UNPKG

wave-roll

Version:

JavaScript Library for Comparative MIDI Piano-Roll Visualization

6 lines 1.16 MB
(function(ys,O){typeof exports=="object"&&typeof module<"u"?O(exports):typeof define=="function"&&define.amd?define(["exports"],O):(ys=typeof globalThis<"u"?globalThis:ys||self,O(ys.WaveRoll={}))})(this,function(ys){"use strict";var O=(n=>(n.Application="application",n.WebGLPipes="webgl-pipes",n.WebGLPipesAdaptor="webgl-pipes-adaptor",n.WebGLSystem="webgl-system",n.WebGPUPipes="webgpu-pipes",n.WebGPUPipesAdaptor="webgpu-pipes-adaptor",n.WebGPUSystem="webgpu-system",n.CanvasSystem="canvas-system",n.CanvasPipesAdaptor="canvas-pipes-adaptor",n.CanvasPipes="canvas-pipes",n.Asset="asset",n.LoadParser="load-parser",n.ResolveParser="resolve-parser",n.CacheParser="cache-parser",n.DetectionParser="detection-parser",n.MaskEffect="mask-effect",n.BlendMode="blend-mode",n.TextureSource="texture-source",n.Environment="environment",n.ShapeBuilder="shape-builder",n.Batcher="batcher",n))(O||{});const dl=n=>{if(typeof n=="function"||typeof n=="object"&&n.extension){if(!n.extension)throw new Error("Extension class must have an extension object");n={...typeof n.extension!="object"?{type:n.extension}:n.extension,ref:n}}if(typeof n=="object")n={...n};else throw new Error("Invalid extension type");return typeof n.type=="string"&&(n.type=[n.type]),n},Co=(n,t)=>dl(n).priority??t,st={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...n){return n.map(dl).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...n){return n.map(dl).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(n,t,e){const s=this._addHandlers,i=this._removeHandlers;if(s[n]||i[n])throw new Error(`Extension type ${n} already has a handler`);s[n]=t,i[n]=e;const r=this._queue;return r[n]&&(r[n]?.forEach(o=>t(o)),delete r[n]),this},handleByMap(n,t){return this.handle(n,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(n,t,e=-1){return this.handle(n,s=>{t.findIndex(r=>r.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((r,o)=>Co(o.value,e)-Co(r.value,e)))},s=>{const i=t.findIndex(r=>r.name===s.name);i!==-1&&t.splice(i,1)})},handleByList(n,t,e=-1){return this.handle(n,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((i,r)=>Co(r,e)-Co(i,e)))},s=>{const i=t.indexOf(s.ref);i!==-1&&t.splice(i,1)})},mixin(n,...t){for(const e of t)Object.defineProperties(n.prototype,Object.getOwnPropertyDescriptors(e))}},V0={extension:{type:O.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.resolve().then(()=>xD)}},z0={extension:{type:O.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>vD)}};class Bt{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new Bt(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))}}function Md(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function H0(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var t=n.default;if(typeof t=="function"){var e=function s(){var i=!1;try{i=this instanceof s}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(n).forEach(function(s){var i=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:function(){return n[s]}})}),e}var fl={exports:{}},Cd;function W0(){return Cd||(Cd=1,function(n){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function i(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function r(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new i(h,u||l,d),p=e?e+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],f]:l._events[p].push(f):(l._events[p]=f,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)t.call(h,u)&&c.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},a.prototype.listeners=function(c){var h=e?e+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d<f;d++)p[d]=u[d].fn;return p},a.prototype.listenerCount=function(c){var h=e?e+c:c,u=this._events[h];return u?u.fn?1:u.length:0},a.prototype.emit=function(c,h,u,d,f,p){var g=e?e+c:c;if(!this._events[g])return!1;var m=this._events[g],y=arguments.length,_,v;if(m.fn){switch(m.once&&this.removeListener(c,m.fn,void 0,!0),y){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,h),!0;case 3:return m.fn.call(m.context,h,u),!0;case 4:return m.fn.call(m.context,h,u,d),!0;case 5:return m.fn.call(m.context,h,u,d,f),!0;case 6:return m.fn.call(m.context,h,u,d,f,p),!0}for(v=1,_=new Array(y-1);v<y;v++)_[v-1]=arguments[v];m.fn.apply(m.context,_)}else{var x=m.length,b;for(v=0;v<x;v++)switch(m[v].once&&this.removeListener(c,m[v].fn,void 0,!0),y){case 1:m[v].fn.call(m[v].context);break;case 2:m[v].fn.call(m[v].context,h);break;case 3:m[v].fn.call(m[v].context,h,u);break;case 4:m[v].fn.call(m[v].context,h,u,d);break;default:if(!_)for(b=1,_=new Array(y-1);b<y;b++)_[b-1]=arguments[b];m[v].fn.apply(m[v].context,_)}}return!0},a.prototype.on=function(c,h,u){return r(this,c,h,u,!1)},a.prototype.once=function(c,h,u){return r(this,c,h,u,!0)},a.prototype.removeListener=function(c,h,u,d){var f=e?e+c:c;if(!this._events[f])return this;if(!h)return o(this,f),this;var p=this._events[f];if(p.fn)p.fn===h&&(!d||p.once)&&(!u||p.context===u)&&o(this,f);else{for(var g=0,m=[],y=p.length;g<y;g++)(p[g].fn!==h||d&&!p[g].once||u&&p[g].context!==u)&&m.push(p[g]);m.length?this._events[f]=m.length===1?m[0]:m:o(this,f)}return this},a.prototype.removeAllListeners=function(c){var h;return c?(h=e?e+c:c,this._events[h]&&o(this,h)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,n.exports=a}(fl)),fl.exports}var q0=W0();const Re=Md(q0),$0=Math.PI*2,j0=180/Math.PI,X0=Math.PI/180;class Tt{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new Tt(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 pl.x=0,pl.y=0,pl}}const pl=new Tt;class X{constructor(t=1,e=0,s=0,i=1,r=0,o=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=i,this.tx=r,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,r,o){return this.a=t,this.b=e,this.c=s,this.d=i,this.tx=r,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 Tt;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 Tt;const s=this.a,i=this.b,r=this.c,o=this.d,a=this.tx,l=this.ty,c=1/(s*o+r*-i),h=t.x,u=t.y;return e.x=o*c*h+-r*c*u+(l*r-a*o)*c,e.y=s*c*u+-i*c*h+(-l*s+a*i)*c,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,r=this.c,o=this.tx;return this.a=i*e-this.b*s,this.b=i*s+this.b*e,this.c=r*e-this.d*s,this.d=r*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,r=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*s+t.b*r,this.c=t.c*e+t.d*i,this.d=t.c*s+t.d*r,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*s+t.ty*r+this.ty,this}appendFrom(t,e){const s=t.a,i=t.b,r=t.c,o=t.d,a=t.tx,l=t.ty,c=e.a,h=e.b,u=e.c,d=e.d;return this.a=s*c+i*u,this.b=s*h+i*d,this.c=r*c+o*u,this.d=r*h+o*d,this.tx=a*c+l*u+e.tx,this.ty=a*h+l*d+e.ty,this}setTransform(t,e,s,i,r,o,a,l,c){return this.a=Math.cos(a+c)*r,this.b=Math.sin(a+c)*r,this.c=-Math.sin(a-l)*o,this.d=Math.cos(a-l)*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,r=this.d,o=t.pivot,a=-Math.atan2(-i,r),l=Math.atan2(s,e),c=Math.abs(a+l);return c<1e-5||Math.abs($0-c)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=l),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(i*i+r*r),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*s+o.y*r),t}invert(){const t=this.a,e=this.b,s=this.c,i=this.d,r=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*r)/o,this.ty=-(t*this.ty-e*r)/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 X;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 K0.identity()}static get shared(){return Y0.identity()}}const Y0=new X,K0=new X,Sn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Mn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Cn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],En=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],ml=[],Ed=[],Eo=Math.sign;function Z0(){for(let n=0;n<16;n++){const t=[];ml.push(t);for(let e=0;e<16;e++){const s=Eo(Sn[n]*Sn[e]+Cn[n]*Mn[e]),i=Eo(Mn[n]*Sn[e]+En[n]*Mn[e]),r=Eo(Sn[n]*Cn[e]+Cn[n]*En[e]),o=Eo(Mn[n]*Cn[e]+En[n]*En[e]);for(let a=0;a<16;a++)if(Sn[a]===s&&Mn[a]===i&&Cn[a]===r&&En[a]===o){t.push(a);break}}}for(let n=0;n<16;n++){const t=new X;t.set(Sn[n],Mn[n],Cn[n],En[n],0,0),Ed.push(t)}}Z0();const vt={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:n=>Sn[n],uY:n=>Mn[n],vX:n=>Cn[n],vY:n=>En[n],inv:n=>n&8?n&15:-n&7,add:(n,t)=>ml[n][t],sub:(n,t)=>ml[n][vt.inv(t)],rotate180:n=>n^4,isVertical:n=>(n&3)===2,byDirection:(n,t)=>Math.abs(n)*2<=Math.abs(t)?t>=0?vt.S:vt.N:Math.abs(t)*2<=Math.abs(n)?n>0?vt.E:vt.W:t>0?n>0?vt.SE:vt.SW:n>0?vt.NE:vt.NW,matrixAppendRotationInv:(n,t,e=0,s=0)=>{const i=Ed[vt.inv(t)];i.tx=e,i.ty=s,n.append(i)},transformRectCoords:(n,t,e,s)=>{const{x:i,y:r,width:o,height:a}=n,{x:l,y:c,width:h,height:u}=t;return e===vt.E?(s.set(i+l,r+c,o,a),s):e===vt.S?s.set(h-r-a+l,i+c,a,o):e===vt.W?s.set(h-i-o+l,u-r-a+c,o,a):e===vt.N?s.set(r+l,u-i-o+c,a,o):s.set(i+l,r+c,o,a)}},ko=[new Tt,new Tt,new Tt,new Tt];class gt{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 gt(0,0,0,0)}clone(){return new gt(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:r,height:o}=this;if(r<=0||o<=0)return!1;const a=this.x,l=this.y,c=s*(1-i),h=s-c,u=a-c,d=a+r+c,f=l-c,p=l+o+c,g=a+h,m=a+r-h,y=l+h,_=l+o-h;return t>=u&&t<=d&&e>=f&&e<=p&&!(t>g&&t<m&&e>y&&e<_)}intersects(t,e){if(!e){const M=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=M)return!1;const C=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>C}const s=this.left,i=this.right,r=this.top,o=this.bottom;if(i<=s||o<=r)return!1;const a=ko[0].set(t.left,t.top),l=ko[1].set(t.left,t.bottom),c=ko[2].set(t.right,t.top),h=ko[3].set(t.right,t.bottom);if(c.x<=a.x||l.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(l,l),e.apply(c,c),e.apply(h,h),Math.max(a.x,l.x,c.x,h.x)<=s||Math.min(a.x,l.x,c.x,h.x)>=i||Math.max(a.y,l.y,c.y,h.y)<=r||Math.min(a.y,l.y,c.y,h.y)>=o))return!1;const d=u*(l.y-a.y),f=u*(a.x-l.x),p=d*s+f*r,g=d*i+f*r,m=d*s+f*o,y=d*i+f*o;if(Math.max(p,g,m,y)<=d*a.x+f*a.y||Math.min(p,g,m,y)>=d*h.x+f*h.y)return!1;const _=u*(a.y-c.y),v=u*(c.x-a.x),x=_*s+v*r,b=_*i+v*r,w=_*s+v*o,T=_*i+v*o;return!(Math.max(x,b,w,T)<=_*a.x+v*a.y||Math.min(x,b,w,T)>=_*h.x+v*h.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),r=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(r-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),r=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=i,this.height=r-i,this}getBounds(t){return t||(t=new gt),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,r=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&&r>=this.y&&r<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 gl={default:-1};function Mt(n="default"){return gl[n]===void 0&&(gl[n]=-1),++gl[n]}const kd={},ut="8.0.0",Q0="8.3.4";function it(n,t,e=3){if(kd[t])return;let s=new Error().stack;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${n}`):(s=s.split(` `).splice(e).join(` `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} Deprecated since v${n}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${n}`),console.warn(s))),kd[t]=!0}const Pd=()=>{};function ni(n){return n+=n===0?1:0,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1}function Ad(n){return!(n&n-1)&&!!n}function Id(n){const t={};for(const e in n)n[e]!==void 0&&(t[e]=n[e]);return t}const Rd=Object.create(null);function J0(n){const t=Rd[n];return t===void 0&&(Rd[n]=Mt("resource")),t}const Fd=class y0 extends Re{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...y0.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){it(ut,"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()}update(){this.emit("change",this),this._sharedResourceId=null}_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=J0(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Fd.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let _s=Fd;const Dd=class _0 extends Re{constructor(t={}){super(),this.options=t,this.uid=Mt("textureSource"),this._resourceType="textureSource",this._resourceId=Mt("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.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={..._0.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.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new _s(Id(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.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=Mt("resource"),this.emit("change",this),this.emit("unload",this)}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),r=Math.round(e*s);return this.width=i/s,this.height=r/s,this._resolution=s,this.pixelWidth===i&&this.pixelHeight===r?!1:(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=r,this.emit("resize",this),this._resourceId=Mt("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=Ad(this.pixelWidth)&&Ad(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Dd.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let qt=Dd;class yl extends qt{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}}yl.extension=O.TextureSource;const Od=new X;class Bd{constructor(t,e){this.mapCoord=new X,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 r=t[i],o=t[i+1];e[i]=r*s.a+o*s.c+s.tx,e[i+1]=r*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&&(Od.set(s.width/i.width,0,0,s.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(Od));const r=t.source,o=this.uClampFrame,a=this.clampMargin/r._resolution,l=this.clampOffset/r._resolution;return o[0]=(t.frame.x+a+l)/r.width,o[1]=(t.frame.y+a+l)/r.height,o[2]=(t.frame.x+t.frame.width-a+l)/r.width,o[3]=(t.frame.y+t.frame.height-a+l)/r.height,this.uClampOffset[0]=this.clampOffset/r.pixelWidth,this.uClampOffset[1]=this.clampOffset/r.pixelHeight,this.isSimple=t.frame.width===r.width&&t.frame.height===r.height&&t.rotate===0,!0}}class $ extends Re{constructor({source:t,label:e,frame:s,orig:i,trim:r,defaultAnchor:o,defaultBorders:a,rotate:l,dynamic:c}={}){if(super(),this.uid=Mt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new gt,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new qt,this.noFrame=!s,s)this.frame.copyFrom(s);else{const{width:h,height:u}=this._source;this.frame.width=h,this.frame.height=u}this.orig=i||this.frame,this.trim=r,this.rotate=l??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=!1,this.dynamic=c||!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 Bd(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,r=e.x/s,o=e.y/i,a=e.width/s,l=e.height/i;let c=this.rotate;if(c){const h=a/2,u=l/2,d=r+h,f=o+u;c=vt.add(c,vt.NW),t.x0=d+h*vt.uX(c),t.y0=f+u*vt.uY(c),c=vt.add(c,2),t.x1=d+h*vt.uX(c),t.y1=f+u*vt.uY(c),c=vt.add(c,2),t.x2=d+h*vt.uX(c),t.y2=f+u*vt.uY(c),c=vt.add(c,2),t.x3=d+h*vt.uX(c),t.y3=f+u*vt.uY(c)}else t.x0=r,t.y0=o,t.x1=r+a,t.y1=o,t.x2=r+a,t.y2=o+l,t.x3=r,t.y3=o+l}destroy(t=!1){this._source&&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 it(ut,"Texture.baseTexture is now Texture.source"),this._source}}$.EMPTY=new $({label:"EMPTY",source:new qt({label:"EMPTY"})}),$.EMPTY.destroy=Pd,$.WHITE=new $({source:new yl({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),$.WHITE.destroy=Pd;function Nd(n,t,e){const{width:s,height:i}=e.orig,r=e.trim;if(r){const o=r.width,a=r.height;n.minX=r.x-t._x*s,n.maxX=n.minX+o,n.minY=r.y-t._y*i,n.maxY=n.minY+a}else n.minX=-t._x*s,n.maxX=n.minX+s,n.minY=-t._y*i,n.maxY=n.minY+i}const Ld=new X;class ce{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=Ld,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 gt);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=Ld,this}set(t,e,s,i){this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}addFrame(t,e,s,i,r){r||(r=this.matrix);const o=r.a,a=r.b,l=r.c,c=r.d,h=r.tx,u=r.ty;let d=this.minX,f=this.minY,p=this.maxX,g=this.maxY,m=o*t+l*e+h,y=a*t+c*e+u;m<d&&(d=m),y<f&&(f=y),m>p&&(p=m),y>g&&(g=y),m=o*s+l*e+h,y=a*s+c*e+u,m<d&&(d=m),y<f&&(f=y),m>p&&(p=m),y>g&&(g=y),m=o*t+l*i+h,y=a*t+c*i+u,m<d&&(d=m),y<f&&(f=y),m>p&&(p=m),y>g&&(g=y),m=o*s+l*i+h,y=a*s+c*i+u,m<d&&(d=m),y<f&&(f=y),m>p&&(p=m),y>g&&(g=y),this.minX=d,this.minY=f,this.maxX=p,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,r=this.maxY,{a:o,b:a,c:l,d:c,tx:h,ty:u}=t;let d=o*e+l*s+h,f=a*e+c*s+u;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=o*i+l*s+h,f=a*i+c*s+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*e+l*r+h,f=a*e+c*r+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*i+l*r+h,f=a*i+c*r+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f: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 ce(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 r=this.minX,o=this.minY,a=this.maxX,l=this.maxY;i||(i=this.matrix);const c=i.a,h=i.b,u=i.c,d=i.d,f=i.tx,p=i.ty;for(let g=e;g<s;g+=2){const m=t[g],y=t[g+1],_=c*m+u*y+f,v=h*m+d*y+p;r=_<r?_:r,o=v<o?v:o,a=_>a?_:a,l=v>l?v:l}this.minX=r,this.minY=o,this.maxX=a,this.maxY=l}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 tv={grad:.9,turn:360,rad:360/(2*Math.PI)},Rs=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},Yt=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*n)/e+0},$e=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),n>e?e:n>t?n:t},Gd=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},Ud=function(n){return{r:$e(n.r,0,255),g:$e(n.g,0,255),b:$e(n.b,0,255),a:$e(n.a)}},_l=function(n){return{r:Yt(n.r),g:Yt(n.g),b:Yt(n.b),a:Yt(n.a,3)}},ev=/^#([0-9a-f]{3,8})$/i,Po=function(n){var t=n.toString(16);return t.length<2?"0"+t:t},Vd=function(n){var t=n.r,e=n.g,s=n.b,i=n.a,r=Math.max(t,e,s),o=r-Math.min(t,e,s),a=o?r===t?(e-s)/o:r===e?2+(s-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:i}},zd=function(n){var t=n.h,e=n.s,s=n.v,i=n.a;t=t/360*6,e/=100,s/=100;var r=Math.floor(t),o=s*(1-e),a=s*(1-(t-r)*e),l=s*(1-(1-t+r)*e),c=r%6;return{r:255*[s,a,o,o,l,s][c],g:255*[l,s,s,a,o,o][c],b:255*[o,o,l,s,s,a][c],a:i}},Hd=function(n){return{h:Gd(n.h),s:$e(n.s,0,100),l:$e(n.l,0,100),a:$e(n.a)}},Wd=function(n){return{h:Yt(n.h),s:Yt(n.s),l:Yt(n.l),a:Yt(n.a,3)}},qd=function(n){return zd((e=(t=n).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},er=function(n){return{h:(t=Vd(n)).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},sv=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,nv=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iv=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rv=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xl={string:[[function(n){var t=ev.exec(n);return t?(n=t[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?Yt(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?Yt(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var t=iv.exec(n)||rv.exec(n);return t?t[2]!==t[4]||t[4]!==t[6]?null:Ud({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(n){var t=sv.exec(n)||nv.exec(n);if(!t)return null;var e,s,i=Hd({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(tv[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return qd(i)},"hsl"]],object:[[function(n){var t=n.r,e=n.g,s=n.b,i=n.a,r=i===void 0?1:i;return Rs(t)&&Rs(e)&&Rs(s)?Ud({r:Number(t),g:Number(e),b:Number(s),a:Number(r)}):null},"rgb"],[function(n){var t=n.h,e=n.s,s=n.l,i=n.a,r=i===void 0?1:i;if(!Rs(t)||!Rs(e)||!Rs(s))return null;var o=Hd({h:Number(t),s:Number(e),l:Number(s),a:Number(r)});return qd(o)},"hsl"],[function(n){var t=n.h,e=n.s,s=n.v,i=n.a,r=i===void 0?1:i;if(!Rs(t)||!Rs(e)||!Rs(s))return null;var o=function(a){return{h:Gd(a.h),s:$e(a.s,0,100),v:$e(a.v,0,100),a:$e(a.a)}}({h:Number(t),s:Number(e),v:Number(s),a:Number(r)});return zd(o)},"hsv"]]},$d=function(n,t){for(var e=0;e<t.length;e++){var s=t[e][0](n);if(s)return[s,t[e][1]]}return[null,void 0]},ov=function(n){return typeof n=="string"?$d(n.trim(),xl.string):typeof n=="object"&&n!==null?$d(n,xl.object):[null,void 0]},vl=function(n,t){var e=er(n);return{h:e.h,s:$e(e.s+100*t,0,100),l:e.l,a:e.a}},bl=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},jd=function(n,t){var e=er(n);return{h:e.h,s:e.s,l:$e(e.l+100*t,0,100),a:e.a}},wl=function(){function n(t){this.parsed=ov(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return Yt(bl(this.rgba),2)},n.prototype.isDark=function(){return bl(this.rgba)<.5},n.prototype.isLight=function(){return bl(this.rgba)>=.5},n.prototype.toHex=function(){return t=_l(this.rgba),e=t.r,s=t.g,i=t.b,o=(r=t.a)<1?Po(Yt(255*r)):"","#"+Po(e)+Po(s)+Po(i)+o;var t,e,s,i,r,o},n.prototype.toRgb=function(){return _l(this.rgba)},n.prototype.toRgbString=function(){return t=_l(this.rgba),e=t.r,s=t.g,i=t.b,(r=t.a)<1?"rgba("+e+", "+s+", "+i+", "+r+")":"rgb("+e+", "+s+", "+i+")";var t,e,s,i,r},n.prototype.toHsl=function(){return Wd(er(this.rgba))},n.prototype.toHslString=function(){return t=Wd(er(this.rgba)),e=t.h,s=t.s,i=t.l,(r=t.a)<1?"hsla("+e+", "+s+"%, "+i+"%, "+r+")":"hsl("+e+", "+s+"%, "+i+"%)";var t,e,s,i,r},n.prototype.toHsv=function(){return t=Vd(this.rgba),{h:Yt(t.h),s:Yt(t.s),v:Yt(t.v),a:Yt(t.a,3)};var t},n.prototype.invert=function(){return xs({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},n.prototype.saturate=function(t){return t===void 0&&(t=.1),xs(vl(this.rgba,t))},n.prototype.desaturate=function(t){return t===void 0&&(t=.1),xs(vl(this.rgba,-t))},n.prototype.grayscale=function(){return xs(vl(this.rgba,-1))},n.prototype.lighten=function(t){return t===void 0&&(t=.1),xs(jd(this.rgba,t))},n.prototype.darken=function(t){return t===void 0&&(t=.1),xs(jd(this.rgba,-t))},n.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},n.prototype.alpha=function(t){return typeof t=="number"?xs({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):Yt(this.rgba.a,3);var e},n.prototype.hue=function(t){var e=er(this.rgba);return typeof t=="number"?xs({h:t,s:e.s,l:e.l,a:e.a}):Yt(e.h)},n.prototype.isEqual=function(t){return this.toHex()===xs(t).toHex()},n}(),xs=function(n){return n instanceof wl?n:new wl(n)},Xd=[],av=function(n){n.forEach(function(t){Xd.indexOf(t)<0&&(t(wl,xl),Xd.push(t))})};function lv(n,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 r={};n.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,c=s[this.toHex()];if(c)return c;if(o?.closest){var h=this.toRgb(),u=1/0,d="black";if(!r.length)for(var f in e)r[f]=new n(e[f]).toRgb();for(var p in e){var g=(a=h,l=r[p],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));g<u&&(u=g,d=p)}return d}},t.string.push([function(o){var a=o.toLowerCase(),l=a==="transparent"?"#0000":e[a];return l?new n(l).toRgb():null},"name"])}av([lv]);const ii=class So{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 So)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((r,o)=>r===e[o]);if(t!==null&&e!==null){const r=Object.keys(t),o=Object.keys(e);return r.length!==o.length?!1:r.every(a=>t[a]===e[a])}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,r]=this._components;return t[0]=e,t[1]=s,t[2]=i,t[3]=r,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,r]=So._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=i,this._components[3]*=r,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,r=this._int&255;return e&&(s=s*t+.5|0,i=i*t+.5|0,r=r*t+.5|0),(t*255<<24)+(s<<16)+(i<<8)+r}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}_normalize(t){let e,s,i,r;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,r=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,i,r=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,r=255]=t,e/=255,s/=255,i/=255,r/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=So.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=xs(t);o.isValid()&&({r:e,g:s,b:i,a:r}=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]=r,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,r)=>{t[r]=Math.min(Math.max(i,e),s)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof So||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}};ii.shared=new ii,ii._temp=new ii,ii.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Ct=ii;const cv={cullArea:null,cullable:!1,cullableChildren:!0};let Tl=0;const Yd=500;function rt(...n){Tl!==Yd&&(Tl++,Tl===Yd?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...n))}class Sl{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,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(){this._pool.length=0,this._index=0}}class hv{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 Sl(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}}const se=new hv,uv={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(n){typeof n=="boolean"&&n===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(n===!0?{}:n))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(n){it("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(n)}};function Kd(n,t,e){const s=n.length;let i;if(t>=s||e===0)return;e=t+e>s?s-t:e;const r=s-e;for(i=t;i<r;++i)n[i]=n[i+e];n.length=r}const dv={allowChildren:!0,removeChildren(n=0,t){const e=t??this.children.length,s=e-n,i=[];if(s>0&&s<=e){for(let o=e-1;o>=n;o--){const a=this.children[o];a&&(i.push(a),a.parent=null)}Kd(this.children,n,e);const r=this.renderGroup||this.parentRenderGroup;r&&r.removeChildren(i);for(let o=0;o<i.length;++o){const a=i[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,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(n){const t=this.getChildAt(n);return this.removeChild(t)},getChildAt(n){if(n<0||n>=this.children.length)throw new Error(`getChildAt: Index (${n}) does not exist.`);return this.children[n]},setChildIndex(n,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(n),this.addChildAt(n,t)},getChildIndex(n){const t=this.children.indexOf(n);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(n,t){this.allowChildren||it(ut,"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(`${n}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(n.parent){const i=n.parent.children.indexOf(n);if(n.parent===this&&i===t)return n;i!==-1&&n.parent.children.splice(i,1)}t===e.length?e.push(n):e.splice(t,0,n),n.parent=this,n.didChange=!0,n._updateFlags=15;const s=this.renderGroup||this.parentRenderGroup;return s&&s.addChild(n),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",n,this,t),n.emit("added",this),n},swapChildren(n,t){if(n===t)return;const e=this.getChildIndex(n),s=this.getChildIndex(t);this.children[e]=t,this.children[s]=n;const i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...n){return n.length===1?this.reparentChildAt(n[0],this.children.length):(n.forEach(t=>this.reparentChildAt(t,this.children.length)),n[0])},reparentChildAt(n,t){if(n.parent===this)return this.setChildIndex(n,t),n;const e=n.worldTransform.clone();n.removeFromParent(),this.addChildAt(n,t);const s=this.worldTransform.clone();return s.invert(),e.prepend(s),n.setFromMatrix(e),n},replaceChild(n,t){n.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(n)),t.setFromMatrix(n.localTransform),t.updateLocalTransform(),this.removeChild(n)}},fv={collectRenderables(n,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(n,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,n):this.collectRenderablesWithEffects(n,t,e))},collectRenderablesSimple(n,t,e){const s=this.children,i=s.length;for(let r=0;r<i;r++)s[r].collectRenderables(n,t,e)},collectRenderablesWithEffects(n,t,e){const{renderPipes:s}=t;for(let i=0;i<this.effects.length;i++){const r=this.effects[i];s[r.pipe].push(r,this,n)}this.collectRenderablesSimple(n,t,e);for(let i=this.effects.length-1;i>=0;i--){const r=this.effects[i];s[r.pipe].pop(r,this,n)}}};class Ao{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 pv{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 se.get(s.maskClass,t)}return t}returnMaskEffect(t){se.return(t)}}const Ml=new pv;st.handleByList(O.MaskEffect,Ml._