diff --git a/dist/assets/index-BrVMjrya.js b/dist/assets/index-B-woOuPC.js similarity index 99% rename from dist/assets/index-BrVMjrya.js rename to dist/assets/index-B-woOuPC.js index 8392355..2fcf062 100644 --- a/dist/assets/index-BrVMjrya.js +++ b/dist/assets/index-B-woOuPC.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-yJqyT1FD.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-yJqyT1FD.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-CQJ6qUg9.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-CQJ6qUg9.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-CQJ6qUg9.js b/dist/assets/index-CQJ6qUg9.js new file mode 100644 index 0000000..df89f26 --- /dev/null +++ b/dist/assets/index-CQJ6qUg9.js @@ -0,0 +1,1239 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DPMVQNnV.js","assets/index-B-woOuPC.js"])))=>i.map(i=>d[i]); +var CS=Object.defineProperty;var IS=(s,e,t)=>e in s?CS(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var x=(s,e,t)=>IS(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 a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).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 ti={},mo=[],Fn=()=>{},by=()=>!1,Qh=s=>s.charCodeAt(0)===111&&s.charCodeAt(1)===110&&(s.charCodeAt(2)>122||s.charCodeAt(2)<97),eu=s=>s.startsWith("onUpdate:"),ki=Object.assign,Zm=(s,e)=>{const t=s.indexOf(e);t>-1&&s.splice(t,1)},RS=Object.prototype.hasOwnProperty,qt=(s,e)=>RS.call(s,e),ft=Array.isArray,po=s=>Yl(s)==="[object Map]",Bo=s=>Yl(s)==="[object Set]",$p=s=>Yl(s)==="[object Date]",_t=s=>typeof s=="function",gi=s=>typeof s=="string",As=s=>typeof s=="symbol",Kt=s=>s!==null&&typeof s=="object",wy=s=>(Kt(s)||_t(s))&&_t(s.then)&&_t(s.catch),Sy=Object.prototype.toString,Yl=s=>Sy.call(s),PS=s=>Yl(s).slice(8,-1),_y=s=>Yl(s)==="[object Object]",tu=s=>gi(s)&&s!=="NaN"&&s[0]!=="-"&&""+parseInt(s,10)===s,hl=Km(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),iu=s=>{const e=Object.create(null);return(t=>e[t]||(e[t]=s(t)))},kS=/-\w/g,Ks=iu(s=>s.replace(kS,e=>e.slice(1).toUpperCase())),FS=/\B([A-Z])/g,Kr=iu(s=>s.replace(FS,"-$1").toLowerCase()),My=iu(s=>s.charAt(0).toUpperCase()+s.slice(1)),Bu=iu(s=>s?`on${My(s)}`:""),Cn=(s,e)=>!Object.is(s,e),Uc=(s,...e)=>{for(let t=0;t{Object.defineProperty(s,e,{configurable:!0,enumerable:!1,writable:i,value:t})},su=s=>{const e=parseFloat(s);return isNaN(e)?s:e},OS=s=>{const e=gi(s)?Number(s):NaN;return isNaN(e)?s:e};let Gp;const nu=()=>Gp||(Gp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Li(s){if(ft(s)){const e={};for(let t=0;t{if(t){const i=t.split(LS);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function ot(s){let e="";if(gi(s))e=s;else if(ft(s))for(let t=0;tLo(t,e))}const Ey=s=>!!(s&&s.__v_isRef===!0),je=s=>gi(s)?s:s==null?"":ft(s)||Kt(s)&&(s.toString===Sy||!_t(s.toString))?Ey(s)?je(s.value):JSON.stringify(s,Cy,2):String(s),Cy=(s,e)=>Ey(e)?Cy(s,e.value):po(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,n],r)=>(t[Lu(i,r)+" =>"]=n,t),{})}:Bo(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Lu(t))}:As(e)?Lu(e):Kt(e)&&!ft(e)&&!_y(e)?String(e):e,Lu=(s,e="")=>{var t;return As(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 Ii;class Iy{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&&Ii&&(Ii.active?(this.parent=Ii,this.index=(Ii.scopes||(Ii.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(Ii===this)Ii=this.prevScope;else{let e=Ii;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(dl){let e=dl;for(dl=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let s;for(;ul;){let e=ul;for(ul=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 By(s){for(let e=s.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Ly(s){let e,t=s.depsTail,i=t;for(;i;){const n=i.prevDep;i.version===-1?(i===t&&(t=n),tp(i),$S(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=n}s.deps=e,s.depsTail=t}function Rf(s){for(let e=s.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Dy(e.dep.computed)||e.dep.version!==e.version))return!0;return!!s._dirty}function Dy(s){if(s.flags&4&&!(s.flags&16)||(s.flags&=-17,s.globalVersion===Tl)||(s.globalVersion=Tl,!s.isSSR&&s.flags&128&&(!s.deps&&!s._dirty||!Rf(s))))return;s.flags|=2;const e=s.dep,t=ni,i=Zs;ni=s,Zs=!0;try{By(s);const n=s.fn(s._value);(e.version===0||Cn(n,s._value))&&(s.flags|=128,s._value=n,e.version++)}catch(n){throw e.version++,n}finally{ni=t,Zs=i,Ly(s),s.flags&=-3}}function tp(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)tp(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function $S(s){const{prevDep:e,nextDep:t}=s;e&&(e.nextDep=t,s.prevDep=void 0),t&&(t.prevDep=e,s.nextDep=void 0)}let Zs=!0;const Ny=[];function ur(){Ny.push(Zs),Zs=!1}function dr(){const s=Ny.pop();Zs=s===void 0?!0:s}function Hp(s){const{cleanup:e}=s;if(s.cleanup=void 0,e){const t=ni;ni=void 0;try{e()}finally{ni=t}}}let Tl=0;class GS{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 ip{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(!ni||!Zs||ni===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==ni)t=this.activeLink=new GS(ni,this),ni.deps?(t.prevDep=ni.depsTail,ni.depsTail.nextDep=t,ni.depsTail=t):ni.deps=ni.depsTail=t,Uy(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=ni.depsTail,t.nextDep=void 0,ni.depsTail.nextDep=t,ni.depsTail=t,ni.deps===t&&(ni.deps=i)}return t}trigger(e){this.version++,Tl++,this.notify(e)}notify(e){Qm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{ep()}}}function Uy(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)Uy(i)}const t=s.dep.subs;t!==s&&(s.prevSub=t,t&&(t.nextSub=s)),s.dep.subs=s}}const ih=new WeakMap,_a=Symbol(""),Pf=Symbol(""),Al=Symbol("");function es(s,e,t){if(Zs&&ni){let i=ih.get(s);i||ih.set(s,i=new Map);let n=i.get(t);n||(i.set(t,n=new ip),n.map=i,n.key=t),n.track()}}function Jn(s,e,t,i,n,r){const a=ih.get(s);if(!a){Tl++;return}const o=h=>{h&&h.trigger()};if(Qm(),e==="clear")a.forEach(o);else{const h=ft(s),l=h&&tu(t);if(h&&t==="length"){const c=Number(i);a.forEach((u,d)=>{(d==="length"||d===Al||!As(d)&&d>=c)&&o(u)})}else switch((t!==void 0||a.has(void 0))&&o(a.get(t)),l&&o(a.get(Al)),e){case"add":h?l&&o(a.get("length")):(o(a.get(_a)),po(s)&&o(a.get(Pf)));break;case"delete":h||(o(a.get(_a)),po(s)&&o(a.get(Pf)));break;case"set":po(s)&&o(a.get(_a));break}}ep()}function HS(s,e){const t=ih.get(s);return t&&t.get(e)}function ja(s){const e=$t(s);return e===s?e:(es(e,"iterate",Al),Ts(s)?e:e.map(sn))}function ru(s){return es(s=$t(s),"iterate",Al),s}function Tn(s,e){return fr(s)?Eo(lr(s)?sn(e):e):sn(e)}const jS={__proto__:null,[Symbol.iterator](){return Nu(this,Symbol.iterator,s=>Tn(this,s))},concat(...s){return ja(this).concat(...s.map(e=>ft(e)?ja(e):e))},entries(){return Nu(this,"entries",s=>(s[1]=Tn(this,s[1]),s))},every(s,e){return Vn(this,"every",s,e,void 0,arguments)},filter(s,e){return Vn(this,"filter",s,e,t=>t.map(i=>Tn(this,i)),arguments)},find(s,e){return Vn(this,"find",s,e,t=>Tn(this,t),arguments)},findIndex(s,e){return Vn(this,"findIndex",s,e,void 0,arguments)},findLast(s,e){return Vn(this,"findLast",s,e,t=>Tn(this,t),arguments)},findLastIndex(s,e){return Vn(this,"findLastIndex",s,e,void 0,arguments)},forEach(s,e){return Vn(this,"forEach",s,e,void 0,arguments)},includes(...s){return Uu(this,"includes",s)},indexOf(...s){return Uu(this,"indexOf",s)},join(s){return ja(this).join(s)},lastIndexOf(...s){return Uu(this,"lastIndexOf",s)},map(s,e){return Vn(this,"map",s,e,void 0,arguments)},pop(){return $o(this,"pop")},push(...s){return $o(this,"push",s)},reduce(s,...e){return jp(this,"reduce",s,e)},reduceRight(s,...e){return jp(this,"reduceRight",s,e)},shift(){return $o(this,"shift")},some(s,e){return Vn(this,"some",s,e,void 0,arguments)},splice(...s){return $o(this,"splice",s)},toReversed(){return ja(this).toReversed()},toSorted(s){return ja(this).toSorted(s)},toSpliced(...s){return ja(this).toSpliced(...s)},unshift(...s){return $o(this,"unshift",s)},values(){return Nu(this,"values",s=>Tn(this,s))}};function Nu(s,e,t){const i=ru(s),n=i[e]();return i!==s&&!Ts(s)&&(n._next=n.next,n.next=()=>{const r=n._next();return r.done||(r.value=t(r.value)),r}),n}const WS=Array.prototype;function Vn(s,e,t,i,n,r){const a=ru(s),o=a!==s&&!Ts(s),h=a[e];if(h!==WS[e]){const u=h.apply(s,r);return o?sn(u):u}let l=t;a!==s&&(o?l=function(u,d){return t.call(this,Tn(s,u),d,s)}:t.length>2&&(l=function(u,d){return t.call(this,u,d,s)}));const c=h.call(a,l,i);return o&&n?n(c):c}function jp(s,e,t,i){const n=ru(s),r=n!==s&&!Ts(s);let a=t,o=!1;n!==s&&(r?(o=i.length===0,a=function(l,c,u){return o&&(o=!1,l=Tn(s,l)),t.call(this,l,Tn(s,c),u,s)}):t.length>3&&(a=function(l,c,u){return t.call(this,l,c,u,s)}));const h=n[e](a,...i);return o?Tn(s,h):h}function Uu(s,e,t){const i=$t(s);es(i,"iterate",Al);const n=i[e](...t);return(n===-1||n===!1)&&au(t[0])?(t[0]=$t(t[0]),i[e](...t)):n}function $o(s,e,t=[]){ur(),Qm();const i=$t(s)[e].apply(s,t);return ep(),dr(),i}const zS=Km("__proto__,__v_isRef,__isVue"),Xy=new Set(Object.getOwnPropertyNames(Symbol).filter(s=>s!=="arguments"&&s!=="caller").map(s=>Symbol[s]).filter(As));function qS(s){As(s)||(s=String(s));const e=$t(this);return es(e,"has",s),e.hasOwnProperty(s)}class Vy{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?r_:Hy:r?Gy:$y).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const a=ft(e);if(!n){let h;if(a&&(h=jS[t]))return h;if(t==="hasOwnProperty")return qS}const o=Reflect.get(e,t,Si(e)?e:i);if((As(t)?Xy.has(t):zS(t))||(n||es(e,"get",t),r))return o;if(Si(o)){const h=a&&tu(t)?o:o.value;return n&&Kt(h)?Ff(h):h}return Kt(o)?n?Ff(o):Ba(o):o}}class Yy extends Vy{constructor(e=!1){super(!1,e)}set(e,t,i,n){let r=e[t];const a=ft(e)&&tu(t);if(!this._isShallow){const l=fr(r);if(!Ts(i)&&!fr(i)&&(r=$t(r),i=$t(i)),!a&&Si(r)&&!Si(i))return l||(r.value=i),!0}const o=a?Number(t)s,ic=s=>Reflect.getPrototypeOf(s);function e_(s,e,t){return function(...i){const n=this.__v_raw,r=$t(n),a=po(r),o=s==="entries"||s===Symbol.iterator&&a,h=s==="keys"&&a,l=n[s](...i),c=t?kf:e?Eo:sn;return!e&&es(r,"iterate",h?Pf:_a),ki(Object.create(l),{next(){const{value:u,done:d}=l.next();return d?{value:u,done:d}:{value:o?[c(u[0]),c(u[1])]:c(u),done:d}}})}}function sc(s){return function(...e){return s==="delete"?!1:s==="clear"?void 0:this}}function t_(s,e){const t={get(n){const r=this.__v_raw,a=$t(r),o=$t(n);s||(Cn(n,o)&&es(a,"get",n),es(a,"get",o));const{has:h}=ic(a),l=e?kf:s?Eo:sn;if(h.call(a,n))return l(r.get(n));if(h.call(a,o))return l(r.get(o));r!==a&&r.get(n)},get size(){const n=this.__v_raw;return!s&&es($t(n),"iterate",_a),n.size},has(n){const r=this.__v_raw,a=$t(r),o=$t(n);return s||(Cn(n,o)&&es(a,"has",n),es(a,"has",o)),n===o?r.has(n):r.has(n)||r.has(o)},forEach(n,r){const a=this,o=a.__v_raw,h=$t(o),l=e?kf:s?Eo:sn;return!s&&es(h,"iterate",_a),o.forEach((c,u)=>n.call(r,l(c),l(u),a))}};return ki(t,s?{add:sc("add"),set:sc("set"),delete:sc("delete"),clear:sc("clear")}:{add(n){const r=$t(this),a=ic(r),o=$t(n),h=!e&&!Ts(n)&&!fr(n)?o:n;return a.has.call(r,h)||Cn(n,h)&&a.has.call(r,n)||Cn(o,h)&&a.has.call(r,o)||(r.add(h),Jn(r,"add",h,h)),this},set(n,r){!e&&!Ts(r)&&!fr(r)&&(r=$t(r));const a=$t(this),{has:o,get:h}=ic(a);let l=o.call(a,n);l||(n=$t(n),l=o.call(a,n));const c=h.call(a,n);return a.set(n,r),l?Cn(r,c)&&Jn(a,"set",n,r):Jn(a,"add",n,r),this},delete(n){const r=$t(this),{has:a,get:o}=ic(r);let h=a.call(r,n);h||(n=$t(n),h=a.call(r,n)),o&&o.call(r,n);const l=r.delete(n);return h&&Jn(r,"delete",n,void 0),l},clear(){const n=$t(this),r=n.size!==0,a=n.clear();return r&&Jn(n,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=e_(n,s,e)}),t}function sp(s,e){const t=t_(s,e);return(i,n,r)=>n==="__v_isReactive"?!s:n==="__v_isReadonly"?s:n==="__v_raw"?i:Reflect.get(qt(t,n)&&n in i?t:i,n,r)}const i_={get:sp(!1,!1)},s_={get:sp(!1,!0)},n_={get:sp(!0,!1)};const $y=new WeakMap,Gy=new WeakMap,Hy=new WeakMap,r_=new WeakMap;function a_(s){switch(s){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ba(s){return fr(s)?s:np(s,!1,ZS,i_,$y)}function o_(s){return np(s,!1,QS,s_,Gy)}function Ff(s){return np(s,!0,JS,n_,Hy)}function np(s,e,t,i,n){if(!Kt(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 a=a_(PS(s));if(a===0)return s;const o=new Proxy(s,a===2?i:t);return n.set(s,o),o}function lr(s){return fr(s)?lr(s.__v_raw):!!(s&&s.__v_isReactive)}function fr(s){return!!(s&&s.__v_isReadonly)}function Ts(s){return!!(s&&s.__v_isShallow)}function au(s){return s?!!s.__v_raw:!1}function $t(s){const e=s&&s.__v_raw;return e?$t(e):s}function Nr(s){return!qt(s,"__v_skip")&&Object.isExtensible(s)&&Ty(s,"__v_skip",!0),s}const sn=s=>Kt(s)?Ba(s):s,Eo=s=>Kt(s)?Ff(s):s;function Si(s){return s?s.__v_isRef===!0:!1}function ht(s){return l_(s,!1)}function l_(s,e){return Si(s)?s:new c_(s,e)}class c_{constructor(e,t){this.dep=new ip,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:$t(e),this._value=t?e:sn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||Ts(e)||fr(e);e=i?e:$t(e),Cn(e,t)&&(this._rawValue=e,this._value=i?e:sn(e),this.dep.trigger())}}function ke(s){return Si(s)?s.value:s}const h_={get:(s,e,t)=>e==="__v_raw"?s:ke(Reflect.get(s,e,t)),set:(s,e,t,i)=>{const n=s[e];return Si(n)&&!Si(t)?(n.value=t,!0):Reflect.set(s,e,t,i)}};function jy(s){return lr(s)?s:new Proxy(s,h_)}function u_(s){const e=ft(s)?new Array(s.length):{};for(const t in s)e[t]=f_(s,t);return e}class d_{constructor(e,t,i){this._object=e,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=As(t)?t:String(t),this._raw=$t(e);let n=!0,r=e;if(!ft(e)||As(this._key)||!tu(this._key))do n=!au(r)||Ts(r);while(n&&(r=r.__v_raw));this._shallow=n}get value(){let e=this._object[this._key];return this._shallow&&(e=ke(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Si(this._raw[this._key])){const t=this._object[this._key];if(Si(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return HS(this._raw,this._key)}}function f_(s,e,t){return new d_(s,e,t)}class m_{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ip(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Tl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&ni!==this)return Oy(this,!0),!0}get value(){const e=this.dep.track();return Dy(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function p_(s,e,t=!1){let i,n;return _t(s)?i=s:(i=s.get,n=s.set),new m_(i,n,t)}const nc={},sh=new WeakMap;let la;function g_(s,e=!1,t=la){if(t){let i=sh.get(t);i||sh.set(t,i=[]),i.push(s)}}function v_(s,e,t=ti){const{immediate:i,deep:n,once:r,scheduler:a,augmentJob:o,call:h}=t,l=w=>n?w:Ts(w)||n===!1||n===0?Qn(w,1):Qn(w);let c,u,d,f,p=!1,m=!1;if(Si(s)?(u=()=>s.value,p=Ts(s)):lr(s)?(u=()=>l(s),p=!0):ft(s)?(m=!0,p=s.some(w=>lr(w)||Ts(w)),u=()=>s.map(w=>{if(Si(w))return w.value;if(lr(w))return l(w);if(_t(w))return h?h(w,2):w()})):_t(s)?e?u=h?()=>h(s,2):s:u=()=>{if(d){ur();try{d()}finally{dr()}}const w=la;la=c;try{return h?h(s,3,[f]):s(f)}finally{la=w}}:u=Fn,e&&n){const w=u,A=n===!0?1/0:n;u=()=>Qn(w(),A)}const g=Py(),v=()=>{c.stop(),g&&g.active&&Zm(g.effects,c)};if(r&&e){const w=e;e=(...A)=>{const M=w(...A);return v(),M}}let b=m?new Array(s.length).fill(nc):nc;const y=w=>{if(!(!(c.flags&1)||!c.dirty&&!w))if(e){const A=c.run();if(w||n||p||(m?A.some((M,_)=>Cn(M,b[_])):Cn(A,b))){d&&d();const M=la;la=c;try{const _=[A,b===nc?void 0:m&&b[0]===nc?[]:b,f];b=A,h?h(e,3,_):e(..._)}finally{la=M}}}else c.run()};return o&&o(y),c=new ky(u),c.scheduler=a?()=>a(y,!1):y,f=w=>g_(w,!1,c),d=c.onStop=()=>{const w=sh.get(c);if(w){if(h)h(w,4);else for(const A of w)A();sh.delete(c)}},e?i?y(!0):b=c.run():a?a(y.bind(null,!0),!0):c.run(),v.pause=c.pause.bind(c),v.resume=c.resume.bind(c),v.stop=v,v}function Qn(s,e=1/0,t){if(e<=0||!Kt(s)||s.__v_skip||(t=t||new Map,(t.get(s)||0)>=e))return s;if(t.set(s,e),e--,Si(s))Qn(s.value,e,t);else if(ft(s))for(let i=0;i{Qn(i,e,t)});else if(_y(s)){for(const i in s)Qn(s[i],e,t);for(const i of Object.getOwnPropertySymbols(s))Object.prototype.propertyIsEnumerable.call(s,i)&&Qn(s[i],e,t)}return s}/** +* @vue/runtime-core v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function $l(s,e,t,i){try{return i?s(...i):s()}catch(n){ou(n,e,t)}}function Ns(s,e,t,i){if(_t(s)){const n=$l(s,e,t,i);return n&&wy(n)&&n.catch(r=>{ou(r,e,t)}),n}if(ft(s)){const n=[];for(let r=0;r>>1,n=os[i],r=El(n);r=El(t)?os.push(s):os.splice(x_(e),0,s),s.flags|=1,zy()}}function zy(){nh||(nh=Wy.then(Ky))}function b_(s){if(!ft(s))Cr&&s.id===-1?Cr.splice(to+1,0,s):s.flags&1||(go.push(s),s.flags|=1);else for(let e=0;eEl(t)-El(i));if(go.length=0,Cr){for(let t=0;ts.id==null?s.flags&2?-1:1/0:s.id;function Ky(s){try{for(xn=0;xn{i._d&&hh(-1);const r=rh(e),a=cr.length;let o;try{o=s(...n)}finally{for(let h=cr.length;h>a;h--)cp();rh(r),i._d&&hh(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function be(s,e){if(ss===null)return s;const t=pu(ss),i=s.dirs||(s.dirs=[]);for(let n=0;n1)return t&&_t(e)?e.call(i&&i.proxy):e}}function S_(){return!!(hp()||Ma)}const __=Symbol.for("v-scx"),M_=()=>fl(__);function Qo(s,e){return ap(s,null,e)}function ds(s,e,t){return ap(s,e,t)}function ap(s,e,t=ti){const{immediate:i,deep:n,flush:r,once:a}=t,o=ki({},t),h=e&&i||!e&&r!=="post";let l;if(kl){if(r==="sync"){const f=M_();l=f.__watcherHandles||(f.__watcherHandles=[])}else if(!h){const f=()=>{};return f.stop=Fn,f.resume=Fn,f.pause=Fn,f}}const c=ls;o.call=(f,p,m)=>Ns(f,c,p,m);let u=!1;r==="post"?o.scheduler=f=>{fs(f,c&&c.suspense)}:r!=="sync"&&(u=!0,o.scheduler=(f,p)=>{p?f():rp(f)}),o.augmentJob=f=>{e&&(f.flags|=4),u&&(f.flags|=2,c&&(f.id=c.uid,f.i=c))};const d=v_(s,e,o);return kl&&(l?l.push(d):h&&d()),d}function T_(s,e,t){const i=this.proxy,n=gi(s)?s.includes(".")?Jy(i,s):()=>i[s]:s.bind(i,i);let r;_t(e)?r=e:(r=e.handler,t=e);const a=Hl(this),o=ap(n,r.bind(i),t);return a(),o}function Jy(s,e){const t=e.split(".");return()=>{let i=s;for(let n=0;ns.__isTeleport,Os=Symbol("_leaveCb"),Go=Symbol("_enterCb");function E_(){const s={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return La(()=>{s.isMounted=!0}),du(()=>{s.isUnmounting=!0}),s}const Rs=[Function,Array],Qy={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Rs,onEnter:Rs,onAfterEnter:Rs,onEnterCancelled:Rs,onBeforeLeave:Rs,onLeave:Rs,onAfterLeave:Rs,onLeaveCancelled:Rs,onBeforeAppear:Rs,onAppear:Rs,onAfterAppear:Rs,onAppearCancelled:Rs},ex=s=>{const e=s.subTree;return e.component?ex(e.component):e},C_={name:"BaseTransition",props:Qy,setup(s,{slots:e}){const t=hp(),i=E_();return()=>{const n=e.default&&sx(e.default(),!0),r=n&&n.length?tx(n):t.subTree?Xe():void 0;if(!r)return;const a=$t(s),{mode:o}=a;if(i.isLeaving)return Xu(r);const h=oh(r);if(!h)return Xu(r);let l=Of(h,a,i,t,u=>l=u);h.type!==is&&Cl(h,l);let c=t.subTree&&oh(t.subTree);if(c&&c.type!==is&&!ma(c,h)&&ex(t).type!==is){let u=Of(c,a,i,t);if(Cl(c,u),o==="out-in"&&h.type!==is)return i.isLeaving=!0,u.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete u.afterLeave,c=void 0},Xu(r);o==="in-out"&&h.type!==is?u.delayLeave=(d,f,p)=>{const m=ix(i,c);m[String(c.key)]=c,d[Os]=()=>{f(),d[Os]=void 0,delete l.delayedLeave,c=void 0},l.delayedLeave=()=>{p(),delete l.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return r}}};function tx(s){let e=s[0];if(s.length>1){for(const t of s)if(t.type!==is){e=t;break}}return e}const I_=C_;function ix(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 Of(s,e,t,i,n){const{appear:r,mode:a,persisted:o=!1,onBeforeEnter:h,onEnter:l,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:g,onAppear:v,onAfterAppear:b,onAppearCancelled:y}=e,w=String(s.key),A=ix(t,s),M=(P,F)=>{P&&Ns(P,i,9,F)},_=(P,F)=>{const I=F[1];M(P,F),ft(P)?P.every(k=>k.length<=1)&&I():P.length<=1&&I()},R={mode:a,persisted:o,beforeEnter(P){let F=h;if(!t.isMounted)if(r)F=g||h;else return;P[Os]&&P[Os](!0);const I=A[w];I&&ma(s,I)&&I.el[Os]&&I.el[Os](),M(F,[P])},enter(P){if(A[w]===s)return;let F=l,I=c,k=u;if(!t.isMounted)if(r)F=v||l,I=b||c,k=y||u;else return;let B=!1;P[Go]=U=>{B||(B=!0,U?M(k,[P]):M(I,[P]),R.delayedLeave&&R.delayedLeave(),P[Go]=void 0)};const D=P[Go].bind(null,!1);F?_(F,[P,D]):D()},leave(P,F){const I=String(s.key);if(P[Go]&&P[Go](!0),t.isUnmounting)return F();M(d,[P]);let k=!1;P[Os]=D=>{k||(k=!0,F(),D?M(m,[P]):M(p,[P]),P[Os]=void 0,A[I]===s&&delete A[I])};const B=P[Os].bind(null,!1);A[I]=s,f?_(f,[P,B]):B()},clone(P){const F=Of(P,e,t,i,n);return n&&n(F),F}};return R}function Xu(s){if(hu(s))return s=jr(s),s.children=null,s}function oh(s){if(!hu(s))return cu(s.type)&&s.children?tx(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&&_t(t.default))return t.default()}}function Cl(s,e){if(s.shapeFlag&6&&s.component){s.transition=e;const t=s.component.subTree;Cl(cu(t.type)&&oh(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 sx(s,e=!1,t){let i=[],n=0;for(let r=0;r1)for(let r=0;rml(m,e&&(ft(e)?e[g]:e),t,i,n));return}if(vo(i)&&!n){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&ml(s,e,t,i.component.subTree);return}const r=i.shapeFlag&4?pu(i.component):i.el,a=n?null:r,{i:o,r:h}=s,l=e&&e.r,c=o.refs===ti?o.refs={}:o.refs,u=o.setupState,d=$t(u),f=u===ti?by:m=>zp(c,m)?!1:qt(d,m),p=(m,g)=>!(g&&zp(c,g));if(l!=null&&l!==h){if(qp(e),gi(l))c[l]=null,f(l)&&(u[l]=null);else if(Si(l)){const m=e;p(l,m.k)&&(l.value=null),m.k&&(c[m.k]=null)}}if(_t(h))$l(h,o,12,[a,c]);else{const m=gi(h),g=Si(h);if(m||g){const v=()=>{if(s.f){const b=m?f(h)?u[h]:c[h]:p()||!s.k?h.value:c[s.k];if(n)ft(b)&&Zm(b,r);else if(ft(b))b.includes(r)||b.push(r);else if(m)c[h]=[r],f(h)&&(u[h]=c[h]);else{const y=[r];p(h,s.k)&&(h.value=y),s.k&&(c[s.k]=y)}}else m?(c[h]=a,f(h)&&(u[h]=a)):g&&(p(h,s.k)&&(h.value=a),s.k&&(c[s.k]=a))};if(a){const b=()=>{v(),lh.delete(s)};b.id=-1,lh.set(s,b),fs(b,t)}else qp(s),v()}}}function qp(s){const e=lh.get(s);e&&(e.flags|=8,lh.delete(s))}nu().requestIdleCallback;nu().cancelIdleCallback;const vo=s=>!!s.type.__asyncLoader,hu=s=>s.type.__isKeepAlive;function R_(s,e){rx(s,"a",e)}function P_(s,e){rx(s,"da",e)}function rx(s,e,t=ls){const i=s.__wdc||(s.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return s()});if(uu(e,i,t),t){let n=t.parent;for(;n&&n.parent;)hu(n.parent.vnode)&&k_(i,e,t,n),n=n.parent}}function k_(s,e,t,i){const n=uu(e,s,i,!0);Gl(()=>{Zm(i[e],n)},t)}function uu(s,e,t=ls,i=!1){if(t){const n=t[s]||(t[s]=[]),r=e.__weh||(e.__weh=(...a)=>{ur();const o=Hl(t),h=Ns(e,t,s,a);return o(),dr(),h});return i?n.unshift(r):n.push(r),r}}const yr=s=>(e,t=ls)=>{(!kl||s==="sp")&&uu(s,(...i)=>e(...i),t)},F_=yr("bm"),La=yr("m"),O_=yr("bu"),B_=yr("u"),du=yr("bum"),Gl=yr("um"),L_=yr("sp"),D_=yr("rtg"),N_=yr("rtc");function U_(s,e=ls){uu("ec",s,e)}const X_=Symbol.for("v-ndc");function li(s,e,t,i){let n;const r=t,a=ft(s);if(a||gi(s)){const o=a&&lr(s);let h=!1,l=!1;o&&(h=!Ts(s),l=fr(s),s=ru(s)),n=new Array(s.length);for(let c=0,u=s.length;ce(o,h,void 0,r));else{const o=Object.keys(s);n=new Array(o.length);for(let h=0,l=o.length;h0;return ie(),Qt(Ke,null,[Ue("slot",l,i)],c?-2:64)}let a=s[e];a&&a._c&&(a._d=!1);const o=cr.length;ie();let h;try{const l=a&&ax(a(t)),c=t.key||r||l&&l.key;h=Qt(Ke,{key:(c&&!As(c)?c:`_${e}`)+(!l&&i?"_fb":"")},l||(i?i():[]),l&&s._===1?64:-2)}catch(l){for(let c=cr.length;c>o;c--)cp();throw l}finally{a&&a._c&&(a._d=!0)}return h}function ax(s){return s.some(e=>Rl(e)?!(e.type===is||e.type===Ke&&!ax(e.children)):!0)?s:null}const Bf=s=>s?Ax(s)?pu(s):Bf(s.parent):null,pl=ki(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=>Bf(s.parent),$root:s=>Bf(s.root),$host:s=>s.ce,$emit:s=>s.emit,$options:s=>lx(s),$forceUpdate:s=>s.f||(s.f=()=>{rp(s.update)}),$nextTick:s=>s.n||(s.n=lu.bind(s.proxy)),$watch:s=>T_.bind(s)}),Vu=(s,e)=>s!==ti&&!s.__isScriptSetup&&qt(s,e),Y_={get({_:s},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:n,props:r,accessCache:a,type:o,appContext:h}=s;if(e[0]!=="$"){const d=a[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(Vu(i,e))return a[e]=1,i[e];if(n!==ti&&qt(n,e))return a[e]=2,n[e];if(qt(r,e))return a[e]=3,r[e];if(t!==ti&&qt(t,e))return a[e]=4,t[e];Lf&&(a[e]=0)}}const l=pl[e];let c,u;if(l)return e==="$attrs"&&es(s.attrs,"get",""),l(s);if((c=o.__cssModules)&&(c=c[e]))return c;if(t!==ti&&qt(t,e))return a[e]=4,t[e];if(u=h.config.globalProperties,qt(u,e))return u[e]},set({_:s},e,t){const{data:i,setupState:n,ctx:r}=s;return Vu(n,e)?(n[e]=t,!0):i!==ti&&qt(i,e)?(i[e]=t,!0):qt(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:a}},o){let h;return!!(t[o]||s!==ti&&o[0]!=="$"&&qt(s,o)||Vu(e,o)||qt(r,o)||qt(i,o)||qt(pl,o)||qt(n.config.globalProperties,o)||(h=a.__cssModules)&&h[o])},defineProperty(s,e,t){return t.get!=null?s._.accessCache[e]=0:qt(t,"value")&&this.set(s,e,t.value,null),Reflect.defineProperty(s,e,t)}};function Kp(s){return ft(s)?s.reduce((e,t)=>(e[t]=null,e),{}):s}let Lf=!0;function $_(s){const e=lx(s),t=s.proxy,i=s.ctx;Lf=!1,e.beforeCreate&&Zp(e.beforeCreate,s,"bc");const{data:n,computed:r,methods:a,watch:o,provide:h,inject:l,created:c,beforeMount:u,mounted:d,beforeUpdate:f,updated:p,activated:m,deactivated:g,beforeDestroy:v,beforeUnmount:b,destroyed:y,unmounted:w,render:A,renderTracked:M,renderTriggered:_,errorCaptured:R,serverPrefetch:P,expose:F,inheritAttrs:I,components:k,directives:B,filters:D}=e;if(l&&G_(l,i,null),a)for(const N in a){const O=a[N];_t(O)&&(i[N]=O.bind(t))}if(n){const N=n.call(t,t);Kt(N)&&(s.data=Ba(N))}if(Lf=!0,r)for(const N in r){const O=r[N],X=_t(O)?O.bind(t,t):_t(O.get)?O.get.bind(t,t):Fn,E=!_t(O)&&_t(O.set)?O.set.bind(t):Fn,V=gt({get:X,set:E});Object.defineProperty(i,N,{enumerable:!0,configurable:!0,get:()=>V.value,set:q=>V.value=q})}if(o)for(const N in o)ox(o[N],i,t,N);if(h){const N=_t(h)?h.call(t):h;Reflect.ownKeys(N).forEach(O=>{w_(O,N[O])})}c&&Zp(c,s,"c");function L(N,O){ft(O)?O.forEach(X=>N(X.bind(t))):O&&N(O.bind(t))}if(L(F_,u),L(La,d),L(O_,f),L(B_,p),L(R_,m),L(P_,g),L(U_,R),L(N_,M),L(D_,_),L(du,b),L(Gl,w),L(L_,P),ft(F))if(F.length){const N=s.exposed||(s.exposed={});F.forEach(O=>{Object.defineProperty(N,O,{get:()=>t[O],set:X=>t[O]=X,enumerable:!0})})}else s.exposed||(s.exposed={});A&&s.render===Fn&&(s.render=A),I!=null&&(s.inheritAttrs=I),k&&(s.components=k),B&&(s.directives=B),P&&nx(s)}function G_(s,e,t=Fn){ft(s)&&(s=Df(s));for(const i in s){const n=s[i];let r;Kt(n)?"default"in n?r=fl(n.from||i,n.default,!0):r=fl(n.from||i):r=fl(n),Si(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:a=>r.value=a}):e[i]=r}}function Zp(s,e,t){Ns(ft(s)?s.map(i=>i.bind(e.proxy)):s.bind(e.proxy),e,t)}function ox(s,e,t,i){let n=i.includes(".")?Jy(t,i):()=>t[i];if(gi(s)){const r=e[s];_t(r)&&ds(n,r)}else if(_t(s))ds(n,s.bind(t));else if(Kt(s))if(ft(s))s.forEach(r=>ox(r,e,t,i));else{const r=_t(s.handler)?s.handler.bind(t):e[s.handler];_t(r)&&ds(n,r,s)}}function lx(s){const e=s.type,{mixins:t,extends:i}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:a}}=s.appContext,o=r.get(e);let h;return o?h=o:!n.length&&!t&&!i?h=e:(h={},n.length&&n.forEach(l=>ch(h,l,a,!0)),ch(h,e,a)),Kt(e)&&r.set(e,h),h}function ch(s,e,t,i=!1){const{mixins:n,extends:r}=e;r&&ch(s,r,t,!0),n&&n.forEach(a=>ch(s,a,t,!0));for(const a in e)if(!(i&&a==="expose")){const o=H_[a]||t&&t[a];s[a]=o?o(s[a],e[a]):e[a]}return s}const H_={data:Jp,props:Qp,emits:Qp,methods:el,computed:el,beforeCreate:rs,created:rs,beforeMount:rs,mounted:rs,beforeUpdate:rs,updated:rs,beforeDestroy:rs,beforeUnmount:rs,destroyed:rs,unmounted:rs,activated:rs,deactivated:rs,errorCaptured:rs,serverPrefetch:rs,components:el,directives:el,watch:W_,provide:Jp,inject:j_};function Jp(s,e){return e?s?function(){return ki(_t(s)?s.call(this,this):s,_t(e)?e.call(this,this):e)}:e:s}function j_(s,e){return el(Df(s),Df(e))}function Df(s){if(ft(s)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?s.modelModifiers:s[`${e}Modifiers`]||s[`${Ks(e)}Modifiers`]||s[`${Kr(e)}Modifiers`];function Z_(s,e,...t){if(s.isUnmounted)return;const i=s.vnode.props||ti;let n=t;const r=e.startsWith("update:"),a=r&&K_(i,e.slice(7));a&&(a.trim&&(n=t.map(c=>gi(c)?c.trim():c)),a.number&&(n=t.map(su)));let o,h=i[o=Bu(e)]||i[o=Bu(Ks(e))];!h&&r&&(h=i[o=Bu(Kr(e))]),h&&Ns(h,s,6,n);const l=i[o+"Once"];if(l){if(!s.emitted)s.emitted={};else if(s.emitted[o])return;s.emitted[o]=!0,Ns(l,s,6,n)}}const J_=new WeakMap;function hx(s,e,t=!1){const i=t?J_:e.emitsCache,n=i.get(s);if(n!==void 0)return n;const r=s.emits;let a={},o=!1;if(!_t(s)){const h=l=>{const c=hx(l,e,!0);c&&(o=!0,ki(a,c))};!t&&e.mixins.length&&e.mixins.forEach(h),s.extends&&h(s.extends),s.mixins&&s.mixins.forEach(h)}return!r&&!o?(Kt(s)&&i.set(s,null),null):(ft(r)?r.forEach(h=>a[h]=null):ki(a,r),Kt(s)&&i.set(s,a),a)}function fu(s,e){return!s||!Qh(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),qt(s,e[0].toLowerCase()+e.slice(1))||qt(s,Kr(e))||qt(s,e))}function eg(s){const{type:e,vnode:t,proxy:i,withProxy:n,propsOptions:[r],slots:a,attrs:o,emit:h,render:l,renderCache:c,props:u,data:d,setupState:f,ctx:p,inheritAttrs:m}=s,g=rh(s);let v,b;try{if(t.shapeFlag&4){const w=n||i,A=w;v=An(l.call(A,w,c,u,f,d,p)),b=o}else{const w=e;v=An(w.length>1?w(u,{attrs:o,slots:a,emit:h}):w(u,null)),b=e.props?o:Q_(o)}}catch(w){cr.length=0,ou(w,s,1),v=Ue(is)}let y=v;if(b&&m!==!1){const w=Object.keys(b),{shapeFlag:A}=y;w.length&&A&7&&(r&&w.some(eu)&&(b=eM(b,r)),y=jr(y,b,!1,!0))}if(t.dirs&&(y=jr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(t.dirs):t.dirs),t.transition){const w=cu(y.type)&&oh(y)||y;Cl(w,t.transition)}return v=y,rh(g),v}const Q_=s=>{let e;for(const t in s)(t==="class"||t==="style"||Qh(t))&&((e||(e={}))[t]=s[t]);return e},eM=(s,e)=>{const t={};for(const i in s)(!eu(i)||!(i.slice(9)in e))&&(t[i]=s[i]);return t};function tM(s,e,t){const{props:i,children:n,component:r}=s,{props:a,children:o,patchFlag:h}=e,l=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&h>=0){if(h&1024)return!0;if(h&16)return i?tg(i,a,l):!!a;if(h&8){const c=e.dynamicProps;for(let u=0;uObject.create(dx),mx=s=>Object.getPrototypeOf(s)===dx;function sM(s,e,t,i=!1){const n={},r=fx();s.propsDefaults=Object.create(null),px(s,e,n,r);for(const a in s.propsOptions[0])a in n||(n[a]=void 0);t?s.props=i?n:o_(n):s.type.props?s.props=n:s.props=r,s.attrs=r}function nM(s,e,t,i){const{props:n,attrs:r,vnode:{patchFlag:a}}=s,o=$t(n),[h]=s.propsOptions;let l=!1;if((i||a>0)&&!(a&16)){if(a&8){const c=s.vnode.dynamicProps;for(let u=0;u{h=!0;const[d,f]=gx(u,e,!0);ki(a,d),f&&o.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(c),s.extends&&c(s.extends),s.mixins&&s.mixins.forEach(c)}if(!r&&!h)return Kt(s)&&i.set(s,mo),mo;if(ft(r))for(let c=0;cs==="_"||s==="_ctx"||s==="$stable",lp=s=>ft(s)?s.map(An):[An(s)],aM=(s,e,t)=>{if(e._n)return e;const i=ah((...n)=>lp(e(...n)),t);return i._c=!1,i},vx=(s,e,t)=>{const i=s._ctx;for(const n in s){if(op(n))continue;const r=s[n];if(_t(r))e[n]=aM(n,r,i);else if(r!=null){const a=lp(r);e[n]=()=>a}}},yx=(s,e)=>{const t=lp(e);s.slots.default=()=>t},xx=(s,e,t)=>{for(const i in e)(t||!op(i))&&(s[i]=e[i])},oM=(s,e,t)=>{const i=s.slots=fx();if(s.vnode.shapeFlag&32){const n=e._;n?(xx(i,e,t),t&&Ty(i,"_",n,!0)):vx(e,i)}else e&&yx(s,e)},lM=(s,e,t)=>{const{vnode:i,slots:n}=s;let r=!0,a=ti;if(i.shapeFlag&32){const o=e._;o?t&&o===1?r=!1:xx(n,e,t):(r=!e.$stable,vx(e,n)),a=e}else e&&(yx(s,e),a={default:1});if(r)for(const o in n)!op(o)&&a[o]==null&&delete n[o]},fs=fM;function cM(s){return hM(s)}function hM(s,e){const t=nu();t.__VUE__=!0;const{insert:i,remove:n,patchProp:r,createElement:a,createText:o,createComment:h,setText:l,setElementText:c,parentNode:u,nextSibling:d,setScopeId:f=Fn,insertStaticContent:p}=s,m=(G,Z,z,j=null,te=null,he=null,ve=void 0,le=null,ye=!!Z.dynamicChildren)=>{if(G===Z)return;G&&!ma(G,Z)&&(j=me(G),q(G,te,he,!0),G=null),Z.patchFlag===-2&&(ye=!1,Z.dynamicChildren=null);const{type:ae,ref:Le,shapeFlag:Re}=Z;switch(ae){case mu:g(G,Z,z,j);break;case is:v(G,Z,z,j);break;case Xc:G==null&&b(Z,z,j,ve);break;case Ke:k(G,Z,z,j,te,he,ve,le,ye);break;default:Re&1?A(G,Z,z,j,te,he,ve,le,ye):Re&6?B(G,Z,z,j,te,he,ve,le,ye):(Re&64||Re&128)&&ae.process(G,Z,z,j,te,he,ve,le,ye,ge)}Le!=null&&te?ml(Le,G&&G.ref,he,Z||G,!Z):Le==null&&G&&G.ref!=null&&ml(G.ref,null,he,G,!0)},g=(G,Z,z,j)=>{if(G==null)i(Z.el=o(Z.children),z,j);else{const te=Z.el=G.el;Z.children!==G.children&&l(te,Z.children)}},v=(G,Z,z,j)=>{G==null?i(Z.el=h(Z.children||""),z,j):Z.el=G.el},b=(G,Z,z,j)=>{[G.el,G.anchor]=p(G.children,Z,z,j,G.el,G.anchor)},y=({el:G,anchor:Z},z,j)=>{let te;for(;G&&G!==Z;)te=d(G),i(G,z,j),G=te;i(Z,z,j)},w=({el:G,anchor:Z})=>{let z;for(;G&&G!==Z;)z=d(G),n(G),G=z;n(Z)},A=(G,Z,z,j,te,he,ve,le,ye)=>{if(Z.type==="svg"?ve="svg":Z.type==="math"&&(ve="mathml"),G==null)M(Z,z,j,te,he,ve,le,ye);else{const ae=G.el&&G.el._isVueCE?G.el:null;try{ae&&ae._beginPatch(),P(G,Z,te,he,ve,le,ye)}finally{ae&&ae._endPatch()}}},M=(G,Z,z,j,te,he,ve,le)=>{let ye,ae;const{props:Le,shapeFlag:Re,transition:Oe,dirs:tt}=G;if(ye=G.el=a(G.type,he,Le&&Le.is,Le),Re&8?c(ye,G.children):Re&16&&R(G.children,ye,null,j,te,Yu(G,he),ve,le),tt&&ea(G,null,j,"created"),_(ye,G,G.scopeId,ve,j),Le){for(const Pt in Le)Pt!=="value"&&!hl(Pt)&&r(ye,Pt,null,Le[Pt],he,j);"value"in Le&&r(ye,"value",null,Le.value,he),(ae=Le.onVnodeBeforeMount)&&dn(ae,j,G)}tt&&ea(G,null,j,"beforeMount");const St=uM(te,Oe);St&&Oe.beforeEnter(ye),i(ye,Z,z),((ae=Le&&Le.onVnodeMounted)||St||tt)&&fs(()=>{try{ae&&dn(ae,j,G),St&&Oe.enter(ye),tt&&ea(G,null,j,"mounted")}finally{}},te)},_=(G,Z,z,j,te)=>{if(z&&f(G,z),j)for(let he=0;he{for(let ae=ye;ae{const le=Z.el=G.el;let{patchFlag:ye,dynamicChildren:ae,dirs:Le}=Z;ye|=G.patchFlag&16;const Re=G.props||ti,Oe=Z.props||ti;let tt;if(z&&ta(z,!1),(tt=Oe.onVnodeBeforeUpdate)&&dn(tt,z,Z,G),Le&&ea(Z,G,z,"beforeUpdate"),z&&ta(z,!0),ae&&(!G.dynamicChildren||G.dynamicChildren.length!==ae.length)&&(ye=0,ve=!1,ae=null),(Re.innerHTML&&Oe.innerHTML==null||Re.textContent&&Oe.textContent==null)&&c(le,""),ae?F(G.dynamicChildren,ae,le,z,j,Yu(Z,te),he):ve||O(G,Z,le,null,z,j,Yu(Z,te),he,!1),ye>0){if(ye&16)I(le,Re,Oe,z,te);else if(ye&2&&Re.class!==Oe.class&&r(le,"class",null,Oe.class,te),ye&4&&r(le,"style",Re.style,Oe.style,te),ye&8){const St=Z.dynamicProps;for(let Pt=0;Pt{tt&&dn(tt,z,Z,G),Le&&ea(Z,G,z,"updated")},j)},F=(G,Z,z,j,te,he,ve)=>{for(let le=0;le{if(Z!==z){if(Z!==ti)for(const he in Z)!hl(he)&&!(he in z)&&r(G,he,Z[he],null,te,j);for(const he in z){if(hl(he))continue;const ve=z[he],le=Z[he];ve!==le&&he!=="value"&&r(G,he,le,ve,te,j)}"value"in z&&r(G,"value",Z.value,z.value,te)}},k=(G,Z,z,j,te,he,ve,le,ye)=>{const ae=Z.el=G?G.el:o(""),Le=Z.anchor=G?G.anchor:o("");let{patchFlag:Re,dynamicChildren:Oe,slotScopeIds:tt}=Z;tt&&(le=le?le.concat(tt):tt),G==null?(i(ae,z,j),i(Le,z,j),R(Z.children||[],z,Le,te,he,ve,le,ye)):Re>0&&Re&64&&Oe&&G.dynamicChildren&&G.dynamicChildren.length===Oe.length?(F(G.dynamicChildren,Oe,z,te,he,ve,le),(Z.key!=null||te&&Z===te.subTree)&&bx(G,Z,!0)):O(G,Z,z,Le,te,he,ve,le,ye)},B=(G,Z,z,j,te,he,ve,le,ye)=>{Z.slotScopeIds=le,G==null?Z.shapeFlag&512?te.ctx.activate(Z,z,j,ve,ye):D(Z,z,j,te,he,ve,ye):U(G,Z,ye)},D=(G,Z,z,j,te,he,ve)=>{const le=G.component=xM(G,j,te);if(hu(G)&&(le.ctx.renderer=ge),bM(le,!1,ve),le.asyncDep){if(te&&te.registerDep(le,L,ve),!G.el){const ye=le.subTree=Ue(is);v(null,ye,Z,z),G.placeholder=ye.el}}else L(le,G,Z,z,te,he,ve)},U=(G,Z,z)=>{const j=Z.component=G.component;if(tM(G,Z,z))if(j.asyncDep&&!j.asyncResolved){N(j,Z,z);return}else j.next=Z,j.update();else Z.el=G.el,j.vnode=Z},L=(G,Z,z,j,te,he,ve)=>{const le=()=>{if(G.isMounted){let{next:Re,bu:Oe,u:tt,parent:St,vnode:Pt}=G;{const Oi=wx(G);if(Oi){Re&&(Re.el=Pt.el,N(G,Re,ve)),Oi.asyncDep.then(()=>{fs(()=>{G.isUnmounted||ae()},te)});return}}let wt=Re,Rt;ta(G,!1),Re?(Re.el=Pt.el,N(G,Re,ve)):Re=Pt,Oe&&Uc(Oe),(Rt=Re.props&&Re.props.onVnodeBeforeUpdate)&&dn(Rt,St,Re,Pt),ta(G,!0);const Zt=eg(G),Fi=G.subTree;G.subTree=Zt,m(Fi,Zt,u(Fi.el),me(Fi),G,te,he),Re.el=Zt.el,wt===null&&iM(G,Zt.el),tt&&fs(tt,te),(Rt=Re.props&&Re.props.onVnodeUpdated)&&fs(()=>dn(Rt,St,Re,Pt),te)}else{let Re;const{el:Oe,props:tt}=Z,{bm:St,m:Pt,parent:wt,root:Rt,type:Zt}=G,Fi=vo(Z);ta(G,!1),St&&Uc(St),!Fi&&(Re=tt&&tt.onVnodeBeforeMount)&&dn(Re,wt,Z),ta(G,!0);{Rt.ce&&Rt.ce._hasShadowRoot()&&Rt.ce._injectChildStyle(Zt,G.parent?G.parent.type:void 0);const Oi=G.subTree=eg(G);m(null,Oi,z,j,G,te,he),Z.el=Oi.el}if(Pt&&fs(Pt,te),!Fi&&(Re=tt&&tt.onVnodeMounted)){const Oi=Z;fs(()=>dn(Re,wt,Oi),te)}(Z.shapeFlag&256||wt&&vo(wt.vnode)&&wt.vnode.shapeFlag&256)&&G.a&&fs(G.a,te),G.isMounted=!0,Z=z=j=null}};G.scope.on();const ye=G.effect=new ky(le);G.scope.off();const ae=G.update=ye.run.bind(ye),Le=G.job=ye.runIfDirty.bind(ye);Le.i=G,Le.id=G.uid,ye.scheduler=()=>rp(Le),ta(G,!0),ae()},N=(G,Z,z)=>{Z.component=G;const j=G.vnode.props;G.vnode=Z,G.next=null,nM(G,Z.props,j,z),lM(G,Z.children,z),ur(),Wp(G),dr()},O=(G,Z,z,j,te,he,ve,le,ye=!1)=>{const ae=G&&G.children,Le=G?G.shapeFlag:0,Re=Z.children,{patchFlag:Oe,shapeFlag:tt}=Z;if(Oe>0){if(Oe&128){E(ae,Re,z,j,te,he,ve,le,ye);return}else if(Oe&256){X(ae,Re,z,j,te,he,ve,le,ye);return}}tt&8?(Le&16&&fe(ae,te,he),Re!==ae&&c(z,Re)):Le&16?tt&16?E(ae,Re,z,j,te,he,ve,le,ye):fe(ae,te,he,!0):(Le&8&&c(z,""),tt&16&&R(Re,z,j,te,he,ve,le,ye))},X=(G,Z,z,j,te,he,ve,le,ye)=>{G=G||mo,Z=Z||mo;const ae=G.length,Le=Z.length,Re=Math.min(ae,Le);let Oe;for(Oe=0;OeLe?fe(G,te,he,!0,!1,Re):R(Z,z,j,te,he,ve,le,ye,Re)},E=(G,Z,z,j,te,he,ve,le,ye)=>{let ae=0;const Le=Z.length;let Re=G.length-1,Oe=Le-1;for(;ae<=Re&&ae<=Oe;){const tt=G[ae],St=Z[ae]=ye?Zn(Z[ae]):An(Z[ae]);if(ma(tt,St))m(tt,St,z,null,te,he,ve,le,ye);else break;ae++}for(;ae<=Re&&ae<=Oe;){const tt=G[Re],St=Z[Oe]=ye?Zn(Z[Oe]):An(Z[Oe]);if(ma(tt,St))m(tt,St,z,null,te,he,ve,le,ye);else break;Re--,Oe--}if(ae>Re){if(ae<=Oe){const tt=Oe+1,St=ttOe)for(;ae<=Re;)q(G[ae],te,he,!0),ae++;else{const tt=ae,St=ae,Pt=new Map;for(ae=St;ae<=Oe;ae++){const yi=Z[ae]=ye?Zn(Z[ae]):An(Z[ae]);yi.key!=null&&Pt.set(yi.key,ae)}let wt,Rt=0;const Zt=Oe-St+1;let Fi=!1,Oi=0;const Wi=new Array(Zt);for(ae=0;ae=Zt){q(yi,te,he,!0);continue}let ce;if(yi.key!=null)ce=Pt.get(yi.key);else for(wt=St;wt<=Oe;wt++)if(Wi[wt-St]===0&&ma(yi,Z[wt])){ce=wt;break}ce===void 0?q(yi,te,he,!0):(Wi[ce-St]=ae+1,ce>=Oi?Oi=ce:Fi=!0,m(yi,Z[ce],z,null,te,he,ve,le,ye),Rt++)}const on=Fi?dM(Wi):mo;for(wt=on.length-1,ae=Zt-1;ae>=0;ae--){const yi=St+ae,ce=Z[yi],de=Z[yi+1],kt=yi+1{const{el:he,type:ve,transition:le,children:ye,shapeFlag:ae}=G;if(ae&6){V(G.component.subTree,Z,z,j);return}if(ae&128){G.suspense.move(Z,z,j);return}if(ae&64){ve.move(G,Z,z,ge);return}if(ve===Ke){i(he,Z,z);for(let Re=0;Rele.enter(he),te));else{const{leave:Re,delayLeave:Oe,afterLeave:tt}=le,St=()=>{G.ctx.isUnmounted?n(he):i(he,Z,z)},Pt=()=>{const wt=he._isLeaving||!!he[Os];he._isLeaving&&he[Os](!0),le.persisted&&!wt?St():Re(he,()=>{St(),tt&&tt()})};Oe?Oe(he,St,Pt):Pt()}else i(he,Z,z)},q=(G,Z,z,j=!1,te=!1)=>{const{type:he,props:ve,ref:le,children:ye,dynamicChildren:ae,shapeFlag:Le,patchFlag:Re,dirs:Oe,cacheIndex:tt,memo:St}=G;if(Re===-2&&(te=!1),le!=null&&(ur(),ml(le,null,z,G,!0),dr()),tt!=null&&(Z.renderCache[tt]=void 0),Le&256){Z.ctx.deactivate(G);return}const Pt=Le&1&&Oe,wt=!vo(G);let Rt;if(wt&&(Rt=ve&&ve.onVnodeBeforeUnmount)&&dn(Rt,Z,G),Le&6)K(G.component,z,j);else{if(Le&128){G.suspense.unmount(z,j);return}Pt&&ea(G,null,Z,"beforeUnmount"),Le&64?G.type.remove(G,Z,z,ge,j):ae&&!ae.hasOnce&&(he!==Ke||Re>0&&Re&64)?fe(ae,Z,z,!1,!0):(he===Ke&&Re&384||!te&&Le&16)&&fe(ye,Z,z),j&&W(G)}const Zt=St!=null&&tt==null;(wt&&(Rt=ve&&ve.onVnodeUnmounted)||Pt||Zt)&&fs(()=>{Rt&&dn(Rt,Z,G),Pt&&ea(G,null,Z,"unmounted"),Zt&&(G.el=null)},z)},W=G=>{const{type:Z,el:z,anchor:j,transition:te}=G;if(Z===Ke){J(z,j);return}if(Z===Xc){w(G);return}const he=()=>{n(z),te&&!te.persisted&&te.afterLeave&&te.afterLeave()};if(G.shapeFlag&1&&te&&!te.persisted){const{leave:ve,delayLeave:le}=te,ye=()=>ve(z,he);le?le(G.el,he,ye):ye()}else he()},J=(G,Z)=>{let z;for(;G!==Z;)z=d(G),n(G),G=z;n(Z)},K=(G,Z,z)=>{const{bum:j,scope:te,job:he,subTree:ve,um:le,m:ye,a:ae}=G;sg(ye),sg(ae),j&&Uc(j),te.stop(),he&&(he.flags|=8,q(ve,G,Z,z)),le&&fs(le,Z),fs(()=>{G.isUnmounted=!0},Z)},fe=(G,Z,z,j=!1,te=!1,he=0)=>{for(let ve=he;ve{if(G.shapeFlag&6)return me(G.component.subTree);if(G.shapeFlag&128)return G.suspense.next();const Z=d(G.anchor||G.el),z=Z&&Z[A_];return z?d(z):Z};let we=!1;const Ee=(G,Z,z)=>{let j;G==null?Z._vnode&&(q(Z._vnode,null,null,!0),j=Z._vnode.component):m(Z._vnode||null,G,Z,null,null,null,z),Z._vnode=G,we||(we=!0,Wp(j),qy(),we=!1)},ge={p:m,um:q,m:V,r:W,mt:D,mc:R,pc:O,pbc:F,n:me,o:s};return{render:Ee,hydrate:void 0,createApp:q_(Ee)}}function Yu({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 ta({effect:s,job:e},t){t?(s.flags|=32,e.flags|=4):(s.flags&=-33,e.flags&=-5)}function uM(s,e){return(!s||s&&!s.pendingBranch)&&e&&!e.persisted}function bx(s,e,t=!1){const i=s.children,n=e.children;if(ft(i)&&ft(n))for(let r=0;r>1,s[t[o]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,a=t[r-1];r-- >0;)t[r]=a,a=e[a];return t}function wx(s){const e=s.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:wx(e)}function sg(s){if(s)for(let e=0;es.__isSuspense;function fM(s,e){e&&e.pendingBranch?ft(s)?e.effects.push(...s):e.effects.push(s):b_(s)}const Ke=Symbol.for("v-fgt"),mu=Symbol.for("v-txt"),is=Symbol.for("v-cmt"),Xc=Symbol.for("v-stc"),cr=[];let Ms=null;function ie(s=!1){cr.push(Ms=s?null:[])}function cp(){cr.pop(),Ms=cr[cr.length-1]||null}let Il=1;function hh(s,e=!1){Il+=s,s<0&&Ms&&e&&(Ms.hasOnce=!0)}function Mx(s){return s.dynamicChildren=Il>0?Ms||mo:null,cp(),Il>0&&Ms&&Ms.push(s),s}function oe(s,e,t,i,n,r){return Mx(T(s,e,t,i,n,r,!0))}function Qt(s,e,t,i,n){return Mx(Ue(s,e,t,i,n,!0))}function Rl(s){return s?s.__v_isVNode===!0:!1}function ma(s,e){return s.type===e.type&&s.key===e.key}const Tx=({key:s})=>s??null,Vc=({ref:s,ref_key:e,ref_for:t})=>(typeof s=="number"&&(s=""+s),s!=null?gi(s)||Si(s)||_t(s)?{i:ss,r:s,k:e,f:!!t}:s:null);function T(s,e=null,t=null,i=0,n=null,r=s===Ke?0:1,a=!1,o=!1){const h={__v_isVNode:!0,__v_skip:!0,type:s,props:e,key:e&&Tx(e),ref:e&&Vc(e),scopeId:Zy,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:ss};return o?(uh(h,t),r&128&&s.normalize(h)):t&&(h.shapeFlag|=gi(t)?8:16),Il>0&&!a&&Ms&&(h.patchFlag>0||r&6)&&h.patchFlag!==32&&Ms.push(h),h}const Ue=mM;function mM(s,e=null,t=null,i=0,n=null,r=!1){if((!s||s===X_)&&(s=is),Rl(s)){const o=jr(s,e,!0);return t&&uh(o,t),Il>0&&!r&&Ms&&(o.shapeFlag&6?Ms[Ms.indexOf(s)]=o:Ms.push(o)),o.patchFlag=-2,o}if(MM(s)&&(s=s.__vccOpts),e){e=pM(e);let{class:o,style:h}=e;o&&!gi(o)&&(e.class=ot(o)),Kt(h)&&(au(h)&&!ft(h)&&(h=ki({},h)),e.style=Li(h))}const a=gi(s)?1:_x(s)?128:cu(s)?64:Kt(s)?4:_t(s)?2:0;return T(s,e,t,i,n,a,r,!0)}function pM(s){return s?au(s)||mx(s)?ki({},s):s:null}function jr(s,e,t=!1,i=!1){const{props:n,ref:r,patchFlag:a,children:o,transition:h}=s,l=e?gM(n||{},e):n,c={__v_isVNode:!0,__v_skip:!0,type:s.type,props:l,key:l&&Tx(l),ref:e&&e.ref?t&&r?ft(r)?r.concat(Vc(e)):[r,Vc(e)]:Vc(e):r,scopeId:s.scopeId,slotScopeIds:s.slotScopeIds,children:o,target:s.target,targetStart:s.targetStart,targetAnchor:s.targetAnchor,staticCount:s.staticCount,shapeFlag:s.shapeFlag,patchFlag:e&&s.type!==Ke?a===-1?16:a|16:a,dynamicProps:s.dynamicProps,dynamicChildren:s.dynamicChildren,appContext:s.appContext,dirs:s.dirs,transition:h,component:s.component,suspense:s.suspense,ssContent:s.ssContent&&jr(s.ssContent),ssFallback:s.ssFallback&&jr(s.ssFallback),placeholder:s.placeholder,el:s.el,anchor:s.anchor,ctx:s.ctx,ce:s.ce};return h&&i&&Cl(c,h.clone(c)),c}function ri(s=" ",e=0){return Ue(mu,null,s,e)}function io(s,e){const t=Ue(Xc,null,s);return t.staticCount=e,t}function Xe(s="",e=!1){return e?(ie(),Qt(is,null,s)):Ue(is,null,s)}function An(s){return s==null||typeof s=="boolean"?Ue(is):ft(s)?Ue(Ke,null,s.slice()):Rl(s)?Zn(s):Ue(mu,null,String(s))}function Zn(s){return s.el===null&&s.patchFlag!==-1||s.memo?s:jr(s)}function uh(s,e){let t=0;const{shapeFlag:i}=s;if(e==null)e=null;else if(ft(e))t=16;else if(typeof e=="object")if(i&65){const n=e.default;n&&(n._c&&(n._d=!1),uh(s,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!mx(e)?e._ctx=ss:n===3&&ss&&(ss.slots._===1?e._=1:(e._=2,s.patchFlag|=1024))}else if(_t(e)){if(i&65){uh(s,{default:e});return}e={default:e,_ctx:ss},t=32}else e=String(e),i&64?(t=16,e=[ri(e)]):t=8;s.children=e,s.shapeFlag|=t}function gM(...s){const e={};for(let t=0;tls||ss;let dh,Pl;{const s=nu(),e=(t,i)=>{let n;return(n=s[t])||(n=s[t]=[]),n.push(i),r=>{n.length>1?n.forEach(a=>a(r)):n[0](r)}};dh=e("__VUE_INSTANCE_SETTERS__",t=>ls=t),Pl=e("__VUE_SSR_SETTERS__",t=>kl=t)}const Hl=s=>{const e=ls;return dh(s),s.scope.on(),()=>{s.scope.off(),dh(e)}},ng=()=>{ls&&ls.scope.off(),dh(null)};function Ax(s){return s.vnode.shapeFlag&4}let kl=!1;function bM(s,e=!1,t=!1){e&&Pl(e);const{props:i,children:n}=s.vnode,r=Ax(s);sM(s,i,r,e),oM(s,n,t||e);const a=r?wM(s,e):void 0;return e&&Pl(!1),a}function wM(s,e){const t=s.type;s.accessCache=Object.create(null),s.proxy=new Proxy(s.ctx,Y_);const{setup:i}=t;if(i){ur();const n=s.setupContext=i.length>1?_M(s):null,r=Hl(s),a=$l(i,s,0,[s.props,n]),o=wy(a);if(dr(),r(),(o||s.sp)&&!vo(s)&&nx(s),o){if(a.then(ng,ng),e)return a.then(h=>{Pl(!0);try{rg(s,h,e)}finally{Pl(!1)}}).catch(h=>{ou(h,s,0)});s.asyncDep=a}else rg(s,a)}else Ex(s)}function rg(s,e,t){_t(e)?s.type.__ssrInlineRender?s.ssrRender=e:s.render=e:Kt(e)&&(s.setupState=jy(e)),Ex(s)}function Ex(s,e,t){const i=s.type;s.render||(s.render=i.render||Fn);{const n=Hl(s);ur();try{$_(s)}finally{dr(),n()}}}const SM={get(s,e){return es(s,"get",""),s[e]}};function _M(s){const e=t=>{s.exposed=t||{}};return{attrs:new Proxy(s.attrs,SM),slots:s.slots,emit:s.emit,expose:e}}function pu(s){return s.exposed?s.exposeProxy||(s.exposeProxy=new Proxy(jy(Nr(s.exposed)),{get(e,t){if(t in e)return e[t];if(t in pl)return pl[t](s)},has(e,t){return t in e||t in pl}})):s.proxy}function MM(s){return _t(s)&&"__vccOpts"in s}const gt=(s,e)=>p_(s,e,kl);function TM(s,e,t){try{hh(-1);const i=arguments.length;return i===2?Kt(e)&&!ft(e)?Rl(e)?Ue(s,null,[e]):Ue(s,e):Ue(s,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Rl(t)&&(t=[t]),Ue(s,e,t))}finally{hh(1)}}const AM="3.5.41";/** +* @vue/runtime-dom v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Uf;const ag=typeof window<"u"&&window.trustedTypes;if(ag)try{Uf=ag.createPolicy("vue",{createHTML:s=>s})}catch{}const Cx=Uf?s=>Uf.createHTML(s):s=>s,EM="http://www.w3.org/2000/svg",CM="http://www.w3.org/1998/Math/MathML",jn=typeof document<"u"?document:null,og=jn&&jn.createElement("template"),IM={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"?jn.createElementNS(EM,s):e==="mathml"?jn.createElementNS(CM,s):t?jn.createElement(s,{is:t}):jn.createElement(s);return s==="select"&&i&&i.multiple!=null&&n.setAttribute("multiple",i.multiple),n},createText:s=>jn.createTextNode(s),createComment:s=>jn.createComment(s),setText:(s,e)=>{s.nodeValue=e},setElementText:(s,e)=>{s.textContent=e},parentNode:s=>s.parentNode,nextSibling:s=>s.nextSibling,querySelector:s=>jn.querySelector(s),setScopeId(s,e){s.setAttribute(e,"")},insertStaticContent(s,e,t,i,n,r){const a=t?t.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),t),!(n===r||!(n=n.nextSibling)););else{og.innerHTML=Cx(i==="svg"?`${s}`:i==="mathml"?`${s}`:s);const o=og.content;if(i==="svg"||i==="mathml"){const h=o.firstChild;for(;h.firstChild;)o.appendChild(h.firstChild);o.removeChild(h)}e.insertBefore(o,t)}return[a?a.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},wr="transition",Ho="animation",Fl=Symbol("_vtc"),Ix={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},RM=ki({},Qy,Ix),PM=s=>(s.displayName="Transition",s.props=RM,s),kM=PM((s,{slots:e})=>TM(I_,FM(s),e)),ia=(s,e=[])=>{ft(s)?s.forEach(t=>t(...e)):s&&s(...e)},lg=s=>s?ft(s)?s.some(e=>e.length>1):s.length>1:!1;function FM(s){const e={};for(const k in s)k in Ix||(e[k]=s[k]);if(s.css===!1)return e;const{name:t="v",type:i,duration:n,enterFromClass:r=`${t}-enter-from`,enterActiveClass:a=`${t}-enter-active`,enterToClass:o=`${t}-enter-to`,appearFromClass:h=r,appearActiveClass:l=a,appearToClass:c=o,leaveFromClass:u=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:f=`${t}-leave-to`}=s,p=OM(n),m=p&&p[0],g=p&&p[1],{onBeforeEnter:v,onEnter:b,onEnterCancelled:y,onLeave:w,onLeaveCancelled:A,onBeforeAppear:M=v,onAppear:_=b,onAppearCancelled:R=y}=e,P=(k,B,D,U)=>{k._enterCancelled=U,sa(k,B?c:o),sa(k,B?l:a),D&&D()},F=(k,B)=>{k._isLeaving=!1,sa(k,u),sa(k,f),sa(k,d),B&&B()},I=k=>(B,D)=>{const U=k?_:b,L=()=>P(B,k,D);ia(U,[B,L]),cg(()=>{sa(B,k?h:r),Yn(B,k?c:o),lg(U)||hg(B,i,m,L)})};return ki(e,{onBeforeEnter(k){ia(v,[k]),Yn(k,r),Yn(k,a)},onBeforeAppear(k){ia(M,[k]),Yn(k,h),Yn(k,l)},onEnter:I(!1),onAppear:I(!0),onLeave(k,B){k._isLeaving=!0;const D=()=>F(k,B);Yn(k,u),k._enterCancelled?(Yn(k,d),fg(k)):(fg(k),Yn(k,d)),cg(()=>{k._isLeaving&&(sa(k,u),Yn(k,f),lg(w)||hg(k,i,g,D))}),ia(w,[k,D])},onEnterCancelled(k){P(k,!1,void 0,!0),ia(y,[k])},onAppearCancelled(k){P(k,!0,void 0,!0),ia(R,[k])},onLeaveCancelled(k){F(k),ia(A,[k])}})}function OM(s){if(s==null)return null;if(Kt(s))return[$u(s.enter),$u(s.leave)];{const e=$u(s);return[e,e]}}function $u(s){return OS(s)}function Yn(s,e){e.split(/\s+/).forEach(t=>t&&s.classList.add(t)),(s[Fl]||(s[Fl]=new Set)).add(e)}function sa(s,e){e.split(/\s+/).forEach(i=>i&&s.classList.remove(i));const t=s[Fl];t&&(t.delete(e),t.size||(s[Fl]=void 0))}function cg(s){requestAnimationFrame(()=>{requestAnimationFrame(s)})}let BM=0;function hg(s,e,t,i){const n=s._endId=++BM,r=()=>{n===s._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:a,timeout:o,propCount:h}=LM(s,e);if(!a)return i();const l=a+"end";let c=0;const u=()=>{s.removeEventListener(l,d),r()},d=f=>{f.target===s&&++c>=h&&u()};setTimeout(()=>{c(t[p]||"").split(", "),n=i(`${wr}Delay`),r=i(`${wr}Duration`),a=ug(n,r),o=i(`${Ho}Delay`),h=i(`${Ho}Duration`),l=ug(o,h);let c=null,u=0,d=0;e===wr?a>0&&(c=wr,u=a,d=r.length):e===Ho?l>0&&(c=Ho,u=l,d=h.length):(u=Math.max(a,l),c=u>0?a>l?wr:Ho:null,d=c?c===wr?r.length:h.length:0);const f=c===wr&&/\b(?:transform|all)(?:,|$)/.test(i(`${wr}Property`).toString());return{type:c,timeout:u,propCount:d,hasTransform:f}}function ug(s,e){for(;s.lengthdg(t)+dg(s[i])))}function dg(s){return s==="auto"?0:Number(s.slice(0,-1).replace(",","."))*1e3}function fg(s){return(s?s.ownerDocument:document).body.offsetHeight}function DM(s,e,t){const i=s[Fl];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?s.removeAttribute("class"):t?s.setAttribute("class",e):s.className=e}const fh=Symbol("_vod"),Rx=Symbol("_vsh"),Sr={name:"show",beforeMount(s,{value:e},{transition:t}){s[fh]=s.style.display==="none"?"":s.style.display,t&&e?t.beforeEnter(s):jo(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),jo(s,!0),i.enter(s)):i.leave(s,()=>{jo(s,!1)}):jo(s,e))},beforeUnmount(s,{value:e}){jo(s,e)}};function jo(s,e){s.style.display=e?s[fh]:"none",s[Rx]=!e}const NM=Symbol(""),UM=/(?:^|;)\s*display\s*:/;function XM(s,e,t){const i=s.style,n=gi(t);let r=!1;if(t&&!n){if(e)if(gi(e))for(const a of e.split(";")){const o=a.slice(0,a.indexOf(":")).trim();t[o]==null&&tl(i,o,"")}else for(const a in e)t[a]==null&&tl(i,a,"");for(const a in t){a==="display"&&(r=!0);const o=t[a];o!=null?YM(s,a,!gi(e)&&e?e[a]:void 0,o)||tl(i,a,o):tl(i,a,"")}}else if(n){if(e!==t){const a=i[NM];a&&(t+=";"+a),i.cssText=t,r=UM.test(t)}}else e&&s.removeAttribute("style");fh in s&&(s[fh]=r?i.display:"",s[Rx]&&(i.display="none"))}const mg=/\s*!important$/;function tl(s,e,t){if(ft(t))t.forEach(i=>tl(s,e,i));else if(t==null&&(t=""),e.startsWith("--"))s.setProperty(e,t);else{const i=VM(s,e);mg.test(t)?s.setProperty(Kr(i),t.replace(mg,""),"important"):s[i]=t}}const pg=["Webkit","Moz","ms"],Gu={};function VM(s,e){const t=Gu[e];if(t)return t;let i=Ks(e);if(i!=="filter"&&i in s)return Gu[e]=i;i=My(i);for(let n=0;nHu||(zM.then(()=>Hu=0),Hu=Date.now());function KM(s,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;const n=t.value;if(ft(n)){const r=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{r.call(i),i._stopped=!0};const a=n.slice(),o=[i];for(let h=0;hs.charCodeAt(0)===111&&s.charCodeAt(1)===110&&s.charCodeAt(2)>96&&s.charCodeAt(2)<123,ZM=(s,e,t,i,n,r)=>{const a=n==="svg";e==="class"?DM(s,i,a):e==="style"?XM(s,t,i):Qh(e)?eu(e)||GM(s,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):JM(s,e,i,a))?(yg(s,e,i),!s.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&vg(s,e,i,a,r,e!=="value")):s._isVueCE&&(QM(s,e)||s._def.__asyncLoader&&(/[A-Z]/.test(e)||!gi(i)))?yg(s,Ks(e),i,r,e):(e==="true-value"?s._trueValue=i:e==="false-value"&&(s._falseValue=i),vg(s,e,i,a))};function JM(s,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in s&&bg(e)&&_t(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 bg(e)&&gi(t)?!1:e in s}function QM(s,e){const t=s._def.props;if(!t)return!1;const i=Ks(e);return Array.isArray(t)?t.some(n=>Ks(n)===i):Object.keys(t).some(n=>Ks(n)===i)}const Co=s=>{const e=s.props["onUpdate:modelValue"]||!1;return ft(e)?t=>Uc(e,t):e};function eT(s){s.target.composing=!0}function wg(s){const e=s.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const In=Symbol("_assign"),rc=Symbol("_initialValue");function ju(s,e,t){return e&&(s=s.trim()),t&&(s=su(s)),s}const ut={created(s,{modifiers:{lazy:e,trim:t,number:i}},n){s.parentNode&&(s.type==="text"?s[rc]=s.defaultValue.replace(/[\r\n]/g,""):s.type==="textarea"&&(s[rc]=s.defaultValue.replace(/\r\n?/g,` +`))),s[In]=Co(n);const r=i||n.props&&n.props.type==="number";Or(s,e?"change":"input",a=>{a.target.composing||s[In](ju(s.value,t,r))}),(t||r)&&Or(s,"change",()=>{s.value=ju(s.value,t,r)}),e||(Or(s,"compositionstart",eT),Or(s,"compositionend",wg),Or(s,"change",wg))},mounted(s,{value:e,modifiers:{trim:t,number:i}}){const n=e??"",r=s[rc];delete s[rc],r!==void 0&&(s.type==="text"||s.type==="textarea")&&s.value!==r?s[In](ju(s.value,t,i)):s.value=n},beforeUpdate(s,{value:e,oldValue:t,modifiers:{lazy:i,trim:n,number:r}},a){if(s[In]=Co(a),s.composing)return;const o=(r||s.type==="number")&&!/^0\d/.test(s.value)?su(s.value):s.value,h=e??"";if(o===h)return;const l=s.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===s&&s.type!=="range"&&(i&&e===t||n&&s.value.trim()===h)||(s.value=h)}},ei={deep:!0,created(s,e,t){s[In]=Co(t),Or(s,"change",()=>{const i=s._modelValue,n=Ol(s),r=s.checked,a=s[In];if(ft(i)){const o=Jm(i,n),h=o!==-1;if(r&&!h)a(i.concat(n));else if(!r&&h){const l=[...i];l.splice(o,1),a(l)}}else if(Bo(i)){const o=new Set(i);r?o.add(n):o.delete(n),a(o)}else a(Px(s,r))})},mounted:Sg,beforeUpdate(s,e,t){s[In]=Co(t),Sg(s,e,t)}};function Sg(s,{value:e,oldValue:t},i){s._modelValue=e;let n;if(ft(e))n=Jm(e,i.props.value)>-1;else if(Bo(e))n=e.has(i.props.value);else{if(e===t)return;n=Lo(e,Px(s,!0))}s.checked!==n&&(s.checked=n)}const jt={deep:!0,created(s,{value:e,modifiers:{number:t}},i){s._modelValue=e,Or(s,"change",()=>{const n=Array.prototype.filter.call(s.options,r=>r.selected).map(r=>t?su(Ol(r)):Ol(r));s[In](s.multiple?Bo(s._modelValue)?new Set(n):n:n[0]),s._assigning=!0,lu(()=>{s._assigning=!1})}),s[In]=Co(i)},mounted(s,{value:e}){_g(s,e)},beforeUpdate(s,{value:e},t){s._modelValue=e,s[In]=Co(t)},updated(s,{value:e}){s._assigning||_g(s,e)}};function _g(s,e){const t=s.multiple,i=ft(e);if(!(t&&!i&&!Bo(e))){for(let n=0,r=s.options.length;nString(l)===String(o)):a.selected=Jm(e,o)>-1}else a.selected=e.has(o);else if(Lo(Ol(a),e)){s.selectedIndex!==n&&(s.selectedIndex=n);return}}!t&&s.selectedIndex!==-1&&(s.selectedIndex=-1)}}function Ol(s){return"_value"in s?s._value:s.value}function Px(s,e){const t=e?"_trueValue":"_falseValue";return t in s?s[t]:e}const tT=["ctrl","shift","alt","meta"],iT={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)=>tT.some(t=>s[`${t}Key`]&&!e.includes(t))},xt=(s,e)=>{if(!s)return s;const t=s._withMods||(s._withMods={}),i=e.join(".");return t[i]||(t[i]=((n,...r)=>{for(let a=0;a{const t=s._withKeys||(s._withKeys={}),i=e.join(".");return t[i]||(t[i]=(n=>{if(!("key"in n))return;const r=Kr(n.key);if(e.some(a=>a===r||sT[a]===r))return s(n)}))},nT=ki({patchProp:ZM},IM);let Mg;function rT(){return Mg||(Mg=cM(nT))}const aT=((...s)=>{const e=rT().createApp(...s),{mount:t}=e;return e.mount=i=>{const n=lT(i);if(!n)return;const r=e._component;!_t(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const a=t(n,!1,oT(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},e});function oT(s){if(s instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&s instanceof MathMLElement)return"mathml"}function lT(s){return gi(s)?document.querySelector(s):s}/*! + * pinia v4.0.3 + * (c) 2026 Eduardo San Martin Morote + * @license MIT + */let kx;const gu=s=>kx=s,Fx=Symbol();function Tg(s){return s&&typeof s=="object"&&Object.prototype.toString.call(s)==="[object Object]"&&typeof s.toJSON!="function"}function cT(){const s=Ry(!0),e=s.run(()=>ht({}));let t=[],i=[];const n=Nr({install(r){gu(n),n._a=r,r.provide(Fx,n),r.config.globalProperties.$pinia=n,i.forEach(a=>t.push(a)),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 Xf=()=>{};function Ag(s,e,t,i=Xf){s.add(e);const n=()=>{s.delete(e)&&i()};return!t&&Py()&&YS(n),n}function Wa(s,...e){s.forEach(t=>{t(...e)})}const hT=s=>s(),Eg=Symbol(),Wu=Symbol();function Vf(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];Tg(n)&&Tg(i)&&Object.hasOwn(s,t)&&!Si(i)&&!lr(i)?s[t]=Vf(n,i):s[t]=i}return s}const uT=Symbol();function dT(s){return!s||typeof s!="object"||!Object.hasOwn(s,uT)}const{assign:Tr}=Object;function fT(s){return!!(Si(s)&&s.effect)}function mT(s,e,t,i){const{state:n,actions:r,getters:a}=e,o=t.state.value[s];let h;function l(){o||(t.state.value[s]=n?n():{});const c=u_(t.state.value[s]);return Tr(c,r,Object.keys(a||{}).reduce((u,d)=>(u[d]=Nr(gt(()=>{gu(t);const f=t._s.get(s);return a[d].call(f,f)})),u),{}))}return h=Ox(s,l,e,t,i,!0),h}function Ox(s,e,t={},i,n,r){let a;const o=Tr({actions:{}},t),h={deep:!0};let l,c,u=new Set,d=new Set,f;const p=i.state.value[s];!r&&!p&&(i.state.value[s]={});let m;function g(_){let R;l=c=!1,typeof _=="function"?(_(i.state.value[s]),R={type:"patch function",storeId:s,events:f}):(Vf(i.state.value[s],_),R={type:"patch object",payload:_,storeId:s,events:f});const P=m=Symbol();lu().then(()=>{m===P&&(l=!0)}),c=!0,Wa(u,R,i.state.value[s])}const v=r?function(){const{state:R}=t,P=R?R():{};this.$patch(F=>{Tr(F,P)})}:Xf;function b(){a.stop(),u.clear(),d.clear(),i._s.delete(s)}const y=(_,R="")=>{if(Eg in _)return _[Wu]=R,_;const P=function(){gu(i);const F=Array.from(arguments),I=new Set,k=new Set;function B(L){I.add(L)}function D(L){k.add(L)}Wa(d,{args:F,name:P[Wu],store:A,after:B,onError:D});let U;try{U=_.apply(this&&this.$id===s?this:A,F)}catch(L){throw Wa(k,L),L}return U instanceof Promise?U.then(L=>(Wa(I,L),L)).catch(L=>(Wa(k,L),Promise.reject(L))):(Wa(I,U),U)};return P[Eg]=!0,P[Wu]=R,P},w={_p:i,$id:s,$onAction:Ag.bind(null,d),$patch:g,$reset:v,$subscribe(_,R={}){if(u.has(_))return Xf;const P=Ag(u,_,R.detached,()=>F()),F=a.run(()=>ds(()=>i.state.value[s],I=>{(R.flush==="sync"?c:l)&&_({storeId:s,type:"direct",events:f},I)},Tr({},h,R)));return P},$dispose:b},A=Ba(w);i._s.set(s,A);const M=(i._a&&i._a.runWithContext||hT)(()=>i._e.run(()=>(a=Ry()).run(()=>e({action:y}))));for(const _ in M){const R=M[_];Si(R)&&!fT(R)||lr(R)?r||(p&&dT(R)&&(Si(R)?R.value=p[_]:((R instanceof Set||R instanceof Map)&&R.clear(),Vf(R,p[_]))),i.state.value[s][_]=R):typeof R=="function"&&(M[_]=y(R,_),o.actions[_]=R)}return Tr(A,M),Tr($t(A),M),Object.defineProperty(A,"$state",{get:()=>i.state.value[s],set:_=>{g(R=>{Tr(R,_)})}}),i._p.forEach(_=>{const R=a.run(()=>_({store:A,app:i._a,pinia:i,options:o}));Tr(A,R)}),p&&r&&t.hydrate&&t.hydrate(A.$state,p),l=!0,c=!0,A}/*! #__NO_SIDE_EFFECTS__ */function pT(s,e,t){let i;const n=typeof e=="function";i=n?t:e;function r(a,o){const h=S_();return a=a||(h?fl(Fx,null):null),a&&gu(a),a=kx,a._s.has(s)||(n?Ox(s,e,i,a):mT(s,i,a)),a._s.get(s)}return r.$id=s,r}var Da=(s=>(s[s.WEBGL_LEGACY=0]="WEBGL_LEGACY",s[s.WEBGL=1]="WEBGL",s[s.WEBGL2=2]="WEBGL2",s))(Da||{}),Bx=(s=>(s[s.UNKNOWN=0]="UNKNOWN",s[s.WEBGL=1]="WEBGL",s[s.CANVAS=2]="CANVAS",s))(Bx||{}),Yf=(s=>(s[s.COLOR=16384]="COLOR",s[s.DEPTH=256]="DEPTH",s[s.STENCIL=1024]="STENCIL",s))(Yf||{}),dt=(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))(dt||{}),Rn=(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))(Rn||{}),Ne=(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))(Ne||{}),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||{}),Qe=(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))(Qe||{}),ze=(s=>(s[s.FLOAT=0]="FLOAT",s[s.INT=1]="INT",s[s.UINT=2]="UINT",s))(ze||{}),qs=(s=>(s[s.NEAREST=0]="NEAREST",s[s.LINEAR=1]="LINEAR",s))(qs||{}),Js=(s=>(s[s.CLAMP=33071]="CLAMP",s[s.REPEAT=10497]="REPEAT",s[s.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",s))(Js||{}),Us=(s=>(s[s.OFF=0]="OFF",s[s.POW2=1]="POW2",s[s.ON=2]="ON",s[s.ON_MANUAL=3]="ON_MANUAL",s))(Us||{}),Ni=(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))(Ni||{}),En=(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))(En||{}),up=(s=>(s[s.AUTO=0]="AUTO",s[s.MANUAL=1]="MANUAL",s))(up||{}),Ls=(s=>(s.LOW="lowp",s.MEDIUM="mediump",s.HIGH="highp",s))(Ls||{}),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||{}),On=(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))(On||{});const gT={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")},We={ADAPTER:gT,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var zu=/iPhone/i,Cg=/iPod/i,Ig=/iPad/i,Rg=/\biOS-universal(?:.+)Mac\b/i,qu=/\bAndroid(?:.+)Mobile\b/i,Pg=/Android/i,za=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ac=/Silk/i,$n=/Windows Phone/i,kg=/\bWindows(?:.+)ARM\b/i,Fg=/BlackBerry/i,Og=/BB10/i,Bg=/Opera Mini/i,Lg=/\b(CriOS|Chrome)(?:.+)Mobile/i,Dg=/Mobile(?:.+)Firefox\b/i,Ng=function(s){return typeof s<"u"&&s.platform==="MacIntel"&&typeof s.maxTouchPoints=="number"&&s.maxTouchPoints>1&&typeof MSStream>"u"};function vT(s){return function(e){return e.test(s)}}function Ug(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=vT(t),r={apple:{phone:n(zu)&&!n($n),ipod:n(Cg),tablet:!n(zu)&&(n(Ig)||Ng(e))&&!n($n),universal:n(Rg),device:(n(zu)||n(Cg)||n(Ig)||n(Rg)||Ng(e))&&!n($n)},amazon:{phone:n(za),tablet:!n(za)&&n(ac),device:n(za)||n(ac)},android:{phone:!n($n)&&n(za)||!n($n)&&n(qu),tablet:!n($n)&&!n(za)&&!n(qu)&&(n(ac)||n(Pg)),device:!n($n)&&(n(za)||n(ac)||n(qu)||n(Pg))||n(/\bokhttp\b/i)},windows:{phone:n($n),tablet:n(kg),device:n($n)||n(kg)},other:{blackberry:n(Fg),blackberry10:n(Og),opera:n(Bg),firefox:n(Dg),chrome:n(Lg),device:n(Fg)||n(Og)||n(Bg)||n(Dg)||n(Lg)},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 yT=Ug.default??Ug,tr=yT(globalThis.navigator);We.RETINA_PREFIX=/@([0-9\.]+)x/;We.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var mh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function xT(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 Ku={exports:{}},Xg;function bT(){return Xg||(Xg=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(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function r(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new n(c,u||h,d),p=t?t+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function a(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)e.call(c,u)&&l.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=t?t+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d80*O){W=K=L[0],J=fe=L[1];for(var ge=O;geK&&(K=me),we>fe&&(fe=we);Ee=Math.max(K-W,fe-J),Ee=Ee!==0?32767/Ee:0}return i(V,q,O,W,J,Ee,0),q}function e(L,N,O,X,E){var V,q;if(E===U(L,N,O,X)>0)for(V=N;V=N;V-=X)q=k(V,L[V],L[V+1],q);return q&&w(q,q.next)&&(B(q),q=q.next),q}function t(L,N){if(!L)return L;N||(N=L);var O=L,X;do if(X=!1,!O.steiner&&(w(O,O.next)||y(O.prev,O,O.next)===0)){if(B(O),O=N=O.prev,O===O.next)break;X=!0}else O=O.next;while(X||O!==N);return N}function i(L,N,O,X,E,V,q){if(L){!q&&V&&f(L,X,E,V);for(var W=L,J,K;L.prev!==L.next;){if(J=L.prev,K=L.next,V?r(L,X,E,V):n(L)){N.push(J.i/O|0),N.push(L.i/O|0),N.push(K.i/O|0),B(L),L=K.next,W=K.next;continue}if(L=K,L===W){q?q===1?(L=a(t(L),N,O),i(L,N,O,X,E,V,2)):q===2&&o(L,N,O,X,E,V):i(t(L),N,O,X,E,V,1);break}}}}function n(L){var N=L.prev,O=L,X=L.next;if(y(N,O,X)>=0)return!1;for(var E=N.x,V=O.x,q=X.x,W=N.y,J=O.y,K=X.y,fe=EV?E>q?E:q:V>q?V:q,Ee=W>J?W>K?W:K:J>K?J:K,ge=X.next;ge!==N;){if(ge.x>=fe&&ge.x<=we&&ge.y>=me&&ge.y<=Ee&&v(E,W,V,J,q,K,ge.x,ge.y)&&y(ge.prev,ge,ge.next)>=0)return!1;ge=ge.next}return!0}function r(L,N,O,X){var E=L.prev,V=L,q=L.next;if(y(E,V,q)>=0)return!1;for(var W=E.x,J=V.x,K=q.x,fe=E.y,me=V.y,we=q.y,Ee=WJ?W>K?W:K:J>K?J:K,G=fe>me?fe>we?fe:we:me>we?me:we,Z=m(Ee,ge,N,O,X),z=m(Te,G,N,O,X),j=L.prevZ,te=L.nextZ;j&&j.z>=Z&&te&&te.z<=z;){if(j.x>=Ee&&j.x<=Te&&j.y>=ge&&j.y<=G&&j!==E&&j!==q&&v(W,fe,J,me,K,we,j.x,j.y)&&y(j.prev,j,j.next)>=0||(j=j.prevZ,te.x>=Ee&&te.x<=Te&&te.y>=ge&&te.y<=G&&te!==E&&te!==q&&v(W,fe,J,me,K,we,te.x,te.y)&&y(te.prev,te,te.next)>=0))return!1;te=te.nextZ}for(;j&&j.z>=Z;){if(j.x>=Ee&&j.x<=Te&&j.y>=ge&&j.y<=G&&j!==E&&j!==q&&v(W,fe,J,me,K,we,j.x,j.y)&&y(j.prev,j,j.next)>=0)return!1;j=j.prevZ}for(;te&&te.z<=z;){if(te.x>=Ee&&te.x<=Te&&te.y>=ge&&te.y<=G&&te!==E&&te!==q&&v(W,fe,J,me,K,we,te.x,te.y)&&y(te.prev,te,te.next)>=0)return!1;te=te.nextZ}return!0}function a(L,N,O){var X=L;do{var E=X.prev,V=X.next.next;!w(E,V)&&A(E,X,X.next,V)&&P(E,V)&&P(V,E)&&(N.push(E.i/O|0),N.push(X.i/O|0),N.push(V.i/O|0),B(X),B(X.next),X=L=V),X=X.next}while(X!==L);return t(X)}function o(L,N,O,X,E,V){var q=L;do{for(var W=q.next.next;W!==q.prev;){if(q.i!==W.i&&b(q,W)){var J=I(q,W);q=t(q,q.next),J=t(J,J.next),i(q,N,O,X,E,V,0),i(J,N,O,X,E,V,0);return}W=W.next}q=q.next}while(q!==L)}function h(L,N,O,X){var E=[],V,q,W,J,K;for(V=0,q=N.length;V=O.next.y&&O.next.y!==O.y){var W=O.x+(E-O.y)*(O.next.x-O.x)/(O.next.y-O.y);if(W<=X&&W>V&&(V=W,q=O.x=O.x&&O.x>=K&&X!==O.x&&v(Eq.x||O.x===q.x&&d(q,O)))&&(q=O,me=we)),O=O.next;while(O!==J);return q}function d(L,N){return y(L.prev,L,N.prev)<0&&y(N.next,L,L.next)<0}function f(L,N,O,X){var E=L;do E.z===0&&(E.z=m(E.x,E.y,N,O,X)),E.prevZ=E.prev,E.nextZ=E.next,E=E.next;while(E!==L);E.prevZ.nextZ=null,E.prevZ=null,p(E)}function p(L){var N,O,X,E,V,q,W,J,K=1;do{for(O=L,L=null,V=null,q=0;O;){for(q++,X=O,W=0,N=0;N0||J>0&&X;)W!==0&&(J===0||!X||O.z<=X.z)?(E=O,O=O.nextZ,W--):(E=X,X=X.nextZ,J--),V?V.nextZ=E:L=E,E.prevZ=V,V=E;O=X}V.nextZ=null,K*=2}while(q>1);return L}function m(L,N,O,X,E){return L=(L-O)*E|0,N=(N-X)*E|0,L=(L|L<<8)&16711935,L=(L|L<<4)&252645135,L=(L|L<<2)&858993459,L=(L|L<<1)&1431655765,N=(N|N<<8)&16711935,N=(N|N<<4)&252645135,N=(N|N<<2)&858993459,N=(N|N<<1)&1431655765,L|N<<1}function g(L){var N=L,O=L;do(N.x=(L-q)*(V-W)&&(L-q)*(X-W)>=(O-q)*(N-W)&&(O-q)*(V-W)>=(E-q)*(X-W)}function b(L,N){return L.next.i!==N.i&&L.prev.i!==N.i&&!R(L,N)&&(P(L,N)&&P(N,L)&&F(L,N)&&(y(L.prev,L,N.prev)||y(L,N.prev,N))||w(L,N)&&y(L.prev,L,L.next)>0&&y(N.prev,N,N.next)>0)}function y(L,N,O){return(N.y-L.y)*(O.x-N.x)-(N.x-L.x)*(O.y-N.y)}function w(L,N){return L.x===N.x&&L.y===N.y}function A(L,N,O,X){var E=_(y(L,N,O)),V=_(y(L,N,X)),q=_(y(O,X,L)),W=_(y(O,X,N));return!!(E!==V&&q!==W||E===0&&M(L,O,N)||V===0&&M(L,X,N)||q===0&&M(O,L,X)||W===0&&M(O,N,X))}function M(L,N,O){return N.x<=Math.max(L.x,O.x)&&N.x>=Math.min(L.x,O.x)&&N.y<=Math.max(L.y,O.y)&&N.y>=Math.min(L.y,O.y)}function _(L){return L>0?1:L<0?-1:0}function R(L,N){var O=L;do{if(O.i!==L.i&&O.next.i!==L.i&&O.i!==N.i&&O.next.i!==N.i&&A(O,O.next,L,N))return!0;O=O.next}while(O!==L);return!1}function P(L,N){return y(L.prev,L,L.next)<0?y(L,N,L.next)>=0&&y(L,L.prev,N)>=0:y(L,N,L.prev)<0||y(L,L.next,N)<0}function F(L,N){var O=L,X=!1,E=(L.x+N.x)/2,V=(L.y+N.y)/2;do O.y>V!=O.next.y>V&&O.next.y!==O.y&&E<(O.next.x-O.x)*(V-O.y)/(O.next.y-O.y)+O.x&&(X=!X),O=O.next;while(O!==L);return X}function I(L,N){var O=new D(L.i,L.x,L.y),X=new D(N.i,N.x,N.y),E=L.next,V=N.prev;return L.next=N,N.prev=L,O.next=E,E.prev=O,X.next=O,O.prev=X,V.next=X,X.prev=V,X}function k(L,N,O,X){var E=new D(L,N,O);return X?(E.next=X.next,E.prev=X,X.next.prev=E,X.next=E):(E.prev=E,E.next=E),E}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 D(L,N,O){this.i=L,this.x=N,this.y=O,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}s.deviation=function(L,N,O,X){var E=N&&N.length,V=E?N[0]*O:L.length,q=Math.abs(U(L,0,V,O));if(E)for(var W=0,J=N.length;W0&&(X+=L[E-1].length,O.holes.push(X))}return O},oc.exports}var _T=ST();const MT=Lx(_T);var na={},il={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var TT=il.exports,Yg;function AT(){return Yg||(Yg=1,(function(s,e){(function(t){var i=e&&!e.nodeType&&e,n=s&&!s.nodeType&&s,r=typeof mh=="object"&&mh;(r.global===r||r.window===r||r.self===r)&&(t=r);var a,o=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,p=128,m="-",g=/^xn--/,v=/[^\x20-\x7E]/,b=/[\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"},w=h-l,A=Math.floor,M=String.fromCharCode,_;function R(E){throw new RangeError(y[E])}function P(E,V){for(var q=E.length,W=[];q--;)W[q]=V(E[q]);return W}function F(E,V){var q=E.split("@"),W="";q.length>1&&(W=q[0]+"@",E=q[1]),E=E.replace(b,".");var J=E.split("."),K=P(J,V).join(".");return W+K}function I(E){for(var V=[],q=0,W=E.length,J,K;q=55296&&J<=56319&&q65535&&(V-=65536,q+=M(V>>>10&1023|55296),V=56320|V&1023),q+=M(V),q}).join("")}function B(E){return E-48<10?E-22:E-65<26?E-65:E-97<26?E-97:h}function D(E,V){return E+22+75*(E<26)-((V!=0)<<5)}function U(E,V,q){var W=0;for(E=q?A(E/d):E>>1,E+=A(E/V);E>w*c>>1;W+=h)E=A(E/w);return A(W+(w+1)*E/(E+u))}function L(E){var V=[],q=E.length,W,J=0,K=p,fe=f,me,we,Ee,ge,Te,G,Z,z,j;for(me=E.lastIndexOf(m),me<0&&(me=0),we=0;we=128&&R("not-basic"),V.push(E.charCodeAt(we));for(Ee=me>0?me+1:0;Ee=q&&R("invalid-input"),Z=B(E.charCodeAt(Ee++)),(Z>=h||Z>A((o-J)/Te))&&R("overflow"),J+=Z*Te,z=G<=fe?l:G>=fe+c?c:G-fe,!(ZA(o/j)&&R("overflow"),Te*=j;W=V.length+1,fe=U(J-ge,W,ge==0),A(J/W)>o-K&&R("overflow"),K+=A(J/W),J%=W,V.splice(J++,0,K)}return k(V)}function N(E){var V,q,W,J,K,fe,me,we,Ee,ge,Te,G=[],Z,z,j,te;for(E=I(E),Z=E.length,V=p,q=0,K=f,fe=0;fe=V&&TeA((o-q)/z)&&R("overflow"),q+=(me-V)*z,V=me,fe=0;feo&&R("overflow"),Te==V){for(we=q,Ee=h;ge=Ee<=K?l:Ee>=K+c?c:Ee-K,!(we-1e3&&ce<1e3||M.call(/e/,de))return de;var kt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ce=="number"){var zt=ce<0?-F(-ce):F(ce);if(zt!==ce){var Jt=String(zt),mt=b.call(de,Jt.length+1);return y.call(Jt,kt,"$&_")+"."+y.call(y.call(mt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(de,kt,"$&_")}var X=IT,E=X.custom,V=z(E)?E:null,q={__proto__:null,double:'"',single:"'"},W={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Ju=function ce(de,kt,zt,Jt){var mt=kt||{};if(he(mt,"quoteStyle")&&!he(q,mt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(he(mt,"maxStringLength")&&(typeof mt.maxStringLength=="number"?mt.maxStringLength<0&&mt.maxStringLength!==1/0:mt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Cs=he(mt,"customInspect")?mt.customInspect:!0;if(typeof Cs!="boolean"&&Cs!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(he(mt,"indent")&&mt.indent!==null&&mt.indent!==" "&&!(parseInt(mt.indent,10)===mt.indent&&mt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(he(mt,"numericSeparator")&&typeof mt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Xs=mt.numericSeparator;if(typeof de>"u")return"undefined";if(de===null)return"null";if(typeof de=="boolean")return de?"true":"false";if(typeof de=="string")return Pt(de,mt);if(typeof de=="number"){if(de===0)return 1/0/de>0?"0":"-0";var Ui=String(de);return Xs?O(de,Ui):Ui}if(typeof de=="bigint"){var Is=String(de)+"n";return Xs?O(de,Is):Is}var xr=typeof mt.depth>"u"?5:mt.depth;if(typeof zt>"u"&&(zt=0),zt>=xr&&xr>0&&typeof de=="object")return me(de)?"[Array]":"[Object]";var ln=Wi(mt,zt);if(typeof Jt>"u")Jt=[];else if(ye(Jt,de)>=0)return"[Circular]";function zi(_e,Me,xe){if(Me&&(Jt=P.call(Jt),Jt.push(Me)),xe){var De={depth:mt.depth};return he(mt,"quoteStyle")&&(De.quoteStyle=mt.quoteStyle),ce(_e,De,zt+1,Jt)}return ce(_e,mt,zt+1,Jt)}if(typeof de=="function"&&!Ee(de)){var Ya=le(de),$a=yi(de,zi);return"[Function"+(Ya?": "+Ya:" (anonymous)")+"]"+($a.length>0?" { "+R.call($a,", ")+" }":"")}if(z(de)){var Qr=D?y.call(String(de),/^(Symbol\(.*\))_[^)]*$/,"$1"):B.call(de);return typeof de=="object"&&!D?Rt(Qr):Qr}if(St(de)){for(var cn="<"+A.call(String(de.nodeName)),bs=de.attributes||[],hn=0;hn",cn}if(me(de)){if(de.length===0)return"[]";var Xn=yi(de,zi);return ln&&!Oi(Xn)?"["+on(Xn,ln)+"]":"[ "+R.call(Xn,", ")+" ]"}if(ge(de)){var un=yi(de,zi);return!("cause"in Error.prototype)&&"cause"in de&&!L.call(de,"cause")?"{ ["+String(de)+"] "+R.call(_.call("[cause]: "+zi(de.cause),un),", ")+" }":un.length===0?"["+String(de)+"]":"{ ["+String(de)+"] "+R.call(un,", ")+" }"}if(typeof de=="object"&&Cs){if(V&&typeof de[V]=="function"&&X)return X(de,{depth:xr-zt});if(Cs!=="symbol"&&typeof de.inspect=="function")return de.inspect()}if(ae(de)){var Ga=[];return i&&i.call(de,function(_e,Me){Ga.push(zi(Me,de,!0)+" => "+zi(_e,de))}),Fi("Map",t.call(de),Ga,ln)}if(Oe(de)){var br=[];return o&&o.call(de,function(_e){br.push(zi(_e,de))}),Fi("Set",a.call(de),br,ln)}if(Le(de))return Zt("WeakMap");if(tt(de))return Zt("WeakSet");if(Re(de))return Zt("WeakRef");if(G(de))return Rt(zi(Number(de)));if(j(de))return Rt(zi(I.call(de)));if(Z(de))return Rt(p.call(de));if(Te(de))return Rt(zi(String(de)));if(typeof window<"u"&&de===window)return"{ [object Window] }";if(typeof globalThis<"u"&&de===globalThis||typeof mh<"u"&&de===mh)return"{ [object globalThis] }";if(!we(de)&&!Ee(de)){var H=yi(de,zi),Y=N?N(de)===Object.prototype:de instanceof Object||de.constructor===Object,ee=de instanceof Object?"":"null prototype",ne=!Y&&U&&Object(de)===de&&U in de?b.call(ve(de),8,-1):ee?"Object":"",ue=Y||typeof de.constructor!="function"?"":de.constructor.name?de.constructor.name+" ":"",pe=ue+(ne||ee?"["+R.call(_.call([],ne||[],ee||[]),": ")+"] ":"");return H.length===0?pe+"{}":ln?pe+"{"+on(H,ln)+"}":pe+"{ "+R.call(H,", ")+" }"}return String(de)};function J(ce,de,kt){var zt=kt.quoteStyle||de,Jt=q[zt];return Jt+ce+Jt}function K(ce){return y.call(String(ce),/"/g,""")}function fe(ce){return!U||!(typeof ce=="object"&&(U in ce||typeof ce[U]<"u"))}function me(ce){return ve(ce)==="[object Array]"&&fe(ce)}function we(ce){return ve(ce)==="[object Date]"&&fe(ce)}function Ee(ce){return ve(ce)==="[object RegExp]"&&fe(ce)}function ge(ce){return ve(ce)==="[object Error]"&&fe(ce)}function Te(ce){return ve(ce)==="[object String]"&&fe(ce)}function G(ce){return ve(ce)==="[object Number]"&&fe(ce)}function Z(ce){return ve(ce)==="[object Boolean]"&&fe(ce)}function z(ce){if(D)return ce&&typeof ce=="object"&&ce instanceof Symbol;if(typeof ce=="symbol")return!0;if(!ce||typeof ce!="object"||!B)return!1;try{return B.call(ce),!0}catch{}return!1}function j(ce){if(!ce||typeof ce!="object"||!I)return!1;try{return I.call(ce),!0}catch{}return!1}var te=Object.prototype.hasOwnProperty||function(ce){return ce in this};function he(ce,de){return te.call(ce,de)}function ve(ce){return m.call(ce)}function le(ce){if(ce.name)return ce.name;var de=v.call(g.call(ce),/^function\s*([\w$]+)/);return de?de[1]:null}function ye(ce,de){if(ce.indexOf)return ce.indexOf(de);for(var kt=0,zt=ce.length;ktde.maxStringLength){var kt=ce.length-de.maxStringLength,zt="... "+kt+" more character"+(kt>1?"s":"");return Pt(b.call(ce,0,de.maxStringLength),de)+zt}var Jt=W[de.quoteStyle||"single"];Jt.lastIndex=0;var mt=y.call(y.call(ce,Jt,"\\$1"),/[\x00-\x1f]/g,wt);return J(mt,"single",de)}function wt(ce){var de=ce.charCodeAt(0),kt={8:"b",9:"t",10:"n",12:"f",13:"r"}[de];return kt?"\\"+kt:"\\x"+(de<16?"0":"")+w.call(de.toString(16))}function Rt(ce){return"Object("+ce+")"}function Zt(ce){return ce+" { ? }"}function Fi(ce,de,kt,zt){var Jt=zt?on(kt,zt):R.call(kt,", ");return ce+" ("+de+") {"+Jt+"}"}function Oi(ce){for(var de=0;de=0)return!1;return!0}function Wi(ce,de){var kt;if(ce.indent===" ")kt=" ";else if(typeof ce.indent=="number"&&ce.indent>0)kt=R.call(Array(ce.indent+1)," ");else return null;return{base:kt,prev:R.call(Array(de+1),kt)}}function on(ce,de){if(ce.length===0)return"";var kt=` +`+de.prev+de.base;return kt+R.call(ce,","+kt)+` +`+de.prev}function yi(ce,de){var kt=me(ce),zt=[];if(kt){zt.length=ce.length;for(var Jt=0;Jt"u"||!_?s:_(Uint8Array),D={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":M&&_?_([][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%":M&&_?_(_([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!_?s:_(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":b,"%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"||!M||!_?s:_(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&_?_(""[Symbol.iterator]()):s,"%Symbol%":M?Symbol:s,"%SyntaxError%":a,"%ThrowTypeError%":A,"%TypedArray%":B,"%TypeError%":o,"%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%":h,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet,"%Function.prototype.call%":I,"%Function.prototype.apply%":F,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":R,"%Math.abs%":l,"%Math.floor%":c,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":p,"%Math.sign%":m,"%Reflect.getPrototypeOf%":P};if(_)try{null.error}catch(Ee){var U=_(_(Ee));D["%Error.prototype%"]=U}var L=function Ee(ge){var Te;if(ge==="%AsyncFunction%")Te=v("async function () {}");else if(ge==="%GeneratorFunction%")Te=v("function* () {}");else if(ge==="%AsyncGeneratorFunction%")Te=v("async function* () {}");else if(ge==="%AsyncGenerator%"){var G=Ee("%AsyncGeneratorFunction%");G&&(Te=G.prototype)}else if(ge==="%AsyncIteratorPrototype%"){var Z=Ee("%AsyncGenerator%");Z&&_&&(Te=_(Z.prototype))}return D[ge]=Te,Te},N={__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"]},O=yu(),X=QT(),E=O.call(I,Array.prototype.concat),V=O.call(F,Array.prototype.splice),q=O.call(I,String.prototype.replace),W=O.call(I,String.prototype.slice),J=O.call(I,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fe=/\\(\\)?/g,me=function(ge){var Te=W(ge,0,1),G=W(ge,-1);if(Te==="%"&&G!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(G==="%"&&Te!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var Z=[];return q(ge,K,function(z,j,te,he){Z[Z.length]=te?q(he,fe,"$1"):j||z}),Z},we=function(ge,Te){var G=ge,Z;if(X(N,G)&&(Z=N[G],G="%"+Z[0]+"%"),X(D,G)){var z=D[G];if(z===k&&(z=L(G)),typeof z>"u"&&!Te)throw new o("intrinsic "+ge+" exists, but is not available. Please file an issue!");return{alias:Z,name:G,value:z}}throw new a("intrinsic "+ge+" does not exist!")};return kd=function(ge,Te){if(typeof ge!="string"||ge.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Te!="boolean")throw new o('"allowMissing" argument must be a boolean');if(J(/^%?[^%]*%?$/,ge)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var G=me(ge),Z=G.length>0?G[0]:"",z=we("%"+Z+"%",Te),j=z.name,te=z.value,he=!1,ve=z.alias;ve&&(Z=ve[0],V(G,E([0,1],ve)));for(var le=1,ye=!0;le=G.length){var Oe=b(te,ae);ye=!!Oe,ye&&"get"in Oe&&!("originalValue"in Oe.get)?te=Oe.get:te=te[ae]}else ye=X(te,ae),te=te[ae];ye&&!he&&(D[j]=te)}}return te},kd}var Fd,T0;function Gx(){if(T0)return Fd;T0=1;var s=fp(),e=$x(),t=e([s("%String.prototype.indexOf%")]);return Fd=function(n,r){var a=s(n,!!r);return typeof a=="function"&&t(n,".prototype.")>-1?e([a]):a},Fd}var Od,A0;function Hx(){if(A0)return Od;A0=1;var s=fp(),e=Gx(),t=vu(),i=Do(),n=s("%Map%",!0),r=e("Map.prototype.get",!0),a=e("Map.prototype.set",!0),o=e("Map.prototype.has",!0),h=e("Map.prototype.delete",!0),l=e("Map.prototype.size",!0);return Od=!!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=h(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?o(u,f):!1},set:function(f,p){u||(u=new n),a(u,f,p)}};return d},Od}var Bd,E0;function e2(){if(E0)return Bd;E0=1;var s=fp(),e=Gx(),t=vu(),i=Hx(),n=Do(),r=s("%WeakMap%",!0),a=e("WeakMap.prototype.get",!0),o=e("WeakMap.prototype.set",!0),h=e("WeakMap.prototype.has",!0),l=e("WeakMap.prototype.delete",!0);return Bd=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?a(u,p):d&&d.get(p)},has:function(p){return r&&p&&(typeof p=="object"||typeof p=="function")&&u?h(u,p):!!d&&d.has(p)},set:function(p,m){r&&p&&(typeof p=="object"||typeof p=="function")?(u||(u=new r),o(u,p,m)):i&&(d||(d=i()),d.set(p,m))}};return f}:i,Bd}var Ld,C0;function jx(){if(C0)return Ld;C0=1;var s=Do(),e=vu(),t=RT(),i=Hx(),n=e2(),r=n||i||t;return Ld=function(){var o,h={assert:function(l){if(!h.has(l)){var c=l&&Object(l)===l?"the given object key":e(l);throw new s("Side channel does not contain "+c)}},delete:function(l){return!!o&&o.delete(l)},get:function(l){return o&&o.get(l)},has:function(l){return!!o&&o.has(l)},set:function(l,c){o||(o=r()),o.set(l,c)}};return h},Ld}var Dd,I0;function mp(){if(I0)return Dd;I0=1;var s=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Dd={default:t.RFC3986,formatters:{RFC1738:function(i){return s.call(i,e,"+")},RFC3986:function(i){return String(i)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Dd}var Nd,R0;function Wx(){if(R0)return Nd;R0=1;var s=mp(),e=jx(),t=Ux(),i=Object.prototype.hasOwnProperty,n=Array.isArray,r=e(),a=function(P,F){return r.set(P,F),P},o=function(P){return r.has(P)},h=function(P){return r.get(P)},l=function(P,F){r.set(P,F)},c=(function(){for(var R=[],P=0;P<256;++P)R[R.length]="%"+((P<16?"0":"")+P.toString(16)).toUpperCase();return R})(),u=function(P){for(;P.length>1;){var F=P.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 a(d(P.concat(F),I),k)}P[k]=F}else if(P&&typeof P=="object")if(o(P)){var B=h(P)+1;P[B]=F,l(P,B)}else{if(I&&I.strictMerge)return[P,F];(I&&(I.plainObjects||I.allowPrototypes)||!i.call(Object.prototype,F))&&(P[F]=!0)}else return[P,F];return P}if(!P||typeof P!="object"){if(o(F)){for(var D=Object.keys(F),U=I&&I.plainObjects?{__proto__:null,0:P}:{0:P},L=0;LI.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return a(d(O,I),O.length-1)}return O}var X=P;if(n(P)&&!n(F)&&(X=d(P,I)),n(P)&&n(F)){if(F.forEach(function(E,V){if(i.call(P,V)){var q=P[V];q&&typeof q=="object"&&E&&typeof E=="object"?P[V]=R(q,E,I):P[P.length]=E}else P[V]=E}),I&&typeof I.arrayLimit=="number"&&P.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 a(d(P,I),P.length-1)}return P}return Object.keys(F).reduce(function(E,V){var q=F[V];if(i.call(E,V)?f(E,V,R(E[V],q,I)):f(E,V,q),o(F)&&!o(E)&&a(E,h(F)),o(E)){var W=parseInt(V,10);String(W)===V&&W>=0&&W>h(E)&&l(E,W)}return E},X)},m=function(P,F){return Object.keys(F).reduce(function(I,k){return f(I,k,F[k]),I},P)},g=function(R,P,F){var I=R.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,b=function(P,F,I,k,B){if(P.length===0)return P;var D=P;if(typeof P=="symbol"?D=Symbol.prototype.toString.call(P):typeof P!="string"&&(D=String(P)),I==="iso-8859-1")return escape(D).replace(/%u[0-9a-f]{4}/gi,function(q){return"%26%23"+parseInt(q.slice(2),16)+"%3B"});for(var U="",L=0;L=v?D.slice(L,L+v):D;if(L+v=55296&&O<=56319&&(N=N.slice(0,-1),L-=1)}for(var X=[],E=0;E=48&&V<=57||V>=65&&V<=90||V>=97&&V<=122||B===s.RFC1738&&(V===40||V===41)){X[X.length]=N.charAt(E);continue}if(V<128){X[X.length]=c[V];continue}if(V<2048){X[X.length]=c[192|V>>6]+c[128|V&63];continue}if(V<55296||V>=57344){X[X.length]=c[224|V>>12]+c[128|V>>6&63]+c[128|V&63];continue}E+=1,V=65536+((V&1023)<<10|N.charCodeAt(E)&1023),X[X.length]=c[240|V>>18]+c[128|V>>12&63]+c[128|V>>6&63]+c[128|V&63]}U+=X.join("")}return U},y=function(P){for(var F=[{obj:{o:P},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 a(d(U,{plainObjects:k}),U.length-1)}return U},_=function(P,F){if(n(P)){for(var I=[],k=0;k"u"&&(E=0)}if(typeof P=="function"?O=P(v,O):O instanceof Date?O=k(O):b==="comma"&&r(O)&&(O=e.maybeMap(O,function(j){return j instanceof Date?k(j):j})),O===null){if(A)return D(R&&!U?R(v,c.encoder,L,"key",B):v);O=""}if(u(O)||e.isBuffer(O)){if(R){var W=U?v:R(v,c.encoder,L,"key",B);return[D(W)+"="+D(R(O,c.encoder,L,"value",B))]}return[D(v)+"="+D(String(O))]}var J=[];if(typeof O>"u")return J;var K;if(b==="comma"&&r(O))U&&R&&(O=e.maybeMap(O,function(j){return j==null?j:R(j)})),K=[{value:O.length>0?O.join(",")||null:void 0}];else if(r(P))K=P;else{var fe=Object.keys(O);K=F?fe.sort(F):fe}var me=_?String(v).replace(/\./g,"%2E"):String(v),we=y&&r(O)&&O.length===1?me+"[]":me;if(w&&r(O)&&O.length===0)return we+"[]";for(var Ee=0;Ee"u"?g.encodeDotInKeys===!0?!0:c.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:c.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:A,charset:v,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?c.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:c.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:c.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:c.encodeValuesOnly,filter:w,format:b,formatter:y,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:c.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:c.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:c.strictNullHandling}};return Ud=function(m,g){var v=m,b=p(g),y,w;typeof b.filter=="function"?(w=b.filter,v=w("",v)):r(b.filter)&&(w=b.filter,y=w);var A=[];if(typeof v!="object"||v===null)return"";var M=n[b.arrayFormat],_=M==="comma"&&b.commaRoundTrip;y||(y=Object.keys(v)),b.sort&&y.sort(b.sort);for(var R=s(),P=0;P"u"||F===null)){var I=v[F];b.skipNulls&&I===null||o(A,f(I,F,M,_,b.allowEmptyArrays,b.strictNullHandling,b.skipNulls,b.encodeDotInKeys,b.encode?b.encoder:null,b.filter,b.sort,b.allowDots,b.serializeDate,b.format,b.formatter,b.encodeValuesOnly,b.charset,R))}}var k=A.join(b.delimiter),B=b.addQueryPrefix===!0?"?":"";return b.charsetSentinel&&(b.charset==="iso-8859-1"?B+="utf8=%26%2310003%3B"+b.delimiter:B+="utf8=%E2%9C%93"+b.delimiter),k.length>0?B+k:""},Ud}var Xd,k0;function i2(){if(k0)return Xd;k0=1;var s=Wx(),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,b=f.indexOf(",");b>-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.");b=f.indexOf(",",b+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},a="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",h=function(p,m){var g={__proto__:null},v=m.ignoreQueryPrefix?p.replace(/^\?/,""):p;v=v.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=m.parameterLimit===1/0?void 0:m.parameterLimit,y=v.split(m.delimiter,m.throwOnLimitExceeded&&typeof b<"u"?b+1:b);if(m.throwOnLimitExceeded&&typeof b<"u"&&y.length>b)throw new RangeError("Parameter limit exceeded. Only "+b+" parameter"+(b===1?"":"s")+" allowed.");var w=-1,A,M=m.charset;if(m.charsetSentinel)for(A=0;A-1&&(I=t(I)?[I]:I),m.comma&&t(I)&&I.length>m.arrayLimit&&(I=s.combine([],I,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded)),F!==null){var k=e.call(g,F);k&&(m.duplicates==="combine"||_.indexOf("[]=")>-1)?g[F]=s.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 b=f.slice(0,-1).join("");v=Array.isArray(p)&&p[b]?p[b].length:0}for(var y=g?p:r(p,m,v),w=f.length-1;w>=0;--w){var A,M=f[w];if(M==="[]"&&m.parseArrays)s.isOverflow(y)?A=y:A=m.allowEmptyArrays&&(y===""||m.strictNullHandling&&y===null)?[]:s.combine([],y,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded);else{A=m.plainObjects?{__proto__:null}:{};var _=M.charAt(0)==="["&&M.charAt(M.length-1)==="]"?M.slice(1,-1):M,R=m.decodeDotInKeys?_.replace(/%2E/g,"."):_,P=parseInt(R,10),F=!isNaN(P)&&M!==R&&String(P)===R&&P>=0&&m.parseArrays;if(!m.parseArrays&&R==="")A={0:y};else if(F&&P=0?g.slice(0,b):g;if(y){if(!m.plainObjects&&e.call(Object.prototype,y)&&!m.allowPrototypes)return;v[v.length]=y}for(var w=g.length,A=b,M=0;A>=0&&M=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 b=c(p,g);if(b)return l(b,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"?h(f,m):f,v=m.plainObjects?{__proto__:null}:{},b=Object.keys(g),y=0;y",'"',"`"," ","\r",` +`," "],a=["{","}","|","\\","^","`"].concat(r),o=["'"].concat(a),h=["%","/","?",";","#"].concat(o),l=["/","?","#"],c=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=s2();function v(A,M,_){if(A&&typeof A=="object"&&A instanceof e)return A;var R=new e;return R.parse(A,M,_),R}e.prototype.parse=function(A,M,_){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var R=A.indexOf("?"),P=R!==-1&&R127?fe+="x":fe+=K[me];if(!fe.match(u)){var Ee=W.slice(0,O),ge=W.slice(O+1),Te=K.match(d);Te&&(Ee.push(Te[1]),ge.unshift(Te[2])),ge.length&&(k="/"+ge.join(".")+k),this.hostname=Ee.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=s.toASCII(this.hostname));var G=this.port?":"+this.port:"",Z=this.hostname||"";this.host=Z+G,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),k[0]!=="/"&&(k="/"+k))}if(!f[U])for(var O=0,J=o.length;O0?_.host.split("@"):!1;fe&&(_.auth=fe.shift(),_.hostname=fe.shift(),_.host=_.hostname)}return _.search=A.search,_.query=A.query,(_.pathname!==null||_.search!==null)&&(_.path=(_.pathname?_.pathname:"")+(_.search?_.search:"")),_.href=_.format(),_}if(!W.length)return _.pathname=null,_.search?_.path="/"+_.search:_.path=null,_.href=_.format(),_;for(var me=W.slice(-1)[0],we=(_.host||A.host||W.length>1)&&(me==="."||me==="..")||me==="",Ee=0,ge=W.length;ge>=0;ge--)me=W[ge],me==="."?W.splice(ge,1):me===".."?(W.splice(ge,1),Ee++):Ee&&(W.splice(ge,1),Ee--);if(!V&&!q)for(;Ee--;Ee)W.unshift("..");V&&W[0]!==""&&(!W[0]||W[0].charAt(0)!=="/")&&W.unshift(""),we&&W.join("/").substr(-1)!=="/"&&W.push("");var Te=W[0]===""||W[0]&&W[0].charAt(0)==="/";if(K){_.hostname=Te?"":W.length?W.shift():"",_.host=_.hostname;var fe=_.host&&_.host.indexOf("@")>0?_.host.split("@"):!1;fe&&(_.auth=fe.shift(),_.hostname=fe.shift(),_.host=_.hostname)}return V=V||_.host&&W.length,V&&!Te&&W.unshift(""),W.length>0?_.pathname=W.join("/"):(_.pathname=null,_.path=null),(_.pathname!==null||_.search!==null)&&(_.path=(_.pathname?_.pathname:"")+(_.search?_.search:"")),_.auth=A.auth||_.auth,_.slashes=_.slashes||A.slashes,_.href=_.format(),_},e.prototype.parseHost=function(){var A=this.host,M=i.exec(A);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),A=A.substr(0,A.length-M.length)),A&&(this.hostname=A)},na.parse=v,na.resolve=y,na.resolveObject=w,na.format=b,na.Url=e,na}n2();const B0={};function Ot(s,e,t=3){if(B0[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))),B0[e]=!0}function Vs(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function Wo(s){return s.split("?")[0].split("#")[0]}function r2(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a2(s,e,t){return s.replace(new RegExp(r2(e),"g"),t)}function o2(s,e){let t="",i=0,n=-1,r=0,a=-1;for(let o=0;o<=s.length;++o){if(o2){const h=t.lastIndexOf("/");if(h!==t.length-1){h===-1?(t="",i=0):(t=t.slice(0,h),i=t.length-1-t.lastIndexOf("/")),n=o,r=0;continue}}else if(t.length===2||t.length===1){t="",i=0,n=o,r=0;continue}}}else t.length>0?t+=`/${s.slice(n+1,o)}`:t=s.slice(n+1,o),i=o-n-1;n=o,r=0}else a===46&&r!==-1?++r:r=-1}return t}const wi={toPosix(s){return a2(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){Vs(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(Vs(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=Wo(this.toPosix(e??We.ADAPTER.getBaseUrl())),n=Wo(this.toPosix(t??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?wi.join(n,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(Vs(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=o2(s),s.length>0&&i&&(s+="/"),t?`/${s}`:e+s},isAbsolute(s){return Vs(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(Vs(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),a=s;s=s.slice(r.length);for(let o=s.length-1;o>=1;--o)if(e=s.charCodeAt(o),e===47){if(!n){i=o;break}}else n=!1;return i===-1?t?"/":this.isUrl(a)?r+s:r:t&&i===1?"//":r+s.slice(0,i)},rootname(s){Vs(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){Vs(s),e&&Vs(e),s=Wo(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 a=e.length-1,o=-1;for(r=s.length-1;r>=0;--r){const h=s.charCodeAt(r);if(h===47){if(!n){t=r+1;break}}else o===-1&&(n=!1,o=r+1),a>=0&&(h===e.charCodeAt(a)?--a===-1&&(i=r):(a=-1,i=o))}return t===i?i=o: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){Vs(s),s=Wo(this.toPosix(s));let e=-1,t=0,i=-1,n=!0,r=0;for(let a=s.length-1;a>=0;--a){const o=s.charCodeAt(a);if(o===47){if(!n){t=a+1;break}continue}i===-1&&(n=!1,i=a+1),o===46?e===-1?e=a: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){Vs(s);const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;s=Wo(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,a=0,o=-1,h=!0,l=s.length-1,c=0;for(;l>=n;--l){if(t=s.charCodeAt(l),t===47){if(!h){a=l+1;break}continue}o===-1&&(h=!1,o=l+1),t===46?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===a+1?o!==-1&&(a===0&&i?e.base=e.name=s.slice(1,o):e.base=e.name=s.slice(a,o)):(a===0&&i?(e.name=s.slice(1,r),e.base=s.slice(1,o)):(e.name=s.slice(a,r),e.base=s.slice(a,o)),e.ext=s.slice(r,o)),e.dir=this.dirname(s),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Yd;async function l2(){return Yd??(Yd=(async()=>{var r;const s=document.createElement("canvas").getContext("webgl");if(!s)return Ni.UNPACK;const e=await new Promise(a=>{const o=document.createElement("video");o.onloadeddata=()=>a(o),o.onerror=()=>a(null),o.autoplay=!1,o.crossOrigin="anonymous",o.preload="auto",o.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",o.load()});if(!e)return Ni.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]?Ni.PMA:Ni.UNPACK})()),Yd}let $d;function c2(){return typeof $d>"u"&&($d=(function(){var e;const s={stencil:!0,failIfMajorPerformanceCaveat:We.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!We.ADAPTER.getWebGLRenderingContext())return!1;const t=We.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}})()),$d}var h2={grad:.9,turn:360,rad:360/(2*Math.PI)},Gn=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},Di=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*s)/t+0},Ds=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),s>t?t:s>e?s:e},zx=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},L0=function(s){return{r:Ds(s.r,0,255),g:Ds(s.g,0,255),b:Ds(s.b,0,255),a:Ds(s.a)}},Gd=function(s){return{r:Di(s.r),g:Di(s.g),b:Di(s.b),a:Di(s.a,3)}},u2=/^#([0-9a-f]{3,8})$/i,lc=function(s){var e=s.toString(16);return e.length<2?"0"+e:e},qx=function(s){var e=s.r,t=s.g,i=s.b,n=s.a,r=Math.max(e,t,i),a=r-Math.min(e,t,i),o=a?r===e?(t-i)/a:r===t?2+(i-e)/a:4+(e-t)/a:0;return{h:60*(o<0?o+6:o),s:r?a/r*100:0,v:r/255*100,a:n}},Kx=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),a=i*(1-t),o=i*(1-(e-r)*t),h=i*(1-(1-e+r)*t),l=r%6;return{r:255*[i,o,a,a,h,i][l],g:255*[h,i,i,o,a,a][l],b:255*[a,a,h,i,i,o][l],a:n}},D0=function(s){return{h:zx(s.h),s:Ds(s.s,0,100),l:Ds(s.l,0,100),a:Ds(s.a)}},N0=function(s){return{h:Di(s.h),s:Di(s.s),l:Di(s.l),a:Di(s.a,3)}},U0=function(s){return Kx((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},gl=function(s){return{h:(e=qx(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},d2=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,f2=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m2=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p2=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$f={string:[[function(s){var e=u2.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?Di(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?Di(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var e=m2.exec(s)||p2.exec(s);return e?e[2]!==e[4]||e[4]!==e[6]?null:L0({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=d2.exec(s)||f2.exec(s);if(!e)return null;var t,i,n=D0({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(h2[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return U0(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 Gn(e)&&Gn(t)&&Gn(i)?L0({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(!Gn(e)||!Gn(t)||!Gn(i))return null;var a=D0({h:Number(e),s:Number(t),l:Number(i),a:Number(r)});return U0(a)},"hsl"],[function(s){var e=s.h,t=s.s,i=s.v,n=s.a,r=n===void 0?1:n;if(!Gn(e)||!Gn(t)||!Gn(i))return null;var a=(function(o){return{h:zx(o.h),s:Ds(o.s,0,100),v:Ds(o.v,0,100),a:Ds(o.a)}})({h:Number(e),s:Number(t),v:Number(i),a:Number(r)});return Kx(a)},"hsv"]]},X0=function(s,e){for(var t=0;t=.5},s.prototype.toHex=function(){return e=Gd(this.rgba),t=e.r,i=e.g,n=e.b,a=(r=e.a)<1?lc(Di(255*r)):"","#"+lc(t)+lc(i)+lc(n)+a;var e,t,i,n,r,a},s.prototype.toRgb=function(){return Gd(this.rgba)},s.prototype.toRgbString=function(){return e=Gd(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 N0(gl(this.rgba))},s.prototype.toHslString=function(){return e=N0(gl(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=qx(this.rgba),{h:Di(e.h),s:Di(e.s),v:Di(e.v),a:Di(e.a,3)};var e},s.prototype.invert=function(){return fn({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),fn(Hd(this.rgba,e))},s.prototype.desaturate=function(e){return e===void 0&&(e=.1),fn(Hd(this.rgba,-e))},s.prototype.grayscale=function(){return fn(Hd(this.rgba,-1))},s.prototype.lighten=function(e){return e===void 0&&(e=.1),fn(V0(this.rgba,e))},s.prototype.darken=function(e){return e===void 0&&(e=.1),fn(V0(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"?fn({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Di(this.rgba.a,3);var t},s.prototype.hue=function(e){var t=gl(this.rgba);return typeof e=="number"?fn({h:e,s:t.s,l:t.l,a:t.a}):Di(t.h)},s.prototype.isEqual=function(e){return this.toHex()===fn(e).toHex()},s})(),fn=function(s){return s instanceof Gf?s:new Gf(s)},Y0=[],v2=function(s){s.forEach(function(e){Y0.indexOf(e)<0&&(e(Gf,$f),Y0.push(e))})};function y2(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(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,h,l=i[this.toHex()];if(l)return l;if(a!=null&&a.closest){var c=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=(o=c,h=r[p],Math.pow(o.r-h.r,2)+Math.pow(o.g-h.g,2)+Math.pow(o.b-h.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(a=>e[a]===t[a])}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]=Yc.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 a=e;t=(a>>16&255)/255,i=(a>>8&255)/255,n=(a&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 o=Yc.HEX_PATTERN.exec(e);o&&(e=`#${o[2]}`)}const a=fn(e);a.isValid()&&({r:t,g:i,b:n,a:r}=a.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)}};so.shared=new so,so.temp=new so,so.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Wt=so;function x2(s){return Ot("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Wt.shared.setValue(s).toHex()}function b2(s){return Ot("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Wt.shared.setValue(s).toNumber()}function w2(){const s=[],e=[];for(let i=0;i<32;i++)s[i]=i,e[i]=i;s[dt.NORMAL_NPM]=dt.NORMAL,s[dt.ADD_NPM]=dt.ADD,s[dt.SCREEN_NPM]=dt.SCREEN,e[dt.NORMAL]=dt.NORMAL_NPM,e[dt.ADD]=dt.ADD_NPM,e[dt.SCREEN]=dt.SCREEN_NPM;const t=[];return t.push(e),t.push(s),t}const Zx=w2();function Jx(s,e){return Zx[e?1:0][s]}function S2(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 $0(s){return!(s&s-1)&&!!s}function G0(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 xo(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))(Ge||{});const jf=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},q0=(s,e)=>jf(s).priority??e,et={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(jf).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(jf).forEach(e=>{e.type.forEach(t=>{var r,a;const i=this._addHandlers,n=this._queue;i[t]?(r=i[t])==null||r.call(i,e):(n[t]=n[t]||[],(a=n[t])==null||a.push(e))})}),this},handle(s,e,t){var a;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]&&((a=r[s])==null||a.forEach(o=>e(o)),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)=>q0(r,t)-q0(n,t)))},i=>{const n=e.indexOf(i.ref);n!==-1&&e.splice(n,1)})}};class Wf{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 C2=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` +`);function I2(s){let e="";for(let t=0;t0&&(e+=` +else `),t=0;--i){const n=zf[i];if(n.test&&n.test(s,t))return new n(s,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Qs{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,t,i,n,r,a,o,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:c}=this;this._aliasCount++;for(let u=0,d=c.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(Qs.prototype,{dispatch:{value:Qs.prototype.emit},run:{value:Qs.prototype.emit}});class Bl{constructor(e=0,t=0){this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Qs("setRealSize"),this.onUpdate=new Qs("update"),this.onError=new Qs("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 xu extends Bl{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===Ni.UNPACK);const r=t.realWidth,a=t.realHeight;return i.width===r&&i.height===a?n.texSubImage2D(t.target,0,0,0,r,a,t.format,i.type,this.data):(i.width=r,i.height=a,n.texImage2D(t.target,0,i.internalFormat,r,a,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 P2={scaleMode:qs.NEAREST,alphaMode:Ni.NPM},qf=class no extends jl{constructor(e=null,t=null){super(),t=Object.assign({},no.defaultOptions,t);const{alphaMode:i,mipmap:n,anisotropicLevel:r,scaleMode:a,width:o,height:h,wrapMode:l,format:c,type:u,target:d,resolution:f,resourceOptions:p}=t;e&&!(e instanceof Bl)&&(e=eb(e,p),e.internal=!0),this.resolution=f||We.RESOLUTION,this.width=Math.round((o||0)*this.resolution)/this.resolution,this.height=Math.round((h||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=r,this._wrapMode=l,this._scaleMode=a,this.format=c,this.type=u,this.target=d,this.alphaMode=i,this.uid=Pa(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=o>0&&h>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=$0(this.realWidth)&&$0(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 _r[this.cacheId],delete mn[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),no.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=We.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else{if(!e._pixiId){const o=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${Pa()}`}r=e._pixiId}let a=_r[r];if(n&&i&&!a)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return a||(a=new no(e,t),a.cacheId=r,no.addToCache(a,r)),a}static fromBuffer(e,t,i,n){e=e||new Float32Array(t*i*4);const r=new xu(e,{width:t,height:i,...n==null?void 0:n.resourceOptions});let a,o;return e instanceof Float32Array?(a=Ne.RGBA,o=Qe.FLOAT):e instanceof Int32Array?(a=Ne.RGBA_INTEGER,o=Qe.INT):e instanceof Uint32Array?(a=Ne.RGBA_INTEGER,o=Qe.UNSIGNED_INT):e instanceof Int16Array?(a=Ne.RGBA_INTEGER,o=Qe.SHORT):e instanceof Uint16Array?(a=Ne.RGBA_INTEGER,o=Qe.UNSIGNED_SHORT):e instanceof Int8Array?(a=Ne.RGBA,o=Qe.BYTE):(a=Ne.RGBA,o=Qe.UNSIGNED_BYTE),r.internal=!0,new no(r,Object.assign({},P2,{type:o,format:a},n))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),_r[t]&&_r[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),_r[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=_r[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete _r[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))(Hi||{});class Xt{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new Xt(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}}Xt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const cc=[new Xt,new Xt,new Xt,new Xt];class Tt{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=Hi.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 Tt(0,0,0,0)}clone(){return new Tt(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)<=R)return!1;const P=this.ye.bottom?e.bottom:this.bottom)>P}const i=this.left,n=this.right,r=this.top,a=this.bottom;if(n<=i||a<=r)return!1;const o=cc[0].set(e.left,e.top),h=cc[1].set(e.left,e.bottom),l=cc[2].set(e.right,e.top),c=cc[3].set(e.right,e.bottom);if(l.x<=o.x||h.y<=o.y)return!1;const u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(o,o),t.apply(h,h),t.apply(l,l),t.apply(c,c),Math.max(o.x,h.x,l.x,c.x)<=i||Math.min(o.x,h.x,l.x,c.x)>=n||Math.max(o.y,h.y,l.y,c.y)<=r||Math.min(o.y,h.y,l.y,c.y)>=a))return!1;const d=u*(h.y-o.y),f=u*(o.x-h.x),p=d*i+f*r,m=d*n+f*r,g=d*i+f*a,v=d*n+f*a;if(Math.max(p,m,g,v)<=d*o.x+f*o.y||Math.min(p,m,g,v)>=d*c.x+f*c.y)return!1;const b=u*(o.y-l.y),y=u*(l.x-o.x),w=b*i+y*r,A=b*n+y*r,M=b*i+y*a,_=b*n+y*a;return!(Math.max(w,A,M,_)<=b*o.x+y*o.y||Math.min(w,A,M,_)>=b*c.x+y*c.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}}Tt.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class bu{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.radius=i,this.type=Hi.CIRC}clone(){return new bu(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 Tt(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}bu.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class wu{constructor(e=0,t=0,i=0,n=0){this.x=e,this.y=t,this.width=i,this.height=n,this.type=Hi.ELIP}clone(){return new wu(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 Tt(this.x-this.width,this.y-this.height,this.width,this.height)}}wu.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Aa{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!=c>t&&e<(l-o)*((t-h)/(c-h))+o&&(i=!i)}return i}}Aa.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((s,e)=>`${s}, ${e}`,"")}]`};class Su{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=Hi.RREC}clone(){return new Su(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 a=i*i;if(n*n+r*r<=a||(n=e-(this.x+this.width-i),n*n+r*r<=a)||(r=t-(this.y+this.height-i),n*n+r*r<=a)||(n=e-(this.x+i),n*n+r*r<=a))return!0}return!1}}Su.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class oi{constructor(e=1,t=0,i=0,n=1,r=0,a=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=a}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,a){return this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=a,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 Xt;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 Xt;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,a=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=a*t-this.ty*i,this.ty=a*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,a,o,h,l){return this.a=Math.cos(o+l)*r,this.b=Math.sin(o+l)*r,this.c=-Math.sin(o-h)*a,this.d=Math.cos(o-h)*a,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,a=e.pivot,o=-Math.atan2(-n,r),h=Math.atan2(i,t),l=Math.abs(o+h);return l<1e-5||Math.abs(vh-l)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=h),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(n*n+r*r),e.position.x=this.tx+(a.x*t+a.y*n),e.position.y=this.ty+(a.x*i+a.y*r),e}invert(){const e=this.a,t=this.b,i=this.c,n=this.d,r=this.tx,a=e*n-t*i;return this.a=n/a,this.b=-t/a,this.c=-i/a,this.d=e/a,this.tx=(i*this.ty-n*r)/a,this.ty=-(e*this.ty-t*r)/a,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 oi;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 oi}static get TEMP_MATRIX(){return new oi}}oi.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 ca=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],ha=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],ua=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],da=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Zf=[],ib=[],hc=Math.sign;function U2(){for(let s=0;s<16;s++){const e=[];Zf.push(e);for(let t=0;t<16;t++){const i=hc(ca[s]*ca[t]+ua[s]*ha[t]),n=hc(ha[s]*ca[t]+da[s]*ha[t]),r=hc(ca[s]*ua[t]+ua[s]*da[t]),a=hc(ha[s]*ua[t]+da[s]*da[t]);for(let o=0;o<16;o++)if(ca[o]===i&&ha[o]===n&&ua[o]===r&&da[o]===a){e.push(o);break}}}for(let s=0;s<16;s++){const e=new oi;e.set(ca[s],ha[s],ua[s],da[s],0,0),ib.push(e)}}U2();const fi={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=>ca[s],uY:s=>ha[s],vX:s=>ua[s],vY:s=>da[s],inv:s=>s&8?s&15:-s&7,add:(s,e)=>Zf[s][e],sub:(s,e)=>Zf[s][fi.inv(e)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,e)=>Math.abs(s)*2<=Math.abs(e)?e>=0?fi.S:fi.N:Math.abs(e)*2<=Math.abs(s)?s>0?fi.E:fi.W:e>0?s>0?fi.SE:fi.SW:s>0?fi.NE:fi.NW,matrixAppendRotationInv:(s,e,t=0,i=0)=>{const n=ib[fi.inv(e)];n.tx=t,n.ty=i,s.append(n)}};class ir{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 ir(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))}}ir.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Jf=class{constructor(){this.worldTransform=new oi,this.localTransform=new oi,this.position=new ir(this.onChange,this,0,0),this.scale=new ir(this.onChange,this,1,1),this.pivot=new ir(this.onChange,this,0,0),this.skew=new ir(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())}};Jf.IDENTITY=new Jf;let pp=Jf;pp.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 X2=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; + +void main(void){ + gl_FragColor *= texture2D(uSampler, vTextureCoord); +}`,V2=`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 Z0(s,e,t){const i=s.createShader(e);return s.shaderSource(i,t),s.compileShader(i),i}function Qd(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]) + }`}],Y2={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); + }`},$2={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 G2(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 a=s.uniforms[n];let o=!1;for(let h=0;h=Da.WEBGL2&&(e=s.getContext("webgl2",{})),e||(e=s.getContext("webgl",{})||s.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),qa=e}return qa}let uc;function j2(){if(!uc){uc=Ls.MEDIUM;const s=H2();if(s&&s.getShaderPrecisionFormat){const e=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);e&&(uc=e.precision?Ls.HIGH:Ls.MEDIUM)}}return uc}function J0(s,e){const t=s.getShaderSource(e).split(` +`).map((l,c)=>`${c}: ${l}`),i=s.getShaderInfoLog(e),n=i.split(` +`),r={},a=n.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!r[l]?(r[l]=!0,!0):!1),o=[""];a.forEach(l=>{t[l-1]=`%c${t[l-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const h=t.join(` +`);o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function W2(s,e,t,i){s.getProgramParameter(e,s.LINK_STATUS)||(s.getShaderParameter(t,s.COMPILE_STATUS)||J0(s,t),s.getShaderParameter(i,s.COMPILE_STATUS)||J0(s,i),console.error("PixiJS Error: Could not initialize shader."),s.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",s.getProgramInfoLog(e)))}const z2={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 rb(s){return z2[s]}let dc=null;const Q0={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 ab(s,e){if(!dc){const t=Object.keys(Q0);dc={};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=Gs._textureArrayPool,n=this.renderer.batch,r=this._tempBoundTextures,a=this.renderer.textureGC.count;let o=++vt._globalBatch,h=0,l=i[0],c=0;n.copyBoundTextures(r,t);for(let u=0;u=t&&(n.boundArray(l,r,o,t),this.buildDrawCalls(l,c,u),c=u,l=i[++h],++o),d._batchEnabled=o,d.touched=a,l.elements[l.count++]=d)}l.count>0&&(n.boundArray(l,r,o,t),this.buildDrawCalls(l,c,this._bufferSize),++h,++o);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:a,count:o}=e;let h=0;for(let l=0;l=0&&u=Da.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")}}xh.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},xh.extension={type:Ge.RendererSystem,name:"context"};et.add(xh);class im{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 Qs("disposeFramebuffer"),this.multisample=Ai.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,t){return this.colorTextures[e]=t||new vt(null,{scaleMode:qs.NEAREST,resolution:1,mipmap:Us.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new vt(null,{scaleMode:qs.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Us.OFF,format:Ne.DEPTH_COMPONENT,type:Qe.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=a=>{i(a),this.onError.emit(a)})}),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===Ni.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 a in r){const o=r[a];if(o!==i&&o.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 gp{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 a=e.width/2/n,o=e.height/2/r,h=e.x/n+a,l=e.y/r+o;i=fi.add(i,fi.NW),this.x0=h+a*fi.uX(i),this.y0=l+o*fi.uY(i),i=fi.add(i,2),this.x1=h+a*fi.uX(i),this.y1=l+o*fi.uY(i),i=fi.add(i,2),this.x2=h+a*fi.uX(i),this.y2=l+o*fi.uY(i),i=fi.add(i,2),this.x3=h+a*fi.uX(i),this.y3=l+o*fi.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}}gp.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 iv=new gp;function mc(s){s.destroy=function(){},s.on=function(){},s.once=function(){},s.emit=function(){}}let pt=class si extends jl{constructor(e,t,i,n,r,a,o){if(super(),this.noFrame=!1,t||(this.noFrame=!0,t=new Tt(0,0,1,1)),e instanceof si&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=n,this.valid=!1,this.destroyed=!1,this._uvs=iv,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=a?new Xt(a.x,a.y):new Xt(0,0),this.defaultBorders=o,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&&mn[t.url]&&si.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,si.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 si(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===iv&&(this._uvs=new gp),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,t={},i=We.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else if(e instanceof vt){if(!e.cacheId){const o=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e.cacheId=`${o}-${Pa()}`,vt.addToCache(e,e.cacheId)}r=e.cacheId}else{if(!e._pixiId){const o=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${Pa()}`}r=e._pixiId}let a=mn[r];if(n&&i&&!a)throw new Error(`The cacheId "${r}" does not exist in TextureCache.`);return!a&&!(e instanceof vt)?(t.resolution||(t.resolution=mr(e)),a=new si(new vt(e,t)),a.baseTexture.cacheId=r,vt.addToCache(a.baseTexture,r),si.addToCache(a,r)):!a&&e instanceof vt&&(a=new si(e),si.addToCache(a,r)),a}static fromURL(e,t){const i=Object.assign({autoLoad:!1},t==null?void 0:t.resourceOptions),n=si.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 si(vt.fromBuffer(e,t,i,n))}static fromLoader(e,t,i,n){const r=new vt(e,Object.assign({scaleMode:vt.defaultOptions.scaleMode,resolution:mr(t)},n)),{resource:a}=r;a instanceof hb&&(a.url=t);const o=new si(r);return i||(i=t),vt.addToCache(o.baseTexture,i),si.addToCache(o,i),i!==t&&(vt.addToCache(o.baseTexture,t),si.addToCache(o,t)),o.baseTexture.valid?Promise.resolve(o):new Promise(h=>{o.baseTexture.once("loaded",()=>h(o))})}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),mn[t]&&mn[t]!==e&&console.warn(`Texture added to the cache with an id [${t}] that already had an entry`),mn[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=mn[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete mn[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;tthis.baseTexture.width,o=i+r>this.baseTexture.height;if(a||o){const h=a&&o?"and":"or",l=`X: ${t} + ${n} = ${t+n} > ${this.baseTexture.width}`,c=`Y: ${i} + ${r} = ${i+r} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${h} ${c}`)}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 si._EMPTY||(si._EMPTY=new si(new vt),mc(si._EMPTY),mc(si._EMPTY.baseTexture)),si._EMPTY}static get WHITE(){if(!si._WHITE){const e=We.ADAPTER.createCanvas(16,16),t=e.getContext("2d");e.width=16,e.height=16,t.fillStyle="white",t.fillRect(0,0,16,16),si._WHITE=new si(vt.from(e)),mc(si._WHITE),mc(si._WHITE.baseTexture)}return si._WHITE}};class Na extends pt{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,a=Math.round(t*n)/n;this.valid=r>0&&a>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=a,i&&this.baseTexture.resize(r,a),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 Na(new cb(e))}}class ub{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 cb(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new Na(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=ph(e),t=ph(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 a=this.texturePool[r].pop();return a||(a=this.createTexture(e,t,n)),a.filterPoolKey=r,a.setResolution(i),a}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&&(c=this.getOptimalFilterTexture(l.width,l.height,t.resolution),c.filterFrame=l.filterFrame),i[u].apply(this,l,c,En.CLEAR,t);const d=l;l=c,c=d}i[u].apply(this,l,h.renderTexture,En.BLEND,t),u>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}t.clear(),this.statePool.push(t)}bindAndClear(e,t=En.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 a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,i.bind(e,e.filterFrame,a)}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===En.CLEAR||t===En.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(Rn.TRIANGLES)):(r.geometry.bind(this.quad),r.geometry.draw(Rn.TRIANGLE_STRIP))}calculateSpriteMatrix(e,t){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:r}=t._texture,a=e.set(n.width,0,0,n.height,i.x,i.y),o=t.worldTransform.copyTo(oi.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/r.width,1/r.height),a.translate(t.anchor.x,t.anchor.y),a}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=pc[0],n=pc[1],r=pc[2],a=pc[3];i.set(t.left,t.top),n.set(t.left,t.bottom),r.set(t.right,t.top),a.set(t.right,t.bottom),e.apply(i,i),e.apply(n,n),e.apply(r,r),e.apply(a,a);const o=Math.min(i.x,n.x,r.x,a.x),h=Math.min(i.y,n.y,r.y,a.y),l=Math.max(i.x,n.x,r.x,a.x),c=Math.max(i.y,n.y,r.y,a.y);t.x=o,t.y=h,t.width=l-o,t.height=c-h}roundFrame(e,t,i,n,r){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(r){const{a,b:o,c:h,d:l}=r;if((Math.abs(o)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(l)>1e-4))return}r=r?ef.copyFrom(r):ef.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)}}}fb.extension={type:Ge.RendererSystem,name:"filter"};et.add(fb);class aA{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 oA=new Tt;class mb{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new im(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 Tt,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let t=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;We.PREFER_ENV===Da.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 a=0;a>i,o=t.height>>i,h=a/t.width;this.setViewport(t.x*h,t.y*h,a,o)}else{const a=e.width>>i,o=e.height>>i;this.setViewport(0,0,a,o)}}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:a}=this;a.clearColor(e,t,i,n),a.clear(r)}initFramebuffer(e){const{gl:t}=this,i=new aA(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 a;this.renderer.context.webGLVersion===1?a=t.DEPTH_STENCIL:e.depth&&e.stencil?a=t.DEPTH24_STENCIL8:e.depth?a=t.DEPTH_COMPONENT24:a=t.STENCIL_INDEX8,i.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,a,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,a,e.width,e.height)}const n=e.colorTextures;let r=n.length;t.drawBuffers||(r=Math.min(r,1));for(let a=0;a1&&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 o=[];for(let h=0;h1&&i.drawBuffers(o),e.depthTexture&&this.writeDepthTexture){const h=e.depthTexture;this.renderer.texture.bind(h,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,t)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){n.stencil=n.stencil||i.createRenderbuffer();let h,l;this.renderer.context.webGLVersion===1?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH_STENCIL):e.depth&&e.stencil?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH24_STENCIL8):e.depth?(h=i.DEPTH_ATTACHMENT,l=i.DEPTH_COMPONENT24):(h=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,h,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,a,o,h)=>i.drawElementsInstancedANGLE(n,r,a,o,h),e.drawArraysInstanced=(n,r,a,o)=>i.drawArraysInstancedANGLE(n,r,a,o)):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 a=n[t.program.id]||this.initGeometryVao(e,t,r);this._activeGeometry=e,this._activeVao!==a&&(this._activeVao=a,this.hasVao?i.bindVertexArray(a):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}}gb.extension={type:Ge.RendererSystem,name:"mask"};et.add(gb);class vb{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 nv=new oi,rv=[],yb=class $c extends vb{constructor(e){super(e),this.glConst=We.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,a=i.getBounds(!0,rv.pop()??new Tt);this.roundFrameToPixels(a,r.current?r.current.resolution:n.resolution,r.sourceFrame,r.destinationFrame,n.projection.transform),t&&a.fit(t),e._scissorRectLocal=a}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()||$c.isMatrixRotated(t.worldTransform)||$c.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){$c.isMatrixRotated(r)||(r=r?nv.copyFrom(r):nv.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&&rv.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)}};yb.extension={type:Ge.RendererSystem,name:"scissor"};let dA=yb;et.add(dA);class xb extends vb{constructor(e){super(e),this.glConst=We.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)}}xb.extension={type:Ge.RendererSystem,name:"stencil"};et.add(xb);class bb{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return Ot("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return Ot("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return Ot("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}}bb.extension={type:[Ge.RendererSystem,Ge.CanvasRendererSystem],name:"_plugin"};et.add(bb);class wb{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new oi,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,a=n?-1:1;r.identity(),r.a=1/t.width*2,r.d=a*(1/t.height*2),r.tx=-1-t.x*r.a,r.ty=-a-t.y*r.d}setTransform(e){}destroy(){this.renderer=null}}wb.extension={type:Ge.RendererSystem,name:"projection"};et.add(wb);const fA=new pp,av=new Tt;class Sb{constructor(e){this.renderer=e,this._tempMatrix=new oi}generateTexture(e,t){const{region:i,...n}=t||{},r=(i==null?void 0:i.copyTo(av))||e.getLocalBounds(av,!0),a=n.resolution||this.renderer.resolution;r.width=Math.max(r.width,1/a),r.height=Math.max(r.height,1/a),n.width=r.width,n.height=r.height,n.resolution=a,n.multisample??(n.multisample=this.renderer.multisample);const o=Na.create(n);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const h=e.transform;return e.transform=fA,this.renderer.render(e,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=h,o}destroy(){}}Sb.extension={type:[Ge.RendererSystem,Ge.CanvasRendererSystem],name:"textureGenerator"};et.add(Sb);const ra=new Tt,qo=new Tt;class _b{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Tt,this.destinationFrame=new Tt,this.viewportFrame=new Tt}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,a,o;e?(r=e.baseTexture,o=r.resolution,t||(ra.width=e.frame.width,ra.height=e.frame.height,t=ra),i||(qo.x=e.frame.x,qo.y=e.frame.y,qo.width=t.width,qo.height=t.height,i=qo),a=r.framebuffer):(o=n.resolution,t||(ra.width=n._view.screen.width,ra.height=n._view.screen.height,t=ra),i||(i=ra,i.width=t.width,i.height=t.height));const h=this.viewportFrame;h.x=i.x*o,h.y=i.y*o,h.width=i.width*o,h.height=i.height*o,e||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(a,h),this.renderer.projection.update(i,t,o,!a),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=Wt.shared.setValue(e||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);const r=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=r.width!==a.width||r.height!==a.height;if(o){let{x:h,y:l,width:c,height:u}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,u)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,t),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}_b.extension={type:Ge.RendererSystem,name:"renderTexture"};et.add(_b);class mA{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 pA(s,e){const t={},i=e.getProgramParameter(s,e.ACTIVE_ATTRIBUTES);for(let n=0;nl>c?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)*a.data.size),a.dataLen=t,i%t!==0&&i<16){const o=i%t%16;i+=o,n+=o}i+t>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=t,i=t):(a.offset=n,i+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function wA(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 SA(s,e){if(!s.autoManage)return{size:0,syncFunc:yA};const t=wA(s.uniforms,e),{uboElements:i,size:n}=bA(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 a=0;a1){const u=rb(o.data.type),d=Math.max(Mb[o.data.type]/16,1),f=u/d,p=(4-f%4)%4;r.push(` + cv = ud.${l}.value; + v = uv.${l}; + offset = ${o.offset/4}; + + t = 0; + + for(var i=0; i < ${o.data.size*d}; i++) + { + for(var j = 0; j < ${f}; j++) + { + data[offset++] = v[t++]; + } + offset += ${p}; + } + + `)}else{const u=xA[o.data.type];r.push(` + cv = ud.${l}.value; + v = uv.${l}; + offset = ${o.offset/4}; + ${u}; + `)}}return r.push(` + renderer.buffer.update(buffer); + `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",r.join(` +`))}}let _A=0;const gc={textureCount:0,uboCount:0};class Tb{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=_A++}systemCheck(){if(!q2())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||(gc.textureCount=0,gc.uboCount=0,this.syncUniformGroup(e.uniformGroup,gc)),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]=G2(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,gc,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 a=this.getSignature(e,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=SA(e,this.shader.program.uniformData)),e.autoManage){const h=new Float32Array(o.size/4);e.buffer.update(h)}return t.uniformGroups[e.id]=o.syncFunc,t.uniformGroups[e.id]}getSignature(e,t,i){const n=e.uniforms,r=[`${i}-`];for(const a in n)r.push(a),t[a]&&r.push(t[a].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=vA(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}}Tb.extension={type:Ge.RendererSystem,name:"shader"};et.add(Tb);class bh{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(){}}bh.defaultOptions={hello:!1},bh.extension={type:[Ge.RendererSystem,Ge.CanvasRendererSystem],name:"startup"};et.add(bh);function MA(s,e=[]){return e[dt.NORMAL]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.ADD]=[s.ONE,s.ONE],e[dt.MULTIPLY]=[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.SCREEN]=[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.OVERLAY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.DARKEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.LIGHTEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.COLOR_DODGE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.COLOR_BURN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.HARD_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.SOFT_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.DIFFERENCE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.EXCLUSION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.HUE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.SATURATION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.COLOR]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.LUMINOSITY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.NONE]=[0,0],e[dt.NORMAL_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.ADD_NPM]=[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],e[dt.SCREEN_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[dt.SRC_IN]=[s.DST_ALPHA,s.ZERO],e[dt.SRC_OUT]=[s.ONE_MINUS_DST_ALPHA,s.ZERO],e[dt.SRC_ATOP]=[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[dt.DST_OVER]=[s.ONE_MINUS_DST_ALPHA,s.ONE],e[dt.DST_IN]=[s.ZERO,s.SRC_ALPHA],e[dt.DST_OUT]=[s.ZERO,s.ONE_MINUS_SRC_ALPHA],e[dt.DST_ATOP]=[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],e[dt.XOR]=[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[dt.SUBTRACT]=[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD],e}const TA=0,AA=1,EA=2,CA=3,IA=4,RA=5,Ab=class sm{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=dt.NONE,this._blendEq=!1,this.map=[],this.map[TA]=this.setBlend,this.map[AA]=this.setOffset,this.map[EA]=this.setCullFace,this.map[CA]=this.setDepthTest,this.map[IA]=this.setFrontFace,this.map[RA]=this.setDepthMask,this.checks=[],this.defaultState=new Nn,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=MA(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 Qs(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(a=>this._systemsHash[a]===n);n[e.name](t[r])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const rl=class Gc{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Gc.defaultMaxIdle,this.checkCountMax=Gc.defaultCheckCountMax,this.mode=Gc.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==up.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}};rl.defaultMode=up.AUTO,rl.defaultMaxIdle=3600,rl.defaultCheckCountMax=600,rl.extension={type:Ge.RendererSystem,name:"textureGC"};let fa=rl;et.add(fa);class sf{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=Qe.UNSIGNED_BYTE,this.internalFormat=Ne.RGBA,this.samplerType=0}}function FA(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[s.RGB]:ze.FLOAT,[s.RGBA]:ze.FLOAT,[s.ALPHA]:ze.FLOAT,[s.LUMINANCE]:ze.FLOAT,[s.LUMINANCE_ALPHA]:ze.FLOAT,[s.R8]:ze.FLOAT,[s.R8_SNORM]:ze.FLOAT,[s.RG8]:ze.FLOAT,[s.RG8_SNORM]:ze.FLOAT,[s.RGB8]:ze.FLOAT,[s.RGB8_SNORM]:ze.FLOAT,[s.RGB565]:ze.FLOAT,[s.RGBA4]:ze.FLOAT,[s.RGB5_A1]:ze.FLOAT,[s.RGBA8]:ze.FLOAT,[s.RGBA8_SNORM]:ze.FLOAT,[s.RGB10_A2]:ze.FLOAT,[s.RGB10_A2UI]:ze.FLOAT,[s.SRGB8]:ze.FLOAT,[s.SRGB8_ALPHA8]:ze.FLOAT,[s.R16F]:ze.FLOAT,[s.RG16F]:ze.FLOAT,[s.RGB16F]:ze.FLOAT,[s.RGBA16F]:ze.FLOAT,[s.R32F]:ze.FLOAT,[s.RG32F]:ze.FLOAT,[s.RGB32F]:ze.FLOAT,[s.RGBA32F]:ze.FLOAT,[s.R11F_G11F_B10F]:ze.FLOAT,[s.RGB9_E5]:ze.FLOAT,[s.R8I]:ze.INT,[s.R8UI]:ze.UINT,[s.R16I]:ze.INT,[s.R16UI]:ze.UINT,[s.R32I]:ze.INT,[s.R32UI]:ze.UINT,[s.RG8I]:ze.INT,[s.RG8UI]:ze.UINT,[s.RG16I]:ze.INT,[s.RG16UI]:ze.UINT,[s.RG32I]:ze.INT,[s.RG32UI]:ze.UINT,[s.RGB8I]:ze.INT,[s.RGB8UI]:ze.UINT,[s.RGB16I]:ze.INT,[s.RGB16UI]:ze.UINT,[s.RGB32I]:ze.INT,[s.RGB32UI]:ze.UINT,[s.RGBA8I]:ze.INT,[s.RGBA8UI]:ze.UINT,[s.RGBA16I]:ze.INT,[s.RGBA16UI]:ze.UINT,[s.RGBA32I]:ze.INT,[s.RGBA32UI]:ze.UINT,[s.DEPTH_COMPONENT16]:ze.FLOAT,[s.DEPTH_COMPONENT24]:ze.FLOAT,[s.DEPTH_COMPONENT32F]:ze.FLOAT,[s.DEPTH_STENCIL]:ze.FLOAT,[s.DEPTH24_STENCIL8]:ze.FLOAT,[s.DEPTH32F_STENCIL8]:ze.FLOAT}:e={[s.RGB]:ze.FLOAT,[s.RGBA]:ze.FLOAT,[s.ALPHA]:ze.FLOAT,[s.LUMINANCE]:ze.FLOAT,[s.LUMINANCE_ALPHA]:ze.FLOAT,[s.DEPTH_STENCIL]:ze.FLOAT},e}function OA(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[Qe.UNSIGNED_BYTE]:{[Ne.RGBA]:s.RGBA8,[Ne.RGB]:s.RGB8,[Ne.RG]:s.RG8,[Ne.RED]:s.R8,[Ne.RGBA_INTEGER]:s.RGBA8UI,[Ne.RGB_INTEGER]:s.RGB8UI,[Ne.RG_INTEGER]:s.RG8UI,[Ne.RED_INTEGER]:s.R8UI,[Ne.ALPHA]:s.ALPHA,[Ne.LUMINANCE]:s.LUMINANCE,[Ne.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Qe.BYTE]:{[Ne.RGBA]:s.RGBA8_SNORM,[Ne.RGB]:s.RGB8_SNORM,[Ne.RG]:s.RG8_SNORM,[Ne.RED]:s.R8_SNORM,[Ne.RGBA_INTEGER]:s.RGBA8I,[Ne.RGB_INTEGER]:s.RGB8I,[Ne.RG_INTEGER]:s.RG8I,[Ne.RED_INTEGER]:s.R8I},[Qe.UNSIGNED_SHORT]:{[Ne.RGBA_INTEGER]:s.RGBA16UI,[Ne.RGB_INTEGER]:s.RGB16UI,[Ne.RG_INTEGER]:s.RG16UI,[Ne.RED_INTEGER]:s.R16UI,[Ne.DEPTH_COMPONENT]:s.DEPTH_COMPONENT16},[Qe.SHORT]:{[Ne.RGBA_INTEGER]:s.RGBA16I,[Ne.RGB_INTEGER]:s.RGB16I,[Ne.RG_INTEGER]:s.RG16I,[Ne.RED_INTEGER]:s.R16I},[Qe.UNSIGNED_INT]:{[Ne.RGBA_INTEGER]:s.RGBA32UI,[Ne.RGB_INTEGER]:s.RGB32UI,[Ne.RG_INTEGER]:s.RG32UI,[Ne.RED_INTEGER]:s.R32UI,[Ne.DEPTH_COMPONENT]:s.DEPTH_COMPONENT24},[Qe.INT]:{[Ne.RGBA_INTEGER]:s.RGBA32I,[Ne.RGB_INTEGER]:s.RGB32I,[Ne.RG_INTEGER]:s.RG32I,[Ne.RED_INTEGER]:s.R32I},[Qe.FLOAT]:{[Ne.RGBA]:s.RGBA32F,[Ne.RGB]:s.RGB32F,[Ne.RG]:s.RG32F,[Ne.RED]:s.R32F,[Ne.DEPTH_COMPONENT]:s.DEPTH_COMPONENT32F},[Qe.HALF_FLOAT]:{[Ne.RGBA]:s.RGBA16F,[Ne.RGB]:s.RGB16F,[Ne.RG]:s.RG16F,[Ne.RED]:s.R16F},[Qe.UNSIGNED_SHORT_5_6_5]:{[Ne.RGB]:s.RGB565},[Qe.UNSIGNED_SHORT_4_4_4_4]:{[Ne.RGBA]:s.RGBA4},[Qe.UNSIGNED_SHORT_5_5_5_1]:{[Ne.RGBA]:s.RGB5_A1},[Qe.UNSIGNED_INT_2_10_10_10_REV]:{[Ne.RGBA]:s.RGB10_A2,[Ne.RGBA_INTEGER]:s.RGB10_A2UI},[Qe.UNSIGNED_INT_10F_11F_11F_REV]:{[Ne.RGB]:s.R11F_G11F_B10F},[Qe.UNSIGNED_INT_5_9_9_9_REV]:{[Ne.RGB]:s.RGB9_E5},[Qe.UNSIGNED_INT_24_8]:{[Ne.DEPTH_STENCIL]:s.DEPTH24_STENCIL8},[Qe.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[Ne.DEPTH_STENCIL]:s.DEPTH32F_STENCIL8}}:e={[Qe.UNSIGNED_BYTE]:{[Ne.RGBA]:s.RGBA,[Ne.RGB]:s.RGB,[Ne.ALPHA]:s.ALPHA,[Ne.LUMINANCE]:s.LUMINANCE,[Ne.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Qe.UNSIGNED_SHORT_5_6_5]:{[Ne.RGB]:s.RGB},[Qe.UNSIGNED_SHORT_4_4_4_4]:{[Ne.RGBA]:s.RGBA},[Qe.UNSIGNED_SHORT_5_5_5_1]:{[Ne.RGBA]:s.RGBA}},e}class Eb{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new vt,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=OA(e),this.samplerTypes=FA(e);const t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(let n=0;n=0;--r){const a=t[r];a&&a._glTextures[n].samplerType!==ze.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(e){const t=new sf(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]??ze.FLOAT,this.webGLVersion===2&&e.type===Qe.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!==ze.FLOAT&&(this.hasIntegerTextures=!0);else{const r=e.realWidth,a=e.realHeight,o=i.gl;(t.width!==r||t.height!==a||t.dirtyId<0)&&(t.width=r,t.height=a,o.texImage2D(e.target,0,t.internalFormat,r,a,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}destroyTexture(e,t){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){const n=this.managedTextures.indexOf(e);n!==-1&&xo(this.managedTextures,n,1)}}updateTextureStyle(e){var i;const t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===Us.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Js.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!==Us.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===qs.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===qs.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===qs.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===qs.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}Eb.extension={type:Ge.RendererSystem,name:"texture"};et.add(Eb);class Cb{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 a=0;a(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))(ka||{});class nf{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 Ib=class Ss{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 nf(null,null,1/0),this.deltaMS=1/Ss.targetFPMS,this.elapsedMS=1/Ss.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=ka.NORMAL){return this._addListener(new nf(e,t,i))}addOnce(e,t,i=ka.NORMAL){return this._addListener(new nf(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?us.shared:new us,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Rb.extension=Ge.Application;et.add(Rb);const Pb=[];et.handleByList(Ge.Renderer,Pb);function BA(s){for(const e of Pb)if(e.test(s))return new e(s);throw new Error("Unable to auto-detect a suitable renderer.")}var LA=`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; +}`,DA=`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 NA=LA,kb=DA;class Fb{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(){}}Fb.extension={type:Ge.RendererSystem,name:"_multisample"};et.add(Fb);class UA{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Ob{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 a=e._glBuffers[r]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,a.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 XA extends Lb{constructor(e,t){const{width:i,height:n}=t||{};let r,a;Array.isArray(e)?(r=e,a=e.length):a=e,super(a,{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:a}=this,{gl:o}=e;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,t.format,i.type,null);for(let h=0;h0)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 We.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===Ni.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 co._EMPTY=co._EMPTY??We.ADAPTER.createCanvas(0,0),co._EMPTY}}const rm=class jc extends pr{constructor(e,t){t=t||{},super(We.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)},jc.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;pr.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 a=this.source;a.width=n,a.height=r,a._pixiId=`canvas_${Pa()}`,a.getContext("2d").drawImage(e,0,0,t,i,0,0,n,r),this._resolve(),this._resolve=null}}static getSize(e){const t=jc.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"&&jc.SVG_XML.test(e)}};rm.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let am=rm;class $A extends pr{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const om=class lm extends pr{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];pr.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&&(us.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||(us.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(us.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||lm.TYPES.includes(t)}};om.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],om.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Nb=om;zf.push(co,hb,VA,Nb,$A,am,xu,YA,XA);class Ll{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?Tt.EMPTY:(e=e||new Tt(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:a,tx:o,ty:h}=e,l=i*t.x+r*t.y+o,c=n*t.x+a*t.y+h;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(e){let t=this.minX,i=this.minY,n=this.maxX,r=this.maxY,a=e[0],o=e[1];t=an?a:n,r=o>r?o:r,a=e[2],o=e[3],t=an?a:n,r=o>r?o:r,a=e[4],o=e[5],t=an?a:n,r=o>r?o:r,a=e[6],o=e[7],t=an?a:n,r=o>r?o: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 a=e.a,o=e.b,h=e.c,l=e.d,c=e.tx,u=e.ty;let d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,g=a*t+h*i+c,v=o*t+l*i+u;d=gp?g:p,m=v>m?v:m,g=a*n+h*i+c,v=o*n+l*i+u,d=gp?g:p,m=v>m?v:m,g=a*t+h*r+c,v=o*t+l*r+u,d=gp?g:p,m=v>m?v:m,g=a*n+h*r+c,v=o*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,a=this.maxX,o=this.maxY;for(let h=t;ha?l:a,o=c>o?c:o}this.minX=n,this.minY=r,this.maxX=a,this.maxY=o}addVertices(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)}addVerticesMatrix(e,t,i,n,r=0,a=r){const o=e.a,h=e.b,l=e.c,c=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=a>c?a:c}}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=a>c?a:c}}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,a){e-=r,t-=a,i+=r,n+=a,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n}}class vi extends jl{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new pp,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 Ll,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const t=Object.keys(e);for(let i=0;i1)for(let t=0;tthis.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const i=this.getChildIndex(e),n=this.getChildIndex(t);this.children[i]=t,this.children[n]=e,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(e);xo(this.children,i,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t0&&r<=n){a=this.children.splice(i,r);for(let o=0;o1&&this.children.sort(jA),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!==cm.prototype._render&&(i=this.getBounds(!0));const r=e.projection.transform;if(r&&(n?(n=HA.copyFrom(n),n.prepend(r)):n=r),i&&t.intersects(i,n))this._render(e);else if(this.cullArea)return;for(let a=0,o=this.children.length;a=n&&Ko.x=r&&Ko.y=t&&(a=s-o-1),h=h.replace("%value%",e[a].toString()),n+=h,n+=` +`}return i=i.replace("%blur%",n),i=i.replace("%size%",s.toString()),i}const eE=` + 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 tE(s,e){const t=Math.ceil(s/2);let i=eE,n="",r;e?r="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":r="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let a=0;a 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 um extends hs{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(kb,sE,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]=Wt.shared.setValue(e).toArray(),a=[i,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0];this._loadMatrix(a,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,a=1/3,o=r(a),h=i+(1-i)*a,l=a*(1-i)-o*n,c=a*(1-i)+o*n,u=a*(1-i)+o*n,d=i+a*(1-i),f=a*(1-i)-o*n,p=a*(1-i)-o*n,m=a*(1-i)+o*n,g=i+a*(1-i),v=[h,l,c,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 a=Wt.shared,[o,h,l]=a.setValue(i).toArray(),[c,u,d]=a.setValue(n).toArray(),f=[.3,.59,.11,0,0,o,h,l,e,0,c,u,d,t,0,o-c,h-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}}um.prototype.grayscale=um.prototype.greyscale;var nE=`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)); +} +`,rE=`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 aE extends hs{constructor(e,t){const i=new oi;e.renderable=!1,super(rE,nE,{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 Xt(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,a=Math.sqrt(r.a*r.a+r.b*r.b),o=Math.sqrt(r.c*r.c+r.d*r.d);a!==0&&o!==0&&(this.uniforms.rotation[0]=r.a/a,this.uniforms.rotation[1]=r.b/a,this.uniforms.rotation[2]=r.c/o,this.uniforms.rotation[3]=r.d/o),e.applyFilter(this,t,i,n)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var oE=`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; +} +`,lE=` +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 cE extends hs{constructor(){super(lE,oE)}}var hE=`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 uE extends hs{constructor(e=.5,t=Math.random()){super(kb,hE,{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 ov={AlphaFilter:KA,BlurFilter:iE,BlurFilterPass:hm,ColorMatrixFilter:um,DisplacementFilter:aE,FXAAFilter:cE,NoiseFilter:uE};Object.entries(ov).forEach(([s,e])=>{Object.defineProperty(ov,s,{get(){return Ot("7.1.0",`filters.${s} has moved to ${s}`),e}})});class dE{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||(us.system.add(this.tickerUpdate,this,ka.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(us.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(a=>{e.currentTarget=i[r],this.notifyTarget(e,a)})}propagationPath(e){const t=[e];for(let i=0;i=0;u--){const d=c[u],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,r,a||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),o=!0}}}const h=this._isInteractive(t),l=e.isInteractive();return h&&l&&this._allInteractiveElements.push(e),a||this._hitElements.length>0?null:o?this._hitElements:h&&!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")&&(Br.pauseUpdate=!1),e.interactiveChildren&&e.children){const h=e.children;for(let l=h.length-1;l>=0;l--){const c=h[l],u=this.hitTestRecursive(c,this._isInteractive(t)?t:c.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 a=this._isInteractive(t),o=e.isInteractive();return a&&n(e,i)?o?[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,rf),!e.hitArea.contains(rf.x,rf.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,a;t=t??e.type;const i=`on${t}`;(a=(r=e.currentTarget)[i])==null||a.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 Hs)){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 h,l;if(!(e instanceof Hs)){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(((h=n.overTargets)==null?void 0:h.length)>0&&r!==t.target){const c=e.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(e,c,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 c=e.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(t,c);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 a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push("pointermove"):this.dispatchEvent(t,"pointermove"),o&&a.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?a.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),o&&a.push("globaltouchmove")),i&&(this.moveOnAll?a.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),o&&a.push("globalmousemove"),this.cursor=(l=t.target)==null?void 0:l.cursor),a.length>0&&this.all(t,a),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var a;if(!(e instanceof Hs)){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=(a=i.target)==null?void 0:a.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 Hs)){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 a=this.createPointerEvent(e,"pointerleave",n);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),i&&this.notifyTarget(a,"mouseleave"),a.target=a.target.parent;t.overTargets=null,this.freeEvent(r),this.freeEvent(a)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Hs)){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 o=i.button===2;this.dispatchEvent(i,o?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.pressTargetsByButton[e.button]);let a=r;if(r&&!i.composedPath().includes(r)){let o=r;for(;o&&!i.composedPath().includes(o);){if(i.currentTarget=o,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const h=i.button===2;this.notifyTarget(i,h?"rightupoutside":"mouseupoutside")}o=o.parent}delete n.pressTargetsByButton[e.button],a=o}if(a){const o=this.clonePointerEvent(i,"click");o.target=a,o.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:o.target,timeStamp:t});const h=n.clicksByButton[e.button];if(h.target===o.target&&t-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=o.target,h.timeStamp=t,o.detail=h.clickCount,o.pointerType==="mouse"){const l=o.button===2;this.dispatchEvent(o,l?"rightclick":"click")}else o.pointerType==="touch"&&this.dispatchEvent(o,"tap");this.dispatchEvent(o,"pointertap"),this.freeEvent(o)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof Hs)){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 wo)){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,fm._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,a=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=gE),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=vE[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}};dm.extension={name:"events",type:[Ge.RendererSystem,Ge.CanvasRendererSystem]},dm.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let mm=dm;et.add(mm);function lv(s){return s==="dynamic"||s==="static"}const yE={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??lv(mm.defaultEventMode)},set interactive(s){Ot("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??mm.defaultEventMode},set eventMode(s){this._internalInteractive=lv(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,a=typeof e=="function"?void 0:e;s=i?`${s}capture`:s;const o=typeof e=="function"?e:e.handleEvent,h=this;n&&n.addEventListener("abort",()=>{h.off(s,o,a)}),r?h.once(s,o,a):h.on(s,o,a)},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}};vi.mixin(yE);const xE={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};vi.mixin(xE);const bE=9,vc=100,wE=0,SE=0,cv=2,hv=1,_E=-1e3,ME=-1e3,TE=2;class Vb{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,(tr.tablet||tr.phone)&&this.createTouchHook();const t=document.createElement("div");t.style.width=`${vc}px`,t.style.height=`${vc}px`,t.style.position="absolute",t.style.top=`${wE}px`,t.style.left=`${SE}px`,t.style.zIndex=cv.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=`${hv}px`,e.style.height=`${hv}px`,e.style.position="absolute",e.style.top=`${_E}px`,e.style.left=`${ME}px`,e.style.zIndex=TE.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=`${vc}px`,t.style.height=`${vc}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=cv.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(a=>n.dispatchEvent(r,a))}_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===bE&&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}}Vb.extension={name:"accessibility",type:[Ge.RendererPlugin,Ge.CanvasRendererPlugin]};et.add(Vb);const Yb=class pm{constructor(e){this.stage=new ji,e=Object.assign({forceCanvas:!1},e),this.renderer=BA(e),pm._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=pm._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}};Yb._plugins=[];let $b=Yb;et.handleByList(Ge.Application,$b._plugins);class Gb{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}}Gb.extension=Ge.Application;et.add(Gb);const uv={loader:Ge.LoadParser,resolver:Ge.ResolveParser,cache:Ge.CacheParser,detection:Ge.DetectionParser};et.handle(Ge.Asset,s=>{const e=s.ref;Object.entries(uv).filter(([t])=>!!e[t]).forEach(([t,i])=>et.add(Object.assign(e[t],{extension:e[t].extension??i})))},s=>{const e=s.ref;Object.keys(uv).filter(t=>!!e[t]).forEach(t=>et.remove(e[t]))});class AE{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),_h=(s,e)=>{const t=e.split("?")[1];return t&&(s+=`?${t}`),s};function Hb(s,e,t,i,n){const r=e[t];for(let a=0;a{const a=r.substring(1,r.length-1).split(",");n.push(a)}),Hb(s,n,0,t,i)}else i.push(s);return i}const Mh=s=>!Array.isArray(s);class CE{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=Ws(e);let n;for(let o=0;o{n[o]=t}));const r=Object.keys(n),a={cacheKeys:r,keys:i};if(i.forEach(o=>{this._cacheMap.set(o,a)}),r.forEach(o=>{const h=n?n[o]:t;this._cache.has(o)&&this._cache.get(o)!==h&&console.warn("[Cache] already has key:",o),this._cache.set(o,n[o])}),t instanceof pt){const o=t;i.forEach(h=>{o.baseTexture!==pt.EMPTY.baseTexture&&vt.addToCache(o.baseTexture,h),pt.addToCache(o,h)})}}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 pa=new CE;class IE{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 a,o;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 h=0;h({alias:[l],src:l})),o=a.length,h=a.map(async l=>{const c=wi.toAbsolute(l.src);if(!n[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),n[l.src]=await this.promiseCache[c].promise,t&&t(++i/o)}catch(u){throw delete this.promiseCache[c],delete n[l.src],new Error(`[Loader.load] Failed to load ${c}. +${u}`)}});return await Promise.all(h),r?n[a[0].src]:n}async unload(e){const t=Ws(e,i=>({alias:[i],src:i})).map(async i=>{var a,o;const n=wi.toAbsolute(i.src),r=this.promiseCache[n];if(r){const h=await r.promise;delete this.promiseCache[n],(o=(a=r.parser)==null?void 0:a.unload)==null||o.call(a,h,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 Es=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(Es||{});const RE=".json",PE="application/json",kE={extension:{type:Ge.LoadParser,priority:Es.Low},name:"loadJson",test(s){return No(s,PE)||xs(s,RE)},async load(s){return await(await We.ADAPTER.fetch(s)).json()}};et.add(kE);const FE=".txt",OE="text/plain",BE={name:"loadTxt",extension:{type:Ge.LoadParser,priority:Es.Low},test(s){return No(s,OE)||xs(s,FE)},async load(s){return await(await We.ADAPTER.fetch(s)).text()}};et.add(BE);const LE=["normal","bold","100","200","300","400","500","600","700","800","900"],DE=[".ttf",".otf",".woff",".woff2"],NE=["font/ttf","font/otf","font/woff","font/woff2"],UE=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function XE(s){const e=wi.extname(s),t=wi.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(UE)){i=!1;break}let n=t.join(" ");return i||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const VE=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function YE(s){return VE.test(s)?s:encodeURI(s)}const $E={extension:{type:Ge.LoadParser,priority:Es.Low},name:"loadWebFont",test(s){return No(s,NE)||xs(s,DE)},async load(s,e){var i,n,r;const t=We.ADAPTER.getFontFaceSet();if(t){const a=[],o=((i=e.data)==null?void 0:i.family)??XE(s),h=((r=(n=e.data)==null?void 0:n.weights)==null?void 0:r.filter(c=>LE.includes(c)))??["normal"],l=e.data??{};for(let c=0;cWe.ADAPTER.getFontFaceSet().delete(e))}};et.add($E);const GE=`(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 So=null,gm=class{constructor(){So||(So=URL.createObjectURL(new Blob([GE],{type:"application/javascript"}))),this.worker=new Worker(So)}};gm.revokeObjectURL=function(){So&&(URL.revokeObjectURL(So),So=null)};const HE=`(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 _o=null;class jb{constructor(){_o||(_o=URL.createObjectURL(new Blob([HE],{type:"application/javascript"}))),this.worker=new Worker(_o)}}jb.revokeObjectURL=function(){_o&&(URL.revokeObjectURL(_o),_o=null)};let dv=0,af;class jE{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 gm;t.addEventListener("message",i=>{t.terminate(),gm.revokeObjectURL(),e(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){af===void 0&&(af=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[dv]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:dv++,id:i})}}const fv=new jE;function zl(s,e,t){s.resource.internal=!0;const i=new pt(s),n=()=>{delete e.promiseCache[t],pa.has(t)&&pa.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 WE=[".jpeg",".jpg",".png",".webp",".avif"],zE=["image/jpeg","image/png","image/webp","image/avif"];async function qE(s){const e=await We.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 Mu={name:"loadTextures",extension:{type:Ge.LoadParser,priority:Es.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(s){return No(s,zE)||xs(s,WE)},async load(s,e,t){var o;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;i?this.config.preferWorkers&&await fv.isImageBitmapSupported()?n=await fv.loadImageBitmap(s):n=await qE(s):n=await new Promise((h,l)=>{const c=new Image;c.crossOrigin=this.config.crossOrigin,c.src=s,c.complete?h(c):(c.onload=()=>h(c),c.onerror=u=>l(u))});const r={...e.data};r.resolution??(r.resolution=mr(s)),i&&((o=r.resourceOptions)==null?void 0:o.ownsImageBitmap)===void 0&&(r.resourceOptions={...r.resourceOptions},r.resourceOptions.ownsImageBitmap=!0);const a=new vt(n,r);return a.resource.src=s,zl(a,t,s)},unload(s){s.destroy(!0)}};et.add(Mu);const KE=".svg",ZE="image/svg+xml",JE={extension:{type:Ge.LoadParser,priority:Es.High},name:"loadSVG",test(s){return No(s,ZE)||xs(s,KE)},async testParse(s){return am.test(s)},async parse(s,e,t){var r;const i=new am(s,(r=e==null?void 0:e.data)==null?void 0:r.resourceOptions);await i.load();const n=new vt(i,{resolution:mr(s),...e==null?void 0:e.data});return n.resource.src=e.src,zl(n,t,e.src)},async load(s,e){return(await We.ADAPTER.fetch(s)).text()},unload:Mu.unload};et.add(JE);const QE=[".mp4",".m4v",".webm",".ogv"],eC=["video/mp4","video/webm","video/ogg"],tC={name:"loadVideo",extension:{type:Ge.LoadParser,priority:Es.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(s){return No(s,eC)||xs(s,QE)},async load(s,e,t){var a;let i;const n=await(await We.ADAPTER.fetch(s)).blob(),r=URL.createObjectURL(n);try{const o={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(a=e==null?void 0:e.data)==null?void 0:a.resourceOptions,autoLoad:!0},h=new Nb(r,o);await h.load();const l=new vt(h,{alphaMode:await l2(),resolution:mr(s),...e==null?void 0:e.data});l.resource.src=s,i=zl(l,t,s),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(o){throw URL.revokeObjectURL(r),o}return i},unload(s){s.destroy(!0)}};et.add(tC);class iC{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 Ws(t||i||n||r,a=>typeof a=="string"?a:Array.isArray(a)?a.map(o=>(o==null?void 0:o.src)??(o==null?void 0:o.srcs)??o):a!=null&&a.src||a!=null&&a.srcs?a.src??a.srcs:a,!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,a=n.alias??n.name;let o;if(typeof a=="string"){const h=this._createBundleAssetId(e,a);i.push(h),o=[a,h]}else{const h=a.map(l=>this._createBundleAssetId(e,l));i.push(...h),o=[...a,...h]}this.add({...n,alias:o,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 a=t[n],o=a.src??a.srcs;this.add({...a,alias:r,src:Array.isArray(o)?o:[o]})}i.push(...r)}),this._bundles[e]=i}add(e,t,i,n,r){const a=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(Ot("7.2.0",`Assets.add now uses an object instead of individual parameters. +Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),a.push({alias:e,src:t,data:i,format:n,loadParser:r})):Array.isArray(e)?a.push(...e):a.push(e);let o;o=h=>{this.hasKey(h)&&console.warn(`[Resolver] already has key: ${h} overwriting`)},Ws(a).forEach(h=>{const{src:l,srcs:c}=h;let{data:u,format:d,loadParser:f}=h;const p=Ws(l||c).map(v=>typeof v=="string"?EE(v):Array.isArray(v)?v:[v]),m=this.getAlias(h);Array.isArray(m)?m.forEach(o):o(m);const g=[];p.forEach(v=>{v.forEach(b=>{let y={};if(typeof b!="object"){y.src=b;for(let w=0;w{this._assetMap[v]=g})})}resolveBundle(e){const t=Mh(e);e=Ws(e);const i={};return e.forEach(n=>{const r=this._bundles[n];if(r){const a=this.resolve(r),o={};for(const h in a){const l=a[h];o[this._extractAssetIdFromBundle(n,h)]=l}i[n]=o}}),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=Mh(e);e=Ws(e);const i={};return e.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let r=this._assetMap[n];const a=r[0],o=this._getPreferredOrder(r);o==null||o.priority.forEach(h=>{o.params[h].forEach(l=>{const c=r.filter(u=>u[h]?u[h]===l:!1);c.length&&(r=c)})}),this._resolverHash[n]=r[0]??a}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:a}=t;return(this._basePath||this._rootPath)&&(e.src=wi.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=a??e.format??wi.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class sC{constructor(){this._detections=[],this._initialized=!1,this.resolver=new iC,this.loader=new IE,this.cache=pa,this._backgroundLoader=new AE(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var r,a;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 o=e.manifest;typeof o=="string"&&(o=await this.load(o)),this.resolver.addManifest(o)}const t=((r=e.texturePreference)==null?void 0:r.resolution)??1,i=typeof t=="number"?[t]:t,n=await this._detectFormats({preferredFormats:(a=e.texturePreference)==null?void 0:a.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=Mh(e),n=Ws(e).map(o=>{if(typeof o!="string"){const h=this.resolver.getAlias(o);return h.some(l=>!this.resolver.hasKey(l))&&this.add(o),Array.isArray(h)?h[0]:h}return this.resolver.hasKey(o)||this.add({alias:o,src:o}),o}),r=this.resolver.resolve(n),a=await this._mapLoadToResolve(r,t);return i?a[n[0]]:a}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={},a=Object.keys(n);let o=0,h=0;const l=()=>{t==null||t(++o/h)},c=a.map(u=>{const d=n[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{r[u]=f})});return await Promise.all(c),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 pa.get(e);const t={};for(let i=0;i{const l=r[o.src],c=[o.src];o.alias&&c.push(...o.alias),a[n[h]]=l,pa.set(c,l)}),a}async unload(e){this._initialized||await this.init();const t=Ws(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=Ws(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=>{pa.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 Mu.config.preferWorkers}set preferWorkers(e){Ot("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 kn=new sC;et.handleByList(Ge.LoadParser,kn.loader.parsers).handleByList(Ge.ResolveParser,kn.resolver.parsers).handleByList(Ge.CacheParser,kn.cache.parsers).handleByList(Ge.DetectionParser,kn.detections);const nC={extension:Ge.CacheParser,test:s=>Array.isArray(s)&&s.every(e=>e instanceof pt),getCacheableAssets:(s,e)=>{const t={};return s.forEach(i=>{e.forEach((n,r)=>{t[i+(r===0?"":r+1)]=n})}),t}};et.add(nC);async function Wb(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 rC={extension:{type:Ge.DetectionParser,priority:1},test:async()=>Wb("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async s=>[...s,"avif"],remove:async s=>s.filter(e=>e!=="avif")};et.add(rC);const aC={extension:{type:Ge.DetectionParser,priority:0},test:async()=>Wb("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async s=>[...s,"webp"],remove:async s=>s.filter(e=>e!=="webp")};et.add(aC);const mv=["png","jpg","jpeg"],oC={extension:{type:Ge.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async s=>[...s,...mv],remove:async s=>s.filter(e=>!mv.includes(e))};et.add(oC);const lC="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function xp(s){return lC?!1:document.createElement("video").canPlayType(s)!==""}const cC={extension:{type:Ge.DetectionParser,priority:0},test:async()=>xp("video/webm"),add:async s=>[...s,"webm"],remove:async s=>s.filter(e=>e!=="webm")};et.add(cC);const hC={extension:{type:Ge.DetectionParser,priority:0},test:async()=>xp("video/mp4"),add:async s=>[...s,"mp4","m4v"],remove:async s=>s.filter(e=>e!=="mp4"&&e!=="m4v")};et.add(hC);const uC={extension:{type:Ge.DetectionParser,priority:0},test:async()=>xp("video/ogg"),add:async s=>[...s,"ogv"],remove:async s=>s.filter(e=>e!=="ogv")};et.add(uC);const dC={extension:Ge.ResolveParser,test:Mu.test,parse:s=>{var e;return{resolution:parseFloat(((e=We.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:wi.extname(s).slice(1),src:s}}};et.add(dC);var Vi=(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))(Vi||{});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 pn,ao;function pv(){ao={bptc:pn.getExtension("EXT_texture_compression_bptc"),astc:pn.getExtension("WEBGL_compressed_texture_astc"),etc:pn.getExtension("WEBGL_compressed_texture_etc"),s3tc:pn.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:pn.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:pn.getExtension("WEBGL_compressed_texture_pvrtc")||pn.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:pn.getExtension("WEBGL_compressed_texture_etc1"),atc:pn.getExtension("WEBGL_compressed_texture_atc")}}const fC={extension:{type:Ge.DetectionParser,priority:2},test:async()=>{const s=We.ADAPTER.createCanvas().getContext("webgl");return s?(pn=s,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async s=>{ao||pv();const e=[];for(const t in ao)ao[t]&&e.push(t);return[...e,...s]},remove:async s=>(ao||pv(),s.filter(e=>!(e in ao)))};et.add(fC);class mC extends xu{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 Wf(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 Wf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class Ea extends mC{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=Ea._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||Ea._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,a=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,a,o){const h=new Array(i);let l=e.byteOffset,c=a,u=o,d=c+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*Th[t];for(let m=0;m1?c:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(e.buffer,l,p)},l+=p,c=c>>1||1,u=u>>1||1,d=c+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*Th[t];return h}}const of=4,yc=124,pC=32,gv=20,gC=542327876,xc={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},vC={FOURCC:2},bc={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},yC=1,xC=2,bC=4,wC=64,SC=512,_C=131072,MC=827611204,TC=861165636,AC=894720068,EC=808540228,CC=4,IC={[MC]:Vi.COMPRESSED_RGBA_S3TC_DXT1_EXT,[TC]:Vi.COMPRESSED_RGBA_S3TC_DXT3_EXT,[AC]:Vi.COMPRESSED_RGBA_S3TC_DXT5_EXT},RC={70:Vi.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Vi.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Vi.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Vi.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Vi.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Vi.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Vi.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Vi.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Vi.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:Vi.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:Vi.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:Vi.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:Vi.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function PC(s){const e=new Uint32Array(s);if(e[0]!==gC)throw new Error("Invalid DDS file magic word");const t=new Uint32Array(s,0,yc/Uint32Array.BYTES_PER_ELEMENT),i=t[xc.HEIGHT],n=t[xc.WIDTH],r=t[xc.MIPMAP_COUNT],a=new Uint32Array(s,xc.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,pC/Uint32Array.BYTES_PER_ELEMENT),o=a[yC];if(o&bC){const h=a[vC.FOURCC];if(h!==EC){const b=IC[h],y=of+yc,w=new Uint8Array(s,y);return[new Ea(w,{format:b,width:n,height:i,levels:r})]}const l=of+yc,c=new Uint32Array(e.buffer,l,gv/Uint32Array.BYTES_PER_ELEMENT),u=c[bc.DXGI_FORMAT],d=c[bc.RESOURCE_DIMENSION],f=c[bc.MISC_FLAG],p=c[bc.ARRAY_SIZE],m=RC[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===CC)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=of+yc+gv;if(p===1)g.push(new Uint8Array(s,v));else{const b=Th[m];let y=0,w=n,A=i;for(let _=0;_>>1,A=A>>>1}let M=v;for(let _=0;_new Ea(b,{format:m,width:n,height:i,levels:r}))}throw o&wC?new Error("DDSParser does not support uncompressed texture data."):o&SC?new Error("DDSParser does not supported YUV uncompressed texture data."):o&_C?new Error("DDSParser does not support single-channel (lumninance) texture data!"):o&xC?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 vv=[171,75,84,88,32,49,49,187,13,10,26,10],kC=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},vm=64,yv={[Qe.UNSIGNED_BYTE]:1,[Qe.UNSIGNED_SHORT]:2,[Qe.INT]:4,[Qe.UNSIGNED_INT]:4,[Qe.FLOAT]:4,[Qe.HALF_FLOAT]:8},FC={[Ne.RGBA]:4,[Ne.RGB]:3,[Ne.RG]:2,[Ne.RED]:1,[Ne.LUMINANCE]:1,[Ne.LUMINANCE_ALPHA]:2,[Ne.ALPHA]:1},OC={[Qe.UNSIGNED_SHORT_4_4_4_4]:2,[Qe.UNSIGNED_SHORT_5_5_5_1]:2,[Qe.UNSIGNED_SHORT_5_6_5]:2};function BC(s,e,t=!1){const i=new DataView(e);if(!LC(s,i))return null;const n=i.getUint32(Ys.ENDIANNESS,!0)===kC,r=i.getUint32(Ys.GL_TYPE,n),a=i.getUint32(Ys.GL_FORMAT,n),o=i.getUint32(Ys.GL_INTERNAL_FORMAT,n),h=i.getUint32(Ys.PIXEL_WIDTH,n),l=i.getUint32(Ys.PIXEL_HEIGHT,n)||1,c=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||c!==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=h+3&-4,b=l+3&-4,y=new Array(u);let w=h*l;r===0&&(w=v*b);let A;if(r!==0?yv[r]?A=yv[r]*FC[a]:A=OC[r]:A=Th[o],A===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const M=t?NC(i,p,n):null;let _=w*A,R=h,P=l,F=v,I=b,k=vm+p;for(let B=0;B1||r!==0?R:F,levelHeight:f>1||r!==0?P:I,levelBuffer:new Uint8Array(e,U,_)},U+=_}k+=D+4,k=k%4!==0?k+4-k%4:k,R=R>>1||1,P=P>>1||1,F=R+m-1&-4,I=P+g-1&-4,_=F*I*A}return r!==0?{uncompressed:y.map(B=>{let D=B[0].levelBuffer,U=!1;return r===Qe.FLOAT?D=new Float32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4):r===Qe.UNSIGNED_INT?(U=!0,D=new Uint32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)):r===Qe.INT&&(U=!0,D=new Int32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)),{resource:new xu(D,{width:B[0].levelWidth,height:B[0].levelHeight}),type:r,format:U?DC(a):a}}),kvData:M}:{compressed:y.map(B=>new Ea(null,{format:o,width:h,height:l,levels:f,levelBuffers:B})),kvData:M}}function LC(s,e){for(let t=0;te-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h{const a=new vt(r,{mipmap:Us.OFF,alphaMode:Ni.NO_PREMULTIPLIED_ALPHA,resolution:mr(s),...e.data});return zl(a,t,s)});return n.length===1?n[0]:n},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};et.add(UC);const XC={extension:{type:Ge.LoadParser,priority:Es.High},name:"loadKTX",test(s){return xs(s,".ktx")},async load(s,e,t){const i=await(await We.ADAPTER.fetch(s)).arrayBuffer(),{compressed:n,uncompressed:r,kvData:a}=BC(s,i),o=n??r,h={mipmap:Us.OFF,alphaMode:Ni.NO_PREMULTIPLIED_ALPHA,resolution:mr(s),...e.data},l=o.map(c=>{o===r&&Object.assign(h,{type:c.type,format:c.format});const u=c.resource??c,d=new vt(u,h);return d.ktxKeyValueData=a,zl(d,t,s)});return l.length===1?l[0]:l},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};et.add(XC);const VC=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],YC={extension:Ge.ResolveParser,test:s=>{const e=wi.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(VC.includes(r))return{resolution:parseFloat(((i=We.RETINA_PREFIX.exec(s))==null?void 0:i[1])??"1"),format:r,src:s}}return{resolution:parseFloat(((n=We.RETINA_PREFIX.exec(s))==null?void 0:n[1])??"1"),format:t,src:s}}};et.add(YC);const wc=new Tt,$C=4,zb=class ol{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((a,o)=>{r.toBlob(h=>{if(!h){o(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>a(l.result),l.onerror=o,l.readAsDataURL(h)},t,i)});if(r.toDataURL!==void 0)return r.toDataURL(t,i);if(r.convertToBlob!==void 0){const a=await r.convertToBlob({type:t,quality:i});return new Promise((o,h)=>{const l=new FileReader;l.onload=()=>o(l.result),l.onerror=h,l.readAsDataURL(a)})}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:a,premultipliedAlpha:o}=this._rawPixels(e,t);a&&ol._flipY(i,n,r),o&&ol._unpremultiplyAlpha(i);const h=new M2(n,r,1),l=new ImageData(new Uint8ClampedArray(i.buffer),n,r);return h.context.putImageData(l,0,0),h.canvas}pixels(e,t){const{pixels:i,width:n,height:r,flipY:a,premultipliedAlpha:o}=this._rawPixels(e,t);return a&&ol._flipY(i,n,r),o&&ol._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,a=!1,o,h=!1;e&&(e instanceof Na?o=e:(o=i.generateTexture(e,{region:t,resolution:i.resolution,multisample:i.multisample}),h=!0,t&&(wc.width=t.width,wc.height=t.height,t=wc)));const l=i.gl;if(o){if(n=o.baseTexture.resolution,t=t??o.frame,r=!1,a=o.baseTexture.alphaMode>0&&o.baseTexture.format===Ne.RGBA,!h){i.renderTexture.bind(o);const f=o.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else n=i.resolution,t||(t=wc,t.width=i.width/n,t.height=i.height/n),r=!0,a=this._rendererPremultipliedAlpha,i.renderTexture.bind();const c=Math.max(Math.round(t.width*n),1),u=Math.max(Math.round(t.height*n),1),d=new Uint8Array($C*c*u);return l.readPixels(Math.round(t.x*n),Math.round(t.y*n),c,u,l.RGBA,l.UNSIGNED_BYTE,d),h&&(o==null||o.destroy(!0)),{pixels:d,width:c,height:u,flipY:r,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(e,t,i){const n=t<<2,r=i>>1,a=new Uint8Array(n);for(let o=0;o=0&&o>=0&&n>=0&&r>=0)){e.length=0;return}const h=Math.ceil(2.3*Math.sqrt(a+o)),l=h*8+(n?4:0)+(r?4:0);if(e.length=l,l===0)return;if(h===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 c=0,u=h*4+(n?2:0)+2,d=u,f=l;{const p=n+a,m=r,g=t+p,v=t-p,b=i+m;if(e[c++]=g,e[c++]=b,e[--u]=b,e[--u]=v,r){const y=i-m;e[d++]=v,e[d++]=y,e[--f]=y,e[--f]=g}}for(let p=1;p0||e&&i<=0){const n=t/2;for(let r=n+n%2;r=6){xv(t,!1);const a=[];for(let l=0;l=0&&r>=0&&a.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)}},jC={build(s){Ah.build(s)},triangulate(s,e){Ah.triangulate(s,e)}};var Fs=(s=>(s.MITER="miter",s.BEVEL="bevel",s.ROUND="round",s))(Fs||{}),Xr=(s=>(s.BUTT="butt",s.ROUND="round",s.SQUARE="square",s))(Xr||{});const Io={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 bv{static curveTo(e,t,i,n,r,a){const o=a[a.length-2],h=a[a.length-1]-t,l=o-e,c=n-t,u=i-e,d=Math.abs(h*u-l*c);if(d<1e-8||r===0)return(a[a.length-2]!==e||a[a.length-1]!==t)&&a.push(e,t),null;const f=h*h+l*l,p=c*c+u*u,m=h*c+l*u,g=r*Math.sqrt(f)/d,v=r*Math.sqrt(p)/d,b=g*m/f,y=v*m/p,w=g*u+v*l,A=g*c+v*h,M=l*(v+b),_=h*(v+b),R=u*(g+y),P=c*(g+y),F=Math.atan2(_-A,M-w),I=Math.atan2(P-A,R-w);return{cx:w+e,cy:A+t,radius:r,startAngle:F,endAngle:I,anticlockwise:l*c>u*h}}static arc(e,t,i,n,r,a,o,h,l){const c=o-a,u=Io._segmentsCount(Math.abs(c)*r,Math.ceil(Math.abs(c)/vh)*40),d=c/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=u-1,v=g%1/g;for(let b=0;b<=g;++b){const y=b+v*b,w=d+a+f*y,A=Math.cos(w),M=-Math.sin(w);l.push((p*A+m*M)*r+i,(p*-M+m*A)*r+n)}}}class WC{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 bp{static curveLength(e,t,i,n,r,a,o,h){let l=0,c=0,u=0,d=0,f=0,p=0,m=0,g=0,v=0,b=0,y=0,w=e,A=t;for(let M=1;M<=10;++M)c=M/10,u=c*c,d=u*c,f=1-c,p=f*f,m=p*f,g=m*e+3*p*c*i+3*f*u*r+d*o,v=m*t+3*p*c*n+3*f*u*a+d*h,b=w-g,y=A-v,w=g,A=v,l+=Math.sqrt(b*b+y*y);return l}static curveTo(e,t,i,n,r,a,o){const h=o[o.length-2],l=o[o.length-1];o.length-=2;const c=Io._segmentsCount(bp.curveLength(h,l,e,t,i,n,r,a));let u=0,d=0,f=0,p=0,m=0;o.push(h,l);for(let g=1,v=0;g<=c;++g)v=g/c,u=1-v,d=u*u,f=d*u,p=v*v,m=p*v,o.push(f*h+3*d*v*e+3*u*p*i+m*r,f*l+3*d*v*t+3*u*p*n+m*a)}}function wv(s,e,t,i,n,r,a,o){const h=s-t*n,l=e-i*n,c=s+t*r,u=e+i*r;let d,f;a?(d=i,f=-t):(d=-i,f=t);const p=h+d,m=l+f,g=c+d,v=u+f;return o.push(p,m,g,v),2}function aa(s,e,t,i,n,r,a,o){const h=t-s,l=i-e;let c=Math.atan2(h,l),u=Math.atan2(n-s,r-e);o&&cu&&(u+=Math.PI*2);let d=c;const f=u-c,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,v=f/g;if(d+=v,o){a.push(s,e,t,i);for(let b=1,y=d;b=0&&(r.join===Fs.ROUND?d+=aa(y,w,y-_*B,w-R*B,y-P*B,w-F*B,c,!1)+4:d+=2,c.push(y-P*D,w-F*D,y+P*B,w+F*B));continue}const K=(-_+v)*(-R+w)-(-_+y)*(-R+b),fe=(-P+A)*(-F+w)-(-P+y)*(-F+M),me=(O*fe-E*K)/W,we=(V*K-X*fe)/W,Ee=(me-y)*(me-y)+(we-w)*(we-w),ge=y+(me-y)*B,Te=w+(we-w)*B,G=y-(me-y)*D,Z=w-(we-w)*D,z=Math.min(O*O+X*X,E*E+V*V),j=J?B:D,te=z+j*j*m,he=Ee<=te;let ve=r.join;if(ve===Fs.MITER&&Ee/m>g&&(ve=Fs.BEVEL),he)switch(ve){case Fs.MITER:{c.push(ge,Te,G,Z);break}case Fs.BEVEL:{J?c.push(ge,Te,y+_*D,w+R*D,ge,Te,y+P*D,w+F*D):c.push(y-_*B,w-R*B,G,Z,y-P*B,w-F*B,G,Z),d+=2;break}case Fs.ROUND:{J?(c.push(ge,Te,y+_*D,w+R*D),d+=aa(y,w,y+_*D,w+R*D,y+P*D,w+F*D,c,!0)+4,c.push(ge,Te,y+P*D,w+F*D)):(c.push(y-_*B,w-R*B,G,Z),d+=aa(y,w,y-_*B,w-R*B,y-P*B,w-F*B,c,!1)+4,c.push(y-P*B,w-F*B,G,Z));break}}else{switch(c.push(y-_*B,w-R*B,y+_*D,w+R*D),ve){case Fs.MITER:{J?c.push(G,Z,G,Z):c.push(ge,Te,ge,Te),d+=2;break}case Fs.ROUND:{J?d+=aa(y,w,y+_*D,w+R*D,y+P*D,w+F*D,c,!0)+2:d+=aa(y,w,y-_*B,w-R*B,y-P*B,w-F*B,c,!1)+2;break}}c.push(y-P*B,w-F*B,y+P*D,w+F*D),d+=2}}v=i[(u-2)*2],b=i[(u-2)*2+1],y=i[(u-1)*2],w=i[(u-1)*2+1],_=-(b-w),R=v-y,I=Math.sqrt(_*_+R*R),_/=I,R/=I,_*=p,R*=p,c.push(y-_*B,w-R*B,y+_*D,w+R*D),h||(r.cap===Xr.ROUND?d+=aa(y-_*(B-D)*.5,w-R*(B-D)*.5,y-_*B,w-R*B,y+_*D,w+R*D,c,!1)+2:r.cap===Xr.SQUARE&&(d+=wv(y,w,_,R,B,D,!1,c)));const U=e.indices,L=Io.epsilon*Io.epsilon;for(let N=f;N0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,i=null,n=null){const r=new Eh(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 Eh(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 h=this.shapeIndex;h65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?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=Sc.pop(),n||(n=new Kf,n.texArray=new em),this.drawCalls.push(n)),n.start=c,n.size=0,n.texArray.count=0,n.type=l),m.touched=1,m._batchEnabled=e,m._batchLocation=r,m.wrapMode=Js.REPEAT,n.texArray.elements[n.texArray.count++]=m,r++)),n.size+=d.size,c+=d.size,o=m._batchLocation,this.addColors(t,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,o,d.attribSize,d.attribStart)}vt._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),a=new Float32Array(r),o=new Uint32Array(r);let h=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 Aa,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new Aa,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),wp.curveTo(e,t,i,n,r),this}bezierCurveTo(e,t,i,n,r,a){return this._initCurve(),bp.curveTo(e,t,i,n,r,a,this.currentPath.points),this}arcTo(e,t,i,n,r){this._initCurve(e,t);const a=this.currentPath.points,o=bv.curveTo(e,t,i,n,r,a);if(o){const{cx:h,cy:l,radius:c,startAngle:u,endAngle:d,anticlockwise:f}=o;this.arc(h,l,c,u,d,f)}return this}arc(e,t,i,n,r,a=!1){if(n===r)return this;if(!a&&r<=n?r+=vh:a&&n<=r&&(n+=vh),r-n===0)return this;const o=e+Math.cos(n)*i,h=t+Math.sin(n)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-o),d=Math.abs(c[c.length-1]-h);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 Tt(e,t,i,n))}drawRoundedRect(e,t,i,n,r){return this.drawShape(new Su(e,t,i,n,r))}drawCircle(e,t,i){return this.drawShape(new bu(e,t,i))}drawEllipse(e,t,i,n){return this.drawShape(new wu(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 Aa(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===Hi.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&&(a=i);let o=e._buffers;o||(o=e._buffers=this.generateBuffers(e));const h=t[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=Jx(e.blendMode,l),r.state.set(this.state);const c=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=Wt.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fn&&(m=n),p>=o.length&&o.push(this._generateOneMoreBuffer(e));const g=o[p];g.uploadDynamic(t,f,m);const v=e._bufferUpdateIDs[p]||0;d=d||g._updateID0);n[a]=l,n[a+r]=l,n[a+r*2]=l,n[a+r*3]=l,a+=r*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}e1.extension={name:"particle",type:Ge.RendererPlugin};et.add(e1);var Au=(s=>(s[s.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",s[s.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",s))(Au||{});const _c={willReadFrequently:!0},gn=class at{static get experimentalLetterSpacingSupported(){let e=at._experimentalLetterSpacingSupported;if(e!==void 0){const t=We.ADAPTER.getCanvasRenderingContext2D().prototype;e=at._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,i,n,r,a,o,h,l){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=r,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=l}static measureText(e,t,i,n=at._canvas){i=i??t.wordWrap;const r=t.toFontString(),a=at.measureFont(r);a.fontSize===0&&(a.fontSize=t.fontSize,a.ascent=t.fontSize);const o=n.getContext("2d",_c);o.font=r;const h=(i?at.wordWrap(e,t,n):e).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let c=0;for(let p=0;p0&&(n?r-=t:r+=(at.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=at._canvas){const n=i.getContext("2d",_c);let r=0,a="",o="";const h=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,u=at.collapseSpaces(c),d=at.collapseNewlines(c);let f=!u;const p=t.wordWrapWidth+l,m=at.tokenize(e);for(let g=0;gp)if(a!==""&&(o+=at.addLine(a),a="",r=0),at.canBreakWords(v,t.breakWords)){const y=at.wordWrapSplit(v);for(let w=0;wp&&(o+=at.addLine(a),f=!1,a="",r=0),a+=A,r+=R}}else{a.length>0&&(o+=at.addLine(a),a="",r=0);const y=g===m.length-1;o+=at.addLine(v,!y),f=!1,a="",r=0}else b+r>p&&(f=!1,o+=at.addLine(a),a="",r=0),(a.length>0||!at.isBreakingSpace(v)||f)&&(a+=v,r+=b)}return o+=at.addLine(a,!1),o}static addLine(e,t=!0){return e=at.trimRight(e),e=t?`${e} +`:e,e}static getFromCache(e,t,i,n){let r=i[e];return typeof r!="number"&&(r=at._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(!at.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:at._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:at._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let i="";if(typeof e!="string")return t;for(let n=0;no;--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]})(),gn.experimentalLetterSpacing=!1,gn._fonts={},gn._newlines=[10,13],gn._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let Rr=gn;const sI=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],t1=class ll{constructor(e){this.styleID=0,this.reset(),df(this,e,e)}clone(){const e={};return df(e,this,ll.defaultStyle),new ll(e)}reset(){df(this,ll.defaultStyle,ll.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=uf(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=uf(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){nI(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=uf(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)&&!sI.includes(n)&&(n=`"${n}"`),t[i]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};t1.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Au.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=t1;function uf(s){const e=Wt.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 nI(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,b=i.lineHeight*(f+1);let y=v;f+10}}function oI(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(dI),this.registerFindHook(fI),this.registerFindHook(oI),this.registerFindHook(lI),this.registerFindHook(cI),this.registerUploadHook(hI),this.registerUploadHook(uI)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,us.system.addOnce(this.tick,this,ka.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&&us.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}};s1.uploadsPerFrame=4;let bm=s1;Object.defineProperties(We,{UPLOADS_PER_FRAME:{get(){return bm.uploadsPerFrame},set(s){Ot("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),bm.uploadsPerFrame=s}}});function r1(s,e){return e instanceof vt?(e._glTextures[s.CONTEXT_UID]||s.texture.bind(e),!0):!1}function mI(s,e){if(!(e instanceof vs))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:i}=t;for(let n=0;n1?tn.from(vI,gI,t):tn.from(Av,yI,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,a=e.uvRespectAnchor?e.anchor.y:0;n=i.uvs,n[0]=n[6]=-r,n[1]=n[3]=-a,n[2]=n[4]=1-r,n[5]=n[7]=1-a,i.invalidate();const o=e._texture,h=o.baseTexture,l=h.alphaMode>0,c=e.tileTransform.localTransform,u=e.uvMatrix;let d=h.isPowerOfTwo&&o.frame.width===h.width&&o.frame.height===h.height;d&&(h._glTextures[t.CONTEXT_UID]?d=h.wrapMode!==Js.CLAMP:h.wrapMode===Js.CLAMP&&(h.wrapMode=Js.REPEAT));const f=d?this.simpleShader:this.shader,p=o.width,m=o.height,g=e._width,v=e._height;Mc.set(c.a*p/g,c.b*p/v,c.c*m/g,c.d*m/v,c.tx/g,c.ty/v),Mc.invert(),d?Mc.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=Mc.toArray(!0),f.uniforms.uColor=Wt.shared.setValue(e.tint).premultiply(e.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=o,t.shader.bind(f),t.geometry.bind(i),this.state.blendMode=Jx(e.blendMode,l),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}o1.extension={name:"tilingSprite",type:Ge.RendererPlugin};et.add(o1);const l1=class cl{constructor(e,t,i){this.linkedSheets=[],(e instanceof vt||e instanceof pt)&&(e={texture:e,data:t,resolutionFilename:i});const{texture:n,data:r,resolutionFilename:a=null,cachePrefix:o=""}=e;this.cachePrefix=o,this._texture=n instanceof pt?n:null,this.baseTexture=n instanceof vt?n:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;const h=this.baseTexture.resource;this.resolution=this._updateResolution(a||(h?h.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=mr(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<=cl.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=cl.BATCH_SIZE;for(;t-e{this._batchIndex*cl.BATCH_SIZE{i[n]=e}),Object.keys(e.textures).forEach(n=>{i[`${e.cachePrefix}${n}`]=e.textures[n]}),!t){const n=wi.dirname(s[0]);e.linkedSheets.forEach((r,a)=>{Object.assign(i,c1([`${n}/${e.data.meta.related_multi_packs[a]}`],r,!0))})}return i}const wI={extension:Ge.Asset,cache:{test:s=>s instanceof Ev,getCacheableAssets:(s,e)=>c1(s,e,!1)},resolver:{test:s=>{const e=s.split("?")[0].split("."),t=e.pop(),i=e.pop();return t==="json"&&bI.includes(i)},parse:s=>{var t;const e=s.split(".");return{resolution:parseFloat(((t=We.RETINA_PREFIX.exec(s))==null?void 0:t[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:Ge.LoadParser,priority:Es.Normal},async testParse(s,e){return wi.extname(e.src).toLowerCase()===".json"&&!!s.frames},async parse(s,e,t){var c,u;const{texture:i,imageFilename:n,cachePrefix:r}=(e==null?void 0:e.data)??{};let a=wi.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let o;if(i&&i.baseTexture)o=i;else{const d=_h(a+(n??s.meta.image),e.src);o=(await t.load([d]))[d]}const h=new Ev({texture:o.baseTexture,data:s,resolutionFilename:e.src,cachePrefix:r});await h.parse();const l=(c=s==null?void 0:s.meta)==null?void 0:c.related_multi_packs;if(Array.isArray(l)){const d=[];for(const p of l){if(typeof p!="string")continue;let m=a+p;(u=e.data)!=null&&u.ignoreMultiPack||(m=_h(m,e.src),d.push(t.load({src:m,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);h.linkedSheets=f,f.forEach(p=>{p.linkedSheets=[h].concat(h.linkedSheets.filter(m=>m!==p))})}return h},unload(s){s.destroy(!0)}}};et.add(wI);class Ih{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class zc{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 a=t[r].match(/^[a-z]+/gm)[0],o=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(const l in o){const c=o[l].split("="),u=c[0],d=c[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;h[u]=p}i[a].push(h)}const n=new Ih;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 wm{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 Ih,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),r=e.getElementsByTagName("page"),a=e.getElementsByTagName("char"),o=e.getElementsByTagName("kerning"),h=e.getElementsByTagName("distanceField");for(let l=0;l")?wm.test(We.ADAPTER.parseXML(e)):!1}static parse(e){return wm.parse(We.ADAPTER.parseXML(e))}}const ff=[zc,wm,Sm];function SI(s){for(let e=0;e=h-F*a){if(m===0)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${_}')`);--M,g=null,v=null,b=null,m=0,p=0,y=0;continue}if(y=Math.max(F+R.fontProperties.descent,y),I*a+p>=d){if(p===0)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${_}')`);--M,m+=y*a,m=Math.ceil(m),p=0,y=0;continue}MI(g,v,R,p,m,a,u);const k=qc(R.text);f.char.push({id:k,page:w.length-1,x:p/a,y:m/a,width:I,height:F,xoffset:0,yoffset:0,xadvance:P-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),p+=(I+2*r)*a,p=Math.ceil(p)}if(!(i!=null&&i.skipKerning))for(let M=0,_=c.length;M<_;M++){const R=c[M];for(let P=0;P<_;P++){const F=c[P],I=v.measureText(R).width,k=v.measureText(F).width,B=v.measureText(R+F).width-(I+k);B&&f.kerning.push({first:qc(R),second:qc(F),amount:B})}}const A=new vn(f,w,!0);return vn.available[e]!==void 0&&vn.uninstall(e),vn.available[e]=A,A}};Ar.ALPHA=[["a","z"],["A","Z"]," "],Ar.NUMERIC=[["0","9"]],Ar.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],Ar.ASCII=[[" ","~"]],Ar.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:Ar.ALPHANUMERIC},Ar.available={};let Er=Ar;var AI=`// Pixi texture info\r +varying vec2 vTextureCoord;\r +uniform sampler2D uSampler;\r +\r +// Tint\r +uniform vec4 uColor;\r +\r +// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r +uniform float uFWidth;\r +\r +void main(void) {\r +\r + // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r + vec4 texColor = texture2D(uSampler, vTextureCoord);\r +\r + // MSDF\r + float median = texColor.r + texColor.g + texColor.b -\r + min(texColor.r, min(texColor.g, texColor.b)) -\r + max(texColor.r, max(texColor.g, texColor.b));\r + // SDF\r + median = min(median, texColor.a);\r +\r + float screenPxDistance = uFWidth * (median - 0.5);\r + float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r + if (median < 0.01) {\r + alpha = 0.0;\r + } else if (median > 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 +`,EI=`// 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 Cv=[],Iv=[],Rv=[],CI=class u1 extends ji{constructor(e,t={}){super();const{align:i,tint:n,maxWidth:r,letterSpacing:a,fontName:o,fontSize:h}=Object.assign({},u1.styleDefaults,t);if(!Er.available[o])throw new Error(`Missing BitmapFont "${o}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new Wt(n),this._font=void 0,this._fontName=o,this._fontSize=h,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=a,this._anchor=new ir(()=>{this.dirty=!0},this,0,0),this._roundPixels=We.ROUND_PIXELS,this.dirty=!0,this._resolution=We.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var I;const e=Er.available[this._fontName],t=this.fontSize,i=t/e.size,n=new Xt,r=[],a=[],o=[],h=this._text.replace(/(?:\r\n|\r)/g,` +`)||" ",l=h1(h),c=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?Cv:Iv;let d=null,f=0,p=0,m=0,g=-1,v=0,b=0,y=0,w=0;for(let k=0;k0&&n.x>c&&(++b,xo(r,1+g-b,1+k-g),k=g,g=-1,a.push(v),o.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,w=0)}const A=l[l.length-1];A!=="\r"&&A!==` +`&&(/(?:\s)/.test(A)&&(f=v),a.push(f),p=Math.max(p,f),o.push(-1));const M=[];for(let k=0;k<=m;k++){let B=0;this._align==="right"?B=p-a[k]:this._align==="center"?B=(p-a[k])/2:this._align==="justify"&&(B=o[k]<0?0:(p-a[k])/o[k]),M.push(B)}const _=r.length,R={},P=[],F=this._activePagesMeshData;u.push(...F);for(let k=0;k<_;k++){const B=r[k].texture,D=B.baseTexture.uid;if(!R[D]){let U=u.pop();if(!U){const N=new _p;let O,X;e.distanceFieldType==="none"?(O=new Ch(pt.EMPTY),X=dt.NORMAL):(O=new Ch(pt.EMPTY,{program:Pn.from(EI,AI),uniforms:{uFWidth:0}}),X=dt.NORMAL_NPM);const E=new Dl(N,O);E.blendMode=X,U={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:E,vertices:null,uvs:null,indices:null}}U.index=0,U.indexCount=0,U.vertexCount=0,U.uvsCount=0,U.total=0;const{_textureCache:L}=this;L[D]=L[D]||new pt(B.baseTexture),U.mesh.texture=L[D],U.mesh.tint=this._tintColor.value,P.push(U),R[D]=U}R[D].total++}for(let k=0;k6*D)||B.vertices.lengtht[n.mesh.texture.baseTexture.uid]).forEach(n=>{n.mesh.texture=pt.EMPTY});for(const n in t)t[n].destroy(),delete t[n];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};CI.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const II=[".xml",".fnt"],RI={extension:{type:Ge.LoadParser,priority:Es.Normal},name:"loadBitmapFont",test(s){return II.includes(wi.extname(s).toLowerCase())},async testParse(s){return zc.test(s)||Sm.test(s)},async parse(s,e,t){const i=zc.test(s)?zc.parse(s):Sm.parse(s),{src:n}=e,{page:r}=i,a=[];for(let l=0;lo[l]);return Er.install(i,h,!0)},async load(s,e){return(await We.ADAPTER.fetch(s)).text()},unload(s){s.destroy()}};et.add(RI);const _m=class oo extends Wr{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new oo(Object.keys(oo.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 oo.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:i}=oo;if(i[e]){const n=i[e];return this._fonts.push(n),n.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return We.ADAPTER.fetch(e).then(n=>n.blob()).then(async n=>new Promise((r,a)=>{const o=URL.createObjectURL(n),h=new FileReader;h.onload=()=>r([o,h.result]),h.onerror=a,h.readAsDataURL(n)})).then(async([n,r])=>{const a=Object.assign({family:wi.basename(e,wi.extname(e)),weight:"normal",style:"normal",display:"auto",src:n,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);i[e]=a,this._fonts.push(a),this.styleID++;const o=new FontFace(a.family,`url(${a.src})`,{weight:a.weight,style:a.style,display:a.display});a.fontFace=o,await o.load(),document.fonts.add(o),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=b2(e)),typeof e=="number"?x2(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,oo.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}=We.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}};_m.availableFonts={},_m.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 mf=_m;const Tc=class lo extends Zr{constructor(e="",t={}){super(pt.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=pt.from(i,{scaleMode:We.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new Tt,n.trim=new Tt,this.texture=n;const r="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",o=document.createElementNS(r,"svg"),h=document.createElementNS(r,"foreignObject"),l=document.createElementNS(a,"div"),c=document.createElementNS(a,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",o.appendChild(h),this.maxWidth=lo.defaultMaxWidth,this.maxHeight=lo.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=o,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=lo.defaultAutoResolution,this._resolution=lo.defaultResolution??We.RESOLUTION,this.text=e,this.style=t}measureText(e){var c,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:a,height:o}=r;(a>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(a)),l=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+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:a}=this.measureText();i.width=n.width=Math.ceil(Math.max(1,r)),i.height=n.height=Math.ceil(Math.max(1,a)),this._updateID++;const o=this._updateID;await new Promise(h=>{n.onload=async()=>{if(o/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}};Tc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Tc.defaultMaxWidth=2024,Tc.defaultMaxHeight=2024,Tc.defaultAutoResolution=!0;function Rh(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 d1(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 PI(s,e,t,i,n){if(s==="random")return n();const r=Math.max(1,Math.round(t)),a=Math.max(0,Math.round(e))%r;return i?a/r:r<=1?.5:a/(r-1)}function Pv(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 kI(s,e){const{innerW:t,innerH:i,outerW:n,outerH:r}=d1(s),a=Math.max(0,(n-t)/2),o=Math.max(0,(r-i)/2),h=a*r,l=t*o,c=h*2+l*2;if(c<=0){const p=n*2+r*2;if(p<=0)return{x:0,y:0,radialAngle:0};let m=e()*p,g,v;return mtypeof 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(a)?a:e.outerRectH),s.coneDirection=Number.isFinite(o)?o:90,s.emissionAngleMode=Number.isFinite(h)&&h>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 P=Array.from(new Set((Array.isArray(s.collisionColliderIds)?s.collisionColliderIds:[]).map(I=>Math.round(Number(I))).filter(I=>Number.isFinite(I)&&I>0)));(P.length!==s.collisionColliderIds.length||P.some((I,k)=>I!==s.collisionColliderIds[k]))&&(s.collisionColliderIds=P),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=Nl().imageResources);for(const I of s.imageResources){!I.texture&&s.texture&&(I.texture=s.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=s.colorOverLife?"lifetime":"fixed"),I.colorStart||(I.colorStart=s.colorStart||"#ffffff"),I.colorEnd||(I.colorEnd=s.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(Pr,I.blend)||(I.blend=s.blend||"normal"),["off","fixed","curve"].includes(I.independentAlpha)||(I.independentAlpha=s.independentAlpha||"off"),Number.isFinite(I.alpha)||(I.alpha=Number.isFinite(s.alphaScale)?s.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(I.alphaCurveMode)||(I.alphaCurveMode=s.curveMode||"跟随导出"),(!Array.isArray(I.alphaCurve)||I.alphaCurve.length<2)&&(I.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(c){const I=100/s.imageResources.length;s.imageResources.forEach((k,B)=>{k.weight=B===s.imageResources.length-1?100-I*(s.imageResources.length-1):I,k.locked=!1})}if(s.imageWeightVersion=1,d){const I=Number.isFinite(f)&&f!==0?f:980;s.gravity=I,s.gravityMin=I,s.gravityMax=I}if(p){const I=Number.isFinite(m)&&Number.isFinite(g)&&(m!==0||g!==0);s.windMin=I?Math.hypot(m,g):100,s.windMax=s.windMin,s.windDirection=I?Math.atan2(-g,m)*180/Math.PI:0}v&&(s.forceStrength=Number.isFinite(b)&&b!==0?b:10),y&&(s.trailConfigVersion=3,s.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],s.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],s.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],s.trailGridRows=4,s.trailGridCols=4),(w||!s.trailResources.length)&&(s.trailResources=[{id:1,texture:M||null,textureName:_,previewUrl:R,weight:100,locked:!1,rotation:0,colorMode:s.trailColorMode,color:s.trailColor,colorGradient:s.trailColorGradient.map(I=>({...I})),blend:"normal",alphaMode:s.trailAlphaMode,alpha:s.trailAlpha,alphaCurve:s.trailAlphaCurve.map(I=>({...I})),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(I=>({...I})),shapeEnabled:s.trailShapeEnabled,shapeCurve:s.trailShapeCurve.map(I=>({...I}))}]);for(const I of s.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=s.trailColorMode||"particle"),I.color||(I.color=s.trailColor||"#ffffff"),(!Array.isArray(I.colorGradient)||I.colorGradient.length<2)&&(I.colorGradient=(s.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(k=>({...k}))),Object.prototype.hasOwnProperty.call(Pr,I.blend)||(I.blend="normal"),["particle","fixed","curve"].includes(I.alphaMode)||(I.alphaMode=s.trailAlphaMode||"particle"),Number.isFinite(I.alpha)||(I.alpha=Number.isFinite(s.trailAlpha)?s.trailAlpha:1),(!Array.isArray(I.alphaCurve)||I.alphaCurve.length<2)&&(I.alphaCurve=(s.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),Number.isFinite(I.boneCount)||(I.boneCount=Number.isFinite(s.trailBoneCount)?s.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(s.trailLength)?s.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(s.trailWidth)?s.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=s.trailWidthMode||"particle"),typeof I.lifeLengthEnabled!="boolean"&&(I.lifeLengthEnabled=!!s.trailLifeLengthEnabled),(!Array.isArray(I.lifeLengthCurve)||I.lifeLengthCurve.length<2)&&(I.lifeLengthCurve=(s.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),typeof I.shapeEnabled!="boolean"&&(I.shapeEnabled=!!s.trailShapeEnabled),(!Array.isArray(I.shapeCurve)||I.shapeCurve.length<2)&&(I.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 I of s.trailResources)I.alphaCurve=((F=I.alphaCurve)==null?void 0:F.length)>=2?I.alphaCurve:[{x:0,y:1},{x:1,y:1}];return s.trailResourceVersion=6,s}const Pr={normal:0,add:1,multiply:2,screen:3},BI=400;class LI extends ji{constructor(t,i=BI){super();x(this,"pool",[]);x(this,"cfg");x(this,"accumulator",0);x(this,"burstTimer",0);x(this,"_spawnSerial",0);x(this,"_elapsed",0);x(this,"_attractionEnabledAt",0);x(this,"_attractionWasEnabled",!1);x(this,"_emitterPos",null);x(this,"states",[]);x(this,"rng",Math.random);x(this,"_lastSeed",-1);x(this,"trailDebugGfx",new vs);x(this,"colliders",[]);x(this,"followSpawnX",0);x(this,"followSpawnY",0);x(this,"followSpawnAngle",0);x(this,"spawnPathSampler",null);x(this,"spawnPathClosed",!1);x(this,"followExportCurveMode","线性");x(this,"simulationTransform",null);this.cfg=zr(t),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=gf(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),a=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 o=[];for(let p=0;p0){const O=Math.max(1e-4,Math.abs(n.rootScaleX)),X=Math.max(1e-4,Math.abs(n.rootScaleY)),E=-(((h=this.simulationTransform)==null?void 0:h.rotation)??n.rootRotation)*Math.PI/180,V=Math.cos(E),q=Math.sin(E),W=((l=this.simulationTransform)==null?void 0:l.centerX)??n.centerX,J=((c=this.simulationTransform)==null?void 0:c.centerY)??n.centerY,K=W+V*O*m.x-q*X*m.y,fe=-J+q*O*m.x+V*X*m.y,me=K,we=-fe,Ee=n.forceCenterX-me,ge=n.forceCenterY-we,Te=Math.hypot(Ee,ge);if(Te>1e-4&&Te<=n.forceRadius){let G=1;n.forceFalloff==="linear"?G=1-Te/n.forceRadius:n.forceFalloff==="inverse"&&(G=Math.min(10,n.forceRadius/Math.max(Te,n.forceRadius*.1)));const Z=n.forceStrength*G*10,z=Ee/Te*Z,j=ge/Te*Z,te=z,he=-j;m.vx+=(V*te+q*he)/O*t,m.vy+=(-q*te+V*he)/X*t}}if(!m.collisionPaused&&n.damping>0){const O=Math.max(0,1-n.damping*t);m.vx*=O,m.vy*=O}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 O=m.maxLife-m.life;if(n.attractionDelayMode==="particle"?O>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const E=Za(n,m.x,m.y,this.simulationTransform),V=n.attractionCenterX,q=n.attractionCenterY,W=Math.max(0,n.attractionRadius);if(!m.attractionActive){if(Math.hypot(V-E.x,q-E.y)<=W){this.kill(p);continue}m.attractionActive=!0,m.attractionElapsed=0,m.attractionStartWorldX=E.x,m.attractionStartWorldY=E.y}m.attractionElapsed+=t;const J=Math.max(1e-4,n.attractionDuration),K=Math.min(1,m.attractionElapsed/J);let fe=Yi(m.attractionStartWorldX,V,K),me=Yi(m.attractionStartWorldY,q,K);if(n.attractionPath==="curve"){const ge=V-m.attractionStartWorldX,Te=q-m.attractionStartWorldY,G=Math.hypot(ge,Te);if(G>1e-4){const Z=G*.25*m.attractionCurveSide,z=(m.attractionStartWorldX+V)*.5-Te/G*Z,j=(m.attractionStartWorldY+q)*.5+ge/G*Z,te=1-K;fe=te*te*m.attractionStartWorldX+2*te*K*z+K*K*V,me=te*te*m.attractionStartWorldY+2*te*K*j+K*K*q}}const we=Math.hypot(V-fe,q-me);if(K>=1||we<=W){this.kill(p);continue}const Ee=kv(n,fe,me,this.simulationTransform);m.x=Ee.x,m.y=Ee.y,m.vx=0,m.vy=0}}const v=g,b=m.sprite,y=n.imageResources.find(O=>O.id===m.resourceId);if(y){const O=this.imageFrameState(y,m.maxLife-m.life);m.imageFrameIndex=O.index,b.texture=this.imageFrameTexture(y,m.imageFrameIndex),b.visible=O.visible}if(n.speedOverLifeEnabled){const O=Ac(pf(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,v,m.speedScaleTarget),1),X=m.speedScale===0?O:O/m.speedScale;m.vx*=X,m.vy*=X,m.speedScale=O}let w=m.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(w=Yi(n.rotationSpeedMin,n.rotationSpeedMax,bn(n.rotationOverLifeCurve,v))),m.rotation+=w*t;let A=m.x,M=m.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const O=m.maxLife-m.life,X=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,E=O*Math.max(0,n.noiseSpeed)*Math.PI*2;A+=(Math.sin(m.noisePhaseX+E)-Math.sin(m.noisePhaseX))*X,M+=(Math.sin(m.noisePhaseY+E*.83)-Math.sin(m.noisePhaseY))*X}b.x=A,b.y=M,b.rotation=-m.rotation*Math.PI/180;let _=1,R=1;n.scaleOverLifeEnabled&&(_=pf(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,v,m.scaleOverLifeX),R=n.scaleOverLifeAxisMode==="separate"?pf(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,v,m.scaleOverLifeY):_),b.scale.set(Ac(m.scaleStartX*_,1),Ac(m.scaleStartY*R,1));const P=n.alphaMode==="curve"?bn(n.alphaCurve,v,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;b.alpha=Ac((y==null?void 0:y.independentAlpha)==="fixed"?y.alpha:(y==null?void 0:y.independentAlpha)==="curve"?bn(y.alphaCurve,v,this.resolveCurveMode(y.alphaCurveMode)):P,1);const F=(y==null?void 0:y.colorStart)||"#ffffff",I=(y==null?void 0:y.colorMode)==="lifetime"?vf(y.colorGradient,v):(y==null?void 0:y.colorMode)==="random"?m.colorSample:Mo(F);b.tint=I,b.blendMode=Pr[(y==null?void 0:y.blend)||"normal"];const k=this.updateTrail(m,A,M,v,b),B=Za(n,A,M,this.simulationTransform),D=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,U=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),N=k?{...k,bones:k.bones.map(O=>{const X=Za(n,O.x,O.y,this.simulationTransform);return{...O,worldX:X.x,worldY:X.y,worldRotation:D-O.rotation}})}:void 0;o.push({boneName:m.boneName,spawnId:m.spawnId,x:A,y:M,rotation:m.rotation,scaleX:b.scale.x,scaleY:b.scale.y,worldX:B.x,worldY:B.y,worldRotation:D+m.rotation,worldScaleX:b.scale.x*U,worldScaleY:b.scale.y*L,alpha:b.alpha,colorHex:I,resourceId:m.resourceId,imageFrameIndex:m.imageFrameIndex,imageVisible:b.visible,trailState:N,active:!0})}return this.states=o,o}ensureTrailMesh(t){const i=this.cfg,n=i.trailResources.find(g=>g.id===t.trailResourceId)||i.trailResources[0],r=(n==null?void 0:n.texture)||pt.EMPTY,a=Number(n==null?void 0:n.rotation)||0,o=Math.max(2,Math.min(16,Math.round(i.trailGridRows))),h=Math.max(2,Math.min(32,Math.round(i.trailGridCols))),l=Math.max(2,Math.min(16,Math.round((n==null?void 0:n.boneCount)??3))),c=`${o}:${h}:${l}:${(n==null?void 0:n.id)??0}:${a}`;if(t.trailMesh&&t.trailMeshSignature===c)return t.trailMesh.texture!==r&&(t.trailMesh.texture=r),t.trailMesh;t.trailMesh&&(this.removeChild(t.trailMesh),t.trailMesh.destroy()),t.trailMeshSignature&&t.trailMeshSignature!==c&&(t.trailHistory.length=0,t.trailBones.length=0);const u=new Float32Array(o*h*2),d=new Float32Array(o*h*2),f=[],p=[];for(let g=0;g.05?t.trailHistory.unshift({x:i,y:n}):(a.x=i,a.y=n);const o=Math.max(1,r)*1.5;let h=0,l=t.trailHistory.length;for(let c=1;c=o||c>=239){l=c+1;break}t.trailHistory.length>l&&(t.trailHistory.length=l)}sampleTrailBones(t,i,n){const r=Math.max(2,Math.min(16,Math.round(n))),a=t.trailHistory,o=[];if(!a.length)return o;let h=0;for(let c=1;c=u&&v>1e-4){const b=(u-d)/v;f={x:Yi(m.x,g.x,b),y:Yi(m.y,g.y,b)};break}d+=v}o.push({boneName:`${t.boneName}_trail_${c}`,x:f.x,y:f.y,rotation:0})}for(let c=0;c1){const c=o[0].rotation,d=(o[o.length-1].rotation-c+540)%360-180;for(let f=0;fu.id===i.resourceId)||r.trailResources[0];if(!(a!=null&&a.texture)||i.bones.length<2){n.visible=!1;return}t.trailResourceId=a.id,n.texture!==a.texture&&(n.texture=a.texture);const o=Math.max(2,Math.min(16,Math.round(r.trailGridRows))),h=Math.max(2,Math.min(32,Math.round(r.trailGridCols))),l=n.vertices,c=[];for(let u=0;u.5&&i.alpha>0}updateTrail(t,i,n,r,a){const o=this.cfg;if(!o.trail||!t.trailEnabled||t.trailSampledLength<=0||t.trailSampledWidth<=0){t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1);return}this.ensureTrailMesh(t);const h=o.trailResources.find(f=>f.id===t.trailResourceId)||o.trailResources[0];this.appendTrailPoint(t,i,n,t.trailSampledLength);const l=h!=null&&h.lifeLengthEnabled?Math.max(0,bn(h.lifeLengthCurve,r)):1,c=Math.max(0,t.trailSampledLength)*l;t.trailBones=this.sampleTrailBones(t,c,(h==null?void 0:h.boneCount)??3),t.trailBones[0]&&(t.trailBones[0].x=i,t.trailBones[0].y=n);const u=(h==null?void 0:h.widthMode)==="particle"?(Math.abs(a.scale.x)+Math.abs(a.scale.y))*.5:1;t.trailCurrentWidth=Math.max(0,t.trailSampledWidth)*u,t.trailCurrentAlpha=(h==null?void 0:h.alphaMode)==="particle"?a.alpha:(h==null?void 0:h.alphaMode)==="curve"?bn(h.alphaCurve,r):(h==null?void 0:h.alpha)??1,t.trailCurrentColor=(h==null?void 0:h.colorMode)==="particle"?a.tint:(h==null?void 0:h.colorMode)==="curve"?vf(h.colorGradient,r):Mo((h==null?void 0:h.color)||"#ffffff");const d={bones:t.trailBones.map(f=>({...f})),activeBoneCount:t.trailBones.length,width:t.trailCurrentWidth,alpha:Math.min(1,Math.max(0,t.trailCurrentAlpha)),colorHex:t.trailCurrentColor,resourceId:t.trailResourceId};return this.skinTrailMesh(t,d),d}drawTrailMeshDebug(t){const i=this.trailDebugGfx;if(i.clear(),!t||!this.cfg.trail)return;const n=Math.max(2,Math.min(16,Math.round(this.cfg.trailGridRows))),r=Math.max(2,Math.min(32,Math.round(this.cfg.trailGridCols)));i.lineStyle(1,3790847,.72);for(const a of this.pool){const o=a.trailMesh;if(!(o!=null&&o.visible))continue;const h=o.vertices,l=(c,u)=>{const d=(c*n+u)*2;return{x:h[d],y:h[d+1]}};for(let c=0;c0&&this.spawnPathSampler){const o=this.estimatedEmissionCount(),h=PI(t.spawnPathDistribution,this._spawnSerial,o,this.spawnPathClosed,this.rng),l=this.spawnPathSampler(h);if(l)return{...this.applyFollowToOrigin(l.x+i,l.y+n),radialAngle:0,pathAngle:l.angle}}const r=FI(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),a=Math.sin(n);return{x:this.followSpawnX+r*t-a*i,y:this.followSpawnY+a*t+r*i}}spawnOne(){const t=this.cfg;let i=this.pool.findIndex(w=>!w.active);if(i===-1)return;const n=this.spawnOrigin(),{x:r,y:a}=n,o=Ja(t.lifeMode,t.lifeMin,t.lifeMax,t.lifeCurve,this.rng()),h=Ja(t.speedMode,t.speedMin,t.speedMax,t.speedCurve,this.rng()),l=OI(t,n,this.followSpawnAngle,this.rng),c=this.pool[i],u=this.pickImageResource(),d=this._spawnSerial++;c.spawnId=d;const f=this.pickTrailResource(oa(t.seed,d,1540483477));c.noisePhaseX=oa(t.seed,d,1757159915)*Math.PI*2,c.noisePhaseY=oa(t.seed,d,48610963)*Math.PI*2,c.gravityStrength=t.useGravity&&t.gravityMode==="random"?Yi(t.gravityMin,t.gravityMax,this.rng()):t.gravityMin,c.windStrength=t.wind&&t.windMode==="random"?Yi(t.windMin,t.windMax,this.rng()):t.windMin,c.attractionActive=!1,c.attractionElapsed=0,c.collisionPaused=!1,c.attractionCurveSide=oa(t.seed,d,2738958700)<.5?-1:1,c.trailHistory.length=0,c.trailBones.length=0,c.trailCurrentWidth=0,c.trailCurrentAlpha=0,c.trailCurrentColor=16777215,c.trailResourceId=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=oa(t.seed,d,668265261)*100,b=(w,A,M,_,R)=>{if(w!=="random")return Math.max(0,Number(A)||0);const P=Math.max(0,Math.min(Number(M)||0,Number(_)||0)),F=Math.max(0,Math.max(Number(M)||0,Number(_)||0));return Yi(P,F,oa(t.seed,d,R))};c.trailSampledLength=b(f.lengthMode,f.length,f.lengthMin,f.lengthMax,374761393),c.trailSampledWidth=b(f.widthSizeMode,f.width,f.widthMin,f.widthMax,3550635116),c.trailEnabled=t.trail&&(g||v0&&c.trailSampledWidth>0,c.trailMesh&&(c.trailMesh.visible=!1),c.active=!0,c.life=o,c.maxLife=o,c.x=r,c.y=a,c.trailEnabled&&c.trailHistory.push({x:r,y:a}),c.vx=Math.cos(l)*h,c.vy=Math.sin(l)*h,c.scaleStartX=Ja(t.scaleMode,t.scaleMin,t.scaleMax,t.scaleCurve,this.rng())*u.scale,c.scaleStartY=t.scaleAxisMode==="separate"?Ja(t.scaleMode,t.scaleYMin,t.scaleYMax,t.scaleYCurve,this.rng())*u.scale:c.scaleStartX,c.alphaStart=t.alpha,c.alphaEnd=t.alphaEnd,c.rotation=t.initialRotationMode==="direction"?-Math.atan2(c.vy,c.vx)*180/Math.PI+t.initialRotationMin:Ja(t.initialRotationMode,t.initialRotationMin,t.initialRotationMax,t.initialRotationCurve,this.rng()),c.rotationSpeed=t.rotationOverLifeEnabled?Ja(t.rotationOverLifeMode,t.rotationSpeedMin,t.rotationSpeedMax,t.rotationOverLifeCurve,this.rng()):0,c.speedScale=1,c.speedScaleTarget=t.speedOverLifeMode==="random"?Yi(t.speedOverLifeMin,t.speedOverLifeMax,this.rng()):t.speedOverLifeMin,c.scaleOverLifeX=t.scaleOverLifeMode==="random"?Yi(t.scaleOverLifeMin,t.scaleOverLifeMax,this.rng()):t.scaleOverLifeMin,c.scaleOverLifeY=t.scaleOverLifeMode==="random"?Yi(t.scaleYOverLifeMin,t.scaleYOverLifeMax,this.rng()):t.scaleYOverLifeMin,c.resourceId=u.id,c.colorSample=u.colorMode==="random"?vf(u.colorGradient,oa(t.seed,d,2654435769)):Mo(u.colorStart);const y=this.imageFrameState(u,0);c.imageFrameIndex=y.index,c.sprite.texture=this.imageFrameTexture(u,y.index),c.sprite.anchor.set(u.anchorX,u.anchorY),c.sprite.blendMode=Pr[u.blend],c.sprite.tint=c.colorSample,c.sprite.visible=!0}pickImageResource(){const t=this.cfg.imageResources.filter(r=>r.texture||r.sequenceFrames.some(a=>a.texture));if(!t.length)return{id:1,texture:this.cfg.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",blend:"normal",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]};const i=t.reduce((r,a)=>r+Math.max(0,a.weight),0);if(i<=0)return t[Math.floor(this.rng()*t.length)];let n=this.rng()*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}imageFrameState(t,i){if(t.imageMode!=="sequence"||t.sequenceFrames.length<=1)return{index:0,visible:!0};const n=Math.min(120,Math.max(1,Number(t.sequenceFps)||30)),r=Math.max(0,Math.floor(Math.max(0,i)*n)),a=t.sequenceFrames.length-1;return t.sequencePlayback==="once-hide"?{index:Math.min(a,r),visible:r<=a}:t.sequencePlayback==="once-hold"?{index:Math.min(a,r),visible:!0}:t.sequencePlayback==="loop-reverse"?{index:a-r%t.sequenceFrames.length,visible:!0}:{index:r%t.sequenceFrames.length,visible:!0}}imageFrameTexture(t,i){var n;return t.imageMode==="sequence"&&t.sequenceFrames.length?((n=t.sequenceFrames[Math.max(0,Math.min(t.sequenceFrames.length-1,i))])==null?void 0:n.texture)||t.texture||this.cfg.texture:t.texture||this.cfg.texture}pickTrailResource(t){const i=this.cfg.trailResources.filter(a=>a.texture);if(!i.length)return this.cfg.trailResources[0]||{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}]};const n=i.reduce((a,o)=>a+Math.max(0,o.weight),0);if(n<=0)return i[Math.min(i.length-1,Math.floor(t*i.length))];let r=t*n;for(const a of i)if(r-=Math.max(0,a.weight),r<=0)return a;return i[i.length-1]}kill(t){const i=this.pool[t];i.active=!1,i.sprite.visible=!1,i.trailHistory.length=0,i.trailBones.length=0,i.trailMesh&&(i.trailMesh.visible=!1)}clear(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1)}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.trailBones.length?{bones:i.trailBones.map(n=>{var a;const r=Za(this.cfg,n.x,n.y,this.simulationTransform);return{...n,worldX:r.x,worldY:r.y,worldRotation:(((a=this.simulationTransform)==null?void 0:a.rotation)??this.cfg.rootRotation)-n.rotation}}),activeBoneCount:i.trailBones.length,width:i.trailCurrentWidth,alpha:i.trailCurrentAlpha,colorHex:i.trailCurrentColor,resourceId:i.trailResourceId}:void 0});return t}captureWorldTransform(t){var r,a,o;const i=Za(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(((a=this.simulationTransform)==null?void 0:a.scaleX)??this.cfg.rootScaleX),worldScaleY:t.sprite.scale.y*Math.abs(((o=this.simulationTransform)==null?void 0:o.scaleY)??this.cfg.rootScaleY)}}apply(t){var n;const i=new Map;for(const r of t)i.set(r.boneName,r);for(const r of this.pool){const a=i.get(r.boneName);if(!a){r.active=!1,r.sprite.visible=!1,r.trailMesh&&(r.trailMesh.visible=!1);continue}r.active=a.active;const o=r.sprite;if(o.visible=a.active&&a.imageVisible!==!1,o.x=a.x,o.y=a.y,o.rotation=-a.rotation*Math.PI/180,o.scale.set(a.scaleX,a.scaleY),o.alpha=a.alpha,o.tint=a.colorHex,a.resourceId!=null){const h=this.cfg.imageResources.find(l=>l.id===a.resourceId);h&&(r.imageFrameIndex=a.imageFrameIndex??0,o.texture=this.imageFrameTexture(h,r.imageFrameIndex),o.anchor.set(h.anchorX,h.anchorY),o.blendMode=Pr[h.blend])}this.cfg.trail&&a.trailState?(r.trailResourceId=a.trailState.resourceId??((n=this.cfg.trailResources[0])==null?void 0:n.id)??1,r.trailBones=a.trailState.bones.map(h=>({...h})),r.trailCurrentWidth=a.trailState.width,r.trailCurrentAlpha=a.trailState.alpha,this.skinTrailMesh(r,a.trailState)):r.trailMesh&&(r.trailMesh.visible=!1)}}reset(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1);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=gf(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=gf(this.cfg.seed>>>0)}}function Yi(s,e,t){return s+(e-s)*t}function Ac(s,e){return Number.isFinite(s)?s:e}function Za(s,e,t,i=null){const n=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleX)??s.rootScaleX)),r=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleY)??s.rootScaleY)),a=-((i==null?void 0:i.rotation)??s.rootRotation)*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=(i==null?void 0:i.centerX)??s.centerX,c=(i==null?void 0:i.centerY)??s.centerY,u=l+o*n*e-h*r*t,d=-c+h*n*e+o*r*t;return{x:u,y:-d}}function kv(s,e,t,i=null){const n=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleX)??s.rootScaleX)),r=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleY)??s.rootScaleY)),a=-((i==null?void 0:i.rotation)??s.rootRotation)*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=e-((i==null?void 0:i.centerX)??s.centerX),c=-t+((i==null?void 0:i.centerY)??s.centerY);return{x:(o*l+h*c)/n,y:(-h*l+o*c)/r}}function DI(s,e,t,i=null){const n=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleX)??s.rootScaleX)),r=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleY)??s.rootScaleY)),a=-((i==null?void 0:i.rotation)??s.rootRotation)*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=o*n*e-h*r*t,c=h*n*e+o*r*t;return{x:l,y:-c}}function NI(s,e,t,i=null){const n=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleX)??s.rootScaleX)),r=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleY)??s.rootScaleY)),a=-((i==null?void 0:i.rotation)??s.rootRotation)*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=-t;return{x:(o*e+h*l)/n,y:(-h*e+o*l)/r}}function UI(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),a=Math.max(1e-4,Math.abs(s.scaleX??1)),o=Math.max(1e-4,Math.abs(s.scaleY??1)),h=e-s.x,l=t-s.y,c=(n*h+r*l)/a,u=(-r*h+n*l)/o,d=(M,_,R,P)=>{const F=R/a,I=P/o,k=Math.max(1e-4,Math.hypot(F,I)),B=F/k,D=I/k,U=n*B-r*D,L=r*B+n*D;return{x:s.x+n*M*a-r*_*o+U*.05,y:s.y+r*M*a+n*_*o+L*.05,nx:U,ny:L}};if(s.shape==="circle"){const M=Math.max(.001,s.radius),_=Math.hypot(c,u);if(_>=M)return null;const R=_>1e-4?c/_:1,P=_>1e-4?u/_:0;return d(R*M,P*M,R,P)}if(s.shape==="ellipse"){const M=Math.max(.001,s.radiusX),_=Math.max(.001,s.radiusY),R=Math.hypot(c/M,u/_);if(R>=1)return null;const P=R>1e-4?1/R:1,F=R>1e-4?c*P:M,I=R>1e-4?u*P:0,k=Math.max(1e-4,Math.hypot(F/(M*M),I/(_*_)));return d(F,I,F/(M*M)/k,I/(_*_)/k)}if(s.shape==="rect"){const M=Math.max(.001,s.width*.5),_=Math.max(.001,s.height*.5);if(Math.abs(c)>=M||Math.abs(u)>=_)return null;const R=M-Math.abs(c),P=_-Math.abs(u);if(R=0?1:-1;return d(I*M,u,I,0)}const F=u>=0?1:-1;return d(c,F*_,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},(M,_)=>{const R=Math.PI*.5+_/f*Math.PI*2;return{x:Math.cos(R)*p,y:Math.sin(R)*m}});let v=!1;for(let M=0,_=g.length-1;Mu!=P.y>u&&c<(P.x-R.x)*(u-R.y)/(P.y-R.y)+R.x&&(v=!v)}if(!v)return null;let b=g[0].x,y=g[0].y,w=1/0;for(let M=0;M>>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 Ja(s,e,t,i,n){return s==="fixed"?e:s==="curve"?Yi(e,t,bn(i,n)):Yi(e,t,n)}function pf(s,e,t,i,n,r){return s==="curve"?Yi(e,t,bn(i,n)):s==="random"?r:e}function Fv(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 bn(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],a=i[n+1],o=a.x-r.x||1;if(t!=="贝塞尔")return Yi(r.y,a.y,(e-r.x)/o);const h=r.x+(r.outX??o/3),l=r.y+(r.outY??(a.y-r.y)/3),c=a.x+(a.inX??-o/3),u=a.y+(a.inY??-(a.y-r.y)/3);let d=0,f=1;for(let p=0;p<14;p++){const m=(d+f)/2;Fv(r.x,h,c,a.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 Mo(s){let e=s.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function VI(s,e,t){const i=Ov(s),n=Ov(e),r=Math.round(i[0]+(n[0]-i[0])*t),a=Math.round(i[1]+(n[1]-i[1])*t),o=Math.round(i[2]+(n[2]-i[2])*t);return r<<16|a<<8|o}function vf(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 Mo(t[0].color);if(e>=t[t.length-1].position)return Mo(t[t.length-1].color);for(let i=0;ir.position)continue;const a=(e-n.position)/Math.max(1e-4,r.position-n.position);return VI(n.color,r.color,a)}return Mo(t[t.length-1].color)}function Ov(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]}const Fa=new Map,Ca=new Map;function YI(s){return[...Fa.values()].some(e=>e===s)}function f1(s){if(!(YI(s)||(Ca.get(s)||0)>0)){Ca.delete(s);for(const e of s.textures)e.destroy(!0)}}function $I(s){const e=Ca.get(s)||0;e>1?Ca.set(s,e-1):Ca.delete(s),f1(s)}function GI(s){return Fa.get(s)||null}function Eu(s,e){ql(s),Fa.set(s,e)}function HI(s){const e=Fa.get(s);return e?(Ca.set(e,(Ca.get(e)||0)+1),e):null}function jI(s,e){const t=Fa.get(s);return t?(Eu(e,t),!0):!1}function ql(s){const e=Fa.get(s);e&&(Fa.delete(s),f1(e))}function ci(s){if(Array.isArray(s))return s.map(e=>ci(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]=ci(n);return t}}return s}const m1=["3.8","4.0","4.1","4.2","4.3"];function Ph(s){const e=String(s||"").trim();return m1.find(t=>e===t||e.startsWith(`${t}.`))||null}function Mm(){return m1.join(" / ")}function WI(s){return s==="4.3"?"4.3":"4.2"}function Tp(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"linear",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function p1(s){const e=Object.assign(Tp(),s||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=Ph(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 Tm=30;function Kc(s,e=1){return Math.min(1800,Math.max(1,Math.ceil(Number(s)||e)))}function g1(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 Kc(Math.ceil(n*Math.max(1,e)),Tm)}function Vr(s,e=30){const t=Kc(s.loopDurationFrames),i=g1(s,e),n=s.generateLoopStartAnimation?s.loopStartUseCustomDuration?Kc(s.loopStartDurationFrames,Tm):i:0,r=s.generateLoopEndAnimation?s.loopEndUseCustomDuration?Kc(s.loopEndDurationFrames,Tm):i:0;return{start:n,loop:t,end:r,total:n+t+r}}function v1(s,e){const t=Vr(s,e),n=Math.max(0,Math.ceil(Math.max(0,Number(s.delay)||0)*Math.max(1,e)))+t.start;return{start:n,end:n+t.loop}}function Zc(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 zI(s,e,t){const i=Math.max(1,e-1),n=Math.max(1,t-1),r=s.end>=i?n:s.end;return Zc(s.start,r,t)}let Ec=1,Cc=1,Ic=1,Rc=1;function Pc(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 Kl=pT("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:Tp()}}),getters:{activeSystemCount:s=>s.systems.length},actions:{syncSceneSequences(){Ec=Math.max(Ec,...this.systems.map(s=>s.id+1),1),Cc=Math.max(Cc,...this.colliders.map(s=>s.id+1),1),Ic=Math.max(Ic,...this.paths.map(s=>s.id+1),1),Rc=Math.max(Rc,...this.spines.map(s=>s.id+1),1)},addSystem(s){const e=Nl();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 o of this.systems){const h=/^ParticleSystem(\d+)$/.exec(o.config.name);h&&(r=Math.max(r,parseInt(h[1],10)))}e.name=`ParticleSystem${r+1}`;let a=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+a}`,a++}const i=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:Ec++,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=Cc++,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=Ic++,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=Rc++,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=ci(i);return n.id=Ec++,n.config.name=Pc(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=ci(i);return n.id=Cc++,n.name=Pc(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=ci(i);return n.id=Ic++,n.name=Pc(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=ci(e);return t.id=Rc++,t.name=Pc(e.name,this.spines.map(i=>i.name)),t.selectedBone="",jI(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=zr(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){ql(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=Zc(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=Zc(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 a=r.config,o=Math.max(0,Number(a.lifeMin)||0),h=Math.max(0,Number(a.lifeMax)||0),l=a.lifeMode==="fixed"?o:Math.max(o,h),c=a.mode==="stream"?a.streamBehavior==="loop"?Math.max(1/s,Math.ceil(Math.max(1,Number(a.loopDurationFrames)||1))/s):Math.max(1/s,Number(a.duration)||0):0;let u=Math.max(0,Number(a.delay)||0)+c+l;a.mode==="stream"&&a.streamBehavior==="loop"&&(u=Math.max(0,Number(a.delay)||0)+Vr(a,s).total/s),u>e&&(e=u)}for(const r of this.spines){const a=r.animations.find(h=>h.name===r.selectedAnimation);if(!a)continue;const o=Math.max(0,Number(r.timeOffset)||0)+Math.max(0,a.duration||0);o>e&&(e=o)}for(const r of this.colliders){if(!r.followPath||!r.followPathId)continue;const a=Math.max(0,Number(r.followDuration)||0);a>e&&(e=a)}const t=this.timeline.totalFrames,i=Math.max(2,Math.ceil(e*s)+1);this.timeline.totalFrames=i;const n=zI({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}}}),y1="SpineParticle.SystemSettings",x1=1,yf="SpineParticle.SystemSettings.v1";function Zo(s,e,t,i){const n=Number(s);return Math.min(t,Math.max(e,Number.isFinite(n)?n:i))}function qI(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 KI(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(Zo(s.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:Zo(s.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:Zo(s.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(Zo(s.axisFontSize,8,40,e.axisFontSize)),tickWidth:Zo(s.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:i}}function ZI(s){let e;try{e=JSON.parse(s)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==y1)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==x1)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function JI(s,e){Object.assign(s.settings,KI(e,s.settings))}let kc=null;function QI(s){kc==null||kc();try{const e=localStorage.getItem(yf);e&&JI(s,ZI(e).settings)}catch{try{localStorage.removeItem(yf)}catch{}}kc=ds(()=>qI(s.settings),e=>{const t={format:y1,version:x1,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(yf,JSON.stringify(t))}catch{}},{deep:!0})}function Bv(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 Lv(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),a=Math.max(1e-4,Math.abs(s.scaleX??1)),o=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*a-r*t*o,y:s.y+r*e*a+n*t*o}}function xf(s,e){if(!s.points.length)return null;if(s.points.length===1)return{...Lv(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 b=v/20,y=Bv(m.x,m.x+m.outX,g.x+g.inX,g.x,b),w=Bv(m.y,m.y+m.outY,g.y+g.inY,g.y,b),A=Lv(s,y,w),M=i[i.length-1];M&&(n+=Math.hypot(A.x-M.x,A.y-M.y)),i.push({...A,distance:n})}}const r=Math.min(1,Math.max(0,e))*n;let a=i.findIndex(p=>p.distance>=r);a<0&&(a=i.length-1);const o=i[a],h=i[Math.max(0,a-1)],l=i[Math.min(i.length-1,a+1)],c=h.distance,u=a>0?(r-c)/Math.max(1e-4,o.distance-c):0,d=h.x+(o.x-h.x)*Math.min(1,Math.max(0,u)),f=h.y+(o.y-h.y)*Math.min(1,Math.max(0,u));return{x:d,y:f,angle:Math.atan2(l.y-h.y,l.x-h.x)*180/Math.PI}}function Ji(s){return s.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function eR(s){const e=new Map;for(const i of s)for(const n of i)e.has(n.boneName)||e.set(n.boneName,Ji([n])[0]);const t=[...e.keys()].sort((i,n)=>{const r=Number(i.replace(/^p_/,"")),a=Number(n.replace(/^p_/,""));return Number.isFinite(r)&&Number.isFinite(a)?r-a:i.localeCompare(n)});for(let i=0;i[r.boneName,r]));s[i]=t.map(r=>{const a=n.get(r);return a||{...Ji([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function tR(s){s.length<2||(s[s.length-1]=Ji(s[0]))}function iR(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(Ji(s[r]||[]))}return i}function bf(s){return`${s.boneName}:${s.spawnId??"legacy"}`}function Dv(s){return{...Ji([s])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function sR(s,e,t,i){const n=Math.min(s.length,i+1),r=s.slice(Math.max(0,s.length-n)),a=new Map;for(const l of e){if(l.imageVisible===!1||l.alpha<=0)continue;const c=bf(l),u=new Map;let d=!1;for(let f=r.length-1;f>=0;f--){const p=r[f].find(m=>bf(m)===c);if(p)d=!0,u.set(f,p);else if(d)break}a.set(c,u)}const o=Math.max(0,r.length-1),h=[];for(let l=0;l<=t;l++){const c=Math.min(o,Math.round(l/t*o));h.push(e.map(u=>{var f;if(u.imageVisible===!1||u.alpha<=0)return Ji([u])[0];const d=(f=a.get(bf(u)))==null?void 0:f.get(c);return d?Ji([d])[0]:Dv(u)}))}return h[0]=h[0].map(Dv),h[h.length-1]=Ji(e),h}function Nv(s,e){const t=s.length?1:0;for(let i=t;i{const y=b?[[]]:[];e.reset();for(let w=0;w0&&e.restartEmissionCycle();for(let A=0;A0;w++)e.update(r,"off"),b.push(e.capture());(v=b[b.length-1])!=null&&v.length&&b.push([]),Nv(u,iR(b,o.end))}const g=Ji(u[u.length-1]||[]);for(u.length>i&&(u.length=i);u.lengtho.id===r)||(this.container.removeChild(a.root),a.root.destroy({children:!0}),this.entries.delete(r));for(const r of e){const a=GI(r.id);let o=this.entries.get(r.id);if(o&&o.assetVersion!==r.assetVersion&&!a&&(this.container.removeChild(o.root),o.root.destroy({children:!0}),this.entries.delete(r.id),o=void 0),(!o||o.assetVersion!==r.assetVersion)&&a){o&&(this.container.removeChild(o.root),o.root.destroy({children:!0}));const d=new ji,f=new a.SpineClass({skeletonData:a.skeletonData,autoUpdate:!1,darkTint:!1});a.skeletonData.defaultSkin&&f.skeleton.setSkin(a.skeletonData.defaultSkin),a.runtimeVersion==="4.3"?f.skeleton.setupPoseSlots():f.skeleton.setSlotsToSetupPose(),d.addChild(f),this.container.addChild(d),o={root:d,spine:f,runtimeVersion:a.runtimeVersion,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,o)}if(!o)continue;const h=o.root,l=o.spine,c=r.visible!==!1&&r.enabled;h.visible=c,h.renderable=c,h.position.set(r.x,-r.y),h.rotation=-r.rotation*Math.PI/180,h.scale.set(r.scaleX,r.scaleY),o.animation!==r.selectedAnimation&&(o.animation=r.selectedAnimation,o.runtimeVersion==="4.3"?l.skeleton.setupPose():l.skeleton.setToSetupPose(),l.state.clearTracks(),o.animation&&l.state.setAnimation(0,o.animation,!1));const u=o.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,a=i.root,o=Math.cos(a.rotation),h=Math.sin(a.rotation),l=o*a.scale.x,c=-h*a.scale.y,u=h*a.scale.x,d=o*a.scale.y,f=l*r.a+c*r.c,p=l*r.b+c*r.d,m=u*r.a+d*r.c,g=u*r.b+d*r.d,v=a.position.x+l*r.worldX+c*r.worldY,b=a.position.y+u*r.worldX+d*r.worldY;return{x:v,y:-b,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 b1=class{constructor(){x(this,"entries",{});x(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 Zi){return t.setFromString(e)}},x(Zi,"WHITE",new Zi(1,1,1,1)),x(Zi,"RED",new Zi(1,0,0,1)),x(Zi,"GREEN",new Zi(0,1,0,1)),x(Zi,"BLUE",new Zi(0,0,1,1)),x(Zi,"MAGENTA",new Zi(1,0,1,1)),Zi);var bi;let Ye=(bi=class{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*bi.degRad)}static sinDeg(e){return Math.sin(e*bi.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*bi.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 bi.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}},x(bi,"PI",3.1415927),x(bi,"PI2",bi.PI*2),x(bi,"invPI2",1/bi.PI2),x(bi,"radiansToDegrees",180/bi.PI),x(bi,"radDeg",bi.radiansToDegrees),x(bi,"degreesToRadians",bi.PI/180),x(bi,"degRad",bi.degreesToRadians),bi);var zs;let $e=(zs=class{static arrayCopy(e,t,i,n,r){for(let a=t,o=n;a=t?e:zs.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)*o;let h=t.bone.skeleton,l=t.deform,c=this.vertices,u=this.bones;if(!u){l.length>0&&(c=l);let m=t.bone,g=m.worldX,v=m.worldY,b=m.a,y=m.b,w=m.c,A=m.d;for(let M=i,_=a;_=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 ar._nextID++}},x(ar,"_nextID",0),ar);var $i;(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"})($i||($i={}));const _1=[$i.hold,$i.once,$i.loop,$i.pingpong,$i.onceReverse,$i.loopReverse,$i.pingpongReverse];let Ap=class{constructor(e,t,i){x(this,"name");x(this,"timelines",[]);x(this,"timelineIds",new b1);x(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 c=0,u=l.length;ct)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}},Un=class extends hi{constructor(t,i,n){super(t,n);x(this,"curves");this.curves=$e.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=$e.newFloatArray(i);$e.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,a,o,h,l,c,u,d){let f=this.curves,p=this.getFrameCount()+t*18;n==0&&(f[i]=2+p);let m=(r-o*2+l)*.03,g=(a-h*2+c)*.03,v=((o-l)*3-r+u)*.006,b=((h-c)*3-a+d)*.006,y=m*2+v,w=g*2+b,A=(o-r)*.3+m+v*.16666667,M=(h-a)*.3+g+b*.16666667,_=r+A,R=a+M;for(let P=p+18;pt){let c=this.frames[i],u=this.frames[i+n];return u+(t-c)/(a[r]-c)*(a[r+1]-u)}let o=r+18;for(r+=2;r=t){let c=a[r-2],u=a[r-1];return u+(t-c)/(a[r]-c)*(a[r+1]-u)}i+=this.getFrameEntries();let h=a[o-2],l=a[o-1];return l+(t-h)/(this.frames[i]-h)*(this.frames[i+n]-l)}},rn=class extends Un{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],a=t[i+1];return a+(e-r)/(t[i+2]-r)*(t[i+2+1]-a);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=c[m];d=c[m+1],f=c[m+2],p=c[m+3];let b=(n-v)/(c[m+4]-v);d+=(c[m+4+1]-d)*b,f+=(c[m+4+2]-f)*b,p+=(c[m+4+3]-p)*b;break;case 1:d=c[m+1],f=c[m+2],p=c[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(a==1)u.r=d,u.g=f,u.b=p;else{if(o==Ce.setup){let v=l.data.color;u.r=v.r,u.g=v.g,u.b=v.b}u.r+=(d-u.r)*a,u.g+=(f-u.g)*a,u.b+=(p-u.b)*a}}},L1=class extends rn{constructor(t,i,n){super(t,i,At.alpha+"|"+n);x(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,a,o,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.color;if(n>3];switch(A){case 0:let M=c[w];f=c[w+1],p=c[w+2],m=c[w+3],g=c[w+4],v=c[w+5],b=c[w+6],y=c[w+7];let _=(n-M)/(c[w+8]-M);f+=(c[w+8+1]-f)*_,p+=(c[w+8+2]-p)*_,m+=(c[w+8+3]-m)*_,g+=(c[w+8+4]-g)*_,v+=(c[w+8+5]-v)*_,b+=(c[w+8+6]-b)*_,y+=(c[w+8+7]-y)*_;break;case 1:f=c[w+1],p=c[w+2],m=c[w+3],g=c[w+4],v=c[w+5],b=c[w+6],y=c[w+7];break;default:f=this.getBezierValue(n,w,1,A-2),p=this.getBezierValue(n,w,2,A+18-2),m=this.getBezierValue(n,w,3,A+36-2),g=this.getBezierValue(n,w,4,A+54-2),v=this.getBezierValue(n,w,5,A+72-2),b=this.getBezierValue(n,w,6,A+90-2),y=this.getBezierValue(n,w,7,A+108-2)}if(a==1)u.set(f,p,m,g),d.r=v,d.g=b,d.b=y;else{if(o==Ce.setup){u.setFromColor(l.data.color);let M=l.data.darkColor;d.r=M.r,d.g=M.g,d.b=M.b}u.add((f-u.r)*a,(p-u.g)*a,(m-u.b)*a,(g-u.a)*a),d.r+=(v-d.r)*a,d.g+=(b-d.g)*a,d.b+=(y-d.b)*a}}},N1=class extends Un{constructor(t,i,n){super(t,i,[At.rgb+"|"+n,At.rgb2+"|"+n]);x(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,i,n,r,a,o,h,l){t*=7,this.frames[t]=i,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=a,this.frames[t+4]=o,this.frames[t+5]=h,this.frames[t+6]=l}apply(t,i,n,r,a,o,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=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 a=r+18;for(r+=2;r=t){let l=n[r-2],c=n[r-1];return c+(t-l)/(n[r]-l)*(n[r+1]-c)}let o=n[a-2],h=n[a-1];return h+(1-h)*(t-o)/(this.frames[i+this.getFrameEntries()]-o)}apply(t,i,n,r,a,o,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.getAttachment();if(!c||!(c instanceof gr)||c.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(o=Ce.setup);let d=this.vertices,f=d[0].length,p=this.frames;if(n=p[p.length-1]){let w=d[p.length-1];if(a==1)if(o==Ce.add){let A=c;if(A.bones)for(let M=0;Mn)this.apply(t,i,Number.MAX_VALUE,r,a,o,h),i=-1;else if(i>=l[c-1])return;if(n0&&l[u-1]==d;)u--}for(;u=l[u];u++)r.push(this.events[u])}},x(ba,"propertyIds",[""+At.event]),ba);var wa;let vl=(wa=class extends hi{constructor(t){super(t,wa.propertyIds);x(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,a,o,h){if(h==ts.mixOut){o==Ce.setup&&$e.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(n>2];switch(m){case 0:let g=c[p];u=c[p+1],d=c[p+2],f=c[p+3];let v=(n-g)/(c[p+4]-g);u+=(c[p+4+1]-u)*v,d+=(c[p+4+2]-d)*v,f+=(c[p+4+3]-f)*v;break;case 1:u=c[p+1],d=c[p+2],f=c[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(o==Ce.setup){let g=l.data;l.mixRotate=g.mixRotate+(u-g.mixRotate)*a,l.mixX=g.mixX+(d-g.mixX)*a,l.mixY=g.mixY+(f-g.mixY)*a}else l.mixRotate+=(u-l.mixRotate)*a,l.mixX+=(d-l.mixX)*a,l.mixY+=(f-l.mixY)*a}},Ua=class extends rn{constructor(t,i,n,r){super(t,i,r+"|"+n);x(this,"constraintIndex",0);this.constraintIndex=n}apply(t,i,n,r,a,o,h){let l;if(this.constraintIndex==-1){const c=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,a,o,this.get(u),this.setup(u),c))}else l=t.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(n,a,o,this.get(l),this.setup(l)))}},H1=class extends Ua{constructor(e,t,i){super(e,t,i,At.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},j1=class extends Ua{constructor(e,t,i){super(e,t,i,At.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},W1=class extends Ua{constructor(e,t,i){super(e,t,i,At.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},z1=class extends Ua{constructor(e,t,i){super(e,t,i,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}},q1=class extends Ua{constructor(e,t,i){super(e,t,i,At.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},K1=class extends Ua{constructor(e,t,i){super(e,t,i,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 Ua{constructor(e,t,i){super(e,t,i,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 Sa;let J1=(Sa=class extends hi{constructor(t,i){super(t,Sa.propertyIds);x(this,"constraintIndex");this.constraintIndex=i}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,a,o,h){let l;if(this.constraintIndex!=-1&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const c=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],a,o,h),i=-1;else if(i>=c[c.length-1])return;if(!(n=c[hi.search1(c,i)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},x(Sa,"propertyIds",[At.physicsConstraintReset.toString()]),Sa);var as;let Q1=(as=class extends hi{constructor(t,i,n){super(t,[At.sequence+"|"+i+"|"+n.sequence.id]);x(this,"slotIndex");x(this,"attachment");this.slotIndex=i,this.attachment=n}getFrameEntries(){return as.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,i,n,r,a){let o=this.frames;t*=as.ENTRIES,o[t]=i,o[t+as.MODE]=n|r<<4,o[t+as.DELAY]=a}apply(t,i,n,r,a,o,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.attachment,u=this.attachment;if(c!=u&&(!(c instanceof gr)||c.timelineAttachment!=u))return;if(h==ts.mixOut){o==Ce.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(n>4,b=this.attachment.sequence.regions.length,y=_1[m&15];if(y!=$i.hold)switch(v+=(n-p)/g+1e-5|0,y){case $i.once:v=Math.min(b-1,v);break;case $i.loop:v%=b;break;case $i.pingpong:{let w=(b<<1)-2;v=w==0?0:v%w,v>=b&&(v=w-v);break}case $i.onceReverse:v=Math.max(b-1-v,0);break;case $i.loopReverse:v=b-1-v%b;break;case $i.pingpongReverse:{let w=(b<<1)-2;v=w==0?0:(v+b-1)%w,v>=b&&(v=w-v)}}l.sequenceIndex=v}},x(as,"ENTRIES",3),x(as,"MODE",1),x(as,"DELAY",2),as);var or;let aR=(or=class{constructor(e){x(this,"data");x(this,"tracks",new Array);x(this,"timeScale",1);x(this,"unkeyedState",0);x(this,"events",new Array);x(this,"listeners",new Array);x(this,"queue",new lR(this));x(this,"propertyIDs",new b1);x(this,"animationsChanged",!1);x(this,"trackEntryPool",new kh(()=>new oR));this.data=e}static emptyAnimation(){return or._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=a,r.delay>0)continue;a=-r.delay,r.delay=0}let o=r.next;if(o){let h=r.trackLast-o.delay;if(h>=0){for(o.delay=0,o.trackTime+=r.timeScale==0?0:(h/r.timeScale+e)*o.timeScale,r.trackTime+=a,this.setCurrent(i,o,!0);o.mixingFrom;)o.mixTime+=e,o=o.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 h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=a}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?Ce.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,b=p.animationLast,y=p.getAnimationTime(),w=y,A=t;p.reverse&&(w=p.animation.duration-w,A=null);let M=p.animation.timelines,_=M.length;if(d==0&&g==1||m==Ce.add){d==0&&(v=!0);for(let R=0;R<_;R++){var r=M[R];r instanceof ho?this.applyAttachmentTimeline(r,e,w,m,v):r.apply(e,b,w,A,g,m,ts.mixIn)}}else{let R=p.timelineMode,P=p.shortestRotation,F=!P&&p.timelinesRotation.length!=_<<1;F&&(p.timelinesRotation.length=_<<1);for(let I=0;I<_;I++){let k=M[I],B=R[I]==wf?m:Ce.setup;!P&&k instanceof Oh?this.applyRotateTimeline(k,e,w,g,B,p.timelinesRotation,I<<1,F):k instanceof ho?this.applyAttachmentTimeline(k,e,w,m,v):k.apply(e,b,w,A,g,B,ts.mixIn)}}this.queueEvents(p,y),t.length=0,p.nextAnimationLast=y,p.nextTrackLast=p.trackTime}for(var a=this.unkeyedState+Vv,o=e.slots,h=0,l=e.slots.length;h1&&(r=1),i!=Ce.first&&(i=n.mixBlend));let a=r=n.alphaAttachmentThreshold):(o&&A instanceof vl&&_==Ce.setup&&(M=ts.mixIn),A.apply(t,d,p,m,R,_,M))}}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 a=t.slots[e.slotIndex];a.bone.active&&(i=0,y=m>=0;Math.abs(g)<=90&&Ye.signum(g)!=Ye.signum(p)&&(Math.abs(m-v)>180?(f+=360*Ye.signum(m),y=b):v!=0?f-=360*Ye.signum(m):y=b),y!=b&&(f+=360*Ye.signum(m)),a[o]=f}a[o+1]=p,l.rotation=u+f*n}queueEvents(e,t){let i=e.animationStart,n=e.animationEnd,r=n-i,a=e.trackLast%r,o=this.events,h=0,l=o.length;for(;hn||this.queue.event(e,u)}let c=!1;if(e.loop)if(r==0)c=!0;else{const u=Math.floor(e.trackTime/r);c=u>0&&u>Math.floor(e.trackLast/r)}else c=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 a=this.trackEntry(e,t,i,r);return this.setCurrent(e,a,n),this.queue.drain(),a}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 a=this.trackEntry(e,t,i,r);return r?(r.next=a,a.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-a.mixDuration,0))):(this.setCurrent(e,a,!0),this.queue.drain(),n<0&&(n=0)),a.delay=n,a}setEmptyAnimation(e,t=0){let i=this.setAnimationWith(e,or.emptyAnimation(),!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){let n=this.addAnimationWith(e,or.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[h]=cR,a[h]=u;continue e}break}r[h]=Sf}}}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()}},x(or,"_emptyAnimation",new Ap("",[],0)),or),oR=class{constructor(){x(this,"animation",null);x(this,"previous",null);x(this,"next",null);x(this,"mixingFrom",null);x(this,"mixingTo",null);x(this,"listener",null);x(this,"trackIndex",0);x(this,"loop",!1);x(this,"holdPrevious",!1);x(this,"reverse",!1);x(this,"shortestRotation",!1);x(this,"eventThreshold",0);x(this,"mixAttachmentThreshold",0);x(this,"alphaAttachmentThreshold",0);x(this,"mixDrawOrderThreshold",0);x(this,"animationStart",0);x(this,"animationEnd",0);x(this,"animationLast",0);x(this,"nextAnimationLast",0);x(this,"delay",0);x(this,"trackTime",0);x(this,"trackLast",0);x(this,"nextTrackLast",0);x(this,"trackEnd",0);x(this,"timeScale",0);x(this,"alpha",0);x(this,"mixTime",0);x(this,"_mixDuration",0);x(this,"interruptAlpha",0);x(this,"totalAlpha",0);x(this,"mixBlend",Ce.replace);x(this,"timelineMode",new Array);x(this,"timelineHoldMix",new Array);x(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}},lR=class{constructor(e){x(this,"objects",[]);x(this,"drainDisabled",!1);x(this,"animState");this.animState=e}start(e){this.objects.push(ms.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(ms.interrupt),this.objects.push(e)}end(e){this.objects.push(ms.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(ms.dispose),this.objects.push(e)}complete(e){this.objects.push(ms.complete),this.objects.push(e)}event(e,t){this.objects.push(ms.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{c.width=parseInt(i[1]),c.height=parseInt(i[2])},n.format=()=>{},n.filter=c=>{c.minFilter=$e.enumValue(Bi,i[1]),c.magFilter=$e.enumValue(Bi,i[2])},n.repeat=c=>{i[1].indexOf("x")!=-1&&(c.uWrap=hr.Repeat),i[1].indexOf("y")!=-1&&(c.vWrap=hr.Repeat)},n.pma=c=>{c.pma=i[1]=="true"};var r={};r.xy=c=>{c.x=parseInt(i[1]),c.y=parseInt(i[2])},r.size=c=>{c.width=parseInt(i[1]),c.height=parseInt(i[2])},r.bounds=c=>{c.x=parseInt(i[1]),c.y=parseInt(i[2]),c.width=parseInt(i[3]),c.height=parseInt(i[4])},r.offset=c=>{c.offsetX=parseInt(i[1]),c.offsetY=parseInt(i[2])},r.orig=c=>{c.originalWidth=parseInt(i[1]),c.originalHeight=parseInt(i[2])},r.offsets=c=>{c.offsetX=parseInt(i[1]),c.offsetY=parseInt(i[2]),c.originalWidth=parseInt(i[3]),c.originalHeight=parseInt(i[4])},r.rotate=c=>{let u=i[1];u=="true"?c.degrees=90:u!="false"&&(c.degrees=parseInt(u))},r.index=c=>{c.index=parseInt(i[1])};let a=t.readLine();for(;a&&a.trim().length==0;)a=t.readLine();for(;!(!a||a.trim().length==0||t.readEntry(i,a)==0);)a=t.readLine();let o=null,h=null,l=null;for(;a!==null;)if(a.trim().length==0)o=null,a=t.readLine();else if(o){let c=new nw(o,a);for(;;){let u=t.readEntry(i,a=t.readLine());if(u==0)break;let d=r[i[0]];if(d)d(c);else{h||(h=[]),l||(l=[]),h.push(i[0]);let f=[];for(let p=0;p0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,c.degrees==90?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new pR(a.trim());t.readEntry(i,a=t.readLine())!=0;){let c=n[i[0]];c&&c(o)}this.pages.push(o)}}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 a=t.indexOf(",",r);if(a==-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,a-r).trim(),r=a+1,n==4)return 4}}},pR=class{constructor(e){x(this,"name");x(this,"minFilter",Bi.Nearest);x(this,"magFilter",Bi.Nearest);x(this,"uWrap",hr.ClampToEdge);x(this,"vWrap",hr.ClampToEdge);x(this,"texture",null);x(this,"width",0);x(this,"height",0);x(this,"pma",!1);x(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}},nw=class extends fR{constructor(t,i){super();x(this,"page");x(this,"name");x(this,"x",0);x(this,"y",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0);x(this,"index",0);x(this,"degrees",0);x(this,"names",null);x(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}},Zl=class Am extends gr{constructor(t,i){super(t);x(this,"region",null);x(this,"path");x(this,"regionUVs",[]);x(this,"uvs",[]);x(this,"triangles",[]);x(this,"color",new Mt(1,1,1,1));x(this,"width",0);x(this,"height",0);x(this,"hullLength",0);x(this,"edges",[]);x(this,"parentMesh",null);x(this,"sequence",null);x(this,"tempColor",new Mt(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=$e.newFloatArray(t.length));let i=this.uvs,n=this.uvs.length,r=this.region.u,a=this.region.v,o=0,h=0;if(this.region instanceof nw){let l=this.region,c=l.page,u=c.width,d=c.height;switch(l.degrees){case 90:r-=(l.originalHeight-l.offsetY-l.height)/u,a-=(l.originalWidth-l.offsetX-l.width)/d,o=l.originalHeight/u,h=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 pi;(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"})(pi||(pi={}));let Yv=class{constructor(e,t,i){x(this,"data");x(this,"skeleton");x(this,"parent",null);x(this,"children",new Array);x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"scaleX",0);x(this,"scaleY",0);x(this,"shearX",0);x(this,"shearY",0);x(this,"ax",0);x(this,"ay",0);x(this,"arotation",0);x(this,"ascaleX",0);x(this,"ascaleY",0);x(this,"ashearX",0);x(this,"ashearY",0);x(this,"a",0);x(this,"b",0);x(this,"c",0);x(this,"d",0);x(this,"worldY",0);x(this,"worldX",0);x(this,"inherit",pi.Normal);x(this,"sorted",!1);x(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,a,o){this.ax=e,this.ay=t,this.arotation=i,this.ascaleX=n,this.ascaleY=r,this.ashearX=a,this.ashearY=o;let h=this.parent;if(!h){let f=this.skeleton;const p=f.scaleX,m=f.scaleY,g=(i+a)*Ye.degRad,v=(i+90+o)*Ye.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=h.a,c=h.b,u=h.c,d=h.d;switch(this.worldX=l*e+c*t+h.worldX,this.worldY=u*e+d*t+h.worldY,this.inherit){case pi.Normal:{const f=(i+a)*Ye.degRad,p=(i+90+o)*Ye.degRad,m=Math.cos(f)*n,g=Math.cos(p)*r,v=Math.sin(f)*n,b=Math.sin(p)*r;this.a=l*m+c*v,this.b=l*g+c*b,this.c=u*m+d*v,this.d=u*g+d*b;return}case pi.OnlyTranslation:{const f=(i+a)*Ye.degRad,p=(i+90+o)*Ye.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 pi.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-c*f*u)/m,c=u*m,d=l*m,g=Math.atan2(u,l)*Ye.radDeg):(l=0,u=0,g=90-Math.atan2(d,c)*Ye.radDeg);const v=(i+a-g)*Ye.degRad,b=(i+o-g+90)*Ye.degRad,y=Math.cos(v)*n,w=Math.cos(b)*r,A=Math.sin(v)*n,M=Math.sin(b)*r;this.a=l*y-c*A,this.b=l*w-c*M,this.c=u*y+d*A,this.d=u*w+d*M;break}case pi.NoScale:case pi.NoScaleOrReflection:{i*=Ye.degRad;const f=Math.cos(i),p=Math.sin(i);let m=(l*f+c*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==pi.NoScale&&l*d-c*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v),i=Math.PI/2+Math.atan2(g,m);const b=Math.cos(i)*v,y=Math.sin(i)*v;a*=Ye.degRad,o=(90+o)*Ye.degRad;const w=Math.cos(a)*n,A=Math.cos(o)*r,M=Math.sin(a)*n,_=Math.sin(o)*r;this.a=m*w+b*M,this.b=m*A+b*_,this.c=g*w+y*M,this.d=g*A+y*_;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)*Ye.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)*Ye.radDeg;return}let t=e.a,i=e.b,n=e.c,r=e.d,a=1/(t*r-i*n),o=r*a,h=i*a,l=n*a,c=t*a,u=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=u*o-d*h,this.ay=d*c-u*l;let f,p,m,g;if(this.inherit==pi.OnlyTranslation)f=this.a,p=this.b,m=this.c,g=this.d;else{switch(this.inherit){case pi.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,a=1/(t*r-i*n),o=r*a,h=i*a;break}case pi.NoScale:case pi.NoScaleOrReflection:let v=Ye.cosDeg(this.rotation),b=Ye.sinDeg(this.rotation);t=(t*v+i*b)/this.skeleton.scaleX,n=(n*v+r*b)/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==pi.NoScale&&a<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y);let w=Ye.PI/2+Math.atan2(n,t);i=Math.cos(w)*y,r=Math.sin(w)*y,a=1/(t*r-i*n),o=r*a,h=i*a,l=n*a,c=t*a}f=o*this.a-h*this.c,p=o*this.b-h*this.d,m=c*this.c-l*this.a,g=c*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)*Ye.radDeg,this.arotation=Math.atan2(m,f)*Ye.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*Ye.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*Ye.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*Ye.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=Ye.sinDeg(e),i=Ye.cosDeg(e);return Math.atan2(this.a*t-this.c*i,this.d*i-this.b*t)*Ye.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=Ye.sinDeg(e),i=Ye.cosDeg(e);return Math.atan2(i*this.c+t*this.d,i*this.a+t*this.b)*Ye.radDeg}rotateWorld(e){e*=Ye.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}},Iu=class{constructor(e,t,i){x(this,"name");x(this,"order");x(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=i}},cw=class{constructor(e,t){x(this,"data");x(this,"intValue",0);x(this,"floatValue",0);x(this,"stringValue",null);x(this,"time",0);x(this,"volume",0);x(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},hw=class{constructor(e){x(this,"name");x(this,"intValue",0);x(this,"floatValue",0);x(this,"stringValue",null);x(this,"audioPath",null);x(this,"volume",0);x(this,"balance",0);this.name=e}},gR=class{constructor(e,t){x(this,"data");x(this,"bones");x(this,"target");x(this,"bendDirection",0);x(this,"compress",!1);x(this,"stretch",!1);x(this,"mix",1);x(this,"softness",0);x(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 pi.NoScale:case pi.NoScaleOrReflection:p=t-e.worldX,m=i-e.worldY}const b=e.data.length*g;if(b>1e-4){const y=p*p+m*m;if(n&&yb*b){const w=(Math.sqrt(y)/b-1)*o+1;g*=w,a&&(v*=w)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,g,v,e.ashearX,e.ashearY)}apply2(e,t,i,n,r,a,o,h,l){if(e.inherit!=pi.Normal||t.inherit!=pi.Normal)return;let c=e.ax,u=e.ay,d=e.ascaleX,f=e.ascaleY,p=d,m=f,g=t.ascaleX,v=0,b=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,b=180):b=0;let w=t.ax,A=0,M=0,_=0,R=e.a,P=e.b,F=e.c,I=e.d,k=Math.abs(d-f)<=1e-4;!k||a?(A=0,M=R*w+e.worldX,_=F*w+e.worldY):(A=t.ay,M=R*w+P*A+e.worldX,_=F*w+I*A+e.worldY);let B=e.parent;if(!B)throw new Error("IK parent must itself have a parent.");R=B.a,P=B.b,F=B.c,I=B.d;let D=R*I-P*F,U=M-B.worldX,L=_-B.worldY;D=Math.abs(D)<=1e-4?0:1/D;let N=(U*I-L*P)*D-c,O=(L*R-U*F)*D-u,X=Math.sqrt(N*N+O*O),E=t.data.length*g,V,q;if(X<1e-4){this.apply1(e,i,n,!1,a,!1,l),t.updateWorldTransformWith(w,A,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}U=i-B.worldX,L=n-B.worldY;let W=(U*I-L*P)*D-c,J=(L*R-U*F)*D-u,K=W*W+J*J;if(h!=0){h*=d*(g+1)*.5;let we=Math.sqrt(K),Ee=we-X-E*d+h;if(Ee>0){let ge=Math.min(1,Ee/(h*2))-1;ge=(Ee-h*(1-ge*ge))/we,W-=ge*W,J-=ge*J,K=W*W+J*J}}e:if(k){E*=d;let we=(K-X*X-E*E)/(2*X*E);we<-1?(we=-1,q=Math.PI*r):we>1?(we=1,q=0,a&&(R=(Math.sqrt(K)/(X+E)-1)*l+1,p*=R,o&&(m*=R))):q=Math.acos(we)*r,R=X+E*we,P=E*Math.sin(q),V=Math.atan2(J*R-W*P,W*R+J*P)}else{R=d*E,P=f*E;let we=R*R,Ee=P*P,ge=Math.atan2(J,W);F=Ee*X*X+we*K-we*Ee;let Te=-2*Ee*X,G=Ee-we;if(I=Te*Te-4*G*F,I>=0){let ae=Math.sqrt(I);Te<0&&(ae=-ae),ae=-(Te+ae)*.5;let Le=ae/G,Re=F/ae,Oe=Math.abs(Le)=0){L=Math.sqrt(Le)*r,V=ge-Math.atan2(L,Oe),q=Math.atan2(L/f,(Oe-X)/d);break e}}let Z=Ye.PI,z=X-R,j=z*z,te=0,he=0,ve=X+R,le=ve*ve,ye=0;F=-R*X/(we-Ee),F>=-1&&F<=1&&(F=Math.acos(F),U=R*Math.cos(F)+X,L=P*Math.sin(F),I=U*U+L*L,Ile&&(he=F,le=I,ve=U,ye=L)),K<=(j+le)*.5?(V=ge-Math.atan2(te*r,z),q=Z*r):(V=ge-Math.atan2(ye*r,ve),q=he*r)}let fe=Math.atan2(A,w)*y,me=e.arotation;V=(V-fe)*Ye.radDeg+v-me,V>180?V-=360:V<-180&&(V+=360),e.updateWorldTransformWith(c,u,me+V*l,p,m,0,0),me=t.arotation,q=((q+fe)*Ye.radDeg-t.ashearX)*y+b-me,q>180?q-=360:q<-180&&(q+=360),t.updateWorldTransformWith(w,A,me+q*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},uw=class extends Iu{constructor(t){super(t,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"bendDirection",0);x(this,"compress",!1);x(this,"stretch",!1);x(this,"uniform",!1);x(this,"mix",0);x(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},dw=class extends Iu{constructor(t){super(t,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"positionMode",Bn.Fixed);x(this,"spacingMode",Ri.Fixed);x(this,"rotateMode",Ia.Chain);x(this,"offsetRotation",0);x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var Bn;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(Bn||(Bn={}));var Ri;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(Ri||(Ri={}));var Ia;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(Ia||(Ia={}));var Qi;let vR=(Qi=class{constructor(e,t){x(this,"data");x(this,"bones");x(this,"target");x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"spaces",new Array);x(this,"positions",new Array);x(this,"world",new Array);x(this,"curves",new Array);x(this,"lengths",new Array);x(this,"segments",new Array);x(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){w=u/w*p;for(let M=1;M0?Ye.degRad:-.01745329277777778}for(let w=0,A=3;w0){let I=M.a,k=M.b,B=M.c,D=M.d,U=0,L=0,N=0;if(o?U=m[A-1]:d[w+1]==0?U=m[A+2]:U=Math.atan2(F,P),U-=Math.atan2(B,I),y){L=Math.cos(U),N=Math.sin(U);let O=M.data.length;g+=(O*(L*I-N*B)-P)*i,v+=(O*(N*I+L*B)-F)*i}else U+=b;U>Ye.PI?U-=Ye.PI2:U<-3.1415927&&(U+=Ye.PI2),U*=i,L=Math.cos(U),N=Math.sin(U),M.a=L*I-N*B,M.b=L*k-N*D,M.c=N*I+L*B,M.d=N*k+L*D}M.updateAppliedTransform()}}computeWorldPositions(e,t,i){let n=this.target,r=this.position,a=this.spaces,o=$e.setArraySize(this.positions,t*3+2),h=this.world,l=e.closed,c=e.worldVerticesLength,u=c/6,d=Qi.NONE;if(!e.constantSpeed){let O=e.lengths;u-=l?1:2;let X=O[u];this.data.positionMode==Bn.Percent&&(r*=X);let E;switch(this.data.spacingMode){case Ri.Percent:E=X;break;case Ri.Proportional:E=X/t;break;default:E=1}h=$e.setArraySize(this.world,8);for(let V=0,q=0,W=0;VX){d!=Qi.AFTER&&(d=Qi.AFTER,e.computeWorldVertices(n,c-6,4,h,0,2)),this.addAfterPosition(K-X,h,0,o,q);continue}for(;;W++){let fe=O[W];if(!(K>fe)){if(W==0)K/=fe;else{let me=O[W-1];K=(K-me)/(fe-me)}break}}W!=d&&(d=W,l&&W==u?(e.computeWorldVertices(n,c-4,4,h,0,2),e.computeWorldVertices(n,0,4,h,4,2)):e.computeWorldVertices(n,W*6+2,8,h,0,2)),this.addCurvePosition(K,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,q,i||V>0&&J==0)}return o}l?(c+=2,h=$e.setArraySize(this.world,c),e.computeWorldVertices(n,2,c-4,h,0,2),e.computeWorldVertices(n,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=$e.setArraySize(this.world,c),e.computeWorldVertices(n,2,c,h,0,2));let f=$e.setArraySize(this.curves,u),p=0,m=h[0],g=h[1],v=0,b=0,y=0,w=0,A=0,M=0,_=0,R=0,P=0,F=0,I=0,k=0,B=0,D=0;for(let O=0,X=2;Op){this.addAfterPosition(W-p,h,c-4,o,X);continue}for(;;E++){let J=f[E];if(!(W>J)){if(E==0)W/=J;else{let K=f[E-1];W=(W-K)/(J-K)}break}}if(E!=d){d=E;let J=E*6;for(m=h[J],g=h[J+1],v=h[J+2],b=h[J+3],y=h[J+4],w=h[J+5],A=h[J+6],M=h[J+7],_=(m-v*2+y)*.03,R=(g-b*2+w)*.03,P=((v-y)*3-m+A)*.006,F=((b-w)*3-g+M)*.006,I=_*2+P,k=R*2+F,B=(v-m)*.3+_+P*.16666667,D=(b-g)*.3+R+F*.16666667,N=Math.sqrt(B*B+D*D),L[0]=N,J=1;J<8;J++)B+=I,D+=k,I+=P,k+=F,N+=Math.sqrt(B*B+D*D),L[J]=N;B+=I,D+=k,N+=Math.sqrt(B*B+D*D),L[8]=N,B+=I+P,D+=k+F,N+=Math.sqrt(B*B+D*D),L[9]=N,V=0}for(W*=N;;V++){let J=L[V];if(!(W>J)){if(V==0)W/=J;else{let K=L[V-1];W=V+(W-K)/(J-K)}break}}this.addCurvePosition(W*.1,m,g,v,b,y,w,A,M,o,X,i||O>0&&q==0)}return o}addBeforePosition(e,t,i,n,r){let a=t[i],o=t[i+1],h=t[i+2]-a,l=t[i+3]-o,c=Math.atan2(l,h);n[r]=a+e*Math.cos(c),n[r+1]=o+e*Math.sin(c),n[r+2]=c}addAfterPosition(e,t,i,n,r){let a=t[i+2],o=t[i+3],h=a-t[i],l=o-t[i+1],c=Math.atan2(l,h);n[r]=a+e*Math.cos(c),n[r+1]=o+e*Math.sin(c),n[r+2]=c}addCurvePosition(e,t,i,n,r,a,o,h,l,c,u,d){if(e==0||isNaN(e)){c[u]=t,c[u+1]=i,c[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,b=m*e,y=b*3,w=m*y,A=y*e,M=t*v+n*w+a*A+h*p,_=i*v+r*w+o*A+l*p;c[u]=M,c[u+1]=_,d&&(e<.001?c[u+2]=Math.atan2(r-i,n-t):c[u+2]=Math.atan2(_-(i*g+r*b*2+o*f),M-(t*g+n*b*2+a*f)))}},x(Qi,"NONE",-1),x(Qi,"BEFORE",-2),x(Qi,"AFTER",-3),x(Qi,"epsilon",1e-5),Qi),yR=class{constructor(e,t){x(this,"data");x(this,"_bone",null);x(this,"inertia",0);x(this,"strength",0);x(this,"damping",0);x(this,"massInverse",0);x(this,"wind",0);x(this,"gravity",0);x(this,"mix",0);x(this,"_reset",!0);x(this,"ux",0);x(this,"uy",0);x(this,"cx",0);x(this,"cy",0);x(this,"tx",0);x(this,"ty",0);x(this,"xOffset",0);x(this,"xVelocity",0);x(this,"yOffset",0);x(this,"yVelocity",0);x(this,"rotateOffset",0);x(this,"rotateVelocity",0);x(this,"scaleOffset",0);x(this,"scaleVelocity",0);x(this,"active",!1);x(this,"skeleton");x(this,"remaining",0);x(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,a=this.data.scaleX>0,o=this.bone,h=o.data.length;switch(e){case Lr.none:return;case Lr.reset:this.reset();case Lr.update:const l=this.skeleton,c=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=c,this.lastTime=l.time;const u=o.worldX,d=o.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,b=this.data.limit*c,y=b*Math.abs(l.scaleY);if(b*=Math.abs(l.scaleX),i||n){if(i){const w=(this.ux-u)*p;this.xOffset+=w>b?b:w<-b?-b:w,this.ux=u}if(n){const w=(this.uy-d)*p;this.yOffset+=w>y?y:w<-y?-y:w,this.uy=d}if(f>=m){v=Math.pow(this.damping,60*m);const w=this.massInverse*m,A=this.strength,M=this.wind*g*l.scaleX,_=this.gravity*g*l.scaleY;do i&&(this.xVelocity+=(M-this.xOffset*A)*w,this.xOffset+=this.xVelocity*m,this.xVelocity*=v),n&&(this.yVelocity-=(_+this.yOffset*A)*w,this.yOffset+=this.yVelocity*m,this.yVelocity*=v),f-=m;while(f>=m)}i&&(o.worldX+=this.xOffset*t*this.data.x),n&&(o.worldY+=this.yOffset*t*this.data.y)}if(r||a){let w=Math.atan2(o.c,o.a),A=0,M=0,_=0,R=this.cx-o.worldX,P=this.cy-o.worldY;if(R>b?R=b:R<-b&&(R=-b),P>y?P=y:P<-y&&(P=-y),r){_=(this.data.rotate+this.data.shearX)*t;let F=Math.atan2(P+this.ty,R+this.tx)-w-this.rotateOffset*_;this.rotateOffset+=(F-Math.ceil(F*Ye.invPI2-.5)*Ye.PI2)*p,F=this.rotateOffset*_+w,A=Math.cos(F),M=Math.sin(F),a&&(F=h*o.getWorldScaleX(),F>0&&(this.scaleOffset+=(R*A+P*M)*p/F))}else{A=Math.cos(w),M=Math.sin(w);const F=h*o.getWorldScaleX();F>0&&(this.scaleOffset+=(R*A+P*M)*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=Ip.yDown?-this.gravity:this.gravity,D=h/g;for(;;)if(f-=m,a&&(this.scaleVelocity+=(k*A-B*M-this.scaleOffset*I)*F,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=v),r){if(this.rotateVelocity-=((k*M+B*A)*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,c=Math.sin(f),u=Math.cos(f),d=o.b,o.b=u*d-c*o.d,o.d=c*d+u*o.d),f+=l*this.data.shearX,c=Math.sin(f),u=Math.cos(f),d=o.a,o.a=u*d-c*o.c,o.c=c*d+u*o.c}else l*=this.data.rotate,c=Math.sin(l),u=Math.cos(l),d=o.a,o.a=u*d-c*o.c,o.c=c*d+u*o.c,d=o.b,o.b=u*d-c*o.d,o.d=c*d+u*o.d}if(a){const l=1+this.scaleOffset*t*this.data.scaleX;o.a*=l,o.c*=l}e!=Lr.pose&&(this.tx=h*o.a,this.ty=h*o.c),o.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,i){const n=i*Ye.degRad,r=Math.cos(n),a=Math.sin(n),o=this.cx-e,h=this.cy-t;this.translate(o*r-h*a-o,o*a+h*r-h)}},xR=class{constructor(e,t){x(this,"data");x(this,"bone");x(this,"color");x(this,"darkColor",null);x(this,"attachment",null);x(this,"attachmentState",0);x(this,"sequenceIndex",-1);x(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 Mt,this.darkColor=e.darkColor?new Mt:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof gr)||!(this.attachment instanceof gr)||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){x(this,"data");x(this,"bones");x(this,"target");x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0);x(this,"temp",new Fh);x(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?Ye.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,b=g.length;vYe.PI?R-=Ye.PI2:R<-3.1415927&&(R+=Ye.PI2),R*=e;let P=Math.cos(R),F=Math.sin(R);y.a=P*w-F*M,y.b=P*A-F*_,y.c=F*w+P*M,y.d=F*A+P*_}if(o){let w=this.temp;h.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(w.x-y.worldX)*t,y.worldY+=(w.y-y.worldY)*i}if(n!=0){let w=Math.sqrt(y.a*y.a+y.c*y.c);w!=0&&(w=(w+(Math.sqrt(l*l+u*u)-w+this.data.offsetScaleX)*n)/w),y.a*=w,y.c*=w}if(r!=0){let w=Math.sqrt(y.b*y.b+y.d*y.d);w!=0&&(w=(w+(Math.sqrt(c*c+d*d)-w+this.data.offsetScaleY)*r)/w),y.b*=w,y.d*=w}if(a>0){let w=y.b,A=y.d,M=Math.atan2(A,w),_=Math.atan2(d,c)-Math.atan2(u,l)-(M-Math.atan2(y.c,y.a));_>Ye.PI?_-=Ye.PI2:_<-3.1415927&&(_+=Ye.PI2),_=M+(_+m)*a;let R=Math.sqrt(w*w+A*A);y.b=Math.cos(_)*R,y.d=Math.sin(_)*R}y.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,a=this.mixShearY,o=t!=0||i!=0,h=this.target,l=h.a,c=h.b,u=h.c,d=h.d,f=l*d-c*u>0?Ye.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,b=g.length;vYe.PI?R-=Ye.PI2:R<-3.1415927&&(R+=Ye.PI2),R*=e;let P=Math.cos(R),F=Math.sin(R);y.a=P*w-F*M,y.b=P*A-F*_,y.c=F*w+P*M,y.d=F*A+P*_}if(o){let w=this.temp;h.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),y.worldX+=w.x*t,y.worldY+=w.y*i}if(n!=0){let w=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*n+1;y.a*=w,y.c*=w}if(r!=0){let w=(Math.sqrt(c*c+d*d)-1+this.data.offsetScaleY)*r+1;y.b*=w,y.d*=w}if(a>0){let w=Math.atan2(d,c)-Math.atan2(u,l);w>Ye.PI?w-=Ye.PI2:w<-3.1415927&&(w+=Ye.PI2);let A=y.b,M=y.d;w=Math.atan2(M,A)+(w-Ye.PI/2+m)*a;let _=Math.sqrt(A*A+M*M);y.b=Math.cos(w)*_,y.d=Math.sin(w)*_}y.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,a=this.mixShearY,o=this.target,h=this.bones;for(let l=0,c=h.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 Fh,i=new Fh;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,a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let c=0,u=r.length;c=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 Yr;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(Yr||(Yr={}));let pw=class extends Iu{constructor(t){super(t,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0);x(this,"offsetRotation",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"offsetScaleX",0);x(this,"offsetScaleY",0);x(this,"offsetShearY",0);x(this,"relative",!1);x(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Im=class{constructor(e){x(this,"scale",1);x(this,"attachmentLoader");x(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,i=new Bh;i.name="";let n=new wR(e),r=n.readInt32(),a=n.readInt32();i.hash=a==0&&r==0?null:a.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 o=n.readBoolean();o&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let h=0;h=n.readInt(!0);for(let c=0;c>1&3,f.rotateMode=p>>3&3,(p&128)!=0&&(f.offsetRotation=n.readFloat()),f.position=n.readFloat(),f.positionMode==Bn.Fixed&&(f.position*=t),f.spacing=n.readFloat(),(f.spacingMode==Ri.Length||f.spacingMode==Ri.Fixed)&&(f.spacing*=t),f.mixRotate=n.readFloat(),f.mixX=n.readFloat(),f.mixY=n.readFloat(),i.pathConstraints.push(f)}h=n.readInt(!0);for(let c=0,u;c>4,e.readFloat())}n.push(M);break}}}}}let a=e.readInt(!0);if(a>0){let l=new vl(a),c=i.slots.length;for(let u=0;u=0;b--)p[b]=-1;let m=$e.newArray(c-f,0),g=0,v=0;for(let b=0;b=0;b--)p[b]==-1&&(p[b]=m[--v]);l.setFrame(u,d,p)}n.push(l)}let o=e.readInt(!0);if(o>0){let l=new Cp(o);for(let c=0;c>>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}},SR=class{constructor(e,t,i,n,r){x(this,"parent");x(this,"skinIndex");x(this,"slotIndex");x(this,"mesh");x(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.parent=n,this.inheritTimeline=r}},_R=class{constructor(e=null,t=null,i=0){x(this,"bones");x(this,"vertices");x(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 Ki(s,e,t){let i=s.readFloat(),n=s.readFloat()*t;for(let r=0,a=0,o=e.getFrameCount()-1;e.setFrame(r,i,n),r!=o;r++){let h=s.readFloat(),l=s.readFloat()*t;switch(s.readByte()){case wn:e.setStepped(r);break;case Sn:Bt(s,e,a++,r,0,i,h,n,l,t)}i=h,n=l}return e}function _f(s,e,t){let i=s.readFloat(),n=s.readFloat()*t,r=s.readFloat()*t;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,i,n,r),a!=h;a++){let l=s.readFloat(),c=s.readFloat()*t,u=s.readFloat()*t;switch(s.readByte()){case wn:e.setStepped(a);break;case Sn:Bt(s,e,o++,a,0,i,l,n,c,t),Bt(s,e,o++,a,1,i,l,r,u,t)}i=l,n=c,r=u}return e}function Bt(s,e,t,i,n,r,a,o,h,l){e.setBezier(t,i,n,r,o,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,a,h)}const MR=0,TR=1,AR=2,ER=3,CR=4,IR=5,RR=6,PR=7,kR=8,FR=9,OR=10,BR=0,LR=1,DR=2,NR=3,UR=4,XR=5,VR=0,YR=1,$R=0,GR=1,HR=2,jR=0,WR=1,zR=2,qR=4,KR=5,ZR=6,JR=7,QR=8,wn=1,Sn=2;class ps{constructor(){x(this,"convexPolygons",new Array);x(this,"convexPolygonsIndices",new Array);x(this,"indicesArray",new Array);x(this,"isConcaveArray",new Array);x(this,"triangles",new Array);x(this,"polygonPool",new kh(()=>new Array));x(this,"polygonIndicesPool",new kh(()=>new Array))}triangulate(e){let t=e,i=e.length>>1,n=this.indicesArray;n.length=0;for(let o=0;o3;){let o=i-1,h=0,l=1;for(;;){e:if(!r[h]){let d=n[o]<<1,f=n[h]<<1,p=n[l]<<1,m=t[d],g=t[d+1],v=t[f],b=t[f+1],y=t[p],w=t[p+1];for(let A=(l+1)%i;A!=o;A=(A+1)%i){if(!r[A])continue;let M=n[A]<<1,_=t[M],R=t[M+1];if(ps.positiveArea(y,w,m,g,_,R)&&ps.positiveArea(m,g,v,b,_,R)&&ps.positiveArea(v,b,y,w,_,R))break e}break}if(l==0){do{if(!r[h])break;h--}while(h>0);break}o=h,h=l,l=(l+1)%i}a.push(n[(i+h-1)%i]),a.push(n[h]),a.push(n[(h+1)%i]),n.splice(h,1),r.splice(h,1),i--;let c=(i+h-1)%i,u=h==i?0:h;r[c]=ps.isConcave(c,i,t,n),r[u]=ps.isConcave(u,i,t,n)}return i==3&&(a.push(n[2]),a.push(n[0]),a.push(n[1])),a}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 a=this.polygonIndicesPool.obtain();a.length=0;let o=this.polygonPool.obtain();o.length=0;let h=-1,l=0;for(let c=0,u=t.length;c0?(n.push(o),r.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),o=this.polygonPool.obtain(),o.length=0,o.push(m),o.push(g),o.push(v),o.push(b),o.push(y),o.push(w),a=this.polygonIndicesPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),l=ps.winding(m,g,v,b,y,w),h=d)}o.length>0&&(n.push(o),r.push(a));for(let c=0,u=n.length;c=0;c--)o=n[c],o.length==0&&(n.splice(c,1),this.polygonPool.free(o),a=r[c],r.splice(c,1),this.polygonIndicesPool.free(a));return n}static isConcave(e,t,i,n){let r=n[(t+e-1)%t]<<1,a=n[e]<<1,o=n[(e+1)%t]<<1;return!this.positiveArea(i[r],i[r+1],i[a],i[a+1],i[o],i[o+1])}static positiveArea(e,t,i,n,r,a){return e*(a-n)+i*(t-a)+r*(n-t)>=0}static winding(e,t,i,n,r,a){let o=i-e,h=n-t;return r*h-a*o+o*t-e*h>=0?1:-1}}class Lh{constructor(){x(this,"triangulator",new ps);x(this,"clippingPolygon",new Array);x(this,"clipOutput",new Array);x(this,"clippedVertices",new Array);x(this,"clippedUVs",new Array);x(this,"clippedTriangles",new Array);x(this,"scratch",new Array);x(this,"clipAttachment",null);x(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let i=t.worldVerticesLength,n=$e.setArraySize(this.clippingPolygon,i);t.computeWorldVertices(e,0,i,n,0,2);let r=this.clippingPolygon;Lh.makeClockwise(r);let a=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let o=0,h=a.length;o>1,M=this.clipOutput,_=$e.setArraySize(r,y+A*2);for(let P=0;P>1,q=this.clipOutput,W=$e.setArraySize(l,D+V*f);for(let K=0;K>1,X=this.clipOutput,E=$e.setArraySize(a,I+O*2),V=$e.setArraySize(o,I+O*2);for(let W=0;W=2?(u=h,h=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(a),u.push(e),u.push(t),h.length=0;let d=o.length-4,f=o;for(let p=0;;p+=2){let m=f[p],g=f[p+1],v=m-f[p+2],b=g-f[p+3],y=h.length,w=u;for(let M=0,_=u.length-2;M<_;){let R=w[M],P=w[M+1];M+=2;let F=w[M],I=w[M+1],k=b*(m-F)>v*(g-I),B=b*(m-R)-v*(g-P);if(B>0){if(k){h.push(F),h.push(I);continue}let D=F-R,U=I-P,L=B/(D*b-U*v);if(L>=0&&L<=1)h.push(R+D*L),h.push(P+U*L);else{h.push(F),h.push(I);continue}}else if(k){let D=F-R,U=I-P,L=B/(D*b-U*v);if(L>=0&&L<=1)h.push(R+D*L),h.push(P+U*L),h.push(F),h.push(I);else{h.push(F),h.push(I);continue}}c=!0}if(y==h.length)return l.length=0,!0;if(h.push(h[0]),h.push(h[1]),p==d)break;let A=h;h=u,h.length=0,u=A}if(l!=h){l.length=0;for(let p=0,m=h.length-2;p>1;l0){let c=i.findPhysicsConstraint(o);if(!c)throw new Error("Physics constraint not found: "+o);l=i.physicsConstraints.indexOf(c)}for(let c in h){let u=h[c],d=u[0];if(!d)continue;let f=u.length;if(c=="reset"){const m=new J1(f,l);for(let g=0;d!=null;d=u[g+1],g++)m.setFrame(g,re(d,"time",0));r.push(m);continue}let p;if(c=="inertia")p=new H1(f,f,l);else if(c=="strength")p=new j1(f,f,l);else if(c=="damping")p=new W1(f,f,l);else if(c=="mass")p=new z1(f,f,l);else if(c=="wind")p=new q1(f,f,l);else if(c=="gravity")p=new K1(f,f,l);else if(c=="mix")p=new Z1(f,f,l);else continue;r.push($s(u,p,0,1))}}if(e.attachments)for(let o in e.attachments){let h=e.attachments[o],l=i.findSkin(o);if(!l)throw new Error("Skin not found: "+o);for(let c in h){let u=h[c],d=i.findSlot(c);if(!d)throw new Error("Slot not found: "+c);let f=d.index;for(let p in u){let m=u[p],g=l.getAttachment(f,p);for(let v in m){let b=m[v],y=b[0];if(y){if(v=="deform"){let w=g.bones,A=g.vertices,M=w?A.length/3*2:A.length,_=new U1(b.length,b.length,f,g),R=re(y,"time",0);for(let P=0,F=0;;P++){let I,k=re(y,"vertices",null);if(!k)I=w?$e.newFloatArray(M):A;else{I=$e.newFloatArray(M);let L=re(y,"offset",0);if($e.arrayCopy(k,0,I,L,k.length),n!=1)for(let N=L,O=N+k.length;N=0;v--)d[v]==-1&&(d[v]=p[--g])}o.setFrame(l,re(u,"time",0),d)}r.push(o)}if(e.events){let o=new Cp(e.events.length),h=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 qn=class qn extends dR{constructor(t){super(t.resource.source);x(this,"texture");this.texture=pt.from(t)}static from(t){return qn.textureMap.has(t)?qn.textureMap.get(t):new qn(t)}setFilters(t,i){this.texture.baseTexture.scaleMode=qn.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=qn.toPixiMipMap(t)}setWraps(t,i){this.texture.baseTexture.wrapMode=qn.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case Bi.Nearest:case Bi.MipMapNearestLinear:case Bi.MipMapNearestNearest:return qs.NEAREST;case Bi.Linear:case Bi.MipMapLinearLinear:case Bi.MipMapLinearNearest:return qs.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case Bi.Nearest:case Bi.Linear:return Us.OFF;case Bi.MipMapNearestLinear:case Bi.MipMapNearestNearest:case Bi.MipMapLinearLinear:case Bi.MipMapLinearNearest:return Us.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case hr.ClampToEdge:return Js.CLAMP;case hr.MirroredRepeat:return Js.MIRRORED_REPEAT;case hr.Repeat:return Js.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case Yr.Normal:return dt.NORMAL;case Yr.Additive:return dt.ADD;case Yr.Multiply:return dt.MULTIPLY;case Yr.Screen:return dt.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};x(qn,"textureMap",new Map);let Oa=qn;const Kn=class Kn extends Dl{constructor(){const t=new _p;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const i=new Ch(pt.EMPTY);super(t,i);x(this,"name","");x(this,"warnedTwoTint",!1)}updateFromSpineData(t,i,n,r,a,o,h,l){var v,b;this.texture=t.texture;const c=a/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((v=u.data)==null?void 0:v.length)!==c&&(u.data=new Float32Array(c));const d=this.geometry.getBuffer("aVertexPosition");((b=d.data)==null?void 0:b.length)!==c&&(d.data=new Float32Array(c));let f=0,p=u.data,m=d.data;for(let y=0;ynew Rm);x(this,"beforeUpdateWorldTransforms",()=>{});x(this,"afterUpdateWorldTransforms",()=>{});x(this,"_autoUpdate",!1);x(this,"_ticker",us.shared);x(this,"meshesCache",new Map);x(this,"lightColor",new Mt);x(this,"darkColor",new Mt);x(this,"_boundsProvider");x(this,"_boundsPoint",new Xt);x(this,"_boundsSpineID",-1);x(this,"_boundsSpineDirty",!0);x(this,"slotsObject",new Map);x(this,"verticesCache",$e.newFloatArray(1024));x(this,"clippingSlotToPixiMasks",{});x(this,"currentClippingSlot");const n=t instanceof Bh?t:t.skeletonData;this.skeleton=new Ip(n);const r=new uR(n);this.state=new aR(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(a=>!!a.data.darkColor):t==null?void 0:t.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new yl)):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??us.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 yl&&(this.darkTint=!0),i.destroy()}else for(let i=0;inew yl,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(Lr.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 o;let r=this.getSlotFromRef(t);const a=(o=this.slotsObject.get(r))==null?void 0:o.container;if(!(a&&a===i)){for(const[h,{container:l}]of this.slotsObject)if(h!==r&&l===i){this.removeSlotObject(h,i);break}a&&this.removeChild(a),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 a;let n=this.getSlotFromRef(t),r=(a=this.slotsObject.get(n))==null?void 0:a.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:a}=t,o=a?!!i.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(i)&&o,r.visible){let h=i.bone;const l=r.localTransform;l.a=h.a,l.b=h.c,l.c=-h.b,l.d=-h.d,l.tx=h.worldX,l.ty=h.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 o,h;const n=t.attachment;if(n&&n instanceof To){const l=(o=this.clippingSlotToPixiMasks)[h=t.data.name]||(o[h]={slot:t,vertices:new Array});l.maskComputed=!1,this.currentClippingSlot=l;return}let r=this.currentClippingSlot;const a=this.slotsObject.get(t);if(r&&a){let l=r.mask;if(l||(l=Gv.obtain(),r.mask=l,this.addChild(l)),!r.maskComputed){let c=r.slot,u=c.attachment;r.maskComputed=!0;const d=u.worldVerticesLength,f=r.vertices;u.computeWorldVertices(c,0,d,f,0,2),l.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}a.container.mask=l}else a!=null&&a.container.mask&&(a.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),i){for(const l in this.clippingSlotToPixiMasks){const c=this.clippingSlotToPixiMasks[l];(!(c.slot.attachment instanceof To)||!c.maskComputed)&&c.mask&&(this.removeChild(c.mask),Gv.free(c.mask),c.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var r,a;this.resetMeshes();let t=null,i=null;const n=this.skeleton.drawOrder;for(let o=0,h=n.length,l=0;o>1)*p,b>this.verticesCache.length&&(this.verticesCache=$e.newFloatArray(b)),y.computeWorldVertices(c,0,y.worldVerticesLength,this.verticesCache,0,p),t=y.triangles,i=y.uvs,v=(a=y.region)==null?void 0:a.texture}else if(m instanceof To){Yt.clipper.clipStart(c,m);continue}else{this.hasMeshForSlot(c)&&(this.getMeshForSlot(c).visible=!1),Yt.clipper.clipEndWithSlot(c);continue}if(v!=null){const w=c.bone.skeleton.color,A=c.color,M=w.a*A.a*g.a;this.lightColor.set(w.r*A.r*g.r,w.g*A.g*g.g,w.b*A.b*g.b,M),c.darkColor!=null?this.darkColor.set(c.darkColor.r,c.darkColor.g,c.darkColor.b,1):this.darkColor.set(0,0,0,1);let _,R,P,F;if(Yt.clipper.isClipping())Yt.clipper.clipTriangles(this.verticesCache,t,t.length,i,this.lightColor,this.darkColor,f),_=Yt.clipper.clippedVertices,R=_.length,P=Yt.clipper.clippedTriangles,F=P.length;else{const k=this.verticesCache;for(let B=2,D=0,U=b;Bnew vs);Ip.yDown=!0;const Fc="spineTextureAtlasLoader",aP={extension:Ge.Asset,resolver:{test:s=>xs(s,".atlas"),parse:s=>{var t,i;const e=s.split(".");return{resolution:parseFloat(((i=(t=We.RETINA_PREFIX)==null?void 0:t.exec(s))==null?void 0:i[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:Fc,extension:{type:Ge.LoadParser,priority:Es.Normal,name:Fc},test(s){return xs(s,".atlas")},async load(s){const e=await We.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${Fc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return await e.text()},testParse(s,e){const t=xs(e.src,".atlas"),i=typeof s=="string",n=e.loadParser===Fc;return Promise.resolve((t||n)&&i)},unload(s){s.dispose()},async parse(s,e,t){var h;const i=e.data||{};let n=wi.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const r=new sw(s);if(i.images instanceof vt||typeof i.images=="string"){const l=i.images;i.images={},i.images[r.pages[0].name]=l}const a=[];let o=!0;for(const l of t.parsers)if(l.name=="loadTextures"){o=(h=l.config)==null?void 0:h.preferCreateImageBitmap;break}kn.setPreferences({preferCreateImageBitmap:!1});for(const l of r.pages){const c=l.name,u=i!=null&&i.images?i.images[c]:void 0;if(u instanceof vt)l.setTexture(Oa.from(u));else{const d=u??wi.normalize([...n.split(wi.sep),c].join(wi.sep)),f={src:_h(d,e.src),data:{...i.imageMetadata,alphaMode:l.pma?Ni.PMA:Ni.UNPACK}},p=t.load(f).then(m=>{l.setTexture(Oa.from(m.baseTexture))});a.push(p)}}return await Promise.all(a),kn.setPreferences({preferCreateImageBitmap:o}),r}}};et.add(aP);const Oc="spineSkeletonLoader";function oP(s){return s.hasOwnProperty("bones")}function lP(s){return s instanceof Uint8Array}const cP={extension:Ge.Asset,loader:{name:Oc,extension:{type:Ge.LoadParser,priority:Es.Normal,name:Oc},test(s){return xs(s,".skel")},async load(s){const e=await We.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${Oc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return new Uint8Array(await e.arrayBuffer())},testParse(s,e){const t=xs(e.src,".json")&&oP(s),i=xs(e.src,".skel")&&lP(s),n=e.loadParser===Oc;return Promise.resolve(t||i||n)}}};et.add(cP);class hP extends Dn{constructor(t=!1){super();x(this,"_buffer");x(this,"_indexBuffer");this._buffer=new ai(void 0,t,!1),this._indexBuffer=new ai(void 0,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Qe.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Qe.FLOAT).addAttribute("aColor",this._buffer,4,!0,Qe.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,Qe.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Qe.FLOAT).addIndex(this._indexBuffer)}}const uP=` +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; + +} +`,dP=` +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 gw extends Ir{constructor(e){super(e),this.shaderGenerator=new ob(uP,dP),this.geometryClass=hP,this.vertexSize=7}packInterleavedGeometry(e,t,i,n,r){const{uint32View:a,float32View:o}=t,h=n/this.vertexSize,l=e.uvs,c=e.indices,u=e.vertexData,d=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),p=Wt.shared.setValue(e._tintRGB).toPremultiplied(f,!0),m=Wt.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let a=function(l){return Promise.all(l.map(c=>Promise.resolve(c).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),h=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));n=a(t.map(l=>{if(l=vP(l),l in Hv)return;Hv[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":gP,c||(d.as="script"),d.crossOrigin="",d.href=l,h&&d.setAttribute("nonce",h),document.head.appendChild(d),c)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return n.then(a=>{for(const o of a||[])o.status==="rejected"&&r(o.reason);return e().catch(r)})};async function yw(){const[s,e]=await Promise.all([jv(()=>import("./index-B-woOuPC.js"),[]),jv(()=>import("./index-DPMVQNnV.js"),__vite__mapDeps([0,1]))]);return{core:s,pixi:e}}async function yP(s,e,t){const{core:i,pixi:n}=await yw(),r=new i.TextureAtlas(e);return Rp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonJson(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}async function xP(s,e,t){const{core:i,pixi:n}=await yw(),r=new i.TextureAtlas(e);return Rp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonBinary(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}function Dr(s,e,t){const i=Number(s[e]);return Number.isFinite(i)?i:t}function ys(s,e,t,i){s[e]==null&&(s[e]=Dr(s,t,i))}function Pp(s,e,t){if(typeof s.curve!="number")return;const i=Dr(s,"time",0),r=Dr(e,"time",0)-i,a=s.curve,o=Dr(s,"c2",0),h=Dr(s,"c3",1),l=Dr(s,"c4",1);s.curve=t.flatMap(([c,u])=>[i+r*a,c+(u-c)*o,i+r*h,c+(u-c)*l]),delete s.c2,delete s.c3,delete s.c4}function $r(s,e){if(Array.isArray(s))for(let t=0;t[Dr(i,r,a),Dr(n,r,a)]))}}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 Wv(s,e){if(Array.isArray(s))for(let t=0;t[o,a[h]]))}}function wP(s){for(const e of s.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of s.transform||[])ys(e,"mixRotate","rotateMix",1),ys(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),ys(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),ys(e,"mixShearY","shearMix",1);for(const e of s.path||[])ys(e,"mixRotate","rotateMix",1),ys(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function SP(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 _P(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),Wv(e.rgba,!1),Wv(e.rgba2,!0)}function MP(s){for(const e of Object.values(s.bones||{})){for(const t of e.rotate||[])ys(t,"value","angle",0);$r(e.rotate,[{key:"value",fallback:0}]),$r(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),$r(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),$r(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function TP(s){for(const e of Object.values(s.ik||{}))$r(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function AP(s){for(const e of Object.values(s.transform||{})){for(const t of e)ys(t,"mixRotate","rotateMix",1),ys(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),ys(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),ys(t,"mixShearY","shearMix",1);$r(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 EP(s){for(const e of Object.values(s.path||{})){for(const i of["position","spacing"]){const n=e[i];for(const r of n||[])ys(r,"value",i,0);$r(n,[{key:"value",fallback:0}])}const t=e.mix;for(const i of t||[])ys(i,"mixRotate","rotateMix",1),ys(i,"mixX","translateMix",1),i.mixY==null&&(i.mixY=i.mixX);$r(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function CP(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,a]of Object.entries(i)){const o=n[r]||(n[r]={});for(const[h,l]of Object.entries(a)){const c=o[h]||(o[h]={});c.deform=l,bP(l)}}}delete s.deform}function xw(s){wP(s),SP(s);for(const e of Object.values(s.animations||{}))_P(e),MP(e),TP(e),AP(e),EP(e),CP(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return s}function IP(s){return s.replace(/\\/g,"/").split("/").pop()||s}async function RP(s){const e=await Promise.all(s.map(async t=>{const i=URL.createObjectURL(t);try{return[IP(t.name).toLowerCase(),await pt.fromURL(i)]}finally{URL.revokeObjectURL(i)}}));return new Map(e)}function PP(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 bw(s,e,t){var a;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 RP(t),r=[...n.values()];try{let o,h,l=null,c;if(/\.skel$/i.test(s.name)){const u=await s.arrayBuffer();try{({skeletonData:o,SpineClass:h}=await xP(u,i,n)),c="4.3"}catch(d){try{({skeletonData:o,SpineClass:h}=pP(u,i,n)),c="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=Ph(o.version)}else{let u;try{u=JSON.parse(await s.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(l=Ph((a=u==null?void 0:u.skeleton)==null?void 0:a.spine),!l)throw new Error(`Spine JSON 版本不受支持,仅支持 ${Mm()}`);c=WI(l),l==="3.8"&&xw(u);const d=c==="4.3"?await yP(u,i,n):mP(u,i,n);o=d.skeletonData,h=d.SpineClass}if(!l)throw new Error(`Spine 数据版本不受支持,仅支持 ${Mm()}`);return{skeletonData:o,textures:r,runtimeVersion:c,SpineClass:h,dataVersion:l,animations:o.animations.map(u=>({name:u.name,duration:u.duration})),bones:PP(o)}}catch(o){for(const h of r)h.destroy(!0);throw o}}function Jc(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 kP(s,e,t){return{skeleton:{name:s.name,dataUrl:await Jc(s)},atlas:{name:e.name,dataUrl:await Jc(e)},textures:await Promise.all(t.map(async i=>({name:i.name,dataUrl:await Jc(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 FP(s){return{skeleton:await Tf(s.skeleton),atlas:await Tf(s.atlas),textures:await Promise.all(s.textures.map(Tf))}}const ww="SpineParticle.EditorConfig",Sw=1;function _w(s){return{backgroundX:s.backgroundX,backgroundY:s.backgroundY,backgroundOpacity:s.backgroundOpacity,backgroundImageName:s.backgroundImageName,backgroundImageData:s.backgroundImageData,showGrid:s.showGrid,exportSettings:ci(s.exportSettings)}}function OP(s){return JSON.parse(JSON.stringify(s,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function Mw(s){const e=ci(s);return delete e.tags,delete e.selectedTag,e}function BP(s){const e=_w(s.settings);return OP({format:ww,version:Sw,savedAt:new Date().toISOString(),editor:ci(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=>({...ci(t),frames:void 0})),colliders:s.colliders.map(Mw),paths:ci(s.paths),spines:ci(s.spines)}})}function LP(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function Tw(s){const e=BP(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=LP(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),0),e}function Aw(s){let e;try{e=JSON.parse(s)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==ww)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==Sw)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 DP(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 a=e.get(r);return a||(a=pt.fromURL(r).then(o=>Nr(o)),e.set(r,a)),a},i=await t("/images/star.png");await Promise.all(s.map(async n=>{var a;const r=zr(n.config);r.texture=i,await Promise.all(r.imageResources.map(async o=>{o.texture=await t(o.previewUrl||"/images/star.png"),await Promise.all(o.sequenceFrames.map(async h=>{h.texture=await t(h.previewUrl||o.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async o=>{o.texture=await t(o.previewUrl||"/images/trail.png")})),r.trailTexture=((a=r.trailResources[0])==null?void 0:a.texture)||null,n.frames=[]}))}async function NP(s){const e=new Map;try{for(const t of s){if(!t.sourceBundle)continue;const i=await FP(t.sourceBundle);e.set(t.id,await bw(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 UP(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 XP(s,e){var c,u,d,f,p,m,g;const t=Aw(JSON.stringify(e)),i=ci(t.scene.systems),n=t.scene.colliders.map(Mw),r=ci(t.scene.paths),a=ci(t.scene.spines);for(const v of a)v.sourceBundle==null&&(v.sourceBundle=null),v.dataVersion==null&&(v.dataVersion="");await DP(i);const o=await NP(a),h=new Map(s.spines.map(v=>[v.id,v.assetVersion]));for(const v of s.spines)ql(v.id);s.systems=i,s.colliders=n,s.paths=r,s.spines=a,Object.assign(s.editor,ci(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=p1((c=t.settings)==null?void 0:c.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 b=o.get(v.id);if(v.assetVersion=Math.max(Number(v.assetVersion)||0,h.get(v.id)||0)+1,!b){v.status="empty",v.error=v.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",v.animations=[],v.bones=[],v.selectedAnimation="";continue}Eu(v.id,b),v.dataVersion=b.dataVersion,v.animations=b.animations,v.bones=b.bones,b.animations.some(y=>y.name===v.selectedAnimation)||(v.selectedAnimation=((p=b.animations[0])==null?void 0:p.name)||""),v.status="ready",v.error=""}s.syncSceneSequences(),UP(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 Ew(s,e){return XP(s,Aw(e))}async function VP(s,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return Ew(s,await e.text())}const Ru=Ba({undoCount:0});let Uh=null,sr=null,Gr=[],Jo=null,nr=null,Xh=!1;function kp(s){return{systems:s.systems.map(t=>{const i=ci(t);return i.frames=void 0,i}),colliders:ci(s.colliders),paths:ci(s.paths),spines:ci(s.spines),animations:[...s.timeline.animations],settings:_w(s.settings)}}function Fp(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 Cw(s,e=kp(s),t=Fp(e)){const i=new Map;for(const n of e.spines){const r=HI(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())$I(e);s.spineAssets.clear()}}function Iw(s){for(;Gr.length>s;)Vh(Gr.shift()||null);Ru.undoCount=Gr.length}function Rw(){const s=Uh;if(!s||!sr||Xh)return;const e=kp(s),t=Fp(e);t!==sr.signature&&(Gr.push(sr),sr=Cw(s,e,t),Iw(s.settings.undoLimit))}function YP(){Xh||(nr&&clearTimeout(nr),nr=setTimeout(()=>{nr=null,Rw()},250))}function $P(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 GP(s){var t,i;if(!$P(s)){const n=s.systems[0],r=s.colliders[0],a=s.paths[0],o=s.spines[0];n?(s.activeObjectType="particle",s.activeObjectId=n.id):r?(s.activeObjectType="collision",s.activeObjectId=r.id):a?(s.activeObjectType="path",s.activeObjectId=a.id):(s.activeObjectType="spine",s.activeObjectId=(o==null?void 0:o.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 HP(s,e){const t=sr;Xh=!0;try{for(const i of s.spines)ql(i.id);s.systems=ci(e.data.systems),s.colliders=ci(e.data.colliders),s.paths=ci(e.data.paths),s.spines=ci(e.data.spines),s.timeline.animations=[...e.data.animations],Object.assign(s.settings,ci(e.data.settings));for(const[i,n]of e.spineAssets)Eu(i,n);for(const i of s.systems)i.frames=[];s.timeline.recorded=!1,s.timeline.playing=!1,GP(s),s.recalcTotalFrames(),sr=e}finally{Xh=!1,Vh(t)}}function jP(s){if(!(Uh===s&&Jo)){Jo==null||Jo(),nr&&clearTimeout(nr),Vh(sr);for(const e of Gr)Vh(e);Gr=[],Uh=s,sr=Cw(s),Ru.undoCount=0,Jo=ds(()=>Fp(kp(s)),YP,{flush:"post"})}}function WP(s,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));s.settings.undoLimit=t,Iw(t)}function Af(){const s=Uh;if(!s||!sr)return!1;nr&&(clearTimeout(nr),nr=null),Rw();const e=Gr.pop();return e?(HP(s,e),Ru.undoCount=Gr.length,!0):!1}function zP(s){const e=s instanceof HTMLElement?s:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function qP(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||zP(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]))}La(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),Gl(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const KP={class:"stage-wrap"},ZP={class:"topbar"},JP=["disabled"],QP={class:"tool-group"},ek={class:"tool-group"},tk={key:0,class:"background-panel"},ik=["disabled"],sk=["title"],nk={class:"background-position-row"},rk={class:"background-opacity-row"},ak={class:"zoom-pct"},ok={key:0,class:"settings-panel"},lk={class:"sp-head"},ck={class:"sp-switch-row"},hk={class:"sp-switch-control"},uk={class:"sp-row"},dk={class:"sp-chk"},fk={class:"sp-chk"},mk={class:"sp-row"},pk={class:"sp-row"},gk={class:"sp-chk"},vk={class:"sp-chk"},yk={class:"sp-row"},xk={class:"sp-row"},bk={class:"sp-row"},wk={class:"sp-hex"},Sk={class:"sp-chk"},_k={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},Mk={class:"help-head"},Tk={key:2,class:"hud"},Ak={class:"hud-number hud-system-count"},Ek={class:"hud-number hud-particle-count"},Ck=nn({__name:"Stage",setup(s){const e=Kl(),t=ht(null),i=ht(null),n=ht(!1),r=ht(!1),a=ht(!1),o=ht(null),h=gt(()=>e.settings.backgroundImageName),l=ht(""),c=ht(!1);function u(H){l.value=l.value===H?"":H}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);function d(){e.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),e.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2))}qP({canvasElement:t,canvasFocused:c,undo:Af,save:()=>Tw(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:H=>{l.value=H}});let f=null,p=null,m=null,g=null,v=0,b=null,y=null,w=null,A=null,M=null,_=null,R=null,P=null,F=null,I=null,k=null,B=null,D=[],U=0,L=0,N=0,O=0,X=null,E=null;const V=new Map,q=new Map;let W=[];const J=new Map,K=new Set;let fe=!1;ds(()=>[e.activeObjectType,e.activeObjectId],()=>K.clear());async function me(){if(X&&E)return X;const[H,Y]=await Promise.all([pt.fromURL("/images/star.png"),pt.fromURL("/images/trail.png")]);return X=H,E=Y,X}function we(){p=new ji,f.stage.addChild(p),k=new ji,f.stage.addChild(k),m=new Zr(pt.EMPTY),m.anchor.set(.5),m.visible=!1,p.addChild(m),I=new vs,p.addChild(I),B=new rR,p.addChild(B.container),y=new vs,p.addChild(y),b=new vs,p.addChild(b),A=new vs,p.addChild(A),M=new vs,p.addChild(M),_=new vs,p.addChild(_),R=new vs,p.addChild(R),P=new vs,p.addChild(P),F=new vs,p.addChild(F),w=new vs,p.addChild(w)}function Ee(){r.value=!r.value,r.value&&(n.value=!1)}function ge(){a.value=!0,n.value=!1,r.value=!1}function Te(H){H.key==="Escape"&&a.value&&(a.value=!1)}function G(){n.value=!n.value,n.value&&(r.value=!1)}function Z(H){WP(e,Number(H.target.value))}async function z(H){var ne;const Y=H.target,ee=(ne=Y.files)==null?void 0:ne[0];if(ee)try{e.settings.backgroundImageData=await Jc(ee),e.settings.backgroundImageName=ee.name}catch(ue){console.error("背景图加载失败",ue)}finally{Y.value=""}}async function j(H){const Y=++v;if(!H){m&&(m.texture=pt.EMPTY,m.visible=!1),g&&g.destroy(!0),g=null;return}try{const ee=await pt.fromURL(H);if(Y!==v||!m){ee.destroy(!0);return}const ne=g;g=ee,m.texture=ee,m.visible=!0,ne&&ne.destroy(!0)}catch(ee){console.error("背景图恢复失败",ee)}}function te(H=!0){e.settings.backgroundImageData="",e.settings.backgroundImageName="",o.value&&(o.value.value=""),H&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}function he(H,Y=0){if(H<=0)return 1;const ee=Math.pow(10,Math.floor(Math.log10(H))),ne=[1,2,5,10,20,50,100];let ue=1;for(const pe of ne)if(pe*ee>=H){ue=pe*ee;break}return Math.max(ue,Y)}function ve(){if(!I)return;const H=I;H.clear();const Y=e.settings;if(!Y.tickEnabled){for(const Se of D)Se.visible=!1;return}const ee=0,ne=0,ue=f.screen.width/e.editor.viewScale,pe=f.screen.height/e.editor.viewScale,_e=+("0x"+Y.axisColor.replace("#",""));H.lineStyle(1.5,_e,.35),H.moveTo(-ue,ne),H.lineTo(ue,ne),H.moveTo(ee,-pe),H.lineTo(ee,pe);const Me=e.editor.viewScale,xe=he(50/Me),De=ue,Ie=pe,Be=Math.max(1,Y.tickWidth);if(Y.tickEnabled){for(let Se=0;Se<=ue;Se+=xe){const rt=Math.round(Se/xe)*xe;rt!==0&&(H.lineStyle(Be,_e,.25),H.moveTo(rt,ne-4),H.lineTo(rt,ne+4),H.moveTo(-rt,ne-4),H.lineTo(-rt,ne+4))}for(let Se=0;Se<=pe;Se+=xe)Math.round(Se/xe)*xe!==0&&(H.lineStyle(Be,_e,.25),H.moveTo(ee-4,Se),H.lineTo(ee+4,Se),H.moveTo(ee-4,-Se),H.lineTo(ee+4,-Se))}const Ae=f.screen.width/2+e.editor.viewX,He=f.screen.height*.5+e.editor.viewY,st=Y.axisFontSize,Ze=+("0x"+Y.axisColor.replace("#",""));for(;D.length<64;){const Se=new Mp("",{fontFamily:"monospace",fontSize:st,fill:Ze});Se.anchor.set(.5,.5),k.addChild(Se),D.push(Se)}let nt=0;const Je=Y.showAxisLabels&&Y.tickEnabled;for(let Se=0;Se<=ue;Se+=xe){const rt=Math.round(Se/xe)*xe;if(rt===0||!Je||rt>De)continue;const Pe=D[nt++];if(!Pe)break;Pe.style.fontSize=st,Pe.text=String(rt),Pe.position.set(Ae+rt*Me,He+9),Pe.visible=!0;const Et=D[nt++];if(!Et)break;Et.style.fontSize=st,Et.text=String(-rt),Et.position.set(Ae-rt*Me,He+9),Et.visible=!0}for(let Se=0;Se<=pe;Se+=xe){const rt=Math.round(Se/xe)*xe;if(rt===0||!Je||rt>Ie)continue;const Pe=D[nt++];if(!Pe)break;Pe.style.fontSize=st,Pe.text=String(rt),Pe.position.set(Ae+8,He-Se*Me),Pe.visible=!0;const Et=D[nt++];if(!Et)break;Et.style.fontSize=st,Et.text=String(-rt),Et.position.set(Ae+8,He+Se*Me),Et.visible=!0}for(;nt{e.editor.viewX=ne+(Me.clientX-Y),e.editor.viewY=ue+(Me.clientY-ee)},_e=()=>{window.removeEventListener("pointermove",pe),window.removeEventListener("pointerup",_e),window.removeEventListener("pointercancel",_e)};window.addEventListener("pointermove",pe),window.addEventListener("pointerup",_e),window.addEventListener("pointercancel",_e)}function ae(H,Y){const ee=t.value.getBoundingClientRect(),ne=Math.max(1e-4,e.editor.viewScale),ue=H-ee.left,pe=Y-ee.top;return{x:(ue-f.screen.width/2-e.editor.viewX)/ne,y:-(pe-f.screen.height*.5-e.editor.viewY)/ne}}function Le(H,Y,ee){const ne=H.rotation*Math.PI/180,ue=Math.cos(ne),pe=Math.sin(ne),_e=Math.max(1e-4,Math.abs(H.scaleX??1)),Me=Math.max(1e-4,Math.abs(H.scaleY??1));return{x:H.x+ue*Y*_e-pe*ee*Me,y:H.y+pe*Y*_e+ue*ee*Me}}function Re(H,Y,ee){const ne=H.rotation*Math.PI/180,ue=Math.cos(ne),pe=Math.sin(ne),_e=Math.max(1e-4,Math.abs(H.scaleX??1)),Me=Math.max(1e-4,Math.abs(H.scaleY??1)),xe=Y-H.x,De=ee-H.y;return{x:(ue*xe+pe*De)/_e,y:(-pe*xe+ue*De)/Me}}function Oe(){if(e.activeObjectType!=="path")return null;const H=e.paths.find(Y=>Y.id===e.activeObjectId)||null;return(H==null?void 0:H.visible)===!1?null:H}function tt(H,Y,ee){if(H.points.length<2)return H.points.length;const ne=H.closed?H.points.length:H.points.length-1;let ue=H.points.length,pe=1/0;for(let _e=0;_eMath.hypot(Me.x-ne.x,Me.y-ne.y)<=ue);if(pe>=0){Y.points.splice(pe,1),K.clear();return}const _e=tt(Y,ne.x,ne.y);Y.points.splice(_e,0,{x:ne.x,y:ne.y,inX:0,inY:0,outX:0,outY:0}),K.clear(),K.add(_e)}function Pt(H){const Y=Oe();if(!Y||!Y.enabled)return!1;const ee=ae(H.clientX,H.clientY),ne=Re(Y,ee.x,ee.y),ue=9/Math.max(.01,e.editor.viewScale);if(H.detail>=2){if(Y.points.findIndex(Ie=>Math.hypot(Ie.x-ne.x,Ie.y-ne.y)<=ue)>=0)return!0;const xe={x:ne.x,y:ne.y,inX:0,inY:0,outX:0,outY:0},De=tt(Y,ne.x,ne.y);return Y.points.splice(De,0,xe),K.clear(),K.add(De),fe=!0,wt(Ie=>{const Be=ae(Ie.clientX,Ie.clientY),Ae=Re(Y,Be.x,Be.y);xe.outX=Ae.x-xe.x,xe.outY=Ae.y-xe.y,xe.inX=-xe.outX,xe.inY=-xe.outY}),!0}let pe=null;for(const Me of K){const xe=Y.points[Me];xe&&(Math.hypot(xe.x+xe.inX-ne.x,xe.y+xe.inY-ne.y)<=ue&&(pe={index:Me,side:"in"}),Math.hypot(xe.x+xe.outX-ne.x,xe.y+xe.outY-ne.y)<=ue&&(pe={index:Me,side:"out"}))}if(pe){const Me=Y.points[pe.index],xe=pe.side==="in"?Math.hypot(Me.outX,Me.outY):Math.hypot(Me.inX,Me.inY);return wt(Ie=>{const Be=ae(Ie.clientX,Ie.clientY),Ae=Re(Y,Be.x,Be.y),He=Ae.x-Me.x,st=Ae.y-Me.y;if(pe.side==="in"?(Me.inX=He,Me.inY=st):(Me.outX=He,Me.outY=st),!Ie.altKey){const Ze=Math.max(1e-4,Math.hypot(He,st)),nt=Ie.shiftKey?Ze:xe;pe.side==="in"?(Me.outX=-He/Ze*nt,Me.outY=-st/Ze*nt):(Me.inX=-He/Ze*nt,Me.inY=-st/Ze*nt)}}),!0}const _e=Y.points.findIndex(Me=>Math.hypot(Me.x-ne.x,Me.y-ne.y)<=ue);if(_e>=0){if(H.altKey)return K.delete(_e),!0;H.ctrlKey||H.metaKey?K.add(_e):K.has(_e)||(K.clear(),K.add(_e));const Me=ne,xe=[...K].map(Ie=>({index:Ie,x:Y.points[Ie].x,y:Y.points[Ie].y}));return wt(Ie=>{const Be=ae(Ie.clientX,Ie.clientY),Ae=Re(Y,Be.x,Be.y);for(const He of xe)Y.points[He.index].x=He.x+Ae.x-Me.x,Y.points[He.index].y=He.y+Ae.y-Me.y}),!0}if(H.altKey&&!H.ctrlKey&&!H.metaKey)return K.clear(),!0;if(H.ctrlKey||H.metaKey||H.altKey){const Me=ne,xe=H.altKey,De=Ie=>{const Be=ae(Ie.clientX,Ie.clientY),Ae=Re(Y,Be.x,Be.y),He=Math.min(Me.x,Ae.x),st=Math.max(Me.x,Ae.x),Ze=Math.min(Me.y,Ae.y),nt=Math.max(Me.y,Ae.y);Y.points.forEach((Je,Se)=>{Je.x>=He&&Je.x<=st&&Je.y>=Ze&&Je.y<=nt&&(xe?K.delete(Se):K.add(Se))}),window.removeEventListener("pointerup",De),window.removeEventListener("pointercancel",De)};return window.addEventListener("pointerup",De),window.addEventListener("pointercancel",De),!0}return!1}function wt(H){const Y=()=>{window.removeEventListener("pointermove",H),window.removeEventListener("pointerup",Y),window.removeEventListener("pointercancel",Y)};window.addEventListener("pointermove",H),window.addEventListener("pointerup",Y),window.addEventListener("pointercancel",Y)}function Rt(H){if(e.activeObjectType!=="collision")return!1;const Y=e.colliders.find(nt=>nt.id===e.activeObjectId);if(!(Y!=null&&Y.enabled)||Y.visible===!1)return!1;const ee=ae(H.clientX,H.clientY),ne=Y.rotation*Math.PI/180,ue=Math.cos(ne),pe=Math.sin(ne),_e=Math.max(1e-4,Math.abs(Y.scaleX??1)),Me=Math.max(1e-4,Math.abs(Y.scaleY??1)),xe=ee.x-Y.x,De=ee.y-Y.y,Ie=(ue*xe+pe*De)/_e,Be=(-pe*xe+ue*De)/Me;if(!(Y.shape==="circle"?Math.hypot(Ie,Be)<=Y.radius:Y.shape==="ellipse"?Math.hypot(Ie/Math.max(1,Y.radiusX),Be/Math.max(1,Y.radiusY))<=1:Math.abs(Ie)<=Y.width*.5&&Math.abs(Be)<=Y.height*.5))return!1;const He=Y.x,st=Y.y,Ze=ee;return wt(nt=>{const Je=ae(nt.clientX,nt.clientY);Y.x=He+Je.x-Ze.x,Y.y=st+Je.y-Ze.y}),!0}function Zt(H){const Y=e.systems.find(De=>De.id===e.activeId);if((Y==null?void 0:Y.visible)===!1)return!1;const ee=Y==null?void 0:Y.config;if(!(ee!=null&&ee.forceField)||ee.forceRadius<=0)return!1;const ne=ae(H.clientX,H.clientY);if(Math.hypot(ne.x-ee.forceCenterX,ne.y-ee.forceCenterY)>ee.forceRadius)return!1;const pe=ee.forceCenterX,_e=ee.forceCenterY;t.value&&(t.value.style.cursor="grabbing");const Me=De=>{const Ie=ae(De.clientX,De.clientY);ee.forceCenterX=pe+Ie.x-ne.x,ee.forceCenterY=_e+Ie.y-ne.y},xe=()=>{t.value&&(t.value.style.cursor=""),window.removeEventListener("pointermove",Me),window.removeEventListener("pointerup",xe),window.removeEventListener("pointercancel",xe)};return window.addEventListener("pointermove",Me),window.addEventListener("pointerup",xe),window.addEventListener("pointercancel",xe),H.preventDefault(),!0}function Fi(H){const Y=e.systems.find(Ie=>Ie.id===e.activeId);if((Y==null?void 0:Y.visible)===!1)return!1;const ee=Y==null?void 0:Y.config;if(!(ee!=null&&ee.attraction))return!1;const ne=ae(H.clientX,H.clientY),ue=Math.max(ee.attractionRadius,12/Math.max(1e-4,e.editor.viewScale));if(Math.hypot(ne.x-ee.attractionCenterX,ne.y-ee.attractionCenterY)>ue)return!1;const _e=ee.attractionCenterX,Me=ee.attractionCenterY;t.value&&(t.value.style.cursor="grabbing");const xe=Ie=>{const Be=ae(Ie.clientX,Ie.clientY);ee.attractionCenterX=_e+Be.x-ne.x,ee.attractionCenterY=Me+Be.y-ne.y},De=()=>{t.value&&(t.value.style.cursor=""),window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",De),window.removeEventListener("pointercancel",De)};return window.addEventListener("pointermove",xe),window.addEventListener("pointerup",De),window.addEventListener("pointercancel",De),H.preventDefault(),!0}function Oi(){const H=e.activeObjectId;if(e.activeObjectType==="particle"){const ne=e.systems.find(pe=>pe.id===H);if(!ne||ne.visible===!1)return null;const ue=ne.config;return{x:ue.centerX,y:ue.centerY,rotation:ue.rootRotation,scaleX:ue.rootScaleX??1,scaleY:ue.rootScaleY??1,setPosition:(pe,_e)=>{ue.centerX=pe,ue.centerY=_e},setRotation:pe=>{ue.rootRotation=pe},setScale:(pe,_e)=>{ue.rootScaleX=pe,ue.rootScaleY=_e}}}const ee=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(ne=>ne.id===H);return!ee||ee.visible===!1?null:{x:Number(ee.x)||0,y:Number(ee.y)||0,rotation:Number(ee.rotation)||0,scaleX:Math.max(.05,Number(ee.scaleX)||1),scaleY:Math.max(.05,Number(ee.scaleY)||1),setPosition:(ne,ue)=>{ee.x=ne,ee.y=ue},setRotation:ne=>{ee.rotation=ne},setScale:(ne,ue)=>{ee.scaleX=ne,ee.scaleY=ue}}}function Wi(H){const Y=Oi();if(!Y)return;const ee=e.editor.viewScale,ne=t.value.getBoundingClientRect(),ue=ne.left+f.screen.width/2+e.editor.viewX+Y.x*ee,pe=ne.top+f.screen.height*.5+e.editor.viewY+-Y.y*ee,_e=H.clientX,Me=H.clientY,xe=l.value,De=Y.x,Ie=Y.y,Be=Y.rotation,Ae=Y.scaleX,He=Y.scaleY,st=Math.hypot(_e-ue,Me-pe)||1,Ze=Math.atan2(Me-pe,_e-ue),nt=Se=>{const rt=(Se.clientX-_e)/ee,Pe=(Se.clientY-Me)/ee;if(xe==="translate")Y.setPosition(De+rt,Ie-Pe);else if(xe==="rotate"){const Et=Math.atan2(Se.clientY-pe,Se.clientX-ue);Y.setRotation(Be-(Et-Ze)*180/Math.PI)}else if(xe==="scale"){const Vt=Math.hypot(Se.clientX-ue,Se.clientY-pe)/st;Y.setScale(Math.max(.05,Ae*Vt),Math.max(.05,He*Vt))}},Je=()=>{window.removeEventListener("pointermove",nt),window.removeEventListener("pointerup",Je),window.removeEventListener("pointercancel",Je)};window.addEventListener("pointermove",nt),window.addEventListener("pointerup",Je),window.addEventListener("pointercancel",Je)}function on(){ce(1.2)}function yi(){ce(1/1.2)}function ce(H){const Y=Math.max(.01,e.editor.viewScale*H);e.editor.viewScale=Y}function de(){e.editor.viewScale=1,e.editor.viewX=0,e.editor.viewY=0}function kt(){e.editor.viewScale=1,e.editor.viewX=0,e.editor.viewY=0}function zt(){e.settings.showGrid=!e.settings.showGrid}function Jt(){if(p){for(const[H,Y]of V){const ee=e.systems.find(ne=>ne.id===H);(!ee||q.get(H)!==ee.config)&&(p.removeChild(Y),Y.destroy({children:!0}),V.delete(H),q.delete(H))}for(const H of e.systems){X&&!H.config.texture&&(H.config.texture=X);const Y=zr(H.config);if(E)for(const ne of Y.trailResources)!ne.texture&&(ne.previewUrl==="/images/trail.png"||ne.previewUrl==="/trails/trail.png")&&(ne.texture=E);if(X)for(const ne of Y.imageResources)!ne.texture&&ne.textureName==="star"&&(ne.texture=X);if(V.has(H.id))continue;const ee=new LI(H.config);ee.setEmitterPos(()=>({x:H.config.centerX,y:H.config.centerY})),p.addChild(ee),V.set(H.id,ee),q.set(H.id,H.config)}}}function mt(){if(!b)return;const H=b;if(H.clear(),!!e.settings.showEmitter&&e.systems.length)for(const Y of e.systems){if(Y.visible===!1)continue;const ee=J.get(Y.id),ne=(ee==null?void 0:ee.x)??Y.config.centerX??0,ue=-((ee==null?void 0:ee.y)??Y.config.centerY??0),pe=e.activeObjectType==="particle"&&Y.id===e.activeId,_e=pe?16763955:9082040,Me=pe?.4:.2;H.lineStyle(1,_e,Me),H.drawCircle(ne,ue,10),H.beginFill(_e,pe?.8:.4),H.drawCircle(ne,ue,3),H.endFill(),H.lineStyle(1,_e,pe?.3:.15),H.moveTo(ne-16,ue),H.lineTo(ne+16,ue),H.moveTo(ne,ue-16),H.lineTo(ne,ue+16)}}function Cs(){var ee;if(!y)return;const H=y;(ee=H.parent)==null||ee.addChild(H),H.clear();const Y=new Map;for(const ne of e.spines)ne.visible===!1||!ne.selectedBone||ne.status!=="ready"||Y.set(`${ne.id}:${ne.selectedBone}`,{spineId:ne.id,boneName:ne.selectedBone});for(const ne of e.systems){if(ne.visible===!1)continue;const ue=ne.config;if(!ue.emitterFollow||ue.emitterFollowMode!=="bone"||!ue.emitterFollowSpineId||!ue.emitterFollowBoneName)continue;const pe=e.spines.find(_e=>_e.id===ue.emitterFollowSpineId);!pe||pe.visible===!1||Y.set(`${ue.emitterFollowSpineId}:${ue.emitterFollowBoneName}`,{spineId:ue.emitterFollowSpineId,boneName:ue.emitterFollowBoneName})}for(const ne of Y.values()){const ue=B==null?void 0:B.getBoneWorldTransform(ne.spineId,ne.boneName);if(!ue)continue;const pe=ue.x,_e=-ue.y;H.lineStyle(2,12881151,.95),H.beginFill(12881151,.2),H.drawCircle(pe,_e,8),H.endFill(),H.beginFill(15919103,1),H.drawCircle(pe,_e,3.5),H.endFill()}}function Xs(){if(!A)return;const H=A;if(H.clear(),!e.settings.showEmitter)return;const Y=e.systems.find(Ze=>Ze.id===e.activeId);if(!Y||Y.visible===!1)return;const ee=Y.config,ne=J.get(Y.id),ue=(ne==null?void 0:ne.x)??ee.centerX??0,pe=-((ne==null?void 0:ne.y)??ee.centerY??0),_e=ee.shape;if(_e==="point"||_e==="path")return;const Me=ee.rootScaleX??1,xe=ee.rootScaleY??1,De=-((ne==null?void 0:ne.rotation)??ee.rootRotation??0)*Math.PI/180,Ie=Math.cos(De),Be=Math.sin(De),Ae=ee.offsetX??0,He=ee.offsetY??0,st=(Ze,nt)=>{const Je=Ze+Ae,Se=-nt-He,rt=Je*Me,Pe=Se*xe;return[ue+rt*Ie-Pe*Be,pe+(rt*Be+Pe*Ie)]};if(_e==="circle"){const Ze=Rh(ee.innerRadius,ee.outerRadius);H.lineStyle(2,3991658,.7);const nt=48;for(const Je of[Ze.outer,Ze.inner])if(!(Je<=0))for(let Se=0;Se<=nt;Se++){const rt=Se/nt*Math.PI*2,[Pe,Et]=st(Math.cos(rt)*Je,Math.sin(rt)*Je);Se===0?H.moveTo(Pe,Et):H.lineTo(Pe,Et)}}else if(_e==="rect"){const Ze=d1(ee);H.lineStyle(2,4885759,.7);for(const[nt,Je]of[[Ze.outerW,Ze.outerH],[Ze.innerW,Ze.innerH]]){if(nt<=0||Je<=0)continue;const Se=nt/2,rt=Je/2,Pe=st(-Se,-rt),Et=st(Se,-rt),Vt=st(Se,rt),ui=st(-Se,rt);H.moveTo(Pe[0],Pe[1]),H.lineTo(Et[0],Et[1]),H.lineTo(Vt[0],Vt[1]),H.lineTo(ui[0],ui[1]),H.lineTo(Pe[0],Pe[1])}}else if(_e==="cone"){const Ze=Rh(ee.innerRadius,ee.outerRadius),nt=ee.coneAngle/2*Math.PI/180,Je=ee.coneDirection*Math.PI/180,Se=st(Math.cos(Je-nt)*Ze.inner,Math.sin(Je-nt)*Ze.inner),rt=st(Math.cos(Je+nt)*Ze.inner,Math.sin(Je+nt)*Ze.inner),Pe=st(Math.cos(Je-nt)*Ze.outer,Math.sin(Je-nt)*Ze.outer),Et=st(Math.cos(Je+nt)*Ze.outer,Math.sin(Je+nt)*Ze.outer);H.lineStyle(2,3991658,.7),H.moveTo(Se[0],Se[1]),H.lineTo(Pe[0],Pe[1]),H.moveTo(rt[0],rt[1]),H.lineTo(Et[0],Et[1]),H.lineStyle(1,3991658,.5);const Vt=24;for(const ui of[Ze.outer,Ze.inner])if(!(ui<=0))for(let Xi=0;Xi<=Vt;Xi++){const ns=Je-nt+2*nt*Xi/Vt,[$,S]=st(Math.cos(ns)*ui,Math.sin(ns)*ui);Xi===0?H.moveTo($,S):H.lineTo($,S)}}}function Ui(){if(!M)return;const H=M;H.clear();const Y=e.systems.find(_e=>_e.id===e.activeId);if((Y==null?void 0:Y.visible)===!1)return;const ee=Y==null?void 0:Y.config;if(!(ee!=null&&ee.forceField)||ee.forceRadius<=0)return;const ne=ee.forceCenterX,ue=-ee.forceCenterY,pe=ee.forceStrength>=0?5818367:16739194;H.lineStyle(2,pe,.85),H.beginFill(pe,.08),H.drawCircle(ne,ue,ee.forceRadius),H.endFill(),H.lineStyle(1,pe,.7),H.moveTo(ne-9,ue),H.lineTo(ne+9,ue),H.moveTo(ne,ue-9),H.lineTo(ne,ue+9),H.beginFill(pe,.95),H.drawCircle(ne,ue,4),H.endFill()}function Is(){if(!_)return;const H=_;H.clear();const Y=e.systems.find(Me=>Me.id===e.activeId);if((Y==null?void 0:Y.visible)===!1)return;const ee=Y==null?void 0:Y.config;if(!(ee!=null&&ee.attraction))return;const ne=ee.attractionCenterX,ue=-ee.attractionCenterY,pe=Math.max(0,ee.attractionRadius),_e=16731487;pe>0&&(H.lineStyle(2,_e,.95),H.beginFill(_e,.09),H.drawCircle(ne,ue,pe),H.endFill()),H.lineStyle(1,_e,.85),H.moveTo(ne-10,ue),H.lineTo(ne+10,ue),H.moveTo(ne,ue-10),H.lineTo(ne,ue+10),H.beginFill(_e,1),H.drawCircle(ne,ue,pe>0?4:6),H.endFill()}function xr(){if(!F)return;const H=F;if(H.clear(),!l.value)return;const Y=Oi();if(!Y)return;const ee=Y.x,ne=-Y.y,ue=Y.scaleX,pe=Y.scaleY,_e=-Y.rotation*Math.PI/180,Me=Math.cos(_e),xe=Math.sin(_e),De=(Ae,He)=>{const st=Ae*ue,Ze=-He*pe;return[ee+st*Me-Ze*xe,ne+(st*xe+Ze*Me)]},Ie=(Ae,He,st,Ze)=>{const nt=De(Ae,He),Je=De(st,Ze);H.moveTo(nt[0],nt[1]),H.lineTo(Je[0],Je[1])},Be=26;if(H.lineStyle(2,3526911,.9),H.beginFill(3526911,.25),H.drawCircle(ee,ne,6),H.endFill(),l.value==="translate")H.lineStyle(2,3526911,.9),Ie(-Be,0,Be,0),Ie(0,-Be,0,Be),Ie(Be-6,-4,Be,0),Ie(Be,0,Be-6,4),Ie(-20,-4,-Be,0),Ie(-Be,0,-20,4),Ie(-4,Be-6,0,Be),Ie(0,Be,4,Be-6),Ie(-4,-20,0,-Be),Ie(0,-Be,4,-20);else if(l.value==="rotate"){H.lineStyle(2,3526911,.8);const Ae=48;for(let Ze=0;Ze<=Ae;Ze++){const nt=Ze/Ae*Math.PI*2,[Je,Se]=De(Math.cos(nt)*Be,Math.sin(nt)*Be);Ze===0?H.moveTo(Je,Se):H.lineTo(Je,Se)}const[He,st]=De(0,Be);H.beginFill(3526911,.95),H.drawCircle(He,st,4),H.endFill()}else if(l.value==="scale"){H.lineStyle(2,3526911,.9);const He=[[-Be,-Be],[Be,-Be],[Be,Be],[-Be,Be]].map(([st,Ze])=>De(st,Ze));H.moveTo(He[0][0],He[0][1]),H.lineTo(He[1][0],He[1][1]),H.lineTo(He[2][0],He[2][1]),H.lineTo(He[3][0],He[3][1]),H.lineTo(He[0][0],He[0][1]),H.beginFill(3526911,.9);for(const st of He)H.drawRect(st[0]-3,st[1]-3,6,6);H.endFill()}}function ln(H,Y,ee,ne){var _e;const ue=Number.isFinite(Y.worldX)&&Number.isFinite(Y.worldY),pe=Number.isFinite(Y.worldRotation);H.push({boneName:Y.boneName,x:ue?Y.worldX:Y.x,y:ue?-Y.worldY:Y.y,rotation:pe?-Y.worldRotation:-Y.rotation,parentX:ee,parentY:ne}),(_e=Y.trailState)!=null&&_e.bones.length&&Y.trailState.bones.forEach(Me=>{const xe=Number.isFinite(Me.worldX)&&Number.isFinite(Me.worldY),De=Number.isFinite(Me.worldRotation);H.push({boneName:Me.boneName,x:xe?Me.worldX:Me.x,y:xe?-Me.worldY:Me.y,rotation:De?-Me.worldRotation:Me.rotation,parentX:ee,parentY:ne,trail:!0})})}function zi(H,Y,ee,ne,ue,pe,_e,Me){const xe=pe*.62,De=Y+ne*pe,Ie=ee+ue*pe,Be=Math.max(2.5,pe*.32),Ae=Math.max(1.7,pe*.22),He=De-ne*Be,st=Ie-ue*Be,Ze=-ue,nt=ne;H.lineStyle(_e,Me,.95),H.moveTo(Y-ne*xe,ee-ue*xe),H.lineTo(He,st),H.lineStyle(0),H.beginFill(Me,.95),H.drawPolygon([De,Ie,He+Ze*Ae,st+nt*Ae,He-Ze*Ae,st-nt*Ae]),H.endFill()}function Ya(H){if(!w)return;const Y=w;if(Y.clear(),!e.settings.showBones)return;const ee=0,ne=0,ue=Math.max(.25,Math.abs(e.editor.viewScale)||1),pe=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),_e=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2)),Me=2.5*pe/ue,xe=4.5*_e/ue,De=Math.max(.65,_e*.625)/ue;for(const Ie of H){const Be=Ie.trail?16731533:16747610;Y.lineStyle(1,Be,Ie.trail?.65:.35),Y.moveTo(Ie.parentX??ee,Ie.parentY??ne),Y.lineTo(Ie.x,Ie.y);const Ae=Ie.rotation*Math.PI/180,He=Math.cos(Ae),st=Math.sin(Ae);zi(Y,Ie.x,Ie.y,He,st,xe,De,15684432),zi(Y,Ie.x,Ie.y,st,-He,xe,De,5622123),Y.beginFill(Be,.9),Y.drawCircle(Ie.x,Ie.y,Me),Y.endFill()}}function $a(H,Y=16777215){const ee=Number.parseInt(H.replace("#",""),16);return Number.isFinite(ee)?ee:Y}function Qr(){if(!R)return;const H=R;H.clear();for(const Y of W){if(Y.visible===!1)continue;const ee=e.activeObjectType==="collision"&&e.activeObjectId===Y.id,ne=Y.enabled?ee?16735858:13911899:5792116,ue=Y.rotation*Math.PI/180,pe=Math.cos(ue),_e=Math.sin(ue),Me=Math.max(1e-4,Math.abs(Y.scaleX??1)),xe=Math.max(1e-4,Math.abs(Y.scaleY??1)),De=(Ae,He)=>({x:Y.x+pe*Ae*Me-_e*He*xe,y:-(Y.y+_e*Ae*Me+pe*He*xe)});let Ie=[];if(Y.shape==="circle"||Y.shape==="ellipse"){const Ae=Y.shape==="circle"?Y.radius:Y.radiusX,He=Y.shape==="circle"?Y.radius:Y.radiusY;Ie=Array.from({length:49},(st,Ze)=>{const nt=Ze/48*Math.PI*2;return De(Math.cos(nt)*Ae,Math.sin(nt)*He)})}else if(Y.shape==="rect"){const Ae=Y.width*.5,He=Y.height*.5;Ie=[De(-Ae,-He),De(Ae,-He),De(Ae,He),De(-Ae,He),De(-Ae,-He)]}else{const Ae=Math.max(3,Math.min(16,Math.round(Y.sides)));Ie=Array.from({length:Ae+1},(He,st)=>{const Ze=Math.PI*.5+st%Ae/Ae*Math.PI*2;return De(Math.cos(Ze)*Y.width*.5,Math.sin(Ze)*Y.height*.5)})}if(!Ie.length)continue;H.lineStyle(ee?2.5:1.5,ne,Y.enabled?.95:.45),H.beginFill(ne,ee?.12:.055),H.moveTo(Ie[0].x,Ie[0].y);for(let Ae=1;Ae{const Ie=Le(Y,xe,De);return{x:Ie.x,y:-Ie.y}},pe=Y.points[0],_e=ue(pe.x,pe.y);H.lineStyle(ee?2.5:1.8,ne,ee?1:.75),H.moveTo(_e.x,_e.y);const Me=Y.closed?Y.points.length:Y.points.length-1;for(let xe=0;xe{const Ie=ue(xe.x,xe.y),Be=ue(xe.x+xe.inX,xe.y+xe.inY),Ae=ue(xe.x+xe.outX,xe.y+xe.outY),He=Math.hypot(xe.inX,xe.inY)>.01,st=Math.hypot(xe.outX,xe.outY)>.01;H.lineStyle(1,11121867,.65),He&&(H.moveTo(Ie.x,Ie.y),H.lineTo(Be.x,Be.y)),st&&(H.moveTo(Ie.x,Ie.y),H.lineTo(Ae.x,Ae.y)),He&&(H.beginFill(14015724,.95),H.drawCircle(Be.x,Be.y,3),H.endFill()),st&&(H.beginFill(14015724,.95),H.drawCircle(Ae.x,Ae.y,3),H.endFill()),H.beginFill(K.has(De)?16777215:ne,1),H.lineStyle(1.5,K.has(De)?6126847:16777215,.95),H.drawCircle(Ie.x,Ie.y,K.has(De)?5:4),H.endFill()})}}function bs(H,Y,ee="linear"){if(!H.length)return Y;const ne=[...H].sort((ue,pe)=>ue.x-pe.x);if(Y<=ne[0].x)return ne[0].y;for(let ue=1;ue{if(!Y.followPath||!Y.followPathId)return Y;const ee=e.paths.find(De=>De.id===Y.followPathId&&De.enabled);if(!(ee!=null&&ee.points.length))return Y;const ne=Math.max(.05,Number(Y.followDuration)||2),ue=Math.min(1,Math.max(0,H/ne)),pe=Array.isArray(Y.followCurve)?Y.followCurve:[{x:0,y:0},{x:1,y:1}],_e=Y.followCurveMode==="跟随导出"?e.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":Y.followCurveMode==="贝塞尔"?"bezier":"linear",Me=Math.min(1,Math.max(0,bs(pe,ue,_e))),xe=xf(ee,Me);return xe?{...Y,x:xe.x,y:xe.y,rotation:Y.rotation+(Y.followPathRotation?xe.angle:0)}:Y})}function un(H,Y,ee,ne=Math.max(1e-4,Math.abs(H.rootScaleX)),ue=Math.max(1e-4,Math.abs(H.rootScaleY))){const pe=-H.rootRotation*Math.PI/180,_e=Math.cos(pe),Me=Math.sin(pe),xe=Y-H.centerX,De=-ee+H.centerY;return{x:(_e*xe+Me*De)/ne,y:(-Me*xe+_e*De)/ue}}function Ga(H,Y,ee){const ne=xf(Y,ee);if(!ne)return null;const ue=un(H,ne.x,ne.y),pe=ne.angle*Math.PI/180,_e=un(H,ne.x+Math.cos(pe),ne.y+Math.sin(pe)),Me=Math.atan2(_e.y-ue.y,_e.x-ue.x)*180/Math.PI;return{...ue,angle:Me}}function br(){var ee,ne,ue;O=requestAnimationFrame(br);const H=performance.now()/1e3;let Y=H-U;if(U=H,Y>.1&&(Y=.1),f&&p){p.scale.set(e.editor.viewScale),p.position.set(f.screen.width/2+e.editor.viewX,f.screen.height*.5+e.editor.viewY),m&&(m.position.set(Number(e.settings.backgroundX)||0,-(Number(e.settings.backgroundY)||0)),m.alpha=Math.min(1,Math.max(0,Number(e.settings.backgroundOpacity)||0))),ve(),Jt();const pe=Math.max(1,e.timeline.fps),_e=e.timeline.frame,Me=_e/pe;B==null||B.sync(e.spines,_e,pe),Xn(Me);for(const Je of e.systems){const Se=V.get(Je.id);if(!Se)continue;Se.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const rt=Je.visible!==!1;Se.visible=rt,Se.renderable=rt;const Pe=Je.config;Se.scale.set(Pe.rootScaleX,Pe.rootScaleY);const Et=new Set(Pe.collisionColliderIds);Se.setColliders(Pe.collision?W.filter(It=>Et.has(It.id)):[]),Se.setEmitterFollowSpawn(0,0,0);let Vt={x:Pe.centerX,y:Pe.centerY,rotation:Pe.rootRotation};const ui=Pe.emitterFollow&&Pe.emitterFollowMode==="bone"?e.spines.find(It=>It.id===Pe.emitterFollowSpineId&&It.enabled&&It.status==="ready"):null,Xi=ui&&(B==null?void 0:B.getBoneWorldTransform(ui.id,Pe.emitterFollowBoneName))||null,ns=Pe.emitterFollow&&Pe.emitterFollowMode==="path"?e.paths.find(It=>It.id===Pe.emitterFollowPathId&&It.enabled):null,$=Math.max(.05,Pe.emitterFollowDuration),S=Math.min(1,Math.max(0,Me/$)),C=Math.min(1,Math.max(0,bs(Pe.emitterFollowCurve,S))),Q=Math.min(1,Math.max(0,Pe.emitterFollowOffset)),Fe=Pe.emitterFollowDirection==="reverse"?(1-Q)*(1-C):Q+(1-Q)*C,ct=ns?xf(ns,Fe):null;if(Xi){const It=Pe.emitterFollowBoneOffsetX,Ht=Pe.emitterFollowBoneOffsetY,qi=Xi.x+It,Ha=Xi.y+Ht,tc=Pe.rootRotation+Pe.emitterFollowBoneRotation,Vo=Math.max(1e-4,Math.abs(Pe.rootScaleX*Pe.emitterFollowBoneScaleX)),Yo=Math.max(1e-4,Math.abs(Pe.rootScaleY*Pe.emitterFollowBoneScaleY));if(Vt={x:qi,y:Ha,rotation:tc},Pe.emitterFollowSpace==="local")Se.position.set(qi,-Ha),Se.rotation=-tc*Math.PI/180,Se.scale.set(Vo,Yo),Se.setSimulationTransform(qi,Ha,tc,Vo,Yo);else{Se.position.set(Pe.centerX,-Pe.centerY),Se.rotation=-Pe.rootRotation*Math.PI/180,Se.scale.set(Vo,Yo),Se.setSimulationTransform(Pe.centerX,Pe.centerY,Pe.rootRotation,Vo,Yo);const Yp=un(Pe,qi,Ha,Vo,Yo),ES=-(tc-Pe.rootRotation);Se.setEmitterFollowSpawn(Yp.x,Yp.y,ES)}}else if(ct){const It=ct.angle+(Pe.emitterFollowDirection==="reverse"?180:0),Ht=Pe.emitterAngleMode==="direction"?It:Pe.rootRotation;if(Vt={x:ct.x,y:ct.y,rotation:Ht},Pe.emitterFollowSpace==="local")Se.position.set(ct.x,-ct.y),Se.rotation=-Ht*Math.PI/180,Se.setSimulationTransform(ct.x,ct.y,Ht);else{Se.position.set(Pe.centerX,-Pe.centerY),Se.rotation=-Pe.rootRotation*Math.PI/180,Se.setSimulationTransform(Pe.centerX,Pe.centerY,Pe.rootRotation);const qi=un(Pe,ct.x,ct.y),Ha=Pe.emitterAngleMode==="direction"?-(It-Pe.rootRotation):0;Se.setEmitterFollowSpawn(qi.x,qi.y,Ha)}}else Se.position.set(Pe.centerX,-Pe.centerY),Se.rotation=-Pe.rootRotation*Math.PI/180,Se.setSimulationTransform(Pe.centerX,Pe.centerY,Pe.rootRotation);const Ct=Pe.shape==="path"&&Pe.spawnPathId>0&&e.paths.find(It=>It.id===Pe.spawnPathId&&It.enabled&&It.points.length>0)||null;Se.setSpawnPathSampler(Ct?It=>Ga(Pe,Ct,It):null,(Ct==null?void 0:Ct.closed)===!0),J.set(Je.id,Vt)}let xe=0;const De=[],Ie=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,Be=(Je,Se,rt)=>{!Je||Je.id!==Ie||Je.visible===!1||ln(De,rt,Se.position.x,Se.position.y)},Ae=e.timeline,He=Ae.fps,st=1/Math.max(1,He);let Ze=N,nt=0;if(Ae.playing?(L+=Y,nt=Math.floor(L/st),nt>0&&(L-=nt*st)):L=0,Ae.playing&&nt>0)for(let Je=0;JeVt.id===e.activeId),rt=(Se==null?void 0:Se.config.mode)==="stream"&&Se.config.streamBehavior==="loop"?v1(Se.config,He):null,Et=Ae.loop&&(rt==null?void 0:rt.start)===Ae.playbackStart&&rt.end===Ae.playbackEnd?Ae.playbackEnd-1:Ae.playbackEnd;if(Ae.frame>Et)if(Ae.loop)Ae.frame=Ae.playbackStart;else{Ae.frame=Ae.playbackEnd,Ae.playing=!1;break}}else{if(Ae.frame===0)for(const Se of e.systems){const rt=V.get(Se.id);rt&&(Se.config.mode==="stream"&&Se.config.streamBehavior==="loop"?nR(Se,rt,He,Ae.totalFrames):rt.reset())}for(const[Se,rt]of V){const Pe=e.systems.find(ns=>ns.id===Se),Et=(Pe==null?void 0:Pe.config.mode)==="stream"&&Pe.config.streamBehavior==="loop",Vt=Et?(ee=Pe.frames)==null?void 0:ee[Ae.frame]:void 0,ui=Ae.frame===0&&!Et,Xi=ui?[]:Vt||rt.update(st);if(ui?rt.apply([]):Vt&&rt.apply(Vt),(Pe==null?void 0:Pe.visible)!==!1)for(const ns of Xi)ns.active&&Be(Pe,rt,ns);xe+=Xi.length}for(const Se of e.systems){if(!Se.config.texture)continue;Se.frames=Se.frames||[];const rt=V.get(Se.id);rt&&!(Se.config.mode==="stream"&&Se.config.streamBehavior==="loop")&&(Se.frames[Ae.frame]=rt.capture())}Ae.frame++,Ae.frame>=Ae.totalFrames&&(Ae.frame=Ae.playbackStart,Ae.recorded=!0)}else{Ae.playing||(Ze=Ae.frame);for(const Je of e.systems){const Se=V.get(Je.id),rt=Ae.playing?N:Ae.frame,Pe=(ue=Je.frames)==null?void 0:ue[rt],Et=Je.config.mode==="stream"&&Je.config.streamBehavior==="loop"&&!!Pe;if((Ae.recorded||Et)&&Se&&Pe){Se.apply(Pe);for(const Vt of Pe)Vt.active&&(Be(Je,Se,Vt),xe++)}else if(Se){const Vt=Ae.frame===0?[]:Se.update(0);if(Ae.frame===0&&Se.apply([]),Je.visible!==!1)for(const ui of Vt)ui.active&&Be(Je,Se,ui);xe+=Se.activeCount}}}N=Ze,B==null||B.sync(e.spines,Ze,He);for(const[,Je]of V)Je.drawTrailMeshDebug(e.settings.showSkinMesh);Qr(),cn(),Cs(),mt(),Xs(),Ui(),Is(),xr(),Ya(De),i.value&&(i.value.systems=e.systems.length,i.value.particles=xe)}}return La(async()=>{window.addEventListener("keydown",Te);const H=t.value;f=new $b({width:H.clientWidth||800,height:H.clientHeight||600,backgroundAlpha:0,antialias:!0}),H.appendChild(f.view),we(),ds(()=>e.settings.backgroundImageData,j,{immediate:!0}),await me();const Y=X;for(const ee of e.systems){ee.config.texture=Y;const ne=zr(ee.config);if(E)for(const ue of ne.trailResources)!ue.texture&&(ue.previewUrl==="/images/trail.png"||ue.previewUrl==="/trails/trail.png")&&(ue.texture=E);for(const ue of ne.imageResources)!ue.texture&&ue.textureName==="star"&&(ue.texture=Y)}i.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,L=0,N=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const ee of e.systems)ee.frames=[];e.recalcTotalFrames(),U=performance.now()/1e3,br(),ds(()=>e.systems.map(ee=>JSON.stringify(ee.config,(ne,ue)=>ne==="texture"||ne==="trailTexture"||ne==="previewUrl"?void 0:ue)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const ee of e.systems)ee.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),jP(e)}),Gl(()=>{window.removeEventListener("keydown",Te),cancelAnimationFrame(O),B==null||B.destroy(),B=null,v++,g&&g.destroy(!0),g=null,m=null,f&&(f.destroy(!0,{children:!0}),f=null)}),(H,Y)=>(ie(),oe("div",KP,[T("div",{ref_key:"holder",ref:t,class:ot(["stage-holder",{grid:ke(e).settings.showGrid}]),tabindex:"0",onWheel:xt(le,["prevent"]),onPointerdown:ye,onDblclick:xt(St,["prevent"])},null,34),T("div",ZP,[T("button",{class:"settings-btn",onClick:G,title:"系统设置"},"系统设置"),T("button",{class:"undo-btn",disabled:ke(Ru).undoCount===0,onClick:Y[0]||(Y[0]=(...ee)=>ke(Af)&&ke(Af)(...ee)),title:"撤回上一步 (Ctrl+Z)"},"↶",8,JP),T("div",QP,[T("button",{class:ot(["tool-btn",{on:l.value===""}]),onClick:Y[1]||(Y[1]=ee=>u("")),title:"拖动画布 (Q)"},"✋",2),T("button",{class:ot(["tool-btn",{on:l.value==="translate"}]),onClick:Y[2]||(Y[2]=ee=>u("translate")),title:"位移 (W)"},"✥",2),T("button",{class:ot(["tool-btn",{on:l.value==="rotate"}]),onClick:Y[3]||(Y[3]=ee=>u("rotate")),title:"旋转 (E)"},"⟳",2),T("button",{class:ot(["tool-btn",{on:l.value==="scale"}]),onClick:Y[4]||(Y[4]=ee=>u("scale")),title:"缩放 (R)"},"⤢",2)]),T("div",ek,[T("button",{class:"tool-btn",onClick:on,title:"放大"},"+"),T("button",{class:"tool-btn",onClick:yi,title:"缩小"},"-"),T("button",{class:"tool-btn",onClick:de,title:"适配画布"},"⤢"),T("button",{class:ot(["tool-btn",{on:ke(e).settings.showGrid}]),onClick:zt,title:"切换网格"},"▦",2),T("button",{class:"tool-btn",onClick:kt,title:"重置视图"},"⟳")]),T("div",{class:"background-menu",onClick:Y[10]||(Y[10]=xt(()=>{},["stop"]))},[T("button",{class:ot(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:Ee},"背景图",2),r.value?(ie(),oe("div",tk,[T("button",{class:"background-upload",onClick:Y[5]||(Y[5]=ee=>{var ne;return(ne=o.value)==null?void 0:ne.click()})},je(h.value?"更换图像":"上传图像"),1),T("button",{class:"background-clear",disabled:!h.value,onClick:Y[6]||(Y[6]=ee=>te())},"清除背景",8,ik),T("input",{ref_key:"backgroundFileInput",ref:o,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:z},null,544),T("div",{class:"background-file-name",title:h.value},je(h.value||"未上传图像"),9,sk),T("div",nk,[T("label",null,[Y[28]||(Y[28]=T("span",null,"X",-1)),be(T("input",{"onUpdate:modelValue":Y[7]||(Y[7]=ee=>ke(e).settings.backgroundX=ee),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[ut,ke(e).settings.backgroundX,void 0,{number:!0}]])]),T("label",null,[Y[29]||(Y[29]=T("span",null,"Y",-1)),be(T("input",{"onUpdate:modelValue":Y[8]||(Y[8]=ee=>ke(e).settings.backgroundY=ee),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[ut,ke(e).settings.backgroundY,void 0,{number:!0}]])])]),T("label",rk,[Y[30]||(Y[30]=T("span",null,"透明度",-1)),be(T("input",{"onUpdate:modelValue":Y[9]||(Y[9]=ee=>ke(e).settings.backgroundOpacity=ee),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[ut,ke(e).settings.backgroundOpacity,void 0,{number:!0}]]),T("b",null,je(Math.round(ke(e).settings.backgroundOpacity*100))+"%",1)])])):Xe("",!0)]),T("button",{class:ot(["help-btn",{on:a.value}]),title:"查看使用说明",onClick:ge},"使用说明",2),T("span",ak,je(Math.round(ke(e).editor.viewScale*100))+"%",1)]),n.value?(ie(),oe("div",ok,[T("div",lk,[Y[31]||(Y[31]=ri("系统设置 ",-1)),T("button",{class:"sp-close",onClick:Y[11]||(Y[11]=ee=>n.value=!1)},"✕")]),Y[45]||(Y[45]=T("div",{class:"sp-section-title"},"界面布局",-1)),T("label",ck,[Y[33]||(Y[33]=T("span",null,"参数面板位置",-1)),T("span",hk,[be(T("input",{type:"checkbox","onUpdate:modelValue":Y[12]||(Y[12]=ee=>ke(e).settings.parameterPanelOnRight=ee),"aria-label":"参数面板显示在右侧"},null,512),[[ei,ke(e).settings.parameterPanelOnRight]]),Y[32]||(Y[32]=T("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),T("b",null,je(ke(e).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),Y[46]||(Y[46]=T("div",{class:"sp-divider"},null,-1)),Y[47]||(Y[47]=T("div",{class:"sp-section-title"},"操作历史",-1)),T("label",uk,[Y[34]||(Y[34]=T("span",null,"最大撤回步数",-1)),be(T("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":Y[13]||(Y[13]=ee=>ke(e).settings.undoLimit=ee),"aria-label":"最大撤回步数",onChange:Z},null,544),[[ut,ke(e).settings.undoLimit,void 0,{number:!0}]])]),Y[48]||(Y[48]=T("div",{class:"sp-divider"},null,-1)),Y[49]||(Y[49]=T("div",{class:"sp-section-title"},"画布辅助显示",-1)),T("label",dk,[be(T("input",{type:"checkbox","onUpdate:modelValue":Y[14]||(Y[14]=ee=>ke(e).settings.showEmitter=ee)},null,512),[[ei,ke(e).settings.showEmitter]]),Y[35]||(Y[35]=ri("发射点",-1))]),T("label",fk,[be(T("input",{type:"checkbox","onUpdate:modelValue":Y[15]||(Y[15]=ee=>ke(e).settings.showBones=ee)},null,512),[[ei,ke(e).settings.showBones]]),Y[36]||(Y[36]=ri("骨骼连线",-1))]),ke(e).settings.showBones?(ie(),oe(Ke,{key:0},[T("label",mk,[Y[37]||(Y[37]=T("span",null,"骨骼点绘制大小",-1)),be(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":Y[16]||(Y[16]=ee=>ke(e).settings.bonePointDrawSize=ee),"aria-label":"骨骼点绘制大小",onChange:d},null,544),[[ut,ke(e).settings.bonePointDrawSize,void 0,{number:!0}]])]),T("label",pk,[Y[38]||(Y[38]=T("span",null,"坐标轴绘制大小",-1)),be(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":Y[17]||(Y[17]=ee=>ke(e).settings.boneAxisDrawSize=ee),"aria-label":"坐标轴绘制大小",onChange:d},null,544),[[ut,ke(e).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):Xe("",!0),T("label",gk,[be(T("input",{type:"checkbox","onUpdate:modelValue":Y[18]||(Y[18]=ee=>ke(e).settings.showSkinMesh=ee)},null,512),[[ei,ke(e).settings.showSkinMesh]]),Y[39]||(Y[39]=ri("蒙皮网格",-1))]),Y[50]||(Y[50]=T("div",{class:"sp-divider"},null,-1)),T("label",vk,[be(T("input",{type:"checkbox","onUpdate:modelValue":Y[19]||(Y[19]=ee=>ke(e).settings.tickEnabled=ee)},null,512),[[ei,ke(e).settings.tickEnabled]]),Y[40]||(Y[40]=ri("启用刻度",-1))]),ke(e).settings.tickEnabled?(ie(),oe(Ke,{key:1},[T("label",yk,[Y[41]||(Y[41]=T("span",null,"刻度文字大小",-1)),be(T("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":Y[20]||(Y[20]=ee=>ke(e).settings.axisFontSize=ee)},null,512),[[ut,ke(e).settings.axisFontSize,void 0,{number:!0}]]),be(T("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":Y[21]||(Y[21]=ee=>ke(e).settings.axisFontSize=ee),class:"sp-num"},null,512),[[ut,ke(e).settings.axisFontSize,void 0,{number:!0}]])]),T("label",xk,[Y[42]||(Y[42]=T("span",null,"刻度线粗细",-1)),be(T("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":Y[22]||(Y[22]=ee=>ke(e).settings.tickWidth=ee)},null,512),[[ut,ke(e).settings.tickWidth,void 0,{number:!0}]]),be(T("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":Y[23]||(Y[23]=ee=>ke(e).settings.tickWidth=ee),class:"sp-num"},null,512),[[ut,ke(e).settings.tickWidth,void 0,{number:!0}]])]),T("label",bk,[Y[43]||(Y[43]=T("span",null,"坐标轴颜色",-1)),be(T("input",{type:"color","onUpdate:modelValue":Y[24]||(Y[24]=ee=>ke(e).settings.axisColor=ee),class:"sp-colr"},null,512),[[ut,ke(e).settings.axisColor]]),T("span",wk,je(ke(e).settings.axisColor),1)]),T("label",Sk,[be(T("input",{type:"checkbox","onUpdate:modelValue":Y[25]||(Y[25]=ee=>ke(e).settings.showAxisLabels=ee)},null,512),[[ei,ke(e).settings.showAxisLabels]]),Y[44]||(Y[44]=ri("显示刻度数值",-1))])],64)):Xe("",!0),Y[51]||(Y[51]=T("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):Xe("",!0),a.value?(ie(),oe("div",{key:1,class:"help-overlay",role:"presentation",onClick:Y[27]||(Y[27]=xt(ee=>a.value=!1,["self"]))},[T("section",_k,[T("header",Mk,[Y[52]||(Y[52]=T("div",null,[T("h2",{id:"help-title"},"使用说明"),T("p",null,"从创建粒子到保存、导出的快速入门")],-1)),T("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:Y[26]||(Y[26]=ee=>a.value=!1)},"✕")]),Y[53]||(Y[53]=io('

快速开始

  1. 创建对象:在左侧“场景对象”中添加粒子、碰撞、路径或 Spine。
  2. 编辑粒子:选中粒子系统,依次调整发射、形状、属性、外观资源和修改器。
  3. 查看效果:使用底部时间轴播放、暂停或拖动到指定帧;修改参数后会自动重新计算。
  4. 保存成果:配置文件用于继续编辑;“导出 Spine Json”支持 Spine 3.8、4.0、4.1、4.2 和 4.3。

常用功能

小眼睛
单独显示或隐藏场景对象;隐藏的粒子系统不会导出。
+Copy
完整复制当前选中对象,方便对比不同参数效果。
背景图
上传参考图并调整位置和透明度,只用于画布预览。
系统设置
管理界面与辅助显示,并自动保存在当前浏览器中。
配置管理
保存当前项目数据、加载配置,或直接使用预设文件;不包含系统设置。
Spine 骨骼
在层级树搜索并选择骨骼,可用于粒子发射器跟随。

快捷键

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

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

配置与导出有什么区别?

保存配置会保存编辑器中的全部对象和参数,之后可以继续修改;导出 Spine Json只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。

',1))])])):Xe("",!0),i.value?(ie(),oe("div",Tk,[Y[54]||(Y[54]=ri(" 系统: ",-1)),T("b",Ak,je(i.value.systems),1),Y[55]||(Y[55]=ri(" · 粒子(骨骼): ",-1)),T("b",Ek,je(i.value.particles),1),Y[56]||(Y[56]=ri(" · 根骨骼: ",-1)),Y[57]||(Y[57]=T("b",null,"root",-1)),Y[58]||(Y[58]=T("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):Xe("",!0)]))}}),an=(s,e)=>{const t=s.__vccOpts||s;for(const[i,n]of e)t[i]=n;return t},Ik=an(Ck,[["__scopeId","data-v-94c32e62"]]),Rk={class:"ns-label"},Pk=["min","max","step","value","disabled"],kk=["min","max","step","value","disabled"],Fk=nn({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=ht(String(t.modelValue));ds(()=>t.modelValue,h=>{n.value=String(h)});function r(h){const l=parseFloat(h.target.value);Number.isNaN(l)||i("update:modelValue",l)}function a(h){n.value=h.target.value;const l=parseFloat(n.value);Number.isNaN(l)||i("update:modelValue",l)}function o(){const h=parseFloat(n.value);Number.isNaN(h)&&(n.value=String(t.modelValue))}return(h,l)=>(ie(),oe("div",{class:ot(["ns",{disabled:s.disabled}])},[T("span",Rk,je(s.label),1),T("input",{type:"range",class:"ns-range",min:s.min,max:s.max,step:s.step,value:s.modelValue,disabled:s.disabled,onInput:r},null,40,Pk),T("input",{type:"number",class:"ns-num",min:s.min,max:s.max,step:s.step,value:n.value,disabled:s.disabled,onInput:a,onBlur:o},null,40,kk)],2))}}),qe=an(Fk,[["__scopeId","data-v-7c2fbed0"]]),Ok={class:"ce"},Bk={class:"ce-editor"},Lk={class:"ce-grid"},Dk=["x1","x2","y2"],Nk=["y1","x2","y2"],Uk=["x","y","width","height"],Xk=["d"],Vk={key:0,class:"ce-handles"},Yk=["x1","y1","x2","y2"],$k=["cx","cy","onPointerdown"],Gk=["x1","y1","x2","y2"],Hk=["cx","cy","onPointerdown"],jk=["cx","cy"],Wk=["cx","cy","onPointerdown","onDblclick"],zk={class:"ce-nav"},qk={class:"ce-tip"},Mr=8,Kk=nn({__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=ht(null),r=ht(300),a=ht(110);let o=null;function h(){if(!n.value)return;const I=n.value.getBoundingClientRect();r.value=I.width,a.value=I.height}function l(I){return Mr+I*(r.value-Mr*2)}function c(I){return Mr+(1-I)*(a.value-Mr*2)}function u(){return[...t.modelValue].sort((I,k)=>I.x-k.x)}function d(I){i("update:modelValue",[...I].sort((k,B)=>k.x-B.x))}function f(){d(t.defaultValue.map(I=>({...I})))}const p=gt(()=>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 b(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=gt(()=>{if(!p.value.length)return"";let I=`M ${l(p.value[0].x)} ${c(p.value[0].y)}`;for(let k=1;kMath.abs(U.x-k)>.02);D.push({x:k,y:B}),d(D)}let _={t:0,i:-1,x:0,y:0};function R(I,k){I.stopPropagation();const B=u().findIndex(N=>Math.abs(N.x-p.value[k].x)<1e-6&&Math.abs(N.y-p.value[k].y)<1e-6);if(B<0)return;const D=Date.now();if(D-_.t<300&&_.i===k&&Math.abs(I.clientX-_.x)<8&&Math.abs(I.clientY-_.y)<8){_={t:0,i:-1,x:0,y:0},F(k);return}_={t:D,i:k,x:I.clientX,y:I.clientY};const U=N=>{(Math.abs(N.clientX-I.clientX)>8||Math.abs(N.clientY-I.clientY)>8)&&(_={t:0,i:-1,x:0,y:0});const{x:O,y:X}=w(N.clientX,N.clientY),E=u();E[B]={x:O,y:X},d(E)},L=()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",L)};window.addEventListener("pointermove",U),window.addEventListener("pointerup",L)}function P(I,k,B){I.stopPropagation();const D=L=>{const N=w(L.clientX,L.clientY),O=u(),X=O[k],E=B==="in"?O[Math.max(0,k-1)].x:X.x,V=B==="in"?X.x:O[Math.min(O.length-1,k+1)].x,q=Math.min(V,Math.max(E,N.x)),W=Math.round((q-X.x)*100)/100,J=Math.round((N.y-X.y)*100)/100;O[k]=B==="in"?{...X,inX:W,inY:J}:{...X,outX:W,outY:J},d(O)},U=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",U)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",U)}function F(I,k){k==null||k.stopPropagation();const B=u();B.length<=2||(A=Date.now(),d(B.filter((D,U)=>U!==I)))}return La(()=>{h(),o=new ResizeObserver(h),n.value&&o.observe(n.value)}),Gl(()=>{o==null||o.disconnect()}),(I,k)=>(ie(),oe("div",Ok,[T("div",Bk,[(ie(),oe("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:M},[T("g",Lk,[(ie(),oe(Ke,null,li([.25,.5,.75],B=>T("line",{key:"v"+B,x1:l(B),y1:"0",x2:l(B),y2:c(0)},null,8,Dk)),64)),(ie(),oe(Ke,null,li([.25,.5,.75],B=>T("line",{key:"h"+B,x1:"0",y1:c(B),x2:l(1),y2:c(B)},null,8,Nk)),64))]),T("rect",{x:l(0),y:c(1),width:l(1)-l(0),height:c(0)-c(1),class:"ce-frame",fill:"none"},null,8,Uk),T("path",{d:y.value,class:"ce-line",fill:"none"},null,8,Xk),s.mode==="bezier"?(ie(),oe("g",Vk,[(ie(!0),oe(Ke,null,li(p.value,(B,D)=>(ie(),oe(Ke,{key:"handles-"+D},[D>0?(ie(),oe("line",{key:0,x1:l(B.x),y1:c(B.y),x2:l(v(D).x),y2:c(v(D).y)},null,8,Yk)):Xe("",!0),D>0?(ie(),oe("circle",{key:1,cx:l(v(D).x),cy:c(v(D).y),r:"4",onPointerdown:U=>P(U,D,"in")},null,40,$k)):Xe("",!0),DP(U,D,"out")},null,40,Hk)):Xe("",!0)],64))),128))])):Xe("",!0),(ie(!0),oe(Ke,null,li(p.value,(B,D)=>(ie(),oe("g",{key:D},[T("circle",{cx:l(B.x),cy:c(B.y),r:"5",class:"ce-node"},null,8,jk),T("circle",{cx:l(B.x),cy:c(B.y),r:"9",class:"ce-hit",onPointerdown:U=>R(U,D),onDblclick:U=>F(D,U)},null,40,Wk)]))),128))],544)),T("div",zk,[T("span",qk,je(s.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),T("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:f},"重置")]))}}),yn=an(Kk,[["__scopeId","data-v-9bfb7b31"]]),Zk={class:"pac"},Jk={class:"pac-head"},Qk={class:"pac-label"},eF={key:0,class:"pac-modes"},tF=["onClick"],iF={class:"pac-range"},sF={class:"pac-curve"},nF={class:"pac-axis"},rF=nn({__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=gt(()=>{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)=>(ie(),oe("div",Zk,[T("div",Jk,[T("span",Qk,je(s.label),1),s.showModes?(ie(),oe("div",eF,[(ie(!0),oe(Ke,null,li(t.value,r=>(ie(),oe("button",{key:r.value,class:ot(["pac-mode",{on:s.mode===r.value}]),onClick:a=>i.$emit("update:mode",r.value)},je(r.label),11,tF))),128))])):Xe("",!0)]),s.mode==="fixed"||s.mode==="direction"?(ie(),Qt(qe,{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"?(ie(),oe(Ke,{key:1},[Ue(qe,{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"]),Ue(qe,{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)):(ie(),oe(Ke,{key:2},[T("div",iF,[Ue(qe,{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"]),Ue(qe,{label:"范围上限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMax,"onUpdate:modelValue":n[4]||(n[4]=r=>i.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])]),T("div",sF,[Ue(yn,{"model-value":s.curve,"default-value":s.defaultCurve,"onUpdate:modelValue":n[5]||(n[5]=r=>i.$emit("update:curve",r))},null,8,["model-value","default-value"]),T("div",nF,[n[6]||(n[6]=T("span",null,"0",-1)),T("span",null,je(s.curveLabel),1),n[7]||(n[7]=T("span",null,"1",-1))])])],64))]))}}),Hn=an(rF,[["__scopeId","data-v-238f838c"]]),aF={class:"gradient-editor"},oF=["title","onClick","onDblclick","onPointerdown"],lF={key:0,class:"gradient-controls"},cF=["value"],hF=["value"],uF={class:"gradient-position"},dF=["value"],fF=["disabled"],mF=nn({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=ht(null),r=ht(0),a=gt(()=>t.modelValue[r.value]||null),o=gt(()=>[...t.modelValue].sort((R,P)=>R.position-P.position)),h=gt(()=>{const R=o.value;return R.length?`linear-gradient(90deg, ${R.map(P=>`${P.color} ${l(P.position)*100}%`).join(", ")})`:"#ffffff"});ds(()=>t.modelValue.length,R=>{r.value>=R&&(r.value=Math.max(0,R-1))});function l(R){return Math.min(1,Math.max(0,Number(R)||0))}function c(){return t.modelValue.map(R=>({position:l(R.position),color:R.color}))}function u(R,P){const F=c();F[R]&&(F[R]={...F[R],...P},i("update:modelValue",F))}function d(R){u(r.value,{color:R.target.value})}function f(R){var I;const P=R.target,F=_(P.value,((I=a.value)==null?void 0:I.color)||"#ffffff");P.value=F,u(r.value,{color:F})}function p(R){const P=R.target;f(R),P.blur()}function m(R){const P=Number(R.target.value);Number.isFinite(P)&&u(r.value,{position:l(P/100)})}function g(R){const P=c();P.push({position:l(R),color:A(P,R)}),r.value=P.length-1,i("update:modelValue",P)}function v(R){if(!n.value)return;const P=n.value.getBoundingClientRect();g((R.clientX-P.left)/Math.max(1,P.width))}function b(){const R=o.value;let P=.5;if(R.length>1){let F=-1;for(let I=0;IF&&(F=k,P=(R[I].position+R[I+1].position)/2)}}g(P)}function y(R){if(t.modelValue.length<=2||R<0)return;const P=c().filter((F,I)=>I!==R);r.value=Math.min(R,P.length-1),i("update:modelValue",P)}function w(R,P){if(!n.value)return;r.value=P;const F=k=>{const B=n.value.getBoundingClientRect();u(P,{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),R.preventDefault()}function A(R,P){const F=[...R].sort((I,k)=>I.position-k.position);if(!F.length)return"#ffffff";if(P<=F[0].position)return F[0].color;if(P>=F[F.length-1].position)return F[F.length-1].color;for(let I=0;IB.position)continue;const D=(P-k.position)/Math.max(1e-4,B.position-k.position);return M(k.color,B.color,D)}return F[F.length-1].color}function M(R,P,F){const I=U=>{const L=parseInt(U.replace("#","").padEnd(6,"0").slice(0,6),16);return[L>>16&255,L>>8&255,L&255]},k=I(R),B=I(P),D=U=>Math.round(k[U]+(B[U]-k[U])*F);return`#${[D(0),D(1),D(2)].map(U=>U.toString(16).padStart(2,"0")).join("")}`}function _(R,P){let F=R.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()}`:P}return(R,P)=>(ie(),oe("div",aF,[T("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:Li({background:h.value}),title:"双击色带添加色标",onDblclick:v},[(ie(!0),oe(Ke,null,li(s.modelValue,(F,I)=>(ie(),oe("button",{key:I,type:"button",class:ot(["gradient-stop",{selected:I===r.value}]),style:Li({left:`${l(F.position)*100}%`,"--stop-color":F.color}),title:`${Math.round(l(F.position)*100)}% · ${F.color}`,onClick:xt(k=>r.value=I,["stop"]),onDblclick:xt(k=>y(I),["stop"]),onPointerdown:xt(k=>w(k,I),["stop"])},null,46,oF))),128))],36),a.value?(ie(),oe("div",lF,[T("input",{type:"color",class:"gradient-color",value:a.value.color,"aria-label":"色标颜色",onInput:d},null,40,cF),T("input",{type:"text",class:"gradient-hex-input",value:a.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:f,onKeydown:Ta(p,["enter"])},null,40,hF),T("label",uF,[T("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(a.value.position)*100),"aria-label":"色标位置",onInput:m},null,40,dF),P[1]||(P[1]=T("span",null,"%",-1))]),T("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:b},"+"),T("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:s.modelValue.length<=2,onClick:P[0]||(P[0]=F=>y(r.value))},"×",8,fF)])):Xe("",!0),P[2]||(P[2]=T("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),zv=an(mF,[["__scopeId","data-v-f6ab10bf"]]),pF={class:"image-card"},gF={class:"imgrow"},vF=["title"],yF=["src","alt"],xF={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},bF={class:"img-fields"},wF={key:0,class:"row"},SF={class:"row"},_F=["placeholder"],MF={class:"img-actions"},TF=["title"],AF=["disabled"],EF={class:"thumb-note"},CF={key:0,class:"row"},IF={class:"row"},RF={class:"row"},PF={class:"sequence-note"},kF={class:"resource-weight-row"},FF=["disabled","title"],OF={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},BF={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},LF=nn({__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=gt(()=>{var l,c;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=((c=u[u.length-1])==null?void 0:c.name)||d;return u.length===1?`1 帧 · ${d}`:`${u.length} 帧 · ${d} → ${f}`}const h=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return h.includes(".")?h:`${h}.png`}),r=gt(()=>{var h,l;return t.resource.imageMode==="sequence"?((l=(h=t.resource.sequenceFrames)==null?void 0:h[0])==null?void 0:l.previewUrl)||"":t.resource.previewUrl}),a=gt(()=>{var u,d;const h=t.resource.sequenceFrames||[];if(!h.length)return"未选择序列帧";const l=((u=h[0])==null?void 0:u.name)||"第一张图片",c=((d=h[h.length-1])==null?void 0:d.name)||"最后一张图片";return`已选择 ${h.length} 帧,按 ${l}-${c} 顺序播放`});function o(){t.supportsSequence&&t.resource.imageMode==="sequence"?i("pickSequence",t.resource.id):i("pick",t.resource.id)}return(h,l)=>(ie(),oe("div",pF,[T("div",gF,[T("button",{class:"img-thumb",title:s.supportsSequence&&s.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:o},[r.value?(ie(),oe("img",{key:0,src:r.value,alt:s.resource.textureName},null,8,yF)):(ie(),oe("svg",xF,[...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,vF),T("div",bF,[s.showFolder?(ie(),oe("label",wF,[l[11]||(l[11]=T("span",null,"子文件夹",-1)),be(T("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>s.resource.textureFolder=c),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[ut,s.resource.textureFolder]])])):Xe("",!0),T("label",SF,[l[12]||(l[12]=T("span",null,"名称",-1)),be(T("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>s.resource.textureName=c),type:"text",class:"inp",placeholder:s.namePlaceholder},null,8,_F),[[ut,s.resource.textureName]])])]),T("div",MF,[T("button",{class:"mini-btn2",title:`恢复 ${s.defaultFile}`,onClick:l[2]||(l[2]=c=>h.$emit("reset",s.resource.id))},"⟳",8,TF),T("button",{class:"mini-btn2",title:"删除图片资源",disabled:s.resourceCount===1,onClick:l[3]||(l[3]=c=>h.$emit("remove",s.resource.id))},"🗑",8,AF)])]),T("div",EF,je(n.value),1),s.supportsSequence?(ie(),oe("label",CF,[l[14]||(l[14]=T("span",null,"图片模式",-1)),be(T("select",{"onUpdate:modelValue":l[4]||(l[4]=c=>s.resource.imageMode=c),class:"inp"},[...l[13]||(l[13]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"sequence"},"序列帧",-1)])],512),[[jt,s.resource.imageMode]])])):Xe("",!0),s.supportsSequence&&s.resource.imageMode==="sequence"?(ie(),oe(Ke,{key:1},[T("label",IF,[l[16]||(l[16]=T("span",null,"播放模式",-1)),be(T("select",{"onUpdate:modelValue":l[5]||(l[5]=c=>s.resource.sequencePlayback=c),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),[[jt,s.resource.sequencePlayback]])]),T("label",RF,[l[17]||(l[17]=T("span",null,"播放帧率",-1)),be(T("input",{"onUpdate:modelValue":l[6]||(l[6]=c=>s.resource.sequenceFps=c),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[ut,s.resource.sequenceFps,void 0,{number:!0}]])]),T("button",{class:"sequence-pick",onClick:l[7]||(l[7]=c=>h.$emit("pickSequence",s.resource.id))},"选择序列帧(多选)"),T("div",PF,je(a.value),1)],64)):Xe("",!0),T("div",kF,[Ue(qe,{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]=c=>h.$emit("updateWeight",s.resource.id,c))},null,8,["model-value","disabled"]),T("button",{class:ot(["weight-lock",{on:s.resource.locked}]),disabled:s.resourceCount===1,title:s.resource.locked?"解除占比锁定":"锁定当前占比",onClick:l[9]||(l[9]=c=>h.$emit("toggleLock",s.resource.id))},[s.resource.locked?(ie(),oe("svg",OF,[...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)])])):(ie(),oe("svg",BF,[...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,FF)]),V_(h.$slots,"default",{},void 0)]))}}),qv=an(LF,[["__scopeId","data-v-68ff5314"]]),DF={class:"spine-editor"},NF={class:"field wide"},UF={class:"grid three"},XF={class:"field"},VF={class:"field"},YF={class:"field"},$F={class:"grid three"},GF={class:"field"},HF={class:"field"},jF={class:"field"},WF=["disabled"],zF={class:"asset-row"},qF=["title"],KF={class:"asset-row"},ZF=["title"],JF={class:"asset-row"},QF=["title"],e3={class:"asset-actions"},t3=["disabled"],i3={class:"runtime-note"},s3={key:0},n3={key:0,class:"error"},r3={class:"section-box"},a3={key:0,class:"empty"},o3={key:1,class:"field wide"},l3=["value"],c3={class:"section-box"},h3={class:"tree-title-row"},u3=["disabled","title"],d3={key:0,class:"empty"},f3={key:1,class:"bone-search"},m3={key:2,class:"empty"},p3={key:3,class:"bone-tree"},g3=["onClick","onKeydown"],v3=["title","onClick"],y3={key:1,class:"bone-leaf"},x3={class:"bone-name"},b3=nn({__name:"SpineObjectPanel",props:{spineObject:{}},setup(s){const e=s,t=Kl(),i=ht(null),n=ht(null),r=ht(null),a=ht(null),o=ht(new Set),h=ht(""),l=ht(null),c=ht(null),u=ht([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const d=gt(()=>{var N;return((N=l.value)==null?void 0:N.name)||e.spineObject.skeletonFileName}),f=gt(()=>{var N;return((N=c.value)==null?void 0:N.name)||e.spineObject.atlasFileName}),p=gt(()=>u.value.length?u.value.map(N=>N.name):e.spineObject.textureFileNames),m=gt(()=>p.value.length?`${p.value.length} 张:${p.value.join(", ")}`:"PNG / JPEG / WebP..."),g=gt(()=>new Set(e.spineObject.bones.map(N=>N.parent).filter(N=>!!N))),v=gt(()=>new Map(e.spineObject.bones.map(N=>[N.name,N]))),b=gt(()=>e.spineObject.bones.filter(N=>{var E;const O=h.value.trim().toLocaleLowerCase();if(O)return N.name.toLocaleLowerCase().includes(O);let X=N.parent;for(;X;){if(o.value.has(X))return!1;X=((E=v.value.get(X))==null?void 0:E.parent)||null}return!0})),y=gt(()=>g.value.size>0&&[...g.value].every(N=>o.value.has(N)));function w(N){const O=e.spineObject.selectedBone===N;for(const X of t.spines)X.selectedBone="";O||(e.spineObject.selectedBone=N)}function A(N){o.value.has(N)?o.value.delete(N):o.value.add(N)}function M(){o.value=y.value?new Set:new Set(g.value)}function _(N){var O;return((O=N.target.files)==null?void 0:O[0])||null}function R(N){l.value=_(N)}function P(N){c.value=_(N)}function F(N){u.value=Array.from(N.target.files||[])}function I(N){return N.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function k(N){const O=Array.from(N.target.files||[]);if(!O.length)return;const X=O.filter(K=>/\.(json|skel)$/i.test(K.name)),E=O.filter(K=>/\.atlas$/i.test(K.name)),V=O.filter(K=>/\.(png|jpe?g|webp|wepb)$/i.test(K.name)),q=E.map(K=>({atlas:K,skeleton:X.find(fe=>I(fe)===I(K))})).find(K=>K.skeleton),W=(q==null?void 0:q.skeleton)||X[0]||null,J=(q==null?void 0:q.atlas)||E[0]||null;if(l.value=W,c.value=J,u.value=V,!W||!J||!V.length){const K=[!W&&"JSON / SKEL",!J&&"Atlas",!V.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${K}`;return}await U()}function B(){t.recalcTotalFrames()}function D(){B(),t.timeline.frame=0}async function U(){var X;const N=l.value,O=c.value;if(!N||!O||!u.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const E=await bw(N,O,u.value);Eu(e.spineObject.id,E),e.spineObject.skeletonFileName=N.name,e.spineObject.atlasFileName=O.name,e.spineObject.textureFileNames=u.value.map(V=>V.name),e.spineObject.dataVersion=E.dataVersion,e.spineObject.animations=E.animations,e.spineObject.bones=E.bones,e.spineObject.selectedBone="",h.value="",o.value=new Set,e.spineObject.selectedAnimation=((X=E.animations[0])==null?void 0:X.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",B(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await kP(N,O,u.value)}catch(V){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",V)}}catch(E){e.spineObject.status="error",e.spineObject.error=E instanceof Error?E.message:String(E)}}function L(){ql(e.spineObject.id),l.value=null,c.value=null,u.value=[],i.value&&(i.value.value=""),n.value&&(n.value.value=""),r.value&&(r.value.value=""),a.value&&(a.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="",h.value="",o.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",B()}return(N,O)=>(ie(),oe("div",DF,[O[30]||(O[30]=T("div",{class:"editor-title"},"Spine 属性",-1)),T("label",NF,[O[15]||(O[15]=T("span",null,"Spine 名称",-1)),be(T("input",{"onUpdate:modelValue":O[0]||(O[0]=X=>s.spineObject.name=X)},null,512),[[ut,s.spineObject.name]])]),T("div",UF,[T("label",XF,[O[16]||(O[16]=T("span",null,"X 位置",-1)),be(T("input",{"onUpdate:modelValue":O[1]||(O[1]=X=>s.spineObject.x=X),type:"number"},null,512),[[ut,s.spineObject.x,void 0,{number:!0}]])]),T("label",VF,[O[17]||(O[17]=T("span",null,"Y 位置",-1)),be(T("input",{"onUpdate:modelValue":O[2]||(O[2]=X=>s.spineObject.y=X),type:"number"},null,512),[[ut,s.spineObject.y,void 0,{number:!0}]])]),T("label",YF,[O[18]||(O[18]=T("span",null,"旋转",-1)),be(T("input",{"onUpdate:modelValue":O[3]||(O[3]=X=>s.spineObject.rotation=X),type:"number"},null,512),[[ut,s.spineObject.rotation,void 0,{number:!0}]])])]),T("div",$F,[T("label",GF,[O[19]||(O[19]=T("span",null,"Scale X",-1)),be(T("input",{"onUpdate:modelValue":O[4]||(O[4]=X=>s.spineObject.scaleX=X),type:"number",step:"0.05"},null,512),[[ut,s.spineObject.scaleX,void 0,{number:!0}]])]),T("label",HF,[O[20]||(O[20]=T("span",null,"Scale Y",-1)),be(T("input",{"onUpdate:modelValue":O[5]||(O[5]=X=>s.spineObject.scaleY=X),type:"number",step:"0.05"},null,512),[[ut,s.spineObject.scaleY,void 0,{number:!0}]])]),T("label",jF,[O[21]||(O[21]=T("span",null,"开始时间",-1)),be(T("input",{"onUpdate:modelValue":O[6]||(O[6]=X=>s.spineObject.timeOffset=X),type:"number",min:"0",step:"0.033333",onChange:B},null,544),[[ut,s.spineObject.timeOffset,void 0,{number:!0}]])])]),O[31]||(O[31]=T("div",{class:"divider"},null,-1)),O[32]||(O[32]=T("div",{class:"section-title"},"Spine 资源",-1)),T("input",{ref_key:"skeletonInput",ref:i,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:R},null,544),T("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:P},null,544),T("input",{ref_key:"textureInput",ref:r,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:F},null,544),T("input",{ref_key:"folderInput",ref:a,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:k},null,544),T("button",{class:"folder-select",disabled:s.spineObject.status==="loading",onClick:O[7]||(O[7]=X=>{var E;return(E=a.value)==null?void 0:E.click()})},"选择文件夹并加载",8,WF),O[33]||(O[33]=T("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),T("div",zF,[T("div",{class:"asset-name",title:d.value},je(d.value||"JSON / SKEL..."),9,qF),T("button",{onClick:O[8]||(O[8]=X=>{var E;return(E=i.value)==null?void 0:E.click()})},"选择")]),T("div",KF,[T("div",{class:"asset-name",title:f.value},je(f.value||"Atlas..."),9,ZF),T("button",{onClick:O[9]||(O[9]=X=>{var E;return(E=n.value)==null?void 0:E.click()})},"选择")]),T("div",JF,[T("div",{class:"asset-name",title:p.value.join(", ")},je(m.value),9,QF),T("button",{onClick:O[10]||(O[10]=X=>{var E;return(E=r.value)==null?void 0:E.click()})},"选择(多选)")]),T("div",e3,[T("button",{class:"load",disabled:s.spineObject.status==="loading",onClick:U},je(s.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,t3),T("button",{class:"clear",onClick:L},"清除")]),T("div",i3,[O[22]||(O[22]=ri(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线 ",-1)),s.spineObject.dataVersion?(ie(),oe("span",s3," · 当前资源 "+je(s.spineObject.dataVersion),1)):Xe("",!0)]),s.spineObject.error?(ie(),oe("div",n3,je(s.spineObject.error),1)):Xe("",!0),T("div",r3,[O[25]||(O[25]=T("div",{class:"section-title"},"Spine 动画",-1)),s.spineObject.animations.length?(ie(),oe("label",o3,[O[24]||(O[24]=T("span",null,"时间轴播放动画",-1)),be(T("select",{"onUpdate:modelValue":O[11]||(O[11]=X=>s.spineObject.selectedAnimation=X),onChange:D},[O[23]||(O[23]=T("option",{value:""},"无",-1)),(ie(!0),oe(Ke,null,li(s.spineObject.animations,X=>(ie(),oe("option",{key:X.name,value:X.name},je(X.name)+"("+je(X.duration.toFixed(2))+"s) ",9,l3))),128))],544),[[jt,s.spineObject.selectedAnimation]])])):(ie(),oe("div",a3,"无可用动画"))]),T("div",c3,[T("div",h3,[O[29]||(O[29]=T("div",{class:"section-title"},"层级树",-1)),T("button",{class:ot(["selected-bone",{active:s.spineObject.selectedBone}]),disabled:!s.spineObject.selectedBone,title:s.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:O[12]||(O[12]=X=>s.spineObject.selectedBone="")},[s.spineObject.selectedBone?(ie(),oe(Ke,{key:0},[O[26]||(O[26]=ri("清除选中骨骼:",-1)),T("strong",null,je(s.spineObject.selectedBone),1)],64)):(ie(),oe(Ke,{key:1},[O[27]||(O[27]=ri("当前骨骼:",-1)),O[28]||(O[28]=T("strong",null,"未选择",-1))],64))],10,u3),s.spineObject.bones.length?(ie(),oe("button",{key:0,class:"tree-action",onClick:M},je(y.value?"全部展开":"全部折叠"),1)):Xe("",!0)]),s.spineObject.bones.length?(ie(),oe("div",f3,[be(T("input",{"onUpdate:modelValue":O[13]||(O[13]=X=>h.value=X),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[ut,h.value,void 0,{trim:!0}]]),h.value?(ie(),oe("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:O[14]||(O[14]=X=>h.value="")},"✕")):Xe("",!0)])):(ie(),oe("div",d3,"未加载 Spine")),s.spineObject.bones.length&&!b.value.length?(ie(),oe("div",m3,"未找到匹配的骨骼")):s.spineObject.bones.length?(ie(),oe("div",p3,[(ie(!0),oe(Ke,null,li(b.value,X=>(ie(),oe("div",{key:X.name,class:ot(["bone",{selected:s.spineObject.selectedBone===X.name}]),style:Li({paddingLeft:`${6+X.depth*16}px`}),role:"button",tabindex:"0",onClick:E=>w(X.name),onKeydown:Ta(xt(E=>w(X.name),["prevent"]),["enter"])},[g.value.has(X.name)?(ie(),oe("button",{key:0,class:"bone-toggle",title:o.value.has(X.name)?"展开子骨骼":"折叠子骨骼",onClick:xt(E=>A(X.name),["stop"])},je(o.value.has(X.name)?"▸":"▾"),9,v3)):(ie(),oe("span",y3,"•")),T("span",x3,je(X.name),1)],46,g3))),128))])):Xe("",!0)])]))}}),w3=an(b3,[["__scopeId","data-v-9257fb45"]]),xi=Ba({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let Bc=0;function S3(s){return new Promise(e=>window.setTimeout(e,s))}function Kv(s,e){const t=++Bc,i=performance.now();Object.assign(xi,{visible:!0,title:s,detail:e,progress:0,indeterminate:!1,failed:!1});const n=(a,o)=>{t===Bc&&(xi.indeterminate=a==null,a!=null&&(xi.progress=Math.min(100,Math.max(0,a))),o&&(xi.detail=o))},r=async(a,o)=>{if(t!==Bc)return;xi.failed=a,xi.indeterminate=!1,xi.progress=a?xi.progress:100,xi.detail=o,await S3(Math.max(180,(a?850:450)-(performance.now()-i))),t===Bc&&(xi.visible=!1)};return{update:n,paint:()=>new Promise(a=>requestAnimationFrame(()=>a())),finish:(a="已完成")=>r(!1,a),fail:(a="操作失败")=>r(!0,a)}}async function _3(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 a=0,o="";for(e(i?0:null);;){const{done:h,value:l}=await n.read();if(h)break;a+=l.byteLength,o+=r.decode(l,{stream:!0}),e(i?Math.min(1,a/t):null)}return o+=r.decode(),i&&e(1),o}const M3="3.8";function Bs(s,e,t){s[e]==null&&s[t]!=null&&(s[e]=s[t]),delete s[t]}function Pm(s){if(!s||typeof s!="object")return;if(Array.isArray(s)){for(const t of s)Pm(t);return}const e=s;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Pm(t)}function T3(s){for(const e of s.bones)Bs(e,"transform","inherit");for(const e of s.transform||[])Bs(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),Bs(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of s.path||[])Bs(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&&Bs(i,"deform","timelines")}function A3(s){for(const e of Object.values(s.slots||{}))Bs(e,"color","rgba"),Bs(e,"twoColor","rgba2")}function E3(s){for(const e of Object.values(s.bones||{}))for(const t of e.rotate||[])Bs(t,"angle","value")}function C3(s){for(const e of Object.values(s.transform||{}))for(const t of e)Bs(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),Bs(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function I3(s){for(const e of Object.values(s.path||{})){for(const t of["position","spacing"])for(const i of e[t]||[])Bs(i,t,"value");for(const t of e.mix||[])Bs(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function R3(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,a]of Object.entries(i)){const o=n[r]||(n[r]={});for(const[h,l]of Object.entries(a))l.deform&&(o[h]=l.deform)}}delete s.attachments}function P3(s){s.skeleton.spine=M3,T3(s);for(const e of Object.values(s.animations))A3(e),E3(e),C3(e),I3(e),R3(e);return Pm(s.animations),s}function k3(s,e,t,i){const n=t.frame-e.frame,r=n<=0?0:(s.frame-e.frame)/n;let a=0;for(let o=0;o[...i].sort((a,o)=>a-o);let r=!0;for(;r;){r=!1;const a=n();for(let o=0;ou&&(u=f,c=d)}c>=0&&(i.add(c),r=!0)}}return n().map(a=>s[a])}function Zv(s,e,t,i,n){const r=t-e+1;if(r<2)return 0;const a=n?e:t,o=n?e+1:t-1,h=n?e+2:t-2,l=Math.abs(s[o].frame-s[a].frame);if(r>=3&&l>0&&Math.abs(Math.abs(s[h].frame-s[o].frame)-l)<1e-6){const u=s[a].values[i],d=s[o].values[i],f=s[h].values[i];return n?(-3*u+4*d-f)/(2*l):(3*u-4*d+f)/(2*l)}const c=s[o].frame-s[a].frame;return c?(s[o].values[i]-s[a].values[i])/c:0}function Jv(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])),c=a+Zv(s,e,t,r,!0)*i/3,u=o-Zv(s,e,t,r,!1)*i/3;n.push([Math.max(h,Math.min(l,c)),Math.max(h,Math.min(l,u))])}return{values:n}}function F3(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 O3(s,e,t,i,n){const r=t.frame-e.frame,a=r<=0?0:(s.frame-e.frame)/r;let o=0;for(let h=0;h[...i].sort((o,h)=>o-h);let r=!0;for(;r;){r=!1;const o=n();for(let h=0;hf&&(f=m,d=p)}d>=0&&(i.add(d),r=!0)}}const a=n();return{samples:a.map(o=>s[o]),controls:a.slice(0,-1).map((o,h)=>Jv(s,o,a[h+1]))}}function B3(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 Mi(s){if(!Number.isFinite(s))return 0;const e=Math.round(s*1e5)/1e5;return Object.is(e,-0)?0:e}function L3(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))),a=Math.max(2,t.length),o=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),h=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,c=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(s,e){let t=s,i=2;for(;e.has(t);)t=`${s}_${i++}`;return e.add(t),t}function N3(s){return s.replace(/\.[^./\\]+$/,"")}function Ow(s,e){return N3([s,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function U3(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 Dc(s){return Math.round(Math.max(0,Math.min(1,s))*255).toString(16).padStart(2,"0")}function sy(s,e){return[(s>>16&255)/255,(s>>8&255)/255,(s&255)/255,Math.max(0,Math.min(1,e))]}function xl(s,e){return Mi(s/e)}function X3(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+Vr(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function Yh(s,e){return e?s.boneName:`${s.spawnId??"legacy"}_${s.boneName}`}function V3(s,e,t){const i=new Set;for(const n of s)for(const r of n)i.add(Yh(r,e));return[...i].sort().map((n,r)=>({key:n,name:Fw(`_particle_${String(r).padStart(3,"0")}`,t),states:s.map(a=>a.find(o=>Yh(o,e)===n)||null)}))}function Y3(s,e,t,i){const n=e*t/i,r=Math.min(s.states.length-1,Math.max(0,Math.floor(n))),a=Math.min(s.states.length-1,r+1),o=s.states[r],h=s.states[a];if(!o||!h||Yh(o,!0)!==Yh(h,!0)||o.spawnId!==h.spawnId)return o;const l=n-r;if(l<=1e-6)return o;const c=(d,f)=>(d??0)+((f??d??0)-(d??0))*l,u=o.trailState&&h.trailState&&o.trailState.resourceId===h.trailState.resourceId?{...o.trailState,width:c(o.trailState.width,h.trailState.width),alpha:c(o.trailState.alpha,h.trailState.alpha),bones:o.trailState.bones.map((d,f)=>{const p=h.trailState.bones[f]||d;return{...d,worldX:c(d.worldX??d.x,p.worldX??p.x),worldY:c(d.worldY??d.y,p.worldY??p.y),worldRotation:c(d.worldRotation??-d.rotation,p.worldRotation??-p.rotation)}})}:o.trailState;return{...o,worldX:c(o.worldX,h.worldX),worldY:c(o.worldY,h.worldY),worldRotation:c(o.worldRotation,h.worldRotation),worldScaleX:c(o.worldScaleX,h.worldScaleX),worldScaleY:c(o.worldScaleY,h.worldScaleY),alpha:c(o.alpha,h.alpha),trailState:u}}function ny(s,e){return!s||s==="跟随导出"?e.keyframeCurve:s==="贝塞尔"?"bezier":"linear"}function eo(s,e,t,i,n,r=new Set,a=n.keyframeCurve){if(!s.length)return[];const o=a==="bezier"&&n.spineVersion!=="3.8"?kw(s,i,r):{samples:Pw(s,i,r),controls:[]},h=o.samples.map(l=>{const c={time:xl(l.frame,e)};return t.forEach((u,d)=>{c[u]=Mi(l.values[d])}),c});for(let l=0;l0&&n&&e.add(t-1),i&&e.add(t))}return e}function G3(s){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),i&&e.add(t))}return e}function H3(s,e){var i;if(!s.shapeEnabled||!((i=s.shapeCurve)!=null&&i.length))return 1;const t=[...s.shapeCurve].sort((n,r)=>n.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let n=1;n{r!==n&&(i.push(t(r,a)),n=r)}),i}function W3(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,a=U3(r);(!a.width||!a.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const o=a.width||1,h=a.height||1;return{path:Ow(s.textureFolder,n),x:Mi((.5-s.anchorX)*o),y:Mi((s.anchorY-.5)*h),width:Mi(o),height:Mi(h)}}function z3(s,e,t,i,n=i.keyframeCurve){if(!s.length)return[];const r=new Set;for(let c=1;c({frame:u,values:c})),o=1/255,h=n==="bezier"&&i.spineVersion!=="3.8"?kw(a,[o,o,o,.01],r):{samples:Pw(a,[o,o,o,.01],r),controls:[]},l=h.samples.map(c=>({time:xl(c.frame,t),color:`${Dc(c.values[0])}${Dc(c.values[1])}${Dc(c.values[2])}${Dc(c.values[3])}`}));if(h.controls.length)for(let c=0;c({time:xl(d,n),name:u??null}));h.length&&(o.attachment=h);const l=z3(i,t,n,r,a);l.length&&(o.rgba=l)}function ay(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=[],a=s.systems.filter(m=>m.visible!==!1),o={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||(o.skeleton.fps=i);const h=o.skins[0].attachments,l=new Set(["root"]),c=[...new Set([...s.timeline.animations.length?s.timeline.animations:["animation"],...a.map(m=>m.animation||"animation")])],u=new Map;for(const m of a){const g=Math.min(((p=m.frames)==null?void 0:p.length)||0,X3(m,t)),v=(m.frames||[]).slice(0,g);v.length||r.push({code:"empty-cache",message:`“${m.config.name}”没有可用帧缓存。`});const b=Fw(D3(m.config.name,`system_${m.id}`),l);o.bones.push({name:b,parent:"root"});const y=V3(v,e.bonePool,l),w=Math.max(0,(g-1)/t),A=Math.max(1,Math.ceil(w*n)+1),M=u.get(m.animation)||[];M.push({system:m,tracks:y,targetFrames:A}),u.set(m.animation,M);for(const _ of y){o.bones.push({name:_.name,parent:b});const R=new Set(m.config.imageResources.map(k=>k.blend));for(const k of R){const B=`${_.name}_image_${k}`;o.slots.push({name:B,bone:_.name,color:"ffffff00",blend:Qv[k]});const D=h[B]||(h[B]={});for(const U of m.config.imageResources.filter(L=>L.blend===k)){const L=U.imageMode==="sequence"?Math.max(1,U.sequenceFrames.length):1;for(let N=0;N{var X;return((X=O==null?void 0:O.trailState)==null?void 0:X.resourceId)===k.id}))continue;const B=Math.max(2,Math.min(16,Math.round(k.boneCount||3))),D=[];for(let O=0;Oo.bones.findIndex(X=>X.name===O)),N=Ow("",k.textureName||`trail_${k.id}`);(h[U]||(h[U]={}))[`trail_${k.id}`]=L3(m.config,k,L,N),k.texture||r.push({code:"missing-image",message:`拖尾图片“${k.textureName||k.id}”缺失,已保留路径。`})}const P=`${_.name}_image_`,F=`${_.name}_trail_`,I=o.slots.filter(k=>String(k.name).startsWith(P)||String(k.name).startsWith(F));I.length&&(o.slots=o.slots.filter(k=>!I.includes(k)),o.slots.push(...I.filter(k=>String(k.name).startsWith(F)),...I.filter(k=>String(k.name).startsWith(P))))}}for(const m of c){const g=u.get(m)||[],v={bones:{},slots:{}};let b=!1;for(const{system:y,tracks:w,targetFrames:A}of g)for(const M of w){const _=Array.from({length:A},(E,V)=>Y3(M,V,t,n)),R=_.map(E=>!!(E!=null&&E.active)),P=[],F=[],I=[];_.forEach((E,V)=>{E!=null&&E.active&&(P.push({frame:V,values:[E.worldX??E.x,E.worldY??E.y]}),F.push(E.worldRotation??E.rotation),I.push({frame:V,values:[E.worldScaleX??E.scaleX,E.worldScaleY??E.scaleY]}))});const k=B3(F),B=P.map((E,V)=>({frame:E.frame,values:[k[V]??0]})),D=$3(_),U={},L=eo(P,n,["x","y"],[ey,ey],e,D),N=eo(B,n,["value"],[iy],e,D),O=eo(I,n,["x","y"],[Lc,Lc],e,D);L.length&&(U.translate=L),N.length&&(U.rotate=N),O.length&&(U.scale=O),Object.keys(U).length&&(v.bones[M.name]=U,b=!0);const X=new Set(y.config.imageResources.map(E=>E.blend));for(const E of X){const V=[],q=[];let W=16777215;for(let me=0;meTe.id===we.resourceId):void 0,ge=!!we&&R[me]&&we.imageVisible!==!1&&(Ee==null?void 0:Ee.blend)===E;we&&(Ee==null?void 0:Ee.blend)===E&&(W=we.colorHex),V.push(ge?`image_${Ee.id}_${we.imageFrameIndex??0}`:null),q.push(sy(W,ge?we.alpha:0))}const K=y.config.imageResources.filter(me=>me.blend===E).filter(me=>me.independentAlpha==="curve").map(me=>ny(me.alphaCurveMode,e)),fe=K.length?K.includes("bezier")?"bezier":"linear":ny(y.config.alphaMode==="curve"?y.config.curveMode:void 0,e);ry(v,`${M.name}_image_${E}`,V,q,n,e,fe),V.some(Boolean)&&(b=!0)}if(y.config.trail)for(const E of y.config.trailResources){const V=Math.max(2,Math.min(16,Math.round(E.boneCount||3))),q=_.map(Te=>{var G;return((G=Te==null?void 0:Te.trailState)==null?void 0:G.resourceId)===E.id?Te.trailState:void 0}),W=q.find(Te=>!!Te);if(!W)continue;const J=G3(q),K=E.widthSizeMode==="random"?Math.max(1,Number(E.widthMin)||0,Number(E.widthMax)||0):Math.max(.001,Number(E.width)||100);let fe=W;const me=q.map(Te=>(Te&&(fe=Te),fe));for(let Te=0;Te{const Oe=Le==null?void 0:Le.bones[Math.min(Le.bones.length-1,Te)];if(!Oe)return;const tt={x:Oe.worldX??Oe.x,y:Oe.worldY??Oe.y,rotation:Oe.worldRotation??-Oe.rotation};G.push({frame:Re,values:[tt.x,tt.y]}),Z.push({frame:Re,values:[tt.rotation]}),z.push({frame:Re,values:[1,Math.max(0,Le.width/K)*te]})});const he=`${M.name}_trail_${E.id}_${Te}`,ve={},le=eo(G,n,["x","y"],[ty,ty],e,j),ye=eo(Z,n,["value"],[iy],e,j),ae=eo(z,n,["x","y"],[Lc,Lc],e,j);le.length&&(ve.translate=le),ye.length&&(ve.rotate=ye),ae.length&&(ve.scale=ae),Object.keys(ve).length&&(v.bones[he]=ve)}const we=q.map(()=>`trail_${E.id}`);let Ee=W.colorHex;const ge=q.map(Te=>(Te&&(Ee=Te.colorHex),sy(Ee,Te?Te.alpha:0)));ry(v,`${M.name}_trail_${E.id}`,we,ge,n,e),b=!0}}(b||!e.excludeEmptyAnimations)&&(o.animations[m]=v)}!Object.keys(o.animations).length&&!e.excludeEmptyAnimations&&(o.animations.animation={bones:{},slots:{}});const d=e.spineVersion==="3.8"?P3(o):o,f=JSON.stringify(d,null,2);return{json:d,text:f,warnings:r,particleSystemCount:a.length,animationCount:Object.keys(d.animations).length,boneCount:d.bones.length}}function q3(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 w8{constructor(){x(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 K3{constructor(){x(this,"entries",{});x(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 _s){return t.setFromString(e)}};x(_s,"WHITE",new _s(1,1,1,1)),x(_s,"RED",new _s(1,0,0,1)),x(_s,"GREEN",new _s(0,1,0,1)),x(_s,"BLUE",new _s(0,0,1,1)),x(_s,"MAGENTA",new _s(1,0,1,1));let bt=_s;const di=class di{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*di.degRad)}static sinDeg(e){return Math.sin(e*di.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*di.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 di.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}};x(di,"epsilon",1e-5),x(di,"epsilon2",di.epsilon*di.epsilon),x(di,"PI",3.1415927),x(di,"PI2",di.PI*2),x(di,"invPI2",1/di.PI2),x(di,"radiansToDegrees",180/di.PI),x(di,"radDeg",di.radiansToDegrees),x(di,"degreesToRadians",di.PI/180),x(di,"degRad",di.degreesToRadians);let Ve=di;const Ps=class Ps{apply(e,t,i){return t===void 0||i===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(i)}};x(Ps,"linear",new class extends Ps{applyInternal(e){return e}}),x(Ps,"smooth",new class extends Ps{applyInternal(e){return e*e*(3-2*e)}}),x(Ps,"slowFast",new class extends Ps{applyInternal(e){return e*e}}),x(Ps,"fastSlow",new class extends Ps{applyInternal(e){return(e-1)*(e-1)*-1+1}}),x(Ps,"circle",new class extends Ps{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 Ao=Ps;class Z3 extends Ao{constructor(t){super();x(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 S8 extends Z3{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const Fr=class Fr{static arrayCopy(e,t,i,n,r){for(let a=t,o=n;a=t?e:Fr.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 T8{constructor(e=32){x(this,"values");x(this,"addedValues",0);x(this,"lastValue",0);x(this,"mean",0);x(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{c.width=parseInt(i[1]),c.height=parseInt(i[2])},n.format=()=>{},n.filter=c=>{c.minFilter=lt.enumValue(Ro,i[1]),c.magFilter=lt.enumValue(Ro,i[2])},n.repeat=c=>{i[1].indexOf("x")!==-1&&(c.uWrap=Po.Repeat),i[1].indexOf("y")!==-1&&(c.vWrap=Po.Repeat)},n.pma=c=>{c.pma=i[1]==="true"};var r={};r.xy=c=>{c.x=parseInt(i[1]),c.y=parseInt(i[2])},r.size=c=>{c.width=parseInt(i[1]),c.height=parseInt(i[2])},r.bounds=c=>{c.x=parseInt(i[1]),c.y=parseInt(i[2]),c.width=parseInt(i[3]),c.height=parseInt(i[4])},r.offset=c=>{c.offsetX=parseInt(i[1]),c.offsetY=parseInt(i[2])},r.orig=c=>{c.originalWidth=parseInt(i[1]),c.originalHeight=parseInt(i[2])},r.offsets=c=>{c.offsetX=parseInt(i[1]),c.offsetY=parseInt(i[2]),c.originalWidth=parseInt(i[3]),c.originalHeight=parseInt(i[4])},r.rotate=c=>{const u=i[1];u==="true"?c.degrees=90:u!=="false"&&(c.degrees=parseInt(u))},r.index=c=>{c.index=parseInt(i[1])};let a=t.readLine();for(;a&&a.trim().length===0;)a=t.readLine();for(;!(!a||a.trim().length===0||t.readEntry(i,a)===0);)a=t.readLine();let o=null,h=null,l=null;for(;a!==null;)if(a.trim().length===0)o=null,a=t.readLine();else if(o){const c=new Lw(o,a);for(;;){const u=t.readEntry(i,a=t.readLine());if(u===0)break;const d=r[i[0]];if(d)d(c);else{h||(h=[]),l||(l=[]),h.push(i[0]);const f=[];for(let p=0;p0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,c.degrees===90?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new tO(a.trim());t.readEntry(i,a=t.readLine())!==0;){const c=n[i[0]];c&&c(o)}this.pages.push(o)}}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 a=t.indexOf(",",r);if(a===-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,a-r).trim(),r=a+1,n===4)return 4}}}class tO{constructor(e){x(this,"name");x(this,"minFilter",Ro.Nearest);x(this,"magFilter",Ro.Nearest);x(this,"uWrap",Po.ClampToEdge);x(this,"vWrap",Po.ClampToEdge);x(this,"texture",null);x(this,"width",0);x(this,"height",0);x(this,"pma",!1);x(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 Lw extends Bw{constructor(t,i){super();x(this,"page");x(this,"name");x(this,"x",0);x(this,"y",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0);x(this,"index",0);x(this,"degrees",0);x(this,"names",null);x(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}}const qh=class qh{constructor(e){x(this,"name");x(this,"timelineAttachment");x(this,"timelineSlots",qh.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,a=this.timelineSlots.length;r>1)*h;const l=i.appliedPose.deform;let c=this.vertices;const u=this.bones;if(!u){l.length>0&&(c=l);const m=i.bone.appliedPose,g=m.worldX,v=m.worldY,b=m.a,y=m.b,w=m.c,A=m.d;for(let M=n,_=o;_=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 uo._nextID++}};x(uo,"_nextID",0);let Fo=uo;var Gi;(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"})(Gi||(Gi={}));const Dw=[Gi.hold,Gi.once,Gi.loop,Gi.pingpong,Gi.onceReverse,Gi.loopReverse,Gi.pingpongReverse];class Op{constructor(e,t,i){x(this,"name");x(this,"timelines",[]);x(this,"timelineIds");x(this,"bones");x(this,"color",new bt(1,1,1,1));x(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=i,this.timelineIds=new K3,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 iO(s){return typeof s=="object"&&s!==null&&typeof s.slotIndex=="number"}class Xa extends ii{constructor(t,i,...n){super(t,...n);x(this,"curves");this.curves=lt.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=lt.newFloatArray(i);lt.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,a,o,h,l,c,u,d){const f=this.curves;let p=this.getFrameCount()+t*18;n===0&&(f[i]=2+p);const m=(r-o*2+l)*.03,g=(a-h*2+c)*.03,v=((o-l)*3-r+u)*.006,b=((h-c)*3-a+d)*.006;let y=m*2+v,w=g*2+b,A=(o-r)*.3+m+v*.16666667,M=(h-a)*.3+g+b*.16666667,_=r+A,R=a+M;for(let P=p+18;pt){const c=this.frames[i],u=this.frames[i+n];return u+(t-c)/(a[r]-c)*(a[r+1]-u)}const o=r+18;for(r+=2;r=t){const c=a[r-2],u=a[r-1];return u+(t-c)/(a[r]-c)*(a[r+1]-u)}i+=this.getFrameEntries();const h=a[o-2],l=a[o-1];return l+(t-h)/(this.frames[i]-h)*(this.frames[i+n]-l)}}class rr extends Xa{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],a=t[i+1];return a+(e-r)/(t[i+2]-r)*(t[i+2+1]-a)}case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r,a){if(e>2];switch(f){case 0:{const p=u[d];h=u[d+1],l=u[d+2],c=u[d+3];const m=(i-p)/(u[d+4]-p);h+=(u[d+4+1]-h)*m,l+=(u[d+4+2]-l)*m,c+=(u[d+4+3]-c)*m;break}case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(n!==1)if(r===it.setup){const p=e.data.setupPose.color;h=p.r+(h-p.r)*n,l=p.g+(l-p.g)*n,c=p.b+(c-p.b)*n}else h=o.r+(h-o.r)*n,l=o.g+(l-o.g)*n,c=o.b+(c-o.b)*n;o.r=h<0?0:h>1?1:h,o.g=l<0?0:l>1?1:l,o.b=c<0?0:c>1?1:c}}class Kw extends rr{constructor(t,i,n){super(t,i,`${yt.alpha}|${n}`);x(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,a,o,h,l,c){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=(c?u.appliedPose:u.pose).color;let f=0;const p=this.frames;if(n1?1:f}}class Zw extends Pu{constructor(e,t,i){super(e,t,i,`${yt.rgb}|${i}`,`${yt.alpha}|${i}`,`${yt.rgb2}|${i}`)}getFrameEntries(){return 8}setFrame(e,t,i,n,r,a,o,h,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]=a,this.frames[e+5]=o,this.frames[e+6]=h,this.frames[e+7]=l}apply1(e,t,i,n,r,a){const o=t.color,h=t.darkColor;let l=0,c=0,u=0;const d=this.frames;if(i>3];switch(b){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],c=d[v+6],u=d[v+7];const w=(i-y)/(d[v+8]-y);f+=(d[v+8+1]-f)*w,p+=(d[v+8+2]-p)*w,m+=(d[v+8+3]-m)*w,g+=(d[v+8+4]-g)*w,l+=(d[v+8+5]-l)*w,c+=(d[v+8+6]-c)*w,u+=(d[v+8+7]-u)*w;break}case 1:f=d[v+1],p=d[v+2],m=d[v+3],g=d[v+4],l=d[v+5],c=d[v+6],u=d[v+7];break;default:f=this.getBezierValue(i,v,1,b-2),p=this.getBezierValue(i,v,2,b+18-2),m=this.getBezierValue(i,v,3,b+36-2),g=this.getBezierValue(i,v,4,b+54-2),l=this.getBezierValue(i,v,5,b+72-2),c=this.getBezierValue(i,v,6,b+90-2),u=this.getBezierValue(i,v,7,b+108-2)}if(n===1)o.set(f,p,m,g);else if(r===it.setup){const y=e.data.setupPose;let w=y.color;o.set(w.r+(f-w.r)*n,w.g+(p-w.g)*n,w.b+(m-w.b)*n,w.a+(g-w.a)*n),w=y.darkColor,l=w.r+(l-w.r)*n,c=w.g+(c-w.g)*n,u=w.b+(u-w.b)*n}else o.add((f-o.r)*n,(p-o.g)*n,(m-o.b)*n,(g-o.a)*n),l=h.r+(l-h.r)*n,c=h.g+(c-h.g)*n,u=h.b+(u-h.b)*n;h.r=l<0?0:l>1?1:l,h.g=c<0?0:c>1?1:c,h.b=u<0?0:u>1?1:u}}class Jw extends Pu{constructor(e,t,i){super(e,t,i,`${yt.rgb}|${i}`,`${yt.rgb2}|${i}`)}getFrameEntries(){return 7}setFrame(e,t,i,n,r,a,o,h){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]=a,this.frames[e+5]=o,this.frames[e+6]=h}apply1(e,t,i,n,r,a){const o=t.color,h=t.darkColor;let l=0,c=0,u=0,d=0,f=0,p=0;const m=this.frames;if(i1?1:l,o.g=c<0?0:c>1?1:c,o.b=u<0?0:u>1?1:u,h.r=d<0?0:d>1?1:d,h.g=f<0?0:f>1?1:f,h.b=p<0?0:p>1?1:p}}class bl extends ii{constructor(t,i){super(t,`${yt.attachment}|${i}`);x(this,"slotIndex",0);x(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,a,o,h,l,c){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=c?u.appliedPose:u.pose;l||nt){const l=this.frames[i];return n[r+1]*(t-l)/(n[r]-l)}const a=r+18;for(r+=2;r=t){const l=n[r-2],c=n[r-1];return c+(t-l)/(n[r]-l)*(n[r+1]-c)}const o=n[a-2],h=n[a-1];return h+(1-h)*(t-o)/(this.frames[i+this.getFrameEntries()]-o)}apply(t,i,n,r,a,o,h,l,c){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,c))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 b=ii.search(f,n);g=this.getCurvePercent(n,b),p=this.vertices[b],m=this.vertices[b+1]}const v=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],c,p,m,g,v,a,o,h);for(const b of d)this.applyToSlot(u[b],c,p,m,g,v,a,o,h)}applyBeforeFirst(t,i,n,r){if(!t.bone.active)return;const a=i?t.appliedPose:t.pose;if(a.attachment==null||a.attachment.timelineAttachment!==this.attachment)return;const o=a.deform;switch(o.length===0&&(r=it.setup),r){case it.setup:o.length=0;break;case it.first:{if(n===1){o.length=0;return}const h=this.vertices[0].length;o.length=h;const l=o,c=a.attachment;if(c.bones===null){const u=c.vertices;for(let d=0;d>4,c=h.attachment.sequence.regions.length;const u=Dw[a&15];if(u!==Gi.hold)switch(l+=(n-r)/o+1e-5|0,u){case Gi.once:l=Math.min(c-1,l);break;case Gi.loop:l%=c;break;case Gi.pingpong:{const d=(c<<1)-2;l=d===0?0:l%d,l>=c&&(l=d-l);break}case Gi.onceReverse:l=Math.max(c-1-l,0);break;case Gi.loopReverse:l=c-1-l%c;break;case Gi.pingpongReverse:{const d=(c<<1)-2;l=d===0?0:(l+c-1)%d,l>=c&&(l=d-l)}}h.sequenceIndex=l}};x(ks,"ENTRIES",3),x(ks,"MODE",1),x(ks,"DELAY",2);let Hh=ks;const Zh=class Zh extends ii{constructor(t){super(t,...Zh.propertyIds);x(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,a,o,h,l,c){if(!r)return;const u=this.frames,d=this.frames.length;if(i>n)this.apply(null,i,Number.MAX_VALUE,r,0,o,!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])}};x(Zh,"propertyIds",[`${yt.event}`]);let Xl=Zh;const fo=class fo extends ii{constructor(t){super(t,...fo.propertyIds);x(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,a,o,h,l,c){const u=c?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(l||n>2];switch(b){case 0:{const w=f[v];p=f[v+1],m=f[v+2],g=f[v+3];const A=(n-w)/(f[v+4]-w);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,b-2),m=this.getBezierValue(n,v,2,b+18-2),g=this.getBezierValue(n,v,3,b+36-2)}const y=o===it.setup?u.data.setupPose:d;h?(d.mixRotate=y.mixRotate+p*a,d.mixX=y.mixX+m*a,d.mixY=y.mixY+g*a):(d.mixRotate=y.mixRotate+(p-y.mixRotate)*a,d.mixX=y.mixX+(m-y.mixX)*a,d.mixY=y.mixY+(g-y.mixY)*a)}}class Jr extends Jl{constructor(e,t,i,n){super(e,t,i,n)}apply(e,t,i,n,r,a,o,h,l){if(o&&!this.additive&&(o=!1),this.constraintIndex===-1){const c=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,a,o,this.get(f),this.get(d.data.setupPose),c))}}else{const c=e.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;this.set(u,this.getAbsoluteValue(i,r,a,o,this.get(u),this.get(c.data.setupPose)))}}}}class rS extends Jr{constructor(e,t,i){super(e,t,i,yt.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class aS extends Jr{constructor(e,t,i){super(e,t,i,yt.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class oS extends Jr{constructor(e,t,i){super(e,t,i,yt.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class lS extends Jr{constructor(e,t,i){super(e,t,i,yt.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class cS extends Jr{constructor(e,t,i){super(e,t,i,yt.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class hS extends Jr{constructor(e,t,i){super(e,t,i,yt.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class uS extends Jr{constructor(e,t,i){super(e,t,i,yt.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const Jh=class Jh extends ii{constructor(t,i){super(t,...Jh.propertyIds);x(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,a,o,h,l,c){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,[],a,o,!1,!1,!1),i=-1;else if(i>=d[d.length-1])return;if(!(n=d[ii.search(d,i)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};x(Jh,"propertyIds",[yt.physicsConstraintReset.toString()]);let jh=Jh;class dS extends Jl{constructor(e,t,i){super(e,t,i,yt.sliderTime)}apply(e,t,i,n,r,a,o,h,l){const c=e.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.time=this.getAbsoluteValue(i,r,a,o,u.time,c.data.setupPose.time)}}}class fS extends Jl{constructor(e,t,i){super(e,t,i,yt.sliderMix),this.additive=!0}apply(e,t,i,n,r,a,o,h,l){const c=e.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.mix=this.getAbsoluteValue(i,r,a,o,u.mix,c.data.setupPose.mix)}}}const _l=class _l{constructor(e){x(this,"data");x(this,"tracks",[]);x(this,"timeScale",1);x(this,"unkeyedState",0);x(this,"events",[]);x(this,"listeners",[]);x(this,"queue",new aO(this));x(this,"propertyIds",new Map);x(this,"animationsChanged",!1);x(this,"trackEntryPool",new J3(()=>new rO));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=a,r.delay>0)continue;a=-r.delay,r.delay=0}let o=r.next;if(o){const h=r.trackLast-o.delay;if(h>=0){for(o.delay=0,o.trackTime+=r.timeScale===0?0:(h/r.timeScale+e)*o.timeScale,r.trackTime+=a,this.setTrack(i,o,!0);o.mixingFrom;)o.mixTime+=e,o=o.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 h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=a}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 o=0,h=i.length;o0)continue;n=!0;let c=l.alpha;l.mixingFrom?c*=this.applyMixingFrom(l,e):l.trackTime>=l.trackEnd&&!l.next&&(c=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(o===0&&c===1)for(let v=0;v=l.alphaAttachmentThreshold,y=l.additive,w=y||l.shortestRotation,A=!w&&l.timelinesRotation.length!==g<<1;A&&(l.timelinesRotation.length=g<<1);for(let M=0;M0?h/o:a,c=i.animation.timelines,u=c.length,d=i.timelineMode,f=i.timelineHoldMix,p=r=i.alphaAttachmentThreshold);else{const B=!m||!(P instanceof Hr)||I===it.current;P.apply(t,w,M,_,k,I,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 a=t.slots[e.slotIndex];if(!a.bone.active||!r&&a.attachmentState===this.unkeyedState+fy)return;let o=i=0,A=v>=0;Math.abs(b)<=90&&Ve.signum(b)!==Ve.signum(g)&&(Math.abs(v-y)>180?(m+=360*Ve.signum(v),A=w):y!==0?m-=360*Ve.signum(v):A=w),A!==w&&(m+=360*Ve.signum(v)),a[o]=m}a[o+1]=g,c.rotation=f+m*n}queueEvents(e,t){const i=e.animationStart,n=e.animationEnd,r=n-i,a=e.reverse;let o=e.trackLast%r;a&&(o=r-o);const h=this.events;let l=0,c=h.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,a=n-i,o=e.animation.timelines;for(let h=0,l=e.animation.timelines.length;h=a){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=a);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 a=this.trackEntry(e,t,i,r);return this.setTrack(e,a,n),this.queue.drain(),a}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 a=this.trackEntry(e,t,i,r);return r?(r.next=a,a.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-a.mixDuration,0))):(this.setTrack(e,a,!0),this.queue.drain(),n<0&&(n=0)),a.delay=n,a}setEmptyAnimation(e,t=0){const i=this.setAnimation(e,_l.emptyAnimation,!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){const n=this.addAnimation(e,_l.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&&(a[d]=v);break}}h&&(g=g&~Nc|r[d]&Nc),r[d]=g}}from(e,t,i){const n=this.propertyIds;let r=oO;for(let a=0,o=i.length;a= 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()}};x(_l,"emptyAnimation",new Op("",[],0));let ly=_l;class rO{constructor(){x(this,"animation",null);x(this,"previous",null);x(this,"next",null);x(this,"mixingFrom",null);x(this,"mixingTo",null);x(this,"listener",null);x(this,"trackIndex",0);x(this,"loop",!1);x(this,"additive",!1);x(this,"reverse",!1);x(this,"shortestRotation",!1);x(this,"keepHold",!1);x(this,"eventThreshold",0);x(this,"mixAttachmentThreshold",0);x(this,"alphaAttachmentThreshold",0);x(this,"mixDrawOrderThreshold",0);x(this,"animationStart",0);x(this,"animationEnd",0);x(this,"animationLast",0);x(this,"nextAnimationLast",0);x(this,"delay",0);x(this,"trackTime",0);x(this,"trackLast",0);x(this,"nextTrackLast",0);x(this,"trackEnd",0);x(this,"timeScale",0);x(this,"alpha",0);x(this,"mixTime",0);x(this,"mixDuration",0);x(this,"totalAlpha",0);x(this,"mixInterpolation",Ao.linear);x(this,"timelineMode",[]);x(this,"timelineHoldMix",[]);x(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===Ao.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=Ao.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 aO{constructor(e){x(this,"objects",[]);x(this,"drainDisabled",!1);x(this,"animState");this.animState=e}start(e){this.objects.push(gs.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(gs.interrupt),this.objects.push(e)}end(e){this.objects.push(gs.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(gs.dispose),this.objects.push(e)}complete(e){this.objects.push(gs.complete),this.objects.push(e)}event(e,t){this.objects.push(gs.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,i,n,r,a;if(!this.drainDisabled){this.drainDisabled=!0;for(let o=0;o= 0.");if(!i)throw new Error("name cannot be null.");this.index=t,this.parent=n}copy(t){const i=new Fu(this.index,this.name,t);return i.length=this.length,i.setupPose.set(this.setupPose),i}}var mi;(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"})(mi||(mi={}));class km{constructor(){x(this,"bone");x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"scaleX",0);x(this,"scaleY",0);x(this,"shearX",0);x(this,"shearY",0);x(this,"inherit",mi.Normal);x(this,"a",0);x(this,"b",0);x(this,"c",0);x(this,"d",0);x(this,"worldY",0);x(this,"worldX",0);x(this,"world",0);x(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,a=this.shearY;if(!this.bone.parent){const d=e.scaleX,f=e.scaleY,p=(t+r)*Ve.degRad,m=(t+90+a)*Ve.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 o=this.bone.parent.appliedPose;let h=o.a,l=o.b,c=o.c,u=o.d;switch(this.worldX=h*this.x+l*this.y+o.worldX,this.worldY=c*this.x+u*this.y+o.worldY,this.inherit){case mi.Normal:{const d=(t+r)*Ve.degRad,f=(t+90+a)*Ve.degRad,p=Math.cos(d)*i,m=Math.cos(f)*n,g=Math.sin(d)*i,v=Math.sin(f)*n;this.a=h*p+l*g,this.b=h*m+l*v,this.c=c*p+u*g,this.d=c*m+u*v;return}case mi.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,p=(t+r)*Ve.degRad,m=(t+90+a)*Ve.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 mi.NoRotationOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f;h*=p,c*=m;let g=h*h+c*c,v=0;g>Ve.epsilon2?(g=Math.abs(h*u*m-l*p*c)/g,l=c*g,u=h*g,v=t-Ve.atan2Deg(c,h)):(h=0,c=0,v=t-90+Ve.atan2Deg(u,l));const b=(v+r)*Ve.degRad,y=(v+a+90)*Ve.degRad,w=Math.cos(b)*i,A=Math.cos(y)*n,M=Math.sin(b)*i,_=Math.sin(y)*n;this.a=(h*w-l*M)*d,this.b=(h*A-l*_)*d,this.c=(c*w+u*M)*f,this.d=(c*A+u*_)*f;break}case mi.NoScale:case mi.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f,g=t*Ve.degRad,v=Math.cos(g),b=Math.sin(g);let y=(h*v+l*b)*p,w=(c*v+u*b)*m;const A=1/Math.sqrt(y*y+w*w);y*=A,w*=A;let M=-w,_=y;this.inherit===mi.NoScale&&h*u-l*c<0!=(d<0!=f<0)&&(M=-M,_=-_);const R=r*Ve.degRad,P=(90+a)*Ve.degRad,F=Math.cos(R)*i,I=Math.cos(P)*n,k=Math.sin(R)*i,B=Math.sin(P)*n;this.a=(y*F+M*k)*d,this.b=(y*I+M*B)*d,this.c=(w*F+_*k)*f,this.d=(w*I+_*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,b=1/i;this.x=(this.worldX-e.x)*v,this.y=(this.worldY-e.y)*b,this.set5(this.a*v,this.b*v,this.c*b,this.d*b,0);return}const n=this.bone.parent.appliedPose;let r=n.a,a=n.b,o=n.c,h=n.d;const l=r*h-a*o,c=1/(r*h-a*o),u=h*c,d=a*c,f=o*c,p=r*c,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 mi.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 mi.OnlyTranslation:{const v=1/t,b=1/i;this.set5(this.a*v,this.b*v,this.c*b,this.d*b,0);break}case mi.NoRotationOrReflection:{const v=1/t,b=1/i;r*=v,o*=b;const y=this.a*v,w=this.b*v,A=this.c*b,M=this.d*b,_=1/(r*r+o*o),R=1/Math.abs(l*v*b);this.set5((r*y+o*A)*_,(r*w+o*M)*_,(r*A-o*y)*R,(r*M-o*w)*R,Ve.atan2Deg(o,r));break}case mi.NoScale:case mi.NoScaleOrReflection:{const v=1/t,b=1/i,y=this.a*v,w=this.b*v,A=this.c*b,M=this.d*b;let _=h*this.a-a*this.c,R=r*this.c-o*this.a;l<0&&(_=-_,R=-R);let P=Ve.atan2Deg(R,_);this.rotation=P,P*=Ve.degRad;const F=Math.cos(P),I=Math.sin(P);let k=(r*F+a*I)*v,B=(o*F+h*I)*b;const D=1/Math.sqrt(k*k+B*B);k*=D,B*=D;const U=this.inherit===mi.NoScale&&l<0!=(t<0!=i<0)?-1:1;this.set4(k*y+B*A,k*w+B*M,(k*A-B*y)*U,(k*M-B*w)*U)}}}set4(e,t,i,n){const r=e*e+i*i,a=t*t+n*n;r>Ve.epsilon2?(this.shearX=Ve.atan2Deg(i,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(a),a>Ve.epsilon2?(this.shearY=Ve.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 a=e*e+i*i,o=t*t+n*n;if(a>Ve.epsilon2){const h=Ve.atan2Deg(i,e);this.rotation=h+r,this.scaleX=Math.sqrt(a),this.scaleY=Math.sqrt(o),o>Ve.epsilon2?(this.shearY=Ve.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90-h):this.shearY-=90+h,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(o),this.shearY=0,this.rotation=o>Ve.epsilon2?Ve.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,a,o,h,l,c,u){typeof n=="number"?kr.apply1(t,i,n,r,a,o,h,l):kr.apply2(t,i,n,r,a,o,h,l,c,u)}static apply1(t,i,n,r,a,o,h,l){i.modifyLocal(t);const c=i.bone.parent.appliedPose;let u=c.a,d=c.b,f=c.c,p=c.d,m=-i.shearX-i.rotation,g=0,v=0;switch(i.inherit){case mi.OnlyTranslation:g=(n-i.worldX)*Ve.signum(t.scaleX),v=(r-i.worldY)*Ve.signum(t.scaleY);break;case mi.NoRotationOrReflection:{const b=Math.abs(u*p-d*f)/Math.max(Ve.epsilon,u*u+f*f),y=u/t.scaleX,w=f/t.scaleY;d=-w*b*t.scaleX,p=y*b*t.scaleY,m+=Ve.atan2Deg(w,y)}default:{const b=n-c.worldX,y=r-c.worldY,w=u*p-d*f;Math.abs(w)<=Ve.epsilon?(g=0,v=0):(g=(b*p-y*d)/w-i.x,v=(y*u-b*f)/w-i.y)}}if(m+=Ve.atan2Deg(v,g),i.scaleX<0&&(m+=180),m>180?m-=360:m<=-180&&(m+=360),i.rotation+=m*l,a||o){switch(i.inherit){case mi.NoScale:case mi.NoScaleOrReflection:g=n-i.worldX,v=r-i.worldY}const b=i.bone.data.length*i.scaleX;if(b>Ve.epsilon){const y=g*g+v*v;if(a&&yb*b){const w=(Math.sqrt(y)/b-1)*l+1;switch(i.scaleX*=w,h){case cs.Uniform:i.scaleY*=w;break;case cs.Volume:i.scaleY/=w<.7?.25+.642857*w:w}}}}}static apply2(t,i,n,r,a,o,h,l,c,u){if(i.inherit!==mi.Normal||n.inherit!==mi.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,b=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,b=180):b=0;let w=0,A=0,M=i.a,_=i.b,R=i.c,P=i.d;const F=Math.abs(p-m)<=Ve.epsilon;!F||h?(n.y=0,w=M*n.x+i.worldX,A=R*n.x+i.worldY):(w=M*n.x+_*n.y+i.worldX,A=R*n.x+P*n.y+i.worldY);const I=i.bone.parent.appliedPose;M=I.a,_=I.b,R=I.c,P=I.d;let k=M*P-_*R,B=w-I.worldX,D=A-I.worldY;k=Math.abs(k)<=Ve.epsilon?0:1/k;const U=(B*P-D*_)*k-d,L=(D*M-B*R)*k-f;let N=Math.sqrt(U*U+L*L),O=n.bone.data.length*g,X,E;if(N0){let me=Math.min(1,fe/(c*2))-1;me=(fe-c*(1-me*me))/K,V-=me*V,q-=me*q,W=V*V+q*q}}e:if(F){O*=p;let K=(W-N*N-O*O)/(2*N*O);if(K<-1)K=-1,E=Math.PI*o;else if(K>1){if(K=1,E=0,h)switch(M=(Math.sqrt(W)/(N+O)-1)*u+1,i.scaleX*=M,l){case cs.Uniform:i.scaleY*=M;break;case cs.Volume:i.scaleY/=M<.7?.25+.642857*M:M}}else E=Math.acos(K)*o;M=N+O*K,_=O*Math.sin(E),X=Math.atan2(q*M-V*_,V*M+q*_)}else{M=p*O,_=m*O;const K=M*M,fe=_*_,me=Math.atan2(q,V);R=fe*N*N+K*W-K*fe;const we=-2*fe*N,Ee=fe-K;if(P=we*we-4*Ee*R,P>=0){let ve=Math.sqrt(P);we<0&&(ve=-ve),ve=-(we+ve)*.5;let le=ve/Ee,ye=R/ve;const ae=Math.abs(le)=0){D=Math.sqrt(le)*o,X=me-Math.atan2(D,ae),E=Math.atan2(D/m,(ae-N)/p);break e}}let ge=Ve.PI,Te=N-M,G=Te*Te,Z=0,z=0,j=N+M,te=j*j,he=0;R=-M*N/(K-fe),R>=-1&&R<=1&&(R=Math.acos(R),B=M*Math.cos(R)+N,D=_*Math.sin(R),P=B*B+D*D,Pte&&(z=R,te=P,j=B,he=D)),W<=(G+te)*.5?(X=me-Math.atan2(Z*o,Te),E=ge*o):(X=me-Math.atan2(he*o,j),E=z*o)}const J=Math.atan2(n.y,n.x)*y;X=(X-J)*Ve.radDeg+v-i.rotation,X>180?X-=360:X<=-180&&(X+=360),i.rotation+=X*u,E=((E+J)*Ve.radDeg-n.shearX)*y+b-n.rotation,E>180?E-=360:E<=-180&&(E+=360),n.rotation+=E*u}}class Qc extends ec{constructor(t){super(t,new Fm);x(this,"bones",[]);x(this,"_target",null);x(this,"_scaleYMode",cs.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 kr(this,t)}}class Om{constructor(){x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(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 eh extends ec{constructor(t){super(t,new Om);x(this,"bones",[]);x(this,"_slot",null);x(this,"positionMode",Ln.Fixed);x(this,"spacingMode",Pi.Fixed);x(this,"rotateMode",Ra.Chain);x(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 Bm(this,t)}}var Ln;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(Ln||(Ln={}));var Pi;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(Pi||(Pi={}));var Ra;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(Ra||(Ra={}));const js=class js extends Ql{constructor(t,i){super(t,new Om,new Om);x(this,"data");x(this,"bones");x(this,"slot");x(this,"spaces",[]);x(this,"positions",[]);x(this,"world",[]);x(this,"curves",[]);x(this,"lengths",[]);x(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 js(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.slot.appliedPose.attachment;if(!(n instanceof Vl))return;const r=this.appliedPose,a=r.mixRotate,o=r.mixX,h=r.mixY;if(a===0&&o===0&&h===0)return;const l=this.data,c=l.rotateMode===Ra.Tangent,u=l.rotateMode===Ra.ChainScale,d=this.bones,f=d.length,p=c?f:f+1,m=lt.setArraySize(this.spaces,p),g=u?this.lengths=lt.setArraySize(this.lengths,f):[],v=r.spacing;switch(l.spacingMode){case Pi.Percent:if(u)for(let _=0,R=p-1;_0){_=p/_*v;for(let R=1;R0?Ve.degRad:-Ve.degRad}for(let _=0,R=3;_0){let D=P.a,U=P.b,L=P.c,N=P.d,O=0,X=0,E=0;if(c?O=b[R-1]:m[_+1]===0?O=b[R+2]:O=Math.atan2(B,k),O-=Math.atan2(L,D),M){X=Math.cos(O),E=Math.sin(O);const V=P.bone.data.length;y+=(V*(X*D-E*L)-k)*a,w+=(V*(E*D+X*L)-B)*a}else O+=A;O>Ve.PI?O-=Ve.PI2:O<-Ve.PI&&(O+=Ve.PI2),O*=a,X=Math.cos(O),E=Math.sin(O),P.a=X*D-E*L,P.b=X*U-E*N,P.c=E*D+X*L,P.d=E*U+X*N}}}computeWorldPositions(t,i,n,r){const a=this.slot;let o=this.appliedPose.position,h=this.spaces,l=lt.setArraySize(this.positions,n*3+2),c=this.world;const u=i.closed;let d=i.worldVerticesLength,f=d/6,p=js.NONE;if(!i.constantSpeed){const E=i.lengths;f-=u?1:2;const V=E[f];this.data.positionMode===Ln.Percent&&(o*=V);let q;switch(this.data.spacingMode){case Pi.Percent:q=V;break;case Pi.Proportional:q=V/n;break;default:q=1}c=lt.setArraySize(this.world,8);for(let W=0,J=0,K=0;WV){p!==js.AFTER&&(p=js.AFTER,i.computeWorldVertices(t,a,d-6,4,c,0,2)),this.addAfterPosition(me-V,c,0,l,J);continue}for(;;K++){const we=E[K];if(!(me>we)){if(K===0)me/=we;else{const Ee=E[K-1];me=(me-Ee)/(we-Ee)}break}}K!==p&&(p=K,u&&K===f?(i.computeWorldVertices(t,a,d-4,4,c,0,2),i.computeWorldVertices(t,a,0,4,c,4,2)):i.computeWorldVertices(t,a,K*6+2,8,c,0,2)),this.addCurvePosition(me,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],l,J,r||W>0&&fe===0)}return l}u?(d+=2,c=lt.setArraySize(this.world,d),i.computeWorldVertices(t,a,2,d-4,c,0,2),i.computeWorldVertices(t,a,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(f--,d-=4,c=lt.setArraySize(this.world,d),i.computeWorldVertices(t,a,2,d,c,0,2));const m=lt.setArraySize(this.curves,f);let g=0,v=c[0],b=c[1],y=0,w=0,A=0,M=0,_=0,R=0,P=0,F=0,I=0,k=0,B=0,D=0,U=0,L=0;for(let E=0,V=2;Eg){this.addAfterPosition(K-g,c,d-4,l,V);continue}for(;;q++){const fe=m[q];if(!(K>fe)){if(q===0)K/=fe;else{const me=m[q-1];K=(K-me)/(fe-me)}break}}if(q!==p){p=q;let fe=q*6;for(v=c[fe],b=c[fe+1],y=c[fe+2],w=c[fe+3],A=c[fe+4],M=c[fe+5],_=c[fe+6],R=c[fe+7],P=(v-y*2+A)*.03,F=(b-w*2+M)*.03,I=((y-A)*3-v+_)*.006,k=((w-M)*3-b+R)*.006,B=P*2+I,D=F*2+k,U=(y-v)*.3+P+I*.16666667,L=(w-b)*.3+F+k*.16666667,X=Math.sqrt(U*U+L*L),O[0]=X,fe=1;fe<8;fe++)U+=B,L+=D,B+=I,D+=k,X+=Math.sqrt(U*U+L*L),O[fe]=X;U+=B,L+=D,X+=Math.sqrt(U*U+L*L),O[8]=X,U+=B+I,L+=D+k,X+=Math.sqrt(U*U+L*L),O[9]=X,W=0}for(K*=X;;W++){const fe=O[W];if(!(K>fe)){if(W===0)K/=fe;else{const me=O[W-1];K=W+(K-me)/(fe-me)}break}}this.addCurvePosition(K*.1,v,b,y,w,A,M,_,R,l,V,r||E>0&&J===0)}return l}addBeforePosition(t,i,n,r,a){const o=i[n],h=i[n+1],l=i[n+2]-o,c=i[n+3]-h,u=Math.atan2(c,l);r[a]=o+t*Math.cos(u),r[a+1]=h+t*Math.sin(u),r[a+2]=u}addAfterPosition(t,i,n,r,a){const o=i[n+2],h=i[n+3],l=o-i[n],c=h-i[n+1],u=Math.atan2(c,l);r[a]=o+t*Math.cos(u),r[a+1]=h+t*Math.sin(u),r[a+2]=u}addCurvePosition(t,i,n,r,a,o,h,l,c,u,d,f){if(t===0||Number.isNaN(t)){u[d]=i,u[d+1]=n,u[d+2]=Math.atan2(a-n,r-i);return}const p=t*t,m=p*t,g=1-t,v=g*g,b=v*g,y=g*t,w=y*3,A=g*w,M=w*t,_=i*b+r*A+o*M+l*m,R=n*b+a*A+h*M+c*m;u[d]=_,u[d+1]=R,f&&(t<.001?u[d+2]=Math.atan2(a-n,r-i):u[d+2]=Math.atan2(R-(n*v+a*y*2+h*p),_-(i*v+r*y*2+o*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,a=this.bones.length;for(let o=0;o0,o=this.data.y>0,h=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,c=this.bone;let u=c.bone.data.length,d=this.data.step,f=0;if(i!==ga.none){switch(c.modifyWorld(t),i){case ga.reset:this.reset(t);case ga.update:{const p=Math.max(t.time-this.lastTime,0),m=this.remaining;this.remaining+=p,this.lastTime=t.time;const g=c.worldX,v=c.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=v;else{let b=this.remaining,y=n.inertia,w=t.data.referenceScale,A=-1,M=0,_=0,R=this.data.limit*p,P=R*Math.abs(t.scaleY);if(R*=Math.abs(t.scaleX),a||o){if(a){const F=(this.ux-g)*y;this.xOffset+=F>R?R:F<-R?-R:F,this.ux=g}if(o){const F=(this.uy-v)*y;this.yOffset+=F>P?P:F<-P?-P:F,this.uy=v}if(b>=d){const F=this.xOffset,I=this.yOffset;A=n.damping**(60*d),M=d*n.massInverse,_=n.strength;const k=w*n.wind,B=w*n.gravity,D=(k*t.windX+B*t.gravityX)*t.scaleX,U=(k*t.windY+B*t.gravityY)*t.scaleY;do a&&(this.xVelocity+=(D-this.xOffset*_)*M,this.xOffset+=this.xVelocity*d,this.xVelocity*=A),o&&(this.yVelocity-=(U+this.yOffset*_)*M,this.yOffset+=this.yVelocity*d,this.yVelocity*=A),b-=d;while(b>=d);this.xLag=this.xOffset-F,this.yLag=this.yOffset-I}f=Math.max(0,1-b/d),a&&(c.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),o&&(c.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(h||l){let F=Math.atan2(c.c,c.a),I=0,k=0,B=0,D=this.cx-c.worldX,U=this.cy-c.worldY;if(D>R?D=R:D<-R&&(D=-R),U>P?U=P:U<-P&&(U=-P),b=this.remaining,h){B=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-m/d);let L=Math.atan2(U+this.ty,D+this.tx)-F-(this.rotateOffset-f)*B;this.rotateOffset+=(L-Math.ceil(L*Ve.invPI2-.5)*Ve.PI2)*y,L=(this.rotateOffset-f)*B+F,I=Math.cos(L),k=Math.sin(L),l&&(L=u*c.getWorldScaleX(),L>0&&(this.scaleOffset+=(D*I+U*k)*y/L))}else{I=Math.cos(F),k=Math.sin(F);const L=u*c.getWorldScaleX()-this.scaleLag*Math.max(0,1-m/d);L>0&&(this.scaleOffset+=(D*I+U*k)*y/L)}if(b>=d){A===-1&&(A=n.damping**(60*d),M=d*n.massInverse,_=n.strength);const L=n.wind*t.windX+n.gravity*t.gravityX,N=(n.wind*t.windY+n.gravity*t.gravityY)*Nm.yDir,O=this.rotateOffset,X=this.scaleOffset,E=u/w;for(;;)if(b-=d,l&&(this.scaleVelocity+=(L*I-N*k-this.scaleOffset*_)*M,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=A),h){if(this.rotateVelocity-=((L*k+N*I)*E+this.rotateOffset*_)*M,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=A,b0){let b=0;this.data.rotate>0&&(b=p*this.data.rotate,m=Math.sin(b),g=Math.cos(b),v=c.b,c.b=g*v-m*c.d,c.d=m*v+g*c.d),b+=p*this.data.shearX,m=Math.sin(b),g=Math.cos(b),v=c.a,c.a=g*v-m*c.c,c.c=m*v+g*c.c}else p*=this.data.rotate,m=Math.sin(p),g=Math.cos(p),v=c.a,c.a=g*v-m*c.c,c.c=m*v+g*c.c,v=c.b,c.b=g*v-m*c.d,c.d=m*v+g*c.d}if(l){let p=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(c.a*=p,c.c*=p,this.data.scaleYMode){case cs.Uniform:c.b*=p,c.d*=p;break;case cs.Volume:p=Math.abs(p),p=p>=.7?1/p:4-3.67347*p,c.b*=p,c.d*=p}}i!==ga.pose&&(this.tx=u*c.a,this.ty=u*c.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 th extends ec{constructor(t){super(t,new Lm);x(this,"_bone",null);x(this,"x",0);x(this,"y",0);x(this,"rotate",0);x(this,"scaleX",0);x(this,"shearX",0);x(this,"limit",0);x(this,"step",0);x(this,"inertiaGlobal",!1);x(this,"strengthGlobal",!1);x(this,"dampingGlobal",!1);x(this,"massGlobal",!1);x(this,"windGlobal",!1);x(this,"gravityGlobal",!1);x(this,"mixGlobal",!1);x(this,"_scaleYMode",cs.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 Ou(this,t)}}typeof Math.fround>"u"&&(Math.fround=(s=>e=>(s[0]=e,s[0]))(new Float32Array(1)));class Um{constructor(){x(this,"time",0);x(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const Ml=class Ml extends Ql{constructor(t,i){super(t,new Um,new Um);x(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 Ml(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,a=r.animation,o=this.bone;if(o!==null){if(!o.active)return;r.local&&o.appliedPose.validateLocalTransform(t),n.time=r.offset+(r.property.value(t,o.appliedPose,r.local,Ml.offsets)-r.property.offset)*r.scale,r.loop?n.time=a.duration+n.time%a.duration:n.time=Math.max(0,n.time)}const h=t.bones,l=a.bones;for(let c=0,u=a.bones.length;c=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 Wh;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(Wh||(Wh={}));class Ym{constructor(){x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(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 Vp extends Ql{constructor(t,i){super(t,new Ym,new Ym);x(this,"bones");x(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 Vp(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,a=r.localSource,o=r.localTarget,h=r.additive,l=r.clamp,c=r.offsets,u=this.source.appliedPose;a&&u.validateLocalTransform(t);const d=r.properties,f=r.properties.length,p=this.bones;for(let m=0,g=this.bones.length;m0?n[Gt.ROTATION]:-n[Gt.ROTATION]);return o<0&&(o+=360),o}}class xS extends Xo{mix(e){return e.mixRotate}apply(e,t,i,n,r,a){if(r)i.rotation+=(a?n:n-i.rotation)*t.mixRotate;else{const o=e.scaleX,h=e.scaleY,l=1/o,c=1/h,u=i.a*l,d=i.b*l,f=i.c*c,p=i.d*c;n*=Ve.degRad,a||(n-=Math.atan2(f,u)),n>Ve.PI?n-=Ve.PI2:n<-Ve.PI&&(n+=Ve.PI2),n*=t.mixRotate;const m=Math.cos(n),g=Math.sin(n);i.a=(m*u-g*f)*o,i.b=(m*d-g*p)*o,i.c=(g*u+m*f)*h,i.d=(g*d+m*p)*h}}}class Gm extends Uo{value(e,t,i,n){return i?t.x+n[Gt.X]:(n[Gt.X]*t.a+n[Gt.Y]*t.b+t.worldX)/e.scaleX}}class bS extends Xo{mix(e){return e.mixX}apply(e,t,i,n,r,a){r?i.x+=(a?n:n-i.x)*t.mixX:(a||(n-=i.worldX/e.scaleX),i.worldX+=n*t.mixX*e.scaleX)}}class Hm extends Uo{value(e,t,i,n){return i?t.y+n[Gt.Y]:(n[Gt.X]*t.c+n[Gt.Y]*t.d+t.worldY)/e.scaleY}}class wS extends Xo{mix(e){return e.mixY}apply(e,t,i,n,r,a){r?i.y+=(a?n:n-i.y)*t.mixY:(a||(n-=i.worldY/e.scaleY),i.worldY+=n*t.mixY*e.scaleY)}}class jm extends Uo{value(e,t,i,n){if(i)return t.scaleX+n[Gt.SCALEX];const r=t.a/e.scaleX,a=t.c/e.scaleY;return Math.sqrt(r*r+a*a)+n[Gt.SCALEX]}}class SS extends Xo{mix(e){return e.mixScaleX}apply(e,t,i,n,r,a){if(r)a?i.scaleX*=1+(n-1)*t.mixScaleX:i.scaleX!==0&&(i.scaleX+=(n-i.scaleX)*t.mixScaleX);else if(a){const o=1+(n-1)*t.mixScaleX;i.a*=o,i.c*=o}else{let o=i.a/e.scaleX,h=i.c/e.scaleY,l=Math.sqrt(o*o+h*h);l!==0&&(l=1+(n-l)*t.mixScaleX/l,i.a*=l,i.c*=l)}}}class Wm extends Uo{value(e,t,i,n){if(i)return t.scaleY+n[Gt.SCALEY];const r=t.b/e.scaleX,a=t.d/e.scaleY;return Math.sqrt(r*r+a*a)+n[Gt.SCALEY]}}class _S extends Xo{mix(e){return e.mixScaleY}apply(e,t,i,n,r,a){if(r)a?i.scaleY*=1+(n-1)*t.mixScaleY:i.scaleY!==0&&(i.scaleY+=(n-i.scaleY)*t.mixScaleY);else if(a){const o=1+(n-1)*t.mixScaleY;i.b*=o,i.d*=o}else{let o=i.b/e.scaleX,h=i.d/e.scaleY,l=Math.sqrt(o*o+h*h);l!==0&&(l=1+(n-l)*t.mixScaleY/l,i.b*=l,i.d*=l)}}}class zm extends Uo{value(e,t,i,n){if(i)return t.shearY+n[Gt.SHEARY];const r=1/e.scaleX,a=1/e.scaleY;return(Math.atan2(t.d*a,t.b*r)-Math.atan2(t.c*a,t.a*r))*Ve.radDeg-90+n[Gt.SHEARY]}}class MS extends Xo{mix(e){return e.mixShearY}apply(e,t,i,n,r,a){if(r)a||(n-=i.shearY),i.shearY+=n*t.mixShearY;else{const o=e.scaleX,h=e.scaleY,l=i.b/o,c=i.d/h,u=Math.atan2(c,l);n=(n+90)*Ve.degRad,a?n-=Ve.PI/2:(n-=u-Math.atan2(i.c/h,i.a/o),n>Ve.PI?n-=Ve.PI2:n<-Ve.PI&&(n+=Ve.PI2)),n=u+n*t.mixShearY;const d=Math.sqrt(l*l+c*c);i.b=Math.cos(n)*d*o,i.d=Math.sin(n)*d*h}}}class P8{constructor(e){x(this,"scale",1);x(this,"attachmentLoader");x(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new vS;i.name="";const n=new cO(e),r=n.readInt32(),a=n.readInt32();i.hash=a===0&&r===0?null:a.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 o=n.readBoolean();o&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let h=0;h=n.readInt(!0);for(let p=0;p>5;for(let w=0,A;w>1&1,v.spacingMode=b>>2&3,v.rotateMode=b>>4&3,(b&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===Pi.Length||v.spacingMode===Pi.Fixed)&&(y.spacing*=t),y.mixRotate=n.readFloat(),y.mixX=n.readFloat(),y.mixY=n.readFloat(),c.push(v);break}case FO:{const v=new th(m);v.bone=l[n.readInt(!0)];let b=n.readByte();if(v.skinRequired=(b&1)!==0,(b&2)!==0&&(v.x=n.readFloat()),(b&4)!==0&&(v.y=n.readFloat()),(b&8)!==0&&(v.rotate=n.readFloat()),(b&16)!==0){let w=n.readFloat();w<-2?(v.scaleYMode=cs.Volume,w=-2-w):w<0&&(v.scaleYMode=cs.Uniform,w=-1-w),v.scaleX=w}(b&32)!==0&&(v.shearX=n.readFloat()),v.limit=((b&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=(b&128)!==0?n.readFloat():1,y.wind=n.readFloat(),y.gravity=n.readFloat(),b=n.readByte(),(b&1)!==0&&(v.inertiaGlobal=!0),(b&2)!==0&&(v.strengthGlobal=!0),(b&4)!==0&&(v.dampingGlobal=!0),(b&8)!==0&&(v.massGlobal=!0),(b&16)!==0&&(v.windGlobal=!0),(b&32)!==0&&(v.gravityGlobal=!0),(b&64)!==0&&(v.mixGlobal=!0),y.mix=(b&128)!==0?n.readFloat():1,c.push(v);break}case OO:{const v=new ya(m),b=n.readByte();if(v.skinRequired=(b&1)!==0,v.loop=(b&2)!==0,v.additive=(b&4)!==0,(b&8)!==0){const y=n.readFloat();o&&(b&64)!==0?v.max=y:v.setupPose.time=y}if((b&16)!==0&&(v.setupPose.mix=(b&32)!==0?n.readFloat():1),(b&64)!==0){v.local=(b&128)!==0,v.bone=l[n.readInt(!0)];const y=n.readFloat();let w=1;switch(n.readByte()){case 0:v.property=new $m;break;case 1:{w=t,v.property=new Gm;break}case 2:{w=t,v.property=new Hm;break}case 3:v.property=new jm;break;case 4:v.property=new Wm;break;case 5:v.property=new zm;break;default:continue}v.property.offset=y*w,v.offset=n.readFloat(),v.scale=n.readFloat()/w}c.push(v);break}}}const d=this.readSkin(n,i,!0,o);d&&(i.defaultSkin=d,i.skins.push(d));{let p=i.skins.length;for(lt.setArraySize(i.skins,h=p+n.readInt(!0));p0){b=[];for(let _=0;_>4,e.readFloat())}r.push(F);break}}}}}const o=i.slots.length,h=e.readInt(!0);if(h>0){const f=new Hr(h);for(let p=0;p0){const f=new Xl(c);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 hO=class{constructor(e,t,i,n,r,a){x(this,"source");x(this,"skinIndex");x(this,"slotIndex");x(this,"sourceIndex");x(this,"mesh");x(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.sourceIndex=n,this.source=r,this.inheritTimelines=a}};class py{constructor(e=null,t,i=0){x(this,"bones");x(this,"vertices");x(this,"length");this.bones=e,this.vertices=t,this.length=i}}var zn;(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"})(zn||(zn={}));function _i(s,e,t,i){t instanceof rr?uO(s,e,t,i):dO(s,e,t,i)}function uO(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i;for(let a=0,o=0,h=t.getFrameCount()-1;t.setFrame(a,n,r),a!==h;a++){const l=s.readFloat(),c=s.readFloat()*i;switch(s.readByte()){case _n:t.setStepped(a);break;case Mn:Lt(s,t,o++,a,0,n,l,r,c,i)}n=l,r=c}e.push(t)}function dO(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i,a=s.readFloat()*i;for(let o=0,h=0,l=t.getFrameCount()-1;t.setFrame(o,n,r,a),o!==l;o++){const c=s.readFloat(),u=s.readFloat()*i,d=s.readFloat()*i;switch(s.readByte()){case _n:t.setStepped(o);break;case Mn:Lt(s,t,h++,o,0,n,c,r,u,i),Lt(s,t,h++,o,1,n,c,a,d,i)}n=c,r=u,a=d}e.push(t)}function gy(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,a=0;for(let o=0;o=0;o--)i[o]===-1&&(i[o]=n[--a]);return i}function Lt(s,e,t,i,n,r,a,o,h,l){e.setBezier(t,i,n,r,o,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,a,h)}const fO=0,mO=1,pO=2,gO=3,vO=4,yO=5,xO=6,bO=7,wO=8,SO=9,_O=10,MO=0,TO=1,AO=2,EO=3,CO=4,IO=5,RO=0,PO=1,kO=2,FO=3,OO=4,BO=0,LO=1,DO=0,NO=1,UO=2,XO=0,VO=1,YO=2,$O=4,GO=5,HO=6,jO=7,WO=8,zO=0,qO=1,_n=1,Mn=2;class KO{constructor(e){x(this,"attachmentLoader");x(this,"scale",1);x(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new vS,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=se(r,"referenceScale",100)*t,i.fps=r.fps,i.imagesPath=r.images??null,i.audioPath=r.audio??null),n.bones)for(let a=0;a0&&l.properties.push(M)}l.offsets[Gt.ROTATION]=se(a,"rotation",0),l.offsets[Gt.X]=se(a,"x",0)*t,l.offsets[Gt.Y]=se(a,"y",0)*t,l.offsets[Gt.SCALEX]=se(a,"scaleX",0),l.offsets[Gt.SCALEY]=se(a,"scaleY",0),l.offsets[Gt.SHEARY]=se(a,"shearY",0);const y=l.setupPose;d&&(y.mixRotate=se(a,"mixRotate",1)),f&&(y.mixX=se(a,"mixX",1)),p&&(y.mixY=se(a,"mixY",y.mixX)),m&&(y.mixScaleX=se(a,"mixScaleX",1)),g&&(y.mixScaleY=se(a,"mixScaleY",y.mixScaleX)),v&&(y.mixShearY=se(a,"mixShearY",1)),i.constraints.push(l);break}case"path":{const l=new eh(o);l.skinRequired=h;for(let f=0;f0){const d=i.findConstraint(l,th);if(!d)throw new Error(`Physics constraint not found: ${l}`);u=i.constraints.indexOf(d)}for(const d in c){const f=c[d];let p=f[0];if(!p)continue;const m=f.length;let g,v=0;if(d==="reset"){const b=new jh(m,u);for(let y=0;p!=null;p=f[y+1],y++)b.setFrame(y,se(p,"time",0));r.push(b);continue}switch(d){case"inertia":g=new rS(m,m,u);break;case"strength":g=new aS(m,m,u);break;case"damping":g=new oS(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}ws(r,f,g,v,1)}}if(e.slider)for(const l in e.slider){const c=e.slider[l],u=i.findConstraint(l,ya);if(!u)throw new Error(`Slider not found: ${l}`);const d=i.constraints.indexOf(u);for(const f in c){const p=c[f];if(!p[0])continue;const g=p.length;switch(f){case"time":ws(r,p,new dS(g,g,d),1,1);break;case"mix":ws(r,p,new fS(g,g,d),1,1);break}}}if(e.attachments)for(const l in e.attachments){const c=e.attachments[l],u=i.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const d in c){const f=c[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],b=u.getAttachment(m,g);if(!b)throw new Error(`Timeline attachment not found: ${g}`);for(const y in v){const w=v[y];let A=w[0];if(A){if(y==="deform"){const M=b.bones,_=b.vertices,R=M?_.length/3*2:_.length,P=new Qw(w.length,w.length,m,b);let F=se(A,"time",0);for(let I=0,k=0;;I++){let B;const D=se(A,"vertices",null);if(!D)B=M?lt.newFloatArray(R):_;else{B=lt.newFloatArray(R);const O=se(A,"offset",0);if(lt.arrayCopy(D,0,B,O,D.length),n!==1)for(let X=O,E=X+D.length;X=0;l--)r[l]===-1&&(r[l]=a[--h]);return r}function Ut(s,e,t,i,n,r,a,o,h,l){if(s==="stepped")return e.setStepped(i),t;const c=n<<2,u=s[c],d=s[c+1]*l,f=s[c+2],p=s[c+3]*l;return e.setBezier(t,i,n,r,o,u,d,f,p,a,h),t+1}function se(s,e,t){return s[e]!==void 0?s[e]:t}class JO{newRegionAttachment(e,t,i,n){return new Cu(t,i)}newMeshAttachment(e,t,i,n){return new Zl(t,i)}newBoundingBoxAttachment(e,t){return new ew(t)}newPathAttachment(e,t){return new Ul(t)}newPointAttachment(e,t){return new aw(t)}newClippingAttachment(e,t){return new To(t)}}class QO{sequence(e){for(let t=0;t!Number.isInteger(c)||c<0||c>=a))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const o=Number(s.hull)||0;if(!Number.isInteger(o)||o<0||o>a)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(s.edges)&&s.edges.some(c=>!Number.isInteger(c)||c<0||c>=a*2||c%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===i.length)return;let h=0,l=0;for(;h=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(h!==n.length||l!==a)throw new Error(`拖尾网格“${e}”的顶点数量与 UV 不一致`)}function iB(s,e){var r,a,o,h;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&&!eB.has(l.inherit))throw new Error(`骨骼“${l.name||""}”的 inherit 值“${l.inherit}”不符合 Spine ${e} JSON 格式`);if(/_particle_\d+_trail_/.test(String(l.name||""))){const c=i.get(String(l.parent||""));if(!c||/_particle_\d+_trail_/.test(String(c.name||"")))throw new Error(`拖尾骨骼“${l.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const l of Array.isArray(s.skins)?s.skins:[]){const c=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(c))for(const d of Object.keys(c[u]||{})){const f=c[u][d];(f==null?void 0:f.type)==="mesh"&&(tB(f,d,t.length),((r=f.vertices)==null?void 0:r.length)!==((a=f.uvs)==null?void 0:a.length)&&n.add(u))}}for(const l of Object.values(s.animations||{}))for(const c of n){const u=(h=(o=l==null?void 0:l.slots)==null?void 0:o[c])==null?void 0:h.attachment;if(Array.isArray(u)&&u.some(d=>!(d!=null&&d.name)))throw new Error(`加权拖尾插槽“${c}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0`)}}function sB(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 yy(s,e){var a;const t=JSON.parse(s),i=Ph((a=t==null?void 0:t.skeleton)==null?void 0:a.spine);if(!i)throw new Error(`导出版本不受支持,仅支持 Spine ${Mm()}`);if(e&&i!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${i}`);iB(t,i),i==="3.8"&&sB(t);const n=i==="3.8"?xw(JSON.parse(JSON.stringify(t))):t,r=i==="4.3"?new KO(new QO).readSkeletonData(n):new Dh(new JO).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 TS="http://127.0.0.1:27843";class zh extends Error{constructor(t,i="CONNECTOR_ERROR",n){super(t);x(this,"code");x(this,"pairUrl");this.name="SpineConnectorError",this.code=i,this.pairUrl=n}}function qm(s,e){return String(s||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function nB(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 rB(s,e,t){const i=String(s||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>qm(r,"images")),n=qm(e.replace(/\.[^./\\]+$/,""),"image");return[...i,`${n}${nB(e,t)}`].join("/")}async function Cf(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 a="";const o=32768;for(let h=0;ha.finally(()=>{i++,e==null||e(i,t.length)});for(const a of s.filter(o=>o.visible!==!1)){for(const o of a.config.imageResources)if(o.imageMode==="sequence"&&o.sequenceFrames.length)for(const h of o.sequenceFrames)t.push(n(Cf(h.previewUrl,o.textureFolder,h.name||o.textureName)));else t.push(n(Cf(o.previewUrl,o.textureFolder,o.textureName)));if(a.config.trail)for(const o of a.config.trailResources)t.push(n(Cf(o.previewUrl,"",o.textureName)))}const r=new Map;for(const a of await Promise.all(t))a&&!r.has(a.path)&&r.set(a.path,a);return[...r.values()]}async function aB(){try{const s=await fetch(`${TS}/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 oB(s,e){const t=await AS(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 a=new XMLHttpRequest;a.open("POST",`${TS}/v1/convert`),a.responseType="blob",a.setRequestHeader("Content-Type","application/json"),a.upload.onprogress=o=>{e==null||e({phase:"upload",progress:o.lengthComputable&&o.total>0?o.loaded/o.total:null})},a.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),a.onprogress=o=>{e==null||e({phase:"download",progress:o.lengthComputable&&o.total>0?o.loaded/o.total:null})},a.onerror=()=>r(new zh("未检测到本地 Spine 连接器,请先启动连接器","CONNECTOR_OFFLINE")),a.onload=async()=>{const o=a.response;if(a.status<200||a.status>=300){let c={};try{c=JSON.parse(await o.text())}catch{}r(new zh(c.message||`Spine 连接器返回错误:HTTP ${a.status}`,c.code,c.pairUrl));return}const h=a.getResponseHeader("X-Spine-File-Name");let l=`${qm(s.projectName,"SpineParticle")}.zip`;if(h)try{l=decodeURIComponent(h)}catch{}n({blob:o,fileName:l,spineEditorVersion:a.getResponseHeader("X-Spine-Editor-Version")||s.spineVersion,imageCount:t.length})},a.send(i)})}function lB(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 cB=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 hB(s){let e=4294967295;for(const t of s)e=cB[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function uB(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 dB(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 If(s){const e=new Uint8Array(s);return{bytes:e,view:new DataView(e.buffer)}}function xy(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 fB(s){const e=new TextEncoder,t=[],i=[],n=dB();let r=0;for(const h of s){const l=e.encode(uB(h.name)),c=hB(h.data),u=If(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,c,!0),u.view.setUint32(18,h.data.length,!0),u.view.setUint32(22,h.data.length,!0),u.view.setUint16(26,l.length,!0),t.push(u.bytes,l,h.data);const d=If(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,c,!0),d.view.setUint32(20,h.data.length,!0),d.view.setUint32(24,h.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+h.data.length}const a=xy(i),o=If(22);return o.view.setUint32(0,101010256,!0),o.view.setUint16(8,s.length,!0),o.view.setUint16(10,s.length,!0),o.view.setUint32(12,a.length,!0),o.view.setUint32(16,r,!0),new Blob([xy([...t,a,o.bytes])],{type:"application/zip"})}function mB(s){const e=atob(s),t=new Uint8Array(e.length);for(let i=0;ii===".."||/^[a-z]+:/i.test(i))?"images":t.join("/")}function gB(s){return String(s||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function vB(s){const e=await AS(s.systems);if(!e.length)throw new Error("当前可见粒子系统没有可导出的图片");const t=pB(s.imagesPath);return{blob:fB(e.map(n=>({name:`${t}/${n.path}`,data:mB(n.dataBase64)}))),imageCount:e.length,folder:t}}function yB(s,e){const t=`${gB(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}const xB={class:"panel"},bB={class:"panel-scroll"},wB={class:"group config-management"},SB={class:"caret"},_B={class:"group-body config-management-body"},MB={class:"config-toolbar"},TB=["disabled"],AB={value:""},EB=["value"],CB={class:"group"},IB={class:"caret"},RB={class:"scene-actions"},PB=["disabled"],kB={class:"group-body"},FB={class:"tree scene-tree"},OB=["onClick"],BB={class:"tlabel"},LB=["title","aria-label","onClick"],DB={viewBox:"0 0 24 24","aria-hidden":"true"},NB={key:0,class:"eye-slash",d:"M4 4l16 16"},UB=["onClick"],XB=["onClick"],VB={class:"tlabel"},YB=["title","aria-label","onClick"],$B={viewBox:"0 0 24 24","aria-hidden":"true"},GB={key:0,class:"eye-slash",d:"M4 4l16 16"},HB=["onClick"],jB=["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"},eL=["title","aria-label","onClick"],tL={viewBox:"0 0 24 24","aria-hidden":"true"},iL={key:0,class:"eye-slash",d:"M4 4l16 16"},sL=["onClick"],nL={key:0,class:"empty"},rL={class:"row"},aL={class:"seed-row scene-seed"},oL={class:"field-block"},lL={class:"field-grid"},cL={class:"field-block"},hL={class:"field-block check-field"},uL={class:"field-grid"},dL={class:"compact-field"},fL={class:"compact-field"},mL={class:"field-grid"},pL={class:"compact-field"},gL={class:"compact-field"},vL={key:1,class:"field-grid"},yL={class:"compact-field"},xL={class:"compact-field"},bL={key:2,class:"field-grid"},wL={class:"compact-field"},SL={class:"compact-field"},_L={class:"field-block"},ML={key:4,class:"field-grid"},TL={class:"compact-field"},AL={class:"compact-field"},EL={class:"collider-follow-section"},CL={class:"follow-path"},IL={class:"field-block"},RL=["value"],PL={class:"field-grid"},kL={class:"compact-field"},FL={class:"compact-field"},OL={class:"follow-path"},BL={class:"field-block"},LL={class:"field-grid"},DL={class:"compact-field"},NL={class:"compact-field"},UL={class:"field-grid"},XL={class:"compact-field"},VL={class:"compact-field"},YL={class:"setting-line"},$L={class:"setting-line"},GL={class:"field-block"},HL={key:4,class:"panel-hint"},jL={class:"group"},WL={class:"caret"},zL={class:"group-body"},qL={class:"segs"},KL={class:"segs stream-behavior-segs"},ZL={key:2,class:"stream-loop-options"},JL={class:"loop-section-row"},QL={class:"switch-row"},eD=["checked"],tD={key:0,class:"loop-duration-control"},iD={class:"switch-row loop-duration-toggle"},sD=["checked"],nD={class:"loop-section-duration"},rD=["value"],aD={key:1},oD={key:2,class:"loop-auto-duration"},lD={class:"loop-section-row"},cD={class:"switch-row"},hD=["checked"],uD={key:0,class:"loop-duration-control"},dD={class:"switch-row loop-duration-toggle"},fD=["checked"],mD={class:"loop-section-duration"},pD=["value"],gD={key:1},vD={key:2,class:"loop-auto-duration"},yD={key:3,class:"modifier-hint stream-loop-hint"},xD={class:"group"},bD={class:"caret"},wD={class:"group-body"},SD={class:"row"},_D={class:"row"},MD=["value","disabled"],TD={key:0,class:"row"},AD={class:"row"},ED={key:0,value:"radial"},CD={key:1,value:"path-normal"},ID={key:2,value:"path-tangent"},RD={class:"group"},PD={class:"caret"},kD={class:"group-body attr-body"},FD={class:"attr-axis-head"},OD={class:"axis-modes"},BD={class:"life-item"},LD={class:"switch-row"},DD={class:"life-item"},ND={class:"switch-row"},UD={class:"axis-modes life-axis"},XD={class:"life-item"},VD={class:"switch-row"},YD={class:"group"},$D={class:"caret"},GD={class:"group-body"},HD={class:"seg"},jD={class:"row"},WD={class:"curve-wrap"},zD={class:"row"},qD=["onUpdate:modelValue"],KD=["onUpdate:modelValue"],ZD={class:"row resource-color-row"},JD=["onUpdate:modelValue"],QD=["onUpdate:modelValue"],eN={key:0,class:"row resource-color-picker"},tN=["onUpdate:modelValue"],iN=["value","onChange","onKeydown"],sN={key:0,class:"random-color-hint"},nN={class:"resource-alpha-head"},rN={class:"alpha-modes"},aN=["onClick"],oN=["onClick"],lN=["onClick"],cN={class:"row"},hN=["onUpdate:modelValue"],uN={class:"resource-alpha-curve"},dN={class:"group"},fN={class:"caret"},mN={class:"group-body"},pN={class:"modifier-item"},gN={class:"switch-row modifier-switch"},vN={key:0,class:"modifier-params"},yN={class:"modifier-item"},xN={class:"switch-row modifier-switch"},bN={key:0,class:"modifier-params gravity-params"},wN={class:"modifier-mode-row"},SN={class:"modifier-item"},_N={class:"switch-row modifier-switch"},MN={key:0,class:"modifier-params gravity-params"},TN={class:"modifier-mode-row"},AN={class:"modifier-item"},EN={class:"switch-row modifier-switch"},CN={key:0,class:"modifier-params"},IN={class:"row"},RN={class:"modifier-item"},PN={class:"switch-row modifier-switch"},kN={key:0,class:"modifier-params"},FN={class:"row"},ON={class:"row"},BN={class:"modifier-item"},LN={class:"switch-row modifier-switch"},DN={key:0,class:"modifier-params trail-params"},NN={class:"row"},UN=["onUpdate:modelValue"],XN={class:"row"},VN=["onUpdate:modelValue"],YN={class:"row"},$N=["onUpdate:modelValue"],GN={class:"switch-row trail-sub-switch"},HN=["onUpdate:modelValue"],jN={class:"switch-row trail-sub-switch"},WN=["onUpdate:modelValue"],zN={class:"trail-mode-head"},qN={class:"alpha-modes"},KN=["onClick"],ZN=["onClick"],JN=["onClick"],QN={class:"row"},e5=["onUpdate:modelValue"],t5={key:6,class:"row trail-fixed-color"},i5=["onUpdate:modelValue"],s5=["value","onChange","onKeydown"],n5={class:"trail-mode-head"},r5={class:"alpha-modes"},a5=["onClick"],o5=["onClick"],l5=["onClick"],c5={class:"trail-grid-row"},h5={class:"modifier-item"},u5={class:"switch-row modifier-switch"},d5=["disabled"],f5={key:0,class:"modifier-params emitter-follow-params"},m5={class:"field-block"},p5=["value"],g5={key:0,value:"bone"},v5={class:"field-block"},y5=["value"],x5={class:"field-block"},b5={class:"field-grid follow-grid"},w5={class:"compact-field"},S5={class:"compact-field"},_5={class:"field-block"},M5={key:0,class:"bone-follow-target"},T5={key:1,class:"bone-follow-missing"},A5={class:"field-block"},E5={class:"field-grid follow-grid"},C5={class:"compact-field"},I5={class:"compact-field"},R5={class:"bone-follow-transform-grid"},P5={class:"compact-field"},k5={class:"compact-field"},F5={class:"compact-field"},O5={class:"modifier-item"},B5={class:"switch-row modifier-switch"},L5={key:0,class:"modifier-params collision-filter-params"},D5={class:"collision-filter-tags"},N5=["title"],U5=["aria-label","onClick"],X5=["disabled","title"],V5={key:0,class:"collision-filter-empty"},Y5={key:1,class:"collision-filter-picker"},$5=["onClick"],G5={class:"group"},H5={class:"caret"},j5={class:"group-body export-settings"},W5={class:"export-field"},z5={class:"export-field"},q5={class:"export-field"},K5={key:0,class:"export-help"},Z5={class:"export-fps-row"},J5={class:"export-field export-fps-field"},Q5={class:"export-checkbox"},e4={class:"export-switches"},t4={class:"switch-row export-switch"},i4={class:"switch-row export-switch"},s4={class:"switch-row export-switch export-switch-last"},n4={class:"spine-export-actions"},r4=["disabled","title"],a4=["disabled"],o4=["disabled","title"],l4={key:0},c4=["href"],h4=["href"],u4=nn({__name:"ParticlePanel",setup(s){const e=Kl();e.settings.exportSettings=p1(e.settings.exportSettings);const t=gt(()=>e.settings.exportSettings),i=ht(null),n=ht(""),r=ht([]),a=ht(!1),o=ht(""),h=ht(!1),l=ht(!1),c=ht(null),u=ht(""),d=ht(!1),f=ht(null),p=ht(""),m=ht(""),g=gt(()=>{const $=f.value;return $?$.available?$.spineFound?$.authorized?"连接器可用 · Spine 已就绪":"连接器已启动,当前网站尚未授权":"连接器已启动,但未找到 Spine":"本地 Spine 连接器未启动":"正在检测本地 Spine 连接器…"}),v=gt(()=>{var $,S,C,Q,Fe,ct;return{ready:!!(($=f.value)!=null&&$.available)&&!!((S=f.value)!=null&&S.spineFound)&&!!((C=f.value)!=null&&C.authorized),warning:!!((Q=f.value)!=null&&Q.available)&&(!((Fe=f.value)!=null&&Fe.spineFound)||!((ct=f.value)!=null&&ct.authorized))}}),b=gt(()=>{var $,S,C;return!!(($=f.value)!=null&&$.available)&&!!((S=f.value)!=null&&S.spineFound)&&!!((C=f.value)!=null&&C.authorized)}),y=gt(()=>{const $=f.value;return!($!=null&&$.available)||!$.spineFound||$.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),w=gt(()=>{const $=f.value;return $?$.available?$.spineFound?$.authorized?"":"未授权":"未找到 Spine":"未启动":"检测中"}),A=gt(()=>l.value?"正在重新计算并生成 Spine 工程":w.value?`暂不可用:${w.value}`:`调用本机 Spine 自动生成 ${t.value.spineVersion} 工程`);function M($){return $==="跟随导出"?t.value.keyframeCurve==="bezier"?"bezier":"linear":$==="贝塞尔"?"bezier":"linear"}e.systems.length||e.addSystem();function _(){Tw(e),h.value=!1,o.value="配置已保存到本地"}async function R($){var Q;const S=$.target,C=(Q=S.files)==null?void 0:Q[0];if(C){o.value="正在加载配置…",h.value=!1;try{await VP(e,C),o.value=`已加载:${C.name}`}catch(Fe){h.value=!0,o.value=Fe instanceof Error?Fe.message:String(Fe)}finally{S.value=""}}}async function P(){try{const $=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!$.ok)throw new Error("无法读取预设列表");const S=await $.json();r.value=Array.isArray(S)?S.filter(C=>!!C&&typeof C.name=="string"&&typeof C.file=="string"):[]}catch{r.value=[]}}async function F(){const $=n.value;if(!$)return;a.value=!0,h.value=!1,o.value="正在加载预设…";const S=Kv("加载预设",`正在下载 ${$}…`);try{await S.paint();const C=await fetch(`/Preset/${encodeURIComponent($)}`,{cache:"no-store"});if(!C.ok)throw new Error(`无法读取预设:${$}`);const Q=await _3(C,Fe=>{S.update(Fe==null?null:Fe*55,`正在下载 ${$}…`)});S.update(58,"正在解析预设配置…"),S.update(70,"正在解析并恢复预设资源…"),await Ew(e,Q),o.value=`已加载预设:${$.replace(/\.json$/i,"")}`,await S.finish("预设加载完成")}catch(C){h.value=!0;const Q=C instanceof Error?C.message:String(C);o.value=`${Q},请检查预设文件命名`,await S.fail(Q)}finally{a.value=!1,n.value=""}}La(()=>{P(),B(),I=window.setInterval(B,3e3)});let I,k=0;du(()=>{I!==void 0&&window.clearInterval(I)});async function B(){const $=++k,S=await aB();if($!==k)return;f.value=S;const C=m.value;(C==="CONNECTOR_OFFLINE"?S.available:C==="SPINE_NOT_FOUND"?S.available&&S.spineFound:C==="ORIGIN_NOT_ALLOWED"?S.available&&S.spineFound&&S.authorized:!!C&&S.available&&S.spineFound&&S.authorized)&&(m.value="",p.value="",d.value&&(d.value=!1,u.value=""))}function D(){return new Promise($=>requestAnimationFrame(()=>$()))}async function U($){e.timeline.playing=!1,e.timeline.frame=0,e.timeline.recorded=!1;for(const Q of e.systems)Q.frames=void 0;e.recalcTotalFrames(),await D(),e.timeline.playing=!0;const S=e.timeline.totalFrames/Math.max(1,e.timeline.fps)*1e3,C=performance.now()+Math.max(8e3,S*2.5+3e3);for(;!e.timeline.recorded;){if(performance.now()>C)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");$==null||$(Math.min(.98,e.timeline.frame/Math.max(1,e.timeline.totalFrames-1))),await new Promise(Q=>setTimeout(Q,50))}$==null||$(1)}async function L(){if(!l.value){l.value=!0,c.value="json",d.value=!1,m.value="",p.value="",u.value="正在重新计算粒子动画…";try{await U();const $=ay({systems:e.systems,timeline:e.timeline,settings:t.value});yy($.text,t.value.spineVersion),q3($,t.value.fileName);const S=$.warnings.length?`;${$.warnings.length} 条资源提示(缺图仍已导出)`:"";u.value=`已导出 Spine ${t.value.spineVersion}:${$.particleSystemCount} 个粒子系统、${$.animationCount} 个动画、${$.boneCount} 根骨骼${S}`}catch($){d.value=!0,u.value=$ instanceof Error?$.message:String($)}finally{l.value=!1,c.value=null}}}async function N(){if(l.value)return;l.value=!0,c.value="spine",d.value=!1,m.value="",p.value="",u.value="正在重新计算粒子动画…";const $=Kv("导出 Spine 包","正在重新计算粒子动画…");try{await $.paint(),await U(Fe=>$.update(Fe*18,"正在重新计算粒子动画…")),$.update(20,"正在生成 Spine JSON…");const S=ay({systems:e.systems,timeline:e.timeline,settings:t.value});yy(S.text,t.value.spineVersion),u.value="正在整理图片并调用本机 Spine…";const C=t.value.fileName.replace(/\.json$/i,"")||"SpineParticle",Q=await oB({projectName:C,spineVersion:t.value.spineVersion,skeletonJson:S.text,systems:e.systems},({phase:Fe,progress:ct})=>{Fe==="images"?$.update(ct==null?null:22+ct*18,"正在整理工程图片…"):Fe==="upload"?$.update(ct==null?null:40+ct*30,"正在上传数据到 Spine 连接器…"):Fe==="processing"?$.update(null,"Spine 正在转换工程,请稍候…"):$.update(ct==null?null:82+ct*16,"正在下载生成的 Spine 工程包…")});$.update(99,"正在交给浏览器下载…"),lB(Q.blob,Q.fileName),u.value=`已生成 ${Q.fileName}:包含 .spine 工程和 ${Q.imageCount} 张图片,Spine ${Q.spineEditorVersion}`,await B(),await $.finish("Spine 工程包已开始下载")}catch(S){const C=S instanceof Error?S.message:String(S);d.value=!0,m.value=S instanceof zh?S.code:"",S instanceof zh&&S.pairUrl&&(p.value=S.pairUrl),u.value=C,await B(),await $.fail(C)}finally{l.value=!1,c.value=null}}async function O(){if(!l.value){l.value=!0,c.value="images",d.value=!1,m.value="",p.value="",u.value="正在整理当前粒子系统使用的图片…";try{const $=await vB({systems:e.systems,imagesPath:t.value.imagesPath}),S=yB($.blob,t.value.fileName);u.value=`已生成 ${S}:${$.folder}/ 内包含 ${$.imageCount} 张图片`}catch($){d.value=!0,u.value=$ instanceof Error?$.message:String($)}finally{l.value=!1,c.value=null}}}const X=gt(()=>{const $=e.systems.findIndex(S=>S.id===e.activeId);return $>=0?$:0}),E=gt(()=>e.systems[X.value]||null),V=gt(()=>E.value?g1(E.value.config,e.timeline.fps):30),q=gt(()=>{var S;const $=(S=E.value)==null?void 0:S.config;return $?Math.max(1,Math.ceil(Number($.loopDurationFrames)||1)):1}),W=gt(()=>e.activeObjectType),J=gt(()=>e.activeObjectType==="collision"&&e.colliders.find($=>$.id===e.activeObjectId)||null),K=gt(()=>e.activeObjectType==="path"&&e.paths.find($=>$.id===e.activeObjectId)||null),fe=gt(()=>e.activeObjectType==="spine"&&e.spines.find($=>$.id===e.activeObjectId)||null),me=gt(()=>e.activeObjectType==="particle"?e.systems.some($=>$.id===e.activeObjectId):e.activeObjectType==="collision"?e.colliders.some($=>$.id===e.activeObjectId):e.activeObjectType==="path"?e.paths.some($=>$.id===e.activeObjectId):e.spines.some($=>$.id===e.activeObjectId)),we=gt(()=>{const $=e.spines.find(S=>S.selectedBone&&S.bones.some(C=>C.name===S.selectedBone));return $?{spine:$,boneName:$.selectedBone}:null}),Ee=gt(()=>{var C;const $=(C=E.value)==null?void 0:C.config;if(!$||$.emitterFollowMode!=="bone")return null;const S=e.spines.find(Q=>Q.id===$.emitterFollowSpineId);return!S||!S.bones.some(Q=>Q.name===$.emitterFollowBoneName)?null:{spine:S,boneName:$.emitterFollowBoneName}}),ge=ht(!1),Te=gt(()=>{var S;const $=new Set(((S=E.value)==null?void 0:S.config.collisionColliderIds)||[]);return e.colliders.filter(C=>$.has(C.id))}),G=gt(()=>{var S;const $=new Set(((S=E.value)==null?void 0:S.config.collisionColliderIds)||[]);return e.colliders.filter(C=>!$.has(C.id))});ds(()=>{var $,S;return[($=E.value)==null?void 0:$.id,(S=E.value)==null?void 0:S.config.collision]},()=>{ge.value=!1});function Z($){var C;const S=(C=E.value)==null?void 0:C.config;!S||S.collisionColliderIds.includes($)||(S.collisionColliderIds.push($),ge.value=!1)}function z($){var C;const S=(C=E.value)==null?void 0:C.config;S&&(S.collisionColliderIds=S.collisionColliderIds.filter(Q=>Q!==$))}Qo(()=>{for(const $ of e.systems)$.visible==null&&($.visible=!0);for(const $ of e.colliders)$.visible==null&&($.visible=!0);for(const $ of e.paths)$.visible==null&&($.visible=!0);for(const $ of e.spines)$.visible==null&&($.visible=!0)}),Qo(()=>{if(!E.value)return;const $=zr(E.value.config);$.lifeMode==="curve"&&($.lifeMode="random"),$.speedMode==="curve"&&($.speedMode="random"),$.scaleMode==="curve"&&($.scaleMode="random"),$.initialRotationMode==="curve"&&($.initialRotationMode="random"),$.mode==="stream"&&!($.duration>0)&&($.duration=1),$.streamBehavior==="loop"&&($.emitterFollow||$.emitterFollowMode!=="none")&&tt($)}),Qo(()=>{const $=new Set(e.colliders.map(S=>S.id));for(const S of e.systems){const C=zr(S.config),Q=C.collisionColliderIds.filter(Ct=>$.has(Ct));if(Q.length!==C.collisionColliderIds.length&&(C.collisionColliderIds=Q),C.spawnPathId>0&&!e.paths.some(Ct=>Ct.id===C.spawnPathId)&&(C.spawnPathId=0,(C.emissionAngleMode==="path-normal"||C.emissionAngleMode==="path-tangent")&&(C.emissionAngleMode="fixed")),C.emitterFollowMode!=="bone")continue;const Fe=e.spines.find(Ct=>Ct.id===C.emitterFollowSpineId);!!(Fe!=null&&Fe.bones.some(Ct=>Ct.name===C.emitterFollowBoneName))||(C.emitterFollowMode="none",C.emitterFollowSpineId=0,C.emitterFollowBoneName="")}}),Qo(()=>{for(const $ of e.colliders)$.followPathId==null&&($.followPathId=0),$.followDuration>0||($.followDuration=2),$.followPathRotation==null&&($.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes($.followCurveMode)||($.followCurveMode="跟随导出"),(!Array.isArray($.followCurve)||$.followCurve.length<2)&&($.followCurve=[{x:0,y:0},{x:1,y:1}])});const j=[{x:0,y:0},{x:1,y:1}],te=[{x:0,y:1},{x:1,y:1}],he=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],ve=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],le=[{x:0,y:1},{x:1,y:1}],ye=[{x:0,y:1},{x:1,y:1}],ae=Ba({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function Le($){ae[$]=!ae[$]}function Re($){var C;const S=(C=E.value)==null?void 0:C.config;S&&(S.mode=$,$==="stream"&&!(S.duration>0)&&(S.duration=1))}function Oe($){var Q;const S=(Q=E.value)==null?void 0:Q.config;if(!S)return;const C=Math.min(1800,Math.max(1,Math.ceil(Number($)||1)));S.loopDurationFrames=C}function tt($){const S=Nl();$.emitterFollow=!1,$.emitterFollowMode="none",$.emitterFollowPathId=S.emitterFollowPathId,$.emitterFollowSpineId=S.emitterFollowSpineId,$.emitterFollowBoneName=S.emitterFollowBoneName,$.emitterFollowBoneOffsetX=S.emitterFollowBoneOffsetX,$.emitterFollowBoneOffsetY=S.emitterFollowBoneOffsetY,$.emitterFollowBoneRotation=S.emitterFollowBoneRotation,$.emitterFollowBoneScaleX=S.emitterFollowBoneScaleX,$.emitterFollowBoneScaleY=S.emitterFollowBoneScaleY,$.emitterAngleMode=S.emitterAngleMode,$.emitterFollowCurve=S.emitterFollowCurve.map(C=>({...C})),$.emitterFollowDuration=S.emitterFollowDuration,$.emitterFollowSpace=S.emitterFollowSpace,$.emitterFollowDirection=S.emitterFollowDirection,$.emitterFollowOffset=S.emitterFollowOffset}function St($){var Fe;const S=(Fe=E.value)==null?void 0:Fe.config;if(!S||S.streamBehavior===$)return;const C=$==="loop",Q=C?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(Q)&&(tt(S),S.streamBehavior=$,C||(S.generateLoopStartAnimation=!1,S.generateLoopEndAnimation=!1))}function Pt($,S){var Fe;const C=(Fe=E.value)==null?void 0:Fe.config;if(!C)return;const Q=S.target.checked;$==="start"?C.generateLoopStartAnimation=Q:C.generateLoopEndAnimation=Q}function wt($,S){var Fe;const C=(Fe=E.value)==null?void 0:Fe.config;if(!C)return;const Q=Math.min(1800,Math.max(1,Math.ceil(Number(S.target.value)||30)));$==="start"?C.loopStartDurationFrames=Q:C.loopEndDurationFrames=Q}function Rt($,S){var Fe;const C=(Fe=E.value)==null?void 0:Fe.config;if(!C)return;const Q=S.target.checked;$==="start"?C.loopStartUseCustomDuration=Q:C.loopEndUseCustomDuration=Q}function Zt($,S){const C=$.target.value;if(S.emitterFollowMode=C,C!=="bone"){S.emitterFollowSpineId=0,S.emitterFollowBoneName="";return}Fi(S)}function Fi($){const S=we.value;if(!S){$.emitterFollowMode="none",$.emitterFollowSpineId=0,$.emitterFollowBoneName="";return}$.emitterFollowMode="bone",$.emitterFollowSpineId=S.spine.id,$.emitterFollowBoneName=S.boneName}const Oi={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function Wi($){var Q;const S=(Q=E.value)==null?void 0:Q.config;if($==="export"){e.settings.exportSettings=Tp();return}if(!S)return;const C=Nl();for(const Fe of Oi[$])S[Fe]=C[Fe]}function on(){t.value.fps=Math.min(240,Math.max(1,Math.round(Number(t.value.fps)||30)))}function yi($){var S;e.selectSystem(((S=e.systems[$])==null?void 0:S.id)??0)}function ce(){e.addSystem()}function de(){e.addCollider()}function kt(){e.addPath()}function zt(){e.addSpine()}function Jt(){e.duplicateSelectedObject()}function mt($,S,C=0,Q=0,Fe=0,ct=0){return{x:$,y:S,inX:C,inY:Q,outX:Fe,outY:ct}}function Cs(){const $=K.value;if(!(!$||!$.preset))if($.preset==="circle"){const C=60.751328;$.points=[mt(110,0,0,-C,0,C),mt(0,110,C,0,-C,0),mt(-110,0,0,C,0,-C),mt(0,-110,-C,0,C,0)],$.closed=!0}else if($.preset==="square")$.points=[mt(-100,-100),mt(100,-100),mt(100,100),mt(-100,100)],$.closed=!0;else{const S=$.preset==="star"?10:6;$.points=Array.from({length:S},(C,Q)=>{const Fe=$.preset==="star"&&Q%2?50:110,ct=-Math.PI*.5+Q/S*Math.PI*2;return mt(Math.cos(ct)*Fe,Math.sin(ct)*Fe)}),$.closed=!0}}function Xs(){K.value&&(K.value.points=[])}function Ui(){E.value&&(E.value.config.seed=Math.floor(Math.random()*999999)+1)}function Is($){var C;const S=(C=E.value)==null?void 0:C.config;!S||$==="direction"||(S.speedOverLifeMode=$,$==="curve"&&S.speedOverLifeMin===S.speedOverLifeMax&&(S.speedOverLifeMin=0,S.speedOverLifeMax=1))}function xr(){var S;const $=(S=E.value)==null?void 0:S.config;!$||$.scaleOverLifeMode!=="curve"||($.scaleOverLifeMin===$.scaleOverLifeMax&&($.scaleOverLifeMin=0,$.scaleOverLifeMax=1),$.scaleYOverLifeMin===$.scaleYOverLifeMax&&($.scaleYOverLifeMin=0,$.scaleYOverLifeMax=1))}function ln($){var C;const S=(C=E.value)==null?void 0:C.config;!S||$==="direction"||(S.scaleOverLifeMode=$,xr())}const zi={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 Ya(){var C;const $=(C=E.value)==null?void 0:C.config;if(!$)return;const S=zi[$.shape];S&&Object.assign($,S)}function $a(){var S;const $=(S=E.value)==null?void 0:S.config;!$||$.spawnPathId>0||($.emissionAngleMode==="path-normal"||$.emissionAngleMode==="path-tangent")&&($.emissionAngleMode="fixed")}const Qr=ht(null),cn=ht(null),bs=ht(null),hn=ht(null),Xn=ht(null);function un(){var C;const $=(C=E.value)==null?void 0:C.config;if(!$)return;const S=Math.max(0,...$.trailResources.map(Q=>Q.id))+1;$.trailResources.push({id:S,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:le.map(Q=>({...Q})),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:te.map(Q=>({...Q})),shapeEnabled:!1,shapeCurve:ye.map(Q=>({...Q}))}),pe()}function Ga($){var S;Xn.value=$,(S=hn.value)==null||S.click()}function br($,S){var Fe;const C=(Fe=E.value)==null?void 0:Fe.config;if(!C)return;const Q=$==="trailGridCols"?32:16;C[$]=Math.min(Q,Math.max(2,Math.round(Number(S)||2)))}function H($,S){var Q;const C=(Q=E.value)==null?void 0:Q.config.trailResources.find(Fe=>Fe.id===$);C&&(C.boneCount=Math.min(16,Math.max(2,Math.round(Number(S)||2))))}function Y($,S){var Q;const C=(Q=E.value)==null?void 0:Q.config.trailResources.find(Fe=>Fe.id===$);C&&(C.rotation=Math.max(-360,Math.min(360,Number(S)||0)))}async function ee($){var Ct,It;const S=$.target,C=(Ct=S.files)==null?void 0:Ct[0],Q=(It=E.value)==null?void 0:It.config,Fe=Q==null?void 0:Q.trailResources.find(Ht=>Ht.id===Xn.value);if(!C||!Fe){S.value="";return}const ct=await Ze(C);Fe.texture=Nr(await pt.fromURL(ct)),Fe.previewUrl=ct,Fe.textureName=C.name.replace(/\.[^.]+$/,"")||"trail",S.value="",Xn.value=null}async function ne($){var Q;const S=(Q=E.value)==null?void 0:Q.config,C=S==null?void 0:S.trailResources.find(Fe=>Fe.id===$);C&&(C.texture=Nr(await pt.fromURL("/images/trail.png")),C.previewUrl="/images/trail.png",C.textureName="trail",C.weight=100,C.locked=!1,C.rotation=0,C.boneCount=3,C.trailRatio=100,C.lengthMode="fixed",C.length=100,C.lengthMin=100,C.lengthMax=100,C.widthSizeMode="fixed",C.width=100,C.widthMin=100,C.widthMax=100,C.widthMode="particle",C.lifeLengthEnabled=!1,C.lifeLengthCurve=te.map(Fe=>({...Fe})),C.shapeEnabled=!1,C.shapeCurve=ye.map(Fe=>({...Fe})),C.colorMode="particle",C.color="#ffffff",C.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],C.blend="normal",C.alphaMode="particle",C.alpha=1,C.alphaCurve=le.map(Fe=>({...Fe})),pe())}function ue($){var Q;const S=(Q=E.value)==null?void 0:Q.config.trailResources;if(!S||S.length<=1)return;const C=S.findIndex(Fe=>Fe.id===$);C>=0&&S.splice(C,1),pe()}function pe(){var Fe;const $=(Fe=E.value)==null?void 0:Fe.config.trailResources;if(!($!=null&&$.length))return;if($.length===1){$[0].weight=100,$[0].locked=!1;return}const S=$.filter(ct=>ct.locked),C=$.filter(ct=>!ct.locked);let Q=S.reduce((ct,Ct)=>ct+Math.max(0,Number(Ct.weight)||0),0);Q>100&&(Vt(S,100,!0),Q=100),Vt(C,100-Q)}function _e($,S){var It;const C=(It=E.value)==null?void 0:It.config.trailResources;if(!(C!=null&&C.length))return;if(C.length===1){C[0].weight=100,C[0].locked=!1;return}const Q=C.find(Ht=>Ht.id===$);if(!Q||Q.locked)return;const Fe=C.filter(Ht=>Ht.id!==$&&Ht.locked).reduce((Ht,qi)=>Ht+Math.max(0,Number(qi.weight)||0),0),ct=Math.max(0,100-Fe),Ct=C.filter(Ht=>Ht.id!==$&&!Ht.locked);Q.weight=Et(Math.min(ct,Math.max(0,Number(S)||0))),Ct.length?Vt(Ct,ct-Q.weight,!0):Q.weight=Et(ct)}function Me($){var Q;const S=(Q=E.value)==null?void 0:Q.config.trailResources;if(!S||S.length===1)return;const C=S.find(Fe=>Fe.id===$);C&&(C.locked=!C.locked)}function xe($,S){const C=S.target;$.color=Je(C.value,$.color),C.value=$.color}function De($,S){xe($,S),S.target.blur()}function Ie(){var C;const $=(C=E.value)==null?void 0:C.config;if(!$)return;const S=Math.max(0,...$.imageResources.map(Q=>Q.id))+1;$.imageResources.push({id:S,texture:$.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:ve.map(Q=>({...Q}))}),ui()}function Be($){var S;bs.value=$,(S=Qr.value)==null||S.click()}function Ae($){var S;bs.value=$,(S=cn.value)==null||S.click()}async function He($){var It,Ht;const S=$.target,C=(It=S.files)==null?void 0:It[0],Q=(Ht=E.value)==null?void 0:Ht.config,Fe=Q==null?void 0:Q.imageResources.find(qi=>qi.id===bs.value);if(!C||!Fe){S.value="";return}const ct=await Ze(C),Ct=Nr(await pt.fromURL(ct));Fe.texture=Ct,Fe.previewUrl=ct,Fe.textureFolder="",Fe.textureName=C.name.replace(/\.[^.]+$/,"")||"particle",S.value="",bs.value=null}async function st($){var ct;const S=$.target,C=Array.from(S.files||[]).sort((Ct,It)=>Ct.name.localeCompare(It.name,void 0,{numeric:!0,sensitivity:"base"})),Q=(ct=E.value)==null?void 0:ct.config,Fe=Q==null?void 0:Q.imageResources.find(Ct=>Ct.id===bs.value);if(!C.length||!Fe){S.value="";return}Fe.sequenceFrames=await Promise.all(C.map(async Ct=>{const It=await Ze(Ct);return{name:Ct.name,previewUrl:It,texture:Nr(await pt.fromURL(It))}})),Fe.imageMode="sequence",S.value="",bs.value=null}function Ze($){return new Promise((S,C)=>{const Q=new FileReader;Q.onload=()=>S(String(Q.result||"")),Q.onerror=()=>C(Q.error),Q.readAsDataURL($)})}function nt($){var Q;const S=(Q=E.value)==null?void 0:Q.config,C=S==null?void 0:S.imageResources.find(Fe=>Fe.id===$);!S||!C||(C.texture=S.texture,C.textureName="star",C.textureFolder="",C.previewUrl="/images/star.png",C.imageMode="fixed",C.sequencePlayback="loop-forward",C.sequenceFps=30,C.sequenceFrames=[],C.scale=1,C.anchorX=.5,C.anchorY=.5,C.colorMode="fixed",C.colorStart="#ffffff",C.colorEnd="#ff4d4d",C.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],C.blend="normal",C.independentAlpha="off",C.alpha=1,C.alphaCurveMode="跟随导出",C.alphaCurve=ve.map(Fe=>({...Fe})),C.locked=!1,ui())}function Je($,S){let C=$.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(C)&&(C=C.split("").map(Q=>Q+Q).join("")),/^[0-9a-f]{6}$/i.test(C)?`#${C.toLowerCase()}`:S}function Se($,S){const C=S.target;$.colorStart=Je(C.value,$.colorStart),C.value=$.colorStart}function rt($,S){Se($,S),S.target.blur()}function Pe($){var Q;const S=(Q=E.value)==null?void 0:Q.config.imageResources;if(!S||S.length<=1)return;const C=S.findIndex(Fe=>Fe.id===$);C>=0&&S.splice(C,1),ui()}function Et($){return Math.round($)}function Vt($,S,C=!1){if(!$.length)return;const Q=Math.max(0,Et(S)),Fe=C?$.reduce((Ct,It)=>Ct+Math.max(0,Number(It.weight)||0),0):0;let ct=0;$.forEach((Ct,It)=>{const Ht=It===$.length-1,qi=Et(Ht?Q-ct:Fe>0?Q*Math.max(0,Number(Ct.weight)||0)/Fe:Q/$.length);Ct.weight=qi,ct+=qi})}function ui(){var Fe;const $=(Fe=E.value)==null?void 0:Fe.config.imageResources;if(!($!=null&&$.length))return;if($.length===1){$[0].weight=100,$[0].locked=!1;return}const S=$.filter(ct=>ct.locked),C=$.filter(ct=>!ct.locked);let Q=S.reduce((ct,Ct)=>ct+Math.max(0,Number(Ct.weight)||0),0);Q>100&&(Vt(S,100,!0),Q=100),Vt(C,100-Q)}function Xi($,S){var It;const C=(It=E.value)==null?void 0:It.config.imageResources;if(!(C!=null&&C.length))return;if(C.length===1){C[0].weight=100,C[0].locked=!1;return}const Q=C.find(Ht=>Ht.id===$);if(!Q||Q.locked)return;const Fe=C.filter(Ht=>Ht.id!==$&&Ht.locked).reduce((Ht,qi)=>Ht+Math.max(0,Number(qi.weight)||0),0),ct=Math.max(0,100-Fe),Ct=C.filter(Ht=>Ht.id!==$&&!Ht.locked);if(Q.weight=Et(Math.min(ct,Math.max(0,Number(S)||0))),!Ct.length){Q.weight=Et(ct);return}Vt(Ct,ct-Q.weight,!0)}function ns($){var Q;const S=(Q=E.value)==null?void 0:Q.config.imageResources;if(!S||S.length===1)return;const C=S.find(Fe=>Fe.id===$);C&&(C.locked=!C.locked)}return($,S)=>(ie(),oe("div",xB,[S[391]||(S[391]=T("div",{class:"panel-header"},[T("span",null,"Spine粒子编辑器-Yeomai")],-1)),T("div",bB,[T("div",wB,[T("div",{class:"group-head",onClick:S[0]||(S[0]=C=>Le("config"))},[T("span",SB,je(ae.config?"▸":"▾"),1),S[197]||(S[197]=T("span",null,"配置管理",-1))]),be(T("div",_B,[T("div",MB,[T("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:_},"保存配置"),T("button",{title:"加载本地编辑器配置",onClick:S[1]||(S[1]=C=>{var Q;return(Q=i.value)==null?void 0:Q.click()})},"加载配置"),be(T("select",{"onUpdate:modelValue":S[2]||(S[2]=C=>n.value=C),"aria-label":"预设列表",disabled:!r.value.length||a.value,onPointerdown:P,onFocus:P,onChange:F},[T("option",AB,je(r.value.length?"选择预设":"无预设文件"),1),(ie(!0),oe(Ke,null,li(r.value,C=>(ie(),oe("option",{key:C.file,value:C.file},je(C.name),9,EB))),128))],40,TB),[[jt,n.value]]),T("input",{ref_key:"configFileInput",ref:i,hidden:"",type:"file",accept:".json,application/json",onChange:R},null,544)]),o.value?(ie(),oe("div",{key:0,class:ot(["config-message",{error:h.value}])},je(o.value),3)):Xe("",!0)],512),[[Sr,!ae.config]])]),T("div",CB,[T("div",{class:"group-head scene-head",onClick:S[3]||(S[3]=C=>Le("scene"))},[T("span",IB,je(ae.scene?"▸":"▾"),1),S[198]||(S[198]=T("span",null,"场景对象",-1)),T("div",RB,[T("button",{class:"scene-add",title:"添加粒子系统",onClick:xt(ce,["stop"])},"+粒子"),T("button",{class:"scene-add",title:"添加碰撞体",onClick:xt(de,["stop"])},"+碰撞"),T("button",{class:"scene-add",title:"添加路径",onClick:xt(kt,["stop"])},"+路径"),T("button",{class:"scene-add",title:"添加 Spine",onClick:xt(zt,["stop"])},"+Spine"),T("button",{class:"scene-add",disabled:!me.value,title:"复制当前选中的场景对象",onClick:xt(Jt,["stop"])},"+Copy",8,PB)])]),be(T("div",kB,[T("div",FB,[(ie(!0),oe(Ke,null,li(ke(e).systems,(C,Q)=>(ie(),oe("div",{key:`particle-${C.id}`,class:ot(["tree-item scene-object-item",{on:W.value==="particle"&&C.id===ke(e).activeObjectId}]),onClick:Fe=>yi(Q)},[S[201]||(S[201]=T("span",{class:"tdot"},"●",-1)),T("span",BB,je(C.config.name||"ParticleSystem"+(Q+1)),1),T("button",{class:ot(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":C.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:xt(Fe=>C.visible=C.visible===!1,["stop"])},[(ie(),oe("svg",DB,[S[199]||(S[199]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[200]||(S[200]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(ie(),oe("path",NB)):Xe("",!0)]))],10,LB),S[202]||(S[202]=T("span",{class:"scene-object-kind"},"粒子",-1)),T("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:xt(Fe=>ke(e).removeSystem(C.id),["stop"])},"✕",8,UB)],10,OB))),128)),(ie(!0),oe(Ke,null,li(ke(e).colliders,C=>(ie(),oe("div",{key:`collision-${C.id}`,class:ot(["tree-item scene-object-item",{on:W.value==="collision"&&C.id===ke(e).activeObjectId}]),onClick:Q=>ke(e).selectSceneObject("collision",C.id)},[S[205]||(S[205]=T("span",{class:"tdot collision-dot"},"■",-1)),T("span",VB,je(C.name),1),T("button",{class:ot(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":C.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:xt(Q=>C.visible=C.visible===!1,["stop"])},[(ie(),oe("svg",$B,[S[203]||(S[203]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[204]||(S[204]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(ie(),oe("path",GB)):Xe("",!0)]))],10,YB),S[206]||(S[206]=T("span",{class:"scene-object-kind"},"碰撞",-1)),T("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:xt(Q=>ke(e).removeCollider(C.id),["stop"])},"✕",8,HB)],10,XB))),128)),(ie(!0),oe(Ke,null,li(ke(e).paths,C=>(ie(),oe("div",{key:`path-${C.id}`,class:ot(["tree-item scene-object-item",{on:W.value==="path"&&C.id===ke(e).activeObjectId}]),onClick:Q=>ke(e).selectSceneObject("path",C.id)},[S[209]||(S[209]=T("span",{class:"tdot path-dot"},"◇",-1)),T("span",WB,je(C.name),1),T("button",{class:ot(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?"显示路径":"隐藏路径","aria-label":C.visible===!1?"显示路径":"隐藏路径",onClick:xt(Q=>C.visible=C.visible===!1,["stop"])},[(ie(),oe("svg",qB,[S[207]||(S[207]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[208]||(S[208]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(ie(),oe("path",KB)):Xe("",!0)]))],10,zB),S[210]||(S[210]=T("span",{class:"scene-object-kind"},"路径",-1)),T("button",{class:"scene-object-delete",title:"删除路径",onClick:xt(Q=>ke(e).removePath(C.id),["stop"])},"✕",8,ZB)],10,jB))),128)),(ie(!0),oe(Ke,null,li(ke(e).spines,C=>(ie(),oe("div",{key:`spine-${C.id}`,class:ot(["tree-item scene-object-item",{on:W.value==="spine"&&C.id===ke(e).activeObjectId}]),onClick:Q=>ke(e).selectSceneObject("spine",C.id)},[S[213]||(S[213]=T("span",{class:"tdot spine-dot"},"◆",-1)),T("span",QB,je(C.name),1),T("button",{class:ot(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":C.visible===!1?"显示 Spine":"隐藏 Spine",onClick:xt(Q=>C.visible=C.visible===!1,["stop"])},[(ie(),oe("svg",tL,[S[211]||(S[211]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[212]||(S[212]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(ie(),oe("path",iL)):Xe("",!0)]))],10,eL),S[214]||(S[214]=T("span",{class:"scene-object-kind"},"Spine",-1)),T("button",{class:"scene-object-delete",title:"删除 Spine",onClick:xt(Q=>ke(e).removeSpine(C.id),["stop"])},"✕",8,sL)],10,JB))),128)),!ke(e).systems.length&&!ke(e).colliders.length&&!ke(e).paths.length&&!ke(e).spines.length?(ie(),oe("div",nL,"场景中暂无对象")):Xe("",!0)]),W.value==="particle"&&E.value?(ie(),oe(Ke,{key:0},[T("label",rL,[S[215]||(S[215]=T("span",null,"名称",-1)),be(T("input",{"onUpdate:modelValue":S[4]||(S[4]=C=>E.value.config.name=C),class:"inp"},null,512),[[ut,E.value.config.name]])]),Ue(qe,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:E.value.config.centerX,"onUpdate:modelValue":S[5]||(S[5]=C=>E.value.config.centerX=C)},null,8,["modelValue"]),Ue(qe,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:E.value.config.centerY,"onUpdate:modelValue":S[6]||(S[6]=C=>E.value.config.centerY=C)},null,8,["modelValue"]),Ue(qe,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:E.value.config.offsetX,"onUpdate:modelValue":S[7]||(S[7]=C=>E.value.config.offsetX=C)},null,8,["modelValue"]),Ue(qe,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:E.value.config.offsetY,"onUpdate:modelValue":S[8]||(S[8]=C=>E.value.config.offsetY=C)},null,8,["modelValue"]),Ue(qe,{label:"旋转",min:-360,max:360,step:1,modelValue:E.value.config.rootRotation,"onUpdate:modelValue":S[9]||(S[9]=C=>E.value.config.rootRotation=C)},null,8,["modelValue"]),Ue(qe,{label:"缩放X",min:.05,max:10,step:.05,modelValue:E.value.config.rootScaleX,"onUpdate:modelValue":S[10]||(S[10]=C=>E.value.config.rootScaleX=C)},null,8,["modelValue"]),Ue(qe,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:E.value.config.rootScaleY,"onUpdate:modelValue":S[11]||(S[11]=C=>E.value.config.rootScaleY=C)},null,8,["modelValue"]),T("div",aL,[S[216]||(S[216]=T("label",{for:"system-seed"},"随机种子",-1)),be(T("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":S[12]||(S[12]=C=>E.value.config.seed=C),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[ut,E.value.config.seed,void 0,{number:!0}]]),T("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:Ui},"⚄")]),S[217]||(S[217]=T("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):J.value?(ie(),oe(Ke,{key:1},[S[242]||(S[242]=T("div",{class:"object-editor-title"},"碰撞体属性",-1)),T("label",oL,[S[218]||(S[218]=T("span",null,"碰撞体名称",-1)),be(T("input",{"onUpdate:modelValue":S[13]||(S[13]=C=>J.value.name=C),class:"inp"},null,512),[[ut,J.value.name]])]),T("div",lL,[T("label",cL,[S[220]||(S[220]=T("span",null,"类型",-1)),be(T("select",{"onUpdate:modelValue":S[14]||(S[14]=C=>J.value.shape=C),class:"inp"},[...S[219]||(S[219]=[io('',5)])],512),[[jt,J.value.shape]])]),T("label",hL,[S[221]||(S[221]=T("span",null,"启用",-1)),be(T("input",{"onUpdate:modelValue":S[15]||(S[15]=C=>J.value.enabled=C),type:"checkbox"},null,512),[[ei,J.value.enabled]])])]),T("div",uL,[T("label",dL,[S[222]||(S[222]=T("span",null,"X 位置",-1)),be(T("input",{"onUpdate:modelValue":S[16]||(S[16]=C=>J.value.x=C),type:"number",class:"inp"},null,512),[[ut,J.value.x,void 0,{number:!0}]])]),T("label",fL,[S[223]||(S[223]=T("span",null,"Y 位置",-1)),be(T("input",{"onUpdate:modelValue":S[17]||(S[17]=C=>J.value.y=C),type:"number",class:"inp"},null,512),[[ut,J.value.y,void 0,{number:!0}]])])]),Ue(qe,{label:"旋转",min:-360,max:360,step:1,modelValue:J.value.rotation,"onUpdate:modelValue":S[18]||(S[18]=C=>J.value.rotation=C)},null,8,["modelValue"]),T("div",mL,[T("label",pL,[S[224]||(S[224]=T("span",null,"缩放 X",-1)),be(T("input",{"onUpdate:modelValue":S[19]||(S[19]=C=>J.value.scaleX=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ut,J.value.scaleX,void 0,{number:!0}]])]),T("label",gL,[S[225]||(S[225]=T("span",null,"缩放 Y",-1)),be(T("input",{"onUpdate:modelValue":S[20]||(S[20]=C=>J.value.scaleY=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ut,J.value.scaleY,void 0,{number:!0}]])])]),J.value.shape==="circle"?(ie(),Qt(qe,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:J.value.radius,"onUpdate:modelValue":S[21]||(S[21]=C=>J.value.radius=C)},null,8,["modelValue"])):J.value.shape==="ellipse"?(ie(),oe("div",vL,[T("label",yL,[S[226]||(S[226]=T("span",null,"X 半径",-1)),be(T("input",{"onUpdate:modelValue":S[22]||(S[22]=C=>J.value.radiusX=C),type:"number",min:"1",class:"inp"},null,512),[[ut,J.value.radiusX,void 0,{number:!0}]])]),T("label",xL,[S[227]||(S[227]=T("span",null,"Y 半径",-1)),be(T("input",{"onUpdate:modelValue":S[23]||(S[23]=C=>J.value.radiusY=C),type:"number",min:"1",class:"inp"},null,512),[[ut,J.value.radiusY,void 0,{number:!0}]])])])):(ie(),oe("div",bL,[T("label",wL,[S[228]||(S[228]=T("span",null,"宽度",-1)),be(T("input",{"onUpdate:modelValue":S[24]||(S[24]=C=>J.value.width=C),type:"number",min:"1",class:"inp"},null,512),[[ut,J.value.width,void 0,{number:!0}]])]),T("label",SL,[S[229]||(S[229]=T("span",null,"高度",-1)),be(T("input",{"onUpdate:modelValue":S[25]||(S[25]=C=>J.value.height=C),type:"number",min:"1",class:"inp"},null,512),[[ut,J.value.height,void 0,{number:!0}]])])])),J.value.shape==="polygon"||J.value.shape==="custom"?(ie(),Qt(qe,{key:3,label:"边数",min:3,max:16,step:1,modelValue:J.value.sides,"onUpdate:modelValue":S[26]||(S[26]=C=>J.value.sides=C)},null,8,["modelValue"])):Xe("",!0),T("label",_L,[S[231]||(S[231]=T("span",null,"碰撞响应",-1)),be(T("select",{"onUpdate:modelValue":S[27]||(S[27]=C=>J.value.response=C),class:"inp"},[...S[230]||(S[230]=[T("option",{value:"physics"},"物理(弹跳/摩擦)",-1),T("option",{value:"pause"},"暂停(停止不动)",-1),T("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[jt,J.value.response]])]),J.value.response==="physics"?(ie(),oe("div",ML,[T("label",TL,[S[232]||(S[232]=T("span",null,"弹性 (0-1)",-1)),be(T("input",{"onUpdate:modelValue":S[28]||(S[28]=C=>J.value.elasticity=C),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[ut,J.value.elasticity,void 0,{number:!0}]])]),T("label",AL,[S[233]||(S[233]=T("span",null,"摩擦 (0-1)",-1)),be(T("input",{"onUpdate:modelValue":S[29]||(S[29]=C=>J.value.friction=C),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[ut,J.value.friction,void 0,{number:!0}]])])])):Xe("",!0),T("div",EL,[T("label",CL,[be(T("input",{"onUpdate:modelValue":S[30]||(S[30]=C=>J.value.followPath=C),type:"checkbox"},null,512),[[ei,J.value.followPath]]),S[234]||(S[234]=ri("跟随路径移动",-1))]),J.value.followPath?(ie(),oe(Ke,{key:0},[T("label",IL,[S[236]||(S[236]=T("span",null,"目标路径",-1)),be(T("select",{"onUpdate:modelValue":S[31]||(S[31]=C=>J.value.followPathId=C),class:"inp"},[S[235]||(S[235]=T("option",{value:0},"(未选择)",-1)),(ie(!0),oe(Ke,null,li(ke(e).paths,C=>(ie(),oe("option",{key:C.id,value:C.id},je(C.name),9,RL))),128))],512),[[jt,J.value.followPathId,void 0,{number:!0}]])]),T("div",PL,[T("label",kL,[S[237]||(S[237]=T("span",null,"移动时长(秒)",-1)),be(T("input",{"onUpdate:modelValue":S[32]||(S[32]=C=>J.value.followDuration=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ut,J.value.followDuration,void 0,{number:!0}]])]),T("label",FL,[S[239]||(S[239]=T("span",null,"曲线模式",-1)),be(T("select",{"onUpdate:modelValue":S[33]||(S[33]=C=>J.value.followCurveMode=C),class:"inp"},[...S[238]||(S[238]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[jt,J.value.followCurveMode]])])]),T("label",OL,[be(T("input",{"onUpdate:modelValue":S[34]||(S[34]=C=>J.value.followPathRotation=C),type:"checkbox"},null,512),[[ei,J.value.followPathRotation]]),S[240]||(S[240]=ri("方向沿路径",-1))]),S[241]||(S[241]=T("div",{class:"collider-curve-title"},[ri("移动进度曲线 "),T("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),Ue(yn,{"model-value":J.value.followCurve||j,"default-value":j,mode:M(J.value.followCurveMode),"onUpdate:modelValue":S[35]||(S[35]=C=>J.value.followCurve=C)},null,8,["model-value","mode"])],64)):Xe("",!0)])],64)):K.value?(ie(),oe(Ke,{key:2},[S[252]||(S[252]=T("div",{class:"object-editor-title"},"路径属性",-1)),T("label",BL,[S[243]||(S[243]=T("span",null,"路径名称",-1)),be(T("input",{"onUpdate:modelValue":S[36]||(S[36]=C=>K.value.name=C),class:"inp"},null,512),[[ut,K.value.name]])]),T("div",LL,[T("label",DL,[S[244]||(S[244]=T("span",null,"X 位置",-1)),be(T("input",{"onUpdate:modelValue":S[37]||(S[37]=C=>K.value.x=C),type:"number",class:"inp"},null,512),[[ut,K.value.x,void 0,{number:!0}]])]),T("label",NL,[S[245]||(S[245]=T("span",null,"Y 位置",-1)),be(T("input",{"onUpdate:modelValue":S[38]||(S[38]=C=>K.value.y=C),type:"number",class:"inp"},null,512),[[ut,K.value.y,void 0,{number:!0}]])])]),Ue(qe,{label:"旋转",min:-360,max:360,step:1,modelValue:K.value.rotation,"onUpdate:modelValue":S[39]||(S[39]=C=>K.value.rotation=C)},null,8,["modelValue"]),T("div",UL,[T("label",XL,[S[246]||(S[246]=T("span",null,"缩放 X",-1)),be(T("input",{"onUpdate:modelValue":S[40]||(S[40]=C=>K.value.scaleX=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ut,K.value.scaleX,void 0,{number:!0}]])]),T("label",VL,[S[247]||(S[247]=T("span",null,"缩放 Y",-1)),be(T("input",{"onUpdate:modelValue":S[41]||(S[41]=C=>K.value.scaleY=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ut,K.value.scaleY,void 0,{number:!0}]])])]),T("label",YL,[S[248]||(S[248]=T("span",null,"闭合路径",-1)),be(T("input",{"onUpdate:modelValue":S[42]||(S[42]=C=>K.value.closed=C),type:"checkbox"},null,512),[[ei,K.value.closed]])]),T("label",$L,[S[249]||(S[249]=T("span",null,"路径颜色",-1)),be(T("input",{"onUpdate:modelValue":S[43]||(S[43]=C=>K.value.color=C),type:"color",class:"path-color"},null,512),[[ut,K.value.color]])]),S[253]||(S[253]=io('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),T("label",GL,[S[251]||(S[251]=T("span",null,"应用预设形状",-1)),be(T("select",{"onUpdate:modelValue":S[44]||(S[44]=C=>K.value.preset=C),class:"inp"},[...S[250]||(S[250]=[io('',5)])],512),[[jt,K.value.preset]])]),T("button",{class:"path-action primary",onClick:Cs},"应用预设"),T("button",{class:"path-action",onClick:Xs},"清空锚点")],64)):fe.value?(ie(),Qt(w3,{key:3,"spine-object":fe.value},null,8,["spine-object"])):(ie(),oe("div",HL,"使用右上角按钮创建场景对象"))],512),[[Sr,!ae.scene]])]),W.value==="particle"&&E.value?(ie(),oe(Ke,{key:0},[T("div",jL,[T("div",{class:"group-head",onClick:S[46]||(S[46]=C=>Le("emitMode"))},[T("span",WL,je(ae.emitMode?"▸":"▾"),1),S[254]||(S[254]=T("span",null,"发射模式",-1)),T("button",{class:"group-reset",title:"重置发射模式参数",onClick:S[45]||(S[45]=xt(C=>Wi("emitMode"),["stop"]))},"重置")]),be(T("div",zL,[T("div",qL,[T("button",{class:ot(["seg",{on:E.value.config.mode==="stream"}]),onClick:S[47]||(S[47]=C=>Re("stream"))},"持续",2),T("button",{class:ot(["seg",{on:E.value.config.mode==="burst"}]),onClick:S[48]||(S[48]=C=>Re("burst"))},"爆发",2)]),E.value.config.mode==="stream"?(ie(),oe(Ke,{key:0},[T("div",KL,[T("button",{class:ot(["seg",{on:E.value.config.streamBehavior==="normal"}]),onClick:S[49]||(S[49]=C=>St("normal"))},"常规持续",2),T("button",{class:ot(["seg",{on:E.value.config.streamBehavior==="loop"}]),onClick:S[50]||(S[50]=C=>St("loop"))},"循环持续",2)]),Ue(qe,{label:"发射速率",min:1,max:300,step:1,modelValue:E.value.config.rate,"onUpdate:modelValue":S[51]||(S[51]=C=>E.value.config.rate=C)},null,8,["modelValue"]),E.value.config.streamBehavior==="normal"?(ie(),Qt(qe,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:E.value.config.duration,"onUpdate:modelValue":S[52]||(S[52]=C=>E.value.config.duration=C)},null,8,["modelValue"])):(ie(),Qt(qe,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":q.value,"onUpdate:modelValue":Oe},null,8,["model-value"])),E.value.config.streamBehavior==="loop"?(ie(),oe("div",ZL,[T("div",JL,[T("label",QL,[T("input",{type:"checkbox",checked:E.value.config.generateLoopStartAnimation,onChange:S[53]||(S[53]=C=>Pt("start",C))},null,40,eD),S[255]||(S[255]=T("span",{class:"switch-ui"},null,-1)),S[256]||(S[256]=T("span",null,"生成开始循环动画",-1))]),E.value.config.generateLoopStartAnimation?(ie(),oe("div",tD,[T("label",iD,[T("input",{type:"checkbox",checked:E.value.config.loopStartUseCustomDuration,onChange:S[54]||(S[54]=C=>Rt("start",C))},null,40,sD),S[257]||(S[257]=T("span",{class:"switch-ui"},null,-1)),S[258]||(S[258]=T("span",null,"指定时长",-1))]),T("label",nD,[E.value.config.loopStartUseCustomDuration?(ie(),oe("input",{key:0,value:E.value.config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"开始循环段时长",onChange:S[55]||(S[55]=C=>wt("start",C))},null,40,rD)):Xe("",!0),E.value.config.loopStartUseCustomDuration?(ie(),oe("span",aD,"f")):(ie(),oe("span",oD,"自动 "+je(V.value)+"f",1))])])):Xe("",!0)]),T("div",lD,[T("label",cD,[T("input",{type:"checkbox",checked:E.value.config.generateLoopEndAnimation,onChange:S[56]||(S[56]=C=>Pt("end",C))},null,40,hD),S[259]||(S[259]=T("span",{class:"switch-ui"},null,-1)),S[260]||(S[260]=T("span",null,"生成结束循环动画",-1))]),E.value.config.generateLoopEndAnimation?(ie(),oe("div",uD,[T("label",dD,[T("input",{type:"checkbox",checked:E.value.config.loopEndUseCustomDuration,onChange:S[57]||(S[57]=C=>Rt("end",C))},null,40,fD),S[261]||(S[261]=T("span",{class:"switch-ui"},null,-1)),S[262]||(S[262]=T("span",null,"指定时长",-1))]),T("label",mD,[E.value.config.loopEndUseCustomDuration?(ie(),oe("input",{key:0,value:E.value.config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"结束循环段时长",onChange:S[58]||(S[58]=C=>wt("end",C))},null,40,pD)):Xe("",!0),E.value.config.loopEndUseCustomDuration?(ie(),oe("span",gD,"f")):(ie(),oe("span",vD,"自动 "+je(V.value)+"f",1))])])):Xe("",!0)])])):Xe("",!0),E.value.config.streamBehavior==="loop"?(ie(),oe("div",yD,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):Xe("",!0)],64)):(ie(),Qt(qe,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:E.value.config.burstCount,"onUpdate:modelValue":S[59]||(S[59]=C=>E.value.config.burstCount=C)},null,8,["modelValue"])),Ue(qe,{label:"延迟时间",min:0,max:5,step:.1,modelValue:E.value.config.delay,"onUpdate:modelValue":S[60]||(S[60]=C=>E.value.config.delay=C)},null,8,["modelValue"])],512),[[Sr,!ae.emitMode]])]),T("div",xD,[T("div",{class:"group-head",onClick:S[62]||(S[62]=C=>Le("shape"))},[T("span",bD,je(ae.shape?"▸":"▾"),1),S[263]||(S[263]=T("span",null,"发射器形状",-1)),T("button",{class:"group-reset",title:"重置发射器形状参数",onClick:S[61]||(S[61]=xt(C=>Wi("shape"),["stop"]))},"重置")]),be(T("div",wD,[T("label",SD,[S[265]||(S[265]=T("span",null,"形状",-1)),be(T("select",{"onUpdate:modelValue":S[63]||(S[63]=C=>E.value.config.shape=C),class:"inp",onChange:Ya},[...S[264]||(S[264]=[io('',5)])],544),[[jt,E.value.config.shape]])]),E.value.config.shape==="circle"||E.value.config.shape==="cone"?(ie(),oe(Ke,{key:0},[Ue(qe,{label:E.value.config.shape==="cone"?"内径":"内半径",min:0,max:E.value.config.outerRadius,step:1,modelValue:E.value.config.innerRadius,"onUpdate:modelValue":S[64]||(S[64]=C=>E.value.config.innerRadius=C)},null,8,["label","max","modelValue"]),Ue(qe,{label:E.value.config.shape==="cone"?"外径":"外半径",min:E.value.config.innerRadius,max:300,step:1,modelValue:E.value.config.outerRadius,"onUpdate:modelValue":S[65]||(S[65]=C=>E.value.config.outerRadius=C)},null,8,["label","min","modelValue"])],64)):Xe("",!0),E.value.config.shape==="cone"?(ie(),oe(Ke,{key:1},[Ue(qe,{label:"锥形朝向",min:-360,max:360,step:1,modelValue:E.value.config.coneDirection,"onUpdate:modelValue":S[66]||(S[66]=C=>E.value.config.coneDirection=C)},null,8,["modelValue"]),Ue(qe,{label:"锥形开口角度",min:1,max:360,step:1,modelValue:E.value.config.coneAngle,"onUpdate:modelValue":S[67]||(S[67]=C=>E.value.config.coneAngle=C)},null,8,["modelValue"])],64)):E.value.config.shape==="rect"?(ie(),oe(Ke,{key:2},[Ue(qe,{label:"内宽",min:0,max:E.value.config.outerRectW,step:1,modelValue:E.value.config.innerRectW,"onUpdate:modelValue":S[68]||(S[68]=C=>E.value.config.innerRectW=C)},null,8,["max","modelValue"]),Ue(qe,{label:"内高",min:0,max:E.value.config.outerRectH,step:1,modelValue:E.value.config.innerRectH,"onUpdate:modelValue":S[69]||(S[69]=C=>E.value.config.innerRectH=C)},null,8,["max","modelValue"]),Ue(qe,{label:"外宽",min:E.value.config.innerRectW,max:400,step:1,modelValue:E.value.config.outerRectW,"onUpdate:modelValue":S[70]||(S[70]=C=>E.value.config.outerRectW=C)},null,8,["min","modelValue"]),Ue(qe,{label:"外高",min:E.value.config.innerRectH,max:400,step:1,modelValue:E.value.config.outerRectH,"onUpdate:modelValue":S[71]||(S[71]=C=>E.value.config.outerRectH=C)},null,8,["min","modelValue"])],64)):E.value.config.shape==="path"?(ie(),oe(Ke,{key:3},[T("label",_D,[S[267]||(S[267]=T("span",null,"选择路径",-1)),be(T("select",{"onUpdate:modelValue":S[72]||(S[72]=C=>E.value.config.spawnPathId=C),class:"inp",onChange:$a},[S[266]||(S[266]=T("option",{value:0},"无路径(点发射)",-1)),(ie(!0),oe(Ke,null,li(ke(e).paths,C=>(ie(),oe("option",{key:C.id,value:C.id,disabled:!C.enabled},je(C.name),9,MD))),128))],544),[[jt,E.value.config.spawnPathId,void 0,{number:!0}]])]),E.value.config.spawnPathId>0?(ie(),oe("label",TD,[S[269]||(S[269]=T("span",null,"出生分布",-1)),be(T("select",{"onUpdate:modelValue":S[73]||(S[73]=C=>E.value.config.spawnPathDistribution=C),class:"inp"},[...S[268]||(S[268]=[T("option",{value:"fixed"},"等间距固定分布",-1),T("option",{value:"random"},"随机分布",-1)])],512),[[jt,E.value.config.spawnPathDistribution]])])):Xe("",!0)],64)):Xe("",!0),S[273]||(S[273]=T("div",{class:"divider"},null,-1)),T("label",AD,[S[272]||(S[272]=T("span",null,"发射角度",-1)),be(T("select",{"onUpdate:modelValue":S[74]||(S[74]=C=>E.value.config.emissionAngleMode=C),class:"inp"},[S[270]||(S[270]=T("option",{value:"fixed"},"固定",-1)),S[271]||(S[271]=T("option",{value:"random"},"随机",-1)),E.value.config.shape==="circle"||E.value.config.shape==="rect"||E.value.config.shape==="cone"?(ie(),oe("option",ED,"径向(中心向外)")):Xe("",!0),E.value.config.shape==="path"&&E.value.config.spawnPathId>0?(ie(),oe("option",CD,"垂直于路径")):Xe("",!0),E.value.config.shape==="path"&&E.value.config.spawnPathId>0?(ie(),oe("option",ID,"沿路径方向")):Xe("",!0)],512),[[jt,E.value.config.emissionAngleMode]])]),E.value.config.emissionAngleMode==="fixed"?(ie(),Qt(qe,{key:4,label:"固定角度",min:-360,max:360,step:1,modelValue:E.value.config.direction,"onUpdate:modelValue":S[75]||(S[75]=C=>E.value.config.direction=C)},null,8,["modelValue"])):E.value.config.emissionAngleMode==="random"?(ie(),oe(Ke,{key:5},[Ue(qe,{label:"基准角度",min:-360,max:360,step:1,modelValue:E.value.config.direction,"onUpdate:modelValue":S[76]||(S[76]=C=>E.value.config.direction=C)},null,8,["modelValue"]),Ue(qe,{label:"随机范围",min:0,max:360,step:1,modelValue:E.value.config.spread,"onUpdate:modelValue":S[77]||(S[77]=C=>E.value.config.spread=C)},null,8,["modelValue"])],64)):Xe("",!0)],512),[[Sr,!ae.shape]])]),T("div",RD,[T("div",{class:"group-head",onClick:S[79]||(S[79]=C=>Le("attr"))},[T("span",PD,je(ae.attr?"▸":"▾"),1),S[274]||(S[274]=T("span",null,"粒子属性",-1)),T("button",{class:"group-reset",title:"重置粒子属性参数",onClick:S[78]||(S[78]=xt(C=>Wi("attr"),["stop"]))},"重置")]),be(T("div",kD,[S[282]||(S[282]=T("div",{class:"attr-section-title"},"粒子初始参数",-1)),Ue(Hn,{label:"初始生命周期","allow-curve":!1,mode:E.value.config.lifeMode,"onUpdate:mode":S[80]||(S[80]=C=>E.value.config.lifeMode=C),"value-min":E.value.config.lifeMin,"onUpdate:valueMin":S[81]||(S[81]=C=>E.value.config.lifeMin=C),"value-max":E.value.config.lifeMax,"onUpdate:valueMax":S[82]||(S[82]=C=>E.value.config.lifeMax=C),curve:E.value.config.lifeCurve,"onUpdate:curve":S[83]||(S[83]=C=>E.value.config.lifeCurve=C),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),Ue(Hn,{label:"初始速度","allow-curve":!1,mode:E.value.config.speedMode,"onUpdate:mode":S[84]||(S[84]=C=>E.value.config.speedMode=C),"value-min":E.value.config.speedMin,"onUpdate:valueMin":S[85]||(S[85]=C=>E.value.config.speedMin=C),"value-max":E.value.config.speedMax,"onUpdate:valueMax":S[86]||(S[86]=C=>E.value.config.speedMax=C),curve:E.value.config.speedCurve,"onUpdate:curve":S[87]||(S[87]=C=>E.value.config.speedCurve=C),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),T("div",FD,[S[275]||(S[275]=T("span",null,"初始缩放",-1)),T("div",OD,[T("button",{class:ot(["axis-mode",{on:E.value.config.scaleAxisMode==="uniform"}]),onClick:S[88]||(S[88]=C=>E.value.config.scaleAxisMode="uniform")},"统一",2),T("button",{class:ot(["axis-mode",{on:E.value.config.scaleAxisMode==="separate"}]),onClick:S[89]||(S[89]=C=>E.value.config.scaleAxisMode="separate")},"XY分离",2)])]),Ue(Hn,{label:E.value.config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:E.value.config.scaleMode,"onUpdate:mode":S[90]||(S[90]=C=>E.value.config.scaleMode=C),"value-min":E.value.config.scaleMin,"onUpdate:valueMin":S[91]||(S[91]=C=>E.value.config.scaleMin=C),"value-max":E.value.config.scaleMax,"onUpdate:valueMax":S[92]||(S[92]=C=>E.value.config.scaleMax=C),curve:E.value.config.scaleCurve,"onUpdate:curve":S[93]||(S[93]=C=>E.value.config.scaleCurve=C),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),E.value.config.scaleAxisMode==="separate"?(ie(),Qt(Hn,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:E.value.config.scaleMode,"onUpdate:mode":S[94]||(S[94]=C=>E.value.config.scaleMode=C),"value-min":E.value.config.scaleYMin,"onUpdate:valueMin":S[95]||(S[95]=C=>E.value.config.scaleYMin=C),"value-max":E.value.config.scaleYMax,"onUpdate:valueMax":S[96]||(S[96]=C=>E.value.config.scaleYMax=C),curve:E.value.config.scaleYCurve,"onUpdate:curve":S[97]||(S[97]=C=>E.value.config.scaleYCurve=C),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):Xe("",!0),Ue(Hn,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:E.value.config.initialRotationMode,"onUpdate:mode":S[98]||(S[98]=C=>E.value.config.initialRotationMode=C),"value-min":E.value.config.initialRotationMin,"onUpdate:valueMin":S[99]||(S[99]=C=>E.value.config.initialRotationMin=C),"value-max":E.value.config.initialRotationMax,"onUpdate:valueMax":S[100]||(S[100]=C=>E.value.config.initialRotationMax=C),curve:E.value.config.initialRotationCurve,"onUpdate:curve":S[101]||(S[101]=C=>E.value.config.initialRotationCurve=C),min:-360,max:360,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),S[283]||(S[283]=T("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),T("div",BD,[T("label",LD,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[102]||(S[102]=C=>E.value.config.speedOverLifeEnabled=C)},null,512),[[ei,E.value.config.speedOverLifeEnabled]]),S[276]||(S[276]=T("span",{class:"switch-ui"},null,-1)),S[277]||(S[277]=T("span",null,"生命周期内速度",-1))]),E.value.config.speedOverLifeEnabled?(ie(),Qt(Hn,{key:0,label:"速度倍率",mode:E.value.config.speedOverLifeMode,"onUpdate:mode":Is,"value-min":E.value.config.speedOverLifeMin,"onUpdate:valueMin":S[103]||(S[103]=C=>E.value.config.speedOverLifeMin=C),"value-max":E.value.config.speedOverLifeMax,"onUpdate:valueMax":S[104]||(S[104]=C=>E.value.config.speedOverLifeMax=C),curve:E.value.config.speedOverLifeCurve,"onUpdate:curve":S[105]||(S[105]=C=>E.value.config.speedOverLifeCurve=C),"default-curve":te,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):Xe("",!0)]),T("div",DD,[T("label",ND,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[106]||(S[106]=C=>E.value.config.scaleOverLifeEnabled=C),onChange:xr},null,544),[[ei,E.value.config.scaleOverLifeEnabled]]),S[278]||(S[278]=T("span",{class:"switch-ui"},null,-1)),S[279]||(S[279]=T("span",null,"生命周期内缩放",-1))]),E.value.config.scaleOverLifeEnabled?(ie(),oe(Ke,{key:0},[T("div",UD,[T("button",{class:ot(["axis-mode",{on:E.value.config.scaleOverLifeAxisMode==="uniform"}]),onClick:S[107]||(S[107]=C=>E.value.config.scaleOverLifeAxisMode="uniform")},"统一",2),T("button",{class:ot(["axis-mode",{on:E.value.config.scaleOverLifeAxisMode==="separate"}]),onClick:S[108]||(S[108]=C=>E.value.config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),Ue(Hn,{label:E.value.config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:E.value.config.scaleOverLifeMode,"onUpdate:mode":ln,"value-min":E.value.config.scaleOverLifeMin,"onUpdate:valueMin":S[109]||(S[109]=C=>E.value.config.scaleOverLifeMin=C),"value-max":E.value.config.scaleOverLifeMax,"onUpdate:valueMax":S[110]||(S[110]=C=>E.value.config.scaleOverLifeMax=C),curve:E.value.config.scaleOverLifeCurve,"onUpdate:curve":S[111]||(S[111]=C=>E.value.config.scaleOverLifeCurve=C),"default-curve":te,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","value-min","value-max","curve"]),E.value.config.scaleOverLifeAxisMode==="separate"?(ie(),Qt(Hn,{key:0,label:"倍率 Y","show-modes":!1,mode:E.value.config.scaleOverLifeMode,"onUpdate:mode":S[112]||(S[112]=C=>E.value.config.scaleOverLifeMode=C),"value-min":E.value.config.scaleYOverLifeMin,"onUpdate:valueMin":S[113]||(S[113]=C=>E.value.config.scaleYOverLifeMin=C),"value-max":E.value.config.scaleYOverLifeMax,"onUpdate:valueMax":S[114]||(S[114]=C=>E.value.config.scaleYOverLifeMax=C),curve:E.value.config.scaleYOverLifeCurve,"onUpdate:curve":S[115]||(S[115]=C=>E.value.config.scaleYOverLifeCurve=C),"default-curve":te,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):Xe("",!0)],64)):Xe("",!0)]),T("div",XD,[T("label",VD,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[116]||(S[116]=C=>E.value.config.rotationOverLifeEnabled=C)},null,512),[[ei,E.value.config.rotationOverLifeEnabled]]),S[280]||(S[280]=T("span",{class:"switch-ui"},null,-1)),S[281]||(S[281]=T("span",null,"生命周期内旋转",-1))]),E.value.config.rotationOverLifeEnabled?(ie(),Qt(Hn,{key:0,label:"旋转速度",mode:E.value.config.rotationOverLifeMode,"onUpdate:mode":S[117]||(S[117]=C=>E.value.config.rotationOverLifeMode=C),"value-min":E.value.config.rotationSpeedMin,"onUpdate:valueMin":S[118]||(S[118]=C=>E.value.config.rotationSpeedMin=C),"value-max":E.value.config.rotationSpeedMax,"onUpdate:valueMax":S[119]||(S[119]=C=>E.value.config.rotationSpeedMax=C),curve:E.value.config.rotationOverLifeCurve,"onUpdate:curve":S[120]||(S[120]=C=>E.value.config.rotationOverLifeCurve=C),"default-curve":j,min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):Xe("",!0)])],512),[[Sr,!ae.attr]])]),T("div",YD,[T("div",{class:"group-head",onClick:S[122]||(S[122]=C=>Le("look"))},[T("span",$D,je(ae.look?"▸":"▾"),1),S[284]||(S[284]=T("span",null,"外观与资源",-1)),T("button",{class:"group-reset",title:"重置外观与资源参数",onClick:S[121]||(S[121]=xt(C=>Wi("look"),["stop"]))},"重置")]),be(T("div",GD,[S[298]||(S[298]=T("div",{class:"look-title"},"透明度",-1)),T("div",HD,[T("button",{class:ot(["seg-btn",{active:E.value.config.alphaMode==="curve"}]),onClick:S[123]||(S[123]=C=>E.value.config.alphaMode="curve")},"曲线",2),T("button",{class:ot(["seg-btn",{active:E.value.config.alphaMode==="fixed"}]),onClick:S[124]||(S[124]=C=>E.value.config.alphaMode="fixed")},"固定",2)]),E.value.config.alphaMode==="fixed"?(ie(),Qt(qe,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:E.value.config.alpha,"onUpdate:modelValue":S[125]||(S[125]=C=>E.value.config.alpha=C)},null,8,["modelValue"])):(ie(),oe(Ke,{key:1},[T("label",jD,[S[286]||(S[286]=T("span",null,"曲线模式",-1)),be(T("select",{"onUpdate:modelValue":S[126]||(S[126]=C=>E.value.config.curveMode=C),class:"inp"},[...S[285]||(S[285]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[jt,E.value.config.curveMode]])]),T("div",WD,[Ue(yn,{modelValue:E.value.config.alphaCurve,"onUpdate:modelValue":S[127]||(S[127]=C=>E.value.config.alphaCurve=C),"default-value":he,mode:M(E.value.config.curveMode)},null,8,["modelValue","mode"]),S[287]||(S[287]=T("div",{class:"curve-labels"},[T("span",null,"0(透明)"),T("span",null,"生命周期 →"),T("span",null,"1(不透明)")],-1))])],64)),T("div",{class:"look-title image-title"},[S[288]||(S[288]=T("span",null,"图片资源",-1)),T("button",{class:"image-add",title:"新增图片资源",onClick:Ie},"+")]),(ie(!0),oe(Ke,null,li(E.value.config.imageResources,C=>(ie(),Qt(qv,{key:C.id,resource:C,"resource-count":E.value.config.imageResources.length,"supports-sequence":"","default-file":"star.png",onPick:Be,onPickSequence:Ae,onReset:nt,onRemove:Pe,onUpdateWeight:Xi,onToggleLock:ns},{default:ah(()=>[Ue(qe,{label:"缩放",min:.1,max:3,step:.05,modelValue:C.scale,"onUpdate:modelValue":Q=>C.scale=Q},null,8,["modelValue","onUpdate:modelValue"]),T("label",zD,[S[289]||(S[289]=T("span",null,"轴心 x,y",-1)),be(T("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":Q=>C.anchorX=Q},null,8,qD),[[ut,C.anchorX,void 0,{number:!0}]]),be(T("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":Q=>C.anchorY=Q},null,8,KD),[[ut,C.anchorY,void 0,{number:!0}]])]),S[297]||(S[297]=T("div",{class:"resource-divider"},null,-1)),T("label",ZD,[S[292]||(S[292]=T("span",null,"颜色",-1)),be(T("select",{"onUpdate:modelValue":Q=>C.colorMode=Q,class:"inp"},[...S[290]||(S[290]=[T("option",{value:"fixed"},"固定色",-1),T("option",{value:"random"},"随机颜色",-1),T("option",{value:"lifetime"},"生命周期",-1)])],8,JD),[[jt,C.colorMode]]),be(T("select",{"onUpdate:modelValue":Q=>C.blend=Q,class:"inp blend-select"},[...S[291]||(S[291]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,QD),[[jt,C.blend]])]),C.colorMode==="fixed"?(ie(),oe("label",eN,[S[293]||(S[293]=T("span",null,"固定色",-1)),be(T("input",{type:"color","onUpdate:modelValue":Q=>C.colorStart=Q,class:"colr"},null,8,tN),[[ut,C.colorStart]]),T("input",{type:"text",class:"hex-input",value:C.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:Q=>Se(C,Q),onKeydown:Ta(Q=>rt(C,Q),["enter"])},null,40,iN)])):(ie(),oe(Ke,{key:1},[Ue(zv,{modelValue:C.colorGradient,"onUpdate:modelValue":Q=>C.colorGradient=Q},null,8,["modelValue","onUpdate:modelValue"]),C.colorMode==="random"?(ie(),oe("div",sN,"每个粒子出生时从色带随机取色,生命周期内保持不变")):Xe("",!0)],64)),T("div",nN,[S[294]||(S[294]=T("span",null,"独立透明度",-1)),T("div",rN,[T("button",{class:ot({on:C.independentAlpha==="off"}),onClick:Q=>C.independentAlpha="off"},"关闭",10,aN),T("button",{class:ot({on:C.independentAlpha==="fixed"}),onClick:Q=>C.independentAlpha="fixed"},"固定",10,oN),T("button",{class:ot({on:C.independentAlpha==="curve"}),onClick:Q=>C.independentAlpha="curve"},"曲线",10,lN)])]),C.independentAlpha==="fixed"?(ie(),Qt(qe,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:C.alpha,"onUpdate:modelValue":Q=>C.alpha=Q},null,8,["modelValue","onUpdate:modelValue"])):C.independentAlpha==="curve"?(ie(),oe(Ke,{key:3},[T("label",cN,[S[296]||(S[296]=T("span",null,"曲线模式",-1)),be(T("select",{"onUpdate:modelValue":Q=>C.alphaCurveMode=Q,class:"inp"},[...S[295]||(S[295]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],8,hN),[[jt,C.alphaCurveMode]])]),T("div",uN,[Ue(yn,{modelValue:C.alphaCurve,"onUpdate:modelValue":Q=>C.alphaCurve=Q,"default-value":ve,mode:M(C.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","mode"])])],64)):Xe("",!0)]),_:2},1032,["resource","resource-count"]))),128)),T("input",{ref_key:"textureFileInput",ref:Qr,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:He},null,544),T("input",{ref_key:"sequenceFileInput",ref:cn,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:st},null,544)],512),[[Sr,!ae.look]])]),T("div",dN,[T("div",{class:"group-head",onClick:S[129]||(S[129]=C=>Le("mods"))},[T("span",fN,je(ae.mods?"▸":"▾"),1),S[299]||(S[299]=T("span",null,"修改器",-1)),T("button",{class:"group-reset",title:"重置修改器参数",onClick:S[128]||(S[128]=xt(C=>Wi("mods"),["stop"]))},"重置")]),be(T("div",mN,[T("div",pN,[T("label",gN,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[130]||(S[130]=C=>E.value.config.noise=C)},null,512),[[ei,E.value.config.noise]]),S[300]||(S[300]=T("span",{class:"switch-ui"},null,-1)),S[301]||(S[301]=T("span",null,"开启移动噪声",-1))]),E.value.config.noise?(ie(),oe("div",vN,[Ue(qe,{label:"强度",min:0,max:100,step:1,modelValue:E.value.config.noiseAmt,"onUpdate:modelValue":S[131]||(S[131]=C=>E.value.config.noiseAmt=C)},null,8,["modelValue"]),Ue(qe,{label:"波动范围",min:0,max:500,step:1,modelValue:E.value.config.noiseRange,"onUpdate:modelValue":S[132]||(S[132]=C=>E.value.config.noiseRange=C)},null,8,["modelValue"]),Ue(qe,{label:"时间流速",min:0,max:10,step:.1,modelValue:E.value.config.noiseSpeed,"onUpdate:modelValue":S[133]||(S[133]=C=>E.value.config.noiseSpeed=C)},null,8,["modelValue"]),S[302]||(S[302]=T("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):Xe("",!0)]),T("div",yN,[T("label",xN,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[134]||(S[134]=C=>E.value.config.useGravity=C)},null,512),[[ei,E.value.config.useGravity]]),S[303]||(S[303]=T("span",{class:"switch-ui"},null,-1)),S[304]||(S[304]=T("span",null,"开启重力",-1))]),E.value.config.useGravity?(ie(),oe("div",bN,[T("div",wN,[T("button",{class:ot(["axis-mode",{on:E.value.config.gravityMode==="fixed"}]),onClick:S[135]||(S[135]=C=>E.value.config.gravityMode="fixed")},"固定",2),T("button",{class:ot(["axis-mode",{on:E.value.config.gravityMode==="random"}]),onClick:S[136]||(S[136]=C=>E.value.config.gravityMode="random")},"随机",2)]),E.value.config.gravityMode==="fixed"?(ie(),Qt(qe,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:E.value.config.gravityMin,"onUpdate:modelValue":S[137]||(S[137]=C=>E.value.config.gravityMin=C)},null,8,["modelValue"])):(ie(),oe(Ke,{key:1},[Ue(qe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:E.value.config.gravityMin,"onUpdate:modelValue":S[138]||(S[138]=C=>E.value.config.gravityMin=C)},null,8,["modelValue"]),Ue(qe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:E.value.config.gravityMax,"onUpdate:modelValue":S[139]||(S[139]=C=>E.value.config.gravityMax=C)},null,8,["modelValue"])],64)),Ue(qe,{label:"方向",min:-360,max:360,step:1,modelValue:E.value.config.gravityDirection,"onUpdate:modelValue":S[140]||(S[140]=C=>E.value.config.gravityDirection=C)},null,8,["modelValue"]),S[305]||(S[305]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内重力"),T("span",null,"纵轴:强度 0~1")],-1)),Ue(yn,{modelValue:E.value.config.gravityCurve,"onUpdate:modelValue":S[141]||(S[141]=C=>E.value.config.gravityCurve=C),"default-value":te},null,8,["modelValue"]),S[306]||(S[306]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),S[307]||(S[307]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Xe("",!0)]),T("div",SN,[T("label",_N,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[142]||(S[142]=C=>E.value.config.wind=C)},null,512),[[ei,E.value.config.wind]]),S[308]||(S[308]=T("span",{class:"switch-ui"},null,-1)),S[309]||(S[309]=T("span",null,"开启风力",-1))]),E.value.config.wind?(ie(),oe("div",MN,[T("div",TN,[T("button",{class:ot(["axis-mode",{on:E.value.config.windMode==="fixed"}]),onClick:S[143]||(S[143]=C=>E.value.config.windMode="fixed")},"固定",2),T("button",{class:ot(["axis-mode",{on:E.value.config.windMode==="random"}]),onClick:S[144]||(S[144]=C=>E.value.config.windMode="random")},"随机",2)]),E.value.config.windMode==="fixed"?(ie(),Qt(qe,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:E.value.config.windMin,"onUpdate:modelValue":S[145]||(S[145]=C=>E.value.config.windMin=C)},null,8,["modelValue"])):(ie(),oe(Ke,{key:1},[Ue(qe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:E.value.config.windMin,"onUpdate:modelValue":S[146]||(S[146]=C=>E.value.config.windMin=C)},null,8,["modelValue"]),Ue(qe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:E.value.config.windMax,"onUpdate:modelValue":S[147]||(S[147]=C=>E.value.config.windMax=C)},null,8,["modelValue"])],64)),Ue(qe,{label:"方向",min:-360,max:360,step:1,modelValue:E.value.config.windDirection,"onUpdate:modelValue":S[148]||(S[148]=C=>E.value.config.windDirection=C)},null,8,["modelValue"]),S[310]||(S[310]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内风力"),T("span",null,"纵轴:强度 0~1")],-1)),Ue(yn,{modelValue:E.value.config.windCurve,"onUpdate:modelValue":S[149]||(S[149]=C=>E.value.config.windCurve=C),"default-value":te},null,8,["modelValue"]),S[311]||(S[311]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),S[312]||(S[312]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Xe("",!0)]),T("div",AN,[T("label",EN,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[150]||(S[150]=C=>E.value.config.forceField=C)},null,512),[[ei,E.value.config.forceField]]),S[313]||(S[313]=T("span",{class:"switch-ui"},null,-1)),S[314]||(S[314]=T("span",null,"开启力场",-1))]),E.value.config.forceField?(ie(),oe("div",CN,[Ue(qe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:E.value.config.forceCenterX,"onUpdate:modelValue":S[151]||(S[151]=C=>E.value.config.forceCenterX=C)},null,8,["modelValue"]),Ue(qe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:E.value.config.forceCenterY,"onUpdate:modelValue":S[152]||(S[152]=C=>E.value.config.forceCenterY=C)},null,8,["modelValue"]),Ue(qe,{label:"力场强度",min:-300,max:300,step:1,modelValue:E.value.config.forceStrength,"onUpdate:modelValue":S[153]||(S[153]=C=>E.value.config.forceStrength=C)},null,8,["modelValue"]),Ue(qe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:E.value.config.forceRadius,"onUpdate:modelValue":S[154]||(S[154]=C=>E.value.config.forceRadius=C)},null,8,["modelValue"]),T("label",IN,[S[316]||(S[316]=T("span",null,"衰减模式",-1)),be(T("select",{"onUpdate:modelValue":S[155]||(S[155]=C=>E.value.config.forceFalloff=C),class:"inp"},[...S[315]||(S[315]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[jt,E.value.config.forceFalloff]])]),S[317]||(S[317]=T("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1))])):Xe("",!0)]),T("div",RN,[T("label",PN,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[156]||(S[156]=C=>E.value.config.attraction=C)},null,512),[[ei,E.value.config.attraction]]),S[318]||(S[318]=T("span",{class:"switch-ui"},null,-1)),S[319]||(S[319]=T("span",null,"开启吸附",-1))]),E.value.config.attraction?(ie(),oe("div",kN,[Ue(qe,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:E.value.config.attractionCenterX,"onUpdate:modelValue":S[157]||(S[157]=C=>E.value.config.attractionCenterX=C)},null,8,["modelValue"]),Ue(qe,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:E.value.config.attractionCenterY,"onUpdate:modelValue":S[158]||(S[158]=C=>E.value.config.attractionCenterY=C)},null,8,["modelValue"]),Ue(qe,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:E.value.config.attractionRadius,"onUpdate:modelValue":S[159]||(S[159]=C=>E.value.config.attractionRadius=C)},null,8,["modelValue"]),Ue(qe,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:E.value.config.attractionDuration,"onUpdate:modelValue":S[160]||(S[160]=C=>E.value.config.attractionDuration=C)},null,8,["modelValue"]),Ue(qe,{label:"延迟时间",min:0,max:30,step:.05,modelValue:E.value.config.attractionDelay,"onUpdate:modelValue":S[161]||(S[161]=C=>E.value.config.attractionDelay=C)},null,8,["modelValue"]),T("label",FN,[S[321]||(S[321]=T("span",null,"延迟方式",-1)),be(T("select",{"onUpdate:modelValue":S[162]||(S[162]=C=>E.value.config.attractionDelayMode=C),class:"inp"},[...S[320]||(S[320]=[T("option",{value:"global"},"统一时间",-1),T("option",{value:"particle"},"单粒子生命",-1)])],512),[[jt,E.value.config.attractionDelayMode]])]),T("label",ON,[S[323]||(S[323]=T("span",null,"吸附方式",-1)),be(T("select",{"onUpdate:modelValue":S[163]||(S[163]=C=>E.value.config.attractionPath=C),class:"inp"},[...S[322]||(S[322]=[T("option",{value:"linear"},"直线",-1),T("option",{value:"curve"},"曲线",-1)])],512),[[jt,E.value.config.attractionPath]])]),S[324]||(S[324]=T("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1))])):Xe("",!0)]),T("div",BN,[T("label",LN,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[164]||(S[164]=C=>E.value.config.trail=C)},null,512),[[ei,E.value.config.trail]]),S[325]||(S[325]=T("span",{class:"switch-ui"},null,-1)),S[326]||(S[326]=T("span",null,"开启拖尾",-1))]),E.value.config.trail?(ie(),oe("div",DN,[T("div",{class:"trail-section-head"},[S[327]||(S[327]=T("div",{class:"trail-section-title"},"拖尾独立图片",-1)),T("button",{class:"image-add",title:"增加拖尾图片资源",onClick:un},"+")]),(ie(!0),oe(Ke,null,li(E.value.config.trailResources,C=>(ie(),Qt(qv,{key:C.id,resource:C,"resource-count":E.value.config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:Ga,onReset:ne,onRemove:ue,onUpdateWeight:_e,onToggleLock:Me},{default:ah(()=>[S[343]||(S[343]=T("div",{class:"resource-divider"},null,-1)),Ue(qe,{label:"旋转",min:-360,max:360,step:1,"model-value":C.rotation,"onUpdate:modelValue":Q=>Y(C.id,Q)},null,8,["model-value","onUpdate:modelValue"]),Ue(qe,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":C.boneCount,"onUpdate:modelValue":Q=>H(C.id,Q)},null,8,["model-value","onUpdate:modelValue"]),Ue(qe,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:C.trailRatio,"onUpdate:modelValue":Q=>C.trailRatio=Q},null,8,["modelValue","onUpdate:modelValue"]),T("label",NN,[S[329]||(S[329]=T("span",null,"拖尾长度",-1)),be(T("select",{"onUpdate:modelValue":Q=>C.lengthMode=Q,class:"inp"},[...S[328]||(S[328]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,UN),[[jt,C.lengthMode]])]),C.lengthMode==="fixed"?(ie(),Qt(qe,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:C.length,"onUpdate:modelValue":Q=>C.length=Q},null,8,["modelValue","onUpdate:modelValue"])):(ie(),oe(Ke,{key:1},[Ue(qe,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:C.lengthMin,"onUpdate:modelValue":Q=>C.lengthMin=Q},null,8,["modelValue","onUpdate:modelValue"]),Ue(qe,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:C.lengthMax,"onUpdate:modelValue":Q=>C.lengthMax=Q},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",XN,[S[331]||(S[331]=T("span",null,"拖尾宽度",-1)),be(T("select",{"onUpdate:modelValue":Q=>C.widthSizeMode=Q,class:"inp"},[...S[330]||(S[330]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,VN),[[jt,C.widthSizeMode]])]),C.widthSizeMode==="fixed"?(ie(),Qt(qe,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:C.width,"onUpdate:modelValue":Q=>C.width=Q},null,8,["modelValue","onUpdate:modelValue"])):(ie(),oe(Ke,{key:3},[Ue(qe,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:C.widthMin,"onUpdate:modelValue":Q=>C.widthMin=Q},null,8,["modelValue","onUpdate:modelValue"]),Ue(qe,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:C.widthMax,"onUpdate:modelValue":Q=>C.widthMax=Q},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",YN,[S[333]||(S[333]=T("span",null,"宽度缩放",-1)),be(T("select",{"onUpdate:modelValue":Q=>C.widthMode=Q,class:"inp"},[...S[332]||(S[332]=[T("option",{value:"particle"},"跟随粒子",-1),T("option",{value:"fixed"},"固定",-1)])],8,$N),[[jt,C.widthMode]])]),T("label",GN,[be(T("input",{type:"checkbox","onUpdate:modelValue":Q=>C.lifeLengthEnabled=Q},null,8,HN),[[ei,C.lifeLengthEnabled]]),S[334]||(S[334]=T("span",{class:"switch-ui"},null,-1)),S[335]||(S[335]=T("span",null,"生命周期长度曲线",-1))]),C.lifeLengthEnabled?(ie(),Qt(yn,{key:4,modelValue:C.lifeLengthCurve,"onUpdate:modelValue":Q=>C.lifeLengthCurve=Q,"default-value":te},null,8,["modelValue","onUpdate:modelValue"])):Xe("",!0),T("label",jN,[be(T("input",{type:"checkbox","onUpdate:modelValue":Q=>C.shapeEnabled=Q},null,8,WN),[[ei,C.shapeEnabled]]),S[336]||(S[336]=T("span",{class:"switch-ui"},null,-1)),S[337]||(S[337]=T("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),C.shapeEnabled?(ie(),Qt(yn,{key:5,modelValue:C.shapeCurve,"onUpdate:modelValue":Q=>C.shapeCurve=Q,"default-value":ye},null,8,["modelValue","onUpdate:modelValue"])):Xe("",!0),T("div",zN,[S[338]||(S[338]=T("span",null,"颜色模式",-1)),T("div",qN,[T("button",{class:ot(["axis-mode",{on:C.colorMode==="particle"}]),onClick:Q=>C.colorMode="particle"},"跟随粒子",10,KN),T("button",{class:ot(["axis-mode",{on:C.colorMode==="fixed"}]),onClick:Q=>C.colorMode="fixed"},"固定",10,ZN),T("button",{class:ot(["axis-mode",{on:C.colorMode==="curve"}]),onClick:Q=>C.colorMode="curve"},"曲线",10,JN)])]),T("label",QN,[S[340]||(S[340]=T("span",null,"混合模式",-1)),be(T("select",{"onUpdate:modelValue":Q=>C.blend=Q,class:"inp"},[...S[339]||(S[339]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,e5),[[jt,C.blend]])]),C.colorMode==="fixed"?(ie(),oe("label",t5,[S[341]||(S[341]=T("span",null,"固定颜色",-1)),be(T("input",{class:"colr",type:"color","onUpdate:modelValue":Q=>C.color=Q},null,8,i5),[[ut,C.color]]),T("input",{class:"hex-input",value:C.color,onChange:Q=>xe(C,Q),onKeydown:Ta(xt(Q=>De(C,Q),["prevent"]),["enter"])},null,40,s5)])):C.colorMode==="curve"?(ie(),Qt(zv,{key:7,modelValue:C.colorGradient,"onUpdate:modelValue":Q=>C.colorGradient=Q},null,8,["modelValue","onUpdate:modelValue"])):Xe("",!0),T("div",n5,[S[342]||(S[342]=T("span",null,"透明度模式",-1)),T("div",r5,[T("button",{class:ot(["axis-mode",{on:C.alphaMode==="particle"}]),onClick:Q=>C.alphaMode="particle"},"跟随粒子",10,a5),T("button",{class:ot(["axis-mode",{on:C.alphaMode==="fixed"}]),onClick:Q=>C.alphaMode="fixed"},"固定",10,o5),T("button",{class:ot(["axis-mode",{on:C.alphaMode==="curve"}]),onClick:Q=>C.alphaMode="curve"},"曲线",10,l5)])]),C.alphaMode==="fixed"?(ie(),Qt(qe,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:C.alpha,"onUpdate:modelValue":Q=>C.alpha=Q},null,8,["modelValue","onUpdate:modelValue"])):Xe("",!0),C.alphaMode==="curve"?(ie(),Qt(yn,{key:9,modelValue:C.alphaCurve,"onUpdate:modelValue":Q=>C.alphaCurve=Q,"default-value":le},null,8,["modelValue","onUpdate:modelValue"])):Xe("",!0)]),_:2},1032,["resource","resource-count"]))),128)),T("input",{ref_key:"trailTextureFileInput",ref:hn,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:ee},null,544),T("div",c5,[Ue(qe,{label:"网格行数",min:2,max:16,step:1,"model-value":E.value.config.trailGridRows,"onUpdate:modelValue":S[165]||(S[165]=C=>br("trailGridRows",C))},null,8,["model-value"]),Ue(qe,{label:"网格列数",min:2,max:32,step:1,"model-value":E.value.config.trailGridCols,"onUpdate:modelValue":S[166]||(S[166]=C=>br("trailGridCols",C))},null,8,["model-value"])]),S[344]||(S[344]=T("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):Xe("",!0)]),T("div",h5,[T("label",u5,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[167]||(S[167]=C=>E.value.config.emitterFollow=C),disabled:E.value.config.streamBehavior==="loop"},null,8,d5),[[ei,E.value.config.emitterFollow]]),S[345]||(S[345]=T("span",{class:"switch-ui"},null,-1)),S[346]||(S[346]=T("span",null,"开启发射器跟随",-1))]),E.value.config.emitterFollow&&E.value.config.streamBehavior!=="loop"?(ie(),oe("div",f5,[T("label",m5,[S[349]||(S[349]=T("span",null,"跟随模式",-1)),T("select",{value:E.value.config.emitterFollowMode,class:"inp",onChange:S[168]||(S[168]=C=>Zt(C,E.value.config))},[S[347]||(S[347]=T("option",{value:"none"},"无",-1)),S[348]||(S[348]=T("option",{value:"path"},"跟随路径",-1)),we.value||E.value.config.emitterFollowMode==="bone"?(ie(),oe("option",g5,"选中的骨骼")):Xe("",!0)],40,p5)]),E.value.config.emitterFollowMode==="path"?(ie(),oe(Ke,{key:0},[T("label",v5,[S[351]||(S[351]=T("span",null,"跟随路径",-1)),be(T("select",{"onUpdate:modelValue":S[169]||(S[169]=C=>E.value.config.emitterFollowPathId=C),class:"inp"},[S[350]||(S[350]=T("option",{value:0},"无",-1)),(ie(!0),oe(Ke,null,li(ke(e).paths,C=>(ie(),oe("option",{key:C.id,value:C.id},je(C.name),9,y5))),128))],512),[[jt,E.value.config.emitterFollowPathId,void 0,{number:!0}]])]),T("label",x5,[S[353]||(S[353]=T("span",null,"发射器角度模式",-1)),be(T("select",{"onUpdate:modelValue":S[170]||(S[170]=C=>E.value.config.emitterAngleMode=C),class:"inp"},[...S[352]||(S[352]=[T("option",{value:"fixed"},"固定角度",-1),T("option",{value:"direction"},"跟随移动方向",-1)])],512),[[jt,E.value.config.emitterAngleMode]])]),S[359]||(S[359]=T("div",{class:"gravity-curve-title"},[T("span",null,"移动进度曲线 (0→1)")],-1)),Ue(yn,{modelValue:E.value.config.emitterFollowCurve,"onUpdate:modelValue":S[171]||(S[171]=C=>E.value.config.emitterFollowCurve=C),"default-value":j},null,8,["modelValue"]),T("div",b5,[T("label",w5,[S[354]||(S[354]=T("span",null,"移动时长 (s)",-1)),be(T("input",{"onUpdate:modelValue":S[172]||(S[172]=C=>E.value.config.emitterFollowDuration=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ut,E.value.config.emitterFollowDuration,void 0,{number:!0}]])]),T("label",S5,[S[356]||(S[356]=T("span",null,"跟随空间",-1)),be(T("select",{"onUpdate:modelValue":S[173]||(S[173]=C=>E.value.config.emitterFollowSpace=C),class:"inp"},[...S[355]||(S[355]=[T("option",{value:"local"},"局部空间(GEN 移动)",-1),T("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[jt,E.value.config.emitterFollowSpace]])])]),T("label",_5,[S[358]||(S[358]=T("span",null,"移动方向",-1)),be(T("select",{"onUpdate:modelValue":S[174]||(S[174]=C=>E.value.config.emitterFollowDirection=C),class:"inp"},[...S[357]||(S[357]=[T("option",{value:"forward"},"正向(起点 → 终点)",-1),T("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[jt,E.value.config.emitterFollowDirection]])]),Ue(qe,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:E.value.config.emitterFollowOffset,"onUpdate:modelValue":S[175]||(S[175]=C=>E.value.config.emitterFollowOffset=C)},null,8,["modelValue"]),S[360]||(S[360]=T("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):E.value.config.emitterFollowMode==="bone"?(ie(),oe(Ke,{key:1},[Ee.value?(ie(),oe("div",M5,[S[361]||(S[361]=ri("跟随目标:",-1)),T("strong",null,je(Ee.value.spine.name)+" / "+je(Ee.value.boneName),1)])):(ie(),oe("div",T5,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),we.value&&(!Ee.value||we.value.spine.id!==Ee.value.spine.id||we.value.boneName!==Ee.value.boneName)?(ie(),oe("button",{key:2,class:"bone-follow-rebind",onClick:S[176]||(S[176]=C=>Fi(E.value.config))},je(Ee.value?"重新绑定":"绑定")+"当前选中骨骼:"+je(we.value.spine.name)+" / "+je(we.value.boneName),1)):Xe("",!0),Ee.value?(ie(),oe(Ke,{key:3},[T("label",A5,[S[363]||(S[363]=T("span",null,"跟随空间",-1)),be(T("select",{"onUpdate:modelValue":S[177]||(S[177]=C=>E.value.config.emitterFollowSpace=C),class:"inp"},[...S[362]||(S[362]=[T("option",{value:"local"},"本地空间(随骨骼移动)",-1),T("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[jt,E.value.config.emitterFollowSpace]])]),T("div",E5,[T("label",C5,[S[364]||(S[364]=T("span",null,"位移偏移 X",-1)),be(T("input",{"onUpdate:modelValue":S[178]||(S[178]=C=>E.value.config.emitterFollowBoneOffsetX=C),type:"number",step:"1",class:"inp"},null,512),[[ut,E.value.config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),T("label",I5,[S[365]||(S[365]=T("span",null,"位移偏移 Y",-1)),be(T("input",{"onUpdate:modelValue":S[179]||(S[179]=C=>E.value.config.emitterFollowBoneOffsetY=C),type:"number",step:"1",class:"inp"},null,512),[[ut,E.value.config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),T("div",R5,[T("label",P5,[S[366]||(S[366]=T("span",null,"旋转偏移",-1)),be(T("input",{"onUpdate:modelValue":S[180]||(S[180]=C=>E.value.config.emitterFollowBoneRotation=C),type:"number",step:"1",class:"inp"},null,512),[[ut,E.value.config.emitterFollowBoneRotation,void 0,{number:!0}]])]),T("label",k5,[S[367]||(S[367]=T("span",null,"缩放偏移 X",-1)),be(T("input",{"onUpdate:modelValue":S[181]||(S[181]=C=>E.value.config.emitterFollowBoneScaleX=C),type:"number",step:"0.05",class:"inp"},null,512),[[ut,E.value.config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),T("label",F5,[S[368]||(S[368]=T("span",null,"缩放偏移 Y",-1)),be(T("input",{"onUpdate:modelValue":S[182]||(S[182]=C=>E.value.config.emitterFollowBoneScaleY=C),type:"number",step:"0.05",class:"inp"},null,512),[[ut,E.value.config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),S[369]||(S[369]=T("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):Xe("",!0)],64)):Xe("",!0)])):Xe("",!0)]),T("div",O5,[T("label",B5,[be(T("input",{type:"checkbox","onUpdate:modelValue":S[183]||(S[183]=C=>E.value.config.collision=C)},null,512),[[ei,E.value.config.collision]]),S[370]||(S[370]=T("span",{class:"switch-ui"},null,-1)),S[371]||(S[371]=T("span",null,"开启碰撞",-1))]),E.value.config.collision?(ie(),oe("div",L5,[S[372]||(S[372]=T("div",{class:"collision-filter-title"},"参与的碰撞对象",-1)),T("div",D5,[(ie(!0),oe(Ke,null,li(Te.value,C=>(ie(),oe("span",{key:C.id,class:ot(["collision-filter-tag",{disabled:!C.enabled}]),title:C.enabled?C.name:`${C.name}(碰撞体已禁用)`},[T("span",null,je(C.name),1),T("button",{type:"button","aria-label":`清除碰撞对象 ${C.name}`,onClick:Q=>z(C.id)},"×",8,U5)],10,N5))),128)),T("button",{type:"button",class:ot(["collision-filter-add",{active:ge.value}]),disabled:G.value.length===0,title:G.value.length?"加入场景碰撞对象":"没有可加入的碰撞对象",onClick:S[184]||(S[184]=C=>ge.value=!ge.value)},"+",10,X5)]),Te.value.length===0?(ie(),oe("div",V5,"未选择碰撞对象,当前粒子不会发生碰撞")):Xe("",!0),ge.value&&G.value.length?(ie(),oe("div",Y5,[(ie(!0),oe(Ke,null,li(G.value,C=>(ie(),oe("button",{key:C.id,type:"button",onClick:Q=>Z(C.id)},[T("span",null,je(C.name),1),T("small",null,je(C.enabled?"可用":"已禁用"),1)],8,$5))),128))])):Xe("",!0),S[373]||(S[373]=T("div",{class:"modifier-hint"},"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",-1))])):Xe("",!0)]),Ue(qe,{label:"阻尼",min:0,max:2,step:.05,modelValue:E.value.config.damping,"onUpdate:modelValue":S[185]||(S[185]=C=>E.value.config.damping=C)},null,8,["modelValue"])],512),[[Sr,!ae.mods]])]),T("div",G5,[T("div",{class:"group-head",onClick:S[187]||(S[187]=C=>Le("export"))},[T("span",H5,je(ae.export?"▸":"▾"),1),S[374]||(S[374]=T("span",null,"导出设置",-1)),T("button",{class:"group-reset",title:"重置导出设置",onClick:S[186]||(S[186]=xt(C=>Wi("export"),["stop"]))},"重置")]),be(T("div",j5,[T("label",W5,[S[375]||(S[375]=T("span",null,"图片路径 (Spine Images Path)",-1)),be(T("input",{"onUpdate:modelValue":S[188]||(S[188]=C=>t.value.imagesPath=C),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[ut,t.value.imagesPath,void 0,{trim:!0}]])]),T("label",z5,[S[377]||(S[377]=T("span",null,"Spine 版本",-1)),be(T("select",{"onUpdate:modelValue":S[189]||(S[189]=C=>t.value.spineVersion=C),class:"inp export-input"},[...S[376]||(S[376]=[io('',5)])],512),[[jt,t.value.spineVersion]])]),T("label",q5,[S[379]||(S[379]=T("span",null,"关键帧插值曲线",-1)),be(T("select",{"onUpdate:modelValue":S[190]||(S[190]=C=>t.value.keyframeCurve=C),class:"inp export-input"},[...S[378]||(S[378]=[T("option",{value:"linear"},"线性 (Linear)",-1),T("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[jt,t.value.keyframeCurve]])]),S[388]||(S[388]=T("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),t.value.spineVersion==="3.8"?(ie(),oe("div",K5,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):Xe("",!0),T("div",Z5,[T("label",J5,[S[380]||(S[380]=T("span",null,"导出 FPS",-1)),be(T("input",{"onUpdate:modelValue":S[191]||(S[191]=C=>t.value.fps=C),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:on},null,544),[[ut,t.value.fps,void 0,{number:!0}]])]),T("label",Q5,[be(T("input",{"onUpdate:modelValue":S[192]||(S[192]=C=>t.value.omitFps=C),type:"checkbox"},null,512),[[ei,t.value.omitFps]]),S[381]||(S[381]=ri("不写 fps",-1))])]),S[389]||(S[389]=T("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),T("div",e4,[T("label",t4,[be(T("input",{"onUpdate:modelValue":S[193]||(S[193]=C=>t.value.integerFrameAlignment=C),type:"checkbox"},null,512),[[ei,t.value.integerFrameAlignment]]),S[382]||(S[382]=T("span",{class:"switch-ui"},null,-1)),S[383]||(S[383]=T("span",null,"整数帧对齐",-1))]),T("label",i4,[be(T("input",{"onUpdate:modelValue":S[194]||(S[194]=C=>t.value.bonePool=C),type:"checkbox"},null,512),[[ei,t.value.bonePool]]),S[384]||(S[384]=T("span",{class:"switch-ui"},null,-1)),S[385]||(S[385]=T("span",null,"骨骼对象池",-1))]),T("label",s4,[be(T("input",{"onUpdate:modelValue":S[195]||(S[195]=C=>t.value.excludeEmptyAnimations=C),type:"checkbox"},null,512),[[ei,t.value.excludeEmptyAnimations]]),S[386]||(S[386]=T("span",{class:"switch-ui"},null,-1)),S[387]||(S[387]=T("span",null,"排除无内容动画",-1))])])],512),[[Sr,!ae.export]])])],64)):Xe("",!0)]),T("div",n4,[T("button",{type:"button",class:"export-spine-json",disabled:l.value,title:l.value?"正在重新计算并烘焙动画":`导出 Spine ${t.value.spineVersion} JSON`,onClick:L},je(l.value&&c.value==="json"?"正在准备导出…":"导出Spine Json"),9,r4),T("button",{type:"button",class:"export-spine-images",disabled:l.value,title:"单独下载当前粒子系统使用的图片 ZIP",onClick:O},je(l.value&&c.value==="images"?"正在整理图片…":"导出 images 包"),9,a4),T("button",{type:"button",class:"export-spine-project",disabled:l.value||!b.value,title:A.value,onClick:N},[T("span",null,je(l.value&&c.value==="spine"?"正在生成工程…":"导出 .spine 包"),1),!l.value&&w.value?(ie(),oe("small",l4,je(w.value),1)):Xe("",!0)],8,o4)]),T("div",{class:ot(["connector-status",v.value])},[S[390]||(S[390]=T("span",{class:"connector-dot"},null,-1)),ri(je(g.value)+" ",1),y.value?(ie(),oe("a",{key:0,href:y.value,target:"_blank",rel:"noopener",title:"在本机连接器中授权当前网站"},"授权当前网站",8,c4)):Xe("",!0),T("button",{type:"button",title:"重新检测连接器",onClick:B},"刷新")],2),u.value?(ie(),oe("div",{key:0,class:ot(["export-message",{error:d.value}])},[ri(je(u.value)+" ",1),p.value?(ie(),oe("a",{key:0,href:p.value,target:"_blank",rel:"noopener",onClick:S[196]||(S[196]=C=>p.value="")},"授权当前网站",8,h4)):Xe("",!0)],2)):Xe("",!0)]))}}),d4=an(u4,[["__scopeId","data-v-1ace5c57"]]),f4={class:"timeline"},m4={class:"tl-controls"},p4=["title"],g4={class:"tl-range",title:"自定义播放起始帧"},v4=["max","onKeydown"],y4={class:"tl-range",title:"自定义播放结束帧"},x4=["min","max","onKeydown"],b4=["title"],w4={class:"tl-frame"},S4=["disabled"],_4=["onClick"],M4={key:0},T4={class:"tl-animation-editor"},A4={key:0,class:"tl-animation-error"},E4={class:"tl-animation-actions"},C4=["disabled"],I4={key:1,class:"tl-animation-hint"},R4={class:"tl-anim tl-spine-preview"},P4=["value","disabled"],k4={value:""},F4=["value"],O4={class:"tl-zoom"},B4={class:"tl-ticks"},L4={class:"tl-ticklabel"},D4={class:"tl-lanes"},N4=["onPointerdown"],U4={class:"lane-name"},X4=["onPointerdown"],V4=["onPointerdown"],Y4=["onPointerdown"],$4={class:"lane-name"},G4={key:0,class:"tl-empty"},H4=nn({__name:"Timeline",setup(s){const e=Kl(),t=ht(null),i=ht(null),n=ht(!1),r=ht("animation"),a=ht("");Qo(()=>{(!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 z of e.systems)(!z.animation||!e.timeline.animations.includes(z.animation))&&(z.animation=e.timeline.animations[0])});const o=gt(()=>e.systems.find(z=>z.id===e.activeId)||null),h=gt(()=>{const z=o.value;return!z||!W(z)?null:v1(z.config,m.value)});function l(){o.value&&(n.value=!n.value,r.value=o.value.animation,a.value="")}function c(z){const j=o.value;j&&(e.setSystemAnimation(j.id,z),r.value=z,a.value="")}function u(){const z=e.addAnimation();r.value=z,a.value=""}function d(){var te;const z=((te=o.value)==null?void 0:te.animation)||e.timeline.animation,j=r.value.trim();if(!j){a.value="动画名称不能为空";return}if(j!==z&&e.timeline.animations.includes(j)){a.value="动画名称不能重复";return}if(!e.renameAnimation(z,j)){a.value="无法修改动画名称";return}r.value=j,a.value=""}function f(){var te,he;const z=((te=o.value)==null?void 0:te.animation)||e.timeline.animation;if(!e.removeAnimation(z)){a.value="至少需要保留一个动画";return}const j=((he=o.value)==null?void 0:he.animation)||e.timeline.animation;r.value=j,a.value=""}function p(z){var j;(j=i.value)!=null&&j.contains(z.target)||(n.value=!1)}La(()=>document.addEventListener("pointerdown",p)),du(()=>document.removeEventListener("pointerdown",p));const m=gt(()=>Math.max(1,e.timeline.fps||30)),g=ht(120),v=ht({}),b=ht({}),y=ht({}),w=ht({}),A=ht(String(e.timeline.playbackStart)),M=ht(String(e.timeline.playbackEnd));ds(()=>e.timeline.playbackStart,z=>{A.value=String(z)}),ds(()=>e.timeline.playbackEnd,z=>{M.value=String(z)});const _=gt(()=>e.timeline.totalFrames),R=gt(()=>g.value<=30?"放大":g.value>=300?"缩小":"适中"),P=gt(()=>e.spines.filter(z=>z.selectedAnimation&&z.animations.some(j=>j.name===z.selectedAnimation&&j.duration>0))),F=gt(()=>(e.activeObjectType==="spine"?e.spines.find(j=>j.id===e.activeObjectId&&j.animations.length):null)||e.spines.find(j=>j.animations.length)||null);function I(z){const j=F.value;j&&(j.selectedAnimation=z.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(M.value)),M.value=String(e.timeline.playbackEnd)}function D(){const z=h.value;z&&(e.setPlaybackEnd(z.end),e.setPlaybackStart(z.start))}function U(){var j;const z=((j=t.value)==null?void 0:j.clientWidth)||600;return g.value/z}const L=gt(()=>{const z=[],j=g.value;let te=1;g.value<=10?te=1:g.value<=50?te=5:g.value<=200?te=10:g.value<=500?te=50:te=100;for(let he=0;he<=j;he+=te)z.push({f:he,px:he/U()});return z}),N=gt(()=>e.timeline.frame/U());function O(z){const j=z.config;return(v.value[z.id]??Math.max(0,Number(j.delay)||0))*m.value/U()}function X(z){const j=z.config,te=Math.max(0,Number(j.lifeMin)||0),he=Math.max(0,Number(j.lifeMax)||0);return j.lifeMode==="fixed"?te:Math.max(te,he)}function E(z){return q(z)}function V(z){if(z.config.mode!=="stream")return 0;if(z.config.streamBehavior==="loop"){const te=z.config;return(y.value[z.id]??Vr(te,m.value).loop)/U()}return(b.value[z.id]??Math.max(1/m.value,Number(z.config.duration)||1))*m.value/U()}function q(z){const j=z.config;return j.mode==="stream"&&j.streamBehavior==="loop"?J(z)+V(z)+K(z):V(z)+X(z)*m.value/U()}function W(z){const j=z.config;return j.mode==="stream"&&j.streamBehavior==="loop"}function J(z){return W(z)?Vr(z.config,m.value).start/U():0}function K(z){return W(z)?Vr(z.config,m.value).end/U():0}function fe(z){var j;return((j=z.animations.find(te=>te.name===z.selectedAnimation))==null?void 0:j.duration)||0}function me(z){return(w.value[z.id]??Math.max(0,Number(z.timeOffset)||0))*m.value/U()}function we(z){return fe(z)*m.value/U()}function Ee(z){const j=z.deltaY<0?.8:1.25;let te=g.value*j;te=Math.min(2e3,Math.max(10,te)),g.value=Math.round(te)}function ge(z){const j=t.value,te=ve=>{const le=j.getBoundingClientRect(),ye=Math.floor((ve.clientX-le.left)/le.width*g.value);e.timeline.frame=Math.max(0,Math.min(ye,_.value-1))};te(z);const he=()=>{window.removeEventListener("pointermove",te),window.removeEventListener("pointerup",he)};window.addEventListener("pointermove",te),window.addEventListener("pointerup",he)}function Te(z,j){z.stopPropagation();const te=z.clientX,he=Math.max(0,Number(j.config.delay)||0),ve=U()/m.value,le=Re=>{const Oe=(Re.clientX-te)*ve,tt=Math.max(0,Math.min(he+Oe,600));v.value[j.id]=Math.round(tt*m.value)/m.value},ye=Re=>{window.removeEventListener("pointermove",le),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",Le);const Oe=v.value[j.id];delete v.value[j.id],Re&&Oe!=null&&Oe!==he&&(j.config.delay=Oe)},ae=()=>ye(!0),Le=()=>ye(!1);window.addEventListener("pointermove",le),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",Le)}function G(z,j){var Pt;z.stopPropagation();const te=W(j),he=Math.max(0,Number(j.config.duration)||0),ve=Vr(j.config,m.value).loop,le=U()/m.value,ye=((Pt=z.currentTarget.closest(".lane-bar"))==null?void 0:Pt.getBoundingClientRect().left)??z.clientX,ae=J(j);let Le=!1;const Re=wt=>{if(Le=!0,te){const Rt=Math.min(1800,Math.max(1,Math.round((wt.clientX-ye-ae)/U())));y.value[j.id]=Rt}else{const Rt=Math.max(1/m.value,Math.min((wt.clientX-ye)*le,600));b.value[j.id]=Math.round(Rt*m.value)/m.value}},Oe=wt=>{window.removeEventListener("pointermove",Re),window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",St);const Rt=b.value[j.id],Zt=y.value[j.id];delete b.value[j.id],delete y.value[j.id],wt&&Le&&te&&Zt!=null&&Zt!==ve?j.config.loopDurationFrames=Zt:wt&&Le&&!te&&Rt!=null&&Rt!==he&&(j.config.duration=Rt)},tt=()=>Oe(!0),St=()=>Oe(!1);window.addEventListener("pointermove",Re),window.addEventListener("pointerup",tt),window.addEventListener("pointercancel",St)}function Z(z,j){z.stopPropagation();const te=z.clientX,he=Math.max(0,Number(j.timeOffset)||0),ve=U()/m.value,le=Re=>{const Oe=Math.max(0,Math.min(he+(Re.clientX-te)*ve,600));w.value[j.id]=Math.round(Oe*m.value)/m.value},ye=Re=>{window.removeEventListener("pointermove",le),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",Le);const Oe=w.value[j.id];delete w.value[j.id],Re&&Oe!=null&&Oe!==he&&(j.timeOffset=Oe,e.recalcTotalFrames())},ae=()=>ye(!0),Le=()=>ye(!1);window.addEventListener("pointermove",le),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",Le)}return(z,j)=>{var te,he,ve;return ie(),oe("div",f4,[T("div",m4,[T("button",{class:ot(["tl-btn",{on:ke(e).timeline.playing}]),onClick:j[0]||(j[0]=le=>ke(e).togglePlay()),title:ke(e).timeline.playing?"暂停 (D)":"播放 (D)"},je(ke(e).timeline.playing?"❚❚":"▶"),11,p4),T("button",{class:"tl-btn",onClick:j[1]||(j[1]=le=>ke(e).toStart()),title:"回到第一帧 (S)"},"⏮"),T("button",{class:"tl-btn",onClick:j[2]||(j[2]=le=>ke(e).previousFrame()),title:"前一帧"},"◀"),T("button",{class:"tl-btn",onClick:j[3]||(j[3]=le=>ke(e).nextFrame()),title:"后一帧"},"▶"),T("button",{class:"tl-btn",onClick:j[4]||(j[4]=le=>ke(e).toEnd()),title:"移动到最后一帧"},"⏭"),T("button",{class:ot(["tl-btn",{on:ke(e).timeline.loop}]),onClick:j[5]||(j[5]=le=>ke(e).toggleLoop()),title:"循环"},"⟳",2),T("label",g4,[j[10]||(j[10]=T("span",null,"A",-1)),be(T("input",{"onUpdate:modelValue":j[6]||(j[6]=le=>A.value=le),type:"number",min:"0",max:Math.max(0,ke(e).timeline.playbackEnd-1),"aria-label":"播放起始帧",onChange:k,onKeydown:Ta(xt(k,["prevent"]),["enter"])},null,40,v4),[[ut,A.value]])]),T("label",y4,[j[11]||(j[11]=T("span",null,"B",-1)),be(T("input",{"onUpdate:modelValue":j[7]||(j[7]=le=>M.value=le),type:"number",min:ke(e).timeline.playbackStart+1,max:Math.max(1,ke(e).timeline.totalFrames-1),"aria-label":"播放结束帧",onChange:B,onKeydown:Ta(xt(B,["prevent"]),["enter"])},null,40,x4),[[ut,M.value]])]),h.value?(ie(),oe("button",{key:0,class:"tl-loop-range",title:`设为闭合自循环范围 ${h.value.start}–${h.value.end}f`,onClick:D},"循环段",8,b4)):Xe("",!0),T("span",w4,[j[12]||(j[12]=ri("帧 ",-1)),T("b",null,je(ke(e).timeline.frame),1),j[13]||(j[13]=ri(" / ",-1)),T("b",null,je(Math.max(0,ke(e).timeline.totalFrames-1)),1)]),j[18]||(j[18]=T("span",{class:"tl-legend"},[T("i",{class:"legend-emission"}),ri("持续发射 "),T("i",{class:"legend-life"}),ri("粒子存在 "),T("i",{class:"legend-spine"}),ri("Spine 动画")],-1)),T("div",{ref_key:"animationMenuRef",ref:i,class:"tl-anim tl-owner-animation"},[j[16]||(j[16]=T("span",null,"所属动画",-1)),T("button",{class:"tl-animation-trigger",disabled:!o.value,title:"设置当前粒子系统所属的动画",onClick:xt(l,["stop"])},[T("span",null,je(((te=o.value)==null?void 0:te.animation)||ke(e).timeline.animation),1),j[14]||(j[14]=T("i",null,"⌄",-1))],8,S4),n.value?(ie(),oe("div",{key:0,class:"tl-animation-menu",onPointerdown:j[9]||(j[9]=xt(()=>{},["stop"]))},[j[15]||(j[15]=T("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(ie(!0),oe(Ke,null,li(ke(e).timeline.animations,le=>{var ye,ae;return ie(),oe("button",{key:le,class:ot(["tl-animation-option",{on:((ye=o.value)==null?void 0:ye.animation)===le}]),onClick:Le=>c(le)},[T("span",null,je(le),1),((ae=o.value)==null?void 0:ae.animation)===le?(ie(),oe("i",M4,"✓")):Xe("",!0)],10,_4)}),128)),T("div",T4,[be(T("input",{"onUpdate:modelValue":j[8]||(j[8]=le=>r.value=le),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:Ta(d,["enter"])},null,544),[[ut,r.value]]),T("button",{title:"重命名当前动画",onClick:d},"重命名")]),a.value?(ie(),oe("div",A4,je(a.value),1)):Xe("",!0),T("div",E4,[T("button",{onClick:u},"+ 新增"),T("button",{disabled:ke(e).timeline.animations.length<=1,onClick:f},"删除",8,C4)]),ke(e).timeline.animations.length<=1?(ie(),oe("div",I4,"至少需要保留一个动画")):Xe("",!0)],32)):Xe("",!0)],512),T("label",R4,[j[17]||(j[17]=ri("Spine 预览动画 ",-1)),T("select",{class:"tl-sel",value:((he=F.value)==null?void 0:he.selectedAnimation)||"",disabled:!F.value,onChange:I},[T("option",k4,je(F.value?"无":"无可用 Spine 动画"),1),(ie(!0),oe(Ke,null,li(((ve=F.value)==null?void 0:ve.animations)||[],le=>(ie(),oe("option",{key:le.name,value:le.name},je(le.name)+"("+je(le.duration.toFixed(2))+"s) ",9,F4))),128))],40,P4)]),T("span",O4,je(R.value),1)]),T("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:xt(Ee,["prevent"]),onPointerdown:ge},[T("div",B4,[(ie(!0),oe(Ke,null,li(L.value,le=>(ie(),oe("div",{key:le.f,class:"tl-tickline",style:Li({left:le.px+"px"})},[T("span",L4,je(le.f)+"f",1)],4))),128))]),T("div",{class:"tl-playhead",style:Li({left:N.value+"px"})},null,4),T("div",D4,[(ie(!0),oe(Ke,null,li(ke(e).systems,(le,ye)=>(ie(),oe("div",{key:le.id,class:"tl-lane"},[j[19]||(j[19]=T("span",{class:"lane-ico"},"●",-1)),T("div",{class:"lane-bar",style:Li({left:O(le)+"px",width:E(le)+"px"}),onPointerdown:xt(ae=>Te(ae,le),["stop"])},[T("span",U4,je(le.config.name||"系统 "+(ye+1)),1),T("span",{class:ot(["bar-life",{"loop-life":W(le)}]),style:Li({width:q(le)+"px"})},null,6),W(le)?(ie(),oe(Ke,{key:0},[J(le)?(ie(),oe("span",{key:0,class:"bar-loop-transition bar-loop-start",style:Li({width:J(le)+"px"})},null,4)):Xe("",!0),T("span",{class:"bar-emission bar-loop",style:Li({left:J(le)+"px",width:V(le)+"px"})},[T("span",{class:"bar-handle",title:"拖动循环段时长",onPointerdown:xt(ae=>G(ae,le),["stop"])},null,40,X4)],4),K(le)?(ie(),oe("span",{key:1,class:"bar-loop-transition bar-loop-end",style:Li({left:J(le)+V(le)+"px",width:K(le)+"px"})},null,4)):Xe("",!0)],64)):le.config.mode==="stream"?(ie(),oe("span",{key:1,class:"bar-emission",style:Li({width:V(le)+"px"})},[T("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:xt(ae=>G(ae,le),["stop"])},null,40,V4)],4)):Xe("",!0)],44,N4)]))),128)),(ie(!0),oe(Ke,null,li(P.value,le=>(ie(),oe("div",{key:`spine-${le.id}`,class:"tl-lane spine-lane"},[j[20]||(j[20]=T("span",{class:"lane-ico spine-ico"},"◆",-1)),T("div",{class:"spine-bar",style:Li({left:me(le)+"px",width:we(le)+"px"}),title:"拖动调整动画开始时间",onPointerdown:xt(ye=>Z(ye,le),["stop"])},[T("span",$4,je(le.name)+" · "+je(le.selectedAnimation),1)],44,Y4)]))),128)),!ke(e).systems.length&&!P.value.length?(ie(),oe("div",G4,"暂无可显示的动画数据")):Xe("",!0)])],544)])}}}),j4=an(H4,[["__scopeId","data-v-8d9981a9"]]),W4={class:"transfer-heading"},z4={key:0},q4={class:"transfer-detail"},K4=nn({__name:"TransferProgressOverlay",setup(s){const e=ht(null);return ds(()=>xi.visible,async t=>{var i;t&&(await lu(),(i=e.value)==null||i.focus({preventScroll:!0}))},{flush:"post"}),(t,i)=>(ie(),Qt(kM,{name:"transfer-fade"},{default:ah(()=>[ke(xi).visible?(ie(),oe("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]=xt(()=>{},["stop","prevent"])),onPointerup:i[1]||(i[1]=xt(()=>{},["stop","prevent"])),onClick:i[2]||(i[2]=xt(()=>{},["stop","prevent"])),onDblclick:i[3]||(i[3]=xt(()=>{},["stop","prevent"])),onContextmenu:i[4]||(i[4]=xt(()=>{},["stop","prevent"])),onWheel:i[5]||(i[5]=xt(()=>{},["stop","prevent"])),onKeydown:i[6]||(i[6]=xt(()=>{},["stop","prevent"]))},[T("div",{class:ot(["transfer-dialog",{failed:ke(xi).failed}])},[T("div",W4,[T("span",null,je(ke(xi).title),1),ke(xi).indeterminate?Xe("",!0):(ie(),oe("strong",z4,je(Math.round(ke(xi).progress))+"%",1))]),T("div",{class:ot(["transfer-track",{indeterminate:ke(xi).indeterminate}])},[T("div",{class:"transfer-bar",style:Li(ke(xi).indeterminate?void 0:{width:`${ke(xi).progress}%`})},null,4)],2),T("div",q4,je(ke(xi).detail),1)],2)],544)):Xe("",!0)]),_:1}))}}),Z4=an(K4,[["__scopeId","data-v-592b922e"]]),J4=["inert","aria-hidden"],Q4={class:"right"},eU={class:"stage-area"},tU=nn({__name:"App",setup(s){const e=Kl();QI(e);const t=ht(360),i=ht(180);function n(a){a.preventDefault();const o=l=>{const c=e.settings.parameterPanelOnRight?window.innerWidth-l.clientX:l.clientX,u=Math.max(240,Math.min(c,window.innerWidth-200));t.value=u},h=()=>{window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",o),window.addEventListener("pointerup",h)}function r(a){a.preventDefault();const o=a.clientY,h=i.value,l=u=>{const d=Math.max(80,Math.min(h+(o-u.clientY),window.innerHeight-200));i.value=d},c=()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",c)}return(a,o)=>(ie(),oe(Ke,null,[T("div",{class:ot(["layout",{"panel-right":ke(e).settings.parameterPanelOnRight}]),inert:ke(xi).visible?!0:void 0,"aria-hidden":ke(xi).visible?"true":void 0},[T("div",{class:"parameter-panel",style:Li({width:t.value+"px"})},[Ue(d4)],4),T("div",{class:"resizer-col",onPointerdown:n},null,32),T("div",Q4,[T("div",eU,[Ue(Ik)]),T("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),T("div",{class:"timeline-area",style:Li({height:i.value+"px"})},[Ue(j4)],4)])],10,J4),Ue(Z4)],64))}}),iU=an(tU,[["__scopeId","data-v-42c4fa00"]]);aT(iU).use(cT()).mount("#app");export{fy as $,kn as A,Wh as B,Wt as C,ji as D,Ge as E,us as F,Dn as G,bt as H,Xt as I,vS as J,vs as K,Es as L,Us as M,qr as N,ku as O,Pn as P,Ll as Q,ko as R,qs as S,Q3 as T,lt as U,oy as V,Js as W,P8 as X,KO as Y,Vl as Z,Mp as _,pt as a,Lm as a$,dy as a0,Kw as a1,Op as a2,I8 as a3,$h as a4,bl as a5,cO as a6,wl as a7,Fu as a8,km as a9,Gm as aA,Hm as aB,Nc as aC,kr as aD,Qc as aE,Fm as aF,eS as aG,mi as aH,Ww as aI,w8 as aJ,Ao as aK,uy as aL,Ve as aM,it as aN,Bm as aO,eh as aP,nS as aQ,Om as aR,iS as aS,sS as aT,Ou as aU,oS as aV,th as aW,hS as aX,rS as aY,lS as aZ,uS as a_,Va as aa,Bp as ab,Lp as ac,cy as ad,Ql as ae,ec as af,Jl as ag,Xa as ah,rr as ai,_8 as aj,Qw as ak,lO as al,Oo as am,Hr as an,Up as ao,gS as ap,aO as aq,Xl as ar,gs as as,hy as at,A8 as au,Uo as av,$m as aw,jm as ax,Wm as ay,zm as az,Ro as b,vr as b$,jh as b0,aS as b1,Jr as b2,cS as b3,Dp as b4,J3 as b5,mS as b6,pS as b7,Np as b8,Ln as b9,dS as bA,Xp as bB,Pu as bC,yS as bD,Dm as bE,Pi as bF,K3 as bG,tO as bH,Lw as bI,Bw as bJ,M8 as bK,ii as bL,Xo as bM,xS as bN,SS as bO,_S as bP,MS as bQ,bS as bR,wS as bS,rO as bT,Vp as bU,Gt as bV,Ym as bW,tS as bX,Nw as bY,Uw as bZ,Xw as b_,Z3 as ba,S8 as bb,yt as bc,Jw as bd,Zw as be,zw as bf,qw as bg,Ra as bh,Gh as bi,oO as bj,Vw as bk,Yw as bl,cs as bm,$w as bn,Fo as bo,Gi as bp,Dw as bq,Hh as br,Gw as bs,Hw as bt,jw as bu,my as bv,Xm as bw,ya as bx,fS as by,Um as bz,Po as c,T8 as c0,sO as c1,nO as c2,iO as c3,dt as d,et as e,E8 as f,vt as g,Ni as h,_h as i,xs as j,ai as k,Qe as l,tn as m,oi as n,vp as o,wi as p,Dl as q,Ir as r,We as s,ob as t,_p as u,Ch as v,Nm as w,ga as x,ly as y,Vm as z}; diff --git a/dist/assets/index-RonkRpMh.css b/dist/assets/index-CheycJh3.css similarity index 71% rename from dist/assets/index-RonkRpMh.css rename to dist/assets/index-CheycJh3.css index 1ac43ac..3adb8a9 100644 --- a/dist/assets/index-RonkRpMh.css +++ b/dist/assets/index-CheycJh3.css @@ -1 +1 @@ -.stage-wrap[data-v-94c32e62]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-94c32e62]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-94c32e62]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-94c32e62]:active{cursor:grabbing}.topbar[data-v-94c32e62]{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-94c32e62]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-94c32e62]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-94c32e62]{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-94c32e62]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-94c32e62]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-94c32e62]{position:relative;flex:0 0 auto}.background-btn[data-v-94c32e62]{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-94c32e62]:hover,.background-btn.on[data-v-94c32e62]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-94c32e62]{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-94c32e62]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-94c32e62]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-94c32e62]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-94c32e62]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-94c32e62]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-94c32e62]{display:none}.background-file-name[data-v-94c32e62]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-94c32e62]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-94c32e62]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-94c32e62]{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-94c32e62]{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-94c32e62]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-94c32e62]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.help-btn[data-v-94c32e62]{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-94c32e62]:hover,.help-btn.on[data-v-94c32e62]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-94c32e62]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.help-overlay[data-v-94c32e62]{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-94c32e62]{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-94c32e62]{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-94c32e62]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-94c32e62]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-94c32e62]{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-94c32e62]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-94c32e62]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-94c32e62]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-94c32e62]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-94c32e62]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-94c32e62]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-94c32e62]{color:#dce4f7}.help-grid[data-v-94c32e62]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-94c32e62]{display:grid;gap:0;margin:0}.help-list>div[data-v-94c32e62]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-94c32e62]:last-child{border-bottom:0}.help-list dt[data-v-94c32e62]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-94c32e62]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-94c32e62]{display:grid;gap:7px}.shortcut-list>div[data-v-94c32e62]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-94c32e62]{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-94c32e62]{color:#65728b;font-size:10px}.shortcut-list em[data-v-94c32e62]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-94c32e62]{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-94c32e62]{margin-top:12px}.help-export p[data-v-94c32e62]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}@media(max-width:760px){.help-overlay[data-v-94c32e62]{padding:66px 12px 14px}.help-grid[data-v-94c32e62]{grid-template-columns:1fr}}.hud[data-v-94c32e62]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-94c32e62]{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-94c32e62]{width:3ch}.hud-particle-count[data-v-94c32e62]{width:7ch;text-align:left}.hud-tip[data-v-94c32e62]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-94c32e62]{color:#fc3}.settings-btn[data-v-94c32e62]{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-94c32e62]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-94c32e62]{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-94c32e62]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-94c32e62]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-94c32e62]{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-94c32e62]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-94c32e62]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-94c32e62]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-94c32e62]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-94c32e62]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-94c32e62]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-94c32e62]: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-94c32e62]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-94c32e62]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-94c32e62]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-94c32e62]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-94c32e62]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-94c32e62]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-94c32e62]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-94c32e62]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-94c32e62]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-94c32e62]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-94c32e62]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-94c32e62]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-94c32e62]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-94c32e62]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-94c32e62]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.sp-chk.disabled[data-v-94c32e62]{color:#5f687d;cursor:not-allowed}.sp-chk.disabled input[data-v-94c32e62]{cursor:not-allowed;opacity:.55}.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}.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}.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}.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-988d7abf]{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-988d7abf]{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-988d7abf]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-988d7abf]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-988d7abf]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-988d7abf]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-988d7abf]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.config-management-body[data-v-988d7abf]{padding-bottom:2px}.config-toolbar[data-v-988d7abf]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-988d7abf],.config-toolbar select[data-v-988d7abf]{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-988d7abf]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-988d7abf]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-988d7abf]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-988d7abf]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-988d7abf]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-988d7abf]{color:#e8959e}.empty[data-v-988d7abf],.panel-hint[data-v-988d7abf]{color:#667;font-size:12px;padding:8px 0}.group[data-v-988d7abf]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-988d7abf]{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-988d7abf]:hover{background:#20202e}.group-reset[data-v-988d7abf]{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-988d7abf]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-head[data-v-988d7abf]{padding-right:6px}.scene-actions[data-v-988d7abf]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-988d7abf]{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-988d7abf]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-988d7abf]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-988d7abf]{padding:8px 10px 12px}.caret[data-v-988d7abf]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-988d7abf]{height:1px;background:#2a2a3c;margin:8px 0}.tree[data-v-988d7abf]{margin-bottom:8px}.tree-item[data-v-988d7abf]{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-988d7abf]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-988d7abf]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-988d7abf]{color:#556}.tree-item .tdot.collision-dot[data-v-988d7abf]{color:#ff7070}.tree-item .tdot.path-dot[data-v-988d7abf]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-988d7abf]{color:#c08cff;font-size:11px}.tree-item .tlabel[data-v-988d7abf]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-988d7abf]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-988d7abf]{min-height:28px;cursor:pointer}.scene-object-item[data-v-988d7abf]:hover{background:#202b40}.scene-object-kind[data-v-988d7abf]{color:#75829c;font-size:10px}.scene-object-eye[data-v-988d7abf]{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-988d7abf]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-988d7abf]{color:#59647a}.scene-object-eye svg[data-v-988d7abf]{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-988d7abf]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-988d7abf]{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-988d7abf]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-988d7abf]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-988d7abf]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-988d7abf]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-988d7abf]{color:#5f6d86;line-height:1.5}.field-grid[data-v-988d7abf]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-988d7abf]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-988d7abf]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-988d7abf]{align-items:flex-start}.check-field input[data-v-988d7abf]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.follow-path[data-v-988d7abf],.setting-line[data-v-988d7abf]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-988d7abf]{justify-content:space-between}.follow-path input[data-v-988d7abf],.setting-line input[type=checkbox][data-v-988d7abf]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-988d7abf]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-988d7abf]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-988d7abf]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-988d7abf]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-988d7abf]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-988d7abf]{color:#aeb8cf}.path-help ul[data-v-988d7abf]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-988d7abf]{margin:3px 0}.path-action[data-v-988d7abf]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-988d7abf]:hover{filter:brightness(1.12)}.path-action.primary[data-v-988d7abf]{background:#f05408;color:#fff}.tag[data-v-988d7abf]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-988d7abf]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-988d7abf]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-988d7abf]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.pair[data-v-988d7abf]{display:flex;flex-direction:column;gap:2px;flex:1}.colr[data-v-988d7abf]{width:28px;height:22px;border:none;background:none;cursor:pointer}.segs[data-v-988d7abf]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-988d7abf]{margin-top:10px}.stream-loop-options[data-v-988d7abf]{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-988d7abf]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-988d7abf]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-988d7abf]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-988d7abf]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-988d7abf]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-988d7abf]:after{transform:translate(12px)}.loop-section-duration[data-v-988d7abf]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-988d7abf]{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-988d7abf]:focus{border-color:#716eff}.loop-auto-duration[data-v-988d7abf]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-988d7abf]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-988d7abf]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.mini-btn[data-v-988d7abf]{background:#2e3a55;border:1px solid #3a4a6a;color:#cdf;border-radius:5px;padding:3px 8px;font-size:11px;cursor:pointer}.mini-btn.danger[data-v-988d7abf]{background:#4a2a2e;color:#fbb}.placeholder[data-v-988d7abf]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-988d7abf]{padding-top:3px}.export-field[data-v-988d7abf]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-988d7abf]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-988d7abf]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-988d7abf]{margin-bottom:5px}.export-checkbox[data-v-988d7abf]{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-988d7abf]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-988d7abf]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-988d7abf]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-988d7abf]{font-weight:600}.export-switch-last[data-v-988d7abf]{margin-top:13px}.spine-export-actions[data-v-988d7abf]{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.export-spine-json[data-v-988d7abf]{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-988d7abf]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-988d7abf]:disabled{cursor:wait;opacity:.68}.export-spine-project[data-v-988d7abf]{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-988d7abf]{color:inherit;font-size:9px;font-weight:500;line-height:1.1}.export-spine-project[data-v-988d7abf]:hover:not(:disabled){border-color:#47c89f;background:#238267}.export-spine-project[data-v-988d7abf]:disabled{cursor:not-allowed;opacity:.48}.export-spine-images[data-v-988d7abf]{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-988d7abf]:hover:not(:disabled){border-color:#6099dc;background:#315581}.export-spine-images[data-v-988d7abf]:disabled{cursor:wait;opacity:.55}.connector-status[data-v-988d7abf]{display:flex;align-items:center;justify-content:center;gap:5px;padding-top:6px;color:#717b99;font-size:10px}.connector-status .connector-dot[data-v-988d7abf]{width:6px;height:6px;border-radius:50%;background:#66718f}.connector-status.ready[data-v-988d7abf]{color:#70d8ae}.connector-status.ready .connector-dot[data-v-988d7abf]{background:#49c993;box-shadow:0 0 5px #49c99388}.connector-status.warning[data-v-988d7abf]{color:#d4aa67}.connector-status.warning .connector-dot[data-v-988d7abf]{background:#d4aa67}.connector-status button[data-v-988d7abf]{padding:0 3px;border:0;background:transparent;color:#8290b6;font-size:10px;cursor:pointer}.connector-status button[data-v-988d7abf]:hover{color:#c5caff}.connector-status a[data-v-988d7abf]{padding:0 3px;color:#a8b0ff;font-size:10px;text-decoration:underline}.connector-status a[data-v-988d7abf]:hover{color:#d8dcff}.export-message[data-v-988d7abf]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-988d7abf]{color:#ff858f}.export-message a[data-v-988d7abf]{display:inline-block;margin-left:5px;color:#9da7ff;text-decoration:underline}.look-title[data-v-988d7abf]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-988d7abf]:first-child{margin-top:2px}.seg[data-v-988d7abf]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-988d7abf]{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-988d7abf]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-hint[data-v-988d7abf]{min-height:54px;border:1px dashed #2e2e44;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#556;font-size:11px;margin:6px 0}.curve-wrap[data-v-988d7abf]{margin:6px 0}.curve-labels[data-v-988d7abf]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-988d7abf]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-988d7abf]{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-988d7abf]:hover{background:#4542a8;color:#fff}.image-card[data-v-988d7abf]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-988d7abf]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-988d7abf]{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-988d7abf]:hover{border-color:#7774ff}.img-thumb img[data-v-988d7abf]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-988d7abf]{flex:1;min-width:0}.img-actions[data-v-988d7abf]{display:flex;flex-direction:column;gap:4px}.mini-btn2[data-v-988d7abf]{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-988d7abf]:hover{background:#2b3a5c}.mini-btn2[data-v-988d7abf]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-988d7abf]{color:#667;font-size:11px;margin:4px 0 2px}.resource-divider[data-v-988d7abf]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-988d7abf]{max-width:88px}.resource-color-picker .hex[data-v-988d7abf]{margin-left:0}.random-color-hint[data-v-988d7abf]{margin:-5px 0 9px 68px;color:#66758e;font-size:9px;line-height:1.45}.hex-input[data-v-988d7abf]{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-988d7abf]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-988d7abf]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-988d7abf]{display:flex;gap:3px}.alpha-modes button[data-v-988d7abf]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-988d7abf]:hover{background:#273246}.alpha-modes button.on[data-v-988d7abf]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-988d7abf]{margin-top:7px}.resource-weight-row[data-v-988d7abf]{display:flex;align-items:center;gap:5px}.resource-weight-control[data-v-988d7abf]{flex:1;min-width:0}.weight-lock[data-v-988d7abf]{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-988d7abf]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-988d7abf]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-988d7abf]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-988d7abf]:disabled{opacity:.35;cursor:not-allowed}.file-input[data-v-988d7abf]{display:none}.hex[data-v-988d7abf]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-988d7abf]{width:46px;flex:0 0 46px;text-align:center}.attr-body[data-v-988d7abf]{padding:10px;background:#151b27}.attr-section-title[data-v-988d7abf]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-988d7abf]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-988d7abf]{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-988d7abf]{display:flex;gap:4px}.axis-mode[data-v-988d7abf]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-988d7abf]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-988d7abf]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-988d7abf]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-988d7abf]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-988d7abf]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-988d7abf]: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-988d7abf]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-988d7abf]:after{transform:translate(14px)}.life-axis[data-v-988d7abf]{margin:9px 0 2px 42px}.seed-row[data-v-988d7abf]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-988d7abf]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-988d7abf]{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-988d7abf]:focus{border-color:#625ff1}.seed-random[data-v-988d7abf]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-988d7abf]:hover{background:#394964}.scene-seed[data-v-988d7abf]{margin-top:10px}.seed-hint[data-v-988d7abf]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.modifier-item[data-v-988d7abf]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.modifier-switch[data-v-988d7abf]{font-weight:600}.modifier-params[data-v-988d7abf]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-988d7abf]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-988d7abf]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-988d7abf]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-988d7abf]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-988d7abf]{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-988d7abf]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-988d7abf]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-988d7abf]{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-988d7abf]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-988d7abf]{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-988d7abf]:hover,.collision-filter-add.active[data-v-988d7abf]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-988d7abf]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-988d7abf]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-988d7abf]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-988d7abf]{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-988d7abf]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-988d7abf]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-988d7abf]{flex:none;color:#68758d;font-size:9px}.stream-loop-hint[data-v-988d7abf]{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-988d7abf]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-988d7abf]{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-988d7abf]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-988d7abf]{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-988d7abf]{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-988d7abf]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-988d7abf]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-988d7abf]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-988d7abf]{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-988d7abf]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-988d7abf]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-988d7abf] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-988d7abf]{padding-right:2px}.trail-section-title[data-v-988d7abf]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-resource-row[data-v-988d7abf]{display:flex;align-items:stretch;gap:8px;margin-bottom:10px;padding:8px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.trail-thumb[data-v-988d7abf]{width:58px;min-height:58px;padding:3px;flex:0 0 58px;border:1px solid #3a4963;border-radius:6px;background:#101725;cursor:pointer;overflow:hidden}.trail-thumb[data-v-988d7abf]:hover{border-color:#7774ff}.trail-thumb img[data-v-988d7abf]{display:block;width:100%;height:100%;object-fit:contain}.trail-resource-fields[data-v-988d7abf]{display:flex;min-width:0;flex:1;flex-direction:column;gap:7px}.trail-color-row[data-v-988d7abf]{display:flex;align-items:center;gap:5px;color:#8a93bb;font-size:11px}.trail-color-row>span[data-v-988d7abf]{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trail-color-row .hex-input[data-v-988d7abf],.trail-fixed-color .hex-input[data-v-988d7abf]{min-width:0;flex:1}.trail-mode-head[data-v-988d7abf]{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-988d7abf]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-988d7abf]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-988d7abf] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-988d7abf] .ns-label{width:100%}.trail-grid-row[data-v-988d7abf] .ns-range{min-width:0}.trail-grid-row[data-v-988d7abf] .ns-num{width:42px}.trail-params[data-v-988d7abf] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.timeline[data-v-8d9981a9]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-8d9981a9]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-8d9981a9]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.tl-btn.on[data-v-8d9981a9]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-range[data-v-8d9981a9]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-8d9981a9]{width:43px;height:25px;padding:0 5px;box-sizing:border-box;border:1px solid #3a3a51;border-radius:5px;outline:none;background:#181824;color:#e1e4ed;font-size:11px;text-align:center}.tl-range input[data-v-8d9981a9]:focus{border-color:#716eff}.tl-loop-range[data-v-8d9981a9]{height:25px;padding:0 7px;border:1px solid #4e5680;border-radius:5px;background:#252943;color:#bfc8e8;font-size:10px;cursor:pointer;white-space:nowrap}.tl-loop-range[data-v-8d9981a9]:hover{border-color:#716eff;color:#fff}.tl-frame[data-v-8d9981a9]{display:inline-block;flex:0 0 92px;width:92px;box-sizing:border-box;font-size:12px;color:#aab;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}.tl-frame b[data-v-8d9981a9]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-8d9981a9]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-8d9981a9]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-8d9981a9]{margin-left:4px;background:#2f8b62}.legend-life[data-v-8d9981a9]{margin-left:5px;background:#a54551}.legend-spine[data-v-8d9981a9]{margin-left:5px;background:#7448b8}.tl-anim[data-v-8d9981a9]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-8d9981a9]{position:relative}.tl-animation-trigger[data-v-8d9981a9]{display:flex;align-items:center;justify-content:space-between;gap:8px;width:116px;height:25px;padding:0 7px;overflow:hidden;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;cursor:pointer}.tl-animation-trigger>span[data-v-8d9981a9]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-8d9981a9]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-8d9981a9]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-8d9981a9]{position:absolute;z-index:30;right:0;bottom:calc(100% + 6px);width:226px;padding:7px;border:1px solid #3c4760;border-radius:8px;background:#171b29;box-shadow:0 10px 24px #00000073}.tl-animation-menu-title[data-v-8d9981a9]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-8d9981a9]{display:flex;align-items:center;justify-content:space-between;width:100%;height:27px;padding:0 7px;border:0;border-radius:5px;background:transparent;color:#b8c1d5;text-align:left;cursor:pointer}.tl-animation-option>span[data-v-8d9981a9]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-8d9981a9]:hover{background:#252e42}.tl-animation-option.on[data-v-8d9981a9]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-8d9981a9]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-8d9981a9]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:7px;padding-top:7px;border-top:1px solid #2b3346}.tl-animation-name[data-v-8d9981a9]{min-width:0;height:27px;padding:0 7px;box-sizing:border-box;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2;outline:none}.tl-animation-name[data-v-8d9981a9]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-8d9981a9],.tl-animation-actions button[data-v-8d9981a9]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-8d9981a9]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-8d9981a9]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-8d9981a9]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-8d9981a9]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-8d9981a9]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-8d9981a9]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-8d9981a9]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-8d9981a9]{max-width:190px}.tl-zoom[data-v-8d9981a9]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-8d9981a9]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-8d9981a9]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-8d9981a9]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-8d9981a9]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-8d9981a9]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-8d9981a9]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-8d9981a9]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-8d9981a9]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-bar[data-v-8d9981a9]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-8d9981a9]:active{cursor:grabbing}.lane-name[data-v-8d9981a9]{position:absolute;left:14px;right:5px;top:2px;z-index:2;pointer-events:none;font-size:11px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-life[data-v-8d9981a9]{position:absolute;inset:0 auto 0 0;z-index:0;min-width:1px;border:1px solid #c05a66;border-radius:5px;background:#a54551;box-sizing:border-box}.bar-life.loop-life[data-v-8d9981a9]{border-color:#667085;background:#242b39}.bar-emission[data-v-8d9981a9]{position:absolute;inset:0 auto 0 0;z-index:1;min-width:1px;border:1px solid #45a97d;border-radius:5px 0 0 5px;background:#2f8b62;box-sizing:border-box}.bar-emission.bar-loop[data-v-8d9981a9]{border-radius:0}.bar-loop-transition[data-v-8d9981a9]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-8d9981a9]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-8d9981a9]{border-radius:0 5px 5px 0}.bar-handle[data-v-8d9981a9]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-8d9981a9]:hover{background:#ffffff59}.spine-ico[data-v-8d9981a9]{color:#c08cff}.spine-bar[data-v-8d9981a9]{position:absolute;top:4px;height:18px;min-width:1px;box-sizing:border-box;border:1px solid #a575ed;border-radius:5px;background:#7448b8;cursor:grab;box-shadow:inset 0 0 0 1px #ffffff0d}.spine-bar[data-v-8d9981a9]:active{cursor:grabbing}.tl-empty[data-v-8d9981a9]{color:#667;font-size:11px;padding:8px}.transfer-overlay[data-v-592b922e]{position:fixed;z-index:2000;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:auto;cursor:wait;overscroll-behavior:contain;background:#05080f42;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.transfer-dialog[data-v-592b922e]{width:min(420px,calc(100vw - 40px));padding:18px 20px 16px;border:1px solid #414b66;border-radius:10px;box-shadow:0 18px 55px #00000075;background:#171d2b;color:#e7ebf5}.transfer-heading[data-v-592b922e]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;font-size:14px;font-weight:700}.transfer-heading strong[data-v-592b922e]{color:#a8a6ff;font-size:12px;font-variant-numeric:tabular-nums}.transfer-track[data-v-592b922e]{height:9px;overflow:hidden;border:1px solid #35415a;border-radius:999px;background:#0d1422}.transfer-bar[data-v-592b922e]{height:100%;border-radius:inherit;background:linear-gradient(90deg,#4d75e8,#7774ff);transition:width .16s ease}.transfer-track.indeterminate .transfer-bar[data-v-592b922e]{width:42%;animation:transfer-slide-592b922e 1s ease-in-out infinite}.transfer-detail[data-v-592b922e]{min-height:17px;margin-top:9px;color:#8895ae;font-size:11px;line-height:1.5}.transfer-dialog.failed[data-v-592b922e]{border-color:#754351}.transfer-dialog.failed .transfer-heading strong[data-v-592b922e],.transfer-dialog.failed .transfer-detail[data-v-592b922e]{color:#e99aa9}.transfer-dialog.failed .transfer-bar[data-v-592b922e]{background:#c85d70}.transfer-fade-enter-active[data-v-592b922e],.transfer-fade-leave-active[data-v-592b922e]{transition:opacity .16s ease}.transfer-fade-enter-from[data-v-592b922e],.transfer-fade-leave-to[data-v-592b922e]{opacity:0}@keyframes transfer-slide-592b922e{0%{transform:translate(-110%)}to{transform:translate(250%)}}.layout[data-v-42c4fa00]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-42c4fa00]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-42c4fa00]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-42c4fa00]:hover{background:#3a5a8c}.right[data-v-42c4fa00]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-42c4fa00]{order:1}.panel-right .resizer-col[data-v-42c4fa00]{order:2}.panel-right .parameter-panel[data-v-42c4fa00]{order:3}.stage-area[data-v-42c4fa00]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-42c4fa00]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-42c4fa00]:hover{background:#3a5a8c}.timeline-area[data-v-42c4fa00]{position:relative;z-index:10;flex-shrink:0;overflow:visible}html,body{width:100%;height:100%;margin:0;padding:0;overflow:clip;overscroll-behavior:none;background:#0b0b12;color:#e8e8f0;font-family:system-ui,-apple-system,Segoe UI,sans-serif}body{position:fixed;top:0;right:0;bottom:0;left:0}*{box-sizing:border-box}#app{position:fixed;top:0;right:0;bottom:0;left:0;width:auto;height:auto;overflow:clip}input[type=number]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none} +.stage-wrap[data-v-94c32e62]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-94c32e62]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-94c32e62]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-94c32e62]:active{cursor:grabbing}.topbar[data-v-94c32e62]{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-94c32e62]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-94c32e62]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-94c32e62]{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-94c32e62]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-94c32e62]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-94c32e62]{position:relative;flex:0 0 auto}.background-btn[data-v-94c32e62]{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-94c32e62]:hover,.background-btn.on[data-v-94c32e62]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-94c32e62]{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-94c32e62]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-94c32e62]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-94c32e62]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-94c32e62]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-94c32e62]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-94c32e62]{display:none}.background-file-name[data-v-94c32e62]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-94c32e62]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-94c32e62]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-94c32e62]{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-94c32e62]{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-94c32e62]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-94c32e62]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.help-btn[data-v-94c32e62]{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-94c32e62]:hover,.help-btn.on[data-v-94c32e62]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-94c32e62]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.help-overlay[data-v-94c32e62]{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-94c32e62]{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-94c32e62]{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-94c32e62]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-94c32e62]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-94c32e62]{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-94c32e62]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-94c32e62]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-94c32e62]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-94c32e62]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-94c32e62]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-94c32e62]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-94c32e62]{color:#dce4f7}.help-grid[data-v-94c32e62]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-94c32e62]{display:grid;gap:0;margin:0}.help-list>div[data-v-94c32e62]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-94c32e62]:last-child{border-bottom:0}.help-list dt[data-v-94c32e62]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-94c32e62]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-94c32e62]{display:grid;gap:7px}.shortcut-list>div[data-v-94c32e62]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-94c32e62]{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-94c32e62]{color:#65728b;font-size:10px}.shortcut-list em[data-v-94c32e62]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-94c32e62]{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-94c32e62]{margin-top:12px}.help-export p[data-v-94c32e62]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}@media(max-width:760px){.help-overlay[data-v-94c32e62]{padding:66px 12px 14px}.help-grid[data-v-94c32e62]{grid-template-columns:1fr}}.hud[data-v-94c32e62]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-94c32e62]{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-94c32e62]{width:3ch}.hud-particle-count[data-v-94c32e62]{width:7ch;text-align:left}.hud-tip[data-v-94c32e62]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-94c32e62]{color:#fc3}.settings-btn[data-v-94c32e62]{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-94c32e62]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-94c32e62]{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-94c32e62]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-94c32e62]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-94c32e62]{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-94c32e62]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-94c32e62]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-94c32e62]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-94c32e62]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-94c32e62]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-94c32e62]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-94c32e62]: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-94c32e62]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-94c32e62]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-94c32e62]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-94c32e62]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-94c32e62]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-94c32e62]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-94c32e62]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-94c32e62]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-94c32e62]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-94c32e62]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-94c32e62]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-94c32e62]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-94c32e62]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-94c32e62]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-94c32e62]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.sp-chk.disabled[data-v-94c32e62]{color:#5f687d;cursor:not-allowed}.sp-chk.disabled input[data-v-94c32e62]{cursor:not-allowed;opacity:.55}.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}.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}.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}.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-1ace5c57]{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-1ace5c57]{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-1ace5c57]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-1ace5c57]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-1ace5c57]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-1ace5c57]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-1ace5c57]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.config-management-body[data-v-1ace5c57]{padding-bottom:2px}.config-toolbar[data-v-1ace5c57]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-1ace5c57],.config-toolbar select[data-v-1ace5c57]{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-1ace5c57]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-1ace5c57]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-1ace5c57]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-1ace5c57]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-1ace5c57]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-1ace5c57]{color:#e8959e}.empty[data-v-1ace5c57],.panel-hint[data-v-1ace5c57]{color:#667;font-size:12px;padding:8px 0}.group[data-v-1ace5c57]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-1ace5c57]{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-1ace5c57]:hover{background:#20202e}.group-reset[data-v-1ace5c57]{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-1ace5c57]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-head[data-v-1ace5c57]{padding-right:6px}.scene-actions[data-v-1ace5c57]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-1ace5c57]{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-1ace5c57]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-1ace5c57]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-1ace5c57]{padding:8px 10px 12px}.caret[data-v-1ace5c57]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-1ace5c57]{height:1px;background:#2a2a3c;margin:8px 0}.tree[data-v-1ace5c57]{margin-bottom:8px}.tree-item[data-v-1ace5c57]{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-1ace5c57]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-1ace5c57]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-1ace5c57]{color:#556}.tree-item .tdot.collision-dot[data-v-1ace5c57]{color:#ff7070}.tree-item .tdot.path-dot[data-v-1ace5c57]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-1ace5c57]{color:#c08cff;font-size:11px}.tree-item .tlabel[data-v-1ace5c57]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-1ace5c57]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-1ace5c57]{min-height:28px;cursor:pointer}.scene-object-item[data-v-1ace5c57]:hover{background:#202b40}.scene-object-kind[data-v-1ace5c57]{color:#75829c;font-size:10px}.scene-object-eye[data-v-1ace5c57]{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-1ace5c57]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-1ace5c57]{color:#59647a}.scene-object-eye svg[data-v-1ace5c57]{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-1ace5c57]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-1ace5c57]{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-1ace5c57]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-1ace5c57]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-1ace5c57]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-1ace5c57]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-1ace5c57]{color:#5f6d86;line-height:1.5}.field-grid[data-v-1ace5c57]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-1ace5c57]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-1ace5c57]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-1ace5c57]{align-items:flex-start}.check-field input[data-v-1ace5c57]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.follow-path[data-v-1ace5c57],.setting-line[data-v-1ace5c57]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-1ace5c57]{justify-content:space-between}.follow-path input[data-v-1ace5c57],.setting-line input[type=checkbox][data-v-1ace5c57]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-1ace5c57]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-1ace5c57]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-1ace5c57]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-1ace5c57]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-1ace5c57]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-1ace5c57]{color:#aeb8cf}.path-help ul[data-v-1ace5c57]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-1ace5c57]{margin:3px 0}.path-action[data-v-1ace5c57]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-1ace5c57]:hover{filter:brightness(1.12)}.path-action.primary[data-v-1ace5c57]{background:#f05408;color:#fff}.tag[data-v-1ace5c57]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-1ace5c57]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-1ace5c57]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-1ace5c57]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.pair[data-v-1ace5c57]{display:flex;flex-direction:column;gap:2px;flex:1}.colr[data-v-1ace5c57]{width:28px;height:22px;border:none;background:none;cursor:pointer}.segs[data-v-1ace5c57]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-1ace5c57]{margin-top:10px}.stream-loop-options[data-v-1ace5c57]{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-1ace5c57]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-1ace5c57]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-1ace5c57]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-1ace5c57]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-1ace5c57]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-1ace5c57]:after{transform:translate(12px)}.loop-section-duration[data-v-1ace5c57]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-1ace5c57]{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-1ace5c57]:focus{border-color:#716eff}.loop-auto-duration[data-v-1ace5c57]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-1ace5c57]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-1ace5c57]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.mini-btn[data-v-1ace5c57]{background:#2e3a55;border:1px solid #3a4a6a;color:#cdf;border-radius:5px;padding:3px 8px;font-size:11px;cursor:pointer}.mini-btn.danger[data-v-1ace5c57]{background:#4a2a2e;color:#fbb}.placeholder[data-v-1ace5c57]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-1ace5c57]{padding-top:3px}.export-field[data-v-1ace5c57]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-1ace5c57]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-1ace5c57]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-1ace5c57]{margin-bottom:5px}.export-checkbox[data-v-1ace5c57]{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-1ace5c57]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-1ace5c57]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-1ace5c57]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-1ace5c57]{font-weight:600}.export-switch-last[data-v-1ace5c57]{margin-top:13px}.spine-export-actions[data-v-1ace5c57]{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.export-spine-json[data-v-1ace5c57]{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-1ace5c57]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-1ace5c57]:disabled{cursor:wait;opacity:.68}.export-spine-project[data-v-1ace5c57]{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-1ace5c57]{color:inherit;font-size:9px;font-weight:500;line-height:1.1}.export-spine-project[data-v-1ace5c57]:hover:not(:disabled){border-color:#47c89f;background:#238267}.export-spine-project[data-v-1ace5c57]:disabled{cursor:not-allowed;opacity:.48}.export-spine-images[data-v-1ace5c57]{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-1ace5c57]:hover:not(:disabled){border-color:#6099dc;background:#315581}.export-spine-images[data-v-1ace5c57]:disabled{cursor:wait;opacity:.55}.connector-status[data-v-1ace5c57]{display:flex;align-items:center;justify-content:center;gap:5px;padding-top:6px;color:#717b99;font-size:10px}.connector-status .connector-dot[data-v-1ace5c57]{width:6px;height:6px;border-radius:50%;background:#66718f}.connector-status.ready[data-v-1ace5c57]{color:#70d8ae}.connector-status.ready .connector-dot[data-v-1ace5c57]{background:#49c993;box-shadow:0 0 5px #49c99388}.connector-status.warning[data-v-1ace5c57]{color:#d4aa67}.connector-status.warning .connector-dot[data-v-1ace5c57]{background:#d4aa67}.connector-status button[data-v-1ace5c57]{padding:0 3px;border:0;background:transparent;color:#8290b6;font-size:10px;cursor:pointer}.connector-status button[data-v-1ace5c57]:hover{color:#c5caff}.connector-status a[data-v-1ace5c57]{padding:0 3px;color:#a8b0ff;font-size:10px;text-decoration:underline}.connector-status a[data-v-1ace5c57]:hover{color:#d8dcff}.export-message[data-v-1ace5c57]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-1ace5c57]{color:#ff858f}.export-message a[data-v-1ace5c57]{display:inline-block;margin-left:5px;color:#9da7ff;text-decoration:underline}.look-title[data-v-1ace5c57]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-1ace5c57]:first-child{margin-top:2px}.seg[data-v-1ace5c57]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-1ace5c57]{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-1ace5c57]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-hint[data-v-1ace5c57]{min-height:54px;border:1px dashed #2e2e44;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#556;font-size:11px;margin:6px 0}.curve-wrap[data-v-1ace5c57]{margin:6px 0}.curve-labels[data-v-1ace5c57]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-1ace5c57]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-1ace5c57]{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-1ace5c57]:hover{background:#4542a8;color:#fff}.image-card[data-v-1ace5c57]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-1ace5c57]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-1ace5c57]{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-1ace5c57]:hover{border-color:#7774ff}.img-thumb img[data-v-1ace5c57]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-1ace5c57]{flex:1;min-width:0}.img-actions[data-v-1ace5c57]{display:flex;flex-direction:column;gap:4px}.mini-btn2[data-v-1ace5c57]{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-1ace5c57]:hover{background:#2b3a5c}.mini-btn2[data-v-1ace5c57]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-1ace5c57]{color:#667;font-size:11px;margin:4px 0 2px}.resource-divider[data-v-1ace5c57]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-1ace5c57]{max-width:88px}.resource-color-picker .hex[data-v-1ace5c57]{margin-left:0}.random-color-hint[data-v-1ace5c57]{margin:-5px 0 9px 68px;color:#66758e;font-size:9px;line-height:1.45}.hex-input[data-v-1ace5c57]{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-1ace5c57]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-1ace5c57]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-1ace5c57]{display:flex;gap:3px}.alpha-modes button[data-v-1ace5c57]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-1ace5c57]:hover{background:#273246}.alpha-modes button.on[data-v-1ace5c57]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-1ace5c57]{margin-top:7px}.resource-weight-row[data-v-1ace5c57]{display:flex;align-items:center;gap:5px}.resource-weight-control[data-v-1ace5c57]{flex:1;min-width:0}.weight-lock[data-v-1ace5c57]{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-1ace5c57]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-1ace5c57]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-1ace5c57]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-1ace5c57]:disabled{opacity:.35;cursor:not-allowed}.file-input[data-v-1ace5c57]{display:none}.hex[data-v-1ace5c57]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-1ace5c57]{width:46px;flex:0 0 46px;text-align:center}.attr-body[data-v-1ace5c57]{padding:10px;background:#151b27}.attr-section-title[data-v-1ace5c57]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-1ace5c57]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-1ace5c57]{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-1ace5c57]{display:flex;gap:4px}.axis-mode[data-v-1ace5c57]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-1ace5c57]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-1ace5c57]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-1ace5c57]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-1ace5c57]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-1ace5c57]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-1ace5c57]: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-1ace5c57]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-1ace5c57]:after{transform:translate(14px)}.life-axis[data-v-1ace5c57]{margin:9px 0 2px 42px}.seed-row[data-v-1ace5c57]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-1ace5c57]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-1ace5c57]{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-1ace5c57]:focus{border-color:#625ff1}.seed-random[data-v-1ace5c57]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-1ace5c57]:hover{background:#394964}.scene-seed[data-v-1ace5c57]{margin-top:10px}.seed-hint[data-v-1ace5c57]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.modifier-item[data-v-1ace5c57]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.modifier-switch[data-v-1ace5c57]{font-weight:600}.modifier-params[data-v-1ace5c57]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-1ace5c57]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-1ace5c57]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-1ace5c57]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-1ace5c57]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-1ace5c57]{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-1ace5c57]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-1ace5c57]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-1ace5c57]{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-1ace5c57]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-1ace5c57]{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-1ace5c57]:hover,.collision-filter-add.active[data-v-1ace5c57]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-1ace5c57]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-1ace5c57]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-1ace5c57]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-1ace5c57]{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-1ace5c57]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-1ace5c57]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-1ace5c57]{flex:none;color:#68758d;font-size:9px}.stream-loop-hint[data-v-1ace5c57]{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-1ace5c57]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-1ace5c57]{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-1ace5c57]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-1ace5c57]{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-1ace5c57]{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-1ace5c57]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-1ace5c57]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-1ace5c57]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-1ace5c57]{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-1ace5c57]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-1ace5c57]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-1ace5c57] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-1ace5c57]{padding-right:2px}.trail-section-title[data-v-1ace5c57]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-resource-row[data-v-1ace5c57]{display:flex;align-items:stretch;gap:8px;margin-bottom:10px;padding:8px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.trail-thumb[data-v-1ace5c57]{width:58px;min-height:58px;padding:3px;flex:0 0 58px;border:1px solid #3a4963;border-radius:6px;background:#101725;cursor:pointer;overflow:hidden}.trail-thumb[data-v-1ace5c57]:hover{border-color:#7774ff}.trail-thumb img[data-v-1ace5c57]{display:block;width:100%;height:100%;object-fit:contain}.trail-resource-fields[data-v-1ace5c57]{display:flex;min-width:0;flex:1;flex-direction:column;gap:7px}.trail-color-row[data-v-1ace5c57]{display:flex;align-items:center;gap:5px;color:#8a93bb;font-size:11px}.trail-color-row>span[data-v-1ace5c57]{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trail-color-row .hex-input[data-v-1ace5c57],.trail-fixed-color .hex-input[data-v-1ace5c57]{min-width:0;flex:1}.trail-mode-head[data-v-1ace5c57]{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-1ace5c57]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-1ace5c57]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-1ace5c57] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-1ace5c57] .ns-label{width:100%}.trail-grid-row[data-v-1ace5c57] .ns-range{min-width:0}.trail-grid-row[data-v-1ace5c57] .ns-num{width:42px}.trail-params[data-v-1ace5c57] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.timeline[data-v-8d9981a9]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-8d9981a9]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-8d9981a9]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.tl-btn.on[data-v-8d9981a9]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-range[data-v-8d9981a9]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-8d9981a9]{width:43px;height:25px;padding:0 5px;box-sizing:border-box;border:1px solid #3a3a51;border-radius:5px;outline:none;background:#181824;color:#e1e4ed;font-size:11px;text-align:center}.tl-range input[data-v-8d9981a9]:focus{border-color:#716eff}.tl-loop-range[data-v-8d9981a9]{height:25px;padding:0 7px;border:1px solid #4e5680;border-radius:5px;background:#252943;color:#bfc8e8;font-size:10px;cursor:pointer;white-space:nowrap}.tl-loop-range[data-v-8d9981a9]:hover{border-color:#716eff;color:#fff}.tl-frame[data-v-8d9981a9]{display:inline-block;flex:0 0 92px;width:92px;box-sizing:border-box;font-size:12px;color:#aab;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}.tl-frame b[data-v-8d9981a9]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-8d9981a9]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-8d9981a9]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-8d9981a9]{margin-left:4px;background:#2f8b62}.legend-life[data-v-8d9981a9]{margin-left:5px;background:#a54551}.legend-spine[data-v-8d9981a9]{margin-left:5px;background:#7448b8}.tl-anim[data-v-8d9981a9]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-8d9981a9]{position:relative}.tl-animation-trigger[data-v-8d9981a9]{display:flex;align-items:center;justify-content:space-between;gap:8px;width:116px;height:25px;padding:0 7px;overflow:hidden;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;cursor:pointer}.tl-animation-trigger>span[data-v-8d9981a9]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-8d9981a9]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-8d9981a9]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-8d9981a9]{position:absolute;z-index:30;right:0;bottom:calc(100% + 6px);width:226px;padding:7px;border:1px solid #3c4760;border-radius:8px;background:#171b29;box-shadow:0 10px 24px #00000073}.tl-animation-menu-title[data-v-8d9981a9]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-8d9981a9]{display:flex;align-items:center;justify-content:space-between;width:100%;height:27px;padding:0 7px;border:0;border-radius:5px;background:transparent;color:#b8c1d5;text-align:left;cursor:pointer}.tl-animation-option>span[data-v-8d9981a9]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-8d9981a9]:hover{background:#252e42}.tl-animation-option.on[data-v-8d9981a9]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-8d9981a9]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-8d9981a9]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:7px;padding-top:7px;border-top:1px solid #2b3346}.tl-animation-name[data-v-8d9981a9]{min-width:0;height:27px;padding:0 7px;box-sizing:border-box;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2;outline:none}.tl-animation-name[data-v-8d9981a9]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-8d9981a9],.tl-animation-actions button[data-v-8d9981a9]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-8d9981a9]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-8d9981a9]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-8d9981a9]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-8d9981a9]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-8d9981a9]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-8d9981a9]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-8d9981a9]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-8d9981a9]{max-width:190px}.tl-zoom[data-v-8d9981a9]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-8d9981a9]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-8d9981a9]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-8d9981a9]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-8d9981a9]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-8d9981a9]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-8d9981a9]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-8d9981a9]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-8d9981a9]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-bar[data-v-8d9981a9]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-8d9981a9]:active{cursor:grabbing}.lane-name[data-v-8d9981a9]{position:absolute;left:14px;right:5px;top:2px;z-index:2;pointer-events:none;font-size:11px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-life[data-v-8d9981a9]{position:absolute;inset:0 auto 0 0;z-index:0;min-width:1px;border:1px solid #c05a66;border-radius:5px;background:#a54551;box-sizing:border-box}.bar-life.loop-life[data-v-8d9981a9]{border-color:#667085;background:#242b39}.bar-emission[data-v-8d9981a9]{position:absolute;inset:0 auto 0 0;z-index:1;min-width:1px;border:1px solid #45a97d;border-radius:5px 0 0 5px;background:#2f8b62;box-sizing:border-box}.bar-emission.bar-loop[data-v-8d9981a9]{border-radius:0}.bar-loop-transition[data-v-8d9981a9]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-8d9981a9]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-8d9981a9]{border-radius:0 5px 5px 0}.bar-handle[data-v-8d9981a9]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-8d9981a9]:hover{background:#ffffff59}.spine-ico[data-v-8d9981a9]{color:#c08cff}.spine-bar[data-v-8d9981a9]{position:absolute;top:4px;height:18px;min-width:1px;box-sizing:border-box;border:1px solid #a575ed;border-radius:5px;background:#7448b8;cursor:grab;box-shadow:inset 0 0 0 1px #ffffff0d}.spine-bar[data-v-8d9981a9]:active{cursor:grabbing}.tl-empty[data-v-8d9981a9]{color:#667;font-size:11px;padding:8px}.transfer-overlay[data-v-592b922e]{position:fixed;z-index:2000;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:auto;cursor:wait;overscroll-behavior:contain;background:#05080f42;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.transfer-dialog[data-v-592b922e]{width:min(420px,calc(100vw - 40px));padding:18px 20px 16px;border:1px solid #414b66;border-radius:10px;box-shadow:0 18px 55px #00000075;background:#171d2b;color:#e7ebf5}.transfer-heading[data-v-592b922e]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;font-size:14px;font-weight:700}.transfer-heading strong[data-v-592b922e]{color:#a8a6ff;font-size:12px;font-variant-numeric:tabular-nums}.transfer-track[data-v-592b922e]{height:9px;overflow:hidden;border:1px solid #35415a;border-radius:999px;background:#0d1422}.transfer-bar[data-v-592b922e]{height:100%;border-radius:inherit;background:linear-gradient(90deg,#4d75e8,#7774ff);transition:width .16s ease}.transfer-track.indeterminate .transfer-bar[data-v-592b922e]{width:42%;animation:transfer-slide-592b922e 1s ease-in-out infinite}.transfer-detail[data-v-592b922e]{min-height:17px;margin-top:9px;color:#8895ae;font-size:11px;line-height:1.5}.transfer-dialog.failed[data-v-592b922e]{border-color:#754351}.transfer-dialog.failed .transfer-heading strong[data-v-592b922e],.transfer-dialog.failed .transfer-detail[data-v-592b922e]{color:#e99aa9}.transfer-dialog.failed .transfer-bar[data-v-592b922e]{background:#c85d70}.transfer-fade-enter-active[data-v-592b922e],.transfer-fade-leave-active[data-v-592b922e]{transition:opacity .16s ease}.transfer-fade-enter-from[data-v-592b922e],.transfer-fade-leave-to[data-v-592b922e]{opacity:0}@keyframes transfer-slide-592b922e{0%{transform:translate(-110%)}to{transform:translate(250%)}}.layout[data-v-42c4fa00]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-42c4fa00]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-42c4fa00]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-42c4fa00]:hover{background:#3a5a8c}.right[data-v-42c4fa00]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-42c4fa00]{order:1}.panel-right .resizer-col[data-v-42c4fa00]{order:2}.panel-right .parameter-panel[data-v-42c4fa00]{order:3}.stage-area[data-v-42c4fa00]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-42c4fa00]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-42c4fa00]:hover{background:#3a5a8c}.timeline-area[data-v-42c4fa00]{position:relative;z-index:10;flex-shrink:0;overflow:visible}html,body{width:100%;height:100%;margin:0;padding:0;overflow:clip;overscroll-behavior:none;background:#0b0b12;color:#e8e8f0;font-family:system-ui,-apple-system,Segoe UI,sans-serif}body{position:fixed;top:0;right:0;bottom:0;left:0}*{box-sizing:border-box}#app{position:fixed;top:0;right:0;bottom:0;left:0;width:auto;height:auto;overflow:clip}input[type=number]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none} diff --git a/dist/assets/index-C_0QkTeX.js b/dist/assets/index-DPMVQNnV.js similarity index 99% rename from dist/assets/index-C_0QkTeX.js rename to dist/assets/index-DPMVQNnV.js index f182311..7a4482b 100644 --- a/dist/assets/index-C_0QkTeX.js +++ b/dist/assets/index-DPMVQNnV.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-yJqyT1FD.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-yJqyT1FD.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-BrVMjrya.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-BrVMjrya.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-CQJ6qUg9.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-CQJ6qUg9.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-B-woOuPC.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-B-woOuPC.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-yJqyT1FD.js b/dist/assets/index-yJqyT1FD.js deleted file mode 100644 index 6967527..0000000 --- a/dist/assets/index-yJqyT1FD.js +++ /dev/null @@ -1,1239 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C_0QkTeX.js","assets/index-BrVMjrya.js"])))=>i.map(i=>d[i]); -var CS=Object.defineProperty;var IS=(s,e,t)=>e in s?CS(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var x=(s,e,t)=>IS(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 a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).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 ii={},fo=[],Pn=()=>{},by=()=>!1,Jh=s=>s.charCodeAt(0)===111&&s.charCodeAt(1)===110&&(s.charCodeAt(2)>122||s.charCodeAt(2)<97),Qh=s=>s.startsWith("onUpdate:"),Oi=Object.assign,Zm=(s,e)=>{const t=s.indexOf(e);t>-1&&s.splice(t,1)},RS=Object.prototype.hasOwnProperty,zt=(s,e)=>RS.call(s,e),dt=Array.isArray,mo=s=>Yl(s)==="[object Map]",Oo=s=>Yl(s)==="[object Set]",$p=s=>Yl(s)==="[object Date]",_t=s=>typeof s=="function",gi=s=>typeof s=="string",Ss=s=>typeof s=="symbol",qt=s=>s!==null&&typeof s=="object",wy=s=>(qt(s)||_t(s))&&_t(s.then)&&_t(s.catch),Sy=Object.prototype.toString,Yl=s=>Sy.call(s),PS=s=>Yl(s).slice(8,-1),_y=s=>Yl(s)==="[object Object]",eu=s=>gi(s)&&s!=="NaN"&&s[0]!=="-"&&""+parseInt(s,10)===s,hl=Km(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),tu=s=>{const e=Object.create(null);return(t=>e[t]||(e[t]=s(t)))},kS=/-\w/g,qs=tu(s=>s.replace(kS,e=>e.slice(1).toUpperCase())),FS=/\B([A-Z])/g,jr=tu(s=>s.replace(FS,"-$1").toLowerCase()),My=tu(s=>s.charAt(0).toUpperCase()+s.slice(1)),Ou=tu(s=>s?`on${My(s)}`:""),An=(s,e)=>!Object.is(s,e),Uc=(s,...e)=>{for(let t=0;t{Object.defineProperty(s,e,{configurable:!0,enumerable:!1,writable:i,value:t})},iu=s=>{const e=parseFloat(s);return isNaN(e)?s:e},OS=s=>{const e=gi(s)?Number(s):NaN;return isNaN(e)?s:e};let Gp;const su=()=>Gp||(Gp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ni(s){if(dt(s)){const e={};for(let t=0;t{if(t){const i=t.split(LS);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function ot(s){let e="";if(gi(s))e=s;else if(dt(s))for(let t=0;tBo(t,e))}const Ey=s=>!!(s&&s.__v_isRef===!0),je=s=>gi(s)?s:s==null?"":dt(s)||qt(s)&&(s.toString===Sy||!_t(s.toString))?Ey(s)?je(s.value):JSON.stringify(s,Cy,2):String(s),Cy=(s,e)=>Ey(e)?Cy(s,e.value):mo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,n],r)=>(t[Bu(i,r)+" =>"]=n,t),{})}:Oo(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Bu(t))}:Ss(e)?Bu(e):qt(e)&&!dt(e)&&!_y(e)?String(e):e,Bu=(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 Pi;class Iy{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&&Pi&&(Pi.active?(this.parent=Pi,this.index=(Pi.scopes||(Pi.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(Pi===this)Pi=this.prevScope;else{let e=Pi;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(dl){let e=dl;for(dl=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let s;for(;ul;){let e=ul;for(ul=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 By(s){for(let e=s.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Ly(s){let e,t=s.depsTail,i=t;for(;i;){const n=i.prevDep;i.version===-1?(i===t&&(t=n),tp(i),$S(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=n}s.deps=e,s.depsTail=t}function If(s){for(let e=s.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Dy(e.dep.computed)||e.dep.version!==e.version))return!0;return!!s._dirty}function Dy(s){if(s.flags&4&&!(s.flags&16)||(s.flags&=-17,s.globalVersion===Tl)||(s.globalVersion=Tl,!s.isSSR&&s.flags&128&&(!s.deps&&!s._dirty||!If(s))))return;s.flags|=2;const e=s.dep,t=ri,i=Ks;ri=s,Ks=!0;try{By(s);const n=s.fn(s._value);(e.version===0||An(n,s._value))&&(s.flags|=128,s._value=n,e.version++)}catch(n){throw e.version++,n}finally{ri=t,Ks=i,Ly(s),s.flags&=-3}}function tp(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)tp(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function $S(s){const{prevDep:e,nextDep:t}=s;e&&(e.nextDep=t,s.prevDep=void 0),t&&(t.prevDep=e,s.nextDep=void 0)}let Ks=!0;const Ny=[];function cr(){Ny.push(Ks),Ks=!1}function hr(){const s=Ny.pop();Ks=s===void 0?!0:s}function Hp(s){const{cleanup:e}=s;if(s.cleanup=void 0,e){const t=ri;ri=void 0;try{e()}finally{ri=t}}}let Tl=0;class GS{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 ip{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(!ri||!Ks||ri===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==ri)t=this.activeLink=new GS(ri,this),ri.deps?(t.prevDep=ri.depsTail,ri.depsTail.nextDep=t,ri.depsTail=t):ri.deps=ri.depsTail=t,Uy(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=ri.depsTail,t.nextDep=void 0,ri.depsTail.nextDep=t,ri.depsTail=t,ri.deps===t&&(ri.deps=i)}return t}trigger(e){this.version++,Tl++,this.notify(e)}notify(e){Qm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{ep()}}}function Uy(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)Uy(i)}const t=s.dep.subs;t!==s&&(s.prevSub=t,t&&(t.nextSub=s)),s.dep.subs=s}}const ih=new WeakMap,Ma=Symbol(""),Rf=Symbol(""),Al=Symbol("");function Ji(s,e,t){if(Ks&&ri){let i=ih.get(s);i||ih.set(s,i=new Map);let n=i.get(t);n||(i.set(t,n=new ip),n.map=i,n.key=t),n.track()}}function Kn(s,e,t,i,n,r){const a=ih.get(s);if(!a){Tl++;return}const o=h=>{h&&h.trigger()};if(Qm(),e==="clear")a.forEach(o);else{const h=dt(s),l=h&&eu(t);if(h&&t==="length"){const c=Number(i);a.forEach((u,d)=>{(d==="length"||d===Al||!Ss(d)&&d>=c)&&o(u)})}else switch((t!==void 0||a.has(void 0))&&o(a.get(t)),l&&o(a.get(Al)),e){case"add":h?l&&o(a.get("length")):(o(a.get(Ma)),mo(s)&&o(a.get(Rf)));break;case"delete":h||(o(a.get(Ma)),mo(s)&&o(a.get(Rf)));break;case"set":mo(s)&&o(a.get(Ma));break}}ep()}function HS(s,e){const t=ih.get(s);return t&&t.get(e)}function Ha(s){const e=Yt(s);return e===s?e:(Ji(e,"iterate",Al),ws(s)?e:e.map(tn))}function nu(s){return Ji(s=Yt(s),"iterate",Al),s}function _n(s,e){return ur(s)?Ao(ar(s)?tn(e):e):tn(e)}const jS={__proto__:null,[Symbol.iterator](){return Du(this,Symbol.iterator,s=>_n(this,s))},concat(...s){return Ha(this).concat(...s.map(e=>dt(e)?Ha(e):e))},entries(){return Du(this,"entries",s=>(s[1]=_n(this,s[1]),s))},every(s,e){return Un(this,"every",s,e,void 0,arguments)},filter(s,e){return Un(this,"filter",s,e,t=>t.map(i=>_n(this,i)),arguments)},find(s,e){return Un(this,"find",s,e,t=>_n(this,t),arguments)},findIndex(s,e){return Un(this,"findIndex",s,e,void 0,arguments)},findLast(s,e){return Un(this,"findLast",s,e,t=>_n(this,t),arguments)},findLastIndex(s,e){return Un(this,"findLastIndex",s,e,void 0,arguments)},forEach(s,e){return Un(this,"forEach",s,e,void 0,arguments)},includes(...s){return Nu(this,"includes",s)},indexOf(...s){return Nu(this,"indexOf",s)},join(s){return Ha(this).join(s)},lastIndexOf(...s){return Nu(this,"lastIndexOf",s)},map(s,e){return Un(this,"map",s,e,void 0,arguments)},pop(){return $o(this,"pop")},push(...s){return $o(this,"push",s)},reduce(s,...e){return jp(this,"reduce",s,e)},reduceRight(s,...e){return jp(this,"reduceRight",s,e)},shift(){return $o(this,"shift")},some(s,e){return Un(this,"some",s,e,void 0,arguments)},splice(...s){return $o(this,"splice",s)},toReversed(){return Ha(this).toReversed()},toSorted(s){return Ha(this).toSorted(s)},toSpliced(...s){return Ha(this).toSpliced(...s)},unshift(...s){return $o(this,"unshift",s)},values(){return Du(this,"values",s=>_n(this,s))}};function Du(s,e,t){const i=nu(s),n=i[e]();return i!==s&&!ws(s)&&(n._next=n.next,n.next=()=>{const r=n._next();return r.done||(r.value=t(r.value)),r}),n}const WS=Array.prototype;function Un(s,e,t,i,n,r){const a=nu(s),o=a!==s&&!ws(s),h=a[e];if(h!==WS[e]){const u=h.apply(s,r);return o?tn(u):u}let l=t;a!==s&&(o?l=function(u,d){return t.call(this,_n(s,u),d,s)}:t.length>2&&(l=function(u,d){return t.call(this,u,d,s)}));const c=h.call(a,l,i);return o&&n?n(c):c}function jp(s,e,t,i){const n=nu(s),r=n!==s&&!ws(s);let a=t,o=!1;n!==s&&(r?(o=i.length===0,a=function(l,c,u){return o&&(o=!1,l=_n(s,l)),t.call(this,l,_n(s,c),u,s)}):t.length>3&&(a=function(l,c,u){return t.call(this,l,c,u,s)}));const h=n[e](a,...i);return o?_n(s,h):h}function Nu(s,e,t){const i=Yt(s);Ji(i,"iterate",Al);const n=i[e](...t);return(n===-1||n===!1)&&ru(t[0])?(t[0]=Yt(t[0]),i[e](...t)):n}function $o(s,e,t=[]){cr(),Qm();const i=Yt(s)[e].apply(s,t);return ep(),hr(),i}const zS=Km("__proto__,__v_isRef,__isVue"),Xy=new Set(Object.getOwnPropertyNames(Symbol).filter(s=>s!=="arguments"&&s!=="caller").map(s=>Symbol[s]).filter(Ss));function qS(s){Ss(s)||(s=String(s));const e=Yt(this);return Ji(e,"has",s),e.hasOwnProperty(s)}class Vy{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?r_:Hy:r?Gy:$y).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const a=dt(e);if(!n){let h;if(a&&(h=jS[t]))return h;if(t==="hasOwnProperty")return qS}const o=Reflect.get(e,t,_i(e)?e:i);if((Ss(t)?Xy.has(t):zS(t))||(n||Ji(e,"get",t),r))return o;if(_i(o)){const h=a&&eu(t)?o:o.value;return n&&qt(h)?kf(h):h}return qt(o)?n?kf(o):La(o):o}}class Yy extends Vy{constructor(e=!1){super(!1,e)}set(e,t,i,n){let r=e[t];const a=dt(e)&&eu(t);if(!this._isShallow){const l=ur(r);if(!ws(i)&&!ur(i)&&(r=Yt(r),i=Yt(i)),!a&&_i(r)&&!_i(i))return l||(r.value=i),!0}const o=a?Number(t)s,ic=s=>Reflect.getPrototypeOf(s);function e_(s,e,t){return function(...i){const n=this.__v_raw,r=Yt(n),a=mo(r),o=s==="entries"||s===Symbol.iterator&&a,h=s==="keys"&&a,l=n[s](...i),c=t?Pf:e?Ao:tn;return!e&&Ji(r,"iterate",h?Rf:Ma),Oi(Object.create(l),{next(){const{value:u,done:d}=l.next();return d?{value:u,done:d}:{value:o?[c(u[0]),c(u[1])]:c(u),done:d}}})}}function sc(s){return function(...e){return s==="delete"?!1:s==="clear"?void 0:this}}function t_(s,e){const t={get(n){const r=this.__v_raw,a=Yt(r),o=Yt(n);s||(An(n,o)&&Ji(a,"get",n),Ji(a,"get",o));const{has:h}=ic(a),l=e?Pf:s?Ao:tn;if(h.call(a,n))return l(r.get(n));if(h.call(a,o))return l(r.get(o));r!==a&&r.get(n)},get size(){const n=this.__v_raw;return!s&&Ji(Yt(n),"iterate",Ma),n.size},has(n){const r=this.__v_raw,a=Yt(r),o=Yt(n);return s||(An(n,o)&&Ji(a,"has",n),Ji(a,"has",o)),n===o?r.has(n):r.has(n)||r.has(o)},forEach(n,r){const a=this,o=a.__v_raw,h=Yt(o),l=e?Pf:s?Ao:tn;return!s&&Ji(h,"iterate",Ma),o.forEach((c,u)=>n.call(r,l(c),l(u),a))}};return Oi(t,s?{add:sc("add"),set:sc("set"),delete:sc("delete"),clear:sc("clear")}:{add(n){const r=Yt(this),a=ic(r),o=Yt(n),h=!e&&!ws(n)&&!ur(n)?o:n;return a.has.call(r,h)||An(n,h)&&a.has.call(r,n)||An(o,h)&&a.has.call(r,o)||(r.add(h),Kn(r,"add",h,h)),this},set(n,r){!e&&!ws(r)&&!ur(r)&&(r=Yt(r));const a=Yt(this),{has:o,get:h}=ic(a);let l=o.call(a,n);l||(n=Yt(n),l=o.call(a,n));const c=h.call(a,n);return a.set(n,r),l?An(r,c)&&Kn(a,"set",n,r):Kn(a,"add",n,r),this},delete(n){const r=Yt(this),{has:a,get:o}=ic(r);let h=a.call(r,n);h||(n=Yt(n),h=a.call(r,n)),o&&o.call(r,n);const l=r.delete(n);return h&&Kn(r,"delete",n,void 0),l},clear(){const n=Yt(this),r=n.size!==0,a=n.clear();return r&&Kn(n,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=e_(n,s,e)}),t}function sp(s,e){const t=t_(s,e);return(i,n,r)=>n==="__v_isReactive"?!s:n==="__v_isReadonly"?s:n==="__v_raw"?i:Reflect.get(zt(t,n)&&n in i?t:i,n,r)}const i_={get:sp(!1,!1)},s_={get:sp(!1,!0)},n_={get:sp(!0,!1)};const $y=new WeakMap,Gy=new WeakMap,Hy=new WeakMap,r_=new WeakMap;function a_(s){switch(s){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function La(s){return ur(s)?s:np(s,!1,ZS,i_,$y)}function o_(s){return np(s,!1,QS,s_,Gy)}function kf(s){return np(s,!0,JS,n_,Hy)}function np(s,e,t,i,n){if(!qt(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 a=a_(PS(s));if(a===0)return s;const o=new Proxy(s,a===2?i:t);return n.set(s,o),o}function ar(s){return ur(s)?ar(s.__v_raw):!!(s&&s.__v_isReactive)}function ur(s){return!!(s&&s.__v_isReadonly)}function ws(s){return!!(s&&s.__v_isShallow)}function ru(s){return s?!!s.__v_raw:!1}function Yt(s){const e=s&&s.__v_raw;return e?Yt(e):s}function Or(s){return!zt(s,"__v_skip")&&Object.isExtensible(s)&&Ty(s,"__v_skip",!0),s}const tn=s=>qt(s)?La(s):s,Ao=s=>qt(s)?kf(s):s;function _i(s){return s?s.__v_isRef===!0:!1}function ht(s){return l_(s,!1)}function l_(s,e){return _i(s)?s:new c_(s,e)}class c_{constructor(e,t){this.dep=new ip,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Yt(e),this._value=t?e:tn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||ws(e)||ur(e);e=i?e:Yt(e),An(e,t)&&(this._rawValue=e,this._value=i?e:tn(e),this.dep.trigger())}}function ke(s){return _i(s)?s.value:s}const h_={get:(s,e,t)=>e==="__v_raw"?s:ke(Reflect.get(s,e,t)),set:(s,e,t,i)=>{const n=s[e];return _i(n)&&!_i(t)?(n.value=t,!0):Reflect.set(s,e,t,i)}};function jy(s){return ar(s)?s:new Proxy(s,h_)}function u_(s){const e=dt(s)?new Array(s.length):{};for(const t in s)e[t]=f_(s,t);return e}class d_{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(!dt(e)||Ss(this._key)||!eu(this._key))do n=!ru(r)||ws(r);while(n&&(r=r.__v_raw));this._shallow=n}get value(){let e=this._object[this._key];return this._shallow&&(e=ke(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&_i(this._raw[this._key])){const t=this._object[this._key];if(_i(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return HS(this._raw,this._key)}}function f_(s,e,t){return new d_(s,e,t)}class m_{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ip(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Tl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&ri!==this)return Oy(this,!0),!0}get value(){const e=this.dep.track();return Dy(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function p_(s,e,t=!1){let i,n;return _t(s)?i=s:(i=s.get,n=s.set),new m_(i,n,t)}const nc={},sh=new WeakMap;let ca;function g_(s,e=!1,t=ca){if(t){let i=sh.get(t);i||sh.set(t,i=[]),i.push(s)}}function v_(s,e,t=ii){const{immediate:i,deep:n,once:r,scheduler:a,augmentJob:o,call:h}=t,l=w=>n?w:ws(w)||n===!1||n===0?Zn(w,1):Zn(w);let c,u,d,f,p=!1,m=!1;if(_i(s)?(u=()=>s.value,p=ws(s)):ar(s)?(u=()=>l(s),p=!0):dt(s)?(m=!0,p=s.some(w=>ar(w)||ws(w)),u=()=>s.map(w=>{if(_i(w))return w.value;if(ar(w))return l(w);if(_t(w))return h?h(w,2):w()})):_t(s)?e?u=h?()=>h(s,2):s:u=()=>{if(d){cr();try{d()}finally{hr()}}const w=ca;ca=c;try{return h?h(s,3,[f]):s(f)}finally{ca=w}}:u=Pn,e&&n){const w=u,A=n===!0?1/0:n;u=()=>Zn(w(),A)}const g=Py(),v=()=>{c.stop(),g&&g.active&&Zm(g.effects,c)};if(r&&e){const w=e;e=(...A)=>{const T=w(...A);return v(),T}}let b=m?new Array(s.length).fill(nc):nc;const y=w=>{if(!(!(c.flags&1)||!c.dirty&&!w))if(e){const A=c.run();if(w||n||p||(m?A.some((T,M)=>An(T,b[M])):An(A,b))){d&&d();const T=ca;ca=c;try{const M=[A,b===nc?void 0:m&&b[0]===nc?[]:b,f];b=A,h?h(e,3,M):e(...M)}finally{ca=T}}}else c.run()};return o&&o(y),c=new ky(u),c.scheduler=a?()=>a(y,!1):y,f=w=>g_(w,!1,c),d=c.onStop=()=>{const w=sh.get(c);if(w){if(h)h(w,4);else for(const A of w)A();sh.delete(c)}},e?i?y(!0):b=c.run():a?a(y.bind(null,!0),!0):c.run(),v.pause=c.pause.bind(c),v.resume=c.resume.bind(c),v.stop=v,v}function Zn(s,e=1/0,t){if(e<=0||!qt(s)||s.__v_skip||(t=t||new Map,(t.get(s)||0)>=e))return s;if(t.set(s,e),e--,_i(s))Zn(s.value,e,t);else if(dt(s))for(let i=0;i{Zn(i,e,t)});else if(_y(s)){for(const i in s)Zn(s[i],e,t);for(const i of Object.getOwnPropertySymbols(s))Object.prototype.propertyIsEnumerable.call(s,i)&&Zn(s[i],e,t)}return s}/** -* @vue/runtime-core v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function $l(s,e,t,i){try{return i?s(...i):s()}catch(n){au(n,e,t)}}function Os(s,e,t,i){if(_t(s)){const n=$l(s,e,t,i);return n&&wy(n)&&n.catch(r=>{au(r,e,t)}),n}if(dt(s)){const n=[];for(let r=0;r>>1,n=ns[i],r=El(n);r=El(t)?ns.push(s):ns.splice(x_(e),0,s),s.flags|=1,zy()}}function zy(){nh||(nh=Wy.then(Ky))}function b_(s){if(!dt(s))Mr&&s.id===-1?Mr.splice(eo+1,0,s):s.flags&1||(po.push(s),s.flags|=1);else for(let e=0;eEl(t)-El(i));if(po.length=0,Mr){for(let t=0;ts.id==null?s.flags&2?-1:1/0:s.id;function Ky(s){try{for(vn=0;vn{i._d&&hh(-1);const r=rh(e),a=or.length;let o;try{o=s(...n)}finally{for(let h=or.length;h>a;h--)cp();rh(r),i._d&&hh(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function xe(s,e){if(ts===null)return s;const t=mu(ts),i=s.dirs||(s.dirs=[]);for(let n=0;n1)return t&&_t(e)?e.call(i&&i.proxy):e}}function S_(){return!!(hp()||Ta)}const __=Symbol.for("v-scx"),M_=()=>fl(__);function Qo(s,e){return ap(s,null,e)}function cs(s,e,t){return ap(s,e,t)}function ap(s,e,t=ii){const{immediate:i,deep:n,flush:r,once:a}=t,o=Oi({},t),h=e&&i||!e&&r!=="post";let l;if(kl){if(r==="sync"){const f=M_();l=f.__watcherHandles||(f.__watcherHandles=[])}else if(!h){const f=()=>{};return f.stop=Pn,f.resume=Pn,f.pause=Pn,f}}const c=rs;o.call=(f,p,m)=>Os(f,c,p,m);let u=!1;r==="post"?o.scheduler=f=>{hs(f,c&&c.suspense)}:r!=="sync"&&(u=!0,o.scheduler=(f,p)=>{p?f():rp(f)}),o.augmentJob=f=>{e&&(f.flags|=4),u&&(f.flags|=2,c&&(f.id=c.uid,f.i=c))};const d=v_(s,e,o);return kl&&(l?l.push(d):h&&d()),d}function T_(s,e,t){const i=this.proxy,n=gi(s)?s.includes(".")?Jy(i,s):()=>i[s]:s.bind(i,i);let r;_t(e)?r=e:(r=e.handler,t=e);const a=Hl(this),o=ap(n,r.bind(i),t);return a(),o}function Jy(s,e){const t=e.split(".");return()=>{let i=s;for(let n=0;ns.__isTeleport,Rs=Symbol("_leaveCb"),Go=Symbol("_enterCb");function E_(){const s={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Da(()=>{s.isMounted=!0}),uu(()=>{s.isUnmounting=!0}),s}const As=[Function,Array],Qy={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:As,onEnter:As,onAfterEnter:As,onEnterCancelled:As,onBeforeLeave:As,onLeave:As,onAfterLeave:As,onLeaveCancelled:As,onBeforeAppear:As,onAppear:As,onAfterAppear:As,onAppearCancelled:As},ex=s=>{const e=s.subTree;return e.component?ex(e.component):e},C_={name:"BaseTransition",props:Qy,setup(s,{slots:e}){const t=hp(),i=E_();return()=>{const n=e.default&&sx(e.default(),!0),r=n&&n.length?tx(n):t.subTree?Ue():void 0;if(!r)return;const a=Yt(s),{mode:o}=a;if(i.isLeaving)return Uu(r);const h=oh(r);if(!h)return Uu(r);let l=Ff(h,a,i,t,u=>l=u);h.type!==es&&Cl(h,l);let c=t.subTree&&oh(t.subTree);if(c&&c.type!==es&&!pa(c,h)&&ex(t).type!==es){let u=Ff(c,a,i,t);if(Cl(c,u),o==="out-in"&&h.type!==es)return i.isLeaving=!0,u.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete u.afterLeave,c=void 0},Uu(r);o==="in-out"&&h.type!==es?u.delayLeave=(d,f,p)=>{const m=ix(i,c);m[String(c.key)]=c,d[Rs]=()=>{f(),d[Rs]=void 0,delete l.delayedLeave,c=void 0},l.delayedLeave=()=>{p(),delete l.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return r}}};function tx(s){let e=s[0];if(s.length>1){for(const t of s)if(t.type!==es){e=t;break}}return e}const I_=C_;function ix(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 Ff(s,e,t,i,n){const{appear:r,mode:a,persisted:o=!1,onBeforeEnter:h,onEnter:l,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:g,onAppear:v,onAfterAppear:b,onAppearCancelled:y}=e,w=String(s.key),A=ix(t,s),T=(P,F)=>{P&&Os(P,i,9,F)},M=(P,F)=>{const I=F[1];T(P,F),dt(P)?P.every(k=>k.length<=1)&&I():P.length<=1&&I()},R={mode:a,persisted:o,beforeEnter(P){let F=h;if(!t.isMounted)if(r)F=g||h;else return;P[Rs]&&P[Rs](!0);const I=A[w];I&&pa(s,I)&&I.el[Rs]&&I.el[Rs](),T(F,[P])},enter(P){if(A[w]===s)return;let F=l,I=c,k=u;if(!t.isMounted)if(r)F=v||l,I=b||c,k=y||u;else return;let O=!1;P[Go]=U=>{O||(O=!0,U?T(k,[P]):T(I,[P]),R.delayedLeave&&R.delayedLeave(),P[Go]=void 0)};const L=P[Go].bind(null,!1);F?M(F,[P,L]):L()},leave(P,F){const I=String(s.key);if(P[Go]&&P[Go](!0),t.isUnmounting)return F();T(d,[P]);let k=!1;P[Rs]=L=>{k||(k=!0,F(),L?T(m,[P]):T(p,[P]),P[Rs]=void 0,A[I]===s&&delete A[I])};const O=P[Rs].bind(null,!1);A[I]=s,f?M(f,[P,O]):O()},clone(P){const F=Ff(P,e,t,i,n);return n&&n(F),F}};return R}function Uu(s){if(cu(s))return s=Yr(s),s.children=null,s}function oh(s){if(!cu(s))return lu(s.type)&&s.children?tx(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&&_t(t.default))return t.default()}}function Cl(s,e){if(s.shapeFlag&6&&s.component){s.transition=e;const t=s.component.subTree;Cl(lu(t.type)&&oh(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 sx(s,e=!1,t){let i=[],n=0;for(let r=0;r1)for(let r=0;rml(m,e&&(dt(e)?e[g]:e),t,i,n));return}if(go(i)&&!n){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&ml(s,e,t,i.component.subTree);return}const r=i.shapeFlag&4?mu(i.component):i.el,a=n?null:r,{i:o,r:h}=s,l=e&&e.r,c=o.refs===ii?o.refs={}:o.refs,u=o.setupState,d=Yt(u),f=u===ii?by:m=>zp(c,m)?!1:zt(d,m),p=(m,g)=>!(g&&zp(c,g));if(l!=null&&l!==h){if(qp(e),gi(l))c[l]=null,f(l)&&(u[l]=null);else if(_i(l)){const m=e;p(l,m.k)&&(l.value=null),m.k&&(c[m.k]=null)}}if(_t(h))$l(h,o,12,[a,c]);else{const m=gi(h),g=_i(h);if(m||g){const v=()=>{if(s.f){const b=m?f(h)?u[h]:c[h]:p()||!s.k?h.value:c[s.k];if(n)dt(b)&&Zm(b,r);else if(dt(b))b.includes(r)||b.push(r);else if(m)c[h]=[r],f(h)&&(u[h]=c[h]);else{const y=[r];p(h,s.k)&&(h.value=y),s.k&&(c[s.k]=y)}}else m?(c[h]=a,f(h)&&(u[h]=a)):g&&(p(h,s.k)&&(h.value=a),s.k&&(c[s.k]=a))};if(a){const b=()=>{v(),lh.delete(s)};b.id=-1,lh.set(s,b),hs(b,t)}else qp(s),v()}}}function qp(s){const e=lh.get(s);e&&(e.flags|=8,lh.delete(s))}su().requestIdleCallback;su().cancelIdleCallback;const go=s=>!!s.type.__asyncLoader,cu=s=>s.type.__isKeepAlive;function R_(s,e){rx(s,"a",e)}function P_(s,e){rx(s,"da",e)}function rx(s,e,t=rs){const i=s.__wdc||(s.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return s()});if(hu(e,i,t),t){let n=t.parent;for(;n&&n.parent;)cu(n.parent.vnode)&&k_(i,e,t,n),n=n.parent}}function k_(s,e,t,i){const n=hu(e,s,i,!0);Gl(()=>{Zm(i[e],n)},t)}function hu(s,e,t=rs,i=!1){if(t){const n=t[s]||(t[s]=[]),r=e.__weh||(e.__weh=(...a)=>{cr();const o=Hl(t),h=Os(e,t,s,a);return o(),hr(),h});return i?n.unshift(r):n.push(r),r}}const gr=s=>(e,t=rs)=>{(!kl||s==="sp")&&hu(s,(...i)=>e(...i),t)},F_=gr("bm"),Da=gr("m"),O_=gr("bu"),B_=gr("u"),uu=gr("bum"),Gl=gr("um"),L_=gr("sp"),D_=gr("rtg"),N_=gr("rtc");function U_(s,e=rs){hu("ec",s,e)}const X_=Symbol.for("v-ndc");function ci(s,e,t,i){let n;const r=t,a=dt(s);if(a||gi(s)){const o=a&&ar(s);let h=!1,l=!1;o&&(h=!ws(s),l=ur(s),s=nu(s)),n=new Array(s.length);for(let c=0,u=s.length;ce(o,h,void 0,r));else{const o=Object.keys(s);n=new Array(o.length);for(let h=0,l=o.length;h0;return te(),Qt(Ke,null,[Ne("slot",l,i)],c?-2:64)}let a=s[e];a&&a._c&&(a._d=!1);const o=or.length;te();let h;try{const l=a&&ax(a(t)),c=t.key||r||l&&l.key;h=Qt(Ke,{key:(c&&!Ss(c)?c:`_${e}`)+(!l&&i?"_fb":"")},l||(i?i():[]),l&&s._===1?64:-2)}catch(l){for(let c=or.length;c>o;c--)cp();throw l}finally{a&&a._c&&(a._d=!0)}return h}function ax(s){return s.some(e=>Rl(e)?!(e.type===es||e.type===Ke&&!ax(e.children)):!0)?s:null}const Of=s=>s?Ax(s)?mu(s):Of(s.parent):null,pl=Oi(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=>Of(s.parent),$root:s=>Of(s.root),$host:s=>s.ce,$emit:s=>s.emit,$options:s=>lx(s),$forceUpdate:s=>s.f||(s.f=()=>{rp(s.update)}),$nextTick:s=>s.n||(s.n=ou.bind(s.proxy)),$watch:s=>T_.bind(s)}),Xu=(s,e)=>s!==ii&&!s.__isScriptSetup&&zt(s,e),Y_={get({_:s},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:n,props:r,accessCache:a,type:o,appContext:h}=s;if(e[0]!=="$"){const d=a[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(Xu(i,e))return a[e]=1,i[e];if(n!==ii&&zt(n,e))return a[e]=2,n[e];if(zt(r,e))return a[e]=3,r[e];if(t!==ii&&zt(t,e))return a[e]=4,t[e];Bf&&(a[e]=0)}}const l=pl[e];let c,u;if(l)return e==="$attrs"&&Ji(s.attrs,"get",""),l(s);if((c=o.__cssModules)&&(c=c[e]))return c;if(t!==ii&&zt(t,e))return a[e]=4,t[e];if(u=h.config.globalProperties,zt(u,e))return u[e]},set({_:s},e,t){const{data:i,setupState:n,ctx:r}=s;return Xu(n,e)?(n[e]=t,!0):i!==ii&&zt(i,e)?(i[e]=t,!0):zt(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:a}},o){let h;return!!(t[o]||s!==ii&&o[0]!=="$"&&zt(s,o)||Xu(e,o)||zt(r,o)||zt(i,o)||zt(pl,o)||zt(n.config.globalProperties,o)||(h=a.__cssModules)&&h[o])},defineProperty(s,e,t){return t.get!=null?s._.accessCache[e]=0:zt(t,"value")&&this.set(s,e,t.value,null),Reflect.defineProperty(s,e,t)}};function Kp(s){return dt(s)?s.reduce((e,t)=>(e[t]=null,e),{}):s}let Bf=!0;function $_(s){const e=lx(s),t=s.proxy,i=s.ctx;Bf=!1,e.beforeCreate&&Zp(e.beforeCreate,s,"bc");const{data:n,computed:r,methods:a,watch:o,provide:h,inject:l,created:c,beforeMount:u,mounted:d,beforeUpdate:f,updated:p,activated:m,deactivated:g,beforeDestroy:v,beforeUnmount:b,destroyed:y,unmounted:w,render:A,renderTracked:T,renderTriggered:M,errorCaptured:R,serverPrefetch:P,expose:F,inheritAttrs:I,components:k,directives:O,filters:L}=e;if(l&&G_(l,i,null),a)for(const D in a){const _=a[D];_t(_)&&(i[D]=_.bind(t))}if(n){const D=n.call(t,t);qt(D)&&(s.data=La(D))}if(Bf=!0,r)for(const D in r){const _=r[D],X=_t(_)?_.bind(t,t):_t(_.get)?_.get.bind(t,t):Pn,N=!_t(_)&&_t(_.set)?_.set.bind(t):Pn,V=pt({get:X,set:N});Object.defineProperty(i,D,{enumerable:!0,configurable:!0,get:()=>V.value,set:G=>V.value=G})}if(o)for(const D in o)ox(o[D],i,t,D);if(h){const D=_t(h)?h.call(t):h;Reflect.ownKeys(D).forEach(_=>{w_(_,D[_])})}c&&Zp(c,s,"c");function B(D,_){dt(_)?_.forEach(X=>D(X.bind(t))):_&&D(_.bind(t))}if(B(F_,u),B(Da,d),B(O_,f),B(B_,p),B(R_,m),B(P_,g),B(U_,R),B(N_,T),B(D_,M),B(uu,b),B(Gl,w),B(L_,P),dt(F))if(F.length){const D=s.exposed||(s.exposed={});F.forEach(_=>{Object.defineProperty(D,_,{get:()=>t[_],set:X=>t[_]=X,enumerable:!0})})}else s.exposed||(s.exposed={});A&&s.render===Pn&&(s.render=A),I!=null&&(s.inheritAttrs=I),k&&(s.components=k),O&&(s.directives=O),P&&nx(s)}function G_(s,e,t=Pn){dt(s)&&(s=Lf(s));for(const i in s){const n=s[i];let r;qt(n)?"default"in n?r=fl(n.from||i,n.default,!0):r=fl(n.from||i):r=fl(n),_i(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:a=>r.value=a}):e[i]=r}}function Zp(s,e,t){Os(dt(s)?s.map(i=>i.bind(e.proxy)):s.bind(e.proxy),e,t)}function ox(s,e,t,i){let n=i.includes(".")?Jy(t,i):()=>t[i];if(gi(s)){const r=e[s];_t(r)&&cs(n,r)}else if(_t(s))cs(n,s.bind(t));else if(qt(s))if(dt(s))s.forEach(r=>ox(r,e,t,i));else{const r=_t(s.handler)?s.handler.bind(t):e[s.handler];_t(r)&&cs(n,r,s)}}function lx(s){const e=s.type,{mixins:t,extends:i}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:a}}=s.appContext,o=r.get(e);let h;return o?h=o:!n.length&&!t&&!i?h=e:(h={},n.length&&n.forEach(l=>ch(h,l,a,!0)),ch(h,e,a)),qt(e)&&r.set(e,h),h}function ch(s,e,t,i=!1){const{mixins:n,extends:r}=e;r&&ch(s,r,t,!0),n&&n.forEach(a=>ch(s,a,t,!0));for(const a in e)if(!(i&&a==="expose")){const o=H_[a]||t&&t[a];s[a]=o?o(s[a],e[a]):e[a]}return s}const H_={data:Jp,props:Qp,emits:Qp,methods:el,computed:el,beforeCreate:is,created:is,beforeMount:is,mounted:is,beforeUpdate:is,updated:is,beforeDestroy:is,beforeUnmount:is,destroyed:is,unmounted:is,activated:is,deactivated:is,errorCaptured:is,serverPrefetch:is,components:el,directives:el,watch:W_,provide:Jp,inject:j_};function Jp(s,e){return e?s?function(){return Oi(_t(s)?s.call(this,this):s,_t(e)?e.call(this,this):e)}:e:s}function j_(s,e){return el(Lf(s),Lf(e))}function Lf(s){if(dt(s)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?s.modelModifiers:s[`${e}Modifiers`]||s[`${qs(e)}Modifiers`]||s[`${jr(e)}Modifiers`];function Z_(s,e,...t){if(s.isUnmounted)return;const i=s.vnode.props||ii;let n=t;const r=e.startsWith("update:"),a=r&&K_(i,e.slice(7));a&&(a.trim&&(n=t.map(c=>gi(c)?c.trim():c)),a.number&&(n=t.map(iu)));let o,h=i[o=Ou(e)]||i[o=Ou(qs(e))];!h&&r&&(h=i[o=Ou(jr(e))]),h&&Os(h,s,6,n);const l=i[o+"Once"];if(l){if(!s.emitted)s.emitted={};else if(s.emitted[o])return;s.emitted[o]=!0,Os(l,s,6,n)}}const J_=new WeakMap;function hx(s,e,t=!1){const i=t?J_:e.emitsCache,n=i.get(s);if(n!==void 0)return n;const r=s.emits;let a={},o=!1;if(!_t(s)){const h=l=>{const c=hx(l,e,!0);c&&(o=!0,Oi(a,c))};!t&&e.mixins.length&&e.mixins.forEach(h),s.extends&&h(s.extends),s.mixins&&s.mixins.forEach(h)}return!r&&!o?(qt(s)&&i.set(s,null),null):(dt(r)?r.forEach(h=>a[h]=null):Oi(a,r),qt(s)&&i.set(s,a),a)}function du(s,e){return!s||!Jh(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),zt(s,e[0].toLowerCase()+e.slice(1))||zt(s,jr(e))||zt(s,e))}function eg(s){const{type:e,vnode:t,proxy:i,withProxy:n,propsOptions:[r],slots:a,attrs:o,emit:h,render:l,renderCache:c,props:u,data:d,setupState:f,ctx:p,inheritAttrs:m}=s,g=rh(s);let v,b;try{if(t.shapeFlag&4){const w=n||i,A=w;v=Mn(l.call(A,w,c,u,f,d,p)),b=o}else{const w=e;v=Mn(w.length>1?w(u,{attrs:o,slots:a,emit:h}):w(u,null)),b=e.props?o:Q_(o)}}catch(w){or.length=0,au(w,s,1),v=Ne(es)}let y=v;if(b&&m!==!1){const w=Object.keys(b),{shapeFlag:A}=y;w.length&&A&7&&(r&&w.some(Qh)&&(b=eM(b,r)),y=Yr(y,b,!1,!0))}if(t.dirs&&(y=Yr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(t.dirs):t.dirs),t.transition){const w=lu(y.type)&&oh(y)||y;Cl(w,t.transition)}return v=y,rh(g),v}const Q_=s=>{let e;for(const t in s)(t==="class"||t==="style"||Jh(t))&&((e||(e={}))[t]=s[t]);return e},eM=(s,e)=>{const t={};for(const i in s)(!Qh(i)||!(i.slice(9)in e))&&(t[i]=s[i]);return t};function tM(s,e,t){const{props:i,children:n,component:r}=s,{props:a,children:o,patchFlag:h}=e,l=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&h>=0){if(h&1024)return!0;if(h&16)return i?tg(i,a,l):!!a;if(h&8){const c=e.dynamicProps;for(let u=0;uObject.create(dx),mx=s=>Object.getPrototypeOf(s)===dx;function sM(s,e,t,i=!1){const n={},r=fx();s.propsDefaults=Object.create(null),px(s,e,n,r);for(const a in s.propsOptions[0])a in n||(n[a]=void 0);t?s.props=i?n:o_(n):s.type.props?s.props=n:s.props=r,s.attrs=r}function nM(s,e,t,i){const{props:n,attrs:r,vnode:{patchFlag:a}}=s,o=Yt(n),[h]=s.propsOptions;let l=!1;if((i||a>0)&&!(a&16)){if(a&8){const c=s.vnode.dynamicProps;for(let u=0;u{h=!0;const[d,f]=gx(u,e,!0);Oi(a,d),f&&o.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(c),s.extends&&c(s.extends),s.mixins&&s.mixins.forEach(c)}if(!r&&!h)return qt(s)&&i.set(s,fo),fo;if(dt(r))for(let c=0;cs==="_"||s==="_ctx"||s==="$stable",lp=s=>dt(s)?s.map(Mn):[Mn(s)],aM=(s,e,t)=>{if(e._n)return e;const i=ah((...n)=>lp(e(...n)),t);return i._c=!1,i},vx=(s,e,t)=>{const i=s._ctx;for(const n in s){if(op(n))continue;const r=s[n];if(_t(r))e[n]=aM(n,r,i);else if(r!=null){const a=lp(r);e[n]=()=>a}}},yx=(s,e)=>{const t=lp(e);s.slots.default=()=>t},xx=(s,e,t)=>{for(const i in e)(t||!op(i))&&(s[i]=e[i])},oM=(s,e,t)=>{const i=s.slots=fx();if(s.vnode.shapeFlag&32){const n=e._;n?(xx(i,e,t),t&&Ty(i,"_",n,!0)):vx(e,i)}else e&&yx(s,e)},lM=(s,e,t)=>{const{vnode:i,slots:n}=s;let r=!0,a=ii;if(i.shapeFlag&32){const o=e._;o?t&&o===1?r=!1:xx(n,e,t):(r=!e.$stable,vx(e,n)),a=e}else e&&(yx(s,e),a={default:1});if(r)for(const o in n)!op(o)&&a[o]==null&&delete n[o]},hs=fM;function cM(s){return hM(s)}function hM(s,e){const t=su();t.__VUE__=!0;const{insert:i,remove:n,patchProp:r,createElement:a,createText:o,createComment:h,setText:l,setElementText:c,parentNode:u,nextSibling:d,setScopeId:f=Pn,insertStaticContent:p}=s,m=(H,K,q,z=null,ee=null,le=null,ve=void 0,re=null,ye=!!K.dynamicChildren)=>{if(H===K)return;H&&!pa(H,K)&&(z=me(H),G(H,ee,le,!0),H=null),K.patchFlag===-2&&(ye=!1,K.dynamicChildren=null);const{type:he,ref:Xe,shapeFlag:Pe}=K;switch(he){case fu:g(H,K,q,z);break;case es:v(H,K,q,z);break;case Xc:H==null&&b(K,q,z,ve);break;case Ke:k(H,K,q,z,ee,le,ve,re,ye);break;default:Pe&1?A(H,K,q,z,ee,le,ve,re,ye):Pe&6?O(H,K,q,z,ee,le,ve,re,ye):(Pe&64||Pe&128)&&he.process(H,K,q,z,ee,le,ve,re,ye,ge)}Xe!=null&&ee?ml(Xe,H&&H.ref,le,K||H,!K):Xe==null&&H&&H.ref!=null&&ml(H.ref,null,le,H,!0)},g=(H,K,q,z)=>{if(H==null)i(K.el=o(K.children),q,z);else{const ee=K.el=H.el;K.children!==H.children&&l(ee,K.children)}},v=(H,K,q,z)=>{H==null?i(K.el=h(K.children||""),q,z):K.el=H.el},b=(H,K,q,z)=>{[H.el,H.anchor]=p(H.children,K,q,z,H.el,H.anchor)},y=({el:H,anchor:K},q,z)=>{let ee;for(;H&&H!==K;)ee=d(H),i(H,q,z),H=ee;i(K,q,z)},w=({el:H,anchor:K})=>{let q;for(;H&&H!==K;)q=d(H),n(H),H=q;n(K)},A=(H,K,q,z,ee,le,ve,re,ye)=>{if(K.type==="svg"?ve="svg":K.type==="math"&&(ve="mathml"),H==null)T(K,q,z,ee,le,ve,re,ye);else{const he=H.el&&H.el._isVueCE?H.el:null;try{he&&he._beginPatch(),P(H,K,ee,le,ve,re,ye)}finally{he&&he._endPatch()}}},T=(H,K,q,z,ee,le,ve,re)=>{let ye,he;const{props:Xe,shapeFlag:Pe,transition:Oe,dirs:it}=H;if(ye=H.el=a(H.type,le,Xe&&Xe.is,Xe),Pe&8?c(ye,H.children):Pe&16&&R(H.children,ye,null,z,ee,Vu(H,le),ve,re),it&&ta(H,null,z,"created"),M(ye,H,H.scopeId,ve,z),Xe){for(const Ct in Xe)Ct!=="value"&&!hl(Ct)&&r(ye,Ct,null,Xe[Ct],le,z);"value"in Xe&&r(ye,"value",null,Xe.value,le),(he=Xe.onVnodeBeforeMount)&&hn(he,z,H)}it&&ta(H,null,z,"beforeMount");const bt=uM(ee,Oe);bt&&Oe.beforeEnter(ye),i(ye,K,q),((he=Xe&&Xe.onVnodeMounted)||bt||it)&&hs(()=>{try{he&&hn(he,z,H),bt&&Oe.enter(ye),it&&ta(H,null,z,"mounted")}finally{}},ee)},M=(H,K,q,z,ee)=>{if(q&&f(H,q),z)for(let le=0;le{for(let he=ye;he{const re=K.el=H.el;let{patchFlag:ye,dynamicChildren:he,dirs:Xe}=K;ye|=H.patchFlag&16;const Pe=H.props||ii,Oe=K.props||ii;let it;if(q&&ia(q,!1),(it=Oe.onVnodeBeforeUpdate)&&hn(it,q,K,H),Xe&&ta(K,H,q,"beforeUpdate"),q&&ia(q,!0),he&&(!H.dynamicChildren||H.dynamicChildren.length!==he.length)&&(ye=0,ve=!1,he=null),(Pe.innerHTML&&Oe.innerHTML==null||Pe.textContent&&Oe.textContent==null)&&c(re,""),he?F(H.dynamicChildren,he,re,q,z,Vu(K,ee),le):ve||_(H,K,re,null,q,z,Vu(K,ee),le,!1),ye>0){if(ye&16)I(re,Pe,Oe,q,ee);else if(ye&2&&Pe.class!==Oe.class&&r(re,"class",null,Oe.class,ee),ye&4&&r(re,"style",Pe.style,Oe.style,ee),ye&8){const bt=K.dynamicProps;for(let Ct=0;Ct{it&&hn(it,q,K,H),Xe&&ta(K,H,q,"updated")},z)},F=(H,K,q,z,ee,le,ve)=>{for(let re=0;re{if(K!==q){if(K!==ii)for(const le in K)!hl(le)&&!(le in q)&&r(H,le,K[le],null,ee,z);for(const le in q){if(hl(le))continue;const ve=q[le],re=K[le];ve!==re&&le!=="value"&&r(H,le,re,ve,ee,z)}"value"in q&&r(H,"value",K.value,q.value,ee)}},k=(H,K,q,z,ee,le,ve,re,ye)=>{const he=K.el=H?H.el:o(""),Xe=K.anchor=H?H.anchor:o("");let{patchFlag:Pe,dynamicChildren:Oe,slotScopeIds:it}=K;it&&(re=re?re.concat(it):it),H==null?(i(he,q,z),i(Xe,q,z),R(K.children||[],q,Xe,ee,le,ve,re,ye)):Pe>0&&Pe&64&&Oe&&H.dynamicChildren&&H.dynamicChildren.length===Oe.length?(F(H.dynamicChildren,Oe,q,ee,le,ve,re),(K.key!=null||ee&&K===ee.subTree)&&bx(H,K,!0)):_(H,K,q,Xe,ee,le,ve,re,ye)},O=(H,K,q,z,ee,le,ve,re,ye)=>{K.slotScopeIds=re,H==null?K.shapeFlag&512?ee.ctx.activate(K,q,z,ve,ye):L(K,q,z,ee,le,ve,ye):U(H,K,ye)},L=(H,K,q,z,ee,le,ve)=>{const re=H.component=xM(H,z,ee);if(cu(H)&&(re.ctx.renderer=ge),bM(re,!1,ve),re.asyncDep){if(ee&&ee.registerDep(re,B,ve),!H.el){const ye=re.subTree=Ne(es);v(null,ye,K,q),H.placeholder=ye.el}}else B(re,H,K,q,ee,le,ve)},U=(H,K,q)=>{const z=K.component=H.component;if(tM(H,K,q))if(z.asyncDep&&!z.asyncResolved){D(z,K,q);return}else z.next=K,z.update();else K.el=H.el,z.vnode=K},B=(H,K,q,z,ee,le,ve)=>{const re=()=>{if(H.isMounted){let{next:Pe,bu:Oe,u:it,parent:bt,vnode:Ct}=H;{const Bi=wx(H);if(Bi){Pe&&(Pe.el=Ct.el,D(H,Pe,ve)),Bi.asyncDep.then(()=>{hs(()=>{H.isUnmounted||he()},ee)});return}}let wt=Pe,Et;ia(H,!1),Pe?(Pe.el=Ct.el,D(H,Pe,ve)):Pe=Ct,Oe&&Uc(Oe),(Et=Pe.props&&Pe.props.onVnodeBeforeUpdate)&&hn(Et,bt,Pe,Ct),ia(H,!0);const Kt=eg(H),yi=H.subTree;H.subTree=Kt,m(yi,Kt,u(yi.el),me(yi),H,ee,le),Pe.el=Kt.el,wt===null&&iM(H,Kt.el),it&&hs(it,ee),(Et=Pe.props&&Pe.props.onVnodeUpdated)&&hs(()=>hn(Et,bt,Pe,Ct),ee)}else{let Pe;const{el:Oe,props:it}=K,{bm:bt,m:Ct,parent:wt,root:Et,type:Kt}=H,yi=go(K);ia(H,!1),bt&&Uc(bt),!yi&&(Pe=it&&it.onVnodeBeforeMount)&&hn(Pe,wt,K),ia(H,!0);{Et.ce&&Et.ce._hasShadowRoot()&&Et.ce._injectChildStyle(Kt,H.parent?H.parent.type:void 0);const Bi=H.subTree=eg(H);m(null,Bi,q,z,H,ee,le),K.el=Bi.el}if(Ct&&hs(Ct,ee),!yi&&(Pe=it&&it.onVnodeMounted)){const Bi=K;hs(()=>hn(Pe,wt,Bi),ee)}(K.shapeFlag&256||wt&&go(wt.vnode)&&wt.vnode.shapeFlag&256)&&H.a&&hs(H.a,ee),H.isMounted=!0,K=q=z=null}};H.scope.on();const ye=H.effect=new ky(re);H.scope.off();const he=H.update=ye.run.bind(ye),Xe=H.job=ye.runIfDirty.bind(ye);Xe.i=H,Xe.id=H.uid,ye.scheduler=()=>rp(Xe),ia(H,!0),he()},D=(H,K,q)=>{K.component=H;const z=H.vnode.props;H.vnode=K,H.next=null,nM(H,K.props,z,q),lM(H,K.children,q),cr(),Wp(H),hr()},_=(H,K,q,z,ee,le,ve,re,ye=!1)=>{const he=H&&H.children,Xe=H?H.shapeFlag:0,Pe=K.children,{patchFlag:Oe,shapeFlag:it}=K;if(Oe>0){if(Oe&128){N(he,Pe,q,z,ee,le,ve,re,ye);return}else if(Oe&256){X(he,Pe,q,z,ee,le,ve,re,ye);return}}it&8?(Xe&16&&de(he,ee,le),Pe!==he&&c(q,Pe)):Xe&16?it&16?N(he,Pe,q,z,ee,le,ve,re,ye):de(he,ee,le,!0):(Xe&8&&c(q,""),it&16&&R(Pe,q,z,ee,le,ve,re,ye))},X=(H,K,q,z,ee,le,ve,re,ye)=>{H=H||fo,K=K||fo;const he=H.length,Xe=K.length,Pe=Math.min(he,Xe);let Oe;for(Oe=0;OeXe?de(H,ee,le,!0,!1,Pe):R(K,q,z,ee,le,ve,re,ye,Pe)},N=(H,K,q,z,ee,le,ve,re,ye)=>{let he=0;const Xe=K.length;let Pe=H.length-1,Oe=Xe-1;for(;he<=Pe&&he<=Oe;){const it=H[he],bt=K[he]=ye?qn(K[he]):Mn(K[he]);if(pa(it,bt))m(it,bt,q,null,ee,le,ve,re,ye);else break;he++}for(;he<=Pe&&he<=Oe;){const it=H[Pe],bt=K[Oe]=ye?qn(K[Oe]):Mn(K[Oe]);if(pa(it,bt))m(it,bt,q,null,ee,le,ve,re,ye);else break;Pe--,Oe--}if(he>Pe){if(he<=Oe){const it=Oe+1,bt=itOe)for(;he<=Pe;)G(H[he],ee,le,!0),he++;else{const it=he,bt=he,Ct=new Map;for(he=bt;he<=Oe;he++){const xi=K[he]=ye?qn(K[he]):Mn(K[he]);xi.key!=null&&Ct.set(xi.key,he)}let wt,Et=0;const Kt=Oe-bt+1;let yi=!1,Bi=0;const Ls=new Array(Kt);for(he=0;he=Kt){G(xi,ee,le,!0);continue}let ce;if(xi.key!=null)ce=Ct.get(xi.key);else for(wt=bt;wt<=Oe;wt++)if(Ls[wt-bt]===0&&pa(xi,K[wt])){ce=wt;break}ce===void 0?G(xi,ee,le,!0):(Ls[ce-bt]=he+1,ce>=Bi?Bi=ce:yi=!0,m(xi,K[ce],q,null,ee,le,ve,re,ye),Et++)}const an=yi?dM(Ls):fo;for(wt=an.length-1,he=Kt-1;he>=0;he--){const xi=bt+he,ce=K[xi],fe=K[xi+1],It=xi+1{const{el:le,type:ve,transition:re,children:ye,shapeFlag:he}=H;if(he&6){V(H.component.subTree,K,q,z);return}if(he&128){H.suspense.move(K,q,z);return}if(he&64){ve.move(H,K,q,ge);return}if(ve===Ke){i(le,K,q);for(let Pe=0;Pere.enter(le),ee));else{const{leave:Pe,delayLeave:Oe,afterLeave:it}=re,bt=()=>{H.ctx.isUnmounted?n(le):i(le,K,q)},Ct=()=>{const wt=le._isLeaving||!!le[Rs];le._isLeaving&&le[Rs](!0),re.persisted&&!wt?bt():Pe(le,()=>{bt(),it&&it()})};Oe?Oe(le,bt,Ct):Ct()}else i(le,K,q)},G=(H,K,q,z=!1,ee=!1)=>{const{type:le,props:ve,ref:re,children:ye,dynamicChildren:he,shapeFlag:Xe,patchFlag:Pe,dirs:Oe,cacheIndex:it,memo:bt}=H;if(Pe===-2&&(ee=!1),re!=null&&(cr(),ml(re,null,q,H,!0),hr()),it!=null&&(K.renderCache[it]=void 0),Xe&256){K.ctx.deactivate(H);return}const Ct=Xe&1&&Oe,wt=!go(H);let Et;if(wt&&(Et=ve&&ve.onVnodeBeforeUnmount)&&hn(Et,K,H),Xe&6)Q(H.component,q,z);else{if(Xe&128){H.suspense.unmount(q,z);return}Ct&&ta(H,null,K,"beforeUnmount"),Xe&64?H.type.remove(H,K,q,ge,z):he&&!he.hasOnce&&(le!==Ke||Pe>0&&Pe&64)?de(he,K,q,!1,!0):(le===Ke&&Pe&384||!ee&&Xe&16)&&de(ye,K,q),z&&j(H)}const Kt=bt!=null&&it==null;(wt&&(Et=ve&&ve.onVnodeUnmounted)||Ct||Kt)&&hs(()=>{Et&&hn(Et,K,H),Ct&&ta(H,null,K,"unmounted"),Kt&&(H.el=null)},q)},j=H=>{const{type:K,el:q,anchor:z,transition:ee}=H;if(K===Ke){ne(q,z);return}if(K===Xc){w(H);return}const le=()=>{n(q),ee&&!ee.persisted&&ee.afterLeave&&ee.afterLeave()};if(H.shapeFlag&1&&ee&&!ee.persisted){const{leave:ve,delayLeave:re}=ee,ye=()=>ve(q,le);re?re(H.el,le,ye):ye()}else le()},ne=(H,K)=>{let q;for(;H!==K;)q=d(H),n(H),H=q;n(K)},Q=(H,K,q)=>{const{bum:z,scope:ee,job:le,subTree:ve,um:re,m:ye,a:he}=H;sg(ye),sg(he),z&&Uc(z),ee.stop(),le&&(le.flags|=8,G(ve,H,K,q)),re&&hs(re,K),hs(()=>{H.isUnmounted=!0},K)},de=(H,K,q,z=!1,ee=!1,le=0)=>{for(let ve=le;ve{if(H.shapeFlag&6)return me(H.component.subTree);if(H.shapeFlag&128)return H.suspense.next();const K=d(H.anchor||H.el),q=K&&K[A_];return q?d(q):K};let we=!1;const Re=(H,K,q)=>{let z;H==null?K._vnode&&(G(K._vnode,null,null,!0),z=K._vnode.component):m(K._vnode||null,H,K,null,null,null,q),K._vnode=H,we||(we=!0,Wp(z),qy(),we=!1)},ge={p:m,um:G,m:V,r:j,mt:L,mc:R,pc:_,pbc:F,n:me,o:s};return{render:Re,hydrate:void 0,createApp:q_(Re)}}function Vu({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 ia({effect:s,job:e},t){t?(s.flags|=32,e.flags|=4):(s.flags&=-33,e.flags&=-5)}function uM(s,e){return(!s||s&&!s.pendingBranch)&&e&&!e.persisted}function bx(s,e,t=!1){const i=s.children,n=e.children;if(dt(i)&&dt(n))for(let r=0;r>1,s[t[o]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,a=t[r-1];r-- >0;)t[r]=a,a=e[a];return t}function wx(s){const e=s.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:wx(e)}function sg(s){if(s)for(let e=0;es.__isSuspense;function fM(s,e){e&&e.pendingBranch?dt(s)?e.effects.push(...s):e.effects.push(s):b_(s)}const Ke=Symbol.for("v-fgt"),fu=Symbol.for("v-txt"),es=Symbol.for("v-cmt"),Xc=Symbol.for("v-stc"),or=[];let bs=null;function te(s=!1){or.push(bs=s?null:[])}function cp(){or.pop(),bs=or[or.length-1]||null}let Il=1;function hh(s,e=!1){Il+=s,s<0&&bs&&e&&(bs.hasOnce=!0)}function Mx(s){return s.dynamicChildren=Il>0?bs||fo:null,cp(),Il>0&&bs&&bs.push(s),s}function oe(s,e,t,i,n,r){return Mx(E(s,e,t,i,n,r,!0))}function Qt(s,e,t,i,n){return Mx(Ne(s,e,t,i,n,!0))}function Rl(s){return s?s.__v_isVNode===!0:!1}function pa(s,e){return s.type===e.type&&s.key===e.key}const Tx=({key:s})=>s??null,Vc=({ref:s,ref_key:e,ref_for:t})=>(typeof s=="number"&&(s=""+s),s!=null?gi(s)||_i(s)||_t(s)?{i:ts,r:s,k:e,f:!!t}:s:null);function E(s,e=null,t=null,i=0,n=null,r=s===Ke?0:1,a=!1,o=!1){const h={__v_isVNode:!0,__v_skip:!0,type:s,props:e,key:e&&Tx(e),ref:e&&Vc(e),scopeId:Zy,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:ts};return o?(uh(h,t),r&128&&s.normalize(h)):t&&(h.shapeFlag|=gi(t)?8:16),Il>0&&!a&&bs&&(h.patchFlag>0||r&6)&&h.patchFlag!==32&&bs.push(h),h}const Ne=mM;function mM(s,e=null,t=null,i=0,n=null,r=!1){if((!s||s===X_)&&(s=es),Rl(s)){const o=Yr(s,e,!0);return t&&uh(o,t),Il>0&&!r&&bs&&(o.shapeFlag&6?bs[bs.indexOf(s)]=o:bs.push(o)),o.patchFlag=-2,o}if(MM(s)&&(s=s.__vccOpts),e){e=pM(e);let{class:o,style:h}=e;o&&!gi(o)&&(e.class=ot(o)),qt(h)&&(ru(h)&&!dt(h)&&(h=Oi({},h)),e.style=Ni(h))}const a=gi(s)?1:_x(s)?128:lu(s)?64:qt(s)?4:_t(s)?2:0;return E(s,e,t,i,n,a,r,!0)}function pM(s){return s?ru(s)||mx(s)?Oi({},s):s:null}function Yr(s,e,t=!1,i=!1){const{props:n,ref:r,patchFlag:a,children:o,transition:h}=s,l=e?gM(n||{},e):n,c={__v_isVNode:!0,__v_skip:!0,type:s.type,props:l,key:l&&Tx(l),ref:e&&e.ref?t&&r?dt(r)?r.concat(Vc(e)):[r,Vc(e)]:Vc(e):r,scopeId:s.scopeId,slotScopeIds:s.slotScopeIds,children:o,target:s.target,targetStart:s.targetStart,targetAnchor:s.targetAnchor,staticCount:s.staticCount,shapeFlag:s.shapeFlag,patchFlag:e&&s.type!==Ke?a===-1?16:a|16:a,dynamicProps:s.dynamicProps,dynamicChildren:s.dynamicChildren,appContext:s.appContext,dirs:s.dirs,transition:h,component:s.component,suspense:s.suspense,ssContent:s.ssContent&&Yr(s.ssContent),ssFallback:s.ssFallback&&Yr(s.ssFallback),placeholder:s.placeholder,el:s.el,anchor:s.anchor,ctx:s.ctx,ce:s.ce};return h&&i&&Cl(c,h.clone(c)),c}function ai(s=" ",e=0){return Ne(fu,null,s,e)}function to(s,e){const t=Ne(Xc,null,s);return t.staticCount=e,t}function Ue(s="",e=!1){return e?(te(),Qt(es,null,s)):Ne(es,null,s)}function Mn(s){return s==null||typeof s=="boolean"?Ne(es):dt(s)?Ne(Ke,null,s.slice()):Rl(s)?qn(s):Ne(fu,null,String(s))}function qn(s){return s.el===null&&s.patchFlag!==-1||s.memo?s:Yr(s)}function uh(s,e){let t=0;const{shapeFlag:i}=s;if(e==null)e=null;else if(dt(e))t=16;else if(typeof e=="object")if(i&65){const n=e.default;n&&(n._c&&(n._d=!1),uh(s,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!mx(e)?e._ctx=ts:n===3&&ts&&(ts.slots._===1?e._=1:(e._=2,s.patchFlag|=1024))}else if(_t(e)){if(i&65){uh(s,{default:e});return}e={default:e,_ctx:ts},t=32}else e=String(e),i&64?(t=16,e=[ai(e)]):t=8;s.children=e,s.shapeFlag|=t}function gM(...s){const e={};for(let t=0;trs||ts;let dh,Pl;{const s=su(),e=(t,i)=>{let n;return(n=s[t])||(n=s[t]=[]),n.push(i),r=>{n.length>1?n.forEach(a=>a(r)):n[0](r)}};dh=e("__VUE_INSTANCE_SETTERS__",t=>rs=t),Pl=e("__VUE_SSR_SETTERS__",t=>kl=t)}const Hl=s=>{const e=rs;return dh(s),s.scope.on(),()=>{s.scope.off(),dh(e)}},ng=()=>{rs&&rs.scope.off(),dh(null)};function Ax(s){return s.vnode.shapeFlag&4}let kl=!1;function bM(s,e=!1,t=!1){e&&Pl(e);const{props:i,children:n}=s.vnode,r=Ax(s);sM(s,i,r,e),oM(s,n,t||e);const a=r?wM(s,e):void 0;return e&&Pl(!1),a}function wM(s,e){const t=s.type;s.accessCache=Object.create(null),s.proxy=new Proxy(s.ctx,Y_);const{setup:i}=t;if(i){cr();const n=s.setupContext=i.length>1?_M(s):null,r=Hl(s),a=$l(i,s,0,[s.props,n]),o=wy(a);if(hr(),r(),(o||s.sp)&&!go(s)&&nx(s),o){if(a.then(ng,ng),e)return a.then(h=>{Pl(!0);try{rg(s,h,e)}finally{Pl(!1)}}).catch(h=>{au(h,s,0)});s.asyncDep=a}else rg(s,a)}else Ex(s)}function rg(s,e,t){_t(e)?s.type.__ssrInlineRender?s.ssrRender=e:s.render=e:qt(e)&&(s.setupState=jy(e)),Ex(s)}function Ex(s,e,t){const i=s.type;s.render||(s.render=i.render||Pn);{const n=Hl(s);cr();try{$_(s)}finally{hr(),n()}}}const SM={get(s,e){return Ji(s,"get",""),s[e]}};function _M(s){const e=t=>{s.exposed=t||{}};return{attrs:new Proxy(s.attrs,SM),slots:s.slots,emit:s.emit,expose:e}}function mu(s){return s.exposed?s.exposeProxy||(s.exposeProxy=new Proxy(jy(Or(s.exposed)),{get(e,t){if(t in e)return e[t];if(t in pl)return pl[t](s)},has(e,t){return t in e||t in pl}})):s.proxy}function MM(s){return _t(s)&&"__vccOpts"in s}const pt=(s,e)=>p_(s,e,kl);function TM(s,e,t){try{hh(-1);const i=arguments.length;return i===2?qt(e)&&!dt(e)?Rl(e)?Ne(s,null,[e]):Ne(s,e):Ne(s,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Rl(t)&&(t=[t]),Ne(s,e,t))}finally{hh(1)}}const AM="3.5.41";/** -* @vue/runtime-dom v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Nf;const ag=typeof window<"u"&&window.trustedTypes;if(ag)try{Nf=ag.createPolicy("vue",{createHTML:s=>s})}catch{}const Cx=Nf?s=>Nf.createHTML(s):s=>s,EM="http://www.w3.org/2000/svg",CM="http://www.w3.org/1998/Math/MathML",Gn=typeof document<"u"?document:null,og=Gn&&Gn.createElement("template"),IM={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"?Gn.createElementNS(EM,s):e==="mathml"?Gn.createElementNS(CM,s):t?Gn.createElement(s,{is:t}):Gn.createElement(s);return s==="select"&&i&&i.multiple!=null&&n.setAttribute("multiple",i.multiple),n},createText:s=>Gn.createTextNode(s),createComment:s=>Gn.createComment(s),setText:(s,e)=>{s.nodeValue=e},setElementText:(s,e)=>{s.textContent=e},parentNode:s=>s.parentNode,nextSibling:s=>s.nextSibling,querySelector:s=>Gn.querySelector(s),setScopeId(s,e){s.setAttribute(e,"")},insertStaticContent(s,e,t,i,n,r){const a=t?t.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),t),!(n===r||!(n=n.nextSibling)););else{og.innerHTML=Cx(i==="svg"?`${s}`:i==="mathml"?`${s}`:s);const o=og.content;if(i==="svg"||i==="mathml"){const h=o.firstChild;for(;h.firstChild;)o.appendChild(h.firstChild);o.removeChild(h)}e.insertBefore(o,t)}return[a?a.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},vr="transition",Ho="animation",Fl=Symbol("_vtc"),Ix={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},RM=Oi({},Qy,Ix),PM=s=>(s.displayName="Transition",s.props=RM,s),kM=PM((s,{slots:e})=>TM(I_,FM(s),e)),sa=(s,e=[])=>{dt(s)?s.forEach(t=>t(...e)):s&&s(...e)},lg=s=>s?dt(s)?s.some(e=>e.length>1):s.length>1:!1;function FM(s){const e={};for(const k in s)k in Ix||(e[k]=s[k]);if(s.css===!1)return e;const{name:t="v",type:i,duration:n,enterFromClass:r=`${t}-enter-from`,enterActiveClass:a=`${t}-enter-active`,enterToClass:o=`${t}-enter-to`,appearFromClass:h=r,appearActiveClass:l=a,appearToClass:c=o,leaveFromClass:u=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:f=`${t}-leave-to`}=s,p=OM(n),m=p&&p[0],g=p&&p[1],{onBeforeEnter:v,onEnter:b,onEnterCancelled:y,onLeave:w,onLeaveCancelled:A,onBeforeAppear:T=v,onAppear:M=b,onAppearCancelled:R=y}=e,P=(k,O,L,U)=>{k._enterCancelled=U,na(k,O?c:o),na(k,O?l:a),L&&L()},F=(k,O)=>{k._isLeaving=!1,na(k,u),na(k,f),na(k,d),O&&O()},I=k=>(O,L)=>{const U=k?M:b,B=()=>P(O,k,L);sa(U,[O,B]),cg(()=>{na(O,k?h:r),Xn(O,k?c:o),lg(U)||hg(O,i,m,B)})};return Oi(e,{onBeforeEnter(k){sa(v,[k]),Xn(k,r),Xn(k,a)},onBeforeAppear(k){sa(T,[k]),Xn(k,h),Xn(k,l)},onEnter:I(!1),onAppear:I(!0),onLeave(k,O){k._isLeaving=!0;const L=()=>F(k,O);Xn(k,u),k._enterCancelled?(Xn(k,d),fg(k)):(fg(k),Xn(k,d)),cg(()=>{k._isLeaving&&(na(k,u),Xn(k,f),lg(w)||hg(k,i,g,L))}),sa(w,[k,L])},onEnterCancelled(k){P(k,!1,void 0,!0),sa(y,[k])},onAppearCancelled(k){P(k,!0,void 0,!0),sa(R,[k])},onLeaveCancelled(k){F(k),sa(A,[k])}})}function OM(s){if(s==null)return null;if(qt(s))return[Yu(s.enter),Yu(s.leave)];{const e=Yu(s);return[e,e]}}function Yu(s){return OS(s)}function Xn(s,e){e.split(/\s+/).forEach(t=>t&&s.classList.add(t)),(s[Fl]||(s[Fl]=new Set)).add(e)}function na(s,e){e.split(/\s+/).forEach(i=>i&&s.classList.remove(i));const t=s[Fl];t&&(t.delete(e),t.size||(s[Fl]=void 0))}function cg(s){requestAnimationFrame(()=>{requestAnimationFrame(s)})}let BM=0;function hg(s,e,t,i){const n=s._endId=++BM,r=()=>{n===s._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:a,timeout:o,propCount:h}=LM(s,e);if(!a)return i();const l=a+"end";let c=0;const u=()=>{s.removeEventListener(l,d),r()},d=f=>{f.target===s&&++c>=h&&u()};setTimeout(()=>{c(t[p]||"").split(", "),n=i(`${vr}Delay`),r=i(`${vr}Duration`),a=ug(n,r),o=i(`${Ho}Delay`),h=i(`${Ho}Duration`),l=ug(o,h);let c=null,u=0,d=0;e===vr?a>0&&(c=vr,u=a,d=r.length):e===Ho?l>0&&(c=Ho,u=l,d=h.length):(u=Math.max(a,l),c=u>0?a>l?vr:Ho:null,d=c?c===vr?r.length:h.length:0);const f=c===vr&&/\b(?:transform|all)(?:,|$)/.test(i(`${vr}Property`).toString());return{type:c,timeout:u,propCount:d,hasTransform:f}}function ug(s,e){for(;s.lengthdg(t)+dg(s[i])))}function dg(s){return s==="auto"?0:Number(s.slice(0,-1).replace(",","."))*1e3}function fg(s){return(s?s.ownerDocument:document).body.offsetHeight}function DM(s,e,t){const i=s[Fl];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?s.removeAttribute("class"):t?s.setAttribute("class",e):s.className=e}const fh=Symbol("_vod"),Rx=Symbol("_vsh"),yr={name:"show",beforeMount(s,{value:e},{transition:t}){s[fh]=s.style.display==="none"?"":s.style.display,t&&e?t.beforeEnter(s):jo(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),jo(s,!0),i.enter(s)):i.leave(s,()=>{jo(s,!1)}):jo(s,e))},beforeUnmount(s,{value:e}){jo(s,e)}};function jo(s,e){s.style.display=e?s[fh]:"none",s[Rx]=!e}const NM=Symbol(""),UM=/(?:^|;)\s*display\s*:/;function XM(s,e,t){const i=s.style,n=gi(t);let r=!1;if(t&&!n){if(e)if(gi(e))for(const a of e.split(";")){const o=a.slice(0,a.indexOf(":")).trim();t[o]==null&&tl(i,o,"")}else for(const a in e)t[a]==null&&tl(i,a,"");for(const a in t){a==="display"&&(r=!0);const o=t[a];o!=null?YM(s,a,!gi(e)&&e?e[a]:void 0,o)||tl(i,a,o):tl(i,a,"")}}else if(n){if(e!==t){const a=i[NM];a&&(t+=";"+a),i.cssText=t,r=UM.test(t)}}else e&&s.removeAttribute("style");fh in s&&(s[fh]=r?i.display:"",s[Rx]&&(i.display="none"))}const mg=/\s*!important$/;function tl(s,e,t){if(dt(t))t.forEach(i=>tl(s,e,i));else if(t==null&&(t=""),e.startsWith("--"))s.setProperty(e,t);else{const i=VM(s,e);mg.test(t)?s.setProperty(jr(i),t.replace(mg,""),"important"):s[i]=t}}const pg=["Webkit","Moz","ms"],$u={};function VM(s,e){const t=$u[e];if(t)return t;let i=qs(e);if(i!=="filter"&&i in s)return $u[e]=i;i=My(i);for(let n=0;nGu||(zM.then(()=>Gu=0),Gu=Date.now());function KM(s,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;const n=t.value;if(dt(n)){const r=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{r.call(i),i._stopped=!0};const a=n.slice(),o=[i];for(let h=0;hs.charCodeAt(0)===111&&s.charCodeAt(1)===110&&s.charCodeAt(2)>96&&s.charCodeAt(2)<123,ZM=(s,e,t,i,n,r)=>{const a=n==="svg";e==="class"?DM(s,i,a):e==="style"?XM(s,t,i):Jh(e)?Qh(e)||GM(s,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):JM(s,e,i,a))?(yg(s,e,i),!s.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&vg(s,e,i,a,r,e!=="value")):s._isVueCE&&(QM(s,e)||s._def.__asyncLoader&&(/[A-Z]/.test(e)||!gi(i)))?yg(s,qs(e),i,r,e):(e==="true-value"?s._trueValue=i:e==="false-value"&&(s._falseValue=i),vg(s,e,i,a))};function JM(s,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in s&&bg(e)&&_t(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 bg(e)&&gi(t)?!1:e in s}function QM(s,e){const t=s._def.props;if(!t)return!1;const i=qs(e);return Array.isArray(t)?t.some(n=>qs(n)===i):Object.keys(t).some(n=>qs(n)===i)}const Eo=s=>{const e=s.props["onUpdate:modelValue"]||!1;return dt(e)?t=>Uc(e,t):e};function eT(s){s.target.composing=!0}function wg(s){const e=s.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const En=Symbol("_assign"),rc=Symbol("_initialValue");function Hu(s,e,t){return e&&(s=s.trim()),t&&(s=iu(s)),s}const ct={created(s,{modifiers:{lazy:e,trim:t,number:i}},n){s.parentNode&&(s.type==="text"?s[rc]=s.defaultValue.replace(/[\r\n]/g,""):s.type==="textarea"&&(s[rc]=s.defaultValue.replace(/\r\n?/g,` -`))),s[En]=Eo(n);const r=i||n.props&&n.props.type==="number";Rr(s,e?"change":"input",a=>{a.target.composing||s[En](Hu(s.value,t,r))}),(t||r)&&Rr(s,"change",()=>{s.value=Hu(s.value,t,r)}),e||(Rr(s,"compositionstart",eT),Rr(s,"compositionend",wg),Rr(s,"change",wg))},mounted(s,{value:e,modifiers:{trim:t,number:i}}){const n=e??"",r=s[rc];delete s[rc],r!==void 0&&(s.type==="text"||s.type==="textarea")&&s.value!==r?s[En](Hu(s.value,t,i)):s.value=n},beforeUpdate(s,{value:e,oldValue:t,modifiers:{lazy:i,trim:n,number:r}},a){if(s[En]=Eo(a),s.composing)return;const o=(r||s.type==="number")&&!/^0\d/.test(s.value)?iu(s.value):s.value,h=e??"";if(o===h)return;const l=s.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===s&&s.type!=="range"&&(i&&e===t||n&&s.value.trim()===h)||(s.value=h)}},ti={deep:!0,created(s,e,t){s[En]=Eo(t),Rr(s,"change",()=>{const i=s._modelValue,n=Ol(s),r=s.checked,a=s[En];if(dt(i)){const o=Jm(i,n),h=o!==-1;if(r&&!h)a(i.concat(n));else if(!r&&h){const l=[...i];l.splice(o,1),a(l)}}else if(Oo(i)){const o=new Set(i);r?o.add(n):o.delete(n),a(o)}else a(Px(s,r))})},mounted:Sg,beforeUpdate(s,e,t){s[En]=Eo(t),Sg(s,e,t)}};function Sg(s,{value:e,oldValue:t},i){s._modelValue=e;let n;if(dt(e))n=Jm(e,i.props.value)>-1;else if(Oo(e))n=e.has(i.props.value);else{if(e===t)return;n=Bo(e,Px(s,!0))}s.checked!==n&&(s.checked=n)}const jt={deep:!0,created(s,{value:e,modifiers:{number:t}},i){s._modelValue=e,Rr(s,"change",()=>{const n=Array.prototype.filter.call(s.options,r=>r.selected).map(r=>t?iu(Ol(r)):Ol(r));s[En](s.multiple?Oo(s._modelValue)?new Set(n):n:n[0]),s._assigning=!0,ou(()=>{s._assigning=!1})}),s[En]=Eo(i)},mounted(s,{value:e}){_g(s,e)},beforeUpdate(s,{value:e},t){s._modelValue=e,s[En]=Eo(t)},updated(s,{value:e}){s._assigning||_g(s,e)}};function _g(s,e){const t=s.multiple,i=dt(e);if(!(t&&!i&&!Oo(e))){for(let n=0,r=s.options.length;nString(l)===String(o)):a.selected=Jm(e,o)>-1}else a.selected=e.has(o);else if(Bo(Ol(a),e)){s.selectedIndex!==n&&(s.selectedIndex=n);return}}!t&&s.selectedIndex!==-1&&(s.selectedIndex=-1)}}function Ol(s){return"_value"in s?s._value:s.value}function Px(s,e){const t=e?"_trueValue":"_falseValue";return t in s?s[t]:e}const tT=["ctrl","shift","alt","meta"],iT={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)=>tT.some(t=>s[`${t}Key`]&&!e.includes(t))},yt=(s,e)=>{if(!s)return s;const t=s._withMods||(s._withMods={}),i=e.join(".");return t[i]||(t[i]=((n,...r)=>{for(let a=0;a{const t=s._withKeys||(s._withKeys={}),i=e.join(".");return t[i]||(t[i]=(n=>{if(!("key"in n))return;const r=jr(n.key);if(e.some(a=>a===r||sT[a]===r))return s(n)}))},nT=Oi({patchProp:ZM},IM);let Mg;function rT(){return Mg||(Mg=cM(nT))}const aT=((...s)=>{const e=rT().createApp(...s),{mount:t}=e;return e.mount=i=>{const n=lT(i);if(!n)return;const r=e._component;!_t(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const a=t(n,!1,oT(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},e});function oT(s){if(s instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&s instanceof MathMLElement)return"mathml"}function lT(s){return gi(s)?document.querySelector(s):s}/*! - * pinia v4.0.3 - * (c) 2026 Eduardo San Martin Morote - * @license MIT - */let kx;const pu=s=>kx=s,Fx=Symbol();function Tg(s){return s&&typeof s=="object"&&Object.prototype.toString.call(s)==="[object Object]"&&typeof s.toJSON!="function"}function cT(){const s=Ry(!0),e=s.run(()=>ht({}));let t=[],i=[];const n=Or({install(r){pu(n),n._a=r,r.provide(Fx,n),r.config.globalProperties.$pinia=n,i.forEach(a=>t.push(a)),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 Uf=()=>{};function Ag(s,e,t,i=Uf){s.add(e);const n=()=>{s.delete(e)&&i()};return!t&&Py()&&YS(n),n}function ja(s,...e){s.forEach(t=>{t(...e)})}const hT=s=>s(),Eg=Symbol(),ju=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];Tg(n)&&Tg(i)&&Object.hasOwn(s,t)&&!_i(i)&&!ar(i)?s[t]=Xf(n,i):s[t]=i}return s}const uT=Symbol();function dT(s){return!s||typeof s!="object"||!Object.hasOwn(s,uT)}const{assign:wr}=Object;function fT(s){return!!(_i(s)&&s.effect)}function mT(s,e,t,i){const{state:n,actions:r,getters:a}=e,o=t.state.value[s];let h;function l(){o||(t.state.value[s]=n?n():{});const c=u_(t.state.value[s]);return wr(c,r,Object.keys(a||{}).reduce((u,d)=>(u[d]=Or(pt(()=>{pu(t);const f=t._s.get(s);return a[d].call(f,f)})),u),{}))}return h=Ox(s,l,e,t,i,!0),h}function Ox(s,e,t={},i,n,r){let a;const o=wr({actions:{}},t),h={deep:!0};let l,c,u=new Set,d=new Set,f;const p=i.state.value[s];!r&&!p&&(i.state.value[s]={});let m;function g(M){let R;l=c=!1,typeof M=="function"?(M(i.state.value[s]),R={type:"patch function",storeId:s,events:f}):(Xf(i.state.value[s],M),R={type:"patch object",payload:M,storeId:s,events:f});const P=m=Symbol();ou().then(()=>{m===P&&(l=!0)}),c=!0,ja(u,R,i.state.value[s])}const v=r?function(){const{state:R}=t,P=R?R():{};this.$patch(F=>{wr(F,P)})}:Uf;function b(){a.stop(),u.clear(),d.clear(),i._s.delete(s)}const y=(M,R="")=>{if(Eg in M)return M[ju]=R,M;const P=function(){pu(i);const F=Array.from(arguments),I=new Set,k=new Set;function O(B){I.add(B)}function L(B){k.add(B)}ja(d,{args:F,name:P[ju],store:A,after:O,onError:L});let U;try{U=M.apply(this&&this.$id===s?this:A,F)}catch(B){throw ja(k,B),B}return U instanceof Promise?U.then(B=>(ja(I,B),B)).catch(B=>(ja(k,B),Promise.reject(B))):(ja(I,U),U)};return P[Eg]=!0,P[ju]=R,P},w={_p:i,$id:s,$onAction:Ag.bind(null,d),$patch:g,$reset:v,$subscribe(M,R={}){if(u.has(M))return Uf;const P=Ag(u,M,R.detached,()=>F()),F=a.run(()=>cs(()=>i.state.value[s],I=>{(R.flush==="sync"?c:l)&&M({storeId:s,type:"direct",events:f},I)},wr({},h,R)));return P},$dispose:b},A=La(w);i._s.set(s,A);const T=(i._a&&i._a.runWithContext||hT)(()=>i._e.run(()=>(a=Ry()).run(()=>e({action:y}))));for(const M in T){const R=T[M];_i(R)&&!fT(R)||ar(R)?r||(p&&dT(R)&&(_i(R)?R.value=p[M]:((R instanceof Set||R instanceof Map)&&R.clear(),Xf(R,p[M]))),i.state.value[s][M]=R):typeof R=="function"&&(T[M]=y(R,M),o.actions[M]=R)}return wr(A,T),wr(Yt(A),T),Object.defineProperty(A,"$state",{get:()=>i.state.value[s],set:M=>{g(R=>{wr(R,M)})}}),i._p.forEach(M=>{const R=a.run(()=>M({store:A,app:i._a,pinia:i,options:o}));wr(A,R)}),p&&r&&t.hydrate&&t.hydrate(A.$state,p),l=!0,c=!0,A}/*! #__NO_SIDE_EFFECTS__ */function pT(s,e,t){let i;const n=typeof e=="function";i=n?t:e;function r(a,o){const h=S_();return a=a||(h?fl(Fx,null):null),a&&pu(a),a=kx,a._s.has(s)||(n?Ox(s,e,i,a):mT(s,i,a)),a._s.get(s)}return r.$id=s,r}var Na=(s=>(s[s.WEBGL_LEGACY=0]="WEBGL_LEGACY",s[s.WEBGL=1]="WEBGL",s[s.WEBGL2=2]="WEBGL2",s))(Na||{}),Bx=(s=>(s[s.UNKNOWN=0]="UNKNOWN",s[s.WEBGL=1]="WEBGL",s[s.CANVAS=2]="CANVAS",s))(Bx||{}),Vf=(s=>(s[s.COLOR=16384]="COLOR",s[s.DEPTH=256]="DEPTH",s[s.STENCIL=1024]="STENCIL",s))(Vf||{}),ut=(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))(ut||{}),Cn=(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))(Cn||{}),De=(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))(De||{}),vo=(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))(vo||{}),et=(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))(et||{}),ze=(s=>(s[s.FLOAT=0]="FLOAT",s[s.INT=1]="INT",s[s.UINT=2]="UINT",s))(ze||{}),zs=(s=>(s[s.NEAREST=0]="NEAREST",s[s.LINEAR=1]="LINEAR",s))(zs||{}),Zs=(s=>(s[s.CLAMP=33071]="CLAMP",s[s.REPEAT=10497]="REPEAT",s[s.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",s))(Zs||{}),Bs=(s=>(s[s.OFF=0]="OFF",s[s.POW2=1]="POW2",s[s.ON=2]="ON",s[s.ON_MANUAL=3]="ON_MANUAL",s))(Bs||{}),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||{}),Tn=(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))(Tn||{}),up=(s=>(s[s.AUTO=0]="AUTO",s[s.MANUAL=1]="MANUAL",s))(up||{}),ks=(s=>(s.LOW="lowp",s.MEDIUM="mediump",s.HIGH="highp",s))(ks||{}),Ri=(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))(Ri||{}),Ci=(s=>(s[s.NONE=0]="NONE",s[s.LOW=2]="LOW",s[s.MEDIUM=4]="MEDIUM",s[s.HIGH=8]="HIGH",s))(Ci||{}),kn=(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))(kn||{});const gT={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")},We={ADAPTER:gT,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Wu=/iPhone/i,Cg=/iPod/i,Ig=/iPad/i,Rg=/\biOS-universal(?:.+)Mac\b/i,zu=/\bAndroid(?:.+)Mobile\b/i,Pg=/Android/i,Wa=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ac=/Silk/i,Vn=/Windows Phone/i,kg=/\bWindows(?:.+)ARM\b/i,Fg=/BlackBerry/i,Og=/BB10/i,Bg=/Opera Mini/i,Lg=/\b(CriOS|Chrome)(?:.+)Mobile/i,Dg=/Mobile(?:.+)Firefox\b/i,Ng=function(s){return typeof s<"u"&&s.platform==="MacIntel"&&typeof s.maxTouchPoints=="number"&&s.maxTouchPoints>1&&typeof MSStream>"u"};function vT(s){return function(e){return e.test(s)}}function Ug(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=vT(t),r={apple:{phone:n(Wu)&&!n(Vn),ipod:n(Cg),tablet:!n(Wu)&&(n(Ig)||Ng(e))&&!n(Vn),universal:n(Rg),device:(n(Wu)||n(Cg)||n(Ig)||n(Rg)||Ng(e))&&!n(Vn)},amazon:{phone:n(Wa),tablet:!n(Wa)&&n(ac),device:n(Wa)||n(ac)},android:{phone:!n(Vn)&&n(Wa)||!n(Vn)&&n(zu),tablet:!n(Vn)&&!n(Wa)&&!n(zu)&&(n(ac)||n(Pg)),device:!n(Vn)&&(n(Wa)||n(ac)||n(zu)||n(Pg))||n(/\bokhttp\b/i)},windows:{phone:n(Vn),tablet:n(kg),device:n(Vn)||n(kg)},other:{blackberry:n(Fg),blackberry10:n(Og),opera:n(Bg),firefox:n(Dg),chrome:n(Lg),device:n(Fg)||n(Og)||n(Bg)||n(Dg)||n(Lg)},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 yT=Ug.default??Ug,Qn=yT(globalThis.navigator);We.RETINA_PREFIX=/@([0-9\.]+)x/;We.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var mh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function xT(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 qu={exports:{}},Xg;function bT(){return Xg||(Xg=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(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function r(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new n(c,u||h,d),p=t?t+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function a(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)e.call(c,u)&&l.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=t?t+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d80*_){j=Q=B[0],ne=de=B[1];for(var ge=_;geQ&&(Q=me),we>de&&(de=we);Re=Math.max(Q-j,de-ne),Re=Re!==0?32767/Re:0}return i(V,G,_,j,ne,Re,0),G}function e(B,D,_,X,N){var V,G;if(N===U(B,D,_,X)>0)for(V=D;V<_;V+=X)G=k(V,B[V],B[V+1],G);else for(V=_-X;V>=D;V-=X)G=k(V,B[V],B[V+1],G);return G&&w(G,G.next)&&(O(G),G=G.next),G}function t(B,D){if(!B)return B;D||(D=B);var _=B,X;do if(X=!1,!_.steiner&&(w(_,_.next)||y(_.prev,_,_.next)===0)){if(O(_),_=D=_.prev,_===_.next)break;X=!0}else _=_.next;while(X||_!==D);return D}function i(B,D,_,X,N,V,G){if(B){!G&&V&&f(B,X,N,V);for(var j=B,ne,Q;B.prev!==B.next;){if(ne=B.prev,Q=B.next,V?r(B,X,N,V):n(B)){D.push(ne.i/_|0),D.push(B.i/_|0),D.push(Q.i/_|0),O(B),B=Q.next,j=Q.next;continue}if(B=Q,B===j){G?G===1?(B=a(t(B),D,_),i(B,D,_,X,N,V,2)):G===2&&o(B,D,_,X,N,V):i(t(B),D,_,X,N,V,1);break}}}}function n(B){var D=B.prev,_=B,X=B.next;if(y(D,_,X)>=0)return!1;for(var N=D.x,V=_.x,G=X.x,j=D.y,ne=_.y,Q=X.y,de=NV?N>G?N:G:V>G?V:G,Re=j>ne?j>Q?j:Q:ne>Q?ne:Q,ge=X.next;ge!==D;){if(ge.x>=de&&ge.x<=we&&ge.y>=me&&ge.y<=Re&&v(N,j,V,ne,G,Q,ge.x,ge.y)&&y(ge.prev,ge,ge.next)>=0)return!1;ge=ge.next}return!0}function r(B,D,_,X){var N=B.prev,V=B,G=B.next;if(y(N,V,G)>=0)return!1;for(var j=N.x,ne=V.x,Q=G.x,de=N.y,me=V.y,we=G.y,Re=jne?j>Q?j:Q:ne>Q?ne:Q,H=de>me?de>we?de:we:me>we?me:we,K=m(Re,ge,D,_,X),q=m(Ae,H,D,_,X),z=B.prevZ,ee=B.nextZ;z&&z.z>=K&&ee&&ee.z<=q;){if(z.x>=Re&&z.x<=Ae&&z.y>=ge&&z.y<=H&&z!==N&&z!==G&&v(j,de,ne,me,Q,we,z.x,z.y)&&y(z.prev,z,z.next)>=0||(z=z.prevZ,ee.x>=Re&&ee.x<=Ae&&ee.y>=ge&&ee.y<=H&&ee!==N&&ee!==G&&v(j,de,ne,me,Q,we,ee.x,ee.y)&&y(ee.prev,ee,ee.next)>=0))return!1;ee=ee.nextZ}for(;z&&z.z>=K;){if(z.x>=Re&&z.x<=Ae&&z.y>=ge&&z.y<=H&&z!==N&&z!==G&&v(j,de,ne,me,Q,we,z.x,z.y)&&y(z.prev,z,z.next)>=0)return!1;z=z.prevZ}for(;ee&&ee.z<=q;){if(ee.x>=Re&&ee.x<=Ae&&ee.y>=ge&&ee.y<=H&&ee!==N&&ee!==G&&v(j,de,ne,me,Q,we,ee.x,ee.y)&&y(ee.prev,ee,ee.next)>=0)return!1;ee=ee.nextZ}return!0}function a(B,D,_){var X=B;do{var N=X.prev,V=X.next.next;!w(N,V)&&A(N,X,X.next,V)&&P(N,V)&&P(V,N)&&(D.push(N.i/_|0),D.push(X.i/_|0),D.push(V.i/_|0),O(X),O(X.next),X=B=V),X=X.next}while(X!==B);return t(X)}function o(B,D,_,X,N,V){var G=B;do{for(var j=G.next.next;j!==G.prev;){if(G.i!==j.i&&b(G,j)){var ne=I(G,j);G=t(G,G.next),ne=t(ne,ne.next),i(G,D,_,X,N,V,0),i(ne,D,_,X,N,V,0);return}j=j.next}G=G.next}while(G!==B)}function h(B,D,_,X){var N=[],V,G,j,ne,Q;for(V=0,G=D.length;V=_.next.y&&_.next.y!==_.y){var j=_.x+(N-_.y)*(_.next.x-_.x)/(_.next.y-_.y);if(j<=X&&j>V&&(V=j,G=_.x<_.next.x?_:_.next,j===X))return G}_=_.next}while(_!==D);if(!G)return null;var ne=G,Q=G.x,de=G.y,me=1/0,we;_=G;do X>=_.x&&_.x>=Q&&X!==_.x&&v(NG.x||_.x===G.x&&d(G,_)))&&(G=_,me=we)),_=_.next;while(_!==ne);return G}function d(B,D){return y(B.prev,B,D.prev)<0&&y(D.next,B,B.next)<0}function f(B,D,_,X){var N=B;do N.z===0&&(N.z=m(N.x,N.y,D,_,X)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==B);N.prevZ.nextZ=null,N.prevZ=null,p(N)}function p(B){var D,_,X,N,V,G,j,ne,Q=1;do{for(_=B,B=null,V=null,G=0;_;){for(G++,X=_,j=0,D=0;D0||ne>0&&X;)j!==0&&(ne===0||!X||_.z<=X.z)?(N=_,_=_.nextZ,j--):(N=X,X=X.nextZ,ne--),V?V.nextZ=N:B=N,N.prevZ=V,V=N;_=X}V.nextZ=null,Q*=2}while(G>1);return B}function m(B,D,_,X,N){return B=(B-_)*N|0,D=(D-X)*N|0,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,D=(D|D<<8)&16711935,D=(D|D<<4)&252645135,D=(D|D<<2)&858993459,D=(D|D<<1)&1431655765,B|D<<1}function g(B){var D=B,_=B;do(D.x<_.x||D.x===_.x&&D.y<_.y)&&(_=D),D=D.next;while(D!==B);return _}function v(B,D,_,X,N,V,G,j){return(N-G)*(D-j)>=(B-G)*(V-j)&&(B-G)*(X-j)>=(_-G)*(D-j)&&(_-G)*(V-j)>=(N-G)*(X-j)}function b(B,D){return B.next.i!==D.i&&B.prev.i!==D.i&&!R(B,D)&&(P(B,D)&&P(D,B)&&F(B,D)&&(y(B.prev,B,D.prev)||y(B,D.prev,D))||w(B,D)&&y(B.prev,B,B.next)>0&&y(D.prev,D,D.next)>0)}function y(B,D,_){return(D.y-B.y)*(_.x-D.x)-(D.x-B.x)*(_.y-D.y)}function w(B,D){return B.x===D.x&&B.y===D.y}function A(B,D,_,X){var N=M(y(B,D,_)),V=M(y(B,D,X)),G=M(y(_,X,B)),j=M(y(_,X,D));return!!(N!==V&&G!==j||N===0&&T(B,_,D)||V===0&&T(B,X,D)||G===0&&T(_,B,X)||j===0&&T(_,D,X))}function T(B,D,_){return D.x<=Math.max(B.x,_.x)&&D.x>=Math.min(B.x,_.x)&&D.y<=Math.max(B.y,_.y)&&D.y>=Math.min(B.y,_.y)}function M(B){return B>0?1:B<0?-1:0}function R(B,D){var _=B;do{if(_.i!==B.i&&_.next.i!==B.i&&_.i!==D.i&&_.next.i!==D.i&&A(_,_.next,B,D))return!0;_=_.next}while(_!==B);return!1}function P(B,D){return y(B.prev,B,B.next)<0?y(B,D,B.next)>=0&&y(B,B.prev,D)>=0:y(B,D,B.prev)<0||y(B,B.next,D)<0}function F(B,D){var _=B,X=!1,N=(B.x+D.x)/2,V=(B.y+D.y)/2;do _.y>V!=_.next.y>V&&_.next.y!==_.y&&N<(_.next.x-_.x)*(V-_.y)/(_.next.y-_.y)+_.x&&(X=!X),_=_.next;while(_!==B);return X}function I(B,D){var _=new L(B.i,B.x,B.y),X=new L(D.i,D.x,D.y),N=B.next,V=D.prev;return B.next=D,D.prev=B,_.next=N,N.prev=_,X.next=_,_.prev=X,V.next=X,X.prev=V,X}function k(B,D,_,X){var N=new L(B,D,_);return X?(N.next=X.next,N.prev=X,X.next.prev=N,X.next=N):(N.prev=N,N.next=N),N}function O(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function L(B,D,_){this.i=B,this.x=D,this.y=_,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}s.deviation=function(B,D,_,X){var N=D&&D.length,V=N?D[0]*_:B.length,G=Math.abs(U(B,0,V,_));if(N)for(var j=0,ne=D.length;j0&&(X+=B[N-1].length,_.holes.push(X))}return _},oc.exports}var _T=ST();const MT=Lx(_T);var ra={},il={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var TT=il.exports,Yg;function AT(){return Yg||(Yg=1,(function(s,e){(function(t){var i=e&&!e.nodeType&&e,n=s&&!s.nodeType&&s,r=typeof mh=="object"&&mh;(r.global===r||r.window===r||r.self===r)&&(t=r);var a,o=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,p=128,m="-",g=/^xn--/,v=/[^\x20-\x7E]/,b=/[\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"},w=h-l,A=Math.floor,T=String.fromCharCode,M;function R(N){throw new RangeError(y[N])}function P(N,V){for(var G=N.length,j=[];G--;)j[G]=V(N[G]);return j}function F(N,V){var G=N.split("@"),j="";G.length>1&&(j=G[0]+"@",N=G[1]),N=N.replace(b,".");var ne=N.split("."),Q=P(ne,V).join(".");return j+Q}function I(N){for(var V=[],G=0,j=N.length,ne,Q;G=55296&&ne<=56319&&G65535&&(V-=65536,G+=T(V>>>10&1023|55296),V=56320|V&1023),G+=T(V),G}).join("")}function O(N){return N-48<10?N-22:N-65<26?N-65:N-97<26?N-97:h}function L(N,V){return N+22+75*(N<26)-((V!=0)<<5)}function U(N,V,G){var j=0;for(N=G?A(N/d):N>>1,N+=A(N/V);N>w*c>>1;j+=h)N=A(N/w);return A(j+(w+1)*N/(N+u))}function B(N){var V=[],G=N.length,j,ne=0,Q=p,de=f,me,we,Re,ge,Ae,H,K,q,z;for(me=N.lastIndexOf(m),me<0&&(me=0),we=0;we=128&&R("not-basic"),V.push(N.charCodeAt(we));for(Re=me>0?me+1:0;Re=G&&R("invalid-input"),K=O(N.charCodeAt(Re++)),(K>=h||K>A((o-ne)/Ae))&&R("overflow"),ne+=K*Ae,q=H<=de?l:H>=de+c?c:H-de,!(KA(o/z)&&R("overflow"),Ae*=z;j=V.length+1,de=U(ne-ge,j,ge==0),A(ne/j)>o-Q&&R("overflow"),Q+=A(ne/j),ne%=j,V.splice(ne++,0,Q)}return k(V)}function D(N){var V,G,j,ne,Q,de,me,we,Re,ge,Ae,H=[],K,q,z,ee;for(N=I(N),K=N.length,V=p,G=0,Q=f,de=0;de=V&&AeA((o-G)/q)&&R("overflow"),G+=(me-V)*q,V=me,de=0;deo&&R("overflow"),Ae==V){for(we=G,Re=h;ge=Re<=Q?l:Re>=Q+c?c:Re-Q,!(we-1e3&&ce<1e3||T.call(/e/,fe))return fe;var It=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ce=="number"){var Rt=ce<0?-F(-ce):F(ce);if(Rt!==ce){var Zt=String(Rt),St=b.call(fe,Zt.length+1);return y.call(Zt,It,"$&_")+"."+y.call(y.call(St,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(fe,It,"$&_")}var X=IT,N=X.custom,V=q(N)?N:null,G={__proto__:null,double:'"',single:"'"},j={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Zu=function ce(fe,It,Rt,Zt){var St=It||{};if(le(St,"quoteStyle")&&!le(G,St.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(le(St,"maxStringLength")&&(typeof St.maxStringLength=="number"?St.maxStringLength<0&&St.maxStringLength!==1/0:St.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ms=le(St,"customInspect")?St.customInspect:!0;if(typeof Ms!="boolean"&&Ms!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(le(St,"indent")&&St.indent!==null&&St.indent!==" "&&!(parseInt(St.indent,10)===St.indent&&St.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(le(St,"numericSeparator")&&typeof St.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ds=St.numericSeparator;if(typeof fe>"u")return"undefined";if(fe===null)return"null";if(typeof fe=="boolean")return fe?"true":"false";if(typeof fe=="string")return Ct(fe,St);if(typeof fe=="number"){if(fe===0)return 1/0/fe>0?"0":"-0";var Li=String(fe);return Ds?_(fe,Li):Li}if(typeof fe=="bigint"){var Ts=String(fe)+"n";return Ds?_(fe,Ts):Ts}var qr=typeof St.depth>"u"?5:St.depth;if(typeof Rt>"u"&&(Rt=0),Rt>=qr&&qr>0&&typeof fe=="object")return me(fe)?"[Array]":"[Object]";var on=Ls(St,Rt);if(typeof Zt>"u")Zt=[];else if(ye(Zt,fe)>=0)return"[Circular]";function Wi(_e,Me,be){if(Me&&(Zt=P.call(Zt),Zt.push(Me)),be){var Le={depth:St.depth};return le(St,"quoteStyle")&&(Le.quoteStyle=St.quoteStyle),ce(_e,Le,Rt+1,Zt)}return ce(_e,St,Rt+1,Zt)}if(typeof fe=="function"&&!Re(fe)){var Kr=re(fe),Zr=xi(fe,Wi);return"[Function"+(Kr?": "+Kr:" (anonymous)")+"]"+(Zr.length>0?" { "+R.call(Zr,", ")+" }":"")}if(q(fe)){var Ns=L?y.call(String(fe),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(fe);return typeof fe=="object"&&!L?Et(Ns):Ns}if(bt(fe)){for(var ln="<"+A.call(String(fe.nodeName)),cn=fe.attributes||[],Nn=0;Nn",ln}if(me(fe)){if(fe.length===0)return"[]";var Jr=xi(fe,Wi);return on&&!Bi(Jr)?"["+an(Jr,on)+"]":"[ "+R.call(Jr,", ")+" ]"}if(ge(fe)){var Us=xi(fe,Wi);return!("cause"in Error.prototype)&&"cause"in fe&&!B.call(fe,"cause")?"{ ["+String(fe)+"] "+R.call(M.call("[cause]: "+Wi(fe.cause),Us),", ")+" }":Us.length===0?"["+String(fe)+"]":"{ ["+String(fe)+"] "+R.call(Us,", ")+" }"}if(typeof fe=="object"&&Ms){if(V&&typeof fe[V]=="function"&&X)return X(fe,{depth:qr-Rt});if(Ms!=="symbol"&&typeof fe.inspect=="function")return fe.inspect()}if(he(fe)){var $a=[];return i&&i.call(fe,function(_e,Me){$a.push(Wi(Me,fe,!0)+" => "+Wi(_e,fe))}),yi("Map",t.call(fe),$a,on)}if(Oe(fe)){var Qr=[];return o&&o.call(fe,function(_e){Qr.push(Wi(_e,fe))}),yi("Set",a.call(fe),Qr,on)}if(Xe(fe))return Kt("WeakMap");if(it(fe))return Kt("WeakSet");if(Pe(fe))return Kt("WeakRef");if(H(fe))return Et(Wi(Number(fe)));if(z(fe))return Et(Wi(I.call(fe)));if(K(fe))return Et(p.call(fe));if(Ae(fe))return Et(Wi(String(fe)));if(typeof window<"u"&&fe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&fe===globalThis||typeof mh<"u"&&fe===mh)return"{ [object globalThis] }";if(!we(fe)&&!Re(fe)){var W=xi(fe,Wi),Y=D?D(fe)===Object.prototype:fe instanceof Object||fe.constructor===Object,J=fe instanceof Object?"":"null prototype",ie=!Y&&U&&Object(fe)===fe&&U in fe?b.call(ve(fe),8,-1):J?"Object":"",ue=Y||typeof fe.constructor!="function"?"":fe.constructor.name?fe.constructor.name+" ":"",pe=ue+(ie||J?"["+R.call(M.call([],ie||[],J||[]),": ")+"] ":"");return W.length===0?pe+"{}":on?pe+"{"+an(W,on)+"}":pe+"{ "+R.call(W,", ")+" }"}return String(fe)};function ne(ce,fe,It){var Rt=It.quoteStyle||fe,Zt=G[Rt];return Zt+ce+Zt}function Q(ce){return y.call(String(ce),/"/g,""")}function de(ce){return!U||!(typeof ce=="object"&&(U in ce||typeof ce[U]<"u"))}function me(ce){return ve(ce)==="[object Array]"&&de(ce)}function we(ce){return ve(ce)==="[object Date]"&&de(ce)}function Re(ce){return ve(ce)==="[object RegExp]"&&de(ce)}function ge(ce){return ve(ce)==="[object Error]"&&de(ce)}function Ae(ce){return ve(ce)==="[object String]"&&de(ce)}function H(ce){return ve(ce)==="[object Number]"&&de(ce)}function K(ce){return ve(ce)==="[object Boolean]"&&de(ce)}function q(ce){if(L)return ce&&typeof ce=="object"&&ce instanceof Symbol;if(typeof ce=="symbol")return!0;if(!ce||typeof ce!="object"||!O)return!1;try{return O.call(ce),!0}catch{}return!1}function z(ce){if(!ce||typeof ce!="object"||!I)return!1;try{return I.call(ce),!0}catch{}return!1}var ee=Object.prototype.hasOwnProperty||function(ce){return ce in this};function le(ce,fe){return ee.call(ce,fe)}function ve(ce){return m.call(ce)}function re(ce){if(ce.name)return ce.name;var fe=v.call(g.call(ce),/^function\s*([\w$]+)/);return fe?fe[1]:null}function ye(ce,fe){if(ce.indexOf)return ce.indexOf(fe);for(var It=0,Rt=ce.length;Itfe.maxStringLength){var It=ce.length-fe.maxStringLength,Rt="... "+It+" more character"+(It>1?"s":"");return Ct(b.call(ce,0,fe.maxStringLength),fe)+Rt}var Zt=j[fe.quoteStyle||"single"];Zt.lastIndex=0;var St=y.call(y.call(ce,Zt,"\\$1"),/[\x00-\x1f]/g,wt);return ne(St,"single",fe)}function wt(ce){var fe=ce.charCodeAt(0),It={8:"b",9:"t",10:"n",12:"f",13:"r"}[fe];return It?"\\"+It:"\\x"+(fe<16?"0":"")+w.call(fe.toString(16))}function Et(ce){return"Object("+ce+")"}function Kt(ce){return ce+" { ? }"}function yi(ce,fe,It,Rt){var Zt=Rt?an(It,Rt):R.call(It,", ");return ce+" ("+fe+") {"+Zt+"}"}function Bi(ce){for(var fe=0;fe=0)return!1;return!0}function Ls(ce,fe){var It;if(ce.indent===" ")It=" ";else if(typeof ce.indent=="number"&&ce.indent>0)It=R.call(Array(ce.indent+1)," ");else return null;return{base:It,prev:R.call(Array(fe+1),It)}}function an(ce,fe){if(ce.length===0)return"";var It=` -`+fe.prev+fe.base;return It+R.call(ce,","+It)+` -`+fe.prev}function xi(ce,fe){var It=me(ce),Rt=[];if(It){Rt.length=ce.length;for(var Zt=0;Zt"u"||!M?s:M(Uint8Array),L={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":T&&M?M([][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%":T&&M?M(M([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!M?s:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":b,"%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"||!T||!M?s:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&M?M(""[Symbol.iterator]()):s,"%Symbol%":T?Symbol:s,"%SyntaxError%":a,"%ThrowTypeError%":A,"%TypedArray%":O,"%TypeError%":o,"%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%":h,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet,"%Function.prototype.call%":I,"%Function.prototype.apply%":F,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":R,"%Math.abs%":l,"%Math.floor%":c,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":p,"%Math.sign%":m,"%Reflect.getPrototypeOf%":P};if(M)try{null.error}catch(Re){var U=M(M(Re));L["%Error.prototype%"]=U}var B=function Re(ge){var Ae;if(ge==="%AsyncFunction%")Ae=v("async function () {}");else if(ge==="%GeneratorFunction%")Ae=v("function* () {}");else if(ge==="%AsyncGeneratorFunction%")Ae=v("async function* () {}");else if(ge==="%AsyncGenerator%"){var H=Re("%AsyncGeneratorFunction%");H&&(Ae=H.prototype)}else if(ge==="%AsyncIteratorPrototype%"){var K=Re("%AsyncGenerator%");K&&M&&(Ae=M(K.prototype))}return L[ge]=Ae,Ae},D={__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"]},_=vu(),X=QT(),N=_.call(I,Array.prototype.concat),V=_.call(F,Array.prototype.splice),G=_.call(I,String.prototype.replace),j=_.call(I,String.prototype.slice),ne=_.call(I,RegExp.prototype.exec),Q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,de=/\\(\\)?/g,me=function(ge){var Ae=j(ge,0,1),H=j(ge,-1);if(Ae==="%"&&H!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(H==="%"&&Ae!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var K=[];return G(ge,Q,function(q,z,ee,le){K[K.length]=ee?G(le,de,"$1"):z||q}),K},we=function(ge,Ae){var H=ge,K;if(X(D,H)&&(K=D[H],H="%"+K[0]+"%"),X(L,H)){var q=L[H];if(q===k&&(q=B(H)),typeof q>"u"&&!Ae)throw new o("intrinsic "+ge+" exists, but is not available. Please file an issue!");return{alias:K,name:H,value:q}}throw new a("intrinsic "+ge+" does not exist!")};return Pd=function(ge,Ae){if(typeof ge!="string"||ge.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ae!="boolean")throw new o('"allowMissing" argument must be a boolean');if(ne(/^%?[^%]*%?$/,ge)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var H=me(ge),K=H.length>0?H[0]:"",q=we("%"+K+"%",Ae),z=q.name,ee=q.value,le=!1,ve=q.alias;ve&&(K=ve[0],V(H,N([0,1],ve)));for(var re=1,ye=!0;re=H.length){var Oe=b(ee,he);ye=!!Oe,ye&&"get"in Oe&&!("originalValue"in Oe.get)?ee=Oe.get:ee=ee[he]}else ye=X(ee,he),ee=ee[he];ye&&!le&&(L[z]=ee)}}return ee},Pd}var kd,T0;function Gx(){if(T0)return kd;T0=1;var s=fp(),e=$x(),t=e([s("%String.prototype.indexOf%")]);return kd=function(n,r){var a=s(n,!!r);return typeof a=="function"&&t(n,".prototype.")>-1?e([a]):a},kd}var Fd,A0;function Hx(){if(A0)return Fd;A0=1;var s=fp(),e=Gx(),t=gu(),i=Lo(),n=s("%Map%",!0),r=e("Map.prototype.get",!0),a=e("Map.prototype.set",!0),o=e("Map.prototype.has",!0),h=e("Map.prototype.delete",!0),l=e("Map.prototype.size",!0);return Fd=!!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=h(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?o(u,f):!1},set:function(f,p){u||(u=new n),a(u,f,p)}};return d},Fd}var Od,E0;function e2(){if(E0)return Od;E0=1;var s=fp(),e=Gx(),t=gu(),i=Hx(),n=Lo(),r=s("%WeakMap%",!0),a=e("WeakMap.prototype.get",!0),o=e("WeakMap.prototype.set",!0),h=e("WeakMap.prototype.has",!0),l=e("WeakMap.prototype.delete",!0);return Od=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?a(u,p):d&&d.get(p)},has:function(p){return r&&p&&(typeof p=="object"||typeof p=="function")&&u?h(u,p):!!d&&d.has(p)},set:function(p,m){r&&p&&(typeof p=="object"||typeof p=="function")?(u||(u=new r),o(u,p,m)):i&&(d||(d=i()),d.set(p,m))}};return f}:i,Od}var Bd,C0;function jx(){if(C0)return Bd;C0=1;var s=Lo(),e=gu(),t=RT(),i=Hx(),n=e2(),r=n||i||t;return Bd=function(){var o,h={assert:function(l){if(!h.has(l)){var c=l&&Object(l)===l?"the given object key":e(l);throw new s("Side channel does not contain "+c)}},delete:function(l){return!!o&&o.delete(l)},get:function(l){return o&&o.get(l)},has:function(l){return!!o&&o.has(l)},set:function(l,c){o||(o=r()),o.set(l,c)}};return h},Bd}var Ld,I0;function mp(){if(I0)return Ld;I0=1;var s=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Ld={default:t.RFC3986,formatters:{RFC1738:function(i){return s.call(i,e,"+")},RFC3986:function(i){return String(i)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Ld}var Dd,R0;function Wx(){if(R0)return Dd;R0=1;var s=mp(),e=jx(),t=Ux(),i=Object.prototype.hasOwnProperty,n=Array.isArray,r=e(),a=function(P,F){return r.set(P,F),P},o=function(P){return r.has(P)},h=function(P){return r.get(P)},l=function(P,F){r.set(P,F)},c=(function(){for(var R=[],P=0;P<256;++P)R[R.length]="%"+((P<16?"0":"")+P.toString(16)).toUpperCase();return R})(),u=function(P){for(;P.length>1;){var F=P.pop(),I=F.obj[F.prop];if(n(I)){for(var k=[],O=0;O=I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return a(d(P.concat(F),I),k)}P[k]=F}else if(P&&typeof P=="object")if(o(P)){var O=h(P)+1;P[O]=F,l(P,O)}else{if(I&&I.strictMerge)return[P,F];(I&&(I.plainObjects||I.allowPrototypes)||!i.call(Object.prototype,F))&&(P[F]=!0)}else return[P,F];return P}if(!P||typeof P!="object"){if(o(F)){for(var L=Object.keys(F),U=I&&I.plainObjects?{__proto__:null,0:P}:{0:P},B=0;BI.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return a(d(_,I),_.length-1)}return _}var X=P;if(n(P)&&!n(F)&&(X=d(P,I)),n(P)&&n(F)){if(F.forEach(function(N,V){if(i.call(P,V)){var G=P[V];G&&typeof G=="object"&&N&&typeof N=="object"?P[V]=R(G,N,I):P[P.length]=N}else P[V]=N}),I&&typeof I.arrayLimit=="number"&&P.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 a(d(P,I),P.length-1)}return P}return Object.keys(F).reduce(function(N,V){var G=F[V];if(i.call(N,V)?f(N,V,R(N[V],G,I)):f(N,V,G),o(F)&&!o(N)&&a(N,h(F)),o(N)){var j=parseInt(V,10);String(j)===V&&j>=0&&j>h(N)&&l(N,j)}return N},X)},m=function(P,F){return Object.keys(F).reduce(function(I,k){return f(I,k,F[k]),I},P)},g=function(R,P,F){var I=R.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,b=function(P,F,I,k,O){if(P.length===0)return P;var L=P;if(typeof P=="symbol"?L=Symbol.prototype.toString.call(P):typeof P!="string"&&(L=String(P)),I==="iso-8859-1")return escape(L).replace(/%u[0-9a-f]{4}/gi,function(G){return"%26%23"+parseInt(G.slice(2),16)+"%3B"});for(var U="",B=0;B=v?L.slice(B,B+v):L;if(B+v=55296&&_<=56319&&(D=D.slice(0,-1),B-=1)}for(var X=[],N=0;N=48&&V<=57||V>=65&&V<=90||V>=97&&V<=122||O===s.RFC1738&&(V===40||V===41)){X[X.length]=D.charAt(N);continue}if(V<128){X[X.length]=c[V];continue}if(V<2048){X[X.length]=c[192|V>>6]+c[128|V&63];continue}if(V<55296||V>=57344){X[X.length]=c[224|V>>12]+c[128|V>>6&63]+c[128|V&63];continue}N+=1,V=65536+((V&1023)<<10|D.charCodeAt(N)&1023),X[X.length]=c[240|V>>18]+c[128|V>>12&63]+c[128|V>>6&63]+c[128|V&63]}U+=X.join("")}return U},y=function(P){for(var F=[{obj:{o:P},prop:"o"}],I=e(),k=0;kI){if(O)throw new RangeError("Array limit exceeded. Only "+I+" element"+(I===1?"":"s")+" allowed in an array.");return a(d(U,{plainObjects:k}),U.length-1)}return U},M=function(P,F){if(n(P)){for(var I=[],k=0;k"u"&&(N=0)}if(typeof P=="function"?_=P(v,_):_ instanceof Date?_=k(_):b==="comma"&&r(_)&&(_=e.maybeMap(_,function(z){return z instanceof Date?k(z):z})),_===null){if(A)return L(R&&!U?R(v,c.encoder,B,"key",O):v);_=""}if(u(_)||e.isBuffer(_)){if(R){var j=U?v:R(v,c.encoder,B,"key",O);return[L(j)+"="+L(R(_,c.encoder,B,"value",O))]}return[L(v)+"="+L(String(_))]}var ne=[];if(typeof _>"u")return ne;var Q;if(b==="comma"&&r(_))U&&R&&(_=e.maybeMap(_,function(z){return z==null?z:R(z)})),Q=[{value:_.length>0?_.join(",")||null:void 0}];else if(r(P))Q=P;else{var de=Object.keys(_);Q=F?de.sort(F):de}var me=M?String(v).replace(/\./g,"%2E"):String(v),we=y&&r(_)&&_.length===1?me+"[]":me;if(w&&r(_)&&_.length===0)return we+"[]";for(var Re=0;Re"u"?g.encodeDotInKeys===!0?!0:c.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:c.addQueryPrefix,allowDots:T,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:A,charset:v,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?c.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:c.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:c.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:c.encodeValuesOnly,filter:w,format:b,formatter:y,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:c.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:c.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:c.strictNullHandling}};return Nd=function(m,g){var v=m,b=p(g),y,w;typeof b.filter=="function"?(w=b.filter,v=w("",v)):r(b.filter)&&(w=b.filter,y=w);var A=[];if(typeof v!="object"||v===null)return"";var T=n[b.arrayFormat],M=T==="comma"&&b.commaRoundTrip;y||(y=Object.keys(v)),b.sort&&y.sort(b.sort);for(var R=s(),P=0;P"u"||F===null)){var I=v[F];b.skipNulls&&I===null||o(A,f(I,F,T,M,b.allowEmptyArrays,b.strictNullHandling,b.skipNulls,b.encodeDotInKeys,b.encode?b.encoder:null,b.filter,b.sort,b.allowDots,b.serializeDate,b.format,b.formatter,b.encodeValuesOnly,b.charset,R))}}var k=A.join(b.delimiter),O=b.addQueryPrefix===!0?"?":"";return b.charsetSentinel&&(b.charset==="iso-8859-1"?O+="utf8=%26%2310003%3B"+b.delimiter:O+="utf8=%E2%9C%93"+b.delimiter),k.length>0?O+k:""},Nd}var Ud,k0;function i2(){if(k0)return Ud;k0=1;var s=Wx(),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,b=f.indexOf(",");b>-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.");b=f.indexOf(",",b+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},a="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",h=function(p,m){var g={__proto__:null},v=m.ignoreQueryPrefix?p.replace(/^\?/,""):p;v=v.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=m.parameterLimit===1/0?void 0:m.parameterLimit,y=v.split(m.delimiter,m.throwOnLimitExceeded&&typeof b<"u"?b+1:b);if(m.throwOnLimitExceeded&&typeof b<"u"&&y.length>b)throw new RangeError("Parameter limit exceeded. Only "+b+" parameter"+(b===1?"":"s")+" allowed.");var w=-1,A,T=m.charset;if(m.charsetSentinel)for(A=0;A-1&&(I=t(I)?[I]:I),m.comma&&t(I)&&I.length>m.arrayLimit&&(I=s.combine([],I,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded)),F!==null){var k=e.call(g,F);k&&(m.duplicates==="combine"||M.indexOf("[]=")>-1)?g[F]=s.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 b=f.slice(0,-1).join("");v=Array.isArray(p)&&p[b]?p[b].length:0}for(var y=g?p:r(p,m,v),w=f.length-1;w>=0;--w){var A,T=f[w];if(T==="[]"&&m.parseArrays)s.isOverflow(y)?A=y:A=m.allowEmptyArrays&&(y===""||m.strictNullHandling&&y===null)?[]:s.combine([],y,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded);else{A=m.plainObjects?{__proto__:null}:{};var M=T.charAt(0)==="["&&T.charAt(T.length-1)==="]"?T.slice(1,-1):T,R=m.decodeDotInKeys?M.replace(/%2E/g,"."):M,P=parseInt(R,10),F=!isNaN(P)&&T!==R&&String(P)===R&&P>=0&&m.parseArrays;if(!m.parseArrays&&R==="")A={0:y};else if(F&&P=0?g.slice(0,b):g;if(y){if(!m.plainObjects&&e.call(Object.prototype,y)&&!m.allowPrototypes)return;v[v.length]=y}for(var w=g.length,A=b,T=0;A>=0&&T=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 b=c(p,g);if(b)return l(b,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 Ud=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"?h(f,m):f,v=m.plainObjects?{__proto__:null}:{},b=Object.keys(g),y=0;y",'"',"`"," ","\r",` -`," "],a=["{","}","|","\\","^","`"].concat(r),o=["'"].concat(a),h=["%","/","?",";","#"].concat(o),l=["/","?","#"],c=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=s2();function v(A,T,M){if(A&&typeof A=="object"&&A instanceof e)return A;var R=new e;return R.parse(A,T,M),R}e.prototype.parse=function(A,T,M){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var R=A.indexOf("?"),P=R!==-1&&R127?de+="x":de+=Q[me];if(!de.match(u)){var Re=j.slice(0,_),ge=j.slice(_+1),Ae=Q.match(d);Ae&&(Re.push(Ae[1]),ge.unshift(Ae[2])),ge.length&&(k="/"+ge.join(".")+k),this.hostname=Re.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),G||(this.hostname=s.toASCII(this.hostname));var H=this.port?":"+this.port:"",K=this.hostname||"";this.host=K+H,this.href+=this.host,G&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),k[0]!=="/"&&(k="/"+k))}if(!f[U])for(var _=0,ne=o.length;_0?M.host.split("@"):!1;de&&(M.auth=de.shift(),M.hostname=de.shift(),M.host=M.hostname)}return M.search=A.search,M.query=A.query,(M.pathname!==null||M.search!==null)&&(M.path=(M.pathname?M.pathname:"")+(M.search?M.search:"")),M.href=M.format(),M}if(!j.length)return M.pathname=null,M.search?M.path="/"+M.search:M.path=null,M.href=M.format(),M;for(var me=j.slice(-1)[0],we=(M.host||A.host||j.length>1)&&(me==="."||me==="..")||me==="",Re=0,ge=j.length;ge>=0;ge--)me=j[ge],me==="."?j.splice(ge,1):me===".."?(j.splice(ge,1),Re++):Re&&(j.splice(ge,1),Re--);if(!V&&!G)for(;Re--;Re)j.unshift("..");V&&j[0]!==""&&(!j[0]||j[0].charAt(0)!=="/")&&j.unshift(""),we&&j.join("/").substr(-1)!=="/"&&j.push("");var Ae=j[0]===""||j[0]&&j[0].charAt(0)==="/";if(Q){M.hostname=Ae?"":j.length?j.shift():"",M.host=M.hostname;var de=M.host&&M.host.indexOf("@")>0?M.host.split("@"):!1;de&&(M.auth=de.shift(),M.hostname=de.shift(),M.host=M.hostname)}return V=V||M.host&&j.length,V&&!Ae&&j.unshift(""),j.length>0?M.pathname=j.join("/"):(M.pathname=null,M.path=null),(M.pathname!==null||M.search!==null)&&(M.path=(M.pathname?M.pathname:"")+(M.search?M.search:"")),M.auth=A.auth||M.auth,M.slashes=M.slashes||A.slashes,M.href=M.format(),M},e.prototype.parseHost=function(){var A=this.host,T=i.exec(A);T&&(T=T[0],T!==":"&&(this.port=T.substr(1)),A=A.substr(0,A.length-T.length)),A&&(this.hostname=A)},ra.parse=v,ra.resolve=y,ra.resolveObject=w,ra.format=b,ra.Url=e,ra}n2();const B0={};function kt(s,e,t=3){if(B0[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))),B0[e]=!0}function Xs(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function Wo(s){return s.split("?")[0].split("#")[0]}function r2(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a2(s,e,t){return s.replace(new RegExp(r2(e),"g"),t)}function o2(s,e){let t="",i=0,n=-1,r=0,a=-1;for(let o=0;o<=s.length;++o){if(o2){const h=t.lastIndexOf("/");if(h!==t.length-1){h===-1?(t="",i=0):(t=t.slice(0,h),i=t.length-1-t.lastIndexOf("/")),n=o,r=0;continue}}else if(t.length===2||t.length===1){t="",i=0,n=o,r=0;continue}}}else t.length>0?t+=`/${s.slice(n+1,o)}`:t=s.slice(n+1,o),i=o-n-1;n=o,r=0}else a===46&&r!==-1?++r:r=-1}return t}const Si={toPosix(s){return a2(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=Wo(this.toPosix(e??We.ADAPTER.getBaseUrl())),n=Wo(this.toPosix(t??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?Si.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=o2(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),a=s;s=s.slice(r.length);for(let o=s.length-1;o>=1;--o)if(e=s.charCodeAt(o),e===47){if(!n){i=o;break}}else n=!1;return i===-1?t?"/":this.isUrl(a)?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=Wo(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 a=e.length-1,o=-1;for(r=s.length-1;r>=0;--r){const h=s.charCodeAt(r);if(h===47){if(!n){t=r+1;break}}else o===-1&&(n=!1,o=r+1),a>=0&&(h===e.charCodeAt(a)?--a===-1&&(i=r):(a=-1,i=o))}return t===i?i=o: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=Wo(this.toPosix(s));let e=-1,t=0,i=-1,n=!0,r=0;for(let a=s.length-1;a>=0;--a){const o=s.charCodeAt(a);if(o===47){if(!n){t=a+1;break}continue}i===-1&&(n=!1,i=a+1),o===46?e===-1?e=a: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=Wo(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,a=0,o=-1,h=!0,l=s.length-1,c=0;for(;l>=n;--l){if(t=s.charCodeAt(l),t===47){if(!h){a=l+1;break}continue}o===-1&&(h=!1,o=l+1),t===46?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===a+1?o!==-1&&(a===0&&i?e.base=e.name=s.slice(1,o):e.base=e.name=s.slice(a,o)):(a===0&&i?(e.name=s.slice(1,r),e.base=s.slice(1,o)):(e.name=s.slice(a,r),e.base=s.slice(a,o)),e.ext=s.slice(r,o)),e.dir=this.dirname(s),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Vd;async function l2(){return Vd??(Vd=(async()=>{var r;const s=document.createElement("canvas").getContext("webgl");if(!s)return Xi.UNPACK;const e=await new Promise(a=>{const o=document.createElement("video");o.onloadeddata=()=>a(o),o.onerror=()=>a(null),o.autoplay=!1,o.crossOrigin="anonymous",o.preload="auto",o.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",o.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})()),Vd}let Yd;function c2(){return typeof Yd>"u"&&(Yd=(function(){var e;const s={stencil:!0,failIfMajorPerformanceCaveat:We.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!We.ADAPTER.getWebGLRenderingContext())return!1;const t=We.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}})()),Yd}var h2={grad:.9,turn:360,rad:360/(2*Math.PI)},Yn=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},Ui=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*s)/t+0},Fs=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),s>t?t:s>e?s:e},zx=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},L0=function(s){return{r:Fs(s.r,0,255),g:Fs(s.g,0,255),b:Fs(s.b,0,255),a:Fs(s.a)}},$d=function(s){return{r:Ui(s.r),g:Ui(s.g),b:Ui(s.b),a:Ui(s.a,3)}},u2=/^#([0-9a-f]{3,8})$/i,lc=function(s){var e=s.toString(16);return e.length<2?"0"+e:e},qx=function(s){var e=s.r,t=s.g,i=s.b,n=s.a,r=Math.max(e,t,i),a=r-Math.min(e,t,i),o=a?r===e?(t-i)/a:r===t?2+(i-e)/a:4+(e-t)/a:0;return{h:60*(o<0?o+6:o),s:r?a/r*100:0,v:r/255*100,a:n}},Kx=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),a=i*(1-t),o=i*(1-(e-r)*t),h=i*(1-(1-e+r)*t),l=r%6;return{r:255*[i,o,a,a,h,i][l],g:255*[h,i,i,o,a,a][l],b:255*[a,a,h,i,i,o][l],a:n}},D0=function(s){return{h:zx(s.h),s:Fs(s.s,0,100),l:Fs(s.l,0,100),a:Fs(s.a)}},N0=function(s){return{h:Ui(s.h),s:Ui(s.s),l:Ui(s.l),a:Ui(s.a,3)}},U0=function(s){return Kx((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},gl=function(s){return{h:(e=qx(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},d2=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,f2=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m2=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p2=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yf={string:[[function(s){var e=u2.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?Ui(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?Ui(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var e=m2.exec(s)||p2.exec(s);return e?e[2]!==e[4]||e[4]!==e[6]?null:L0({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=d2.exec(s)||f2.exec(s);if(!e)return null;var t,i,n=D0({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(h2[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return U0(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 Yn(e)&&Yn(t)&&Yn(i)?L0({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(!Yn(e)||!Yn(t)||!Yn(i))return null;var a=D0({h:Number(e),s:Number(t),l:Number(i),a:Number(r)});return U0(a)},"hsl"],[function(s){var e=s.h,t=s.s,i=s.v,n=s.a,r=n===void 0?1:n;if(!Yn(e)||!Yn(t)||!Yn(i))return null;var a=(function(o){return{h:zx(o.h),s:Fs(o.s,0,100),v:Fs(o.v,0,100),a:Fs(o.a)}})({h:Number(e),s:Number(t),v:Number(i),a:Number(r)});return Kx(a)},"hsv"]]},X0=function(s,e){for(var t=0;t=.5},s.prototype.toHex=function(){return e=$d(this.rgba),t=e.r,i=e.g,n=e.b,a=(r=e.a)<1?lc(Ui(255*r)):"","#"+lc(t)+lc(i)+lc(n)+a;var e,t,i,n,r,a},s.prototype.toRgb=function(){return $d(this.rgba)},s.prototype.toRgbString=function(){return e=$d(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 N0(gl(this.rgba))},s.prototype.toHslString=function(){return e=N0(gl(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=qx(this.rgba),{h:Ui(e.h),s:Ui(e.s),v:Ui(e.v),a:Ui(e.a,3)};var e},s.prototype.invert=function(){return un({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),un(Gd(this.rgba,e))},s.prototype.desaturate=function(e){return e===void 0&&(e=.1),un(Gd(this.rgba,-e))},s.prototype.grayscale=function(){return un(Gd(this.rgba,-1))},s.prototype.lighten=function(e){return e===void 0&&(e=.1),un(V0(this.rgba,e))},s.prototype.darken=function(e){return e===void 0&&(e=.1),un(V0(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"?un({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Ui(this.rgba.a,3);var t},s.prototype.hue=function(e){var t=gl(this.rgba);return typeof e=="number"?un({h:e,s:t.s,l:t.l,a:t.a}):Ui(t.h)},s.prototype.isEqual=function(e){return this.toHex()===un(e).toHex()},s})(),un=function(s){return s instanceof $f?s:new $f(s)},Y0=[],v2=function(s){s.forEach(function(e){Y0.indexOf(e)<0&&(e($f,Yf),Y0.push(e))})};function y2(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(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,h,l=i[this.toHex()];if(l)return l;if(a!=null&&a.closest){var c=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=(o=c,h=r[p],Math.pow(o.r-h.r,2)+Math.pow(o.g-h.g,2)+Math.pow(o.b-h.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(a=>e[a]===t[a])}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]=Yc.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 a=e;t=(a>>16&255)/255,i=(a>>8&255)/255,n=(a&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 o=Yc.HEX_PATTERN.exec(e);o&&(e=`#${o[2]}`)}const a=un(e);a.isValid()&&({r:t,g:i,b:n,a:r}=a.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)}};io.shared=new io,io.temp=new io,io.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Wt=io;function x2(s){return kt("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Wt.shared.setValue(s).toHex()}function b2(s){return kt("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Wt.shared.setValue(s).toNumber()}function w2(){const s=[],e=[];for(let i=0;i<32;i++)s[i]=i,e[i]=i;s[ut.NORMAL_NPM]=ut.NORMAL,s[ut.ADD_NPM]=ut.ADD,s[ut.SCREEN_NPM]=ut.SCREEN,e[ut.NORMAL]=ut.NORMAL_NPM,e[ut.ADD]=ut.ADD_NPM,e[ut.SCREEN]=ut.SCREEN_NPM;const t=[];return t.push(e),t.push(s),t}const Zx=w2();function Jx(s,e){return Zx[e?1:0][s]}function S2(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 $0(s){return!(s&s-1)&&!!s}function G0(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 yo(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))(He||{});const Hf=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},q0=(s,e)=>Hf(s).priority??e,tt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(Hf).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(Hf).forEach(e=>{e.type.forEach(t=>{var r,a;const i=this._addHandlers,n=this._queue;i[t]?(r=i[t])==null||r.call(i,e):(n[t]=n[t]||[],(a=n[t])==null||a.push(e))})}),this},handle(s,e,t){var a;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]&&((a=r[s])==null||a.forEach(o=>e(o)),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)=>q0(r,t)-q0(n,t)))},i=>{const n=e.indexOf(i.ref);n!==-1&&e.splice(n,1)})}};class jf{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 C2=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` -`);function I2(s){let e="";for(let t=0;t0&&(e+=` -else `),t=0;--i){const n=Wf[i];if(n.test&&n.test(s,t))return new n(s,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Js{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,t,i,n,r,a,o,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:c}=this;this._aliasCount++;for(let u=0,d=c.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(Js.prototype,{dispatch:{value:Js.prototype.emit},run:{value:Js.prototype.emit}});class Bl{constructor(e=0,t=0){this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Js("setRealSize"),this.onUpdate=new Js("update"),this.onError=new Js("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 yu extends Bl{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,a=t.realHeight;return i.width===r&&i.height===a?n.texSubImage2D(t.target,0,0,0,r,a,t.format,i.type,this.data):(i.width=r,i.height=a,n.texImage2D(t.target,0,i.internalFormat,r,a,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 P2={scaleMode:zs.NEAREST,alphaMode:Xi.NPM},zf=class so extends jl{constructor(e=null,t=null){super(),t=Object.assign({},so.defaultOptions,t);const{alphaMode:i,mipmap:n,anisotropicLevel:r,scaleMode:a,width:o,height:h,wrapMode:l,format:c,type:u,target:d,resolution:f,resourceOptions:p}=t;e&&!(e instanceof Bl)&&(e=eb(e,p),e.internal=!0),this.resolution=f||We.RESOLUTION,this.width=Math.round((o||0)*this.resolution)/this.resolution,this.height=Math.round((h||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=r,this._wrapMode=l,this._scaleMode=a,this.format=c,this.type=u,this.target=d,this.alphaMode=i,this.uid=ka(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=o>0&&h>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=$0(this.realWidth)&&$0(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 xr[this.cacheId],delete dn[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),so.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=We.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else{if(!e._pixiId){const o=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${ka()}`}r=e._pixiId}let a=xr[r];if(n&&i&&!a)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return a||(a=new so(e,t),a.cacheId=r,so.addToCache(a,r)),a}static fromBuffer(e,t,i,n){e=e||new Float32Array(t*i*4);const r=new yu(e,{width:t,height:i,...n==null?void 0:n.resourceOptions});let a,o;return e instanceof Float32Array?(a=De.RGBA,o=et.FLOAT):e instanceof Int32Array?(a=De.RGBA_INTEGER,o=et.INT):e instanceof Uint32Array?(a=De.RGBA_INTEGER,o=et.UNSIGNED_INT):e instanceof Int16Array?(a=De.RGBA_INTEGER,o=et.SHORT):e instanceof Uint16Array?(a=De.RGBA_INTEGER,o=et.UNSIGNED_SHORT):e instanceof Int8Array?(a=De.RGBA,o=et.BYTE):(a=De.RGBA,o=et.UNSIGNED_BYTE),r.internal=!0,new so(r,Object.assign({},P2,{type:o,format:a},n))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),xr[t]&&xr[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),xr[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=xr[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete xr[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))(Hi||{});class Xt{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new Xt(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}}Xt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const cc=[new Xt,new Xt,new Xt,new Xt];class Tt{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=Hi.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 Tt(0,0,0,0)}clone(){return new Tt(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)<=R)return!1;const P=this.ye.bottom?e.bottom:this.bottom)>P}const i=this.left,n=this.right,r=this.top,a=this.bottom;if(n<=i||a<=r)return!1;const o=cc[0].set(e.left,e.top),h=cc[1].set(e.left,e.bottom),l=cc[2].set(e.right,e.top),c=cc[3].set(e.right,e.bottom);if(l.x<=o.x||h.y<=o.y)return!1;const u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(o,o),t.apply(h,h),t.apply(l,l),t.apply(c,c),Math.max(o.x,h.x,l.x,c.x)<=i||Math.min(o.x,h.x,l.x,c.x)>=n||Math.max(o.y,h.y,l.y,c.y)<=r||Math.min(o.y,h.y,l.y,c.y)>=a))return!1;const d=u*(h.y-o.y),f=u*(o.x-h.x),p=d*i+f*r,m=d*n+f*r,g=d*i+f*a,v=d*n+f*a;if(Math.max(p,m,g,v)<=d*o.x+f*o.y||Math.min(p,m,g,v)>=d*c.x+f*c.y)return!1;const b=u*(o.y-l.y),y=u*(l.x-o.x),w=b*i+y*r,A=b*n+y*r,T=b*i+y*a,M=b*n+y*a;return!(Math.max(w,A,T,M)<=b*o.x+y*o.y||Math.min(w,A,T,M)>=b*c.x+y*c.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}}Tt.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class xu{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.radius=i,this.type=Hi.CIRC}clone(){return new xu(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 Tt(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}xu.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class bu{constructor(e=0,t=0,i=0,n=0){this.x=e,this.y=t,this.width=i,this.height=n,this.type=Hi.ELIP}clone(){return new bu(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 Tt(this.x-this.width,this.y-this.height,this.width,this.height)}}bu.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Ea{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!=c>t&&e<(l-o)*((t-h)/(c-h))+o&&(i=!i)}return i}}Ea.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((s,e)=>`${s}, ${e}`,"")}]`};class wu{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=Hi.RREC}clone(){return new wu(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 a=i*i;if(n*n+r*r<=a||(n=e-(this.x+this.width-i),n*n+r*r<=a)||(r=t-(this.y+this.height-i),n*n+r*r<=a)||(n=e-(this.x+i),n*n+r*r<=a))return!0}return!1}}wu.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class li{constructor(e=1,t=0,i=0,n=1,r=0,a=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=a}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,a){return this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=a,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 Xt;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 Xt;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,a=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=a*t-this.ty*i,this.ty=a*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,a,o,h,l){return this.a=Math.cos(o+l)*r,this.b=Math.sin(o+l)*r,this.c=-Math.sin(o-h)*a,this.d=Math.cos(o-h)*a,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,a=e.pivot,o=-Math.atan2(-n,r),h=Math.atan2(i,t),l=Math.abs(o+h);return l<1e-5||Math.abs(vh-l)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=h),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(n*n+r*r),e.position.x=this.tx+(a.x*t+a.y*n),e.position.y=this.ty+(a.x*i+a.y*r),e}invert(){const e=this.a,t=this.b,i=this.c,n=this.d,r=this.tx,a=e*n-t*i;return this.a=n/a,this.b=-t/a,this.c=-i/a,this.d=e/a,this.tx=(i*this.ty-n*r)/a,this.ty=-(e*this.ty-t*r)/a,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 li;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 li}static get TEMP_MATRIX(){return new li}}li.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 ha=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],ua=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],da=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],fa=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Kf=[],ib=[],hc=Math.sign;function U2(){for(let s=0;s<16;s++){const e=[];Kf.push(e);for(let t=0;t<16;t++){const i=hc(ha[s]*ha[t]+da[s]*ua[t]),n=hc(ua[s]*ha[t]+fa[s]*ua[t]),r=hc(ha[s]*da[t]+da[s]*fa[t]),a=hc(ua[s]*da[t]+fa[s]*fa[t]);for(let o=0;o<16;o++)if(ha[o]===i&&ua[o]===n&&da[o]===r&&fa[o]===a){e.push(o);break}}}for(let s=0;s<16;s++){const e=new li;e.set(ha[s],ua[s],da[s],fa[s],0,0),ib.push(e)}}U2();const fi={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=>ha[s],uY:s=>ua[s],vX:s=>da[s],vY:s=>fa[s],inv:s=>s&8?s&15:-s&7,add:(s,e)=>Kf[s][e],sub:(s,e)=>Kf[s][fi.inv(e)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,e)=>Math.abs(s)*2<=Math.abs(e)?e>=0?fi.S:fi.N:Math.abs(e)*2<=Math.abs(s)?s>0?fi.E:fi.W:e>0?s>0?fi.SE:fi.SW:s>0?fi.NE:fi.NW,matrixAppendRotationInv:(s,e,t=0,i=0)=>{const n=ib[fi.inv(e)];n.tx=t,n.ty=i,s.append(n)}};class er{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 er(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))}}er.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Zf=class{constructor(){this.worldTransform=new li,this.localTransform=new li,this.position=new er(this.onChange,this,0,0),this.scale=new er(this.onChange,this,1,1),this.pivot=new er(this.onChange,this,0,0),this.skew=new er(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())}};Zf.IDENTITY=new Zf;let pp=Zf;pp.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 X2=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; - -void main(void){ - gl_FragColor *= texture2D(uSampler, vTextureCoord); -}`,V2=`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 Z0(s,e,t){const i=s.createShader(e);return s.shaderSource(i,t),s.compileShader(i),i}function Jd(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]) - }`}],Y2={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); - }`},$2={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 G2(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 a=s.uniforms[n];let o=!1;for(let h=0;h=Na.WEBGL2&&(e=s.getContext("webgl2",{})),e||(e=s.getContext("webgl",{})||s.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),za=e}return za}let uc;function j2(){if(!uc){uc=ks.MEDIUM;const s=H2();if(s&&s.getShaderPrecisionFormat){const e=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);e&&(uc=e.precision?ks.HIGH:ks.MEDIUM)}}return uc}function J0(s,e){const t=s.getShaderSource(e).split(` -`).map((l,c)=>`${c}: ${l}`),i=s.getShaderInfoLog(e),n=i.split(` -`),r={},a=n.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!r[l]?(r[l]=!0,!0):!1),o=[""];a.forEach(l=>{t[l-1]=`%c${t[l-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const h=t.join(` -`);o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function W2(s,e,t,i){s.getProgramParameter(e,s.LINK_STATUS)||(s.getShaderParameter(t,s.COMPILE_STATUS)||J0(s,t),s.getShaderParameter(i,s.COMPILE_STATUS)||J0(s,i),console.error("PixiJS Error: Could not initialize shader."),s.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",s.getProgramInfoLog(e)))}const z2={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 rb(s){return z2[s]}let dc=null;const Q0={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 ab(s,e){if(!dc){const t=Object.keys(Q0);dc={};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=$s._textureArrayPool,n=this.renderer.batch,r=this._tempBoundTextures,a=this.renderer.textureGC.count;let o=++gt._globalBatch,h=0,l=i[0],c=0;n.copyBoundTextures(r,t);for(let u=0;u=t&&(n.boundArray(l,r,o,t),this.buildDrawCalls(l,c,u),c=u,l=i[++h],++o),d._batchEnabled=o,d.touched=a,l.elements[l.count++]=d)}l.count>0&&(n.boundArray(l,r,o,t),this.buildDrawCalls(l,c,this._bufferSize),++h,++o);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:a,count:o}=e;let h=0;for(let l=0;l=0&&u=Na.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")}}xh.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},xh.extension={type:He.RendererSystem,name:"context"};tt.add(xh);class tm{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 Js("disposeFramebuffer"),this.multisample=Ci.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,t){return this.colorTextures[e]=t||new gt(null,{scaleMode:zs.NEAREST,resolution:1,mipmap:Bs.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new gt(null,{scaleMode:zs.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Bs.OFF,format:De.DEPTH_COMPONENT,type:et.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=a=>{i(a),this.onError.emit(a)})}),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 a in r){const o=r[a];if(o!==i&&o.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 gp{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 a=e.width/2/n,o=e.height/2/r,h=e.x/n+a,l=e.y/r+o;i=fi.add(i,fi.NW),this.x0=h+a*fi.uX(i),this.y0=l+o*fi.uY(i),i=fi.add(i,2),this.x1=h+a*fi.uX(i),this.y1=l+o*fi.uY(i),i=fi.add(i,2),this.x2=h+a*fi.uX(i),this.y2=l+o*fi.uY(i),i=fi.add(i,2),this.x3=h+a*fi.uX(i),this.y3=l+o*fi.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}}gp.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 iv=new gp;function mc(s){s.destroy=function(){},s.on=function(){},s.once=function(){},s.emit=function(){}}let mt=class ni extends jl{constructor(e,t,i,n,r,a,o){if(super(),this.noFrame=!1,t||(this.noFrame=!0,t=new Tt(0,0,1,1)),e instanceof ni&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=n,this.valid=!1,this.destroyed=!1,this._uvs=iv,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=a?new Xt(a.x,a.y):new Xt(0,0),this.defaultBorders=o,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&&dn[t.url]&&ni.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,ni.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 ni(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===iv&&(this._uvs=new gp),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,t={},i=We.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else if(e instanceof gt){if(!e.cacheId){const o=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e.cacheId=`${o}-${ka()}`,gt.addToCache(e,e.cacheId)}r=e.cacheId}else{if(!e._pixiId){const o=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${ka()}`}r=e._pixiId}let a=dn[r];if(n&&i&&!a)throw new Error(`The cacheId "${r}" does not exist in TextureCache.`);return!a&&!(e instanceof gt)?(t.resolution||(t.resolution=dr(e)),a=new ni(new gt(e,t)),a.baseTexture.cacheId=r,gt.addToCache(a.baseTexture,r),ni.addToCache(a,r)):!a&&e instanceof gt&&(a=new ni(e),ni.addToCache(a,r)),a}static fromURL(e,t){const i=Object.assign({autoLoad:!1},t==null?void 0:t.resourceOptions),n=ni.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 ni(gt.fromBuffer(e,t,i,n))}static fromLoader(e,t,i,n){const r=new gt(e,Object.assign({scaleMode:gt.defaultOptions.scaleMode,resolution:dr(t)},n)),{resource:a}=r;a instanceof hb&&(a.url=t);const o=new ni(r);return i||(i=t),gt.addToCache(o.baseTexture,i),ni.addToCache(o,i),i!==t&&(gt.addToCache(o.baseTexture,t),ni.addToCache(o,t)),o.baseTexture.valid?Promise.resolve(o):new Promise(h=>{o.baseTexture.once("loaded",()=>h(o))})}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),dn[t]&&dn[t]!==e&&console.warn(`Texture added to the cache with an id [${t}] that already had an entry`),dn[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=dn[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete dn[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;tthis.baseTexture.width,o=i+r>this.baseTexture.height;if(a||o){const h=a&&o?"and":"or",l=`X: ${t} + ${n} = ${t+n} > ${this.baseTexture.width}`,c=`Y: ${i} + ${r} = ${i+r} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${h} ${c}`)}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 ni._EMPTY||(ni._EMPTY=new ni(new gt),mc(ni._EMPTY),mc(ni._EMPTY.baseTexture)),ni._EMPTY}static get WHITE(){if(!ni._WHITE){const e=We.ADAPTER.createCanvas(16,16),t=e.getContext("2d");e.width=16,e.height=16,t.fillStyle="white",t.fillRect(0,0,16,16),ni._WHITE=new ni(gt.from(e)),mc(ni._WHITE),mc(ni._WHITE.baseTexture)}return ni._WHITE}};class Ua extends mt{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,a=Math.round(t*n)/n;this.valid=r>0&&a>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=a,i&&this.baseTexture.resize(r,a),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 Ua(new cb(e))}}class ub{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,t,i=Ci.NONE){const n=new cb(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new Ua(n)}getOptimalTexture(e,t,i=1,n=Ci.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=ph(e),t=ph(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 a=this.texturePool[r].pop();return a||(a=this.createTexture(e,t,n)),a.filterPoolKey=r,a.setResolution(i),a}getFilterTexture(e,t,i){const n=this.getOptimalTexture(e.width,e.height,t||e.resolution,i||Ci.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&&(c=this.getOptimalFilterTexture(l.width,l.height,t.resolution),c.filterFrame=l.filterFrame),i[u].apply(this,l,c,Tn.CLEAR,t);const d=l;l=c,c=d}i[u].apply(this,l,h.renderTexture,Tn.BLEND,t),u>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}t.clear(),this.statePool.push(t)}bindAndClear(e,t=Tn.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 a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,i.bind(e,e.filterFrame,a)}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===Tn.CLEAR||t===Tn.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(Cn.TRIANGLES)):(r.geometry.bind(this.quad),r.geometry.draw(Cn.TRIANGLE_STRIP))}calculateSpriteMatrix(e,t){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:r}=t._texture,a=e.set(n.width,0,0,n.height,i.x,i.y),o=t.worldTransform.copyTo(li.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/r.width,1/r.height),a.translate(t.anchor.x,t.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,t,i=1,n=Ci.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||Ci.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=pc[0],n=pc[1],r=pc[2],a=pc[3];i.set(t.left,t.top),n.set(t.left,t.bottom),r.set(t.right,t.top),a.set(t.right,t.bottom),e.apply(i,i),e.apply(n,n),e.apply(r,r),e.apply(a,a);const o=Math.min(i.x,n.x,r.x,a.x),h=Math.min(i.y,n.y,r.y,a.y),l=Math.max(i.x,n.x,r.x,a.x),c=Math.max(i.y,n.y,r.y,a.y);t.x=o,t.y=h,t.width=l-o,t.height=c-h}roundFrame(e,t,i,n,r){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(r){const{a,b:o,c:h,d:l}=r;if((Math.abs(o)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(l)>1e-4))return}r=r?Qd.copyFrom(r):Qd.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)}}}fb.extension={type:He.RendererSystem,name:"filter"};tt.add(fb);class aA{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Ci.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const oA=new Tt;class mb{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new tm(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 Tt,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let t=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;We.PREFER_ENV===Na.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 a=0;a>i,o=t.height>>i,h=a/t.width;this.setViewport(t.x*h,t.y*h,a,o)}else{const a=e.width>>i,o=e.height>>i;this.setViewport(0,0,a,o)}}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=Vf.COLOR|Vf.DEPTH){const{gl:a}=this;a.clearColor(e,t,i,n),a.clear(r)}initFramebuffer(e){const{gl:t}=this,i=new aA(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 a;this.renderer.context.webGLVersion===1?a=t.DEPTH_STENCIL:e.depth&&e.stencil?a=t.DEPTH24_STENCIL8:e.depth?a=t.DEPTH_COMPONENT24:a=t.STENCIL_INDEX8,i.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,a,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,a,e.width,e.height)}const n=e.colorTextures;let r=n.length;t.drawBuffers||(r=Math.min(r,1));for(let a=0;a1&&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 o=[];for(let h=0;h1&&i.drawBuffers(o),e.depthTexture&&this.writeDepthTexture){const h=e.depthTexture;this.renderer.texture.bind(h,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,t)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){n.stencil=n.stencil||i.createRenderbuffer();let h,l;this.renderer.context.webGLVersion===1?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH_STENCIL):e.depth&&e.stencil?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH24_STENCIL8):e.depth?(h=i.DEPTH_ATTACHMENT,l=i.DEPTH_COMPONENT24):(h=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,h,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=Ci.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,a,o,h)=>i.drawElementsInstancedANGLE(n,r,a,o,h),e.drawArraysInstanced=(n,r,a,o)=>i.drawArraysInstancedANGLE(n,r,a,o)):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 a=n[t.program.id]||this.initGeometryVao(e,t,r);this._activeGeometry=e,this._activeVao!==a&&(this._activeVao=a,this.hasVao?i.bindVertexArray(a):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}}gb.extension={type:He.RendererSystem,name:"mask"};tt.add(gb);class vb{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 nv=new li,rv=[],yb=class $c extends vb{constructor(e){super(e),this.glConst=We.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,a=i.getBounds(!0,rv.pop()??new Tt);this.roundFrameToPixels(a,r.current?r.current.resolution:n.resolution,r.sourceFrame,r.destinationFrame,n.projection.transform),t&&a.fit(t),e._scissorRectLocal=a}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()||$c.isMatrixRotated(t.worldTransform)||$c.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){$c.isMatrixRotated(r)||(r=r?nv.copyFrom(r):nv.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&&rv.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)}};yb.extension={type:He.RendererSystem,name:"scissor"};let dA=yb;tt.add(dA);class xb extends vb{constructor(e){super(e),this.glConst=We.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)}}xb.extension={type:He.RendererSystem,name:"stencil"};tt.add(xb);class bb{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return kt("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return kt("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return kt("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}}bb.extension={type:[He.RendererSystem,He.CanvasRendererSystem],name:"_plugin"};tt.add(bb);class wb{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new li,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,a=n?-1:1;r.identity(),r.a=1/t.width*2,r.d=a*(1/t.height*2),r.tx=-1-t.x*r.a,r.ty=-a-t.y*r.d}setTransform(e){}destroy(){this.renderer=null}}wb.extension={type:He.RendererSystem,name:"projection"};tt.add(wb);const fA=new pp,av=new Tt;class Sb{constructor(e){this.renderer=e,this._tempMatrix=new li}generateTexture(e,t){const{region:i,...n}=t||{},r=(i==null?void 0:i.copyTo(av))||e.getLocalBounds(av,!0),a=n.resolution||this.renderer.resolution;r.width=Math.max(r.width,1/a),r.height=Math.max(r.height,1/a),n.width=r.width,n.height=r.height,n.resolution=a,n.multisample??(n.multisample=this.renderer.multisample);const o=Ua.create(n);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const h=e.transform;return e.transform=fA,this.renderer.render(e,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=h,o}destroy(){}}Sb.extension={type:[He.RendererSystem,He.CanvasRendererSystem],name:"textureGenerator"};tt.add(Sb);const aa=new Tt,qo=new Tt;class _b{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Tt,this.destinationFrame=new Tt,this.viewportFrame=new Tt}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,a,o;e?(r=e.baseTexture,o=r.resolution,t||(aa.width=e.frame.width,aa.height=e.frame.height,t=aa),i||(qo.x=e.frame.x,qo.y=e.frame.y,qo.width=t.width,qo.height=t.height,i=qo),a=r.framebuffer):(o=n.resolution,t||(aa.width=n._view.screen.width,aa.height=n._view.screen.height,t=aa),i||(i=aa,i.width=t.width,i.height=t.height));const h=this.viewportFrame;h.x=i.x*o,h.y=i.y*o,h.width=i.width*o,h.height=i.height*o,e||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(a,h),this.renderer.projection.update(i,t,o,!a),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=Wt.shared.setValue(e||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);const r=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=r.width!==a.width||r.height!==a.height;if(o){let{x:h,y:l,width:c,height:u}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,u)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,t),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}_b.extension={type:He.RendererSystem,name:"renderTexture"};tt.add(_b);class mA{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 pA(s,e){const t={},i=e.getProgramParameter(s,e.ACTIVE_ATTRIBUTES);for(let n=0;nl>c?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)*a.data.size),a.dataLen=t,i%t!==0&&i<16){const o=i%t%16;i+=o,n+=o}i+t>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=t,i=t):(a.offset=n,i+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function wA(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 SA(s,e){if(!s.autoManage)return{size:0,syncFunc:yA};const t=wA(s.uniforms,e),{uboElements:i,size:n}=bA(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 a=0;a1){const u=rb(o.data.type),d=Math.max(Mb[o.data.type]/16,1),f=u/d,p=(4-f%4)%4;r.push(` - cv = ud.${l}.value; - v = uv.${l}; - offset = ${o.offset/4}; - - t = 0; - - for(var i=0; i < ${o.data.size*d}; i++) - { - for(var j = 0; j < ${f}; j++) - { - data[offset++] = v[t++]; - } - offset += ${p}; - } - - `)}else{const u=xA[o.data.type];r.push(` - cv = ud.${l}.value; - v = uv.${l}; - offset = ${o.offset/4}; - ${u}; - `)}}return r.push(` - renderer.buffer.update(buffer); - `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",r.join(` -`))}}let _A=0;const gc={textureCount:0,uboCount:0};class Tb{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=_A++}systemCheck(){if(!q2())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||(gc.textureCount=0,gc.uboCount=0,this.syncUniformGroup(e.uniformGroup,gc)),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]=G2(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,gc,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 a=this.getSignature(e,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=SA(e,this.shader.program.uniformData)),e.autoManage){const h=new Float32Array(o.size/4);e.buffer.update(h)}return t.uniformGroups[e.id]=o.syncFunc,t.uniformGroups[e.id]}getSignature(e,t,i){const n=e.uniforms,r=[`${i}-`];for(const a in n)r.push(a),t[a]&&r.push(t[a].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=vA(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}}Tb.extension={type:He.RendererSystem,name:"shader"};tt.add(Tb);class bh{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(){}}bh.defaultOptions={hello:!1},bh.extension={type:[He.RendererSystem,He.CanvasRendererSystem],name:"startup"};tt.add(bh);function MA(s,e=[]){return e[ut.NORMAL]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.ADD]=[s.ONE,s.ONE],e[ut.MULTIPLY]=[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.SCREEN]=[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.OVERLAY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.DARKEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.LIGHTEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.COLOR_DODGE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.COLOR_BURN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.HARD_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.SOFT_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.DIFFERENCE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.EXCLUSION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.HUE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.SATURATION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.COLOR]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.LUMINOSITY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.NONE]=[0,0],e[ut.NORMAL_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.ADD_NPM]=[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],e[ut.SCREEN_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[ut.SRC_IN]=[s.DST_ALPHA,s.ZERO],e[ut.SRC_OUT]=[s.ONE_MINUS_DST_ALPHA,s.ZERO],e[ut.SRC_ATOP]=[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[ut.DST_OVER]=[s.ONE_MINUS_DST_ALPHA,s.ONE],e[ut.DST_IN]=[s.ZERO,s.SRC_ALPHA],e[ut.DST_OUT]=[s.ZERO,s.ONE_MINUS_SRC_ALPHA],e[ut.DST_ATOP]=[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],e[ut.XOR]=[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[ut.SUBTRACT]=[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD],e}const TA=0,AA=1,EA=2,CA=3,IA=4,RA=5,Ab=class im{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=ut.NONE,this._blendEq=!1,this.map=[],this.map[TA]=this.setBlend,this.map[AA]=this.setOffset,this.map[EA]=this.setCullFace,this.map[CA]=this.setDepthTest,this.map[IA]=this.setFrontFace,this.map[RA]=this.setDepthMask,this.checks=[],this.defaultState=new Ln,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=MA(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 Js(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(a=>this._systemsHash[a]===n);n[e.name](t[r])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const rl=class Gc{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Gc.defaultMaxIdle,this.checkCountMax=Gc.defaultCheckCountMax,this.mode=Gc.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==up.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}};rl.defaultMode=up.AUTO,rl.defaultMaxIdle=3600,rl.defaultCheckCountMax=600,rl.extension={type:He.RendererSystem,name:"textureGC"};let ma=rl;tt.add(ma);class tf{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=et.UNSIGNED_BYTE,this.internalFormat=De.RGBA,this.samplerType=0}}function FA(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[s.RGB]:ze.FLOAT,[s.RGBA]:ze.FLOAT,[s.ALPHA]:ze.FLOAT,[s.LUMINANCE]:ze.FLOAT,[s.LUMINANCE_ALPHA]:ze.FLOAT,[s.R8]:ze.FLOAT,[s.R8_SNORM]:ze.FLOAT,[s.RG8]:ze.FLOAT,[s.RG8_SNORM]:ze.FLOAT,[s.RGB8]:ze.FLOAT,[s.RGB8_SNORM]:ze.FLOAT,[s.RGB565]:ze.FLOAT,[s.RGBA4]:ze.FLOAT,[s.RGB5_A1]:ze.FLOAT,[s.RGBA8]:ze.FLOAT,[s.RGBA8_SNORM]:ze.FLOAT,[s.RGB10_A2]:ze.FLOAT,[s.RGB10_A2UI]:ze.FLOAT,[s.SRGB8]:ze.FLOAT,[s.SRGB8_ALPHA8]:ze.FLOAT,[s.R16F]:ze.FLOAT,[s.RG16F]:ze.FLOAT,[s.RGB16F]:ze.FLOAT,[s.RGBA16F]:ze.FLOAT,[s.R32F]:ze.FLOAT,[s.RG32F]:ze.FLOAT,[s.RGB32F]:ze.FLOAT,[s.RGBA32F]:ze.FLOAT,[s.R11F_G11F_B10F]:ze.FLOAT,[s.RGB9_E5]:ze.FLOAT,[s.R8I]:ze.INT,[s.R8UI]:ze.UINT,[s.R16I]:ze.INT,[s.R16UI]:ze.UINT,[s.R32I]:ze.INT,[s.R32UI]:ze.UINT,[s.RG8I]:ze.INT,[s.RG8UI]:ze.UINT,[s.RG16I]:ze.INT,[s.RG16UI]:ze.UINT,[s.RG32I]:ze.INT,[s.RG32UI]:ze.UINT,[s.RGB8I]:ze.INT,[s.RGB8UI]:ze.UINT,[s.RGB16I]:ze.INT,[s.RGB16UI]:ze.UINT,[s.RGB32I]:ze.INT,[s.RGB32UI]:ze.UINT,[s.RGBA8I]:ze.INT,[s.RGBA8UI]:ze.UINT,[s.RGBA16I]:ze.INT,[s.RGBA16UI]:ze.UINT,[s.RGBA32I]:ze.INT,[s.RGBA32UI]:ze.UINT,[s.DEPTH_COMPONENT16]:ze.FLOAT,[s.DEPTH_COMPONENT24]:ze.FLOAT,[s.DEPTH_COMPONENT32F]:ze.FLOAT,[s.DEPTH_STENCIL]:ze.FLOAT,[s.DEPTH24_STENCIL8]:ze.FLOAT,[s.DEPTH32F_STENCIL8]:ze.FLOAT}:e={[s.RGB]:ze.FLOAT,[s.RGBA]:ze.FLOAT,[s.ALPHA]:ze.FLOAT,[s.LUMINANCE]:ze.FLOAT,[s.LUMINANCE_ALPHA]:ze.FLOAT,[s.DEPTH_STENCIL]:ze.FLOAT},e}function OA(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[et.UNSIGNED_BYTE]:{[De.RGBA]:s.RGBA8,[De.RGB]:s.RGB8,[De.RG]:s.RG8,[De.RED]:s.R8,[De.RGBA_INTEGER]:s.RGBA8UI,[De.RGB_INTEGER]:s.RGB8UI,[De.RG_INTEGER]:s.RG8UI,[De.RED_INTEGER]:s.R8UI,[De.ALPHA]:s.ALPHA,[De.LUMINANCE]:s.LUMINANCE,[De.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[et.BYTE]:{[De.RGBA]:s.RGBA8_SNORM,[De.RGB]:s.RGB8_SNORM,[De.RG]:s.RG8_SNORM,[De.RED]:s.R8_SNORM,[De.RGBA_INTEGER]:s.RGBA8I,[De.RGB_INTEGER]:s.RGB8I,[De.RG_INTEGER]:s.RG8I,[De.RED_INTEGER]:s.R8I},[et.UNSIGNED_SHORT]:{[De.RGBA_INTEGER]:s.RGBA16UI,[De.RGB_INTEGER]:s.RGB16UI,[De.RG_INTEGER]:s.RG16UI,[De.RED_INTEGER]:s.R16UI,[De.DEPTH_COMPONENT]:s.DEPTH_COMPONENT16},[et.SHORT]:{[De.RGBA_INTEGER]:s.RGBA16I,[De.RGB_INTEGER]:s.RGB16I,[De.RG_INTEGER]:s.RG16I,[De.RED_INTEGER]:s.R16I},[et.UNSIGNED_INT]:{[De.RGBA_INTEGER]:s.RGBA32UI,[De.RGB_INTEGER]:s.RGB32UI,[De.RG_INTEGER]:s.RG32UI,[De.RED_INTEGER]:s.R32UI,[De.DEPTH_COMPONENT]:s.DEPTH_COMPONENT24},[et.INT]:{[De.RGBA_INTEGER]:s.RGBA32I,[De.RGB_INTEGER]:s.RGB32I,[De.RG_INTEGER]:s.RG32I,[De.RED_INTEGER]:s.R32I},[et.FLOAT]:{[De.RGBA]:s.RGBA32F,[De.RGB]:s.RGB32F,[De.RG]:s.RG32F,[De.RED]:s.R32F,[De.DEPTH_COMPONENT]:s.DEPTH_COMPONENT32F},[et.HALF_FLOAT]:{[De.RGBA]:s.RGBA16F,[De.RGB]:s.RGB16F,[De.RG]:s.RG16F,[De.RED]:s.R16F},[et.UNSIGNED_SHORT_5_6_5]:{[De.RGB]:s.RGB565},[et.UNSIGNED_SHORT_4_4_4_4]:{[De.RGBA]:s.RGBA4},[et.UNSIGNED_SHORT_5_5_5_1]:{[De.RGBA]:s.RGB5_A1},[et.UNSIGNED_INT_2_10_10_10_REV]:{[De.RGBA]:s.RGB10_A2,[De.RGBA_INTEGER]:s.RGB10_A2UI},[et.UNSIGNED_INT_10F_11F_11F_REV]:{[De.RGB]:s.R11F_G11F_B10F},[et.UNSIGNED_INT_5_9_9_9_REV]:{[De.RGB]:s.RGB9_E5},[et.UNSIGNED_INT_24_8]:{[De.DEPTH_STENCIL]:s.DEPTH24_STENCIL8},[et.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[De.DEPTH_STENCIL]:s.DEPTH32F_STENCIL8}}:e={[et.UNSIGNED_BYTE]:{[De.RGBA]:s.RGBA,[De.RGB]:s.RGB,[De.ALPHA]:s.ALPHA,[De.LUMINANCE]:s.LUMINANCE,[De.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[et.UNSIGNED_SHORT_5_6_5]:{[De.RGB]:s.RGB},[et.UNSIGNED_SHORT_4_4_4_4]:{[De.RGBA]:s.RGBA},[et.UNSIGNED_SHORT_5_5_5_1]:{[De.RGBA]:s.RGBA}},e}class Eb{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new gt,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=OA(e),this.samplerTypes=FA(e);const t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(let n=0;n=0;--r){const a=t[r];a&&a._glTextures[n].samplerType!==ze.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(e){const t=new tf(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]??ze.FLOAT,this.webGLVersion===2&&e.type===et.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!==ze.FLOAT&&(this.hasIntegerTextures=!0);else{const r=e.realWidth,a=e.realHeight,o=i.gl;(t.width!==r||t.height!==a||t.dirtyId<0)&&(t.width=r,t.height=a,o.texImage2D(e.target,0,t.internalFormat,r,a,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&&yo(this.managedTextures,n,1)}}updateTextureStyle(e){var i;const t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===Bs.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Zs.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!==Bs.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===zs.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===zs.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===zs.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===zs.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}Eb.extension={type:He.RendererSystem,name:"texture"};tt.add(Eb);class Cb{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 a=0;a(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))(Fa||{});class sf{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 Ib=class ys{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 sf(null,null,1/0),this.deltaMS=1/ys.targetFPMS,this.elapsedMS=1/ys.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=Fa.NORMAL){return this._addListener(new sf(e,t,i))}addOnce(e,t,i=Fa.NORMAL){return this._addListener(new sf(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?ls.shared:new ls,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Rb.extension=He.Application;tt.add(Rb);const Pb=[];tt.handleByList(He.Renderer,Pb);function BA(s){for(const e of Pb)if(e.test(s))return new e(s);throw new Error("Unable to auto-detect a suitable renderer.")}var LA=`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; -}`,DA=`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 NA=LA,kb=DA;class Fb{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>=Ci.HIGH?this.multisample=Ci.HIGH:t>=Ci.MEDIUM?this.multisample=Ci.MEDIUM:t>=Ci.LOW?this.multisample=Ci.LOW:this.multisample=Ci.NONE}destroy(){}}Fb.extension={type:He.RendererSystem,name:"_multisample"};tt.add(Fb);class UA{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Ob{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 a=e._glBuffers[r]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,a.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 XA extends Lb{constructor(e,t){const{width:i,height:n}=t||{};let r,a;Array.isArray(e)?(r=e,a=e.length):a=e,super(a,{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=vo.TEXTURE_2D_ARRAY}upload(e,t,i){const{length:n,itemDirtyIds:r,items:a}=this,{gl:o}=e;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,t.format,i.type,null);for(let h=0;h0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=vo.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 We.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 lo._EMPTY=lo._EMPTY??We.ADAPTER.createCanvas(0,0),lo._EMPTY}}const nm=class jc extends fr{constructor(e,t){t=t||{},super(We.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)},jc.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;fr.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 a=this.source;a.width=n,a.height=r,a._pixiId=`canvas_${ka()}`,a.getContext("2d").drawImage(e,0,0,t,i,0,0,n,r),this._resolve(),this._resolve=null}}static getSize(e){const t=jc.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"&&jc.SVG_XML.test(e)}};nm.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let rm=nm;class $A extends fr{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const am=class om extends fr{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];fr.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&&(ls.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||(ls.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ls.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||om.TYPES.includes(t)}};am.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],am.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Nb=am;Wf.push(lo,hb,VA,Nb,$A,rm,yu,YA,XA);class Ll{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?Tt.EMPTY:(e=e||new Tt(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:a,tx:o,ty:h}=e,l=i*t.x+r*t.y+o,c=n*t.x+a*t.y+h;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(e){let t=this.minX,i=this.minY,n=this.maxX,r=this.maxY,a=e[0],o=e[1];t=an?a:n,r=o>r?o:r,a=e[2],o=e[3],t=an?a:n,r=o>r?o:r,a=e[4],o=e[5],t=an?a:n,r=o>r?o:r,a=e[6],o=e[7],t=an?a:n,r=o>r?o: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 a=e.a,o=e.b,h=e.c,l=e.d,c=e.tx,u=e.ty;let d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,g=a*t+h*i+c,v=o*t+l*i+u;d=gp?g:p,m=v>m?v:m,g=a*n+h*i+c,v=o*n+l*i+u,d=gp?g:p,m=v>m?v:m,g=a*t+h*r+c,v=o*t+l*r+u,d=gp?g:p,m=v>m?v:m,g=a*n+h*r+c,v=o*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,a=this.maxX,o=this.maxY;for(let h=t;ha?l:a,o=c>o?c:o}this.minX=n,this.minY=r,this.maxX=a,this.maxY=o}addVertices(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)}addVerticesMatrix(e,t,i,n,r=0,a=r){const o=e.a,h=e.b,l=e.c,c=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=a>c?a:c}}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=a>c?a:c}}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,a){e-=r,t-=a,i+=r,n+=a,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n}}class vi extends jl{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new pp,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 Ll,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);yo(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){a=this.children.splice(i,r);for(let o=0;o1&&this.children.sort(jA),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!==lm.prototype._render&&(i=this.getBounds(!0));const r=e.projection.transform;if(r&&(n?(n=HA.copyFrom(n),n.prepend(r)):n=r),i&&t.intersects(i,n))this._render(e);else if(this.cullArea)return;for(let a=0,o=this.children.length;a=n&&Ko.x=r&&Ko.y=t&&(a=s-o-1),h=h.replace("%value%",e[a].toString()),n+=h,n+=` -`}return i=i.replace("%blur%",n),i=i.replace("%size%",s.toString()),i}const eE=` - 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 tE(s,e){const t=Math.ceil(s/2);let i=eE,n="",r;e?r="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":r="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let a=0;a 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 hm extends os{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(kb,sE,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]=Wt.shared.setValue(e).toArray(),a=[i,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0];this._loadMatrix(a,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,a=1/3,o=r(a),h=i+(1-i)*a,l=a*(1-i)-o*n,c=a*(1-i)+o*n,u=a*(1-i)+o*n,d=i+a*(1-i),f=a*(1-i)-o*n,p=a*(1-i)-o*n,m=a*(1-i)+o*n,g=i+a*(1-i),v=[h,l,c,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 a=Wt.shared,[o,h,l]=a.setValue(i).toArray(),[c,u,d]=a.setValue(n).toArray(),f=[.3,.59,.11,0,0,o,h,l,e,0,c,u,d,t,0,o-c,h-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}}hm.prototype.grayscale=hm.prototype.greyscale;var nE=`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)); -} -`,rE=`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 aE extends os{constructor(e,t){const i=new li;e.renderable=!1,super(rE,nE,{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 Xt(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,a=Math.sqrt(r.a*r.a+r.b*r.b),o=Math.sqrt(r.c*r.c+r.d*r.d);a!==0&&o!==0&&(this.uniforms.rotation[0]=r.a/a,this.uniforms.rotation[1]=r.b/a,this.uniforms.rotation[2]=r.c/o,this.uniforms.rotation[3]=r.d/o),e.applyFilter(this,t,i,n)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var oE=`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; -} -`,lE=` -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 cE extends os{constructor(){super(lE,oE)}}var hE=`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 uE extends os{constructor(e=.5,t=Math.random()){super(kb,hE,{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 ov={AlphaFilter:KA,BlurFilter:iE,BlurFilterPass:cm,ColorMatrixFilter:hm,DisplacementFilter:aE,FXAAFilter:cE,NoiseFilter:uE};Object.entries(ov).forEach(([s,e])=>{Object.defineProperty(ov,s,{get(){return kt("7.1.0",`filters.${s} has moved to ${s}`),e}})});class dE{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||(ls.system.add(this.tickerUpdate,this,Fa.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(ls.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(a=>{e.currentTarget=i[r],this.notifyTarget(e,a)})}propagationPath(e){const t=[e];for(let i=0;i=0;u--){const d=c[u],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,r,a||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),o=!0}}}const h=this._isInteractive(t),l=e.isInteractive();return h&&l&&this._allInteractiveElements.push(e),a||this._hitElements.length>0?null:o?this._hitElements:h&&!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")&&(Pr.pauseUpdate=!1),e.interactiveChildren&&e.children){const h=e.children;for(let l=h.length-1;l>=0;l--){const c=h[l],u=this.hitTestRecursive(c,this._isInteractive(t)?t:c.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 a=this._isInteractive(t),o=e.isInteractive();return a&&n(e,i)?o?[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,nf),!e.hitArea.contains(nf.x,nf.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,a;t=t??e.type;const i=`on${t}`;(a=(r=e.currentTarget)[i])==null||a.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 Gs)){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 h,l;if(!(e instanceof Gs)){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(((h=n.overTargets)==null?void 0:h.length)>0&&r!==t.target){const c=e.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(e,c,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 c=e.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(t,c);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 a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push("pointermove"):this.dispatchEvent(t,"pointermove"),o&&a.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?a.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),o&&a.push("globaltouchmove")),i&&(this.moveOnAll?a.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),o&&a.push("globalmousemove"),this.cursor=(l=t.target)==null?void 0:l.cursor),a.length>0&&this.all(t,a),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var a;if(!(e instanceof Gs)){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=(a=i.target)==null?void 0:a.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 Gs)){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 a=this.createPointerEvent(e,"pointerleave",n);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),i&&this.notifyTarget(a,"mouseleave"),a.target=a.target.parent;t.overTargets=null,this.freeEvent(r),this.freeEvent(a)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Gs)){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 o=i.button===2;this.dispatchEvent(i,o?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.pressTargetsByButton[e.button]);let a=r;if(r&&!i.composedPath().includes(r)){let o=r;for(;o&&!i.composedPath().includes(o);){if(i.currentTarget=o,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const h=i.button===2;this.notifyTarget(i,h?"rightupoutside":"mouseupoutside")}o=o.parent}delete n.pressTargetsByButton[e.button],a=o}if(a){const o=this.clonePointerEvent(i,"click");o.target=a,o.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:o.target,timeStamp:t});const h=n.clicksByButton[e.button];if(h.target===o.target&&t-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=o.target,h.timeStamp=t,o.detail=h.clickCount,o.pointerType==="mouse"){const l=o.button===2;this.dispatchEvent(o,l?"rightclick":"click")}else o.pointerType==="touch"&&this.dispatchEvent(o,"tap");this.dispatchEvent(o,"pointertap"),this.freeEvent(o)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof Gs)){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 bo)){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,dm._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,a=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=gE),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=vE[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}};um.extension={name:"events",type:[He.RendererSystem,He.CanvasRendererSystem]},um.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let fm=um;tt.add(fm);function lv(s){return s==="dynamic"||s==="static"}const yE={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??lv(fm.defaultEventMode)},set interactive(s){kt("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??fm.defaultEventMode},set eventMode(s){this._internalInteractive=lv(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,a=typeof e=="function"?void 0:e;s=i?`${s}capture`:s;const o=typeof e=="function"?e:e.handleEvent,h=this;n&&n.addEventListener("abort",()=>{h.off(s,o,a)}),r?h.once(s,o,a):h.on(s,o,a)},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}};vi.mixin(yE);const xE={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};vi.mixin(xE);const bE=9,vc=100,wE=0,SE=0,cv=2,hv=1,_E=-1e3,ME=-1e3,TE=2;class Vb{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,(Qn.tablet||Qn.phone)&&this.createTouchHook();const t=document.createElement("div");t.style.width=`${vc}px`,t.style.height=`${vc}px`,t.style.position="absolute",t.style.top=`${wE}px`,t.style.left=`${SE}px`,t.style.zIndex=cv.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=`${hv}px`,e.style.height=`${hv}px`,e.style.position="absolute",e.style.top=`${_E}px`,e.style.left=`${ME}px`,e.style.zIndex=TE.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=`${vc}px`,t.style.height=`${vc}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=cv.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(a=>n.dispatchEvent(r,a))}_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===bE&&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}}Vb.extension={name:"accessibility",type:[He.RendererPlugin,He.CanvasRendererPlugin]};tt.add(Vb);const Yb=class mm{constructor(e){this.stage=new ji,e=Object.assign({forceCanvas:!1},e),this.renderer=BA(e),mm._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=mm._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}};Yb._plugins=[];let $b=Yb;tt.handleByList(He.Application,$b._plugins);class Gb{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}}Gb.extension=He.Application;tt.add(Gb);const uv={loader:He.LoadParser,resolver:He.ResolveParser,cache:He.CacheParser,detection:He.DetectionParser};tt.handle(He.Asset,s=>{const e=s.ref;Object.entries(uv).filter(([t])=>!!e[t]).forEach(([t,i])=>tt.add(Object.assign(e[t],{extension:e[t].extension??i})))},s=>{const e=s.ref;Object.keys(uv).filter(t=>!!e[t]).forEach(t=>tt.remove(e[t]))});class AE{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),_h=(s,e)=>{const t=e.split("?")[1];return t&&(s+=`?${t}`),s};function Hb(s,e,t,i,n){const r=e[t];for(let a=0;a{const a=r.substring(1,r.length-1).split(",");n.push(a)}),Hb(s,n,0,t,i)}else i.push(s);return i}const Mh=s=>!Array.isArray(s);class CE{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=js(e);let n;for(let o=0;o{n[o]=t}));const r=Object.keys(n),a={cacheKeys:r,keys:i};if(i.forEach(o=>{this._cacheMap.set(o,a)}),r.forEach(o=>{const h=n?n[o]:t;this._cache.has(o)&&this._cache.get(o)!==h&&console.warn("[Cache] already has key:",o),this._cache.set(o,n[o])}),t instanceof mt){const o=t;i.forEach(h=>{o.baseTexture!==mt.EMPTY.baseTexture&>.addToCache(o.baseTexture,h),mt.addToCache(o,h)})}}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 ga=new CE;class IE{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 a,o;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 h=0;h({alias:[l],src:l})),o=a.length,h=a.map(async l=>{const c=Si.toAbsolute(l.src);if(!n[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),n[l.src]=await this.promiseCache[c].promise,t&&t(++i/o)}catch(u){throw delete this.promiseCache[c],delete n[l.src],new Error(`[Loader.load] Failed to load ${c}. -${u}`)}});return await Promise.all(h),r?n[a[0].src]:n}async unload(e){const t=js(e,i=>({alias:[i],src:i})).map(async i=>{var a,o;const n=Si.toAbsolute(i.src),r=this.promiseCache[n];if(r){const h=await r.promise;delete this.promiseCache[n],(o=(a=r.parser)==null?void 0:a.unload)==null||o.call(a,h,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 _s=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(_s||{});const RE=".json",PE="application/json",kE={extension:{type:He.LoadParser,priority:_s.Low},name:"loadJson",test(s){return Do(s,PE)||gs(s,RE)},async load(s){return await(await We.ADAPTER.fetch(s)).json()}};tt.add(kE);const FE=".txt",OE="text/plain",BE={name:"loadTxt",extension:{type:He.LoadParser,priority:_s.Low},test(s){return Do(s,OE)||gs(s,FE)},async load(s){return await(await We.ADAPTER.fetch(s)).text()}};tt.add(BE);const LE=["normal","bold","100","200","300","400","500","600","700","800","900"],DE=[".ttf",".otf",".woff",".woff2"],NE=["font/ttf","font/otf","font/woff","font/woff2"],UE=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function XE(s){const e=Si.extname(s),t=Si.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(UE)){i=!1;break}let n=t.join(" ");return i||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const VE=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function YE(s){return VE.test(s)?s:encodeURI(s)}const $E={extension:{type:He.LoadParser,priority:_s.Low},name:"loadWebFont",test(s){return Do(s,NE)||gs(s,DE)},async load(s,e){var i,n,r;const t=We.ADAPTER.getFontFaceSet();if(t){const a=[],o=((i=e.data)==null?void 0:i.family)??XE(s),h=((r=(n=e.data)==null?void 0:n.weights)==null?void 0:r.filter(c=>LE.includes(c)))??["normal"],l=e.data??{};for(let c=0;cWe.ADAPTER.getFontFaceSet().delete(e))}};tt.add($E);const GE=`(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,pm=class{constructor(){wo||(wo=URL.createObjectURL(new Blob([GE],{type:"application/javascript"}))),this.worker=new Worker(wo)}};pm.revokeObjectURL=function(){wo&&(URL.revokeObjectURL(wo),wo=null)};const HE=`(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 So=null;class jb{constructor(){So||(So=URL.createObjectURL(new Blob([HE],{type:"application/javascript"}))),this.worker=new Worker(So)}}jb.revokeObjectURL=function(){So&&(URL.revokeObjectURL(So),So=null)};let dv=0,rf;class jE{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 pm;t.addEventListener("message",i=>{t.terminate(),pm.revokeObjectURL(),e(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){rf===void 0&&(rf=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[dv]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:dv++,id:i})}}const fv=new jE;function zl(s,e,t){s.resource.internal=!0;const i=new mt(s),n=()=>{delete e.promiseCache[t],ga.has(t)&&ga.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 WE=[".jpeg",".jpg",".png",".webp",".avif"],zE=["image/jpeg","image/png","image/webp","image/avif"];async function qE(s){const e=await We.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 _u={name:"loadTextures",extension:{type:He.LoadParser,priority:_s.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(s){return Do(s,zE)||gs(s,WE)},async load(s,e,t){var o;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;i?this.config.preferWorkers&&await fv.isImageBitmapSupported()?n=await fv.loadImageBitmap(s):n=await qE(s):n=await new Promise((h,l)=>{const c=new Image;c.crossOrigin=this.config.crossOrigin,c.src=s,c.complete?h(c):(c.onload=()=>h(c),c.onerror=u=>l(u))});const r={...e.data};r.resolution??(r.resolution=dr(s)),i&&((o=r.resourceOptions)==null?void 0:o.ownsImageBitmap)===void 0&&(r.resourceOptions={...r.resourceOptions},r.resourceOptions.ownsImageBitmap=!0);const a=new gt(n,r);return a.resource.src=s,zl(a,t,s)},unload(s){s.destroy(!0)}};tt.add(_u);const KE=".svg",ZE="image/svg+xml",JE={extension:{type:He.LoadParser,priority:_s.High},name:"loadSVG",test(s){return Do(s,ZE)||gs(s,KE)},async testParse(s){return rm.test(s)},async parse(s,e,t){var r;const i=new rm(s,(r=e==null?void 0:e.data)==null?void 0:r.resourceOptions);await i.load();const n=new gt(i,{resolution:dr(s),...e==null?void 0:e.data});return n.resource.src=e.src,zl(n,t,e.src)},async load(s,e){return(await We.ADAPTER.fetch(s)).text()},unload:_u.unload};tt.add(JE);const QE=[".mp4",".m4v",".webm",".ogv"],eC=["video/mp4","video/webm","video/ogg"],tC={name:"loadVideo",extension:{type:He.LoadParser,priority:_s.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(s){return Do(s,eC)||gs(s,QE)},async load(s,e,t){var a;let i;const n=await(await We.ADAPTER.fetch(s)).blob(),r=URL.createObjectURL(n);try{const o={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(a=e==null?void 0:e.data)==null?void 0:a.resourceOptions,autoLoad:!0},h=new Nb(r,o);await h.load();const l=new gt(h,{alphaMode:await l2(),resolution:dr(s),...e==null?void 0:e.data});l.resource.src=s,i=zl(l,t,s),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(o){throw URL.revokeObjectURL(r),o}return i},unload(s){s.destroy(!0)}};tt.add(tC);class iC{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 js(t||i||n||r,a=>typeof a=="string"?a:Array.isArray(a)?a.map(o=>(o==null?void 0:o.src)??(o==null?void 0:o.srcs)??o):a!=null&&a.src||a!=null&&a.srcs?a.src??a.srcs:a,!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,a=n.alias??n.name;let o;if(typeof a=="string"){const h=this._createBundleAssetId(e,a);i.push(h),o=[a,h]}else{const h=a.map(l=>this._createBundleAssetId(e,l));i.push(...h),o=[...a,...h]}this.add({...n,alias:o,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 a=t[n],o=a.src??a.srcs;this.add({...a,alias:r,src:Array.isArray(o)?o:[o]})}i.push(...r)}),this._bundles[e]=i}add(e,t,i,n,r){const a=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(kt("7.2.0",`Assets.add now uses an object instead of individual parameters. -Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),a.push({alias:e,src:t,data:i,format:n,loadParser:r})):Array.isArray(e)?a.push(...e):a.push(e);let o;o=h=>{this.hasKey(h)&&console.warn(`[Resolver] already has key: ${h} overwriting`)},js(a).forEach(h=>{const{src:l,srcs:c}=h;let{data:u,format:d,loadParser:f}=h;const p=js(l||c).map(v=>typeof v=="string"?EE(v):Array.isArray(v)?v:[v]),m=this.getAlias(h);Array.isArray(m)?m.forEach(o):o(m);const g=[];p.forEach(v=>{v.forEach(b=>{let y={};if(typeof b!="object"){y.src=b;for(let w=0;w{this._assetMap[v]=g})})}resolveBundle(e){const t=Mh(e);e=js(e);const i={};return e.forEach(n=>{const r=this._bundles[n];if(r){const a=this.resolve(r),o={};for(const h in a){const l=a[h];o[this._extractAssetIdFromBundle(n,h)]=l}i[n]=o}}),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=Mh(e);e=js(e);const i={};return e.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let r=this._assetMap[n];const a=r[0],o=this._getPreferredOrder(r);o==null||o.priority.forEach(h=>{o.params[h].forEach(l=>{const c=r.filter(u=>u[h]?u[h]===l:!1);c.length&&(r=c)})}),this._resolverHash[n]=r[0]??a}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:a}=t;return(this._basePath||this._rootPath)&&(e.src=Si.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=a??e.format??Si.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class sC{constructor(){this._detections=[],this._initialized=!1,this.resolver=new iC,this.loader=new IE,this.cache=ga,this._backgroundLoader=new AE(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var r,a;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 o=e.manifest;typeof o=="string"&&(o=await this.load(o)),this.resolver.addManifest(o)}const t=((r=e.texturePreference)==null?void 0:r.resolution)??1,i=typeof t=="number"?[t]:t,n=await this._detectFormats({preferredFormats:(a=e.texturePreference)==null?void 0:a.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=Mh(e),n=js(e).map(o=>{if(typeof o!="string"){const h=this.resolver.getAlias(o);return h.some(l=>!this.resolver.hasKey(l))&&this.add(o),Array.isArray(h)?h[0]:h}return this.resolver.hasKey(o)||this.add({alias:o,src:o}),o}),r=this.resolver.resolve(n),a=await this._mapLoadToResolve(r,t);return i?a[n[0]]:a}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={},a=Object.keys(n);let o=0,h=0;const l=()=>{t==null||t(++o/h)},c=a.map(u=>{const d=n[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{r[u]=f})});return await Promise.all(c),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 ga.get(e);const t={};for(let i=0;i{const l=r[o.src],c=[o.src];o.alias&&c.push(...o.alias),a[n[h]]=l,ga.set(c,l)}),a}async unload(e){this._initialized||await this.init();const t=js(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=js(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=>{ga.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 _u.config.preferWorkers}set preferWorkers(e){kt("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 sC;tt.handleByList(He.LoadParser,Rn.loader.parsers).handleByList(He.ResolveParser,Rn.resolver.parsers).handleByList(He.CacheParser,Rn.cache.parsers).handleByList(He.DetectionParser,Rn.detections);const nC={extension:He.CacheParser,test:s=>Array.isArray(s)&&s.every(e=>e instanceof mt),getCacheableAssets:(s,e)=>{const t={};return s.forEach(i=>{e.forEach((n,r)=>{t[i+(r===0?"":r+1)]=n})}),t}};tt.add(nC);async function Wb(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 rC={extension:{type:He.DetectionParser,priority:1},test:async()=>Wb("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async s=>[...s,"avif"],remove:async s=>s.filter(e=>e!=="avif")};tt.add(rC);const aC={extension:{type:He.DetectionParser,priority:0},test:async()=>Wb("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async s=>[...s,"webp"],remove:async s=>s.filter(e=>e!=="webp")};tt.add(aC);const mv=["png","jpg","jpeg"],oC={extension:{type:He.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async s=>[...s,...mv],remove:async s=>s.filter(e=>!mv.includes(e))};tt.add(oC);const lC="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function xp(s){return lC?!1:document.createElement("video").canPlayType(s)!==""}const cC={extension:{type:He.DetectionParser,priority:0},test:async()=>xp("video/webm"),add:async s=>[...s,"webm"],remove:async s=>s.filter(e=>e!=="webm")};tt.add(cC);const hC={extension:{type:He.DetectionParser,priority:0},test:async()=>xp("video/mp4"),add:async s=>[...s,"mp4","m4v"],remove:async s=>s.filter(e=>e!=="mp4"&&e!=="m4v")};tt.add(hC);const uC={extension:{type:He.DetectionParser,priority:0},test:async()=>xp("video/ogg"),add:async s=>[...s,"ogv"],remove:async s=>s.filter(e=>e!=="ogv")};tt.add(uC);const dC={extension:He.ResolveParser,test:_u.test,parse:s=>{var e;return{resolution:parseFloat(((e=We.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:Si.extname(s).slice(1),src:s}}};tt.add(dC);var Vi=(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))(Vi||{});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 fn,ro;function pv(){ro={bptc:fn.getExtension("EXT_texture_compression_bptc"),astc:fn.getExtension("WEBGL_compressed_texture_astc"),etc:fn.getExtension("WEBGL_compressed_texture_etc"),s3tc:fn.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:fn.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:fn.getExtension("WEBGL_compressed_texture_pvrtc")||fn.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:fn.getExtension("WEBGL_compressed_texture_etc1"),atc:fn.getExtension("WEBGL_compressed_texture_atc")}}const fC={extension:{type:He.DetectionParser,priority:2},test:async()=>{const s=We.ADAPTER.createCanvas().getContext("webgl");return s?(fn=s,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async s=>{ro||pv();const e=[];for(const t in ro)ro[t]&&e.push(t);return[...e,...s]},remove:async s=>(ro||pv(),s.filter(e=>!(e in ro)))};tt.add(fC);class mC extends yu{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 jf(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 jf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class Ca extends mC{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=Ca._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||Ca._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,a=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,a,o){const h=new Array(i);let l=e.byteOffset,c=a,u=o,d=c+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*Th[t];for(let m=0;m1?c:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(e.buffer,l,p)},l+=p,c=c>>1||1,u=u>>1||1,d=c+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*Th[t];return h}}const af=4,yc=124,pC=32,gv=20,gC=542327876,xc={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},vC={FOURCC:2},bc={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},yC=1,xC=2,bC=4,wC=64,SC=512,_C=131072,MC=827611204,TC=861165636,AC=894720068,EC=808540228,CC=4,IC={[MC]:Vi.COMPRESSED_RGBA_S3TC_DXT1_EXT,[TC]:Vi.COMPRESSED_RGBA_S3TC_DXT3_EXT,[AC]:Vi.COMPRESSED_RGBA_S3TC_DXT5_EXT},RC={70:Vi.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Vi.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Vi.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Vi.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Vi.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Vi.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Vi.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Vi.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Vi.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:Vi.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:Vi.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:Vi.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:Vi.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function PC(s){const e=new Uint32Array(s);if(e[0]!==gC)throw new Error("Invalid DDS file magic word");const t=new Uint32Array(s,0,yc/Uint32Array.BYTES_PER_ELEMENT),i=t[xc.HEIGHT],n=t[xc.WIDTH],r=t[xc.MIPMAP_COUNT],a=new Uint32Array(s,xc.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,pC/Uint32Array.BYTES_PER_ELEMENT),o=a[yC];if(o&bC){const h=a[vC.FOURCC];if(h!==EC){const b=IC[h],y=af+yc,w=new Uint8Array(s,y);return[new Ca(w,{format:b,width:n,height:i,levels:r})]}const l=af+yc,c=new Uint32Array(e.buffer,l,gv/Uint32Array.BYTES_PER_ELEMENT),u=c[bc.DXGI_FORMAT],d=c[bc.RESOURCE_DIMENSION],f=c[bc.MISC_FLAG],p=c[bc.ARRAY_SIZE],m=RC[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===CC)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=af+yc+gv;if(p===1)g.push(new Uint8Array(s,v));else{const b=Th[m];let y=0,w=n,A=i;for(let M=0;M>>1,A=A>>>1}let T=v;for(let M=0;Mnew Ca(b,{format:m,width:n,height:i,levels:r}))}throw o&wC?new Error("DDSParser does not support uncompressed texture data."):o&SC?new Error("DDSParser does not supported YUV uncompressed texture data."):o&_C?new Error("DDSParser does not support single-channel (lumninance) texture data!"):o&xC?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 vv=[171,75,84,88,32,49,49,187,13,10,26,10],kC=67305985,Vs={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},gm=64,yv={[et.UNSIGNED_BYTE]:1,[et.UNSIGNED_SHORT]:2,[et.INT]:4,[et.UNSIGNED_INT]:4,[et.FLOAT]:4,[et.HALF_FLOAT]:8},FC={[De.RGBA]:4,[De.RGB]:3,[De.RG]:2,[De.RED]:1,[De.LUMINANCE]:1,[De.LUMINANCE_ALPHA]:2,[De.ALPHA]:1},OC={[et.UNSIGNED_SHORT_4_4_4_4]:2,[et.UNSIGNED_SHORT_5_5_5_1]:2,[et.UNSIGNED_SHORT_5_6_5]:2};function BC(s,e,t=!1){const i=new DataView(e);if(!LC(s,i))return null;const n=i.getUint32(Vs.ENDIANNESS,!0)===kC,r=i.getUint32(Vs.GL_TYPE,n),a=i.getUint32(Vs.GL_FORMAT,n),o=i.getUint32(Vs.GL_INTERNAL_FORMAT,n),h=i.getUint32(Vs.PIXEL_WIDTH,n),l=i.getUint32(Vs.PIXEL_HEIGHT,n)||1,c=i.getUint32(Vs.PIXEL_DEPTH,n)||1,u=i.getUint32(Vs.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=i.getUint32(Vs.NUMBER_OF_FACES,n),f=i.getUint32(Vs.NUMBER_OF_MIPMAP_LEVELS,n),p=i.getUint32(Vs.BYTES_OF_KEY_VALUE_DATA,n);if(l===0||c!==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=h+3&-4,b=l+3&-4,y=new Array(u);let w=h*l;r===0&&(w=v*b);let A;if(r!==0?yv[r]?A=yv[r]*FC[a]:A=OC[r]:A=Th[o],A===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const T=t?NC(i,p,n):null;let M=w*A,R=h,P=l,F=v,I=b,k=gm+p;for(let O=0;O1||r!==0?R:F,levelHeight:f>1||r!==0?P:I,levelBuffer:new Uint8Array(e,U,M)},U+=M}k+=L+4,k=k%4!==0?k+4-k%4:k,R=R>>1||1,P=P>>1||1,F=R+m-1&-4,I=P+g-1&-4,M=F*I*A}return r!==0?{uncompressed:y.map(O=>{let L=O[0].levelBuffer,U=!1;return r===et.FLOAT?L=new Float32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4):r===et.UNSIGNED_INT?(U=!0,L=new Uint32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)):r===et.INT&&(U=!0,L=new Int32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)),{resource:new yu(L,{width:O[0].levelWidth,height:O[0].levelHeight}),type:r,format:U?DC(a):a}}),kvData:T}:{compressed:y.map(O=>new Ca(null,{format:o,width:h,height:l,levels:f,levelBuffers:O})),kvData:T}}function LC(s,e){for(let t=0;te-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h{const a=new gt(r,{mipmap:Bs.OFF,alphaMode:Xi.NO_PREMULTIPLIED_ALPHA,resolution:dr(s),...e.data});return zl(a,t,s)});return n.length===1?n[0]:n},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};tt.add(UC);const XC={extension:{type:He.LoadParser,priority:_s.High},name:"loadKTX",test(s){return gs(s,".ktx")},async load(s,e,t){const i=await(await We.ADAPTER.fetch(s)).arrayBuffer(),{compressed:n,uncompressed:r,kvData:a}=BC(s,i),o=n??r,h={mipmap:Bs.OFF,alphaMode:Xi.NO_PREMULTIPLIED_ALPHA,resolution:dr(s),...e.data},l=o.map(c=>{o===r&&Object.assign(h,{type:c.type,format:c.format});const u=c.resource??c,d=new gt(u,h);return d.ktxKeyValueData=a,zl(d,t,s)});return l.length===1?l[0]:l},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};tt.add(XC);const VC=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],YC={extension:He.ResolveParser,test:s=>{const e=Si.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(VC.includes(r))return{resolution:parseFloat(((i=We.RETINA_PREFIX.exec(s))==null?void 0:i[1])??"1"),format:r,src:s}}return{resolution:parseFloat(((n=We.RETINA_PREFIX.exec(s))==null?void 0:n[1])??"1"),format:t,src:s}}};tt.add(YC);const wc=new Tt,$C=4,zb=class ol{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((a,o)=>{r.toBlob(h=>{if(!h){o(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>a(l.result),l.onerror=o,l.readAsDataURL(h)},t,i)});if(r.toDataURL!==void 0)return r.toDataURL(t,i);if(r.convertToBlob!==void 0){const a=await r.convertToBlob({type:t,quality:i});return new Promise((o,h)=>{const l=new FileReader;l.onload=()=>o(l.result),l.onerror=h,l.readAsDataURL(a)})}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:a,premultipliedAlpha:o}=this._rawPixels(e,t);a&&ol._flipY(i,n,r),o&&ol._unpremultiplyAlpha(i);const h=new M2(n,r,1),l=new ImageData(new Uint8ClampedArray(i.buffer),n,r);return h.context.putImageData(l,0,0),h.canvas}pixels(e,t){const{pixels:i,width:n,height:r,flipY:a,premultipliedAlpha:o}=this._rawPixels(e,t);return a&&ol._flipY(i,n,r),o&&ol._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,a=!1,o,h=!1;e&&(e instanceof Ua?o=e:(o=i.generateTexture(e,{region:t,resolution:i.resolution,multisample:i.multisample}),h=!0,t&&(wc.width=t.width,wc.height=t.height,t=wc)));const l=i.gl;if(o){if(n=o.baseTexture.resolution,t=t??o.frame,r=!1,a=o.baseTexture.alphaMode>0&&o.baseTexture.format===De.RGBA,!h){i.renderTexture.bind(o);const f=o.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else n=i.resolution,t||(t=wc,t.width=i.width/n,t.height=i.height/n),r=!0,a=this._rendererPremultipliedAlpha,i.renderTexture.bind();const c=Math.max(Math.round(t.width*n),1),u=Math.max(Math.round(t.height*n),1),d=new Uint8Array($C*c*u);return l.readPixels(Math.round(t.x*n),Math.round(t.y*n),c,u,l.RGBA,l.UNSIGNED_BYTE,d),h&&(o==null||o.destroy(!0)),{pixels:d,width:c,height:u,flipY:r,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(e,t,i){const n=t<<2,r=i>>1,a=new Uint8Array(n);for(let o=0;o=0&&o>=0&&n>=0&&r>=0)){e.length=0;return}const h=Math.ceil(2.3*Math.sqrt(a+o)),l=h*8+(n?4:0)+(r?4:0);if(e.length=l,l===0)return;if(h===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 c=0,u=h*4+(n?2:0)+2,d=u,f=l;{const p=n+a,m=r,g=t+p,v=t-p,b=i+m;if(e[c++]=g,e[c++]=b,e[--u]=b,e[--u]=v,r){const y=i-m;e[d++]=v,e[d++]=y,e[--f]=y,e[--f]=g}}for(let p=1;p0||e&&i<=0){const n=t/2;for(let r=n+n%2;r=6){xv(t,!1);const a=[];for(let l=0;l=0&&r>=0&&a.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)}},jC={build(s){Ah.build(s)},triangulate(s,e){Ah.triangulate(s,e)}};var Is=(s=>(s.MITER="miter",s.BEVEL="bevel",s.ROUND="round",s))(Is||{}),Lr=(s=>(s.BUTT="butt",s.ROUND="round",s.SQUARE="square",s))(Lr||{});const Co={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 bv{static curveTo(e,t,i,n,r,a){const o=a[a.length-2],h=a[a.length-1]-t,l=o-e,c=n-t,u=i-e,d=Math.abs(h*u-l*c);if(d<1e-8||r===0)return(a[a.length-2]!==e||a[a.length-1]!==t)&&a.push(e,t),null;const f=h*h+l*l,p=c*c+u*u,m=h*c+l*u,g=r*Math.sqrt(f)/d,v=r*Math.sqrt(p)/d,b=g*m/f,y=v*m/p,w=g*u+v*l,A=g*c+v*h,T=l*(v+b),M=h*(v+b),R=u*(g+y),P=c*(g+y),F=Math.atan2(M-A,T-w),I=Math.atan2(P-A,R-w);return{cx:w+e,cy:A+t,radius:r,startAngle:F,endAngle:I,anticlockwise:l*c>u*h}}static arc(e,t,i,n,r,a,o,h,l){const c=o-a,u=Co._segmentsCount(Math.abs(c)*r,Math.ceil(Math.abs(c)/vh)*40),d=c/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=u-1,v=g%1/g;for(let b=0;b<=g;++b){const y=b+v*b,w=d+a+f*y,A=Math.cos(w),T=-Math.sin(w);l.push((p*A+m*T)*r+i,(p*-T+m*A)*r+n)}}}class WC{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 bp{static curveLength(e,t,i,n,r,a,o,h){let l=0,c=0,u=0,d=0,f=0,p=0,m=0,g=0,v=0,b=0,y=0,w=e,A=t;for(let T=1;T<=10;++T)c=T/10,u=c*c,d=u*c,f=1-c,p=f*f,m=p*f,g=m*e+3*p*c*i+3*f*u*r+d*o,v=m*t+3*p*c*n+3*f*u*a+d*h,b=w-g,y=A-v,w=g,A=v,l+=Math.sqrt(b*b+y*y);return l}static curveTo(e,t,i,n,r,a,o){const h=o[o.length-2],l=o[o.length-1];o.length-=2;const c=Co._segmentsCount(bp.curveLength(h,l,e,t,i,n,r,a));let u=0,d=0,f=0,p=0,m=0;o.push(h,l);for(let g=1,v=0;g<=c;++g)v=g/c,u=1-v,d=u*u,f=d*u,p=v*v,m=p*v,o.push(f*h+3*d*v*e+3*u*p*i+m*r,f*l+3*d*v*t+3*u*p*n+m*a)}}function wv(s,e,t,i,n,r,a,o){const h=s-t*n,l=e-i*n,c=s+t*r,u=e+i*r;let d,f;a?(d=i,f=-t):(d=-i,f=t);const p=h+d,m=l+f,g=c+d,v=u+f;return o.push(p,m,g,v),2}function oa(s,e,t,i,n,r,a,o){const h=t-s,l=i-e;let c=Math.atan2(h,l),u=Math.atan2(n-s,r-e);o&&cu&&(u+=Math.PI*2);let d=c;const f=u-c,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,v=f/g;if(d+=v,o){a.push(s,e,t,i);for(let b=1,y=d;b=0&&(r.join===Is.ROUND?d+=oa(y,w,y-M*O,w-R*O,y-P*O,w-F*O,c,!1)+4:d+=2,c.push(y-P*L,w-F*L,y+P*O,w+F*O));continue}const Q=(-M+v)*(-R+w)-(-M+y)*(-R+b),de=(-P+A)*(-F+w)-(-P+y)*(-F+T),me=(_*de-N*Q)/j,we=(V*Q-X*de)/j,Re=(me-y)*(me-y)+(we-w)*(we-w),ge=y+(me-y)*O,Ae=w+(we-w)*O,H=y-(me-y)*L,K=w-(we-w)*L,q=Math.min(_*_+X*X,N*N+V*V),z=ne?O:L,ee=q+z*z*m,le=Re<=ee;let ve=r.join;if(ve===Is.MITER&&Re/m>g&&(ve=Is.BEVEL),le)switch(ve){case Is.MITER:{c.push(ge,Ae,H,K);break}case Is.BEVEL:{ne?c.push(ge,Ae,y+M*L,w+R*L,ge,Ae,y+P*L,w+F*L):c.push(y-M*O,w-R*O,H,K,y-P*O,w-F*O,H,K),d+=2;break}case Is.ROUND:{ne?(c.push(ge,Ae,y+M*L,w+R*L),d+=oa(y,w,y+M*L,w+R*L,y+P*L,w+F*L,c,!0)+4,c.push(ge,Ae,y+P*L,w+F*L)):(c.push(y-M*O,w-R*O,H,K),d+=oa(y,w,y-M*O,w-R*O,y-P*O,w-F*O,c,!1)+4,c.push(y-P*O,w-F*O,H,K));break}}else{switch(c.push(y-M*O,w-R*O,y+M*L,w+R*L),ve){case Is.MITER:{ne?c.push(H,K,H,K):c.push(ge,Ae,ge,Ae),d+=2;break}case Is.ROUND:{ne?d+=oa(y,w,y+M*L,w+R*L,y+P*L,w+F*L,c,!0)+2:d+=oa(y,w,y-M*O,w-R*O,y-P*O,w-F*O,c,!1)+2;break}}c.push(y-P*O,w-F*O,y+P*L,w+F*L),d+=2}}v=i[(u-2)*2],b=i[(u-2)*2+1],y=i[(u-1)*2],w=i[(u-1)*2+1],M=-(b-w),R=v-y,I=Math.sqrt(M*M+R*R),M/=I,R/=I,M*=p,R*=p,c.push(y-M*O,w-R*O,y+M*L,w+R*L),h||(r.cap===Lr.ROUND?d+=oa(y-M*(O-L)*.5,w-R*(O-L)*.5,y-M*O,w-R*O,y+M*L,w+R*L,c,!1)+2:r.cap===Lr.SQUARE&&(d+=wv(y,w,M,R,O,L,!1,c)));const U=e.indices,B=Co.epsilon*Co.epsilon;for(let D=f;D0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,i=null,n=null){const r=new Eh(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 Eh(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 h=this.shapeIndex;h65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?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=Sc.pop(),n||(n=new qf,n.texArray=new Qf),this.drawCalls.push(n)),n.start=c,n.size=0,n.texArray.count=0,n.type=l),m.touched=1,m._batchEnabled=e,m._batchLocation=r,m.wrapMode=Zs.REPEAT,n.texArray.elements[n.texArray.count++]=m,r++)),n.size+=d.size,c+=d.size,o=m._batchLocation,this.addColors(t,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,o,d.attribSize,d.attribStart)}gt._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),a=new Float32Array(r),o=new Uint32Array(r);let h=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 Ea,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new Ea,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),wp.curveTo(e,t,i,n,r),this}bezierCurveTo(e,t,i,n,r,a){return this._initCurve(),bp.curveTo(e,t,i,n,r,a,this.currentPath.points),this}arcTo(e,t,i,n,r){this._initCurve(e,t);const a=this.currentPath.points,o=bv.curveTo(e,t,i,n,r,a);if(o){const{cx:h,cy:l,radius:c,startAngle:u,endAngle:d,anticlockwise:f}=o;this.arc(h,l,c,u,d,f)}return this}arc(e,t,i,n,r,a=!1){if(n===r)return this;if(!a&&r<=n?r+=vh:a&&n<=r&&(n+=vh),r-n===0)return this;const o=e+Math.cos(n)*i,h=t+Math.sin(n)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-o),d=Math.abs(c[c.length-1]-h);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 Tt(e,t,i,n))}drawRoundedRect(e,t,i,n,r){return this.drawShape(new wu(e,t,i,n,r))}drawCircle(e,t,i){return this.drawShape(new xu(e,t,i))}drawEllipse(e,t,i,n){return this.drawShape(new bu(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 Ea(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===Hi.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&&(a=i);let o=e._buffers;o||(o=e._buffers=this.generateBuffers(e));const h=t[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=Jx(e.blendMode,l),r.state.set(this.state);const c=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=Wt.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fn&&(m=n),p>=o.length&&o.push(this._generateOneMoreBuffer(e));const g=o[p];g.uploadDynamic(t,f,m);const v=e._bufferUpdateIDs[p]||0;d=d||g._updateID0);n[a]=l,n[a+r]=l,n[a+r*2]=l,n[a+r*3]=l,a+=r*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}e1.extension={name:"particle",type:He.RendererPlugin};tt.add(e1);var Tu=(s=>(s[s.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",s[s.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",s))(Tu||{});const _c={willReadFrequently:!0},mn=class at{static get experimentalLetterSpacingSupported(){let e=at._experimentalLetterSpacingSupported;if(e!==void 0){const t=We.ADAPTER.getCanvasRenderingContext2D().prototype;e=at._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,i,n,r,a,o,h,l){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=r,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=l}static measureText(e,t,i,n=at._canvas){i=i??t.wordWrap;const r=t.toFontString(),a=at.measureFont(r);a.fontSize===0&&(a.fontSize=t.fontSize,a.ascent=t.fontSize);const o=n.getContext("2d",_c);o.font=r;const h=(i?at.wordWrap(e,t,n):e).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let c=0;for(let p=0;p0&&(n?r-=t:r+=(at.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=at._canvas){const n=i.getContext("2d",_c);let r=0,a="",o="";const h=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,u=at.collapseSpaces(c),d=at.collapseNewlines(c);let f=!u;const p=t.wordWrapWidth+l,m=at.tokenize(e);for(let g=0;gp)if(a!==""&&(o+=at.addLine(a),a="",r=0),at.canBreakWords(v,t.breakWords)){const y=at.wordWrapSplit(v);for(let w=0;wp&&(o+=at.addLine(a),f=!1,a="",r=0),a+=A,r+=R}}else{a.length>0&&(o+=at.addLine(a),a="",r=0);const y=g===m.length-1;o+=at.addLine(v,!y),f=!1,a="",r=0}else b+r>p&&(f=!1,o+=at.addLine(a),a="",r=0),(a.length>0||!at.isBreakingSpace(v)||f)&&(a+=v,r+=b)}return o+=at.addLine(a,!1),o}static addLine(e,t=!0){return e=at.trimRight(e),e=t?`${e} -`:e,e}static getFromCache(e,t,i,n){let r=i[e];return typeof r!="number"&&(r=at._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(!at.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:at._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:at._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let i="";if(typeof e!="string")return t;for(let n=0;no;--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]})(),mn.experimentalLetterSpacing=!1,mn._fonts={},mn._newlines=[10,13],mn._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let Ar=mn;const sI=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],t1=class ll{constructor(e){this.styleID=0,this.reset(),uf(this,e,e)}clone(){const e={};return uf(e,this,ll.defaultStyle),new ll(e)}reset(){uf(this,ll.defaultStyle,ll.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=hf(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=hf(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){nI(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=hf(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)&&!sI.includes(n)&&(n=`"${n}"`),t[i]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};t1.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Tu.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 $r=t1;function hf(s){const e=Wt.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 nI(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,b=i.lineHeight*(f+1);let y=v;f+10}}function oI(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(dI),this.registerFindHook(fI),this.registerFindHook(oI),this.registerFindHook(lI),this.registerFindHook(cI),this.registerUploadHook(hI),this.registerUploadHook(uI)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,ls.system.addOnce(this.tick,this,Fa.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&&ls.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}};s1.uploadsPerFrame=4;let xm=s1;Object.defineProperties(We,{UPLOADS_PER_FRAME:{get(){return xm.uploadsPerFrame},set(s){kt("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),xm.uploadsPerFrame=s}}});function r1(s,e){return e instanceof gt?(e._glTextures[s.CONTEXT_UID]||s.texture.bind(e),!0):!1}function mI(s,e){if(!(e instanceof ms))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:i}=t;for(let n=0;n1?en.from(vI,gI,t):en.from(Av,yI,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,a=e.uvRespectAnchor?e.anchor.y:0;n=i.uvs,n[0]=n[6]=-r,n[1]=n[3]=-a,n[2]=n[4]=1-r,n[5]=n[7]=1-a,i.invalidate();const o=e._texture,h=o.baseTexture,l=h.alphaMode>0,c=e.tileTransform.localTransform,u=e.uvMatrix;let d=h.isPowerOfTwo&&o.frame.width===h.width&&o.frame.height===h.height;d&&(h._glTextures[t.CONTEXT_UID]?d=h.wrapMode!==Zs.CLAMP:h.wrapMode===Zs.CLAMP&&(h.wrapMode=Zs.REPEAT));const f=d?this.simpleShader:this.shader,p=o.width,m=o.height,g=e._width,v=e._height;Mc.set(c.a*p/g,c.b*p/v,c.c*m/g,c.d*m/v,c.tx/g,c.ty/v),Mc.invert(),d?Mc.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=Mc.toArray(!0),f.uniforms.uColor=Wt.shared.setValue(e.tint).premultiply(e.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=o,t.shader.bind(f),t.geometry.bind(i),this.state.blendMode=Jx(e.blendMode,l),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}o1.extension={name:"tilingSprite",type:He.RendererPlugin};tt.add(o1);const l1=class cl{constructor(e,t,i){this.linkedSheets=[],(e instanceof gt||e instanceof mt)&&(e={texture:e,data:t,resolutionFilename:i});const{texture:n,data:r,resolutionFilename:a=null,cachePrefix:o=""}=e;this.cachePrefix=o,this._texture=n instanceof mt?n:null,this.baseTexture=n instanceof gt?n:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;const h=this.baseTexture.resource;this.resolution=this._updateResolution(a||(h?h.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=dr(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<=cl.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=cl.BATCH_SIZE;for(;t-e{this._batchIndex*cl.BATCH_SIZE{i[n]=e}),Object.keys(e.textures).forEach(n=>{i[`${e.cachePrefix}${n}`]=e.textures[n]}),!t){const n=Si.dirname(s[0]);e.linkedSheets.forEach((r,a)=>{Object.assign(i,c1([`${n}/${e.data.meta.related_multi_packs[a]}`],r,!0))})}return i}const wI={extension:He.Asset,cache:{test:s=>s instanceof Ev,getCacheableAssets:(s,e)=>c1(s,e,!1)},resolver:{test:s=>{const e=s.split("?")[0].split("."),t=e.pop(),i=e.pop();return t==="json"&&bI.includes(i)},parse:s=>{var t;const e=s.split(".");return{resolution:parseFloat(((t=We.RETINA_PREFIX.exec(s))==null?void 0:t[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:He.LoadParser,priority:_s.Normal},async testParse(s,e){return Si.extname(e.src).toLowerCase()===".json"&&!!s.frames},async parse(s,e,t){var c,u;const{texture:i,imageFilename:n,cachePrefix:r}=(e==null?void 0:e.data)??{};let a=Si.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let o;if(i&&i.baseTexture)o=i;else{const d=_h(a+(n??s.meta.image),e.src);o=(await t.load([d]))[d]}const h=new Ev({texture:o.baseTexture,data:s,resolutionFilename:e.src,cachePrefix:r});await h.parse();const l=(c=s==null?void 0:s.meta)==null?void 0:c.related_multi_packs;if(Array.isArray(l)){const d=[];for(const p of l){if(typeof p!="string")continue;let m=a+p;(u=e.data)!=null&&u.ignoreMultiPack||(m=_h(m,e.src),d.push(t.load({src:m,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);h.linkedSheets=f,f.forEach(p=>{p.linkedSheets=[h].concat(h.linkedSheets.filter(m=>m!==p))})}return h},unload(s){s.destroy(!0)}}};tt.add(wI);class Ih{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class zc{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 a=t[r].match(/^[a-z]+/gm)[0],o=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(const l in o){const c=o[l].split("="),u=c[0],d=c[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;h[u]=p}i[a].push(h)}const n=new Ih;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 bm{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 Ih,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),r=e.getElementsByTagName("page"),a=e.getElementsByTagName("char"),o=e.getElementsByTagName("kerning"),h=e.getElementsByTagName("distanceField");for(let l=0;l")?bm.test(We.ADAPTER.parseXML(e)):!1}static parse(e){return bm.parse(We.ADAPTER.parseXML(e))}}const df=[zc,bm,wm];function SI(s){for(let e=0;e=h-F*a){if(m===0)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${M}')`);--T,g=null,v=null,b=null,m=0,p=0,y=0;continue}if(y=Math.max(F+R.fontProperties.descent,y),I*a+p>=d){if(p===0)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${M}')`);--T,m+=y*a,m=Math.ceil(m),p=0,y=0;continue}MI(g,v,R,p,m,a,u);const k=qc(R.text);f.char.push({id:k,page:w.length-1,x:p/a,y:m/a,width:I,height:F,xoffset:0,yoffset:0,xadvance:P-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),p+=(I+2*r)*a,p=Math.ceil(p)}if(!(i!=null&&i.skipKerning))for(let T=0,M=c.length;T 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 -`,EI=`// 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 Cv=[],Iv=[],Rv=[],CI=class u1 extends ji{constructor(e,t={}){super();const{align:i,tint:n,maxWidth:r,letterSpacing:a,fontName:o,fontSize:h}=Object.assign({},u1.styleDefaults,t);if(!_r.available[o])throw new Error(`Missing BitmapFont "${o}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new Wt(n),this._font=void 0,this._fontName=o,this._fontSize=h,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=a,this._anchor=new er(()=>{this.dirty=!0},this,0,0),this._roundPixels=We.ROUND_PIXELS,this.dirty=!0,this._resolution=We.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var I;const e=_r.available[this._fontName],t=this.fontSize,i=t/e.size,n=new Xt,r=[],a=[],o=[],h=this._text.replace(/(?:\r\n|\r)/g,` -`)||" ",l=h1(h),c=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?Cv:Iv;let d=null,f=0,p=0,m=0,g=-1,v=0,b=0,y=0,w=0;for(let k=0;k0&&n.x>c&&(++b,yo(r,1+g-b,1+k-g),k=g,g=-1,a.push(v),o.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,w=0)}const A=l[l.length-1];A!=="\r"&&A!==` -`&&(/(?:\s)/.test(A)&&(f=v),a.push(f),p=Math.max(p,f),o.push(-1));const T=[];for(let k=0;k<=m;k++){let O=0;this._align==="right"?O=p-a[k]:this._align==="center"?O=(p-a[k])/2:this._align==="justify"&&(O=o[k]<0?0:(p-a[k])/o[k]),T.push(O)}const M=r.length,R={},P=[],F=this._activePagesMeshData;u.push(...F);for(let k=0;k6*L)||O.vertices.lengtht[n.mesh.texture.baseTexture.uid]).forEach(n=>{n.mesh.texture=mt.EMPTY});for(const n in t)t[n].destroy(),delete t[n];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};CI.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const II=[".xml",".fnt"],RI={extension:{type:He.LoadParser,priority:_s.Normal},name:"loadBitmapFont",test(s){return II.includes(Si.extname(s).toLowerCase())},async testParse(s){return zc.test(s)||wm.test(s)},async parse(s,e,t){const i=zc.test(s)?zc.parse(s):wm.parse(s),{src:n}=e,{page:r}=i,a=[];for(let l=0;lo[l]);return _r.install(i,h,!0)},async load(s,e){return(await We.ADAPTER.fetch(s)).text()},unload(s){s.destroy()}};tt.add(RI);const Sm=class ao extends $r{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new ao(Object.keys(ao.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 ao.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:i}=ao;if(i[e]){const n=i[e];return this._fonts.push(n),n.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return We.ADAPTER.fetch(e).then(n=>n.blob()).then(async n=>new Promise((r,a)=>{const o=URL.createObjectURL(n),h=new FileReader;h.onload=()=>r([o,h.result]),h.onerror=a,h.readAsDataURL(n)})).then(async([n,r])=>{const a=Object.assign({family:Si.basename(e,Si.extname(e)),weight:"normal",style:"normal",display:"auto",src:n,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);i[e]=a,this._fonts.push(a),this.styleID++;const o=new FontFace(a.family,`url(${a.src})`,{weight:a.weight,style:a.style,display:a.display});a.fontFace=o,await o.load(),document.fonts.add(o),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=b2(e)),typeof e=="number"?x2(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,ao.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}=We.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}};Sm.availableFonts={},Sm.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 ff=Sm;const Tc=class oo extends Wr{constructor(e="",t={}){super(mt.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=mt.from(i,{scaleMode:We.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new Tt,n.trim=new Tt,this.texture=n;const r="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",o=document.createElementNS(r,"svg"),h=document.createElementNS(r,"foreignObject"),l=document.createElementNS(a,"div"),c=document.createElementNS(a,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",o.appendChild(h),this.maxWidth=oo.defaultMaxWidth,this.maxHeight=oo.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=o,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=oo.defaultAutoResolution,this._resolution=oo.defaultResolution??We.RESOLUTION,this.text=e,this.style=t}measureText(e){var c,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:a,height:o}=r;(a>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(a)),l=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+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:a}=this.measureText();i.width=n.width=Math.ceil(Math.max(1,r)),i.height=n.height=Math.ceil(Math.max(1,a)),this._updateID++;const o=this._updateID;await new Promise(h=>{n.onload=async()=>{if(o/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}};Tc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Tc.defaultMaxWidth=2024,Tc.defaultMaxHeight=2024,Tc.defaultAutoResolution=!0;function Rh(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 d1(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 PI(s,e,t,i,n){if(s==="random")return n();const r=Math.max(1,Math.round(t)),a=Math.max(0,Math.round(e))%r;return i?a/r:r<=1?.5:a/(r-1)}function Pv(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 kI(s,e){const{innerW:t,innerH:i,outerW:n,outerH:r}=d1(s),a=Math.max(0,(n-t)/2),o=Math.max(0,(r-i)/2),h=a*r,l=t*o,c=h*2+l*2;if(c<=0){const p=n*2+r*2;if(p<=0)return{x:0,y:0,radialAngle:0};let m=e()*p,g,v;return mtypeof O=="object"&&O!==null?{...O}:O):k);i&&(s.innerRadius=0,s.outerRadius=Math.max(0,Number.isFinite(n)?n:e.outerRadius),s.innerRectW=0,s.innerRectH=0,s.outerRectW=Math.max(0,Number.isFinite(r)?r:e.outerRectW),s.outerRectH=Math.max(0,Number.isFinite(a)?a:e.outerRectH),s.coneDirection=Number.isFinite(o)?o:90,s.emissionAngleMode=Number.isFinite(h)&&h>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 P=Array.from(new Set((Array.isArray(s.collisionColliderIds)?s.collisionColliderIds:[]).map(I=>Math.round(Number(I))).filter(I=>Number.isFinite(I)&&I>0)));(P.length!==s.collisionColliderIds.length||P.some((I,k)=>I!==s.collisionColliderIds[k]))&&(s.collisionColliderIds=P),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=Nl().imageResources);for(const I of s.imageResources){!I.texture&&s.texture&&(I.texture=s.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=s.colorOverLife?"lifetime":"fixed"),I.colorStart||(I.colorStart=s.colorStart||"#ffffff"),I.colorEnd||(I.colorEnd=s.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(Er,I.blend)||(I.blend=s.blend||"normal"),["off","fixed","curve"].includes(I.independentAlpha)||(I.independentAlpha=s.independentAlpha||"off"),Number.isFinite(I.alpha)||(I.alpha=Number.isFinite(s.alphaScale)?s.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(I.alphaCurveMode)||(I.alphaCurveMode=s.curveMode||"跟随导出"),(!Array.isArray(I.alphaCurve)||I.alphaCurve.length<2)&&(I.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(c){const I=100/s.imageResources.length;s.imageResources.forEach((k,O)=>{k.weight=O===s.imageResources.length-1?100-I*(s.imageResources.length-1):I,k.locked=!1})}if(s.imageWeightVersion=1,d){const I=Number.isFinite(f)&&f!==0?f:980;s.gravity=I,s.gravityMin=I,s.gravityMax=I}if(p){const I=Number.isFinite(m)&&Number.isFinite(g)&&(m!==0||g!==0);s.windMin=I?Math.hypot(m,g):100,s.windMax=s.windMin,s.windDirection=I?Math.atan2(-g,m)*180/Math.PI:0}v&&(s.forceStrength=Number.isFinite(b)&&b!==0?b:10),y&&(s.trailConfigVersion=3,s.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],s.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],s.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],s.trailGridRows=4,s.trailGridCols=4),(w||!s.trailResources.length)&&(s.trailResources=[{id:1,texture:T||null,textureName:M,previewUrl:R,weight:100,locked:!1,rotation:0,colorMode:s.trailColorMode,color:s.trailColor,colorGradient:s.trailColorGradient.map(I=>({...I})),blend:"normal",alphaMode:s.trailAlphaMode,alpha:s.trailAlpha,alphaCurve:s.trailAlphaCurve.map(I=>({...I})),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(I=>({...I})),shapeEnabled:s.trailShapeEnabled,shapeCurve:s.trailShapeCurve.map(I=>({...I}))}]);for(const I of s.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=s.trailColorMode||"particle"),I.color||(I.color=s.trailColor||"#ffffff"),(!Array.isArray(I.colorGradient)||I.colorGradient.length<2)&&(I.colorGradient=(s.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(k=>({...k}))),Object.prototype.hasOwnProperty.call(Er,I.blend)||(I.blend="normal"),["particle","fixed","curve"].includes(I.alphaMode)||(I.alphaMode=s.trailAlphaMode||"particle"),Number.isFinite(I.alpha)||(I.alpha=Number.isFinite(s.trailAlpha)?s.trailAlpha:1),(!Array.isArray(I.alphaCurve)||I.alphaCurve.length<2)&&(I.alphaCurve=(s.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),Number.isFinite(I.boneCount)||(I.boneCount=Number.isFinite(s.trailBoneCount)?s.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(s.trailLength)?s.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(s.trailWidth)?s.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=s.trailWidthMode||"particle"),typeof I.lifeLengthEnabled!="boolean"&&(I.lifeLengthEnabled=!!s.trailLifeLengthEnabled),(!Array.isArray(I.lifeLengthCurve)||I.lifeLengthCurve.length<2)&&(I.lifeLengthCurve=(s.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),typeof I.shapeEnabled!="boolean"&&(I.shapeEnabled=!!s.trailShapeEnabled),(!Array.isArray(I.shapeCurve)||I.shapeCurve.length<2)&&(I.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 I of s.trailResources)I.alphaCurve=((F=I.alphaCurve)==null?void 0:F.length)>=2?I.alphaCurve:[{x:0,y:1},{x:1,y:1}];return s.trailResourceVersion=6,s}const Er={normal:0,add:1,multiply:2,screen:3},BI=400;class LI extends ji{constructor(t,i=BI){super();x(this,"pool",[]);x(this,"cfg");x(this,"accumulator",0);x(this,"burstTimer",0);x(this,"_spawnSerial",0);x(this,"_elapsed",0);x(this,"_attractionEnabledAt",0);x(this,"_attractionWasEnabled",!1);x(this,"_emitterPos",null);x(this,"states",[]);x(this,"rng",Math.random);x(this,"_lastSeed",-1);x(this,"trailDebugGfx",new ms);x(this,"colliders",[]);x(this,"followSpawnX",0);x(this,"followSpawnY",0);x(this,"followSpawnAngle",0);x(this,"spawnPathSampler",null);x(this,"spawnPathClosed",!1);x(this,"followExportCurveMode","线性");x(this,"simulationTransform",null);this.cfg=Gr(t),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=pf(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),a=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 o=[];for(let p=0;p0){const _=Math.max(1e-4,Math.abs(n.rootScaleX)),X=Math.max(1e-4,Math.abs(n.rootScaleY)),N=-(((h=this.simulationTransform)==null?void 0:h.rotation)??n.rootRotation)*Math.PI/180,V=Math.cos(N),G=Math.sin(N),j=((l=this.simulationTransform)==null?void 0:l.centerX)??n.centerX,ne=((c=this.simulationTransform)==null?void 0:c.centerY)??n.centerY,Q=j+V*_*m.x-G*X*m.y,de=-ne+G*_*m.x+V*X*m.y,me=Q,we=-de,Re=n.forceCenterX-me,ge=n.forceCenterY-we,Ae=Math.hypot(Re,ge);if(Ae>1e-4&&Ae<=n.forceRadius){let H=1;n.forceFalloff==="linear"?H=1-Ae/n.forceRadius:n.forceFalloff==="inverse"&&(H=Math.min(10,n.forceRadius/Math.max(Ae,n.forceRadius*.1)));const K=n.forceStrength*H*10,q=Re/Ae*K,z=ge/Ae*K,ee=q,le=-z;m.vx+=(V*ee+G*le)/_*t,m.vy+=(-G*ee+V*le)/X*t}}if(!m.collisionPaused&&n.damping>0){const _=Math.max(0,1-n.damping*t);m.vx*=_,m.vy*=_}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 _=m.maxLife-m.life;if(n.attractionDelayMode==="particle"?_>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const N=Ka(n,m.x,m.y,this.simulationTransform),V=n.attractionCenterX,G=n.attractionCenterY,j=Math.max(0,n.attractionRadius);if(!m.attractionActive){if(Math.hypot(V-N.x,G-N.y)<=j){this.kill(p);continue}m.attractionActive=!0,m.attractionElapsed=0,m.attractionStartWorldX=N.x,m.attractionStartWorldY=N.y}m.attractionElapsed+=t;const ne=Math.max(1e-4,n.attractionDuration),Q=Math.min(1,m.attractionElapsed/ne);let de=Yi(m.attractionStartWorldX,V,Q),me=Yi(m.attractionStartWorldY,G,Q);if(n.attractionPath==="curve"){const ge=V-m.attractionStartWorldX,Ae=G-m.attractionStartWorldY,H=Math.hypot(ge,Ae);if(H>1e-4){const K=H*.25*m.attractionCurveSide,q=(m.attractionStartWorldX+V)*.5-Ae/H*K,z=(m.attractionStartWorldY+G)*.5+ge/H*K,ee=1-Q;de=ee*ee*m.attractionStartWorldX+2*ee*Q*q+Q*Q*V,me=ee*ee*m.attractionStartWorldY+2*ee*Q*z+Q*Q*G}}const we=Math.hypot(V-de,G-me);if(Q>=1||we<=j){this.kill(p);continue}const Re=kv(n,de,me,this.simulationTransform);m.x=Re.x,m.y=Re.y,m.vx=0,m.vy=0}}const v=g,b=m.sprite,y=n.imageResources.find(_=>_.id===m.resourceId);if(y){const _=this.imageFrameState(y,m.maxLife-m.life);m.imageFrameIndex=_.index,b.texture=this.imageFrameTexture(y,m.imageFrameIndex),b.visible=_.visible}if(n.speedOverLifeEnabled){const _=Ac(mf(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,v,m.speedScaleTarget),1),X=m.speedScale===0?_:_/m.speedScale;m.vx*=X,m.vy*=X,m.speedScale=_}let w=m.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(w=Yi(n.rotationSpeedMin,n.rotationSpeedMax,yn(n.rotationOverLifeCurve,v))),m.rotation+=w*t;let A=m.x,T=m.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const _=m.maxLife-m.life,X=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,N=_*Math.max(0,n.noiseSpeed)*Math.PI*2;A+=(Math.sin(m.noisePhaseX+N)-Math.sin(m.noisePhaseX))*X,T+=(Math.sin(m.noisePhaseY+N*.83)-Math.sin(m.noisePhaseY))*X}b.x=A,b.y=T,b.rotation=-m.rotation*Math.PI/180;let M=1,R=1;n.scaleOverLifeEnabled&&(M=mf(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,v,m.scaleOverLifeX),R=n.scaleOverLifeAxisMode==="separate"?mf(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,v,m.scaleOverLifeY):M),b.scale.set(Ac(m.scaleStartX*M,1),Ac(m.scaleStartY*R,1));const P=n.alphaMode==="curve"?yn(n.alphaCurve,v,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;b.alpha=Ac((y==null?void 0:y.independentAlpha)==="fixed"?y.alpha:(y==null?void 0:y.independentAlpha)==="curve"?yn(y.alphaCurve,v,this.resolveCurveMode(y.alphaCurveMode)):P,1);const F=(y==null?void 0:y.colorStart)||"#ffffff",I=(y==null?void 0:y.colorMode)==="lifetime"?gf(y.colorGradient,v):(y==null?void 0:y.colorMode)==="random"?m.colorSample:_o(F);b.tint=I,b.blendMode=Er[(y==null?void 0:y.blend)||"normal"];const k=this.updateTrail(m,A,T,v,b),O=Ka(n,A,T,this.simulationTransform),L=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,U=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleX)??n.rootScaleX),B=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleY)??n.rootScaleY),D=k?{...k,bones:k.bones.map(_=>{const X=Ka(n,_.x,_.y,this.simulationTransform);return{..._,worldX:X.x,worldY:X.y,worldRotation:L-_.rotation}})}:void 0;o.push({boneName:m.boneName,spawnId:m.spawnId,x:A,y:T,rotation:m.rotation,scaleX:b.scale.x,scaleY:b.scale.y,worldX:O.x,worldY:O.y,worldRotation:L+m.rotation,worldScaleX:b.scale.x*U,worldScaleY:b.scale.y*B,alpha:b.alpha,colorHex:I,resourceId:m.resourceId,imageFrameIndex:m.imageFrameIndex,imageVisible:b.visible,trailState:D,active:!0})}return this.states=o,o}ensureTrailMesh(t){const i=this.cfg,n=i.trailResources.find(g=>g.id===t.trailResourceId)||i.trailResources[0],r=(n==null?void 0:n.texture)||mt.EMPTY,a=Number(n==null?void 0:n.rotation)||0,o=Math.max(2,Math.min(16,Math.round(i.trailGridRows))),h=Math.max(2,Math.min(32,Math.round(i.trailGridCols))),l=Math.max(2,Math.min(16,Math.round((n==null?void 0:n.boneCount)??3))),c=`${o}:${h}:${l}:${(n==null?void 0:n.id)??0}:${a}`;if(t.trailMesh&&t.trailMeshSignature===c)return t.trailMesh.texture!==r&&(t.trailMesh.texture=r),t.trailMesh;t.trailMesh&&(this.removeChild(t.trailMesh),t.trailMesh.destroy()),t.trailMeshSignature&&t.trailMeshSignature!==c&&(t.trailHistory.length=0,t.trailBones.length=0);const u=new Float32Array(o*h*2),d=new Float32Array(o*h*2),f=[],p=[];for(let g=0;g.05?t.trailHistory.unshift({x:i,y:n}):(a.x=i,a.y=n);const o=Math.max(1,r)*1.5;let h=0,l=t.trailHistory.length;for(let c=1;c=o||c>=239){l=c+1;break}t.trailHistory.length>l&&(t.trailHistory.length=l)}sampleTrailBones(t,i,n){const r=Math.max(2,Math.min(16,Math.round(n))),a=t.trailHistory,o=[];if(!a.length)return o;let h=0;for(let c=1;c=u&&v>1e-4){const b=(u-d)/v;f={x:Yi(m.x,g.x,b),y:Yi(m.y,g.y,b)};break}d+=v}o.push({boneName:`${t.boneName}_trail_${c}`,x:f.x,y:f.y,rotation:0})}for(let c=0;c1){const c=o[0].rotation,d=(o[o.length-1].rotation-c+540)%360-180;for(let f=0;fu.id===i.resourceId)||r.trailResources[0];if(!(a!=null&&a.texture)||i.bones.length<2){n.visible=!1;return}t.trailResourceId=a.id,n.texture!==a.texture&&(n.texture=a.texture);const o=Math.max(2,Math.min(16,Math.round(r.trailGridRows))),h=Math.max(2,Math.min(32,Math.round(r.trailGridCols))),l=n.vertices,c=[];for(let u=0;u.5&&i.alpha>0}updateTrail(t,i,n,r,a){const o=this.cfg;if(!o.trail||!t.trailEnabled||t.trailSampledLength<=0||t.trailSampledWidth<=0){t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1);return}this.ensureTrailMesh(t);const h=o.trailResources.find(f=>f.id===t.trailResourceId)||o.trailResources[0];this.appendTrailPoint(t,i,n,t.trailSampledLength);const l=h!=null&&h.lifeLengthEnabled?Math.max(0,yn(h.lifeLengthCurve,r)):1,c=Math.max(0,t.trailSampledLength)*l;t.trailBones=this.sampleTrailBones(t,c,(h==null?void 0:h.boneCount)??3),t.trailBones[0]&&(t.trailBones[0].x=i,t.trailBones[0].y=n);const u=(h==null?void 0:h.widthMode)==="particle"?(Math.abs(a.scale.x)+Math.abs(a.scale.y))*.5:1;t.trailCurrentWidth=Math.max(0,t.trailSampledWidth)*u,t.trailCurrentAlpha=(h==null?void 0:h.alphaMode)==="particle"?a.alpha:(h==null?void 0:h.alphaMode)==="curve"?yn(h.alphaCurve,r):(h==null?void 0:h.alpha)??1,t.trailCurrentColor=(h==null?void 0:h.colorMode)==="particle"?a.tint:(h==null?void 0:h.colorMode)==="curve"?gf(h.colorGradient,r):_o((h==null?void 0:h.color)||"#ffffff");const d={bones:t.trailBones.map(f=>({...f})),activeBoneCount:t.trailBones.length,width:t.trailCurrentWidth,alpha:Math.min(1,Math.max(0,t.trailCurrentAlpha)),colorHex:t.trailCurrentColor,resourceId:t.trailResourceId};return this.skinTrailMesh(t,d),d}drawTrailMeshDebug(t){const i=this.trailDebugGfx;if(i.clear(),!t||!this.cfg.trail)return;const n=Math.max(2,Math.min(16,Math.round(this.cfg.trailGridRows))),r=Math.max(2,Math.min(32,Math.round(this.cfg.trailGridCols)));i.lineStyle(1,3790847,.72);for(const a of this.pool){const o=a.trailMesh;if(!(o!=null&&o.visible))continue;const h=o.vertices,l=(c,u)=>{const d=(c*n+u)*2;return{x:h[d],y:h[d+1]}};for(let c=0;c0&&this.spawnPathSampler){const o=this.estimatedEmissionCount(),h=PI(t.spawnPathDistribution,this._spawnSerial,o,this.spawnPathClosed,this.rng),l=this.spawnPathSampler(h);if(l)return{...this.applyFollowToOrigin(l.x+i,l.y+n),radialAngle:0,pathAngle:l.angle}}const r=FI(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),a=Math.sin(n);return{x:this.followSpawnX+r*t-a*i,y:this.followSpawnY+a*t+r*i}}spawnOne(){const t=this.cfg;let i=this.pool.findIndex(w=>!w.active);if(i===-1)return;const n=this.spawnOrigin(),{x:r,y:a}=n,o=Za(t.lifeMode,t.lifeMin,t.lifeMax,t.lifeCurve,this.rng()),h=Za(t.speedMode,t.speedMin,t.speedMax,t.speedCurve,this.rng()),l=OI(t,n,this.followSpawnAngle,this.rng),c=this.pool[i],u=this.pickImageResource(),d=this._spawnSerial++;c.spawnId=d;const f=this.pickTrailResource(la(t.seed,d,1540483477));c.noisePhaseX=la(t.seed,d,1757159915)*Math.PI*2,c.noisePhaseY=la(t.seed,d,48610963)*Math.PI*2,c.gravityStrength=t.useGravity&&t.gravityMode==="random"?Yi(t.gravityMin,t.gravityMax,this.rng()):t.gravityMin,c.windStrength=t.wind&&t.windMode==="random"?Yi(t.windMin,t.windMax,this.rng()):t.windMin,c.attractionActive=!1,c.attractionElapsed=0,c.collisionPaused=!1,c.attractionCurveSide=la(t.seed,d,2738958700)<.5?-1:1,c.trailHistory.length=0,c.trailBones.length=0,c.trailCurrentWidth=0,c.trailCurrentAlpha=0,c.trailCurrentColor=16777215,c.trailResourceId=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=la(t.seed,d,668265261)*100,b=(w,A,T,M,R)=>{if(w!=="random")return Math.max(0,Number(A)||0);const P=Math.max(0,Math.min(Number(T)||0,Number(M)||0)),F=Math.max(0,Math.max(Number(T)||0,Number(M)||0));return Yi(P,F,la(t.seed,d,R))};c.trailSampledLength=b(f.lengthMode,f.length,f.lengthMin,f.lengthMax,374761393),c.trailSampledWidth=b(f.widthSizeMode,f.width,f.widthMin,f.widthMax,3550635116),c.trailEnabled=t.trail&&(g||v0&&c.trailSampledWidth>0,c.trailMesh&&(c.trailMesh.visible=!1),c.active=!0,c.life=o,c.maxLife=o,c.x=r,c.y=a,c.trailEnabled&&c.trailHistory.push({x:r,y:a}),c.vx=Math.cos(l)*h,c.vy=Math.sin(l)*h,c.scaleStartX=Za(t.scaleMode,t.scaleMin,t.scaleMax,t.scaleCurve,this.rng())*u.scale,c.scaleStartY=t.scaleAxisMode==="separate"?Za(t.scaleMode,t.scaleYMin,t.scaleYMax,t.scaleYCurve,this.rng())*u.scale:c.scaleStartX,c.alphaStart=t.alpha,c.alphaEnd=t.alphaEnd,c.rotation=t.initialRotationMode==="direction"?-Math.atan2(c.vy,c.vx)*180/Math.PI+t.initialRotationMin:Za(t.initialRotationMode,t.initialRotationMin,t.initialRotationMax,t.initialRotationCurve,this.rng()),c.rotationSpeed=t.rotationOverLifeEnabled?Za(t.rotationOverLifeMode,t.rotationSpeedMin,t.rotationSpeedMax,t.rotationOverLifeCurve,this.rng()):0,c.speedScale=1,c.speedScaleTarget=t.speedOverLifeMode==="random"?Yi(t.speedOverLifeMin,t.speedOverLifeMax,this.rng()):t.speedOverLifeMin,c.scaleOverLifeX=t.scaleOverLifeMode==="random"?Yi(t.scaleOverLifeMin,t.scaleOverLifeMax,this.rng()):t.scaleOverLifeMin,c.scaleOverLifeY=t.scaleOverLifeMode==="random"?Yi(t.scaleYOverLifeMin,t.scaleYOverLifeMax,this.rng()):t.scaleYOverLifeMin,c.resourceId=u.id,c.colorSample=u.colorMode==="random"?gf(u.colorGradient,la(t.seed,d,2654435769)):_o(u.colorStart);const y=this.imageFrameState(u,0);c.imageFrameIndex=y.index,c.sprite.texture=this.imageFrameTexture(u,y.index),c.sprite.anchor.set(u.anchorX,u.anchorY),c.sprite.blendMode=Er[u.blend],c.sprite.tint=c.colorSample,c.sprite.visible=!0}pickImageResource(){const t=this.cfg.imageResources.filter(r=>r.texture||r.sequenceFrames.some(a=>a.texture));if(!t.length)return{id:1,texture:this.cfg.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",blend:"normal",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]};const i=t.reduce((r,a)=>r+Math.max(0,a.weight),0);if(i<=0)return t[Math.floor(this.rng()*t.length)];let n=this.rng()*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}imageFrameState(t,i){if(t.imageMode!=="sequence"||t.sequenceFrames.length<=1)return{index:0,visible:!0};const n=Math.min(120,Math.max(1,Number(t.sequenceFps)||30)),r=Math.max(0,Math.floor(Math.max(0,i)*n)),a=t.sequenceFrames.length-1;return t.sequencePlayback==="once-hide"?{index:Math.min(a,r),visible:r<=a}:t.sequencePlayback==="once-hold"?{index:Math.min(a,r),visible:!0}:t.sequencePlayback==="loop-reverse"?{index:a-r%t.sequenceFrames.length,visible:!0}:{index:r%t.sequenceFrames.length,visible:!0}}imageFrameTexture(t,i){var n;return t.imageMode==="sequence"&&t.sequenceFrames.length?((n=t.sequenceFrames[Math.max(0,Math.min(t.sequenceFrames.length-1,i))])==null?void 0:n.texture)||t.texture||this.cfg.texture:t.texture||this.cfg.texture}pickTrailResource(t){const i=this.cfg.trailResources.filter(a=>a.texture);if(!i.length)return this.cfg.trailResources[0]||{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}]};const n=i.reduce((a,o)=>a+Math.max(0,o.weight),0);if(n<=0)return i[Math.min(i.length-1,Math.floor(t*i.length))];let r=t*n;for(const a of i)if(r-=Math.max(0,a.weight),r<=0)return a;return i[i.length-1]}kill(t){const i=this.pool[t];i.active=!1,i.sprite.visible=!1,i.trailHistory.length=0,i.trailBones.length=0,i.trailMesh&&(i.trailMesh.visible=!1)}clear(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1)}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.trailBones.length?{bones:i.trailBones.map(n=>{var a;const r=Ka(this.cfg,n.x,n.y,this.simulationTransform);return{...n,worldX:r.x,worldY:r.y,worldRotation:(((a=this.simulationTransform)==null?void 0:a.rotation)??this.cfg.rootRotation)-n.rotation}}),activeBoneCount:i.trailBones.length,width:i.trailCurrentWidth,alpha:i.trailCurrentAlpha,colorHex:i.trailCurrentColor,resourceId:i.trailResourceId}:void 0});return t}captureWorldTransform(t){var r,a,o;const i=Ka(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(((a=this.simulationTransform)==null?void 0:a.scaleX)??this.cfg.rootScaleX),worldScaleY:t.sprite.scale.y*Math.abs(((o=this.simulationTransform)==null?void 0:o.scaleY)??this.cfg.rootScaleY)}}apply(t){var n;const i=new Map;for(const r of t)i.set(r.boneName,r);for(const r of this.pool){const a=i.get(r.boneName);if(!a){r.active=!1,r.sprite.visible=!1,r.trailMesh&&(r.trailMesh.visible=!1);continue}r.active=a.active;const o=r.sprite;if(o.visible=a.active&&a.imageVisible!==!1,o.x=a.x,o.y=a.y,o.rotation=-a.rotation*Math.PI/180,o.scale.set(a.scaleX,a.scaleY),o.alpha=a.alpha,o.tint=a.colorHex,a.resourceId!=null){const h=this.cfg.imageResources.find(l=>l.id===a.resourceId);h&&(r.imageFrameIndex=a.imageFrameIndex??0,o.texture=this.imageFrameTexture(h,r.imageFrameIndex),o.anchor.set(h.anchorX,h.anchorY),o.blendMode=Er[h.blend])}this.cfg.trail&&a.trailState?(r.trailResourceId=a.trailState.resourceId??((n=this.cfg.trailResources[0])==null?void 0:n.id)??1,r.trailBones=a.trailState.bones.map(h=>({...h})),r.trailCurrentWidth=a.trailState.width,r.trailCurrentAlpha=a.trailState.alpha,this.skinTrailMesh(r,a.trailState)):r.trailMesh&&(r.trailMesh.visible=!1)}}reset(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1);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=pf(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=pf(this.cfg.seed>>>0)}}function Yi(s,e,t){return s+(e-s)*t}function Ac(s,e){return Number.isFinite(s)?s:e}function Ka(s,e,t,i=null){const n=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleX)??s.rootScaleX)),r=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleY)??s.rootScaleY)),a=-((i==null?void 0:i.rotation)??s.rootRotation)*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=(i==null?void 0:i.centerX)??s.centerX,c=(i==null?void 0:i.centerY)??s.centerY,u=l+o*n*e-h*r*t,d=-c+h*n*e+o*r*t;return{x:u,y:-d}}function kv(s,e,t,i=null){const n=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleX)??s.rootScaleX)),r=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleY)??s.rootScaleY)),a=-((i==null?void 0:i.rotation)??s.rootRotation)*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=e-((i==null?void 0:i.centerX)??s.centerX),c=-t+((i==null?void 0:i.centerY)??s.centerY);return{x:(o*l+h*c)/n,y:(-h*l+o*c)/r}}function DI(s,e,t,i=null){const n=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleX)??s.rootScaleX)),r=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleY)??s.rootScaleY)),a=-((i==null?void 0:i.rotation)??s.rootRotation)*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=o*n*e-h*r*t,c=h*n*e+o*r*t;return{x:l,y:-c}}function NI(s,e,t,i=null){const n=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleX)??s.rootScaleX)),r=Math.max(1e-4,Math.abs((i==null?void 0:i.scaleY)??s.rootScaleY)),a=-((i==null?void 0:i.rotation)??s.rootRotation)*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=-t;return{x:(o*e+h*l)/n,y:(-h*e+o*l)/r}}function UI(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),a=Math.max(1e-4,Math.abs(s.scaleX??1)),o=Math.max(1e-4,Math.abs(s.scaleY??1)),h=e-s.x,l=t-s.y,c=(n*h+r*l)/a,u=(-r*h+n*l)/o,d=(T,M,R,P)=>{const F=R/a,I=P/o,k=Math.max(1e-4,Math.hypot(F,I)),O=F/k,L=I/k,U=n*O-r*L,B=r*O+n*L;return{x:s.x+n*T*a-r*M*o+U*.05,y:s.y+r*T*a+n*M*o+B*.05,nx:U,ny:B}};if(s.shape==="circle"){const T=Math.max(.001,s.radius),M=Math.hypot(c,u);if(M>=T)return null;const R=M>1e-4?c/M:1,P=M>1e-4?u/M:0;return d(R*T,P*T,R,P)}if(s.shape==="ellipse"){const T=Math.max(.001,s.radiusX),M=Math.max(.001,s.radiusY),R=Math.hypot(c/T,u/M);if(R>=1)return null;const P=R>1e-4?1/R:1,F=R>1e-4?c*P:T,I=R>1e-4?u*P:0,k=Math.max(1e-4,Math.hypot(F/(T*T),I/(M*M)));return d(F,I,F/(T*T)/k,I/(M*M)/k)}if(s.shape==="rect"){const T=Math.max(.001,s.width*.5),M=Math.max(.001,s.height*.5);if(Math.abs(c)>=T||Math.abs(u)>=M)return null;const R=T-Math.abs(c),P=M-Math.abs(u);if(R=0?1:-1;return d(I*T,u,I,0)}const F=u>=0?1:-1;return d(c,F*M,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},(T,M)=>{const R=Math.PI*.5+M/f*Math.PI*2;return{x:Math.cos(R)*p,y:Math.sin(R)*m}});let v=!1;for(let T=0,M=g.length-1;Tu!=P.y>u&&c<(P.x-R.x)*(u-R.y)/(P.y-R.y)+R.x&&(v=!v)}if(!v)return null;let b=g[0].x,y=g[0].y,w=1/0;for(let T=0;T>>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 Za(s,e,t,i,n){return s==="fixed"?e:s==="curve"?Yi(e,t,yn(i,n)):Yi(e,t,n)}function mf(s,e,t,i,n,r){return s==="curve"?Yi(e,t,yn(i,n)):s==="random"?r:e}function Fv(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 yn(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],a=i[n+1],o=a.x-r.x||1;if(t!=="贝塞尔")return Yi(r.y,a.y,(e-r.x)/o);const h=r.x+(r.outX??o/3),l=r.y+(r.outY??(a.y-r.y)/3),c=a.x+(a.inX??-o/3),u=a.y+(a.inY??-(a.y-r.y)/3);let d=0,f=1;for(let p=0;p<14;p++){const m=(d+f)/2;Fv(r.x,h,c,a.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 _o(s){let e=s.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function VI(s,e,t){const i=Ov(s),n=Ov(e),r=Math.round(i[0]+(n[0]-i[0])*t),a=Math.round(i[1]+(n[1]-i[1])*t),o=Math.round(i[2]+(n[2]-i[2])*t);return r<<16|a<<8|o}function gf(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 _o(t[0].color);if(e>=t[t.length-1].position)return _o(t[t.length-1].color);for(let i=0;ir.position)continue;const a=(e-n.position)/Math.max(1e-4,r.position-n.position);return VI(n.color,r.color,a)}return _o(t[t.length-1].color)}function Ov(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]}const Oa=new Map,Ia=new Map;function YI(s){return[...Oa.values()].some(e=>e===s)}function f1(s){if(!(YI(s)||(Ia.get(s)||0)>0)){Ia.delete(s);for(const e of s.textures)e.destroy(!0)}}function $I(s){const e=Ia.get(s)||0;e>1?Ia.set(s,e-1):Ia.delete(s),f1(s)}function GI(s){return Oa.get(s)||null}function Au(s,e){ql(s),Oa.set(s,e)}function HI(s){const e=Oa.get(s);return e?(Ia.set(e,(Ia.get(e)||0)+1),e):null}function jI(s,e){const t=Oa.get(s);return t?(Au(e,t),!0):!1}function ql(s){const e=Oa.get(s);e&&(Oa.delete(s),f1(e))}function hi(s){if(Array.isArray(s))return s.map(e=>hi(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]=hi(n);return t}}return s}const m1=["3.8","4.0","4.1","4.2","4.3"];function Ph(s){const e=String(s||"").trim();return m1.find(t=>e===t||e.startsWith(`${t}.`))||null}function _m(){return m1.join(" / ")}function WI(s){return s==="4.3"?"4.3":"4.2"}function Tp(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"linear",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function p1(s){const e=Object.assign(Tp(),s||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=Ph(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 Mm=30;function Kc(s,e=1){return Math.min(1800,Math.max(1,Math.ceil(Number(s)||e)))}function g1(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 Kc(Math.ceil(n*Math.max(1,e)),Mm)}function Dr(s,e=30){const t=Kc(s.loopDurationFrames),i=g1(s,e),n=s.generateLoopStartAnimation?s.loopStartUseCustomDuration?Kc(s.loopStartDurationFrames,Mm):i:0,r=s.generateLoopEndAnimation?s.loopEndUseCustomDuration?Kc(s.loopEndDurationFrames,Mm):i:0;return{start:n,loop:t,end:r,total:n+t+r}}function v1(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}}function Zc(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 zI(s,e,t){const i=Math.max(1,e-1),n=Math.max(1,t-1),r=s.end>=i?n:s.end;return Zc(s.start,r,t)}let Ec=1,Cc=1,Ic=1,Rc=1;function Pc(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 Kl=pT("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:Tp()}}),getters:{activeSystemCount:s=>s.systems.length},actions:{syncSceneSequences(){Ec=Math.max(Ec,...this.systems.map(s=>s.id+1),1),Cc=Math.max(Cc,...this.colliders.map(s=>s.id+1),1),Ic=Math.max(Ic,...this.paths.map(s=>s.id+1),1),Rc=Math.max(Rc,...this.spines.map(s=>s.id+1),1)},addSystem(s){const e=Nl();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 o of this.systems){const h=/^ParticleSystem(\d+)$/.exec(o.config.name);h&&(r=Math.max(r,parseInt(h[1],10)))}e.name=`ParticleSystem${r+1}`;let a=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+a}`,a++}const i=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:Ec++,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=Cc++,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=Ic++,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=Rc++,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=hi(i);return n.id=Ec++,n.config.name=Pc(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=hi(i);return n.id=Cc++,n.name=Pc(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=hi(i);return n.id=Ic++,n.name=Pc(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=hi(e);return t.id=Rc++,t.name=Pc(e.name,this.spines.map(i=>i.name)),t.selectedBone="",jI(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=Gr(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){ql(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=Zc(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=Zc(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 a=r.config,o=Math.max(0,Number(a.lifeMin)||0),h=Math.max(0,Number(a.lifeMax)||0),l=a.lifeMode==="fixed"?o:Math.max(o,h),c=a.mode==="stream"?a.streamBehavior==="loop"?Math.max(1/s,Math.ceil(Math.max(1,Number(a.loopDurationFrames)||1))/s):Math.max(1/s,Number(a.duration)||0):0;let u=Math.max(0,Number(a.delay)||0)+c+l;a.mode==="stream"&&a.streamBehavior==="loop"&&(u=Math.max(0,Number(a.delay)||0)+Dr(a,s).total/s),u>e&&(e=u)}for(const r of this.spines){const a=r.animations.find(h=>h.name===r.selectedAnimation);if(!a)continue;const o=Math.max(0,Number(r.timeOffset)||0)+Math.max(0,a.duration||0);o>e&&(e=o)}for(const r of this.colliders){if(!r.followPath||!r.followPathId)continue;const a=Math.max(0,Number(r.followDuration)||0);a>e&&(e=a)}const t=this.timeline.totalFrames,i=Math.max(2,Math.ceil(e*s)+1);this.timeline.totalFrames=i;const n=zI({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}}}),y1="SpineParticle.SystemSettings",x1=1,vf="SpineParticle.SystemSettings.v1";function Zo(s,e,t,i){const n=Number(s);return Math.min(t,Math.max(e,Number.isFinite(n)?n:i))}function qI(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 KI(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(Zo(s.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:Zo(s.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:Zo(s.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(Zo(s.axisFontSize,8,40,e.axisFontSize)),tickWidth:Zo(s.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:i}}function ZI(s){let e;try{e=JSON.parse(s)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==y1)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==x1)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function JI(s,e){Object.assign(s.settings,KI(e,s.settings))}let kc=null;function QI(s){kc==null||kc();try{const e=localStorage.getItem(vf);e&&JI(s,ZI(e).settings)}catch{try{localStorage.removeItem(vf)}catch{}}kc=cs(()=>qI(s.settings),e=>{const t={format:y1,version:x1,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(vf,JSON.stringify(t))}catch{}},{deep:!0})}function Bv(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 Lv(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),a=Math.max(1e-4,Math.abs(s.scaleX??1)),o=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*a-r*t*o,y:s.y+r*e*a+n*t*o}}function yf(s,e){if(!s.points.length)return null;if(s.points.length===1)return{...Lv(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 b=v/20,y=Bv(m.x,m.x+m.outX,g.x+g.inX,g.x,b),w=Bv(m.y,m.y+m.outY,g.y+g.inY,g.y,b),A=Lv(s,y,w),T=i[i.length-1];T&&(n+=Math.hypot(A.x-T.x,A.y-T.y)),i.push({...A,distance:n})}}const r=Math.min(1,Math.max(0,e))*n;let a=i.findIndex(p=>p.distance>=r);a<0&&(a=i.length-1);const o=i[a],h=i[Math.max(0,a-1)],l=i[Math.min(i.length-1,a+1)],c=h.distance,u=a>0?(r-c)/Math.max(1e-4,o.distance-c):0,d=h.x+(o.x-h.x)*Math.min(1,Math.max(0,u)),f=h.y+(o.y-h.y)*Math.min(1,Math.max(0,u));return{x:d,y:f,angle:Math.atan2(l.y-h.y,l.x-h.x)*180/Math.PI}}function Ki(s){return s.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function eR(s){const e=new Map;for(const i of s)for(const n of i)e.has(n.boneName)||e.set(n.boneName,Ki([n])[0]);const t=[...e.keys()].sort((i,n)=>{const r=Number(i.replace(/^p_/,"")),a=Number(n.replace(/^p_/,""));return Number.isFinite(r)&&Number.isFinite(a)?r-a:i.localeCompare(n)});for(let i=0;i[r.boneName,r]));s[i]=t.map(r=>{const a=n.get(r);return a||{...Ki([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function tR(s){s.length<2||(s[s.length-1]=Ki(s[0]))}function iR(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(Ki(s[r]||[]))}return i}function xf(s){return`${s.boneName}:${s.spawnId??"legacy"}`}function Dv(s){return{...Ki([s])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function sR(s,e,t,i){const n=Math.min(s.length,i+1),r=s.slice(Math.max(0,s.length-n)),a=new Map;for(const l of e){if(l.imageVisible===!1||l.alpha<=0)continue;const c=xf(l),u=new Map;let d=!1;for(let f=r.length-1;f>=0;f--){const p=r[f].find(m=>xf(m)===c);if(p)d=!0,u.set(f,p);else if(d)break}a.set(c,u)}const o=Math.max(0,r.length-1),h=[];for(let l=0;l<=t;l++){const c=Math.min(o,Math.round(l/t*o));h.push(e.map(u=>{var f;if(u.imageVisible===!1||u.alpha<=0)return Ki([u])[0];const d=(f=a.get(xf(u)))==null?void 0:f.get(c);return d?Ki([d])[0]:Dv(u)}))}return h[0]=h[0].map(Dv),h[h.length-1]=Ki(e),h}function Nv(s,e){const t=s.length?1:0;for(let i=t;i{const y=b?[[]]:[];e.reset();for(let w=0;w0&&e.restartEmissionCycle();for(let A=0;A0;w++)e.update(r,"off"),b.push(e.capture());(v=b[b.length-1])!=null&&v.length&&b.push([]),Nv(u,iR(b,o.end))}const g=Ki(u[u.length-1]||[]);for(u.length>i&&(u.length=i);u.lengtho.id===r)||(this.container.removeChild(a.root),a.root.destroy({children:!0}),this.entries.delete(r));for(const r of e){const a=GI(r.id);let o=this.entries.get(r.id);if(o&&o.assetVersion!==r.assetVersion&&!a&&(this.container.removeChild(o.root),o.root.destroy({children:!0}),this.entries.delete(r.id),o=void 0),(!o||o.assetVersion!==r.assetVersion)&&a){o&&(this.container.removeChild(o.root),o.root.destroy({children:!0}));const d=new ji,f=new a.SpineClass({skeletonData:a.skeletonData,autoUpdate:!1,darkTint:!1});a.skeletonData.defaultSkin&&f.skeleton.setSkin(a.skeletonData.defaultSkin),a.runtimeVersion==="4.3"?f.skeleton.setupPoseSlots():f.skeleton.setSlotsToSetupPose(),d.addChild(f),this.container.addChild(d),o={root:d,spine:f,runtimeVersion:a.runtimeVersion,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,o)}if(!o)continue;const h=o.root,l=o.spine,c=r.visible!==!1&&r.enabled;h.visible=c,h.renderable=c,h.position.set(r.x,-r.y),h.rotation=-r.rotation*Math.PI/180,h.scale.set(r.scaleX,r.scaleY),o.animation!==r.selectedAnimation&&(o.animation=r.selectedAnimation,o.runtimeVersion==="4.3"?l.skeleton.setupPose():l.skeleton.setToSetupPose(),l.state.clearTracks(),o.animation&&l.state.setAnimation(0,o.animation,!1));const u=o.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,a=i.root,o=Math.cos(a.rotation),h=Math.sin(a.rotation),l=o*a.scale.x,c=-h*a.scale.y,u=h*a.scale.x,d=o*a.scale.y,f=l*r.a+c*r.c,p=l*r.b+c*r.d,m=u*r.a+d*r.c,g=u*r.b+d*r.d,v=a.position.x+l*r.worldX+c*r.worldY,b=a.position.y+u*r.worldX+d*r.worldY;return{x:v,y:-b,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 b1=class{constructor(){x(this,"entries",{});x(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 qi){return t.setFromString(e)}},x(qi,"WHITE",new qi(1,1,1,1)),x(qi,"RED",new qi(1,0,0,1)),x(qi,"GREEN",new qi(0,1,0,1)),x(qi,"BLUE",new qi(0,0,1,1)),x(qi,"MAGENTA",new qi(1,0,1,1)),qi);var wi;let $e=(wi=class{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*wi.degRad)}static sinDeg(e){return Math.sin(e*wi.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*wi.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 wi.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}},x(wi,"PI",3.1415927),x(wi,"PI2",wi.PI*2),x(wi,"invPI2",1/wi.PI2),x(wi,"radiansToDegrees",180/wi.PI),x(wi,"radDeg",wi.radiansToDegrees),x(wi,"degreesToRadians",wi.PI/180),x(wi,"degRad",wi.degreesToRadians),wi);var Ws;let Ge=(Ws=class{static arrayCopy(e,t,i,n,r){for(let a=t,o=n;a=t?e:Ws.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)*o;let h=t.bone.skeleton,l=t.deform,c=this.vertices,u=this.bones;if(!u){l.length>0&&(c=l);let m=t.bone,g=m.worldX,v=m.worldY,b=m.a,y=m.b,w=m.c,A=m.d;for(let T=i,M=a;M=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 nr._nextID++}},x(nr,"_nextID",0),nr);var $i;(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"})($i||($i={}));const _1=[$i.hold,$i.once,$i.loop,$i.pingpong,$i.onceReverse,$i.loopReverse,$i.pingpongReverse];let Ap=class{constructor(e,t,i){x(this,"name");x(this,"timelines",[]);x(this,"timelineIds",new b1);x(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 c=0,u=l.length;ct)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 ui{constructor(t,i,n){super(t,n);x(this,"curves");this.curves=Ge.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=Ge.newFloatArray(i);Ge.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,a,o,h,l,c,u,d){let f=this.curves,p=this.getFrameCount()+t*18;n==0&&(f[i]=2+p);let m=(r-o*2+l)*.03,g=(a-h*2+c)*.03,v=((o-l)*3-r+u)*.006,b=((h-c)*3-a+d)*.006,y=m*2+v,w=g*2+b,A=(o-r)*.3+m+v*.16666667,T=(h-a)*.3+g+b*.16666667,M=r+A,R=a+T;for(let P=p+18;pt){let c=this.frames[i],u=this.frames[i+n];return u+(t-c)/(a[r]-c)*(a[r+1]-u)}let o=r+18;for(r+=2;r=t){let c=a[r-2],u=a[r-1];return u+(t-c)/(a[r]-c)*(a[r+1]-u)}i+=this.getFrameEntries();let h=a[o-2],l=a[o-1];return l+(t-h)/(this.frames[i]-h)*(this.frames[i+n]-l)}},nn=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],a=t[i+1];return a+(e-r)/(t[i+2]-r)*(t[i+2+1]-a);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=c[m];d=c[m+1],f=c[m+2],p=c[m+3];let b=(n-v)/(c[m+4]-v);d+=(c[m+4+1]-d)*b,f+=(c[m+4+2]-f)*b,p+=(c[m+4+3]-p)*b;break;case 1:d=c[m+1],f=c[m+2],p=c[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(a==1)u.r=d,u.g=f,u.b=p;else{if(o==Ee.setup){let v=l.data.color;u.r=v.r,u.g=v.g,u.b=v.b}u.r+=(d-u.r)*a,u.g+=(f-u.g)*a,u.b+=(p-u.b)*a}}},L1=class extends nn{constructor(t,i,n){super(t,i,At.alpha+"|"+n);x(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,a,o,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.color;if(n>3];switch(A){case 0:let T=c[w];f=c[w+1],p=c[w+2],m=c[w+3],g=c[w+4],v=c[w+5],b=c[w+6],y=c[w+7];let M=(n-T)/(c[w+8]-T);f+=(c[w+8+1]-f)*M,p+=(c[w+8+2]-p)*M,m+=(c[w+8+3]-m)*M,g+=(c[w+8+4]-g)*M,v+=(c[w+8+5]-v)*M,b+=(c[w+8+6]-b)*M,y+=(c[w+8+7]-y)*M;break;case 1:f=c[w+1],p=c[w+2],m=c[w+3],g=c[w+4],v=c[w+5],b=c[w+6],y=c[w+7];break;default:f=this.getBezierValue(n,w,1,A-2),p=this.getBezierValue(n,w,2,A+18-2),m=this.getBezierValue(n,w,3,A+36-2),g=this.getBezierValue(n,w,4,A+54-2),v=this.getBezierValue(n,w,5,A+72-2),b=this.getBezierValue(n,w,6,A+90-2),y=this.getBezierValue(n,w,7,A+108-2)}if(a==1)u.set(f,p,m,g),d.r=v,d.g=b,d.b=y;else{if(o==Ee.setup){u.setFromColor(l.data.color);let T=l.data.darkColor;d.r=T.r,d.g=T.g,d.b=T.b}u.add((f-u.r)*a,(p-u.g)*a,(m-u.b)*a,(g-u.a)*a),d.r+=(v-d.r)*a,d.g+=(b-d.g)*a,d.b+=(y-d.b)*a}}},N1=class extends Dn{constructor(t,i,n){super(t,i,[At.rgb+"|"+n,At.rgb2+"|"+n]);x(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,i,n,r,a,o,h,l){t*=7,this.frames[t]=i,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=a,this.frames[t+4]=o,this.frames[t+5]=h,this.frames[t+6]=l}apply(t,i,n,r,a,o,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=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 a=r+18;for(r+=2;r=t){let l=n[r-2],c=n[r-1];return c+(t-l)/(n[r]-l)*(n[r+1]-c)}let o=n[a-2],h=n[a-1];return h+(1-h)*(t-o)/(this.frames[i+this.getFrameEntries()]-o)}apply(t,i,n,r,a,o,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.getAttachment();if(!c||!(c instanceof mr)||c.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(o=Ee.setup);let d=this.vertices,f=d[0].length,p=this.frames;if(n=p[p.length-1]){let w=d[p.length-1];if(a==1)if(o==Ee.add){let A=c;if(A.bones)for(let T=0;Tn)this.apply(t,i,Number.MAX_VALUE,r,a,o,h),i=-1;else if(i>=l[c-1])return;if(n0&&l[u-1]==d;)u--}for(;u=l[u];u++)r.push(this.events[u])}},x(wa,"propertyIds",[""+At.event]),wa);var Sa;let vl=(Sa=class extends ui{constructor(t){super(t,Sa.propertyIds);x(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,a,o,h){if(h==Qi.mixOut){o==Ee.setup&&Ge.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(n>2];switch(m){case 0:let g=c[p];u=c[p+1],d=c[p+2],f=c[p+3];let v=(n-g)/(c[p+4]-g);u+=(c[p+4+1]-u)*v,d+=(c[p+4+2]-d)*v,f+=(c[p+4+3]-f)*v;break;case 1:u=c[p+1],d=c[p+2],f=c[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(o==Ee.setup){let g=l.data;l.mixRotate=g.mixRotate+(u-g.mixRotate)*a,l.mixX=g.mixX+(d-g.mixX)*a,l.mixY=g.mixY+(f-g.mixY)*a}else l.mixRotate+=(u-l.mixRotate)*a,l.mixX+=(d-l.mixX)*a,l.mixY+=(f-l.mixY)*a}},Xa=class extends nn{constructor(t,i,n,r){super(t,i,r+"|"+n);x(this,"constraintIndex",0);this.constraintIndex=n}apply(t,i,n,r,a,o,h){let l;if(this.constraintIndex==-1){const c=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,a,o,this.get(u),this.setup(u),c))}else l=t.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(n,a,o,this.get(l),this.setup(l)))}},H1=class extends Xa{constructor(e,t,i){super(e,t,i,At.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},j1=class extends Xa{constructor(e,t,i){super(e,t,i,At.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},W1=class extends Xa{constructor(e,t,i){super(e,t,i,At.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},z1=class extends Xa{constructor(e,t,i){super(e,t,i,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}},q1=class extends Xa{constructor(e,t,i){super(e,t,i,At.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},K1=class extends Xa{constructor(e,t,i){super(e,t,i,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 Xa{constructor(e,t,i){super(e,t,i,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 _a;let J1=(_a=class extends ui{constructor(t,i){super(t,_a.propertyIds);x(this,"constraintIndex");this.constraintIndex=i}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,a,o,h){let l;if(this.constraintIndex!=-1&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const c=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],a,o,h),i=-1;else if(i>=c[c.length-1])return;if(!(n=c[ui.search1(c,i)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},x(_a,"propertyIds",[At.physicsConstraintReset.toString()]),_a);var ss;let Q1=(ss=class extends ui{constructor(t,i,n){super(t,[At.sequence+"|"+i+"|"+n.sequence.id]);x(this,"slotIndex");x(this,"attachment");this.slotIndex=i,this.attachment=n}getFrameEntries(){return ss.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,i,n,r,a){let o=this.frames;t*=ss.ENTRIES,o[t]=i,o[t+ss.MODE]=n|r<<4,o[t+ss.DELAY]=a}apply(t,i,n,r,a,o,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.attachment,u=this.attachment;if(c!=u&&(!(c instanceof mr)||c.timelineAttachment!=u))return;if(h==Qi.mixOut){o==Ee.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(n>4,b=this.attachment.sequence.regions.length,y=_1[m&15];if(y!=$i.hold)switch(v+=(n-p)/g+1e-5|0,y){case $i.once:v=Math.min(b-1,v);break;case $i.loop:v%=b;break;case $i.pingpong:{let w=(b<<1)-2;v=w==0?0:v%w,v>=b&&(v=w-v);break}case $i.onceReverse:v=Math.max(b-1-v,0);break;case $i.loopReverse:v=b-1-v%b;break;case $i.pingpongReverse:{let w=(b<<1)-2;v=w==0?0:(v+b-1)%w,v>=b&&(v=w-v)}}l.sequenceIndex=v}},x(ss,"ENTRIES",3),x(ss,"MODE",1),x(ss,"DELAY",2),ss);var rr;let aR=(rr=class{constructor(e){x(this,"data");x(this,"tracks",new Array);x(this,"timeScale",1);x(this,"unkeyedState",0);x(this,"events",new Array);x(this,"listeners",new Array);x(this,"queue",new lR(this));x(this,"propertyIDs",new b1);x(this,"animationsChanged",!1);x(this,"trackEntryPool",new kh(()=>new oR));this.data=e}static emptyAnimation(){return rr._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=a,r.delay>0)continue;a=-r.delay,r.delay=0}let o=r.next;if(o){let h=r.trackLast-o.delay;if(h>=0){for(o.delay=0,o.trackTime+=r.timeScale==0?0:(h/r.timeScale+e)*o.timeScale,r.trackTime+=a,this.setCurrent(i,o,!0);o.mixingFrom;)o.mixTime+=e,o=o.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 h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=a}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?Ee.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,b=p.animationLast,y=p.getAnimationTime(),w=y,A=t;p.reverse&&(w=p.animation.duration-w,A=null);let T=p.animation.timelines,M=T.length;if(d==0&&g==1||m==Ee.add){d==0&&(v=!0);for(let R=0;R1&&(r=1),i!=Ee.first&&(i=n.mixBlend));let a=r=n.alphaAttachmentThreshold):(o&&A instanceof vl&&M==Ee.setup&&(T=Qi.mixIn),A.apply(t,d,p,m,R,M,T))}}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 a=t.slots[e.slotIndex];a.bone.active&&(i=0,y=m>=0;Math.abs(g)<=90&&$e.signum(g)!=$e.signum(p)&&(Math.abs(m-v)>180?(f+=360*$e.signum(m),y=b):v!=0?f-=360*$e.signum(m):y=b),y!=b&&(f+=360*$e.signum(m)),a[o]=f}a[o+1]=p,l.rotation=u+f*n}queueEvents(e,t){let i=e.animationStart,n=e.animationEnd,r=n-i,a=e.trackLast%r,o=this.events,h=0,l=o.length;for(;hn||this.queue.event(e,u)}let c=!1;if(e.loop)if(r==0)c=!0;else{const u=Math.floor(e.trackTime/r);c=u>0&&u>Math.floor(e.trackLast/r)}else c=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 a=this.trackEntry(e,t,i,r);return this.setCurrent(e,a,n),this.queue.drain(),a}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 a=this.trackEntry(e,t,i,r);return r?(r.next=a,a.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-a.mixDuration,0))):(this.setCurrent(e,a,!0),this.queue.drain(),n<0&&(n=0)),a.delay=n,a}setEmptyAnimation(e,t=0){let i=this.setAnimationWith(e,rr.emptyAnimation(),!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){let n=this.addAnimationWith(e,rr.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[h]=cR,a[h]=u;continue e}break}r[h]=wf}}}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()}},x(rr,"_emptyAnimation",new Ap("",[],0)),rr),oR=class{constructor(){x(this,"animation",null);x(this,"previous",null);x(this,"next",null);x(this,"mixingFrom",null);x(this,"mixingTo",null);x(this,"listener",null);x(this,"trackIndex",0);x(this,"loop",!1);x(this,"holdPrevious",!1);x(this,"reverse",!1);x(this,"shortestRotation",!1);x(this,"eventThreshold",0);x(this,"mixAttachmentThreshold",0);x(this,"alphaAttachmentThreshold",0);x(this,"mixDrawOrderThreshold",0);x(this,"animationStart",0);x(this,"animationEnd",0);x(this,"animationLast",0);x(this,"nextAnimationLast",0);x(this,"delay",0);x(this,"trackTime",0);x(this,"trackLast",0);x(this,"nextTrackLast",0);x(this,"trackEnd",0);x(this,"timeScale",0);x(this,"alpha",0);x(this,"mixTime",0);x(this,"_mixDuration",0);x(this,"interruptAlpha",0);x(this,"totalAlpha",0);x(this,"mixBlend",Ee.replace);x(this,"timelineMode",new Array);x(this,"timelineHoldMix",new Array);x(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}},lR=class{constructor(e){x(this,"objects",[]);x(this,"drainDisabled",!1);x(this,"animState");this.animState=e}start(e){this.objects.push(us.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(us.interrupt),this.objects.push(e)}end(e){this.objects.push(us.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(us.dispose),this.objects.push(e)}complete(e){this.objects.push(us.complete),this.objects.push(e)}event(e,t){this.objects.push(us.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{c.width=parseInt(i[1]),c.height=parseInt(i[2])},n.format=()=>{},n.filter=c=>{c.minFilter=Ge.enumValue(Di,i[1]),c.magFilter=Ge.enumValue(Di,i[2])},n.repeat=c=>{i[1].indexOf("x")!=-1&&(c.uWrap=lr.Repeat),i[1].indexOf("y")!=-1&&(c.vWrap=lr.Repeat)},n.pma=c=>{c.pma=i[1]=="true"};var r={};r.xy=c=>{c.x=parseInt(i[1]),c.y=parseInt(i[2])},r.size=c=>{c.width=parseInt(i[1]),c.height=parseInt(i[2])},r.bounds=c=>{c.x=parseInt(i[1]),c.y=parseInt(i[2]),c.width=parseInt(i[3]),c.height=parseInt(i[4])},r.offset=c=>{c.offsetX=parseInt(i[1]),c.offsetY=parseInt(i[2])},r.orig=c=>{c.originalWidth=parseInt(i[1]),c.originalHeight=parseInt(i[2])},r.offsets=c=>{c.offsetX=parseInt(i[1]),c.offsetY=parseInt(i[2]),c.originalWidth=parseInt(i[3]),c.originalHeight=parseInt(i[4])},r.rotate=c=>{let u=i[1];u=="true"?c.degrees=90:u!="false"&&(c.degrees=parseInt(u))},r.index=c=>{c.index=parseInt(i[1])};let a=t.readLine();for(;a&&a.trim().length==0;)a=t.readLine();for(;!(!a||a.trim().length==0||t.readEntry(i,a)==0);)a=t.readLine();let o=null,h=null,l=null;for(;a!==null;)if(a.trim().length==0)o=null,a=t.readLine();else if(o){let c=new nw(o,a);for(;;){let u=t.readEntry(i,a=t.readLine());if(u==0)break;let d=r[i[0]];if(d)d(c);else{h||(h=[]),l||(l=[]),h.push(i[0]);let f=[];for(let p=0;p0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,c.degrees==90?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new pR(a.trim());t.readEntry(i,a=t.readLine())!=0;){let c=n[i[0]];c&&c(o)}this.pages.push(o)}}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 a=t.indexOf(",",r);if(a==-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,a-r).trim(),r=a+1,n==4)return 4}}},pR=class{constructor(e){x(this,"name");x(this,"minFilter",Di.Nearest);x(this,"magFilter",Di.Nearest);x(this,"uWrap",lr.ClampToEdge);x(this,"vWrap",lr.ClampToEdge);x(this,"texture",null);x(this,"width",0);x(this,"height",0);x(this,"pma",!1);x(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}},nw=class extends fR{constructor(t,i){super();x(this,"page");x(this,"name");x(this,"x",0);x(this,"y",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0);x(this,"index",0);x(this,"degrees",0);x(this,"names",null);x(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}},Zl=class Tm extends mr{constructor(t,i){super(t);x(this,"region",null);x(this,"path");x(this,"regionUVs",[]);x(this,"uvs",[]);x(this,"triangles",[]);x(this,"color",new Mt(1,1,1,1));x(this,"width",0);x(this,"height",0);x(this,"hullLength",0);x(this,"edges",[]);x(this,"parentMesh",null);x(this,"sequence",null);x(this,"tempColor",new Mt(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=Ge.newFloatArray(t.length));let i=this.uvs,n=this.uvs.length,r=this.region.u,a=this.region.v,o=0,h=0;if(this.region instanceof nw){let l=this.region,c=l.page,u=c.width,d=c.height;switch(l.degrees){case 90:r-=(l.originalHeight-l.offsetY-l.height)/u,a-=(l.originalWidth-l.offsetX-l.width)/d,o=l.originalHeight/u,h=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 pi;(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"})(pi||(pi={}));let Yv=class{constructor(e,t,i){x(this,"data");x(this,"skeleton");x(this,"parent",null);x(this,"children",new Array);x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"scaleX",0);x(this,"scaleY",0);x(this,"shearX",0);x(this,"shearY",0);x(this,"ax",0);x(this,"ay",0);x(this,"arotation",0);x(this,"ascaleX",0);x(this,"ascaleY",0);x(this,"ashearX",0);x(this,"ashearY",0);x(this,"a",0);x(this,"b",0);x(this,"c",0);x(this,"d",0);x(this,"worldY",0);x(this,"worldX",0);x(this,"inherit",pi.Normal);x(this,"sorted",!1);x(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,a,o){this.ax=e,this.ay=t,this.arotation=i,this.ascaleX=n,this.ascaleY=r,this.ashearX=a,this.ashearY=o;let h=this.parent;if(!h){let f=this.skeleton;const p=f.scaleX,m=f.scaleY,g=(i+a)*$e.degRad,v=(i+90+o)*$e.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=h.a,c=h.b,u=h.c,d=h.d;switch(this.worldX=l*e+c*t+h.worldX,this.worldY=u*e+d*t+h.worldY,this.inherit){case pi.Normal:{const f=(i+a)*$e.degRad,p=(i+90+o)*$e.degRad,m=Math.cos(f)*n,g=Math.cos(p)*r,v=Math.sin(f)*n,b=Math.sin(p)*r;this.a=l*m+c*v,this.b=l*g+c*b,this.c=u*m+d*v,this.d=u*g+d*b;return}case pi.OnlyTranslation:{const f=(i+a)*$e.degRad,p=(i+90+o)*$e.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 pi.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-c*f*u)/m,c=u*m,d=l*m,g=Math.atan2(u,l)*$e.radDeg):(l=0,u=0,g=90-Math.atan2(d,c)*$e.radDeg);const v=(i+a-g)*$e.degRad,b=(i+o-g+90)*$e.degRad,y=Math.cos(v)*n,w=Math.cos(b)*r,A=Math.sin(v)*n,T=Math.sin(b)*r;this.a=l*y-c*A,this.b=l*w-c*T,this.c=u*y+d*A,this.d=u*w+d*T;break}case pi.NoScale:case pi.NoScaleOrReflection:{i*=$e.degRad;const f=Math.cos(i),p=Math.sin(i);let m=(l*f+c*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==pi.NoScale&&l*d-c*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v),i=Math.PI/2+Math.atan2(g,m);const b=Math.cos(i)*v,y=Math.sin(i)*v;a*=$e.degRad,o=(90+o)*$e.degRad;const w=Math.cos(a)*n,A=Math.cos(o)*r,T=Math.sin(a)*n,M=Math.sin(o)*r;this.a=m*w+b*T,this.b=m*A+b*M,this.c=g*w+y*T,this.d=g*A+y*M;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)*$e.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)*$e.radDeg;return}let t=e.a,i=e.b,n=e.c,r=e.d,a=1/(t*r-i*n),o=r*a,h=i*a,l=n*a,c=t*a,u=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=u*o-d*h,this.ay=d*c-u*l;let f,p,m,g;if(this.inherit==pi.OnlyTranslation)f=this.a,p=this.b,m=this.c,g=this.d;else{switch(this.inherit){case pi.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,a=1/(t*r-i*n),o=r*a,h=i*a;break}case pi.NoScale:case pi.NoScaleOrReflection:let v=$e.cosDeg(this.rotation),b=$e.sinDeg(this.rotation);t=(t*v+i*b)/this.skeleton.scaleX,n=(n*v+r*b)/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==pi.NoScale&&a<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y);let w=$e.PI/2+Math.atan2(n,t);i=Math.cos(w)*y,r=Math.sin(w)*y,a=1/(t*r-i*n),o=r*a,h=i*a,l=n*a,c=t*a}f=o*this.a-h*this.c,p=o*this.b-h*this.d,m=c*this.c-l*this.a,g=c*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)*$e.radDeg,this.arotation=Math.atan2(m,f)*$e.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*$e.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*$e.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*$e.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=$e.sinDeg(e),i=$e.cosDeg(e);return Math.atan2(this.a*t-this.c*i,this.d*i-this.b*t)*$e.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=$e.sinDeg(e),i=$e.cosDeg(e);return Math.atan2(i*this.c+t*this.d,i*this.a+t*this.b)*$e.radDeg}rotateWorld(e){e*=$e.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}},Cu=class{constructor(e,t,i){x(this,"name");x(this,"order");x(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=i}},cw=class{constructor(e,t){x(this,"data");x(this,"intValue",0);x(this,"floatValue",0);x(this,"stringValue",null);x(this,"time",0);x(this,"volume",0);x(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},hw=class{constructor(e){x(this,"name");x(this,"intValue",0);x(this,"floatValue",0);x(this,"stringValue",null);x(this,"audioPath",null);x(this,"volume",0);x(this,"balance",0);this.name=e}},gR=class{constructor(e,t){x(this,"data");x(this,"bones");x(this,"target");x(this,"bendDirection",0);x(this,"compress",!1);x(this,"stretch",!1);x(this,"mix",1);x(this,"softness",0);x(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 pi.NoScale:case pi.NoScaleOrReflection:p=t-e.worldX,m=i-e.worldY}const b=e.data.length*g;if(b>1e-4){const y=p*p+m*m;if(n&&yb*b){const w=(Math.sqrt(y)/b-1)*o+1;g*=w,a&&(v*=w)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,g,v,e.ashearX,e.ashearY)}apply2(e,t,i,n,r,a,o,h,l){if(e.inherit!=pi.Normal||t.inherit!=pi.Normal)return;let c=e.ax,u=e.ay,d=e.ascaleX,f=e.ascaleY,p=d,m=f,g=t.ascaleX,v=0,b=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,b=180):b=0;let w=t.ax,A=0,T=0,M=0,R=e.a,P=e.b,F=e.c,I=e.d,k=Math.abs(d-f)<=1e-4;!k||a?(A=0,T=R*w+e.worldX,M=F*w+e.worldY):(A=t.ay,T=R*w+P*A+e.worldX,M=F*w+I*A+e.worldY);let O=e.parent;if(!O)throw new Error("IK parent must itself have a parent.");R=O.a,P=O.b,F=O.c,I=O.d;let L=R*I-P*F,U=T-O.worldX,B=M-O.worldY;L=Math.abs(L)<=1e-4?0:1/L;let D=(U*I-B*P)*L-c,_=(B*R-U*F)*L-u,X=Math.sqrt(D*D+_*_),N=t.data.length*g,V,G;if(X<1e-4){this.apply1(e,i,n,!1,a,!1,l),t.updateWorldTransformWith(w,A,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}U=i-O.worldX,B=n-O.worldY;let j=(U*I-B*P)*L-c,ne=(B*R-U*F)*L-u,Q=j*j+ne*ne;if(h!=0){h*=d*(g+1)*.5;let we=Math.sqrt(Q),Re=we-X-N*d+h;if(Re>0){let ge=Math.min(1,Re/(h*2))-1;ge=(Re-h*(1-ge*ge))/we,j-=ge*j,ne-=ge*ne,Q=j*j+ne*ne}}e:if(k){N*=d;let we=(Q-X*X-N*N)/(2*X*N);we<-1?(we=-1,G=Math.PI*r):we>1?(we=1,G=0,a&&(R=(Math.sqrt(Q)/(X+N)-1)*l+1,p*=R,o&&(m*=R))):G=Math.acos(we)*r,R=X+N*we,P=N*Math.sin(G),V=Math.atan2(ne*R-j*P,j*R+ne*P)}else{R=d*N,P=f*N;let we=R*R,Re=P*P,ge=Math.atan2(ne,j);F=Re*X*X+we*Q-we*Re;let Ae=-2*Re*X,H=Re-we;if(I=Ae*Ae-4*H*F,I>=0){let he=Math.sqrt(I);Ae<0&&(he=-he),he=-(Ae+he)*.5;let Xe=he/H,Pe=F/he,Oe=Math.abs(Xe)=0){B=Math.sqrt(Xe)*r,V=ge-Math.atan2(B,Oe),G=Math.atan2(B/f,(Oe-X)/d);break e}}let K=$e.PI,q=X-R,z=q*q,ee=0,le=0,ve=X+R,re=ve*ve,ye=0;F=-R*X/(we-Re),F>=-1&&F<=1&&(F=Math.acos(F),U=R*Math.cos(F)+X,B=P*Math.sin(F),I=U*U+B*B,Ire&&(le=F,re=I,ve=U,ye=B)),Q<=(z+re)*.5?(V=ge-Math.atan2(ee*r,q),G=K*r):(V=ge-Math.atan2(ye*r,ve),G=le*r)}let de=Math.atan2(A,w)*y,me=e.arotation;V=(V-de)*$e.radDeg+v-me,V>180?V-=360:V<-180&&(V+=360),e.updateWorldTransformWith(c,u,me+V*l,p,m,0,0),me=t.arotation,G=((G+de)*$e.radDeg-t.ashearX)*y+b-me,G>180?G-=360:G<-180&&(G+=360),t.updateWorldTransformWith(w,A,me+G*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},uw=class extends Cu{constructor(t){super(t,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"bendDirection",0);x(this,"compress",!1);x(this,"stretch",!1);x(this,"uniform",!1);x(this,"mix",0);x(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},dw=class extends Cu{constructor(t){super(t,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"positionMode",Fn.Fixed);x(this,"spacingMode",ki.Fixed);x(this,"rotateMode",Ra.Chain);x(this,"offsetRotation",0);x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var Fn;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(Fn||(Fn={}));var ki;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(ki||(ki={}));var Ra;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(Ra||(Ra={}));var Zi;let vR=(Zi=class{constructor(e,t){x(this,"data");x(this,"bones");x(this,"target");x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"spaces",new Array);x(this,"positions",new Array);x(this,"world",new Array);x(this,"curves",new Array);x(this,"lengths",new Array);x(this,"segments",new Array);x(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){w=u/w*p;for(let T=1;T0?$e.degRad:-.01745329277777778}for(let w=0,A=3;w0){let I=T.a,k=T.b,O=T.c,L=T.d,U=0,B=0,D=0;if(o?U=m[A-1]:d[w+1]==0?U=m[A+2]:U=Math.atan2(F,P),U-=Math.atan2(O,I),y){B=Math.cos(U),D=Math.sin(U);let _=T.data.length;g+=(_*(B*I-D*O)-P)*i,v+=(_*(D*I+B*O)-F)*i}else U+=b;U>$e.PI?U-=$e.PI2:U<-3.1415927&&(U+=$e.PI2),U*=i,B=Math.cos(U),D=Math.sin(U),T.a=B*I-D*O,T.b=B*k-D*L,T.c=D*I+B*O,T.d=D*k+B*L}T.updateAppliedTransform()}}computeWorldPositions(e,t,i){let n=this.target,r=this.position,a=this.spaces,o=Ge.setArraySize(this.positions,t*3+2),h=this.world,l=e.closed,c=e.worldVerticesLength,u=c/6,d=Zi.NONE;if(!e.constantSpeed){let _=e.lengths;u-=l?1:2;let X=_[u];this.data.positionMode==Fn.Percent&&(r*=X);let N;switch(this.data.spacingMode){case ki.Percent:N=X;break;case ki.Proportional:N=X/t;break;default:N=1}h=Ge.setArraySize(this.world,8);for(let V=0,G=0,j=0;VX){d!=Zi.AFTER&&(d=Zi.AFTER,e.computeWorldVertices(n,c-6,4,h,0,2)),this.addAfterPosition(Q-X,h,0,o,G);continue}for(;;j++){let de=_[j];if(!(Q>de)){if(j==0)Q/=de;else{let me=_[j-1];Q=(Q-me)/(de-me)}break}}j!=d&&(d=j,l&&j==u?(e.computeWorldVertices(n,c-4,4,h,0,2),e.computeWorldVertices(n,0,4,h,4,2)):e.computeWorldVertices(n,j*6+2,8,h,0,2)),this.addCurvePosition(Q,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,G,i||V>0&&ne==0)}return o}l?(c+=2,h=Ge.setArraySize(this.world,c),e.computeWorldVertices(n,2,c-4,h,0,2),e.computeWorldVertices(n,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=Ge.setArraySize(this.world,c),e.computeWorldVertices(n,2,c,h,0,2));let f=Ge.setArraySize(this.curves,u),p=0,m=h[0],g=h[1],v=0,b=0,y=0,w=0,A=0,T=0,M=0,R=0,P=0,F=0,I=0,k=0,O=0,L=0;for(let _=0,X=2;_p){this.addAfterPosition(j-p,h,c-4,o,X);continue}for(;;N++){let ne=f[N];if(!(j>ne)){if(N==0)j/=ne;else{let Q=f[N-1];j=(j-Q)/(ne-Q)}break}}if(N!=d){d=N;let ne=N*6;for(m=h[ne],g=h[ne+1],v=h[ne+2],b=h[ne+3],y=h[ne+4],w=h[ne+5],A=h[ne+6],T=h[ne+7],M=(m-v*2+y)*.03,R=(g-b*2+w)*.03,P=((v-y)*3-m+A)*.006,F=((b-w)*3-g+T)*.006,I=M*2+P,k=R*2+F,O=(v-m)*.3+M+P*.16666667,L=(b-g)*.3+R+F*.16666667,D=Math.sqrt(O*O+L*L),B[0]=D,ne=1;ne<8;ne++)O+=I,L+=k,I+=P,k+=F,D+=Math.sqrt(O*O+L*L),B[ne]=D;O+=I,L+=k,D+=Math.sqrt(O*O+L*L),B[8]=D,O+=I+P,L+=k+F,D+=Math.sqrt(O*O+L*L),B[9]=D,V=0}for(j*=D;;V++){let ne=B[V];if(!(j>ne)){if(V==0)j/=ne;else{let Q=B[V-1];j=V+(j-Q)/(ne-Q)}break}}this.addCurvePosition(j*.1,m,g,v,b,y,w,A,T,o,X,i||_>0&&G==0)}return o}addBeforePosition(e,t,i,n,r){let a=t[i],o=t[i+1],h=t[i+2]-a,l=t[i+3]-o,c=Math.atan2(l,h);n[r]=a+e*Math.cos(c),n[r+1]=o+e*Math.sin(c),n[r+2]=c}addAfterPosition(e,t,i,n,r){let a=t[i+2],o=t[i+3],h=a-t[i],l=o-t[i+1],c=Math.atan2(l,h);n[r]=a+e*Math.cos(c),n[r+1]=o+e*Math.sin(c),n[r+2]=c}addCurvePosition(e,t,i,n,r,a,o,h,l,c,u,d){if(e==0||isNaN(e)){c[u]=t,c[u+1]=i,c[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,b=m*e,y=b*3,w=m*y,A=y*e,T=t*v+n*w+a*A+h*p,M=i*v+r*w+o*A+l*p;c[u]=T,c[u+1]=M,d&&(e<.001?c[u+2]=Math.atan2(r-i,n-t):c[u+2]=Math.atan2(M-(i*g+r*b*2+o*f),T-(t*g+n*b*2+a*f)))}},x(Zi,"NONE",-1),x(Zi,"BEFORE",-2),x(Zi,"AFTER",-3),x(Zi,"epsilon",1e-5),Zi),yR=class{constructor(e,t){x(this,"data");x(this,"_bone",null);x(this,"inertia",0);x(this,"strength",0);x(this,"damping",0);x(this,"massInverse",0);x(this,"wind",0);x(this,"gravity",0);x(this,"mix",0);x(this,"_reset",!0);x(this,"ux",0);x(this,"uy",0);x(this,"cx",0);x(this,"cy",0);x(this,"tx",0);x(this,"ty",0);x(this,"xOffset",0);x(this,"xVelocity",0);x(this,"yOffset",0);x(this,"yVelocity",0);x(this,"rotateOffset",0);x(this,"rotateVelocity",0);x(this,"scaleOffset",0);x(this,"scaleVelocity",0);x(this,"active",!1);x(this,"skeleton");x(this,"remaining",0);x(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,a=this.data.scaleX>0,o=this.bone,h=o.data.length;switch(e){case kr.none:return;case kr.reset:this.reset();case kr.update:const l=this.skeleton,c=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=c,this.lastTime=l.time;const u=o.worldX,d=o.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,b=this.data.limit*c,y=b*Math.abs(l.scaleY);if(b*=Math.abs(l.scaleX),i||n){if(i){const w=(this.ux-u)*p;this.xOffset+=w>b?b:w<-b?-b:w,this.ux=u}if(n){const w=(this.uy-d)*p;this.yOffset+=w>y?y:w<-y?-y:w,this.uy=d}if(f>=m){v=Math.pow(this.damping,60*m);const w=this.massInverse*m,A=this.strength,T=this.wind*g*l.scaleX,M=this.gravity*g*l.scaleY;do i&&(this.xVelocity+=(T-this.xOffset*A)*w,this.xOffset+=this.xVelocity*m,this.xVelocity*=v),n&&(this.yVelocity-=(M+this.yOffset*A)*w,this.yOffset+=this.yVelocity*m,this.yVelocity*=v),f-=m;while(f>=m)}i&&(o.worldX+=this.xOffset*t*this.data.x),n&&(o.worldY+=this.yOffset*t*this.data.y)}if(r||a){let w=Math.atan2(o.c,o.a),A=0,T=0,M=0,R=this.cx-o.worldX,P=this.cy-o.worldY;if(R>b?R=b:R<-b&&(R=-b),P>y?P=y:P<-y&&(P=-y),r){M=(this.data.rotate+this.data.shearX)*t;let F=Math.atan2(P+this.ty,R+this.tx)-w-this.rotateOffset*M;this.rotateOffset+=(F-Math.ceil(F*$e.invPI2-.5)*$e.PI2)*p,F=this.rotateOffset*M+w,A=Math.cos(F),T=Math.sin(F),a&&(F=h*o.getWorldScaleX(),F>0&&(this.scaleOffset+=(R*A+P*T)*p/F))}else{A=Math.cos(w),T=Math.sin(w);const F=h*o.getWorldScaleX();F>0&&(this.scaleOffset+=(R*A+P*T)*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,O=Ip.yDown?-this.gravity:this.gravity,L=h/g;for(;;)if(f-=m,a&&(this.scaleVelocity+=(k*A-O*T-this.scaleOffset*I)*F,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=v),r){if(this.rotateVelocity-=((k*T+O*A)*L+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,c=Math.sin(f),u=Math.cos(f),d=o.b,o.b=u*d-c*o.d,o.d=c*d+u*o.d),f+=l*this.data.shearX,c=Math.sin(f),u=Math.cos(f),d=o.a,o.a=u*d-c*o.c,o.c=c*d+u*o.c}else l*=this.data.rotate,c=Math.sin(l),u=Math.cos(l),d=o.a,o.a=u*d-c*o.c,o.c=c*d+u*o.c,d=o.b,o.b=u*d-c*o.d,o.d=c*d+u*o.d}if(a){const l=1+this.scaleOffset*t*this.data.scaleX;o.a*=l,o.c*=l}e!=kr.pose&&(this.tx=h*o.a,this.ty=h*o.c),o.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,i){const n=i*$e.degRad,r=Math.cos(n),a=Math.sin(n),o=this.cx-e,h=this.cy-t;this.translate(o*r-h*a-o,o*a+h*r-h)}},xR=class{constructor(e,t){x(this,"data");x(this,"bone");x(this,"color");x(this,"darkColor",null);x(this,"attachment",null);x(this,"attachmentState",0);x(this,"sequenceIndex",-1);x(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 Mt,this.darkColor=e.darkColor?new Mt:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof mr)||!(this.attachment instanceof mr)||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){x(this,"data");x(this,"bones");x(this,"target");x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0);x(this,"temp",new Fh);x(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?$e.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,b=g.length;v$e.PI?R-=$e.PI2:R<-3.1415927&&(R+=$e.PI2),R*=e;let P=Math.cos(R),F=Math.sin(R);y.a=P*w-F*T,y.b=P*A-F*M,y.c=F*w+P*T,y.d=F*A+P*M}if(o){let w=this.temp;h.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(w.x-y.worldX)*t,y.worldY+=(w.y-y.worldY)*i}if(n!=0){let w=Math.sqrt(y.a*y.a+y.c*y.c);w!=0&&(w=(w+(Math.sqrt(l*l+u*u)-w+this.data.offsetScaleX)*n)/w),y.a*=w,y.c*=w}if(r!=0){let w=Math.sqrt(y.b*y.b+y.d*y.d);w!=0&&(w=(w+(Math.sqrt(c*c+d*d)-w+this.data.offsetScaleY)*r)/w),y.b*=w,y.d*=w}if(a>0){let w=y.b,A=y.d,T=Math.atan2(A,w),M=Math.atan2(d,c)-Math.atan2(u,l)-(T-Math.atan2(y.c,y.a));M>$e.PI?M-=$e.PI2:M<-3.1415927&&(M+=$e.PI2),M=T+(M+m)*a;let R=Math.sqrt(w*w+A*A);y.b=Math.cos(M)*R,y.d=Math.sin(M)*R}y.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,a=this.mixShearY,o=t!=0||i!=0,h=this.target,l=h.a,c=h.b,u=h.c,d=h.d,f=l*d-c*u>0?$e.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,b=g.length;v$e.PI?R-=$e.PI2:R<-3.1415927&&(R+=$e.PI2),R*=e;let P=Math.cos(R),F=Math.sin(R);y.a=P*w-F*T,y.b=P*A-F*M,y.c=F*w+P*T,y.d=F*A+P*M}if(o){let w=this.temp;h.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),y.worldX+=w.x*t,y.worldY+=w.y*i}if(n!=0){let w=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*n+1;y.a*=w,y.c*=w}if(r!=0){let w=(Math.sqrt(c*c+d*d)-1+this.data.offsetScaleY)*r+1;y.b*=w,y.d*=w}if(a>0){let w=Math.atan2(d,c)-Math.atan2(u,l);w>$e.PI?w-=$e.PI2:w<-3.1415927&&(w+=$e.PI2);let A=y.b,T=y.d;w=Math.atan2(T,A)+(w-$e.PI/2+m)*a;let M=Math.sqrt(A*A+T*T);y.b=Math.cos(w)*M,y.d=Math.sin(w)*M}y.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,a=this.mixShearY,o=this.target,h=this.bones;for(let l=0,c=h.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 Fh,i=new Fh;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,a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let c=0,u=r.length;c=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 Nr;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(Nr||(Nr={}));let pw=class extends Cu{constructor(t){super(t,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0);x(this,"offsetRotation",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"offsetScaleX",0);x(this,"offsetScaleY",0);x(this,"offsetShearY",0);x(this,"relative",!1);x(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Cm=class{constructor(e){x(this,"scale",1);x(this,"attachmentLoader");x(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,i=new Bh;i.name="";let n=new wR(e),r=n.readInt32(),a=n.readInt32();i.hash=a==0&&r==0?null:a.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 o=n.readBoolean();o&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let h=0;h=n.readInt(!0);for(let c=0;c>1&3,f.rotateMode=p>>3&3,(p&128)!=0&&(f.offsetRotation=n.readFloat()),f.position=n.readFloat(),f.positionMode==Fn.Fixed&&(f.position*=t),f.spacing=n.readFloat(),(f.spacingMode==ki.Length||f.spacingMode==ki.Fixed)&&(f.spacing*=t),f.mixRotate=n.readFloat(),f.mixX=n.readFloat(),f.mixY=n.readFloat(),i.pathConstraints.push(f)}h=n.readInt(!0);for(let c=0,u;c>4,e.readFloat())}n.push(T);break}}}}}let a=e.readInt(!0);if(a>0){let l=new vl(a),c=i.slots.length;for(let u=0;u=0;b--)p[b]=-1;let m=Ge.newArray(c-f,0),g=0,v=0;for(let b=0;b=0;b--)p[b]==-1&&(p[b]=m[--v]);l.setFrame(u,d,p)}n.push(l)}let o=e.readInt(!0);if(o>0){let l=new Cp(o);for(let c=0;c>>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}},SR=class{constructor(e,t,i,n,r){x(this,"parent");x(this,"skinIndex");x(this,"slotIndex");x(this,"mesh");x(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.parent=n,this.inheritTimeline=r}},_R=class{constructor(e=null,t=null,i=0){x(this,"bones");x(this,"vertices");x(this,"length");this.bones=e,this.vertices=t,this.length=i}};var Hn;(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"})(Hn||(Hn={}));function zi(s,e,t){let i=s.readFloat(),n=s.readFloat()*t;for(let r=0,a=0,o=e.getFrameCount()-1;e.setFrame(r,i,n),r!=o;r++){let h=s.readFloat(),l=s.readFloat()*t;switch(s.readByte()){case xn:e.setStepped(r);break;case bn:Bt(s,e,a++,r,0,i,h,n,l,t)}i=h,n=l}return e}function Sf(s,e,t){let i=s.readFloat(),n=s.readFloat()*t,r=s.readFloat()*t;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,i,n,r),a!=h;a++){let l=s.readFloat(),c=s.readFloat()*t,u=s.readFloat()*t;switch(s.readByte()){case xn:e.setStepped(a);break;case bn:Bt(s,e,o++,a,0,i,l,n,c,t),Bt(s,e,o++,a,1,i,l,r,u,t)}i=l,n=c,r=u}return e}function Bt(s,e,t,i,n,r,a,o,h,l){e.setBezier(t,i,n,r,o,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,a,h)}const MR=0,TR=1,AR=2,ER=3,CR=4,IR=5,RR=6,PR=7,kR=8,FR=9,OR=10,BR=0,LR=1,DR=2,NR=3,UR=4,XR=5,VR=0,YR=1,$R=0,GR=1,HR=2,jR=0,WR=1,zR=2,qR=4,KR=5,ZR=6,JR=7,QR=8,xn=1,bn=2;class ds{constructor(){x(this,"convexPolygons",new Array);x(this,"convexPolygonsIndices",new Array);x(this,"indicesArray",new Array);x(this,"isConcaveArray",new Array);x(this,"triangles",new Array);x(this,"polygonPool",new kh(()=>new Array));x(this,"polygonIndicesPool",new kh(()=>new Array))}triangulate(e){let t=e,i=e.length>>1,n=this.indicesArray;n.length=0;for(let o=0;o3;){let o=i-1,h=0,l=1;for(;;){e:if(!r[h]){let d=n[o]<<1,f=n[h]<<1,p=n[l]<<1,m=t[d],g=t[d+1],v=t[f],b=t[f+1],y=t[p],w=t[p+1];for(let A=(l+1)%i;A!=o;A=(A+1)%i){if(!r[A])continue;let T=n[A]<<1,M=t[T],R=t[T+1];if(ds.positiveArea(y,w,m,g,M,R)&&ds.positiveArea(m,g,v,b,M,R)&&ds.positiveArea(v,b,y,w,M,R))break e}break}if(l==0){do{if(!r[h])break;h--}while(h>0);break}o=h,h=l,l=(l+1)%i}a.push(n[(i+h-1)%i]),a.push(n[h]),a.push(n[(h+1)%i]),n.splice(h,1),r.splice(h,1),i--;let c=(i+h-1)%i,u=h==i?0:h;r[c]=ds.isConcave(c,i,t,n),r[u]=ds.isConcave(u,i,t,n)}return i==3&&(a.push(n[2]),a.push(n[0]),a.push(n[1])),a}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 a=this.polygonIndicesPool.obtain();a.length=0;let o=this.polygonPool.obtain();o.length=0;let h=-1,l=0;for(let c=0,u=t.length;c0?(n.push(o),r.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),o=this.polygonPool.obtain(),o.length=0,o.push(m),o.push(g),o.push(v),o.push(b),o.push(y),o.push(w),a=this.polygonIndicesPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),l=ds.winding(m,g,v,b,y,w),h=d)}o.length>0&&(n.push(o),r.push(a));for(let c=0,u=n.length;c=0;c--)o=n[c],o.length==0&&(n.splice(c,1),this.polygonPool.free(o),a=r[c],r.splice(c,1),this.polygonIndicesPool.free(a));return n}static isConcave(e,t,i,n){let r=n[(t+e-1)%t]<<1,a=n[e]<<1,o=n[(e+1)%t]<<1;return!this.positiveArea(i[r],i[r+1],i[a],i[a+1],i[o],i[o+1])}static positiveArea(e,t,i,n,r,a){return e*(a-n)+i*(t-a)+r*(n-t)>=0}static winding(e,t,i,n,r,a){let o=i-e,h=n-t;return r*h-a*o+o*t-e*h>=0?1:-1}}class Lh{constructor(){x(this,"triangulator",new ds);x(this,"clippingPolygon",new Array);x(this,"clipOutput",new Array);x(this,"clippedVertices",new Array);x(this,"clippedUVs",new Array);x(this,"clippedTriangles",new Array);x(this,"scratch",new Array);x(this,"clipAttachment",null);x(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let i=t.worldVerticesLength,n=Ge.setArraySize(this.clippingPolygon,i);t.computeWorldVertices(e,0,i,n,0,2);let r=this.clippingPolygon;Lh.makeClockwise(r);let a=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let o=0,h=a.length;o>1,T=this.clipOutput,M=Ge.setArraySize(r,y+A*2);for(let P=0;P>1,G=this.clipOutput,j=Ge.setArraySize(l,L+V*f);for(let Q=0;Q>1,X=this.clipOutput,N=Ge.setArraySize(a,I+_*2),V=Ge.setArraySize(o,I+_*2);for(let j=0;j=2?(u=h,h=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(a),u.push(e),u.push(t),h.length=0;let d=o.length-4,f=o;for(let p=0;;p+=2){let m=f[p],g=f[p+1],v=m-f[p+2],b=g-f[p+3],y=h.length,w=u;for(let T=0,M=u.length-2;Tv*(g-I),O=b*(m-R)-v*(g-P);if(O>0){if(k){h.push(F),h.push(I);continue}let L=F-R,U=I-P,B=O/(L*b-U*v);if(B>=0&&B<=1)h.push(R+L*B),h.push(P+U*B);else{h.push(F),h.push(I);continue}}else if(k){let L=F-R,U=I-P,B=O/(L*b-U*v);if(B>=0&&B<=1)h.push(R+L*B),h.push(P+U*B),h.push(F),h.push(I);else{h.push(F),h.push(I);continue}}c=!0}if(y==h.length)return l.length=0,!0;if(h.push(h[0]),h.push(h[1]),p==d)break;let A=h;h=u,h.length=0,u=A}if(l!=h){l.length=0;for(let p=0,m=h.length-2;p>1;l0){let c=i.findPhysicsConstraint(o);if(!c)throw new Error("Physics constraint not found: "+o);l=i.physicsConstraints.indexOf(c)}for(let c in h){let u=h[c],d=u[0];if(!d)continue;let f=u.length;if(c=="reset"){const m=new J1(f,l);for(let g=0;d!=null;d=u[g+1],g++)m.setFrame(g,ae(d,"time",0));r.push(m);continue}let p;if(c=="inertia")p=new H1(f,f,l);else if(c=="strength")p=new j1(f,f,l);else if(c=="damping")p=new W1(f,f,l);else if(c=="mass")p=new z1(f,f,l);else if(c=="wind")p=new q1(f,f,l);else if(c=="gravity")p=new K1(f,f,l);else if(c=="mix")p=new Z1(f,f,l);else continue;r.push(Ys(u,p,0,1))}}if(e.attachments)for(let o in e.attachments){let h=e.attachments[o],l=i.findSkin(o);if(!l)throw new Error("Skin not found: "+o);for(let c in h){let u=h[c],d=i.findSlot(c);if(!d)throw new Error("Slot not found: "+c);let f=d.index;for(let p in u){let m=u[p],g=l.getAttachment(f,p);for(let v in m){let b=m[v],y=b[0];if(y){if(v=="deform"){let w=g.bones,A=g.vertices,T=w?A.length/3*2:A.length,M=new U1(b.length,b.length,f,g),R=ae(y,"time",0);for(let P=0,F=0;;P++){let I,k=ae(y,"vertices",null);if(!k)I=w?Ge.newFloatArray(T):A;else{I=Ge.newFloatArray(T);let B=ae(y,"offset",0);if(Ge.arrayCopy(k,0,I,B,k.length),n!=1)for(let D=B,_=D+k.length;D<_;D++)I[D]*=n;if(!w)for(let D=0;D=0;v--)d[v]==-1&&(d[v]=p[--g])}o.setFrame(l,ae(u,"time",0),d)}r.push(o)}if(e.events){let o=new Cp(e.events.length),h=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 Wn=class Wn extends dR{constructor(t){super(t.resource.source);x(this,"texture");this.texture=mt.from(t)}static from(t){return Wn.textureMap.has(t)?Wn.textureMap.get(t):new Wn(t)}setFilters(t,i){this.texture.baseTexture.scaleMode=Wn.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=Wn.toPixiMipMap(t)}setWraps(t,i){this.texture.baseTexture.wrapMode=Wn.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case Di.Nearest:case Di.MipMapNearestLinear:case Di.MipMapNearestNearest:return zs.NEAREST;case Di.Linear:case Di.MipMapLinearLinear:case Di.MipMapLinearNearest:return zs.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case Di.Nearest:case Di.Linear:return Bs.OFF;case Di.MipMapNearestLinear:case Di.MipMapNearestNearest:case Di.MipMapLinearLinear:case Di.MipMapLinearNearest:return Bs.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case lr.ClampToEdge:return Zs.CLAMP;case lr.MirroredRepeat:return Zs.MIRRORED_REPEAT;case lr.Repeat:return Zs.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case Nr.Normal:return ut.NORMAL;case Nr.Additive:return ut.ADD;case Nr.Multiply:return ut.MULTIPLY;case Nr.Screen:return ut.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};x(Wn,"textureMap",new Map);let Ba=Wn;const zn=class zn extends Dl{constructor(){const t=new _p;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const i=new Ch(mt.EMPTY);super(t,i);x(this,"name","");x(this,"warnedTwoTint",!1)}updateFromSpineData(t,i,n,r,a,o,h,l){var v,b;this.texture=t.texture;const c=a/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((v=u.data)==null?void 0:v.length)!==c&&(u.data=new Float32Array(c));const d=this.geometry.getBuffer("aVertexPosition");((b=d.data)==null?void 0:b.length)!==c&&(d.data=new Float32Array(c));let f=0,p=u.data,m=d.data;for(let y=0;ynew Im);x(this,"beforeUpdateWorldTransforms",()=>{});x(this,"afterUpdateWorldTransforms",()=>{});x(this,"_autoUpdate",!1);x(this,"_ticker",ls.shared);x(this,"meshesCache",new Map);x(this,"lightColor",new Mt);x(this,"darkColor",new Mt);x(this,"_boundsProvider");x(this,"_boundsPoint",new Xt);x(this,"_boundsSpineID",-1);x(this,"_boundsSpineDirty",!0);x(this,"slotsObject",new Map);x(this,"verticesCache",Ge.newFloatArray(1024));x(this,"clippingSlotToPixiMasks",{});x(this,"currentClippingSlot");const n=t instanceof Bh?t:t.skeletonData;this.skeleton=new Ip(n);const r=new uR(n);this.state=new aR(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(a=>!!a.data.darkColor):t==null?void 0:t.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new yl)):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??ls.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 yl&&(this.darkTint=!0),i.destroy()}else for(let i=0;inew yl,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(kr.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 o;let r=this.getSlotFromRef(t);const a=(o=this.slotsObject.get(r))==null?void 0:o.container;if(!(a&&a===i)){for(const[h,{container:l}]of this.slotsObject)if(h!==r&&l===i){this.removeSlotObject(h,i);break}a&&this.removeChild(a),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 a;let n=this.getSlotFromRef(t),r=(a=this.slotsObject.get(n))==null?void 0:a.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:a}=t,o=a?!!i.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(i)&&o,r.visible){let h=i.bone;const l=r.localTransform;l.a=h.a,l.b=h.c,l.c=-h.b,l.d=-h.d,l.tx=h.worldX,l.ty=h.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 o,h;const n=t.attachment;if(n&&n instanceof Mo){const l=(o=this.clippingSlotToPixiMasks)[h=t.data.name]||(o[h]={slot:t,vertices:new Array});l.maskComputed=!1,this.currentClippingSlot=l;return}let r=this.currentClippingSlot;const a=this.slotsObject.get(t);if(r&&a){let l=r.mask;if(l||(l=Gv.obtain(),r.mask=l,this.addChild(l)),!r.maskComputed){let c=r.slot,u=c.attachment;r.maskComputed=!0;const d=u.worldVerticesLength,f=r.vertices;u.computeWorldVertices(c,0,d,f,0,2),l.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}a.container.mask=l}else a!=null&&a.container.mask&&(a.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),i){for(const l in this.clippingSlotToPixiMasks){const c=this.clippingSlotToPixiMasks[l];(!(c.slot.attachment instanceof Mo)||!c.maskComputed)&&c.mask&&(this.removeChild(c.mask),Gv.free(c.mask),c.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var r,a;this.resetMeshes();let t=null,i=null;const n=this.skeleton.drawOrder;for(let o=0,h=n.length,l=0;o>1)*p,b>this.verticesCache.length&&(this.verticesCache=Ge.newFloatArray(b)),y.computeWorldVertices(c,0,y.worldVerticesLength,this.verticesCache,0,p),t=y.triangles,i=y.uvs,v=(a=y.region)==null?void 0:a.texture}else if(m instanceof Mo){Vt.clipper.clipStart(c,m);continue}else{this.hasMeshForSlot(c)&&(this.getMeshForSlot(c).visible=!1),Vt.clipper.clipEndWithSlot(c);continue}if(v!=null){const w=c.bone.skeleton.color,A=c.color,T=w.a*A.a*g.a;this.lightColor.set(w.r*A.r*g.r,w.g*A.g*g.g,w.b*A.b*g.b,T),c.darkColor!=null?this.darkColor.set(c.darkColor.r,c.darkColor.g,c.darkColor.b,1):this.darkColor.set(0,0,0,1);let M,R,P,F;if(Vt.clipper.isClipping())Vt.clipper.clipTriangles(this.verticesCache,t,t.length,i,this.lightColor,this.darkColor,f),M=Vt.clipper.clippedVertices,R=M.length,P=Vt.clipper.clippedTriangles,F=P.length;else{const k=this.verticesCache;for(let O=2,L=0,U=b;Onew ms);Ip.yDown=!0;const Fc="spineTextureAtlasLoader",aP={extension:He.Asset,resolver:{test:s=>gs(s,".atlas"),parse:s=>{var t,i;const e=s.split(".");return{resolution:parseFloat(((i=(t=We.RETINA_PREFIX)==null?void 0:t.exec(s))==null?void 0:i[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:Fc,extension:{type:He.LoadParser,priority:_s.Normal,name:Fc},test(s){return gs(s,".atlas")},async load(s){const e=await We.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${Fc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return await e.text()},testParse(s,e){const t=gs(e.src,".atlas"),i=typeof s=="string",n=e.loadParser===Fc;return Promise.resolve((t||n)&&i)},unload(s){s.dispose()},async parse(s,e,t){var h;const i=e.data||{};let n=Si.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const r=new sw(s);if(i.images instanceof gt||typeof i.images=="string"){const l=i.images;i.images={},i.images[r.pages[0].name]=l}const a=[];let o=!0;for(const l of t.parsers)if(l.name=="loadTextures"){o=(h=l.config)==null?void 0:h.preferCreateImageBitmap;break}Rn.setPreferences({preferCreateImageBitmap:!1});for(const l of r.pages){const c=l.name,u=i!=null&&i.images?i.images[c]:void 0;if(u instanceof gt)l.setTexture(Ba.from(u));else{const d=u??Si.normalize([...n.split(Si.sep),c].join(Si.sep)),f={src:_h(d,e.src),data:{...i.imageMetadata,alphaMode:l.pma?Xi.PMA:Xi.UNPACK}},p=t.load(f).then(m=>{l.setTexture(Ba.from(m.baseTexture))});a.push(p)}}return await Promise.all(a),Rn.setPreferences({preferCreateImageBitmap:o}),r}}};tt.add(aP);const Oc="spineSkeletonLoader";function oP(s){return s.hasOwnProperty("bones")}function lP(s){return s instanceof Uint8Array}const cP={extension:He.Asset,loader:{name:Oc,extension:{type:He.LoadParser,priority:_s.Normal,name:Oc},test(s){return gs(s,".skel")},async load(s){const e=await We.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${Oc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return new Uint8Array(await e.arrayBuffer())},testParse(s,e){const t=gs(e.src,".json")&&oP(s),i=gs(e.src,".skel")&&lP(s),n=e.loadParser===Oc;return Promise.resolve(t||i||n)}}};tt.add(cP);class hP extends Bn{constructor(t=!1){super();x(this,"_buffer");x(this,"_indexBuffer");this._buffer=new oi(void 0,t,!1),this._indexBuffer=new oi(void 0,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,et.FLOAT).addAttribute("aColor",this._buffer,4,!0,et.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,et.FLOAT).addIndex(this._indexBuffer)}}const uP=` -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; - -} -`,dP=` -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 gw extends Tr{constructor(e){super(e),this.shaderGenerator=new ob(uP,dP),this.geometryClass=hP,this.vertexSize=7}packInterleavedGeometry(e,t,i,n,r){const{uint32View:a,float32View:o}=t,h=n/this.vertexSize,l=e.uvs,c=e.indices,u=e.vertexData,d=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),p=Wt.shared.setValue(e._tintRGB).toPremultiplied(f,!0),m=Wt.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let a=function(l){return Promise.all(l.map(c=>Promise.resolve(c).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),h=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));n=a(t.map(l=>{if(l=vP(l),l in Hv)return;Hv[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":gP,c||(d.as="script"),d.crossOrigin="",d.href=l,h&&d.setAttribute("nonce",h),document.head.appendChild(d),c)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return n.then(a=>{for(const o of a||[])o.status==="rejected"&&r(o.reason);return e().catch(r)})};async function yw(){const[s,e]=await Promise.all([jv(()=>import("./index-BrVMjrya.js"),[]),jv(()=>import("./index-C_0QkTeX.js"),__vite__mapDeps([0,1]))]);return{core:s,pixi:e}}async function yP(s,e,t){const{core:i,pixi:n}=await yw(),r=new i.TextureAtlas(e);return Rp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonJson(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}async function xP(s,e,t){const{core:i,pixi:n}=await yw(),r=new i.TextureAtlas(e);return Rp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonBinary(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}function Fr(s,e,t){const i=Number(s[e]);return Number.isFinite(i)?i:t}function ps(s,e,t,i){s[e]==null&&(s[e]=Fr(s,t,i))}function Pp(s,e,t){if(typeof s.curve!="number")return;const i=Fr(s,"time",0),r=Fr(e,"time",0)-i,a=s.curve,o=Fr(s,"c2",0),h=Fr(s,"c3",1),l=Fr(s,"c4",1);s.curve=t.flatMap(([c,u])=>[i+r*a,c+(u-c)*o,i+r*h,c+(u-c)*l]),delete s.c2,delete s.c3,delete s.c4}function Ur(s,e){if(Array.isArray(s))for(let t=0;t[Fr(i,r,a),Fr(n,r,a)]))}}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 Wv(s,e){if(Array.isArray(s))for(let t=0;t[o,a[h]]))}}function wP(s){for(const e of s.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of s.transform||[])ps(e,"mixRotate","rotateMix",1),ps(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),ps(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),ps(e,"mixShearY","shearMix",1);for(const e of s.path||[])ps(e,"mixRotate","rotateMix",1),ps(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function SP(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 _P(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),Wv(e.rgba,!1),Wv(e.rgba2,!0)}function MP(s){for(const e of Object.values(s.bones||{})){for(const t of e.rotate||[])ps(t,"value","angle",0);Ur(e.rotate,[{key:"value",fallback:0}]),Ur(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),Ur(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),Ur(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function TP(s){for(const e of Object.values(s.ik||{}))Ur(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function AP(s){for(const e of Object.values(s.transform||{})){for(const t of e)ps(t,"mixRotate","rotateMix",1),ps(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),ps(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),ps(t,"mixShearY","shearMix",1);Ur(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 EP(s){for(const e of Object.values(s.path||{})){for(const i of["position","spacing"]){const n=e[i];for(const r of n||[])ps(r,"value",i,0);Ur(n,[{key:"value",fallback:0}])}const t=e.mix;for(const i of t||[])ps(i,"mixRotate","rotateMix",1),ps(i,"mixX","translateMix",1),i.mixY==null&&(i.mixY=i.mixX);Ur(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function CP(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,a]of Object.entries(i)){const o=n[r]||(n[r]={});for(const[h,l]of Object.entries(a)){const c=o[h]||(o[h]={});c.deform=l,bP(l)}}}delete s.deform}function xw(s){wP(s),SP(s);for(const e of Object.values(s.animations||{}))_P(e),MP(e),TP(e),AP(e),EP(e),CP(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return s}function IP(s){return s.replace(/\\/g,"/").split("/").pop()||s}async function RP(s){const e=await Promise.all(s.map(async t=>{const i=URL.createObjectURL(t);try{return[IP(t.name).toLowerCase(),await mt.fromURL(i)]}finally{URL.revokeObjectURL(i)}}));return new Map(e)}function PP(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 bw(s,e,t){var a;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 RP(t),r=[...n.values()];try{let o,h,l=null,c;if(/\.skel$/i.test(s.name)){const u=await s.arrayBuffer();try{({skeletonData:o,SpineClass:h}=await xP(u,i,n)),c="4.3"}catch(d){try{({skeletonData:o,SpineClass:h}=pP(u,i,n)),c="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=Ph(o.version)}else{let u;try{u=JSON.parse(await s.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(l=Ph((a=u==null?void 0:u.skeleton)==null?void 0:a.spine),!l)throw new Error(`Spine JSON 版本不受支持,仅支持 ${_m()}`);c=WI(l),l==="3.8"&&xw(u);const d=c==="4.3"?await yP(u,i,n):mP(u,i,n);o=d.skeletonData,h=d.SpineClass}if(!l)throw new Error(`Spine 数据版本不受支持,仅支持 ${_m()}`);return{skeletonData:o,textures:r,runtimeVersion:c,SpineClass:h,dataVersion:l,animations:o.animations.map(u=>({name:u.name,duration:u.duration})),bones:PP(o)}}catch(o){for(const h of r)h.destroy(!0);throw o}}function Jc(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 kP(s,e,t){return{skeleton:{name:s.name,dataUrl:await Jc(s)},atlas:{name:e.name,dataUrl:await Jc(e)},textures:await Promise.all(t.map(async i=>({name:i.name,dataUrl:await Jc(i)})))}}async function Mf(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 FP(s){return{skeleton:await Mf(s.skeleton),atlas:await Mf(s.atlas),textures:await Promise.all(s.textures.map(Mf))}}const ww="SpineParticle.EditorConfig",Sw=1;function _w(s){return{backgroundX:s.backgroundX,backgroundY:s.backgroundY,backgroundOpacity:s.backgroundOpacity,backgroundImageName:s.backgroundImageName,backgroundImageData:s.backgroundImageData,showGrid:s.showGrid,exportSettings:hi(s.exportSettings)}}function OP(s){return JSON.parse(JSON.stringify(s,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function Mw(s){const e=hi(s);return delete e.tags,delete e.selectedTag,e}function BP(s){const e=_w(s.settings);return OP({format:ww,version:Sw,savedAt:new Date().toISOString(),editor:hi(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=>({...hi(t),frames:void 0})),colliders:s.colliders.map(Mw),paths:hi(s.paths),spines:hi(s.spines)}})}function LP(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function Tw(s){const e=BP(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=LP(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),0),e}function Aw(s){let e;try{e=JSON.parse(s)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==ww)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==Sw)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 DP(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 a=e.get(r);return a||(a=mt.fromURL(r).then(o=>Or(o)),e.set(r,a)),a},i=await t("/images/star.png");await Promise.all(s.map(async n=>{var a;const r=Gr(n.config);r.texture=i,await Promise.all(r.imageResources.map(async o=>{o.texture=await t(o.previewUrl||"/images/star.png"),await Promise.all(o.sequenceFrames.map(async h=>{h.texture=await t(h.previewUrl||o.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async o=>{o.texture=await t(o.previewUrl||"/images/trail.png")})),r.trailTexture=((a=r.trailResources[0])==null?void 0:a.texture)||null,n.frames=[]}))}async function NP(s){const e=new Map;try{for(const t of s){if(!t.sourceBundle)continue;const i=await FP(t.sourceBundle);e.set(t.id,await bw(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 UP(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 XP(s,e){var c,u,d,f,p,m,g;const t=Aw(JSON.stringify(e)),i=hi(t.scene.systems),n=t.scene.colliders.map(Mw),r=hi(t.scene.paths),a=hi(t.scene.spines);for(const v of a)v.sourceBundle==null&&(v.sourceBundle=null),v.dataVersion==null&&(v.dataVersion="");await DP(i);const o=await NP(a),h=new Map(s.spines.map(v=>[v.id,v.assetVersion]));for(const v of s.spines)ql(v.id);s.systems=i,s.colliders=n,s.paths=r,s.spines=a,Object.assign(s.editor,hi(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=p1((c=t.settings)==null?void 0:c.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 b=o.get(v.id);if(v.assetVersion=Math.max(Number(v.assetVersion)||0,h.get(v.id)||0)+1,!b){v.status="empty",v.error=v.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",v.animations=[],v.bones=[],v.selectedAnimation="";continue}Au(v.id,b),v.dataVersion=b.dataVersion,v.animations=b.animations,v.bones=b.bones,b.animations.some(y=>y.name===v.selectedAnimation)||(v.selectedAnimation=((p=b.animations[0])==null?void 0:p.name)||""),v.status="ready",v.error=""}s.syncSceneSequences(),UP(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 Ew(s,e){return XP(s,Aw(e))}async function VP(s,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return Ew(s,await e.text())}const Iu=La({undoCount:0});let Uh=null,tr=null,Xr=[],Jo=null,ir=null,Xh=!1;function kp(s){return{systems:s.systems.map(t=>{const i=hi(t);return i.frames=void 0,i}),colliders:hi(s.colliders),paths:hi(s.paths),spines:hi(s.spines),animations:[...s.timeline.animations],settings:_w(s.settings)}}function Fp(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 Cw(s,e=kp(s),t=Fp(e)){const i=new Map;for(const n of e.spines){const r=HI(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())$I(e);s.spineAssets.clear()}}function Iw(s){for(;Xr.length>s;)Vh(Xr.shift()||null);Iu.undoCount=Xr.length}function Rw(){const s=Uh;if(!s||!tr||Xh)return;const e=kp(s),t=Fp(e);t!==tr.signature&&(Xr.push(tr),tr=Cw(s,e,t),Iw(s.settings.undoLimit))}function YP(){Xh||(ir&&clearTimeout(ir),ir=setTimeout(()=>{ir=null,Rw()},250))}function $P(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 GP(s){var t,i;if(!$P(s)){const n=s.systems[0],r=s.colliders[0],a=s.paths[0],o=s.spines[0];n?(s.activeObjectType="particle",s.activeObjectId=n.id):r?(s.activeObjectType="collision",s.activeObjectId=r.id):a?(s.activeObjectType="path",s.activeObjectId=a.id):(s.activeObjectType="spine",s.activeObjectId=(o==null?void 0:o.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 HP(s,e){const t=tr;Xh=!0;try{for(const i of s.spines)ql(i.id);s.systems=hi(e.data.systems),s.colliders=hi(e.data.colliders),s.paths=hi(e.data.paths),s.spines=hi(e.data.spines),s.timeline.animations=[...e.data.animations],Object.assign(s.settings,hi(e.data.settings));for(const[i,n]of e.spineAssets)Au(i,n);for(const i of s.systems)i.frames=[];s.timeline.recorded=!1,s.timeline.playing=!1,GP(s),s.recalcTotalFrames(),tr=e}finally{Xh=!1,Vh(t)}}function jP(s){if(!(Uh===s&&Jo)){Jo==null||Jo(),ir&&clearTimeout(ir),Vh(tr);for(const e of Xr)Vh(e);Xr=[],Uh=s,tr=Cw(s),Iu.undoCount=0,Jo=cs(()=>Fp(kp(s)),YP,{flush:"post"})}}function WP(s,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));s.settings.undoLimit=t,Iw(t)}function Tf(){const s=Uh;if(!s||!tr)return!1;ir&&(clearTimeout(ir),ir=null),Rw();const e=Xr.pop();return e?(HP(s,e),Iu.undoCount=Xr.length,!0):!1}function zP(s){const e=s instanceof HTMLElement?s:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function qP(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||zP(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]))}Da(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),Gl(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const KP={class:"stage-wrap"},ZP={class:"topbar"},JP=["disabled"],QP={class:"tool-group"},ek={class:"tool-group"},tk={key:0,class:"background-panel"},ik=["disabled"],sk=["title"],nk={class:"background-position-row"},rk={class:"background-opacity-row"},ak={class:"zoom-pct"},ok={key:0,class:"settings-panel"},lk={class:"sp-head"},ck={class:"sp-switch-row"},hk={class:"sp-switch-control"},uk={class:"sp-row"},dk={class:"sp-chk"},fk={class:"sp-chk"},mk={class:"sp-row"},pk={class:"sp-row"},gk={class:"sp-chk"},vk={class:"sp-chk"},yk={class:"sp-row"},xk={class:"sp-row"},bk={class:"sp-row"},wk={class:"sp-hex"},Sk={class:"sp-chk"},_k={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},Mk={class:"help-head"},Tk={key:2,class:"hud"},Ak={class:"hud-number hud-system-count"},Ek={class:"hud-number hud-particle-count"},Ck=sn({__name:"Stage",setup(s){const e=Kl(),t=ht(null),i=ht(null),n=ht(!1),r=ht(!1),a=ht(!1),o=ht(null),h=pt(()=>e.settings.backgroundImageName),l=ht(""),c=ht(!1);function u(W){l.value=l.value===W?"":W}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);function d(){e.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),e.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2))}qP({canvasElement:t,canvasFocused:c,undo:Tf,save:()=>Tw(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:W=>{l.value=W}});let f=null,p=null,m=null,g=null,v=0,b=null,y=null,w=null,A=null,T=null,M=null,R=null,P=null,F=null,I=null,k=null,O=null,L=[],U=0,B=0,D=0,_=0,X=null,N=null;const V=new Map,G=new Map;let j=[];const ne=new Map,Q=new Set;let de=!1;cs(()=>[e.activeObjectType,e.activeObjectId],()=>Q.clear());async function me(){if(X&&N)return X;const[W,Y]=await Promise.all([mt.fromURL("/images/star.png"),mt.fromURL("/images/trail.png")]);return X=W,N=Y,X}function we(){p=new ji,f.stage.addChild(p),k=new ji,f.stage.addChild(k),m=new Wr(mt.EMPTY),m.anchor.set(.5),m.visible=!1,p.addChild(m),I=new ms,p.addChild(I),O=new rR,p.addChild(O.container),y=new ms,p.addChild(y),b=new ms,p.addChild(b),A=new ms,p.addChild(A),T=new ms,p.addChild(T),M=new ms,p.addChild(M),R=new ms,p.addChild(R),P=new ms,p.addChild(P),F=new ms,p.addChild(F),w=new ms,p.addChild(w)}function Re(){r.value=!r.value,r.value&&(n.value=!1)}function ge(){a.value=!0,n.value=!1,r.value=!1}function Ae(W){W.key==="Escape"&&a.value&&(a.value=!1)}function H(){n.value=!n.value,n.value&&(r.value=!1)}function K(W){WP(e,Number(W.target.value))}async function q(W){var ie;const Y=W.target,J=(ie=Y.files)==null?void 0:ie[0];if(J)try{e.settings.backgroundImageData=await Jc(J),e.settings.backgroundImageName=J.name}catch(ue){console.error("背景图加载失败",ue)}finally{Y.value=""}}async function z(W){const Y=++v;if(!W){m&&(m.texture=mt.EMPTY,m.visible=!1),g&&g.destroy(!0),g=null;return}try{const J=await mt.fromURL(W);if(Y!==v||!m){J.destroy(!0);return}const ie=g;g=J,m.texture=J,m.visible=!0,ie&&ie.destroy(!0)}catch(J){console.error("背景图恢复失败",J)}}function ee(W=!0){e.settings.backgroundImageData="",e.settings.backgroundImageName="",o.value&&(o.value.value=""),W&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}function le(W,Y=0){if(W<=0)return 1;const J=Math.pow(10,Math.floor(Math.log10(W))),ie=[1,2,5,10,20,50,100];let ue=1;for(const pe of ie)if(pe*J>=W){ue=pe*J;break}return Math.max(ue,Y)}function ve(){if(!I)return;const W=I;W.clear();const Y=e.settings;if(!Y.tickEnabled){for(const Se of L)Se.visible=!1;return}const J=0,ie=0,ue=f.screen.width/e.editor.viewScale,pe=f.screen.height/e.editor.viewScale,_e=+("0x"+Y.axisColor.replace("#",""));W.lineStyle(1.5,_e,.35),W.moveTo(-ue,ie),W.lineTo(ue,ie),W.moveTo(J,-pe),W.lineTo(J,pe);const Me=e.editor.viewScale,be=le(50/Me),Le=ue,Ce=pe,Be=Math.max(1,Y.tickWidth);if(Y.tickEnabled){for(let Se=0;Se<=ue;Se+=be){const Je=Math.round(Se/be)*be;Je!==0&&(W.lineStyle(Be,_e,.25),W.moveTo(Je,ie-4),W.lineTo(Je,ie+4),W.moveTo(-Je,ie-4),W.lineTo(-Je,ie+4))}for(let Se=0;Se<=pe;Se+=be)Math.round(Se/be)*be!==0&&(W.lineStyle(Be,_e,.25),W.moveTo(J-4,Se),W.lineTo(J+4,Se),W.moveTo(J-4,-Se),W.lineTo(J+4,-Se))}const Te=f.screen.width/2+e.editor.viewX,Ye=f.screen.height*.5+e.editor.viewY,nt=Y.axisFontSize,Ze=+("0x"+Y.axisColor.replace("#",""));for(;L.length<64;){const Se=new Mp("",{fontFamily:"monospace",fontSize:nt,fill:Ze});Se.anchor.set(.5,.5),k.addChild(Se),L.push(Se)}let rt=0;const Qe=Y.showAxisLabels&&Y.tickEnabled;for(let Se=0;Se<=ue;Se+=be){const Je=Math.round(Se/be)*be;if(Je===0||!Qe||Je>Le)continue;const Ie=L[rt++];if(!Ie)break;Ie.style.fontSize=nt,Ie.text=String(Je),Ie.position.set(Te+Je*Me,Ye+9),Ie.visible=!0;const Ft=L[rt++];if(!Ft)break;Ft.style.fontSize=nt,Ft.text=String(-Je),Ft.position.set(Te-Je*Me,Ye+9),Ft.visible=!0}for(let Se=0;Se<=pe;Se+=be){const Je=Math.round(Se/be)*be;if(Je===0||!Qe||Je>Ce)continue;const Ie=L[rt++];if(!Ie)break;Ie.style.fontSize=nt,Ie.text=String(Je),Ie.position.set(Te+8,Ye-Se*Me),Ie.visible=!0;const Ft=L[rt++];if(!Ft)break;Ft.style.fontSize=nt,Ft.text=String(-Je),Ft.position.set(Te+8,Ye+Se*Me),Ft.visible=!0}for(;rt{e.editor.viewX=ie+(Me.clientX-Y),e.editor.viewY=ue+(Me.clientY-J)},_e=()=>{window.removeEventListener("pointermove",pe),window.removeEventListener("pointerup",_e),window.removeEventListener("pointercancel",_e)};window.addEventListener("pointermove",pe),window.addEventListener("pointerup",_e),window.addEventListener("pointercancel",_e)}function he(W,Y){const J=t.value.getBoundingClientRect(),ie=Math.max(1e-4,e.editor.viewScale),ue=W-J.left,pe=Y-J.top;return{x:(ue-f.screen.width/2-e.editor.viewX)/ie,y:-(pe-f.screen.height*.5-e.editor.viewY)/ie}}function Xe(W,Y,J){const ie=W.rotation*Math.PI/180,ue=Math.cos(ie),pe=Math.sin(ie),_e=Math.max(1e-4,Math.abs(W.scaleX??1)),Me=Math.max(1e-4,Math.abs(W.scaleY??1));return{x:W.x+ue*Y*_e-pe*J*Me,y:W.y+pe*Y*_e+ue*J*Me}}function Pe(W,Y,J){const ie=W.rotation*Math.PI/180,ue=Math.cos(ie),pe=Math.sin(ie),_e=Math.max(1e-4,Math.abs(W.scaleX??1)),Me=Math.max(1e-4,Math.abs(W.scaleY??1)),be=Y-W.x,Le=J-W.y;return{x:(ue*be+pe*Le)/_e,y:(-pe*be+ue*Le)/Me}}function Oe(){if(e.activeObjectType!=="path")return null;const W=e.paths.find(Y=>Y.id===e.activeObjectId)||null;return(W==null?void 0:W.visible)===!1?null:W}function it(W,Y,J){if(W.points.length<2)return W.points.length;const ie=W.closed?W.points.length:W.points.length-1;let ue=W.points.length,pe=1/0;for(let _e=0;_eMath.hypot(Me.x-ie.x,Me.y-ie.y)<=ue);if(pe>=0){Y.points.splice(pe,1),Q.clear();return}const _e=it(Y,ie.x,ie.y);Y.points.splice(_e,0,{x:ie.x,y:ie.y,inX:0,inY:0,outX:0,outY:0}),Q.clear(),Q.add(_e)}function Ct(W){const Y=Oe();if(!Y||!Y.enabled)return!1;const J=he(W.clientX,W.clientY),ie=Pe(Y,J.x,J.y),ue=9/Math.max(.01,e.editor.viewScale);if(W.detail>=2){if(Y.points.findIndex(Ce=>Math.hypot(Ce.x-ie.x,Ce.y-ie.y)<=ue)>=0)return!0;const be={x:ie.x,y:ie.y,inX:0,inY:0,outX:0,outY:0},Le=it(Y,ie.x,ie.y);return Y.points.splice(Le,0,be),Q.clear(),Q.add(Le),de=!0,wt(Ce=>{const Be=he(Ce.clientX,Ce.clientY),Te=Pe(Y,Be.x,Be.y);be.outX=Te.x-be.x,be.outY=Te.y-be.y,be.inX=-be.outX,be.inY=-be.outY}),!0}let pe=null;for(const Me of Q){const be=Y.points[Me];be&&(Math.hypot(be.x+be.inX-ie.x,be.y+be.inY-ie.y)<=ue&&(pe={index:Me,side:"in"}),Math.hypot(be.x+be.outX-ie.x,be.y+be.outY-ie.y)<=ue&&(pe={index:Me,side:"out"}))}if(pe){const Me=Y.points[pe.index],be=pe.side==="in"?Math.hypot(Me.outX,Me.outY):Math.hypot(Me.inX,Me.inY);return wt(Ce=>{const Be=he(Ce.clientX,Ce.clientY),Te=Pe(Y,Be.x,Be.y),Ye=Te.x-Me.x,nt=Te.y-Me.y;if(pe.side==="in"?(Me.inX=Ye,Me.inY=nt):(Me.outX=Ye,Me.outY=nt),!Ce.altKey){const Ze=Math.max(1e-4,Math.hypot(Ye,nt)),rt=Ce.shiftKey?Ze:be;pe.side==="in"?(Me.outX=-Ye/Ze*rt,Me.outY=-nt/Ze*rt):(Me.inX=-Ye/Ze*rt,Me.inY=-nt/Ze*rt)}}),!0}const _e=Y.points.findIndex(Me=>Math.hypot(Me.x-ie.x,Me.y-ie.y)<=ue);if(_e>=0){if(W.altKey)return Q.delete(_e),!0;W.ctrlKey||W.metaKey?Q.add(_e):Q.has(_e)||(Q.clear(),Q.add(_e));const Me=ie,be=[...Q].map(Ce=>({index:Ce,x:Y.points[Ce].x,y:Y.points[Ce].y}));return wt(Ce=>{const Be=he(Ce.clientX,Ce.clientY),Te=Pe(Y,Be.x,Be.y);for(const Ye of be)Y.points[Ye.index].x=Ye.x+Te.x-Me.x,Y.points[Ye.index].y=Ye.y+Te.y-Me.y}),!0}if(W.altKey&&!W.ctrlKey&&!W.metaKey)return Q.clear(),!0;if(W.ctrlKey||W.metaKey||W.altKey){const Me=ie,be=W.altKey,Le=Ce=>{const Be=he(Ce.clientX,Ce.clientY),Te=Pe(Y,Be.x,Be.y),Ye=Math.min(Me.x,Te.x),nt=Math.max(Me.x,Te.x),Ze=Math.min(Me.y,Te.y),rt=Math.max(Me.y,Te.y);Y.points.forEach((Qe,Se)=>{Qe.x>=Ye&&Qe.x<=nt&&Qe.y>=Ze&&Qe.y<=rt&&(be?Q.delete(Se):Q.add(Se))}),window.removeEventListener("pointerup",Le),window.removeEventListener("pointercancel",Le)};return window.addEventListener("pointerup",Le),window.addEventListener("pointercancel",Le),!0}return!1}function wt(W){const Y=()=>{window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",Y),window.removeEventListener("pointercancel",Y)};window.addEventListener("pointermove",W),window.addEventListener("pointerup",Y),window.addEventListener("pointercancel",Y)}function Et(W){if(e.activeObjectType!=="collision")return!1;const Y=e.colliders.find(rt=>rt.id===e.activeObjectId);if(!(Y!=null&&Y.enabled)||Y.visible===!1)return!1;const J=he(W.clientX,W.clientY),ie=Y.rotation*Math.PI/180,ue=Math.cos(ie),pe=Math.sin(ie),_e=Math.max(1e-4,Math.abs(Y.scaleX??1)),Me=Math.max(1e-4,Math.abs(Y.scaleY??1)),be=J.x-Y.x,Le=J.y-Y.y,Ce=(ue*be+pe*Le)/_e,Be=(-pe*be+ue*Le)/Me;if(!(Y.shape==="circle"?Math.hypot(Ce,Be)<=Y.radius:Y.shape==="ellipse"?Math.hypot(Ce/Math.max(1,Y.radiusX),Be/Math.max(1,Y.radiusY))<=1:Math.abs(Ce)<=Y.width*.5&&Math.abs(Be)<=Y.height*.5))return!1;const Ye=Y.x,nt=Y.y,Ze=J;return wt(rt=>{const Qe=he(rt.clientX,rt.clientY);Y.x=Ye+Qe.x-Ze.x,Y.y=nt+Qe.y-Ze.y}),!0}function Kt(W){const Y=e.systems.find(Le=>Le.id===e.activeId);if((Y==null?void 0:Y.visible)===!1)return!1;const J=Y==null?void 0:Y.config;if(!(J!=null&&J.forceField)||J.forceRadius<=0)return!1;const ie=he(W.clientX,W.clientY);if(Math.hypot(ie.x-J.forceCenterX,ie.y-J.forceCenterY)>J.forceRadius)return!1;const pe=J.forceCenterX,_e=J.forceCenterY;t.value&&(t.value.style.cursor="grabbing");const Me=Le=>{const Ce=he(Le.clientX,Le.clientY);J.forceCenterX=pe+Ce.x-ie.x,J.forceCenterY=_e+Ce.y-ie.y},be=()=>{t.value&&(t.value.style.cursor=""),window.removeEventListener("pointermove",Me),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)};return window.addEventListener("pointermove",Me),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be),W.preventDefault(),!0}function yi(W){const Y=e.systems.find(Ce=>Ce.id===e.activeId);if((Y==null?void 0:Y.visible)===!1)return!1;const J=Y==null?void 0:Y.config;if(!(J!=null&&J.attraction))return!1;const ie=he(W.clientX,W.clientY),ue=Math.max(J.attractionRadius,12/Math.max(1e-4,e.editor.viewScale));if(Math.hypot(ie.x-J.attractionCenterX,ie.y-J.attractionCenterY)>ue)return!1;const _e=J.attractionCenterX,Me=J.attractionCenterY;t.value&&(t.value.style.cursor="grabbing");const be=Ce=>{const Be=he(Ce.clientX,Ce.clientY);J.attractionCenterX=_e+Be.x-ie.x,J.attractionCenterY=Me+Be.y-ie.y},Le=()=>{t.value&&(t.value.style.cursor=""),window.removeEventListener("pointermove",be),window.removeEventListener("pointerup",Le),window.removeEventListener("pointercancel",Le)};return window.addEventListener("pointermove",be),window.addEventListener("pointerup",Le),window.addEventListener("pointercancel",Le),W.preventDefault(),!0}function Bi(){const W=e.activeObjectId;if(e.activeObjectType==="particle"){const ie=e.systems.find(pe=>pe.id===W);if(!ie||ie.visible===!1)return null;const ue=ie.config;return{x:ue.centerX,y:ue.centerY,rotation:ue.rootRotation,scaleX:ue.rootScaleX??1,scaleY:ue.rootScaleY??1,setPosition:(pe,_e)=>{ue.centerX=pe,ue.centerY=_e},setRotation:pe=>{ue.rootRotation=pe},setScale:(pe,_e)=>{ue.rootScaleX=pe,ue.rootScaleY=_e}}}const J=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(ie=>ie.id===W);return!J||J.visible===!1?null:{x:Number(J.x)||0,y:Number(J.y)||0,rotation:Number(J.rotation)||0,scaleX:Math.max(.05,Number(J.scaleX)||1),scaleY:Math.max(.05,Number(J.scaleY)||1),setPosition:(ie,ue)=>{J.x=ie,J.y=ue},setRotation:ie=>{J.rotation=ie},setScale:(ie,ue)=>{J.scaleX=ie,J.scaleY=ue}}}function Ls(W){const Y=Bi();if(!Y)return;const J=e.editor.viewScale,ie=t.value.getBoundingClientRect(),ue=ie.left+f.screen.width/2+e.editor.viewX+Y.x*J,pe=ie.top+f.screen.height*.5+e.editor.viewY+-Y.y*J,_e=W.clientX,Me=W.clientY,be=l.value,Le=Y.x,Ce=Y.y,Be=Y.rotation,Te=Y.scaleX,Ye=Y.scaleY,nt=Math.hypot(_e-ue,Me-pe)||1,Ze=Math.atan2(Me-pe,_e-ue),rt=Se=>{const Je=(Se.clientX-_e)/J,Ie=(Se.clientY-Me)/J;if(be==="translate")Y.setPosition(Le+Je,Ce-Ie);else if(be==="rotate"){const Ft=Math.atan2(Se.clientY-pe,Se.clientX-ue);Y.setRotation(Be-(Ft-Ze)*180/Math.PI)}else if(be==="scale"){const Jt=Math.hypot(Se.clientX-ue,Se.clientY-pe)/nt;Y.setScale(Math.max(.05,Te*Jt),Math.max(.05,Ye*Jt))}},Qe=()=>{window.removeEventListener("pointermove",rt),window.removeEventListener("pointerup",Qe),window.removeEventListener("pointercancel",Qe)};window.addEventListener("pointermove",rt),window.addEventListener("pointerup",Qe),window.addEventListener("pointercancel",Qe)}function an(){ce(1.2)}function xi(){ce(1/1.2)}function ce(W){const Y=Math.max(.01,e.editor.viewScale*W);e.editor.viewScale=Y}function fe(){e.editor.viewScale=1,e.editor.viewX=0,e.editor.viewY=0}function It(){e.editor.viewScale=1,e.editor.viewX=0,e.editor.viewY=0}function Rt(){e.settings.showGrid=!e.settings.showGrid}function Zt(){if(p){for(const[W,Y]of V){const J=e.systems.find(ie=>ie.id===W);(!J||G.get(W)!==J.config)&&(p.removeChild(Y),Y.destroy({children:!0}),V.delete(W),G.delete(W))}for(const W of e.systems){X&&!W.config.texture&&(W.config.texture=X);const Y=Gr(W.config);if(N)for(const ie of Y.trailResources)!ie.texture&&(ie.previewUrl==="/images/trail.png"||ie.previewUrl==="/trails/trail.png")&&(ie.texture=N);if(X)for(const ie of Y.imageResources)!ie.texture&&ie.textureName==="star"&&(ie.texture=X);if(V.has(W.id))continue;const J=new LI(W.config);J.setEmitterPos(()=>({x:W.config.centerX,y:W.config.centerY})),p.addChild(J),V.set(W.id,J),G.set(W.id,W.config)}}}function St(){if(!b)return;const W=b;if(W.clear(),!!e.settings.showEmitter&&e.systems.length)for(const Y of e.systems){if(Y.visible===!1)continue;const J=ne.get(Y.id),ie=(J==null?void 0:J.x)??Y.config.centerX??0,ue=-((J==null?void 0:J.y)??Y.config.centerY??0),pe=e.activeObjectType==="particle"&&Y.id===e.activeId,_e=pe?16763955:9082040,Me=pe?.4:.2;W.lineStyle(1,_e,Me),W.drawCircle(ie,ue,10),W.beginFill(_e,pe?.8:.4),W.drawCircle(ie,ue,3),W.endFill(),W.lineStyle(1,_e,pe?.3:.15),W.moveTo(ie-16,ue),W.lineTo(ie+16,ue),W.moveTo(ie,ue-16),W.lineTo(ie,ue+16)}}function Ms(){var J;if(!y)return;const W=y;(J=W.parent)==null||J.addChild(W),W.clear();const Y=new Map;for(const ie of e.spines)ie.visible===!1||!ie.selectedBone||ie.status!=="ready"||Y.set(`${ie.id}:${ie.selectedBone}`,{spineId:ie.id,boneName:ie.selectedBone});for(const ie of e.systems){if(ie.visible===!1)continue;const ue=ie.config;if(!ue.emitterFollow||ue.emitterFollowMode!=="bone"||!ue.emitterFollowSpineId||!ue.emitterFollowBoneName)continue;const pe=e.spines.find(_e=>_e.id===ue.emitterFollowSpineId);!pe||pe.visible===!1||Y.set(`${ue.emitterFollowSpineId}:${ue.emitterFollowBoneName}`,{spineId:ue.emitterFollowSpineId,boneName:ue.emitterFollowBoneName})}for(const ie of Y.values()){const ue=O==null?void 0:O.getBoneWorldTransform(ie.spineId,ie.boneName);if(!ue)continue;const pe=ue.x,_e=-ue.y;W.lineStyle(2,12881151,.95),W.beginFill(12881151,.2),W.drawCircle(pe,_e,8),W.endFill(),W.beginFill(15919103,1),W.drawCircle(pe,_e,3.5),W.endFill()}}function Ds(){if(!A)return;const W=A;if(W.clear(),!e.settings.showEmitter)return;const Y=e.systems.find(Ze=>Ze.id===e.activeId);if(!Y||Y.visible===!1)return;const J=Y.config,ie=ne.get(Y.id),ue=(ie==null?void 0:ie.x)??J.centerX??0,pe=-((ie==null?void 0:ie.y)??J.centerY??0),_e=J.shape;if(_e==="point"||_e==="path")return;const Me=J.rootScaleX??1,be=J.rootScaleY??1,Le=-((ie==null?void 0:ie.rotation)??J.rootRotation??0)*Math.PI/180,Ce=Math.cos(Le),Be=Math.sin(Le),Te=J.offsetX??0,Ye=J.offsetY??0,nt=(Ze,rt)=>{const Qe=Ze+Te,Se=-rt-Ye,Je=Qe*Me,Ie=Se*be;return[ue+Je*Ce-Ie*Be,pe+(Je*Be+Ie*Ce)]};if(_e==="circle"){const Ze=Rh(J.innerRadius,J.outerRadius);W.lineStyle(2,3991658,.7);const rt=48;for(const Qe of[Ze.outer,Ze.inner])if(!(Qe<=0))for(let Se=0;Se<=rt;Se++){const Je=Se/rt*Math.PI*2,[Ie,Ft]=nt(Math.cos(Je)*Qe,Math.sin(Je)*Qe);Se===0?W.moveTo(Ie,Ft):W.lineTo(Ie,Ft)}}else if(_e==="rect"){const Ze=d1(J);W.lineStyle(2,4885759,.7);for(const[rt,Qe]of[[Ze.outerW,Ze.outerH],[Ze.innerW,Ze.innerH]]){if(rt<=0||Qe<=0)continue;const Se=rt/2,Je=Qe/2,Ie=nt(-Se,-Je),Ft=nt(Se,-Je),Jt=nt(Se,Je),Mi=nt(-Se,Je);W.moveTo(Ie[0],Ie[1]),W.lineTo(Ft[0],Ft[1]),W.lineTo(Jt[0],Jt[1]),W.lineTo(Mi[0],Mi[1]),W.lineTo(Ie[0],Ie[1])}}else if(_e==="cone"){const Ze=Rh(J.innerRadius,J.outerRadius),rt=J.coneAngle/2*Math.PI/180,Qe=J.coneDirection*Math.PI/180,Se=nt(Math.cos(Qe-rt)*Ze.inner,Math.sin(Qe-rt)*Ze.inner),Je=nt(Math.cos(Qe+rt)*Ze.inner,Math.sin(Qe+rt)*Ze.inner),Ie=nt(Math.cos(Qe-rt)*Ze.outer,Math.sin(Qe-rt)*Ze.outer),Ft=nt(Math.cos(Qe+rt)*Ze.outer,Math.sin(Qe+rt)*Ze.outer);W.lineStyle(2,3991658,.7),W.moveTo(Se[0],Se[1]),W.lineTo(Ie[0],Ie[1]),W.moveTo(Je[0],Je[1]),W.lineTo(Ft[0],Ft[1]),W.lineStyle(1,3991658,.5);const Jt=24;for(const Mi of[Ze.outer,Ze.inner])if(!(Mi<=0))for(let $=0;$<=Jt;$++){const S=Qe-rt+2*rt*$/Jt,[C,Z]=nt(Math.cos(S)*Mi,Math.sin(S)*Mi);$===0?W.moveTo(C,Z):W.lineTo(C,Z)}}}function Li(){if(!T)return;const W=T;W.clear();const Y=e.systems.find(_e=>_e.id===e.activeId);if((Y==null?void 0:Y.visible)===!1)return;const J=Y==null?void 0:Y.config;if(!(J!=null&&J.forceField)||J.forceRadius<=0)return;const ie=J.forceCenterX,ue=-J.forceCenterY,pe=J.forceStrength>=0?5818367:16739194;W.lineStyle(2,pe,.85),W.beginFill(pe,.08),W.drawCircle(ie,ue,J.forceRadius),W.endFill(),W.lineStyle(1,pe,.7),W.moveTo(ie-9,ue),W.lineTo(ie+9,ue),W.moveTo(ie,ue-9),W.lineTo(ie,ue+9),W.beginFill(pe,.95),W.drawCircle(ie,ue,4),W.endFill()}function Ts(){if(!M)return;const W=M;W.clear();const Y=e.systems.find(Me=>Me.id===e.activeId);if((Y==null?void 0:Y.visible)===!1)return;const J=Y==null?void 0:Y.config;if(!(J!=null&&J.attraction))return;const ie=J.attractionCenterX,ue=-J.attractionCenterY,pe=Math.max(0,J.attractionRadius),_e=16731487;pe>0&&(W.lineStyle(2,_e,.95),W.beginFill(_e,.09),W.drawCircle(ie,ue,pe),W.endFill()),W.lineStyle(1,_e,.85),W.moveTo(ie-10,ue),W.lineTo(ie+10,ue),W.moveTo(ie,ue-10),W.lineTo(ie,ue+10),W.beginFill(_e,1),W.drawCircle(ie,ue,pe>0?4:6),W.endFill()}function qr(){if(!F)return;const W=F;if(W.clear(),!l.value)return;const Y=Bi();if(!Y)return;const J=Y.x,ie=-Y.y,ue=Y.scaleX,pe=Y.scaleY,_e=-Y.rotation*Math.PI/180,Me=Math.cos(_e),be=Math.sin(_e),Le=(Te,Ye)=>{const nt=Te*ue,Ze=-Ye*pe;return[J+nt*Me-Ze*be,ie+(nt*be+Ze*Me)]},Ce=(Te,Ye,nt,Ze)=>{const rt=Le(Te,Ye),Qe=Le(nt,Ze);W.moveTo(rt[0],rt[1]),W.lineTo(Qe[0],Qe[1])},Be=26;if(W.lineStyle(2,3526911,.9),W.beginFill(3526911,.25),W.drawCircle(J,ie,6),W.endFill(),l.value==="translate")W.lineStyle(2,3526911,.9),Ce(-Be,0,Be,0),Ce(0,-Be,0,Be),Ce(Be-6,-4,Be,0),Ce(Be,0,Be-6,4),Ce(-20,-4,-Be,0),Ce(-Be,0,-20,4),Ce(-4,Be-6,0,Be),Ce(0,Be,4,Be-6),Ce(-4,-20,0,-Be),Ce(0,-Be,4,-20);else if(l.value==="rotate"){W.lineStyle(2,3526911,.8);const Te=48;for(let Ze=0;Ze<=Te;Ze++){const rt=Ze/Te*Math.PI*2,[Qe,Se]=Le(Math.cos(rt)*Be,Math.sin(rt)*Be);Ze===0?W.moveTo(Qe,Se):W.lineTo(Qe,Se)}const[Ye,nt]=Le(0,Be);W.beginFill(3526911,.95),W.drawCircle(Ye,nt,4),W.endFill()}else if(l.value==="scale"){W.lineStyle(2,3526911,.9);const Ye=[[-Be,-Be],[Be,-Be],[Be,Be],[-Be,Be]].map(([nt,Ze])=>Le(nt,Ze));W.moveTo(Ye[0][0],Ye[0][1]),W.lineTo(Ye[1][0],Ye[1][1]),W.lineTo(Ye[2][0],Ye[2][1]),W.lineTo(Ye[3][0],Ye[3][1]),W.lineTo(Ye[0][0],Ye[0][1]),W.beginFill(3526911,.9);for(const nt of Ye)W.drawRect(nt[0]-3,nt[1]-3,6,6);W.endFill()}}function on(W,Y,J,ie){var _e;const ue=Number.isFinite(Y.worldX)&&Number.isFinite(Y.worldY),pe=Number.isFinite(Y.worldRotation);W.push({boneName:Y.boneName,x:ue?Y.worldX:Y.x,y:ue?-Y.worldY:Y.y,rotation:pe?-Y.worldRotation:-Y.rotation,parentX:J,parentY:ie}),(_e=Y.trailState)!=null&&_e.bones.length&&Y.trailState.bones.forEach(Me=>{const be=Number.isFinite(Me.worldX)&&Number.isFinite(Me.worldY),Le=Number.isFinite(Me.worldRotation);W.push({boneName:Me.boneName,x:be?Me.worldX:Me.x,y:be?-Me.worldY:Me.y,rotation:Le?-Me.worldRotation:Me.rotation,parentX:J,parentY:ie,trail:!0})})}function Wi(W,Y,J,ie,ue,pe,_e,Me){const be=pe*.62,Le=Y+ie*pe,Ce=J+ue*pe,Be=Math.max(2.5,pe*.32),Te=Math.max(1.7,pe*.22),Ye=Le-ie*Be,nt=Ce-ue*Be,Ze=-ue,rt=ie;W.lineStyle(_e,Me,.95),W.moveTo(Y-ie*be,J-ue*be),W.lineTo(Ye,nt),W.lineStyle(0),W.beginFill(Me,.95),W.drawPolygon([Le,Ce,Ye+Ze*Te,nt+rt*Te,Ye-Ze*Te,nt-rt*Te]),W.endFill()}function Kr(W){if(!w)return;const Y=w;if(Y.clear(),!e.settings.showBones)return;const J=0,ie=0,ue=Math.max(.25,Math.abs(e.editor.viewScale)||1),pe=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),_e=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2)),Me=2.5*pe/ue,be=4.5*_e/ue,Le=Math.max(.65,_e*.625)/ue;for(const Ce of W){const Be=Ce.trail?16731533:16747610;Y.lineStyle(1,Be,Ce.trail?.65:.35),Y.moveTo(Ce.parentX??J,Ce.parentY??ie),Y.lineTo(Ce.x,Ce.y);const Te=Ce.rotation*Math.PI/180,Ye=Math.cos(Te),nt=Math.sin(Te);Wi(Y,Ce.x,Ce.y,Ye,nt,be,Le,15684432),Wi(Y,Ce.x,Ce.y,nt,-Ye,be,Le,5622123),Y.beginFill(Be,.9),Y.drawCircle(Ce.x,Ce.y,Me),Y.endFill()}}function Zr(W,Y=16777215){const J=Number.parseInt(W.replace("#",""),16);return Number.isFinite(J)?J:Y}function Ns(){if(!R)return;const W=R;W.clear();for(const Y of j){if(Y.visible===!1)continue;const J=e.activeObjectType==="collision"&&e.activeObjectId===Y.id,ie=Y.enabled?J?16735858:13911899:5792116,ue=Y.rotation*Math.PI/180,pe=Math.cos(ue),_e=Math.sin(ue),Me=Math.max(1e-4,Math.abs(Y.scaleX??1)),be=Math.max(1e-4,Math.abs(Y.scaleY??1)),Le=(Te,Ye)=>({x:Y.x+pe*Te*Me-_e*Ye*be,y:-(Y.y+_e*Te*Me+pe*Ye*be)});let Ce=[];if(Y.shape==="circle"||Y.shape==="ellipse"){const Te=Y.shape==="circle"?Y.radius:Y.radiusX,Ye=Y.shape==="circle"?Y.radius:Y.radiusY;Ce=Array.from({length:49},(nt,Ze)=>{const rt=Ze/48*Math.PI*2;return Le(Math.cos(rt)*Te,Math.sin(rt)*Ye)})}else if(Y.shape==="rect"){const Te=Y.width*.5,Ye=Y.height*.5;Ce=[Le(-Te,-Ye),Le(Te,-Ye),Le(Te,Ye),Le(-Te,Ye),Le(-Te,-Ye)]}else{const Te=Math.max(3,Math.min(16,Math.round(Y.sides)));Ce=Array.from({length:Te+1},(Ye,nt)=>{const Ze=Math.PI*.5+nt%Te/Te*Math.PI*2;return Le(Math.cos(Ze)*Y.width*.5,Math.sin(Ze)*Y.height*.5)})}if(!Ce.length)continue;W.lineStyle(J?2.5:1.5,ie,Y.enabled?.95:.45),W.beginFill(ie,J?.12:.055),W.moveTo(Ce[0].x,Ce[0].y);for(let Te=1;Te{const Ce=Xe(Y,be,Le);return{x:Ce.x,y:-Ce.y}},pe=Y.points[0],_e=ue(pe.x,pe.y);W.lineStyle(J?2.5:1.8,ie,J?1:.75),W.moveTo(_e.x,_e.y);const Me=Y.closed?Y.points.length:Y.points.length-1;for(let be=0;be{const Ce=ue(be.x,be.y),Be=ue(be.x+be.inX,be.y+be.inY),Te=ue(be.x+be.outX,be.y+be.outY),Ye=Math.hypot(be.inX,be.inY)>.01,nt=Math.hypot(be.outX,be.outY)>.01;W.lineStyle(1,11121867,.65),Ye&&(W.moveTo(Ce.x,Ce.y),W.lineTo(Be.x,Be.y)),nt&&(W.moveTo(Ce.x,Ce.y),W.lineTo(Te.x,Te.y)),Ye&&(W.beginFill(14015724,.95),W.drawCircle(Be.x,Be.y,3),W.endFill()),nt&&(W.beginFill(14015724,.95),W.drawCircle(Te.x,Te.y,3),W.endFill()),W.beginFill(Q.has(Le)?16777215:ie,1),W.lineStyle(1.5,Q.has(Le)?6126847:16777215,.95),W.drawCircle(Ce.x,Ce.y,Q.has(Le)?5:4),W.endFill()})}}function cn(W,Y,J="linear"){if(!W.length)return Y;const ie=[...W].sort((ue,pe)=>ue.x-pe.x);if(Y<=ie[0].x)return ie[0].y;for(let ue=1;ue{if(!Y.followPath||!Y.followPathId)return Y;const J=e.paths.find(Le=>Le.id===Y.followPathId&&Le.enabled);if(!(J!=null&&J.points.length))return Y;const ie=Math.max(.05,Number(Y.followDuration)||2),ue=Math.min(1,Math.max(0,W/ie)),pe=Array.isArray(Y.followCurve)?Y.followCurve:[{x:0,y:0},{x:1,y:1}],_e=Y.followCurveMode==="跟随导出"?e.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":Y.followCurveMode==="贝塞尔"?"bezier":"linear",Me=Math.min(1,Math.max(0,cn(pe,ue,_e))),be=yf(J,Me);return be?{...Y,x:be.x,y:be.y,rotation:Y.rotation+(Y.followPathRotation?be.angle:0)}:Y})}function Us(W,Y,J,ie=Math.max(1e-4,Math.abs(W.rootScaleX)),ue=Math.max(1e-4,Math.abs(W.rootScaleY))){const pe=-W.rootRotation*Math.PI/180,_e=Math.cos(pe),Me=Math.sin(pe),be=Y-W.centerX,Le=-J+W.centerY;return{x:(_e*be+Me*Le)/ie,y:(-Me*be+_e*Le)/ue}}function $a(W,Y,J){const ie=yf(Y,J);if(!ie)return null;const ue=Us(W,ie.x,ie.y),pe=ie.angle*Math.PI/180,_e=Us(W,ie.x+Math.cos(pe),ie.y+Math.sin(pe)),Me=Math.atan2(_e.y-ue.y,_e.x-ue.x)*180/Math.PI;return{...ue,angle:Me}}function Qr(){var J,ie,ue;_=requestAnimationFrame(Qr);const W=performance.now()/1e3;let Y=W-U;if(U=W,Y>.1&&(Y=.1),f&&p){p.scale.set(e.editor.viewScale),p.position.set(f.screen.width/2+e.editor.viewX,f.screen.height*.5+e.editor.viewY),m&&(m.position.set(Number(e.settings.backgroundX)||0,-(Number(e.settings.backgroundY)||0)),m.alpha=Math.min(1,Math.max(0,Number(e.settings.backgroundOpacity)||0))),ve(),Zt();const pe=Math.max(1,e.timeline.fps),_e=e.timeline.frame,Me=_e/pe;O==null||O.sync(e.spines,_e,pe),Jr(Me);for(const Qe of e.systems){const Se=V.get(Qe.id);if(!Se)continue;Se.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const Je=Qe.visible!==!1;Se.visible=Je,Se.renderable=Je;const Ie=Qe.config;Se.scale.set(Ie.rootScaleX,Ie.rootScaleY);const Ft=new Set(Ie.collisionColliderIds);Se.setColliders(Ie.collision?j.filter(ei=>Ft.has(ei.id)):[]),Se.setEmitterFollowSpawn(0,0,0);let Jt={x:Ie.centerX,y:Ie.centerY,rotation:Ie.rootRotation};const Mi=Ie.emitterFollow&&Ie.emitterFollowMode==="bone"?e.spines.find(ei=>ei.id===Ie.emitterFollowSpineId&&ei.enabled&&ei.status==="ready"):null,$=Mi&&(O==null?void 0:O.getBoneWorldTransform(Mi.id,Ie.emitterFollowBoneName))||null,S=Ie.emitterFollow&&Ie.emitterFollowMode==="path"?e.paths.find(ei=>ei.id===Ie.emitterFollowPathId&&ei.enabled):null,C=Math.max(.05,Ie.emitterFollowDuration),Z=Math.min(1,Math.max(0,Me/C)),Fe=Math.min(1,Math.max(0,cn(Ie.emitterFollowCurve,Z))),ft=Math.min(1,Math.max(0,Ie.emitterFollowOffset)),Ot=Ie.emitterFollowDirection==="reverse"?(1-ft)*(1-Fe):ft+(1-ft)*Fe,Ht=S?yf(S,Ot):null;if($){const ei=Ie.emitterFollowBoneOffsetX,Xo=Ie.emitterFollowBoneOffsetY,ea=$.x+ei,Ga=$.y+Xo,tc=Ie.rootRotation+Ie.emitterFollowBoneRotation,Vo=Math.max(1e-4,Math.abs(Ie.rootScaleX*Ie.emitterFollowBoneScaleX)),Yo=Math.max(1e-4,Math.abs(Ie.rootScaleY*Ie.emitterFollowBoneScaleY));if(Jt={x:ea,y:Ga,rotation:tc},Ie.emitterFollowSpace==="local")Se.position.set(ea,-Ga),Se.rotation=-tc*Math.PI/180,Se.scale.set(Vo,Yo),Se.setSimulationTransform(ea,Ga,tc,Vo,Yo);else{Se.position.set(Ie.centerX,-Ie.centerY),Se.rotation=-Ie.rootRotation*Math.PI/180,Se.scale.set(Vo,Yo),Se.setSimulationTransform(Ie.centerX,Ie.centerY,Ie.rootRotation,Vo,Yo);const Yp=Us(Ie,ea,Ga,Vo,Yo),ES=-(tc-Ie.rootRotation);Se.setEmitterFollowSpawn(Yp.x,Yp.y,ES)}}else if(Ht){const ei=Ht.angle+(Ie.emitterFollowDirection==="reverse"?180:0),Xo=Ie.emitterAngleMode==="direction"?ei:Ie.rootRotation;if(Jt={x:Ht.x,y:Ht.y,rotation:Xo},Ie.emitterFollowSpace==="local")Se.position.set(Ht.x,-Ht.y),Se.rotation=-Xo*Math.PI/180,Se.setSimulationTransform(Ht.x,Ht.y,Xo);else{Se.position.set(Ie.centerX,-Ie.centerY),Se.rotation=-Ie.rootRotation*Math.PI/180,Se.setSimulationTransform(Ie.centerX,Ie.centerY,Ie.rootRotation);const ea=Us(Ie,Ht.x,Ht.y),Ga=Ie.emitterAngleMode==="direction"?-(ei-Ie.rootRotation):0;Se.setEmitterFollowSpawn(ea.x,ea.y,Ga)}}else Se.position.set(Ie.centerX,-Ie.centerY),Se.rotation=-Ie.rootRotation*Math.PI/180,Se.setSimulationTransform(Ie.centerX,Ie.centerY,Ie.rootRotation);const Gt=Ie.shape==="path"&&Ie.spawnPathId>0&&e.paths.find(ei=>ei.id===Ie.spawnPathId&&ei.enabled&&ei.points.length>0)||null;Se.setSpawnPathSampler(Gt?ei=>$a(Ie,Gt,ei):null,(Gt==null?void 0:Gt.closed)===!0),ne.set(Qe.id,Jt)}let be=0;const Le=[],Ce=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,Be=(Qe,Se,Je)=>{!Qe||Qe.id!==Ce||Qe.visible===!1||on(Le,Je,Se.position.x,Se.position.y)},Te=e.timeline,Ye=Te.fps,nt=1/Math.max(1,Ye);let Ze=D,rt=0;if(Te.playing?(B+=Y,rt=Math.floor(B/nt),rt>0&&(B-=rt*nt)):B=0,Te.playing&&rt>0)for(let Qe=0;QeJt.id===e.activeId),Je=(Se==null?void 0:Se.config.mode)==="stream"&&Se.config.streamBehavior==="loop"?v1(Se.config,Ye):null,Ft=Te.loop&&(Je==null?void 0:Je.start)===Te.playbackStart&&Je.end===Te.playbackEnd?Te.playbackEnd-1:Te.playbackEnd;if(Te.frame>Ft)if(Te.loop)Te.frame=Te.playbackStart;else{Te.frame=Te.playbackEnd,Te.playing=!1;break}}else{if(Te.frame===0)for(const Se of e.systems){const Je=V.get(Se.id);Je&&(Se.config.mode==="stream"&&Se.config.streamBehavior==="loop"?nR(Se,Je,Ye,Te.totalFrames):Je.reset())}for(const[Se,Je]of V){const Ie=e.systems.find(S=>S.id===Se),Ft=(Ie==null?void 0:Ie.config.mode)==="stream"&&Ie.config.streamBehavior==="loop",Jt=Ft?(J=Ie.frames)==null?void 0:J[Te.frame]:void 0,Mi=Te.frame===0&&!Ft,$=Mi?[]:Jt||Je.update(nt);if(Mi?Je.apply([]):Jt&&Je.apply(Jt),(Ie==null?void 0:Ie.visible)!==!1)for(const S of $)S.active&&Be(Ie,Je,S);be+=$.length}for(const Se of e.systems){if(!Se.config.texture)continue;Se.frames=Se.frames||[];const Je=V.get(Se.id);Je&&!(Se.config.mode==="stream"&&Se.config.streamBehavior==="loop")&&(Se.frames[Te.frame]=Je.capture())}Te.frame++,Te.frame>=Te.totalFrames&&(Te.frame=Te.playbackStart,Te.recorded=!0)}else{Te.playing||(Ze=Te.frame);for(const Qe of e.systems){const Se=V.get(Qe.id),Je=Te.playing?D:Te.frame,Ie=(ue=Qe.frames)==null?void 0:ue[Je],Ft=Qe.config.mode==="stream"&&Qe.config.streamBehavior==="loop"&&!!Ie;if((Te.recorded||Ft)&&Se&&Ie){Se.apply(Ie);for(const Jt of Ie)Jt.active&&(Be(Qe,Se,Jt),be++)}else if(Se){const Jt=Te.frame===0?[]:Se.update(0);if(Te.frame===0&&Se.apply([]),Qe.visible!==!1)for(const Mi of Jt)Mi.active&&Be(Qe,Se,Mi);be+=Se.activeCount}}}D=Ze,O==null||O.sync(e.spines,Ze,Ye);for(const[,Qe]of V)Qe.drawTrailMeshDebug(e.settings.showSkinMesh);Ns(),ln(),Ms(),St(),Ds(),Li(),Ts(),qr(),Kr(Le),i.value&&(i.value.systems=e.systems.length,i.value.particles=be)}}return Da(async()=>{window.addEventListener("keydown",Ae);const W=t.value;f=new $b({width:W.clientWidth||800,height:W.clientHeight||600,backgroundAlpha:0,antialias:!0}),W.appendChild(f.view),we(),cs(()=>e.settings.backgroundImageData,z,{immediate:!0}),await me();const Y=X;for(const J of e.systems){J.config.texture=Y;const ie=Gr(J.config);if(N)for(const ue of ie.trailResources)!ue.texture&&(ue.previewUrl==="/images/trail.png"||ue.previewUrl==="/trails/trail.png")&&(ue.texture=N);for(const ue of ie.imageResources)!ue.texture&&ue.textureName==="star"&&(ue.texture=Y)}i.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,B=0,D=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const J of e.systems)J.frames=[];e.recalcTotalFrames(),U=performance.now()/1e3,Qr(),cs(()=>e.systems.map(J=>JSON.stringify(J.config,(ie,ue)=>ie==="texture"||ie==="trailTexture"||ie==="previewUrl"?void 0:ue)).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}),jP(e)}),Gl(()=>{window.removeEventListener("keydown",Ae),cancelAnimationFrame(_),O==null||O.destroy(),O=null,v++,g&&g.destroy(!0),g=null,m=null,f&&(f.destroy(!0,{children:!0}),f=null)}),(W,Y)=>(te(),oe("div",KP,[E("div",{ref_key:"holder",ref:t,class:ot(["stage-holder",{grid:ke(e).settings.showGrid}]),tabindex:"0",onWheel:yt(re,["prevent"]),onPointerdown:ye,onDblclick:yt(bt,["prevent"])},null,34),E("div",ZP,[E("button",{class:"settings-btn",onClick:H,title:"系统设置"},"系统设置"),E("button",{class:"undo-btn",disabled:ke(Iu).undoCount===0,onClick:Y[0]||(Y[0]=(...J)=>ke(Tf)&&ke(Tf)(...J)),title:"撤回上一步 (Ctrl+Z)"},"↶",8,JP),E("div",QP,[E("button",{class:ot(["tool-btn",{on:l.value===""}]),onClick:Y[1]||(Y[1]=J=>u("")),title:"拖动画布 (Q)"},"✋",2),E("button",{class:ot(["tool-btn",{on:l.value==="translate"}]),onClick:Y[2]||(Y[2]=J=>u("translate")),title:"位移 (W)"},"✥",2),E("button",{class:ot(["tool-btn",{on:l.value==="rotate"}]),onClick:Y[3]||(Y[3]=J=>u("rotate")),title:"旋转 (E)"},"⟳",2),E("button",{class:ot(["tool-btn",{on:l.value==="scale"}]),onClick:Y[4]||(Y[4]=J=>u("scale")),title:"缩放 (R)"},"⤢",2)]),E("div",ek,[E("button",{class:"tool-btn",onClick:an,title:"放大"},"+"),E("button",{class:"tool-btn",onClick:xi,title:"缩小"},"-"),E("button",{class:"tool-btn",onClick:fe,title:"适配画布"},"⤢"),E("button",{class:ot(["tool-btn",{on:ke(e).settings.showGrid}]),onClick:Rt,title:"切换网格"},"▦",2),E("button",{class:"tool-btn",onClick:It,title:"重置视图"},"⟳")]),E("div",{class:"background-menu",onClick:Y[10]||(Y[10]=yt(()=>{},["stop"]))},[E("button",{class:ot(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:Re},"背景图",2),r.value?(te(),oe("div",tk,[E("button",{class:"background-upload",onClick:Y[5]||(Y[5]=J=>{var ie;return(ie=o.value)==null?void 0:ie.click()})},je(h.value?"更换图像":"上传图像"),1),E("button",{class:"background-clear",disabled:!h.value,onClick:Y[6]||(Y[6]=J=>ee())},"清除背景",8,ik),E("input",{ref_key:"backgroundFileInput",ref:o,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:q},null,544),E("div",{class:"background-file-name",title:h.value},je(h.value||"未上传图像"),9,sk),E("div",nk,[E("label",null,[Y[28]||(Y[28]=E("span",null,"X",-1)),xe(E("input",{"onUpdate:modelValue":Y[7]||(Y[7]=J=>ke(e).settings.backgroundX=J),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[ct,ke(e).settings.backgroundX,void 0,{number:!0}]])]),E("label",null,[Y[29]||(Y[29]=E("span",null,"Y",-1)),xe(E("input",{"onUpdate:modelValue":Y[8]||(Y[8]=J=>ke(e).settings.backgroundY=J),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[ct,ke(e).settings.backgroundY,void 0,{number:!0}]])])]),E("label",rk,[Y[30]||(Y[30]=E("span",null,"透明度",-1)),xe(E("input",{"onUpdate:modelValue":Y[9]||(Y[9]=J=>ke(e).settings.backgroundOpacity=J),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[ct,ke(e).settings.backgroundOpacity,void 0,{number:!0}]]),E("b",null,je(Math.round(ke(e).settings.backgroundOpacity*100))+"%",1)])])):Ue("",!0)]),E("button",{class:ot(["help-btn",{on:a.value}]),title:"查看使用说明",onClick:ge},"使用说明",2),E("span",ak,je(Math.round(ke(e).editor.viewScale*100))+"%",1)]),n.value?(te(),oe("div",ok,[E("div",lk,[Y[31]||(Y[31]=ai("系统设置 ",-1)),E("button",{class:"sp-close",onClick:Y[11]||(Y[11]=J=>n.value=!1)},"✕")]),Y[45]||(Y[45]=E("div",{class:"sp-section-title"},"界面布局",-1)),E("label",ck,[Y[33]||(Y[33]=E("span",null,"参数面板位置",-1)),E("span",hk,[xe(E("input",{type:"checkbox","onUpdate:modelValue":Y[12]||(Y[12]=J=>ke(e).settings.parameterPanelOnRight=J),"aria-label":"参数面板显示在右侧"},null,512),[[ti,ke(e).settings.parameterPanelOnRight]]),Y[32]||(Y[32]=E("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),E("b",null,je(ke(e).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),Y[46]||(Y[46]=E("div",{class:"sp-divider"},null,-1)),Y[47]||(Y[47]=E("div",{class:"sp-section-title"},"操作历史",-1)),E("label",uk,[Y[34]||(Y[34]=E("span",null,"最大撤回步数",-1)),xe(E("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":Y[13]||(Y[13]=J=>ke(e).settings.undoLimit=J),"aria-label":"最大撤回步数",onChange:K},null,544),[[ct,ke(e).settings.undoLimit,void 0,{number:!0}]])]),Y[48]||(Y[48]=E("div",{class:"sp-divider"},null,-1)),Y[49]||(Y[49]=E("div",{class:"sp-section-title"},"画布辅助显示",-1)),E("label",dk,[xe(E("input",{type:"checkbox","onUpdate:modelValue":Y[14]||(Y[14]=J=>ke(e).settings.showEmitter=J)},null,512),[[ti,ke(e).settings.showEmitter]]),Y[35]||(Y[35]=ai("发射点",-1))]),E("label",fk,[xe(E("input",{type:"checkbox","onUpdate:modelValue":Y[15]||(Y[15]=J=>ke(e).settings.showBones=J)},null,512),[[ti,ke(e).settings.showBones]]),Y[36]||(Y[36]=ai("骨骼连线",-1))]),ke(e).settings.showBones?(te(),oe(Ke,{key:0},[E("label",mk,[Y[37]||(Y[37]=E("span",null,"骨骼点绘制大小",-1)),xe(E("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":Y[16]||(Y[16]=J=>ke(e).settings.bonePointDrawSize=J),"aria-label":"骨骼点绘制大小",onChange:d},null,544),[[ct,ke(e).settings.bonePointDrawSize,void 0,{number:!0}]])]),E("label",pk,[Y[38]||(Y[38]=E("span",null,"坐标轴绘制大小",-1)),xe(E("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":Y[17]||(Y[17]=J=>ke(e).settings.boneAxisDrawSize=J),"aria-label":"坐标轴绘制大小",onChange:d},null,544),[[ct,ke(e).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):Ue("",!0),E("label",gk,[xe(E("input",{type:"checkbox","onUpdate:modelValue":Y[18]||(Y[18]=J=>ke(e).settings.showSkinMesh=J)},null,512),[[ti,ke(e).settings.showSkinMesh]]),Y[39]||(Y[39]=ai("蒙皮网格",-1))]),Y[50]||(Y[50]=E("div",{class:"sp-divider"},null,-1)),E("label",vk,[xe(E("input",{type:"checkbox","onUpdate:modelValue":Y[19]||(Y[19]=J=>ke(e).settings.tickEnabled=J)},null,512),[[ti,ke(e).settings.tickEnabled]]),Y[40]||(Y[40]=ai("启用刻度",-1))]),ke(e).settings.tickEnabled?(te(),oe(Ke,{key:1},[E("label",yk,[Y[41]||(Y[41]=E("span",null,"刻度文字大小",-1)),xe(E("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":Y[20]||(Y[20]=J=>ke(e).settings.axisFontSize=J)},null,512),[[ct,ke(e).settings.axisFontSize,void 0,{number:!0}]]),xe(E("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":Y[21]||(Y[21]=J=>ke(e).settings.axisFontSize=J),class:"sp-num"},null,512),[[ct,ke(e).settings.axisFontSize,void 0,{number:!0}]])]),E("label",xk,[Y[42]||(Y[42]=E("span",null,"刻度线粗细",-1)),xe(E("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":Y[22]||(Y[22]=J=>ke(e).settings.tickWidth=J)},null,512),[[ct,ke(e).settings.tickWidth,void 0,{number:!0}]]),xe(E("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":Y[23]||(Y[23]=J=>ke(e).settings.tickWidth=J),class:"sp-num"},null,512),[[ct,ke(e).settings.tickWidth,void 0,{number:!0}]])]),E("label",bk,[Y[43]||(Y[43]=E("span",null,"坐标轴颜色",-1)),xe(E("input",{type:"color","onUpdate:modelValue":Y[24]||(Y[24]=J=>ke(e).settings.axisColor=J),class:"sp-colr"},null,512),[[ct,ke(e).settings.axisColor]]),E("span",wk,je(ke(e).settings.axisColor),1)]),E("label",Sk,[xe(E("input",{type:"checkbox","onUpdate:modelValue":Y[25]||(Y[25]=J=>ke(e).settings.showAxisLabels=J)},null,512),[[ti,ke(e).settings.showAxisLabels]]),Y[44]||(Y[44]=ai("显示刻度数值",-1))])],64)):Ue("",!0),Y[51]||(Y[51]=E("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):Ue("",!0),a.value?(te(),oe("div",{key:1,class:"help-overlay",role:"presentation",onClick:Y[27]||(Y[27]=yt(J=>a.value=!1,["self"]))},[E("section",_k,[E("header",Mk,[Y[52]||(Y[52]=E("div",null,[E("h2",{id:"help-title"},"使用说明"),E("p",null,"从创建粒子到保存、导出的快速入门")],-1)),E("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:Y[26]||(Y[26]=J=>a.value=!1)},"✕")]),Y[53]||(Y[53]=to('

快速开始

  1. 创建对象:在左侧“场景对象”中添加粒子、碰撞、路径或 Spine。
  2. 编辑粒子:选中粒子系统,依次调整发射、形状、属性、外观资源和修改器。
  3. 查看效果:使用底部时间轴播放、暂停或拖动到指定帧;修改参数后会自动重新计算。
  4. 保存成果:配置文件用于继续编辑;“导出 Spine Json”支持 Spine 3.8、4.0、4.1、4.2 和 4.3。

常用功能

小眼睛
单独显示或隐藏场景对象;隐藏的粒子系统不会导出。
+Copy
完整复制当前选中对象,方便对比不同参数效果。
背景图
上传参考图并调整位置和透明度,只用于画布预览。
系统设置
管理界面与辅助显示,并自动保存在当前浏览器中。
配置管理
保存当前项目数据、加载配置,或直接使用预设文件;不包含系统设置。
Spine 骨骼
在层级树搜索并选择骨骼,可用于粒子发射器跟随。

快捷键

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

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

配置与导出有什么区别?

保存配置会保存编辑器中的全部对象和参数,之后可以继续修改;导出 Spine Json只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。

',1))])])):Ue("",!0),i.value?(te(),oe("div",Tk,[Y[54]||(Y[54]=ai(" 系统: ",-1)),E("b",Ak,je(i.value.systems),1),Y[55]||(Y[55]=ai(" · 粒子(骨骼): ",-1)),E("b",Ek,je(i.value.particles),1),Y[56]||(Y[56]=ai(" · 根骨骼: ",-1)),Y[57]||(Y[57]=E("b",null,"root",-1)),Y[58]||(Y[58]=E("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):Ue("",!0)]))}}),rn=(s,e)=>{const t=s.__vccOpts||s;for(const[i,n]of e)t[i]=n;return t},Ik=rn(Ck,[["__scopeId","data-v-94c32e62"]]),Rk={class:"ns-label"},Pk=["min","max","step","value","disabled"],kk=["min","max","step","value","disabled"],Fk=sn({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=ht(String(t.modelValue));cs(()=>t.modelValue,h=>{n.value=String(h)});function r(h){const l=parseFloat(h.target.value);Number.isNaN(l)||i("update:modelValue",l)}function a(h){n.value=h.target.value;const l=parseFloat(n.value);Number.isNaN(l)||i("update:modelValue",l)}function o(){const h=parseFloat(n.value);Number.isNaN(h)&&(n.value=String(t.modelValue))}return(h,l)=>(te(),oe("div",{class:ot(["ns",{disabled:s.disabled}])},[E("span",Rk,je(s.label),1),E("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,Pk),E("input",{type:"number",class:"ns-num",min:s.min,max:s.max,step:s.step,value:n.value,disabled:s.disabled,onInput:a,onBlur:o},null,40,kk)],2))}}),qe=rn(Fk,[["__scopeId","data-v-7c2fbed0"]]),Ok={class:"ce"},Bk={class:"ce-editor"},Lk={class:"ce-grid"},Dk=["x1","x2","y2"],Nk=["y1","x2","y2"],Uk=["x","y","width","height"],Xk=["d"],Vk={key:0,class:"ce-handles"},Yk=["x1","y1","x2","y2"],$k=["cx","cy","onPointerdown"],Gk=["x1","y1","x2","y2"],Hk=["cx","cy","onPointerdown"],jk=["cx","cy"],Wk=["cx","cy","onPointerdown","onDblclick"],zk={class:"ce-nav"},qk={class:"ce-tip"},br=8,Kk=sn({__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=ht(null),r=ht(300),a=ht(110);let o=null;function h(){if(!n.value)return;const I=n.value.getBoundingClientRect();r.value=I.width,a.value=I.height}function l(I){return br+I*(r.value-br*2)}function c(I){return br+(1-I)*(a.value-br*2)}function u(){return[...t.modelValue].sort((I,k)=>I.x-k.x)}function d(I){i("update:modelValue",[...I].sort((k,O)=>k.x-O.x))}function f(){d(t.defaultValue.map(I=>({...I})))}const p=pt(()=>u());function m(I){const k=p.value[I],O=p.value[Math.max(0,I-1)];return{x:k.x-(k.x-O.x)/3,y:k.y-(k.y-O.y)/3}}function g(I){const k=p.value[I],O=p.value[Math.min(p.value.length-1,I+1)];return{x:k.x+(O.x-k.x)/3,y:k.y+(O.y-k.y)/3}}function v(I){const k=p.value[I],O=m(I);return{x:k.x+(k.inX??O.x-k.x),y:k.y+(k.inY??O.y-k.y)}}function b(I){const k=p.value[I],O=g(I);return{x:k.x+(k.outX??O.x-k.x),y:k.y+(k.outY??O.y-k.y)}}const y=pt(()=>{if(!p.value.length)return"";let I=`M ${l(p.value[0].x)} ${c(p.value[0].y)}`;for(let k=1;kMath.abs(U.x-k)>.02);L.push({x:k,y:O}),d(L)}let M={t:0,i:-1,x:0,y:0};function R(I,k){I.stopPropagation();const O=u().findIndex(D=>Math.abs(D.x-p.value[k].x)<1e-6&&Math.abs(D.y-p.value[k].y)<1e-6);if(O<0)return;const L=Date.now();if(L-M.t<300&&M.i===k&&Math.abs(I.clientX-M.x)<8&&Math.abs(I.clientY-M.y)<8){M={t:0,i:-1,x:0,y:0},F(k);return}M={t:L,i:k,x:I.clientX,y:I.clientY};const U=D=>{(Math.abs(D.clientX-I.clientX)>8||Math.abs(D.clientY-I.clientY)>8)&&(M={t:0,i:-1,x:0,y:0});const{x:_,y:X}=w(D.clientX,D.clientY),N=u();N[O]={x:_,y:X},d(N)},B=()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",B)};window.addEventListener("pointermove",U),window.addEventListener("pointerup",B)}function P(I,k,O){I.stopPropagation();const L=B=>{const D=w(B.clientX,B.clientY),_=u(),X=_[k],N=O==="in"?_[Math.max(0,k-1)].x:X.x,V=O==="in"?X.x:_[Math.min(_.length-1,k+1)].x,G=Math.min(V,Math.max(N,D.x)),j=Math.round((G-X.x)*100)/100,ne=Math.round((D.y-X.y)*100)/100;_[k]=O==="in"?{...X,inX:j,inY:ne}:{...X,outX:j,outY:ne},d(_)},U=()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",U)};window.addEventListener("pointermove",L),window.addEventListener("pointerup",U)}function F(I,k){k==null||k.stopPropagation();const O=u();O.length<=2||(A=Date.now(),d(O.filter((L,U)=>U!==I)))}return Da(()=>{h(),o=new ResizeObserver(h),n.value&&o.observe(n.value)}),Gl(()=>{o==null||o.disconnect()}),(I,k)=>(te(),oe("div",Ok,[E("div",Bk,[(te(),oe("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:T},[E("g",Lk,[(te(),oe(Ke,null,ci([.25,.5,.75],O=>E("line",{key:"v"+O,x1:l(O),y1:"0",x2:l(O),y2:c(0)},null,8,Dk)),64)),(te(),oe(Ke,null,ci([.25,.5,.75],O=>E("line",{key:"h"+O,x1:"0",y1:c(O),x2:l(1),y2:c(O)},null,8,Nk)),64))]),E("rect",{x:l(0),y:c(1),width:l(1)-l(0),height:c(0)-c(1),class:"ce-frame",fill:"none"},null,8,Uk),E("path",{d:y.value,class:"ce-line",fill:"none"},null,8,Xk),s.mode==="bezier"?(te(),oe("g",Vk,[(te(!0),oe(Ke,null,ci(p.value,(O,L)=>(te(),oe(Ke,{key:"handles-"+L},[L>0?(te(),oe("line",{key:0,x1:l(O.x),y1:c(O.y),x2:l(v(L).x),y2:c(v(L).y)},null,8,Yk)):Ue("",!0),L>0?(te(),oe("circle",{key:1,cx:l(v(L).x),cy:c(v(L).y),r:"4",onPointerdown:U=>P(U,L,"in")},null,40,$k)):Ue("",!0),LP(U,L,"out")},null,40,Hk)):Ue("",!0)],64))),128))])):Ue("",!0),(te(!0),oe(Ke,null,ci(p.value,(O,L)=>(te(),oe("g",{key:L},[E("circle",{cx:l(O.x),cy:c(O.y),r:"5",class:"ce-node"},null,8,jk),E("circle",{cx:l(O.x),cy:c(O.y),r:"9",class:"ce-hit",onPointerdown:U=>R(U,L),onDblclick:U=>F(L,U)},null,40,Wk)]))),128))],544)),E("div",zk,[E("span",qk,je(s.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),E("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:f},"重置")]))}}),gn=rn(Kk,[["__scopeId","data-v-9bfb7b31"]]),Zk={class:"pac"},Jk={class:"pac-head"},Qk={class:"pac-label"},eF={key:0,class:"pac-modes"},tF=["onClick"],iF={class:"pac-range"},sF={class:"pac-curve"},nF={class:"pac-axis"},rF=sn({__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=pt(()=>{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)=>(te(),oe("div",Zk,[E("div",Jk,[E("span",Qk,je(s.label),1),s.showModes?(te(),oe("div",eF,[(te(!0),oe(Ke,null,ci(t.value,r=>(te(),oe("button",{key:r.value,class:ot(["pac-mode",{on:s.mode===r.value}]),onClick:a=>i.$emit("update:mode",r.value)},je(r.label),11,tF))),128))])):Ue("",!0)]),s.mode==="fixed"||s.mode==="direction"?(te(),Qt(qe,{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"?(te(),oe(Ke,{key:1},[Ne(qe,{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"]),Ne(qe,{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)):(te(),oe(Ke,{key:2},[E("div",iF,[Ne(qe,{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"]),Ne(qe,{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"])]),E("div",sF,[Ne(gn,{"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"]),E("div",nF,[n[6]||(n[6]=E("span",null,"0",-1)),E("span",null,je(s.curveLabel),1),n[7]||(n[7]=E("span",null,"1",-1))])])],64))]))}}),$n=rn(rF,[["__scopeId","data-v-238f838c"]]),aF={class:"gradient-editor"},oF=["title","onClick","onDblclick","onPointerdown"],lF={key:0,class:"gradient-controls"},cF=["value"],hF=["value"],uF={class:"gradient-position"},dF=["value"],fF=["disabled"],mF=sn({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=ht(null),r=ht(0),a=pt(()=>t.modelValue[r.value]||null),o=pt(()=>[...t.modelValue].sort((R,P)=>R.position-P.position)),h=pt(()=>{const R=o.value;return R.length?`linear-gradient(90deg, ${R.map(P=>`${P.color} ${l(P.position)*100}%`).join(", ")})`:"#ffffff"});cs(()=>t.modelValue.length,R=>{r.value>=R&&(r.value=Math.max(0,R-1))});function l(R){return Math.min(1,Math.max(0,Number(R)||0))}function c(){return t.modelValue.map(R=>({position:l(R.position),color:R.color}))}function u(R,P){const F=c();F[R]&&(F[R]={...F[R],...P},i("update:modelValue",F))}function d(R){u(r.value,{color:R.target.value})}function f(R){var I;const P=R.target,F=M(P.value,((I=a.value)==null?void 0:I.color)||"#ffffff");P.value=F,u(r.value,{color:F})}function p(R){const P=R.target;f(R),P.blur()}function m(R){const P=Number(R.target.value);Number.isFinite(P)&&u(r.value,{position:l(P/100)})}function g(R){const P=c();P.push({position:l(R),color:A(P,R)}),r.value=P.length-1,i("update:modelValue",P)}function v(R){if(!n.value)return;const P=n.value.getBoundingClientRect();g((R.clientX-P.left)/Math.max(1,P.width))}function b(){const R=o.value;let P=.5;if(R.length>1){let F=-1;for(let I=0;IF&&(F=k,P=(R[I].position+R[I+1].position)/2)}}g(P)}function y(R){if(t.modelValue.length<=2||R<0)return;const P=c().filter((F,I)=>I!==R);r.value=Math.min(R,P.length-1),i("update:modelValue",P)}function w(R,P){if(!n.value)return;r.value=P;const F=k=>{const O=n.value.getBoundingClientRect();u(P,{position:l((k.clientX-O.left)/Math.max(1,O.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),R.preventDefault()}function A(R,P){const F=[...R].sort((I,k)=>I.position-k.position);if(!F.length)return"#ffffff";if(P<=F[0].position)return F[0].color;if(P>=F[F.length-1].position)return F[F.length-1].color;for(let I=0;IO.position)continue;const L=(P-k.position)/Math.max(1e-4,O.position-k.position);return T(k.color,O.color,L)}return F[F.length-1].color}function T(R,P,F){const I=U=>{const B=parseInt(U.replace("#","").padEnd(6,"0").slice(0,6),16);return[B>>16&255,B>>8&255,B&255]},k=I(R),O=I(P),L=U=>Math.round(k[U]+(O[U]-k[U])*F);return`#${[L(0),L(1),L(2)].map(U=>U.toString(16).padStart(2,"0")).join("")}`}function M(R,P){let F=R.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()}`:P}return(R,P)=>(te(),oe("div",aF,[E("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:Ni({background:h.value}),title:"双击色带添加色标",onDblclick:v},[(te(!0),oe(Ke,null,ci(s.modelValue,(F,I)=>(te(),oe("button",{key:I,type:"button",class:ot(["gradient-stop",{selected:I===r.value}]),style:Ni({left:`${l(F.position)*100}%`,"--stop-color":F.color}),title:`${Math.round(l(F.position)*100)}% · ${F.color}`,onClick:yt(k=>r.value=I,["stop"]),onDblclick:yt(k=>y(I),["stop"]),onPointerdown:yt(k=>w(k,I),["stop"])},null,46,oF))),128))],36),a.value?(te(),oe("div",lF,[E("input",{type:"color",class:"gradient-color",value:a.value.color,"aria-label":"色标颜色",onInput:d},null,40,cF),E("input",{type:"text",class:"gradient-hex-input",value:a.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:f,onKeydown:Aa(p,["enter"])},null,40,hF),E("label",uF,[E("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(a.value.position)*100),"aria-label":"色标位置",onInput:m},null,40,dF),P[1]||(P[1]=E("span",null,"%",-1))]),E("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:b},"+"),E("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:s.modelValue.length<=2,onClick:P[0]||(P[0]=F=>y(r.value))},"×",8,fF)])):Ue("",!0),P[2]||(P[2]=E("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),zv=rn(mF,[["__scopeId","data-v-f6ab10bf"]]),pF={class:"image-card"},gF={class:"imgrow"},vF=["title"],yF=["src","alt"],xF={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},bF={class:"img-fields"},wF={key:0,class:"row"},SF={class:"row"},_F=["placeholder"],MF={class:"img-actions"},TF=["title"],AF=["disabled"],EF={class:"thumb-note"},CF={key:0,class:"row"},IF={class:"row"},RF={class:"row"},PF={class:"sequence-note"},kF={class:"resource-weight-row"},FF=["disabled","title"],OF={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},BF={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},LF=sn({__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=pt(()=>{var l,c;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=((c=u[u.length-1])==null?void 0:c.name)||d;return u.length===1?`1 帧 · ${d}`:`${u.length} 帧 · ${d} → ${f}`}const h=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return h.includes(".")?h:`${h}.png`}),r=pt(()=>{var h,l;return t.resource.imageMode==="sequence"?((l=(h=t.resource.sequenceFrames)==null?void 0:h[0])==null?void 0:l.previewUrl)||"":t.resource.previewUrl}),a=pt(()=>{var u,d;const h=t.resource.sequenceFrames||[];if(!h.length)return"未选择序列帧";const l=((u=h[0])==null?void 0:u.name)||"第一张图片",c=((d=h[h.length-1])==null?void 0:d.name)||"最后一张图片";return`已选择 ${h.length} 帧,按 ${l}-${c} 顺序播放`});function o(){t.supportsSequence&&t.resource.imageMode==="sequence"?i("pickSequence",t.resource.id):i("pick",t.resource.id)}return(h,l)=>(te(),oe("div",pF,[E("div",gF,[E("button",{class:"img-thumb",title:s.supportsSequence&&s.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:o},[r.value?(te(),oe("img",{key:0,src:r.value,alt:s.resource.textureName},null,8,yF)):(te(),oe("svg",xF,[...l[10]||(l[10]=[E("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),E("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),E("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,vF),E("div",bF,[s.showFolder?(te(),oe("label",wF,[l[11]||(l[11]=E("span",null,"子文件夹",-1)),xe(E("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>s.resource.textureFolder=c),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[ct,s.resource.textureFolder]])])):Ue("",!0),E("label",SF,[l[12]||(l[12]=E("span",null,"名称",-1)),xe(E("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>s.resource.textureName=c),type:"text",class:"inp",placeholder:s.namePlaceholder},null,8,_F),[[ct,s.resource.textureName]])])]),E("div",MF,[E("button",{class:"mini-btn2",title:`恢复 ${s.defaultFile}`,onClick:l[2]||(l[2]=c=>h.$emit("reset",s.resource.id))},"⟳",8,TF),E("button",{class:"mini-btn2",title:"删除图片资源",disabled:s.resourceCount===1,onClick:l[3]||(l[3]=c=>h.$emit("remove",s.resource.id))},"🗑",8,AF)])]),E("div",EF,je(n.value),1),s.supportsSequence?(te(),oe("label",CF,[l[14]||(l[14]=E("span",null,"图片模式",-1)),xe(E("select",{"onUpdate:modelValue":l[4]||(l[4]=c=>s.resource.imageMode=c),class:"inp"},[...l[13]||(l[13]=[E("option",{value:"fixed"},"固定",-1),E("option",{value:"sequence"},"序列帧",-1)])],512),[[jt,s.resource.imageMode]])])):Ue("",!0),s.supportsSequence&&s.resource.imageMode==="sequence"?(te(),oe(Ke,{key:1},[E("label",IF,[l[16]||(l[16]=E("span",null,"播放模式",-1)),xe(E("select",{"onUpdate:modelValue":l[5]||(l[5]=c=>s.resource.sequencePlayback=c),class:"inp"},[...l[15]||(l[15]=[E("option",{value:"once-hide"},"单次-尾帧消失",-1),E("option",{value:"once-hold"},"单次-尾帧固定",-1),E("option",{value:"loop-forward"},"正向循环",-1),E("option",{value:"loop-reverse"},"反向循环",-1)])],512),[[jt,s.resource.sequencePlayback]])]),E("label",RF,[l[17]||(l[17]=E("span",null,"播放帧率",-1)),xe(E("input",{"onUpdate:modelValue":l[6]||(l[6]=c=>s.resource.sequenceFps=c),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[ct,s.resource.sequenceFps,void 0,{number:!0}]])]),E("button",{class:"sequence-pick",onClick:l[7]||(l[7]=c=>h.$emit("pickSequence",s.resource.id))},"选择序列帧(多选)"),E("div",PF,je(a.value),1)],64)):Ue("",!0),E("div",kF,[Ne(qe,{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]=c=>h.$emit("updateWeight",s.resource.id,c))},null,8,["model-value","disabled"]),E("button",{class:ot(["weight-lock",{on:s.resource.locked}]),disabled:s.resourceCount===1,title:s.resource.locked?"解除占比锁定":"锁定当前占比",onClick:l[9]||(l[9]=c=>h.$emit("toggleLock",s.resource.id))},[s.resource.locked?(te(),oe("svg",OF,[...l[18]||(l[18]=[E("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),E("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(te(),oe("svg",BF,[...l[19]||(l[19]=[E("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),E("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,FF)]),V_(h.$slots,"default",{},void 0)]))}}),qv=rn(LF,[["__scopeId","data-v-68ff5314"]]),DF={class:"spine-editor"},NF={class:"field wide"},UF={class:"grid three"},XF={class:"field"},VF={class:"field"},YF={class:"field"},$F={class:"grid three"},GF={class:"field"},HF={class:"field"},jF={class:"field"},WF=["disabled"],zF={class:"asset-row"},qF=["title"],KF={class:"asset-row"},ZF=["title"],JF={class:"asset-row"},QF=["title"],e3={class:"asset-actions"},t3=["disabled"],i3={class:"runtime-note"},s3={key:0},n3={key:0,class:"error"},r3={class:"section-box"},a3={key:0,class:"empty"},o3={key:1,class:"field wide"},l3=["value"],c3={class:"section-box"},h3={class:"tree-title-row"},u3=["disabled","title"],d3={key:0,class:"empty"},f3={key:1,class:"bone-search"},m3={key:2,class:"empty"},p3={key:3,class:"bone-tree"},g3=["onClick","onKeydown"],v3=["title","onClick"],y3={key:1,class:"bone-leaf"},x3={class:"bone-name"},b3=sn({__name:"SpineObjectPanel",props:{spineObject:{}},setup(s){const e=s,t=Kl(),i=ht(null),n=ht(null),r=ht(null),a=ht(null),o=ht(new Set),h=ht(""),l=ht(null),c=ht(null),u=ht([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const d=pt(()=>{var D;return((D=l.value)==null?void 0:D.name)||e.spineObject.skeletonFileName}),f=pt(()=>{var D;return((D=c.value)==null?void 0:D.name)||e.spineObject.atlasFileName}),p=pt(()=>u.value.length?u.value.map(D=>D.name):e.spineObject.textureFileNames),m=pt(()=>p.value.length?`${p.value.length} 张:${p.value.join(", ")}`:"PNG / JPEG / WebP..."),g=pt(()=>new Set(e.spineObject.bones.map(D=>D.parent).filter(D=>!!D))),v=pt(()=>new Map(e.spineObject.bones.map(D=>[D.name,D]))),b=pt(()=>e.spineObject.bones.filter(D=>{var N;const _=h.value.trim().toLocaleLowerCase();if(_)return D.name.toLocaleLowerCase().includes(_);let X=D.parent;for(;X;){if(o.value.has(X))return!1;X=((N=v.value.get(X))==null?void 0:N.parent)||null}return!0})),y=pt(()=>g.value.size>0&&[...g.value].every(D=>o.value.has(D)));function w(D){const _=e.spineObject.selectedBone===D;for(const X of t.spines)X.selectedBone="";_||(e.spineObject.selectedBone=D)}function A(D){o.value.has(D)?o.value.delete(D):o.value.add(D)}function T(){o.value=y.value?new Set:new Set(g.value)}function M(D){var _;return((_=D.target.files)==null?void 0:_[0])||null}function R(D){l.value=M(D)}function P(D){c.value=M(D)}function F(D){u.value=Array.from(D.target.files||[])}function I(D){return D.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function k(D){const _=Array.from(D.target.files||[]);if(!_.length)return;const X=_.filter(Q=>/\.(json|skel)$/i.test(Q.name)),N=_.filter(Q=>/\.atlas$/i.test(Q.name)),V=_.filter(Q=>/\.(png|jpe?g|webp|wepb)$/i.test(Q.name)),G=N.map(Q=>({atlas:Q,skeleton:X.find(de=>I(de)===I(Q))})).find(Q=>Q.skeleton),j=(G==null?void 0:G.skeleton)||X[0]||null,ne=(G==null?void 0:G.atlas)||N[0]||null;if(l.value=j,c.value=ne,u.value=V,!j||!ne||!V.length){const Q=[!j&&"JSON / SKEL",!ne&&"Atlas",!V.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${Q}`;return}await U()}function O(){t.recalcTotalFrames()}function L(){O(),t.timeline.frame=0}async function U(){var X;const D=l.value,_=c.value;if(!D||!_||!u.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const N=await bw(D,_,u.value);Au(e.spineObject.id,N),e.spineObject.skeletonFileName=D.name,e.spineObject.atlasFileName=_.name,e.spineObject.textureFileNames=u.value.map(V=>V.name),e.spineObject.dataVersion=N.dataVersion,e.spineObject.animations=N.animations,e.spineObject.bones=N.bones,e.spineObject.selectedBone="",h.value="",o.value=new Set,e.spineObject.selectedAnimation=((X=N.animations[0])==null?void 0:X.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",O(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await kP(D,_,u.value)}catch(V){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",V)}}catch(N){e.spineObject.status="error",e.spineObject.error=N instanceof Error?N.message:String(N)}}function B(){ql(e.spineObject.id),l.value=null,c.value=null,u.value=[],i.value&&(i.value.value=""),n.value&&(n.value.value=""),r.value&&(r.value.value=""),a.value&&(a.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="",h.value="",o.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",O()}return(D,_)=>(te(),oe("div",DF,[_[30]||(_[30]=E("div",{class:"editor-title"},"Spine 属性",-1)),E("label",NF,[_[15]||(_[15]=E("span",null,"Spine 名称",-1)),xe(E("input",{"onUpdate:modelValue":_[0]||(_[0]=X=>s.spineObject.name=X)},null,512),[[ct,s.spineObject.name]])]),E("div",UF,[E("label",XF,[_[16]||(_[16]=E("span",null,"X 位置",-1)),xe(E("input",{"onUpdate:modelValue":_[1]||(_[1]=X=>s.spineObject.x=X),type:"number"},null,512),[[ct,s.spineObject.x,void 0,{number:!0}]])]),E("label",VF,[_[17]||(_[17]=E("span",null,"Y 位置",-1)),xe(E("input",{"onUpdate:modelValue":_[2]||(_[2]=X=>s.spineObject.y=X),type:"number"},null,512),[[ct,s.spineObject.y,void 0,{number:!0}]])]),E("label",YF,[_[18]||(_[18]=E("span",null,"旋转",-1)),xe(E("input",{"onUpdate:modelValue":_[3]||(_[3]=X=>s.spineObject.rotation=X),type:"number"},null,512),[[ct,s.spineObject.rotation,void 0,{number:!0}]])])]),E("div",$F,[E("label",GF,[_[19]||(_[19]=E("span",null,"Scale X",-1)),xe(E("input",{"onUpdate:modelValue":_[4]||(_[4]=X=>s.spineObject.scaleX=X),type:"number",step:"0.05"},null,512),[[ct,s.spineObject.scaleX,void 0,{number:!0}]])]),E("label",HF,[_[20]||(_[20]=E("span",null,"Scale Y",-1)),xe(E("input",{"onUpdate:modelValue":_[5]||(_[5]=X=>s.spineObject.scaleY=X),type:"number",step:"0.05"},null,512),[[ct,s.spineObject.scaleY,void 0,{number:!0}]])]),E("label",jF,[_[21]||(_[21]=E("span",null,"开始时间",-1)),xe(E("input",{"onUpdate:modelValue":_[6]||(_[6]=X=>s.spineObject.timeOffset=X),type:"number",min:"0",step:"0.033333",onChange:O},null,544),[[ct,s.spineObject.timeOffset,void 0,{number:!0}]])])]),_[31]||(_[31]=E("div",{class:"divider"},null,-1)),_[32]||(_[32]=E("div",{class:"section-title"},"Spine 资源",-1)),E("input",{ref_key:"skeletonInput",ref:i,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:R},null,544),E("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:P},null,544),E("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),E("input",{ref_key:"folderInput",ref:a,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:k},null,544),E("button",{class:"folder-select",disabled:s.spineObject.status==="loading",onClick:_[7]||(_[7]=X=>{var N;return(N=a.value)==null?void 0:N.click()})},"选择文件夹并加载",8,WF),_[33]||(_[33]=E("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),E("div",zF,[E("div",{class:"asset-name",title:d.value},je(d.value||"JSON / SKEL..."),9,qF),E("button",{onClick:_[8]||(_[8]=X=>{var N;return(N=i.value)==null?void 0:N.click()})},"选择")]),E("div",KF,[E("div",{class:"asset-name",title:f.value},je(f.value||"Atlas..."),9,ZF),E("button",{onClick:_[9]||(_[9]=X=>{var N;return(N=n.value)==null?void 0:N.click()})},"选择")]),E("div",JF,[E("div",{class:"asset-name",title:p.value.join(", ")},je(m.value),9,QF),E("button",{onClick:_[10]||(_[10]=X=>{var N;return(N=r.value)==null?void 0:N.click()})},"选择(多选)")]),E("div",e3,[E("button",{class:"load",disabled:s.spineObject.status==="loading",onClick:U},je(s.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,t3),E("button",{class:"clear",onClick:B},"清除")]),E("div",i3,[_[22]||(_[22]=ai(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线 ",-1)),s.spineObject.dataVersion?(te(),oe("span",s3," · 当前资源 "+je(s.spineObject.dataVersion),1)):Ue("",!0)]),s.spineObject.error?(te(),oe("div",n3,je(s.spineObject.error),1)):Ue("",!0),E("div",r3,[_[25]||(_[25]=E("div",{class:"section-title"},"Spine 动画",-1)),s.spineObject.animations.length?(te(),oe("label",o3,[_[24]||(_[24]=E("span",null,"时间轴播放动画",-1)),xe(E("select",{"onUpdate:modelValue":_[11]||(_[11]=X=>s.spineObject.selectedAnimation=X),onChange:L},[_[23]||(_[23]=E("option",{value:""},"无",-1)),(te(!0),oe(Ke,null,ci(s.spineObject.animations,X=>(te(),oe("option",{key:X.name,value:X.name},je(X.name)+"("+je(X.duration.toFixed(2))+"s) ",9,l3))),128))],544),[[jt,s.spineObject.selectedAnimation]])])):(te(),oe("div",a3,"无可用动画"))]),E("div",c3,[E("div",h3,[_[29]||(_[29]=E("div",{class:"section-title"},"层级树",-1)),E("button",{class:ot(["selected-bone",{active:s.spineObject.selectedBone}]),disabled:!s.spineObject.selectedBone,title:s.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:_[12]||(_[12]=X=>s.spineObject.selectedBone="")},[s.spineObject.selectedBone?(te(),oe(Ke,{key:0},[_[26]||(_[26]=ai("清除选中骨骼:",-1)),E("strong",null,je(s.spineObject.selectedBone),1)],64)):(te(),oe(Ke,{key:1},[_[27]||(_[27]=ai("当前骨骼:",-1)),_[28]||(_[28]=E("strong",null,"未选择",-1))],64))],10,u3),s.spineObject.bones.length?(te(),oe("button",{key:0,class:"tree-action",onClick:T},je(y.value?"全部展开":"全部折叠"),1)):Ue("",!0)]),s.spineObject.bones.length?(te(),oe("div",f3,[xe(E("input",{"onUpdate:modelValue":_[13]||(_[13]=X=>h.value=X),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[ct,h.value,void 0,{trim:!0}]]),h.value?(te(),oe("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:_[14]||(_[14]=X=>h.value="")},"✕")):Ue("",!0)])):(te(),oe("div",d3,"未加载 Spine")),s.spineObject.bones.length&&!b.value.length?(te(),oe("div",m3,"未找到匹配的骨骼")):s.spineObject.bones.length?(te(),oe("div",p3,[(te(!0),oe(Ke,null,ci(b.value,X=>(te(),oe("div",{key:X.name,class:ot(["bone",{selected:s.spineObject.selectedBone===X.name}]),style:Ni({paddingLeft:`${6+X.depth*16}px`}),role:"button",tabindex:"0",onClick:N=>w(X.name),onKeydown:Aa(yt(N=>w(X.name),["prevent"]),["enter"])},[g.value.has(X.name)?(te(),oe("button",{key:0,class:"bone-toggle",title:o.value.has(X.name)?"展开子骨骼":"折叠子骨骼",onClick:yt(N=>A(X.name),["stop"])},je(o.value.has(X.name)?"▸":"▾"),9,v3)):(te(),oe("span",y3,"•")),E("span",x3,je(X.name),1)],46,g3))),128))])):Ue("",!0)])]))}}),w3=rn(b3,[["__scopeId","data-v-9257fb45"]]),bi=La({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let Bc=0;function S3(s){return new Promise(e=>window.setTimeout(e,s))}function Kv(s,e){const t=++Bc,i=performance.now();Object.assign(bi,{visible:!0,title:s,detail:e,progress:0,indeterminate:!1,failed:!1});const n=(a,o)=>{t===Bc&&(bi.indeterminate=a==null,a!=null&&(bi.progress=Math.min(100,Math.max(0,a))),o&&(bi.detail=o))},r=async(a,o)=>{if(t!==Bc)return;bi.failed=a,bi.indeterminate=!1,bi.progress=a?bi.progress:100,bi.detail=o,await S3(Math.max(180,(a?850:450)-(performance.now()-i))),t===Bc&&(bi.visible=!1)};return{update:n,paint:()=>new Promise(a=>requestAnimationFrame(()=>a())),finish:(a="已完成")=>r(!1,a),fail:(a="操作失败")=>r(!0,a)}}async function _3(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 a=0,o="";for(e(i?0:null);;){const{done:h,value:l}=await n.read();if(h)break;a+=l.byteLength,o+=r.decode(l,{stream:!0}),e(i?Math.min(1,a/t):null)}return o+=r.decode(),i&&e(1),o}const M3="3.8";function Ps(s,e,t){s[e]==null&&s[t]!=null&&(s[e]=s[t]),delete s[t]}function Rm(s){if(!s||typeof s!="object")return;if(Array.isArray(s)){for(const t of s)Rm(t);return}const e=s;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Rm(t)}function T3(s){for(const e of s.bones)Ps(e,"transform","inherit");for(const e of s.transform||[])Ps(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),Ps(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of s.path||[])Ps(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&&Ps(i,"deform","timelines")}function A3(s){for(const e of Object.values(s.slots||{}))Ps(e,"color","rgba"),Ps(e,"twoColor","rgba2")}function E3(s){for(const e of Object.values(s.bones||{}))for(const t of e.rotate||[])Ps(t,"angle","value")}function C3(s){for(const e of Object.values(s.transform||{}))for(const t of e)Ps(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),Ps(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function I3(s){for(const e of Object.values(s.path||{})){for(const t of["position","spacing"])for(const i of e[t]||[])Ps(i,t,"value");for(const t of e.mix||[])Ps(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function R3(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,a]of Object.entries(i)){const o=n[r]||(n[r]={});for(const[h,l]of Object.entries(a))l.deform&&(o[h]=l.deform)}}delete s.attachments}function P3(s){s.skeleton.spine=M3,T3(s);for(const e of Object.values(s.animations))A3(e),E3(e),C3(e),I3(e),R3(e);return Rm(s.animations),s}function k3(s,e,t,i){const n=t.frame-e.frame,r=n<=0?0:(s.frame-e.frame)/n;let a=0;for(let o=0;o[...i].sort((a,o)=>a-o);let r=!0;for(;r;){r=!1;const a=n();for(let o=0;ou&&(u=f,c=d)}c>=0&&(i.add(c),r=!0)}}return n().map(a=>s[a])}function Zv(s,e,t,i,n){const r=t-e+1;if(r<2)return 0;const a=n?e:t,o=n?e+1:t-1,h=n?e+2:t-2,l=Math.abs(s[o].frame-s[a].frame);if(r>=3&&l>0&&Math.abs(Math.abs(s[h].frame-s[o].frame)-l)<1e-6){const u=s[a].values[i],d=s[o].values[i],f=s[h].values[i];return n?(-3*u+4*d-f)/(2*l):(3*u-4*d+f)/(2*l)}const c=s[o].frame-s[a].frame;return c?(s[o].values[i]-s[a].values[i])/c:0}function Jv(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])),c=a+Zv(s,e,t,r,!0)*i/3,u=o-Zv(s,e,t,r,!1)*i/3;n.push([Math.max(h,Math.min(l,c)),Math.max(h,Math.min(l,u))])}return{values:n}}function F3(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 O3(s,e,t,i,n){const r=t.frame-e.frame,a=r<=0?0:(s.frame-e.frame)/r;let o=0;for(let h=0;h[...i].sort((o,h)=>o-h);let r=!0;for(;r;){r=!1;const o=n();for(let h=0;hf&&(f=m,d=p)}d>=0&&(i.add(d),r=!0)}}const a=n();return{samples:a.map(o=>s[o]),controls:a.slice(0,-1).map((o,h)=>Jv(s,o,a[h+1]))}}function B3(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 Ai(s){if(!Number.isFinite(s))return 0;const e=Math.round(s*1e5)/1e5;return Object.is(e,-0)?0:e}function L3(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))),a=Math.max(2,t.length),o=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),h=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,c=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(s,e){let t=s,i=2;for(;e.has(t);)t=`${s}_${i++}`;return e.add(t),t}function N3(s){return s.replace(/\.[^./\\]+$/,"")}function Ow(s,e){return N3([s,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function U3(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 Dc(s){return Math.round(Math.max(0,Math.min(1,s))*255).toString(16).padStart(2,"0")}function sy(s,e){return[(s>>16&255)/255,(s>>8&255)/255,(s&255)/255,Math.max(0,Math.min(1,e))]}function xl(s,e){return Ai(s/e)}function X3(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 Yh(s,e){return e?s.boneName:`${s.spawnId??"legacy"}_${s.boneName}`}function V3(s,e,t){const i=new Set;for(const n of s)for(const r of n)i.add(Yh(r,e));return[...i].sort().map((n,r)=>({key:n,name:Fw(`_particle_${String(r).padStart(3,"0")}`,t),states:s.map(a=>a.find(o=>Yh(o,e)===n)||null)}))}function Y3(s,e,t,i){const n=e*t/i,r=Math.min(s.states.length-1,Math.max(0,Math.floor(n))),a=Math.min(s.states.length-1,r+1),o=s.states[r],h=s.states[a];if(!o||!h||Yh(o,!0)!==Yh(h,!0)||o.spawnId!==h.spawnId)return o;const l=n-r;if(l<=1e-6)return o;const c=(d,f)=>(d??0)+((f??d??0)-(d??0))*l,u=o.trailState&&h.trailState&&o.trailState.resourceId===h.trailState.resourceId?{...o.trailState,width:c(o.trailState.width,h.trailState.width),alpha:c(o.trailState.alpha,h.trailState.alpha),bones:o.trailState.bones.map((d,f)=>{const p=h.trailState.bones[f]||d;return{...d,worldX:c(d.worldX??d.x,p.worldX??p.x),worldY:c(d.worldY??d.y,p.worldY??p.y),worldRotation:c(d.worldRotation??-d.rotation,p.worldRotation??-p.rotation)}})}:o.trailState;return{...o,worldX:c(o.worldX,h.worldX),worldY:c(o.worldY,h.worldY),worldRotation:c(o.worldRotation,h.worldRotation),worldScaleX:c(o.worldScaleX,h.worldScaleX),worldScaleY:c(o.worldScaleY,h.worldScaleY),alpha:c(o.alpha,h.alpha),trailState:u}}function ny(s,e){return!s||s==="跟随导出"?e.keyframeCurve:s==="贝塞尔"?"bezier":"linear"}function Qa(s,e,t,i,n,r=new Set,a=n.keyframeCurve){if(!s.length)return[];const o=a==="bezier"&&n.spineVersion!=="3.8"?kw(s,i,r):{samples:Pw(s,i,r),controls:[]},h=o.samples.map(l=>{const c={time:xl(l.frame,e)};return t.forEach((u,d)=>{c[u]=Ai(l.values[d])}),c});for(let l=0;l0&&n&&e.add(t-1),i&&e.add(t))}return e}function G3(s){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),i&&e.add(t))}return e}function H3(s,e){var i;if(!s.shapeEnabled||!((i=s.shapeCurve)!=null&&i.length))return 1;const t=[...s.shapeCurve].sort((n,r)=>n.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let n=1;n{r!==n&&(i.push(t(r,a)),n=r)}),i}function W3(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,a=U3(r);(!a.width||!a.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const o=a.width||1,h=a.height||1;return{path:Ow(s.textureFolder,n),x:Ai((.5-s.anchorX)*o),y:Ai((s.anchorY-.5)*h),width:Ai(o),height:Ai(h)}}function z3(s,e,t,i,n=i.keyframeCurve){if(!s.length)return[];const r=new Set;for(let c=1;c({frame:u,values:c})),o=1/255,h=n==="bezier"&&i.spineVersion!=="3.8"?kw(a,[o,o,o,.01],r):{samples:Pw(a,[o,o,o,.01],r),controls:[]},l=h.samples.map(c=>({time:xl(c.frame,t),color:`${Dc(c.values[0])}${Dc(c.values[1])}${Dc(c.values[2])}${Dc(c.values[3])}`}));if(h.controls.length)for(let c=0;c({time:xl(d,n),name:u??null}));h.length&&(o.attachment=h);const l=z3(i,t,n,r,a);l.length&&(o.rgba=l)}function ay(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=[],a=s.systems.filter(m=>m.visible!==!1),o={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||(o.skeleton.fps=i);const h=o.skins[0].attachments,l=new Set(["root"]),c=[...new Set([...s.timeline.animations.length?s.timeline.animations:["animation"],...a.map(m=>m.animation||"animation")])],u=new Map;for(const m of a){const g=Math.min(((p=m.frames)==null?void 0:p.length)||0,X3(m,t)),v=(m.frames||[]).slice(0,g);v.length||r.push({code:"empty-cache",message:`“${m.config.name}”没有可用帧缓存。`});const b=Fw(D3(m.config.name,`system_${m.id}`),l);o.bones.push({name:b,parent:"root"});const y=V3(v,e.bonePool,l),w=Math.max(0,(g-1)/t),A=Math.max(1,Math.ceil(w*n)+1),T=u.get(m.animation)||[];T.push({system:m,tracks:y,targetFrames:A}),u.set(m.animation,T);for(const M of y){o.bones.push({name:M.name,parent:b});const R=new Set(m.config.imageResources.map(k=>k.blend));for(const k of R){const O=`${M.name}_image_${k}`;o.slots.push({name:O,bone:M.name,color:"ffffff00",blend:Qv[k]});const L=h[O]||(h[O]={});for(const U of m.config.imageResources.filter(B=>B.blend===k)){const B=U.imageMode==="sequence"?Math.max(1,U.sequenceFrames.length):1;for(let D=0;D{var X;return((X=_==null?void 0:_.trailState)==null?void 0:X.resourceId)===k.id}))continue;const O=Math.max(2,Math.min(16,Math.round(k.boneCount||3))),L=[];for(let _=0;_o.bones.findIndex(X=>X.name===_)),D=Ow("",k.textureName||`trail_${k.id}`);(h[U]||(h[U]={}))[`trail_${k.id}`]=L3(m.config,k,B,D),k.texture||r.push({code:"missing-image",message:`拖尾图片“${k.textureName||k.id}”缺失,已保留路径。`})}const P=`${M.name}_image_`,F=`${M.name}_trail_`,I=o.slots.filter(k=>String(k.name).startsWith(P)||String(k.name).startsWith(F));I.length&&(o.slots=o.slots.filter(k=>!I.includes(k)),o.slots.push(...I.filter(k=>String(k.name).startsWith(F)),...I.filter(k=>String(k.name).startsWith(P))))}}for(const m of c){const g=u.get(m)||[],v={bones:{},slots:{}};let b=!1;for(const{system:y,tracks:w,targetFrames:A}of g)for(const T of w){const M=Array.from({length:A},(N,V)=>Y3(T,V,t,n)),R=M.map(N=>!!(N!=null&&N.active)),P=[],F=[],I=[];M.forEach((N,V)=>{N!=null&&N.active&&(P.push({frame:V,values:[N.worldX??N.x,N.worldY??N.y]}),F.push(N.worldRotation??N.rotation),I.push({frame:V,values:[N.worldScaleX??N.scaleX,N.worldScaleY??N.scaleY]}))});const k=B3(F),O=P.map((N,V)=>({frame:N.frame,values:[k[V]??0]})),L=$3(M),U={},B=Qa(P,n,["x","y"],[ey,ey],e,L),D=Qa(O,n,["value"],[iy],e,L),_=Qa(I,n,["x","y"],[Lc,Lc],e,L);B.length&&(U.translate=B),D.length&&(U.rotate=D),_.length&&(U.scale=_),Object.keys(U).length&&(v.bones[T.name]=U,b=!0);const X=new Set(y.config.imageResources.map(N=>N.blend));for(const N of X){const V=[],G=[];let j=16777215;for(let me=0;meAe.id===we.resourceId):void 0,ge=!!we&&R[me]&&we.imageVisible!==!1&&(Re==null?void 0:Re.blend)===N;we&&(Re==null?void 0:Re.blend)===N&&(j=we.colorHex),V.push(ge?`image_${Re.id}_${we.imageFrameIndex??0}`:null),G.push(sy(j,ge?we.alpha:0))}const Q=y.config.imageResources.filter(me=>me.blend===N).filter(me=>me.independentAlpha==="curve").map(me=>ny(me.alphaCurveMode,e)),de=Q.length?Q.includes("bezier")?"bezier":"linear":ny(y.config.alphaMode==="curve"?y.config.curveMode:void 0,e);ry(v,`${T.name}_image_${N}`,V,G,n,e,de),V.some(Boolean)&&(b=!0)}if(y.config.trail)for(const N of y.config.trailResources){const V=Math.max(2,Math.min(16,Math.round(N.boneCount||3))),G=M.map(Ae=>{var H;return((H=Ae==null?void 0:Ae.trailState)==null?void 0:H.resourceId)===N.id?Ae.trailState:void 0}),j=G.find(Ae=>!!Ae);if(!j)continue;const ne=G3(G),Q=N.widthSizeMode==="random"?Math.max(1,Number(N.widthMin)||0,Number(N.widthMax)||0):Math.max(.001,Number(N.width)||100);let de=j;const me=G.map(Ae=>(Ae&&(de=Ae),de));for(let Ae=0;Ae{const Oe=Xe==null?void 0:Xe.bones[Math.min(Xe.bones.length-1,Ae)];if(!Oe)return;const it={x:Oe.worldX??Oe.x,y:Oe.worldY??Oe.y,rotation:Oe.worldRotation??-Oe.rotation};H.push({frame:Pe,values:[it.x,it.y]}),K.push({frame:Pe,values:[it.rotation]}),q.push({frame:Pe,values:[1,Math.max(0,Xe.width/Q)*ee]})});const le=`${T.name}_trail_${N.id}_${Ae}`,ve={},re=Qa(H,n,["x","y"],[ty,ty],e,z),ye=Qa(K,n,["value"],[iy],e,z),he=Qa(q,n,["x","y"],[Lc,Lc],e,z);re.length&&(ve.translate=re),ye.length&&(ve.rotate=ye),he.length&&(ve.scale=he),Object.keys(ve).length&&(v.bones[le]=ve)}const we=G.map(()=>`trail_${N.id}`);let Re=j.colorHex;const ge=G.map(Ae=>(Ae&&(Re=Ae.colorHex),sy(Re,Ae?Ae.alpha:0)));ry(v,`${T.name}_trail_${N.id}`,we,ge,n,e),b=!0}}(b||!e.excludeEmptyAnimations)&&(o.animations[m]=v)}!Object.keys(o.animations).length&&!e.excludeEmptyAnimations&&(o.animations.animation={bones:{},slots:{}});const d=e.spineVersion==="3.8"?P3(o):o,f=JSON.stringify(d,null,2);return{json:d,text:f,warnings:r,particleSystemCount:a.length,animationCount:Object.keys(d.animations).length,boneCount:d.bones.length}}function q3(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 w8{constructor(){x(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 K3{constructor(){x(this,"entries",{});x(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 xs){return t.setFromString(e)}};x(xs,"WHITE",new xs(1,1,1,1)),x(xs,"RED",new xs(1,0,0,1)),x(xs,"GREEN",new xs(0,1,0,1)),x(xs,"BLUE",new xs(0,0,1,1)),x(xs,"MAGENTA",new xs(1,0,1,1));let xt=xs;const di=class di{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*di.degRad)}static sinDeg(e){return Math.sin(e*di.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*di.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 di.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}};x(di,"epsilon",1e-5),x(di,"epsilon2",di.epsilon*di.epsilon),x(di,"PI",3.1415927),x(di,"PI2",di.PI*2),x(di,"invPI2",1/di.PI2),x(di,"radiansToDegrees",180/di.PI),x(di,"radDeg",di.radiansToDegrees),x(di,"degreesToRadians",di.PI/180),x(di,"degRad",di.degreesToRadians);let Ve=di;const Es=class Es{apply(e,t,i){return t===void 0||i===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(i)}};x(Es,"linear",new class extends Es{applyInternal(e){return e}}),x(Es,"smooth",new class extends Es{applyInternal(e){return e*e*(3-2*e)}}),x(Es,"slowFast",new class extends Es{applyInternal(e){return e*e}}),x(Es,"fastSlow",new class extends Es{applyInternal(e){return(e-1)*(e-1)*-1+1}}),x(Es,"circle",new class extends Es{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 To=Es;class Z3 extends To{constructor(t){super();x(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 S8 extends Z3{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const Ir=class Ir{static arrayCopy(e,t,i,n,r){for(let a=t,o=n;a=t?e:Ir.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 T8{constructor(e=32){x(this,"values");x(this,"addedValues",0);x(this,"lastValue",0);x(this,"mean",0);x(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{c.width=parseInt(i[1]),c.height=parseInt(i[2])},n.format=()=>{},n.filter=c=>{c.minFilter=lt.enumValue(Io,i[1]),c.magFilter=lt.enumValue(Io,i[2])},n.repeat=c=>{i[1].indexOf("x")!==-1&&(c.uWrap=Ro.Repeat),i[1].indexOf("y")!==-1&&(c.vWrap=Ro.Repeat)},n.pma=c=>{c.pma=i[1]==="true"};var r={};r.xy=c=>{c.x=parseInt(i[1]),c.y=parseInt(i[2])},r.size=c=>{c.width=parseInt(i[1]),c.height=parseInt(i[2])},r.bounds=c=>{c.x=parseInt(i[1]),c.y=parseInt(i[2]),c.width=parseInt(i[3]),c.height=parseInt(i[4])},r.offset=c=>{c.offsetX=parseInt(i[1]),c.offsetY=parseInt(i[2])},r.orig=c=>{c.originalWidth=parseInt(i[1]),c.originalHeight=parseInt(i[2])},r.offsets=c=>{c.offsetX=parseInt(i[1]),c.offsetY=parseInt(i[2]),c.originalWidth=parseInt(i[3]),c.originalHeight=parseInt(i[4])},r.rotate=c=>{const u=i[1];u==="true"?c.degrees=90:u!=="false"&&(c.degrees=parseInt(u))},r.index=c=>{c.index=parseInt(i[1])};let a=t.readLine();for(;a&&a.trim().length===0;)a=t.readLine();for(;!(!a||a.trim().length===0||t.readEntry(i,a)===0);)a=t.readLine();let o=null,h=null,l=null;for(;a!==null;)if(a.trim().length===0)o=null,a=t.readLine();else if(o){const c=new Lw(o,a);for(;;){const u=t.readEntry(i,a=t.readLine());if(u===0)break;const d=r[i[0]];if(d)d(c);else{h||(h=[]),l||(l=[]),h.push(i[0]);const f=[];for(let p=0;p0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,c.degrees===90?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new tO(a.trim());t.readEntry(i,a=t.readLine())!==0;){const c=n[i[0]];c&&c(o)}this.pages.push(o)}}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 a=t.indexOf(",",r);if(a===-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,a-r).trim(),r=a+1,n===4)return 4}}}class tO{constructor(e){x(this,"name");x(this,"minFilter",Io.Nearest);x(this,"magFilter",Io.Nearest);x(this,"uWrap",Ro.ClampToEdge);x(this,"vWrap",Ro.ClampToEdge);x(this,"texture",null);x(this,"width",0);x(this,"height",0);x(this,"pma",!1);x(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 Lw extends Bw{constructor(t,i){super();x(this,"page");x(this,"name");x(this,"x",0);x(this,"y",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0);x(this,"index",0);x(this,"degrees",0);x(this,"names",null);x(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}}const zh=class zh{constructor(e){x(this,"name");x(this,"timelineAttachment");x(this,"timelineSlots",zh.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,a=this.timelineSlots.length;r>1)*h;const l=i.appliedPose.deform;let c=this.vertices;const u=this.bones;if(!u){l.length>0&&(c=l);const m=i.bone.appliedPose,g=m.worldX,v=m.worldY,b=m.a,y=m.b,w=m.c,A=m.d;for(let T=n,M=o;M=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 ho._nextID++}};x(ho,"_nextID",0);let ko=ho;var Gi;(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"})(Gi||(Gi={}));const Dw=[Gi.hold,Gi.once,Gi.loop,Gi.pingpong,Gi.onceReverse,Gi.loopReverse,Gi.pingpongReverse];class Op{constructor(e,t,i){x(this,"name");x(this,"timelines",[]);x(this,"timelineIds");x(this,"bones");x(this,"color",new xt(1,1,1,1));x(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=i,this.timelineIds=new K3,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 iO(s){return typeof s=="object"&&s!==null&&typeof s.slotIndex=="number"}class Va extends si{constructor(t,i,...n){super(t,...n);x(this,"curves");this.curves=lt.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=lt.newFloatArray(i);lt.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,a,o,h,l,c,u,d){const f=this.curves;let p=this.getFrameCount()+t*18;n===0&&(f[i]=2+p);const m=(r-o*2+l)*.03,g=(a-h*2+c)*.03,v=((o-l)*3-r+u)*.006,b=((h-c)*3-a+d)*.006;let y=m*2+v,w=g*2+b,A=(o-r)*.3+m+v*.16666667,T=(h-a)*.3+g+b*.16666667,M=r+A,R=a+T;for(let P=p+18;pt){const c=this.frames[i],u=this.frames[i+n];return u+(t-c)/(a[r]-c)*(a[r+1]-u)}const o=r+18;for(r+=2;r=t){const c=a[r-2],u=a[r-1];return u+(t-c)/(a[r]-c)*(a[r+1]-u)}i+=this.getFrameEntries();const h=a[o-2],l=a[o-1];return l+(t-h)/(this.frames[i]-h)*(this.frames[i+n]-l)}}class sr extends Va{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],a=t[i+1];return a+(e-r)/(t[i+2]-r)*(t[i+2+1]-a)}case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r,a){if(e>2];switch(f){case 0:{const p=u[d];h=u[d+1],l=u[d+2],c=u[d+3];const m=(i-p)/(u[d+4]-p);h+=(u[d+4+1]-h)*m,l+=(u[d+4+2]-l)*m,c+=(u[d+4+3]-c)*m;break}case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(n!==1)if(r===st.setup){const p=e.data.setupPose.color;h=p.r+(h-p.r)*n,l=p.g+(l-p.g)*n,c=p.b+(c-p.b)*n}else h=o.r+(h-o.r)*n,l=o.g+(l-o.g)*n,c=o.b+(c-o.b)*n;o.r=h<0?0:h>1?1:h,o.g=l<0?0:l>1?1:l,o.b=c<0?0:c>1?1:c}}class Kw extends sr{constructor(t,i,n){super(t,i,`${vt.alpha}|${n}`);x(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,a,o,h,l,c){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=(c?u.appliedPose:u.pose).color;let f=0;const p=this.frames;if(n1?1:f}}class Zw extends Ru{constructor(e,t,i){super(e,t,i,`${vt.rgb}|${i}`,`${vt.alpha}|${i}`,`${vt.rgb2}|${i}`)}getFrameEntries(){return 8}setFrame(e,t,i,n,r,a,o,h,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]=a,this.frames[e+5]=o,this.frames[e+6]=h,this.frames[e+7]=l}apply1(e,t,i,n,r,a){const o=t.color,h=t.darkColor;let l=0,c=0,u=0;const d=this.frames;if(i>3];switch(b){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],c=d[v+6],u=d[v+7];const w=(i-y)/(d[v+8]-y);f+=(d[v+8+1]-f)*w,p+=(d[v+8+2]-p)*w,m+=(d[v+8+3]-m)*w,g+=(d[v+8+4]-g)*w,l+=(d[v+8+5]-l)*w,c+=(d[v+8+6]-c)*w,u+=(d[v+8+7]-u)*w;break}case 1:f=d[v+1],p=d[v+2],m=d[v+3],g=d[v+4],l=d[v+5],c=d[v+6],u=d[v+7];break;default:f=this.getBezierValue(i,v,1,b-2),p=this.getBezierValue(i,v,2,b+18-2),m=this.getBezierValue(i,v,3,b+36-2),g=this.getBezierValue(i,v,4,b+54-2),l=this.getBezierValue(i,v,5,b+72-2),c=this.getBezierValue(i,v,6,b+90-2),u=this.getBezierValue(i,v,7,b+108-2)}if(n===1)o.set(f,p,m,g);else if(r===st.setup){const y=e.data.setupPose;let w=y.color;o.set(w.r+(f-w.r)*n,w.g+(p-w.g)*n,w.b+(m-w.b)*n,w.a+(g-w.a)*n),w=y.darkColor,l=w.r+(l-w.r)*n,c=w.g+(c-w.g)*n,u=w.b+(u-w.b)*n}else o.add((f-o.r)*n,(p-o.g)*n,(m-o.b)*n,(g-o.a)*n),l=h.r+(l-h.r)*n,c=h.g+(c-h.g)*n,u=h.b+(u-h.b)*n;h.r=l<0?0:l>1?1:l,h.g=c<0?0:c>1?1:c,h.b=u<0?0:u>1?1:u}}class Jw extends Ru{constructor(e,t,i){super(e,t,i,`${vt.rgb}|${i}`,`${vt.rgb2}|${i}`)}getFrameEntries(){return 7}setFrame(e,t,i,n,r,a,o,h){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]=a,this.frames[e+5]=o,this.frames[e+6]=h}apply1(e,t,i,n,r,a){const o=t.color,h=t.darkColor;let l=0,c=0,u=0,d=0,f=0,p=0;const m=this.frames;if(i1?1:l,o.g=c<0?0:c>1?1:c,o.b=u<0?0:u>1?1:u,h.r=d<0?0:d>1?1:d,h.g=f<0?0:f>1?1:f,h.b=p<0?0:p>1?1:p}}class bl extends si{constructor(t,i){super(t,`${vt.attachment}|${i}`);x(this,"slotIndex",0);x(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,a,o,h,l,c){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=c?u.appliedPose:u.pose;l||nt){const l=this.frames[i];return n[r+1]*(t-l)/(n[r]-l)}const a=r+18;for(r+=2;r=t){const l=n[r-2],c=n[r-1];return c+(t-l)/(n[r]-l)*(n[r+1]-c)}const o=n[a-2],h=n[a-1];return h+(1-h)*(t-o)/(this.frames[i+this.getFrameEntries()]-o)}apply(t,i,n,r,a,o,h,l,c){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,c))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 b=si.search(f,n);g=this.getCurvePercent(n,b),p=this.vertices[b],m=this.vertices[b+1]}const v=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],c,p,m,g,v,a,o,h);for(const b of d)this.applyToSlot(u[b],c,p,m,g,v,a,o,h)}applyBeforeFirst(t,i,n,r){if(!t.bone.active)return;const a=i?t.appliedPose:t.pose;if(a.attachment==null||a.attachment.timelineAttachment!==this.attachment)return;const o=a.deform;switch(o.length===0&&(r=st.setup),r){case st.setup:o.length=0;break;case st.first:{if(n===1){o.length=0;return}const h=this.vertices[0].length;o.length=h;const l=o,c=a.attachment;if(c.bones===null){const u=c.vertices;for(let d=0;d>4,c=h.attachment.sequence.regions.length;const u=Dw[a&15];if(u!==Gi.hold)switch(l+=(n-r)/o+1e-5|0,u){case Gi.once:l=Math.min(c-1,l);break;case Gi.loop:l%=c;break;case Gi.pingpong:{const d=(c<<1)-2;l=d===0?0:l%d,l>=c&&(l=d-l);break}case Gi.onceReverse:l=Math.max(c-1-l,0);break;case Gi.loopReverse:l=c-1-l%c;break;case Gi.pingpongReverse:{const d=(c<<1)-2;l=d===0?0:(l+c-1)%d,l>=c&&(l=d-l)}}h.sequenceIndex=l}};x(Cs,"ENTRIES",3),x(Cs,"MODE",1),x(Cs,"DELAY",2);let Hh=Cs;const Kh=class Kh extends si{constructor(t){super(t,...Kh.propertyIds);x(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,a,o,h,l,c){if(!r)return;const u=this.frames,d=this.frames.length;if(i>n)this.apply(null,i,Number.MAX_VALUE,r,0,o,!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])}};x(Kh,"propertyIds",[`${vt.event}`]);let Xl=Kh;const uo=class uo extends si{constructor(t){super(t,...uo.propertyIds);x(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,a,o,h,l,c){const u=c?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(l||n>2];switch(b){case 0:{const w=f[v];p=f[v+1],m=f[v+2],g=f[v+3];const A=(n-w)/(f[v+4]-w);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,b-2),m=this.getBezierValue(n,v,2,b+18-2),g=this.getBezierValue(n,v,3,b+36-2)}const y=o===st.setup?u.data.setupPose:d;h?(d.mixRotate=y.mixRotate+p*a,d.mixX=y.mixX+m*a,d.mixY=y.mixY+g*a):(d.mixRotate=y.mixRotate+(p-y.mixRotate)*a,d.mixX=y.mixX+(m-y.mixX)*a,d.mixY=y.mixY+(g-y.mixY)*a)}}class zr extends Jl{constructor(e,t,i,n){super(e,t,i,n)}apply(e,t,i,n,r,a,o,h,l){if(o&&!this.additive&&(o=!1),this.constraintIndex===-1){const c=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,a,o,this.get(f),this.get(d.data.setupPose),c))}}else{const c=e.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;this.set(u,this.getAbsoluteValue(i,r,a,o,this.get(u),this.get(c.data.setupPose)))}}}}class rS extends zr{constructor(e,t,i){super(e,t,i,vt.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class aS extends zr{constructor(e,t,i){super(e,t,i,vt.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class oS extends zr{constructor(e,t,i){super(e,t,i,vt.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class lS extends zr{constructor(e,t,i){super(e,t,i,vt.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class cS extends zr{constructor(e,t,i){super(e,t,i,vt.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class hS extends zr{constructor(e,t,i){super(e,t,i,vt.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class uS extends zr{constructor(e,t,i){super(e,t,i,vt.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const Zh=class Zh extends si{constructor(t,i){super(t,...Zh.propertyIds);x(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,a,o,h,l,c){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,[],a,o,!1,!1,!1),i=-1;else if(i>=d[d.length-1])return;if(!(n=d[si.search(d,i)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};x(Zh,"propertyIds",[vt.physicsConstraintReset.toString()]);let jh=Zh;class dS extends Jl{constructor(e,t,i){super(e,t,i,vt.sliderTime)}apply(e,t,i,n,r,a,o,h,l){const c=e.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.time=this.getAbsoluteValue(i,r,a,o,u.time,c.data.setupPose.time)}}}class fS extends Jl{constructor(e,t,i){super(e,t,i,vt.sliderMix),this.additive=!0}apply(e,t,i,n,r,a,o,h,l){const c=e.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.mix=this.getAbsoluteValue(i,r,a,o,u.mix,c.data.setupPose.mix)}}}const _l=class _l{constructor(e){x(this,"data");x(this,"tracks",[]);x(this,"timeScale",1);x(this,"unkeyedState",0);x(this,"events",[]);x(this,"listeners",[]);x(this,"queue",new aO(this));x(this,"propertyIds",new Map);x(this,"animationsChanged",!1);x(this,"trackEntryPool",new J3(()=>new rO));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=a,r.delay>0)continue;a=-r.delay,r.delay=0}let o=r.next;if(o){const h=r.trackLast-o.delay;if(h>=0){for(o.delay=0,o.trackTime+=r.timeScale===0?0:(h/r.timeScale+e)*o.timeScale,r.trackTime+=a,this.setTrack(i,o,!0);o.mixingFrom;)o.mixTime+=e,o=o.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 h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=a}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 o=0,h=i.length;o0)continue;n=!0;let c=l.alpha;l.mixingFrom?c*=this.applyMixingFrom(l,e):l.trackTime>=l.trackEnd&&!l.next&&(c=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(o===0&&c===1)for(let v=0;v=l.alphaAttachmentThreshold,y=l.additive,w=y||l.shortestRotation,A=!w&&l.timelinesRotation.length!==g<<1;A&&(l.timelinesRotation.length=g<<1);for(let T=0;T0?h/o:a,c=i.animation.timelines,u=c.length,d=i.timelineMode,f=i.timelineHoldMix,p=r=i.alphaAttachmentThreshold);else{const O=!m||!(P instanceof Vr)||I===st.current;P.apply(t,w,T,M,k,I,g,O,!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 a=t.slots[e.slotIndex];if(!a.bone.active||!r&&a.attachmentState===this.unkeyedState+fy)return;let o=i=0,A=v>=0;Math.abs(b)<=90&&Ve.signum(b)!==Ve.signum(g)&&(Math.abs(v-y)>180?(m+=360*Ve.signum(v),A=w):y!==0?m-=360*Ve.signum(v):A=w),A!==w&&(m+=360*Ve.signum(v)),a[o]=m}a[o+1]=g,c.rotation=f+m*n}queueEvents(e,t){const i=e.animationStart,n=e.animationEnd,r=n-i,a=e.reverse;let o=e.trackLast%r;a&&(o=r-o);const h=this.events;let l=0,c=h.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,a=n-i,o=e.animation.timelines;for(let h=0,l=e.animation.timelines.length;h=a){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=a);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 a=this.trackEntry(e,t,i,r);return this.setTrack(e,a,n),this.queue.drain(),a}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 a=this.trackEntry(e,t,i,r);return r?(r.next=a,a.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-a.mixDuration,0))):(this.setTrack(e,a,!0),this.queue.drain(),n<0&&(n=0)),a.delay=n,a}setEmptyAnimation(e,t=0){const i=this.setAnimation(e,_l.emptyAnimation,!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){const n=this.addAnimation(e,_l.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&&(a[d]=v);break}}h&&(g=g&~Nc|r[d]&Nc),r[d]=g}}from(e,t,i){const n=this.propertyIds;let r=oO;for(let a=0,o=i.length;a= 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()}};x(_l,"emptyAnimation",new Op("",[],0));let ly=_l;class rO{constructor(){x(this,"animation",null);x(this,"previous",null);x(this,"next",null);x(this,"mixingFrom",null);x(this,"mixingTo",null);x(this,"listener",null);x(this,"trackIndex",0);x(this,"loop",!1);x(this,"additive",!1);x(this,"reverse",!1);x(this,"shortestRotation",!1);x(this,"keepHold",!1);x(this,"eventThreshold",0);x(this,"mixAttachmentThreshold",0);x(this,"alphaAttachmentThreshold",0);x(this,"mixDrawOrderThreshold",0);x(this,"animationStart",0);x(this,"animationEnd",0);x(this,"animationLast",0);x(this,"nextAnimationLast",0);x(this,"delay",0);x(this,"trackTime",0);x(this,"trackLast",0);x(this,"nextTrackLast",0);x(this,"trackEnd",0);x(this,"timeScale",0);x(this,"alpha",0);x(this,"mixTime",0);x(this,"mixDuration",0);x(this,"totalAlpha",0);x(this,"mixInterpolation",To.linear);x(this,"timelineMode",[]);x(this,"timelineHoldMix",[]);x(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===To.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=To.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 aO{constructor(e){x(this,"objects",[]);x(this,"drainDisabled",!1);x(this,"animState");this.animState=e}start(e){this.objects.push(fs.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(fs.interrupt),this.objects.push(e)}end(e){this.objects.push(fs.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(fs.dispose),this.objects.push(e)}complete(e){this.objects.push(fs.complete),this.objects.push(e)}event(e,t){this.objects.push(fs.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,i,n,r,a;if(!this.drainDisabled){this.drainDisabled=!0;for(let o=0;o= 0.");if(!i)throw new Error("name cannot be null.");this.index=t,this.parent=n}copy(t){const i=new ku(this.index,this.name,t);return i.length=this.length,i.setupPose.set(this.setupPose),i}}var mi;(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"})(mi||(mi={}));class Pm{constructor(){x(this,"bone");x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"scaleX",0);x(this,"scaleY",0);x(this,"shearX",0);x(this,"shearY",0);x(this,"inherit",mi.Normal);x(this,"a",0);x(this,"b",0);x(this,"c",0);x(this,"d",0);x(this,"worldY",0);x(this,"worldX",0);x(this,"world",0);x(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,a=this.shearY;if(!this.bone.parent){const d=e.scaleX,f=e.scaleY,p=(t+r)*Ve.degRad,m=(t+90+a)*Ve.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 o=this.bone.parent.appliedPose;let h=o.a,l=o.b,c=o.c,u=o.d;switch(this.worldX=h*this.x+l*this.y+o.worldX,this.worldY=c*this.x+u*this.y+o.worldY,this.inherit){case mi.Normal:{const d=(t+r)*Ve.degRad,f=(t+90+a)*Ve.degRad,p=Math.cos(d)*i,m=Math.cos(f)*n,g=Math.sin(d)*i,v=Math.sin(f)*n;this.a=h*p+l*g,this.b=h*m+l*v,this.c=c*p+u*g,this.d=c*m+u*v;return}case mi.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,p=(t+r)*Ve.degRad,m=(t+90+a)*Ve.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 mi.NoRotationOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f;h*=p,c*=m;let g=h*h+c*c,v=0;g>Ve.epsilon2?(g=Math.abs(h*u*m-l*p*c)/g,l=c*g,u=h*g,v=t-Ve.atan2Deg(c,h)):(h=0,c=0,v=t-90+Ve.atan2Deg(u,l));const b=(v+r)*Ve.degRad,y=(v+a+90)*Ve.degRad,w=Math.cos(b)*i,A=Math.cos(y)*n,T=Math.sin(b)*i,M=Math.sin(y)*n;this.a=(h*w-l*T)*d,this.b=(h*A-l*M)*d,this.c=(c*w+u*T)*f,this.d=(c*A+u*M)*f;break}case mi.NoScale:case mi.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f,g=t*Ve.degRad,v=Math.cos(g),b=Math.sin(g);let y=(h*v+l*b)*p,w=(c*v+u*b)*m;const A=1/Math.sqrt(y*y+w*w);y*=A,w*=A;let T=-w,M=y;this.inherit===mi.NoScale&&h*u-l*c<0!=(d<0!=f<0)&&(T=-T,M=-M);const R=r*Ve.degRad,P=(90+a)*Ve.degRad,F=Math.cos(R)*i,I=Math.cos(P)*n,k=Math.sin(R)*i,O=Math.sin(P)*n;this.a=(y*F+T*k)*d,this.b=(y*I+T*O)*d,this.c=(w*F+M*k)*f,this.d=(w*I+M*O)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,i=e.scaleY;if(!this.bone.parent){const v=1/t,b=1/i;this.x=(this.worldX-e.x)*v,this.y=(this.worldY-e.y)*b,this.set5(this.a*v,this.b*v,this.c*b,this.d*b,0);return}const n=this.bone.parent.appliedPose;let r=n.a,a=n.b,o=n.c,h=n.d;const l=r*h-a*o,c=1/(r*h-a*o),u=h*c,d=a*c,f=o*c,p=r*c,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 mi.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 mi.OnlyTranslation:{const v=1/t,b=1/i;this.set5(this.a*v,this.b*v,this.c*b,this.d*b,0);break}case mi.NoRotationOrReflection:{const v=1/t,b=1/i;r*=v,o*=b;const y=this.a*v,w=this.b*v,A=this.c*b,T=this.d*b,M=1/(r*r+o*o),R=1/Math.abs(l*v*b);this.set5((r*y+o*A)*M,(r*w+o*T)*M,(r*A-o*y)*R,(r*T-o*w)*R,Ve.atan2Deg(o,r));break}case mi.NoScale:case mi.NoScaleOrReflection:{const v=1/t,b=1/i,y=this.a*v,w=this.b*v,A=this.c*b,T=this.d*b;let M=h*this.a-a*this.c,R=r*this.c-o*this.a;l<0&&(M=-M,R=-R);let P=Ve.atan2Deg(R,M);this.rotation=P,P*=Ve.degRad;const F=Math.cos(P),I=Math.sin(P);let k=(r*F+a*I)*v,O=(o*F+h*I)*b;const L=1/Math.sqrt(k*k+O*O);k*=L,O*=L;const U=this.inherit===mi.NoScale&&l<0!=(t<0!=i<0)?-1:1;this.set4(k*y+O*A,k*w+O*T,(k*A-O*y)*U,(k*T-O*w)*U)}}}set4(e,t,i,n){const r=e*e+i*i,a=t*t+n*n;r>Ve.epsilon2?(this.shearX=Ve.atan2Deg(i,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(a),a>Ve.epsilon2?(this.shearY=Ve.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 a=e*e+i*i,o=t*t+n*n;if(a>Ve.epsilon2){const h=Ve.atan2Deg(i,e);this.rotation=h+r,this.scaleX=Math.sqrt(a),this.scaleY=Math.sqrt(o),o>Ve.epsilon2?(this.shearY=Ve.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90-h):this.shearY-=90+h,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(o),this.shearY=0,this.rotation=o>Ve.epsilon2?Ve.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,a,o,h,l,c,u){typeof n=="number"?Cr.apply1(t,i,n,r,a,o,h,l):Cr.apply2(t,i,n,r,a,o,h,l,c,u)}static apply1(t,i,n,r,a,o,h,l){i.modifyLocal(t);const c=i.bone.parent.appliedPose;let u=c.a,d=c.b,f=c.c,p=c.d,m=-i.shearX-i.rotation,g=0,v=0;switch(i.inherit){case mi.OnlyTranslation:g=(n-i.worldX)*Ve.signum(t.scaleX),v=(r-i.worldY)*Ve.signum(t.scaleY);break;case mi.NoRotationOrReflection:{const b=Math.abs(u*p-d*f)/Math.max(Ve.epsilon,u*u+f*f),y=u/t.scaleX,w=f/t.scaleY;d=-w*b*t.scaleX,p=y*b*t.scaleY,m+=Ve.atan2Deg(w,y)}default:{const b=n-c.worldX,y=r-c.worldY,w=u*p-d*f;Math.abs(w)<=Ve.epsilon?(g=0,v=0):(g=(b*p-y*d)/w-i.x,v=(y*u-b*f)/w-i.y)}}if(m+=Ve.atan2Deg(v,g),i.scaleX<0&&(m+=180),m>180?m-=360:m<=-180&&(m+=360),i.rotation+=m*l,a||o){switch(i.inherit){case mi.NoScale:case mi.NoScaleOrReflection:g=n-i.worldX,v=r-i.worldY}const b=i.bone.data.length*i.scaleX;if(b>Ve.epsilon){const y=g*g+v*v;if(a&&yb*b){const w=(Math.sqrt(y)/b-1)*l+1;switch(i.scaleX*=w,h){case as.Uniform:i.scaleY*=w;break;case as.Volume:i.scaleY/=w<.7?.25+.642857*w:w}}}}}static apply2(t,i,n,r,a,o,h,l,c,u){if(i.inherit!==mi.Normal||n.inherit!==mi.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,b=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,b=180):b=0;let w=0,A=0,T=i.a,M=i.b,R=i.c,P=i.d;const F=Math.abs(p-m)<=Ve.epsilon;!F||h?(n.y=0,w=T*n.x+i.worldX,A=R*n.x+i.worldY):(w=T*n.x+M*n.y+i.worldX,A=R*n.x+P*n.y+i.worldY);const I=i.bone.parent.appliedPose;T=I.a,M=I.b,R=I.c,P=I.d;let k=T*P-M*R,O=w-I.worldX,L=A-I.worldY;k=Math.abs(k)<=Ve.epsilon?0:1/k;const U=(O*P-L*M)*k-d,B=(L*T-O*R)*k-f;let D=Math.sqrt(U*U+B*B),_=n.bone.data.length*g,X,N;if(D0){let me=Math.min(1,de/(c*2))-1;me=(de-c*(1-me*me))/Q,V-=me*V,G-=me*G,j=V*V+G*G}}e:if(F){_*=p;let Q=(j-D*D-_*_)/(2*D*_);if(Q<-1)Q=-1,N=Math.PI*o;else if(Q>1){if(Q=1,N=0,h)switch(T=(Math.sqrt(j)/(D+_)-1)*u+1,i.scaleX*=T,l){case as.Uniform:i.scaleY*=T;break;case as.Volume:i.scaleY/=T<.7?.25+.642857*T:T}}else N=Math.acos(Q)*o;T=D+_*Q,M=_*Math.sin(N),X=Math.atan2(G*T-V*M,V*T+G*M)}else{T=p*_,M=m*_;const Q=T*T,de=M*M,me=Math.atan2(G,V);R=de*D*D+Q*j-Q*de;const we=-2*de*D,Re=de-Q;if(P=we*we-4*Re*R,P>=0){let ve=Math.sqrt(P);we<0&&(ve=-ve),ve=-(we+ve)*.5;let re=ve/Re,ye=R/ve;const he=Math.abs(re)=0){L=Math.sqrt(re)*o,X=me-Math.atan2(L,he),N=Math.atan2(L/m,(he-D)/p);break e}}let ge=Ve.PI,Ae=D-T,H=Ae*Ae,K=0,q=0,z=D+T,ee=z*z,le=0;R=-T*D/(Q-de),R>=-1&&R<=1&&(R=Math.acos(R),O=T*Math.cos(R)+D,L=M*Math.sin(R),P=O*O+L*L,Pee&&(q=R,ee=P,z=O,le=L)),j<=(H+ee)*.5?(X=me-Math.atan2(K*o,Ae),N=ge*o):(X=me-Math.atan2(le*o,z),N=q*o)}const ne=Math.atan2(n.y,n.x)*y;X=(X-ne)*Ve.radDeg+v-i.rotation,X>180?X-=360:X<=-180&&(X+=360),i.rotation+=X*u,N=((N+ne)*Ve.radDeg-n.shearX)*y+b-n.rotation,N>180?N-=360:N<=-180&&(N+=360),n.rotation+=N*u}}class Qc extends ec{constructor(t){super(t,new km);x(this,"bones",[]);x(this,"_target",null);x(this,"_scaleYMode",as.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 Cr(this,t)}}class Fm{constructor(){x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(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 eh extends ec{constructor(t){super(t,new Fm);x(this,"bones",[]);x(this,"_slot",null);x(this,"positionMode",On.Fixed);x(this,"spacingMode",Fi.Fixed);x(this,"rotateMode",Pa.Chain);x(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 Om(this,t)}}var On;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(On||(On={}));var Fi;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(Fi||(Fi={}));var Pa;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(Pa||(Pa={}));const Hs=class Hs extends Ql{constructor(t,i){super(t,new Fm,new Fm);x(this,"data");x(this,"bones");x(this,"slot");x(this,"spaces",[]);x(this,"positions",[]);x(this,"world",[]);x(this,"curves",[]);x(this,"lengths",[]);x(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 Hs(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.slot.appliedPose.attachment;if(!(n instanceof Vl))return;const r=this.appliedPose,a=r.mixRotate,o=r.mixX,h=r.mixY;if(a===0&&o===0&&h===0)return;const l=this.data,c=l.rotateMode===Pa.Tangent,u=l.rotateMode===Pa.ChainScale,d=this.bones,f=d.length,p=c?f:f+1,m=lt.setArraySize(this.spaces,p),g=u?this.lengths=lt.setArraySize(this.lengths,f):[],v=r.spacing;switch(l.spacingMode){case Fi.Percent:if(u)for(let M=0,R=p-1;M0){M=p/M*v;for(let R=1;R0?Ve.degRad:-Ve.degRad}for(let M=0,R=3;M0){let L=P.a,U=P.b,B=P.c,D=P.d,_=0,X=0,N=0;if(c?_=b[R-1]:m[M+1]===0?_=b[R+2]:_=Math.atan2(O,k),_-=Math.atan2(B,L),T){X=Math.cos(_),N=Math.sin(_);const V=P.bone.data.length;y+=(V*(X*L-N*B)-k)*a,w+=(V*(N*L+X*B)-O)*a}else _+=A;_>Ve.PI?_-=Ve.PI2:_<-Ve.PI&&(_+=Ve.PI2),_*=a,X=Math.cos(_),N=Math.sin(_),P.a=X*L-N*B,P.b=X*U-N*D,P.c=N*L+X*B,P.d=N*U+X*D}}}computeWorldPositions(t,i,n,r){const a=this.slot;let o=this.appliedPose.position,h=this.spaces,l=lt.setArraySize(this.positions,n*3+2),c=this.world;const u=i.closed;let d=i.worldVerticesLength,f=d/6,p=Hs.NONE;if(!i.constantSpeed){const N=i.lengths;f-=u?1:2;const V=N[f];this.data.positionMode===On.Percent&&(o*=V);let G;switch(this.data.spacingMode){case Fi.Percent:G=V;break;case Fi.Proportional:G=V/n;break;default:G=1}c=lt.setArraySize(this.world,8);for(let j=0,ne=0,Q=0;jV){p!==Hs.AFTER&&(p=Hs.AFTER,i.computeWorldVertices(t,a,d-6,4,c,0,2)),this.addAfterPosition(me-V,c,0,l,ne);continue}for(;;Q++){const we=N[Q];if(!(me>we)){if(Q===0)me/=we;else{const Re=N[Q-1];me=(me-Re)/(we-Re)}break}}Q!==p&&(p=Q,u&&Q===f?(i.computeWorldVertices(t,a,d-4,4,c,0,2),i.computeWorldVertices(t,a,0,4,c,4,2)):i.computeWorldVertices(t,a,Q*6+2,8,c,0,2)),this.addCurvePosition(me,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],l,ne,r||j>0&&de===0)}return l}u?(d+=2,c=lt.setArraySize(this.world,d),i.computeWorldVertices(t,a,2,d-4,c,0,2),i.computeWorldVertices(t,a,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(f--,d-=4,c=lt.setArraySize(this.world,d),i.computeWorldVertices(t,a,2,d,c,0,2));const m=lt.setArraySize(this.curves,f);let g=0,v=c[0],b=c[1],y=0,w=0,A=0,T=0,M=0,R=0,P=0,F=0,I=0,k=0,O=0,L=0,U=0,B=0;for(let N=0,V=2;Ng){this.addAfterPosition(Q-g,c,d-4,l,V);continue}for(;;G++){const de=m[G];if(!(Q>de)){if(G===0)Q/=de;else{const me=m[G-1];Q=(Q-me)/(de-me)}break}}if(G!==p){p=G;let de=G*6;for(v=c[de],b=c[de+1],y=c[de+2],w=c[de+3],A=c[de+4],T=c[de+5],M=c[de+6],R=c[de+7],P=(v-y*2+A)*.03,F=(b-w*2+T)*.03,I=((y-A)*3-v+M)*.006,k=((w-T)*3-b+R)*.006,O=P*2+I,L=F*2+k,U=(y-v)*.3+P+I*.16666667,B=(w-b)*.3+F+k*.16666667,X=Math.sqrt(U*U+B*B),_[0]=X,de=1;de<8;de++)U+=O,B+=L,O+=I,L+=k,X+=Math.sqrt(U*U+B*B),_[de]=X;U+=O,B+=L,X+=Math.sqrt(U*U+B*B),_[8]=X,U+=O+I,B+=L+k,X+=Math.sqrt(U*U+B*B),_[9]=X,j=0}for(Q*=X;;j++){const de=_[j];if(!(Q>de)){if(j===0)Q/=de;else{const me=_[j-1];Q=j+(Q-me)/(de-me)}break}}this.addCurvePosition(Q*.1,v,b,y,w,A,T,M,R,l,V,r||N>0&&ne===0)}return l}addBeforePosition(t,i,n,r,a){const o=i[n],h=i[n+1],l=i[n+2]-o,c=i[n+3]-h,u=Math.atan2(c,l);r[a]=o+t*Math.cos(u),r[a+1]=h+t*Math.sin(u),r[a+2]=u}addAfterPosition(t,i,n,r,a){const o=i[n+2],h=i[n+3],l=o-i[n],c=h-i[n+1],u=Math.atan2(c,l);r[a]=o+t*Math.cos(u),r[a+1]=h+t*Math.sin(u),r[a+2]=u}addCurvePosition(t,i,n,r,a,o,h,l,c,u,d,f){if(t===0||Number.isNaN(t)){u[d]=i,u[d+1]=n,u[d+2]=Math.atan2(a-n,r-i);return}const p=t*t,m=p*t,g=1-t,v=g*g,b=v*g,y=g*t,w=y*3,A=g*w,T=w*t,M=i*b+r*A+o*T+l*m,R=n*b+a*A+h*T+c*m;u[d]=M,u[d+1]=R,f&&(t<.001?u[d+2]=Math.atan2(a-n,r-i):u[d+2]=Math.atan2(R-(n*v+a*y*2+h*p),M-(i*v+r*y*2+o*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,a=this.bones.length;for(let o=0;o0,o=this.data.y>0,h=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,c=this.bone;let u=c.bone.data.length,d=this.data.step,f=0;if(i!==va.none){switch(c.modifyWorld(t),i){case va.reset:this.reset(t);case va.update:{const p=Math.max(t.time-this.lastTime,0),m=this.remaining;this.remaining+=p,this.lastTime=t.time;const g=c.worldX,v=c.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=v;else{let b=this.remaining,y=n.inertia,w=t.data.referenceScale,A=-1,T=0,M=0,R=this.data.limit*p,P=R*Math.abs(t.scaleY);if(R*=Math.abs(t.scaleX),a||o){if(a){const F=(this.ux-g)*y;this.xOffset+=F>R?R:F<-R?-R:F,this.ux=g}if(o){const F=(this.uy-v)*y;this.yOffset+=F>P?P:F<-P?-P:F,this.uy=v}if(b>=d){const F=this.xOffset,I=this.yOffset;A=n.damping**(60*d),T=d*n.massInverse,M=n.strength;const k=w*n.wind,O=w*n.gravity,L=(k*t.windX+O*t.gravityX)*t.scaleX,U=(k*t.windY+O*t.gravityY)*t.scaleY;do a&&(this.xVelocity+=(L-this.xOffset*M)*T,this.xOffset+=this.xVelocity*d,this.xVelocity*=A),o&&(this.yVelocity-=(U+this.yOffset*M)*T,this.yOffset+=this.yVelocity*d,this.yVelocity*=A),b-=d;while(b>=d);this.xLag=this.xOffset-F,this.yLag=this.yOffset-I}f=Math.max(0,1-b/d),a&&(c.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),o&&(c.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(h||l){let F=Math.atan2(c.c,c.a),I=0,k=0,O=0,L=this.cx-c.worldX,U=this.cy-c.worldY;if(L>R?L=R:L<-R&&(L=-R),U>P?U=P:U<-P&&(U=-P),b=this.remaining,h){O=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-m/d);let B=Math.atan2(U+this.ty,L+this.tx)-F-(this.rotateOffset-f)*O;this.rotateOffset+=(B-Math.ceil(B*Ve.invPI2-.5)*Ve.PI2)*y,B=(this.rotateOffset-f)*O+F,I=Math.cos(B),k=Math.sin(B),l&&(B=u*c.getWorldScaleX(),B>0&&(this.scaleOffset+=(L*I+U*k)*y/B))}else{I=Math.cos(F),k=Math.sin(F);const B=u*c.getWorldScaleX()-this.scaleLag*Math.max(0,1-m/d);B>0&&(this.scaleOffset+=(L*I+U*k)*y/B)}if(b>=d){A===-1&&(A=n.damping**(60*d),T=d*n.massInverse,M=n.strength);const B=n.wind*t.windX+n.gravity*t.gravityX,D=(n.wind*t.windY+n.gravity*t.gravityY)*Dm.yDir,_=this.rotateOffset,X=this.scaleOffset,N=u/w;for(;;)if(b-=d,l&&(this.scaleVelocity+=(B*I-D*k-this.scaleOffset*M)*T,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=A),h){if(this.rotateVelocity-=((B*k+D*I)*N+this.rotateOffset*M)*T,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=A,b0){let b=0;this.data.rotate>0&&(b=p*this.data.rotate,m=Math.sin(b),g=Math.cos(b),v=c.b,c.b=g*v-m*c.d,c.d=m*v+g*c.d),b+=p*this.data.shearX,m=Math.sin(b),g=Math.cos(b),v=c.a,c.a=g*v-m*c.c,c.c=m*v+g*c.c}else p*=this.data.rotate,m=Math.sin(p),g=Math.cos(p),v=c.a,c.a=g*v-m*c.c,c.c=m*v+g*c.c,v=c.b,c.b=g*v-m*c.d,c.d=m*v+g*c.d}if(l){let p=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(c.a*=p,c.c*=p,this.data.scaleYMode){case as.Uniform:c.b*=p,c.d*=p;break;case as.Volume:p=Math.abs(p),p=p>=.7?1/p:4-3.67347*p,c.b*=p,c.d*=p}}i!==va.pose&&(this.tx=u*c.a,this.ty=u*c.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 th extends ec{constructor(t){super(t,new Bm);x(this,"_bone",null);x(this,"x",0);x(this,"y",0);x(this,"rotate",0);x(this,"scaleX",0);x(this,"shearX",0);x(this,"limit",0);x(this,"step",0);x(this,"inertiaGlobal",!1);x(this,"strengthGlobal",!1);x(this,"dampingGlobal",!1);x(this,"massGlobal",!1);x(this,"windGlobal",!1);x(this,"gravityGlobal",!1);x(this,"mixGlobal",!1);x(this,"_scaleYMode",as.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 Fu(this,t)}}typeof Math.fround>"u"&&(Math.fround=(s=>e=>(s[0]=e,s[0]))(new Float32Array(1)));class Nm{constructor(){x(this,"time",0);x(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const Ml=class Ml extends Ql{constructor(t,i){super(t,new Nm,new Nm);x(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 Ml(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,a=r.animation,o=this.bone;if(o!==null){if(!o.active)return;r.local&&o.appliedPose.validateLocalTransform(t),n.time=r.offset+(r.property.value(t,o.appliedPose,r.local,Ml.offsets)-r.property.offset)*r.scale,r.loop?n.time=a.duration+n.time%a.duration:n.time=Math.max(0,n.time)}const h=t.bones,l=a.bones;for(let c=0,u=a.bones.length;c=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 Wh;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(Wh||(Wh={}));class Vm{constructor(){x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(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 Vp extends Ql{constructor(t,i){super(t,new Vm,new Vm);x(this,"bones");x(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 Vp(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,a=r.localSource,o=r.localTarget,h=r.additive,l=r.clamp,c=r.offsets,u=this.source.appliedPose;a&&u.validateLocalTransform(t);const d=r.properties,f=r.properties.length,p=this.bones;for(let m=0,g=this.bones.length;m0?n[$t.ROTATION]:-n[$t.ROTATION]);return o<0&&(o+=360),o}}class xS extends Uo{mix(e){return e.mixRotate}apply(e,t,i,n,r,a){if(r)i.rotation+=(a?n:n-i.rotation)*t.mixRotate;else{const o=e.scaleX,h=e.scaleY,l=1/o,c=1/h,u=i.a*l,d=i.b*l,f=i.c*c,p=i.d*c;n*=Ve.degRad,a||(n-=Math.atan2(f,u)),n>Ve.PI?n-=Ve.PI2:n<-Ve.PI&&(n+=Ve.PI2),n*=t.mixRotate;const m=Math.cos(n),g=Math.sin(n);i.a=(m*u-g*f)*o,i.b=(m*d-g*p)*o,i.c=(g*u+m*f)*h,i.d=(g*d+m*p)*h}}}class $m extends No{value(e,t,i,n){return i?t.x+n[$t.X]:(n[$t.X]*t.a+n[$t.Y]*t.b+t.worldX)/e.scaleX}}class bS extends Uo{mix(e){return e.mixX}apply(e,t,i,n,r,a){r?i.x+=(a?n:n-i.x)*t.mixX:(a||(n-=i.worldX/e.scaleX),i.worldX+=n*t.mixX*e.scaleX)}}class Gm extends No{value(e,t,i,n){return i?t.y+n[$t.Y]:(n[$t.X]*t.c+n[$t.Y]*t.d+t.worldY)/e.scaleY}}class wS extends Uo{mix(e){return e.mixY}apply(e,t,i,n,r,a){r?i.y+=(a?n:n-i.y)*t.mixY:(a||(n-=i.worldY/e.scaleY),i.worldY+=n*t.mixY*e.scaleY)}}class Hm extends No{value(e,t,i,n){if(i)return t.scaleX+n[$t.SCALEX];const r=t.a/e.scaleX,a=t.c/e.scaleY;return Math.sqrt(r*r+a*a)+n[$t.SCALEX]}}class SS extends Uo{mix(e){return e.mixScaleX}apply(e,t,i,n,r,a){if(r)a?i.scaleX*=1+(n-1)*t.mixScaleX:i.scaleX!==0&&(i.scaleX+=(n-i.scaleX)*t.mixScaleX);else if(a){const o=1+(n-1)*t.mixScaleX;i.a*=o,i.c*=o}else{let o=i.a/e.scaleX,h=i.c/e.scaleY,l=Math.sqrt(o*o+h*h);l!==0&&(l=1+(n-l)*t.mixScaleX/l,i.a*=l,i.c*=l)}}}class jm extends No{value(e,t,i,n){if(i)return t.scaleY+n[$t.SCALEY];const r=t.b/e.scaleX,a=t.d/e.scaleY;return Math.sqrt(r*r+a*a)+n[$t.SCALEY]}}class _S extends Uo{mix(e){return e.mixScaleY}apply(e,t,i,n,r,a){if(r)a?i.scaleY*=1+(n-1)*t.mixScaleY:i.scaleY!==0&&(i.scaleY+=(n-i.scaleY)*t.mixScaleY);else if(a){const o=1+(n-1)*t.mixScaleY;i.b*=o,i.d*=o}else{let o=i.b/e.scaleX,h=i.d/e.scaleY,l=Math.sqrt(o*o+h*h);l!==0&&(l=1+(n-l)*t.mixScaleY/l,i.b*=l,i.d*=l)}}}class Wm extends No{value(e,t,i,n){if(i)return t.shearY+n[$t.SHEARY];const r=1/e.scaleX,a=1/e.scaleY;return(Math.atan2(t.d*a,t.b*r)-Math.atan2(t.c*a,t.a*r))*Ve.radDeg-90+n[$t.SHEARY]}}class MS extends Uo{mix(e){return e.mixShearY}apply(e,t,i,n,r,a){if(r)a||(n-=i.shearY),i.shearY+=n*t.mixShearY;else{const o=e.scaleX,h=e.scaleY,l=i.b/o,c=i.d/h,u=Math.atan2(c,l);n=(n+90)*Ve.degRad,a?n-=Ve.PI/2:(n-=u-Math.atan2(i.c/h,i.a/o),n>Ve.PI?n-=Ve.PI2:n<-Ve.PI&&(n+=Ve.PI2)),n=u+n*t.mixShearY;const d=Math.sqrt(l*l+c*c);i.b=Math.cos(n)*d*o,i.d=Math.sin(n)*d*h}}}class P8{constructor(e){x(this,"scale",1);x(this,"attachmentLoader");x(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new vS;i.name="";const n=new cO(e),r=n.readInt32(),a=n.readInt32();i.hash=a===0&&r===0?null:a.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 o=n.readBoolean();o&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let h=0;h=n.readInt(!0);for(let p=0;p>5;for(let w=0,A;w>1&1,v.spacingMode=b>>2&3,v.rotateMode=b>>4&3,(b&128)!==0&&(v.offsetRotation=n.readFloat());const y=v.setupPose;y.position=n.readFloat(),v.positionMode===On.Fixed&&(y.position*=t),y.spacing=n.readFloat(),(v.spacingMode===Fi.Length||v.spacingMode===Fi.Fixed)&&(y.spacing*=t),y.mixRotate=n.readFloat(),y.mixX=n.readFloat(),y.mixY=n.readFloat(),c.push(v);break}case FO:{const v=new th(m);v.bone=l[n.readInt(!0)];let b=n.readByte();if(v.skinRequired=(b&1)!==0,(b&2)!==0&&(v.x=n.readFloat()),(b&4)!==0&&(v.y=n.readFloat()),(b&8)!==0&&(v.rotate=n.readFloat()),(b&16)!==0){let w=n.readFloat();w<-2?(v.scaleYMode=as.Volume,w=-2-w):w<0&&(v.scaleYMode=as.Uniform,w=-1-w),v.scaleX=w}(b&32)!==0&&(v.shearX=n.readFloat()),v.limit=((b&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=(b&128)!==0?n.readFloat():1,y.wind=n.readFloat(),y.gravity=n.readFloat(),b=n.readByte(),(b&1)!==0&&(v.inertiaGlobal=!0),(b&2)!==0&&(v.strengthGlobal=!0),(b&4)!==0&&(v.dampingGlobal=!0),(b&8)!==0&&(v.massGlobal=!0),(b&16)!==0&&(v.windGlobal=!0),(b&32)!==0&&(v.gravityGlobal=!0),(b&64)!==0&&(v.mixGlobal=!0),y.mix=(b&128)!==0?n.readFloat():1,c.push(v);break}case OO:{const v=new xa(m),b=n.readByte();if(v.skinRequired=(b&1)!==0,v.loop=(b&2)!==0,v.additive=(b&4)!==0,(b&8)!==0){const y=n.readFloat();o&&(b&64)!==0?v.max=y:v.setupPose.time=y}if((b&16)!==0&&(v.setupPose.mix=(b&32)!==0?n.readFloat():1),(b&64)!==0){v.local=(b&128)!==0,v.bone=l[n.readInt(!0)];const y=n.readFloat();let w=1;switch(n.readByte()){case 0:v.property=new Ym;break;case 1:{w=t,v.property=new $m;break}case 2:{w=t,v.property=new Gm;break}case 3:v.property=new Hm;break;case 4:v.property=new jm;break;case 5:v.property=new Wm;break;default:continue}v.property.offset=y*w,v.offset=n.readFloat(),v.scale=n.readFloat()/w}c.push(v);break}}}const d=this.readSkin(n,i,!0,o);d&&(i.defaultSkin=d,i.skins.push(d));{let p=i.skins.length;for(lt.setArraySize(i.skins,h=p+n.readInt(!0));p0){b=[];for(let M=0;M>4,e.readFloat())}r.push(F);break}}}}}const o=i.slots.length,h=e.readInt(!0);if(h>0){const f=new Vr(h);for(let p=0;p0){const f=new Xl(c);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 hO=class{constructor(e,t,i,n,r,a){x(this,"source");x(this,"skinIndex");x(this,"slotIndex");x(this,"sourceIndex");x(this,"mesh");x(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.sourceIndex=n,this.source=r,this.inheritTimelines=a}};class py{constructor(e=null,t,i=0){x(this,"bones");x(this,"vertices");x(this,"length");this.bones=e,this.vertices=t,this.length=i}}var jn;(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"})(jn||(jn={}));function Ti(s,e,t,i){t instanceof sr?uO(s,e,t,i):dO(s,e,t,i)}function uO(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i;for(let a=0,o=0,h=t.getFrameCount()-1;t.setFrame(a,n,r),a!==h;a++){const l=s.readFloat(),c=s.readFloat()*i;switch(s.readByte()){case wn:t.setStepped(a);break;case Sn:Lt(s,t,o++,a,0,n,l,r,c,i)}n=l,r=c}e.push(t)}function dO(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i,a=s.readFloat()*i;for(let o=0,h=0,l=t.getFrameCount()-1;t.setFrame(o,n,r,a),o!==l;o++){const c=s.readFloat(),u=s.readFloat()*i,d=s.readFloat()*i;switch(s.readByte()){case wn:t.setStepped(o);break;case Sn:Lt(s,t,h++,o,0,n,c,r,u,i),Lt(s,t,h++,o,1,n,c,a,d,i)}n=c,r=u,a=d}e.push(t)}function gy(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,a=0;for(let o=0;o=0;o--)i[o]===-1&&(i[o]=n[--a]);return i}function Lt(s,e,t,i,n,r,a,o,h,l){e.setBezier(t,i,n,r,o,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,a,h)}const fO=0,mO=1,pO=2,gO=3,vO=4,yO=5,xO=6,bO=7,wO=8,SO=9,_O=10,MO=0,TO=1,AO=2,EO=3,CO=4,IO=5,RO=0,PO=1,kO=2,FO=3,OO=4,BO=0,LO=1,DO=0,NO=1,UO=2,XO=0,VO=1,YO=2,$O=4,GO=5,HO=6,jO=7,WO=8,zO=0,qO=1,wn=1,Sn=2;class KO{constructor(e){x(this,"attachmentLoader");x(this,"scale",1);x(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new vS,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=se(r,"referenceScale",100)*t,i.fps=r.fps,i.imagesPath=r.images??null,i.audioPath=r.audio??null),n.bones)for(let a=0;a0&&l.properties.push(T)}l.offsets[$t.ROTATION]=se(a,"rotation",0),l.offsets[$t.X]=se(a,"x",0)*t,l.offsets[$t.Y]=se(a,"y",0)*t,l.offsets[$t.SCALEX]=se(a,"scaleX",0),l.offsets[$t.SCALEY]=se(a,"scaleY",0),l.offsets[$t.SHEARY]=se(a,"shearY",0);const y=l.setupPose;d&&(y.mixRotate=se(a,"mixRotate",1)),f&&(y.mixX=se(a,"mixX",1)),p&&(y.mixY=se(a,"mixY",y.mixX)),m&&(y.mixScaleX=se(a,"mixScaleX",1)),g&&(y.mixScaleY=se(a,"mixScaleY",y.mixScaleX)),v&&(y.mixShearY=se(a,"mixShearY",1)),i.constraints.push(l);break}case"path":{const l=new eh(o);l.skinRequired=h;for(let f=0;f0){const d=i.findConstraint(l,th);if(!d)throw new Error(`Physics constraint not found: ${l}`);u=i.constraints.indexOf(d)}for(const d in c){const f=c[d];let p=f[0];if(!p)continue;const m=f.length;let g,v=0;if(d==="reset"){const b=new jh(m,u);for(let y=0;p!=null;p=f[y+1],y++)b.setFrame(y,se(p,"time",0));r.push(b);continue}switch(d){case"inertia":g=new rS(m,m,u);break;case"strength":g=new aS(m,m,u);break;case"damping":g=new oS(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}vs(r,f,g,v,1)}}if(e.slider)for(const l in e.slider){const c=e.slider[l],u=i.findConstraint(l,xa);if(!u)throw new Error(`Slider not found: ${l}`);const d=i.constraints.indexOf(u);for(const f in c){const p=c[f];if(!p[0])continue;const g=p.length;switch(f){case"time":vs(r,p,new dS(g,g,d),1,1);break;case"mix":vs(r,p,new fS(g,g,d),1,1);break}}}if(e.attachments)for(const l in e.attachments){const c=e.attachments[l],u=i.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const d in c){const f=c[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],b=u.getAttachment(m,g);if(!b)throw new Error(`Timeline attachment not found: ${g}`);for(const y in v){const w=v[y];let A=w[0];if(A){if(y==="deform"){const T=b.bones,M=b.vertices,R=T?M.length/3*2:M.length,P=new Qw(w.length,w.length,m,b);let F=se(A,"time",0);for(let I=0,k=0;;I++){let O;const L=se(A,"vertices",null);if(!L)O=T?lt.newFloatArray(R):M;else{O=lt.newFloatArray(R);const _=se(A,"offset",0);if(lt.arrayCopy(L,0,O,_,L.length),n!==1)for(let X=_,N=X+L.length;X=0;l--)r[l]===-1&&(r[l]=a[--h]);return r}function Ut(s,e,t,i,n,r,a,o,h,l){if(s==="stepped")return e.setStepped(i),t;const c=n<<2,u=s[c],d=s[c+1]*l,f=s[c+2],p=s[c+3]*l;return e.setBezier(t,i,n,r,o,u,d,f,p,a,h),t+1}function se(s,e,t){return s[e]!==void 0?s[e]:t}class JO{newRegionAttachment(e,t,i,n){return new Eu(t,i)}newMeshAttachment(e,t,i,n){return new Zl(t,i)}newBoundingBoxAttachment(e,t){return new ew(t)}newPathAttachment(e,t){return new Ul(t)}newPointAttachment(e,t){return new aw(t)}newClippingAttachment(e,t){return new Mo(t)}}class QO{sequence(e){for(let t=0;t!Number.isInteger(c)||c<0||c>=a))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const o=Number(s.hull)||0;if(!Number.isInteger(o)||o<0||o>a)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(s.edges)&&s.edges.some(c=>!Number.isInteger(c)||c<0||c>=a*2||c%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===i.length)return;let h=0,l=0;for(;h=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(h!==n.length||l!==a)throw new Error(`拖尾网格“${e}”的顶点数量与 UV 不一致`)}function iB(s,e){var r,a,o,h;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&&!eB.has(l.inherit))throw new Error(`骨骼“${l.name||""}”的 inherit 值“${l.inherit}”不符合 Spine ${e} JSON 格式`);if(/_particle_\d+_trail_/.test(String(l.name||""))){const c=i.get(String(l.parent||""));if(!c||/_particle_\d+_trail_/.test(String(c.name||"")))throw new Error(`拖尾骨骼“${l.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const l of Array.isArray(s.skins)?s.skins:[]){const c=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(c))for(const d of Object.keys(c[u]||{})){const f=c[u][d];(f==null?void 0:f.type)==="mesh"&&(tB(f,d,t.length),((r=f.vertices)==null?void 0:r.length)!==((a=f.uvs)==null?void 0:a.length)&&n.add(u))}}for(const l of Object.values(s.animations||{}))for(const c of n){const u=(h=(o=l==null?void 0:l.slots)==null?void 0:o[c])==null?void 0:h.attachment;if(Array.isArray(u)&&u.some(d=>!(d!=null&&d.name)))throw new Error(`加权拖尾插槽“${c}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0`)}}function sB(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 yy(s,e){var a;const t=JSON.parse(s),i=Ph((a=t==null?void 0:t.skeleton)==null?void 0:a.spine);if(!i)throw new Error(`导出版本不受支持,仅支持 Spine ${_m()}`);if(e&&i!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${i}`);iB(t,i),i==="3.8"&&sB(t);const n=i==="3.8"?xw(JSON.parse(JSON.stringify(t))):t,r=i==="4.3"?new KO(new QO).readSkeletonData(n):new Dh(new JO).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 TS="http://127.0.0.1:27843";class zm extends Error{constructor(t,i="CONNECTOR_ERROR",n){super(t);x(this,"code");x(this,"pairUrl");this.name="SpineConnectorError",this.code=i,this.pairUrl=n}}function qm(s,e){return String(s||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function nB(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 rB(s,e,t){const i=String(s||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>qm(r,"images")),n=qm(e.replace(/\.[^./\\]+$/,""),"image");return[...i,`${n}${nB(e,t)}`].join("/")}async function Ef(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 a="";const o=32768;for(let h=0;ha.finally(()=>{i++,e==null||e(i,t.length)});for(const a of s.filter(o=>o.visible!==!1)){for(const o of a.config.imageResources)if(o.imageMode==="sequence"&&o.sequenceFrames.length)for(const h of o.sequenceFrames)t.push(n(Ef(h.previewUrl,o.textureFolder,h.name||o.textureName)));else t.push(n(Ef(o.previewUrl,o.textureFolder,o.textureName)));if(a.config.trail)for(const o of a.config.trailResources)t.push(n(Ef(o.previewUrl,"",o.textureName)))}const r=new Map;for(const a of await Promise.all(t))a&&!r.has(a.path)&&r.set(a.path,a);return[...r.values()]}async function aB(){try{const s=await fetch(`${TS}/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 oB(s,e){const t=await AS(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 a=new XMLHttpRequest;a.open("POST",`${TS}/v1/convert`),a.responseType="blob",a.setRequestHeader("Content-Type","application/json"),a.upload.onprogress=o=>{e==null||e({phase:"upload",progress:o.lengthComputable&&o.total>0?o.loaded/o.total:null})},a.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),a.onprogress=o=>{e==null||e({phase:"download",progress:o.lengthComputable&&o.total>0?o.loaded/o.total:null})},a.onerror=()=>r(new zm("未检测到本地 Spine 连接器,请先启动连接器","CONNECTOR_OFFLINE")),a.onload=async()=>{const o=a.response;if(a.status<200||a.status>=300){let c={};try{c=JSON.parse(await o.text())}catch{}r(new zm(c.message||`Spine 连接器返回错误:HTTP ${a.status}`,c.code,c.pairUrl));return}const h=a.getResponseHeader("X-Spine-File-Name");let l=`${qm(s.projectName,"SpineParticle")}.zip`;if(h)try{l=decodeURIComponent(h)}catch{}n({blob:o,fileName:l,spineEditorVersion:a.getResponseHeader("X-Spine-Editor-Version")||s.spineVersion,imageCount:t.length})},a.send(i)})}function lB(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 cB=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 hB(s){let e=4294967295;for(const t of s)e=cB[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function uB(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 dB(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 Cf(s){const e=new Uint8Array(s);return{bytes:e,view:new DataView(e.buffer)}}function xy(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 fB(s){const e=new TextEncoder,t=[],i=[],n=dB();let r=0;for(const h of s){const l=e.encode(uB(h.name)),c=hB(h.data),u=Cf(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,c,!0),u.view.setUint32(18,h.data.length,!0),u.view.setUint32(22,h.data.length,!0),u.view.setUint16(26,l.length,!0),t.push(u.bytes,l,h.data);const d=Cf(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,c,!0),d.view.setUint32(20,h.data.length,!0),d.view.setUint32(24,h.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+h.data.length}const a=xy(i),o=Cf(22);return o.view.setUint32(0,101010256,!0),o.view.setUint16(8,s.length,!0),o.view.setUint16(10,s.length,!0),o.view.setUint32(12,a.length,!0),o.view.setUint32(16,r,!0),new Blob([xy([...t,a,o.bytes])],{type:"application/zip"})}function mB(s){const e=atob(s),t=new Uint8Array(e.length);for(let i=0;ii===".."||/^[a-z]+:/i.test(i))?"images":t.join("/")}function gB(s){return String(s||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function vB(s){const e=await AS(s.systems);if(!e.length)throw new Error("当前可见粒子系统没有可导出的图片");const t=pB(s.imagesPath);return{blob:fB(e.map(n=>({name:`${t}/${n.path}`,data:mB(n.dataBase64)}))),imageCount:e.length,folder:t}}function yB(s,e){const t=`${gB(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}const xB={class:"panel"},bB={class:"panel-scroll"},wB={class:"group config-management"},SB={class:"caret"},_B={class:"group-body config-management-body"},MB={class:"config-toolbar"},TB=["disabled"],AB={value:""},EB=["value"],CB={class:"group"},IB={class:"caret"},RB={class:"scene-actions"},PB=["disabled"],kB={class:"group-body"},FB={class:"tree scene-tree"},OB=["onClick"],BB={class:"tlabel"},LB=["title","aria-label","onClick"],DB={viewBox:"0 0 24 24","aria-hidden":"true"},NB={key:0,class:"eye-slash",d:"M4 4l16 16"},UB=["onClick"],XB=["onClick"],VB={class:"tlabel"},YB=["title","aria-label","onClick"],$B={viewBox:"0 0 24 24","aria-hidden":"true"},GB={key:0,class:"eye-slash",d:"M4 4l16 16"},HB=["onClick"],jB=["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"},eL=["title","aria-label","onClick"],tL={viewBox:"0 0 24 24","aria-hidden":"true"},iL={key:0,class:"eye-slash",d:"M4 4l16 16"},sL=["onClick"],nL={key:0,class:"empty"},rL={class:"row"},aL={class:"seed-row scene-seed"},oL={class:"field-block"},lL={class:"field-grid"},cL={class:"field-block"},hL={class:"field-block check-field"},uL={class:"field-grid"},dL={class:"compact-field"},fL={class:"compact-field"},mL={class:"field-grid"},pL={class:"compact-field"},gL={class:"compact-field"},vL={key:1,class:"field-grid"},yL={class:"compact-field"},xL={class:"compact-field"},bL={key:2,class:"field-grid"},wL={class:"compact-field"},SL={class:"compact-field"},_L={class:"field-block"},ML={key:4,class:"field-grid"},TL={class:"compact-field"},AL={class:"compact-field"},EL={class:"collider-follow-section"},CL={class:"follow-path"},IL={class:"field-block"},RL=["value"],PL={class:"field-grid"},kL={class:"compact-field"},FL={class:"compact-field"},OL={class:"follow-path"},BL={class:"field-block"},LL={class:"field-grid"},DL={class:"compact-field"},NL={class:"compact-field"},UL={class:"field-grid"},XL={class:"compact-field"},VL={class:"compact-field"},YL={class:"setting-line"},$L={class:"setting-line"},GL={class:"field-block"},HL={key:4,class:"panel-hint"},jL={class:"group"},WL={class:"caret"},zL={class:"group-body"},qL={class:"segs"},KL={class:"segs stream-behavior-segs"},ZL={key:2,class:"stream-loop-options"},JL={class:"loop-section-row"},QL={class:"switch-row"},eD=["checked"],tD={key:0,class:"loop-duration-control"},iD={class:"switch-row loop-duration-toggle"},sD=["checked"],nD={class:"loop-section-duration"},rD=["value"],aD={key:1},oD={key:2,class:"loop-auto-duration"},lD={class:"loop-section-row"},cD={class:"switch-row"},hD=["checked"],uD={key:0,class:"loop-duration-control"},dD={class:"switch-row loop-duration-toggle"},fD=["checked"],mD={class:"loop-section-duration"},pD=["value"],gD={key:1},vD={key:2,class:"loop-auto-duration"},yD={key:3,class:"modifier-hint stream-loop-hint"},xD={class:"group"},bD={class:"caret"},wD={class:"group-body"},SD={class:"row"},_D={class:"row"},MD=["value","disabled"],TD={key:0,class:"row"},AD={class:"row"},ED={key:0,value:"radial"},CD={key:1,value:"path-normal"},ID={key:2,value:"path-tangent"},RD={class:"group"},PD={class:"caret"},kD={class:"group-body attr-body"},FD={class:"attr-axis-head"},OD={class:"axis-modes"},BD={class:"life-item"},LD={class:"switch-row"},DD={class:"life-item"},ND={class:"switch-row"},UD={class:"axis-modes life-axis"},XD={class:"life-item"},VD={class:"switch-row"},YD={class:"group"},$D={class:"caret"},GD={class:"group-body"},HD={class:"seg"},jD={class:"row"},WD={class:"curve-wrap"},zD={class:"row"},qD=["onUpdate:modelValue"],KD=["onUpdate:modelValue"],ZD={class:"row resource-color-row"},JD=["onUpdate:modelValue"],QD=["onUpdate:modelValue"],eN={key:0,class:"row resource-color-picker"},tN=["onUpdate:modelValue"],iN=["value","onChange","onKeydown"],sN={key:0,class:"random-color-hint"},nN={class:"resource-alpha-head"},rN={class:"alpha-modes"},aN=["onClick"],oN=["onClick"],lN=["onClick"],cN={class:"row"},hN=["onUpdate:modelValue"],uN={class:"resource-alpha-curve"},dN={class:"group"},fN={class:"caret"},mN={class:"group-body"},pN={class:"modifier-item"},gN={class:"switch-row modifier-switch"},vN={key:0,class:"modifier-params"},yN={class:"modifier-item"},xN={class:"switch-row modifier-switch"},bN={key:0,class:"modifier-params gravity-params"},wN={class:"modifier-mode-row"},SN={class:"modifier-item"},_N={class:"switch-row modifier-switch"},MN={key:0,class:"modifier-params gravity-params"},TN={class:"modifier-mode-row"},AN={class:"modifier-item"},EN={class:"switch-row modifier-switch"},CN={key:0,class:"modifier-params"},IN={class:"row"},RN={class:"modifier-item"},PN={class:"switch-row modifier-switch"},kN={key:0,class:"modifier-params"},FN={class:"row"},ON={class:"row"},BN={class:"modifier-item"},LN={class:"switch-row modifier-switch"},DN={key:0,class:"modifier-params trail-params"},NN={class:"row"},UN=["onUpdate:modelValue"],XN={class:"row"},VN=["onUpdate:modelValue"],YN={class:"row"},$N=["onUpdate:modelValue"],GN={class:"switch-row trail-sub-switch"},HN=["onUpdate:modelValue"],jN={class:"switch-row trail-sub-switch"},WN=["onUpdate:modelValue"],zN={class:"trail-mode-head"},qN={class:"alpha-modes"},KN=["onClick"],ZN=["onClick"],JN=["onClick"],QN={class:"row"},e4=["onUpdate:modelValue"],t4={key:6,class:"row trail-fixed-color"},i4=["onUpdate:modelValue"],s4=["value","onChange","onKeydown"],n4={class:"trail-mode-head"},r4={class:"alpha-modes"},a4=["onClick"],o4=["onClick"],l4=["onClick"],c4={class:"trail-grid-row"},h4={class:"modifier-item"},u4={class:"switch-row modifier-switch"},d4=["disabled"],f4={key:0,class:"modifier-params emitter-follow-params"},m4={class:"field-block"},p4=["value"],g4={key:0,value:"bone"},v4={class:"field-block"},y4=["value"],x4={class:"field-block"},b4={class:"field-grid follow-grid"},w4={class:"compact-field"},S4={class:"compact-field"},_4={class:"field-block"},M4={key:0,class:"bone-follow-target"},T4={key:1,class:"bone-follow-missing"},A4={class:"field-block"},E4={class:"field-grid follow-grid"},C4={class:"compact-field"},I4={class:"compact-field"},R4={class:"bone-follow-transform-grid"},P4={class:"compact-field"},k4={class:"compact-field"},F4={class:"compact-field"},O4={class:"modifier-item"},B4={class:"switch-row modifier-switch"},L4={key:0,class:"modifier-params collision-filter-params"},D4={class:"collision-filter-tags"},N4=["title"],U4=["aria-label","onClick"],X4=["disabled","title"],V4={key:0,class:"collision-filter-empty"},Y4={key:1,class:"collision-filter-picker"},$4=["onClick"],G4={class:"group"},H4={class:"caret"},j4={class:"group-body export-settings"},W4={class:"export-field"},z4={class:"export-field"},q4={class:"export-field"},K4={key:0,class:"export-help"},Z4={class:"export-fps-row"},J4={class:"export-field export-fps-field"},Q4={class:"export-checkbox"},e5={class:"export-switches"},t5={class:"switch-row export-switch"},i5={class:"switch-row export-switch"},s5={class:"switch-row export-switch export-switch-last"},n5={class:"spine-export-actions"},r5=["disabled","title"],a5=["disabled"],o5=["disabled","title"],l5={key:0},c5=["href"],h5=["href"],u5=sn({__name:"ParticlePanel",setup(s){const e=Kl();e.settings.exportSettings=p1(e.settings.exportSettings);const t=pt(()=>e.settings.exportSettings),i=ht(null),n=ht(""),r=ht([]),a=ht(!1),o=ht(""),h=ht(!1),l=ht(!1),c=ht(null),u=ht(""),d=ht(!1),f=ht(null),p=ht(""),m=pt(()=>{const $=f.value;return $?$.available?$.spineFound?$.authorized?"连接器可用 · Spine 已就绪":"连接器已启动,当前网站尚未授权":"连接器已启动,但未找到 Spine":"本地 Spine 连接器未启动":"正在检测本地 Spine 连接器…"}),g=pt(()=>{var $,S,C,Z,Fe,ft;return{ready:!!(($=f.value)!=null&&$.available)&&!!((S=f.value)!=null&&S.spineFound)&&!!((C=f.value)!=null&&C.authorized),warning:!!((Z=f.value)!=null&&Z.available)&&(!((Fe=f.value)!=null&&Fe.spineFound)||!((ft=f.value)!=null&&ft.authorized))}}),v=pt(()=>{var $,S,C;return!!(($=f.value)!=null&&$.available)&&!!((S=f.value)!=null&&S.spineFound)&&!!((C=f.value)!=null&&C.authorized)}),b=pt(()=>{const $=f.value;return!($!=null&&$.available)||!$.spineFound||$.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),y=pt(()=>{const $=f.value;return $?$.available?$.spineFound?$.authorized?"":"未授权":"未找到 Spine":"未启动":"检测中"}),w=pt(()=>l.value?"正在重新计算并生成 Spine 工程":y.value?`暂不可用:${y.value}`:`调用本机 Spine 自动生成 ${t.value.spineVersion} 工程`);function A($){return $==="跟随导出"?t.value.keyframeCurve==="bezier"?"bezier":"linear":$==="贝塞尔"?"bezier":"linear"}e.systems.length||e.addSystem();function T(){Tw(e),h.value=!1,o.value="配置已保存到本地"}async function M($){var Z;const S=$.target,C=(Z=S.files)==null?void 0:Z[0];if(C){o.value="正在加载配置…",h.value=!1;try{await VP(e,C),o.value=`已加载:${C.name}`}catch(Fe){h.value=!0,o.value=Fe instanceof Error?Fe.message:String(Fe)}finally{S.value=""}}}async function R(){try{const $=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!$.ok)throw new Error("无法读取预设列表");const S=await $.json();r.value=Array.isArray(S)?S.filter(C=>!!C&&typeof C.name=="string"&&typeof C.file=="string"):[]}catch{r.value=[]}}async function P(){const $=n.value;if(!$)return;a.value=!0,h.value=!1,o.value="正在加载预设…";const S=Kv("加载预设",`正在下载 ${$}…`);try{await S.paint();const C=await fetch(`/Preset/${encodeURIComponent($)}`,{cache:"no-store"});if(!C.ok)throw new Error(`无法读取预设:${$}`);const Z=await _3(C,Fe=>{S.update(Fe==null?null:Fe*55,`正在下载 ${$}…`)});S.update(58,"正在解析预设配置…"),S.update(70,"正在解析并恢复预设资源…"),await Ew(e,Z),o.value=`已加载预设:${$.replace(/\.json$/i,"")}`,await S.finish("预设加载完成")}catch(C){h.value=!0;const Z=C instanceof Error?C.message:String(C);o.value=`${Z},请检查预设文件命名`,await S.fail(Z)}finally{a.value=!1,n.value=""}}Da(()=>{R(),I(),F=window.setInterval(I,3e3)});let F;uu(()=>{F!==void 0&&window.clearInterval(F)});async function I(){f.value=await aB()}function k(){return new Promise($=>requestAnimationFrame(()=>$()))}async function O($){e.timeline.playing=!1,e.timeline.frame=0,e.timeline.recorded=!1;for(const Z of e.systems)Z.frames=void 0;e.recalcTotalFrames(),await k(),e.timeline.playing=!0;const S=e.timeline.totalFrames/Math.max(1,e.timeline.fps)*1e3,C=performance.now()+Math.max(8e3,S*2.5+3e3);for(;!e.timeline.recorded;){if(performance.now()>C)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");$==null||$(Math.min(.98,e.timeline.frame/Math.max(1,e.timeline.totalFrames-1))),await new Promise(Z=>setTimeout(Z,50))}$==null||$(1)}async function L(){if(!l.value){l.value=!0,c.value="json",d.value=!1,p.value="",u.value="正在重新计算粒子动画…";try{await O();const $=ay({systems:e.systems,timeline:e.timeline,settings:t.value});yy($.text,t.value.spineVersion),q3($,t.value.fileName);const S=$.warnings.length?`;${$.warnings.length} 条资源提示(缺图仍已导出)`:"";u.value=`已导出 Spine ${t.value.spineVersion}:${$.particleSystemCount} 个粒子系统、${$.animationCount} 个动画、${$.boneCount} 根骨骼${S}`}catch($){d.value=!0,u.value=$ instanceof Error?$.message:String($)}finally{l.value=!1,c.value=null}}}async function U(){if(l.value)return;l.value=!0,c.value="spine",d.value=!1,p.value="",u.value="正在重新计算粒子动画…";const $=Kv("导出 Spine 包","正在重新计算粒子动画…");try{await $.paint(),await O(Fe=>$.update(Fe*18,"正在重新计算粒子动画…")),$.update(20,"正在生成 Spine JSON…");const S=ay({systems:e.systems,timeline:e.timeline,settings:t.value});yy(S.text,t.value.spineVersion),u.value="正在整理图片并调用本机 Spine…";const C=t.value.fileName.replace(/\.json$/i,"")||"SpineParticle",Z=await oB({projectName:C,spineVersion:t.value.spineVersion,skeletonJson:S.text,systems:e.systems},({phase:Fe,progress:ft})=>{Fe==="images"?$.update(ft==null?null:22+ft*18,"正在整理工程图片…"):Fe==="upload"?$.update(ft==null?null:40+ft*30,"正在上传数据到 Spine 连接器…"):Fe==="processing"?$.update(null,"Spine 正在转换工程,请稍候…"):$.update(ft==null?null:82+ft*16,"正在下载生成的 Spine 工程包…")});$.update(99,"正在交给浏览器下载…"),lB(Z.blob,Z.fileName),u.value=`已生成 ${Z.fileName}:包含 .spine 工程和 ${Z.imageCount} 张图片,Spine ${Z.spineEditorVersion}`,await I(),await $.finish("Spine 工程包已开始下载")}catch(S){d.value=!0,S instanceof zm&&S.pairUrl&&(p.value=S.pairUrl),u.value=S instanceof Error?S.message:String(S),await I(),await $.fail(u.value)}finally{l.value=!1,c.value=null}}async function B(){if(!l.value){l.value=!0,c.value="images",d.value=!1,p.value="",u.value="正在整理当前粒子系统使用的图片…";try{const $=await vB({systems:e.systems,imagesPath:t.value.imagesPath}),S=yB($.blob,t.value.fileName);u.value=`已生成 ${S}:${$.folder}/ 内包含 ${$.imageCount} 张图片`}catch($){d.value=!0,u.value=$ instanceof Error?$.message:String($)}finally{l.value=!1,c.value=null}}}const D=pt(()=>{const $=e.systems.findIndex(S=>S.id===e.activeId);return $>=0?$:0}),_=pt(()=>e.systems[D.value]||null),X=pt(()=>_.value?g1(_.value.config,e.timeline.fps):30),N=pt(()=>{var S;const $=(S=_.value)==null?void 0:S.config;return $?Math.max(1,Math.ceil(Number($.loopDurationFrames)||1)):1}),V=pt(()=>e.activeObjectType),G=pt(()=>e.activeObjectType==="collision"&&e.colliders.find($=>$.id===e.activeObjectId)||null),j=pt(()=>e.activeObjectType==="path"&&e.paths.find($=>$.id===e.activeObjectId)||null),ne=pt(()=>e.activeObjectType==="spine"&&e.spines.find($=>$.id===e.activeObjectId)||null),Q=pt(()=>e.activeObjectType==="particle"?e.systems.some($=>$.id===e.activeObjectId):e.activeObjectType==="collision"?e.colliders.some($=>$.id===e.activeObjectId):e.activeObjectType==="path"?e.paths.some($=>$.id===e.activeObjectId):e.spines.some($=>$.id===e.activeObjectId)),de=pt(()=>{const $=e.spines.find(S=>S.selectedBone&&S.bones.some(C=>C.name===S.selectedBone));return $?{spine:$,boneName:$.selectedBone}:null}),me=pt(()=>{var C;const $=(C=_.value)==null?void 0:C.config;if(!$||$.emitterFollowMode!=="bone")return null;const S=e.spines.find(Z=>Z.id===$.emitterFollowSpineId);return!S||!S.bones.some(Z=>Z.name===$.emitterFollowBoneName)?null:{spine:S,boneName:$.emitterFollowBoneName}}),we=ht(!1),Re=pt(()=>{var S;const $=new Set(((S=_.value)==null?void 0:S.config.collisionColliderIds)||[]);return e.colliders.filter(C=>$.has(C.id))}),ge=pt(()=>{var S;const $=new Set(((S=_.value)==null?void 0:S.config.collisionColliderIds)||[]);return e.colliders.filter(C=>!$.has(C.id))});cs(()=>{var $,S;return[($=_.value)==null?void 0:$.id,(S=_.value)==null?void 0:S.config.collision]},()=>{we.value=!1});function Ae($){var C;const S=(C=_.value)==null?void 0:C.config;!S||S.collisionColliderIds.includes($)||(S.collisionColliderIds.push($),we.value=!1)}function H($){var C;const S=(C=_.value)==null?void 0:C.config;S&&(S.collisionColliderIds=S.collisionColliderIds.filter(Z=>Z!==$))}Qo(()=>{for(const $ of e.systems)$.visible==null&&($.visible=!0);for(const $ of e.colliders)$.visible==null&&($.visible=!0);for(const $ of e.paths)$.visible==null&&($.visible=!0);for(const $ of e.spines)$.visible==null&&($.visible=!0)}),Qo(()=>{if(!_.value)return;const $=Gr(_.value.config);$.lifeMode==="curve"&&($.lifeMode="random"),$.speedMode==="curve"&&($.speedMode="random"),$.scaleMode==="curve"&&($.scaleMode="random"),$.initialRotationMode==="curve"&&($.initialRotationMode="random"),$.mode==="stream"&&!($.duration>0)&&($.duration=1),$.streamBehavior==="loop"&&($.emitterFollow||$.emitterFollowMode!=="none")&&Pe($)}),Qo(()=>{const $=new Set(e.colliders.map(S=>S.id));for(const S of e.systems){const C=Gr(S.config),Z=C.collisionColliderIds.filter(Ot=>$.has(Ot));if(Z.length!==C.collisionColliderIds.length&&(C.collisionColliderIds=Z),C.spawnPathId>0&&!e.paths.some(Ot=>Ot.id===C.spawnPathId)&&(C.spawnPathId=0,(C.emissionAngleMode==="path-normal"||C.emissionAngleMode==="path-tangent")&&(C.emissionAngleMode="fixed")),C.emitterFollowMode!=="bone")continue;const Fe=e.spines.find(Ot=>Ot.id===C.emitterFollowSpineId);!!(Fe!=null&&Fe.bones.some(Ot=>Ot.name===C.emitterFollowBoneName))||(C.emitterFollowMode="none",C.emitterFollowSpineId=0,C.emitterFollowBoneName="")}}),Qo(()=>{for(const $ of e.colliders)$.followPathId==null&&($.followPathId=0),$.followDuration>0||($.followDuration=2),$.followPathRotation==null&&($.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes($.followCurveMode)||($.followCurveMode="跟随导出"),(!Array.isArray($.followCurve)||$.followCurve.length<2)&&($.followCurve=[{x:0,y:0},{x:1,y:1}])});const K=[{x:0,y:0},{x:1,y:1}],q=[{x:0,y:1},{x:1,y:1}],z=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],ee=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],le=[{x:0,y:1},{x:1,y:1}],ve=[{x:0,y:1},{x:1,y:1}],re=La({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function ye($){re[$]=!re[$]}function he($){var C;const S=(C=_.value)==null?void 0:C.config;S&&(S.mode=$,$==="stream"&&!(S.duration>0)&&(S.duration=1))}function Xe($){var Z;const S=(Z=_.value)==null?void 0:Z.config;if(!S)return;const C=Math.min(1800,Math.max(1,Math.ceil(Number($)||1)));S.loopDurationFrames=C}function Pe($){const S=Nl();$.emitterFollow=!1,$.emitterFollowMode="none",$.emitterFollowPathId=S.emitterFollowPathId,$.emitterFollowSpineId=S.emitterFollowSpineId,$.emitterFollowBoneName=S.emitterFollowBoneName,$.emitterFollowBoneOffsetX=S.emitterFollowBoneOffsetX,$.emitterFollowBoneOffsetY=S.emitterFollowBoneOffsetY,$.emitterFollowBoneRotation=S.emitterFollowBoneRotation,$.emitterFollowBoneScaleX=S.emitterFollowBoneScaleX,$.emitterFollowBoneScaleY=S.emitterFollowBoneScaleY,$.emitterAngleMode=S.emitterAngleMode,$.emitterFollowCurve=S.emitterFollowCurve.map(C=>({...C})),$.emitterFollowDuration=S.emitterFollowDuration,$.emitterFollowSpace=S.emitterFollowSpace,$.emitterFollowDirection=S.emitterFollowDirection,$.emitterFollowOffset=S.emitterFollowOffset}function Oe($){var Fe;const S=(Fe=_.value)==null?void 0:Fe.config;if(!S||S.streamBehavior===$)return;const C=$==="loop",Z=C?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(Z)&&(Pe(S),S.streamBehavior=$,C||(S.generateLoopStartAnimation=!1,S.generateLoopEndAnimation=!1))}function it($,S){var Fe;const C=(Fe=_.value)==null?void 0:Fe.config;if(!C)return;const Z=S.target.checked;$==="start"?C.generateLoopStartAnimation=Z:C.generateLoopEndAnimation=Z}function bt($,S){var Fe;const C=(Fe=_.value)==null?void 0:Fe.config;if(!C)return;const Z=Math.min(1800,Math.max(1,Math.ceil(Number(S.target.value)||30)));$==="start"?C.loopStartDurationFrames=Z:C.loopEndDurationFrames=Z}function Ct($,S){var Fe;const C=(Fe=_.value)==null?void 0:Fe.config;if(!C)return;const Z=S.target.checked;$==="start"?C.loopStartUseCustomDuration=Z:C.loopEndUseCustomDuration=Z}function wt($,S){const C=$.target.value;if(S.emitterFollowMode=C,C!=="bone"){S.emitterFollowSpineId=0,S.emitterFollowBoneName="";return}Et(S)}function Et($){const S=de.value;if(!S){$.emitterFollowMode="none",$.emitterFollowSpineId=0,$.emitterFollowBoneName="";return}$.emitterFollowMode="bone",$.emitterFollowSpineId=S.spine.id,$.emitterFollowBoneName=S.boneName}const Kt={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function yi($){var Z;const S=(Z=_.value)==null?void 0:Z.config;if($==="export"){e.settings.exportSettings=Tp();return}if(!S)return;const C=Nl();for(const Fe of Kt[$])S[Fe]=C[Fe]}function Bi(){t.value.fps=Math.min(240,Math.max(1,Math.round(Number(t.value.fps)||30)))}function Ls($){var S;e.selectSystem(((S=e.systems[$])==null?void 0:S.id)??0)}function an(){e.addSystem()}function xi(){e.addCollider()}function ce(){e.addPath()}function fe(){e.addSpine()}function It(){e.duplicateSelectedObject()}function Rt($,S,C=0,Z=0,Fe=0,ft=0){return{x:$,y:S,inX:C,inY:Z,outX:Fe,outY:ft}}function Zt(){const $=j.value;if(!(!$||!$.preset))if($.preset==="circle"){const C=60.751328;$.points=[Rt(110,0,0,-C,0,C),Rt(0,110,C,0,-C,0),Rt(-110,0,0,C,0,-C),Rt(0,-110,-C,0,C,0)],$.closed=!0}else if($.preset==="square")$.points=[Rt(-100,-100),Rt(100,-100),Rt(100,100),Rt(-100,100)],$.closed=!0;else{const S=$.preset==="star"?10:6;$.points=Array.from({length:S},(C,Z)=>{const Fe=$.preset==="star"&&Z%2?50:110,ft=-Math.PI*.5+Z/S*Math.PI*2;return Rt(Math.cos(ft)*Fe,Math.sin(ft)*Fe)}),$.closed=!0}}function St(){j.value&&(j.value.points=[])}function Ms(){_.value&&(_.value.config.seed=Math.floor(Math.random()*999999)+1)}function Ds($){var C;const S=(C=_.value)==null?void 0:C.config;!S||$==="direction"||(S.speedOverLifeMode=$,$==="curve"&&S.speedOverLifeMin===S.speedOverLifeMax&&(S.speedOverLifeMin=0,S.speedOverLifeMax=1))}function Li(){var S;const $=(S=_.value)==null?void 0:S.config;!$||$.scaleOverLifeMode!=="curve"||($.scaleOverLifeMin===$.scaleOverLifeMax&&($.scaleOverLifeMin=0,$.scaleOverLifeMax=1),$.scaleYOverLifeMin===$.scaleYOverLifeMax&&($.scaleYOverLifeMin=0,$.scaleYOverLifeMax=1))}function Ts($){var C;const S=(C=_.value)==null?void 0:C.config;!S||$==="direction"||(S.scaleOverLifeMode=$,Li())}const qr={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 on(){var C;const $=(C=_.value)==null?void 0:C.config;if(!$)return;const S=qr[$.shape];S&&Object.assign($,S)}function Wi(){var S;const $=(S=_.value)==null?void 0:S.config;!$||$.spawnPathId>0||($.emissionAngleMode==="path-normal"||$.emissionAngleMode==="path-tangent")&&($.emissionAngleMode="fixed")}const Kr=ht(null),Zr=ht(null),Ns=ht(null),ln=ht(null),cn=ht(null);function Nn(){var C;const $=(C=_.value)==null?void 0:C.config;if(!$)return;const S=Math.max(0,...$.trailResources.map(Z=>Z.id))+1;$.trailResources.push({id:S,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:le.map(Z=>({...Z})),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:q.map(Z=>({...Z})),shapeEnabled:!1,shapeCurve:ve.map(Z=>({...Z}))}),ie()}function Jr($){var S;cn.value=$,(S=ln.value)==null||S.click()}function Us($,S){var Fe;const C=(Fe=_.value)==null?void 0:Fe.config;if(!C)return;const Z=$==="trailGridCols"?32:16;C[$]=Math.min(Z,Math.max(2,Math.round(Number(S)||2)))}function $a($,S){var Z;const C=(Z=_.value)==null?void 0:Z.config.trailResources.find(Fe=>Fe.id===$);C&&(C.boneCount=Math.min(16,Math.max(2,Math.round(Number(S)||2))))}function Qr($,S){var Z;const C=(Z=_.value)==null?void 0:Z.config.trailResources.find(Fe=>Fe.id===$);C&&(C.rotation=Math.max(-360,Math.min(360,Number(S)||0)))}async function W($){var Ot,Ht;const S=$.target,C=(Ot=S.files)==null?void 0:Ot[0],Z=(Ht=_.value)==null?void 0:Ht.config,Fe=Z==null?void 0:Z.trailResources.find(Gt=>Gt.id===cn.value);if(!C||!Fe){S.value="";return}const ft=await Ye(C);Fe.texture=Or(await mt.fromURL(ft)),Fe.previewUrl=ft,Fe.textureName=C.name.replace(/\.[^.]+$/,"")||"trail",S.value="",cn.value=null}async function Y($){var Z;const S=(Z=_.value)==null?void 0:Z.config,C=S==null?void 0:S.trailResources.find(Fe=>Fe.id===$);C&&(C.texture=Or(await mt.fromURL("/images/trail.png")),C.previewUrl="/images/trail.png",C.textureName="trail",C.weight=100,C.locked=!1,C.rotation=0,C.boneCount=3,C.trailRatio=100,C.lengthMode="fixed",C.length=100,C.lengthMin=100,C.lengthMax=100,C.widthSizeMode="fixed",C.width=100,C.widthMin=100,C.widthMax=100,C.widthMode="particle",C.lifeLengthEnabled=!1,C.lifeLengthCurve=q.map(Fe=>({...Fe})),C.shapeEnabled=!1,C.shapeCurve=ve.map(Fe=>({...Fe})),C.colorMode="particle",C.color="#ffffff",C.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],C.blend="normal",C.alphaMode="particle",C.alpha=1,C.alphaCurve=le.map(Fe=>({...Fe})),ie())}function J($){var Z;const S=(Z=_.value)==null?void 0:Z.config.trailResources;if(!S||S.length<=1)return;const C=S.findIndex(Fe=>Fe.id===$);C>=0&&S.splice(C,1),ie()}function ie(){var Fe;const $=(Fe=_.value)==null?void 0:Fe.config.trailResources;if(!($!=null&&$.length))return;if($.length===1){$[0].weight=100,$[0].locked=!1;return}const S=$.filter(ft=>ft.locked),C=$.filter(ft=>!ft.locked);let Z=S.reduce((ft,Ot)=>ft+Math.max(0,Number(Ot.weight)||0),0);Z>100&&(Ie(S,100,!0),Z=100),Ie(C,100-Z)}function ue($,S){var Ht;const C=(Ht=_.value)==null?void 0:Ht.config.trailResources;if(!(C!=null&&C.length))return;if(C.length===1){C[0].weight=100,C[0].locked=!1;return}const Z=C.find(Gt=>Gt.id===$);if(!Z||Z.locked)return;const Fe=C.filter(Gt=>Gt.id!==$&&Gt.locked).reduce((Gt,ei)=>Gt+Math.max(0,Number(ei.weight)||0),0),ft=Math.max(0,100-Fe),Ot=C.filter(Gt=>Gt.id!==$&&!Gt.locked);Z.weight=Je(Math.min(ft,Math.max(0,Number(S)||0))),Ot.length?Ie(Ot,ft-Z.weight,!0):Z.weight=Je(ft)}function pe($){var Z;const S=(Z=_.value)==null?void 0:Z.config.trailResources;if(!S||S.length===1)return;const C=S.find(Fe=>Fe.id===$);C&&(C.locked=!C.locked)}function _e($,S){const C=S.target;$.color=Ze(C.value,$.color),C.value=$.color}function Me($,S){_e($,S),S.target.blur()}function be(){var C;const $=(C=_.value)==null?void 0:C.config;if(!$)return;const S=Math.max(0,...$.imageResources.map(Z=>Z.id))+1;$.imageResources.push({id:S,texture:$.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:ee.map(Z=>({...Z}))}),Ft()}function Le($){var S;Ns.value=$,(S=Kr.value)==null||S.click()}function Ce($){var S;Ns.value=$,(S=Zr.value)==null||S.click()}async function Be($){var Ht,Gt;const S=$.target,C=(Ht=S.files)==null?void 0:Ht[0],Z=(Gt=_.value)==null?void 0:Gt.config,Fe=Z==null?void 0:Z.imageResources.find(ei=>ei.id===Ns.value);if(!C||!Fe){S.value="";return}const ft=await Ye(C),Ot=Or(await mt.fromURL(ft));Fe.texture=Ot,Fe.previewUrl=ft,Fe.textureFolder="",Fe.textureName=C.name.replace(/\.[^.]+$/,"")||"particle",S.value="",Ns.value=null}async function Te($){var ft;const S=$.target,C=Array.from(S.files||[]).sort((Ot,Ht)=>Ot.name.localeCompare(Ht.name,void 0,{numeric:!0,sensitivity:"base"})),Z=(ft=_.value)==null?void 0:ft.config,Fe=Z==null?void 0:Z.imageResources.find(Ot=>Ot.id===Ns.value);if(!C.length||!Fe){S.value="";return}Fe.sequenceFrames=await Promise.all(C.map(async Ot=>{const Ht=await Ye(Ot);return{name:Ot.name,previewUrl:Ht,texture:Or(await mt.fromURL(Ht))}})),Fe.imageMode="sequence",S.value="",Ns.value=null}function Ye($){return new Promise((S,C)=>{const Z=new FileReader;Z.onload=()=>S(String(Z.result||"")),Z.onerror=()=>C(Z.error),Z.readAsDataURL($)})}function nt($){var Z;const S=(Z=_.value)==null?void 0:Z.config,C=S==null?void 0:S.imageResources.find(Fe=>Fe.id===$);!S||!C||(C.texture=S.texture,C.textureName="star",C.textureFolder="",C.previewUrl="/images/star.png",C.imageMode="fixed",C.sequencePlayback="loop-forward",C.sequenceFps=30,C.sequenceFrames=[],C.scale=1,C.anchorX=.5,C.anchorY=.5,C.colorMode="fixed",C.colorStart="#ffffff",C.colorEnd="#ff4d4d",C.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],C.blend="normal",C.independentAlpha="off",C.alpha=1,C.alphaCurveMode="跟随导出",C.alphaCurve=ee.map(Fe=>({...Fe})),C.locked=!1,Ft())}function Ze($,S){let C=$.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(C)&&(C=C.split("").map(Z=>Z+Z).join("")),/^[0-9a-f]{6}$/i.test(C)?`#${C.toLowerCase()}`:S}function rt($,S){const C=S.target;$.colorStart=Ze(C.value,$.colorStart),C.value=$.colorStart}function Qe($,S){rt($,S),S.target.blur()}function Se($){var Z;const S=(Z=_.value)==null?void 0:Z.config.imageResources;if(!S||S.length<=1)return;const C=S.findIndex(Fe=>Fe.id===$);C>=0&&S.splice(C,1),Ft()}function Je($){return Math.round($)}function Ie($,S,C=!1){if(!$.length)return;const Z=Math.max(0,Je(S)),Fe=C?$.reduce((Ot,Ht)=>Ot+Math.max(0,Number(Ht.weight)||0),0):0;let ft=0;$.forEach((Ot,Ht)=>{const Gt=Ht===$.length-1,ei=Je(Gt?Z-ft:Fe>0?Z*Math.max(0,Number(Ot.weight)||0)/Fe:Z/$.length);Ot.weight=ei,ft+=ei})}function Ft(){var Fe;const $=(Fe=_.value)==null?void 0:Fe.config.imageResources;if(!($!=null&&$.length))return;if($.length===1){$[0].weight=100,$[0].locked=!1;return}const S=$.filter(ft=>ft.locked),C=$.filter(ft=>!ft.locked);let Z=S.reduce((ft,Ot)=>ft+Math.max(0,Number(Ot.weight)||0),0);Z>100&&(Ie(S,100,!0),Z=100),Ie(C,100-Z)}function Jt($,S){var Ht;const C=(Ht=_.value)==null?void 0:Ht.config.imageResources;if(!(C!=null&&C.length))return;if(C.length===1){C[0].weight=100,C[0].locked=!1;return}const Z=C.find(Gt=>Gt.id===$);if(!Z||Z.locked)return;const Fe=C.filter(Gt=>Gt.id!==$&&Gt.locked).reduce((Gt,ei)=>Gt+Math.max(0,Number(ei.weight)||0),0),ft=Math.max(0,100-Fe),Ot=C.filter(Gt=>Gt.id!==$&&!Gt.locked);if(Z.weight=Je(Math.min(ft,Math.max(0,Number(S)||0))),!Ot.length){Z.weight=Je(ft);return}Ie(Ot,ft-Z.weight,!0)}function Mi($){var Z;const S=(Z=_.value)==null?void 0:Z.config.imageResources;if(!S||S.length===1)return;const C=S.find(Fe=>Fe.id===$);C&&(C.locked=!C.locked)}return($,S)=>(te(),oe("div",xB,[S[391]||(S[391]=E("div",{class:"panel-header"},[E("span",null,"Spine粒子编辑器-Yeomai")],-1)),E("div",bB,[E("div",wB,[E("div",{class:"group-head",onClick:S[0]||(S[0]=C=>ye("config"))},[E("span",SB,je(re.config?"▸":"▾"),1),S[197]||(S[197]=E("span",null,"配置管理",-1))]),xe(E("div",_B,[E("div",MB,[E("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:T},"保存配置"),E("button",{title:"加载本地编辑器配置",onClick:S[1]||(S[1]=C=>{var Z;return(Z=i.value)==null?void 0:Z.click()})},"加载配置"),xe(E("select",{"onUpdate:modelValue":S[2]||(S[2]=C=>n.value=C),"aria-label":"预设列表",disabled:!r.value.length||a.value,onPointerdown:R,onFocus:R,onChange:P},[E("option",AB,je(r.value.length?"选择预设":"无预设文件"),1),(te(!0),oe(Ke,null,ci(r.value,C=>(te(),oe("option",{key:C.file,value:C.file},je(C.name),9,EB))),128))],40,TB),[[jt,n.value]]),E("input",{ref_key:"configFileInput",ref:i,hidden:"",type:"file",accept:".json,application/json",onChange:M},null,544)]),o.value?(te(),oe("div",{key:0,class:ot(["config-message",{error:h.value}])},je(o.value),3)):Ue("",!0)],512),[[yr,!re.config]])]),E("div",CB,[E("div",{class:"group-head scene-head",onClick:S[3]||(S[3]=C=>ye("scene"))},[E("span",IB,je(re.scene?"▸":"▾"),1),S[198]||(S[198]=E("span",null,"场景对象",-1)),E("div",RB,[E("button",{class:"scene-add",title:"添加粒子系统",onClick:yt(an,["stop"])},"+粒子"),E("button",{class:"scene-add",title:"添加碰撞体",onClick:yt(xi,["stop"])},"+碰撞"),E("button",{class:"scene-add",title:"添加路径",onClick:yt(ce,["stop"])},"+路径"),E("button",{class:"scene-add",title:"添加 Spine",onClick:yt(fe,["stop"])},"+Spine"),E("button",{class:"scene-add",disabled:!Q.value,title:"复制当前选中的场景对象",onClick:yt(It,["stop"])},"+Copy",8,PB)])]),xe(E("div",kB,[E("div",FB,[(te(!0),oe(Ke,null,ci(ke(e).systems,(C,Z)=>(te(),oe("div",{key:`particle-${C.id}`,class:ot(["tree-item scene-object-item",{on:V.value==="particle"&&C.id===ke(e).activeObjectId}]),onClick:Fe=>Ls(Z)},[S[201]||(S[201]=E("span",{class:"tdot"},"●",-1)),E("span",BB,je(C.config.name||"ParticleSystem"+(Z+1)),1),E("button",{class:ot(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":C.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:yt(Fe=>C.visible=C.visible===!1,["stop"])},[(te(),oe("svg",DB,[S[199]||(S[199]=E("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[200]||(S[200]=E("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(te(),oe("path",NB)):Ue("",!0)]))],10,LB),S[202]||(S[202]=E("span",{class:"scene-object-kind"},"粒子",-1)),E("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:yt(Fe=>ke(e).removeSystem(C.id),["stop"])},"✕",8,UB)],10,OB))),128)),(te(!0),oe(Ke,null,ci(ke(e).colliders,C=>(te(),oe("div",{key:`collision-${C.id}`,class:ot(["tree-item scene-object-item",{on:V.value==="collision"&&C.id===ke(e).activeObjectId}]),onClick:Z=>ke(e).selectSceneObject("collision",C.id)},[S[205]||(S[205]=E("span",{class:"tdot collision-dot"},"■",-1)),E("span",VB,je(C.name),1),E("button",{class:ot(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":C.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:yt(Z=>C.visible=C.visible===!1,["stop"])},[(te(),oe("svg",$B,[S[203]||(S[203]=E("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[204]||(S[204]=E("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(te(),oe("path",GB)):Ue("",!0)]))],10,YB),S[206]||(S[206]=E("span",{class:"scene-object-kind"},"碰撞",-1)),E("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:yt(Z=>ke(e).removeCollider(C.id),["stop"])},"✕",8,HB)],10,XB))),128)),(te(!0),oe(Ke,null,ci(ke(e).paths,C=>(te(),oe("div",{key:`path-${C.id}`,class:ot(["tree-item scene-object-item",{on:V.value==="path"&&C.id===ke(e).activeObjectId}]),onClick:Z=>ke(e).selectSceneObject("path",C.id)},[S[209]||(S[209]=E("span",{class:"tdot path-dot"},"◇",-1)),E("span",WB,je(C.name),1),E("button",{class:ot(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?"显示路径":"隐藏路径","aria-label":C.visible===!1?"显示路径":"隐藏路径",onClick:yt(Z=>C.visible=C.visible===!1,["stop"])},[(te(),oe("svg",qB,[S[207]||(S[207]=E("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[208]||(S[208]=E("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(te(),oe("path",KB)):Ue("",!0)]))],10,zB),S[210]||(S[210]=E("span",{class:"scene-object-kind"},"路径",-1)),E("button",{class:"scene-object-delete",title:"删除路径",onClick:yt(Z=>ke(e).removePath(C.id),["stop"])},"✕",8,ZB)],10,jB))),128)),(te(!0),oe(Ke,null,ci(ke(e).spines,C=>(te(),oe("div",{key:`spine-${C.id}`,class:ot(["tree-item scene-object-item",{on:V.value==="spine"&&C.id===ke(e).activeObjectId}]),onClick:Z=>ke(e).selectSceneObject("spine",C.id)},[S[213]||(S[213]=E("span",{class:"tdot spine-dot"},"◆",-1)),E("span",QB,je(C.name),1),E("button",{class:ot(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":C.visible===!1?"显示 Spine":"隐藏 Spine",onClick:yt(Z=>C.visible=C.visible===!1,["stop"])},[(te(),oe("svg",tL,[S[211]||(S[211]=E("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[212]||(S[212]=E("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(te(),oe("path",iL)):Ue("",!0)]))],10,eL),S[214]||(S[214]=E("span",{class:"scene-object-kind"},"Spine",-1)),E("button",{class:"scene-object-delete",title:"删除 Spine",onClick:yt(Z=>ke(e).removeSpine(C.id),["stop"])},"✕",8,sL)],10,JB))),128)),!ke(e).systems.length&&!ke(e).colliders.length&&!ke(e).paths.length&&!ke(e).spines.length?(te(),oe("div",nL,"场景中暂无对象")):Ue("",!0)]),V.value==="particle"&&_.value?(te(),oe(Ke,{key:0},[E("label",rL,[S[215]||(S[215]=E("span",null,"名称",-1)),xe(E("input",{"onUpdate:modelValue":S[4]||(S[4]=C=>_.value.config.name=C),class:"inp"},null,512),[[ct,_.value.config.name]])]),Ne(qe,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:_.value.config.centerX,"onUpdate:modelValue":S[5]||(S[5]=C=>_.value.config.centerX=C)},null,8,["modelValue"]),Ne(qe,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:_.value.config.centerY,"onUpdate:modelValue":S[6]||(S[6]=C=>_.value.config.centerY=C)},null,8,["modelValue"]),Ne(qe,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:_.value.config.offsetX,"onUpdate:modelValue":S[7]||(S[7]=C=>_.value.config.offsetX=C)},null,8,["modelValue"]),Ne(qe,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:_.value.config.offsetY,"onUpdate:modelValue":S[8]||(S[8]=C=>_.value.config.offsetY=C)},null,8,["modelValue"]),Ne(qe,{label:"旋转",min:-360,max:360,step:1,modelValue:_.value.config.rootRotation,"onUpdate:modelValue":S[9]||(S[9]=C=>_.value.config.rootRotation=C)},null,8,["modelValue"]),Ne(qe,{label:"缩放X",min:.05,max:10,step:.05,modelValue:_.value.config.rootScaleX,"onUpdate:modelValue":S[10]||(S[10]=C=>_.value.config.rootScaleX=C)},null,8,["modelValue"]),Ne(qe,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:_.value.config.rootScaleY,"onUpdate:modelValue":S[11]||(S[11]=C=>_.value.config.rootScaleY=C)},null,8,["modelValue"]),E("div",aL,[S[216]||(S[216]=E("label",{for:"system-seed"},"随机种子",-1)),xe(E("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":S[12]||(S[12]=C=>_.value.config.seed=C),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[ct,_.value.config.seed,void 0,{number:!0}]]),E("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:Ms},"⚄")]),S[217]||(S[217]=E("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):G.value?(te(),oe(Ke,{key:1},[S[242]||(S[242]=E("div",{class:"object-editor-title"},"碰撞体属性",-1)),E("label",oL,[S[218]||(S[218]=E("span",null,"碰撞体名称",-1)),xe(E("input",{"onUpdate:modelValue":S[13]||(S[13]=C=>G.value.name=C),class:"inp"},null,512),[[ct,G.value.name]])]),E("div",lL,[E("label",cL,[S[220]||(S[220]=E("span",null,"类型",-1)),xe(E("select",{"onUpdate:modelValue":S[14]||(S[14]=C=>G.value.shape=C),class:"inp"},[...S[219]||(S[219]=[to('',5)])],512),[[jt,G.value.shape]])]),E("label",hL,[S[221]||(S[221]=E("span",null,"启用",-1)),xe(E("input",{"onUpdate:modelValue":S[15]||(S[15]=C=>G.value.enabled=C),type:"checkbox"},null,512),[[ti,G.value.enabled]])])]),E("div",uL,[E("label",dL,[S[222]||(S[222]=E("span",null,"X 位置",-1)),xe(E("input",{"onUpdate:modelValue":S[16]||(S[16]=C=>G.value.x=C),type:"number",class:"inp"},null,512),[[ct,G.value.x,void 0,{number:!0}]])]),E("label",fL,[S[223]||(S[223]=E("span",null,"Y 位置",-1)),xe(E("input",{"onUpdate:modelValue":S[17]||(S[17]=C=>G.value.y=C),type:"number",class:"inp"},null,512),[[ct,G.value.y,void 0,{number:!0}]])])]),Ne(qe,{label:"旋转",min:-360,max:360,step:1,modelValue:G.value.rotation,"onUpdate:modelValue":S[18]||(S[18]=C=>G.value.rotation=C)},null,8,["modelValue"]),E("div",mL,[E("label",pL,[S[224]||(S[224]=E("span",null,"缩放 X",-1)),xe(E("input",{"onUpdate:modelValue":S[19]||(S[19]=C=>G.value.scaleX=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ct,G.value.scaleX,void 0,{number:!0}]])]),E("label",gL,[S[225]||(S[225]=E("span",null,"缩放 Y",-1)),xe(E("input",{"onUpdate:modelValue":S[20]||(S[20]=C=>G.value.scaleY=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ct,G.value.scaleY,void 0,{number:!0}]])])]),G.value.shape==="circle"?(te(),Qt(qe,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:G.value.radius,"onUpdate:modelValue":S[21]||(S[21]=C=>G.value.radius=C)},null,8,["modelValue"])):G.value.shape==="ellipse"?(te(),oe("div",vL,[E("label",yL,[S[226]||(S[226]=E("span",null,"X 半径",-1)),xe(E("input",{"onUpdate:modelValue":S[22]||(S[22]=C=>G.value.radiusX=C),type:"number",min:"1",class:"inp"},null,512),[[ct,G.value.radiusX,void 0,{number:!0}]])]),E("label",xL,[S[227]||(S[227]=E("span",null,"Y 半径",-1)),xe(E("input",{"onUpdate:modelValue":S[23]||(S[23]=C=>G.value.radiusY=C),type:"number",min:"1",class:"inp"},null,512),[[ct,G.value.radiusY,void 0,{number:!0}]])])])):(te(),oe("div",bL,[E("label",wL,[S[228]||(S[228]=E("span",null,"宽度",-1)),xe(E("input",{"onUpdate:modelValue":S[24]||(S[24]=C=>G.value.width=C),type:"number",min:"1",class:"inp"},null,512),[[ct,G.value.width,void 0,{number:!0}]])]),E("label",SL,[S[229]||(S[229]=E("span",null,"高度",-1)),xe(E("input",{"onUpdate:modelValue":S[25]||(S[25]=C=>G.value.height=C),type:"number",min:"1",class:"inp"},null,512),[[ct,G.value.height,void 0,{number:!0}]])])])),G.value.shape==="polygon"||G.value.shape==="custom"?(te(),Qt(qe,{key:3,label:"边数",min:3,max:16,step:1,modelValue:G.value.sides,"onUpdate:modelValue":S[26]||(S[26]=C=>G.value.sides=C)},null,8,["modelValue"])):Ue("",!0),E("label",_L,[S[231]||(S[231]=E("span",null,"碰撞响应",-1)),xe(E("select",{"onUpdate:modelValue":S[27]||(S[27]=C=>G.value.response=C),class:"inp"},[...S[230]||(S[230]=[E("option",{value:"physics"},"物理(弹跳/摩擦)",-1),E("option",{value:"pause"},"暂停(停止不动)",-1),E("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[jt,G.value.response]])]),G.value.response==="physics"?(te(),oe("div",ML,[E("label",TL,[S[232]||(S[232]=E("span",null,"弹性 (0-1)",-1)),xe(E("input",{"onUpdate:modelValue":S[28]||(S[28]=C=>G.value.elasticity=C),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[ct,G.value.elasticity,void 0,{number:!0}]])]),E("label",AL,[S[233]||(S[233]=E("span",null,"摩擦 (0-1)",-1)),xe(E("input",{"onUpdate:modelValue":S[29]||(S[29]=C=>G.value.friction=C),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[ct,G.value.friction,void 0,{number:!0}]])])])):Ue("",!0),E("div",EL,[E("label",CL,[xe(E("input",{"onUpdate:modelValue":S[30]||(S[30]=C=>G.value.followPath=C),type:"checkbox"},null,512),[[ti,G.value.followPath]]),S[234]||(S[234]=ai("跟随路径移动",-1))]),G.value.followPath?(te(),oe(Ke,{key:0},[E("label",IL,[S[236]||(S[236]=E("span",null,"目标路径",-1)),xe(E("select",{"onUpdate:modelValue":S[31]||(S[31]=C=>G.value.followPathId=C),class:"inp"},[S[235]||(S[235]=E("option",{value:0},"(未选择)",-1)),(te(!0),oe(Ke,null,ci(ke(e).paths,C=>(te(),oe("option",{key:C.id,value:C.id},je(C.name),9,RL))),128))],512),[[jt,G.value.followPathId,void 0,{number:!0}]])]),E("div",PL,[E("label",kL,[S[237]||(S[237]=E("span",null,"移动时长(秒)",-1)),xe(E("input",{"onUpdate:modelValue":S[32]||(S[32]=C=>G.value.followDuration=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ct,G.value.followDuration,void 0,{number:!0}]])]),E("label",FL,[S[239]||(S[239]=E("span",null,"曲线模式",-1)),xe(E("select",{"onUpdate:modelValue":S[33]||(S[33]=C=>G.value.followCurveMode=C),class:"inp"},[...S[238]||(S[238]=[E("option",null,"跟随导出",-1),E("option",null,"线性",-1),E("option",null,"贝塞尔",-1)])],512),[[jt,G.value.followCurveMode]])])]),E("label",OL,[xe(E("input",{"onUpdate:modelValue":S[34]||(S[34]=C=>G.value.followPathRotation=C),type:"checkbox"},null,512),[[ti,G.value.followPathRotation]]),S[240]||(S[240]=ai("方向沿路径",-1))]),S[241]||(S[241]=E("div",{class:"collider-curve-title"},[ai("移动进度曲线 "),E("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),Ne(gn,{"model-value":G.value.followCurve||K,"default-value":K,mode:A(G.value.followCurveMode),"onUpdate:modelValue":S[35]||(S[35]=C=>G.value.followCurve=C)},null,8,["model-value","mode"])],64)):Ue("",!0)])],64)):j.value?(te(),oe(Ke,{key:2},[S[252]||(S[252]=E("div",{class:"object-editor-title"},"路径属性",-1)),E("label",BL,[S[243]||(S[243]=E("span",null,"路径名称",-1)),xe(E("input",{"onUpdate:modelValue":S[36]||(S[36]=C=>j.value.name=C),class:"inp"},null,512),[[ct,j.value.name]])]),E("div",LL,[E("label",DL,[S[244]||(S[244]=E("span",null,"X 位置",-1)),xe(E("input",{"onUpdate:modelValue":S[37]||(S[37]=C=>j.value.x=C),type:"number",class:"inp"},null,512),[[ct,j.value.x,void 0,{number:!0}]])]),E("label",NL,[S[245]||(S[245]=E("span",null,"Y 位置",-1)),xe(E("input",{"onUpdate:modelValue":S[38]||(S[38]=C=>j.value.y=C),type:"number",class:"inp"},null,512),[[ct,j.value.y,void 0,{number:!0}]])])]),Ne(qe,{label:"旋转",min:-360,max:360,step:1,modelValue:j.value.rotation,"onUpdate:modelValue":S[39]||(S[39]=C=>j.value.rotation=C)},null,8,["modelValue"]),E("div",UL,[E("label",XL,[S[246]||(S[246]=E("span",null,"缩放 X",-1)),xe(E("input",{"onUpdate:modelValue":S[40]||(S[40]=C=>j.value.scaleX=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ct,j.value.scaleX,void 0,{number:!0}]])]),E("label",VL,[S[247]||(S[247]=E("span",null,"缩放 Y",-1)),xe(E("input",{"onUpdate:modelValue":S[41]||(S[41]=C=>j.value.scaleY=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ct,j.value.scaleY,void 0,{number:!0}]])])]),E("label",YL,[S[248]||(S[248]=E("span",null,"闭合路径",-1)),xe(E("input",{"onUpdate:modelValue":S[42]||(S[42]=C=>j.value.closed=C),type:"checkbox"},null,512),[[ti,j.value.closed]])]),E("label",$L,[S[249]||(S[249]=E("span",null,"路径颜色",-1)),xe(E("input",{"onUpdate:modelValue":S[43]||(S[43]=C=>j.value.color=C),type:"color",class:"path-color"},null,512),[[ct,j.value.color]])]),S[253]||(S[253]=to('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),E("label",GL,[S[251]||(S[251]=E("span",null,"应用预设形状",-1)),xe(E("select",{"onUpdate:modelValue":S[44]||(S[44]=C=>j.value.preset=C),class:"inp"},[...S[250]||(S[250]=[to('',5)])],512),[[jt,j.value.preset]])]),E("button",{class:"path-action primary",onClick:Zt},"应用预设"),E("button",{class:"path-action",onClick:St},"清空锚点")],64)):ne.value?(te(),Qt(w3,{key:3,"spine-object":ne.value},null,8,["spine-object"])):(te(),oe("div",HL,"使用右上角按钮创建场景对象"))],512),[[yr,!re.scene]])]),V.value==="particle"&&_.value?(te(),oe(Ke,{key:0},[E("div",jL,[E("div",{class:"group-head",onClick:S[46]||(S[46]=C=>ye("emitMode"))},[E("span",WL,je(re.emitMode?"▸":"▾"),1),S[254]||(S[254]=E("span",null,"发射模式",-1)),E("button",{class:"group-reset",title:"重置发射模式参数",onClick:S[45]||(S[45]=yt(C=>yi("emitMode"),["stop"]))},"重置")]),xe(E("div",zL,[E("div",qL,[E("button",{class:ot(["seg",{on:_.value.config.mode==="stream"}]),onClick:S[47]||(S[47]=C=>he("stream"))},"持续",2),E("button",{class:ot(["seg",{on:_.value.config.mode==="burst"}]),onClick:S[48]||(S[48]=C=>he("burst"))},"爆发",2)]),_.value.config.mode==="stream"?(te(),oe(Ke,{key:0},[E("div",KL,[E("button",{class:ot(["seg",{on:_.value.config.streamBehavior==="normal"}]),onClick:S[49]||(S[49]=C=>Oe("normal"))},"常规持续",2),E("button",{class:ot(["seg",{on:_.value.config.streamBehavior==="loop"}]),onClick:S[50]||(S[50]=C=>Oe("loop"))},"循环持续",2)]),Ne(qe,{label:"发射速率",min:1,max:300,step:1,modelValue:_.value.config.rate,"onUpdate:modelValue":S[51]||(S[51]=C=>_.value.config.rate=C)},null,8,["modelValue"]),_.value.config.streamBehavior==="normal"?(te(),Qt(qe,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:_.value.config.duration,"onUpdate:modelValue":S[52]||(S[52]=C=>_.value.config.duration=C)},null,8,["modelValue"])):(te(),Qt(qe,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":N.value,"onUpdate:modelValue":Xe},null,8,["model-value"])),_.value.config.streamBehavior==="loop"?(te(),oe("div",ZL,[E("div",JL,[E("label",QL,[E("input",{type:"checkbox",checked:_.value.config.generateLoopStartAnimation,onChange:S[53]||(S[53]=C=>it("start",C))},null,40,eD),S[255]||(S[255]=E("span",{class:"switch-ui"},null,-1)),S[256]||(S[256]=E("span",null,"生成开始循环动画",-1))]),_.value.config.generateLoopStartAnimation?(te(),oe("div",tD,[E("label",iD,[E("input",{type:"checkbox",checked:_.value.config.loopStartUseCustomDuration,onChange:S[54]||(S[54]=C=>Ct("start",C))},null,40,sD),S[257]||(S[257]=E("span",{class:"switch-ui"},null,-1)),S[258]||(S[258]=E("span",null,"指定时长",-1))]),E("label",nD,[_.value.config.loopStartUseCustomDuration?(te(),oe("input",{key:0,value:_.value.config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"开始循环段时长",onChange:S[55]||(S[55]=C=>bt("start",C))},null,40,rD)):Ue("",!0),_.value.config.loopStartUseCustomDuration?(te(),oe("span",aD,"f")):(te(),oe("span",oD,"自动 "+je(X.value)+"f",1))])])):Ue("",!0)]),E("div",lD,[E("label",cD,[E("input",{type:"checkbox",checked:_.value.config.generateLoopEndAnimation,onChange:S[56]||(S[56]=C=>it("end",C))},null,40,hD),S[259]||(S[259]=E("span",{class:"switch-ui"},null,-1)),S[260]||(S[260]=E("span",null,"生成结束循环动画",-1))]),_.value.config.generateLoopEndAnimation?(te(),oe("div",uD,[E("label",dD,[E("input",{type:"checkbox",checked:_.value.config.loopEndUseCustomDuration,onChange:S[57]||(S[57]=C=>Ct("end",C))},null,40,fD),S[261]||(S[261]=E("span",{class:"switch-ui"},null,-1)),S[262]||(S[262]=E("span",null,"指定时长",-1))]),E("label",mD,[_.value.config.loopEndUseCustomDuration?(te(),oe("input",{key:0,value:_.value.config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"结束循环段时长",onChange:S[58]||(S[58]=C=>bt("end",C))},null,40,pD)):Ue("",!0),_.value.config.loopEndUseCustomDuration?(te(),oe("span",gD,"f")):(te(),oe("span",vD,"自动 "+je(X.value)+"f",1))])])):Ue("",!0)])])):Ue("",!0),_.value.config.streamBehavior==="loop"?(te(),oe("div",yD,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):Ue("",!0)],64)):(te(),Qt(qe,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:_.value.config.burstCount,"onUpdate:modelValue":S[59]||(S[59]=C=>_.value.config.burstCount=C)},null,8,["modelValue"])),Ne(qe,{label:"延迟时间",min:0,max:5,step:.1,modelValue:_.value.config.delay,"onUpdate:modelValue":S[60]||(S[60]=C=>_.value.config.delay=C)},null,8,["modelValue"])],512),[[yr,!re.emitMode]])]),E("div",xD,[E("div",{class:"group-head",onClick:S[62]||(S[62]=C=>ye("shape"))},[E("span",bD,je(re.shape?"▸":"▾"),1),S[263]||(S[263]=E("span",null,"发射器形状",-1)),E("button",{class:"group-reset",title:"重置发射器形状参数",onClick:S[61]||(S[61]=yt(C=>yi("shape"),["stop"]))},"重置")]),xe(E("div",wD,[E("label",SD,[S[265]||(S[265]=E("span",null,"形状",-1)),xe(E("select",{"onUpdate:modelValue":S[63]||(S[63]=C=>_.value.config.shape=C),class:"inp",onChange:on},[...S[264]||(S[264]=[to('',5)])],544),[[jt,_.value.config.shape]])]),_.value.config.shape==="circle"||_.value.config.shape==="cone"?(te(),oe(Ke,{key:0},[Ne(qe,{label:_.value.config.shape==="cone"?"内径":"内半径",min:0,max:_.value.config.outerRadius,step:1,modelValue:_.value.config.innerRadius,"onUpdate:modelValue":S[64]||(S[64]=C=>_.value.config.innerRadius=C)},null,8,["label","max","modelValue"]),Ne(qe,{label:_.value.config.shape==="cone"?"外径":"外半径",min:_.value.config.innerRadius,max:300,step:1,modelValue:_.value.config.outerRadius,"onUpdate:modelValue":S[65]||(S[65]=C=>_.value.config.outerRadius=C)},null,8,["label","min","modelValue"])],64)):Ue("",!0),_.value.config.shape==="cone"?(te(),oe(Ke,{key:1},[Ne(qe,{label:"锥形朝向",min:-360,max:360,step:1,modelValue:_.value.config.coneDirection,"onUpdate:modelValue":S[66]||(S[66]=C=>_.value.config.coneDirection=C)},null,8,["modelValue"]),Ne(qe,{label:"锥形开口角度",min:1,max:360,step:1,modelValue:_.value.config.coneAngle,"onUpdate:modelValue":S[67]||(S[67]=C=>_.value.config.coneAngle=C)},null,8,["modelValue"])],64)):_.value.config.shape==="rect"?(te(),oe(Ke,{key:2},[Ne(qe,{label:"内宽",min:0,max:_.value.config.outerRectW,step:1,modelValue:_.value.config.innerRectW,"onUpdate:modelValue":S[68]||(S[68]=C=>_.value.config.innerRectW=C)},null,8,["max","modelValue"]),Ne(qe,{label:"内高",min:0,max:_.value.config.outerRectH,step:1,modelValue:_.value.config.innerRectH,"onUpdate:modelValue":S[69]||(S[69]=C=>_.value.config.innerRectH=C)},null,8,["max","modelValue"]),Ne(qe,{label:"外宽",min:_.value.config.innerRectW,max:400,step:1,modelValue:_.value.config.outerRectW,"onUpdate:modelValue":S[70]||(S[70]=C=>_.value.config.outerRectW=C)},null,8,["min","modelValue"]),Ne(qe,{label:"外高",min:_.value.config.innerRectH,max:400,step:1,modelValue:_.value.config.outerRectH,"onUpdate:modelValue":S[71]||(S[71]=C=>_.value.config.outerRectH=C)},null,8,["min","modelValue"])],64)):_.value.config.shape==="path"?(te(),oe(Ke,{key:3},[E("label",_D,[S[267]||(S[267]=E("span",null,"选择路径",-1)),xe(E("select",{"onUpdate:modelValue":S[72]||(S[72]=C=>_.value.config.spawnPathId=C),class:"inp",onChange:Wi},[S[266]||(S[266]=E("option",{value:0},"无路径(点发射)",-1)),(te(!0),oe(Ke,null,ci(ke(e).paths,C=>(te(),oe("option",{key:C.id,value:C.id,disabled:!C.enabled},je(C.name),9,MD))),128))],544),[[jt,_.value.config.spawnPathId,void 0,{number:!0}]])]),_.value.config.spawnPathId>0?(te(),oe("label",TD,[S[269]||(S[269]=E("span",null,"出生分布",-1)),xe(E("select",{"onUpdate:modelValue":S[73]||(S[73]=C=>_.value.config.spawnPathDistribution=C),class:"inp"},[...S[268]||(S[268]=[E("option",{value:"fixed"},"等间距固定分布",-1),E("option",{value:"random"},"随机分布",-1)])],512),[[jt,_.value.config.spawnPathDistribution]])])):Ue("",!0)],64)):Ue("",!0),S[273]||(S[273]=E("div",{class:"divider"},null,-1)),E("label",AD,[S[272]||(S[272]=E("span",null,"发射角度",-1)),xe(E("select",{"onUpdate:modelValue":S[74]||(S[74]=C=>_.value.config.emissionAngleMode=C),class:"inp"},[S[270]||(S[270]=E("option",{value:"fixed"},"固定",-1)),S[271]||(S[271]=E("option",{value:"random"},"随机",-1)),_.value.config.shape==="circle"||_.value.config.shape==="rect"||_.value.config.shape==="cone"?(te(),oe("option",ED,"径向(中心向外)")):Ue("",!0),_.value.config.shape==="path"&&_.value.config.spawnPathId>0?(te(),oe("option",CD,"垂直于路径")):Ue("",!0),_.value.config.shape==="path"&&_.value.config.spawnPathId>0?(te(),oe("option",ID,"沿路径方向")):Ue("",!0)],512),[[jt,_.value.config.emissionAngleMode]])]),_.value.config.emissionAngleMode==="fixed"?(te(),Qt(qe,{key:4,label:"固定角度",min:-360,max:360,step:1,modelValue:_.value.config.direction,"onUpdate:modelValue":S[75]||(S[75]=C=>_.value.config.direction=C)},null,8,["modelValue"])):_.value.config.emissionAngleMode==="random"?(te(),oe(Ke,{key:5},[Ne(qe,{label:"基准角度",min:-360,max:360,step:1,modelValue:_.value.config.direction,"onUpdate:modelValue":S[76]||(S[76]=C=>_.value.config.direction=C)},null,8,["modelValue"]),Ne(qe,{label:"随机范围",min:0,max:360,step:1,modelValue:_.value.config.spread,"onUpdate:modelValue":S[77]||(S[77]=C=>_.value.config.spread=C)},null,8,["modelValue"])],64)):Ue("",!0)],512),[[yr,!re.shape]])]),E("div",RD,[E("div",{class:"group-head",onClick:S[79]||(S[79]=C=>ye("attr"))},[E("span",PD,je(re.attr?"▸":"▾"),1),S[274]||(S[274]=E("span",null,"粒子属性",-1)),E("button",{class:"group-reset",title:"重置粒子属性参数",onClick:S[78]||(S[78]=yt(C=>yi("attr"),["stop"]))},"重置")]),xe(E("div",kD,[S[282]||(S[282]=E("div",{class:"attr-section-title"},"粒子初始参数",-1)),Ne($n,{label:"初始生命周期","allow-curve":!1,mode:_.value.config.lifeMode,"onUpdate:mode":S[80]||(S[80]=C=>_.value.config.lifeMode=C),"value-min":_.value.config.lifeMin,"onUpdate:valueMin":S[81]||(S[81]=C=>_.value.config.lifeMin=C),"value-max":_.value.config.lifeMax,"onUpdate:valueMax":S[82]||(S[82]=C=>_.value.config.lifeMax=C),curve:_.value.config.lifeCurve,"onUpdate:curve":S[83]||(S[83]=C=>_.value.config.lifeCurve=C),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),Ne($n,{label:"初始速度","allow-curve":!1,mode:_.value.config.speedMode,"onUpdate:mode":S[84]||(S[84]=C=>_.value.config.speedMode=C),"value-min":_.value.config.speedMin,"onUpdate:valueMin":S[85]||(S[85]=C=>_.value.config.speedMin=C),"value-max":_.value.config.speedMax,"onUpdate:valueMax":S[86]||(S[86]=C=>_.value.config.speedMax=C),curve:_.value.config.speedCurve,"onUpdate:curve":S[87]||(S[87]=C=>_.value.config.speedCurve=C),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),E("div",FD,[S[275]||(S[275]=E("span",null,"初始缩放",-1)),E("div",OD,[E("button",{class:ot(["axis-mode",{on:_.value.config.scaleAxisMode==="uniform"}]),onClick:S[88]||(S[88]=C=>_.value.config.scaleAxisMode="uniform")},"统一",2),E("button",{class:ot(["axis-mode",{on:_.value.config.scaleAxisMode==="separate"}]),onClick:S[89]||(S[89]=C=>_.value.config.scaleAxisMode="separate")},"XY分离",2)])]),Ne($n,{label:_.value.config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:_.value.config.scaleMode,"onUpdate:mode":S[90]||(S[90]=C=>_.value.config.scaleMode=C),"value-min":_.value.config.scaleMin,"onUpdate:valueMin":S[91]||(S[91]=C=>_.value.config.scaleMin=C),"value-max":_.value.config.scaleMax,"onUpdate:valueMax":S[92]||(S[92]=C=>_.value.config.scaleMax=C),curve:_.value.config.scaleCurve,"onUpdate:curve":S[93]||(S[93]=C=>_.value.config.scaleCurve=C),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),_.value.config.scaleAxisMode==="separate"?(te(),Qt($n,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:_.value.config.scaleMode,"onUpdate:mode":S[94]||(S[94]=C=>_.value.config.scaleMode=C),"value-min":_.value.config.scaleYMin,"onUpdate:valueMin":S[95]||(S[95]=C=>_.value.config.scaleYMin=C),"value-max":_.value.config.scaleYMax,"onUpdate:valueMax":S[96]||(S[96]=C=>_.value.config.scaleYMax=C),curve:_.value.config.scaleYCurve,"onUpdate:curve":S[97]||(S[97]=C=>_.value.config.scaleYCurve=C),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):Ue("",!0),Ne($n,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:_.value.config.initialRotationMode,"onUpdate:mode":S[98]||(S[98]=C=>_.value.config.initialRotationMode=C),"value-min":_.value.config.initialRotationMin,"onUpdate:valueMin":S[99]||(S[99]=C=>_.value.config.initialRotationMin=C),"value-max":_.value.config.initialRotationMax,"onUpdate:valueMax":S[100]||(S[100]=C=>_.value.config.initialRotationMax=C),curve:_.value.config.initialRotationCurve,"onUpdate:curve":S[101]||(S[101]=C=>_.value.config.initialRotationCurve=C),min:-360,max:360,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),S[283]||(S[283]=E("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),E("div",BD,[E("label",LD,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[102]||(S[102]=C=>_.value.config.speedOverLifeEnabled=C)},null,512),[[ti,_.value.config.speedOverLifeEnabled]]),S[276]||(S[276]=E("span",{class:"switch-ui"},null,-1)),S[277]||(S[277]=E("span",null,"生命周期内速度",-1))]),_.value.config.speedOverLifeEnabled?(te(),Qt($n,{key:0,label:"速度倍率",mode:_.value.config.speedOverLifeMode,"onUpdate:mode":Ds,"value-min":_.value.config.speedOverLifeMin,"onUpdate:valueMin":S[103]||(S[103]=C=>_.value.config.speedOverLifeMin=C),"value-max":_.value.config.speedOverLifeMax,"onUpdate:valueMax":S[104]||(S[104]=C=>_.value.config.speedOverLifeMax=C),curve:_.value.config.speedOverLifeCurve,"onUpdate:curve":S[105]||(S[105]=C=>_.value.config.speedOverLifeCurve=C),"default-curve":q,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):Ue("",!0)]),E("div",DD,[E("label",ND,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[106]||(S[106]=C=>_.value.config.scaleOverLifeEnabled=C),onChange:Li},null,544),[[ti,_.value.config.scaleOverLifeEnabled]]),S[278]||(S[278]=E("span",{class:"switch-ui"},null,-1)),S[279]||(S[279]=E("span",null,"生命周期内缩放",-1))]),_.value.config.scaleOverLifeEnabled?(te(),oe(Ke,{key:0},[E("div",UD,[E("button",{class:ot(["axis-mode",{on:_.value.config.scaleOverLifeAxisMode==="uniform"}]),onClick:S[107]||(S[107]=C=>_.value.config.scaleOverLifeAxisMode="uniform")},"统一",2),E("button",{class:ot(["axis-mode",{on:_.value.config.scaleOverLifeAxisMode==="separate"}]),onClick:S[108]||(S[108]=C=>_.value.config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),Ne($n,{label:_.value.config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:_.value.config.scaleOverLifeMode,"onUpdate:mode":Ts,"value-min":_.value.config.scaleOverLifeMin,"onUpdate:valueMin":S[109]||(S[109]=C=>_.value.config.scaleOverLifeMin=C),"value-max":_.value.config.scaleOverLifeMax,"onUpdate:valueMax":S[110]||(S[110]=C=>_.value.config.scaleOverLifeMax=C),curve:_.value.config.scaleOverLifeCurve,"onUpdate:curve":S[111]||(S[111]=C=>_.value.config.scaleOverLifeCurve=C),"default-curve":q,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","value-min","value-max","curve"]),_.value.config.scaleOverLifeAxisMode==="separate"?(te(),Qt($n,{key:0,label:"倍率 Y","show-modes":!1,mode:_.value.config.scaleOverLifeMode,"onUpdate:mode":S[112]||(S[112]=C=>_.value.config.scaleOverLifeMode=C),"value-min":_.value.config.scaleYOverLifeMin,"onUpdate:valueMin":S[113]||(S[113]=C=>_.value.config.scaleYOverLifeMin=C),"value-max":_.value.config.scaleYOverLifeMax,"onUpdate:valueMax":S[114]||(S[114]=C=>_.value.config.scaleYOverLifeMax=C),curve:_.value.config.scaleYOverLifeCurve,"onUpdate:curve":S[115]||(S[115]=C=>_.value.config.scaleYOverLifeCurve=C),"default-curve":q,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):Ue("",!0)],64)):Ue("",!0)]),E("div",XD,[E("label",VD,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[116]||(S[116]=C=>_.value.config.rotationOverLifeEnabled=C)},null,512),[[ti,_.value.config.rotationOverLifeEnabled]]),S[280]||(S[280]=E("span",{class:"switch-ui"},null,-1)),S[281]||(S[281]=E("span",null,"生命周期内旋转",-1))]),_.value.config.rotationOverLifeEnabled?(te(),Qt($n,{key:0,label:"旋转速度",mode:_.value.config.rotationOverLifeMode,"onUpdate:mode":S[117]||(S[117]=C=>_.value.config.rotationOverLifeMode=C),"value-min":_.value.config.rotationSpeedMin,"onUpdate:valueMin":S[118]||(S[118]=C=>_.value.config.rotationSpeedMin=C),"value-max":_.value.config.rotationSpeedMax,"onUpdate:valueMax":S[119]||(S[119]=C=>_.value.config.rotationSpeedMax=C),curve:_.value.config.rotationOverLifeCurve,"onUpdate:curve":S[120]||(S[120]=C=>_.value.config.rotationOverLifeCurve=C),"default-curve":K,min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):Ue("",!0)])],512),[[yr,!re.attr]])]),E("div",YD,[E("div",{class:"group-head",onClick:S[122]||(S[122]=C=>ye("look"))},[E("span",$D,je(re.look?"▸":"▾"),1),S[284]||(S[284]=E("span",null,"外观与资源",-1)),E("button",{class:"group-reset",title:"重置外观与资源参数",onClick:S[121]||(S[121]=yt(C=>yi("look"),["stop"]))},"重置")]),xe(E("div",GD,[S[298]||(S[298]=E("div",{class:"look-title"},"透明度",-1)),E("div",HD,[E("button",{class:ot(["seg-btn",{active:_.value.config.alphaMode==="curve"}]),onClick:S[123]||(S[123]=C=>_.value.config.alphaMode="curve")},"曲线",2),E("button",{class:ot(["seg-btn",{active:_.value.config.alphaMode==="fixed"}]),onClick:S[124]||(S[124]=C=>_.value.config.alphaMode="fixed")},"固定",2)]),_.value.config.alphaMode==="fixed"?(te(),Qt(qe,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:_.value.config.alpha,"onUpdate:modelValue":S[125]||(S[125]=C=>_.value.config.alpha=C)},null,8,["modelValue"])):(te(),oe(Ke,{key:1},[E("label",jD,[S[286]||(S[286]=E("span",null,"曲线模式",-1)),xe(E("select",{"onUpdate:modelValue":S[126]||(S[126]=C=>_.value.config.curveMode=C),class:"inp"},[...S[285]||(S[285]=[E("option",null,"跟随导出",-1),E("option",null,"线性",-1),E("option",null,"贝塞尔",-1)])],512),[[jt,_.value.config.curveMode]])]),E("div",WD,[Ne(gn,{modelValue:_.value.config.alphaCurve,"onUpdate:modelValue":S[127]||(S[127]=C=>_.value.config.alphaCurve=C),"default-value":z,mode:A(_.value.config.curveMode)},null,8,["modelValue","mode"]),S[287]||(S[287]=E("div",{class:"curve-labels"},[E("span",null,"0(透明)"),E("span",null,"生命周期 →"),E("span",null,"1(不透明)")],-1))])],64)),E("div",{class:"look-title image-title"},[S[288]||(S[288]=E("span",null,"图片资源",-1)),E("button",{class:"image-add",title:"新增图片资源",onClick:be},"+")]),(te(!0),oe(Ke,null,ci(_.value.config.imageResources,C=>(te(),Qt(qv,{key:C.id,resource:C,"resource-count":_.value.config.imageResources.length,"supports-sequence":"","default-file":"star.png",onPick:Le,onPickSequence:Ce,onReset:nt,onRemove:Se,onUpdateWeight:Jt,onToggleLock:Mi},{default:ah(()=>[Ne(qe,{label:"缩放",min:.1,max:3,step:.05,modelValue:C.scale,"onUpdate:modelValue":Z=>C.scale=Z},null,8,["modelValue","onUpdate:modelValue"]),E("label",zD,[S[289]||(S[289]=E("span",null,"轴心 x,y",-1)),xe(E("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":Z=>C.anchorX=Z},null,8,qD),[[ct,C.anchorX,void 0,{number:!0}]]),xe(E("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":Z=>C.anchorY=Z},null,8,KD),[[ct,C.anchorY,void 0,{number:!0}]])]),S[297]||(S[297]=E("div",{class:"resource-divider"},null,-1)),E("label",ZD,[S[292]||(S[292]=E("span",null,"颜色",-1)),xe(E("select",{"onUpdate:modelValue":Z=>C.colorMode=Z,class:"inp"},[...S[290]||(S[290]=[E("option",{value:"fixed"},"固定色",-1),E("option",{value:"random"},"随机颜色",-1),E("option",{value:"lifetime"},"生命周期",-1)])],8,JD),[[jt,C.colorMode]]),xe(E("select",{"onUpdate:modelValue":Z=>C.blend=Z,class:"inp blend-select"},[...S[291]||(S[291]=[E("option",{value:"normal"},"正常",-1),E("option",{value:"add"},"相加",-1),E("option",{value:"multiply"},"相乘",-1),E("option",{value:"screen"},"滤色",-1)])],8,QD),[[jt,C.blend]])]),C.colorMode==="fixed"?(te(),oe("label",eN,[S[293]||(S[293]=E("span",null,"固定色",-1)),xe(E("input",{type:"color","onUpdate:modelValue":Z=>C.colorStart=Z,class:"colr"},null,8,tN),[[ct,C.colorStart]]),E("input",{type:"text",class:"hex-input",value:C.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:Z=>rt(C,Z),onKeydown:Aa(Z=>Qe(C,Z),["enter"])},null,40,iN)])):(te(),oe(Ke,{key:1},[Ne(zv,{modelValue:C.colorGradient,"onUpdate:modelValue":Z=>C.colorGradient=Z},null,8,["modelValue","onUpdate:modelValue"]),C.colorMode==="random"?(te(),oe("div",sN,"每个粒子出生时从色带随机取色,生命周期内保持不变")):Ue("",!0)],64)),E("div",nN,[S[294]||(S[294]=E("span",null,"独立透明度",-1)),E("div",rN,[E("button",{class:ot({on:C.independentAlpha==="off"}),onClick:Z=>C.independentAlpha="off"},"关闭",10,aN),E("button",{class:ot({on:C.independentAlpha==="fixed"}),onClick:Z=>C.independentAlpha="fixed"},"固定",10,oN),E("button",{class:ot({on:C.independentAlpha==="curve"}),onClick:Z=>C.independentAlpha="curve"},"曲线",10,lN)])]),C.independentAlpha==="fixed"?(te(),Qt(qe,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:C.alpha,"onUpdate:modelValue":Z=>C.alpha=Z},null,8,["modelValue","onUpdate:modelValue"])):C.independentAlpha==="curve"?(te(),oe(Ke,{key:3},[E("label",cN,[S[296]||(S[296]=E("span",null,"曲线模式",-1)),xe(E("select",{"onUpdate:modelValue":Z=>C.alphaCurveMode=Z,class:"inp"},[...S[295]||(S[295]=[E("option",null,"跟随导出",-1),E("option",null,"线性",-1),E("option",null,"贝塞尔",-1)])],8,hN),[[jt,C.alphaCurveMode]])]),E("div",uN,[Ne(gn,{modelValue:C.alphaCurve,"onUpdate:modelValue":Z=>C.alphaCurve=Z,"default-value":ee,mode:A(C.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","mode"])])],64)):Ue("",!0)]),_:2},1032,["resource","resource-count"]))),128)),E("input",{ref_key:"textureFileInput",ref:Kr,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:Be},null,544),E("input",{ref_key:"sequenceFileInput",ref:Zr,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:Te},null,544)],512),[[yr,!re.look]])]),E("div",dN,[E("div",{class:"group-head",onClick:S[129]||(S[129]=C=>ye("mods"))},[E("span",fN,je(re.mods?"▸":"▾"),1),S[299]||(S[299]=E("span",null,"修改器",-1)),E("button",{class:"group-reset",title:"重置修改器参数",onClick:S[128]||(S[128]=yt(C=>yi("mods"),["stop"]))},"重置")]),xe(E("div",mN,[E("div",pN,[E("label",gN,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[130]||(S[130]=C=>_.value.config.noise=C)},null,512),[[ti,_.value.config.noise]]),S[300]||(S[300]=E("span",{class:"switch-ui"},null,-1)),S[301]||(S[301]=E("span",null,"开启移动噪声",-1))]),_.value.config.noise?(te(),oe("div",vN,[Ne(qe,{label:"强度",min:0,max:100,step:1,modelValue:_.value.config.noiseAmt,"onUpdate:modelValue":S[131]||(S[131]=C=>_.value.config.noiseAmt=C)},null,8,["modelValue"]),Ne(qe,{label:"波动范围",min:0,max:500,step:1,modelValue:_.value.config.noiseRange,"onUpdate:modelValue":S[132]||(S[132]=C=>_.value.config.noiseRange=C)},null,8,["modelValue"]),Ne(qe,{label:"时间流速",min:0,max:10,step:.1,modelValue:_.value.config.noiseSpeed,"onUpdate:modelValue":S[133]||(S[133]=C=>_.value.config.noiseSpeed=C)},null,8,["modelValue"]),S[302]||(S[302]=E("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):Ue("",!0)]),E("div",yN,[E("label",xN,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[134]||(S[134]=C=>_.value.config.useGravity=C)},null,512),[[ti,_.value.config.useGravity]]),S[303]||(S[303]=E("span",{class:"switch-ui"},null,-1)),S[304]||(S[304]=E("span",null,"开启重力",-1))]),_.value.config.useGravity?(te(),oe("div",bN,[E("div",wN,[E("button",{class:ot(["axis-mode",{on:_.value.config.gravityMode==="fixed"}]),onClick:S[135]||(S[135]=C=>_.value.config.gravityMode="fixed")},"固定",2),E("button",{class:ot(["axis-mode",{on:_.value.config.gravityMode==="random"}]),onClick:S[136]||(S[136]=C=>_.value.config.gravityMode="random")},"随机",2)]),_.value.config.gravityMode==="fixed"?(te(),Qt(qe,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:_.value.config.gravityMin,"onUpdate:modelValue":S[137]||(S[137]=C=>_.value.config.gravityMin=C)},null,8,["modelValue"])):(te(),oe(Ke,{key:1},[Ne(qe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:_.value.config.gravityMin,"onUpdate:modelValue":S[138]||(S[138]=C=>_.value.config.gravityMin=C)},null,8,["modelValue"]),Ne(qe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:_.value.config.gravityMax,"onUpdate:modelValue":S[139]||(S[139]=C=>_.value.config.gravityMax=C)},null,8,["modelValue"])],64)),Ne(qe,{label:"方向",min:-360,max:360,step:1,modelValue:_.value.config.gravityDirection,"onUpdate:modelValue":S[140]||(S[140]=C=>_.value.config.gravityDirection=C)},null,8,["modelValue"]),S[305]||(S[305]=E("div",{class:"gravity-curve-title"},[E("span",null,"生命周期内重力"),E("span",null,"纵轴:强度 0~1")],-1)),Ne(gn,{modelValue:_.value.config.gravityCurve,"onUpdate:modelValue":S[141]||(S[141]=C=>_.value.config.gravityCurve=C),"default-value":q},null,8,["modelValue"]),S[306]||(S[306]=E("div",{class:"gravity-curve-axis"},[E("span",null,"0"),E("span",null,"生命周期 →"),E("span",null,"1")],-1)),S[307]||(S[307]=E("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Ue("",!0)]),E("div",SN,[E("label",_N,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[142]||(S[142]=C=>_.value.config.wind=C)},null,512),[[ti,_.value.config.wind]]),S[308]||(S[308]=E("span",{class:"switch-ui"},null,-1)),S[309]||(S[309]=E("span",null,"开启风力",-1))]),_.value.config.wind?(te(),oe("div",MN,[E("div",TN,[E("button",{class:ot(["axis-mode",{on:_.value.config.windMode==="fixed"}]),onClick:S[143]||(S[143]=C=>_.value.config.windMode="fixed")},"固定",2),E("button",{class:ot(["axis-mode",{on:_.value.config.windMode==="random"}]),onClick:S[144]||(S[144]=C=>_.value.config.windMode="random")},"随机",2)]),_.value.config.windMode==="fixed"?(te(),Qt(qe,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:_.value.config.windMin,"onUpdate:modelValue":S[145]||(S[145]=C=>_.value.config.windMin=C)},null,8,["modelValue"])):(te(),oe(Ke,{key:1},[Ne(qe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:_.value.config.windMin,"onUpdate:modelValue":S[146]||(S[146]=C=>_.value.config.windMin=C)},null,8,["modelValue"]),Ne(qe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:_.value.config.windMax,"onUpdate:modelValue":S[147]||(S[147]=C=>_.value.config.windMax=C)},null,8,["modelValue"])],64)),Ne(qe,{label:"方向",min:-360,max:360,step:1,modelValue:_.value.config.windDirection,"onUpdate:modelValue":S[148]||(S[148]=C=>_.value.config.windDirection=C)},null,8,["modelValue"]),S[310]||(S[310]=E("div",{class:"gravity-curve-title"},[E("span",null,"生命周期内风力"),E("span",null,"纵轴:强度 0~1")],-1)),Ne(gn,{modelValue:_.value.config.windCurve,"onUpdate:modelValue":S[149]||(S[149]=C=>_.value.config.windCurve=C),"default-value":q},null,8,["modelValue"]),S[311]||(S[311]=E("div",{class:"gravity-curve-axis"},[E("span",null,"0"),E("span",null,"生命周期 →"),E("span",null,"1")],-1)),S[312]||(S[312]=E("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Ue("",!0)]),E("div",AN,[E("label",EN,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[150]||(S[150]=C=>_.value.config.forceField=C)},null,512),[[ti,_.value.config.forceField]]),S[313]||(S[313]=E("span",{class:"switch-ui"},null,-1)),S[314]||(S[314]=E("span",null,"开启力场",-1))]),_.value.config.forceField?(te(),oe("div",CN,[Ne(qe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:_.value.config.forceCenterX,"onUpdate:modelValue":S[151]||(S[151]=C=>_.value.config.forceCenterX=C)},null,8,["modelValue"]),Ne(qe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:_.value.config.forceCenterY,"onUpdate:modelValue":S[152]||(S[152]=C=>_.value.config.forceCenterY=C)},null,8,["modelValue"]),Ne(qe,{label:"力场强度",min:-300,max:300,step:1,modelValue:_.value.config.forceStrength,"onUpdate:modelValue":S[153]||(S[153]=C=>_.value.config.forceStrength=C)},null,8,["modelValue"]),Ne(qe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:_.value.config.forceRadius,"onUpdate:modelValue":S[154]||(S[154]=C=>_.value.config.forceRadius=C)},null,8,["modelValue"]),E("label",IN,[S[316]||(S[316]=E("span",null,"衰减模式",-1)),xe(E("select",{"onUpdate:modelValue":S[155]||(S[155]=C=>_.value.config.forceFalloff=C),class:"inp"},[...S[315]||(S[315]=[E("option",{value:"constant"},"恒定(范围内力度不变)",-1),E("option",{value:"linear"},"线性衰减(边缘为 0)",-1),E("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[jt,_.value.config.forceFalloff]])]),S[317]||(S[317]=E("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1))])):Ue("",!0)]),E("div",RN,[E("label",PN,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[156]||(S[156]=C=>_.value.config.attraction=C)},null,512),[[ti,_.value.config.attraction]]),S[318]||(S[318]=E("span",{class:"switch-ui"},null,-1)),S[319]||(S[319]=E("span",null,"开启吸附",-1))]),_.value.config.attraction?(te(),oe("div",kN,[Ne(qe,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:_.value.config.attractionCenterX,"onUpdate:modelValue":S[157]||(S[157]=C=>_.value.config.attractionCenterX=C)},null,8,["modelValue"]),Ne(qe,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:_.value.config.attractionCenterY,"onUpdate:modelValue":S[158]||(S[158]=C=>_.value.config.attractionCenterY=C)},null,8,["modelValue"]),Ne(qe,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:_.value.config.attractionRadius,"onUpdate:modelValue":S[159]||(S[159]=C=>_.value.config.attractionRadius=C)},null,8,["modelValue"]),Ne(qe,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:_.value.config.attractionDuration,"onUpdate:modelValue":S[160]||(S[160]=C=>_.value.config.attractionDuration=C)},null,8,["modelValue"]),Ne(qe,{label:"延迟时间",min:0,max:30,step:.05,modelValue:_.value.config.attractionDelay,"onUpdate:modelValue":S[161]||(S[161]=C=>_.value.config.attractionDelay=C)},null,8,["modelValue"]),E("label",FN,[S[321]||(S[321]=E("span",null,"延迟方式",-1)),xe(E("select",{"onUpdate:modelValue":S[162]||(S[162]=C=>_.value.config.attractionDelayMode=C),class:"inp"},[...S[320]||(S[320]=[E("option",{value:"global"},"统一时间",-1),E("option",{value:"particle"},"单粒子生命",-1)])],512),[[jt,_.value.config.attractionDelayMode]])]),E("label",ON,[S[323]||(S[323]=E("span",null,"吸附方式",-1)),xe(E("select",{"onUpdate:modelValue":S[163]||(S[163]=C=>_.value.config.attractionPath=C),class:"inp"},[...S[322]||(S[322]=[E("option",{value:"linear"},"直线",-1),E("option",{value:"curve"},"曲线",-1)])],512),[[jt,_.value.config.attractionPath]])]),S[324]||(S[324]=E("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1))])):Ue("",!0)]),E("div",BN,[E("label",LN,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[164]||(S[164]=C=>_.value.config.trail=C)},null,512),[[ti,_.value.config.trail]]),S[325]||(S[325]=E("span",{class:"switch-ui"},null,-1)),S[326]||(S[326]=E("span",null,"开启拖尾",-1))]),_.value.config.trail?(te(),oe("div",DN,[E("div",{class:"trail-section-head"},[S[327]||(S[327]=E("div",{class:"trail-section-title"},"拖尾独立图片",-1)),E("button",{class:"image-add",title:"增加拖尾图片资源",onClick:Nn},"+")]),(te(!0),oe(Ke,null,ci(_.value.config.trailResources,C=>(te(),Qt(qv,{key:C.id,resource:C,"resource-count":_.value.config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:Jr,onReset:Y,onRemove:J,onUpdateWeight:ue,onToggleLock:pe},{default:ah(()=>[S[343]||(S[343]=E("div",{class:"resource-divider"},null,-1)),Ne(qe,{label:"旋转",min:-360,max:360,step:1,"model-value":C.rotation,"onUpdate:modelValue":Z=>Qr(C.id,Z)},null,8,["model-value","onUpdate:modelValue"]),Ne(qe,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":C.boneCount,"onUpdate:modelValue":Z=>$a(C.id,Z)},null,8,["model-value","onUpdate:modelValue"]),Ne(qe,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:C.trailRatio,"onUpdate:modelValue":Z=>C.trailRatio=Z},null,8,["modelValue","onUpdate:modelValue"]),E("label",NN,[S[329]||(S[329]=E("span",null,"拖尾长度",-1)),xe(E("select",{"onUpdate:modelValue":Z=>C.lengthMode=Z,class:"inp"},[...S[328]||(S[328]=[E("option",{value:"fixed"},"固定",-1),E("option",{value:"random"},"随机范围",-1)])],8,UN),[[jt,C.lengthMode]])]),C.lengthMode==="fixed"?(te(),Qt(qe,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:C.length,"onUpdate:modelValue":Z=>C.length=Z},null,8,["modelValue","onUpdate:modelValue"])):(te(),oe(Ke,{key:1},[Ne(qe,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:C.lengthMin,"onUpdate:modelValue":Z=>C.lengthMin=Z},null,8,["modelValue","onUpdate:modelValue"]),Ne(qe,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:C.lengthMax,"onUpdate:modelValue":Z=>C.lengthMax=Z},null,8,["modelValue","onUpdate:modelValue"])],64)),E("label",XN,[S[331]||(S[331]=E("span",null,"拖尾宽度",-1)),xe(E("select",{"onUpdate:modelValue":Z=>C.widthSizeMode=Z,class:"inp"},[...S[330]||(S[330]=[E("option",{value:"fixed"},"固定",-1),E("option",{value:"random"},"随机范围",-1)])],8,VN),[[jt,C.widthSizeMode]])]),C.widthSizeMode==="fixed"?(te(),Qt(qe,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:C.width,"onUpdate:modelValue":Z=>C.width=Z},null,8,["modelValue","onUpdate:modelValue"])):(te(),oe(Ke,{key:3},[Ne(qe,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:C.widthMin,"onUpdate:modelValue":Z=>C.widthMin=Z},null,8,["modelValue","onUpdate:modelValue"]),Ne(qe,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:C.widthMax,"onUpdate:modelValue":Z=>C.widthMax=Z},null,8,["modelValue","onUpdate:modelValue"])],64)),E("label",YN,[S[333]||(S[333]=E("span",null,"宽度缩放",-1)),xe(E("select",{"onUpdate:modelValue":Z=>C.widthMode=Z,class:"inp"},[...S[332]||(S[332]=[E("option",{value:"particle"},"跟随粒子",-1),E("option",{value:"fixed"},"固定",-1)])],8,$N),[[jt,C.widthMode]])]),E("label",GN,[xe(E("input",{type:"checkbox","onUpdate:modelValue":Z=>C.lifeLengthEnabled=Z},null,8,HN),[[ti,C.lifeLengthEnabled]]),S[334]||(S[334]=E("span",{class:"switch-ui"},null,-1)),S[335]||(S[335]=E("span",null,"生命周期长度曲线",-1))]),C.lifeLengthEnabled?(te(),Qt(gn,{key:4,modelValue:C.lifeLengthCurve,"onUpdate:modelValue":Z=>C.lifeLengthCurve=Z,"default-value":q},null,8,["modelValue","onUpdate:modelValue"])):Ue("",!0),E("label",jN,[xe(E("input",{type:"checkbox","onUpdate:modelValue":Z=>C.shapeEnabled=Z},null,8,WN),[[ti,C.shapeEnabled]]),S[336]||(S[336]=E("span",{class:"switch-ui"},null,-1)),S[337]||(S[337]=E("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),C.shapeEnabled?(te(),Qt(gn,{key:5,modelValue:C.shapeCurve,"onUpdate:modelValue":Z=>C.shapeCurve=Z,"default-value":ve},null,8,["modelValue","onUpdate:modelValue"])):Ue("",!0),E("div",zN,[S[338]||(S[338]=E("span",null,"颜色模式",-1)),E("div",qN,[E("button",{class:ot(["axis-mode",{on:C.colorMode==="particle"}]),onClick:Z=>C.colorMode="particle"},"跟随粒子",10,KN),E("button",{class:ot(["axis-mode",{on:C.colorMode==="fixed"}]),onClick:Z=>C.colorMode="fixed"},"固定",10,ZN),E("button",{class:ot(["axis-mode",{on:C.colorMode==="curve"}]),onClick:Z=>C.colorMode="curve"},"曲线",10,JN)])]),E("label",QN,[S[340]||(S[340]=E("span",null,"混合模式",-1)),xe(E("select",{"onUpdate:modelValue":Z=>C.blend=Z,class:"inp"},[...S[339]||(S[339]=[E("option",{value:"normal"},"正常",-1),E("option",{value:"add"},"相加",-1),E("option",{value:"multiply"},"相乘",-1),E("option",{value:"screen"},"滤色",-1)])],8,e4),[[jt,C.blend]])]),C.colorMode==="fixed"?(te(),oe("label",t4,[S[341]||(S[341]=E("span",null,"固定颜色",-1)),xe(E("input",{class:"colr",type:"color","onUpdate:modelValue":Z=>C.color=Z},null,8,i4),[[ct,C.color]]),E("input",{class:"hex-input",value:C.color,onChange:Z=>_e(C,Z),onKeydown:Aa(yt(Z=>Me(C,Z),["prevent"]),["enter"])},null,40,s4)])):C.colorMode==="curve"?(te(),Qt(zv,{key:7,modelValue:C.colorGradient,"onUpdate:modelValue":Z=>C.colorGradient=Z},null,8,["modelValue","onUpdate:modelValue"])):Ue("",!0),E("div",n4,[S[342]||(S[342]=E("span",null,"透明度模式",-1)),E("div",r4,[E("button",{class:ot(["axis-mode",{on:C.alphaMode==="particle"}]),onClick:Z=>C.alphaMode="particle"},"跟随粒子",10,a4),E("button",{class:ot(["axis-mode",{on:C.alphaMode==="fixed"}]),onClick:Z=>C.alphaMode="fixed"},"固定",10,o4),E("button",{class:ot(["axis-mode",{on:C.alphaMode==="curve"}]),onClick:Z=>C.alphaMode="curve"},"曲线",10,l4)])]),C.alphaMode==="fixed"?(te(),Qt(qe,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:C.alpha,"onUpdate:modelValue":Z=>C.alpha=Z},null,8,["modelValue","onUpdate:modelValue"])):Ue("",!0),C.alphaMode==="curve"?(te(),Qt(gn,{key:9,modelValue:C.alphaCurve,"onUpdate:modelValue":Z=>C.alphaCurve=Z,"default-value":le},null,8,["modelValue","onUpdate:modelValue"])):Ue("",!0)]),_:2},1032,["resource","resource-count"]))),128)),E("input",{ref_key:"trailTextureFileInput",ref:ln,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:W},null,544),E("div",c4,[Ne(qe,{label:"网格行数",min:2,max:16,step:1,"model-value":_.value.config.trailGridRows,"onUpdate:modelValue":S[165]||(S[165]=C=>Us("trailGridRows",C))},null,8,["model-value"]),Ne(qe,{label:"网格列数",min:2,max:32,step:1,"model-value":_.value.config.trailGridCols,"onUpdate:modelValue":S[166]||(S[166]=C=>Us("trailGridCols",C))},null,8,["model-value"])]),S[344]||(S[344]=E("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):Ue("",!0)]),E("div",h4,[E("label",u4,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[167]||(S[167]=C=>_.value.config.emitterFollow=C),disabled:_.value.config.streamBehavior==="loop"},null,8,d4),[[ti,_.value.config.emitterFollow]]),S[345]||(S[345]=E("span",{class:"switch-ui"},null,-1)),S[346]||(S[346]=E("span",null,"开启发射器跟随",-1))]),_.value.config.emitterFollow&&_.value.config.streamBehavior!=="loop"?(te(),oe("div",f4,[E("label",m4,[S[349]||(S[349]=E("span",null,"跟随模式",-1)),E("select",{value:_.value.config.emitterFollowMode,class:"inp",onChange:S[168]||(S[168]=C=>wt(C,_.value.config))},[S[347]||(S[347]=E("option",{value:"none"},"无",-1)),S[348]||(S[348]=E("option",{value:"path"},"跟随路径",-1)),de.value||_.value.config.emitterFollowMode==="bone"?(te(),oe("option",g4,"选中的骨骼")):Ue("",!0)],40,p4)]),_.value.config.emitterFollowMode==="path"?(te(),oe(Ke,{key:0},[E("label",v4,[S[351]||(S[351]=E("span",null,"跟随路径",-1)),xe(E("select",{"onUpdate:modelValue":S[169]||(S[169]=C=>_.value.config.emitterFollowPathId=C),class:"inp"},[S[350]||(S[350]=E("option",{value:0},"无",-1)),(te(!0),oe(Ke,null,ci(ke(e).paths,C=>(te(),oe("option",{key:C.id,value:C.id},je(C.name),9,y4))),128))],512),[[jt,_.value.config.emitterFollowPathId,void 0,{number:!0}]])]),E("label",x4,[S[353]||(S[353]=E("span",null,"发射器角度模式",-1)),xe(E("select",{"onUpdate:modelValue":S[170]||(S[170]=C=>_.value.config.emitterAngleMode=C),class:"inp"},[...S[352]||(S[352]=[E("option",{value:"fixed"},"固定角度",-1),E("option",{value:"direction"},"跟随移动方向",-1)])],512),[[jt,_.value.config.emitterAngleMode]])]),S[359]||(S[359]=E("div",{class:"gravity-curve-title"},[E("span",null,"移动进度曲线 (0→1)")],-1)),Ne(gn,{modelValue:_.value.config.emitterFollowCurve,"onUpdate:modelValue":S[171]||(S[171]=C=>_.value.config.emitterFollowCurve=C),"default-value":K},null,8,["modelValue"]),E("div",b4,[E("label",w4,[S[354]||(S[354]=E("span",null,"移动时长 (s)",-1)),xe(E("input",{"onUpdate:modelValue":S[172]||(S[172]=C=>_.value.config.emitterFollowDuration=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[ct,_.value.config.emitterFollowDuration,void 0,{number:!0}]])]),E("label",S4,[S[356]||(S[356]=E("span",null,"跟随空间",-1)),xe(E("select",{"onUpdate:modelValue":S[173]||(S[173]=C=>_.value.config.emitterFollowSpace=C),class:"inp"},[...S[355]||(S[355]=[E("option",{value:"local"},"局部空间(GEN 移动)",-1),E("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[jt,_.value.config.emitterFollowSpace]])])]),E("label",_4,[S[358]||(S[358]=E("span",null,"移动方向",-1)),xe(E("select",{"onUpdate:modelValue":S[174]||(S[174]=C=>_.value.config.emitterFollowDirection=C),class:"inp"},[...S[357]||(S[357]=[E("option",{value:"forward"},"正向(起点 → 终点)",-1),E("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[jt,_.value.config.emitterFollowDirection]])]),Ne(qe,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:_.value.config.emitterFollowOffset,"onUpdate:modelValue":S[175]||(S[175]=C=>_.value.config.emitterFollowOffset=C)},null,8,["modelValue"]),S[360]||(S[360]=E("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):_.value.config.emitterFollowMode==="bone"?(te(),oe(Ke,{key:1},[me.value?(te(),oe("div",M4,[S[361]||(S[361]=ai("跟随目标:",-1)),E("strong",null,je(me.value.spine.name)+" / "+je(me.value.boneName),1)])):(te(),oe("div",T4,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),de.value&&(!me.value||de.value.spine.id!==me.value.spine.id||de.value.boneName!==me.value.boneName)?(te(),oe("button",{key:2,class:"bone-follow-rebind",onClick:S[176]||(S[176]=C=>Et(_.value.config))},je(me.value?"重新绑定":"绑定")+"当前选中骨骼:"+je(de.value.spine.name)+" / "+je(de.value.boneName),1)):Ue("",!0),me.value?(te(),oe(Ke,{key:3},[E("label",A4,[S[363]||(S[363]=E("span",null,"跟随空间",-1)),xe(E("select",{"onUpdate:modelValue":S[177]||(S[177]=C=>_.value.config.emitterFollowSpace=C),class:"inp"},[...S[362]||(S[362]=[E("option",{value:"local"},"本地空间(随骨骼移动)",-1),E("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[jt,_.value.config.emitterFollowSpace]])]),E("div",E4,[E("label",C4,[S[364]||(S[364]=E("span",null,"位移偏移 X",-1)),xe(E("input",{"onUpdate:modelValue":S[178]||(S[178]=C=>_.value.config.emitterFollowBoneOffsetX=C),type:"number",step:"1",class:"inp"},null,512),[[ct,_.value.config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),E("label",I4,[S[365]||(S[365]=E("span",null,"位移偏移 Y",-1)),xe(E("input",{"onUpdate:modelValue":S[179]||(S[179]=C=>_.value.config.emitterFollowBoneOffsetY=C),type:"number",step:"1",class:"inp"},null,512),[[ct,_.value.config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),E("div",R4,[E("label",P4,[S[366]||(S[366]=E("span",null,"旋转偏移",-1)),xe(E("input",{"onUpdate:modelValue":S[180]||(S[180]=C=>_.value.config.emitterFollowBoneRotation=C),type:"number",step:"1",class:"inp"},null,512),[[ct,_.value.config.emitterFollowBoneRotation,void 0,{number:!0}]])]),E("label",k4,[S[367]||(S[367]=E("span",null,"缩放偏移 X",-1)),xe(E("input",{"onUpdate:modelValue":S[181]||(S[181]=C=>_.value.config.emitterFollowBoneScaleX=C),type:"number",step:"0.05",class:"inp"},null,512),[[ct,_.value.config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),E("label",F4,[S[368]||(S[368]=E("span",null,"缩放偏移 Y",-1)),xe(E("input",{"onUpdate:modelValue":S[182]||(S[182]=C=>_.value.config.emitterFollowBoneScaleY=C),type:"number",step:"0.05",class:"inp"},null,512),[[ct,_.value.config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),S[369]||(S[369]=E("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):Ue("",!0)],64)):Ue("",!0)])):Ue("",!0)]),E("div",O4,[E("label",B4,[xe(E("input",{type:"checkbox","onUpdate:modelValue":S[183]||(S[183]=C=>_.value.config.collision=C)},null,512),[[ti,_.value.config.collision]]),S[370]||(S[370]=E("span",{class:"switch-ui"},null,-1)),S[371]||(S[371]=E("span",null,"开启碰撞",-1))]),_.value.config.collision?(te(),oe("div",L4,[S[372]||(S[372]=E("div",{class:"collision-filter-title"},"参与的碰撞对象",-1)),E("div",D4,[(te(!0),oe(Ke,null,ci(Re.value,C=>(te(),oe("span",{key:C.id,class:ot(["collision-filter-tag",{disabled:!C.enabled}]),title:C.enabled?C.name:`${C.name}(碰撞体已禁用)`},[E("span",null,je(C.name),1),E("button",{type:"button","aria-label":`清除碰撞对象 ${C.name}`,onClick:Z=>H(C.id)},"×",8,U4)],10,N4))),128)),E("button",{type:"button",class:ot(["collision-filter-add",{active:we.value}]),disabled:ge.value.length===0,title:ge.value.length?"加入场景碰撞对象":"没有可加入的碰撞对象",onClick:S[184]||(S[184]=C=>we.value=!we.value)},"+",10,X4)]),Re.value.length===0?(te(),oe("div",V4,"未选择碰撞对象,当前粒子不会发生碰撞")):Ue("",!0),we.value&&ge.value.length?(te(),oe("div",Y4,[(te(!0),oe(Ke,null,ci(ge.value,C=>(te(),oe("button",{key:C.id,type:"button",onClick:Z=>Ae(C.id)},[E("span",null,je(C.name),1),E("small",null,je(C.enabled?"可用":"已禁用"),1)],8,$4))),128))])):Ue("",!0),S[373]||(S[373]=E("div",{class:"modifier-hint"},"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",-1))])):Ue("",!0)]),Ne(qe,{label:"阻尼",min:0,max:2,step:.05,modelValue:_.value.config.damping,"onUpdate:modelValue":S[185]||(S[185]=C=>_.value.config.damping=C)},null,8,["modelValue"])],512),[[yr,!re.mods]])]),E("div",G4,[E("div",{class:"group-head",onClick:S[187]||(S[187]=C=>ye("export"))},[E("span",H4,je(re.export?"▸":"▾"),1),S[374]||(S[374]=E("span",null,"导出设置",-1)),E("button",{class:"group-reset",title:"重置导出设置",onClick:S[186]||(S[186]=yt(C=>yi("export"),["stop"]))},"重置")]),xe(E("div",j4,[E("label",W4,[S[375]||(S[375]=E("span",null,"图片路径 (Spine Images Path)",-1)),xe(E("input",{"onUpdate:modelValue":S[188]||(S[188]=C=>t.value.imagesPath=C),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[ct,t.value.imagesPath,void 0,{trim:!0}]])]),E("label",z4,[S[377]||(S[377]=E("span",null,"Spine 版本",-1)),xe(E("select",{"onUpdate:modelValue":S[189]||(S[189]=C=>t.value.spineVersion=C),class:"inp export-input"},[...S[376]||(S[376]=[to('',5)])],512),[[jt,t.value.spineVersion]])]),E("label",q4,[S[379]||(S[379]=E("span",null,"关键帧插值曲线",-1)),xe(E("select",{"onUpdate:modelValue":S[190]||(S[190]=C=>t.value.keyframeCurve=C),class:"inp export-input"},[...S[378]||(S[378]=[E("option",{value:"linear"},"线性 (Linear)",-1),E("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[jt,t.value.keyframeCurve]])]),S[388]||(S[388]=E("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),t.value.spineVersion==="3.8"?(te(),oe("div",K4,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):Ue("",!0),E("div",Z4,[E("label",J4,[S[380]||(S[380]=E("span",null,"导出 FPS",-1)),xe(E("input",{"onUpdate:modelValue":S[191]||(S[191]=C=>t.value.fps=C),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:Bi},null,544),[[ct,t.value.fps,void 0,{number:!0}]])]),E("label",Q4,[xe(E("input",{"onUpdate:modelValue":S[192]||(S[192]=C=>t.value.omitFps=C),type:"checkbox"},null,512),[[ti,t.value.omitFps]]),S[381]||(S[381]=ai("不写 fps",-1))])]),S[389]||(S[389]=E("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),E("div",e5,[E("label",t5,[xe(E("input",{"onUpdate:modelValue":S[193]||(S[193]=C=>t.value.integerFrameAlignment=C),type:"checkbox"},null,512),[[ti,t.value.integerFrameAlignment]]),S[382]||(S[382]=E("span",{class:"switch-ui"},null,-1)),S[383]||(S[383]=E("span",null,"整数帧对齐",-1))]),E("label",i5,[xe(E("input",{"onUpdate:modelValue":S[194]||(S[194]=C=>t.value.bonePool=C),type:"checkbox"},null,512),[[ti,t.value.bonePool]]),S[384]||(S[384]=E("span",{class:"switch-ui"},null,-1)),S[385]||(S[385]=E("span",null,"骨骼对象池",-1))]),E("label",s5,[xe(E("input",{"onUpdate:modelValue":S[195]||(S[195]=C=>t.value.excludeEmptyAnimations=C),type:"checkbox"},null,512),[[ti,t.value.excludeEmptyAnimations]]),S[386]||(S[386]=E("span",{class:"switch-ui"},null,-1)),S[387]||(S[387]=E("span",null,"排除无内容动画",-1))])])],512),[[yr,!re.export]])])],64)):Ue("",!0)]),E("div",n5,[E("button",{type:"button",class:"export-spine-json",disabled:l.value,title:l.value?"正在重新计算并烘焙动画":`导出 Spine ${t.value.spineVersion} JSON`,onClick:L},je(l.value&&c.value==="json"?"正在准备导出…":"导出Spine Json"),9,r5),E("button",{type:"button",class:"export-spine-images",disabled:l.value,title:"单独下载当前粒子系统使用的图片 ZIP",onClick:B},je(l.value&&c.value==="images"?"正在整理图片…":"导出 images 包"),9,a5),E("button",{type:"button",class:"export-spine-project",disabled:l.value||!v.value,title:w.value,onClick:U},[E("span",null,je(l.value&&c.value==="spine"?"正在生成工程…":"导出 .spine 包"),1),!l.value&&y.value?(te(),oe("small",l5,je(y.value),1)):Ue("",!0)],8,o5)]),E("div",{class:ot(["connector-status",g.value])},[S[390]||(S[390]=E("span",{class:"connector-dot"},null,-1)),ai(je(m.value)+" ",1),b.value?(te(),oe("a",{key:0,href:b.value,target:"_blank",rel:"noopener",title:"在本机连接器中授权当前网站"},"授权当前网站",8,c5)):Ue("",!0),E("button",{type:"button",title:"重新检测连接器",onClick:I},"刷新")],2),u.value?(te(),oe("div",{key:0,class:ot(["export-message",{error:d.value}])},[ai(je(u.value)+" ",1),p.value?(te(),oe("a",{key:0,href:p.value,target:"_blank",rel:"noopener",onClick:S[196]||(S[196]=C=>p.value="")},"授权当前网站",8,h5)):Ue("",!0)],2)):Ue("",!0)]))}}),d5=rn(u5,[["__scopeId","data-v-988d7abf"]]),f5={class:"timeline"},m5={class:"tl-controls"},p5=["title"],g5={class:"tl-range",title:"自定义播放起始帧"},v5=["max","onKeydown"],y5={class:"tl-range",title:"自定义播放结束帧"},x5=["min","max","onKeydown"],b5=["title"],w5={class:"tl-frame"},S5=["disabled"],_5=["onClick"],M5={key:0},T5={class:"tl-animation-editor"},A5={key:0,class:"tl-animation-error"},E5={class:"tl-animation-actions"},C5=["disabled"],I5={key:1,class:"tl-animation-hint"},R5={class:"tl-anim tl-spine-preview"},P5=["value","disabled"],k5={value:""},F5=["value"],O5={class:"tl-zoom"},B5={class:"tl-ticks"},L5={class:"tl-ticklabel"},D5={class:"tl-lanes"},N5=["onPointerdown"],U5={class:"lane-name"},X5=["onPointerdown"],V5=["onPointerdown"],Y5=["onPointerdown"],$5={class:"lane-name"},G5={key:0,class:"tl-empty"},H5=sn({__name:"Timeline",setup(s){const e=Kl(),t=ht(null),i=ht(null),n=ht(!1),r=ht("animation"),a=ht("");Qo(()=>{(!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 q of e.systems)(!q.animation||!e.timeline.animations.includes(q.animation))&&(q.animation=e.timeline.animations[0])});const o=pt(()=>e.systems.find(q=>q.id===e.activeId)||null),h=pt(()=>{const q=o.value;return!q||!j(q)?null:v1(q.config,m.value)});function l(){o.value&&(n.value=!n.value,r.value=o.value.animation,a.value="")}function c(q){const z=o.value;z&&(e.setSystemAnimation(z.id,q),r.value=q,a.value="")}function u(){const q=e.addAnimation();r.value=q,a.value=""}function d(){var ee;const q=((ee=o.value)==null?void 0:ee.animation)||e.timeline.animation,z=r.value.trim();if(!z){a.value="动画名称不能为空";return}if(z!==q&&e.timeline.animations.includes(z)){a.value="动画名称不能重复";return}if(!e.renameAnimation(q,z)){a.value="无法修改动画名称";return}r.value=z,a.value=""}function f(){var ee,le;const q=((ee=o.value)==null?void 0:ee.animation)||e.timeline.animation;if(!e.removeAnimation(q)){a.value="至少需要保留一个动画";return}const z=((le=o.value)==null?void 0:le.animation)||e.timeline.animation;r.value=z,a.value=""}function p(q){var z;(z=i.value)!=null&&z.contains(q.target)||(n.value=!1)}Da(()=>document.addEventListener("pointerdown",p)),uu(()=>document.removeEventListener("pointerdown",p));const m=pt(()=>Math.max(1,e.timeline.fps||30)),g=ht(120),v=ht({}),b=ht({}),y=ht({}),w=ht({}),A=ht(String(e.timeline.playbackStart)),T=ht(String(e.timeline.playbackEnd));cs(()=>e.timeline.playbackStart,q=>{A.value=String(q)}),cs(()=>e.timeline.playbackEnd,q=>{T.value=String(q)});const M=pt(()=>e.timeline.totalFrames),R=pt(()=>g.value<=30?"放大":g.value>=300?"缩小":"适中"),P=pt(()=>e.spines.filter(q=>q.selectedAnimation&&q.animations.some(z=>z.name===q.selectedAnimation&&z.duration>0))),F=pt(()=>(e.activeObjectType==="spine"?e.spines.find(z=>z.id===e.activeObjectId&&z.animations.length):null)||e.spines.find(z=>z.animations.length)||null);function I(q){const z=F.value;z&&(z.selectedAnimation=q.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function k(){e.setPlaybackStart(Number(A.value)),A.value=String(e.timeline.playbackStart)}function O(){e.setPlaybackEnd(Number(T.value)),T.value=String(e.timeline.playbackEnd)}function L(){const q=h.value;q&&(e.setPlaybackEnd(q.end),e.setPlaybackStart(q.start))}function U(){var z;const q=((z=t.value)==null?void 0:z.clientWidth)||600;return g.value/q}const B=pt(()=>{const q=[],z=g.value;let ee=1;g.value<=10?ee=1:g.value<=50?ee=5:g.value<=200?ee=10:g.value<=500?ee=50:ee=100;for(let le=0;le<=z;le+=ee)q.push({f:le,px:le/U()});return q}),D=pt(()=>e.timeline.frame/U());function _(q){const z=q.config;return(v.value[q.id]??Math.max(0,Number(z.delay)||0))*m.value/U()}function X(q){const z=q.config,ee=Math.max(0,Number(z.lifeMin)||0),le=Math.max(0,Number(z.lifeMax)||0);return z.lifeMode==="fixed"?ee:Math.max(ee,le)}function N(q){return G(q)}function V(q){if(q.config.mode!=="stream")return 0;if(q.config.streamBehavior==="loop"){const ee=q.config;return(y.value[q.id]??Dr(ee,m.value).loop)/U()}return(b.value[q.id]??Math.max(1/m.value,Number(q.config.duration)||1))*m.value/U()}function G(q){const z=q.config;return z.mode==="stream"&&z.streamBehavior==="loop"?ne(q)+V(q)+Q(q):V(q)+X(q)*m.value/U()}function j(q){const z=q.config;return z.mode==="stream"&&z.streamBehavior==="loop"}function ne(q){return j(q)?Dr(q.config,m.value).start/U():0}function Q(q){return j(q)?Dr(q.config,m.value).end/U():0}function de(q){var z;return((z=q.animations.find(ee=>ee.name===q.selectedAnimation))==null?void 0:z.duration)||0}function me(q){return(w.value[q.id]??Math.max(0,Number(q.timeOffset)||0))*m.value/U()}function we(q){return de(q)*m.value/U()}function Re(q){const z=q.deltaY<0?.8:1.25;let ee=g.value*z;ee=Math.min(2e3,Math.max(10,ee)),g.value=Math.round(ee)}function ge(q){const z=t.value,ee=ve=>{const re=z.getBoundingClientRect(),ye=Math.floor((ve.clientX-re.left)/re.width*g.value);e.timeline.frame=Math.max(0,Math.min(ye,M.value-1))};ee(q);const le=()=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",le)};window.addEventListener("pointermove",ee),window.addEventListener("pointerup",le)}function Ae(q,z){q.stopPropagation();const ee=q.clientX,le=Math.max(0,Number(z.config.delay)||0),ve=U()/m.value,re=Pe=>{const Oe=(Pe.clientX-ee)*ve,it=Math.max(0,Math.min(le+Oe,600));v.value[z.id]=Math.round(it*m.value)/m.value},ye=Pe=>{window.removeEventListener("pointermove",re),window.removeEventListener("pointerup",he),window.removeEventListener("pointercancel",Xe);const Oe=v.value[z.id];delete v.value[z.id],Pe&&Oe!=null&&Oe!==le&&(z.config.delay=Oe)},he=()=>ye(!0),Xe=()=>ye(!1);window.addEventListener("pointermove",re),window.addEventListener("pointerup",he),window.addEventListener("pointercancel",Xe)}function H(q,z){var Ct;q.stopPropagation();const ee=j(z),le=Math.max(0,Number(z.config.duration)||0),ve=Dr(z.config,m.value).loop,re=U()/m.value,ye=((Ct=q.currentTarget.closest(".lane-bar"))==null?void 0:Ct.getBoundingClientRect().left)??q.clientX,he=ne(z);let Xe=!1;const Pe=wt=>{if(Xe=!0,ee){const Et=Math.min(1800,Math.max(1,Math.round((wt.clientX-ye-he)/U())));y.value[z.id]=Et}else{const Et=Math.max(1/m.value,Math.min((wt.clientX-ye)*re,600));b.value[z.id]=Math.round(Et*m.value)/m.value}},Oe=wt=>{window.removeEventListener("pointermove",Pe),window.removeEventListener("pointerup",it),window.removeEventListener("pointercancel",bt);const Et=b.value[z.id],Kt=y.value[z.id];delete b.value[z.id],delete y.value[z.id],wt&&Xe&&ee&&Kt!=null&&Kt!==ve?z.config.loopDurationFrames=Kt:wt&&Xe&&!ee&&Et!=null&&Et!==le&&(z.config.duration=Et)},it=()=>Oe(!0),bt=()=>Oe(!1);window.addEventListener("pointermove",Pe),window.addEventListener("pointerup",it),window.addEventListener("pointercancel",bt)}function K(q,z){q.stopPropagation();const ee=q.clientX,le=Math.max(0,Number(z.timeOffset)||0),ve=U()/m.value,re=Pe=>{const Oe=Math.max(0,Math.min(le+(Pe.clientX-ee)*ve,600));w.value[z.id]=Math.round(Oe*m.value)/m.value},ye=Pe=>{window.removeEventListener("pointermove",re),window.removeEventListener("pointerup",he),window.removeEventListener("pointercancel",Xe);const Oe=w.value[z.id];delete w.value[z.id],Pe&&Oe!=null&&Oe!==le&&(z.timeOffset=Oe,e.recalcTotalFrames())},he=()=>ye(!0),Xe=()=>ye(!1);window.addEventListener("pointermove",re),window.addEventListener("pointerup",he),window.addEventListener("pointercancel",Xe)}return(q,z)=>{var ee,le,ve;return te(),oe("div",f5,[E("div",m5,[E("button",{class:ot(["tl-btn",{on:ke(e).timeline.playing}]),onClick:z[0]||(z[0]=re=>ke(e).togglePlay()),title:ke(e).timeline.playing?"暂停 (D)":"播放 (D)"},je(ke(e).timeline.playing?"❚❚":"▶"),11,p5),E("button",{class:"tl-btn",onClick:z[1]||(z[1]=re=>ke(e).toStart()),title:"回到第一帧 (S)"},"⏮"),E("button",{class:"tl-btn",onClick:z[2]||(z[2]=re=>ke(e).previousFrame()),title:"前一帧"},"◀"),E("button",{class:"tl-btn",onClick:z[3]||(z[3]=re=>ke(e).nextFrame()),title:"后一帧"},"▶"),E("button",{class:"tl-btn",onClick:z[4]||(z[4]=re=>ke(e).toEnd()),title:"移动到最后一帧"},"⏭"),E("button",{class:ot(["tl-btn",{on:ke(e).timeline.loop}]),onClick:z[5]||(z[5]=re=>ke(e).toggleLoop()),title:"循环"},"⟳",2),E("label",g5,[z[10]||(z[10]=E("span",null,"A",-1)),xe(E("input",{"onUpdate:modelValue":z[6]||(z[6]=re=>A.value=re),type:"number",min:"0",max:Math.max(0,ke(e).timeline.playbackEnd-1),"aria-label":"播放起始帧",onChange:k,onKeydown:Aa(yt(k,["prevent"]),["enter"])},null,40,v5),[[ct,A.value]])]),E("label",y5,[z[11]||(z[11]=E("span",null,"B",-1)),xe(E("input",{"onUpdate:modelValue":z[7]||(z[7]=re=>T.value=re),type:"number",min:ke(e).timeline.playbackStart+1,max:Math.max(1,ke(e).timeline.totalFrames-1),"aria-label":"播放结束帧",onChange:O,onKeydown:Aa(yt(O,["prevent"]),["enter"])},null,40,x5),[[ct,T.value]])]),h.value?(te(),oe("button",{key:0,class:"tl-loop-range",title:`设为闭合自循环范围 ${h.value.start}–${h.value.end}f`,onClick:L},"循环段",8,b5)):Ue("",!0),E("span",w5,[z[12]||(z[12]=ai("帧 ",-1)),E("b",null,je(ke(e).timeline.frame),1),z[13]||(z[13]=ai(" / ",-1)),E("b",null,je(Math.max(0,ke(e).timeline.totalFrames-1)),1)]),z[18]||(z[18]=E("span",{class:"tl-legend"},[E("i",{class:"legend-emission"}),ai("持续发射 "),E("i",{class:"legend-life"}),ai("粒子存在 "),E("i",{class:"legend-spine"}),ai("Spine 动画")],-1)),E("div",{ref_key:"animationMenuRef",ref:i,class:"tl-anim tl-owner-animation"},[z[16]||(z[16]=E("span",null,"所属动画",-1)),E("button",{class:"tl-animation-trigger",disabled:!o.value,title:"设置当前粒子系统所属的动画",onClick:yt(l,["stop"])},[E("span",null,je(((ee=o.value)==null?void 0:ee.animation)||ke(e).timeline.animation),1),z[14]||(z[14]=E("i",null,"⌄",-1))],8,S5),n.value?(te(),oe("div",{key:0,class:"tl-animation-menu",onPointerdown:z[9]||(z[9]=yt(()=>{},["stop"]))},[z[15]||(z[15]=E("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(te(!0),oe(Ke,null,ci(ke(e).timeline.animations,re=>{var ye,he;return te(),oe("button",{key:re,class:ot(["tl-animation-option",{on:((ye=o.value)==null?void 0:ye.animation)===re}]),onClick:Xe=>c(re)},[E("span",null,je(re),1),((he=o.value)==null?void 0:he.animation)===re?(te(),oe("i",M5,"✓")):Ue("",!0)],10,_5)}),128)),E("div",T5,[xe(E("input",{"onUpdate:modelValue":z[8]||(z[8]=re=>r.value=re),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:Aa(d,["enter"])},null,544),[[ct,r.value]]),E("button",{title:"重命名当前动画",onClick:d},"重命名")]),a.value?(te(),oe("div",A5,je(a.value),1)):Ue("",!0),E("div",E5,[E("button",{onClick:u},"+ 新增"),E("button",{disabled:ke(e).timeline.animations.length<=1,onClick:f},"删除",8,C5)]),ke(e).timeline.animations.length<=1?(te(),oe("div",I5,"至少需要保留一个动画")):Ue("",!0)],32)):Ue("",!0)],512),E("label",R5,[z[17]||(z[17]=ai("Spine 预览动画 ",-1)),E("select",{class:"tl-sel",value:((le=F.value)==null?void 0:le.selectedAnimation)||"",disabled:!F.value,onChange:I},[E("option",k5,je(F.value?"无":"无可用 Spine 动画"),1),(te(!0),oe(Ke,null,ci(((ve=F.value)==null?void 0:ve.animations)||[],re=>(te(),oe("option",{key:re.name,value:re.name},je(re.name)+"("+je(re.duration.toFixed(2))+"s) ",9,F5))),128))],40,P5)]),E("span",O5,je(R.value),1)]),E("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:yt(Re,["prevent"]),onPointerdown:ge},[E("div",B5,[(te(!0),oe(Ke,null,ci(B.value,re=>(te(),oe("div",{key:re.f,class:"tl-tickline",style:Ni({left:re.px+"px"})},[E("span",L5,je(re.f)+"f",1)],4))),128))]),E("div",{class:"tl-playhead",style:Ni({left:D.value+"px"})},null,4),E("div",D5,[(te(!0),oe(Ke,null,ci(ke(e).systems,(re,ye)=>(te(),oe("div",{key:re.id,class:"tl-lane"},[z[19]||(z[19]=E("span",{class:"lane-ico"},"●",-1)),E("div",{class:"lane-bar",style:Ni({left:_(re)+"px",width:N(re)+"px"}),onPointerdown:yt(he=>Ae(he,re),["stop"])},[E("span",U5,je(re.config.name||"系统 "+(ye+1)),1),E("span",{class:ot(["bar-life",{"loop-life":j(re)}]),style:Ni({width:G(re)+"px"})},null,6),j(re)?(te(),oe(Ke,{key:0},[ne(re)?(te(),oe("span",{key:0,class:"bar-loop-transition bar-loop-start",style:Ni({width:ne(re)+"px"})},null,4)):Ue("",!0),E("span",{class:"bar-emission bar-loop",style:Ni({left:ne(re)+"px",width:V(re)+"px"})},[E("span",{class:"bar-handle",title:"拖动循环段时长",onPointerdown:yt(he=>H(he,re),["stop"])},null,40,X5)],4),Q(re)?(te(),oe("span",{key:1,class:"bar-loop-transition bar-loop-end",style:Ni({left:ne(re)+V(re)+"px",width:Q(re)+"px"})},null,4)):Ue("",!0)],64)):re.config.mode==="stream"?(te(),oe("span",{key:1,class:"bar-emission",style:Ni({width:V(re)+"px"})},[E("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:yt(he=>H(he,re),["stop"])},null,40,V5)],4)):Ue("",!0)],44,N5)]))),128)),(te(!0),oe(Ke,null,ci(P.value,re=>(te(),oe("div",{key:`spine-${re.id}`,class:"tl-lane spine-lane"},[z[20]||(z[20]=E("span",{class:"lane-ico spine-ico"},"◆",-1)),E("div",{class:"spine-bar",style:Ni({left:me(re)+"px",width:we(re)+"px"}),title:"拖动调整动画开始时间",onPointerdown:yt(ye=>K(ye,re),["stop"])},[E("span",$5,je(re.name)+" · "+je(re.selectedAnimation),1)],44,Y5)]))),128)),!ke(e).systems.length&&!P.value.length?(te(),oe("div",G5,"暂无可显示的动画数据")):Ue("",!0)])],544)])}}}),j5=rn(H5,[["__scopeId","data-v-8d9981a9"]]),W5={class:"transfer-heading"},z5={key:0},q5={class:"transfer-detail"},K5=sn({__name:"TransferProgressOverlay",setup(s){const e=ht(null);return cs(()=>bi.visible,async t=>{var i;t&&(await ou(),(i=e.value)==null||i.focus({preventScroll:!0}))},{flush:"post"}),(t,i)=>(te(),Qt(kM,{name:"transfer-fade"},{default:ah(()=>[ke(bi).visible?(te(),oe("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]=yt(()=>{},["stop","prevent"])),onPointerup:i[1]||(i[1]=yt(()=>{},["stop","prevent"])),onClick:i[2]||(i[2]=yt(()=>{},["stop","prevent"])),onDblclick:i[3]||(i[3]=yt(()=>{},["stop","prevent"])),onContextmenu:i[4]||(i[4]=yt(()=>{},["stop","prevent"])),onWheel:i[5]||(i[5]=yt(()=>{},["stop","prevent"])),onKeydown:i[6]||(i[6]=yt(()=>{},["stop","prevent"]))},[E("div",{class:ot(["transfer-dialog",{failed:ke(bi).failed}])},[E("div",W5,[E("span",null,je(ke(bi).title),1),ke(bi).indeterminate?Ue("",!0):(te(),oe("strong",z5,je(Math.round(ke(bi).progress))+"%",1))]),E("div",{class:ot(["transfer-track",{indeterminate:ke(bi).indeterminate}])},[E("div",{class:"transfer-bar",style:Ni(ke(bi).indeterminate?void 0:{width:`${ke(bi).progress}%`})},null,4)],2),E("div",q5,je(ke(bi).detail),1)],2)],544)):Ue("",!0)]),_:1}))}}),Z5=rn(K5,[["__scopeId","data-v-592b922e"]]),J5=["inert","aria-hidden"],Q5={class:"right"},eU={class:"stage-area"},tU=sn({__name:"App",setup(s){const e=Kl();QI(e);const t=ht(360),i=ht(180);function n(a){a.preventDefault();const o=l=>{const c=e.settings.parameterPanelOnRight?window.innerWidth-l.clientX:l.clientX,u=Math.max(240,Math.min(c,window.innerWidth-200));t.value=u},h=()=>{window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",o),window.addEventListener("pointerup",h)}function r(a){a.preventDefault();const o=a.clientY,h=i.value,l=u=>{const d=Math.max(80,Math.min(h+(o-u.clientY),window.innerHeight-200));i.value=d},c=()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",c)}return(a,o)=>(te(),oe(Ke,null,[E("div",{class:ot(["layout",{"panel-right":ke(e).settings.parameterPanelOnRight}]),inert:ke(bi).visible?!0:void 0,"aria-hidden":ke(bi).visible?"true":void 0},[E("div",{class:"parameter-panel",style:Ni({width:t.value+"px"})},[Ne(d5)],4),E("div",{class:"resizer-col",onPointerdown:n},null,32),E("div",Q5,[E("div",eU,[Ne(Ik)]),E("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),E("div",{class:"timeline-area",style:Ni({height:i.value+"px"})},[Ne(j5)],4)])],10,J5),Ne(Z5)],64))}}),iU=rn(tU,[["__scopeId","data-v-42c4fa00"]]);aT(iU).use(cT()).mount("#app");export{fy as $,Rn as A,Wh as B,Wt as C,ji as D,He as E,ls as F,Bn as G,xt as H,Xt as I,vS as J,ms as K,_s as L,Bs as M,Hr as N,Pu as O,In as P,Ll as Q,Po as R,zs as S,Q3 as T,lt as U,oy as V,Zs as W,P8 as X,KO as Y,Vl as Z,Mp as _,mt as a,Bm as a$,dy as a0,Kw as a1,Op as a2,I8 as a3,$h as a4,bl as a5,cO as a6,wl as a7,ku as a8,Pm as a9,$m as aA,Gm as aB,Nc as aC,Cr as aD,Qc as aE,km as aF,eS as aG,mi as aH,Ww as aI,w8 as aJ,To as aK,uy as aL,Ve as aM,st as aN,Om as aO,eh as aP,nS as aQ,Fm as aR,iS as aS,sS as aT,Fu as aU,oS as aV,th as aW,hS as aX,rS as aY,lS as aZ,uS as a_,Ya as aa,Bp as ab,Lp as ac,cy as ad,Ql as ae,ec as af,Jl as ag,Va as ah,sr as ai,_8 as aj,Qw as ak,lO as al,Fo as am,Vr as an,Up as ao,gS as ap,aO as aq,Xl as ar,fs as as,hy as at,A8 as au,No as av,Ym as aw,Hm as ax,jm as ay,Wm as az,Io as b,pr as b$,jh as b0,aS as b1,zr as b2,cS as b3,Dp as b4,J3 as b5,mS as b6,pS as b7,Np as b8,On as b9,dS as bA,Xp as bB,Ru as bC,yS as bD,Lm as bE,Fi as bF,K3 as bG,tO as bH,Lw as bI,Bw as bJ,M8 as bK,si as bL,Uo as bM,xS as bN,SS as bO,_S as bP,MS as bQ,bS as bR,wS as bS,rO as bT,Vp as bU,$t as bV,Vm as bW,tS as bX,Nw as bY,Uw as bZ,Xw as b_,Z3 as ba,S8 as bb,vt as bc,Jw as bd,Zw as be,zw as bf,qw as bg,Pa as bh,Gh as bi,oO as bj,Vw as bk,Yw as bl,as as bm,$w as bn,ko as bo,Gi as bp,Dw as bq,Hh as br,Gw as bs,Hw as bt,jw as bu,my as bv,Um as bw,xa as bx,fS as by,Nm as bz,Ro as c,T8 as c0,sO as c1,nO as c2,iO as c3,ut as d,tt as e,E8 as f,gt as g,Xi as h,_h as i,gs as j,oi as k,et as l,en as m,li as n,vp as o,Si as p,Dl as q,Tr as r,We as s,ob as t,_p as u,Ch as v,Dm as w,va as x,ly as y,Xm as z}; diff --git a/dist/index.html b/dist/index.html index 26540ad..c81a98d 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/src/views/ParticlePanel.vue b/src/views/ParticlePanel.vue index 2aec31b..08f19de 100644 --- a/src/views/ParticlePanel.vue +++ b/src/views/ParticlePanel.vue @@ -1031,6 +1031,7 @@ const exportMessage = ref('') const exportError = ref(false) const connectorHealth = ref(null) const connectorPairUrl = ref('') +const connectorExportErrorCode = ref('') const connectorStatusText = computed(() => { const health = connectorHealth.value @@ -1144,12 +1145,32 @@ onMounted(() => { }) let connectorHealthTimer: number | undefined +let connectorHealthRequestId = 0 onBeforeUnmount(() => { if (connectorHealthTimer !== undefined) window.clearInterval(connectorHealthTimer) }) async function refreshConnectorHealth() { - connectorHealth.value = await checkSpineConnector() + const requestId = ++connectorHealthRequestId + const health = await checkSpineConnector() + if (requestId !== connectorHealthRequestId) return + connectorHealth.value = health + const code = connectorExportErrorCode.value + const resolved = code === 'CONNECTOR_OFFLINE' + ? health.available + : code === 'SPINE_NOT_FOUND' + ? health.available && health.spineFound + : code === 'ORIGIN_NOT_ALLOWED' + ? health.available && health.spineFound && health.authorized + : !!code && health.available && health.spineFound && health.authorized + if (resolved) { + connectorExportErrorCode.value = '' + connectorPairUrl.value = '' + if (exportError.value) { + exportError.value = false + exportMessage.value = '' + } + } } function nextPaint() { @@ -1179,6 +1200,7 @@ async function exportSpineJson() { exportBusy.value = true exportTarget.value = 'json' exportError.value = false + connectorExportErrorCode.value = '' connectorPairUrl.value = '' exportMessage.value = '正在重新计算粒子动画…' try { @@ -1202,6 +1224,7 @@ async function exportSpineProject() { exportBusy.value = true exportTarget.value = 'spine' exportError.value = false + connectorExportErrorCode.value = '' connectorPairUrl.value = '' exportMessage.value = '正在重新计算粒子动画…' const transfer = beginTransfer('导出 Spine 包', '正在重新计算粒子动画…') @@ -1230,11 +1253,13 @@ async function exportSpineProject() { await refreshConnectorHealth() await transfer.finish('Spine 工程包已开始下载') } catch (error) { + const errorMessage = error instanceof Error ? error.message : String(error) exportError.value = true + connectorExportErrorCode.value = error instanceof SpineConnectorError ? error.code : '' if (error instanceof SpineConnectorError && error.pairUrl) connectorPairUrl.value = error.pairUrl - exportMessage.value = error instanceof Error ? error.message : String(error) + exportMessage.value = errorMessage await refreshConnectorHealth() - await transfer.fail(exportMessage.value) + await transfer.fail(errorMessage) } finally { exportBusy.value = false exportTarget.value = null @@ -1246,6 +1271,7 @@ async function exportSpineImages() { exportBusy.value = true exportTarget.value = 'images' exportError.value = false + connectorExportErrorCode.value = '' connectorPairUrl.value = '' exportMessage.value = '正在整理当前粒子系统使用的图片…' try {