PageSourceSearch

https://arona-note.netlify.app/_astro/SpinePlayer.BHeVZB3M.js

js arona-note.netlify.app collected 2026-10-03 10:28:28 UTC 441,974 bytes, 314 lines download raw bytes

vendor: 10,896 bytes, lines 1-2
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/browserAll.C24f_xP3.js","_astro/webworkerAll.CQrcKCR1.js","_astro/Filter.D4bURMG6.js","_astro/WebGPURenderer.B8NSNx_K.js","_astro/BufferResource.CIFSdiOa.js","_astro/RenderTargetSystem.bDRyAEyo.js","_astro/CanvasPool.DxMD5ozV.js","_astro/WebGLRenderer.BQ6YDYJg.js","_astro/CanvasRenderer.B9uB1Edj.js","_astro/BitmapFont.G2RZkRQk.js"])))=>i.map(i=>d[i]);
2import{T as fh}from"./runtime-dom.esm-bundler.BkDFwomG.js";import{_ as as}from"./preload-helper.CVfkMyKi.js";import{g as Xa}from"./_commonjsHelpers.Cpj98o6Y.js";import{_ as mh}from"./_plugin-vue_export-helper.DlAUqK2U.js";import{c as mn,y as Ri,z as gh,A as ph,C as xh,D as gn,d as yh,o as pn,a as xn,E as bh,F as _e,G as Qe,H as yn,b as bn,I as wh}from"./runtime-core.esm-bundler.z36Am-N8.js";var V=(r=>(r.Application="application",r.WebGLPipes="webgl-pipes",r.WebGLPipesAdaptor="webgl-pipes-adaptor",r.WebGLSystem="webgl-system",r.WebGPUPipes="webgpu-pipes",r.WebGPUPipesAdaptor="webgpu-pipes-adaptor",r.WebGPUSystem="webgpu-system",r.CanvasSystem="canvas-system",r.CanvasPipesAdaptor="canvas-pipes-adaptor",r.CanvasPipes="canvas-pipes",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r.MaskEffect="mask-effect",r.BlendMode="blend-mode",r.TextureSource="texture-source",r.Environment="environment",r.ShapeBuilder="shape-builder",r.Batcher="batcher",r))(V||{});const mr=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r}}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},Us=(r,t)=>mr(r).priority??t,lt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(mr).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...r){return r.map(mr).forEach(t=>{t.type.forEach(e=>{const s=this._addHandlers,i=this._queue;s[e]?s[e]?.(t):(i[e]=i[e]||[],i[e]?.push(t))})}),this},handle(r,t,e){const s=this._addHandlers,i=this._removeHandlers;if(s[r]||i[r])throw new Error(`Extension type ${r} already has a handler`);s[r]=t,i[r]=e;const n=this._queue;return n[r]&&(n[r]?.forEach(o=>t(o)),delete n[r]),this},handleByMap(r,t){return this.handle(r,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(r,t,e=-1){return this.handle(r,s=>{t.findIndex(n=>n.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((n,o)=>Us(o.value,e)-Us(n.value,e)))},s=>{const i=t.findIndex(n=>n.name===s.name);i!==-1&&t.splice(i,1)})},handleByList(r,t,e=-1){return this.handle(r,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((i,n)=>Us(n,e)-Us(i,e)))},s=>{const i=t.indexOf(s.ref);i!==-1&&t.splice(i,1)})},mixin(r,...t){for(const e of t)Object.defineProperties(r.prototype,Object.getOwnPropertyDescriptors(e))}},_h={extension:{type:V.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await as(()=>import("./browserAll.C24f_xP3.js"),__vite__mapDeps([0,1,2]))}},vh={extension:{type:V.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await as(()=>import("./webworkerAll.CQrcKCR1.js"),__vite__mapDeps([1,2]))}};class Yt{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new Yt(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var Fi={exports:{}},wn;function Ah(){return wn||(wn=1,(function(r){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function i(a,h,c){this.fn=a,this.context=h,this.once=c||!1}function n(a,h,c,d,f){if(typeof c!="function")throw new TypeError("The listener must be a function");var u=new i(c,d||a,f),m=e?e+h:h;return a._events[m]?a._events[m].fn?a._events[m]=[a._events[m],u]:a._events[m].push(u):(a._events[m]=u,a._eventsCount++),a}function o(a,h){--a._eventsCount===0?a._events=new s:delete a._events[h]}function l(){this._events=new s,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],c,d;if(this._eventsCount===0)return h;for(d in c=this._events)t.call(c,d)&&h.push(e?d.slice(1):d);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(c)):h},l.prototype.listeners=function(h){var c=e?e+h:h,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,u=d.length,m=new Array(u);f<u;f++)m[f]=d[f].fn;return m},l.prototype.listenerCount=function(h){var c=e?e+h:h,d=this._events[c];return d?d.fn?1:d.length:0},l.prototype.emit=function(h,c,d,f,u,m){var g=e?e+h:h;if(!this._events[g])return!1;var p=this._events[g],b=arguments.length,w,x;if(p.fn){switch(p.once&&this.removeListener(h,p.fn,void 0,!0),b){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,d),!0;case 4:return p.fn.call(p.context,c,d,f),!0;case 5:return p.fn.call(p.context,c,d,f,u),!0;case 6:return p.fn.call(p.context,c,d,f,u,m),!0}for(x=1,w=new Array(b-1);x<b;x++)w[x-1]=arguments[x];p.fn.apply(p.context,w)}else{var y=p.length,_;for(x=0;x<y;x++)switch(p[x].once&&this.removeListener(h,p[x].fn,void 0,!0),b){case 1:p[x].fn.call(p[x].context);break;case 2:p[x].fn.call(p[x].context,c);break;case 3:p[x].fn.call(p[x].context,c,d);break;case 4:p[x].fn.call(p[x].context,c,d,f);break;default:if(!w)for(_=1,w=new Array(b-1);_<b;_++)w[_-1]=arguments[_];p[x].fn.apply(p[x].context,w)}}return!0},l.prototype.on=function(h,c,d){return n(this,h,c,d,!1)},l.prototype.once=function(h,c,d){return n(this,h,c,d,!0)},l.prototype.removeListener=function(h,c,d,f){var u=e?e+h:h;if(!this._events[u])return this;if(!c)return o(this,u),this;var m=this._events[u];if(m.fn)m.fn===c&&(!f||m.once)&&(!d||m.context===d)&&o(this,u);else{for(var g=0,p=[],b=m.length;g<b;g++)(m[g].fn!==c||f&&!m[g].once||d&&m[g].context!==d)&&p.push(m[g]);p.length?this._events[u]=p.length===1?p[0]:p:o(this,u)}return this},l.prototype.removeAllListeners=function(h){var c;return h?(c=e?e+h:h,this._events[c]&&o(this,c)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=e,l.EventEmitter=l,r.exports=l})(Fi)),Fi.exports}var Ch=Ah();const Pe=Xa(Ch),Sh=Math.PI*2,kh=180/Math.PI,Mh=Math.PI/180;class Lt{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new Lt(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Bi.x=0,Bi.y=0,Bi}}const Bi=new Lt;class st{constructor(t=1,e=0,s=0,i=1,n=0,o=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=i,this.tx=n,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,s,i,n,o){return this.a=t,this.b=e,this.c=s,this.d=i,this.tx=n,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new Lt;const s=t.x,i=t.y;return e.x=this.a*s+this.c*i+this.tx,e.y=this.b*s+this.d*i+this.ty,e}applyInverse(t,e){e=e||new Lt;const s=this.a,i=this.b,n=this.c,o=this.d,l=this.tx,a=this.ty,h=1/(s*o+n*-i),c=t.x,d=t.y;return e.x=o*h*c+-n*h*d+(a*n-l*o)*h,e.y=s*h*d+-i*h*c+(-a*s+l*i)*h,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),s=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*s,this.b=i*s+this.b*e,this.c=n*e-this.d*s,this.d=n*s+this.d*e,this.tx=o*e-this.ty*s,this.ty=o*s+this.ty*e,this}append(t){const e=this.a,s=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*s+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*s+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*s+t.ty*n+this.ty,this}appendFrom(t,e){const s=t.a,i=t.b,n=t.c,o=t.d,l=t.tx,a=t.ty,h=e.a,c=e.b,d=e.c,f=e.d;return this.a=s*h+i*d,this.b=s*c+i*f,this.c=n*h+o*d,this.d=n*c+o*f,this.tx=l*h+a*d+e.tx,this.ty=l*c+a*f+e.ty,this}setTransform(t,e,s,i,n,o,l,a,h){return this.a=Math.cos(l+h)*n,this.b=Math.sin(l+h)*n,this.c=-Math.sin(l-a)*o,this.d=Math.cos(l-a)*o,this.tx=t-(s*this.a+i*this.c),this.ty=e-(s*this.b+i*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,i=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,s=this.b,i=this.c,n=this.d,o=t.pivot,l=-Math.atan2(-i,n),a=Math.atan2(s,e),h=Math.abs(l+a);return h<1e-5||Math.abs(Sh-h)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=l,t.skew.y=a),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*s+o.y*n),t}invert(){const t=this.a,e=this.b,s=this.c,i=this.d,n=this.tx,o=t*i-e*s;return this.a=i/o,this.b=-e/o,this.c=-s/o,this.d=t/o,this.tx=(s*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new st;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return Ph.identity()}static get shared(){return Th.identity()}}const Th=new st,Ph=new st,Ye=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],De=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Le=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Xe=[
vendor: 7,091 bytes, lines 2-5
21,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],gr=[],Oa=[],Ws=Math.sign;function Ih(){for(let r=0;r<16;r++){const t=[];gr.push(t);for(let e=0;e<16;e++){const s=Ws(Ye[r]*Ye[e]+Le[r]*De[e]),i=Ws(De[r]*Ye[e]+Xe[r]*De[e]),n=Ws(Ye[r]*Le[e]+Le[r]*Xe[e]),o=Ws(De[r]*Le[e]+Xe[r]*Xe[e]);for(let l=0;l<16;l++)if(Ye[l]===s&&De[l]===i&&Le[l]===n&&Xe[l]===o){t.push(l);break}}}for(let r=0;r<16;r++){const t=new st;t.set(Ye[r],De[r],Le[r],Xe[r],0,0),Oa.push(t)}}Ih();const ot={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:r=>Ye[r],uY:r=>De[r],vX:r=>Le[r],vY:r=>Xe[r],inv:r=>r&8?r&15:-r&7,add:(r,t)=>gr[r][t],sub:(r,t)=>gr[r][ot.inv(t)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,t)=>Math.abs(r)*2<=Math.abs(t)?t>=0?ot.S:ot.N:Math.abs(t)*2<=Math.abs(r)?r>0?ot.E:ot.W:t>0?r>0?ot.SE:ot.SW:r>0?ot.NE:ot.NW,matrixAppendRotationInv:(r,t,e=0,s=0,i=0,n=0)=>{const o=Oa[ot.inv(t)],l=o.a,a=o.b,h=o.c,c=o.d,d=e-Math.min(0,l*i,h*n,l*i+h*n),f=s-Math.min(0,a*i,c*n,a*i+c*n),u=r.a,m=r.b,g=r.c,p=r.d;r.a=l*u+a*g,r.b=l*m+a*p,r.c=h*u+c*g,r.d=h*m+c*p,r.tx=d*u+f*g+r.tx,r.ty=d*m+f*p+r.ty},transformRectCoords:(r,t,e,s)=>{const{x:i,y:n,width:o,height:l}=r,{x:a,y:h,width:c,height:d}=t;return e===ot.E?(s.set(i+a,n+h,o,l),s):e===ot.S?s.set(c-n-l+a,i+h,l,o):e===ot.W?s.set(c-i-o+a,d-n-l+h,o,l):e===ot.N?s.set(n+a,d-i-o+h,l,o):s.set(i+a,n+h,o,l)}},Hs=[new Lt,new Lt,new Lt,new Lt];class Pt{constructor(t=0,e=0,s=0,i=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(i)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Pt(0,0,0,0)}clone(){return new Pt(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,s,i=.5){const{width:n,height:o}=this;if(n<=0||o<=0)return!1;const l=this.x,a=this.y,h=s*(1-i),c=s-h,d=l-h,f=l+n+h,u=a-h,m=a+o+h,g=l+c,p=l+n-c,b=a+c,w=a+o-c;return t>=d&&t<=f&&e>=u&&e<=m&&!(t>g&&t<p&&e>b&&e<w)}intersects(t,e){if(!e){const C=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=C)return!1;const k=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>k}const s=this.left,i=this.right,n=this.top,o=this.bottom;if(i<=s||o<=n)return!1;const l=Hs[0].set(t.left,t.top),a=Hs[1].set(t.left,t.bottom),h=Hs[2].set(t.right,t.top),c=Hs[3].set(t.right,t.bottom);if(h.x<=l.x||a.y<=l.y)return!1;const d=Math.sign(e.a*e.d-e.b*e.c);if(d===0||(e.apply(l,l),e.apply(a,a),e.apply(h,h),e.apply(c,c),Math.max(l.x,a.x,h.x,c.x)<=s||Math.min(l.x,a.x,h.x,c.x)>=i||Math.max(l.y,a.y,h.y,c.y)<=n||Math.min(l.y,a.y,h.y,c.y)>=o))return!1;const f=d*(a.y-l.y),u=d*(l.x-a.x),m=f*s+u*n,g=f*i+u*n,p=f*s+u*o,b=f*i+u*o;if(Math.max(m,g,p,b)<=f*l.x+u*l.y||Math.min(m,g,p,b)>=f*c.x+u*c.y)return!1;const w=d*(l.y-h.y),x=d*(h.x-l.x),y=w*s+x*n,_=w*i+x*n,v=w*s+x*o,A=w*i+x*o;return!(Math.max(y,_,v,A)<=w*l.x+x*l.y||Math.min(y,_,v,A)>=w*c.x+x*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=i,this.height=Math.max(n-i,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=i-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=i,this.height=n-i,this}getBounds(t){return t||(t=new Pt),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,s=t.y,i=t.x+t.width,n=t.y+t.height;return e>=this.x&&e<this.x+this.width&&s>=this.y&&s<this.y+this.height&&i>=this.x&&i<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Yi={default:-1};function wt(r="default"){return Yi[r]===void 0&&(Yi[r]=-1),++Yi[r]}const _n=new Set,At="8.0.0",Eh="8.3.4",rs={quiet:!1,noColor:!1},at=((r,t,e=3)=>{if(rs.quiet||_n.has(t))return;let s=new Error().stack;const i=`${t}
3Deprecated since v${r}`,n=typeof console.groupCollapsed=="function"&&!rs.noColor;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",i):(s=s.split(`
4`).splice(e).join(`
5`),n?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",i),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",i),console.warn(s))),_n.add(t)});Object.defineProperties(at,{quiet:{get:()=>rs.quiet,set:r=>{rs.quiet=r},enumerable:!0,configurable:!1},noColor:{get:()=>rs.noColor,set:r=>{rs.noColor=r},enumerable:!0,configurable:!1}});const Ga=()=>{};function vn(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function An(r){return!(r&r-1)&&!!r}function Na(r){const t={};for(const e in r)r[e]!==void 0&&(t[e]=r[e]);return t}const Cn=Object.create(null);function Rh(r){const t=Cn[r];return t===void 0&&(Cn[r]=wt("resource")),t}const Va=class za extends Pe{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...za.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){at(At,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}
5update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Rh(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Va.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Ua=Va;const Wa=class Ha extends Pe{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=wt("textureSource"),this._resourceType="textureSource",this._resourceId=wt("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Ha.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.viewDimension=t.viewDimension??t.dimensions,this.arrayLayerCount=t.arrayLayerCount,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new Ua(Na(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=wt("resource"),this.emit("change",this),this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,s){s||(s=this._resolution),t||(t=this.width),e||(e=this.height);const i=Math.round(t*s),n=Math.round(e*s);return this.width=i/s,this.height=n/s,this._resolution=s,this.pixelWidth===i&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=n,this.emit
vendor: 8,367 bytes, line 5
5("resize",this),this._resourceId=wt("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=An(this.pixelWidth)&&An(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Wa.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let Ht=Wa;class Br extends Ht{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let s=t.format;s||(e instanceof Float32Array?s="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?s="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?s="rgba16uint":(e instanceof Int8Array,s="bgra8unorm")),super({...t,resource:e,format:s}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}Br.extension=V.TextureSource;const Sn=new st;class Fh{constructor(t,e){this.mapCoord=new st,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){e===void 0&&(e=t);const s=this.mapCoord;for(let i=0;i<t.length;i+=2){const n=t[i],o=t[i+1];e[i]=n*s.a+o*s.c+s.tx,e[i+1]=n*s.b+o*s.d+s.ty}return e}update(){const t=this._texture;this._updateID++;const e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);const s=t.orig,i=t.trim;i&&(Sn.set(s.width/i.width,0,0,s.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(Sn));const n=t.source,o=this.uClampFrame,l=this.clampMargin/n._resolution,a=this.clampOffset/n._resolution;return o[0]=(t.frame.x+l+a)/n.width,o[1]=(t.frame.y+l+a)/n.height,o[2]=(t.frame.x+t.frame.width-l+a)/n.width,o[3]=(t.frame.y+t.frame.height-l+a)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=t.frame.width===n.width&&t.frame.height===n.height&&t.rotate===0,!0}}let it=class extends Pe{constructor({source:t,label:e,frame:s,orig:i,trim:n,defaultAnchor:o,defaultBorders:l,rotate:a,dynamic:h}={}){if(super(),this.uid=wt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Pt,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new Ht,this.noFrame=!s,s)this.frame.copyFrom(s);else{const{width:c,height:d}=this._source;this.frame.width=c,this.frame.height=d}this.orig=i||this.frame,this.trim=n,this.rotate=a??0,this.defaultAnchor=o,this.defaultBorders=l,this.destroyed=!1,this.dynamic=h||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new Fh(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:e}=this,{width:s,height:i}=this._source,n=e.x/s,o=e.y/i,l=e.width/s,a=e.height/i;let h=this.rotate;if(h){const c=l/2,d=a/2,f=n+c,u=o+d;h=ot.add(h,ot.NW),t.x0=f+c*ot.uX(h),t.y0=u+d*ot.uY(h),h=ot.add(h,2),t.x1=f+c*ot.uX(h),t.y1=u+d*ot.uY(h),h=ot.add(h,2),t.x2=f+c*ot.uX(h),t.y2=u+d*ot.uY(h),h=ot.add(h,2),t.x3=f+c*ot.uX(h),t.y3=u+d*ot.uY(h)}else t.x0=n,t.y0=o,t.x1=n+l,t.y1=o,t.x2=n+l,t.y2=o+a,t.x3=n,t.y3=o+a}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return at(At,"Texture.baseTexture is now Texture.source"),this._source}};it.EMPTY=new it({label:"EMPTY",source:new Ht({label:"EMPTY"})});it.EMPTY.destroy=Ga;it.WHITE=new it({source:new Br({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});it.WHITE.destroy=Ga;function Bh(r,t,e){const{width:s,height:i}=e.orig,n=e.trim;if(n){const o=n.width,l=n.height;r.minX=n.x-t._x*s,r.maxX=r.minX+o,r.minY=n.y-t._y*i,r.maxY=r.minY+l}else r.minX=-t._x*s,r.maxX=r.minX+s,r.minY=-t._y*i,r.maxY=r.minY+i}const kn=new st;class ie{constructor(t=1/0,e=1/0,s=-1/0,i=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=kn,this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Pt);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=kn,this}set(t,e,s,i){this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}addFrame(t,e,s,i,n){n||(n=this.matrix);const o=n.a,l=n.b,a=n.c,h=n.d,c=n.tx,d=n.ty;let f=this.minX,u=this.minY,m=this.maxX,g=this.maxY,p=o*t+a*e+c,b=l*t+h*e+d;p<f&&(f=p),b<u&&(u=b),p>m&&(m=p),b>g&&(g=b),p=o*s+a*e+c,b=l*s+h*e+d,p<f&&(f=p),b<u&&(u=b),p>m&&(m=p),b>g&&(g=b),p=o*t+a*i+c,b=l*t+h*i+d,p<f&&(f=p),b<u&&(u=b),p>m&&(m=p),b>g&&(g=b),p=o*s+a*i+c,b=l*s+h*i+d,p<f&&(f=p),b<u&&(u=b),p>m&&(m=p),b>g&&(g=b),this.minX=f,this.minY=u,this.maxX=m,this.maxY=g}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const e=this.minX,s=this.minY,i=this.maxX,n=this.maxY,{a:o,b:l,c:a,d:h,tx:c,ty:d}=t;let f=o*e+a*s+c,u=l*e+h*s+d;this.minX=f,this.minY=u,this.maxX=f,this.maxY=u,f=o*i+a*s+c,u=l*i+h*s+d,this.minX=f<this.minX?f:this.minX,this.minY=u<this.minY?u:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=u>this.maxY?u:this.maxY,f=o*e+a*n+c,u=l*e+h*n+d,this.minX=f<this.minX?f:this.minX,this.minY=u<this.minY?u:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=u>this.maxY?u:this.maxY,f=o*i+a*n+c,u=l*i+h*n+d,this.minX=f<this.minX?f:this.minX,this.minY=u<this.minY?u:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=u>this.maxY?u:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,s,i){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<s&&(this.minY=s),this.maxY>i&&(this.maxY=i),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new ie(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,s,i){let n=this.minX,o=this.minY,l=this.maxX,a=this.maxY;
vendor: 6,355 bytes, line 5
5i||(i=this.matrix);const h=i.a,c=i.b,d=i.c,f=i.d,u=i.tx,m=i.ty;for(let g=e;g<s;g+=2){const p=t[g],b=t[g+1],w=h*p+d*b+u,x=c*p+f*b+m;n=w<n?w:n,o=x<o?x:o,l=w>l?w:l,a=x>a?x:a}this.minX=n,this.minY=o,this.maxX=l,this.maxY=a}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var Yh={grad:.9,turn:360,rad:360/(2*Math.PI)},ve=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},Mt=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*r)/e+0},$t=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),r>e?e:r>t?r:t},$a=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},Mn=function(r){return{r:$t(r.r,0,255),g:$t(r.g,0,255),b:$t(r.b,0,255),a:$t(r.a)}},Di=function(r){return{r:Mt(r.r),g:Mt(r.g),b:Mt(r.b),a:Mt(r.a,3)}},Dh=/^#([0-9a-f]{3,8})$/i,$s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},qa=function(r){var t=r.r,e=r.g,s=r.b,i=r.a,n=Math.max(t,e,s),o=n-Math.min(t,e,s),l=o?n===t?(e-s)/o:n===e?2+(s-t)/o:4+(t-e)/o:0;return{h:60*(l<0?l+6:l),s:n?o/n*100:0,v:n/255*100,a:i}},ja=function(r){var t=r.h,e=r.s,s=r.v,i=r.a;t=t/360*6,e/=100,s/=100;var n=Math.floor(t),o=s*(1-e),l=s*(1-(t-n)*e),a=s*(1-(1-t+n)*e),h=n%6;return{r:255*[s,l,o,o,a,s][h],g:255*[a,s,s,l,o,o][h],b:255*[o,o,a,s,s,l][h],a:i}},Tn=function(r){return{h:$a(r.h),s:$t(r.s,0,100),l:$t(r.l,0,100),a:$t(r.a)}},Pn=function(r){return{h:Mt(r.h),s:Mt(r.s),l:Mt(r.l),a:Mt(r.a,3)}},In=function(r){return ja((e=(t=r).s,{h:t.h,s:(e*=((s=t.l)<50?s:100-s)/100)>0?2*e/(s+e)*100:0,v:s+e,a:t.a}));var t,e,s},Ps=function(r){return{h:(t=qa(r)).h,s:(i=(200-(e=t.s))*(s=t.v)/100)>0&&i<200?e*s/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,e,s,i},Lh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Oh=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Gh=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pr={string:[[function(r){var t=Dh.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?Mt(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?Mt(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=Oh.exec(r)||Gh.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:Mn({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(r){var t=Lh.exec(r)||Xh.exec(r);if(!t)return null;var e,s,i=Tn({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(Yh[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return In(i)},"hsl"]],object:[[function(r){var t=r.r,e=r.g,s=r.b,i=r.a,n=i===void 0?1:i;return ve(t)&&ve(e)&&ve(s)?Mn({r:Number(t),g:Number(e),b:Number(s),a:Number(n)}):null},"rgb"],[function(r){var t=r.h,e=r.s,s=r.l,i=r.a,n=i===void 0?1:i;if(!ve(t)||!ve(e)||!ve(s))return null;var o=Tn({h:Number(t),s:Number(e),l:Number(s),a:Number(n)});return In(o)},"hsl"],[function(r){var t=r.h,e=r.s,s=r.v,i=r.a,n=i===void 0?1:i;if(!ve(t)||!ve(e)||!ve(s))return null;var o=(function(l){return{h:$a(l.h),s:$t(l.s,0,100),v:$t(l.v,0,100),a:$t(l.a)}})({h:Number(t),s:Number(e),v:Number(s),a:Number(n)});return ja(o)},"hsv"]]},En=function(r,t){for(var e=0;e<t.length;e++){var s=t[e][0](r);if(s)return[s,t[e][1]]}return[null,void 0]},Nh=function(r){return typeof r=="string"?En(r.trim(),pr.string):typeof r=="object"&&r!==null?En(r,pr.object):[null,void 0]},Li=function(r,t){var e=Ps(r);return{h:e.h,s:$t(e.s+100*t,0,100),l:e.l,a:e.a}},Xi=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},Rn=function(r,t){var e=Ps(r);return{h:e.h,s:e.s,l:$t(e.l+100*t,0,100),a:e.a}},xr=(function(){function r(t){this.parsed=Nh(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return Mt(Xi(this.rgba),2)},r.prototype.isDark=function(){return Xi(this.rgba)<.5},r.prototype.isLight=function(){return Xi(this.rgba)>=.5},r.prototype.toHex=function(){return t=Di(this.rgba),e=t.r,s=t.g,i=t.b,o=(n=t.a)<1?$s(Mt(255*n)):"","#"+$s(e)+$s(s)+$s(i)+o;var t,e,s,i,n,o},r.prototype.toRgb=function(){return Di(this.rgba)},r.prototype.toRgbString=function(){return t=Di(this.rgba),e=t.r,s=t.g,i=t.b,(n=t.a)<1?"rgba("+e+", "+s+", "+i+", "+n+")":"rgb("+e+", "+s+", "+i+")";var t,e,s,i,n},r.prototype.toHsl=function(){return Pn(Ps(this.rgba))},r.prototype.toHslString=function(){return t=Pn(Ps(this.rgba)),e=t.h,s=t.s,i=t.l,(n=t.a)<1?"hsla("+e+", "+s+"%, "+i+"%, "+n+")":"hsl("+e+", "+s+"%, "+i+"%)";var t,e,s,i,n},r.prototype.toHsv=function(){return t=qa(this.rgba),{h:Mt(t.h),s:Mt(t.s),v:Mt(t.v),a:Mt(t.a,3)};var t},r.prototype.invert=function(){return ce({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},r.prototype.saturate=function(t){return t===void 0&&(t=.1),ce(Li(this.rgba,t))},r.prototype.desaturate=function(t){return t===void 0&&(t=.1),ce(Li(this.rgba,-t))},r.prototype.grayscale=function(){return ce(Li(this.rgba,-1))},r.prototype.lighten=function(t){return t===void 0&&(t=.1),ce(Rn(this.rgba,t))},r.prototype.darken=function(t){return t===void 0&&(t=.1),ce(Rn(this.rgba,-t))},r.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},r.prototype.alpha=function(t){return typeof t=="number"?ce({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):Mt(this.rgba.a,3);var e},r.prototype.hue=function(t){var e=Ps(this.rgba);return typeof t=="number"?ce({h:t,s:e.s,l:e.l,a:e.a}):Mt(e.h)},r.prototype.isEqual=function(t){return this.toHex()===ce(t).toHex()},r})(),ce=function(r){return r instanceof xr?r:new xr(r)},Fn=[],Vh=function(r){r.forEach(function(t){Fn.indexOf(t)<0&&(t(xr,pr),Fn.push(t))})};
vendor: 8,556 bytes, line 5
5function zh(r,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var i in e)s[e[i]]=i;var n={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var l,a,h=s[this.toHex()];if(h)return h;if(o?.closest){var c=this.toRgb(),d=1/0,f="black";if(!n.length)for(var u in e)n[u]=new r(e[u]).toRgb();for(var m in e){var g=(l=c,a=n[m],Math.pow(l.r-a.r,2)+Math.pow(l.g-a.g,2)+Math.pow(l.b-a.b,2));g<d&&(d=g,f=m)}return f}},t.string.push([function(o){var l=o.toLowerCase(),a=l==="transparent"?"#0000":e[l];return a?new r(a).toRgb():null},"name"])}Vh([zh]);const ds=class Ss{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof Ss)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,e){const s=typeof t;if(s!==typeof e)return!1;if(s==="number"||s==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((n,o)=>n===e[o]);if(t!==null&&e!==null){const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(l=>t[l]===e[l])}return t===e}toRgba(){const[t,e,s,i]=this._components;return{r:t,g:e,b:s,a:i}}toRgb(){const[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){const[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){const[e,s,i]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(s*255),t[2]=Math.round(i*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,s,i,n]=this._components;return t[0]=e,t[1]=s,t[2]=i,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,s,i]=this._components;return t[0]=e,t[1]=s,t[2]=i,t}toNumber(){return this._int}toBgrNumber(){const[t,e,s]=this.toUint8RgbArray();return(s<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,s,i,n]=Ss._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=i,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let s=this._int>>16&255,i=this._int>>8&255,n=this._int&255;return e&&(s=s*t+.5|0,i=i*t+.5|0,n=n*t+.5|0),(t*255<<24)+(s<<16)+(i<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(t){let e,s,i,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,s=(o>>8&255)/255,i=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,i,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,s,i,n=255]=t,e/=255,s/=255,i/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const l=Ss.HEX_PATTERN.exec(t);l&&(t=`#${l[2]}`)}const o=ce(t);o.isValid()&&({r:e,g:s,b:i,a:n}=o.rgba,e/=255,s/=255,i/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=s,this._components[2]=i,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,e,s]=this._components;this._int=(t*255<<16)+(e*255<<8)+(s*255|0)}_clamp(t,e=0,s=1){return typeof t=="number"?Math.min(Math.max(t,e),s):(t.forEach((i,n)=>{t[n]=Math.min(Math.max(i,e),s)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof Ss||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};ds.shared=new ds;ds._temp=new ds;ds.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Wt=ds;const Uh={cullArea:null,cullable:!1,cullableChildren:!0};let Oi=0;const Bn=500;function xt(...r){Oi!==Bn&&(Oi++,Oi===Bn?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r))}const yi={_registeredResources:new Set,register(r){this._registeredResources.add(r)},unregister(r){this._registeredResources.delete(r)}
5,release(){this._registeredResources.forEach(r=>r.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(r){return this._registeredResources.has(r)},reset(){this._registeredResources.clear()}};let Wh=class{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return this._index>0?e=this._pool[--this._index]:(e=new this._classType,this._count++),e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}};class Hh{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new Wh(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(e=>{const s=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[s]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}}const zt=new Hh;yi.register(zt);const $h={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===!0?{}:r))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){at("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r)}};function qh(r,t,e){const s=r.length;let i;if(t>=s||e===0)return;e=t+e>s?s-t:e;const n=s-e;for(i=t;i<n;++i)r[i]=r[i+e];r.length=n}const jh={allowChildren:!0,removeChildren(r=0,t){const e=t??this.children.length,s=e-r,i=[];if(s>0&&s<=e){for(let o=e-1;o>=r;o--){const l=this.children[o];l&&(i.push(l),l.parent=null)}qh(this.children,r,e);const n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(i);for(let o=0;o<i.length;++o){const l=i[o];l.parentRenderLayer?.detach(l),this.emit("childRemoved",l,this,o),i[o].emit("removed",this)}return i.length>0&&this._didViewChangeTick++,i}else if(s===0&&this.children.length===0)return i;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(r){const t=this.getChildAt(r);return this.removeChild(t)},getChildAt(r){if(r<0||r>=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,t)},getChildIndex(r){const t=this.children.indexOf(r);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(r,t){this.allowChildren||at(At,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:e}=this;if(t<0||t>e.length)throw new Error(`${r}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);const s=r.parent===this;if(r.parent){const n=r.parent.children.indexOf(r);if(s){if(n===t)return r;r.parent.children.splice(n,1)}else r.removeFromParent()}t===e.length?e.push(r):e.splice(t,0,r),r.parent=this,r.didChange=!0,r._updateFlags=15;const i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(r),this.sortableChildren&&(this.sortDirty=!0),s||(this.emit("childAdded",r,this,t),r.emit("added",this)),r},swapChildren(r,t){if(r===t)return;const e=this.getChildIndex(r),s=this.getChildIndex(t);this.children[e]=t,this.children[s]=r;const i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(t=>this.reparentChildAt(t,this.children.length)),r[0])},reparentChildAt(r,t){if(r.parent===this)return this.setChildIndex(r,t),r;const e=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,t);const s=this.worldTransform.clone();return s.invert(),e.prepend(s),r.setFromMatrix(e),r},replaceChild(r,t){r.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(r)),t.setFromMatrix(r.localTransform),t.updateLocalTransform(),this.removeChild(r)}},Kh={collectRenderables(r,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(r,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,r):this.collectRenderablesWithEffects(r,t,e))},collectRenderablesSimple(r,t,e){const s=this.children,i=s.length;for(let n=0;n<i;n++)s[n].collectRenderables(r,t,e)},collectRenderablesWithEffects(r,t,e){const{renderPipes:s}=t;
vendor: 32,113 bytes, line 5
5for(let i=0;i<this.effects.length;i++){const n=this.effects[i];s[n.pipe].push(n,this,r)}this.collectRenderablesSimple(r,t,e);for(let i=this.effects.length-1;i>=0;i--){const n=this.effects[i];s[n.pipe].pop(n,this,r)}}};class Yn{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}class Zh{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){const s=this._tests[e];if(s.test(t))return zt.get(s.maskClass,t)}return t}returnMaskEffect(t){zt.return(t)}}const yr=new Zh;lt.handleByList(V.MaskEffect,yr._effectClasses);const Qh={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0)},addEffect(r){this.effects.indexOf(r)===-1&&(this.effects.push(r),this.effects.sort((e,s)=>e.priority-s.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(r){const t=this.effects.indexOf(r);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(r){const t=this._maskEffect;t?.mask!==r&&(t&&(this.removeEffect(t),yr.returnMaskEffect(t),this._maskEffect=null),r!=null&&(this._maskEffect=yr.getMaskEffect(r),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged()},set filters(r){!Array.isArray(r)&&r&&(r=[r]);const t=this._filterEffect||(this._filterEffect=new Yn);r=r;const e=r?.length>0,s=t.filters?.length>0,i=e!==s;r=Array.isArray(r)?r.slice(0):r,t.filters=Object.freeze(r),i&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=r??null))},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new Yn),this._filterEffect.filterArea=r},get filterArea(){return this._filterEffect?.filterArea}},Jh={label:null,get name(){return at(At,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){at(At,"Container.name property has been removed, use Container.label instead"),this.label=r},getChildByName(r,t=!1){return this.getChildByLabel(r,t)},getChildByLabel(r,t=!1){const e=this.children;for(let s=0;s<e.length;s++){const i=e[s];if(i.label===r||r instanceof RegExp&&r.test(i.label))return i}if(t)for(let s=0;s<e.length;s++){const n=e[s].getChildByLabel(r,!0);if(n)return n}return null},getChildrenByLabel(r,t=!1,e=[]){const s=this.children;for(let i=0;i<s.length;i++){const n=s[i];(n.label===r||r instanceof RegExp&&r.test(n.label))&&e.push(n)}if(t)for(let i=0;i<s.length;i++)s[i].getChildrenByLabel(r,!0,e);return e}},Ot=zt.getPool(st),Se=zt.getPool(ie),tc=new st,ec={getFastGlobalBounds(r,t){t||(t=new ie),t.clear(),this._getGlobalBoundsRecursive(!!r,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);const e=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(e.worldTransform),t},_getGlobalBoundsRecursive(r,t,e){let s=t;if(r&&this.parentRenderLayer&&this.parentRenderLayer!==e||this.localDisplayStatus!==7||!this.measurable)return;const i=!!this.effects.length;if((this.renderGroup||i)&&(s=Se.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const o=this.bounds;s.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform)}const n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(r,s,e)}if(i){let n=!1;const o=this.renderGroup||this.parentRenderGroup;for(let l=0;l<this.effects.length;l++)this.effects[l].addBounds&&(n||(n=!0,s.applyMatrix(o.worldTransform)),this.effects[l].addBounds(s,!0));n&&s.applyMatrix(o.worldTransform.copyTo(tc).invert()),t.addBounds(s),Se.return(s)}else this.renderGroup&&(t.addBounds(s,this.relativeGroupTransform),Se.return(s))}};function Ka(r,t,e){e.clear();let s,i;return r.parent?t?s=r.parent.worldTransform:(i=Ot.get().identity(),s=Yr(r,i)):s=st.IDENTITY,Za(r,e,s,t),i&&Ot.return(i),e.isValid||e.set(0,0,0,0),e}function Za(r,t,e,s){if(!r.visible||!r.measurable)return;let i;s?i=r.worldTransform:(r.updateLocalTransform(),i=Ot.get(),i.appendFrom(r.localTransform,e));const n=t,o=!!r.effects.length;if(o&&(t=Se.get().clear()),r.boundsArea)t.addRect(r.boundsArea,i);else{const l=r.bounds;l&&!l.isEmpty()&&(t.matrix=i,t.addBounds(l));for(let a=0;a<r.children.length;a++)Za(r.children[a],t,i,s)}if(o){for(let l=0;l<r.effects.length;l++)r.effects[l].addBounds?.(t);n.addBounds(t,st.IDENTITY),Se.return(t)}s||Ot.return(i)}function Yr(r,t){const e=r.parent;return e&&(Yr(e,t),e.updateLocalTransform(),t.append(e.localTransform)),t}function Qa(r,t){if(r===16777215||!t)return t;if(t===16777215||!r)return r;const e=r>>16&255,s=r>>8&255,i=r&255,n=t>>16&255,o=t>>8&255,l=t&255,a=e*n/255|0,h=s*o/255|0,c=i*l/255|0;return(a<<16)+(h<<8)+c}const Dn=16777215;function Ln(r,t){return r===Dn?t:t===Dn?r:Qa(r,t)}function ni(r){return((r&255)<<16)+(r&65280)+(r>>16&255)}const sc={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,e=this.parent;for(;e;)t*=e.alpha,e=e.parent;return t},getGlobalTransform(r=new st,t){if(t)return r.copyFrom(this.worldTransform);this.updateLocalTransform();const e=Yr(this,Ot.get().identity());return r.appendFrom(this.localTransform,e),Ot.return(e),r},getGlobalTint(r){if(r)return this.renderGroup?ni(this.renderGroup.worldColor):this.parentRenderGroup?ni(Ln(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=Ln(t,e.localColor),e=e.parent;return ni(t)}};function Ja(r,t,e){return t.clear(),e||(e=st.IDENTITY),to(r,t,e,r,!0),t.isValid||t.set(0,0,0,0),t}function to(r,t,e,s,i){let n;if(i)n=Ot.get(),n=e.copyTo(n);else{if(!r.visible||!r.measurable)return;r.updateLocalTransform();const a=r.localTransform;n=Ot.get(),n.appendFrom(a,e)}const o=t,l=!!r.effects.length;if(l&&(t=Se.get().clear()),r.boundsArea)t.addRect(r.boundsArea,n);else{r.renderPipeId&&(t.matrix=n,t.addBounds(r.bounds));const a=r.children;for(let h=0;h<a.length;h++)to(a[h],t,n,s,!1)}if(l){for(let a=0;a<r.effects.length;a++)r.effects[a].addLocalBounds?.(t,s);o.addBounds(t,st.IDENTITY),Se.return(t)}Ot.return(n)}function eo(r,t){const e=r.children;for(let s=0;s<e.length;s++){const i=e[s],n=i.uid,o=(i._didViewChangeTick&65535)<<16|i._didContainerChangeTick&65535,l=t.index;(t.data[l]!==n||t.data[l+1]!==o)&&(t.data[t.index]=n,t.data[t.index+1]=o,t.didChange=!0),t.index=l+2,i.children.length&&eo(i,t)}return t.didChange}const ic=new st,rc={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(r,t){const e=Math.sign(this.scale.x)||1;t!==0?this.scale.x=r/t*e:this.scale.x=e},_setHeight(r,t){const e=Math.sign(this.scale.y)||1;t!==0?this.scale.y=r/t*e:this.scale.y=e},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new ie});const r=this._localBoundsCacheData;return r.index=1,r.didChange=!1,r.data[0]!==this._didViewChangeTick&&(r.didChange=!0,r.data[0]=this._didViewChangeTick),eo(this,r),r.didChange&&Ja(this,r.localBounds,ic),r.localBounds},getBounds(r,t){return Ka(this,r,t||new ie)}},nc={_onRender:null,set onRender(r){const t=this.renderGroup||this.parentRenderGroup;if(!r){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=r},get onRender(){return this._onRender}},ac={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(r){this._zIndex!==r&&(this._zIndex=r,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(oc))}};function oc(r,t){return r._zIndex-t._zIndex}const lc={getGlobalPosition(r=new Lt,t=!1){return this.parent?this.parent.toGlobal(this._position,r,t):(r.x=this._position.x,r.y=this._position.y),r},toGlobal(r,t,e=!1){const s=this.getGlobalTransform(Ot.get(),e);return t=s.apply(r,t),Ot.return(s),t},toLocal(r,t,e,s){t&&(r=t.toGlobal(r,e,s));const i=this.getGlobalTransform(Ot.get(),s);return e=i.applyInverse(r,e),Ot.return(i),e}};class Dr{constructor(){this.uid=wt("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let hc=0;class cc{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new Ua(this.textureOptions)}createTexture(t,e,s,i){const n=new Ht({...this.textureOptions,width:t,height:e,resolution:1,antialias:s,autoGarbageCollect:!1,autoGenerateMipmaps:i});return new it({source:n,label:`texturePool_${hc++}`})}getOptimalTexture(t,e,s=1,i,n=!1){let o=Math.ceil(t*s-1e-6),l=Math.ceil(e*s-1e-6);o=vn(o),l=vn(l);const a=i?1:0,h=n?1:0,c=(o<<17)+(l<<2)+(h<<1)+a;this._texturePool[c]||(this._texturePool[c]=[]);let d=this._texturePool[c].pop();return d||(d=this.createTexture(o,l,i,n)),d.source._resolution=s,d.source.width=o/s,d.source.height=l/s,d.source.pixelWidth=o,d.source.pixelHeight=l,d.frame.x=0,d.frame.y=0,d.frame.width=t,d.frame.height=e,d.updateUvs(),this._poolKeyHash[d.uid]=c,d}getSameSizeTexture(t,e=!1){const s=t.source;return this.getOptimalTexture(t.width,t.height,s._resolution,e)}returnTexture(t,e=!1){const s=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[s].push(t)}clear(t){if(t=t!==!1,t)for(const e in this._texturePool){const s=this._texturePool[e];if(s)for(let i=0;i<s.length;i++)s[i].destroy(!0)}this._texturePool={}}}const so=new cc;yi.register(so);class dc{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new st,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new Dr,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const e=t.children;for(let s=0;s<e.length;s++){const i=e[s];i._updateFlags=15,this.addChild(i)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(so.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const e=t.children;for(let s=0;s<e.length;s++)this.addChild(e[s])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}const e=t.children;for(let s=0;s<e.length;s++)this.removeChild(e[s])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){const e=this.root.children;for(let s=0;s<e.length;s++)this._getChildren(e[s],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;const s=t.children;for(let i=0;i<s.length;i++)this._getChildren(s[i],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new st),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new st),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new st),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function uc(r,t,e={}){for(const s in t)!e[s]&&t[s]!==void 0&&(r[s]=t[s])}const Gi=new Yt(null),qs=new Yt(null),Ni=new Yt(null,1,1),js=new Yt(null),Xn=1,fc=2,Vi=4;class Te extends Pe{constructor(t={}){super(),this.uid=wt("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new st,this.relativeGroupTransform=new st,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new Yt(this,0,0),this._scale=Ni,this._pivot=qs,this._origin=js,this._skew=Gi,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],uc(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach(e=>this.addChild(e)),t.parent?.addChild(this)}static mixin(t){at("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),lt.mixin(Te,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||at(At,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let i=0;i<t.length;i++)this.addChild(t[i]);return t[0]}const e=t[0],s=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),s&&(s.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,s&&s.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,e._zIndex!==0&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let i=0;i<t.length;i++)this.removeChild(t[i]);return t[0]}const e=t[0],s=this.children.indexOf(e);return s>-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,s),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=zt.get(dc,this),this.groupTransform=st.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),zt.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new st),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*kh}set angle(t){this.rotation=t*Mh}get pivot(){return this._pivot===qs&&(this._pivot=new Yt(this,0,0)),this._pivot}set pivot(t){this._pivot===qs&&(this._pivot=new Yt(this,0,0),this._origin!==js&&xt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Gi&&(this._skew=new Yt(this,0,0)),this._skew}set skew(t){this._skew===Gi&&(this._skew=new Yt(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===Ni&&(this._scale=new Yt(this,1,1)),this._scale}set scale(t){this._scale===Ni&&(this._scale=new Yt(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===js&&(this._origin=new Yt(this,0,0)),this._origin}set origin(t){this._origin===js&&(this._origin=new Yt(this,0,0),this._pivot!==qs&&xt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const s=this.getLocalBounds();typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,s.width),e!==void 0&&this._setHeight(e,s.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,s=this._scale,i=this._pivot,n=this._origin,o=this._position,l=s._x,a=s._y,h=i._x,c=i._y,d=-n._x,f=-n._y;e.a=this._cx*l,e.b=this._sx*l,e.c=this._cy*a,e.d=this._sy*a,e.tx=o._x-(h*e.a+c*e.c)+(d*e.a+f*e.c)-d,e.ty=o._y-(h*e.b+c*e.d)+(d*e.b+f*e.d)-f}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=Xn,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const s=Wt.shared.setValue(t??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=Xn,this._onUpdate())}get tint(){return ni(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=fc,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const e=t?2:0;(this.localDisplayStatus&2)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Vi,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const e=t?0:4;(this.localDisplayStatus&4)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Vi,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=Vi,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0;let e;if(this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t?.children)&&e)for(let i=0;i<e.length;++i)e[i].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}}lt.mixin(Te,jh,ec,lc,nc,rc,Qh,Jh,ac,Uh,$h,sc,Kh);class Lr extends Te{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new ie(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const e=this.bounds,{x:s,y:i}=t;return s>=e.minX&&s<=e.maxX&&i>=e.minY&&i<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,s){const{renderPipes:i}=e;i.blendMode.pushBlendMode(this,this.groupBlendMode,t);const o=i[this.renderPipeId];o?.addRenderable&&o.addRenderable(this,t),this.didViewUpdate=!1;const l=this.children,a=l.length;for(let h=0;h<a;h++)l[h].collectRenderables(t,e,s);i.blendMode.popBlendMode(t)}}class Ds extends Lr{constructor(t=it.EMPTY){t instanceof it&&(t={texture:t});const{texture:e=it.EMPTY,anchor:s,roundPixels:i,width:n,height:o,...l}=t;super({label:"Sprite",...l}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Yt({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=i??!1,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o)}static from(t,e=!1){return t instanceof it?new Ds(t):new Ds(it.from(t,e))}set texture(t){t||(t=it.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return Bh(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return at("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,s=this._bounds,{width:i,height:n}=e.orig;s.minX=-t._x*i,s.maxX=s.minX+i,s.minY=-t._y*n,s.maxY=s.minY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){const s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),e!==void 0&&this._setHeight(e,this._texture.orig.height)}}const mc=new ie;function io(r,t,e){const s=mc;r.measurable=!0,Ka(r,e,s),t.addBoundsMask(s),r.measurable=!1}function ro(r,t,e){const s=Se.get();r.measurable=!0;const i=Ot.get().identity(),n=no(r,e,i);Ja(r,s,n),r.measurable=!1,t.addBoundsMask(s),Ot.return(i),Se.return(s)}function no(r,t,e){return r?(r!==t&&(no(r.parent,t,e),r.updateLocalTransform(),e.append(r.localTransform)),e):(xt("Mask bounds, renderable is not inside the root container"),e)}class ao{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof Ds),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,e){this.inverse||io(this.mask,t,e)}addLocalBounds(t,e){ro(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof Ds}}ao.extension=V.MaskEffect;class oo{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}oo.extension=V.MaskEffect;class lo{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,e){io(this.mask,t,e)}addLocalBounds(t,e){ro(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof Te}}lo.extension=V.MaskEffect;const gc={createCanvas:(r,t)=>{const e=document.createElement("canvas");return e.width=r,e.height=t,e},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")};let On=gc;const mt={get(){return On},set(r){On=r}};class ho extends Ht{constructor(t){t.resource||(t.resource=mt.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,s=this._resolution){const i=super.resize(t,e,s);return i&&this.resizeCanvas(),i}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}ho.extension=V.TextureSource;class us extends Ht{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}us.extension=V.TextureSource;var li=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(li||{});class zi{constructor(t,e=null,s=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=s,this._once=i}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.
vendor: 5,505 bytes, line 5
5next,t.next=this}destroy(t=!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 e=this.next;return this.next=t?null:e,this.previous=null,e}}const co=class Ut{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 zi(null,null,1/0),this.deltaMS=1/Ut.targetFPMS,this.elapsedMS=1/Ut.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),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(t,e,s=li.NORMAL){return this._addListener(new zi(t,e,s))}addOnce(t,e,s=li.NORMAL){return this._addListener(new zi(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(!e)t.connect(s);else{for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s.match(t,e)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*Ut.targetFPMS;const s=this._head;let i=s.next;for(;i;)i=i.emit(this);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(Math.max(0,t)/1e3,Ut.targetFPMS);this._maxElapsedMS=1/e,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){t===0?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!Ut._shared){const t=Ut._shared=new Ut;t.autoStart=!0,t._protected=!0}return Ut._shared}static get system(){if(!Ut._system){const t=Ut._system=new Ut;t.autoStart=!0,t._protected=!0}return Ut._system}};co.targetFPMS=.06;let Ee=co,Ui;async function uo(){return Ui??(Ui=(async()=>{const t=mt.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(o=>{const l=document.createElement("video");l.onloadeddata=()=>o(l),l.onerror=()=>o(null),l.autoplay=!1,l.crossOrigin="anonymous",l.preload="auto",l.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",l.load()});if(!e)return"premultiply-alpha-on-upload";const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s);const i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(i),t.deleteTexture(s),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Ui}const bi=class fo extends Ht{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...fo.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}
vendor: 12,004 bytes, line 5
5updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=Ee.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await uo(),this._load=new Promise((s,i)=>{this.isValid?s(this):(this._resolve=s,this._reject=i,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ee.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Ee.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ee.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};bi.extension=V.TextureSource;bi.defaultOptions={...Ht.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};bi.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Is=bi;const ee=(r,t,e=!1)=>(Array.isArray(r)||(r=[r]),t?r.map(s=>typeof s=="string"||e?t(s):s):r);class pc{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||xt(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const s=ee(t);let i;for(let a=0;a<this.parsers.length;a++){const h=this.parsers[a];if(h.test(e)){i=h.getCacheableAssets(s,e);break}}const n=new Map(Object.entries(i||{}));i||s.forEach(a=>{n.set(a,e)});const o=[...n.keys()],l={cacheKeys:o,keys:s};s.forEach(a=>{this._cacheMap.set(a,l)}),o.forEach(a=>{const h=i?i[a]:e;this._cache.has(a)&&this._cache.get(a)!==h&&xt("[Cache] already has key:",a),this._cache.set(a,n.get(a))})}remove(t){if(!this._cacheMap.has(t)){xt(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(i=>{this._cache.delete(i)}),e.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const bt=new pc,br=[];lt.handleByList(V.TextureSource,br);function mo(r={}){const t=r&&r.resource,e=t?r.resource:r,s=t?r:{resource:r};for(let i=0;i<br.length;i++){const n=br[i];if(n.test(e))return new n(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}function xc(r={},t=!1){const e=r&&r.resource,s=e?r.resource:r,i=e?r:{resource:r};if(!t&&bt.has(s))return bt.get(s);const n=new it({source:mo(i)});return n.on("destroy",()=>{bt.has(s)&&bt.remove(s)}),t||bt.set(s,n),n}function yc(r,t=!1){return typeof r=="string"?bt.get(r):r instanceof Ht?new it({source:r}):xc(r,t)}it.from=yc;Ht.from=mo;lt.add(ao,oo,lo,Is,us,ho,Br);var pe=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(pe||{});function Qt(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function ys(r){return r.split("?")[0].split("#")[0]}function bc(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wc(r,t,e){return r.replace(new RegExp(bc(t),"g"),e)}function _c(r,t){let e="",s=0,i=-1,n=0,o=-1;for(let l=0;l<=r.length;++l){if(l<r.length)o=r.charCodeAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||n===1))if(i!==l-1&&n===2){if(e.length<2||s!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){const a=e.lastIndexOf("/");if(a!==e.length-1){a===-1?(e="",s=0):(e=e.slice(0,a),s=e.length-1-e.lastIndexOf("/")),i=l,n=0;continue}}else if(e.length===2||e.length===1){e="",s=0,i=l,n=0;continue}}}else e.length>0?e+=`/${r.slice(i+1,l)}`:e=r.slice(i+1,l),s=l-i-1;i=l,n=0}else o===46&&n!==-1?++n:n=-1}return e}const Et={toPosix(r){return wc(r,"\\","/")},isUrl(r){return/^https?:/.test(this.toPosix(r))},isDataUrl(r){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return/^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){Qt(r),r=this.toPosix(r);const t=/^file:\/\/\//.exec(r);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(r);return e?e[0]:""},toAbsolute(r,t,e){if(Qt(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;const s=ys(this.toPosix(t??mt.get().getBaseUrl())),i=ys(this.toPosix(e??this.rootname(s)));return r=this.toPosix(r),r.startsWith("/")?Et.join(i,r.slice(1)):this.isAbsolute(r)?r:this.join(s,r)},normalize(r){if(Qt(r),r.length===0)return".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let t="";const e=r.startsWith("/");this.hasProtocol(r)&&(t=this.rootname(r),r=r.slice(t.length));const s=r.endsWith("/");return r=_c(r),r.length>0&&s&&(r+="/"),e?`/${r}`:t+r},isAbsolute(r){return Qt(r),r=this.toPosix(r),this.hasProtocol(r)?!0:r.startsWith("/")},join(...r){if(r.length===0)return".";let t;for(let e=0;e<r.length;++e){const s=r[e];if(Qt(s),s.length>0)if(t===void 0)t=s;else{const i=r[e-1]??"";this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(r){if(Qt(r),r.length===0)return".";r=this.toPosix(r);let t=r.charCodeAt(0);const e=t===47;let s=-1,i=!0;const n=this.getProtocol(r),o=r;r=r.slice(n.length);for(let l=r.length-1;l>=1;--l)if(t=r.charCodeAt(l),t===47){if(!i){s=l;break}}else i=!1;return s===-1?e?"/":this.isUrl(o)?n+r:n:e&&s===1?"//":n+r.slice(0,s)},rootname(r){Qt(r),r=this.toPosix(r);let t="";if(r.startsWith("/")?t="/":t=this.getProtocol(r),this.isUrl(r)){const e=r.indexOf("/",t.length);e!==-1?t=r.slice(0,e):t=r,t.endsWith("/")||(t+="/")}return t},basename(r,t){Qt(r),t&&Qt(t),r=ys(this.toPosix(r));let e=0,s=-1,i=!0,n;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";let o=t.length-1,l=-1;for(n=r.length-1;n>=0;--n){const a=r.charCodeAt(n);if(a===47){if(!i){e=n+1;break}}else l===-1&&(i=!1,l=n+1),o>=0&&(a===t.charCodeAt(o)?--o===-1&&(s=n):(o=-1,s=l))}return e===s?s=l:s===-1&&(s=r.length),r.slice(e,s)}for(n=r.length-1;n>=0;--n)if(r.charCodeAt(n)===47){if(!i){e=n+1;break}}else s===-1&&(i=!1,s=n+1);return s===-1?"":r.slice(e,s)},extname(r){Qt(r),r=ys(this.toPosix(r));let t=-1,e=0,s=-1,i=!0,n=0;for(let o=r.length-1;o>=0;--o){const l=r.charCodeAt(o);if(l===47){if(!i){e=o+1;break}continue}s===-1&&(i=!1,s=o+1),l===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||s===-1||n===0||n===1&&t===s-1&&t===e+1?"":r.slice(t,s)},parse(r){Qt(r);const t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;r=ys(this.toPosix(r));let e=r.charCodeAt(0);const s=this.isAbsolute(r);let i;t.root=this.rootname(r),s||this.hasProtocol(r)?i=1:i=0;let n=-1,o=0,l=-1,a=!0,h=r.length-1,c=0;for(;h>=i;--h){if(e=r.charCodeAt(h),e===47){if(!a){o=h+1;break}continue}l===-1&&(a=!1,l=h+1),e===46?n===-1?n=h:c!==1&&(c=1):n!==-1&&(c=-1)}return n===-1||l===-1||c===0||c===1&&n===l-1&&n===o+1?l!==-1&&(o===0&&s?t.base=t.name=r.slice(1,l):t.base=t.name=r.slice(o,l)):(o===0&&s?(t.name=r.slice(1,n),t.base=r.slice(1,l)):(t.name=r.slice(o,n),t.base=r.slice(o,l)),t.ext=r.slice(n,l)),t.dir=this.dirname(r),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function go(r,t,e,s,i){const n=t[e];for(let o=0;o<n.length;o++){const l=n[o];e<t.length-1?go(r.replace(s[e],l),t,e+1,s,i):i.push(r.replace(s[e],l))}}function vc(r){const t=/\{(.*?)\}/g,e=r.match(t),s=[];if(e){const i=[];e.forEach(n=>{const o=n.substring(1,n.length-1).split(",");i.push(o)}),go(r,i,0,e,s)}else s.push(r);return s}const hi=r=>!Array.isArray(r);class He{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${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(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}
5prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}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(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`).join("&")}}getAlias(t){const{alias:e,src:s}=t;return ee(e||s,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,!0)}removeAlias(t,e){this._assetMap[t]&&(e&&e!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&xt("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const s=[];let i=e;Array.isArray(e)||(i=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),i.forEach(n=>{const o=n.src,l=n.alias;let a;if(typeof l=="string"){const h=this._createBundleAssetId(t,l);s.push(h),a=[l,h]}else{const h=l.map(c=>this._createBundleAssetId(t,c));s.push(...h),a=[...l,...h]}this.add({...n,alias:a,src:o})}),this._bundles[t]=s}add(t){const e=[];Array.isArray(t)?e.push(...t):e.push(t);let s;s=n=>{this.hasKey(n)&&xt(`[Resolver] already has key: ${n} overwriting`)},ee(e).forEach(n=>{const{src:o}=n;let{data:l,format:a,loadParser:h,parser:c}=n;const d=ee(o).map(g=>typeof g=="string"?vc(g):Array.isArray(g)?g:[g]),f=this.getAlias(n);Array.isArray(f)?f.forEach(s):s(f);const u=[],m=g=>{const p=this._parsers.find(b=>b.test(g));return{src:g,...p?.parse(g)}};d.forEach(g=>{g.forEach(p=>{let b={};if(typeof p!="object"?b=m(p):(l=p.data??l,a=p.format??a,(p.loadParser||p.parser)&&(h=p.loadParser??h,c=p.parser??c),b={...m(p.src),...p}),!f)throw new Error(`[Resolver] alias is undefined for this asset: ${b.src}`);b=this._buildResolvedAsset(b,{aliases:f,data:l,format:a,loadParser:h,parser:c,progressSize:n.progressSize}),u.push(b)})}),f.forEach(g=>{this._assetMap[g]=u})})}resolveBundle(t){const e=hi(t);t=ee(t);const s={};return t.forEach(i=>{const n=this._bundles[i];if(n){const o=this.resolve(n),l={};for(const a in o){const h=o[a];l[this._extractAssetIdFromBundle(i,a)]=h}s[i]=l}}),e?s[t[0]]:s}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const s={};for(const i in e)s[i]=e[i].src;return s}return e.src}resolve(t){const e=hi(t);t=ee(t);const s={};return t.forEach(i=>{if(!this._resolverHash[i])if(this._assetMap[i]){let n=this._assetMap[i];const o=this._getPreferredOrder(n);o?.priority.forEach(l=>{o.params[l].forEach(a=>{const h=n.filter(c=>c[l]?c[l]===a:!1);h.length&&(n=h)})}),this._resolverHash[i]=n[0]}else this._resolverHash[i]=this._buildResolvedAsset({alias:[i],src:i},{});s[i]=this._resolverHash[i]}),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const s=t[e],i=this._preferredOrder.find(n=>n.params.format.includes(s.format));if(i)return i}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}
vendor: 7,144 bytes, lines 5-23
5_buildResolvedAsset(t,e){const{aliases:s,data:i,loadParser:n,parser:o,format:l,progressSize:a}=e;return(this._basePath||this._rootPath)&&(t.src=Et.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...i||{},...t.data},t.loadParser=n??t.loadParser,t.parser=o??t.parser,t.format=l??t.format??Ac(t.src),a!==void 0&&(t.progressSize=a),t}}He.RETINA_PREFIX=/@([0-9\.]+)x/;function Ac(r){return r.split(".").pop().split("?").shift().split("#").shift()}const ci=(r,t)=>{const e=t.split("?")[1];return e&&(r+=`?${e}`),r},po=class ks{constructor(t,e){this.linkedSheets=[];let s=t;t?.source instanceof Ht&&(s={texture:t,data:e});const{texture:i,data:n,cachePrefix:o=""}=s;this.cachePrefix=o,this._texture=i instanceof it?i:null,this.textureSource=i.source,this.textures={},this.animations={},this.data=n;const l=parseFloat(n.meta.scale);l?(this.resolution=l,i.source.resolution=this.resolution):this.resolution=i.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=ks.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,e=!1){let s=t;const i=e?1/0:ks.BATCH_SIZE;for(;s-t<i&&s<this._frameKeys.length;){const n=this._frameKeys[s],o=this._frames[n],l=o.frame;if(l){let a=null,h=null;const c=o.trimmed!==!1&&o.sourceSize?o.sourceSize:o.frame,d=new Pt(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);o.rotated?a=new Pt(Math.floor(l.x)/this.resolution,Math.floor(l.y)/this.resolution,Math.floor(l.h)/this.resolution,Math.floor(l.w)/this.resolution):a=new Pt(Math.floor(l.x)/this.resolution,Math.floor(l.y)/this.resolution,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution),o.trimmed!==!1&&o.spriteSourceSize&&(h=new Pt(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution)),this.textures[n]=new it({source:this.textureSource,frame:a,orig:d,trim:h,rotate:o.rotated?2:0,defaultAnchor:o.anchor,defaultBorders:o.borders,label:n.toString()})}s++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let s=0;s<t[e].length;s++){const i=t[e][s];this.animations[e].push(this.textures[i])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*ks.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*ks.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){for(const e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};po.BATCH_SIZE=1e3;let Gn=po;const Cc=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function xo(r,t,e){const s={};if(r.forEach(i=>{s[i]=t}),Object.keys(t.textures).forEach(i=>{s[`${t.cachePrefix}${i}`]=t.textures[i]}),!e){const i=Et.dirname(r[0]);t.linkedSheets.forEach((n,o)=>{const l=xo([`${i}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(s,l)})}return s}const Sc={extension:V.Asset,cache:{test:r=>r instanceof Gn,getCacheableAssets:(r,t)=>xo(r,t,!1)},resolver:{extension:{type:V.ResolveParser,name:"resolveSpritesheet"},test:r=>{const e=r.split("?")[0].split("."),s=e.pop(),i=e.pop();return s==="json"&&Cc.includes(i)},parse:r=>{const t=r.split(".");return{resolution:parseFloat(He.RETINA_PREFIX.exec(r)?.[1]??"1"),format:t[t.length-2],src:r}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:V.LoadParser,priority:pe.Normal,name:"spritesheetLoader"},async testParse(r,t){return Et.extname(t.src).toLowerCase()===".json"&&!!r.frames},async parse(r,t,e){const{texture:s,imageFilename:i,textureOptions:n,cachePrefix:o}=t?.data??{};let l=Et.dirname(t.src);l&&l.lastIndexOf("/")!==l.length-1&&(l+="/");let a;if(s instanceof it)a=s;else{const d=ci(l+(i??r.meta.image),t.src);a=(await e.load([{src:d,data:n}]))[d]}const h=new Gn({texture:a.source,data:r,cachePrefix:o});await h.parse();const c=r?.meta?.related_multi_packs;if(Array.isArray(c)){const d=[];for(const u of c){if(typeof u!="string")continue;let m=l+u;t.data?.ignoreMultiPack||(m=ci(m,t.src),d.push(e.load({src:m,data:{textureOptions:n,ignoreMultiPack:!0}})))}const f=await Promise.all(d);h.linkedSheets=f,f.forEach(u=>{u.linkedSheets=[h].concat(h.linkedSheets.filter(m=>m!==u))})}return h},async unload(r,t,e){await e.unload(r.textureSource._sourceOrigin),r.destroy(!1)}}};lt.add(Sc);const Wi=Object.create(null),Nn=Object.create(null);function Xr(r,t){let e=Nn[r];return e===void 0&&(Wi[t]===void 0&&(Wi[t]=1),Nn[r]=e=Wi[t]++),e}let Ks;function yo(){return(!Ks||Ks?.isContextLost())&&(Ks=mt.get().createCanvas().getContext("webgl",{})),Ks}let Zs;function kc(){if(!Zs){Zs="mediump";const r=yo();r&&r.getShaderPrecisionFormat&&(Zs=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?"highp":"mediump")}return Zs}function Mc(r,t,e){return t?r:e?(r=r.replace("out vec4 finalColor;",""),`
6
7        #ifdef GL_ES // This checks if it is WebGL1
8        #define in varying
9        #define finalColor gl_FragColor
10        #define texture texture2D
11        #endif
12        ${r}
13        `):`
14
15        #ifdef GL_ES // This checks if it is WebGL1
16        #define in attribute
17        #define out varying
18        #endif
19        ${r}
20        `}function Tc(r,t,e){const s=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(r.substring(0,9)!=="precision"){let i=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return i==="highp"&&s!=="highp"&&(i="mediump"),`precision ${i} float;
21${r}`}else if(s!=="highp"&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}function Pc(r,t){return t?`#version 300 es
22${r}`:r}const Ic={},Ec={};function Rc(r,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";const s=e?Ic:Ec;return s[t]?(s[t]++,t+=`-${s[t]}`):s[t]=1,r.indexOf("#define SHADER_NAME")!==-1?r:`${`#define SHADER_NAME ${t}`}
23${r}`}function Fc(r,t){return t?r.replace("#version 300 es",""):r}const Hi={stripVersion:Fc,ensurePrecision:Tc,addProgramDefines:Mc,setProgramName:Rc,insertVersion:Pc},bs=Object.create(null),bo=class wr{constructor(t){t={...wr.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:kc()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let i=t.fragment,n=t.vertex;
23Object.keys(Hi).forEach(o=>{const l=s[o];i=Hi[o](i,l,!0),n=Hi[o](n,l,!1)}),this.fragment=i,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Xr(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,bs[this._cacheKey]=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return bs[e]||(bs[e]=new wr(t),bs[e]._cacheKey=e),bs[e]}};bo.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let wo=bo;const Vn={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function Bc(r){return Vn[r]??Vn.float32}const Yc={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},zn=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function Un(r,t){let e;for(;(e=zn.exec(r))!==null;){const s=Yc[e[3]]??"float32";t[e[2]]={location:parseInt(e[1],10),format:s,stride:Bc(s).stride,offset:0,instance:!1,start:0}}zn.lastIndex=0}function Dc(r){return r.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function Lc({source:r,entryPoint:t}){const e={},s=Dc(r),i=s.indexOf(`fn ${t}(`);if(i===-1)return e;const n=s.indexOf("->",i);if(n===-1)return e;const o=s.substring(i,n);if(Un(o,e),Object.keys(e).length===0){const l=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(l){const a=l[1],h=new RegExp(`struct\\s+${a}\\s*\\{([^}]+)\\}`,"s"),c=s.match(h);c&&Un(c[1],e)}}return e}function $i(r){const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,n=/:\s*([\w<>]+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,l=/(\w+)\s*:\s*([\w\<\>]+)/g,a=/struct\s+(\w+)/,h=r.match(t)?.map(d=>({group:parseInt(d.match(e)[1],10),binding:parseInt(d.match(s)[1],10),name:d.match(i)[2],isUniform:d.match(i)[1]==="<uniform>",type:d.match(n)[1]}));if(!h)return{groups:[],structs:[]};const c=r.match(o)?.map(d=>{const f=d.match(a)[1],u=d.match(l).reduce((m,g)=>{const[p,b]=g.split(":");return m[p.trim()]=b.trim(),m},{});return u?{name:f,members:u}:null}).filter(({name:d})=>h.some(f=>f.type===d||f.type.includes(`<${d}>`)))??[];return{groups:h,structs:c}}var Oe=(r=>(r[r.VERTEX=1]="VERTEX",r[r.FRAGMENT=2]="FRAGMENT",r[r.COMPUTE=4]="COMPUTE",r))(Oe||{});function Xc({groups:r}){const t=[];for(let e=0;e<r.length;e++){const s=r[e];t[s.group]||(t[s.group]=[]),s.isUniform?t[s.group].push({binding:s.binding,visibility:Oe.VERTEX|Oe.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?t[s.group].push({binding:s.binding,visibility:Oe.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?t[s.group].push({binding:s.binding,visibility:Oe.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?t[s.group].push({binding:s.binding,visibility:Oe.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&t[s.group].push({binding:s.binding,visibility:Oe.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let e=0;e<t.length;e++)t[e]||(t[e]=[]);return t}function Oc({groups:r}){const t=[];for(let e=0;e<r.length;e++){const s=r[e];t[s.group]||(t[s.group]={}),t[s.group][s.name]=s.binding}return t}function Gc(r,t){const e=new Set,s=new Set,i=[...r.structs,...t.structs].filter(o=>e.has(o.name)?!1:(e.add(o.name),!0)),n=[...r.groups,...t.groups].filter(o=>{const l=`${o.name}-${o.binding}`;return s.has(l)?!1:(s.add(l),!0)});return{structs:i,groups:n}}const ws=Object.create(null);class wi{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:s,layout:i,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=s,e.source===s.source){const l=$i(e.source);this.structsAndGroups=l}else{const l=$i(s.source),a=$i(e.source);this.structsAndGroups=Gc(l,a)}this.layout=i??Oc(this.structsAndGroups),this.gpuLayout=n??Xc(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,s=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=Xr(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=Lc(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,ws[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return ws[e]||(ws[e]=new wi(t),ws[e]._cacheKey=e),ws[e]}}const _o=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],Nc=_o.reduce((r,t)=>(r[t]=!0,r),{});function Vc(r,t){switch(r){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const vo=class Ao{constructor(t,e){this._touched=0,this.uid=wt("uniform"),this._resourceType="uniformGroup",this._resourceId=wt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...Ao.defaultOptions,...e},this.uniformStructures=t;const s={};for(const i in t){const n=t[i];if(n.name=i,n.size=n.size??1,!Nc[n.type]){const o=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){const[,l,a]=o;throw new Error(`Uniform type ${n.type} is not supported. Use type: '${l}', size: ${a} instead.`)}throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${_o.join(", ")}`)}n.value??(n.value=Vc(n.type,n.size)),s[i]=n.value}this.uniforms=s,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=Xr(Object.keys(s).map(i=>`${i}-${t[i].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};vo.defaultOptions={ubo:!1,isStatic:!1};let Co=vo;class ai{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const s in t){const i=t[s];this.setResource(i,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const s in this.resources)t[e++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,e){const s=this.resources[e];t!==s&&(s?.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){const s=this.resources;
vendor: 4,216 bytes, line 23
23for(const i in s)s[i]._gcLastUsed=t,s[i]._touched=e}destroy(){const t=this.resources;for(const e in t)t[e]?.off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}var os=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.CANVAS=4]="CANVAS",r[r.BOTH=3]="BOTH",r))(os||{});class _i extends Pe{constructor(t){super(),this.uid=wt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:s,groups:i,resources:n,compatibleRenderers:o,groupMap:l}=t;this.gpuProgram=e,this.glProgram=s,o===void 0&&(o=0,e&&(o|=os.WEBGPU),s&&(o|=os.WEBGL)),this.compatibleRenderers=o;const a={};if(!n&&!i&&(n={}),n&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&i&&!l)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&i&&l)for(const h in l)for(const c in l[h]){const d=l[h][c];a[d]={group:h,binding:c,name:d}}else if(e&&i&&!l){const h=e.structsAndGroups.groups;l={},h.forEach(c=>{l[c.group]=l[c.group]||{},l[c.group][c.binding]=c.name,a[c.name]=c})}else if(n){i={},l={},e&&e.structsAndGroups.groups.forEach(d=>{l[d.group]=l[d.group]||{},l[d.group][d.binding]=d.name,a[d.name]=d});let h=0;for(const c in n)a[c]||(i[99]||(i[99]=new ai,this._ownedBindGroups.push(i[99])),a[c]={group:99,binding:h,name:c},l[99]=l[99]||{},l[99][h]=c,h++);for(const c in n){const d=c;let f=n[c];!f.source&&!f._resourceType&&(f=new Co(f));const u=a[d];u&&(i[u.group]||(i[u.group]=new ai,this._ownedBindGroups.push(i[u.group])),i[u.group].setResource(f,u.binding))}}this.groups=i,this._uniformBindMap=l,this.resources=this._buildResourceAccessor(i,a)}addResource(t,e,s){var i,n;(i=this._uniformBindMap)[e]||(i[e]={}),(n=this._uniformBindMap[e])[s]||(n[s]=t),this.groups[e]||(this.groups[e]=new ai,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const s={};for(const i in e){const n=e[i];Object.defineProperty(s,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return s}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:e,gl:s,...i}=t;let n,o;return e&&(n=wi.from(e)),s&&(o=wo.from(s)),new _i({gpuProgram:n,glProgram:o,...i})}}const zc={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},qi=0,ji=1,Ki=2,Zi=3,Qi=4,Ji=5,_r=class So{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<qi)}set blend(t){!!(this.data&1<<qi)!==t&&(this.data^=1<<qi)}get offsets(){return!!(this.data&1<<ji)}set offsets(t){!!(this.data&1<<ji)!==t&&(this.data^=1<<ji)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Ki)}set culling(t){!!(this.data&1<<Ki)!==t&&(this.data^=1<<Ki)}get depthTest(){return!!(this.data&1<<Zi)}set depthTest(t){!!(this.data&1<<Zi)!==t&&(this.data^=1<<Zi)}get depthMask(){return!!(this.data&1<<Ji)}set depthMask(t){!!(this.data&1<<Ji)!==t&&(this.data^=1<<Ji)}get clockwiseFrontFace(){return!!(this.data&1<<Qi)}set clockwiseFrontFace(t){!!(this.data&1<<Qi)!==t&&(this.data^=1<<Qi)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=zc[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new So;return t.depthTest=!1,t.blend=!0,t}};_r.default2d=_r.for2d();let ko=_r;
vendor: 7,495 bytes, line 23
23const vr=[];lt.handleByNamedList(V.Environment,vr);async function Uc(r){if(!r)for(let t=0;t<vr.length;t++){const e=vr[t];if(e.value.test()){await e.value.load();return}}}let _s;function Wc(){if(typeof _s=="boolean")return _s;try{_s=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{_s=!1}return _s}function Wn(r,t,e=2){const s=t&&t.length,i=s?t[0]*e:r.length;let n=Mo(r,0,i,e,!0);const o=[];if(!n||n.next===n.prev)return o;let l,a,h;if(s&&(n=Kc(r,t,n,e)),r.length>80*e){l=r[0],a=r[1];let c=l,d=a;for(let f=e;f<i;f+=e){const u=r[f],m=r[f+1];u<l&&(l=u),m<a&&(a=m),u>c&&(c=u),m>d&&(d=m)}h=Math.max(c-l,d-a),h=h!==0?32767/h:0}return Ls(n,o,e,l,a,h,0),o}function Mo(r,t,e,s,i){let n;if(i===od(r,t,e,s)>0)for(let o=t;o<e;o+=s)n=Hn(o/s|0,r[o],r[o+1],n);else for(let o=e-s;o>=t;o-=s)n=Hn(o/s|0,r[o],r[o+1],n);return n&&fs(n,n.next)&&(Os(n),n=n.next),n}function Ue(r,t){if(!r)return r;t||(t=r);let e=r,s;do if(s=!1,!e.steiner&&(fs(e,e.next)||ft(e.prev,e,e.next)===0)){if(Os(e),e=t=e.prev,e===e.next)break;s=!0}else e=e.next;while(s||e!==t);return t}function Ls(r,t,e,s,i,n,o){if(!r)return;!o&&n&&ed(r,s,i,n);let l=r;for(;r.prev!==r.next;){const a=r.prev,h=r.next;if(n?$c(r,s,i,n):Hc(r)){t.push(a.i,r.i,h.i),Os(r),r=h.next,l=h.next;continue}if(r=h,r===l){o?o===1?(r=qc(Ue(r),t),Ls(r,t,e,s,i,n,2)):o===2&&jc(r,t,e,s,i,n):Ls(Ue(r),t,e,s,i,n,1);break}}}function Hc(r){const t=r.prev,e=r,s=r.next;if(ft(t,e,s)>=0)return!1;const i=t.x,n=e.x,o=s.x,l=t.y,a=e.y,h=s.y,c=Math.min(i,n,o),d=Math.min(l,a,h),f=Math.max(i,n,o),u=Math.max(l,a,h);let m=s.next;for(;m!==t;){if(m.x>=c&&m.x<=f&&m.y>=d&&m.y<=u&&Ms(i,l,n,a,o,h,m.x,m.y)&&ft(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function $c(r,t,e,s){const i=r.prev,n=r,o=r.next;if(ft(i,n,o)>=0)return!1;const l=i.x,a=n.x,h=o.x,c=i.y,d=n.y,f=o.y,u=Math.min(l,a,h),m=Math.min(c,d,f),g=Math.max(l,a,h),p=Math.max(c,d,f),b=Ar(u,m,t,e,s),w=Ar(g,p,t,e,s);let x=r.prevZ,y=r.nextZ;for(;x&&x.z>=b&&y&&y.z<=w;){if(x.x>=u&&x.x<=g&&x.y>=m&&x.y<=p&&x!==i&&x!==o&&Ms(l,c,a,d,h,f,x.x,x.y)&&ft(x.prev,x,x.next)>=0||(x=x.prevZ,y.x>=u&&y.x<=g&&y.y>=m&&y.y<=p&&y!==i&&y!==o&&Ms(l,c,a,d,h,f,y.x,y.y)&&ft(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;x&&x.z>=b;){if(x.x>=u&&x.x<=g&&x.y>=m&&x.y<=p&&x!==i&&x!==o&&Ms(l,c,a,d,h,f,x.x,x.y)&&ft(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;y&&y.z<=w;){if(y.x>=u&&y.x<=g&&y.y>=m&&y.y<=p&&y!==i&&y!==o&&Ms(l,c,a,d,h,f,y.x,y.y)&&ft(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function qc(r,t){let e=r;do{const s=e.prev,i=e.next.next;!fs(s,i)&&Po(s,e,e.next,i)&&Xs(s,i)&&Xs(i,s)&&(t.push(s.i,e.i,i.i),Os(e),Os(e.next),e=r=i),e=e.next}while(e!==r);return Ue(e)}function jc(r,t,e,s,i,n){let o=r;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&rd(o,l)){let a=Io(o,l);o=Ue(o,o.next),a=Ue(a,a.next),Ls(o,t,e,s,i,n,0),Ls(a,t,e,s,i,n,0);return}l=l.next}o=o.next}while(o!==r)}function Kc(r,t,e,s){const i=[];for(let n=0,o=t.length;n<o;n++){const l=t[n]*s,a=n<o-1?t[n+1]*s:r.length,h=Mo(r,l,a,s,!1);h===h.next&&(h.steiner=!0),i.push(id(h))}i.sort(Zc);for(let n=0;n<i.length;n++)e=Qc(i[n],e);return e}function Zc(r,t){let e=r.x-t.x;if(e===0&&(e=r.y-t.y,e===0)){const s=(r.next.y-r.y)/(r.next.x-r.x),i=(t.next.y-t.y)/(t.next.x-t.x);e=s-i}return e}function Qc(r,t){const e=Jc(r,t);if(!e)return t;const s=Io(e,r);return Ue(s,s.next),Ue(e,e.next)}function Jc(r,t){let e=t;const s=r.x,i=r.y;let n=-1/0,o;if(fs(r,e))return e;do{if(fs(r,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){const d=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=s&&d>n&&(n=d,o=e.x<e.next.x?e:e.next,d===s))return o}e=e.next}while(e!==t);if(!o)return null;const l=o,a=o.x,h=o.y;let c=1/0;e=o;do{if(s>=e.x&&e.x>=a&&s!==e.x&&To(i<h?s:n,i,a,h,i<h?n:s,i,e.x,e.y)){const d=Math.abs(i-e.y)/(s-e.x);Xs(e,r)&&(d<c||d===c&&(e.x>o.x||e.x===o.x&&td(o,e)))&&(o=e,c=d)}e=e.next}while(e!==l);return o}function td(r,t){return ft(r.prev,r,t.prev)<0&&ft(t.next,r,r.next)<0}function ed(r,t,e,s){let i=r;do i.z===0&&(i.z=Ar(i.x,i.y,t,e,s)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,sd(i)}function sd(r){let t,e=1;do{let s=r,i;r=null;let n=null;for(t=0;s;){t++;let o=s,l=0;for(let h=0;h<e&&(l++,o=o.nextZ,!!o);h++);let a=e;for(;l>0||a>0&&o;)l!==0&&(a===0||!o||s.z<=o.z)?(i=s,s=s.nextZ,l--):(i=o,o=o.nextZ,a--),n?n.nextZ=i:r=i,i.prevZ=n,n=i;s=o}n.nextZ=null,e*=2}while(t>1);return r}function Ar(r,t,e,s,i){return r=(r-e)*i|0,t=(t-s)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function id(r){let t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function To(r,t,e,s,i,n,o,l){return(i-o)*(t-l)>=(r-o)*(n-l)&&(r-o)*(s-l)>=(e-o)*(t-l)&&(e-o)*(n-l)>=(i-o)*(s-l)}function Ms(r,t,e,s,i,n,o,l){return!(r===o&&t===l)&&To(r,t,e,s,i,n,o,l)}function rd(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!nd(r,t)&&(Xs(r,t)&&Xs(t,r)&&ad(r,t)&&(ft(r.prev,r,t.prev)||ft(r,t.prev,t))||fs(r,t)&&ft(r.prev,r,r.next)>0&&ft(t.prev,t,t.next)>0)}function ft(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function fs(r,t){return r.x===t.x&&r.y===t.y}function Po(r,t,e,s){const i=Js(ft(r,t,e)),n=Js(ft(r,t,s)),o=Js(ft(e,s,r)),l=Js(ft(e,s,t));return!!(i!==n&&o!==l||i===0&&Qs(r,e,t)||n===0&&Qs(r,s,t)||o===0&&Qs(e,r,s)||l===0&&Qs(e,t,s))}function Qs(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function Js(r){return r>0?1:r<0?-1:0}function nd(r,t){let e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Po(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Xs(r,t){return ft(r.prev,r,r.next)<0?ft(r,t,r.next)>=0&&ft(r,r.prev,t)>=0:ft(r,t,r.prev)<0||ft(r,r.next,t)<0}function ad(r,t){let e=r,s=!1;const i=(r.x+t.x)/2,n=(r.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&i<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(s=!s),e=e.next;while(e!==r);return s}function Io(r,t){const e=Cr(r.i,r.x,r.y),s=Cr(t.i,t.x,t.y),i=r.next,n=t.prev;return r.next=t,t.prev=r,e.next=i,i.prev=e,s.next=e,e.prev=s,n.next=s,s.prev=n,s}function Hn(r,t,e,s){const i=Cr(r,t,e);return s?(i.next=s.next,i.prev=s,s.next.prev=i,s.next=i):(i.prev=i,i.next=i),i}function Os(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Cr(r,t,e){return{i:r,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function od(r,t,e,s){let i=0;for(let n=t,o=e-s;n<e;n+=s)i+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return i}const ld=Wn.default||Wn;var Eo=(r=>(r[r.NONE=0]="NONE",r[r.COLOR=16384]="COLOR",r[r.STENCIL=1024]="STENCIL",r[r.DEPTH=256]="DEPTH",r[r.COLOR_DEPTH=16640]="COLOR_DEPTH",r[r.COLOR_STENCIL=17408]="COLOR_STENCIL",r[r.DEPTH_STENCIL=1280]="DEPTH_STENCIL",r[r.ALL=17664]="ALL",r))(Eo||{});class hd{constructor(t){this.items=[],this._name=t}emit(t,e,s,i,n,o,l,a){const{name:h,items:c}=this;for(let d=0,f=c.length;d<f;d++)c[d][h](t,e,s,i,n,o,l,a);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&this.items.splice(e,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const cd=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","render
23Start","render","update","postrender","prerender"],Ro=class Fo extends Pe{constructor(t){super(),this.tick=0,this.uid=wt("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...cd,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(t={}){const e=t.skipExtensionImports===!0?!0:t.manageImports===!1;await Uc(e),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const s in this._systemsHash)t={...this._systemsHash[s].constructor.defaultOptions,...t};t={...Fo.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(t);this._initOptions=t}render(t,e){this.tick++;let s=t;if(s instanceof Te&&(s={container:s},e&&(at(At,"passing a second argument is deprecated, please use render options instead"),s.target=e.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){const i=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=i?s.clearColor:Wt.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(t,e,s){const i=this.view.resolution;this.view.resize(t,e,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==i&&this.runners.resolutionChange.emit(s)}clear(t={}){const e=this;t.target||(t.target=e.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=Eo.ALL);const{clear:s,clearColor:i,target:n,mipLevel:o,layer:l}=t;Wt.shared.setValue(i??this.background.colorRgba),e.renderTarget.clear(n,s,Wt.shared.toArray(),o??0,l??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(e=>{this.runners[e]=new hd(e)})}_addSystems(t){let e;for(e in t){const s=t[e];this._addSystem(s.value,s.name)}}_addSystem(t,e){const s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(const i in this.runners)this.runners[i].add(s);return this}_addPipes(t,e){const s=e.reduce((i,n)=>(i[n.name]=n.value,i),{});t.forEach(i=>{const n=i.value,o=i.name,l=s[o];this.renderPipes[o]=new n(this,l?new l:null),this.runners.destroy.add(this.renderPipes[o])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&yi.release(),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Wc())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};Ro.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Bo=Ro,ti;function dd(r){return ti!==void 0||(ti=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:r??Bo.defaultOptions.failIfMajorPerformanceCaveat};try{if(!mt.get().getWebGLRenderingContext())return!1;let s=mt.get().createCanvas().getContext("webgl",t);const i=!!s?.getContextAttributes()?.stencil;if(s){const n=s.getExtension("WEBGL_lose_context");n&&n.loseContext()}return s=null,i}catch{return!1}})()),ti}let ei;async function ud(r={}){return ei!==void 0||(ei=await(async()=>{const t=mt.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(r)).requestDevice(),!0}catch{return!1}})()),ei}const $n=["webgl","webgpu","canvas"];async function fd(r){let t=[];
23r.preference?(t.push(r.preference),$n.forEach(n=>{n!==r.preference&&t.push(n)})):t=$n.slice();let e,s={};for(let n=0;n<t.length;n++){const o=t[n];if(o==="webgpu"&&await ud()){const{WebGPURenderer:l}=await as(async()=>{const{WebGPURenderer:a}=await import("./WebGPURenderer.B8NSNx_K.js");return{WebGPURenderer:a}},__vite__mapDeps([3,4,5,2,6]));e=l,s={...r,...r.webgpu};break}else if(o==="webgl"&&dd(r.failIfMajorPerformanceCaveat??Bo.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:l}=await as(async()=>{const{WebGLRenderer:a}=await import("./WebGLRenderer.BQ6YDYJg.js");return{WebGLRenderer:a}},__vite__mapDeps([7,4,5,2]));e=l,s={...r,...r.webgl};break}else if(o==="canvas"){const{CanvasRenderer:l}=await as(async()=>{const{CanvasRenderer:a}=await import("./CanvasRenderer.B9uB1Edj.js");return{CanvasRenderer:a}},__vite__mapDeps([8,5,2]));e=l,s={...r,...r.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!e)throw new Error("No available renderer for the current environment");const i=new e;return await i.init(s),i}const Yo="8.17.1";class Do{static init(){globalThis.__PIXI_APP_INIT__?.(this,Yo)}static destroy(){}}Do.extension=V.Application;class md{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,Yo)}destroy(){this._renderer=null}}md.extension={type:[V.WebGLSystem,V.WebGPUSystem],name:"initHook",priority:-10};class Lo{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(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 e,s;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:n}=this._resizeTo;e=i,s=n}this.renderer.resize(e,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Lo.extension=V.Application;class Xo{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,li.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ee.shared:new Ee,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Xo.extension=V.Application;lt.add(Lo);lt.add(Xo);const Oo=class Sr{constructor(...t){this.stage=new Te,t[0]!==void 0&&at(At,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new Te),this.renderer=await fd(t),Sr._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return at(At,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,e=!1){const s=Sr._plugins.slice(0);s.reverse(),s.forEach(i=>{i.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Oo._plugins=[];let Go=Oo;lt.handleByList(V.Application,Go._plugins);lt.add(Do);const tr={test(r){return typeof r=="string"&&r.startsWith("info face=")},parse(r){const t=r.match(/^[a-z]+\s+.+$/gm),e={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const d in t){const f=t[d].match(/^[a-z]+/gm)[0],u=t[d].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),m={};for(const g in u){const p=u[g].split("="),b=p[0],w=p[1].replace(/"/gm,""),x=parseFloat(w),y=isNaN(x)?w:x;m[b]=y}e[f].push(m)}const s={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[i]=e.info,[n]=e.common,[o]=e.distanceField??[];o&&(s.distanceField={range:parseInt(o.distanceRange,10),type:o.fieldType}),s.fontSize=parseInt(i.size,10),s.fontFamily=i.face,s.lineHeight=parseInt(n.lineHeight,10);const l=e.page;for(let d=0;d<l.length;d++)s.pages.push({id:parseInt(l[d].id,10)||0,file:l[d].file});const a={};s.baseLineOffset=s.lineHeight-parseInt(n.base,10);const h=e.char;for(let d=0;d<h.length;d++){const f=h[d],u=parseInt(f.id,10);let m=f.letter??f.char??String.fromCharCode(u);m==="space"&&(m=" "),a[u]=m,s.chars[m]={id:u,page:parseInt(f.page,10)||0,x:parseInt(f.x,10),y:parseInt(f.y,10),width:parseInt(f.width,10),height:parseInt(f.height,10),xOffset:parseInt(f.xoffset,10),yOffset:parseInt(f.yoffset,10),xAdvance:parseInt(f.xadvance,10),kerning:{}}}const c=e.kerning||[];for(let d=0;d<c.length;d++){const f=parseInt(c[d].first,10),u=parseInt(c[d].second,10),m=parseInt(c[d].amount,10);s.chars[a[u]]&&(s.chars[a[u]].kerning[a[f]]=m)}return s}},qn={test(r){const t=r;return typeof t!="string"&&"getElementsByTagName"in t&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null},parse(r){const t={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},e=r.getElementsByTagName("info")[0],s=r.getElementsByTagName("common")[0],i=r.getElementsByTagName("distanceField")[0];i&&(t.distanceField={type:i.getAttribute("fieldType"),range:parseInt(i.getAttribute("distanceRange"),10)});const n=r.getElementsByTagName("page"),o=r.getElementsByTagName("char"),l=r.getElementsByTagName("kerning");t.fontSize=parseInt(e.getAttribute("size"),10),t.fontFamily=e.getAttribute("face"),t.lineHeight=parseInt(s.getAttribute("lineHeight"),10);for(let h=0;h<n.length;h++)t.pages.push({id:parseInt(n[h].getAttribute("id"),10)||0,file:n[h].getAttribute("file")});const a={};
23t.baseLineOffset=t.lineHeight-parseInt(s.getAttribute("base"),10);for(let h=0;h<o.length;h++){const c=o[h],d=parseInt(c.getAttribute("id"),10);let f=c.getAttribute("letter")??c.getAttribute("char")??String.fromCharCode(d);f==="space"&&(f=" "),a[d]=f,t.chars[f]={id:d,page:parseInt(c.getAttribute("page"),10)||0,x:parseInt(c.getAttribute("x"),10),y:parseInt(c.getAttribute("y"),10),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10),xOffset:parseInt(c.getAttribute("xoffset"),10),yOffset:parseInt(c.getAttribute("yoffset"),10),xAdvance:parseInt(c.getAttribute("xadvance"),10),kerning:{}}}for(let h=0;h<l.length;h++){const c=parseInt(l[h].getAttribute("first"),10),d=parseInt(l[h].getAttribute("second"),10),f=parseInt(l[h].getAttribute("amount"),10);t.chars[a[d]]&&(t.chars[a[d]].kerning[a[c]]=f)}return t}},jn={test(r){return typeof r=="string"&&r.match(/<font(\s|>)/)?qn.test(mt.get().parseXML(r)):!1},parse(r){return qn.parse(mt.get().parseXML(r))}},gd=[".xml",".fnt"],pd={extension:{type:V.CacheParser,name:"cacheBitmapFont"},test:r=>!!r?.pages&&!!r?.chars&&typeof r?.fontFamily=="string"&&r.fontFamily!=="",getCacheableAssets(r,t){const e={};return r.forEach(s=>{e[s]=t,e[`${s}-bitmap`]=t}),e[`${t.fontFamily}-bitmap`]=t,e}},xd={extension:{type:V.LoadParser,priority:pe.Normal},name:"loadBitmapFont",id:"bitmap-font",test(r){return gd.includes(Et.extname(r).toLowerCase())},async testParse(r){return tr.test(r)||jn.test(r)},async parse(r,t,e){const s=tr.test(r)?tr.parse(r):jn.parse(r),{src:i}=t,{pages:n}=s,o=[],l=s.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:!1,resolution:1}:{};for(let f=0;f<n.length;++f){const u=n[f].file;let m=Et.join(Et.dirname(i),u);m=ci(m,i),o.push({src:m,data:l})}const[a,{BitmapFont:h}]=await Promise.all([e.load(o),as(()=>import("./BitmapFont.G2RZkRQk.js"),__vite__mapDeps([9,6]))]),c=o.map(f=>a[f.src]);return new h({data:s,textures:c},i)},async load(r,t){return await(await mt.get().fetch(r)).text()},async unload(r,t,e){await Promise.all(r.pages.map(s=>e.unload(s.texture.source._sourceOrigin))),r.destroy()}};class yd{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(e=>{this._assetList.push(e)}),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 t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s<e;s++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}const bd={extension:{type:V.CacheParser,name:"cacheTextureArray"},test:r=>Array.isArray(r)&&r.every(t=>t instanceof it),getCacheableAssets:(r,t)=>{const e={};return r.forEach(s=>{t.forEach((i,n)=>{e[s+(n===0?"":n+1)]=i})}),e}};async function No(r){if("Image"in globalThis)return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=r});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const t=await(await fetch(r)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}const wd={extension:{type:V.DetectionParser,priority:1},test:async()=>No("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(t=>t!=="avif")},Kn=["png","jpg","jpeg"],_d={extension:{type:V.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async r=>[...r,...Kn],remove:async r=>r.filter(t=>!Kn.includes(t))},vd="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function vi(r){return vd?!1:document.createElement("video").canPlayType(r)!==""}const Ad={extension:{type:V.DetectionParser,priority:0},test:async()=>vi("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(t=>t!=="mp4"&&t!=="m4v")},Cd={extension:{type:V.DetectionParser,priority:0},test:async()=>vi("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(t=>t!=="ogv")},Sd={extension:{type:V.DetectionParser,priority:0},test:async()=>vi("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(t=>t!=="webm")},kd={extension:{type:V.DetectionParser,priority:0},test:async()=>No("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(t=>t!=="webp")},Vo=class oi{constructor(){this.loadOptions={...oi.defaultOptions},this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,s)=>(this._parsersValidated=!1,t[e]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const s={promise:null,parser:null};return s.promise=(async()=>{let i=null,n=null;if((e.parser||e.loadParser)&&(n=this._parserHash[e.parser||e.loadParser],e.loadParser&&xt(`[Assets] "loadParser" is deprecated, use "parser" instead for ${t}`),n||xt(`[Assets] specified load parser "${e.parser||e.loadParser}" not found while loading ${t}`)),!n){for(let o=0;o<this.parsers.length;o++){const l=this.parsers[o];if(l.load&&l.test?.(t,e,this)){n=l;break}}if(!n)return xt(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}i=await n.load(t,e,this),s.parser=n;for(let o=0;o<this.parsers.length;o++){const l=this.parsers[o];l.parse&&l.parse&&await l.testParse?.(i,e,this)&&(i=await l.parse(i,e,this)||i,s.parser=l)}return i})(),s}
23async load(t,e){this._parsersValidated||this._validateParsers();const s=typeof e=="function"?{...oi.defaultOptions,...this.loadOptions,onProgress:e}:{...oi.defaultOptions,...this.loadOptions,...e||{}},{onProgress:i,onError:n,strategy:o,retryCount:l,retryDelay:a}=s;let h=0;const c={},d=hi(t),f=ee(t,g=>({alias:[g],src:g,data:{}})),u=f.reduce((g,p)=>g+(p.progressSize||1),0),m=f.map(async g=>{const p=Et.toAbsolute(g.src);c[g.src]||(await this._loadAssetWithRetry(p,g,{onProgress:i,onError:n,strategy:o,retryCount:l,retryDelay:a},c),h+=g.progressSize||1,i&&i(h/u))});return await Promise.all(m),d?c[f[0].src]:c}async unload(t){const s=ee(t,i=>({alias:[i],src:i})).map(async i=>{const n=Et.toAbsolute(i.src),o=this.promiseCache[n];if(o){const l=await o.promise;delete this.promiseCache[n],await o.parser?.unload?.(l,i,this)}});await Promise.all(s)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name||t.id).reduce((t,e)=>(!e.name&&!e.id?xt("[Assets] parser should have an id"):(t[e.name]||t[e.id])&&xt(`[Assets] parser id conflict "${e.id}"`),t[e.name]=e,e.id&&(t[e.id]=e),t),{})}async _loadAssetWithRetry(t,e,s,i){let n=0;const{onError:o,strategy:l,retryCount:a,retryDelay:h}=s,c=d=>new Promise(f=>setTimeout(f,d));for(;;)try{this.promiseCache[t]||(this.promiseCache[t]=this._getLoadPromiseAndParser(t,e)),i[e.src]=await this.promiseCache[t].promise;return}catch(d){delete this.promiseCache[t],delete i[e.src],n++;const f=l!=="retry"||n>a;if(l==="retry"&&!f){o&&o(d,e),await c(h);continue}if(l==="skip"){o&&o(d,e);return}o&&o(d,e);const u=new Error(`[Loader.load] Failed to load ${t}.
24${d}`);throw d instanceof Error&&d.stack&&(u.stack=d.stack),u}}};Vo.defaultOptions={onProgress:void 0,onError:void 0,strategy:"throw",retryCount:3,retryDelay:250};let Md=Vo;function ps(r,t){if(Array.isArray(t)){for(const e of t)if(r.startsWith(`data:${e}`))return!0;return!1}return r.startsWith(`data:${t}`)}function qt(r,t){const e=r.split("?")[0],s=Et.extname(e).toLowerCase();return Array.isArray(t)?t.includes(s):s===t}const Td=".json",Pd="application/json",Id={extension:{type:V.LoadParser,priority:pe.Low},name:"loadJson",id:"json",test(r){return ps(r,Pd)||qt(r,Td)},async load(r){return await(await mt.get().fetch(r)).json()}},Ed=".txt",Rd="text/plain",Fd={name:"loadTxt",id:"text",extension:{type:V.LoadParser,priority:pe.Low,name:"loadTxt"},test(r){return ps(r,Rd)||qt(r,Ed)},async load(r){return await(await mt.get().fetch(r)).text()}},Bd=["normal","bold","100","200","300","400","500","600","700","800","900"],Yd=[".ttf",".otf",".woff",".woff2"],Dd=["font/ttf","font/otf","font/woff","font/woff2"],Ld=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function Xd(r){const t=Et.extname(r),i=Et.basename(r,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(l=>l.charAt(0).toUpperCase()+l.slice(1));let n=i.length>0;for(const l of i)if(!l.match(Ld)){n=!1;break}let o=i.join(" ");return n||(o=`"${o.replace(/[\\"]/g,"\\$&")}"`),o}const Od=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function Gd(r){return Od.test(r)?r:encodeURI(r)}const Nd={extension:{type:V.LoadParser,priority:pe.Low},name:"loadWebFont",id:"web-font",test(r){return ps(r,Dd)||qt(r,Yd)},async load(r,t){const e=mt.get().getFontFaceSet();if(e){const s=[],i=t.data?.family??Xd(r),n=t.data?.weights?.filter(l=>Bd.includes(l))??["normal"],o=t.data??{};for(let l=0;l<n.length;l++){const a=n[l],h=new FontFace(i,`url('${Gd(r)}')`,{...o,weight:a});await h.load(),e.add(h),s.push(h)}return bt.has(`${i}-and-url`)?bt.get(`${i}-and-url`).entries.push({url:r,faces:s}):bt.set(`${i}-and-url`,{entries:[{url:r,faces:s}]}),s.length===1?s[0]:s}return xt("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(r){const t=Array.isArray(r)?r:[r],e=t[0].family,s=bt.get(`${e}-and-url`),i=s.entries.find(n=>n.faces.some(o=>t.indexOf(o)!==-1));i.faces=i.faces.filter(n=>t.indexOf(n)===-1),i.faces.length===0&&(s.entries=s.entries.filter(n=>n!==i)),t.forEach(n=>{mt.get().getFontFaceSet().delete(n)}),s.entries.length===0&&bt.remove(`${e}-and-url`)}};var er,Zn;function Vd(){if(Zn)return er;Zn=1,er=e;var r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function e(n){var o=[];return n.replace(t,function(l,a,h){var c=a.toLowerCase();for(h=i(h),c=="m"&&h.length>2&&(o.push([a].concat(h.splice(0,2))),c="l",a=a=="m"?"l":"L");;){if(h.length==r[c])return h.unshift(a),o.push(h);if(h.length<r[c])throw new Error("malformed path data");o.push([a].concat(h.splice(0,r[c])))}}),o}var s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function i(n){var o=n.match(s);return o?o.map(Number):[]}return er}var zd=Vd();const Ud=Xa(zd);function Wd(r,t){const e=Ud(r),s=[];let i=null,n=0,o=0;for(let l=0;l<e.length;l++){const a=e[l],h=a[0],c=a;switch(h){case"M":n=c[1],o=c[2],t.moveTo(n,o);break;case"m":n+=c[1],o+=c[2],t.moveTo(n,o);break;case"H":n=c[1],t.lineTo(n,o);break;case"h":n+=c[1],t.lineTo(n,o);break;case"V":o=c[1],t.lineTo(n,o);break;case"v":o+=c[1],t.lineTo(n,o);break;case"L":n=c[1],o=c[2],t.lineTo(n,o);break;case"l":n+=c[1],o+=c[2],t.lineTo(n,o);break;case"C":n=c[5],o=c[6],t.bezierCurveTo(c[1],c[2],c[3],c[4],n,o);break;case"c":t.bezierCurveTo(n+c[1],o+c[2],n+c[3],o+c[4],n+c[5],o+c[6]),n+=c[5],o+=c[6];break;case"S":n=c[3],o=c[4],t.bezierCurveToShort(c[1],c[2],n,o);break;case"s":t.bezierCurveToShort(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case"Q":n=c[3],o=c[4],t.quadraticCurveTo(c[1],c[2],n,o);break;case"q":t.quadraticCurveTo(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case"T":n=c[1],o=c[2],t.quadraticCurveToShort(n,o);break;case"t":n+=c[1],o+=c[2],t.quadraticCurveToShort(n,o);break;case"A":n=c[6],o=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case"a":n+=c[6],o+=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case"Z":case"z":t.closePath(),s.length>0&&(i=s.pop(),i?(n=i.startX,o=i.startY):(n=0,o=0)),i=null;break;default:xt(`Unknown SVG path command: ${h}`)}h!=="Z"&&h!=="z"&&i===null&&(i={startX:n,startY:o},s.push(i))}return t}class Or{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new Or(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let i=this.x-t,n=this.y-e;return i*=i,n*=n,i+n<=s}strokeContains(t,e,s,i=.5){if(this.radius===0)return!1;const n=this.x-t,o=this.y-e,l=this.radius,a=(1-i)*s,h=Math.sqrt(n*n+o*o);return h<=l+a&&h>l-(s-a)}getBounds(t){return t||(t=new Pt),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.he
vendor: 4,881 bytes, line 24
24ight=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Gr{constructor(t=0,e=0,s=0,i=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=i}clone(){return new Gr(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,i=(e-this.y)/this.halfHeight;return s*=s,i*=i,s+i<=1}strokeContains(t,e,s,i=.5){const{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return!1;const l=s*(1-i),a=s-l,h=n-a,c=o-a,d=n+l,f=o+l,u=t-this.x,m=e-this.y,g=u*u/(h*h)+m*m/(c*c),p=u*u/(d*d)+m*m/(f*f);return g>1&&p<=1}getBounds(t){return t||(t=new Pt),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function Hd(r,t,e,s,i,n){const o=r-e,l=t-s,a=i-e,h=n-s,c=o*a+l*h,d=a*a+h*h;let f=-1;d!==0&&(f=c/d);let u,m;f<0?(u=e,m=s):f>1?(u=i,m=n):(u=e+f*a,m=s+f*h);const g=r-u,p=t-m;return g*g+p*p}let $d,qd;class Es{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const s=[];for(let i=0,n=e.length;i<n;i++)s.push(e[i].x,e[i].y);e=s}this.points=e,this.closePath=!0}isClockwise(){let t=0;const e=this.points,s=e.length;for(let i=0;i<s;i+=2){const n=e[i],o=e[i+1],l=e[(i+2)%s],a=e[(i+3)%s];t+=(l-n)*(a+o)}return t<0}containsPolygon(t){const e=this.getBounds($d),s=t.getBounds(qd);if(!e.containsRect(s))return!1;const i=t.points;for(let n=0;n<i.length;n+=2){const o=i[n],l=i[n+1];if(!this.contains(o,l))return!1}return!0}clone(){const t=this.points.slice(),e=new Es(t);return e.closePath=this.closePath,e}contains(t,e){let s=!1;const i=this.points.length/2;for(let n=0,o=i-1;n<i;o=n++){const l=this.points[n*2],a=this.points[n*2+1],h=this.points[o*2],c=this.points[o*2+1];a>e!=c>e&&t<(h-l)*((e-a)/(c-a))+l&&(s=!s)}return s}strokeContains(t,e,s,i=.5){const n=s*s,o=n*(1-i),l=n-o,{points:a}=this,h=a.length-(this.closePath?0:2);for(let c=0;c<h;c+=2){const d=a[c],f=a[c+1],u=a[(c+2)%a.length],m=a[(c+3)%a.length],g=Hd(t,e,d,f,u,m),p=Math.sign((u-d)*(e-f)-(m-f)*(t-d));if(g<=(p<0?l:o))return!0}return!1}getBounds(t){t||(t=new Pt);const e=this.points;let s=1/0,i=-1/0,n=1/0,o=-1/0;for(let l=0,a=e.length;l<a;l+=2){const h=e[l],c=e[l+1];s=h<s?h:s,i=h>i?h:i,n=c<n?c:n,o=c>o?c:o}return t.x=s,t.width=i-s,t.y=n,t.height=o-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return at("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return at("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const si=(r,t,e,s,i,n,o)=>{const l=r-e,a=t-s,h=Math.sqrt(l*l+a*a);return h>=i-n&&h<=i+o};class Nr{constructor(t=0,e=0,s=0,i=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=i,this.radius=n}getBounds(t){return t||(t=new Pt),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Nr(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let i=t-(this.x+s),n=e-(this.y+s);const o=s*s;if(i*i+n*n<=o||(i=t-(this.x+this.width-s),i*i+n*n<=o)||(n=e-(this.y+this.height-s),i*i+n*n<=o)||(i=t-(this.x+s),i*i+n*n<=o))return!0}return!1}strokeContains(t,e,s,i=.5){const{x:n,y:o,width:l,height:a,radius:h}=this,c=s*(1-i),d=s-c,f=n+h,u=o+h,m=l-h*2,g=a-h*2,p=n+l,b=o+a;return(t>=n-c&&t<=n+d||t>=p-d&&t<=p+c)&&e>=u&&e<=u+g||(e>=o-c&&e<=o+d||e>=b-d&&e<=b+c)&&t>=f&&t<=f+m?!0:t<f&&e<u&&si(t,e,f,u,h,d,c)||t>p-h&&e<u&&si(t,e,p-h,u,h,d,c)||t>p-h&&e>b-h&&si(t,e,p-h,b-h,h,d,c)||t<f&&e>b-h&&si(t,e,f,b-h,h,d,c)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const zo={};
24function jd(r,t,e){let s=2166136261;for(let i=0;i<t;i++)s^=r[i].uid,s=Math.imul(s,16777619),s>>>=0;return zo[s]||Kd(r,t,s,e)}function Kd(r,t,e,s){const i={};let n=0;for(let l=0;l<s;l++){const a=l<t?r[l]:it.EMPTY.source;i[n++]=a.source,i[n++]=a.style}const o=new ai(i);return zo[e]=o,o}class Qn{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}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 int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}function kr(r,t,e,s){if(e??(e=0),s??(s=Math.min(r.byteLength-e,t.byteLength)),!(e&7)&&!(s&7)){const i=s/8;new Float64Array(t,0,i).set(new Float64Array(r,e,i))}else if(!(e&3)&&!(s&3)){const i=s/4;new Float32Array(t,0,i).set(new Float32Array(r,e,i))}else new Uint8Array(t).set(new Uint8Array(r,e,s))}const Zd={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var Qd=(r=>(r[r.DISABLED=0]="DISABLED",r[r.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",r[r.MASK_ACTIVE=2]="MASK_ACTIVE",r[r.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",r[r.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",r[r.NONE=5]="NONE",r))(Qd||{});function Jn(r,t){return t.alphaMode==="no-premultiply-alpha"&&Zd[r]||r}const Jd=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
25`);function tu(r){let t="";for(let e=0;e<r;++e)e>0&&(t+=`
26else `),e<r-1&&(t+=`if(test == ${e}.0){}`);return t}function eu(r,t){if(r===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const e=t.createShader(t.FRAGMENT_SHADER);try{for(;;){const s=Jd.replace(/%forloop%/gi,tu(r));if(t.shaderSource(e,s),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))r=r/2|0;else break}}finally{t.deleteShader(e)}return r}let Je=null;function su(){if(Je)return Je;const r=yo();return Je=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),Je=eu(Je,r),r.getExtension("WEBGL_lose_context")?.loseContext(),Je}class iu{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}}class ru{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new iu,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const Rs=[];let di=0;yi.register({clear:()=>{if(Rs.length>0)for(const r of Rs)r&&r.destroy();Rs.length=0,di=0}});function ta(){return di>0?Rs[--di]:new ru}function ea(r){r.elements=null,Rs[di++]=r}let vs=0;const Uo=class Wo{constructor(t){this.uid=wt("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...Wo.defaultOptions,...t},t.maxTextures||(at("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=su());const{maxTextures:e,attributesInitialSize:s,indicesInitialSize:i}=t;this.attributeBuffer=new Qn(s*4),this.indexBuffer=new Uint16Array(i),this.maxTextures=e}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)ea(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,e){const s=t._batch.textures.ids[e._source.uid];return!s&&s!==0?!1:(t._textureId=s,t.texture=e,!0)}updateElement(t){this.dirty=!0;const e=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId)}break(t){const e=this._elements;if(!e[this.elementStart])return;let s=ta(),i=s.textures;i.clear();const n=e[this.elementStart];let o=Jn(n.blendMode,n.texture._source),l=n.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const a=this.attributeBuffer.float32View,h=this.attributeBuffer.uint32View,c=this.indexBuffer;let d=this._batchIndexSize,f=this._batchIndexStart,u="startBatch",m=[];const g=this.maxTextures;for(let p=this.elementStart;p<this.elementSize;++p){const b=e[p];e[p]=null;const x=b.texture._source,y=Jn(b.blendMode,x),_=o!==y||l!==b.topology;if(x._batchTick===vs&&!_){b._textureId=x._textureBindLocation,d+=b.indexSize,b.packAsQuad?(this.packQuadAttributes(b,a,h,b._attributeStart,b._textureId),this.packQuadIndex(c,b._indexStart,b._attributeStart/this.vertexSize)):(this.packAttributes(b,a,h,b._attributeStart,b._textureId),this.packIndex(b,c,b._indexStart,b._attributeStart/this.vertexSize)),b._batch=s,m.push(b);continue}x._batchTick=vs,(i.count>=g||_)&&(this._finishBatch(s,f,d-f,i,o,l,t,u,m),u="renderBatch",f=d,o=y,l=b.topology,s=ta(),i=s.textures,i.clear(),m=[],++vs),b._textureId=x._textureBindLocation=i.count,i.ids[x.uid]=i.count,i.textures[i.count++
26]=x,b._batch=s,m.push(b),d+=b.indexSize,b.packAsQuad?(this.packQuadAttributes(b,a,h,b._attributeStart,b._textureId),this.packQuadIndex(c,b._indexStart,b._attributeStart/this.vertexSize)):(this.packAttributes(b,a,h,b._attributeStart,b._textureId),this.packIndex(b,c,b._indexStart,b._attributeStart/this.vertexSize))}i.count>0&&(this._finishBatch(s,f,d-f,i,o,l,t,u,m),f=d,++vs),this.elementStart=this.elementSize,this._batchIndexStart=f,this._batchIndexSize=d}_finishBatch(t,e,s,i,n,o,l,a,h){t.gpuBindGroup=null,t.bindGroup=null,t.action=a,t.batcher=this,t.textures=i,t.blendMode=n,t.topology=o,t.start=e,t.size=s,t.elements=h,++vs,this.batches[this.batchIndex++]=t,l.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,this.attributeBuffer.size*2),s=new Qn(e);kr(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(t){const e=this.indexBuffer;let s=Math.max(t,e.length*1.5);s+=s%2;const i=s>65535?new Uint32Array(s):new Uint16Array(s);if(i.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let n=0;n<e.length;n++)i[n]=e[n];else kr(e.buffer,i.buffer);this.indexBuffer=i}packQuadIndex(t,e,s){t[e]=s+0,t[e+1]=s+1,t[e+2]=s+2,t[e+3]=s+0,t[e+4]=s+2,t[e+5]=s+3}packIndex(t,e,s,i){const n=t.indices,o=t.indexSize,l=t.indexOffset,a=t.attributeOffset;for(let h=0;h<o;h++)e[s++]=i+n[h+l]-a}destroy(t={}){if(this.batches!==null){for(let e=0;e<this.batchIndex;e++)ea(this.batches[e]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&(this.shader?.destroy(),this.shader=null);for(let e=0;e<this._elements.length;e++)this._elements[e]&&(this._elements[e]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};Uo.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let Ho=Uo;var Tt=(r=>(r[r.MAP_READ=1]="MAP_READ",r[r.MAP_WRITE=2]="MAP_WRITE",r[r.COPY_SRC=4]="COPY_SRC",r[r.COPY_DST=8]="COPY_DST",r[r.INDEX=16]="INDEX",r[r.VERTEX=32]="VERTEX",r[r.UNIFORM=64]="UNIFORM",r[r.STORAGE=128]="STORAGE",r[r.INDIRECT=256]="INDIRECT",r[r.QUERY_RESOLVE=512]="QUERY_RESOLVE",r[r.STATIC=1024]="STATIC",r))(Tt||{});class We extends Pe{constructor(t){let{data:e,size:s}=t;const{usage:i,label:n,shrinkToFit:o}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=wt("buffer"),this._resourceType="buffer",this._resourceId=wt("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,s??(s=e?.byteLength);const l=!!e;this.descriptor={size:s,usage:i,mappedAtCreation:l,label:n},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&Tt.STATIC)}set static(t){t?this.descriptor.usage|=Tt.STATIC:this.descriptor.usage&=~Tt.STATIC}setDataWithSize(t,e,s){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){s&&this.emit("update",this);return}const i=this._data;if(this._data=t,this._dataInt32=null,!i||i.length!==t.length){!this.shrinkToFit&&i&&t.byteLength<i.byteLength?s&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=wt("resource"),this.emit("change",this));return}s&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function $o(r,t){if(!(r instanceof We)){let e=t?Tt.INDEX:Tt.VERTEX;r instanceof Array&&(t?(r=new Uint32Array(r),e=Tt.INDEX|Tt.COPY_DST):(r=new Float32Array(r),e=Tt.VERTEX|Tt.COPY_DST)),r=new We({data:r,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:e})}return r}function nu(r,t,e){const s=r.getAttribute(t);if(!s)return e.minX=0,e.minY=0,e.maxX=0,e.maxY=0,e;const i=s.buffer.data;let n=1/0,o=1/0,l=-1/0,a=-1/0;const h=i.BYTES_PER_ELEMENT,c=(s.offset||0)/h,d=(s.stride||8)/h;for(let f=c;f<i.length;f+=d){const u=i[f],m=i[f+1];u>l&&(l=u),m>a&&(a=m),u<n&&(n=u),m<o&&(o=m)}return e.minX=n,e.minY=o,e.maxX=l,e.maxY=a,e}function au(r){return(r instanceof We||Array.isArray(r)||r.BYTES_PER_ELEMENT)&&(r={buffer:r}),r.buffer=$o(r.buffer,!1),r}class qo extends Pe{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=wt("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new ie,this._boundsDirty=!0;const{attributes:e,indexBuffer:s,topology:i}=t;if(this.buffers=[],this.attributes={},e)for(const n in e)this.addAttribute(n,e[n]);this.instanceCount=t.instanceCount??1,s&&this.addIndex(s),this.topology=i||"triangle-list"}
vendor: 4,790 bytes, lines 26-79
26onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){const s=au(e);this.buffers.indexOf(s.buffer)===-1&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=s}addIndex(t){this.indexBuffer=$o(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,nu(this,"aPosition",this._bounds)):this._bounds}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(e=>e.destroy()),this.unload(),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const ou=new Float32Array(1),lu=new Uint32Array(1);class hu extends qo{constructor(){const e=new We({data:ou,label:"attribute-batch-buffer",usage:Tt.VERTEX|Tt.COPY_DST,shrinkToFit:!1}),s=new We({data:lu,label:"index-batch-buffer",usage:Tt.INDEX|Tt.COPY_DST,shrinkToFit:!1}),i=24;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:i,offset:0},aUV:{buffer:e,format:"float32x2",stride:i,offset:8},aColor:{buffer:e,format:"unorm8x4",stride:i,offset:16},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:i,offset:20}},indexBuffer:s})}}function sa(r,t,e){if(r)for(const s in r){const i=s.toLocaleLowerCase(),n=t[i];if(n){let o=r[s];s==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&n.push(`//----${e}----//`),n.push(o)}else xt(`${s} placement hook does not exist in shader`)}}const cu=/\{\{(.*?)\}\}/g;function ia(r){const t={};return(r.match(cu)?.map(s=>s.replace(/[{()}]/g,""))??[]).forEach(s=>{t[s]=[]}),t}function ra(r,t){let e;const s=/@in\s+([^;]+);/g;for(;(e=s.exec(r))!==null;)t.push(e[1])}function na(r,t,e=!1){const s=[];ra(t,s),r.forEach(l=>{l.header&&ra(l.header,s)});const i=s;e&&i.sort();const n=i.map((l,a)=>`       @location(${a}) ${l},`).join(`
27`);let o=t.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`
28${n}
29`),o}function aa(r,t){let e;const s=/@out\s+([^;]+);/g;for(;(e=s.exec(r))!==null;)t.push(e[1])}function du(r){const e=/\b(\w+)\s*:/g.exec(r);return e?e[1]:""}function uu(r){const t=/@.*?\s+/g;return r.replace(t,"")}function fu(r,t){const e=[];aa(t,e),r.forEach(a=>{a.header&&aa(a.header,e)});let s=0;const i=e.sort().map(a=>a.indexOf("builtin")>-1?a:`@location(${s++}) ${a}`).join(`,
30`),n=e.sort().map(a=>`       var ${uu(a)};`).join(`
31`),o=`return VSOutput(
32            ${e.sort().map(a=>` ${du(a)}`).join(`,
33`)});`;let l=t.replace(/@out\s+[^;]+;\s*/g,"");return l=l.replace("{{struct}}",`
34${i}
35`),l=l.replace("{{start}}",`
36${n}
37`),l=l.replace("{{return}}",`
38${o}
39`),l}function oa(r,t){let e=r;for(const s in t){const i=t[s];i.join(`
40`).length?e=e.replace(`{{${s}}}`,`//-----${s} START-----//
41${i.join(`
42`)}
43//----${s} FINISH----//`):e=e.replace(`{{${s}}}`,"")}return e}const Re=Object.create(null),sr=new Map;let mu=0;function gu({template:r,bits:t}){const e=jo(r,t);if(Re[e])return Re[e];const{vertex:s,fragment:i}=xu(r,t);return Re[e]=Ko(s,i,t),Re[e]}function pu({template:r,bits:t}){const e=jo(r,t);return Re[e]||(Re[e]=Ko(r.vertex,r.fragment,t)),Re[e]}function xu(r,t){const e=t.map(o=>o.vertex).filter(o=>!!o),s=t.map(o=>o.fragment).filter(o=>!!o);let i=na(e,r.vertex,!0);i=fu(e,i);const n=na(s,r.fragment,!0);return{vertex:i,fragment:n}}function jo(r,t){return t.map(e=>(sr.has(e)||sr.set(e,mu++),sr.get(e))).sort((e,s)=>e-s).join("-")+r.vertex+r.fragment}function Ko(r,t,e){const s=ia(r),i=ia(t);return e.forEach(n=>{sa(n.vertex,s,n.name),sa(n.fragment,i,n.name)}),{vertex:oa(r,s),fragment:oa(t,i)}}const yu=`
44    @in aPosition: vec2<f32>;
45    @in aUV: vec2<f32>;
46
47    @out @builtin(position) vPosition: vec4<f32>;
48    @out vUV : vec2<f32>;
49    @out vColor : vec4<f32>;
50
51    {{header}}
52
53    struct VSOutput {
54        {{struct}}
55    };
56
57    @vertex
58    fn main( {{in}} ) -> VSOutput {
59
60        var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
61        var modelMatrix = mat3x3<f32>(
62            1.0, 0.0, 0.0,
63            0.0, 1.0, 0.0,
64            0.0, 0.0, 1.0
65          );
66        var position = aPosition;
67        var uv = aUV;
68
69        {{start}}
70
71        vColor = vec4<f32>(1., 1., 1., 1.);
72
73        {{main}}
74
75        vUV = uv;
76
77        var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
78
79        vPosition =  vec4<f32>((modelViewProjectionMatrix *  vec3<f32>
79(position, 1.0)).xy, 0.0, 1.0);
80
81        vColor *= globalUniforms.uWorldColorAlpha;
82
83        {{end}}
84
85        {{return}}
86    };
87`,bu=`
88    @in vUV : vec2<f32>;
89    @in vColor : vec4<f32>;
90
91    {{header}}
92
93    @fragment
94    fn main(
95        {{in}}
96      ) -> @location(0) vec4<f32> {
97
98        {{start}}
99
100        var outColor:vec4<f32>;
101
102        {{main}}
103
104        var finalColor:vec4<f32> = outColor * vColor;
105
106        {{end}}
107
108        return finalColor;
109      };
110`,wu=`
111    in vec2 aPosition;
112    in vec2 aUV;
113
114    out vec4 vColor;
115    out vec2 vUV;
116
117    {{header}}
118
119    void main(void){
120
121        mat3 worldTransformMatrix = uWorldTransformMatrix;
122        mat3 modelMatrix = mat3(
123            1.0, 0.0, 0.0,
124            0.0, 1.0, 0.0,
125            0.0, 0.0, 1.0
126          );
127        vec2 position = aPosition;
128        vec2 uv = aUV;
129
130        {{start}}
131
132        vColor = vec4(1.);
133
134        {{main}}
135
136        vUV = uv;
137
138        mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
139
140        gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
141
142        vColor *= uWorldColorAlpha;
143
144        {{end}}
145    }
146`,_u=`
147
148    in vec4 vColor;
149    in vec2 vUV;
150
151    out vec4 finalColor;
152
153    {{header}}
154
155    void main(void) {
156
157        {{start}}
158
159        vec4 outColor;
160
161        {{main}}
162
163        finalColor = outColor * vColor;
164
165        {{end}}
166    }
167`,vu={name:"global-uniforms-bit",vertex:{header:`
168        struct GlobalUniforms {
169            uProjectionMatrix:mat3x3<f32>,
170            uWorldTransformMatrix:mat3x3<f32>,
171            uWorldColorAlpha: vec4<f32>,
172            uResolution: vec2<f32>,
173        }
174
175        @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
176        `}},Au={name:"global-uniforms-bit",vertex:{header:`
177          uniform mat3 uProjectionMatrix;
178          uniform mat3 uWorldTransformMatrix;
179          uniform vec4 uWorldColorAlpha;
180          uniform vec2 uResolution;
181        `}};function Zo({bits:r,name:t}){const e=gu({template:{fragment:bu,vertex:yu},bits:[vu,...r]});return wi.from({name:t,vertex:{source:e.vertex,entryPoint:"main"},fragment:{source:e.fragment,entryPoint:"main"}})}function Qo({bits:r,name:t}){return new wo({name:t,...pu({template:{vertex:wu,fragment:_u},bits:[Au,...r]})})}const Jo={name:"color-bit",vertex:{header:`
182            @in aColor: vec4<f32>;
183        `,main:`
184            vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
185        `}},tl={name:"color-bit",vertex:{header:`
186            in vec4 aColor;
187        `,main:`
188            vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
189        `}},ir={};function Cu(r){const t=[];if(r===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let e=0;for(let s=0;s<r;s++)t.push(`@group(1) @binding(${e++}) var textureSource${s+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${e++}) var textureSampler${s+1}: sampler;`)}return t.join(`
190`)}function Su(r){const t=[];if(r===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let e=0;e<r;e++)e===r-1?t.push("  default:{"):t.push(`  case ${e}:{`),t.push(`      outColor = textureSampleGrad(textureSource${e+1}, textureSampler${e+1}, vUV, uvDx, uvDy);`),t.push("      break;}");t.push("}")}return t.join(`
191`)}function el(r){return ir[r]||(ir[r]={name:"texture-batch-bit",vertex:{header:`
192                @in aTextureIdAndRound: vec2<u32>;
193                @out @interpolate(flat) vTextureId : u32;
194            `,main:`
195                vTextureId = aTextureIdAndRound.y;
196            `,end:`
197                if(aTextureIdAndRound.x == 1)
198                {
199                    vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
200                }
201            `},fragment:{header:`
202                @in @interpolate(flat) vTextureId: u32;
203
204                ${Cu(r)}
205            `,main:`
206                var uvDx = dpdx(vUV);
207                var uvDy = dpdy(vUV);
208
209                ${Su(r)}
210            `}}),ir[r]}const rr={};function ku(r){const t=[];for(let e=0;e<r;e++)e>0&&t.push("else"),e<r-1&&t.push(`if(vTextureId < ${e}
210.5)`),t.push("{"),t.push(`	outColor = texture(uTextures[${e}], vUV);`),t.push("}");return t.join(`
211`)}function sl(r){return rr[r]||(rr[r]={name:"texture-batch-bit",vertex:{header:`
212                in vec2 aTextureIdAndRound;
213                out float vTextureId;
214
215            `,main:`
216                vTextureId = aTextureIdAndRound.y;
217            `,end:`
218                if(aTextureIdAndRound.x == 1.)
219                {
220                    gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
221                }
222            `},fragment:{header:`
223                in float vTextureId;
224
225                uniform sampler2D uTextures[${r}];
226
227            `,main:`
228
229                ${ku(r)}
230            `}}),rr[r]}const il={name:"round-pixels-bit",vertex:{header:`
231            fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
232            {
233                return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
234            }
235        `}},rl={name:"round-pixels-bit",vertex:{header:`
236            vec2 roundPixels(vec2 position, vec2 targetSize)
237            {
238                return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
239            }
240        `}},la={};function nl(r){let t=la[r];if(t)return t;const e=new Int32Array(r);for(let s=0;s<r;s++)e[s]=s;return t=la[r]=new Co({uTextures:{value:e,type:"i32",size:r}},{isStatic:!0}),t}class ha extends _i{constructor(t){const e=Qo({name:"batch",bits:[tl,sl(t),rl]}),s=Zo({name:"batch",bits:[Jo,el(t),il]});super({glProgram:e,gpuProgram:s,resources:{batchSamplers:nl(t)}}),this.maxTextures=t}}let As=null;const al=class ol extends Ho{constructor(t){super(t),this.geometry=new hu,this.name=ol.extension.name,this.vertexSize=6,As??(As=new ha(t.maxTextures)),this.shader=As}packAttributes(t,e,s,i,n){const o=n<<16|t.roundPixels&65535,l=t.transform,a=l.a,h=l.b,c=l.c,d=l.d,f=l.tx,u=l.ty,{positions:m,uvs:g}=t,p=t.color,b=t.attributeOffset,w=b+t.attributeSize;for(let x=b;x<w;x++){const y=x*2,_=m[y],v=m[y+1];e[i++]=a*_+c*v+f,e[i++]=d*v+h*_+u,e[i++]=g[y],e[i++]=g[y+1],s[i++]=p,s[i++]=o}}packQuadAttributes(t,e,s,i,n){const o=t.texture,l=t.transform,a=l.a,h=l.b,c=l.c,d=l.d,f=l.tx,u=l.ty,m=t.bounds,g=m.maxX,p=m.minX,b=m.maxY,w=m.minY,x=o.uvs,y=t.color,_=n<<16|t.roundPixels&65535;e[i+0]=a*p+c*w+f,e[i+1]=d*w+h*p+u,e[i+2]=x.x0,e[i+3]=x.y0,s[i+4]=y,s[i+5]=_,e[i+6]=a*g+c*w+f,e[i+7]=d*w+h*g+u,e[i+8]=x.x1,e[i+9]=x.y1,s[i+10]=y,s[i+11]=_,e[i+12]=a*g+c*b+f,e[i+13]=d*b+h*g+u,e[i+14]=x.x2,e[i+15]=x.y2,s[i+16]=y,s[i+17]=_,e[i+18]=a*p+c*b+f,e[i+19]=d*b+h*p+u,e[i+20]=x.x3,e[i+21]=x.y3,s[i+22]=y,s[i+23]=_}_updateMaxTextures(t){this.shader.maxTextures!==t&&(As=new ha(t),this.shader=As)}destroy(){this.shader=null,super.destroy()}};al.extension={type:[V.Batcher],name:"default"};let Mu=al;class Ai{constructor(t){this.items=Object.create(null);const{renderer:e,type:s,onUnload:i,priority:n,name:o}=t;this._renderer=e,e.gc.addResourceHash(this,"items",s,n??0),this._onUnload=i,this.name=o}add(t){return this.items[t.uid]?!1:(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...e){if(!this.items[t.uid])return;const s=t._gpuData[this._renderer.uid];s&&(this._onUnload?.(t,...e),s.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach(e=>e&&this.remove(e,...t))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}function Tu(r,t,e,s,i,n,o,l=null){let a=0;e*=t,i*=n;const h=l.a,c=l.b,d=l.c,f=l.d,u=l.tx,m=l.ty;for(;a<o;){const g=r[e],p=r[e+1];s[i]=h*g+d*p+u,s[i+1]=c*g+f*p+m,i+=n,e+=t,a++}}function Pu(r,t,e,s){let i=0;for(t*=e;i<s;)r[t]=0,r[t+1]=0,t+=e,i++}function ll(r,t,e,s,i){const n=t.a,o=t.b,l=t.c,a=t.d,h=t.tx,c=t.ty;e||(e=0),s||(s=2),i||(i=r.length/s-e);let d=e*s;for(let f=0;f<i;f++){const u=r[d],m=r[d+1];r[d]=n*u+l*m+h,r[d+1]=o*u+a*m+c,d+=s}}const Iu=new st;class Vr{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const t=this.baseColor,e=t>>16|t&65280|(t&255)<<16,s=this.renderable;return s?Qa(e,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):e+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||Iu}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}const Gs={extension:{type:V.ShapeBuilder,name:"circle"},build(r,t){let e,s,i,n,o,l;if(r.type==="circle"){const y=r;if(o=l=y.radius,o<=0)return!1;e=y.x,s=y.y,i=n=0}else if(r.type==="ellipse"){const y=r;if(o=y.halfWidth,l=y.halfHeight,o<=0||l<=0)return!1;e=y.x,s=y.y,i=n=0}else{const y=r,_=y.width/2,v=y.height/2;e=y.x+_,s=y.y+v,o=l=Math.max(0,Math.min(y.radius,Math.min(_,v))),i=_-o,n=v-l}if(i<0||n<0)return!1;const a=Math.ceil(2.3*Math.sqrt(o+l)),h=a*8+(i?4:0)+(n?4:0);if(h===0)return!1;if(a===0)return t[0]=t[6]=e+i,t[1]=t[3]=s+n,t[2]=t[4]=e-i,t[5]=t[7]=s-n,!0;let c=0,d=a*4+(i?2:0)+2,f=d,u=h,m=i+o,g=n,p=e+m,b=e-m,w=s+g;if(t[c++]=p,t[c++]=w,t[--d]=w,t[--d]=b,n){const y=s-g;t[f++]=b,t[f++]=y,t[--u]=y,t[--u]=p}for(let y=1;y<a;y++){const _=Math.PI/2*(y/a),v=i+Math.cos(_)*o,A=n+Math.sin(_)*l,C=e+v,M=e-v,k=s+A,S=s-A;t[c++]=C,t[c++]=k,t[--d]=k,t[--d]=M,t[f++]=M,t[f++]=S,t[--u]=S,t[--u]=C}m=i,g=n+l,p=e+m,b=e-m,w=s+g;const x=s-g;return t[c++]=p,t[c++]=w,t[--u]=x,t[--u]=p,i&&(t[c++]=b,t[c++]=w,t[--u]=x,t[--u]=b),!0},triangulate(r,t,e,s,i,n){if(r.length===0)return;let o=0,l=0;for(let c=0;c<r.length;c+=2)o+=r[c],l+=r[c+1];o/=r.length/2,l/=r.length/2;let a=s;t[a*e]=o,t[a*e+1]=l;const h=a++;for(let c=0;c<r.length;c+=2)t[a*e]=r[c],t[a*e+1]=r[c+1],c>0&&(i[n++]=a,i[n++]=h,i[n++]=a-1),a++;i[n++]=h+1,i[n++]=h,i[n++]=a-1}},Eu={...Gs,extension:{...Gs.extension,name:"ellipse"}},Ru={...Gs,extension:{...Gs.extension,name:"roundedRectangle"}},hl=1e-4,ca=1e-4;function Fu(r){const t=r.length;if(t<6)return 1;let e=0;for(let s=0,i=r[t-2],n=r[t-1];s<t;s+=2){const o=r[s],l=r[s+1];e+=(o-i)*(l+n),i=o,n=l}return e<0?-1:1}function da(r,t,e,s,i,n,o,l){const a=r-e*i,h=t-s*i,c=r+e*n,d=t+s*n;let f,u;o?(f=s,u=-e):(f=-s,u=e);const m=a+f,g=h+u,p=c+f,b=d+u;return l.push(m,g),l.push(p,b),2}function Be(r,t,e,s,i,n,o,l){const a=e-r,h=s-t;
vendor: 5,095 bytes, line 240
240let c=Math.atan2(a,h),d=Math.atan2(i-r,n-t);l&&c<d?c+=Math.PI*2:!l&&c>d&&(d+=Math.PI*2);let f=c;const u=d-c,m=Math.abs(u),g=Math.sqrt(a*a+h*h),p=(15*m*Math.sqrt(g)/Math.PI>>0)+1,b=u/p;if(f+=b,l){o.push(r,t),o.push(e,s);for(let w=1,x=f;w<p;w++,x+=b)o.push(r,t),o.push(r+Math.sin(x)*g,t+Math.cos(x)*g);o.push(r,t),o.push(i,n)}else{o.push(e,s),o.push(r,t);for(let w=1,x=f;w<p;w++,x+=b)o.push(r+Math.sin(x)*g,t+Math.cos(x)*g),o.push(r,t);o.push(i,n),o.push(r,t)}return p*2}function Bu(r,t,e,s,i,n){const o=hl;if(r.length===0)return;const l=t;let a=l.alignment;if(t.alignment!==.5){let L=Fu(r);a=(a-.5)*L+.5}const h=new Lt(r[0],r[1]),c=new Lt(r[r.length-2],r[r.length-1]),d=s,f=Math.abs(h.x-c.x)<o&&Math.abs(h.y-c.y)<o;if(d){r=r.slice(),f&&(r.pop(),r.pop(),c.set(r[r.length-2],r[r.length-1]));const L=(h.x+c.x)*.5,U=(c.y+h.y)*.5;r.unshift(L,U),r.push(L,U)}const u=i,m=r.length/2;let g=r.length;const p=u.length/2,b=l.width/2,w=b*b,x=l.miterLimit*l.miterLimit;let y=r[0],_=r[1],v=r[2],A=r[3],C=0,M=0,k=-(_-A),S=y-v,E=0,R=0,T=Math.sqrt(k*k+S*S);k/=T,S/=T,k*=b,S*=b;const I=a,F=(1-I)*2,D=I*2;d||(l.cap==="round"?g+=Be(y-k*(F-D)*.5,_-S*(F-D)*.5,y-k*F,_-S*F,y+k*D,_+S*D,u,!0)+2:l.cap==="square"&&(g+=da(y,_,k,S,F,D,!0,u))),u.push(y-k*F,_-S*F),u.push(y+k*D,_+S*D);for(let L=1;L<m-1;++L){y=r[(L-1)*2],_=r[(L-1)*2+1],v=r[L*2],A=r[L*2+1],C=r[(L+1)*2],M=r[(L+1)*2+1],k=-(_-A),S=y-v,T=Math.sqrt(k*k+S*S),k/=T,S/=T,k*=b,S*=b,E=-(A-M),R=v-C,T=Math.sqrt(E*E+R*R),E/=T,R/=T,E*=b,R*=b;const U=v-y,j=_-A,Z=v-C,N=M-A,q=U*Z+j*N,$=j*Z-N*U,ht=$<0;if(Math.abs($)<.001*Math.abs(q)){u.push(v-k*F,A-S*F),u.push(v+k*D,A+S*D),q>=0&&(l.join==="round"?g+=Be(v,A,v-k*F,A-S*F,v-E*F,A-R*F,u,!1)+4:g+=2,u.push(v-E*D,A-R*D),u.push(v+E*F,A+R*F));continue}const _t=(-k+y)*(-S+A)-(-k+v)*(-S+_),rt=(-E+C)*(-R+A)-(-E+v)*(-R+M),nt=(U*rt-Z*_t)/$,dt=(N*_t-j*rt)/$,vt=(nt-v)*(nt-v)+(dt-A)*(dt-A),Rt=v+(nt-v)*F,B=A+(dt-A)*F,G=v-(nt-v)*D,z=A-(dt-A)*D,tt=Math.min(U*U+j*j,Z*Z+N*N),yt=ht?F:D,St=tt+yt*yt*w;vt<=St?l.join==="bevel"||vt/w>x?(ht?(u.push(Rt,B),u.push(v+k*D,A+S*D),u.push(Rt,B),u.push(v+E*D,A+R*D)):(u.push(v-k*F,A-S*F),u.push(G,z),u.push(v-E*F,A-R*F),u.push(G,z)),g+=2):l.join==="round"?ht?(u.push(Rt,B),u.push(v+k*D,A+S*D),g+=Be(v,A,v+k*D,A+S*D,v+E*D,A+R*D,u,!0)+4,u.push(Rt,B),u.push(v+E*D,A+R*D)):(u.push(v-k*F,A-S*F),u.push(G,z),g+=Be(v,A,v-k*F,A-S*F,v-E*F,A-R*F,u,!1)+4,u.push(v-E*F,A-R*F),u.push(G,z)):(u.push(Rt,B),u.push(G,z)):(u.push(v-k*F,A-S*F),u.push(v+k*D,A+S*D),l.join==="round"?ht?g+=Be(v,A,v+k*D,A+S*D,v+E*D,A+R*D,u,!0)+2:g+=Be(v,A,v-k*F,A-S*F,v-E*F,A-R*F,u,!1)+2:l.join==="miter"&&vt/w<=x&&(ht?(u.push(G,z),u.push(G,z)):(u.push(Rt,B),u.push(Rt,B)),g+=2),u.push(v-E*F,A-R*F),u.push(v+E*D,A+R*D),g+=2)}y=r[(m-2)*2],_=r[(m-2)*2+1],v=r[(m-1)*2],A=r[(m-1)*2+1],k=-(_-A),S=y-v,T=Math.sqrt(k*k+S*S),k/=T,S/=T,k*=b,S*=b,u.push(v-k*F,A-S*F),u.push(v+k*D,A+S*D),d||(l.cap==="round"?g+=Be(v-k*(F-D)*.5,A-S*(F-D)*.5,v-k*F,A-S*F,v+k*D,A+S*D,u,!1)+2:l.cap==="square"&&(g+=da(v,A,k,S,F,D,!1,u)));const H=ca*ca;for(let L=p;L<g+p-2;++L)y=u[L*2],_=u[L*2+1],v=u[(L+1)*2],A=u[(L+1)*2+1],C=u[(L+2)*2],M=u[(L+2)*2+1],!(Math.abs(y*(A-M)+v*(M-_)+C*(_-A))<H)&&n.push(L,L+1,L+2)}function Yu(r,t,e,s){const i=hl;if(r.length===0)return;const n=r[0],o=r[1],l=r[r.length-2],a=r[r.length-1],h=t||Math.abs(n-l)<i&&Math.abs(o-a)<i,c=e,d=r.length/2,f=c.length/2;for(let u=0;u<d;u++)c.push(r[u*2]),c.push(r[u*2+1]);for(let u=0;u<d-1;u++)s.push(f+u,f+u+1);h&&s.push(f+d-1,f)}function cl(r,t,e,s,i,n,o){const l=ld(r,t,2);if(!l)return;for(let h=0;h<l.length;h+=3)n[o++]=l[h]+i,n[o++]=l[h+1]+i,n[o++]=l[h+2]+i;let a=i*s;for(let h=0;h<r.length;h+=2)e[a]=r[h],e[a+1]=r[h+1],a+=s}const Du=[],Lu={extension:{type:V.ShapeBuilder,name:"polygon"},build(r,t){for(let e=0;e<r.points.length;e++)t[e]=r.points[e];return!0},triangulate(r,t,e,s,i,n){cl(r,Du,t,e,s,i,n)}},Xu={extension:{type:V.ShapeBuilder,name:"rectangle"},build(r,t){const e=r,s=e.x,i=e.y,n=e.width,o=e.height;return n>0&&o>0?(t[0]=s,t[1]=i,t[2]=s+n,t[3]=i,t[4]=s+n,t[5]=i+o,t[6]=s,t[7]=i+o,!0):!1},triangulate(r,t,e,s,i,n){let o=0;s*=e,t[s+o]=r[0],t[s+o+1]=r[1],o+=e,t[s+o]=r[2],t[s+o+1]=r[3],o+=e,t[s+o]=r[6],t[s+o+1]=r[7],o+=e,t[s+o]=r[4],t[s+o+1]=r[5],o+=e;const l=s/e;i[n++]=l,i[n++]=l+1,i[n++]=l+2,i[n++]=l+1,i[n++]=l+3,i[n++]=l+2}},Ou={extension:{type:V.ShapeBuilder,name:"triangle"},build(r,t){return t[0]=r.x,t[1]=r.y,t[2]=r.x2,t[3]=r.y2,t[4]=r.x3,t[5]=r.y3,!0},triangulate(r,t,e,s,i,n){let o=0;s*=e,t[s+o]=r[0],t[s+o+1]=r[1],o+=e,t[s+o]=r[2],t[s+o+1]=r[3],o+=e,t[s+o]=r[4],t[s+o+1]=r[5];const l=s/e;i[n++]=l,i[n++]=l+1,i[n++]=l+2}},ua=[{offset:0,color:"white"},{offset:1,color:"black"}],zr=class Mr{constructor(...t){this.uid=wt("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let e=Gu(t);e={...e.type==="radial"?Mr.defaultRadialOptions:Mr.defaultLinearOptions,...Na(e)},this._textureSize=e.textureSize,this._wrapMode=e.wrapMode,e.type==="radial"?(this.center=e.center,this.outerCenter=e.outerCenter??this.center,this.innerRadius=e.innerRadius,this.outerRadius=e.outerRadius,this.scale=e.scale,this.rotation=e.rotation):(this.start=e.start,this.end=e.end),this.textureSpace
240=e.textureSpace,this.type=e.type,e.colorStops.forEach(i=>{this.addColorStop(i.offset,i.color)})}addColorStop(t,e){return this.colorStops.push({offset:t,color:Wt.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:s,y:i}=this.end,n=s-t,o=i-e;const l=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){const p=t;t=s,s=p,n*=-1}if(o<0){const p=e;e=i,i=p,o*=-1}}const a=this.colorStops.length?this.colorStops:ua,h=this._textureSize,{canvas:c,context:d}=ma(h,1),f=l?d.createLinearGradient(this._textureSize,0,0,0):d.createLinearGradient(0,0,this._textureSize,0);fa(f,a),d.fillStyle=f,d.fillRect(0,0,h,1),this.texture=new it({source:new us({resource:c,addressMode:this._wrapMode})});const u=Math.sqrt(n*n+o*o),m=Math.atan2(o,n),g=new st;g.scale(u/h,1),g.rotate(m),g.translate(t,e),this.textureSpace==="local"&&g.scale(h,h),this.transform=g}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:ua,e=this._textureSize,{canvas:s,context:i}=ma(e,e),{x:n,y:o}=this.center,{x:l,y:a}=this.outerCenter,h=this.innerRadius,c=this.outerRadius,d=l-c,f=a-c,u=e/(c*2),m=(n-d)*u,g=(o-f)*u,p=i.createRadialGradient(m,g,h*u,(l-d)*u,(a-f)*u,c*u);fa(p,t),i.fillStyle=t[t.length-1].color,i.fillRect(0,0,e,e),i.fillStyle=p,i.translate(m,g),i.rotate(this.rotation),i.scale(1,this.scale),i.translate(-m,-g),i.fillRect(0,0,e,e),this.texture=new it({source:new us({resource:s,addressMode:this._wrapMode})});const b=new st;b.scale(1/u,1/u),b.translate(d,f),this.textureSpace==="local"&&b.scale(e,e),this.transform=b}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};zr.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};zr.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let Vs=zr;function fa(r,t){for(let e=0;e<t.length;e++){const s=t[e];r.addColorStop(s.offset,s.color)}}function ma(r,t){const e=mt.get().createCanvas(r,t),s=e.getContext("2d");return{canvas:e,context:s}}function Gu(r){let t=r[0]??{};return(typeof t=="number"||r[1])&&(at("8.5.2","use options object instead"),t={type:"linear",start:{x:r[0],y:r[1]},end:{x:r[2],y:r[3]},textureSpace:r[4],textureSize:r[5]??Vs.defaultLinearOptions.textureSize}),t}const Nu=new st,Vu=new Pt;function zu(r,t,e,s){const i=t.matrix?r.copyFrom(t.matrix).invert():r.identity();if(t.textureSpace==="local"){const o=e.getBounds(Vu);t.width&&o.pad(t.width);const{x:l,y:a}=o,h=1/o.width,c=1/o.height,d=-l*h,f=-a*c,u=i.a,m=i.b,g=i.c,p=i.d;i.a*=h,i.b*=h,i.c*=c,i.d*=c,i.tx=d*u+f*g+i.tx,i.ty=d*m+f*p+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);const n=t.texture.source.style;return!(t.fill instanceof Vs)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),s&&i.append(Nu.copyFrom(s).invert()),i}const Ci={};lt.handleByMap(V.ShapeBuilder,Ci);lt.add(Xu,Lu,Ou,Gs,Eu,Ru);const Uu=new Pt,Wu=new st;function Hu(r,t){const{geometryData:e,batches:s}=t;s.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let i=0;i<r.instructions.length;i++){const n=r.instructions[i];if(n.action==="texture")$u(n.data,s,e);else if(n.action==="fill"||n.action==="stroke"){const o=n.action==="stroke",l=n.data.path.shapePath,a=n.data.style,h=n.data.hole;o&&h&&ga(h.shapePath,a,!0,s,e),h&&(l.shapePrimitives[l.shapePrimitives.length-1].holes=h.shapePath.shapePrimitives),ga(l,a,o,s,e)}}}function $u(r,t,e){const s=[],i=Ci.rectangle,n=Uu;n.x=r.dx,n.y=r.dy,n.width=r.dw,n.height=r.dh;const o=r.transform;if(!i.build(n,s))return;const{vertices:l,uvs:a,indices:h}=e,c=h.length,d=l.length/2;o&&ll(s,o),i.triangulate(s,l,2,d,h,c);const f=r.image,u=f.uvs;a.push(u.x0,u.y0,u.x1,u.y1,u.x3,u.y3,u.x2,u.y2);const m=zt.get(Vr);m.indexOffset=c,m.indexSize=h.length-c,m.attributeOffset=d,m.attributeSize=l.length/2-d,m.baseColor=r.style,m.alpha=r.alpha,m.texture=f,m.geometryData=e,t.push(m)}function ga(r,t,e,s,i){const{vertices:n,uvs:o,indices:l}=i;
240r.shapePrimitives.forEach(({shape:a,transform:h,holes:c})=>{const d=[],f=Ci[a.type];if(!f.build(a,d))return;const u=l.length,m=n.length/2;let g="triangle-list";if(h&&ll(d,h),e){const x=a.closePath??!0,y=t;y.pixelLine?(Yu(d,x,n,l),g="line-list"):Bu(d,y,!1,x,n,l)}else if(c){const x=[],y=d.slice();qu(c).forEach(v=>{x.push(y.length/2),y.push(...v)}),cl(y,x,n,2,m,l,u)}else f.triangulate(d,n,2,m,l,u);const p=o.length/2,b=t.texture;if(b!==it.WHITE){const x=zu(Wu,t,a,h);Tu(n,2,m,o,p,2,n.length/2-m,x)}else Pu(o,p,2,n.length/2-m);const w=zt.get(Vr);w.indexOffset=u,w.indexSize=l.length-u,w.attributeOffset=m,w.attributeSize=n.length/2-m,w.baseColor=t.color,w.alpha=t.alpha,w.texture=b,w.geometryData=i,w.topology=g,s.push(w)})}function qu(r){const t=[];for(let e=0;e<r.length;e++){const s=r[e].shape,i=[];Ci[s.type].build(s,i)&&t.push(i)}return t}class ju{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{zt.return(t)}),this.graphicsData&&zt.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}}class Ku{constructor(){this.instructions=new Dr}init(t){const e=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(e):this.batcher=new Mu({maxTextures:e}),this.instructions.reset()}get geometry(){return at(Eh,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const Ur=class Tr{constructor(t){this._renderer=t,this._managedContexts=new Ai({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Tr.defaultOptions.bezierSmoothness=t?.bezierSmoothness??Tr.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const e=!!t._gpuData[this._renderer.uid],s=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!e){e&&s.reset(),Hu(t,s);const i=t.batchMode;t.customShader||i==="no-batch"?s.isBatchable=!1:i==="auto"?s.isBatchable=s.geometryData.vertices.length<400:s.isBatchable=!0,t.dirty=!1}return s}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const e=zt.get(Ku,{maxTextures:this._renderer.limits.maxBatchableTextures}),s=t._gpuData[this._renderer.uid],{batches:i,geometryData:n}=s;s.graphicsData=e;const o=n.vertices.length,l=n.indices.length;for(let d=0;d<i.length;d++)i[d].applyTransform=!1;const a=e.batcher;a.ensureAttributeBuffer(o),a.ensureIndexBuffer(l),a.begin();for(let d=0;d<i.length;d++){const f=i[d];a.add(f)}a.finish(e.instructions);const h=a.geometry;h.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,!0),h.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,!0);const c=a.batches;for(let d=0;d<c.length;d++){const f=c[d];f.bindGroup=jd(f.textures.textures,f.textures.count,this._renderer.limits.maxBatchableTextures)}return e}_initContext(t){const e=new ju;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};Ur.extension={type:[V.WebGLSystem,V.WebGPUSystem],name:"graphicsContext"};Ur.defaultOptions={bezierSmoothness:.5};let Wr=Ur;const Zu=8,ii=11920929e-14,Qu=1;function dl(r,t,e,s,i,n,o,l,a,h){const d=Math.min(.99,Math.max(0,h??Wr.defaultOptions.bezierSmoothness));let f=(Qu-d)/1;return f*=f,Ju(t,e,s,i,n,o,l,a,r,f),r}function Ju(r,t,e,s,i,n,o,l,a,h){Pr(r,t,e,s,i,n,o,l,a,h,0),a.push(o,l)}function Pr(r,t,e,s,i,n,o,l,a,h,c){if(c>Zu)return;const d=(r+e)/2,f=(t+s)/2,u=(e+i)/2,m=(s+n)/2,g=(i+o)/2,p=(n+l)/2,b=(d+u)/2,w=(f+m)/2,x=(u+g)/2,y=(m+p)/2,_=(b+x)/2,v=(w+y)/2;if(c>0){let A=o-r,C=l-t;const M=Math.abs((e-o)*C-(s-l)*A),k=Math.abs((i-o)*C-(n-l)*A);if(M>ii&&k>ii){if((M+k)*(M+k)<=h*(A*A+C*C)){a.push(_,v);return}}else if(M>ii){if(M*M<=h*(A*A+C*C)){a.push(_,v);return}}else if(k>ii){if(k*k<=h*(A*A+C*C)){a.push(_,v);return}}else if(A=_-(r+o)/2,C=v-(t+l)/2,A*A+C*C<=h){a.push(_,v);return}}Pr(r,t,d,f,b,w,_,v,a,h,c+1),Pr(_,v,x,y,g,p,o,l,a,h,c+1)}const tf=8,ef=11920929e-14,sf=1;function rf(r,t,e,s,i,n,o,l){const h=Math.min(.99,Math.max(0,l??Wr.defaultOptions.bezierSmoothness));let c=(sf-h)/1;return c*=c,nf(t,e,s,i,n,o,r,c),r}function nf(r,t,e,s,i,n,o,l){Ir(o,r,t,e,s,i,n,l,0),o.push(i,n)}function Ir(r,t,e,s,i,n,o,l,a){if(a>tf)return;const h=(t+s)/2,c=(e+i)/2,d=(s+n)/2,f=(i+o)/2,u=(h+d)/2,m=(c+f)/2;let g=n-t,p=o-e;const b=Math.abs((s-n)*p-(i-o)*g);if(b>ef){if(b*b<=l*(g*g+p*p)){r.push(u,m);return}}else if(g=u-(t+n)/2,p=m-(e+o)/2,g*g+p*p<=l){r.push(u,m);return}Ir(r,t,e,h,c,u,m,l,a+1),Ir(r,u,m,d,f,n,o,l,a+1)}function ul(r,t,e,s,i,n,o,l){let a=Math.abs(i-n);(!o&&i>n||o&&n>i)&&(a=2*Math.PI-a),l||(l=Math.max(6,Math.floor(6*Math.pow(s,1/3)*(a/Math.PI)))),l=Math.max(l,3);let h=a/l,c=i;h*=o?-1:1;for(let d=0;d<l+1;d++){const f=Math.cos(c),u=Math.sin(c),m=t+f*s,g=e+u*s;r.push(m,g),c+=h}}function af(r,t,e,s,i,n){const o=r[r.length-2],a=r[r.length-1]-e,h=o-t,c=i-e,d=s-t,f=Math.abs(a*d-h*c);if(f<1e-8||n===0){(r[r.length-2]!==t||r[r.length-1]!==e)&&r.push(t,e);return}const u=a*a+h*h,m=c*c+d*d,g=a*c+h*d,p=n*Math.sqrt(u)/f,b=n*Math.sqrt(m)/f,w=p*g/u,x=b*g/m,y=p*d+b*h,_=p*c+b*a,v=h*(b+w),A=a*(b+w),C=d*(p+x),M=c*(p+x),k=Math.atan2(A-_,v-y),S=Math.atan2(M-_,C-y);ul(r,y+t,_+e,n,k,S,h*c>d*a)}const Fs=Math.PI*2,nr={centerX:0,centerY:0,ang1:0,ang2:0},ar=({x:r,y:t}
vendor: 9,287 bytes, line 240
240,e,s,i,n,o,l,a)=>{r*=e,t*=s;const h=i*r-n*t,c=n*r+i*t;return a.x=h+o,a.y=c+l,a};function of(r,t){const e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),s=t===1.5707963267948966?.551915024494:e,i=Math.cos(r),n=Math.sin(r),o=Math.cos(r+t),l=Math.sin(r+t);return[{x:i-n*s,y:n+i*s},{x:o+l*s,y:l-o*s},{x:o,y:l}]}const pa=(r,t,e,s)=>{const i=r*s-t*e<0?-1:1;let n=r*e+t*s;return n>1&&(n=1),n<-1&&(n=-1),i*Math.acos(n)},lf=(r,t,e,s,i,n,o,l,a,h,c,d,f)=>{const u=Math.pow(i,2),m=Math.pow(n,2),g=Math.pow(c,2),p=Math.pow(d,2);let b=u*m-u*p-m*g;b<0&&(b=0),b/=u*p+m*g,b=Math.sqrt(b)*(o===l?-1:1);const w=b*i/n*d,x=b*-n/i*c,y=h*w-a*x+(r+e)/2,_=a*w+h*x+(t+s)/2,v=(c-w)/i,A=(d-x)/n,C=(-c-w)/i,M=(-d-x)/n,k=pa(1,0,v,A);let S=pa(v,A,C,M);l===0&&S>0&&(S-=Fs),l===1&&S<0&&(S+=Fs),f.centerX=y,f.centerY=_,f.ang1=k,f.ang2=S};function hf(r,t,e,s,i,n,o,l=0,a=0,h=0){if(n===0||o===0)return;const c=Math.sin(l*Fs/360),d=Math.cos(l*Fs/360),f=d*(t-s)/2+c*(e-i)/2,u=-c*(t-s)/2+d*(e-i)/2;if(f===0&&u===0)return;n=Math.abs(n),o=Math.abs(o);const m=Math.pow(f,2)/Math.pow(n,2)+Math.pow(u,2)/Math.pow(o,2);m>1&&(n*=Math.sqrt(m),o*=Math.sqrt(m)),lf(t,e,s,i,n,o,a,h,c,d,f,u,nr);let{ang1:g,ang2:p}=nr;const{centerX:b,centerY:w}=nr;let x=Math.abs(p)/(Fs/4);Math.abs(1-x)<1e-7&&(x=1);const y=Math.max(Math.ceil(x),1);p/=y;let _=r[r.length-2],v=r[r.length-1];const A={x:0,y:0};for(let C=0;C<y;C++){const M=of(g,p),{x:k,y:S}=ar(M[0],n,o,d,c,b,w,A),{x:E,y:R}=ar(M[1],n,o,d,c,b,w,A),{x:T,y:I}=ar(M[2],n,o,d,c,b,w,A);dl(r,_,v,k,S,E,R,T,I),_=T,v=I,g+=p}}function cf(r,t,e){const s=(o,l)=>{const a=l.x-o.x,h=l.y-o.y,c=Math.sqrt(a*a+h*h),d=a/c,f=h/c;return{len:c,nx:d,ny:f}},i=(o,l)=>{o===0?r.moveTo(l.x,l.y):r.lineTo(l.x,l.y)};let n=t[t.length-1];for(let o=0;o<t.length;o++){const l=t[o%t.length],a=l.radius??e;if(a<=0){i(o,l),n=l;continue}const h=t[(o+1)%t.length],c=s(l,n),d=s(l,h);if(c.len<1e-4||d.len<1e-4){i(o,l),n=l;continue}let f=Math.asin(c.nx*d.ny-c.ny*d.nx),u=1,m=!1;c.nx*d.nx-c.ny*-d.ny<0?f<0?f=Math.PI+f:(f=Math.PI-f,u=-1,m=!0):f>0&&(u=-1,m=!0);const g=f/2;let p,b=Math.abs(Math.cos(g)*a/Math.sin(g));b>Math.min(c.len/2,d.len/2)?(b=Math.min(c.len/2,d.len/2),p=Math.abs(b*Math.sin(g)/Math.cos(g))):p=a;const w=l.x+d.nx*b+-d.ny*p*u,x=l.y+d.ny*b+d.nx*p*u,y=Math.atan2(c.ny,c.nx)+Math.PI/2*u,_=Math.atan2(d.ny,d.nx)-Math.PI/2*u;o===0&&r.moveTo(w+Math.cos(y)*p,x+Math.sin(y)*p),r.arc(w,x,p,y,_,m),n=l}}function df(r,t,e,s){const i=(l,a)=>Math.sqrt((l.x-a.x)**2+(l.y-a.y)**2),n=(l,a,h)=>({x:l.x+(a.x-l.x)*h,y:l.y+(a.y-l.y)*h}),o=t.length;for(let l=0;l<o;l++){const a=t[(l+1)%o],h=a.radius??e;if(h<=0){l===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y);continue}const c=t[l],d=t[(l+2)%o],f=i(c,a);let u;if(f<1e-4)u=a;else{const p=Math.min(f/2,h);u=n(a,c,p/f)}const m=i(d,a);let g;if(m<1e-4)g=a;else{const p=Math.min(m/2,h);g=n(a,d,p/m)}l===0?r.moveTo(u.x,u.y):r.lineTo(u.x,u.y),r.quadraticCurveTo(a.x,a.y,g.x,g.y,s)}}const uf=new Pt;class ff{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new ie,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();const s=this._currentPoly.points,i=s[s.length-2],n=s[s.length-1];return(i!==t||n!==e)&&s.push(t,e),this}arc(t,e,s,i,n,o){this._ensurePoly(!1);const l=this._currentPoly.points;return ul(l,t,e,s,i,n,o),this}arcTo(t,e,s,i,n){this._ensurePoly();const o=this._currentPoly.points;return af(o,t,e,s,i,n),this}arcToSvg(t,e,s,i,n,o,l){const a=this._currentPoly.points;return hf(a,this._currentPoly.lastX,this._currentPoly.lastY,o,l,t,e,s,i,n),this}bezierCurveTo(t,e,s,i,n,o,l){this._ensurePoly();const a=this._currentPoly;return dl(this._currentPoly.points,a.lastX,a.lastY,t,e,s,i,n,o,l),this}quadraticCurveTo(t,e,s,i,n){this._ensurePoly();const o=this._currentPoly;return rf(this._currentPoly.points,o.lastX,o.lastY,t,e,s,i,n),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0),t.transform(e));const s=this.shapePrimitives,i=s.length;for(let n=0;n<t.instructions.length;n++){const o=t.instructions[n];this[o.action](...o.data)}if(t.checkForHoles&&s.length-i>1){let n=null;for(let o=i;o<s.length;o++){const l=s[o];if(l.shape.type==="polygon"){const a=l.shape,h=n?.shape;h&&h.containsPolygon(a)?(n.holes||(n.holes=[]),n.holes.push(l),s.copyWithin(o,o+1),s.length--,o--):n=l}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,s,i,n){return this.drawShape(new Pt(t,e,s,i),n),this}circle(t,e,s,i){return this.drawShape(new Or(t,e,s),i),this}poly(t,e,s){const i=new Es(t);return i.closePath=e,this.drawShape(i,s),this}regularPoly(t,e,s,i,n=0,o){i=Math.max(i|0,3);const l=-1*Math.PI/2+n,a=Math.PI*2/i,h=[];for(let c=0;c<i;c++){const d=l-c*a;h.push(t+s*Math.cos(d),e+s*Math.sin(d))}return this.poly(h,!0,o),this}roundPoly(t,e,s,i,n,o=0,l){if(i=Math.max(i|0,3),n<=0)return this.regularPoly(t,e,s,i,o);const a=s*Math.sin(Math.PI/i)-.001;n=Math.min(n,a);const h=-1*Math.PI/2+o,c=Math.PI*2/i,d=(i-2)*Math.PI/i/2;for(let f=0;f<i;f++){const u=f*c+h,m=t+s*Math.cos(u),g=e+s*Math.sin(u),p=u+Math.PI+d,b=u-Math.PI-d,w=m+n*Math.cos(p),x=g+n*Math.sin(p),y=m+n*Math.cos(b),_=g+n*Math.sin(b);f===0?this.moveTo(w,x):this.lineTo(w,x),this.quadraticCurveTo(m,g,y,_,l)}return this.closePath()}roundShape(t,e,s=!1,i){return t.length<3?this:(s?df(this,t,e,i):cf(this,t,e),this.closePath())}filletRect(t,e,s,i,n){if(n===0)return this.rect(t,e,s,i);const o=Math.min(s,i)/2,l=Math.min(o,Math.max(-o,n)),a=t+s,h=e+i,c=l<0?-l:0,d=Math.abs(l);return this.moveTo(t,e+d).arcTo(t+c,e+c,t+d,e,d).lineTo(a-d,e).arcTo(a-c,e+c,a,e+d,d).lineTo(a,h-d).arcTo(a-c,h-c,t+s-d,h,d).lineTo(t+d,h).arcTo(t+c,h-c,t,h-d,d).closePath()}chamferRect(t,e,s,i,n,o){if(n<=0)return this.rect(t,e,s,i);const l=Math.min(n,Math.min(s,i)/2),a=t+s,h=e+i,c=[t+l,e,a-l,e,a,e+l,a,h-l,a-l,h,t+l,h,t,h-l,t,e+l];for(let d=c.length-1;d>=2;d-=2)c[d]===c[d-2]&&c[d-1]===c[d-3]&&c.splice(d-1,2);return this.poly(c,!0,o)}ellipse(t,e,s,i,n){return this.drawShape(new Gr(t,e,s,i),n),this}roundRect(t,e,s,i,n,o){return this.drawShape(new Nr(t,e,s,i,n),o),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let s=this._currentPoly;return s&&this.endPoly(),s=new Es,s.points.push(t,e),this._currentPoly=s,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new Es,t)){const e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let s=e.shape.x,i=e.shape.y;if(e.transform&&!e.transform.isIdentity()){const n=e.transform,o=s;s=n.a*s+n.c*i+n.tx,i=n.b*o+n.d*i+n.ty}this._currentPoly.points.push(s,i)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;e<t.instructions.length;e++){const s=t.instructions[e];this[s.action](...s.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const e=this.shapePrimitives;for(let s=0;s<e.length;s++){const i=e[s],n=i.shape.getBounds(uf);i.transform?t.addRect(n,i.transform):t.addRect(n)}return t}}class ke{constructor(t,e=!1){this.instructions=[],this.uid=wt("graphicsPath"),this._dirty=!0,this.checkForHoles=e,typeof t=="string"?Wd(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new ff(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,s,i,n){const o=this.instructions[this.instructions.length-1],l=this.getLastPoint(Lt.shared);let a=0,h=0;if(!o||o.action!=="bezierCurveTo")a=l.x,h=l.y;else{a=o.data[2],h=o.data[3];const c=l.x,d=l.y;a=c+(c-a),h=d+(d-h)}return this.instructions.push({action:"bezierCurveTo",data:[a,h,t,e,s,i,n]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,s){const i=this.instructions[this.instructions.length-1],n=this.getLastPoint(Lt.shared);let o=0,l=0;if(!i||i.action!=="quadraticCurveTo")o=n.x,l=n.y;else{o=i.data[0],l=i.data[1];const a=n.x,h=n.y;o=a+(a-o),l=h+(h-l)}return this.instructions.push({action:"quadraticCurveTo",data:[o,l,t,e,s]}),this._dirty=!0,this}rect(t,e,s,i,n){return this.instructions.push({action:"rect",data:[t,e,s,i,n]}),this._dirty=!0,this}circle(t,e,s,i){return this.instructions.push({action:"circle",data:[t,e,s,i]}),this._dirty=!0,this}
240roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,s,i,n,o,l){n||(n=i/2);const a=-1*Math.PI/2+o,h=s*2,c=Math.PI*2/h,d=[];for(let f=0;f<h;f++){const u=f%2?n:i,m=f*c+a;d.push(t+u*Math.cos(m),e+u*Math.sin(m))}return this.poly(d,!0,l),this}clone(t=!1){const e=new ke;if(e.checkForHoles=this.checkForHoles,!t)e.instructions=this.instructions.slice();else for(let s=0;s<this.instructions.length;s++){const i=this.instructions[s];e.instructions.push({action:i.action,data:i.data.slice()})}return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const e=t.a,s=t.b,i=t.c,n=t.d,o=t.tx,l=t.ty;let a=0,h=0,c=0,d=0,f=0,u=0,m=0,g=0;for(let p=0;p<this.instructions.length;p++){const b=this.instructions[p],w=b.data;switch(b.action){case"moveTo":case"lineTo":a=w[0],h=w[1],w[0]=e*a+i*h+o,w[1]=s*a+n*h+l;break;case"bezierCurveTo":c=w[0],d=w[1],f=w[2],u=w[3],a=w[4],h=w[5],w[0]=e*c+i*d+o,w[1]=s*c+n*d+l,w[2]=e*f+i*u+o,w[3]=s*f+n*u+l,w[4]=e*a+i*h+o,w[5]=s*a+n*h+l;break;case"quadraticCurveTo":c=w[0],d=w[1],a=w[2],h=w[3],w[0]=e*c+i*d+o,w[1]=s*c+n*d+l,w[2]=e*a+i*h+o,w[3]=s*a+n*h+l;break;case"arcToSvg":a=w[5],h=w[6],m=w[0],g=w[1],w[0]=e*m+i*g,w[1]=s*m+n*g,w[5]=e*a+i*h+o,w[6]=s*a+n*h+l;break;case"circle":w[4]=Cs(w[3],t);break;case"rect":w[4]=Cs(w[4],t);break;case"ellipse":w[8]=Cs(w[8],t);break;case"roundRect":w[5]=Cs(w[5],t);break;case"addPath":w[0].transform(t);break;case"poly":w[2]=Cs(w[2],t);break;default:xt("unknown transform action",b.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,s=this.instructions[e];if(!s)return t.x=0,t.y=0,t;for(;s.action==="closePath";){if(e--,e<0)return t.x=0,t.y=0,t;s=this.instructions[e]}switch(s.action){case"moveTo":case"lineTo":t.x=s.data[0],t.y=s.data[1];break;case"quadraticCurveTo":t.x=s.data[2],t.y=s.data[3];break;case"bezierCurveTo":t.x=s.data[4],t.y=s.data[5];break;case"arc":case"arcToSvg":t.x=s.data[5],t.y=s.data[6];break;case"addPath":s.data[0].getLastPoint(t);break}return t}}function Cs(r,t){return r?r.prepend(t):t.clone()}function pt(r,t,e){const s=r.getAttribute(t);return s?Number(s):e}function mf(r,t){const e=r.querySelectorAll("defs");for(let s=0;s<e.length;s++){const i=e[s];for(let n=0;n<i.children.length;n++){const o=i.children[n];switch(o.nodeName.toLowerCase()){case"lineargradient":t.defs[o.id]=gf(o);break;case"radialgradient":t.defs[o.id]=pf();break}}}}function gf(r){const t=pt(r,"x1",0),e=pt(r,"y1",0),s=pt(r,"x2",1),i=pt(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new Vs(t,e,s,i,n==="objectBoundingBox"?"local":"global");for(let l=0;l<r.children.length;l++){const a=r.children[l],h=pt(a,"offset",0),c=Wt.shared.setValue(a.getAttribute("stop-color")).toNumber();o.addColorStop(h,c)}return o}function pf(r){return xt("[SVG Parser] Radial gradients are not yet supported"),new Vs(0,0,1,0)}function xa(r){const t=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}const ya={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function fl(r,t){const e=r.getAttribute("style"),s={},i={},n={strokeStyle:s,fillStyle:i,useFill:!1,useStroke:!1};for(const o in ya){const l=r.getAttribute(o);l&&ba(t,n,o,l.trim())}if(e){const o=e.split(";");for(let l=0;l<o.length;l++){const a=o[l].trim(),[h,c]=a.split(":");ya[h]&&ba(t,n,h,c.trim())}}return{strokeStyle:n.useStroke?s:null,fillStyle:n.useFill?i:null,useFill:n.useFill,useStroke:n.useStroke}}
240function ba(r,t,e,s){switch(e){case"stroke":if(s!=="none"){if(s.startsWith("url(")){const i=xa(s);t.strokeStyle.fill=r.defs[i]}else t.strokeStyle.color=Wt.shared.setValue(s).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(s);break;case"fill":if(s!=="none"){if(s.startsWith("url(")){const i=xa(s);t.fillStyle.fill=r.defs[i]}else t.fillStyle.color=Wt.shared.setValue(s).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(s);break;case"stroke-opacity":t.strokeStyle.alpha=Number(s);break;case"opacity":t.fillStyle.alpha=Number(s),t.strokeStyle.alpha=Number(s);break}}function xf(r){if(r.length<=2)return!0;const t=r.map(l=>l.area).sort((l,a)=>a-l),[e,s]=t,i=t[t.length-1],n=e/s,o=s/i;return!(n>3&&o<2)}function yf(r){return r.split(/(?=[Mm])/).filter(s=>s.trim().length>0)}function bf(r){const t=r.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;const e=t.map(Number),s=[],i=[];for(let c=0;c<e.length;c+=2)c+1<e.length&&(s.push(e[c]),i.push(e[c+1]));if(s.length===0||i.length===0)return 0;const n=Math.min(...s),o=Math.max(...s),l=Math.min(...i),a=Math.max(...i);return(o-n)*(a-l)}function wa(r,t){const e=new ke(r,!1);for(const s of e.instructions)t.instructions.push(s)}function wf(r,t){if(typeof r=="string"){const o=document.createElement("div");o.innerHTML=r.trim(),r=o.querySelector("svg")}const e={context:t,defs:{},path:new ke};mf(r,e);const s=r.children,{fillStyle:i,strokeStyle:n}=fl(r,e);for(let o=0;o<s.length;o++){const l=s[o];l.nodeName.toLowerCase()!=="defs"&&ml(l,e,i,n)}return t}function ml(r,t,e,s){const i=r.children,{fillStyle:n,strokeStyle:o}=fl(r,t);n&&e?e={...e,...n}:n&&(e=n),o&&s?s={...s,...o}:o&&(s=o);const l=!e&&!s;l&&(e={color:0});let a,h,c,d,f,u,m,g,p,b,w,x,y,_,v,A,C;switch(r.nodeName.toLowerCase()){case"path":{_=r.getAttribute("d");const M=r.getAttribute("fill-rule"),k=yf(_),S=M==="evenodd",E=k.length>1;if(S&&E){const T=k.map(F=>({path:F,area:bf(F)}));if(T.sort((F,D)=>D.area-F.area),k.length>3||!xf(T))for(let F=0;F<T.length;F++){const D=T[F],H=F===0;t.context.beginPath();const L=new ke(void 0,!0);wa(D.path,L),t.context.path(L),H?(e&&t.context.fill(e),s&&t.context.stroke(s)):t.context.cut()}else for(let F=0;F<T.length;F++){const D=T[F],H=F%2===1;t.context.beginPath();const L=new ke(void 0,!0);wa(D.path,L),t.context.path(L),H?t.context.cut():(e&&t.context.fill(e),s&&t.context.stroke(s))}}else{const T=M?M==="evenodd":!0;v=new ke(_,T),t.context.path(v),e&&t.context.fill(e),s&&t.context.stroke(s)}break}case"circle":m=pt(r,"cx",0),g=pt(r,"cy",0),p=pt(r,"r",0),t.context.ellipse(m,g,p,p),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"rect":a=pt(r,"x",0),h=pt(r,"y",0),A=pt(r,"width",0),C=pt(r,"height",0),b=pt(r,"rx",0),w=pt(r,"ry",0),b||w?t.context.roundRect(a,h,A,C,b||w):t.context.rect(a,h,A,C),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"ellipse":m=pt(r,"cx",0),g=pt(r,"cy",0),b=pt(r,"rx",0),w=pt(r,"ry",0),t.context.beginPath(),t.context.ellipse(m,g,b,w),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"line":c=pt(r,"x1",0),d=pt(r,"y1",0),f=pt(r,"x2",0),u=pt(r,"y2",0),t.context.beginPath(),t.context.moveTo(c,d),t.context.lineTo(f,u),s&&t.context.stroke(s);break;case"polygon":y=r.getAttribute("points"),x=y.match(/-?\d+/g).map(M=>parseInt(M,10)),t.context.poly(x,!0),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"polyline":y=r.getAttribute("points"),x=y.match(/-?\d+/g).map(M=>parseInt(M,10)),t.context.poly(x,!1),s&&t.context.stroke(s);break;case"g":case"svg":break;default:{xt(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}l&&(e=null);for(let M=0;M<i.length;M++)ml(i[M],t,e,s)}const _a={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class _f{constructor(t,e){this.uid=wt("fillPattern"),this._tick=0,this.transform=new st,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=_a[e].addressModeU,t.source.style.addressModeV=_a[e].addressModeV)}setTransform(t){const e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}function vf(r){return Wt.isColorLike(r)}function va(r){return r instanceof _f}function Aa(r){return r instanceof Vs}function Af(r){return r instanceof it}function Cf(r,t,e){const s=Wt.shared.setValue(t??0);return r.color=s.toNumber(),r.alpha=s.alpha===1?e.alpha:s.alpha,r.texture=it.WHITE,{...e,...r}}function Sf(r,t,e){return r.texture=t,{...e,...r}}function Ca(r,t,e){return r.fill=t,r.color=16777215,r.texture=t.texture,r.matrix=t.transform,{...e,...r}}function Sa(r,t,e){return t.buildGradient(),r.fill=t,r.color=16777215,r.texture=t.texture,r.matrix=t.transform,r.textureSpace
240=t.textureSpace,{...e,...r}}function kf(r,t){const e={...t,...r},s=Wt.shared.setValue(e.color);return e.alpha*=s.alpha,e.color=s.toNumber(),e}function Ts(r,t){if(r==null)return null;const e={},s=r;return vf(r)?Cf(e,r,t):Af(r)?Sf(e,r,t):va(r)?Ca(e,r,t):Aa(r)?Sa(e,r,t):s.fill&&va(s.fill)?Ca(s,s.fill,t):s.fill&&Aa(s.fill)?Sa(s,s.fill,t):kf(s,t)}function ka(r,t){const{width:e,alignment:s,miterLimit:i,cap:n,join:o,pixelLine:l,...a}=t,h=Ts(r,a);return h?{width:e,alignment:s,miterLimit:i,cap:n,join:o,pixelLine:l,...h}:null}function Mf(r,t){let e=1;const s=r.shapePath.shapePrimitives;for(let i=0;i<s.length;i++){const n=s[i].shape;if(n.type!=="polygon")continue;const o=n.points,l=o.length;if(l<6)continue;const a=n.closePath;for(let h=0;h<l;h+=2){if(!a&&(h===0||h===l-2))continue;const c=(h-2+l)%l,d=(h+2)%l,f=o[c],u=o[c+1],m=o[h],g=o[h+1],p=o[d],b=o[d+1],w=f-m,x=u-g,y=p-m,_=b-g,v=w*w+x*x,A=y*y+_*_;if(v<1e-12||A<1e-12)continue;let k=(w*y+x*_)/Math.sqrt(v*A);k<-1?k=-1:k>1&&(k=1);const S=Math.sqrt((1-k)*.5);if(S<1e-6)continue;const E=Math.min(1/S,t);E>e&&(e=E)}}return e}const Tf=new Lt,Ma=new st,Hr=class de extends Pe{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=wt("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new ke,this._transform=new st,this._fillStyle={...de.defaultFillStyle},this._strokeStyle={...de.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new ie,this._boundsDirty=!0}clone(){const t=new de;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=Ts(t,de.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=ka(t,de.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=Ts(t,de.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=Ts(t,de.defaultStrokeStyle),this}texture(t,e,s,i,n,o){return this.instructions.push({action:"texture",data:{image:t,dx:s||0,dy:i||0,dw:n||t.frame.width,dh:o||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e||e===0?Wt.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new ke,this}fill(t,e){let s;const i=this.instructions[this.instructions.length-1];return this._tick===0&&i?.action==="stroke"?s=i.data.path:s=this._activePath.clone(),s?(t!=null&&(e!==void 0&&typeof t=="number"&&(at(At,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:e}),this._fillStyle=Ts(t,de.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:s}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:e}=this._activePath.getLastPoint(Lt.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(t){let e;const s=this.instructions[this.instructions.length-1];return this._tick===0&&s?.action==="fill"?e=s.data.path:e=this._activePath.clone(),e?(t!=null&&(this._strokeStyle=ka(t,de.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:e}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const e=this.instructions[this.instructions.length-1-t],s=this._activePath.clone();if(e&&(e.action==="stroke"||e.action==="fill"))if(e.data.hole)e.data.hole.addPath(s);else{e.data.hole=s;break}}return this._initNextPathLocation(),this}arc(t,e,s,i,n,o){this._tick++;const l=this._transform;return this._activePath.arc(l.a*t+l.c*e+l.tx,l.b*t+l.d*e+l.ty,s,i,n,o),this}arcTo(t,e,s,i,n){this._tick++;const o=this._transform;return this._activePath.arcTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*s+o.c*i+o.tx,o.b*s+o.d*i+o.ty,n),this}arcToSvg(t,e,s,i,n,o,l){this._tick++;const a=this._transform;return this._activePath.arcToSvg(t,e,s,i,n,a.a*o+a.c*l+a.tx,a.b*o+a.d*l+a.ty),this}bezierCurveTo(t,e,s,i,n,o,l){this._tick++;const a=this._transform;return this._activePath.bezierCurveTo(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,a.a*s+a.c*i+a.tx,a.b*s+a.d*i+a.ty,a.a*n+a.c*o+a.tx,a.b*n+a.d*o+a.ty,l),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,s,i){return this._tick++,this._activePath.ellipse(t,e,s,i,this._transform.clone()),this}circle(t,e,s){return this._tick++,this._activePath.circle(t,e,s,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;const s=this._transform;return this._activePath.lineTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty),this}moveTo(t,e){this._tick++;const s=this._transform,i=this._activePath.instructions,n=s.a*t+s.c*e+s.tx,o=s.b*t+s.d*e+s.ty;return i.length===1&&i[0].action==="moveTo"?(i[0].data[0]=n,i[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(t,e,s,i,n){this._tick++;const o=this._transform;return this._activePath.quadraticCurveTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*s+o.c*i+o.tx,o.b*s+o.d*i+o.ty,n),this}rect(t,e,s,i){return this._tick++,this._activePath.rect(t,e,s,i,this._transform.clone()),this}
240roundRect(t,e,s,i,n){return this._tick++,this._activePath.roundRect(t,e,s,i,n,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,s,i,n=0,o){return this._tick++,this._activePath.regularPoly(t,e,s,i,n,o),this}roundPoly(t,e,s,i,n,o){return this._tick++,this._activePath.roundPoly(t,e,s,i,n,o),this}roundShape(t,e,s,i){return this._tick++,this._activePath.roundShape(t,e,s,i),this}filletRect(t,e,s,i,n){return this._tick++,this._activePath.filletRect(t,e,s,i,n),this}chamferRect(t,e,s,i,n,o){return this._tick++,this._activePath.chamferRect(t,e,s,i,n,o),this}star(t,e,s,i,n=0,o=0){return this._tick++,this._activePath.star(t,e,s,i,n,o,this._transform.clone()),this}svg(t){return this._tick++,wf(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,e=t){return this._transform.scale(t,e),this}setTransform(t,e,s,i,n,o){return t instanceof st?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,s,i,n,o),this)}transform(t,e,s,i,n,o){return t instanceof st?(this._transform.append(t),this):(Ma.set(t,e,s,i,n,o),this._transform.append(Ma),this)}translate(t,e=t){return this._transform.translate(t,e),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){const s=this.instructions[e],i=s.action;if(i==="fill"){const n=s.data;t.addBounds(n.path.bounds)}else if(i==="texture"){const n=s.data;t.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform)}if(i==="stroke"){const n=s.data,o=n.style.alignment;let l=n.style.width*(1-o);n.style.join==="miter"&&(l*=Mf(n.path,n.style.miterLimit));const a=n.path.bounds;t.addFrame(a.minX-l,a.minY-l,a.maxX+l,a.maxY+l)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){if(!this.bounds.containsPoint(t.x,t.y))return!1;const e=this.instructions;let s=!1;for(let i=0;i<e.length;i++){const n=e[i],o=n.data,l=o.path;if(!n.action||!l)continue;const a=o.style,h=l.shapePath.shapePrimitives;for(let c=0;c<h.length;c++){const d=h[c].shape;if(!a||!d)continue;const f=h[c].transform,u=f?f.applyInverse(t,Tf):t;if(n.action==="fill")s=d.contains(u.x,u.y);else{const g=a;s=d.strokeContains(u.x,u.y,g.width,g.alignment)}const m=o.hole;if(m){const g=m.shapePath?.shapePrimitives;if(g)for(let p=0;p<g.length;p++)g[p].shape.contains(u.x,u.y)&&(s=!1)}if(s)return!0}}return s}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof t=="boolean"?t:t?.texture){const s=typeof t=="boolean"?t:t?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(s)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(s))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};Hr.defaultFillStyle={color:16777215,alpha:1,texture:it.WHITE,matrix:null,fill:null,textureSpace:"local"};Hr.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:it.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let is=Hr;function $r(r,t=1){const e=He.RETINA_PREFIX?.exec(r);return e?parseFloat(e[1]):t}function qr(r,t,e){r.label=e,r._sourceOrigin=e;const s=new it({source:r,label:e}),i=()=>{delete t.promiseCache[e],bt.has(e)&&bt.remove(e)};return s.source.once("destroy",()=>{t.promiseCache[e]&&(xt("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."),i())}),s.once("destroy",()=>{r.destroyed||(xt("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),i())}),s}const Pf=".svg",If="image/svg+xml",Ef={extension:{type:V.LoadParser,priority:pe.Low,name:"loadSVG"},name:"loadSVG",id:"svg",config:{crossOrigin:"anonymous",parseAsGraphicsContext:!1},test(r){return ps(r,If)||qt(r,Pf)},async load(r,t,e){return t.data?.parseAsGraphicsContext??this.config.parseAsGraphicsContext?Ff(r):Rf(r,t,e,this.config.crossOrigin)},unload(r){r.destroy(!0)}};async function Rf(r,t,e,s){const i=await mt.get().fetch(r),n=mt.get().createImage();n.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await i.text())}`,n.crossOrigin=s,await n.decode();const o=t.data?.width??n.width,l=t.data?.height??n.height,a=t.data?.resolution||$r(r),h=Math.ceil(o*a),c=Math.ceil(l*a),d=mt.get().createCanvas(h,c),f=d.getContext("2d");f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high",f.drawImage(n,
2400,0,o*a,l*a);const{parseAsGraphicsContext:u,...m}=t.data??{},g=new us({resource:d,alphaMode:"premultiply-alpha-on-upload",resolution:a,...m});return qr(g,e,r)}async function Ff(r){const e=await(await mt.get().fetch(r)).text(),s=new is;return s.svg(e),s}const Bf=`(function () {
241    'use strict';
242
243    const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
244    async function checkImageBitmap() {
245      try {
246        if (typeof createImageBitmap !== "function") return false;
247        const response = await fetch(WHITE_PNG);
248        const imageBlob = await response.blob();
249        const imageBitmap = await createImageBitmap(imageBlob);
250        return imageBitmap.width === 1 && imageBitmap.height === 1;
251      } catch (_e) {
252        return false;
253      }
254    }
255    void checkImageBitmap().then((result) => {
256      self.postMessage(result);
257    });
258
259})();
260`;let ls=null,Er=class{constructor(){ls||(ls=URL.createObjectURL(new Blob([Bf],{type:"application/javascript"}))),this.worker=new Worker(ls)}};Er.revokeObjectURL=function(){ls&&(URL.revokeObjectURL(ls),ls=null)};const Yf=`(function () {
261    'use strict';
262
263    async function loadImageBitmap(url, alphaMode) {
264      const response = await fetch(url);
265      if (!response.ok) {
266        throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`);
267      }
268      const imageBlob = await response.blob();
269      return alphaMode === "premultiplied-alpha" ? createImageBitmap(imageBlob, { premultiplyAlpha: "none" }) : createImageBitmap(imageBlob);
270    }
271    self.onmessage = async (event) => {
272      try {
273        const imageBitmap = await loadImageBitmap(event.data.data[0], event.data.data[1]);
274        self.postMessage({
275          data: imageBitmap,
276          uuid: event.data.uuid,
277          id: event.data.id
278        }, [imageBitmap]);
279      } catch (e) {
280        self.postMessage({
281          error: e,
282          uuid: event.data.uuid,
283          id: event.data.id
284        });
285      }
286    };
287
288})();
289`;let hs=null;class gl{constructor(){hs||(hs=URL.createObjectURL(new Blob([Yf],{type:"application/javascript"}))),this.worker=new Worker(hs)}}gl.revokeObjectURL=function(){hs&&(URL.revokeObjectURL(hs),hs=null)};let Ta=0,or;class Df{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(t=>{const{worker:e}=new Er;e.addEventListener("message",s=>{e.terminate(),Er.revokeObjectURL(),t(s.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t,e){return this._run("loadImageBitmap",[t,e?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=!0)}_getWorker(){or===void 0&&(or=navigator.hardwareConcurrency||4);let t=this._workerPool.pop();return!t&&this._createdWorkers<or&&(this._createdWorkers++,t=new gl().worker,t.addEventListener("message",e=>{this._complete(e.data),this._returnWorker(e.target),this._next()})),t}_returnWorker(t){this._workerPool.push(t)}_complete(t){this._resolveHash[t.uuid]&&(t.error!==void 0?this._resolveHash[t.uuid].reject(t.error):this._resolveHash[t.uuid].resolve(t.data),delete this._resolveHash[t.uuid])}async _run(t,e){await this._initWorkers();const s=new Promise((i,n)=>{this._queue.push({id:t,arguments:e,resolve:i,reject:n})});return this._next(),s}_next(){if(!this._queue.length)return;const t=this._getWorker();if(!t)return;const e=this._queue.pop(),s=e.id;this._resolveHash[Ta]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Ta++,id:s})}reset(){this._workerPool.forEach(t=>t.terminate()),this._workerPool.length=0,Object.values(this._resolveHash).forEach(({reject:t})=>{t?.(new Error("WorkerManager has been reset before completion"))}),this._resolveHash={},this._queue.length=0,this._initialized=!1,this._createdWorkers=0}}const Pa=new Df,Lf=[".jpeg",".jpg",".png",".webp",".avif"],Xf=["image/jpeg","image/png","image/webp","image/avif"];async function Of(r,t){const e=await mt.get().fetch(r);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${e.status} ${e.statusText}`);const s=await e.blob();return t?.data?.alphaMode==="premultiplied-alpha"?createImageBitmap(s,{premultiplyAlpha:"none"}):createImageBitmap(s)}
289const pl={name:"loadTextures",id:"texture",extension:{type:V.LoadParser,priority:pe.High,name:"loadTextures"},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(r){return ps(r,Xf)||qt(r,Lf)},async load(r,t,e){let s=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Pa.isImageBitmapSupported()?s=await Pa.loadImageBitmap(r,t):s=await Of(r,t):s=await new Promise((n,o)=>{s=mt.get().createImage(),s.crossOrigin=this.config.crossOrigin,s.src=r,s.complete?n(s):(s.onload=()=>{n(s)},s.onerror=o)});const i=new us({resource:s,alphaMode:"premultiply-alpha-on-upload",resolution:t.data?.resolution||$r(r),...t.data});return qr(i,e,r)},unload(r){r.destroy(!0)}},Gf=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"];let lr,hr;function Nf(r,t,e){e===void 0&&!t.startsWith("data:")?r.crossOrigin=zf(t):e!==!1&&(r.crossOrigin=typeof e=="string"?e:"anonymous")}function Vf(r){return new Promise((t,e)=>{r.addEventListener("canplaythrough",s),r.addEventListener("error",i),r.load();function s(){n(),t()}function i(o){n(),e(o)}function n(){r.removeEventListener("canplaythrough",s),r.removeEventListener("error",i)}})}function zf(r,t=globalThis.location){if(r.startsWith("data:"))return"";t||(t=globalThis.location);const e=new URL(r,document.baseURI);return e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""}function Uf(){const r=[],t=[];for(const e of Gf){const s=Is.MIME_TYPES[e.substring(1)]||`video/${e.substring(1)}`;vi(s)&&(r.push(e),t.includes(s)||t.push(s))}return{validVideoExtensions:r,validVideoMime:t}}const Wf={name:"loadVideo",id:"video",extension:{type:V.LoadParser,name:"loadVideo"},test(r){if(!lr||!hr){const{validVideoExtensions:s,validVideoMime:i}=Uf();lr=s,hr=i}const t=ps(r,hr),e=qt(r,lr);return t||e},async load(r,t,e){const s={...Is.defaultOptions,resolution:t.data?.resolution||$r(r),alphaMode:t.data?.alphaMode||await uo(),...t.data},i=document.createElement("video"),n={preload:s.autoLoad!==!1?"auto":void 0,"webkit-playsinline":s.playsinline!==!1?"":void 0,playsinline:s.playsinline!==!1?"":void 0,muted:s.muted===!0?"":void 0,loop:s.loop===!0?"":void 0,autoplay:s.autoPlay!==!1?"":void 0};Object.keys(n).forEach(a=>{const h=n[a];h!==void 0&&i.setAttribute(a,h)}),s.muted===!0&&(i.muted=!0),Nf(i,r,s.crossorigin);const o=document.createElement("source");let l;if(s.mime)l=s.mime;else if(r.startsWith("data:"))l=r.slice(5,r.indexOf(";"));else if(!r.startsWith("blob:")){const a=r.split("?")[0].slice(r.lastIndexOf(".")+1).toLowerCase();l=Is.MIME_TYPES[a]||`video/${a}`}return o.src=r,l&&(o.type=l),new Promise((a,h)=>{s.preload&&!s.autoPlay&&i.load(),i.addEventListener("canplay",c),i.addEventListener("error",d),o.addEventListener("error",d),i.appendChild(o);async function c(){const u=new Is({...s,resource:i});f(),t.data.preload&&await Vf(i),a(qr(u,e,r))}function d(u){f(),h(u)}function f(){i.removeEventListener("canplay",c),i.removeEventListener("error",d),o.removeEventListener("error",d)}})},unload(r){r.destroy(!0)}},xl={extension:{type:V.ResolveParser,name:"resolveTexture"},test:pl.test,parse:r=>({resolution:parseFloat(He.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})},Hf={extension:{type:V.ResolveParser,priority:-2,name:"resolveJson"},test:r=>He.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:xl.parse};class $f{constructor(){this._detections=[],this._initialized=!1,this.resolver=new He,this.loader=new Md,this.cache=bt,this._backgroundLoader=new yd(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized){xt("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let n=t.manifest;typeof n=="string"&&(n=await this.load(n)),this.resolver.addManifest(n)}const e=t.texturePreference?.resolution??1,s=typeof e=="number"?[e]:e,i=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:i,resolution:s}}),t.preferences&&this.setPreferences(t.preferences),t.loadOptions&&(this.loader.loadOptions={...this.loader.loadOptions,...t.loadOptions})}add(t){this.resolver.add(t)}async load(t,e){this._initialized||await this.init();const s=hi(t),i=ee(t).map(l=>{if(typeof l!="string"){const a=this.resolver.getAlias(l);return a.some(h=>!this.resolver.hasKey(h))&&this.add(l),Array.isArray(a)?a[0]:a}return this.resolver.hasKey(l)||this.add({alias:l,src:l}),l}),n=this.resolver.resolve(i),o=await this._mapLoadToResolve(n,e);return s?o[i[0]]:o}
289addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let s=!1;typeof t=="string"&&(s=!0,t=[t]);const i=this.resolver.resolveBundle(t),n={},o=Object.keys(i);let l=0;const a=[],h=()=>{e?.(a.reduce((d,f)=>d+f,0)/l)},c=o.map((d,f)=>{const u=i[d],m=Object.values(u),p=[...new Set(m.flat())].reduce((b,w)=>b+(w.progressSize||1),0);return a.push(0),l+=p,this._mapLoadToResolve(u,b=>{a[f]=b*p,h()}).then(b=>{n[d]=b})});return await Promise.all(c),s?n[t[0]]:n}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(s=>{this._backgroundLoader.add(Object.values(s))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return bt.get(t);const e={};for(let s=0;s<t.length;s++)e[s]=bt.get(t[s]);return e}async _mapLoadToResolve(t,e){const s=[...new Set(Object.values(t))];this._backgroundLoader.active=!1;const i=await this.loader.load(s,e);this._backgroundLoader.active=!0;const n={};return s.forEach(o=>{const l=i[o.src],a=[o.src];o.alias&&a.push(...o.alias),a.forEach(h=>{n[h]=l}),bt.set(a,l)}),n}async unload(t){this._initialized||await this.init();const e=ee(t).map(i=>typeof i!="string"?i.src:i),s=this.resolver.resolve(e);await this._unloadFromResolved(s)}async unloadBundle(t){this._initialized||await this.init(),t=ee(t);const e=this.resolver.resolveBundle(t),s=Object.keys(e).map(i=>this._unloadFromResolved(e[i]));await Promise.all(s)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(s=>{bt.remove(s.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const s of t.detections)t.skipDetections||await s.test()?e=await s.add(e):t.skipDetections||(e=await s.remove(e));return e=e.filter((s,i)=>e.indexOf(s)===i),e}get detections(){return this._detections}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(s=>s in t).forEach(s=>{e.config[s]=t[s]})})}}const Ge=new $f;lt.handleByList(V.LoadParser,Ge.loader.parsers).handleByList(V.ResolveParser,Ge.resolver.parsers).handleByList(V.CacheParser,Ge.cache.parsers).handleByList(V.DetectionParser,Ge.detections);lt.add(bd,_d,wd,kd,Ad,Cd,Sd,Id,Fd,Nd,Ef,pl,Wf,xd,pd,xl,Hf);const Ia={loader:V.LoadParser,resolver:V.ResolveParser,cache:V.CacheParser,detection:V.DetectionParser};lt.handle(V.Asset,r=>{const t=r.ref;Object.entries(Ia).filter(([e])=>!!t[e]).forEach(([e,s])=>lt.add(Object.assign(t[e],{extension:t[e].extension??s})))},r=>{const t=r.ref;Object.keys(Ia).filter(e=>!!t[e]).forEach(e=>lt.remove(t[e]))});class qf{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class jf{constructor(){this.instructions=new Dr}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const jr=class Rr{constructor(t){this._renderer=t,this._managedContexts=new Ai({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Rr.defaultOptions.bezierSmoothness=t?.bezierSmoothness??Rr.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const e=t._gpuData,s=!!e[this._renderer.uid],i=e[this._renderer.uid]||this._initContext(t);return(t.dirty||!s)&&(s&&i.reset(),i.isBatchable=!1,t.dirty=!1),i}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const e=new jf,s=this.getGpuContext(t);return s.graphicsData=e,e.init(),e}_initContext(t){const e=new qf;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};jr.extension={type:[V.CanvasSystem],name:"graphicsContext"};jr.defaultOptions={bezierSmoothness:.5};let Kf=jr;class yl{constructor(t,e){this.state=ko.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Ai({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}
289addRenderable(t,e){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}yl.extension={type:[V.CanvasPipes],name:"graphics"};function Zf(r,t,e){const s=(r>>24&255)/255;t[e++]=(r&255)/255*s,t[e++]=(r>>8&255)/255*s,t[e++]=(r>>16&255)/255*s,t[e++]=s}class Qf{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{zt.return(t)}),this.batches.length=0}}class bl{constructor(t,e){this.state=ko.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Ai({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const e=t.context,s=!!t._gpuData,n=this.renderer.graphicsContext.updateGpuContext(e);return!!(n.isBatchable||s!==n.isBatchable)}addRenderable(t,e){const i=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),i.isBatchable?this._addToBatcher(t,e):(this.renderer.renderPipes.batch.break(e),e.add(t))}updateRenderable(t){const s=this._getGpuDataForRenderable(t).batches;for(let i=0;i<s.length;i++){const n=s[i];n._batcher.updateElement(n)}}execute(t){if(!t.isRenderable)return;const e=this.renderer,s=t.context;if(!e.graphicsContext.getGpuContext(s).batches.length)return;const n=s.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const o=n.resources.localUniforms.uniforms;o.uTransformMatrix=t.groupTransform,o.uRound=e._roundPixels|t._roundPixels,Zf(t.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const e=this._getGpuDataForRenderable(t),i=this.renderer.graphicsContext.updateGpuContext(t.context);e.destroy(),i.isBatchable&&this._updateBatchesForRenderable(t,e)}_addToBatcher(t,e){const s=this.renderer.renderPipes.batch,i=this._getGpuDataForRenderable(t).batches;for(let n=0;n<i.length;n++){const o=i[n];s.addToBatch(o,e)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const e=new Qf;return t._gpuData[this.renderer.uid]=e,this._managedGraphics.add(t),e}_updateBatchesForRenderable(t,e){const s=t.context,n=this.renderer.graphicsContext.getGpuContext(s),o=this.renderer._roundPixels|t._roundPixels;e.batches=n.batches.map(l=>{const a=zt.get(Vr);return l.copyTo(a),a.renderable=t,a.roundPixels=o,a})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.de
289stroy(),this._adaptor=null,this.state=null}}bl.extension={type:[V.WebGLPipes,V.WebGPUPipes],name:"graphics"};lt.add(yl);lt.add(bl);lt.add(Kf);lt.add(Wr);class ui extends Lr{constructor(t){t instanceof is&&(t={context:t});const{context:e,roundPixels:s,...i}=t||{};super({label:"Graphics",...i}),this.renderPipeId="graphics",e?this.context=e:(this.context=this._ownedContext=new is,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=s??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||t?.context===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new ui(this._context.clone()):(this._ownedContext=null,new ui(this._context))}lineStyle(t,e,s){at(At,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const i={};return t&&(i.width=t),e&&(i.color=e),s&&(i.alpha=s),this.context.strokeStyle=i,this}beginFill(t,e){at(At,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const s={};return t!==void 0&&(s.color=t),e!==void 0&&(s.alpha=e),this.context.fillStyle=s,this}endFill(){at(At,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return(t.width!==is.defaultStrokeStyle.width||t.color!==is.defaultStrokeStyle.color||t.alpha!==is.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return at(At,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return at(At,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return at(At,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return at(At,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return at(At,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return at(At,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}lt.add(_h,vh);if(typeof window<"u"&&window.PIXI){const r=window.require;window.require=t=>{if(r)return r(t);if(t.startsWith("@pixi/")||t.startsWith("pixi.js"))return window.PIXI}}class wl{entries={};size=0;add(t){let e=this.entries[t];return this.entries[t]=!0,e?!1:(this.size++,!0)}addAll(t){let e=this.size;
289for(var s=0,i=t.length;s<i;s++)this.add(t[s]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}}class W{r;g;b;a;static WHITE=new W(1,1,1,1);static RED=new W(1,0,0,1);static GREEN=new W(0,1,0,1);static BLUE=new W(0,0,1,1);static MAGENTA=new W(1,0,1,1);constructor(t=0,e=0,s=0,i=0){this.r=t,this.g=e,this.b=s,this.a=i}set(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)=="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,s,i){return this.r+=t,this.g+=e,this.b+=s,this.a+=i,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((e&4278190080)>>>24)/255,t.g=((e&16711680)>>>16)/255,t.b=((e&65280)>>>8)/255,t.a=(e&255)/255}static rgb888ToColor(t,e){t.r=((e&16711680)>>>16)/255,t.g=((e&65280)>>>8)/255,t.b=(e&255)/255}toRgb888(){const t=e=>("0"+(e*255).toString(16)).slice(-2);return+("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,e=new W){return e.setFromString(t)}}class X{static PI=3.1415927;static PI2=X.PI*2;static invPI2=1/X.PI2;static radiansToDegrees=180/X.PI;static radDeg=X.radiansToDegrees;static degreesToRadians=X.PI/180;static degRad=X.degreesToRadians;static clamp(t,e,s){return t<e?e:t>s?s:t}static cosDeg(t){return Math.cos(t*X.degRad)}static sinDeg(t){return Math.sin(t*X.degRad)}static atan2Deg(t,e){return Math.atan2(t,e)*X.degRad}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),.3333333333333333);return t<0?-e:e}static randomTriangular(t,e){return X.randomTriangularWith(t,e,(t+e)*.5)}static randomTriangularWith(t,e,s){let i=Math.random(),n=e-t;return i<=(s-t)/n?t+Math.sqrt(i*n*(s-t)):e-Math.sqrt((1-i)*n*(e-s))}static isPowerOfTwo(t){return t&&(t&t-1)===0}}class O{static SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";static arrayCopy(t,e,s,i,n){for(let o=e,l=i;o<e+n;o++,l++)s[l]=t[o]}static arrayFill(t,e,s,i){for(let n=e;n<s;n++)t[n]=i}static setArraySize(t,e,s=0){let i=t.length;if(i==e)return t;if(t.length=e,i<e)for(let n=i;n<e;n++)t[n]=s;return t}static ensureArrayCapacity(t,e,s=0){return t.length>=e?t:O.setArraySize(t,e,s)}static newArray(t,e){let s=new Array(t);for(let i=0;i<t;i++)s[i]=e;return s}static newFloatArray(t){if(O.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let s=0;s<e.length;s++)e[s]=0;return e}}static newShortArray(t){if(O.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let s=0;s<e.length;s++)e[s]=0;return e}}static toFloatArray(t){return O.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return O.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,s=!0){for(var i=0;i<t.length;i++)if(t[i]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}}class Ns{items=new Array;instantiator;constructor(t){this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class fi{x;y;constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return t!=0&&(this.x/=t,this.y/=t),this}}class _l{name;constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}}class re extends _l{static nextID=0;id=re.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(t){super(t)}computeWorldVertices(t,e,s,i,n,o){s=n+(s>>1)*o;let l=t.bone.skeleton,a=t.deform,h=this.vertices,c=this.bones;if(!c){a.length>0&&(h=a);let m=t.bone,g=m.worldX,p=m.worldY,b=m.a,w=m.b,x=m.c,y=m.d;for(let _=e,v=n;v<s;_+=2,v+=o){let A=h[_],C=h[_+1];i[v]=A*b+C*w+g,i[v+1]=A*x+C*y+p}return}let d=0,f=0;for(let m=0;m<e;m+=2){let g=c[d];d+=g+1,f+=g}let u=l.bones;if(a.length==0)for(let m=n,g=f*3;m<s;m+=o){let p=0,b=0,w=c[d++];for(w+=d;d<w;d++,g+=3){let x=u[c[d]],y=h[g],_=h[g+1],v=h[g+2];p+=(y*x.a+_*x.b+x.worldX)*v,b+=(y*x.c+_*x.d+x.worldY)*v}
289i[m]=p,i[m+1]=b}else{let m=a;for(let g=n,p=f*3,b=f<<1;g<s;g+=o){let w=0,x=0,y=c[d++];for(y+=d;d<y;d++,p+=3,b+=2){let _=u[c[d]],v=h[p]+m[b],A=h[p+1]+m[b+1],C=h[p+2];w+=(v*_.a+A*_.b+_.worldX)*C,x+=(v*_.c+A*_.d+_.worldY)*C}i[g]=w,i[g+1]=x}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),O.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=O.newFloatArray(this.vertices.length),O.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}}class cs{static _nextID=0;id=cs.nextID();regions;start=0;digits=0;setupIndex=0;constructor(t){this.regions=new Array(t)}copy(){let t=new cs(this.regions.length);return O.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,e){let s=t.sequenceIndex;s==-1&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1);let i=this.regions[s];e.region!=i&&(e.region=i,e.updateRegion())}getPath(t,e){let s=t,i=(this.start+e).toString();for(let n=this.digits-i.length;n>0;n--)s+="0";return s+=i,s}static nextID(){return cs._nextID++}}var It;(function(r){r[r.hold=0]="hold",r[r.once=1]="once",r[r.loop=2]="loop",r[r.pingpong=3]="pingpong",r[r.onceReverse=4]="onceReverse",r[r.loopReverse=5]="loopReverse",r[r.pingpongReverse=6]="pingpongReverse"})(It||(It={}));const vl=[It.hold,It.once,It.loop,It.pingpong,It.onceReverse,It.loopReverse,It.pingpongReverse];class Kr{name;timelines=[];timelineIds=new wl;duration;constructor(t,e,s){if(!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=s}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,s,i,n,o,l,a){if(!t)throw new Error("skeleton cannot be null.");i&&this.duration!=0&&(s%=this.duration,e>0&&(e%=this.duration));let h=this.timelines;for(let c=0,d=h.length;c<d;c++)h[c].apply(t,e,s,n,o,l,a)}}var Y;(function(r){r[r.setup=0]="setup",r[r.first=1]="first",r[r.replace=2]="replace",r[r.add=3]="add"})(Y||(Y={}));var Dt;(function(r){r[r.mixIn=0]="mixIn",r[r.mixOut=1]="mixOut"})(Dt||(Dt={}));const K={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28};class ct{propertyIds;frames;constructor(t,e){this.propertyIds=e,this.frames=O.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let s=t.length;for(let i=1;i<s;i++)if(t[i]>e)return i-1;return s-1}static search(t,e,s){let i=t.length;for(let n=s;n<i;n+=s)if(t[n]>e)return n-s;return i-s}}class xe extends ct{curves;constructor(t,e,s){super(t,s),this.curves=O.newFloatArray(t+e*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+t*18;if(this.curves.length>e){let s=O.newFloatArray(e);O.arrayCopy(this.curves,0,s,0,e),this.curves=s}}setBezier(t,e,s,i,n,o,l,a,h,c,d){let f=this.curves,u=this.getFrameCount()+t*18;s==0&&(f[e]=2+u);let m=(i-o*2+a)*.03,g=(n-l*2+h)*.03,p=((o-a)*3-i+c)*.006,b=((l-h)*3-n+d)*.006,w=m*2+p,x=g*2+b,y=(o-i)*.3+m+p*.16666667,_=(l-n)*.3+g+b*.16666667,v=i+y,A=n+_;for(let C=u+18;u<C;u+=2)f[u]=v,f[u+1]=A,y+=w,_+=x,w+=p,x+=b,v+=y,A+=_}getBezierValue(t,e,s,i){let n=this.curves;if(n[i]>t){let h=this.frames[e],c=this.frames[e+s];return c+(t-h)/(n[i]-h)*(n[i+1]-c)}let o=i+18;for(i+=2;i<o;i+=2)if(n[i]>=t){let h=n[i-2],c=n[i-1];return c+(t-h)/(n[i]-h)*(n[i+1]-c)}e+=this.getFrameEntries();let l=n[o-2],a=n[o-1];return a+(t-l)/(this.frames[e]-l)*(this.frames[e+s]-a)}}class ne extends xe{constructor(t,e,s){super(t,e,[s])}getFrameEntries(){return 2}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+1]=s}getCurveValue(t){let e=this.frames,s=e.length-2;for(let n=2;n<=s;n+=2)if(e[n]>t){s=n-2;break}let i=this.curves[s>>1];switch(i){case 0:let n=e[s],o=e[s+1];return o+(t-n)/(e[s+2]-n)*(e[s+2+1]-o);case 1:return e[s+1]}return this.getBezierValue(t,s,1,i-2)}getRelativeValue(t,e,s,i,n){if(t<this.frames[0]){switch(s){case Y.setup:return n;case Y.first:return i+(n-i)*e}return i}let o=this.getCurveValue(t);switch(s){case Y.setup:return n+o*e;case Y.first:case Y.replace:o+=n-i}return i+o*e}getAbsoluteValue(t,e,s,i,n){if(t<this.frames[0]){switch(s){case Y.setup:return n;case Y.first:return i+(n-i)*e}return i}let o=this.getCurveValue(t);return s==Y.setup?n+(o-n)*e:i+(o-i)*e}getAbsoluteValue2(t,e,s,i,n,o){if(t<this.frames[0]){switch(s){case Y.setup:return n;case Y.first:return i+(n-i)*e}return i}return s==Y.setup?n+(o-n)*e:i+(o-i)*e}getScaleValue(t,e,s,i,n,o){const l=this.frames;if(t<l[0]){switch(s){case Y.setup:return o;case Y.first:return n+(o-n)*e}return n}let a=this.getCurveValue(t)*o;if(e==1)return s==Y.add?n+a-o:a;if(i==Dt.mixOut)switch(s){case Y.setup:return o+(Math.abs(a)*X.signum(o)-o)*e;case Y.first:case Y.replace:return n+(Math.abs(a)*X.signum(n)-n)*e}else{let h=0;switch(s){case Y.setup:return h=Math.abs(o)*X.signum(a),h+(a-h)*e;case Y.first:case Y.replace:return h=Math.abs(n)*X.signum(a),h+(a-h)*e}}return n+(a-o)*e}}class Zr extends xe{constructor(t,e,s,i){super(t,e,[s,i])}getFrameEntries(){return 3}setFrame(t,e,s,i){t*=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i}}class mi extends ne{boneIndex=0;constructor(t,e,s){super(t,e,K.rotate+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];a.active&&(a.rotation=this.getRelativeValue(s,n,o,a.rotation,a.data.rotation))}}class Al extends Zr{boneIndex=0;constructor(t,e,s){super(t,e,K.x+"|"+s,K.y+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];if(!a.active)return;let h=this.frames;if(s<h[0]){switch(o){case Y.setup:a.x=a.data.x,a.y=a.data.y;return;case Y.first:a.x+=(a.data.x-a.x)*n,a.y+=(a.data.y-a.y)*n}return}let c=0,d=0,f=ct.search(h,s,3),u=this.curves[f/3];switch(u){case 0:let m=h[f];c=h[f+1],d=h[f+2];let g=(s-m)/(h[f+3]-m);
289c+=(h[f+3+1]-c)*g,d+=(h[f+3+2]-d)*g;break;case 1:c=h[f+1],d=h[f+2];break;default:c=this.getBezierValue(s,f,1,u-2),d=this.getBezierValue(s,f,2,u+18-2)}switch(o){case Y.setup:a.x=a.data.x+c*n,a.y=a.data.y+d*n;break;case Y.first:case Y.replace:a.x+=(a.data.x+c-a.x)*n,a.y+=(a.data.y+d-a.y)*n;break;case Y.add:a.x+=c*n,a.y+=d*n}}}class Cl extends ne{boneIndex=0;constructor(t,e,s){super(t,e,K.x+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];a.active&&(a.x=this.getRelativeValue(s,n,o,a.x,a.data.x))}}class Sl extends ne{boneIndex=0;constructor(t,e,s){super(t,e,K.y+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];a.active&&(a.y=this.getRelativeValue(s,n,o,a.y,a.data.y))}}class kl extends Zr{boneIndex=0;constructor(t,e,s){super(t,e,K.scaleX+"|"+s,K.scaleY+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];if(!a.active)return;let h=this.frames;if(s<h[0]){switch(o){case Y.setup:a.scaleX=a.data.scaleX,a.scaleY=a.data.scaleY;return;case Y.first:a.scaleX+=(a.data.scaleX-a.scaleX)*n,a.scaleY+=(a.data.scaleY-a.scaleY)*n}return}let c,d,f=ct.search(h,s,3),u=this.curves[f/3];switch(u){case 0:let m=h[f];c=h[f+1],d=h[f+2];let g=(s-m)/(h[f+3]-m);c+=(h[f+3+1]-c)*g,d+=(h[f+3+2]-d)*g;break;case 1:c=h[f+1],d=h[f+2];break;default:c=this.getBezierValue(s,f,1,u-2),d=this.getBezierValue(s,f,2,u+18-2)}if(c*=a.data.scaleX,d*=a.data.scaleY,n==1)o==Y.add?(a.scaleX+=c-a.data.scaleX,a.scaleY+=d-a.data.scaleY):(a.scaleX=c,a.scaleY=d);else{let m=0,g=0;if(l==Dt.mixOut)switch(o){case Y.setup:m=a.data.scaleX,g=a.data.scaleY,a.scaleX=m+(Math.abs(c)*X.signum(m)-m)*n,a.scaleY=g+(Math.abs(d)*X.signum(g)-g)*n;break;case Y.first:case Y.replace:m=a.scaleX,g=a.scaleY,a.scaleX=m+(Math.abs(c)*X.signum(m)-m)*n,a.scaleY=g+(Math.abs(d)*X.signum(g)-g)*n;break;case Y.add:a.scaleX+=(c-a.data.scaleX)*n,a.scaleY+=(d-a.data.scaleY)*n}else switch(o){case Y.setup:m=Math.abs(a.data.scaleX)*X.signum(c),g=Math.abs(a.data.scaleY)*X.signum(d),a.scaleX=m+(c-m)*n,a.scaleY=g+(d-g)*n;break;case Y.first:case Y.replace:m=Math.abs(a.scaleX)*X.signum(c),g=Math.abs(a.scaleY)*X.signum(d),a.scaleX=m+(c-m)*n,a.scaleY=g+(d-g)*n;break;case Y.add:a.scaleX+=(c-a.data.scaleX)*n,a.scaleY+=(d-a.data.scaleY)*n}}}}class Ml extends ne{boneIndex=0;constructor(t,e,s){super(t,e,K.scaleX+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];a.active&&(a.scaleX=this.getScaleValue(s,n,o,l,a.scaleX,a.data.scaleX))}}class Tl extends ne{boneIndex=0;constructor(t,e,s){super(t,e,K.scaleY+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];a.active&&(a.scaleY=this.getScaleValue(s,n,o,l,a.scaleY,a.data.scaleY))}}class Pl extends Zr{boneIndex=0;constructor(t,e,s){super(t,e,K.shearX+"|"+s,K.shearY+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];if(!a.active)return;let h=this.frames;if(s<h[0]){switch(o){case Y.setup:a.shearX=a.data.shearX,a.shearY=a.data.shearY;return;case Y.first:a.shearX+=(a.data.shearX-a.shearX)*n,a.shearY+=(a.data.shearY-a.shearY)*n}return}let c=0,d=0,f=ct.search(h,s,3),u=this.curves[f/3];switch(u){case 0:let m=h[f];c=h[f+1],d=h[f+2];let g=(s-m)/(h[f+3]-m);c+=(h[f+3+1]-c)*g,d+=(h[f+3+2]-d)*g;break;case 1:c=h[f+1],d=h[f+2];break;default:c=this.getBezierValue(s,f,1,u-2),d=this.getBezierValue(s,f,2,u+18-2)}switch(o){case Y.setup:a.shearX=a.data.shearX+c*n,a.shearY=a.data.shearY+d*n;break;case Y.first:case Y.replace:a.shearX+=(a.data.shearX+c-a.shearX)*n,a.shearY+=(a.data.shearY+d-a.shearY)*n;break;case Y.add:a.shearX+=c*n,a.shearY+=d*n}}}class Il extends ne{boneIndex=0;constructor(t,e,s){super(t,e,K.shearX+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];a.active&&(a.shearX=this.getRelativeValue(s,n,o,a.shearX,a.data.shearX))}}class El extends ne{boneIndex=0;constructor(t,e,s){super(t,e,K.shearY+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];a.active&&(a.shearY=this.getRelativeValue(s,n,o,a.shearY,a.data.shearY))}}class Rl extends ct{boneIndex=0;constructor(t,e){super(t,[K.inherit+"|"+e]),this.boneIndex=e}getFrameEntries(){return 2}setFrame(t,e,s){t*=2,this.frames[t]=e,this.frames[t+1]=s}
289apply(t,e,s,i,n,o,l){let a=t.bones[this.boneIndex];if(!a.active)return;if(l==Dt.mixOut){o==Y.setup&&(a.inherit=a.data.inherit);return}let h=this.frames;if(s<h[0]){(o==Y.setup||o==Y.first)&&(a.inherit=a.data.inherit);return}a.inherit=this.frames[ct.search(h,s,2)+1]}}class Fl extends xe{slotIndex=0;constructor(t,e,s){super(t,e,[K.rgb+"|"+s,K.alpha+"|"+s]),this.slotIndex=s}getFrameEntries(){return 5}setFrame(t,e,s,i,n,o){t*=5,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n,this.frames[t+4]=o}apply(t,e,s,i,n,o,l){let a=t.slots[this.slotIndex];if(!a.bone.active)return;let h=this.frames,c=a.color;if(s<h[0]){let b=a.data.color;switch(o){case Y.setup:c.setFromColor(b);return;case Y.first:c.add((b.r-c.r)*n,(b.g-c.g)*n,(b.b-c.b)*n,(b.a-c.a)*n)}return}let d=0,f=0,u=0,m=0,g=ct.search(h,s,5),p=this.curves[g/5];switch(p){case 0:let b=h[g];d=h[g+1],f=h[g+2],u=h[g+3],m=h[g+4];let w=(s-b)/(h[g+5]-b);d+=(h[g+5+1]-d)*w,f+=(h[g+5+2]-f)*w,u+=(h[g+5+3]-u)*w,m+=(h[g+5+4]-m)*w;break;case 1:d=h[g+1],f=h[g+2],u=h[g+3],m=h[g+4];break;default:d=this.getBezierValue(s,g,1,p-2),f=this.getBezierValue(s,g,2,p+18-2),u=this.getBezierValue(s,g,3,p+36-2),m=this.getBezierValue(s,g,4,p+54-2)}n==1?c.set(d,f,u,m):(o==Y.setup&&c.setFromColor(a.data.color),c.add((d-c.r)*n,(f-c.g)*n,(u-c.b)*n,(m-c.a)*n))}}class Bl extends xe{slotIndex=0;constructor(t,e,s){super(t,e,[K.rgb+"|"+s]),this.slotIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,i,n){t<<=2,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n}apply(t,e,s,i,n,o,l){let a=t.slots[this.slotIndex];if(!a.bone.active)return;let h=this.frames,c=a.color;if(s<h[0]){let p=a.data.color;switch(o){case Y.setup:c.r=p.r,c.g=p.g,c.b=p.b;return;case Y.first:c.r+=(p.r-c.r)*n,c.g+=(p.g-c.g)*n,c.b+=(p.b-c.b)*n}return}let d=0,f=0,u=0,m=ct.search(h,s,4),g=this.curves[m>>2];switch(g){case 0:let p=h[m];d=h[m+1],f=h[m+2],u=h[m+3];let b=(s-p)/(h[m+4]-p);d+=(h[m+4+1]-d)*b,f+=(h[m+4+2]-f)*b,u+=(h[m+4+3]-u)*b;break;case 1:d=h[m+1],f=h[m+2],u=h[m+3];break;default:d=this.getBezierValue(s,m,1,g-2),f=this.getBezierValue(s,m,2,g+18-2),u=this.getBezierValue(s,m,3,g+36-2)}if(n==1)c.r=d,c.g=f,c.b=u;else{if(o==Y.setup){let p=a.data.color;c.r=p.r,c.g=p.g,c.b=p.b}c.r+=(d-c.r)*n,c.g+=(f-c.g)*n,c.b+=(u-c.b)*n}}}class Yl extends ne{slotIndex=0;constructor(t,e,s){super(t,e,K.alpha+"|"+s),this.slotIndex=s}apply(t,e,s,i,n,o,l){let a=t.slots[this.slotIndex];if(!a.bone.active)return;let h=a.color;if(s<this.frames[0]){let d=a.data.color;switch(o){case Y.setup:h.a=d.a;return;case Y.first:h.a+=(d.a-h.a)*n}return}let c=this.getCurveValue(s);n==1?h.a=c:(o==Y.setup&&(h.a=a.data.color.a),h.a+=(c-h.a)*n)}}class Dl extends xe{slotIndex=0;constructor(t,e,s){super(t,e,[K.rgb+"|"+s,K.alpha+"|"+s,K.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 8}setFrame(t,e,s,i,n,o,l,a,h){t<<=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n,this.frames[t+4]=o,this.frames[t+5]=l,this.frames[t+6]=a,this.frames[t+7]=h}apply(t,e,s,i,n,o,l){let a=t.slots[this.slotIndex];if(!a.bone.active)return;let h=this.frames,c=a.color,d=a.darkColor;if(s<h[0]){let _=a.data.color,v=a.data.darkColor;switch(o){case Y.setup:c.setFromColor(_),d.r=v.r,d.g=v.g,d.b=v.b;return;case Y.first:c.add((_.r-c.r)*n,(_.g-c.g)*n,(_.b-c.b)*n,(_.a-c.a)*n),d.r+=(v.r-d.r)*n,d.g+=(v.g-d.g)*n,d.b+=(v.b-d.b)*n}return}let f=0,u=0,m=0,g=0,p=0,b=0,w=0,x=ct.search(h,s,8),y=this.curves[x>>3];switch(y){case 0:let _=h[x];f=h[x+1],u=h[x+2],m=h[x+3],g=h[x+4],p=h[x+5],b=h[x+6],w=h[x+7];let v=(s-_)/(h[x+8]-_);f+=(h[x+8+1]-f)*v,u+=(h[x+8+2]-u)*v,m+=(h[x+8+3]-m)*v,g+=(h[x+8+4]-g)*v,p+=(h[x+8+5]-p)*v,b+=(h[x+8+6]-b)*v,w+=(h[x+8+7]-w)*v;break;case 1:f=h[x+1],u=h[x+2],m=h[x+3],g=h[x+4],p=h[x+5],b=h[x+6],w=h[x+7];break;default:f=this.getBezierValue(s,x,1,y-2),u=this.getBezierValue(s,x,2,y+18-2),m=this.getBezierValue(s,x,3,y+36-2),g=this.getBezierValue(s,x,4,y+54-2),p=this.getBezierValue(s,x,5,y+72-2),b=this.getBezierValue(s,x,6,y+90-2),w=this.getBezierValue(s,x,7,y+108-2)}if(n==1)c.set(f,u,m,g),d.r=p,d.g=b,d.b=w;else{if(o==Y.setup){c.setFromColor(a.data.color);let _=a.data.darkColor;d.r=_.r,d.g=_.g,d.b=_.b}c.add((f-c.r)*n,(u-c.g)*n,(m-c.b)*n,(g-c.a)*n),d.r+=(p-d.r)*n,d.g+=(b-d.g)*n,d.b+=(w-d.b)*n}}}class Ll extends xe{slotIndex=0;constructor(t,e,s){super(t,e,[K.rgb+"|"+s,K.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,i,n,o,l,a){t*=7,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n,this.frames[t+4]=o,this.frames[t+5]=l,this.frames[t+6]=a}apply(t,e,s,i,n,o,l){let a=t.slots[this.slotIndex];if(!a.bone.active)return;
289let h=this.frames,c=a.color,d=a.darkColor;if(s<h[0]){let y=a.data.color,_=a.data.darkColor;switch(o){case Y.setup:c.r=y.r,c.g=y.g,c.b=y.b,d.r=_.r,d.g=_.g,d.b=_.b;return;case Y.first:c.r+=(y.r-c.r)*n,c.g+=(y.g-c.g)*n,c.b+=(y.b-c.b)*n,d.r+=(_.r-d.r)*n,d.g+=(_.g-d.g)*n,d.b+=(_.b-d.b)*n}return}let f=0,u=0,m=0,g=0,p=0,b=0,w=ct.search(h,s,7),x=this.curves[w/7];switch(x){case 0:let y=h[w];f=h[w+1],u=h[w+2],m=h[w+3],g=h[w+4],p=h[w+5],b=h[w+6];let _=(s-y)/(h[w+7]-y);f+=(h[w+7+1]-f)*_,u+=(h[w+7+2]-u)*_,m+=(h[w+7+3]-m)*_,g+=(h[w+7+4]-g)*_,p+=(h[w+7+5]-p)*_,b+=(h[w+7+6]-b)*_;break;case 1:f=h[w+1],u=h[w+2],m=h[w+3],g=h[w+4],p=h[w+5],b=h[w+6];break;default:f=this.getBezierValue(s,w,1,x-2),u=this.getBezierValue(s,w,2,x+18-2),m=this.getBezierValue(s,w,3,x+36-2),g=this.getBezierValue(s,w,4,x+54-2),p=this.getBezierValue(s,w,5,x+72-2),b=this.getBezierValue(s,w,6,x+90-2)}if(n==1)c.r=f,c.g=u,c.b=m,d.r=g,d.g=p,d.b=b;else{if(o==Y.setup){let y=a.data.color,_=a.data.darkColor;c.r=y.r,c.g=y.g,c.b=y.b,d.r=_.r,d.g=_.g,d.b=_.b}c.r+=(f-c.r)*n,c.g+=(u-c.g)*n,c.b+=(m-c.b)*n,d.r+=(g-d.r)*n,d.g+=(p-d.g)*n,d.b+=(b-d.b)*n}}}class ns extends ct{slotIndex=0;attachmentNames;constructor(t,e){super(t,[K.attachment+"|"+e]),this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.attachmentNames[t]=s}apply(t,e,s,i,n,o,l){let a=t.slots[this.slotIndex];if(a.bone.active){if(l==Dt.mixOut){o==Y.setup&&this.setAttachment(t,a,a.data.attachmentName);return}if(s<this.frames[0]){(o==Y.setup||o==Y.first)&&this.setAttachment(t,a,a.data.attachmentName);return}this.setAttachment(t,a,this.attachmentNames[ct.search1(this.frames,s)])}}setAttachment(t,e,s){e.setAttachment(s?t.getAttachment(this.slotIndex,s):null)}}class Xl extends xe{slotIndex=0;attachment;vertices;constructor(t,e,s,i){super(t,e,[K.deform+"|"+s+"|"+i.id]),this.slotIndex=s,this.attachment=i,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.vertices[t]=s}setBezier(t,e,s,i,n,o,l,a,h,c,d){let f=this.curves,u=this.getFrameCount()+t*18;s==0&&(f[e]=2+u);
289let m=(i-o*2+a)*.03,g=h*.03-l*.06,p=((o-a)*3-i+c)*.006,b=(l-h+.33333333)*.018,w=m*2+p,x=g*2+b,y=(o-i)*.3+m+p*.16666667,_=l*.3+g+b*.16666667,v=i+y,A=_;for(let C=u+18;u<C;u+=2)f[u]=v,f[u+1]=A,y+=w,_+=x,w+=p,x+=b,v+=y,A+=_}getCurvePercent(t,e){let s=this.curves,i=s[e];switch(i){case 0:let a=this.frames[e];return(t-a)/(this.frames[e+this.getFrameEntries()]-a);case 1:return 0}if(i-=2,s[i]>t){let a=this.frames[e];return s[i+1]*(t-a)/(s[i]-a)}let n=i+18;for(i+=2;i<n;i+=2)if(s[i]>=t){let a=s[i-2],h=s[i-1];return h+(t-a)/(s[i]-a)*(s[i+1]-h)}let o=s[n-2],l=s[n-1];return l+(1-l)*(t-o)/(this.frames[e+this.getFrameEntries()]-o)}apply(t,e,s,i,n,o,l){let a=t.slots[this.slotIndex];if(!a.bone.active)return;let h=a.getAttachment();if(!h||!(h instanceof re)||h.timelineAttachment!=this.attachment)return;let c=a.deform;c.length==0&&(o=Y.setup);let d=this.vertices,f=d[0].length,u=this.frames;if(s<u[0]){switch(o){case Y.setup:c.length=0;return;case Y.first:if(n==1){c.length=0;return}c.length=f;let x=h;if(x.bones){n=1-n;for(var m=0;m<f;m++)c[m]*=n}else{let y=x.vertices;for(var m=0;m<f;m++)c[m]+=(y[m]-c[m])*n}}return}if(c.length=f,s>=u[u.length-1]){let x=d[u.length-1];if(n==1)if(o==Y.add){let y=h;if(y.bones)for(let _=0;_<f;_++)c[_]+=x[_];else{let _=y.vertices;for(let v=0;v<f;v++)c[v]+=x[v]-_[v]}}else O.arrayCopy(x,0,c,0,f);else switch(o){case Y.setup:{let _=h;if(_.bones)for(let v=0;v<f;v++)c[v]=x[v]*n;else{let v=_.vertices;for(let A=0;A<f;A++){let C=v[A];c[A]=C+(x[A]-C)*n}}break}case Y.first:case Y.replace:for(let _=0;_<f;_++)c[_]+=(x[_]-c[_])*n;break;case Y.add:let y=h;if(y.bones)for(let _=0;_<f;_++)c[_]+=x[_]*n;else{let _=y.vertices;for(let v=0;v<f;v++)c[v]+=(x[v]-_[v])*n}}return}let g=ct.search1(u,s),p=this.getCurvePercent(s,g),b=d[g],w=d[g+1];if(n==1)if(o==Y.add){let x=h;if(x.bones)for(let y=0;y<f;y++){let _=b[y];c[y]+=_+(w[y]-_)*p}else{let y=x.vertices;for(let _=0;_<f;_++){let v=b[_];c[_]+=v+(w[_]-v)*p-y[_]}}}else for(let x=0;x<f;x++){let y=b[x];c[x]=y+(w[x]-y)*p}else switch(o){case Y.setup:{let y=h;if(y.bones)for(let _=0;_<f;_++){let v=b[_];c[_]=(v+(w[_]-v)*p)*n}else{let _=y.vertices;for(let v=0;v<f;v++){let A=b[v],C=_[v];c[v]=C+(A+(w[v]-A)*p-C)*n}}break}case Y.first:case Y.replace:for(let y=0;y<f;y++){let _=b[y];c[y]+=(_+(w[y]-_)*p-c[y])*n}break;case Y.add:let x=h;if(x.bones)for(let y=0;y<f;y++){let _=b[y];c[y]+=(_+(w[y]-_)*p)*n}else{let y=x.vertices;for(let _=0;_<f;_++){let v=b[_];c[_]+=(v+(w[_]-v)*p-y[_])*n}}}}}class zs extends ct{static propertyIds=[""+K.event];events;constructor(t){super(t,zs.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,s,i,n,o,l){if(!i)return;let a=this.frames,h=this.frames.length;if(e>s)this.apply(t,e,Number.MAX_VALUE,i,n,o,l),e=-1;else if(e>=a[h-1])return;if(s<a[0])return;let c=0;if(e<a[0])c=0;else{c=ct.search1(a,e)+1;let d=a[c];for(;c>0&&a[c-1]==d;)c--}for(;c<h&&s>=a[c];c++)i.push(this.events[c])}}class Ne extends ct{static propertyIds=[""+K.drawOrder];drawOrders;constructor(t){super(t,Ne.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.drawOrders[t]=s}apply(t,e,s,i,n,o,l){if(l==Dt.mixOut){o==Y.setup&&O.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(s<this.frames[0]){(o==Y.setup||o==Y.first)&&O.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let a=ct.search1(this.frames,s),h=this.drawOrders[a];if(!h)O.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);else{let c=t.drawOrder,d=t.slots;for(let f=0,u=h.length;f<u;f++)c[f]=d[h[f]]}}}class Ol extends xe{constraintIndex=0;constructor(t,e,s){super(t,e,[K.ikConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(t,e,s,i,n,o,l){t*=6,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n,this.frames[t+4]=o?1:0,this.frames[t+5]=l?1:0}apply(t,e,s,i,n,o,l){let a=t.ikConstraints[this.constraintIndex];if(!a.active)return;let h=this.frames;if(s<h[0]){switch(o){case Y.setup:a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch;return;case Y.first:a.mix+=(a.data.mix-a.mix)*n,a.softness+=(a.data.softness-a.softness)*n,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}return}let c=0,d=0,f=ct.search(h,s,6),u=this.curves[f/6];switch(u){case 0:let m=h[f];c=h[f+1],d=h[f+2];let g=(s-m)/(h[f+6]-m);c+=(h[f+6+1]-c)*g,d+=(h[f+6+2]-d)*g;break;case 1:c=h[f+1],d=h[f+2];break;default:c=this.getBezierValue(s,f,1,u-2),d=this.getBezierValue(s,f,2,u+18-2)}o==Y.setup?(a.mix=a.data.mix+(c-a.data.mix)*n,a.softness=a.data.softness+(d-a.data.softness)*n,l==Dt.mixOut?(a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch):(a.bendDirection=h[f+3],a.compress=h[f+4]!=0,a.stretch=h[f+5]!=0)):(a.mix+=(c-a.mix)*n,a.softness+=(d-a.softness)*n,l==Dt.mixIn&&(a.bendDirection=h[f+3],a.compress=h[f+4]!=0,a.stretch=h[f+5]!=0))}}class Gl extends xe{constraintIndex=0;constructor(t,e,s){super(t,e,[K.transformConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,i,n,o,l,a){let h=this.frames;t*=7,h[t]=e,h[t+1]=s,h[t+2]=i,h[t+3]=n,h[t+4]=o,h[t+5]=l,h[t+6]=a}apply(t,e,s,i,n,o,l){let a=t.transformConstraints[this.constraintIndex];if(!a.active)return;let h=this.frames;if(s<h[0]){let w=a.data;switch(o){case Y.setup:a.mixRotate=w.mixRotate,a.mixX=w.mixX,a.mixY=w.mixY,a.mixScaleX=w.mixScaleX,a.mixScaleY=w.mixScaleY,a.mixShearY=w.mixShearY;return;case Y.first:a.mixRotate+=(w.mixRotate-a.mixRotate)*n,a.mixX+=(w.mixX-a.mixX)*n,a.mixY+=(w.mixY-a.mixY)*n,a.mixScaleX+=(w.mixScaleX-a.mixScaleX)*n,a.mixScaleY+=(w.mixScaleY-a.mi
289xScaleY)*n,a.mixShearY+=(w.mixShearY-a.mixShearY)*n}return}let c,d,f,u,m,g,p=ct.search(h,s,7),b=this.curves[p/7];switch(b){case 0:let w=h[p];c=h[p+1],d=h[p+2],f=h[p+3],u=h[p+4],m=h[p+5],g=h[p+6];let x=(s-w)/(h[p+7]-w);c+=(h[p+7+1]-c)*x,d+=(h[p+7+2]-d)*x,f+=(h[p+7+3]-f)*x,u+=(h[p+7+4]-u)*x,m+=(h[p+7+5]-m)*x,g+=(h[p+7+6]-g)*x;break;case 1:c=h[p+1],d=h[p+2],f=h[p+3],u=h[p+4],m=h[p+5],g=h[p+6];break;default:c=this.getBezierValue(s,p,1,b-2),d=this.getBezierValue(s,p,2,b+18-2),f=this.getBezierValue(s,p,3,b+36-2),u=this.getBezierValue(s,p,4,b+54-2),m=this.getBezierValue(s,p,5,b+72-2),g=this.getBezierValue(s,p,6,b+90-2)}if(o==Y.setup){let w=a.data;a.mixRotate=w.mixRotate+(c-w.mixRotate)*n,a.mixX=w.mixX+(d-w.mixX)*n,a.mixY=w.mixY+(f-w.mixY)*n,a.mixScaleX=w.mixScaleX+(u-w.mixScaleX)*n,a.mixScaleY=w.mixScaleY+(m-w.mixScaleY)*n,a.mixShearY=w.mixShearY+(g-w.mixShearY)*n}else a.mixRotate+=(c-a.mixRotate)*n,a.mixX+=(d-a.mixX)*n,a.mixY+=(f-a.mixY)*n,a.mixScaleX+=(u-a.mixScaleX)*n,a.mixScaleY+=(m-a.mixScaleY)*n,a.mixShearY+=(g-a.mixShearY)*n}}class Nl extends ne{constraintIndex=0;constructor(t,e,s){super(t,e,K.pathConstraintPosition+"|"+s),this.constraintIndex=s}apply(t,e,s,i,n,o,l){let a=t.pathConstraints[this.constraintIndex];a.active&&(a.position=this.getAbsoluteValue(s,n,o,a.position,a.data.position))}}class Vl extends ne{constraintIndex=0;constructor(t,e,s){super(t,e,K.pathConstraintSpacing+"|"+s),this.constraintIndex=s}apply(t,e,s,i,n,o,l){let a=t.pathConstraints[this.constraintIndex];a.active&&(a.spacing=this.getAbsoluteValue(s,n,o,a.spacing,a.data.spacing))}}class zl extends xe{constraintIndex=0;constructor(t,e,s){super(t,e,[K.pathConstraintMix+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,i,n){let o=this.frames;t<<=2,o[t]=e,o[t+1]=s,o[t+2]=i,o[t+3]=n}apply(t,e,s,i,n,o,l){let a=t.pathConstraints[this.constraintIndex];if(!a.active)return;let h=this.frames;if(s<h[0]){switch(o){case Y.setup:a.mixRotate=a.data.mixRotate,a.mixX=a.data.mixX,a.mixY=a.data.mixY;return;case Y.first:a.mixRotate+=(a.data.mixRotate-a.mixRotate)*n,a.mixX+=(a.data.mixX-a.mixX)*n,a.mixY+=(a.data.mixY-a.mixY)*n}return}let c,d,f,u=ct.search(h,s,4),m=this.curves[u>>2];switch(m){case 0:let g=h[u];c=h[u+1],d=h[u+2],f=h[u+3];let p=(s-g)/(h[u+4]-g);c+=(h[u+4+1]-c)*p,d+=(h[u+4+2]-d)*p,f+=(h[u+4+3]-f)*p;break;case 1:c=h[u+1],d=h[u+2],f=h[u+3];break;default:c=this.getBezierValue(s,u,1,m-2),d=this.getBezierValue(s,u,2,m+18-2),f=this.getBezierValue(s,u,3,m+36-2)}if(o==Y.setup){let g=a.data;
289a.mixRotate=g.mixRotate+(c-g.mixRotate)*n,a.mixX=g.mixX+(d-g.mixX)*n,a.mixY=g.mixY+(f-g.mixY)*n}else a.mixRotate+=(c-a.mixRotate)*n,a.mixX+=(d-a.mixX)*n,a.mixY+=(f-a.mixY)*n}}class $e extends ne{constraintIndex=0;constructor(t,e,s,i){super(t,e,i+"|"+s),this.constraintIndex=s}apply(t,e,s,i,n,o,l){let a;if(this.constraintIndex==-1){const h=s>=this.frames[0]?this.getCurveValue(s):0;for(const c of t.physicsConstraints)c.active&&this.global(c.data)&&this.set(c,this.getAbsoluteValue2(s,n,o,this.get(c),this.setup(c),h))}else a=t.physicsConstraints[this.constraintIndex],a.active&&this.set(a,this.getAbsoluteValue(s,n,o,this.get(a),this.setup(a)))}}class Ul extends $e{constructor(t,e,s){super(t,e,s,K.physicsConstraintInertia)}setup(t){return t.data.inertia}get(t){return t.inertia}set(t,e){t.inertia=e}global(t){return t.inertiaGlobal}}class Wl extends $e{constructor(t,e,s){super(t,e,s,K.physicsConstraintStrength)}setup(t){return t.data.strength}get(t){return t.strength}set(t,e){t.strength=e}global(t){return t.strengthGlobal}}class Hl extends $e{constructor(t,e,s){super(t,e,s,K.physicsConstraintDamping)}setup(t){return t.data.damping}get(t){return t.damping}set(t,e){t.damping=e}global(t){return t.dampingGlobal}}class $l extends $e{constructor(t,e,s){super(t,e,s,K.physicsConstraintMass)}setup(t){return 1/t.data.massInverse}get(t){return 1/t.massInverse}set(t,e){t.massInverse=1/e}global(t){return t.massGlobal}}class ql extends $e{constructor(t,e,s){super(t,e,s,K.physicsConstraintWind)}setup(t){return t.data.wind}get(t){return t.wind}set(t,e){t.wind=e}global(t){return t.windGlobal}}class jl extends $e{constructor(t,e,s){super(t,e,s,K.physicsConstraintGravity)}setup(t){return t.data.gravity}get(t){return t.gravity}set(t,e){t.gravity=e}global(t){return t.gravityGlobal}}class Kl extends $e{constructor(t,e,s){super(t,e,s,K.physicsConstraintMix)}setup(t){return t.data.mix}get(t){return t.mix}set(t,e){t.mix=e}global(t){return t.mixGlobal}}class Si extends ct{static propertyIds=[K.physicsConstraintReset.toString()];constraintIndex;constructor(t,e){super(t,Si.propertyIds),this.constraintIndex=e}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e}apply(t,e,s,i,n,o,l){let a;if(this.constraintIndex!=-1&&(a=t.physicsConstraints[this.constraintIndex],!a.active))return;const h=this.frames;if(e>s)this.apply(t,e,Number.MAX_VALUE,[],n,o,l),e=-1;else if(e>=h[h.length-1])return;if(!(s<h[0])&&(e<h[0]||s>=h[ct.search1(h,e)+1]))if(a!=null)a.reset();else for(const c of t.physicsConstraints)c.active&&c.reset()}}class me extends ct{static ENTRIES=3;static MODE=1;static DELAY=2;slotIndex;attachment;constructor(t,e,s){super(t,[K.sequence+"|"+e+"|"+s.sequence.id]),this.slotIndex=e,this.attachment=s}getFrameEntries(){return me.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,s,i,n){let o=this.frames;t*=me.ENTRIES,o[t]=e,o[t+me.MODE]=s|i<<4,o[t+me.DELAY]=n}apply(t,e,s,i,n,o,l){let a=t.slots[this.slotIndex];if(!a.bone.active)return;let h=a.attachment,c=this.attachment;if(h!=c&&(!(h instanceof re)||h.timelineAttachment!=c))return;if(l==Dt.mixOut){o==Y.setup&&(a.sequenceIndex=-1);return}let d=this.frames;if(s<d[0]){(o==Y.setup||o==Y.first)&&(a.sequenceIndex=-1);return}let f=ct.search(d,s,me.ENTRIES),u=d[f],m=d[f+me.MODE],g=d[f+me.DELAY];if(!this.attachment.sequence)return;let p=m>>4,b=this.attachment.sequence.regions.length,w=vl[m&15];if(w!=It.hold)switch(p+=(s-u)/g+1e-5|0,w){case It.once:p=Math.min(b-1,p);break;case It.loop:p%=b;break;case It.pingpong:{let x=(b<<1)-2;p=x==0?0:p%x,p>=b&&(p=x-p);break}case It.onceReverse:p=Math.max(b-1-p,0);break;case It.loopReverse:p=b-1-p%b;break;case It.pingpongReverse:{let x=(b<<1)-2;p=x==0?0:(p+b-1)%x,p>=b&&(p=x-p)}}a.sequenceIndex=p}}class Bs{static _emptyAnimation=new Kr("<empty>",[],0);static emptyAnimation(){return Bs._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new tm(this);propertyIDs=new wl;animationsChanged=!1;trackEntryPool=new Ns(()=>new Jf);constructor(t){this.data=t}update(t){t*=this.timeScale;let e=this.tracks;for(let s=0,i=e.length;s<i;s++){let n=e[s];if(!n)continue;n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast;let o=t*n.timeScale;if(n.delay>0){if(n.delay-=o,n.delay>0)continue;o=-n.delay,n.delay=0}let l=n.next;if(l){let a=n.trackLast-l.delay;if(a>=0){for(l.delay=0,l.trackTime+=n.timeScale==0?0:(a/n.timeScale+t)*l.timeScale,n.trackTime+=o,this.setCurrent(s,l,!0);l.mixingFrom;)l.mixTime+=t,l=l.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&!n.mixingFrom){e[s]=null,this.queue.end(n),this.clearNext(n);continue}if(n.mixingFrom&&this.updateMixingFrom(n,t)){let a=n.mixingFrom;for(n.mixingFrom=null,a&&(a.mixingTo=null);a;)this.queue.end(a),a=a.mixingFrom}n.trackTime+=o}this.queue.drain()}updateMixingFrom(t,e){let s=t.mixingFrom;if(!s)return!0;let i=this.updateMixingFrom(s,e);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,t.nextTrackLast!=-1&&t.mixTime>=t.mixDuration?((s.totalAlpha==0||t.mixDuration==0)&&(t.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=t),t.interruptAlpha=s.interruptAlpha,this.queue.end(s)),i):(s.trackTime+=e*s.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,s=this.tracks,i=!1;for(let f=0,u=s.length;f<u;f++){let m=s[f];if(!m||m.delay>0)continue;i=!0;let g=f==0?Y.first:m.mixBlend,p=m.alpha;m.mixingFrom?p*=this.applyMixingFrom(m,t,g):m.trackTime>=m.trackEnd&&!m.next&&(p=0);let b=p>=m.alphaAttachmentThreshold,w=m.animationLast,x=m.getAnimationTime(),y=x,_=e;m.reverse&&(y=m.animation.duration-y,_=null);let v=m.animation.timelines,A=v.length;if(f==0&&p==1||g==Y.add){f==0&&(b=!0);for(let C=0;C<A;C++){var n=v[C];n instanceof ns?this.applyAttachmentTimeline(n,t,y,g,b):n.apply(t,w,y,_,p,g,Dt.mixIn)}}else{let C=m.timelineMode,M=m.shortestRotation,k=!M&&m.timelinesRotation.length!=A<<1;k&&(m.timelinesRotation.length=A<<1);for(let S=0;S<A;S++){let E=v[S],R=C[S]==cr?g:Y.setup;!M&&E instanceof mi?this.applyRotateTimeline(E,t,y,p,R,m.timelinesRotation,S<<1,k):E instanceof ns?this.applyAttachmentTimeline(E,t,y,g,b):E.apply(t,w,y,_,p,R,Dt.mixIn)}}this.queueEvents(m,x),e.length=0,m.nextAnimationLast=x,m.nextTrackLast=m.trackTime}for(var o=this.unkeyedState+Fa,l=t.slots,a=0,h=t.slots.length;a<h;a++){var c=l[a];if(c.attachmentState==o){var d=c.data.attachmentName;c.setAttachment(d?t.getAttachment(c.data.index,d):null)}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(t,e,s){let i=t.mixingFrom;i.mixingFrom&&this.applyMixingFrom(i,e,s);let n=0;t.mixDuration==0?(n=1,s==Y.first&&(s=Y.setup)):(n=t.mixTime/t.mixDuration,n>1&&(n=1),s!=Y.first&&(s=i.mixBlend));let o=n<i.mixAttachmentThreshold,l=n<i.mixDrawOrderThreshold,a=i.animation.timelines,h=a.length,c=i.alpha*t.interruptAlpha,d=c*(1-n),f=i.animationLast,u=i.getAnimationTime(),m=u,g=null;if(i.reverse?m=i.animation.duration-m:n<i.eventThreshold&&(g=this.events),s==Y.add)for(let p=0;p<h;p++)a[p].apply(e,f,m,g,d,s,Dt.mixOut);else{let p=i.timelineMode,b=i.timelineHoldMix,w=i.shortestRotation,x=!w&&i.timelinesRotation.length!=h<<1;x&&(i.timelinesRotation.length=h<<1),i.totalAlpha=0;for(let y=0;y<h;y++){let _=a[y],v=Dt.mixOut,A,C=0;switch(p[y]){case cr:if(!l&&_ instanceof Ne)continue;A=s,C=d;break;case Ea:A=Y.setup,C=d;break;case Ra:A=s,C=c;break;case dr:A=Y.setup,C=c;break;default:A=Y.setup;let M=b[y];C=c*Math.max(0,1-M.mixTime/M.mixDuration);break}i.totalAlpha+=C,!w&&_ instanceof mi?this.applyRotateTimeline(_,e,m,C,A,i.timelinesRotation,y<<1,x):_ instanceof ns?this.applyAttachmentTimeline(_,e,m,A,o&&C>=i.alphaAttachmentThreshold):(l&&_ instanceof Ne&&A==Y.setup&&(v=Dt.mixIn),_.apply(e,f,m,g,C,A,v))}}return t.mixDuration>0&&this.queueEvents(i,u),this.events.length=0,i.nextAnimationLast=u,i.nextTrackLast=i.trackTime,n}applyAttachmentTimeline(t,e,s,i,n){var o=e.slots[t.slotIndex];o.bone.active&&(s<t.frames[0]?(i==Y.setup||i==Y.first)&&this.setAttachment(e,o,o.data.attachmentName,n):this.setAttachment(e,o,t.attachmentNames[ct.search1(t.frames,s)],n),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+Fa))}setAttachment(t,e,s,i){e.setAttachment(s?t.getAttachment(e.data.index,s):null),i&&(e.attachmentState=this.unkeyedState+sm)}
289applyRotateTimeline(t,e,s,i,n,o,l,a){if(a&&(o[l]=0),i==1){t.apply(e,0,s,null,1,n,Dt.mixIn);return}let h=e.bones[t.boneIndex];if(!h.active)return;let c=t.frames,d=0,f=0;if(s<c[0])switch(n){case Y.setup:h.rotation=h.data.rotation;default:return;case Y.first:d=h.rotation,f=h.data.rotation}else d=n==Y.setup?h.data.rotation:h.rotation,f=h.data.rotation+t.getCurveValue(s);let u=0,m=f-d;if(m-=Math.ceil(m/360-.5)*360,m==0)u=o[l];else{let g=0,p=0;a?(g=0,p=m):(g=o[l],p=o[l+1]);let b=g-g%360;u=m+b;let w=m>=0,x=g>=0;Math.abs(p)<=90&&X.signum(p)!=X.signum(m)&&(Math.abs(g-b)>180?(u+=360*X.signum(g),x=w):b!=0?u-=360*X.signum(g):x=w),x!=w&&(u+=360*X.signum(g)),o[l]=u}o[l+1]=m,h.rotation=d+u*i}queueEvents(t,e){let s=t.animationStart,i=t.animationEnd,n=i-s,o=t.trackLast%n,l=this.events,a=0,h=l.length;for(;a<h;a++){let d=l[a];if(d.time<o)break;d.time>i||this.queue.event(t,d)}let c=!1;if(t.loop)if(n==0)c=!0;else{const d=Math.floor(t.trackTime/n);c=d>0&&d>Math.floor(t.trackLast/n)}else c=e>=i&&t.animationLast<i;for(c&&this.queue.complete(t);a<h;a++){let d=l[a];d.time<s||this.queue.event(t,d)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,s=this.tracks.length;e<s;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let s=e;for(;;){let i=s.mixingFrom;if(!i)break;this.queue.end(i),s.mixingFrom=null,s.mixingTo=null,s=i}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,s){let i=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,i&&(s&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s=!1){let i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,s)}setAnimationWith(t,e,s=!1){if(!e)throw new Error("animation cannot be null.");let i=!0,n=this.expandToIndex(t);n&&(n.nextTrackLast==-1?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,i=!1):this.clearNext(n));let o=this.trackEntry(t,e,s,n);return this.setCurrent(t,o,i),this.queue.drain(),o}addAnimation(t,e,s=!1,i=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,s,i)}addAnimationWith(t,e,s=!1,i=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let o=this.trackEntry(t,e,s,n);return n?(n.next=o,o.previous=n,i<=0&&(i=Math.max(i+n.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(t,o,!0),this.queue.drain(),i<0&&(i=0)),o.delay=i,o}setEmptyAnimation(t,e=0){let s=this.setAnimationWith(t,Bs.emptyAnimation(),!1);return s.mixDuration=e,s.trackEnd=e,s}addEmptyAnimation(t,e=0,s=0){let i=this.addAnimationWith(t,Bs.emptyAnimation(),!1,s);return s<=0&&(i.delay=Math.max(i.delay+i.mixDuration-e,0)),i.mixDuration=e,i.trackEnd=e,i}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,i=this.tracks.length;s<i;s++){let n=this.tracks[s];n&&this.setEmptyAnimation(n.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(O.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,s,i){let n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=t,n.animation=e,n.loop=s,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.alphaAttachmentThreshold=0,n.mixAttachmentThreshold=0,n.mixDrawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=i?this.data.getMix(i.animation,e):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=Y.replace,n}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let e=0,s=t.length;e<s;e++){let i=t[e];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do(!i.mixingTo||i.mixBlend!=Y.add)&&this.computeHold(i),i=i.mixingTo;while(i)}}}computeHold(t){let e=t.mixingTo,s=t.animation.timelines,i=t.animation.timelines.length,n=t.timelineMode;n.length=i;let o=t.timelineHoldMix;o.length=0;let l=this.propertyIDs;if(e&&e.holdPrevious){for(let a=0;a<i;a++)n[a]=l.addAll(s[a].getPropertyIds())?dr:Ra;return}t:for(let a=0;a<i;a++){let h=s[a],c=h.getPropertyIds();if(!l.addAll(c))n[a]=cr;else if(!e||h instanceof ns||h instanceof Ne||h instanceof zs||!e.animation.hasTimeline(c))n[a]=Ea;else{for(let d=e.mixingTo;d;d=d.mixingTo)if(!d.animation.hasTimeline(c)){if(t.mixDuration>0){n[a]=em,o[a]=d;continue t}break}n[a]=dr}}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}}class Jf{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;mixAttachmentThreshold=0;alphaAttachmentThreshold=0;mixDrawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;_mixDuration=0;interruptAlpha=0;totalAlpha=0;get mixDuration(){return this._mixDuration}set mixDuration(t){this._mixDuration=t}setMixDurationWithDelay(t,e){this._mixDuration=t,e<=0&&(this.previous!=null?e=Math.max(e+this.previous.getTrackComplete()-t,0):e=0),this.delay=e}mixBlend=Y.replace;timelineMode=new Array;timelineHoldMix=new Array;timelinesRotation=new Array;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 t=this.animationEnd-this.animationStart;return t==0?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(t!=0){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}wasApplied(){return this.nextTrackLast!=-1}isNextReady(){return this.next!=null&&this.nextTrackLast-this.next.delay>=0}}class tm{objects=[];drainDisabled=!1;animState;constructor(t){this.animState=t}start(t){this.objects.push(Nt.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(Nt.interrupt),this.objects.push(t)}end(t){this.objects.push(Nt.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(Nt.dispose),this.objects.push(t)}complete(t){this.objects.push(Nt.complete),this.objects.push(t)}event(t,e){this.objects.push(Nt.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,e=this.animState.listeners;for(let s=0;s<t.length;s+=2){let i=t[s],n=t[s+1];switch(i){case Nt.start:n.listener&&n.listener.start&&n.listener.start(n);for(let l=0;l<e.length;l++){let a=e[l];a.start&&a.start(n)}break;case Nt.interrupt:n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(let l=0;l<e.length;l++){let a=e[l];a.interrupt&&a.interrupt(n)}break;case Nt.end:n.listener&&n.listener.end&&n.listener.end(n);for(let l=0;l<e.length;l++){let a=e[l];a.end&&a.end(n)}case Nt.dispose:n.listener&&n.listener.dispose&&n.listener.dispose(n);for(let l=0;l<e.length;l++){let a=e[l];a.dispose&&a.dispose(n)}this.animState.trackEntryPool.free(n);break;case Nt.complete:n.listener&&n.listener.complete&&n.listener.complete(n);for(let l=0;l<e.length;l++){let a=e[l];a.complete&&a.complete(n)}break;case Nt.event:let o=t[s+++2];n.listener&&n.listener.event&&n.listener.event(n,o);for(let l=0;l<e.length;l++){let a=e[l];a.event&&a.event(n,o)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}}var Nt;(function(r){r[r.start=0]="start",r[r.interrupt=1]="interrupt",r[r.end=2]="end",r[r.dis
289pose=3]="dispose",r[r.complete=4]="complete",r[r.event=5]="event"})(Nt||(Nt={}));const cr=0,Ea=1,Ra=2,dr=3,em=4,Fa=1,sm=2;class im{skeletonData;animationToMixTime={};defaultMix=0;constructor(t){if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,s){let i=this.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);let n=this.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);this.setMixWith(i,n,s)}setMixWith(t,e,s){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let i=t.name+"."+e.name;this.animationToMixTime[i]=s}getMix(t,e){let s=t.name+"."+e.name,i=this.animationToMixTime[s];return i===void 0?this.defaultMix:i}}class ki extends re{color=new W(1,1,1,1);constructor(t){super(t)}copy(){let t=new ki(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}}class Ve extends re{endSlot=null;color=new W(.2275,.2275,.8078,1);constructor(t){super(t)}copy(){let t=new Ve(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}}class rm{_image;constructor(t){this._image=t}getImage(){return this._image}}var kt;(function(r){r[r.Nearest=9728]="Nearest",r[r.Linear=9729]="Linear",r[r.MipMap=9987]="MipMap",r[r.MipMapNearestNearest=9984]="MipMapNearestNearest",r[r.MipMapLinearNearest=9985]="MipMapLinearNearest",r[r.MipMapNearestLinear=9986]="MipMapNearestLinear",r[r.MipMapLinearLinear=9987]="MipMapLinearLinear"})(kt||(kt={}));var Me;(function(r){r[r.MirroredRepeat=33648]="MirroredRepeat",r[r.ClampToEdge=33071]="ClampToEdge",r[r.Repeat=10497]="Repeat"})(Me||(Me={}));class nm{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0}class am{pages=new Array;regions=new Array;constructor(t){let e=new om(t),s=new Array(4),i={};i.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},i.format=()=>{},i.filter=c=>{c.minFilter=O.enumValue(kt,s[1]),c.magFilter=O.enumValue(kt,s[2])},i.repeat=c=>{s[1].indexOf("x")!=-1&&(c.uWrap=Me.Repeat),s[1].indexOf("y")!=-1&&(c.vWrap=Me.Repeat)},i.pma=c=>{c.pma=s[1]=="true"};var n={};n.xy=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2])},n.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},n.bounds=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2]),c.width=parseInt(s[3]),c.height=parseInt(s[4])},n.offset=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2])},n.orig=c=>{c.originalWidth=parseInt(s[1]),c.originalHeight=parseInt(s[2])},n.offsets=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2]),c.originalWidth=parseInt(s[3]),c.originalHeight=parseInt(s[4])},n.rotate=c=>{let d=s[1];d=="true"?c.degrees=90:d!="false"&&(c.degrees=parseInt(d))},n.index=c=>{c.index=parseInt(s[1])};let o=e.readLine();for(;o&&o.trim().length==0;)o=e.readLine();for(;!(!o||o.trim().length==0||e.readEntry(s,o)==0);)o=e.readLine();let l=null,a=null,h=null;for(;o!==null;)if(o.trim().length==0)l=null,o=e.readLine();else if(l){let c=new Zl(l,o);for(;;){let d=e.readEntry(s,o=e.readLine());if(d==0)break;let f=n[s[0]];if(f)f(c);else{a||(a=[]),h||(h=[]),a.push(s[0]);let u=[];for(let m=0;m<d;m++)u.push(parseInt(s[m+1]));h.push(u)}}c.originalWidth==0&&c.originalHeight==0&&(c.originalWidth=c.width,c.originalHeight=c.height),a&&a.length>0&&h&&h.length>0&&(c.names=a,c.values=h,a=null,h=null),c.u=c.x/l.width,c.v=c.y/l.height,c.degrees==90?(c.u2=(c.x+c.height)/l.width,c.v2=(c.y+c.width)/l.height):(c.u2=(c.x+c.width)/l.width,c.v2=(c.y+c.height)/l.height),this.regions.push(c)}else{for(l=new lm(o.trim());e.readEntry(s,o=e.readLine())!=0;){let c=i[s[0]];c&&c(l)}this.pages.push(l)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let s of this.pages)s.setTexture(t.get(e+s.name))}dispose(){for(let t=0;t<this.pages.length;t++)this.pages[t].texture?.dispose()}}class om{lines;index=0;constructor(t){this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e||(e=e.trim(),e.length==0))return 0;let s=e.indexOf(":");if(s==-1)return 0;t[0]=e.substr(0,s).trim();for(let i=1,n=s+1;;i++){let o=e.indexOf(",",n);if(o==-1)return t[i]=e.substr(n).trim(),i;if(t[i]=e.substr(n,o-n).trim(),n=o+1,i==4)return 4}}}class lm{name;minFilter=kt.Nearest;magFilter=kt.Nearest;uWrap=Me.ClampToEdge;vWrap=Me.ClampToEdge;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(t){this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);for(let e of this.regions)e.texture=t}}class Zl extends nm{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(t,e){super(),this.page=t,this.name=e,t.regions.push(this)}}class jt extends re{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new W(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new W(0,0,0,0);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=O.newFloatArray(t.length));let e=this.uvs,s=this.uvs.length,i=this.region.u,n=this.region.v,o=0,l=0;if(this.region instanceof Zl){let a=this.region,h=a.page,c=h.width,d=h.height;switch(a.degrees){case 90:i-=(a.originalHeight-a.offsetY-a.height)/c,n-=(a.originalWidth-a.offsetX-a.width)/d,o=a.originalHeight/c,l=a.originalWidth/d;for(let f=0;f<s;f+=2)e[f]=i+t[f+1]*o,e[f+1]=n+(1-t[f])*l;return;case 180:i-=(a.originalWidth-a.offsetX-a.width)/c,n-=a.offsetY/d,o=a.originalWidth/c,l=a.originalHeight/d;for(let f=0;f<s;f+=2)e[f]=i+(1-t[f])*o,e[f+1]=n+(1-t[f+1])*l;return;case 270:i-=a.offsetY/c,n-=a.offsetX/d,o=a.originalHeight/c,l=a.originalWidth/d;for(let f=0;f<s;f+=2)e[f]=i+(1-t[f+1])*o,e[f+1]=n+t[f]*l;return}i-=a.offsetX/c,n-=(a.originalHeight-a.offsetY-a.height)/d,o=a.originalWidth/c,l=a.originalHeight/d}else this.region?(o=this.region.u2-i,l=this.region.v2-n):(i=n=0,o=l=1);for(let a=0;a<s;a+=2)e[a]=i+t[a]*o,e[a+1]=n+t[a+1]*l}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new jt(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),O.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=this.uvs instanceof Float32Array?O.newFloatArray(this.uvs.length):new Array(this.uvs.length),O.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),O.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),O.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,e,s,i,n,o){this.sequence!=null&&this.sequence.apply(t,this),super.computeWorldVertices(t,e,s,i,n,o)}newLinkedMesh(){let t=new jt(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),t.region!=null&&t.updateRegion(),t}}class ms extends re{lengths=[];closed=!1;constantSpeed=!1;color=new W(1,1,1,1);constructor(t){super(t)}copy(){let t=new ms(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),O.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class Qr extends re{x=0;y=0;rotation=0;color=new W(.38,.94,0,1);constructor(t){super(t)}computeWorldPosition(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e}computeWorldRotation(t){const e=this.rotation*X.degRad,s=Math.cos(e),i=Math.sin(e),n=s*t.a+i*t.b,o=s*t.c+i*t.d;return X.atan2Deg(o,n)}copy(){let t=new Qr(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}}class Q extends _l{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new W(1,1,1,1);path;region=null;sequence=null;offset=O.newFloatArray(8);uvs=O.newFloatArray(8);tempColor=new W(1,1,1,1);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.region,e=this.uvs;if(t==null){e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=1,e[5]=1,e[6]=1,e[7]=0;return}let s=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*s,o=-this.height/2*this.scaleY+this.region.offsetY*i,l=n+this.region.width*s,a=o+this.region.height*i,h=this.rotation*X.degRad,c=Math.cos(h),d=Math.sin(h),f=this.x,u=this.y,m=n*c+f,g=n*d,p=o*c+u,b=o*d,w=l*c+f,x=l*d,y=a*c+u,_=a*d,v=this.offset;v[0]=m-b,v[1]=p+g,v[2]=m-_,v[3]=y+g,v[4]=w-_,v[5]=y+x,v[6]=w-b,v[7]=p+x,t.degrees==90?(e[0]=t.u2,e[1]=t.v2,e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)}computeWorldVertices(t,e,s,i){this.sequence!=null&&this.sequence.apply(t,this);let n=t.bone,o=this.offset,l=n.worldX,a=n.worldY,h=n.a,c=n.b,d=n.c,f=n.d,u=0,m=0;
289u=o[0],m=o[1],e[s]=u*h+m*c+l,e[s+1]=u*d+m*f+a,s+=i,u=o[2],m=o[3],e[s]=u*h+m*c+l,e[s+1]=u*d+m*f+a,s+=i,u=o[4],m=o[5],e[s]=u*h+m*c+l,e[s+1]=u*d+m*f+a,s+=i,u=o[6],m=o[7],e[s]=u*h+m*c+l,e[s+1]=u*d+m*f+a}copy(){let t=new Q(this.name,this.path);return t.region=this.region,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,O.arrayCopy(this.uvs,0,t.uvs,0,8),O.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=this.sequence!=null?this.sequence.copy():null,t}static X1=0;static Y1=1;static C1R=2;static C1G=3;static C1B=4;static C1A=5;static U1=6;static V1=7;static X2=8;static Y2=9;static C2R=10;static C2G=11;static C2B=12;static C2A=13;static U2=14;static V2=15;static X3=16;static Y3=17;static C3R=18;static C3G=19;static C3B=20;static C3A=21;static U3=22;static V3=23;static X4=24;static Y4=25;static C4R=26;static C4G=27;static C4B=28;static C4A=29;static U4=30;static V4=31}class Ql{atlas;constructor(t){this.atlas=t}loadSequence(t,e,s){let i=s.regions;for(let n=0,o=i.length;n<o;n++){let l=s.getPath(e,n),a=this.atlas.findRegion(l);if(a==null)throw new Error("Region not found in atlas: "+l+" (sequence: "+t+")");i[n]=a}}newRegionAttachment(t,e,s,i){let n=new Q(e,s);if(i!=null)this.loadSequence(e,s,i);else{let o=this.atlas.findRegion(s);if(!o)throw new Error("Region not found in atlas: "+s+" (region attachment: "+e+")");n.region=o}return n}newMeshAttachment(t,e,s,i){let n=new jt(e,s);if(i!=null)this.loadSequence(e,s,i);else{let o=this.atlas.findRegion(s);if(!o)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+e+")");n.region=o}return n}newBoundingBoxAttachment(t,e){return new ki(e)}newPathAttachment(t,e){return new ms(e)}newPointAttachment(t,e){return new Qr(e)}newClippingAttachment(t,e){return new Ve(e)}}class Jl{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;inherit=ut.Normal;skinRequired=!1;color=new W;icon;visible=!1;constructor(t,e,s){if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=s}}var ut;(function(r){r[r.Normal=0]="Normal",r[r.OnlyTranslation=1]="OnlyTranslation",r[r.NoRotationOrReflection=2]="NoRotationOrReflection",r[r.NoScale=3]="NoScale",r[r.NoScaleOrReflection=4]="NoScaleOrReflection"})(ut||(ut={}));class Ba{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;inherit=ut.Normal;sorted=!1;active=!1;constructor(t,e,s){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(t){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(t,e,s,i,n,o,l){this.ax=t,this.ay=e,this.arotation=s,this.ascaleX=i,this.ascaleY=n,this.ashearX=o,this.ashearY=l;let a=this.parent;if(!a){let u=this.skeleton;const m=u.scaleX,g=u.scaleY,p=(s+o)*X.degRad,b=(s+90+l)*X.degRad;this.a=Math.cos(p)*i*m,this.b=Math.cos(b)*n*m,this.c=Math.sin(p)*i*g,this.d=Math.sin(b)*n*g,this.worldX=t*m+u.x,this.worldY=e*g+u.y;return}let h=a.a,c=a.b,d=a.c,f=a.d;switch(this.worldX=h*t+c*e+a.worldX,this.worldY=d*t+f*e+a.worldY,this.inherit){case ut.Normal:{const u=(s+o)*X.degRad,m=(s+90+l)*X.degRad,g=Math.cos(u)*i,p=Math.cos(m)*n,b=Math.sin(u)*i,w=Math.sin(m)*n;this.a=h*g+c*b,this.b=h*p+c*w,this.c=d*g+f*b,this.d=d*p+f*w;return}case ut.OnlyTranslation:{const u=(s+o)*X.degRad,m=(s+90+l)*X.degRad;this.a=Math.cos(u)*i,this.b=Math.cos(m)*n,this.c=Math.sin(u)*i,this.d=Math.sin(m)*n;break}case ut.NoRotationOrReflection:{let u=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;h*=u,d*=m;let g=h*h+d*d,p=0;g>1e-4?(g=Math.abs(h*f*m-c*u*d)/g,c=d*g,f=h*g,p=Math.atan2(d,h)*X.radDeg):(h=0,d=0,p=90-Math.atan2(f,c)*X.radDeg);const b=(s+o-p)*X.degRad,w=(s+l-p+90)*X.degRad,x=Math.cos(b)*i,y=Math.cos(w)*n,_=Math.sin(b)*i,v=Math.sin(w)*n;this.a=h*x-c*_,this.b=h*y-c*v,this.c=d*x+f*_,this.d=d*y+f*v;break}case ut.NoScale:case ut.NoScaleOrReflection:{s*=X.degRad;const u=Math.cos(s),m=Math.sin(s);let g=(h*u+c*m)/this.skeleton.scaleX,p=(d*u+f*m)/this.skeleton.scaleY,b=M
289ath.sqrt(g*g+p*p);b>1e-5&&(b=1/b),g*=b,p*=b,b=Math.sqrt(g*g+p*p),this.inherit==ut.NoScale&&h*f-c*d<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(b=-b),s=Math.PI/2+Math.atan2(p,g);const w=Math.cos(s)*b,x=Math.sin(s)*b;o*=X.degRad,l=(90+l)*X.degRad;const y=Math.cos(o)*i,_=Math.cos(l)*n,v=Math.sin(o)*i,A=Math.sin(l)*n;this.a=g*y+w*v,this.b=g*_+w*A,this.c=p*y+x*v,this.d=p*_+x*A;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}updateAppliedTransform(){let t=this.parent;if(!t){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*X.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)*X.radDeg;return}let e=t.a,s=t.b,i=t.c,n=t.d,o=1/(e*n-s*i),l=n*o,a=s*o,h=i*o,c=e*o,d=this.worldX-t.worldX,f=this.worldY-t.worldY;this.ax=d*l-f*a,this.ay=f*c-d*h;let u,m,g,p;if(this.inherit==ut.OnlyTranslation)u=this.a,m=this.b,g=this.c,p=this.d;else{switch(this.inherit){case ut.NoRotationOrReflection:{let _=Math.abs(e*n-s*i)/(e*e+i*i);s=-i*this.skeleton.scaleX*_/this.skeleton.scaleY,n=e*this.skeleton.scaleY*_/this.skeleton.scaleX,o=1/(e*n-s*i),l=n*o,a=s*o;break}case ut.NoScale:case ut.NoScaleOrReflection:let b=X.cosDeg(this.rotation),w=X.sinDeg(this.rotation);e=(e*b+s*w)/this.skeleton.scaleX,i=(i*b+n*w)/this.skeleton.scaleY;let x=Math.sqrt(e*e+i*i);x>1e-5&&(x=1/x),e*=x,i*=x,x=Math.sqrt(e*e+i*i),this.inherit==ut.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(x=-x);let y=X.PI/2+Math.atan2(i,e);s=Math.cos(y)*x,n=Math.sin(y)*x,o=1/(e*n-s*i),l=n*o,a=s*o,h=i*o,c=e*o}u=l*this.a-a*this.c,m=l*this.b-a*this.d,g=c*this.c-h*this.a,p=c*this.d-h*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(u*u+g*g),this.ascaleX>1e-4){let b=u*p-m*g;this.ascaleY=b/this.ascaleX,this.ashearY=-Math.atan2(u*m+g*p,b)*X.radDeg,this.arotation=Math.atan2(g,u)*X.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,m)*X.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*X.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*X.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(t){let e=1/(this.a*this.d-this.b*this.c),s=t.x-this.worldX,i=t.y-this.worldY;return t.x=s*this.d*e-i*this.b*e,t.y=i*this.a*e-s*this.c*e,t}localToWorld(t){let e=t.x,s=t.y;return t.x=e*this.a+s*this.b+this.worldX,t.y=e*this.c+s*this.d+this.worldY,t}worldToParent(t){if(t==null)throw new Error("world cannot be null.");return this.parent==null?t:this.parent.worldToLocal(t)}parentToWorld(t){if(t==null)throw new Error("world cannot be null.");return this.parent==null?t:this.parent.localToWorld(t)}worldToLocalRotation(t){let e=X.sinDeg(t),s=X.cosDeg(t);return Math.atan2(this.a*e-this.c*s,this.d*s-this.b*e)*X.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=X.sinDeg(t),s=X.cosDeg(t);return Math.atan2(s*this.c+e*this.d,s*this.a+e*this.b)*X.radDeg}rotateWorld(t){t*=X.degRad;const e=Math.sin(t),s=Math.cos(t),i=this.a,n=this.b;this.a=s*i-e*this.c,this.b=s*n-e*this.d,this.c=e*i+s*this.c,this.d=e*n+s*this.d}}class Mi{name;order;skinRequired;constructor(t,e,s){this.name=t,this.order=e,this.skinRequired=s}}class th{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(t,e){if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}}class eh{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(t){this.name=t}}class hm{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let n=e.findBone(t.bones[i].name);
289if(!n)throw new Error(`Couldn't find bone ${t.bones[i].name}`);this.bones.push(n)}let s=e.findBone(t.target.name);if(!s)throw new Error(`Couldn't find bone ${t.target.name}`);this.target=s,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}update(t){if(this.mix==0)return;let e=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(t,e,s,i,n,o,l){let a=t.parent;if(!a)throw new Error("IK bone must have parent.");let h=a.a,c=a.b,d=a.c,f=a.d,u=-t.ashearX-t.arotation,m=0,g=0;switch(t.inherit){case ut.OnlyTranslation:m=(e-t.worldX)*X.signum(t.skeleton.scaleX),g=(s-t.worldY)*X.signum(t.skeleton.scaleY);break;case ut.NoRotationOrReflection:let w=Math.abs(h*f-c*d)/Math.max(1e-4,h*h+d*d),x=h/t.skeleton.scaleX,y=d/t.skeleton.scaleY;c=-y*w*t.skeleton.scaleX,f=x*w*t.skeleton.scaleY,u+=Math.atan2(y,x)*X.radDeg;default:let _=e-a.worldX,v=s-a.worldY,A=h*f-c*d;Math.abs(A)<=1e-4?(m=0,g=0):(m=(_*f-v*c)/A-t.ax,g=(v*h-_*d)/A-t.ay)}u+=Math.atan2(g,m)*X.radDeg,t.ascaleX<0&&(u+=180),u>180?u-=360:u<-180&&(u+=360);let p=t.ascaleX,b=t.ascaleY;if(i||n){switch(t.inherit){case ut.NoScale:case ut.NoScaleOrReflection:m=e-t.worldX,g=s-t.worldY}const w=t.data.length*p;if(w>1e-4){const x=m*m+g*g;if(i&&x<w*w||n&&x>w*w){const y=(Math.sqrt(x)/w-1)*l+1;p*=y,o&&(b*=y)}}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+u*l,p,b,t.ashearX,t.ashearY)}apply2(t,e,s,i,n,o,l,a,h){if(t.inherit!=ut.Normal||e.inherit!=ut.Normal)return;let c=t.ax,d=t.ay,f=t.ascaleX,u=t.ascaleY,m=f,g=u,p=e.ascaleX,b=0,w=0,x=0;f<0?(f=-f,b=180,x=-1):(b=0,x=1),u<0&&(u=-u,x=-x),p<0?(p=-p,w=180):w=0;let y=e.ax,_=0,v=0,A=0,C=t.a,M=t.b,k=t.c,S=t.d,E=Math.abs(f-u)<=1e-4;!E||o?(_=0,v=C*y+t.worldX,A=k*y+t.worldY):(_=e.ay,v=C*y+M*_+t.worldX,A=k*y+S*_+t.worldY);let R=t.parent;if(!R)throw new Error("IK parent must itself have a parent.");C=R.a,M=R.b,k=R.c,S=R.d;let T=C*S-M*k,I=v-R.worldX,F=A-R.worldY;T=Math.abs(T)<=1e-4?0:1/T;let D=(I*S-F*M)*T-c,H=(F*C-I*k)*T-d,L=Math.sqrt(D*D+H*H),U=e.data.length*p,j,Z;if(L<1e-4){this.apply1(t,s,i,!1,o,!1,h),e.updateWorldTransformWith(y,_,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}I=s-R.worldX,F=i-R.worldY;let N=(I*S-F*M)*T-c,q=(F*C-I*k)*T-d,$=N*N+q*q;if(a!=0){a*=f*(p+1)*.5;let rt=Math.sqrt($),nt=rt-L-U*f+a;if(nt>0){let dt=Math.min(1,nt/(a*2))-1;dt=(nt-a*(1-dt*dt))/rt,N-=dt*N,q-=dt*q,$=N*N+q*q}}t:if(E){U*=f;let rt=($-L*L-U*U)/(2*L*U);rt<-1?(rt=-1,Z=Math.PI*n):rt>1?(rt=1,Z=0,o&&(C=(Math.sqrt($)/(L+U)-1)*h+1,m*=C,l&&(g*=C))):Z=Math.acos(rt)*n,C=L+U*rt,M=U*Math.sin(Z),j=Math.atan2(q*C-N*M,N*C+q*M)}else{C=f*U,M=u*U;let rt=C*C,nt=M*M,dt=Math.atan2(q,N);k=nt*L*L+rt*$-rt*nt;let vt=-2*nt*L,Rt=nt-rt;if(S=vt*vt-4*Rt*k,S>=0){let Xt=Math.sqrt(S);vt<0&&(Xt=-Xt),Xt=-(vt+Xt)*.5;let Kt=Xt/Rt,be=k/Xt,qe=Math.abs(Kt)<Math.abs(be)?Kt:be;if(Kt=$-qe*qe,Kt>=0){F=Math.sqrt(Kt)*n,j=dt-Math.atan2(F,qe),Z=Math.atan2(F/u,(qe-L)/f);break t}}let B=X.PI,G=L-C,z=G*G,tt=0,yt=0,St=L+C,gt=St*St,ye=0;k=-C*L/(rt-nt),k>=-1&&k<=1&&(k=Math.acos(k),I=C*Math.cos(k)+L,F=M*Math.sin(k),S=I*I+F*F,S<z&&(B=k,z=S,G=I,tt=F),S>gt&&(yt=k,gt=S,St=I,ye=F)),$<=(z+gt)*.5?(j=dt-Math.atan2(tt*n,G),Z=B*n):(j=dt-Math.atan2(ye*n,St),Z=yt*n)}let ht=Math.atan2(_,y)*x,_t=t.arotation;j=(j-ht)*X.radDeg+b-_t,j>180?j-=360:j<-180&&(j+=360),t.updateWorldTransformWith(c,d,_t+j*h,m,g,0,0),_t=e.arotation,Z=((Z+ht)*X.radDeg-e.ashearX)*x+w-_t,Z>180?Z-=360:Z<-180&&(Z+=360),e.updateWorldTransformWith(y,_,_t+Z*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}class sh extends Mi{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=0;compress=!1;stretch=!1;uniform=!1;mix=0;softness=0;constructor(t){super(t,0,!1)}}class ih extends Mi{bones=new Array;_target=null;set target(t){this._target=t}
289get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=ge.Fixed;spacingMode=Ct.Fixed;rotateMode=ze.Chain;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(t){super(t,0,!1)}}var ge;(function(r){r[r.Fixed=0]="Fixed",r[r.Percent=1]="Percent"})(ge||(ge={}));var Ct;(function(r){r[r.Length=0]="Length",r[r.Fixed=1]="Fixed",r[r.Percent=2]="Percent",r[r.Proportional=3]="Proportional"})(Ct||(Ct={}));var ze;(function(r){r[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale"})(ze||(ze={}));class Ae{static NONE=-1;static BEFORE=-2;static AFTER=-3;static epsilon=1e-5;data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,n=t.bones.length;i<n;i++){let o=e.findBone(t.bones[i].name);if(!o)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(o)}let s=e.findSlot(t.target.name);if(!s)throw new Error(`Couldn't find target bone ${t.target.name}`);this.target=s,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}update(t){let e=this.target.getAttachment();if(!(e instanceof ms))return;let s=this.mixRotate,i=this.mixX,n=this.mixY;if(s==0&&i==0&&n==0)return;let o=this.data,l=o.rotateMode==ze.Tangent,a=o.rotateMode==ze.ChainScale,h=this.bones,c=h.length,d=l?c:c+1,f=O.setArraySize(this.spaces,d),u=a?this.lengths=O.setArraySize(this.lengths,c):[],m=this.spacing;switch(o.spacingMode){case Ct.Percent:if(a)for(let v=0,A=d-1;v<A;v++){let C=h[v],M=C.data.length,k=M*C.a,S=M*C.c;u[v]=Math.sqrt(k*k+S*S)}O.arrayFill(f,1,d,m);break;case Ct.Proportional:let y=0;for(let v=0,A=d-1;v<A;){let C=h[v],M=C.data.length;if(M<Ae.epsilon)a&&(u[v]=0),f[++v]=m;else{let k=M*C.a,S=M*C.c,E=Math.sqrt(k*k+S*S);a&&(u[v]=E),f[++v]=E,y+=E}}if(y>0){y=d/y*m;for(let v=1;v<d;v++)f[v]*=y}break;default:let _=o.spacingMode==Ct.Length;for(let v=0,A=d-1;v<A;){let C=h[v],M=C.data.length;if(M<Ae.epsilon)a&&(u[v]=0),f[++v]=m;else{let k=M*C.a,S=M*C.c,E=Math.sqrt(k*k+S*S);a&&(u[v]=E),f[++v]=(_?M+m:m)*E/M}}}let g=this.computeWorldPositions(e,d,l),p=g[0],b=g[1],w=o.offsetRotation,x=!1;if(w==0)x=o.rotateMode==ze.Chain;else{x=!1;let y=this.target.bone;w*=y.a*y.d-y.b*y.c>0?X.degRad:-.01745329277777778}for(let y=0,_=3;y<c;y++,_+=3){let v=h[y];v.worldX+=(p-v.worldX)*i,v.worldY+=(b-v.worldY)*n;let A=g[_],C=g[_+1],M=A-p,k=C-b;if(a){let S=u[y];if(S!=0){let E=(Math.sqrt(M*M+k*k)/S-1)*s+1;v.a*=E,v.c*=E}}if(p=A,b=C,s>0){let S=v.a,E=v.b,R=v.c,T=v.d,I=0,F=0,D=0;if(l?I=g[_-1]:f[y+1]==0?I=g[_+2]:I=Math.atan2(k,M),I-=Math.atan2(R,S),x){F=Math.cos(I),D=Math.sin(I);let H=v.data.length;p+=(H*(F*S-D*R)-M)*s,b+=(H*(D*S+F*R)-k)*s}else I+=w;I>X.PI?I-=X.PI2:I<-3.1415927&&(I+=X.PI2),I*=s,F=Math.cos(I),D=Math.sin(I),v.a=F*S-D*R,v.b=F*E-D*T,v.c=D*S+F*R,v.d=D*E+F*T}v.updateAppliedTransform()}}computeWorldPositions(t,e,s){let i=this.target,n=this.position,o=this.spaces,l=O.setArraySize(this.positions,e*3+2),a=this.world,h=t.closed,c=t.worldVerticesLength,d=c/6,f=Ae.NONE;if(!t.constantSpeed){let H=t.lengths;d-=h?1:2;let L=H[d];this.data.positionMode==ge.Percent&&(n*=L);let U;switch(this.data.spacingMode){case Ct.Percent:U=L;break;case Ct.Proportional:U=L/e;break;default:U=1}a=O.setArraySize(this.world,8);for(let j=0,Z=0,N=0;j<e;j++,Z+=3){let q=o[j]*U;n+=q;let $=n;if(h)$%=L,$<0&&($+=L),N=0;else if($<0){f!=Ae.BEFORE&&(f=Ae.BEFORE,t.computeWorldVertices(i,2,4,a,0,2)),this.addBeforePosition($,a,0,l,Z);continue}else if($>L){f!=Ae.AFTER&&(f=Ae.AFTER,t.computeWorldVertices(i,c-6,4,a,0,2)),this.addAfterPosition($-L,a,0,l,Z);continue}for(;;N++){let ht=H[N];if(!($>ht)){if(N==0)$/=ht;else{let _t=H[N-1];$=($-_t)/(ht-_t)}break}}N!=f&&(f=N,h&&N==d?(t.computeWorldVertices(i,c-4,4,a,0,2),t.computeWorldVertices(i,0,4,a,4,2)):t.computeWorldVertices(i,N*6+2,8,a,0,2)),this.addCurvePosition($,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],l,Z,s||j>0&&q==0)}return l}h?(c+=2,a=O.setArraySize(this.world,c),t.computeWorldVertices(i,2,c-4,a,0,2),t.computeWorldVertices(i,0,2,a,c-4,2),a[c-2]=a[0],a[c-1]=a[1]):(d--,c-=4,a=O.setArraySize(this.world,c),t.computeWorldVertices(i,2,c,a,0,2));let u=O.setArraySize(this.curves,d),m=0,g=a[0],p=a[1],b=0,w=0,x=0,y=0,_=0,v=0,A=0,C=0,M=0,k=0,S=0,E=0,R=0,T=0;for(let H=0,L=2;H<d;H++,L+=6)b=a[L],w=a[L+1],x=a[L+2],y=a[L+3],_=a[L+4],v=a[L+5],A=(g-b*2+x)*.1875,C=(p-w*2+y)*.1875,M=((b-x)*3-g+_)*.09375,k=((w-y)*3-p+v)*.09375,S=A*2+M,E=C*2+k,R=(b-g)*.75+A+M*.16666667,T=(w-p)*.75+C+k*.16666667,m+=Math.sqrt(R*R+T*T),R+=S,T+=E,S+=M,E+=k,m+=Math.sqrt(R*R+T*T),R+=S,T+=E,m+=Math.sqrt(R*R+T*T),R+=S+M,T+=E+k,m+=Math.sqrt(R*R+T*T),u[H]=m,g=_,p=v;this.data.positionMode==ge.Percent&&(n*=m);let I;switch(this.data.spacingMode){case Ct.Percent:I=m;break;case Ct.Proportional:I=m/e;break;default:I=1}let F=this.segments,D=0;for(let H=0,L=0,U=0,j=0;H<e;H++,L+=3){let Z=o[H]*I;n+=Z;let N=n;
289if(h)N%=m,N<0&&(N+=m),U=0;else if(N<0){this.addBeforePosition(N,a,0,l,L);continue}else if(N>m){this.addAfterPosition(N-m,a,c-4,l,L);continue}for(;;U++){let q=u[U];if(!(N>q)){if(U==0)N/=q;else{let $=u[U-1];N=(N-$)/(q-$)}break}}if(U!=f){f=U;let q=U*6;for(g=a[q],p=a[q+1],b=a[q+2],w=a[q+3],x=a[q+4],y=a[q+5],_=a[q+6],v=a[q+7],A=(g-b*2+x)*.03,C=(p-w*2+y)*.03,M=((b-x)*3-g+_)*.006,k=((w-y)*3-p+v)*.006,S=A*2+M,E=C*2+k,R=(b-g)*.3+A+M*.16666667,T=(w-p)*.3+C+k*.16666667,D=Math.sqrt(R*R+T*T),F[0]=D,q=1;q<8;q++)R+=S,T+=E,S+=M,E+=k,D+=Math.sqrt(R*R+T*T),F[q]=D;R+=S,T+=E,D+=Math.sqrt(R*R+T*T),F[8]=D,R+=S+M,T+=E+k,D+=Math.sqrt(R*R+T*T),F[9]=D,j=0}for(N*=D;;j++){let q=F[j];if(!(N>q)){if(j==0)N/=q;else{let $=F[j-1];N=j+(N-$)/(q-$)}break}}this.addCurvePosition(N*.1,g,p,b,w,x,y,_,v,l,L,s||H>0&&Z==0)}return l}addBeforePosition(t,e,s,i,n){let o=e[s],l=e[s+1],a=e[s+2]-o,h=e[s+3]-l,c=Math.atan2(h,a);i[n]=o+t*Math.cos(c),i[n+1]=l+t*Math.sin(c),i[n+2]=c}addAfterPosition(t,e,s,i,n){let o=e[s+2],l=e[s+3],a=o-e[s],h=l-e[s+1],c=Math.atan2(h,a);i[n]=o+t*Math.cos(c),i[n+1]=l+t*Math.sin(c),i[n+2]=c}addCurvePosition(t,e,s,i,n,o,l,a,h,c,d,f){if(t==0||isNaN(t)){c[d]=e,c[d+1]=s,c[d+2]=Math.atan2(n-s,i-e);return}let u=t*t,m=u*t,g=1-t,p=g*g,b=p*g,w=g*t,x=w*3,y=g*x,_=x*t,v=e*b+i*y+o*_+a*m,A=s*b+n*y+l*_+h*m;c[d]=v,c[d+1]=A,f&&(t<.001?c[d+2]=Math.atan2(n-s,i-e):c[d+2]=Math.atan2(A-(s*p+n*w*2+l*u),v-(e*p+i*w*2+o*u)))}}class cm{data;_bone=null;set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;_reset=!0;ux=0;uy=0;cx=0;cy=0;tx=0;ty=0;xOffset=0;xVelocity=0;yOffset=0;yVelocity=0;rotateOffset=0;rotateVelocity=0;scaleOffset=0;scaleVelocity=0;active=!1;skeleton;remaining=0;lastTime=0;constructor(t,e){this.data=t,this.skeleton=e,this.bone=e.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}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 t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}isActive(){return this.active}update(t){const e=this.mix;if(e==0)return;const s=this.data.x>0,i=this.data.y>0,n=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,l=this.bone,a=l.data.length;switch(t){case se.none:return;case se.reset:this.reset();case se.update:const h=this.skeleton,c=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=c,this.lastTime=h.time;const d=l.worldX,f=l.worldY;if(this._reset)this._reset=!1,this.ux=d,this.uy=f;else{let u=this.remaining,m=this.inertia,g=this.data.step,p=this.skeleton.data.referenceScale,b=-1,w=this.data.limit*c,x=w*Math.abs(h.scaleY);if(w*=Math.abs(h.scaleX),s||i){if(s){const y=(this.ux-d)*m;this.xOffset+=y>w?w:y<-w?-w:y,this.ux=d}if(i){const y=(this.uy-f)*m;this.yOffset+=y>x?x:y<-x?-x:y,this.uy=f}if(u>=g){b=Math.pow(this.damping,60*g);const y=this.massInverse*g,_=this.strength,v=this.wind*p*h.scaleX,A=this.gravity*p*h.scaleY;do s&&(this.xVelocity+=(v-this.xOffset*_)*y,this.xOffset+=this.xVelocity*g,this.xVelocity*=b),i&&(this.yVelocity-=(A+this.yOffset*_)*y,this.yOffset+=this.yVelocity*g,this.yVelocity*=b),u-=g;while(u>=g)}s&&(l.worldX+=this.xOffset*e*this.data.x),i&&(l.worldY+=this.yOffset*e*this.data.y)}if(n||o){let y=Math.atan2(l.c,l.a),_=0,v=0,A=0,C=this.cx-l.worldX,M=this.cy-l.worldY;if(C>w?C=w:C<-w&&(C=-w),M>x?M=x:M<-x&&(M=-x),n){A=(this.data.rotate+this.data.shearX)*e;let k=Math.atan2(M+this.ty,C+this.tx)-y-this.rotateOffset*A;this.rotateOffset+=(k-Math.ceil(k*X.invPI2-.5)*X.PI2)*m,k=this.rotateOffset*A+y,_=Math.cos(k),v=Math.sin(k),o&&(k=a*l.getWorldScaleX(),k>0&&(this.scaleOffset+=(C*_+M*v)*m/k))}else{_=Math.cos(y),v=Math.sin(y);const k=a*l.getWorldScaleX();k>0&&(this.scaleOffset+=(C*_+M*v)*m/k)}if(u=this.remaining,u>=g){b==-1&&(b=Math.pow(this.damping,60*g));const k=this.massInverse*g,S=this.strength,E=this.wind,R=gs.yDown?-this.gravity:this.gravity,T=a/p;for(;;)if(u-=g,o&&(this.scaleVelocity+=(E*_-R*v-this.scaleOffset*S)*k,this.scaleOffset+=this.scaleVelocity*g,this.scaleVelocity*=b),n){if
289(this.rotateVelocity-=((E*v+R*_)*T+this.rotateOffset*S)*k,this.rotateOffset+=this.rotateVelocity*g,this.rotateVelocity*=b,u<g)break;const I=this.rotateOffset*A+y;_=Math.cos(I),v=Math.sin(I)}else if(u<g)break}}this.remaining=u}this.cx=l.worldX,this.cy=l.worldY;break;case se.pose:s&&(l.worldX+=this.xOffset*e*this.data.x),i&&(l.worldY+=this.yOffset*e*this.data.y)}if(n){let h=this.rotateOffset*e,c=0,d=0,f=0;if(this.data.shearX>0){let u=0;this.data.rotate>0&&(u=h*this.data.rotate,c=Math.sin(u),d=Math.cos(u),f=l.b,l.b=d*f-c*l.d,l.d=c*f+d*l.d),u+=h*this.data.shearX,c=Math.sin(u),d=Math.cos(u),f=l.a,l.a=d*f-c*l.c,l.c=c*f+d*l.c}else h*=this.data.rotate,c=Math.sin(h),d=Math.cos(h),f=l.a,l.a=d*f-c*l.c,l.c=c*f+d*l.c,f=l.b,l.b=d*f-c*l.d,l.d=c*f+d*l.d}if(o){const h=1+this.scaleOffset*e*this.data.scaleX;l.a*=h,l.c*=h}t!=se.pose&&(this.tx=a*l.a,this.ty=a*l.c),l.updateAppliedTransform()}translate(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e}rotate(t,e,s){const i=s*X.degRad,n=Math.cos(i),o=Math.sin(i),l=this.cx-t,a=this.cy-e;this.translate(l*n-a*o-l,l*o+a*n-a)}}class dm{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new W,this.darkColor=t.darkColor?new W:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&((!(t instanceof re)||!(this.attachment instanceof re)||t.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=t,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}}class um{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new fi;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let n=e.findBone(t.bones[i].name);if(!n)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(n)}let s=e.findBone(t.target.name);if(!s)throw new Error(`Couldn't find target bone ${t.target.name}.`);this.target=s,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}update(t){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleY==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,n=this.mixScaleY,o=this.mixShearY,l=e!=0||s!=0,a=this.target,h=a.a,c=a.b,d=a.c,f=a.d,u=h*f-c*d>0?X.degRad:-.01745329277777778,m=this.data.offsetRotation*u,g=this.data.offsetShearY*u,p=this.bones;for(let b=0,w=p.length;b<w;b++){let x=p[b];if(t!=0){let y=x.a,_=x.b,v=x.c,A=x.d,C=Math.atan2(d,h)-Math.atan2(v,y)+m;C>X.PI?C-=X.PI2:C<-3.1415927&&(C+=X.PI2),C*=t;let M=Math.cos(C),k=Math.sin(C);x.a=M*y-k*v,x.b=M*_-k*A,x.c=k*y+M*v,x.d=k*_+M*A}if(l){let y=this.temp;a.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(y.x-x.worldX)*e,x.worldY+=(y.y-x.worldY)*s}if(i!=0){let y=Math.sqrt(x.a*x.a+x.c*x.c);y!=0&&(y=(y+(Math.sqrt(h*h+d*d)-y+this.data.offsetScaleX)*i)/y),x.a*=y,x.c*=y}if(n!=0){let y=Math.sqrt(x.b*x.b+x.d*x.d);y!=0&&(y=(y+(Math.sqrt(c*c+f*f)-y+this.data.offsetScaleY)*n)/y),x.b*=y,x.d*=y}if(o>0){let y=x.b,_=x.d,v=Math.atan2(_,y),A=Math.atan2(f,c)-Math.atan2(d,h)-(v-Math.atan2(x.c,x.a));A>X.PI?A-=X.PI2:A<-3.1415927&&(A+=X.PI2),A=v+(A+g)*o;let C=Math.sqrt(y*y+_*_);x.b=Math.cos(A)*C,x.d=Math.sin(A)*C}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,n=this.mixScaleY,o=this.mixShearY,l=e!=0||s!=0,a=this.target,h=a.a,c=a.b,d=a.c,f=a.d,u=h*f-c*d>0?X.degRad:-.01745329277777778,m=this.data.offsetRotation*u,g=this.data.offsetShearY*u,p=this.bones;for(let b=0,w=p.length;b<w;b++){let x=p[b];if(t!=0){let y=x.a,_=x.b,v=x.c,A=x.d,C=Math.atan2(d,h)+m;C>X.PI?C-=X.PI2:C<-3.1415927&&(C+=X.PI2),C*=t;let M=Math.cos(C),k=Math.sin(C);x.a=M*y-k*v,x.b=M*_-k*A,x.c=k*y+M*v,x.d=k*_+M*A}if(l){let y=this.temp;a.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),x.worldX+=y.x*e,x.worldY+=y.y*s}if(i!=0){let y=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleX)*i+1;x.a*=y,x.c*=y}if(n!=0){let y=(Math.sqrt(c*c+f*f)-1+this.data.offsetScaleY)*n+1;x.b*=y,x.d*=y}if(o>0){let y=Math.atan2(f,c)-Math.atan2(d,h);y>X.PI?y-=X.PI2:y<-3.1415927&&(y+=X.PI2);let _=x.b,v=x.d;y=Math.atan2(v,_)+(y-X.PI/2+g)*o;let A=Math.sqrt(_*_+v*v);x.b=Math.cos(y)*A,x.d=Math.sin(y)*A}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,n=this.mixScaleY,o=this.mixShearY,l=this.target,a=this.bones;for(let h=0,c=a.length;h<c;h++){let d=a[h],f=d.arotation;
289t!=0&&(f+=(l.arotation-f+this.data.offsetRotation)*t);let u=d.ax,m=d.ay;u+=(l.ax-u+this.data.offsetX)*e,m+=(l.ay-m+this.data.offsetY)*s;let g=d.ascaleX,p=d.ascaleY;i!=0&&g!=0&&(g=(g+(l.ascaleX-g+this.data.offsetScaleX)*i)/g),n!=0&&p!=0&&(p=(p+(l.ascaleY-p+this.data.offsetScaleY)*n)/p);let b=d.ashearY;o!=0&&(b+=(l.ashearY-b+this.data.offsetShearY)*o),d.updateWorldTransformWith(u,m,f,g,p,d.ashearX,b)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,n=this.mixScaleY,o=this.mixShearY,l=this.target,a=this.bones;for(let h=0,c=a.length;h<c;h++){let d=a[h],f=d.arotation+(l.arotation+this.data.offsetRotation)*t,u=d.ax+(l.ax+this.data.offsetX)*e,m=d.ay+(l.ay+this.data.offsetY)*s,g=d.ascaleX*((l.ascaleX-1+this.data.offsetScaleX)*i+1),p=d.ascaleY*((l.ascaleY-1+this.data.offsetScaleY)*n+1),b=d.ashearY+(l.ashearY+this.data.offsetShearY)*o;d.updateWorldTransformWith(u,m,f,g,p,d.ashearX,b)}}}class gs{static quadTriangles=[0,1,2,2,3,0];static yDown=!1;data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return gs.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}x=0;y=0;time=0;constructor(t){if(!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e<t.bones.length;e++){let s=t.bones[e],i;if(!s.parent)i=new Ba(s,this,null);else{let n=this.bones[s.parent.index];i=new Ba(s,this,n),n.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let e=0;e<t.slots.length;e++){let s=t.slots[e],i=this.bones[s.boneData.index],n=new dm(s,i);this.slots.push(n),this.drawOrder.push(n)}this.ikConstraints=new Array;for(let e=0;e<t.ikConstraints.length;e++){let s=t.ikConstraints[e];this.ikConstraints.push(new hm(s,this))}this.transformConstraints=new Array;for(let e=0;e<t.transformConstraints.length;e++){let s=t.transformConstraints[e];this.transformConstraints.push(new um(s,this))}this.pathConstraints=new Array;for(let e=0;e<t.pathConstraints.length;e++){let s=t.pathConstraints[e];this.pathConstraints.push(new Ae(s,this))}this.physicsConstraints=new Array;for(let e=0;e<t.physicsConstraints.length;e++){let s=t.physicsConstraints[e];this.physicsConstraints.push(new cm(s,this))}this.color=new W(1,1,1,1),this.updateCache()}updateCache(){let t=this._updateCache;t.length=0;let e=this.bones;for(let f=0,u=e.length;f<u;f++){let m=e[f];m.sorted=m.data.skinRequired,m.active=!m.sorted}if(this.skin){let f=this.skin.bones;for(let u=0,m=this.skin.bones.length;u<m;u++){let g=this.bones[f[u].index];do g.sorted=!1,g.active=!0,g=g.parent;while(g)}}let s=this.ikConstraints,i=this.transformConstraints,n=this.pathConstraints,o=this.physicsConstraints,l=s.length,a=i.length,h=n.length,c=this.physicsConstraints.length,d=l+a+h+c;t:for(let f=0;f<d;f++){for(let u=0;u<l;u++){let m=s[u];if(m.data.order==f){this.sortIkConstraint(m);continue t}}for(let u=0;u<a;u++){let m=i[u];if(m.data.order==f){this.sortTransformConstraint(m);continue t}}for(let u=0;u<h;u++){let m=n[u];if(m.data.order==f){this.sortPathConstraint(m);continue t}}for(let u=0;u<c;u++){const m=o[u];if(m.data.order==f){this.sortPhysicsConstraint(m);continue t}}}for(let f=0,u=e.length;f<u;f++)this.sortBone(e[f])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&O.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target;this.sortBone(e);let s=t.bones,i=s[0];if(this.sortBone(i),s.length==1)this._updateCache.push(t),this.sortReset(i.children);else{let n=s[s.length-1];this.sortBone(n),this._updateCache.push(t),this.sortReset(i.children),n.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&O.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target,s=e.data.index,i=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,s,i),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,s,i);for(let a=0,h=this.data.skins.length;a<h;a++)this.sortPathConstraintAttachment(this.data.skins[a],s,i);let n=e.getAttachment();n instanceof ms&&this.sortPathConstraintAttachmentWith(n,i);let o=t.bones,l=o.length;for(let a=0;a<l;a++)this.sortBone(o[a]);this._updateCache.push(t);for(let a=0;a<l;a++)this.sortReset(o[a].children);for(let a=0;a<l;a++)o[a].sorted=!0}
289sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&O.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let e=t.bones,s=e.length;if(t.data.local)for(let i=0;i<s;i++){let n=e[i];this.sortBone(n.parent),this.sortBone(n)}else for(let i=0;i<s;i++)this.sortBone(e[i]);this._updateCache.push(t);for(let i=0;i<s;i++)this.sortReset(e[i].children);for(let i=0;i<s;i++)e[i].sorted=!0}sortPathConstraintAttachment(t,e,s){let i=t.attachments[e];if(i)for(let n in i)this.sortPathConstraintAttachmentWith(i[n],s)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof ms))return;let s=t.bones;if(!s)this.sortBone(e);else{let i=this.bones;for(let n=0,o=s.length;n<o;){let l=s[n++];for(l+=n;n<l;)this.sortBone(i[s[n++]])}}}sortPhysicsConstraint(t){const e=t.bone;t.active=e.active&&(!t.data.skinRequired||this.skin!=null&&O.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(e),this._updateCache.push(t),this.sortReset(e.children),e.sorted=!0)}sortBone(t){if(!t||t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,s=t.length;e<s;e++){let i=t[e];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(t){if(t==null)throw new Error("physics is undefined");let e=this.bones;for(let i=0,n=e.length;i<n;i++){let o=e[i];o.ax=o.x,o.ay=o.y,o.arotation=o.rotation,o.ascaleX=o.scaleX,o.ascaleY=o.scaleY,o.ashearX=o.shearX,o.ashearY=o.shearY}let s=this._updateCache;for(let i=0,n=s.length;i<n;i++)s[i].update(t)}updateWorldTransformWith(t,e){if(!e)throw new Error("parent cannot be null.");let s=this.bones;for(let p=1,b=s.length;p<b;p++){let w=s[p];w.ax=w.x,w.ay=w.y,w.arotation=w.rotation,w.ascaleX=w.scaleX,w.ascaleY=w.scaleY,w.ashearX=w.shearX,w.ashearY=w.shearY}let i=this.getRootBone();if(!i)throw new Error("Root bone must not be null.");let n=e.a,o=e.b,l=e.c,a=e.d;i.worldX=n*this.x+o*this.y+e.worldX,i.worldY=l*this.x+a*this.y+e.worldY;const h=(i.rotation+i.shearX)*X.degRad,c=(i.rotation+90+i.shearY)*X.degRad,d=Math.cos(h)*i.scaleX,f=Math.cos(c)*i.scaleY,u=Math.sin(h)*i.scaleX,m=Math.sin(c)*i.scaleY;i.a=(n*d+o*u)*this.scaleX,i.b=(n*f+o*m)*this.scaleX,i.c=(l*d+a*u)*this.scaleY,i.d=(l*f+a*m)*this.scaleY;let g=this._updateCache;for(let p=0,b=g.length;p<b;p++){let w=g[p];w!=i&&w.update(t)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const t of this.bones)t.setToSetupPose();for(const t of this.ikConstraints)t.setToSetupPose();for(const t of this.transformConstraints)t.setToSetupPose();for(const t of this.pathConstraints)t.setToSetupPose();for(const t of this.physicsConstraints)t.setToSetupPose()}setSlotsToSetupPose(){let t=this.slots;O.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,s=t.length;e<s;e++)t[e].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++){let n=e[s];if(n.data.name==t)return n}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++){let n=e[s];if(n.data.name==t)return n}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let s=0,i=e.length;s<i;s++){let n=e[s],o=n.data.attachmentName;if(o){let l=t.getAttachment(s,o);l&&n.setAttachment(l)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){let s=this.data.findSlot(t);if(!s)throw new Error(`Can't find slot with name ${t}`);return this.getAttachment(s.index,e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let s=this.skin.getAttachment(t,e);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let s=this.slots;for(let i=0,n=s.length;i<n;i++){let o=s[i];if(o.data.name==t){let l=null;if(e&&(l=this.getAttachment(i,e),!l))throw new Error("Attachment not found: "+e+", for slot: "+t);o.setAttachment(l);return}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.ikConstraints.find(e=>e.data.name==t)??null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(e=>e.data.name==t)??null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(e=>e.data.name==t)??null}findPhysicsConstraint(t){if(t==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(e=>e.data.name==t)??null}getBoundsRect(t){let e=new fi,s=new fi;return this.getBounds(e,s,void 0,t),{x:e.x,y:e.y,width:s.x,height:s.y}}getBounds(t,e,s=new Array(2),i=null){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");let n=this.drawOrder,o=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(let c=0,d=n.length;c<d;c++){let f=n[c];if(!f.bone.active)continue;let u=0,m=null,g=null,p=f.getAttachment();if(p instanceof Q)u=8,m=O.setArraySize(s,u,0),p.computeWorldVertices(f,m,0,2),g=gs.quadTriangles;else if(p instanceof jt){let b=p;u=b.worldVerticesLength,m=O.setArraySize(s,u,0),b.computeWorldVertices(f,0,u,m,0,2),g=b.triangles}else if(p instanceof Ve&&i!=null){i.clipStart(f,p);continue}
289if(m&&g){i!=null&&i.isClipping()&&(i.clipTriangles(m,g,g.length),m=i.clippedVertices,u=i.clippedVertices.length);for(let b=0,w=m.length;b<w;b+=2){let x=m[b],y=m[b+1];o=Math.min(o,x),l=Math.min(l,y),a=Math.max(a,x),h=Math.max(h,y)}}i?.clipEndWithSlot(f)}i?.clipEnd(),t.set(o,l),e.set(a-o,h-l)}update(t){this.time+=t}physicsTranslate(t,e){const s=this.physicsConstraints;for(let i=0,n=s.length;i<n;i++)s[i].translate(t,e)}physicsRotate(t,e,s){const i=this.physicsConstraints;for(let n=0,o=i.length;n<o;n++)i[n].rotate(t,e,s)}}var se;(function(r){r[r.none=0]="none",r[r.reset=1]="reset",r[r.update=2]="update",r[r.pose=3]="pose"})(se||(se={}));class rh extends Mi{_bone=null;set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}x=0;y=0;rotate=0;scaleX=0;shearX=0;limit=0;step=0;inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;inertiaGlobal=!1;strengthGlobal=!1;dampingGlobal=!1;massGlobal=!1;windGlobal=!1;gravityGlobal=!1;mixGlobal=!1;constructor(t){super(t,0,!1)}}class gi{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;physicsConstraints=new Array;x=0;y=0;width=0;height=0;referenceScale=100;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++){let n=e[s];if(n.name==t)return n}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++){let n=e[s];if(n.name==t)return n}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let s=0,i=e.length;s<i;s++){let n=e[s];if(n.name==t)return n}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let s=0,i=e.length;s<i;s++){let n=e[s];if(n.name==t)return n}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let e=this.animations;for(let s=0,i=e.length;s<i;s++){let n=e[s];if(n.name==t)return n}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.ikConstraints;for(let s=0,i=e.length;s<i;s++){const n=e[s];if(n.name==t)return n}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.transformConstraints;for(let s=0,i=e.length;s<i;s++){const n=e[s];if(n.name==t)return n}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.pathConstraints;for(let s=0,i=e.length;s<i;s++){const n=e[s];if(n.name==t)return n}return null}findPhysicsConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.physicsConstraints;for(let s=0,i=e.length;s<i;s++){const n=e[s];if(n.name==t)return n}return null}}class Ya{slotIndex;name;attachment;constructor(t=0,e,s){this.slotIndex=t,this.name=e,this.attachment=s}}class Fr{name;attachments=new Array;bones=Array();constraints=new Array;color=new W(.99607843,.61960787,.30980393,1);constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,s){if(!s)throw new Error("attachment cannot be null.");let i=this.attachments;t>=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=s}addSkin(t){for(let i=0;i<t.bones.length;i++){let n=t.bones[i],o=!1;for(let l=0;l<this.bones.length;l++)if(this.bones[l]==n){o=!0;break}o||this.bones.push(n)}for(let i=0;i<t.constraints.length;i++){let n=t.constraints[i],o=!1;for(let l=0;l<this.constraints.length;l++)if(this.constraints[l]==n){o=!0;break}o||this.constraints.push(n)}let e=t.getAttachments();for(let i=0;i<e.length;i++){var s=e[i];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(t){for(let i=0;i<t.bones.length;i++){let n=t.bones[i],o=!1;for(let l=0;l<this.bones.length;l++)if(this.bones[l]==n){o=!0;break}o||this.bones.push(n)}for(let i=0;i<t.constraints.length;i++){let n=t.constraints[i],o=!1;for(let l=0;l<this.constraints.length;l++)if(this.constraints[l]==n){o=!0;break}o||this.constraints.push(n)}let e=t.getAttachments();for(let i=0;i<e.length;i++){var s=e[i];s.attachment&&(s.attachment instanceof jt?(s.attachment=s.attachment.newLinkedMesh(),this.setAttachment(s.slotIndex,s.name,s.attachment)):(s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment)))}}getAttachment(t,e){let s=this.attachments[t];return s?s[e]:null}removeAttachment(t,e){let s=this.attachments[t];s&&delete s[e]}getAttachments(){let t=new Array;for(var e=0;e<this.attachments.length;e++){let s=this.attachments[e];if(s)for(let i in s){let n=s[i];
289n&&t.push(new Ya(e,i,n))}}return t}getAttachmentsForSlot(t,e){let s=this.attachments[t];if(s)for(let i in s){let n=s[i];n&&e.push(new Ya(t,i,n))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let s=0;for(let i=0;i<t.slots.length;i++){let n=t.slots[i],o=n.getAttachment();if(o&&s<e.attachments.length){let l=e.attachments[s];for(let a in l){let h=l[a];if(o==h){let c=this.getAttachment(s,a);c&&n.setAttachment(c);break}}}s++}}}class nh{index=0;name;boneData;color=new W(1,1,1,1);darkColor=null;attachmentName=null;blendMode=Fe.Normal;visible=!0;constructor(t,e,s){if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=s}}var Fe;(function(r){r[r.Normal=0]="Normal",r[r.Additive=1]="Additive",r[r.Multiply=2]="Multiply",r[r.Screen=3]="Screen"})(Fe||(Fe={}));class ah extends Mi{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(t){super(t,0,!1)}}class oh{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(t){this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,s=new gi;s.name="";let i=new fm(t),n=i.readInt32(),o=i.readInt32();s.hash=o==0&&n==0?null:o.toString(16)+n.toString(16),s.version=i.readString(),s.x=i.readFloat(),s.y=i.readFloat(),s.width=i.readFloat(),s.height=i.readFloat(),s.referenceScale=i.readFloat()*e;let l=i.readBoolean();l&&(s.fps=i.readFloat(),s.imagesPath=i.readString(),s.audioPath=i.readString());let a=0;a=i.readInt(!0);for(let c=0;c<a;c++){let d=i.readString();if(!d)throw new Error("String in string table must not be null.");i.strings.push(d)}a=i.readInt(!0);for(let c=0;c<a;c++){let d=i.readString();if(!d)throw new Error("Bone name must not be null.");let f=c==0?null:s.bones[i.readInt(!0)],u=new Jl(c,d,f);u.rotation=i.readFloat(),u.x=i.readFloat()*e,u.y=i.readFloat()*e,u.scaleX=i.readFloat(),u.scaleY=i.readFloat(),u.shearX=i.readFloat(),u.shearY=i.readFloat(),u.length=i.readFloat()*e,u.inherit=i.readByte(),u.skinRequired=i.readBoolean(),l&&(W.rgba8888ToColor(u.color,i.readInt32()),u.icon=i.readString()??void 0,u.visible=i.readBoolean()),s.bones.push(u)}a=i.readInt(!0);for(let c=0;c<a;c++){let d=i.readString();if(!d)throw new Error("Slot name must not be null.");let f=s.bones[i.readInt(!0)],u=new nh(c,d,f);W.rgba8888ToColor(u.color,i.readInt32());let m=i.readInt32();m!=-1&&W.rgb888ToColor(u.darkColor=new W,m),u.attachmentName=i.readStringRef(),u.blendMode=i.readInt(!0),l&&(u.visible=i.readBoolean()),s.slots.push(u)}a=i.readInt(!0);for(let c=0,d;c<a;c++){let f=i.readString();if(!f)throw new Error("IK constraint data name must not be null.");let u=new sh(f);u.order=i.readInt(!0),d=i.readInt(!0);for(let g=0;g<d;g++)u.bones.push(s.bones[i.readInt(!0)]);u.target=s.bones[i.readInt(!0)];let m=i.readByte();u.skinRequired=(m&1)!=0,u.bendDirection=(m&2)!=0?1:-1,u.compress=(m&4)!=0,u.stretch=(m&8)!=0,u.uniform=(m&16)!=0,(m&32)!=0&&(u.mix=(m&64)!=0?i.readFloat():1),(m&128)!=0&&(u.softness=i.readFloat()*e),s.ikConstraints.push(u)}a=i.readInt(!0);for(let c=0,d;c<a;c++){let f=i.readString();if(!f)throw new Error("Transform constraint data name must not be null.");let u=new ah(f);u.order=i.readInt(!0),d=i.readInt(!0);for(let g=0;g<d;g++)u.bones.push(s.bones[i.readInt(!0)]);u.target=s.bones[i.readInt(!0)];let m=i.readByte();u.skinRequired=(m&1)!=0,u.local=(m&2)!=0,u.relative=(m&4)!=0,(m&8)!=0&&(u.offsetRotation=i.readFloat()),(m&16)!=0&&(u.offsetX=i.readFloat()*e),(m&32)!=0&&(u.offsetY=i.readFloat()*e),(m&64)!=0&&(u.offsetScaleX=i.readFloat()),(m&128)!=0&&(u.offsetScaleY=i.readFloat()),m=i.readByte(),(m&1)!=0&&(u.offsetShearY=i.readFloat()),(m&2)!=0&&(u.mixRotate=i.readFloat()),(m&4)!=0&&(u.mixX=i.readFloat()),(m&8)!=0&&(u.mixY=i.readFloat()),(m&16)!=0&&(u.mixScaleX=i.readFloat()),(m&32)!=0&&(u.mixScaleY=i.readFloat()),(m&64)!=0&&(u.mixShearY=i.readFloat()),s.transformConstraints.push(u)}a=i.readInt(!0);for(let c=0,d;c<a;c++){let f=i.readString();if(!f)throw new Error("Path constraint data name must not be null.");let u=new ih(f);u.order=i.readInt(!0),u.skinRequired=i.readBoolean(),d=i.readInt(!0);for(let g=0;g<d;
289g++)u.bones.push(s.bones[i.readInt(!0)]);u.target=s.slots[i.readInt(!0)];const m=i.readByte();u.positionMode=m&1,u.spacingMode=m>>1&3,u.rotateMode=m>>3&3,(m&128)!=0&&(u.offsetRotation=i.readFloat()),u.position=i.readFloat(),u.positionMode==ge.Fixed&&(u.position*=e),u.spacing=i.readFloat(),(u.spacingMode==Ct.Length||u.spacingMode==Ct.Fixed)&&(u.spacing*=e),u.mixRotate=i.readFloat(),u.mixX=i.readFloat(),u.mixY=i.readFloat(),s.pathConstraints.push(u)}a=i.readInt(!0);for(let c=0,d;c<a;c++){const f=i.readString();if(!f)throw new Error("Physics constraint data name must not be null.");const u=new rh(f);u.order=i.readInt(!0),u.bone=s.bones[i.readInt(!0)];let m=i.readByte();u.skinRequired=(m&1)!=0,(m&2)!=0&&(u.x=i.readFloat()),(m&4)!=0&&(u.y=i.readFloat()),(m&8)!=0&&(u.rotate=i.readFloat()),(m&16)!=0&&(u.scaleX=i.readFloat()),(m&32)!=0&&(u.shearX=i.readFloat()),u.limit=((m&64)!=0?i.readFloat():5e3)*e,u.step=1/i.readUnsignedByte(),u.inertia=i.readFloat(),u.strength=i.readFloat(),u.damping=i.readFloat(),u.massInverse=(m&128)!=0?i.readFloat():1,u.wind=i.readFloat(),u.gravity=i.readFloat(),m=i.readByte(),(m&1)!=0&&(u.inertiaGlobal=!0),(m&2)!=0&&(u.strengthGlobal=!0),(m&4)!=0&&(u.dampingGlobal=!0),(m&8)!=0&&(u.massGlobal=!0),(m&16)!=0&&(u.windGlobal=!0),(m&32)!=0&&(u.gravityGlobal=!0),(m&64)!=0&&(u.mixGlobal=!0),u.mix=(m&128)!=0?i.readFloat():1,s.physicsConstraints.push(u)}let h=this.readSkin(i,s,!0,l);h&&(s.defaultSkin=h,s.skins.push(h));{let c=s.skins.length;for(O.setArraySize(s.skins,a=c+i.readInt(!0));c<a;c++){let d=this.readSkin(i,s,!1,l);if(!d)throw new Error("readSkin() should not have returned null.");s.skins[c]=d}}a=this.linkedMeshes.length;for(let c=0;c<a;c++){let d=this.linkedMeshes[c];const f=s.skins[d.skinIndex];if(!d.parent)throw new Error("Linked mesh parent must not be null");let u=f.getAttachment(d.slotIndex,d.parent);if(!u)throw new Error(`Parent mesh not found: ${d.parent}`);d.mesh.timelineAttachment=d.inheritTimeline?u:d.mesh,d.mesh.setParentMesh(u),d.mesh.region!=null&&d.mesh.updateRegion()}this.linkedMeshes.length=0,a=i.readInt(!0);for(let c=0;c<a;c++){let d=i.readString();if(!d)throw new Error("Event data name must not be null");let f=new eh(d);f.intValue=i.readInt(!1),f.floatValue=i.readFloat(),f.stringValue=i.readString(),f.audioPath=i.readString(),f.audioPath&&(f.volume=i.readFloat(),f.balance=i.readFloat()),s.events.push(f)}a=i.readInt(!0);for(let c=0;c<a;c++){let d=i.readString();if(!d)throw new Error("Animatio name must not be null.");s.animations.push(this.readAnimation(i,d,s))}return s}readSkin(t,e,s,i){let n=null,o=0;if(s){if(o=t.readInt(!0),o==0)return null;n=new Fr("default")}else{let l=t.readString();if(!l)throw new Error("Skin name must not be null.");n=new Fr(l),i&&W.rgba8888ToColor(n.color,t.readInt32()),n.bones.length=t.readInt(!0);for(let a=0,h=n.bones.length;a<h;a++)n.bones[a]=e.bones[t.readInt(!0)];for(let a=0,h=t.readInt(!0);a<h;a++)n.constraints.push(e.ikConstraints[t.readInt(!0)]);for(let a=0,h=t.readInt(!0);a<h;a++)n.constraints.push(e.transformConstraints[t.readInt(!0)]);for(let a=0,h=t.readInt(!0);a<h;a++)n.constraints.push(e.pathConstraints[t.readInt(!0)]);for(let a=0,h=t.readInt(!0);a<h;a++)n.constraints.push(e.physicsConstraints[t.readInt(!0)]);o=t.readInt(!0)}for(let l=0;l<o;l++){let a=t.readInt(!0);for(let h=0,c=t.readInt(!0);h<c;h++){let d=t.readStringRef();if(!d)throw new Error("Attachment name must not be null");let f=this.readAttachment(t,e,n,a,d,i);f&&n.setAttachment(a,d,f)}}return n}readAttachment(t,e,s,i,n,o){let l=this.scale,a=t.readByte();const h=(a&8)!=0?t.readStringRef():n;if(!h)throw new Error("Attachment name must not be null");switch(a&7){case Ce.Region:{let c=(a&16)!=0?t.readStringRef():null;const d=(a&32)!=0?t.readInt32():4294967295,f=(a&64)!=0?this.readSequence(t):null;let u=(a&128)!=0?t.readFloat():0,m=t.readFloat(),g=t.readFloat(),p=t.readFloat(),b=t.readFloat(),w=t.readFloat(),x=t.readFloat();c||(c=h);let y=this.attachmentLoader.newRegionAttachment(s,h,c,f);return y?(y.path=c,y.x=m*l,y.y=g*l,y.scaleX=p,y.scaleY=b,y.rotation=u,y.width=w*l,y.height=x*l,W.rgba8888ToColor(y.color,d),y.sequence=f,f==null&&y.updateRegion(),y):null}case Ce.BoundingBox:{let c=this.readVertices(t,(a&16)!=0),d=o?t.readInt32():0,f=this.attachmentLoader.newBoundingBoxAttachment(s,h);return f?(f.worldVerticesLength=c.length,f.vertices=c.vertices,f.bones=c.bones,o&&W.rgba8888ToColor(f.color,d),f):null}case Ce.Mesh:{let c=(a&16)!=0?t.readStringRef():h;const d=(a&32)!=0?t.readInt32():4294967295,f=(a&64)!=0?this.readSequence(t):null,u=t.readInt(!0),m=this.readVertices(t,(a&128)!=0),g=this.readFloatArray(t,m.length,1),p=this.readShortArray(t,(m.length-u-2)*3);let b=[],w=0,x=0;o&&(b=this.readShortArray(t,t.readInt(!0)),w=t.readFloat(),x=t.readFloat()),c||(c=h);let y=this.attachmentLoader.newMeshAttachment(s,h,c,f);return y?(y.path=c,W.rgba8888ToColor(y.color,d),y.bones=m.bones,y.vertices=m.vertices,y.worldVerticesLength=m.length,y.triangles=p,y.regionUVs=g,f==null&&y.updateRegion(),y.hullLength=u<<1,y.sequence=f,o&&(y.edges=b,y.width=w*l,y.height=x*l),y):null}case Ce.LinkedMesh:{const c=(a&16)!=0?t.readStringRef():h;if(c==null)throw new Error("Path of linked mesh must not be null");const d=(a&32)!=0?t.readInt32():4294967295,f=(a&64)!=0?this.readSequence(t):null,u=(a&128)!=0,m=t.readInt(!0),g=t.readStringRef();let p=0,b=0;o&&(p=t.readFloat(),b=t.readFloat());let w=this.attachmentLoader.newMeshAttachment(s,h,c,f);return w?(w.path=c,W.rgba8888ToColor(w.color,d),w.sequence=f,o&&(w.width=p*l,w.height=b*l),this.linkedMeshes.push(new mm(w,m,i,g,u)),w):null}case Ce.Path:{const c=(a&16)!=0,d=(a&32)!=0,f=this.readVertices(t,(a&64)!=0),u=O.newArray(f.length/6,0);for(let p=0,b=u.length;p<b;p++)u[p]=t.readFloat()*l;const m=o?t.readInt32():0,g=this.attachmentLoader.newPathAttachment(s,h);return g?(g.closed=c,g.constantSpeed=d,g.worldVerticesLength=f.length,g.vertices=f.vertices,g.bones=f.bones,g.lengths=u,o&&W.rgba8888ToColor(g.color,m),g):null}case Ce.Point:{const c=t.readFloat(),d=t.readFloat(),f=t.readFloat(),u=o?t.readInt32():0,m=this.attachmentLoader.newPointAttachment(s,h);return m?(m.x=d*l,m.y=f*l,m.rotation=c,o&&W.rgba8888ToColor(m.color,u),m):null}case Ce.Clipping:{const c=t.readInt(!0),d=this.readVertices(t,(a&16)!=0);let f=o?t.readInt32():0,u=this.attachmentLoader.newClippingAttachment(s,h);return u?(u.endSlot=e.slots[c],u.worldVerticesLength=d.length,u.vertices=d.vertices,u.bones=d.bones,o&&W.rgba8888ToColor(u.color,f),u):null}}return null}readSequence(t){let e=new cs(t.readInt(!0));return e.start=t.readInt(!0),e.digits=t.readInt(!0),e.setupIndex=t.readInt(!0),e}readVertices(t,e){const s=this.scale,i=t.readInt(!0),n=new gm;if(n.length=i<<1,!e)return n.vertices=this.readFloatArray(t,n.length,s),n;let o=new Array,l=new Array;for(let a=0;a<i;a++){let h=t.readInt(!0);l.push(h);for(let c=0;c<h;
289c++)l.push(t.readInt(!0)),o.push(t.readFloat()*s),o.push(t.readFloat()*s),o.push(t.readFloat())}return n.vertices=O.toFloatArray(o),n.bones=l,n}readFloatArray(t,e,s){let i=new Array(e);if(s==1)for(let n=0;n<e;n++)i[n]=t.readFloat();else for(let n=0;n<e;n++)i[n]=t.readFloat()*s;return i}readShortArray(t,e){let s=new Array(e);for(let i=0;i<e;i++)s[i]=t.readInt(!0);return s}readAnimation(t,e,s){t.readInt(!0);let i=new Array,n=this.scale;for(let h=0,c=t.readInt(!0);h<c;h++){let d=t.readInt(!0);for(let f=0,u=t.readInt(!0);f<u;f++){let m=t.readByte(),g=t.readInt(!0),p=g-1;switch(m){case Mm:{let b=new ns(g,d);for(let w=0;w<g;w++)b.setFrame(w,t.readFloat(),t.readStringRef());i.push(b);break}case Tm:{let b=t.readInt(!0),w=new Fl(g,b,d),x=t.readFloat(),y=t.readUnsignedByte()/255,_=t.readUnsignedByte()/255,v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255;for(let C=0,M=0;w.setFrame(C,x,y,_,v,A),C!=p;C++){let k=t.readFloat(),S=t.readUnsignedByte()/255,E=t.readUnsignedByte()/255,R=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255;switch(t.readByte()){case ue:w.setStepped(C);break;case fe:J(t,w,M++,C,0,x,k,y,S,1),J(t,w,M++,C,1,x,k,_,E,1),J(t,w,M++,C,2,x,k,v,R,1),J(t,w,M++,C,3,x,k,A,T,1)}x=k,y=S,_=E,v=R,A=T}i.push(w);break}case Pm:{let b=t.readInt(!0),w=new Bl(g,b,d),x=t.readFloat(),y=t.readUnsignedByte()/255,_=t.readUnsignedByte()/255,v=t.readUnsignedByte()/255;for(let A=0,C=0;w.setFrame(A,x,y,_,v),A!=p;A++){let M=t.readFloat(),k=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,E=t.readUnsignedByte()/255;switch(t.readByte()){case ue:w.setStepped(A);break;case fe:J(t,w,C++,A,0,x,M,y,k,1),J(t,w,C++,A,1,x,M,_,S,1),J(t,w,C++,A,2,x,M,v,E,1)}x=M,y=k,_=S,v=E}i.push(w);break}case Im:{let b=t.readInt(!0),w=new Dl(g,b,d),x=t.readFloat(),y=t.readUnsignedByte()/255,_=t.readUnsignedByte()/255,v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255,k=t.readUnsignedByte()/255;for(let S=0,E=0;w.setFrame(S,x,y,_,v,A,C,M,k),S!=p;S++){let R=t.readFloat(),T=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255,D=t.readUnsignedByte()/255,H=t.readUnsignedByte()/255,L=t.readUnsignedByte()/255,U=t.readUnsignedByte()/255;switch(t.readByte()){case ue:w.setStepped(S);break;case fe:J(t,w,E++,S,0,x,R,y,T,1),J(t,w,E++,S,1,x,R,_,I,1),J(t,w,E++,S,2,x,R,v,F,1),J(t,w,E++,S,3,x,R,A,D,1),J(t,w,E++,S,4,x,R,C,H,1),J(t,w,E++,S,5,x,R,M,L,1),J(t,w,E++,S,6,x,R,k,U,1)}x=R,y=T,_=I,v=F,A=D,C=H,M=L,k=U}i.push(w);break}case Em:{let b=t.readInt(!0),w=new Ll(g,b,d),x=t.readFloat(),y=t.readUnsignedByte()/255,_=t.readUnsignedByte()/255,v=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255;for(let k=0,S=0;w.setFrame(k,x,y,_,v,A,C,M),k!=p;k++){let E=t.readFloat(),R=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255,D=t.readUnsignedByte()/255,H=t.readUnsignedByte()/255;switch(t.readByte()){case ue:w.setStepped(k);break;case fe:J(t,w,S++,k,0,x,E,y,R,1),J(t,w,S++,k,1,x,E,_,T,1),J(t,w,S++,k,2,x,E,v,I,1),J(t,w,S++,k,3,x,E,A,F,1),J(t,w,S++,k,4,x,E,C,D,1),J(t,w,S++,k,5,x,E,M,H,1)}x=E,y=R,_=T,v=I,A=F,C=D,M=H}i.push(w);break}case Rm:{let b=new Yl(g,t.readInt(!0),d),w=t.readFloat(),x=t.readUnsignedByte()/255;for(let y=0,_=0;b.setFrame(y,w,x),y!=p;y++){let v=t.readFloat(),A=t.readUnsignedByte()/255;switch(t.readByte()){case ue:b.setStepped(y);break;case fe:J(t,b,_++,y,0,w,v,x,A,1)}w=v,x=A}i.push(b)}}}}for(let h=0,c=t.readInt(!0);h<c;h++){let d=t.readInt(!0);for(let f=0,u=t.readInt(!0);f<u;f++){let m=t.readByte(),g=t.readInt(!0);if(m==km){let b=new Rl(g,d);for(let w=0;w<g;w++)b.setFrame(w,t.readFloat(),t.readByte());i.push(b);continue}let p=t.readInt(!0);switch(m){case pm:i.push(Bt(t,new mi(g,p,d),1));break;case xm:i.push(ur(t,new Al(g,p,d),n));break;case ym:i.push(Bt(t,new Cl(g,p,d),n));break;case bm:i.push(Bt(t,new Sl(g,p,d),n));break;case wm:i.push(ur(t,new kl(g,p,d),1));break;case _m:i.push(Bt(t,new Ml(g,p,d),1));break;case vm:i.push(Bt(t,new Tl(g,p,d),1));break;case Am:i.push(ur(t,new Pl(g,p,d),1));break;case Cm:i.push(Bt(t,new Il(g,p,d),1));break;case Sm:i.push(Bt(t,new El(g,p,d),1))}}}for(let h=0,c=t.readInt(!0);h<c;h++){let d=t.readInt(!0),f=t.readInt(!0),u=f-1,m=new Ol(f,t.readInt(!0),d),g=t.readByte(),p=t.readFloat(),b=(g&1)!=0?(g&2)!=0?t.readFloat():1:0,w=(g&4)!=0?t.readFloat()*n:0;for(let x=0,y=0;
289m.setFrame(x,p,b,w,(g&8)!=0?1:-1,(g&16)!=0,(g&32)!=0),x!=u;x++){g=t.readByte();const _=t.readFloat(),v=(g&1)!=0?(g&2)!=0?t.readFloat():1:0,A=(g&4)!=0?t.readFloat()*n:0;(g&64)!=0?m.setStepped(x):(g&128)!=0&&(J(t,m,y++,x,0,p,_,b,v,1),J(t,m,y++,x,1,p,_,w,A,n)),p=_,b=v,w=A}i.push(m)}for(let h=0,c=t.readInt(!0);h<c;h++){let d=t.readInt(!0),f=t.readInt(!0),u=f-1,m=new Gl(f,t.readInt(!0),d),g=t.readFloat(),p=t.readFloat(),b=t.readFloat(),w=t.readFloat(),x=t.readFloat(),y=t.readFloat(),_=t.readFloat();for(let v=0,A=0;m.setFrame(v,g,p,b,w,x,y,_),v!=u;v++){let C=t.readFloat(),M=t.readFloat(),k=t.readFloat(),S=t.readFloat(),E=t.readFloat(),R=t.readFloat(),T=t.readFloat();switch(t.readByte()){case ue:m.setStepped(v);break;case fe:J(t,m,A++,v,0,g,C,p,M,1),J(t,m,A++,v,1,g,C,b,k,1),J(t,m,A++,v,2,g,C,w,S,1),J(t,m,A++,v,3,g,C,x,E,1),J(t,m,A++,v,4,g,C,y,R,1),J(t,m,A++,v,5,g,C,_,T,1)}g=C,p=M,b=k,w=S,x=E,y=R,_=T}i.push(m)}for(let h=0,c=t.readInt(!0);h<c;h++){let d=t.readInt(!0),f=s.pathConstraints[d];for(let u=0,m=t.readInt(!0);u<m;u++){const g=t.readByte(),p=t.readInt(!0),b=t.readInt(!0);switch(g){case Ym:i.push(Bt(t,new Nl(p,b,d),f.positionMode==ge.Fixed?n:1));break;case Dm:i.push(Bt(t,new Vl(p,b,d),f.spacingMode==Ct.Length||f.spacingMode==Ct.Fixed?n:1));break;case Lm:let w=new zl(p,b,d),x=t.readFloat(),y=t.readFloat(),_=t.readFloat(),v=t.readFloat();for(let A=0,C=0,M=w.getFrameCount()-1;w.setFrame(A,x,y,_,v),A!=M;A++){let k=t.readFloat(),S=t.readFloat(),E=t.readFloat(),R=t.readFloat();switch(t.readByte()){case ue:w.setStepped(A);break;case fe:J(t,w,C++,A,0,x,k,y,S,1),J(t,w,C++,A,1,x,k,_,E,1),J(t,w,C++,A,2,x,k,v,R,1)}x=k,y=S,_=E,v=R}i.push(w)}}}for(let h=0,c=t.readInt(!0);h<c;h++){const d=t.readInt(!0)-1;for(let f=0,u=t.readInt(!0);f<u;f++){const m=t.readByte(),g=t.readInt(!0);if(m==Wm){const b=new Si(g,d);for(let w=0;w<g;w++)b.setFrame(w,t.readFloat());i.push(b);continue}const p=t.readInt(!0);switch(m){case Xm:i.push(Bt(t,new Ul(g,p,d),1));break;case Om:i.push(Bt(t,new Wl(g,p,d),1));break;case Gm:i.push(Bt(t,new Hl(g,p,d),1));break;case Nm:i.push(Bt(t,new $l(g,p,d),1));break;case Vm:i.push(Bt(t,new ql(g,p,d),1));break;case zm:i.push(Bt(t,new jl(g,p,d),1));break;case Um:i.push(Bt(t,new Kl(g,p,d),1))}}}for(let h=0,c=t.readInt(!0);h<c;h++){let d=s.skins[t.readInt(!0)];for(let f=0,u=t.readInt(!0);f<u;f++){let m=t.readInt(!0);for(let g=0,p=t.readInt(!0);g<p;g++){let b=t.readStringRef();if(!b)throw new Error("attachmentName must not be null.");let w=d.getAttachment(m,b),x=t.readByte(),y=t.readInt(!0),_=y-1;switch(x){case Fm:{let v=w,A=v.bones,C=v.vertices,M=A?C.length/3*2:C.length,k=t.readInt(!0),S=new Xl(y,k,m,v),E=t.readFloat();for(let R=0,T=0;;R++){let I,F=t.readInt(!0);if(F==0)I=A?O.newFloatArray(M):C;else{I=O.newFloatArray(M);let H=t.readInt(!0);if(F+=H,n==1)for(let L=H;L<F;L++)I[L]=t.readFloat();else for(let L=H;L<F;L++)I[L]=t.readFloat()*n;if(!A)for(let L=0,U=I.length;L<U;L++)I[L]+=C[L]}if(S.setFrame(R,E,I),R==_)break;let D=t.readFloat();switch(t.readByte()){case ue:S.setStepped(R);break;case fe:J(t,S,T++,R,0,E,D,0,1,1)}E=D}i.push(S);break}case Bm:{let v=new me(y,m,w);for(let A=0;A<y;A++){let C=t.readFloat(),M=t.readInt32();v.setFrame(A,C,vl[M&15],M>>4,t.readFloat())}i.push(v);break}}}}}let o=t.readInt(!0);if(o>0){let h=new Ne(o),c=s.slots.length;for(let d=0;d<o;d++){let f=t.readFloat(),u=t.readInt(!0),m=O.newArray(c,0);for(let w=c-1;w>=0;w--)m[w]=-1;let g=O.newArray(c-u,0),p=0,b=0;for(let w=0;w<u;w++){let x=t.readInt(!0);for(;p!=x;)g[b++]=p++;m[p+t.readInt(!0)]=p++}for(;p<c;)g[b++]=p++;for(let w=c-1;w>=0;w--)m[w]==-1&&(m[w]=g[--b]);h.setFrame(d,f,m)}i.push(h)}let l=t.readInt(!0);if(l>0){let h=new zs(l);for(let c=0;c<l;c++){let d=t.readFloat(),f=s.events[t.readInt(!0)],u=new th(d,f);u.intValue=t.readInt(!1),u.floatValue=t.readFloat(),u.stringValue=t.readString(),u.stringValue==null&&(u.stringValue=f.stringValue),u.data.audioPath&&(u.volume=t.readFloat(),u.balance=t.readFloat()),h.setFrame
289(c,u)}i.push(h)}let a=0;for(let h=0,c=i.length;h<c;h++)a=Math.max(a,i[h].getDuration());return new Kr(e,i,a)}}class fm{strings;index;buffer;constructor(t,e=new Array,s=0,i=new DataView(t instanceof ArrayBuffer?t:t.buffer)){this.strings=e,this.index=s,this.buffer=i}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),s=e&127;return(e&128)!=0&&(e=this.readByte(),s|=(e&127)<<7,(e&128)!=0&&(e=this.readByte(),s|=(e&127)<<14,(e&128)!=0&&(e=this.readByte(),s|=(e&127)<<21,(e&128)!=0&&(e=this.readByte(),s|=(e&127)<<28)))),t?s:s>>>1^-(s&1)}readStringRef(){let t=this.readInt(!0);return t==0?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let s=0;s<t;){let i=this.readUnsignedByte();switch(i>>4){case 12:case 13:e+=String.fromCharCode((i&31)<<6|this.readByte()&63),s+=2;break;case 14:e+=String.fromCharCode((i&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:e+=String.fromCharCode(i),s++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return this.readByte()!=0}}let mm=class{parent;skinIndex;slotIndex;mesh;inheritTimeline;constructor(t,e,s,i,n){this.mesh=t,this.skinIndex=e,this.slotIndex=s,this.parent=i,this.inheritTimeline=n}};class gm{bones;vertices;length;constructor(t=null,e=null,s=0){this.bones=t,this.vertices=e,this.length=s}}var Ce;(function(r){r[r.Region=0]="Region",r[r.BoundingBox=1]="BoundingBox",r[r.Mesh=2]="Mesh",r[r.LinkedMesh=3]="LinkedMesh",r[r.Path=4]="Path",r[r.Point=5]="Point",r[r.Clipping=6]="Clipping"})(Ce||(Ce={}));function Bt(r,t,e){let s=r.readFloat(),i=r.readFloat()*e;for(let n=0,o=0,l=t.getFrameCount()-1;t.setFrame(n,s,i),n!=l;n++){let a=r.readFloat(),h=r.readFloat()*e;switch(r.readByte()){case ue:t.setStepped(n);break;case fe:J(r,t,o++,n,0,s,a,i,h,e)}s=a,i=h}return t}function ur(r,t,e){let s=r.readFloat(),i=r.readFloat()*e,n=r.readFloat()*e;for(let o=0,l=0,a=t.getFrameCount()-1;t.setFrame(o,s,i,n),o!=a;o++){let h=r.readFloat(),c=r.readFloat()*e,d=r.readFloat()*e;switch(r.readByte()){case ue:t.setStepped(o);break;case fe:J(r,t,l++,o,0,s,h,i,c,e),J(r,t,l++,o,1,s,h,n,d,e)}s=h,i=c,n=d}return t}function J(r,t,e,s,i,n,o,l,a,h){t.setBezier(e,s,i,n,l,r.readFloat(),r.readFloat()*h,r.readFloat(),r.readFloat()*h,o,a)}const pm=0,xm=1,ym=2,bm=3,wm=4,_m=5,vm=6,Am=7,Cm=8,Sm=9,km=10,Mm=0,Tm=1,Pm=2,Im=3,Em=4,Rm=5,Fm=0,Bm=1,Ym=0,Dm=1,Lm=2,Xm=0,Om=1,Gm=2,Nm=4,Vm=5,zm=6,Um=7,Wm=8,ue=1,fe=2;class Hm{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new Ns(()=>O.newFloatArray(16));update(t,e){if(!t)throw new Error("skeleton cannot be null.");let s=this.boundingBoxes,i=this.polygons,n=this.polygonPool,o=t.slots,l=o.length;s.length=0,n.freeAll(i),i.length=0;for(let a=0;a<l;a++){let h=o[a];if(!h.bone.active)continue;let c=h.getAttachment();if(c instanceof ki){let d=c;s.push(d);let f=n.obtain();f.length!=d.worldVerticesLength&&(f=O.newFloatArray(d.worldVerticesLength)),i.push(f),d.computeWorldVertices(h,0,d.worldVerticesLength,f,0,2)}}e?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=this.polygons;for(let o=0,l=n.length;o<l;o++){let a=n[o],h=a;for(let c=0,d=a.length;c<d;c+=2){let f=h[c],u=h[c+1];t=Math.min(t,f),e=Math.min(e,u),s=Math.max(s,f),i=Math.max(i,u)}}this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,s,i){let n=this.minX,o=this.minY,l=this.maxX,a=this.maxY;if(t<=n&&s<=n||e<=o&&i<=o||t>=l&&s>=l||e>=a&&i>=a)return!1;let h=(i-e)/(s-t),c=h*(n-t)+e;if(c>o&&c<a||(c=h*(l-t)+e,c>o&&c<a))return!0;let d=(o-e)/h+t;return d>n&&d<l||(d=(a-e)/h+t,d>n&&d<l)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let s=this.polygons;for(let i=0,n=s.length;i<n;i++)if(this.containsPointPolygon(s[i],t,e))return this.boundingBoxes[i];return null}containsPointPolygon(t,e,s){let i=t,n=t.length,o=n-2,l=!1;for(let a=0;a<n;a+=2){let h=i[a+1],c=i[o+1];if(h<s&&c>=s||c<s&&h>=s){let d=i[a];d+(s-h)/(c-h)*(i[o]-d)<e&&(l=!l)}o=a}return l}intersectsSegment(t,e,s,i){let n=this.polygons;for(let o=0,l=n.length;o<l;o++)if(this.intersectsSegmentPolygon(n[o],t,e,s,i))return this.boundingBoxes[o];return null}intersectsSegmentPolygon(t,e,s,i,n){let o=t,l=t.length,a=e-i,h=s-n,c=e*n-s*i,d=o[l-2],f=o[l-1];for(let u=0;u<l;u+=2){let m=o[u],g=o[u+1],p=d*g-f*m,b=d-m,w=f-g,x=a*w-h*b,y=(c*b-a*p)/x;if((y>=d&&y<=m||y>=m&&y<=d)&&(y>=e&&y<=i||y>=i&&y<=e)){let _=(c*w-h*p)/x;if((_>=f&&_<=g||_>=g&&_<=f)&&(_>=s&&_<=n||_>=n&&_<=s))return!0}d=m,f=g}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let 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 Vt{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new Ns(()=>new Array);polygonIndicesPool=new Ns(()=>new Array);triangulate(t){let e=t,s=t.length>>1,i=this.indicesArray;i.length=0;for(let l=0;l<s;l++)i[l]=l;let n=this.isConcaveArray;n.length=0;for(let l=0,a=s;l<a;++l)n[l]=Vt.isConcave(l,s,e,i);let o=this.triangles;for(o.length=0;s>3;){let l=s-1,a=0,h=1;for(;;){t:if(!n[a]){let f=i[l]<<1,u=i[a]<<1,m=i[h]<<1,g=e[f],p=e[f+1],b=e[u],w=e[u+1],x=e[m],y=e[m+1];for(let _=(h+1)%s;_!=l;
289_=(_+1)%s){if(!n[_])continue;let v=i[_]<<1,A=e[v],C=e[v+1];if(Vt.positiveArea(x,y,g,p,A,C)&&Vt.positiveArea(g,p,b,w,A,C)&&Vt.positiveArea(b,w,x,y,A,C))break t}break}if(h==0){do{if(!n[a])break;a--}while(a>0);break}l=a,a=h,h=(h+1)%s}o.push(i[(s+a-1)%s]),o.push(i[a]),o.push(i[(a+1)%s]),i.splice(a,1),n.splice(a,1),s--;let c=(s+a-1)%s,d=a==s?0:a;n[c]=Vt.isConcave(c,s,e,i),n[d]=Vt.isConcave(d,s,e,i)}return s==3&&(o.push(i[2]),o.push(i[0]),o.push(i[1])),o}decompose(t,e){let s=t,i=this.convexPolygons;this.polygonPool.freeAll(i),i.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let o=this.polygonIndicesPool.obtain();o.length=0;let l=this.polygonPool.obtain();l.length=0;let a=-1,h=0;for(let c=0,d=e.length;c<d;c+=3){let f=e[c]<<1,u=e[c+1]<<1,m=e[c+2]<<1,g=s[f],p=s[f+1],b=s[u],w=s[u+1],x=s[m],y=s[m+1],_=!1;if(a==f){let v=l.length-4,A=Vt.winding(l[v],l[v+1],l[v+2],l[v+3],x,y),C=Vt.winding(x,y,l[0],l[1],l[2],l[3]);A==h&&C==h&&(l.push(x),l.push(y),o.push(m),_=!0)}_||(l.length>0?(i.push(l),n.push(o)):(this.polygonPool.free(l),this.polygonIndicesPool.free(o)),l=this.polygonPool.obtain(),l.length=0,l.push(g),l.push(p),l.push(b),l.push(w),l.push(x),l.push(y),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(f),o.push(u),o.push(m),h=Vt.winding(g,p,b,w,x,y),a=f)}l.length>0&&(i.push(l),n.push(o));for(let c=0,d=i.length;c<d;c++){if(o=n[c],o.length==0)continue;let f=o[0],u=o[o.length-1];l=i[c];let m=l.length-4,g=l[m],p=l[m+1],b=l[m+2],w=l[m+3],x=l[0],y=l[1],_=l[2],v=l[3],A=Vt.winding(g,p,b,w,x,y);for(let C=0;C<d;C++){if(C==c)continue;let M=n[C];if(M.length!=3)continue;let k=M[0],S=M[1],E=M[2],R=i[C],T=R[R.length-2],I=R[R.length-1];if(k!=f||S!=u)continue;let F=Vt.winding(g,p,b,w,T,I),D=Vt.winding(T,I,x,y,_,v);F==A&&D==A&&(R.length=0,M.length=0,l.push(T),l.push(I),o.push(E),g=b,p=w,b=T,w=I,C=0)}}for(let c=i.length-1;c>=0;c--)l=i[c],l.length==0&&(i.splice(c,1),this.polygonPool.free(l),o=n[c],n.splice(c,1),this.polygonIndicesPool.free(o));return i}static isConcave(t,e,s,i){let n=i[(e+t-1)%e]<<1,o=i[t]<<1,l=i[(t+1)%e]<<1;return!this.positiveArea(s[n],s[n+1],s[o],s[o+1],s[l],s[l+1])}static positiveArea(t,e,s,i,n,o){return t*(o-i)+s*(e-o)+n*(i-e)>=0}static winding(t,e,s,i,n,o){let l=s-t,a=i-e;return n*a-o*l+l*e-t*a>=0?1:-1}}class pi{triangulator=new Vt;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedUVs=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let s=e.worldVerticesLength,i=O.setArraySize(this.clippingPolygon,s);e.computeWorldVertices(t,0,s,i,0,2);let n=this.clippingPolygon;pi.makeClockwise(n);let o=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let l=0,a=o.length;l<a;l++){let h=o[l];pi.makeClockwise(h),h.push(h[0]),h.push(h[1])}return o.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(t,e,s,i,n,o,l,a){let h,c,d,f,u,m;typeof e=="number"?(h=s,c=i,d=n,f=o,u=l,m=a):(h=e,c=s,d=i,f=n,u=o,m=l),d&&f&&u&&typeof m=="boolean"?this.clipTrianglesRender(t,h,c,d,f,u,m):this.clipTrianglesNoRender(t,h,c)}clipTrianglesNoRender(t,e,s){let i=this.clipOutput,n=this.clippedVertices,o=this.clippedTriangles,l=this.clippingPolygons,a=l.length,h=0;n.length=0,o.length=0;for(let c=0;c<s;c+=3){let d=e[c]<<1,f=t[d],u=t[d+1];d=e[c+1]<<1;let m=t[d],g=t[d+1];d=e[c+2]<<1;let p=t[d],b=t[d+1];for(let w=0;w<a;w++){let x=n.length;if(this.clip(f,u,m,g,p,b,l[w],i)){let y=i.length;if(y==0)continue;let _=y>>1,v=this.clipOutput,A=O.setArraySize(n,x+_*2);for(let M=0;M<y;M+=2,x+=2){let k=v[M],S=v[M+1];A[x]=k,A[x+1]=S}x=o.length;let C=O.setArraySize(o,x+3*(_-2));_--;for(let M=1;M<_;M++,x+=3)C[x]=h,C[x+1]=h+M,C[x+2]=h+M+1;h+=_+1}else{let y=O.setArraySize(n,x+6);y[x]=f,y[x+1]=u,y[x+2]=m,y[x+3]=g,y[x+4]=p,y[x+5]=b,x=o.length;let _=O.setArraySize(o,x+3);_[x]=h,_[x+1]=h+1,_[x+2]=h+2,h+=3;break}}}}clipTrianglesRender(t,e,s,i,n,o,l){let a=this.clipOutput,h=this.clippedVertices,c=this.clippedTriangles,d=this.clippingPolygons,f=d.length,u=l?12:8,m=0;h.length=0,c.length=0;for(let g=0;g<s;g+=3){let p=e[g]<<1,b=t[p],w=t[p+1],x=i[p],y=i[p+1];p=e[g+1]<<1;let _=t[p],v=t[p+1],A=i[p],C=i[p+1];p=e[g+2]<<1;let M=t[p],k=t[p+1],S=i[p],E=i[p+1];for(let R=0;R<f;R++){let T=h.length;if(this.clip(b,w,_,v,M,k,d[R],a)){let I=a.length;if(I==0)continue;let F=v-k,D=M-_,H=b-M,L=k-w,U=1/(F*H+D*(w-k)),j=I>>1,Z=this.clipOutput,N=O.setArraySize(h,T+j*u);for(let $=0;$<I;$+=2,T+=u){let ht=Z[$],_t=Z[$+1];N[T]=ht,N[T+1]=_t,N[T+2]=n.r,N[T+3]=n.g,N[T+4]=n.b,N[T+5]=n.a;let rt=ht-M,nt=_t-k,dt=(F*rt+D*nt)*U,vt=(L*rt+H*nt)*U,Rt=1-dt-vt;N[T+6]=x*dt+A*vt+S*Rt,N[T+7]=y*dt+C*vt+E*Rt,l&&(N[T+8]=o.r,N[T+9]=o.g,N[T+10]=o.b,N[T+11]=o.a)}T=c.length;let q=O.setArraySize(c,T+3*(j-2));j--;for(let $=1;$<j;$++,T+=3)q[T]=m,q[T+1]=m+$,q[T+2]=m+$+1;m+=j+1}
289else{let I=O.setArraySize(h,T+3*u);I[T]=b,I[T+1]=w,I[T+2]=n.r,I[T+3]=n.g,I[T+4]=n.b,I[T+5]=n.a,l?(I[T+6]=x,I[T+7]=y,I[T+8]=o.r,I[T+9]=o.g,I[T+10]=o.b,I[T+11]=o.a,I[T+12]=_,I[T+13]=v,I[T+14]=n.r,I[T+15]=n.g,I[T+16]=n.b,I[T+17]=n.a,I[T+18]=A,I[T+19]=C,I[T+20]=o.r,I[T+21]=o.g,I[T+22]=o.b,I[T+23]=o.a,I[T+24]=M,I[T+25]=k,I[T+26]=n.r,I[T+27]=n.g,I[T+28]=n.b,I[T+29]=n.a,I[T+30]=S,I[T+31]=E,I[T+32]=o.r,I[T+33]=o.g,I[T+34]=o.b,I[T+35]=o.a):(I[T+6]=x,I[T+7]=y,I[T+8]=_,I[T+9]=v,I[T+10]=n.r,I[T+11]=n.g,I[T+12]=n.b,I[T+13]=n.a,I[T+14]=A,I[T+15]=C,I[T+16]=M,I[T+17]=k,I[T+18]=n.r,I[T+19]=n.g,I[T+20]=n.b,I[T+21]=n.a,I[T+22]=S,I[T+23]=E),T=c.length;let F=O.setArraySize(c,T+3);F[T]=m,F[T+1]=m+1,F[T+2]=m+2,m+=3;break}}}}clipTrianglesUnpacked(t,e,s,i){let n=this.clipOutput,o=this.clippedVertices,l=this.clippedUVs,a=this.clippedTriangles,h=this.clippingPolygons,c=h.length,d=0;o.length=0,l.length=0,a.length=0;for(let f=0;f<s;f+=3){let u=e[f]<<1,m=t[u],g=t[u+1],p=i[u],b=i[u+1];u=e[f+1]<<1;let w=t[u],x=t[u+1],y=i[u],_=i[u+1];u=e[f+2]<<1;let v=t[u],A=t[u+1],C=i[u],M=i[u+1];for(let k=0;k<c;k++){let S=o.length;if(this.clip(m,g,w,x,v,A,h[k],n)){let E=n.length;if(E==0)continue;let R=x-A,T=v-w,I=m-v,F=A-g,D=1/(R*I+T*(g-A)),H=E>>1,L=this.clipOutput,U=O.setArraySize(o,S+H*2),j=O.setArraySize(l,S+H*2);for(let N=0;N<E;N+=2,S+=2){let q=L[N],$=L[N+1];U[S]=q,U[S+1]=$;let ht=q-v,_t=$-A,rt=(R*ht+T*_t)*D,nt=(F*ht+I*_t)*D,dt=1-rt-nt;j[S]=p*rt+y*nt+C*dt,j[S+1]=b*rt+_*nt+M*dt}S=a.length;let Z=O.setArraySize(a,S+3*(H-2));H--;for(let N=1;N<H;N++,S+=3)Z[S]=d,Z[S+1]=d+N,Z[S+2]=d+N+1;d+=H+1}else{let E=O.setArraySize(o,S+6);E[S]=m,E[S+1]=g,E[S+2]=w,E[S+3]=x,E[S+4]=v,E[S+5]=A;let R=O.setArraySize(l,S+6);R[S]=p,R[S+1]=b,R[S+2]=y,R[S+3]=_,R[S+4]=C,R[S+5]=M,S=a.length;let T=O.setArraySize(a,S+3);T[S]=d,T[S+1]=d+1,T[S+2]=d+2,d+=3;break}}}}clip(t,e,s,i,n,o,l,a){let h=a,c=!1,d;l.length%4>=2?(d=a,a=this.scratch):d=this.scratch,d.length=0,d.push(t),d.push(e),d.push(s),d.push(i),d.push(n),d.push(o),d.push(t),d.push(e),a.length=0;let f=l.length-4,u=l;for(let m=0;;m+=2){let g=u[m],p=u[m+1],b=g-u[m+2],w=p-u[m+3],x=a.length,y=d;for(let v=0,A=d.length-2;v<A;){let C=y[v],M=y[v+1];v+=2;let k=y[v],S=y[v+1],E=w*(g-k)>b*(p-S),R=w*(g-C)-b*(p-M);if(R>0){if(E){a.push(k),a.push(S);continue}let T=k-C,I=S-M,F=R/(T*w-I*b);if(F>=0&&F<=1)a.push(C+T*F),a.push(M+I*F);else{a.push(k),a.push(S);continue}}else if(E){let T=k-C,I=S-M,F=R/(T*w-I*b);if(F>=0&&F<=1)a.push(C+T*F),a.push(M+I*F),a.push(k),a.push(S);else{a.push(k),a.push(S);continue}}c=!0}if(x==a.length)return h.length=0,!0;if(a.push(a[0]),a.push(a[1]),m==f)break;let _=a;a=d,a.length=0,d=_}if(h!=a){h.length=0;for(let m=0,g=a.length-2;m<g;m++)h[m]=a[m]}else h.length=h.length-2;return c}static makeClockwise(t){let e=t,s=t.length,i=e[s-2]*e[1]-e[0]*e[s-1],n=0,o=0,l=0,a=0;for(let h=0,c=s-3;h<c;h+=2)n=e[h],o=e[h+1],l=e[h+2],a=e[h+3],i+=n*a-l*o;if(!(i<0))for(let h=0,c=s-2,d=s>>1;h<d;h+=2){let f=e[h],u=e[h+1],m=c-h;e[h]=e[m],e[h+1]=e[m+1],e[m]=f,e[m+1]=u}}}class $m{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(t){this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,s=new gi,i=typeof t=="string"?JSON.parse(t):t,n=i.skeleton;if(n&&(s.hash=n.hash,s.version=n.spine,s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height,s.referenceScale=P(n,"referenceScale",100)*e,s.fps=n.fps,s.imagesPath=n.images??null,s.audioPath=n.audio??null),i.bones)for(let o=0;o<i.bones.length;o++){let l=i.bones[o],a=null,h=P(l,"parent",null);h&&(a=s.findBone(h));let c=new Jl(s.bones.length,l.name,a);c.length=P(l,"length",0)*e,c.x=P(l,"x",0)*e,c.y=P(l,"y",0)*e,c.rotation=P(l,"rotation",0),c.scaleX=P(l,"scaleX",1),c.scaleY=P(l,"scaleY",1),c.shearX=P(l,"shearX",0),c.shearY=P(l,"shearY",0),c.inherit=O.enumValue(ut,P(l,"inherit","Normal")),c.skinRequired=P(l,"skin",!1);let d=P(l,"color",null);d&&c.color.setFromString(d),s.bones.push(c)}if(i.slots)for(let o=0;o<i.slots.length;o++){let l=i.slots[o],a=l.name,h=s.findBone(l.bone);if(!h)throw new Error(`Couldn't find bone ${l.bone} for slot ${a}`);let c=new nh(s.slots.length,a,h),d=P(l,"color",null);d&&c.color.setFromString(d);let f=P(l,"dark",null);f&&(c.darkColor=W.fromString(f)),c.attachmentName=P(l,"attachment",null),c.blendMode=O.enumValue(Fe,P(l,"blend","normal")),c.visible=P(l,"visible",!0),s.slots.push(c)}if(i.ik)for(let o=0;o<i.ik.length;o++){let l=i.ik[o],a=new sh(l.name);a.order=P(l,"order",0),a.skinRequired=P(l,"skin",!1);for(let c=0;c<l.bones.length;c++){let d=s.findBone(l.bones[c]);if(!d)throw new Error(`Couldn't find bone ${l.bones[c]} for IK constraint ${l.name}.`);a.bones.push(d)}let h=s.findBone(l.target);if(!h)throw new Error(`Couldn't find target bone ${l.target} for IK constraint ${l.name}.`);a.target=h,a.mix=P(l,"mix",1),a.softness=P(l,"softness",0)*e,a.bendDirection=P(l,"bendPositive",!0)?1:-1,a.compress=P(l,"compress",!1),a.stretch=P(l,"stretch",!1),a.uniform=P(l,"uniform",!1),s.ikConstraints.push(a)}if(i.transform)for(let o=0;o<i.transform.length;
289o++){let l=i.transform[o],a=new ah(l.name);a.order=P(l,"order",0),a.skinRequired=P(l,"skin",!1);for(let d=0;d<l.bones.length;d++){let f=l.bones[d],u=s.findBone(f);if(!u)throw new Error(`Couldn't find bone ${f} for transform constraint ${l.name}.`);a.bones.push(u)}let h=l.target,c=s.findBone(h);if(!c)throw new Error(`Couldn't find target bone ${h} for transform constraint ${l.name}.`);a.target=c,a.local=P(l,"local",!1),a.relative=P(l,"relative",!1),a.offsetRotation=P(l,"rotation",0),a.offsetX=P(l,"x",0)*e,a.offsetY=P(l,"y",0)*e,a.offsetScaleX=P(l,"scaleX",0),a.offsetScaleY=P(l,"scaleY",0),a.offsetShearY=P(l,"shearY",0),a.mixRotate=P(l,"mixRotate",1),a.mixX=P(l,"mixX",1),a.mixY=P(l,"mixY",a.mixX),a.mixScaleX=P(l,"mixScaleX",1),a.mixScaleY=P(l,"mixScaleY",a.mixScaleX),a.mixShearY=P(l,"mixShearY",1),s.transformConstraints.push(a)}if(i.path)for(let o=0;o<i.path.length;o++){let l=i.path[o],a=new ih(l.name);a.order=P(l,"order",0),a.skinRequired=P(l,"skin",!1);for(let d=0;d<l.bones.length;d++){let f=l.bones[d],u=s.findBone(f);if(!u)throw new Error(`Couldn't find bone ${f} for path constraint ${l.name}.`);a.bones.push(u)}let h=l.target,c=s.findSlot(h);if(!c)throw new Error(`Couldn't find target slot ${h} for path constraint ${l.name}.`);a.target=c,a.positionMode=O.enumValue(ge,P(l,"positionMode","Percent")),a.spacingMode=O.enumValue(Ct,P(l,"spacingMode","Length")),a.rotateMode=O.enumValue(ze,P(l,"rotateMode","Tangent")),a.offsetRotation=P(l,"rotation",0),a.position=P(l,"position",0),a.positionMode==ge.Fixed&&(a.position*=e),a.spacing=P(l,"spacing",0),(a.spacingMode==Ct.Length||a.spacingMode==Ct.Fixed)&&(a.spacing*=e),a.mixRotate=P(l,"mixRotate",1),a.mixX=P(l,"mixX",1),a.mixY=P(l,"mixY",a.mixX),s.pathConstraints.push(a)}if(i.physics)for(let o=0;o<i.physics.length;o++){const l=i.physics[o],a=new rh(l.name);a.order=P(l,"order",0),a.skinRequired=P(l,"skin",!1);const h=l.bone,c=s.findBone(h);if(c==null)throw new Error("Physics bone not found: "+h);a.bone=c,a.x=P(l,"x",0),a.y=P(l,"y",0),a.rotate=P(l,"rotate",0),a.scaleX=P(l,"scaleX",0),a.shearX=P(l,"shearX",0),a.limit=P(l,"limit",5e3)*e,a.step=1/P(l,"fps",60),a.inertia=P(l,"inertia",1),a.strength=P(l,"strength",100),a.damping=P(l,"damping",1),a.massInverse=1/P(l,"mass",1),a.wind=P(l,"wind",0),a.gravity=P(l,"gravity",0),a.mix=P(l,"mix",1),a.inertiaGlobal=P(l,"inertiaGlobal",!1),a.strengthGlobal=P(l,"strengthGlobal",!1),a.dampingGlobal=P(l,"dampingGlobal",!1),a.massGlobal=P(l,"massGlobal",!1),a.windGlobal=P(l,"windGlobal",!1),a.gravityGlobal=P(l,"gravityGlobal",!1),a.mixGlobal=P(l,"mixGlobal",!1),s.physicsConstraints.push(a)}if(i.skins)for(let o=0;o<i.skins.length;o++){let l=i.skins[o],a=new Fr(l.name);if(l.bones)for(let h=0;h<l.bones.length;h++){let c=l.bones[h],d=s.findBone(c);if(!d)throw new Error(`Couldn't find bone ${c} for skin ${l.name}.`);a.bones.push(d)}if(l.ik)for(let h=0;h<l.ik.length;h++){let c=l.ik[h],d=s.findIkConstraint(c);if(!d)throw new Error(`Couldn't find IK constraint ${c} for skin ${l.name}.`);a.constraints.push(d)}if(l.transform)for(let h=0;h<l.transform.length;h++){let c=l.transform[h],d=s.findTransformConstraint(c);if(!d)throw new Error(`Couldn't find transform constraint ${c} for skin ${l.name}.`);a.constraints.push(d)}if(l.path)for(let h=0;h<l.path.length;h++){let c=l.path[h],d=s.findPathConstraint(c);if(!d)throw new Error(`Couldn't find path constraint ${c} for skin ${l.name}.`);a.constraints.push(d)}if(l.physics)for(let h=0;h<l.physics.length;h++){let c=l.physics[h],d=s.findPhysicsConstraint(c);if(!d)throw new Error(`Couldn't find physics constraint ${c} for skin ${l.name}.`);a.constraints.push(d)}for(let h in l.attachments){let c=s.findSlot(h);if(!c)throw new Error(`Couldn't find slot ${h} for skin ${l.name}.`);let d=l.attachments[h];for(let f in d){let u=this.readAttachment(d[f],a,c.index,f,s);u&&a.setAttachment(c.index,f,u)}}s.skins.push(a),a.name=="default"&&(s.defaultSkin=a)}for(let o=0,l=this.linkedMeshes.length;o<l;o++){let a=this.linkedMeshes[o],h=a.skin?s.findSkin(a.skin):s.defaultSkin;if(!h)throw new Error(`Skin not found: ${a.skin}`);let c=h.getAttachment(a.slotIndex,a.parent);if(!c)throw new Error(`Parent mesh not found: ${a.parent}`);a.mesh.timelineAttachment=a.inheritTimeline?c:a.mesh,a.mesh.setParentMesh(c),a.mesh.region!=null&&a.mesh.updateRegion()}if(this.linkedMeshes.length=0,i.events)for(let o in i.events){let l=i.events[o],a=new eh(o);a.intValue=P(l,"int",0),a.floatValue=P(l,"float",0),a.stringValue=P(l,"string",""),a.audioPath=P(l,"audio",null),a.audioPath&&(a.volume=P(l,"volume",1),a.balance=P(l,"balance",0)),s.events.push(a)}if(i.animations)for(let o in i.animations){let l=i.animations[o];this.readAnimation(l,o,s)}return s}readAttachment(t,e,s,i,n){let o=this.scale;switch(i=P(t,"name",i),P(t,"type","region")){case"region":{let l=P(t,"path",i),a=this.readSequence(P(t,"sequence",null)),h=this.attachmentLoader.newRegionAttachment(e,i,l,a);if(!h)return null;h.path=l,h.x=P(t,"x",0)*o,h.y=P(t,"y",0)*o,h.scaleX=P(t,"scaleX",1),h.scaleY=P(t,"scaleY",1),h.rotation=P(t,"rotation",0),h.width=t.width*o,h.height=t.height*o,h.sequence=a;let c=P(t,"color",null);return c&&h.color.setFromString(c),h.region!=null&&h.updateRegion(),h}
289case"boundingbox":{let l=this.attachmentLoader.newBoundingBoxAttachment(e,i);if(!l)return null;this.readVertices(t,l,t.vertexCount<<1);let a=P(t,"color",null);return a&&l.color.setFromString(a),l}case"mesh":case"linkedmesh":{let l=P(t,"path",i),a=this.readSequence(P(t,"sequence",null)),h=this.attachmentLoader.newMeshAttachment(e,i,l,a);if(!h)return null;h.path=l;let c=P(t,"color",null);c&&h.color.setFromString(c),h.width=P(t,"width",0)*o,h.height=P(t,"height",0)*o,h.sequence=a;let d=P(t,"parent",null);if(d)return this.linkedMeshes.push(new qm(h,P(t,"skin",null),s,d,P(t,"timelines",!0))),h;let f=t.uvs;return this.readVertices(t,h,f.length),h.triangles=t.triangles,h.regionUVs=f,h.region!=null&&h.updateRegion(),h.edges=P(t,"edges",null),h.hullLength=P(t,"hull",0)*2,h}case"path":{let l=this.attachmentLoader.newPathAttachment(e,i);if(!l)return null;l.closed=P(t,"closed",!1),l.constantSpeed=P(t,"constantSpeed",!0);let a=t.vertexCount;this.readVertices(t,l,a<<1);let h=O.newArray(a/3,0);for(let d=0;d<t.lengths.length;d++)h[d]=t.lengths[d]*o;l.lengths=h;let c=P(t,"color",null);return c&&l.color.setFromString(c),l}case"point":{let l=this.attachmentLoader.newPointAttachment(e,i);if(!l)return null;l.x=P(t,"x",0)*o,l.y=P(t,"y",0)*o,l.rotation=P(t,"rotation",0);let a=P(t,"color",null);return a&&l.color.setFromString(a),l}case"clipping":{let l=this.attachmentLoader.newClippingAttachment(e,i);if(!l)return null;let a=P(t,"end",null);a&&(l.endSlot=n.findSlot(a));let h=t.vertexCount;this.readVertices(t,l,h<<1);let c=P(t,"color",null);return c&&l.color.setFromString(c),l}}return null}readSequence(t){if(t==null)return null;let e=new cs(P(t,"count",0));return e.start=P(t,"start",1),e.digits=P(t,"digits",0),e.setupIndex=P(t,"setup",0),e}readVertices(t,e,s){let i=this.scale;e.worldVerticesLength=s;let n=t.vertices;if(s==n.length){let a=O.toFloatArray(n);if(i!=1)for(let h=0,c=n.length;h<c;h++)a[h]*=i;e.vertices=a;return}let o=new Array,l=new Array;for(let a=0,h=n.length;a<h;){let c=n[a++];l.push(c);for(let d=a+c*4;a<d;a+=4)l.push(n[a]),o.push(n[a+1]*i),o.push(n[a+2]*i),o.push(n[a+3])}e.bones=l,e.vertices=O.toFloatArray(o)}readAnimation(t,e,s){let i=this.scale,n=new Array;if(t.slots)for(let l in t.slots){let a=t.slots[l],h=s.findSlot(l);if(!h)throw new Error("Slot not found: "+l);let c=h.index;for(let d in a){let f=a[d];if(!f)continue;let u=f.length;if(d=="attachment"){let m=new ns(u,c);for(let g=0;g<u;g++){let p=f[g];m.setFrame(g,P(p,"time",0),P(p,"name",null))}n.push(m)}else if(d=="rgba"){let m=new Fl(u,u<<2,c),g=f[0],p=P(g,"time",0),b=W.fromString(g.color);for(let w=0,x=0;;w++){m.setFrame(w,p,b.r,b.g,b.b,b.a);let y=f[w+1];if(!y){m.shrink(x);break}let _=P(y,"time",0),v=W.fromString(y.color),A=g.curve;A&&(x=et(A,m,x,w,0,p,_,b.r,v.r,1),x=et(A,m,x,w,1,p,_,b.g,v.g,1),x=et(A,m,x,w,2,p,_,b.b,v.b,1),x=et(A,m,x,w,3,p,_,b.a,v.a,1)),p=_,b=v,g=y}n.push(m)}else if(d=="rgb"){let m=new Bl(u,u*3,c),g=f[0],p=P(g,"time",0),b=W.fromString(g.color);for(let w=0,x=0;;w++){m.setFrame(w,p,b.r,b.g,b.b);let y=f[w+1];if(!y){m.shrink(x);break}let _=P(y,"time",0),v=W.fromString(y.color),A=g.curve;A&&(x=et(A,m,x,w,0,p,_,b.r,v.r,1),x=et(A,m,x,w,1,p,_,b.g,v.g,1),x=et(A,m,x,w,2,p,_,b.b,v.b,1)),p=_,b=v,g=y}n.push(m)}else if(d=="alpha")n.push(Jt(f,new Yl(u,u,c),0,1));else if(d=="rgba2"){let m=new Dl(u,u*7,c),g=f[0],p=P(g,"time",0),b=W.fromString(g.light),w=W.fromString(g.dark);for(let x=0,y=0;;x++){m.setFrame(x,p,b.r,b.g,b.b,b.a,w.r,w.g,w.b);let _=f[x+1];if(!_){m.shrink(y);break}let v=P(_,"time",0),A=W.fromString(_.light),C=W.fromString(_.dark),M=g.curve;M&&(y=et(M,m,y,x,0,p,v,b.r,A.r,1),y=et(M,m,y,x,1,p,v,b.g,A.g,1),y=et(M,m,y,x,2,p,v,b.b,A.b,1),y=et(M,m,y,x,3,p,v,b.a,A.a,1),y=et(M,m,y,x,4,p,v,w.r,C.r,1),y=et(M,m,y,x,5,p,v,w.g,C.g,1),y=et(M,m,y,x,6,p,v,w.b,C.b,1)),p=v,b=A,w=C,g=_}n.push(m)}else if(d=="rgb2"){let m=new Ll(u,u*6,c),g=f[0],p=P(g,"time",0),b=W.fromString(g.light),w=W.fromString(g.dark);for(let x=0,y=0;;x++){m.setFrame(x,p,b.r,b.g,b.b,w.r,w.g,w.b);let _=f[x+1];if(!_){m.shrink(y);break}let v=P(_,"time",0),A=W.fromString(_.light),C=W.fromString(_.dark),M=g.curve;M&&(y=et(M,m,y,x,0,p,v,b.r,A.r,1),y=et(M,m,y,x,1,p,v,b.g,A.g,1),y=et(M,m,y,x,2,p,v,b.b,A.b,1),y=et(M,m,y,x,3,p,v,w.r,C.r,1),y=et(M,m,y,x,4,p,v,w.g,C.g,1),y=et(M,m,y,x,5,p,v,w.b,C.b,1)),p=v,b=A,w=C,g=_}n.push(m)}}}if(t.bones)for(let l in t.bones){let a=t.bones[l],h=s.findBone(l);if(!h)throw new Error("Bone not found: "+l);let c=h.index;for(let d in a){let f=a[d],u=f.length;if(u!=0){if(d==="rotate")n.push(Jt(f,new mi(u,u,c),0,1));else if(d==="translate"){let m=new Al(u,u<<1,c);n.push(fr(f,m,"x","y",0,i))}else if(d==="translatex"){let m=new Cl(u,u,c);n.push(Jt(f,m,0,i))}else if(d==="translatey"){let m=new Sl(u,u,c);n.push(Jt(f,m,0,i))}else if(d==="scale"){let m=new kl(u,u<<1,c);n.push(fr(f,m,"x","y",1,1))}else if(d==="scalex"){let m=new Ml(u,u,c);n.push(Jt(f,m,1,1))}else if(d==="scaley"){let m=new Tl(u,u,c);n.push(Jt(f,m,1,1))}else if(d==="shear"){let m=new Pl(u,u<<1,c);n.push(fr(f,m,"x","y",0,1))}else if(d==="shearx"){let m=new Il(u,u,c);n.push(Jt(f,m,0,1))}else if(d==="sheary"){let m=new El(u,u,c);n.push(Jt(f,m,0,1))}else if(d==="inherit"){let m=new Rl(u,h.index);for(let g=0;g<f.length;g++){let p=f[g];
289m.setFrame(g,P(p,"time",0),O.enumValue(ut,P(p,"inherit","Normal")))}n.push(m)}}}}if(t.ik)for(let l in t.ik){let a=t.ik[l],h=a[0];if(!h)continue;let c=s.findIkConstraint(l);if(!c)throw new Error("IK Constraint not found: "+l);let d=s.ikConstraints.indexOf(c),f=new Ol(a.length,a.length<<1,d),u=P(h,"time",0),m=P(h,"mix",1),g=P(h,"softness",0)*i;for(let p=0,b=0;;p++){f.setFrame(p,u,m,g,P(h,"bendPositive",!0)?1:-1,P(h,"compress",!1),P(h,"stretch",!1));let w=a[p+1];if(!w){f.shrink(b);break}let x=P(w,"time",0),y=P(w,"mix",1),_=P(w,"softness",0)*i,v=h.curve;v&&(b=et(v,f,b,p,0,u,x,m,y,1),b=et(v,f,b,p,1,u,x,g,_,i)),u=x,m=y,g=_,h=w}n.push(f)}if(t.transform)for(let l in t.transform){let a=t.transform[l],h=a[0];if(!h)continue;let c=s.findTransformConstraint(l);if(!c)throw new Error("Transform constraint not found: "+l);let d=s.transformConstraints.indexOf(c),f=new Gl(a.length,a.length*6,d),u=P(h,"time",0),m=P(h,"mixRotate",1),g=P(h,"mixX",1),p=P(h,"mixY",g),b=P(h,"mixScaleX",1),w=P(h,"mixScaleY",b),x=P(h,"mixShearY",1);for(let y=0,_=0;;y++){f.setFrame(y,u,m,g,p,b,w,x);let v=a[y+1];if(!v){f.shrink(_);break}let A=P(v,"time",0),C=P(v,"mixRotate",1),M=P(v,"mixX",1),k=P(v,"mixY",M),S=P(v,"mixScaleX",1),E=P(v,"mixScaleY",S),R=P(v,"mixShearY",1),T=h.curve;T&&(_=et(T,f,_,y,0,u,A,m,C,1),_=et(T,f,_,y,1,u,A,g,M,1),_=et(T,f,_,y,2,u,A,p,k,1),_=et(T,f,_,y,3,u,A,b,S,1),_=et(T,f,_,y,4,u,A,w,E,1),_=et(T,f,_,y,5,u,A,x,R,1)),u=A,m=C,g=M,p=k,b=S,w=E,b=S,h=v}n.push(f)}if(t.path)for(let l in t.path){let a=t.path[l],h=s.findPathConstraint(l);if(!h)throw new Error("Path constraint not found: "+l);let c=s.pathConstraints.indexOf(h);for(let d in a){let f=a[d],u=f[0];if(!u)continue;let m=f.length;if(d==="position"){let g=new Nl(m,m,c);n.push(Jt(f,g,0,h.positionMode==ge.Fixed?i:1))}else if(d==="spacing"){let g=new Vl(m,m,c);n.push(Jt(f,g,0,h.spacingMode==Ct.Length||h.spacingMode==Ct.Fixed?i:1))}else if(d==="mix"){let g=new zl(m,m*3,c),p=P(u,"time",0),b=P(u,"mixRotate",1),w=P(u,"mixX",1),x=P(u,"mixY",w);for(let y=0,_=0;;y++){g.setFrame(y,p,b,w,x);let v=f[y+1];if(!v){g.shrink(_);break}let A=P(v,"time",0),C=P(v,"mixRotate",1),M=P(v,"mixX",1),k=P(v,"mixY",M),S=u.curve;S&&(_=et(S,g,_,y,0,p,A,b,C,1),_=et(S,g,_,y,1,p,A,w,M,1),_=et(S,g,_,y,2,p,A,x,k,1)),p=A,b=C,w=M,x=k,u=v}n.push(g)}}}if(t.physics)for(let l in t.physics){let a=t.physics[l],h=-1;if(l.length>0){let c=s.findPhysicsConstraint(l);if(!c)throw new Error("Physics constraint not found: "+l);h=s.physicsConstraints.indexOf(c)}for(let c in a){let d=a[c],f=d[0];if(!f)continue;let u=d.length;if(c=="reset"){const g=new Si(u,h);for(let p=0;f!=null;f=d[p+1],p++)g.setFrame(p,P(f,"time",0));n.push(g);continue}let m;if(c=="inertia")m=new Ul(u,u,h);else if(c=="strength")m=new Wl(u,u,h);else if(c=="damping")m=new Hl(u,u,h);else if(c=="mass")m=new $l(u,u,h);else if(c=="wind")m=new ql(u,u,h);else if(c=="gravity")m=new jl(u,u,h);else if(c=="mix")m=new Kl(u,u,h);else continue;n.push(Jt(d,m,0,1))}}if(t.attachments)for(let l in t.attachments){let a=t.attachments[l],h=s.findSkin(l);if(!h)throw new Error("Skin not found: "+l);for(let c in a){let d=a[c],f=s.findSlot(c);if(!f)throw new Error("Slot not found: "+c);let u=f.index;for(let m in d){let g=d[m],p=h.getAttachment(u,m);for(let b in g){let w=g[b],x=w[0];if(x){if(b=="deform"){let y=p.bones,_=p.vertices,v=y?_.length/3*2:_.length,A=new Xl(w.length,w.length,u,p),C=P(x,"time",0);for(let M=0,k=0;;M++){let S,E=P(x,"vertices",null);if(!E)S=y?O.newFloatArray(v):_;else{S=O.newFloatArray(v);let F=P(x,"offset",0);if(O.arrayCopy(E,0,S,F,E.length),i!=1)for(let D=F,H=D+E.length;D<H;D++)S[D]*=i;if(!y)for(let D=0;D<v;D++)S[D]+=_[D]}A.setFrame(M,C,S);let R=w[M+1];if(!R){A.shrink(k);break}let T=P(R,"time",0),I=x.curve;I&&(k=et(I,A,k,M,0,C,T,0,1,1)),C=T,x=R}n.push(A)}else if(b=="sequence"){let y=new me(w.length,u,p),_=0;for(let v=0;v<w.length;v++){let A=P(x,"delay",_),C=P(x,"time",0),M=It[P(x,"mode","hold")],k=P(x,"index",0);y.setFrame(v,C,M,k,A),_=A,x=w[v+1]}n.push(y)}}}}}}if(t.drawOrder){let l=new Ne(t.drawOrder.length),a=s.slots.length,h=0;for(let c=0;c<t.drawOrder.length;c++,h++){let d=t.drawOrder[c],f=null,u=P(d,"offsets",null);if(u){f=O.newArray(a,-1);let m=O.newArray(a-u.length,0),g=0,p=0;for(let b=0;b<u.length;b++){let w=u[b],x=s.findSlot(w.slot);if(!x)throw new Error("Slot not found: "+x);let y=x.index;for(;g!=y;)m[p++]=g++;f[g+w.offset]=g++}for(;g<a;)m[p++]=g++;for(let b=a-1;b>=0;b--)f[b]==-1&&(f[b]=m[--p])}
289l.setFrame(h,P(d,"time",0),f)}n.push(l)}if(t.events){let l=new zs(t.events.length),a=0;for(let h=0;h<t.events.length;h++,a++){let c=t.events[h],d=s.findEvent(c.name);if(!d)throw new Error("Event not found: "+c.name);let f=new th(O.toSinglePrecision(P(c,"time",0)),d);f.intValue=P(c,"int",d.intValue),f.floatValue=P(c,"float",d.floatValue),f.stringValue=P(c,"string",d.stringValue),f.data.audioPath&&(f.volume=P(c,"volume",1),f.balance=P(c,"balance",0)),l.setFrame(a,f)}n.push(l)}let o=0;for(let l=0,a=n.length;l<a;l++)o=Math.max(o,n[l].getDuration());s.animations.push(new Kr(e,n,o))}}class qm{parent;skin;slotIndex;mesh;inheritTimeline;constructor(t,e,s,i,n){this.mesh=t,this.skin=e,this.slotIndex=s,this.parent=i,this.inheritTimeline=n}}function Jt(r,t,e,s){let i=r[0],n=P(i,"time",0),o=P(i,"value",e)*s,l=0;for(let a=0;;a++){t.setFrame(a,n,o);let h=r[a+1];if(!h)return t.shrink(l),t;let c=P(h,"time",0),d=P(h,"value",e)*s;i.curve&&(l=et(i.curve,t,l,a,0,n,c,o,d,s)),n=c,o=d,i=h}}function fr(r,t,e,s,i,n){let o=r[0],l=P(o,"time",0),a=P(o,e,i)*n,h=P(o,s,i)*n,c=0;for(let d=0;;d++){t.setFrame(d,l,a,h);let f=r[d+1];if(!f)return t.shrink(c),t;let u=P(f,"time",0),m=P(f,e,i)*n,g=P(f,s,i)*n,p=o.curve;p&&(c=et(p,t,c,d,0,l,u,a,m,n),c=et(p,t,c,d,1,l,u,h,g,n)),l=u,a=m,h=g,o=f}}function et(r,t,e,s,i,n,o,l,a,h){if(r=="stepped")return t.setStepped(s),e;let c=i<<2,d=r[c],f=r[c+1]*h,u=r[c+2],m=r[c+3]*h;return t.setBezier(e,s,i,n,l,d,f,u,m,o,a),e+1}function P(r,t,e){return r[t]!==void 0?r[t]:e}typeof Math.fround>"u"&&(Math.fround=(function(r){return function(t){return r[0]=t,r[0]}})(new Float32Array(1)));class te extends rm{static textureMap=new Map;static from(t){return te.textureMap.has(t)?te.textureMap.get(t):new te(t)}texture;constructor(t){super(t.resource),this.texture=it.from(t)}setFilters(t,e){const s=this.texture.source.style;s.minFilter=te.toPixiTextureFilter(t),s.magFilter=te.toPixiTextureFilter(e),this.texture.source.autoGenerateMipmaps=te.toPixiMipMap(t),this.texture.source.updateMipmaps()}setWraps(t,e){const s=this.texture.source.style;s.addressModeU=te.toPixiTextureWrap(t),s.addressModeV=te.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiMipMap(t){switch(t){case kt.Nearest:case kt.Linear:return!1;case kt.MipMapNearestLinear:case kt.MipMapNearestNearest:case kt.MipMapLinearLinear:case kt.MipMapLinearNearest:return!0;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureFilter(t){switch(t){case kt.Nearest:case kt.MipMapNearestLinear:case kt.MipMapNearestNearest:return"nearest";case kt.Linear:case kt.MipMapLinearLinear:case kt.MipMapLinearNearest:return"linear";default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case Me.ClampToEdge:return"clamp-to-edge";case Me.MirroredRepeat:return"mirror-repeat";case Me.Repeat:return"repeat";default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case Fe.Normal:return"normal";case Fe.Additive:return"add";case Fe.Multiply:return"multiply";case Fe.Screen:return"screen";default:throw new Error(`Unknown blendMode: ${String(t)}`)}}}const ts="spineTextureAtlasLoader",jm={extension:V.Asset,resolver:{test:r=>qt(r,".atlas"),parse:r=>{const t=r.split(".");return{resolution:parseFloat(He.RETINA_PREFIX?.exec(r)?.[1]??"1"),format:t[t.length-2],src:r}}},loader:{id:ts,name:ts,extension:{type:V.LoadParser,priority:pe.Normal,name:ts},test(r){return qt(r,".atlas")},async load(r){const t=await mt.get().fetch(r);if(!t.ok)throw new Error(`[${ts}] Failed to fetch ${r}: ${t.status} ${t.statusText}`);return await t.text()},testParse(r,t){const e=qt(t.src,".atlas"),s=typeof r=="string",i=t.parser===ts||t.loadParser===ts;return Promise.resolve((e||i)&&s)},unload(r){r.dispose()},async parse(r,t,e){const s=t.data||{};let i=Et.dirname(t.src);i&&i.lastIndexOf("/")!==i.length-1&&(i+="/");const n=new am(r);
289if(s.images instanceof Ht||typeof s.images=="string"){const l=s.images;s.images={},s.images[n.pages[0].name]=l}const o=[];for(const l of n.pages){const a=l.name,h=s?.images?s.images[a]:void 0;if(h instanceof Ht)l.setTexture(te.from(h));else{const c=h??Et.normalize([...i.split(Et.sep),a].join(Et.sep)),d={src:ci(c,t.src),data:{...s.imageMetadata,alphaMode:l.pma?"premultiplied-alpha":"premultiply-alpha-on-upload"}},f=e.load(d).then(u=>{l.setTexture(te.from(u.source))});o.push(f)}}return await Promise.all(o),n}}};lt.add(jm);const es="spineSkeletonLoader";function Km(r){return Object.prototype.hasOwnProperty.call(r,"bones")}function Zm(r){return r instanceof Uint8Array}const Qm={extension:V.Asset,loader:{id:es,name:es,extension:{type:V.LoadParser,priority:pe.Normal,name:es},test(r){return qt(r,".skel")},async load(r){const t=await mt.get().fetch(r);if(!t.ok)throw new Error(`[${es}] Failed to fetch ${r}: ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())},testParse(r,t){const e=qt(t.src,".json")&&Km(r),s=qt(t.src,".skel")&&Zm(r),i=t.parser===es||t.loadParser===es;return Promise.resolve(e||s||i)}}};lt.add(Qm);const Jm=new Float32Array(1),tg=new Uint32Array(1);class eg extends qo{constructor(){const e=new We({data:Jm,label:"attribute-batch-buffer",usage:Tt.VERTEX|Tt.COPY_DST,shrinkToFit:!1}),s=new We({data:tg,label:"index-batch-buffer",usage:Tt.INDEX|Tt.COPY_DST,shrinkToFit:!1}),i=28;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:i,offset:0},aUV:{buffer:e,format:"float32x2",stride:i,offset:8},aColor:{buffer:e,format:"unorm8x4",stride:i,offset:16},aDarkColor:{buffer:e,format:"unorm8x4",stride:i,offset:20},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:i,offset:24}},indexBuffer:s})}}const sg={name:"color-bit",vertex:{header:`
290            @in aDarkColor: vec4<f32>;
291            @out vDarkColor: vec4<f32>;
292        `,main:`
293        vDarkColor = aDarkColor;
294        `},fragment:{header:`
295            @in vDarkColor: vec4<f32>;
296        `,end:`
297
298        let alpha = outColor.a * vColor.a;
299        let rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;
300
301        finalColor = vec4<f32>(rgb, alpha);
302
303        `}},ig={name:"color-bit",vertex:{header:`
304            in vec4 aDarkColor;
305            out vec4 vDarkColor;
306        `,main:`
307            vDarkColor = aDarkColor;
308        `},fragment:{header:`
309            in vec4 vDarkColor;
310        `,end:`
311
312        finalColor.a = outColor.a * vColor.a;
313        finalColor.rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;
314        `}};class rg extends _i{constructor(t){const e=Qo({name:"dark-tint-batch",bits:[tl,ig,sl(t),rl]}),s=Zo({name:"dark-tint-batch",bits:[Jo,sg,el(t),il]});super({glProgram:e,gpuProgram:s,resources:{batchSamplers:nl(t)}})}}let Da=null;class Jr extends Ho{static extension={type:[V.Batcher],name:"darkTint"};geometry=new eg;shader=Da||(Da=new rg(this.maxTextures));name=Jr.extension.name;vertexSize=7;packAttributes(t,e,s,i,n){const o=n<<16|t.roundPixels&65535,l=t.transform,a=l.a,h=l.b,c=l.c,d=l.d,f=l.tx,u=l.ty,{positions:m,uvs:g}=t,p=t.color,b=(p>>24&255)/255,w=Wt.shared.setValue(t.darkColor).premultiply(b,!0).toPremultiplied(1,!1),x=t.attributeOffset,y=x+t.attributeSize;for(let _=x;_<y;_++){const v=_*2,A=m[v],C=m[v+1];e[i++]=a*A+c*C+f,e[i++]=d*C+h*A+u,e[i++]=g[v],e[i++]=g[v+1],s[i++]=p,s[i++]=w,s[i++]=o}}packQuadAttributes(t,e,s,i,n){const o=t.texture,l=t.transform,a=l.a,h=l.b,c=l.c,d=l.d,f=l.tx,u=l.ty,m=t.bounds,g=m.maxX,p=m.minX,b=m.maxY,w=m.minY,x=o.uvs,y=t.color,_=t.darkColor,v=n<<16|t.roundPixels&65535;e[i+0]=a*p+c*w+f,e[i+1]=d*w+h*p+u,e[i+2]=x.x0,e[i+3]=x.y0,s[i+4]=y,s[i+5]=_,s[i+6]=v,e[i+7]=a*g+c*w+f,e[i+8]=d*w+h*g+u,e[i+9]=x.x1,e[i+10]=x.y1,s[i+11]=y,s[i+12]=_,s[i+13]=v,e[i+14]=a*g+c*b+f,e[i+15]=d*b+h*g+u,e[i+16]=x.x2,e[i+17]=x.y2,s[i+18]=y,s[i+19]=_,s[i+20]=v,e[i+21]=a*p+c*b+f,e[i+22]=d*b+h*p+u,e[i+23]=x.x3,e[i+24]=x.y3,s[i+25]=y,s[i+26]=_,s[i+27]=v}}lt.add(Jr);const ng=O.newFloatArray(8);class Ys{static QUAD_TRIANGLES=[0,1,2,2,3,0];static VERTEX_SIZE=8;ctx;triangleRendering=!1;debugRendering=!1;vertices=O.newFloatArray(8*1024);tempColor=new W;constructor(t){this.ctx=t}draw(t){this.triangleRendering?this.drawTriangles(t):this.drawImages(t)}drawImages(t){let e=this.ctx,s=this.tempColor,i=t.color,n=t.drawOrder;this.debugRendering&&(e.strokeStyle="green");for(let o=0,l=n.length;o<l;o++){let a=n[o],h=a.bone;if(!h.active)continue;let c=a.getAttachment();if(!(c instanceof Q))continue;c.computeWorldVertices(a,ng,0,2);let d=c.region,f=d.texture.getImage(),u=a.color,m=c.color;s.set(i.r*u.r*m.r,i.g*u.g*m.g,i.b*u.b*m.b,i.a*u.a*m.a),e.save(),e.transform(h.a,h.c,h.b,h.d,h.worldX,h.worldY),e.translate(c.offset[0],c.offset[1]),e.rotate(c.rotation*Math.PI/180);let g=c.width/d.originalWidth;e.scale(g*c.scaleX,g*c.scaleY);let p=d.width,b=d.height;if(e.translate(p/2,b/2),c.region.degrees==90){let w=p;p=b,b=w,e.rotate(-Math.PI/2)}e.scale(1,-1),e.translate(-p/2,-b/2),e.globalAlpha=s.a,e.drawImage(f,f.width*d.u,f.height*d.v,p,b,0,0,p,b),this.debugRendering&&e.strokeRect(0,0,p,b),e.restore(
314)}}drawTriangles(t){let e=this.ctx,s=this.tempColor,i=t.color,n=t.drawOrder,o=null,l=this.vertices,a=null;for(let c=0,d=n.length;c<d;c++){let f=n[c],u=f.getAttachment(),m;if(u instanceof Q){let g=u;l=this.computeRegionVertices(f,g,!1),a=Ys.QUAD_TRIANGLES,m=g.region.texture.getImage()}else if(u instanceof jt){let g=u;l=this.computeMeshVertices(f,g,!1),a=g.triangles,m=g.region.texture.getImage()}else continue;if(m){f.data.blendMode!=o&&(o=f.data.blendMode);let g=f.color,p=u.color;s.set(i.r*g.r*p.r,i.g*g.g*p.g,i.b*g.b*p.b,i.a*g.a*p.a),e.globalAlpha=s.a;for(var h=0;h<a.length;h+=3){let b=a[h]*8,w=a[h+1]*8,x=a[h+2]*8,y=l[b],_=l[b+1],v=l[b+6],A=l[b+7],C=l[w],M=l[w+1],k=l[w+6],S=l[w+7],E=l[x],R=l[x+1],T=l[x+6],I=l[x+7];this.drawTriangle(m,y,_,v,A,C,M,k,S,E,R,T,I),this.debugRendering&&(e.strokeStyle="green",e.beginPath(),e.moveTo(y,_),e.lineTo(C,M),e.lineTo(E,R),e.lineTo(y,_),e.stroke())}}}this.ctx.globalAlpha=1}drawTriangle(t,e,s,i,n,o,l,a,h,c,d,f,u){let m=this.ctx;const g=t.width-1,p=t.height-1;i*=g,n*=p,a*=g,h*=p,f*=g,u*=p,m.beginPath(),m.moveTo(e,s),m.lineTo(o,l),m.lineTo(c,d),m.closePath(),o-=e,l-=s,c-=e,d-=s,a-=i,h-=n,f-=i,u-=n;let b=a*u-f*h;if(b==0)return;b=1/b;const w=(u*o-h*c)*b,x=(u*l-h*d)*b,y=(a*c-f*o)*b,_=(a*d-f*l)*b,v=e-w*i-y*n,A=s-x*i-_*n;m.save(),m.transform(w,x,y,_,v,A),m.clip(),m.drawImage(t,0,0),m.restore()}computeRegionVertices(t,e,s){let i=t.bone.skeleton.color,n=t.color,o=e.color,l=i.a*n.a*o.a,a=s?l:1,h=this.tempColor;h.set(i.r*n.r*o.r*a,i.g*n.g*o.g*a,i.b*n.b*o.b*a,l),e.computeWorldVertices(t,this.vertices,0,Ys.VERTEX_SIZE);let c=this.vertices,d=e.uvs;return c[Q.C1R]=h.r,c[Q.C1G]=h.g,c[Q.C1B]=h.b,c[Q.C1A]=h.a,c[Q.U1]=d[0],c[Q.V1]=d[1],c[Q.C2R]=h.r,c[Q.C2G]=h.g,c[Q.C2B]=h.b,c[Q.C2A]=h.a,c[Q.U2]=d[2],c[Q.V2]=d[3],c[Q.C3R]=h.r,c[Q.C3G]=h.g,c[Q.C3B]=h.b,c[Q.C3A]=h.a,c[Q.U3]=d[4],c[Q.V3]=d[5],c[Q.C4R]=h.r,c[Q.C4G]=h.g,c[Q.C4B]=h.b,c[Q.C4A]=h.a,c[Q.U4]=d[6],c[Q.V4]=d[7],c}computeMeshVertices(t,e,s){let i=t.bone.skeleton.color,n=t.color,o=e.color,l=i.a*n.a*o.a,a=s?l:1,h=this.tempColor;h.set(i.r*n.r*o.r*a,i.g*n.g*o.g*a,i.b*n.b*o.b*a,l);let c=e.worldVerticesLength/2,d=this.vertices;d.length<e.worldVerticesLength&&(this.vertices=d=O.newFloatArray(e.worldVerticesLength)),e.computeWorldVertices(t,0,e.worldVerticesLength,d,0,Ys.VERTEX_SIZE);let f=e.uvs;for(let u=0,m=0,g=2;u<c;u++)d[g++]=h.r,d[g++]=h.g,d[g++]=h.b,d[g++]=h.a,d[g++]=f[m++],d[g++]=f[m++],g+=2;return d}}class ag{indexOffset=0;attributeOffset=0;indexSize;attributeSize;batcherName="darkTint";topology="triangle-list";packAsQuad=!1;renderable;positions;indices;uvs;roundPixels;data;blendMode;darkTint;texture;transform;_textureId;_attributeStart;_indexStart;_batcher;_batch;get color(){const t=this.data.color,e=this.renderable.groupColor,s=this.renderable.groupAlpha;let i;const n=t.a*s*255;if(e!==16777215){const o=e>>16&255,l=e>>8&255,a=e&255,h=t.r*a,c=t.g*l,d=t.b*o;i=n<<24|d<<16|c<<8|h}else i=n<<24|t.b*255<<16|t.g*255<<8|t.r*255;return i}get darkColor(){const t=this.data.darkColor;return t.b*255<<16|t.g*255<<8|t.r*255}get groupTransform(){return this.renderable.groupTransform}setData(t,e,s,i){if(this.renderable=t,this.transform=t.groupTransform,this.data=e,e.clipped){const n=e.clippedData;this.indexSize=n.indicesCount,this.attributeSize=n.vertexCount,this.positions=n.vertices,this.indices=n.indices,this.uvs=n.uvs}else this.indexSize=e.indices.length,this.attributeSize=e.vertices.length/2,this.positions=e.vertices,this.indices=e.indices,this.uvs=e.uvs;this.texture=e.texture,this.roundPixels=i,this.blendMode=s,this.batcherName=e.darkTint?"darkTint":"default"}}const og={0:"normal",1:"add",2:"multiply",3:"screen"};class lg{static extension={type:[V.WebGLPipes,V.WebGPUPipes,V.CanvasPipes],name:"spine"};renderer;canvasSkeletonRenderer;gpuSpineData={};_destroyRenderableBound=this.destroyRenderable.bind(this);constructor(t){this.renderer=t}validateRenderable(t){if(this.renderer.type===os.CANVAS||(t._validateAndTransformAttachments(),t.spineAttachmentsDirty))return!0;if(t.spineTexturesDirty){const e=t.skeleton.drawOrder,s=this.gpuSpineData[t.uid];if(!s)return!1;for(let i=0,n=e.length;i<n;i++){const o=e[i],l=o.getAttachment();if(l instanceof Q||l instanceof jt){const a=t._getCachedData(o,l),h=s.slotBatches[a.id],c=a.texture;if(c!==h?.texture&&!h?._batcher.checkAndUpdateTexture(h,c))return!0}}}return!1}execute(t){if(this.renderer.type===os.CANVAS){const e=this.renderer,s=(t.groupColorAlpha>>>24&255)/255,i=e.canvasContext,n=i.activeContext;n.save(),this.canvasSkeletonRenderer||(this.canvasSkeletonRenderer=new Ys(n),this.canvasSkeletonRenderer.triangleRendering=!0),i.setContextTransform(t.groupTransform,(e._roundPixels|t._roundPixels)===1);const o=t.skeleton.color.a;t.skeleton.color.a*=s,this.canvasSkeletonRenderer.draw(t.skeleton),t.skeleton.color.a=o,n.restore(
314)}}addRenderable(t,e){if(this.renderer.type===os.CANVAS){this.renderer.renderPipes.batch.break(e),e.add(t);return}const s=this._getSpineData(t),i=this.renderer.renderPipes.batch,n=t.skeleton.drawOrder,o=this.renderer._roundPixels|t._roundPixels;t._validateAndTransformAttachments(),t.spineAttachmentsDirty=!1,t.spineTexturesDirty=!1;for(let l=0,a=n.length;l<a;l++){const h=n[l],c=h.getAttachment(),d=og[h.data.blendMode];let f=!1;if(c instanceof Q||c instanceof jt){const m=t._getCachedData(h,c),g=s.slotBatches[m.id]||=new ag;g.setData(t,m,d,o),f=m.skipRender,f||i.addToBatch(g,e)}const u=t._slotsObject[h.data.name];if(u){const m=u.container;m.includeInBuild=!0,m.collectRenderables(e,this.renderer,null),m.includeInBuild=!1}}}updateRenderable(t){const e=this.gpuSpineData[t.uid];if(!e)return;t._validateAndTransformAttachments(),t.spineAttachmentsDirty=!1,t.spineTexturesDirty=!1;const s=t.skeleton.drawOrder;for(let i=0,n=s.length;i<n;i++){const o=s[i],l=o.getAttachment();if(l instanceof Q||l instanceof jt){const a=t._getCachedData(o,l);if(!a.skipRender){const h=e.slotBatches[a.id];h?._batcher?.updateElement(h)}}}}destroyRenderable(t){this.gpuSpineData[t.uid]=null,t.off("destroyed",this._destroyRenderableBound)}destroy(){this.gpuSpineData=null,this.renderer=null,this.canvasSkeletonRenderer=null}_getSpineData(t){return this.gpuSpineData[t.uid]||this._initMeshData(t)}_initMeshData(t){return this.gpuSpineData[t.uid]={slotBatches:{}},t.on("destroyed",this._destroyRenderableBound),this.gpuSpineData[t.uid]}}lt.add(lg);const ri=new fi;gs.yDown=!0;const ss=new pi,La=new Ns(()=>new ui);class xi extends Lr{batched=!0;buildId=0;renderPipeId="spine";_didSpineUpdate=!1;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};skeleton;state;skeletonBounds;darkTint=!1;_debug=void 0;_slotsObject=Object.create(null);clippingSlotToPixiMasks=Object.create(null);getSlotFromRef(t){let e;if(typeof t=="number"?e=this.skeleton.slots[t]:typeof t=="string"?e=this.skeleton.findSlot(t):e=t,!e)throw new Error(`No slot found with the given slot reference: ${t}`);return e}spineAttachmentsDirty=!0;spineTexturesDirty=!0;_lastAttachments=[];_stateChanged=!0;attachmentCacheData=[];get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}_autoUpdate=!1;_ticker=Ee.shared;get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!t&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=t}get ticker(){return this._ticker}set ticker(t){t=t??Ee.shared,this._ticker!==t&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),t.add(this.internalUpdate,this)),this._ticker=t)}_boundsProvider;get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t&&(this._boundsDirty=!1),this.updateBounds()}hasNeverUpdated=!0;constructor(t){t instanceof gi&&(t={skeletonData:t}),super({}),this.allowChildren=!0;const e=t instanceof gi?t:t.skeletonData;this.skeleton=new gs(e),this.state=new Bs(new im(e)),t?.ticker&&(this._ticker=t.ticker),this.autoUpdate=t?.autoUpdate??!0,this.darkTint=t?.darkTint===void 0?this.skeleton.slots.some(i=>!!i.data.darkColor):t?.darkTint;const s=this.skeleton.slots;for(let i=0;i<s.length;i++)this.attachmentCacheData[i]=Object.create(null);this._boundsProvider=t.boundsProvider}update(t){this.internalUpdate(0,t)}internalUpdate(t,e){this._updateAndApplyState(e??this._ticker.deltaMS/1e3)}get bounds(){return this._boundsDirty&&this.updateBounds(),this._bounds}setBonePosition(t,e){const s=t;if(typeof t=="string"&&(t=this.skeleton.findBone(t)),!t)throw Error(`Cant set bone position, bone ${String(s)} not found`);if(ri.set(e.x,e.y),t.parent){const i=t.parent.worldToLocal(ri);t.x=i.x,t.y=-i.y}else t.x=ri.x,t.y=ri.y}getBonePosition(t,e){const s=t;return typeof t=="string"&&(t=this.skeleton.findBone(t)),t?(e||(e={x:0,y:0}),e.x=t.worldX,e.y=t.worldY,e):(console.error(`Cant set bone position! Bone ${String(s)} not found`),e)}_updateAndApplyState(t){this.hasNeverUpdated=!1,this.state.update(t),this.skeleton.update(t);const{skeleton:e}=this;this.state.apply(e),this.beforeUpdateWorldTransforms(this),e.updateWorldTransform(se.update),this.afterUpdateWorldTransforms(this),this.updateSlotObjects(),this._stateChanged=!0,this.onViewUpdate()}_validateAndTransformAttachments(){this._stateChanged&&(this._stateChanged=!1,this.validateAttachments(),this.transformAttachments())}validateAttachments(){const t=this.skeleton.drawOrder,e=this._lastAttachments;let s=0,i=!1;for(let n=0;n<t.length;n++){const l=t[n].getAttachment();l&&(l!==e[s]&&(i=!0,e[s]=l),s++)}s!==e.length&&(i=!0,e.length=s),this.spineAttachmentsDirty||=i}currentClippingSlot;updateAndSetPixiMask(t,e){const s=t.attachment;if(s&&s instanceof Ve){const o=this.clippingSlotToPixiMasks[t.data.name]||={slot:t,vertices:new Array};o.maskComputed=!1,this.currentClippingSlot=o;return}let i=this.currentClippingSlot,n=this._slotsObject[t.data.name];if(i&&n){let o=i.mask;if(o||(o=La.obtain(),i.mask=o,this.addChild(o)),!i.maskComputed){let l=i.slot,a=l.attachment;i.maskComputed=!0;const h=a.worldVerticesLength,c=i.vertices;
314a.computeWorldVertices(l,0,h,c,0,2),o.clear().poly(c).stroke({width:0}).fill({alpha:.25})}n.container.mask=o}else n?.container.mask&&(n.container.mask=null);if(i&&i.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),e){for(const o in this.clippingSlotToPixiMasks){const l=this.clippingSlotToPixiMasks[o];(!(l.slot.attachment instanceof Ve)||!l.maskComputed)&&l.mask&&(this.removeChild(l.mask),La.free(l.mask),l.mask=void 0)}this.currentClippingSlot=void 0}}transformAttachments(){const t=this.skeleton.drawOrder;for(let e=0;e<t.length;e++){const s=t[e];this.updateAndSetPixiMask(s,e===t.length-1);const i=s.getAttachment();if(i){if(i instanceof jt||i instanceof Q){const n=this._getCachedData(s,i);i instanceof Q?i.computeWorldVertices(s,n.vertices,0,2):i.computeWorldVertices(s,0,i.worldVerticesLength,n.vertices,0,2),n.uvs.length<i.uvs.length&&(n.uvs=new Float32Array(i.uvs.length)),kr(i.uvs.buffer,n.uvs.buffer);const l=s.bone.skeleton.color,a=s.color,h=i.color,c=l.a*a.a*h.a;if(n.color.set(l.r*a.r*h.r,l.g*a.g*h.g,l.b*a.b*h.b,c),this.alpha===0||c===0)n.skipRender||(this.spineAttachmentsDirty=!0),n.skipRender=!0;else{n.skipRender&&(this.spineAttachmentsDirty=!0),n.skipRender=n.clipped=!1,s.darkColor&&n.darkColor.setFromColor(s.darkColor);const d=i.region?.texture.texture||it.EMPTY;n.texture!==d&&(n.texture=d,this.spineTexturesDirty=!0),ss.isClipping()&&this.updateClippingData(n)}}else if(i instanceof Ve){ss.clipStart(s,i);continue}}ss.clipEndWithSlot(s)}ss.clipEnd()}updateClippingData(t){t.clipped=!0,ss.clipTrianglesUnpacked(t.vertices,t.indices,t.indices.length,t.uvs);const{clippedVertices:e,clippedUVs:s,clippedTriangles:i}=ss,n=e.length/2,o=i.length;t.clippedData||(t.clippedData={vertices:new Float32Array(n*2),uvs:new Float32Array(n*2),vertexCount:n,indices:new Uint16Array(o),indicesCount:o},this.spineAttachmentsDirty=!0);const l=t.clippedData,a=l.vertexCount!==n||o!==l.indicesCount;t.skipRender=n===0,a&&(this.spineAttachmentsDirty=!0,l.vertexCount<n&&(l.vertices=new Float32Array(n*2),l.uvs=new Float32Array(n*2)),l.indices.length<o&&(l.indices=new Uint16Array(o)));const{vertices:h,uvs:c,indices:d}=l;for(let f=0;f<n;f++)h[f*2]=e[f*2],h[f*2+1]=e[f*2+1],c[f*2]=s[f*2],c[f*2+1]=s[f*2+1];l.vertexCount=n;for(let f=0;f<o;f++)d[f]!==i[f]&&(this.spineAttachmentsDirty=!0,d[f]=i[f]);l.indicesCount=o}updateSlotObjects(){for(const t in this._slotsObject){const e=this._slotsObject[t];e&&this.updateSlotObject(e)}}updateSlotObject(t){const{slot:e,container:s}=t,i=t.followAttachmentTimeline?!!e.attachment:!0,n=this.skeleton.color.a*e.color.a;if(s.visible=this.skeleton.drawOrder.includes(e)&&i&&this.alpha>0&&n>0,s.visible){let o=e.bone;const l=s.localTransform;l.a=o.a,l.b=o.c,l.c=-o.b,l.d=-o.d,l.tx=o.worldX,l.ty=o.worldY,s.setFromMatrix(l),s.alpha=n}}_getCachedData(t,e){return this.attachmentCacheData[t.data.index][e.name]||this.initCachedData(t,e)}initCachedData(t,e){let s;return e instanceof Q?(s=new Float32Array(8),this.attachmentCacheData[t.data.index][e.name]={id:`${t.data.index}-${e.name}`,vertices:s,clipped:!1,indices:[0,1,2,0,2,3],uvs:new Float32Array(e.uvs.length),color:new W(1,1,1,1),darkColor:new W(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:e.region?.texture.texture}):(s=new Float32Array(e.worldVerticesLength),this.attachmentCacheData[t.data.index][e.name]={id:`${t.data.index}-${e.name}`,vertices:s,clipped:!1,indices:e.triangles,uvs:new Float32Array(e.uvs.length),color:new W(1,1,1,1),darkColor:new W(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:e.region?.texture.texture}),this.attachmentCacheData[t.data.index][e.name]}onViewUpdate(){if(this._didViewChangeTick++,this._boundsProvider||(this._boundsDirty=!0),this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this),this.debug?.renderDebug(this)}addSlotObject(t,e,s){t=this.getSlotFromRef(t);for(const n in this._slotsObject)this._slotsObject[n]?.container===e&&this.removeSlotObject(this._slotsObject[n].slot);this.removeSlotObject(t),e.includeInBuild=!1,this.addChild(e);const i={container:e,slot:t,followAttachmentTimeline:s?.followAttachmentTimeline||!1};this._slotsObject[t.data.name]=i,this.updateSlotObject(i)}removeSlotObject(t){let e;if(t instanceof Te){for(const s in this._slotsObject)if(this._slotsObject[s]?.container===t){this._slotsObject[s]=null,e=t;break}}else{const s=this.getSlotFromRef(t);e=this._slotsObject[s.data.name]?.container,this._slotsObject[s.data.name]=null}e&&(this.removeChild(e),e.includeInBuild=!0)}removeSlotObjects(){Object.entries(this._slotsObject).forEach(([t,e])=>{e&&e.container.removeFromParent(),delete this._slotsObject[t]})}getSlotObject(t){return t=this.getSlotFromRef(t),this._slotsObject[t.data.name]?.container}updateBounds(){this._boundsDirty=!1,this.skeletonBounds||=new Hm;const t=this.skeletonBounds;if(t.update(this.skeleton,!0),this._boundsProvider){const e=this._boundsProvider.calculateBounds(this),s=this._bounds;s.clear(),s.x=e.x,s.y=e.y,s.width=e.width,s.height=e.height}else if(t.minX===1/0){this.hasNeverUpdated&&(this._updateAndApplyState(0),this._boundsDirty=!1),this._val
314idateAndTransformAttachments();const e=this.skeleton.drawOrder,s=this._bounds;s.clear();for(let i=0;i<e.length;i++){const n=e[i],o=n.getAttachment();if(o&&(o instanceof Q||o instanceof jt)){const l=this._getCachedData(n,o);s.addVertexData(l.vertices,0,l.vertices.length)}}}else this._bounds.minX=t.minX,this._bounds.minY=t.minY,this._bounds.maxX=t.maxX,this._bounds.maxY=t.maxY}addBounds(t){t.addBounds(this.bounds)}destroy(t=!1){super.destroy(t),this._ticker.remove(this.internalUpdate,this),this._ticker=null,this.state.clearListeners(),this.debug=void 0,this.skeleton=null,this.state=null,this._slotsObject=null,this._lastAttachments.length=0,this.attachmentCacheData=null}skeletonToPixiWorldCoordinates(t){this.worldTransform.apply(t,t)}pixiWorldCoordinatesToSkeleton(t){this.worldTransform.applyInverse(t,t)}pixiWorldCoordinatesToBone(t,e){this.pixiWorldCoordinatesToSkeleton(t),e.parent?e.parent.worldToLocal(t):e.worldToLocal(t)}static from({skeleton:t,atlas:e,scale:s=1,darkTint:i,autoUpdate:n=!0,boundsProvider:o,ticker:l}){const a=`${t}-${e}-${s}`;if(bt.has(a))return new xi({skeletonData:bt.get(a),darkTint:i,autoUpdate:n,boundsProvider:o,ticker:l});const h=Ge.get(t),c=Ge.get(e),d=new Ql(c),f=h instanceof Uint8Array?new oh(d):new $m(d);f.scale=s;const u=f.readSkeletonData(h);return bt.set(a,u),new xi({skeletonData:u,darkTint:i,autoUpdate:n,boundsProvider:o,ticker:l})}}const hg=yh({__name:"SpinePlayer",props:{enabled:{type:Boolean},spineVoiceLang:{},characters:{}},setup(r,{expose:t}){t();const e=r;let s=null;typeof window<"u"&&setTimeout(()=>{const B=z=>{s&&s(z)};window.addEventListener("copy",B,!0);const G=z=>{s&&s(z)};window.addEventListener("code-copy",G)},100);const i=_e(!1),n=_e(!0),o=()=>{const B=localStorage.getItem("spine-enabled")!=="false";return n.value=B,B},l=B=>{if(B.key==="spine-enabled"){const G=B.newValue!=="false";n.value=G,G?vt():nt()}},a=B=>{const{enabled:G}=B.detail;n.value=G,G?vt():nt()},h=()=>{const B=document.documentElement.getAttribute("theme");i.value=B==="dark"};pn(()=>{h();const B=new MutationObserver(G=>{G.forEach(z=>{z.attributeName==="theme"&&h()})});B.observe(document.documentElement,{attributes:!0,attributeFilter:["theme"]}),xn(()=>{B.disconnect()})});const c=Qe(()=>!!e.characters),d=B=>{const G=e.characters;if(!G)return null;const z=tt=>tt.replace(/{lang}/g,B);return{arona:{...G.arona,voiceConfig:G.arona.voiceConfig.map(tt=>({...tt,audio:z(tt.audio)})),copyConfig:G.arona.copyConfig?{...G.arona.copyConfig,audio:G.arona.copyConfig.audio?z(G.arona.copyConfig.audio):void 0}:void 0,offset:G.arona.offset},plana:{...G.plana,voiceConfig:G.plana.voiceConfig.map(tt=>({...tt,audio:z(tt.audio)})),copyConfig:G.plana.copyConfig?{...G.plana.copyConfig,audio:G.plana.copyConfig.audio?z(G.plana.copyConfig.audio):void 0}:void 0,offset:G.plana.offset}}},f=_e(null);let u=null,m=null,g=null,p=_e(!1),b=null,w=null,x=_e("arona");const y=_e(!1),_={context:null,buffers:new Map,currentSource:null,gainNode:null,initialize(){y.value&&(this.context||(this.context=new(window.AudioContext||window.webkitAudioContext),this.gainNode=this.context.createGain(),this.gainNode.gain.value=.5,this.gainNode.connect(this.context.destination)))},async loadAudioFile(B){if(this.buffers.has(B)){const G=this.buffers.get(B);return G.lastUsed=Date.now(),G.buffer}try{const z=await(await fetch(B)).arrayBuffer(),tt=await this.context.decodeAudioData(z);return this.buffers.set(B,{buffer:tt,lastUsed:Date.now()}),tt}catch(G){return console.error("音频加载失败:",G),null}},async playAudio(B){return this.currentSource&&this.currentSource.stop(),new Promise(G=>{const z=this.context.createBufferSource();z.buffer=B,z.connect(this.gainNode),z.onended=()=>{this.currentSource===z&&(this.currentSource=null),G()},this.currentSource=z,z.start()})},clear(){this.currentSource&&(this.currentSource.stop(),this.currentSource=null),this.buffers.clear()},gc(){const B=Date.now();for(const[G,z]of this.buffers.entries())B-z.lastUsed>3e5&&this.buffers.delete(G)}},v=async()=>{if(!ht.value)return!1;_.initialize(),_.gc();const B=ht.value.voiceConfig.map(G=>_.loadAudioFile(G.audio));return Promise.all(B).catch(G=>(console.error("音频预加载失败:",G),!1))},A=()=>{if(!y.value||!f.value)return;const B=window.scrollY,G=window.innerHeight,z=document.documentElement.scrollHeight,tt=document.querySelector("footer");if(!tt)return;const yt=tt.getBoundingClientRect(),gt=f.value.getBoundingClientRect().bottom,ye=yt.top,Xt=25;if(gt>ye){const Kt=gt-ye,be=Xt+Kt+20;f.value.style.bottom=`${be}px`}else f.value.style.bottom=`${Xt}px`;M()&&(z-(B+G)<=1?f.value.style.left="-50%":f.value.style.left="0%")},C=()=>
314{if(!y.value||!f.value)return;const B=document.querySelector(".chatdialog-container");if(!B)return;const G=f.value.getBoundingClientRect(),z=B.offsetWidth,tt=B.offsetHeight,yt=G.left+G.width/2-z/2,St=G.top+G.height/2-tt/2,ye=Math.max(10,yt),Xt=Math.max(10,St);B.style.left=`${ye}px`,B.style.top=`${Xt}px`,B.style.bottom="auto"},M=()=>y.value?/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent):!1;let k=!1,S=!1;const E=_e(!1),R=_e("");let T=-1;const I=(B,G)=>{let z=null;return function(...tt){z&&clearTimeout(z),z=setTimeout(()=>{B.apply(this,tt),z=null},G)}},F=_e(null),D=I(async B=>{if(B.preventDefault(),B.stopPropagation(),!k){if(k=!0,S=!0,p.value=!0,F.value?.(),!$.value)return;const G=$.value[x.value].voiceConfig;if(!G||G.length===0)return;let z;do z=Math.floor(Math.random()*G.length);while(z===T&&G.length>1);T=z;const tt=G[z];try{const yt=await _.loadAudioFile(tt.audio);if(!yt)throw new Error("音频加载失败");R.value=tt.text,E.value=!0,yn(()=>{C()}),m&&tt.animation&&m.state.setAnimation(2,tt.animation,!1),await _.playAudio(yt),k=!1,S=!1,p.value=!1,m&&m.state.setEmptyAnimation(2,0),E.value=!1}catch(yt){console.error("音频播放失败:",yt),k=!1,S=!1,p.value=!1,E.value=!1}}},300),H=async B=>{if(!$.value)return;const G=ht.value;if(!G?.copyConfig)return;const z=G.copyConfig;if(!k){k=!0,S=!0,p.value=!0,F.value?.();try{R.value=z.text,E.value=!0,yn(()=>{C()}),m&&z.animation&&m.state.setAnimation(2,z.animation,!1);const tt=Date.now();if(z.audio){const gt=await _.loadAudioFile(z.audio);gt&&await _.playAudio(gt)}const yt=2e3,St=Date.now()-tt;St<yt&&await new Promise(gt=>setTimeout(gt,yt-St)),k=!1,S=!1,p.value=!1,m&&m.state.setEmptyAnimation(2,0),E.value=!1}catch(tt){console.error("[SpinePlayer] 复制事件处理失败:",tt),k=!1,S=!1,p.value=!1,E.value=!1}}};let L=null,U=null,j=1;const Z=async B=>{try{let G=function(Gt,Ft,Zt){const we=Math.cos(Zt),Ke=Math.sin(Zt);return{x:Gt*we-Ft*Ke,y:Gt*Ke+Ft*we}},z=function(Gt){if(p.value||!f.value)return;const Ft=f.value.getBoundingClientRect(),Zt=Gt.clientX-(Ft.right-Ft.width/2),we=Gt.clientY-(Ft.bottom-Ft.height*4/5),Ke=B.eyeRotationAngle*(Math.PI/180),Ie=G(Zt,we,-Ke),Ii=Ie.x,Ei=Ie.y,xs=Math.sqrt(Ii*Ii+Ei*Ei),Ze=Math.atan2(Ei,Ii),dn=Math.min(xs,lh),un=-dn*Math.cos(Ze),fn=dn*Math.sin(Ze);ae&&(ae.x=tn+un,ae.y=en+fn),oe&&(oe.x=sn+un,oe.y=rn+fn);const hh=Math.min(xs,hn)*Math.cos(Ze),ch=Math.min(xs,hn)*Math.sin(Ze),dh=Math.min(xs,cn)*Math.cos(Ze),uh=Math.min(xs,cn)*Math.sin(Ze);le&&(le.x=nn-hh,le.y=an+ch),he&&(he.x=on+dh,he.y=ln-uh),je.updateWorldTransform(se.update)},tt=function(){ae&&(ae.x=tn,ae.y=en),oe&&(oe.x=sn,oe.y=rn),le&&(le.x=nn,le.y=an),he&&(he.x=on,he.y=ln),je.updateWorldTransform(se.update)},yt=function(){if(S){g=setTimeout(yt,500);return}const Gt=Math.random()*3+3,Ft=Math.random()>.5;B.eyeCloseAnimationName&&(Pi.setAnimation(1,B.eyeCloseAnimationName,!1),Ft&&Pi.addAnimation(1,B.eyeCloseAnimationName,!1,.1)),g=setTimeout(yt,Gt*1e3)};if(g&&clearTimeout(g),f.value&&(f.value.innerHTML=""),u&&(u.destroy(!0,{children:!0,texture:!0}),u=null),!f.value)return;const St=2;u=new Go,await u.init({width:f.value.clientWidth*St,height:f.value.clientHeight*St,backgroundAlpha:0,antialias:!0,resolution:1}),f.value.appendChild(u.canvas);try{const Gt=await Ge.load(B.atlasUrl),Ft=await fetch(B.skelUrl);if(!Ft.ok)throw new Error(`Failed to fetch skeleton: ${Ft.status} ${Ft.statusText}`);const Zt=new Uint8Array(await Ft.arrayBuffer()),we=new Ql(Gt),Ie=new oh(we).readSkeletonData(Zt);m=new xi({skeletonData:Ie,autoUpdate:!0})}catch(Gt){throw console.error("Failed to load spine assets or create instance:",Gt),Gt}m.skeleton.updateWorldTransform(se.update);const gt=m.skeleton.getBoundsRect(),ye=gt.width||500,Xt=gt.height||500,Kt=ye/Xt;j=Kt;const be=f.value.clientHeight,qe=be*Kt;f.value.style.width=`${qe}px`;const Ti=be/Xt;!U&&f.value&&(U=new ResizeObserver(Gt=>{for(const Ft of Gt){const Zt=Ft.contentRect.height,we=Zt*j;if(f.value.style.width=`${we}px`,u&&m){u.renderer.resize(we*2,Zt*2);const Ie=Zt/Xt;m.scale.set(Ie*2),m.position.set(-gt.x*Ie*2,(Zt-(gt.y+gt.height)*Ie)*2)}E.value&&C()}}),U.observe(f.value)),m.scale.set(Ti*St),m.position.set(-gt.x*Ti*St,(be-(gt.y+gt.height)*Ti)*St),m.batched=!1,u.stage.addChild(m),B.idleAnimationName&&m.state.setAnimation(0,B.idleAnimationName,!0);const je=m.skeleton,Pi=m.state;w=Pi;const ae=B.rightEyeBone?je.findBone(B.rightEyeBone):null,oe=B.leftEyeBone?je.findBone(B.leftEyeBone):null,le=B.frontHeadBone?je.findBone(B.frontHeadBone):null,he=B.backHeadBone?je.findBone(B.backHeadBone):null,tn=ae?ae.data.x:0,en=ae?ae.data.y:0,sn=oe?oe.data.x:0,rn=oe?oe.data.y:0,nn=le?le.data.x:0,an=le?le.data.y:0,on=he?he.data.x:0,ln=he?he.data.y:0,lh=15,hn=2,cn=1;F.value=tt,M()||(L=z,window.addEventListener("mousemove",L)),yt()}catch(G){console.error("Failed to initialize spine player:",G)}},N=Qe(()=>e.enabled!==!1),q=Qe(()=>e.spineVoiceLang||"zh"),$=Qe(()=>d(q.value)),ht=Qe(()=>$.value?.[x.value]),_t=Qe(()=>{const B=ht.value?.offset;if(!B)return{};const G={};return B.left!==void 0&&(G.left=B.left),B.bottom!==void 0&&(G.bottom=B.bottom),G}),rt=B=>{B.type==="scroll"?A():["mousemove","touchmove"].includes(B.type)&&L?.(B)},nt=()=>
314{g&&clearTimeout(g),b&&clearTimeout(b),L&&!M()&&(window.removeEventListener("mousemove",L),L=null),U&&f.value&&(U.unobserve(f.value),U.disconnect(),U=null),f.value&&(f.value.innerHTML=""),u&&(u.destroy(!0,{children:!0,texture:!0}),u=null,m=null),_.clear()},dt=async()=>{if(nt(),!(!N.value||!f.value||!ht.value)){x.value=i.value?"plana":"arona";try{await Promise.all([v(),Z(ht.value)])}catch(B){console.error("初始化失败:",B)}}},vt=I(dt,300);bh([i,N],async([B,G],[z,tt])=>{G!==tt?G?vt():nt():G&&B!==z&&vt()},{immediate:!0}),pn(()=>{y.value=!0,o();const B={passive:!0};window.addEventListener("scroll",rt,B),M()||window.addEventListener("mousemove",rt,B),window.addEventListener("storage",l),window.addEventListener("spine-toggle",a);const G=()=>{s=H,o()};document.addEventListener("astro:after-swap",G),N.value&&n.value&&vt(),setTimeout(()=>{s=H},500)}),xn(()=>{nt(),window.removeEventListener("scroll",rt),window.removeEventListener("storage",l),window.removeEventListener("spine-toggle",a)});const Rt={props:e,get globalCopyHandler(){return s},set globalCopyHandler(B){s=B},isDarkMode:i,spineVisible:n,checkSpineVisible:o,handleStorageChange:l,handleSpineToggle:a,updateTheme:h,hasConfig:c,getSpineAssets:d,playerContainer:f,get app(){return u},set app(B){u=B},get spineInstance(){return m},set spineInstance(B){m=B},get blinkInterval(){return g},set blinkInterval(B){g=B},get isEyeControlDisabled(){return p},set isEyeControlDisabled(B){p=B},get eyeControlTimer(){return b},set eyeControlTimer(B){b=B},get currentAnimationState(){return w},set currentAnimationState(B){w=B},get currentCharacter(){return x},set currentCharacter(B){x=B},clientReady:y,AudioManager:_,preloadAudio:v,handleScroll:A,updateChatDialogPosition:C,isMobileDevice:M,get isPlaying(){return k},set isPlaying(B){k=B},get isDialogPlaying(){return S},set isDialogPlaying(B){S=B},showDialog:E,currentDialog:R,get lastPlayedIndex(){return T},set lastPlayedIndex(B){T=B},debounce:I,resetBonesState:F,handlePlayerClick:D,handleCopyEvent:H,get moveBonesHandler(){return L},set moveBonesHandler(B){L=B},get resizeObserver(){return U},set resizeObserver(B){U=B},get currentSkeletonAspectRatio(){return j},set currentSkeletonAspectRatio(B){j=B},initializeSpinePlayer:Z,enabled:N,spineVoiceLang:q,spineAssets:$,currentAssets:ht,playerContainerStyle:_t,handleEvents:rt,cleanup:nt,initializeCharacter:dt,debouncedInitialize:vt};return Object.defineProperty(Rt,"__isScriptSetup",{enumerable:!1,value:!0}),Rt}}),cg={key:0,class:"spine-player-wrapper"},dg={key:0,class:"chatdialog-container"},ug={class:"chatdialog"};function fg(r,t,e,s,i,n){return s.enabled&&s.hasConfig&&s.spineVisible?(bn(),mn("div",cg,[Ri("div",{ref:"playerContainer",class:"playerContainer",style:gh(s.playerContainerStyle),onClick:t[0]||(t[0]=(...o)=>s.handlePlayerClick&&s.handlePlayerClick(...o)),onTouchstart:t[1]||(t[1]=(...o)=>s.handlePlayerClick&&s.handlePlayerClick(...o))},null,36),ph(fh,{name:"fade"},{default:xh(()=>[s.showDialog?(bn(),mn("div",dg,[t[2]||(t[2]=Ri("div",{class:"chatdialog-triangle"},null,-1)),Ri("div",ug,wh(s.currentDialog),1)])):gn("",!0)]),_:1})])):gn("",!0)}const Ag=mh(hg,[["render",fg]]);export{Co as $,Bo as A,We as B,Wt as C,mt as D,Pe as E,Vs as F,wi as G,Ua as H,Pt as I,us as J,bt as K,Ee as L,st as M,qh as N,Te as O,Lt as P,jd as Q,os as R,_i as S,it as T,li as U,Ai as V,kr as W,ai as X,Xr as Y,Eo as Z,Ht as _,ko as a,Zo as a0,Jo as a1,il as a2,el as a3,Fh as a4,Mu as a5,zt as a6,Ka as a7,ie as a8,so as a9,Yn as aa,Ds as ab,dc as ac,Ln as ad,Vi as ae,Xn as af,fc as ag,Ja as ah,Zf as ai,Yo as aj,md as ak,hd as al,qo as am,eu as an,Qo as ao,tl as ap,rl as aq,sl as ar,nl as as,Ag as at,wo as b,yi as c,Qd as d,Tt as e,wt as f,Bc as g,ot as h,ni as i,V as j,ui as k,zu as l,Qa as m,vn as n,Bu as o,_f as p,ho as q,lt as r,Ci as s,is as t,Wc as u,Ts as v,xt as w,ka as x,at as y,At as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.