From c041503004d66a2031472fa3b13c759dd85a45a5 Mon Sep 17 00:00:00 2001 From: tianmo Date: Thu, 22 Oct 2026 11:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B2=E6=9F=93=E9=A1=BA=E5=BA=8F=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{index-3evwjaUy.js => index-Bvs6zl88.js} | 2 +- dist/assets/index-BwW3PUa0.css | 1 + .../{index-DbmHfkuV.js => index-BxN_H-6_.js} | 2 +- dist/assets/index-CBAQrWSZ.js | 1239 ----------------- dist/assets/index-CjEJ0XJ5.js | 1239 +++++++++++++++++ dist/assets/index-D9S6kMFu.css | 1 - dist/index.html | 4 +- package.json | 1 + scripts/verify-render-layer.mjs | 73 + src/core/particleConfig.ts | 10 + src/core/particleTypes.ts | 9 + src/editor/editorConfig.ts | 5 + src/spine/SpineObjectPanel.vue | 121 +- src/spine/SpineRuntimeLayer.ts | 85 +- src/spine/spineAssetLoader.ts | 14 +- src/spine/spineTypes.ts | 10 + src/store/particleStore.ts | 3 + src/views/Stage.vue | 8 +- .../ParticleAppearanceSection.vue | 78 +- src/views/particle-panel/useParticlePanel.ts | 118 +- src/views/stage/emitterSync.ts | 102 +- src/views/stage/renderLayer.ts | 70 + 22 files changed, 1904 insertions(+), 1291 deletions(-) rename dist/assets/{index-3evwjaUy.js => index-Bvs6zl88.js} (99%) create mode 100644 dist/assets/index-BwW3PUa0.css rename dist/assets/{index-DbmHfkuV.js => index-BxN_H-6_.js} (99%) delete mode 100644 dist/assets/index-CBAQrWSZ.js create mode 100644 dist/assets/index-CjEJ0XJ5.js delete mode 100644 dist/assets/index-D9S6kMFu.css create mode 100644 scripts/verify-render-layer.mjs create mode 100644 src/views/stage/renderLayer.ts diff --git a/dist/assets/index-3evwjaUy.js b/dist/assets/index-Bvs6zl88.js similarity index 99% rename from dist/assets/index-3evwjaUy.js rename to dist/assets/index-Bvs6zl88.js index 2cc0eb8..9b06800 100644 --- a/dist/assets/index-3evwjaUy.js +++ b/dist/assets/index-Bvs6zl88.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-CBAQrWSZ.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-CBAQrWSZ.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-CjEJ0XJ5.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-CjEJ0XJ5.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-BwW3PUa0.css b/dist/assets/index-BwW3PUa0.css new file mode 100644 index 0000000..edd4ccc --- /dev/null +++ b/dist/assets/index-BwW3PUa0.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-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-38dbe6fc]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-38dbe6fc]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-38dbe6fc]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-38dbe6fc]:active{cursor:grabbing}.hud[data-v-38dbe6fc]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-38dbe6fc]{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-38dbe6fc]{width:3ch}.hud-particle-count[data-v-38dbe6fc]{width:7ch;text-align:left}.hud-tip[data-v-38dbe6fc]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-38dbe6fc]{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-3545b078]{display:grid;gap:10px;color:#c5cbe0}.editor-title[data-v-3545b078],.section-title[data-v-3545b078]{color:#dce2f5;font-weight:700}.editor-title[data-v-3545b078]{padding-bottom:9px;border-bottom:1px solid #30394d}.grid[data-v-3545b078]{display:grid;gap:8px}.grid.three[data-v-3545b078]{grid-template-columns:repeat(3,minmax(0,1fr))}.field[data-v-3545b078]{display:grid;gap:5px;min-width:0;color:#919bb7;font-size:12px}.field input[data-v-3545b078],.field select[data-v-3545b078],.asset-name[data-v-3545b078]{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-3545b078]{height:1px;background:#30394d;margin:2px 0}.asset-row[data-v-3545b078]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.asset-name[data-v-3545b078]{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#7f8aa7}button[data-v-3545b078]{height:35px;padding:0 13px;border:1px solid #3b4a67;border-radius:6px;background:#33415b;color:#e2e6f3;cursor:pointer}button[data-v-3545b078]:hover{filter:brightness(1.13)}button[data-v-3545b078]:disabled{opacity:.55;cursor:wait}.folder-select[data-v-3545b078]{width:100%;border-color:#6659c7;background:#4940a8;color:#fff}.folder-hint[data-v-3545b078]{margin-top:-5px;color:#69758e;font-size:10px;line-height:1.45}.asset-actions[data-v-3545b078]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.asset-actions .load[data-v-3545b078]{background:#5543df;border-color:#6959ec}.asset-actions .clear[data-v-3545b078]{background:#702b34;border-color:#803842}.runtime-note[data-v-3545b078]{color:#69758e;font-size:11px;text-align:center}.error[data-v-3545b078]{padding:8px 10px;color:#ffabb2;background:#4b2028;border:1px solid #76323e;border-radius:6px;font-size:12px}.section-box[data-v-3545b078]{display:grid;gap:8px;padding:10px;background:#182132;border:1px solid #303c54;border-radius:7px}.empty[data-v-3545b078]{color:#667187;font-size:12px;padding:5px 0}.bone-tree[data-v-3545b078]{max-height:240px;overflow:auto;padding:4px 0;background:#111827;border-radius:5px}.tree-title-row[data-v-3545b078]{display:flex;align-items:center;justify-content:space-between;gap:8px}.tree-tabs[data-v-3545b078]{display:flex;gap:3px;margin:6px 0}.tree-tabs button[data-v-3545b078]{height:24px;padding:0 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:10px;cursor:pointer}.tree-tabs button[data-v-3545b078]:hover{background:#273246}.tree-tabs button.on[data-v-3545b078]{border-color:#7774ff;background:#35336b;color:#fff}.selected-bone[data-v-3545b078]{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-3545b078]{color:#aeb9d4;background:#242f44;border-color:#35445e;cursor:pointer}.selected-bone.active[data-v-3545b078]:hover{border-color:#675ec4;background:#302b57}.selected-bone[data-v-3545b078]:disabled{opacity:1;cursor:default}.selected-bone strong[data-v-3545b078]{color:#c5cde3;font-weight:600}.tree-action[data-v-3545b078]{height:24px;padding:0 8px;color:#9aa7c2;background:#242f44;border-color:#35445e;font-size:10px}.bone-search[data-v-3545b078]{position:relative}.bone-search input[data-v-3545b078]{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-3545b078]:focus{border-color:#7065df;box-shadow:0 0 0 1px #7065df38}.bone-search button[data-v-3545b078]{position:absolute;top:3px;right:3px;width:24px;height:24px;padding:0;border:0;color:#8d98b0;background:transparent}.bone[data-v-3545b078]{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-3545b078]:hover{background:#45567e38}.bone.selected[data-v-3545b078]{color:#f0edff;background:#6b53dd52;box-shadow:inset 2px 0 #8e72ff}.bone[data-v-3545b078]:focus-visible{box-shadow:inset 0 0 0 1px #7d72dd}.bone-toggle[data-v-3545b078]{width:22px;height:22px;padding:0;border:0;background:transparent;color:#9aa7c2}.bone-toggle[data-v-3545b078]:hover{background:#26324a}.bone-leaf[data-v-3545b078]{display:inline-flex;width:22px;justify-content:center;color:#58647d}.bone-name[data-v-3545b078]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.slot-row[data-v-3545b078]{padding-right:8px}.slot-order[data-v-3545b078]{width:24px;flex:0 0 24px;color:#66758e;font-size:10px;font-variant-numeric:tabular-nums;text-align:right}.slot-attachment[data-v-3545b078]{margin-left:auto;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}@media(max-width:430px){.grid.three[data-v-3545b078]{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-f9eac627]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-f9eac627]{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-f9eac627]:hover{background:#20202e}.group-reset[data-v-f9eac627]{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-f9eac627]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-f9eac627]{padding:8px 10px 12px}.caret[data-v-f9eac627]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-f9eac627]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-f9eac627]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-f9eac627]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-f9eac627]{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-f9eac627]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-f9eac627]{margin-top:10px}.stream-loop-options[data-v-f9eac627]{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-f9eac627]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-f9eac627]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-f9eac627]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-f9eac627]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(12px)}.loop-section-duration[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-f9eac627]{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-f9eac627]:focus{border-color:#716eff}.loop-auto-duration[data-v-f9eac627]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-f9eac627]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-f9eac627]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.seg[data-v-f9eac627]{display:flex;gap:6px;margin:6px 0}.inp.tiny[data-v-f9eac627]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-f9eac627]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-f9eac627]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-f9eac627]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-f9eac627]: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-f9eac627]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(14px)}.modifier-hint[data-v-f9eac627]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-f9eac627]{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-f9eac627]{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-07642cd0]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-07642cd0]{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-07642cd0]:hover{background:#20202e}.group-reset[data-v-07642cd0]{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-07642cd0]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-07642cd0]{padding:8px 10px 12px}.caret[data-v-07642cd0]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-07642cd0]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-07642cd0]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-07642cd0]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-07642cd0]{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-07642cd0]{width:28px;height:22px;border:none;background:none;cursor:pointer}.seg[data-v-07642cd0]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-07642cd0]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.look-title[data-v-07642cd0]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-07642cd0]:first-child{margin-top:2px}.seg[data-v-07642cd0]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-07642cd0]{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-07642cd0]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-wrap[data-v-07642cd0]{margin:6px 0}.curve-labels[data-v-07642cd0]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-07642cd0]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-07642cd0]{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-07642cd0]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-07642cd0]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-07642cd0]{max-width:88px}.resource-color-picker .hex[data-v-07642cd0]{margin-left:0}.random-color-hint[data-v-07642cd0]{margin:-5px 0 9px 68px;color:#66758e;font-size:9px;line-height:1.45}.hex-input[data-v-07642cd0]{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-07642cd0]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-07642cd0]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-07642cd0]{display:flex;gap:3px}.alpha-modes button[data-v-07642cd0]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-07642cd0]:hover{background:#273246}.alpha-modes button.on[data-v-07642cd0]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-07642cd0]{margin-top:7px}.file-input[data-v-07642cd0]{display:none}.hex[data-v-07642cd0]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-07642cd0]{width:46px;flex:0 0 46px;text-align:center}.render-layer-current[data-v-07642cd0]{display:flex;align-items:center;gap:6px;margin:6px 0}.render-layer-text[data-v-07642cd0]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#9aa6c2;font-size:11px}.mini-btn[data-v-07642cd0]{flex:0 0 auto;height:24px;padding:0 7px;border:1px solid #3d4a66;border-radius:5px;background:#202a3e;color:#a9b5cf;font-size:10px;cursor:pointer}.mini-btn[data-v-07642cd0]:hover{border-color:#7774ff;color:#fff}.mini-btn.ghost[data-v-07642cd0]{background:transparent}.slot-picker[data-v-07642cd0]{margin:6px 0;padding:6px;border:1px solid #2e3a52;border-radius:6px;background:#111a28}.slot-list[data-v-07642cd0]{max-height:180px;overflow:auto;margin-top:6px}.slot-item[data-v-07642cd0]{display:flex;align-items:center;gap:6px;width:100%;padding:4px 6px;border:1px solid transparent;border-radius:4px;background:transparent;color:#aab4cc;font-size:11px;text-align:left;cursor:pointer}.slot-item[data-v-07642cd0]:hover{background:#1d2a3f}.slot-item.on[data-v-07642cd0]{border-color:#7774ff;background:#2b2b55;color:#fff}.slot-order[data-v-07642cd0]{width:26px;flex:0 0 26px;color:#66758e;font-variant-numeric:tabular-nums}.slot-name[data-v-07642cd0]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slot-attachment[data-v-07642cd0]{max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}.switch-row[data-v-07642cd0]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-07642cd0]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-07642cd0]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-07642cd0]: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-07642cd0]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-07642cd0]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-07642cd0]{opacity:.45;cursor:not-allowed}.render-layer-switch[data-v-07642cd0]{margin:6px 0}.modifier-hint[data-v-07642cd0]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.render-layer-warning[data-v-07642cd0]{color:#d8a45e}.empty[data-v-96ef634f]{color:#667;font-size:12px;padding:8px 0}.group[data-v-96ef634f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-96ef634f]{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-96ef634f]:hover{background:#20202e}.group-reset[data-v-96ef634f]{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-96ef634f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-96ef634f]{padding:8px 10px 12px}.caret[data-v-96ef634f]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-96ef634f]{height:1px;background:#2a2a3c;margin:8px 0}.field-block[data-v-96ef634f]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-96ef634f]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-96ef634f]{color:#5f6d86;line-height:1.5}.field-grid[data-v-96ef634f]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-96ef634f]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-96ef634f]{width:100%;min-height:30px;box-sizing:border-box}.tag[data-v-96ef634f]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-96ef634f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-96ef634f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-96ef634f]{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-96ef634f]{width:28px;height:22px;border:none;background:none;cursor:pointer}.placeholder[data-v-96ef634f]{color:#667;font-size:11px;padding:6px 0}.image-add[data-v-96ef634f]{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-96ef634f]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-96ef634f]{height:1px;margin:9px 0 7px;background:#2a3549}.hex-input[data-v-96ef634f]{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-96ef634f]:focus{border-color:#7774ff;color:#fff}.alpha-modes[data-v-96ef634f]{display:flex;gap:3px}.alpha-modes button[data-v-96ef634f]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-96ef634f]:hover{background:#273246}.alpha-modes button.on[data-v-96ef634f]{border-color:#7774ff;background:#605df0;color:#fff}.file-input[data-v-96ef634f]{display:none}.hex[data-v-96ef634f]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-96ef634f]{width:46px;flex:0 0 46px;text-align:center}.axis-mode[data-v-96ef634f]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-96ef634f]{border-color:#7774ff;background:#605df0;color:#fff}.switch-row[data-v-96ef634f]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-96ef634f]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-96ef634f]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-96ef634f]: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-96ef634f]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-96ef634f]:after{transform:translate(14px)}.modifier-item[data-v-96ef634f]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.modifier-switch[data-v-96ef634f]{font-weight:600}.modifier-params[data-v-96ef634f]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-96ef634f]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-96ef634f]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-96ef634f]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-96ef634f]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-96ef634f]{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-96ef634f]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-96ef634f]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-96ef634f]{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-96ef634f]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-96ef634f]{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-96ef634f]:hover,.collision-filter-add.active[data-v-96ef634f]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-96ef634f]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-96ef634f]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-96ef634f]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-96ef634f]{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-96ef634f]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-96ef634f]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-96ef634f]{flex:none;color:#68758d;font-size:9px}.switch-row input:disabled+.switch-ui[data-v-96ef634f]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-96ef634f]{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-96ef634f]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-96ef634f]{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-96ef634f]{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-96ef634f]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-96ef634f]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-96ef634f]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-96ef634f]{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-96ef634f]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-96ef634f]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-96ef634f] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-96ef634f]{padding-right:2px}.trail-section-title[data-v-96ef634f]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-fixed-color .hex-input[data-v-96ef634f]{min-width:0;flex:1}.trail-mode-head[data-v-96ef634f]{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-96ef634f]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-96ef634f]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-96ef634f] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-96ef634f] .ns-label{width:100%}.trail-grid-row[data-v-96ef634f] .ns-range{min-width:0}.trail-grid-row[data-v-96ef634f] .ns-num{width:42px}.trail-params[data-v-96ef634f] .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-1e581e89]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-1e581e89]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-1e581e89]{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-1e581e89]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-range[data-v-1e581e89]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-1e581e89]{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-1e581e89]:focus{border-color:#716eff}.tl-loop-range[data-v-1e581e89]{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-1e581e89]:hover{border-color:#716eff;color:#fff}.tl-frame[data-v-1e581e89]{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-1e581e89]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-1e581e89]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-1e581e89]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-1e581e89]{margin-left:4px;background:#2f8b62}.legend-life[data-v-1e581e89]{margin-left:5px;background:#a54551}.legend-spine[data-v-1e581e89]{margin-left:5px;background:#7448b8}.tl-anim[data-v-1e581e89]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-1e581e89]{position:relative}.tl-animation-trigger[data-v-1e581e89]{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-1e581e89]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-1e581e89]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-1e581e89]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-1e581e89]{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-1e581e89]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-1e581e89]{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-1e581e89]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-1e581e89]:hover{background:#252e42}.tl-animation-option.on[data-v-1e581e89]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-1e581e89]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-1e581e89]{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-1e581e89]{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-1e581e89]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-1e581e89],.tl-animation-actions button[data-v-1e581e89]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-1e581e89]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-1e581e89]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-1e581e89]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-1e581e89]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-1e581e89]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-1e581e89]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-1e581e89]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-1e581e89]{max-width:190px}.tl-zoom[data-v-1e581e89]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-1e581e89]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-1e581e89]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-1e581e89]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-1e581e89]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-1e581e89]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-1e581e89]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-1e581e89]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-1e581e89]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-bar[data-v-1e581e89]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-1e581e89]:active{cursor:grabbing}.lane-name[data-v-1e581e89]{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-1e581e89]{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-1e581e89]{border-color:#667085;background:#242b39}.bar-emission[data-v-1e581e89]{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-1e581e89]{border-radius:0}.bar-loop-transition[data-v-1e581e89]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-1e581e89]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-1e581e89]{border-radius:0 5px 5px 0}.bar-handle[data-v-1e581e89]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-1e581e89]:hover{background:#ffffff59}.spine-ico[data-v-1e581e89]{color:#c08cff}.spine-bar[data-v-1e581e89]{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-1e581e89]:active{cursor:grabbing}.tl-empty[data-v-1e581e89]{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}html,body,#app{-webkit-user-select:none;user-select:none}input,textarea,select,[contenteditable=true]{-webkit-user-select:text;user-select:text}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-DbmHfkuV.js b/dist/assets/index-BxN_H-6_.js similarity index 99% rename from dist/assets/index-DbmHfkuV.js rename to dist/assets/index-BxN_H-6_.js index 87ea175..bde02e6 100644 --- a/dist/assets/index-DbmHfkuV.js +++ b/dist/assets/index-BxN_H-6_.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-CBAQrWSZ.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-CBAQrWSZ.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-3evwjaUy.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-3evwjaUy.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-CjEJ0XJ5.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-CjEJ0XJ5.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-Bvs6zl88.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-Bvs6zl88.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-CBAQrWSZ.js b/dist/assets/index-CBAQrWSZ.js deleted file mode 100644 index 5540dd6..0000000 --- a/dist/assets/index-CBAQrWSZ.js +++ /dev/null @@ -1,1239 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DbmHfkuV.js","assets/index-3evwjaUy.js"])))=>i.map(i=>d[i]); -var SS=Object.defineProperty;var TS=(s,e,t)=>e in s?SS(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var w=(s,e,t)=>TS(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 -* @license MIT -**/function km(s){const e=Object.create(null);for(const t of s.split(","))e[t]=1;return t=>t in e}const Ft={},No=[],on=()=>{},ax=()=>!1,Rh=s=>s.charCodeAt(0)===111&&s.charCodeAt(1)===110&&(s.charCodeAt(2)>122||s.charCodeAt(2)<97),Ph=s=>s.startsWith("onUpdate:"),fi=Object.assign,Fm=(s,e)=>{const t=s.indexOf(e);t>-1&&s.splice(t,1)},MS=Object.prototype.hasOwnProperty,Et=(s,e)=>MS.call(s,e),je=Array.isArray,Uo=s=>pl(s)==="[object Map]",aa=s=>pl(s)==="[object Set]",Cp=s=>pl(s)==="[object Date]",st=s=>typeof s=="function",Wt=s=>typeof s=="string",ss=s=>typeof s=="symbol",It=s=>s!==null&&typeof s=="object",lx=s=>(It(s)||st(s))&&st(s.then)&&st(s.catch),cx=Object.prototype.toString,pl=s=>cx.call(s),_S=s=>pl(s).slice(8,-1),hx=s=>pl(s)==="[object Object]",kh=s=>Wt(s)&&s!=="NaN"&&s[0]!=="-"&&""+parseInt(s,10)===s,Na=km(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Fh=s=>{const e=Object.create(null);return(t=>e[t]||(e[t]=s(t)))},CS=/-\w/g,As=Fh(s=>s.replace(CS,e=>e.slice(1).toUpperCase())),AS=/\B([A-Z])/g,wr=Fh(s=>s.replace(AS,"-$1").toLowerCase()),ux=Fh(s=>s.charAt(0).toUpperCase()+s.slice(1)),fu=Fh(s=>s?`on${ux(s)}`:""),Qs=(s,e)=>!Object.is(s,e),pc=(s,...e)=>{for(let t=0;t{Object.defineProperty(s,e,{configurable:!0,enumerable:!1,writable:i,value:t})},Oh=s=>{const e=parseFloat(s);return isNaN(e)?s:e},ES=s=>{const e=Wt(s)?Number(s):NaN;return isNaN(e)?s:e};let Ap;const Bh=()=>Ap||(Ap=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function gi(s){if(je(s)){const e={};for(let t=0;t{if(t){const i=t.split(RS);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Be(s){let e="";if(Wt(s))e=s;else if(je(s))for(let t=0;tla(t,e))}const mx=s=>!!(s&&s.__v_isRef===!0),Me=s=>Wt(s)?s:s==null?"":je(s)||It(s)&&(s.toString===cx||!st(s.toString))?mx(s)?Me(s.value):JSON.stringify(s,px,2):String(s),px=(s,e)=>mx(e)?px(s,e.value):Uo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,n],r)=>(t[mu(i,r)+" =>"]=n,t),{})}:aa(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>mu(t))}:ss(e)?mu(e):It(e)&&!je(e)&&!hx(e)?String(e):e,mu=(s,e="")=>{var t;return ss(s)?`Symbol(${(t=s.description)!=null?t:e})`:s};/** -* @vue/reactivity v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let hi;class gx{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&hi&&(hi.active?(this.parent=hi,this.index=(hi.scopes||(hi.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){const i=this.scopes.slice();for(e=0,t=i.length;e0&&--this._on===0){if(hi===this)hi=this.prevScope;else{let e=hi;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t0)return;if($a){let e=$a;for($a=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let s;for(;Ua;){let e=Ua;for(Ua=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){s||(s=i)}e=t}}if(s)throw s}function Sx(s){for(let e=s.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Tx(s){let e,t=s.depsTail,i=t;for(;i;){const n=i.prevDep;i.version===-1?(i===t&&(t=n),Dm(i),DS(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=n}s.deps=e,s.depsTail=t}function af(s){for(let e=s.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Mx(e.dep.computed)||e.dep.version!==e.version))return!0;return!!s._dirty}function Mx(s){if(s.flags&4&&!(s.flags&16)||(s.flags&=-17,s.globalVersion===Ja)||(s.globalVersion=Ja,!s.isSSR&&s.flags&128&&(!s.deps&&!s._dirty||!af(s))))return;s.flags|=2;const e=s.dep,t=Dt,i=Es;Dt=s,Es=!0;try{Sx(s);const n=s.fn(s._value);(e.version===0||Qs(n,s._value))&&(s.flags|=128,s._value=n,e.version++)}catch(n){throw e.version++,n}finally{Dt=t,Es=i,Tx(s),s.flags&=-3}}function Dm(s,e=!1){const{dep:t,prevSub:i,nextSub:n}=s;if(i&&(i.nextSub=n,s.prevSub=void 0),n&&(n.prevSub=i,s.nextSub=void 0),t.subs===s&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)Dm(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function DS(s){const{prevDep:e,nextDep:t}=s;e&&(e.nextDep=t,s.prevDep=void 0),t&&(t.prevDep=e,s.nextDep=void 0)}let Es=!0;const _x=[];function Nn(){_x.push(Es),Es=!1}function Un(){const s=_x.pop();Es=s===void 0?!0:s}function Ep(s){const{cleanup:e}=s;if(s.cleanup=void 0,e){const t=Dt;Dt=void 0;try{e()}finally{Dt=t}}}let Ja=0;class NS{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Nm{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Dt||!Es||Dt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Dt)t=this.activeLink=new NS(Dt,this),Dt.deps?(t.prevDep=Dt.depsTail,Dt.depsTail.nextDep=t,Dt.depsTail=t):Dt.deps=Dt.depsTail=t,Cx(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Dt.depsTail,t.nextDep=void 0,Dt.depsTail.nextDep=t,Dt.depsTail=t,Dt.deps===t&&(Dt.deps=i)}return t}trigger(e){this.version++,Ja++,this.notify(e)}notify(e){Bm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Lm()}}}function Cx(s){if(s.dep.sc++,s.sub.flags&4){const e=s.dep.computed;if(e&&!s.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)Cx(i)}const t=s.dep.subs;t!==s&&(s.prevSub=t,t&&(t.nextSub=s)),s.dep.subs=s}}const Fc=new WeakMap,Zr=Symbol(""),lf=Symbol(""),Qa=Symbol("");function Pi(s,e,t){if(Es&&Dt){let i=Fc.get(s);i||Fc.set(s,i=new Map);let n=i.get(t);n||(i.set(t,n=new Nm),n.map=i,n.key=t),n.track()}}function _n(s,e,t,i,n,r){const o=Fc.get(s);if(!o){Ja++;return}const a=c=>{c&&c.trigger()};if(Bm(),e==="clear")o.forEach(a);else{const c=je(s),l=c&&kh(t);if(c&&t==="length"){const h=Number(i);o.forEach((u,d)=>{(d==="length"||d===Qa||!ss(d)&&d>=h)&&a(u)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),l&&a(o.get(Qa)),e){case"add":c?l&&a(o.get("length")):(a(o.get(Zr)),Uo(s)&&a(o.get(lf)));break;case"delete":c||(a(o.get(Zr)),Uo(s)&&a(o.get(lf)));break;case"set":Uo(s)&&a(o.get(Zr));break}}Lm()}function US(s,e){const t=Fc.get(s);return t&&t.get(e)}function xo(s){const e=yt(s);return e===s?e:(Pi(e,"iterate",Qa),is(s)?e:e.map(Fs))}function Lh(s){return Pi(s=yt(s),"iterate",Qa),s}function qs(s,e){return $n(s)?Qo(Bn(s)?Fs(e):e):Fs(e)}const $S={__proto__:null,[Symbol.iterator](){return gu(this,Symbol.iterator,s=>qs(this,s))},concat(...s){return xo(this).concat(...s.map(e=>je(e)?xo(e):e))},entries(){return gu(this,"entries",s=>(s[1]=qs(this,s[1]),s))},every(s,e){return mn(this,"every",s,e,void 0,arguments)},filter(s,e){return mn(this,"filter",s,e,t=>t.map(i=>qs(this,i)),arguments)},find(s,e){return mn(this,"find",s,e,t=>qs(this,t),arguments)},findIndex(s,e){return mn(this,"findIndex",s,e,void 0,arguments)},findLast(s,e){return mn(this,"findLast",s,e,t=>qs(this,t),arguments)},findLastIndex(s,e){return mn(this,"findLastIndex",s,e,void 0,arguments)},forEach(s,e){return mn(this,"forEach",s,e,void 0,arguments)},includes(...s){return vu(this,"includes",s)},indexOf(...s){return vu(this,"indexOf",s)},join(s){return xo(this).join(s)},lastIndexOf(...s){return vu(this,"lastIndexOf",s)},map(s,e){return mn(this,"map",s,e,void 0,arguments)},pop(){return va(this,"pop")},push(...s){return va(this,"push",s)},reduce(s,...e){return Ip(this,"reduce",s,e)},reduceRight(s,...e){return Ip(this,"reduceRight",s,e)},shift(){return va(this,"shift")},some(s,e){return mn(this,"some",s,e,void 0,arguments)},splice(...s){return va(this,"splice",s)},toReversed(){return xo(this).toReversed()},toSorted(s){return xo(this).toSorted(s)},toSpliced(...s){return xo(this).toSpliced(...s)},unshift(...s){return va(this,"unshift",s)},values(){return gu(this,"values",s=>qs(this,s))}};function gu(s,e,t){const i=Lh(s),n=i[e]();return i!==s&&!is(s)&&(n._next=n.next,n.next=()=>{const r=n._next();return r.done||(r.value=t(r.value)),r}),n}const XS=Array.prototype;function mn(s,e,t,i,n,r){const o=Lh(s),a=o!==s&&!is(s),c=o[e];if(c!==XS[e]){const u=c.apply(s,r);return a?Fs(u):u}let l=t;o!==s&&(a?l=function(u,d){return t.call(this,qs(s,u),d,s)}:t.length>2&&(l=function(u,d){return t.call(this,u,d,s)}));const h=c.call(o,l,i);return a&&n?n(h):h}function Ip(s,e,t,i){const n=Lh(s),r=n!==s&&!is(s);let o=t,a=!1;n!==s&&(r?(a=i.length===0,o=function(l,h,u){return a&&(a=!1,l=qs(s,l)),t.call(this,l,qs(s,h),u,s)}):t.length>3&&(o=function(l,h,u){return t.call(this,l,h,u,s)}));const c=n[e](o,...i);return a?qs(s,c):c}function vu(s,e,t){const i=yt(s);Pi(i,"iterate",Qa);const n=i[e](...t);return(n===-1||n===!1)&&Dh(t[0])?(t[0]=yt(t[0]),i[e](...t)):n}function va(s,e,t=[]){Nn(),Bm();const i=yt(s)[e].apply(s,t);return Lm(),Un(),i}const VS=km("__proto__,__v_isRef,__isVue"),Ax=new Set(Object.getOwnPropertyNames(Symbol).filter(s=>s!=="arguments"&&s!=="caller").map(s=>Symbol[s]).filter(ss));function YS(s){ss(s)||(s=String(s));const e=yt(this);return Pi(e,"has",s),e.hasOwnProperty(s)}class Ex{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const n=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!n;if(t==="__v_isReadonly")return n;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(n?r?QS:kx:r?Px:Rx).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=je(e);if(!n){let c;if(o&&(c=$S[t]))return c;if(t==="hasOwnProperty")return YS}const a=Reflect.get(e,t,zt(e)?e:i);if((ss(t)?Ax.has(t):VS(t))||(n||Pi(e,"get",t),r))return a;if(zt(a)){const c=o&&kh(t)?a:a.value;return n&&It(c)?hf(c):c}return It(a)?n?hf(a):co(a):a}}class Ix extends Ex{constructor(e=!1){super(!1,e)}set(e,t,i,n){let r=e[t];const o=je(e)&&kh(t);if(!this._isShallow){const l=$n(r);if(!is(i)&&!$n(i)&&(r=yt(r),i=yt(i)),!o&&zt(r)&&!zt(i))return l||(r.value=i),!0}const a=o?Number(t)s,kl=s=>Reflect.getPrototypeOf(s);function zS(s,e,t){return function(...i){const n=this.__v_raw,r=yt(n),o=Uo(r),a=s==="entries"||s===Symbol.iterator&&o,c=s==="keys"&&o,l=n[s](...i),h=t?cf:e?Qo:Fs;return!e&&Pi(r,"iterate",c?lf:Zr),fi(Object.create(l),{next(){const{value:u,done:d}=l.next();return d?{value:u,done:d}:{value:a?[h(u[0]),h(u[1])]:h(u),done:d}}})}}function Fl(s){return function(...e){return s==="delete"?!1:s==="clear"?void 0:this}}function qS(s,e){const t={get(n){const r=this.__v_raw,o=yt(r),a=yt(n);s||(Qs(n,a)&&Pi(o,"get",n),Pi(o,"get",a));const{has:c}=kl(o),l=e?cf:s?Qo:Fs;if(c.call(o,n))return l(r.get(n));if(c.call(o,a))return l(r.get(a));r!==o&&r.get(n)},get size(){const n=this.__v_raw;return!s&&Pi(yt(n),"iterate",Zr),n.size},has(n){const r=this.__v_raw,o=yt(r),a=yt(n);return s||(Qs(n,a)&&Pi(o,"has",n),Pi(o,"has",a)),n===a?r.has(n):r.has(n)||r.has(a)},forEach(n,r){const o=this,a=o.__v_raw,c=yt(a),l=e?cf:s?Qo:Fs;return!s&&Pi(c,"iterate",Zr),a.forEach((h,u)=>n.call(r,l(h),l(u),o))}};return fi(t,s?{add:Fl("add"),set:Fl("set"),delete:Fl("delete"),clear:Fl("clear")}:{add(n){const r=yt(this),o=kl(r),a=yt(n),c=!e&&!is(n)&&!$n(n)?a:n;return o.has.call(r,c)||Qs(n,c)&&o.has.call(r,n)||Qs(a,c)&&o.has.call(r,a)||(r.add(c),_n(r,"add",c,c)),this},set(n,r){!e&&!is(r)&&!$n(r)&&(r=yt(r));const o=yt(this),{has:a,get:c}=kl(o);let l=a.call(o,n);l||(n=yt(n),l=a.call(o,n));const h=c.call(o,n);return o.set(n,r),l?Qs(r,h)&&_n(o,"set",n,r):_n(o,"add",n,r),this},delete(n){const r=yt(this),{has:o,get:a}=kl(r);let c=o.call(r,n);c||(n=yt(n),c=o.call(r,n)),a&&a.call(r,n);const l=r.delete(n);return c&&_n(r,"delete",n,void 0),l},clear(){const n=yt(this),r=n.size!==0,o=n.clear();return r&&_n(n,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=zS(n,s,e)}),t}function Um(s,e){const t=qS(s,e);return(i,n,r)=>n==="__v_isReactive"?!s:n==="__v_isReadonly"?s:n==="__v_raw"?i:Reflect.get(Et(t,n)&&n in i?t:i,n,r)}const KS={get:Um(!1,!1)},ZS={get:Um(!1,!0)},JS={get:Um(!0,!1)};const Rx=new WeakMap,Px=new WeakMap,kx=new WeakMap,QS=new WeakMap;function eT(s){switch(s){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function co(s){return $n(s)?s:$m(s,!1,HS,KS,Rx)}function tT(s){return $m(s,!1,WS,ZS,Px)}function hf(s){return $m(s,!0,jS,JS,kx)}function $m(s,e,t,i,n){if(!It(s)||s.__v_raw&&!(e&&s.__v_isReactive)||s.__v_skip||!Object.isExtensible(s))return s;const r=n.get(s);if(r)return r;const o=eT(_S(s));if(o===0)return s;const a=new Proxy(s,o===2?i:t);return n.set(s,a),a}function Bn(s){return $n(s)?Bn(s.__v_raw):!!(s&&s.__v_isReactive)}function $n(s){return!!(s&&s.__v_isReadonly)}function is(s){return!!(s&&s.__v_isShallow)}function Dh(s){return s?!!s.__v_raw:!1}function yt(s){const e=s&&s.__v_raw;return e?yt(e):s}function lr(s){return!Et(s,"__v_skip")&&Object.isExtensible(s)&&dx(s,"__v_skip",!0),s}const Fs=s=>It(s)?co(s):s,Qo=s=>It(s)?hf(s):s;function zt(s){return s?s.__v_isRef===!0:!1}function Ye(s){return iT(s,!1)}function iT(s,e){return zt(s)?s:new sT(s,e)}class sT{constructor(e,t){this.dep=new Nm,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:yt(e),this._value=t?e:Fs(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||is(e)||$n(e);e=i?e:yt(e),Qs(e,t)&&(this._rawValue=e,this._value=i?e:Fs(e),this.dep.trigger())}}function R(s){return zt(s)?s.value:s}const nT={get:(s,e,t)=>e==="__v_raw"?s:R(Reflect.get(s,e,t)),set:(s,e,t,i)=>{const n=s[e];return zt(n)&&!zt(t)?(n.value=t,!0):Reflect.set(s,e,t,i)}};function Fx(s){return Bn(s)?s:new Proxy(s,nT)}function rT(s){const e=je(s)?new Array(s.length):{};for(const t in s)e[t]=aT(s,t);return e}class oT{constructor(e,t,i){this._object=e,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=ss(t)?t:String(t),this._raw=yt(e);let n=!0,r=e;if(!je(e)||ss(this._key)||!kh(this._key))do n=!Dh(r)||is(r);while(n&&(r=r.__v_raw));this._shallow=n}get value(){let e=this._object[this._key];return this._shallow&&(e=R(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&zt(this._raw[this._key])){const t=this._object[this._key];if(zt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return US(this._raw,this._key)}}function aT(s,e,t){return new oT(s,e,t)}class lT{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Nm(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ja-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Dt!==this)return wx(this,!0),!0}get value(){const e=this.dep.track();return Mx(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function cT(s,e,t=!1){let i,n;return st(s)?i=s:(i=s.get,n=s.set),new lT(i,n,t)}const Ol={},Oc=new WeakMap;let Lr;function hT(s,e=!1,t=Lr){if(t){let i=Oc.get(t);i||Oc.set(t,i=[]),i.push(s)}}function uT(s,e,t=Ft){const{immediate:i,deep:n,once:r,scheduler:o,augmentJob:a,call:c}=t,l=T=>n?T:is(T)||n===!1||n===0?Cn(T,1):Cn(T);let h,u,d,f,p=!1,m=!1;if(zt(s)?(u=()=>s.value,p=is(s)):Bn(s)?(u=()=>l(s),p=!0):je(s)?(m=!0,p=s.some(T=>Bn(T)||is(T)),u=()=>s.map(T=>{if(zt(T))return T.value;if(Bn(T))return l(T);if(st(T))return c?c(T,2):T()})):st(s)?e?u=c?()=>c(s,2):s:u=()=>{if(d){Nn();try{d()}finally{Un()}}const T=Lr;Lr=h;try{return c?c(s,3,[f]):s(f)}finally{Lr=T}}:u=on,e&&n){const T=u,A=n===!0?1/0:n;u=()=>Cn(T(),A)}const g=xx(),v=()=>{h.stop(),g&&g.active&&Fm(g.effects,h)};if(r&&e){const T=e;e=(...A)=>{const S=T(...A);return v(),S}}let y=m?new Array(s.length).fill(Ol):Ol;const x=T=>{if(!(!(h.flags&1)||!h.dirty&&!T))if(e){const A=h.run();if(T||n||p||(m?A.some((S,b)=>Qs(S,y[b])):Qs(A,y))){d&&d();const S=Lr;Lr=h;try{const b=[A,y===Ol?void 0:m&&y[0]===Ol?[]:y,f];y=A,c?c(e,3,b):e(...b)}finally{Lr=S}}}else h.run()};return a&&a(x),h=new yx(u),h.scheduler=o?()=>o(x,!1):x,f=T=>hT(T,!1,h),d=h.onStop=()=>{const T=Oc.get(h);if(T){if(c)c(T,4);else for(const A of T)A();Oc.delete(h)}},e?i?x(!0):y=h.run():o?o(x.bind(null,!0),!0):h.run(),v.pause=h.pause.bind(h),v.resume=h.resume.bind(h),v.stop=v,v}function Cn(s,e=1/0,t){if(e<=0||!It(s)||s.__v_skip||(t=t||new Map,(t.get(s)||0)>=e))return s;if(t.set(s,e),e--,zt(s))Cn(s.value,e,t);else if(je(s))for(let i=0;i{Cn(i,e,t)});else if(hx(s)){for(const i in s)Cn(s[i],e,t);for(const i of Object.getOwnPropertySymbols(s))Object.prototype.propertyIsEnumerable.call(s,i)&&Cn(s[i],e,t)}return s}/** -* @vue/runtime-core v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function gl(s,e,t,i){try{return i?s(...i):s()}catch(n){Nh(n,e,t)}}function ps(s,e,t,i){if(st(s)){const n=gl(s,e,t,i);return n&&lx(n)&&n.catch(r=>{Nh(r,e,t)}),n}if(je(s)){const n=[];for(let r=0;r>>1,n=Ni[i],r=el(n);r=el(t)?Ni.push(s):Ni.splice(fT(e),0,s),s.flags|=1,Bx()}}function Bx(){Bc||(Bc=Ox.then(Dx))}function mT(s){if(!je(s))Qn&&s.id===-1?Qn.splice(Ao+1,0,s):s.flags&1||($o.push(s),s.flags|=1);else for(let e=0;eel(t)-el(i));if($o.length=0,Qn){for(let t=0;ts.id==null?s.flags&2?-1:1/0:s.id;function Dx(s){try{for(Gs=0;Gs{i._d&&$c(-1);const r=Lc(e),o=Ln.length;let a;try{a=s(...n)}finally{for(let c=Ln.length;c>o;c--)Hm();Lc(r),i._d&&$c(1)}return a};return i._n=!0,i._c=!0,i._d=!0,i}function le(s,e){if(Oi===null)return s;const t=jh(Oi),i=s.dirs||(s.dirs=[]);for(let n=0;n1)return t&&st(e)?e.call(i&&i.proxy):e}}function pT(){return!!(jm()||Jr)}const gT=Symbol.for("v-scx"),vT=()=>Xo(gT);function Aa(s,e){return Vm(s,null,e)}function Yi(s,e,t){return Vm(s,e,t)}function Vm(s,e,t=Ft){const{immediate:i,deep:n,flush:r,once:o}=t,a=fi({},t),c=e&&i||!e&&r!=="post";let l;if(rl){if(r==="sync"){const f=vT();l=f.__watcherHandles||(f.__watcherHandles=[])}else if(!c){const f=()=>{};return f.stop=on,f.resume=on,f.pause=on,f}}const h=Ui;a.call=(f,p,m)=>ps(f,h,p,m);let u=!1;r==="post"?a.scheduler=f=>{Hi(f,h&&h.suspense)}:r!=="sync"&&(u=!0,a.scheduler=(f,p)=>{p?f():Xm(f)}),a.augmentJob=f=>{e&&(f.flags|=4),u&&(f.flags|=2,h&&(f.id=h.uid,f.i=h))};const d=uT(s,e,a);return rl&&(l?l.push(d):c&&d()),d}function xT(s,e,t){const i=this.proxy,n=Wt(s)?s.includes(".")?$x(i,s):()=>i[s]:s.bind(i,i);let r;st(e)?r=e:(r=e.handler,t=e);const o=yl(this),a=Vm(n,r.bind(i),t);return o(),a}function $x(s,e){const t=e.split(".");return()=>{let i=s;for(let n=0;ns.__isTeleport,hs=Symbol("_leaveCb"),xa=Symbol("_enterCb");function bT(){const s={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return jn(()=>{s.isMounted=!0}),vl(()=>{s.isUnmounting=!0}),s}const os=[Function,Array],Xx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:os,onEnter:os,onAfterEnter:os,onEnterCancelled:os,onBeforeLeave:os,onLeave:os,onAfterLeave:os,onLeaveCancelled:os,onBeforeAppear:os,onAppear:os,onAfterAppear:os,onAppearCancelled:os},Vx=s=>{const e=s.subTree;return e.component?Vx(e.component):e},wT={name:"BaseTransition",props:Xx,setup(s,{slots:e}){const t=jm(),i=bT();return()=>{const n=e.default&&Hx(e.default(),!0),r=n&&n.length?Yx(n):t.subTree?Te():void 0;if(!r)return;const o=yt(s),{mode:a}=o;if(i.isLeaving)return xu(r);const c=Dc(r);if(!c)return xu(r);let l=uf(c,o,i,t,u=>l=u);c.type!==Fi&&tl(c,l);let h=t.subTree&&Dc(t.subTree);if(h&&h.type!==Fi&&!Vr(h,c)&&Vx(t).type!==Fi){let u=uf(h,o,i,t);if(tl(h,u),a==="out-in"&&c.type!==Fi)return i.isLeaving=!0,u.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete u.afterLeave,h=void 0},xu(r);a==="in-out"&&c.type!==Fi?u.delayLeave=(d,f,p)=>{const m=Gx(i,h);m[String(h.key)]=h,d[hs]=()=>{f(),d[hs]=void 0,delete l.delayedLeave,h=void 0},l.delayedLeave=()=>{p(),delete l.delayedLeave,h=void 0}}:h=void 0}else h&&(h=void 0);return r}}};function Yx(s){let e=s[0];if(s.length>1){for(const t of s)if(t.type!==Fi){e=t;break}}return e}const ST=wT;function Gx(s,e){const{leavingVNodes:t}=s;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function uf(s,e,t,i,n){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:h,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:g,onAppear:v,onAfterAppear:y,onAppearCancelled:x}=e,T=String(s.key),A=Gx(t,s),S=(I,F)=>{I&&ps(I,i,9,F)},b=(I,F)=>{const E=F[1];S(I,F),je(I)?I.every(k=>k.length<=1)&&E():I.length<=1&&E()},_={mode:o,persisted:a,beforeEnter(I){let F=c;if(!t.isMounted)if(r)F=g||c;else return;I[hs]&&I[hs](!0);const E=A[T];E&&Vr(s,E)&&E.el[hs]&&E.el[hs](),S(F,[I])},enter(I){if(A[T]===s)return;let F=l,E=h,k=u;if(!t.isMounted)if(r)F=v||l,E=y||h,k=x||u;else return;let B=!1;I[xa]=$=>{B||(B=!0,$?S(k,[I]):S(E,[I]),_.delayedLeave&&_.delayedLeave(),I[xa]=void 0)};const N=I[xa].bind(null,!1);F?b(F,[I,N]):N()},leave(I,F){const E=String(s.key);if(I[xa]&&I[xa](!0),t.isUnmounting)return F();S(d,[I]);let k=!1;I[hs]=N=>{k||(k=!0,F(),N?S(m,[I]):S(p,[I]),I[hs]=void 0,A[E]===s&&delete A[E])};const B=I[hs].bind(null,!1);A[E]=s,f?b(f,[I,B]):B()},clone(I){const F=uf(I,e,t,i,n);return n&&n(F),F}};return _}function xu(s){if(Vh(s))return s=vr(s),s.children=null,s}function Dc(s){if(!Vh(s))return Xh(s.type)&&s.children?Yx(s.children):s;if(s.component)return s.component.subTree;const{shapeFlag:e,children:t}=s;if(t){if(e&16)return t[0];if(e&32&&st(t.default))return t.default()}}function tl(s,e){if(s.shapeFlag&6&&s.component){s.transition=e;const t=s.component.subTree;tl(Xh(t.type)&&Dc(t)||t,e)}else s.shapeFlag&128?(s.ssContent.transition=e.clone(s.ssContent),s.ssFallback.transition=e.clone(s.ssFallback)):s.transition=e}function Hx(s,e=!1,t){let i=[],n=0;for(let r=0;r1)for(let r=0;rXa(m,e&&(je(e)?e[g]:e),t,i,n));return}if(Vo(i)&&!n){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Xa(s,e,t,i.component.subTree);return}const r=i.shapeFlag&4?jh(i.component):i.el,o=n?null:r,{i:a,r:c}=s,l=e&&e.r,h=a.refs===Ft?a.refs={}:a.refs,u=a.setupState,d=yt(u),f=u===Ft?ax:m=>Pp(h,m)?!1:Et(d,m),p=(m,g)=>!(g&&Pp(h,g));if(l!=null&&l!==c){if(kp(e),Wt(l))h[l]=null,f(l)&&(u[l]=null);else if(zt(l)){const m=e;p(l,m.k)&&(l.value=null),m.k&&(h[m.k]=null)}}if(st(c))gl(c,a,12,[o,h]);else{const m=Wt(c),g=zt(c);if(m||g){const v=()=>{if(s.f){const y=m?f(c)?u[c]:h[c]:p()||!s.k?c.value:h[s.k];if(n)je(y)&&Fm(y,r);else if(je(y))y.includes(r)||y.push(r);else if(m)h[c]=[r],f(c)&&(u[c]=h[c]);else{const x=[r];p(c,s.k)&&(c.value=x),s.k&&(h[s.k]=x)}}else m?(h[c]=o,f(c)&&(u[c]=o)):g&&(p(c,s.k)&&(c.value=o),s.k&&(h[s.k]=o))};if(o){const y=()=>{v(),Nc.delete(s)};y.id=-1,Nc.set(s,y),Hi(y,t)}else kp(s),v()}}}function kp(s){const e=Nc.get(s);e&&(e.flags|=8,Nc.delete(s))}Bh().requestIdleCallback;Bh().cancelIdleCallback;const Vo=s=>!!s.type.__asyncLoader,Vh=s=>s.type.__isKeepAlive;function TT(s,e){Wx(s,"a",e)}function MT(s,e){Wx(s,"da",e)}function Wx(s,e,t=Ui){const i=s.__wdc||(s.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return s()});if(Yh(e,i,t),t){let n=t.parent;for(;n&&n.parent;)Vh(n.parent.vnode)&&_T(i,e,t,n),n=n.parent}}function _T(s,e,t,i){const n=Yh(e,s,i,!0);xl(()=>{Fm(i[e],n)},t)}function Yh(s,e,t=Ui,i=!1){if(t){const n=t[s]||(t[s]=[]),r=e.__weh||(e.__weh=(...o)=>{Nn();const a=yl(t),c=ps(e,t,s,o);return a(),Un(),c});return i?n.unshift(r):n.push(r),r}}const Hn=s=>(e,t=Ui)=>{(!rl||s==="sp")&&Yh(s,(...i)=>e(...i),t)},CT=Hn("bm"),jn=Hn("m"),AT=Hn("bu"),ET=Hn("u"),vl=Hn("bum"),xl=Hn("um"),IT=Hn("sp"),RT=Hn("rtg"),PT=Hn("rtc");function kT(s,e=Ui){Yh("ec",s,e)}const FT=Symbol.for("v-ndc");function $t(s,e,t,i){let n;const r=t,o=je(s);if(o||Wt(s)){const a=o&&Bn(s);let c=!1,l=!1;a&&(c=!is(s),l=$n(s),s=Lh(s)),n=new Array(s.length);for(let h=0,u=s.length;he(a,c,void 0,r));else{const a=Object.keys(s);n=new Array(a.length);for(let c=0,l=a.length;c0;return K(),Pt(Fe,null,[ye("slot",l,i)],h?-2:64)}let o=s[e];o&&o._c&&(o._d=!1);const a=Ln.length;K();let c;try{const l=o&&zx(o(t)),h=t.key||r||l&&l.key;c=Pt(Fe,{key:(h&&!ss(h)?h:`_${e}`)+(!l&&i?"_fb":"")},l||(i?i():[]),l&&s._===1?64:-2)}catch(l){for(let h=Ln.length;h>a;h--)Hm();throw l}finally{o&&o._c&&(o._d=!0)}return c}function zx(s){return s.some(e=>sl(e)?!(e.type===Fi||e.type===Fe&&!zx(e.children)):!0)?s:null}const df=s=>s?my(s)?jh(s):df(s.parent):null,Va=fi(Object.create(null),{$:s=>s,$el:s=>s.vnode.el,$data:s=>s.data,$props:s=>s.props,$attrs:s=>s.attrs,$slots:s=>s.slots,$refs:s=>s.refs,$parent:s=>df(s.parent),$root:s=>df(s.root),$host:s=>s.ce,$emit:s=>s.emit,$options:s=>Kx(s),$forceUpdate:s=>s.f||(s.f=()=>{Xm(s.update)}),$nextTick:s=>s.n||(s.n=Uh.bind(s.proxy)),$watch:s=>xT.bind(s)}),yu=(s,e)=>s!==Ft&&!s.__isScriptSetup&&Et(s,e),BT={get({_:s},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:n,props:r,accessCache:o,type:a,appContext:c}=s;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return i[e];case 2:return n[e];case 4:return t[e];case 3:return r[e]}else{if(yu(i,e))return o[e]=1,i[e];if(n!==Ft&&Et(n,e))return o[e]=2,n[e];if(Et(r,e))return o[e]=3,r[e];if(t!==Ft&&Et(t,e))return o[e]=4,t[e];ff&&(o[e]=0)}}const l=Va[e];let h,u;if(l)return e==="$attrs"&&Pi(s.attrs,"get",""),l(s);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==Ft&&Et(t,e))return o[e]=4,t[e];if(u=c.config.globalProperties,Et(u,e))return u[e]},set({_:s},e,t){const{data:i,setupState:n,ctx:r}=s;return yu(n,e)?(n[e]=t,!0):i!==Ft&&Et(i,e)?(i[e]=t,!0):Et(s.props,e)||e[0]==="$"&&e.slice(1)in s?!1:(r[e]=t,!0)},has({_:{data:s,setupState:e,accessCache:t,ctx:i,appContext:n,props:r,type:o}},a){let c;return!!(t[a]||s!==Ft&&a[0]!=="$"&&Et(s,a)||yu(e,a)||Et(r,a)||Et(i,a)||Et(Va,a)||Et(n.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(s,e,t){return t.get!=null?s._.accessCache[e]=0:Et(t,"value")&&this.set(s,e,t.value,null),Reflect.defineProperty(s,e,t)}};function Fp(s){return je(s)?s.reduce((e,t)=>(e[t]=null,e),{}):s}let ff=!0;function LT(s){const e=Kx(s),t=s.proxy,i=s.ctx;ff=!1,e.beforeCreate&&Op(e.beforeCreate,s,"bc");const{data:n,computed:r,methods:o,watch:a,provide:c,inject:l,created:h,beforeMount:u,mounted:d,beforeUpdate:f,updated:p,activated:m,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:x,unmounted:T,render:A,renderTracked:S,renderTriggered:b,errorCaptured:_,serverPrefetch:I,expose:F,inheritAttrs:E,components:k,directives:B,filters:N}=e;if(l&&DT(l,i,null),o)for(const U in o){const C=o[U];st(C)&&(i[U]=C.bind(t))}if(n){const U=n.call(t,t);It(U)&&(s.data=co(U))}if(ff=!0,r)for(const U in r){const C=r[U],P=st(C)?C.bind(t,t):st(C.get)?C.get.bind(t,t):on,O=!st(C)&&st(C.set)?C.set.bind(t):on,D=qe({get:P,set:O});Object.defineProperty(i,U,{enumerable:!0,configurable:!0,get:()=>D.value,set:V=>D.value=V})}if(a)for(const U in a)qx(a[U],i,t,U);if(c){const U=st(c)?c.call(t):c;Reflect.ownKeys(U).forEach(C=>{Ux(C,U[C])})}h&&Op(h,s,"c");function L(U,C){je(C)?C.forEach(P=>U(P.bind(t))):C&&U(C.bind(t))}if(L(CT,u),L(jn,d),L(AT,f),L(ET,p),L(TT,m),L(MT,g),L(kT,_),L(PT,S),L(RT,b),L(vl,y),L(xl,T),L(IT,I),je(F))if(F.length){const U=s.exposed||(s.exposed={});F.forEach(C=>{Object.defineProperty(U,C,{get:()=>t[C],set:P=>t[C]=P,enumerable:!0})})}else s.exposed||(s.exposed={});A&&s.render===on&&(s.render=A),E!=null&&(s.inheritAttrs=E),k&&(s.components=k),B&&(s.directives=B),I&&jx(s)}function DT(s,e,t=on){je(s)&&(s=mf(s));for(const i in s){const n=s[i];let r;It(n)?"default"in n?r=Xo(n.from||i,n.default,!0):r=Xo(n.from||i):r=Xo(n),zt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function Op(s,e,t){ps(je(s)?s.map(i=>i.bind(e.proxy)):s.bind(e.proxy),e,t)}function qx(s,e,t,i){let n=i.includes(".")?$x(t,i):()=>t[i];if(Wt(s)){const r=e[s];st(r)&&Yi(n,r)}else if(st(s))Yi(n,s.bind(t));else if(It(s))if(je(s))s.forEach(r=>qx(r,e,t,i));else{const r=st(s.handler)?s.handler.bind(t):e[s.handler];st(r)&&Yi(n,r,s)}}function Kx(s){const e=s.type,{mixins:t,extends:i}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=s.appContext,a=r.get(e);let c;return a?c=a:!n.length&&!t&&!i?c=e:(c={},n.length&&n.forEach(l=>Uc(c,l,o,!0)),Uc(c,e,o)),It(e)&&r.set(e,c),c}function Uc(s,e,t,i=!1){const{mixins:n,extends:r}=e;r&&Uc(s,r,t,!0),n&&n.forEach(o=>Uc(s,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=NT[o]||t&&t[o];s[o]=a?a(s[o],e[o]):e[o]}return s}const NT={data:Bp,props:Lp,emits:Lp,methods:Ea,computed:Ea,beforeCreate:Bi,created:Bi,beforeMount:Bi,mounted:Bi,beforeUpdate:Bi,updated:Bi,beforeDestroy:Bi,beforeUnmount:Bi,destroyed:Bi,unmounted:Bi,activated:Bi,deactivated:Bi,errorCaptured:Bi,serverPrefetch:Bi,components:Ea,directives:Ea,watch:$T,provide:Bp,inject:UT};function Bp(s,e){return e?s?function(){return fi(st(s)?s.call(this,this):s,st(e)?e.call(this,this):e)}:e:s}function UT(s,e){return Ea(mf(s),mf(e))}function mf(s){if(je(s)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?s.modelModifiers:s[`${e}Modifiers`]||s[`${As(e)}Modifiers`]||s[`${wr(e)}Modifiers`];function GT(s,e,...t){if(s.isUnmounted)return;const i=s.vnode.props||Ft;let n=t;const r=e.startsWith("update:"),o=r&&YT(i,e.slice(7));o&&(o.trim&&(n=t.map(h=>Wt(h)?h.trim():h)),o.number&&(n=t.map(Oh)));let a,c=i[a=fu(e)]||i[a=fu(As(e))];!c&&r&&(c=i[a=fu(wr(e))]),c&&ps(c,s,6,n);const l=i[a+"Once"];if(l){if(!s.emitted)s.emitted={};else if(s.emitted[a])return;s.emitted[a]=!0,ps(l,s,6,n)}}const HT=new WeakMap;function Jx(s,e,t=!1){const i=t?HT:e.emitsCache,n=i.get(s);if(n!==void 0)return n;const r=s.emits;let o={},a=!1;if(!st(s)){const c=l=>{const h=Jx(l,e,!0);h&&(a=!0,fi(o,h))};!t&&e.mixins.length&&e.mixins.forEach(c),s.extends&&c(s.extends),s.mixins&&s.mixins.forEach(c)}return!r&&!a?(It(s)&&i.set(s,null),null):(je(r)?r.forEach(c=>o[c]=null):fi(o,r),It(s)&&i.set(s,o),o)}function Gh(s,e){return!s||!Rh(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),Et(s,e[0].toLowerCase()+e.slice(1))||Et(s,wr(e))||Et(s,e))}function Dp(s){const{type:e,vnode:t,proxy:i,withProxy:n,propsOptions:[r],slots:o,attrs:a,emit:c,render:l,renderCache:h,props:u,data:d,setupState:f,ctx:p,inheritAttrs:m}=s,g=Lc(s);let v,y;try{if(t.shapeFlag&4){const T=n||i,A=T;v=Ks(l.call(A,T,h,u,f,d,p)),y=a}else{const T=e;v=Ks(T.length>1?T(u,{attrs:a,slots:o,emit:c}):T(u,null)),y=e.props?a:jT(a)}}catch(T){Ln.length=0,Nh(T,s,1),v=ye(Fi)}let x=v;if(y&&m!==!1){const T=Object.keys(y),{shapeFlag:A}=x;T.length&&A&7&&(r&&T.some(Ph)&&(y=WT(y,r)),x=vr(x,y,!1,!0))}if(t.dirs&&(x=vr(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(t.dirs):t.dirs),t.transition){const T=Xh(x.type)&&Dc(x)||x;tl(T,t.transition)}return v=x,Lc(g),v}const jT=s=>{let e;for(const t in s)(t==="class"||t==="style"||Rh(t))&&((e||(e={}))[t]=s[t]);return e},WT=(s,e)=>{const t={};for(const i in s)(!Ph(i)||!(i.slice(9)in e))&&(t[i]=s[i]);return t};function zT(s,e,t){const{props:i,children:n,component:r}=s,{props:o,children:a,patchFlag:c}=e,l=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&c>=0){if(c&1024)return!0;if(c&16)return i?Np(i,o,l):!!o;if(c&8){const h=e.dynamicProps;for(let u=0;uObject.create(ey),iy=s=>Object.getPrototypeOf(s)===ey;function KT(s,e,t,i=!1){const n={},r=ty();s.propsDefaults=Object.create(null),sy(s,e,n,r);for(const o in s.propsOptions[0])o in n||(n[o]=void 0);t?s.props=i?n:tT(n):s.type.props?s.props=n:s.props=r,s.attrs=r}function ZT(s,e,t,i){const{props:n,attrs:r,vnode:{patchFlag:o}}=s,a=yt(n),[c]=s.propsOptions;let l=!1;if((i||o>0)&&!(o&16)){if(o&8){const h=s.vnode.dynamicProps;for(let u=0;u{c=!0;const[d,f]=ny(u,e,!0);fi(o,d),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(h),s.extends&&h(s.extends),s.mixins&&s.mixins.forEach(h)}if(!r&&!c)return It(s)&&i.set(s,No),No;if(je(r))for(let h=0;hs==="_"||s==="_ctx"||s==="$stable",Gm=s=>je(s)?s.map(Ks):[Ks(s)],QT=(s,e,t)=>{if(e._n)return e;const i=$h((...n)=>Gm(e(...n)),t);return i._c=!1,i},ry=(s,e,t)=>{const i=s._ctx;for(const n in s){if(Ym(n))continue;const r=s[n];if(st(r))e[n]=QT(n,r,i);else if(r!=null){const o=Gm(r);e[n]=()=>o}}},oy=(s,e)=>{const t=Gm(e);s.slots.default=()=>t},ay=(s,e,t)=>{for(const i in e)(t||!Ym(i))&&(s[i]=e[i])},eM=(s,e,t)=>{const i=s.slots=ty();if(s.vnode.shapeFlag&32){const n=e._;n?(ay(i,e,t),t&&dx(i,"_",n,!0)):ry(e,i)}else e&&oy(s,e)},tM=(s,e,t)=>{const{vnode:i,slots:n}=s;let r=!0,o=Ft;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:ay(n,e,t):(r=!e.$stable,ry(e,n)),o=e}else e&&(oy(s,e),o={default:1});if(r)for(const a in n)!Ym(a)&&o[a]==null&&delete n[a]},Hi=oM;function iM(s){return sM(s)}function sM(s,e){const t=Bh();t.__VUE__=!0;const{insert:i,remove:n,patchProp:r,createElement:o,createText:a,createComment:c,setText:l,setElementText:h,parentNode:u,nextSibling:d,setScopeId:f=on,insertStaticContent:p}=s,m=(X,j,H,G=null,z=null,te=null,he=void 0,se=null,ue=!!j.dynamicChildren)=>{if(X===j)return;X&&!Vr(X,j)&&(G=re(X),V(X,z,te,!0),X=null),j.patchFlag===-2&&(ue=!1,j.dynamicChildren=null);const{type:ae,ref:Ee,shapeFlag:xe}=j;switch(ae){case Hh:g(X,j,H,G);break;case Fi:v(X,j,H,G);break;case gc:X==null&&y(j,H,G,he);break;case Fe:k(X,j,H,G,z,te,he,se,ue);break;default:xe&1?A(X,j,H,G,z,te,he,se,ue):xe&6?B(X,j,H,G,z,te,he,se,ue):(xe&64||xe&128)&&ae.process(X,j,H,G,z,te,he,se,ue,ce)}Ee!=null&&z?Xa(Ee,X&&X.ref,te,j||X,!j):Ee==null&&X&&X.ref!=null&&Xa(X.ref,null,te,X,!0)},g=(X,j,H,G)=>{if(X==null)i(j.el=a(j.children),H,G);else{const z=j.el=X.el;j.children!==X.children&&l(z,j.children)}},v=(X,j,H,G)=>{X==null?i(j.el=c(j.children||""),H,G):j.el=X.el},y=(X,j,H,G)=>{[X.el,X.anchor]=p(X.children,j,H,G,X.el,X.anchor)},x=({el:X,anchor:j},H,G)=>{let z;for(;X&&X!==j;)z=d(X),i(X,H,G),X=z;i(j,H,G)},T=({el:X,anchor:j})=>{let H;for(;X&&X!==j;)H=d(X),n(X),X=H;n(j)},A=(X,j,H,G,z,te,he,se,ue)=>{if(j.type==="svg"?he="svg":j.type==="math"&&(he="mathml"),X==null)S(j,H,G,z,te,he,se,ue);else{const ae=X.el&&X.el._isVueCE?X.el:null;try{ae&&ae._beginPatch(),I(X,j,z,te,he,se,ue)}finally{ae&&ae._endPatch()}}},S=(X,j,H,G,z,te,he,se)=>{let ue,ae;const{props:Ee,shapeFlag:xe,transition:fe,dirs:De}=X;if(ue=X.el=o(X.type,te,Ee&&Ee.is,Ee),xe&8?h(ue,X.children):xe&16&&_(X.children,ue,null,G,z,bu(X,te),he,se),De&&Ar(X,null,G,"created"),b(ue,X,X.scopeId,he,G),Ee){for(const ze in Ee)ze!=="value"&&!Na(ze)&&r(ue,ze,null,Ee[ze],te,G);"value"in Ee&&r(ue,"value",null,Ee.value,te),(ae=Ee.onVnodeBeforeMount)&&Ns(ae,G,X)}De&&Ar(X,null,G,"beforeMount");const Ze=nM(z,fe);Ze&&fe.beforeEnter(ue),i(ue,j,H),((ae=Ee&&Ee.onVnodeMounted)||Ze||De)&&Hi(()=>{try{ae&&Ns(ae,G,X),Ze&&fe.enter(ue),De&&Ar(X,null,G,"mounted")}finally{}},z)},b=(X,j,H,G,z)=>{if(H&&f(X,H),G)for(let te=0;te{for(let ae=ue;ae{const se=j.el=X.el;let{patchFlag:ue,dynamicChildren:ae,dirs:Ee}=j;ue|=X.patchFlag&16;const xe=X.props||Ft,fe=j.props||Ft;let De;if(H&&Er(H,!1),(De=fe.onVnodeBeforeUpdate)&&Ns(De,H,j,X),Ee&&Ar(j,X,H,"beforeUpdate"),H&&Er(H,!0),ae&&(!X.dynamicChildren||X.dynamicChildren.length!==ae.length)&&(ue=0,he=!1,ae=null),(xe.innerHTML&&fe.innerHTML==null||xe.textContent&&fe.textContent==null)&&h(se,""),ae?F(X.dynamicChildren,ae,se,H,G,bu(j,z),te):he||C(X,j,se,null,H,G,bu(j,z),te,!1),ue>0){if(ue&16)E(se,xe,fe,H,z);else if(ue&2&&xe.class!==fe.class&&r(se,"class",null,fe.class,z),ue&4&&r(se,"style",xe.style,fe.style,z),ue&8){const Ze=j.dynamicProps;for(let ze=0;ze{De&&Ns(De,H,j,X),Ee&&Ar(j,X,H,"updated")},G)},F=(X,j,H,G,z,te,he)=>{for(let se=0;se{if(j!==H){if(j!==Ft)for(const te in j)!Na(te)&&!(te in H)&&r(X,te,j[te],null,z,G);for(const te in H){if(Na(te))continue;const he=H[te],se=j[te];he!==se&&te!=="value"&&r(X,te,se,he,z,G)}"value"in H&&r(X,"value",j.value,H.value,z)}},k=(X,j,H,G,z,te,he,se,ue)=>{const ae=j.el=X?X.el:a(""),Ee=j.anchor=X?X.anchor:a("");let{patchFlag:xe,dynamicChildren:fe,slotScopeIds:De}=j;De&&(se=se?se.concat(De):De),X==null?(i(ae,H,G),i(Ee,H,G),_(j.children||[],H,Ee,z,te,he,se,ue)):xe>0&&xe&64&&fe&&X.dynamicChildren&&X.dynamicChildren.length===fe.length?(F(X.dynamicChildren,fe,H,z,te,he,se),(j.key!=null||z&&j===z.subTree)&&ly(X,j,!0)):C(X,j,H,Ee,z,te,he,se,ue)},B=(X,j,H,G,z,te,he,se,ue)=>{j.slotScopeIds=se,X==null?j.shapeFlag&512?z.ctx.activate(j,H,G,he,ue):N(j,H,G,z,te,he,ue):$(X,j,ue)},N=(X,j,H,G,z,te,he)=>{const se=X.component=dM(X,G,z);if(Vh(X)&&(se.ctx.renderer=ce),fM(se,!1,he),se.asyncDep){if(z&&z.registerDep(se,L,he),!X.el){const ue=se.subTree=ye(Fi);v(null,ue,j,H),X.placeholder=ue.el}}else L(se,X,j,H,z,te,he)},$=(X,j,H)=>{const G=j.component=X.component;if(zT(X,j,H))if(G.asyncDep&&!G.asyncResolved){U(G,j,H);return}else G.next=j,G.update();else j.el=X.el,G.vnode=j},L=(X,j,H,G,z,te,he)=>{const se=()=>{if(X.isMounted){let{next:xe,bu:fe,u:De,parent:Ze,vnode:ze}=X;{const we=cy(X);if(we){xe&&(xe.el=ze.el,U(X,xe,he)),we.asyncDep.then(()=>{Hi(()=>{X.isUnmounted||ae()},z)});return}}let Ke=xe,Le;Er(X,!1),xe?(xe.el=ze.el,U(X,xe,he)):xe=ze,fe&&pc(fe),(Le=xe.props&&xe.props.onVnodeBeforeUpdate)&&Ns(Le,Ze,xe,ze),Er(X,!0);const be=Dp(X),at=X.subTree;X.subTree=be,m(at,be,u(at.el),re(at),X,z,te),xe.el=be.el,Ke===null&&qT(X,be.el),De&&Hi(De,z),(Le=xe.props&&xe.props.onVnodeUpdated)&&Hi(()=>Ns(Le,Ze,xe,ze),z)}else{let xe;const{el:fe,props:De}=j,{bm:Ze,m:ze,parent:Ke,root:Le,type:be}=X,at=Vo(j);Er(X,!1),Ze&&pc(Ze),!at&&(xe=De&&De.onVnodeBeforeMount)&&Ns(xe,Ke,j),Er(X,!0);{Le.ce&&Le.ce._hasShadowRoot()&&Le.ce._injectChildStyle(be,X.parent?X.parent.type:void 0);const we=X.subTree=Dp(X);m(null,we,H,G,X,z,te),j.el=we.el}if(ze&&Hi(ze,z),!at&&(xe=De&&De.onVnodeMounted)){const we=j;Hi(()=>Ns(xe,Ke,we),z)}(j.shapeFlag&256||Ke&&Vo(Ke.vnode)&&Ke.vnode.shapeFlag&256)&&X.a&&Hi(X.a,z),X.isMounted=!0,j=H=G=null}};X.scope.on();const ue=X.effect=new yx(se);X.scope.off();const ae=X.update=ue.run.bind(ue),Ee=X.job=ue.runIfDirty.bind(ue);Ee.i=X,Ee.id=X.uid,ue.scheduler=()=>Xm(Ee),Er(X,!0),ae()},U=(X,j,H)=>{j.component=X;const G=X.vnode.props;X.vnode=j,X.next=null,ZT(X,j.props,G,H),tM(X,j.children,H),Nn(),Rp(X),Un()},C=(X,j,H,G,z,te,he,se,ue=!1)=>{const ae=X&&X.children,Ee=X?X.shapeFlag:0,xe=j.children,{patchFlag:fe,shapeFlag:De}=j;if(fe>0){if(fe&128){O(ae,xe,H,G,z,te,he,se,ue);return}else if(fe&256){P(ae,xe,H,G,z,te,he,se,ue);return}}De&8?(Ee&16&&ne(ae,z,te),xe!==ae&&h(H,xe)):Ee&16?De&16?O(ae,xe,H,G,z,te,he,se,ue):ne(ae,z,te,!0):(Ee&8&&h(H,""),De&16&&_(xe,H,G,z,te,he,se,ue))},P=(X,j,H,G,z,te,he,se,ue)=>{X=X||No,j=j||No;const ae=X.length,Ee=j.length,xe=Math.min(ae,Ee);let fe;for(fe=0;feEe?ne(X,z,te,!0,!1,xe):_(j,H,G,z,te,he,se,ue,xe)},O=(X,j,H,G,z,te,he,se,ue)=>{let ae=0;const Ee=j.length;let xe=X.length-1,fe=Ee-1;for(;ae<=xe&&ae<=fe;){const De=X[ae],Ze=j[ae]=ue?Mn(j[ae]):Ks(j[ae]);if(Vr(De,Ze))m(De,Ze,H,null,z,te,he,se,ue);else break;ae++}for(;ae<=xe&&ae<=fe;){const De=X[xe],Ze=j[fe]=ue?Mn(j[fe]):Ks(j[fe]);if(Vr(De,Ze))m(De,Ze,H,null,z,te,he,se,ue);else break;xe--,fe--}if(ae>xe){if(ae<=fe){const De=fe+1,Ze=Defe)for(;ae<=xe;)V(X[ae],z,te,!0),ae++;else{const De=ae,Ze=ae,ze=new Map;for(ae=Ze;ae<=fe;ae++){const vt=j[ae]=ue?Mn(j[ae]):Ks(j[ae]);vt.key!=null&&ze.set(vt.key,ae)}let Ke,Le=0;const be=fe-Ze+1;let at=!1,we=0;const mi=new Array(be);for(ae=0;ae=be){V(vt,z,te,!0);continue}let ie;if(vt.key!=null)ie=ze.get(vt.key);else for(Ke=Ze;Ke<=fe;Ke++)if(mi[Ke-Ze]===0&&Vr(vt,j[Ke])){ie=Ke;break}ie===void 0?V(vt,z,te,!0):(mi[ie-Ze]=ae+1,ie>=we?we=ie:at=!0,m(vt,j[ie],H,null,z,te,he,se,ue),Le++)}const Rt=at?rM(mi):No;for(Ke=Rt.length-1,ae=be-1;ae>=0;ae--){const vt=Ze+ae,ie=j[vt],oe=j[vt+1],lt=vt+1{const{el:te,type:he,transition:se,children:ue,shapeFlag:ae}=X;if(ae&6){D(X.component.subTree,j,H,G);return}if(ae&128){X.suspense.move(j,H,G);return}if(ae&64){he.move(X,j,H,ce);return}if(he===Fe){i(te,j,H);for(let xe=0;xese.enter(te),z));else{const{leave:xe,delayLeave:fe,afterLeave:De}=se,Ze=()=>{X.ctx.isUnmounted?n(te):i(te,j,H)},ze=()=>{const Ke=te._isLeaving||!!te[hs];te._isLeaving&&te[hs](!0),se.persisted&&!Ke?Ze():xe(te,()=>{Ze(),De&&De()})};fe?fe(te,Ze,ze):ze()}else i(te,j,H)},V=(X,j,H,G=!1,z=!1)=>{const{type:te,props:he,ref:se,children:ue,dynamicChildren:ae,shapeFlag:Ee,patchFlag:xe,dirs:fe,cacheIndex:De,memo:Ze}=X;if(xe===-2&&(z=!1),se!=null&&(Nn(),Xa(se,null,H,X,!0),Un()),De!=null&&(j.renderCache[De]=void 0),Ee&256){j.ctx.deactivate(X);return}const ze=Ee&1&&fe,Ke=!Vo(X);let Le;if(Ke&&(Le=he&&he.onVnodeBeforeUnmount)&&Ns(Le,j,X),Ee&6)q(X.component,H,G);else{if(Ee&128){X.suspense.unmount(H,G);return}ze&&Ar(X,null,j,"beforeUnmount"),Ee&64?X.type.remove(X,j,H,ce,G):ae&&!ae.hasOnce&&(te!==Fe||xe>0&&xe&64)?ne(ae,j,H,!1,!0):(te===Fe&&xe&384||!z&&Ee&16)&&ne(ue,j,H),G&&Y(X)}const be=Ze!=null&&De==null;(Ke&&(Le=he&&he.onVnodeUnmounted)||ze||be)&&Hi(()=>{Le&&Ns(Le,j,X),ze&&Ar(X,null,j,"unmounted"),be&&(X.el=null)},H)},Y=X=>{const{type:j,el:H,anchor:G,transition:z}=X;if(j===Fe){W(H,G);return}if(j===gc){T(X);return}const te=()=>{n(H),z&&!z.persisted&&z.afterLeave&&z.afterLeave()};if(X.shapeFlag&1&&z&&!z.persisted){const{leave:he,delayLeave:se}=z,ue=()=>he(H,te);se?se(X.el,te,ue):ue()}else te()},W=(X,j)=>{let H;for(;X!==j;)H=d(X),n(X),X=H;n(j)},q=(X,j,H)=>{const{bum:G,scope:z,job:te,subTree:he,um:se,m:ue,a:ae}=X;$p(ue),$p(ae),G&&pc(G),z.stop(),te&&(te.flags|=8,V(he,X,j,H)),se&&Hi(se,j),Hi(()=>{X.isUnmounted=!0},j)},ne=(X,j,H,G=!1,z=!1,te=0)=>{for(let he=te;he{if(X.shapeFlag&6)return re(X.component.subTree);if(X.shapeFlag&128)return X.suspense.next();const j=d(X.anchor||X.el),H=j&&j[yT];return H?d(H):j};let me=!1;const ve=(X,j,H)=>{let G;X==null?j._vnode&&(V(j._vnode,null,null,!0),G=j._vnode.component):m(j._vnode||null,X,j,null,null,null,H),j._vnode=X,me||(me=!0,Rp(G),Lx(),me=!1)},ce={p:m,um:V,m:D,r:Y,mt:N,mc:_,pc:C,pbc:F,n:re,o:s};return{render:ve,hydrate:void 0,createApp:VT(ve)}}function bu({type:s,props:e},t){return t==="svg"&&s==="foreignObject"||t==="mathml"&&s==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Er({effect:s,job:e},t){t?(s.flags|=32,e.flags|=4):(s.flags&=-33,e.flags&=-5)}function nM(s,e){return(!s||s&&!s.pendingBranch)&&e&&!e.persisted}function ly(s,e,t=!1){const i=s.children,n=e.children;if(je(i)&&je(n))for(let r=0;r>1,s[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function cy(s){const e=s.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:cy(e)}function $p(s){if(s)for(let e=0;es.__isSuspense;function oM(s,e){e&&e.pendingBranch?je(s)?e.effects.push(...s):e.effects.push(s):mT(s)}const Fe=Symbol.for("v-fgt"),Hh=Symbol.for("v-txt"),Fi=Symbol.for("v-cmt"),gc=Symbol.for("v-stc"),Ln=[];let ts=null;function K(s=!1){Ln.push(ts=s?null:[])}function Hm(){Ln.pop(),ts=Ln[Ln.length-1]||null}let il=1;function $c(s,e=!1){il+=s,s<0&&ts&&e&&(ts.hasOnce=!0)}function dy(s){return s.dynamicChildren=il>0?ts||No:null,Hm(),il>0&&ts&&ts.push(s),s}function J(s,e,t,i,n,r){return dy(M(s,e,t,i,n,r,!0))}function Pt(s,e,t,i,n){return dy(ye(s,e,t,i,n,!0))}function sl(s){return s?s.__v_isVNode===!0:!1}function Vr(s,e){return s.type===e.type&&s.key===e.key}const fy=({key:s})=>s??null,vc=({ref:s,ref_key:e,ref_for:t})=>(typeof s=="number"&&(s=""+s),s!=null?Wt(s)||zt(s)||st(s)?{i:Oi,r:s,k:e,f:!!t}:s:null);function M(s,e=null,t=null,i=0,n=null,r=s===Fe?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:s,props:e,key:e&&fy(e),ref:e&&vc(e),scopeId:Nx,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Oi};return a?(Xc(c,t),r&128&&s.normalize(c)):t&&(c.shapeFlag|=Wt(t)?8:16),il>0&&!o&&ts&&(c.patchFlag>0||r&6)&&c.patchFlag!==32&&ts.push(c),c}const ye=aM;function aM(s,e=null,t=null,i=0,n=null,r=!1){if((!s||s===FT)&&(s=Fi),sl(s)){const a=vr(s,e,!0);return t&&Xc(a,t),il>0&&!r&&ts&&(a.shapeFlag&6?ts[ts.indexOf(s)]=a:ts.push(a)),a.patchFlag=-2,a}if(vM(s)&&(s=s.__vccOpts),e){e=lM(e);let{class:a,style:c}=e;a&&!Wt(a)&&(e.class=Be(a)),It(c)&&(Dh(c)&&!je(c)&&(c=fi({},c)),e.style=gi(c))}const o=Wt(s)?1:uy(s)?128:Xh(s)?64:It(s)?4:st(s)?2:0;return M(s,e,t,i,n,o,r,!0)}function lM(s){return s?Dh(s)||iy(s)?fi({},s):s:null}function vr(s,e,t=!1,i=!1){const{props:n,ref:r,patchFlag:o,children:a,transition:c}=s,l=e?cM(n||{},e):n,h={__v_isVNode:!0,__v_skip:!0,type:s.type,props:l,key:l&&fy(l),ref:e&&e.ref?t&&r?je(r)?r.concat(vc(e)):[r,vc(e)]:vc(e):r,scopeId:s.scopeId,slotScopeIds:s.slotScopeIds,children:a,target:s.target,targetStart:s.targetStart,targetAnchor:s.targetAnchor,staticCount:s.staticCount,shapeFlag:s.shapeFlag,patchFlag:e&&s.type!==Fe?o===-1?16:o|16:o,dynamicProps:s.dynamicProps,dynamicChildren:s.dynamicChildren,appContext:s.appContext,dirs:s.dirs,transition:c,component:s.component,suspense:s.suspense,ssContent:s.ssContent&&vr(s.ssContent),ssFallback:s.ssFallback&&vr(s.ssFallback),placeholder:s.placeholder,el:s.el,anchor:s.anchor,ctx:s.ctx,ce:s.ce};return c&&i&&tl(h,c.clone(h)),h}function kt(s=" ",e=0){return ye(Hh,null,s,e)}function es(s,e){const t=ye(gc,null,s);return t.staticCount=e,t}function Te(s="",e=!1){return e?(K(),Pt(Fi,null,s)):ye(Fi,null,s)}function Ks(s){return s==null||typeof s=="boolean"?ye(Fi):je(s)?ye(Fe,null,s.slice()):sl(s)?Mn(s):ye(Hh,null,String(s))}function Mn(s){return s.el===null&&s.patchFlag!==-1||s.memo?s:vr(s)}function Xc(s,e){let t=0;const{shapeFlag:i}=s;if(e==null)e=null;else if(je(e))t=16;else if(typeof e=="object")if(i&65){const n=e.default;n&&(n._c&&(n._d=!1),Xc(s,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!iy(e)?e._ctx=Oi:n===3&&Oi&&(Oi.slots._===1?e._=1:(e._=2,s.patchFlag|=1024))}else if(st(e)){if(i&65){Xc(s,{default:e});return}e={default:e,_ctx:Oi},t=32}else e=String(e),i&64?(t=16,e=[kt(e)]):t=8;s.children=e,s.shapeFlag|=t}function cM(...s){const e={};for(let t=0;tUi||Oi;let Vc,nl;{const s=Bh(),e=(t,i)=>{let n;return(n=s[t])||(n=s[t]=[]),n.push(i),r=>{n.length>1?n.forEach(o=>o(r)):n[0](r)}};Vc=e("__VUE_INSTANCE_SETTERS__",t=>Ui=t),nl=e("__VUE_SSR_SETTERS__",t=>rl=t)}const yl=s=>{const e=Ui;return Vc(s),s.scope.on(),()=>{s.scope.off(),Vc(e)}},Xp=()=>{Ui&&Ui.scope.off(),Vc(null)};function my(s){return s.vnode.shapeFlag&4}let rl=!1;function fM(s,e=!1,t=!1){e&&nl(e);const{props:i,children:n}=s.vnode,r=my(s);KT(s,i,r,e),eM(s,n,t||e);const o=r?mM(s,e):void 0;return e&&nl(!1),o}function mM(s,e){const t=s.type;s.accessCache=Object.create(null),s.proxy=new Proxy(s.ctx,BT);const{setup:i}=t;if(i){Nn();const n=s.setupContext=i.length>1?gM(s):null,r=yl(s),o=gl(i,s,0,[s.props,n]),a=lx(o);if(Un(),r(),(a||s.sp)&&!Vo(s)&&jx(s),a){if(o.then(Xp,Xp),e)return o.then(c=>{nl(!0);try{Vp(s,c,e)}finally{nl(!1)}}).catch(c=>{Nh(c,s,0)});s.asyncDep=o}else Vp(s,o)}else py(s)}function Vp(s,e,t){st(e)?s.type.__ssrInlineRender?s.ssrRender=e:s.render=e:It(e)&&(s.setupState=Fx(e)),py(s)}function py(s,e,t){const i=s.type;s.render||(s.render=i.render||on);{const n=yl(s);Nn();try{LT(s)}finally{Un(),n()}}}const pM={get(s,e){return Pi(s,"get",""),s[e]}};function gM(s){const e=t=>{s.exposed=t||{}};return{attrs:new Proxy(s.attrs,pM),slots:s.slots,emit:s.emit,expose:e}}function jh(s){return s.exposed?s.exposeProxy||(s.exposeProxy=new Proxy(Fx(lr(s.exposed)),{get(e,t){if(t in e)return e[t];if(t in Va)return Va[t](s)},has(e,t){return t in e||t in Va}})):s.proxy}function vM(s){return st(s)&&"__vccOpts"in s}const qe=(s,e)=>cT(s,e,rl);function xM(s,e,t){try{$c(-1);const i=arguments.length;return i===2?It(e)&&!je(e)?sl(e)?ye(s,null,[e]):ye(s,e):ye(s,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&sl(t)&&(t=[t]),ye(s,e,t))}finally{$c(1)}}const yM="3.5.41";/** -* @vue/runtime-dom v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let gf;const Yp=typeof window<"u"&&window.trustedTypes;if(Yp)try{gf=Yp.createPolicy("vue",{createHTML:s=>s})}catch{}const gy=gf?s=>gf.createHTML(s):s=>s,bM="http://www.w3.org/2000/svg",wM="http://www.w3.org/1998/Math/MathML",yn=typeof document<"u"?document:null,Gp=yn&&yn.createElement("template"),SM={insert:(s,e,t)=>{e.insertBefore(s,t||null)},remove:s=>{const e=s.parentNode;e&&e.removeChild(s)},createElement:(s,e,t,i)=>{const n=e==="svg"?yn.createElementNS(bM,s):e==="mathml"?yn.createElementNS(wM,s):t?yn.createElement(s,{is:t}):yn.createElement(s);return s==="select"&&i&&i.multiple!=null&&n.setAttribute("multiple",i.multiple),n},createText:s=>yn.createTextNode(s),createComment:s=>yn.createComment(s),setText:(s,e)=>{s.nodeValue=e},setElementText:(s,e)=>{s.textContent=e},parentNode:s=>s.parentNode,nextSibling:s=>s.nextSibling,querySelector:s=>yn.querySelector(s),setScopeId(s,e){s.setAttribute(e,"")},insertStaticContent(s,e,t,i,n,r){const o=t?t.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),t),!(n===r||!(n=n.nextSibling)););else{Gp.innerHTML=gy(i==="svg"?`${s}`:i==="mathml"?`${s}`:s);const a=Gp.content;if(i==="svg"||i==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Wn="transition",ya="animation",ol=Symbol("_vtc"),vy={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},TM=fi({},Xx,vy),MM=s=>(s.displayName="Transition",s.props=TM,s),_M=MM((s,{slots:e})=>xM(ST,CM(s),e)),Ir=(s,e=[])=>{je(s)?s.forEach(t=>t(...e)):s&&s(...e)},Hp=s=>s?je(s)?s.some(e=>e.length>1):s.length>1:!1;function CM(s){const e={};for(const k in s)k in vy||(e[k]=s[k]);if(s.css===!1)return e;const{name:t="v",type:i,duration:n,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:c=r,appearActiveClass:l=o,appearToClass:h=a,leaveFromClass:u=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:f=`${t}-leave-to`}=s,p=AM(n),m=p&&p[0],g=p&&p[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:x,onLeave:T,onLeaveCancelled:A,onBeforeAppear:S=v,onAppear:b=y,onAppearCancelled:_=x}=e,I=(k,B,N,$)=>{k._enterCancelled=$,Rr(k,B?h:a),Rr(k,B?l:o),N&&N()},F=(k,B)=>{k._isLeaving=!1,Rr(k,u),Rr(k,f),Rr(k,d),B&&B()},E=k=>(B,N)=>{const $=k?b:y,L=()=>I(B,k,N);Ir($,[B,L]),jp(()=>{Rr(B,k?c:r),pn(B,k?h:a),Hp($)||Wp(B,i,m,L)})};return fi(e,{onBeforeEnter(k){Ir(v,[k]),pn(k,r),pn(k,o)},onBeforeAppear(k){Ir(S,[k]),pn(k,c),pn(k,l)},onEnter:E(!1),onAppear:E(!0),onLeave(k,B){k._isLeaving=!0;const N=()=>F(k,B);pn(k,u),k._enterCancelled?(pn(k,d),Kp(k)):(Kp(k),pn(k,d)),jp(()=>{k._isLeaving&&(Rr(k,u),pn(k,f),Hp(T)||Wp(k,i,g,N))}),Ir(T,[k,N])},onEnterCancelled(k){I(k,!1,void 0,!0),Ir(x,[k])},onAppearCancelled(k){I(k,!0,void 0,!0),Ir(_,[k])},onLeaveCancelled(k){F(k),Ir(A,[k])}})}function AM(s){if(s==null)return null;if(It(s))return[wu(s.enter),wu(s.leave)];{const e=wu(s);return[e,e]}}function wu(s){return ES(s)}function pn(s,e){e.split(/\s+/).forEach(t=>t&&s.classList.add(t)),(s[ol]||(s[ol]=new Set)).add(e)}function Rr(s,e){e.split(/\s+/).forEach(i=>i&&s.classList.remove(i));const t=s[ol];t&&(t.delete(e),t.size||(s[ol]=void 0))}function jp(s){requestAnimationFrame(()=>{requestAnimationFrame(s)})}let EM=0;function Wp(s,e,t,i){const n=s._endId=++EM,r=()=>{n===s._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:c}=IM(s,e);if(!o)return i();const l=o+"end";let h=0;const u=()=>{s.removeEventListener(l,d),r()},d=f=>{f.target===s&&++h>=c&&u()};setTimeout(()=>{h(t[p]||"").split(", "),n=i(`${Wn}Delay`),r=i(`${Wn}Duration`),o=zp(n,r),a=i(`${ya}Delay`),c=i(`${ya}Duration`),l=zp(a,c);let h=null,u=0,d=0;e===Wn?o>0&&(h=Wn,u=o,d=r.length):e===ya?l>0&&(h=ya,u=l,d=c.length):(u=Math.max(o,l),h=u>0?o>l?Wn:ya:null,d=h?h===Wn?r.length:c.length:0);const f=h===Wn&&/\b(?:transform|all)(?:,|$)/.test(i(`${Wn}Property`).toString());return{type:h,timeout:u,propCount:d,hasTransform:f}}function zp(s,e){for(;s.lengthqp(t)+qp(s[i])))}function qp(s){return s==="auto"?0:Number(s.slice(0,-1).replace(",","."))*1e3}function Kp(s){return(s?s.ownerDocument:document).body.offsetHeight}function RM(s,e,t){const i=s[ol];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?s.removeAttribute("class"):t?s.setAttribute("class",e):s.className=e}const Yc=Symbol("_vod"),xy=Symbol("_vsh"),bi={name:"show",beforeMount(s,{value:e},{transition:t}){s[Yc]=s.style.display==="none"?"":s.style.display,t&&e?t.beforeEnter(s):ba(s,e)},mounted(s,{value:e},{transition:t}){t&&e&&t.enter(s)},updated(s,{value:e,oldValue:t},{transition:i}){!e!=!t&&(i?e?(i.beforeEnter(s),ba(s,!0),i.enter(s)):i.leave(s,()=>{ba(s,!1)}):ba(s,e))},beforeUnmount(s,{value:e}){ba(s,e)}};function ba(s,e){s.style.display=e?s[Yc]:"none",s[xy]=!e}const PM=Symbol(""),kM=/(?:^|;)\s*display\s*:/;function FM(s,e,t){const i=s.style,n=Wt(t);let r=!1;if(t&&!n){if(e)if(Wt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&Ia(i,a,"")}else for(const o in e)t[o]==null&&Ia(i,o,"");for(const o in t){o==="display"&&(r=!0);const a=t[o];a!=null?BM(s,o,!Wt(e)&&e?e[o]:void 0,a)||Ia(i,o,a):Ia(i,o,"")}}else if(n){if(e!==t){const o=i[PM];o&&(t+=";"+o),i.cssText=t,r=kM.test(t)}}else e&&s.removeAttribute("style");Yc in s&&(s[Yc]=r?i.display:"",s[xy]&&(i.display="none"))}const Zp=/\s*!important$/;function Ia(s,e,t){if(je(t))t.forEach(i=>Ia(s,e,i));else if(t==null&&(t=""),e.startsWith("--"))s.setProperty(e,t);else{const i=OM(s,e);Zp.test(t)?s.setProperty(wr(i),t.replace(Zp,""),"important"):s[i]=t}}const Jp=["Webkit","Moz","ms"],Su={};function OM(s,e){const t=Su[e];if(t)return t;let i=As(e);if(i!=="filter"&&i in s)return Su[e]=i;i=ux(i);for(let n=0;nTu||(XM.then(()=>Tu=0),Tu=Date.now());function YM(s,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;const n=t.value;if(je(n)){const r=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{r.call(i),i._stopped=!0};const o=n.slice(),a=[i];for(let c=0;cs.charCodeAt(0)===111&&s.charCodeAt(1)===110&&s.charCodeAt(2)>96&&s.charCodeAt(2)<123,GM=(s,e,t,i,n,r)=>{const o=n==="svg";e==="class"?RM(s,i,o):e==="style"?FM(s,t,i):Rh(e)?Ph(e)||DM(s,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):HM(s,e,i,o))?(tg(s,e,i),!s.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&eg(s,e,i,o,r,e!=="value")):s._isVueCE&&(jM(s,e)||s._def.__asyncLoader&&(/[A-Z]/.test(e)||!Wt(i)))?tg(s,As(e),i,r,e):(e==="true-value"?s._trueValue=i:e==="false-value"&&(s._falseValue=i),eg(s,e,i,o))};function HM(s,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in s&&sg(e)&&st(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&s.tagName==="IFRAME"||e==="form"||e==="list"&&s.tagName==="INPUT"||e==="type"&&s.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const n=s.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return sg(e)&&Wt(t)?!1:e in s}function jM(s,e){const t=s._def.props;if(!t)return!1;const i=As(e);return Array.isArray(t)?t.some(n=>As(n)===i):Object.keys(t).some(n=>As(n)===i)}const ea=s=>{const e=s.props["onUpdate:modelValue"]||!1;return je(e)?t=>pc(e,t):e};function WM(s){s.target.composing=!0}function ng(s){const e=s.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const tn=Symbol("_assign"),Bl=Symbol("_initialValue");function Mu(s,e,t){return e&&(s=s.trim()),t&&(s=Oh(s)),s}const Ge={created(s,{modifiers:{lazy:e,trim:t,number:i}},n){s.parentNode&&(s.type==="text"?s[Bl]=s.defaultValue.replace(/[\r\n]/g,""):s.type==="textarea"&&(s[Bl]=s.defaultValue.replace(/\r\n?/g,` -`))),s[tn]=ea(n);const r=i||n.props&&n.props.type==="number";nr(s,e?"change":"input",o=>{o.target.composing||s[tn](Mu(s.value,t,r))}),(t||r)&&nr(s,"change",()=>{s.value=Mu(s.value,t,r)}),e||(nr(s,"compositionstart",WM),nr(s,"compositionend",ng),nr(s,"change",ng))},mounted(s,{value:e,modifiers:{trim:t,number:i}}){const n=e??"",r=s[Bl];delete s[Bl],r!==void 0&&(s.type==="text"||s.type==="textarea")&&s.value!==r?s[tn](Mu(s.value,t,i)):s.value=n},beforeUpdate(s,{value:e,oldValue:t,modifiers:{lazy:i,trim:n,number:r}},o){if(s[tn]=ea(o),s.composing)return;const a=(r||s.type==="number")&&!/^0\d/.test(s.value)?Oh(s.value):s.value,c=e??"";if(a===c)return;const l=s.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===s&&s.type!=="range"&&(i&&e===t||n&&s.value.trim()===c)||(s.value=c)}},St={deep:!0,created(s,e,t){s[tn]=ea(t),nr(s,"change",()=>{const i=s._modelValue,n=al(s),r=s.checked,o=s[tn];if(je(i)){const a=Om(i,n),c=a!==-1;if(r&&!c)o(i.concat(n));else if(!r&&c){const l=[...i];l.splice(a,1),o(l)}}else if(aa(i)){const a=new Set(i);r?a.add(n):a.delete(n),o(a)}else o(yy(s,r))})},mounted:rg,beforeUpdate(s,e,t){s[tn]=ea(t),rg(s,e,t)}};function rg(s,{value:e,oldValue:t},i){s._modelValue=e;let n;if(je(e))n=Om(e,i.props.value)>-1;else if(aa(e))n=e.has(i.props.value);else{if(e===t)return;n=la(e,yy(s,!0))}s.checked!==n&&(s.checked=n)}const Tt={deep:!0,created(s,{value:e,modifiers:{number:t}},i){s._modelValue=e,nr(s,"change",()=>{const n=Array.prototype.filter.call(s.options,r=>r.selected).map(r=>t?Oh(al(r)):al(r));s[tn](s.multiple?aa(s._modelValue)?new Set(n):n:n[0]),s._assigning=!0,Uh(()=>{s._assigning=!1})}),s[tn]=ea(i)},mounted(s,{value:e}){og(s,e)},beforeUpdate(s,{value:e},t){s._modelValue=e,s[tn]=ea(t)},updated(s,{value:e}){s._assigning||og(s,e)}};function og(s,e){const t=s.multiple,i=je(e);if(!(t&&!i&&!aa(e))){for(let n=0,r=s.options.length;nString(l)===String(a)):o.selected=Om(e,a)>-1}else o.selected=e.has(a);else if(la(al(o),e)){s.selectedIndex!==n&&(s.selectedIndex=n);return}}!t&&s.selectedIndex!==-1&&(s.selectedIndex=-1)}}function al(s){return"_value"in s?s._value:s.value}function yy(s,e){const t=e?"_trueValue":"_falseValue";return t in s?s[t]:e}const zM=["ctrl","shift","alt","meta"],qM={stop:s=>s.stopPropagation(),prevent:s=>s.preventDefault(),self:s=>s.target!==s.currentTarget,ctrl:s=>!s.ctrlKey,shift:s=>!s.shiftKey,alt:s=>!s.altKey,meta:s=>!s.metaKey,left:s=>"button"in s&&s.button!==0,middle:s=>"button"in s&&s.button!==1,right:s=>"button"in s&&s.button!==2,exact:(s,e)=>zM.some(t=>s[`${t}Key`]&&!e.includes(t))},tt=(s,e)=>{if(!s)return s;const t=s._withMods||(s._withMods={}),i=e.join(".");return t[i]||(t[i]=((n,...r)=>{for(let o=0;o{const t=s._withKeys||(s._withKeys={}),i=e.join(".");return t[i]||(t[i]=(n=>{if(!("key"in n))return;const r=wr(n.key);if(e.some(o=>o===r||KM[o]===r))return s(n)}))},ZM=fi({patchProp:GM},SM);let ag;function JM(){return ag||(ag=iM(ZM))}const QM=((...s)=>{const e=JM().createApp(...s),{mount:t}=e;return e.mount=i=>{const n=t_(i);if(!n)return;const r=e._component;!st(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const o=t(n,!1,e_(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e});function e_(s){if(s instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&s instanceof MathMLElement)return"mathml"}function t_(s){return Wt(s)?document.querySelector(s):s}/*! - * pinia v4.0.3 - * (c) 2026 Eduardo San Martin Morote - * @license MIT - */let by;const Wh=s=>by=s,wy=Symbol();function lg(s){return s&&typeof s=="object"&&Object.prototype.toString.call(s)==="[object Object]"&&typeof s.toJSON!="function"}function i_(){const s=vx(!0),e=s.run(()=>Ye({}));let t=[],i=[];const n=lr({install(r){Wh(n),n._a=r,r.provide(wy,n),r.config.globalProperties.$pinia=n,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:s,_s:new Map,state:e});return n}const vf=()=>{};function cg(s,e,t,i=vf){s.add(e);const n=()=>{s.delete(e)&&i()};return!t&&xx()&&LS(n),n}function yo(s,...e){s.forEach(t=>{t(...e)})}const s_=s=>s(),hg=Symbol(),_u=Symbol();function xf(s,e){s instanceof Map&&e instanceof Map?e.forEach((t,i)=>s.set(i,t)):s instanceof Set&&e instanceof Set&&e.forEach(s.add,s);for(const t in e){if(!Object.hasOwn(e,t))continue;const i=e[t],n=s[t];lg(n)&&lg(i)&&Object.hasOwn(s,t)&&!zt(i)&&!Bn(i)?s[t]=xf(n,i):s[t]=i}return s}const n_=Symbol();function r_(s){return!s||typeof s!="object"||!Object.hasOwn(s,n_)}const{assign:Kn}=Object;function o_(s){return!!(zt(s)&&s.effect)}function a_(s,e,t,i){const{state:n,actions:r,getters:o}=e,a=t.state.value[s];let c;function l(){a||(t.state.value[s]=n?n():{});const h=rT(t.state.value[s]);return Kn(h,r,Object.keys(o||{}).reduce((u,d)=>(u[d]=lr(qe(()=>{Wh(t);const f=t._s.get(s);return o[d].call(f,f)})),u),{}))}return c=Sy(s,l,e,t,i,!0),c}function Sy(s,e,t={},i,n,r){let o;const a=Kn({actions:{}},t),c={deep:!0};let l,h,u=new Set,d=new Set,f;const p=i.state.value[s];!r&&!p&&(i.state.value[s]={});let m;function g(b){let _;l=h=!1,typeof b=="function"?(b(i.state.value[s]),_={type:"patch function",storeId:s,events:f}):(xf(i.state.value[s],b),_={type:"patch object",payload:b,storeId:s,events:f});const I=m=Symbol();Uh().then(()=>{m===I&&(l=!0)}),h=!0,yo(u,_,i.state.value[s])}const v=r?function(){const{state:_}=t,I=_?_():{};this.$patch(F=>{Kn(F,I)})}:vf;function y(){o.stop(),u.clear(),d.clear(),i._s.delete(s)}const x=(b,_="")=>{if(hg in b)return b[_u]=_,b;const I=function(){Wh(i);const F=Array.from(arguments),E=new Set,k=new Set;function B(L){E.add(L)}function N(L){k.add(L)}yo(d,{args:F,name:I[_u],store:A,after:B,onError:N});let $;try{$=b.apply(this&&this.$id===s?this:A,F)}catch(L){throw yo(k,L),L}return $ instanceof Promise?$.then(L=>(yo(E,L),L)).catch(L=>(yo(k,L),Promise.reject(L))):(yo(E,$),$)};return I[hg]=!0,I[_u]=_,I},T={_p:i,$id:s,$onAction:cg.bind(null,d),$patch:g,$reset:v,$subscribe(b,_={}){if(u.has(b))return vf;const I=cg(u,b,_.detached,()=>F()),F=o.run(()=>Yi(()=>i.state.value[s],E=>{(_.flush==="sync"?h:l)&&b({storeId:s,type:"direct",events:f},E)},Kn({},c,_)));return I},$dispose:y},A=co(T);i._s.set(s,A);const S=(i._a&&i._a.runWithContext||s_)(()=>i._e.run(()=>(o=vx()).run(()=>e({action:x}))));for(const b in S){const _=S[b];zt(_)&&!o_(_)||Bn(_)?r||(p&&r_(_)&&(zt(_)?_.value=p[b]:((_ instanceof Set||_ instanceof Map)&&_.clear(),xf(_,p[b]))),i.state.value[s][b]=_):typeof _=="function"&&(S[b]=x(_,b),a.actions[b]=_)}return Kn(A,S),Kn(yt(A),S),Object.defineProperty(A,"$state",{get:()=>i.state.value[s],set:b=>{g(_=>{Kn(_,b)})}}),i._p.forEach(b=>{const _=o.run(()=>b({store:A,app:i._a,pinia:i,options:a}));Kn(A,_)}),p&&r&&t.hydrate&&t.hydrate(A.$state,p),l=!0,h=!0,A}/*! #__NO_SIDE_EFFECTS__ */function l_(s,e,t){let i;const n=typeof e=="function";i=n?t:e;function r(o,a){const c=pT();return o=o||(c?Xo(wy,null):null),o&&Wh(o),o=by,o._s.has(s)||(n?Sy(s,e,i,o):a_(s,i,o)),o._s.get(s)}return r.$id=s,r}var ho=(s=>(s[s.WEBGL_LEGACY=0]="WEBGL_LEGACY",s[s.WEBGL=1]="WEBGL",s[s.WEBGL2=2]="WEBGL2",s))(ho||{}),Ty=(s=>(s[s.UNKNOWN=0]="UNKNOWN",s[s.WEBGL=1]="WEBGL",s[s.CANVAS=2]="CANVAS",s))(Ty||{}),yf=(s=>(s[s.COLOR=16384]="COLOR",s[s.DEPTH=256]="DEPTH",s[s.STENCIL=1024]="STENCIL",s))(yf||{}),He=(s=>(s[s.NORMAL=0]="NORMAL",s[s.ADD=1]="ADD",s[s.MULTIPLY=2]="MULTIPLY",s[s.SCREEN=3]="SCREEN",s[s.OVERLAY=4]="OVERLAY",s[s.DARKEN=5]="DARKEN",s[s.LIGHTEN=6]="LIGHTEN",s[s.COLOR_DODGE=7]="COLOR_DODGE",s[s.COLOR_BURN=8]="COLOR_BURN",s[s.HARD_LIGHT=9]="HARD_LIGHT",s[s.SOFT_LIGHT=10]="SOFT_LIGHT",s[s.DIFFERENCE=11]="DIFFERENCE",s[s.EXCLUSION=12]="EXCLUSION",s[s.HUE=13]="HUE",s[s.SATURATION=14]="SATURATION",s[s.COLOR=15]="COLOR",s[s.LUMINOSITY=16]="LUMINOSITY",s[s.NORMAL_NPM=17]="NORMAL_NPM",s[s.ADD_NPM=18]="ADD_NPM",s[s.SCREEN_NPM=19]="SCREEN_NPM",s[s.NONE=20]="NONE",s[s.SRC_OVER=0]="SRC_OVER",s[s.SRC_IN=21]="SRC_IN",s[s.SRC_OUT=22]="SRC_OUT",s[s.SRC_ATOP=23]="SRC_ATOP",s[s.DST_OVER=24]="DST_OVER",s[s.DST_IN=25]="DST_IN",s[s.DST_OUT=26]="DST_OUT",s[s.DST_ATOP=27]="DST_ATOP",s[s.ERASE=26]="ERASE",s[s.SUBTRACT=28]="SUBTRACT",s[s.XOR=29]="XOR",s))(He||{}),sn=(s=>(s[s.POINTS=0]="POINTS",s[s.LINES=1]="LINES",s[s.LINE_LOOP=2]="LINE_LOOP",s[s.LINE_STRIP=3]="LINE_STRIP",s[s.TRIANGLES=4]="TRIANGLES",s[s.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",s[s.TRIANGLE_FAN=6]="TRIANGLE_FAN",s))(sn||{}),Se=(s=>(s[s.RGBA=6408]="RGBA",s[s.RGB=6407]="RGB",s[s.RG=33319]="RG",s[s.RED=6403]="RED",s[s.RGBA_INTEGER=36249]="RGBA_INTEGER",s[s.RGB_INTEGER=36248]="RGB_INTEGER",s[s.RG_INTEGER=33320]="RG_INTEGER",s[s.RED_INTEGER=36244]="RED_INTEGER",s[s.ALPHA=6406]="ALPHA",s[s.LUMINANCE=6409]="LUMINANCE",s[s.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",s[s.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",s[s.DEPTH_STENCIL=34041]="DEPTH_STENCIL",s))(Se||{}),Yo=(s=>(s[s.TEXTURE_2D=3553]="TEXTURE_2D",s[s.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",s[s.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",s[s.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",s[s.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",s[s.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",s[s.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",s))(Yo||{}),Ne=(s=>(s[s.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",s[s.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",s[s.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",s[s.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",s[s.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",s[s.UNSIGNED_INT=5125]="UNSIGNED_INT",s[s.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",s[s.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",s[s.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",s[s.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",s[s.BYTE=5120]="BYTE",s[s.SHORT=5122]="SHORT",s[s.INT=5124]="INT",s[s.FLOAT=5126]="FLOAT",s[s.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",s[s.HALF_FLOAT=36193]="HALF_FLOAT",s))(Ne||{}),Oe=(s=>(s[s.FLOAT=0]="FLOAT",s[s.INT=1]="INT",s[s.UINT=2]="UINT",s))(Oe||{}),Cs=(s=>(s[s.NEAREST=0]="NEAREST",s[s.LINEAR=1]="LINEAR",s))(Cs||{}),Is=(s=>(s[s.CLAMP=33071]="CLAMP",s[s.REPEAT=10497]="REPEAT",s[s.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",s))(Is||{}),gs=(s=>(s[s.OFF=0]="OFF",s[s.POW2=1]="POW2",s[s.ON=2]="ON",s[s.ON_MANUAL=3]="ON_MANUAL",s))(gs||{}),xi=(s=>(s[s.NPM=0]="NPM",s[s.UNPACK=1]="UNPACK",s[s.PMA=2]="PMA",s[s.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",s[s.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",s[s.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",s))(xi||{}),Zs=(s=>(s[s.NO=0]="NO",s[s.YES=1]="YES",s[s.AUTO=2]="AUTO",s[s.BLEND=0]="BLEND",s[s.CLEAR=1]="CLEAR",s[s.BLIT=2]="BLIT",s))(Zs||{}),Wm=(s=>(s[s.AUTO=0]="AUTO",s[s.MANUAL=1]="MANUAL",s))(Wm||{}),fs=(s=>(s.LOW="lowp",s.MEDIUM="mediump",s.HIGH="highp",s))(fs||{}),ci=(s=>(s[s.NONE=0]="NONE",s[s.SCISSOR=1]="SCISSOR",s[s.STENCIL=2]="STENCIL",s[s.SPRITE=3]="SPRITE",s[s.COLOR=4]="COLOR",s))(ci||{}),ai=(s=>(s[s.NONE=0]="NONE",s[s.LOW=2]="LOW",s[s.MEDIUM=4]="MEDIUM",s[s.HIGH=8]="HIGH",s))(ai||{}),an=(s=>(s[s.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",s[s.ARRAY_BUFFER=34962]="ARRAY_BUFFER",s[s.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",s))(an||{});const c_={createCanvas:(s,e)=>{const t=document.createElement("canvas");return t.width=s,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(s,e)=>fetch(s,e),parseXML:s=>new DOMParser().parseFromString(s,"text/xml")},ke={ADAPTER:c_,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Cu=/iPhone/i,ug=/iPod/i,dg=/iPad/i,fg=/\biOS-universal(?:.+)Mac\b/i,Au=/\bAndroid(?:.+)Mobile\b/i,mg=/Android/i,bo=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Ll=/Silk/i,gn=/Windows Phone/i,pg=/\bWindows(?:.+)ARM\b/i,gg=/BlackBerry/i,vg=/BB10/i,xg=/Opera Mini/i,yg=/\b(CriOS|Chrome)(?:.+)Mobile/i,bg=/Mobile(?:.+)Firefox\b/i,wg=function(s){return typeof s<"u"&&s.platform==="MacIntel"&&typeof s.maxTouchPoints=="number"&&s.maxTouchPoints>1&&typeof MSStream>"u"};function h_(s){return function(e){return e.test(s)}}function Sg(s){var e={userAgent:"",platform:"",maxTouchPoints:0};!s&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof s=="string"?e.userAgent=s:s&&s.userAgent&&(e={userAgent:s.userAgent,platform:s.platform,maxTouchPoints:s.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=h_(t),r={apple:{phone:n(Cu)&&!n(gn),ipod:n(ug),tablet:!n(Cu)&&(n(dg)||wg(e))&&!n(gn),universal:n(fg),device:(n(Cu)||n(ug)||n(dg)||n(fg)||wg(e))&&!n(gn)},amazon:{phone:n(bo),tablet:!n(bo)&&n(Ll),device:n(bo)||n(Ll)},android:{phone:!n(gn)&&n(bo)||!n(gn)&&n(Au),tablet:!n(gn)&&!n(bo)&&!n(Au)&&(n(Ll)||n(mg)),device:!n(gn)&&(n(bo)||n(Ll)||n(Au)||n(mg))||n(/\bokhttp\b/i)},windows:{phone:n(gn),tablet:n(pg),device:n(gn)||n(pg)},other:{blackberry:n(gg),blackberry10:n(vg),opera:n(xg),firefox:n(bg),chrome:n(yg),device:n(gg)||n(vg)||n(xg)||n(bg)||n(yg)},any:!1,phone:!1,tablet:!1};return r.any=r.apple.device||r.android.device||r.windows.device||r.other.device,r.phone=r.apple.phone||r.android.phone||r.windows.phone,r.tablet=r.apple.tablet||r.android.tablet||r.windows.tablet,r}const u_=Sg.default??Sg,En=u_(globalThis.navigator);ke.RETINA_PREFIX=/@([0-9\.]+)x/;ke.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Gc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function My(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function d_(s){if(Object.prototype.hasOwnProperty.call(s,"__esModule"))return s;var e=s.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(i){var n=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return s[i]}})}),t}var Eu={exports:{}},Tg;function f_(){return Tg||(Tg=1,(function(s){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function n(c,l,h){this.fn=c,this.context=l,this.once=h||!1}function r(c,l,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new n(h,u||c,d),p=t?t+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],f]:c._events[p].push(f):(c._events[p]=f,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new i:delete c._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],h,u;if(this._eventsCount===0)return l;for(u in h=this._events)e.call(h,u)&&l.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(h)):l},a.prototype.listeners=function(l){var h=t?t+l:l,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d80*C){Y=q=L[0],W=ne=L[1];for(var ce=C;ceq&&(q=re),me>ne&&(ne=me);ve=Math.max(q-Y,ne-W),ve=ve!==0?32767/ve:0}return i(D,V,C,Y,W,ve,0),V}function e(L,U,C,P,O){var D,V;if(O===$(L,U,C,P)>0)for(D=U;D=U;D-=P)V=k(D,L[D],L[D+1],V);return V&&T(V,V.next)&&(B(V),V=V.next),V}function t(L,U){if(!L)return L;U||(U=L);var C=L,P;do if(P=!1,!C.steiner&&(T(C,C.next)||x(C.prev,C,C.next)===0)){if(B(C),C=U=C.prev,C===C.next)break;P=!0}else C=C.next;while(P||C!==U);return U}function i(L,U,C,P,O,D,V){if(L){!V&&D&&f(L,P,O,D);for(var Y=L,W,q;L.prev!==L.next;){if(W=L.prev,q=L.next,D?r(L,P,O,D):n(L)){U.push(W.i/C|0),U.push(L.i/C|0),U.push(q.i/C|0),B(L),L=q.next,Y=q.next;continue}if(L=q,L===Y){V?V===1?(L=o(t(L),U,C),i(L,U,C,P,O,D,2)):V===2&&a(L,U,C,P,O,D):i(t(L),U,C,P,O,D,1);break}}}}function n(L){var U=L.prev,C=L,P=L.next;if(x(U,C,P)>=0)return!1;for(var O=U.x,D=C.x,V=P.x,Y=U.y,W=C.y,q=P.y,ne=OD?O>V?O:V:D>V?D:V,ve=Y>W?Y>q?Y:q:W>q?W:q,ce=P.next;ce!==U;){if(ce.x>=ne&&ce.x<=me&&ce.y>=re&&ce.y<=ve&&v(O,Y,D,W,V,q,ce.x,ce.y)&&x(ce.prev,ce,ce.next)>=0)return!1;ce=ce.next}return!0}function r(L,U,C,P){var O=L.prev,D=L,V=L.next;if(x(O,D,V)>=0)return!1;for(var Y=O.x,W=D.x,q=V.x,ne=O.y,re=D.y,me=V.y,ve=YW?Y>q?Y:q:W>q?W:q,X=ne>re?ne>me?ne:me:re>me?re:me,j=m(ve,ce,U,C,P),H=m(de,X,U,C,P),G=L.prevZ,z=L.nextZ;G&&G.z>=j&&z&&z.z<=H;){if(G.x>=ve&&G.x<=de&&G.y>=ce&&G.y<=X&&G!==O&&G!==V&&v(Y,ne,W,re,q,me,G.x,G.y)&&x(G.prev,G,G.next)>=0||(G=G.prevZ,z.x>=ve&&z.x<=de&&z.y>=ce&&z.y<=X&&z!==O&&z!==V&&v(Y,ne,W,re,q,me,z.x,z.y)&&x(z.prev,z,z.next)>=0))return!1;z=z.nextZ}for(;G&&G.z>=j;){if(G.x>=ve&&G.x<=de&&G.y>=ce&&G.y<=X&&G!==O&&G!==V&&v(Y,ne,W,re,q,me,G.x,G.y)&&x(G.prev,G,G.next)>=0)return!1;G=G.prevZ}for(;z&&z.z<=H;){if(z.x>=ve&&z.x<=de&&z.y>=ce&&z.y<=X&&z!==O&&z!==V&&v(Y,ne,W,re,q,me,z.x,z.y)&&x(z.prev,z,z.next)>=0)return!1;z=z.nextZ}return!0}function o(L,U,C){var P=L;do{var O=P.prev,D=P.next.next;!T(O,D)&&A(O,P,P.next,D)&&I(O,D)&&I(D,O)&&(U.push(O.i/C|0),U.push(P.i/C|0),U.push(D.i/C|0),B(P),B(P.next),P=L=D),P=P.next}while(P!==L);return t(P)}function a(L,U,C,P,O,D){var V=L;do{for(var Y=V.next.next;Y!==V.prev;){if(V.i!==Y.i&&y(V,Y)){var W=E(V,Y);V=t(V,V.next),W=t(W,W.next),i(V,U,C,P,O,D,0),i(W,U,C,P,O,D,0);return}Y=Y.next}V=V.next}while(V!==L)}function c(L,U,C,P){var O=[],D,V,Y,W,q;for(D=0,V=U.length;D=C.next.y&&C.next.y!==C.y){var Y=C.x+(O-C.y)*(C.next.x-C.x)/(C.next.y-C.y);if(Y<=P&&Y>D&&(D=Y,V=C.x=C.x&&C.x>=q&&P!==C.x&&v(OV.x||C.x===V.x&&d(V,C)))&&(V=C,re=me)),C=C.next;while(C!==W);return V}function d(L,U){return x(L.prev,L,U.prev)<0&&x(U.next,L,L.next)<0}function f(L,U,C,P){var O=L;do O.z===0&&(O.z=m(O.x,O.y,U,C,P)),O.prevZ=O.prev,O.nextZ=O.next,O=O.next;while(O!==L);O.prevZ.nextZ=null,O.prevZ=null,p(O)}function p(L){var U,C,P,O,D,V,Y,W,q=1;do{for(C=L,L=null,D=null,V=0;C;){for(V++,P=C,Y=0,U=0;U0||W>0&&P;)Y!==0&&(W===0||!P||C.z<=P.z)?(O=C,C=C.nextZ,Y--):(O=P,P=P.nextZ,W--),D?D.nextZ=O:L=O,O.prevZ=D,D=O;C=P}D.nextZ=null,q*=2}while(V>1);return L}function m(L,U,C,P,O){return L=(L-C)*O|0,U=(U-P)*O|0,L=(L|L<<8)&16711935,L=(L|L<<4)&252645135,L=(L|L<<2)&858993459,L=(L|L<<1)&1431655765,U=(U|U<<8)&16711935,U=(U|U<<4)&252645135,U=(U|U<<2)&858993459,U=(U|U<<1)&1431655765,L|U<<1}function g(L){var U=L,C=L;do(U.x=(L-V)*(D-Y)&&(L-V)*(P-Y)>=(C-V)*(U-Y)&&(C-V)*(D-Y)>=(O-V)*(P-Y)}function y(L,U){return L.next.i!==U.i&&L.prev.i!==U.i&&!_(L,U)&&(I(L,U)&&I(U,L)&&F(L,U)&&(x(L.prev,L,U.prev)||x(L,U.prev,U))||T(L,U)&&x(L.prev,L,L.next)>0&&x(U.prev,U,U.next)>0)}function x(L,U,C){return(U.y-L.y)*(C.x-U.x)-(U.x-L.x)*(C.y-U.y)}function T(L,U){return L.x===U.x&&L.y===U.y}function A(L,U,C,P){var O=b(x(L,U,C)),D=b(x(L,U,P)),V=b(x(C,P,L)),Y=b(x(C,P,U));return!!(O!==D&&V!==Y||O===0&&S(L,C,U)||D===0&&S(L,P,U)||V===0&&S(C,L,P)||Y===0&&S(C,U,P))}function S(L,U,C){return U.x<=Math.max(L.x,C.x)&&U.x>=Math.min(L.x,C.x)&&U.y<=Math.max(L.y,C.y)&&U.y>=Math.min(L.y,C.y)}function b(L){return L>0?1:L<0?-1:0}function _(L,U){var C=L;do{if(C.i!==L.i&&C.next.i!==L.i&&C.i!==U.i&&C.next.i!==U.i&&A(C,C.next,L,U))return!0;C=C.next}while(C!==L);return!1}function I(L,U){return x(L.prev,L,L.next)<0?x(L,U,L.next)>=0&&x(L,L.prev,U)>=0:x(L,U,L.prev)<0||x(L,L.next,U)<0}function F(L,U){var C=L,P=!1,O=(L.x+U.x)/2,D=(L.y+U.y)/2;do C.y>D!=C.next.y>D&&C.next.y!==C.y&&O<(C.next.x-C.x)*(D-C.y)/(C.next.y-C.y)+C.x&&(P=!P),C=C.next;while(C!==L);return P}function E(L,U){var C=new N(L.i,L.x,L.y),P=new N(U.i,U.x,U.y),O=L.next,D=U.prev;return L.next=U,U.prev=L,C.next=O,O.prev=C,P.next=C,C.prev=P,D.next=P,P.prev=D,P}function k(L,U,C,P){var O=new N(L,U,C);return P?(O.next=P.next,O.prev=P,P.next.prev=O,P.next=O):(O.prev=O,O.next=O),O}function B(L){L.next.prev=L.prev,L.prev.next=L.next,L.prevZ&&(L.prevZ.nextZ=L.nextZ),L.nextZ&&(L.nextZ.prevZ=L.prevZ)}function N(L,U,C){this.i=L,this.x=U,this.y=C,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}s.deviation=function(L,U,C,P){var O=U&&U.length,D=O?U[0]*C:L.length,V=Math.abs($(L,0,D,C));if(O)for(var Y=0,W=U.length;Y0&&(P+=L[O-1].length,C.holes.push(P))}return C},Dl.exports}var g_=p_();const v_=My(g_);var Pr={},Ra={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var x_=Ra.exports,_g;function y_(){return _g||(_g=1,(function(s,e){(function(t){var i=e&&!e.nodeType&&e,n=s&&!s.nodeType&&s,r=typeof Gc=="object"&&Gc;(r.global===r||r.window===r||r.self===r)&&(t=r);var o,a=2147483647,c=36,l=1,h=26,u=38,d=700,f=72,p=128,m="-",g=/^xn--/,v=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=c-l,A=Math.floor,S=String.fromCharCode,b;function _(O){throw new RangeError(x[O])}function I(O,D){for(var V=O.length,Y=[];V--;)Y[V]=D(O[V]);return Y}function F(O,D){var V=O.split("@"),Y="";V.length>1&&(Y=V[0]+"@",O=V[1]),O=O.replace(y,".");var W=O.split("."),q=I(W,D).join(".");return Y+q}function E(O){for(var D=[],V=0,Y=O.length,W,q;V=55296&&W<=56319&&V65535&&(D-=65536,V+=S(D>>>10&1023|55296),D=56320|D&1023),V+=S(D),V}).join("")}function B(O){return O-48<10?O-22:O-65<26?O-65:O-97<26?O-97:c}function N(O,D){return O+22+75*(O<26)-((D!=0)<<5)}function $(O,D,V){var Y=0;for(O=V?A(O/d):O>>1,O+=A(O/D);O>T*h>>1;Y+=c)O=A(O/T);return A(Y+(T+1)*O/(O+u))}function L(O){var D=[],V=O.length,Y,W=0,q=p,ne=f,re,me,ve,ce,de,X,j,H,G;for(re=O.lastIndexOf(m),re<0&&(re=0),me=0;me=128&&_("not-basic"),D.push(O.charCodeAt(me));for(ve=re>0?re+1:0;ve=V&&_("invalid-input"),j=B(O.charCodeAt(ve++)),(j>=c||j>A((a-W)/de))&&_("overflow"),W+=j*de,H=X<=ne?l:X>=ne+h?h:X-ne,!(jA(a/G)&&_("overflow"),de*=G;Y=D.length+1,ne=$(W-ce,Y,ce==0),A(W/Y)>a-q&&_("overflow"),q+=A(W/Y),W%=Y,D.splice(W++,0,q)}return k(D)}function U(O){var D,V,Y,W,q,ne,re,me,ve,ce,de,X=[],j,H,G,z;for(O=E(O),j=O.length,D=p,V=0,q=f,ne=0;ne=D&&deA((a-V)/H)&&_("overflow"),V+=(re-D)*H,D=re,ne=0;nea&&_("overflow"),de==D){for(me=V,ve=c;ce=ve<=q?l:ve>=q+h?h:ve-q,!(me-1e3&&ie<1e3||S.call(/e/,oe))return oe;var lt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ie=="number"){var _t=ie<0?-F(-ie):F(ie);if(_t!==ie){var Ct=String(_t),et=y.call(oe,Ct.length+1);return x.call(Ct,lt,"$&_")+"."+x.call(x.call(et,/([0-9]{3})/g,"$&_"),/_$/,"")}}return x.call(oe,lt,"$&_")}var P=S_,O=P.custom,D=H(O)?O:null,V={__proto__:null,double:'"',single:"'"},Y={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Ru=function ie(oe,lt,_t,Ct){var et=lt||{};if(te(et,"quoteStyle")&&!te(V,et.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(te(et,"maxStringLength")&&(typeof et.maxStringLength=="number"?et.maxStringLength<0&&et.maxStringLength!==1/0:et.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var rs=te(et,"customInspect")?et.customInspect:!0;if(typeof rs!="boolean"&&rs!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(te(et,"indent")&&et.indent!==null&&et.indent!==" "&&!(parseInt(et.indent,10)===et.indent&&et.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(te(et,"numericSeparator")&&typeof et.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var ni=et.numericSeparator;if(typeof oe>"u")return"undefined";if(oe===null)return"null";if(typeof oe=="boolean")return oe?"true":"false";if(typeof oe=="string")return ze(oe,et);if(typeof oe=="number"){if(oe===0)return 1/0/oe>0?"0":"-0";var Kt=String(oe);return ni?C(oe,Kt):Kt}if(typeof oe=="bigint"){var At=String(oe)+"n";return ni?C(oe,At):At}var vs=typeof et.depth>"u"?5:et.depth;if(typeof _t>"u"&&(_t=0),_t>=vs&&vs>0&&typeof oe=="object")return re(oe)?"[Array]":"[Object]";var Ci=mi(et,_t);if(typeof Ct>"u")Ct=[];else if(ue(Ct,oe)>=0)return"[Circular]";function ri(pe,_e,wt){if(_e&&(Ct=I.call(Ct),Ct.push(_e)),wt){var Bt={depth:et.depth};return te(et,"quoteStyle")&&(Bt.quoteStyle=et.quoteStyle),ie(pe,Bt,_t+1,Ct)}return ie(pe,et,_t+1,Ct)}if(typeof oe=="function"&&!ve(oe)){var fn=se(oe),Bs=vt(oe,ri);return"[Function"+(fn?": "+fn:" (anonymous)")+"]"+(Bs.length>0?" { "+_.call(Bs,", ")+" }":"")}if(H(oe)){var Ls=N?x.call(String(oe),/^(Symbol\(.*\))_[^)]*$/,"$1"):B.call(oe);return typeof oe=="object"&&!N?Le(Ls):Ls}if(Ze(oe)){for(var Ds="<"+A.call(String(oe.nodeName)),_r=oe.attributes||[],Gi=0;Gi<_r.length;Gi++)Ds+=" "+_r[Gi].name+"="+W(q(_r[Gi].value),"double",et);return Ds+=">",oe.childNodes&&oe.childNodes.length&&(Ds+="..."),Ds+="",Ds}if(re(oe)){if(oe.length===0)return"[]";var fa=vt(oe,ri);return Ci&&!we(fa)?"["+Rt(fa,Ci)+"]":"[ "+_.call(fa,", ")+" ]"}if(ce(oe)){var ma=vt(oe,ri);return!("cause"in Error.prototype)&&"cause"in oe&&!L.call(oe,"cause")?"{ ["+String(oe)+"] "+_.call(b.call("[cause]: "+ri(oe.cause),ma),", ")+" }":ma.length===0?"["+String(oe)+"]":"{ ["+String(oe)+"] "+_.call(ma,", ")+" }"}if(typeof oe=="object"&&rs){if(D&&typeof oe[D]=="function"&&P)return P(oe,{depth:vs-_t});if(rs!=="symbol"&&typeof oe.inspect=="function")return oe.inspect()}if(ae(oe)){var El=[];return i&&i.call(oe,function(pe,_e){El.push(ri(_e,oe,!0)+" => "+ri(pe,oe))}),at("Map",t.call(oe),El,Ci)}if(fe(oe)){var Il=[];return a&&a.call(oe,function(pe){Il.push(ri(pe,oe))}),at("Set",o.call(oe),Il,Ci)}if(Ee(oe))return be("WeakMap");if(De(oe))return be("WeakSet");if(xe(oe))return be("WeakRef");if(X(oe))return Le(ri(Number(oe)));if(G(oe))return Le(ri(E.call(oe)));if(j(oe))return Le(p.call(oe));if(de(oe))return Le(ri(String(oe)));if(typeof window<"u"&&oe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&oe===globalThis||typeof Gc<"u"&&oe===Gc)return"{ [object globalThis] }";if(!me(oe)&&!ve(oe)){var vo=vt(oe,ri),Rl=U?U(oe)===Object.prototype:oe instanceof Object||oe.constructor===Object,pa=oe instanceof Object?"":"null prototype",Pl=!Rl&&$&&Object(oe)===oe&&$ in oe?y.call(he(oe),8,-1):pa?"Object":"",du=Rl||typeof oe.constructor!="function"?"":oe.constructor.name?oe.constructor.name+" ":"",ee=du+(Pl||pa?"["+_.call(b.call([],Pl||[],pa||[]),": ")+"] ":"");return vo.length===0?ee+"{}":Ci?ee+"{"+Rt(vo,Ci)+"}":ee+"{ "+_.call(vo,", ")+" }"}return String(oe)};function W(ie,oe,lt){var _t=lt.quoteStyle||oe,Ct=V[_t];return Ct+ie+Ct}function q(ie){return x.call(String(ie),/"/g,""")}function ne(ie){return!$||!(typeof ie=="object"&&($ in ie||typeof ie[$]<"u"))}function re(ie){return he(ie)==="[object Array]"&&ne(ie)}function me(ie){return he(ie)==="[object Date]"&&ne(ie)}function ve(ie){return he(ie)==="[object RegExp]"&&ne(ie)}function ce(ie){return he(ie)==="[object Error]"&&ne(ie)}function de(ie){return he(ie)==="[object String]"&&ne(ie)}function X(ie){return he(ie)==="[object Number]"&&ne(ie)}function j(ie){return he(ie)==="[object Boolean]"&&ne(ie)}function H(ie){if(N)return ie&&typeof ie=="object"&&ie instanceof Symbol;if(typeof ie=="symbol")return!0;if(!ie||typeof ie!="object"||!B)return!1;try{return B.call(ie),!0}catch{}return!1}function G(ie){if(!ie||typeof ie!="object"||!E)return!1;try{return E.call(ie),!0}catch{}return!1}var z=Object.prototype.hasOwnProperty||function(ie){return ie in this};function te(ie,oe){return z.call(ie,oe)}function he(ie){return m.call(ie)}function se(ie){if(ie.name)return ie.name;var oe=v.call(g.call(ie),/^function\s*([\w$]+)/);return oe?oe[1]:null}function ue(ie,oe){if(ie.indexOf)return ie.indexOf(oe);for(var lt=0,_t=ie.length;lt<_t;lt++)if(ie[lt]===oe)return lt;return-1}function ae(ie){if(!t||!ie||typeof ie!="object")return!1;try{t.call(ie);try{o.call(ie)}catch{return!0}return ie instanceof Map}catch{}return!1}function Ee(ie){if(!l||!ie||typeof ie!="object")return!1;try{l.call(ie,l);try{u.call(ie,u)}catch{return!0}return ie instanceof WeakMap}catch{}return!1}function xe(ie){if(!f||!ie||typeof ie!="object")return!1;try{return f.call(ie),!0}catch{}return!1}function fe(ie){if(!o||!ie||typeof ie!="object")return!1;try{o.call(ie);try{t.call(ie)}catch{return!0}return ie instanceof Set}catch{}return!1}function De(ie){if(!u||!ie||typeof ie!="object")return!1;try{u.call(ie,u);try{l.call(ie,l)}catch{return!0}return ie instanceof WeakSet}catch{}return!1}function Ze(ie){return!ie||typeof ie!="object"?!1:typeof HTMLElement<"u"&&ie instanceof HTMLElement?!0:typeof ie.nodeName=="string"&&typeof ie.getAttribute=="function"}function ze(ie,oe){if(ie.length>oe.maxStringLength){var lt=ie.length-oe.maxStringLength,_t="... "+lt+" more character"+(lt>1?"s":"");return ze(y.call(ie,0,oe.maxStringLength),oe)+_t}var Ct=Y[oe.quoteStyle||"single"];Ct.lastIndex=0;var et=x.call(x.call(ie,Ct,"\\$1"),/[\x00-\x1f]/g,Ke);return W(et,"single",oe)}function Ke(ie){var oe=ie.charCodeAt(0),lt={8:"b",9:"t",10:"n",12:"f",13:"r"}[oe];return lt?"\\"+lt:"\\x"+(oe<16?"0":"")+T.call(oe.toString(16))}function Le(ie){return"Object("+ie+")"}function be(ie){return ie+" { ? }"}function at(ie,oe,lt,_t){var Ct=_t?Rt(lt,_t):_.call(lt,", ");return ie+" ("+oe+") {"+Ct+"}"}function we(ie){for(var oe=0;oe=0)return!1;return!0}function mi(ie,oe){var lt;if(ie.indent===" ")lt=" ";else if(typeof ie.indent=="number"&&ie.indent>0)lt=_.call(Array(ie.indent+1)," ");else return null;return{base:lt,prev:_.call(Array(oe+1),lt)}}function Rt(ie,oe){if(ie.length===0)return"";var lt=` -`+oe.prev+oe.base;return lt+_.call(ie,","+lt)+` -`+oe.prev}function vt(ie,oe){var lt=re(ie),_t=[];if(lt){_t.length=ie.length;for(var Ct=0;Ct"u"||!b?s:b(Uint8Array),N={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":S&&b?b([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?s:Float16Array,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":k,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&b?b(b([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!S||!b?s:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":y,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":n,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!S||!b?s:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&b?b(""[Symbol.iterator]()):s,"%Symbol%":S?Symbol:s,"%SyntaxError%":o,"%ThrowTypeError%":A,"%TypedArray%":B,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet,"%Function.prototype.call%":E,"%Function.prototype.apply%":F,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":_,"%Math.abs%":l,"%Math.floor%":h,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":p,"%Math.sign%":m,"%Reflect.getPrototypeOf%":I};if(b)try{null.error}catch(ve){var $=b(b(ve));N["%Error.prototype%"]=$}var L=function ve(ce){var de;if(ce==="%AsyncFunction%")de=v("async function () {}");else if(ce==="%GeneratorFunction%")de=v("function* () {}");else if(ce==="%AsyncGeneratorFunction%")de=v("async function* () {}");else if(ce==="%AsyncGenerator%"){var X=ve("%AsyncGeneratorFunction%");X&&(de=X.prototype)}else if(ce==="%AsyncIteratorPrototype%"){var j=ve("%AsyncGenerator%");j&&b&&(de=b(j.prototype))}return N[ce]=de,de},U={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},C=qh(),P=j_(),O=C.call(E,Array.prototype.concat),D=C.call(F,Array.prototype.splice),V=C.call(E,String.prototype.replace),Y=C.call(E,String.prototype.slice),W=C.call(E,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ne=/\\(\\)?/g,re=function(ce){var de=Y(ce,0,1),X=Y(ce,-1);if(de==="%"&&X!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(X==="%"&&de!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var j=[];return V(ce,q,function(H,G,z,te){j[j.length]=z?V(te,ne,"$1"):G||H}),j},me=function(ce,de){var X=ce,j;if(P(U,X)&&(j=U[X],X="%"+j[0]+"%"),P(N,X)){var H=N[X];if(H===k&&(H=L(X)),typeof H>"u"&&!de)throw new a("intrinsic "+ce+" exists, but is not available. Please file an issue!");return{alias:j,name:X,value:H}}throw new o("intrinsic "+ce+" does not exist!")};return hd=function(ce,de){if(typeof ce!="string"||ce.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof de!="boolean")throw new a('"allowMissing" argument must be a boolean');if(W(/^%?[^%]*%?$/,ce)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var X=re(ce),j=X.length>0?X[0]:"",H=me("%"+j+"%",de),G=H.name,z=H.value,te=!1,he=H.alias;he&&(j=he[0],D(X,O([0,1],he)));for(var se=1,ue=!0;se=X.length){var fe=y(z,ae);ue=!!fe,ue&&"get"in fe&&!("originalValue"in fe.get)?z=fe.get:z=z[ae]}else ue=P(z,ae),z=z[ae];ue&&!te&&(N[G]=z)}}return z},hd}var ud,l0;function ky(){if(l0)return ud;l0=1;var s=qm(),e=Py(),t=e([s("%String.prototype.indexOf%")]);return ud=function(n,r){var o=s(n,!!r);return typeof o=="function"&&t(n,".prototype.")>-1?e([o]):o},ud}var dd,c0;function Fy(){if(c0)return dd;c0=1;var s=qm(),e=ky(),t=zh(),i=ca(),n=s("%Map%",!0),r=e("Map.prototype.get",!0),o=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),c=e("Map.prototype.delete",!0),l=e("Map.prototype.size",!0);return dd=!!n&&function(){var u,d={assert:function(f){if(!d.has(f))throw new i("Side channel does not contain "+t(f))},delete:function(f){if(u){var p=c(u,f);return l(u)===0&&(u=void 0),p}return!1},get:function(f){if(u)return r(u,f)},has:function(f){return u?a(u,f):!1},set:function(f,p){u||(u=new n),o(u,f,p)}};return d},dd}var fd,h0;function W_(){if(h0)return fd;h0=1;var s=qm(),e=ky(),t=zh(),i=Fy(),n=ca(),r=s("%WeakMap%",!0),o=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),c=e("WeakMap.prototype.has",!0),l=e("WeakMap.prototype.delete",!0);return fd=r?function(){var u,d,f={assert:function(p){if(!f.has(p))throw new n("Side channel does not contain "+t(p))},delete:function(p){if(r&&p&&(typeof p=="object"||typeof p=="function")){if(u)return l(u,p)}else if(i&&d)return d.delete(p);return!1},get:function(p){return r&&p&&(typeof p=="object"||typeof p=="function")&&u?o(u,p):d&&d.get(p)},has:function(p){return r&&p&&(typeof p=="object"||typeof p=="function")&&u?c(u,p):!!d&&d.has(p)},set:function(p,m){r&&p&&(typeof p=="object"||typeof p=="function")?(u||(u=new r),a(u,p,m)):i&&(d||(d=i()),d.set(p,m))}};return f}:i,fd}var md,u0;function Oy(){if(u0)return md;u0=1;var s=ca(),e=zh(),t=T_(),i=Fy(),n=W_(),r=n||i||t;return md=function(){var a,c={assert:function(l){if(!c.has(l)){var h=l&&Object(l)===l?"the given object key":e(l);throw new s("Side channel does not contain "+h)}},delete:function(l){return!!a&&a.delete(l)},get:function(l){return a&&a.get(l)},has:function(l){return!!a&&a.has(l)},set:function(l,h){a||(a=r()),a.set(l,h)}};return c},md}var pd,d0;function Km(){if(d0)return pd;d0=1;var s=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return pd={default:t.RFC3986,formatters:{RFC1738:function(i){return s.call(i,e,"+")},RFC3986:function(i){return String(i)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},pd}var gd,f0;function By(){if(f0)return gd;f0=1;var s=Km(),e=Oy(),t=Ay(),i=Object.prototype.hasOwnProperty,n=Array.isArray,r=e(),o=function(I,F){return r.set(I,F),I},a=function(I){return r.has(I)},c=function(I){return r.get(I)},l=function(I,F){r.set(I,F)},h=(function(){for(var _=[],I=0;I<256;++I)_[_.length]="%"+((I<16?"0":"")+I.toString(16)).toUpperCase();return _})(),u=function(I){for(;I.length>1;){var F=I.pop(),E=F.obj[F.prop];if(n(E)){for(var k=[],B=0;B=E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(I.concat(F),E),k)}I[k]=F}else if(I&&typeof I=="object")if(a(I)){var B=c(I)+1;I[B]=F,l(I,B)}else{if(E&&E.strictMerge)return[I,F];(E&&(E.plainObjects||E.allowPrototypes)||!i.call(Object.prototype,F))&&(I[F]=!0)}else return[I,F];return I}if(!I||typeof I!="object"){if(a(F)){for(var N=Object.keys(F),$=E&&E.plainObjects?{__proto__:null,0:I}:{0:I},L=0;LE.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(C,E),C.length-1)}return C}var P=I;if(n(I)&&!n(F)&&(P=d(I,E)),n(I)&&n(F)){if(F.forEach(function(O,D){if(i.call(I,D)){var V=I[D];V&&typeof V=="object"&&O&&typeof O=="object"?I[D]=_(V,O,E):I[I.length]=O}else I[D]=O}),E&&typeof E.arrayLimit=="number"&&I.length>E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(I,E),I.length-1)}return I}return Object.keys(F).reduce(function(O,D){var V=F[D];if(i.call(O,D)?f(O,D,_(O[D],V,E)):f(O,D,V),a(F)&&!a(O)&&o(O,c(F)),a(O)){var Y=parseInt(D,10);String(Y)===D&&Y>=0&&Y>c(O)&&l(O,Y)}return O},P)},m=function(I,F){return Object.keys(F).reduce(function(E,k){return f(E,k,F[k]),E},I)},g=function(_,I,F){var E=_.replace(/\+/g," ");if(F==="iso-8859-1")return E.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(E)}catch{return E}},v=1024,y=function(I,F,E,k,B){if(I.length===0)return I;var N=I;if(typeof I=="symbol"?N=Symbol.prototype.toString.call(I):typeof I!="string"&&(N=String(I)),E==="iso-8859-1")return escape(N).replace(/%u[0-9a-f]{4}/gi,function(V){return"%26%23"+parseInt(V.slice(2),16)+"%3B"});for(var $="",L=0;L=v?N.slice(L,L+v):N;if(L+v=55296&&C<=56319&&(U=U.slice(0,-1),L-=1)}for(var P=[],O=0;O=48&&D<=57||D>=65&&D<=90||D>=97&&D<=122||B===s.RFC1738&&(D===40||D===41)){P[P.length]=U.charAt(O);continue}if(D<128){P[P.length]=h[D];continue}if(D<2048){P[P.length]=h[192|D>>6]+h[128|D&63];continue}if(D<55296||D>=57344){P[P.length]=h[224|D>>12]+h[128|D>>6&63]+h[128|D&63];continue}O+=1,D=65536+((D&1023)<<10|U.charCodeAt(O)&1023),P[P.length]=h[240|D>>18]+h[128|D>>12&63]+h[128|D>>6&63]+h[128|D&63]}$+=P.join("")}return $},x=function(I){for(var F=[{obj:{o:I},prop:"o"}],E=e(),k=0;kE){if(B)throw new RangeError("Array limit exceeded. Only "+E+" element"+(E===1?"":"s")+" allowed in an array.");return o(d($,{plainObjects:k}),$.length-1)}return $},b=function(I,F){if(n(I)){for(var E=[],k=0;k"u"&&(O=0)}if(typeof I=="function"?C=I(v,C):C instanceof Date?C=k(C):y==="comma"&&r(C)&&(C=e.maybeMap(C,function(G){return G instanceof Date?k(G):G})),C===null){if(A)return N(_&&!$?_(v,h.encoder,L,"key",B):v);C=""}if(u(C)||e.isBuffer(C)){if(_){var Y=$?v:_(v,h.encoder,L,"key",B);return[N(Y)+"="+N(_(C,h.encoder,L,"value",B))]}return[N(v)+"="+N(String(C))]}var W=[];if(typeof C>"u")return W;var q;if(y==="comma"&&r(C))$&&_&&(C=e.maybeMap(C,function(G){return G==null?G:_(G)})),q=[{value:C.length>0?C.join(",")||null:void 0}];else if(r(I))q=I;else{var ne=Object.keys(C);q=F?ne.sort(F):ne}var re=b?String(v).replace(/\./g,"%2E"):String(v),me=x&&r(C)&&C.length===1?re+"[]":re;if(T&&r(C)&&C.length===0)return me+"[]";for(var ve=0;ve"u"?g.encodeDotInKeys===!0?!0:h.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:h.addQueryPrefix,allowDots:S,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:A,charset:v,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?h.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:h.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:h.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:h.encodeValuesOnly,filter:T,format:y,formatter:x,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:h.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:h.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:h.strictNullHandling}};return vd=function(m,g){var v=m,y=p(g),x,T;typeof y.filter=="function"?(T=y.filter,v=T("",v)):r(y.filter)&&(T=y.filter,x=T);var A=[];if(typeof v!="object"||v===null)return"";var S=n[y.arrayFormat],b=S==="comma"&&y.commaRoundTrip;x||(x=Object.keys(v)),y.sort&&x.sort(y.sort);for(var _=s(),I=0;I"u"||F===null)){var E=v[F];y.skipNulls&&E===null||a(A,f(E,F,S,b,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,_))}}var k=A.join(y.delimiter),B=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?B+="utf8=%26%2310003%3B"+y.delimiter:B+="utf8=%E2%9C%93"+y.delimiter),k.length>0?B+k:""},vd}var xd,p0;function q_(){if(p0)return xd;p0=1;var s=By(),e=Object.prototype.hasOwnProperty,t=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:s.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},n=function(f){return f.replace(/&#(\d+);/g,function(p,m){return String.fromCharCode(parseInt(m,10))})},r=function(f,p,m,g){if(f&&typeof f=="string"&&p.comma&&f.indexOf(",")>-1){if(g&&p.throwOnLimitExceeded)for(var v=0,y=f.indexOf(",");y>-1;){if(v+=1,v>=p.arrayLimit)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");y=f.indexOf(",",y+1)}return f.split(",")}if(p.throwOnLimitExceeded&&m>=p.arrayLimit)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");return f},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",c=function(p,m){var g={__proto__:null},v=m.ignoreQueryPrefix?p.replace(/^\?/,""):p;v=v.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var y=m.parameterLimit===1/0?void 0:m.parameterLimit,x=v.split(m.delimiter,m.throwOnLimitExceeded&&typeof y<"u"?y+1:y);if(m.throwOnLimitExceeded&&typeof y<"u"&&x.length>y)throw new RangeError("Parameter limit exceeded. Only "+y+" parameter"+(y===1?"":"s")+" allowed.");var T=-1,A,S=m.charset;if(m.charsetSentinel)for(A=0;A-1&&(E=t(E)?[E]:E),m.comma&&t(E)&&E.length>m.arrayLimit&&(E=s.combine([],E,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded)),F!==null){var k=e.call(g,F);k&&(m.duplicates==="combine"||b.indexOf("[]=")>-1)?g[F]=s.combine(g[F],E,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded):(!k||m.duplicates==="last")&&(g[F]=E)}}return g},l=function(f,p,m,g){var v=0;if(f.length>0&&f[f.length-1]==="[]"){var y=f.slice(0,-1).join("");v=Array.isArray(p)&&p[y]?p[y].length:0}for(var x=g?p:r(p,m,v),T=f.length-1;T>=0;--T){var A,S=f[T];if(S==="[]"&&m.parseArrays)s.isOverflow(x)?A=x:A=m.allowEmptyArrays&&(x===""||m.strictNullHandling&&x===null)?[]:s.combine([],x,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded);else{A=m.plainObjects?{__proto__:null}:{};var b=S.charAt(0)==="["&&S.charAt(S.length-1)==="]"?S.slice(1,-1):S,_=m.decodeDotInKeys?b.replace(/%2E/g,"."):b,I=parseInt(_,10),F=!isNaN(I)&&S!==_&&String(I)===_&&I>=0&&m.parseArrays;if(!m.parseArrays&&_==="")A={0:x};else if(F&&I=0?g.slice(0,y):g;if(x){if(!m.plainObjects&&e.call(Object.prototype,x)&&!m.allowPrototypes)return;v[v.length]=x}for(var T=g.length,A=y,S=0;A>=0&&S=0){if(m.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+m.depth+" and strictDepth is true");v[v.length]="["+g.slice(A)+"]"}return v},u=function(p,m,g,v){if(p){var y=h(p,g);if(y)return l(y,m,g,v)}},d=function(p){if(!p)return i;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof p.throwOnLimitExceeded<"u"&&typeof p.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var m=typeof p.charset>"u"?i.charset:p.charset,g=typeof p.duplicates>"u"?i.duplicates:p.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var v=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:i.allowDots:!!p.allowDots;return{allowDots:v,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:i.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:i.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:i.arrayLimit,charset:m,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:i.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:i.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:i.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:i.decoder,delimiter:typeof p.delimiter=="string"||s.isRegExp(p.delimiter)?p.delimiter:i.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:i.depth,duplicates:g,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:i.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:i.plainObjects,strictDepth:typeof p.strictDepth=="boolean"?!!p.strictDepth:i.strictDepth,strictMerge:typeof p.strictMerge=="boolean"?!!p.strictMerge:i.strictMerge,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:typeof p.throwOnLimitExceeded=="boolean"?p.throwOnLimitExceeded:!1}};return xd=function(f,p){var m=d(p);if(f===""||f===null||typeof f>"u")return m.plainObjects?{__proto__:null}:{};for(var g=typeof f=="string"?c(f,m):f,v=m.plainObjects?{__proto__:null}:{},y=Object.keys(g),x=0;x",'"',"`"," ","\r",` -`," "],o=["{","}","|","\\","^","`"].concat(r),a=["'"].concat(o),c=["%","/","?",";","#"].concat(a),l=["/","?","#"],h=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=K_();function v(A,S,b){if(A&&typeof A=="object"&&A instanceof e)return A;var _=new e;return _.parse(A,S,b),_}e.prototype.parse=function(A,S,b){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var _=A.indexOf("?"),I=_!==-1&&_127?ne+="x":ne+=q[re];if(!ne.match(u)){var ve=Y.slice(0,C),ce=Y.slice(C+1),de=q.match(d);de&&(ve.push(de[1]),ce.unshift(de[2])),ce.length&&(k="/"+ce.join(".")+k),this.hostname=ve.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),V||(this.hostname=s.toASCII(this.hostname));var X=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+X,this.href+=this.host,V&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),k[0]!=="/"&&(k="/"+k))}if(!f[$])for(var C=0,W=a.length;C0?b.host.split("@"):!1;ne&&(b.auth=ne.shift(),b.hostname=ne.shift(),b.host=b.hostname)}return b.search=A.search,b.query=A.query,(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.href=b.format(),b}if(!Y.length)return b.pathname=null,b.search?b.path="/"+b.search:b.path=null,b.href=b.format(),b;for(var re=Y.slice(-1)[0],me=(b.host||A.host||Y.length>1)&&(re==="."||re==="..")||re==="",ve=0,ce=Y.length;ce>=0;ce--)re=Y[ce],re==="."?Y.splice(ce,1):re===".."?(Y.splice(ce,1),ve++):ve&&(Y.splice(ce,1),ve--);if(!D&&!V)for(;ve--;ve)Y.unshift("..");D&&Y[0]!==""&&(!Y[0]||Y[0].charAt(0)!=="/")&&Y.unshift(""),me&&Y.join("/").substr(-1)!=="/"&&Y.push("");var de=Y[0]===""||Y[0]&&Y[0].charAt(0)==="/";if(q){b.hostname=de?"":Y.length?Y.shift():"",b.host=b.hostname;var ne=b.host&&b.host.indexOf("@")>0?b.host.split("@"):!1;ne&&(b.auth=ne.shift(),b.hostname=ne.shift(),b.host=b.hostname)}return D=D||b.host&&Y.length,D&&!de&&Y.unshift(""),Y.length>0?b.pathname=Y.join("/"):(b.pathname=null,b.path=null),(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.auth=A.auth||b.auth,b.slashes=b.slashes||A.slashes,b.href=b.format(),b},e.prototype.parseHost=function(){var A=this.host,S=i.exec(A);S&&(S=S[0],S!==":"&&(this.port=S.substr(1)),A=A.substr(0,A.length-S.length)),A&&(this.hostname=A)},Pr.parse=v,Pr.resolve=x,Pr.resolveObject=T,Pr.format=y,Pr.Url=e,Pr}Z_();const x0={};function ht(s,e,t=3){if(x0[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e} -Deprecated since v${s}`):(i=i.split(` -`).splice(t).join(` -`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e} -Deprecated since v${s}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e} -Deprecated since v${s}`),console.warn(i))),x0[e]=!0}function xs(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function wa(s){return s.split("?")[0].split("#")[0]}function J_(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Q_(s,e,t){return s.replace(new RegExp(J_(e),"g"),t)}function eC(s,e){let t="",i=0,n=-1,r=0,o=-1;for(let a=0;a<=s.length;++a){if(a2){const c=t.lastIndexOf("/");if(c!==t.length-1){c===-1?(t="",i=0):(t=t.slice(0,c),i=t.length-1-t.lastIndexOf("/")),n=a,r=0;continue}}else if(t.length===2||t.length===1){t="",i=0,n=a,r=0;continue}}}else t.length>0?t+=`/${s.slice(n+1,a)}`:t=s.slice(n+1,a),i=a-n-1;n=a,r=0}else o===46&&r!==-1?++r:r=-1}return t}const Qt={toPosix(s){return Q_(s,"\\","/")},isUrl(s){return/^https?:/.test(this.toPosix(s))},isDataUrl(s){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(s)},isBlobUrl(s){return s.startsWith("blob:")},hasProtocol(s){return/^[^/:]+:/.test(this.toPosix(s))},getProtocol(s){xs(s),s=this.toPosix(s);const e=/^file:\/\/\//.exec(s);if(e)return e[0];const t=/^[^/:]+:\/{0,2}/.exec(s);return t?t[0]:""},toAbsolute(s,e,t){if(xs(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=wa(this.toPosix(e??ke.ADAPTER.getBaseUrl())),n=wa(this.toPosix(t??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?Qt.join(n,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(xs(s),s.length===0)return".";if(this.isDataUrl(s)||this.isBlobUrl(s))return s;s=this.toPosix(s);let e="";const t=s.startsWith("/");this.hasProtocol(s)&&(e=this.rootname(s),s=s.slice(e.length));const i=s.endsWith("/");return s=eC(s),s.length>0&&i&&(s+="/"),t?`/${s}`:e+s},isAbsolute(s){return xs(s),s=this.toPosix(s),this.hasProtocol(s)?!0:s.startsWith("/")},join(...s){if(s.length===0)return".";let e;for(let t=0;t0)if(e===void 0)e=i;else{const n=s[t-1]??"";this.joinExtensions.includes(this.extname(n).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return e===void 0?".":this.normalize(e)},dirname(s){if(xs(s),s.length===0)return".";s=this.toPosix(s);let e=s.charCodeAt(0);const t=e===47;let i=-1,n=!0;const r=this.getProtocol(s),o=s;s=s.slice(r.length);for(let a=s.length-1;a>=1;--a)if(e=s.charCodeAt(a),e===47){if(!n){i=a;break}}else n=!1;return i===-1?t?"/":this.isUrl(o)?r+s:r:t&&i===1?"//":r+s.slice(0,i)},rootname(s){xs(s),s=this.toPosix(s);let e="";if(s.startsWith("/")?e="/":e=this.getProtocol(s),this.isUrl(s)){const t=s.indexOf("/",e.length);t!==-1?e=s.slice(0,t):e=s,e.endsWith("/")||(e+="/")}return e},basename(s,e){xs(s),e&&xs(e),s=wa(this.toPosix(s));let t=0,i=-1,n=!0,r;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e.length===s.length&&e===s)return"";let o=e.length-1,a=-1;for(r=s.length-1;r>=0;--r){const c=s.charCodeAt(r);if(c===47){if(!n){t=r+1;break}}else a===-1&&(n=!1,a=r+1),o>=0&&(c===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(r=s.length-1;r>=0;--r)if(s.charCodeAt(r)===47){if(!n){t=r+1;break}}else i===-1&&(n=!1,i=r+1);return i===-1?"":s.slice(t,i)},extname(s){xs(s),s=wa(this.toPosix(s));let e=-1,t=0,i=-1,n=!0,r=0;for(let o=s.length-1;o>=0;--o){const a=s.charCodeAt(o);if(a===47){if(!n){t=o+1;break}continue}i===-1&&(n=!1,i=o+1),a===46?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||i===-1||r===0||r===1&&e===i-1&&e===t+1?"":s.slice(e,i)},parse(s){xs(s);const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;s=wa(this.toPosix(s));let t=s.charCodeAt(0);const i=this.isAbsolute(s);let n;e.root=this.rootname(s),i||this.hasProtocol(s)?n=1:n=0;let r=-1,o=0,a=-1,c=!0,l=s.length-1,h=0;for(;l>=n;--l){if(t=s.charCodeAt(l),t===47){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),t===46?r===-1?r=l:h!==1&&(h=1):r!==-1&&(h=-1)}return r===-1||a===-1||h===0||h===1&&r===a-1&&r===o+1?a!==-1&&(o===0&&i?e.base=e.name=s.slice(1,a):e.base=e.name=s.slice(o,a)):(o===0&&i?(e.name=s.slice(1,r),e.base=s.slice(1,a)):(e.name=s.slice(o,r),e.base=s.slice(o,a)),e.ext=s.slice(r,a)),e.dir=this.dirname(s),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let bd;async function tC(){return bd??(bd=(async()=>{var r;const s=document.createElement("canvas").getContext("webgl");if(!s)return xi.UNPACK;const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return xi.UNPACK;const t=s.createTexture();s.bindTexture(s.TEXTURE_2D,t);const i=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,i),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return s.readPixels(0,0,1,1,s.RGBA,s.UNSIGNED_BYTE,n),s.deleteFramebuffer(i),s.deleteTexture(t),(r=s.getExtension("WEBGL_lose_context"))==null||r.loseContext(),n[0]<=n[3]?xi.PMA:xi.UNPACK})()),bd}let wd;function iC(){return typeof wd>"u"&&(wd=(function(){var e;const s={stencil:!0,failIfMajorPerformanceCaveat:ke.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!ke.ADAPTER.getWebGLRenderingContext())return!1;const t=ke.ADAPTER.createCanvas();let i=t.getContext("webgl",s)||t.getContext("experimental-webgl",s);const n=!!((e=i==null?void 0:i.getContextAttributes())!=null&&e.stencil);if(i){const r=i.getExtension("WEBGL_lose_context");r&&r.loseContext()}return i=null,n}catch{return!1}})()),wd}var sC={grad:.9,turn:360,rad:360/(2*Math.PI)},vn=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},vi=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*s)/t+0},ms=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),s>t?t:s>e?s:e},Ly=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},y0=function(s){return{r:ms(s.r,0,255),g:ms(s.g,0,255),b:ms(s.b,0,255),a:ms(s.a)}},Sd=function(s){return{r:vi(s.r),g:vi(s.g),b:vi(s.b),a:vi(s.a,3)}},nC=/^#([0-9a-f]{3,8})$/i,Nl=function(s){var e=s.toString(16);return e.length<2?"0"+e:e},Dy=function(s){var e=s.r,t=s.g,i=s.b,n=s.a,r=Math.max(e,t,i),o=r-Math.min(e,t,i),a=o?r===e?(t-i)/o:r===t?2+(i-e)/o:4+(e-t)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:n}},Ny=function(s){var e=s.h,t=s.s,i=s.v,n=s.a;e=e/360*6,t/=100,i/=100;var r=Math.floor(e),o=i*(1-t),a=i*(1-(e-r)*t),c=i*(1-(1-e+r)*t),l=r%6;return{r:255*[i,a,o,o,c,i][l],g:255*[c,i,i,a,o,o][l],b:255*[o,o,c,i,i,a][l],a:n}},b0=function(s){return{h:Ly(s.h),s:ms(s.s,0,100),l:ms(s.l,0,100),a:ms(s.a)}},w0=function(s){return{h:vi(s.h),s:vi(s.s),l:vi(s.l),a:vi(s.a,3)}},S0=function(s){return Ny((t=(e=s).s,{h:e.h,s:(t*=((i=e.l)<50?i:100-i)/100)>0?2*t/(i+t)*100:0,v:i+t,a:e.a}));var e,t,i},Ya=function(s){return{h:(e=Dy(s)).h,s:(n=(200-(t=e.s))*(i=e.v)/100)>0&&n<200?t*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,t,i,n},rC=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,oC=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,aC=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lC=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bf={string:[[function(s){var e=nC.exec(s);return e?(s=e[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?vi(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?vi(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var e=aC.exec(s)||lC.exec(s);return e?e[2]!==e[4]||e[4]!==e[6]?null:y0({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(s){var e=rC.exec(s)||oC.exec(s);if(!e)return null;var t,i,n=b0({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(sC[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return S0(n)},"hsl"]],object:[[function(s){var e=s.r,t=s.g,i=s.b,n=s.a,r=n===void 0?1:n;return vn(e)&&vn(t)&&vn(i)?y0({r:Number(e),g:Number(t),b:Number(i),a:Number(r)}):null},"rgb"],[function(s){var e=s.h,t=s.s,i=s.l,n=s.a,r=n===void 0?1:n;if(!vn(e)||!vn(t)||!vn(i))return null;var o=b0({h:Number(e),s:Number(t),l:Number(i),a:Number(r)});return S0(o)},"hsl"],[function(s){var e=s.h,t=s.s,i=s.v,n=s.a,r=n===void 0?1:n;if(!vn(e)||!vn(t)||!vn(i))return null;var o=(function(a){return{h:Ly(a.h),s:ms(a.s,0,100),v:ms(a.v,0,100),a:ms(a.a)}})({h:Number(e),s:Number(t),v:Number(i),a:Number(r)});return Ny(o)},"hsv"]]},T0=function(s,e){for(var t=0;t=.5},s.prototype.toHex=function(){return e=Sd(this.rgba),t=e.r,i=e.g,n=e.b,o=(r=e.a)<1?Nl(vi(255*r)):"","#"+Nl(t)+Nl(i)+Nl(n)+o;var e,t,i,n,r,o},s.prototype.toRgb=function(){return Sd(this.rgba)},s.prototype.toRgbString=function(){return e=Sd(this.rgba),t=e.r,i=e.g,n=e.b,(r=e.a)<1?"rgba("+t+", "+i+", "+n+", "+r+")":"rgb("+t+", "+i+", "+n+")";var e,t,i,n,r},s.prototype.toHsl=function(){return w0(Ya(this.rgba))},s.prototype.toHslString=function(){return e=w0(Ya(this.rgba)),t=e.h,i=e.s,n=e.l,(r=e.a)<1?"hsla("+t+", "+i+"%, "+n+"%, "+r+")":"hsl("+t+", "+i+"%, "+n+"%)";var e,t,i,n,r},s.prototype.toHsv=function(){return e=Dy(this.rgba),{h:vi(e.h),s:vi(e.s),v:vi(e.v),a:vi(e.a,3)};var e},s.prototype.invert=function(){return Us({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},s.prototype.saturate=function(e){return e===void 0&&(e=.1),Us(Td(this.rgba,e))},s.prototype.desaturate=function(e){return e===void 0&&(e=.1),Us(Td(this.rgba,-e))},s.prototype.grayscale=function(){return Us(Td(this.rgba,-1))},s.prototype.lighten=function(e){return e===void 0&&(e=.1),Us(M0(this.rgba,e))},s.prototype.darken=function(e){return e===void 0&&(e=.1),Us(M0(this.rgba,-e))},s.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},s.prototype.alpha=function(e){return typeof e=="number"?Us({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):vi(this.rgba.a,3);var t},s.prototype.hue=function(e){var t=Ya(this.rgba);return typeof e=="number"?Us({h:e,s:t.s,l:t.l,a:t.a}):vi(t.h)},s.prototype.isEqual=function(e){return this.toHex()===Us(e).toHex()},s})(),Us=function(s){return s instanceof wf?s:new wf(s)},_0=[],hC=function(s){s.forEach(function(e){_0.indexOf(e)<0&&(e(wf,bf),_0.push(e))})};function uC(s,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var n in t)i[t[n]]=n;var r={};s.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,c,l=i[this.toHex()];if(l)return l;if(o!=null&&o.closest){var h=this.toRgb(),u=1/0,d="black";if(!r.length)for(var f in t)r[f]=new s(t[f]).toRgb();for(var p in t){var m=(a=h,c=r[p],Math.pow(a.r-c.r,2)+Math.pow(a.g-c.g,2)+Math.pow(a.b-c.b,2));mn===t[r]);if(e!==null&&t!==null){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}return e===t}toRgba(){const[e,t,i,n]=this._components;return{r:e,g:t,b:i,a:n}}toRgb(){const[e,t,i]=this._components;return{r:e,g:t,b:i}}toRgbaString(){const[e,t,i]=this.toUint8RgbArray();return`rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){const[t,i,n]=this._components;return e=e??[],e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(n*255),e}toRgbArray(e){e=e??[];const[t,i,n]=this._components;return e[0]=t,e[1]=i,e[2]=n,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,i,n,r]=xc.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=n,this._components[3]*=r,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,n=this._int>>8&255,r=this._int&255;return t&&(i=i*e+.5|0,n=n*e+.5|0,r=r*e+.5|0),(e*255<<24)+(i<<16)+(n<<8)+r}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,i,n]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(i*e)/e,this._components[2]=Math.round(n*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[t,i,n,r]=this._components;return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}normalize(e){let t,i,n,r;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const o=e;t=(o>>16&255)/255,i=(o>>8&255)/255,n=(o&255)/255,r=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,n,r=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,n,r=255]=e,t/=255,i/=255,n/=255,r/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const a=xc.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`)}const o=Us(e);o.isValid()&&({r:t,g:i,b:n,a:r}=o.rgba,t/=255,i/=255,n/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=n,this._components[3]=r,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0)}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((n,r)=>{e[r]=Math.min(Math.max(n,t),i)}),e)}};Eo.shared=new Eo,Eo.temp=new Eo,Eo.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Mt=Eo;function dC(s){return ht("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Mt.shared.setValue(s).toHex()}function fC(s){return ht("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Mt.shared.setValue(s).toNumber()}function mC(){const s=[],e=[];for(let i=0;i<32;i++)s[i]=i,e[i]=i;s[He.NORMAL_NPM]=He.NORMAL,s[He.ADD_NPM]=He.ADD,s[He.SCREEN_NPM]=He.SCREEN,e[He.NORMAL]=He.NORMAL_NPM,e[He.ADD]=He.ADD_NPM,e[He.SCREEN]=He.SCREEN_NPM;const t=[];return t.push(e),t.push(s),t}const Uy=mC();function $y(s,e){return Uy[e?1:0][s]}function pC(s,e=null){const t=s*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,n=0;i>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function C0(s){return!(s&s-1)&&!!s}function A0(s){let e=(s>65535?1:0)<<4;s>>>=e;let t=(s>255?1:0)<<3;return s>>>=t,e|=t,t=(s>15?1:0)<<2,s>>>=t,e|=t,t=(s>3?1:0)<<1,s>>>=t,e|=t,e|s>>1}function Go(s,e,t){const i=s.length;let n;if(e>=i||t===0)return;t=e+t>i?i-e:t;const r=i-t;for(n=e;n(s.Renderer="renderer",s.Application="application",s.RendererSystem="renderer-webgl-system",s.RendererPlugin="renderer-webgl-plugin",s.CanvasRendererSystem="renderer-canvas-system",s.CanvasRendererPlugin="renderer-canvas-plugin",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s))(Re||{});const Tf=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},k0=(s,e)=>Tf(s).priority??e,Ue={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(Tf).forEach(e=>{e.type.forEach(t=>{var i,n;return(n=(i=this._removeHandlers)[t])==null?void 0:n.call(i,e)})}),this},add(...s){return s.map(Tf).forEach(e=>{e.type.forEach(t=>{var r,o;const i=this._addHandlers,n=this._queue;i[t]?(r=i[t])==null||r.call(i,e):(n[t]=n[t]||[],(o=n[t])==null||o.push(e))})}),this},handle(s,e,t){var o;const i=this._addHandlers,n=this._removeHandlers;if(i[s]||n[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=e,n[s]=t;const r=this._queue;return r[s]&&((o=r[s])==null||o.forEach(a=>e(a)),delete r[s]),this},handleByMap(s,e){return this.handle(s,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByList(s,e,t=-1){return this.handle(s,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((n,r)=>k0(r,t)-k0(n,t)))},i=>{const n=e.indexOf(i.ref);n!==-1&&e.splice(n,1)})}};class Mf{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const wC=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` -`);function SC(s){let e="";for(let t=0;t0&&(e+=` -else `),t=0;--i){const n=_f[i];if(n.test&&n.test(s,t))return new n(s,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Rs{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,t,i,n,r,o,a,c){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:h}=this;this._aliasCount++;for(let u=0,d=h.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Rs.prototype,{dispatch:{value:Rs.prototype.emit},run:{value:Rs.prototype.emit}});class ll{constructor(e=0,t=0){this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Rs("setRealSize"),this.onUpdate=new Rs("update"),this.onError=new Rs("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,t,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,t){return!1}}class Kh extends ll{constructor(e,t){const{width:i,height:n}=t||{};if(!i||!n)throw new Error("BufferResource width or height invalid");super(i,n),this.data=e,this.unpackAlignment=t.unpackAlignment??4}upload(e,t,i){const n=e.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,this.unpackAlignment),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===xi.UNPACK);const r=t.realWidth,o=t.realHeight;return i.width===r&&i.height===o?n.texSubImage2D(t.target,0,0,0,r,o,t.format,i.type,this.data):(i.width=r,i.height=o,n.texImage2D(t.target,0,i.internalFormat,r,o,0,t.format,i.type,this.data)),!0}dispose(){this.data=null}static test(e){return e===null||e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}const MC={scaleMode:Cs.NEAREST,alphaMode:xi.NPM},Cf=class Io extends bl{constructor(e=null,t=null){super(),t=Object.assign({},Io.defaultOptions,t);const{alphaMode:i,mipmap:n,anisotropicLevel:r,scaleMode:o,width:a,height:c,wrapMode:l,format:h,type:u,target:d,resolution:f,resourceOptions:p}=t;e&&!(e instanceof ll)&&(e=Vy(e,p),e.internal=!0),this.resolution=f||ke.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((c||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=r,this._wrapMode=l,this._scaleMode=o,this.format=h,this.type=u,this.target=d,this.alphaMode=i,this.uid=ro(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&c>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let i;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,i=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,i=!0),i&&this.dirtyStyleId++,this}setSize(e,t,i){return i=i||this.resolution,this.setRealSize(e*i,t*i,i)}setRealSize(e,t,i){return this.resolution=i||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=C0(this.realWidth)&&C0(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete zn[this.cacheId],delete $s[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),Io.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,i=ke.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${ro()}`}r=e._pixiId}let o=zn[r];if(n&&i&&!o)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return o||(o=new Io(e,t),o.cacheId=r,Io.addToCache(o,r)),o}static fromBuffer(e,t,i,n){e=e||new Float32Array(t*i*4);const r=new Kh(e,{width:t,height:i,...n==null?void 0:n.resourceOptions});let o,a;return e instanceof Float32Array?(o=Se.RGBA,a=Ne.FLOAT):e instanceof Int32Array?(o=Se.RGBA_INTEGER,a=Ne.INT):e instanceof Uint32Array?(o=Se.RGBA_INTEGER,a=Ne.UNSIGNED_INT):e instanceof Int16Array?(o=Se.RGBA_INTEGER,a=Ne.SHORT):e instanceof Uint16Array?(o=Se.RGBA_INTEGER,a=Ne.UNSIGNED_SHORT):e instanceof Int8Array?(o=Se.RGBA,a=Ne.BYTE):(o=Se.RGBA,a=Ne.UNSIGNED_BYTE),r.internal=!0,new Io(r,Object.assign({},MC,{type:a,format:o},n))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),zn[t]&&zn[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),zn[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=zn[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete zn[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t1){for(let u=0;u(s[s.POLY=0]="POLY",s[s.RECT=1]="RECT",s[s.CIRC=2]="CIRC",s[s.ELIP=3]="ELIP",s[s.RREC=4]="RREC",s))(Mi||{});class gt{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new gt(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}}gt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const Ul=[new gt,new gt,new gt,new gt];class rt{constructor(e=0,t=0,i=0,n=0){this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(n),this.type=Mi.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new rt(0,0,0,0)}clone(){return new rt(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e=this.y&&te.right?e.right:this.right)<=_)return!1;const I=this.ye.bottom?e.bottom:this.bottom)>I}const i=this.left,n=this.right,r=this.top,o=this.bottom;if(n<=i||o<=r)return!1;const a=Ul[0].set(e.left,e.top),c=Ul[1].set(e.left,e.bottom),l=Ul[2].set(e.right,e.top),h=Ul[3].set(e.right,e.bottom);if(l.x<=a.x||c.y<=a.y)return!1;const u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(a,a),t.apply(c,c),t.apply(l,l),t.apply(h,h),Math.max(a.x,c.x,l.x,h.x)<=i||Math.min(a.x,c.x,l.x,h.x)>=n||Math.max(a.y,c.y,l.y,h.y)<=r||Math.min(a.y,c.y,l.y,h.y)>=o))return!1;const d=u*(c.y-a.y),f=u*(a.x-c.x),p=d*i+f*r,m=d*n+f*r,g=d*i+f*o,v=d*n+f*o;if(Math.max(p,m,g,v)<=d*a.x+f*a.y||Math.min(p,m,g,v)>=d*h.x+f*h.y)return!1;const y=u*(a.y-l.y),x=u*(l.x-a.x),T=y*i+x*r,A=y*n+x*r,S=y*i+x*o,b=y*n+x*o;return!(Math.max(T,A,S,b)<=y*a.x+x*a.y||Math.min(T,A,S,b)>=y*h.x+x*h.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),r=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=n,this.height=Math.max(r-n,0),this}ceil(e=1,t=.001){const i=Math.ceil((this.x+this.width-t)*e)/e,n=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=n-this.y,this}enlarge(e){const t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),r=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=n,this.height=r-n,this}}rt.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Zh{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.radius=i,this.type=Mi.CIRC}clone(){return new Zh(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;const i=this.radius*this.radius;let n=this.x-e,r=this.y-t;return n*=n,r*=r,n+r<=i}getBounds(){return new rt(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}Zh.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class Jh{constructor(e=0,t=0,i=0,n=0){this.x=e,this.y=t,this.width=i,this.height=n,this.type=Mi.ELIP}clone(){return new Jh(this.x,this.y,this.width,this.height)}contains(e,t){if(this.width<=0||this.height<=0)return!1;let i=(e-this.x)/this.width,n=(t-this.y)/this.height;return i*=i,n*=n,i+n<=1}getBounds(){return new rt(this.x-this.width,this.y-this.height,this.width,this.height)}}Jh.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class eo{constructor(...e){let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){const i=[];for(let n=0,r=t.length;nt!=h>t&&e<(l-a)*((t-c)/(h-c))+a&&(i=!i)}return i}}eo.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((s,e)=>`${s}, ${e}`,"")}]`};class Qh{constructor(e=0,t=0,i=0,n=0,r=20){this.x=e,this.y=t,this.width=i,this.height=n,this.radius=r,this.type=Mi.RREC}clone(){return new Qh(this.x,this.y,this.width,this.height,this.radius)}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let n=e-(this.x+i),r=t-(this.y+i);const o=i*i;if(n*n+r*r<=o||(n=e-(this.x+this.width-i),n*n+r*r<=o)||(r=t-(this.y+this.height-i),n*n+r*r<=o)||(n=e-(this.x+i),n*n+r*r<=o))return!0}return!1}}Qh.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class Ut{constructor(e=1,t=0,i=0,n=1,r=0,o=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=o}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,i,n,r,o){return this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const i=t||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,t){t=t||new gt;const i=e.x,n=e.y;return t.x=this.a*i+this.c*n+this.tx,t.y=this.b*i+this.d*n+this.ty,t}applyInverse(e,t){t=t||new gt;const i=1/(this.a*this.d+this.c*-this.b),n=e.x,r=e.y;return t.x=this.d*i*n+-this.c*i*r+(this.ty*this.c-this.tx*this.d)*i,t.y=this.a*i*r+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),i=Math.sin(e),n=this.a,r=this.c,o=this.tx;return this.a=n*t-this.b*i,this.b=n*i+this.b*t,this.c=r*t-this.d*i,this.d=r*i+this.d*t,this.tx=o*t-this.ty*i,this.ty=o*i+this.ty*t,this}append(e){const t=this.a,i=this.b,n=this.c,r=this.d;return this.a=e.a*t+e.b*n,this.b=e.a*i+e.b*r,this.c=e.c*t+e.d*n,this.d=e.c*i+e.d*r,this.tx=e.tx*t+e.ty*n+this.tx,this.ty=e.tx*i+e.ty*r+this.ty,this}setTransform(e,t,i,n,r,o,a,c,l){return this.a=Math.cos(a+l)*r,this.b=Math.sin(a+l)*r,this.c=-Math.sin(a-c)*o,this.d=Math.cos(a-c)*o,this.tx=e-(i*this.a+n*this.c),this.ty=t-(i*this.b+n*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,n=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,i=this.b,n=this.c,r=this.d,o=e.pivot,a=-Math.atan2(-n,r),c=Math.atan2(i,t),l=Math.abs(a+c);return l<1e-5||Math.abs(Wc-l)<1e-5?(e.rotation=c,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=c),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(n*n+r*r),e.position.x=this.tx+(o.x*t+o.y*n),e.position.y=this.ty+(o.x*i+o.y*r),e}invert(){const e=this.a,t=this.b,i=this.c,n=this.d,r=this.tx,o=e*n-t*i;return this.a=n/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-n*r)/o,this.ty=-(e*this.ty-t*r)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Ut;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}static get IDENTITY(){return new Ut}static get TEMP_MATRIX(){return new Ut}}Ut.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const Dr=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Nr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ur=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],$r=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ef=[],Gy=[],$l=Math.sign;function kC(){for(let s=0;s<16;s++){const e=[];Ef.push(e);for(let t=0;t<16;t++){const i=$l(Dr[s]*Dr[t]+Ur[s]*Nr[t]),n=$l(Nr[s]*Dr[t]+$r[s]*Nr[t]),r=$l(Dr[s]*Ur[t]+Ur[s]*$r[t]),o=$l(Nr[s]*Ur[t]+$r[s]*$r[t]);for(let a=0;a<16;a++)if(Dr[a]===i&&Nr[a]===n&&Ur[a]===r&&$r[a]===o){e.push(a);break}}}for(let s=0;s<16;s++){const e=new Ut;e.set(Dr[s],Nr[s],Ur[s],$r[s],0,0),Gy.push(e)}}kC();const Gt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:s=>Dr[s],uY:s=>Nr[s],vX:s=>Ur[s],vY:s=>$r[s],inv:s=>s&8?s&15:-s&7,add:(s,e)=>Ef[s][e],sub:(s,e)=>Ef[s][Gt.inv(e)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,e)=>Math.abs(s)*2<=Math.abs(e)?e>=0?Gt.S:Gt.N:Math.abs(e)*2<=Math.abs(s)?s>0?Gt.E:Gt.W:e>0?s>0?Gt.SE:Gt.SW:s>0?Gt.NE:Gt.NW,matrixAppendRotationInv:(s,e,t=0,i=0)=>{const n=Gy[Gt.inv(e)];n.tx=t,n.ty=i,s.append(n)}};class In{constructor(e,t,i=0,n=0){this._x=i,this._y=n,this.cb=e,this.scope=t}clone(e=this.cb,t=this.scope){return new In(e,t,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}In.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const If=class{constructor(){this.worldTransform=new Ut,this.localTransform=new Ut,this.position=new In(this.onChange,this,0,0),this.scale=new In(this.onChange,this,1,1),this.pivot=new In(this.onChange,this,0,0),this.skew=new In(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const s=this.localTransform;this._localID!==this._currentLocalID&&(s.a=this._cx*this.scale.x,s.b=this._sx*this.scale.x,s.c=this._cy*this.scale.y,s.d=this._sy*this.scale.y,s.tx=this.position.x-(this.pivot.x*s.a+this.pivot.y*s.c),s.ty=this.position.y-(this.pivot.x*s.b+this.pivot.y*s.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(s){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==s._worldID){const t=s.worldTransform,i=this.worldTransform;i.a=e.a*t.a+e.b*t.c,i.b=e.a*t.b+e.b*t.d,i.c=e.c*t.a+e.d*t.c,i.d=e.c*t.b+e.d*t.d,i.tx=e.tx*t.a+e.ty*t.c+t.tx,i.ty=e.tx*t.b+e.ty*t.d+t.ty,this._parentID=s._worldID,this._worldID++}}setFromMatrix(s){s.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(s){this._rotation!==s&&(this._rotation=s,this.updateSkew())}};If.IDENTITY=new If;let Zm=If;Zm.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var FC=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; - -void main(void){ - gl_FragColor *= texture2D(uSampler, vTextureCoord); -}`,OC=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void){ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -} -`;function O0(s,e,t){const i=s.createShader(e);return s.shaderSource(i,t),s.compileShader(i),i}function Pd(s){const e=new Array(s);for(let t=0;ts.type==="float"&&s.size===1&&!s.isArray,code:s=>` - if(uv["${s}"] !== ud["${s}"].value) - { - ud["${s}"].value = uv["${s}"] - gl.uniform1f(ud["${s}"].location, uv["${s}"]) - } - `},{test:(s,e)=>(s.type==="sampler2D"||s.type==="samplerCube"||s.type==="sampler2DArray")&&s.size===1&&!s.isArray&&(e==null||e.castToBaseTexture!==void 0),code:s=>`t = syncData.textureCount++; - - renderer.texture.bind(uv["${s}"], t); - - if(ud["${s}"].value !== t) - { - ud["${s}"].value = t; - gl.uniform1i(ud["${s}"].location, t); -; // eslint-disable-line max-len - }`},{test:(s,e)=>s.type==="mat3"&&s.size===1&&!s.isArray&&e.a!==void 0,code:s=>` - gl.uniformMatrix3fv(ud["${s}"].location, false, uv["${s}"].toArray(true)); - `,codeUbo:s=>` - var ${s}_matrix = uv.${s}.toArray(true); - - data[offset] = ${s}_matrix[0]; - data[offset+1] = ${s}_matrix[1]; - data[offset+2] = ${s}_matrix[2]; - - data[offset + 4] = ${s}_matrix[3]; - data[offset + 5] = ${s}_matrix[4]; - data[offset + 6] = ${s}_matrix[5]; - - data[offset + 8] = ${s}_matrix[6]; - data[offset + 9] = ${s}_matrix[7]; - data[offset + 10] = ${s}_matrix[8]; - `},{test:(s,e)=>s.type==="vec2"&&s.size===1&&!s.isArray&&e.x!==void 0,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v.x || cv[1] !== v.y) - { - cv[0] = v.x; - cv[1] = v.y; - gl.uniform2f(ud["${s}"].location, v.x, v.y); - }`,codeUbo:s=>` - v = uv.${s}; - - data[offset] = v.x; - data[offset+1] = v.y; - `},{test:s=>s.type==="vec2"&&s.size===1&&!s.isArray,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - gl.uniform2f(ud["${s}"].location, v[0], v[1]); - } - `},{test:(s,e)=>s.type==="vec4"&&s.size===1&&!s.isArray&&e.width!==void 0,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) - { - cv[0] = v.x; - cv[1] = v.y; - cv[2] = v.width; - cv[3] = v.height; - gl.uniform4f(ud["${s}"].location, v.x, v.y, v.width, v.height) - }`,codeUbo:s=>` - v = uv.${s}; - - data[offset] = v.x; - data[offset+1] = v.y; - data[offset+2] = v.width; - data[offset+3] = v.height; - `},{test:(s,e)=>s.type==="vec4"&&s.size===1&&!s.isArray&&e.red!==void 0,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) - { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - cv[3] = v.alpha; - gl.uniform4f(ud["${s}"].location, v.red, v.green, v.blue, v.alpha) - }`,codeUbo:s=>` - v = uv.${s}; - - data[offset] = v.red; - data[offset+1] = v.green; - data[offset+2] = v.blue; - data[offset+3] = v.alpha; - `},{test:(s,e)=>s.type==="vec3"&&s.size===1&&!s.isArray&&e.red!==void 0,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a) - { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - - gl.uniform3f(ud["${s}"].location, v.red, v.green, v.blue) - }`,codeUbo:s=>` - v = uv.${s}; - - data[offset] = v.red; - data[offset+1] = v.green; - data[offset+2] = v.blue; - `},{test:s=>s.type==="vec4"&&s.size===1&&!s.isArray,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4f(ud["${s}"].location, v[0], v[1], v[2], v[3]) - }`}],BC={float:` - if (cv !== v) - { - cu.value = v; - gl.uniform1f(location, v); - }`,vec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2f(location, v[0], v[1]) - }`,vec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3f(location, v[0], v[1], v[2]) - }`,vec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4f(location, v[0], v[1], v[2], v[3]); - }`,int:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,ivec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2i(location, v[0], v[1]); - }`,ivec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3i(location, v[0], v[1], v[2]); - }`,ivec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,uint:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1ui(location, v); - }`,uvec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2ui(location, v[0], v[1]); - }`,uvec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3ui(location, v[0], v[1], v[2]); - }`,uvec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4ui(location, v[0], v[1], v[2], v[3]); - }`,bool:` - if (cv !== v) - { - cu.value = v; - gl.uniform1i(location, v); - }`,bvec2:` - if (cv[0] != v[0] || cv[1] != v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2i(location, v[0], v[1]); - }`,bvec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3i(location, v[0], v[1], v[2]); - }`,bvec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,samplerCube:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,sampler2DArray:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`},LC={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function DC(s,e){var i;const t=[` - var v = null; - var cv = null; - var cu = null; - var t = 0; - var gl = renderer.gl; - `];for(const n in s.uniforms){const r=e[n];if(!r){((i=s.uniforms[n])==null?void 0:i.group)===!0&&(s.uniforms[n].ubo?t.push(` - renderer.shader.syncUniformBufferGroup(uv.${n}, '${n}'); - `):t.push(` - renderer.shader.syncUniformGroup(uv.${n}, syncData); - `));continue}const o=s.uniforms[n];let a=!1;for(let c=0;c=ho.WEBGL2&&(e=s.getContext("webgl2",{})),e||(e=s.getContext("webgl",{})||s.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),wo=e}return wo}let Xl;function UC(){if(!Xl){Xl=fs.MEDIUM;const s=NC();if(s&&s.getShaderPrecisionFormat){const e=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);e&&(Xl=e.precision?fs.HIGH:fs.MEDIUM)}}return Xl}function B0(s,e){const t=s.getShaderSource(e).split(` -`).map((l,h)=>`${h}: ${l}`),i=s.getShaderInfoLog(e),n=i.split(` -`),r={},o=n.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!r[l]?(r[l]=!0,!0):!1),a=[""];o.forEach(l=>{t[l-1]=`%c${t[l-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=t.join(` -`);a[0]=c,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function $C(s,e,t,i){s.getProgramParameter(e,s.LINK_STATUS)||(s.getShaderParameter(t,s.COMPILE_STATUS)||B0(s,t),s.getShaderParameter(i,s.COMPILE_STATUS)||B0(s,i),console.error("PixiJS Error: Could not initialize shader."),s.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",s.getProgramInfoLog(e)))}const XC={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Wy(s){return XC[s]}let Vl=null;const L0={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function zy(s,e){if(!Vl){const t=Object.keys(L0);Vl={};for(let i=0;i0&&(t+=` -else `),ithis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,i=ws._textureArrayPool,n=this.renderer.batch,r=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++Je._globalBatch,c=0,l=i[0],h=0;n.copyBoundTextures(r,t);for(let u=0;u=t&&(n.boundArray(l,r,a,t),this.buildDrawCalls(l,h,u),h=u,l=i[++c],++a),d._batchEnabled=a,d.touched=o,l.elements[l.count++]=d)}l.count>0&&(n.boundArray(l,r,a,t),this.buildDrawCalls(l,h,this._bufferSize),++c,++a);for(let u=0;u0);for(let m=0;m=0;--n)e[n]=i[n]||null,e[n]&&(e[n]._batchLocation=n)}boundArray(e,t,i,n){const{elements:r,ids:o,count:a}=e;let c=0;for(let l=0;l=0&&u=ho.WEBGL2&&(i=e.getContext("webgl2",t)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const t=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}qc.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},qc.extension={type:Re.RendererSystem,name:"context"};Ue.add(qc);class Ff{constructor(e,t){if(this.width=Math.round(e),this.height=Math.round(t),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Rs("disposeFramebuffer"),this.multisample=ai.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,t){return this.colorTextures[e]=t||new Je(null,{scaleMode:Cs.NEAREST,resolution:1,mipmap:gs.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new Je(null,{scaleMode:Cs.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:gs.OFF,format:Se.DEPTH_COMPONENT,type:Ne.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,t){if(e=Math.round(e),t=Math.round(t),!e||!t)throw new Error("Framebuffer width and height must not be zero");if(!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(let i=0;i{const n=this.source;this.url=n.src;const r=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};n.complete&&n.src?r():(n.onload=r,n.onerror=o=>{i(o),this.onError.emit(o)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const t=globalThis.createImageBitmap,i=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then(n=>n.blob()).then(n=>t(n,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===xi.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,t,i){if(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,t,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,t,i,this.bitmap),!this.preserveBitmap){let n=!0;const r=t._glTextures;for(const o in r){const a=r[o];if(a!==i&&a.dirtyId!==t.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class Jm{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,t,i){const n=t.width,r=t.height;if(i){const o=e.width/2/n,a=e.height/2/r,c=e.x/n+o,l=e.y/r+a;i=Gt.add(i,Gt.NW),this.x0=c+o*Gt.uX(i),this.y0=l+a*Gt.uY(i),i=Gt.add(i,2),this.x1=c+o*Gt.uX(i),this.y1=l+a*Gt.uY(i),i=Gt.add(i,2),this.x2=c+o*Gt.uX(i),this.y2=l+a*Gt.uY(i),i=Gt.add(i,2),this.x3=c+o*Gt.uX(i),this.y3=l+a*Gt.uY(i)}else this.x0=e.x/n,this.y0=e.y/r,this.x1=(e.x+e.width)/n,this.y1=e.y/r,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/r,this.x3=e.x/n,this.y3=(e.y+e.height)/r;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}Jm.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const U0=new Jm;function Gl(s){s.destroy=function(){},s.on=function(){},s.once=function(){},s.emit=function(){}}let We=class Lt extends bl{constructor(e,t,i,n,r,o,a){if(super(),this.noFrame=!1,t||(this.noFrame=!0,t=new rt(0,0,1,1)),e instanceof Lt&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=n,this.valid=!1,this.destroyed=!1,this._uvs=U0,this.uvMatrix=null,this.orig=i||t,this._rotate=Number(r||0),r===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new gt(o.x,o.y):new gt(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=t:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:t}=this.baseTexture;t!=null&&t.url&&$s[t.url]&&Lt.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Lt.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var n;const e=this._frame.clone(),t=this._frame===this.orig?e:this.orig.clone(),i=new Lt(this.baseTexture,!this.noFrame&&e,t,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}updateUvs(){this._uvs===U0&&(this._uvs=new Jm),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,t={},i=ke.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else if(e instanceof Je){if(!e.cacheId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e.cacheId=`${a}-${ro()}`,Je.addToCache(e,e.cacheId)}r=e.cacheId}else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${ro()}`}r=e._pixiId}let o=$s[r];if(n&&i&&!o)throw new Error(`The cacheId "${r}" does not exist in TextureCache.`);return!o&&!(e instanceof Je)?(t.resolution||(t.resolution=Xn(e)),o=new Lt(new Je(e,t)),o.baseTexture.cacheId=r,Je.addToCache(o.baseTexture,r),Lt.addToCache(o,r)):!o&&e instanceof Je&&(o=new Lt(e),Lt.addToCache(o,r)),o}static fromURL(e,t){const i=Object.assign({autoLoad:!1},t==null?void 0:t.resourceOptions),n=Lt.from(e,Object.assign({resourceOptions:i},t),!1),r=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):r.load().then(()=>Promise.resolve(n))}static fromBuffer(e,t,i,n){return new Lt(Je.fromBuffer(e,t,i,n))}static fromLoader(e,t,i,n){const r=new Je(e,Object.assign({scaleMode:Je.defaultOptions.scaleMode,resolution:Xn(t)},n)),{resource:o}=r;o instanceof Jy&&(o.url=t);const a=new Lt(r);return i||(i=t),Je.addToCache(a.baseTexture,i),Lt.addToCache(a,i),i!==t&&(Je.addToCache(a.baseTexture,t),Lt.addToCache(a,t)),a.baseTexture.valid?Promise.resolve(a):new Promise(c=>{a.baseTexture.once("loaded",()=>c(a))})}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),$s[t]&&$s[t]!==e&&console.warn(`Texture added to the cache with an id [${t}] that already had an entry`),$s[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=$s[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete $s[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;tthis.baseTexture.width,a=i+r>this.baseTexture.height;if(o||a){const c=o&&a?"and":"or",l=`X: ${t} + ${n} = ${t+n} > ${this.baseTexture.width}`,h=`Y: ${i} + ${r} = ${i+r} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${c} ${h}`)}this.valid=n&&r&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Lt._EMPTY||(Lt._EMPTY=new Lt(new Je),Gl(Lt._EMPTY),Gl(Lt._EMPTY.baseTexture)),Lt._EMPTY}static get WHITE(){if(!Lt._WHITE){const e=ke.ADAPTER.createCanvas(16,16),t=e.getContext("2d");e.width=16,e.height=16,t.fillStyle="white",t.fillRect(0,0,16,16),Lt._WHITE=new Lt(Je.from(e)),Gl(Lt._WHITE),Gl(Lt._WHITE.baseTexture)}return Lt._WHITE}};class uo extends We{constructor(e,t){super(e,t),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,t,i=!0){const n=this.baseTexture.resolution,r=Math.round(e*n)/n,o=Math.round(t*n)/n;this.valid=r>0&&o>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=o,i&&this.baseTexture.resize(r,o),this.updateUvs()}setResolution(e){const{baseTexture:t}=this;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))}static create(e){return new uo(new Zy(e))}}class Qy{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,t,i=ai.NONE){const n=new Zy(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new uo(n)}getOptimalTexture(e,t,i=1,n=ai.NONE){let r;e=Math.max(Math.ceil(e*i-1e-6),1),t=Math.max(Math.ceil(t*i-1e-6),1),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=Hc(e),t=Hc(t),r=((e&65535)<<16|t&65535)>>>0,n>1&&(r+=n*4294967296)):r=n>1?-n:-1,this.texturePool[r]||(this.texturePool[r]=[]);let o=this.texturePool[r].pop();return o||(o=this.createTexture(e,t,n)),o.filterPoolKey=r,o.setResolution(i),o}getFilterTexture(e,t,i){const n=this.getOptimalTexture(e.width,e.height,t||e.resolution,i||ai.NONE);return n.filterFrame=e.filterFrame,n}returnTexture(e){const t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const t in this.texturePool){const i=this.texturePool[t];if(i)for(let n=0;n0&&e.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const i=this.texturePool[t];if(i)for(let n=0;n1&&(h=this.getOptimalFilterTexture(l.width,l.height,t.resolution),h.filterFrame=l.filterFrame),i[u].apply(this,l,h,Zs.CLEAR,t);const d=l;l=h,h=d}i[u].apply(this,l,c.renderTexture,Zs.BLEND,t),u>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)}bindAndClear(e,t=Zs.CLEAR){const{renderTexture:i,state:n}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e==null?void 0:e.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,i.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const r=n.stateId&1||this.forceClear;(t===Zs.CLEAR||t===Zs.BLIT&&r)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,t,i,n){const r=this.renderer;r.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,r.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),r.geometry.bind(this.quadUv),r.geometry.draw(sn.TRIANGLES)):(r.geometry.bind(this.quad),r.geometry.draw(sn.TRIANGLE_STRIP))}calculateSpriteMatrix(e,t){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:r}=t._texture,o=e.set(n.width,0,0,n.height,i.x,i.y),a=t.worldTransform.copyTo(Ut.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/r.width,1/r.height),o.translate(t.anchor.x,t.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,t,i=1,n=ai.NONE){return this.texturePool.getOptimalTexture(e,t,i,n)}getFilterTexture(e,t,i){if(typeof e=="number"){const r=e;e=t,t=r}e=e||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,i||ai.NONE);return n.filterFrame=e.filterFrame,n}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,t){const i=Hl[0],n=Hl[1],r=Hl[2],o=Hl[3];i.set(t.left,t.top),n.set(t.left,t.bottom),r.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(i,i),e.apply(n,n),e.apply(r,r),e.apply(o,o);const a=Math.min(i.x,n.x,r.x,o.x),c=Math.min(i.y,n.y,r.y,o.y),l=Math.max(i.x,n.x,r.x,o.x),h=Math.max(i.y,n.y,r.y,o.y);t.x=a,t.y=c,t.width=l-a,t.height=h-c}roundFrame(e,t,i,n,r){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(r){const{a:o,b:a,c,d:l}=r;if((Math.abs(a)>1e-4||Math.abs(c)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(l)>1e-4))return}r=r?kd.copyFrom(r):kd.identity(),r.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(r,e),e.ceil(t),this.transformAABB(r.invert(),e)}}}tb.extension={type:Re.RendererSystem,name:"filter"};Ue.add(tb);class QC{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=ai.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const eA=new rt;class ib{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Ff(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new rt,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let t=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;ke.PREFER_ENV===ho.WEBGL_LEGACY&&(t=null,i=null),t?e.drawBuffers=n=>t.drawBuffersWEBGL(n):(this.hasMRT=!1,e.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,t,i=0){const{gl:n}=this;if(e){const r=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,r.framebuffer)),r.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,r.mipLevel=i),r.dirtyId!==e.dirtyId&&(r.dirtyId=e.dirtyId,r.dirtyFormat!==e.dirtyFormat?(r.dirtyFormat=e.dirtyFormat,r.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):r.dirtySize!==e.dirtySize&&(r.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let o=0;o>i,a=t.height>>i,c=o/t.width;this.setViewport(t.x*c,t.y*c,o,a)}else{const o=e.width>>i,a=e.height>>i;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,t,i,n){const r=this.viewport;e=Math.round(e),t=Math.round(t),i=Math.round(i),n=Math.round(n),(r.width!==i||r.height!==n||r.x!==e||r.y!==t)&&(r.x=e,r.y=t,r.width=i,r.height=n,this.gl.viewport(e,t,i,n))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,t,i,n,r=yf.COLOR|yf.DEPTH){const{gl:o}=this;o.clearColor(e,t,i,n),o.clear(r)}initFramebuffer(e){const{gl:t}=this,i=new QC(t.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i}resizeFramebuffer(e){const{gl:t}=this,i=e.glFramebuffers[this.CONTEXT_UID];if(i.stencil){t.bindRenderbuffer(t.RENDERBUFFER,i.stencil);let o;this.renderer.context.webGLVersion===1?o=t.DEPTH_STENCIL:e.depth&&e.stencil?o=t.DEPTH24_STENCIL8:e.depth?o=t.DEPTH_COMPONENT24:o=t.STENCIL_INDEX8,i.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,o,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,o,e.width,e.height)}const n=e.colorTextures;let r=n.length;t.drawBuffers||(r=Math.min(r,1));for(let o=0;o1&&this.canMultisampleFramebuffer(e)?n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer():n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const a=[];for(let c=0;c1&&i.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){const c=e.depthTexture;this.renderer.texture.bind(c,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){n.stencil=n.stencil||i.createRenderbuffer();let c,l;this.renderer.context.webGLVersion===1?(c=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH_STENCIL):e.depth&&e.stencil?(c=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH24_STENCIL8):e.depth?(c=i.DEPTH_ATTACHMENT,l=i.DEPTH_COMPONENT24):(c=i.STENCIL_ATTACHMENT,l=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,l,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,l,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,c,i.RENDERBUFFER,n.stencil)}else n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:t}=this;let i=ai.NONE;if(e<=1||t===null)return i;for(let n=0;n=0&&this.managedFramebuffers.splice(r,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,t)}disposeAll(e){const t=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;ii.createVertexArrayOES(),e.bindVertexArray=n=>i.bindVertexArrayOES(n),e.deleteVertexArray=n=>i.deleteVertexArrayOES(n)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(t.webGLVersion!==2){const i=e.getExtension("ANGLE_instanced_arrays");i?(e.vertexAttribDivisor=(n,r)=>i.vertexAttribDivisorANGLE(n,r),e.drawElementsInstanced=(n,r,o,a,c)=>i.drawElementsInstancedANGLE(n,r,o,a,c),e.drawArraysInstanced=(n,r,o,a)=>i.drawArraysInstancedANGLE(n,r,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex}bind(e,t){t=t||this.renderer.shader.shader;const{gl:i}=this;let n=e.glVertexArrayObjects[this.CONTEXT_UID],r=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},r=!0);const o=n[t.program.id]||this.initGeometryVao(e,t,r);this._activeGeometry=e,this._activeVao!==o&&(this._activeVao=o,this.hasVao?i.bindVertexArray(o):this.activateVao(e,t.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,t=this.renderer.buffer;for(let i=0;i"u"?.5:t,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,t){t===void 0&&(t=e);const i=this.mapCoord;for(let n=0;n0?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}}nb.extension={type:Re.RendererSystem,name:"mask"};Ue.add(nb);class rb{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 X0=new Ut,V0=[],ob=class yc extends rb{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,V0.pop()??new rt);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()||yc.isMatrixRotated(t.worldTransform)||yc.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){yc.isMatrixRotated(r)||(r=r?X0.copyFrom(r):X0.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&&V0.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)}};ob.extension={type:Re.RendererSystem,name:"scissor"};let rA=ob;Ue.add(rA);class ab extends rb{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)}}ab.extension={type:Re.RendererSystem,name:"stencil"};Ue.add(ab);class lb{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return ht("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return ht("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return ht("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}}lb.extension={type:[Re.RendererSystem,Re.CanvasRendererSystem],name:"_plugin"};Ue.add(lb);class cb{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ut,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}}cb.extension={type:Re.RendererSystem,name:"projection"};Ue.add(cb);const oA=new Zm,Y0=new rt;class hb{constructor(e){this.renderer=e,this._tempMatrix=new Ut}generateTexture(e,t){const{region:i,...n}=t||{},r=(i==null?void 0:i.copyTo(Y0))||e.getLocalBounds(Y0,!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=uo.create(n);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const c=e.transform;return e.transform=oA,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=c,a}destroy(){}}hb.extension={type:[Re.RendererSystem,Re.CanvasRendererSystem],name:"textureGenerator"};Ue.add(hb);const kr=new rt,Ta=new rt;class ub{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new rt,this.destinationFrame=new rt,this.viewportFrame=new rt}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||(kr.width=e.frame.width,kr.height=e.frame.height,t=kr),i||(Ta.x=e.frame.x,Ta.y=e.frame.y,Ta.width=t.width,Ta.height=t.height,i=Ta),o=r.framebuffer):(a=n.resolution,t||(kr.width=n._view.screen.width,kr.height=n._view.screen.height,t=kr),i||(i=kr,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=Mt.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}}ub.extension={type:Re.RendererSystem,name:"renderTexture"};Ue.add(ub);class aA{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 lA(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 mA(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 pA(s,e){if(!s.autoManage)return{size:0,syncFunc:uA};const t=mA(s.uniforms,e),{uboElements:i,size:n}=fA(t),r=[` - var v = null; - var v2 = null; - var cv = null; - var t = 0; - var gl = renderer.gl - var index = 0; - var data = buffer.data; - `];for(let o=0;o1){const u=Wy(a.data.type),d=Math.max(db[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}; - - t = 0; - - for(var i=0; i < ${a.data.size*d}; i++) - { - for(var j = 0; j < ${f}; j++) - { - data[offset++] = v[t++]; - } - offset += ${p}; - } - - `)}else{const u=dA[a.data.type];r.push(` - cv = ud.${l}.value; - v = uv.${l}; - offset = ${a.offset/4}; - ${u}; - `)}}return r.push(` - renderer.buffer.update(buffer); - `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",r.join(` -`))}}let gA=0;const jl={textureCount:0,uboCount:0};class fb{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=gA++}systemCheck(){if(!VC())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]=DC(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]=pA(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=hA(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}}fb.extension={type:Re.RendererSystem,name:"shader"};Ue.add(fb);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:[Re.RendererSystem,Re.CanvasRendererSystem],name:"startup"};Ue.add(Kc);function vA(s,e=[]){return e[He.NORMAL]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.ADD]=[s.ONE,s.ONE],e[He.MULTIPLY]=[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.SCREEN]=[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.OVERLAY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.DARKEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.LIGHTEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.COLOR_DODGE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.COLOR_BURN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.HARD_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.SOFT_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.DIFFERENCE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.EXCLUSION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.HUE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.SATURATION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.COLOR]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.LUMINOSITY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.NONE]=[0,0],e[He.NORMAL_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.ADD_NPM]=[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],e[He.SCREEN_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[He.SRC_IN]=[s.DST_ALPHA,s.ZERO],e[He.SRC_OUT]=[s.ONE_MINUS_DST_ALPHA,s.ZERO],e[He.SRC_ATOP]=[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[He.DST_OVER]=[s.ONE_MINUS_DST_ALPHA,s.ONE],e[He.DST_IN]=[s.ZERO,s.SRC_ALPHA],e[He.DST_OUT]=[s.ZERO,s.ONE_MINUS_SRC_ALPHA],e[He.DST_ATOP]=[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],e[He.XOR]=[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[He.SUBTRACT]=[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD],e}const xA=0,yA=1,bA=2,wA=3,SA=4,TA=5,mb=class Of{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=He.NONE,this._blendEq=!1,this.map=[],this.map[xA]=this.setBlend,this.map[yA]=this.setOffset,this.map[bA]=this.setCullFace,this.map[wA]=this.setDepthTest,this.map[SA]=this.setFrontFace,this.map[TA]=this.setDepthMask,this.checks=[],this.defaultState=new un,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=vA(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 Fa=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}};Fa.defaultMode=Wm.AUTO,Fa.defaultMaxIdle=3600,Fa.defaultCheckCountMax=600,Fa.extension={type:Re.RendererSystem,name:"textureGC"};let Xr=Fa;Ue.add(Xr);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=Ne.UNSIGNED_BYTE,this.internalFormat=Se.RGBA,this.samplerType=0}}function CA(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 AA(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[Ne.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},[Ne.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},[Ne.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},[Ne.SHORT]:{[Se.RGBA_INTEGER]:s.RGBA16I,[Se.RGB_INTEGER]:s.RGB16I,[Se.RG_INTEGER]:s.RG16I,[Se.RED_INTEGER]:s.R16I},[Ne.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},[Ne.INT]:{[Se.RGBA_INTEGER]:s.RGBA32I,[Se.RGB_INTEGER]:s.RGB32I,[Se.RG_INTEGER]:s.RG32I,[Se.RED_INTEGER]:s.R32I},[Ne.FLOAT]:{[Se.RGBA]:s.RGBA32F,[Se.RGB]:s.RGB32F,[Se.RG]:s.RG32F,[Se.RED]:s.R32F,[Se.DEPTH_COMPONENT]:s.DEPTH_COMPONENT32F},[Ne.HALF_FLOAT]:{[Se.RGBA]:s.RGBA16F,[Se.RGB]:s.RGB16F,[Se.RG]:s.RG16F,[Se.RED]:s.R16F},[Ne.UNSIGNED_SHORT_5_6_5]:{[Se.RGB]:s.RGB565},[Ne.UNSIGNED_SHORT_4_4_4_4]:{[Se.RGBA]:s.RGBA4},[Ne.UNSIGNED_SHORT_5_5_5_1]:{[Se.RGBA]:s.RGB5_A1},[Ne.UNSIGNED_INT_2_10_10_10_REV]:{[Se.RGBA]:s.RGB10_A2,[Se.RGBA_INTEGER]:s.RGB10_A2UI},[Ne.UNSIGNED_INT_10F_11F_11F_REV]:{[Se.RGB]:s.R11F_G11F_B10F},[Ne.UNSIGNED_INT_5_9_9_9_REV]:{[Se.RGB]:s.RGB9_E5},[Ne.UNSIGNED_INT_24_8]:{[Se.DEPTH_STENCIL]:s.DEPTH24_STENCIL8},[Ne.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[Se.DEPTH_STENCIL]:s.DEPTH32F_STENCIL8}}:e={[Ne.UNSIGNED_BYTE]:{[Se.RGBA]:s.RGBA,[Se.RGB]:s.RGB,[Se.ALPHA]:s.ALPHA,[Se.LUMINANCE]:s.LUMINANCE,[Se.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Ne.UNSIGNED_SHORT_5_6_5]:{[Se.RGB]:s.RGB},[Ne.UNSIGNED_SHORT_4_4_4_4]:{[Se.RGBA]:s.RGBA},[Ne.UNSIGNED_SHORT_5_5_5_1]:{[Se.RGBA]:s.RGBA}},e}class pb{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=AA(e),this.samplerTypes=CA(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===Ne.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&&Go(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}}pb.extension={type:Re.RendererSystem,name:"texture"};Ue.add(pb);class gb{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))(oo||{});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 vb=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=oo.NORMAL){return this._addListener(new Bd(e,t,i))}addOnce(e,t,i=oo.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?Vi.shared:new Vi,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}xb.extension=Re.Application;Ue.add(xb);const yb=[];Ue.handleByList(Re.Renderer,yb);function EA(s){for(const e of yb)if(e.test(s))return new e(s);throw new Error("Unable to auto-detect a suitable renderer.")}var IA=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,RA=`attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -vec2 filterTextureCoord( void ) -{ - return aVertexPosition * (outputFrame.zw * inputSize.zw); -} - -void main(void) -{ - gl_Position = filterVertexPosition(); - vTextureCoord = filterTextureCoord(); -} -`;const PA=IA,bb=RA;class wb{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>=ai.HIGH?this.multisample=ai.HIGH:t>=ai.MEDIUM?this.multisample=ai.MEDIUM:t>=ai.LOW?this.multisample=ai.LOW:this.multisample=ai.NONE}destroy(){}}wb.extension={type:Re.RendererSystem,name:"_multisample"};Ue.add(wb);class kA{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Sb{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 FA extends Mb{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=Yo.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=Yo.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===xi.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 Oo._EMPTY=Oo._EMPTY??ke.ADAPTER.createCanvas(0,0),Oo._EMPTY}}const Lf=class Sc extends Vn{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;Vn.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_${ro()}`,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 LA extends Vn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const Nf=class Uf extends Vn{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];Vn.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&&(Vi.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||(Vi.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Vi.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 Cb=Nf;_f.push(Oo,Jy,OA,Cb,LA,Df,Kh,BA,FA);class cl{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?rt.EMPTY:(e=e||new rt(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 qt extends bl{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 cl,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);Go(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(UA),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=NA.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&&Ma.x=r&&Ma.y=t&&(o=s-a-1),c=c.replace("%value%",e[o].toString()),n+=c,n+=` -`}return i=i.replace("%blur%",n),i=i.replace("%size%",s.toString()),i}const WA=` - attribute vec2 aVertexPosition; - - uniform mat3 projectionMatrix; - - uniform float strength; - - varying vec2 vBlurTexCoords[%size%]; - - uniform vec4 inputSize; - uniform vec4 outputFrame; - - vec4 filterVertexPosition( void ) - { - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); - } - - vec2 filterTextureCoord( void ) - { - return aVertexPosition * (outputFrame.zw * inputSize.zw); - } - - void main(void) - { - gl_Position = filterVertexPosition(); - - vec2 textureCoord = filterTextureCoord(); - %blur% - }`;function zA(s,e){const t=Math.ceil(s/2);let i=WA,n="",r;e?r="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":r="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o 0.0) { - c.rgb /= c.a; - } - - vec4 result; - - result.r = (m[0] * c.r); - result.r += (m[1] * c.g); - result.r += (m[2] * c.b); - result.r += (m[3] * c.a); - result.r += m[4]; - - result.g = (m[5] * c.r); - result.g += (m[6] * c.g); - result.g += (m[7] * c.b); - result.g += (m[8] * c.a); - result.g += m[9]; - - result.b = (m[10] * c.r); - result.b += (m[11] * c.g); - result.b += (m[12] * c.b); - result.b += (m[13] * c.a); - result.b += m[14]; - - result.a = (m[15] * c.r); - result.a += (m[16] * c.g); - result.a += (m[17] * c.b); - result.a += (m[18] * c.a); - result.a += m[19]; - - vec3 rgb = mix(c.rgb, result.rgb, uAlpha); - - // Premultiply alpha again. - rgb *= result.a; - - gl_FragColor = vec4(rgb, result.a); -} -`;class Vf extends Xi{constructor(){const e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(bb,KA,e),this.alpha=1}_loadMatrix(e,t=!1){let i=e;t&&(this._multiply(i,this.uniforms.m,e),i=this._colorMatrix(i)),this.uniforms.m=i}_multiply(e,t,i){return e[0]=t[0]*i[0]+t[1]*i[5]+t[2]*i[10]+t[3]*i[15],e[1]=t[0]*i[1]+t[1]*i[6]+t[2]*i[11]+t[3]*i[16],e[2]=t[0]*i[2]+t[1]*i[7]+t[2]*i[12]+t[3]*i[17],e[3]=t[0]*i[3]+t[1]*i[8]+t[2]*i[13]+t[3]*i[18],e[4]=t[0]*i[4]+t[1]*i[9]+t[2]*i[14]+t[3]*i[19]+t[4],e[5]=t[5]*i[0]+t[6]*i[5]+t[7]*i[10]+t[8]*i[15],e[6]=t[5]*i[1]+t[6]*i[6]+t[7]*i[11]+t[8]*i[16],e[7]=t[5]*i[2]+t[6]*i[7]+t[7]*i[12]+t[8]*i[17],e[8]=t[5]*i[3]+t[6]*i[8]+t[7]*i[13]+t[8]*i[18],e[9]=t[5]*i[4]+t[6]*i[9]+t[7]*i[14]+t[8]*i[19]+t[9],e[10]=t[10]*i[0]+t[11]*i[5]+t[12]*i[10]+t[13]*i[15],e[11]=t[10]*i[1]+t[11]*i[6]+t[12]*i[11]+t[13]*i[16],e[12]=t[10]*i[2]+t[11]*i[7]+t[12]*i[12]+t[13]*i[17],e[13]=t[10]*i[3]+t[11]*i[8]+t[12]*i[13]+t[13]*i[18],e[14]=t[10]*i[4]+t[11]*i[9]+t[12]*i[14]+t[13]*i[19]+t[14],e[15]=t[15]*i[0]+t[16]*i[5]+t[17]*i[10]+t[18]*i[15],e[16]=t[15]*i[1]+t[16]*i[6]+t[17]*i[11]+t[18]*i[16],e[17]=t[15]*i[2]+t[16]*i[7]+t[17]*i[12]+t[18]*i[17],e[18]=t[15]*i[3]+t[16]*i[8]+t[17]*i[13]+t[18]*i[18],e[19]=t[15]*i[4]+t[16]*i[9]+t[17]*i[14]+t[18]*i[19]+t[19],e}_colorMatrix(e){const t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){const i=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(i,t)}tint(e,t){const[i,n,r]=Mt.shared.setValue(e).toArray(),o=[i,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0];this._loadMatrix(o,t)}greyscale(e,t){const i=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(i,t)}blackAndWhite(e){const t=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(t,e)}hue(e,t){e=(e||0)/180*Math.PI;const i=Math.cos(e),n=Math.sin(e),r=Math.sqrt,o=1/3,a=r(o),c=i+(1-i)*o,l=o*(1-i)-a*n,h=o*(1-i)+a*n,u=o*(1-i)+a*n,d=i+o*(1-i),f=o*(1-i)-a*n,p=o*(1-i)-a*n,m=o*(1-i)+a*n,g=i+o*(1-i),v=[c,l,h,0,0,u,d,f,0,0,p,m,g,0,0,0,0,0,1,0];this._loadMatrix(v,t)}contrast(e,t){const i=(e||0)+1,n=-.5*(i-1),r=[i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0];this._loadMatrix(r,t)}saturate(e=0,t){const i=e*2/3+1,n=(i-1)*-.5,r=[i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0];this._loadMatrix(r,t)}desaturate(){this.saturate(-1)}negative(e){const t=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(t,e)}sepia(e){const t=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(t,e)}technicolor(e){const t=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(t,e)}polaroid(e){const t=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(t,e)}toBGR(e){const t=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(t,e)}kodachrome(e){const t=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(t,e)}browni(e){const t=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(t,e)}vintage(e){const t=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(t,e)}colorTone(e,t,i,n,r){e=e||.2,t=t||.15,i=i||16770432,n=n||3375104;const o=Mt.shared,[a,c,l]=o.setValue(i).toArray(),[h,u,d]=o.setValue(n).toArray(),f=[.3,.59,.11,0,0,a,c,l,e,0,h,u,d,t,0,a-h,c-u,l-d,0,0];this._loadMatrix(f,r)}night(e,t){e=e||.1;const i=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(i,t)}predator(e,t){const i=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(i,t)}lsd(e){const t=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(t,e)}reset(){const e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)}get matrix(){return this.uniforms.m}set matrix(e){this.uniforms.m=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}Vf.prototype.grayscale=Vf.prototype.greyscale;var ZA=`varying vec2 vFilterCoord; -varying vec2 vTextureCoord; - -uniform vec2 scale; -uniform mat2 rotation; -uniform sampler2D uSampler; -uniform sampler2D mapSampler; - -uniform highp vec4 inputSize; -uniform vec4 inputClamp; - -void main(void) -{ - vec4 map = texture2D(mapSampler, vFilterCoord); - - map -= 0.5; - map.xy = scale * inputSize.zw * (rotation * map.xy); - - gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw)); -} -`,JA=`attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; -uniform mat3 filterMatrix; - -varying vec2 vTextureCoord; -varying vec2 vFilterCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -vec2 filterTextureCoord( void ) -{ - return aVertexPosition * (outputFrame.zw * inputSize.zw); -} - -void main(void) -{ - gl_Position = filterVertexPosition(); - vTextureCoord = filterTextureCoord(); - vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy; -} -`;class QA extends Xi{constructor(e,t){const i=new Ut;e.renderable=!1,super(JA,ZA,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,t==null&&(t=20),this.scale=new gt(t,t)}apply(e,t,i,n){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const r=this.maskSprite.worldTransform,o=Math.sqrt(r.a*r.a+r.b*r.b),a=Math.sqrt(r.c*r.c+r.d*r.d);o!==0&&a!==0&&(this.uniforms.rotation[0]=r.a/o,this.uniforms.rotation[1]=r.b/o,this.uniforms.rotation[2]=r.c/a,this.uniforms.rotation[3]=r.d/a),e.applyFilter(this,t,i,n)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var e2=`varying vec2 v_rgbNW; -varying vec2 v_rgbNE; -varying vec2 v_rgbSW; -varying vec2 v_rgbSE; -varying vec2 v_rgbM; - -varying vec2 vFragCoord; -uniform sampler2D uSampler; -uniform highp vec4 inputSize; - - -/** - Basic FXAA implementation based on the code on geeks3d.com with the - modification that the texture2DLod stuff was removed since it's - unsupported by WebGL. - - -- - - From: - https://github.com/mitsuhiko/webgl-meincraft - - Copyright (c) 2011 by Armin Ronacher. - - Some rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FXAA_REDUCE_MIN -#define FXAA_REDUCE_MIN (1.0/ 128.0) -#endif -#ifndef FXAA_REDUCE_MUL -#define FXAA_REDUCE_MUL (1.0 / 8.0) -#endif -#ifndef FXAA_SPAN_MAX -#define FXAA_SPAN_MAX 8.0 -#endif - -//optimized version for mobile, where dependent -//texture reads can be a bottleneck -vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP, - vec2 v_rgbNW, vec2 v_rgbNE, - vec2 v_rgbSW, vec2 v_rgbSE, - vec2 v_rgbM) { - vec4 color; - vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; - vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; - vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; - vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; - vec4 texColor = texture2D(tex, v_rgbM); - vec3 rgbM = texColor.xyz; - vec3 luma = vec3(0.299, 0.587, 0.114); - float lumaNW = dot(rgbNW, luma); - float lumaNE = dot(rgbNE, luma); - float lumaSW = dot(rgbSW, luma); - float lumaSE = dot(rgbSE, luma); - float lumaM = dot(rgbM, luma); - float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); - float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); - - mediump vec2 dir; - dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); - dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); - - float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * - (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN); - - float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce); - dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX), - max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), - dir * rcpDirMin)) * inverseVP; - - vec3 rgbA = 0.5 * ( - texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + - texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); - vec3 rgbB = rgbA * 0.5 + 0.25 * ( - texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + - texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); - - float lumaB = dot(rgbB, luma); - if ((lumaB < lumaMin) || (lumaB > lumaMax)) - color = vec4(rgbA, texColor.a); - else - color = vec4(rgbB, texColor.a); - return color; -} - -void main() { - - vec4 color; - - color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); - - gl_FragColor = color; -} -`,t2=` -attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; - -varying vec2 v_rgbNW; -varying vec2 v_rgbNE; -varying vec2 v_rgbSW; -varying vec2 v_rgbSE; -varying vec2 v_rgbM; - -varying vec2 vFragCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -void texcoords(vec2 fragCoord, vec2 inverseVP, - out vec2 v_rgbNW, out vec2 v_rgbNE, - out vec2 v_rgbSW, out vec2 v_rgbSE, - out vec2 v_rgbM) { - v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP; - v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP; - v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP; - v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP; - v_rgbM = vec2(fragCoord * inverseVP); -} - -void main(void) { - - gl_Position = filterVertexPosition(); - - vFragCoord = aVertexPosition * outputFrame.zw; - - texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); -} -`;class i2 extends Xi{constructor(){super(t2,e2)}}var s2=`precision highp float; - -varying vec2 vTextureCoord; -varying vec4 vColor; - -uniform float uNoise; -uniform float uSeed; -uniform sampler2D uSampler; - -float rand(vec2 co) -{ - return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); -} - -void main() -{ - vec4 color = texture2D(uSampler, vTextureCoord); - float randomValue = rand(gl_FragCoord.xy * uSeed); - float diff = (randomValue - 0.5) * uNoise; - - // Un-premultiply alpha before applying the color matrix. See issue #3539. - if (color.a > 0.0) { - color.rgb /= color.a; - } - - color.r += diff; - color.g += diff; - color.b += diff; - - // Premultiply alpha again. - color.rgb *= color.a; - - gl_FragColor = color; -} -`;class n2 extends Xi{constructor(e=.5,t=Math.random()){super(bb,s2,{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 G0={AlphaFilter:YA,BlurFilter:qA,BlurFilterPass:Xf,ColorMatrixFilter:Vf,DisplacementFilter:QA,FXAAFilter:i2,NoiseFilter:n2};Object.entries(G0).forEach(([s,e])=>{Object.defineProperty(G0,s,{get(){return ht("7.1.0",`filters.${s} has moved to ${s}`),e}})});class r2{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||(Vi.system.add(this.tickerUpdate,this,oo.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Vi.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")&&(rr.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 jo)){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=c2),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=h2[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:[Re.RendererSystem,Re.CanvasRendererSystem]},Yf.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Hf=Yf;Ue.add(Hf);function H0(s){return s==="dynamic"||s==="static"}const u2={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??H0(Hf.defaultEventMode)},set interactive(s){ht("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=H0(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 wl))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}};qt.mixin(u2);const d2={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};qt.mixin(d2);const f2=9,Wl=100,m2=0,p2=0,j0=2,W0=1,g2=-1e3,v2=-1e3,x2=2;class Ib{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,(En.tablet||En.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=`${m2}px`,t.style.left=`${p2}px`,t.style.zIndex=j0.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=`${W0}px`,e.style.height=`${W0}px`,e.style.position="absolute",e.style.top=`${g2}px`,e.style.left=`${v2}px`,e.style.zIndex=x2.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=j0.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 wl(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===f2&&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}}Ib.extension={name:"accessibility",type:[Re.RendererPlugin,Re.CanvasRendererPlugin]};Ue.add(Ib);const Rb=class jf{constructor(e){this.stage=new _i,e=Object.assign({forceCanvas:!1},e),this.renderer=EA(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}};Rb._plugins=[];let Pb=Rb;Ue.handleByList(Re.Application,Pb._plugins);class kb{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}}kb.extension=Re.Application;Ue.add(kb);const z0={loader:Re.LoadParser,resolver:Re.ResolveParser,cache:Re.CacheParser,detection:Re.DetectionParser};Ue.handle(Re.Asset,s=>{const e=s.ref;Object.entries(z0).filter(([t])=>!!e[t]).forEach(([t,i])=>Ue.add(Object.assign(e[t],{extension:e[t].extension??i})))},s=>{const e=s.ref;Object.keys(z0).filter(t=>!!e[t]).forEach(t=>Ue.remove(e[t]))});class y2{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 Fb(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)}),Fb(s,n,0,t,i)}else i.push(s);return i}const eh=s=>!Array.isArray(s);class w2{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=Ms(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 We){const a=t;i.forEach(c=>{a.baseTexture!==We.EMPTY.baseTexture&&Je.addToCache(a.baseTexture,c),We.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 Yr=new w2;class S2{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=Qt.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=Ms(e,i=>({alias:[i],src:i})).map(async i=>{var o,a;const n=Qt.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 T2=".json",M2="application/json",_2={extension:{type:Re.LoadParser,priority:ns.Low},name:"loadJson",test(s){return ha(s,M2)||Ki(s,T2)},async load(s){return await(await ke.ADAPTER.fetch(s)).json()}};Ue.add(_2);const C2=".txt",A2="text/plain",E2={name:"loadTxt",extension:{type:Re.LoadParser,priority:ns.Low},test(s){return ha(s,A2)||Ki(s,C2)},async load(s){return await(await ke.ADAPTER.fetch(s)).text()}};Ue.add(E2);const I2=["normal","bold","100","200","300","400","500","600","700","800","900"],R2=[".ttf",".otf",".woff",".woff2"],P2=["font/ttf","font/otf","font/woff","font/woff2"],k2=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function F2(s){const e=Qt.extname(s),t=Qt.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(k2)){i=!1;break}let n=t.join(" ");return i||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const O2=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function B2(s){return O2.test(s)?s:encodeURI(s)}const L2={extension:{type:Re.LoadParser,priority:ns.Low},name:"loadWebFont",test(s){return ha(s,P2)||Ki(s,R2)},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)??F2(s),c=((r=(n=e.data)==null?void 0:n.weights)==null?void 0:r.filter(h=>I2.includes(h)))??["normal"],l=e.data??{};for(let h=0;hke.ADAPTER.getFontFaceSet().delete(e))}};Ue.add(L2);const D2=`(function() { - "use strict"; - const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; - async function checkImageBitmap() { - try { - if (typeof createImageBitmap != "function") - return !1; - const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob); - return imageBitmap.width === 1 && imageBitmap.height === 1; - } catch { - return !1; - } - } - checkImageBitmap().then((result) => { - self.postMessage(result); - }); -})(); -`;let Wo=null,Wf=class{constructor(){Wo||(Wo=URL.createObjectURL(new Blob([D2],{type:"application/javascript"}))),this.worker=new Worker(Wo)}};Wf.revokeObjectURL=function(){Wo&&(URL.revokeObjectURL(Wo),Wo=null)};const N2=`(function() { - "use strict"; - async function loadImageBitmap(url) { - const response = await fetch(url); - if (!response.ok) - throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`); - const imageBlob = await response.blob(); - return await createImageBitmap(imageBlob); - } - self.onmessage = async (event) => { - try { - const imageBitmap = await loadImageBitmap(event.data.data[0]); - self.postMessage({ - data: imageBitmap, - uuid: event.data.uuid, - id: event.data.id - }, [imageBitmap]); - } catch (e) { - self.postMessage({ - error: e, - uuid: event.data.uuid, - id: event.data.id - }); - } - }; -})(); -`;let zo=null;class Ob{constructor(){zo||(zo=URL.createObjectURL(new Blob([N2],{type:"application/javascript"}))),this.worker=new Worker(zo)}}Ob.revokeObjectURL=function(){zo&&(URL.revokeObjectURL(zo),zo=null)};let q0=0,Dd;class U2{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[q0]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:q0++,id:i})}}const K0=new U2;function Sl(s,e,t){s.resource.internal=!0;const i=new We(s),n=()=>{delete e.promiseCache[t],Yr.has(t)&&Yr.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 $2=[".jpeg",".jpg",".png",".webp",".avif"],X2=["image/jpeg","image/png","image/webp","image/avif"];async function V2(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:Re.LoadParser,priority:ns.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(s){return ha(s,X2)||Ki(s,$2)},async load(s,e,t){var a;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;i?this.config.preferWorkers&&await K0.isImageBitmapSupported()?n=await K0.loadImageBitmap(s):n=await V2(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=Xn(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,Sl(o,t,s)},unload(s){s.destroy(!0)}};Ue.add(tu);const Y2=".svg",G2="image/svg+xml",H2={extension:{type:Re.LoadParser,priority:ns.High},name:"loadSVG",test(s){return ha(s,G2)||Ki(s,Y2)},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:Xn(s),...e==null?void 0:e.data});return n.resource.src=e.src,Sl(n,t,e.src)},async load(s,e){return(await ke.ADAPTER.fetch(s)).text()},unload:tu.unload};Ue.add(H2);const j2=[".mp4",".m4v",".webm",".ogv"],W2=["video/mp4","video/webm","video/ogg"],z2={name:"loadVideo",extension:{type:Re.LoadParser,priority:ns.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(s){return ha(s,W2)||Ki(s,j2)},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 Cb(r,a);await c.load();const l=new Je(c,{alphaMode:await tC(),resolution:Xn(s),...e==null?void 0:e.data});l.resource.src=s,i=Sl(l,t,s),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(a){throw URL.revokeObjectURL(r),a}return i},unload(s){s.destroy(!0)}};Ue.add(z2);class q2{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 Ms(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"?(ht("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`)},Ms(o).forEach(c=>{const{src:l,srcs:h}=c;let{data:u,format:d,loadParser:f}=c;const p=Ms(l||h).map(v=>typeof v=="string"?b2(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(y=>{let x={};if(typeof y!="object"){x.src=y;for(let T=0;T{this._assetMap[v]=g})})}resolveBundle(e){const t=eh(e);e=Ms(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=Ms(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=Qt.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??Qt.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class K2{constructor(){this._detections=[],this._initialized=!1,this.resolver=new q2,this.loader=new S2,this.cache=Yr,this._backgroundLoader=new y2(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=Ms(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 Yr.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,Yr.set(h,l)}),o}async unload(e){this._initialized||await this.init();const t=Ms(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=Ms(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=>{Yr.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){ht("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 rn=new K2;Ue.handleByList(Re.LoadParser,rn.loader.parsers).handleByList(Re.ResolveParser,rn.resolver.parsers).handleByList(Re.CacheParser,rn.cache.parsers).handleByList(Re.DetectionParser,rn.detections);const Z2={extension:Re.CacheParser,test:s=>Array.isArray(s)&&s.every(e=>e instanceof We),getCacheableAssets:(s,e)=>{const t={};return s.forEach(i=>{e.forEach((n,r)=>{t[i+(r===0?"":r+1)]=n})}),t}};Ue.add(Z2);async function Bb(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 J2={extension:{type:Re.DetectionParser,priority:1},test:async()=>Bb("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async s=>[...s,"avif"],remove:async s=>s.filter(e=>e!=="avif")};Ue.add(J2);const Q2={extension:{type:Re.DetectionParser,priority:0},test:async()=>Bb("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async s=>[...s,"webp"],remove:async s=>s.filter(e=>e!=="webp")};Ue.add(Q2);const Z0=["png","jpg","jpeg"],eE={extension:{type:Re.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async s=>[...s,...Z0],remove:async s=>s.filter(e=>!Z0.includes(e))};Ue.add(eE);const tE="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function tp(s){return tE?!1:document.createElement("video").canPlayType(s)!==""}const iE={extension:{type:Re.DetectionParser,priority:0},test:async()=>tp("video/webm"),add:async s=>[...s,"webm"],remove:async s=>s.filter(e=>e!=="webm")};Ue.add(iE);const sE={extension:{type:Re.DetectionParser,priority:0},test:async()=>tp("video/mp4"),add:async s=>[...s,"mp4","m4v"],remove:async s=>s.filter(e=>e!=="mp4"&&e!=="m4v")};Ue.add(sE);const nE={extension:{type:Re.DetectionParser,priority:0},test:async()=>tp("video/ogg"),add:async s=>[...s,"ogv"],remove:async s=>s.filter(e=>e!=="ogv")};Ue.add(nE);const rE={extension:Re.ResolveParser,test:tu.test,parse:s=>{var e;return{resolution:parseFloat(((e=ke.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:Qt.extname(s).slice(1),src:s}}};Ue.add(rE);var yi=(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))(yi||{});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 Xs,Po;function J0(){Po={bptc:Xs.getExtension("EXT_texture_compression_bptc"),astc:Xs.getExtension("WEBGL_compressed_texture_astc"),etc:Xs.getExtension("WEBGL_compressed_texture_etc"),s3tc:Xs.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Xs.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:Xs.getExtension("WEBGL_compressed_texture_pvrtc")||Xs.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:Xs.getExtension("WEBGL_compressed_texture_etc1"),atc:Xs.getExtension("WEBGL_compressed_texture_atc")}}const oE={extension:{type:Re.DetectionParser,priority:2},test:async()=>{const s=ke.ADAPTER.createCanvas().getContext("webgl");return s?(Xs=s,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async s=>{Po||J0();const e=[];for(const t in Po)Po[t]&&e.push(t);return[...e,...s]},remove:async s=>(Po||J0(),s.filter(e=>!(e in Po)))};Ue.add(oE);class aE 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 Mf(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 Mf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class to extends aE{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=to._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||to._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,lE=32,Q0=20,cE=542327876,ql={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},hE={FOURCC:2},Kl={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},uE=1,dE=2,fE=4,mE=64,pE=512,gE=131072,vE=827611204,xE=861165636,yE=894720068,bE=808540228,wE=4,SE={[vE]:yi.COMPRESSED_RGBA_S3TC_DXT1_EXT,[xE]:yi.COMPRESSED_RGBA_S3TC_DXT3_EXT,[yE]:yi.COMPRESSED_RGBA_S3TC_DXT5_EXT},TE={70:yi.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:yi.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:yi.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:yi.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:yi.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:yi.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:yi.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:yi.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:yi.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:yi.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:yi.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:yi.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:yi.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function ME(s){const e=new Uint32Array(s);if(e[0]!==cE)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,lE/Uint32Array.BYTES_PER_ELEMENT),a=o[uE];if(a&fE){const c=o[hE.FOURCC];if(c!==bE){const y=SE[c],x=Nd+zl,T=new Uint8Array(s,x);return[new to(T,{format:y,width:n,height:i,levels:r})]}const l=Nd+zl,h=new Uint32Array(e.buffer,l,Q0/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=TE[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===wE)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+Q0;if(p===1)g.push(new Uint8Array(s,v));else{const y=th[m];let x=0,T=n,A=i;for(let b=0;b>>1,A=A>>>1}let S=v;for(let b=0;bnew to(y,{format:m,width:n,height:i,levels:r}))}throw a&mE?new Error("DDSParser does not support uncompressed texture data."):a&pE?new Error("DDSParser does not supported YUV uncompressed texture data."):a&gE?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&dE?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 ev=[171,75,84,88,32,49,49,187,13,10,26,10],_E=67305985,ys={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,tv={[Ne.UNSIGNED_BYTE]:1,[Ne.UNSIGNED_SHORT]:2,[Ne.INT]:4,[Ne.UNSIGNED_INT]:4,[Ne.FLOAT]:4,[Ne.HALF_FLOAT]:8},CE={[Se.RGBA]:4,[Se.RGB]:3,[Se.RG]:2,[Se.RED]:1,[Se.LUMINANCE]:1,[Se.LUMINANCE_ALPHA]:2,[Se.ALPHA]:1},AE={[Ne.UNSIGNED_SHORT_4_4_4_4]:2,[Ne.UNSIGNED_SHORT_5_5_5_1]:2,[Ne.UNSIGNED_SHORT_5_6_5]:2};function EE(s,e,t=!1){const i=new DataView(e);if(!IE(s,i))return null;const n=i.getUint32(ys.ENDIANNESS,!0)===_E,r=i.getUint32(ys.GL_TYPE,n),o=i.getUint32(ys.GL_FORMAT,n),a=i.getUint32(ys.GL_INTERNAL_FORMAT,n),c=i.getUint32(ys.PIXEL_WIDTH,n),l=i.getUint32(ys.PIXEL_HEIGHT,n)||1,h=i.getUint32(ys.PIXEL_DEPTH,n)||1,u=i.getUint32(ys.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=i.getUint32(ys.NUMBER_OF_FACES,n),f=i.getUint32(ys.NUMBER_OF_MIPMAP_LEVELS,n),p=i.getUint32(ys.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,y=l+3&-4,x=new Array(u);let T=c*l;r===0&&(T=v*y);let A;if(r!==0?tv[r]?A=tv[r]*CE[o]:A=AE[r]:A=th[a],A===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const S=t?PE(i,p,n):null;let b=T*A,_=c,I=l,F=v,E=y,k=zf+p;for(let B=0;B1||r!==0?_:F,levelHeight:f>1||r!==0?I:E,levelBuffer:new Uint8Array(e,$,b)},$+=b}k+=N+4,k=k%4!==0?k+4-k%4:k,_=_>>1||1,I=I>>1||1,F=_+m-1&-4,E=I+g-1&-4,b=F*E*A}return r!==0?{uncompressed:x.map(B=>{let N=B[0].levelBuffer,$=!1;return r===Ne.FLOAT?N=new Float32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4):r===Ne.UNSIGNED_INT?($=!0,N=new Uint32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)):r===Ne.INT&&($=!0,N=new Int32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)),{resource:new Kh(N,{width:B[0].levelWidth,height:B[0].levelHeight}),type:r,format:$?RE(o):o}}),kvData:S}:{compressed:x.map(B=>new to(null,{format:a,width:c,height:l,levels:f,levelBuffers:B})),kvData:S}}function IE(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:xi.NO_PREMULTIPLIED_ALPHA,resolution:Xn(s),...e.data});return Sl(o,t,s)});return n.length===1?n[0]:n},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};Ue.add(kE);const FE={extension:{type:Re.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}=EE(s,i),a=n??r,c={mipmap:gs.OFF,alphaMode:xi.NO_PREMULTIPLIED_ALPHA,resolution:Xn(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,Sl(d,t,s)});return l.length===1?l[0]:l},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};Ue.add(FE);const OE=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],BE={extension:Re.ResolveParser,test:s=>{const e=Qt.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(OE.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}}};Ue.add(BE);const Zl=new rt,LE=4,Lb=class Ba{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&&Ba._flipY(i,n,r),a&&Ba._unpremultiplyAlpha(i);const c=new vC(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&&Ba._flipY(i,n,r),a&&Ba._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 uo?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(LE*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,y=i+m;if(e[h++]=g,e[h++]=y,e[--u]=y,e[--u]=v,r){const x=i-m;e[d++]=v,e[d++]=x,e[--f]=x,e[--f]=g}}for(let p=1;p0||e&&i<=0){const n=t/2;for(let r=n+n%2;r=6){iv(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)}},UE={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||{}),hr=(s=>(s.BUTT="butt",s.ROUND="round",s.SQUARE="square",s))(hr||{});const ta={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 sv{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,y=g*m/f,x=v*m/p,T=g*u+v*l,A=g*h+v*c,S=l*(v+y),b=c*(v+y),_=u*(g+x),I=h*(g+x),F=Math.atan2(b-A,S-T),E=Math.atan2(I-A,_-T);return{cx:T+e,cy:A+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=ta._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 y=0;y<=g;++y){const x=y+v*y,T=d+o+f*x,A=Math.cos(T),S=-Math.sin(T);l.push((p*A+m*S)*r+i,(p*-S+m*A)*r+n)}}}class $E{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,y=0,x=0,T=e,A=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,y=T-g,x=A-v,T=g,A=v,l+=Math.sqrt(y*y+x*x);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=ta._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 nv(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 Fr(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 y=1,x=d;y=0&&(r.join===cs.ROUND?d+=Fr(x,T,x-b*B,T-_*B,x-I*B,T-F*B,h,!1)+4:d+=2,h.push(x-I*N,T-F*N,x+I*B,T+F*B));continue}const q=(-b+v)*(-_+T)-(-b+x)*(-_+y),ne=(-I+A)*(-F+T)-(-I+x)*(-F+S),re=(C*ne-O*q)/Y,me=(D*q-P*ne)/Y,ve=(re-x)*(re-x)+(me-T)*(me-T),ce=x+(re-x)*B,de=T+(me-T)*B,X=x-(re-x)*N,j=T-(me-T)*N,H=Math.min(C*C+P*P,O*O+D*D),G=W?B:N,z=H+G*G*m,te=ve<=z;let he=r.join;if(he===cs.MITER&&ve/m>g&&(he=cs.BEVEL),te)switch(he){case cs.MITER:{h.push(ce,de,X,j);break}case cs.BEVEL:{W?h.push(ce,de,x+b*N,T+_*N,ce,de,x+I*N,T+F*N):h.push(x-b*B,T-_*B,X,j,x-I*B,T-F*B,X,j),d+=2;break}case cs.ROUND:{W?(h.push(ce,de,x+b*N,T+_*N),d+=Fr(x,T,x+b*N,T+_*N,x+I*N,T+F*N,h,!0)+4,h.push(ce,de,x+I*N,T+F*N)):(h.push(x-b*B,T-_*B,X,j),d+=Fr(x,T,x-b*B,T-_*B,x-I*B,T-F*B,h,!1)+4,h.push(x-I*B,T-F*B,X,j));break}}else{switch(h.push(x-b*B,T-_*B,x+b*N,T+_*N),he){case cs.MITER:{W?h.push(X,j,X,j):h.push(ce,de,ce,de),d+=2;break}case cs.ROUND:{W?d+=Fr(x,T,x+b*N,T+_*N,x+I*N,T+F*N,h,!0)+2:d+=Fr(x,T,x-b*B,T-_*B,x-I*B,T-F*B,h,!1)+2;break}}h.push(x-I*B,T-F*B,x+I*N,T+F*N),d+=2}}v=i[(u-2)*2],y=i[(u-2)*2+1],x=i[(u-1)*2],T=i[(u-1)*2+1],b=-(y-T),_=v-x,E=Math.sqrt(b*b+_*_),b/=E,_/=E,b*=p,_*=p,h.push(x-b*B,T-_*B,x+b*N,T+_*N),c||(r.cap===hr.ROUND?d+=Fr(x-b*(B-N)*.5,T-_*(B-N)*.5,x-b*B,T-_*B,x+b*N,T+_*N,h,!1)+2:r.cap===hr.SQUARE&&(d+=nv(x,T,b,_,B,N,!1,h)));const $=e.indices,L=ta.epsilon*ta.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 eo,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new eo,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=sv.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 rt(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 eo(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===Mi.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=$y(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=Mt.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}}Vb.extension={name:"particle",type:Re.RendererPlugin};Ue.add(Vb);var su=(s=>(s[s.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",s[s.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",s))(su||{});const Ql={willReadFrequently:!0},Vs=class Xe{static get experimentalLetterSpacingSupported(){let e=Xe._experimentalLetterSpacingSupported;if(e!==void 0){const t=ke.ADAPTER.getCanvasRenderingContext2D().prototype;e=Xe._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=Xe._canvas){i=i??t.wordWrap;const r=t.toFontString(),o=Xe.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?Xe.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+=(Xe.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=Xe._canvas){const n=i.getContext("2d",Ql);let r=0,o="",a="";const c=Object.create(null),{letterSpacing:l,whiteSpace:h}=t,u=Xe.collapseSpaces(h),d=Xe.collapseNewlines(h);let f=!u;const p=t.wordWrapWidth+l,m=Xe.tokenize(e);for(let g=0;gp)if(o!==""&&(a+=Xe.addLine(o),o="",r=0),Xe.canBreakWords(v,t.breakWords)){const x=Xe.wordWrapSplit(v);for(let T=0;Tp&&(a+=Xe.addLine(o),f=!1,o="",r=0),o+=A,r+=_}}else{o.length>0&&(a+=Xe.addLine(o),o="",r=0);const x=g===m.length-1;a+=Xe.addLine(v,!x),f=!1,o="",r=0}else y+r>p&&(f=!1,a+=Xe.addLine(o),o="",r=0),(o.length>0||!Xe.isBreakingSpace(v)||f)&&(o+=v,r+=y)}return a+=Xe.addLine(o,!1),a}static addLine(e,t=!0){return e=Xe.trimRight(e),e=t?`${e} -`:e,e}static getFromCache(e,t,i,n){let r=i[e];return typeof r!="number"&&(r=Xe._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(!Xe.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:Xe._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:Xe._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]})(),Vs.experimentalLetterSpacing=!1,Vs._fonts={},Vs._newlines=[10,13],Vs._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let tr=Vs;const KE=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Yb=class La{constructor(e){this.styleID=0,this.reset(),Yd(this,e,e)}clone(){const e={};return Yd(e,this,La.defaultStyle),new La(e)}reset(){Yd(this,La.defaultStyle,La.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){ZE(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)&&!KE.includes(n)&&(n=`"${n}"`),t[i]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};Yb.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 xr=Yb;function Vd(s){const e=Mt.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 ZE(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,y=i.lineHeight*(f+1);let x=v;f+10}}function eI(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(rI),this.registerFindHook(oI),this.registerFindHook(eI),this.registerFindHook(tI),this.registerFindHook(iI),this.registerUploadHook(sI),this.registerUploadHook(nI)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,Vi.system.addOnce(this.tick,this,oo.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&&Vi.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}};Hb.uploadsPerFrame=4;let Zf=Hb;Object.defineProperties(ke,{UPLOADS_PER_FRAME:{get(){return Zf.uploadsPerFrame},set(s){ht("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),Zf.uploadsPerFrame=s}}});function Wb(s,e){return e instanceof Je?(e._glTextures[s.CONTEXT_UID]||s.texture.bind(e),!0):!1}function aI(s,e){if(!(e instanceof Li))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:i}=t;for(let n=0;n1?ks.from(hI,cI,t):ks.from(cv,uI,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=Mt.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=$y(e.blendMode,l),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}qb.extension={name:"tilingSprite",type:Re.RendererPlugin};Ue.add(qb);const Kb=class Da{constructor(e,t,i){this.linkedSheets=[],(e instanceof Je||e instanceof We)&&(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 We?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=Xn(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<=Da.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=Da.BATCH_SIZE;for(;t-e{this._batchIndex*Da.BATCH_SIZE{i[n]=e}),Object.keys(e.textures).forEach(n=>{i[`${e.cachePrefix}${n}`]=e.textures[n]}),!t){const n=Qt.dirname(s[0]);e.linkedSheets.forEach((r,o)=>{Object.assign(i,Zb([`${n}/${e.data.meta.related_multi_packs[o]}`],r,!0))})}return i}const mI={extension:Re.Asset,cache:{test:s=>s instanceof hv,getCacheableAssets:(s,e)=>Zb(s,e,!1)},resolver:{test:s=>{const e=s.split("?")[0].split("."),t=e.pop(),i=e.pop();return t==="json"&&fI.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:Re.LoadParser,priority:ns.Normal},async testParse(s,e){return Qt.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=Qt.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 hv({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)}}};Ue.add(mI);class rh{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Mc{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=[Mc,Jf,Qf];function pI(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,y=null,m=0,p=0,x=0;continue}if(x=Math.max(F+_.fontProperties.descent,x),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+=x*o,m=Math.ceil(m),p=0,x=0;continue}vI(g,v,_,p,m,o,u);const k=_c(_.text);f.char.push({id:k,page:T.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 0.99) {\r - alpha = 1.0;\r - }\r -\r - // Gamma correction for coverage-like alpha\r - float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r - float gamma = mix(1.0, 1.0 / 2.2, luma);\r - float coverage = pow(uColor.a * alpha, gamma); \r -\r - // NPM Textures, NPM outputs\r - gl_FragColor = vec4(uColor.rgb, coverage);\r -}\r -`,bI=`// Mesh material default fragment\r -attribute vec2 aVertexPosition;\r -attribute vec2 aTextureCoord;\r -\r -uniform mat3 projectionMatrix;\r -uniform mat3 translationMatrix;\r -uniform mat3 uTextureMatrix;\r -\r -varying vec2 vTextureCoord;\r -\r -void main(void)\r -{\r - gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r -\r - vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r -}\r -`;const uv=[],dv=[],fv=[],wI=class Qb extends _i{constructor(e,t={}){super();const{align:i,tint:n,maxWidth:r,letterSpacing:o,fontName:a,fontSize:c}=Object.assign({},Qb.styleDefaults,t);if(!Jn.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new Mt(n),this._font=void 0,this._fontName=a,this._fontSize=c,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new In(()=>{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=Jn.available[this._fontName],t=this.fontSize,i=t/e.size,n=new gt,r=[],o=[],a=[],c=this._text.replace(/(?:\r\n|\r)/g,` -`)||" ",l=Jb(c),h=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?uv:dv;let d=null,f=0,p=0,m=0,g=-1,v=0,y=0,x=0,T=0;for(let k=0;k0&&n.x>h&&(++y,Go(r,1+g-y,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,T=0)}const A=l[l.length-1];A!=="\r"&&A!==` -`&&(/(?:\s)/.test(A)&&(f=v),o.push(f),p=Math.max(p,f),a.push(-1));const S=[];for(let k=0;k<=m;k++){let B=0;this._align==="right"?B=p-o[k]:this._align==="center"?B=(p-o[k])/2:this._align==="justify"&&(B=a[k]<0?0:(p-o[k])/a[k]),S.push(B)}const b=r.length,_={},I=[],F=this._activePagesMeshData;u.push(...F);for(let k=0;k6*N)||B.vertices.lengtht[n.mesh.texture.baseTexture.uid]).forEach(n=>{n.mesh.texture=We.EMPTY});for(const n in t)t[n].destroy(),delete t[n];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};wI.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const SI=[".xml",".fnt"],TI={extension:{type:Re.LoadParser,priority:ns.Normal},name:"loadBitmapFont",test(s){return SI.includes(Qt.extname(s).toLowerCase())},async testParse(s){return Mc.test(s)||Qf.test(s)},async parse(s,e,t){const i=Mc.test(s)?Mc.parse(s):Qf.parse(s),{src:n}=e,{page:r}=i,o=[];for(let l=0;la[l]);return Jn.install(i,c,!0)},async load(s,e){return(await ke.ADAPTER.fetch(s)).text()},unload(s){s.destroy()}};Ue.add(TI);const em=class ko extends xr{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new ko(Object.keys(ko.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 ko.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:i}=ko;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:Qt.basename(e,Qt.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 { - font-family: "${t.family}"; - src: url('${t.dataSrc}'); - 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=fC(e)),typeof e=="number"?dC(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,ko.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 Fo extends Sr{constructor(e="",t={}){super(We.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=We.from(i,{scaleMode:ke.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new rt,n.trim=new rt,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=Fo.defaultMaxWidth,this.maxHeight=Fo.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=Fo.defaultAutoResolution,this._resolution=Fo.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 e1(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 MI(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 mv(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 _I(s,e){const{innerW:t,innerH:i,outerW:n,outerH:r}=e1(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 mt?0:s==="linear"?1-e/t:s==="inverse"?Math.min(10,t/Math.max(e,t*.1)):1}function RI(s,e,t,i,n,r,o){const a=s-t,c=e-i,l=Math.hypot(a,c);if(l<=1e-4||l>r)return{x:0,y:0};const h=n*t1(o,l,r)*10;return{x:-c/l*h,y:a/l*h}}function PI(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,h=(n*c+r*l)/o,u=(-r*c+n*l)/a,d=(S,b,_,I)=>{const F=_/o,E=I/a,k=Math.max(1e-4,Math.hypot(F,E)),B=F/k,N=E/k,$=n*B-r*N,L=r*B+n*N;return{x:s.x+n*S*o-r*b*a+$*.05,y:s.y+r*S*o+n*b*a+L*.05,nx:$,ny:L}};if(s.shape==="circle"){const S=Math.max(.001,s.radius),b=Math.hypot(h,u);if(b>=S)return null;const _=b>1e-4?h/b:1,I=b>1e-4?u/b:0;return d(_*S,I*S,_,I)}if(s.shape==="ellipse"){const S=Math.max(.001,s.radiusX),b=Math.max(.001,s.radiusY),_=Math.hypot(h/S,u/b);if(_>=1)return null;const I=_>1e-4?1/_:1,F=_>1e-4?h*I:S,E=_>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 _=S-Math.abs(h),I=b-Math.abs(u);if(_=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 _=Math.PI*.5+b/f*Math.PI*2;return{x:Math.cos(_)*p,y:Math.sin(_)*m}});let v=!1;for(let S=0,b=g.length-1;Su!=I.y>u&&h<(I.x-_.x)*(u-_.y)/(I.y-_.y)+_.x&&(v=!v)}if(!v)return null;let y=g[0].x,x=g[0].y,T=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 To(s,e,t,i,n){return s==="fixed"?e:s==="curve"?wi(e,t,en(i,n)):wi(e,t,n)}function jd(s,e,t,i,n,r){return s==="curve"?wi(e,t,en(i,n)):s==="random"?r:e}function vv(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 en(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 wi(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;vv(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 qo(s){let e=s.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function FI(s,e,t){const i=xv(s),n=xv(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 qo(t[0].color);if(e>=t[t.length-1].position)return qo(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 FI(n.color,r.color,o)}return qo(t[t.length-1].color)}function xv(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 OI(){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 BI{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)||We.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:wi(p.x,m.x,v),y:wi(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,en(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"?en(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):qo((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 LI(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 UI(s,e){const t=s.trailResources.filter(r=>r.texture);if(!t.length)return s.trailResources[0]||DI();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 yv(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 ul(){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",showShape:!0,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",showForceFieldShape:!0,vortex:!1,vortexStrength:10,vortexRadius:100,vortexCenterX:0,vortexCenterY:0,vortexFalloff:"linear",showVortexShape:!0,attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",showAttractionShape:!0,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 yr(s){var F;const e=ul(),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,y=Number(t.forceStrength),x=t.trailConfigVersion!==3,T=!Array.isArray(t.trailResources),A=t.trailResourceVersion!==6,S=t.trailTexture,b=String(t.trailTextureName||"trail"),_=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(B=>typeof B=="object"&&B!==null?{...B}:B):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=ul().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(ur,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,B)=>{k.weight=B===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(y)&&y!==0?y:10),x&&(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),(T||!s.trailResources.length)&&(s.trailResources=[{id:1,texture:S||null,textureName:b,previewUrl:_,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(ur,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),A)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 $I extends _i{constructor(t,i=EI){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 Li);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=yr(t),this.trail=new BI(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 C=Math.max(1e-4,Math.abs(n.rootScaleX)),P=Math.max(1e-4,Math.abs(n.rootScaleY)),O=-(((c=this.simulationTransform)==null?void 0:c.rotation)??n.rootRotation)*Math.PI/180,D=Math.cos(O),V=Math.sin(O),Y=((l=this.simulationTransform)==null?void 0:l.centerX)??n.centerX,W=((h=this.simulationTransform)==null?void 0:h.centerY)??n.centerY,q=Y+D*C*m.x-V*P*m.y,ne=-W+V*C*m.x+D*P*m.y,re=q,me=-ne,ve=n.forceCenterX-re,ce=n.forceCenterY-me,de=Math.hypot(ve,ce);if(de>1e-4&&de<=n.forceRadius){const X=t1(n.forceFalloff,de,n.forceRadius),j=n.forceStrength*X*10,H=ve/de*j,G=ce/de*j,z=H,te=-G;m.vx+=(D*z+V*te)/C*t,m.vy+=(-V*z+D*te)/P*t}}if(!m.collisionPaused&&n.vortex&&n.vortexStrength!==0&&n.vortexRadius>0){const C=Or(n,m.x,m.y,this.simulationTransform),P=RI(C.x,C.y,n.vortexCenterX,n.vortexCenterY,n.vortexStrength,n.vortexRadius,n.vortexFalloff),O=gv(n,P.x,P.y,this.simulationTransform);m.vx+=O.x*t,m.vy+=O.y*t}if(!m.collisionPaused&&n.damping>0){const C=Math.max(0,1-n.damping*t);m.vx*=C,m.vy*=C}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 C=m.maxLife-m.life;if(n.attractionDelayMode==="particle"?C>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const O=Or(n,m.x,m.y,this.simulationTransform),D=n.attractionCenterX,V=n.attractionCenterY,Y=Math.max(0,n.attractionRadius);if(!m.attractionActive){if(Math.hypot(D-O.x,V-O.y)<=Y){this.kill(p);continue}m.attractionActive=!0,m.attractionElapsed=0,m.attractionStartWorldX=O.x,m.attractionStartWorldY=O.y}m.attractionElapsed+=t;const W=Math.max(1e-4,n.attractionDuration),q=Math.min(1,m.attractionElapsed/W);let ne=wi(m.attractionStartWorldX,D,q),re=wi(m.attractionStartWorldY,V,q);if(n.attractionPath==="curve"){const ce=D-m.attractionStartWorldX,de=V-m.attractionStartWorldY,X=Math.hypot(ce,de);if(X>1e-4){const j=X*.25*m.attractionCurveSide,H=(m.attractionStartWorldX+D)*.5-de/X*j,G=(m.attractionStartWorldY+V)*.5+ce/X*j,z=1-q;ne=z*z*m.attractionStartWorldX+2*z*q*H+q*q*D,re=z*z*m.attractionStartWorldY+2*z*q*G+q*q*V}}const me=Math.hypot(D-ne,V-re);if(q>=1||me<=Y){this.kill(p);continue}const ve=pv(n,ne,re,this.simulationTransform);m.x=ve.x,m.y=ve.y,m.vx=0,m.vy=0}}const v=g,y=m.sprite,x=n.imageResources.find(C=>C.id===m.resourceId);if(x){const C=yv(x,m.maxLife-m.life);m.imageFrameIndex=C.index,y.texture=zd(x,n.texture,m.imageFrameIndex),y.visible=C.visible}if(n.speedOverLifeEnabled){const C=ic(jd(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,v,m.speedScaleTarget),1),P=m.speedScale===0?C:C/m.speedScale;m.vx*=P,m.vy*=P,m.speedScale=C}let T=m.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(T=wi(n.rotationSpeedMin,n.rotationSpeedMax,en(n.rotationOverLifeCurve,v))),m.rotation+=T*t;let A=m.x,S=m.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const C=m.maxLife-m.life,P=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,O=C*Math.max(0,n.noiseSpeed)*Math.PI*2;A+=(Math.sin(m.noisePhaseX+O)-Math.sin(m.noisePhaseX))*P,S+=(Math.sin(m.noisePhaseY+O*.83)-Math.sin(m.noisePhaseY))*P}y.x=A,y.y=S,y.rotation=-m.rotation*Math.PI/180;let b=1,_=1;n.scaleOverLifeEnabled&&(b=jd(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,v,m.scaleOverLifeX),_=n.scaleOverLifeAxisMode==="separate"?jd(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,v,m.scaleOverLifeY):b),y.scale.set(ic(m.scaleStartX*b,1),ic(m.scaleStartY*_,1));const I=n.alphaMode==="curve"?en(n.alphaCurve,v,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;y.alpha=ic((x==null?void 0:x.independentAlpha)==="fixed"?x.alpha:(x==null?void 0:x.independentAlpha)==="curve"?en(x.alphaCurve,v,this.resolveCurveMode(x.alphaCurveMode)):I,1);const F=(x==null?void 0:x.colorStart)||"#ffffff",E=(x==null?void 0:x.colorMode)==="lifetime"?tm(x.colorGradient,v):(x==null?void 0:x.colorMode)==="random"?m.colorSample:qo(F);y.tint=E,y.blendMode=ur[(x==null?void 0:x.blend)||"normal"];const k=this.trail.update(m.trail,n,m.boneName,A,S,v,y),B=Or(n,A,S,this.simulationTransform),N=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,$=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleX)??n.rootScaleX),L=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleY)??n.rootScaleY),U=k?{...k,bones:k.bones.map(C=>{const P=Or(n,C.x,C.y,this.simulationTransform);return{...C,worldX:P.x,worldY:P.y,worldRotation:N-C.rotation}})}:void 0;a.push({boneName:m.boneName,spawnId:m.spawnId,x:A,y:S,rotation:m.rotation,scaleX:y.scale.x,scaleY:y.scale.y,worldX:B.x,worldY:B.y,worldRotation:N+m.rotation,worldScaleX:y.scale.x*$,worldScaleY:y.scale.y*L,alpha:y.alpha,colorHex:E,resourceId:m.resourceId,imageFrameIndex:m.imageFrameIndex,imageVisible:y.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=MI(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=CI(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(T=>!T.active);if(i===-1)return;const n=this.spawnOrigin(),{x:r,y:o}=n,a=To(t.lifeMode,t.lifeMin,t.lifeMax,t.lifeCurve,this.rng()),c=To(t.speedMode,t.speedMin,t.speedMax,t.speedCurve,this.rng()),l=AI(t,n,this.followSpawnAngle,this.rng),h=this.pool[i],u=NI(t,this.rng),d=this._spawnSerial++;h.spawnId=d;const f=UI(t,Br(t.seed,d,1540483477));h.noisePhaseX=Br(t.seed,d,1757159915)*Math.PI*2,h.noisePhaseY=Br(t.seed,d,48610963)*Math.PI*2,h.gravityStrength=t.useGravity&&t.gravityMode==="random"?wi(t.gravityMin,t.gravityMax,this.rng()):t.gravityMin,h.windStrength=t.wind&&t.windMode==="random"?wi(t.windMin,t.windMax,this.rng()):t.windMin,h.attractionActive=!1,h.attractionElapsed=0,h.collisionPaused=!1,h.attractionCurveSide=Br(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=Br(t.seed,d,668265261)*100,y=(T,A,S,b,_)=>{if(T!=="random")return Math.max(0,Number(A)||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 wi(I,F,Br(t.seed,d,_))};h.trail.sampledLength=y(f.lengthMode,f.length,f.lengthMin,f.lengthMax,374761393),h.trail.sampledWidth=y(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=To(t.scaleMode,t.scaleMin,t.scaleMax,t.scaleCurve,this.rng())*u.scale,h.scaleStartY=t.scaleAxisMode==="separate"?To(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:To(t.initialRotationMode,t.initialRotationMin,t.initialRotationMax,t.initialRotationCurve,this.rng()),h.rotationSpeed=t.rotationOverLifeEnabled?To(t.rotationOverLifeMode,t.rotationSpeedMin,t.rotationSpeedMax,t.rotationOverLifeCurve,this.rng()):0,h.speedScale=1,h.speedScaleTarget=t.speedOverLifeMode==="random"?wi(t.speedOverLifeMin,t.speedOverLifeMax,this.rng()):t.speedOverLifeMin,h.scaleOverLifeX=t.scaleOverLifeMode==="random"?wi(t.scaleOverLifeMin,t.scaleOverLifeMax,this.rng()):t.scaleOverLifeMin,h.scaleOverLifeY=t.scaleOverLifeMode==="random"?wi(t.scaleYOverLifeMin,t.scaleYOverLifeMax,this.rng()):t.scaleYOverLifeMin,h.resourceId=u.id,h.colorSample=u.colorMode==="random"?tm(u.colorGradient,Br(t.seed,d,2654435769)):qo(u.colorStart);const x=yv(u,0);h.imageFrameIndex=x.index,h.sprite.texture=zd(u,t.texture,x.index),h.sprite.anchor.set(u.anchorX,u.anchorY),h.sprite.blendMode=ur[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=Or(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=Or(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=ur[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 ao=new Map,io=new Map;function XI(s){return[...ao.values()].some(e=>e===s)}function i1(s){if(!(XI(s)||(io.get(s)||0)>0)){io.delete(s);for(const e of s.textures)e.destroy(!0)}}function VI(s){const e=io.get(s)||0;e>1?io.set(s,e-1):io.delete(s),i1(s)}function YI(s){return ao.get(s)||null}function nu(s,e){Tl(s),ao.set(s,e)}function GI(s){const e=ao.get(s);return e?(io.set(e,(io.get(e)||0)+1),e):null}function HI(s,e){const t=ao.get(s);return t?(nu(e,t),!0):!1}function Tl(s){const e=ao.get(s);e&&(ao.delete(s),i1(e))}function Xt(s){if(Array.isArray(s))return s.map(e=>Xt(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]=Xt(n);return t}}return s}const s1=["3.8","4.0","4.1","4.2","4.3"];function ah(s){const e=String(s||"").trim();return s1.find(t=>e===t||e.startsWith(`${t}.`))||null}function im(){return s1.join(" / ")}function jI(s){return s==="4.3"?"4.3":"4.2"}function ap(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"bezier",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function n1(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 r1(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 dr(s,e=30){const t=Ac(s.loopDurationFrames),i=r1(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 lp(s,e){const t=dr(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}}const WI=.001;function zI(s,e){const t=Math.max(1,Number(e)||30),n=Math.max(0,Number(s)||0)*t+WI*t;return Math.max(0,Math.floor(n))}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 qI(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 fo=l_("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=ul();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=Xt(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=Xt(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=Xt(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=Xt(e);return t.id=oc++,t.name=ac(e.name,this.spines.map(i=>i.name)),t.selectedBone="",HI(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=yr(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){Tl(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)+dr(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,zI(e,s)+1);this.timeline.totalFrames=i;const n=qI({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}}}),o1="SpineParticle.SystemSettings",a1=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 KI(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 ZI(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!==o1)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==a1)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function QI(s,e){Object.assign(s.settings,ZI(e,s.settings))}let lc=null;function eR(s){lc==null||lc();try{const e=localStorage.getItem(qd);e&&QI(s,JI(e).settings)}catch{try{localStorage.removeItem(qd)}catch{}}lc=Yi(()=>KI(s.settings),e=>{const t={format:o1,version:a1,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(qd,JSON.stringify(t))}catch{}},{deep:!0})}function tR(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 iR(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=tR(50/d),p=l,m=h,g=Math.max(1,o.tickWidth);if(o.tickEnabled){for(let b=0;b<=l;b+=f){const _=Math.round(b/f)*f;_!==0&&(r.lineStyle(g,u,.25),r.moveTo(_,c-4),r.lineTo(_,c+4),r.moveTo(-_,c-4),r.lineTo(-_,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,y=e.screen.height*.5+s.editor.viewY,x=o.axisFontSize,T=+("0x"+o.axisColor.replace("#",""));for(;n.length<64;){const b=new op("",{fontFamily:"monospace",fontSize:x,fill:T});b.anchor.set(.5,.5),i.addChild(b),n.push(b)}let A=0;const S=o.showAxisLabels&&o.tickEnabled;for(let b=0;b<=l;b+=f){const _=Math.round(b/f)*f;if(_===0||!S||_>p)continue;const I=n[A++];if(!I)break;I.style.fontSize=x,I.text=String(_),I.position.set(v+_*d,y+9),I.visible=!0;const F=n[A++];if(!F)break;F.style.fontSize=x,F.text=String(-_),F.position.set(v-_*d,y+9),F.visible=!0}for(let b=0;b<=h;b+=f){const _=Math.round(b/f)*f;if(_===0||!S||_>m)continue;const I=n[A++];if(!I)break;I.style.fontSize=x,I.text=String(_),I.position.set(v+8,y-b*d),I.visible=!0;const F=n[A++];if(!F)break;F.style.fontSize=x,F.text=String(-_),F.position.set(v+8,y+b*d),F.visible=!0}for(;Ay.id===s.activeId);if(!n||n.visible===!1)return;const r=n.config;if(!r.showShape)return;const 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=(y,x)=>{const T=y+m,A=-x-g,S=T*h,b=A*u;return[a+S*f-b*p,c+(S*p+b*f)]};if(l==="circle"){const y=oh(r.innerRadius,r.outerRadius);i.lineStyle(2,3991658,.7);const x=48;for(const T of[y.outer,y.inner])if(!(T<=0))for(let A=0;A<=x;A++){const S=A/x*Math.PI*2,[b,_]=v(Math.cos(S)*T,Math.sin(S)*T);A===0?i.moveTo(b,_):i.lineTo(b,_)}}else if(l==="rect"){const y=e1(r);i.lineStyle(2,4885759,.7);for(const[x,T]of[[y.outerW,y.outerH],[y.innerW,y.innerH]]){if(x<=0||T<=0)continue;const A=x/2,S=T/2,b=v(-A,-S),_=v(A,-S),I=v(A,S),F=v(-A,S);i.moveTo(b[0],b[1]),i.lineTo(_[0],_[1]),i.lineTo(I[0],I[1]),i.lineTo(F[0],F[1]),i.lineTo(b[0],b[1])}}else if(l==="cone"){const y=oh(r.innerRadius,r.outerRadius),x=r.coneAngle/2*Math.PI/180,T=r.coneDirection*Math.PI/180,A=v(Math.cos(T-x)*y.inner,Math.sin(T-x)*y.inner),S=v(Math.cos(T+x)*y.inner,Math.sin(T+x)*y.inner),b=v(Math.cos(T-x)*y.outer,Math.sin(T-x)*y.outer),_=v(Math.cos(T+x)*y.outer,Math.sin(T+x)*y.outer);i.lineStyle(2,3991658,.7),i.moveTo(A[0],A[1]),i.lineTo(b[0],b[1]),i.moveTo(S[0],S[1]),i.lineTo(_[0],_[1]),i.lineStyle(1,3991658,.5);const I=24;for(const F of[y.outer,y.inner])if(!(F<=0))for(let E=0;E<=I;E++){const k=T-x+2*x*E/I,[B,N]=v(Math.cos(k)*F,Math.sin(k)*F);E===0?i.moveTo(B,N):i.lineTo(B,N)}}}function rR(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.showForceFieldShape||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 oR(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(u=>u.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.vortex)||!n.showVortexShape||n.vortexRadius<=0)return;const r=n.vortexCenterX,o=-n.vortexCenterY,a=n.vortexStrength>=0?12156159:16753228;t.lineStyle(2,a,.9),t.beginFill(a,.07),t.drawCircle(r,o,n.vortexRadius),t.endFill(),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill();const c=r+Math.min(n.vortexRadius*.65,50),l=n.vortexStrength>=0?-1:1,h=o+l*14;t.lineStyle(2,a,.9),t.moveTo(c,o+l*-8),t.lineTo(c,h),t.moveTo(c,h),t.lineTo(c-4,h-l*5),t.moveTo(c,h),t.lineTo(c+4,h-l*5)}function aR(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)||!n.showAttractionShape)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 lR(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 Mo(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 l1(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 hR(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,y=-g*c;return[r+v*h-y*u,o+(v*u+y*h)]},f=(m,g,v,y)=>{const x=d(m,g),T=d(v,y);i.moveTo(x[0],x[1]),i.lineTo(T[0],T[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 y=0;y<=m;y++){const x=y/m*Math.PI*2,[T,A]=d(Math.cos(x)*p,Math.sin(x)*p);y===0?i.moveTo(T,A):i.lineTo(T,A)}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,y])=>d(v,y));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 uR(s,e=16777215){const t=Number.parseInt(s.replace("#",""),16);return Number.isFinite(t)?t:e}function dR(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,y)=>{const x=y/48*Math.PI*2;return d(Math.cos(x)*m,Math.sin(x)*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 y=Math.PI*.5+v%m/m*Math.PI*2;return d(Math.cos(y)*n.width*.5,Math.sin(y)*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;mo.id===s.activeObjectId):null,r=(n==null?void 0:n.config.shape)==="path"&&!n.config.showShape?n.config.spawnPathId:0;for(const o of s.paths){if(o.id===r||o.visible===!1||!o.enabled||!o.points.length)continue;const a=s.activeObjectType==="path"&&s.activeObjectId===o.id,c=uR(o.color,16749374),l=(f,p)=>{const m=lR(o,f,p);return{x:m.x,y:-m.y}},h=o.points[0],u=l(h.x,h.y);i.lineStyle(a?2.5:1.8,c,a?1:.75),i.moveTo(u.x,u.y);const d=o.closed?o.points.length:o.points.length-1;for(let f=0;f{const m=l(f.x,f.y),g=l(f.x+f.inX,f.y+f.inY),v=l(f.x+f.outX,f.y+f.outY),y=Math.hypot(f.inX,f.inY)>.01,x=Math.hypot(f.outX,f.outY)>.01;i.lineStyle(1,11121867,.65),y&&(i.moveTo(m.x,m.y),i.lineTo(g.x,g.y)),x&&(i.moveTo(m.x,m.y),i.lineTo(v.x,v.y)),y&&(i.beginFill(14015724,.95),i.drawCircle(g.x,g.y,3),i.endFill()),x&&(i.beginFill(14015724,.95),i.drawCircle(v.x,v.y,3),i.endFill()),i.beginFill(e.has(p)?16777215:c,1),i.lineStyle(1.5,e.has(p)?6126847:16777215,.95),i.drawCircle(m.x,m.y,e.has(p)?5:4),i.endFill()})}}function mR(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 wv(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 pR(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);wv(i,d.x,d.y,m,g,h,u,15684432),wv(i,d.x,d.y,g,-m,h,u,5622123),i.beginFill(f,.9),i.drawCircle(d.x,d.y,l),i.endFill()}}function Ii(s){return s.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function gR(s){const e=new Map;for(const i of s)for(const n of i)e.has(n.boneName)||e.set(n.boneName,Ii([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||{...Ii([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function vR(s){s.length<2||(s[s.length-1]=Ii(s[0]))}function xR(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(Ii(s[r]||[]))}return i}function Kd(s){return`${s.boneName}:${s.spawnId??"legacy"}`}function Sv(s){return{...Ii([s])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function yR(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 Ii([u])[0];const d=(f=o.get(Kd(u)))==null?void 0:f.get(h);return d?Ii([d])[0]:Sv(u)}))}return c[0]=c[0].map(Sv),c[c.length-1]=Ii(e),c}function Tv(s,e){const t=s.length?1:0;for(let i=t;i{const x=y?[[]]:[];e.reset();for(let T=0;T0&&e.restartEmissionCycle();for(let A=0;A0;T++)e.update(r,"off"),y.push(e.capture());(v=y[y.length-1])!=null&&v.length&&y.push([]),Tv(u,xR(y,a.end))}const g=Ii(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=YI(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 _i,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,y=o.position.y+u*r.worldX+d*r.worldY;return{x:v,y:-y,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 c1=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 Ei){return t.setFromString(e)}},w(Ei,"WHITE",new Ei(1,1,1,1)),w(Ei,"RED",new Ei(1,0,0,1)),w(Ei,"GREEN",new Ei(0,1,0,1)),w(Ei,"BLUE",new Ei(0,0,1,1)),w(Ei,"MAGENTA",new Ei(1,0,1,1)),Ei);var Jt;let Ae=(Jt=class{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*Jt.degRad)}static sinDeg(e){return Math.sin(e*Jt.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Jt.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 Jt.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(Jt,"PI",3.1415927),w(Jt,"PI2",Jt.PI*2),w(Jt,"invPI2",1/Jt.PI2),w(Jt,"radiansToDegrees",180/Jt.PI),w(Jt,"radDeg",Jt.radiansToDegrees),w(Jt,"degreesToRadians",Jt.PI/180),w(Jt,"degRad",Jt.degreesToRadians),Jt);var _s;let Ie=(_s=class{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:_s.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,y=m.a,x=m.b,T=m.c,A=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 Fn._nextID++}},w(Fn,"_nextID",0),Fn);var Si;(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"})(Si||(Si={}));const d1=[Si.hold,Si.once,Si.loop,Si.pingpong,Si.onceReverse,Si.loopReverse,Si.pingpongReverse];let cp=class{constructor(e,t,i){w(this,"name");w(this,"timelines",[]);w(this,"timelineIds",new c1);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}},dn=class extends Vt{constructor(t,i,n){super(t,n);w(this,"curves");this.curves=Ie.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=Ie.newFloatArray(i);Ie.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,y=((c-h)*3-o+d)*.006,x=m*2+v,T=g*2+y,A=(a-r)*.3+m+v*.16666667,S=(c-o)*.3+g+y*.16666667,b=r+A,_=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 dn{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 y=(n-v)/(h[m+4]-v);d+=(h[m+4+1]-d)*y,f+=(h[m+4+2]-f)*y,p+=(h[m+4+3]-p)*y;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}}},_1=class extends Os{constructor(t,i,n){super(t,i,ot.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(A){case 0:let S=h[T];f=h[T+1],p=h[T+2],m=h[T+3],g=h[T+4],v=h[T+5],y=h[T+6],x=h[T+7];let b=(n-S)/(h[T+8]-S);f+=(h[T+8+1]-f)*b,p+=(h[T+8+2]-p)*b,m+=(h[T+8+3]-m)*b,g+=(h[T+8+4]-g)*b,v+=(h[T+8+5]-v)*b,y+=(h[T+8+6]-y)*b,x+=(h[T+8+7]-x)*b;break;case 1:f=h[T+1],p=h[T+2],m=h[T+3],g=h[T+4],v=h[T+5],y=h[T+6],x=h[T+7];break;default:f=this.getBezierValue(n,T,1,A-2),p=this.getBezierValue(n,T,2,A+18-2),m=this.getBezierValue(n,T,3,A+36-2),g=this.getBezierValue(n,T,4,A+54-2),v=this.getBezierValue(n,T,5,A+72-2),y=this.getBezierValue(n,T,6,A+90-2),x=this.getBezierValue(n,T,7,A+108-2)}if(o==1)u.set(f,p,m,g),d.r=v,d.g=y,d.b=x;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+=(y-d.g)*o,d.b+=(x-d.b)*o}}},A1=class extends dn{constructor(t,i,n){super(t,i,[ot.rgb+"|"+n,ot.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 Yn)||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 T=d[p.length-1];if(o==1)if(a==ge.add){let A=h;if(A.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(zr,"propertyIds",[""+ot.event]),zr);var qr;let Ga=(qr=class extends Vt{constructor(t){super(t,qr.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==ki.mixOut){a==ge.setup&&Ie.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}},mo=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)))}},O1=class extends mo{constructor(e,t,i){super(e,t,i,ot.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},B1=class extends mo{constructor(e,t,i){super(e,t,i,ot.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},L1=class extends mo{constructor(e,t,i){super(e,t,i,ot.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},D1=class extends mo{constructor(e,t,i){super(e,t,i,ot.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}},N1=class extends mo{constructor(e,t,i){super(e,t,i,ot.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},U1=class extends mo{constructor(e,t,i){super(e,t,i,ot.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},$1=class extends mo{constructor(e,t,i){super(e,t,i,ot.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}};var Kr;let X1=(Kr=class extends Vt{constructor(t,i){super(t,Kr.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[Vt.search1(h,i)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},w(Kr,"propertyIds",[ot.physicsConstraintReset.toString()]),Kr);var Di;let V1=(Di=class extends Vt{constructor(t,i,n){super(t,[ot.sequence+"|"+i+"|"+n.sequence.id]);w(this,"slotIndex");w(this,"attachment");this.slotIndex=i,this.attachment=n}getFrameEntries(){return Di.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,i,n,r,o){let a=this.frames;t*=Di.ENTRIES,a[t]=i,a[t+Di.MODE]=n|r<<4,a[t+Di.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 Yn)||h.timelineAttachment!=u))return;if(c==ki.mixOut){a==ge.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(n>4,y=this.attachment.sequence.regions.length,x=d1[m&15];if(x!=Si.hold)switch(v+=(n-p)/g+1e-5|0,x){case Si.once:v=Math.min(y-1,v);break;case Si.loop:v%=y;break;case Si.pingpong:{let T=(y<<1)-2;v=T==0?0:v%T,v>=y&&(v=T-v);break}case Si.onceReverse:v=Math.max(y-1-v,0);break;case Si.loopReverse:v=y-1-v%y;break;case Si.pingpongReverse:{let T=(y<<1)-2;v=T==0?0:(v+y-1)%T,v>=y&&(v=T-v)}}l.sequenceIndex=v}},w(Di,"ENTRIES",3),w(Di,"MODE",1),w(Di,"DELAY",2),Di);var On;let wR=(On=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 TR(this));w(this,"propertyIDs",new c1);w(this,"animationsChanged",!1);w(this,"trackEntryPool",new lh(()=>new SR));this.data=e}static emptyAnimation(){return On._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,y=p.animationLast,x=p.getAnimationTime(),T=x,A=t;p.reverse&&(T=p.animation.duration-T,A=null);let S=p.animation.timelines,b=S.length;if(d==0&&g==1||m==ge.add){d==0&&(v=!0);for(let _=0;_1&&(r=1),i!=ge.first&&(i=n.mixBlend));let o=r=n.alphaAttachmentThreshold):(a&&A instanceof Ga&&b==ge.setup&&(S=ki.mixIn),A.apply(t,d,p,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,x=m>=0;Math.abs(g)<=90&&Ae.signum(g)!=Ae.signum(p)&&(Math.abs(m-v)>180?(f+=360*Ae.signum(m),x=y):v!=0?f-=360*Ae.signum(m):x=y),x!=y&&(f+=360*Ae.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,On.emptyAnimation(),!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){let n=this.addAnimationWith(e,On.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]=MR,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(On,"_emptyAnimation",new cp("",[],0)),On),SR=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}},TR=class{constructor(e){w(this,"objects",[]);w(this,"drainDisabled",!1);w(this,"animState");this.animState=e}start(e){this.objects.push(ji.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(ji.interrupt),this.objects.push(e)}end(e){this.objects.push(ji.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(ji.dispose),this.objects.push(e)}complete(e){this.objects.push(ji.complete),this.objects.push(e)}event(e,t){this.objects.push(ji.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=Ie.enumValue(pi,i[1]),h.magFilter=Ie.enumValue(pi,i[2])},n.repeat=h=>{i[1].indexOf("x")!=-1&&(h.uWrap=Dn.Repeat),i[1].indexOf("y")!=-1&&(h.vWrap=Dn.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 W1(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 RR(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}}},RR=class{constructor(e){w(this,"name");w(this,"minFilter",pi.Nearest);w(this,"magFilter",pi.Nearest);w(this,"uWrap",Dn.ClampToEdge);w(this,"vWrap",Dn.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}},W1=class extends ER{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)}},Ml=class nm extends Yn{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 nt(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 nt(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=Ie.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 W1){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 jt;(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"})(jt||(jt={}));let Ev=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",jt.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)*Ae.degRad,v=(i+90+a)*Ae.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 jt.Normal:{const f=(i+o)*Ae.degRad,p=(i+90+a)*Ae.degRad,m=Math.cos(f)*n,g=Math.cos(p)*r,v=Math.sin(f)*n,y=Math.sin(p)*r;this.a=l*m+h*v,this.b=l*g+h*y,this.c=u*m+d*v,this.d=u*g+d*y;return}case jt.OnlyTranslation:{const f=(i+o)*Ae.degRad,p=(i+90+a)*Ae.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 jt.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)*Ae.radDeg):(l=0,u=0,g=90-Math.atan2(d,h)*Ae.radDeg);const v=(i+o-g)*Ae.degRad,y=(i+a-g+90)*Ae.degRad,x=Math.cos(v)*n,T=Math.cos(y)*r,A=Math.sin(v)*n,S=Math.sin(y)*r;this.a=l*x-h*A,this.b=l*T-h*S,this.c=u*x+d*A,this.d=u*T+d*S;break}case jt.NoScale:case jt.NoScaleOrReflection:{i*=Ae.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==jt.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 y=Math.cos(i)*v,x=Math.sin(i)*v;o*=Ae.degRad,a=(90+a)*Ae.degRad;const T=Math.cos(o)*n,A=Math.cos(a)*r,S=Math.sin(o)*n,b=Math.sin(a)*r;this.a=m*T+y*S,this.b=m*A+y*b,this.c=g*T+x*S,this.d=g*A+x*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)*Ae.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)*Ae.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==jt.OnlyTranslation)f=this.a,p=this.b,m=this.c,g=this.d;else{switch(this.inherit){case jt.NoRotationOrReflection:{let A=Math.abs(t*r-i*n)/(t*t+n*n);i=-n*this.skeleton.scaleX*A/this.skeleton.scaleY,r=t*this.skeleton.scaleY*A/this.skeleton.scaleX,o=1/(t*r-i*n),a=r*o,c=i*o;break}case jt.NoScale:case jt.NoScaleOrReflection:let v=Ae.cosDeg(this.rotation),y=Ae.sinDeg(this.rotation);t=(t*v+i*y)/this.skeleton.scaleX,n=(n*v+r*y)/this.skeleton.scaleY;let x=Math.sqrt(t*t+n*n);x>1e-5&&(x=1/x),t*=x,n*=x,x=Math.sqrt(t*t+n*n),this.inherit==jt.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(x=-x);let T=Ae.PI/2+Math.atan2(n,t);i=Math.cos(T)*x,r=Math.sin(T)*x,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)*Ae.radDeg,this.arotation=Math.atan2(m,f)*Ae.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*Ae.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*Ae.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*Ae.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=Ae.sinDeg(e),i=Ae.cosDeg(e);return Math.atan2(this.a*t-this.c*i,this.d*i-this.b*t)*Ae.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=Ae.sinDeg(e),i=Ae.cosDeg(e);return Math.atan2(i*this.c+t*this.d,i*this.a+t*this.b)*Ae.radDeg}rotateWorld(e){e*=Ae.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}},J1=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}},PR=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 jt.NoScale:case jt.NoScaleOrReflection:p=t-e.worldX,m=i-e.worldY}const y=e.data.length*g;if(y>1e-4){const x=p*p+m*m;if(n&&xy*y){const T=(Math.sqrt(x)/y-1)*a+1;g*=T,o&&(v*=T)}}}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!=jt.Normal||t.inherit!=jt.Normal)return;let h=e.ax,u=e.ay,d=e.ascaleX,f=e.ascaleY,p=d,m=f,g=t.ascaleX,v=0,y=0,x=0;d<0?(d=-d,v=180,x=-1):(v=0,x=1),f<0&&(f=-f,x=-x),g<0?(g=-g,y=180):y=0;let T=t.ax,A=0,S=0,b=0,_=e.a,I=e.b,F=e.c,E=e.d,k=Math.abs(d-f)<=1e-4;!k||o?(A=0,S=_*T+e.worldX,b=F*T+e.worldY):(A=t.ay,S=_*T+I*A+e.worldX,b=F*T+E*A+e.worldY);let B=e.parent;if(!B)throw new Error("IK parent must itself have a parent.");_=B.a,I=B.b,F=B.c,E=B.d;let N=_*E-I*F,$=S-B.worldX,L=b-B.worldY;N=Math.abs(N)<=1e-4?0:1/N;let U=($*E-L*I)*N-h,C=(L*_-$*F)*N-u,P=Math.sqrt(U*U+C*C),O=t.data.length*g,D,V;if(P<1e-4){this.apply1(e,i,n,!1,o,!1,l),t.updateWorldTransformWith(T,A,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}$=i-B.worldX,L=n-B.worldY;let Y=($*E-L*I)*N-h,W=(L*_-$*F)*N-u,q=Y*Y+W*W;if(c!=0){c*=d*(g+1)*.5;let me=Math.sqrt(q),ve=me-P-O*d+c;if(ve>0){let ce=Math.min(1,ve/(c*2))-1;ce=(ve-c*(1-ce*ce))/me,Y-=ce*Y,W-=ce*W,q=Y*Y+W*W}}e:if(k){O*=d;let me=(q-P*P-O*O)/(2*P*O);me<-1?(me=-1,V=Math.PI*r):me>1?(me=1,V=0,o&&(_=(Math.sqrt(q)/(P+O)-1)*l+1,p*=_,a&&(m*=_))):V=Math.acos(me)*r,_=P+O*me,I=O*Math.sin(V),D=Math.atan2(W*_-Y*I,Y*_+W*I)}else{_=d*O,I=f*O;let me=_*_,ve=I*I,ce=Math.atan2(W,Y);F=ve*P*P+me*q-me*ve;let de=-2*ve*P,X=ve-me;if(E=de*de-4*X*F,E>=0){let ae=Math.sqrt(E);de<0&&(ae=-ae),ae=-(de+ae)*.5;let Ee=ae/X,xe=F/ae,fe=Math.abs(Ee)=0){L=Math.sqrt(Ee)*r,D=ce-Math.atan2(L,fe),V=Math.atan2(L/f,(fe-P)/d);break e}}let j=Ae.PI,H=P-_,G=H*H,z=0,te=0,he=P+_,se=he*he,ue=0;F=-_*P/(me-ve),F>=-1&&F<=1&&(F=Math.acos(F),$=_*Math.cos(F)+P,L=I*Math.sin(F),E=$*$+L*L,Ese&&(te=F,se=E,he=$,ue=L)),q<=(G+se)*.5?(D=ce-Math.atan2(z*r,H),V=j*r):(D=ce-Math.atan2(ue*r,he),V=te*r)}let ne=Math.atan2(A,T)*x,re=e.arotation;D=(D-ne)*Ae.radDeg+v-re,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(h,u,re+D*l,p,m,0,0),re=t.arotation,V=((V+ne)*Ae.radDeg-t.ashearX)*x+y-re,V>180?V-=360:V<-180&&(V+=360),t.updateWorldTransformWith(T,A,re+V*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},ew=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.")}},tw=class extends ou{constructor(t){super(t,0,!1);w(this,"bones",new Array);w(this,"_target",null);w(this,"positionMode",ln.Fixed);w(this,"spacingMode",ui.Fixed);w(this,"rotateMode",so.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 ln;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(ln||(ln={}));var ui;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(ui||(ui={}));var so;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(so||(so={}));var Ri;let kR=(Ri=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){T=u/T*p;for(let S=1;S0?Ae.degRad:-.01745329277777778}for(let T=0,A=3;T0){let E=S.a,k=S.b,B=S.c,N=S.d,$=0,L=0,U=0;if(a?$=m[A-1]:d[T+1]==0?$=m[A+2]:$=Math.atan2(F,I),$-=Math.atan2(B,E),x){L=Math.cos($),U=Math.sin($);let C=S.data.length;g+=(C*(L*E-U*B)-I)*i,v+=(C*(U*E+L*B)-F)*i}else $+=y;$>Ae.PI?$-=Ae.PI2:$<-3.1415927&&($+=Ae.PI2),$*=i,L=Math.cos($),U=Math.sin($),S.a=L*E-U*B,S.b=L*k-U*N,S.c=U*E+L*B,S.d=U*k+L*N}S.updateAppliedTransform()}}computeWorldPositions(e,t,i){let n=this.target,r=this.position,o=this.spaces,a=Ie.setArraySize(this.positions,t*3+2),c=this.world,l=e.closed,h=e.worldVerticesLength,u=h/6,d=Ri.NONE;if(!e.constantSpeed){let C=e.lengths;u-=l?1:2;let P=C[u];this.data.positionMode==ln.Percent&&(r*=P);let O;switch(this.data.spacingMode){case ui.Percent:O=P;break;case ui.Proportional:O=P/t;break;default:O=1}c=Ie.setArraySize(this.world,8);for(let D=0,V=0,Y=0;DP){d!=Ri.AFTER&&(d=Ri.AFTER,e.computeWorldVertices(n,h-6,4,c,0,2)),this.addAfterPosition(q-P,c,0,a,V);continue}for(;;Y++){let ne=C[Y];if(!(q>ne)){if(Y==0)q/=ne;else{let re=C[Y-1];q=(q-re)/(ne-re)}break}}Y!=d&&(d=Y,l&&Y==u?(e.computeWorldVertices(n,h-4,4,c,0,2),e.computeWorldVertices(n,0,4,c,4,2)):e.computeWorldVertices(n,Y*6+2,8,c,0,2)),this.addCurvePosition(q,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],a,V,i||D>0&&W==0)}return a}l?(h+=2,c=Ie.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=Ie.setArraySize(this.world,h),e.computeWorldVertices(n,2,h,c,0,2));let f=Ie.setArraySize(this.curves,u),p=0,m=c[0],g=c[1],v=0,y=0,x=0,T=0,A=0,S=0,b=0,_=0,I=0,F=0,E=0,k=0,B=0,N=0;for(let C=0,P=2;Cp){this.addAfterPosition(Y-p,c,h-4,a,P);continue}for(;;O++){let W=f[O];if(!(Y>W)){if(O==0)Y/=W;else{let q=f[O-1];Y=(Y-q)/(W-q)}break}}if(O!=d){d=O;let W=O*6;for(m=c[W],g=c[W+1],v=c[W+2],y=c[W+3],x=c[W+4],T=c[W+5],A=c[W+6],S=c[W+7],b=(m-v*2+x)*.03,_=(g-y*2+T)*.03,I=((v-x)*3-m+A)*.006,F=((y-T)*3-g+S)*.006,E=b*2+I,k=_*2+F,B=(v-m)*.3+b+I*.16666667,N=(y-g)*.3+_+F*.16666667,U=Math.sqrt(B*B+N*N),L[0]=U,W=1;W<8;W++)B+=E,N+=k,E+=I,k+=F,U+=Math.sqrt(B*B+N*N),L[W]=U;B+=E,N+=k,U+=Math.sqrt(B*B+N*N),L[8]=U,B+=E+I,N+=k+F,U+=Math.sqrt(B*B+N*N),L[9]=U,D=0}for(Y*=U;;D++){let W=L[D];if(!(Y>W)){if(D==0)Y/=W;else{let q=L[D-1];Y=D+(Y-q)/(W-q)}break}}this.addCurvePosition(Y*.1,m,g,v,y,x,T,A,S,a,P,i||C>0&&V==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,y=m*e,x=y*3,T=m*x,A=x*e,S=t*v+n*T+o*A+c*p,b=i*v+r*T+a*A+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*y*2+a*f),S-(t*g+n*y*2+o*f)))}},w(Ri,"NONE",-1),w(Ri,"BEFORE",-2),w(Ri,"AFTER",-3),w(Ri,"epsilon",1e-5),Ri),FR=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 or.none:return;case or.reset:this.reset();case or.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,y=this.data.limit*h,x=y*Math.abs(l.scaleY);if(y*=Math.abs(l.scaleX),i||n){if(i){const T=(this.ux-u)*p;this.xOffset+=T>y?y:T<-y?-y:T,this.ux=u}if(n){const T=(this.uy-d)*p;this.yOffset+=T>x?x:T<-x?-x:T,this.uy=d}if(f>=m){v=Math.pow(this.damping,60*m);const T=this.massInverse*m,A=this.strength,S=this.wind*g*l.scaleX,b=this.gravity*g*l.scaleY;do i&&(this.xVelocity+=(S-this.xOffset*A)*T,this.xOffset+=this.xVelocity*m,this.xVelocity*=v),n&&(this.yVelocity-=(b+this.yOffset*A)*T,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 T=Math.atan2(a.c,a.a),A=0,S=0,b=0,_=this.cx-a.worldX,I=this.cy-a.worldY;if(_>y?_=y:_<-y&&(_=-y),I>x?I=x:I<-x&&(I=-x),r){b=(this.data.rotate+this.data.shearX)*t;let F=Math.atan2(I+this.ty,_+this.tx)-T-this.rotateOffset*b;this.rotateOffset+=(F-Math.ceil(F*Ae.invPI2-.5)*Ae.PI2)*p,F=this.rotateOffset*b+T,A=Math.cos(F),S=Math.sin(F),o&&(F=c*a.getWorldScaleX(),F>0&&(this.scaleOffset+=(_*A+I*S)*p/F))}else{A=Math.cos(T),S=Math.sin(T);const F=c*a.getWorldScaleX();F>0&&(this.scaleOffset+=(_*A+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,B=dp.yDown?-this.gravity:this.gravity,N=c/g;for(;;)if(f-=m,o&&(this.scaleVelocity+=(k*A-B*S-this.scaleOffset*E)*F,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=v),r){if(this.rotateVelocity-=((k*S+B*A)*N+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!=or.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*Ae.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)}},OR=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 nt,this.darkColor=e.darkColor?new nt:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof Yn)||!(this.attachment instanceof Yn)||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}},BR=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?Ae.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,y=g.length;vAe.PI?_-=Ae.PI2:_<-3.1415927&&(_+=Ae.PI2),_*=e;let I=Math.cos(_),F=Math.sin(_);x.a=I*T-F*S,x.b=I*A-F*b,x.c=F*T+I*S,x.d=F*A+I*b}if(a){let T=this.temp;c.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(T.x-x.worldX)*t,x.worldY+=(T.y-x.worldY)*i}if(n!=0){let T=Math.sqrt(x.a*x.a+x.c*x.c);T!=0&&(T=(T+(Math.sqrt(l*l+u*u)-T+this.data.offsetScaleX)*n)/T),x.a*=T,x.c*=T}if(r!=0){let T=Math.sqrt(x.b*x.b+x.d*x.d);T!=0&&(T=(T+(Math.sqrt(h*h+d*d)-T+this.data.offsetScaleY)*r)/T),x.b*=T,x.d*=T}if(o>0){let T=x.b,A=x.d,S=Math.atan2(A,T),b=Math.atan2(d,h)-Math.atan2(u,l)-(S-Math.atan2(x.c,x.a));b>Ae.PI?b-=Ae.PI2:b<-3.1415927&&(b+=Ae.PI2),b=S+(b+m)*o;let _=Math.sqrt(T*T+A*A);x.b=Math.cos(b)*_,x.d=Math.sin(b)*_}x.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?Ae.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,y=g.length;vAe.PI?_-=Ae.PI2:_<-3.1415927&&(_+=Ae.PI2),_*=e;let I=Math.cos(_),F=Math.sin(_);x.a=I*T-F*S,x.b=I*A-F*b,x.c=F*T+I*S,x.d=F*A+I*b}if(a){let T=this.temp;c.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),x.worldX+=T.x*t,x.worldY+=T.y*i}if(n!=0){let T=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*n+1;x.a*=T,x.c*=T}if(r!=0){let T=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*r+1;x.b*=T,x.d*=T}if(o>0){let T=Math.atan2(d,h)-Math.atan2(u,l);T>Ae.PI?T-=Ae.PI2:T<-3.1415927&&(T+=Ae.PI2);let A=x.b,S=x.d;T=Math.atan2(S,A)+(T-Ae.PI/2+m)*o;let b=Math.sqrt(A*A+S*S);x.b=Math.cos(T)*b,x.d=Math.sin(T)*b}x.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 fr;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(fr||(fr={}));let nw=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 LR(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==ln.Fixed&&(f.position*=t),f.spacing=n.readFloat(),(f.spacingMode==ui.Length||f.spacingMode==ui.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 Ga(o),h=i.slots.length;for(let u=0;u=0;y--)p[y]=-1;let m=Ie.newArray(h-f,0),g=0,v=0;for(let y=0;y=0;y--)p[y]==-1&&(p[y]=m[--v]);l.setFrame(u,d,p)}n.push(l)}let a=e.readInt(!0);if(a>0){let l=new up(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}},DR=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}},NR=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 bn;(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"})(bn||(bn={}));function Ai(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 Hs:e.setStepped(r);break;case js:ut(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 Hs:e.setStepped(o);break;case js:ut(s,e,a++,o,0,i,l,n,h,t),ut(s,e,a++,o,1,i,l,r,u,t)}i=l,n=h,r=u}return e}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 UR=0,$R=1,XR=2,VR=3,YR=4,GR=5,HR=6,jR=7,WR=8,zR=9,qR=10,KR=0,ZR=1,JR=2,QR=3,eP=4,tP=5,iP=0,sP=1,nP=0,rP=1,oP=2,aP=0,lP=1,cP=2,hP=4,uP=5,dP=6,fP=7,mP=8,Hs=1,js=2;class Wi{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],y=t[f+1],x=t[p],T=t[p+1];for(let A=(l+1)%i;A!=a;A=(A+1)%i){if(!r[A])continue;let S=n[A]<<1,b=t[S],_=t[S+1];if(Wi.positiveArea(x,T,m,g,b,_)&&Wi.positiveArea(m,g,v,y,b,_)&&Wi.positiveArea(v,y,x,T,b,_))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]=Wi.isConcave(h,i,t,n),r[u]=Wi.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(y),a.push(x),a.push(T),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(d),o.push(f),o.push(p),l=Wi.winding(m,g,v,y,x,T),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 Wi);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=Ie.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=Ie.setArraySize(r,x+A*2);for(let I=0;I>1,V=this.clipOutput,Y=Ie.setArraySize(l,N+D*f);for(let q=0;q<$;q+=2,N+=f){let ne=V[q],re=V[q+1];Y[N]=ne,Y[N+1]=re,Y[N+2]=r.r,Y[N+3]=r.g,Y[N+4]=r.b,Y[N+5]=r.a;let me=ne-I,ve=re-F,ce=(L*me+U*ve)*O,de=(P*me+C*ve)*O,X=1-ce-de;Y[N+6]=x*ce+b*de+E*X,Y[N+7]=T*ce+_*de+k*X,a&&(Y[N+8]=o.r,Y[N+9]=o.g,Y[N+10]=o.b,Y[N+11]=o.a)}N=h.length;let W=Ie.setArraySize(h,N+3*(D-2));D--;for(let q=1;q>1,P=this.clipOutput,O=Ie.setArraySize(o,E+C*2),D=Ie.setArraySize(a,E+C*2);for(let Y=0;Y=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],y=g-f[p+3],x=c.length,T=u;for(let S=0,b=u.length-2;Sv*(g-E),B=y*(m-_)-v*(g-I);if(B>0){if(k){c.push(F),c.push(E);continue}let N=F-_,$=E-I,L=B/(N*y-$*v);if(L>=0&&L<=1)c.push(_+N*L),c.push(I+$*L);else{c.push(F),c.push(E);continue}}else if(k){let N=F-_,$=E-I,L=B/(N*y-$*v);if(L>=0&&L<=1)c.push(_+N*L),c.push(I+$*L),c.push(F),c.push(E);else{c.push(F),c.push(E);continue}}h=!0}if(x==c.length)return l.length=0,!0;if(c.push(c[0]),c.push(c[1]),p==d)break;let A=c;c=u,c.length=0,u=A}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 X1(f,l);for(let g=0;d!=null;d=u[g+1],g++)m.setFrame(g,Q(d,"time",0));r.push(m);continue}let p;if(h=="inertia")p=new O1(f,f,l);else if(h=="strength")p=new B1(f,f,l);else if(h=="damping")p=new L1(f,f,l);else if(h=="mass")p=new D1(f,f,l);else if(h=="wind")p=new N1(f,f,l);else if(h=="gravity")p=new U1(f,f,l);else if(h=="mix")p=new $1(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 y=m[v],x=y[0];if(x){if(v=="deform"){let T=g.bones,A=g.vertices,S=T?A.length/3*2:A.length,b=new E1(y.length,y.length,f,g),_=Q(x,"time",0);for(let I=0,F=0;;I++){let E,k=Q(x,"vertices",null);if(!k)E=T?Ie.newFloatArray(S):A;else{E=Ie.newFloatArray(S);let L=Q(x,"offset",0);if(Ie.arrayCopy(k,0,E,L,k.length),n!=1)for(let U=L,C=U+k.length;U=0;v--)d[v]==-1&&(d[v]=p[--g])}a.setFrame(l,Q(u,"time",0),d)}r.push(a)}if(e.events){let a=new up(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 Sn=class Sn extends AR{constructor(t){super(t.resource.source);w(this,"texture");this.texture=We.from(t)}static from(t){return Sn.textureMap.has(t)?Sn.textureMap.get(t):new Sn(t)}setFilters(t,i){this.texture.baseTexture.scaleMode=Sn.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=Sn.toPixiMipMap(t)}setWraps(t,i){this.texture.baseTexture.wrapMode=Sn.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case pi.Nearest:case pi.MipMapNearestLinear:case pi.MipMapNearestNearest:return Cs.NEAREST;case pi.Linear:case pi.MipMapLinearLinear:case pi.MipMapLinearNearest:return Cs.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case pi.Nearest:case pi.Linear:return gs.OFF;case pi.MipMapNearestLinear:case pi.MipMapNearestNearest:case pi.MipMapLinearLinear:case pi.MipMapLinearNearest:return gs.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case Dn.ClampToEdge:return Is.CLAMP;case Dn.MirroredRepeat:return Is.MIRRORED_REPEAT;case Dn.Repeat:return Is.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case fr.Normal:return He.NORMAL;case fr.Additive:return He.ADD;case fr.Multiply:return He.MULTIPLY;case fr.Screen:return He.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};w(Sn,"textureMap",new Map);let lo=Sn;const Tn=class Tn extends hl{constructor(){const t=new rp;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const i=new nh(We.EMPTY);super(t,i);w(this,"name","");w(this,"warnedTwoTint",!1)}updateFromSpineData(t,i,n,r,o,a,c,l){var v,y;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");((y=d.data)==null?void 0:y.length)!==h&&(d.data=new Float32Array(h));let f=0,p=u.data,m=d.data;for(let x=0;xnew lm);w(this,"beforeUpdateWorldTransforms",()=>{});w(this,"afterUpdateWorldTransforms",()=>{});w(this,"_autoUpdate",!1);w(this,"_ticker",Vi.shared);w(this,"meshesCache",new Map);w(this,"lightColor",new nt);w(this,"darkColor",new nt);w(this,"_boundsProvider");w(this,"_boundsPoint",new gt);w(this,"_boundsSpineID",-1);w(this,"_boundsSpineDirty",!0);w(this,"slotsObject",new Map);w(this,"verticesCache",Ie.newFloatArray(1024));w(this,"clippingSlotToPixiMasks",{});w(this,"currentClippingSlot");const n=t instanceof uh?t:t.skeletonData;this.skeleton=new dp(n);const r=new CR(n);this.state=new wR(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 Ha)):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??Vi.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 Ha&&(this.darkTint=!0),i.destroy()}else for(let i=0;inew Ha,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(or.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 Ko){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=Rv.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 Ko)||!h.maskComputed)&&h.mask&&(this.removeChild(h.mask),Rv.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,y>this.verticesCache.length&&(this.verticesCache=Ie.newFloatArray(y)),x.computeWorldVertices(h,0,x.worldVerticesLength,this.verticesCache,0,p),t=x.triangles,i=x.uvs,v=(o=x.region)==null?void 0:o.texture}else if(m instanceof Ko){xt.clipper.clipStart(h,m);continue}else{this.hasMeshForSlot(h)&&(this.getMeshForSlot(h).visible=!1),xt.clipper.clipEndWithSlot(h);continue}if(v!=null){const T=h.bone.skeleton.color,A=h.color,S=T.a*A.a*g.a;this.lightColor.set(T.r*A.r*g.r,T.g*A.g*g.g,T.b*A.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,_,I,F;if(xt.clipper.isClipping())xt.clipper.clipTriangles(this.verticesCache,t,t.length,i,this.lightColor,this.darkColor,f),b=xt.clipper.clippedVertices,_=b.length,I=xt.clipper.clippedTriangles,F=I.length;else{const k=this.verticesCache;for(let B=2,N=0,$=y;B<$;B+=p,N+=2){let L=B;k[L++]=this.lightColor.r,k[L++]=this.lightColor.g,k[L++]=this.lightColor.b,k[L++]=this.lightColor.a,k[L++]=i[N],k[L++]=i[N+1],f&&(k[L++]=this.darkColor.r,k[L++]=this.darkColor.g,k[L++]=this.darkColor.b,k[L++]=this.darkColor.a)}b=this.verticesCache,_=y,I=t,F=t.length}if(_==0||F==0){xt.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,_,I,F,f)}xt.clipper.clipEndWithSlot(h)}xt.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 cl);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(xt.vectorAux.set(i.x,i.y),t.parent){const r=t.parent.worldToLocal(xt.vectorAux);t.x=r.x,t.y=r.y}else t.x=xt.vectorAux.x,t.y=xt.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 xt.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=xt.skeletonCache[d];if(!f){const p=rn.get(r),m=rn.get(o),g=new rm(m);let v=p instanceof Uint8Array?new am(g):new fh(g);v.scale=a,f=v.readSkeletonData(p),xt.skeletonCache[d]=f}return new xt({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=xt.skeletonCache[r];if(o)return new xt(o,n);const a=rn.get(t),c=rn.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),xt.skeletonCache[r]=o,new this(o,n)}get tint(){return this.skeleton.color.toRgb888()}set tint(t){nt.rgb888ToColor(this.skeleton.color,t)}};w(xt,"vectorAux",new ch),w(xt,"clipper",new dh),w(xt,"QUAD_TRIANGLES",[0,1,2,2,3,0]),w(xt,"VERTEX_SIZE",8),w(xt,"DARK_VERTEX_SIZE",12),w(xt,"skeletonCache",Object.create(null));let mh=xt;const Rv=new lh(()=>new Li);dp.yDown=!0;const cc="spineTextureAtlasLoader",wP={extension:Re.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:Re.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=Qt.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const r=new j1(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}rn.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(lo.from(u));else{const d=u??Qt.normalize([...n.split(Qt.sep),h].join(Qt.sep)),f={src:Qc(d,e.src),data:{...i.imageMetadata,alphaMode:l.pma?xi.PMA:xi.UNPACK}},p=t.load(f).then(m=>{l.setTexture(lo.from(m.baseTexture))});o.push(p)}}return await Promise.all(o),rn.setPreferences({preferCreateImageBitmap:a}),r}}};Ue.add(wP);const hc="spineSkeletonLoader";function SP(s){return s.hasOwnProperty("bones")}function TP(s){return s instanceof Uint8Array}const MP={extension:Re.Asset,loader:{name:hc,extension:{type:Re.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")&&SP(s),i=Ki(e.src,".skel")&&TP(s),n=e.loadParser===hc;return Promise.resolve(t||i||n)}}};Ue.add(MP);class _P extends hn{constructor(t=!1){super();w(this,"_buffer");w(this,"_indexBuffer");this._buffer=new Nt(void 0,t,!1),this._indexBuffer=new Nt(void 0,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Ne.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Ne.FLOAT).addAttribute("aColor",this._buffer,4,!0,Ne.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,Ne.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Ne.FLOAT).addIndex(this._indexBuffer)}}const CP=` -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; - -} -`,AP=` -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; -} -`;class rw extends er{constructor(e){super(e),this.shaderGenerator=new qy(CP,AP),this.geometryClass=_P,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=Mt.shared.setValue(e._tintRGB).toPremultiplied(f,!0),m=Mt.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=kP(l),l in Pv)return;Pv[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":PP,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 aw(){const[s,e]=await Promise.all([kv(()=>import("./index-3evwjaUy.js"),[]),kv(()=>import("./index-DbmHfkuV.js"),__vite__mapDeps([0,1]))]);return{core:s,pixi:e}}async function FP(s,e,t){const{core:i,pixi:n}=await aw(),r=new i.TextureAtlas(e);return fp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonJson(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}async function OP(s,e,t){const{core:i,pixi:n}=await aw(),r=new i.TextureAtlas(e);return fp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonBinary(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}function ar(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]=ar(s,t,i))}function mp(s,e,t){if(typeof s.curve!="number")return;const i=ar(s,"time",0),r=ar(e,"time",0)-i,o=s.curve,a=ar(s,"c2",0),c=ar(s,"c3",1),l=ar(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 mr(s,e){if(Array.isArray(s))for(let t=0;t[ar(i,r,o),ar(n,r,o)]))}}function BP(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 Fv(s,e){if(Array.isArray(s))for(let t=0;t[a,o[c]]))}}function LP(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 DP(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 NP(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),Fv(e.rgba,!1),Fv(e.rgba2,!0)}function UP(s){for(const e of Object.values(s.bones||{})){for(const t of e.rotate||[])qi(t,"value","angle",0);mr(e.rotate,[{key:"value",fallback:0}]),mr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),mr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),mr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function $P(s){for(const e of Object.values(s.ik||{}))mr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function XP(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);mr(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 VP(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);mr(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);mr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function YP(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,BP(l)}}}delete s.deform}function lw(s){LP(s),DP(s);for(const e of Object.values(s.animations||{}))NP(e),UP(e),$P(e),XP(e),VP(e),YP(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return s}function GP(s){return s.replace(/\\/g,"/").split("/").pop()||s}async function HP(s){const e=await Promise.all(s.map(async t=>{const i=URL.createObjectURL(t);try{return[GP(t.name).toLowerCase(),await We.fromURL(i)]}finally{URL.revokeObjectURL(i)}}));return new Map(e)}function jP(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 cw(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 HP(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 OP(u,i,n)),h="4.3"}catch(d){try{({skeletonData:a,SpineClass:c}=RP(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=jI(l),l==="3.8"&&lw(u);const d=h==="4.3"?await FP(u,i,n):IP(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:jP(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 WP(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 zP(s){return{skeleton:await tf(s.skeleton),atlas:await tf(s.atlas),textures:await Promise.all(s.textures.map(tf))}}const hw="SpineParticle.EditorConfig",uw=1;function dw(s){return{backgroundX:s.backgroundX,backgroundY:s.backgroundY,backgroundOpacity:s.backgroundOpacity,backgroundImageName:s.backgroundImageName,backgroundImageData:s.backgroundImageData,showGrid:s.showGrid,exportSettings:Xt(s.exportSettings)}}function qP(s){return JSON.parse(JSON.stringify(s,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function fw(s){const e=Xt(s);return delete e.tags,delete e.selectedTag,e}function KP(s){const e=dw(s.settings);return qP({format:hw,version:uw,savedAt:new Date().toISOString(),editor:Xt(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=>({...Xt(t),frames:void 0})),colliders:s.colliders.map(fw),paths:Xt(s.paths),spines:Xt(s.spines)}})}function ZP(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function mw(s){const e=KP(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=ZP(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),0),e}function pw(s){let e;try{e=JSON.parse(s)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==hw)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==uw)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=We.fromURL(r).then(a=>lr(a)),e.set(r,o)),o},i=await t("/images/star.png");await Promise.all(s.map(async n=>{var o;const r=yr(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 QP(s){const e=new Map;try{for(const t of s){if(!t.sourceBundle)continue;const i=await zP(t.sourceBundle);e.set(t.id,await cw(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 ek(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 tk(s,e){var h,u,d,f,p,m,g;const t=pw(JSON.stringify(e)),i=Xt(t.scene.systems),n=t.scene.colliders.map(fw),r=Xt(t.scene.paths),o=Xt(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 QP(o),c=new Map(s.spines.map(v=>[v.id,v.assetVersion]));for(const v of s.spines)Tl(v.id);s.systems=i,s.colliders=n,s.paths=r,s.spines=o,Object.assign(s.editor,Xt(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=n1((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 y=a.get(v.id);if(v.assetVersion=Math.max(Number(v.assetVersion)||0,c.get(v.id)||0)+1,!y){v.status="empty",v.error=v.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",v.animations=[],v.bones=[],v.selectedAnimation="";continue}nu(v.id,y),v.dataVersion=y.dataVersion,v.animations=y.animations,v.bones=y.bones,y.animations.some(x=>x.name===v.selectedAnimation)||(v.selectedAnimation=((p=y.animations[0])==null?void 0:p.name)||""),v.status="ready",v.error=""}s.syncSceneSequences(),ek(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 gw(s,e){return tk(s,pw(e))}async function ik(s,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return gw(s,await e.text())}const au=co({undoCount:0});let ph=null,Rn=null,pr=[],Ca=null,Pn=null,gh=!1;function pp(s){return{systems:s.systems.map(t=>{const i=Xt(t);return i.frames=void 0,i}),colliders:Xt(s.colliders),paths:Xt(s.paths),spines:Xt(s.spines),animations:[...s.timeline.animations],settings:dw(s.settings)}}function gp(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 vw(s,e=pp(s),t=gp(e)){const i=new Map;for(const n of e.spines){const r=GI(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())VI(e);s.spineAssets.clear()}}function xw(s){for(;pr.length>s;)vh(pr.shift()||null);au.undoCount=pr.length}function yw(){const s=ph;if(!s||!Rn||gh)return;const e=pp(s),t=gp(e);t!==Rn.signature&&(pr.push(Rn),Rn=vw(s,e,t),xw(s.settings.undoLimit))}function sk(){gh||(Pn&&clearTimeout(Pn),Pn=setTimeout(()=>{Pn=null,yw()},250))}function nk(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 rk(s){var t,i;if(!nk(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 ok(s,e){const t=Rn;gh=!0;try{for(const i of s.spines)Tl(i.id);s.systems=Xt(e.data.systems),s.colliders=Xt(e.data.colliders),s.paths=Xt(e.data.paths),s.spines=Xt(e.data.spines),s.timeline.animations=[...e.data.animations],Object.assign(s.settings,Xt(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,rk(s),s.recalcTotalFrames(),Rn=e}finally{gh=!1,vh(t)}}function ak(s){if(!(ph===s&&Ca)){Ca==null||Ca(),Pn&&clearTimeout(Pn),vh(Rn);for(const e of pr)vh(e);pr=[],ph=s,Rn=vw(s),au.undoCount=0,Ca=Yi(()=>gp(pp(s)),sk,{flush:"post"})}}function lk(s,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));s.settings.undoLimit=t,xw(t)}function bw(){const s=ph;if(!s||!Rn)return!1;Pn&&(clearTimeout(Pn),Pn=null),yw();const e=pr.pop();return e?(ok(s,e),au.undoCount=pr.length,!0):!1}function ck(s){const e=s instanceof HTMLElement?s:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function hk(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||ck(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]))}jn(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),xl(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const uk={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},dk={class:"help-body"},fk=["aria-expanded"],mk={class:"caret"},pk={class:"help-module-body"},gk=["aria-expanded"],vk={class:"caret"},xk={class:"help-module-body"},yk=["aria-expanded"],bk={class:"caret"},wk={class:"help-module-body"},Sk=["aria-expanded"],Tk={class:"caret"},Mk={class:"help-module-body"},_k=["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=["aria-expanded"],Bk={class:"caret"},Lk={class:"help-module-body"},Dk=["aria-expanded"],Nk={class:"caret"},Uk={class:"help-module-body"},$k=ei({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=Ye(Array.from({length:9},()=>!1));function n(){t("close")}function r(o){o.key==="Escape"&&n()}return jn(()=>window.addEventListener("keydown",r)),vl(()=>window.removeEventListener("keydown",r)),(o,a)=>s.show?(K(),J("div",{key:0,class:"help-overlay",role:"presentation",onClick:tt(n,["self"])},[M("section",uk,[M("header",{class:"help-head"},[a[9]||(a[9]=M("div",null,[M("h2",{id:"help-title"},"使用说明"),M("p",null,"从创建粒子到保存、导出的快速入门")],-1)),M("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:n},"✕")]),M("div",dk,[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)),M("section",{class:Be(["help-section help-module",{open:i.value[0]}])},[M("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]=M("span",{class:"mnum"},"1",-1)),a[11]||(a[11]=M("span",{class:"mtitle"},"配置管理",-1)),M("span",mk,Me(i.value[0]?"▾":"▸"),1)],8,fk),le(M("div",pk,[...a[12]||(a[12]=[es('
保存配置
把当前全部场景对象和参数保存为工程 JSON 文件(也支持 Ctrl+S)。
加载配置
选择本地配置文件,恢复完整工程。
预设
从下拉中选择已保存的预设快速套用;点击下拉即可刷新列表。
范围
配置只含对象与参数,不含“系统设置”;系统设置单独存于浏览器。
',1)])],512),[[bi,i.value[0]]])],2),M("section",{class:Be(["help-section help-module",{open:i.value[1]}])},[M("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]=M("span",{class:"mnum"},"2",-1)),a[14]||(a[14]=M("span",{class:"mtitle"},"场景对象",-1)),M("span",vk,Me(i.value[1]?"▾":"▸"),1)],8,gk),le(M("div",xk,[...a[15]||(a[15]=[es('
粒子
核心对象。可设名称、位置 X/Y、偏移、旋转、缩放 X/Y,以及“随机种子”——相同种子可精确复现同一次效果。
碰撞
圆形/椭圆/矩形/多边形/自定义;启用开关、碰撞响应(物理弹跳/暂停/销毁)、弹性与摩擦,还可沿某条路径移动并带进度曲线。
路径
贝塞尔路径,可双击新建/删除锚点、拖手柄调曲线;内置圆/方/多边形/星形预设,支持闭合与颜色。
Spine
加载 .json+.atlas+.png 预览骨骼动画,可查看/搜索骨骼层级树,用于粒子“发射器跟随”。
通用
每个对象都有小眼睛显隐;“+Copy”可以复制当前对象;隐藏的粒子系统不会进入导出。
',1)])],512),[[bi,i.value[1]]])],2),M("section",{class:Be(["help-section help-module",{open:i.value[2]}])},[M("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]=M("span",{class:"mnum"},"3",-1)),a[17]||(a[17]=M("span",{class:"mtitle"},"发射模式",-1)),M("span",bk,Me(i.value[2]?"▾":"▸"),1)],8,yk),le(M("div",wk,[...a[18]||(a[18]=[es('
持续
按“每秒发射数量”持续喷射;再分“常规持续”(发射时长)与“循环持续”(三段式:开始循环 / 纯循环 / 结束循环,可自动或自定义帧长,做到无缝衔接)。
爆发
一次性发射“单次数量”颗粒子。
延迟时间
粒子条左端位置,表示发射开始前的等待时间。
注意
循环持续模式不支持骨骼跟随和路径跟随;开关时会把跟随设置恢复默认。
',1)])],512),[[bi,i.value[2]]])],2),M("section",{class:Be(["help-section help-module",{open:i.value[3]}])},[M("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]=M("span",{class:"mnum"},"4",-1)),a[20]||(a[20]=M("span",{class:"mtitle"},"发射器形状",-1)),M("span",Tk,Me(i.value[3]?"▾":"▸"),1)],8,Sk),le(M("div",Mk,[...a[21]||(a[21]=[es('
形状
点 / 圆形 / 矩形 / 锥形 / 路径。
圆·锥
内半径与外半径,形成环形或锥形发射区;锥形额外有“锥形朝向”和“开口角度”。
矩形
“外框 − 内框”形成环带,可分别设置内外宽高。
路径
选一条场景路径作为出生线;出生分布可选等距固定或随机。
发射角度
固定 / 随机(基准角度 + 随机范围)/ 径向(圆、矩、锥中心向外)/ 垂直于路径 / 沿路径方向。
',1)])],512),[[bi,i.value[3]]])],2),M("section",{class:Be(["help-section help-module",{open:i.value[4]}])},[M("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]=M("span",{class:"mnum"},"5",-1)),a[23]||(a[23]=M("span",{class:"mtitle"},"粒子属性",-1)),M("span",Ck,Me(i.value[4]?"▾":"▸"),1)],8,_k),le(M("div",Ak,[...a[24]||(a[24]=[M("dl",{class:"help-list"},[M("div",null,[M("dt",null,"初始参数"),M("dd",null,"生命周期、速度、缩放(统一或 X/Y 分离)、初始旋转(可跟随发射方向)。每个属性支持固定 / 随机 / 曲线三种取值。")]),M("div",null,[M("dt",null,"生命周期变化"),M("dd",null,"速度倍率、缩放倍率(统一/分离)、旋转速度,均可用“生命周期 → 倍率”曲线控制。")]),M("div",null,[M("dt",null,"曲线含义"),M("dd",null,"横轴为粒子生命周期 0→1,纵轴为倍率或对应数值。")])],-1)])],512),[[bi,i.value[4]]])],2),M("section",{class:Be(["help-section help-module",{open:i.value[5]}])},[M("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]=M("span",{class:"mnum"},"6",-1)),a[26]||(a[26]=M("span",{class:"mtitle"},"外观与资源",-1)),M("span",Ik,Me(i.value[5]?"▾":"▸"),1)],8,Ek),le(M("div",Rk,[...a[27]||(a[27]=[M("dl",{class:"help-list"},[M("div",null,[M("dt",null,"透明度"),M("dd",null,"曲线或固定;曲线模式可选“跟随导出 / 线性 / 贝塞尔”。")]),M("div",null,[M("dt",null,"图片资源"),M("dd",null,"“+”新增,可上传单图或序列帧;多张图片按权重随机。每张可调缩放、轴心、颜色(固定/随机/生命周期渐变)、混合模式(正常/相加/相乘/滤色)、独立透明度(关/固定/曲线)。")]),M("div",null,[M("dt",null,"序列帧"),M("dd",null,"播放方式:单次隐藏 / 单次定格 / 正向循环 / 反向循环,可设每秒帧数。")])],-1)])],512),[[bi,i.value[5]]])],2),M("section",{class:Be(["help-section help-module",{open:i.value[6]}])},[M("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]=M("span",{class:"mnum"},"7",-1)),a[29]||(a[29]=M("span",{class:"mtitle"},"修改器",-1)),M("span",kk,Me(i.value[6]?"▾":"▸"),1)],8,Pk),le(M("div",Fk,[...a[30]||(a[30]=[es('
移动噪声
强度、波动范围、时间流速,让粒子轨迹产生抖动。
重力 / 风力
固定或随机强度、方向,以及生命周期内强度曲线。
力场
中心 X/Y、强度(正吸负斥)、半径、衰减(恒定/线性/反比)。
吸附
延迟后把粒子吸到指定点,到达范围即死亡;可直线或曲线。
拖尾
独立拖尾图片(多资源按权重)、旋转、拖尾骨骼数、拖尾比例;长度/宽度可固定或随机并支持放大;可加生命周期长度曲线与形状曲线;颜色/透明度可跟随粒子、固定或曲线。
发射器跟随
跟随某条路径(局部/世界、正/反向、进度曲线),或跟随 Spine 骨骼(选中的骨骼 + 偏移)。
碰撞 + 阻尼
选择场景中已启用的碰撞对象参与,并设置速度阻尼。
',1)])],512),[[bi,i.value[6]]])],2),M("section",{class:Be(["help-section help-module",{open:i.value[7]}])},[M("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]=M("span",{class:"mnum"},"8",-1)),a[32]||(a[32]=M("span",{class:"mtitle"},"导出设置",-1)),M("span",Bk,Me(i.value[7]?"▾":"▸"),1)],8,Ok),le(M("div",Lk,[...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),[[bi,i.value[7]]])],2),M("section",{class:Be(["help-section help-module help-connector",{open:i.value[8]}])},[M("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]=M("span",{class:"mnum"},"9",-1)),a[35]||(a[35]=M("span",{class:"mtitle"},"连接器(Spine 连接器)使用说明",-1)),M("span",Nk,Me(i.value[8]?"▾":"▸"),1)],8,Dk),le(M("div",Uk,[...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),[[bi,i.value[8]]])],2),a[38]||(a[38]=M("section",{class:"help-section help-export"},[M("h3",null,"配置与导出有什么区别?"),M("p",null,[M("b",null,"保存配置"),kt("会保存编辑器中的全部对象和参数,之后可以继续修改;"),M("b",null,"导出 Spine Json"),kt("只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。")])],-1))])])])):Te("",!0)}}),ti=(s,e)=>{const t=s.__vccOpts||s;for(const[i,n]of e)t[i]=n;return t},Xk=ti($k,[["__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 Vk(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 Yk(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 ww(s,e){const t=Math.max(.01,s.store.editor.viewScale*e);s.store.editor.viewScale=t}function Gk(s){ww(s,1.2)}function Hk(s){ww(s,1/1.2)}function jk(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function Wk(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function zk(s){s.store.settings.showGrid=!s.store.settings.showGrid}const qk={class:"topbar"},Kk=["disabled"],Zk={class:"tool-group"},Jk={class:"tool-group"},Qk={key:0,class:"background-panel"},eF=["disabled"],tF=["title"],iF={class:"background-position-row"},sF={class:"background-opacity-row"},nF={class:"zoom-pct"},rF=ei({__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=fo(),r=Ye(!1),o=Ye(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(){bw()}return(m,g)=>(K(),J("div",qk,[M("button",{class:"settings-btn",onClick:h,title:"系统设置"},"系统设置"),M("button",{class:"undo-btn",disabled:R(au).undoCount===0,onClick:p,title:"撤回上一步 (Ctrl+Z)"},"↶",8,Kk),M("div",Zk,[M("button",{class:Be(["tool-btn",{on:s.activeTool===""}]),onClick:g[0]||(g[0]=v=>c("")),title:"拖动画布 (Q)"},"✋",2),M("button",{class:Be(["tool-btn",{on:s.activeTool==="translate"}]),onClick:g[1]||(g[1]=v=>c("translate")),title:"位移 (W)"},"✥",2),M("button",{class:Be(["tool-btn",{on:s.activeTool==="rotate"}]),onClick:g[2]||(g[2]=v=>c("rotate")),title:"旋转 (E)"},"⟳",2),M("button",{class:Be(["tool-btn",{on:s.activeTool==="scale"}]),onClick:g[3]||(g[3]=v=>c("scale")),title:"缩放 (R)"},"⤢",2)]),M("div",Jk,[M("button",{class:"tool-btn",onClick:g[4]||(g[4]=v=>R(Gk)(s.ctx)),title:"放大"},"+"),M("button",{class:"tool-btn",onClick:g[5]||(g[5]=v=>R(Hk)(s.ctx)),title:"缩小"},"-"),M("button",{class:"tool-btn",onClick:g[6]||(g[6]=v=>R(jk)(s.ctx)),title:"适配画布"},"⤢"),M("button",{class:Be(["tool-btn",{on:R(n).settings.showGrid}]),onClick:g[7]||(g[7]=v=>R(zk)(s.ctx)),title:"切换网格"},"▦",2),M("button",{class:"tool-btn",onClick:g[8]||(g[8]=v=>R(Wk)(s.ctx)),title:"重置视图"},"⟳")]),M("div",{class:"background-menu",onClick:g[14]||(g[14]=tt(()=>{},["stop"]))},[M("button",{class:Be(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:l},"背景图",2),r.value?(K(),J("div",Qk,[M("button",{class:"background-upload",onClick:g[9]||(g[9]=v=>{var y;return(y=o.value)==null?void 0:y.click()})},Me(a.value?"更换图像":"上传图像"),1),M("button",{class:"background-clear",disabled:!a.value,onClick:g[10]||(g[10]=v=>f())},"清除背景",8,eF),M("input",{ref_key:"backgroundFileInput",ref:o,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:d},null,544),M("div",{class:"background-file-name",title:a.value},Me(a.value||"未上传图像"),9,tF),M("div",iF,[M("label",null,[g[15]||(g[15]=M("span",null,"X",-1)),le(M("input",{"onUpdate:modelValue":g[11]||(g[11]=v=>R(n).settings.backgroundX=v),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[Ge,R(n).settings.backgroundX,void 0,{number:!0}]])]),M("label",null,[g[16]||(g[16]=M("span",null,"Y",-1)),le(M("input",{"onUpdate:modelValue":g[12]||(g[12]=v=>R(n).settings.backgroundY=v),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[Ge,R(n).settings.backgroundY,void 0,{number:!0}]])])]),M("label",sF,[g[17]||(g[17]=M("span",null,"透明度",-1)),le(M("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),[[Ge,R(n).settings.backgroundOpacity,void 0,{number:!0}]]),M("b",null,Me(Math.round(R(n).settings.backgroundOpacity*100))+"%",1)])])):Te("",!0)]),M("button",{class:Be(["help-btn",{on:s.showHelp}]),title:"查看使用说明",onClick:u},"使用说明",2),M("span",nF,Me(Math.round(R(n).editor.viewScale*100))+"%",1)]))}}),oF=ti(rF,[["__scopeId","data-v-4749834a"]]),aF={key:0,class:"settings-panel"},lF={class:"sp-head"},cF={class:"sp-switch-row"},hF={class:"sp-switch-control"},uF={class:"sp-row"},dF={class:"sp-chk"},fF={class:"sp-chk"},mF={class:"sp-row"},pF={class:"sp-row"},gF={class:"sp-chk"},vF={class:"sp-chk"},xF={class:"sp-row"},yF={class:"sp-row"},bF={class:"sp-row"},wF={class:"sp-hex"},SF={class:"sp-chk"},TF=ei({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=fo();function n(o){lk(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(),J("div",aF,[M("div",lF,[a[15]||(a[15]=kt("系统设置 ",-1)),M("button",{class:"sp-close",onClick:a[0]||(a[0]=c=>t("close"))},"✕")]),a[29]||(a[29]=M("div",{class:"sp-section-title"},"界面布局",-1)),M("label",cF,[a[17]||(a[17]=M("span",null,"参数面板位置",-1)),M("span",hF,[le(M("input",{type:"checkbox","onUpdate:modelValue":a[1]||(a[1]=c=>R(i).settings.parameterPanelOnRight=c),"aria-label":"参数面板显示在右侧"},null,512),[[St,R(i).settings.parameterPanelOnRight]]),a[16]||(a[16]=M("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),M("b",null,Me(R(i).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),a[30]||(a[30]=M("div",{class:"sp-divider"},null,-1)),a[31]||(a[31]=M("div",{class:"sp-section-title"},"操作历史",-1)),M("label",uF,[a[18]||(a[18]=M("span",null,"最大撤回步数",-1)),le(M("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),[[Ge,R(i).settings.undoLimit,void 0,{number:!0}]])]),a[32]||(a[32]=M("div",{class:"sp-divider"},null,-1)),a[33]||(a[33]=M("div",{class:"sp-section-title"},"画布辅助显示",-1)),M("label",dF,[le(M("input",{type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=c=>R(i).settings.showEmitter=c)},null,512),[[St,R(i).settings.showEmitter]]),a[19]||(a[19]=kt("发射点",-1))]),M("label",fF,[le(M("input",{type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=c=>R(i).settings.showBones=c)},null,512),[[St,R(i).settings.showBones]]),a[20]||(a[20]=kt("骨骼连线",-1))]),R(i).settings.showBones?(K(),J(Fe,{key:0},[M("label",mF,[a[21]||(a[21]=M("span",null,"骨骼点绘制大小",-1)),le(M("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),[[Ge,R(i).settings.bonePointDrawSize,void 0,{number:!0}]])]),M("label",pF,[a[22]||(a[22]=M("span",null,"坐标轴绘制大小",-1)),le(M("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),[[Ge,R(i).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):Te("",!0),M("label",gF,[le(M("input",{type:"checkbox","onUpdate:modelValue":a[7]||(a[7]=c=>R(i).settings.showSkinMesh=c)},null,512),[[St,R(i).settings.showSkinMesh]]),a[23]||(a[23]=kt("蒙皮网格",-1))]),a[34]||(a[34]=M("div",{class:"sp-divider"},null,-1)),M("label",vF,[le(M("input",{type:"checkbox","onUpdate:modelValue":a[8]||(a[8]=c=>R(i).settings.tickEnabled=c)},null,512),[[St,R(i).settings.tickEnabled]]),a[24]||(a[24]=kt("启用刻度",-1))]),R(i).settings.tickEnabled?(K(),J(Fe,{key:1},[M("label",xF,[a[25]||(a[25]=M("span",null,"刻度文字大小",-1)),le(M("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":a[9]||(a[9]=c=>R(i).settings.axisFontSize=c)},null,512),[[Ge,R(i).settings.axisFontSize,void 0,{number:!0}]]),le(M("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":a[10]||(a[10]=c=>R(i).settings.axisFontSize=c),class:"sp-num"},null,512),[[Ge,R(i).settings.axisFontSize,void 0,{number:!0}]])]),M("label",yF,[a[26]||(a[26]=M("span",null,"刻度线粗细",-1)),le(M("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":a[11]||(a[11]=c=>R(i).settings.tickWidth=c)},null,512),[[Ge,R(i).settings.tickWidth,void 0,{number:!0}]]),le(M("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":a[12]||(a[12]=c=>R(i).settings.tickWidth=c),class:"sp-num"},null,512),[[Ge,R(i).settings.tickWidth,void 0,{number:!0}]])]),M("label",bF,[a[27]||(a[27]=M("span",null,"坐标轴颜色",-1)),le(M("input",{type:"color","onUpdate:modelValue":a[13]||(a[13]=c=>R(i).settings.axisColor=c),class:"sp-colr"},null,512),[[Ge,R(i).settings.axisColor]]),M("span",wF,Me(R(i).settings.axisColor),1)]),M("label",SF,[le(M("input",{type:"checkbox","onUpdate:modelValue":a[14]||(a[14]=c=>R(i).settings.showAxisLabels=c)},null,512),[[St,R(i).settings.showAxisLabels]]),a[28]||(a[28]=kt("显示刻度数值",-1))])],64)):Te("",!0),a[35]||(a[35]=M("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):Te("",!0)}}),MF=ti(TF,[["__scopeId","data-v-1bba85d9"]]);class sf{constructor(){w(this,"sprite",null);w(this,"texture",null);w(this,"loadVersion",0)}createSprite(e){const t=new Sr(We.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=We.EMPTY,this.sprite.visible=!1),this.texture&&this.texture.destroy(!0),this.texture=null;return}try{const i=await We.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 _F{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=Mo(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=Mo(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=Mo(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=Mo(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=Mo(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((y,x)=>{y.x>=p&&y.x<=m&&y.y>=g&&y.y<=v&&(l?this.selectedNodes.delete(x):this.selectedNodes.add(x))}),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),!0}return!1}}class CF{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(y=>y.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(y=>{const x=us(this.ctx,y.clientX,y.clientY);i.x=m+x.x-v.x,i.y=g+x.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.showForceFieldShape||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)||!i.showAttractionShape)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,y=Math.atan2(h-c,l-a);Zo(T=>{const A=(T.clientX-l)/r,S=(T.clientY-h)/r;if(u==="translate")t.setPosition(d+A,f-S);else if(u==="rotate"){const b=Math.atan2(T.clientY-c,T.clientX-a);t.setRotation(p-(b-y)*180/Math.PI)}else if(u==="scale"){const _=Math.hypot(T.clientX-a,T.clientY-c)/v;t.setScale(Math.max(.05,m*_),Math.max(.05,g*_))}})}}function Ov(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 Bv(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 vp(s,e){if(!s.points.length)return null;if(s.points.length===1)return{...Bv(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 y=v/20,x=Ov(m.x,m.x+m.outX,g.x+g.inX,g.x,y),T=Ov(m.y,m.y+m.outY,g.y+g.inY,g.y,y),A=Bv(s,x,T),S=i[i.length-1];S&&(n+=Math.hypot(A.x-S.x,A.y-S.y)),i.push({...A,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 xh(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 AF(s,e,t){const i=vp(e,t);if(!i)return null;const n=xh(s,i.x,i.y),r=i.angle*Math.PI/180,o=xh(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 EF(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,l1(o,r,a))),l=vp(i,c);return l?{...t,x:l.x,y:l.y,rotation:t.rotation+(t.followPathRotation?l.angle:0)}:t})}class IF{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=yr(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 $I(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 RF(){const[s,e]=await Promise.all([We.fromURL("/images/star.png"),We.fromURL("/images/trail.png")]);return{dotTex:s,trailTex:e}}function PF(s,e,t){for(const i of s.systems){i.config.texture=e;const n=yr(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 kF={class:"stage-wrap"},FF={key:0,class:"hud"},OF={class:"hud-number hud-system-count"},BF={class:"hud-number hud-particle-count"},LF=ei({__name:"Stage",setup(s){const e=fo(),t=Ye(null),i=Ye(null),n=Ye(!1),r=Ye(!1),o=Ye(""),a=Ye(!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,y=null,x=null,T=null,A=null,S=null,b=[],_=0,I=0,F=0,E=0,k=null,B=null;const N=new sf,$=new IF,L={store:e,holder:t,app:()=>c},U=new _F(L),C=new CF(L,()=>o.value);let P=[];const O=new Map;function D(){l=new _i,c.stage.addChild(l),A=new _i,c.stage.addChild(A),N.createSprite(l),T=new Li,l.addChild(T),S=new bR,l.addChild(S.container),u=new Li,l.addChild(u),h=new Li,l.addChild(h),f=new Li,l.addChild(f),p=new Li,l.addChild(p),m=new Li,l.addChild(m),g=new Li,l.addChild(g),v=new Li,l.addChild(v),y=new Li,l.addChild(y),x=new Li,l.addChild(x),d=new Li,l.addChild(d)}function V(de){if(de.button===0){if(o.value&&C.selectedTransformTarget()){C.onGizmoDown(de);return}U.onPointerDown(de)||C.onColliderPointerDown(de)||C.onAttractionDown(de)||C.onForceFieldDown(de)||Yk(L,de.clientX,de.clientY)}}function Y(de){U.onStageDoubleClick(de)}function W(de){Vk(L,de)}function q(de=!0){sf.clearStoreBackground(e,de)}async function ne(de){await sf.handleFileChange(e,de)}hk({canvasElement:t,canvasFocused:a,undo:bw,save:()=>mw(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:de=>{o.value=de}});function re(){l&&$.sync(e,l,k,B)}function me(de,X,j,H){const G=Math.max(2,Math.floor(H)||2);if(de.config.mode==="stream"&&de.config.streamBehavior==="loop"){Mv(de,X,j,G);return}X.reset();const z=1/Math.max(1,j),te=[];for(let he=0;he=X)continue;const z=$.emitters.get(G.id);if(!z){j=!1;continue}me(G,z,de,X)}j&&(e.timeline.recorded=!0)}function ce(){var j,H,G,z;E=requestAnimationFrame(ce);const de=performance.now()/1e3;let X=de-_;if(_=de,X>.1&&(X=.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),N.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),iR(e,c,T,A,b),re();const te=Math.max(1,e.timeline.fps),he=e.timeline.frame,se=he/te;S==null||S.sync(e.spines,he,te),P=EF(e,se);for(const Le of e.systems){const be=$.emitters.get(Le.id);if(!be)continue;be.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const at=Le.visible!==!1;be.visible=at,be.renderable=at;const we=Le.config;be.scale.set(we.rootScaleX,we.rootScaleY);const mi=new Set(we.collisionColliderIds);be.setColliders(we.collision?P.filter(At=>mi.has(At.id)):[]),be.setEmitterFollowSpawn(0,0,0);let Rt={x:we.centerX,y:we.centerY,rotation:we.rootRotation};const vt=we.emitterFollow&&we.emitterFollowMode==="bone"?e.spines.find(At=>At.id===we.emitterFollowSpineId&&At.enabled&&At.status==="ready"):null,ie=vt&&(S==null?void 0:S.getBoneWorldTransform(vt.id,we.emitterFollowBoneName))||null,oe=we.emitterFollow&&we.emitterFollowMode==="path"?e.paths.find(At=>At.id===we.emitterFollowPathId&&At.enabled):null,lt=Math.max(.05,we.emitterFollowDuration),_t=Math.min(1,Math.max(0,se/lt)),Ct=Math.min(1,Math.max(0,l1(we.emitterFollowCurve,_t))),et=Math.min(1,Math.max(0,we.emitterFollowOffset)),rs=we.emitterFollowDirection==="reverse"?(1-et)*(1-Ct):et+(1-et)*Ct,ni=oe?vp(oe,rs):null;if(ie){const At=we.emitterFollowBoneOffsetX,vs=we.emitterFollowBoneOffsetY,Ci=ie.x+At,ri=ie.y+vs,fn=we.rootRotation+we.emitterFollowBoneRotation,Bs=Math.max(1e-4,Math.abs(we.rootScaleX*we.emitterFollowBoneScaleX)),Ls=Math.max(1e-4,Math.abs(we.rootScaleY*we.emitterFollowBoneScaleY));if(Rt={x:Ci,y:ri,rotation:fn},we.emitterFollowSpace==="local")be.position.set(Ci,-ri),be.rotation=-fn*Math.PI/180,be.scale.set(Bs,Ls),be.setSimulationTransform(Ci,ri,fn,Bs,Ls);else{be.position.set(we.centerX,-we.centerY),be.rotation=-we.rootRotation*Math.PI/180,be.scale.set(Bs,Ls),be.setSimulationTransform(we.centerX,we.centerY,we.rootRotation,Bs,Ls);const Ds=xh(we,Ci,ri,Bs,Ls),_r=-(fn-we.rootRotation);be.setEmitterFollowSpawn(Ds.x,Ds.y,_r)}}else if(ni){const At=ni.angle+(we.emitterFollowDirection==="reverse"?180:0),vs=we.emitterAngleMode==="direction"?At:we.rootRotation;if(Rt={x:ni.x,y:ni.y,rotation:vs},we.emitterFollowSpace==="local")be.position.set(ni.x,-ni.y),be.rotation=-vs*Math.PI/180,be.setSimulationTransform(ni.x,ni.y,vs);else{be.position.set(we.centerX,-we.centerY),be.rotation=-we.rootRotation*Math.PI/180,be.setSimulationTransform(we.centerX,we.centerY,we.rootRotation);const Ci=xh(we,ni.x,ni.y),ri=we.emitterAngleMode==="direction"?-(At-we.rootRotation):0;be.setEmitterFollowSpawn(Ci.x,Ci.y,ri)}}else be.position.set(we.centerX,-we.centerY),be.rotation=-we.rootRotation*Math.PI/180,be.setSimulationTransform(we.centerX,we.centerY,we.rootRotation);const Kt=we.shape==="path"&&we.spawnPathId>0&&e.paths.find(At=>At.id===we.spawnPathId&&At.enabled&&At.points.length>0)||null;be.setSpawnPathSampler(Kt?At=>AF(we,Kt,At):null,(Kt==null?void 0:Kt.closed)===!0),O.set(Le.id,Rt)}let ue=0;const ae=[],Ee=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,xe=(Le,be,at)=>{!Le||Le.id!==Ee||Le.visible===!1||mR(ae,at,be.position.x,be.position.y)},fe=e.timeline,De=fe.fps,Ze=1/Math.max(1,De);let ze=F,Ke=0;if(fe.playing?(I+=X,Ke=Math.floor(I/Ze),Ke>0&&(I-=Ke*Ze)):(I=0,ve(De)),fe.playing&&Ke>0)for(let Le=0;LeRt.id===e.activeId),at=(be==null?void 0:be.config.mode)==="stream"&&be.config.streamBehavior==="loop"?lp(be.config,De):null,mi=fe.loop&&(at==null?void 0:at.start)===fe.playbackStart&&at.end===fe.playbackEnd?fe.playbackEnd-1:fe.playbackEnd;if(fe.frame>mi)if(fe.loop)fe.frame=fe.playbackStart;else{fe.frame=fe.playbackEnd,fe.playing=!1;break}}else{for(const be of e.systems){const at=$.emitters.get(be.id);if(!at)continue;be.config.mode==="stream"&&be.config.streamBehavior==="loop"?(j=be.frames)!=null&&j.length||Mv(be,at,De,fe.totalFrames):fe.frame===0&&at.reset()}for(const[be,at]of $.emitters){const we=e.systems.find(oe=>oe.id===be),mi=(we==null?void 0:we.config.mode)==="stream"&&we.config.streamBehavior==="loop",Rt=mi?(H=we.frames)==null?void 0:H[fe.frame]:void 0,vt=fe.frame===0&&!mi,ie=vt?[]:Rt||at.update(Ze);if(vt?at.apply([]):Rt&&at.apply(Rt),(we==null?void 0:we.visible)!==!1)for(const oe of ie)oe.active&&xe(we,at,oe);ue+=ie.length}for(const be of e.systems){if(!be.config.texture)continue;be.frames=be.frames||[];const at=$.emitters.get(be.id);at&&!(be.config.mode==="stream"&&be.config.streamBehavior==="loop")&&(be.frames[fe.frame]=at.capture())}fe.frame++,fe.frame>=fe.totalFrames&&(fe.frame=fe.playbackStart,fe.recorded=!0)}else{fe.playing||(ze=fe.frame);for(const Le of e.systems){const be=$.emitters.get(Le.id),at=fe.playing?F:fe.frame,we=(z=Le.frames)==null?void 0:z[at],mi=Le.config.mode==="stream"&&Le.config.streamBehavior==="loop"&&!!we;if((fe.recorded||mi)&&be&&we){be.apply(we);for(const Rt of we)Rt.active&&(xe(Le,be,Rt),ue++)}else if(be){const Rt=fe.frame===0?[]:be.update(0);if(fe.frame===0&&be.apply([]),Le.visible!==!1)for(const vt of Rt)vt.active&&xe(Le,be,vt);ue+=be.activeCount}}}F=ze,S==null||S.sync(e.spines,ze,De);for(const[,Le]of $.emitters)Le.drawTrailMeshDebug(e.settings.showSkinMesh);dR(e,P,v),fR(e,U.selectedNodes,y),cR(e,S,u),sR(e,O,h),nR(e,O,f),rR(e,p),oR(e,m),aR(e,g),hR(o,C.selectedTransformTarget.bind(C),x),pR(ae,e,d),i.value&&(i.value.systems=e.systems.length,i.value.particles=ue)}}return jn(async()=>{const de=t.value;c=new Pb({width:de.clientWidth||800,height:de.clientHeight||600,backgroundAlpha:0,antialias:!0}),de.appendChild(c.view),D(),Yi(()=>e.settings.backgroundImageData,j=>N.syncTexture(j),{immediate:!0});const X=await RF();k=X.dotTex,B=X.trailTex,PF(e,k,B),i.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,I=0,F=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const j of e.systems)j.frames=[];e.recalcTotalFrames(),_=performance.now()/1e3,ce(),Yi(()=>e.systems.map(j=>JSON.stringify(j.config,(H,G)=>H==="texture"||H==="trailTexture"||H==="previewUrl"?void 0:G)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const j of e.systems)j.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),ak(e)}),xl(()=>{cancelAnimationFrame(E),S==null||S.destroy(),S=null,N.destroy(),l&&c&&$.destroy(l),c&&(c.destroy(!0,{children:!0}),c=null)}),Yi(()=>[e.activeObjectType,e.activeObjectId],()=>U.resetSelection()),(de,X)=>(K(),J("div",kF,[M("div",{ref_key:"holder",ref:t,class:Be(["stage-holder",{grid:R(e).settings.showGrid}]),tabindex:"0",onWheel:tt(W,["prevent"]),onPointerdown:V,onDblclick:tt(Y,["prevent"])},null,34),ye(oF,{ctx:L,"active-tool":o.value,"show-settings":n.value,"show-help":r.value,"onUpdate:activeTool":X[0]||(X[0]=j=>o.value=j),"onUpdate:showSettings":X[1]||(X[1]=j=>n.value=j),"onUpdate:showHelp":X[2]||(X[2]=j=>r.value=j),onClearBackground:q,onBackgroundFile:ne},null,8,["active-tool","show-settings","show-help"]),ye(MF,{show:n.value,onClose:X[3]||(X[3]=j=>n.value=!1)},null,8,["show"]),ye(Xk,{show:r.value,onClose:X[4]||(X[4]=j=>r.value=!1)},null,8,["show"]),i.value?(K(),J("div",FF,[X[5]||(X[5]=kt(" 系统: ",-1)),M("b",OF,Me(i.value.systems),1),X[6]||(X[6]=kt(" · 粒子(骨骼): ",-1)),M("b",BF,Me(i.value.particles),1),X[7]||(X[7]=kt(" · 根骨骼: ",-1)),X[8]||(X[8]=M("b",null,"root",-1)),X[9]||(X[9]=M("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):Te("",!0)]))}}),DF=ti(LF,[["__scopeId","data-v-b3b109ad"]]),NF=[{x:0,y:0},{x:1,y:1}],cm=[{x:0,y:1},{x:1,y:1}],UF=[{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}],Zt=co({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let uc=0;function $F(s){return new Promise(e=>window.setTimeout(e,s))}function Sw(s,e){const t=++uc,i=performance.now();Object.assign(Zt,{visible:!0,title:s,detail:e,progress:0,indeterminate:!1,failed:!1});const n=(o,a)=>{t===uc&&(Zt.indeterminate=o==null,o!=null&&(Zt.progress=Math.min(100,Math.max(0,o))),a&&(Zt.detail=a))},r=async(o,a)=>{if(t!==uc)return;Zt.failed=o,Zt.indeterminate=!1,Zt.progress=o?Zt.progress:100,Zt.detail=a,await $F(Math.max(180,(o?850:450)-(performance.now()-i))),t===uc&&(Zt.visible=!1)};return{update:n,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o="已完成")=>r(!1,o),fail:(o="操作失败")=>r(!0,o)}}async function XF(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 VF="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 YF(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 GF(s){for(const e of Object.values(s.slots||{}))ds(e,"color","rgba"),ds(e,"twoColor","rgba2")}function HF(s){for(const e of Object.values(s.bones||{}))for(const t of e.rotate||[])ds(t,"angle","value")}function jF(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 WF(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 zF(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 qF(s){s.skeleton.spine=VF,YF(s);for(const e of Object.values(s.animations))GF(e),HF(e),jF(e),WF(e),zF(e);return fm(s.animations),s}function KF(s,e,t,i,n=!1){if(n){let c=0;for(let l=0;l[...n].sort((a,c)=>a-c);let o=!0;for(;o;){o=!1;const a=r();for(let c=0;cf&&(f=m,d=p)}d>=0&&(n.add(d),o=!0)}}return r().map(a=>s[a])}function Lv(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 Dv(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+Lv(s,e,t,r,!0)*i/3,u=a-Lv(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 ZF(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,r=!1){if(r){let l=0;for(let h=0;h[...n].sort((c,l)=>c-l);let o=!0;for(;o;){o=!1;const c=r();for(let l=0;lm&&(m=v,p=g)}p>=0&&(n.add(p),o=!0)}}const a=r();return{samples:a.map(c=>s[c]),controls:a.slice(0,-1).map((c,l)=>Dv(s,c,a[l+1]))}}function QF(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 si(s){if(!Number.isFinite(s))return 0;const e=Math.round(s*1e5)/1e5;return Object.is(e,-0)?0:e}function e3(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 x=0;x=0;x--)g.push({col:x,row:n-1});for(let x=n-2;x>=1;x--)g.push({col:0,row:x});const v=g.length;for(let x=1;x|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function _w(s,e){let t=s,i=2;for(;e.has(t);)t=`${s}_${i++}`;return e.add(t),t}function i3(s){return s.replace(/\.[^./\\]+$/,"")}function Cw(s,e){return i3([s,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function s3(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 Vv(s,e){return[(s>>16&255)/255,(s>>8&255)/255,(s&255)/255,Math.max(0,Math.min(1,e))]}function ja(s,e){return si(s/e)}function n3(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+dr(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function r3(s,e,t){const i=s.config;if(i.mode!=="stream"||i.streamBehavior!=="loop")return new Set;const n=lp(i,e),r=Math.max(1,t)/Math.max(1,e);return new Set([Math.round(n.start*r),Math.round(n.end*r)])}function yh(s,e){return e?s.boneName:`${s.spawnId??"legacy"}_${s.boneName}`}function o3(s,e,t,i){const n=new Set;for(const r of s)for(const o of r)n.add(yh(o,e));return[...n].sort().map((r,o)=>({key:r,name:_w(`${i}_${o}`,t),states:s.map(a=>a.find(c=>yh(c,e)===r)||null)}))}function Yv(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 a3(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||yh(a,!0)!==yh(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 Gv(s,e){return!s||s==="跟随导出"?e.keyframeCurve:s==="贝塞尔"?"bezier":"linear"}function Co(s,e,t,i,n,r=new Set,o=new Set,a=n.keyframeCurve){if(!s.length)return[];const c=new Set(r);for(const u of o)c.add(u);const l=a==="bezier"&&n.spineVersion!=="3.8"?Mw(s,i,c,o):{samples:Tw(s,i,c,o),controls:[]},h=l.samples.map(u=>{const d={time:ja(u.frame,e)};return t.forEach((f,p)=>{d[f]=si(u.values[p])}),o.has(u.frame)&&(d.curve="stepped"),d});for(let u=0;u0&&n&&e.add(t-1),i&&e.add(t))}return e}function c3(s){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),i&&e.add(t))}return e}function d3(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{(o!==r||i.has(a))&&(n.push(t(o,a)),r=o)}),n}function m3(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=s3(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const a=o.width||1,c=o.height||1;return{path:Cw(s.textureFolder,n),x:si((.5-s.anchorX)*a),y:si((s.anchorY-.5)*c),width:si(a),height:si(c)}}function Hv(s,e){const t=[];for(const n of e){const r=n.imageMode==="sequence"?Math.max(1,n.sequenceFrames.length):1;for(let o=0;o1;return new Map(t.map((n,r)=>[n,i?`${s}_${r}`:s]))}function p3(s,e,t,i,n=i.keyframeCurve,r=new Set,o=new Set){if(!s.length)return[];const a=new Set;for(let d=1;d({frame:f,values:d})),l=1/255,h=n==="bezier"&&i.spineVersion!=="3.8"?Mw(c,[l,l,l,.01],a,r):{samples:Tw(c,[l,l,l,.01],a,r),controls:[]},u=h.samples.map(d=>{const f={time:ja(d.frame,t),color:`${fc(d.values[0])}${fc(d.values[1])}${fc(d.values[2])}${fc(d.values[3])}`};return r.has(d.frame)&&(f.curve="stepped"),f});if(h.controls.length)for(let d=0;d({time:ja(p,n),name:f??null}),c);h.length&&(l.attachment=h);const u=p3(i,t,n,r,o,a,c);u.length&&(l.rgba=u)}function Wv(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,n3(m,t)),v=(m.frames||[]).slice(0,g);v.length||r.push({code:"empty-cache",message:`“${m.config.name}”没有可用帧缓存。`});const y=_w(t3(m.config.name,`system_${m.id}`),l);a.bones.push({name:y,parent:"root"});const x=o3(v,e.bonePool,l,y),T=Math.max(0,(g-1)/t),A=Math.max(1,Math.ceil(T*n)+1),S=r3(m,t,n),b=u.get(m.animation)||[];b.push({system:m,tracks:x,targetFrames:A,boundaryFrames:S,attachmentPrefix:y}),u.set(m.animation,b);for(const _ of x){a.bones.push({name:_.name,parent:y});const I=Yv(m,_),F=new Set(I.map($=>$.blend)),E=[],k=[];for(const $ of F){const L=`${_.name}_${$}`;E.push(L),a.slots.push({name:L,bone:_.name,color:"ffffff00",blend:Nv[$]});const U=c[L]||(c[L]={}),C=I.filter(O=>O.blend===$),P=Hv(y,C);for(const O of C){const D=O.imageMode==="sequence"?Math.max(1,O.sequenceFrames.length):1;for(let V=0;V{var V;return((V=D==null?void 0:D.trailState)==null?void 0:V.resourceId)===$.id}))continue;const L=Math.max(2,Math.min(16,Math.round($.boneCount||3))),U=[];for(let D=0;Da.bones.findIndex(V=>V.name===D)),O=Cw("",$.textureName||`trail_${$.id}`);(c[C]||(c[C]={}))[`trail_${$.id}`]=e3(m.config,$,P,O),$.texture||r.push({code:"missing-image",message:`拖尾图片“${$.textureName||$.id}”缺失,已保留路径。`})}const B=new Set([...E,...k]),N=a.slots.filter($=>B.has(String($.name)));N.length&&(a.slots=a.slots.filter($=>!N.includes($)),a.slots.push(...N.filter($=>k.includes(String($.name))),...N.filter($=>E.includes(String($.name)))))}}for(const m of h){const g=u.get(m)||[],v={bones:{},slots:{}};let y=!1;for(const{system:x,tracks:T,targetFrames:A,boundaryFrames:S,attachmentPrefix:b}of g)for(const _ of T){const I=Array.from({length:A},(W,q)=>a3(_,q,t,n)),F=I.map(W=>!!(W!=null&&W.active)),E=[],k=[],B=[];I.forEach((W,q)=>{W!=null&&W.active&&(E.push({frame:q,values:[W.worldX??W.x,W.worldY??W.y]}),k.push(W.worldRotation??W.rotation),B.push({frame:q,values:[W.worldScaleX??W.scaleX,W.worldScaleY??W.scaleY]}))});const N=QF(k),$=E.map((W,q)=>({frame:W.frame,values:[N[q]??0]})),L=l3(I);for(const W of S)L.add(W);const U=c3(I),C={},P=Co(E,n,["x","y"],[Uv,Uv],e,L,U),O=Co($,n,["value"],[Xv],e,L,U),D=Co(B,n,["x","y"],[dc,dc],e,L,U);P.length&&(C.translate=P),O.length&&(C.rotate=O),D.length&&(C.scale=D),Object.keys(C).length&&(v.bones[_.name]=C,y=!0);const V=Yv(x,_),Y=new Set(V.map(W=>W.blend));for(const W of Y){const q=V.filter(X=>X.blend===W),ne=Hv(b,q),re=[],me=[];let ve=16777215;for(let X=0;Xte.id===j.resourceId):void 0,G=!!j&&F[X]&&j.imageVisible!==!1&&(H==null?void 0:H.blend)===W;j&&(H==null?void 0:H.blend)===W&&(ve=j.colorHex);const z=G?ne.get(`${H.id}_${j.imageFrameIndex??0}`):void 0;re.push(z??null),me.push(Vv(ve,G?j.alpha:0))}const ce=q.filter(X=>X.independentAlpha==="curve").map(X=>Gv(X.alphaCurveMode,e)),de=ce.length?ce.includes("bezier")?"bezier":"linear":Gv(x.config.alphaMode==="curve"?x.config.curveMode:void 0,e);jv(v,`${_.name}_${W}`,re,me,n,e,de,U,S),re.some(Boolean)&&(y=!0)}if(x.config.trail)for(const W of x.config.trailResources){const q=Math.max(2,Math.min(16,Math.round(W.boneCount||3))),ne=I.map(z=>{var te;return((te=z==null?void 0:z.trailState)==null?void 0:te.resourceId)===W.id?z.trailState:void 0}),re=ne.find(z=>!!z);if(!re)continue;const me=u3(ne),ve=h3(ne),ce=W.widthSizeMode==="random"?Math.max(1,Number(W.widthMin)||0,Number(W.widthMax)||0):Math.max(.001,Number(W.width)||100);let de=re;const X=ne.map(z=>(z&&(de=z),de));for(let z=0;z{const Le=ze==null?void 0:ze.bones[Math.min(ze.bones.length-1,z)];if(!Le)return;const be={x:Le.worldX??Le.x,y:Le.worldY??Le.y,rotation:Le.worldRotation??-Le.rotation};te.push({frame:Ke,values:[be.x,be.y]}),he.push({frame:Ke,values:[be.rotation]}),se.push({frame:Ke,values:[1,Math.max(0,ze.width/ce)*ae]})});const Ee=`${_.name}_trail_${W.id}_${z}`,xe={},fe=Co(te,n,["x","y"],[$v,$v],e,ue,ve),De=Co(he,n,["value"],[Xv],e,ue,ve),Ze=Co(se,n,["x","y"],[dc,dc],e,ue,ve);fe.length&&(xe.translate=fe),De.length&&(xe.rotate=De),Ze.length&&(xe.scale=Ze),Object.keys(xe).length&&(v.bones[Ee]=xe)}const j=ne.map(()=>`trail_${W.id}`);let H=re.colorHex;const G=ne.map(z=>(z&&(H=z.colorHex),Vv(H,z?z.alpha:0)));jv(v,`${_.name}_trail_${W.id}`,j,G,n,e,e.keyframeCurve,ve,S),y=!0}}(y||!e.excludeEmptyAnimations)&&(a.animations[m]=v)}!Object.keys(a.animations).length&&!e.excludeEmptyAnimations&&(a.animations.animation={bones:{},slots:{}});const d=e.spineVersion==="3.8"?qF(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 g3(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 uX{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 v3{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 it=Qi;const Yt=class Yt{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*Yt.degRad)}static sinDeg(e){return Math.sin(e*Yt.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Yt.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 Yt.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(Yt,"epsilon",1e-5),w(Yt,"epsilon2",Yt.epsilon*Yt.epsilon),w(Yt,"PI",3.1415927),w(Yt,"PI2",Yt.PI*2),w(Yt,"invPI2",1/Yt.PI2),w(Yt,"radiansToDegrees",180/Yt.PI),w(Yt,"radDeg",Yt.radiansToDegrees),w(Yt,"degreesToRadians",Yt.PI/180),w(Yt,"degRad",Yt.degreesToRadians);let Ce=Yt;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 Jo=as;class x3 extends Jo{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 dX extends x3{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const sr=class sr{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:sr.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 pX{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=Ve.enumValue(ia,i[1]),h.magFilter=Ve.enumValue(ia,i[2])},n.repeat=h=>{i[1].indexOf("x")!==-1&&(h.uWrap=sa.Repeat),i[1].indexOf("y")!==-1&&(h.vWrap=sa.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 Ew(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 S3(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 S3{constructor(e){w(this,"name");w(this,"minFilter",ia.Nearest);w(this,"magFilter",ia.Nearest);w(this,"uWrap",sa.ClampToEdge);w(this,"vWrap",sa.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 Ew extends Aw{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,y=m.a,x=m.b,T=m.c,A=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 Lo._nextID++}};w(Lo,"_nextID",0);let ra=Lo;var Ti;(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"})(Ti||(Ti={}));const Iw=[Ti.hold,Ti.once,Ti.loop,Ti.pingpong,Ti.onceReverse,Ti.loopReverse,Ti.pingpongReverse];class xp{constructor(e,t,i){w(this,"name");w(this,"timelines",[]);w(this,"timelineIds");w(this,"bones");w(this,"color",new it(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 v3,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 T3(s){return typeof s=="object"&&s!==null&&typeof s.slotIndex=="number"}class po extends Ot{constructor(t,i,...n){super(t,...n);w(this,"curves");this.curves=Ve.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=Ve.newFloatArray(i);Ve.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,y=((c-h)*3-o+d)*.006;let x=m*2+v,T=g*2+y,A=(a-r)*.3+m+v*.16666667,S=(c-o)*.3+g+y*.16666667,b=r+A,_=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 kn extends po{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===$e.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 Vw extends kn{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 Yw 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(y){case 0:{const x=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 T=(i-x)/(d[v+8]-x);f+=(d[v+8+1]-f)*T,p+=(d[v+8+2]-p)*T,m+=(d[v+8+3]-m)*T,g+=(d[v+8+4]-g)*T,l+=(d[v+8+5]-l)*T,h+=(d[v+8+6]-h)*T,u+=(d[v+8+7]-u)*T;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,y-2),p=this.getBezierValue(i,v,2,y+18-2),m=this.getBezierValue(i,v,3,y+36-2),g=this.getBezierValue(i,v,4,y+54-2),l=this.getBezierValue(i,v,5,y+72-2),h=this.getBezierValue(i,v,6,y+90-2),u=this.getBezierValue(i,v,7,y+108-2)}if(n===1)a.set(f,p,m,g);else if(r===$e.setup){const x=e.data.setupPose;let T=x.color;a.set(T.r+(f-T.r)*n,T.g+(p-T.g)*n,T.b+(m-T.b)*n,T.a+(g-T.a)*n),T=x.darkColor,l=T.r+(l-T.r)*n,h=T.g+(h-T.g)*n,u=T.b+(u-T.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 Gw 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 Wa extends Ot{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 y=Ot.search(f,n);g=this.getCurvePercent(n,y),p=this.vertices[y],m=this.vertices[y+1]}const v=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],h,p,m,g,v,o,a,c);for(const y of d)this.applyToSlot(u[y],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=$e.setup),r){case $e.setup:a.length=0;break;case $e.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=Iw[o&15];if(u!==Ti.hold)switch(l+=(n-r)/a+1e-5|0,u){case Ti.once:l=Math.min(h-1,l);break;case Ti.loop:l%=h;break;case Ti.pingpong:{const d=(h<<1)-2;l=d===0?0:l%d,l>=h&&(l=d-l);break}case Ti.onceReverse:l=Math.max(h-1-l,0);break;case Ti.loopReverse:l=h-1-l%h;break;case Ti.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 Ot{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 fl=Eh;const Do=class Do extends Ot{constructor(t){super(t,...Do.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(y){case 0:{const T=f[v];p=f[v+1],m=f[v+2],g=f[v+3];const A=(n-T)/(f[v+4]-T);p+=(f[v+4+1]-p)*A,m+=(f[v+4+2]-m)*A,g+=(f[v+4+3]-g)*A;break}case 1:p=f[v+1],m=f[v+2],g=f[v+3];break;default:p=this.getBezierValue(n,v,1,y-2),m=this.getBezierValue(n,v,2,y+18-2),g=this.getBezierValue(n,v,3,y+36-2)}const x=a===$e.setup?u.data.setupPose:d;c?(d.mixRotate=x.mixRotate+p*o,d.mixX=x.mixX+m*o,d.mixY=x.mixY+g*o):(d.mixRotate=x.mixRotate+(p-x.mixRotate)*o,d.mixX=x.mixX+(m-x.mixX)*o,d.mixY=x.mixY+(g-x.mixY)*o)}}class Tr 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 Zw extends Tr{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 Jw extends Tr{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 Tr{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 eS extends Tr{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 tS extends Tr{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 iS extends Tr{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 sS extends Tr{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 Ot{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[Ot.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 Th=Ih;class nS 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 rS 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 Ka=class Ka{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 A3(this));w(this,"propertyIds",new Map);w(this,"animationsChanged",!1);w(this,"trackEntryPool",new y3(()=>new C3));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,x=l.additive,T=x||l.shortestRotation,A=!T&&l.timelinesRotation.length!==g<<1;A&&(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 B=!m||!(I instanceof gr)||E===$e.current;I.apply(t,T,S,b,k,E,g,B,!1)}}return i.reverse&&r0&&this.queueEvents(i,A),this.events.length=0,i.nextAnimationLast=A,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+ex)return;let a=i=0,A=v>=0;Math.abs(y)<=90&&Ce.signum(y)!==Ce.signum(g)&&(Math.abs(v-x)>180?(m+=360*Ce.signum(v),A=T):x!==0?m-=360*Ce.signum(v):A=T),A!==T&&(m+=360*Ce.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,Ka.emptyAnimation,!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){const n=this.addAnimation(e,Ka.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=E3;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(Ka,"emptyAnimation",new xp("",[],0));let qv=Ka;class C3{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",Jo.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===Jo.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=Jo.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 A3{constructor(e){w(this,"objects",[]);w(this,"drainDisabled",!1);w(this,"animState");this.animState=e}start(e){this.objects.push(zi.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(zi.interrupt),this.objects.push(e)}end(e){this.objects.push(zi.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(zi.dispose),this.objects.push(e)}complete(e){this.objects.push(zi.complete),this.objects.push(e)}event(e,t){this.objects.push(zi.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 Ht;(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"})(Ht||(Ht={}));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",Ht.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)*Ce.degRad,m=(t+90+o)*Ce.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 Ht.Normal:{const d=(t+r)*Ce.degRad,f=(t+90+o)*Ce.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 Ht.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,p=(t+r)*Ce.degRad,m=(t+90+o)*Ce.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 Ht.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>Ce.epsilon2?(g=Math.abs(c*u*m-l*p*h)/g,l=h*g,u=c*g,v=t-Ce.atan2Deg(h,c)):(c=0,h=0,v=t-90+Ce.atan2Deg(u,l));const y=(v+r)*Ce.degRad,x=(v+o+90)*Ce.degRad,T=Math.cos(y)*i,A=Math.cos(x)*n,S=Math.sin(y)*i,b=Math.sin(x)*n;this.a=(c*T-l*S)*d,this.b=(c*A-l*b)*d,this.c=(h*T+u*S)*f,this.d=(h*A+u*b)*f;break}case Ht.NoScale:case Ht.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f,g=t*Ce.degRad,v=Math.cos(g),y=Math.sin(g);let x=(c*v+l*y)*p,T=(h*v+u*y)*m;const A=1/Math.sqrt(x*x+T*T);x*=A,T*=A;let S=-T,b=x;this.inherit===Ht.NoScale&&c*u-l*h<0!=(d<0!=f<0)&&(S=-S,b=-b);const _=r*Ce.degRad,I=(90+o)*Ce.degRad,F=Math.cos(_)*i,E=Math.cos(I)*n,k=Math.sin(_)*i,B=Math.sin(I)*n;this.a=(x*F+S*k)*d,this.b=(x*E+S*B)*d,this.c=(T*F+b*k)*f,this.d=(T*E+b*B)*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,y=1/i;this.x=(this.worldX-e.x)*v,this.y=(this.worldY-e.y)*y,this.set5(this.a*v,this.b*v,this.c*y,this.d*y,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 Ht.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 Ht.OnlyTranslation:{const v=1/t,y=1/i;this.set5(this.a*v,this.b*v,this.c*y,this.d*y,0);break}case Ht.NoRotationOrReflection:{const v=1/t,y=1/i;r*=v,a*=y;const x=this.a*v,T=this.b*v,A=this.c*y,S=this.d*y,b=1/(r*r+a*a),_=1/Math.abs(l*v*y);this.set5((r*x+a*A)*b,(r*T+a*S)*b,(r*A-a*x)*_,(r*S-a*T)*_,Ce.atan2Deg(a,r));break}case Ht.NoScale:case Ht.NoScaleOrReflection:{const v=1/t,y=1/i,x=this.a*v,T=this.b*v,A=this.c*y,S=this.d*y;let b=c*this.a-o*this.c,_=r*this.c-a*this.a;l<0&&(b=-b,_=-_);let I=Ce.atan2Deg(_,b);this.rotation=I,I*=Ce.degRad;const F=Math.cos(I),E=Math.sin(I);let k=(r*F+o*E)*v,B=(a*F+c*E)*y;const N=1/Math.sqrt(k*k+B*B);k*=N,B*=N;const $=this.inherit===Ht.NoScale&&l<0!=(t<0!=i<0)?-1:1;this.set4(k*x+B*A,k*T+B*S,(k*A-B*x)*$,(k*S-B*T)*$)}}}set4(e,t,i,n){const r=e*e+i*i,o=t*t+n*n;r>Ce.epsilon2?(this.shearX=Ce.atan2Deg(i,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Ce.epsilon2?(this.shearY=Ce.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>Ce.epsilon2){const c=Ce.atan2Deg(i,e);this.rotation=c+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Ce.epsilon2?(this.shearY=Ce.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>Ce.epsilon2?Ce.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"?ir.apply1(t,i,n,r,o,a,c,l):ir.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 Ht.OnlyTranslation:g=(n-i.worldX)*Ce.signum(t.scaleX),v=(r-i.worldY)*Ce.signum(t.scaleY);break;case Ht.NoRotationOrReflection:{const y=Math.abs(u*p-d*f)/Math.max(Ce.epsilon,u*u+f*f),x=u/t.scaleX,T=f/t.scaleY;d=-T*y*t.scaleX,p=x*y*t.scaleY,m+=Ce.atan2Deg(T,x)}default:{const y=n-h.worldX,x=r-h.worldY,T=u*p-d*f;Math.abs(T)<=Ce.epsilon?(g=0,v=0):(g=(y*p-x*d)/T-i.x,v=(x*u-y*f)/T-i.y)}}if(m+=Ce.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 Ht.NoScale:case Ht.NoScaleOrReflection:g=n-i.worldX,v=r-i.worldY}const y=i.bone.data.length*i.scaleX;if(y>Ce.epsilon){const x=g*g+v*v;if(o&&xy*y){const T=(Math.sqrt(x)/y-1)*l+1;switch(i.scaleX*=T,c){case $i.Uniform:i.scaleY*=T;break;case $i.Volume:i.scaleY/=T<.7?.25+.642857*T:T}}}}}static apply2(t,i,n,r,o,a,c,l,h,u){if(i.inherit!==Ht.Normal||n.inherit!==Ht.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,y=0,x=0;p<0?(p=-p,v=180,x=-1):(v=0,x=1),m<0&&(m=-m,x=-x),g<0?(g=-g,y=180):y=0;let T=0,A=0,S=i.a,b=i.b,_=i.c,I=i.d;const F=Math.abs(p-m)<=Ce.epsilon;!F||c?(n.y=0,T=S*n.x+i.worldX,A=_*n.x+i.worldY):(T=S*n.x+b*n.y+i.worldX,A=_*n.x+I*n.y+i.worldY);const E=i.bone.parent.appliedPose;S=E.a,b=E.b,_=E.c,I=E.d;let k=S*I-b*_,B=T-E.worldX,N=A-E.worldY;k=Math.abs(k)<=Ce.epsilon?0:1/k;const $=(B*I-N*b)*k-d,L=(N*S-B*_)*k-f;let U=Math.sqrt($*$+L*L),C=n.bone.data.length*g,P,O;if(U0){let re=Math.min(1,ne/(h*2))-1;re=(ne-h*(1-re*re))/q,D-=re*D,V-=re*V,Y=D*D+V*V}}e:if(F){C*=p;let q=(Y-U*U-C*C)/(2*U*C);if(q<-1)q=-1,O=Math.PI*a;else if(q>1){if(q=1,O=0,c)switch(S=(Math.sqrt(Y)/(U+C)-1)*u+1,i.scaleX*=S,l){case $i.Uniform:i.scaleY*=S;break;case $i.Volume:i.scaleY/=S<.7?.25+.642857*S:S}}else O=Math.acos(q)*a;S=U+C*q,b=C*Math.sin(O),P=Math.atan2(V*S-D*b,D*S+V*b)}else{S=p*C,b=m*C;const q=S*S,ne=b*b,re=Math.atan2(V,D);_=ne*U*U+q*Y-q*ne;const me=-2*ne*U,ve=ne-q;if(I=me*me-4*ve*_,I>=0){let he=Math.sqrt(I);me<0&&(he=-he),he=-(me+he)*.5;let se=he/ve,ue=_/he;const ae=Math.abs(se)=0){N=Math.sqrt(se)*a,P=re-Math.atan2(N,ae),O=Math.atan2(N/m,(ae-U)/p);break e}}let ce=Ce.PI,de=U-S,X=de*de,j=0,H=0,G=U+S,z=G*G,te=0;_=-S*U/(q-ne),_>=-1&&_<=1&&(_=Math.acos(_),B=S*Math.cos(_)+U,N=b*Math.sin(_),I=B*B+N*N,Iz&&(H=_,z=I,G=B,te=N)),Y<=(X+z)*.5?(P=re-Math.atan2(j*a,de),O=ce*a):(P=re-Math.atan2(te*a,G),O=H*a)}const W=Math.atan2(n.y,n.x)*x;P=(P-W)*Ce.radDeg+v-i.rotation,P>180?P-=360:P<=-180&&(P+=360),i.rotation+=P*u,O=((O+W)*Ce.radDeg-n.shearX)*x+y-n.rotation,O>180?O-=360:O<=-180&&(O+=360),n.rotation+=O*u}}class Rc extends Al{constructor(t){super(t,new pm);w(this,"bones",[]);w(this,"_target",null);w(this,"_scaleYMode",$i.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 ir(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 Al{constructor(t){super(t,new gm);w(this,"bones",[]);w(this,"_slot",null);w(this,"positionMode",cn.Fixed);w(this,"spacingMode",di.Fixed);w(this,"rotateMode",no.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 cn;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(cn||(cn={}));var di;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(di||(di={}));var no;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(no||(no={}));const Ts=class Ts extends Cl{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 Ts(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.slot.appliedPose.attachment;if(!(n instanceof ml))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===no.Tangent,u=l.rotateMode===no.ChainScale,d=this.bones,f=d.length,p=h?f:f+1,m=Ve.setArraySize(this.spaces,p),g=u?this.lengths=Ve.setArraySize(this.lengths,f):[],v=r.spacing;switch(l.spacingMode){case di.Percent:if(u)for(let b=0,_=p-1;b<_;b++){const I=d[b],F=I.bone.data.length,E=F*I.a,k=F*I.c;g[b]=Math.sqrt(E*E+k*k)}Ve.arrayFill(m,1,p,v);break;case di.Proportional:{let b=0;for(let _=0,I=p-1;_0){b=p/b*v;for(let _=1;_0?Ce.degRad:-Ce.degRad}for(let b=0,_=3;b0){let N=I.a,$=I.b,L=I.c,U=I.d,C=0,P=0,O=0;if(h?C=y[_-1]:m[b+1]===0?C=y[_+2]:C=Math.atan2(B,k),C-=Math.atan2(L,N),S){P=Math.cos(C),O=Math.sin(C);const D=I.bone.data.length;x+=(D*(P*N-O*L)-k)*o,T+=(D*(O*N+P*L)-B)*o}else C+=A;C>Ce.PI?C-=Ce.PI2:C<-Ce.PI&&(C+=Ce.PI2),C*=o,P=Math.cos(C),O=Math.sin(C),I.a=P*N-O*L,I.b=P*$-O*U,I.c=O*N+P*L,I.d=O*$+P*U}}}computeWorldPositions(t,i,n,r){const o=this.slot;let a=this.appliedPose.position,c=this.spaces,l=Ve.setArraySize(this.positions,n*3+2),h=this.world;const u=i.closed;let d=i.worldVerticesLength,f=d/6,p=Ts.NONE;if(!i.constantSpeed){const O=i.lengths;f-=u?1:2;const D=O[f];this.data.positionMode===cn.Percent&&(a*=D);let V;switch(this.data.spacingMode){case di.Percent:V=D;break;case di.Proportional:V=D/n;break;default:V=1}h=Ve.setArraySize(this.world,8);for(let Y=0,W=0,q=0;YD){p!==Ts.AFTER&&(p=Ts.AFTER,i.computeWorldVertices(t,o,d-6,4,h,0,2)),this.addAfterPosition(re-D,h,0,l,W);continue}for(;;q++){const me=O[q];if(!(re>me)){if(q===0)re/=me;else{const ve=O[q-1];re=(re-ve)/(me-ve)}break}}q!==p&&(p=q,u&&q===f?(i.computeWorldVertices(t,o,d-4,4,h,0,2),i.computeWorldVertices(t,o,0,4,h,4,2)):i.computeWorldVertices(t,o,q*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,W,r||Y>0&&ne===0)}return l}u?(d+=2,h=Ve.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=Ve.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d,h,0,2));const m=Ve.setArraySize(this.curves,f);let g=0,v=h[0],y=h[1],x=0,T=0,A=0,S=0,b=0,_=0,I=0,F=0,E=0,k=0,B=0,N=0,$=0,L=0;for(let O=0,D=2;Og){this.addAfterPosition(q-g,h,d-4,l,D);continue}for(;;V++){const ne=m[V];if(!(q>ne)){if(V===0)q/=ne;else{const re=m[V-1];q=(q-re)/(ne-re)}break}}if(V!==p){p=V;let ne=V*6;for(v=h[ne],y=h[ne+1],x=h[ne+2],T=h[ne+3],A=h[ne+4],S=h[ne+5],b=h[ne+6],_=h[ne+7],I=(v-x*2+A)*.03,F=(y-T*2+S)*.03,E=((x-A)*3-v+b)*.006,k=((T-S)*3-y+_)*.006,B=I*2+E,N=F*2+k,$=(x-v)*.3+I+E*.16666667,L=(T-y)*.3+F+k*.16666667,P=Math.sqrt($*$+L*L),C[0]=P,ne=1;ne<8;ne++)$+=B,L+=N,B+=E,N+=k,P+=Math.sqrt($*$+L*L),C[ne]=P;$+=B,L+=N,P+=Math.sqrt($*$+L*L),C[8]=P,$+=B+E,L+=N+k,P+=Math.sqrt($*$+L*L),C[9]=P,Y=0}for(q*=P;;Y++){const ne=C[Y];if(!(q>ne)){if(Y===0)q/=ne;else{const re=C[Y-1];q=Y+(q-re)/(ne-re)}break}}this.addCurvePosition(q*.1,v,y,x,T,A,S,b,_,l,D,r||O>0&&W===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,y=v*g,x=g*t,T=x*3,A=g*T,S=T*t,b=i*y+r*A+a*S+l*m,_=n*y+o*A+c*S+h*m;u[d]=b,u[d+1]=_,f&&(t<.001?u[d+2]=Math.atan2(o-n,r-i):u[d+2]=Math.atan2(_-(n*v+o*x*2+c*p),b-(i*v+r*x*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!==Gr.none){switch(h.modifyWorld(t),i){case Gr.reset:this.reset(t);case Gr.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 y=this.remaining,x=n.inertia,T=t.data.referenceScale,A=-1,S=0,b=0,_=this.data.limit*p,I=_*Math.abs(t.scaleY);if(_*=Math.abs(t.scaleX),o||a){if(o){const F=(this.ux-g)*x;this.xOffset+=F>_?_:F<-_?-_:F,this.ux=g}if(a){const F=(this.uy-v)*x;this.yOffset+=F>I?I:F<-I?-I:F,this.uy=v}if(y>=d){const F=this.xOffset,E=this.yOffset;A=n.damping**(60*d),S=d*n.massInverse,b=n.strength;const k=T*n.wind,B=T*n.gravity,N=(k*t.windX+B*t.gravityX)*t.scaleX,$=(k*t.windY+B*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=(N-this.xOffset*b)*S,this.xOffset+=this.xVelocity*d,this.xVelocity*=A),a&&(this.yVelocity-=($+this.yOffset*b)*S,this.yOffset+=this.yVelocity*d,this.yVelocity*=A),y-=d;while(y>=d);this.xLag=this.xOffset-F,this.yLag=this.yOffset-E}f=Math.max(0,1-y/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,B=0,N=this.cx-h.worldX,$=this.cy-h.worldY;if(N>_?N=_:N<-_&&(N=-_),$>I?$=I:$<-I&&($=-I),y=this.remaining,c){B=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-m/d);let L=Math.atan2($+this.ty,N+this.tx)-F-(this.rotateOffset-f)*B;this.rotateOffset+=(L-Math.ceil(L*Ce.invPI2-.5)*Ce.PI2)*x,L=(this.rotateOffset-f)*B+F,E=Math.cos(L),k=Math.sin(L),l&&(L=u*h.getWorldScaleX(),L>0&&(this.scaleOffset+=(N*E+$*k)*x/L))}else{E=Math.cos(F),k=Math.sin(F);const L=u*h.getWorldScaleX()-this.scaleLag*Math.max(0,1-m/d);L>0&&(this.scaleOffset+=(N*E+$*k)*x/L)}if(y>=d){A===-1&&(A=n.damping**(60*d),S=d*n.massInverse,b=n.strength);const L=n.wind*t.windX+n.gravity*t.gravityX,U=(n.wind*t.windY+n.gravity*t.gravityY)*bm.yDir,C=this.rotateOffset,P=this.scaleOffset,O=u/T;for(;;)if(y-=d,l&&(this.scaleVelocity+=(L*E-U*k-this.scaleOffset*b)*S,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=A),c){if(this.rotateVelocity-=((L*k+U*E)*O+this.rotateOffset*b)*S,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=A,y0){let y=0;this.data.rotate>0&&(y=p*this.data.rotate,m=Math.sin(y),g=Math.cos(y),v=h.b,h.b=g*v-m*h.d,h.d=m*v+g*h.d),y+=p*this.data.shearX,m=Math.sin(y),g=Math.cos(y),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 $i.Uniform:h.b*=p,h.d*=p;break;case $i.Volume:p=Math.abs(p),p=p>=.7?1/p:4-3.67347*p,h.b*=p,h.d*=p}}i!==Gr.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 Al{constructor(t){super(t,new xm);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",$i.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 Za=class Za extends Cl{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 Za(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,Za.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 Mh;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(Mh||(Mh={}));class Mm{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 _p extends Cl{constructor(t,i){super(t,new Mm,new Mm);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 _p(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[bt.ROTATION]:-n[bt.ROTATION]);return a<0&&(a+=360),a}}class uS extends da{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*=Ce.degRad,o||(n-=Math.atan2(f,u)),n>Ce.PI?n-=Ce.PI2:n<-Ce.PI&&(n+=Ce.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 ua{value(e,t,i,n){return i?t.x+n[bt.X]:(n[bt.X]*t.a+n[bt.Y]*t.b+t.worldX)/e.scaleX}}class dS extends da{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 ua{value(e,t,i,n){return i?t.y+n[bt.Y]:(n[bt.X]*t.c+n[bt.Y]*t.d+t.worldY)/e.scaleY}}class fS extends da{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 ua{value(e,t,i,n){if(i)return t.scaleX+n[bt.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+n[bt.SCALEX]}}class mS extends da{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 ua{value(e,t,i,n){if(i)return t.scaleY+n[bt.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+n[bt.SCALEY]}}class pS extends da{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 ua{value(e,t,i,n){if(i)return t.shearY+n[bt.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))*Ce.radDeg-90+n[bt.SHEARY]}}class gS extends da{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)*Ce.degRad,o?n-=Ce.PI/2:(n-=u-Math.atan2(i.c/c,i.a/a),n>Ce.PI?n-=Ce.PI2:n<-Ce.PI&&(n+=Ce.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 wX{constructor(e){w(this,"scale",1);w(this,"attachmentLoader");w(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new cS;i.name="";const n=new R3(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 T=0,A;T>1&1,v.spacingMode=y>>2&3,v.rotateMode=y>>4&3,(y&128)!==0&&(v.offsetRotation=n.readFloat());const x=v.setupPose;x.position=n.readFloat(),v.positionMode===cn.Fixed&&(x.position*=t),x.spacing=n.readFloat(),(v.spacingMode===di.Length||v.spacingMode===di.Fixed)&&(x.spacing*=t),x.mixRotate=n.readFloat(),x.mixX=n.readFloat(),x.mixY=n.readFloat(),h.push(v);break}case eO:{const v=new kc(m);v.bone=l[n.readInt(!0)];let y=n.readByte();if(v.skinRequired=(y&1)!==0,(y&2)!==0&&(v.x=n.readFloat()),(y&4)!==0&&(v.y=n.readFloat()),(y&8)!==0&&(v.rotate=n.readFloat()),(y&16)!==0){let T=n.readFloat();T<-2?(v.scaleYMode=$i.Volume,T=-2-T):T<0&&(v.scaleYMode=$i.Uniform,T=-1-T),v.scaleX=T}(y&32)!==0&&(v.shearX=n.readFloat()),v.limit=((y&64)!==0?n.readFloat():5e3)*t,v.step=1/n.readUnsignedByte();const x=v.setupPose;x.inertia=n.readFloat(),x.strength=n.readFloat(),x.damping=n.readFloat(),x.massInverse=(y&128)!==0?n.readFloat():1,x.wind=n.readFloat(),x.gravity=n.readFloat(),y=n.readByte(),(y&1)!==0&&(v.inertiaGlobal=!0),(y&2)!==0&&(v.strengthGlobal=!0),(y&4)!==0&&(v.dampingGlobal=!0),(y&8)!==0&&(v.massGlobal=!0),(y&16)!==0&&(v.windGlobal=!0),(y&32)!==0&&(v.gravityGlobal=!0),(y&64)!==0&&(v.mixGlobal=!0),x.mix=(y&128)!==0?n.readFloat():1,h.push(v);break}case tO:{const v=new jr(m),y=n.readByte();if(v.skinRequired=(y&1)!==0,v.loop=(y&2)!==0,v.additive=(y&4)!==0,(y&8)!==0){const x=n.readFloat();a&&(y&64)!==0?v.max=x:v.setupPose.time=x}if((y&16)!==0&&(v.setupPose.mix=(y&32)!==0?n.readFloat():1),(y&64)!==0){v.local=(y&128)!==0,v.bone=l[n.readInt(!0)];const x=n.readFloat();let T=1;switch(n.readByte()){case 0:v.property=new _m;break;case 1:{T=t,v.property=new Cm;break}case 2:{T=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=x*T,v.offset=n.readFloat(),v.scale=n.readFloat()/T}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(Ve.setArraySize(i.skins,c=p+n.readInt(!0));p0){y=[];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 gr(c);for(let p=0;p0){const f=new fl(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 P3=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 ix{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 wn;(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"})(wn||(wn={}));function ii(s,e,t,i){t instanceof kn?k3(s,e,t,i):F3(s,e,t,i)}function k3(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 Ws:t.setStepped(o);break;case zs:dt(s,t,a++,o,0,n,l,r,h,i)}n=l,r=h}e.push(t)}function F3(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 Ws:t.setStepped(a);break;case zs:dt(s,t,c++,a,0,n,h,r,u,i),dt(s,t,c++,a,1,n,h,o,d,i)}n=h,r=u,o=d}e.push(t)}function sx(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 dt(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 O3=0,B3=1,L3=2,D3=3,N3=4,U3=5,$3=6,X3=7,V3=8,Y3=9,G3=10,H3=0,j3=1,W3=2,z3=3,q3=4,K3=5,Z3=0,J3=1,Q3=2,eO=3,tO=4,iO=0,sO=1,nO=0,rO=1,oO=2,aO=0,lO=1,cO=2,hO=4,uO=5,dO=6,fO=7,mO=8,pO=0,gO=1,Ws=1,zs=2;class vO{constructor(e){w(this,"attachmentLoader");w(this,"scale",1);w(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new cS,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[bt.ROTATION]=Z(o,"rotation",0),l.offsets[bt.X]=Z(o,"x",0)*t,l.offsets[bt.Y]=Z(o,"y",0)*t,l.offsets[bt.SCALEX]=Z(o,"scaleX",0),l.offsets[bt.SCALEY]=Z(o,"scaleY",0),l.offsets[bt.SHEARY]=Z(o,"shearY",0);const x=l.setupPose;d&&(x.mixRotate=Z(o,"mixRotate",1)),f&&(x.mixX=Z(o,"mixX",1)),p&&(x.mixY=Z(o,"mixY",x.mixX)),m&&(x.mixScaleX=Z(o,"mixScaleX",1)),g&&(x.mixScaleY=Z(o,"mixScaleY",x.mixScaleX)),v&&(x.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 y=new Th(m,u);for(let x=0;p!=null;p=f[x+1],x++)y.setFrame(x,Z(p,"time",0));r.push(y);continue}switch(d){case"inertia":g=new Zw(m,m,u);break;case"strength":g=new Jw(m,m,u);break;case"damping":g=new Qw(m,m,u);break;case"mass":g=new eS(m,m,u);break;case"wind":g=new tS(m,m,u);break;case"gravity":g=new iS(m,m,u);break;case"mix":{v=1,g=new sS(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,jr);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 nS(g,g,d),1,1);break;case"mix":Zi(r,p,new rS(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],y=u.getAttachment(m,g);if(!y)throw new Error(`Timeline attachment not found: ${g}`);for(const x in v){const T=v[x];let A=T[0];if(A){if(x==="deform"){const S=y.bones,b=y.vertices,_=S?b.length/3*2:b.length,I=new Hw(T.length,T.length,m,y);let F=Z(A,"time",0);for(let E=0,k=0;;E++){let B;const N=Z(A,"vertices",null);if(!N)B=S?Ve.newFloatArray(_):b;else{B=Ve.newFloatArray(_);const C=Z(A,"offset",0);if(Ve.arrayCopy(N,0,B,C,N.length),n!==1)for(let P=C,O=P+N.length;P=0;l--)r[l]===-1&&(r[l]=o[--c]);return r}function pt(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 yO{newRegionAttachment(e,t,i,n){return new ru(t,i)}newMeshAttachment(e,t,i,n){return new Ml(t,i)}newBoundingBoxAttachment(e,t){return new Y1(t)}newPathAttachment(e,t){return new dl(t)}newPointAttachment(e,t){return new q1(t)}newClippingAttachment(e,t){return new Ko(t)}}class bO{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 TO(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&&!wO.has(l.inherit))throw new Error(`骨骼“${l.name||""}”的 inherit 值“${l.inherit}”不符合 Spine ${e} JSON 格式`);if(/_trail_\d+_\d+$/.test(String(l.name||""))){const h=i.get(String(l.parent||""));if(!h||/_trail_\d+_\d+$/.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"&&(SO(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 MO(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 rx(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}`);TO(t,i),i==="3.8"&&MO(t);const n=i==="3.8"?lw(JSON.parse(JSON.stringify(t))):t,r=i==="4.3"?new vO(new bO).readSkeletonData(n):new fh(new yO).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 vS="http://127.0.0.1:27843";class _h 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 _O(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 CO(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}${_O(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 AO(){try{const s=await fetch(`${vS}/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 EO(s,e){const t=await xS(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",`${vS}/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 _h("未检测到本地 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 _h(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 IO(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 RO=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 PO(s){let e=4294967295;for(const t of s)e=RO[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function kO(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 FO(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 ox(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 OO(s){const e=new TextEncoder,t=[],i=[],n=FO();let r=0;for(const c of s){const l=e.encode(kO(c.name)),h=PO(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=ox(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([ox([...t,o,a.bytes])],{type:"application/zip"})}function BO(s){const e=atob(s),t=new Uint8Array(e.length);for(let i=0;ii===".."||/^[a-z]+:/i.test(i))?"images":t.join("/")}function DO(s){return String(s||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function NO(s){const e=await xS(s.systems);if(!e.length)throw new Error("当前可见粒子系统没有可导出的图片");const t=LO(s.imagesPath);return{blob:OO(e.map(n=>({name:`${t}/${n.path}`,data:BO(n.dataBase64)}))),imageCount:e.length,folder:t}}function UO(s,e){const t=`${DO(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 $O(s){s.settings.exportSettings=n1(s.settings.exportSettings);const e=qe(()=>s.settings.exportSettings),t=Ye(!1),i=Ye(null),n=Ye(""),r=Ye(!1),o=Ye(null),a=Ye(""),c=Ye(""),l=qe(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"连接器可用 · Spine 已就绪":"连接器已启动,当前网站尚未授权":"连接器已启动,但未找到 Spine":"本地 Spine 连接器未启动":"正在检测本地 Spine 连接器…"}),h=qe(()=>{var b,_,I,F,E,k;return{ready:!!((b=o.value)!=null&&b.available)&&!!((_=o.value)!=null&&_.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,_,I;return!!((b=o.value)!=null&&b.available)&&!!((_=o.value)!=null&&_.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} 工程`);jn(()=>{v(),m=window.setInterval(v,3e3)});let m,g=0;vl(()=>{m!==void 0&&window.clearInterval(m)});async function v(){const b=++g,_=await AO();if(b!==g)return;o.value=_;const I=c.value;(I==="CONNECTOR_OFFLINE"?_.available:I==="SPINE_NOT_FOUND"?_.available&&_.spineFound:I==="ORIGIN_NOT_ALLOWED"?_.available&&_.spineFound&&_.authorized:!!I&&_.available&&_.spineFound&&_.authorized)&&(c.value="",a.value="",r.value&&(r.value=!1,n.value=""))}function y(){return new Promise(b=>requestAnimationFrame(()=>b()))}async function x(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 y(),s.timeline.playing=!0;const _=s.timeline.totalFrames/Math.max(1,s.timeline.fps)*1e3,I=performance.now()+Math.max(8e3,_*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 T(){if(!t.value){t.value=!0,i.value="json",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";try{await x();const b=Wv({systems:s.systems,timeline:s.timeline,settings:e.value});rx(b.text,e.value.spineVersion),g3(b,e.value.fileName);const _=b.warnings.length?`;${b.warnings.length} 条资源提示(缺图仍已导出)`:"";n.value=`已导出 Spine ${e.value.spineVersion}:${b.particleSystemCount} 个粒子系统、${b.animationCount} 个动画、${b.boneCount} 根骨骼${_}`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,i.value=null}}}async function A(){if(t.value)return;t.value=!0,i.value="spine",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";const b=Sw("导出 Spine 包","正在重新计算粒子动画…");try{await b.paint(),await x(E=>b.update(E*18,"正在重新计算粒子动画…")),b.update(20,"正在生成 Spine JSON…");const _=Wv({systems:s.systems,timeline:s.timeline,settings:e.value});rx(_.text,e.value.spineVersion),n.value="正在整理图片并调用本机 Spine…";const I=e.value.fileName.replace(/\.json$/i,"")||"SpineParticle",F=await EO({projectName:I,spineVersion:e.value.spineVersion,skeletonJson:_.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,"正在交给浏览器下载…"),IO(F.blob,F.fileName),n.value=`已生成 ${F.fileName}:包含 .spine 工程和 ${F.imageCount} 张图片,Spine ${F.spineEditorVersion}`,await v(),await b.finish("Spine 工程包已开始下载")}catch(_){const I=_ instanceof Error?_.message:String(_);r.value=!0,c.value=_ instanceof _h?_.code:"",_ instanceof _h&&_.pairUrl&&(a.value=_.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 NO({systems:s.systems,imagesPath:e.value.imagesPath}),_=UO(b.blob,e.value.fileName);n.value=`已生成 ${_}:${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:y,prepareExportFrames:x,exportSpineJson:T,exportSpineProject:A,exportSpineImages:S}}function XO(s){const e=Ye(null),t=Ye(""),i=Ye([]),n=Ye(!1),r=Ye(""),o=Ye(!1);function a(){mw(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 ik(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=Sw("加载预设",`正在下载 ${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 XF(f,m=>{d.update(m==null?null:m*55,`正在下载 ${u}…`)});d.update(58,"正在解析预设配置…"),d.update(70,"正在解析并恢复预设资源…"),await gw(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 jn(l),{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h}}function VO(s){const e=Ye(null),t=Ye(null),i=Ye(null),n=Ye(null),r=Ye(null);function o(){var D;const P=(D=s.value)==null?void 0:D.config;if(!P)return;const O=Math.max(0,...P.trailResources.map(V=>V.id))+1;P.trailResources.push({id:O,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(V=>({...V})),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(V=>({...V})),shapeEnabled:!1,shapeCurve:dm.map(V=>({...V}))}),p()}function a(P){var O;r.value=P,(O=n.value)==null||O.click()}function c(P,O){var Y;const D=(Y=s.value)==null?void 0:Y.config;if(!D)return;const V=P==="trailGridCols"?32:16;D[P]=Math.min(V,Math.max(2,Math.round(Number(O)||2)))}function l(P,O){var V;const D=(V=s.value)==null?void 0:V.config.trailResources.find(Y=>Y.id===P);D&&(D.boneCount=Math.min(16,Math.max(2,Math.round(Number(O)||2))))}function h(P,O){var V;const D=(V=s.value)==null?void 0:V.config.trailResources.find(Y=>Y.id===P);D&&(D.rotation=Math.max(-360,Math.min(360,Number(O)||0)))}async function u(P){var q,ne;const O=P.target,D=(q=O.files)==null?void 0:q[0],V=(ne=s.value)==null?void 0:ne.config,Y=V==null?void 0:V.trailResources.find(re=>re.id===r.value);if(!D||!Y){O.value="";return}const W=await _(D);Y.texture=lr(await We.fromURL(W)),Y.previewUrl=W,Y.textureName=D.name.replace(/\.[^.]+$/,"")||"trail",O.value="",r.value=null}async function d(P){var V;const O=(V=s.value)==null?void 0:V.config,D=O==null?void 0:O.trailResources.find(Y=>Y.id===P);D&&(D.texture=lr(await We.fromURL("/images/trail.png")),D.previewUrl="/images/trail.png",D.textureName="trail",D.weight=100,D.locked=!1,D.rotation=0,D.boneCount=3,D.trailRatio=100,D.lengthMode="fixed",D.length=100,D.lengthMin=100,D.lengthMax=100,D.widthSizeMode="fixed",D.width=100,D.widthMin=100,D.widthMax=100,D.widthMode="particle",D.lifeLengthEnabled=!1,D.lifeLengthCurve=cm.map(Y=>({...Y})),D.shapeEnabled=!1,D.shapeCurve=dm.map(Y=>({...Y})),D.colorMode="particle",D.color="#ffffff",D.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],D.blend="normal",D.alphaMode="particle",D.alpha=1,D.alphaCurve=um.map(Y=>({...Y})),p())}function f(P){var V;const O=(V=s.value)==null?void 0:V.config.trailResources;if(!O||O.length<=1)return;const D=O.findIndex(Y=>Y.id===P);D>=0&&O.splice(D,1),p()}function p(){var Y;const P=(Y=s.value)==null?void 0:Y.config.trailResources;if(!(P!=null&&P.length))return;if(P.length===1){P[0].weight=100,P[0].locked=!1;return}const O=P.filter(W=>W.locked),D=P.filter(W=>!W.locked);let V=O.reduce((W,q)=>W+Math.max(0,Number(q.weight)||0),0);V>100&&($(O,100,!0),V=100),$(D,100-V)}function m(P,O){var ne;const D=(ne=s.value)==null?void 0:ne.config.trailResources;if(!(D!=null&&D.length))return;if(D.length===1){D[0].weight=100,D[0].locked=!1;return}const V=D.find(re=>re.id===P);if(!V||V.locked)return;const Y=D.filter(re=>re.id!==P&&re.locked).reduce((re,me)=>re+Math.max(0,Number(me.weight)||0),0),W=Math.max(0,100-Y),q=D.filter(re=>re.id!==P&&!re.locked);V.weight=N(Math.min(W,Math.max(0,Number(O)||0))),q.length?$(q,W-V.weight,!0):V.weight=N(W)}function g(P){var V;const O=(V=s.value)==null?void 0:V.config.trailResources;if(!O||O.length===1)return;const D=O.find(Y=>Y.id===P);D&&(D.locked=!D.locked)}function v(P,O){const D=O.target;P.color=F(D.value,P.color),D.value=P.color}function y(P,O){v(P,O),O.target.blur()}function x(){var D;const P=(D=s.value)==null?void 0:D.config;if(!P)return;const O=Math.max(0,...P.imageResources.map(V=>V.id))+1;P.imageResources.push({id:O,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(V=>({...V}))}),L()}function T(P){var O;i.value=P,(O=e.value)==null||O.click()}function A(P){var O;i.value=P,(O=t.value)==null||O.click()}async function S(P){var ne,re;const O=P.target,D=(ne=O.files)==null?void 0:ne[0],V=(re=s.value)==null?void 0:re.config,Y=V==null?void 0:V.imageResources.find(me=>me.id===i.value);if(!D||!Y){O.value="";return}const W=await _(D),q=lr(await We.fromURL(W));Y.texture=q,Y.previewUrl=W,Y.textureFolder="",Y.textureName=D.name.replace(/\.[^.]+$/,"")||"particle",O.value="",i.value=null}async function b(P){var W;const O=P.target,D=Array.from(O.files||[]).sort((q,ne)=>q.name.localeCompare(ne.name,void 0,{numeric:!0,sensitivity:"base"})),V=(W=s.value)==null?void 0:W.config,Y=V==null?void 0:V.imageResources.find(q=>q.id===i.value);if(!D.length||!Y){O.value="";return}Y.sequenceFrames=await Promise.all(D.map(async q=>{const ne=await _(q);return{name:q.name,previewUrl:ne,texture:lr(await We.fromURL(ne))}})),Y.imageMode="sequence",O.value="",i.value=null}function _(P){return new Promise((O,D)=>{const V=new FileReader;V.onload=()=>O(String(V.result||"")),V.onerror=()=>D(V.error),V.readAsDataURL(P)})}function I(P){var V;const O=(V=s.value)==null?void 0:V.config,D=O==null?void 0:O.imageResources.find(Y=>Y.id===P);!O||!D||(D.texture=O.texture,D.textureName="star",D.textureFolder="",D.previewUrl="/images/star.png",D.imageMode="fixed",D.sequencePlayback="loop-forward",D.sequenceFps=30,D.sequenceFrames=[],D.scale=1,D.anchorX=.5,D.anchorY=.5,D.colorMode="fixed",D.colorStart="#ffffff",D.colorEnd="#ff4d4d",D.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],D.blend="normal",D.independentAlpha="off",D.alpha=1,D.alphaCurveMode="跟随导出",D.alphaCurve=hm.map(Y=>({...Y})),D.locked=!1,L())}function F(P,O){let D=P.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(D)&&(D=D.split("").map(V=>V+V).join("")),/^[0-9a-f]{6}$/i.test(D)?`#${D.toLowerCase()}`:O}function E(P,O){const D=O.target;P.colorStart=F(D.value,P.colorStart),D.value=P.colorStart}function k(P,O){E(P,O),O.target.blur()}function B(P){var V;const O=(V=s.value)==null?void 0:V.config.imageResources;if(!O||O.length<=1)return;const D=O.findIndex(Y=>Y.id===P);D>=0&&O.splice(D,1),L()}function N(P){return Math.round(P)}function $(P,O,D=!1){if(!P.length)return;const V=Math.max(0,N(O)),Y=D?P.reduce((q,ne)=>q+Math.max(0,Number(ne.weight)||0),0):0;let W=0;P.forEach((q,ne)=>{const re=ne===P.length-1,me=N(re?V-W:Y>0?V*Math.max(0,Number(q.weight)||0)/Y:V/P.length);q.weight=me,W+=me})}function L(){var Y;const P=(Y=s.value)==null?void 0:Y.config.imageResources;if(!(P!=null&&P.length))return;if(P.length===1){P[0].weight=100,P[0].locked=!1;return}const O=P.filter(W=>W.locked),D=P.filter(W=>!W.locked);let V=O.reduce((W,q)=>W+Math.max(0,Number(q.weight)||0),0);V>100&&($(O,100,!0),V=100),$(D,100-V)}function U(P,O){var ne;const D=(ne=s.value)==null?void 0:ne.config.imageResources;if(!(D!=null&&D.length))return;if(D.length===1){D[0].weight=100,D[0].locked=!1;return}const V=D.find(re=>re.id===P);if(!V||V.locked)return;const Y=D.filter(re=>re.id!==P&&re.locked).reduce((re,me)=>re+Math.max(0,Number(me.weight)||0),0),W=Math.max(0,100-Y),q=D.filter(re=>re.id!==P&&!re.locked);if(V.weight=N(Math.min(W,Math.max(0,Number(O)||0))),!q.length){V.weight=N(W);return}$(q,W-V.weight,!0)}function C(P){var V;const O=(V=s.value)==null?void 0:V.config.imageResources;if(!O||O.length===1)return;const D=O.find(Y=>Y.id===P);D&&(D.locked=!D.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:y,addImageResource:x,openTexturePicker:T,openSequencePicker:A,onTextureFile:S,onSequenceFiles:b,readFileAsDataUrl:_,resetTexture:I,normalizeHex:F,setResourceFixedColor:E,commitResourceFixedColor:k,removeImageResource:B,roundWeight:N,distributeImageWeights:$,rebalanceImageWeights:L,setResourceWeight:U,toggleResourceLock:C}}function YO(){const s=fo(),{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}=$O(s),{configFileInput:v,selectedPreset:y,presetOptions:x,presetLoading:T,configMessage:A,configError:S,saveConfig:b,onConfigFileChange:_,refreshPresets:I,loadSelectedPreset:F}=XO(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(pe=>pe.id===s.activeId);return ee>=0?ee:0}),B=qe(()=>s.systems[k.value]||null),{textureFileInput:N,sequenceFileInput:$,trailTextureFileInput:L,addTrailResource:U,openTrailTexturePicker:C,onTrailRigChange:P,onTrailResourceBoneCountChange:O,onTrailResourceRotationChange:D,onTrailTextureFile:V,resetTrailTexture:Y,removeTrailResource:W,setTrailResourceWeight:q,toggleTrailResourceLock:ne,setTrailColor:re,commitTrailColor:me,addImageResource:ve,openTexturePicker:ce,openSequencePicker:de,onTextureFile:X,onSequenceFiles:j,resetTexture:H,setResourceFixedColor:G,commitResourceFixedColor:z,removeImageResource:te,setResourceWeight:he,toggleResourceLock:se}=VO(B),ue=qe(()=>B.value?r1(B.value.config,s.timeline.fps):30),ae=qe(()=>{var pe;const ee=(pe=B.value)==null?void 0:pe.config;return ee?Math.max(1,Math.ceil(Number(ee.loopDurationFrames)||1)):1}),Ee=qe(()=>s.activeObjectType),xe=qe(()=>s.activeObjectType==="collision"&&s.colliders.find(ee=>ee.id===s.activeObjectId)||null),fe=qe(()=>s.activeObjectType==="path"&&s.paths.find(ee=>ee.id===s.activeObjectId)||null),De=qe(()=>s.activeObjectType==="spine"&&s.spines.find(ee=>ee.id===s.activeObjectId)||null),Ze=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)),ze=qe(()=>{const ee=s.spines.find(pe=>pe.selectedBone&&pe.bones.some(_e=>_e.name===pe.selectedBone));return ee?{spine:ee,boneName:ee.selectedBone}:null}),Ke=qe(()=>{var _e;const ee=(_e=B.value)==null?void 0:_e.config;if(!ee||ee.emitterFollowMode!=="bone")return null;const pe=s.spines.find(wt=>wt.id===ee.emitterFollowSpineId);return!pe||!pe.bones.some(wt=>wt.name===ee.emitterFollowBoneName)?null:{spine:pe,boneName:ee.emitterFollowBoneName}}),Le=Ye(!1),be=qe(()=>{var pe;const ee=new Set(((pe=B.value)==null?void 0:pe.config.collisionColliderIds)||[]);return s.colliders.filter(_e=>ee.has(_e.id))}),at=qe(()=>{var pe;const ee=new Set(((pe=B.value)==null?void 0:pe.config.collisionColliderIds)||[]);return s.colliders.filter(_e=>!ee.has(_e.id))});Yi(()=>{var ee,pe;return[(ee=B.value)==null?void 0:ee.id,(pe=B.value)==null?void 0:pe.config.collision]},()=>{Le.value=!1});function we(ee){var _e;const pe=(_e=B.value)==null?void 0:_e.config;!pe||pe.collisionColliderIds.includes(ee)||(pe.collisionColliderIds.push(ee),Le.value=!1)}function mi(ee){var _e;const pe=(_e=B.value)==null?void 0:_e.config;pe&&(pe.collisionColliderIds=pe.collisionColliderIds.filter(wt=>wt!==ee))}Aa(()=>{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)}),Aa(()=>{if(!B.value)return;const ee=yr(B.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")&<(ee)}),Aa(()=>{const ee=new Set(s.colliders.map(pe=>pe.id));for(const pe of s.systems){const _e=yr(pe.config),wt=_e.collisionColliderIds.filter(Cr=>ee.has(Cr));if(wt.length!==_e.collisionColliderIds.length&&(_e.collisionColliderIds=wt),_e.spawnPathId>0&&!s.paths.some(Cr=>Cr.id===_e.spawnPathId)&&(_e.spawnPathId=0,(_e.emissionAngleMode==="path-normal"||_e.emissionAngleMode==="path-tangent")&&(_e.emissionAngleMode="fixed")),_e.emitterFollowMode!=="bone")continue;const Bt=s.spines.find(Cr=>Cr.id===_e.emitterFollowSpineId);!!(Bt!=null&&Bt.bones.some(Cr=>Cr.name===_e.emitterFollowBoneName))||(_e.emitterFollowMode="none",_e.emitterFollowSpineId=0,_e.emitterFollowBoneName="")}}),Aa(()=>{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 Rt=co({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function vt(ee){Rt[ee]=!Rt[ee]}function ie(ee){var _e;const pe=(_e=B.value)==null?void 0:_e.config;pe&&(pe.mode=ee,ee==="stream"&&!(pe.duration>0)&&(pe.duration=1))}function oe(ee){var wt;const pe=(wt=B.value)==null?void 0:wt.config;if(!pe)return;const _e=Math.min(1800,Math.max(1,Math.ceil(Number(ee)||1)));pe.loopDurationFrames=_e}function lt(ee){const pe=ul();ee.emitterFollow=!1,ee.emitterFollowMode="none",ee.emitterFollowPathId=pe.emitterFollowPathId,ee.emitterFollowSpineId=pe.emitterFollowSpineId,ee.emitterFollowBoneName=pe.emitterFollowBoneName,ee.emitterFollowBoneOffsetX=pe.emitterFollowBoneOffsetX,ee.emitterFollowBoneOffsetY=pe.emitterFollowBoneOffsetY,ee.emitterFollowBoneRotation=pe.emitterFollowBoneRotation,ee.emitterFollowBoneScaleX=pe.emitterFollowBoneScaleX,ee.emitterFollowBoneScaleY=pe.emitterFollowBoneScaleY,ee.emitterAngleMode=pe.emitterAngleMode,ee.emitterFollowCurve=pe.emitterFollowCurve.map(_e=>({..._e})),ee.emitterFollowDuration=pe.emitterFollowDuration,ee.emitterFollowSpace=pe.emitterFollowSpace,ee.emitterFollowDirection=pe.emitterFollowDirection,ee.emitterFollowOffset=pe.emitterFollowOffset}function _t(ee){var Bt;const pe=(Bt=B.value)==null?void 0:Bt.config;if(!pe||pe.streamBehavior===ee)return;const _e=ee==="loop",wt=_e?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(wt)&&(lt(pe),pe.streamBehavior=ee,_e||(pe.generateLoopStartAnimation=!1,pe.generateLoopEndAnimation=!1))}function Ct(ee,pe){var Bt;const _e=(Bt=B.value)==null?void 0:Bt.config;if(!_e)return;const wt=pe.target.checked;ee==="start"?_e.generateLoopStartAnimation=wt:_e.generateLoopEndAnimation=wt}function et(ee,pe){var Bt;const _e=(Bt=B.value)==null?void 0:Bt.config;if(!_e)return;const wt=Math.min(1800,Math.max(1,Math.ceil(Number(pe.target.value)||30)));ee==="start"?_e.loopStartDurationFrames=wt:_e.loopEndDurationFrames=wt}function rs(ee,pe){var Bt;const _e=(Bt=B.value)==null?void 0:Bt.config;if(!_e)return;const wt=pe.target.checked;ee==="start"?_e.loopStartUseCustomDuration=wt:_e.loopEndUseCustomDuration=wt}function ni(ee,pe){const _e=ee.target.value;if(pe.emitterFollowMode=_e,_e!=="bone"){pe.emitterFollowSpineId=0,pe.emitterFollowBoneName="";return}Kt(pe)}function Kt(ee){const pe=ze.value;if(!pe){ee.emitterFollowMode="none",ee.emitterFollowSpineId=0,ee.emitterFollowBoneName="";return}ee.emitterFollowMode="bone",ee.emitterFollowSpineId=pe.spine.id,ee.emitterFollowBoneName=pe.boneName}const At={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","showShape","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","showForceFieldShape","vortex","vortexStrength","vortexRadius","vortexCenterX","vortexCenterY","vortexFalloff","showVortexShape","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","showAttractionShape","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 wt;const pe=(wt=B.value)==null?void 0:wt.config;if(ee==="export"){s.settings.exportSettings=ap();return}if(!pe)return;const _e=ul();for(const Bt of At[ee])pe[Bt]=_e[Bt]}function Ci(){e.value.fps=Math.min(240,Math.max(1,Math.round(Number(e.value.fps)||30)))}function ri(ee){var pe;s.selectSystem(((pe=s.systems[ee])==null?void 0:pe.id)??0)}function fn(){s.addSystem()}function Bs(){s.addCollider()}function Ls(){s.addPath()}function Ds(){s.addSpine()}function _r(){s.duplicateSelectedObject()}function Gi(ee,pe,_e=0,wt=0,Bt=0,ga=0){return{x:ee,y:pe,inX:_e,inY:wt,outX:Bt,outY:ga}}function fa(){const ee=fe.value;if(!(!ee||!ee.preset))if(ee.preset==="circle"){const _e=60.751328;ee.points=[Gi(110,0,0,-_e,0,_e),Gi(0,110,_e,0,-_e,0),Gi(-110,0,0,_e,0,-_e),Gi(0,-110,-_e,0,_e,0)],ee.closed=!0}else if(ee.preset==="square")ee.points=[Gi(-100,-100),Gi(100,-100),Gi(100,100),Gi(-100,100)],ee.closed=!0;else{const pe=ee.preset==="star"?10:6;ee.points=Array.from({length:pe},(_e,wt)=>{const Bt=ee.preset==="star"&&wt%2?50:110,ga=-Math.PI*.5+wt/pe*Math.PI*2;return Gi(Math.cos(ga)*Bt,Math.sin(ga)*Bt)}),ee.closed=!0}}function ma(){fe.value&&(fe.value.points=[])}function El(){B.value&&(B.value.config.seed=Math.floor(Math.random()*999999)+1)}function Il(ee){var _e;const pe=(_e=B.value)==null?void 0:_e.config;!pe||ee==="direction"||(pe.speedOverLifeMode=ee,ee==="curve"&&pe.speedOverLifeMin===pe.speedOverLifeMax&&(pe.speedOverLifeMin=0,pe.speedOverLifeMax=1))}function vo(){var pe;const ee=(pe=B.value)==null?void 0:pe.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 _e;const pe=(_e=B.value)==null?void 0:_e.config;!pe||ee==="direction"||(pe.scaleOverLifeMode=ee,vo())}const pa={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 _e;const ee=(_e=B.value)==null?void 0:_e.config;if(!ee)return;const pe=pa[ee.shape];pe&&Object.assign(ee,pe)}function du(){var pe;const ee=(pe=B.value)==null?void 0:pe.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:y,presetOptions:x,presetLoading:T,configMessage:A,configError:S,saveConfig:b,onConfigFileChange:_,refreshPresets:I,loadSelectedPreset:F,resolvedCurveEditorMode:E,sys:B,textureFileInput:N,sequenceFileInput:$,trailTextureFileInput:L,addTrailResource:U,openTrailTexturePicker:C,onTrailRigChange:P,onTrailResourceBoneCountChange:O,onTrailResourceRotationChange:D,onTrailTextureFile:V,resetTrailTexture:Y,removeTrailResource:W,setTrailResourceWeight:q,toggleTrailResourceLock:ne,setTrailColor:re,commitTrailColor:me,addImageResource:ve,openTexturePicker:ce,openSequencePicker:de,onTextureFile:X,onSequenceFiles:j,resetTexture:H,setResourceFixedColor:G,commitResourceFixedColor:z,removeImageResource:te,setResourceWeight:he,toggleResourceLock:se,automaticLoopDuration:ue,loopDurationFrames:ae,activeObjectType:Ee,activeCollider:xe,activePath:fe,activeSpine:De,canCopyObject:Ze,selectedSpineBone:ze,boundSpineBone:Ke,collisionPickerOpen:Le,selectedCollisionBodies:be,availableCollisionBodies:at,addCollisionBody:we,removeCollisionBody:mi,collapsed:Rt,toggle:vt,setEmitMode:ie,setLoopDurationFrames:oe,setStreamBehavior:_t,setLoopSection:Ct,setLoopSectionDuration:et,setLoopCustomDuration:rs,onEmitterFollowModeChange:ni,bindSelectedBone:Kt,resetModule:vs,normalizeExportFps:Ci,select:ri,addSys:fn,addCollider:Bs,addPath:Ls,addSpine:Ds,copySelectedObject:_r,applyPathPreset:fa,clearPathAnchors:ma,randomizeSeed:El,setSpeedOverLifeMode:Il,prepareScaleOverLifeCurve:vo,setScaleOverLifeMode:Rl,onShapeChange:Pl,onSpawnPathChange:du,LINEAR_CURVE:NF,FLAT_CURVE:cm,ALPHA_CURVE:UF,RESOURCE_ALPHA_CURVE:hm,TRAIL_ALPHA_CURVE:um,TRAIL_SHAPE_CURVE:dm}}const yS=Symbol("particle-panel");function GO(){const s=YO();return Ux(yS,s),s}function Mr(){const s=Xo(yS);if(!s)throw new Error("Particle panel sections require a ParticlePanel parent");return s}const HO={class:"group config-management"},jO={class:"caret"},WO={class:"group-body config-management-body"},zO={class:"config-toolbar"},qO=["disabled"],KO={value:""},ZO=["value"],JO=ei({__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}=Mr();return(p,m)=>(K(),J("div",HO,[M("div",{class:"group-head",onClick:m[0]||(m[0]=g=>R(d)("config"))},[M("span",jO,Me(R(u).config?"▸":"▾"),1),m[8]||(m[8]=M("span",null,"配置管理",-1))]),le(M("div",WO,[M("div",zO,[M("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:m[1]||(m[1]=(...g)=>R(a)&&R(a)(...g))},"保存配置"),M("button",{title:"加载本地编辑器配置",onClick:m[2]||(m[2]=g=>{var v;return(v=R(e))==null?void 0:v.click()})},"加载配置"),le(M("select",{"onUpdate:modelValue":m[3]||(m[3]=g=>zt(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))},[M("option",KO,Me(R(i).length?"选择预设":"无预设文件"),1),(K(!0),J(Fe,null,$t(R(i),g=>(K(),J("option",{key:g.file,value:g.file},Me(g.name),9,ZO))),128))],40,qO),[[Tt,R(t)]]),M("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(),J("div",{key:0,class:Be(["config-message",{error:R(o)}])},Me(R(r)),3)):Te("",!0)],512),[[bi,!R(u).config]])]))}}),QO=ti(JO,[["__scopeId","data-v-cb52d3e0"]]),eB={class:"ns-label"},tB=["min","max","step","value","disabled"],iB=["min","max","step","value","disabled"],sB=ei({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Ye(String(t.modelValue));Yi(()=>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(),J("div",{class:Be(["ns",{disabled:s.disabled}])},[M("span",eB,Me(s.label),1),M("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,tB),M("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,iB)],2))}}),Pe=ti(sB,[["__scopeId","data-v-7c2fbed0"]]),nB={class:"ce"},rB={class:"ce-editor"},oB={class:"ce-grid"},aB=["x1","x2","y2"],lB=["y1","x2","y2"],cB=["x","y","width","height"],hB=["d"],uB={key:0,class:"ce-handles"},dB=["x1","y1","x2","y2"],fB=["cx","cy","onPointerdown"],mB=["x1","y1","x2","y2"],pB=["cx","cy","onPointerdown"],gB=["cx","cy"],vB=["cx","cy","onPointerdown","onDblclick"],xB={class:"ce-nav"},yB={class:"ce-tip"},qn=8,bB=ei({__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=Ye(null),r=Ye(300),o=Ye(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 qn+E*(r.value-qn*2)}function h(E){return qn+(1-E)*(o.value-qn*2)}function u(){return[...t.modelValue].sort((E,k)=>E.x-k.x)}function d(E){i("update:modelValue",[...E].sort((k,B)=>k.x-B.x))}function f(){d(t.defaultValue.map(E=>({...E})))}const p=qe(()=>u());function m(E){const k=p.value[E],B=p.value[Math.max(0,E-1)];return{x:k.x-(k.x-B.x)/3,y:k.y-(k.y-B.y)/3}}function g(E){const k=p.value[E],B=p.value[Math.min(p.value.length-1,E+1)];return{x:k.x+(B.x-k.x)/3,y:k.y+(B.y-k.y)/3}}function v(E){const k=p.value[E],B=m(E);return{x:k.x+(k.inX??B.x-k.x),y:k.y+(k.inY??B.y-k.y)}}function y(E){const k=p.value[E],B=g(E);return{x:k.x+(k.outX??B.x-k.x),y:k.y+(k.outY??B.y-k.y)}}const x=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);N.push({x:k,y:B}),d(N)}let b={t:0,i:-1,x:0,y:0};function _(E,k){E.stopPropagation();const B=u().findIndex(U=>Math.abs(U.x-p.value[k].x)<1e-6&&Math.abs(U.y-p.value[k].y)<1e-6);if(B<0)return;const N=Date.now();if(N-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:N,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:C,y:P}=T(U.clientX,U.clientY),O=u();O[B]={x:C,y:P},d(O)},L=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",L)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",L)}function I(E,k,B){E.stopPropagation();const N=L=>{const U=T(L.clientX,L.clientY),C=u(),P=C[k],O=B==="in"?C[Math.max(0,k-1)].x:P.x,D=B==="in"?P.x:C[Math.min(C.length-1,k+1)].x,V=Math.min(D,Math.max(O,U.x)),Y=Math.round((V-P.x)*100)/100,W=Math.round((U.y-P.y)*100)/100;C[k]=B==="in"?{...P,inX:Y,inY:W}:{...P,outX:Y,outY:W},d(C)},$=()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",$)};window.addEventListener("pointermove",N),window.addEventListener("pointerup",$)}function F(E,k){k==null||k.stopPropagation();const B=u();B.length<=2||(A=Date.now(),d(B.filter((N,$)=>$!==E)))}return jn(()=>{c(),a=new ResizeObserver(c),n.value&&a.observe(n.value)}),xl(()=>{a==null||a.disconnect()}),(E,k)=>(K(),J("div",nB,[M("div",rB,[(K(),J("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:S},[M("g",oB,[(K(),J(Fe,null,$t([.25,.5,.75],B=>M("line",{key:"v"+B,x1:l(B),y1:"0",x2:l(B),y2:h(0)},null,8,aB)),64)),(K(),J(Fe,null,$t([.25,.5,.75],B=>M("line",{key:"h"+B,x1:"0",y1:h(B),x2:l(1),y2:h(B)},null,8,lB)),64))]),M("rect",{x:l(0),y:h(1),width:l(1)-l(0),height:h(0)-h(1),class:"ce-frame",fill:"none"},null,8,cB),M("path",{d:x.value,class:"ce-line",fill:"none"},null,8,hB),s.mode==="bezier"?(K(),J("g",uB,[(K(!0),J(Fe,null,$t(p.value,(B,N)=>(K(),J(Fe,{key:"handles-"+N},[N>0?(K(),J("line",{key:0,x1:l(B.x),y1:h(B.y),x2:l(v(N).x),y2:h(v(N).y)},null,8,dB)):Te("",!0),N>0?(K(),J("circle",{key:1,cx:l(v(N).x),cy:h(v(N).y),r:"4",onPointerdown:$=>I($,N,"in")},null,40,fB)):Te("",!0),NI($,N,"out")},null,40,pB)):Te("",!0)],64))),128))])):Te("",!0),(K(!0),J(Fe,null,$t(p.value,(B,N)=>(K(),J("g",{key:N},[M("circle",{cx:l(B.x),cy:h(B.y),r:"5",class:"ce-node"},null,8,gB),M("circle",{cx:l(B.x),cy:h(B.y),r:"9",class:"ce-hit",onPointerdown:$=>_($,N),onDblclick:$=>F(N,$)},null,40,vB)]))),128))],544)),M("div",xB,[M("span",yB,Me(s.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),M("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:f},"重置")]))}}),Js=ti(bB,[["__scopeId","data-v-9bfb7b31"]]),wB={class:"spine-editor"},SB={class:"field wide"},TB={class:"grid three"},MB={class:"field"},_B={class:"field"},CB={class:"field"},AB={class:"grid three"},EB={class:"field"},IB={class:"field"},RB={class:"field"},PB=["disabled"],kB={class:"asset-row"},FB=["title"],OB={class:"asset-row"},BB=["title"],LB={class:"asset-row"},DB=["title"],NB={class:"asset-actions"},UB=["disabled"],$B={class:"runtime-note"},XB={key:0},VB={key:0,class:"error"},YB={class:"section-box"},GB={key:0,class:"empty"},HB={key:1,class:"field wide"},jB=["value"],WB={class:"section-box"},zB={class:"tree-title-row"},qB=["disabled","title"],KB={key:0,class:"empty"},ZB={key:1,class:"bone-search"},JB={key:2,class:"empty"},QB={key:3,class:"bone-tree"},eL=["onClick","onKeydown"],tL=["title","onClick"],iL={key:1,class:"bone-leaf"},sL={class:"bone-name"},nL=ei({__name:"SpineObjectPanel",props:{spineObject:{}},setup(s){const e=s,t=fo(),i=Ye(null),n=Ye(null),r=Ye(null),o=Ye(null),a=Ye(new Set),c=Ye(""),l=Ye(null),h=Ye(null),u=Ye([]);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]))),y=qe(()=>e.spineObject.bones.filter(U=>{var O;const C=c.value.trim().toLocaleLowerCase();if(C)return U.name.toLocaleLowerCase().includes(C);let P=U.parent;for(;P;){if(a.value.has(P))return!1;P=((O=v.value.get(P))==null?void 0:O.parent)||null}return!0})),x=qe(()=>g.value.size>0&&[...g.value].every(U=>a.value.has(U)));function T(U){const C=e.spineObject.selectedBone===U;for(const P of t.spines)P.selectedBone="";C||(e.spineObject.selectedBone=U)}function A(U){a.value.has(U)?a.value.delete(U):a.value.add(U)}function S(){a.value=x.value?new Set:new Set(g.value)}function b(U){var C;return((C=U.target.files)==null?void 0:C[0])||null}function _(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 C=Array.from(U.target.files||[]);if(!C.length)return;const P=C.filter(q=>/\.(json|skel)$/i.test(q.name)),O=C.filter(q=>/\.atlas$/i.test(q.name)),D=C.filter(q=>/\.(png|jpe?g|webp|wepb)$/i.test(q.name)),V=O.map(q=>({atlas:q,skeleton:P.find(ne=>E(ne)===E(q))})).find(q=>q.skeleton),Y=(V==null?void 0:V.skeleton)||P[0]||null,W=(V==null?void 0:V.atlas)||O[0]||null;if(l.value=Y,h.value=W,u.value=D,!Y||!W||!D.length){const q=[!Y&&"JSON / SKEL",!W&&"Atlas",!D.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${q}`;return}await $()}function B(){t.recalcTotalFrames()}function N(){B(),t.timeline.frame=0}async function $(){var P;const U=l.value,C=h.value;if(!U||!C||!u.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const O=await cw(U,C,u.value);nu(e.spineObject.id,O),e.spineObject.skeletonFileName=U.name,e.spineObject.atlasFileName=C.name,e.spineObject.textureFileNames=u.value.map(D=>D.name),e.spineObject.dataVersion=O.dataVersion,e.spineObject.animations=O.animations,e.spineObject.bones=O.bones,e.spineObject.selectedBone="",c.value="",a.value=new Set,e.spineObject.selectedAnimation=((P=O.animations[0])==null?void 0:P.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",B(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await WP(U,C,u.value)}catch(D){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",D)}}catch(O){e.spineObject.status="error",e.spineObject.error=O instanceof Error?O.message:String(O)}}function L(){Tl(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="",B()}return(U,C)=>(K(),J("div",wB,[C[30]||(C[30]=M("div",{class:"editor-title"},"Spine 属性",-1)),M("label",SB,[C[15]||(C[15]=M("span",null,"Spine 名称",-1)),le(M("input",{"onUpdate:modelValue":C[0]||(C[0]=P=>s.spineObject.name=P)},null,512),[[Ge,s.spineObject.name]])]),M("div",TB,[M("label",MB,[C[16]||(C[16]=M("span",null,"X 位置",-1)),le(M("input",{"onUpdate:modelValue":C[1]||(C[1]=P=>s.spineObject.x=P),type:"number"},null,512),[[Ge,s.spineObject.x,void 0,{number:!0}]])]),M("label",_B,[C[17]||(C[17]=M("span",null,"Y 位置",-1)),le(M("input",{"onUpdate:modelValue":C[2]||(C[2]=P=>s.spineObject.y=P),type:"number"},null,512),[[Ge,s.spineObject.y,void 0,{number:!0}]])]),M("label",CB,[C[18]||(C[18]=M("span",null,"旋转",-1)),le(M("input",{"onUpdate:modelValue":C[3]||(C[3]=P=>s.spineObject.rotation=P),type:"number"},null,512),[[Ge,s.spineObject.rotation,void 0,{number:!0}]])])]),M("div",AB,[M("label",EB,[C[19]||(C[19]=M("span",null,"Scale X",-1)),le(M("input",{"onUpdate:modelValue":C[4]||(C[4]=P=>s.spineObject.scaleX=P),type:"number",step:"0.05"},null,512),[[Ge,s.spineObject.scaleX,void 0,{number:!0}]])]),M("label",IB,[C[20]||(C[20]=M("span",null,"Scale Y",-1)),le(M("input",{"onUpdate:modelValue":C[5]||(C[5]=P=>s.spineObject.scaleY=P),type:"number",step:"0.05"},null,512),[[Ge,s.spineObject.scaleY,void 0,{number:!0}]])]),M("label",RB,[C[21]||(C[21]=M("span",null,"开始时间",-1)),le(M("input",{"onUpdate:modelValue":C[6]||(C[6]=P=>s.spineObject.timeOffset=P),type:"number",min:"0",step:"0.033333",onChange:B},null,544),[[Ge,s.spineObject.timeOffset,void 0,{number:!0}]])])]),C[31]||(C[31]=M("div",{class:"divider"},null,-1)),C[32]||(C[32]=M("div",{class:"section-title"},"Spine 资源",-1)),M("input",{ref_key:"skeletonInput",ref:i,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:_},null,544),M("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:I},null,544),M("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),M("input",{ref_key:"folderInput",ref:o,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:k},null,544),M("button",{class:"folder-select",disabled:s.spineObject.status==="loading",onClick:C[7]||(C[7]=P=>{var O;return(O=o.value)==null?void 0:O.click()})},"选择文件夹并加载",8,PB),C[33]||(C[33]=M("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),M("div",kB,[M("div",{class:"asset-name",title:d.value},Me(d.value||"JSON / SKEL..."),9,FB),M("button",{onClick:C[8]||(C[8]=P=>{var O;return(O=i.value)==null?void 0:O.click()})},"选择")]),M("div",OB,[M("div",{class:"asset-name",title:f.value},Me(f.value||"Atlas..."),9,BB),M("button",{onClick:C[9]||(C[9]=P=>{var O;return(O=n.value)==null?void 0:O.click()})},"选择")]),M("div",LB,[M("div",{class:"asset-name",title:p.value.join(", ")},Me(m.value),9,DB),M("button",{onClick:C[10]||(C[10]=P=>{var O;return(O=r.value)==null?void 0:O.click()})},"选择(多选)")]),M("div",NB,[M("button",{class:"load",disabled:s.spineObject.status==="loading",onClick:$},Me(s.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,UB),M("button",{class:"clear",onClick:L},"清除")]),M("div",$B,[C[22]||(C[22]=kt(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线 ",-1)),s.spineObject.dataVersion?(K(),J("span",XB," · 当前资源 "+Me(s.spineObject.dataVersion),1)):Te("",!0)]),s.spineObject.error?(K(),J("div",VB,Me(s.spineObject.error),1)):Te("",!0),M("div",YB,[C[25]||(C[25]=M("div",{class:"section-title"},"Spine 动画",-1)),s.spineObject.animations.length?(K(),J("label",HB,[C[24]||(C[24]=M("span",null,"时间轴播放动画",-1)),le(M("select",{"onUpdate:modelValue":C[11]||(C[11]=P=>s.spineObject.selectedAnimation=P),onChange:N},[C[23]||(C[23]=M("option",{value:""},"无",-1)),(K(!0),J(Fe,null,$t(s.spineObject.animations,P=>(K(),J("option",{key:P.name,value:P.name},Me(P.name)+"("+Me(P.duration.toFixed(2))+"s) ",9,jB))),128))],544),[[Tt,s.spineObject.selectedAnimation]])])):(K(),J("div",GB,"无可用动画"))]),M("div",WB,[M("div",zB,[C[29]||(C[29]=M("div",{class:"section-title"},"层级树",-1)),M("button",{class:Be(["selected-bone",{active:s.spineObject.selectedBone}]),disabled:!s.spineObject.selectedBone,title:s.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:C[12]||(C[12]=P=>s.spineObject.selectedBone="")},[s.spineObject.selectedBone?(K(),J(Fe,{key:0},[C[26]||(C[26]=kt("清除选中骨骼:",-1)),M("strong",null,Me(s.spineObject.selectedBone),1)],64)):(K(),J(Fe,{key:1},[C[27]||(C[27]=kt("当前骨骼:",-1)),C[28]||(C[28]=M("strong",null,"未选择",-1))],64))],10,qB),s.spineObject.bones.length?(K(),J("button",{key:0,class:"tree-action",onClick:S},Me(x.value?"全部展开":"全部折叠"),1)):Te("",!0)]),s.spineObject.bones.length?(K(),J("div",ZB,[le(M("input",{"onUpdate:modelValue":C[13]||(C[13]=P=>c.value=P),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[Ge,c.value,void 0,{trim:!0}]]),c.value?(K(),J("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:C[14]||(C[14]=P=>c.value="")},"✕")):Te("",!0)])):(K(),J("div",KB,"未加载 Spine")),s.spineObject.bones.length&&!y.value.length?(K(),J("div",JB,"未找到匹配的骨骼")):s.spineObject.bones.length?(K(),J("div",QB,[(K(!0),J(Fe,null,$t(y.value,P=>(K(),J("div",{key:P.name,class:Be(["bone",{selected:s.spineObject.selectedBone===P.name}]),style:gi({paddingLeft:`${6+P.depth*16}px`}),role:"button",tabindex:"0",onClick:O=>T(P.name),onKeydown:Qr(tt(O=>T(P.name),["prevent"]),["enter"])},[g.value.has(P.name)?(K(),J("button",{key:0,class:"bone-toggle",title:a.value.has(P.name)?"展开子骨骼":"折叠子骨骼",onClick:tt(O=>A(P.name),["stop"])},Me(a.value.has(P.name)?"▸":"▾"),9,tL)):(K(),J("span",iL,"•")),M("span",sL,Me(P.name),1)],46,eL))),128))])):Te("",!0)])]))}}),rL=ti(nL,[["__scopeId","data-v-9257fb45"]]),oL={class:"group"},aL={class:"caret"},lL={class:"scene-actions"},cL=["disabled"],hL={class:"group-body"},uL={class:"tree scene-tree"},dL=["onClick"],fL={class:"tlabel"},mL=["title","aria-label","onClick"],pL={viewBox:"0 0 24 24","aria-hidden":"true"},gL={key:0,class:"eye-slash",d:"M4 4l16 16"},vL=["onClick"],xL=["onClick"],yL={class:"tlabel"},bL=["title","aria-label","onClick"],wL={viewBox:"0 0 24 24","aria-hidden":"true"},SL={key:0,class:"eye-slash",d:"M4 4l16 16"},TL=["onClick"],ML=["onClick"],_L={class:"tlabel"},CL=["title","aria-label","onClick"],AL={viewBox:"0 0 24 24","aria-hidden":"true"},EL={key:0,class:"eye-slash",d:"M4 4l16 16"},IL=["onClick"],RL=["onClick"],PL={class:"tlabel"},kL=["title","aria-label","onClick"],FL={viewBox:"0 0 24 24","aria-hidden":"true"},OL={key:0,class:"eye-slash",d:"M4 4l16 16"},BL=["onClick"],LL={key:0,class:"empty"},DL={class:"row"},NL={class:"seed-row scene-seed"},UL={class:"field-block"},$L={class:"field-grid"},XL={class:"field-block"},VL={class:"field-block check-field"},YL={class:"field-grid"},GL={class:"compact-field"},HL={class:"compact-field"},jL={class:"field-grid"},WL={class:"compact-field"},zL={class:"compact-field"},qL={key:1,class:"field-grid"},KL={class:"compact-field"},ZL={class:"compact-field"},JL={key:2,class:"field-grid"},QL={class:"compact-field"},eD={class:"compact-field"},tD={class:"field-block"},iD={key:4,class:"field-grid"},sD={class:"compact-field"},nD={class:"compact-field"},rD={class:"collider-follow-section"},oD={class:"follow-path"},aD={class:"field-block"},lD=["value"],cD={class:"field-grid"},hD={class:"compact-field"},uD={class:"compact-field"},dD={class:"follow-path"},fD={class:"field-block"},mD={class:"field-grid"},pD={class:"compact-field"},gD={class:"compact-field"},vD={class:"field-grid"},xD={class:"compact-field"},yD={class:"compact-field"},bD={class:"setting-line"},wD={class:"setting-line"},SD={class:"field-block"},TD={key:4,class:"panel-hint"},MD=ei({__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:y,randomizeSeed:x,LINEAR_CURVE:T}=Mr();return(A,S)=>(K(),J("div",oL,[M("div",{class:"group-head scene-head",onClick:S[5]||(S[5]=b=>R(h)("scene"))},[M("span",aL,Me(R(l).scene?"▸":"▾"),1),S[50]||(S[50]=M("span",null,"场景对象",-1)),M("div",lL,[M("button",{class:"scene-add",title:"添加粒子系统",onClick:S[0]||(S[0]=tt((...b)=>R(d)&&R(d)(...b),["stop"]))},"+粒子"),M("button",{class:"scene-add",title:"添加碰撞体",onClick:S[1]||(S[1]=tt((...b)=>R(f)&&R(f)(...b),["stop"]))},"+碰撞"),M("button",{class:"scene-add",title:"添加路径",onClick:S[2]||(S[2]=tt((...b)=>R(p)&&R(p)(...b),["stop"]))},"+路径"),M("button",{class:"scene-add",title:"添加 Spine",onClick:S[3]||(S[3]=tt((...b)=>R(m)&&R(m)(...b),["stop"]))},"+Spine"),M("button",{class:"scene-add",disabled:!R(c),title:"复制当前选中的场景对象",onClick:S[4]||(S[4]=tt((...b)=>R(g)&&R(g)(...b),["stop"]))},"+Copy",8,cL)])]),le(M("div",hL,[M("div",uL,[(K(!0),J(Fe,null,$t(R(e).systems,(b,_)=>(K(),J("div",{key:`particle-${b.id}`,class:Be(["tree-item scene-object-item",{on:R(n)==="particle"&&b.id===R(e).activeObjectId}]),onClick:I=>R(u)(_)},[S[53]||(S[53]=M("span",{class:"tdot"},"●",-1)),M("span",fL,Me(b.config.name||"ParticleSystem"+(_+1)),1),M("button",{class:Be(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":b.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:tt(I=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",pL,[S[51]||(S[51]=M("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]=M("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",gL)):Te("",!0)]))],10,mL),S[54]||(S[54]=M("span",{class:"scene-object-kind"},"粒子",-1)),M("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:tt(I=>R(e).removeSystem(b.id),["stop"])},"✕",8,vL)],10,dL))),128)),(K(!0),J(Fe,null,$t(R(e).colliders,b=>(K(),J("div",{key:`collision-${b.id}`,class:Be(["tree-item scene-object-item",{on:R(n)==="collision"&&b.id===R(e).activeObjectId}]),onClick:_=>R(e).selectSceneObject("collision",b.id)},[S[57]||(S[57]=M("span",{class:"tdot collision-dot"},"■",-1)),M("span",yL,Me(b.name),1),M("button",{class:Be(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":b.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:tt(_=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",wL,[S[55]||(S[55]=M("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]=M("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",SL)):Te("",!0)]))],10,bL),S[58]||(S[58]=M("span",{class:"scene-object-kind"},"碰撞",-1)),M("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:tt(_=>R(e).removeCollider(b.id),["stop"])},"✕",8,TL)],10,xL))),128)),(K(!0),J(Fe,null,$t(R(e).paths,b=>(K(),J("div",{key:`path-${b.id}`,class:Be(["tree-item scene-object-item",{on:R(n)==="path"&&b.id===R(e).activeObjectId}]),onClick:_=>R(e).selectSceneObject("path",b.id)},[S[61]||(S[61]=M("span",{class:"tdot path-dot"},"◇",-1)),M("span",_L,Me(b.name),1),M("button",{class:Be(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示路径":"隐藏路径","aria-label":b.visible===!1?"显示路径":"隐藏路径",onClick:tt(_=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",AL,[S[59]||(S[59]=M("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]=M("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",EL)):Te("",!0)]))],10,CL),S[62]||(S[62]=M("span",{class:"scene-object-kind"},"路径",-1)),M("button",{class:"scene-object-delete",title:"删除路径",onClick:tt(_=>R(e).removePath(b.id),["stop"])},"✕",8,IL)],10,ML))),128)),(K(!0),J(Fe,null,$t(R(e).spines,b=>(K(),J("div",{key:`spine-${b.id}`,class:Be(["tree-item scene-object-item",{on:R(n)==="spine"&&b.id===R(e).activeObjectId}]),onClick:_=>R(e).selectSceneObject("spine",b.id)},[S[65]||(S[65]=M("span",{class:"tdot spine-dot"},"◆",-1)),M("span",PL,Me(b.name),1),M("button",{class:Be(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":b.visible===!1?"显示 Spine":"隐藏 Spine",onClick:tt(_=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",FL,[S[63]||(S[63]=M("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]=M("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",OL)):Te("",!0)]))],10,kL),S[66]||(S[66]=M("span",{class:"scene-object-kind"},"Spine",-1)),M("button",{class:"scene-object-delete",title:"删除 Spine",onClick:tt(_=>R(e).removeSpine(b.id),["stop"])},"✕",8,BL)],10,RL))),128)),!R(e).systems.length&&!R(e).colliders.length&&!R(e).paths.length&&!R(e).spines.length?(K(),J("div",LL,"场景中暂无对象")):Te("",!0)]),R(n)==="particle"&&R(i)?(K(),J(Fe,{key:0},[M("label",DL,[S[67]||(S[67]=M("span",null,"名称",-1)),le(M("input",{"onUpdate:modelValue":S[6]||(S[6]=b=>R(i).config.name=b),class:"inp"},null,512),[[Ge,R(i).config.name]])]),ye(Pe,{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"]),ye(Pe,{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"]),ye(Pe,{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"]),ye(Pe,{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"]),ye(Pe,{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"]),ye(Pe,{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"]),ye(Pe,{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"]),M("div",NL,[S[68]||(S[68]=M("label",{for:"system-seed"},"随机种子",-1)),le(M("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),[[Ge,R(i).config.seed,void 0,{number:!0}]]),M("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:S[15]||(S[15]=(...b)=>R(x)&&R(x)(...b))},"⚄")]),S[69]||(S[69]=M("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):R(r)?(K(),J(Fe,{key:1},[S[94]||(S[94]=M("div",{class:"object-editor-title"},"碰撞体属性",-1)),M("label",UL,[S[70]||(S[70]=M("span",null,"碰撞体名称",-1)),le(M("input",{"onUpdate:modelValue":S[16]||(S[16]=b=>R(r).name=b),class:"inp"},null,512),[[Ge,R(r).name]])]),M("div",$L,[M("label",XL,[S[72]||(S[72]=M("span",null,"类型",-1)),le(M("select",{"onUpdate:modelValue":S[17]||(S[17]=b=>R(r).shape=b),class:"inp"},[...S[71]||(S[71]=[es('',5)])],512),[[Tt,R(r).shape]])]),M("label",VL,[S[73]||(S[73]=M("span",null,"启用",-1)),le(M("input",{"onUpdate:modelValue":S[18]||(S[18]=b=>R(r).enabled=b),type:"checkbox"},null,512),[[St,R(r).enabled]])])]),M("div",YL,[M("label",GL,[S[74]||(S[74]=M("span",null,"X 位置",-1)),le(M("input",{"onUpdate:modelValue":S[19]||(S[19]=b=>R(r).x=b),type:"number",class:"inp"},null,512),[[Ge,R(r).x,void 0,{number:!0}]])]),M("label",HL,[S[75]||(S[75]=M("span",null,"Y 位置",-1)),le(M("input",{"onUpdate:modelValue":S[20]||(S[20]=b=>R(r).y=b),type:"number",class:"inp"},null,512),[[Ge,R(r).y,void 0,{number:!0}]])])]),ye(Pe,{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"]),M("div",jL,[M("label",WL,[S[76]||(S[76]=M("span",null,"缩放 X",-1)),le(M("input",{"onUpdate:modelValue":S[22]||(S[22]=b=>R(r).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,R(r).scaleX,void 0,{number:!0}]])]),M("label",zL,[S[77]||(S[77]=M("span",null,"缩放 Y",-1)),le(M("input",{"onUpdate:modelValue":S[23]||(S[23]=b=>R(r).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,R(r).scaleY,void 0,{number:!0}]])])]),R(r).shape==="circle"?(K(),Pt(Pe,{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(),J("div",qL,[M("label",KL,[S[78]||(S[78]=M("span",null,"X 半径",-1)),le(M("input",{"onUpdate:modelValue":S[25]||(S[25]=b=>R(r).radiusX=b),type:"number",min:"1",class:"inp"},null,512),[[Ge,R(r).radiusX,void 0,{number:!0}]])]),M("label",ZL,[S[79]||(S[79]=M("span",null,"Y 半径",-1)),le(M("input",{"onUpdate:modelValue":S[26]||(S[26]=b=>R(r).radiusY=b),type:"number",min:"1",class:"inp"},null,512),[[Ge,R(r).radiusY,void 0,{number:!0}]])])])):(K(),J("div",JL,[M("label",QL,[S[80]||(S[80]=M("span",null,"宽度",-1)),le(M("input",{"onUpdate:modelValue":S[27]||(S[27]=b=>R(r).width=b),type:"number",min:"1",class:"inp"},null,512),[[Ge,R(r).width,void 0,{number:!0}]])]),M("label",eD,[S[81]||(S[81]=M("span",null,"高度",-1)),le(M("input",{"onUpdate:modelValue":S[28]||(S[28]=b=>R(r).height=b),type:"number",min:"1",class:"inp"},null,512),[[Ge,R(r).height,void 0,{number:!0}]])])])),R(r).shape==="polygon"||R(r).shape==="custom"?(K(),Pt(Pe,{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),M("label",tD,[S[83]||(S[83]=M("span",null,"碰撞响应",-1)),le(M("select",{"onUpdate:modelValue":S[30]||(S[30]=b=>R(r).response=b),class:"inp"},[...S[82]||(S[82]=[M("option",{value:"physics"},"物理(弹跳/摩擦)",-1),M("option",{value:"pause"},"暂停(停止不动)",-1),M("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[Tt,R(r).response]])]),R(r).response==="physics"?(K(),J("div",iD,[M("label",sD,[S[84]||(S[84]=M("span",null,"弹性 (0-1)",-1)),le(M("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),[[Ge,R(r).elasticity,void 0,{number:!0}]])]),M("label",nD,[S[85]||(S[85]=M("span",null,"摩擦 (0-1)",-1)),le(M("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),[[Ge,R(r).friction,void 0,{number:!0}]])])])):Te("",!0),M("div",rD,[M("label",oD,[le(M("input",{"onUpdate:modelValue":S[33]||(S[33]=b=>R(r).followPath=b),type:"checkbox"},null,512),[[St,R(r).followPath]]),S[86]||(S[86]=kt("跟随路径移动",-1))]),R(r).followPath?(K(),J(Fe,{key:0},[M("label",aD,[S[88]||(S[88]=M("span",null,"目标路径",-1)),le(M("select",{"onUpdate:modelValue":S[34]||(S[34]=b=>R(r).followPathId=b),class:"inp"},[S[87]||(S[87]=M("option",{value:0},"(未选择)",-1)),(K(!0),J(Fe,null,$t(R(e).paths,b=>(K(),J("option",{key:b.id,value:b.id},Me(b.name),9,lD))),128))],512),[[Tt,R(r).followPathId,void 0,{number:!0}]])]),M("div",cD,[M("label",hD,[S[89]||(S[89]=M("span",null,"移动时长(秒)",-1)),le(M("input",{"onUpdate:modelValue":S[35]||(S[35]=b=>R(r).followDuration=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,R(r).followDuration,void 0,{number:!0}]])]),M("label",uD,[S[91]||(S[91]=M("span",null,"曲线模式",-1)),le(M("select",{"onUpdate:modelValue":S[36]||(S[36]=b=>R(r).followCurveMode=b),class:"inp"},[...S[90]||(S[90]=[M("option",null,"跟随导出",-1),M("option",null,"线性",-1),M("option",null,"贝塞尔",-1)])],512),[[Tt,R(r).followCurveMode]])])]),M("label",dD,[le(M("input",{"onUpdate:modelValue":S[37]||(S[37]=b=>R(r).followPathRotation=b),type:"checkbox"},null,512),[[St,R(r).followPathRotation]]),S[92]||(S[92]=kt("方向沿路径",-1))]),S[93]||(S[93]=M("div",{class:"collider-curve-title"},[kt("移动进度曲线 "),M("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),ye(Js,{"model-value":R(r).followCurve||R(T),"default-value":R(T),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(),J(Fe,{key:2},[S[104]||(S[104]=M("div",{class:"object-editor-title"},"路径属性",-1)),M("label",fD,[S[95]||(S[95]=M("span",null,"路径名称",-1)),le(M("input",{"onUpdate:modelValue":S[39]||(S[39]=b=>R(o).name=b),class:"inp"},null,512),[[Ge,R(o).name]])]),M("div",mD,[M("label",pD,[S[96]||(S[96]=M("span",null,"X 位置",-1)),le(M("input",{"onUpdate:modelValue":S[40]||(S[40]=b=>R(o).x=b),type:"number",class:"inp"},null,512),[[Ge,R(o).x,void 0,{number:!0}]])]),M("label",gD,[S[97]||(S[97]=M("span",null,"Y 位置",-1)),le(M("input",{"onUpdate:modelValue":S[41]||(S[41]=b=>R(o).y=b),type:"number",class:"inp"},null,512),[[Ge,R(o).y,void 0,{number:!0}]])])]),ye(Pe,{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"]),M("div",vD,[M("label",xD,[S[98]||(S[98]=M("span",null,"缩放 X",-1)),le(M("input",{"onUpdate:modelValue":S[43]||(S[43]=b=>R(o).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,R(o).scaleX,void 0,{number:!0}]])]),M("label",yD,[S[99]||(S[99]=M("span",null,"缩放 Y",-1)),le(M("input",{"onUpdate:modelValue":S[44]||(S[44]=b=>R(o).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,R(o).scaleY,void 0,{number:!0}]])])]),M("label",bD,[S[100]||(S[100]=M("span",null,"闭合路径",-1)),le(M("input",{"onUpdate:modelValue":S[45]||(S[45]=b=>R(o).closed=b),type:"checkbox"},null,512),[[St,R(o).closed]])]),M("label",wD,[S[101]||(S[101]=M("span",null,"路径颜色",-1)),le(M("input",{"onUpdate:modelValue":S[46]||(S[46]=b=>R(o).color=b),type:"color",class:"path-color"},null,512),[[Ge,R(o).color]])]),S[105]||(S[105]=es('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),M("label",SD,[S[103]||(S[103]=M("span",null,"应用预设形状",-1)),le(M("select",{"onUpdate:modelValue":S[47]||(S[47]=b=>R(o).preset=b),class:"inp"},[...S[102]||(S[102]=[es('',5)])],512),[[Tt,R(o).preset]])]),M("button",{class:"path-action primary",onClick:S[48]||(S[48]=(...b)=>R(v)&&R(v)(...b))},"应用预设"),M("button",{class:"path-action",onClick:S[49]||(S[49]=(...b)=>R(y)&&R(y)(...b))},"清空锚点")],64)):R(a)?(K(),Pt(rL,{key:3,"spine-object":R(a)},null,8,["spine-object"])):(K(),J("div",TD,"使用右上角按钮创建场景对象"))],512),[[bi,!R(l).scene]])]))}}),_D=ti(MD,[["__scopeId","data-v-3873124f"]]),CD={class:"group"},AD={class:"caret"},ED={class:"group-body"},ID={class:"segs"},RD={class:"segs stream-behavior-segs"},PD={key:2,class:"stream-loop-options"},kD={class:"loop-section-row"},FD={class:"switch-row"},OD=["checked"],BD={key:0,class:"loop-duration-control"},LD={class:"switch-row loop-duration-toggle"},DD=["checked"],ND={class:"loop-section-duration"},UD=["value"],$D={key:1},XD={key:2,class:"loop-auto-duration"},VD={class:"loop-section-row"},YD={class:"switch-row"},GD=["checked"],HD={key:0,class:"loop-duration-control"},jD={class:"switch-row loop-duration-toggle"},WD=["checked"],zD={class:"loop-section-duration"},qD=["value"],KD={key:1},ZD={key:2,class:"loop-auto-duration"},JD={key:3,class:"modifier-hint stream-loop-hint"},QD={class:"group"},eN={class:"caret"},tN={class:"group-body"},iN={class:"row"},sN={class:"row"},nN=["value","disabled"],rN={key:0,class:"row"},oN={class:"row"},aN={key:0,value:"radial"},lN={key:1,value:"path-normal"},cN={key:2,value:"path-tangent"},hN={key:6,class:"switch-row"},uN=ei({__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}=Mr();return(v,y)=>(K(),J(Fe,null,[M("div",CD,[M("div",{class:"group-head",onClick:y[1]||(y[1]=x=>R(o)("emitMode"))},[M("span",AD,Me(R(r).emitMode?"▸":"▾"),1),y[36]||(y[36]=M("span",null,"发射模式",-1)),M("button",{class:"group-reset",title:"重置发射模式参数",onClick:y[0]||(y[0]=tt(x=>R(f)("emitMode"),["stop"]))},"重置")]),le(M("div",ED,[M("div",ID,[M("button",{class:Be(["seg",{on:R(t).config.mode==="stream"}]),onClick:y[2]||(y[2]=x=>R(a)("stream"))},"持续",2),M("button",{class:Be(["seg",{on:R(t).config.mode==="burst"}]),onClick:y[3]||(y[3]=x=>R(a)("burst"))},"爆发",2)]),R(t).config.mode==="stream"?(K(),J(Fe,{key:0},[M("div",RD,[M("button",{class:Be(["seg",{on:R(t).config.streamBehavior==="normal"}]),onClick:y[4]||(y[4]=x=>R(l)("normal"))},"常规持续",2),M("button",{class:Be(["seg",{on:R(t).config.streamBehavior==="loop"}]),onClick:y[5]||(y[5]=x=>R(l)("loop"))},"循环持续",2)]),ye(Pe,{label:"发射速率",min:1,max:300,step:1,modelValue:R(t).config.rate,"onUpdate:modelValue":y[6]||(y[6]=x=>R(t).config.rate=x)},null,8,["modelValue"]),R(t).config.streamBehavior==="normal"?(K(),Pt(Pe,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:R(t).config.duration,"onUpdate:modelValue":y[7]||(y[7]=x=>R(t).config.duration=x)},null,8,["modelValue"])):(K(),Pt(Pe,{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(),J("div",PD,[M("div",kD,[M("label",FD,[M("input",{type:"checkbox",checked:R(t).config.generateLoopStartAnimation,onChange:y[8]||(y[8]=x=>R(h)("start",x))},null,40,OD),y[37]||(y[37]=M("span",{class:"switch-ui"},null,-1)),y[38]||(y[38]=M("span",null,"生成开始循环动画",-1))]),R(t).config.generateLoopStartAnimation?(K(),J("div",BD,[M("label",LD,[M("input",{type:"checkbox",checked:R(t).config.loopStartUseCustomDuration,onChange:y[9]||(y[9]=x=>R(d)("start",x))},null,40,DD),y[39]||(y[39]=M("span",{class:"switch-ui"},null,-1)),y[40]||(y[40]=M("span",null,"指定时长",-1))]),M("label",ND,[R(t).config.loopStartUseCustomDuration?(K(),J("input",{key:0,value:R(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"开始循环段时长",onChange:y[10]||(y[10]=x=>R(u)("start",x))},null,40,UD)):Te("",!0),R(t).config.loopStartUseCustomDuration?(K(),J("span",$D,"f")):(K(),J("span",XD,"自动 "+Me(R(i))+"f",1))])])):Te("",!0)]),M("div",VD,[M("label",YD,[M("input",{type:"checkbox",checked:R(t).config.generateLoopEndAnimation,onChange:y[11]||(y[11]=x=>R(h)("end",x))},null,40,GD),y[41]||(y[41]=M("span",{class:"switch-ui"},null,-1)),y[42]||(y[42]=M("span",null,"生成结束循环动画",-1))]),R(t).config.generateLoopEndAnimation?(K(),J("div",HD,[M("label",jD,[M("input",{type:"checkbox",checked:R(t).config.loopEndUseCustomDuration,onChange:y[12]||(y[12]=x=>R(d)("end",x))},null,40,WD),y[43]||(y[43]=M("span",{class:"switch-ui"},null,-1)),y[44]||(y[44]=M("span",null,"指定时长",-1))]),M("label",zD,[R(t).config.loopEndUseCustomDuration?(K(),J("input",{key:0,value:R(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"结束循环段时长",onChange:y[13]||(y[13]=x=>R(u)("end",x))},null,40,qD)):Te("",!0),R(t).config.loopEndUseCustomDuration?(K(),J("span",KD,"f")):(K(),J("span",ZD,"自动 "+Me(R(i))+"f",1))])])):Te("",!0)])])):Te("",!0),R(t).config.streamBehavior==="loop"?(K(),J("div",JD,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):Te("",!0)],64)):(K(),Pt(Pe,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:R(t).config.burstCount,"onUpdate:modelValue":y[14]||(y[14]=x=>R(t).config.burstCount=x)},null,8,["modelValue"])),ye(Pe,{label:"延迟时间",min:0,max:5,step:.1,modelValue:R(t).config.delay,"onUpdate:modelValue":y[15]||(y[15]=x=>R(t).config.delay=x)},null,8,["modelValue"])],512),[[bi,!R(r).emitMode]])]),M("div",QD,[M("div",{class:"group-head",onClick:y[17]||(y[17]=x=>R(o)("shape"))},[M("span",eN,Me(R(r).shape?"▸":"▾"),1),y[45]||(y[45]=M("span",null,"发射器形状",-1)),M("button",{class:"group-reset",title:"重置发射器形状参数",onClick:y[16]||(y[16]=tt(x=>R(f)("shape"),["stop"]))},"重置")]),le(M("div",tN,[M("label",iN,[y[47]||(y[47]=M("span",null,"形状",-1)),le(M("select",{"onUpdate:modelValue":y[18]||(y[18]=x=>R(t).config.shape=x),class:"inp",onChange:y[19]||(y[19]=(...x)=>R(m)&&R(m)(...x))},[...y[46]||(y[46]=[es('',5)])],544),[[Tt,R(t).config.shape]])]),R(t).config.shape==="circle"||R(t).config.shape==="cone"?(K(),J(Fe,{key:0},[ye(Pe,{label:R(t).config.shape==="cone"?"内径":"内半径",min:0,max:R(t).config.outerRadius,step:1,modelValue:R(t).config.innerRadius,"onUpdate:modelValue":y[20]||(y[20]=x=>R(t).config.innerRadius=x)},null,8,["label","max","modelValue"]),ye(Pe,{label:R(t).config.shape==="cone"?"外径":"外半径",min:R(t).config.innerRadius,max:300,step:1,modelValue:R(t).config.outerRadius,"onUpdate:modelValue":y[21]||(y[21]=x=>R(t).config.outerRadius=x)},null,8,["label","min","modelValue"])],64)):Te("",!0),R(t).config.shape==="cone"?(K(),J(Fe,{key:1},[ye(Pe,{label:"锥形朝向",min:-360,max:360,step:1,modelValue:R(t).config.coneDirection,"onUpdate:modelValue":y[22]||(y[22]=x=>R(t).config.coneDirection=x)},null,8,["modelValue"]),ye(Pe,{label:"锥形开口角度",min:1,max:360,step:1,modelValue:R(t).config.coneAngle,"onUpdate:modelValue":y[23]||(y[23]=x=>R(t).config.coneAngle=x)},null,8,["modelValue"])],64)):R(t).config.shape==="rect"?(K(),J(Fe,{key:2},[ye(Pe,{label:"内宽",min:0,max:R(t).config.outerRectW,step:1,modelValue:R(t).config.innerRectW,"onUpdate:modelValue":y[24]||(y[24]=x=>R(t).config.innerRectW=x)},null,8,["max","modelValue"]),ye(Pe,{label:"内高",min:0,max:R(t).config.outerRectH,step:1,modelValue:R(t).config.innerRectH,"onUpdate:modelValue":y[25]||(y[25]=x=>R(t).config.innerRectH=x)},null,8,["max","modelValue"]),ye(Pe,{label:"外宽",min:R(t).config.innerRectW,max:400,step:1,modelValue:R(t).config.outerRectW,"onUpdate:modelValue":y[26]||(y[26]=x=>R(t).config.outerRectW=x)},null,8,["min","modelValue"]),ye(Pe,{label:"外高",min:R(t).config.innerRectH,max:400,step:1,modelValue:R(t).config.outerRectH,"onUpdate:modelValue":y[27]||(y[27]=x=>R(t).config.outerRectH=x)},null,8,["min","modelValue"])],64)):R(t).config.shape==="path"?(K(),J(Fe,{key:3},[M("label",sN,[y[49]||(y[49]=M("span",null,"选择路径",-1)),le(M("select",{"onUpdate:modelValue":y[28]||(y[28]=x=>R(t).config.spawnPathId=x),class:"inp",onChange:y[29]||(y[29]=(...x)=>R(g)&&R(g)(...x))},[y[48]||(y[48]=M("option",{value:0},"无路径(点发射)",-1)),(K(!0),J(Fe,null,$t(R(e).paths,x=>(K(),J("option",{key:x.id,value:x.id,disabled:!x.enabled},Me(x.name),9,nN))),128))],544),[[Tt,R(t).config.spawnPathId,void 0,{number:!0}]])]),R(t).config.spawnPathId>0?(K(),J("label",rN,[y[51]||(y[51]=M("span",null,"出生分布",-1)),le(M("select",{"onUpdate:modelValue":y[30]||(y[30]=x=>R(t).config.spawnPathDistribution=x),class:"inp"},[...y[50]||(y[50]=[M("option",{value:"fixed"},"等间距固定分布",-1),M("option",{value:"random"},"随机分布",-1)])],512),[[Tt,R(t).config.spawnPathDistribution]])])):Te("",!0)],64)):Te("",!0),y[57]||(y[57]=M("div",{class:"divider"},null,-1)),M("label",oN,[y[54]||(y[54]=M("span",null,"发射角度",-1)),le(M("select",{"onUpdate:modelValue":y[31]||(y[31]=x=>R(t).config.emissionAngleMode=x),class:"inp"},[y[52]||(y[52]=M("option",{value:"fixed"},"固定",-1)),y[53]||(y[53]=M("option",{value:"random"},"随机",-1)),R(t).config.shape==="circle"||R(t).config.shape==="rect"||R(t).config.shape==="cone"?(K(),J("option",aN,"径向(中心向外)")):Te("",!0),R(t).config.shape==="path"&&R(t).config.spawnPathId>0?(K(),J("option",lN,"垂直于路径")):Te("",!0),R(t).config.shape==="path"&&R(t).config.spawnPathId>0?(K(),J("option",cN,"沿路径方向")):Te("",!0)],512),[[Tt,R(t).config.emissionAngleMode]])]),R(t).config.emissionAngleMode==="fixed"?(K(),Pt(Pe,{key:4,label:"固定角度",min:-360,max:360,step:1,modelValue:R(t).config.direction,"onUpdate:modelValue":y[32]||(y[32]=x=>R(t).config.direction=x)},null,8,["modelValue"])):R(t).config.emissionAngleMode==="random"?(K(),J(Fe,{key:5},[ye(Pe,{label:"基准角度",min:-360,max:360,step:1,modelValue:R(t).config.direction,"onUpdate:modelValue":y[33]||(y[33]=x=>R(t).config.direction=x)},null,8,["modelValue"]),ye(Pe,{label:"随机范围",min:0,max:360,step:1,modelValue:R(t).config.spread,"onUpdate:modelValue":y[34]||(y[34]=x=>R(t).config.spread=x)},null,8,["modelValue"])],64)):Te("",!0),R(t).config.shape!=="point"?(K(),J("label",hN,[le(M("input",{type:"checkbox","onUpdate:modelValue":y[35]||(y[35]=x=>R(t).config.showShape=x)},null,512),[[St,R(t).config.showShape]]),y[55]||(y[55]=M("span",{class:"switch-ui"},null,-1)),y[56]||(y[56]=M("span",null,"显示形状",-1))])):Te("",!0)],512),[[bi,!R(r).shape]])])],64))}}),dN=ti(uN,[["__scopeId","data-v-f9eac627"]]),fN={class:"pac"},mN={class:"pac-head"},pN={class:"pac-label"},gN={key:0,class:"pac-modes"},vN=["onClick"],xN={class:"pac-range"},yN={class:"pac-curve"},bN={class:"pac-axis"},wN=ei({__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(),J("div",fN,[M("div",mN,[M("span",pN,Me(s.label),1),s.showModes?(K(),J("div",gN,[(K(!0),J(Fe,null,$t(t.value,r=>(K(),J("button",{key:r.value,class:Be(["pac-mode",{on:s.mode===r.value}]),onClick:o=>i.$emit("update:mode",r.value)},Me(r.label),11,vN))),128))])):Te("",!0)]),s.mode==="fixed"||s.mode==="direction"?(K(),Pt(Pe,{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(),J(Fe,{key:1},[ye(Pe,{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"]),ye(Pe,{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(),J(Fe,{key:2},[M("div",xN,[ye(Pe,{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"]),ye(Pe,{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"])]),M("div",yN,[ye(Js,{"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"]),M("div",bN,[n[6]||(n[6]=M("span",null,"0",-1)),M("span",null,Me(s.curveLabel),1),n[7]||(n[7]=M("span",null,"1",-1))])])],64))]))}}),xn=ti(wN,[["__scopeId","data-v-238f838c"]]),SN={class:"group"},TN={class:"caret"},MN={class:"group-body attr-body"},_N={class:"attr-axis-head"},CN={class:"axis-modes"},AN={class:"life-item"},EN={class:"switch-row"},IN={class:"life-item"},RN={class:"switch-row"},PN={class:"axis-modes life-axis"},kN={class:"life-item"},FN={class:"switch-row"},ON=ei({__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}=Mr();return(h,u)=>(K(),J("div",SN,[M("div",{class:"group-head",onClick:u[1]||(u[1]=d=>R(i)("attr"))},[M("span",TN,Me(R(t).attr?"▸":"▾"),1),u[44]||(u[44]=M("span",null,"粒子属性",-1)),M("button",{class:"group-reset",title:"重置粒子属性参数",onClick:u[0]||(u[0]=tt(d=>R(n)("attr"),["stop"]))},"重置")]),le(M("div",MN,[u[52]||(u[52]=M("div",{class:"attr-section-title"},"粒子初始参数",-1)),ye(xn,{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"]),ye(xn,{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"]),M("div",_N,[u[45]||(u[45]=M("span",null,"初始缩放",-1)),M("div",CN,[M("button",{class:Be(["axis-mode",{on:R(e).config.scaleAxisMode==="uniform"}]),onClick:u[10]||(u[10]=d=>R(e).config.scaleAxisMode="uniform")},"统一",2),M("button",{class:Be(["axis-mode",{on:R(e).config.scaleAxisMode==="separate"}]),onClick:u[11]||(u[11]=d=>R(e).config.scaleAxisMode="separate")},"XY分离",2)])]),ye(xn,{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(),Pt(xn,{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),ye(xn,{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]=M("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),M("div",AN,[M("label",EN,[le(M("input",{type:"checkbox","onUpdate:modelValue":u[24]||(u[24]=d=>R(e).config.speedOverLifeEnabled=d)},null,512),[[St,R(e).config.speedOverLifeEnabled]]),u[46]||(u[46]=M("span",{class:"switch-ui"},null,-1)),u[47]||(u[47]=M("span",null,"生命周期内速度",-1))]),R(e).config.speedOverLifeEnabled?(K(),Pt(xn,{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)]),M("div",IN,[M("label",RN,[le(M("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),[[St,R(e).config.scaleOverLifeEnabled]]),u[48]||(u[48]=M("span",{class:"switch-ui"},null,-1)),u[49]||(u[49]=M("span",null,"生命周期内缩放",-1))]),R(e).config.scaleOverLifeEnabled?(K(),J(Fe,{key:0},[M("div",PN,[M("button",{class:Be(["axis-mode",{on:R(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:u[30]||(u[30]=d=>R(e).config.scaleOverLifeAxisMode="uniform")},"统一",2),M("button",{class:Be(["axis-mode",{on:R(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:u[31]||(u[31]=d=>R(e).config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),ye(xn,{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(),Pt(xn,{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)]),M("div",kN,[M("label",FN,[le(M("input",{type:"checkbox","onUpdate:modelValue":u[39]||(u[39]=d=>R(e).config.rotationOverLifeEnabled=d)},null,512),[[St,R(e).config.rotationOverLifeEnabled]]),u[50]||(u[50]=M("span",{class:"switch-ui"},null,-1)),u[51]||(u[51]=M("span",null,"生命周期内旋转",-1))]),R(e).config.rotationOverLifeEnabled?(K(),Pt(xn,{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),[[bi,!R(t).attr]])]))}}),BN=ti(ON,[["__scopeId","data-v-cf6b86a5"]]),LN={class:"gradient-editor"},DN=["title","onClick","onDblclick","onPointerdown"],NN={key:0,class:"gradient-controls"},UN=["value"],$N=["value"],XN={class:"gradient-position"},VN=["value"],YN=["disabled"],GN=ei({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Ye(null),r=Ye(0),o=qe(()=>t.modelValue[r.value]||null),a=qe(()=>[...t.modelValue].sort((_,I)=>_.position-I.position)),c=qe(()=>{const _=a.value;return _.length?`linear-gradient(90deg, ${_.map(I=>`${I.color} ${l(I.position)*100}%`).join(", ")})`:"#ffffff"});Yi(()=>t.modelValue.length,_=>{r.value>=_&&(r.value=Math.max(0,_-1))});function l(_){return Math.min(1,Math.max(0,Number(_)||0))}function h(){return t.modelValue.map(_=>({position:l(_.position),color:_.color}))}function u(_,I){const F=h();F[_]&&(F[_]={...F[_],...I},i("update:modelValue",F))}function d(_){u(r.value,{color:_.target.value})}function f(_){var E;const I=_.target,F=b(I.value,((E=o.value)==null?void 0:E.color)||"#ffffff");I.value=F,u(r.value,{color:F})}function p(_){const I=_.target;f(_),I.blur()}function m(_){const I=Number(_.target.value);Number.isFinite(I)&&u(r.value,{position:l(I/100)})}function g(_){const I=h();I.push({position:l(_),color:A(I,_)}),r.value=I.length-1,i("update:modelValue",I)}function v(_){if(!n.value)return;const I=n.value.getBoundingClientRect();g((_.clientX-I.left)/Math.max(1,I.width))}function y(){const _=a.value;let I=.5;if(_.length>1){let F=-1;for(let E=0;E<_.length-1;E++){const k=_[E+1].position-_[E].position;k>F&&(F=k,I=(_[E].position+_[E+1].position)/2)}}g(I)}function x(_){if(t.modelValue.length<=2||_<0)return;const I=h().filter((F,E)=>E!==_);r.value=Math.min(_,I.length-1),i("update:modelValue",I)}function T(_,I){if(!n.value)return;r.value=I;const F=k=>{const B=n.value.getBoundingClientRect();u(I,{position:l((k.clientX-B.left)/Math.max(1,B.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),_.preventDefault()}function A(_,I){const F=[..._].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;EB.position)continue;const N=(I-k.position)/Math.max(1e-4,B.position-k.position);return S(k.color,B.color,N)}return F[F.length-1].color}function S(_,I,F){const E=$=>{const L=parseInt($.replace("#","").padEnd(6,"0").slice(0,6),16);return[L>>16&255,L>>8&255,L&255]},k=E(_),B=E(I),N=$=>Math.round(k[$]+(B[$]-k[$])*F);return`#${[N(0),N(1),N(2)].map($=>$.toString(16).padStart(2,"0")).join("")}`}function b(_,I){let F=_.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(_,I)=>(K(),J("div",LN,[M("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:gi({background:c.value}),title:"双击色带添加色标",onDblclick:v},[(K(!0),J(Fe,null,$t(s.modelValue,(F,E)=>(K(),J("button",{key:E,type:"button",class:Be(["gradient-stop",{selected:E===r.value}]),style:gi({left:`${l(F.position)*100}%`,"--stop-color":F.color}),title:`${Math.round(l(F.position)*100)}% · ${F.color}`,onClick:tt(k=>r.value=E,["stop"]),onDblclick:tt(k=>x(E),["stop"]),onPointerdown:tt(k=>T(k,E),["stop"])},null,46,DN))),128))],36),o.value?(K(),J("div",NN,[M("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":"色标颜色",onInput:d},null,40,UN),M("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:f,onKeydown:Qr(p,["enter"])},null,40,$N),M("label",XN,[M("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":"色标位置",onInput:m},null,40,VN),I[1]||(I[1]=M("span",null,"%",-1))]),M("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:y},"+"),M("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:s.modelValue.length<=2,onClick:I[0]||(I[0]=F=>x(r.value))},"×",8,YN)])):Te("",!0),I[2]||(I[2]=M("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),bS=ti(GN,[["__scopeId","data-v-f6ab10bf"]]),HN={class:"image-card"},jN={class:"imgrow"},WN=["title"],zN=["src","alt"],qN={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},KN={class:"img-fields"},ZN={key:0,class:"row"},JN={class:"row"},QN=["placeholder"],e4={class:"img-actions"},t4=["title"],i4=["disabled"],s4={class:"thumb-note"},n4={key:0,class:"row"},r4={class:"row"},o4={class:"row"},a4={class:"sequence-note"},l4={class:"resource-weight-row"},c4=["disabled","title"],h4={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},u4={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},d4=ei({__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(),J("div",HN,[M("div",jN,[M("button",{class:"img-thumb",title:s.supportsSequence&&s.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:a},[r.value?(K(),J("img",{key:0,src:r.value,alt:s.resource.textureName},null,8,zN)):(K(),J("svg",qN,[...l[10]||(l[10]=[M("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),M("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),M("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,WN),M("div",KN,[s.showFolder?(K(),J("label",ZN,[l[11]||(l[11]=M("span",null,"子文件夹",-1)),le(M("input",{"onUpdate:modelValue":l[0]||(l[0]=h=>s.resource.textureFolder=h),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[Ge,s.resource.textureFolder]])])):Te("",!0),M("label",JN,[l[12]||(l[12]=M("span",null,"名称",-1)),le(M("input",{"onUpdate:modelValue":l[1]||(l[1]=h=>s.resource.textureName=h),type:"text",class:"inp",placeholder:s.namePlaceholder},null,8,QN),[[Ge,s.resource.textureName]])])]),M("div",e4,[M("button",{class:"mini-btn2",title:`恢复 ${s.defaultFile}`,onClick:l[2]||(l[2]=h=>c.$emit("reset",s.resource.id))},"⟳",8,t4),M("button",{class:"mini-btn2",title:"删除图片资源",disabled:s.resourceCount===1,onClick:l[3]||(l[3]=h=>c.$emit("remove",s.resource.id))},"🗑",8,i4)])]),M("div",s4,Me(n.value),1),s.supportsSequence?(K(),J("label",n4,[l[14]||(l[14]=M("span",null,"图片模式",-1)),le(M("select",{"onUpdate:modelValue":l[4]||(l[4]=h=>s.resource.imageMode=h),class:"inp"},[...l[13]||(l[13]=[M("option",{value:"fixed"},"固定",-1),M("option",{value:"sequence"},"序列帧",-1)])],512),[[Tt,s.resource.imageMode]])])):Te("",!0),s.supportsSequence&&s.resource.imageMode==="sequence"?(K(),J(Fe,{key:1},[M("label",r4,[l[16]||(l[16]=M("span",null,"播放模式",-1)),le(M("select",{"onUpdate:modelValue":l[5]||(l[5]=h=>s.resource.sequencePlayback=h),class:"inp"},[...l[15]||(l[15]=[M("option",{value:"once-hide"},"单次-尾帧消失",-1),M("option",{value:"once-hold"},"单次-尾帧固定",-1),M("option",{value:"loop-forward"},"正向循环",-1),M("option",{value:"loop-reverse"},"反向循环",-1)])],512),[[Tt,s.resource.sequencePlayback]])]),M("label",o4,[l[17]||(l[17]=M("span",null,"播放帧率",-1)),le(M("input",{"onUpdate:modelValue":l[6]||(l[6]=h=>s.resource.sequenceFps=h),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[Ge,s.resource.sequenceFps,void 0,{number:!0}]])]),M("button",{class:"sequence-pick",onClick:l[7]||(l[7]=h=>c.$emit("pickSequence",s.resource.id))},"选择序列帧(多选)"),M("div",a4,Me(o.value),1)],64)):Te("",!0),M("div",l4,[ye(Pe,{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"]),M("button",{class:Be(["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(),J("svg",h4,[...l[18]||(l[18]=[M("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),M("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(K(),J("svg",u4,[...l[19]||(l[19]=[M("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),M("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,c4)]),OT(c.$slots,"default",{},void 0)]))}}),wS=ti(d4,[["__scopeId","data-v-68ff5314"]]),f4={class:"group"},m4={class:"caret"},p4={class:"group-body"},g4={class:"seg"},v4={class:"row"},x4={class:"curve-wrap"},y4={class:"look-title image-title"},b4={class:"row"},w4=["onUpdate:modelValue"],S4=["onUpdate:modelValue"],T4={class:"row resource-color-row"},M4=["onUpdate:modelValue"],_4=["onUpdate:modelValue"],C4={key:0,class:"row resource-color-picker"},A4=["onUpdate:modelValue"],E4=["value","onChange","onKeydown"],I4={key:0,class:"random-color-hint"},R4={class:"resource-alpha-head"},P4={class:"alpha-modes"},k4=["onClick"],F4=["onClick"],O4=["onClick"],B4={class:"row"},L4=["onUpdate:modelValue"],D4={class:"resource-alpha-curve"},N4=ei({__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:y,select:x,ALPHA_CURVE:T,RESOURCE_ALPHA_CURVE:A}=Mr();return(S,b)=>(K(),J("div",f4,[M("div",{class:"group-head",onClick:b[1]||(b[1]=_=>R(v)("look"))},[M("span",m4,Me(R(g).look?"▸":"▾"),1),b[10]||(b[10]=M("span",null,"外观与资源",-1)),M("button",{class:"group-reset",title:"重置外观与资源参数",onClick:b[0]||(b[0]=tt(_=>R(y)("look"),["stop"]))},"重置")]),le(M("div",p4,[b[24]||(b[24]=M("div",{class:"look-title"},"透明度",-1)),M("div",g4,[M("button",{class:Be(["seg-btn",{active:R(t).config.alphaMode==="curve"}]),onClick:b[2]||(b[2]=_=>R(t).config.alphaMode="curve")},"曲线",2),M("button",{class:Be(["seg-btn",{active:R(t).config.alphaMode==="fixed"}]),onClick:b[3]||(b[3]=_=>R(t).config.alphaMode="fixed")},"固定",2)]),R(t).config.alphaMode==="fixed"?(K(),Pt(Pe,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:R(t).config.alpha,"onUpdate:modelValue":b[4]||(b[4]=_=>R(t).config.alpha=_)},null,8,["modelValue"])):(K(),J(Fe,{key:1},[M("label",v4,[b[12]||(b[12]=M("span",null,"曲线模式",-1)),le(M("select",{"onUpdate:modelValue":b[5]||(b[5]=_=>R(t).config.curveMode=_),class:"inp"},[...b[11]||(b[11]=[M("option",null,"跟随导出",-1),M("option",null,"线性",-1),M("option",null,"贝塞尔",-1)])],512),[[Tt,R(t).config.curveMode]])]),M("div",x4,[ye(Js,{modelValue:R(t).config.alphaCurve,"onUpdate:modelValue":b[6]||(b[6]=_=>R(t).config.alphaCurve=_),"default-value":R(T),mode:R(e)(R(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),b[13]||(b[13]=M("div",{class:"curve-labels"},[M("span",null,"0(透明)"),M("span",null,"生命周期 →"),M("span",null,"1(不透明)")],-1))])],64)),M("div",y4,[b[14]||(b[14]=M("span",null,"图片资源",-1)),M("button",{class:"image-add",title:"新增图片资源",onClick:b[7]||(b[7]=(..._)=>R(r)&&R(r)(..._))},"+")]),(K(!0),J(Fe,null,$t(R(t).config.imageResources,_=>(K(),Pt(wS,{key:_.id,resource:_,"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(()=>[ye(Pe,{label:"缩放",min:.1,max:3,step:.05,modelValue:_.scale,"onUpdate:modelValue":I=>_.scale=I},null,8,["modelValue","onUpdate:modelValue"]),M("label",b4,[b[15]||(b[15]=M("span",null,"轴心 x,y",-1)),le(M("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":I=>_.anchorX=I},null,8,w4),[[Ge,_.anchorX,void 0,{number:!0}]]),le(M("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":I=>_.anchorY=I},null,8,S4),[[Ge,_.anchorY,void 0,{number:!0}]])]),b[23]||(b[23]=M("div",{class:"resource-divider"},null,-1)),M("label",T4,[b[18]||(b[18]=M("span",null,"颜色",-1)),le(M("select",{"onUpdate:modelValue":I=>_.colorMode=I,class:"inp"},[...b[16]||(b[16]=[M("option",{value:"fixed"},"固定色",-1),M("option",{value:"random"},"随机颜色",-1),M("option",{value:"lifetime"},"生命周期",-1)])],8,M4),[[Tt,_.colorMode]]),le(M("select",{"onUpdate:modelValue":I=>_.blend=I,class:"inp blend-select"},[...b[17]||(b[17]=[M("option",{value:"normal"},"正常",-1),M("option",{value:"add"},"相加",-1),M("option",{value:"multiply"},"相乘",-1),M("option",{value:"screen"},"滤色",-1)])],8,_4),[[Tt,_.blend]])]),_.colorMode==="fixed"?(K(),J("label",C4,[b[19]||(b[19]=M("span",null,"固定色",-1)),le(M("input",{type:"color","onUpdate:modelValue":I=>_.colorStart=I,class:"colr"},null,8,A4),[[Ge,_.colorStart]]),M("input",{type:"text",class:"hex-input",value:_.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:I=>R(u)(_,I),onKeydown:Qr(I=>R(d)(_,I),["enter"])},null,40,E4)])):(K(),J(Fe,{key:1},[ye(bS,{modelValue:_.colorGradient,"onUpdate:modelValue":I=>_.colorGradient=I},null,8,["modelValue","onUpdate:modelValue"]),_.colorMode==="random"?(K(),J("div",I4,"每个粒子出生时从色带随机取色,生命周期内保持不变")):Te("",!0)],64)),M("div",R4,[b[20]||(b[20]=M("span",null,"独立透明度",-1)),M("div",P4,[M("button",{class:Be({on:_.independentAlpha==="off"}),onClick:I=>_.independentAlpha="off"},"关闭",10,k4),M("button",{class:Be({on:_.independentAlpha==="fixed"}),onClick:I=>_.independentAlpha="fixed"},"固定",10,F4),M("button",{class:Be({on:_.independentAlpha==="curve"}),onClick:I=>_.independentAlpha="curve"},"曲线",10,O4)])]),_.independentAlpha==="fixed"?(K(),Pt(Pe,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:_.alpha,"onUpdate:modelValue":I=>_.alpha=I},null,8,["modelValue","onUpdate:modelValue"])):_.independentAlpha==="curve"?(K(),J(Fe,{key:3},[M("label",B4,[b[22]||(b[22]=M("span",null,"曲线模式",-1)),le(M("select",{"onUpdate:modelValue":I=>_.alphaCurveMode=I,class:"inp"},[...b[21]||(b[21]=[M("option",null,"跟随导出",-1),M("option",null,"线性",-1),M("option",null,"贝塞尔",-1)])],8,L4),[[Tt,_.alphaCurveMode]])]),M("div",D4,[ye(Js,{modelValue:_.alphaCurve,"onUpdate:modelValue":I=>_.alphaCurve=I,"default-value":R(A),mode:R(e)(_.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):Te("",!0)]),_:2},1032,["resource","resource-count","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),M("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]=(..._)=>R(c)&&R(c)(..._))},null,544),M("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]=(..._)=>R(l)&&R(l)(..._))},null,544)],512),[[bi,!R(g).look]])]))}}),U4=ti(N4,[["__scopeId","data-v-d8fe7aad"]]),$4={class:"group"},X4={class:"caret"},V4={class:"group-body"},Y4={class:"modifier-item"},G4={class:"switch-row modifier-switch"},H4={key:0,class:"modifier-params"},j4={class:"modifier-item"},W4={class:"switch-row modifier-switch"},z4={key:0,class:"modifier-params gravity-params"},q4={class:"modifier-mode-row"},K4={class:"modifier-item"},Z4={class:"switch-row modifier-switch"},J4={key:0,class:"modifier-params gravity-params"},Q4={class:"modifier-mode-row"},e5={class:"modifier-item"},t5={class:"switch-row modifier-switch"},i5={key:0,class:"modifier-params"},s5={class:"row"},n5={class:"switch-row"},r5={class:"modifier-item"},o5={class:"switch-row modifier-switch"},a5={key:0,class:"modifier-params"},l5={class:"row"},c5={class:"switch-row"},h5={class:"modifier-item"},u5={class:"switch-row modifier-switch"},d5={key:0,class:"modifier-params"},f5={class:"row"},m5={class:"row"},p5={class:"switch-row"},g5={class:"modifier-item"},v5={class:"switch-row modifier-switch"},x5={key:0,class:"modifier-params trail-params"},y5={class:"trail-section-head"},b5={class:"row"},w5=["onUpdate:modelValue"],S5={class:"row"},T5=["onUpdate:modelValue"],M5={class:"row"},_5=["onUpdate:modelValue"],C5={class:"switch-row trail-sub-switch"},A5=["onUpdate:modelValue"],E5={class:"switch-row trail-sub-switch"},I5=["onUpdate:modelValue"],R5={class:"trail-mode-head"},P5={class:"alpha-modes"},k5=["onClick"],F5=["onClick"],O5=["onClick"],B5={class:"row"},L5=["onUpdate:modelValue"],D5={key:6,class:"row trail-fixed-color"},N5=["onUpdate:modelValue"],U5=["value","onChange","onKeydown"],$5={class:"trail-mode-head"},X5={class:"alpha-modes"},V5=["onClick"],Y5=["onClick"],G5=["onClick"],H5={class:"trail-grid-row"},j5={class:"modifier-item"},W5={class:"switch-row modifier-switch"},z5=["disabled"],q5={key:0,class:"modifier-params emitter-follow-params"},K5={class:"field-block"},Z5=["value"],J5={key:0,value:"bone"},Q5={class:"field-block"},e8=["value"],t8={class:"field-block"},i8={class:"field-grid follow-grid"},s8={class:"compact-field"},n8={class:"compact-field"},r8={class:"field-block"},o8={key:0,class:"bone-follow-target"},a8={key:1,class:"bone-follow-missing"},l8={class:"field-block"},c8={class:"field-grid follow-grid"},h8={class:"compact-field"},u8={class:"compact-field"},d8={class:"bone-follow-transform-grid"},f8={class:"compact-field"},m8={class:"compact-field"},p8={class:"compact-field"},g8={class:"modifier-item"},v8={class:"switch-row modifier-switch"},x8={key:0,class:"modifier-params collision-filter-params"},y8={class:"collision-filter-tags"},b8=["title"],w8=["aria-label","onClick"],S8=["disabled","title"],T8={key:0,class:"collision-filter-empty"},M8={key:1,class:"collision-filter-picker"},_8=["onClick"],C8=ei({__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:y,selectedCollisionBodies:x,availableCollisionBodies:T,addCollisionBody:A,removeCollisionBody:S,collapsed:b,toggle:_,onEmitterFollowModeChange:I,bindSelectedBone:F,resetModule:E,select:k,LINEAR_CURVE:B,FLAT_CURVE:N,TRAIL_ALPHA_CURVE:$,TRAIL_SHAPE_CURVE:L}=Mr();return(U,C)=>(K(),J("div",$4,[M("div",{class:"group-head",onClick:C[1]||(C[1]=P=>R(_)("mods"))},[M("span",X4,Me(R(b).mods?"▸":"▾"),1),C[69]||(C[69]=M("span",null,"修改器",-1)),M("button",{class:"group-reset",title:"重置修改器参数",onClick:C[0]||(C[0]=tt(P=>R(E)("mods"),["stop"]))},"重置")]),le(M("div",V4,[M("div",Y4,[M("label",G4,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[2]||(C[2]=P=>R(t).config.noise=P)},null,512),[[St,R(t).config.noise]]),C[70]||(C[70]=M("span",{class:"switch-ui"},null,-1)),C[71]||(C[71]=M("span",null,"开启移动噪声",-1))]),R(t).config.noise?(K(),J("div",H4,[ye(Pe,{label:"强度",min:0,max:100,step:1,modelValue:R(t).config.noiseAmt,"onUpdate:modelValue":C[3]||(C[3]=P=>R(t).config.noiseAmt=P)},null,8,["modelValue"]),ye(Pe,{label:"波动范围",min:0,max:500,step:1,modelValue:R(t).config.noiseRange,"onUpdate:modelValue":C[4]||(C[4]=P=>R(t).config.noiseRange=P)},null,8,["modelValue"]),ye(Pe,{label:"时间流速",min:0,max:10,step:.1,modelValue:R(t).config.noiseSpeed,"onUpdate:modelValue":C[5]||(C[5]=P=>R(t).config.noiseSpeed=P)},null,8,["modelValue"]),C[72]||(C[72]=M("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):Te("",!0)]),M("div",j4,[M("label",W4,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[6]||(C[6]=P=>R(t).config.useGravity=P)},null,512),[[St,R(t).config.useGravity]]),C[73]||(C[73]=M("span",{class:"switch-ui"},null,-1)),C[74]||(C[74]=M("span",null,"开启重力",-1))]),R(t).config.useGravity?(K(),J("div",z4,[M("div",q4,[M("button",{class:Be(["axis-mode",{on:R(t).config.gravityMode==="fixed"}]),onClick:C[7]||(C[7]=P=>R(t).config.gravityMode="fixed")},"固定",2),M("button",{class:Be(["axis-mode",{on:R(t).config.gravityMode==="random"}]),onClick:C[8]||(C[8]=P=>R(t).config.gravityMode="random")},"随机",2)]),R(t).config.gravityMode==="fixed"?(K(),Pt(Pe,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMin,"onUpdate:modelValue":C[9]||(C[9]=P=>R(t).config.gravityMin=P)},null,8,["modelValue"])):(K(),J(Fe,{key:1},[ye(Pe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMin,"onUpdate:modelValue":C[10]||(C[10]=P=>R(t).config.gravityMin=P)},null,8,["modelValue"]),ye(Pe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMax,"onUpdate:modelValue":C[11]||(C[11]=P=>R(t).config.gravityMax=P)},null,8,["modelValue"])],64)),ye(Pe,{label:"方向",min:-360,max:360,step:1,modelValue:R(t).config.gravityDirection,"onUpdate:modelValue":C[12]||(C[12]=P=>R(t).config.gravityDirection=P)},null,8,["modelValue"]),C[75]||(C[75]=M("div",{class:"gravity-curve-title"},[M("span",null,"生命周期内重力"),M("span",null,"纵轴:强度 0~1")],-1)),ye(Js,{modelValue:R(t).config.gravityCurve,"onUpdate:modelValue":C[13]||(C[13]=P=>R(t).config.gravityCurve=P),"default-value":R(N)},null,8,["modelValue","default-value"]),C[76]||(C[76]=M("div",{class:"gravity-curve-axis"},[M("span",null,"0"),M("span",null,"生命周期 →"),M("span",null,"1")],-1)),C[77]||(C[77]=M("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Te("",!0)]),M("div",K4,[M("label",Z4,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[14]||(C[14]=P=>R(t).config.wind=P)},null,512),[[St,R(t).config.wind]]),C[78]||(C[78]=M("span",{class:"switch-ui"},null,-1)),C[79]||(C[79]=M("span",null,"开启风力",-1))]),R(t).config.wind?(K(),J("div",J4,[M("div",Q4,[M("button",{class:Be(["axis-mode",{on:R(t).config.windMode==="fixed"}]),onClick:C[15]||(C[15]=P=>R(t).config.windMode="fixed")},"固定",2),M("button",{class:Be(["axis-mode",{on:R(t).config.windMode==="random"}]),onClick:C[16]||(C[16]=P=>R(t).config.windMode="random")},"随机",2)]),R(t).config.windMode==="fixed"?(K(),Pt(Pe,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMin,"onUpdate:modelValue":C[17]||(C[17]=P=>R(t).config.windMin=P)},null,8,["modelValue"])):(K(),J(Fe,{key:1},[ye(Pe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMin,"onUpdate:modelValue":C[18]||(C[18]=P=>R(t).config.windMin=P)},null,8,["modelValue"]),ye(Pe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMax,"onUpdate:modelValue":C[19]||(C[19]=P=>R(t).config.windMax=P)},null,8,["modelValue"])],64)),ye(Pe,{label:"方向",min:-360,max:360,step:1,modelValue:R(t).config.windDirection,"onUpdate:modelValue":C[20]||(C[20]=P=>R(t).config.windDirection=P)},null,8,["modelValue"]),C[80]||(C[80]=M("div",{class:"gravity-curve-title"},[M("span",null,"生命周期内风力"),M("span",null,"纵轴:强度 0~1")],-1)),ye(Js,{modelValue:R(t).config.windCurve,"onUpdate:modelValue":C[21]||(C[21]=P=>R(t).config.windCurve=P),"default-value":R(N)},null,8,["modelValue","default-value"]),C[81]||(C[81]=M("div",{class:"gravity-curve-axis"},[M("span",null,"0"),M("span",null,"生命周期 →"),M("span",null,"1")],-1)),C[82]||(C[82]=M("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Te("",!0)]),M("div",e5,[M("label",t5,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[22]||(C[22]=P=>R(t).config.forceField=P)},null,512),[[St,R(t).config.forceField]]),C[83]||(C[83]=M("span",{class:"switch-ui"},null,-1)),C[84]||(C[84]=M("span",null,"开启力场",-1))]),R(t).config.forceField?(K(),J("div",i5,[ye(Pe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.forceCenterX,"onUpdate:modelValue":C[23]||(C[23]=P=>R(t).config.forceCenterX=P)},null,8,["modelValue"]),ye(Pe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.forceCenterY,"onUpdate:modelValue":C[24]||(C[24]=P=>R(t).config.forceCenterY=P)},null,8,["modelValue"]),ye(Pe,{label:"力场强度",min:-300,max:300,step:1,modelValue:R(t).config.forceStrength,"onUpdate:modelValue":C[25]||(C[25]=P=>R(t).config.forceStrength=P)},null,8,["modelValue"]),ye(Pe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:R(t).config.forceRadius,"onUpdate:modelValue":C[26]||(C[26]=P=>R(t).config.forceRadius=P)},null,8,["modelValue"]),M("label",s5,[C[86]||(C[86]=M("span",null,"衰减模式",-1)),le(M("select",{"onUpdate:modelValue":C[27]||(C[27]=P=>R(t).config.forceFalloff=P),class:"inp"},[...C[85]||(C[85]=[M("option",{value:"constant"},"恒定(范围内力度不变)",-1),M("option",{value:"linear"},"线性衰减(边缘为 0)",-1),M("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[Tt,R(t).config.forceFalloff]])]),C[89]||(C[89]=M("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1)),M("label",n5,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[28]||(C[28]=P=>R(t).config.showForceFieldShape=P)},null,512),[[St,R(t).config.showForceFieldShape]]),C[87]||(C[87]=M("span",{class:"switch-ui"},null,-1)),C[88]||(C[88]=M("span",null,"显示形状",-1))])])):Te("",!0)]),M("div",r5,[M("label",o5,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[29]||(C[29]=P=>R(t).config.vortex=P)},null,512),[[St,R(t).config.vortex]]),C[90]||(C[90]=M("span",{class:"switch-ui"},null,-1)),C[91]||(C[91]=M("span",null,"开启漩涡",-1))]),R(t).config.vortex?(K(),J("div",a5,[ye(Pe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.vortexCenterX,"onUpdate:modelValue":C[30]||(C[30]=P=>R(t).config.vortexCenterX=P)},null,8,["modelValue"]),ye(Pe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.vortexCenterY,"onUpdate:modelValue":C[31]||(C[31]=P=>R(t).config.vortexCenterY=P)},null,8,["modelValue"]),ye(Pe,{label:"力场强度",min:-300,max:300,step:1,modelValue:R(t).config.vortexStrength,"onUpdate:modelValue":C[32]||(C[32]=P=>R(t).config.vortexStrength=P)},null,8,["modelValue"]),ye(Pe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:R(t).config.vortexRadius,"onUpdate:modelValue":C[33]||(C[33]=P=>R(t).config.vortexRadius=P)},null,8,["modelValue"]),M("label",l5,[C[93]||(C[93]=M("span",null,"衰减模式",-1)),le(M("select",{"onUpdate:modelValue":C[34]||(C[34]=P=>R(t).config.vortexFalloff=P),class:"inp"},[...C[92]||(C[92]=[M("option",{value:"constant"},"恒定(范围内力度不变)",-1),M("option",{value:"linear"},"线性衰减(边缘为 0)",-1),M("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[Tt,R(t).config.vortexFalloff]])]),C[96]||(C[96]=M("div",{class:"modifier-hint"},"正数逆时针 · 负数顺时针",-1)),M("label",c5,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[35]||(C[35]=P=>R(t).config.showVortexShape=P)},null,512),[[St,R(t).config.showVortexShape]]),C[94]||(C[94]=M("span",{class:"switch-ui"},null,-1)),C[95]||(C[95]=M("span",null,"显示形状",-1))])])):Te("",!0)]),M("div",h5,[M("label",u5,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[36]||(C[36]=P=>R(t).config.attraction=P)},null,512),[[St,R(t).config.attraction]]),C[97]||(C[97]=M("span",{class:"switch-ui"},null,-1)),C[98]||(C[98]=M("span",null,"开启吸附",-1))]),R(t).config.attraction?(K(),J("div",d5,[ye(Pe,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.attractionCenterX,"onUpdate:modelValue":C[37]||(C[37]=P=>R(t).config.attractionCenterX=P)},null,8,["modelValue"]),ye(Pe,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.attractionCenterY,"onUpdate:modelValue":C[38]||(C[38]=P=>R(t).config.attractionCenterY=P)},null,8,["modelValue"]),ye(Pe,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:R(t).config.attractionRadius,"onUpdate:modelValue":C[39]||(C[39]=P=>R(t).config.attractionRadius=P)},null,8,["modelValue"]),ye(Pe,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:R(t).config.attractionDuration,"onUpdate:modelValue":C[40]||(C[40]=P=>R(t).config.attractionDuration=P)},null,8,["modelValue"]),ye(Pe,{label:"延迟时间",min:0,max:30,step:.05,modelValue:R(t).config.attractionDelay,"onUpdate:modelValue":C[41]||(C[41]=P=>R(t).config.attractionDelay=P)},null,8,["modelValue"]),M("label",f5,[C[100]||(C[100]=M("span",null,"延迟方式",-1)),le(M("select",{"onUpdate:modelValue":C[42]||(C[42]=P=>R(t).config.attractionDelayMode=P),class:"inp"},[...C[99]||(C[99]=[M("option",{value:"global"},"统一时间",-1),M("option",{value:"particle"},"单粒子生命",-1)])],512),[[Tt,R(t).config.attractionDelayMode]])]),M("label",m5,[C[102]||(C[102]=M("span",null,"吸附方式",-1)),le(M("select",{"onUpdate:modelValue":C[43]||(C[43]=P=>R(t).config.attractionPath=P),class:"inp"},[...C[101]||(C[101]=[M("option",{value:"linear"},"直线",-1),M("option",{value:"curve"},"曲线",-1)])],512),[[Tt,R(t).config.attractionPath]])]),C[105]||(C[105]=M("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1)),M("label",p5,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[44]||(C[44]=P=>R(t).config.showAttractionShape=P)},null,512),[[St,R(t).config.showAttractionShape]]),C[103]||(C[103]=M("span",{class:"switch-ui"},null,-1)),C[104]||(C[104]=M("span",null,"显示形状",-1))])])):Te("",!0)]),M("div",g5,[M("label",v5,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[45]||(C[45]=P=>R(t).config.trail=P)},null,512),[[St,R(t).config.trail]]),C[106]||(C[106]=M("span",{class:"switch-ui"},null,-1)),C[107]||(C[107]=M("span",null,"开启拖尾",-1))]),R(t).config.trail?(K(),J("div",x5,[M("div",y5,[C[108]||(C[108]=M("div",{class:"trail-section-title"},"拖尾独立图片",-1)),M("button",{class:"image-add",title:"增加拖尾图片资源",onClick:C[46]||(C[46]=(...P)=>R(n)&&R(n)(...P))},"+")]),(K(!0),J(Fe,null,$t(R(t).config.trailResources,P=>(K(),Pt(wS,{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(()=>[C[124]||(C[124]=M("div",{class:"resource-divider"},null,-1)),ye(Pe,{label:"旋转",min:-360,max:360,step:1,"model-value":P.rotation,"onUpdate:modelValue":O=>R(c)(P.id,O)},null,8,["model-value","onUpdate:modelValue"]),ye(Pe,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":P.boneCount,"onUpdate:modelValue":O=>R(a)(P.id,O)},null,8,["model-value","onUpdate:modelValue"]),ye(Pe,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:P.trailRatio,"onUpdate:modelValue":O=>P.trailRatio=O},null,8,["modelValue","onUpdate:modelValue"]),M("label",b5,[C[110]||(C[110]=M("span",null,"拖尾长度",-1)),le(M("select",{"onUpdate:modelValue":O=>P.lengthMode=O,class:"inp"},[...C[109]||(C[109]=[M("option",{value:"fixed"},"固定",-1),M("option",{value:"random"},"随机范围",-1)])],8,w5),[[Tt,P.lengthMode]])]),P.lengthMode==="fixed"?(K(),Pt(Pe,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:P.length,"onUpdate:modelValue":O=>P.length=O},null,8,["modelValue","onUpdate:modelValue"])):(K(),J(Fe,{key:1},[ye(Pe,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:P.lengthMin,"onUpdate:modelValue":O=>P.lengthMin=O},null,8,["modelValue","onUpdate:modelValue"]),ye(Pe,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:P.lengthMax,"onUpdate:modelValue":O=>P.lengthMax=O},null,8,["modelValue","onUpdate:modelValue"])],64)),M("label",S5,[C[112]||(C[112]=M("span",null,"拖尾宽度",-1)),le(M("select",{"onUpdate:modelValue":O=>P.widthSizeMode=O,class:"inp"},[...C[111]||(C[111]=[M("option",{value:"fixed"},"固定",-1),M("option",{value:"random"},"随机范围",-1)])],8,T5),[[Tt,P.widthSizeMode]])]),P.widthSizeMode==="fixed"?(K(),Pt(Pe,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:P.width,"onUpdate:modelValue":O=>P.width=O},null,8,["modelValue","onUpdate:modelValue"])):(K(),J(Fe,{key:3},[ye(Pe,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:P.widthMin,"onUpdate:modelValue":O=>P.widthMin=O},null,8,["modelValue","onUpdate:modelValue"]),ye(Pe,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:P.widthMax,"onUpdate:modelValue":O=>P.widthMax=O},null,8,["modelValue","onUpdate:modelValue"])],64)),M("label",M5,[C[114]||(C[114]=M("span",null,"宽度缩放",-1)),le(M("select",{"onUpdate:modelValue":O=>P.widthMode=O,class:"inp"},[...C[113]||(C[113]=[M("option",{value:"particle"},"跟随粒子",-1),M("option",{value:"fixed"},"固定",-1)])],8,_5),[[Tt,P.widthMode]])]),M("label",C5,[le(M("input",{type:"checkbox","onUpdate:modelValue":O=>P.lifeLengthEnabled=O},null,8,A5),[[St,P.lifeLengthEnabled]]),C[115]||(C[115]=M("span",{class:"switch-ui"},null,-1)),C[116]||(C[116]=M("span",null,"生命周期长度曲线",-1))]),P.lifeLengthEnabled?(K(),Pt(Js,{key:4,modelValue:P.lifeLengthCurve,"onUpdate:modelValue":O=>P.lifeLengthCurve=O,"default-value":R(N)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Te("",!0),M("label",E5,[le(M("input",{type:"checkbox","onUpdate:modelValue":O=>P.shapeEnabled=O},null,8,I5),[[St,P.shapeEnabled]]),C[117]||(C[117]=M("span",{class:"switch-ui"},null,-1)),C[118]||(C[118]=M("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),P.shapeEnabled?(K(),Pt(Js,{key:5,modelValue:P.shapeCurve,"onUpdate:modelValue":O=>P.shapeCurve=O,"default-value":R(L)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Te("",!0),M("div",R5,[C[119]||(C[119]=M("span",null,"颜色模式",-1)),M("div",P5,[M("button",{class:Be(["axis-mode",{on:P.colorMode==="particle"}]),onClick:O=>P.colorMode="particle"},"跟随粒子",10,k5),M("button",{class:Be(["axis-mode",{on:P.colorMode==="fixed"}]),onClick:O=>P.colorMode="fixed"},"固定",10,F5),M("button",{class:Be(["axis-mode",{on:P.colorMode==="curve"}]),onClick:O=>P.colorMode="curve"},"曲线",10,O5)])]),M("label",B5,[C[121]||(C[121]=M("span",null,"混合模式",-1)),le(M("select",{"onUpdate:modelValue":O=>P.blend=O,class:"inp"},[...C[120]||(C[120]=[M("option",{value:"normal"},"正常",-1),M("option",{value:"add"},"相加",-1),M("option",{value:"multiply"},"相乘",-1),M("option",{value:"screen"},"滤色",-1)])],8,L5),[[Tt,P.blend]])]),P.colorMode==="fixed"?(K(),J("label",D5,[C[122]||(C[122]=M("span",null,"固定颜色",-1)),le(M("input",{class:"colr",type:"color","onUpdate:modelValue":O=>P.color=O},null,8,N5),[[Ge,P.color]]),M("input",{class:"hex-input",value:P.color,onChange:O=>R(p)(P,O),onKeydown:Qr(tt(O=>R(m)(P,O),["prevent"]),["enter"])},null,40,U5)])):P.colorMode==="curve"?(K(),Pt(bS,{key:7,modelValue:P.colorGradient,"onUpdate:modelValue":O=>P.colorGradient=O},null,8,["modelValue","onUpdate:modelValue"])):Te("",!0),M("div",$5,[C[123]||(C[123]=M("span",null,"透明度模式",-1)),M("div",X5,[M("button",{class:Be(["axis-mode",{on:P.alphaMode==="particle"}]),onClick:O=>P.alphaMode="particle"},"跟随粒子",10,V5),M("button",{class:Be(["axis-mode",{on:P.alphaMode==="fixed"}]),onClick:O=>P.alphaMode="fixed"},"固定",10,Y5),M("button",{class:Be(["axis-mode",{on:P.alphaMode==="curve"}]),onClick:O=>P.alphaMode="curve"},"曲线",10,G5)])]),P.alphaMode==="fixed"?(K(),Pt(Pe,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:P.alpha,"onUpdate:modelValue":O=>P.alpha=O},null,8,["modelValue","onUpdate:modelValue"])):Te("",!0),P.alphaMode==="curve"?(K(),Pt(Js,{key:9,modelValue:P.alphaCurve,"onUpdate:modelValue":O=>P.alphaCurve=O,"default-value":R($)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Te("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),M("input",{ref_key:"trailTextureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:C[47]||(C[47]=(...P)=>R(l)&&R(l)(...P))},null,544),M("div",H5,[ye(Pe,{label:"网格行数",min:2,max:16,step:1,"model-value":R(t).config.trailGridRows,"onUpdate:modelValue":C[48]||(C[48]=P=>R(o)("trailGridRows",P))},null,8,["model-value"]),ye(Pe,{label:"网格列数",min:2,max:32,step:1,"model-value":R(t).config.trailGridCols,"onUpdate:modelValue":C[49]||(C[49]=P=>R(o)("trailGridCols",P))},null,8,["model-value"])]),C[125]||(C[125]=M("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):Te("",!0)]),M("div",j5,[M("label",W5,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[50]||(C[50]=P=>R(t).config.emitterFollow=P),disabled:R(t).config.streamBehavior==="loop"},null,8,z5),[[St,R(t).config.emitterFollow]]),C[126]||(C[126]=M("span",{class:"switch-ui"},null,-1)),C[127]||(C[127]=M("span",null,"开启发射器跟随",-1))]),R(t).config.emitterFollow&&R(t).config.streamBehavior!=="loop"?(K(),J("div",q5,[M("label",K5,[C[130]||(C[130]=M("span",null,"跟随模式",-1)),M("select",{value:R(t).config.emitterFollowMode,class:"inp",onChange:C[51]||(C[51]=P=>R(I)(P,R(t).config))},[C[128]||(C[128]=M("option",{value:"none"},"无",-1)),C[129]||(C[129]=M("option",{value:"path"},"跟随路径",-1)),R(g)||R(t).config.emitterFollowMode==="bone"?(K(),J("option",J5,"选中的骨骼")):Te("",!0)],40,Z5)]),R(t).config.emitterFollowMode==="path"?(K(),J(Fe,{key:0},[M("label",Q5,[C[132]||(C[132]=M("span",null,"跟随路径",-1)),le(M("select",{"onUpdate:modelValue":C[52]||(C[52]=P=>R(t).config.emitterFollowPathId=P),class:"inp"},[C[131]||(C[131]=M("option",{value:0},"无",-1)),(K(!0),J(Fe,null,$t(R(e).paths,P=>(K(),J("option",{key:P.id,value:P.id},Me(P.name),9,e8))),128))],512),[[Tt,R(t).config.emitterFollowPathId,void 0,{number:!0}]])]),M("label",t8,[C[134]||(C[134]=M("span",null,"发射器角度模式",-1)),le(M("select",{"onUpdate:modelValue":C[53]||(C[53]=P=>R(t).config.emitterAngleMode=P),class:"inp"},[...C[133]||(C[133]=[M("option",{value:"fixed"},"固定角度",-1),M("option",{value:"direction"},"跟随移动方向",-1)])],512),[[Tt,R(t).config.emitterAngleMode]])]),C[140]||(C[140]=M("div",{class:"gravity-curve-title"},[M("span",null,"移动进度曲线 (0→1)")],-1)),ye(Js,{modelValue:R(t).config.emitterFollowCurve,"onUpdate:modelValue":C[54]||(C[54]=P=>R(t).config.emitterFollowCurve=P),"default-value":R(B)},null,8,["modelValue","default-value"]),M("div",i8,[M("label",s8,[C[135]||(C[135]=M("span",null,"移动时长 (s)",-1)),le(M("input",{"onUpdate:modelValue":C[55]||(C[55]=P=>R(t).config.emitterFollowDuration=P),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,R(t).config.emitterFollowDuration,void 0,{number:!0}]])]),M("label",n8,[C[137]||(C[137]=M("span",null,"跟随空间",-1)),le(M("select",{"onUpdate:modelValue":C[56]||(C[56]=P=>R(t).config.emitterFollowSpace=P),class:"inp"},[...C[136]||(C[136]=[M("option",{value:"local"},"局部空间(GEN 移动)",-1),M("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[Tt,R(t).config.emitterFollowSpace]])])]),M("label",r8,[C[139]||(C[139]=M("span",null,"移动方向",-1)),le(M("select",{"onUpdate:modelValue":C[57]||(C[57]=P=>R(t).config.emitterFollowDirection=P),class:"inp"},[...C[138]||(C[138]=[M("option",{value:"forward"},"正向(起点 → 终点)",-1),M("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[Tt,R(t).config.emitterFollowDirection]])]),ye(Pe,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:R(t).config.emitterFollowOffset,"onUpdate:modelValue":C[58]||(C[58]=P=>R(t).config.emitterFollowOffset=P)},null,8,["modelValue"]),C[141]||(C[141]=M("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):R(t).config.emitterFollowMode==="bone"?(K(),J(Fe,{key:1},[R(v)?(K(),J("div",o8,[C[142]||(C[142]=kt("跟随目标:",-1)),M("strong",null,Me(R(v).spine.name)+" / "+Me(R(v).boneName),1)])):(K(),J("div",a8,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),R(g)&&(!R(v)||R(g).spine.id!==R(v).spine.id||R(g).boneName!==R(v).boneName)?(K(),J("button",{key:2,class:"bone-follow-rebind",onClick:C[59]||(C[59]=P=>R(F)(R(t).config))},Me(R(v)?"重新绑定":"绑定")+"当前选中骨骼:"+Me(R(g).spine.name)+" / "+Me(R(g).boneName),1)):Te("",!0),R(v)?(K(),J(Fe,{key:3},[M("label",l8,[C[144]||(C[144]=M("span",null,"跟随空间",-1)),le(M("select",{"onUpdate:modelValue":C[60]||(C[60]=P=>R(t).config.emitterFollowSpace=P),class:"inp"},[...C[143]||(C[143]=[M("option",{value:"local"},"本地空间(随骨骼移动)",-1),M("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[Tt,R(t).config.emitterFollowSpace]])]),M("div",c8,[M("label",h8,[C[145]||(C[145]=M("span",null,"位移偏移 X",-1)),le(M("input",{"onUpdate:modelValue":C[61]||(C[61]=P=>R(t).config.emitterFollowBoneOffsetX=P),type:"number",step:"1",class:"inp"},null,512),[[Ge,R(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),M("label",u8,[C[146]||(C[146]=M("span",null,"位移偏移 Y",-1)),le(M("input",{"onUpdate:modelValue":C[62]||(C[62]=P=>R(t).config.emitterFollowBoneOffsetY=P),type:"number",step:"1",class:"inp"},null,512),[[Ge,R(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),M("div",d8,[M("label",f8,[C[147]||(C[147]=M("span",null,"旋转偏移",-1)),le(M("input",{"onUpdate:modelValue":C[63]||(C[63]=P=>R(t).config.emitterFollowBoneRotation=P),type:"number",step:"1",class:"inp"},null,512),[[Ge,R(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),M("label",m8,[C[148]||(C[148]=M("span",null,"缩放偏移 X",-1)),le(M("input",{"onUpdate:modelValue":C[64]||(C[64]=P=>R(t).config.emitterFollowBoneScaleX=P),type:"number",step:"0.05",class:"inp"},null,512),[[Ge,R(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),M("label",p8,[C[149]||(C[149]=M("span",null,"缩放偏移 Y",-1)),le(M("input",{"onUpdate:modelValue":C[65]||(C[65]=P=>R(t).config.emitterFollowBoneScaleY=P),type:"number",step:"0.05",class:"inp"},null,512),[[Ge,R(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),C[150]||(C[150]=M("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):Te("",!0)],64)):Te("",!0)])):Te("",!0)]),M("div",g8,[M("label",v8,[le(M("input",{type:"checkbox","onUpdate:modelValue":C[66]||(C[66]=P=>R(t).config.collision=P)},null,512),[[St,R(t).config.collision]]),C[151]||(C[151]=M("span",{class:"switch-ui"},null,-1)),C[152]||(C[152]=M("span",null,"开启碰撞",-1))]),R(t).config.collision?(K(),J("div",x8,[C[153]||(C[153]=M("div",{class:"collision-filter-title"},"参与的碰撞对象",-1)),M("div",y8,[(K(!0),J(Fe,null,$t(R(x),P=>(K(),J("span",{key:P.id,class:Be(["collision-filter-tag",{disabled:!P.enabled}]),title:P.enabled?P.name:`${P.name}(碰撞体已禁用)`},[M("span",null,Me(P.name),1),M("button",{type:"button","aria-label":`清除碰撞对象 ${P.name}`,onClick:O=>R(S)(P.id)},"×",8,w8)],10,b8))),128)),M("button",{type:"button",class:Be(["collision-filter-add",{active:R(y)}]),disabled:R(T).length===0,title:R(T).length?"加入场景碰撞对象":"没有可加入的碰撞对象",onClick:C[67]||(C[67]=P=>y.value=!R(y))},"+",10,S8)]),R(x).length===0?(K(),J("div",T8,"未选择碰撞对象,当前粒子不会发生碰撞")):Te("",!0),R(y)&&R(T).length?(K(),J("div",M8,[(K(!0),J(Fe,null,$t(R(T),P=>(K(),J("button",{key:P.id,type:"button",onClick:O=>R(A)(P.id)},[M("span",null,Me(P.name),1),M("small",null,Me(P.enabled?"可用":"已禁用"),1)],8,_8))),128))])):Te("",!0),C[154]||(C[154]=M("div",{class:"modifier-hint"},"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",-1))])):Te("",!0)]),ye(Pe,{label:"阻尼",min:0,max:2,step:.05,modelValue:R(t).config.damping,"onUpdate:modelValue":C[68]||(C[68]=P=>R(t).config.damping=P)},null,8,["modelValue"])],512),[[bi,!R(b).mods]])]))}}),A8=ti(C8,[["__scopeId","data-v-96ef634f"]]),E8={class:"group"},I8={class:"caret"},R8={class:"group-body export-settings"},P8={class:"export-field"},k8={class:"export-field"},F8={class:"export-field"},O8={key:0,class:"export-help"},B8={class:"export-fps-row"},L8={class:"export-field export-fps-field"},D8={class:"export-checkbox"},N8={class:"export-switches"},U8={class:"switch-row export-switch"},$8={class:"switch-row export-switch"},X8={class:"switch-row export-switch export-switch-last"},V8=ei({__name:"ExportSettingsSection",setup(s){const{exportSettings:e,collapsed:t,toggle:i,resetModule:n,normalizeExportFps:r,select:o}=Mr();return(a,c)=>(K(),J("div",E8,[M("div",{class:"group-head",onClick:c[1]||(c[1]=l=>R(i)("export"))},[M("span",I8,Me(R(t).export?"▸":"▾"),1),c[11]||(c[11]=M("span",null,"导出设置",-1)),M("button",{class:"group-reset",title:"重置导出设置",onClick:c[0]||(c[0]=tt(l=>R(n)("export"),["stop"]))},"重置")]),le(M("div",R8,[M("label",P8,[c[12]||(c[12]=M("span",null,"图片路径 (Spine Images Path)",-1)),le(M("input",{"onUpdate:modelValue":c[2]||(c[2]=l=>R(e).imagesPath=l),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[Ge,R(e).imagesPath,void 0,{trim:!0}]])]),M("label",k8,[c[14]||(c[14]=M("span",null,"Spine 版本",-1)),le(M("select",{"onUpdate:modelValue":c[3]||(c[3]=l=>R(e).spineVersion=l),class:"inp export-input"},[...c[13]||(c[13]=[es('',5)])],512),[[Tt,R(e).spineVersion]])]),M("label",F8,[c[16]||(c[16]=M("span",null,"关键帧插值曲线",-1)),le(M("select",{"onUpdate:modelValue":c[4]||(c[4]=l=>R(e).keyframeCurve=l),class:"inp export-input"},[...c[15]||(c[15]=[M("option",{value:"linear"},"线性 (Linear)",-1),M("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[Tt,R(e).keyframeCurve]])]),c[25]||(c[25]=M("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),R(e).spineVersion==="3.8"?(K(),J("div",O8,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):Te("",!0),M("div",B8,[M("label",L8,[c[17]||(c[17]=M("span",null,"导出 FPS",-1)),le(M("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),[[Ge,R(e).fps,void 0,{number:!0}]])]),M("label",D8,[le(M("input",{"onUpdate:modelValue":c[7]||(c[7]=l=>R(e).omitFps=l),type:"checkbox"},null,512),[[St,R(e).omitFps]]),c[18]||(c[18]=kt("不写 fps",-1))])]),c[26]||(c[26]=M("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),M("div",N8,[M("label",U8,[le(M("input",{"onUpdate:modelValue":c[8]||(c[8]=l=>R(e).integerFrameAlignment=l),type:"checkbox"},null,512),[[St,R(e).integerFrameAlignment]]),c[19]||(c[19]=M("span",{class:"switch-ui"},null,-1)),c[20]||(c[20]=M("span",null,"整数帧对齐",-1))]),M("label",$8,[le(M("input",{"onUpdate:modelValue":c[9]||(c[9]=l=>R(e).bonePool=l),type:"checkbox"},null,512),[[St,R(e).bonePool]]),c[21]||(c[21]=M("span",{class:"switch-ui"},null,-1)),c[22]||(c[22]=M("span",null,"骨骼对象池",-1))]),M("label",X8,[le(M("input",{"onUpdate:modelValue":c[10]||(c[10]=l=>R(e).excludeEmptyAnimations=l),type:"checkbox"},null,512),[[St,R(e).excludeEmptyAnimations]]),c[23]||(c[23]=M("span",{class:"switch-ui"},null,-1)),c[24]||(c[24]=M("span",null,"排除无内容动画",-1))])])],512),[[bi,!R(t).export]])]))}}),Y8=ti(V8,[["__scopeId","data-v-04462c7a"]]),G8={class:"spine-export-actions"},H8=["disabled","title"],j8=["disabled"],W8=["disabled","title"],z8={key:0},q8=["href"],K8=["href"],Z8=ei({__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}=Mr();return(v,y)=>(K(),J(Fe,null,[M("div",G8,[M("button",{type:"button",class:"export-spine-json",disabled:R(t),title:R(t)?"正在重新计算并烘焙动画":`导出 Spine ${R(e).spineVersion} JSON`,onClick:y[0]||(y[0]=(...x)=>R(p)&&R(p)(...x))},Me(R(t)&&R(i)==="json"?"正在准备导出…":"导出Spine Json"),9,H8),M("button",{type:"button",class:"export-spine-images",disabled:R(t),title:"单独下载当前粒子系统使用的图片 ZIP",onClick:y[1]||(y[1]=(...x)=>R(g)&&R(g)(...x))},Me(R(t)&&R(i)==="images"?"正在整理图片…":"导出 images 包"),9,j8),M("button",{type:"button",class:"export-spine-project",disabled:R(t)||!R(l),title:R(d),onClick:y[2]||(y[2]=(...x)=>R(m)&&R(m)(...x))},[M("span",null,Me(R(t)&&R(i)==="spine"?"正在生成工程…":"导出 .spine 包"),1),!R(t)&&R(u)?(K(),J("small",z8,Me(R(u)),1)):Te("",!0)],8,W8)]),M("div",{class:Be(["connector-status",R(c)])},[y[5]||(y[5]=M("span",{class:"connector-dot"},null,-1)),kt(Me(R(a))+" ",1),R(h)?(K(),J("a",{key:0,href:R(h),target:"_blank",rel:"noopener",title:"在本机连接器中授权当前网站"},"授权当前网站",8,q8)):Te("",!0),M("button",{type:"button",title:"重新检测连接器",onClick:y[3]||(y[3]=(...x)=>R(f)&&R(f)(...x))},"刷新")],2),R(n)?(K(),J("div",{key:0,class:Be(["export-message",{error:R(r)}])},[kt(Me(R(n))+" ",1),R(o)?(K(),J("a",{key:0,href:R(o),target:"_blank",rel:"noopener",onClick:y[4]||(y[4]=x=>o.value="")},"授权当前网站",8,K8)):Te("",!0)],2)):Te("",!0)],64))}}),J8=ti(Z8,[["__scopeId","data-v-7ff40afe"]]),Q8={class:"panel"},eU={class:"panel-scroll"},tU=ei({__name:"ParticlePanel",setup(s){const{activeObjectType:e,sys:t}=GO();return(i,n)=>(K(),J("div",Q8,[n[0]||(n[0]=M("div",{class:"panel-header"},[M("span",null,"Spine粒子编辑器-Yeomai")],-1)),M("div",eU,[ye(QO),ye(_D),R(e)==="particle"&&R(t)?(K(),J(Fe,{key:0},[ye(dN),ye(BN),ye(U4),ye(A8),ye(Y8)],64)):Te("",!0)]),ye(J8)]))}}),iU=ti(tU,[["__scopeId","data-v-283ef8eb"]]),sU={class:"timeline"},nU={class:"tl-controls"},rU=["title"],oU={class:"tl-range",title:"自定义播放起始帧"},aU=["max","onKeydown"],lU={class:"tl-range",title:"自定义播放结束帧"},cU=["min","max","onKeydown"],hU=["title"],uU={class:"tl-frame"},dU=["disabled"],fU=["onClick"],mU={key:0},pU={class:"tl-animation-editor"},gU={key:0,class:"tl-animation-error"},vU={class:"tl-animation-actions"},xU=["disabled"],yU={key:1,class:"tl-animation-hint"},bU={class:"tl-anim tl-spine-preview"},wU=["value","disabled"],SU={value:""},TU=["value"],MU={class:"tl-zoom"},_U={class:"tl-ticks"},CU={class:"tl-ticklabel"},AU={class:"tl-lanes"},EU=["onPointerdown"],IU={class:"lane-name"},RU=["onPointerdown"],PU=["onPointerdown"],kU=["onPointerdown"],FU={class:"lane-name"},OU={key:0,class:"tl-empty"},BU=ei({__name:"Timeline",setup(s){const e=fo(),t=Ye(null),i=Ye(null),n=Ye(!1),r=Ye("animation"),o=Ye("");Aa(()=>{(!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||!Y(H)?null:lp(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,te;const H=((z=a.value)==null?void 0:z.animation)||e.timeline.animation;if(!e.removeAnimation(H)){o.value="至少需要保留一个动画";return}const G=((te=a.value)==null?void 0:te.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)}jn(()=>document.addEventListener("pointerdown",p)),vl(()=>document.removeEventListener("pointerdown",p));const m=qe(()=>Math.max(1,e.timeline.fps||30)),g=Ye(120),v=Ye({}),y=Ye({}),x=Ye({}),T=Ye({}),A=Ye(String(e.timeline.playbackStart)),S=Ye(String(e.timeline.playbackEnd));Yi(()=>e.timeline.playbackStart,H=>{A.value=String(H)}),Yi(()=>e.timeline.playbackEnd,H=>{S.value=String(H)});const b=qe(()=>e.timeline.totalFrames),_=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(A.value)),A.value=String(e.timeline.playbackStart)}function B(){e.setPlaybackEnd(Number(S.value)),S.value=String(e.timeline.playbackEnd)}function N(){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 L=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 te=0;te<=G;te+=z)H.push({f:te,px:te/$()});return H}),U=qe(()=>e.timeline.frame/$());function C(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),te=Math.max(0,Number(G.lifeMax)||0);return G.lifeMode==="fixed"?z:Math.max(z,te)}function O(H){return V(H)}function D(H){if(H.config.mode!=="stream")return 0;if(H.config.streamBehavior==="loop"){const z=H.config;return(x.value[H.id]??dr(z,m.value).loop)/$()}return(y.value[H.id]??Math.max(1/m.value,Number(H.config.duration)||1))*m.value/$()}function V(H){const G=H.config;return G.mode==="stream"&&G.streamBehavior==="loop"?W(H)+D(H)+q(H):D(H)+P(H)*m.value/$()}function Y(H){const G=H.config;return G.mode==="stream"&&G.streamBehavior==="loop"}function W(H){return Y(H)?dr(H.config,m.value).start/$():0}function q(H){return Y(H)?dr(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(T.value[H.id]??Math.max(0,Number(H.timeOffset)||0))*m.value/$()}function me(H){return ne(H)*m.value/$()}function ve(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 ce(H){const G=t.value;e.pause();const z=he=>{const se=G.getBoundingClientRect(),ue=Math.floor((he.clientX-se.left)/se.width*g.value);e.timeline.frame=Math.max(0,Math.min(ue,b.value-1))};z(H);const te=()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",te)};window.addEventListener("pointermove",z),window.addEventListener("pointerup",te)}function de(H,G){H.stopPropagation();const z=H.clientX,te=Math.max(0,Number(G.config.delay)||0),he=$()/m.value,se=xe=>{const fe=(xe.clientX-z)*he,De=Math.max(0,Math.min(te+fe,600));v.value[G.id]=Math.round(De*m.value)/m.value},ue=xe=>{window.removeEventListener("pointermove",se),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",Ee);const fe=v.value[G.id];delete v.value[G.id],xe&&fe!=null&&fe!==te&&(G.config.delay=fe)},ae=()=>ue(!0),Ee=()=>ue(!1);window.addEventListener("pointermove",se),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",Ee)}function X(H,G){var ze;H.stopPropagation();const z=Y(G),te=Math.max(0,Number(G.config.duration)||0),he=dr(G.config,m.value).loop,se=$()/m.value,ue=((ze=H.currentTarget.closest(".lane-bar"))==null?void 0:ze.getBoundingClientRect().left)??H.clientX,ae=W(G);let Ee=!1;const xe=Ke=>{if(Ee=!0,z){const Le=Math.min(1800,Math.max(1,Math.round((Ke.clientX-ue-ae)/$())));x.value[G.id]=Le}else{const Le=Math.max(1/m.value,Math.min((Ke.clientX-ue)*se,600));y.value[G.id]=Math.round(Le*m.value)/m.value}},fe=Ke=>{window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",De),window.removeEventListener("pointercancel",Ze);const Le=y.value[G.id],be=x.value[G.id];delete y.value[G.id],delete x.value[G.id],Ke&&Ee&&z&&be!=null&&be!==he?G.config.loopDurationFrames=be:Ke&&Ee&&!z&&Le!=null&&Le!==te&&(G.config.duration=Le)},De=()=>fe(!0),Ze=()=>fe(!1);window.addEventListener("pointermove",xe),window.addEventListener("pointerup",De),window.addEventListener("pointercancel",Ze)}function j(H,G){H.stopPropagation();const z=H.clientX,te=Math.max(0,Number(G.timeOffset)||0),he=$()/m.value,se=xe=>{const fe=Math.max(0,Math.min(te+(xe.clientX-z)*he,600));T.value[G.id]=Math.round(fe*m.value)/m.value},ue=xe=>{window.removeEventListener("pointermove",se),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",Ee);const fe=T.value[G.id];delete T.value[G.id],xe&&fe!=null&&fe!==te&&(G.timeOffset=fe,e.recalcTotalFrames())},ae=()=>ue(!0),Ee=()=>ue(!1);window.addEventListener("pointermove",se),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",Ee)}return(H,G)=>{var z,te,he;return K(),J("div",sU,[M("div",nU,[M("button",{class:Be(["tl-btn",{on:R(e).timeline.playing}]),onClick:G[0]||(G[0]=se=>R(e).togglePlay()),title:R(e).timeline.playing?"暂停 (D)":"播放 (D)"},Me(R(e).timeline.playing?"❚❚":"▶"),11,rU),M("button",{class:"tl-btn",onClick:G[1]||(G[1]=se=>R(e).toStart()),title:"回到第一帧 (S)"},"⏮"),M("button",{class:"tl-btn",onClick:G[2]||(G[2]=se=>R(e).previousFrame()),title:"前一帧"},"◀"),M("button",{class:"tl-btn",onClick:G[3]||(G[3]=se=>R(e).nextFrame()),title:"后一帧"},"▶"),M("button",{class:"tl-btn",onClick:G[4]||(G[4]=se=>R(e).toEnd()),title:"移动到最后一帧"},"⏭"),M("button",{class:Be(["tl-btn",{on:R(e).timeline.loop}]),onClick:G[5]||(G[5]=se=>R(e).toggleLoop()),title:"循环"},"⟳",2),M("label",oU,[G[10]||(G[10]=M("span",null,"A",-1)),le(M("input",{"onUpdate:modelValue":G[6]||(G[6]=se=>A.value=se),type:"number",min:"0",max:Math.max(0,R(e).timeline.playbackEnd-1),"aria-label":"播放起始帧",onChange:k,onKeydown:Qr(tt(k,["prevent"]),["enter"])},null,40,aU),[[Ge,A.value]])]),M("label",lU,[G[11]||(G[11]=M("span",null,"B",-1)),le(M("input",{"onUpdate:modelValue":G[7]||(G[7]=se=>S.value=se),type:"number",min:R(e).timeline.playbackStart+1,max:Math.max(1,R(e).timeline.totalFrames-1),"aria-label":"播放结束帧",onChange:B,onKeydown:Qr(tt(B,["prevent"]),["enter"])},null,40,cU),[[Ge,S.value]])]),c.value?(K(),J("button",{key:0,class:"tl-loop-range",title:`设为闭合自循环范围 ${c.value.start}–${c.value.end}f`,onClick:N},"循环段",8,hU)):Te("",!0),M("span",uU,[G[12]||(G[12]=kt("帧 ",-1)),M("b",null,Me(R(e).timeline.frame),1),G[13]||(G[13]=kt(" / ",-1)),M("b",null,Me(Math.max(0,R(e).timeline.totalFrames-1)),1)]),G[18]||(G[18]=M("span",{class:"tl-legend"},[M("i",{class:"legend-emission"}),kt("持续发射 "),M("i",{class:"legend-life"}),kt("粒子存在 "),M("i",{class:"legend-spine"}),kt("Spine 动画")],-1)),M("div",{ref_key:"animationMenuRef",ref:i,class:"tl-anim tl-owner-animation"},[G[16]||(G[16]=M("span",null,"所属动画",-1)),M("button",{class:"tl-animation-trigger",disabled:!a.value,title:"设置当前粒子系统所属的动画",onClick:tt(l,["stop"])},[M("span",null,Me(((z=a.value)==null?void 0:z.animation)||R(e).timeline.animation),1),G[14]||(G[14]=M("i",null,"⌄",-1))],8,dU),n.value?(K(),J("div",{key:0,class:"tl-animation-menu",onPointerdown:G[9]||(G[9]=tt(()=>{},["stop"]))},[G[15]||(G[15]=M("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(K(!0),J(Fe,null,$t(R(e).timeline.animations,se=>{var ue,ae;return K(),J("button",{key:se,class:Be(["tl-animation-option",{on:((ue=a.value)==null?void 0:ue.animation)===se}]),onClick:Ee=>h(se)},[M("span",null,Me(se),1),((ae=a.value)==null?void 0:ae.animation)===se?(K(),J("i",mU,"✓")):Te("",!0)],10,fU)}),128)),M("div",pU,[le(M("input",{"onUpdate:modelValue":G[8]||(G[8]=se=>r.value=se),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:Qr(d,["enter"])},null,544),[[Ge,r.value]]),M("button",{title:"重命名当前动画",onClick:d},"重命名")]),o.value?(K(),J("div",gU,Me(o.value),1)):Te("",!0),M("div",vU,[M("button",{onClick:u},"+ 新增"),M("button",{disabled:R(e).timeline.animations.length<=1,onClick:f},"删除",8,xU)]),R(e).timeline.animations.length<=1?(K(),J("div",yU,"至少需要保留一个动画")):Te("",!0)],32)):Te("",!0)],512),M("label",bU,[G[17]||(G[17]=kt("Spine 预览动画 ",-1)),M("select",{class:"tl-sel",value:((te=F.value)==null?void 0:te.selectedAnimation)||"",disabled:!F.value,onChange:E},[M("option",SU,Me(F.value?"无":"无可用 Spine 动画"),1),(K(!0),J(Fe,null,$t(((he=F.value)==null?void 0:he.animations)||[],se=>(K(),J("option",{key:se.name,value:se.name},Me(se.name)+"("+Me(se.duration.toFixed(2))+"s) ",9,TU))),128))],40,wU)]),M("span",MU,Me(_.value),1)]),M("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:tt(ve,["prevent"]),onPointerdown:ce},[M("div",_U,[(K(!0),J(Fe,null,$t(L.value,se=>(K(),J("div",{key:se.f,class:"tl-tickline",style:gi({left:se.px+"px"})},[M("span",CU,Me(se.f)+"f",1)],4))),128))]),M("div",{class:"tl-playhead",style:gi({left:U.value+"px"})},null,4),M("div",AU,[(K(!0),J(Fe,null,$t(R(e).systems,(se,ue)=>(K(),J("div",{key:se.id,class:"tl-lane"},[G[19]||(G[19]=M("span",{class:"lane-ico"},"●",-1)),M("div",{class:"lane-bar",style:gi({left:C(se)+"px",width:O(se)+"px"}),onPointerdown:tt(ae=>de(ae,se),["stop"])},[M("span",IU,Me(se.config.name||"系统 "+(ue+1)),1),M("span",{class:Be(["bar-life",{"loop-life":Y(se)}]),style:gi({width:V(se)+"px"})},null,6),Y(se)?(K(),J(Fe,{key:0},[W(se)?(K(),J("span",{key:0,class:"bar-loop-transition bar-loop-start",style:gi({width:W(se)+"px"})},null,4)):Te("",!0),M("span",{class:"bar-emission bar-loop",style:gi({left:W(se)+"px",width:D(se)+"px"})},[M("span",{class:"bar-handle",title:"拖动循环段时长",onPointerdown:tt(ae=>X(ae,se),["stop"])},null,40,RU)],4),q(se)?(K(),J("span",{key:1,class:"bar-loop-transition bar-loop-end",style:gi({left:W(se)+D(se)+"px",width:q(se)+"px"})},null,4)):Te("",!0)],64)):se.config.mode==="stream"?(K(),J("span",{key:1,class:"bar-emission",style:gi({width:D(se)+"px"})},[M("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:tt(ae=>X(ae,se),["stop"])},null,40,PU)],4)):Te("",!0)],44,EU)]))),128)),(K(!0),J(Fe,null,$t(I.value,se=>(K(),J("div",{key:`spine-${se.id}`,class:"tl-lane spine-lane"},[G[20]||(G[20]=M("span",{class:"lane-ico spine-ico"},"◆",-1)),M("div",{class:"spine-bar",style:gi({left:re(se)+"px",width:me(se)+"px"}),title:"拖动调整动画开始时间",onPointerdown:tt(ue=>j(ue,se),["stop"])},[M("span",FU,Me(se.name)+" · "+Me(se.selectedAnimation),1)],44,kU)]))),128)),!R(e).systems.length&&!I.value.length?(K(),J("div",OU,"暂无可显示的动画数据")):Te("",!0)])],544)])}}}),LU=ti(BU,[["__scopeId","data-v-1e581e89"]]),DU={class:"transfer-heading"},NU={key:0},UU={class:"transfer-detail"},$U=ei({__name:"TransferProgressOverlay",setup(s){const e=Ye(null);return Yi(()=>Zt.visible,async t=>{var i;t&&(await Uh(),(i=e.value)==null||i.focus({preventScroll:!0}))},{flush:"post"}),(t,i)=>(K(),Pt(_M,{name:"transfer-fade"},{default:$h(()=>[R(Zt).visible?(K(),J("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]=tt(()=>{},["stop","prevent"])),onPointerup:i[1]||(i[1]=tt(()=>{},["stop","prevent"])),onClick:i[2]||(i[2]=tt(()=>{},["stop","prevent"])),onDblclick:i[3]||(i[3]=tt(()=>{},["stop","prevent"])),onContextmenu:i[4]||(i[4]=tt(()=>{},["stop","prevent"])),onWheel:i[5]||(i[5]=tt(()=>{},["stop","prevent"])),onKeydown:i[6]||(i[6]=tt(()=>{},["stop","prevent"]))},[M("div",{class:Be(["transfer-dialog",{failed:R(Zt).failed}])},[M("div",DU,[M("span",null,Me(R(Zt).title),1),R(Zt).indeterminate?Te("",!0):(K(),J("strong",NU,Me(Math.round(R(Zt).progress))+"%",1))]),M("div",{class:Be(["transfer-track",{indeterminate:R(Zt).indeterminate}])},[M("div",{class:"transfer-bar",style:gi(R(Zt).indeterminate?void 0:{width:`${R(Zt).progress}%`})},null,4)],2),M("div",UU,Me(R(Zt).detail),1)],2)],544)):Te("",!0)]),_:1}))}}),XU=ti($U,[["__scopeId","data-v-592b922e"]]),VU=["inert","aria-hidden"],YU={class:"right"},GU={class:"stage-area"},HU=ei({__name:"App",setup(s){const e=fo();eR(e);const t=Ye(360),i=Ye(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(),J(Fe,null,[M("div",{class:Be(["layout",{"panel-right":R(e).settings.parameterPanelOnRight}]),inert:R(Zt).visible?!0:void 0,"aria-hidden":R(Zt).visible?"true":void 0},[M("div",{class:"parameter-panel",style:gi({width:t.value+"px"})},[ye(iU)],4),M("div",{class:"resizer-col",onPointerdown:n},null,32),M("div",YU,[M("div",GU,[ye(DF)]),M("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),M("div",{class:"timeline-area",style:gi({height:i.value+"px"})},[ye(LU)],4)])],10,VU),ye(XU)],64))}}),jU=ti(HU,[["__scopeId","data-v-42c4fa00"]]);QM(jU).use(i_()).mount("#app");export{ex as $,rn as A,Mh as B,Mt as C,_i as D,Re as E,Vi as F,hn as G,it as H,gt as I,cS as J,Li as K,ns as L,gs as M,br as N,cu as O,nn as P,cl as Q,na as R,Cs as S,b3 as T,Ve as U,zv as V,Is as W,wX as X,vO as Y,ml as Z,op as _,We as a,xm as a$,Qv as a0,Vw as a1,xp as a2,yX as a3,bh as a4,Wa as a5,R3 as a6,za as a7,hu as a8,mm as a9,Cm as aA,Am as aB,mc as aC,ir as aD,Rc as aE,pm as aF,jw as aG,Ht as aH,Uw as aI,uX as aJ,Jo as aK,Jv as aL,Ce as aM,$e as aN,vm as aO,Pc as aP,Kw as aQ,gm as aR,zw as aS,qw as aT,uu as aU,Qw as aV,kc as aW,iS as aX,Zw as aY,eS as aZ,sS as a_,go as aa,yp as ab,bp as ac,Kv as ad,Cl as ae,Al as af,_l as ag,po as ah,kn as ai,fX as aj,Hw as ak,I3 as al,oa as am,gr as an,Tp as ao,lS as ap,A3 as aq,fl as ar,zi as as,Zv as at,gX as au,ua as av,_m as aw,Em as ax,Im as ay,Rm as az,ia as b,Gn as b$,Th as b0,Jw as b1,Tr as b2,tS as b3,wp as b4,y3 as b5,oS as b6,aS as b7,Sp as b8,cn as b9,nS as bA,Mp as bB,lu as bC,hS as bD,ym as bE,di as bF,v3 as bG,S3 as bH,Ew as bI,Aw as bJ,mX as bK,Ot as bL,da as bM,uS as bN,mS as bO,pS as bP,gS as bQ,dS as bR,fS as bS,C3 as bT,_p as bU,bt as bV,Mm as bW,Ww as bX,Rw as bY,Pw as bZ,kw as b_,x3 as ba,dX as bb,Qe as bc,Gw as bd,Yw as be,$w as bf,Xw as bg,no as bh,wh as bi,E3 as bj,Fw as bk,Ow as bl,$i as bm,Bw as bn,ra as bo,Ti as bp,Iw as bq,Sh as br,Lw as bs,Dw as bt,Nw as bu,tx as bv,Sm as bw,jr as bx,rS as by,wm as bz,sa as c,pX as c0,M3 as c1,_3 as c2,T3 as c3,He as d,Ue as e,vX as f,Je as g,xi as h,Qc as i,Ki as j,Nt as k,Ne as l,ks as m,Ut as n,Qm as o,Qt as p,hl as q,er as r,ke as s,qy as t,rp as u,nh as v,bm as w,Gr as x,qv as y,Tm as z}; diff --git a/dist/assets/index-CjEJ0XJ5.js b/dist/assets/index-CjEJ0XJ5.js new file mode 100644 index 0000000..be542ed --- /dev/null +++ b/dist/assets/index-CjEJ0XJ5.js @@ -0,0 +1,1239 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BxN_H-6_.js","assets/index-Bvs6zl88.js"])))=>i.map(i=>d[i]); +var US=Object.defineProperty;var $S=(i,e,t)=>e in i?US(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var S=(i,e,t)=>$S(i,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"]'))s(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"&&s(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 s(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 +* @license MIT +**/function Dm(i){const e=Object.create(null);for(const t of i.split(","))e[t]=1;return t=>t in e}const Lt={},Xo=[],rn=()=>{},py=()=>!1,Lh=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&(i.charCodeAt(2)>122||i.charCodeAt(2)<97),Bh=i=>i.startsWith("onUpdate:"),fs=Object.assign,Um=(i,e)=>{const t=i.indexOf(e);t>-1&&i.splice(t,1)},XS=Object.prototype.hasOwnProperty,It=(i,e)=>XS.call(i,e),We=Array.isArray,Vo=i=>bl(i)==="[object Map]",ha=i=>bl(i)==="[object Set]",Fp=i=>bl(i)==="[object Date]",it=i=>typeof i=="function",zt=i=>typeof i=="string",si=i=>typeof i=="symbol",Pt=i=>i!==null&&typeof i=="object",gy=i=>(Pt(i)||it(i))&&it(i.then)&&it(i.catch),vy=Object.prototype.toString,bl=i=>vy.call(i),VS=i=>bl(i).slice(8,-1),yy=i=>bl(i)==="[object Object]",Nh=i=>zt(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,Ya=Dm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Dh=i=>{const e=Object.create(null);return(t=>e[t]||(e[t]=i(t)))},YS=/-\w/g,Ai=Dh(i=>i.replace(YS,e=>e.slice(1).toUpperCase())),GS=/\B([A-Z])/g,Mr=Dh(i=>i.replace(GS,"-$1").toLowerCase()),xy=Dh(i=>i.charAt(0).toUpperCase()+i.slice(1)),xu=Dh(i=>i?`on${xy(i)}`:""),Ji=(i,e)=>!Object.is(i,e),bc=(i,...e)=>{for(let t=0;t{Object.defineProperty(i,e,{configurable:!0,enumerable:!1,writable:s,value:t})},Uh=i=>{const e=parseFloat(i);return isNaN(e)?i:e},jS=i=>{const e=zt(i)?Number(i):NaN;return isNaN(e)?i:e};let Op;const $h=()=>Op||(Op=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function vs(i){if(We(i)){const e={};for(let t=0;t{if(t){const s=t.split(WS);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function ke(i){let e="";if(zt(i))e=i;else if(We(i))for(let t=0;tua(t,e))}const Sy=i=>!!(i&&i.__v_isRef===!0),be=i=>zt(i)?i:i==null?"":We(i)||Pt(i)&&(i.toString===vy||!it(i.toString))?Sy(i)?be(i.value):JSON.stringify(i,My,2):String(i),My=(i,e)=>Sy(e)?My(i,e.value):Vo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[s,n],r)=>(t[bu(s,r)+" =>"]=n,t),{})}:ha(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>bu(t))}:si(e)?bu(e):Pt(e)&&!We(e)&&!yy(e)?String(e):e,bu=(i,e="")=>{var t;return si(i)?`Symbol(${(t=i.description)!=null?t:e})`:i};/** +* @vue/reactivity v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let hs;class Ty{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&hs&&(hs.active?(this.parent=hs,this.index=(hs.scopes||(hs.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){const s=this.scopes.slice();for(e=0,t=s.length;e0&&--this._on===0){if(hs===this)hs=this.prevScope;else{let e=hs;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,s;for(t=0,s=this.effects.length;t0)return;if(ja){let e=ja;for(ja=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let i;for(;Ga;){let e=Ga;for(Ga=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){i||(i=s)}e=t}}if(i)throw i}function Ry(i){for(let e=i.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Py(i){let e,t=i.depsTail,s=t;for(;s;){const n=s.prevDep;s.version===-1?(s===t&&(t=n),Ym(s),eM(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=n}i.deps=e,i.depsTail=t}function ff(i){for(let e=i.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(ky(e.dep.computed)||e.dep.version!==e.version))return!0;return!!i._dirty}function ky(i){if(i.flags&4&&!(i.flags&16)||(i.flags&=-17,i.globalVersion===il)||(i.globalVersion=il,!i.isSSR&&i.flags&128&&(!i.deps&&!i._dirty||!ff(i))))return;i.flags|=2;const e=i.dep,t=Dt,s=Ei;Dt=i,Ei=!0;try{Ry(i);const n=i.fn(i._value);(e.version===0||Ji(n,i._value))&&(i.flags|=128,i._value=n,e.version++)}catch(n){throw e.version++,n}finally{Dt=t,Ei=s,Py(i),i.flags&=-3}}function Ym(i,e=!1){const{dep:t,prevSub:s,nextSub:n}=i;if(s&&(s.nextSub=n,i.prevSub=void 0),n&&(n.prevSub=s,i.nextSub=void 0),t.subs===i&&(t.subs=s,!s&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)Ym(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function eM(i){const{prevDep:e,nextDep:t}=i;e&&(e.nextDep=t,i.prevDep=void 0),t&&(t.prevDep=e,i.nextDep=void 0)}let Ei=!0;const Fy=[];function Un(){Fy.push(Ei),Ei=!1}function $n(){const i=Fy.pop();Ei=i===void 0?!0:i}function Lp(i){const{cleanup:e}=i;if(i.cleanup=void 0,e){const t=Dt;Dt=void 0;try{e()}finally{Dt=t}}}let il=0;class tM{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Gm{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Dt||!Ei||Dt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Dt)t=this.activeLink=new tM(Dt,this),Dt.deps?(t.prevDep=Dt.depsTail,Dt.depsTail.nextDep=t,Dt.depsTail=t):Dt.deps=Dt.depsTail=t,Oy(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const s=t.nextDep;s.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=s),t.prevDep=Dt.depsTail,t.nextDep=void 0,Dt.depsTail.nextDep=t,Dt.depsTail=t,Dt.deps===t&&(Dt.deps=s)}return t}trigger(e){this.version++,il++,this.notify(e)}notify(e){Xm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Vm()}}}function Oy(i){if(i.dep.sc++,i.sub.flags&4){const e=i.dep.computed;if(e&&!i.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)Oy(s)}const t=i.dep.subs;t!==i&&(i.prevSub=t,t&&(t.nextSub=i)),i.dep.subs=i}}const Dc=new WeakMap,eo=Symbol(""),mf=Symbol(""),nl=Symbol("");function Ps(i,e,t){if(Ei&&Dt){let s=Dc.get(i);s||Dc.set(i,s=new Map);let n=s.get(t);n||(s.set(t,n=new Gm),n.map=s,n.key=t),n.track()}}function _n(i,e,t,s,n,r){const o=Dc.get(i);if(!o){il++;return}const a=c=>{c&&c.trigger()};if(Xm(),e==="clear")o.forEach(a);else{const c=We(i),l=c&&Nh(t);if(c&&t==="length"){const h=Number(s);o.forEach((u,d)=>{(d==="length"||d===nl||!si(d)&&d>=h)&&a(u)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),l&&a(o.get(nl)),e){case"add":c?l&&a(o.get("length")):(a(o.get(eo)),Vo(i)&&a(o.get(mf)));break;case"delete":c||(a(o.get(eo)),Vo(i)&&a(o.get(mf)));break;case"set":Vo(i)&&a(o.get(eo));break}}Vm()}function sM(i,e){const t=Dc.get(i);return t&&t.get(e)}function bo(i){const e=bt(i);return e===i?e:(Ps(e,"iterate",nl),ti(i)?e:e.map(Fi))}function Xh(i){return Ps(i=bt(i),"iterate",nl),i}function zi(i,e){return Xn(i)?sa(Ln(i)?Fi(e):e):Fi(e)}const iM={__proto__:null,[Symbol.iterator](){return Su(this,Symbol.iterator,i=>zi(this,i))},concat(...i){return bo(this).concat(...i.map(e=>We(e)?bo(e):e))},entries(){return Su(this,"entries",i=>(i[1]=zi(this,i[1]),i))},every(i,e){return mn(this,"every",i,e,void 0,arguments)},filter(i,e){return mn(this,"filter",i,e,t=>t.map(s=>zi(this,s)),arguments)},find(i,e){return mn(this,"find",i,e,t=>zi(this,t),arguments)},findIndex(i,e){return mn(this,"findIndex",i,e,void 0,arguments)},findLast(i,e){return mn(this,"findLast",i,e,t=>zi(this,t),arguments)},findLastIndex(i,e){return mn(this,"findLastIndex",i,e,void 0,arguments)},forEach(i,e){return mn(this,"forEach",i,e,void 0,arguments)},includes(...i){return Mu(this,"includes",i)},indexOf(...i){return Mu(this,"indexOf",i)},join(i){return bo(this).join(i)},lastIndexOf(...i){return Mu(this,"lastIndexOf",i)},map(i,e){return mn(this,"map",i,e,void 0,arguments)},pop(){return Ma(this,"pop")},push(...i){return Ma(this,"push",i)},reduce(i,...e){return Bp(this,"reduce",i,e)},reduceRight(i,...e){return Bp(this,"reduceRight",i,e)},shift(){return Ma(this,"shift")},some(i,e){return mn(this,"some",i,e,void 0,arguments)},splice(...i){return Ma(this,"splice",i)},toReversed(){return bo(this).toReversed()},toSorted(i){return bo(this).toSorted(i)},toSpliced(...i){return bo(this).toSpliced(...i)},unshift(...i){return Ma(this,"unshift",i)},values(){return Su(this,"values",i=>zi(this,i))}};function Su(i,e,t){const s=Xh(i),n=s[e]();return s!==i&&!ti(i)&&(n._next=n.next,n.next=()=>{const r=n._next();return r.done||(r.value=t(r.value)),r}),n}const nM=Array.prototype;function mn(i,e,t,s,n,r){const o=Xh(i),a=o!==i&&!ti(i),c=o[e];if(c!==nM[e]){const u=c.apply(i,r);return a?Fi(u):u}let l=t;o!==i&&(a?l=function(u,d){return t.call(this,zi(i,u),d,i)}:t.length>2&&(l=function(u,d){return t.call(this,u,d,i)}));const h=c.call(o,l,s);return a&&n?n(h):h}function Bp(i,e,t,s){const n=Xh(i),r=n!==i&&!ti(i);let o=t,a=!1;n!==i&&(r?(a=s.length===0,o=function(l,h,u){return a&&(a=!1,l=zi(i,l)),t.call(this,l,zi(i,h),u,i)}):t.length>3&&(o=function(l,h,u){return t.call(this,l,h,u,i)}));const c=n[e](o,...s);return a?zi(i,c):c}function Mu(i,e,t){const s=bt(i);Ps(s,"iterate",nl);const n=s[e](...t);return(n===-1||n===!1)&&Vh(t[0])?(t[0]=bt(t[0]),s[e](...t)):n}function Ma(i,e,t=[]){Un(),Xm();const s=bt(i)[e].apply(i,t);return Vm(),$n(),s}const rM=Dm("__proto__,__v_isRef,__isVue"),Ly=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(si));function oM(i){si(i)||(i=String(i));const e=bt(this);return Ps(e,"has",i),e.hasOwnProperty(i)}class By{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,s){if(t==="__v_skip")return e.__v_skip;const n=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!n;if(t==="__v_isReadonly")return n;if(t==="__v_isShallow")return r;if(t==="__v_raw")return s===(n?r?gM:$y:r?Uy:Dy).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=We(e);if(!n){let c;if(o&&(c=iM[t]))return c;if(t==="hasOwnProperty")return oM}const a=Reflect.get(e,t,Vt(e)?e:s);if((si(t)?Ly.has(t):rM(t))||(n||Ps(e,"get",t),r))return a;if(Vt(a)){const c=o&&Nh(t)?a:a.value;return n&&Pt(c)?gf(c):c}return Pt(a)?n?gf(a):uo(a):a}}class Ny extends By{constructor(e=!1){super(!1,e)}set(e,t,s,n){let r=e[t];const o=We(e)&&Nh(t);if(!this._isShallow){const l=Xn(r);if(!ti(s)&&!Xn(s)&&(r=bt(r),s=bt(s)),!o&&Vt(r)&&!Vt(s))return l||(r.value=s),!0}const a=o?Number(t)i,Nl=i=>Reflect.getPrototypeOf(i);function uM(i,e,t){return function(...s){const n=this.__v_raw,r=bt(n),o=Vo(r),a=i==="entries"||i===Symbol.iterator&&o,c=i==="keys"&&o,l=n[i](...s),h=t?pf:e?sa:Fi;return!e&&Ps(r,"iterate",c?mf:eo),fs(Object.create(l),{next(){const{value:u,done:d}=l.next();return d?{value:u,done:d}:{value:a?[h(u[0]),h(u[1])]:h(u),done:d}}})}}function Dl(i){return function(...e){return i==="delete"?!1:i==="clear"?void 0:this}}function dM(i,e){const t={get(n){const r=this.__v_raw,o=bt(r),a=bt(n);i||(Ji(n,a)&&Ps(o,"get",n),Ps(o,"get",a));const{has:c}=Nl(o),l=e?pf:i?sa:Fi;if(c.call(o,n))return l(r.get(n));if(c.call(o,a))return l(r.get(a));r!==o&&r.get(n)},get size(){const n=this.__v_raw;return!i&&Ps(bt(n),"iterate",eo),n.size},has(n){const r=this.__v_raw,o=bt(r),a=bt(n);return i||(Ji(n,a)&&Ps(o,"has",n),Ps(o,"has",a)),n===a?r.has(n):r.has(n)||r.has(a)},forEach(n,r){const o=this,a=o.__v_raw,c=bt(a),l=e?pf:i?sa:Fi;return!i&&Ps(c,"iterate",eo),a.forEach((h,u)=>n.call(r,l(h),l(u),o))}};return fs(t,i?{add:Dl("add"),set:Dl("set"),delete:Dl("delete"),clear:Dl("clear")}:{add(n){const r=bt(this),o=Nl(r),a=bt(n),c=!e&&!ti(n)&&!Xn(n)?a:n;return o.has.call(r,c)||Ji(n,c)&&o.has.call(r,n)||Ji(a,c)&&o.has.call(r,a)||(r.add(c),_n(r,"add",c,c)),this},set(n,r){!e&&!ti(r)&&!Xn(r)&&(r=bt(r));const o=bt(this),{has:a,get:c}=Nl(o);let l=a.call(o,n);l||(n=bt(n),l=a.call(o,n));const h=c.call(o,n);return o.set(n,r),l?Ji(r,h)&&_n(o,"set",n,r):_n(o,"add",n,r),this},delete(n){const r=bt(this),{has:o,get:a}=Nl(r);let c=o.call(r,n);c||(n=bt(n),c=o.call(r,n)),a&&a.call(r,n);const l=r.delete(n);return c&&_n(r,"delete",n,void 0),l},clear(){const n=bt(this),r=n.size!==0,o=n.clear();return r&&_n(n,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=uM(n,i,e)}),t}function jm(i,e){const t=dM(i,e);return(s,n,r)=>n==="__v_isReactive"?!i:n==="__v_isReadonly"?i:n==="__v_raw"?s:Reflect.get(It(t,n)&&n in s?t:s,n,r)}const fM={get:jm(!1,!1)},mM={get:jm(!1,!0)},pM={get:jm(!0,!1)};const Dy=new WeakMap,Uy=new WeakMap,$y=new WeakMap,gM=new WeakMap;function vM(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function uo(i){return Xn(i)?i:Hm(i,!1,lM,fM,Dy)}function yM(i){return Hm(i,!1,hM,mM,Uy)}function gf(i){return Hm(i,!0,cM,pM,$y)}function Hm(i,e,t,s,n){if(!Pt(i)||i.__v_raw&&!(e&&i.__v_isReactive)||i.__v_skip||!Object.isExtensible(i))return i;const r=n.get(i);if(r)return r;const o=vM(VS(i));if(o===0)return i;const a=new Proxy(i,o===2?s:t);return n.set(i,a),a}function Ln(i){return Xn(i)?Ln(i.__v_raw):!!(i&&i.__v_isReactive)}function Xn(i){return!!(i&&i.__v_isReadonly)}function ti(i){return!!(i&&i.__v_isShallow)}function Vh(i){return i?!!i.__v_raw:!1}function bt(i){const e=i&&i.__v_raw;return e?bt(e):i}function hr(i){return!It(i,"__v_skip")&&Object.isExtensible(i)&&by(i,"__v_skip",!0),i}const Fi=i=>Pt(i)?uo(i):i,sa=i=>Pt(i)?gf(i):i;function Vt(i){return i?i.__v_isRef===!0:!1}function $e(i){return xM(i,!1)}function xM(i,e){return Vt(i)?i:new bM(i,e)}class bM{constructor(e,t){this.dep=new Gm,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:bt(e),this._value=t?e:Fi(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,s=this.__v_isShallow||ti(e)||Xn(e);e=s?e:bt(e),Ji(e,t)&&(this._rawValue=e,this._value=s?e:Fi(e),this.dep.trigger())}}function E(i){return Vt(i)?i.value:i}const wM={get:(i,e,t)=>e==="__v_raw"?i:E(Reflect.get(i,e,t)),set:(i,e,t,s)=>{const n=i[e];return Vt(n)&&!Vt(t)?(n.value=t,!0):Reflect.set(i,e,t,s)}};function Xy(i){return Ln(i)?i:new Proxy(i,wM)}function SM(i){const e=We(i)?new Array(i.length):{};for(const t in i)e[t]=TM(i,t);return e}class MM{constructor(e,t,s){this._object=e,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=si(t)?t:String(t),this._raw=bt(e);let n=!0,r=e;if(!We(e)||si(this._key)||!Nh(this._key))do n=!Vh(r)||ti(r);while(n&&(r=r.__v_raw));this._shallow=n}get value(){let e=this._object[this._key];return this._shallow&&(e=E(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Vt(this._raw[this._key])){const t=this._object[this._key];if(Vt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return sM(this._raw,this._key)}}function TM(i,e,t){return new MM(i,e,t)}class _M{constructor(e,t,s){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Gm(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=il-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Dt!==this)return Iy(this,!0),!0}get value(){const e=this.dep.track();return ky(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function CM(i,e,t=!1){let s,n;return it(i)?s=i:(s=i.get,n=i.set),new _M(s,n,t)}const Ul={},Uc=new WeakMap;let Ur;function AM(i,e=!1,t=Ur){if(t){let s=Uc.get(t);s||Uc.set(t,s=[]),s.push(i)}}function EM(i,e,t=Lt){const{immediate:s,deep:n,once:r,scheduler:o,augmentJob:a,call:c}=t,l=M=>n?M:ti(M)||n===!1||n===0?Cn(M,1):Cn(M);let h,u,d,f,p=!1,m=!1;if(Vt(i)?(u=()=>i.value,p=ti(i)):Ln(i)?(u=()=>l(i),p=!0):We(i)?(m=!0,p=i.some(M=>Ln(M)||ti(M)),u=()=>i.map(M=>{if(Vt(M))return M.value;if(Ln(M))return l(M);if(it(M))return c?c(M,2):M()})):it(i)?e?u=c?()=>c(i,2):i:u=()=>{if(d){Un();try{d()}finally{$n()}}const M=Ur;Ur=h;try{return c?c(i,3,[f]):i(f)}finally{Ur=M}}:u=rn,e&&n){const M=u,_=n===!0?1/0:n;u=()=>Cn(M(),_)}const g=Cy(),v=()=>{h.stop(),g&&g.active&&Um(g.effects,h)};if(r&&e){const M=e;e=(..._)=>{const w=M(..._);return v(),w}}let x=m?new Array(i.length).fill(Ul):Ul;const y=M=>{if(!(!(h.flags&1)||!h.dirty&&!M))if(e){const _=h.run();if(M||n||p||(m?_.some((w,b)=>Ji(w,x[b])):Ji(_,x))){d&&d();const w=Ur;Ur=h;try{const b=[_,x===Ul?void 0:m&&x[0]===Ul?[]:x,f];x=_,c?c(e,3,b):e(...b)}finally{Ur=w}}}else h.run()};return a&&a(y),h=new Ay(u),h.scheduler=o?()=>o(y,!1):y,f=M=>AM(M,!1,h),d=h.onStop=()=>{const M=Uc.get(h);if(M){if(c)c(M,4);else for(const _ of M)_();Uc.delete(h)}},e?s?y(!0):x=h.run():o?o(y.bind(null,!0),!0):h.run(),v.pause=h.pause.bind(h),v.resume=h.resume.bind(h),v.stop=v,v}function Cn(i,e=1/0,t){if(e<=0||!Pt(i)||i.__v_skip||(t=t||new Map,(t.get(i)||0)>=e))return i;if(t.set(i,e),e--,Vt(i))Cn(i.value,e,t);else if(We(i))for(let s=0;s{Cn(s,e,t)});else if(yy(i)){for(const s in i)Cn(i[s],e,t);for(const s of Object.getOwnPropertySymbols(i))Object.prototype.propertyIsEnumerable.call(i,s)&&Cn(i[s],e,t)}return i}/** +* @vue/runtime-core v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function wl(i,e,t,s){try{return s?i(...s):i()}catch(n){Yh(n,e,t)}}function pi(i,e,t,s){if(it(i)){const n=wl(i,e,t,s);return n&&gy(n)&&n.catch(r=>{Yh(r,e,t)}),n}if(We(i)){const n=[];for(let r=0;r>>1,n=Us[s],r=rl(n);r=rl(t)?Us.push(i):Us.splice(RM(e),0,i),i.flags|=1,Yy()}}function Yy(){$c||($c=Vy.then(jy))}function PM(i){if(!We(i))tr&&i.id===-1?tr.splice(Io+1,0,i):i.flags&1||(Yo.push(i),i.flags|=1);else for(let e=0;erl(t)-rl(s));if(Yo.length=0,tr){for(let t=0;ti.id==null?i.flags&2?-1:1/0:i.id;function jy(i){try{for(Yi=0;Yi{s._d&&jc(-1);const r=Xc(e),o=Bn.length;let a;try{a=i(...n)}finally{for(let c=Bn.length;c>o;c--)Zm();Xc(r),s._d&&jc(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function ce(i,e){if(Os===null)return i;const t=Zh(Os),s=i.dirs||(i.dirs=[]);for(let n=0;n1)return t&&it(e)?e.call(s&&s.proxy):e}}function kM(){return!!(Jm()||to)}const FM=Symbol.for("v-scx"),OM=()=>Go(FM);function Ro(i,e){return zm(i,null,e)}function Ls(i,e,t){return zm(i,e,t)}function zm(i,e,t=Lt){const{immediate:s,deep:n,flush:r,once:o}=t,a=fs({},t),c=e&&s||!e&&r!=="post";let l;if(hl){if(r==="sync"){const f=OM();l=f.__watcherHandles||(f.__watcherHandles=[])}else if(!c){const f=()=>{};return f.stop=rn,f.resume=rn,f.pause=rn,f}}const h=$s;a.call=(f,p,m)=>pi(f,h,p,m);let u=!1;r==="post"?a.scheduler=f=>{Gs(f,h&&h.suspense)}:r!=="sync"&&(u=!0,a.scheduler=(f,p)=>{p?f():Wm(f)}),a.augmentJob=f=>{e&&(f.flags|=4),u&&(f.flags|=2,h&&(f.id=h.uid,f.i=h))};const d=EM(i,e,a);return hl&&(l?l.push(d):c&&d()),d}function LM(i,e,t){const s=this.proxy,n=zt(i)?i.includes(".")?zy(s,i):()=>s[i]:i.bind(s,s);let r;it(e)?r=e:(r=e.handler,t=e);const o=Tl(this),a=zm(n,r.bind(s),t);return o(),a}function zy(i,e){const t=e.split(".");return()=>{let s=i;for(let n=0;ni.__isTeleport,hi=Symbol("_leaveCb"),Ta=Symbol("_enterCb");function NM(){const i={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Wn(()=>{i.isMounted=!0}),Sl(()=>{i.isUnmounting=!0}),i}const oi=[Function,Array],qy={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:oi,onEnter:oi,onAfterEnter:oi,onEnterCancelled:oi,onBeforeLeave:oi,onLeave:oi,onAfterLeave:oi,onLeaveCancelled:oi,onBeforeAppear:oi,onAppear:oi,onAfterAppear:oi,onAppearCancelled:oi},Ky=i=>{const e=i.subTree;return e.component?Ky(e.component):e},DM={name:"BaseTransition",props:qy,setup(i,{slots:e}){const t=Jm(),s=NM();return()=>{const n=e.default&&Qy(e.default(),!0),r=n&&n.length?Zy(n):t.subTree?Se():void 0;if(!r)return;const o=bt(i),{mode:a}=o;if(s.isLeaving)return Tu(r);const c=Vc(r);if(!c)return Tu(r);let l=vf(c,o,s,t,u=>l=u);c.type!==Fs&&ol(c,l);let h=t.subTree&&Vc(t.subTree);if(h&&h.type!==Fs&&!jr(h,c)&&Ky(t).type!==Fs){let u=vf(h,o,s,t);if(ol(h,u),a==="out-in"&&c.type!==Fs)return s.isLeaving=!0,u.afterLeave=()=>{s.isLeaving=!1,t.job.flags&8||t.update(),delete u.afterLeave,h=void 0},Tu(r);a==="in-out"&&c.type!==Fs?u.delayLeave=(d,f,p)=>{const m=Jy(s,h);m[String(h.key)]=h,d[hi]=()=>{f(),d[hi]=void 0,delete l.delayedLeave,h=void 0},l.delayedLeave=()=>{p(),delete l.delayedLeave,h=void 0}}:h=void 0}else h&&(h=void 0);return r}}};function Zy(i){let e=i[0];if(i.length>1){for(const t of i)if(t.type!==Fs){e=t;break}}return e}const UM=DM;function Jy(i,e){const{leavingVNodes:t}=i;let s=t.get(e.type);return s||(s=Object.create(null),t.set(e.type,s)),s}function vf(i,e,t,s,n){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:h,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:g,onAppear:v,onAfterAppear:x,onAppearCancelled:y}=e,M=String(i.key),_=Jy(t,i),w=(R,F)=>{R&&pi(R,s,9,F)},b=(R,F)=>{const I=F[1];w(R,F),We(R)?R.every(k=>k.length<=1)&&I():R.length<=1&&I()},C={mode:o,persisted:a,beforeEnter(R){let F=c;if(!t.isMounted)if(r)F=g||c;else return;R[hi]&&R[hi](!0);const I=_[M];I&&jr(i,I)&&I.el[hi]&&I.el[hi](),w(F,[R])},enter(R){if(_[M]===i)return;let F=l,I=h,k=u;if(!t.isMounted)if(r)F=v||l,I=x||h,k=y||u;else return;let B=!1;R[Ta]=$=>{B||(B=!0,$?w(k,[R]):w(I,[R]),C.delayedLeave&&C.delayedLeave(),R[Ta]=void 0)};const D=R[Ta].bind(null,!1);F?b(F,[R,D]):D()},leave(R,F){const I=String(i.key);if(R[Ta]&&R[Ta](!0),t.isUnmounting)return F();w(d,[R]);let k=!1;R[hi]=D=>{k||(k=!0,F(),D?w(m,[R]):w(p,[R]),R[hi]=void 0,_[I]===i&&delete _[I])};const B=R[hi].bind(null,!1);_[I]=i,f?b(f,[R,B]):B()},clone(R){const F=vf(R,e,t,s,n);return n&&n(F),F}};return C}function Tu(i){if(Wh(i))return i=br(i),i.children=null,i}function Vc(i){if(!Wh(i))return Hh(i.type)&&i.children?Zy(i.children):i;if(i.component)return i.component.subTree;const{shapeFlag:e,children:t}=i;if(t){if(e&16)return t[0];if(e&32&&it(t.default))return t.default()}}function ol(i,e){if(i.shapeFlag&6&&i.component){i.transition=e;const t=i.component.subTree;ol(Hh(t.type)&&Vc(t)||t,e)}else i.shapeFlag&128?(i.ssContent.transition=e.clone(i.ssContent),i.ssFallback.transition=e.clone(i.ssFallback)):i.transition=e}function Qy(i,e=!1,t){let s=[],n=0;for(let r=0;r1)for(let r=0;rHa(m,e&&(We(e)?e[g]:e),t,s,n));return}if(jo(s)&&!n){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ha(i,e,t,s.component.subTree);return}const r=s.shapeFlag&4?Zh(s.component):s.el,o=n?null:r,{i:a,r:c}=i,l=e&&e.r,h=a.refs===Lt?a.refs={}:a.refs,u=a.setupState,d=bt(u),f=u===Lt?py:m=>Dp(h,m)?!1:It(d,m),p=(m,g)=>!(g&&Dp(h,g));if(l!=null&&l!==c){if(Up(e),zt(l))h[l]=null,f(l)&&(u[l]=null);else if(Vt(l)){const m=e;p(l,m.k)&&(l.value=null),m.k&&(h[m.k]=null)}}if(it(c))wl(c,a,12,[o,h]);else{const m=zt(c),g=Vt(c);if(m||g){const v=()=>{if(i.f){const x=m?f(c)?u[c]:h[c]:p()||!i.k?c.value:h[i.k];if(n)We(x)&&Um(x,r);else if(We(x))x.includes(r)||x.push(r);else if(m)h[c]=[r],f(c)&&(u[c]=h[c]);else{const y=[r];p(c,i.k)&&(c.value=y),i.k&&(h[i.k]=y)}}else m?(h[c]=o,f(c)&&(u[c]=o)):g&&(p(c,i.k)&&(c.value=o),i.k&&(h[i.k]=o))};if(o){const x=()=>{v(),Yc.delete(i)};x.id=-1,Yc.set(i,x),Gs(x,t)}else Up(i),v()}}}function Up(i){const e=Yc.get(i);e&&(e.flags|=8,Yc.delete(i))}$h().requestIdleCallback;$h().cancelIdleCallback;const jo=i=>!!i.type.__asyncLoader,Wh=i=>i.type.__isKeepAlive;function $M(i,e){tx(i,"a",e)}function XM(i,e){tx(i,"da",e)}function tx(i,e,t=$s){const s=i.__wdc||(i.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return i()});if(zh(e,s,t),t){let n=t.parent;for(;n&&n.parent;)Wh(n.parent.vnode)&&VM(s,e,t,n),n=n.parent}}function VM(i,e,t,s){const n=zh(e,i,s,!0);Ml(()=>{Um(s[e],n)},t)}function zh(i,e,t=$s,s=!1){if(t){const n=t[i]||(t[i]=[]),r=e.__weh||(e.__weh=(...o)=>{Un();const a=Tl(t),c=pi(e,t,i,o);return a(),$n(),c});return s?n.unshift(r):n.push(r),r}}const Hn=i=>(e,t=$s)=>{(!hl||i==="sp")&&zh(i,(...s)=>e(...s),t)},YM=Hn("bm"),Wn=Hn("m"),GM=Hn("bu"),jM=Hn("u"),Sl=Hn("bum"),Ml=Hn("um"),HM=Hn("sp"),WM=Hn("rtg"),zM=Hn("rtc");function qM(i,e=$s){zh("ec",i,e)}const KM=Symbol.for("v-ndc");function Ft(i,e,t,s){let n;const r=t,o=We(i);if(o||zt(i)){const a=o&&Ln(i);let c=!1,l=!1;a&&(c=!ti(i),l=Xn(i),i=Xh(i)),n=new Array(i.length);for(let h=0,u=i.length;he(a,c,void 0,r));else{const a=Object.keys(i);n=new Array(a.length);for(let c=0,l=a.length;c0;return K(),kt(Ae,null,[xe("slot",l,s)],h?-2:64)}let o=i[e];o&&o._c&&(o._d=!1);const a=Bn.length;K();let c;try{const l=o&&sx(o(t)),h=t.key||r||l&&l.key;c=kt(Ae,{key:(h&&!si(h)?h:`_${e}`)+(!l&&s?"_fb":"")},l||(s?s():[]),l&&i._===1?64:-2)}catch(l){for(let h=Bn.length;h>a;h--)Zm();throw l}finally{o&&o._c&&(o._d=!0)}return c}function sx(i){return i.some(e=>ll(e)?!(e.type===Fs||e.type===Ae&&!sx(e.children)):!0)?i:null}const yf=i=>i?Sx(i)?Zh(i):yf(i.parent):null,Wa=fs(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>yf(i.parent),$root:i=>yf(i.root),$host:i=>i.ce,$emit:i=>i.emit,$options:i=>nx(i),$forceUpdate:i=>i.f||(i.f=()=>{Wm(i.update)}),$nextTick:i=>i.n||(i.n=Gh.bind(i.proxy)),$watch:i=>LM.bind(i)}),_u=(i,e)=>i!==Lt&&!i.__isScriptSetup&&It(i,e),JM={get({_:i},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:s,data:n,props:r,accessCache:o,type:a,appContext:c}=i;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return s[e];case 2:return n[e];case 4:return t[e];case 3:return r[e]}else{if(_u(s,e))return o[e]=1,s[e];if(n!==Lt&&It(n,e))return o[e]=2,n[e];if(It(r,e))return o[e]=3,r[e];if(t!==Lt&&It(t,e))return o[e]=4,t[e];xf&&(o[e]=0)}}const l=Wa[e];let h,u;if(l)return e==="$attrs"&&Ps(i.attrs,"get",""),l(i);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==Lt&&It(t,e))return o[e]=4,t[e];if(u=c.config.globalProperties,It(u,e))return u[e]},set({_:i},e,t){const{data:s,setupState:n,ctx:r}=i;return _u(n,e)?(n[e]=t,!0):s!==Lt&&It(s,e)?(s[e]=t,!0):It(i.props,e)||e[0]==="$"&&e.slice(1)in i?!1:(r[e]=t,!0)},has({_:{data:i,setupState:e,accessCache:t,ctx:s,appContext:n,props:r,type:o}},a){let c;return!!(t[a]||i!==Lt&&a[0]!=="$"&&It(i,a)||_u(e,a)||It(r,a)||It(s,a)||It(Wa,a)||It(n.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(i,e,t){return t.get!=null?i._.accessCache[e]=0:It(t,"value")&&this.set(i,e,t.value,null),Reflect.defineProperty(i,e,t)}};function $p(i){return We(i)?i.reduce((e,t)=>(e[t]=null,e),{}):i}let xf=!0;function QM(i){const e=nx(i),t=i.proxy,s=i.ctx;xf=!1,e.beforeCreate&&Xp(e.beforeCreate,i,"bc");const{data:n,computed:r,methods:o,watch:a,provide:c,inject:l,created:h,beforeMount:u,mounted:d,beforeUpdate:f,updated:p,activated:m,deactivated:g,beforeDestroy:v,beforeUnmount:x,destroyed:y,unmounted:M,render:_,renderTracked:w,renderTriggered:b,errorCaptured:C,serverPrefetch:R,expose:F,inheritAttrs:I,components:k,directives:B,filters:D}=e;if(l&&eT(l,s,null),o)for(const X in o){const A=o[X];it(A)&&(s[X]=A.bind(t))}if(n){const X=n.call(t,t);Pt(X)&&(i.data=uo(X))}if(xf=!0,r)for(const X in r){const A=r[X],P=it(A)?A.bind(t,t):it(A.get)?A.get.bind(t,t):rn,O=!it(A)&&it(A.set)?A.set.bind(t):rn,L=Ye({get:P,set:O});Object.defineProperty(s,X,{enumerable:!0,configurable:!0,get:()=>L.value,set:U=>L.value=U})}if(a)for(const X in a)ix(a[X],s,t,X);if(c){const X=it(c)?c.call(t):c;Reflect.ownKeys(X).forEach(A=>{Wy(A,X[A])})}h&&Xp(h,i,"c");function N(X,A){We(A)?A.forEach(P=>X(P.bind(t))):A&&X(A.bind(t))}if(N(YM,u),N(Wn,d),N(GM,f),N(jM,p),N($M,m),N(XM,g),N(qM,C),N(zM,w),N(WM,b),N(Sl,x),N(Ml,M),N(HM,R),We(F))if(F.length){const X=i.exposed||(i.exposed={});F.forEach(A=>{Object.defineProperty(X,A,{get:()=>t[A],set:P=>t[A]=P,enumerable:!0})})}else i.exposed||(i.exposed={});_&&i.render===rn&&(i.render=_),I!=null&&(i.inheritAttrs=I),k&&(i.components=k),B&&(i.directives=B),R&&ex(i)}function eT(i,e,t=rn){We(i)&&(i=bf(i));for(const s in i){const n=i[s];let r;Pt(n)?"default"in n?r=Go(n.from||s,n.default,!0):r=Go(n.from||s):r=Go(n),Vt(r)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[s]=r}}function Xp(i,e,t){pi(We(i)?i.map(s=>s.bind(e.proxy)):i.bind(e.proxy),e,t)}function ix(i,e,t,s){let n=s.includes(".")?zy(t,s):()=>t[s];if(zt(i)){const r=e[i];it(r)&&Ls(n,r)}else if(it(i))Ls(n,i.bind(t));else if(Pt(i))if(We(i))i.forEach(r=>ix(r,e,t,s));else{const r=it(i.handler)?i.handler.bind(t):e[i.handler];it(r)&&Ls(n,r,i)}}function nx(i){const e=i.type,{mixins:t,extends:s}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=i.appContext,a=r.get(e);let c;return a?c=a:!n.length&&!t&&!s?c=e:(c={},n.length&&n.forEach(l=>Gc(c,l,o,!0)),Gc(c,e,o)),Pt(e)&&r.set(e,c),c}function Gc(i,e,t,s=!1){const{mixins:n,extends:r}=e;r&&Gc(i,r,t,!0),n&&n.forEach(o=>Gc(i,o,t,!0));for(const o in e)if(!(s&&o==="expose")){const a=tT[o]||t&&t[o];i[o]=a?a(i[o],e[o]):e[o]}return i}const tT={data:Vp,props:Yp,emits:Yp,methods:Fa,computed:Fa,beforeCreate:Bs,created:Bs,beforeMount:Bs,mounted:Bs,beforeUpdate:Bs,updated:Bs,beforeDestroy:Bs,beforeUnmount:Bs,destroyed:Bs,unmounted:Bs,activated:Bs,deactivated:Bs,errorCaptured:Bs,serverPrefetch:Bs,components:Fa,directives:Fa,watch:iT,provide:Vp,inject:sT};function Vp(i,e){return e?i?function(){return fs(it(i)?i.call(this,this):i,it(e)?e.call(this,this):e)}:e:i}function sT(i,e){return Fa(bf(i),bf(e))}function bf(i){if(We(i)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?i.modelModifiers:i[`${e}Modifiers`]||i[`${Ai(e)}Modifiers`]||i[`${Mr(e)}Modifiers`];function aT(i,e,...t){if(i.isUnmounted)return;const s=i.vnode.props||Lt;let n=t;const r=e.startsWith("update:"),o=r&&oT(s,e.slice(7));o&&(o.trim&&(n=t.map(h=>zt(h)?h.trim():h)),o.number&&(n=t.map(Uh)));let a,c=s[a=xu(e)]||s[a=xu(Ai(e))];!c&&r&&(c=s[a=xu(Mr(e))]),c&&pi(c,i,6,n);const l=s[a+"Once"];if(l){if(!i.emitted)i.emitted={};else if(i.emitted[a])return;i.emitted[a]=!0,pi(l,i,6,n)}}const lT=new WeakMap;function ox(i,e,t=!1){const s=t?lT:e.emitsCache,n=s.get(i);if(n!==void 0)return n;const r=i.emits;let o={},a=!1;if(!it(i)){const c=l=>{const h=ox(l,e,!0);h&&(a=!0,fs(o,h))};!t&&e.mixins.length&&e.mixins.forEach(c),i.extends&&c(i.extends),i.mixins&&i.mixins.forEach(c)}return!r&&!a?(Pt(i)&&s.set(i,null),null):(We(r)?r.forEach(c=>o[c]=null):fs(o,r),Pt(i)&&s.set(i,o),o)}function qh(i,e){return!i||!Lh(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),It(i,e[0].toLowerCase()+e.slice(1))||It(i,Mr(e))||It(i,e))}function Gp(i){const{type:e,vnode:t,proxy:s,withProxy:n,propsOptions:[r],slots:o,attrs:a,emit:c,render:l,renderCache:h,props:u,data:d,setupState:f,ctx:p,inheritAttrs:m}=i,g=Xc(i);let v,x;try{if(t.shapeFlag&4){const M=n||s,_=M;v=qi(l.call(_,M,h,u,f,d,p)),x=a}else{const M=e;v=qi(M.length>1?M(u,{attrs:a,slots:o,emit:c}):M(u,null)),x=e.props?a:cT(a)}}catch(M){Bn.length=0,Yh(M,i,1),v=xe(Fs)}let y=v;if(x&&m!==!1){const M=Object.keys(x),{shapeFlag:_}=y;M.length&&_&7&&(r&&M.some(Bh)&&(x=hT(x,r)),y=br(y,x,!1,!0))}if(t.dirs&&(y=br(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(t.dirs):t.dirs),t.transition){const M=Hh(y.type)&&Vc(y)||y;ol(M,t.transition)}return v=y,Xc(g),v}const cT=i=>{let e;for(const t in i)(t==="class"||t==="style"||Lh(t))&&((e||(e={}))[t]=i[t]);return e},hT=(i,e)=>{const t={};for(const s in i)(!Bh(s)||!(s.slice(9)in e))&&(t[s]=i[s]);return t};function uT(i,e,t){const{props:s,children:n,component:r}=i,{props:o,children:a,patchFlag:c}=e,l=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&c>=0){if(c&1024)return!0;if(c&16)return s?jp(s,o,l):!!o;if(c&8){const h=e.dynamicProps;for(let u=0;uObject.create(lx),hx=i=>Object.getPrototypeOf(i)===lx;function fT(i,e,t,s=!1){const n={},r=cx();i.propsDefaults=Object.create(null),ux(i,e,n,r);for(const o in i.propsOptions[0])o in n||(n[o]=void 0);t?i.props=s?n:yM(n):i.type.props?i.props=n:i.props=r,i.attrs=r}function mT(i,e,t,s){const{props:n,attrs:r,vnode:{patchFlag:o}}=i,a=bt(n),[c]=i.propsOptions;let l=!1;if((s||o>0)&&!(o&16)){if(o&8){const h=i.vnode.dynamicProps;for(let u=0;u{c=!0;const[d,f]=dx(u,e,!0);fs(o,d),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(h),i.extends&&h(i.extends),i.mixins&&i.mixins.forEach(h)}if(!r&&!c)return Pt(i)&&s.set(i,Xo),Xo;if(We(r))for(let h=0;hi==="_"||i==="_ctx"||i==="$stable",Km=i=>We(i)?i.map(qi):[qi(i)],gT=(i,e,t)=>{if(e._n)return e;const s=jh((...n)=>Km(e(...n)),t);return s._c=!1,s},fx=(i,e,t)=>{const s=i._ctx;for(const n in i){if(qm(n))continue;const r=i[n];if(it(r))e[n]=gT(n,r,s);else if(r!=null){const o=Km(r);e[n]=()=>o}}},mx=(i,e)=>{const t=Km(e);i.slots.default=()=>t},px=(i,e,t)=>{for(const s in e)(t||!qm(s))&&(i[s]=e[s])},vT=(i,e,t)=>{const s=i.slots=cx();if(i.vnode.shapeFlag&32){const n=e._;n?(px(s,e,t),t&&by(s,"_",n,!0)):fx(e,s)}else e&&mx(i,e)},yT=(i,e,t)=>{const{vnode:s,slots:n}=i;let r=!0,o=Lt;if(s.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:px(n,e,t):(r=!e.$stable,fx(e,n)),o=e}else e&&(mx(i,e),o={default:1});if(r)for(const a in n)!qm(a)&&o[a]==null&&delete n[a]},Gs=MT;function xT(i){return bT(i)}function bT(i,e){const t=$h();t.__VUE__=!0;const{insert:s,remove:n,patchProp:r,createElement:o,createText:a,createComment:c,setText:l,setElementText:h,parentNode:u,nextSibling:d,setScopeId:f=rn,insertStaticContent:p}=i,m=(Y,W,j,G=null,z=null,se=null,ue=void 0,ne=null,de=!!W.dynamicChildren)=>{if(Y===W)return;Y&&!jr(Y,W)&&(G=re(Y),U(Y,z,se,!0),Y=null),W.patchFlag===-2&&(de=!1,W.dynamicChildren=null);const{type:le,ref:Ie,shapeFlag:ye}=W;switch(le){case Kh:g(Y,W,j,G);break;case Fs:v(Y,W,j,G);break;case wc:Y==null&&x(W,j,G,ue);break;case Ae:k(Y,W,j,G,z,se,ue,ne,de);break;default:ye&1?_(Y,W,j,G,z,se,ue,ne,de):ye&6?B(Y,W,j,G,z,se,ue,ne,de):(ye&64||ye&128)&&le.process(Y,W,j,G,z,se,ue,ne,de,he)}Ie!=null&&z?Ha(Ie,Y&&Y.ref,se,W||Y,!W):Ie==null&&Y&&Y.ref!=null&&Ha(Y.ref,null,se,Y,!0)},g=(Y,W,j,G)=>{if(Y==null)s(W.el=a(W.children),j,G);else{const z=W.el=Y.el;W.children!==Y.children&&l(z,W.children)}},v=(Y,W,j,G)=>{Y==null?s(W.el=c(W.children||""),j,G):W.el=Y.el},x=(Y,W,j,G)=>{[Y.el,Y.anchor]=p(Y.children,W,j,G,Y.el,Y.anchor)},y=({el:Y,anchor:W},j,G)=>{let z;for(;Y&&Y!==W;)z=d(Y),s(Y,j,G),Y=z;s(W,j,G)},M=({el:Y,anchor:W})=>{let j;for(;Y&&Y!==W;)j=d(Y),n(Y),Y=j;n(W)},_=(Y,W,j,G,z,se,ue,ne,de)=>{if(W.type==="svg"?ue="svg":W.type==="math"&&(ue="mathml"),Y==null)w(W,j,G,z,se,ue,ne,de);else{const le=Y.el&&Y.el._isVueCE?Y.el:null;try{le&&le._beginPatch(),R(Y,W,z,se,ue,ne,de)}finally{le&&le._endPatch()}}},w=(Y,W,j,G,z,se,ue,ne)=>{let de,le;const{props:Ie,shapeFlag:ye,transition:me,dirs:Ne}=Y;if(de=Y.el=o(Y.type,se,Ie&&Ie.is,Ie),ye&8?h(de,Y.children):ye&16&&C(Y.children,de,null,G,z,Cu(Y,se),ue,ne),Ne&&Rr(Y,null,G,"created"),b(de,Y,Y.scopeId,ue,G),Ie){for(const qe in Ie)qe!=="value"&&!Ya(qe)&&r(de,qe,null,Ie[qe],se,G);"value"in Ie&&r(de,"value",null,Ie.value,se),(le=Ie.onVnodeBeforeMount)&&Ni(le,G,Y)}Ne&&Rr(Y,null,G,"beforeMount");const Ze=wT(z,me);Ze&&me.beforeEnter(de),s(de,W,j),((le=Ie&&Ie.onVnodeMounted)||Ze||Ne)&&Gs(()=>{try{le&&Ni(le,G,Y),Ze&&me.enter(de),Ne&&Rr(Y,null,G,"mounted")}finally{}},z)},b=(Y,W,j,G,z)=>{if(j&&f(Y,j),G)for(let se=0;se{for(let le=de;le{const ne=W.el=Y.el;let{patchFlag:de,dynamicChildren:le,dirs:Ie}=W;de|=Y.patchFlag&16;const ye=Y.props||Lt,me=W.props||Lt;let Ne;if(j&&Pr(j,!1),(Ne=me.onVnodeBeforeUpdate)&&Ni(Ne,j,W,Y),Ie&&Rr(W,Y,j,"beforeUpdate"),j&&Pr(j,!0),le&&(!Y.dynamicChildren||Y.dynamicChildren.length!==le.length)&&(de=0,ue=!1,le=null),(ye.innerHTML&&me.innerHTML==null||ye.textContent&&me.textContent==null)&&h(ne,""),le?F(Y.dynamicChildren,le,ne,j,G,Cu(W,z),se):ue||A(Y,W,ne,null,j,G,Cu(W,z),se,!1),de>0){if(de&16)I(ne,ye,me,j,z);else if(de&2&&ye.class!==me.class&&r(ne,"class",null,me.class,z),de&4&&r(ne,"style",ye.style,me.style,z),de&8){const Ze=W.dynamicProps;for(let qe=0;qe{Ne&&Ni(Ne,j,W,Y),Ie&&Rr(W,Y,j,"updated")},G)},F=(Y,W,j,G,z,se,ue)=>{for(let ne=0;ne{if(W!==j){if(W!==Lt)for(const se in W)!Ya(se)&&!(se in j)&&r(Y,se,W[se],null,z,G);for(const se in j){if(Ya(se))continue;const ue=j[se],ne=W[se];ue!==ne&&se!=="value"&&r(Y,se,ne,ue,z,G)}"value"in j&&r(Y,"value",W.value,j.value,z)}},k=(Y,W,j,G,z,se,ue,ne,de)=>{const le=W.el=Y?Y.el:a(""),Ie=W.anchor=Y?Y.anchor:a("");let{patchFlag:ye,dynamicChildren:me,slotScopeIds:Ne}=W;Ne&&(ne=ne?ne.concat(Ne):Ne),Y==null?(s(le,j,G),s(Ie,j,G),C(W.children||[],j,Ie,z,se,ue,ne,de)):ye>0&&ye&64&&me&&Y.dynamicChildren&&Y.dynamicChildren.length===me.length?(F(Y.dynamicChildren,me,j,z,se,ue,ne),(W.key!=null||z&&W===z.subTree)&&gx(Y,W,!0)):A(Y,W,j,Ie,z,se,ue,ne,de)},B=(Y,W,j,G,z,se,ue,ne,de)=>{W.slotScopeIds=ne,Y==null?W.shapeFlag&512?z.ctx.activate(W,j,G,ue,de):D(W,j,G,z,se,ue,de):$(Y,W,de)},D=(Y,W,j,G,z,se,ue)=>{const ne=Y.component=IT(Y,G,z);if(Wh(Y)&&(ne.ctx.renderer=he),RT(ne,!1,ue),ne.asyncDep){if(z&&z.registerDep(ne,N,ue),!Y.el){const de=ne.subTree=xe(Fs);v(null,de,W,j),Y.placeholder=de.el}}else N(ne,Y,W,j,z,se,ue)},$=(Y,W,j)=>{const G=W.component=Y.component;if(uT(Y,W,j))if(G.asyncDep&&!G.asyncResolved){X(G,W,j);return}else G.next=W,G.update();else W.el=Y.el,G.vnode=W},N=(Y,W,j,G,z,se,ue)=>{const ne=()=>{if(Y.isMounted){let{next:ye,bu:me,u:Ne,parent:Ze,vnode:qe}=Y;{const Te=vx(Y);if(Te){ye&&(ye.el=qe.el,X(Y,ye,ue)),Te.asyncDep.then(()=>{Gs(()=>{Y.isUnmounted||le()},z)});return}}let Ke=ye,Le;Pr(Y,!1),ye?(ye.el=qe.el,X(Y,ye,ue)):ye=qe,me&&bc(me),(Le=ye.props&&ye.props.onVnodeBeforeUpdate)&&Ni(Le,Ze,ye,qe),Pr(Y,!0);const Me=Gp(Y),nt=Y.subTree;Y.subTree=Me,m(nt,Me,u(nt.el),re(nt),Y,z,se),ye.el=Me.el,Ke===null&&dT(Y,Me.el),Ne&&Gs(Ne,z),(Le=ye.props&&ye.props.onVnodeUpdated)&&Gs(()=>Ni(Le,Ze,ye,qe),z)}else{let ye;const{el:me,props:Ne}=W,{bm:Ze,m:qe,parent:Ke,root:Le,type:Me}=Y,nt=jo(W);Pr(Y,!1),Ze&&bc(Ze),!nt&&(ye=Ne&&Ne.onVnodeBeforeMount)&&Ni(ye,Ke,W),Pr(Y,!0);{Le.ce&&Le.ce._hasShadowRoot()&&Le.ce._injectChildStyle(Me,Y.parent?Y.parent.type:void 0);const Te=Y.subTree=Gp(Y);m(null,Te,j,G,Y,z,se),W.el=Te.el}if(qe&&Gs(qe,z),!nt&&(ye=Ne&&Ne.onVnodeMounted)){const Te=W;Gs(()=>Ni(ye,Ke,Te),z)}(W.shapeFlag&256||Ke&&jo(Ke.vnode)&&Ke.vnode.shapeFlag&256)&&Y.a&&Gs(Y.a,z),Y.isMounted=!0,W=j=G=null}};Y.scope.on();const de=Y.effect=new Ay(ne);Y.scope.off();const le=Y.update=de.run.bind(de),Ie=Y.job=de.runIfDirty.bind(de);Ie.i=Y,Ie.id=Y.uid,de.scheduler=()=>Wm(Ie),Pr(Y,!0),le()},X=(Y,W,j)=>{W.component=Y;const G=Y.vnode.props;Y.vnode=W,Y.next=null,mT(Y,W.props,G,j),yT(Y,W.children,j),Un(),Np(Y),$n()},A=(Y,W,j,G,z,se,ue,ne,de=!1)=>{const le=Y&&Y.children,Ie=Y?Y.shapeFlag:0,ye=W.children,{patchFlag:me,shapeFlag:Ne}=W;if(me>0){if(me&128){O(le,ye,j,G,z,se,ue,ne,de);return}else if(me&256){P(le,ye,j,G,z,se,ue,ne,de);return}}Ne&8?(Ie&16&&ie(le,z,se),ye!==le&&h(j,ye)):Ie&16?Ne&16?O(le,ye,j,G,z,se,ue,ne,de):ie(le,z,se,!0):(Ie&8&&h(j,""),Ne&16&&C(ye,j,G,z,se,ue,ne,de))},P=(Y,W,j,G,z,se,ue,ne,de)=>{Y=Y||Xo,W=W||Xo;const le=Y.length,Ie=W.length,ye=Math.min(le,Ie);let me;for(me=0;meIe?ie(Y,z,se,!0,!1,ye):C(W,j,G,z,se,ue,ne,de,ye)},O=(Y,W,j,G,z,se,ue,ne,de)=>{let le=0;const Ie=W.length;let ye=Y.length-1,me=Ie-1;for(;le<=ye&&le<=me;){const Ne=Y[le],Ze=W[le]=de?Tn(W[le]):qi(W[le]);if(jr(Ne,Ze))m(Ne,Ze,j,null,z,se,ue,ne,de);else break;le++}for(;le<=ye&&le<=me;){const Ne=Y[ye],Ze=W[me]=de?Tn(W[me]):qi(W[me]);if(jr(Ne,Ze))m(Ne,Ze,j,null,z,se,ue,ne,de);else break;ye--,me--}if(le>ye){if(le<=me){const Ne=me+1,Ze=Neme)for(;le<=ye;)U(Y[le],z,se,!0),le++;else{const Ne=le,Ze=le,qe=new Map;for(le=Ze;le<=me;le++){const vt=W[le]=de?Tn(W[le]):qi(W[le]);vt.key!=null&&qe.set(vt.key,le)}let Ke,Le=0;const Me=me-Ze+1;let nt=!1,Te=0;const ps=new Array(Me);for(le=0;le=Me){U(vt,z,se,!0);continue}let te;if(vt.key!=null)te=qe.get(vt.key);else for(Ke=Ze;Ke<=me;Ke++)if(ps[Ke-Ze]===0&&jr(vt,W[Ke])){te=Ke;break}te===void 0?U(vt,z,se,!0):(ps[te-Ze]=le+1,te>=Te?Te=te:nt=!0,m(vt,W[te],j,null,z,se,ue,ne,de),Le++)}const _t=nt?ST(ps):Xo;for(Ke=_t.length-1,le=Me-1;le>=0;le--){const vt=Ze+le,te=W[vt],oe=W[vt+1],lt=vt+1{const{el:se,type:ue,transition:ne,children:de,shapeFlag:le}=Y;if(le&6){L(Y.component.subTree,W,j,G);return}if(le&128){Y.suspense.move(W,j,G);return}if(le&64){ue.move(Y,W,j,he);return}if(ue===Ae){s(se,W,j);for(let ye=0;yene.enter(se),z));else{const{leave:ye,delayLeave:me,afterLeave:Ne}=ne,Ze=()=>{Y.ctx.isUnmounted?n(se):s(se,W,j)},qe=()=>{const Ke=se._isLeaving||!!se[hi];se._isLeaving&&se[hi](!0),ne.persisted&&!Ke?Ze():ye(se,()=>{Ze(),Ne&&Ne()})};me?me(se,Ze,qe):qe()}else s(se,W,j)},U=(Y,W,j,G=!1,z=!1)=>{const{type:se,props:ue,ref:ne,children:de,dynamicChildren:le,shapeFlag:Ie,patchFlag:ye,dirs:me,cacheIndex:Ne,memo:Ze}=Y;if(ye===-2&&(z=!1),ne!=null&&(Un(),Ha(ne,null,j,Y,!0),$n()),Ne!=null&&(W.renderCache[Ne]=void 0),Ie&256){W.ctx.deactivate(Y);return}const qe=Ie&1&&me,Ke=!jo(Y);let Le;if(Ke&&(Le=ue&&ue.onVnodeBeforeUnmount)&&Ni(Le,W,Y),Ie&6)q(Y.component,j,G);else{if(Ie&128){Y.suspense.unmount(j,G);return}qe&&Rr(Y,null,W,"beforeUnmount"),Ie&64?Y.type.remove(Y,W,j,he,G):le&&!le.hasOnce&&(se!==Ae||ye>0&&ye&64)?ie(le,W,j,!1,!0):(se===Ae&&ye&384||!z&&Ie&16)&&ie(de,W,j),G&&V(Y)}const Me=Ze!=null&&Ne==null;(Ke&&(Le=ue&&ue.onVnodeUnmounted)||qe||Me)&&Gs(()=>{Le&&Ni(Le,W,Y),qe&&Rr(Y,null,W,"unmounted"),Me&&(Y.el=null)},j)},V=Y=>{const{type:W,el:j,anchor:G,transition:z}=Y;if(W===Ae){H(j,G);return}if(W===wc){M(Y);return}const se=()=>{n(j),z&&!z.persisted&&z.afterLeave&&z.afterLeave()};if(Y.shapeFlag&1&&z&&!z.persisted){const{leave:ue,delayLeave:ne}=z,de=()=>ue(j,se);ne?ne(Y.el,se,de):de()}else se()},H=(Y,W)=>{let j;for(;Y!==W;)j=d(Y),n(Y),Y=j;n(W)},q=(Y,W,j)=>{const{bum:G,scope:z,job:se,subTree:ue,um:ne,m:de,a:le}=Y;Wp(de),Wp(le),G&&bc(G),z.stop(),se&&(se.flags|=8,U(ue,Y,W,j)),ne&&Gs(ne,W),Gs(()=>{Y.isUnmounted=!0},W)},ie=(Y,W,j,G=!1,z=!1,se=0)=>{for(let ue=se;ue{if(Y.shapeFlag&6)return re(Y.component.subTree);if(Y.shapeFlag&128)return Y.suspense.next();const W=d(Y.anchor||Y.el),j=W&&W[BM];return j?d(j):W};let pe=!1;const ge=(Y,W,j)=>{let G;Y==null?W._vnode&&(U(W._vnode,null,null,!0),G=W._vnode.component):m(W._vnode||null,Y,W,null,null,null,j),W._vnode=Y,pe||(pe=!0,Np(G),Gy(),pe=!1)},he={p:m,um:U,m:L,r:V,mt:D,mc:C,pc:A,pbc:F,n:re,o:i};return{render:ge,hydrate:void 0,createApp:rT(ge)}}function Cu({type:i,props:e},t){return t==="svg"&&i==="foreignObject"||t==="mathml"&&i==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Pr({effect:i,job:e},t){t?(i.flags|=32,e.flags|=4):(i.flags&=-33,e.flags&=-5)}function wT(i,e){return(!i||i&&!i.pendingBranch)&&e&&!e.persisted}function gx(i,e,t=!1){const s=i.children,n=e.children;if(We(s)&&We(n))for(let r=0;r>1,i[t[a]]0&&(e[s]=t[r-1]),t[r]=s)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function vx(i){const e=i.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:vx(e)}function Wp(i){if(i)for(let e=0;ei.__isSuspense;function MT(i,e){e&&e.pendingBranch?We(i)?e.effects.push(...i):e.effects.push(i):PM(i)}const Ae=Symbol.for("v-fgt"),Kh=Symbol.for("v-txt"),Fs=Symbol.for("v-cmt"),wc=Symbol.for("v-stc"),Bn=[];let ei=null;function K(i=!1){Bn.push(ei=i?null:[])}function Zm(){Bn.pop(),ei=Bn[Bn.length-1]||null}let al=1;function jc(i,e=!1){al+=i,i<0&&ei&&e&&(ei.hasOnce=!0)}function bx(i){return i.dynamicChildren=al>0?ei||Xo:null,Zm(),al>0&&ei&&ei.push(i),i}function J(i,e,t,s,n,r){return bx(T(i,e,t,s,n,r,!0))}function kt(i,e,t,s,n){return bx(xe(i,e,t,s,n,!0))}function ll(i){return i?i.__v_isVNode===!0:!1}function jr(i,e){return i.type===e.type&&i.key===e.key}const wx=({key:i})=>i??null,Sc=({ref:i,ref_key:e,ref_for:t})=>(typeof i=="number"&&(i=""+i),i!=null?zt(i)||Vt(i)||it(i)?{i:Os,r:i,k:e,f:!!t}:i:null);function T(i,e=null,t=null,s=0,n=null,r=i===Ae?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:i,props:e,key:e&&wx(e),ref:e&&Sc(e),scopeId:Hy,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Os};return a?(Hc(c,t),r&128&&i.normalize(c)):t&&(c.shapeFlag|=zt(t)?8:16),al>0&&!o&&ei&&(c.patchFlag>0||r&6)&&c.patchFlag!==32&&ei.push(c),c}const xe=TT;function TT(i,e=null,t=null,s=0,n=null,r=!1){if((!i||i===KM)&&(i=Fs),ll(i)){const a=br(i,e,!0);return t&&Hc(a,t),al>0&&!r&&ei&&(a.shapeFlag&6?ei[ei.indexOf(i)]=a:ei.push(a)),a.patchFlag=-2,a}if(OT(i)&&(i=i.__vccOpts),e){e=_T(e);let{class:a,style:c}=e;a&&!zt(a)&&(e.class=ke(a)),Pt(c)&&(Vh(c)&&!We(c)&&(c=fs({},c)),e.style=vs(c))}const o=zt(i)?1:xx(i)?128:Hh(i)?64:Pt(i)?4:it(i)?2:0;return T(i,e,t,s,n,o,r,!0)}function _T(i){return i?Vh(i)||hx(i)?fs({},i):i:null}function br(i,e,t=!1,s=!1){const{props:n,ref:r,patchFlag:o,children:a,transition:c}=i,l=e?CT(n||{},e):n,h={__v_isVNode:!0,__v_skip:!0,type:i.type,props:l,key:l&&wx(l),ref:e&&e.ref?t&&r?We(r)?r.concat(Sc(e)):[r,Sc(e)]:Sc(e):r,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:a,target:i.target,targetStart:i.targetStart,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:e&&i.type!==Ae?o===-1?16:o|16:o,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:c,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&br(i.ssContent),ssFallback:i.ssFallback&&br(i.ssFallback),placeholder:i.placeholder,el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce};return c&&s&&ol(h,c.clone(h)),h}function Rt(i=" ",e=0){return xe(Kh,null,i,e)}function Qs(i,e){const t=xe(wc,null,i);return t.staticCount=e,t}function Se(i="",e=!1){return e?(K(),kt(Fs,null,i)):xe(Fs,null,i)}function qi(i){return i==null||typeof i=="boolean"?xe(Fs):We(i)?xe(Ae,null,i.slice()):ll(i)?Tn(i):xe(Kh,null,String(i))}function Tn(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:br(i)}function Hc(i,e){let t=0;const{shapeFlag:s}=i;if(e==null)e=null;else if(We(e))t=16;else if(typeof e=="object")if(s&65){const n=e.default;n&&(n._c&&(n._d=!1),Hc(i,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!hx(e)?e._ctx=Os:n===3&&Os&&(Os.slots._===1?e._=1:(e._=2,i.patchFlag|=1024))}else if(it(e)){if(s&65){Hc(i,{default:e});return}e={default:e,_ctx:Os},t=32}else e=String(e),s&64?(t=16,e=[Rt(e)]):t=8;i.children=e,i.shapeFlag|=t}function CT(...i){const e={};for(let t=0;t$s||Os;let Wc,cl;{const i=$h(),e=(t,s)=>{let n;return(n=i[t])||(n=i[t]=[]),n.push(s),r=>{n.length>1?n.forEach(o=>o(r)):n[0](r)}};Wc=e("__VUE_INSTANCE_SETTERS__",t=>$s=t),cl=e("__VUE_SSR_SETTERS__",t=>hl=t)}const Tl=i=>{const e=$s;return Wc(i),i.scope.on(),()=>{i.scope.off(),Wc(e)}},zp=()=>{$s&&$s.scope.off(),Wc(null)};function Sx(i){return i.vnode.shapeFlag&4}let hl=!1;function RT(i,e=!1,t=!1){e&&cl(e);const{props:s,children:n}=i.vnode,r=Sx(i);fT(i,s,r,e),vT(i,n,t||e);const o=r?PT(i,e):void 0;return e&&cl(!1),o}function PT(i,e){const t=i.type;i.accessCache=Object.create(null),i.proxy=new Proxy(i.ctx,JM);const{setup:s}=t;if(s){Un();const n=i.setupContext=s.length>1?FT(i):null,r=Tl(i),o=wl(s,i,0,[i.props,n]),a=gy(o);if($n(),r(),(a||i.sp)&&!jo(i)&&ex(i),a){if(o.then(zp,zp),e)return o.then(c=>{cl(!0);try{qp(i,c,e)}finally{cl(!1)}}).catch(c=>{Yh(c,i,0)});i.asyncDep=o}else qp(i,o)}else Mx(i)}function qp(i,e,t){it(e)?i.type.__ssrInlineRender?i.ssrRender=e:i.render=e:Pt(e)&&(i.setupState=Xy(e)),Mx(i)}function Mx(i,e,t){const s=i.type;i.render||(i.render=s.render||rn);{const n=Tl(i);Un();try{QM(i)}finally{$n(),n()}}}const kT={get(i,e){return Ps(i,"get",""),i[e]}};function FT(i){const e=t=>{i.exposed=t||{}};return{attrs:new Proxy(i.attrs,kT),slots:i.slots,emit:i.emit,expose:e}}function Zh(i){return i.exposed?i.exposeProxy||(i.exposeProxy=new Proxy(Xy(hr(i.exposed)),{get(e,t){if(t in e)return e[t];if(t in Wa)return Wa[t](i)},has(e,t){return t in e||t in Wa}})):i.proxy}function OT(i){return it(i)&&"__vccOpts"in i}const Ye=(i,e)=>CM(i,e,hl);function LT(i,e,t){try{jc(-1);const s=arguments.length;return s===2?Pt(e)&&!We(e)?ll(e)?xe(i,null,[e]):xe(i,e):xe(i,null,e):(s>3?t=Array.prototype.slice.call(arguments,2):s===3&&ll(t)&&(t=[t]),xe(i,e,t))}finally{jc(1)}}const BT="3.5.41";/** +* @vue/runtime-dom v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Sf;const Kp=typeof window<"u"&&window.trustedTypes;if(Kp)try{Sf=Kp.createPolicy("vue",{createHTML:i=>i})}catch{}const Tx=Sf?i=>Sf.createHTML(i):i=>i,NT="http://www.w3.org/2000/svg",DT="http://www.w3.org/1998/Math/MathML",xn=typeof document<"u"?document:null,Zp=xn&&xn.createElement("template"),UT={insert:(i,e,t)=>{e.insertBefore(i,t||null)},remove:i=>{const e=i.parentNode;e&&e.removeChild(i)},createElement:(i,e,t,s)=>{const n=e==="svg"?xn.createElementNS(NT,i):e==="mathml"?xn.createElementNS(DT,i):t?xn.createElement(i,{is:t}):xn.createElement(i);return i==="select"&&s&&s.multiple!=null&&n.setAttribute("multiple",s.multiple),n},createText:i=>xn.createTextNode(i),createComment:i=>xn.createComment(i),setText:(i,e)=>{i.nodeValue=e},setElementText:(i,e)=>{i.textContent=e},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>xn.querySelector(i),setScopeId(i,e){i.setAttribute(e,"")},insertStaticContent(i,e,t,s,n,r){const o=t?t.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),t),!(n===r||!(n=n.nextSibling)););else{Zp.innerHTML=Tx(s==="svg"?`${i}`:s==="mathml"?`${i}`:i);const a=Zp.content;if(s==="svg"||s==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},qn="transition",_a="animation",ul=Symbol("_vtc"),_x={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},$T=fs({},qy,_x),XT=i=>(i.displayName="Transition",i.props=$T,i),VT=XT((i,{slots:e})=>LT(UM,YT(i),e)),kr=(i,e=[])=>{We(i)?i.forEach(t=>t(...e)):i&&i(...e)},Jp=i=>i?We(i)?i.some(e=>e.length>1):i.length>1:!1;function YT(i){const e={};for(const k in i)k in _x||(e[k]=i[k]);if(i.css===!1)return e;const{name:t="v",type:s,duration:n,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:c=r,appearActiveClass:l=o,appearToClass:h=a,leaveFromClass:u=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:f=`${t}-leave-to`}=i,p=GT(n),m=p&&p[0],g=p&&p[1],{onBeforeEnter:v,onEnter:x,onEnterCancelled:y,onLeave:M,onLeaveCancelled:_,onBeforeAppear:w=v,onAppear:b=x,onAppearCancelled:C=y}=e,R=(k,B,D,$)=>{k._enterCancelled=$,Fr(k,B?h:a),Fr(k,B?l:o),D&&D()},F=(k,B)=>{k._isLeaving=!1,Fr(k,u),Fr(k,f),Fr(k,d),B&&B()},I=k=>(B,D)=>{const $=k?b:x,N=()=>R(B,k,D);kr($,[B,N]),Qp(()=>{Fr(B,k?c:r),pn(B,k?h:a),Jp($)||eg(B,s,m,N)})};return fs(e,{onBeforeEnter(k){kr(v,[k]),pn(k,r),pn(k,o)},onBeforeAppear(k){kr(w,[k]),pn(k,c),pn(k,l)},onEnter:I(!1),onAppear:I(!0),onLeave(k,B){k._isLeaving=!0;const D=()=>F(k,B);pn(k,u),k._enterCancelled?(pn(k,d),ig(k)):(ig(k),pn(k,d)),Qp(()=>{k._isLeaving&&(Fr(k,u),pn(k,f),Jp(M)||eg(k,s,g,D))}),kr(M,[k,D])},onEnterCancelled(k){R(k,!1,void 0,!0),kr(y,[k])},onAppearCancelled(k){R(k,!0,void 0,!0),kr(C,[k])},onLeaveCancelled(k){F(k),kr(_,[k])}})}function GT(i){if(i==null)return null;if(Pt(i))return[Au(i.enter),Au(i.leave)];{const e=Au(i);return[e,e]}}function Au(i){return jS(i)}function pn(i,e){e.split(/\s+/).forEach(t=>t&&i.classList.add(t)),(i[ul]||(i[ul]=new Set)).add(e)}function Fr(i,e){e.split(/\s+/).forEach(s=>s&&i.classList.remove(s));const t=i[ul];t&&(t.delete(e),t.size||(i[ul]=void 0))}function Qp(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}let jT=0;function eg(i,e,t,s){const n=i._endId=++jT,r=()=>{n===i._endId&&s()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:c}=HT(i,e);if(!o)return s();const l=o+"end";let h=0;const u=()=>{i.removeEventListener(l,d),r()},d=f=>{f.target===i&&++h>=c&&u()};setTimeout(()=>{h(t[p]||"").split(", "),n=s(`${qn}Delay`),r=s(`${qn}Duration`),o=tg(n,r),a=s(`${_a}Delay`),c=s(`${_a}Duration`),l=tg(a,c);let h=null,u=0,d=0;e===qn?o>0&&(h=qn,u=o,d=r.length):e===_a?l>0&&(h=_a,u=l,d=c.length):(u=Math.max(o,l),h=u>0?o>l?qn:_a:null,d=h?h===qn?r.length:c.length:0);const f=h===qn&&/\b(?:transform|all)(?:,|$)/.test(s(`${qn}Property`).toString());return{type:h,timeout:u,propCount:d,hasTransform:f}}function tg(i,e){for(;i.lengthsg(t)+sg(i[s])))}function sg(i){return i==="auto"?0:Number(i.slice(0,-1).replace(",","."))*1e3}function ig(i){return(i?i.ownerDocument:document).body.offsetHeight}function WT(i,e,t){const s=i[ul];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?i.removeAttribute("class"):t?i.setAttribute("class",e):i.className=e}const zc=Symbol("_vod"),Cx=Symbol("_vsh"),ws={name:"show",beforeMount(i,{value:e},{transition:t}){i[zc]=i.style.display==="none"?"":i.style.display,t&&e?t.beforeEnter(i):Ca(i,e)},mounted(i,{value:e},{transition:t}){t&&e&&t.enter(i)},updated(i,{value:e,oldValue:t},{transition:s}){!e!=!t&&(s?e?(s.beforeEnter(i),Ca(i,!0),s.enter(i)):s.leave(i,()=>{Ca(i,!1)}):Ca(i,e))},beforeUnmount(i,{value:e}){Ca(i,e)}};function Ca(i,e){i.style.display=e?i[zc]:"none",i[Cx]=!e}const zT=Symbol(""),qT=/(?:^|;)\s*display\s*:/;function KT(i,e,t){const s=i.style,n=zt(t);let r=!1;if(t&&!n){if(e)if(zt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&Oa(s,a,"")}else for(const o in e)t[o]==null&&Oa(s,o,"");for(const o in t){o==="display"&&(r=!0);const a=t[o];a!=null?JT(i,o,!zt(e)&&e?e[o]:void 0,a)||Oa(s,o,a):Oa(s,o,"")}}else if(n){if(e!==t){const o=s[zT];o&&(t+=";"+o),s.cssText=t,r=qT.test(t)}}else e&&i.removeAttribute("style");zc in i&&(i[zc]=r?s.display:"",i[Cx]&&(s.display="none"))}const ng=/\s*!important$/;function Oa(i,e,t){if(We(t))t.forEach(s=>Oa(i,e,s));else if(t==null&&(t=""),e.startsWith("--"))i.setProperty(e,t);else{const s=ZT(i,e);ng.test(t)?i.setProperty(Mr(s),t.replace(ng,""),"important"):i[s]=t}}const rg=["Webkit","Moz","ms"],Eu={};function ZT(i,e){const t=Eu[e];if(t)return t;let s=Ai(e);if(s!=="filter"&&s in i)return Eu[e]=s;s=xy(s);for(let n=0;nIu||(n_.then(()=>Iu=0),Iu=Date.now());function o_(i,e){const t=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=t.attached)return;const n=t.value;if(We(n)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const o=n.slice(),a=[s];for(let c=0;ci.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)>96&&i.charCodeAt(2)<123,a_=(i,e,t,s,n,r)=>{const o=n==="svg";e==="class"?WT(i,s,o):e==="style"?KT(i,t,s):Lh(e)?Bh(e)||e_(i,e,t,s,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):l_(i,e,s,o))?(lg(i,e,s),!i.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&ag(i,e,s,o,r,e!=="value")):i._isVueCE&&(c_(i,e)||i._def.__asyncLoader&&(/[A-Z]/.test(e)||!zt(s)))?lg(i,Ai(e),s,r,e):(e==="true-value"?i._trueValue=s:e==="false-value"&&(i._falseValue=s),ag(i,e,s,o))};function l_(i,e,t,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in i&&hg(e)&&it(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&i.tagName==="IFRAME"||e==="form"||e==="list"&&i.tagName==="INPUT"||e==="type"&&i.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const n=i.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return hg(e)&&zt(t)?!1:e in i}function c_(i,e){const t=i._def.props;if(!t)return!1;const s=Ai(e);return Array.isArray(t)?t.some(n=>Ai(n)===s):Object.keys(t).some(n=>Ai(n)===s)}const ia=i=>{const e=i.props["onUpdate:modelValue"]||!1;return We(e)?t=>bc(e,t):e};function h_(i){i.target.composing=!0}function ug(i){const e=i.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const en=Symbol("_assign"),$l=Symbol("_initialValue");function Ru(i,e,t){return e&&(i=i.trim()),t&&(i=Uh(i)),i}const Ge={created(i,{modifiers:{lazy:e,trim:t,number:s}},n){i.parentNode&&(i.type==="text"?i[$l]=i.defaultValue.replace(/[\r\n]/g,""):i.type==="textarea"&&(i[$l]=i.defaultValue.replace(/\r\n?/g,` +`))),i[en]=ia(n);const r=s||n.props&&n.props.type==="number";or(i,e?"change":"input",o=>{o.target.composing||i[en](Ru(i.value,t,r))}),(t||r)&&or(i,"change",()=>{i.value=Ru(i.value,t,r)}),e||(or(i,"compositionstart",h_),or(i,"compositionend",ug),or(i,"change",ug))},mounted(i,{value:e,modifiers:{trim:t,number:s}}){const n=e??"",r=i[$l];delete i[$l],r!==void 0&&(i.type==="text"||i.type==="textarea")&&i.value!==r?i[en](Ru(i.value,t,s)):i.value=n},beforeUpdate(i,{value:e,oldValue:t,modifiers:{lazy:s,trim:n,number:r}},o){if(i[en]=ia(o),i.composing)return;const a=(r||i.type==="number")&&!/^0\d/.test(i.value)?Uh(i.value):i.value,c=e??"";if(a===c)return;const l=i.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===i&&i.type!=="range"&&(s&&e===t||n&&i.value.trim()===c)||(i.value=c)}},wt={deep:!0,created(i,e,t){i[en]=ia(t),or(i,"change",()=>{const s=i._modelValue,n=dl(i),r=i.checked,o=i[en];if(We(s)){const a=$m(s,n),c=a!==-1;if(r&&!c)o(s.concat(n));else if(!r&&c){const l=[...s];l.splice(a,1),o(l)}}else if(ha(s)){const a=new Set(s);r?a.add(n):a.delete(n),o(a)}else o(Ax(i,r))})},mounted:dg,beforeUpdate(i,e,t){i[en]=ia(t),dg(i,e,t)}};function dg(i,{value:e,oldValue:t},s){i._modelValue=e;let n;if(We(e))n=$m(e,s.props.value)>-1;else if(ha(e))n=e.has(s.props.value);else{if(e===t)return;n=ua(e,Ax(i,!0))}i.checked!==n&&(i.checked=n)}const Tt={deep:!0,created(i,{value:e,modifiers:{number:t}},s){i._modelValue=e,or(i,"change",()=>{const n=Array.prototype.filter.call(i.options,r=>r.selected).map(r=>t?Uh(dl(r)):dl(r));i[en](i.multiple?ha(i._modelValue)?new Set(n):n:n[0]),i._assigning=!0,Gh(()=>{i._assigning=!1})}),i[en]=ia(s)},mounted(i,{value:e}){fg(i,e)},beforeUpdate(i,{value:e},t){i._modelValue=e,i[en]=ia(t)},updated(i,{value:e}){i._assigning||fg(i,e)}};function fg(i,e){const t=i.multiple,s=We(e);if(!(t&&!s&&!ha(e))){for(let n=0,r=i.options.length;nString(l)===String(a)):o.selected=$m(e,a)>-1}else o.selected=e.has(a);else if(ua(dl(o),e)){i.selectedIndex!==n&&(i.selectedIndex=n);return}}!t&&i.selectedIndex!==-1&&(i.selectedIndex=-1)}}function dl(i){return"_value"in i?i._value:i.value}function Ax(i,e){const t=e?"_trueValue":"_falseValue";return t in i?i[t]:e}const u_=["ctrl","shift","alt","meta"],d_={stop:i=>i.stopPropagation(),prevent:i=>i.preventDefault(),self:i=>i.target!==i.currentTarget,ctrl:i=>!i.ctrlKey,shift:i=>!i.shiftKey,alt:i=>!i.altKey,meta:i=>!i.metaKey,left:i=>"button"in i&&i.button!==0,middle:i=>"button"in i&&i.button!==1,right:i=>"button"in i&&i.button!==2,exact:(i,e)=>u_.some(t=>i[`${t}Key`]&&!e.includes(t))},Je=(i,e)=>{if(!i)return i;const t=i._withMods||(i._withMods={}),s=e.join(".");return t[s]||(t[s]=((n,...r)=>{for(let o=0;o{const t=i._withKeys||(i._withKeys={}),s=e.join(".");return t[s]||(t[s]=(n=>{if(!("key"in n))return;const r=Mr(n.key);if(e.some(o=>o===r||f_[o]===r))return i(n)}))},m_=fs({patchProp:a_},UT);let mg;function p_(){return mg||(mg=xT(m_))}const g_=((...i)=>{const e=p_().createApp(...i),{mount:t}=e;return e.mount=s=>{const n=y_(s);if(!n)return;const r=e._component;!it(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const o=t(n,!1,v_(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e});function v_(i){if(i instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&i instanceof MathMLElement)return"mathml"}function y_(i){return zt(i)?document.querySelector(i):i}/*! + * pinia v4.0.3 + * (c) 2026 Eduardo San Martin Morote + * @license MIT + */let Ex;const Jh=i=>Ex=i,Ix=Symbol();function pg(i){return i&&typeof i=="object"&&Object.prototype.toString.call(i)==="[object Object]"&&typeof i.toJSON!="function"}function x_(){const i=_y(!0),e=i.run(()=>$e({}));let t=[],s=[];const n=hr({install(r){Jh(n),n._a=r,r.provide(Ix,n),r.config.globalProperties.$pinia=n,s.forEach(o=>t.push(o)),s=[]},use(r){return this._a?t.push(r):s.push(r),this},_p:t,_a:null,_e:i,_s:new Map,state:e});return n}const Mf=()=>{};function gg(i,e,t,s=Mf){i.add(e);const n=()=>{i.delete(e)&&s()};return!t&&Cy()&&QS(n),n}function wo(i,...e){i.forEach(t=>{t(...e)})}const b_=i=>i(),vg=Symbol(),Pu=Symbol();function Tf(i,e){i instanceof Map&&e instanceof Map?e.forEach((t,s)=>i.set(s,t)):i instanceof Set&&e instanceof Set&&e.forEach(i.add,i);for(const t in e){if(!Object.hasOwn(e,t))continue;const s=e[t],n=i[t];pg(n)&&pg(s)&&Object.hasOwn(i,t)&&!Vt(s)&&!Ln(s)?i[t]=Tf(n,s):i[t]=s}return i}const w_=Symbol();function S_(i){return!i||typeof i!="object"||!Object.hasOwn(i,w_)}const{assign:Jn}=Object;function M_(i){return!!(Vt(i)&&i.effect)}function T_(i,e,t,s){const{state:n,actions:r,getters:o}=e,a=t.state.value[i];let c;function l(){a||(t.state.value[i]=n?n():{});const h=SM(t.state.value[i]);return Jn(h,r,Object.keys(o||{}).reduce((u,d)=>(u[d]=hr(Ye(()=>{Jh(t);const f=t._s.get(i);return o[d].call(f,f)})),u),{}))}return c=Rx(i,l,e,t,s,!0),c}function Rx(i,e,t={},s,n,r){let o;const a=Jn({actions:{}},t),c={deep:!0};let l,h,u=new Set,d=new Set,f;const p=s.state.value[i];!r&&!p&&(s.state.value[i]={});let m;function g(b){let C;l=h=!1,typeof b=="function"?(b(s.state.value[i]),C={type:"patch function",storeId:i,events:f}):(Tf(s.state.value[i],b),C={type:"patch object",payload:b,storeId:i,events:f});const R=m=Symbol();Gh().then(()=>{m===R&&(l=!0)}),h=!0,wo(u,C,s.state.value[i])}const v=r?function(){const{state:C}=t,R=C?C():{};this.$patch(F=>{Jn(F,R)})}:Mf;function x(){o.stop(),u.clear(),d.clear(),s._s.delete(i)}const y=(b,C="")=>{if(vg in b)return b[Pu]=C,b;const R=function(){Jh(s);const F=Array.from(arguments),I=new Set,k=new Set;function B(N){I.add(N)}function D(N){k.add(N)}wo(d,{args:F,name:R[Pu],store:_,after:B,onError:D});let $;try{$=b.apply(this&&this.$id===i?this:_,F)}catch(N){throw wo(k,N),N}return $ instanceof Promise?$.then(N=>(wo(I,N),N)).catch(N=>(wo(k,N),Promise.reject(N))):(wo(I,$),$)};return R[vg]=!0,R[Pu]=C,R},M={_p:s,$id:i,$onAction:gg.bind(null,d),$patch:g,$reset:v,$subscribe(b,C={}){if(u.has(b))return Mf;const R=gg(u,b,C.detached,()=>F()),F=o.run(()=>Ls(()=>s.state.value[i],I=>{(C.flush==="sync"?h:l)&&b({storeId:i,type:"direct",events:f},I)},Jn({},c,C)));return R},$dispose:x},_=uo(M);s._s.set(i,_);const w=(s._a&&s._a.runWithContext||b_)(()=>s._e.run(()=>(o=_y()).run(()=>e({action:y}))));for(const b in w){const C=w[b];Vt(C)&&!M_(C)||Ln(C)?r||(p&&S_(C)&&(Vt(C)?C.value=p[b]:((C instanceof Set||C instanceof Map)&&C.clear(),Tf(C,p[b]))),s.state.value[i][b]=C):typeof C=="function"&&(w[b]=y(C,b),a.actions[b]=C)}return Jn(_,w),Jn(bt(_),w),Object.defineProperty(_,"$state",{get:()=>s.state.value[i],set:b=>{g(C=>{Jn(C,b)})}}),s._p.forEach(b=>{const C=o.run(()=>b({store:_,app:s._a,pinia:s,options:a}));Jn(_,C)}),p&&r&&t.hydrate&&t.hydrate(_.$state,p),l=!0,h=!0,_}/*! #__NO_SIDE_EFFECTS__ */function __(i,e,t){let s;const n=typeof e=="function";s=n?t:e;function r(o,a){const c=kM();return o=o||(c?Go(Ix,null):null),o&&Jh(o),o=Ex,o._s.has(i)||(n?Rx(i,e,s,o):T_(i,s,o)),o._s.get(i)}return r.$id=i,r}var fo=(i=>(i[i.WEBGL_LEGACY=0]="WEBGL_LEGACY",i[i.WEBGL=1]="WEBGL",i[i.WEBGL2=2]="WEBGL2",i))(fo||{}),Px=(i=>(i[i.UNKNOWN=0]="UNKNOWN",i[i.WEBGL=1]="WEBGL",i[i.CANVAS=2]="CANVAS",i))(Px||{}),_f=(i=>(i[i.COLOR=16384]="COLOR",i[i.DEPTH=256]="DEPTH",i[i.STENCIL=1024]="STENCIL",i))(_f||{}),He=(i=>(i[i.NORMAL=0]="NORMAL",i[i.ADD=1]="ADD",i[i.MULTIPLY=2]="MULTIPLY",i[i.SCREEN=3]="SCREEN",i[i.OVERLAY=4]="OVERLAY",i[i.DARKEN=5]="DARKEN",i[i.LIGHTEN=6]="LIGHTEN",i[i.COLOR_DODGE=7]="COLOR_DODGE",i[i.COLOR_BURN=8]="COLOR_BURN",i[i.HARD_LIGHT=9]="HARD_LIGHT",i[i.SOFT_LIGHT=10]="SOFT_LIGHT",i[i.DIFFERENCE=11]="DIFFERENCE",i[i.EXCLUSION=12]="EXCLUSION",i[i.HUE=13]="HUE",i[i.SATURATION=14]="SATURATION",i[i.COLOR=15]="COLOR",i[i.LUMINOSITY=16]="LUMINOSITY",i[i.NORMAL_NPM=17]="NORMAL_NPM",i[i.ADD_NPM=18]="ADD_NPM",i[i.SCREEN_NPM=19]="SCREEN_NPM",i[i.NONE=20]="NONE",i[i.SRC_OVER=0]="SRC_OVER",i[i.SRC_IN=21]="SRC_IN",i[i.SRC_OUT=22]="SRC_OUT",i[i.SRC_ATOP=23]="SRC_ATOP",i[i.DST_OVER=24]="DST_OVER",i[i.DST_IN=25]="DST_IN",i[i.DST_OUT=26]="DST_OUT",i[i.DST_ATOP=27]="DST_ATOP",i[i.ERASE=26]="ERASE",i[i.SUBTRACT=28]="SUBTRACT",i[i.XOR=29]="XOR",i))(He||{}),tn=(i=>(i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN",i))(tn||{}),_e=(i=>(i[i.RGBA=6408]="RGBA",i[i.RGB=6407]="RGB",i[i.RG=33319]="RG",i[i.RED=6403]="RED",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.ALPHA=6406]="ALPHA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i))(_e||{}),Ho=(i=>(i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i))(Ho||{}),De=(i=>(i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.BYTE=5120]="BYTE",i[i.SHORT=5122]="SHORT",i[i.INT=5124]="INT",i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.HALF_FLOAT=36193]="HALF_FLOAT",i))(De||{}),Be=(i=>(i[i.FLOAT=0]="FLOAT",i[i.INT=1]="INT",i[i.UINT=2]="UINT",i))(Be||{}),Ci=(i=>(i[i.NEAREST=0]="NEAREST",i[i.LINEAR=1]="LINEAR",i))(Ci||{}),Ii=(i=>(i[i.CLAMP=33071]="CLAMP",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",i))(Ii||{}),gi=(i=>(i[i.OFF=0]="OFF",i[i.POW2=1]="POW2",i[i.ON=2]="ON",i[i.ON_MANUAL=3]="ON_MANUAL",i))(gi||{}),xs=(i=>(i[i.NPM=0]="NPM",i[i.UNPACK=1]="UNPACK",i[i.PMA=2]="PMA",i[i.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",i[i.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",i[i.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",i))(xs||{}),Ki=(i=>(i[i.NO=0]="NO",i[i.YES=1]="YES",i[i.AUTO=2]="AUTO",i[i.BLEND=0]="BLEND",i[i.CLEAR=1]="CLEAR",i[i.BLIT=2]="BLIT",i))(Ki||{}),Qm=(i=>(i[i.AUTO=0]="AUTO",i[i.MANUAL=1]="MANUAL",i))(Qm||{}),fi=(i=>(i.LOW="lowp",i.MEDIUM="mediump",i.HIGH="highp",i))(fi||{}),cs=(i=>(i[i.NONE=0]="NONE",i[i.SCISSOR=1]="SCISSOR",i[i.STENCIL=2]="STENCIL",i[i.SPRITE=3]="SPRITE",i[i.COLOR=4]="COLOR",i))(cs||{}),as=(i=>(i[i.NONE=0]="NONE",i[i.LOW=2]="LOW",i[i.MEDIUM=4]="MEDIUM",i[i.HIGH=8]="HIGH",i))(as||{}),on=(i=>(i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i))(on||{});const C_={createCanvas:(i,e)=>{const t=document.createElement("canvas");return t.width=i,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(i,e)=>fetch(i,e),parseXML:i=>new DOMParser().parseFromString(i,"text/xml")},Oe={ADAPTER:C_,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var ku=/iPhone/i,yg=/iPod/i,xg=/iPad/i,bg=/\biOS-universal(?:.+)Mac\b/i,Fu=/\bAndroid(?:.+)Mobile\b/i,wg=/Android/i,So=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Xl=/Silk/i,gn=/Windows Phone/i,Sg=/\bWindows(?:.+)ARM\b/i,Mg=/BlackBerry/i,Tg=/BB10/i,_g=/Opera Mini/i,Cg=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ag=/Mobile(?:.+)Firefox\b/i,Eg=function(i){return typeof i<"u"&&i.platform==="MacIntel"&&typeof i.maxTouchPoints=="number"&&i.maxTouchPoints>1&&typeof MSStream>"u"};function A_(i){return function(e){return e.test(i)}}function Ig(i){var e={userAgent:"",platform:"",maxTouchPoints:0};!i&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof i=="string"?e.userAgent=i:i&&i.userAgent&&(e={userAgent:i.userAgent,platform:i.platform,maxTouchPoints:i.maxTouchPoints||0});var t=e.userAgent,s=t.split("[FBAN");typeof s[1]<"u"&&(t=s[0]),s=t.split("Twitter"),typeof s[1]<"u"&&(t=s[0]);var n=A_(t),r={apple:{phone:n(ku)&&!n(gn),ipod:n(yg),tablet:!n(ku)&&(n(xg)||Eg(e))&&!n(gn),universal:n(bg),device:(n(ku)||n(yg)||n(xg)||n(bg)||Eg(e))&&!n(gn)},amazon:{phone:n(So),tablet:!n(So)&&n(Xl),device:n(So)||n(Xl)},android:{phone:!n(gn)&&n(So)||!n(gn)&&n(Fu),tablet:!n(gn)&&!n(So)&&!n(Fu)&&(n(Xl)||n(wg)),device:!n(gn)&&(n(So)||n(Xl)||n(Fu)||n(wg))||n(/\bokhttp\b/i)},windows:{phone:n(gn),tablet:n(Sg),device:n(gn)||n(Sg)},other:{blackberry:n(Mg),blackberry10:n(Tg),opera:n(_g),firefox:n(Ag),chrome:n(Cg),device:n(Mg)||n(Tg)||n(_g)||n(Ag)||n(Cg)},any:!1,phone:!1,tablet:!1};return r.any=r.apple.device||r.android.device||r.windows.device||r.other.device,r.phone=r.apple.phone||r.android.phone||r.windows.phone,r.tablet=r.apple.tablet||r.android.tablet||r.windows.tablet,r}const E_=Ig.default??Ig,En=E_(globalThis.navigator);Oe.RETINA_PREFIX=/@([0-9\.]+)x/;Oe.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var qc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kx(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function I_(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var n=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return i[s]}})}),t}var Ou={exports:{}},Rg;function R_(){return Rg||(Rg=1,(function(i){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function n(c,l,h){this.fn=c,this.context=l,this.once=h||!1}function r(c,l,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new n(h,u||c,d),p=t?t+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],f]:c._events[p].push(f):(c._events[p]=f,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new s:delete c._events[l]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],h,u;if(this._eventsCount===0)return l;for(u in h=this._events)e.call(h,u)&&l.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(h)):l},a.prototype.listeners=function(l){var h=t?t+l:l,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d80*A){V=q=N[0],H=ie=N[1];for(var he=A;heq&&(q=re),pe>ie&&(ie=pe);ge=Math.max(q-V,ie-H),ge=ge!==0?32767/ge:0}return s(L,U,A,V,H,ge,0),U}function e(N,X,A,P,O){var L,U;if(O===$(N,X,A,P)>0)for(L=X;L=X;L-=P)U=k(L,N[L],N[L+1],U);return U&&M(U,U.next)&&(B(U),U=U.next),U}function t(N,X){if(!N)return N;X||(X=N);var A=N,P;do if(P=!1,!A.steiner&&(M(A,A.next)||y(A.prev,A,A.next)===0)){if(B(A),A=X=A.prev,A===A.next)break;P=!0}else A=A.next;while(P||A!==X);return X}function s(N,X,A,P,O,L,U){if(N){!U&&L&&f(N,P,O,L);for(var V=N,H,q;N.prev!==N.next;){if(H=N.prev,q=N.next,L?r(N,P,O,L):n(N)){X.push(H.i/A|0),X.push(N.i/A|0),X.push(q.i/A|0),B(N),N=q.next,V=q.next;continue}if(N=q,N===V){U?U===1?(N=o(t(N),X,A),s(N,X,A,P,O,L,2)):U===2&&a(N,X,A,P,O,L):s(t(N),X,A,P,O,L,1);break}}}}function n(N){var X=N.prev,A=N,P=N.next;if(y(X,A,P)>=0)return!1;for(var O=X.x,L=A.x,U=P.x,V=X.y,H=A.y,q=P.y,ie=OL?O>U?O:U:L>U?L:U,ge=V>H?V>q?V:q:H>q?H:q,he=P.next;he!==X;){if(he.x>=ie&&he.x<=pe&&he.y>=re&&he.y<=ge&&v(O,V,L,H,U,q,he.x,he.y)&&y(he.prev,he,he.next)>=0)return!1;he=he.next}return!0}function r(N,X,A,P){var O=N.prev,L=N,U=N.next;if(y(O,L,U)>=0)return!1;for(var V=O.x,H=L.x,q=U.x,ie=O.y,re=L.y,pe=U.y,ge=VH?V>q?V:q:H>q?H:q,Y=ie>re?ie>pe?ie:pe:re>pe?re:pe,W=m(ge,he,X,A,P),j=m(fe,Y,X,A,P),G=N.prevZ,z=N.nextZ;G&&G.z>=W&&z&&z.z<=j;){if(G.x>=ge&&G.x<=fe&&G.y>=he&&G.y<=Y&&G!==O&&G!==U&&v(V,ie,H,re,q,pe,G.x,G.y)&&y(G.prev,G,G.next)>=0||(G=G.prevZ,z.x>=ge&&z.x<=fe&&z.y>=he&&z.y<=Y&&z!==O&&z!==U&&v(V,ie,H,re,q,pe,z.x,z.y)&&y(z.prev,z,z.next)>=0))return!1;z=z.nextZ}for(;G&&G.z>=W;){if(G.x>=ge&&G.x<=fe&&G.y>=he&&G.y<=Y&&G!==O&&G!==U&&v(V,ie,H,re,q,pe,G.x,G.y)&&y(G.prev,G,G.next)>=0)return!1;G=G.prevZ}for(;z&&z.z<=j;){if(z.x>=ge&&z.x<=fe&&z.y>=he&&z.y<=Y&&z!==O&&z!==U&&v(V,ie,H,re,q,pe,z.x,z.y)&&y(z.prev,z,z.next)>=0)return!1;z=z.nextZ}return!0}function o(N,X,A){var P=N;do{var O=P.prev,L=P.next.next;!M(O,L)&&_(O,P,P.next,L)&&R(O,L)&&R(L,O)&&(X.push(O.i/A|0),X.push(P.i/A|0),X.push(L.i/A|0),B(P),B(P.next),P=N=L),P=P.next}while(P!==N);return t(P)}function a(N,X,A,P,O,L){var U=N;do{for(var V=U.next.next;V!==U.prev;){if(U.i!==V.i&&x(U,V)){var H=I(U,V);U=t(U,U.next),H=t(H,H.next),s(U,X,A,P,O,L,0),s(H,X,A,P,O,L,0);return}V=V.next}U=U.next}while(U!==N)}function c(N,X,A,P){var O=[],L,U,V,H,q;for(L=0,U=X.length;L=A.next.y&&A.next.y!==A.y){var V=A.x+(O-A.y)*(A.next.x-A.x)/(A.next.y-A.y);if(V<=P&&V>L&&(L=V,U=A.x=A.x&&A.x>=q&&P!==A.x&&v(OU.x||A.x===U.x&&d(U,A)))&&(U=A,re=pe)),A=A.next;while(A!==H);return U}function d(N,X){return y(N.prev,N,X.prev)<0&&y(X.next,N,N.next)<0}function f(N,X,A,P){var O=N;do O.z===0&&(O.z=m(O.x,O.y,X,A,P)),O.prevZ=O.prev,O.nextZ=O.next,O=O.next;while(O!==N);O.prevZ.nextZ=null,O.prevZ=null,p(O)}function p(N){var X,A,P,O,L,U,V,H,q=1;do{for(A=N,N=null,L=null,U=0;A;){for(U++,P=A,V=0,X=0;X0||H>0&&P;)V!==0&&(H===0||!P||A.z<=P.z)?(O=A,A=A.nextZ,V--):(O=P,P=P.nextZ,H--),L?L.nextZ=O:N=O,O.prevZ=L,L=O;A=P}L.nextZ=null,q*=2}while(U>1);return N}function m(N,X,A,P,O){return N=(N-A)*O|0,X=(X-P)*O|0,N=(N|N<<8)&16711935,N=(N|N<<4)&252645135,N=(N|N<<2)&858993459,N=(N|N<<1)&1431655765,X=(X|X<<8)&16711935,X=(X|X<<4)&252645135,X=(X|X<<2)&858993459,X=(X|X<<1)&1431655765,N|X<<1}function g(N){var X=N,A=N;do(X.x=(N-U)*(L-V)&&(N-U)*(P-V)>=(A-U)*(X-V)&&(A-U)*(L-V)>=(O-U)*(P-V)}function x(N,X){return N.next.i!==X.i&&N.prev.i!==X.i&&!C(N,X)&&(R(N,X)&&R(X,N)&&F(N,X)&&(y(N.prev,N,X.prev)||y(N,X.prev,X))||M(N,X)&&y(N.prev,N,N.next)>0&&y(X.prev,X,X.next)>0)}function y(N,X,A){return(X.y-N.y)*(A.x-X.x)-(X.x-N.x)*(A.y-X.y)}function M(N,X){return N.x===X.x&&N.y===X.y}function _(N,X,A,P){var O=b(y(N,X,A)),L=b(y(N,X,P)),U=b(y(A,P,N)),V=b(y(A,P,X));return!!(O!==L&&U!==V||O===0&&w(N,A,X)||L===0&&w(N,P,X)||U===0&&w(A,N,P)||V===0&&w(A,X,P))}function w(N,X,A){return X.x<=Math.max(N.x,A.x)&&X.x>=Math.min(N.x,A.x)&&X.y<=Math.max(N.y,A.y)&&X.y>=Math.min(N.y,A.y)}function b(N){return N>0?1:N<0?-1:0}function C(N,X){var A=N;do{if(A.i!==N.i&&A.next.i!==N.i&&A.i!==X.i&&A.next.i!==X.i&&_(A,A.next,N,X))return!0;A=A.next}while(A!==N);return!1}function R(N,X){return y(N.prev,N,N.next)<0?y(N,X,N.next)>=0&&y(N,N.prev,X)>=0:y(N,X,N.prev)<0||y(N,N.next,X)<0}function F(N,X){var A=N,P=!1,O=(N.x+X.x)/2,L=(N.y+X.y)/2;do A.y>L!=A.next.y>L&&A.next.y!==A.y&&O<(A.next.x-A.x)*(L-A.y)/(A.next.y-A.y)+A.x&&(P=!P),A=A.next;while(A!==N);return P}function I(N,X){var A=new D(N.i,N.x,N.y),P=new D(X.i,X.x,X.y),O=N.next,L=X.prev;return N.next=X,X.prev=N,A.next=O,O.prev=A,P.next=A,A.prev=P,L.next=P,P.prev=L,P}function k(N,X,A,P){var O=new D(N,X,A);return P?(O.next=P.next,O.prev=P,P.next.prev=O,P.next=O):(O.prev=O,O.next=O),O}function B(N){N.next.prev=N.prev,N.prev.next=N.next,N.prevZ&&(N.prevZ.nextZ=N.nextZ),N.nextZ&&(N.nextZ.prevZ=N.prevZ)}function D(N,X,A){this.i=N,this.x=X,this.y=A,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}i.deviation=function(N,X,A,P){var O=X&&X.length,L=O?X[0]*A:N.length,U=Math.abs($(N,0,L,A));if(O)for(var V=0,H=X.length;V0&&(P+=N[O-1].length,A.holes.push(P))}return A},Vl.exports}var F_=k_();const O_=kx(F_);var Or={},La={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var L_=La.exports,kg;function B_(){return kg||(kg=1,(function(i,e){(function(t){var s=e&&!e.nodeType&&e,n=i&&!i.nodeType&&i,r=typeof qc=="object"&&qc;(r.global===r||r.window===r||r.self===r)&&(t=r);var o,a=2147483647,c=36,l=1,h=26,u=38,d=700,f=72,p=128,m="-",g=/^xn--/,v=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=c-l,_=Math.floor,w=String.fromCharCode,b;function C(O){throw new RangeError(y[O])}function R(O,L){for(var U=O.length,V=[];U--;)V[U]=L(O[U]);return V}function F(O,L){var U=O.split("@"),V="";U.length>1&&(V=U[0]+"@",O=U[1]),O=O.replace(x,".");var H=O.split("."),q=R(H,L).join(".");return V+q}function I(O){for(var L=[],U=0,V=O.length,H,q;U=55296&&H<=56319&&U65535&&(L-=65536,U+=w(L>>>10&1023|55296),L=56320|L&1023),U+=w(L),U}).join("")}function B(O){return O-48<10?O-22:O-65<26?O-65:O-97<26?O-97:c}function D(O,L){return O+22+75*(O<26)-((L!=0)<<5)}function $(O,L,U){var V=0;for(O=U?_(O/d):O>>1,O+=_(O/L);O>M*h>>1;V+=c)O=_(O/M);return _(V+(M+1)*O/(O+u))}function N(O){var L=[],U=O.length,V,H=0,q=p,ie=f,re,pe,ge,he,fe,Y,W,j,G;for(re=O.lastIndexOf(m),re<0&&(re=0),pe=0;pe=128&&C("not-basic"),L.push(O.charCodeAt(pe));for(ge=re>0?re+1:0;ge=U&&C("invalid-input"),W=B(O.charCodeAt(ge++)),(W>=c||W>_((a-H)/fe))&&C("overflow"),H+=W*fe,j=Y<=ie?l:Y>=ie+h?h:Y-ie,!(W_(a/G)&&C("overflow"),fe*=G;V=L.length+1,ie=$(H-he,V,he==0),_(H/V)>a-q&&C("overflow"),q+=_(H/V),H%=V,L.splice(H++,0,q)}return k(L)}function X(O){var L,U,V,H,q,ie,re,pe,ge,he,fe,Y=[],W,j,G,z;for(O=I(O),W=O.length,L=p,U=0,q=f,ie=0;ie=L&&fe_((a-U)/j)&&C("overflow"),U+=(re-L)*j,L=re,ie=0;iea&&C("overflow"),fe==L){for(pe=U,ge=c;he=ge<=q?l:ge>=q+h?h:ge-q,!(pe-1e3&&te<1e3||w.call(/e/,oe))return oe;var lt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof te=="number"){var At=te<0?-F(-te):F(te);if(At!==te){var Et=String(At),tt=x.call(oe,Et.length+1);return y.call(Et,lt,"$&_")+"."+y.call(y.call(tt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(oe,lt,"$&_")}var P=U_,O=P.custom,L=j(O)?O:null,U={__proto__:null,double:'"',single:"'"},V={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Bu=function te(oe,lt,At,Et){var tt=lt||{};if(se(tt,"quoteStyle")&&!se(U,tt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(se(tt,"maxStringLength")&&(typeof tt.maxStringLength=="number"?tt.maxStringLength<0&&tt.maxStringLength!==1/0:tt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var ni=se(tt,"customInspect")?tt.customInspect:!0;if(typeof ni!="boolean"&&ni!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(se(tt,"indent")&&tt.indent!==null&&tt.indent!==" "&&!(parseInt(tt.indent,10)===tt.indent&&tt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(se(tt,"numericSeparator")&&typeof tt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var ns=tt.numericSeparator;if(typeof oe>"u")return"undefined";if(oe===null)return"null";if(typeof oe=="boolean")return oe?"true":"false";if(typeof oe=="string")return qe(oe,tt);if(typeof oe=="number"){if(oe===0)return 1/0/oe>0?"0":"-0";var ts=String(oe);return ns?A(oe,ts):ts}if(typeof oe=="bigint"){var Mt=String(oe)+"n";return ns?A(oe,Mt):Mt}var vi=typeof tt.depth>"u"?5:tt.depth;if(typeof At>"u"&&(At=0),At>=vi&&vi>0&&typeof oe=="object")return re(oe)?"[Array]":"[Object]";var Cs=ps(tt,At);if(typeof Et>"u")Et=[];else if(de(Et,oe)>=0)return"[Circular]";function rs(zn,xo,yu){if(xo&&(Et=R.call(Et),Et.push(xo)),yu){var Bl={depth:tt.depth};return se(tt,"quoteStyle")&&(Bl.quoteStyle=tt.quoteStyle),te(zn,Bl,At+1,Et)}return te(zn,tt,At+1,Et)}if(typeof oe=="function"&&!ge(oe)){var dn=ne(oe),ri=vt(oe,rs);return"[Function"+(dn?": "+dn:" (anonymous)")+"]"+(ri.length>0?" { "+C.call(ri,", ")+" }":"")}if(j(oe)){var Li=D?y.call(String(oe),/^(Symbol\(.*\))_[^)]*$/,"$1"):B.call(oe);return typeof oe=="object"&&!D?Le(Li):Li}if(Ze(oe)){for(var Bi="<"+_.call(String(oe.nodeName)),Ar=oe.attributes||[],Er=0;Er",Bi}if(re(oe)){if(oe.length===0)return"[]";var ga=vt(oe,rs);return Cs&&!Te(ga)?"["+_t(ga,Cs)+"]":"[ "+C.call(ga,", ")+" ]"}if(he(oe)){var va=vt(oe,rs);return!("cause"in Error.prototype)&&"cause"in oe&&!N.call(oe,"cause")?"{ ["+String(oe)+"] "+C.call(b.call("[cause]: "+rs(oe.cause),va),", ")+" }":va.length===0?"["+String(oe)+"]":"{ ["+String(oe)+"] "+C.call(va,", ")+" }"}if(typeof oe=="object"&&ni){if(L&&typeof oe[L]=="function"&&P)return P(oe,{depth:vi-At});if(ni!=="symbol"&&typeof oe.inspect=="function")return oe.inspect()}if(le(oe)){var Fl=[];return s&&s.call(oe,function(zn,xo){Fl.push(rs(xo,oe,!0)+" => "+rs(zn,oe))}),nt("Map",t.call(oe),Fl,Cs)}if(me(oe)){var Ol=[];return a&&a.call(oe,function(zn){Ol.push(rs(zn,oe))}),nt("Set",o.call(oe),Ol,Cs)}if(Ie(oe))return Me("WeakMap");if(Ne(oe))return Me("WeakSet");if(ye(oe))return Me("WeakRef");if(Y(oe))return Le(rs(Number(oe)));if(G(oe))return Le(rs(I.call(oe)));if(W(oe))return Le(p.call(oe));if(fe(oe))return Le(rs(String(oe)));if(typeof window<"u"&&oe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&oe===globalThis||typeof qc<"u"&&oe===qc)return"{ [object globalThis] }";if(!pe(oe)&&!ge(oe)){var ya=vt(oe,rs),xa=X?X(oe)===Object.prototype:oe instanceof Object||oe.constructor===Object,ba=oe instanceof Object?"":"null prototype",Ll=!xa&&$&&Object(oe)===oe&&$ in oe?x.call(ue(oe),8,-1):ba?"Object":"",vu=xa||typeof oe.constructor!="function"?"":oe.constructor.name?oe.constructor.name+" ":"",wa=vu+(Ll||ba?"["+C.call(b.call([],Ll||[],ba||[]),": ")+"] ":"");return ya.length===0?wa+"{}":Cs?wa+"{"+_t(ya,Cs)+"}":wa+"{ "+C.call(ya,", ")+" }"}return String(oe)};function H(te,oe,lt){var At=lt.quoteStyle||oe,Et=U[At];return Et+te+Et}function q(te){return y.call(String(te),/"/g,""")}function ie(te){return!$||!(typeof te=="object"&&($ in te||typeof te[$]<"u"))}function re(te){return ue(te)==="[object Array]"&&ie(te)}function pe(te){return ue(te)==="[object Date]"&&ie(te)}function ge(te){return ue(te)==="[object RegExp]"&&ie(te)}function he(te){return ue(te)==="[object Error]"&&ie(te)}function fe(te){return ue(te)==="[object String]"&&ie(te)}function Y(te){return ue(te)==="[object Number]"&&ie(te)}function W(te){return ue(te)==="[object Boolean]"&&ie(te)}function j(te){if(D)return te&&typeof te=="object"&&te instanceof Symbol;if(typeof te=="symbol")return!0;if(!te||typeof te!="object"||!B)return!1;try{return B.call(te),!0}catch{}return!1}function G(te){if(!te||typeof te!="object"||!I)return!1;try{return I.call(te),!0}catch{}return!1}var z=Object.prototype.hasOwnProperty||function(te){return te in this};function se(te,oe){return z.call(te,oe)}function ue(te){return m.call(te)}function ne(te){if(te.name)return te.name;var oe=v.call(g.call(te),/^function\s*([\w$]+)/);return oe?oe[1]:null}function de(te,oe){if(te.indexOf)return te.indexOf(oe);for(var lt=0,At=te.length;ltoe.maxStringLength){var lt=te.length-oe.maxStringLength,At="... "+lt+" more character"+(lt>1?"s":"");return qe(x.call(te,0,oe.maxStringLength),oe)+At}var Et=V[oe.quoteStyle||"single"];Et.lastIndex=0;var tt=y.call(y.call(te,Et,"\\$1"),/[\x00-\x1f]/g,Ke);return H(tt,"single",oe)}function Ke(te){var oe=te.charCodeAt(0),lt={8:"b",9:"t",10:"n",12:"f",13:"r"}[oe];return lt?"\\"+lt:"\\x"+(oe<16?"0":"")+M.call(oe.toString(16))}function Le(te){return"Object("+te+")"}function Me(te){return te+" { ? }"}function nt(te,oe,lt,At){var Et=At?_t(lt,At):C.call(lt,", ");return te+" ("+oe+") {"+Et+"}"}function Te(te){for(var oe=0;oe=0)return!1;return!0}function ps(te,oe){var lt;if(te.indent===" ")lt=" ";else if(typeof te.indent=="number"&&te.indent>0)lt=C.call(Array(te.indent+1)," ");else return null;return{base:lt,prev:C.call(Array(oe+1),lt)}}function _t(te,oe){if(te.length===0)return"";var lt=` +`+oe.prev+oe.base;return lt+C.call(te,","+lt)+` +`+oe.prev}function vt(te,oe){var lt=re(te),At=[];if(lt){At.length=te.length;for(var Et=0;Et"u"||!b?i:b(Uint8Array),D={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?i:ArrayBuffer,"%ArrayIteratorPrototype%":w&&b?b([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":typeof Atomics>"u"?i:Atomics,"%BigInt%":typeof BigInt>"u"?i:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?i:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":s,"%Float16Array%":typeof Float16Array>"u"?i:Float16Array,"%Float32Array%":typeof Float32Array>"u"?i:Float32Array,"%Float64Array%":typeof Float64Array>"u"?i:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?i:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":k,"%Int8Array%":typeof Int8Array>"u"?i:Int8Array,"%Int16Array%":typeof Int16Array>"u"?i:Int16Array,"%Int32Array%":typeof Int32Array>"u"?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&b?b(b([][Symbol.iterator]())):i,"%JSON%":typeof JSON=="object"?JSON:i,"%Map%":typeof Map>"u"?i:Map,"%MapIteratorPrototype%":typeof Map>"u"||!w||!b?i:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?i:Promise,"%Proxy%":typeof Proxy>"u"?i:Proxy,"%RangeError%":n,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?i:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?i:Set,"%SetIteratorPrototype%":typeof Set>"u"||!w||!b?i:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&b?b(""[Symbol.iterator]()):i,"%Symbol%":w?Symbol:i,"%SyntaxError%":o,"%ThrowTypeError%":_,"%TypedArray%":B,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?i:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?i:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?i:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?i:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?i:WeakMap,"%WeakRef%":typeof WeakRef>"u"?i:WeakRef,"%WeakSet%":typeof WeakSet>"u"?i:WeakSet,"%Function.prototype.call%":I,"%Function.prototype.apply%":F,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":C,"%Math.abs%":l,"%Math.floor%":h,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":p,"%Math.sign%":m,"%Reflect.getPrototypeOf%":R};if(b)try{null.error}catch(ge){var $=b(b(ge));D["%Error.prototype%"]=$}var N=function ge(he){var fe;if(he==="%AsyncFunction%")fe=v("async function () {}");else if(he==="%GeneratorFunction%")fe=v("function* () {}");else if(he==="%AsyncGeneratorFunction%")fe=v("async function* () {}");else if(he==="%AsyncGenerator%"){var Y=ge("%AsyncGeneratorFunction%");Y&&(fe=Y.prototype)}else if(he==="%AsyncIteratorPrototype%"){var W=ge("%AsyncGenerator%");W&&b&&(fe=b(W.prototype))}return D[he]=fe,fe},X={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=eu(),P=cC(),O=A.call(I,Array.prototype.concat),L=A.call(F,Array.prototype.splice),U=A.call(I,String.prototype.replace),V=A.call(I,String.prototype.slice),H=A.call(I,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ie=/\\(\\)?/g,re=function(he){var fe=V(he,0,1),Y=V(he,-1);if(fe==="%"&&Y!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&fe!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var W=[];return U(he,q,function(j,G,z,se){W[W.length]=z?U(se,ie,"$1"):G||j}),W},pe=function(he,fe){var Y=he,W;if(P(X,Y)&&(W=X[Y],Y="%"+W[0]+"%"),P(D,Y)){var j=D[Y];if(j===k&&(j=N(Y)),typeof j>"u"&&!fe)throw new a("intrinsic "+he+" exists, but is not available. Please file an issue!");return{alias:W,name:Y,value:j}}throw new o("intrinsic "+he+" does not exist!")};return gd=function(he,fe){if(typeof he!="string"||he.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof fe!="boolean")throw new a('"allowMissing" argument must be a boolean');if(H(/^%?[^%]*%?$/,he)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=re(he),W=Y.length>0?Y[0]:"",j=pe("%"+W+"%",fe),G=j.name,z=j.value,se=!1,ue=j.alias;ue&&(W=ue[0],L(Y,O([0,1],ue)));for(var ne=1,de=!0;ne=Y.length){var me=x(z,le);de=!!me,de&&"get"in me&&!("originalValue"in me.get)?z=me.get:z=z[le]}else de=P(z,le),z=z[le];de&&!se&&(D[G]=z)}}return z},gd}var vd,p0;function $x(){if(p0)return vd;p0=1;var i=tp(),e=Ux(),t=e([i("%String.prototype.indexOf%")]);return vd=function(n,r){var o=i(n,!!r);return typeof o=="function"&&t(n,".prototype.")>-1?e([o]):o},vd}var yd,g0;function Xx(){if(g0)return yd;g0=1;var i=tp(),e=$x(),t=Qh(),s=da(),n=i("%Map%",!0),r=e("Map.prototype.get",!0),o=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),c=e("Map.prototype.delete",!0),l=e("Map.prototype.size",!0);return yd=!!n&&function(){var u,d={assert:function(f){if(!d.has(f))throw new s("Side channel does not contain "+t(f))},delete:function(f){if(u){var p=c(u,f);return l(u)===0&&(u=void 0),p}return!1},get:function(f){if(u)return r(u,f)},has:function(f){return u?a(u,f):!1},set:function(f,p){u||(u=new n),o(u,f,p)}};return d},yd}var xd,v0;function hC(){if(v0)return xd;v0=1;var i=tp(),e=$x(),t=Qh(),s=Xx(),n=da(),r=i("%WeakMap%",!0),o=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),c=e("WeakMap.prototype.has",!0),l=e("WeakMap.prototype.delete",!0);return xd=r?function(){var u,d,f={assert:function(p){if(!f.has(p))throw new n("Side channel does not contain "+t(p))},delete:function(p){if(r&&p&&(typeof p=="object"||typeof p=="function")){if(u)return l(u,p)}else if(s&&d)return d.delete(p);return!1},get:function(p){return r&&p&&(typeof p=="object"||typeof p=="function")&&u?o(u,p):d&&d.get(p)},has:function(p){return r&&p&&(typeof p=="object"||typeof p=="function")&&u?c(u,p):!!d&&d.has(p)},set:function(p,m){r&&p&&(typeof p=="object"||typeof p=="function")?(u||(u=new r),a(u,p,m)):s&&(d||(d=s()),d.set(p,m))}};return f}:s,xd}var bd,y0;function Vx(){if(y0)return bd;y0=1;var i=da(),e=Qh(),t=$_(),s=Xx(),n=hC(),r=n||s||t;return bd=function(){var a,c={assert:function(l){if(!c.has(l)){var h=l&&Object(l)===l?"the given object key":e(l);throw new i("Side channel does not contain "+h)}},delete:function(l){return!!a&&a.delete(l)},get:function(l){return a&&a.get(l)},has:function(l){return!!a&&a.has(l)},set:function(l,h){a||(a=r()),a.set(l,h)}};return c},bd}var wd,x0;function sp(){if(x0)return wd;x0=1;var i=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return wd={default:t.RFC3986,formatters:{RFC1738:function(s){return i.call(s,e,"+")},RFC3986:function(s){return String(s)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},wd}var Sd,b0;function Yx(){if(b0)return Sd;b0=1;var i=sp(),e=Vx(),t=Lx(),s=Object.prototype.hasOwnProperty,n=Array.isArray,r=e(),o=function(R,F){return r.set(R,F),R},a=function(R){return r.has(R)},c=function(R){return r.get(R)},l=function(R,F){r.set(R,F)},h=(function(){for(var C=[],R=0;R<256;++R)C[C.length]="%"+((R<16?"0":"")+R.toString(16)).toUpperCase();return C})(),u=function(R){for(;R.length>1;){var F=R.pop(),I=F.obj[F.prop];if(n(I)){for(var k=[],B=0;B=I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(R.concat(F),I),k)}R[k]=F}else if(R&&typeof R=="object")if(a(R)){var B=c(R)+1;R[B]=F,l(R,B)}else{if(I&&I.strictMerge)return[R,F];(I&&(I.plainObjects||I.allowPrototypes)||!s.call(Object.prototype,F))&&(R[F]=!0)}else return[R,F];return R}if(!R||typeof R!="object"){if(a(F)){for(var D=Object.keys(F),$=I&&I.plainObjects?{__proto__:null,0:R}:{0:R},N=0;NI.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(A,I),A.length-1)}return A}var P=R;if(n(R)&&!n(F)&&(P=d(R,I)),n(R)&&n(F)){if(F.forEach(function(O,L){if(s.call(R,L)){var U=R[L];U&&typeof U=="object"&&O&&typeof O=="object"?R[L]=C(U,O,I):R[R.length]=O}else R[L]=O}),I&&typeof I.arrayLimit=="number"&&R.length>I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(R,I),R.length-1)}return R}return Object.keys(F).reduce(function(O,L){var U=F[L];if(s.call(O,L)?f(O,L,C(O[L],U,I)):f(O,L,U),a(F)&&!a(O)&&o(O,c(F)),a(O)){var V=parseInt(L,10);String(V)===L&&V>=0&&V>c(O)&&l(O,V)}return O},P)},m=function(R,F){return Object.keys(F).reduce(function(I,k){return f(I,k,F[k]),I},R)},g=function(C,R,F){var I=C.replace(/\+/g," ");if(F==="iso-8859-1")return I.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(I)}catch{return I}},v=1024,x=function(R,F,I,k,B){if(R.length===0)return R;var D=R;if(typeof R=="symbol"?D=Symbol.prototype.toString.call(R):typeof R!="string"&&(D=String(R)),I==="iso-8859-1")return escape(D).replace(/%u[0-9a-f]{4}/gi,function(U){return"%26%23"+parseInt(U.slice(2),16)+"%3B"});for(var $="",N=0;N=v?D.slice(N,N+v):D;if(N+v=55296&&A<=56319&&(X=X.slice(0,-1),N-=1)}for(var P=[],O=0;O=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||B===i.RFC1738&&(L===40||L===41)){P[P.length]=X.charAt(O);continue}if(L<128){P[P.length]=h[L];continue}if(L<2048){P[P.length]=h[192|L>>6]+h[128|L&63];continue}if(L<55296||L>=57344){P[P.length]=h[224|L>>12]+h[128|L>>6&63]+h[128|L&63];continue}O+=1,L=65536+((L&1023)<<10|X.charCodeAt(O)&1023),P[P.length]=h[240|L>>18]+h[128|L>>12&63]+h[128|L>>6&63]+h[128|L&63]}$+=P.join("")}return $},y=function(R){for(var F=[{obj:{o:R},prop:"o"}],I=e(),k=0;kI){if(B)throw new RangeError("Array limit exceeded. Only "+I+" element"+(I===1?"":"s")+" allowed in an array.");return o(d($,{plainObjects:k}),$.length-1)}return $},b=function(R,F){if(n(R)){for(var I=[],k=0;k"u"&&(O=0)}if(typeof R=="function"?A=R(v,A):A instanceof Date?A=k(A):x==="comma"&&r(A)&&(A=e.maybeMap(A,function(G){return G instanceof Date?k(G):G})),A===null){if(_)return D(C&&!$?C(v,h.encoder,N,"key",B):v);A=""}if(u(A)||e.isBuffer(A)){if(C){var V=$?v:C(v,h.encoder,N,"key",B);return[D(V)+"="+D(C(A,h.encoder,N,"value",B))]}return[D(v)+"="+D(String(A))]}var H=[];if(typeof A>"u")return H;var q;if(x==="comma"&&r(A))$&&C&&(A=e.maybeMap(A,function(G){return G==null?G:C(G)})),q=[{value:A.length>0?A.join(",")||null:void 0}];else if(r(R))q=R;else{var ie=Object.keys(A);q=F?ie.sort(F):ie}var re=b?String(v).replace(/\./g,"%2E"):String(v),pe=y&&r(A)&&A.length===1?re+"[]":re;if(M&&r(A)&&A.length===0)return pe+"[]";for(var ge=0;ge"u"?g.encodeDotInKeys===!0?!0:h.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:h.addQueryPrefix,allowDots:w,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:_,charset:v,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?h.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:h.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:h.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:h.encodeValuesOnly,filter:M,format:x,formatter:y,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:h.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:h.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:h.strictNullHandling}};return Md=function(m,g){var v=m,x=p(g),y,M;typeof x.filter=="function"?(M=x.filter,v=M("",v)):r(x.filter)&&(M=x.filter,y=M);var _=[];if(typeof v!="object"||v===null)return"";var w=n[x.arrayFormat],b=w==="comma"&&x.commaRoundTrip;y||(y=Object.keys(v)),x.sort&&y.sort(x.sort);for(var C=i(),R=0;R"u"||F===null)){var I=v[F];x.skipNulls&&I===null||a(_,f(I,F,w,b,x.allowEmptyArrays,x.strictNullHandling,x.skipNulls,x.encodeDotInKeys,x.encode?x.encoder:null,x.filter,x.sort,x.allowDots,x.serializeDate,x.format,x.formatter,x.encodeValuesOnly,x.charset,C))}}var k=_.join(x.delimiter),B=x.addQueryPrefix===!0?"?":"";return x.charsetSentinel&&(x.charset==="iso-8859-1"?B+="utf8=%26%2310003%3B"+x.delimiter:B+="utf8=%E2%9C%93"+x.delimiter),k.length>0?B+k:""},Md}var Td,S0;function dC(){if(S0)return Td;S0=1;var i=Yx(),e=Object.prototype.hasOwnProperty,t=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:i.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},n=function(f){return f.replace(/&#(\d+);/g,function(p,m){return String.fromCharCode(parseInt(m,10))})},r=function(f,p,m,g){if(f&&typeof f=="string"&&p.comma&&f.indexOf(",")>-1){if(g&&p.throwOnLimitExceeded)for(var v=0,x=f.indexOf(",");x>-1;){if(v+=1,v>=p.arrayLimit)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");x=f.indexOf(",",x+1)}return f.split(",")}if(p.throwOnLimitExceeded&&m>=p.arrayLimit)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");return f},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",c=function(p,m){var g={__proto__:null},v=m.ignoreQueryPrefix?p.replace(/^\?/,""):p;v=v.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var x=m.parameterLimit===1/0?void 0:m.parameterLimit,y=v.split(m.delimiter,m.throwOnLimitExceeded&&typeof x<"u"?x+1:x);if(m.throwOnLimitExceeded&&typeof x<"u"&&y.length>x)throw new RangeError("Parameter limit exceeded. Only "+x+" parameter"+(x===1?"":"s")+" allowed.");var M=-1,_,w=m.charset;if(m.charsetSentinel)for(_=0;_-1&&(I=t(I)?[I]:I),m.comma&&t(I)&&I.length>m.arrayLimit&&(I=i.combine([],I,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded)),F!==null){var k=e.call(g,F);k&&(m.duplicates==="combine"||b.indexOf("[]=")>-1)?g[F]=i.combine(g[F],I,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded):(!k||m.duplicates==="last")&&(g[F]=I)}}return g},l=function(f,p,m,g){var v=0;if(f.length>0&&f[f.length-1]==="[]"){var x=f.slice(0,-1).join("");v=Array.isArray(p)&&p[x]?p[x].length:0}for(var y=g?p:r(p,m,v),M=f.length-1;M>=0;--M){var _,w=f[M];if(w==="[]"&&m.parseArrays)i.isOverflow(y)?_=y:_=m.allowEmptyArrays&&(y===""||m.strictNullHandling&&y===null)?[]:i.combine([],y,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded);else{_=m.plainObjects?{__proto__:null}:{};var b=w.charAt(0)==="["&&w.charAt(w.length-1)==="]"?w.slice(1,-1):w,C=m.decodeDotInKeys?b.replace(/%2E/g,"."):b,R=parseInt(C,10),F=!isNaN(R)&&w!==C&&String(R)===C&&R>=0&&m.parseArrays;if(!m.parseArrays&&C==="")_={0:y};else if(F&&R=0?g.slice(0,x):g;if(y){if(!m.plainObjects&&e.call(Object.prototype,y)&&!m.allowPrototypes)return;v[v.length]=y}for(var M=g.length,_=x,w=0;_>=0&&w=0){if(m.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+m.depth+" and strictDepth is true");v[v.length]="["+g.slice(_)+"]"}return v},u=function(p,m,g,v){if(p){var x=h(p,g);if(x)return l(x,m,g,v)}},d=function(p){if(!p)return s;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof p.throwOnLimitExceeded<"u"&&typeof p.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var m=typeof p.charset>"u"?s.charset:p.charset,g=typeof p.duplicates>"u"?s.duplicates:p.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var v=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:s.allowDots:!!p.allowDots;return{allowDots:v,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:s.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:s.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:s.arrayLimit,charset:m,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:s.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:s.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:s.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:s.decoder,delimiter:typeof p.delimiter=="string"||i.isRegExp(p.delimiter)?p.delimiter:s.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:s.depth,duplicates:g,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:s.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:s.plainObjects,strictDepth:typeof p.strictDepth=="boolean"?!!p.strictDepth:s.strictDepth,strictMerge:typeof p.strictMerge=="boolean"?!!p.strictMerge:s.strictMerge,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:typeof p.throwOnLimitExceeded=="boolean"?p.throwOnLimitExceeded:!1}};return Td=function(f,p){var m=d(p);if(f===""||f===null||typeof f>"u")return m.plainObjects?{__proto__:null}:{};for(var g=typeof f=="string"?c(f,m):f,v=m.plainObjects?{__proto__:null}:{},x=Object.keys(g),y=0;y",'"',"`"," ","\r",` +`," "],o=["{","}","|","\\","^","`"].concat(r),a=["'"].concat(o),c=["%","/","?",";","#"].concat(a),l=["/","?","#"],h=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=fC();function v(_,w,b){if(_&&typeof _=="object"&&_ instanceof e)return _;var C=new e;return C.parse(_,w,b),C}e.prototype.parse=function(_,w,b){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var C=_.indexOf("?"),R=C!==-1&&C<_.indexOf("#")?"?":"#",F=_.split(R),I=/\\/g;F[0]=F[0].replace(I,"/"),_=F.join(R);var k=_;if(k=k.trim(),!b&&_.split("#").length===1){var B=n.exec(k);if(B)return this.path=k,this.href=k,this.pathname=B[1],B[2]?(this.search=B[2],w?this.query=g.parse(this.search.substr(1)):this.query=this.search.substr(1)):w&&(this.search="",this.query={}),this}var D=t.exec(k);if(D){D=D[0];var $=D.toLowerCase();this.protocol=$,k=k.substr(D.length)}if(b||D||k.match(/^\/\/[^@/]+@[^@/]+/)){var N=k.substr(0,2)==="//";N&&!(D&&p[D])&&(k=k.substr(2),this.slashes=!0)}if(!p[D]&&(N||D&&!m[D])){for(var X=-1,A=0;A127?ie+="x":ie+=q[re];if(!ie.match(u)){var ge=V.slice(0,A),he=V.slice(A+1),fe=q.match(d);fe&&(ge.push(fe[1]),he.unshift(fe[2])),he.length&&(k="/"+he.join(".")+k),this.hostname=ge.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=i.toASCII(this.hostname));var Y=this.port?":"+this.port:"",W=this.hostname||"";this.host=W+Y,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),k[0]!=="/"&&(k="/"+k))}if(!f[$])for(var A=0,H=a.length;A0?b.host.split("@"):!1;ie&&(b.auth=ie.shift(),b.hostname=ie.shift(),b.host=b.hostname)}return b.search=_.search,b.query=_.query,(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.href=b.format(),b}if(!V.length)return b.pathname=null,b.search?b.path="/"+b.search:b.path=null,b.href=b.format(),b;for(var re=V.slice(-1)[0],pe=(b.host||_.host||V.length>1)&&(re==="."||re==="..")||re==="",ge=0,he=V.length;he>=0;he--)re=V[he],re==="."?V.splice(he,1):re===".."?(V.splice(he,1),ge++):ge&&(V.splice(he,1),ge--);if(!L&&!U)for(;ge--;ge)V.unshift("..");L&&V[0]!==""&&(!V[0]||V[0].charAt(0)!=="/")&&V.unshift(""),pe&&V.join("/").substr(-1)!=="/"&&V.push("");var fe=V[0]===""||V[0]&&V[0].charAt(0)==="/";if(q){b.hostname=fe?"":V.length?V.shift():"",b.host=b.hostname;var ie=b.host&&b.host.indexOf("@")>0?b.host.split("@"):!1;ie&&(b.auth=ie.shift(),b.hostname=ie.shift(),b.host=b.hostname)}return L=L||b.host&&V.length,L&&!fe&&V.unshift(""),V.length>0?b.pathname=V.join("/"):(b.pathname=null,b.path=null),(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.auth=_.auth||b.auth,b.slashes=b.slashes||_.slashes,b.href=b.format(),b},e.prototype.parseHost=function(){var _=this.host,w=s.exec(_);w&&(w=w[0],w!==":"&&(this.port=w.substr(1)),_=_.substr(0,_.length-w.length)),_&&(this.hostname=_)},Or.parse=v,Or.resolve=y,Or.resolveObject=M,Or.format=x,Or.Url=e,Or}mC();const _0={};function ht(i,e,t=3){if(_0[e])return;let s=new Error().stack;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",`${e} +Deprecated since v${i}`):(s=s.split(` +`).splice(t).join(` +`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e} +Deprecated since v${i}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e} +Deprecated since v${i}`),console.warn(s))),_0[e]=!0}function yi(i){if(typeof i!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(i)}`)}function Aa(i){return i.split("?")[0].split("#")[0]}function pC(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gC(i,e,t){return i.replace(new RegExp(pC(e),"g"),t)}function vC(i,e){let t="",s=0,n=-1,r=0,o=-1;for(let a=0;a<=i.length;++a){if(a2){const c=t.lastIndexOf("/");if(c!==t.length-1){c===-1?(t="",s=0):(t=t.slice(0,c),s=t.length-1-t.lastIndexOf("/")),n=a,r=0;continue}}else if(t.length===2||t.length===1){t="",s=0,n=a,r=0;continue}}}else t.length>0?t+=`/${i.slice(n+1,a)}`:t=i.slice(n+1,a),s=a-n-1;n=a,r=0}else o===46&&r!==-1?++r:r=-1}return t}const Jt={toPosix(i){return gC(i,"\\","/")},isUrl(i){return/^https?:/.test(this.toPosix(i))},isDataUrl(i){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(i)},isBlobUrl(i){return i.startsWith("blob:")},hasProtocol(i){return/^[^/:]+:/.test(this.toPosix(i))},getProtocol(i){yi(i),i=this.toPosix(i);const e=/^file:\/\/\//.exec(i);if(e)return e[0];const t=/^[^/:]+:\/{0,2}/.exec(i);return t?t[0]:""},toAbsolute(i,e,t){if(yi(i),this.isDataUrl(i)||this.isBlobUrl(i))return i;const s=Aa(this.toPosix(e??Oe.ADAPTER.getBaseUrl())),n=Aa(this.toPosix(t??this.rootname(s)));return i=this.toPosix(i),i.startsWith("/")?Jt.join(n,i.slice(1)):this.isAbsolute(i)?i:this.join(s,i)},normalize(i){if(yi(i),i.length===0)return".";if(this.isDataUrl(i)||this.isBlobUrl(i))return i;i=this.toPosix(i);let e="";const t=i.startsWith("/");this.hasProtocol(i)&&(e=this.rootname(i),i=i.slice(e.length));const s=i.endsWith("/");return i=vC(i),i.length>0&&s&&(i+="/"),t?`/${i}`:e+i},isAbsolute(i){return yi(i),i=this.toPosix(i),this.hasProtocol(i)?!0:i.startsWith("/")},join(...i){if(i.length===0)return".";let e;for(let t=0;t0)if(e===void 0)e=s;else{const n=i[t-1]??"";this.joinExtensions.includes(this.extname(n).toLowerCase())?e+=`/../${s}`:e+=`/${s}`}}return e===void 0?".":this.normalize(e)},dirname(i){if(yi(i),i.length===0)return".";i=this.toPosix(i);let e=i.charCodeAt(0);const t=e===47;let s=-1,n=!0;const r=this.getProtocol(i),o=i;i=i.slice(r.length);for(let a=i.length-1;a>=1;--a)if(e=i.charCodeAt(a),e===47){if(!n){s=a;break}}else n=!1;return s===-1?t?"/":this.isUrl(o)?r+i:r:t&&s===1?"//":r+i.slice(0,s)},rootname(i){yi(i),i=this.toPosix(i);let e="";if(i.startsWith("/")?e="/":e=this.getProtocol(i),this.isUrl(i)){const t=i.indexOf("/",e.length);t!==-1?e=i.slice(0,t):e=i,e.endsWith("/")||(e+="/")}return e},basename(i,e){yi(i),e&&yi(e),i=Aa(this.toPosix(i));let t=0,s=-1,n=!0,r;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e.length===i.length&&e===i)return"";let o=e.length-1,a=-1;for(r=i.length-1;r>=0;--r){const c=i.charCodeAt(r);if(c===47){if(!n){t=r+1;break}}else a===-1&&(n=!1,a=r+1),o>=0&&(c===e.charCodeAt(o)?--o===-1&&(s=r):(o=-1,s=a))}return t===s?s=a:s===-1&&(s=i.length),i.slice(t,s)}for(r=i.length-1;r>=0;--r)if(i.charCodeAt(r)===47){if(!n){t=r+1;break}}else s===-1&&(n=!1,s=r+1);return s===-1?"":i.slice(t,s)},extname(i){yi(i),i=Aa(this.toPosix(i));let e=-1,t=0,s=-1,n=!0,r=0;for(let o=i.length-1;o>=0;--o){const a=i.charCodeAt(o);if(a===47){if(!n){t=o+1;break}continue}s===-1&&(n=!1,s=o+1),a===46?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||s===-1||r===0||r===1&&e===s-1&&e===t+1?"":i.slice(e,s)},parse(i){yi(i);const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;i=Aa(this.toPosix(i));let t=i.charCodeAt(0);const s=this.isAbsolute(i);let n;e.root=this.rootname(i),s||this.hasProtocol(i)?n=1:n=0;let r=-1,o=0,a=-1,c=!0,l=i.length-1,h=0;for(;l>=n;--l){if(t=i.charCodeAt(l),t===47){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),t===46?r===-1?r=l:h!==1&&(h=1):r!==-1&&(h=-1)}return r===-1||a===-1||h===0||h===1&&r===a-1&&r===o+1?a!==-1&&(o===0&&s?e.base=e.name=i.slice(1,a):e.base=e.name=i.slice(o,a)):(o===0&&s?(e.name=i.slice(1,r),e.base=i.slice(1,a)):(e.name=i.slice(o,r),e.base=i.slice(o,a)),e.ext=i.slice(r,a)),e.dir=this.dirname(i),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Cd;async function yC(){return Cd??(Cd=(async()=>{var r;const i=document.createElement("canvas").getContext("webgl");if(!i)return xs.UNPACK;const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return xs.UNPACK;const t=i.createTexture();i.bindTexture(i.TEXTURE_2D,t);const s=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,s),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return i.readPixels(0,0,1,1,i.RGBA,i.UNSIGNED_BYTE,n),i.deleteFramebuffer(s),i.deleteTexture(t),(r=i.getExtension("WEBGL_lose_context"))==null||r.loseContext(),n[0]<=n[3]?xs.PMA:xs.UNPACK})()),Cd}let Ad;function xC(){return typeof Ad>"u"&&(Ad=(function(){var e;const i={stencil:!0,failIfMajorPerformanceCaveat:Oe.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Oe.ADAPTER.getWebGLRenderingContext())return!1;const t=Oe.ADAPTER.createCanvas();let s=t.getContext("webgl",i)||t.getContext("experimental-webgl",i);const n=!!((e=s==null?void 0:s.getContextAttributes())!=null&&e.stencil);if(s){const r=s.getExtension("WEBGL_lose_context");r&&r.loseContext()}return s=null,n}catch{return!1}})()),Ad}var bC={grad:.9,turn:360,rad:360/(2*Math.PI)},vn=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},ys=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*i)/t+0},mi=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),i>t?t:i>e?i:e},Gx=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},C0=function(i){return{r:mi(i.r,0,255),g:mi(i.g,0,255),b:mi(i.b,0,255),a:mi(i.a)}},Ed=function(i){return{r:ys(i.r),g:ys(i.g),b:ys(i.b),a:ys(i.a,3)}},wC=/^#([0-9a-f]{3,8})$/i,Yl=function(i){var e=i.toString(16);return e.length<2?"0"+e:e},jx=function(i){var e=i.r,t=i.g,s=i.b,n=i.a,r=Math.max(e,t,s),o=r-Math.min(e,t,s),a=o?r===e?(t-s)/o:r===t?2+(s-e)/o:4+(e-t)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:n}},Hx=function(i){var e=i.h,t=i.s,s=i.v,n=i.a;e=e/360*6,t/=100,s/=100;var r=Math.floor(e),o=s*(1-t),a=s*(1-(e-r)*t),c=s*(1-(1-e+r)*t),l=r%6;return{r:255*[s,a,o,o,c,s][l],g:255*[c,s,s,a,o,o][l],b:255*[o,o,c,s,s,a][l],a:n}},A0=function(i){return{h:Gx(i.h),s:mi(i.s,0,100),l:mi(i.l,0,100),a:mi(i.a)}},E0=function(i){return{h:ys(i.h),s:ys(i.s),l:ys(i.l),a:ys(i.a,3)}},I0=function(i){return Hx((t=(e=i).s,{h:e.h,s:(t*=((s=e.l)<50?s:100-s)/100)>0?2*t/(s+t)*100:0,v:s+t,a:e.a}));var e,t,s},za=function(i){return{h:(e=jx(i)).h,s:(n=(200-(t=e.s))*(s=e.v)/100)>0&&n<200?t*s/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,t,s,n},SC=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,MC=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,TC=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_C=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Cf={string:[[function(i){var e=wC.exec(i);return e?(i=e[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?ys(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?ys(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var e=TC.exec(i)||_C.exec(i);return e?e[2]!==e[4]||e[4]!==e[6]?null:C0({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(i){var e=SC.exec(i)||MC.exec(i);if(!e)return null;var t,s,n=A0({h:(t=e[1],s=e[2],s===void 0&&(s="deg"),Number(t)*(bC[s]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return I0(n)},"hsl"]],object:[[function(i){var e=i.r,t=i.g,s=i.b,n=i.a,r=n===void 0?1:n;return vn(e)&&vn(t)&&vn(s)?C0({r:Number(e),g:Number(t),b:Number(s),a:Number(r)}):null},"rgb"],[function(i){var e=i.h,t=i.s,s=i.l,n=i.a,r=n===void 0?1:n;if(!vn(e)||!vn(t)||!vn(s))return null;var o=A0({h:Number(e),s:Number(t),l:Number(s),a:Number(r)});return I0(o)},"hsl"],[function(i){var e=i.h,t=i.s,s=i.v,n=i.a,r=n===void 0?1:n;if(!vn(e)||!vn(t)||!vn(s))return null;var o=(function(a){return{h:Gx(a.h),s:mi(a.s,0,100),v:mi(a.v,0,100),a:mi(a.a)}})({h:Number(e),s:Number(t),v:Number(s),a:Number(r)});return Hx(o)},"hsv"]]},R0=function(i,e){for(var t=0;t=.5},i.prototype.toHex=function(){return e=Ed(this.rgba),t=e.r,s=e.g,n=e.b,o=(r=e.a)<1?Yl(ys(255*r)):"","#"+Yl(t)+Yl(s)+Yl(n)+o;var e,t,s,n,r,o},i.prototype.toRgb=function(){return Ed(this.rgba)},i.prototype.toRgbString=function(){return e=Ed(this.rgba),t=e.r,s=e.g,n=e.b,(r=e.a)<1?"rgba("+t+", "+s+", "+n+", "+r+")":"rgb("+t+", "+s+", "+n+")";var e,t,s,n,r},i.prototype.toHsl=function(){return E0(za(this.rgba))},i.prototype.toHslString=function(){return e=E0(za(this.rgba)),t=e.h,s=e.s,n=e.l,(r=e.a)<1?"hsla("+t+", "+s+"%, "+n+"%, "+r+")":"hsl("+t+", "+s+"%, "+n+"%)";var e,t,s,n,r},i.prototype.toHsv=function(){return e=jx(this.rgba),{h:ys(e.h),s:ys(e.s),v:ys(e.v),a:ys(e.a,3)};var e},i.prototype.invert=function(){return Di({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},i.prototype.saturate=function(e){return e===void 0&&(e=.1),Di(Id(this.rgba,e))},i.prototype.desaturate=function(e){return e===void 0&&(e=.1),Di(Id(this.rgba,-e))},i.prototype.grayscale=function(){return Di(Id(this.rgba,-1))},i.prototype.lighten=function(e){return e===void 0&&(e=.1),Di(P0(this.rgba,e))},i.prototype.darken=function(e){return e===void 0&&(e=.1),Di(P0(this.rgba,-e))},i.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},i.prototype.alpha=function(e){return typeof e=="number"?Di({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):ys(this.rgba.a,3);var t},i.prototype.hue=function(e){var t=za(this.rgba);return typeof e=="number"?Di({h:e,s:t.s,l:t.l,a:t.a}):ys(t.h)},i.prototype.isEqual=function(e){return this.toHex()===Di(e).toHex()},i})(),Di=function(i){return i instanceof Af?i:new Af(i)},k0=[],AC=function(i){i.forEach(function(e){k0.indexOf(e)<0&&(e(Af,Cf),k0.push(e))})};function EC(i,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var n in t)s[t[n]]=n;var r={};i.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,c,l=s[this.toHex()];if(l)return l;if(o!=null&&o.closest){var h=this.toRgb(),u=1/0,d="black";if(!r.length)for(var f in t)r[f]=new i(t[f]).toRgb();for(var p in t){var m=(a=h,c=r[p],Math.pow(a.r-c.r,2)+Math.pow(a.g-c.g,2)+Math.pow(a.b-c.b,2));mn===t[r]);if(e!==null&&t!==null){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}return e===t}toRgba(){const[e,t,s,n]=this._components;return{r:e,g:t,b:s,a:n}}toRgb(){const[e,t,s]=this._components;return{r:e,g:t,b:s}}toRgbaString(){const[e,t,s]=this.toUint8RgbArray();return`rgba(${e},${t},${s},${this.alpha})`}toUint8RgbArray(e){const[t,s,n]=this._components;return e=e??[],e[0]=Math.round(t*255),e[1]=Math.round(s*255),e[2]=Math.round(n*255),e}toRgbArray(e){e=e??[];const[t,s,n]=this._components;return e[0]=t,e[1]=s,e[2]=n,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,s,n,r]=Mc.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=s,this._components[2]*=n,this._components[3]*=r,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let s=this._int>>16&255,n=this._int>>8&255,r=this._int&255;return t&&(s=s*e+.5|0,n=n*e+.5|0,r=r*e+.5|0),(e*255<<24)+(s<<16)+(n<<8)+r}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,s,n]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(s*e)/e,this._components[2]=Math.round(n*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[t,s,n,r]=this._components;return e[0]=t,e[1]=s,e[2]=n,e[3]=r,e}normalize(e){let t,s,n,r;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const o=e;t=(o>>16&255)/255,s=(o>>8&255)/255,n=(o&255)/255,r=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,s,n,r=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,s,n,r=255]=e,t/=255,s/=255,n/=255,r/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const a=Mc.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`)}const o=Di(e);o.isValid()&&({r:t,g:s,b:n,a:r}=o.rgba,t/=255,s/=255,n/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=s,this._components[2]=n,this._components[3]=r,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,s]=this._components;this._int=(e*255<<16)+(t*255<<8)+(s*255|0)}_clamp(e,t=0,s=1){return typeof e=="number"?Math.min(Math.max(e,t),s):(e.forEach((n,r)=>{e[r]=Math.min(Math.max(n,t),s)}),e)}};Po.shared=new Po,Po.temp=new Po,Po.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Ct=Po;function IC(i){return ht("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Ct.shared.setValue(i).toHex()}function RC(i){return ht("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Ct.shared.setValue(i).toNumber()}function PC(){const i=[],e=[];for(let s=0;s<32;s++)i[s]=s,e[s]=s;i[He.NORMAL_NPM]=He.NORMAL,i[He.ADD_NPM]=He.ADD,i[He.SCREEN_NPM]=He.SCREEN,e[He.NORMAL]=He.NORMAL_NPM,e[He.ADD]=He.ADD_NPM,e[He.SCREEN]=He.SCREEN_NPM;const t=[];return t.push(e),t.push(i),t}const Wx=PC();function zx(i,e){return Wx[e?1:0][i]}function kC(i,e=null){const t=i*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let s=0,n=0;s>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1}function F0(i){return!(i&i-1)&&!!i}function O0(i){let e=(i>65535?1:0)<<4;i>>>=e;let t=(i>255?1:0)<<3;return i>>>=t,e|=t,t=(i>15?1:0)<<2,i>>>=t,e|=t,t=(i>3?1:0)<<1,i>>>=t,e|=t,e|i>>1}function Wo(i,e,t){const s=i.length;let n;if(e>=s||t===0)return;t=e+t>s?s-e:t;const r=s-t;for(n=e;n(i.Renderer="renderer",i.Application="application",i.RendererSystem="renderer-webgl-system",i.RendererPlugin="renderer-webgl-plugin",i.CanvasRendererSystem="renderer-canvas-system",i.CanvasRendererPlugin="renderer-canvas-plugin",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i))(Pe||{});const If=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i}}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i},U0=(i,e)=>If(i).priority??e,Ue={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(If).forEach(e=>{e.type.forEach(t=>{var s,n;return(n=(s=this._removeHandlers)[t])==null?void 0:n.call(s,e)})}),this},add(...i){return i.map(If).forEach(e=>{e.type.forEach(t=>{var r,o;const s=this._addHandlers,n=this._queue;s[t]?(r=s[t])==null||r.call(s,e):(n[t]=n[t]||[],(o=n[t])==null||o.push(e))})}),this},handle(i,e,t){var o;const s=this._addHandlers,n=this._removeHandlers;if(s[i]||n[i])throw new Error(`Extension type ${i} already has a handler`);s[i]=e,n[i]=t;const r=this._queue;return r[i]&&((o=r[i])==null||o.forEach(a=>e(a)),delete r[i]),this},handleByMap(i,e){return this.handle(i,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByList(i,e,t=-1){return this.handle(i,s=>{e.includes(s.ref)||(e.push(s.ref),e.sort((n,r)=>U0(r,t)-U0(n,t)))},s=>{const n=e.indexOf(s.ref);n!==-1&&e.splice(n,1)})}};class Rf{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const DC=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` +`);function UC(i){let e="";for(let t=0;t0&&(e+=` +else `),t=0;--s){const n=Pf[s];if(n.test&&n.test(i,t))return new n(i,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Ri{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,t,s,n,r,o,a,c){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:h}=this;this._aliasCount++;for(let u=0,d=h.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Ri.prototype,{dispatch:{value:Ri.prototype.emit},run:{value:Ri.prototype.emit}});class fl{constructor(e=0,t=0){this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Ri("setRealSize"),this.onUpdate=new Ri("update"),this.onError=new Ri("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,t,s){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,t){return!1}}class tu extends fl{constructor(e,t){const{width:s,height:n}=t||{};if(!s||!n)throw new Error("BufferResource width or height invalid");super(s,n),this.data=e,this.unpackAlignment=t.unpackAlignment??4}upload(e,t,s){const n=e.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,this.unpackAlignment),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===xs.UNPACK);const r=t.realWidth,o=t.realHeight;return s.width===r&&s.height===o?n.texSubImage2D(t.target,0,0,0,r,o,t.format,s.type,this.data):(s.width=r,s.height=o,n.texImage2D(t.target,0,s.internalFormat,r,o,0,t.format,s.type,this.data)),!0}dispose(){this.data=null}static test(e){return e===null||e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}const XC={scaleMode:Ci.NEAREST,alphaMode:xs.NPM},kf=class ko extends _l{constructor(e=null,t=null){super(),t=Object.assign({},ko.defaultOptions,t);const{alphaMode:s,mipmap:n,anisotropicLevel:r,scaleMode:o,width:a,height:c,wrapMode:l,format:h,type:u,target:d,resolution:f,resourceOptions:p}=t;e&&!(e instanceof fl)&&(e=Kx(e,p),e.internal=!0),this.resolution=f||Oe.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((c||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=r,this._wrapMode=l,this._scaleMode=o,this.format=h,this.type=u,this.target=d,this.alphaMode=s,this.uid=ao(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&c>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let s;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,s=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,s=!0),s&&this.dirtyStyleId++,this}setSize(e,t,s){return s=s||this.resolution,this.setRealSize(e*s,t*s,s)}setRealSize(e,t,s){return this.resolution=s||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=F0(this.realWidth)&&F0(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Kn[this.cacheId],delete Ui[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),ko.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,s=Oe.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${ao()}`}r=e._pixiId}let o=Kn[r];if(n&&s&&!o)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return o||(o=new ko(e,t),o.cacheId=r,ko.addToCache(o,r)),o}static fromBuffer(e,t,s,n){e=e||new Float32Array(t*s*4);const r=new tu(e,{width:t,height:s,...n==null?void 0:n.resourceOptions});let o,a;return e instanceof Float32Array?(o=_e.RGBA,a=De.FLOAT):e instanceof Int32Array?(o=_e.RGBA_INTEGER,a=De.INT):e instanceof Uint32Array?(o=_e.RGBA_INTEGER,a=De.UNSIGNED_INT):e instanceof Int16Array?(o=_e.RGBA_INTEGER,a=De.SHORT):e instanceof Uint16Array?(o=_e.RGBA_INTEGER,a=De.UNSIGNED_SHORT):e instanceof Int8Array?(o=_e.RGBA,a=De.BYTE):(o=_e.RGBA,a=De.UNSIGNED_BYTE),r.internal=!0,new ko(r,Object.assign({},XC,{type:a,format:o},n))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Kn[t]&&Kn[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),Kn[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Kn[e];if(t){const s=t.textureCacheIds.indexOf(e);return s>-1&&t.textureCacheIds.splice(s,1),delete Kn[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t1){for(let u=0;u(i[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC",i))(_s||{});class gt{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new gt(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}}gt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const Gl=[new gt,new gt,new gt,new gt];class ot{constructor(e=0,t=0,s=0,n=0){this.x=Number(e),this.y=Number(t),this.width=Number(s),this.height=Number(n),this.type=_s.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new ot(0,0,0,0)}clone(){return new ot(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e=this.y&&te.right?e.right:this.right)<=C)return!1;const R=this.ye.bottom?e.bottom:this.bottom)>R}const s=this.left,n=this.right,r=this.top,o=this.bottom;if(n<=s||o<=r)return!1;const a=Gl[0].set(e.left,e.top),c=Gl[1].set(e.left,e.bottom),l=Gl[2].set(e.right,e.top),h=Gl[3].set(e.right,e.bottom);if(l.x<=a.x||c.y<=a.y)return!1;const u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(a,a),t.apply(c,c),t.apply(l,l),t.apply(h,h),Math.max(a.x,c.x,l.x,h.x)<=s||Math.min(a.x,c.x,l.x,h.x)>=n||Math.max(a.y,c.y,l.y,h.y)<=r||Math.min(a.y,c.y,l.y,h.y)>=o))return!1;const d=u*(c.y-a.y),f=u*(a.x-c.x),p=d*s+f*r,m=d*n+f*r,g=d*s+f*o,v=d*n+f*o;if(Math.max(p,m,g,v)<=d*a.x+f*a.y||Math.min(p,m,g,v)>=d*h.x+f*h.y)return!1;const x=u*(a.y-l.y),y=u*(l.x-a.x),M=x*s+y*r,_=x*n+y*r,w=x*s+y*o,b=x*n+y*o;return!(Math.max(M,_,w,b)<=x*a.x+y*a.y||Math.min(M,_,w,b)>=x*h.x+y*h.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),s=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),r=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(s-t,0),this.y=n,this.height=Math.max(r-n,0),this}ceil(e=1,t=.001){const s=Math.ceil((this.x+this.width-t)*e)/e,n=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=s-this.x,this.height=n-this.y,this}enlarge(e){const t=Math.min(this.x,e.x),s=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),r=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=s-t,this.y=n,this.height=r-n,this}}ot.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class su{constructor(e=0,t=0,s=0){this.x=e,this.y=t,this.radius=s,this.type=_s.CIRC}clone(){return new su(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;const s=this.radius*this.radius;let n=this.x-e,r=this.y-t;return n*=n,r*=r,n+r<=s}getBounds(){return new ot(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}su.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class iu{constructor(e=0,t=0,s=0,n=0){this.x=e,this.y=t,this.width=s,this.height=n,this.type=_s.ELIP}clone(){return new iu(this.x,this.y,this.width,this.height)}contains(e,t){if(this.width<=0||this.height<=0)return!1;let s=(e-this.x)/this.width,n=(t-this.y)/this.height;return s*=s,n*=n,s+n<=1}getBounds(){return new ot(this.x-this.width,this.y-this.height,this.width,this.height)}}iu.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class so{constructor(...e){let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){const s=[];for(let n=0,r=t.length;nt!=h>t&&e<(l-a)*((t-c)/(h-c))+a&&(s=!s)}return s}}so.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((i,e)=>`${i}, ${e}`,"")}]`};class nu{constructor(e=0,t=0,s=0,n=0,r=20){this.x=e,this.y=t,this.width=s,this.height=n,this.radius=r,this.type=_s.RREC}clone(){return new nu(this.x,this.y,this.width,this.height,this.radius)}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+s&&t<=this.y+this.height-s||e>=this.x+s&&e<=this.x+this.width-s)return!0;let n=e-(this.x+s),r=t-(this.y+s);const o=s*s;if(n*n+r*r<=o||(n=e-(this.x+this.width-s),n*n+r*r<=o)||(r=t-(this.y+this.height-s),n*n+r*r<=o)||(n=e-(this.x+s),n*n+r*r<=o))return!0}return!1}}nu.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class Ot{constructor(e=1,t=0,s=0,n=1,r=0,o=0){this.array=null,this.a=e,this.b=t,this.c=s,this.d=n,this.tx=r,this.ty=o}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,s,n,r,o){return this.a=e,this.b=t,this.c=s,this.d=n,this.tx=r,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const s=t||this.array;return e?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(e,t){t=t||new gt;const s=e.x,n=e.y;return t.x=this.a*s+this.c*n+this.tx,t.y=this.b*s+this.d*n+this.ty,t}applyInverse(e,t){t=t||new gt;const s=1/(this.a*this.d+this.c*-this.b),n=e.x,r=e.y;return t.x=this.d*s*n+-this.c*s*r+(this.ty*this.c-this.tx*this.d)*s,t.y=this.a*s*r+-this.b*s*n+(-this.ty*this.a+this.tx*this.b)*s,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),s=Math.sin(e),n=this.a,r=this.c,o=this.tx;return this.a=n*t-this.b*s,this.b=n*s+this.b*t,this.c=r*t-this.d*s,this.d=r*s+this.d*t,this.tx=o*t-this.ty*s,this.ty=o*s+this.ty*t,this}append(e){const t=this.a,s=this.b,n=this.c,r=this.d;return this.a=e.a*t+e.b*n,this.b=e.a*s+e.b*r,this.c=e.c*t+e.d*n,this.d=e.c*s+e.d*r,this.tx=e.tx*t+e.ty*n+this.tx,this.ty=e.tx*s+e.ty*r+this.ty,this}setTransform(e,t,s,n,r,o,a,c,l){return this.a=Math.cos(a+l)*r,this.b=Math.sin(a+l)*r,this.c=-Math.sin(a-c)*o,this.d=Math.cos(a-c)*o,this.tx=e-(s*this.a+n*this.c),this.ty=t-(s*this.b+n*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const s=this.a,n=this.c;this.a=s*e.a+this.b*e.c,this.b=s*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,s=this.b,n=this.c,r=this.d,o=e.pivot,a=-Math.atan2(-n,r),c=Math.atan2(s,t),l=Math.abs(a+c);return l<1e-5||Math.abs(Jc-l)<1e-5?(e.rotation=c,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=c),e.scale.x=Math.sqrt(t*t+s*s),e.scale.y=Math.sqrt(n*n+r*r),e.position.x=this.tx+(o.x*t+o.y*n),e.position.y=this.ty+(o.x*s+o.y*r),e}invert(){const e=this.a,t=this.b,s=this.c,n=this.d,r=this.tx,o=e*n-t*s;return this.a=n/o,this.b=-t/o,this.c=-s/o,this.d=e/o,this.tx=(s*this.ty-n*r)/o,this.ty=-(e*this.ty-t*r)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Ot;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}static get IDENTITY(){return new Ot}static get TEMP_MATRIX(){return new Ot}}Ot.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const $r=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Xr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Vr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Yr=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Of=[],Jx=[],jl=Math.sign;function qC(){for(let i=0;i<16;i++){const e=[];Of.push(e);for(let t=0;t<16;t++){const s=jl($r[i]*$r[t]+Vr[i]*Xr[t]),n=jl(Xr[i]*$r[t]+Yr[i]*Xr[t]),r=jl($r[i]*Vr[t]+Vr[i]*Yr[t]),o=jl(Xr[i]*Vr[t]+Yr[i]*Yr[t]);for(let a=0;a<16;a++)if($r[a]===s&&Xr[a]===n&&Vr[a]===r&&Yr[a]===o){e.push(a);break}}}for(let i=0;i<16;i++){const e=new Ot;e.set($r[i],Xr[i],Vr[i],Yr[i],0,0),Jx.push(e)}}qC();const jt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:i=>$r[i],uY:i=>Xr[i],vX:i=>Vr[i],vY:i=>Yr[i],inv:i=>i&8?i&15:-i&7,add:(i,e)=>Of[i][e],sub:(i,e)=>Of[i][jt.inv(e)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,e)=>Math.abs(i)*2<=Math.abs(e)?e>=0?jt.S:jt.N:Math.abs(e)*2<=Math.abs(i)?i>0?jt.E:jt.W:e>0?i>0?jt.SE:jt.SW:i>0?jt.NE:jt.NW,matrixAppendRotationInv:(i,e,t=0,s=0)=>{const n=Jx[jt.inv(e)];n.tx=t,n.ty=s,i.append(n)}};class In{constructor(e,t,s=0,n=0){this._x=s,this._y=n,this.cb=e,this.scope=t}clone(e=this.cb,t=this.scope){return new In(e,t,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}In.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Lf=class{constructor(){this.worldTransform=new Ot,this.localTransform=new Ot,this.position=new In(this.onChange,this,0,0),this.scale=new In(this.onChange,this,1,1),this.pivot=new In(this.onChange,this,0,0),this.skew=new In(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const i=this.localTransform;this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(i){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==i._worldID){const t=i.worldTransform,s=this.worldTransform;s.a=e.a*t.a+e.b*t.c,s.b=e.a*t.b+e.b*t.d,s.c=e.c*t.a+e.d*t.c,s.d=e.c*t.b+e.d*t.d,s.tx=e.tx*t.a+e.ty*t.c+t.tx,s.ty=e.tx*t.b+e.ty*t.d+t.ty,this._parentID=i._worldID,this._worldID++}}setFromMatrix(i){i.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(i){this._rotation!==i&&(this._rotation=i,this.updateSkew())}};Lf.IDENTITY=new Lf;let ip=Lf;ip.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var KC=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; + +void main(void){ + gl_FragColor *= texture2D(uSampler, vTextureCoord); +}`,ZC=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void){ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +} +`;function X0(i,e,t){const s=i.createShader(e);return i.shaderSource(s,t),i.compileShader(s),s}function Nd(i){const e=new Array(i);for(let t=0;ti.type==="float"&&i.size===1&&!i.isArray,code:i=>` + if(uv["${i}"] !== ud["${i}"].value) + { + ud["${i}"].value = uv["${i}"] + gl.uniform1f(ud["${i}"].location, uv["${i}"]) + } + `},{test:(i,e)=>(i.type==="sampler2D"||i.type==="samplerCube"||i.type==="sampler2DArray")&&i.size===1&&!i.isArray&&(e==null||e.castToBaseTexture!==void 0),code:i=>`t = syncData.textureCount++; + + renderer.texture.bind(uv["${i}"], t); + + if(ud["${i}"].value !== t) + { + ud["${i}"].value = t; + gl.uniform1i(ud["${i}"].location, t); +; // eslint-disable-line max-len + }`},{test:(i,e)=>i.type==="mat3"&&i.size===1&&!i.isArray&&e.a!==void 0,code:i=>` + gl.uniformMatrix3fv(ud["${i}"].location, false, uv["${i}"].toArray(true)); + `,codeUbo:i=>` + var ${i}_matrix = uv.${i}.toArray(true); + + data[offset] = ${i}_matrix[0]; + data[offset+1] = ${i}_matrix[1]; + data[offset+2] = ${i}_matrix[2]; + + data[offset + 4] = ${i}_matrix[3]; + data[offset + 5] = ${i}_matrix[4]; + data[offset + 6] = ${i}_matrix[5]; + + data[offset + 8] = ${i}_matrix[6]; + data[offset + 9] = ${i}_matrix[7]; + data[offset + 10] = ${i}_matrix[8]; + `},{test:(i,e)=>i.type==="vec2"&&i.size===1&&!i.isArray&&e.x!==void 0,code:i=>` + cv = ud["${i}"].value; + v = uv["${i}"]; + + if(cv[0] !== v.x || cv[1] !== v.y) + { + cv[0] = v.x; + cv[1] = v.y; + gl.uniform2f(ud["${i}"].location, v.x, v.y); + }`,codeUbo:i=>` + v = uv.${i}; + + data[offset] = v.x; + data[offset+1] = v.y; + `},{test:i=>i.type==="vec2"&&i.size===1&&!i.isArray,code:i=>` + cv = ud["${i}"].value; + v = uv["${i}"]; + + if(cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + gl.uniform2f(ud["${i}"].location, v[0], v[1]); + } + `},{test:(i,e)=>i.type==="vec4"&&i.size===1&&!i.isArray&&e.width!==void 0,code:i=>` + cv = ud["${i}"].value; + v = uv["${i}"]; + + if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) + { + cv[0] = v.x; + cv[1] = v.y; + cv[2] = v.width; + cv[3] = v.height; + gl.uniform4f(ud["${i}"].location, v.x, v.y, v.width, v.height) + }`,codeUbo:i=>` + v = uv.${i}; + + data[offset] = v.x; + data[offset+1] = v.y; + data[offset+2] = v.width; + data[offset+3] = v.height; + `},{test:(i,e)=>i.type==="vec4"&&i.size===1&&!i.isArray&&e.red!==void 0,code:i=>` + cv = ud["${i}"].value; + v = uv["${i}"]; + + if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) + { + cv[0] = v.red; + cv[1] = v.green; + cv[2] = v.blue; + cv[3] = v.alpha; + gl.uniform4f(ud["${i}"].location, v.red, v.green, v.blue, v.alpha) + }`,codeUbo:i=>` + v = uv.${i}; + + data[offset] = v.red; + data[offset+1] = v.green; + data[offset+2] = v.blue; + data[offset+3] = v.alpha; + `},{test:(i,e)=>i.type==="vec3"&&i.size===1&&!i.isArray&&e.red!==void 0,code:i=>` + cv = ud["${i}"].value; + v = uv["${i}"]; + + if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a) + { + cv[0] = v.red; + cv[1] = v.green; + cv[2] = v.blue; + + gl.uniform3f(ud["${i}"].location, v.red, v.green, v.blue) + }`,codeUbo:i=>` + v = uv.${i}; + + data[offset] = v.red; + data[offset+1] = v.green; + data[offset+2] = v.blue; + `},{test:i=>i.type==="vec4"&&i.size===1&&!i.isArray,code:i=>` + cv = ud["${i}"].value; + v = uv["${i}"]; + + if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4f(ud["${i}"].location, v[0], v[1], v[2], v[3]) + }`}],JC={float:` + if (cv !== v) + { + cu.value = v; + gl.uniform1f(location, v); + }`,vec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2f(location, v[0], v[1]) + }`,vec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3f(location, v[0], v[1], v[2]) + }`,vec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4f(location, v[0], v[1], v[2], v[3]); + }`,int:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,ivec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2i(location, v[0], v[1]); + }`,ivec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3i(location, v[0], v[1], v[2]); + }`,ivec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4i(location, v[0], v[1], v[2], v[3]); + }`,uint:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1ui(location, v); + }`,uvec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2ui(location, v[0], v[1]); + }`,uvec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3ui(location, v[0], v[1], v[2]); + }`,uvec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4ui(location, v[0], v[1], v[2], v[3]); + }`,bool:` + if (cv !== v) + { + cu.value = v; + gl.uniform1i(location, v); + }`,bvec2:` + if (cv[0] != v[0] || cv[1] != v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2i(location, v[0], v[1]); + }`,bvec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3i(location, v[0], v[1], v[2]); + }`,bvec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4i(location, v[0], v[1], v[2], v[3]); + }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,samplerCube:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,sampler2DArray:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`},QC={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function e2(i,e){var s;const t=[` + var v = null; + var cv = null; + var cu = null; + var t = 0; + var gl = renderer.gl; + `];for(const n in i.uniforms){const r=e[n];if(!r){((s=i.uniforms[n])==null?void 0:s.group)===!0&&(i.uniforms[n].ubo?t.push(` + renderer.shader.syncUniformBufferGroup(uv.${n}, '${n}'); + `):t.push(` + renderer.shader.syncUniformGroup(uv.${n}, syncData); + `));continue}const o=i.uniforms[n];let a=!1;for(let c=0;c=fo.WEBGL2&&(e=i.getContext("webgl2",{})),e||(e=i.getContext("webgl",{})||i.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Mo=e}return Mo}let Hl;function s2(){if(!Hl){Hl=fi.MEDIUM;const i=t2();if(i&&i.getShaderPrecisionFormat){const e=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);e&&(Hl=e.precision?fi.HIGH:fi.MEDIUM)}}return Hl}function V0(i,e){const t=i.getShaderSource(e).split(` +`).map((l,h)=>`${h}: ${l}`),s=i.getShaderInfoLog(e),n=s.split(` +`),r={},o=n.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!r[l]?(r[l]=!0,!0):!1),a=[""];o.forEach(l=>{t[l-1]=`%c${t[l-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=t.join(` +`);a[0]=c,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function i2(i,e,t,s){i.getProgramParameter(e,i.LINK_STATUS)||(i.getShaderParameter(t,i.COMPILE_STATUS)||V0(i,t),i.getShaderParameter(s,i.COMPILE_STATUS)||V0(i,s),console.error("PixiJS Error: Could not initialize shader."),i.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",i.getProgramInfoLog(e)))}const n2={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function tb(i){return n2[i]}let Wl=null;const Y0={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function sb(i,e){if(!Wl){const t=Object.keys(Y0);Wl={};for(let s=0;s0&&(t+=` +else `),sthis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,s=wi._textureArrayPool,n=this.renderer.batch,r=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++Qe._globalBatch,c=0,l=s[0],h=0;n.copyBoundTextures(r,t);for(let u=0;u=t&&(n.boundArray(l,r,a,t),this.buildDrawCalls(l,h,u),h=u,l=s[++c],++a),d._batchEnabled=a,d.touched=o,l.elements[l.count++]=d)}l.count>0&&(n.boundArray(l,r,a,t),this.buildDrawCalls(l,h,this._bufferSize),++c,++a);for(let u=0;u0);for(let m=0;m=0;--n)e[n]=s[n]||null,e[n]&&(e[n]._batchLocation=n)}boundArray(e,t,s,n){const{elements:r,ids:o,count:a}=e;let c=0;for(let l=0;l=0&&u=fo.WEBGL2&&(s=e.getContext("webgl2",t)),s)this.webGLVersion=2;else if(this.webGLVersion=1,s=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!s)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=s,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const t=e.getContextAttributes(),s="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;s&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=s||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}eh.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},eh.extension={type:Pe.RendererSystem,name:"context"};Ue.add(eh);class Uf{constructor(e,t){if(this.width=Math.round(e),this.height=Math.round(t),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ri("disposeFramebuffer"),this.multisample=as.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,t){return this.colorTextures[e]=t||new Qe(null,{scaleMode:Ci.NEAREST,resolution:1,mipmap:gi.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new Qe(null,{scaleMode:Ci.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:gi.OFF,format:_e.DEPTH_COMPONENT,type:De.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,t){if(e=Math.round(e),t=Math.round(t),!e||!t)throw new Error("Framebuffer width and height must not be zero");if(!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(let s=0;s{const n=this.source;this.url=n.src;const r=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};n.complete&&n.src?r():(n.onload=r,n.onerror=o=>{s(o),this.onError.emit(o)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const t=globalThis.createImageBitmap,s=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:s?"cors":"no-cors"}).then(n=>n.blob()).then(n=>t(n,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===xs.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,t,s){if(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,t,s);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,t,s,this.bitmap),!this.preserveBitmap){let n=!0;const r=t._glTextures;for(const o in r){const a=r[o];if(a!==s&&a.dirtyId!==t.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class np{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,t,s){const n=t.width,r=t.height;if(s){const o=e.width/2/n,a=e.height/2/r,c=e.x/n+o,l=e.y/r+a;s=jt.add(s,jt.NW),this.x0=c+o*jt.uX(s),this.y0=l+a*jt.uY(s),s=jt.add(s,2),this.x1=c+o*jt.uX(s),this.y1=l+a*jt.uY(s),s=jt.add(s,2),this.x2=c+o*jt.uX(s),this.y2=l+a*jt.uY(s),s=jt.add(s,2),this.x3=c+o*jt.uX(s),this.y3=l+a*jt.uY(s)}else this.x0=e.x/n,this.y0=e.y/r,this.x1=(e.x+e.width)/n,this.y1=e.y/r,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/r,this.x3=e.x/n,this.y3=(e.y+e.height)/r;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}np.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const H0=new np;function ql(i){i.destroy=function(){},i.on=function(){},i.once=function(){},i.emit=function(){}}let ze=class Nt extends _l{constructor(e,t,s,n,r,o,a){if(super(),this.noFrame=!1,t||(this.noFrame=!0,t=new ot(0,0,1,1)),e instanceof Nt&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=n,this.valid=!1,this.destroyed=!1,this._uvs=H0,this.uvMatrix=null,this.orig=s||t,this._rotate=Number(r||0),r===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new gt(o.x,o.y):new gt(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=t:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:t}=this.baseTexture;t!=null&&t.url&&Ui[t.url]&&Nt.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Nt.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var n;const e=this._frame.clone(),t=this._frame===this.orig?e:this.orig.clone(),s=new Nt(this.baseTexture,!this.noFrame&&e,t,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(s._frame=e),s}updateUvs(){this._uvs===H0&&(this._uvs=new np),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,t={},s=Oe.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else if(e instanceof Qe){if(!e.cacheId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e.cacheId=`${a}-${ao()}`,Qe.addToCache(e,e.cacheId)}r=e.cacheId}else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${ao()}`}r=e._pixiId}let o=Ui[r];if(n&&s&&!o)throw new Error(`The cacheId "${r}" does not exist in TextureCache.`);return!o&&!(e instanceof Qe)?(t.resolution||(t.resolution=Vn(e)),o=new Nt(new Qe(e,t)),o.baseTexture.cacheId=r,Qe.addToCache(o.baseTexture,r),Nt.addToCache(o,r)):!o&&e instanceof Qe&&(o=new Nt(e),Nt.addToCache(o,r)),o}static fromURL(e,t){const s=Object.assign({autoLoad:!1},t==null?void 0:t.resourceOptions),n=Nt.from(e,Object.assign({resourceOptions:s},t),!1),r=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):r.load().then(()=>Promise.resolve(n))}static fromBuffer(e,t,s,n){return new Nt(Qe.fromBuffer(e,t,s,n))}static fromLoader(e,t,s,n){const r=new Qe(e,Object.assign({scaleMode:Qe.defaultOptions.scaleMode,resolution:Vn(t)},n)),{resource:o}=r;o instanceof ob&&(o.url=t);const a=new Nt(r);return s||(s=t),Qe.addToCache(a.baseTexture,s),Nt.addToCache(a,s),s!==t&&(Qe.addToCache(a.baseTexture,t),Nt.addToCache(a,t)),a.baseTexture.valid?Promise.resolve(a):new Promise(c=>{a.baseTexture.once("loaded",()=>c(a))})}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Ui[t]&&Ui[t]!==e&&console.warn(`Texture added to the cache with an id [${t}] that already had an entry`),Ui[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Ui[e];if(t){const s=t.textureCacheIds.indexOf(e);return s>-1&&t.textureCacheIds.splice(s,1),delete Ui[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;tthis.baseTexture.width,a=s+r>this.baseTexture.height;if(o||a){const c=o&&a?"and":"or",l=`X: ${t} + ${n} = ${t+n} > ${this.baseTexture.width}`,h=`Y: ${s} + ${r} = ${s+r} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${c} ${h}`)}this.valid=n&&r&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Nt._EMPTY||(Nt._EMPTY=new Nt(new Qe),ql(Nt._EMPTY),ql(Nt._EMPTY.baseTexture)),Nt._EMPTY}static get WHITE(){if(!Nt._WHITE){const e=Oe.ADAPTER.createCanvas(16,16),t=e.getContext("2d");e.width=16,e.height=16,t.fillStyle="white",t.fillRect(0,0,16,16),Nt._WHITE=new Nt(Qe.from(e)),ql(Nt._WHITE),ql(Nt._WHITE.baseTexture)}return Nt._WHITE}};class mo extends ze{constructor(e,t){super(e,t),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,t,s=!0){const n=this.baseTexture.resolution,r=Math.round(e*n)/n,o=Math.round(t*n)/n;this.valid=r>0&&o>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=o,s&&this.baseTexture.resize(r,o),this.updateUvs()}setResolution(e){const{baseTexture:t}=this;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))}static create(e){return new mo(new rb(e))}}class ab{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,t,s=as.NONE){const n=new rb(Object.assign({width:e,height:t,resolution:1,multisample:s},this.textureOptions));return new mo(n)}getOptimalTexture(e,t,s=1,n=as.NONE){let r;e=Math.max(Math.ceil(e*s-1e-6),1),t=Math.max(Math.ceil(t*s-1e-6),1),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=Kc(e),t=Kc(t),r=((e&65535)<<16|t&65535)>>>0,n>1&&(r+=n*4294967296)):r=n>1?-n:-1,this.texturePool[r]||(this.texturePool[r]=[]);let o=this.texturePool[r].pop();return o||(o=this.createTexture(e,t,n)),o.filterPoolKey=r,o.setResolution(s),o}getFilterTexture(e,t,s){const n=this.getOptimalTexture(e.width,e.height,t||e.resolution,s||as.NONE);return n.filterFrame=e.filterFrame,n}returnTexture(e){const t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const t in this.texturePool){const s=this.texturePool[t];if(s)for(let n=0;n0&&e.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const s=this.texturePool[t];if(s)for(let n=0;n1&&(h=this.getOptimalFilterTexture(l.width,l.height,t.resolution),h.filterFrame=l.filterFrame),s[u].apply(this,l,h,Ki.CLEAR,t);const d=l;l=h,h=d}s[u].apply(this,l,c.renderTexture,Ki.BLEND,t),u>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)}bindAndClear(e,t=Ki.CLEAR){const{renderTexture:s,state:n}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e==null?void 0:e.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,s.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?s.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const r=n.stateId&1||this.forceClear;(t===Ki.CLEAR||t===Ki.BLIT&&r)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,t,s,n){const r=this.renderer;r.state.set(e.state),this.bindAndClear(s,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,r.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),r.geometry.bind(this.quadUv),r.geometry.draw(tn.TRIANGLES)):(r.geometry.bind(this.quad),r.geometry.draw(tn.TRIANGLE_STRIP))}calculateSpriteMatrix(e,t){const{sourceFrame:s,destinationFrame:n}=this.activeState,{orig:r}=t._texture,o=e.set(n.width,0,0,n.height,s.x,s.y),a=t.worldTransform.copyTo(Ot.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/r.width,1/r.height),o.translate(t.anchor.x,t.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,t,s=1,n=as.NONE){return this.texturePool.getOptimalTexture(e,t,s,n)}getFilterTexture(e,t,s){if(typeof e=="number"){const r=e;e=t,t=r}e=e||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,s||as.NONE);return n.filterFrame=e.filterFrame,n}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,t){const s=Kl[0],n=Kl[1],r=Kl[2],o=Kl[3];s.set(t.left,t.top),n.set(t.left,t.bottom),r.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(s,s),e.apply(n,n),e.apply(r,r),e.apply(o,o);const a=Math.min(s.x,n.x,r.x,o.x),c=Math.min(s.y,n.y,r.y,o.y),l=Math.max(s.x,n.x,r.x,o.x),h=Math.max(s.y,n.y,r.y,o.y);t.x=a,t.y=c,t.width=l-a,t.height=h-c}roundFrame(e,t,s,n,r){if(!(e.width<=0||e.height<=0||s.width<=0||s.height<=0)){if(r){const{a:o,b:a,c,d:l}=r;if((Math.abs(a)>1e-4||Math.abs(c)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(l)>1e-4))return}r=r?Dd.copyFrom(r):Dd.identity(),r.translate(-s.x,-s.y).scale(n.width/s.width,n.height/s.height).translate(n.x,n.y),this.transformAABB(r,e),e.ceil(t),this.transformAABB(r.invert(),e)}}}cb.extension={type:Pe.RendererSystem,name:"filter"};Ue.add(cb);class g2{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=as.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const v2=new ot;class hb{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Uf(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ot,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let t=this.renderer.context.extensions.drawBuffers,s=this.renderer.context.extensions.depthTexture;Oe.PREFER_ENV===fo.WEBGL_LEGACY&&(t=null,s=null),t?e.drawBuffers=n=>t.drawBuffersWEBGL(n):(this.hasMRT=!1,e.drawBuffers=()=>{}),s||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,t,s=0){const{gl:n}=this;if(e){const r=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,r.framebuffer)),r.mipLevel!==s&&(e.dirtyId++,e.dirtyFormat++,r.mipLevel=s),r.dirtyId!==e.dirtyId&&(r.dirtyId=e.dirtyId,r.dirtyFormat!==e.dirtyFormat?(r.dirtyFormat=e.dirtyFormat,r.dirtySize=e.dirtySize,this.updateFramebuffer(e,s)):r.dirtySize!==e.dirtySize&&(r.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let o=0;o>s,a=t.height>>s,c=o/t.width;this.setViewport(t.x*c,t.y*c,o,a)}else{const o=e.width>>s,a=e.height>>s;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,t,s,n){const r=this.viewport;e=Math.round(e),t=Math.round(t),s=Math.round(s),n=Math.round(n),(r.width!==s||r.height!==n||r.x!==e||r.y!==t)&&(r.x=e,r.y=t,r.width=s,r.height=n,this.gl.viewport(e,t,s,n))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,t,s,n,r=_f.COLOR|_f.DEPTH){const{gl:o}=this;o.clearColor(e,t,s,n),o.clear(r)}initFramebuffer(e){const{gl:t}=this,s=new g2(t.createFramebuffer());return s.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=s,this.managedFramebuffers.push(e),e.disposeRunner.add(this),s}resizeFramebuffer(e){const{gl:t}=this,s=e.glFramebuffers[this.CONTEXT_UID];if(s.stencil){t.bindRenderbuffer(t.RENDERBUFFER,s.stencil);let o;this.renderer.context.webGLVersion===1?o=t.DEPTH_STENCIL:e.depth&&e.stencil?o=t.DEPTH24_STENCIL8:e.depth?o=t.DEPTH_COMPONENT24:o=t.STENCIL_INDEX8,s.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,s.multisample,o,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,o,e.width,e.height)}const n=e.colorTextures;let r=n.length;t.drawBuffers||(r=Math.min(r,1));for(let o=0;o1&&this.canMultisampleFramebuffer(e)?n.msaaBuffer=n.msaaBuffer||s.createRenderbuffer():n.msaaBuffer&&(s.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const a=[];for(let c=0;c1&&s.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){const c=e.depthTexture;this.renderer.texture.bind(c,0),s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){n.stencil=n.stencil||s.createRenderbuffer();let c,l;this.renderer.context.webGLVersion===1?(c=s.DEPTH_STENCIL_ATTACHMENT,l=s.DEPTH_STENCIL):e.depth&&e.stencil?(c=s.DEPTH_STENCIL_ATTACHMENT,l=s.DEPTH24_STENCIL8):e.depth?(c=s.DEPTH_ATTACHMENT,l=s.DEPTH_COMPONENT24):(c=s.STENCIL_ATTACHMENT,l=s.STENCIL_INDEX8),s.bindRenderbuffer(s.RENDERBUFFER,n.stencil),n.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,n.multisample,l,e.width,e.height):s.renderbufferStorage(s.RENDERBUFFER,l,e.width,e.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,c,s.RENDERBUFFER,n.stencil)}else n.stencil&&(s.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:t}=this;let s=as.NONE;if(e<=1||t===null)return s;for(let n=0;n=0&&this.managedFramebuffers.splice(r,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(s.framebuffer),s.msaaBuffer&&n.deleteRenderbuffer(s.msaaBuffer),s.stencil&&n.deleteRenderbuffer(s.stencil)),s.blitFramebuffer&&this.disposeFramebuffer(s.blitFramebuffer,t)}disposeAll(e){const t=this.managedFramebuffers;this.managedFramebuffers=[];for(let s=0;ss.createVertexArrayOES(),e.bindVertexArray=n=>s.bindVertexArrayOES(n),e.deleteVertexArray=n=>s.deleteVertexArrayOES(n)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(t.webGLVersion!==2){const s=e.getExtension("ANGLE_instanced_arrays");s?(e.vertexAttribDivisor=(n,r)=>s.vertexAttribDivisorANGLE(n,r),e.drawElementsInstanced=(n,r,o,a,c)=>s.drawElementsInstancedANGLE(n,r,o,a,c),e.drawArraysInstanced=(n,r,o,a)=>s.drawArraysInstancedANGLE(n,r,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex}bind(e,t){t=t||this.renderer.shader.shader;const{gl:s}=this;let n=e.glVertexArrayObjects[this.CONTEXT_UID],r=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},r=!0);const o=n[t.program.id]||this.initGeometryVao(e,t,r);this._activeGeometry=e,this._activeVao!==o&&(this._activeVao=o,this.hasVao?s.bindVertexArray(o):this.activateVao(e,t.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,t=this.renderer.buffer;for(let s=0;s"u"?.5:t,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,t){t===void 0&&(t=e);const s=this.mapCoord;for(let n=0;n0?this.maskStack[this.maskStack.length-1]._colorMask:15;s!==t&&this.renderer.gl.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)}destroy(){this.renderer=null}}db.extension={type:Pe.RendererSystem,name:"mask"};Ue.add(db);class fb{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:t}=this.renderer,s=this.getStackLength();this.maskStack=e;const n=this.getStackLength();n!==s&&(n===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const z0=new Ot,q0=[],mb=class Tc extends fb{constructor(e){super(e),this.glConst=Oe.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:s}=e,{renderer:n}=this,r=n.renderTexture,o=s.getBounds(!0,q0.pop()??new ot);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:s,c:n,d:r}=e;return(Math.abs(s)>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()||Tc.isMatrixRotated(t.worldTransform)||Tc.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const s=e._scissorRectLocal;return s.width>0&&s.height>0}roundFrameToPixels(e,t,s,n,r){Tc.isMatrixRotated(r)||(r=r?z0.copyFrom(r):z0.identity(),r.translate(-s.x,-s.y).scale(n.width/s.width,n.height/s.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&&q0.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)}};mb.extension={type:Pe.RendererSystem,name:"scissor"};let S2=mb;Ue.add(S2);class pb extends fb{constructor(e){super(e),this.glConst=Oe.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:s}=this.renderer,n=e._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),s.clearStencil(0),s.clear(s.STENCIL_BUFFER_BIT),s.enable(s.STENCIL_TEST)),e._stencilCounter++;const r=e._colorMask;r!==0&&(e._colorMask=0,s.colorMask(!1,!1,!1,!1)),s.stencilFunc(s.EQUAL,n,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(e._colorMask=r,s.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 s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=s?s._colorMask:15;n!==0&&(s._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&&(s._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)}}pb.extension={type:Pe.RendererSystem,name:"stencil"};Ue.add(pb);class gb{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return ht("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return ht("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return ht("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}}gb.extension={type:[Pe.RendererSystem,Pe.CanvasRendererSystem],name:"_plugin"};Ue.add(gb);class vb{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ot,this.transform=null}update(e,t,s,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,s,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,s,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}}vb.extension={type:Pe.RendererSystem,name:"projection"};Ue.add(vb);const M2=new ip,K0=new ot;class yb{constructor(e){this.renderer=e,this._tempMatrix=new Ot}generateTexture(e,t){const{region:s,...n}=t||{},r=(s==null?void 0:s.copyTo(K0))||e.getLocalBounds(K0,!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=mo.create(n);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const c=e.transform;return e.transform=M2,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=c,a}destroy(){}}yb.extension={type:[Pe.RendererSystem,Pe.CanvasRendererSystem],name:"textureGenerator"};Ue.add(yb);const Lr=new ot,Ia=new ot;class xb{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ot,this.destinationFrame=new ot,this.viewportFrame=new ot}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,s){const n=this.renderer;this.current=e;let r,o,a;e?(r=e.baseTexture,a=r.resolution,t||(Lr.width=e.frame.width,Lr.height=e.frame.height,t=Lr),s||(Ia.x=e.frame.x,Ia.y=e.frame.y,Ia.width=t.width,Ia.height=t.height,s=Ia),o=r.framebuffer):(a=n.resolution,t||(Lr.width=n._view.screen.width,Lr.height=n._view.screen.height,t=Lr),s||(s=Lr,s.width=t.width,s.height=t.height));const c=this.viewportFrame;c.x=s.x*a,c.y=s.y*a,c.width=s.width*a,c.height=s.height*a,e||(c.y=n.view.height-(c.y+c.height)),c.ceil(),this.renderer.framebuffer.bind(o,c),this.renderer.projection.update(s,t,a,!o),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(s)}clear(e,t){const s=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=Ct.shared.setValue(e||s);(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}}xb.extension={type:Pe.RendererSystem,name:"renderTexture"};Ue.add(xb);class T2{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 _2(i,e){const t={},s=e.getProgramParameter(i,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,s=0,n=0;for(let r=0;r1&&(t=Math.max(t,16)*o.data.size),o.dataLen=t,s%t!==0&&s<16){const a=s%t%16;s+=a,n+=a}s+t>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=t,s=t):(o.offset=n,s+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function P2(i,e){const t=[];for(const s in i)e[s]&&t.push(e[s]);return t.sort((s,n)=>s.index-n.index),t}function k2(i,e){if(!i.autoManage)return{size:0,syncFunc:E2};const t=P2(i.uniforms,e),{uboElements:s,size:n}=R2(t),r=[` + var v = null; + var v2 = null; + var cv = null; + var t = 0; + var gl = renderer.gl + var index = 0; + var data = buffer.data; + `];for(let o=0;o1){const u=tb(a.data.type),d=Math.max(bb[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}; + + t = 0; + + for(var i=0; i < ${a.data.size*d}; i++) + { + for(var j = 0; j < ${f}; j++) + { + data[offset++] = v[t++]; + } + offset += ${p}; + } + + `)}else{const u=I2[a.data.type];r.push(` + cv = ud.${l}.value; + v = uv.${l}; + offset = ${a.offset/4}; + ${u}; + `)}}return r.push(` + renderer.buffer.update(buffer); + `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",r.join(` +`))}}let F2=0;const Zl={textureCount:0,uboCount:0};class wb{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=F2++}systemCheck(){if(!r2())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 s=e.program,n=s.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==s&&(this.program=s,this.gl.useProgram(n.program)),t||(Zl.textureCount=0,Zl.uboCount=0,this.syncUniformGroup(e.uniformGroup,Zl)),n}setUniforms(e){const t=this.shader.program,s=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(s.uniformData,e,this.renderer)}syncUniformGroup(e,t){const s=this.getGlProgram();(!e.static||e.dirtyId!==s.uniformDirtyGroups[e.id])&&(s.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,s,t))}syncUniforms(e,t,s){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,s)}createSyncGroups(e){const t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=e2(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,t){const s=this.getGlProgram();if(!e.static||e.dirtyId!==0||!s.uniformGroups[e.id]){e.dirtyId=0;const n=s.uniformGroups[e.id]||this.createSyncBufferGroup(e,s,t);e.buffer.update(),n(s.uniformData,e.uniforms,this.renderer,Zl,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,s.uniformBufferBindings[t])}createSyncBufferGroup(e,t,s){const{gl:n}=this.renderer;this.renderer.buffer.bind(e.buffer);const r=this.gl.getUniformBlockIndex(t.program,s);t.uniformBufferBindings[s]=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]=k2(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,s){const n=e.uniforms,r=[`${s}-`];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,s=e.program,n=A2(t,s);return s.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}}wb.extension={type:Pe.RendererSystem,name:"shader"};Ue.add(wb);class th{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(){}}th.defaultOptions={hello:!1},th.extension={type:[Pe.RendererSystem,Pe.CanvasRendererSystem],name:"startup"};Ue.add(th);function O2(i,e=[]){return e[He.NORMAL]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.ADD]=[i.ONE,i.ONE],e[He.MULTIPLY]=[i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.SCREEN]=[i.ONE,i.ONE_MINUS_SRC_COLOR,i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.OVERLAY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.DARKEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.LIGHTEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.COLOR_DODGE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.COLOR_BURN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.HARD_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.SOFT_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.DIFFERENCE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.EXCLUSION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.HUE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.SATURATION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.COLOR]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.LUMINOSITY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.NONE]=[0,0],e[He.NORMAL_NPM]=[i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.ADD_NPM]=[i.SRC_ALPHA,i.ONE,i.ONE,i.ONE],e[He.SCREEN_NPM]=[i.SRC_ALPHA,i.ONE_MINUS_SRC_COLOR,i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.SRC_IN]=[i.DST_ALPHA,i.ZERO],e[He.SRC_OUT]=[i.ONE_MINUS_DST_ALPHA,i.ZERO],e[He.SRC_ATOP]=[i.DST_ALPHA,i.ONE_MINUS_SRC_ALPHA],e[He.DST_OVER]=[i.ONE_MINUS_DST_ALPHA,i.ONE],e[He.DST_IN]=[i.ZERO,i.SRC_ALPHA],e[He.DST_OUT]=[i.ZERO,i.ONE_MINUS_SRC_ALPHA],e[He.DST_ATOP]=[i.ONE_MINUS_DST_ALPHA,i.SRC_ALPHA],e[He.XOR]=[i.ONE_MINUS_DST_ALPHA,i.ONE_MINUS_SRC_ALPHA],e[He.SUBTRACT]=[i.ONE,i.ONE,i.ONE,i.ONE,i.FUNC_REVERSE_SUBTRACT,i.FUNC_ADD],e}const L2=0,B2=1,N2=2,D2=3,U2=4,$2=5,Sb=class $f{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=He.NONE,this._blendEq=!1,this.map=[],this.map[L2]=this.setBlend,this.map[B2]=this.setOffset,this.map[N2]=this.setCullFace,this.map[D2]=this.setDepthTest,this.map[U2]=this.setFrontFace,this.map[$2]=this.setDepthMask,this.checks=[],this.defaultState=new hn,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=O2(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,s=0;for(;t;)t&1&&this.map[s].call(this,!!(e.data&1<>1,s++;this.stateId=e.data}for(let t=0;te.systems[n]),s=[...t,...Object.keys(e.systems).filter(n=>!t.includes(n))];for(const n of s)this.addSystem(e.systems[n],n)}addRunners(...e){e.forEach(t=>{this.runners[t]=new Ri(t)})}addSystem(e,t){const s=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=s,this._systemsHash[t]=s;for(const n in this.runners)this.runners[n].add(s);return this}emitWithCustomOptions(e,t){const s=Object.keys(this._systemsHash);e.items.forEach(n=>{const r=s.find(o=>this._systemsHash[o]===n);n[e.name](t[r])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Da=class _c{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=_c.defaultMaxIdle,this.checkCountMax=_c.defaultCheckCountMax,this.mode=_c.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==Qm.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let s=!1;for(let n=0;nthis.maxIdle&&(e.destroyTexture(r,!0),t[n]=null,s=!0)}if(s){let n=0;for(let r=0;r=0;n--)this.unload(e.children[n])}destroy(){this.renderer=null}};Da.defaultMode=Qm.AUTO,Da.defaultMaxIdle=3600,Da.defaultCheckCountMax=600,Da.extension={type:Pe.RendererSystem,name:"textureGC"};let Gr=Da;Ue.add(Gr);class $d{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=_e.RGBA,this.samplerType=0}}function Y2(i){let e;return"WebGL2RenderingContext"in globalThis&&i instanceof globalThis.WebGL2RenderingContext?e={[i.RGB]:Be.FLOAT,[i.RGBA]:Be.FLOAT,[i.ALPHA]:Be.FLOAT,[i.LUMINANCE]:Be.FLOAT,[i.LUMINANCE_ALPHA]:Be.FLOAT,[i.R8]:Be.FLOAT,[i.R8_SNORM]:Be.FLOAT,[i.RG8]:Be.FLOAT,[i.RG8_SNORM]:Be.FLOAT,[i.RGB8]:Be.FLOAT,[i.RGB8_SNORM]:Be.FLOAT,[i.RGB565]:Be.FLOAT,[i.RGBA4]:Be.FLOAT,[i.RGB5_A1]:Be.FLOAT,[i.RGBA8]:Be.FLOAT,[i.RGBA8_SNORM]:Be.FLOAT,[i.RGB10_A2]:Be.FLOAT,[i.RGB10_A2UI]:Be.FLOAT,[i.SRGB8]:Be.FLOAT,[i.SRGB8_ALPHA8]:Be.FLOAT,[i.R16F]:Be.FLOAT,[i.RG16F]:Be.FLOAT,[i.RGB16F]:Be.FLOAT,[i.RGBA16F]:Be.FLOAT,[i.R32F]:Be.FLOAT,[i.RG32F]:Be.FLOAT,[i.RGB32F]:Be.FLOAT,[i.RGBA32F]:Be.FLOAT,[i.R11F_G11F_B10F]:Be.FLOAT,[i.RGB9_E5]:Be.FLOAT,[i.R8I]:Be.INT,[i.R8UI]:Be.UINT,[i.R16I]:Be.INT,[i.R16UI]:Be.UINT,[i.R32I]:Be.INT,[i.R32UI]:Be.UINT,[i.RG8I]:Be.INT,[i.RG8UI]:Be.UINT,[i.RG16I]:Be.INT,[i.RG16UI]:Be.UINT,[i.RG32I]:Be.INT,[i.RG32UI]:Be.UINT,[i.RGB8I]:Be.INT,[i.RGB8UI]:Be.UINT,[i.RGB16I]:Be.INT,[i.RGB16UI]:Be.UINT,[i.RGB32I]:Be.INT,[i.RGB32UI]:Be.UINT,[i.RGBA8I]:Be.INT,[i.RGBA8UI]:Be.UINT,[i.RGBA16I]:Be.INT,[i.RGBA16UI]:Be.UINT,[i.RGBA32I]:Be.INT,[i.RGBA32UI]:Be.UINT,[i.DEPTH_COMPONENT16]:Be.FLOAT,[i.DEPTH_COMPONENT24]:Be.FLOAT,[i.DEPTH_COMPONENT32F]:Be.FLOAT,[i.DEPTH_STENCIL]:Be.FLOAT,[i.DEPTH24_STENCIL8]:Be.FLOAT,[i.DEPTH32F_STENCIL8]:Be.FLOAT}:e={[i.RGB]:Be.FLOAT,[i.RGBA]:Be.FLOAT,[i.ALPHA]:Be.FLOAT,[i.LUMINANCE]:Be.FLOAT,[i.LUMINANCE_ALPHA]:Be.FLOAT,[i.DEPTH_STENCIL]:Be.FLOAT},e}function G2(i){let e;return"WebGL2RenderingContext"in globalThis&&i instanceof globalThis.WebGL2RenderingContext?e={[De.UNSIGNED_BYTE]:{[_e.RGBA]:i.RGBA8,[_e.RGB]:i.RGB8,[_e.RG]:i.RG8,[_e.RED]:i.R8,[_e.RGBA_INTEGER]:i.RGBA8UI,[_e.RGB_INTEGER]:i.RGB8UI,[_e.RG_INTEGER]:i.RG8UI,[_e.RED_INTEGER]:i.R8UI,[_e.ALPHA]:i.ALPHA,[_e.LUMINANCE]:i.LUMINANCE,[_e.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[De.BYTE]:{[_e.RGBA]:i.RGBA8_SNORM,[_e.RGB]:i.RGB8_SNORM,[_e.RG]:i.RG8_SNORM,[_e.RED]:i.R8_SNORM,[_e.RGBA_INTEGER]:i.RGBA8I,[_e.RGB_INTEGER]:i.RGB8I,[_e.RG_INTEGER]:i.RG8I,[_e.RED_INTEGER]:i.R8I},[De.UNSIGNED_SHORT]:{[_e.RGBA_INTEGER]:i.RGBA16UI,[_e.RGB_INTEGER]:i.RGB16UI,[_e.RG_INTEGER]:i.RG16UI,[_e.RED_INTEGER]:i.R16UI,[_e.DEPTH_COMPONENT]:i.DEPTH_COMPONENT16},[De.SHORT]:{[_e.RGBA_INTEGER]:i.RGBA16I,[_e.RGB_INTEGER]:i.RGB16I,[_e.RG_INTEGER]:i.RG16I,[_e.RED_INTEGER]:i.R16I},[De.UNSIGNED_INT]:{[_e.RGBA_INTEGER]:i.RGBA32UI,[_e.RGB_INTEGER]:i.RGB32UI,[_e.RG_INTEGER]:i.RG32UI,[_e.RED_INTEGER]:i.R32UI,[_e.DEPTH_COMPONENT]:i.DEPTH_COMPONENT24},[De.INT]:{[_e.RGBA_INTEGER]:i.RGBA32I,[_e.RGB_INTEGER]:i.RGB32I,[_e.RG_INTEGER]:i.RG32I,[_e.RED_INTEGER]:i.R32I},[De.FLOAT]:{[_e.RGBA]:i.RGBA32F,[_e.RGB]:i.RGB32F,[_e.RG]:i.RG32F,[_e.RED]:i.R32F,[_e.DEPTH_COMPONENT]:i.DEPTH_COMPONENT32F},[De.HALF_FLOAT]:{[_e.RGBA]:i.RGBA16F,[_e.RGB]:i.RGB16F,[_e.RG]:i.RG16F,[_e.RED]:i.R16F},[De.UNSIGNED_SHORT_5_6_5]:{[_e.RGB]:i.RGB565},[De.UNSIGNED_SHORT_4_4_4_4]:{[_e.RGBA]:i.RGBA4},[De.UNSIGNED_SHORT_5_5_5_1]:{[_e.RGBA]:i.RGB5_A1},[De.UNSIGNED_INT_2_10_10_10_REV]:{[_e.RGBA]:i.RGB10_A2,[_e.RGBA_INTEGER]:i.RGB10_A2UI},[De.UNSIGNED_INT_10F_11F_11F_REV]:{[_e.RGB]:i.R11F_G11F_B10F},[De.UNSIGNED_INT_5_9_9_9_REV]:{[_e.RGB]:i.RGB9_E5},[De.UNSIGNED_INT_24_8]:{[_e.DEPTH_STENCIL]:i.DEPTH24_STENCIL8},[De.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[_e.DEPTH_STENCIL]:i.DEPTH32F_STENCIL8}}:e={[De.UNSIGNED_BYTE]:{[_e.RGBA]:i.RGBA,[_e.RGB]:i.RGB,[_e.ALPHA]:i.ALPHA,[_e.LUMINANCE]:i.LUMINANCE,[_e.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[De.UNSIGNED_SHORT_5_6_5]:{[_e.RGB]:i.RGB},[De.UNSIGNED_SHORT_4_4_4_4]:{[_e.RGBA]:i.RGBA},[De.UNSIGNED_SHORT_5_5_5_1]:{[_e.RGBA]:i.RGBA}},e}class Mb{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Qe,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=G2(e),this.samplerTypes=Y2(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!==Be.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(e){const t=new $d(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 s;t.internalFormat=((s=this.internalFormats[e.type])==null?void 0:s[e.format])??e.format,t.samplerType=this.samplerTypes[t.internalFormat]??Be.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 s=this.renderer;if(this.initTextureType(e,t),(n=e.resource)==null?void 0:n.upload(s,e,t))t.samplerType!==Be.FLOAT&&(this.hasIntegerTextures=!0);else{const r=e.realWidth,o=e.realHeight,a=s.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:s}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),s.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&&Wo(this.managedTextures,n,1)}}updateTextureStyle(e){var s;const t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===gi.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Ii.CLAMP:t.wrapMode=e.wrapMode,(s=e.resource)!=null&&s.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)}setStyle(e,t){const s=this.gl;if(t.mipmap&&e.mipmap!==gi.ON_MANUAL&&s.generateMipmap(e.target),s.texParameteri(e.target,s.TEXTURE_WRAP_S,t.wrapMode),s.texParameteri(e.target,s.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){s.texParameteri(e.target,s.TEXTURE_MIN_FILTER,e.scaleMode===Ci.LINEAR?s.LINEAR_MIPMAP_LINEAR:s.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Ci.LINEAR){const r=Math.min(e.anisotropicLevel,s.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));s.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,r)}}else s.texParameteri(e.target,s.TEXTURE_MIN_FILTER,e.scaleMode===Ci.LINEAR?s.LINEAR:s.NEAREST);s.texParameteri(e.target,s.TEXTURE_MAG_FILTER,e.scaleMode===Ci.LINEAR?s.LINEAR:s.NEAREST)}destroy(){this.renderer=null}}Mb.extension={type:Pe.RendererSystem,name:"texture"};Ue.add(Mb);class Tb{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:s}=this,n=e._glTransformFeedbacks[s]||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:s,renderer:n}=this;t&&n.shader.bind(t),s.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:t,renderer:s,CONTEXT_UID:n}=this,r=t.createTransformFeedback();e._glTransformFeedbacks[n]=r,t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,r);for(let o=0;o(i[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY",i))(lo||{});class Xd{constructor(e,t=null,s=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=s,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 _b=class Zs{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 Xd(null,null,1/0),this.deltaMS=1/Zs.targetFPMS,this.elapsedMS=1/Zs.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,s=lo.NORMAL){return this._addListener(new Xd(e,t,s))}addOnce(e,t,s=lo.NORMAL){return this._addListener(new Xd(e,t,s,!0))}_addListener(e){let t=this._head.next,s=this._head;if(!t)e.connect(s);else{for(;t;){if(e.priority>t.priority){e.connect(s);break}s=t,t=t.next}e.previous||e.connect(s)}return this._startIfPossible(),this}remove(e,t){let s=this._head.next;for(;s;)s.match(e,t)?s=s.destroy():s=s.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?Ys.shared:new Ys,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Cb.extension=Pe.Application;Ue.add(Cb);const Ab=[];Ue.handleByList(Pe.Renderer,Ab);function j2(i){for(const e of Ab)if(e.test(i))return new e(i);throw new Error("Unable to auto-detect a suitable renderer.")}var H2=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,W2=`attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aVertexPosition * (outputFrame.zw * inputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); +} +`;const z2=H2,Eb=W2;class Ib{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){const s=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,s)}else{const s=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,s)}t>=as.HIGH?this.multisample=as.HIGH:t>=as.MEDIUM?this.multisample=as.MEDIUM:t>=as.LOW?this.multisample=as.LOW:this.multisample=as.NONE}destroy(){}}Ib.extension={type:Pe.RendererSystem,name:"_multisample"};Ue.add(Ib);class q2{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Rb{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:s}=this,n=e._glBuffers[s]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){const{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){const{gl:s,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){const r=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,s.bindBufferBase(s.UNIFORM_BUFFER,t,r.buffer)}}bindBufferRange(e,t,s){const{gl:n,CONTEXT_UID:r}=this;s=s||0;const o=e._glBuffers[r]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,s*256,256)}update(e){const{gl:t,CONTEXT_UID:s}=this,n=e._glBuffers[s]||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 s=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),s&&(t||n.deleteBuffer(s.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const t=Object.keys(this.managedBuffers);for(let s=0;st.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{const{realWidth:t,realHeight:s}=this.items[0];return this.resize(t,s),this.update(),Promise.resolve(this)}),this._load}}class K2 extends kb{constructor(e,t){const{width:s,height:n}=t||{};let r,o;Array.isArray(e)?(r=e,o=e.length):o=e,super(o,{width:s,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=Ho.TEXTURE_2D_ARRAY}upload(e,t,s){const{length:n,itemDirtyIds:r,items:o}=this,{gl:a}=e;s.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,s.internalFormat,this._width,this._height,n,0,t.format,s.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=Ho.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,s){const n=this.itemDirtyIds;for(let r=0;r{if(this.url===null){e(this);return}try{const s=await Oe.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await s.blob();if(this.destroyed)return;const r=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===xs.UNPACK?"premultiply":"none"});if(this.destroyed){r.close();return}this.source=r,this.update(),e(this)}catch(s){if(this.destroyed)return;t(s),this.onError.emit(s)}}),this._load)}upload(e,t,s){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,s)):(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 No._EMPTY=No._EMPTY??Oe.ADAPTER.createCanvas(0,0),No._EMPTY}}const Vf=class Ac extends Yn{constructor(e,t){t=t||{},super(Oe.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)},Ac.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;Yn.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,s=e.height;if(!t||!s)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,r=s*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/s*t,r=this._overrideHeight||this._overrideWidth/t*s),n=Math.round(n),r=Math.round(r);const o=this.source;o.width=n,o.height=r,o._pixiId=`canvas_${ao()}`,o.getContext("2d").drawImage(e,0,0,t,s,0,0,n,r),this._resolve(),this._resolve=null}}static getSize(e){const t=Ac.SVG_SIZE.exec(e),s={};return t&&(s[t[1]]=Math.round(parseFloat(t[3])),s[t[5]]=Math.round(parseFloat(t[7]))),s}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"&&Ac.SVG_XML.test(e)}};Vf.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Yf=Vf;class Q2 extends Yn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const Gf=class jf extends Yn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const s=document.createElement("video");t.autoLoad!==!1&&s.setAttribute("preload","auto"),t.playsinline!==!1&&(s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline","")),t.muted===!0&&(s.setAttribute("muted",""),s.muted=!0),t.loop===!0&&s.setAttribute("loop",""),t.autoPlay!==!1&&s.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);const n=e[0].src||e[0];Yn.crossOrigin(s,n,t.crossorigin);for(let r=0;r{this.valid?t(this):(this._resolve=t,this._reject=s,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&&(Ys.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||(Ys.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ys.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||jf.TYPES.includes(t)}};Gf.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Gf.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Ob=Gf;Pf.push(No,ob,Z2,Ob,Q2,Yf,tu,J2,K2);class ml{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?ot.EMPTY:(e=e||new ot(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:s,b:n,c:r,d:o,tx:a,ty:c}=e,l=s*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,s=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=s,this.maxX=n,this.maxY=r}addFrame(e,t,s,n,r){this.addFrameMatrix(e.worldTransform,t,s,n,r)}addFrameMatrix(e,t,s,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*s+h,v=a*t+l*s+u;d=gp?g:p,m=v>m?v:m,g=o*n+c*s+h,v=a*n+l*s+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,s){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,s,n){this.addVerticesMatrix(e.worldTransform,t,s,n)}addVerticesMatrix(e,t,s,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=s;vn?e.maxX:n,this.maxY=e.maxY>r?e.maxY:r}addBoundsMask(e,t){const s=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 s=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,s,n,r,o){e-=r,t-=o,s+=r,n+=o,this.minX=this.minXs?this.maxX:s,this.minY=this.minYn?this.maxY:n}}class qt extends _l{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new ip,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 ml,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 s=0;s1)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 s=this.getChildIndex(e),n=this.getChildIndex(t);this.children[s]=t,this.children[n]=e,this.onChildrenChange(s=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const s=this.getChildIndex(e);Wo(this.children,s,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(s,r);for(let a=0;a1&&this.children.sort(sA),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 s,n;this.cullArea?(s=this.cullArea,n=this.worldTransform):this._render!==Hf.prototype._render&&(s=this.getBounds(!0));const r=e.projection.transform;if(r&&(n?(n=tA.copyFrom(n),n.prepend(r)):n=r),s&&t.intersects(s,n))this._render(e);else if(this.cullArea)return;for(let o=0,a=this.children.length;o=n&&Ra.x=r&&Ra.y=t&&(o=i-a-1),c=c.replace("%value%",e[o].toString()),n+=c,n+=` +`}return s=s.replace("%blur%",n),s=s.replace("%size%",i.toString()),s}const hA=` + attribute vec2 aVertexPosition; + + uniform mat3 projectionMatrix; + + uniform float strength; + + varying vec2 vBlurTexCoords[%size%]; + + uniform vec4 inputSize; + uniform vec4 outputFrame; + + vec4 filterVertexPosition( void ) + { + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); + } + + vec2 filterTextureCoord( void ) + { + return aVertexPosition * (outputFrame.zw * inputSize.zw); + } + + void main(void) + { + gl_Position = filterVertexPosition(); + + vec2 textureCoord = filterTextureCoord(); + %blur% + }`;function uA(i,e){const t=Math.ceil(i/2);let s=hA,n="",r;e?r="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":r="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o 0.0) { + c.rgb /= c.a; + } + + vec4 result; + + result.r = (m[0] * c.r); + result.r += (m[1] * c.g); + result.r += (m[2] * c.b); + result.r += (m[3] * c.a); + result.r += m[4]; + + result.g = (m[5] * c.r); + result.g += (m[6] * c.g); + result.g += (m[7] * c.b); + result.g += (m[8] * c.a); + result.g += m[9]; + + result.b = (m[10] * c.r); + result.b += (m[11] * c.g); + result.b += (m[12] * c.b); + result.b += (m[13] * c.a); + result.b += m[14]; + + result.a = (m[15] * c.r); + result.a += (m[16] * c.g); + result.a += (m[17] * c.b); + result.a += (m[18] * c.a); + result.a += m[19]; + + vec3 rgb = mix(c.rgb, result.rgb, uAlpha); + + // Premultiply alpha again. + rgb *= result.a; + + gl_FragColor = vec4(rgb, result.a); +} +`;class zf extends Vs{constructor(){const e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(Eb,fA,e),this.alpha=1}_loadMatrix(e,t=!1){let s=e;t&&(this._multiply(s,this.uniforms.m,e),s=this._colorMatrix(s)),this.uniforms.m=s}_multiply(e,t,s){return e[0]=t[0]*s[0]+t[1]*s[5]+t[2]*s[10]+t[3]*s[15],e[1]=t[0]*s[1]+t[1]*s[6]+t[2]*s[11]+t[3]*s[16],e[2]=t[0]*s[2]+t[1]*s[7]+t[2]*s[12]+t[3]*s[17],e[3]=t[0]*s[3]+t[1]*s[8]+t[2]*s[13]+t[3]*s[18],e[4]=t[0]*s[4]+t[1]*s[9]+t[2]*s[14]+t[3]*s[19]+t[4],e[5]=t[5]*s[0]+t[6]*s[5]+t[7]*s[10]+t[8]*s[15],e[6]=t[5]*s[1]+t[6]*s[6]+t[7]*s[11]+t[8]*s[16],e[7]=t[5]*s[2]+t[6]*s[7]+t[7]*s[12]+t[8]*s[17],e[8]=t[5]*s[3]+t[6]*s[8]+t[7]*s[13]+t[8]*s[18],e[9]=t[5]*s[4]+t[6]*s[9]+t[7]*s[14]+t[8]*s[19]+t[9],e[10]=t[10]*s[0]+t[11]*s[5]+t[12]*s[10]+t[13]*s[15],e[11]=t[10]*s[1]+t[11]*s[6]+t[12]*s[11]+t[13]*s[16],e[12]=t[10]*s[2]+t[11]*s[7]+t[12]*s[12]+t[13]*s[17],e[13]=t[10]*s[3]+t[11]*s[8]+t[12]*s[13]+t[13]*s[18],e[14]=t[10]*s[4]+t[11]*s[9]+t[12]*s[14]+t[13]*s[19]+t[14],e[15]=t[15]*s[0]+t[16]*s[5]+t[17]*s[10]+t[18]*s[15],e[16]=t[15]*s[1]+t[16]*s[6]+t[17]*s[11]+t[18]*s[16],e[17]=t[15]*s[2]+t[16]*s[7]+t[17]*s[12]+t[18]*s[17],e[18]=t[15]*s[3]+t[16]*s[8]+t[17]*s[13]+t[18]*s[18],e[19]=t[15]*s[4]+t[16]*s[9]+t[17]*s[14]+t[18]*s[19]+t[19],e}_colorMatrix(e){const t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){const s=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(s,t)}tint(e,t){const[s,n,r]=Ct.shared.setValue(e).toArray(),o=[s,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0];this._loadMatrix(o,t)}greyscale(e,t){const s=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(s,t)}blackAndWhite(e){const t=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(t,e)}hue(e,t){e=(e||0)/180*Math.PI;const s=Math.cos(e),n=Math.sin(e),r=Math.sqrt,o=1/3,a=r(o),c=s+(1-s)*o,l=o*(1-s)-a*n,h=o*(1-s)+a*n,u=o*(1-s)+a*n,d=s+o*(1-s),f=o*(1-s)-a*n,p=o*(1-s)-a*n,m=o*(1-s)+a*n,g=s+o*(1-s),v=[c,l,h,0,0,u,d,f,0,0,p,m,g,0,0,0,0,0,1,0];this._loadMatrix(v,t)}contrast(e,t){const s=(e||0)+1,n=-.5*(s-1),r=[s,0,0,0,n,0,s,0,0,n,0,0,s,0,n,0,0,0,1,0];this._loadMatrix(r,t)}saturate(e=0,t){const s=e*2/3+1,n=(s-1)*-.5,r=[s,n,n,0,0,n,s,n,0,0,n,n,s,0,0,0,0,0,1,0];this._loadMatrix(r,t)}desaturate(){this.saturate(-1)}negative(e){const t=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(t,e)}sepia(e){const t=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(t,e)}technicolor(e){const t=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(t,e)}polaroid(e){const t=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(t,e)}toBGR(e){const t=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(t,e)}kodachrome(e){const t=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(t,e)}browni(e){const t=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(t,e)}vintage(e){const t=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(t,e)}colorTone(e,t,s,n,r){e=e||.2,t=t||.15,s=s||16770432,n=n||3375104;const o=Ct.shared,[a,c,l]=o.setValue(s).toArray(),[h,u,d]=o.setValue(n).toArray(),f=[.3,.59,.11,0,0,a,c,l,e,0,h,u,d,t,0,a-h,c-u,l-d,0,0];this._loadMatrix(f,r)}night(e,t){e=e||.1;const s=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(s,t)}predator(e,t){const s=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(s,t)}lsd(e){const t=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(t,e)}reset(){const e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)}get matrix(){return this.uniforms.m}set matrix(e){this.uniforms.m=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}zf.prototype.grayscale=zf.prototype.greyscale;var mA=`varying vec2 vFilterCoord; +varying vec2 vTextureCoord; + +uniform vec2 scale; +uniform mat2 rotation; +uniform sampler2D uSampler; +uniform sampler2D mapSampler; + +uniform highp vec4 inputSize; +uniform vec4 inputClamp; + +void main(void) +{ + vec4 map = texture2D(mapSampler, vFilterCoord); + + map -= 0.5; + map.xy = scale * inputSize.zw * (rotation * map.xy); + + gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw)); +} +`,pA=`attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; +uniform mat3 filterMatrix; + +varying vec2 vTextureCoord; +varying vec2 vFilterCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aVertexPosition * (outputFrame.zw * inputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); + vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy; +} +`;class gA extends Vs{constructor(e,t){const s=new Ot;e.renderable=!1,super(pA,mA,{mapSampler:e._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=s,t==null&&(t=20),this.scale=new gt(t,t)}apply(e,t,s,n){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const r=this.maskSprite.worldTransform,o=Math.sqrt(r.a*r.a+r.b*r.b),a=Math.sqrt(r.c*r.c+r.d*r.d);o!==0&&a!==0&&(this.uniforms.rotation[0]=r.a/o,this.uniforms.rotation[1]=r.b/o,this.uniforms.rotation[2]=r.c/a,this.uniforms.rotation[3]=r.d/a),e.applyFilter(this,t,s,n)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var vA=`varying vec2 v_rgbNW; +varying vec2 v_rgbNE; +varying vec2 v_rgbSW; +varying vec2 v_rgbSE; +varying vec2 v_rgbM; + +varying vec2 vFragCoord; +uniform sampler2D uSampler; +uniform highp vec4 inputSize; + + +/** + Basic FXAA implementation based on the code on geeks3d.com with the + modification that the texture2DLod stuff was removed since it's + unsupported by WebGL. + + -- + + From: + https://github.com/mitsuhiko/webgl-meincraft + + Copyright (c) 2011 by Armin Ronacher. + + Some rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FXAA_REDUCE_MIN +#define FXAA_REDUCE_MIN (1.0/ 128.0) +#endif +#ifndef FXAA_REDUCE_MUL +#define FXAA_REDUCE_MUL (1.0 / 8.0) +#endif +#ifndef FXAA_SPAN_MAX +#define FXAA_SPAN_MAX 8.0 +#endif + +//optimized version for mobile, where dependent +//texture reads can be a bottleneck +vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP, + vec2 v_rgbNW, vec2 v_rgbNE, + vec2 v_rgbSW, vec2 v_rgbSE, + vec2 v_rgbM) { + vec4 color; + vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; + vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; + vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; + vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; + vec4 texColor = texture2D(tex, v_rgbM); + vec3 rgbM = texColor.xyz; + vec3 luma = vec3(0.299, 0.587, 0.114); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + float lumaM = dot(rgbM, luma); + float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); + float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); + + mediump vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * + (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN); + + float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce); + dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX), + max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), + dir * rcpDirMin)) * inverseVP; + + vec3 rgbA = 0.5 * ( + texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + + texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); + vec3 rgbB = rgbA * 0.5 + 0.25 * ( + texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + + texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); + + float lumaB = dot(rgbB, luma); + if ((lumaB < lumaMin) || (lumaB > lumaMax)) + color = vec4(rgbA, texColor.a); + else + color = vec4(rgbB, texColor.a); + return color; +} + +void main() { + + vec4 color; + + color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); + + gl_FragColor = color; +} +`,yA=` +attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; + +varying vec2 v_rgbNW; +varying vec2 v_rgbNE; +varying vec2 v_rgbSW; +varying vec2 v_rgbSE; +varying vec2 v_rgbM; + +varying vec2 vFragCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +void texcoords(vec2 fragCoord, vec2 inverseVP, + out vec2 v_rgbNW, out vec2 v_rgbNE, + out vec2 v_rgbSW, out vec2 v_rgbSE, + out vec2 v_rgbM) { + v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP; + v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP; + v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP; + v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP; + v_rgbM = vec2(fragCoord * inverseVP); +} + +void main(void) { + + gl_Position = filterVertexPosition(); + + vFragCoord = aVertexPosition * outputFrame.zw; + + texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); +} +`;class xA extends Vs{constructor(){super(yA,vA)}}var bA=`precision highp float; + +varying vec2 vTextureCoord; +varying vec4 vColor; + +uniform float uNoise; +uniform float uSeed; +uniform sampler2D uSampler; + +float rand(vec2 co) +{ + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void main() +{ + vec4 color = texture2D(uSampler, vTextureCoord); + float randomValue = rand(gl_FragCoord.xy * uSeed); + float diff = (randomValue - 0.5) * uNoise; + + // Un-premultiply alpha before applying the color matrix. See issue #3539. + if (color.a > 0.0) { + color.rgb /= color.a; + } + + color.r += diff; + color.g += diff; + color.b += diff; + + // Premultiply alpha again. + color.rgb *= color.a; + + gl_FragColor = color; +} +`;class wA extends Vs{constructor(e=.5,t=Math.random()){super(Eb,bA,{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 Z0={AlphaFilter:oA,BlurFilter:dA,BlurFilterPass:Wf,ColorMatrixFilter:zf,DisplacementFilter:gA,FXAAFilter:xA,NoiseFilter:wA};Object.entries(Z0).forEach(([i,e])=>{Object.defineProperty(Z0,i,{get(){return ht("7.1.0",`filters.${i} has moved to ${i}`),e}})});class SA{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||(Ys.system.add(this.tickerUpdate,this,lo.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Ys.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._deltaTimes.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 s=0,n=t.length;s=0;n--)if(e.currentTarget=s[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,s=this._allInteractiveElements){if(s.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let r=s.length-1;r>=0;r--)n.forEach(o=>{e.currentTarget=s[r],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let s=0;s=0;u--){const d=h[u],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,s,n,r,o||r(e,s));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,s)&&n(e,s)?l?[e]:[]:null}hitTestRecursive(e,t,s,n,r){if(this._interactivePrune(e)||r(e,s))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(ar.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,s,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,s)?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 s;if(e.hitArea&&(e.worldTransform.applyInverse(t,Vd),!e.hitArea.contains(Vd.x,Vd.y)))return!0;if(e._mask){const n=e._mask.isMaskData?e._mask.maskObject:e._mask;if(n&&!((s=n.containsPoint)!=null&&s.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 s=`on${t}`;(o=(r=e.currentTarget)[s])==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 Si)){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 s=this.trackingData(e.pointerId);s.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){var c,l;if(!(e instanceof Si)){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 s=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"),s&&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),s&&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"),s&&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),s&&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")),s&&(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 Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),s=this.createPointerEvent(e),n=s.pointerType==="mouse"||s.pointerType==="pen";this.dispatchEvent(s,"pointerover"),n&&this.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(this.cursor=(o=s.target)==null?void 0:o.cursor);const r=this.clonePointerEvent(s,"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=s.composedPath(),this.freeEvent(s),this.freeEvent(r)}mapPointerOut(e){if(!(e instanceof Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const s=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),r=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(r),s&&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),s&&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 Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),s=this.createPointerEvent(e);if(this.dispatchEvent(s,"pointerup"),s.pointerType==="touch")this.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const a=s.button===2;this.dispatchEvent(s,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=r;if(r&&!s.composedPath().includes(r)){let a=r;for(;a&&!s.composedPath().includes(a);){if(s.currentTarget=a,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")this.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const c=s.button===2;this.notifyTarget(s,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(s,"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(s)}mapPointerUpOutside(e){if(!(e instanceof Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),s=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(s){let r=s;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 qo)){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 s=1;s(s==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[s]=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:s}=this.renderer;this.setTargetElement(t),this.resolution=s,Kf._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 s=this.cursorStyles[e];if(s)switch(typeof s){case"string":t&&(this.domElement.style.cursor=s);break;case"function":s(e);break;case"object":t&&Object.assign(this.domElement.style,s);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 s=0,n=t.length;s0&&(t=e.composedPath()[0]);const s=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 s=e;typeof s.isPrimary>"u"&&(s.isPrimary=!0),typeof s.width>"u"&&(s.width=1),typeof s.height>"u"&&(s.height=1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="mouse"),typeof s.pointerId>"u"&&(s.pointerId=CA),typeof s.pressure>"u"&&(s.pressure=.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),s.isNormalized=!0,t.push(s)}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=AA[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}};qf.extension={name:"events",type:[Pe.RendererSystem,Pe.CanvasRendererSystem]},qf.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Zf=qf;Ue.add(Zf);function J0(i){return i==="dynamic"||i==="static"}const EA={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??J0(Zf.defaultEventMode)},set interactive(i){ht("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=i,this.eventMode=i?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Zf.defaultEventMode},set eventMode(i){this._internalInteractive=J0(i),this._internalEventMode=i},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(i,e,t){const s=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;i=s?`${i}capture`:i;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(i,a,o)}),r?c.once(i,a,o):c.on(i,a,o)},removeEventListener(i,e,t){const s=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;i=s?`${i}capture`:i,e=typeof e=="function"?e:e.handleEvent,this.off(i,e,n)},dispatchEvent(i){if(!(i instanceof Cl))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return i.defaultPrevented=!1,i.path=null,i.target=this,i.manager.dispatchEvent(i),!i.defaultPrevented}};qt.mixin(EA);const IA={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};qt.mixin(IA);const RA=9,Jl=100,PA=0,kA=0,Q0=2,ev=1,FA=-1e3,OA=-1e3,LA=2;class Nb{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,(En.tablet||En.phone)&&this.createTouchHook();const t=document.createElement("div");t.style.width=`${Jl}px`,t.style.height=`${Jl}px`,t.style.position="absolute",t.style.top=`${PA}px`,t.style.left=`${kA}px`,t.style.zIndex=Q0.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=`${ev}px`,e.style.height=`${ev}px`,e.style.position="absolute",e.style.top=`${FA}px`,e.style.left=`${OA}px`,e.style.zIndex=LA.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 s=0;s 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:s}=this.renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>s&&(e.height=s-e.y)}addChild(e){let t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=`${Jl}px`,t.style.height=`${Jl}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=Q0.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:s}=e.target,n=this.renderer.events.rootBoundary,r=Object.assign(new Cl(n),{target:s});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===RA&&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}}Nb.extension={name:"accessibility",type:[Pe.RendererPlugin,Pe.CanvasRendererPlugin]};Ue.add(Nb);const Db=class Jf{constructor(e){this.stage=new ms,e=Object.assign({forceCanvas:!1},e),this.renderer=j2(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 s=Jf._plugins.slice(0);s.reverse(),s.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};Db._plugins=[];let Ub=Db;Ue.handleByList(Pe.Application,Ub._plugins);class $b{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,s;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:r}=this._resizeTo;t=n,s=r}this.renderer.resize(t,s),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}}$b.extension=Pe.Application;Ue.add($b);const tv={loader:Pe.LoadParser,resolver:Pe.ResolveParser,cache:Pe.CacheParser,detection:Pe.DetectionParser};Ue.handle(Pe.Asset,i=>{const e=i.ref;Object.entries(tv).filter(([t])=>!!e[t]).forEach(([t,s])=>Ue.add(Object.assign(e[t],{extension:e[t].extension??s})))},i=>{const e=i.ref;Object.keys(tv).filter(t=>!!e[t]).forEach(t=>Ue.remove(e[t]))});class BA{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 s=0;s(Array.isArray(i)||(i=[i]),e?i.map(s=>typeof s=="string"||t?e(s):s):i),nh=(i,e)=>{const t=e.split("?")[1];return t&&(i+=`?${t}`),i};function Xb(i,e,t,s,n){const r=e[t];for(let o=0;o{const o=r.substring(1,r.length-1).split(",");n.push(o)}),Xb(i,n,0,t,s)}else s.push(i);return s}const rh=i=>!Array.isArray(i);class DA{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 s=Ti(e);let n;for(let a=0;a{n[a]=t}));const r=Object.keys(n),o={cacheKeys:r,keys:s};if(s.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;s.forEach(c=>{a.baseTexture!==ze.EMPTY.baseTexture&&Qe.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(s=>{this._cache.delete(s)}),t.keys.forEach(s=>{this._cacheMap.delete(s)})}get parsers(){return this._parsers}}const Hr=new DA;class UA{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,t,s)=>(this._parsersValidated=!1,e[t]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,t){const s={promise:null,parser:null};return s.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=Jt.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(++s/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=Ti(e,s=>({alias:[s],src:s})).map(async s=>{var o,a;const n=Jt.toAbsolute(s.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,s,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 ii=(i=>(i[i.Low=0]="Low",i[i.Normal=1]="Normal",i[i.High=2]="High",i))(ii||{});const $A=".json",XA="application/json",VA={extension:{type:Pe.LoadParser,priority:ii.Low},name:"loadJson",test(i){return fa(i,XA)||qs(i,$A)},async load(i){return await(await Oe.ADAPTER.fetch(i)).json()}};Ue.add(VA);const YA=".txt",GA="text/plain",jA={name:"loadTxt",extension:{type:Pe.LoadParser,priority:ii.Low},test(i){return fa(i,GA)||qs(i,YA)},async load(i){return await(await Oe.ADAPTER.fetch(i)).text()}};Ue.add(jA);const HA=["normal","bold","100","200","300","400","500","600","700","800","900"],WA=[".ttf",".otf",".woff",".woff2"],zA=["font/ttf","font/otf","font/woff","font/woff2"],qA=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function KA(i){const e=Jt.extname(i),t=Jt.basename(i,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1));let s=t.length>0;for(const r of t)if(!r.match(qA)){s=!1;break}let n=t.join(" ");return s||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const ZA=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function JA(i){return ZA.test(i)?i:encodeURI(i)}const QA={extension:{type:Pe.LoadParser,priority:ii.Low},name:"loadWebFont",test(i){return fa(i,zA)||qs(i,WA)},async load(i,e){var s,n,r;const t=Oe.ADAPTER.getFontFaceSet();if(t){const o=[],a=((s=e.data)==null?void 0:s.family)??KA(i),c=((r=(n=e.data)==null?void 0:n.weights)==null?void 0:r.filter(h=>HA.includes(h)))??["normal"],l=e.data??{};for(let h=0;hOe.ADAPTER.getFontFaceSet().delete(e))}};Ue.add(QA);const eE=`(function() { + "use strict"; + const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; + async function checkImageBitmap() { + try { + if (typeof createImageBitmap != "function") + return !1; + const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob); + return imageBitmap.width === 1 && imageBitmap.height === 1; + } catch { + return !1; + } + } + checkImageBitmap().then((result) => { + self.postMessage(result); + }); +})(); +`;let Ko=null,Qf=class{constructor(){Ko||(Ko=URL.createObjectURL(new Blob([eE],{type:"application/javascript"}))),this.worker=new Worker(Ko)}};Qf.revokeObjectURL=function(){Ko&&(URL.revokeObjectURL(Ko),Ko=null)};const tE=`(function() { + "use strict"; + async function loadImageBitmap(url) { + const response = await fetch(url); + if (!response.ok) + throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`); + const imageBlob = await response.blob(); + return await createImageBitmap(imageBlob); + } + self.onmessage = async (event) => { + try { + const imageBitmap = await loadImageBitmap(event.data.data[0]); + self.postMessage({ + data: imageBitmap, + uuid: event.data.uuid, + id: event.data.id + }, [imageBitmap]); + } catch (e) { + self.postMessage({ + error: e, + uuid: event.data.uuid, + id: event.data.id + }); + } + }; +})(); +`;let Zo=null;class Vb{constructor(){Zo||(Zo=URL.createObjectURL(new Blob([tE],{type:"application/javascript"}))),this.worker=new Worker(Zo)}}Vb.revokeObjectURL=function(){Zo&&(URL.revokeObjectURL(Zo),Zo=null)};let sv=0,Yd;class sE{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 Qf;t.addEventListener("message",s=>{t.terminate(),Qf.revokeObjectURL(),e(s.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Yd===void 0&&(Yd=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 s=new Promise((n,r)=>{this.queue.push({id:e,arguments:t,resolve:n,reject:r})});return this.next(),s}next(){if(!this.queue.length)return;const e=this.getWorker();if(!e)return;const t=this.queue.pop(),s=t.id;this.resolveHash[sv]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:sv++,id:s})}}const iv=new sE;function Al(i,e,t){i.resource.internal=!0;const s=new ze(i),n=()=>{delete e.promiseCache[t],Hr.has(t)&&Hr.remove(t)};return s.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())}),s.once("destroyed",()=>{i.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())}),s}const iE=[".jpeg",".jpg",".png",".webp",".avif"],nE=["image/jpeg","image/png","image/webp","image/avif"];async function rE(i){const e=await Oe.ADAPTER.fetch(i);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${i}: ${e.status} ${e.statusText}`);const t=await e.blob();return await createImageBitmap(t)}const ou={name:"loadTextures",extension:{type:Pe.LoadParser,priority:ii.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(i){return fa(i,nE)||qs(i,iE)},async load(i,e,t){var a;const s=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;s?this.config.preferWorkers&&await iv.isImageBitmapSupported()?n=await iv.loadImageBitmap(i):n=await rE(i):n=await new Promise((c,l)=>{const h=new Image;h.crossOrigin=this.config.crossOrigin,h.src=i,h.complete?c(h):(h.onload=()=>c(h),h.onerror=u=>l(u))});const r={...e.data};r.resolution??(r.resolution=Vn(i)),s&&((a=r.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(r.resourceOptions={...r.resourceOptions},r.resourceOptions.ownsImageBitmap=!0);const o=new Qe(n,r);return o.resource.src=i,Al(o,t,i)},unload(i){i.destroy(!0)}};Ue.add(ou);const oE=".svg",aE="image/svg+xml",lE={extension:{type:Pe.LoadParser,priority:ii.High},name:"loadSVG",test(i){return fa(i,aE)||qs(i,oE)},async testParse(i){return Yf.test(i)},async parse(i,e,t){var r;const s=new Yf(i,(r=e==null?void 0:e.data)==null?void 0:r.resourceOptions);await s.load();const n=new Qe(s,{resolution:Vn(i),...e==null?void 0:e.data});return n.resource.src=e.src,Al(n,t,e.src)},async load(i,e){return(await Oe.ADAPTER.fetch(i)).text()},unload:ou.unload};Ue.add(lE);const cE=[".mp4",".m4v",".webm",".ogv"],hE=["video/mp4","video/webm","video/ogg"],uE={name:"loadVideo",extension:{type:Pe.LoadParser,priority:ii.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(i){return fa(i,hE)||qs(i,cE)},async load(i,e,t){var o;let s;const n=await(await Oe.ADAPTER.fetch(i)).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 Ob(r,a);await c.load();const l=new Qe(c,{alphaMode:await yC(),resolution:Vn(i),...e==null?void 0:e.data});l.resource.src=i,s=Al(l,t,i),s.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(a){throw URL.revokeObjectURL(r),a}return s},unload(i){i.destroy(!0)}};Ue.add(uE);class dE{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(s=>`${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`).join("&")}}getAlias(e){const{alias:t,name:s,src:n,srcs:r}=e;return Ti(t||s||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 s=[];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);s.push(c),a=[o,c]}else{const c=o.map(l=>this._createBundleAssetId(e,l));s.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]})}s.push(...r)}),this._bundles[e]=s}add(e,t,s,n,r){const o=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(ht("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:s,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`)},Ti(o).forEach(c=>{const{src:l,srcs:h}=c;let{data:u,format:d,loadParser:f}=c;const p=Ti(l||h).map(v=>typeof v=="string"?NA(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 M=0;M{this._assetMap[v]=g})})}resolveBundle(e){const t=rh(e);e=Ti(e);const s={};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}s[n]=a}}),t?s[e[0]]:s}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const s={};for(const n in t)s[n]=t[n].src;return s}return t.src}resolve(e){const t=rh(e);e=Ti(e);const s={};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},{});s[n]=this._resolverHash[n]}),t?s[e[0]]:s}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;tr.params.format.includes(s.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:s,data:n,loadParser:r,format:o}=t;return(this._basePath||this._rootPath)&&(e.src=Jt.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=s??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??Jt.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class fE{constructor(){this._detections=[],this._initialized=!1,this.resolver=new dE,this.loader=new UA,this.cache=Hr,this._backgroundLoader=new BA(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,s=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:s}}),e.preferences&&this.setPreferences(e.preferences)}add(e,t,s,n,r){this.resolver.add(e,t,s,n,r)}async load(e,t){this._initialized||await this.init();const s=rh(e),n=Ti(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 s?o[n[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t)}async loadBundle(e,t){this._initialized||await this.init();let s=!1;typeof e=="string"&&(s=!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),s?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(s=>{this._backgroundLoader.add(Object.values(s))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e=="string")return Hr.get(e);const t={};for(let s=0;s{const l=r[a.src],h=[a.src];a.alias&&h.push(...a.alias),o[n[c]]=l,Hr.set(h,l)}),o}async unload(e){this._initialized||await this.init();const t=Ti(e).map(n=>typeof n!="string"?n.src:n),s=this.resolver.resolve(t);await this._unloadFromResolved(s)}async unloadBundle(e){this._initialized||await this.init(),e=Ti(e);const t=this.resolver.resolveBundle(e),s=Object.keys(t).map(n=>this._unloadFromResolved(t[n]));await Promise.all(s)}async _unloadFromResolved(e){const t=Object.values(e);t.forEach(s=>{Hr.remove(s.src)}),await this.loader.unload(t)}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const s of e.detections)e.skipDetections||await s.test()?t=await s.add(t):e.skipDetections||(t=await s.remove(t));return t=t.filter((s,n)=>t.indexOf(s)===n),t}get detections(){return this._detections}get preferWorkers(){return ou.config.preferWorkers}set preferWorkers(e){ht("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(s=>s in e).forEach(s=>{t.config[s]=e[s]})})}}const nn=new fE;Ue.handleByList(Pe.LoadParser,nn.loader.parsers).handleByList(Pe.ResolveParser,nn.resolver.parsers).handleByList(Pe.CacheParser,nn.cache.parsers).handleByList(Pe.DetectionParser,nn.detections);const mE={extension:Pe.CacheParser,test:i=>Array.isArray(i)&&i.every(e=>e instanceof ze),getCacheableAssets:(i,e)=>{const t={};return i.forEach(s=>{e.forEach((n,r)=>{t[s+(r===0?"":r+1)]=n})}),t}};Ue.add(mE);async function Yb(i){if("Image"in globalThis)return new Promise(e=>{const t=new Image;t.onload=()=>{e(!0)},t.onerror=()=>{e(!1)},t.src=i});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(i)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}const pE={extension:{type:Pe.DetectionParser,priority:1},test:async()=>Yb("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async i=>[...i,"avif"],remove:async i=>i.filter(e=>e!=="avif")};Ue.add(pE);const gE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>Yb("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async i=>[...i,"webp"],remove:async i=>i.filter(e=>e!=="webp")};Ue.add(gE);const nv=["png","jpg","jpeg"],vE={extension:{type:Pe.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async i=>[...i,...nv],remove:async i=>i.filter(e=>!nv.includes(e))};Ue.add(vE);const yE="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function ap(i){return yE?!1:document.createElement("video").canPlayType(i)!==""}const xE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>ap("video/webm"),add:async i=>[...i,"webm"],remove:async i=>i.filter(e=>e!=="webm")};Ue.add(xE);const bE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>ap("video/mp4"),add:async i=>[...i,"mp4","m4v"],remove:async i=>i.filter(e=>e!=="mp4"&&e!=="m4v")};Ue.add(bE);const wE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>ap("video/ogg"),add:async i=>[...i,"ogv"],remove:async i=>i.filter(e=>e!=="ogv")};Ue.add(wE);const SE={extension:Pe.ResolveParser,test:ou.test,parse:i=>{var e;return{resolution:parseFloat(((e=Oe.RETINA_PREFIX.exec(i))==null?void 0:e[1])??"1"),format:Jt.extname(i).slice(1),src:i}}};Ue.add(SE);var bs=(i=>(i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",i[i.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",i[i.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",i[i.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",i[i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",i[i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",i[i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",i))(bs||{});const oh={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 $i,Oo;function rv(){Oo={bptc:$i.getExtension("EXT_texture_compression_bptc"),astc:$i.getExtension("WEBGL_compressed_texture_astc"),etc:$i.getExtension("WEBGL_compressed_texture_etc"),s3tc:$i.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:$i.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:$i.getExtension("WEBGL_compressed_texture_pvrtc")||$i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:$i.getExtension("WEBGL_compressed_texture_etc1"),atc:$i.getExtension("WEBGL_compressed_texture_atc")}}const ME={extension:{type:Pe.DetectionParser,priority:2},test:async()=>{const i=Oe.ADAPTER.createCanvas().getContext("webgl");return i?($i=i,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async i=>{Oo||rv();const e=[];for(const t in Oo)Oo[t]&&e.push(t);return[...e,...i]},remove:async i=>(Oo||rv(),i.filter(e=>!(e in Oo)))};Ue.add(ME);class TE extends tu{constructor(e,t={width:1,height:1,autoLoad:!0}){let s,n;typeof e=="string"?(s=e,n=new Uint8Array):(s=null,n=e),super(n,t),this.origin=s,this.buffer=n?new Rf(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 Rf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class io extends TE{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=io._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||io._createLevelBuffers(e instanceof Uint8Array?e:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,t,s){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,s,n,r,o,a){const c=new Array(s);let l=e.byteOffset,h=o,u=a,d=h+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*oh[t];for(let m=0;m1?h:d,levelHeight:s>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*oh[t];return c}}const Gd=4,Ql=124,_E=32,ov=20,CE=542327876,ec={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},AE={FOURCC:2},tc={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},EE=1,IE=2,RE=4,PE=64,kE=512,FE=131072,OE=827611204,LE=861165636,BE=894720068,NE=808540228,DE=4,UE={[OE]:bs.COMPRESSED_RGBA_S3TC_DXT1_EXT,[LE]:bs.COMPRESSED_RGBA_S3TC_DXT3_EXT,[BE]:bs.COMPRESSED_RGBA_S3TC_DXT5_EXT},$E={70:bs.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:bs.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:bs.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:bs.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:bs.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:bs.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:bs.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:bs.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:bs.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:bs.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:bs.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:bs.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:bs.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function XE(i){const e=new Uint32Array(i);if(e[0]!==CE)throw new Error("Invalid DDS file magic word");const t=new Uint32Array(i,0,Ql/Uint32Array.BYTES_PER_ELEMENT),s=t[ec.HEIGHT],n=t[ec.WIDTH],r=t[ec.MIPMAP_COUNT],o=new Uint32Array(i,ec.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,_E/Uint32Array.BYTES_PER_ELEMENT),a=o[EE];if(a&RE){const c=o[AE.FOURCC];if(c!==NE){const x=UE[c],y=Gd+Ql,M=new Uint8Array(i,y);return[new io(M,{format:x,width:n,height:s,levels:r})]}const l=Gd+Ql,h=new Uint32Array(e.buffer,l,ov/Uint32Array.BYTES_PER_ELEMENT),u=h[tc.DXGI_FORMAT],d=h[tc.RESOURCE_DIMENSION],f=h[tc.MISC_FLAG],p=h[tc.ARRAY_SIZE],m=$E[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===DE)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=Gd+Ql+ov;if(p===1)g.push(new Uint8Array(i,v));else{const x=oh[m];let y=0,M=n,_=s;for(let b=0;b>>1,_=_>>>1}let w=v;for(let b=0;bnew io(x,{format:m,width:n,height:s,levels:r}))}throw a&PE?new Error("DDSParser does not support uncompressed texture data."):a&kE?new Error("DDSParser does not supported YUV uncompressed texture data."):a&FE?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&IE?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 av=[171,75,84,88,32,49,49,187,13,10,26,10],VE=67305985,xi={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},em=64,lv={[De.UNSIGNED_BYTE]:1,[De.UNSIGNED_SHORT]:2,[De.INT]:4,[De.UNSIGNED_INT]:4,[De.FLOAT]:4,[De.HALF_FLOAT]:8},YE={[_e.RGBA]:4,[_e.RGB]:3,[_e.RG]:2,[_e.RED]:1,[_e.LUMINANCE]:1,[_e.LUMINANCE_ALPHA]:2,[_e.ALPHA]:1},GE={[De.UNSIGNED_SHORT_4_4_4_4]:2,[De.UNSIGNED_SHORT_5_5_5_1]:2,[De.UNSIGNED_SHORT_5_6_5]:2};function jE(i,e,t=!1){const s=new DataView(e);if(!HE(i,s))return null;const n=s.getUint32(xi.ENDIANNESS,!0)===VE,r=s.getUint32(xi.GL_TYPE,n),o=s.getUint32(xi.GL_FORMAT,n),a=s.getUint32(xi.GL_INTERNAL_FORMAT,n),c=s.getUint32(xi.PIXEL_WIDTH,n),l=s.getUint32(xi.PIXEL_HEIGHT,n)||1,h=s.getUint32(xi.PIXEL_DEPTH,n)||1,u=s.getUint32(xi.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=s.getUint32(xi.NUMBER_OF_FACES,n),f=s.getUint32(xi.NUMBER_OF_MIPMAP_LEVELS,n),p=s.getUint32(xi.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 M=c*l;r===0&&(M=v*x);let _;if(r!==0?lv[r]?_=lv[r]*YE[o]:_=GE[r]:_=oh[a],_===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const w=t?zE(s,p,n):null;let b=M*_,C=c,R=l,F=v,I=x,k=em+p;for(let B=0;B1||r!==0?C:F,levelHeight:f>1||r!==0?R:I,levelBuffer:new Uint8Array(e,$,b)},$+=b}k+=D+4,k=k%4!==0?k+4-k%4:k,C=C>>1||1,R=R>>1||1,F=C+m-1&-4,I=R+g-1&-4,b=F*I*_}return r!==0?{uncompressed:y.map(B=>{let D=B[0].levelBuffer,$=!1;return r===De.FLOAT?D=new Float32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4):r===De.UNSIGNED_INT?($=!0,D=new Uint32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)):r===De.INT&&($=!0,D=new Int32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)),{resource:new tu(D,{width:B[0].levelWidth,height:B[0].levelHeight}),type:r,format:$?WE(o):o}}),kvData:w}:{compressed:y.map(B=>new io(null,{format:a,width:c,height:l,levels:f,levelBuffers:B})),kvData:w}}function HE(i,e){for(let t=0;te-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let c=0;for(;c{const o=new Qe(r,{mipmap:gi.OFF,alphaMode:xs.NO_PREMULTIPLIED_ALPHA,resolution:Vn(i),...e.data});return Al(o,t,i)});return n.length===1?n[0]:n},unload(i){Array.isArray(i)?i.forEach(e=>e.destroy(!0)):i.destroy(!0)}};Ue.add(qE);const KE={extension:{type:Pe.LoadParser,priority:ii.High},name:"loadKTX",test(i){return qs(i,".ktx")},async load(i,e,t){const s=await(await Oe.ADAPTER.fetch(i)).arrayBuffer(),{compressed:n,uncompressed:r,kvData:o}=jE(i,s),a=n??r,c={mipmap:gi.OFF,alphaMode:xs.NO_PREMULTIPLIED_ALPHA,resolution:Vn(i),...e.data},l=a.map(h=>{a===r&&Object.assign(c,{type:h.type,format:h.format});const u=h.resource??h,d=new Qe(u,c);return d.ktxKeyValueData=o,Al(d,t,i)});return l.length===1?l[0]:l},unload(i){Array.isArray(i)?i.forEach(e=>e.destroy(!0)):i.destroy(!0)}};Ue.add(KE);const ZE=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],JE={extension:Pe.ResolveParser,test:i=>{const e=Jt.extname(i).slice(1);return["basis","ktx","dds"].includes(e)},parse:i=>{var s,n;const e=i.split("."),t=e.pop();if(["ktx","dds"].includes(t)){const r=e.pop();if(ZE.includes(r))return{resolution:parseFloat(((s=Oe.RETINA_PREFIX.exec(i))==null?void 0:s[1])??"1"),format:r,src:i}}return{resolution:parseFloat(((n=Oe.RETINA_PREFIX.exec(i))==null?void 0:n[1])??"1"),format:t,src:i}}};Ue.add(JE);const sc=new ot,QE=4,Gb=class $a{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,s,n){const r=new Image;return r.src=await this.base64(e,t,s,n),r}async base64(e,t,s,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,s)});if(r.toDataURL!==void 0)return r.toDataURL(t,s);if(r.convertToBlob!==void 0){const o=await r.convertToBlob({type:t,quality:s});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:s,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);o&&$a._flipY(s,n,r),a&&$a._unpremultiplyAlpha(s);const c=new OC(n,r,1),l=new ImageData(new Uint8ClampedArray(s.buffer),n,r);return c.context.putImageData(l,0,0),c.canvas}pixels(e,t){const{pixels:s,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);return o&&$a._flipY(s,n,r),a&&$a._unpremultiplyAlpha(s),s}_rawPixels(e,t){const s=this.renderer;if(!s)throw new Error("The Extract has already been destroyed");let n,r=!1,o=!1,a,c=!1;e&&(e instanceof mo?a=e:(a=s.generateTexture(e,{region:t,resolution:s.resolution,multisample:s.multisample}),c=!0,t&&(sc.width=t.width,sc.height=t.height,t=sc)));const l=s.gl;if(a){if(n=a.baseTexture.resolution,t=t??a.frame,r=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===_e.RGBA,!c){s.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[s.CONTEXT_UID];f.blitFramebuffer&&s.framebuffer.bind(f.blitFramebuffer)}}else n=s.resolution,t||(t=sc,t.width=s.width/n,t.height=s.height/n),r=!0,o=this._rendererPremultipliedAlpha,s.renderTexture.bind();const h=Math.max(Math.round(t.width*n),1),u=Math.max(Math.round(t.height*n),1),d=new Uint8Array(QE*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,s){const n=t<<2,r=s>>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]=s+r,e[2]=e[4]=t-n,e[5]=e[7]=s-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=s+m;if(e[h++]=g,e[h++]=x,e[--u]=x,e[--u]=v,r){const y=s-m;e[d++]=v,e[d++]=y,e[--f]=y,e[--f]=g}}for(let p=1;p0||e&&s<=0){const n=t/2;for(let r=n+n%2;r=6){cv(t,!1);const o=[];for(let l=0;l=0&&r>=0&&o.push(t,s,t+n,s,t+n,s+r,t,s+r)},triangulate(i,e){const t=i.points,s=e.points;if(t.length===0)return;const n=s.length/2;s.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)}},sI={build(i){ah.build(i)},triangulate(i,e){ah.triangulate(i,e)}};var ci=(i=>(i.MITER="miter",i.BEVEL="bevel",i.ROUND="round",i))(ci||{}),dr=(i=>(i.BUTT="butt",i.ROUND="round",i.SQUARE="square",i))(dr||{});const na={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(i,e=20){if(!this.adaptive||!i||isNaN(i))return e;let t=Math.ceil(i/this.maxLength);return tthis.maxSegments&&(t=this.maxSegments),t}};class hv{static curveTo(e,t,s,n,r,o){const a=o[o.length-2],c=o[o.length-1]-t,l=a-e,h=n-t,u=s-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,M=g*u+v*l,_=g*h+v*c,w=l*(v+x),b=c*(v+x),C=u*(g+y),R=h*(g+y),F=Math.atan2(b-_,w-M),I=Math.atan2(R-_,C-M);return{cx:M+e,cy:_+t,radius:r,startAngle:F,endAngle:I,anticlockwise:l*h>u*c}}static arc(e,t,s,n,r,o,a,c,l){const h=a-o,u=na._segmentsCount(Math.abs(h)*r,Math.ceil(Math.abs(h)/Jc)*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,M=d+o+f*y,_=Math.cos(M),w=-Math.sin(M);l.push((p*_+m*w)*r+s,(p*-w+m*_)*r+n)}}}class iI{constructor(){this.reset()}begin(e,t,s){this.reset(),this.style=e,this.start=t,this.attribStart=s}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 lp{static curveLength(e,t,s,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,M=e,_=t;for(let w=1;w<=10;++w)h=w/10,u=h*h,d=u*h,f=1-h,p=f*f,m=p*f,g=m*e+3*p*h*s+3*f*u*r+d*a,v=m*t+3*p*h*n+3*f*u*o+d*c,x=M-g,y=_-v,M=g,_=v,l+=Math.sqrt(x*x+y*y);return l}static curveTo(e,t,s,n,r,o,a){const c=a[a.length-2],l=a[a.length-1];a.length-=2;const h=na._segmentsCount(lp.curveLength(c,l,e,t,s,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*s+m*r,f*l+3*d*v*t+3*u*p*n+m*o)}}function uv(i,e,t,s,n,r,o,a){const c=i-t*n,l=e-s*n,h=i+t*r,u=e+s*r;let d,f;o?(d=s,f=-t):(d=-s,f=t);const p=c+d,m=l+f,g=h+d,v=u+f;return a.push(p,m,g,v),2}function Br(i,e,t,s,n,r,o,a){const c=t-i,l=s-e;let h=Math.atan2(c,l),u=Math.atan2(n-i,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(i,e,t,s);for(let x=1,y=d;x=0&&(r.join===ci.ROUND?d+=Br(y,M,y-b*B,M-C*B,y-R*B,M-F*B,h,!1)+4:d+=2,h.push(y-R*D,M-F*D,y+R*B,M+F*B));continue}const q=(-b+v)*(-C+M)-(-b+y)*(-C+x),ie=(-R+_)*(-F+M)-(-R+y)*(-F+w),re=(A*ie-O*q)/V,pe=(L*q-P*ie)/V,ge=(re-y)*(re-y)+(pe-M)*(pe-M),he=y+(re-y)*B,fe=M+(pe-M)*B,Y=y-(re-y)*D,W=M-(pe-M)*D,j=Math.min(A*A+P*P,O*O+L*L),G=H?B:D,z=j+G*G*m,se=ge<=z;let ue=r.join;if(ue===ci.MITER&&ge/m>g&&(ue=ci.BEVEL),se)switch(ue){case ci.MITER:{h.push(he,fe,Y,W);break}case ci.BEVEL:{H?h.push(he,fe,y+b*D,M+C*D,he,fe,y+R*D,M+F*D):h.push(y-b*B,M-C*B,Y,W,y-R*B,M-F*B,Y,W),d+=2;break}case ci.ROUND:{H?(h.push(he,fe,y+b*D,M+C*D),d+=Br(y,M,y+b*D,M+C*D,y+R*D,M+F*D,h,!0)+4,h.push(he,fe,y+R*D,M+F*D)):(h.push(y-b*B,M-C*B,Y,W),d+=Br(y,M,y-b*B,M-C*B,y-R*B,M-F*B,h,!1)+4,h.push(y-R*B,M-F*B,Y,W));break}}else{switch(h.push(y-b*B,M-C*B,y+b*D,M+C*D),ue){case ci.MITER:{H?h.push(Y,W,Y,W):h.push(he,fe,he,fe),d+=2;break}case ci.ROUND:{H?d+=Br(y,M,y+b*D,M+C*D,y+R*D,M+F*D,h,!0)+2:d+=Br(y,M,y-b*B,M-C*B,y-R*B,M-F*B,h,!1)+2;break}}h.push(y-R*B,M-F*B,y+R*D,M+F*D),d+=2}}v=s[(u-2)*2],x=s[(u-2)*2+1],y=s[(u-1)*2],M=s[(u-1)*2+1],b=-(x-M),C=v-y,I=Math.sqrt(b*b+C*C),b/=I,C/=I,b*=p,C*=p,h.push(y-b*B,M-C*B,y+b*D,M+C*D),c||(r.cap===dr.ROUND?d+=Br(y-b*(B-D)*.5,M-C*(B-D)*.5,y-b*B,M-C*B,y+b*D,M+C*D,h,!1)+2:r.cap===dr.SQUARE&&(d+=uv(y,M,b,C,B,D,!1,h)));const $=e.indices,N=na.epsilon*na.epsilon;for(let X=f;X0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,s=null,n=null){const r=new lh(e,t,s,n);return this.graphicsData.push(r),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const s=new lh(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return s.lineStyle=n.lineStyle,n.holes.push(s),this.dirty++,this}destroy(){super.destroy();for(let e=0;e0&&(s=this.batches[this.batches.length-1],n=s.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=ic.pop(),n||(n=new Ff,n.texArray=new Nf),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=Ii.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(s,a,d.attribSize,d.attribStart)}Qe._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,s=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 s?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:s},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 so,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new so,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 s=this.currentPath.points,n=s[s.length-2],r=s[s.length-1];return(n!==e||r!==t)&&s.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,s,n){this._initCurve();const r=this.currentPath.points;return r.length===0&&this.moveTo(0,0),cp.curveTo(e,t,s,n,r),this}bezierCurveTo(e,t,s,n,r,o){return this._initCurve(),lp.curveTo(e,t,s,n,r,o,this.currentPath.points),this}arcTo(e,t,s,n,r){this._initCurve(e,t);const o=this.currentPath.points,a=hv.curveTo(e,t,s,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,s,n,r,o=!1){if(n===r)return this;if(!o&&r<=n?r+=Jc:o&&n<=r&&(n+=Jc),r-n===0)return this;const a=e+Math.cos(n)*s,c=t+Math.sin(n)*s,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 s?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:s},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,s,n){return this.drawShape(new ot(e,t,s,n))}drawRoundedRect(e,t,s,n,r){return this.drawShape(new nu(e,t,s,n,r))}drawCircle(e,t,s){return this.drawShape(new su(e,t,s))}drawEllipse(e,t,s,n){return this.drawShape(new iu(e,t,s,n))}drawPolygon(...e){let t,s=!0;const n=e[0];n.points?(s=n.closeStroke,t=n.points):Array.isArray(e[0])?t=e[0]:t=e;const r=new so(t);return r.closeStroke=s,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===_s.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,s=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=s,this.vertexData=new Float32Array(e.points);for(let n=0;ns&&!e.autoResize&&(o=s);let a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));const c=t[0]._texture.baseTexture,l=c.alphaMode>0;this.state.blendMode=zx(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=Ct.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}}Kb.extension={name:"particle",type:Pe.RendererPlugin};Ue.add(Kb);var lu=(i=>(i[i.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",i[i.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",i))(lu||{});const nc={willReadFrequently:!0},Xi=class Ve{static get experimentalLetterSpacingSupported(){let e=Ve._experimentalLetterSpacingSupported;if(e!==void 0){const t=Oe.ADAPTER.getCanvasRenderingContext2D().prototype;e=Ve._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,s,n,r,o,a,c,l){this.text=e,this.style=t,this.width=s,this.height=n,this.lines=r,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=c,this.fontProperties=l}static measureText(e,t,s,n=Ve._canvas){s=s??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",nc);a.font=r;const c=(s?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,s=Ve._canvas){const n=s.getContext("2d",nc);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 M=0;Mp&&(a+=Ve.addLine(o),f=!1,o="",r=0),o+=_,r+=C}}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,s,n){let r=s[e];return typeof r!="number"&&(r=Ve._measureText(e,t,n)+t,s[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 s=e[t];if(!Ve.isBreakingSpace(s))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 s="";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 i=new Intl.Segmenter;return e=>[...i.segment(e)].map(t=>t.segment)}return i=>[...i]})(),Xi.experimentalLetterSpacing=!1,Xi._fonts={},Xi._newlines=[10,13],Xi._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let ir=Xi;const fI=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Zb=class Xa{constructor(e){this.styleID=0,this.reset(),qd(this,e,e)}clone(){const e={};return qd(e,this,Xa.defaultStyle),new Xa(e)}reset(){qd(this,Xa.defaultStyle,Xa.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=zd(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=zd(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){mI(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=zd(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 s=t.length-1;s>=0;s--){let n=t[s].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!fI.includes(n)&&(n=`"${n}"`),t[s]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};Zb.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:lu.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 wr=Zb;function zd(i){const e=Ct.shared,t=s=>{const n=e.setValue(s);return n.alpha===1?n.toHex():n.toRgbaString()};return Array.isArray(i)?i.map(t):t(i)}function mI(i,e){if(!Array.isArray(i)||!Array.isArray(e)||i.length!==e.length)return!1;for(let t=0;t0&&p>m&&(g=(m+p)/2);const v=m+d,x=s.lineHeight*(f+1);let y=v;f+10}}function vI(i,e){var s;let t=!1;if((s=i==null?void 0:i._textures)!=null&&s.length){for(let n=0;n{this.queue&&this.prepareItems()},this.registerFindHook(SI),this.registerFindHook(MI),this.registerFindHook(vI),this.registerFindHook(yI),this.registerFindHook(xI),this.registerUploadHook(bI),this.registerUploadHook(wI)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,Ys.system.addOnce(this.tick,this,lo.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 s=0,n=this.uploadHooks.length;s=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&&Ys.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}};Qb.uploadsPerFrame=4;let im=Qb;Object.defineProperties(Oe,{UPLOADS_PER_FRAME:{get(){return im.uploadsPerFrame},set(i){ht("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),im.uploadsPerFrame=i}}});function t1(i,e){return e instanceof Qe?(e._glTextures[i.CONTEXT_UID]||i.texture.bind(e),!0):!1}function TI(i,e){if(!(e instanceof Ns))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:s}=t;for(let n=0;n1?ki.from(AI,CI,t):ki.from(gv,EI,t)}render(e){const t=this.renderer,s=this.quad;let n=s.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=s.uvs,n[0]=n[6]=-r,n[1]=n[3]=-o,n[2]=n[4]=1-r,n[5]=n[7]=1-o,s.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!==Ii.CLAMP:c.wrapMode===Ii.CLAMP&&(c.wrapMode=Ii.REPEAT));const f=d?this.simpleShader:this.shader,p=a.width,m=a.height,g=e._width,v=e._height;rc.set(h.a*p/g,h.b*p/v,h.c*m/g,h.d*m/v,h.tx/g,h.ty/v),rc.invert(),d?rc.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=rc.toArray(!0),f.uniforms.uColor=Ct.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(s),this.state.blendMode=zx(e.blendMode,l),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}i1.extension={name:"tilingSprite",type:Pe.RendererPlugin};Ue.add(i1);const n1=class Va{constructor(e,t,s){this.linkedSheets=[],(e instanceof Qe||e instanceof ze)&&(e={texture:e,data:t,resolutionFilename:s});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 Qe?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 s=Vn(e,null);return s===null&&(s=typeof t=="number"?t:parseFloat(t??"1")),s!==1&&this.baseTexture.setResolution(s),s}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Va.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const s=Va.BATCH_SIZE;for(;t-e{this._batchIndex*Va.BATCH_SIZE{s[n]=e}),Object.keys(e.textures).forEach(n=>{s[`${e.cachePrefix}${n}`]=e.textures[n]}),!t){const n=Jt.dirname(i[0]);e.linkedSheets.forEach((r,o)=>{Object.assign(s,r1([`${n}/${e.data.meta.related_multi_packs[o]}`],r,!0))})}return s}const PI={extension:Pe.Asset,cache:{test:i=>i instanceof vv,getCacheableAssets:(i,e)=>r1(i,e,!1)},resolver:{test:i=>{const e=i.split("?")[0].split("."),t=e.pop(),s=e.pop();return t==="json"&&RI.includes(s)},parse:i=>{var t;const e=i.split(".");return{resolution:parseFloat(((t=Oe.RETINA_PREFIX.exec(i))==null?void 0:t[1])??"1"),format:e[e.length-2],src:i}}},loader:{name:"spritesheetLoader",extension:{type:Pe.LoadParser,priority:ii.Normal},async testParse(i,e){return Jt.extname(e.src).toLowerCase()===".json"&&!!i.frames},async parse(i,e,t){var h,u;const{texture:s,imageFilename:n,cachePrefix:r}=(e==null?void 0:e.data)??{};let o=Jt.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let a;if(s&&s.baseTexture)a=s;else{const d=nh(o+(n??i.meta.image),e.src);a=(await t.load([d]))[d]}const c=new vv({texture:a.baseTexture,data:i,resolutionFilename:e.src,cachePrefix:r});await c.parse();const l=(h=i==null?void 0:i.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=nh(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(i){i.destroy(!0)}}};Ue.add(PI);class hh{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Ic{static test(e){return typeof e=="string"&&e.startsWith("info face=")}static parse(e){const t=e.match(/^[a-z]+\s+.+$/gm),s={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}s[o].push(c)}const n=new hh;return s.info.forEach(r=>n.info.push({face:r.face,size:parseInt(r.size,10)})),s.common.forEach(r=>n.common.push({lineHeight:parseInt(r.lineHeight,10)})),s.page.forEach(r=>n.page.push({id:parseInt(r.id,10),file:r.file})),s.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)})),s.kerning.forEach(r=>n.kerning.push({first:parseInt(r.first,10),second:parseInt(r.second,10),amount:parseInt(r.amount,10)})),s.distanceField.forEach(r=>n.distanceField.push({distanceRange:parseInt(r.distanceRange,10),fieldType:r.fieldType})),n}}class nm{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 hh,s=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")?nm.test(Oe.ADAPTER.parseXML(e)):!1}static parse(e){return nm.parse(Oe.ADAPTER.parseXML(e))}}const Kd=[Ic,nm,rm];function kI(i){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}')`);--w,g=null,v=null,x=null,m=0,p=0,y=0;continue}if(y=Math.max(F+C.fontProperties.descent,y),I*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}')`);--w,m+=y*o,m=Math.ceil(m),p=0,y=0;continue}OI(g,v,C,p,m,o,u);const k=Rc(C.text);f.char.push({id:k,page:M.length-1,x:p/o,y:m/o,width:I,height:F,xoffset:0,yoffset:0,xadvance:R-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),p+=(I+2*r)*o,p=Math.ceil(p)}if(!(s!=null&&s.skipKerning))for(let w=0,b=h.length;w 0.99) {\r + alpha = 1.0;\r + }\r +\r + // Gamma correction for coverage-like alpha\r + float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r + float gamma = mix(1.0, 1.0 / 2.2, luma);\r + float coverage = pow(uColor.a * alpha, gamma); \r +\r + // NPM Textures, NPM outputs\r + gl_FragColor = vec4(uColor.rgb, coverage);\r +}\r +`,NI=`// Mesh material default fragment\r +attribute vec2 aVertexPosition;\r +attribute vec2 aTextureCoord;\r +\r +uniform mat3 projectionMatrix;\r +uniform mat3 translationMatrix;\r +uniform mat3 uTextureMatrix;\r +\r +varying vec2 vTextureCoord;\r +\r +void main(void)\r +{\r + gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r +\r + vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r +}\r +`;const yv=[],xv=[],bv=[],DI=class a1 extends ms{constructor(e,t={}){super();const{align:s,tint:n,maxWidth:r,letterSpacing:o,fontName:a,fontSize:c}=Object.assign({},a1.styleDefaults,t);if(!er.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=s,this._tintColor=new Ct(n),this._font=void 0,this._fontName=a,this._fontSize=c,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new In(()=>{this.dirty=!0},this,0,0),this._roundPixels=Oe.ROUND_PIXELS,this.dirty=!0,this._resolution=Oe.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var I;const e=er.available[this._fontName],t=this.fontSize,s=t/e.size,n=new gt,r=[],o=[],a=[],c=this._text.replace(/(?:\r\n|\r)/g,` +`)||" ",l=o1(c),h=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?yv:xv;let d=null,f=0,p=0,m=0,g=-1,v=0,x=0,y=0,M=0;for(let k=0;k0&&n.x>h&&(++x,Wo(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,M=0)}const _=l[l.length-1];_!=="\r"&&_!==` +`&&(/(?:\s)/.test(_)&&(f=v),o.push(f),p=Math.max(p,f),a.push(-1));const w=[];for(let k=0;k<=m;k++){let B=0;this._align==="right"?B=p-o[k]:this._align==="center"?B=(p-o[k])/2:this._align==="justify"&&(B=a[k]<0?0:(p-o[k])/a[k]),w.push(B)}const b=r.length,C={},R=[],F=this._activePagesMeshData;u.push(...F);for(let k=0;k6*D)||B.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)}};DI.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const UI=[".xml",".fnt"],$I={extension:{type:Pe.LoadParser,priority:ii.Normal},name:"loadBitmapFont",test(i){return UI.includes(Jt.extname(i).toLowerCase())},async testParse(i){return Ic.test(i)||rm.test(i)},async parse(i,e,t){const s=Ic.test(i)?Ic.parse(i):rm.parse(i),{src:n}=e,{page:r}=s,o=[];for(let l=0;la[l]);return er.install(s,c,!0)},async load(i,e){return(await Oe.ADAPTER.fetch(i)).text()},unload(i){i.destroy()}};Ue.add($I);const om=class Lo extends wr{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new Lo(Object.keys(Lo.defaultOptions).reduce((t,s)=>({...t,[s]:e[s]}),{}))}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 Lo.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:s}=Lo;if(s[e]){const n=s[e];return this._fonts.push(n),n.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return Oe.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:Jt.basename(e,Jt.extname(e)),weight:"normal",style:"normal",display:"auto",src:n,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);s[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(s=>!this._overrides.includes(s));t.length>0&&(this._overrides.push(...t),this.styleID++)}removeOverride(...e){const t=e.filter(s=>this._overrides.includes(s));t.length>0&&(this._overrides=this._overrides.filter(s=>!t.includes(s)),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 { + font-family: "${t.family}"; + src: url('${t.dataSrc}'); + 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=RC(e)),typeof e=="number"?IC(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,s=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=`${s}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,Lo.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}=Oe.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}};om.availableFonts={},om.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 Zd=om;const oc=class Bo extends Tr{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 s=new Image,n=ze.from(s,{scaleMode:Oe.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new ot,n.trim=new ot,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=Bo.defaultMaxWidth,this.maxHeight=Bo.defaultMaxHeight,this._domElement=l,this._styleElement=h,this._svgRoot=a,this._foreignObject=c,this._foreignObject.appendChild(h),this._foreignObject.appendChild(l),this._image=s,this._loadImage=new Image,this._autoResolution=Bo.defaultAutoResolution,this._resolution=Bo.defaultResolution??Oe.RESOLUTION,this.text=e,this.style=t}measureText(e){var h,u;const{text:t,style:s,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:s.toCSS(n)}),this._styleElement.textContent=s.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),s!==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+s.padding*2,height:l+s.padding*2}}async updateText(e=!0){const{style:t,_image:s,_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();s.width=n.width=Math.ceil(Math.max(1,r)),s.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," ")}};oc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},oc.defaultMaxWidth=2024,oc.defaultMaxHeight=2024,oc.defaultAutoResolution=!0;function uh(i,e){const t=Math.max(0,Number(i)||0),s=Math.max(0,Number(e)||0);return{inner:Math.min(t,s),outer:Math.max(t,s)}}function l1(i){const e=Math.max(0,Number(i.outerRectW)||0),t=Math.max(0,Number(i.outerRectH)||0);return{innerW:Math.min(e,Math.max(0,Number(i.innerRectW)||0)),innerH:Math.min(t,Math.max(0,Number(i.innerRectH)||0)),outerW:e,outerH:t}}function XI(i,e,t,s,n){if(i==="random")return n();const r=Math.max(1,Math.round(t)),o=Math.max(0,Math.round(e))%r;return s?o/r:r<=1?.5:o/(r-1)}function wv(i,e,t,s){const n=Math.sqrt(i*i+s()*(e*e-i*i));return{x:Math.cos(t)*n,y:-Math.sin(t)*n,radialAngle:-t*180/Math.PI}}function VI(i,e){const{innerW:t,innerH:s,outerW:n,outerH:r}=l1(i),o=Math.max(0,(n-t)/2),a=Math.max(0,(r-s)/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 mt?0:i==="linear"?1-e/t:i==="inverse"?Math.min(10,t/Math.max(e,t*.1)):1}function WI(i,e,t,s,n,r,o){const a=i-t,c=e-s,l=Math.hypot(a,c);if(l<=1e-4||l>r)return{x:0,y:0};const h=n*c1(o,l,r)*10;return{x:-c/l*h,y:a/l*h}}function zI(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1)),c=e-i.x,l=t-i.y,h=(n*c+r*l)/o,u=(-r*c+n*l)/a,d=(w,b,C,R)=>{const F=C/o,I=R/a,k=Math.max(1e-4,Math.hypot(F,I)),B=F/k,D=I/k,$=n*B-r*D,N=r*B+n*D;return{x:i.x+n*w*o-r*b*a+$*.05,y:i.y+r*w*o+n*b*a+N*.05,nx:$,ny:N}};if(i.shape==="circle"){const w=Math.max(.001,i.radius),b=Math.hypot(h,u);if(b>=w)return null;const C=b>1e-4?h/b:1,R=b>1e-4?u/b:0;return d(C*w,R*w,C,R)}if(i.shape==="ellipse"){const w=Math.max(.001,i.radiusX),b=Math.max(.001,i.radiusY),C=Math.hypot(h/w,u/b);if(C>=1)return null;const R=C>1e-4?1/C:1,F=C>1e-4?h*R:w,I=C>1e-4?u*R:0,k=Math.max(1e-4,Math.hypot(F/(w*w),I/(b*b)));return d(F,I,F/(w*w)/k,I/(b*b)/k)}if(i.shape==="rect"){const w=Math.max(.001,i.width*.5),b=Math.max(.001,i.height*.5);if(Math.abs(h)>=w||Math.abs(u)>=b)return null;const C=w-Math.abs(h),R=b-Math.abs(u);if(C=0?1:-1;return d(I*w,u,I,0)}const F=u>=0?1:-1;return d(h,F*b,0,F)}const f=Math.max(3,Math.min(16,Math.round(i.sides||(i.shape==="custom"?5:6)))),p=Math.max(.001,i.width*.5),m=Math.max(.001,i.height*.5),g=Array.from({length:f},(w,b)=>{const C=Math.PI*.5+b/f*Math.PI*2;return{x:Math.cos(C)*p,y:Math.sin(C)*m}});let v=!1;for(let w=0,b=g.length-1;wu!=R.y>u&&h<(R.x-C.x)*(u-C.y)/(R.y-C.y)+C.x&&(v=!v)}if(!v)return null;let x=g[0].x,y=g[0].y,M=1/0;for(let w=0;w>>0^Math.imul(e+1,2654435761)^t)>>>0;return s^=s>>>16,s=Math.imul(s,2146121005),s^=s>>>15,s=Math.imul(s,2221713035),s^=s>>>16,(s>>>0)/4294967296}function _o(i,e,t,s,n){return i==="fixed"?e:i==="curve"?Ss(e,t,Qi(s,n)):Ss(e,t,n)}function Jd(i,e,t,s,n,r){return i==="curve"?Ss(e,t,Qi(s,n)):i==="random"?r:e}function Tv(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function Qi(i,e,t="线性"){if(!Array.isArray(i)||i.length===0)return 1;const s=[...i].sort((n,r)=>n.x-r.x);if(e<=s[0].x)return s[0].y;if(e>=s[s.length-1].x)return s[s.length-1].y;for(let n=0;n=s[n].x&&e<=s[n+1].x){const r=s[n],o=s[n+1],a=o.x-r.x||1;if(t!=="贝塞尔")return Ss(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;Tv(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(i){let e=i.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function KI(i,e,t){const s=_v(i),n=_v(e),r=Math.round(s[0]+(n[0]-s[0])*t),o=Math.round(s[1]+(n[1]-s[1])*t),a=Math.round(s[2]+(n[2]-s[2])*t);return r<<16|o<<8|a}function am(i,e){if(!Array.isArray(i)||i.length===0)return 16777215;const t=[...i].sort((s,n)=>s.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 s=0;sr.position)continue;const o=(e-n.position)/Math.max(1e-4,r.position-n.position);return KI(n.color,r.color,o)}return Jo(t[t.length-1].color)}function _v(i){let e=i.replace("#","");e.length===3&&(e=e.split("").map(s=>s+s).join(""));const t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}function ZI(){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 Pc(i){i.history.length=0,i.bones.length=0,i.mesh&&(i.mesh.visible=!1)}class JI{constructor(e){S(this,"container");this.container=e}ensureMesh(e,t,s){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:s}):(r.x=t,r.y=s);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,s){const n=Math.max(2,Math.min(16,Math.round(s))),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:Ss(p.x,m.x,v),y:Ss(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===s.resourceId)||t.trailResources[0];if(!(r!=null&&r.texture)||s.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&&s.alpha>0}update(e,t,s,n,r,o,a){if(e.sprite=a,e.boneName=s,!t.trail||!e.enabled||e.sampledLength<=0||e.sampledWidth<=0){Pc(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,Qi(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"?Qi(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"?am(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,s,n){var r;e.sprite=s,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,s,n){if(e.clear(),!t||!s.trail)return;const r=Math.max(2,Math.min(16,Math.round(s.trailGridRows))),o=Math.max(2,Math.min(32,Math.round(s.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 QI(i.texture);const s=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(s<=0)return t[Math.floor(e()*t.length)];let n=e()*s;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function sR(i,e){const t=i.trailResources.filter(r=>r.texture);if(!t.length)return i.trailResources[0]||eR();const s=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(s<=0)return t[Math.min(t.length-1,Math.floor(e*t.length))];let n=e*s;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function Cv(i,e){if(i.imageMode!=="sequence"||i.sequenceFrames.length<=1)return{index:0,visible:!0};const t=Math.min(120,Math.max(1,Number(i.sequenceFps)||30)),s=Math.max(0,Math.floor(Math.max(0,e)*t)),n=i.sequenceFrames.length-1;return i.sequencePlayback==="once-hide"?{index:Math.min(n,s),visible:s<=n}:i.sequencePlayback==="once-hold"?{index:Math.min(n,s),visible:!0}:i.sequencePlayback==="loop-reverse"?{index:n-s%i.sequenceFrames.length,visible:!0}:{index:s%i.sequenceFrames.length,visible:!0}}function ef(i,e,t){var s;return i.imageMode==="sequence"&&i.sequenceFrames.length?((s=i.sequenceFrames[Math.max(0,Math.min(i.sequenceFrames.length-1,t))])==null?void 0:s.texture)||i.texture||e:i.texture||e}function gl(){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",showShape:!0,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,renderLayerMode:"top",renderLayerSpineId:0,renderLayerSlotName:"",renderLayerSlotPosition:"above",renderLayerFollowAttachment:!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",showForceFieldShape:!0,vortex:!1,vortexStrength:10,vortexRadius:100,vortexCenterX:0,vortexCenterY:0,vortexFalloff:"linear",showVortexShape:!0,attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",showAttractionShape:!0,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 Nn(i){var F;const e=gl(),t=i,s=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,M=!Array.isArray(t.trailResources),_=t.trailResourceVersion!==6,w=t.trailTexture,b=String(t.trailTextureName||"trail"),C=String(t.trailPreviewUrl||"/images/trail.png").replace("/trails/trail.png","/images/trail.png");for(const[I,k]of Object.entries(e))t[I]!==void 0&&t[I]!==null||(t[I]=Array.isArray(k)?k.map(B=>typeof B=="object"&&B!==null?{...B}:B):k);s&&(i.innerRadius=0,i.outerRadius=Math.max(0,Number.isFinite(n)?n:e.outerRadius),i.innerRectW=0,i.innerRectH=0,i.outerRectW=Math.max(0,Number.isFinite(r)?r:e.outerRectW),i.outerRectH=Math.max(0,Number.isFinite(o)?o:e.outerRectH),i.coneDirection=Number.isFinite(a)?a:90,i.emissionAngleMode=Number.isFinite(c)&&c>0?"random":"fixed",l==="cone"&&(i.spread=Math.max(0,Number(i.coneAngle)||0)),i.shapeRangeVersion=1),i.shape==="orbit"&&(i.shape="path"),["fixed","random","radial","path-normal","path-tangent"].includes(i.emissionAngleMode)||(i.emissionAngleMode="fixed"),!["circle","rect","cone"].includes(i.shape)&&i.emissionAngleMode==="radial"&&(i.emissionAngleMode="fixed"),i.shape!=="path"&&(i.emissionAngleMode==="path-normal"||i.emissionAngleMode==="path-tangent")&&(i.emissionAngleMode="fixed"),i.spawnPathId=Math.max(0,Math.round(Number(i.spawnPathId)||0)),i.spawnPathDistribution!=="fixed"&&i.spawnPathDistribution!=="random"&&(i.spawnPathDistribution="fixed"),i.renderLayerMode!=="top"&&i.renderLayerMode!=="slot"&&(i.renderLayerMode="top"),i.renderLayerSpineId=Math.max(0,Math.round(Number(i.renderLayerSpineId)||0)),typeof i.renderLayerSlotName!="string"&&(i.renderLayerSlotName=""),i.renderLayerSlotPosition!=="above"&&i.renderLayerSlotPosition!=="below"&&(i.renderLayerSlotPosition="above"),typeof i.renderLayerFollowAttachment!="boolean"&&(i.renderLayerFollowAttachment=!1),i.innerRadius=Math.max(0,Number(i.innerRadius)||0),i.outerRadius=Math.max(i.innerRadius,Number(i.outerRadius)||0),i.innerRectW=Math.max(0,Number(i.innerRectW)||0),i.innerRectH=Math.max(0,Number(i.innerRectH)||0),i.outerRectW=Math.max(i.innerRectW,Number(i.outerRectW)||0),i.outerRectH=Math.max(i.innerRectH,Number(i.outerRectH)||0);const R=Array.from(new Set((Array.isArray(i.collisionColliderIds)?i.collisionColliderIds:[]).map(I=>Math.round(Number(I))).filter(I=>Number.isFinite(I)&&I>0)));(R.length!==i.collisionColliderIds.length||R.some((I,k)=>I!==i.collisionColliderIds[k]))&&(i.collisionColliderIds=R),i.streamBehavior!=="normal"&&i.streamBehavior!=="loop"&&(i.streamBehavior="normal"),(u||!Number.isFinite(i.loopDurationFrames))&&(i.loopDurationFrames=Math.ceil(Math.max(1/30,Number(i.duration)||1)*30)),i.loopDurationFrames=Math.min(1800,Math.max(1,Math.ceil(i.loopDurationFrames))),typeof i.generateLoopStartAnimation!="boolean"&&(i.generateLoopStartAnimation=!1),typeof i.generateLoopEndAnimation!="boolean"&&(i.generateLoopEndAnimation=!1),typeof i.loopStartUseCustomDuration!="boolean"&&(i.loopStartUseCustomDuration=!1),typeof i.loopEndUseCustomDuration!="boolean"&&(i.loopEndUseCustomDuration=!1),i.loopStartDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(i.loopStartDurationFrames)||30))),i.loopEndDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(i.loopEndDurationFrames)||30))),(!Array.isArray(i.imageResources)||i.imageResources.length===0)&&(i.imageResources=gl().imageResources);for(const I of i.imageResources){!I.texture&&i.texture&&(I.texture=i.texture),I.textureName||(I.textureName="star"),I.previewUrl==="/particles/star.png"&&(I.previewUrl="/images/star.png"),I.previewUrl||(I.previewUrl=I.textureName==="star"?"/images/star.png":""),I.imageMode!=="fixed"&&I.imageMode!=="sequence"&&(I.imageMode="fixed"),I.sequencePlayback==="once"?I.sequencePlayback="once-hold":I.sequencePlayback==="loop"?I.sequencePlayback="loop-forward":["once-hide","once-hold","loop-forward","loop-reverse"].includes(I.sequencePlayback)||(I.sequencePlayback="loop-forward"),Number.isFinite(I.sequenceFps)||(I.sequenceFps=30),I.sequenceFps=Math.min(120,Math.max(1,Number(I.sequenceFps)||30)),Array.isArray(I.sequenceFrames)||(I.sequenceFrames=[]);for(const k of I.sequenceFrames)typeof k.name!="string"&&(k.name=""),typeof k.previewUrl!="string"&&(k.previewUrl=""),k.texture===void 0&&(k.texture=null);Number.isFinite(I.weight)||(I.weight=100),typeof I.locked!="boolean"&&(I.locked=!1),Number.isFinite(I.scale)||(I.scale=1),Number.isFinite(I.anchorX)||(I.anchorX=.5),Number.isFinite(I.anchorY)||(I.anchorY=.5),I.colorMode!=="fixed"&&I.colorMode!=="random"&&I.colorMode!=="lifetime"&&(I.colorMode=i.colorOverLife?"lifetime":"fixed"),I.colorStart||(I.colorStart=i.colorStart||"#ffffff"),I.colorEnd||(I.colorEnd=i.colorEnd||I.colorStart),(!Array.isArray(I.colorGradient)||I.colorGradient.length<2)&&(I.colorGradient=[{position:0,color:I.colorStart},{position:1,color:I.colorEnd}]),Object.prototype.hasOwnProperty.call(fr,I.blend)||(I.blend=i.blend||"normal"),["off","fixed","curve"].includes(I.independentAlpha)||(I.independentAlpha=i.independentAlpha||"off"),Number.isFinite(I.alpha)||(I.alpha=Number.isFinite(i.alphaScale)?i.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(I.alphaCurveMode)||(I.alphaCurveMode=i.curveMode||"跟随导出"),(!Array.isArray(I.alphaCurve)||I.alphaCurve.length<2)&&(I.alphaCurve=(i.alphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k})))}if(i.imageResources.length===1)i.imageResources[0].weight=100,i.imageResources[0].locked=!1;else if(h){const I=100/i.imageResources.length;i.imageResources.forEach((k,B)=>{k.weight=B===i.imageResources.length-1?100-I*(i.imageResources.length-1):I,k.locked=!1})}if(i.imageWeightVersion=1,d){const I=Number.isFinite(f)&&f!==0?f:980;i.gravity=I,i.gravityMin=I,i.gravityMax=I}if(p){const I=Number.isFinite(m)&&Number.isFinite(g)&&(m!==0||g!==0);i.windMin=I?Math.hypot(m,g):100,i.windMax=i.windMin,i.windDirection=I?Math.atan2(-g,m)*180/Math.PI:0}v&&(i.forceStrength=Number.isFinite(x)&&x!==0?x:10),y&&(i.trailConfigVersion=3,i.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],i.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],i.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],i.trailGridRows=4,i.trailGridCols=4),(M||!i.trailResources.length)&&(i.trailResources=[{id:1,texture:w||null,textureName:b,previewUrl:C,weight:100,locked:!1,rotation:0,colorMode:i.trailColorMode,color:i.trailColor,colorGradient:i.trailColorGradient.map(I=>({...I})),blend:"normal",alphaMode:i.trailAlphaMode,alpha:i.trailAlpha,alphaCurve:i.trailAlphaCurve.map(I=>({...I})),boneCount:i.trailBoneCount,trailRatio:100,lengthMode:"fixed",length:i.trailLength,lengthMin:i.trailLength,lengthMax:i.trailLength,widthSizeMode:"fixed",width:i.trailWidth,widthMin:i.trailWidth,widthMax:i.trailWidth,widthMode:i.trailWidthMode,lifeLengthEnabled:i.trailLifeLengthEnabled,lifeLengthCurve:i.trailLifeLengthCurve.map(I=>({...I})),shapeEnabled:i.trailShapeEnabled,shapeCurve:i.trailShapeCurve.map(I=>({...I}))}]);for(const I of i.trailResources)I.textureName||(I.textureName="trail"),I.previewUrl==="/trails/trail.png"&&(I.previewUrl="/images/trail.png"),I.previewUrl||(I.previewUrl="/images/trail.png"),Number.isFinite(I.weight)||(I.weight=100),typeof I.locked!="boolean"&&(I.locked=!1),Number.isFinite(I.rotation)||(I.rotation=0),["particle","fixed","curve"].includes(I.colorMode)||(I.colorMode=i.trailColorMode||"particle"),I.color||(I.color=i.trailColor||"#ffffff"),(!Array.isArray(I.colorGradient)||I.colorGradient.length<2)&&(I.colorGradient=(i.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(k=>({...k}))),Object.prototype.hasOwnProperty.call(fr,I.blend)||(I.blend="normal"),["particle","fixed","curve"].includes(I.alphaMode)||(I.alphaMode=i.trailAlphaMode||"particle"),Number.isFinite(I.alpha)||(I.alpha=Number.isFinite(i.trailAlpha)?i.trailAlpha:1),(!Array.isArray(I.alphaCurve)||I.alphaCurve.length<2)&&(I.alphaCurve=(i.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),Number.isFinite(I.boneCount)||(I.boneCount=Number.isFinite(i.trailBoneCount)?i.trailBoneCount:3),Number.isFinite(I.trailRatio)||(I.trailRatio=100),I.trailRatio=Math.min(100,Math.max(0,I.trailRatio)),["fixed","random"].includes(I.lengthMode)||(I.lengthMode="fixed"),Number.isFinite(I.length)||(I.length=Number.isFinite(i.trailLength)?i.trailLength:100),Number.isFinite(I.lengthMin)||(I.lengthMin=I.length),Number.isFinite(I.lengthMax)||(I.lengthMax=I.length),["fixed","random"].includes(I.widthSizeMode)||(I.widthSizeMode="fixed"),Number.isFinite(I.width)||(I.width=Number.isFinite(i.trailWidth)?i.trailWidth:100),Number.isFinite(I.widthMin)||(I.widthMin=I.width),Number.isFinite(I.widthMax)||(I.widthMax=I.width),["particle","fixed"].includes(I.widthMode)||(I.widthMode=i.trailWidthMode||"particle"),typeof I.lifeLengthEnabled!="boolean"&&(I.lifeLengthEnabled=!!i.trailLifeLengthEnabled),(!Array.isArray(I.lifeLengthCurve)||I.lifeLengthCurve.length<2)&&(I.lifeLengthCurve=(i.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),typeof I.shapeEnabled!="boolean"&&(I.shapeEnabled=!!i.trailShapeEnabled),(!Array.isArray(I.shapeCurve)||I.shapeCurve.length<2)&&(I.shapeCurve=(i.trailShapeCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k})));if(i.trailResources.length===1&&(i.trailResources[0].weight=100,i.trailResources[0].locked=!1),_)for(const I of i.trailResources)I.alphaCurve=((F=I.alphaCurve)==null?void 0:F.length)>=2?I.alphaCurve:[{x:0,y:1},{x:1,y:1}];return i.trailResourceVersion=6,i}class Av extends ms{constructor(t,s=jI){super();S(this,"pool",[]);S(this,"cfg");S(this,"accumulator",0);S(this,"burstTimer",0);S(this,"_spawnSerial",0);S(this,"_elapsed",0);S(this,"_attractionEnabledAt",0);S(this,"_attractionWasEnabled",!1);S(this,"states",[]);S(this,"rng",Math.random);S(this,"_lastSeed",-1);S(this,"trailDebugGfx",new Ns);S(this,"trail");S(this,"colliders",[]);S(this,"followSpawnX",0);S(this,"followSpawnY",0);S(this,"followSpawnAngle",0);S(this,"spawnPathSampler",null);S(this,"spawnPathClosed",!1);S(this,"followExportCurveMode","线性");S(this,"simulationTransform",null);this.cfg=Nn(t),this.trail=new JI(this),this._ensurePool(s),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=Qd(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),o=s==="force"||s==="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)),O=-(((c=this.simulationTransform)==null?void 0:c.rotation)??n.rootRotation)*Math.PI/180,L=Math.cos(O),U=Math.sin(O),V=((l=this.simulationTransform)==null?void 0:l.centerX)??n.centerX,H=((h=this.simulationTransform)==null?void 0:h.centerY)??n.centerY,q=V+L*A*m.x-U*P*m.y,ie=-H+U*A*m.x+L*P*m.y,re=q,pe=-ie,ge=n.forceCenterX-re,he=n.forceCenterY-pe,fe=Math.hypot(ge,he);if(fe>1e-4&&fe<=n.forceRadius){const Y=c1(n.forceFalloff,fe,n.forceRadius),W=n.forceStrength*Y*10,j=ge/fe*W,G=he/fe*W,z=j,se=-G;m.vx+=(L*z+U*se)/A*t,m.vy+=(-U*z+L*se)/P*t}}if(!m.collisionPaused&&n.vortex&&n.vortexStrength!==0&&n.vortexRadius>0){const A=Nr(n,m.x,m.y,this.simulationTransform),P=WI(A.x,A.y,n.vortexCenterX,n.vortexCenterY,n.vortexStrength,n.vortexRadius,n.vortexFalloff),O=Mv(n,P.x,P.y,this.simulationTransform);m.vx+=O.x*t,m.vy+=O.y*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 O=Nr(n,m.x,m.y,this.simulationTransform),L=n.attractionCenterX,U=n.attractionCenterY,V=Math.max(0,n.attractionRadius);if(!m.attractionActive){if(Math.hypot(L-O.x,U-O.y)<=V){this.kill(p);continue}m.attractionActive=!0,m.attractionElapsed=0,m.attractionStartWorldX=O.x,m.attractionStartWorldY=O.y}m.attractionElapsed+=t;const H=Math.max(1e-4,n.attractionDuration),q=Math.min(1,m.attractionElapsed/H);let ie=Ss(m.attractionStartWorldX,L,q),re=Ss(m.attractionStartWorldY,U,q);if(n.attractionPath==="curve"){const he=L-m.attractionStartWorldX,fe=U-m.attractionStartWorldY,Y=Math.hypot(he,fe);if(Y>1e-4){const W=Y*.25*m.attractionCurveSide,j=(m.attractionStartWorldX+L)*.5-fe/Y*W,G=(m.attractionStartWorldY+U)*.5+he/Y*W,z=1-q;ie=z*z*m.attractionStartWorldX+2*z*q*j+q*q*L,re=z*z*m.attractionStartWorldY+2*z*q*G+q*q*U}}const pe=Math.hypot(L-ie,U-re);if(q>=1||pe<=V){this.kill(p);continue}const ge=Sv(n,ie,re,this.simulationTransform);m.x=ge.x,m.y=ge.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=Cv(y,m.maxLife-m.life);m.imageFrameIndex=A.index,x.texture=ef(y,n.texture,m.imageFrameIndex),x.visible=A.visible}if(n.speedOverLifeEnabled){const A=ac(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=m.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(M=Ss(n.rotationSpeedMin,n.rotationSpeedMax,Qi(n.rotationOverLifeCurve,v))),m.rotation+=M*t;let _=m.x,w=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,O=A*Math.max(0,n.noiseSpeed)*Math.PI*2;_+=(Math.sin(m.noisePhaseX+O)-Math.sin(m.noisePhaseX))*P,w+=(Math.sin(m.noisePhaseY+O*.83)-Math.sin(m.noisePhaseY))*P}x.x=_,x.y=w,x.rotation=-m.rotation*Math.PI/180;let b=1,C=1;n.scaleOverLifeEnabled&&(b=Jd(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,v,m.scaleOverLifeX),C=n.scaleOverLifeAxisMode==="separate"?Jd(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,v,m.scaleOverLifeY):b),x.scale.set(ac(m.scaleStartX*b,1),ac(m.scaleStartY*C,1));const R=n.alphaMode==="curve"?Qi(n.alphaCurve,v,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;x.alpha=ac((y==null?void 0:y.independentAlpha)==="fixed"?y.alpha:(y==null?void 0:y.independentAlpha)==="curve"?Qi(y.alphaCurve,v,this.resolveCurveMode(y.alphaCurveMode)):R,1);const F=(y==null?void 0:y.colorStart)||"#ffffff",I=(y==null?void 0:y.colorMode)==="lifetime"?am(y.colorGradient,v):(y==null?void 0:y.colorMode)==="random"?m.colorSample:Jo(F);x.tint=I,x.blendMode=fr[(y==null?void 0:y.blend)||"normal"];const k=this.trail.update(m.trail,n,m.boneName,_,w,v,x),B=Nr(n,_,w,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),X=k?{...k,bones:k.bones.map(A=>{const P=Nr(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:_,y:w,rotation:m.rotation,scaleX:x.scale.x,scaleY:x.scale.y,worldX:B.x,worldY:B.y,worldRotation:D+m.rotation,worldScaleX:x.scale.x*$,worldScaleY:x.scale.y*N,alpha:x.alpha,colorHex:I,resourceId:m.resourceId,imageFrameIndex:m.imageFrameIndex,imageVisible:x.visible,trailState:X,active:!0})}return this.states=a,a}drawTrailMeshDebug(t){this.trail.drawDebug(this.trailDebugGfx,t,this.cfg,this.pool.map(s=>s.trail))}emitBurst(){for(let t=0;t0&&this.spawnPathSampler){const a=this.estimatedEmissionCount(),c=XI(t.spawnPathDistribution,this._spawnSerial,a,this.spawnPathClosed,this.rng),l=this.spawnPathSampler(c);if(l)return{...this.applyFollowToOrigin(l.x+s,l.y+n),radialAngle:0,pathAngle:l.angle}}const r=YI(t,this.rng);return{...this.applyFollowToOrigin(s+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,s){const n=this.followSpawnAngle*Math.PI/180,r=Math.cos(n),o=Math.sin(n);return{x:this.followSpawnX+r*t-o*s,y:this.followSpawnY+o*t+r*s}}spawnOne(){const t=this.cfg;let s=this.pool.findIndex(M=>!M.active);if(s===-1)return;const n=this.spawnOrigin(),{x:r,y:o}=n,a=_o(t.lifeMode,t.lifeMin,t.lifeMax,t.lifeCurve,this.rng()),c=_o(t.speedMode,t.speedMin,t.speedMax,t.speedCurve,this.rng()),l=GI(t,n,this.followSpawnAngle,this.rng),h=this.pool[s],u=tR(t,this.rng),d=this._spawnSerial++;h.spawnId=d;const f=sR(t,Dr(t.seed,d,1540483477));h.noisePhaseX=Dr(t.seed,d,1757159915)*Math.PI*2,h.noisePhaseY=Dr(t.seed,d,48610963)*Math.PI*2,h.gravityStrength=t.useGravity&&t.gravityMode==="random"?Ss(t.gravityMin,t.gravityMax,this.rng()):t.gravityMin,h.windStrength=t.wind&&t.windMode==="random"?Ss(t.windMin,t.windMax,this.rng()):t.windMin,h.attractionActive=!1,h.attractionElapsed=0,h.collisionPaused=!1,h.attractionCurveSide=Dr(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=Dr(t.seed,d,668265261)*100,x=(M,_,w,b,C)=>{if(M!=="random")return Math.max(0,Number(_)||0);const R=Math.max(0,Math.min(Number(w)||0,Number(b)||0)),F=Math.max(0,Math.max(Number(w)||0,Number(b)||0));return Ss(R,F,Dr(t.seed,d,C))};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=_o(t.scaleMode,t.scaleMin,t.scaleMax,t.scaleCurve,this.rng())*u.scale,h.scaleStartY=t.scaleAxisMode==="separate"?_o(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:_o(t.initialRotationMode,t.initialRotationMin,t.initialRotationMax,t.initialRotationCurve,this.rng()),h.rotationSpeed=t.rotationOverLifeEnabled?_o(t.rotationOverLifeMode,t.rotationSpeedMin,t.rotationSpeedMax,t.rotationOverLifeCurve,this.rng()):0,h.speedScale=1,h.speedScaleTarget=t.speedOverLifeMode==="random"?Ss(t.speedOverLifeMin,t.speedOverLifeMax,this.rng()):t.speedOverLifeMin,h.scaleOverLifeX=t.scaleOverLifeMode==="random"?Ss(t.scaleOverLifeMin,t.scaleOverLifeMax,this.rng()):t.scaleOverLifeMin,h.scaleOverLifeY=t.scaleOverLifeMode==="random"?Ss(t.scaleYOverLifeMin,t.scaleYOverLifeMax,this.rng()):t.scaleYOverLifeMin,h.resourceId=u.id,h.colorSample=u.colorMode==="random"?am(u.colorGradient,Dr(t.seed,d,2654435769)):Jo(u.colorStart);const y=Cv(u,0);h.imageFrameIndex=y.index,h.sprite.texture=ef(u,t.texture,y.index),h.sprite.anchor.set(u.anchorX,u.anchorY),h.sprite.blendMode=fr[u.blend],h.sprite.tint=h.colorSample,h.sprite.visible=!0}kill(t){const s=this.pool[t];s.active=!1,s.sprite.visible=!1,Pc(s.trail)}clear(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Pc(t.trail)}get activeCount(){let t=0;for(const s of this.pool)s.active&&t++;return t}capture(){const t=[];for(const s of this.pool)s.active&&t.push({boneName:s.boneName,spawnId:s.spawnId,x:s.sprite.x,y:s.sprite.y,rotation:s.rotation,scaleX:s.sprite.scale.x,scaleY:s.sprite.scale.y,...this.captureWorldTransform(s),alpha:s.sprite.alpha,colorHex:s.sprite.tint,resourceId:s.resourceId,imageFrameIndex:s.imageFrameIndex,imageVisible:s.sprite.visible,active:!0,trailState:this.cfg.trail&&s.trail.bones.length?{bones:s.trail.bones.map(n=>{var o;const r=Nr(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:s.trail.bones.length,width:s.trail.currentWidth,alpha:s.trail.currentAlpha,colorHex:s.trail.currentColor,resourceId:s.trail.resourceId}:void 0});return t}captureWorldTransform(t){var r,o,a;const s=Nr(this.cfg,t.sprite.x,t.sprite.y,this.simulationTransform),n=((r=this.simulationTransform)==null?void 0:r.rotation)??this.cfg.rootRotation;return{worldX:s.x,worldY:s.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 s=new Map;for(const n of t)s.set(n.boneName,n);for(const n of this.pool){const r=s.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=ef(a,this.cfg.texture,n.imageFrameIndex),o.anchor.set(a.anchorX,a.anchorY),o.blendMode=fr[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,Pc(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=Qd(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=Qd(this.cfg.seed>>>0)}}const co=new Map,no=new Map;function iR(i){return[...co.values()].some(e=>e===i)}function h1(i){if(!(iR(i)||(no.get(i)||0)>0)){no.delete(i);for(const e of i.textures)e.destroy(!0)}}function nR(i){const e=no.get(i)||0;e>1?no.set(i,e-1):no.delete(i),h1(i)}function rR(i){return co.get(i)||null}function cu(i,e){El(i),co.set(i,e)}function oR(i){const e=co.get(i);return e?(no.set(e,(no.get(e)||0)+1),e):null}function aR(i,e){const t=co.get(i);return t?(cu(e,t),!0):!1}function El(i){const e=co.get(i);e&&(co.delete(i),h1(e))}function $t(i){if(Array.isArray(i))return i.map(e=>$t(e));if(i&&typeof i=="object"){const e=Object.getPrototypeOf(i);if(e===Object.prototype||e===null){const t={};for(const[s,n]of Object.entries(i))t[s]=$t(n);return t}}return i}const u1=["3.8","4.0","4.1","4.2","4.3"];function dh(i){const e=String(i||"").trim();return u1.find(t=>e===t||e.startsWith(`${t}.`))||null}function lm(){return u1.join(" / ")}function lR(i){return i==="4.3"?"4.3":"4.2"}function fp(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"bezier",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function d1(i){const e=Object.assign(fp(),i||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=dh(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 cm=30;function kc(i,e=1){return Math.min(1800,Math.max(1,Math.ceil(Number(i)||e)))}function f1(i,e=30){const t=Math.max(0,Number(i.lifeMin)||0),s=Math.max(0,Number(i.lifeMax)||0),n=i.lifeMode==="fixed"?t:Math.max(t,s);return kc(Math.ceil(n*Math.max(1,e)),cm)}function mr(i,e=30){const t=kc(i.loopDurationFrames),s=f1(i,e),n=i.generateLoopStartAnimation?i.loopStartUseCustomDuration?kc(i.loopStartDurationFrames,cm):s:0,r=i.generateLoopEndAnimation?i.loopEndUseCustomDuration?kc(i.loopEndDurationFrames,cm):s:0;return{start:n,loop:t,end:r,total:n+t+r}}function mp(i,e){const t=mr(i,e),n=Math.max(0,Math.ceil(Math.max(0,Number(i.delay)||0)*Math.max(1,e)))+t.start;return{start:n,end:n+t.loop}}const cR=.001;function hR(i,e){const t=Math.max(1,Number(e)||30),n=Math.max(0,Number(i)||0)*t+cR*t;return Math.max(0,Math.floor(n))}function Fc(i,e,t){const s=Math.max(1,Math.floor(t)-1),n=Math.min(s-1,Math.max(0,Math.floor(Number(i)||0))),r=Math.min(s,Math.max(n+1,Math.floor(Number(e)||s)));return{start:n,end:r}}function uR(i,e,t){const s=Math.max(1,e-1),n=Math.max(1,t-1),r=i.end>=s?n:i.end;return Fc(i.start,r,t)}let lc=1,cc=1,hc=1,uc=1;function dc(i,e){const t=new Set(e),s=`${i} Copy`;if(!t.has(s))return s;let n=2;for(;t.has(`${s} ${n}`);)n++;return`${s} ${n}`}const po=__("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:fp()}}),getters:{activeSystemCount:i=>i.systems.length},actions:{syncSceneSequences(){lc=Math.max(lc,...this.systems.map(i=>i.id+1),1),cc=Math.max(cc,...this.colliders.map(i=>i.id+1),1),hc=Math.max(hc,...this.paths.map(i=>i.id+1),1),uc=Math.max(uc,...this.spines.map(i=>i.id+1),1)},addSystem(i){const e=gl();i!=null&&i.config&&Object.assign(e,i.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 s=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:lc++,visible:!0,animation:s,config:e};return this.systems.push(n),this.activeId=n.id,this.activeObjectType="particle",this.activeObjectId=n.id,n},removeSystem(i){var s;const e=this.systems.findIndex(n=>n.id===i);e>=0&&this.systems.splice(e,1),this.activeId===i&&(this.activeId=((s=this.systems[0])==null?void 0:s.id)??0);const t=this.systems.find(n=>n.id===this.activeId);if(t&&(this.timeline.animation=t.animation),this.activeObjectType==="particle"&&this.activeObjectId===i){const n=this.systems[0];this.activeObjectId=(n==null?void 0:n.id)??0}},selectSystem(i){this.activeId=i,this.activeObjectType="particle",this.activeObjectId=i;const e=this.systems.find(t=>t.id===i);e&&(this.timeline.animation=e.animation)},setSystemAnimation(i,e){if(!this.timeline.animations.includes(e))return;const t=this.systems.find(s=>s.id===i);t&&(t.animation=e,this.timeline.animation=e)},addAnimation(){const i=new Set(this.timeline.animations);let e=2,t=`animation${e}`;for(;i.has(t);)t=`animation${++e}`;this.timeline.animations.push(t),this.timeline.animation=t;const s=this.systems.find(n=>n.id===this.activeId);return s&&(s.animation=t),t},renameAnimation(i,e){const t=e.trim(),s=this.timeline.animations.indexOf(i);if(s<0||!t||t!==i&&this.timeline.animations.includes(t))return!1;this.timeline.animations[s]=t;for(const n of this.systems)n.animation===i&&(n.animation=t);return this.timeline.animation===i&&(this.timeline.animation=t),!0},removeAnimation(i){if(this.timeline.animations.length<=1)return!1;const e=this.timeline.animations.indexOf(i);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 s of this.systems)s.animation===i&&(s.animation=t);return this.timeline.animation===i&&(this.timeline.animation=t),!0},addCollider(){const i=cc++,e={id:i,name:`Collider${i}`,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 i=hc++,e={id:i,name:`Path${i}`,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 i=uc++,e={id:i,name:`SpineSkeleton${i}`,enabled:!0,visible:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,timeOffset:0,skeletonFileName:"",atlasFileName:"",textureFileNames:[],dataVersion:"",sourceBundle:null,selectedAnimation:"",selectedBone:"",selectedSlot:"",animations:[],bones:[],slots:[],assetVersion:0,status:"empty",error:""};return this.spines.push(e),this.activeObjectType="spine",this.activeObjectId=e.id,e},duplicateSelectedObject(){const i=this.activeObjectId;if(!i)return null;if(this.activeObjectType==="particle"){const s=this.systems.find(r=>r.id===i);if(!s)return null;const n=$t(s);return n.id=lc++,n.config.name=dc(s.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 s=this.colliders.find(r=>r.id===i);if(!s)return null;const n=$t(s);return n.id=cc++,n.name=dc(s.name,this.colliders.map(r=>r.name)),this.colliders.push(n),this.activeObjectId=n.id,n}if(this.activeObjectType==="path"){const s=this.paths.find(r=>r.id===i);if(!s)return null;const n=$t(s);return n.id=hc++,n.name=dc(s.name,this.paths.map(r=>r.name)),this.paths.push(n),this.activeObjectId=n.id,n}const e=this.spines.find(s=>s.id===i);if(!e)return null;const t=$t(e);return t.id=uc++,t.name=dc(e.name,this.spines.map(s=>s.name)),t.selectedBone="",t.selectedSlot="",aR(e.id,t.id),this.spines.push(t),this.activeObjectId=t.id,t},selectSceneObject(i,e){if(this.activeObjectType=i,this.activeObjectId=e,i==="particle"){this.activeId=e;const t=this.systems.find(s=>s.id===e);t&&(this.timeline.animation=t.animation)}},removeCollider(i){var t;const e=this.colliders.findIndex(s=>s.id===i);e>=0&&this.colliders.splice(e,1);for(const s of this.systems){const n=Nn(s.config);n.collisionColliderIds=n.collisionColliderIds.filter(r=>r!==i)}if(this.activeObjectType==="collision"&&this.activeObjectId===i){const s=this.systems[0];this.activeObjectType=s?"particle":"collision",this.activeObjectId=(s==null?void 0:s.id)??((t=this.colliders[0])==null?void 0:t.id)??0}},removePath(i){var t;const e=this.paths.findIndex(s=>s.id===i);if(e>=0&&this.paths.splice(e,1),this.activeObjectType==="path"&&this.activeObjectId===i){const s=this.systems[0];this.activeObjectType=s?"particle":"path",this.activeObjectId=(s==null?void 0:s.id)??((t=this.paths[0])==null?void 0:t.id)??0}},removeSpine(i){El(i);const e=this.spines.findIndex(t=>t.id===i);if(e>=0&&this.spines.splice(e,1),this.activeObjectType==="spine"&&this.activeObjectId===i){const t=this.systems[0],s=this.colliders[0],n=this.paths[0],r=this.spines[0];t?(this.activeObjectType="particle",this.activeObjectId=t.id,this.activeId=t.id):s?(this.activeObjectType="collision",this.activeObjectId=s.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 i=Fc(this.timeline.playbackStart,this.timeline.playbackEnd,this.timeline.totalFrames);(this.timeline.frame=i.end)&&(this.timeline.frame=i.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(i){this.timeline.frame=Math.max(0,Math.min(i,this.timeline.totalFrames-1))},setPlaybackStart(i){const e=Fc(i,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 i=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/i,Math.ceil(Math.max(1,Number(o.loopDurationFrames)||1))/i):Math.max(1/i,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)+mr(o,i).total/i),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,s=Math.max(2,hR(e,i)+1);this.timeline.totalFrames=s;const n=uR({start:this.timeline.playbackStart,end:this.timeline.playbackEnd},t,s);return this.timeline.playbackStart=n.start,this.timeline.playbackEnd=n.end,this.timeline.frame>=s&&(this.timeline.frame=s-1),s}}}),m1="SpineParticle.SystemSettings",p1=1,tf="SpineParticle.SystemSettings.v1";function Pa(i,e,t,s){const n=Number(i);return Math.min(t,Math.max(e,Number.isFinite(n)?n:s))}function dR(i){return{parameterPanelOnRight:i.parameterPanelOnRight,undoLimit:i.undoLimit,showEmitter:i.showEmitter,showBones:i.showBones,bonePointDrawSize:i.bonePointDrawSize,boneAxisDrawSize:i.boneAxisDrawSize,showSkinMesh:i.showSkinMesh,tickEnabled:i.tickEnabled,axisFontSize:i.axisFontSize,tickWidth:i.tickWidth,showAxisLabels:i.showAxisLabels,axisColor:i.axisColor}}function fR(i,e){const t=n=>i[n]==null?!!e[n]:i[n]===!0,s=typeof i.axisColor=="string"&&/^#[0-9a-f]{6}$/i.test(i.axisColor)?i.axisColor:e.axisColor;return{parameterPanelOnRight:t("parameterPanelOnRight"),undoLimit:Math.round(Pa(i.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:Pa(i.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:Pa(i.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(Pa(i.axisFontSize,8,40,e.axisFontSize)),tickWidth:Pa(i.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:s}}function mR(i){let e;try{e=JSON.parse(i)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==m1)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==p1)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function pR(i,e){Object.assign(i.settings,fR(e,i.settings))}let fc=null;function gR(i){fc==null||fc();try{const e=localStorage.getItem(tf);e&&pR(i,mR(e).settings)}catch{try{localStorage.removeItem(tf)}catch{}}fc=Ls(()=>dR(i.settings),e=>{const t={format:m1,version:p1,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(tf,JSON.stringify(t))}catch{}},{deep:!0})}function vR(i,e=0){if(i<=0)return 1;const t=Math.pow(10,Math.floor(Math.log10(i))),s=[1,2,5,10,20,50,100];let n=1;for(const r of s)if(r*t>=i){n=r*t;break}return Math.max(n,e)}function yR(i,e,t,s,n){if(!t)return;const r=t;r.clear();const o=i.settings;if(!o.tickEnabled){for(const b of n)b.visible=!1;return}const a=0,c=0,l=e.screen.width/i.editor.viewScale,h=e.screen.height/i.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=i.editor.viewScale,f=vR(50/d),p=l,m=h,g=Math.max(1,o.tickWidth);if(o.tickEnabled){for(let b=0;b<=l;b+=f){const C=Math.round(b/f)*f;C!==0&&(r.lineStyle(g,u,.25),r.moveTo(C,c-4),r.lineTo(C,c+4),r.moveTo(-C,c-4),r.lineTo(-C,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+i.editor.viewX,x=e.screen.height*.5+i.editor.viewY,y=o.axisFontSize,M=+("0x"+o.axisColor.replace("#",""));for(;n.length<64;){const b=new dp("",{fontFamily:"monospace",fontSize:y,fill:M});b.anchor.set(.5,.5),s.addChild(b),n.push(b)}let _=0;const w=o.showAxisLabels&&o.tickEnabled;for(let b=0;b<=l;b+=f){const C=Math.round(b/f)*f;if(C===0||!w||C>p)continue;const R=n[_++];if(!R)break;R.style.fontSize=y,R.text=String(C),R.position.set(v+C*d,x+9),R.visible=!0;const F=n[_++];if(!F)break;F.style.fontSize=y,F.text=String(-C),F.position.set(v-C*d,x+9),F.visible=!0}for(let b=0;b<=h;b+=f){const C=Math.round(b/f)*f;if(C===0||!w||C>m)continue;const R=n[_++];if(!R)break;R.style.fontSize=y,R.text=String(C),R.position.set(v+8,x-b*d),R.visible=!0;const F=n[_++];if(!F)break;F.style.fontSize=y,F.text=String(-C),F.position.set(v+8,x+b*d),F.visible=!0}for(;_x.id===i.activeId);if(!n||n.visible===!1)return;const r=n.config;if(!r.showShape)return;const 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 M=x+m,_=-y-g,w=M*h,b=_*u;return[a+w*f-b*p,c+(w*p+b*f)]};if(l==="circle"){const x=uh(r.innerRadius,r.outerRadius);s.lineStyle(2,3991658,.7);const y=48;for(const M of[x.outer,x.inner])if(!(M<=0))for(let _=0;_<=y;_++){const w=_/y*Math.PI*2,[b,C]=v(Math.cos(w)*M,Math.sin(w)*M);_===0?s.moveTo(b,C):s.lineTo(b,C)}}else if(l==="rect"){const x=l1(r);s.lineStyle(2,4885759,.7);for(const[y,M]of[[x.outerW,x.outerH],[x.innerW,x.innerH]]){if(y<=0||M<=0)continue;const _=y/2,w=M/2,b=v(-_,-w),C=v(_,-w),R=v(_,w),F=v(-_,w);s.moveTo(b[0],b[1]),s.lineTo(C[0],C[1]),s.lineTo(R[0],R[1]),s.lineTo(F[0],F[1]),s.lineTo(b[0],b[1])}}else if(l==="cone"){const x=uh(r.innerRadius,r.outerRadius),y=r.coneAngle/2*Math.PI/180,M=r.coneDirection*Math.PI/180,_=v(Math.cos(M-y)*x.inner,Math.sin(M-y)*x.inner),w=v(Math.cos(M+y)*x.inner,Math.sin(M+y)*x.inner),b=v(Math.cos(M-y)*x.outer,Math.sin(M-y)*x.outer),C=v(Math.cos(M+y)*x.outer,Math.sin(M+y)*x.outer);s.lineStyle(2,3991658,.7),s.moveTo(_[0],_[1]),s.lineTo(b[0],b[1]),s.moveTo(w[0],w[1]),s.lineTo(C[0],C[1]),s.lineStyle(1,3991658,.5);const R=24;for(const F of[x.outer,x.inner])if(!(F<=0))for(let I=0;I<=R;I++){const k=M-y+2*y*I/R,[B,D]=v(Math.cos(k)*F,Math.sin(k)*F);I===0?s.moveTo(B,D):s.lineTo(B,D)}}}function wR(i,e){if(!e)return;const t=e;t.clear();const s=i.systems.find(c=>c.id===i.activeId);if((s==null?void 0:s.visible)===!1)return;const n=s==null?void 0:s.config;if(!(n!=null&&n.forceField)||!n.showForceFieldShape||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 SR(i,e){if(!e)return;const t=e;t.clear();const s=i.systems.find(u=>u.id===i.activeId);if((s==null?void 0:s.visible)===!1)return;const n=s==null?void 0:s.config;if(!(n!=null&&n.vortex)||!n.showVortexShape||n.vortexRadius<=0)return;const r=n.vortexCenterX,o=-n.vortexCenterY,a=n.vortexStrength>=0?12156159:16753228;t.lineStyle(2,a,.9),t.beginFill(a,.07),t.drawCircle(r,o,n.vortexRadius),t.endFill(),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill();const c=r+Math.min(n.vortexRadius*.65,50),l=n.vortexStrength>=0?-1:1,h=o+l*14;t.lineStyle(2,a,.9),t.moveTo(c,o+l*-8),t.lineTo(c,h),t.moveTo(c,h),t.lineTo(c-4,h-l*5),t.moveTo(c,h),t.lineTo(c+4,h-l*5)}function MR(i,e){if(!e)return;const t=e;t.clear();const s=i.systems.find(l=>l.id===i.activeId);if((s==null?void 0:s.visible)===!1)return;const n=s==null?void 0:s.config;if(!(n!=null&&n.attraction)||!n.showAttractionShape)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(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1));return{x:i.x+n*e*o-r*t*a,y:i.y+r*e*o+n*t*a}}function Co(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1)),c=e-i.x,l=t-i.y;return{x:(n*c+r*l)/o,y:(-r*c+n*l)/a}}function g1(i,e,t="linear"){if(!i.length)return e;const s=[...i].sort((n,r)=>n.x-r.x);if(e<=s[0].x)return s[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;s.lineStyle(2,12881151,.95),s.beginFill(12881151,.2),s.drawCircle(c,l,8),s.endFill(),s.beginFill(15919103,1),s.drawCircle(c,l,3.5),s.endFill()}}function CR(i,e,t){if(!t)return;const s=t;if(s.clear(),!i.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),M=d(v,x);s.moveTo(y[0],y[1]),s.lineTo(M[0],M[1])},p=26;if(s.lineStyle(2,3526911,.9),s.beginFill(3526911,.25),s.drawCircle(r,o,6),s.endFill(),i.value==="translate")s.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(i.value==="rotate"){s.lineStyle(2,3526911,.8);const m=48;for(let x=0;x<=m;x++){const y=x/m*Math.PI*2,[M,_]=d(Math.cos(y)*p,Math.sin(y)*p);x===0?s.moveTo(M,_):s.lineTo(M,_)}const[g,v]=d(0,p);s.beginFill(3526911,.95),s.drawCircle(g,v,4),s.endFill()}else if(i.value==="scale"){s.lineStyle(2,3526911,.9);const g=[[-p,-p],[p,-p],[p,p],[-p,p]].map(([v,x])=>d(v,x));s.moveTo(g[0][0],g[0][1]),s.lineTo(g[1][0],g[1][1]),s.lineTo(g[2][0],g[2][1]),s.lineTo(g[3][0],g[3][1]),s.lineTo(g[0][0],g[0][1]),s.beginFill(3526911,.9);for(const v of g)s.drawRect(v[0]-3,v[1]-3,6,6);s.endFill()}}function AR(i,e=16777215){const t=Number.parseInt(i.replace("#",""),16);return Number.isFinite(t)?t:e}function ER(i,e,t){if(!t)return;const s=t;s.clear();for(const n of e){if(n.visible===!1)continue;const r=i.activeObjectType==="collision"&&i.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;s.lineStyle(r?2.5:1.5,o,n.enabled?.95:.45),s.beginFill(o,r?.12:.055),s.moveTo(f[0].x,f[0].y);for(let m=1;mo.id===i.activeObjectId):null,r=(n==null?void 0:n.config.shape)==="path"&&!n.config.showShape?n.config.spawnPathId:0;for(const o of i.paths){if(o.id===r||o.visible===!1||!o.enabled||!o.points.length)continue;const a=i.activeObjectType==="path"&&i.activeObjectId===o.id,c=AR(o.color,16749374),l=(f,p)=>{const m=TR(o,f,p);return{x:m.x,y:-m.y}},h=o.points[0],u=l(h.x,h.y);s.lineStyle(a?2.5:1.8,c,a?1:.75),s.moveTo(u.x,u.y);const d=o.closed?o.points.length:o.points.length-1;for(let f=0;f{const m=l(f.x,f.y),g=l(f.x+f.inX,f.y+f.inY),v=l(f.x+f.outX,f.y+f.outY),x=Math.hypot(f.inX,f.inY)>.01,y=Math.hypot(f.outX,f.outY)>.01;s.lineStyle(1,11121867,.65),x&&(s.moveTo(m.x,m.y),s.lineTo(g.x,g.y)),y&&(s.moveTo(m.x,m.y),s.lineTo(v.x,v.y)),x&&(s.beginFill(14015724,.95),s.drawCircle(g.x,g.y,3),s.endFill()),y&&(s.beginFill(14015724,.95),s.drawCircle(v.x,v.y,3),s.endFill()),s.beginFill(e.has(p)?16777215:c,1),s.lineStyle(1.5,e.has(p)?6126847:16777215,.95),s.drawCircle(m.x,m.y,e.has(p)?5:4),s.endFill()})}}function RR(i,e,t,s){var o;const n=Number.isFinite(e.worldX)&&Number.isFinite(e.worldY),r=Number.isFinite(e.worldRotation);i.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:s}),(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);i.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:s,trail:!0})})}function Iv(i,e,t,s,n,r,o,a){const c=r*.62,l=e+s*r,h=t+n*r,u=Math.max(2.5,r*.32),d=Math.max(1.7,r*.22),f=l-s*u,p=h-n*u,m=-n,g=s;i.lineStyle(o,a,.95),i.moveTo(e-s*c,t-n*c),i.lineTo(f,p),i.lineStyle(0),i.beginFill(a,.95),i.drawPolygon([l,h,f+m*d,p+g*d,f-m*d,p-g*d]),i.endFill()}function PR(i,e,t){if(!t)return;const s=t;if(s.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 i){const f=d.trail?16731533:16747610;s.lineStyle(1,f,d.trail?.65:.35),s.moveTo(d.parentX??n,d.parentY??r),s.lineTo(d.x,d.y);const p=d.rotation*Math.PI/180,m=Math.cos(p),g=Math.sin(p);Iv(s,d.x,d.y,m,g,h,u,15684432),Iv(s,d.x,d.y,g,-m,h,u,5622123),s.beginFill(f,.9),s.drawCircle(d.x,d.y,l),s.endFill()}}function Is(i){return i.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function kR(i){const e=new Map;for(const s of i)for(const n of s)e.has(n.boneName)||e.set(n.boneName,Is([n])[0]);const t=[...e.keys()].sort((s,n)=>{const r=Number(s.replace(/^p_/,"")),o=Number(n.replace(/^p_/,""));return Number.isFinite(r)&&Number.isFinite(o)?r-o:s.localeCompare(n)});for(let s=0;s[r.boneName,r]));i[s]=t.map(r=>{const o=n.get(r);return o||{...Is([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function FR(i){i.length<2||(i[i.length-1]=Is(i[0]))}function OR(i,e){const t=Math.max(0,i.length-1),s=[];for(let n=0;n<=e;n++){const r=Math.min(t,Math.round(n/e*t));s.push(Is(i[r]||[]))}return s}function sf(i){return`${i.boneName}:${i.spawnId??"legacy"}`}function Rv(i){return{...Is([i])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function LR(i,e,t,s){const n=Math.min(i.length,s+1),r=i.slice(Math.max(0,i.length-n)),o=new Map;for(const l of e){if(l.imageVisible===!1||l.alpha<=0)continue;const h=sf(l),u=new Map;let d=!1;for(let f=r.length-1;f>=0;f--){const p=r[f].find(m=>sf(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 Is([u])[0];const d=(f=o.get(sf(u)))==null?void 0:f.get(h);return d?Is([d])[0]:Rv(u)}))}return c[0]=c[0].map(Rv),c[c.length-1]=Is(e),c}function Pv(i,e){const t=i.length?1:0;for(let s=t;s{const y=x?[[]]:[];e.reset();for(let M=0;M0&&e.restartEmissionCycle();for(let _=0;_0;M++)e.update(r,"off"),x.push(e.capture());(v=x[x.length-1])!=null&&v.length&&x.push([]),Pv(u,OR(x,a.end))}const g=Is(u[u.length-1]||[]);for(u.length>s&&(u.length=s);u.length{var a;return String(((a=o==null?void 0:o.data)==null?void 0:a.name)||"")}):null}catch{return null}}getSlotLocalMatrix(e,t){var o,a,c;const s=(o=this.entries.get(e))==null?void 0:o.spine,n=(c=(a=s==null?void 0:s.skeleton)==null?void 0:a.findSlot)==null?void 0:c.call(a,t),r=n==null?void 0:n.bone;return r!=null&&r.active?new Ot(r.a,r.c,-r.b,-r.d,r.worldX,r.worldY):null}getSlotParentMatrix(e,t,s){const n=this.getSlotLocalMatrix(e,t);if(!n)return null;const r=-s.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r);return new Ot(o*s.scaleX,a*s.scaleX,-a*s.scaleY,o*s.scaleY,s.x,-s.y).append(n)}attachSlotObject(e,t,s,n){var o;const r=(o=this.entries.get(e))==null?void 0:o.spine;if(!(r!=null&&r.addSlotObject))return!1;try{return r.addSlotObject(t,s,{followAttachmentTimeline:n}),!0}catch{return!1}}detachSlotObject(e,t,s){var r,o;const n=(r=this.entries.get(e))==null?void 0:r.spine;try{(o=n==null?void 0:n.removeSlotObject)==null||o.call(n,t,s)}catch{}}destroyEntry(e){var t,s;try{(s=(t=e.spine)==null?void 0:t.removeSlotObjects)==null||s.call(t)}catch{}this.container.removeChild(e.root),e.root.destroy({children:!0})}sync(e,t,s){var n;for(const[r,o]of this.entries)e.some(a=>a.id===r)||(this.destroyEntry(o),this.entries.delete(r));for(const r of e){const o=rR(r.id);let a=this.entries.get(r.id);if(a&&a.assetVersion!==r.assetVersion&&!o&&(this.destroyEntry(a),this.entries.delete(r.id),a=void 0),(!a||a.assetVersion!==r.assetVersion)&&o){a&&this.destroyEntry(a);const d=new ms,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,s)-r.timeOffset);u.trackTime=d>0?Math.min(f,d):f}l.update(0)}}getBoneWorldTransform(e,t){const s=this.entries.get(e),n=s==null?void 0:s.spine.skeleton.findBone(t);if(!s||!n||!n.active)return null;const r=s.runtimeVersion==="4.3"?n.appliedPose:n,o=s.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())this.destroyEntry(e);this.entries.clear(),this.container.removeFromParent(),this.container.destroy({children:!0})}}let v1=class{constructor(){S(this,"entries",{});S(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 s=0,n=e.length;s1&&(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 Es){return t.setFromString(e)}},S(Es,"WHITE",new Es(1,1,1,1)),S(Es,"RED",new Es(1,0,0,1)),S(Es,"GREEN",new Es(0,1,0,1)),S(Es,"BLUE",new Es(0,0,1,1)),S(Es,"MAGENTA",new Es(1,0,1,1)),Es);var Zt;let Ee=(Zt=class{static clamp(e,t,s){return es?s:e}static cosDeg(e){return Math.cos(e*Zt.degRad)}static sinDeg(e){return Math.sin(e*Zt.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Zt.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 Zt.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,s){let n=Math.random(),r=t-e;return n<=(s-e)/r?e+Math.sqrt(n*r*(s-e)):t-Math.sqrt((1-n)*r*(t-s))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},S(Zt,"PI",3.1415927),S(Zt,"PI2",Zt.PI*2),S(Zt,"invPI2",1/Zt.PI2),S(Zt,"radiansToDegrees",180/Zt.PI),S(Zt,"radDeg",Zt.radiansToDegrees),S(Zt,"degreesToRadians",Zt.PI/180),S(Zt,"degRad",Zt.degreesToRadians),Zt);var _i;let Re=(_i=class{static arrayCopy(e,t,s,n,r){for(let o=t,a=n;o=t?e:_i.setArraySize(e,t,s)}static newArray(e,t){let s=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=m.c,_=m.d;for(let w=s,b=o;b=this.regions.length&&(s=this.regions.length-1);let n=this.regions[s];t.region!=n&&(t.region=n,t.updateRegion())}getPath(e,t){let s=e,n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)s+="0";return s+=n,s}static nextID(){return Fn._nextID++}},S(Fn,"_nextID",0),Fn);var Ms;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(Ms||(Ms={}));const b1=[Ms.hold,Ms.once,Ms.loop,Ms.pingpong,Ms.onceReverse,Ms.loopReverse,Ms.pingpongReverse];let pp=class{constructor(e,t,s){S(this,"name");S(this,"timelines",[]);S(this,"timelineIds",new v1);S(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t0&&(t%=this.duration));let l=this.timelines;for(let h=0,u=l.length;ht)return n-1;return s-1}static search(e,t,s){let n=e.length;for(let r=s;rt)return r-s;return n-s}},un=class extends Xt{constructor(t,s,n){super(t,n);S(this,"curves");this.curves=Re.newFloatArray(t+s*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let s=this.getFrameCount()+t*18;if(this.curves.length>s){let n=Re.newFloatArray(s);Re.arrayCopy(this.curves,0,n,0,s),this.curves=n}}setBezier(t,s,n,r,o,a,c,l,h,u,d){let f=this.curves,p=this.getFrameCount()+t*18;n==0&&(f[s]=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,M=g*2+x,_=(a-r)*.3+m+v*.16666667,w=(c-o)*.3+g+x*.16666667,b=r+_,C=o+w;for(let R=p+18;pt){let h=this.frames[s],u=this.frames[s+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)}s+=this.getFrameEntries();let c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[s]-c)*(this.frames[s+n]-l)}},Oi=class extends un{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let r=2;r<=s;r+=2)if(t[r]>e){s=r-2;break}let n=this.curves[s>>1];switch(n){case 0:let r=t[s],o=t[s+1];return o+(e-r)/(t[s+2]-r)*(t[s+2+1]-o);case 1:return t[s+1]}return this.getBezierValue(e,s,1,n-2)}getRelativeValue(e,t,s,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==ve.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}}},F1=class extends Oi{constructor(t,s,n){super(t,s,at.alpha+"|"+n);S(this,"slotIndex",0);this.slotIndex=n}apply(t,s,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.color;if(n>3];switch(_){case 0:let w=h[M];f=h[M+1],p=h[M+2],m=h[M+3],g=h[M+4],v=h[M+5],x=h[M+6],y=h[M+7];let b=(n-w)/(h[M+8]-w);f+=(h[M+8+1]-f)*b,p+=(h[M+8+2]-p)*b,m+=(h[M+8+3]-m)*b,g+=(h[M+8+4]-g)*b,v+=(h[M+8+5]-v)*b,x+=(h[M+8+6]-x)*b,y+=(h[M+8+7]-y)*b;break;case 1:f=h[M+1],p=h[M+2],m=h[M+3],g=h[M+4],v=h[M+5],x=h[M+6],y=h[M+7];break;default:f=this.getBezierValue(n,M,1,_-2),p=this.getBezierValue(n,M,2,_+18-2),m=this.getBezierValue(n,M,3,_+36-2),g=this.getBezierValue(n,M,4,_+54-2),v=this.getBezierValue(n,M,5,_+72-2),x=this.getBezierValue(n,M,6,_+90-2),y=this.getBezierValue(n,M,7,_+108-2)}if(o==1)u.set(f,p,m,g),d.r=v,d.g=x,d.b=y;else{if(a==ve.setup){u.setFromColor(l.data.color);let w=l.data.darkColor;d.r=w.r,d.g=w.g,d.b=w.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}}},L1=class extends un{constructor(t,s,n){super(t,s,[at.rgb+"|"+n,at.rgb2+"|"+n]);S(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,s,n,r,o,a,c,l){t*=7,this.frames[t]=s,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,s,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[s];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[s+this.getFrameEntries()]-a)}apply(t,s,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.getAttachment();if(!h||!(h instanceof Gn)||h.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(a=ve.setup);let d=this.vertices,f=d[0].length,p=this.frames;if(n=p[p.length-1]){let M=d[p.length-1];if(o==1)if(a==ve.add){let _=h;if(_.bones)for(let w=0;wn)this.apply(t,s,Number.MAX_VALUE,r,o,a,c),s=-1;else if(s>=l[h-1])return;if(n0&&l[u-1]==d;)u--}for(;u=l[u];u++)r.push(this.events[u])}},S(Zr,"propertyIds",[""+at.event]),Zr);var Jr;let qa=(Jr=class extends Xt{constructor(t){super(t,Jr.propertyIds);S(this,"drawOrders");this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s,n){this.frames[t]=s,this.drawOrders[t]=n}apply(t,s,n,r,o,a,c){if(c==ks.mixOut){a==ve.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==ve.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}},go=class extends Oi{constructor(t,s,n,r){super(t,s,r+"|"+n);S(this,"constraintIndex",0);this.constraintIndex=n}apply(t,s,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)))}},V1=class extends go{constructor(e,t,s){super(e,t,s,at.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},Y1=class extends go{constructor(e,t,s){super(e,t,s,at.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},G1=class extends go{constructor(e,t,s){super(e,t,s,at.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},j1=class extends go{constructor(e,t,s){super(e,t,s,at.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}},H1=class extends go{constructor(e,t,s){super(e,t,s,at.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},W1=class extends go{constructor(e,t,s){super(e,t,s,at.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},z1=class extends go{constructor(e,t,s){super(e,t,s,at.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}};var Qr;let q1=(Qr=class extends Xt{constructor(t,s){super(t,Qr.propertyIds);S(this,"constraintIndex");this.constraintIndex=s}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,n,r,o,a,c){let l;if(this.constraintIndex!=-1&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const h=this.frames;if(s>n)this.apply(t,s,Number.MAX_VALUE,[],o,a,c),s=-1;else if(s>=h[h.length-1])return;if(!(n=h[Xt.search1(h,s)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},S(Qr,"propertyIds",[at.physicsConstraintReset.toString()]),Qr);var Ds;let K1=(Ds=class extends Xt{constructor(t,s,n){super(t,[at.sequence+"|"+s+"|"+n.sequence.id]);S(this,"slotIndex");S(this,"attachment");this.slotIndex=s,this.attachment=n}getFrameEntries(){return Ds.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,s,n,r,o){let a=this.frames;t*=Ds.ENTRIES,a[t]=s,a[t+Ds.MODE]=n|r<<4,a[t+Ds.DELAY]=o}apply(t,s,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 Gn)||h.timelineAttachment!=u))return;if(c==ks.mixOut){a==ve.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(n>4,x=this.attachment.sequence.regions.length,y=b1[m&15];if(y!=Ms.hold)switch(v+=(n-p)/g+1e-5|0,y){case Ms.once:v=Math.min(x-1,v);break;case Ms.loop:v%=x;break;case Ms.pingpong:{let M=(x<<1)-2;v=M==0?0:v%M,v>=x&&(v=M-v);break}case Ms.onceReverse:v=Math.max(x-1-v,0);break;case Ms.loopReverse:v=x-1-v%x;break;case Ms.pingpongReverse:{let M=(x<<1)-2;v=M==0?0:(v+x-1)%M,v>=x&&(v=M-v)}}l.sequenceIndex=v}},S(Ds,"ENTRIES",3),S(Ds,"MODE",1),S(Ds,"DELAY",2),Ds);var On;let NR=(On=class{constructor(e){S(this,"data");S(this,"tracks",new Array);S(this,"timeScale",1);S(this,"unkeyedState",0);S(this,"events",new Array);S(this,"listeners",new Array);S(this,"queue",new UR(this));S(this,"propertyIDs",new v1);S(this,"animationsChanged",!1);S(this,"trackEntryPool",new fh(()=>new DR));this.data=e}static emptyAnimation(){return On._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let s=0,n=t.length;s0){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(s,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[s]=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 s=e.mixingFrom;if(!s)return!0;let n=this.updateMixingFrom(s,t);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((s.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=e),e.interruptAlpha=s.interruptAlpha,this.queue.end(s)),n):(s.trackTime+=t*s.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,s=this.tracks,n=!1;for(let d=0,f=s.length;d0)continue;n=!0;let m=d==0?ve.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(),M=y,_=t;p.reverse&&(M=p.animation.duration-M,_=null);let w=p.animation.timelines,b=w.length;if(d==0&&g==1||m==ve.add){d==0&&(v=!0);for(let C=0;C1&&(r=1),s!=ve.first&&(s=n.mixBlend));let o=r=n.alphaAttachmentThreshold):(a&&_ instanceof qa&&b==ve.setup&&(w=ks.mixIn),_.apply(t,d,p,m,C,b,w))}}return e.mixDuration>0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,s,n,r){var o=t.slots[e.slotIndex];o.bone.active&&(s=0,y=m>=0;Math.abs(g)<=90&&Ee.signum(g)!=Ee.signum(p)&&(Math.abs(m-v)>180?(f+=360*Ee.signum(m),y=x):v!=0?f-=360*Ee.signum(m):y=x),y!=x&&(f+=360*Ee.signum(m)),o[a]=f}o[a+1]=p,l.rotation=u+f*n}queueEvents(e,t){let s=e.animationStart,n=e.animationEnd,r=n-s,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 s=t;for(;;){let n=s.mixingFrom;if(!n)break;this.queue.end(n),s.mixingFrom=null,s.mixingTo=null,s=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,s){let n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(s&&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,s=!1){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,n,s)}setAnimationWith(e,t,s=!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,s,r);return this.setCurrent(e,o,n),this.queue.drain(),o}addAnimation(e,t,s=!1,n=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,s,n)}addAnimationWith(e,t,s=!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,s,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 s=this.setAnimationWith(e,On.emptyAnimation(),!1);return s.mixDuration=t,s.trackEnd=t,s}addEmptyAnimation(e,t=0,s=0){let n=this.addAnimationWith(e,On.emptyAnimation(),!1,s);return s<=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 s=0,n=this.tracks.length;s0){r[c]=$R,o[c]=u;continue e}break}r[c]=rf}}}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()}},S(On,"_emptyAnimation",new pp("",[],0)),On),DR=class{constructor(){S(this,"animation",null);S(this,"previous",null);S(this,"next",null);S(this,"mixingFrom",null);S(this,"mixingTo",null);S(this,"listener",null);S(this,"trackIndex",0);S(this,"loop",!1);S(this,"holdPrevious",!1);S(this,"reverse",!1);S(this,"shortestRotation",!1);S(this,"eventThreshold",0);S(this,"mixAttachmentThreshold",0);S(this,"alphaAttachmentThreshold",0);S(this,"mixDrawOrderThreshold",0);S(this,"animationStart",0);S(this,"animationEnd",0);S(this,"animationLast",0);S(this,"nextAnimationLast",0);S(this,"delay",0);S(this,"trackTime",0);S(this,"trackLast",0);S(this,"nextTrackLast",0);S(this,"trackEnd",0);S(this,"timeScale",0);S(this,"alpha",0);S(this,"mixTime",0);S(this,"_mixDuration",0);S(this,"interruptAlpha",0);S(this,"totalAlpha",0);S(this,"mixBlend",ve.replace);S(this,"timelineMode",new Array);S(this,"timelineHoldMix",new Array);S(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}},UR=class{constructor(e){S(this,"objects",[]);S(this,"drainDisabled",!1);S(this,"animState");this.animState=e}start(e){this.objects.push(js.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(js.interrupt),this.objects.push(e)}end(e){this.objects.push(js.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(js.dispose),this.objects.push(e)}complete(e){this.objects.push(js.complete),this.objects.push(e)}event(e,t){this.objects.push(js.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(s[1]),h.height=parseInt(s[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Re.enumValue(gs,s[1]),h.magFilter=Re.enumValue(gs,s[2])},n.repeat=h=>{s[1].indexOf("x")!=-1&&(h.uWrap=Dn.Repeat),s[1].indexOf("y")!=-1&&(h.vWrap=Dn.Repeat)},n.pma=h=>{h.pma=s[1]=="true"};var r={};r.xy=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2])},r.size=h=>{h.width=parseInt(s[1]),h.height=parseInt(s[2])},r.bounds=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2]),h.width=parseInt(s[3]),h.height=parseInt(s[4])},r.offset=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2])},r.orig=h=>{h.originalWidth=parseInt(s[1]),h.originalHeight=parseInt(s[2])},r.offsets=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2]),h.originalWidth=parseInt(s[3]),h.originalHeight=parseInt(s[4])},r.rotate=h=>{let u=s[1];u=="true"?h.degrees=90:u!="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(s[1])};let o=t.readLine();for(;o&&o.trim().length==0;)o=t.readLine();for(;!(!o||o.trim().length==0||t.readEntry(s,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 tw(a,o);for(;;){let u=t.readEntry(s,o=t.readLine());if(u==0)break;let d=r[s[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(s[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 HR(o.trim());t.readEntry(s,o=t.readLine())!=0;){let h=n[s[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 s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let n=1,r=s+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}}},HR=class{constructor(e){S(this,"name");S(this,"minFilter",gs.Nearest);S(this,"magFilter",gs.Nearest);S(this,"uWrap",Dn.ClampToEdge);S(this,"vWrap",Dn.ClampToEdge);S(this,"texture",null);S(this,"width",0);S(this,"height",0);S(this,"pma",!1);S(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}},tw=class extends GR{constructor(t,s){super();S(this,"page");S(this,"name");S(this,"x",0);S(this,"y",0);S(this,"offsetX",0);S(this,"offsetY",0);S(this,"originalWidth",0);S(this,"originalHeight",0);S(this,"index",0);S(this,"degrees",0);S(this,"names",null);S(this,"values",null);this.page=t,this.name=s,t.regions.push(this)}},Il=class hm extends Gn{constructor(t,s){super(t);S(this,"region",null);S(this,"path");S(this,"regionUVs",[]);S(this,"uvs",[]);S(this,"triangles",[]);S(this,"color",new rt(1,1,1,1));S(this,"width",0);S(this,"height",0);S(this,"hullLength",0);S(this,"edges",[]);S(this,"parentMesh",null);S(this,"sequence",null);S(this,"tempColor",new rt(0,0,0,0));this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=Re.newFloatArray(t.length));let s=this.uvs,n=this.uvs.length,r=this.region.u,o=this.region.v,a=0,c=0;if(this.region instanceof tw){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=s}};var Wt;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(Wt||(Wt={}));let Bv=class{constructor(e,t,s){S(this,"data");S(this,"skeleton");S(this,"parent",null);S(this,"children",new Array);S(this,"x",0);S(this,"y",0);S(this,"rotation",0);S(this,"scaleX",0);S(this,"scaleY",0);S(this,"shearX",0);S(this,"shearY",0);S(this,"ax",0);S(this,"ay",0);S(this,"arotation",0);S(this,"ascaleX",0);S(this,"ascaleY",0);S(this,"ashearX",0);S(this,"ashearY",0);S(this,"a",0);S(this,"b",0);S(this,"c",0);S(this,"d",0);S(this,"worldY",0);S(this,"worldX",0);S(this,"inherit",Wt.Normal);S(this,"sorted",!1);S(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=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,n,r,o,a){this.ax=e,this.ay=t,this.arotation=s,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=(s+o)*Ee.degRad,v=(s+90+a)*Ee.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 Wt.Normal:{const f=(s+o)*Ee.degRad,p=(s+90+a)*Ee.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 Wt.OnlyTranslation:{const f=(s+o)*Ee.degRad,p=(s+90+a)*Ee.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 Wt.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)*Ee.radDeg):(l=0,u=0,g=90-Math.atan2(d,h)*Ee.radDeg);const v=(s+o-g)*Ee.degRad,x=(s+a-g+90)*Ee.degRad,y=Math.cos(v)*n,M=Math.cos(x)*r,_=Math.sin(v)*n,w=Math.sin(x)*r;this.a=l*y-h*_,this.b=l*M-h*w,this.c=u*y+d*_,this.d=u*M+d*w;break}case Wt.NoScale:case Wt.NoScaleOrReflection:{s*=Ee.degRad;const f=Math.cos(s),p=Math.sin(s);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==Wt.NoScale&&l*d-h*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v),s=Math.PI/2+Math.atan2(g,m);const x=Math.cos(s)*v,y=Math.sin(s)*v;o*=Ee.degRad,a=(90+a)*Ee.degRad;const M=Math.cos(o)*n,_=Math.cos(a)*r,w=Math.sin(o)*n,b=Math.sin(a)*r;this.a=m*M+x*w,this.b=m*_+x*b,this.c=g*M+y*w,this.d=g*_+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)*Ee.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)*Ee.radDeg;return}let t=e.a,s=e.b,n=e.c,r=e.d,o=1/(t*r-s*n),a=r*o,c=s*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==Wt.OnlyTranslation)f=this.a,p=this.b,m=this.c,g=this.d;else{switch(this.inherit){case Wt.NoRotationOrReflection:{let _=Math.abs(t*r-s*n)/(t*t+n*n);s=-n*this.skeleton.scaleX*_/this.skeleton.scaleY,r=t*this.skeleton.scaleY*_/this.skeleton.scaleX,o=1/(t*r-s*n),a=r*o,c=s*o;break}case Wt.NoScale:case Wt.NoScaleOrReflection:let v=Ee.cosDeg(this.rotation),x=Ee.sinDeg(this.rotation);t=(t*v+s*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==Wt.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y);let M=Ee.PI/2+Math.atan2(n,t);s=Math.cos(M)*y,r=Math.sin(M)*y,o=1/(t*r-s*n),a=r*o,c=s*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)*Ee.radDeg,this.arotation=Math.atan2(m,f)*Ee.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*Ee.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*Ee.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*Ee.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,n=e.y-this.worldY;return e.x=s*this.d*t-n*this.b*t,e.y=n*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=Ee.sinDeg(e),s=Ee.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*Ee.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=Ee.sinDeg(e),s=Ee.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*Ee.radDeg}rotateWorld(e){e*=Ee.degRad;const t=Math.sin(e),s=Math.cos(e),n=this.a,r=this.b;this.a=s*n-t*this.c,this.b=s*r-t*this.d,this.c=t*n+s*this.c,this.d=t*r+s*this.d}},uu=class{constructor(e,t,s){S(this,"name");S(this,"order");S(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=s}},ow=class{constructor(e,t){S(this,"data");S(this,"intValue",0);S(this,"floatValue",0);S(this,"stringValue",null);S(this,"time",0);S(this,"volume",0);S(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},aw=class{constructor(e){S(this,"name");S(this,"intValue",0);S(this,"floatValue",0);S(this,"stringValue",null);S(this,"audioPath",null);S(this,"volume",0);S(this,"balance",0);this.name=e}},WR=class{constructor(e,t){S(this,"data");S(this,"bones");S(this,"target");S(this,"bendDirection",0);S(this,"compress",!1);S(this,"stretch",!1);S(this,"mix",1);S(this,"softness",0);S(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 Wt.NoScale:case Wt.NoScaleOrReflection:p=t-e.worldX,m=s-e.worldY}const x=e.data.length*g;if(x>1e-4){const y=p*p+m*m;if(n&&yx*x){const M=(Math.sqrt(y)/x-1)*a+1;g*=M,o&&(v*=M)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*a,g,v,e.ashearX,e.ashearY)}apply2(e,t,s,n,r,o,a,c,l){if(e.inherit!=Wt.Normal||t.inherit!=Wt.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 M=t.ax,_=0,w=0,b=0,C=e.a,R=e.b,F=e.c,I=e.d,k=Math.abs(d-f)<=1e-4;!k||o?(_=0,w=C*M+e.worldX,b=F*M+e.worldY):(_=t.ay,w=C*M+R*_+e.worldX,b=F*M+I*_+e.worldY);let B=e.parent;if(!B)throw new Error("IK parent must itself have a parent.");C=B.a,R=B.b,F=B.c,I=B.d;let D=C*I-R*F,$=w-B.worldX,N=b-B.worldY;D=Math.abs(D)<=1e-4?0:1/D;let X=($*I-N*R)*D-h,A=(N*C-$*F)*D-u,P=Math.sqrt(X*X+A*A),O=t.data.length*g,L,U;if(P<1e-4){this.apply1(e,s,n,!1,o,!1,l),t.updateWorldTransformWith(M,_,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}$=s-B.worldX,N=n-B.worldY;let V=($*I-N*R)*D-h,H=(N*C-$*F)*D-u,q=V*V+H*H;if(c!=0){c*=d*(g+1)*.5;let pe=Math.sqrt(q),ge=pe-P-O*d+c;if(ge>0){let he=Math.min(1,ge/(c*2))-1;he=(ge-c*(1-he*he))/pe,V-=he*V,H-=he*H,q=V*V+H*H}}e:if(k){O*=d;let pe=(q-P*P-O*O)/(2*P*O);pe<-1?(pe=-1,U=Math.PI*r):pe>1?(pe=1,U=0,o&&(C=(Math.sqrt(q)/(P+O)-1)*l+1,p*=C,a&&(m*=C))):U=Math.acos(pe)*r,C=P+O*pe,R=O*Math.sin(U),L=Math.atan2(H*C-V*R,V*C+H*R)}else{C=d*O,R=f*O;let pe=C*C,ge=R*R,he=Math.atan2(H,V);F=ge*P*P+pe*q-pe*ge;let fe=-2*ge*P,Y=ge-pe;if(I=fe*fe-4*Y*F,I>=0){let le=Math.sqrt(I);fe<0&&(le=-le),le=-(fe+le)*.5;let Ie=le/Y,ye=F/le,me=Math.abs(Ie)=0){N=Math.sqrt(Ie)*r,L=he-Math.atan2(N,me),U=Math.atan2(N/f,(me-P)/d);break e}}let W=Ee.PI,j=P-C,G=j*j,z=0,se=0,ue=P+C,ne=ue*ue,de=0;F=-C*P/(pe-ge),F>=-1&&F<=1&&(F=Math.acos(F),$=C*Math.cos(F)+P,N=R*Math.sin(F),I=$*$+N*N,Ine&&(se=F,ne=I,ue=$,de=N)),q<=(G+ne)*.5?(L=he-Math.atan2(z*r,j),U=W*r):(L=he-Math.atan2(de*r,ue),U=se*r)}let ie=Math.atan2(_,M)*y,re=e.arotation;L=(L-ie)*Ee.radDeg+v-re,L>180?L-=360:L<-180&&(L+=360),e.updateWorldTransformWith(h,u,re+L*l,p,m,0,0),re=t.arotation,U=((U+ie)*Ee.radDeg-t.ashearX)*y+x-re,U>180?U-=360:U<-180&&(U+=360),t.updateWorldTransformWith(M,_,re+U*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},lw=class extends uu{constructor(t){super(t,0,!1);S(this,"bones",new Array);S(this,"_target",null);S(this,"bendDirection",0);S(this,"compress",!1);S(this,"stretch",!1);S(this,"uniform",!1);S(this,"mix",0);S(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},cw=class extends uu{constructor(t){super(t,0,!1);S(this,"bones",new Array);S(this,"_target",null);S(this,"positionMode",an.Fixed);S(this,"spacingMode",us.Fixed);S(this,"rotateMode",ro.Chain);S(this,"offsetRotation",0);S(this,"position",0);S(this,"spacing",0);S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var an;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(an||(an={}));var us;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(us||(us={}));var ro;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(ro||(ro={}));var Rs;let zR=(Rs=class{constructor(e,t){S(this,"data");S(this,"bones");S(this,"target");S(this,"position",0);S(this,"spacing",0);S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0);S(this,"spaces",new Array);S(this,"positions",new Array);S(this,"world",new Array);S(this,"curves",new Array);S(this,"lengths",new Array);S(this,"segments",new Array);S(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){M=u/M*p;for(let w=1;w0?Ee.degRad:-.01745329277777778}for(let M=0,_=3;M0){let I=w.a,k=w.b,B=w.c,D=w.d,$=0,N=0,X=0;if(a?$=m[_-1]:d[M+1]==0?$=m[_+2]:$=Math.atan2(F,R),$-=Math.atan2(B,I),y){N=Math.cos($),X=Math.sin($);let A=w.data.length;g+=(A*(N*I-X*B)-R)*s,v+=(A*(X*I+N*B)-F)*s}else $+=x;$>Ee.PI?$-=Ee.PI2:$<-3.1415927&&($+=Ee.PI2),$*=s,N=Math.cos($),X=Math.sin($),w.a=N*I-X*B,w.b=N*k-X*D,w.c=X*I+N*B,w.d=X*k+N*D}w.updateAppliedTransform()}}computeWorldPositions(e,t,s){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=Rs.NONE;if(!e.constantSpeed){let A=e.lengths;u-=l?1:2;let P=A[u];this.data.positionMode==an.Percent&&(r*=P);let O;switch(this.data.spacingMode){case us.Percent:O=P;break;case us.Proportional:O=P/t;break;default:O=1}c=Re.setArraySize(this.world,8);for(let L=0,U=0,V=0;LP){d!=Rs.AFTER&&(d=Rs.AFTER,e.computeWorldVertices(n,h-6,4,c,0,2)),this.addAfterPosition(q-P,c,0,a,U);continue}for(;;V++){let ie=A[V];if(!(q>ie)){if(V==0)q/=ie;else{let re=A[V-1];q=(q-re)/(ie-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(q,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],a,U,s||L>0&&H==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,M=0,_=0,w=0,b=0,C=0,R=0,F=0,I=0,k=0,B=0,D=0;for(let A=0,P=2;Ap){this.addAfterPosition(V-p,c,h-4,a,P);continue}for(;;O++){let H=f[O];if(!(V>H)){if(O==0)V/=H;else{let q=f[O-1];V=(V-q)/(H-q)}break}}if(O!=d){d=O;let H=O*6;for(m=c[H],g=c[H+1],v=c[H+2],x=c[H+3],y=c[H+4],M=c[H+5],_=c[H+6],w=c[H+7],b=(m-v*2+y)*.03,C=(g-x*2+M)*.03,R=((v-y)*3-m+_)*.006,F=((x-M)*3-g+w)*.006,I=b*2+R,k=C*2+F,B=(v-m)*.3+b+R*.16666667,D=(x-g)*.3+C+F*.16666667,X=Math.sqrt(B*B+D*D),N[0]=X,H=1;H<8;H++)B+=I,D+=k,I+=R,k+=F,X+=Math.sqrt(B*B+D*D),N[H]=X;B+=I,D+=k,X+=Math.sqrt(B*B+D*D),N[8]=X,B+=I+R,D+=k+F,X+=Math.sqrt(B*B+D*D),N[9]=X,L=0}for(V*=X;;L++){let H=N[L];if(!(V>H)){if(L==0)V/=H;else{let q=N[L-1];V=L+(V-q)/(H-q)}break}}this.addCurvePosition(V*.1,m,g,v,x,y,M,_,w,a,P,s||A>0&&U==0)}return a}addBeforePosition(e,t,s,n,r){let o=t[s],a=t[s+1],c=t[s+2]-o,l=t[s+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,s,n,r){let o=t[s+2],a=t[s+3],c=o-t[s],l=a-t[s+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,s,n,r,o,a,c,l,h,u,d){if(e==0||isNaN(e)){h[u]=t,h[u+1]=s,h[u+2]=Math.atan2(r-s,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=m*y,_=y*e,w=t*v+n*M+o*_+c*p,b=s*v+r*M+a*_+l*p;h[u]=w,h[u+1]=b,d&&(e<.001?h[u+2]=Math.atan2(r-s,n-t):h[u+2]=Math.atan2(b-(s*g+r*x*2+a*f),w-(t*g+n*x*2+o*f)))}},S(Rs,"NONE",-1),S(Rs,"BEFORE",-2),S(Rs,"AFTER",-3),S(Rs,"epsilon",1e-5),Rs),qR=class{constructor(e,t){S(this,"data");S(this,"_bone",null);S(this,"inertia",0);S(this,"strength",0);S(this,"damping",0);S(this,"massInverse",0);S(this,"wind",0);S(this,"gravity",0);S(this,"mix",0);S(this,"_reset",!0);S(this,"ux",0);S(this,"uy",0);S(this,"cx",0);S(this,"cy",0);S(this,"tx",0);S(this,"ty",0);S(this,"xOffset",0);S(this,"xVelocity",0);S(this,"yOffset",0);S(this,"yVelocity",0);S(this,"rotateOffset",0);S(this,"rotateVelocity",0);S(this,"scaleOffset",0);S(this,"scaleVelocity",0);S(this,"active",!1);S(this,"skeleton");S(this,"remaining",0);S(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 s=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 lr.none:return;case lr.reset:this.reset();case lr.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),s||n){if(s){const M=(this.ux-u)*p;this.xOffset+=M>x?x:M<-x?-x:M,this.ux=u}if(n){const M=(this.uy-d)*p;this.yOffset+=M>y?y:M<-y?-y:M,this.uy=d}if(f>=m){v=Math.pow(this.damping,60*m);const M=this.massInverse*m,_=this.strength,w=this.wind*g*l.scaleX,b=this.gravity*g*l.scaleY;do s&&(this.xVelocity+=(w-this.xOffset*_)*M,this.xOffset+=this.xVelocity*m,this.xVelocity*=v),n&&(this.yVelocity-=(b+this.yOffset*_)*M,this.yOffset+=this.yVelocity*m,this.yVelocity*=v),f-=m;while(f>=m)}s&&(a.worldX+=this.xOffset*t*this.data.x),n&&(a.worldY+=this.yOffset*t*this.data.y)}if(r||o){let M=Math.atan2(a.c,a.a),_=0,w=0,b=0,C=this.cx-a.worldX,R=this.cy-a.worldY;if(C>x?C=x:C<-x&&(C=-x),R>y?R=y:R<-y&&(R=-y),r){b=(this.data.rotate+this.data.shearX)*t;let F=Math.atan2(R+this.ty,C+this.tx)-M-this.rotateOffset*b;this.rotateOffset+=(F-Math.ceil(F*Ee.invPI2-.5)*Ee.PI2)*p,F=this.rotateOffset*b+M,_=Math.cos(F),w=Math.sin(F),o&&(F=c*a.getWorldScaleX(),F>0&&(this.scaleOffset+=(C*_+R*w)*p/F))}else{_=Math.cos(M),w=Math.sin(M);const F=c*a.getWorldScaleX();F>0&&(this.scaleOffset+=(C*_+R*w)*p/F)}if(f=this.remaining,f>=m){v==-1&&(v=Math.pow(this.damping,60*m));const F=this.massInverse*m,I=this.strength,k=this.wind,B=yp.yDown?-this.gravity:this.gravity,D=c/g;for(;;)if(f-=m,o&&(this.scaleVelocity+=(k*_-B*w-this.scaleOffset*I)*F,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=v),r){if(this.rotateVelocity-=((k*w+B*_)*D+this.rotateOffset*I)*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!=lr.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,s){const n=s*Ee.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)}},KR=class{constructor(e,t){S(this,"data");S(this,"bone");S(this,"color");S(this,"darkColor",null);S(this,"attachment",null);S(this,"attachmentState",0);S(this,"sequenceIndex",-1);S(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 rt,this.darkColor=e.darkColor?new rt:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof Gn)||!(this.attachment instanceof Gn)||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}},ZR=class{constructor(e,t){S(this,"data");S(this,"bones");S(this,"target");S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0);S(this,"mixScaleX",0);S(this,"mixScaleY",0);S(this,"mixShearY",0);S(this,"temp",new mh);S(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?Ee.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,x=g.length;vEe.PI?C-=Ee.PI2:C<-3.1415927&&(C+=Ee.PI2),C*=e;let R=Math.cos(C),F=Math.sin(C);y.a=R*M-F*w,y.b=R*_-F*b,y.c=F*M+R*w,y.d=F*_+R*b}if(a){let M=this.temp;c.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(M.x-y.worldX)*t,y.worldY+=(M.y-y.worldY)*s}if(n!=0){let M=Math.sqrt(y.a*y.a+y.c*y.c);M!=0&&(M=(M+(Math.sqrt(l*l+u*u)-M+this.data.offsetScaleX)*n)/M),y.a*=M,y.c*=M}if(r!=0){let M=Math.sqrt(y.b*y.b+y.d*y.d);M!=0&&(M=(M+(Math.sqrt(h*h+d*d)-M+this.data.offsetScaleY)*r)/M),y.b*=M,y.d*=M}if(o>0){let M=y.b,_=y.d,w=Math.atan2(_,M),b=Math.atan2(d,h)-Math.atan2(u,l)-(w-Math.atan2(y.c,y.a));b>Ee.PI?b-=Ee.PI2:b<-3.1415927&&(b+=Ee.PI2),b=w+(b+m)*o;let C=Math.sqrt(M*M+_*_);y.b=Math.cos(b)*C,y.d=Math.sin(b)*C}y.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=t!=0||s!=0,c=this.target,l=c.a,h=c.b,u=c.c,d=c.d,f=l*d-h*u>0?Ee.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,x=g.length;vEe.PI?C-=Ee.PI2:C<-3.1415927&&(C+=Ee.PI2),C*=e;let R=Math.cos(C),F=Math.sin(C);y.a=R*M-F*w,y.b=R*_-F*b,y.c=F*M+R*w,y.d=F*_+R*b}if(a){let M=this.temp;c.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),y.worldX+=M.x*t,y.worldY+=M.y*s}if(n!=0){let M=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*n+1;y.a*=M,y.c*=M}if(r!=0){let M=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*r+1;y.b*=M,y.d*=M}if(o>0){let M=Math.atan2(d,h)-Math.atan2(u,l);M>Ee.PI?M-=Ee.PI2:M<-3.1415927&&(M+=Ee.PI2);let _=y.b,w=y.d;M=Math.atan2(w,_)+(M-Ee.PI/2+m)*o;let b=Math.sqrt(_*_+w*w);y.b=Math.cos(M)*b,y.d=Math.sin(M)*b}y.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=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 mh,s=new mh;return this.getBounds(t,s,void 0,e),{x:t.x,y:t.y,width:s.x,height:s.y}}getBounds(e,t,s=new Array(2),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]=s}addSkin(e){for(let n=0;n= 0.");if(!t)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=s}};var pr;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(pr||(pr={}));let dw=class extends uu{constructor(t){super(t,0,!1);S(this,"bones",new Array);S(this,"_target",null);S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0);S(this,"mixScaleX",0);S(this,"mixScaleY",0);S(this,"mixShearY",0);S(this,"offsetRotation",0);S(this,"offsetX",0);S(this,"offsetY",0);S(this,"offsetScaleX",0);S(this,"offsetScaleY",0);S(this,"offsetShearY",0);S(this,"relative",!1);S(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},fm=class{constructor(e){S(this,"scale",1);S(this,"attachmentLoader");S(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new gh;s.name="";let n=new JR(e),r=n.readInt32(),o=n.readInt32();s.hash=o==0&&r==0?null:o.toString(16)+r.toString(16),s.version=n.readString(),s.x=n.readFloat(),s.y=n.readFloat(),s.width=n.readFloat(),s.height=n.readFloat(),s.referenceScale=n.readFloat()*t;let a=n.readBoolean();a&&(s.fps=n.readFloat(),s.imagesPath=n.readString(),s.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==an.Fixed&&(f.position*=t),f.spacing=n.readFloat(),(f.spacingMode==us.Length||f.spacingMode==us.Fixed)&&(f.spacing*=t),f.mixRotate=n.readFloat(),f.mixX=n.readFloat(),f.mixY=n.readFloat(),s.pathConstraints.push(f)}c=n.readInt(!0);for(let h=0,u;h>4,e.readFloat())}n.push(w);break}}}}}let o=e.readInt(!0);if(o>0){let l=new qa(o),h=s.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 vp(a);for(let h=0;h>>1^-(s&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let s=0;s>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),s+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:t+=String.fromCharCode(n),s++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},QR=class{constructor(e,t,s,n,r){S(this,"parent");S(this,"skinIndex");S(this,"slotIndex");S(this,"mesh");S(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.parent=n,this.inheritTimeline=r}},eP=class{constructor(e=null,t=null,s=0){S(this,"bones");S(this,"vertices");S(this,"length");this.bones=e,this.vertices=t,this.length=s}};var bn;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(bn||(bn={}));function As(i,e,t){let s=i.readFloat(),n=i.readFloat()*t;for(let r=0,o=0,a=e.getFrameCount()-1;e.setFrame(r,s,n),r!=a;r++){let c=i.readFloat(),l=i.readFloat()*t;switch(i.readByte()){case Gi:e.setStepped(r);break;case ji:ut(i,e,o++,r,0,s,c,n,l,t)}s=c,n=l}return e}function of(i,e,t){let s=i.readFloat(),n=i.readFloat()*t,r=i.readFloat()*t;for(let o=0,a=0,c=e.getFrameCount()-1;e.setFrame(o,s,n,r),o!=c;o++){let l=i.readFloat(),h=i.readFloat()*t,u=i.readFloat()*t;switch(i.readByte()){case Gi:e.setStepped(o);break;case ji:ut(i,e,a++,o,0,s,l,n,h,t),ut(i,e,a++,o,1,s,l,r,u,t)}s=l,n=h,r=u}return e}function ut(i,e,t,s,n,r,o,a,c,l){e.setBezier(t,s,n,r,a,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,o,c)}const tP=0,sP=1,iP=2,nP=3,rP=4,oP=5,aP=6,lP=7,cP=8,hP=9,uP=10,dP=0,fP=1,mP=2,pP=3,gP=4,vP=5,yP=0,xP=1,bP=0,wP=1,SP=2,MP=0,TP=1,_P=2,CP=4,AP=5,EP=6,IP=7,RP=8,Gi=1,ji=2;class Hs{constructor(){S(this,"convexPolygons",new Array);S(this,"convexPolygonsIndices",new Array);S(this,"indicesArray",new Array);S(this,"isConcaveArray",new Array);S(this,"triangles",new Array);S(this,"polygonPool",new fh(()=>new Array));S(this,"polygonIndicesPool",new fh(()=>new Array))}triangulate(e){let t=e,s=e.length>>1,n=this.indicesArray;n.length=0;for(let a=0;a3;){let a=s-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],M=t[p+1];for(let _=(l+1)%s;_!=a;_=(_+1)%s){if(!r[_])continue;let w=n[_]<<1,b=t[w],C=t[w+1];if(Hs.positiveArea(y,M,m,g,b,C)&&Hs.positiveArea(m,g,v,x,b,C)&&Hs.positiveArea(v,x,y,M,b,C))break e}break}if(l==0){do{if(!r[c])break;c--}while(c>0);break}a=c,c=l,l=(l+1)%s}o.push(n[(s+c-1)%s]),o.push(n[c]),o.push(n[(c+1)%s]),n.splice(c,1),r.splice(c,1),s--;let h=(s+c-1)%s,u=c==s?0:c;r[h]=Hs.isConcave(h,s,t,n),r[u]=Hs.isConcave(u,s,t,n)}return s==3&&(o.push(n[2]),o.push(n[0]),o.push(n[1])),o}decompose(e,t){let s=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(M),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(d),o.push(f),o.push(p),l=Hs.winding(m,g,v,x,y,M),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,s,n){let r=n[(t+e-1)%t]<<1,o=n[e]<<1,a=n[(e+1)%t]<<1;return!this.positiveArea(s[r],s[r+1],s[o],s[o+1],s[a],s[a+1])}static positiveArea(e,t,s,n,r,o){return e*(o-n)+s*(t-o)+r*(n-t)>=0}static winding(e,t,s,n,r,o){let a=s-e,c=n-t;return r*c-o*a+a*t-e*c>=0?1:-1}}class vh{constructor(){S(this,"triangulator",new Hs);S(this,"clippingPolygon",new Array);S(this,"clipOutput",new Array);S(this,"clippedVertices",new Array);S(this,"clippedUVs",new Array);S(this,"clippedTriangles",new Array);S(this,"scratch",new Array);S(this,"clipAttachment",null);S(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let s=t.worldVerticesLength,n=Re.setArraySize(this.clippingPolygon,s);t.computeWorldVertices(e,0,s,n,0,2);let r=this.clippingPolygon;vh.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let a=0,c=o.length;a>1,w=this.clipOutput,b=Re.setArraySize(r,y+_*2);for(let R=0;R>1,U=this.clipOutput,V=Re.setArraySize(l,D+L*f);for(let q=0;q<$;q+=2,D+=f){let ie=U[q],re=U[q+1];V[D]=ie,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 pe=ie-R,ge=re-F,he=(N*pe+X*ge)*O,fe=(P*pe+A*ge)*O,Y=1-he-fe;V[D+6]=y*he+b*fe+I*Y,V[D+7]=M*he+C*fe+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 H=Re.setArraySize(h,D+3*(L-2));L--;for(let q=1;q>1,P=this.clipOutput,O=Re.setArraySize(o,I+A*2),L=Re.setArraySize(a,I+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(s),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,M=u;for(let w=0,b=u.length-2;wv*(g-I),B=x*(m-C)-v*(g-R);if(B>0){if(k){c.push(F),c.push(I);continue}let D=F-C,$=I-R,N=B/(D*x-$*v);if(N>=0&&N<=1)c.push(C+D*N),c.push(R+$*N);else{c.push(F),c.push(I);continue}}else if(k){let D=F-C,$=I-R,N=B/(D*x-$*v);if(N>=0&&N<=1)c.push(C+D*N),c.push(R+$*N),c.push(F),c.push(I);else{c.push(F),c.push(I);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=u,c.length=0,u=_}if(l!=c){l.length=0;for(let p=0,m=c.length-2;p>1;l0){let h=s.findPhysicsConstraint(a);if(!h)throw new Error("Physics constraint not found: "+a);l=s.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 q1(f,l);for(let g=0;d!=null;d=u[g+1],g++)m.setFrame(g,ee(d,"time",0));r.push(m);continue}let p;if(h=="inertia")p=new V1(f,f,l);else if(h=="strength")p=new Y1(f,f,l);else if(h=="damping")p=new G1(f,f,l);else if(h=="mass")p=new j1(f,f,l);else if(h=="wind")p=new H1(f,f,l);else if(h=="gravity")p=new W1(f,f,l);else if(h=="mix")p=new z1(f,f,l);else continue;r.push(bi(u,p,0,1))}}if(e.attachments)for(let a in e.attachments){let c=e.attachments[a],l=s.findSkin(a);if(!l)throw new Error("Skin not found: "+a);for(let h in c){let u=c[h],d=s.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 M=g.bones,_=g.vertices,w=M?_.length/3*2:_.length,b=new B1(x.length,x.length,f,g),C=ee(y,"time",0);for(let R=0,F=0;;R++){let I,k=ee(y,"vertices",null);if(!k)I=M?Re.newFloatArray(w):_;else{I=Re.newFloatArray(w);let N=ee(y,"offset",0);if(Re.arrayCopy(k,0,I,N,k.length),n!=1)for(let X=N,A=X+k.length;X=0;v--)d[v]==-1&&(d[v]=p[--g])}a.setFrame(l,ee(u,"time",0),d)}r.push(a)}if(e.events){let a=new vp(e.events.length),c=0;for(let l=0;l"u"&&(Math.fround=(function(i){return function(e){return i[0]=e,i[0]}})(new Float32Array(1)));if(typeof window<"u"&&window.PIXI){let i=window.require;window.require=e=>{if(i)return i(e);if(e.startsWith("@pixi/"))return window.PIXI}}const Sn=class Sn extends YR{constructor(t){super(t.resource.source);S(this,"texture");this.texture=ze.from(t)}static from(t){return Sn.textureMap.has(t)?Sn.textureMap.get(t):new Sn(t)}setFilters(t,s){this.texture.baseTexture.scaleMode=Sn.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=Sn.toPixiMipMap(t)}setWraps(t,s){this.texture.baseTexture.wrapMode=Sn.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case gs.Nearest:case gs.MipMapNearestLinear:case gs.MipMapNearestNearest:return Ci.NEAREST;case gs.Linear:case gs.MipMapLinearLinear:case gs.MipMapLinearNearest:return Ci.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case gs.Nearest:case gs.Linear:return gi.OFF;case gs.MipMapNearestLinear:case gs.MipMapNearestNearest:case gs.MipMapLinearLinear:case gs.MipMapLinearNearest:return gi.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case Dn.ClampToEdge:return Ii.CLAMP;case Dn.MirroredRepeat:return Ii.MIRRORED_REPEAT;case Dn.Repeat:return Ii.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case pr.Normal:return He.NORMAL;case pr.Additive:return He.ADD;case pr.Multiply:return He.MULTIPLY;case pr.Screen:return He.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};S(Sn,"textureMap",new Map);let ho=Sn;const Mn=class Mn extends pl{constructor(){const t=new up;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const s=new ch(ze.EMPTY);super(t,s);S(this,"name","");S(this,"warnedTwoTint",!1)}updateFromSpineData(t,s,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 mm);S(this,"beforeUpdateWorldTransforms",()=>{});S(this,"afterUpdateWorldTransforms",()=>{});S(this,"_autoUpdate",!1);S(this,"_ticker",Ys.shared);S(this,"meshesCache",new Map);S(this,"lightColor",new rt);S(this,"darkColor",new rt);S(this,"_boundsProvider");S(this,"_boundsPoint",new gt);S(this,"_boundsSpineID",-1);S(this,"_boundsSpineDirty",!0);S(this,"slotsObject",new Map);S(this,"verticesCache",Re.newFloatArray(1024));S(this,"clippingSlotToPixiMasks",{});S(this,"currentClippingSlot");const n=t instanceof gh?t:t.skeletonData;this.skeleton=new yp(n);const r=new VR(n);this.state=new NR(r),(t==null?void 0:t.darkTint)!==void 0||(s==null?void 0:s.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 Ka)):this.initializeMeshFactory(s==null?void 0:s.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??Ys.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 s=this.slotMeshFactory();s instanceof Ka&&(this.darkTint=!0),s.destroy()}else for(let s=0;snew Ka,this.darkTint=!0;break}}update(t){this.internalUpdate(0,t)}internalUpdate(t,s){this.hasNeverUpdated=!1;const n=s??this._ticker.deltaMS/1e3;this.state.update(n),this.state.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.update(n),this.skeleton.updateWorldTransform(lr.update),this.afterUpdateWorldTransforms(this)}updateTransform(){var t;this.renderMeshes(),this.sortChildren(),(t=this.debug)==null||t.renderDebug(this),super.updateTransform()}destroy(t){var s;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)(s=this.clippingSlotToPixiMasks[n].mask)==null||s.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 s=this.meshesCache.get(t);return s.visible=!0,s}else{let s=this.slotMeshFactory();return this.addChild(s),this.meshesCache.set(t,s),s}}getSlotFromRef(t){let s;if(typeof t=="number"?s=this.skeleton.slots[t]:typeof t=="string"?s=this.skeleton.findSlot(t):s=t,!s)throw new Error(`No slot found with the given slot reference: ${t}`);return s}addSlotObject(t,s,n){var a;let r=this.getSlotFromRef(t);const o=(a=this.slotsObject.get(r))==null?void 0:a.container;if(!(o&&o===s)){for(const[c,{container:l}]of this.slotsObject)if(c!==r&&l===s){this.removeSlotObject(c,s);break}o&&this.removeChild(o),this.slotsObject.set(r,{container:s,followAttachmentTimeline:(n==null?void 0:n.followAttachmentTimeline)||!1,followSlotColor:(n==null?void 0:n.followSlotColor)||!1}),this.addChild(s)}}getSlotObject(t){const s=this.slotsObject.get(this.getSlotFromRef(t));return s?s.container:void 0}removeSlotObject(t,s){var o;let n=this.getSlotFromRef(t),r=(o=this.slotsObject.get(n))==null?void 0:o.container;r&&(s&&s!==r||(this.removeChild(r),this.slotsObject.delete(n)))}removeSlotObjects(){for(const[,t]of this.slotsObject)t.container.removeFromParent();this.slotsObject.clear()}updateSlotObject(t,s,n){const{container:r,followAttachmentTimeline:o}=t,a=o?!!s.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(s)&&a,r.visible){let c=s.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*s.color.a,t.followSlotColor&&this.setSlotObjectTint(r,255*this.skeleton.color.r*s.color.r<<16|255*this.skeleton.color.g*s.color.g<<8|255*this.skeleton.color.b*s.color.b)}}setSlotObjectTint(t,s){const n=t;"tint"in n&&(n.tint=s);for(const r of n.children??[])this.setSlotObjectTint(r,s)}updateAndSetPixiMask(t,s){var a,c;const n=t.attachment;if(n&&n instanceof Qo){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=Dv.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),s){for(const l in this.clippingSlotToPixiMasks){const h=this.clippingSlotToPixiMasks[l];(!(h.slot.attachment instanceof Qo)||!h.maskComputed)&&h.mask&&(this.removeChild(h.mask),Dv.free(h.mask),h.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var r,o;this.resetMeshes();let t=null,s=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,s=y.uvs,v=(o=y.region)==null?void 0:o.texture}else if(m instanceof Qo){xt.clipper.clipStart(h,m);continue}else{this.hasMeshForSlot(h)&&(this.getMeshForSlot(h).visible=!1),xt.clipper.clipEndWithSlot(h);continue}if(v!=null){const M=h.bone.skeleton.color,_=h.color,w=M.a*_.a*g.a;this.lightColor.set(M.r*_.r*g.r,M.g*_.g*g.g,M.b*_.b*g.b,w),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,C,R,F;if(xt.clipper.isClipping())xt.clipper.clipTriangles(this.verticesCache,t,t.length,s,this.lightColor,this.darkColor,f),b=xt.clipper.clippedVertices,C=b.length,R=xt.clipper.clippedTriangles,F=R.length;else{const k=this.verticesCache;for(let B=2,D=0,$=x;B<$;B+=p,D+=2){let N=B;k[N++]=this.lightColor.r,k[N++]=this.lightColor.g,k[N++]=this.lightColor.b,k[N++]=this.lightColor.a,k[N++]=s[D],k[N++]=s[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,C=x,R=t,F=t.length}if(C==0||F==0){xt.clipper.clipEndWithSlot(h);continue}const I=this.getMeshForSlot(h);I.renderable=!0,I.zIndex=d,I.updateFromSpineData(v,h.data.blendMode,h.data.name,b,C,R,F,f)}xt.clipper.clipEndWithSlot(h)}xt.clipper.clipEnd()}calculateBounds(){if(!this._boundsProvider){super.calculateBounds();return}const t=this.transform;if(this._boundsSpineID===t._worldID)return;this.updateBounds();const s=this._localBounds,n=this._boundsPoint;n.set(s.minX,s.minY),t.worldTransform.apply(n,n),this._bounds.minX=n.x,this._bounds.minY=n.y,n.set(s.maxX,s.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 ml);const t=this._boundsProvider.calculateBounds(this),s=this._localBounds;s.clear(),s.minX=t.x,s.minY=t.y,s.maxX=t.x+t.width,s.maxY=t.y+t.height,this.hitArea=this._localBounds.getRectangle()}setBonePosition(t,s){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(xt.vectorAux.set(s.x,s.y),t.parent){const r=t.parent.worldToLocal(xt.vectorAux);t.x=r.x,t.y=r.y}else t.x=xt.vectorAux.x,t.y=xt.vectorAux.y}getBonePosition(t,s){const n=t;return typeof t=="string"&&(t=this.skeleton.findBone(t)),t?(s||(s={x:0,y:0}),s.x=t.worldX,s.y=t.worldY,s):(console.error(`Cannot get bone position! Bone ${String(n)} not found`),s)}skeletonToPixiWorldCoordinates(t){this.worldTransform.apply(t,t)}pixiWorldCoordinatesToSkeleton(t){this.worldTransform.applyInverse(t,t)}pixiWorldCoordinatesToBone(t,s){this.pixiWorldCoordinatesToSkeleton(t),s.parent?s.parent.worldToLocal(t):s.worldToLocal(t)}static from(t,s,n){if(typeof t=="string")return xt.oldFrom(t,s,n);const{skeleton:r,atlas:o,scale:a=1,darkTint:c,autoUpdate:l,boundsProvider:h,ticker:u}=t,d=`${r}-${o}-${a}`;let f=xt.skeletonCache[d];if(!f){const p=nn.get(r),m=nn.get(o),g=new um(m);let v=p instanceof Uint8Array?new fm(g):new yh(g);v.scale=a,f=v.readSkeletonData(p),xt.skeletonCache[d]=f}return new xt({skeletonData:f,darkTint:c,autoUpdate:l,boundsProvider:h,ticker:u})}static oldFrom(t,s,n){const r=`${t}-${s}-${(n==null?void 0:n.scale)??1}`;let o=xt.skeletonCache[r];if(o)return new xt(o,n);const a=nn.get(t),c=nn.get(s),l=new um(c);let h=a instanceof Uint8Array?new fm(l):new yh(l);return h.scale=(n==null?void 0:n.scale)??1,o=h.readSkeletonData(a),xt.skeletonCache[r]=o,new this(o,n)}get tint(){return this.skeleton.color.toRgb888()}set tint(t){rt.rgb888ToColor(this.skeleton.color,t)}};S(xt,"vectorAux",new mh),S(xt,"clipper",new vh),S(xt,"QUAD_TRIANGLES",[0,1,2,2,3,0]),S(xt,"VERTEX_SIZE",8),S(xt,"DARK_VERTEX_SIZE",12),S(xt,"skeletonCache",Object.create(null));let xh=xt;const Dv=new fh(()=>new Ns);yp.yDown=!0;const mc="spineTextureAtlasLoader",NP={extension:Pe.Asset,resolver:{test:i=>qs(i,".atlas"),parse:i=>{var t,s;const e=i.split(".");return{resolution:parseFloat(((s=(t=Oe.RETINA_PREFIX)==null?void 0:t.exec(i))==null?void 0:s[1])??"1"),format:e[e.length-2],src:i}}},loader:{name:mc,extension:{type:Pe.LoadParser,priority:ii.Normal,name:mc},test(i){return qs(i,".atlas")},async load(i){const e=await Oe.ADAPTER.fetch(i);if(!e.ok)throw new Error(`[${mc}] Failed to fetch ${i}: ${e.status} ${e.statusText}`);return await e.text()},testParse(i,e){const t=qs(e.src,".atlas"),s=typeof i=="string",n=e.loadParser===mc;return Promise.resolve((t||n)&&s)},unload(i){i.dispose()},async parse(i,e,t){var c;const s=e.data||{};let n=Jt.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const r=new ew(i);if(s.images instanceof Qe||typeof s.images=="string"){const l=s.images;s.images={},s.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}nn.setPreferences({preferCreateImageBitmap:!1});for(const l of r.pages){const h=l.name,u=s!=null&&s.images?s.images[h]:void 0;if(u instanceof Qe)l.setTexture(ho.from(u));else{const d=u??Jt.normalize([...n.split(Jt.sep),h].join(Jt.sep)),f={src:nh(d,e.src),data:{...s.imageMetadata,alphaMode:l.pma?xs.PMA:xs.UNPACK}},p=t.load(f).then(m=>{l.setTexture(ho.from(m.baseTexture))});o.push(p)}}return await Promise.all(o),nn.setPreferences({preferCreateImageBitmap:a}),r}}};Ue.add(NP);const pc="spineSkeletonLoader";function DP(i){return i.hasOwnProperty("bones")}function UP(i){return i instanceof Uint8Array}const $P={extension:Pe.Asset,loader:{name:pc,extension:{type:Pe.LoadParser,priority:ii.Normal,name:pc},test(i){return qs(i,".skel")},async load(i){const e=await Oe.ADAPTER.fetch(i);if(!e.ok)throw new Error(`[${pc}] Failed to fetch ${i}: ${e.status} ${e.statusText}`);return new Uint8Array(await e.arrayBuffer())},testParse(i,e){const t=qs(e.src,".json")&&DP(i),s=qs(e.src,".skel")&&UP(i),n=e.loadParser===pc;return Promise.resolve(t||s||n)}}};Ue.add($P);class XP extends cn{constructor(t=!1){super();S(this,"_buffer");S(this,"_indexBuffer");this._buffer=new Ut(void 0,t,!1),this._indexBuffer=new Ut(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 VP=` +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; + +} +`,YP=` +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; +} +`;class fw extends sr{constructor(e){super(e),this.shaderGenerator=new ib(VP,YP),this.geometryClass=XP,this.vertexSize=7}packInterleavedGeometry(e,t,s,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=Ct.shared.setValue(e._tintRGB).toPremultiplied(f,!0),m=Ct.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=zP(l),l in Uv)return;Uv[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":WP,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 pw(){const[i,e]=await Promise.all([$v(()=>import("./index-Bvs6zl88.js"),[]),$v(()=>import("./index-BxN_H-6_.js"),__vite__mapDeps([0,1]))]);return{core:i,pixi:e}}async function qP(i,e,t){const{core:s,pixi:n}=await pw(),r=new s.TextureAtlas(e);return xp(r,t,n.SpineTexture),{skeletonData:new s.SkeletonJson(new s.AtlasAttachmentLoader(r)).readSkeletonData(i),SpineClass:n.Spine}}async function KP(i,e,t){const{core:s,pixi:n}=await pw(),r=new s.TextureAtlas(e);return xp(r,t,n.SpineTexture),{skeletonData:new s.SkeletonBinary(new s.AtlasAttachmentLoader(r)).readSkeletonData(i),SpineClass:n.Spine}}function cr(i,e,t){const s=Number(i[e]);return Number.isFinite(s)?s:t}function zs(i,e,t,s){i[e]==null&&(i[e]=cr(i,t,s))}function bp(i,e,t){if(typeof i.curve!="number")return;const s=cr(i,"time",0),r=cr(e,"time",0)-s,o=i.curve,a=cr(i,"c2",0),c=cr(i,"c3",1),l=cr(i,"c4",1);i.curve=t.flatMap(([h,u])=>[s+r*o,h+(u-h)*a,s+r*c,h+(u-h)*l]),delete i.c2,delete i.c3,delete i.c4}function gr(i,e){if(Array.isArray(i))for(let t=0;t[cr(s,r,o),cr(n,r,o)]))}}function ZP(i){if(Array.isArray(i))for(let e=0;eNumber.parseInt(s.slice(r,r+2),16)/255);return e?n:n.slice(0,3)}function Xv(i,e){if(Array.isArray(i))for(let t=0;t[a,o[c]]))}}function JP(i){for(const e of i.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of i.transform||[])zs(e,"mixRotate","rotateMix",1),zs(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),zs(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),zs(e,"mixShearY","shearMix",1);for(const e of i.path||[])zs(e,"mixRotate","rotateMix",1),zs(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function QP(i){for(const e of i.skins||[])for(const t of Object.values(e.attachments||{}))for(const s of Object.values(t||{}))s.parent!=null&&s.timelines==null&&s.deform!=null&&(s.timelines=s.deform)}function ek(i){for(const e of Object.values(i.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),Xv(e.rgba,!1),Xv(e.rgba2,!0)}function tk(i){for(const e of Object.values(i.bones||{})){for(const t of e.rotate||[])zs(t,"value","angle",0);gr(e.rotate,[{key:"value",fallback:0}]),gr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),gr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),gr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function sk(i){for(const e of Object.values(i.ik||{}))gr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function ik(i){for(const e of Object.values(i.transform||{})){for(const t of e)zs(t,"mixRotate","rotateMix",1),zs(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),zs(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),zs(t,"mixShearY","shearMix",1);gr(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 nk(i){for(const e of Object.values(i.path||{})){for(const s of["position","spacing"]){const n=e[s];for(const r of n||[])zs(r,"value",s,0);gr(n,[{key:"value",fallback:0}])}const t=e.mix;for(const s of t||[])zs(s,"mixRotate","rotateMix",1),zs(s,"mixX","translateMix",1),s.mixY==null&&(s.mixY=s.mixX);gr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function rk(i){if(!i.deform)return;const e=i.attachments||(i.attachments={});for(const[t,s]of Object.entries(i.deform)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(s)){const a=n[r]||(n[r]={});for(const[c,l]of Object.entries(o)){const h=a[c]||(a[c]={});h.deform=l,ZP(l)}}}delete i.deform}function gw(i){JP(i),QP(i);for(const e of Object.values(i.animations||{}))ek(e),tk(e),sk(e),ik(e),nk(e),rk(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return i}function ok(i){return i.replace(/\\/g,"/").split("/").pop()||i}async function ak(i){const e=await Promise.all(i.map(async t=>{const s=URL.createObjectURL(t);try{return[ok(t.name).toLowerCase(),await ze.fromURL(s)]}finally{URL.revokeObjectURL(s)}}));return new Map(e)}function lk(i){const e=new Map;return i.bones.map(t=>{var r;const s=((r=t.parent)==null?void 0:r.name)||null,n=s?(e.get(s)||0)+1:0;return e.set(t.name,n),{name:t.name,parent:s,depth:n}})}function ck(i){return i.slots.map(e=>{var t;return{name:e.name,order:Number(e.index)||0,bone:((t=e.boneData)==null?void 0:t.name)||"",attachment:e.attachmentName||""}})}async function vw(i,e,t){var o;if(!/\.(json|skel)$/i.test(i.name))throw new Error("Spine 数据仅支持 .json 或 .skel");if(!/\.atlas$/i.test(e.name))throw new Error("图集文件仅支持 .atlas");if(!t.length)throw new Error("请至少选择一张纹理图片");const s=await e.text(),n=await ak(t),r=[...n.values()];try{let a,c,l=null,h;if(/\.skel$/i.test(i.name)){const u=await i.arrayBuffer();try{({skeletonData:a,SpineClass:c}=await KP(u,s,n)),h="4.3"}catch(d){try{({skeletonData:a,SpineClass:c}=HP(u,s,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=dh(a.version)}else{let u;try{u=JSON.parse(await i.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(l=dh((o=u==null?void 0:u.skeleton)==null?void 0:o.spine),!l)throw new Error(`Spine JSON 版本不受支持,仅支持 ${lm()}`);h=lR(l),l==="3.8"&&gw(u);const d=h==="4.3"?await qP(u,s,n):jP(u,s,n);a=d.skeletonData,c=d.SpineClass}if(!l)throw new Error(`Spine 数据版本不受支持,仅支持 ${lm()}`);return{skeletonData:a,textures:r,runtimeVersion:h,SpineClass:c,dataVersion:l,animations:a.animations.map(u=>({name:u.name,duration:u.duration})),bones:lk(a),slots:ck(a)}}catch(a){for(const c of r)c.destroy(!0);throw a}}function Oc(i){return new Promise((e,t)=>{const s=new FileReader;s.onload=()=>e(String(s.result||"")),s.onerror=()=>t(s.error),s.readAsDataURL(i)})}async function hk(i,e,t){return{skeleton:{name:i.name,dataUrl:await Oc(i)},atlas:{name:e.name,dataUrl:await Oc(e)},textures:await Promise.all(t.map(async s=>({name:s.name,dataUrl:await Oc(s)})))}}async function lf(i){const e=await fetch(i.dataUrl);if(!e.ok)throw new Error(`无法读取内嵌 Spine 文件:${i.name}`);return new File([await e.blob()],i.name)}async function uk(i){return{skeleton:await lf(i.skeleton),atlas:await lf(i.atlas),textures:await Promise.all(i.textures.map(lf))}}const yw="SpineParticle.EditorConfig",xw=1;function bw(i){return{backgroundX:i.backgroundX,backgroundY:i.backgroundY,backgroundOpacity:i.backgroundOpacity,backgroundImageName:i.backgroundImageName,backgroundImageData:i.backgroundImageData,showGrid:i.showGrid,exportSettings:$t(i.exportSettings)}}function dk(i){return JSON.parse(JSON.stringify(i,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function ww(i){const e=$t(i);return delete e.tags,delete e.selectedTag,e}function fk(i){const e=bw(i.settings);return dk({format:yw,version:xw,savedAt:new Date().toISOString(),editor:$t(i.editor),settings:e,timeline:{fps:i.timeline.fps,loop:i.timeline.loop,playbackStart:i.timeline.playbackStart,playbackEnd:i.timeline.playbackEnd,animations:[...i.timeline.animations]},selection:{type:i.activeObjectType,id:i.activeObjectId},scene:{systems:i.systems.map(t=>({...$t(t),frames:void 0})),colliders:i.colliders.map(ww),paths:$t(i.paths),spines:$t(i.spines)}})}function mk(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function Sw(i){const e=fk(i),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(t),n=document.createElement("a");return n.href=s,n.download=mk(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(s),0),e}function Mw(i){let e;try{e=JSON.parse(i)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==yw)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==xw)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 pk(i){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=>hr(a)),e.set(r,o)),o},s=await t("/images/star.png");await Promise.all(i.map(async n=>{var o;const r=Nn(n.config);r.texture=s,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 gk(i){const e=new Map;try{for(const t of i){if(!t.sourceBundle)continue;const s=await uk(t.sourceBundle);e.set(t.id,await vw(s.skeleton,s.atlas,s.textures))}return e}catch(t){for(const s of e.values())for(const n of s.textures)n.destroy(!0);throw t}}function vk(i,e){const t=(e==null?void 0:e.type)||"particle",s=Number(e==null?void 0:e.id)||0;(t==="particle"?i.systems.some(r=>r.id===s):t==="collision"?i.colliders.some(r=>r.id===s):t==="path"?i.paths.some(r=>r.id===s):i.spines.some(r=>r.id===s))?i.selectSceneObject(t,s):i.systems[0]?i.selectSceneObject("particle",i.systems[0].id):i.colliders[0]?i.selectSceneObject("collision",i.colliders[0].id):i.paths[0]?i.selectSceneObject("path",i.paths[0].id):i.spines[0]?i.selectSceneObject("spine",i.spines[0].id):(i.activeObjectType="particle",i.activeObjectId=0,i.activeId=0)}async function yk(i,e){var h,u,d,f,p,m,g;const t=Mw(JSON.stringify(e)),s=$t(t.scene.systems),n=t.scene.colliders.map(ww),r=$t(t.scene.paths),o=$t(t.scene.spines);for(const v of o)v.sourceBundle==null&&(v.sourceBundle=null),v.dataVersion==null&&(v.dataVersion=""),Array.isArray(v.slots)||(v.slots=[]),typeof v.selectedBone!="string"&&(v.selectedBone=""),typeof v.selectedSlot!="string"&&(v.selectedSlot="");await pk(s);const a=await gk(o),c=new Map(i.spines.map(v=>[v.id,v.assetVersion]));for(const v of i.spines)El(v.id);i.systems=s,i.colliders=n,i.paths=r,i.spines=o,Object.assign(i.editor,$t(t.editor||{}));const l=t.settings;if(l)for(const v of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(l,v)&&(i.settings[v]=l[v]);i.settings.exportSettings=d1((h=t.settings)==null?void 0:h.exportSettings),i.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(i.settings.undoLimit)||20))),i.timeline.fps=Math.max(1,Math.round(Number((u=t.timeline)==null?void 0:u.fps)||30)),i.timeline.loop=((d=t.timeline)==null?void 0:d.loop)!==!1,i.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 i.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.slots=[],v.selectedAnimation="";continue}cu(v.id,x),v.dataVersion=x.dataVersion,v.animations=x.animations,v.bones=x.bones,v.slots=x.slots,x.animations.some(y=>y.name===v.selectedAnimation)||(v.selectedAnimation=((p=x.animations[0])==null?void 0:p.name)||""),v.status="ready",v.error=""}i.syncSceneSequences(),vk(i,t.selection),i.timeline.playbackStart=Math.max(0,Math.floor(Number((m=t.timeline)==null?void 0:m.playbackStart)||0)),i.timeline.playbackEnd=Math.max(1,Math.floor(Number((g=t.timeline)==null?void 0:g.playbackEnd)||Number.MAX_SAFE_INTEGER)),i.timeline.frame=0,i.timeline.recorded=!1,i.timeline.playing=!0;for(const v of i.systems)i.timeline.animations.includes(v.animation)||(v.animation=i.timeline.animations[0]);return i.recalcTotalFrames(),i.timeline.frame=i.timeline.playbackStart,t}async function Tw(i,e){return yk(i,Mw(e))}async function xk(i,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return Tw(i,await e.text())}const du=uo({undoCount:0});let bh=null,Rn=null,yr=[],ka=null,Pn=null,wh=!1;function wp(i){return{systems:i.systems.map(t=>{const s=$t(t);return s.frames=void 0,s}),colliders:$t(i.colliders),paths:$t(i.paths),spines:$t(i.spines),animations:[...i.timeline.animations],settings:bw(i.settings)}}function Sp(i){return JSON.stringify(i,(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 _w(i,e=wp(i),t=Sp(e)){const s=new Map;for(const n of e.spines){const r=oR(n.id);r&&s.set(n.id,r)}return{data:e,signature:t,spineAssets:s}}function Sh(i){if(i){for(const e of i.spineAssets.values())nR(e);i.spineAssets.clear()}}function Cw(i){for(;yr.length>i;)Sh(yr.shift()||null);du.undoCount=yr.length}function Aw(){const i=bh;if(!i||!Rn||wh)return;const e=wp(i),t=Sp(e);t!==Rn.signature&&(yr.push(Rn),Rn=_w(i,e,t),Cw(i.settings.undoLimit))}function bk(){wh||(Pn&&clearTimeout(Pn),Pn=setTimeout(()=>{Pn=null,Aw()},250))}function wk(i){const e=i.activeObjectId;return i.activeObjectType==="particle"?i.systems.some(t=>t.id===e):i.activeObjectType==="collision"?i.colliders.some(t=>t.id===e):i.activeObjectType==="path"?i.paths.some(t=>t.id===e):i.spines.some(t=>t.id===e)}function Sk(i){var t,s;if(!wk(i)){const n=i.systems[0],r=i.colliders[0],o=i.paths[0],a=i.spines[0];n?(i.activeObjectType="particle",i.activeObjectId=n.id):r?(i.activeObjectType="collision",i.activeObjectId=r.id):o?(i.activeObjectType="path",i.activeObjectId=o.id):(i.activeObjectType="spine",i.activeObjectId=(a==null?void 0:a.id)||0)}const e=i.activeObjectType==="particle"?i.systems.find(n=>n.id===i.activeObjectId):i.systems.find(n=>n.id===i.activeId);i.activeId=(e==null?void 0:e.id)||((t=i.systems[0])==null?void 0:t.id)||0,i.timeline.animation=(e==null?void 0:e.animation)||((s=i.systems[0])==null?void 0:s.animation)||i.timeline.animations[0]||"animation"}function Mk(i,e){const t=Rn;wh=!0;try{for(const s of i.spines)El(s.id);i.systems=$t(e.data.systems),i.colliders=$t(e.data.colliders),i.paths=$t(e.data.paths),i.spines=$t(e.data.spines),i.timeline.animations=[...e.data.animations],Object.assign(i.settings,$t(e.data.settings));for(const[s,n]of e.spineAssets)cu(s,n);for(const s of i.systems)s.frames=[];i.timeline.recorded=!1,i.timeline.playing=!1,Sk(i),i.recalcTotalFrames(),Rn=e}finally{wh=!1,Sh(t)}}function Tk(i){if(!(bh===i&&ka)){ka==null||ka(),Pn&&clearTimeout(Pn),Sh(Rn);for(const e of yr)Sh(e);yr=[],bh=i,Rn=_w(i),du.undoCount=0,ka=Ls(()=>Sp(wp(i)),bk,{flush:"post"})}}function _k(i,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));i.settings.undoLimit=t,Cw(t)}function Ew(){const i=bh;if(!i||!Rn)return!1;Pn&&(clearTimeout(Pn),Pn=null),Aw();const e=yr.pop();return e?(Mk(i,e),du.undoCount=yr.length,!0):!1}function Ck(i){const e=i instanceof HTMLElement?i:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function Ak(i){function e(s){var r;const n=s.target instanceof Node?s.target:null;i.canvasFocused.value=!!n&&!!((r=i.canvasElement.value)!=null&&r.contains(n))}function t(s){const n=s.key.toLowerCase();if((s.ctrlKey||s.metaKey)&&!s.altKey&&n==="s"){s.preventDefault(),s.stopPropagation(),i.save();return}if((s.ctrlKey||s.metaKey)&&!s.altKey&&n==="z"){s.preventDefault(),s.stopPropagation(),i.undo();return}if(s.ctrlKey||s.metaKey||s.altKey||Ck(s.target))return;if(n==="d"){s.preventDefault(),i.togglePlay();return}if(n==="s"){s.preventDefault(),i.toStart();return}if(!i.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};n in r&&(s.preventDefault(),i.setTool(r[n]))}Wn(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),Ml(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const Ek={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},Ik={class:"help-body"},Rk=["aria-expanded"],Pk={class:"caret"},kk={class:"help-module-body"},Fk=["aria-expanded"],Ok={class:"caret"},Lk={class:"help-module-body"},Bk=["aria-expanded"],Nk={class:"caret"},Dk={class:"help-module-body"},Uk=["aria-expanded"],$k={class:"caret"},Xk={class:"help-module-body"},Vk=["aria-expanded"],Yk={class:"caret"},Gk={class:"help-module-body"},jk=["aria-expanded"],Hk={class:"caret"},Wk={class:"help-module-body"},zk=["aria-expanded"],qk={class:"caret"},Kk={class:"help-module-body"},Zk=["aria-expanded"],Jk={class:"caret"},Qk={class:"help-module-body"},eF=["aria-expanded"],tF={class:"caret"},sF={class:"help-module-body"},iF=Qt({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(i,{emit:e}){const t=e,s=$e(Array.from({length:9},()=>!1));function n(){t("close")}function r(o){o.key==="Escape"&&n()}return Wn(()=>window.addEventListener("keydown",r)),Sl(()=>window.removeEventListener("keydown",r)),(o,a)=>i.show?(K(),J("div",{key:0,class:"help-overlay",role:"presentation",onClick:Je(n,["self"])},[T("section",Ek,[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",Ik,[a[37]||(a[37]=Qs('

快速开始

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

连接器用于把网页生成的 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),[[ws,s.value[8]]])],2),a[38]||(a[38]=T("section",{class:"help-section help-export"},[T("h3",null,"配置与导出有什么区别?"),T("p",null,[T("b",null,"保存配置"),Rt("会保存编辑器中的全部对象和参数,之后可以继续修改;"),T("b",null,"导出 Spine Json"),Rt("只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。")])],-1))])])])):Se("",!0)}}),es=(i,e)=>{const t=i.__vccOpts||i;for(const[s,n]of e)t[s]=n;return t},nF=es(iF,[["__scopeId","data-v-78204b9d"]]);function ea(i){const e=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)};window.addEventListener("pointermove",i),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e)}function ui(i,e,t){const s=i.holder.value,n=i.app(),r=s.getBoundingClientRect(),o=Math.max(1e-4,i.store.editor.viewScale),a=e-r.left,c=t-r.top;return{x:(a-n.screen.width/2-i.store.editor.viewX)/o,y:-(c-n.screen.height*.5-i.store.editor.viewY)/o}}function rF(i,e){const t=i.holder.value,s=i.app(),n=i.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=s.screen.width/2,d=s.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 oF(i,e,t){const s=i.store,n=s.editor.viewX,r=s.editor.viewY;ea(o=>{s.editor.viewX=n+(o.clientX-e),s.editor.viewY=r+(o.clientY-t)})}function Iw(i,e){const t=Math.max(.01,i.store.editor.viewScale*e);i.store.editor.viewScale=t}function aF(i){Iw(i,1.2)}function lF(i){Iw(i,1/1.2)}function cF(i){i.store.editor.viewScale=1,i.store.editor.viewX=0,i.store.editor.viewY=0}function hF(i){i.store.editor.viewScale=1,i.store.editor.viewX=0,i.store.editor.viewY=0}function uF(i){i.store.settings.showGrid=!i.store.settings.showGrid}const dF={class:"topbar"},fF=["disabled"],mF={class:"tool-group"},pF={class:"tool-group"},gF={key:0,class:"background-panel"},vF=["disabled"],yF=["title"],xF={class:"background-position-row"},bF={class:"background-opacity-row"},wF={class:"zoom-pct"},SF=Qt({__name:"StageToolbar",props:{ctx:{},activeTool:{},showSettings:{type:Boolean},showHelp:{type:Boolean}},emits:["update:activeTool","update:showSettings","update:showHelp","clear-background","background-file"],setup(i,{emit:e}){const t=i,s=e,n=po(),r=$e(!1),o=$e(null),a=Ye(()=>n.settings.backgroundImageName);function c(m){s("update:activeTool",t.activeTool===m?"":m)}function l(){r.value=!r.value,r.value&&s("update:showSettings",!1)}function h(){const m=!t.showSettings;s("update:showSettings",m),m&&(r.value=!1)}function u(){s("update:showHelp",!0),r.value=!1,s("update:showSettings",!1)}function d(m){s("background-file",m)}function f(m=!0){o.value&&(o.value.value=""),s("clear-background",m)}function p(){Ew()}return(m,g)=>(K(),J("div",dF,[T("button",{class:"settings-btn",onClick:h,title:"系统设置"},"系统设置"),T("button",{class:"undo-btn",disabled:E(du).undoCount===0,onClick:p,title:"撤回上一步 (Ctrl+Z)"},"↶",8,fF),T("div",mF,[T("button",{class:ke(["tool-btn",{on:i.activeTool===""}]),onClick:g[0]||(g[0]=v=>c("")),title:"拖动画布 (Q)"},"✋",2),T("button",{class:ke(["tool-btn",{on:i.activeTool==="translate"}]),onClick:g[1]||(g[1]=v=>c("translate")),title:"位移 (W)"},"✥",2),T("button",{class:ke(["tool-btn",{on:i.activeTool==="rotate"}]),onClick:g[2]||(g[2]=v=>c("rotate")),title:"旋转 (E)"},"⟳",2),T("button",{class:ke(["tool-btn",{on:i.activeTool==="scale"}]),onClick:g[3]||(g[3]=v=>c("scale")),title:"缩放 (R)"},"⤢",2)]),T("div",pF,[T("button",{class:"tool-btn",onClick:g[4]||(g[4]=v=>E(aF)(i.ctx)),title:"放大"},"+"),T("button",{class:"tool-btn",onClick:g[5]||(g[5]=v=>E(lF)(i.ctx)),title:"缩小"},"-"),T("button",{class:"tool-btn",onClick:g[6]||(g[6]=v=>E(cF)(i.ctx)),title:"适配画布"},"⤢"),T("button",{class:ke(["tool-btn",{on:E(n).settings.showGrid}]),onClick:g[7]||(g[7]=v=>E(uF)(i.ctx)),title:"切换网格"},"▦",2),T("button",{class:"tool-btn",onClick:g[8]||(g[8]=v=>E(hF)(i.ctx)),title:"重置视图"},"⟳")]),T("div",{class:"background-menu",onClick:g[14]||(g[14]=Je(()=>{},["stop"]))},[T("button",{class:ke(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:l},"背景图",2),r.value?(K(),J("div",gF,[T("button",{class:"background-upload",onClick:g[9]||(g[9]=v=>{var x;return(x=o.value)==null?void 0:x.click()})},be(a.value?"更换图像":"上传图像"),1),T("button",{class:"background-clear",disabled:!a.value,onClick:g[10]||(g[10]=v=>f())},"清除背景",8,vF),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},be(a.value||"未上传图像"),9,yF),T("div",xF,[T("label",null,[g[15]||(g[15]=T("span",null,"X",-1)),ce(T("input",{"onUpdate:modelValue":g[11]||(g[11]=v=>E(n).settings.backgroundX=v),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[Ge,E(n).settings.backgroundX,void 0,{number:!0}]])]),T("label",null,[g[16]||(g[16]=T("span",null,"Y",-1)),ce(T("input",{"onUpdate:modelValue":g[12]||(g[12]=v=>E(n).settings.backgroundY=v),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[Ge,E(n).settings.backgroundY,void 0,{number:!0}]])])]),T("label",bF,[g[17]||(g[17]=T("span",null,"透明度",-1)),ce(T("input",{"onUpdate:modelValue":g[13]||(g[13]=v=>E(n).settings.backgroundOpacity=v),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[Ge,E(n).settings.backgroundOpacity,void 0,{number:!0}]]),T("b",null,be(Math.round(E(n).settings.backgroundOpacity*100))+"%",1)])])):Se("",!0)]),T("button",{class:ke(["help-btn",{on:i.showHelp}]),title:"查看使用说明",onClick:u},"使用说明",2),T("span",wF,be(Math.round(E(n).editor.viewScale*100))+"%",1)]))}}),MF=es(SF,[["__scopeId","data-v-4749834a"]]),TF={key:0,class:"settings-panel"},_F={class:"sp-head"},CF={class:"sp-switch-row"},AF={class:"sp-switch-control"},EF={class:"sp-row"},IF={class:"sp-chk"},RF={class:"sp-chk"},PF={class:"sp-row"},kF={class:"sp-row"},FF={class:"sp-chk"},OF={class:"sp-chk"},LF={class:"sp-row"},BF={class:"sp-row"},NF={class:"sp-row"},DF={class:"sp-hex"},UF={class:"sp-chk"},$F=Qt({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(i,{emit:e}){const t=e,s=po();function n(o){_k(s,Number(o.target.value))}function r(){s.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(s.settings.bonePointDrawSize)||1)),s.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(s.settings.boneAxisDrawSize)||2))}return(o,a)=>i.show?(K(),J("div",TF,[T("div",_F,[a[15]||(a[15]=Rt("系统设置 ",-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",CF,[a[17]||(a[17]=T("span",null,"参数面板位置",-1)),T("span",AF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[1]||(a[1]=c=>E(s).settings.parameterPanelOnRight=c),"aria-label":"参数面板显示在右侧"},null,512),[[wt,E(s).settings.parameterPanelOnRight]]),a[16]||(a[16]=T("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),T("b",null,be(E(s).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",EF,[a[18]||(a[18]=T("span",null,"最大撤回步数",-1)),ce(T("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":a[2]||(a[2]=c=>E(s).settings.undoLimit=c),"aria-label":"最大撤回步数",onChange:n},null,544),[[Ge,E(s).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",IF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=c=>E(s).settings.showEmitter=c)},null,512),[[wt,E(s).settings.showEmitter]]),a[19]||(a[19]=Rt("发射点",-1))]),T("label",RF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=c=>E(s).settings.showBones=c)},null,512),[[wt,E(s).settings.showBones]]),a[20]||(a[20]=Rt("骨骼连线",-1))]),E(s).settings.showBones?(K(),J(Ae,{key:0},[T("label",PF,[a[21]||(a[21]=T("span",null,"骨骼点绘制大小",-1)),ce(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[5]||(a[5]=c=>E(s).settings.bonePointDrawSize=c),"aria-label":"骨骼点绘制大小",onChange:r},null,544),[[Ge,E(s).settings.bonePointDrawSize,void 0,{number:!0}]])]),T("label",kF,[a[22]||(a[22]=T("span",null,"坐标轴绘制大小",-1)),ce(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[6]||(a[6]=c=>E(s).settings.boneAxisDrawSize=c),"aria-label":"坐标轴绘制大小",onChange:r},null,544),[[Ge,E(s).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):Se("",!0),T("label",FF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[7]||(a[7]=c=>E(s).settings.showSkinMesh=c)},null,512),[[wt,E(s).settings.showSkinMesh]]),a[23]||(a[23]=Rt("蒙皮网格",-1))]),a[34]||(a[34]=T("div",{class:"sp-divider"},null,-1)),T("label",OF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[8]||(a[8]=c=>E(s).settings.tickEnabled=c)},null,512),[[wt,E(s).settings.tickEnabled]]),a[24]||(a[24]=Rt("启用刻度",-1))]),E(s).settings.tickEnabled?(K(),J(Ae,{key:1},[T("label",LF,[a[25]||(a[25]=T("span",null,"刻度文字大小",-1)),ce(T("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":a[9]||(a[9]=c=>E(s).settings.axisFontSize=c)},null,512),[[Ge,E(s).settings.axisFontSize,void 0,{number:!0}]]),ce(T("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":a[10]||(a[10]=c=>E(s).settings.axisFontSize=c),class:"sp-num"},null,512),[[Ge,E(s).settings.axisFontSize,void 0,{number:!0}]])]),T("label",BF,[a[26]||(a[26]=T("span",null,"刻度线粗细",-1)),ce(T("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":a[11]||(a[11]=c=>E(s).settings.tickWidth=c)},null,512),[[Ge,E(s).settings.tickWidth,void 0,{number:!0}]]),ce(T("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":a[12]||(a[12]=c=>E(s).settings.tickWidth=c),class:"sp-num"},null,512),[[Ge,E(s).settings.tickWidth,void 0,{number:!0}]])]),T("label",NF,[a[27]||(a[27]=T("span",null,"坐标轴颜色",-1)),ce(T("input",{type:"color","onUpdate:modelValue":a[13]||(a[13]=c=>E(s).settings.axisColor=c),class:"sp-colr"},null,512),[[Ge,E(s).settings.axisColor]]),T("span",DF,be(E(s).settings.axisColor),1)]),T("label",UF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[14]||(a[14]=c=>E(s).settings.showAxisLabels=c)},null,512),[[wt,E(s).settings.showAxisLabels]]),a[28]||(a[28]=Rt("显示刻度数值",-1))])],64)):Se("",!0),a[35]||(a[35]=T("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):Se("",!0)}}),XF=es($F,[["__scopeId","data-v-1bba85d9"]]);class cf{constructor(){S(this,"sprite",null);S(this,"texture",null);S(this,"loadVersion",0)}createSprite(e){const t=new Tr(ze.EMPTY);return t.anchor.set(.5),t.visible=!1,e.addChild(t),this.sprite=t,t}applyTransform(e,t,s){this.sprite&&(this.sprite.position.set(Number(e)||0,-(Number(t)||0)),this.sprite.alpha=Math.min(1,Math.max(0,Number(s)||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 s=await ze.fromURL(e);if(t!==this.loadVersion||!this.sprite){s.destroy(!0);return}const n=this.texture;this.texture=s,this.sprite.texture=s,this.sprite.visible=!0,n&&n.destroy(!0)}catch(s){console.error("背景图恢复失败",s)}}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 s=t.target,n=(r=s.files)==null?void 0:r[0];if(n)try{e.settings.backgroundImageData=await Oc(n),e.settings.backgroundImageName=n.name}catch(o){console.error("背景图加载失败",o)}finally{s.value=""}}destroy(){this.loadVersion++,this.texture&&this.texture.destroy(!0),this.texture=null,this.sprite=null}}class VF{constructor(e){S(this,"selectedNodes",new Set);S(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(s=>s.id===e.activeObjectId)||null;return(t==null?void 0:t.visible)===!1?null:t}pathInsertIndex(e,t,s){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 s=ui(this.ctx,e.clientX,e.clientY),n=Co(t,s.x,s.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,ea(u=>{const d=ui(this.ctx,u.clientX,u.clientY),f=Co(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 ea(u=>{const d=ui(this.ctx,u.clientX,u.clientY),f=Co(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 ea(u=>{const d=ui(this.ctx,u.clientX,u.clientY),f=Co(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=ui(this.ctx,u.clientX,u.clientY),f=Co(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 YF{constructor(e,t){this.ctx=e,this.getTool=t}onColliderPointerDown(e){const t=this.ctx.store;if(t.activeObjectType!=="collision")return!1;const s=t.colliders.find(x=>x.id===t.activeObjectId);if(!(s!=null&&s.enabled)||s.visible===!1)return!1;const n=ui(this.ctx,e.clientX,e.clientY),r=s.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=Math.max(1e-4,Math.abs(s.scaleX??1)),l=Math.max(1e-4,Math.abs(s.scaleY??1)),h=n.x-s.x,u=n.y-s.y,d=(o*h+a*u)/c,f=(-a*h+o*u)/l;if(!(s.shape==="circle"?Math.hypot(d,f)<=s.radius:s.shape==="ellipse"?Math.hypot(d/Math.max(1,s.radiusX),f/Math.max(1,s.radiusY))<=1:Math.abs(d)<=s.width*.5&&Math.abs(f)<=s.height*.5))return!1;const m=s.x,g=s.y,v=n;return ea(x=>{const y=ui(this.ctx,x.clientX,x.clientY);s.x=m+y.x-v.x,s.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 s=t==null?void 0:t.config;if(!(s!=null&&s.forceField)||!s.showForceFieldShape||s.forceRadius<=0)return!1;const n=ui(this.ctx,e.clientX,e.clientY);if(Math.hypot(n.x-s.forceCenterX,n.y-s.forceCenterY)>s.forceRadius)return!1;const o=s.forceCenterX,a=s.forceCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const c=h=>{const u=ui(this.ctx,h.clientX,h.clientY);s.forceCenterX=o+u.x-n.x,s.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 s=t==null?void 0:t.config;if(!(s!=null&&s.attraction)||!s.showAttractionShape)return!1;const n=ui(this.ctx,e.clientX,e.clientY),r=Math.max(s.attractionRadius,12/Math.max(1e-4,this.ctx.store.editor.viewScale));if(Math.hypot(n.x-s.attractionCenterX,n.y-s.attractionCenterY)>r)return!1;const a=s.attractionCenterX,c=s.attractionCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const l=u=>{const d=ui(this.ctx,u.clientX,u.clientY);s.attractionCenterX=a+d.x-n.x,s.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 s=this.ctx.app(),n=this.ctx.store,r=n.editor.viewScale,o=this.ctx.holder.value.getBoundingClientRect(),a=o.left+s.screen.width/2+n.editor.viewX+t.x*r,c=o.top+s.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);ea(M=>{const _=(M.clientX-l)/r,w=(M.clientY-h)/r;if(u==="translate")t.setPosition(d+_,f-w);else if(u==="rotate"){const b=Math.atan2(M.clientY-c,M.clientX-a);t.setRotation(p-(b-x)*180/Math.PI)}else if(u==="scale"){const C=Math.hypot(M.clientX-a,M.clientY-c)/v;t.setScale(Math.max(.05,m*C),Math.max(.05,g*C))}})}}function Vv(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function Yv(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1));return{x:i.x+n*e*o-r*t*a,y:i.y+r*e*o+n*t*a}}function Mp(i,e){if(!i.points.length)return null;if(i.points.length===1)return{...Yv(i,i.points[0].x,i.points[0].y),angle:i.rotation};const t=i.closed?i.points.length:i.points.length-1,s=[];let n=0;for(let p=0;p0&&v===0)continue;const x=v/20,y=Vv(m.x,m.x+m.outX,g.x+g.inX,g.x,x),M=Vv(m.y,m.y+m.outY,g.y+g.inY,g.y,x),_=Yv(i,y,M),w=s[s.length-1];w&&(n+=Math.hypot(_.x-w.x,_.y-w.y)),s.push({..._,distance:n})}}const r=Math.min(1,Math.max(0,e))*n;let o=s.findIndex(p=>p.distance>=r);o<0&&(o=s.length-1);const a=s[o],c=s[Math.max(0,o-1)],l=s[Math.min(s.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 GF(i,e,t){if(e.renderLayerMode!=="slot")return null;const s=i.find(o=>o.id===e.renderLayerSpineId&&o.enabled&&o.status==="ready");if(!s)return null;const n=s.slots||[],r=n.find(o=>o.name===e.renderLayerSlotName);if(!r)return null;if(e.renderLayerSlotPosition==="below"){let o="";if(t!=null&&t.length){const a=t.indexOf(r.name);if(a===0)return null;a>0&&(o=t[a-1])}if(!o){const a=n.filter(c=>c.orderl.order-c.order)[0];if(!a)return null;o=a.name}return{spineId:s.id,slotName:o,targetSlotName:r.name,followAttachment:!1}}return{spineId:s.id,slotName:r.name,targetSlotName:r.name,followAttachment:e.renderLayerFollowAttachment}}function Mh(i,e,t,s=Math.max(1e-4,Math.abs(i.rootScaleX)),n=Math.max(1e-4,Math.abs(i.rootScaleY))){const r=-i.rootRotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=e-i.centerX,l=-t+i.centerY;return{x:(o*c+a*l)/s,y:(-a*c+o*l)/n}}function jF(i,e,t){const s=Mp(e,t);if(!s)return null;const n=Mh(i,s.x,s.y),r=s.angle*Math.PI/180,o=Mh(i,s.x+Math.cos(r),s.y+Math.sin(r)),a=Math.atan2(o.y-n.y,o.x-n.x)*180/Math.PI;return{...n,angle:a}}function HF(i,e){return i.colliders.map(t=>{if(!t.followPath||!t.followPathId)return t;const s=i.paths.find(h=>h.id===t.followPathId&&h.enabled);if(!(s!=null&&s.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==="跟随导出"?i.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":t.followCurveMode==="贝塞尔"?"bezier":"linear",c=Math.min(1,Math.max(0,g1(o,r,a))),l=Mp(s,c);return l?{...t,x:l.x,y:l.y,rotation:t.rotation+(t.followPathRotation?l.angle:0)}:t})}class WF{constructor(){S(this,"emitters",new Map);S(this,"configs",new Map);S(this,"slotGroups",new Map)}sync(e,t,s,n,r=null){for(const[a,c]of this.emitters){const l=e.systems.find(h=>h.id===a);(!l||this.configs.get(a)!==l.config)&&(c.removeFromParent(),c.destroy({children:!0}),this.emitters.delete(a),this.configs.delete(a))}for(const a of e.systems){s&&!a.config.texture&&(a.config.texture=s);const c=Nn(a.config);if(n)for(const h of c.trailResources)!h.texture&&(h.previewUrl==="/images/trail.png"||h.previewUrl==="/trails/trail.png")&&(h.texture=n);if(s)for(const h of c.imageResources)!h.texture&&h.textureName==="star"&&(h.texture=s);if(this.emitters.has(a.id))continue;const l=new Av(a.config);t.addChild(l),this.emitters.set(a.id,l),this.configs.set(a.id,a.config)}const o=new Set;for(const a of e.systems){const c=this.emitters.get(a.id);if(!c)continue;const l=r&&a.config.renderLayerMode==="slot"?r.getDrawOrder(a.config.renderLayerSpineId):null,h=GF(e.spines,a.config,l),u=h&&r?this.ensureSlotGroup(h,r,a.config):null;u?(o.add(u.key),c.parent!==u.compensator&&u.compensator.addChild(c)):c.parent!==t&&t.addChild(c)}for(const[a,c]of[...this.slotGroups])if(!o.has(a)){for(const l of[...c.compensator.children])l instanceof Av&&l.parent===c.compensator&&t.addChild(l);r==null||r.detachSlotObject(c.spineId,c.slotName,c.wrapper),c.wrapper.removeFromParent(),c.wrapper.removeChild(c.compensator),c.compensator.destroy(),c.wrapper.destroy(),this.slotGroups.delete(a)}}ensureSlotGroup(e,t,s){const n=`${e.spineId}:${e.targetSlotName}:${s.renderLayerSlotPosition}`;let r=this.slotGroups.get(n);if(!r){const o=new ms,a=new ms;o.addChild(a),r={key:n,spineId:e.spineId,slotName:e.slotName,wrapper:o,compensator:a,followAttachment:s.renderLayerFollowAttachment,attached:!1},this.slotGroups.set(n,r)}return(!r.attached||!r.wrapper.parent||r.slotName!==e.slotName)&&(r.wrapper.parent&&t.detachSlotObject(r.spineId,r.slotName,r.wrapper),r.slotName=e.slotName,r.attached=t.attachSlotObject(r.spineId,r.slotName,r.wrapper,e.followAttachment)),r.attached?r:null}updateRenderCompensation(e,t){if(t)for(const s of this.slotGroups.values()){if(!s.attached||!s.wrapper.parent)continue;const n=e.spines.find(o=>o.id===s.spineId);if(!n)continue;const r=t.getSlotParentMatrix(s.spineId,s.slotName,n);r&&(r.invert(),s.compensator.transform.setFromMatrix(r))}}destroy(e){for(const t of this.slotGroups.values()){for(const s of[...t.compensator.children])t.compensator.removeChild(s);t.wrapper.removeFromParent(),t.compensator.destroy(),t.wrapper.destroy()}this.slotGroups.clear();for(const[t,s]of this.emitters)s.removeFromParent(),s.destroy({children:!0}),this.emitters.delete(t),this.configs.delete(t)}}async function zF(){const[i,e]=await Promise.all([ze.fromURL("/images/star.png"),ze.fromURL("/images/trail.png")]);return{dotTex:i,trailTex:e}}function qF(i,e,t){for(const s of i.systems){s.config.texture=e;const n=Nn(s.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 KF={class:"stage-wrap"},ZF={key:0,class:"hud"},JF={class:"hud-number hud-system-count"},QF={class:"hud-number hud-particle-count"},e3=Qt({__name:"Stage",setup(i){const e=po(),t=$e(null),s=$e(null),n=$e(!1),r=$e(!1),o=$e(""),a=$e(!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,M=null,_=null,w=null,b=[],C=0,R=0,F=0,I=0,k=null,B=null;const D=new cf,$=new WF,N={store:e,holder:t,app:()=>c},X=new VF(N),A=new YF(N,()=>o.value);let P=[];const O=new Map;function L(){l=new ms,c.stage.addChild(l),_=new ms,c.stage.addChild(_),D.createSprite(l),M=new Ns,l.addChild(M),w=new BR,l.addChild(w.container),u=new Ns,l.addChild(u),h=new Ns,l.addChild(h),f=new Ns,l.addChild(f),p=new Ns,l.addChild(p),m=new Ns,l.addChild(m),g=new Ns,l.addChild(g),v=new Ns,l.addChild(v),x=new Ns,l.addChild(x),y=new Ns,l.addChild(y),d=new Ns,l.addChild(d)}function U(fe){if(fe.button===0){if(o.value&&A.selectedTransformTarget()){A.onGizmoDown(fe);return}X.onPointerDown(fe)||A.onColliderPointerDown(fe)||A.onAttractionDown(fe)||A.onForceFieldDown(fe)||oF(N,fe.clientX,fe.clientY)}}function V(fe){X.onStageDoubleClick(fe)}function H(fe){rF(N,fe)}function q(fe=!0){cf.clearStoreBackground(e,fe)}async function ie(fe){await cf.handleFileChange(e,fe)}Ak({canvasElement:t,canvasFocused:a,undo:Ew,save:()=>Sw(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:fe=>{o.value=fe}});function re(){l&&$.sync(e,l,k,B,w)}function pe(fe,Y,W,j){const G=Math.max(2,Math.floor(j)||2);if(fe.config.mode==="stream"&&fe.config.streamBehavior==="loop"){kv(fe,Y,W,G);return}Y.reset();const z=1/Math.max(1,W),se=[];for(let ue=0;ue=Y)continue;const z=$.emitters.get(G.id);if(!z){W=!1;continue}pe(G,z,fe,Y)}W&&(e.timeline.recorded=!0)}function he(){var W,j,G,z;I=requestAnimationFrame(he);const fe=performance.now()/1e3;let Y=fe-C;if(C=fe,Y>.1&&(Y=.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),D.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),yR(e,c,M,_,b);const se=Math.max(1,e.timeline.fps),ue=e.timeline.frame,ne=ue/se;w==null||w.sync(e.spines,ue,se),re(),$.updateRenderCompensation(e,w),P=HF(e,ne);for(const Le of e.systems){const Me=$.emitters.get(Le.id);if(!Me)continue;Me.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const nt=Le.visible!==!1;Me.visible=nt,Me.renderable=nt;const Te=Le.config;Me.scale.set(Te.rootScaleX,Te.rootScaleY);const ps=new Set(Te.collisionColliderIds);Me.setColliders(Te.collision?P.filter(Mt=>ps.has(Mt.id)):[]),Me.setEmitterFollowSpawn(0,0,0);let _t={x:Te.centerX,y:Te.centerY,rotation:Te.rootRotation};const vt=Te.emitterFollow&&Te.emitterFollowMode==="bone"?e.spines.find(Mt=>Mt.id===Te.emitterFollowSpineId&&Mt.enabled&&Mt.status==="ready"):null,te=vt&&(w==null?void 0:w.getBoneWorldTransform(vt.id,Te.emitterFollowBoneName))||null,oe=Te.emitterFollow&&Te.emitterFollowMode==="path"?e.paths.find(Mt=>Mt.id===Te.emitterFollowPathId&&Mt.enabled):null,lt=Math.max(.05,Te.emitterFollowDuration),At=Math.min(1,Math.max(0,ne/lt)),Et=Math.min(1,Math.max(0,g1(Te.emitterFollowCurve,At))),tt=Math.min(1,Math.max(0,Te.emitterFollowOffset)),ni=Te.emitterFollowDirection==="reverse"?(1-tt)*(1-Et):tt+(1-tt)*Et,ns=oe?Mp(oe,ni):null;if(te){const Mt=Te.emitterFollowBoneOffsetX,vi=Te.emitterFollowBoneOffsetY,Cs=te.x+Mt,rs=te.y+vi,dn=Te.rootRotation+Te.emitterFollowBoneRotation,ri=Math.max(1e-4,Math.abs(Te.rootScaleX*Te.emitterFollowBoneScaleX)),Li=Math.max(1e-4,Math.abs(Te.rootScaleY*Te.emitterFollowBoneScaleY));if(_t={x:Cs,y:rs,rotation:dn},Te.emitterFollowSpace==="local")Me.position.set(Cs,-rs),Me.rotation=-dn*Math.PI/180,Me.scale.set(ri,Li),Me.setSimulationTransform(Cs,rs,dn,ri,Li);else{Me.position.set(Te.centerX,-Te.centerY),Me.rotation=-Te.rootRotation*Math.PI/180,Me.scale.set(ri,Li),Me.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation,ri,Li);const Bi=Mh(Te,Cs,rs,ri,Li),Ar=-(dn-Te.rootRotation);Me.setEmitterFollowSpawn(Bi.x,Bi.y,Ar)}}else if(ns){const Mt=ns.angle+(Te.emitterFollowDirection==="reverse"?180:0),vi=Te.emitterAngleMode==="direction"?Mt:Te.rootRotation;if(_t={x:ns.x,y:ns.y,rotation:vi},Te.emitterFollowSpace==="local")Me.position.set(ns.x,-ns.y),Me.rotation=-vi*Math.PI/180,Me.setSimulationTransform(ns.x,ns.y,vi);else{Me.position.set(Te.centerX,-Te.centerY),Me.rotation=-Te.rootRotation*Math.PI/180,Me.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation);const Cs=Mh(Te,ns.x,ns.y),rs=Te.emitterAngleMode==="direction"?-(Mt-Te.rootRotation):0;Me.setEmitterFollowSpawn(Cs.x,Cs.y,rs)}}else Me.position.set(Te.centerX,-Te.centerY),Me.rotation=-Te.rootRotation*Math.PI/180,Me.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation);const ts=Te.shape==="path"&&Te.spawnPathId>0&&e.paths.find(Mt=>Mt.id===Te.spawnPathId&&Mt.enabled&&Mt.points.length>0)||null;Me.setSpawnPathSampler(ts?Mt=>jF(Te,ts,Mt):null,(ts==null?void 0:ts.closed)===!0),O.set(Le.id,_t)}let de=0;const le=[],Ie=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,ye=(Le,Me,nt)=>{!Le||Le.id!==Ie||Le.visible===!1||RR(le,nt,Me.position.x,Me.position.y)},me=e.timeline,Ne=me.fps,Ze=1/Math.max(1,Ne);let qe=F,Ke=0;if(me.playing?(R+=Y,Ke=Math.floor(R/Ze),Ke>0&&(R-=Ke*Ze)):(R=0,ge(Ne)),me.playing&&Ke>0)for(let Le=0;Le_t.id===e.activeId),nt=(Me==null?void 0:Me.config.mode)==="stream"&&Me.config.streamBehavior==="loop"?mp(Me.config,Ne):null,ps=me.loop&&(nt==null?void 0:nt.start)===me.playbackStart&&nt.end===me.playbackEnd?me.playbackEnd-1:me.playbackEnd;if(me.frame>ps)if(me.loop)me.frame=me.playbackStart;else{me.frame=me.playbackEnd,me.playing=!1;break}}else{for(const Me of e.systems){const nt=$.emitters.get(Me.id);if(!nt)continue;Me.config.mode==="stream"&&Me.config.streamBehavior==="loop"?(W=Me.frames)!=null&&W.length||kv(Me,nt,Ne,me.totalFrames):me.frame===0&&nt.reset()}for(const[Me,nt]of $.emitters){const Te=e.systems.find(oe=>oe.id===Me),ps=(Te==null?void 0:Te.config.mode)==="stream"&&Te.config.streamBehavior==="loop",_t=ps?(j=Te.frames)==null?void 0:j[me.frame]:void 0,vt=me.frame===0&&!ps,te=vt?[]:_t||nt.update(Ze);if(vt?nt.apply([]):_t&&nt.apply(_t),(Te==null?void 0:Te.visible)!==!1)for(const oe of te)oe.active&&ye(Te,nt,oe);de+=te.length}for(const Me of e.systems){if(!Me.config.texture)continue;Me.frames=Me.frames||[];const nt=$.emitters.get(Me.id);nt&&!(Me.config.mode==="stream"&&Me.config.streamBehavior==="loop")&&(Me.frames[me.frame]=nt.capture())}me.frame++,me.frame>=me.totalFrames&&(me.frame=me.playbackStart,me.recorded=!0)}else{me.playing||(qe=me.frame);for(const Le of e.systems){const Me=$.emitters.get(Le.id),nt=me.playing?F:me.frame,Te=(z=Le.frames)==null?void 0:z[nt],ps=Le.config.mode==="stream"&&Le.config.streamBehavior==="loop"&&!!Te;if((me.recorded||ps)&&Me&&Te){Me.apply(Te);for(const _t of Te)_t.active&&(ye(Le,Me,_t),de++)}else if(Me){const _t=me.frame===0?[]:Me.update(0);if(me.frame===0&&Me.apply([]),Le.visible!==!1)for(const vt of _t)vt.active&&ye(Le,Me,vt);de+=Me.activeCount}}}F=qe,w==null||w.sync(e.spines,qe,Ne);for(const[,Le]of $.emitters)Le.drawTrailMeshDebug(e.settings.showSkinMesh);ER(e,P,v),IR(e,X.selectedNodes,x),_R(e,w,u),xR(e,O,h),bR(e,O,f),wR(e,p),SR(e,m),MR(e,g),CR(o,A.selectedTransformTarget.bind(A),y),PR(le,e,d),s.value&&(s.value.systems=e.systems.length,s.value.particles=de)}}return Wn(async()=>{const fe=t.value;c=new Ub({width:fe.clientWidth||800,height:fe.clientHeight||600,backgroundAlpha:0,antialias:!0}),fe.appendChild(c.view),L(),Ls(()=>e.settings.backgroundImageData,W=>D.syncTexture(W),{immediate:!0});const Y=await zF();k=Y.dotTex,B=Y.trailTex,qF(e,k,B),s.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,R=0,F=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const W of e.systems)W.frames=[];e.recalcTotalFrames(),C=performance.now()/1e3,he(),Ls(()=>e.systems.map(W=>JSON.stringify(W.config,(j,G)=>j==="texture"||j==="trailTexture"||j==="previewUrl"?void 0:G)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const W of e.systems)W.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),Tk(e)}),Ml(()=>{cancelAnimationFrame(I),w==null||w.destroy(),w=null,D.destroy(),l&&c&&$.destroy(l),c&&(c.destroy(!0,{children:!0}),c=null)}),Ls(()=>[e.activeObjectType,e.activeObjectId],()=>X.resetSelection()),(fe,Y)=>(K(),J("div",KF,[T("div",{ref_key:"holder",ref:t,class:ke(["stage-holder",{grid:E(e).settings.showGrid}]),tabindex:"0",onWheel:Je(H,["prevent"]),onPointerdown:U,onDblclick:Je(V,["prevent"])},null,34),xe(MF,{ctx:N,"active-tool":o.value,"show-settings":n.value,"show-help":r.value,"onUpdate:activeTool":Y[0]||(Y[0]=W=>o.value=W),"onUpdate:showSettings":Y[1]||(Y[1]=W=>n.value=W),"onUpdate:showHelp":Y[2]||(Y[2]=W=>r.value=W),onClearBackground:q,onBackgroundFile:ie},null,8,["active-tool","show-settings","show-help"]),xe(XF,{show:n.value,onClose:Y[3]||(Y[3]=W=>n.value=!1)},null,8,["show"]),xe(nF,{show:r.value,onClose:Y[4]||(Y[4]=W=>r.value=!1)},null,8,["show"]),s.value?(K(),J("div",ZF,[Y[5]||(Y[5]=Rt(" 系统: ",-1)),T("b",JF,be(s.value.systems),1),Y[6]||(Y[6]=Rt(" · 粒子(骨骼): ",-1)),T("b",QF,be(s.value.particles),1),Y[7]||(Y[7]=Rt(" · 根骨骼: ",-1)),Y[8]||(Y[8]=T("b",null,"root",-1)),Y[9]||(Y[9]=T("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):Se("",!0)]))}}),t3=es(e3,[["__scopeId","data-v-38dbe6fc"]]),s3=[{x:0,y:0},{x:1,y:1}],pm=[{x:0,y:1},{x:1,y:1}],i3=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],gm=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],vm=[{x:0,y:1},{x:1,y:1}],ym=[{x:0,y:1},{x:1,y:1}],Kt=uo({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let gc=0;function n3(i){return new Promise(e=>window.setTimeout(e,i))}function Rw(i,e){const t=++gc,s=performance.now();Object.assign(Kt,{visible:!0,title:i,detail:e,progress:0,indeterminate:!1,failed:!1});const n=(o,a)=>{t===gc&&(Kt.indeterminate=o==null,o!=null&&(Kt.progress=Math.min(100,Math.max(0,o))),a&&(Kt.detail=a))},r=async(o,a)=>{if(t!==gc)return;Kt.failed=o,Kt.indeterminate=!1,Kt.progress=o?Kt.progress:100,Kt.detail=a,await n3(Math.max(180,(o?850:450)-(performance.now()-s))),t===gc&&(Kt.visible=!1)};return{update:n,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o="已完成")=>r(!1,o),fail:(o="操作失败")=>r(!0,o)}}async function r3(i,e){if(!i.body)return e(null),i.text();const t=Number(i.headers.get("content-length")),s=Number.isFinite(t)&&t>0,n=i.body.getReader(),r=new TextDecoder;let o=0,a="";for(e(s?0:null);;){const{done:c,value:l}=await n.read();if(c)break;o+=l.byteLength,a+=r.decode(l,{stream:!0}),e(s?Math.min(1,o/t):null)}return a+=r.decode(),s&&e(1),a}const o3="3.8";function di(i,e,t){i[e]==null&&i[t]!=null&&(i[e]=i[t]),delete i[t]}function xm(i){if(!i||typeof i!="object")return;if(Array.isArray(i)){for(const t of i)xm(t);return}const e=i;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))xm(t)}function a3(i){for(const e of i.bones)di(e,"transform","inherit");for(const e of i.transform||[])di(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),di(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of i.path||[])di(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of i.skins)for(const t of Object.values(e.attachments||{}))for(const s of Object.values(t||{}))s.parent!=null&&di(s,"deform","timelines")}function l3(i){for(const e of Object.values(i.slots||{}))di(e,"color","rgba"),di(e,"twoColor","rgba2")}function c3(i){for(const e of Object.values(i.bones||{}))for(const t of e.rotate||[])di(t,"angle","value")}function h3(i){for(const e of Object.values(i.transform||{}))for(const t of e)di(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),di(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function u3(i){for(const e of Object.values(i.path||{})){for(const t of["position","spacing"])for(const s of e[t]||[])di(s,t,"value");for(const t of e.mix||[])di(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function d3(i){if(!i.attachments)return;const e=i.deform||(i.deform={});for(const[t,s]of Object.entries(i.attachments)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(s)){const a=n[r]||(n[r]={});for(const[c,l]of Object.entries(o))l.deform&&(a[c]=l.deform)}}delete i.attachments}function f3(i){i.skeleton.spine=o3,a3(i);for(const e of Object.values(i.animations))l3(e),c3(e),h3(e),u3(e),d3(e);return xm(i.animations),i}function m3(i,e,t,s,n=!1){if(n){let c=0;for(let l=0;l[...n].sort((a,c)=>a-c);let o=!0;for(;o;){o=!1;const a=r();for(let c=0;cf&&(f=m,d=p)}d>=0&&(n.add(d),o=!0)}}return r().map(a=>i[a])}function Gv(i,e,t,s,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(i[a].frame-i[o].frame);if(r>=3&&l>0&&Math.abs(Math.abs(i[c].frame-i[a].frame)-l)<1e-6){const u=i[o].values[s],d=i[a].values[s],f=i[c].values[s];return n?(-3*u+4*d-f)/(2*l):(3*u-4*d+f)/(2*l)}const h=i[a].frame-i[o].frame;return h?(i[a].values[s]-i[o].values[s])/h:0}function jv(i,e,t){const s=i[t].frame-i[e].frame,n=[];for(let r=0;rd.values[r])),l=Math.max(...i.slice(e,t+1).map(d=>d.values[r])),h=o+Gv(i,e,t,r,!0)*s/3,u=a-Gv(i,e,t,r,!1)*s/3;n.push([Math.max(c,Math.min(l,h)),Math.max(c,Math.min(l,u))])}return{values:n}}function p3(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function g3(i,e,t,s,n,r=!1){if(r){let l=0;for(let h=0;h[...n].sort((c,l)=>c-l);let o=!0;for(;o;){o=!1;const c=r();for(let l=0;lm&&(m=v,p=g)}p>=0&&(n.add(p),o=!0)}}const a=r();return{samples:a.map(c=>i[c]),controls:a.slice(0,-1).map((c,l)=>jv(i,c,a[l+1]))}}function v3(i){if(!i.length)return[];const e=[i[0]];for(let t=1;t180;)s-=360;for(;s-e[t-1]<-180;)s+=360;e.push(s)}return e}function is(i){if(!Number.isFinite(i))return 0;const e=Math.round(i*1e5)/1e5;return Object.is(e,-0)?0:e}function y3(i,e,t,s){const n=Math.max(2,Math.min(16,Math.round(Number(i.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(i.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 Fw(i,e){let t=i,s=2;for(;e.has(t);)t=`${i}_${s++}`;return e.add(t),t}function b3(i){return i.replace(/\.[^./\\]+$/,"")}function Ow(i,e){return b3([i,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function w3(i){var s,n;const e=Number(((s=i==null?void 0:i.orig)==null?void 0:s.width)??(i==null?void 0:i.width))||0,t=Number(((n=i==null?void 0:i.orig)==null?void 0:n.height)??(i==null?void 0:i.height))||0;return{width:e,height:t}}function yc(i){return Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")}function Kv(i,e){return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255,Math.max(0,Math.min(1,e))]}function Za(i,e){return is(i/e)}function S3(i,e){const t=i.config,s=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+s:t.streamBehavior!=="loop"?r=n+Math.max(1/e,Number(t.duration)||0)+s:r=n+mr(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function M3(i,e,t){const s=i.config;if(s.mode!=="stream"||s.streamBehavior!=="loop")return new Set;const n=mp(s,e),r=Math.max(1,t)/Math.max(1,e);return new Set([Math.round(n.start*r),Math.round(n.end*r)])}function Th(i,e){return e?i.boneName:`${i.spawnId??"legacy"}_${i.boneName}`}function T3(i,e,t,s){const n=new Set;for(const r of i)for(const o of r)n.add(Th(o,e));return[...n].sort().map((r,o)=>({key:r,name:Fw(`${s}_${o}`,t),states:i.map(a=>a.find(c=>Th(c,e)===r)||null)}))}function Zv(i,e){const t=new Set(e.states.map(s=>s==null?void 0:s.resourceId).filter(s=>typeof s=="number"));return i.config.imageResources.filter(s=>t.has(s.id))}function _3(i,e,t,s){const n=e*t/s,r=Math.min(i.states.length-1,Math.max(0,Math.floor(n))),o=Math.min(i.states.length-1,r+1),a=i.states[r],c=i.states[o];if(!a||!c||Th(a,!0)!==Th(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 Jv(i,e){return!i||i==="跟随导出"?e.keyframeCurve:i==="贝塞尔"?"bezier":"linear"}function Eo(i,e,t,s,n,r=new Set,o=new Set,a=n.keyframeCurve){if(!i.length)return[];const c=new Set(r);for(const u of o)c.add(u);const l=a==="bezier"&&n.spineVersion!=="3.8"?kw(i,s,c,o):{samples:Pw(i,s,c,o),controls:[]},h=l.samples.map(u=>{const d={time:Za(u.frame,e)};return t.forEach((f,p)=>{d[f]=is(u.values[p])}),o.has(u.frame)&&(d.curve="stepped"),d});for(let u=0;u0&&n&&e.add(t-1),s&&e.add(t))}return e}function A3(i){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),s&&e.add(t))}return e}function R3(i,e){var s;if(!i.shapeEnabled||!((s=i.shapeCurve)!=null&&s.length))return 1;const t=[...i.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{(o!==r||s.has(a))&&(n.push(t(o,a)),r=o)}),n}function k3(i,e,t){const s=i.imageMode==="sequence"?i.sequenceFrames[e]:void 0,n=(s==null?void 0:s.name)||i.textureName||`image_${i.id}`,r=(s==null?void 0:s.texture)||i.texture,o=w3(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const a=o.width||1,c=o.height||1;return{path:Ow(i.textureFolder,n),x:is((.5-i.anchorX)*a),y:is((i.anchorY-.5)*c),width:is(a),height:is(c)}}function Qv(i,e){const t=[];for(const n of e){const r=n.imageMode==="sequence"?Math.max(1,n.sequenceFrames.length):1;for(let o=0;o1;return new Map(t.map((n,r)=>[n,s?`${i}_${r}`:i]))}function F3(i,e,t,s,n=s.keyframeCurve,r=new Set,o=new Set){if(!i.length)return[];const a=new Set;for(let d=1;d({frame:f,values:d})),l=1/255,h=n==="bezier"&&s.spineVersion!=="3.8"?kw(c,[l,l,l,.01],a,r):{samples:Pw(c,[l,l,l,.01],a,r),controls:[]},u=h.samples.map(d=>{const f={time:Za(d.frame,t),color:`${yc(d.values[0])}${yc(d.values[1])}${yc(d.values[2])}${yc(d.values[3])}`};return r.has(d.frame)&&(f.curve="stepped"),f});if(h.controls.length)for(let d=0;d({time:Za(p,n),name:f??null}),c);h.length&&(l.attachment=h);const u=F3(s,t,n,r,o,a,c);u.length&&(l.rgba=u)}function ty(i){var p;const e=i.settings,t=Math.max(1,Number(i.timeline.fps)||30),s=Math.max(1,Math.round(e.fps||30)),n=e.integerFrameAlignment?s:t,r=[],o=i.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=s);const c=a.skins[0].attachments,l=new Set(["root"]),h=[...new Set([...i.timeline.animations.length?i.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,S3(m,t)),v=(m.frames||[]).slice(0,g);v.length||r.push({code:"empty-cache",message:`“${m.config.name}”没有可用帧缓存。`});const x=Fw(x3(m.config.name,`system_${m.id}`),l);a.bones.push({name:x,parent:"root"});const y=T3(v,e.bonePool,l,x),M=Math.max(0,(g-1)/t),_=Math.max(1,Math.ceil(M*n)+1),w=M3(m,t,n),b=u.get(m.animation)||[];b.push({system:m,tracks:y,targetFrames:_,boundaryFrames:w,attachmentPrefix:x}),u.set(m.animation,b);for(const C of y){a.bones.push({name:C.name,parent:x});const R=Zv(m,C),F=new Set(R.map($=>$.blend)),I=[],k=[];for(const $ of F){const N=`${C.name}_${$}`;I.push(N),a.slots.push({name:N,bone:C.name,color:"ffffff00",blend:Hv[$]});const X=c[N]||(c[N]={}),A=R.filter(O=>O.blend===$),P=Qv(x,A);for(const O of A){const L=O.imageMode==="sequence"?Math.max(1,O.sequenceFrames.length):1;for(let U=0;U{var U;return((U=L==null?void 0:L.trailState)==null?void 0:U.resourceId)===$.id}))continue;const N=Math.max(2,Math.min(16,Math.round($.boneCount||3))),X=[];for(let L=0;La.bones.findIndex(U=>U.name===L)),O=Ow("",$.textureName||`trail_${$.id}`);(c[A]||(c[A]={}))[`trail_${$.id}`]=y3(m.config,$,P,O),$.texture||r.push({code:"missing-image",message:`拖尾图片“${$.textureName||$.id}”缺失,已保留路径。`})}const B=new Set([...I,...k]),D=a.slots.filter($=>B.has(String($.name)));D.length&&(a.slots=a.slots.filter($=>!D.includes($)),a.slots.push(...D.filter($=>k.includes(String($.name))),...D.filter($=>I.includes(String($.name)))))}}for(const m of h){const g=u.get(m)||[],v={bones:{},slots:{}};let x=!1;for(const{system:y,tracks:M,targetFrames:_,boundaryFrames:w,attachmentPrefix:b}of g)for(const C of M){const R=Array.from({length:_},(H,q)=>_3(C,q,t,n)),F=R.map(H=>!!(H!=null&&H.active)),I=[],k=[],B=[];R.forEach((H,q)=>{H!=null&&H.active&&(I.push({frame:q,values:[H.worldX??H.x,H.worldY??H.y]}),k.push(H.worldRotation??H.rotation),B.push({frame:q,values:[H.worldScaleX??H.scaleX,H.worldScaleY??H.scaleY]}))});const D=v3(k),$=I.map((H,q)=>({frame:H.frame,values:[D[q]??0]})),N=C3(R);for(const H of w)N.add(H);const X=A3(R),A={},P=Eo(I,n,["x","y"],[Wv,Wv],e,N,X),O=Eo($,n,["value"],[qv],e,N,X),L=Eo(B,n,["x","y"],[vc,vc],e,N,X);P.length&&(A.translate=P),O.length&&(A.rotate=O),L.length&&(A.scale=L),Object.keys(A).length&&(v.bones[C.name]=A,x=!0);const U=Zv(y,C),V=new Set(U.map(H=>H.blend));for(const H of V){const q=U.filter(Y=>Y.blend===H),ie=Qv(b,q),re=[],pe=[];let ge=16777215;for(let Y=0;Y<_;Y++){const W=R[Y],j=W?y.config.imageResources.find(se=>se.id===W.resourceId):void 0,G=!!W&&F[Y]&&W.imageVisible!==!1&&(j==null?void 0:j.blend)===H;W&&(j==null?void 0:j.blend)===H&&(ge=W.colorHex);const z=G?ie.get(`${j.id}_${W.imageFrameIndex??0}`):void 0;re.push(z??null),pe.push(Kv(ge,G?W.alpha:0))}const he=q.filter(Y=>Y.independentAlpha==="curve").map(Y=>Jv(Y.alphaCurveMode,e)),fe=he.length?he.includes("bezier")?"bezier":"linear":Jv(y.config.alphaMode==="curve"?y.config.curveMode:void 0,e);ey(v,`${C.name}_${H}`,re,pe,n,e,fe,X,w),re.some(Boolean)&&(x=!0)}if(y.config.trail)for(const H of y.config.trailResources){const q=Math.max(2,Math.min(16,Math.round(H.boneCount||3))),ie=R.map(z=>{var se;return((se=z==null?void 0:z.trailState)==null?void 0:se.resourceId)===H.id?z.trailState:void 0}),re=ie.find(z=>!!z);if(!re)continue;const pe=I3(ie),ge=E3(ie),he=H.widthSizeMode==="random"?Math.max(1,Number(H.widthMin)||0,Number(H.widthMax)||0):Math.max(.001,Number(H.width)||100);let fe=re;const Y=ie.map(z=>(z&&(fe=z),fe));for(let z=0;z{const Le=qe==null?void 0:qe.bones[Math.min(qe.bones.length-1,z)];if(!Le)return;const Me={x:Le.worldX??Le.x,y:Le.worldY??Le.y,rotation:Le.worldRotation??-Le.rotation};se.push({frame:Ke,values:[Me.x,Me.y]}),ue.push({frame:Ke,values:[Me.rotation]}),ne.push({frame:Ke,values:[1,Math.max(0,qe.width/he)*le]})});const Ie=`${C.name}_trail_${H.id}_${z}`,ye={},me=Eo(se,n,["x","y"],[zv,zv],e,de,ge),Ne=Eo(ue,n,["value"],[qv],e,de,ge),Ze=Eo(ne,n,["x","y"],[vc,vc],e,de,ge);me.length&&(ye.translate=me),Ne.length&&(ye.rotate=Ne),Ze.length&&(ye.scale=Ze),Object.keys(ye).length&&(v.bones[Ie]=ye)}const W=ie.map(()=>`trail_${H.id}`);let j=re.colorHex;const G=ie.map(z=>(z&&(j=z.colorHex),Kv(j,z?z.alpha:0)));ey(v,`${C.name}_trail_${H.id}`,W,G,n,e,e.keyframeCurve,ge,w),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"?f3(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 O3(i,e){const t=new Blob([i.text],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(t),n=document.createElement("a");n.href=s,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(s),1e3)}class n6{constructor(){S(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(){S(this,"entries",{});S(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 s=0,n=e.length;s1&&(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 Js){return t.setFromString(e)}};S(Js,"WHITE",new Js(1,1,1,1)),S(Js,"RED",new Js(1,0,0,1)),S(Js,"GREEN",new Js(0,1,0,1)),S(Js,"BLUE",new Js(0,0,1,1)),S(Js,"MAGENTA",new Js(1,0,1,1));let st=Js;const Gt=class Gt{static clamp(e,t,s){return es?s:e}static cosDeg(e){return Math.cos(e*Gt.degRad)}static sinDeg(e){return Math.sin(e*Gt.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Gt.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 Gt.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,s){const n=Math.random(),r=t-e;return n<=(s-e)/r?e+Math.sqrt(n*r*(s-e)):t-Math.sqrt((1-n)*r*(t-s))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};S(Gt,"epsilon",1e-5),S(Gt,"epsilon2",Gt.epsilon*Gt.epsilon),S(Gt,"PI",3.1415927),S(Gt,"PI2",Gt.PI*2),S(Gt,"invPI2",1/Gt.PI2),S(Gt,"radiansToDegrees",180/Gt.PI),S(Gt,"radDeg",Gt.radiansToDegrees),S(Gt,"degreesToRadians",Gt.PI/180),S(Gt,"degRad",Gt.degreesToRadians);let Ce=Gt;const ai=class ai{apply(e,t,s){return t===void 0||s===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(s)}};S(ai,"linear",new class extends ai{applyInternal(e){return e}}),S(ai,"smooth",new class extends ai{applyInternal(e){return e*e*(3-2*e)}}),S(ai,"slowFast",new class extends ai{applyInternal(e){return e*e}}),S(ai,"fastSlow",new class extends ai{applyInternal(e){return(e-1)*(e-1)*-1+1}}),S(ai,"circle",new class extends ai{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 ta=ai;class B3 extends ta{constructor(t){super();S(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 r6 extends B3{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const rr=class rr{static arrayCopy(e,t,s,n,r){for(let o=t,a=n;o=t?e:rr.setArraySize(e,t,s)}static newArray(e,t){const s=[];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 l6{constructor(e=32){S(this,"values");S(this,"addedValues",0);S(this,"lastValue",0);S(this,"mean",0);S(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(s[1]),h.height=parseInt(s[2])},n.format=()=>{},n.filter=h=>{h.minFilter=je.enumValue(ra,s[1]),h.magFilter=je.enumValue(ra,s[2])},n.repeat=h=>{s[1].indexOf("x")!==-1&&(h.uWrap=oa.Repeat),s[1].indexOf("y")!==-1&&(h.vWrap=oa.Repeat)},n.pma=h=>{h.pma=s[1]==="true"};var r={};r.xy=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2])},r.size=h=>{h.width=parseInt(s[1]),h.height=parseInt(s[2])},r.bounds=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2]),h.width=parseInt(s[3]),h.height=parseInt(s[4])},r.offset=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2])},r.orig=h=>{h.originalWidth=parseInt(s[1]),h.originalHeight=parseInt(s[2])},r.offsets=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2]),h.originalWidth=parseInt(s[3]),h.originalHeight=parseInt(s[4])},r.rotate=h=>{const u=s[1];u==="true"?h.degrees=90:u!=="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(s[1])};let o=t.readLine();for(;o&&o.trim().length===0;)o=t.readLine();for(;!(!o||o.trim().length===0||t.readEntry(s,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 Bw(a,o);for(;;){const u=t.readEntry(s,o=t.readLine());if(u===0)break;const d=r[s[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(s[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 $3(o.trim());t.readEntry(s,o=t.readLine())!==0;){const h=n[s[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 s=t.indexOf(":");if(s===-1)return 0;e[0]=t.substr(0,s).trim();for(let n=1,r=s+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 $3{constructor(e){S(this,"name");S(this,"minFilter",ra.Nearest);S(this,"magFilter",ra.Nearest);S(this,"uWrap",oa.ClampToEdge);S(this,"vWrap",oa.ClampToEdge);S(this,"texture",null);S(this,"width",0);S(this,"height",0);S(this,"pma",!1);S(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 Bw extends Lw{constructor(t,s){super();S(this,"page");S(this,"name");S(this,"x",0);S(this,"y",0);S(this,"offsetX",0);S(this,"offsetY",0);S(this,"originalWidth",0);S(this,"originalHeight",0);S(this,"index",0);S(this,"degrees",0);S(this,"names",null);S(this,"values",null);this.page=t,this.name=s,t.regions.push(this)}}const Ph=class Ph{constructor(e){S(this,"name");S(this,"timelineAttachment");S(this,"timelineSlots",Ph.empty);if(!e)throw new Error("name cannot be null.");this.name=e,this.timelineAttachment=this}isTimelineActive(e,t,s){let n=e[t];if(n.bone.isActive()){const r=(s?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=s.appliedPose.deform;let h=this.vertices;const u=this.bones;if(!u){l.length>0&&(h=l);const m=s.bone.appliedPose,g=m.worldX,v=m.worldY,x=m.a,y=m.b,M=m.c,_=m.d;for(let w=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 s=e;const n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)s+="0";return s+=n,s}static nextID(){return Uo._nextID++}};S(Uo,"_nextID",0);let la=Uo;var Ts;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(Ts||(Ts={}));const Nw=[Ts.hold,Ts.once,Ts.loop,Ts.pingpong,Ts.onceReverse,Ts.loopReverse,Ts.pingpongReverse];class Tp{constructor(e,t,s){S(this,"name");S(this,"timelines",[]);S(this,"timelineIds");S(this,"bones");S(this,"color",new st(1,1,1,1));S(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=s,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 s=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-s;return n-s}};function X3(i){return typeof i=="object"&&i!==null&&typeof i.slotIndex=="number"}class vo extends Bt{constructor(t,s,...n){super(t,...n);S(this,"curves");this.curves=je.newFloatArray(t+s*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){const s=this.getFrameCount()+t*18;if(this.curves.length>s){const n=je.newFloatArray(s);je.arrayCopy(this.curves,0,n,0,s),this.curves=n}}setBezier(t,s,n,r,o,a,c,l,h,u,d){const f=this.curves;let p=this.getFrameCount()+t*18;n===0&&(f[s]=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,M=g*2+x,_=(a-r)*.3+m+v*.16666667,w=(c-o)*.3+g+x*.16666667,b=r+_,C=o+w;for(let R=p+18;pt){const h=this.frames[s],u=this.frames[s+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)}s+=this.getFrameEntries();const c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[s]-c)*(this.frames[s+n]-l)}}class kn extends vo{constructor(e,t,s){super(e,t,s)}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){const t=this.frames;let s=t.length-2;for(let r=2;r<=s;r+=2)if(t[r]>e){s=r-2;break}const n=this.curves[s>>1];switch(n){case 0:{const r=t[s],o=t[s+1];return o+(e-r)/(t[s+2]-r)*(t[s+2+1]-o)}case 1:return t[s+1]}return this.getBezierValue(e,s,1,n-2)}getRelativeValue(e,t,s,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=(s-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(s,d,1,f-2),l=this.getBezierValue(s,d,2,f+18-2),h=this.getBezierValue(s,d,3,f+36-2)}if(n!==1)if(r===Xe.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 Kw extends kn{constructor(t,s,n){super(t,s,`${et.alpha}|${n}`);S(this,"slotIndex",0);this.slotIndex=n}apply(t,s,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 Zw extends fu{constructor(e,t,s){super(e,t,s,`${et.rgb}|${s}`,`${et.alpha}|${s}`,`${et.rgb2}|${s}`)}getFrameEntries(){return 8}setFrame(e,t,s,n,r,o,a,c,l){e<<=3,this.frames[e]=t,this.frames[e+1]=s,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,s,n,r,o){const a=t.color,c=t.darkColor;let l=0,h=0,u=0;const d=this.frames;if(s>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 M=(s-y)/(d[v+8]-y);f+=(d[v+8+1]-f)*M,p+=(d[v+8+2]-p)*M,m+=(d[v+8+3]-m)*M,g+=(d[v+8+4]-g)*M,l+=(d[v+8+5]-l)*M,h+=(d[v+8+6]-h)*M,u+=(d[v+8+7]-u)*M;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(s,v,1,x-2),p=this.getBezierValue(s,v,2,x+18-2),m=this.getBezierValue(s,v,3,x+36-2),g=this.getBezierValue(s,v,4,x+54-2),l=this.getBezierValue(s,v,5,x+72-2),h=this.getBezierValue(s,v,6,x+90-2),u=this.getBezierValue(s,v,7,x+108-2)}if(n===1)a.set(f,p,m,g);else if(r===Xe.setup){const y=e.data.setupPose;let M=y.color;a.set(M.r+(f-M.r)*n,M.g+(p-M.g)*n,M.b+(m-M.b)*n,M.a+(g-M.a)*n),M=y.darkColor,l=M.r+(l-M.r)*n,h=M.g+(h-M.g)*n,u=M.b+(u-M.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 Jw extends fu{constructor(e,t,s){super(e,t,s,`${et.rgb}|${s}`,`${et.rgb2}|${s}`)}getFrameEntries(){return 7}setFrame(e,t,s,n,r,o,a,c){e*=7,this.frames[e]=t,this.frames[e+1]=s,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,s,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(s1?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 Ja extends Bt{constructor(t,s){super(t,`${et.attachment}|${s}`);S(this,"slotIndex",0);S(this,"attachmentNames");this.slotIndex=s,this.attachmentNames=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s,n){this.frames[t]=s,this.attachmentNames[t]=n}apply(t,s,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[s];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[s+this.getFrameEntries()]-a)}apply(t,s,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=Bt.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,s,n,r){if(!t.bone.active)return;const o=s?t.appliedPose:t.pose;if(o.attachment==null||o.attachment.timelineAttachment!==this.attachment)return;const a=o.deform;switch(a.length===0&&(r=Xe.setup),r){case Xe.setup:a.length=0;break;case Xe.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=Nw[o&15];if(u!==Ts.hold)switch(l+=(n-r)/a+1e-5|0,u){case Ts.once:l=Math.min(h-1,l);break;case Ts.loop:l%=h;break;case Ts.pingpong:{const d=(h<<1)-2;l=d===0?0:l%d,l>=h&&(l=d-l);break}case Ts.onceReverse:l=Math.max(h-1-l,0);break;case Ts.loopReverse:l=h-1-l%h;break;case Ts.pingpongReverse:{const d=(h<<1)-2;l=d===0?0:(l+h-1)%d,l>=h&&(l=d-l)}}c.sequenceIndex=l}};S(li,"ENTRIES",3),S(li,"MODE",1),S(li,"DELAY",2);let Ah=li;const Fh=class Fh extends Bt{constructor(t){super(t,...Fh.propertyIds);S(this,"events");this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s.time,this.events[t]=s}apply(t,s,n,r,o,a,c,l,h){if(!r)return;const u=this.frames,d=this.frames.length;if(s>n)this.apply(null,s,Number.MAX_VALUE,r,0,a,!1,!1,!1),s=-1;else if(s>=u[d-1])return;if(n0&&u[f-1]===p;)f--}for(;f=u[f];f++)r.push(this.events[f])}};S(Fh,"propertyIds",[`${et.event}`]);let yl=Fh;const $o=class $o extends Bt{constructor(t){super(t,...$o.propertyIds);S(this,"drawOrders");this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s,n){this.frames[t]=s,this.drawOrders[t]=n}apply(t,s,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 M=f[v];p=f[v+1],m=f[v+2],g=f[v+3];const _=(n-M)/(f[v+4]-M);p+=(f[v+4+1]-p)*_,m+=(f[v+4+2]-m)*_,g+=(f[v+4+3]-g)*_;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===Xe.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 _r extends Rl{constructor(e,t,s,n){super(e,t,s,n)}apply(e,t,s,n,r,o,a,c,l){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const h=s>=this.frames[0]?this.getCurveValue(s):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(s,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(s,r,o,a,this.get(u),this.get(h.data.setupPose)))}}}}class rS extends _r{constructor(e,t,s){super(e,t,s,et.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class oS extends _r{constructor(e,t,s){super(e,t,s,et.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class aS extends _r{constructor(e,t,s){super(e,t,s,et.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class lS extends _r{constructor(e,t,s){super(e,t,s,et.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class cS extends _r{constructor(e,t,s){super(e,t,s,et.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class hS extends _r{constructor(e,t,s){super(e,t,s,et.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class uS extends _r{constructor(e,t,s){super(e,t,s,et.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const Oh=class Oh extends Bt{constructor(t,s){super(t,...Oh.propertyIds);S(this,"constraintIndex");this.constraintIndex=s,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,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(s>n)this.apply(t,s,Number.MAX_VALUE,[],o,a,!1,!1,!1),s=-1;else if(s>=d[d.length-1])return;if(!(n=d[Bt.search(d,s)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};S(Oh,"propertyIds",[et.physicsConstraintReset.toString()]);let Eh=Oh;class dS extends Rl{constructor(e,t,s){super(e,t,s,et.sliderTime)}apply(e,t,s,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(s,r,o,a,u.time,h.data.setupPose.time)}}}class fS extends Rl{constructor(e,t,s){super(e,t,s,et.sliderMix),this.additive=!0}apply(e,t,s,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(s,r,o,a,u.mix,h.data.setupPose.mix)}}}const tl=class tl{constructor(e){S(this,"data");S(this,"tracks",[]);S(this,"timeScale",1);S(this,"unkeyedState",0);S(this,"events",[]);S(this,"listeners",[]);S(this,"queue",new j3(this));S(this,"propertyIds",new Map);S(this,"animationsChanged",!1);S(this,"trackEntryPool",new N3(()=>new G3));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let s=0,n=t.length;s0){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(s,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[s]=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 s=e.mixingFrom;if(!s)return!0;const n=this.updateMixingFrom(s,t);if(s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,e.nextTrackLast!==-1&&e.mixTime>=e.mixDuration){if(s.totalAlpha===0||e.mixDuration===0){if(e.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=e),s.totalAlpha===0)for(let r=e;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(s)}return n}return s.trackTime+=t*s.timeScale,e.mixTime+=t,!1}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,s=this.tracks;let n=!1;for(let a=0,c=s.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,M=y||l.shortestRotation,_=!M&&l.timelinesRotation.length!==g<<1;_&&(l.timelinesRotation.length=g<<1);for(let w=0;w0?c/a:o,h=s.animation.timelines,u=h.length,d=s.timelineMode,f=s.timelineHoldMix,p=r=s.alphaAttachmentThreshold);else{const B=!m||!(R instanceof xr)||I===Xe.current;R.apply(t,M,w,b,k,I,g,B,!1)}}return s.reverse&&r0&&this.queueEvents(s,_),this.events.length=0,s.nextAnimationLast=_,s.nextTrackLast=s.trackTime,r}applyAttachmentTimeline(e,t,s,n,r){const o=t.slots[e.slotIndex];if(!o.bone.active||!r&&o.attachmentState===this.unkeyedState+ly)return;let a=s=0,_=v>=0;Math.abs(x)<=90&&Ce.signum(x)!==Ce.signum(g)&&(Math.abs(v-y)>180?(m+=360*Ce.signum(v),_=M):y!==0?m-=360*Ce.signum(v):_=M),_!==M&&(m+=360*Ce.signum(v)),o[a]=m}o[a+1]=g,h.rotation=f+m*n}queueEvents(e,t){const s=e.animationStart,n=e.animationEnd,r=n-s,o=e.reverse;let a=e.trackLast%r;o&&(a=r-a);const c=this.events;let l=0,h=c.length;for(;l=s&&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=s&&d.time<=n&&this.queue.event(e,d)}}eventsReverse(e,t,s){const n=e.animation.duration,r=n-t,o=n-s,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 s=t;for(;;){const n=s.mixingFrom;if(!n)break;this.queue.end(n),s.mixingFrom=null,s.mixingTo=null,s=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setTrack(e,t,s){const n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(n.next=null,s&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,s=!1){return typeof t=="string"?this.setAnimation1(e,t,s):this.setAnimation2(e,t,s)}setAnimation1(e,t,s=!1){const n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error(`Animation not found: ${t}`);return this.setAnimation2(e,n,s)}setAnimation2(e,t,s=!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,s,r);return this.setTrack(e,o,n),this.queue.drain(),o}addAnimation(e,t,s=!1,n=0){return typeof t=="string"?this.addAnimation1(e,t,s,n):this.addAnimation2(e,t,s,n)}addAnimation1(e,t,s=!1,n=0){const r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);return this.addAnimation2(e,r,s,n)}addAnimation2(e,t,s=!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,s,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 s=this.setAnimation(e,tl.emptyAnimation,!1);return s.mixDuration=t,s.trackEnd=t,s}addEmptyAnimation(e,t=0,s=0){const n=this.addAnimation(e,tl.emptyAnimation,!1,s);return s<=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 s=0,n=this.tracks.length;s0&&(o[d]=v);break}}c&&(g=g&~xc|r[d]&xc),r[d]=g}}from(e,t,s){const n=this.propertyIds;let r=H3;for(let o=0,a=s.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()}};S(tl,"emptyAnimation",new Tp("",[],0));let iy=tl;class G3{constructor(){S(this,"animation",null);S(this,"previous",null);S(this,"next",null);S(this,"mixingFrom",null);S(this,"mixingTo",null);S(this,"listener",null);S(this,"trackIndex",0);S(this,"loop",!1);S(this,"additive",!1);S(this,"reverse",!1);S(this,"shortestRotation",!1);S(this,"keepHold",!1);S(this,"eventThreshold",0);S(this,"mixAttachmentThreshold",0);S(this,"alphaAttachmentThreshold",0);S(this,"mixDrawOrderThreshold",0);S(this,"animationStart",0);S(this,"animationEnd",0);S(this,"animationLast",0);S(this,"nextAnimationLast",0);S(this,"delay",0);S(this,"trackTime",0);S(this,"trackLast",0);S(this,"nextTrackLast",0);S(this,"trackEnd",0);S(this,"timeScale",0);S(this,"alpha",0);S(this,"mixTime",0);S(this,"mixDuration",0);S(this,"totalAlpha",0);S(this,"mixInterpolation",ta.linear);S(this,"timelineMode",[]);S(this,"timelineHoldMix",[]);S(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===ta.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=ta.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 j3{constructor(e){S(this,"objects",[]);S(this,"drainDisabled",!1);S(this,"animState");this.animState=e}start(e){this.objects.push(Ws.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Ws.interrupt),this.objects.push(e)}end(e){this.objects.push(Ws.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Ws.dispose),this.objects.push(e)}complete(e){this.objects.push(Ws.complete),this.objects.push(e)}event(e,t){this.objects.push(Ws.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,s,n,r,o;if(!this.drainDisabled){this.drainDisabled=!0;for(let a=0;a= 0.");if(!s)throw new Error("name cannot be null.");this.index=t,this.parent=n}copy(t){const s=new pu(this.index,this.name,t);return s.length=this.length,s.setupPose.set(this.setupPose),s}}var Ht;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(Ht||(Ht={}));class bm{constructor(){S(this,"bone");S(this,"x",0);S(this,"y",0);S(this,"rotation",0);S(this,"scaleX",0);S(this,"scaleY",0);S(this,"shearX",0);S(this,"shearY",0);S(this,"inherit",Ht.Normal);S(this,"a",0);S(this,"b",0);S(this,"c",0);S(this,"d",0);S(this,"worldY",0);S(this,"worldX",0);S(this,"world",0);S(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,s=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)*Ce.degRad,m=(t+90+o)*Ce.degRad;this.a=Math.cos(p)*s*d,this.b=Math.cos(m)*n*d,this.c=Math.sin(p)*s*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 Ht.Normal:{const d=(t+r)*Ce.degRad,f=(t+90+o)*Ce.degRad,p=Math.cos(d)*s,m=Math.cos(f)*n,g=Math.sin(d)*s,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 Ht.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,p=(t+r)*Ce.degRad,m=(t+90+o)*Ce.degRad;this.a=Math.cos(p)*s*d,this.b=Math.cos(m)*n*d,this.c=Math.sin(p)*s*f,this.d=Math.sin(m)*n*f;break}case Ht.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>Ce.epsilon2?(g=Math.abs(c*u*m-l*p*h)/g,l=h*g,u=c*g,v=t-Ce.atan2Deg(h,c)):(c=0,h=0,v=t-90+Ce.atan2Deg(u,l));const x=(v+r)*Ce.degRad,y=(v+o+90)*Ce.degRad,M=Math.cos(x)*s,_=Math.cos(y)*n,w=Math.sin(x)*s,b=Math.sin(y)*n;this.a=(c*M-l*w)*d,this.b=(c*_-l*b)*d,this.c=(h*M+u*w)*f,this.d=(h*_+u*b)*f;break}case Ht.NoScale:case Ht.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f,g=t*Ce.degRad,v=Math.cos(g),x=Math.sin(g);let y=(c*v+l*x)*p,M=(h*v+u*x)*m;const _=1/Math.sqrt(y*y+M*M);y*=_,M*=_;let w=-M,b=y;this.inherit===Ht.NoScale&&c*u-l*h<0!=(d<0!=f<0)&&(w=-w,b=-b);const C=r*Ce.degRad,R=(90+o)*Ce.degRad,F=Math.cos(C)*s,I=Math.cos(R)*n,k=Math.sin(C)*s,B=Math.sin(R)*n;this.a=(y*F+w*k)*d,this.b=(y*I+w*B)*d,this.c=(M*F+b*k)*f,this.d=(M*I+b*B)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,s=e.scaleY;if(!this.bone.parent){const v=1/t,x=1/s;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 Ht.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 Ht.OnlyTranslation:{const v=1/t,x=1/s;this.set5(this.a*v,this.b*v,this.c*x,this.d*x,0);break}case Ht.NoRotationOrReflection:{const v=1/t,x=1/s;r*=v,a*=x;const y=this.a*v,M=this.b*v,_=this.c*x,w=this.d*x,b=1/(r*r+a*a),C=1/Math.abs(l*v*x);this.set5((r*y+a*_)*b,(r*M+a*w)*b,(r*_-a*y)*C,(r*w-a*M)*C,Ce.atan2Deg(a,r));break}case Ht.NoScale:case Ht.NoScaleOrReflection:{const v=1/t,x=1/s,y=this.a*v,M=this.b*v,_=this.c*x,w=this.d*x;let b=c*this.a-o*this.c,C=r*this.c-a*this.a;l<0&&(b=-b,C=-C);let R=Ce.atan2Deg(C,b);this.rotation=R,R*=Ce.degRad;const F=Math.cos(R),I=Math.sin(R);let k=(r*F+o*I)*v,B=(a*F+c*I)*x;const D=1/Math.sqrt(k*k+B*B);k*=D,B*=D;const $=this.inherit===Ht.NoScale&&l<0!=(t<0!=s<0)?-1:1;this.set4(k*y+B*_,k*M+B*w,(k*_-B*y)*$,(k*w-B*M)*$)}}}set4(e,t,s,n){const r=e*e+s*s,o=t*t+n*n;r>Ce.epsilon2?(this.shearX=Ce.atan2Deg(s,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Ce.epsilon2?(this.shearY=Ce.atan2Deg(n,t),e*n-t*s<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,s,n,r){this.shearX=0;const o=e*e+s*s,a=t*t+n*n;if(o>Ce.epsilon2){const c=Ce.atan2Deg(s,e);this.rotation=c+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Ce.epsilon2?(this.shearY=Ce.atan2Deg(n,t),e*n-t*s<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>Ce.epsilon2?Ce.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 s=this.bone.children;for(let n=0,r=s.length;n1&&t.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(t,s,n,r,o,a,c,l,h,u){typeof n=="number"?nr.apply1(t,s,n,r,o,a,c,l):nr.apply2(t,s,n,r,o,a,c,l,h,u)}static apply1(t,s,n,r,o,a,c,l){s.modifyLocal(t);const h=s.bone.parent.appliedPose;let u=h.a,d=h.b,f=h.c,p=h.d,m=-s.shearX-s.rotation,g=0,v=0;switch(s.inherit){case Ht.OnlyTranslation:g=(n-s.worldX)*Ce.signum(t.scaleX),v=(r-s.worldY)*Ce.signum(t.scaleY);break;case Ht.NoRotationOrReflection:{const x=Math.abs(u*p-d*f)/Math.max(Ce.epsilon,u*u+f*f),y=u/t.scaleX,M=f/t.scaleY;d=-M*x*t.scaleX,p=y*x*t.scaleY,m+=Ce.atan2Deg(M,y)}default:{const x=n-h.worldX,y=r-h.worldY,M=u*p-d*f;Math.abs(M)<=Ce.epsilon?(g=0,v=0):(g=(x*p-y*d)/M-s.x,v=(y*u-x*f)/M-s.y)}}if(m+=Ce.atan2Deg(v,g),s.scaleX<0&&(m+=180),m>180?m-=360:m<=-180&&(m+=360),s.rotation+=m*l,o||a){switch(s.inherit){case Ht.NoScale:case Ht.NoScaleOrReflection:g=n-s.worldX,v=r-s.worldY}const x=s.bone.data.length*s.scaleX;if(x>Ce.epsilon){const y=g*g+v*v;if(o&&yx*x){const M=(Math.sqrt(y)/x-1)*l+1;switch(s.scaleX*=M,c){case Xs.Uniform:s.scaleY*=M;break;case Xs.Volume:s.scaleY/=M<.7?.25+.642857*M:M}}}}}static apply2(t,s,n,r,o,a,c,l,h,u){if(s.inherit!==Ht.Normal||n.inherit!==Ht.Normal)return;s.modifyLocal(t),n.modifyLocal(t);let d=s.x,f=s.y,p=s.scaleX,m=s.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 M=0,_=0,w=s.a,b=s.b,C=s.c,R=s.d;const F=Math.abs(p-m)<=Ce.epsilon;!F||c?(n.y=0,M=w*n.x+s.worldX,_=C*n.x+s.worldY):(M=w*n.x+b*n.y+s.worldX,_=C*n.x+R*n.y+s.worldY);const I=s.bone.parent.appliedPose;w=I.a,b=I.b,C=I.c,R=I.d;let k=w*R-b*C,B=M-I.worldX,D=_-I.worldY;k=Math.abs(k)<=Ce.epsilon?0:1/k;const $=(B*R-D*b)*k-d,N=(D*w-B*C)*k-f;let X=Math.sqrt($*$+N*N),A=n.bone.data.length*g,P,O;if(X0){let re=Math.min(1,ie/(h*2))-1;re=(ie-h*(1-re*re))/q,L-=re*L,U-=re*U,V=L*L+U*U}}e:if(F){A*=p;let q=(V-X*X-A*A)/(2*X*A);if(q<-1)q=-1,O=Math.PI*a;else if(q>1){if(q=1,O=0,c)switch(w=(Math.sqrt(V)/(X+A)-1)*u+1,s.scaleX*=w,l){case Xs.Uniform:s.scaleY*=w;break;case Xs.Volume:s.scaleY/=w<.7?.25+.642857*w:w}}else O=Math.acos(q)*a;w=X+A*q,b=A*Math.sin(O),P=Math.atan2(U*w-L*b,L*w+U*b)}else{w=p*A,b=m*A;const q=w*w,ie=b*b,re=Math.atan2(U,L);C=ie*X*X+q*V-q*ie;const pe=-2*ie*X,ge=ie-q;if(R=pe*pe-4*ge*C,R>=0){let ue=Math.sqrt(R);pe<0&&(ue=-ue),ue=-(pe+ue)*.5;let ne=ue/ge,de=C/ue;const le=Math.abs(ne)=0){D=Math.sqrt(ne)*a,P=re-Math.atan2(D,le),O=Math.atan2(D/m,(le-X)/p);break e}}let he=Ce.PI,fe=X-w,Y=fe*fe,W=0,j=0,G=X+w,z=G*G,se=0;C=-w*X/(q-ie),C>=-1&&C<=1&&(C=Math.acos(C),B=w*Math.cos(C)+X,D=b*Math.sin(C),R=B*B+D*D,Rz&&(j=C,z=R,G=B,se=D)),V<=(Y+z)*.5?(P=re-Math.atan2(W*a,fe),O=he*a):(P=re-Math.atan2(se*a,G),O=j*a)}const H=Math.atan2(n.y,n.x)*y;P=(P-H)*Ce.radDeg+v-s.rotation,P>180?P-=360:P<=-180&&(P+=360),s.rotation+=P*u,O=((O+H)*Ce.radDeg-n.shearX)*y+x-n.rotation,O>180?O-=360:O<=-180&&(O+=360),n.rotation+=O*u}}class Lc extends kl{constructor(t){super(t,new wm);S(this,"bones",[]);S(this,"_target",null);S(this,"_scaleYMode",Xs.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 nr(this,t)}}class Sm{constructor(){S(this,"position",0);S(this,"spacing",0);S(this,"mixRotate",0);S(this,"mixX",0);S(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 Bc extends kl{constructor(t){super(t,new Sm);S(this,"bones",[]);S(this,"_slot",null);S(this,"positionMode",ln.Fixed);S(this,"spacingMode",ds.Fixed);S(this,"rotateMode",oo.Chain);S(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 Mm(this,t)}}var ln;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(ln||(ln={}));var ds;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(ds||(ds={}));var oo;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(oo||(oo={}));const Mi=class Mi extends Pl{constructor(t,s){super(t,new Sm,new Sm);S(this,"data");S(this,"bones");S(this,"slot");S(this,"spaces",[]);S(this,"positions",[]);S(this,"world",[]);S(this,"curves",[]);S(this,"lengths",[]);S(this,"segments",[]);if(!s)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(const n of this.data.bones)this.bones.push(s.bones[n.index].constrainedPose);this.slot=s.slots[t.slot.index]}copy(t){var s=new Mi(this.data,t);return s.pose.set(this.pose),s}update(t,s){const n=this.slot.appliedPose.attachment;if(!(n instanceof xl))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===oo.Tangent,u=l.rotateMode===oo.ChainScale,d=this.bones,f=d.length,p=h?f:f+1,m=je.setArraySize(this.spaces,p),g=u?this.lengths=je.setArraySize(this.lengths,f):[],v=r.spacing;switch(l.spacingMode){case ds.Percent:if(u)for(let b=0,C=p-1;b0){b=p/b*v;for(let C=1;C0?Ce.degRad:-Ce.degRad}for(let b=0,C=3;b0){let D=R.a,$=R.b,N=R.c,X=R.d,A=0,P=0,O=0;if(h?A=x[C-1]:m[b+1]===0?A=x[C+2]:A=Math.atan2(B,k),A-=Math.atan2(N,D),w){P=Math.cos(A),O=Math.sin(A);const L=R.bone.data.length;y+=(L*(P*D-O*N)-k)*o,M+=(L*(O*D+P*N)-B)*o}else A+=_;A>Ce.PI?A-=Ce.PI2:A<-Ce.PI&&(A+=Ce.PI2),A*=o,P=Math.cos(A),O=Math.sin(A),R.a=P*D-O*N,R.b=P*$-O*X,R.c=O*D+P*N,R.d=O*$+P*X}}}computeWorldPositions(t,s,n,r){const o=this.slot;let a=this.appliedPose.position,c=this.spaces,l=je.setArraySize(this.positions,n*3+2),h=this.world;const u=s.closed;let d=s.worldVerticesLength,f=d/6,p=Mi.NONE;if(!s.constantSpeed){const O=s.lengths;f-=u?1:2;const L=O[f];this.data.positionMode===ln.Percent&&(a*=L);let U;switch(this.data.spacingMode){case ds.Percent:U=L;break;case ds.Proportional:U=L/n;break;default:U=1}h=je.setArraySize(this.world,8);for(let V=0,H=0,q=0;VL){p!==Mi.AFTER&&(p=Mi.AFTER,s.computeWorldVertices(t,o,d-6,4,h,0,2)),this.addAfterPosition(re-L,h,0,l,H);continue}for(;;q++){const pe=O[q];if(!(re>pe)){if(q===0)re/=pe;else{const ge=O[q-1];re=(re-ge)/(pe-ge)}break}}q!==p&&(p=q,u&&q===f?(s.computeWorldVertices(t,o,d-4,4,h,0,2),s.computeWorldVertices(t,o,0,4,h,4,2)):s.computeWorldVertices(t,o,q*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,H,r||V>0&&ie===0)}return l}u?(d+=2,h=je.setArraySize(this.world,d),s.computeWorldVertices(t,o,2,d-4,h,0,2),s.computeWorldVertices(t,o,0,2,h,d-4,2),h[d-2]=h[0],h[d-1]=h[1]):(f--,d-=4,h=je.setArraySize(this.world,d),s.computeWorldVertices(t,o,2,d,h,0,2));const m=je.setArraySize(this.curves,f);let g=0,v=h[0],x=h[1],y=0,M=0,_=0,w=0,b=0,C=0,R=0,F=0,I=0,k=0,B=0,D=0,$=0,N=0;for(let O=0,L=2;Og){this.addAfterPosition(q-g,h,d-4,l,L);continue}for(;;U++){const ie=m[U];if(!(q>ie)){if(U===0)q/=ie;else{const re=m[U-1];q=(q-re)/(ie-re)}break}}if(U!==p){p=U;let ie=U*6;for(v=h[ie],x=h[ie+1],y=h[ie+2],M=h[ie+3],_=h[ie+4],w=h[ie+5],b=h[ie+6],C=h[ie+7],R=(v-y*2+_)*.03,F=(x-M*2+w)*.03,I=((y-_)*3-v+b)*.006,k=((M-w)*3-x+C)*.006,B=R*2+I,D=F*2+k,$=(y-v)*.3+R+I*.16666667,N=(M-x)*.3+F+k*.16666667,P=Math.sqrt($*$+N*N),A[0]=P,ie=1;ie<8;ie++)$+=B,N+=D,B+=I,D+=k,P+=Math.sqrt($*$+N*N),A[ie]=P;$+=B,N+=D,P+=Math.sqrt($*$+N*N),A[8]=P,$+=B+I,N+=D+k,P+=Math.sqrt($*$+N*N),A[9]=P,V=0}for(q*=P;;V++){const ie=A[V];if(!(q>ie)){if(V===0)q/=ie;else{const re=A[V-1];q=V+(q-re)/(ie-re)}break}}this.addCurvePosition(q*.1,v,x,y,M,_,w,b,C,l,L,r||O>0&&H===0)}return l}addBeforePosition(t,s,n,r,o){const a=s[n],c=s[n+1],l=s[n+2]-a,h=s[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,s,n,r,o){const a=s[n+2],c=s[n+3],l=a-s[n],h=c-s[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,s,n,r,o,a,c,l,h,u,d,f){if(t===0||Number.isNaN(t)){u[d]=s,u[d+1]=n,u[d+2]=Math.atan2(o-n,r-s);return}const p=t*t,m=p*t,g=1-t,v=g*g,x=v*g,y=g*t,M=y*3,_=g*M,w=M*t,b=s*x+r*_+a*w+l*m,C=n*x+o*_+c*w+h*m;u[d]=b,u[d+1]=C,f&&(t<.001?u[d+2]=Math.atan2(o-n,r-s):u[d+2]=Math.atan2(C-(n*v+o*y*2+c*p),b-(s*v+r*y*2+a*p)))}sort(t){const s=this.slot.data.index,n=this.slot.bone;t.skin!=null&&this.sortPathSlot(t,t.skin,s,n),t.data.defaultSkin!=null&&t.data.defaultSkin!==t.skin&&this.sortPathSlot(t,t.data.defaultSkin,s,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(s!==Wr.none){switch(h.modifyWorld(t),s){case Wr.reset:this.reset(t);case Wr.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,M=t.data.referenceScale,_=-1,w=0,b=0,C=this.data.limit*p,R=C*Math.abs(t.scaleY);if(C*=Math.abs(t.scaleX),o||a){if(o){const F=(this.ux-g)*y;this.xOffset+=F>C?C:F<-C?-C:F,this.ux=g}if(a){const F=(this.uy-v)*y;this.yOffset+=F>R?R:F<-R?-R:F,this.uy=v}if(x>=d){const F=this.xOffset,I=this.yOffset;_=n.damping**(60*d),w=d*n.massInverse,b=n.strength;const k=M*n.wind,B=M*n.gravity,D=(k*t.windX+B*t.gravityX)*t.scaleX,$=(k*t.windY+B*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=(D-this.xOffset*b)*w,this.xOffset+=this.xVelocity*d,this.xVelocity*=_),a&&(this.yVelocity-=($+this.yOffset*b)*w,this.yOffset+=this.yVelocity*d,this.yVelocity*=_),x-=d;while(x>=d);this.xLag=this.xOffset-F,this.yLag=this.yOffset-I}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),I=0,k=0,B=0,D=this.cx-h.worldX,$=this.cy-h.worldY;if(D>C?D=C:D<-C&&(D=-C),$>R?$=R:$<-R&&($=-R),x=this.remaining,c){B=(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)*B;this.rotateOffset+=(N-Math.ceil(N*Ce.invPI2-.5)*Ce.PI2)*y,N=(this.rotateOffset-f)*B+F,I=Math.cos(N),k=Math.sin(N),l&&(N=u*h.getWorldScaleX(),N>0&&(this.scaleOffset+=(D*I+$*k)*y/N))}else{I=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*I+$*k)*y/N)}if(x>=d){_===-1&&(_=n.damping**(60*d),w=d*n.massInverse,b=n.strength);const N=n.wind*t.windX+n.gravity*t.gravityX,X=(n.wind*t.windY+n.gravity*t.gravityY)*Cm.yDir,A=this.rotateOffset,P=this.scaleOffset,O=u/M;for(;;)if(x-=d,l&&(this.scaleVelocity+=(N*I-X*k-this.scaleOffset*b)*w,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=_),c){if(this.rotateVelocity-=((N*k+X*I)*O+this.rotateOffset*b)*w,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=_,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 Xs.Uniform:h.b*=p,h.d*=p;break;case Xs.Volume:p=Math.abs(p),p=p>=.7?1/p:4-3.67347*p,h.b*=p,h.d*=p}}s!==Wr.pose&&(this.tx=u*h.a,this.ty=u*h.c)}}sort(t){const s=this.bone.bone;t.sortBone(s),t._updateCache.push(this),t.sortReset(s.children),t.constrained(s)}isSourceActive(){return this.bone.bone.active}}class Nc extends kl{constructor(t){super(t,new Tm);S(this,"_bone",null);S(this,"x",0);S(this,"y",0);S(this,"rotate",0);S(this,"scaleX",0);S(this,"shearX",0);S(this,"limit",0);S(this,"step",0);S(this,"inertiaGlobal",!1);S(this,"strengthGlobal",!1);S(this,"dampingGlobal",!1);S(this,"massGlobal",!1);S(this,"windGlobal",!1);S(this,"gravityGlobal",!1);S(this,"mixGlobal",!1);S(this,"_scaleYMode",Xs.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 gu(this,t)}}typeof Math.fround>"u"&&(Math.fround=(i=>e=>(i[0]=e,i[0]))(new Float32Array(1)));class Am{constructor(){S(this,"time",0);S(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const sl=class sl extends Pl{constructor(t,s){super(t,new Am,new Am);S(this,"bone",null);if(!s)throw new Error("skeleton cannot be null.");t.bone!=null&&(this.bone=s.bones[t.bone.index])}copy(t){var s=new sl(this.data,t);return s.pose.set(this.pose),s}update(t,s){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,sl.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]=s}addSkin(e){for(let s=0;s= 0.");if(!n)throw new Error("boneData cannot be null.");this.index=t,this.boneData=n}}var Ih;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(Ih||(Ih={}));class Rm{constructor(){S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0);S(this,"mixScaleX",0);S(this,"mixScaleY",0);S(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 Pp extends Pl{constructor(t,s){super(t,new Rm,new Rm);S(this,"bones");S(this,"source");if(!s)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of t.bones)this.bones.push(s.bones[r.index].constrainedPose);const n=s.bones[t.source.index];if(n==null)throw new Error("source cannot be null.");this.source=n}copy(t){var s=new Pp(this.data,t);return s.pose.set(this.pose),s}update(t,s){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[St.ROTATION]:-n[St.ROTATION]);return a<0&&(a+=360),a}}class xS extends pa{mix(e){return e.mixRotate}apply(e,t,s,n,r,o){if(r)s.rotation+=(o?n:n-s.rotation)*t.mixRotate;else{const a=e.scaleX,c=e.scaleY,l=1/a,h=1/c,u=s.a*l,d=s.b*l,f=s.c*h,p=s.d*h;n*=Ce.degRad,o||(n-=Math.atan2(f,u)),n>Ce.PI?n-=Ce.PI2:n<-Ce.PI&&(n+=Ce.PI2),n*=t.mixRotate;const m=Math.cos(n),g=Math.sin(n);s.a=(m*u-g*f)*a,s.b=(m*d-g*p)*a,s.c=(g*u+m*f)*c,s.d=(g*d+m*p)*c}}}class km extends ma{value(e,t,s,n){return s?t.x+n[St.X]:(n[St.X]*t.a+n[St.Y]*t.b+t.worldX)/e.scaleX}}class bS extends pa{mix(e){return e.mixX}apply(e,t,s,n,r,o){r?s.x+=(o?n:n-s.x)*t.mixX:(o||(n-=s.worldX/e.scaleX),s.worldX+=n*t.mixX*e.scaleX)}}class Fm extends ma{value(e,t,s,n){return s?t.y+n[St.Y]:(n[St.X]*t.c+n[St.Y]*t.d+t.worldY)/e.scaleY}}class wS extends pa{mix(e){return e.mixY}apply(e,t,s,n,r,o){r?s.y+=(o?n:n-s.y)*t.mixY:(o||(n-=s.worldY/e.scaleY),s.worldY+=n*t.mixY*e.scaleY)}}class Om extends ma{value(e,t,s,n){if(s)return t.scaleX+n[St.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+n[St.SCALEX]}}class SS extends pa{mix(e){return e.mixScaleX}apply(e,t,s,n,r,o){if(r)o?s.scaleX*=1+(n-1)*t.mixScaleX:s.scaleX!==0&&(s.scaleX+=(n-s.scaleX)*t.mixScaleX);else if(o){const a=1+(n-1)*t.mixScaleX;s.a*=a,s.c*=a}else{let a=s.a/e.scaleX,c=s.c/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(n-l)*t.mixScaleX/l,s.a*=l,s.c*=l)}}}class Lm extends ma{value(e,t,s,n){if(s)return t.scaleY+n[St.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+n[St.SCALEY]}}class MS extends pa{mix(e){return e.mixScaleY}apply(e,t,s,n,r,o){if(r)o?s.scaleY*=1+(n-1)*t.mixScaleY:s.scaleY!==0&&(s.scaleY+=(n-s.scaleY)*t.mixScaleY);else if(o){const a=1+(n-1)*t.mixScaleY;s.b*=a,s.d*=a}else{let a=s.b/e.scaleX,c=s.d/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(n-l)*t.mixScaleY/l,s.b*=l,s.d*=l)}}}class Bm extends ma{value(e,t,s,n){if(s)return t.shearY+n[St.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))*Ce.radDeg-90+n[St.SHEARY]}}class TS extends pa{mix(e){return e.mixShearY}apply(e,t,s,n,r,o){if(r)o||(n-=s.shearY),s.shearY+=n*t.mixShearY;else{const a=e.scaleX,c=e.scaleY,l=s.b/a,h=s.d/c,u=Math.atan2(h,l);n=(n+90)*Ce.degRad,o?n-=Ce.PI/2:(n-=u-Math.atan2(s.c/c,s.a/a),n>Ce.PI?n-=Ce.PI2:n<-Ce.PI&&(n+=Ce.PI2)),n=u+n*t.mixShearY;const d=Math.sqrt(l*l+h*h);s.b=Math.cos(n)*d*a,s.d=Math.sin(n)*d*c}}}class m6{constructor(e){S(this,"scale",1);S(this,"attachmentLoader");S(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,s=new vS;s.name="";const n=new z3(e),r=n.readInt32(),o=n.readInt32();s.hash=o===0&&r===0?null:o.toString(16)+r.toString(16),s.version=n.readString(),s.x=n.readFloat(),s.y=n.readFloat(),s.width=n.readFloat(),s.height=n.readFloat(),s.referenceScale=n.readFloat()*t;const a=n.readBoolean();a&&(s.fps=n.readFloat(),s.imagesPath=n.readString(),s.audioPath=n.readString());let c=0;c=n.readInt(!0);for(let p=0;p>5;for(let M=0,_;M>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===ln.Fixed&&(y.position*=t),y.spacing=n.readFloat(),(v.spacingMode===ds.Length||v.spacingMode===ds.Fixed)&&(y.spacing*=t),y.mixRotate=n.readFloat(),y.mixX=n.readFloat(),y.mixY=n.readFloat(),h.push(v);break}case yO:{const v=new Nc(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 M=n.readFloat();M<-2?(v.scaleYMode=Xs.Volume,M=-2-M):M<0&&(v.scaleYMode=Xs.Uniform,M=-1-M),v.scaleX=M}(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 xO:{const v=new qr(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 M=1;switch(n.readByte()){case 0:v.property=new Pm;break;case 1:{M=t,v.property=new km;break}case 2:{M=t,v.property=new Fm;break}case 3:v.property=new Om;break;case 4:v.property=new Lm;break;case 5:v.property=new Bm;break;default:continue}v.property.offset=y*M,v.offset=n.readFloat(),v.scale=n.readFloat()/M}h.push(v);break}}}const d=this.readSkin(n,s,!0,a);d&&(s.defaultSkin=d,s.skins.push(d));{let p=s.skins.length;for(je.setArraySize(s.skins,c=p+n.readInt(!0));p0){x=[];for(let b=0;b>4,e.readFloat())}r.push(F);break}}}}}const a=s.slots.length,c=e.readInt(!0);if(c>0){const f=new xr(c);for(let p=0;p0){const f=new yl(h);for(let p=0;p>>1^-(s&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 s=0;s>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),s+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:t+=String.fromCharCode(n),s++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!==0}}let q3=class{constructor(e,t,s,n,r,o){S(this,"source");S(this,"skinIndex");S(this,"slotIndex");S(this,"sourceIndex");S(this,"mesh");S(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.sourceIndex=n,this.source=r,this.inheritTimelines=o}};class hy{constructor(e=null,t,s=0){S(this,"bones");S(this,"vertices");S(this,"length");this.bones=e,this.vertices=t,this.length=s}}var wn;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(wn||(wn={}));function ss(i,e,t,s){t instanceof kn?K3(i,e,t,s):Z3(i,e,t,s)}function K3(i,e,t,s){let n=i.readFloat(),r=i.readFloat()*s;for(let o=0,a=0,c=t.getFrameCount()-1;t.setFrame(o,n,r),o!==c;o++){const l=i.readFloat(),h=i.readFloat()*s;switch(i.readByte()){case Hi:t.setStepped(o);break;case Wi:dt(i,t,a++,o,0,n,l,r,h,s)}n=l,r=h}e.push(t)}function Z3(i,e,t,s){let n=i.readFloat(),r=i.readFloat()*s,o=i.readFloat()*s;for(let a=0,c=0,l=t.getFrameCount()-1;t.setFrame(a,n,r,o),a!==l;a++){const h=i.readFloat(),u=i.readFloat()*s,d=i.readFloat()*s;switch(i.readByte()){case Hi:t.setStepped(a);break;case Wi:dt(i,t,c++,a,0,n,h,r,u,s),dt(i,t,c++,a,1,n,h,o,d,s)}n=h,r=u,o=d}e.push(t)}function uy(i,e){const t=i.readInt(!0);if(t===0)return null;const s=new Array(e).fill(-1),n=new Array(e-t);let r=0,o=0;for(let a=0;a=0;a--)s[a]===-1&&(s[a]=n[--o]);return s}function dt(i,e,t,s,n,r,o,a,c,l){e.setBezier(t,s,n,r,a,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,o,c)}const J3=0,Q3=1,eO=2,tO=3,sO=4,iO=5,nO=6,rO=7,oO=8,aO=9,lO=10,cO=0,hO=1,uO=2,dO=3,fO=4,mO=5,pO=0,gO=1,vO=2,yO=3,xO=4,bO=0,wO=1,SO=0,MO=1,TO=2,_O=0,CO=1,AO=2,EO=4,IO=5,RO=6,PO=7,kO=8,FO=0,OO=1,Hi=1,Wi=2;class LO{constructor(e){S(this,"attachmentLoader");S(this,"scale",1);S(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,s=new vS,n=typeof e=="string"?JSON.parse(e):e,r=n.skeleton;if(r&&(s.hash=r.hash,s.version=r.spine,s.x=r.x,s.y=r.y,s.width=r.width,s.height=r.height,s.referenceScale=Q(r,"referenceScale",100)*t,s.fps=r.fps,s.imagesPath=r.images??null,s.audioPath=r.audio??null),n.bones)for(let o=0;o0&&l.properties.push(w)}l.offsets[St.ROTATION]=Q(o,"rotation",0),l.offsets[St.X]=Q(o,"x",0)*t,l.offsets[St.Y]=Q(o,"y",0)*t,l.offsets[St.SCALEX]=Q(o,"scaleX",0),l.offsets[St.SCALEY]=Q(o,"scaleY",0),l.offsets[St.SHEARY]=Q(o,"shearY",0);const y=l.setupPose;d&&(y.mixRotate=Q(o,"mixRotate",1)),f&&(y.mixX=Q(o,"mixX",1)),p&&(y.mixY=Q(o,"mixY",y.mixX)),m&&(y.mixScaleX=Q(o,"mixScaleX",1)),g&&(y.mixScaleY=Q(o,"mixScaleY",y.mixScaleX)),v&&(y.mixShearY=Q(o,"mixShearY",1)),s.constraints.push(l);break}case"path":{const l=new Bc(a);l.skinRequired=c;for(let f=0;f0){const d=s.findConstraint(l,Nc);if(!d)throw new Error(`Physics constraint not found: ${l}`);u=s.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 Eh(m,u);for(let y=0;p!=null;p=f[y+1],y++)x.setFrame(y,Q(p,"time",0));r.push(x);continue}switch(d){case"inertia":g=new rS(m,m,u);break;case"strength":g=new oS(m,m,u);break;case"damping":g=new aS(m,m,u);break;case"mass":g=new lS(m,m,u);break;case"wind":g=new cS(m,m,u);break;case"gravity":g=new hS(m,m,u);break;case"mix":{v=1,g=new uS(m,m,u);break}default:continue}Ks(r,f,g,v,1)}}if(e.slider)for(const l in e.slider){const h=e.slider[l],u=s.findConstraint(l,qr);if(!u)throw new Error(`Slider not found: ${l}`);const d=s.constraints.indexOf(u);for(const f in h){const p=h[f];if(!p[0])continue;const g=p.length;switch(f){case"time":Ks(r,p,new dS(g,g,d),1,1);break;case"mix":Ks(r,p,new fS(g,g,d),1,1);break}}}if(e.attachments)for(const l in e.attachments){const h=e.attachments[l],u=s.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const d in h){const f=h[d],p=s.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 M=v[y];let _=M[0];if(_){if(y==="deform"){const w=x.bones,b=x.vertices,C=w?b.length/3*2:b.length,R=new Qw(M.length,M.length,m,x);let F=Q(_,"time",0);for(let I=0,k=0;;I++){let B;const D=Q(_,"vertices",null);if(!D)B=w?je.newFloatArray(C):b;else{B=je.newFloatArray(C);const A=Q(_,"offset",0);if(je.arrayCopy(D,0,B,A,D.length),n!==1)for(let P=A,O=P+D.length;P=0;l--)r[l]===-1&&(r[l]=o[--c]);return r}function pt(i,e,t,s,n,r,o,a,c,l){if(i==="stepped")return e.setStepped(s),t;const h=n<<2,u=i[h],d=i[h+1]*l,f=i[h+2],p=i[h+3]*l;return e.setBezier(t,s,n,r,a,u,d,f,p,o,c),t+1}function Q(i,e,t){return i[e]!==void 0?i[e]:t}class NO{newRegionAttachment(e,t,s,n){return new hu(t,s)}newMeshAttachment(e,t,s,n){return new Il(t,s)}newBoundingBoxAttachment(e,t){return new Z1(t)}newPathAttachment(e,t){return new vl(t)}newPointAttachment(e,t){return new iw(t)}newClippingAttachment(e,t){return new Qo(t)}}class DO{sequence(e){for(let t=0;t!Number.isInteger(h)||h<0||h>=o))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const a=Number(i.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(i.edges)&&i.edges.some(h=>!Number.isInteger(h)||h<0||h>=o*2||h%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===s.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 XO(i,e){var r,o,a,c;const t=Array.isArray(i.bones)?i.bones:[],s=new Map(t.map(l=>[String(l.name||""),l])),n=new Set;for(const l of t){if(l.inherit!=null&&!UO.has(l.inherit))throw new Error(`骨骼“${l.name||""}”的 inherit 值“${l.inherit}”不符合 Spine ${e} JSON 格式`);if(/_trail_\d+_\d+$/.test(String(l.name||""))){const h=s.get(String(l.parent||""));if(!h||/_trail_\d+_\d+$/.test(String(h.name||"")))throw new Error(`拖尾骨骼“${l.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const l of Array.isArray(i.skins)?i.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"&&($O(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(i.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 VO(i){var e;if(String(((e=i==null?void 0:i.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error("Spine 3.8 导出的版本标识必须为 3.8");for(const t of i.bones||[])if(t.inherit!=null)throw new Error(`Spine 3.8 骨骼“${t.name||""}”应使用 transform,不能使用 inherit`);for(const t of Object.values(i.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 s=[t];for(;s.length;){const n=s.pop();if(!(!n||typeof n!="object")){if(!Array.isArray(n)&&Array.isArray(n.curve))throw new Error("Spine 3.8 不支持 4.x 数组曲线格式");s.push(...Object.values(n))}}}}function fy(i,e){var o;const t=JSON.parse(i),s=dh((o=t==null?void 0:t.skeleton)==null?void 0:o.spine);if(!s)throw new Error(`导出版本不受支持,仅支持 Spine ${lm()}`);if(e&&s!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${s}`);XO(t,s),s==="3.8"&&VO(t);const n=s==="3.8"?gw(JSON.parse(JSON.stringify(t))):t,r=s==="4.3"?new LO(new DO).readSkeletonData(n):new yh(new NO).readSkeletonData(n);if(!r.bones.length)throw new Error("导出结果缺少骨骼");return{version:s,bones:r.bones.length,slots:r.slots.length,animations:r.animations.length}}const _S="http://127.0.0.1:27843";class Rh extends Error{constructor(t,s="CONNECTOR_ERROR",n){super(t);S(this,"code");S(this,"pairUrl");this.name="SpineConnectorError",this.code=s,this.pairUrl=n}}function Nm(i,e){return String(i||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function YO(i,e){const t=/\.([a-z0-9]{2,5})$/i.exec(i);return t?`.${t[1].toLowerCase()}`:e.includes("jpeg")?".jpg":e.includes("webp")?".webp":e.includes("gif")?".gif":".png"}function GO(i,e,t){const s=String(i||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>Nm(r,"images")),n=Nm(e.replace(/\.[^./\\]+$/,""),"image");return[...s,`${n}${YO(e,t)}`].join("/")}async function uf(i,e,t){if(!i)return null;const s=await fetch(i);if(!s.ok)throw new Error(`无法读取导出图片:${t}`);const n=await s.blob(),r=new Uint8Array(await n.arrayBuffer());let o="";const a=32768;for(let c=0;co.finally(()=>{s++,e==null||e(s,t.length)});for(const o of i.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(uf(c.previewUrl,a.textureFolder,c.name||a.textureName)));else t.push(n(uf(a.previewUrl,a.textureFolder,a.textureName)));if(o.config.trail)for(const a of o.config.trailResources)t.push(n(uf(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 jO(){try{const i=await fetch(`${_S}/v1/health`,{cache:"no-store"});if(!i.ok)throw new Error(`HTTP ${i.status}`);return{available:!0,...await i.json()}}catch(i){return{available:!1,authorized:!1,error:i instanceof Error?i.message:String(i)}}}async function HO(i,e){const t=await CS(i.systems,(n,r)=>{e==null||e({phase:"images",progress:r?n/r:1})}),s=JSON.stringify({schemaVersion:1,projectName:i.projectName,spineVersion:i.spineVersion,skeletonJson:i.skeletonJson,images:t});return new Promise((n,r)=>{const o=new XMLHttpRequest;o.open("POST",`${_S}/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 Rh("未检测到本地 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 Rh(h.message||`Spine 连接器返回错误:HTTP ${o.status}`,h.code,h.pairUrl));return}const c=o.getResponseHeader("X-Spine-File-Name");let l=`${Nm(i.projectName,"SpineParticle")}.zip`;if(c)try{l=decodeURIComponent(c)}catch{}n({blob:a,fileName:l,spineEditorVersion:o.getResponseHeader("X-Spine-Editor-Version")||i.spineVersion,imageCount:t.length})},o.send(s)})}function WO(i,e){const t=URL.createObjectURL(i),s=document.createElement("a");s.href=t,s.download=/\.zip$/i.test(e)?e:`${e}.zip`,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}const zO=Array.from({length:256},(i,e)=>{let t=e;for(let s=0;s<8;s++)t=t&1?3988292384^t>>>1:t>>>1;return t>>>0});function qO(i){let e=4294967295;for(const t of i)e=zO[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function KO(i){const e=String(i||"").replace(/\\/g,"/").split("/").filter(t=>t&&t!==".");if(!e.length||e.some(t=>t===".."))throw new Error("ZIP 文件路径无效");return e.join("/")}function ZO(i=new Date){const e=Math.max(1980,i.getFullYear());return{time:i.getHours()<<11|i.getMinutes()<<5|Math.floor(i.getSeconds()/2),date:e-1980<<9|i.getMonth()+1<<5|i.getDate()}}function df(i){const e=new Uint8Array(i);return{bytes:e,view:new DataView(e.buffer)}}function my(i){const e=new Uint8Array(i.reduce((s,n)=>s+n.length,0));let t=0;for(const s of i)e.set(s,t),t+=s.length;return e}function JO(i){const e=new TextEncoder,t=[],s=[],n=ZO();let r=0;for(const c of i){const l=e.encode(KO(c.name)),h=qO(c.data),u=df(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=df(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),s.push(d.bytes,l),r+=u.bytes.length+l.length+c.data.length}const o=my(s),a=df(22);return a.view.setUint32(0,101010256,!0),a.view.setUint16(8,i.length,!0),a.view.setUint16(10,i.length,!0),a.view.setUint32(12,o.length,!0),a.view.setUint32(16,r,!0),new Blob([my([...t,o,a.bytes])],{type:"application/zip"})}function QO(i){const e=atob(i),t=new Uint8Array(e.length);for(let s=0;ss===".."||/^[a-z]+:/i.test(s))?"images":t.join("/")}function tL(i){return String(i||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function sL(i){const e=await CS(i.systems);if(!e.length)throw new Error("当前可见粒子系统没有可导出的图片");const t=eL(i.imagesPath);return{blob:JO(e.map(n=>({name:`${t}/${n.path}`,data:QO(n.dataBase64)}))),imageCount:e.length,folder:t}}function iL(i,e){const t=`${tL(e)}-images.zip`,s=URL.createObjectURL(i),n=document.createElement("a");return n.href=s,n.download=t,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3),t}function nL(i){i.settings.exportSettings=d1(i.settings.exportSettings);const e=Ye(()=>i.settings.exportSettings),t=$e(!1),s=$e(null),n=$e(""),r=$e(!1),o=$e(null),a=$e(""),c=$e(""),l=Ye(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"连接器可用 · Spine 已就绪":"连接器已启动,当前网站尚未授权":"连接器已启动,但未找到 Spine":"本地 Spine 连接器未启动":"正在检测本地 Spine 连接器…"}),h=Ye(()=>{var b,C,R,F,I,k;return{ready:!!((b=o.value)!=null&&b.available)&&!!((C=o.value)!=null&&C.spineFound)&&!!((R=o.value)!=null&&R.authorized),warning:!!((F=o.value)!=null&&F.available)&&(!((I=o.value)!=null&&I.spineFound)||!((k=o.value)!=null&&k.authorized))}}),u=Ye(()=>{var b,C,R;return!!((b=o.value)!=null&&b.available)&&!!((C=o.value)!=null&&C.spineFound)&&!!((R=o.value)!=null&&R.authorized)}),d=Ye(()=>{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=Ye(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"":"未授权":"未找到 Spine":"未启动":"检测中"}),p=Ye(()=>t.value?"正在重新计算并生成 Spine 工程":f.value?`暂不可用:${f.value}`:`调用本机 Spine 自动生成 ${e.value.spineVersion} 工程`);Wn(()=>{v(),m=window.setInterval(v,3e3)});let m,g=0;Sl(()=>{m!==void 0&&window.clearInterval(m)});async function v(){const b=++g,C=await jO();if(b!==g)return;o.value=C;const R=c.value;(R==="CONNECTOR_OFFLINE"?C.available:R==="SPINE_NOT_FOUND"?C.available&&C.spineFound:R==="ORIGIN_NOT_ALLOWED"?C.available&&C.spineFound&&C.authorized:!!R&&C.available&&C.spineFound&&C.authorized)&&(c.value="",a.value="",r.value&&(r.value=!1,n.value=""))}function x(){return new Promise(b=>requestAnimationFrame(()=>b()))}async function y(b){i.timeline.playing=!1,i.timeline.frame=0,i.timeline.recorded=!1;for(const F of i.systems)F.frames=void 0;i.recalcTotalFrames(),await x(),i.timeline.playing=!0;const C=i.timeline.totalFrames/Math.max(1,i.timeline.fps)*1e3,R=performance.now()+Math.max(8e3,C*2.5+3e3);for(;!i.timeline.recorded;){if(performance.now()>R)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");b==null||b(Math.min(.98,i.timeline.frame/Math.max(1,i.timeline.totalFrames-1))),await new Promise(F=>setTimeout(F,50))}b==null||b(1)}async function M(){if(!t.value){t.value=!0,s.value="json",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";try{await y();const b=ty({systems:i.systems,timeline:i.timeline,settings:e.value});fy(b.text,e.value.spineVersion),O3(b,e.value.fileName);const C=b.warnings.length?`;${b.warnings.length} 条资源提示(缺图仍已导出)`:"";n.value=`已导出 Spine ${e.value.spineVersion}:${b.particleSystemCount} 个粒子系统、${b.animationCount} 个动画、${b.boneCount} 根骨骼${C}`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,s.value=null}}}async function _(){if(t.value)return;t.value=!0,s.value="spine",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";const b=Rw("导出 Spine 包","正在重新计算粒子动画…");try{await b.paint(),await y(I=>b.update(I*18,"正在重新计算粒子动画…")),b.update(20,"正在生成 Spine JSON…");const C=ty({systems:i.systems,timeline:i.timeline,settings:e.value});fy(C.text,e.value.spineVersion),n.value="正在整理图片并调用本机 Spine…";const R=e.value.fileName.replace(/\.json$/i,"")||"SpineParticle",F=await HO({projectName:R,spineVersion:e.value.spineVersion,skeletonJson:C.text,systems:i.systems},({phase:I,progress:k})=>{I==="images"?b.update(k==null?null:22+k*18,"正在整理工程图片…"):I==="upload"?b.update(k==null?null:40+k*30,"正在上传数据到 Spine 连接器…"):I==="processing"?b.update(null,"Spine 正在转换工程,请稍候…"):b.update(k==null?null:82+k*16,"正在下载生成的 Spine 工程包…")});b.update(99,"正在交给浏览器下载…"),WO(F.blob,F.fileName),n.value=`已生成 ${F.fileName}:包含 .spine 工程和 ${F.imageCount} 张图片,Spine ${F.spineEditorVersion}`,await v(),await b.finish("Spine 工程包已开始下载")}catch(C){const R=C instanceof Error?C.message:String(C);r.value=!0,c.value=C instanceof Rh?C.code:"",C instanceof Rh&&C.pairUrl&&(a.value=C.pairUrl),n.value=R,await v(),await b.fail(R)}finally{t.value=!1,s.value=null}}async function w(){if(!t.value){t.value=!0,s.value="images",r.value=!1,c.value="",a.value="",n.value="正在整理当前粒子系统使用的图片…";try{const b=await sL({systems:i.systems,imagesPath:e.value.imagesPath}),C=iL(b.blob,e.value.fileName);n.value=`已生成 ${C}:${b.folder}/ 内包含 ${b.imageCount} 张图片`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,s.value=null}}}return{exportSettings:e,exportBusy:t,exportTarget:s,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:M,exportSpineProject:_,exportSpineImages:w}}function rL(i){const e=$e(null),t=$e(""),s=$e([]),n=$e(!1),r=$e(""),o=$e(!1);function a(){Sw(i),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 xk(i,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();s.value=Array.isArray(d)?d.filter(f=>!!f&&typeof f.name=="string"&&typeof f.file=="string"):[]}catch{s.value=[]}}async function h(){const u=t.value;if(!u)return;n.value=!0,o.value=!1,r.value="正在加载预设…";const d=Rw("加载预设",`正在下载 ${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 r3(f,m=>{d.update(m==null?null:m*55,`正在下载 ${u}…`)});d.update(58,"正在解析预设配置…"),d.update(70,"正在解析并恢复预设资源…"),await Tw(i,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 Wn(l),{configFileInput:e,selectedPreset:t,presetOptions:s,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h}}function oL(i){const e=$e(null),t=$e(null),s=$e(null),n=$e(null),r=$e(null);function o(){var L;const P=(L=i.value)==null?void 0:L.config;if(!P)return;const O=Math.max(0,...P.trailResources.map(U=>U.id))+1;P.trailResources.push({id:O,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:vm.map(U=>({...U})),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:pm.map(U=>({...U})),shapeEnabled:!1,shapeCurve:ym.map(U=>({...U}))}),p()}function a(P){var O;r.value=P,(O=n.value)==null||O.click()}function c(P,O){var V;const L=(V=i.value)==null?void 0:V.config;if(!L)return;const U=P==="trailGridCols"?32:16;L[P]=Math.min(U,Math.max(2,Math.round(Number(O)||2)))}function l(P,O){var U;const L=(U=i.value)==null?void 0:U.config.trailResources.find(V=>V.id===P);L&&(L.boneCount=Math.min(16,Math.max(2,Math.round(Number(O)||2))))}function h(P,O){var U;const L=(U=i.value)==null?void 0:U.config.trailResources.find(V=>V.id===P);L&&(L.rotation=Math.max(-360,Math.min(360,Number(O)||0)))}async function u(P){var q,ie;const O=P.target,L=(q=O.files)==null?void 0:q[0],U=(ie=i.value)==null?void 0:ie.config,V=U==null?void 0:U.trailResources.find(re=>re.id===r.value);if(!L||!V){O.value="";return}const H=await C(L);V.texture=hr(await ze.fromURL(H)),V.previewUrl=H,V.textureName=L.name.replace(/\.[^.]+$/,"")||"trail",O.value="",r.value=null}async function d(P){var U;const O=(U=i.value)==null?void 0:U.config,L=O==null?void 0:O.trailResources.find(V=>V.id===P);L&&(L.texture=hr(await ze.fromURL("/images/trail.png")),L.previewUrl="/images/trail.png",L.textureName="trail",L.weight=100,L.locked=!1,L.rotation=0,L.boneCount=3,L.trailRatio=100,L.lengthMode="fixed",L.length=100,L.lengthMin=100,L.lengthMax=100,L.widthSizeMode="fixed",L.width=100,L.widthMin=100,L.widthMax=100,L.widthMode="particle",L.lifeLengthEnabled=!1,L.lifeLengthCurve=pm.map(V=>({...V})),L.shapeEnabled=!1,L.shapeCurve=ym.map(V=>({...V})),L.colorMode="particle",L.color="#ffffff",L.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],L.blend="normal",L.alphaMode="particle",L.alpha=1,L.alphaCurve=vm.map(V=>({...V})),p())}function f(P){var U;const O=(U=i.value)==null?void 0:U.config.trailResources;if(!O||O.length<=1)return;const L=O.findIndex(V=>V.id===P);L>=0&&O.splice(L,1),p()}function p(){var V;const P=(V=i.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 O=P.filter(H=>H.locked),L=P.filter(H=>!H.locked);let U=O.reduce((H,q)=>H+Math.max(0,Number(q.weight)||0),0);U>100&&($(O,100,!0),U=100),$(L,100-U)}function m(P,O){var ie;const L=(ie=i.value)==null?void 0:ie.config.trailResources;if(!(L!=null&&L.length))return;if(L.length===1){L[0].weight=100,L[0].locked=!1;return}const U=L.find(re=>re.id===P);if(!U||U.locked)return;const V=L.filter(re=>re.id!==P&&re.locked).reduce((re,pe)=>re+Math.max(0,Number(pe.weight)||0),0),H=Math.max(0,100-V),q=L.filter(re=>re.id!==P&&!re.locked);U.weight=D(Math.min(H,Math.max(0,Number(O)||0))),q.length?$(q,H-U.weight,!0):U.weight=D(H)}function g(P){var U;const O=(U=i.value)==null?void 0:U.config.trailResources;if(!O||O.length===1)return;const L=O.find(V=>V.id===P);L&&(L.locked=!L.locked)}function v(P,O){const L=O.target;P.color=F(L.value,P.color),L.value=P.color}function x(P,O){v(P,O),O.target.blur()}function y(){var L;const P=(L=i.value)==null?void 0:L.config;if(!P)return;const O=Math.max(0,...P.imageResources.map(U=>U.id))+1;P.imageResources.push({id:O,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:gm.map(U=>({...U}))}),N()}function M(P){var O;s.value=P,(O=e.value)==null||O.click()}function _(P){var O;s.value=P,(O=t.value)==null||O.click()}async function w(P){var ie,re;const O=P.target,L=(ie=O.files)==null?void 0:ie[0],U=(re=i.value)==null?void 0:re.config,V=U==null?void 0:U.imageResources.find(pe=>pe.id===s.value);if(!L||!V){O.value="";return}const H=await C(L),q=hr(await ze.fromURL(H));V.texture=q,V.previewUrl=H,V.textureFolder="",V.textureName=L.name.replace(/\.[^.]+$/,"")||"particle",O.value="",s.value=null}async function b(P){var H;const O=P.target,L=Array.from(O.files||[]).sort((q,ie)=>q.name.localeCompare(ie.name,void 0,{numeric:!0,sensitivity:"base"})),U=(H=i.value)==null?void 0:H.config,V=U==null?void 0:U.imageResources.find(q=>q.id===s.value);if(!L.length||!V){O.value="";return}V.sequenceFrames=await Promise.all(L.map(async q=>{const ie=await C(q);return{name:q.name,previewUrl:ie,texture:hr(await ze.fromURL(ie))}})),V.imageMode="sequence",O.value="",s.value=null}function C(P){return new Promise((O,L)=>{const U=new FileReader;U.onload=()=>O(String(U.result||"")),U.onerror=()=>L(U.error),U.readAsDataURL(P)})}function R(P){var U;const O=(U=i.value)==null?void 0:U.config,L=O==null?void 0:O.imageResources.find(V=>V.id===P);!O||!L||(L.texture=O.texture,L.textureName="star",L.textureFolder="",L.previewUrl="/images/star.png",L.imageMode="fixed",L.sequencePlayback="loop-forward",L.sequenceFps=30,L.sequenceFrames=[],L.scale=1,L.anchorX=.5,L.anchorY=.5,L.colorMode="fixed",L.colorStart="#ffffff",L.colorEnd="#ff4d4d",L.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],L.blend="normal",L.independentAlpha="off",L.alpha=1,L.alphaCurveMode="跟随导出",L.alphaCurve=gm.map(V=>({...V})),L.locked=!1,N())}function F(P,O){let L=P.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(L)&&(L=L.split("").map(U=>U+U).join("")),/^[0-9a-f]{6}$/i.test(L)?`#${L.toLowerCase()}`:O}function I(P,O){const L=O.target;P.colorStart=F(L.value,P.colorStart),L.value=P.colorStart}function k(P,O){I(P,O),O.target.blur()}function B(P){var U;const O=(U=i.value)==null?void 0:U.config.imageResources;if(!O||O.length<=1)return;const L=O.findIndex(V=>V.id===P);L>=0&&O.splice(L,1),N()}function D(P){return Math.round(P)}function $(P,O,L=!1){if(!P.length)return;const U=Math.max(0,D(O)),V=L?P.reduce((q,ie)=>q+Math.max(0,Number(ie.weight)||0),0):0;let H=0;P.forEach((q,ie)=>{const re=ie===P.length-1,pe=D(re?U-H:V>0?U*Math.max(0,Number(q.weight)||0)/V:U/P.length);q.weight=pe,H+=pe})}function N(){var V;const P=(V=i.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 O=P.filter(H=>H.locked),L=P.filter(H=>!H.locked);let U=O.reduce((H,q)=>H+Math.max(0,Number(q.weight)||0),0);U>100&&($(O,100,!0),U=100),$(L,100-U)}function X(P,O){var ie;const L=(ie=i.value)==null?void 0:ie.config.imageResources;if(!(L!=null&&L.length))return;if(L.length===1){L[0].weight=100,L[0].locked=!1;return}const U=L.find(re=>re.id===P);if(!U||U.locked)return;const V=L.filter(re=>re.id!==P&&re.locked).reduce((re,pe)=>re+Math.max(0,Number(pe.weight)||0),0),H=Math.max(0,100-V),q=L.filter(re=>re.id!==P&&!re.locked);if(U.weight=D(Math.min(H,Math.max(0,Number(O)||0))),!q.length){U.weight=D(H);return}$(q,H-U.weight,!0)}function A(P){var U;const O=(U=i.value)==null?void 0:U.config.imageResources;if(!O||O.length===1)return;const L=O.find(V=>V.id===P);L&&(L.locked=!L.locked)}return{textureFileInput:e,sequenceFileInput:t,pendingResourceId:s,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:M,openSequencePicker:_,onTextureFile:w,onSequenceFiles:b,readFileAsDataUrl:C,resetTexture:R,normalizeHex:F,setResourceFixedColor:I,commitResourceFixedColor:k,removeImageResource:B,roundWeight:D,distributeImageWeights:$,rebalanceImageWeights:N,setResourceWeight:X,toggleResourceLock:A}}function aL(){const i=po(),{exportSettings:e,exportBusy:t,exportTarget:s,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}=nL(i),{configFileInput:v,selectedPreset:x,presetOptions:y,presetLoading:M,configMessage:_,configError:w,saveConfig:b,onConfigFileChange:C,refreshPresets:R,loadSelectedPreset:F}=rL(i);function I(Z){return Z==="跟随导出"?e.value.keyframeCurve==="bezier"?"bezier":"linear":Z==="贝塞尔"?"bezier":"linear"}i.systems.length||i.addSystem();const k=Ye(()=>{const Z=i.systems.findIndex(ae=>ae.id===i.activeId);return Z>=0?Z:0}),B=Ye(()=>i.systems[k.value]||null),{textureFileInput:D,sequenceFileInput:$,trailTextureFileInput:N,addTrailResource:X,openTrailTexturePicker:A,onTrailRigChange:P,onTrailResourceBoneCountChange:O,onTrailResourceRotationChange:L,onTrailTextureFile:U,resetTrailTexture:V,removeTrailResource:H,setTrailResourceWeight:q,toggleTrailResourceLock:ie,setTrailColor:re,commitTrailColor:pe,addImageResource:ge,openTexturePicker:he,openSequencePicker:fe,onTextureFile:Y,onSequenceFiles:W,resetTexture:j,setResourceFixedColor:G,commitResourceFixedColor:z,removeImageResource:se,setResourceWeight:ue,toggleResourceLock:ne}=oL(B),de=Ye(()=>B.value?f1(B.value.config,i.timeline.fps):30),le=Ye(()=>{var ae;const Z=(ae=B.value)==null?void 0:ae.config;return Z?Math.max(1,Math.ceil(Number(Z.loopDurationFrames)||1)):1}),Ie=Ye(()=>i.activeObjectType),ye=Ye(()=>i.activeObjectType==="collision"&&i.colliders.find(Z=>Z.id===i.activeObjectId)||null),me=Ye(()=>i.activeObjectType==="path"&&i.paths.find(Z=>Z.id===i.activeObjectId)||null),Ne=Ye(()=>i.activeObjectType==="spine"&&i.spines.find(Z=>Z.id===i.activeObjectId)||null),Ze=Ye(()=>i.activeObjectType==="particle"?i.systems.some(Z=>Z.id===i.activeObjectId):i.activeObjectType==="collision"?i.colliders.some(Z=>Z.id===i.activeObjectId):i.activeObjectType==="path"?i.paths.some(Z=>Z.id===i.activeObjectId):i.spines.some(Z=>Z.id===i.activeObjectId)),qe=Ye(()=>{const Z=i.spines.find(ae=>ae.selectedBone&&ae.bones.some(we=>we.name===ae.selectedBone));return Z?{spine:Z,boneName:Z.selectedBone}:null}),Ke=Ye(()=>{var we;const Z=(we=B.value)==null?void 0:we.config;if(!Z||Z.emitterFollowMode!=="bone")return null;const ae=i.spines.find(yt=>yt.id===Z.emitterFollowSpineId);return!ae||!ae.bones.some(yt=>yt.name===Z.emitterFollowBoneName)?null:{spine:ae,boneName:Z.emitterFollowBoneName}}),Le=$e(!1),Me=$e(""),nt=Ye(()=>i.spines.filter(Z=>Z.enabled&&Z.visible!==!1&&Z.status==="ready")),Te=Ye(()=>i.spines.find(Z=>{var ae;return Z.id===((ae=B.value)==null?void 0:ae.config.renderLayerSpineId)})||null),ps=Ye(()=>{const Z=Te.value;return!!Z&&Z.enabled&&Z.visible!==!1&&Z.status==="ready"}),_t=Ye(()=>{var Z;return[...((Z=Te.value)==null?void 0:Z.slots)||[]].sort((ae,we)=>ae.order-we.order)}),vt=Ye(()=>{const Z=Me.value.trim().toLocaleLowerCase();return Z?_t.value.filter(ae=>ae.name.toLocaleLowerCase().includes(Z)||ae.attachment.toLocaleLowerCase().includes(Z)):_t.value}),te=Ye(()=>_t.value.find(Z=>{var ae;return Z.name===((ae=B.value)==null?void 0:ae.config.renderLayerSlotName)})||null),oe=Ye(()=>{const Z=te.value;return Z&&_t.value.filter(ae=>ae.orderwe.order-ae.order)[0]||null}),lt=Ye(()=>{var yt;const Z=(yt=B.value)==null?void 0:yt.config,ae=Te.value,we=te.value;return!Z||!ae||!we?"":`${ae.name} / ${we.name} · 图片${Z.renderLayerSlotPosition==="below"?"之下":"之上"}`}),At=Ye(()=>{var we;const Z=(we=B.value)==null?void 0:we.config,ae=te.value;return!Z||!ae?"":Z.renderLayerSlotPosition==="above"?`渲染在 ${ae.name} 图片之上、其后插槽之下`:oe.value?`渲染在 ${oe.value.name} 与 ${ae.name} 之间`:""}),Et=Ye(()=>{var we;const Z=(we=B.value)==null?void 0:we.config;if(!Z||Z.renderLayerMode!=="slot")return"";if(!nt.value.length)return"没有已加载的 Spine,粒子临时显示在最上层。";if(!Z.renderLayerSpineId)return"尚未选择 Spine,粒子临时显示在最上层。";const ae=Te.value;return ae?!ae.enabled||ae.status!=="ready"?"目标 Spine 未就绪,粒子临时显示在最上层。":Z.renderLayerSlotName?te.value?Z.renderLayerSlotPosition==="below"&&!oe.value?"这是第一个插槽,无法显示在其下方,粒子临时显示在最上层。":"":"目标插槽不存在(资源可能已更换),粒子临时显示在最上层。":"":"目标 Spine 不存在,粒子临时显示在最上层。"});function tt(){var ae;const Z=(ae=B.value)==null?void 0:ae.config;Z&&(Z.renderLayerMode="slot",!Z.renderLayerSpineId&&nt.value.length&&(Z.renderLayerSpineId=nt.value[0].id),Le.value=!Z.renderLayerSlotName)}function ni(Z){var we;const ae=(we=B.value)==null?void 0:we.config;ae&&(ae.renderLayerSpineId=Math.max(0,Math.round(Number(Z.target.value)||0)),ae.renderLayerSlotName="",Le.value=!0)}function ns(Z){var we;const ae=(we=B.value)==null?void 0:we.config;ae&&(ae.renderLayerSlotName=Z.name,Le.value=!1,Me.value="")}function ts(){var ae;const Z=(ae=B.value)==null?void 0:ae.config;Z&&(Z.renderLayerSlotName="",Z.renderLayerSlotPosition="above")}const Mt=$e(!1),vi=Ye(()=>{var ae;const Z=new Set(((ae=B.value)==null?void 0:ae.config.collisionColliderIds)||[]);return i.colliders.filter(we=>Z.has(we.id))}),Cs=Ye(()=>{var ae;const Z=new Set(((ae=B.value)==null?void 0:ae.config.collisionColliderIds)||[]);return i.colliders.filter(we=>!Z.has(we.id))});Ls(()=>{var Z,ae;return[(Z=B.value)==null?void 0:Z.id,(ae=B.value)==null?void 0:ae.config.collision]},()=>{Mt.value=!1}),Ls(()=>{var Z;return(Z=B.value)==null?void 0:Z.id},()=>{Le.value=!1,Me.value=""});function rs(Z){var we;const ae=(we=B.value)==null?void 0:we.config;!ae||ae.collisionColliderIds.includes(Z)||(ae.collisionColliderIds.push(Z),Mt.value=!1)}function dn(Z){var we;const ae=(we=B.value)==null?void 0:we.config;ae&&(ae.collisionColliderIds=ae.collisionColliderIds.filter(yt=>yt!==Z))}Ro(()=>{for(const Z of i.systems)Z.visible==null&&(Z.visible=!0);for(const Z of i.colliders)Z.visible==null&&(Z.visible=!0);for(const Z of i.paths)Z.visible==null&&(Z.visible=!0);for(const Z of i.spines)Z.visible==null&&(Z.visible=!0)}),Ro(()=>{if(!B.value)return;const Z=Nn(B.value.config);Z.lifeMode==="curve"&&(Z.lifeMode="random"),Z.speedMode==="curve"&&(Z.speedMode="random"),Z.scaleMode==="curve"&&(Z.scaleMode="random"),Z.initialRotationMode==="curve"&&(Z.initialRotationMode="random"),Z.mode==="stream"&&!(Z.duration>0)&&(Z.duration=1),Z.streamBehavior==="loop"&&(Z.emitterFollow||Z.emitterFollowMode!=="none")&&Er(Z)}),Ro(()=>{const Z=new Set(i.colliders.map(ae=>ae.id));for(const ae of i.systems){const we=Nn(ae.config),yt=we.collisionColliderIds.filter(Ir=>Z.has(Ir));if(yt.length!==we.collisionColliderIds.length&&(we.collisionColliderIds=yt),we.spawnPathId>0&&!i.paths.some(Ir=>Ir.id===we.spawnPathId)&&(we.spawnPathId=0,(we.emissionAngleMode==="path-normal"||we.emissionAngleMode==="path-tangent")&&(we.emissionAngleMode="fixed")),we.emitterFollowMode!=="bone")continue;const Yt=i.spines.find(Ir=>Ir.id===we.emitterFollowSpineId);!!(Yt!=null&&Yt.bones.some(Ir=>Ir.name===we.emitterFollowBoneName))||(we.emitterFollowMode="none",we.emitterFollowSpineId=0,we.emitterFollowBoneName="")}}),Ro(()=>{for(const Z of i.systems){const ae=Nn(Z.config);ae.renderLayerMode!=="slot"||!ae.renderLayerSpineId||i.spines.some(we=>we.id===ae.renderLayerSpineId)||(ae.renderLayerSpineId=0,ae.renderLayerSlotName="")}}),Ro(()=>{for(const Z of i.colliders)Z.followPathId==null&&(Z.followPathId=0),Z.followDuration>0||(Z.followDuration=2),Z.followPathRotation==null&&(Z.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(Z.followCurveMode)||(Z.followCurveMode="跟随导出"),(!Array.isArray(Z.followCurve)||Z.followCurve.length<2)&&(Z.followCurve=[{x:0,y:0},{x:1,y:1}])});const ri=uo({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function Li(Z){ri[Z]=!ri[Z]}function Bi(Z){var we;const ae=(we=B.value)==null?void 0:we.config;ae&&(ae.mode=Z,Z==="stream"&&!(ae.duration>0)&&(ae.duration=1))}function Ar(Z){var yt;const ae=(yt=B.value)==null?void 0:yt.config;if(!ae)return;const we=Math.min(1800,Math.max(1,Math.ceil(Number(Z)||1)));ae.loopDurationFrames=we}function Er(Z){const ae=gl();Z.emitterFollow=!1,Z.emitterFollowMode="none",Z.emitterFollowPathId=ae.emitterFollowPathId,Z.emitterFollowSpineId=ae.emitterFollowSpineId,Z.emitterFollowBoneName=ae.emitterFollowBoneName,Z.emitterFollowBoneOffsetX=ae.emitterFollowBoneOffsetX,Z.emitterFollowBoneOffsetY=ae.emitterFollowBoneOffsetY,Z.emitterFollowBoneRotation=ae.emitterFollowBoneRotation,Z.emitterFollowBoneScaleX=ae.emitterFollowBoneScaleX,Z.emitterFollowBoneScaleY=ae.emitterFollowBoneScaleY,Z.emitterAngleMode=ae.emitterAngleMode,Z.emitterFollowCurve=ae.emitterFollowCurve.map(we=>({...we})),Z.emitterFollowDuration=ae.emitterFollowDuration,Z.emitterFollowSpace=ae.emitterFollowSpace,Z.emitterFollowDirection=ae.emitterFollowDirection,Z.emitterFollowOffset=ae.emitterFollowOffset}function ga(Z){var Yt;const ae=(Yt=B.value)==null?void 0:Yt.config;if(!ae||ae.streamBehavior===Z)return;const we=Z==="loop",yt=we?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(yt)&&(Er(ae),ae.streamBehavior=Z,we||(ae.generateLoopStartAnimation=!1,ae.generateLoopEndAnimation=!1))}function va(Z,ae){var Yt;const we=(Yt=B.value)==null?void 0:Yt.config;if(!we)return;const yt=ae.target.checked;Z==="start"?we.generateLoopStartAnimation=yt:we.generateLoopEndAnimation=yt}function Fl(Z,ae){var Yt;const we=(Yt=B.value)==null?void 0:Yt.config;if(!we)return;const yt=Math.min(1800,Math.max(1,Math.ceil(Number(ae.target.value)||30)));Z==="start"?we.loopStartDurationFrames=yt:we.loopEndDurationFrames=yt}function Ol(Z,ae){var Yt;const we=(Yt=B.value)==null?void 0:Yt.config;if(!we)return;const yt=ae.target.checked;Z==="start"?we.loopStartUseCustomDuration=yt:we.loopEndUseCustomDuration=yt}function ya(Z,ae){const we=Z.target.value;if(ae.emitterFollowMode=we,we!=="bone"){ae.emitterFollowSpineId=0,ae.emitterFollowBoneName="";return}xa(ae)}function xa(Z){const ae=qe.value;if(!ae){Z.emitterFollowMode="none",Z.emitterFollowSpineId=0,Z.emitterFollowBoneName="";return}Z.emitterFollowMode="bone",Z.emitterFollowSpineId=ae.spine.id,Z.emitterFollowBoneName=ae.boneName}const ba={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","showShape","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","renderLayerMode","renderLayerSpineId","renderLayerSlotName","renderLayerSlotPosition","renderLayerFollowAttachment"],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","showForceFieldShape","vortex","vortexStrength","vortexRadius","vortexCenterX","vortexCenterY","vortexFalloff","showVortexShape","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","showAttractionShape","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 Ll(Z){var yt;const ae=(yt=B.value)==null?void 0:yt.config;if(Z==="export"){i.settings.exportSettings=fp();return}if(!ae)return;const we=gl();for(const Yt of ba[Z])ae[Yt]=we[Yt]}function vu(){e.value.fps=Math.min(240,Math.max(1,Math.round(Number(e.value.fps)||30)))}function wa(Z){var ae;i.selectSystem(((ae=i.systems[Z])==null?void 0:ae.id)??0)}function zn(){i.addSystem()}function xo(){i.addCollider()}function yu(){i.addPath()}function Bl(){i.addSpine()}function RS(){i.duplicateSelectedObject()}function fn(Z,ae,we=0,yt=0,Yt=0,Sa=0){return{x:Z,y:ae,inX:we,inY:yt,outX:Yt,outY:Sa}}function PS(){const Z=me.value;if(!(!Z||!Z.preset))if(Z.preset==="circle"){const we=60.751328;Z.points=[fn(110,0,0,-we,0,we),fn(0,110,we,0,-we,0),fn(-110,0,0,we,0,-we),fn(0,-110,-we,0,we,0)],Z.closed=!0}else if(Z.preset==="square")Z.points=[fn(-100,-100),fn(100,-100),fn(100,100),fn(-100,100)],Z.closed=!0;else{const ae=Z.preset==="star"?10:6;Z.points=Array.from({length:ae},(we,yt)=>{const Yt=Z.preset==="star"&&yt%2?50:110,Sa=-Math.PI*.5+yt/ae*Math.PI*2;return fn(Math.cos(Sa)*Yt,Math.sin(Sa)*Yt)}),Z.closed=!0}}function kS(){me.value&&(me.value.points=[])}function FS(){B.value&&(B.value.config.seed=Math.floor(Math.random()*999999)+1)}function OS(Z){var we;const ae=(we=B.value)==null?void 0:we.config;!ae||Z==="direction"||(ae.speedOverLifeMode=Z,Z==="curve"&&ae.speedOverLifeMin===ae.speedOverLifeMax&&(ae.speedOverLifeMin=0,ae.speedOverLifeMax=1))}function kp(){var ae;const Z=(ae=B.value)==null?void 0:ae.config;!Z||Z.scaleOverLifeMode!=="curve"||(Z.scaleOverLifeMin===Z.scaleOverLifeMax&&(Z.scaleOverLifeMin=0,Z.scaleOverLifeMax=1),Z.scaleYOverLifeMin===Z.scaleYOverLifeMax&&(Z.scaleYOverLifeMin=0,Z.scaleYOverLifeMax=1))}function LS(Z){var we;const ae=(we=B.value)==null?void 0:we.config;!ae||Z==="direction"||(ae.scaleOverLifeMode=Z,kp())}const BS={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 NS(){var we;const Z=(we=B.value)==null?void 0:we.config;if(!Z)return;const ae=BS[Z.shape];ae&&Object.assign(Z,ae)}function DS(){var ae;const Z=(ae=B.value)==null?void 0:ae.config;!Z||Z.spawnPathId>0||(Z.emissionAngleMode==="path-normal"||Z.emissionAngleMode==="path-tangent")&&(Z.emissionAngleMode="fixed")}return{store:i,exportSettings:e,exportBusy:t,exportTarget:s,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:M,configMessage:_,configError:w,saveConfig:b,onConfigFileChange:C,refreshPresets:R,loadSelectedPreset:F,resolvedCurveEditorMode:I,sys:B,textureFileInput:D,sequenceFileInput:$,trailTextureFileInput:N,addTrailResource:X,openTrailTexturePicker:A,onTrailRigChange:P,onTrailResourceBoneCountChange:O,onTrailResourceRotationChange:L,onTrailTextureFile:U,resetTrailTexture:V,removeTrailResource:H,setTrailResourceWeight:q,toggleTrailResourceLock:ie,setTrailColor:re,commitTrailColor:pe,addImageResource:ge,openTexturePicker:he,openSequencePicker:fe,onTextureFile:Y,onSequenceFiles:W,resetTexture:j,setResourceFixedColor:G,commitResourceFixedColor:z,removeImageResource:se,setResourceWeight:ue,toggleResourceLock:ne,automaticLoopDuration:de,loopDurationFrames:le,activeObjectType:Ie,activeCollider:ye,activePath:me,activeSpine:Ne,canCopyObject:Ze,selectedSpineBone:qe,boundSpineBone:Ke,renderLayerSlotPickerOpen:Le,renderLayerSlotSearch:Me,renderLayerReadySpines:nt,renderLayerSpineReady:ps,renderLayerSlots:_t,renderLayerFilteredSlots:vt,renderLayerSlotLabel:lt,renderLayerResolvedLabel:At,renderLayerWarning:Et,setRenderLayerSlotMode:tt,selectRenderLayerSpine:ni,pickRenderLayerSlot:ns,clearRenderLayerSlot:ts,collisionPickerOpen:Mt,selectedCollisionBodies:vi,availableCollisionBodies:Cs,addCollisionBody:rs,removeCollisionBody:dn,collapsed:ri,toggle:Li,setEmitMode:Bi,setLoopDurationFrames:Ar,setStreamBehavior:ga,setLoopSection:va,setLoopSectionDuration:Fl,setLoopCustomDuration:Ol,onEmitterFollowModeChange:ya,bindSelectedBone:xa,resetModule:Ll,normalizeExportFps:vu,select:wa,addSys:zn,addCollider:xo,addPath:yu,addSpine:Bl,copySelectedObject:RS,applyPathPreset:PS,clearPathAnchors:kS,randomizeSeed:FS,setSpeedOverLifeMode:OS,prepareScaleOverLifeCurve:kp,setScaleOverLifeMode:LS,onShapeChange:NS,onSpawnPathChange:DS,LINEAR_CURVE:s3,FLAT_CURVE:pm,ALPHA_CURVE:i3,RESOURCE_ALPHA_CURVE:gm,TRAIL_ALPHA_CURVE:vm,TRAIL_SHAPE_CURVE:ym}}const AS=Symbol("particle-panel");function lL(){const i=aL();return Wy(AS,i),i}function Cr(){const i=Go(AS);if(!i)throw new Error("Particle panel sections require a ParticlePanel parent");return i}const cL={class:"group config-management"},hL={class:"caret"},uL={class:"group-body config-management-body"},dL={class:"config-toolbar"},fL=["disabled"],mL={value:""},pL=["value"],gL=Qt({__name:"ProjectConfigSection",setup(i){const{configFileInput:e,selectedPreset:t,presetOptions:s,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h,collapsed:u,toggle:d,select:f}=Cr();return(p,m)=>(K(),J("div",cL,[T("div",{class:"group-head",onClick:m[0]||(m[0]=g=>E(d)("config"))},[T("span",hL,be(E(u).config?"▸":"▾"),1),m[8]||(m[8]=T("span",null,"配置管理",-1))]),ce(T("div",uL,[T("div",dL,[T("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:m[1]||(m[1]=(...g)=>E(a)&&E(a)(...g))},"保存配置"),T("button",{title:"加载本地编辑器配置",onClick:m[2]||(m[2]=g=>{var v;return(v=E(e))==null?void 0:v.click()})},"加载配置"),ce(T("select",{"onUpdate:modelValue":m[3]||(m[3]=g=>Vt(t)?t.value=g:null),"aria-label":"预设列表",disabled:!E(s).length||E(n),onPointerdown:m[4]||(m[4]=(...g)=>E(l)&&E(l)(...g)),onFocus:m[5]||(m[5]=(...g)=>E(l)&&E(l)(...g)),onChange:m[6]||(m[6]=(...g)=>E(h)&&E(h)(...g))},[T("option",mL,be(E(s).length?"选择预设":"无预设文件"),1),(K(!0),J(Ae,null,Ft(E(s),g=>(K(),J("option",{key:g.file,value:g.file},be(g.name),9,pL))),128))],40,fL),[[Tt,E(t)]]),T("input",{ref_key:"configFileInput",ref:e,hidden:"",type:"file",accept:".json,application/json",onChange:m[7]||(m[7]=(...g)=>E(c)&&E(c)(...g))},null,544)]),E(r)?(K(),J("div",{key:0,class:ke(["config-message",{error:E(o)}])},be(E(r)),3)):Se("",!0)],512),[[ws,!E(u).config]])]))}}),vL=es(gL,[["__scopeId","data-v-cb52d3e0"]]),yL={class:"ns-label"},xL=["min","max","step","value","disabled"],bL=["min","max","step","value","disabled"],wL=Qt({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=$e(String(t.modelValue));Ls(()=>t.modelValue,c=>{n.value=String(c)});function r(c){const l=parseFloat(c.target.value);Number.isNaN(l)||s("update:modelValue",l)}function o(c){n.value=c.target.value;const l=parseFloat(n.value);Number.isNaN(l)||s("update:modelValue",l)}function a(){const c=parseFloat(n.value);Number.isNaN(c)&&(n.value=String(t.modelValue))}return(c,l)=>(K(),J("div",{class:ke(["ns",{disabled:i.disabled}])},[T("span",yL,be(i.label),1),T("input",{type:"range",class:"ns-range",min:i.min,max:i.max,step:i.step,value:i.modelValue,disabled:i.disabled,onInput:r},null,40,xL),T("input",{type:"number",class:"ns-num",min:i.min,max:i.max,step:i.step,value:n.value,disabled:i.disabled,onInput:o,onBlur:a},null,40,bL)],2))}}),Fe=es(wL,[["__scopeId","data-v-7c2fbed0"]]),SL={class:"ce"},ML={class:"ce-editor"},TL={class:"ce-grid"},_L=["x1","x2","y2"],CL=["y1","x2","y2"],AL=["x","y","width","height"],EL=["d"],IL={key:0,class:"ce-handles"},RL=["x1","y1","x2","y2"],PL=["cx","cy","onPointerdown"],kL=["x1","y1","x2","y2"],FL=["cx","cy","onPointerdown"],OL=["cx","cy"],LL=["cx","cy","onPointerdown","onDblclick"],BL={class:"ce-nav"},NL={class:"ce-tip"},Zn=8,DL=Qt({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=$e(null),r=$e(300),o=$e(110);let a=null;function c(){if(!n.value)return;const I=n.value.getBoundingClientRect();r.value=I.width,o.value=I.height}function l(I){return Zn+I*(r.value-Zn*2)}function h(I){return Zn+(1-I)*(o.value-Zn*2)}function u(){return[...t.modelValue].sort((I,k)=>I.x-k.x)}function d(I){s("update:modelValue",[...I].sort((k,B)=>k.x-B.x))}function f(){d(t.defaultValue.map(I=>({...I})))}const p=Ye(()=>u());function m(I){const k=p.value[I],B=p.value[Math.max(0,I-1)];return{x:k.x-(k.x-B.x)/3,y:k.y-(k.y-B.y)/3}}function g(I){const k=p.value[I],B=p.value[Math.min(p.value.length-1,I+1)];return{x:k.x+(B.x-k.x)/3,y:k.y+(B.y-k.y)/3}}function v(I){const k=p.value[I],B=m(I);return{x:k.x+(k.inX??B.x-k.x),y:k.y+(k.inY??B.y-k.y)}}function x(I){const k=p.value[I],B=g(I);return{x:k.x+(k.outX??B.x-k.x),y:k.y+(k.outY??B.y-k.y)}}const y=Ye(()=>{if(!p.value.length)return"";let I=`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:B}),d(D)}let b={t:0,i:-1,x:0,y:0};function C(I,k){I.stopPropagation();const B=u().findIndex(X=>Math.abs(X.x-p.value[k].x)<1e-6&&Math.abs(X.y-p.value[k].y)<1e-6);if(B<0)return;const D=Date.now();if(D-b.t<300&&b.i===k&&Math.abs(I.clientX-b.x)<8&&Math.abs(I.clientY-b.y)<8){b={t:0,i:-1,x:0,y:0},F(k);return}b={t:D,i:k,x:I.clientX,y:I.clientY};const $=X=>{(Math.abs(X.clientX-I.clientX)>8||Math.abs(X.clientY-I.clientY)>8)&&(b={t:0,i:-1,x:0,y:0});const{x:A,y:P}=M(X.clientX,X.clientY),O=u();O[B]={x:A,y:P},d(O)},N=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",N)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",N)}function R(I,k,B){I.stopPropagation();const D=N=>{const X=M(N.clientX,N.clientY),A=u(),P=A[k],O=B==="in"?A[Math.max(0,k-1)].x:P.x,L=B==="in"?P.x:A[Math.min(A.length-1,k+1)].x,U=Math.min(L,Math.max(O,X.x)),V=Math.round((U-P.x)*100)/100,H=Math.round((X.y-P.y)*100)/100;A[k]=B==="in"?{...P,inX:V,inY:H}:{...P,outX:V,outY:H},d(A)},$=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",$)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",$)}function F(I,k){k==null||k.stopPropagation();const B=u();B.length<=2||(_=Date.now(),d(B.filter((D,$)=>$!==I)))}return Wn(()=>{c(),a=new ResizeObserver(c),n.value&&a.observe(n.value)}),Ml(()=>{a==null||a.disconnect()}),(I,k)=>(K(),J("div",SL,[T("div",ML,[(K(),J("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:w},[T("g",TL,[(K(),J(Ae,null,Ft([.25,.5,.75],B=>T("line",{key:"v"+B,x1:l(B),y1:"0",x2:l(B),y2:h(0)},null,8,_L)),64)),(K(),J(Ae,null,Ft([.25,.5,.75],B=>T("line",{key:"h"+B,x1:"0",y1:h(B),x2:l(1),y2:h(B)},null,8,CL)),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,AL),T("path",{d:y.value,class:"ce-line",fill:"none"},null,8,EL),i.mode==="bezier"?(K(),J("g",IL,[(K(!0),J(Ae,null,Ft(p.value,(B,D)=>(K(),J(Ae,{key:"handles-"+D},[D>0?(K(),J("line",{key:0,x1:l(B.x),y1:h(B.y),x2:l(v(D).x),y2:h(v(D).y)},null,8,RL)):Se("",!0),D>0?(K(),J("circle",{key:1,cx:l(v(D).x),cy:h(v(D).y),r:"4",onPointerdown:$=>R($,D,"in")},null,40,PL)):Se("",!0),DR($,D,"out")},null,40,FL)):Se("",!0)],64))),128))])):Se("",!0),(K(!0),J(Ae,null,Ft(p.value,(B,D)=>(K(),J("g",{key:D},[T("circle",{cx:l(B.x),cy:h(B.y),r:"5",class:"ce-node"},null,8,OL),T("circle",{cx:l(B.x),cy:h(B.y),r:"9",class:"ce-hit",onPointerdown:$=>C($,D),onDblclick:$=>F(D,$)},null,40,LL)]))),128))],544)),T("div",BL,[T("span",NL,be(i.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),T("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:f},"重置")]))}}),Zi=es(DL,[["__scopeId","data-v-9bfb7b31"]]),UL={class:"spine-editor"},$L={class:"field wide"},XL={class:"grid three"},VL={class:"field"},YL={class:"field"},GL={class:"field"},jL={class:"grid three"},HL={class:"field"},WL={class:"field"},zL={class:"field"},qL=["disabled"],KL={class:"asset-row"},ZL=["title"],JL={class:"asset-row"},QL=["title"],eB={class:"asset-row"},tB=["title"],sB={class:"asset-actions"},iB=["disabled"],nB={class:"runtime-note"},rB={key:0},oB={key:0,class:"error"},aB={class:"section-box"},lB={key:0,class:"empty"},cB={key:1,class:"field wide"},hB=["value"],uB={class:"section-box"},dB={class:"tree-title-row"},fB=["disabled","title"],mB=["disabled","title"],pB={class:"tree-tabs"},gB={key:0,class:"empty"},vB={key:1,class:"bone-search"},yB={key:2,class:"empty"},xB={key:3,class:"bone-tree"},bB=["onClick","onKeydown"],wB=["title","onClick"],SB={key:1,class:"bone-leaf"},MB={class:"bone-name"},TB={key:0,class:"empty"},_B={key:1,class:"bone-search"},CB={key:2,class:"empty"},AB={key:3,class:"bone-tree slot-tree"},EB=["title","onClick","onKeydown"],IB={class:"slot-order"},RB={class:"bone-name"},PB={class:"slot-attachment"},kB=Qt({__name:"SpineObjectPanel",props:{spineObject:{}},setup(i){const e=i,t=po(),s=$e(null),n=$e(null),r=$e(null),o=$e(null),a=$e(new Set),c=$e(""),l=$e("bone"),h=$e(""),u=$e(null),d=$e(null),f=$e([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.selectedSlot==null&&(e.spineObject.selectedSlot=""),Array.isArray(e.spineObject.slots)||(e.spineObject.slots=[]),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const p=Ye(()=>{var L;return((L=u.value)==null?void 0:L.name)||e.spineObject.skeletonFileName}),m=Ye(()=>{var L;return((L=d.value)==null?void 0:L.name)||e.spineObject.atlasFileName}),g=Ye(()=>f.value.length?f.value.map(L=>L.name):e.spineObject.textureFileNames),v=Ye(()=>g.value.length?`${g.value.length} 张:${g.value.join(", ")}`:"PNG / JPEG / WebP..."),x=Ye(()=>new Set(e.spineObject.bones.map(L=>L.parent).filter(L=>!!L))),y=Ye(()=>new Map(e.spineObject.bones.map(L=>[L.name,L]))),M=Ye(()=>e.spineObject.bones.filter(L=>{var H;const U=c.value.trim().toLocaleLowerCase();if(U)return L.name.toLocaleLowerCase().includes(U);let V=L.parent;for(;V;){if(a.value.has(V))return!1;V=((H=y.value.get(V))==null?void 0:H.parent)||null}return!0})),_=Ye(()=>x.value.size>0&&[...x.value].every(L=>a.value.has(L))),w=Ye(()=>{const L=h.value.trim().toLocaleLowerCase(),U=[...e.spineObject.slots].sort((V,H)=>V.order-H.order);return L?U.filter(V=>V.name.toLocaleLowerCase().includes(L)||V.attachment.toLocaleLowerCase().includes(L)):U});function b(L){const U=e.spineObject.selectedBone===L;for(const V of t.spines)V.selectedBone="";U||(e.spineObject.selectedBone=L)}function C(L){const U=e.spineObject.selectedSlot===L;for(const V of t.spines)V.selectedSlot="";U||(e.spineObject.selectedSlot=L)}function R(L){a.value.has(L)?a.value.delete(L):a.value.add(L)}function F(){a.value=_.value?new Set:new Set(x.value)}function I(L){var U;return((U=L.target.files)==null?void 0:U[0])||null}function k(L){u.value=I(L)}function B(L){d.value=I(L)}function D(L){f.value=Array.from(L.target.files||[])}function $(L){return L.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function N(L){const U=Array.from(L.target.files||[]);if(!U.length)return;const V=U.filter(ge=>/\.(json|skel)$/i.test(ge.name)),H=U.filter(ge=>/\.atlas$/i.test(ge.name)),q=U.filter(ge=>/\.(png|jpe?g|webp|wepb)$/i.test(ge.name)),ie=H.map(ge=>({atlas:ge,skeleton:V.find(he=>$(he)===$(ge))})).find(ge=>ge.skeleton),re=(ie==null?void 0:ie.skeleton)||V[0]||null,pe=(ie==null?void 0:ie.atlas)||H[0]||null;if(u.value=re,d.value=pe,f.value=q,!re||!pe||!q.length){const ge=[!re&&"JSON / SKEL",!pe&&"Atlas",!q.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${ge}`;return}await P()}function X(){t.recalcTotalFrames()}function A(){X(),t.timeline.frame=0}async function P(){var V;const L=u.value,U=d.value;if(!L||!U||!f.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const H=await vw(L,U,f.value);cu(e.spineObject.id,H),e.spineObject.skeletonFileName=L.name,e.spineObject.atlasFileName=U.name,e.spineObject.textureFileNames=f.value.map(q=>q.name),e.spineObject.dataVersion=H.dataVersion,e.spineObject.animations=H.animations,e.spineObject.bones=H.bones,e.spineObject.slots=H.slots,e.spineObject.selectedBone="",e.spineObject.selectedSlot="",c.value="",h.value="",a.value=new Set,e.spineObject.selectedAnimation=((V=H.animations[0])==null?void 0:V.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",X(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await hk(L,U,f.value)}catch(q){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",q)}}catch(H){e.spineObject.status="error",e.spineObject.error=H instanceof Error?H.message:String(H)}}function O(){El(e.spineObject.id),u.value=null,d.value=null,f.value=[],s.value&&(s.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.slots=[],e.spineObject.selectedBone="",e.spineObject.selectedSlot="",c.value="",h.value="",a.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",X()}return(L,U)=>(K(),J("div",UL,[U[38]||(U[38]=T("div",{class:"editor-title"},"Spine 属性",-1)),T("label",$L,[U[20]||(U[20]=T("span",null,"Spine 名称",-1)),ce(T("input",{"onUpdate:modelValue":U[0]||(U[0]=V=>i.spineObject.name=V)},null,512),[[Ge,i.spineObject.name]])]),T("div",XL,[T("label",VL,[U[21]||(U[21]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":U[1]||(U[1]=V=>i.spineObject.x=V),type:"number"},null,512),[[Ge,i.spineObject.x,void 0,{number:!0}]])]),T("label",YL,[U[22]||(U[22]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":U[2]||(U[2]=V=>i.spineObject.y=V),type:"number"},null,512),[[Ge,i.spineObject.y,void 0,{number:!0}]])]),T("label",GL,[U[23]||(U[23]=T("span",null,"旋转",-1)),ce(T("input",{"onUpdate:modelValue":U[3]||(U[3]=V=>i.spineObject.rotation=V),type:"number"},null,512),[[Ge,i.spineObject.rotation,void 0,{number:!0}]])])]),T("div",jL,[T("label",HL,[U[24]||(U[24]=T("span",null,"Scale X",-1)),ce(T("input",{"onUpdate:modelValue":U[4]||(U[4]=V=>i.spineObject.scaleX=V),type:"number",step:"0.05"},null,512),[[Ge,i.spineObject.scaleX,void 0,{number:!0}]])]),T("label",WL,[U[25]||(U[25]=T("span",null,"Scale Y",-1)),ce(T("input",{"onUpdate:modelValue":U[5]||(U[5]=V=>i.spineObject.scaleY=V),type:"number",step:"0.05"},null,512),[[Ge,i.spineObject.scaleY,void 0,{number:!0}]])]),T("label",zL,[U[26]||(U[26]=T("span",null,"开始时间",-1)),ce(T("input",{"onUpdate:modelValue":U[6]||(U[6]=V=>i.spineObject.timeOffset=V),type:"number",min:"0",step:"0.033333",onChange:X},null,544),[[Ge,i.spineObject.timeOffset,void 0,{number:!0}]])])]),U[39]||(U[39]=T("div",{class:"divider"},null,-1)),U[40]||(U[40]=T("div",{class:"section-title"},"Spine 资源",-1)),T("input",{ref_key:"skeletonInput",ref:s,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:k},null,544),T("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:B},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:D},null,544),T("input",{ref_key:"folderInput",ref:o,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:N},null,544),T("button",{class:"folder-select",disabled:i.spineObject.status==="loading",onClick:U[7]||(U[7]=V=>{var H;return(H=o.value)==null?void 0:H.click()})},"选择文件夹并加载",8,qL),U[41]||(U[41]=T("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),T("div",KL,[T("div",{class:"asset-name",title:p.value},be(p.value||"JSON / SKEL..."),9,ZL),T("button",{onClick:U[8]||(U[8]=V=>{var H;return(H=s.value)==null?void 0:H.click()})},"选择")]),T("div",JL,[T("div",{class:"asset-name",title:m.value},be(m.value||"Atlas..."),9,QL),T("button",{onClick:U[9]||(U[9]=V=>{var H;return(H=n.value)==null?void 0:H.click()})},"选择")]),T("div",eB,[T("div",{class:"asset-name",title:g.value.join(", ")},be(v.value),9,tB),T("button",{onClick:U[10]||(U[10]=V=>{var H;return(H=r.value)==null?void 0:H.click()})},"选择(多选)")]),T("div",sB,[T("button",{class:"load",disabled:i.spineObject.status==="loading",onClick:P},be(i.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,iB),T("button",{class:"clear",onClick:O},"清除")]),T("div",nB,[U[27]||(U[27]=Rt(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线 ",-1)),i.spineObject.dataVersion?(K(),J("span",rB," · 当前资源 "+be(i.spineObject.dataVersion),1)):Se("",!0)]),i.spineObject.error?(K(),J("div",oB,be(i.spineObject.error),1)):Se("",!0),T("div",aB,[U[30]||(U[30]=T("div",{class:"section-title"},"Spine 动画",-1)),i.spineObject.animations.length?(K(),J("label",cB,[U[29]||(U[29]=T("span",null,"时间轴播放动画",-1)),ce(T("select",{"onUpdate:modelValue":U[11]||(U[11]=V=>i.spineObject.selectedAnimation=V),onChange:A},[U[28]||(U[28]=T("option",{value:""},"无",-1)),(K(!0),J(Ae,null,Ft(i.spineObject.animations,V=>(K(),J("option",{key:V.name,value:V.name},be(V.name)+"("+be(V.duration.toFixed(2))+"s) ",9,hB))),128))],544),[[Tt,i.spineObject.selectedAnimation]])])):(K(),J("div",lB,"无可用动画"))]),T("div",uB,[T("div",dB,[U[37]||(U[37]=T("div",{class:"section-title"},"层级树",-1)),l.value==="bone"?(K(),J("button",{key:0,class:ke(["selected-bone",{active:i.spineObject.selectedBone}]),disabled:!i.spineObject.selectedBone,title:i.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:U[12]||(U[12]=V=>i.spineObject.selectedBone="")},[i.spineObject.selectedBone?(K(),J(Ae,{key:0},[U[31]||(U[31]=Rt("清除选中骨骼:",-1)),T("strong",null,be(i.spineObject.selectedBone),1)],64)):(K(),J(Ae,{key:1},[U[32]||(U[32]=Rt("当前骨骼:",-1)),U[33]||(U[33]=T("strong",null,"未选择",-1))],64))],10,fB)):(K(),J("button",{key:1,class:ke(["selected-bone",{active:i.spineObject.selectedSlot}]),disabled:!i.spineObject.selectedSlot,title:i.spineObject.selectedSlot?"点击清除插槽选择":"当前未选择插槽",onClick:U[13]||(U[13]=V=>i.spineObject.selectedSlot="")},[i.spineObject.selectedSlot?(K(),J(Ae,{key:0},[U[34]||(U[34]=Rt("清除选中插槽:",-1)),T("strong",null,be(i.spineObject.selectedSlot),1)],64)):(K(),J(Ae,{key:1},[U[35]||(U[35]=Rt("当前插槽:",-1)),U[36]||(U[36]=T("strong",null,"未选择",-1))],64))],10,mB)),l.value==="bone"&&i.spineObject.bones.length?(K(),J("button",{key:2,class:"tree-action",onClick:F},be(_.value?"全部展开":"全部折叠"),1)):Se("",!0)]),T("div",pB,[T("button",{class:ke({on:l.value==="bone"}),onClick:U[14]||(U[14]=V=>l.value="bone")},"骨骼",2),T("button",{class:ke({on:l.value==="slot"}),onClick:U[15]||(U[15]=V=>l.value="slot")},"插槽",2)]),l.value==="bone"?(K(),J(Ae,{key:0},[i.spineObject.bones.length?(K(),J("div",vB,[ce(T("input",{"onUpdate:modelValue":U[16]||(U[16]=V=>c.value=V),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[Ge,c.value,void 0,{trim:!0}]]),c.value?(K(),J("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:U[17]||(U[17]=V=>c.value="")},"✕")):Se("",!0)])):(K(),J("div",gB,"未加载 Spine")),i.spineObject.bones.length&&!M.value.length?(K(),J("div",yB,"未找到匹配的骨骼")):i.spineObject.bones.length?(K(),J("div",xB,[(K(!0),J(Ae,null,Ft(M.value,V=>(K(),J("div",{key:V.name,class:ke(["bone",{selected:i.spineObject.selectedBone===V.name}]),style:vs({paddingLeft:`${6+V.depth*16}px`}),role:"button",tabindex:"0",onClick:H=>b(V.name),onKeydown:vr(Je(H=>b(V.name),["prevent"]),["enter"])},[x.value.has(V.name)?(K(),J("button",{key:0,class:"bone-toggle",title:a.value.has(V.name)?"展开子骨骼":"折叠子骨骼",onClick:Je(H=>R(V.name),["stop"])},be(a.value.has(V.name)?"▸":"▾"),9,wB)):(K(),J("span",SB,"•")),T("span",MB,be(V.name),1)],46,bB))),128))])):Se("",!0)],64)):(K(),J(Ae,{key:1},[i.spineObject.slots.length?(K(),J("div",_B,[ce(T("input",{"onUpdate:modelValue":U[18]||(U[18]=V=>h.value=V),type:"search","aria-label":"搜索插槽",placeholder:"搜索插槽或附件名称…"},null,512),[[Ge,h.value,void 0,{trim:!0}]]),h.value?(K(),J("button",{key:0,title:"清空搜索","aria-label":"清空插槽搜索",onClick:U[19]||(U[19]=V=>h.value="")},"✕")):Se("",!0)])):(K(),J("div",TB,"未加载 Spine 插槽")),i.spineObject.slots.length&&!w.value.length?(K(),J("div",CB,"未找到匹配的插槽")):i.spineObject.slots.length?(K(),J("div",AB,[(K(!0),J(Ae,null,Ft(w.value,V=>(K(),J("div",{key:V.name,class:ke(["bone slot-row",{selected:i.spineObject.selectedSlot===V.name}]),role:"button",tabindex:"0",title:`${V.name}(骨骼:${V.bone||"-"},附件:${V.attachment||"空"})`,onClick:H=>C(V.name),onKeydown:vr(Je(H=>C(V.name),["prevent"]),["enter"])},[T("span",IB,be(V.order+1),1),T("span",RB,be(V.name),1),T("span",PB,be(V.attachment||"空"),1)],42,EB))),128))])):Se("",!0)],64))])]))}}),FB=es(kB,[["__scopeId","data-v-3545b078"]]),OB={class:"group"},LB={class:"caret"},BB={class:"scene-actions"},NB=["disabled"],DB={class:"group-body"},UB={class:"tree scene-tree"},$B=["onClick"],XB={class:"tlabel"},VB=["title","aria-label","onClick"],YB={viewBox:"0 0 24 24","aria-hidden":"true"},GB={key:0,class:"eye-slash",d:"M4 4l16 16"},jB=["onClick"],HB=["onClick"],WB={class:"tlabel"},zB=["title","aria-label","onClick"],qB={viewBox:"0 0 24 24","aria-hidden":"true"},KB={key:0,class:"eye-slash",d:"M4 4l16 16"},ZB=["onClick"],JB=["onClick"],QB={class:"tlabel"},eN=["title","aria-label","onClick"],tN={viewBox:"0 0 24 24","aria-hidden":"true"},sN={key:0,class:"eye-slash",d:"M4 4l16 16"},iN=["onClick"],nN=["onClick"],rN={class:"tlabel"},oN=["title","aria-label","onClick"],aN={viewBox:"0 0 24 24","aria-hidden":"true"},lN={key:0,class:"eye-slash",d:"M4 4l16 16"},cN=["onClick"],hN={key:0,class:"empty"},uN={class:"row"},dN={class:"seed-row scene-seed"},fN={class:"field-block"},mN={class:"field-grid"},pN={class:"field-block"},gN={class:"field-block check-field"},vN={class:"field-grid"},yN={class:"compact-field"},xN={class:"compact-field"},bN={class:"field-grid"},wN={class:"compact-field"},SN={class:"compact-field"},MN={key:1,class:"field-grid"},TN={class:"compact-field"},_N={class:"compact-field"},CN={key:2,class:"field-grid"},AN={class:"compact-field"},EN={class:"compact-field"},IN={class:"field-block"},RN={key:4,class:"field-grid"},PN={class:"compact-field"},kN={class:"compact-field"},FN={class:"collider-follow-section"},ON={class:"follow-path"},LN={class:"field-block"},BN=["value"],NN={class:"field-grid"},DN={class:"compact-field"},UN={class:"compact-field"},$N={class:"follow-path"},XN={class:"field-block"},VN={class:"field-grid"},YN={class:"compact-field"},GN={class:"compact-field"},jN={class:"field-grid"},HN={class:"compact-field"},WN={class:"compact-field"},zN={class:"setting-line"},qN={class:"setting-line"},KN={class:"field-block"},ZN={key:4,class:"panel-hint"},JN=Qt({__name:"SceneObjectsSection",setup(i){const{store:e,resolvedCurveEditorMode:t,sys:s,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:M}=Cr();return(_,w)=>(K(),J("div",OB,[T("div",{class:"group-head scene-head",onClick:w[5]||(w[5]=b=>E(h)("scene"))},[T("span",LB,be(E(l).scene?"▸":"▾"),1),w[50]||(w[50]=T("span",null,"场景对象",-1)),T("div",BB,[T("button",{class:"scene-add",title:"添加粒子系统",onClick:w[0]||(w[0]=Je((...b)=>E(d)&&E(d)(...b),["stop"]))},"+粒子"),T("button",{class:"scene-add",title:"添加碰撞体",onClick:w[1]||(w[1]=Je((...b)=>E(f)&&E(f)(...b),["stop"]))},"+碰撞"),T("button",{class:"scene-add",title:"添加路径",onClick:w[2]||(w[2]=Je((...b)=>E(p)&&E(p)(...b),["stop"]))},"+路径"),T("button",{class:"scene-add",title:"添加 Spine",onClick:w[3]||(w[3]=Je((...b)=>E(m)&&E(m)(...b),["stop"]))},"+Spine"),T("button",{class:"scene-add",disabled:!E(c),title:"复制当前选中的场景对象",onClick:w[4]||(w[4]=Je((...b)=>E(g)&&E(g)(...b),["stop"]))},"+Copy",8,NB)])]),ce(T("div",DB,[T("div",UB,[(K(!0),J(Ae,null,Ft(E(e).systems,(b,C)=>(K(),J("div",{key:`particle-${b.id}`,class:ke(["tree-item scene-object-item",{on:E(n)==="particle"&&b.id===E(e).activeObjectId}]),onClick:R=>E(u)(C)},[w[53]||(w[53]=T("span",{class:"tdot"},"●",-1)),T("span",XB,be(b.config.name||"ParticleSystem"+(C+1)),1),T("button",{class:ke(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":b.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:Je(R=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",YB,[w[51]||(w[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)),w[52]||(w[52]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",GB)):Se("",!0)]))],10,VB),w[54]||(w[54]=T("span",{class:"scene-object-kind"},"粒子",-1)),T("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:Je(R=>E(e).removeSystem(b.id),["stop"])},"✕",8,jB)],10,$B))),128)),(K(!0),J(Ae,null,Ft(E(e).colliders,b=>(K(),J("div",{key:`collision-${b.id}`,class:ke(["tree-item scene-object-item",{on:E(n)==="collision"&&b.id===E(e).activeObjectId}]),onClick:C=>E(e).selectSceneObject("collision",b.id)},[w[57]||(w[57]=T("span",{class:"tdot collision-dot"},"■",-1)),T("span",WB,be(b.name),1),T("button",{class:ke(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":b.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:Je(C=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",qB,[w[55]||(w[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)),w[56]||(w[56]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",KB)):Se("",!0)]))],10,zB),w[58]||(w[58]=T("span",{class:"scene-object-kind"},"碰撞",-1)),T("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:Je(C=>E(e).removeCollider(b.id),["stop"])},"✕",8,ZB)],10,HB))),128)),(K(!0),J(Ae,null,Ft(E(e).paths,b=>(K(),J("div",{key:`path-${b.id}`,class:ke(["tree-item scene-object-item",{on:E(n)==="path"&&b.id===E(e).activeObjectId}]),onClick:C=>E(e).selectSceneObject("path",b.id)},[w[61]||(w[61]=T("span",{class:"tdot path-dot"},"◇",-1)),T("span",QB,be(b.name),1),T("button",{class:ke(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示路径":"隐藏路径","aria-label":b.visible===!1?"显示路径":"隐藏路径",onClick:Je(C=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",tN,[w[59]||(w[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)),w[60]||(w[60]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",sN)):Se("",!0)]))],10,eN),w[62]||(w[62]=T("span",{class:"scene-object-kind"},"路径",-1)),T("button",{class:"scene-object-delete",title:"删除路径",onClick:Je(C=>E(e).removePath(b.id),["stop"])},"✕",8,iN)],10,JB))),128)),(K(!0),J(Ae,null,Ft(E(e).spines,b=>(K(),J("div",{key:`spine-${b.id}`,class:ke(["tree-item scene-object-item",{on:E(n)==="spine"&&b.id===E(e).activeObjectId}]),onClick:C=>E(e).selectSceneObject("spine",b.id)},[w[65]||(w[65]=T("span",{class:"tdot spine-dot"},"◆",-1)),T("span",rN,be(b.name),1),T("button",{class:ke(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":b.visible===!1?"显示 Spine":"隐藏 Spine",onClick:Je(C=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",aN,[w[63]||(w[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)),w[64]||(w[64]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",lN)):Se("",!0)]))],10,oN),w[66]||(w[66]=T("span",{class:"scene-object-kind"},"Spine",-1)),T("button",{class:"scene-object-delete",title:"删除 Spine",onClick:Je(C=>E(e).removeSpine(b.id),["stop"])},"✕",8,cN)],10,nN))),128)),!E(e).systems.length&&!E(e).colliders.length&&!E(e).paths.length&&!E(e).spines.length?(K(),J("div",hN,"场景中暂无对象")):Se("",!0)]),E(n)==="particle"&&E(s)?(K(),J(Ae,{key:0},[T("label",uN,[w[67]||(w[67]=T("span",null,"名称",-1)),ce(T("input",{"onUpdate:modelValue":w[6]||(w[6]=b=>E(s).config.name=b),class:"inp"},null,512),[[Ge,E(s).config.name]])]),xe(Fe,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:E(s).config.centerX,"onUpdate:modelValue":w[7]||(w[7]=b=>E(s).config.centerX=b)},null,8,["modelValue"]),xe(Fe,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:E(s).config.centerY,"onUpdate:modelValue":w[8]||(w[8]=b=>E(s).config.centerY=b)},null,8,["modelValue"]),xe(Fe,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:E(s).config.offsetX,"onUpdate:modelValue":w[9]||(w[9]=b=>E(s).config.offsetX=b)},null,8,["modelValue"]),xe(Fe,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:E(s).config.offsetY,"onUpdate:modelValue":w[10]||(w[10]=b=>E(s).config.offsetY=b)},null,8,["modelValue"]),xe(Fe,{label:"旋转",min:-360,max:360,step:1,modelValue:E(s).config.rootRotation,"onUpdate:modelValue":w[11]||(w[11]=b=>E(s).config.rootRotation=b)},null,8,["modelValue"]),xe(Fe,{label:"缩放X",min:.05,max:10,step:.05,modelValue:E(s).config.rootScaleX,"onUpdate:modelValue":w[12]||(w[12]=b=>E(s).config.rootScaleX=b)},null,8,["modelValue"]),xe(Fe,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:E(s).config.rootScaleY,"onUpdate:modelValue":w[13]||(w[13]=b=>E(s).config.rootScaleY=b)},null,8,["modelValue"]),T("div",dN,[w[68]||(w[68]=T("label",{for:"system-seed"},"随机种子",-1)),ce(T("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":w[14]||(w[14]=b=>E(s).config.seed=b),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[Ge,E(s).config.seed,void 0,{number:!0}]]),T("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:w[15]||(w[15]=(...b)=>E(y)&&E(y)(...b))},"⚄")]),w[69]||(w[69]=T("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):E(r)?(K(),J(Ae,{key:1},[w[94]||(w[94]=T("div",{class:"object-editor-title"},"碰撞体属性",-1)),T("label",fN,[w[70]||(w[70]=T("span",null,"碰撞体名称",-1)),ce(T("input",{"onUpdate:modelValue":w[16]||(w[16]=b=>E(r).name=b),class:"inp"},null,512),[[Ge,E(r).name]])]),T("div",mN,[T("label",pN,[w[72]||(w[72]=T("span",null,"类型",-1)),ce(T("select",{"onUpdate:modelValue":w[17]||(w[17]=b=>E(r).shape=b),class:"inp"},[...w[71]||(w[71]=[Qs('',5)])],512),[[Tt,E(r).shape]])]),T("label",gN,[w[73]||(w[73]=T("span",null,"启用",-1)),ce(T("input",{"onUpdate:modelValue":w[18]||(w[18]=b=>E(r).enabled=b),type:"checkbox"},null,512),[[wt,E(r).enabled]])])]),T("div",vN,[T("label",yN,[w[74]||(w[74]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[19]||(w[19]=b=>E(r).x=b),type:"number",class:"inp"},null,512),[[Ge,E(r).x,void 0,{number:!0}]])]),T("label",xN,[w[75]||(w[75]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[20]||(w[20]=b=>E(r).y=b),type:"number",class:"inp"},null,512),[[Ge,E(r).y,void 0,{number:!0}]])])]),xe(Fe,{label:"旋转",min:-360,max:360,step:1,modelValue:E(r).rotation,"onUpdate:modelValue":w[21]||(w[21]=b=>E(r).rotation=b)},null,8,["modelValue"]),T("div",bN,[T("label",wN,[w[76]||(w[76]=T("span",null,"缩放 X",-1)),ce(T("input",{"onUpdate:modelValue":w[22]||(w[22]=b=>E(r).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,E(r).scaleX,void 0,{number:!0}]])]),T("label",SN,[w[77]||(w[77]=T("span",null,"缩放 Y",-1)),ce(T("input",{"onUpdate:modelValue":w[23]||(w[23]=b=>E(r).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,E(r).scaleY,void 0,{number:!0}]])])]),E(r).shape==="circle"?(K(),kt(Fe,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:E(r).radius,"onUpdate:modelValue":w[24]||(w[24]=b=>E(r).radius=b)},null,8,["modelValue"])):E(r).shape==="ellipse"?(K(),J("div",MN,[T("label",TN,[w[78]||(w[78]=T("span",null,"X 半径",-1)),ce(T("input",{"onUpdate:modelValue":w[25]||(w[25]=b=>E(r).radiusX=b),type:"number",min:"1",class:"inp"},null,512),[[Ge,E(r).radiusX,void 0,{number:!0}]])]),T("label",_N,[w[79]||(w[79]=T("span",null,"Y 半径",-1)),ce(T("input",{"onUpdate:modelValue":w[26]||(w[26]=b=>E(r).radiusY=b),type:"number",min:"1",class:"inp"},null,512),[[Ge,E(r).radiusY,void 0,{number:!0}]])])])):(K(),J("div",CN,[T("label",AN,[w[80]||(w[80]=T("span",null,"宽度",-1)),ce(T("input",{"onUpdate:modelValue":w[27]||(w[27]=b=>E(r).width=b),type:"number",min:"1",class:"inp"},null,512),[[Ge,E(r).width,void 0,{number:!0}]])]),T("label",EN,[w[81]||(w[81]=T("span",null,"高度",-1)),ce(T("input",{"onUpdate:modelValue":w[28]||(w[28]=b=>E(r).height=b),type:"number",min:"1",class:"inp"},null,512),[[Ge,E(r).height,void 0,{number:!0}]])])])),E(r).shape==="polygon"||E(r).shape==="custom"?(K(),kt(Fe,{key:3,label:"边数",min:3,max:16,step:1,modelValue:E(r).sides,"onUpdate:modelValue":w[29]||(w[29]=b=>E(r).sides=b)},null,8,["modelValue"])):Se("",!0),T("label",IN,[w[83]||(w[83]=T("span",null,"碰撞响应",-1)),ce(T("select",{"onUpdate:modelValue":w[30]||(w[30]=b=>E(r).response=b),class:"inp"},[...w[82]||(w[82]=[T("option",{value:"physics"},"物理(弹跳/摩擦)",-1),T("option",{value:"pause"},"暂停(停止不动)",-1),T("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[Tt,E(r).response]])]),E(r).response==="physics"?(K(),J("div",RN,[T("label",PN,[w[84]||(w[84]=T("span",null,"弹性 (0-1)",-1)),ce(T("input",{"onUpdate:modelValue":w[31]||(w[31]=b=>E(r).elasticity=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Ge,E(r).elasticity,void 0,{number:!0}]])]),T("label",kN,[w[85]||(w[85]=T("span",null,"摩擦 (0-1)",-1)),ce(T("input",{"onUpdate:modelValue":w[32]||(w[32]=b=>E(r).friction=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Ge,E(r).friction,void 0,{number:!0}]])])])):Se("",!0),T("div",FN,[T("label",ON,[ce(T("input",{"onUpdate:modelValue":w[33]||(w[33]=b=>E(r).followPath=b),type:"checkbox"},null,512),[[wt,E(r).followPath]]),w[86]||(w[86]=Rt("跟随路径移动",-1))]),E(r).followPath?(K(),J(Ae,{key:0},[T("label",LN,[w[88]||(w[88]=T("span",null,"目标路径",-1)),ce(T("select",{"onUpdate:modelValue":w[34]||(w[34]=b=>E(r).followPathId=b),class:"inp"},[w[87]||(w[87]=T("option",{value:0},"(未选择)",-1)),(K(!0),J(Ae,null,Ft(E(e).paths,b=>(K(),J("option",{key:b.id,value:b.id},be(b.name),9,BN))),128))],512),[[Tt,E(r).followPathId,void 0,{number:!0}]])]),T("div",NN,[T("label",DN,[w[89]||(w[89]=T("span",null,"移动时长(秒)",-1)),ce(T("input",{"onUpdate:modelValue":w[35]||(w[35]=b=>E(r).followDuration=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,E(r).followDuration,void 0,{number:!0}]])]),T("label",UN,[w[91]||(w[91]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":w[36]||(w[36]=b=>E(r).followCurveMode=b),class:"inp"},[...w[90]||(w[90]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[Tt,E(r).followCurveMode]])])]),T("label",$N,[ce(T("input",{"onUpdate:modelValue":w[37]||(w[37]=b=>E(r).followPathRotation=b),type:"checkbox"},null,512),[[wt,E(r).followPathRotation]]),w[92]||(w[92]=Rt("方向沿路径",-1))]),w[93]||(w[93]=T("div",{class:"collider-curve-title"},[Rt("移动进度曲线 "),T("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),xe(Zi,{"model-value":E(r).followCurve||E(M),"default-value":E(M),mode:E(t)(E(r).followCurveMode),"onUpdate:modelValue":w[38]||(w[38]=b=>E(r).followCurve=b)},null,8,["model-value","default-value","mode"])],64)):Se("",!0)])],64)):E(o)?(K(),J(Ae,{key:2},[w[104]||(w[104]=T("div",{class:"object-editor-title"},"路径属性",-1)),T("label",XN,[w[95]||(w[95]=T("span",null,"路径名称",-1)),ce(T("input",{"onUpdate:modelValue":w[39]||(w[39]=b=>E(o).name=b),class:"inp"},null,512),[[Ge,E(o).name]])]),T("div",VN,[T("label",YN,[w[96]||(w[96]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[40]||(w[40]=b=>E(o).x=b),type:"number",class:"inp"},null,512),[[Ge,E(o).x,void 0,{number:!0}]])]),T("label",GN,[w[97]||(w[97]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[41]||(w[41]=b=>E(o).y=b),type:"number",class:"inp"},null,512),[[Ge,E(o).y,void 0,{number:!0}]])])]),xe(Fe,{label:"旋转",min:-360,max:360,step:1,modelValue:E(o).rotation,"onUpdate:modelValue":w[42]||(w[42]=b=>E(o).rotation=b)},null,8,["modelValue"]),T("div",jN,[T("label",HN,[w[98]||(w[98]=T("span",null,"缩放 X",-1)),ce(T("input",{"onUpdate:modelValue":w[43]||(w[43]=b=>E(o).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,E(o).scaleX,void 0,{number:!0}]])]),T("label",WN,[w[99]||(w[99]=T("span",null,"缩放 Y",-1)),ce(T("input",{"onUpdate:modelValue":w[44]||(w[44]=b=>E(o).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,E(o).scaleY,void 0,{number:!0}]])])]),T("label",zN,[w[100]||(w[100]=T("span",null,"闭合路径",-1)),ce(T("input",{"onUpdate:modelValue":w[45]||(w[45]=b=>E(o).closed=b),type:"checkbox"},null,512),[[wt,E(o).closed]])]),T("label",qN,[w[101]||(w[101]=T("span",null,"路径颜色",-1)),ce(T("input",{"onUpdate:modelValue":w[46]||(w[46]=b=>E(o).color=b),type:"color",class:"path-color"},null,512),[[Ge,E(o).color]])]),w[105]||(w[105]=Qs('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),T("label",KN,[w[103]||(w[103]=T("span",null,"应用预设形状",-1)),ce(T("select",{"onUpdate:modelValue":w[47]||(w[47]=b=>E(o).preset=b),class:"inp"},[...w[102]||(w[102]=[Qs('',5)])],512),[[Tt,E(o).preset]])]),T("button",{class:"path-action primary",onClick:w[48]||(w[48]=(...b)=>E(v)&&E(v)(...b))},"应用预设"),T("button",{class:"path-action",onClick:w[49]||(w[49]=(...b)=>E(x)&&E(x)(...b))},"清空锚点")],64)):E(a)?(K(),kt(FB,{key:3,"spine-object":E(a)},null,8,["spine-object"])):(K(),J("div",ZN,"使用右上角按钮创建场景对象"))],512),[[ws,!E(l).scene]])]))}}),QN=es(JN,[["__scopeId","data-v-3873124f"]]),eD={class:"group"},tD={class:"caret"},sD={class:"group-body"},iD={class:"segs"},nD={class:"segs stream-behavior-segs"},rD={key:2,class:"stream-loop-options"},oD={class:"loop-section-row"},aD={class:"switch-row"},lD=["checked"],cD={key:0,class:"loop-duration-control"},hD={class:"switch-row loop-duration-toggle"},uD=["checked"],dD={class:"loop-section-duration"},fD=["value"],mD={key:1},pD={key:2,class:"loop-auto-duration"},gD={class:"loop-section-row"},vD={class:"switch-row"},yD=["checked"],xD={key:0,class:"loop-duration-control"},bD={class:"switch-row loop-duration-toggle"},wD=["checked"],SD={class:"loop-section-duration"},MD=["value"],TD={key:1},_D={key:2,class:"loop-auto-duration"},CD={key:3,class:"modifier-hint stream-loop-hint"},AD={class:"group"},ED={class:"caret"},ID={class:"group-body"},RD={class:"row"},PD={class:"row"},kD=["value","disabled"],FD={key:0,class:"row"},OD={class:"row"},LD={key:0,value:"radial"},BD={key:1,value:"path-normal"},ND={key:2,value:"path-tangent"},DD={key:6,class:"switch-row"},UD=Qt({__name:"EmissionSection",setup(i){const{store:e,sys:t,automaticLoopDuration:s,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}=Cr();return(v,x)=>(K(),J(Ae,null,[T("div",eD,[T("div",{class:"group-head",onClick:x[1]||(x[1]=y=>E(o)("emitMode"))},[T("span",tD,be(E(r).emitMode?"▸":"▾"),1),x[36]||(x[36]=T("span",null,"发射模式",-1)),T("button",{class:"group-reset",title:"重置发射模式参数",onClick:x[0]||(x[0]=Je(y=>E(f)("emitMode"),["stop"]))},"重置")]),ce(T("div",sD,[T("div",iD,[T("button",{class:ke(["seg",{on:E(t).config.mode==="stream"}]),onClick:x[2]||(x[2]=y=>E(a)("stream"))},"持续",2),T("button",{class:ke(["seg",{on:E(t).config.mode==="burst"}]),onClick:x[3]||(x[3]=y=>E(a)("burst"))},"爆发",2)]),E(t).config.mode==="stream"?(K(),J(Ae,{key:0},[T("div",nD,[T("button",{class:ke(["seg",{on:E(t).config.streamBehavior==="normal"}]),onClick:x[4]||(x[4]=y=>E(l)("normal"))},"常规持续",2),T("button",{class:ke(["seg",{on:E(t).config.streamBehavior==="loop"}]),onClick:x[5]||(x[5]=y=>E(l)("loop"))},"循环持续",2)]),xe(Fe,{label:"发射速率",min:1,max:300,step:1,modelValue:E(t).config.rate,"onUpdate:modelValue":x[6]||(x[6]=y=>E(t).config.rate=y)},null,8,["modelValue"]),E(t).config.streamBehavior==="normal"?(K(),kt(Fe,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:E(t).config.duration,"onUpdate:modelValue":x[7]||(x[7]=y=>E(t).config.duration=y)},null,8,["modelValue"])):(K(),kt(Fe,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":E(n),"onUpdate:modelValue":E(c)},null,8,["model-value","onUpdate:modelValue"])),E(t).config.streamBehavior==="loop"?(K(),J("div",rD,[T("div",oD,[T("label",aD,[T("input",{type:"checkbox",checked:E(t).config.generateLoopStartAnimation,onChange:x[8]||(x[8]=y=>E(h)("start",y))},null,40,lD),x[37]||(x[37]=T("span",{class:"switch-ui"},null,-1)),x[38]||(x[38]=T("span",null,"生成开始循环动画",-1))]),E(t).config.generateLoopStartAnimation?(K(),J("div",cD,[T("label",hD,[T("input",{type:"checkbox",checked:E(t).config.loopStartUseCustomDuration,onChange:x[9]||(x[9]=y=>E(d)("start",y))},null,40,uD),x[39]||(x[39]=T("span",{class:"switch-ui"},null,-1)),x[40]||(x[40]=T("span",null,"指定时长",-1))]),T("label",dD,[E(t).config.loopStartUseCustomDuration?(K(),J("input",{key:0,value:E(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"开始循环段时长",onChange:x[10]||(x[10]=y=>E(u)("start",y))},null,40,fD)):Se("",!0),E(t).config.loopStartUseCustomDuration?(K(),J("span",mD,"f")):(K(),J("span",pD,"自动 "+be(E(s))+"f",1))])])):Se("",!0)]),T("div",gD,[T("label",vD,[T("input",{type:"checkbox",checked:E(t).config.generateLoopEndAnimation,onChange:x[11]||(x[11]=y=>E(h)("end",y))},null,40,yD),x[41]||(x[41]=T("span",{class:"switch-ui"},null,-1)),x[42]||(x[42]=T("span",null,"生成结束循环动画",-1))]),E(t).config.generateLoopEndAnimation?(K(),J("div",xD,[T("label",bD,[T("input",{type:"checkbox",checked:E(t).config.loopEndUseCustomDuration,onChange:x[12]||(x[12]=y=>E(d)("end",y))},null,40,wD),x[43]||(x[43]=T("span",{class:"switch-ui"},null,-1)),x[44]||(x[44]=T("span",null,"指定时长",-1))]),T("label",SD,[E(t).config.loopEndUseCustomDuration?(K(),J("input",{key:0,value:E(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"结束循环段时长",onChange:x[13]||(x[13]=y=>E(u)("end",y))},null,40,MD)):Se("",!0),E(t).config.loopEndUseCustomDuration?(K(),J("span",TD,"f")):(K(),J("span",_D,"自动 "+be(E(s))+"f",1))])])):Se("",!0)])])):Se("",!0),E(t).config.streamBehavior==="loop"?(K(),J("div",CD,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):Se("",!0)],64)):(K(),kt(Fe,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:E(t).config.burstCount,"onUpdate:modelValue":x[14]||(x[14]=y=>E(t).config.burstCount=y)},null,8,["modelValue"])),xe(Fe,{label:"延迟时间",min:0,max:5,step:.1,modelValue:E(t).config.delay,"onUpdate:modelValue":x[15]||(x[15]=y=>E(t).config.delay=y)},null,8,["modelValue"])],512),[[ws,!E(r).emitMode]])]),T("div",AD,[T("div",{class:"group-head",onClick:x[17]||(x[17]=y=>E(o)("shape"))},[T("span",ED,be(E(r).shape?"▸":"▾"),1),x[45]||(x[45]=T("span",null,"发射器形状",-1)),T("button",{class:"group-reset",title:"重置发射器形状参数",onClick:x[16]||(x[16]=Je(y=>E(f)("shape"),["stop"]))},"重置")]),ce(T("div",ID,[T("label",RD,[x[47]||(x[47]=T("span",null,"形状",-1)),ce(T("select",{"onUpdate:modelValue":x[18]||(x[18]=y=>E(t).config.shape=y),class:"inp",onChange:x[19]||(x[19]=(...y)=>E(m)&&E(m)(...y))},[...x[46]||(x[46]=[Qs('',5)])],544),[[Tt,E(t).config.shape]])]),E(t).config.shape==="circle"||E(t).config.shape==="cone"?(K(),J(Ae,{key:0},[xe(Fe,{label:E(t).config.shape==="cone"?"内径":"内半径",min:0,max:E(t).config.outerRadius,step:1,modelValue:E(t).config.innerRadius,"onUpdate:modelValue":x[20]||(x[20]=y=>E(t).config.innerRadius=y)},null,8,["label","max","modelValue"]),xe(Fe,{label:E(t).config.shape==="cone"?"外径":"外半径",min:E(t).config.innerRadius,max:300,step:1,modelValue:E(t).config.outerRadius,"onUpdate:modelValue":x[21]||(x[21]=y=>E(t).config.outerRadius=y)},null,8,["label","min","modelValue"])],64)):Se("",!0),E(t).config.shape==="cone"?(K(),J(Ae,{key:1},[xe(Fe,{label:"锥形朝向",min:-360,max:360,step:1,modelValue:E(t).config.coneDirection,"onUpdate:modelValue":x[22]||(x[22]=y=>E(t).config.coneDirection=y)},null,8,["modelValue"]),xe(Fe,{label:"锥形开口角度",min:1,max:360,step:1,modelValue:E(t).config.coneAngle,"onUpdate:modelValue":x[23]||(x[23]=y=>E(t).config.coneAngle=y)},null,8,["modelValue"])],64)):E(t).config.shape==="rect"?(K(),J(Ae,{key:2},[xe(Fe,{label:"内宽",min:0,max:E(t).config.outerRectW,step:1,modelValue:E(t).config.innerRectW,"onUpdate:modelValue":x[24]||(x[24]=y=>E(t).config.innerRectW=y)},null,8,["max","modelValue"]),xe(Fe,{label:"内高",min:0,max:E(t).config.outerRectH,step:1,modelValue:E(t).config.innerRectH,"onUpdate:modelValue":x[25]||(x[25]=y=>E(t).config.innerRectH=y)},null,8,["max","modelValue"]),xe(Fe,{label:"外宽",min:E(t).config.innerRectW,max:400,step:1,modelValue:E(t).config.outerRectW,"onUpdate:modelValue":x[26]||(x[26]=y=>E(t).config.outerRectW=y)},null,8,["min","modelValue"]),xe(Fe,{label:"外高",min:E(t).config.innerRectH,max:400,step:1,modelValue:E(t).config.outerRectH,"onUpdate:modelValue":x[27]||(x[27]=y=>E(t).config.outerRectH=y)},null,8,["min","modelValue"])],64)):E(t).config.shape==="path"?(K(),J(Ae,{key:3},[T("label",PD,[x[49]||(x[49]=T("span",null,"选择路径",-1)),ce(T("select",{"onUpdate:modelValue":x[28]||(x[28]=y=>E(t).config.spawnPathId=y),class:"inp",onChange:x[29]||(x[29]=(...y)=>E(g)&&E(g)(...y))},[x[48]||(x[48]=T("option",{value:0},"无路径(点发射)",-1)),(K(!0),J(Ae,null,Ft(E(e).paths,y=>(K(),J("option",{key:y.id,value:y.id,disabled:!y.enabled},be(y.name),9,kD))),128))],544),[[Tt,E(t).config.spawnPathId,void 0,{number:!0}]])]),E(t).config.spawnPathId>0?(K(),J("label",FD,[x[51]||(x[51]=T("span",null,"出生分布",-1)),ce(T("select",{"onUpdate:modelValue":x[30]||(x[30]=y=>E(t).config.spawnPathDistribution=y),class:"inp"},[...x[50]||(x[50]=[T("option",{value:"fixed"},"等间距固定分布",-1),T("option",{value:"random"},"随机分布",-1)])],512),[[Tt,E(t).config.spawnPathDistribution]])])):Se("",!0)],64)):Se("",!0),x[57]||(x[57]=T("div",{class:"divider"},null,-1)),T("label",OD,[x[54]||(x[54]=T("span",null,"发射角度",-1)),ce(T("select",{"onUpdate:modelValue":x[31]||(x[31]=y=>E(t).config.emissionAngleMode=y),class:"inp"},[x[52]||(x[52]=T("option",{value:"fixed"},"固定",-1)),x[53]||(x[53]=T("option",{value:"random"},"随机",-1)),E(t).config.shape==="circle"||E(t).config.shape==="rect"||E(t).config.shape==="cone"?(K(),J("option",LD,"径向(中心向外)")):Se("",!0),E(t).config.shape==="path"&&E(t).config.spawnPathId>0?(K(),J("option",BD,"垂直于路径")):Se("",!0),E(t).config.shape==="path"&&E(t).config.spawnPathId>0?(K(),J("option",ND,"沿路径方向")):Se("",!0)],512),[[Tt,E(t).config.emissionAngleMode]])]),E(t).config.emissionAngleMode==="fixed"?(K(),kt(Fe,{key:4,label:"固定角度",min:-360,max:360,step:1,modelValue:E(t).config.direction,"onUpdate:modelValue":x[32]||(x[32]=y=>E(t).config.direction=y)},null,8,["modelValue"])):E(t).config.emissionAngleMode==="random"?(K(),J(Ae,{key:5},[xe(Fe,{label:"基准角度",min:-360,max:360,step:1,modelValue:E(t).config.direction,"onUpdate:modelValue":x[33]||(x[33]=y=>E(t).config.direction=y)},null,8,["modelValue"]),xe(Fe,{label:"随机范围",min:0,max:360,step:1,modelValue:E(t).config.spread,"onUpdate:modelValue":x[34]||(x[34]=y=>E(t).config.spread=y)},null,8,["modelValue"])],64)):Se("",!0),E(t).config.shape!=="point"?(K(),J("label",DD,[ce(T("input",{type:"checkbox","onUpdate:modelValue":x[35]||(x[35]=y=>E(t).config.showShape=y)},null,512),[[wt,E(t).config.showShape]]),x[55]||(x[55]=T("span",{class:"switch-ui"},null,-1)),x[56]||(x[56]=T("span",null,"显示形状",-1))])):Se("",!0)],512),[[ws,!E(r).shape]])])],64))}}),$D=es(UD,[["__scopeId","data-v-f9eac627"]]),XD={class:"pac"},VD={class:"pac-head"},YD={class:"pac-label"},GD={key:0,class:"pac-modes"},jD=["onClick"],HD={class:"pac-range"},WD={class:"pac-curve"},zD={class:"pac-axis"},qD=Qt({__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(i){const e=i,t=Ye(()=>{const s=[{label:"固定",value:"fixed"},{label:"随机",value:"random"}];return e.allowCurve&&s.push({label:"曲线",value:"curve"}),e.allowDirection&&s.push({label:"发射方向",value:"direction"}),s});return(s,n)=>(K(),J("div",XD,[T("div",VD,[T("span",YD,be(i.label),1),i.showModes?(K(),J("div",GD,[(K(!0),J(Ae,null,Ft(t.value,r=>(K(),J("button",{key:r.value,class:ke(["pac-mode",{on:i.mode===r.value}]),onClick:o=>s.$emit("update:mode",r.value)},be(r.label),11,jD))),128))])):Se("",!0)]),i.mode==="fixed"||i.mode==="direction"?(K(),kt(Fe,{key:0,label:i.mode==="direction"?"角度偏移":"数值",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[0]||(n[0]=r=>s.$emit("update:valueMin",r))},null,8,["label","min","max","step","model-value"])):i.mode==="random"?(K(),J(Ae,{key:1},[xe(Fe,{label:"下限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[1]||(n[1]=r=>s.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),xe(Fe,{label:"上限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":n[2]||(n[2]=r=>s.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])],64)):(K(),J(Ae,{key:2},[T("div",HD,[xe(Fe,{label:"范围下限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[3]||(n[3]=r=>s.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),xe(Fe,{label:"范围上限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":n[4]||(n[4]=r=>s.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])]),T("div",WD,[xe(Zi,{"model-value":i.curve,"default-value":i.defaultCurve,"onUpdate:modelValue":n[5]||(n[5]=r=>s.$emit("update:curve",r))},null,8,["model-value","default-value"]),T("div",zD,[n[6]||(n[6]=T("span",null,"0",-1)),T("span",null,be(i.curveLabel),1),n[7]||(n[7]=T("span",null,"1",-1))])])],64))]))}}),yn=es(qD,[["__scopeId","data-v-238f838c"]]),KD={class:"group"},ZD={class:"caret"},JD={class:"group-body attr-body"},QD={class:"attr-axis-head"},e4={class:"axis-modes"},t4={class:"life-item"},s4={class:"switch-row"},i4={class:"life-item"},n4={class:"switch-row"},r4={class:"axis-modes life-axis"},o4={class:"life-item"},a4={class:"switch-row"},l4=Qt({__name:"ParticleAttributesSection",setup(i){const{sys:e,collapsed:t,toggle:s,resetModule:n,setSpeedOverLifeMode:r,prepareScaleOverLifeCurve:o,setScaleOverLifeMode:a,LINEAR_CURVE:c,FLAT_CURVE:l}=Cr();return(h,u)=>(K(),J("div",KD,[T("div",{class:"group-head",onClick:u[1]||(u[1]=d=>E(s)("attr"))},[T("span",ZD,be(E(t).attr?"▸":"▾"),1),u[44]||(u[44]=T("span",null,"粒子属性",-1)),T("button",{class:"group-reset",title:"重置粒子属性参数",onClick:u[0]||(u[0]=Je(d=>E(n)("attr"),["stop"]))},"重置")]),ce(T("div",JD,[u[52]||(u[52]=T("div",{class:"attr-section-title"},"粒子初始参数",-1)),xe(yn,{label:"初始生命周期","allow-curve":!1,mode:E(e).config.lifeMode,"onUpdate:mode":u[2]||(u[2]=d=>E(e).config.lifeMode=d),"value-min":E(e).config.lifeMin,"onUpdate:valueMin":u[3]||(u[3]=d=>E(e).config.lifeMin=d),"value-max":E(e).config.lifeMax,"onUpdate:valueMax":u[4]||(u[4]=d=>E(e).config.lifeMax=d),curve:E(e).config.lifeCurve,"onUpdate:curve":u[5]||(u[5]=d=>E(e).config.lifeCurve=d),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),xe(yn,{label:"初始速度","allow-curve":!1,mode:E(e).config.speedMode,"onUpdate:mode":u[6]||(u[6]=d=>E(e).config.speedMode=d),"value-min":E(e).config.speedMin,"onUpdate:valueMin":u[7]||(u[7]=d=>E(e).config.speedMin=d),"value-max":E(e).config.speedMax,"onUpdate:valueMax":u[8]||(u[8]=d=>E(e).config.speedMax=d),curve:E(e).config.speedCurve,"onUpdate:curve":u[9]||(u[9]=d=>E(e).config.speedCurve=d),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),T("div",QD,[u[45]||(u[45]=T("span",null,"初始缩放",-1)),T("div",e4,[T("button",{class:ke(["axis-mode",{on:E(e).config.scaleAxisMode==="uniform"}]),onClick:u[10]||(u[10]=d=>E(e).config.scaleAxisMode="uniform")},"统一",2),T("button",{class:ke(["axis-mode",{on:E(e).config.scaleAxisMode==="separate"}]),onClick:u[11]||(u[11]=d=>E(e).config.scaleAxisMode="separate")},"XY分离",2)])]),xe(yn,{label:E(e).config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:E(e).config.scaleMode,"onUpdate:mode":u[12]||(u[12]=d=>E(e).config.scaleMode=d),"value-min":E(e).config.scaleMin,"onUpdate:valueMin":u[13]||(u[13]=d=>E(e).config.scaleMin=d),"value-max":E(e).config.scaleMax,"onUpdate:valueMax":u[14]||(u[14]=d=>E(e).config.scaleMax=d),curve:E(e).config.scaleCurve,"onUpdate:curve":u[15]||(u[15]=d=>E(e).config.scaleCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),E(e).config.scaleAxisMode==="separate"?(K(),kt(yn,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:E(e).config.scaleMode,"onUpdate:mode":u[16]||(u[16]=d=>E(e).config.scaleMode=d),"value-min":E(e).config.scaleYMin,"onUpdate:valueMin":u[17]||(u[17]=d=>E(e).config.scaleYMin=d),"value-max":E(e).config.scaleYMax,"onUpdate:valueMax":u[18]||(u[18]=d=>E(e).config.scaleYMax=d),curve:E(e).config.scaleYCurve,"onUpdate:curve":u[19]||(u[19]=d=>E(e).config.scaleYCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):Se("",!0),xe(yn,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:E(e).config.initialRotationMode,"onUpdate:mode":u[20]||(u[20]=d=>E(e).config.initialRotationMode=d),"value-min":E(e).config.initialRotationMin,"onUpdate:valueMin":u[21]||(u[21]=d=>E(e).config.initialRotationMin=d),"value-max":E(e).config.initialRotationMax,"onUpdate:valueMax":u[22]||(u[22]=d=>E(e).config.initialRotationMax=d),curve:E(e).config.initialRotationCurve,"onUpdate:curve":u[23]||(u[23]=d=>E(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",t4,[T("label",s4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[24]||(u[24]=d=>E(e).config.speedOverLifeEnabled=d)},null,512),[[wt,E(e).config.speedOverLifeEnabled]]),u[46]||(u[46]=T("span",{class:"switch-ui"},null,-1)),u[47]||(u[47]=T("span",null,"生命周期内速度",-1))]),E(e).config.speedOverLifeEnabled?(K(),kt(yn,{key:0,label:"速度倍率",mode:E(e).config.speedOverLifeMode,"onUpdate:mode":E(r),"value-min":E(e).config.speedOverLifeMin,"onUpdate:valueMin":u[25]||(u[25]=d=>E(e).config.speedOverLifeMin=d),"value-max":E(e).config.speedOverLifeMax,"onUpdate:valueMax":u[26]||(u[26]=d=>E(e).config.speedOverLifeMax=d),curve:E(e).config.speedOverLifeCurve,"onUpdate:curve":u[27]||(u[27]=d=>E(e).config.speedOverLifeCurve=d),"default-curve":E(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","onUpdate:mode","value-min","value-max","curve","default-curve"])):Se("",!0)]),T("div",i4,[T("label",n4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[28]||(u[28]=d=>E(e).config.scaleOverLifeEnabled=d),onChange:u[29]||(u[29]=(...d)=>E(o)&&E(o)(...d))},null,544),[[wt,E(e).config.scaleOverLifeEnabled]]),u[48]||(u[48]=T("span",{class:"switch-ui"},null,-1)),u[49]||(u[49]=T("span",null,"生命周期内缩放",-1))]),E(e).config.scaleOverLifeEnabled?(K(),J(Ae,{key:0},[T("div",r4,[T("button",{class:ke(["axis-mode",{on:E(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:u[30]||(u[30]=d=>E(e).config.scaleOverLifeAxisMode="uniform")},"统一",2),T("button",{class:ke(["axis-mode",{on:E(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:u[31]||(u[31]=d=>E(e).config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),xe(yn,{label:E(e).config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:E(e).config.scaleOverLifeMode,"onUpdate:mode":E(a),"value-min":E(e).config.scaleOverLifeMin,"onUpdate:valueMin":u[32]||(u[32]=d=>E(e).config.scaleOverLifeMin=d),"value-max":E(e).config.scaleOverLifeMax,"onUpdate:valueMax":u[33]||(u[33]=d=>E(e).config.scaleOverLifeMax=d),curve:E(e).config.scaleOverLifeCurve,"onUpdate:curve":u[34]||(u[34]=d=>E(e).config.scaleOverLifeCurve=d),"default-curve":E(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve"]),E(e).config.scaleOverLifeAxisMode==="separate"?(K(),kt(yn,{key:0,label:"倍率 Y","show-modes":!1,mode:E(e).config.scaleOverLifeMode,"onUpdate:mode":u[35]||(u[35]=d=>E(e).config.scaleOverLifeMode=d),"value-min":E(e).config.scaleYOverLifeMin,"onUpdate:valueMin":u[36]||(u[36]=d=>E(e).config.scaleYOverLifeMin=d),"value-max":E(e).config.scaleYOverLifeMax,"onUpdate:valueMax":u[37]||(u[37]=d=>E(e).config.scaleYOverLifeMax=d),curve:E(e).config.scaleYOverLifeCurve,"onUpdate:curve":u[38]||(u[38]=d=>E(e).config.scaleYOverLifeCurve=d),"default-curve":E(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):Se("",!0)],64)):Se("",!0)]),T("div",o4,[T("label",a4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[39]||(u[39]=d=>E(e).config.rotationOverLifeEnabled=d)},null,512),[[wt,E(e).config.rotationOverLifeEnabled]]),u[50]||(u[50]=T("span",{class:"switch-ui"},null,-1)),u[51]||(u[51]=T("span",null,"生命周期内旋转",-1))]),E(e).config.rotationOverLifeEnabled?(K(),kt(yn,{key:0,label:"旋转速度",mode:E(e).config.rotationOverLifeMode,"onUpdate:mode":u[40]||(u[40]=d=>E(e).config.rotationOverLifeMode=d),"value-min":E(e).config.rotationSpeedMin,"onUpdate:valueMin":u[41]||(u[41]=d=>E(e).config.rotationSpeedMin=d),"value-max":E(e).config.rotationSpeedMax,"onUpdate:valueMax":u[42]||(u[42]=d=>E(e).config.rotationSpeedMax=d),curve:E(e).config.rotationOverLifeCurve,"onUpdate:curve":u[43]||(u[43]=d=>E(e).config.rotationOverLifeCurve=d),"default-curve":E(c),min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):Se("",!0)])],512),[[ws,!E(t).attr]])]))}}),c4=es(l4,[["__scopeId","data-v-cf6b86a5"]]),h4={class:"gradient-editor"},u4=["title","onClick","onDblclick","onPointerdown"],d4={key:0,class:"gradient-controls"},f4=["value"],m4=["value"],p4={class:"gradient-position"},g4=["value"],v4=["disabled"],y4=Qt({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=$e(null),r=$e(0),o=Ye(()=>t.modelValue[r.value]||null),a=Ye(()=>[...t.modelValue].sort((C,R)=>C.position-R.position)),c=Ye(()=>{const C=a.value;return C.length?`linear-gradient(90deg, ${C.map(R=>`${R.color} ${l(R.position)*100}%`).join(", ")})`:"#ffffff"});Ls(()=>t.modelValue.length,C=>{r.value>=C&&(r.value=Math.max(0,C-1))});function l(C){return Math.min(1,Math.max(0,Number(C)||0))}function h(){return t.modelValue.map(C=>({position:l(C.position),color:C.color}))}function u(C,R){const F=h();F[C]&&(F[C]={...F[C],...R},s("update:modelValue",F))}function d(C){u(r.value,{color:C.target.value})}function f(C){var I;const R=C.target,F=b(R.value,((I=o.value)==null?void 0:I.color)||"#ffffff");R.value=F,u(r.value,{color:F})}function p(C){const R=C.target;f(C),R.blur()}function m(C){const R=Number(C.target.value);Number.isFinite(R)&&u(r.value,{position:l(R/100)})}function g(C){const R=h();R.push({position:l(C),color:_(R,C)}),r.value=R.length-1,s("update:modelValue",R)}function v(C){if(!n.value)return;const R=n.value.getBoundingClientRect();g((C.clientX-R.left)/Math.max(1,R.width))}function x(){const C=a.value;let R=.5;if(C.length>1){let F=-1;for(let I=0;IF&&(F=k,R=(C[I].position+C[I+1].position)/2)}}g(R)}function y(C){if(t.modelValue.length<=2||C<0)return;const R=h().filter((F,I)=>I!==C);r.value=Math.min(C,R.length-1),s("update:modelValue",R)}function M(C,R){if(!n.value)return;r.value=R;const F=k=>{const B=n.value.getBoundingClientRect();u(R,{position:l((k.clientX-B.left)/Math.max(1,B.width))})},I=()=>{window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",I),window.removeEventListener("pointercancel",I)};window.addEventListener("pointermove",F),window.addEventListener("pointerup",I),window.addEventListener("pointercancel",I),C.preventDefault()}function _(C,R){const F=[...C].sort((I,k)=>I.position-k.position);if(!F.length)return"#ffffff";if(R<=F[0].position)return F[0].color;if(R>=F[F.length-1].position)return F[F.length-1].color;for(let I=0;IB.position)continue;const D=(R-k.position)/Math.max(1e-4,B.position-k.position);return w(k.color,B.color,D)}return F[F.length-1].color}function w(C,R,F){const I=$=>{const N=parseInt($.replace("#","").padEnd(6,"0").slice(0,6),16);return[N>>16&255,N>>8&255,N&255]},k=I(C),B=I(R),D=$=>Math.round(k[$]+(B[$]-k[$])*F);return`#${[D(0),D(1),D(2)].map($=>$.toString(16).padStart(2,"0")).join("")}`}function b(C,R){let F=C.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(F)&&(F=F.split("").map(I=>I+I).join("")),/^[0-9a-f]{6}$/i.test(F)?`#${F.toLowerCase()}`:R}return(C,R)=>(K(),J("div",h4,[T("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:vs({background:c.value}),title:"双击色带添加色标",onDblclick:v},[(K(!0),J(Ae,null,Ft(i.modelValue,(F,I)=>(K(),J("button",{key:I,type:"button",class:ke(["gradient-stop",{selected:I===r.value}]),style:vs({left:`${l(F.position)*100}%`,"--stop-color":F.color}),title:`${Math.round(l(F.position)*100)}% · ${F.color}`,onClick:Je(k=>r.value=I,["stop"]),onDblclick:Je(k=>y(I),["stop"]),onPointerdown:Je(k=>M(k,I),["stop"])},null,46,u4))),128))],36),o.value?(K(),J("div",d4,[T("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":"色标颜色",onInput:d},null,40,f4),T("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:f,onKeydown:vr(p,["enter"])},null,40,m4),T("label",p4,[T("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":"色标位置",onInput:m},null,40,g4),R[1]||(R[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:i.modelValue.length<=2,onClick:R[0]||(R[0]=F=>y(r.value))},"×",8,v4)])):Se("",!0),R[2]||(R[2]=T("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),ES=es(y4,[["__scopeId","data-v-f6ab10bf"]]),x4={class:"image-card"},b4={class:"imgrow"},w4=["title"],S4=["src","alt"],M4={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},T4={class:"img-fields"},_4={key:0,class:"row"},C4={class:"row"},A4=["placeholder"],E4={class:"img-actions"},I4=["title"],R4=["disabled"],P4={class:"thumb-note"},k4={key:0,class:"row"},F4={class:"row"},O4={class:"row"},L4={class:"sequence-note"},B4={class:"resource-weight-row"},N4=["disabled","title"],D4={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},U4={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},$4=Qt({__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(i,{emit:e}){const t=i,s=e,n=Ye(()=>{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=Ye(()=>{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=Ye(()=>{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"?s("pickSequence",t.resource.id):s("pick",t.resource.id)}return(c,l)=>(K(),J("div",x4,[T("div",b4,[T("button",{class:"img-thumb",title:i.supportsSequence&&i.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:a},[r.value?(K(),J("img",{key:0,src:r.value,alt:i.resource.textureName},null,8,S4)):(K(),J("svg",M4,[...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,w4),T("div",T4,[i.showFolder?(K(),J("label",_4,[l[11]||(l[11]=T("span",null,"子文件夹",-1)),ce(T("input",{"onUpdate:modelValue":l[0]||(l[0]=h=>i.resource.textureFolder=h),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[Ge,i.resource.textureFolder]])])):Se("",!0),T("label",C4,[l[12]||(l[12]=T("span",null,"名称",-1)),ce(T("input",{"onUpdate:modelValue":l[1]||(l[1]=h=>i.resource.textureName=h),type:"text",class:"inp",placeholder:i.namePlaceholder},null,8,A4),[[Ge,i.resource.textureName]])])]),T("div",E4,[T("button",{class:"mini-btn2",title:`恢复 ${i.defaultFile}`,onClick:l[2]||(l[2]=h=>c.$emit("reset",i.resource.id))},"⟳",8,I4),T("button",{class:"mini-btn2",title:"删除图片资源",disabled:i.resourceCount===1,onClick:l[3]||(l[3]=h=>c.$emit("remove",i.resource.id))},"🗑",8,R4)])]),T("div",P4,be(n.value),1),i.supportsSequence?(K(),J("label",k4,[l[14]||(l[14]=T("span",null,"图片模式",-1)),ce(T("select",{"onUpdate:modelValue":l[4]||(l[4]=h=>i.resource.imageMode=h),class:"inp"},[...l[13]||(l[13]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"sequence"},"序列帧",-1)])],512),[[Tt,i.resource.imageMode]])])):Se("",!0),i.supportsSequence&&i.resource.imageMode==="sequence"?(K(),J(Ae,{key:1},[T("label",F4,[l[16]||(l[16]=T("span",null,"播放模式",-1)),ce(T("select",{"onUpdate:modelValue":l[5]||(l[5]=h=>i.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),[[Tt,i.resource.sequencePlayback]])]),T("label",O4,[l[17]||(l[17]=T("span",null,"播放帧率",-1)),ce(T("input",{"onUpdate:modelValue":l[6]||(l[6]=h=>i.resource.sequenceFps=h),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[Ge,i.resource.sequenceFps,void 0,{number:!0}]])]),T("button",{class:"sequence-pick",onClick:l[7]||(l[7]=h=>c.$emit("pickSequence",i.resource.id))},"选择序列帧(多选)"),T("div",L4,be(o.value),1)],64)):Se("",!0),T("div",B4,[xe(Fe,{class:"resource-weight-control",label:"占比%",min:0,max:100,step:1,"model-value":i.resource.weight,disabled:i.resource.locked||i.resourceCount===1,"onUpdate:modelValue":l[8]||(l[8]=h=>c.$emit("updateWeight",i.resource.id,h))},null,8,["model-value","disabled"]),T("button",{class:ke(["weight-lock",{on:i.resource.locked}]),disabled:i.resourceCount===1,title:i.resource.locked?"解除占比锁定":"锁定当前占比",onClick:l[9]||(l[9]=h=>c.$emit("toggleLock",i.resource.id))},[i.resource.locked?(K(),J("svg",D4,[...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(),J("svg",U4,[...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,N4)]),ZM(c.$slots,"default",{},void 0)]))}}),IS=es($4,[["__scopeId","data-v-68ff5314"]]),X4={class:"group"},V4={class:"caret"},Y4={class:"group-body"},G4={class:"seg"},j4={class:"row"},H4={class:"curve-wrap"},W4={class:"seg"},z4={class:"row"},q4=["value"],K4={value:0},Z4=["value"],J4={class:"render-layer-current"},Q4=["title"],e5={key:0,class:"slot-picker"},t5={class:"slot-list"},s5=["onClick"],i5={class:"slot-order"},n5={class:"slot-name"},r5={class:"slot-attachment"},o5={key:0,class:"modifier-hint"},a5={class:"seg"},l5={class:"switch-row render-layer-switch"},c5=["disabled"],h5={key:0,class:"modifier-hint"},u5={key:2,class:"modifier-hint render-layer-warning"},d5={class:"look-title image-title"},f5={class:"row"},m5=["onUpdate:modelValue"],p5=["onUpdate:modelValue"],g5={class:"row resource-color-row"},v5=["onUpdate:modelValue"],y5=["onUpdate:modelValue"],x5={key:0,class:"row resource-color-picker"},b5=["onUpdate:modelValue"],w5=["value","onChange","onKeydown"],S5={key:0,class:"random-color-hint"},M5={class:"resource-alpha-head"},T5={class:"alpha-modes"},_5=["onClick"],C5=["onClick"],A5=["onClick"],E5={class:"row"},I5=["onUpdate:modelValue"],R5={class:"resource-alpha-curve"},P5=Qt({__name:"ParticleAppearanceSection",setup(i){const{resolvedCurveEditorMode:e,sys:t,textureFileInput:s,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,renderLayerSlotPickerOpen:M,renderLayerSlotSearch:_,renderLayerReadySpines:w,renderLayerSpineReady:b,renderLayerFilteredSlots:C,renderLayerSlotLabel:R,renderLayerResolvedLabel:F,renderLayerWarning:I,setRenderLayerSlotMode:k,selectRenderLayerSpine:B,pickRenderLayerSlot:D,clearRenderLayerSlot:$,ALPHA_CURVE:N,RESOURCE_ALPHA_CURVE:X}=Cr();return(A,P)=>(K(),J("div",X4,[T("div",{class:"group-head",onClick:P[1]||(P[1]=O=>E(v)("look"))},[T("span",V4,be(E(g).look?"▸":"▾"),1),P[19]||(P[19]=T("span",null,"外观与资源",-1)),T("button",{class:"group-reset",title:"重置外观与资源参数",onClick:P[0]||(P[0]=Je(O=>E(x)("look"),["stop"]))},"重置")]),ce(T("div",Y4,[P[37]||(P[37]=T("div",{class:"look-title"},"透明度",-1)),T("div",G4,[T("button",{class:ke(["seg-btn",{active:E(t).config.alphaMode==="curve"}]),onClick:P[2]||(P[2]=O=>E(t).config.alphaMode="curve")},"曲线",2),T("button",{class:ke(["seg-btn",{active:E(t).config.alphaMode==="fixed"}]),onClick:P[3]||(P[3]=O=>E(t).config.alphaMode="fixed")},"固定",2)]),E(t).config.alphaMode==="fixed"?(K(),kt(Fe,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:E(t).config.alpha,"onUpdate:modelValue":P[4]||(P[4]=O=>E(t).config.alpha=O)},null,8,["modelValue"])):(K(),J(Ae,{key:1},[T("label",j4,[P[21]||(P[21]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":P[5]||(P[5]=O=>E(t).config.curveMode=O),class:"inp"},[...P[20]||(P[20]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[Tt,E(t).config.curveMode]])]),T("div",H4,[xe(Zi,{modelValue:E(t).config.alphaCurve,"onUpdate:modelValue":P[6]||(P[6]=O=>E(t).config.alphaCurve=O),"default-value":E(N),mode:E(e)(E(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),P[22]||(P[22]=T("div",{class:"curve-labels"},[T("span",null,"0(透明)"),T("span",null,"生命周期 →"),T("span",null,"1(不透明)")],-1))])],64)),P[38]||(P[38]=T("div",{class:"look-title"},"渲染层级(Spine 插槽)",-1)),T("div",W4,[T("button",{class:ke(["seg-btn",{active:E(t).config.renderLayerMode==="top"}]),onClick:P[7]||(P[7]=O=>E(t).config.renderLayerMode="top")},"最上层",2),T("button",{class:ke(["seg-btn",{active:E(t).config.renderLayerMode==="slot"}]),onClick:P[8]||(P[8]=(...O)=>E(k)&&E(k)(...O))},"Spine 插槽",2)]),E(t).config.renderLayerMode==="slot"?(K(),J(Ae,{key:2},[T("label",z4,[P[23]||(P[23]=T("span",null,"Spine",-1)),T("select",{class:"inp",value:E(t).config.renderLayerSpineId,onChange:P[9]||(P[9]=(...O)=>E(B)&&E(B)(...O))},[T("option",K4,be(E(w).length?"请选择 Spine":"无可用 Spine"),1),(K(!0),J(Ae,null,Ft(E(w),O=>(K(),J("option",{key:O.id,value:O.id},be(O.name),9,Z4))),128))],40,q4)]),E(b)?(K(),J(Ae,{key:0},[T("div",J4,[T("span",{class:"render-layer-text",title:E(R)},be(E(R)||"尚未选择插槽"),9,Q4),T("button",{class:"mini-btn",onClick:P[10]||(P[10]=O=>M.value=!E(M))},be(E(R)?"重新选择":"选择插槽"),1),E(t).config.renderLayerSlotName?(K(),J("button",{key:0,class:"mini-btn ghost",onClick:P[11]||(P[11]=(...O)=>E($)&&E($)(...O))},"清除")):Se("",!0)]),E(M)?(K(),J("div",e5,[ce(T("input",{"onUpdate:modelValue":P[12]||(P[12]=O=>Vt(_)?_.value=O:null),class:"inp",type:"search",placeholder:"搜索插槽或附件名称…","aria-label":"搜索插槽"},null,512),[[Ge,E(_),void 0,{trim:!0}]]),T("div",t5,[(K(!0),J(Ae,null,Ft(E(C),O=>(K(),J("button",{key:O.name,class:ke(["slot-item",{on:E(t).config.renderLayerSlotName===O.name}]),onClick:L=>E(D)(O)},[T("span",i5,be(O.order+1),1),T("span",n5,be(O.name),1),T("span",r5,be(O.attachment||"空插槽"),1)],10,s5))),128)),E(C).length?Se("",!0):(K(),J("div",o5,"没有匹配的插槽"))])])):Se("",!0),E(t).config.renderLayerSlotName?(K(),J(Ae,{key:1},[T("div",a5,[T("button",{class:ke(["seg-btn",{active:E(t).config.renderLayerSlotPosition==="above"}]),onClick:P[13]||(P[13]=O=>E(t).config.renderLayerSlotPosition="above")},"在此插槽图片之上",2),T("button",{class:ke(["seg-btn",{active:E(t).config.renderLayerSlotPosition==="below"}]),onClick:P[14]||(P[14]=O=>E(t).config.renderLayerSlotPosition="below")},"在此插槽图片之下",2)]),T("label",l5,[ce(T("input",{"onUpdate:modelValue":P[15]||(P[15]=O=>E(t).config.renderLayerFollowAttachment=O),type:"checkbox",disabled:E(t).config.renderLayerSlotPosition==="below"},null,8,c5),[[wt,E(t).config.renderLayerFollowAttachment]]),P[24]||(P[24]=T("span",{class:"switch-ui"},null,-1)),P[25]||(P[25]=T("span",null,"随插槽附件显隐",-1))]),E(F)?(K(),J("div",h5,be(E(F)),1)):Se("",!0)],64)):Se("",!0),E(I)?(K(),J("div",u5,be(E(I)),1)):Se("",!0),P[26]||(P[26]=T("div",{class:"modifier-hint"},"调整显示层级只影响编辑器预览,不影响导出数据。",-1))],64)):Se("",!0)],64)):Se("",!0),T("div",d5,[P[27]||(P[27]=T("span",null,"图片资源",-1)),T("button",{class:"image-add",title:"新增图片资源",onClick:P[16]||(P[16]=(...O)=>E(r)&&E(r)(...O))},"+")]),(K(!0),J(Ae,null,Ft(E(t).config.imageResources,O=>(K(),kt(IS,{key:O.id,resource:O,"resource-count":E(t).config.imageResources.length,"supports-sequence":"","default-file":"star.png",onPick:E(o),onPickSequence:E(a),onReset:E(h),onRemove:E(f),onUpdateWeight:E(p),onToggleLock:E(m)},{default:jh(()=>[xe(Fe,{label:"缩放",min:.1,max:3,step:.05,modelValue:O.scale,"onUpdate:modelValue":L=>O.scale=L},null,8,["modelValue","onUpdate:modelValue"]),T("label",f5,[P[28]||(P[28]=T("span",null,"轴心 x,y",-1)),ce(T("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":L=>O.anchorX=L},null,8,m5),[[Ge,O.anchorX,void 0,{number:!0}]]),ce(T("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":L=>O.anchorY=L},null,8,p5),[[Ge,O.anchorY,void 0,{number:!0}]])]),P[36]||(P[36]=T("div",{class:"resource-divider"},null,-1)),T("label",g5,[P[31]||(P[31]=T("span",null,"颜色",-1)),ce(T("select",{"onUpdate:modelValue":L=>O.colorMode=L,class:"inp"},[...P[29]||(P[29]=[T("option",{value:"fixed"},"固定色",-1),T("option",{value:"random"},"随机颜色",-1),T("option",{value:"lifetime"},"生命周期",-1)])],8,v5),[[Tt,O.colorMode]]),ce(T("select",{"onUpdate:modelValue":L=>O.blend=L,class:"inp blend-select"},[...P[30]||(P[30]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,y5),[[Tt,O.blend]])]),O.colorMode==="fixed"?(K(),J("label",x5,[P[32]||(P[32]=T("span",null,"固定色",-1)),ce(T("input",{type:"color","onUpdate:modelValue":L=>O.colorStart=L,class:"colr"},null,8,b5),[[Ge,O.colorStart]]),T("input",{type:"text",class:"hex-input",value:O.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:L=>E(u)(O,L),onKeydown:vr(L=>E(d)(O,L),["enter"])},null,40,w5)])):(K(),J(Ae,{key:1},[xe(ES,{modelValue:O.colorGradient,"onUpdate:modelValue":L=>O.colorGradient=L},null,8,["modelValue","onUpdate:modelValue"]),O.colorMode==="random"?(K(),J("div",S5,"每个粒子出生时从色带随机取色,生命周期内保持不变")):Se("",!0)],64)),T("div",M5,[P[33]||(P[33]=T("span",null,"独立透明度",-1)),T("div",T5,[T("button",{class:ke({on:O.independentAlpha==="off"}),onClick:L=>O.independentAlpha="off"},"关闭",10,_5),T("button",{class:ke({on:O.independentAlpha==="fixed"}),onClick:L=>O.independentAlpha="fixed"},"固定",10,C5),T("button",{class:ke({on:O.independentAlpha==="curve"}),onClick:L=>O.independentAlpha="curve"},"曲线",10,A5)])]),O.independentAlpha==="fixed"?(K(),kt(Fe,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:O.alpha,"onUpdate:modelValue":L=>O.alpha=L},null,8,["modelValue","onUpdate:modelValue"])):O.independentAlpha==="curve"?(K(),J(Ae,{key:3},[T("label",E5,[P[35]||(P[35]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":L=>O.alphaCurveMode=L,class:"inp"},[...P[34]||(P[34]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],8,I5),[[Tt,O.alphaCurveMode]])]),T("div",R5,[xe(Zi,{modelValue:O.alphaCurve,"onUpdate:modelValue":L=>O.alphaCurve=L,"default-value":E(X),mode:E(e)(O.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):Se("",!0)]),_:2},1032,["resource","resource-count","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"textureFileInput",ref:s,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:P[17]||(P[17]=(...O)=>E(c)&&E(c)(...O))},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:P[18]||(P[18]=(...O)=>E(l)&&E(l)(...O))},null,544)],512),[[ws,!E(g).look]])]))}}),k5=es(P5,[["__scopeId","data-v-07642cd0"]]),F5={class:"group"},O5={class:"caret"},L5={class:"group-body"},B5={class:"modifier-item"},N5={class:"switch-row modifier-switch"},D5={key:0,class:"modifier-params"},U5={class:"modifier-item"},$5={class:"switch-row modifier-switch"},X5={key:0,class:"modifier-params gravity-params"},V5={class:"modifier-mode-row"},Y5={class:"modifier-item"},G5={class:"switch-row modifier-switch"},j5={key:0,class:"modifier-params gravity-params"},H5={class:"modifier-mode-row"},W5={class:"modifier-item"},z5={class:"switch-row modifier-switch"},q5={key:0,class:"modifier-params"},K5={class:"row"},Z5={class:"switch-row"},J5={class:"modifier-item"},Q5={class:"switch-row modifier-switch"},e8={key:0,class:"modifier-params"},t8={class:"row"},s8={class:"switch-row"},i8={class:"modifier-item"},n8={class:"switch-row modifier-switch"},r8={key:0,class:"modifier-params"},o8={class:"row"},a8={class:"row"},l8={class:"switch-row"},c8={class:"modifier-item"},h8={class:"switch-row modifier-switch"},u8={key:0,class:"modifier-params trail-params"},d8={class:"trail-section-head"},f8={class:"row"},m8=["onUpdate:modelValue"],p8={class:"row"},g8=["onUpdate:modelValue"],v8={class:"row"},y8=["onUpdate:modelValue"],x8={class:"switch-row trail-sub-switch"},b8=["onUpdate:modelValue"],w8={class:"switch-row trail-sub-switch"},S8=["onUpdate:modelValue"],M8={class:"trail-mode-head"},T8={class:"alpha-modes"},_8=["onClick"],C8=["onClick"],A8=["onClick"],E8={class:"row"},I8=["onUpdate:modelValue"],R8={key:6,class:"row trail-fixed-color"},P8=["onUpdate:modelValue"],k8=["value","onChange","onKeydown"],F8={class:"trail-mode-head"},O8={class:"alpha-modes"},L8=["onClick"],B8=["onClick"],N8=["onClick"],D8={class:"trail-grid-row"},U8={class:"modifier-item"},$8={class:"switch-row modifier-switch"},X8=["disabled"],V8={key:0,class:"modifier-params emitter-follow-params"},Y8={class:"field-block"},G8=["value"],j8={key:0,value:"bone"},H8={class:"field-block"},W8=["value"],z8={class:"field-block"},q8={class:"field-grid follow-grid"},K8={class:"compact-field"},Z8={class:"compact-field"},J8={class:"field-block"},Q8={key:0,class:"bone-follow-target"},eU={key:1,class:"bone-follow-missing"},tU={class:"field-block"},sU={class:"field-grid follow-grid"},iU={class:"compact-field"},nU={class:"compact-field"},rU={class:"bone-follow-transform-grid"},oU={class:"compact-field"},aU={class:"compact-field"},lU={class:"compact-field"},cU={class:"modifier-item"},hU={class:"switch-row modifier-switch"},uU={key:0,class:"modifier-params collision-filter-params"},dU={class:"collision-filter-tags"},fU=["title"],mU=["aria-label","onClick"],pU=["disabled","title"],gU={key:0,class:"collision-filter-empty"},vU={key:1,class:"collision-filter-picker"},yU=["onClick"],xU=Qt({__name:"ParticleModifiersSection",setup(i){const{store:e,sys:t,trailTextureFileInput:s,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:M,addCollisionBody:_,removeCollisionBody:w,collapsed:b,toggle:C,onEmitterFollowModeChange:R,bindSelectedBone:F,resetModule:I,select:k,LINEAR_CURVE:B,FLAT_CURVE:D,TRAIL_ALPHA_CURVE:$,TRAIL_SHAPE_CURVE:N}=Cr();return(X,A)=>(K(),J("div",F5,[T("div",{class:"group-head",onClick:A[1]||(A[1]=P=>E(C)("mods"))},[T("span",O5,be(E(b).mods?"▸":"▾"),1),A[69]||(A[69]=T("span",null,"修改器",-1)),T("button",{class:"group-reset",title:"重置修改器参数",onClick:A[0]||(A[0]=Je(P=>E(I)("mods"),["stop"]))},"重置")]),ce(T("div",L5,[T("div",B5,[T("label",N5,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[2]||(A[2]=P=>E(t).config.noise=P)},null,512),[[wt,E(t).config.noise]]),A[70]||(A[70]=T("span",{class:"switch-ui"},null,-1)),A[71]||(A[71]=T("span",null,"开启移动噪声",-1))]),E(t).config.noise?(K(),J("div",D5,[xe(Fe,{label:"强度",min:0,max:100,step:1,modelValue:E(t).config.noiseAmt,"onUpdate:modelValue":A[3]||(A[3]=P=>E(t).config.noiseAmt=P)},null,8,["modelValue"]),xe(Fe,{label:"波动范围",min:0,max:500,step:1,modelValue:E(t).config.noiseRange,"onUpdate:modelValue":A[4]||(A[4]=P=>E(t).config.noiseRange=P)},null,8,["modelValue"]),xe(Fe,{label:"时间流速",min:0,max:10,step:.1,modelValue:E(t).config.noiseSpeed,"onUpdate:modelValue":A[5]||(A[5]=P=>E(t).config.noiseSpeed=P)},null,8,["modelValue"]),A[72]||(A[72]=T("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):Se("",!0)]),T("div",U5,[T("label",$5,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[6]||(A[6]=P=>E(t).config.useGravity=P)},null,512),[[wt,E(t).config.useGravity]]),A[73]||(A[73]=T("span",{class:"switch-ui"},null,-1)),A[74]||(A[74]=T("span",null,"开启重力",-1))]),E(t).config.useGravity?(K(),J("div",X5,[T("div",V5,[T("button",{class:ke(["axis-mode",{on:E(t).config.gravityMode==="fixed"}]),onClick:A[7]||(A[7]=P=>E(t).config.gravityMode="fixed")},"固定",2),T("button",{class:ke(["axis-mode",{on:E(t).config.gravityMode==="random"}]),onClick:A[8]||(A[8]=P=>E(t).config.gravityMode="random")},"随机",2)]),E(t).config.gravityMode==="fixed"?(K(),kt(Fe,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:E(t).config.gravityMin,"onUpdate:modelValue":A[9]||(A[9]=P=>E(t).config.gravityMin=P)},null,8,["modelValue"])):(K(),J(Ae,{key:1},[xe(Fe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:E(t).config.gravityMin,"onUpdate:modelValue":A[10]||(A[10]=P=>E(t).config.gravityMin=P)},null,8,["modelValue"]),xe(Fe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:E(t).config.gravityMax,"onUpdate:modelValue":A[11]||(A[11]=P=>E(t).config.gravityMax=P)},null,8,["modelValue"])],64)),xe(Fe,{label:"方向",min:-360,max:360,step:1,modelValue:E(t).config.gravityDirection,"onUpdate:modelValue":A[12]||(A[12]=P=>E(t).config.gravityDirection=P)},null,8,["modelValue"]),A[75]||(A[75]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内重力"),T("span",null,"纵轴:强度 0~1")],-1)),xe(Zi,{modelValue:E(t).config.gravityCurve,"onUpdate:modelValue":A[13]||(A[13]=P=>E(t).config.gravityCurve=P),"default-value":E(D)},null,8,["modelValue","default-value"]),A[76]||(A[76]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),A[77]||(A[77]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Se("",!0)]),T("div",Y5,[T("label",G5,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[14]||(A[14]=P=>E(t).config.wind=P)},null,512),[[wt,E(t).config.wind]]),A[78]||(A[78]=T("span",{class:"switch-ui"},null,-1)),A[79]||(A[79]=T("span",null,"开启风力",-1))]),E(t).config.wind?(K(),J("div",j5,[T("div",H5,[T("button",{class:ke(["axis-mode",{on:E(t).config.windMode==="fixed"}]),onClick:A[15]||(A[15]=P=>E(t).config.windMode="fixed")},"固定",2),T("button",{class:ke(["axis-mode",{on:E(t).config.windMode==="random"}]),onClick:A[16]||(A[16]=P=>E(t).config.windMode="random")},"随机",2)]),E(t).config.windMode==="fixed"?(K(),kt(Fe,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:E(t).config.windMin,"onUpdate:modelValue":A[17]||(A[17]=P=>E(t).config.windMin=P)},null,8,["modelValue"])):(K(),J(Ae,{key:1},[xe(Fe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:E(t).config.windMin,"onUpdate:modelValue":A[18]||(A[18]=P=>E(t).config.windMin=P)},null,8,["modelValue"]),xe(Fe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:E(t).config.windMax,"onUpdate:modelValue":A[19]||(A[19]=P=>E(t).config.windMax=P)},null,8,["modelValue"])],64)),xe(Fe,{label:"方向",min:-360,max:360,step:1,modelValue:E(t).config.windDirection,"onUpdate:modelValue":A[20]||(A[20]=P=>E(t).config.windDirection=P)},null,8,["modelValue"]),A[80]||(A[80]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内风力"),T("span",null,"纵轴:强度 0~1")],-1)),xe(Zi,{modelValue:E(t).config.windCurve,"onUpdate:modelValue":A[21]||(A[21]=P=>E(t).config.windCurve=P),"default-value":E(D)},null,8,["modelValue","default-value"]),A[81]||(A[81]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),A[82]||(A[82]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Se("",!0)]),T("div",W5,[T("label",z5,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[22]||(A[22]=P=>E(t).config.forceField=P)},null,512),[[wt,E(t).config.forceField]]),A[83]||(A[83]=T("span",{class:"switch-ui"},null,-1)),A[84]||(A[84]=T("span",null,"开启力场",-1))]),E(t).config.forceField?(K(),J("div",q5,[xe(Fe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:E(t).config.forceCenterX,"onUpdate:modelValue":A[23]||(A[23]=P=>E(t).config.forceCenterX=P)},null,8,["modelValue"]),xe(Fe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:E(t).config.forceCenterY,"onUpdate:modelValue":A[24]||(A[24]=P=>E(t).config.forceCenterY=P)},null,8,["modelValue"]),xe(Fe,{label:"力场强度",min:-300,max:300,step:1,modelValue:E(t).config.forceStrength,"onUpdate:modelValue":A[25]||(A[25]=P=>E(t).config.forceStrength=P)},null,8,["modelValue"]),xe(Fe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:E(t).config.forceRadius,"onUpdate:modelValue":A[26]||(A[26]=P=>E(t).config.forceRadius=P)},null,8,["modelValue"]),T("label",K5,[A[86]||(A[86]=T("span",null,"衰减模式",-1)),ce(T("select",{"onUpdate:modelValue":A[27]||(A[27]=P=>E(t).config.forceFalloff=P),class:"inp"},[...A[85]||(A[85]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[Tt,E(t).config.forceFalloff]])]),A[89]||(A[89]=T("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1)),T("label",Z5,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[28]||(A[28]=P=>E(t).config.showForceFieldShape=P)},null,512),[[wt,E(t).config.showForceFieldShape]]),A[87]||(A[87]=T("span",{class:"switch-ui"},null,-1)),A[88]||(A[88]=T("span",null,"显示形状",-1))])])):Se("",!0)]),T("div",J5,[T("label",Q5,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[29]||(A[29]=P=>E(t).config.vortex=P)},null,512),[[wt,E(t).config.vortex]]),A[90]||(A[90]=T("span",{class:"switch-ui"},null,-1)),A[91]||(A[91]=T("span",null,"开启漩涡",-1))]),E(t).config.vortex?(K(),J("div",e8,[xe(Fe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:E(t).config.vortexCenterX,"onUpdate:modelValue":A[30]||(A[30]=P=>E(t).config.vortexCenterX=P)},null,8,["modelValue"]),xe(Fe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:E(t).config.vortexCenterY,"onUpdate:modelValue":A[31]||(A[31]=P=>E(t).config.vortexCenterY=P)},null,8,["modelValue"]),xe(Fe,{label:"力场强度",min:-300,max:300,step:1,modelValue:E(t).config.vortexStrength,"onUpdate:modelValue":A[32]||(A[32]=P=>E(t).config.vortexStrength=P)},null,8,["modelValue"]),xe(Fe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:E(t).config.vortexRadius,"onUpdate:modelValue":A[33]||(A[33]=P=>E(t).config.vortexRadius=P)},null,8,["modelValue"]),T("label",t8,[A[93]||(A[93]=T("span",null,"衰减模式",-1)),ce(T("select",{"onUpdate:modelValue":A[34]||(A[34]=P=>E(t).config.vortexFalloff=P),class:"inp"},[...A[92]||(A[92]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[Tt,E(t).config.vortexFalloff]])]),A[96]||(A[96]=T("div",{class:"modifier-hint"},"正数逆时针 · 负数顺时针",-1)),T("label",s8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[35]||(A[35]=P=>E(t).config.showVortexShape=P)},null,512),[[wt,E(t).config.showVortexShape]]),A[94]||(A[94]=T("span",{class:"switch-ui"},null,-1)),A[95]||(A[95]=T("span",null,"显示形状",-1))])])):Se("",!0)]),T("div",i8,[T("label",n8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[36]||(A[36]=P=>E(t).config.attraction=P)},null,512),[[wt,E(t).config.attraction]]),A[97]||(A[97]=T("span",{class:"switch-ui"},null,-1)),A[98]||(A[98]=T("span",null,"开启吸附",-1))]),E(t).config.attraction?(K(),J("div",r8,[xe(Fe,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:E(t).config.attractionCenterX,"onUpdate:modelValue":A[37]||(A[37]=P=>E(t).config.attractionCenterX=P)},null,8,["modelValue"]),xe(Fe,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:E(t).config.attractionCenterY,"onUpdate:modelValue":A[38]||(A[38]=P=>E(t).config.attractionCenterY=P)},null,8,["modelValue"]),xe(Fe,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:E(t).config.attractionRadius,"onUpdate:modelValue":A[39]||(A[39]=P=>E(t).config.attractionRadius=P)},null,8,["modelValue"]),xe(Fe,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:E(t).config.attractionDuration,"onUpdate:modelValue":A[40]||(A[40]=P=>E(t).config.attractionDuration=P)},null,8,["modelValue"]),xe(Fe,{label:"延迟时间",min:0,max:30,step:.05,modelValue:E(t).config.attractionDelay,"onUpdate:modelValue":A[41]||(A[41]=P=>E(t).config.attractionDelay=P)},null,8,["modelValue"]),T("label",o8,[A[100]||(A[100]=T("span",null,"延迟方式",-1)),ce(T("select",{"onUpdate:modelValue":A[42]||(A[42]=P=>E(t).config.attractionDelayMode=P),class:"inp"},[...A[99]||(A[99]=[T("option",{value:"global"},"统一时间",-1),T("option",{value:"particle"},"单粒子生命",-1)])],512),[[Tt,E(t).config.attractionDelayMode]])]),T("label",a8,[A[102]||(A[102]=T("span",null,"吸附方式",-1)),ce(T("select",{"onUpdate:modelValue":A[43]||(A[43]=P=>E(t).config.attractionPath=P),class:"inp"},[...A[101]||(A[101]=[T("option",{value:"linear"},"直线",-1),T("option",{value:"curve"},"曲线",-1)])],512),[[Tt,E(t).config.attractionPath]])]),A[105]||(A[105]=T("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1)),T("label",l8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[44]||(A[44]=P=>E(t).config.showAttractionShape=P)},null,512),[[wt,E(t).config.showAttractionShape]]),A[103]||(A[103]=T("span",{class:"switch-ui"},null,-1)),A[104]||(A[104]=T("span",null,"显示形状",-1))])])):Se("",!0)]),T("div",c8,[T("label",h8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[45]||(A[45]=P=>E(t).config.trail=P)},null,512),[[wt,E(t).config.trail]]),A[106]||(A[106]=T("span",{class:"switch-ui"},null,-1)),A[107]||(A[107]=T("span",null,"开启拖尾",-1))]),E(t).config.trail?(K(),J("div",u8,[T("div",d8,[A[108]||(A[108]=T("div",{class:"trail-section-title"},"拖尾独立图片",-1)),T("button",{class:"image-add",title:"增加拖尾图片资源",onClick:A[46]||(A[46]=(...P)=>E(n)&&E(n)(...P))},"+")]),(K(!0),J(Ae,null,Ft(E(t).config.trailResources,P=>(K(),kt(IS,{key:P.id,resource:P,"resource-count":E(t).config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:E(r),onReset:E(h),onRemove:E(u),onUpdateWeight:E(d),onToggleLock:E(f)},{default:jh(()=>[A[124]||(A[124]=T("div",{class:"resource-divider"},null,-1)),xe(Fe,{label:"旋转",min:-360,max:360,step:1,"model-value":P.rotation,"onUpdate:modelValue":O=>E(c)(P.id,O)},null,8,["model-value","onUpdate:modelValue"]),xe(Fe,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":P.boneCount,"onUpdate:modelValue":O=>E(a)(P.id,O)},null,8,["model-value","onUpdate:modelValue"]),xe(Fe,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:P.trailRatio,"onUpdate:modelValue":O=>P.trailRatio=O},null,8,["modelValue","onUpdate:modelValue"]),T("label",f8,[A[110]||(A[110]=T("span",null,"拖尾长度",-1)),ce(T("select",{"onUpdate:modelValue":O=>P.lengthMode=O,class:"inp"},[...A[109]||(A[109]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,m8),[[Tt,P.lengthMode]])]),P.lengthMode==="fixed"?(K(),kt(Fe,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:P.length,"onUpdate:modelValue":O=>P.length=O},null,8,["modelValue","onUpdate:modelValue"])):(K(),J(Ae,{key:1},[xe(Fe,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:P.lengthMin,"onUpdate:modelValue":O=>P.lengthMin=O},null,8,["modelValue","onUpdate:modelValue"]),xe(Fe,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:P.lengthMax,"onUpdate:modelValue":O=>P.lengthMax=O},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",p8,[A[112]||(A[112]=T("span",null,"拖尾宽度",-1)),ce(T("select",{"onUpdate:modelValue":O=>P.widthSizeMode=O,class:"inp"},[...A[111]||(A[111]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,g8),[[Tt,P.widthSizeMode]])]),P.widthSizeMode==="fixed"?(K(),kt(Fe,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:P.width,"onUpdate:modelValue":O=>P.width=O},null,8,["modelValue","onUpdate:modelValue"])):(K(),J(Ae,{key:3},[xe(Fe,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:P.widthMin,"onUpdate:modelValue":O=>P.widthMin=O},null,8,["modelValue","onUpdate:modelValue"]),xe(Fe,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:P.widthMax,"onUpdate:modelValue":O=>P.widthMax=O},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",v8,[A[114]||(A[114]=T("span",null,"宽度缩放",-1)),ce(T("select",{"onUpdate:modelValue":O=>P.widthMode=O,class:"inp"},[...A[113]||(A[113]=[T("option",{value:"particle"},"跟随粒子",-1),T("option",{value:"fixed"},"固定",-1)])],8,y8),[[Tt,P.widthMode]])]),T("label",x8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":O=>P.lifeLengthEnabled=O},null,8,b8),[[wt,P.lifeLengthEnabled]]),A[115]||(A[115]=T("span",{class:"switch-ui"},null,-1)),A[116]||(A[116]=T("span",null,"生命周期长度曲线",-1))]),P.lifeLengthEnabled?(K(),kt(Zi,{key:4,modelValue:P.lifeLengthCurve,"onUpdate:modelValue":O=>P.lifeLengthCurve=O,"default-value":E(D)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Se("",!0),T("label",w8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":O=>P.shapeEnabled=O},null,8,S8),[[wt,P.shapeEnabled]]),A[117]||(A[117]=T("span",{class:"switch-ui"},null,-1)),A[118]||(A[118]=T("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),P.shapeEnabled?(K(),kt(Zi,{key:5,modelValue:P.shapeCurve,"onUpdate:modelValue":O=>P.shapeCurve=O,"default-value":E(N)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Se("",!0),T("div",M8,[A[119]||(A[119]=T("span",null,"颜色模式",-1)),T("div",T8,[T("button",{class:ke(["axis-mode",{on:P.colorMode==="particle"}]),onClick:O=>P.colorMode="particle"},"跟随粒子",10,_8),T("button",{class:ke(["axis-mode",{on:P.colorMode==="fixed"}]),onClick:O=>P.colorMode="fixed"},"固定",10,C8),T("button",{class:ke(["axis-mode",{on:P.colorMode==="curve"}]),onClick:O=>P.colorMode="curve"},"曲线",10,A8)])]),T("label",E8,[A[121]||(A[121]=T("span",null,"混合模式",-1)),ce(T("select",{"onUpdate:modelValue":O=>P.blend=O,class:"inp"},[...A[120]||(A[120]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,I8),[[Tt,P.blend]])]),P.colorMode==="fixed"?(K(),J("label",R8,[A[122]||(A[122]=T("span",null,"固定颜色",-1)),ce(T("input",{class:"colr",type:"color","onUpdate:modelValue":O=>P.color=O},null,8,P8),[[Ge,P.color]]),T("input",{class:"hex-input",value:P.color,onChange:O=>E(p)(P,O),onKeydown:vr(Je(O=>E(m)(P,O),["prevent"]),["enter"])},null,40,k8)])):P.colorMode==="curve"?(K(),kt(ES,{key:7,modelValue:P.colorGradient,"onUpdate:modelValue":O=>P.colorGradient=O},null,8,["modelValue","onUpdate:modelValue"])):Se("",!0),T("div",F8,[A[123]||(A[123]=T("span",null,"透明度模式",-1)),T("div",O8,[T("button",{class:ke(["axis-mode",{on:P.alphaMode==="particle"}]),onClick:O=>P.alphaMode="particle"},"跟随粒子",10,L8),T("button",{class:ke(["axis-mode",{on:P.alphaMode==="fixed"}]),onClick:O=>P.alphaMode="fixed"},"固定",10,B8),T("button",{class:ke(["axis-mode",{on:P.alphaMode==="curve"}]),onClick:O=>P.alphaMode="curve"},"曲线",10,N8)])]),P.alphaMode==="fixed"?(K(),kt(Fe,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:P.alpha,"onUpdate:modelValue":O=>P.alpha=O},null,8,["modelValue","onUpdate:modelValue"])):Se("",!0),P.alphaMode==="curve"?(K(),kt(Zi,{key:9,modelValue:P.alphaCurve,"onUpdate:modelValue":O=>P.alphaCurve=O,"default-value":E($)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Se("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"trailTextureFileInput",ref:s,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:A[47]||(A[47]=(...P)=>E(l)&&E(l)(...P))},null,544),T("div",D8,[xe(Fe,{label:"网格行数",min:2,max:16,step:1,"model-value":E(t).config.trailGridRows,"onUpdate:modelValue":A[48]||(A[48]=P=>E(o)("trailGridRows",P))},null,8,["model-value"]),xe(Fe,{label:"网格列数",min:2,max:32,step:1,"model-value":E(t).config.trailGridCols,"onUpdate:modelValue":A[49]||(A[49]=P=>E(o)("trailGridCols",P))},null,8,["model-value"])]),A[125]||(A[125]=T("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):Se("",!0)]),T("div",U8,[T("label",$8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[50]||(A[50]=P=>E(t).config.emitterFollow=P),disabled:E(t).config.streamBehavior==="loop"},null,8,X8),[[wt,E(t).config.emitterFollow]]),A[126]||(A[126]=T("span",{class:"switch-ui"},null,-1)),A[127]||(A[127]=T("span",null,"开启发射器跟随",-1))]),E(t).config.emitterFollow&&E(t).config.streamBehavior!=="loop"?(K(),J("div",V8,[T("label",Y8,[A[130]||(A[130]=T("span",null,"跟随模式",-1)),T("select",{value:E(t).config.emitterFollowMode,class:"inp",onChange:A[51]||(A[51]=P=>E(R)(P,E(t).config))},[A[128]||(A[128]=T("option",{value:"none"},"无",-1)),A[129]||(A[129]=T("option",{value:"path"},"跟随路径",-1)),E(g)||E(t).config.emitterFollowMode==="bone"?(K(),J("option",j8,"选中的骨骼")):Se("",!0)],40,G8)]),E(t).config.emitterFollowMode==="path"?(K(),J(Ae,{key:0},[T("label",H8,[A[132]||(A[132]=T("span",null,"跟随路径",-1)),ce(T("select",{"onUpdate:modelValue":A[52]||(A[52]=P=>E(t).config.emitterFollowPathId=P),class:"inp"},[A[131]||(A[131]=T("option",{value:0},"无",-1)),(K(!0),J(Ae,null,Ft(E(e).paths,P=>(K(),J("option",{key:P.id,value:P.id},be(P.name),9,W8))),128))],512),[[Tt,E(t).config.emitterFollowPathId,void 0,{number:!0}]])]),T("label",z8,[A[134]||(A[134]=T("span",null,"发射器角度模式",-1)),ce(T("select",{"onUpdate:modelValue":A[53]||(A[53]=P=>E(t).config.emitterAngleMode=P),class:"inp"},[...A[133]||(A[133]=[T("option",{value:"fixed"},"固定角度",-1),T("option",{value:"direction"},"跟随移动方向",-1)])],512),[[Tt,E(t).config.emitterAngleMode]])]),A[140]||(A[140]=T("div",{class:"gravity-curve-title"},[T("span",null,"移动进度曲线 (0→1)")],-1)),xe(Zi,{modelValue:E(t).config.emitterFollowCurve,"onUpdate:modelValue":A[54]||(A[54]=P=>E(t).config.emitterFollowCurve=P),"default-value":E(B)},null,8,["modelValue","default-value"]),T("div",q8,[T("label",K8,[A[135]||(A[135]=T("span",null,"移动时长 (s)",-1)),ce(T("input",{"onUpdate:modelValue":A[55]||(A[55]=P=>E(t).config.emitterFollowDuration=P),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Ge,E(t).config.emitterFollowDuration,void 0,{number:!0}]])]),T("label",Z8,[A[137]||(A[137]=T("span",null,"跟随空间",-1)),ce(T("select",{"onUpdate:modelValue":A[56]||(A[56]=P=>E(t).config.emitterFollowSpace=P),class:"inp"},[...A[136]||(A[136]=[T("option",{value:"local"},"局部空间(GEN 移动)",-1),T("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[Tt,E(t).config.emitterFollowSpace]])])]),T("label",J8,[A[139]||(A[139]=T("span",null,"移动方向",-1)),ce(T("select",{"onUpdate:modelValue":A[57]||(A[57]=P=>E(t).config.emitterFollowDirection=P),class:"inp"},[...A[138]||(A[138]=[T("option",{value:"forward"},"正向(起点 → 终点)",-1),T("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[Tt,E(t).config.emitterFollowDirection]])]),xe(Fe,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:E(t).config.emitterFollowOffset,"onUpdate:modelValue":A[58]||(A[58]=P=>E(t).config.emitterFollowOffset=P)},null,8,["modelValue"]),A[141]||(A[141]=T("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):E(t).config.emitterFollowMode==="bone"?(K(),J(Ae,{key:1},[E(v)?(K(),J("div",Q8,[A[142]||(A[142]=Rt("跟随目标:",-1)),T("strong",null,be(E(v).spine.name)+" / "+be(E(v).boneName),1)])):(K(),J("div",eU,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),E(g)&&(!E(v)||E(g).spine.id!==E(v).spine.id||E(g).boneName!==E(v).boneName)?(K(),J("button",{key:2,class:"bone-follow-rebind",onClick:A[59]||(A[59]=P=>E(F)(E(t).config))},be(E(v)?"重新绑定":"绑定")+"当前选中骨骼:"+be(E(g).spine.name)+" / "+be(E(g).boneName),1)):Se("",!0),E(v)?(K(),J(Ae,{key:3},[T("label",tU,[A[144]||(A[144]=T("span",null,"跟随空间",-1)),ce(T("select",{"onUpdate:modelValue":A[60]||(A[60]=P=>E(t).config.emitterFollowSpace=P),class:"inp"},[...A[143]||(A[143]=[T("option",{value:"local"},"本地空间(随骨骼移动)",-1),T("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[Tt,E(t).config.emitterFollowSpace]])]),T("div",sU,[T("label",iU,[A[145]||(A[145]=T("span",null,"位移偏移 X",-1)),ce(T("input",{"onUpdate:modelValue":A[61]||(A[61]=P=>E(t).config.emitterFollowBoneOffsetX=P),type:"number",step:"1",class:"inp"},null,512),[[Ge,E(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),T("label",nU,[A[146]||(A[146]=T("span",null,"位移偏移 Y",-1)),ce(T("input",{"onUpdate:modelValue":A[62]||(A[62]=P=>E(t).config.emitterFollowBoneOffsetY=P),type:"number",step:"1",class:"inp"},null,512),[[Ge,E(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),T("div",rU,[T("label",oU,[A[147]||(A[147]=T("span",null,"旋转偏移",-1)),ce(T("input",{"onUpdate:modelValue":A[63]||(A[63]=P=>E(t).config.emitterFollowBoneRotation=P),type:"number",step:"1",class:"inp"},null,512),[[Ge,E(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),T("label",aU,[A[148]||(A[148]=T("span",null,"缩放偏移 X",-1)),ce(T("input",{"onUpdate:modelValue":A[64]||(A[64]=P=>E(t).config.emitterFollowBoneScaleX=P),type:"number",step:"0.05",class:"inp"},null,512),[[Ge,E(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),T("label",lU,[A[149]||(A[149]=T("span",null,"缩放偏移 Y",-1)),ce(T("input",{"onUpdate:modelValue":A[65]||(A[65]=P=>E(t).config.emitterFollowBoneScaleY=P),type:"number",step:"0.05",class:"inp"},null,512),[[Ge,E(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),A[150]||(A[150]=T("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):Se("",!0)],64)):Se("",!0)])):Se("",!0)]),T("div",cU,[T("label",hU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[66]||(A[66]=P=>E(t).config.collision=P)},null,512),[[wt,E(t).config.collision]]),A[151]||(A[151]=T("span",{class:"switch-ui"},null,-1)),A[152]||(A[152]=T("span",null,"开启碰撞",-1))]),E(t).config.collision?(K(),J("div",uU,[A[153]||(A[153]=T("div",{class:"collision-filter-title"},"参与的碰撞对象",-1)),T("div",dU,[(K(!0),J(Ae,null,Ft(E(y),P=>(K(),J("span",{key:P.id,class:ke(["collision-filter-tag",{disabled:!P.enabled}]),title:P.enabled?P.name:`${P.name}(碰撞体已禁用)`},[T("span",null,be(P.name),1),T("button",{type:"button","aria-label":`清除碰撞对象 ${P.name}`,onClick:O=>E(w)(P.id)},"×",8,mU)],10,fU))),128)),T("button",{type:"button",class:ke(["collision-filter-add",{active:E(x)}]),disabled:E(M).length===0,title:E(M).length?"加入场景碰撞对象":"没有可加入的碰撞对象",onClick:A[67]||(A[67]=P=>x.value=!E(x))},"+",10,pU)]),E(y).length===0?(K(),J("div",gU,"未选择碰撞对象,当前粒子不会发生碰撞")):Se("",!0),E(x)&&E(M).length?(K(),J("div",vU,[(K(!0),J(Ae,null,Ft(E(M),P=>(K(),J("button",{key:P.id,type:"button",onClick:O=>E(_)(P.id)},[T("span",null,be(P.name),1),T("small",null,be(P.enabled?"可用":"已禁用"),1)],8,yU))),128))])):Se("",!0),A[154]||(A[154]=T("div",{class:"modifier-hint"},"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",-1))])):Se("",!0)]),xe(Fe,{label:"阻尼",min:0,max:2,step:.05,modelValue:E(t).config.damping,"onUpdate:modelValue":A[68]||(A[68]=P=>E(t).config.damping=P)},null,8,["modelValue"])],512),[[ws,!E(b).mods]])]))}}),bU=es(xU,[["__scopeId","data-v-96ef634f"]]),wU={class:"group"},SU={class:"caret"},MU={class:"group-body export-settings"},TU={class:"export-field"},_U={class:"export-field"},CU={class:"export-field"},AU={key:0,class:"export-help"},EU={class:"export-fps-row"},IU={class:"export-field export-fps-field"},RU={class:"export-checkbox"},PU={class:"export-switches"},kU={class:"switch-row export-switch"},FU={class:"switch-row export-switch"},OU={class:"switch-row export-switch export-switch-last"},LU=Qt({__name:"ExportSettingsSection",setup(i){const{exportSettings:e,collapsed:t,toggle:s,resetModule:n,normalizeExportFps:r,select:o}=Cr();return(a,c)=>(K(),J("div",wU,[T("div",{class:"group-head",onClick:c[1]||(c[1]=l=>E(s)("export"))},[T("span",SU,be(E(t).export?"▸":"▾"),1),c[11]||(c[11]=T("span",null,"导出设置",-1)),T("button",{class:"group-reset",title:"重置导出设置",onClick:c[0]||(c[0]=Je(l=>E(n)("export"),["stop"]))},"重置")]),ce(T("div",MU,[T("label",TU,[c[12]||(c[12]=T("span",null,"图片路径 (Spine Images Path)",-1)),ce(T("input",{"onUpdate:modelValue":c[2]||(c[2]=l=>E(e).imagesPath=l),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[Ge,E(e).imagesPath,void 0,{trim:!0}]])]),T("label",_U,[c[14]||(c[14]=T("span",null,"Spine 版本",-1)),ce(T("select",{"onUpdate:modelValue":c[3]||(c[3]=l=>E(e).spineVersion=l),class:"inp export-input"},[...c[13]||(c[13]=[Qs('',5)])],512),[[Tt,E(e).spineVersion]])]),T("label",CU,[c[16]||(c[16]=T("span",null,"关键帧插值曲线",-1)),ce(T("select",{"onUpdate:modelValue":c[4]||(c[4]=l=>E(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),[[Tt,E(e).keyframeCurve]])]),c[25]||(c[25]=T("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),E(e).spineVersion==="3.8"?(K(),J("div",AU,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):Se("",!0),T("div",EU,[T("label",IU,[c[17]||(c[17]=T("span",null,"导出 FPS",-1)),ce(T("input",{"onUpdate:modelValue":c[5]||(c[5]=l=>E(e).fps=l),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:c[6]||(c[6]=(...l)=>E(r)&&E(r)(...l))},null,544),[[Ge,E(e).fps,void 0,{number:!0}]])]),T("label",RU,[ce(T("input",{"onUpdate:modelValue":c[7]||(c[7]=l=>E(e).omitFps=l),type:"checkbox"},null,512),[[wt,E(e).omitFps]]),c[18]||(c[18]=Rt("不写 fps",-1))])]),c[26]||(c[26]=T("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),T("div",PU,[T("label",kU,[ce(T("input",{"onUpdate:modelValue":c[8]||(c[8]=l=>E(e).integerFrameAlignment=l),type:"checkbox"},null,512),[[wt,E(e).integerFrameAlignment]]),c[19]||(c[19]=T("span",{class:"switch-ui"},null,-1)),c[20]||(c[20]=T("span",null,"整数帧对齐",-1))]),T("label",FU,[ce(T("input",{"onUpdate:modelValue":c[9]||(c[9]=l=>E(e).bonePool=l),type:"checkbox"},null,512),[[wt,E(e).bonePool]]),c[21]||(c[21]=T("span",{class:"switch-ui"},null,-1)),c[22]||(c[22]=T("span",null,"骨骼对象池",-1))]),T("label",OU,[ce(T("input",{"onUpdate:modelValue":c[10]||(c[10]=l=>E(e).excludeEmptyAnimations=l),type:"checkbox"},null,512),[[wt,E(e).excludeEmptyAnimations]]),c[23]||(c[23]=T("span",{class:"switch-ui"},null,-1)),c[24]||(c[24]=T("span",null,"排除无内容动画",-1))])])],512),[[ws,!E(t).export]])]))}}),BU=es(LU,[["__scopeId","data-v-04462c7a"]]),NU={class:"spine-export-actions"},DU=["disabled","title"],UU=["disabled"],$U=["disabled","title"],XU={key:0},VU=["href"],YU=["href"],GU=Qt({__name:"ParticleExportFooter",setup(i){const{exportSettings:e,exportBusy:t,exportTarget:s,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}=Cr();return(v,x)=>(K(),J(Ae,null,[T("div",NU,[T("button",{type:"button",class:"export-spine-json",disabled:E(t),title:E(t)?"正在重新计算并烘焙动画":`导出 Spine ${E(e).spineVersion} JSON`,onClick:x[0]||(x[0]=(...y)=>E(p)&&E(p)(...y))},be(E(t)&&E(s)==="json"?"正在准备导出…":"导出Spine Json"),9,DU),T("button",{type:"button",class:"export-spine-images",disabled:E(t),title:"单独下载当前粒子系统使用的图片 ZIP",onClick:x[1]||(x[1]=(...y)=>E(g)&&E(g)(...y))},be(E(t)&&E(s)==="images"?"正在整理图片…":"导出 images 包"),9,UU),T("button",{type:"button",class:"export-spine-project",disabled:E(t)||!E(l),title:E(d),onClick:x[2]||(x[2]=(...y)=>E(m)&&E(m)(...y))},[T("span",null,be(E(t)&&E(s)==="spine"?"正在生成工程…":"导出 .spine 包"),1),!E(t)&&E(u)?(K(),J("small",XU,be(E(u)),1)):Se("",!0)],8,$U)]),T("div",{class:ke(["connector-status",E(c)])},[x[5]||(x[5]=T("span",{class:"connector-dot"},null,-1)),Rt(be(E(a))+" ",1),E(h)?(K(),J("a",{key:0,href:E(h),target:"_blank",rel:"noopener",title:"在本机连接器中授权当前网站"},"授权当前网站",8,VU)):Se("",!0),T("button",{type:"button",title:"重新检测连接器",onClick:x[3]||(x[3]=(...y)=>E(f)&&E(f)(...y))},"刷新")],2),E(n)?(K(),J("div",{key:0,class:ke(["export-message",{error:E(r)}])},[Rt(be(E(n))+" ",1),E(o)?(K(),J("a",{key:0,href:E(o),target:"_blank",rel:"noopener",onClick:x[4]||(x[4]=y=>o.value="")},"授权当前网站",8,YU)):Se("",!0)],2)):Se("",!0)],64))}}),jU=es(GU,[["__scopeId","data-v-7ff40afe"]]),HU={class:"panel"},WU={class:"panel-scroll"},zU=Qt({__name:"ParticlePanel",setup(i){const{activeObjectType:e,sys:t}=lL();return(s,n)=>(K(),J("div",HU,[n[0]||(n[0]=T("div",{class:"panel-header"},[T("span",null,"Spine粒子编辑器-Yeomai")],-1)),T("div",WU,[xe(vL),xe(QN),E(e)==="particle"&&E(t)?(K(),J(Ae,{key:0},[xe($D),xe(c4),xe(k5),xe(bU),xe(BU)],64)):Se("",!0)]),xe(jU)]))}}),qU=es(zU,[["__scopeId","data-v-283ef8eb"]]),KU={class:"timeline"},ZU={class:"tl-controls"},JU=["title"],QU={class:"tl-range",title:"自定义播放起始帧"},e$=["max","onKeydown"],t$={class:"tl-range",title:"自定义播放结束帧"},s$=["min","max","onKeydown"],i$=["title"],n$={class:"tl-frame"},r$=["disabled"],o$=["onClick"],a$={key:0},l$={class:"tl-animation-editor"},c$={key:0,class:"tl-animation-error"},h$={class:"tl-animation-actions"},u$=["disabled"],d$={key:1,class:"tl-animation-hint"},f$={class:"tl-anim tl-spine-preview"},m$=["value","disabled"],p$={value:""},g$=["value"],v$={class:"tl-zoom"},y$={class:"tl-ticks"},x$={class:"tl-ticklabel"},b$={class:"tl-lanes"},w$=["onPointerdown"],S$={class:"lane-name"},M$=["onPointerdown"],T$=["onPointerdown"],_$=["onPointerdown"],C$={class:"lane-name"},A$={key:0,class:"tl-empty"},E$=Qt({__name:"Timeline",setup(i){const e=po(),t=$e(null),s=$e(null),n=$e(!1),r=$e("animation"),o=$e("");Ro(()=>{(!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 j of e.systems)(!j.animation||!e.timeline.animations.includes(j.animation))&&(j.animation=e.timeline.animations[0])});const a=Ye(()=>e.systems.find(j=>j.id===e.activeId)||null),c=Ye(()=>{const j=a.value;return!j||!V(j)?null:mp(j.config,m.value)});function l(){a.value&&(n.value=!n.value,r.value=a.value.animation,o.value="")}function h(j){const G=a.value;G&&(e.setSystemAnimation(G.id,j),r.value=j,o.value="")}function u(){const j=e.addAnimation();r.value=j,o.value=""}function d(){var z;const j=((z=a.value)==null?void 0:z.animation)||e.timeline.animation,G=r.value.trim();if(!G){o.value="动画名称不能为空";return}if(G!==j&&e.timeline.animations.includes(G)){o.value="动画名称不能重复";return}if(!e.renameAnimation(j,G)){o.value="无法修改动画名称";return}r.value=G,o.value=""}function f(){var z,se;const j=((z=a.value)==null?void 0:z.animation)||e.timeline.animation;if(!e.removeAnimation(j)){o.value="至少需要保留一个动画";return}const G=((se=a.value)==null?void 0:se.animation)||e.timeline.animation;r.value=G,o.value=""}function p(j){var G;(G=s.value)!=null&&G.contains(j.target)||(n.value=!1)}Wn(()=>document.addEventListener("pointerdown",p)),Sl(()=>document.removeEventListener("pointerdown",p));const m=Ye(()=>Math.max(1,e.timeline.fps||30)),g=$e(120),v=$e({}),x=$e({}),y=$e({}),M=$e({}),_=$e(String(e.timeline.playbackStart)),w=$e(String(e.timeline.playbackEnd));Ls(()=>e.timeline.playbackStart,j=>{_.value=String(j)}),Ls(()=>e.timeline.playbackEnd,j=>{w.value=String(j)});const b=Ye(()=>e.timeline.totalFrames),C=Ye(()=>g.value<=30?"放大":g.value>=300?"缩小":"适中"),R=Ye(()=>e.spines.filter(j=>j.selectedAnimation&&j.animations.some(G=>G.name===j.selectedAnimation&&G.duration>0))),F=Ye(()=>(e.activeObjectType==="spine"?e.spines.find(G=>G.id===e.activeObjectId&&G.animations.length):null)||e.spines.find(G=>G.animations.length)||null);function I(j){const G=F.value;G&&(G.selectedAnimation=j.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function k(){e.setPlaybackStart(Number(_.value)),_.value=String(e.timeline.playbackStart)}function B(){e.setPlaybackEnd(Number(w.value)),w.value=String(e.timeline.playbackEnd)}function D(){const j=c.value;j&&(e.setPlaybackEnd(j.end),e.setPlaybackStart(j.start))}function $(){var G;const j=((G=t.value)==null?void 0:G.clientWidth)||600;return g.value/j}const N=Ye(()=>{const j=[],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 se=0;se<=G;se+=z)j.push({f:se,px:se/$()});return j}),X=Ye(()=>e.timeline.frame/$());function A(j){const G=j.config;return(v.value[j.id]??Math.max(0,Number(G.delay)||0))*m.value/$()}function P(j){const G=j.config,z=Math.max(0,Number(G.lifeMin)||0),se=Math.max(0,Number(G.lifeMax)||0);return G.lifeMode==="fixed"?z:Math.max(z,se)}function O(j){return U(j)}function L(j){if(j.config.mode!=="stream")return 0;if(j.config.streamBehavior==="loop"){const z=j.config;return(y.value[j.id]??mr(z,m.value).loop)/$()}return(x.value[j.id]??Math.max(1/m.value,Number(j.config.duration)||1))*m.value/$()}function U(j){const G=j.config;return G.mode==="stream"&&G.streamBehavior==="loop"?H(j)+L(j)+q(j):L(j)+P(j)*m.value/$()}function V(j){const G=j.config;return G.mode==="stream"&&G.streamBehavior==="loop"}function H(j){return V(j)?mr(j.config,m.value).start/$():0}function q(j){return V(j)?mr(j.config,m.value).end/$():0}function ie(j){var G;return((G=j.animations.find(z=>z.name===j.selectedAnimation))==null?void 0:G.duration)||0}function re(j){return(M.value[j.id]??Math.max(0,Number(j.timeOffset)||0))*m.value/$()}function pe(j){return ie(j)*m.value/$()}function ge(j){const G=j.deltaY<0?.8:1.25;let z=g.value*G;z=Math.min(2e3,Math.max(10,z)),g.value=Math.round(z)}function he(j){const G=t.value;e.pause();const z=ue=>{const ne=G.getBoundingClientRect(),de=Math.floor((ue.clientX-ne.left)/ne.width*g.value);e.timeline.frame=Math.max(0,Math.min(de,b.value-1))};z(j);const se=()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",se)};window.addEventListener("pointermove",z),window.addEventListener("pointerup",se)}function fe(j,G){j.stopPropagation();const z=j.clientX,se=Math.max(0,Number(G.config.delay)||0),ue=$()/m.value,ne=ye=>{const me=(ye.clientX-z)*ue,Ne=Math.max(0,Math.min(se+me,600));v.value[G.id]=Math.round(Ne*m.value)/m.value},de=ye=>{window.removeEventListener("pointermove",ne),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",Ie);const me=v.value[G.id];delete v.value[G.id],ye&&me!=null&&me!==se&&(G.config.delay=me)},le=()=>de(!0),Ie=()=>de(!1);window.addEventListener("pointermove",ne),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",Ie)}function Y(j,G){var qe;j.stopPropagation();const z=V(G),se=Math.max(0,Number(G.config.duration)||0),ue=mr(G.config,m.value).loop,ne=$()/m.value,de=((qe=j.currentTarget.closest(".lane-bar"))==null?void 0:qe.getBoundingClientRect().left)??j.clientX,le=H(G);let Ie=!1;const ye=Ke=>{if(Ie=!0,z){const Le=Math.min(1800,Math.max(1,Math.round((Ke.clientX-de-le)/$())));y.value[G.id]=Le}else{const Le=Math.max(1/m.value,Math.min((Ke.clientX-de)*ne,600));x.value[G.id]=Math.round(Le*m.value)/m.value}},me=Ke=>{window.removeEventListener("pointermove",ye),window.removeEventListener("pointerup",Ne),window.removeEventListener("pointercancel",Ze);const Le=x.value[G.id],Me=y.value[G.id];delete x.value[G.id],delete y.value[G.id],Ke&&Ie&&z&&Me!=null&&Me!==ue?G.config.loopDurationFrames=Me:Ke&&Ie&&!z&&Le!=null&&Le!==se&&(G.config.duration=Le)},Ne=()=>me(!0),Ze=()=>me(!1);window.addEventListener("pointermove",ye),window.addEventListener("pointerup",Ne),window.addEventListener("pointercancel",Ze)}function W(j,G){j.stopPropagation();const z=j.clientX,se=Math.max(0,Number(G.timeOffset)||0),ue=$()/m.value,ne=ye=>{const me=Math.max(0,Math.min(se+(ye.clientX-z)*ue,600));M.value[G.id]=Math.round(me*m.value)/m.value},de=ye=>{window.removeEventListener("pointermove",ne),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",Ie);const me=M.value[G.id];delete M.value[G.id],ye&&me!=null&&me!==se&&(G.timeOffset=me,e.recalcTotalFrames())},le=()=>de(!0),Ie=()=>de(!1);window.addEventListener("pointermove",ne),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",Ie)}return(j,G)=>{var z,se,ue;return K(),J("div",KU,[T("div",ZU,[T("button",{class:ke(["tl-btn",{on:E(e).timeline.playing}]),onClick:G[0]||(G[0]=ne=>E(e).togglePlay()),title:E(e).timeline.playing?"暂停 (D)":"播放 (D)"},be(E(e).timeline.playing?"❚❚":"▶"),11,JU),T("button",{class:"tl-btn",onClick:G[1]||(G[1]=ne=>E(e).toStart()),title:"回到第一帧 (S)"},"⏮"),T("button",{class:"tl-btn",onClick:G[2]||(G[2]=ne=>E(e).previousFrame()),title:"前一帧"},"◀"),T("button",{class:"tl-btn",onClick:G[3]||(G[3]=ne=>E(e).nextFrame()),title:"后一帧"},"▶"),T("button",{class:"tl-btn",onClick:G[4]||(G[4]=ne=>E(e).toEnd()),title:"移动到最后一帧"},"⏭"),T("button",{class:ke(["tl-btn",{on:E(e).timeline.loop}]),onClick:G[5]||(G[5]=ne=>E(e).toggleLoop()),title:"循环"},"⟳",2),T("label",QU,[G[10]||(G[10]=T("span",null,"A",-1)),ce(T("input",{"onUpdate:modelValue":G[6]||(G[6]=ne=>_.value=ne),type:"number",min:"0",max:Math.max(0,E(e).timeline.playbackEnd-1),"aria-label":"播放起始帧",onChange:k,onKeydown:vr(Je(k,["prevent"]),["enter"])},null,40,e$),[[Ge,_.value]])]),T("label",t$,[G[11]||(G[11]=T("span",null,"B",-1)),ce(T("input",{"onUpdate:modelValue":G[7]||(G[7]=ne=>w.value=ne),type:"number",min:E(e).timeline.playbackStart+1,max:Math.max(1,E(e).timeline.totalFrames-1),"aria-label":"播放结束帧",onChange:B,onKeydown:vr(Je(B,["prevent"]),["enter"])},null,40,s$),[[Ge,w.value]])]),c.value?(K(),J("button",{key:0,class:"tl-loop-range",title:`设为闭合自循环范围 ${c.value.start}–${c.value.end}f`,onClick:D},"循环段",8,i$)):Se("",!0),T("span",n$,[G[12]||(G[12]=Rt("帧 ",-1)),T("b",null,be(E(e).timeline.frame),1),G[13]||(G[13]=Rt(" / ",-1)),T("b",null,be(Math.max(0,E(e).timeline.totalFrames-1)),1)]),G[18]||(G[18]=T("span",{class:"tl-legend"},[T("i",{class:"legend-emission"}),Rt("持续发射 "),T("i",{class:"legend-life"}),Rt("粒子存在 "),T("i",{class:"legend-spine"}),Rt("Spine 动画")],-1)),T("div",{ref_key:"animationMenuRef",ref:s,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:Je(l,["stop"])},[T("span",null,be(((z=a.value)==null?void 0:z.animation)||E(e).timeline.animation),1),G[14]||(G[14]=T("i",null,"⌄",-1))],8,r$),n.value?(K(),J("div",{key:0,class:"tl-animation-menu",onPointerdown:G[9]||(G[9]=Je(()=>{},["stop"]))},[G[15]||(G[15]=T("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(K(!0),J(Ae,null,Ft(E(e).timeline.animations,ne=>{var de,le;return K(),J("button",{key:ne,class:ke(["tl-animation-option",{on:((de=a.value)==null?void 0:de.animation)===ne}]),onClick:Ie=>h(ne)},[T("span",null,be(ne),1),((le=a.value)==null?void 0:le.animation)===ne?(K(),J("i",a$,"✓")):Se("",!0)],10,o$)}),128)),T("div",l$,[ce(T("input",{"onUpdate:modelValue":G[8]||(G[8]=ne=>r.value=ne),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:vr(d,["enter"])},null,544),[[Ge,r.value]]),T("button",{title:"重命名当前动画",onClick:d},"重命名")]),o.value?(K(),J("div",c$,be(o.value),1)):Se("",!0),T("div",h$,[T("button",{onClick:u},"+ 新增"),T("button",{disabled:E(e).timeline.animations.length<=1,onClick:f},"删除",8,u$)]),E(e).timeline.animations.length<=1?(K(),J("div",d$,"至少需要保留一个动画")):Se("",!0)],32)):Se("",!0)],512),T("label",f$,[G[17]||(G[17]=Rt("Spine 预览动画 ",-1)),T("select",{class:"tl-sel",value:((se=F.value)==null?void 0:se.selectedAnimation)||"",disabled:!F.value,onChange:I},[T("option",p$,be(F.value?"无":"无可用 Spine 动画"),1),(K(!0),J(Ae,null,Ft(((ue=F.value)==null?void 0:ue.animations)||[],ne=>(K(),J("option",{key:ne.name,value:ne.name},be(ne.name)+"("+be(ne.duration.toFixed(2))+"s) ",9,g$))),128))],40,m$)]),T("span",v$,be(C.value),1)]),T("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:Je(ge,["prevent"]),onPointerdown:he},[T("div",y$,[(K(!0),J(Ae,null,Ft(N.value,ne=>(K(),J("div",{key:ne.f,class:"tl-tickline",style:vs({left:ne.px+"px"})},[T("span",x$,be(ne.f)+"f",1)],4))),128))]),T("div",{class:"tl-playhead",style:vs({left:X.value+"px"})},null,4),T("div",b$,[(K(!0),J(Ae,null,Ft(E(e).systems,(ne,de)=>(K(),J("div",{key:ne.id,class:"tl-lane"},[G[19]||(G[19]=T("span",{class:"lane-ico"},"●",-1)),T("div",{class:"lane-bar",style:vs({left:A(ne)+"px",width:O(ne)+"px"}),onPointerdown:Je(le=>fe(le,ne),["stop"])},[T("span",S$,be(ne.config.name||"系统 "+(de+1)),1),T("span",{class:ke(["bar-life",{"loop-life":V(ne)}]),style:vs({width:U(ne)+"px"})},null,6),V(ne)?(K(),J(Ae,{key:0},[H(ne)?(K(),J("span",{key:0,class:"bar-loop-transition bar-loop-start",style:vs({width:H(ne)+"px"})},null,4)):Se("",!0),T("span",{class:"bar-emission bar-loop",style:vs({left:H(ne)+"px",width:L(ne)+"px"})},[T("span",{class:"bar-handle",title:"拖动循环段时长",onPointerdown:Je(le=>Y(le,ne),["stop"])},null,40,M$)],4),q(ne)?(K(),J("span",{key:1,class:"bar-loop-transition bar-loop-end",style:vs({left:H(ne)+L(ne)+"px",width:q(ne)+"px"})},null,4)):Se("",!0)],64)):ne.config.mode==="stream"?(K(),J("span",{key:1,class:"bar-emission",style:vs({width:L(ne)+"px"})},[T("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:Je(le=>Y(le,ne),["stop"])},null,40,T$)],4)):Se("",!0)],44,w$)]))),128)),(K(!0),J(Ae,null,Ft(R.value,ne=>(K(),J("div",{key:`spine-${ne.id}`,class:"tl-lane spine-lane"},[G[20]||(G[20]=T("span",{class:"lane-ico spine-ico"},"◆",-1)),T("div",{class:"spine-bar",style:vs({left:re(ne)+"px",width:pe(ne)+"px"}),title:"拖动调整动画开始时间",onPointerdown:Je(de=>W(de,ne),["stop"])},[T("span",C$,be(ne.name)+" · "+be(ne.selectedAnimation),1)],44,_$)]))),128)),!E(e).systems.length&&!R.value.length?(K(),J("div",A$,"暂无可显示的动画数据")):Se("",!0)])],544)])}}}),I$=es(E$,[["__scopeId","data-v-1e581e89"]]),R$={class:"transfer-heading"},P$={key:0},k$={class:"transfer-detail"},F$=Qt({__name:"TransferProgressOverlay",setup(i){const e=$e(null);return Ls(()=>Kt.visible,async t=>{var s;t&&(await Gh(),(s=e.value)==null||s.focus({preventScroll:!0}))},{flush:"post"}),(t,s)=>(K(),kt(VT,{name:"transfer-fade"},{default:jh(()=>[E(Kt).visible?(K(),J("div",{key:0,ref_key:"overlayElement",ref:e,class:"transfer-overlay",role:"dialog","aria-modal":"true","aria-live":"polite",tabindex:"-1",onPointerdown:s[0]||(s[0]=Je(()=>{},["stop","prevent"])),onPointerup:s[1]||(s[1]=Je(()=>{},["stop","prevent"])),onClick:s[2]||(s[2]=Je(()=>{},["stop","prevent"])),onDblclick:s[3]||(s[3]=Je(()=>{},["stop","prevent"])),onContextmenu:s[4]||(s[4]=Je(()=>{},["stop","prevent"])),onWheel:s[5]||(s[5]=Je(()=>{},["stop","prevent"])),onKeydown:s[6]||(s[6]=Je(()=>{},["stop","prevent"]))},[T("div",{class:ke(["transfer-dialog",{failed:E(Kt).failed}])},[T("div",R$,[T("span",null,be(E(Kt).title),1),E(Kt).indeterminate?Se("",!0):(K(),J("strong",P$,be(Math.round(E(Kt).progress))+"%",1))]),T("div",{class:ke(["transfer-track",{indeterminate:E(Kt).indeterminate}])},[T("div",{class:"transfer-bar",style:vs(E(Kt).indeterminate?void 0:{width:`${E(Kt).progress}%`})},null,4)],2),T("div",k$,be(E(Kt).detail),1)],2)],544)):Se("",!0)]),_:1}))}}),O$=es(F$,[["__scopeId","data-v-592b922e"]]),L$=["inert","aria-hidden"],B$={class:"right"},N$={class:"stage-area"},D$=Qt({__name:"App",setup(i){const e=po();gR(e);const t=$e(360),s=$e(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=s.value,l=u=>{const d=Math.max(80,Math.min(c+(a-u.clientY),window.innerHeight-200));s.value=d},h=()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",h)}return(o,a)=>(K(),J(Ae,null,[T("div",{class:ke(["layout",{"panel-right":E(e).settings.parameterPanelOnRight}]),inert:E(Kt).visible?!0:void 0,"aria-hidden":E(Kt).visible?"true":void 0},[T("div",{class:"parameter-panel",style:vs({width:t.value+"px"})},[xe(qU)],4),T("div",{class:"resizer-col",onPointerdown:n},null,32),T("div",B$,[T("div",N$,[xe(t3)]),T("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),T("div",{class:"timeline-area",style:vs({height:s.value+"px"})},[xe(I$)],4)])],10,L$),xe(O$)],64))}}),U$=es(D$,[["__scopeId","data-v-42c4fa00"]]);g_(U$).use(x_()).mount("#app");export{ly as $,nn as A,Ih as B,Ct as C,ms as D,Pe as E,Ys as F,cn as G,st as H,gt as I,vS as J,Ns as K,ii as L,gi as M,Sr as N,mu as O,sn as P,ml as Q,aa as R,Ci as S,D3 as T,je as U,sy as V,Ii as W,m6 as X,LO as Y,xl as Z,dp as _,ze as a,Tm as a$,ay as a0,Kw as a1,Tp as a2,d6 as a3,_h as a4,Ja as a5,z3 as a6,Qa as a7,pu as a8,bm as a9,km as aA,Fm as aB,xc as aC,nr as aD,Lc as aE,wm as aF,eS as aG,Ht as aH,Ww as aI,n6 as aJ,ta as aK,oy as aL,Ce as aM,Xe as aN,Mm as aO,Bc as aP,nS as aQ,Sm as aR,sS as aS,iS as aT,gu as aU,aS as aV,Nc as aW,hS as aX,rS as aY,lS as aZ,uS as a_,yo as aa,_p as ab,Cp as ac,ny as ad,Pl as ae,kl as af,Rl as ag,vo as ah,kn as ai,o6 as aj,Qw as ak,W3 as al,ca as am,xr as an,Ip as ao,gS as ap,j3 as aq,yl as ar,Ws as as,ry as at,c6 as au,ma as av,Pm as aw,Om as ax,Lm as ay,Bm as az,ra as b,jn as b$,Eh as b0,oS as b1,_r as b2,cS as b3,Ap as b4,N3 as b5,mS as b6,pS as b7,Ep as b8,ln as b9,dS as bA,Rp as bB,fu as bC,yS as bD,_m as bE,ds as bF,L3 as bG,$3 as bH,Bw as bI,Lw as bJ,a6 as bK,Bt as bL,pa as bM,xS as bN,SS as bO,MS as bP,TS as bQ,bS as bR,wS as bS,G3 as bT,Pp as bU,St as bV,Rm as bW,tS as bX,Dw as bY,Uw as bZ,$w as b_,B3 as ba,r6 as bb,et as bc,Jw as bd,Zw as be,zw as bf,qw as bg,oo as bh,Ch as bi,H3 as bj,Xw as bk,Vw as bl,Xs as bm,Yw as bn,la as bo,Ts as bp,Nw as bq,Ah as br,Gw as bs,jw as bt,Hw as bu,cy as bv,Em as bw,qr as bx,fS as by,Am as bz,oa as c,l6 as c0,V3 as c1,Y3 as c2,X3 as c3,He as d,Ue as e,h6 as f,Qe as g,xs as h,nh as i,qs as j,Ut as k,De as l,ki as m,Ot as n,rp as o,Jt as p,pl as q,sr as r,Oe as s,ib as t,up as u,ch as v,Cm as w,Wr as x,iy as y,Im as z}; diff --git a/dist/assets/index-D9S6kMFu.css b/dist/assets/index-D9S6kMFu.css deleted file mode 100644 index 0e6a1dc..0000000 --- a/dist/assets/index-D9S6kMFu.css +++ /dev/null @@ -1 +0,0 @@ -.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-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-b3b109ad]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-b3b109ad]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-b3b109ad]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-b3b109ad]:active{cursor:grabbing}.hud[data-v-b3b109ad]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-b3b109ad]{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-b3b109ad]{width:3ch}.hud-particle-count[data-v-b3b109ad]{width:7ch;text-align:left}.hud-tip[data-v-b3b109ad]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-b3b109ad]{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-f9eac627]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-f9eac627]{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-f9eac627]:hover{background:#20202e}.group-reset[data-v-f9eac627]{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-f9eac627]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-f9eac627]{padding:8px 10px 12px}.caret[data-v-f9eac627]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-f9eac627]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-f9eac627]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-f9eac627]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-f9eac627]{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-f9eac627]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-f9eac627]{margin-top:10px}.stream-loop-options[data-v-f9eac627]{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-f9eac627]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-f9eac627]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-f9eac627]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-f9eac627]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(12px)}.loop-section-duration[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-f9eac627]{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-f9eac627]:focus{border-color:#716eff}.loop-auto-duration[data-v-f9eac627]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-f9eac627]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-f9eac627]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.seg[data-v-f9eac627]{display:flex;gap:6px;margin:6px 0}.inp.tiny[data-v-f9eac627]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-f9eac627]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-f9eac627]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-f9eac627]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-f9eac627]: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-f9eac627]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(14px)}.modifier-hint[data-v-f9eac627]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-f9eac627]{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-f9eac627]{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-96ef634f]{color:#667;font-size:12px;padding:8px 0}.group[data-v-96ef634f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-96ef634f]{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-96ef634f]:hover{background:#20202e}.group-reset[data-v-96ef634f]{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-96ef634f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-96ef634f]{padding:8px 10px 12px}.caret[data-v-96ef634f]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-96ef634f]{height:1px;background:#2a2a3c;margin:8px 0}.field-block[data-v-96ef634f]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-96ef634f]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-96ef634f]{color:#5f6d86;line-height:1.5}.field-grid[data-v-96ef634f]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-96ef634f]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-96ef634f]{width:100%;min-height:30px;box-sizing:border-box}.tag[data-v-96ef634f]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-96ef634f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-96ef634f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-96ef634f]{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-96ef634f]{width:28px;height:22px;border:none;background:none;cursor:pointer}.placeholder[data-v-96ef634f]{color:#667;font-size:11px;padding:6px 0}.image-add[data-v-96ef634f]{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-96ef634f]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-96ef634f]{height:1px;margin:9px 0 7px;background:#2a3549}.hex-input[data-v-96ef634f]{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-96ef634f]:focus{border-color:#7774ff;color:#fff}.alpha-modes[data-v-96ef634f]{display:flex;gap:3px}.alpha-modes button[data-v-96ef634f]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-96ef634f]:hover{background:#273246}.alpha-modes button.on[data-v-96ef634f]{border-color:#7774ff;background:#605df0;color:#fff}.file-input[data-v-96ef634f]{display:none}.hex[data-v-96ef634f]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-96ef634f]{width:46px;flex:0 0 46px;text-align:center}.axis-mode[data-v-96ef634f]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-96ef634f]{border-color:#7774ff;background:#605df0;color:#fff}.switch-row[data-v-96ef634f]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-96ef634f]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-96ef634f]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-96ef634f]: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-96ef634f]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-96ef634f]:after{transform:translate(14px)}.modifier-item[data-v-96ef634f]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.modifier-switch[data-v-96ef634f]{font-weight:600}.modifier-params[data-v-96ef634f]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-96ef634f]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-96ef634f]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-96ef634f]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-96ef634f]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-96ef634f]{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-96ef634f]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-96ef634f]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-96ef634f]{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-96ef634f]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-96ef634f]{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-96ef634f]:hover,.collision-filter-add.active[data-v-96ef634f]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-96ef634f]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-96ef634f]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-96ef634f]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-96ef634f]{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-96ef634f]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-96ef634f]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-96ef634f]{flex:none;color:#68758d;font-size:9px}.switch-row input:disabled+.switch-ui[data-v-96ef634f]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-96ef634f]{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-96ef634f]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-96ef634f]{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-96ef634f]{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-96ef634f]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-96ef634f]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-96ef634f]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-96ef634f]{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-96ef634f]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-96ef634f]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-96ef634f] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-96ef634f]{padding-right:2px}.trail-section-title[data-v-96ef634f]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-fixed-color .hex-input[data-v-96ef634f]{min-width:0;flex:1}.trail-mode-head[data-v-96ef634f]{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-96ef634f]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-96ef634f]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-96ef634f] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-96ef634f] .ns-label{width:100%}.trail-grid-row[data-v-96ef634f] .ns-range{min-width:0}.trail-grid-row[data-v-96ef634f] .ns-num{width:42px}.trail-params[data-v-96ef634f] .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-1e581e89]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-1e581e89]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-1e581e89]{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-1e581e89]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-range[data-v-1e581e89]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-1e581e89]{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-1e581e89]:focus{border-color:#716eff}.tl-loop-range[data-v-1e581e89]{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-1e581e89]:hover{border-color:#716eff;color:#fff}.tl-frame[data-v-1e581e89]{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-1e581e89]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-1e581e89]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-1e581e89]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-1e581e89]{margin-left:4px;background:#2f8b62}.legend-life[data-v-1e581e89]{margin-left:5px;background:#a54551}.legend-spine[data-v-1e581e89]{margin-left:5px;background:#7448b8}.tl-anim[data-v-1e581e89]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-1e581e89]{position:relative}.tl-animation-trigger[data-v-1e581e89]{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-1e581e89]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-1e581e89]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-1e581e89]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-1e581e89]{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-1e581e89]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-1e581e89]{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-1e581e89]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-1e581e89]:hover{background:#252e42}.tl-animation-option.on[data-v-1e581e89]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-1e581e89]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-1e581e89]{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-1e581e89]{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-1e581e89]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-1e581e89],.tl-animation-actions button[data-v-1e581e89]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-1e581e89]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-1e581e89]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-1e581e89]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-1e581e89]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-1e581e89]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-1e581e89]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-1e581e89]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-1e581e89]{max-width:190px}.tl-zoom[data-v-1e581e89]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-1e581e89]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-1e581e89]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-1e581e89]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-1e581e89]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-1e581e89]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-1e581e89]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-1e581e89]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-1e581e89]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-bar[data-v-1e581e89]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-1e581e89]:active{cursor:grabbing}.lane-name[data-v-1e581e89]{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-1e581e89]{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-1e581e89]{border-color:#667085;background:#242b39}.bar-emission[data-v-1e581e89]{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-1e581e89]{border-radius:0}.bar-loop-transition[data-v-1e581e89]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-1e581e89]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-1e581e89]{border-radius:0 5px 5px 0}.bar-handle[data-v-1e581e89]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-1e581e89]:hover{background:#ffffff59}.spine-ico[data-v-1e581e89]{color:#c08cff}.spine-bar[data-v-1e581e89]{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-1e581e89]:active{cursor:grabbing}.tl-empty[data-v-1e581e89]{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}html,body,#app{-webkit-user-select:none;user-select:none}input,textarea,select,[contenteditable=true]{-webkit-user-select:text;user-select:text}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/index.html b/dist/index.html index 135890b..608a7c3 100644 --- a/dist/index.html +++ b/dist/index.html @@ -8,8 +8,8 @@ html, body { margin: 0; padding: 0; background: #111; color: #eee; font-family: system-ui, -apple-system, sans-serif; } #app { display: flex; flex-direction: column; height: 100vh; } - - + +
diff --git a/package.json b/package.json index 5d13b29..9c9d80f 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "test:timeline": "node scripts/verify-timeline.mjs", "test:spine-json": "node scripts/verify-spine-json.mjs", "test:spine-naming": "node scripts/verify-spine-naming.mjs", + "test:render-layer": "node scripts/verify-render-layer.mjs", "test:connector": "node scripts/verify-spine-connector.mjs", "test:connector:spine38-path": "node scripts/verify-spine38-connector-path.mjs", "test:connector:sea": "node scripts/verify-connector-sea.mjs", diff --git a/scripts/verify-render-layer.mjs b/scripts/verify-render-layer.mjs new file mode 100644 index 0000000..a1162f8 --- /dev/null +++ b/scripts/verify-render-layer.mjs @@ -0,0 +1,73 @@ +import { build } from 'esbuild' + +const bundled = await build({ + bundle: true, + entryPoints: ['src/views/stage/renderLayer.ts'], + format: 'esm', + platform: 'node', + write: false, +}) +const { resolveRenderTarget } = await import( + `data:text/javascript;base64,${Buffer.from(bundled.outputFiles[0].text).toString('base64')}` +) + +const spines = [{ + id: 7, + enabled: true, + status: 'ready', + slots: [ + { name: 'slot_back', order: 0 }, + { name: 'slot_body', order: 1 }, + { name: 'slot_hand', order: 2 }, + ], +}] +const base = { + renderLayerMode: 'slot', + renderLayerSpineId: 7, + renderLayerSlotName: 'slot_hand', + renderLayerSlotPosition: 'above', + renderLayerFollowAttachment: true, +} + +function expect(actual, expected, label) { + if (JSON.stringify(actual) !== JSON.stringify(expected)) { + throw new Error(`${label}: expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`) + } +} + +expect(resolveRenderTarget(spines, { ...base, renderLayerMode: 'top' }), null, '最上层不应挂槽位') +expect( + resolveRenderTarget(spines, base), + { spineId: 7, slotName: 'slot_hand', targetSlotName: 'slot_hand', followAttachment: true }, + '图片之上应挂到目标插槽', +) +expect( + resolveRenderTarget(spines, { ...base, renderLayerSlotPosition: 'below' }), + { spineId: 7, slotName: 'slot_body', targetSlotName: 'slot_hand', followAttachment: false }, + '图片之下应挂到 drawOrder 前一个插槽', +) +expect( + resolveRenderTarget(spines, { ...base, renderLayerSlotPosition: 'below' }, ['slot_back', 'slot_hand', 'slot_body']), + { spineId: 7, slotName: 'slot_back', targetSlotName: 'slot_hand', followAttachment: false }, + '动画 drawOrder 变化时应按当前顺序取前一个插槽', +) +expect( + resolveRenderTarget(spines, { ...base, renderLayerSlotPosition: 'below' }, ['slot_hand', 'slot_body', 'slot_back']), + null, + '当前 drawOrder 中目标位于最底层时无法放在其下方', +) +expect( + resolveRenderTarget(spines, { ...base, renderLayerSlotName: 'slot_body', renderLayerSlotPosition: 'below' }, ['slot_hand', 'slot_body', 'slot_back']), + { spineId: 7, slotName: 'slot_hand', targetSlotName: 'slot_body', followAttachment: false }, + '当前 drawOrder 中应取紧邻的前一个插槽', +) +expect( + resolveRenderTarget(spines, { ...base, renderLayerSlotName: 'slot_back', renderLayerSlotPosition: 'below' }), + null, + '第一个插槽下方没有可用层级', +) +expect(resolveRenderTarget(spines, { ...base, renderLayerSlotName: 'missing' }), null, '插槽不存在时应回退') +expect(resolveRenderTarget([{ ...spines[0], enabled: false }], base), null, 'Spine 停用时应回退') +expect(resolveRenderTarget([{ ...spines[0], status: 'loading' }], base), null, 'Spine 未就绪时应回退') + +console.log('渲染层级解析校验通过:最上层 / 插槽之上 / 插槽之下 / 动画 drawOrder / 失效回退') diff --git a/src/core/particleConfig.ts b/src/core/particleConfig.ts index 855ca20..36477c9 100644 --- a/src/core/particleConfig.ts +++ b/src/core/particleConfig.ts @@ -65,6 +65,11 @@ export function defaultConfig(): EmitterConfig { rootRotation: 0, rootScaleX: 1, rootScaleY: 1, + renderLayerMode: 'top', + renderLayerSpineId: 0, + renderLayerSlotName: '', + renderLayerSlotPosition: 'above', + renderLayerFollowAttachment: false, emissionAngleMode: 'random', direction: 0, spread: 360, @@ -296,6 +301,11 @@ export function ensureEmitterConfig(config: EmitterConfig): EmitterConfig { if (config.shape !== 'path' && (config.emissionAngleMode === 'path-normal' || config.emissionAngleMode === 'path-tangent')) config.emissionAngleMode = 'fixed' config.spawnPathId = Math.max(0, Math.round(Number(config.spawnPathId) || 0)) if (config.spawnPathDistribution !== 'fixed' && config.spawnPathDistribution !== 'random') config.spawnPathDistribution = 'fixed' + if (config.renderLayerMode !== 'top' && config.renderLayerMode !== 'slot') config.renderLayerMode = 'top' + config.renderLayerSpineId = Math.max(0, Math.round(Number(config.renderLayerSpineId) || 0)) + if (typeof config.renderLayerSlotName !== 'string') config.renderLayerSlotName = '' + if (config.renderLayerSlotPosition !== 'above' && config.renderLayerSlotPosition !== 'below') config.renderLayerSlotPosition = 'above' + if (typeof config.renderLayerFollowAttachment !== 'boolean') config.renderLayerFollowAttachment = false config.innerRadius = Math.max(0, Number(config.innerRadius) || 0) config.outerRadius = Math.max(config.innerRadius, Number(config.outerRadius) || 0) config.innerRectW = Math.max(0, Number(config.innerRectW) || 0) diff --git a/src/core/particleTypes.ts b/src/core/particleTypes.ts index 6081097..a469234 100644 --- a/src/core/particleTypes.ts +++ b/src/core/particleTypes.ts @@ -13,6 +13,9 @@ export type AttributeMode = 'fixed' | 'random' | 'curve' export type RotationMode = AttributeMode | 'direction' export type ScaleAxisMode = 'uniform' | 'separate' export type FieldFalloff = 'constant' | 'linear' | 'inverse' +/** 粒子系统在 Spine 绘制顺序中的位置(仅影响编辑器预览)。 */ +export type RenderLayerMode = 'top' | 'slot' +export type RenderLayerPosition = 'above' | 'below' export interface CurvePoint { x: number; y: number; inX?: number; inY?: number; outX?: number; outY?: number } export interface ColorGradientStop { position: number; color: string } @@ -168,6 +171,12 @@ export interface EmitterConfig { rootRotation: number rootScaleX: number rootScaleY: number + // ==== 渲染层级(仅编辑器预览;不写入 Spine 导出数据)==== + renderLayerMode: RenderLayerMode + renderLayerSpineId: number + renderLayerSlotName: string + renderLayerSlotPosition: RenderLayerPosition + renderLayerFollowAttachment: boolean // 方向 emissionAngleMode: EmissionAngleMode direction: number diff --git a/src/editor/editorConfig.ts b/src/editor/editorConfig.ts index c4c5e83..4185a22 100644 --- a/src/editor/editorConfig.ts +++ b/src/editor/editorConfig.ts @@ -223,6 +223,9 @@ export async function applyEditorConfig(store: EditorStore, input: EditorConfigF for (const spine of spines) { if (spine.sourceBundle == null) spine.sourceBundle = null if (spine.dataVersion == null) spine.dataVersion = '' + if (!Array.isArray(spine.slots)) spine.slots = [] + if (typeof spine.selectedBone !== 'string') spine.selectedBone = '' + if (typeof spine.selectedSlot !== 'string') spine.selectedSlot = '' } await hydrateParticleResources(systems) @@ -257,6 +260,7 @@ export async function applyEditorConfig(store: EditorStore, input: EditorConfigF spine.error = spine.skeletonFileName ? '配置未包含可复用的 Spine 原始资源' : '' spine.animations = [] spine.bones = [] + spine.slots = [] spine.selectedAnimation = '' continue } @@ -264,6 +268,7 @@ export async function applyEditorConfig(store: EditorStore, input: EditorConfigF spine.dataVersion = parsed.dataVersion spine.animations = parsed.animations spine.bones = parsed.bones + spine.slots = parsed.slots if (!parsed.animations.some((animation) => animation.name === spine.selectedAnimation)) { spine.selectedAnimation = parsed.animations[0]?.name || '' } diff --git a/src/spine/SpineObjectPanel.vue b/src/spine/SpineObjectPanel.vue index 791ecf6..1aa2eef 100644 --- a/src/spine/SpineObjectPanel.vue +++ b/src/spine/SpineObjectPanel.vue @@ -62,6 +62,7 @@
层级树
- + +
-
未加载 Spine
- + +
渲染层级(Spine 插槽)
+
+ + +
+ +
图片资源 @@ -105,7 +158,7 @@ import ColorGradientEditor from '../ColorGradientEditor.vue' import ImageResourceCard from '../ImageResourceCard.vue' import SpineObjectPanel from '../../spine/SpineObjectPanel.vue' import { useParticlePanelContext } from './particlePanelContext' -const { resolvedCurveEditorMode, sys, textureFileInput, sequenceFileInput, addImageResource, openTexturePicker, openSequencePicker, onTextureFile, onSequenceFiles, resetTexture, setResourceFixedColor, commitResourceFixedColor, removeImageResource, setResourceWeight, toggleResourceLock, collapsed, toggle, resetModule, select, ALPHA_CURVE, RESOURCE_ALPHA_CURVE } = useParticlePanelContext() +const { resolvedCurveEditorMode, sys, textureFileInput, sequenceFileInput, addImageResource, openTexturePicker, openSequencePicker, onTextureFile, onSequenceFiles, resetTexture, setResourceFixedColor, commitResourceFixedColor, removeImageResource, setResourceWeight, toggleResourceLock, collapsed, toggle, resetModule, select, renderLayerSlotPickerOpen, renderLayerSlotSearch, renderLayerReadySpines, renderLayerSpineReady, renderLayerFilteredSlots, renderLayerSlotLabel, renderLayerResolvedLabel, renderLayerWarning, setRenderLayerSlotMode, selectRenderLayerSpine, pickRenderLayerSlot, clearRenderLayerSlot, ALPHA_CURVE, RESOURCE_ALPHA_CURVE } = useParticlePanelContext() diff --git a/src/views/particle-panel/useParticlePanel.ts b/src/views/particle-panel/useParticlePanel.ts index 19406cf..a88cc92 100644 --- a/src/views/particle-panel/useParticlePanel.ts +++ b/src/views/particle-panel/useParticlePanel.ts @@ -83,6 +83,104 @@ const boundSpineBone = computed(() => { if (!spine || !spine.bones.some((bone) => bone.name === config.emitterFollowBoneName)) return null return { spine, boneName: config.emitterFollowBoneName } }) + +// ===== 渲染层级(仅编辑器预览) ===== +const renderLayerSlotPickerOpen = ref(false) +const renderLayerSlotSearch = ref('') +const renderLayerReadySpines = computed(() => + store.spines.filter((spine) => spine.enabled && spine.visible !== false && spine.status === 'ready'), +) +const renderLayerSpine = computed(() => + store.spines.find((spine) => spine.id === sys.value?.config.renderLayerSpineId) || null, +) +const renderLayerSpineReady = computed(() => { + const spine = renderLayerSpine.value + return !!spine && spine.enabled && spine.visible !== false && spine.status === 'ready' +}) +const renderLayerSlots = computed(() => + [...(renderLayerSpine.value?.slots || [])].sort((a, b) => a.order - b.order), +) +const renderLayerFilteredSlots = computed(() => { + const query = renderLayerSlotSearch.value.trim().toLocaleLowerCase() + if (!query) return renderLayerSlots.value + return renderLayerSlots.value.filter((slot) => + slot.name.toLocaleLowerCase().includes(query) || slot.attachment.toLocaleLowerCase().includes(query), + ) +}) +const renderLayerTargetSlot = computed(() => + renderLayerSlots.value.find((slot) => slot.name === sys.value?.config.renderLayerSlotName) || null, +) +const renderLayerPreviousSlot = computed(() => { + const target = renderLayerTargetSlot.value + if (!target) return null + return renderLayerSlots.value.filter((slot) => slot.order < target.order).sort((a, b) => b.order - a.order)[0] || null +}) +const renderLayerSlotLabel = computed(() => { + const config = sys.value?.config + const spine = renderLayerSpine.value + const target = renderLayerTargetSlot.value + if (!config || !spine || !target) return '' + return `${spine.name} / ${target.name} · 图片${config.renderLayerSlotPosition === 'below' ? '之下' : '之上'}` +}) +const renderLayerResolvedLabel = computed(() => { + const config = sys.value?.config + const target = renderLayerTargetSlot.value + if (!config || !target) return '' + if (config.renderLayerSlotPosition === 'above') return `渲染在 ${target.name} 图片之上、其后插槽之下` + return renderLayerPreviousSlot.value + ? `渲染在 ${renderLayerPreviousSlot.value.name} 与 ${target.name} 之间` + : '' +}) +const renderLayerWarning = computed(() => { + const config = sys.value?.config + if (!config || config.renderLayerMode !== 'slot') return '' + if (!renderLayerReadySpines.value.length) return '没有已加载的 Spine,粒子临时显示在最上层。' + if (!config.renderLayerSpineId) return '尚未选择 Spine,粒子临时显示在最上层。' + const spine = renderLayerSpine.value + if (!spine) return '目标 Spine 不存在,粒子临时显示在最上层。' + if (!spine.enabled || spine.status !== 'ready') return '目标 Spine 未就绪,粒子临时显示在最上层。' + // 未选择插槽时面板本身已显示“尚未选择插槽”,这里不再重复提示。 + if (!config.renderLayerSlotName) return '' + if (!renderLayerTargetSlot.value) return '目标插槽不存在(资源可能已更换),粒子临时显示在最上层。' + if (config.renderLayerSlotPosition === 'below' && !renderLayerPreviousSlot.value) { + return '这是第一个插槽,无法显示在其下方,粒子临时显示在最上层。' + } + return '' +}) + +function setRenderLayerSlotMode() { + const config = sys.value?.config + if (!config) return + config.renderLayerMode = 'slot' + if (!config.renderLayerSpineId && renderLayerReadySpines.value.length) { + config.renderLayerSpineId = renderLayerReadySpines.value[0].id + } + renderLayerSlotPickerOpen.value = !config.renderLayerSlotName +} + +function selectRenderLayerSpine(event: Event) { + const config = sys.value?.config + if (!config) return + config.renderLayerSpineId = Math.max(0, Math.round(Number((event.target as HTMLSelectElement).value) || 0)) + config.renderLayerSlotName = '' + renderLayerSlotPickerOpen.value = true +} + +function pickRenderLayerSlot(slot: { name: string }) { + const config = sys.value?.config + if (!config) return + config.renderLayerSlotName = slot.name + renderLayerSlotPickerOpen.value = false + renderLayerSlotSearch.value = '' +} + +function clearRenderLayerSlot() { + const config = sys.value?.config + if (!config) return + config.renderLayerSlotName = '' + config.renderLayerSlotPosition = 'above' +} + const collisionPickerOpen = ref(false) const selectedCollisionBodies = computed(() => { const ids = new Set(sys.value?.config.collisionColliderIds || []) @@ -96,6 +194,10 @@ const availableCollisionBodies = computed(() => { watch(() => [sys.value?.id, sys.value?.config.collision], () => { collisionPickerOpen.value = false }) +watch(() => sys.value?.id, () => { + renderLayerSlotPickerOpen.value = false + renderLayerSlotSearch.value = '' +}) function addCollisionBody(colliderId: number) { const config = sys.value?.config @@ -156,6 +258,18 @@ watchEffect(() => { } }) +// 渲染层级:仅当 Spine 对象被删除时清空绑定;资源尚未就绪时保留绑定,等加载完成后自动恢复。 +watchEffect(() => { + for (const system of store.systems) { + const config = ensureEmitterConfig(system.config as any) + if (config.renderLayerMode !== 'slot' || !config.renderLayerSpineId) continue + if (!store.spines.some((spine) => spine.id === config.renderLayerSpineId)) { + config.renderLayerSpineId = 0 + config.renderLayerSlotName = '' + } + } +}) + // HMR 或旧场景中的碰撞体缺少路径跟随字段时即时补齐。 watchEffect(() => { for (const collider of store.colliders) { @@ -320,6 +434,8 @@ const MODULE_RESET_KEYS: Record, string[]> = { 'alpha', 'alphaEnd', 'colorStart', 'colorEnd', 'colorOverLife', 'blend', 'alphaMode', 'curveMode', 'alphaCurve', 'textureName', 'textureFolder', 'alphaScale', 'anchorX', 'anchorY', 'independentAlpha', + 'renderLayerMode', 'renderLayerSpineId', 'renderLayerSlotName', + 'renderLayerSlotPosition', 'renderLayerFollowAttachment', ], mods: [ 'noise', 'noiseAmt', 'noiseRange', 'noiseSpeed', @@ -455,5 +571,5 @@ function onSpawnPathChange() { // 重置/删除图片 → 回到默认 star.png -return { store, exportSettings, exportBusy, exportTarget, exportMessage, exportError, connectorPairUrl, connectorStatusText, connectorStatusClass, connectorReady, connectorAuthorizationUrl, connectorDisabledReason, connectorButtonTitle, refreshConnectorHealth, exportSpineJson, exportSpineProject, exportSpineImages, configFileInput, selectedPreset, presetOptions, presetLoading, configMessage, configError, saveConfig, onConfigFileChange, refreshPresets, loadSelectedPreset, resolvedCurveEditorMode, sys, textureFileInput, sequenceFileInput, trailTextureFileInput, addTrailResource, openTrailTexturePicker, onTrailRigChange, onTrailResourceBoneCountChange, onTrailResourceRotationChange, onTrailTextureFile, resetTrailTexture, removeTrailResource, setTrailResourceWeight, toggleTrailResourceLock, setTrailColor, commitTrailColor, addImageResource, openTexturePicker, openSequencePicker, onTextureFile, onSequenceFiles, resetTexture, setResourceFixedColor, commitResourceFixedColor, removeImageResource, setResourceWeight, toggleResourceLock, automaticLoopDuration, loopDurationFrames, activeObjectType, activeCollider, activePath, activeSpine, canCopyObject, selectedSpineBone, boundSpineBone, collisionPickerOpen, selectedCollisionBodies, availableCollisionBodies, addCollisionBody, removeCollisionBody, collapsed, toggle, setEmitMode, setLoopDurationFrames, setStreamBehavior, setLoopSection, setLoopSectionDuration, setLoopCustomDuration, onEmitterFollowModeChange, bindSelectedBone, resetModule, normalizeExportFps, select, addSys, addCollider, addPath, addSpine, copySelectedObject, applyPathPreset, clearPathAnchors, randomizeSeed, setSpeedOverLifeMode, prepareScaleOverLifeCurve, setScaleOverLifeMode, onShapeChange, onSpawnPathChange, LINEAR_CURVE, FLAT_CURVE, ALPHA_CURVE, RESOURCE_ALPHA_CURVE, TRAIL_ALPHA_CURVE, TRAIL_SHAPE_CURVE } +return { store, exportSettings, exportBusy, exportTarget, exportMessage, exportError, connectorPairUrl, connectorStatusText, connectorStatusClass, connectorReady, connectorAuthorizationUrl, connectorDisabledReason, connectorButtonTitle, refreshConnectorHealth, exportSpineJson, exportSpineProject, exportSpineImages, configFileInput, selectedPreset, presetOptions, presetLoading, configMessage, configError, saveConfig, onConfigFileChange, refreshPresets, loadSelectedPreset, resolvedCurveEditorMode, sys, textureFileInput, sequenceFileInput, trailTextureFileInput, addTrailResource, openTrailTexturePicker, onTrailRigChange, onTrailResourceBoneCountChange, onTrailResourceRotationChange, onTrailTextureFile, resetTrailTexture, removeTrailResource, setTrailResourceWeight, toggleTrailResourceLock, setTrailColor, commitTrailColor, addImageResource, openTexturePicker, openSequencePicker, onTextureFile, onSequenceFiles, resetTexture, setResourceFixedColor, commitResourceFixedColor, removeImageResource, setResourceWeight, toggleResourceLock, automaticLoopDuration, loopDurationFrames, activeObjectType, activeCollider, activePath, activeSpine, canCopyObject, selectedSpineBone, boundSpineBone, renderLayerSlotPickerOpen, renderLayerSlotSearch, renderLayerReadySpines, renderLayerSpineReady, renderLayerSlots, renderLayerFilteredSlots, renderLayerSlotLabel, renderLayerResolvedLabel, renderLayerWarning, setRenderLayerSlotMode, selectRenderLayerSpine, pickRenderLayerSlot, clearRenderLayerSlot, collisionPickerOpen, selectedCollisionBodies, availableCollisionBodies, addCollisionBody, removeCollisionBody, collapsed, toggle, setEmitMode, setLoopDurationFrames, setStreamBehavior, setLoopSection, setLoopSectionDuration, setLoopCustomDuration, onEmitterFollowModeChange, bindSelectedBone, resetModule, normalizeExportFps, select, addSys, addCollider, addPath, addSpine, copySelectedObject, applyPathPreset, clearPathAnchors, randomizeSeed, setSpeedOverLifeMode, prepareScaleOverLifeCurve, setScaleOverLifeMode, onShapeChange, onSpawnPathChange, LINEAR_CURVE, FLAT_CURVE, ALPHA_CURVE, RESOURCE_ALPHA_CURVE, TRAIL_ALPHA_CURVE, TRAIL_SHAPE_CURVE } } diff --git a/src/views/stage/emitterSync.ts b/src/views/stage/emitterSync.ts index 0d27e23..c68e7bc 100644 --- a/src/views/stage/emitterSync.ts +++ b/src/views/stage/emitterSync.ts @@ -1,10 +1,12 @@ -import { Texture, type Container } from 'pixi.js' +import { Container, Texture } from 'pixi.js' import { ParticleEmitter, ensureEmitterConfig } from '../../core/particleEmitter' import { sampleScenePath } from '../../core/scenePathSampler' import type { EmitterConfig } from '../../core/particleTypes' import { followCurveValue } from './stageGeometry' import type { useParticleStore, CollisionBody } from '../../store/particleStore' import type { ScenePath } from '../../store/particleStore' +import type { SpineRuntimeLayer } from '../../spine/SpineRuntimeLayer' +import { resolveRenderTarget, type RenderTarget } from './renderLayer' type EditorStore = ReturnType @@ -67,17 +69,28 @@ export function buildPreviewColliders(store: EditorStore, timeSeconds: number): export class EmitterSync { readonly emitters = new Map() private configs = new Map() + /** 渲染层级:一个插槽对应一个 wrapper(同插槽多系统共用),内部 compensator 抵消插槽骨骼变换。 */ + private slotGroups = new Map() sync( store: EditorStore, world: Container, dotTex: Texture | null, trailTex: Texture | null, + spineRuntime: SpineRuntimeLayer | null = null, ) { for (const [id, em] of this.emitters) { const system = store.systems.find((item) => item.id === id) if (!system || this.configs.get(id) !== system.config) { - world.removeChild(em) + em.removeFromParent() em.destroy({ children: true }) this.emitters.delete(id) this.configs.delete(id) @@ -103,15 +116,98 @@ export class EmitterSync { this.emitters.set(sys.id, em) this.configs.set(sys.id, sys.config) } + + const activeGroups = new Set() + for (const sys of store.systems) { + const em = this.emitters.get(sys.id) + if (!em) continue + const drawOrder = spineRuntime && sys.config.renderLayerMode === 'slot' + ? spineRuntime.getDrawOrder(sys.config.renderLayerSpineId) + : null + const target = resolveRenderTarget(store.spines, sys.config, drawOrder) + const group = target && spineRuntime ? this.ensureSlotGroup(target, spineRuntime, sys.config) : null + if (group) { + activeGroups.add(group.key) + if (em.parent !== group.compensator) group.compensator.addChild(em) + } else if (em.parent !== world) { + world.addChild(em) + } + } + for (const [key, group] of [...this.slotGroups]) { + if (activeGroups.has(key)) continue + for (const child of [...group.compensator.children]) { + if (child instanceof ParticleEmitter && child.parent === group.compensator) world.addChild(child) + } + spineRuntime?.detachSlotObject(group.spineId, group.slotName, group.wrapper) + group.wrapper.removeFromParent() + group.wrapper.removeChild(group.compensator) + group.compensator.destroy() + group.wrapper.destroy() + this.slotGroups.delete(key) + } + } + + private ensureSlotGroup( + target: RenderTarget, + spineRuntime: SpineRuntimeLayer, + config: { renderLayerFollowAttachment: boolean; renderLayerSlotPosition: string }, + ) { + // 以“用户配置的目标插槽 + 上/下”分组;drawOrder 变化导致实际挂载插槽改变时只重挂,不重建分组。 + const key = `${target.spineId}:${target.targetSlotName}:${config.renderLayerSlotPosition}` + let group = this.slotGroups.get(key) + if (!group) { + const wrapper = new Container() + const compensator = new Container() + wrapper.addChild(compensator) + group = { + key, + spineId: target.spineId, + slotName: target.slotName, + wrapper, + compensator, + followAttachment: config.renderLayerFollowAttachment, + attached: false, + } + this.slotGroups.set(key, group) + } + // 同一插槽的多个系统共用一个 wrapper,跟随设置以首个挂载的系统为准,避免逐帧反复重挂。 + if (!group.attached || !group.wrapper.parent || group.slotName !== target.slotName) { + if (group.wrapper.parent) spineRuntime.detachSlotObject(group.spineId, group.slotName, group.wrapper) + group.slotName = target.slotName + group.attached = spineRuntime.attachSlotObject(group.spineId, group.slotName, group.wrapper, target.followAttachment) + } + return group.attached ? group : null + } + + /** 每帧在 Spine 同步之后调用:把插槽骨骼变换抵消掉,粒子仍保持在编辑器世界坐标中。 */ + updateRenderCompensation(store: EditorStore, spineRuntime: SpineRuntimeLayer | null) { + if (!spineRuntime) return + for (const group of this.slotGroups.values()) { + if (!group.attached || !group.wrapper.parent) continue + const spine = store.spines.find((item) => item.id === group.spineId) + if (!spine) continue + const parent = spineRuntime.getSlotParentMatrix(group.spineId, group.slotName, spine) + if (!parent) continue + parent.invert() + group.compensator.transform.setFromMatrix(parent) + } } /** 卸载时销毁全部发射器。 */ destroy(world: Container) { + for (const group of this.slotGroups.values()) { + for (const child of [...group.compensator.children]) group.compensator.removeChild(child) + group.wrapper.removeFromParent() + group.compensator.destroy() + group.wrapper.destroy() + } + this.slotGroups.clear() for (const [id, em] of this.emitters) { - world.removeChild(em) + em.removeFromParent() em.destroy({ children: true }) this.emitters.delete(id) this.configs.delete(id) } } } + diff --git a/src/views/stage/renderLayer.ts b/src/views/stage/renderLayer.ts new file mode 100644 index 0000000..34a6eeb --- /dev/null +++ b/src/views/stage/renderLayer.ts @@ -0,0 +1,70 @@ +/** 配置中的渲染层级字段(仅编辑器预览)。 */ +export interface RenderLayerConfig { + renderLayerMode: string + renderLayerSpineId: number + renderLayerSlotName: string + renderLayerSlotPosition: string + renderLayerFollowAttachment: boolean +} + +export interface RenderLayerSlot { + name: string + order: number +} + +export interface RenderLayerSpine { + id: number + enabled: boolean + status: string + slots?: RenderLayerSlot[] +} + +/** 实际要挂载的插槽;below 会解析到当前 drawOrder 中的前一个插槽。 */ +export interface RenderTarget { + spineId: number + /** 实际挂载的插槽 */ + slotName: string + /** 用户配置的目标插槽(用于分组与重挂判断) */ + targetSlotName: string + followAttachment: boolean +} + +/** + * SpinePixi 的 addSlotObject 渲染在该插槽附件之上,所以「在此插槽图片之下」 + * 需要挂到当前 drawOrder 中紧邻的前一个插槽。传入 drawOrder 时按动画实时顺序解析, + * 否则回退到 setup 顺序(用于没有运行时或旧数据)。 + */ +export function resolveRenderTarget( + spines: readonly RenderLayerSpine[], + config: RenderLayerConfig, + drawOrder?: readonly string[] | null, +): RenderTarget | null { + if (config.renderLayerMode !== 'slot') return null + const spine = spines.find((item) => item.id === config.renderLayerSpineId && item.enabled && item.status === 'ready') + if (!spine) return null + const slots = spine.slots || [] + const target = slots.find((slot) => slot.name === config.renderLayerSlotName) + if (!target) return null + if (config.renderLayerSlotPosition === 'below') { + let attachSlotName = '' + if (drawOrder?.length) { + const index = drawOrder.indexOf(target.name) + if (index === 0) return null + if (index > 0) attachSlotName = drawOrder[index - 1] + } + if (!attachSlotName) { + const previous = slots + .filter((slot) => slot.order < target.order) + .sort((a, b) => b.order - a.order)[0] + if (!previous) return null + attachSlotName = previous.name + } + return { spineId: spine.id, slotName: attachSlotName, targetSlotName: target.name, followAttachment: false } + } + return { + spineId: spine.id, + slotName: target.name, + targetSlotName: target.name, + followAttachment: config.renderLayerFollowAttachment, + } +}