UNPKG

@drincs/pixi-vn

Version:

Pixi'VN is a npm package that provides various features for creating visual novels.

6 lines 379 kB
var rx=Object.create;var Yi=Object.defineProperty;var ix=Object.getOwnPropertyDescriptor;var sx=Object.getOwnPropertyNames;var ox=Object.getPrototypeOf,nx=Object.prototype.hasOwnProperty;var ax=(i,t,e)=>t in i?Yi(i,t,{enumerable:true,configurable:true,writable:true,value:e}):i[t]=e;var p=(i,t)=>()=>(i&&(t=i(i=0)),t);var Ml=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),lx=(i,t)=>{for(var e in t)Yi(i,e,{get:t[e],enumerable:true});},hx=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of sx(t))!nx.call(i,s)&&s!==e&&Yi(i,s,{get:()=>t[s],enumerable:!(r=ix(t,s))||r.enumerable});return i};var Cl=(i,t,e)=>(e=i!=null?rx(ox(i)):{},hx(Yi(e,"default",{value:i,enumerable:true}),i));var rt=(i,t,e)=>ax(i,typeof t!="symbol"?t+"":t,e);var S,Io,Lr,I,B=p(()=>{S=(i=>(i.Application="application",i.WebGLPipes="webgl-pipes",i.WebGLPipesAdaptor="webgl-pipes-adaptor",i.WebGLSystem="webgl-system",i.WebGPUPipes="webgpu-pipes",i.WebGPUPipesAdaptor="webgpu-pipes-adaptor",i.WebGPUSystem="webgpu-system",i.CanvasSystem="canvas-system",i.CanvasPipesAdaptor="canvas-pipes-adaptor",i.CanvasPipes="canvas-pipes",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i.MaskEffect="mask-effect",i.BlendMode="blend-mode",i.TextureSource="texture-source",i.Environment="environment",i.ShapeBuilder="shape-builder",i.Batcher="batcher",i))(S||{}),Io=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i};}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i},Lr=(i,t)=>Io(i).priority??t,I={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(Io).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t));}),this},add(...i){return i.map(Io).forEach(t=>{t.type.forEach(e=>{let r=this._addHandlers,s=this._queue;r[e]?r[e]?.(t):(s[e]=s[e]||[],s[e]?.push(t));});}),this},handle(i,t,e){let r=this._addHandlers,s=this._removeHandlers;if(r[i]||s[i])throw new Error(`Extension type ${i} already has a handler`);r[i]=t,s[i]=e;let o=this._queue;return o[i]&&(o[i]?.forEach(n=>t(n)),delete o[i]),this},handleByMap(i,t){return this.handle(i,e=>{e.name&&(t[e.name]=e.ref);},e=>{e.name&&delete t[e.name];})},handleByNamedList(i,t,e=-1){return this.handle(i,r=>{t.findIndex(o=>o.name===r.name)>=0||(t.push({name:r.name,value:r.ref}),t.sort((o,n)=>Lr(n.value,e)-Lr(o.value,e)));},r=>{let s=t.findIndex(o=>o.name===r.name);s!==-1&&t.splice(s,1);})},handleByList(i,t,e=-1){return this.handle(i,r=>{t.includes(r.ref)||(t.push(r.ref),t.sort((s,o)=>Lr(o,e)-Lr(s,e)));},r=>{let s=t.indexOf(r.ref);s!==-1&&t.splice(s,1);})},mixin(i,...t){for(let e of t)Object.defineProperties(i.prototype,Object.getOwnPropertyDescriptors(e));}};});var Bl=Ml((py,Ro)=>{var ux=Object.prototype.hasOwnProperty,Tt="~";function Ur(){}Object.create&&(Ur.prototype=Object.create(null),new Ur().__proto__||(Tt=false));function cx(i,t,e){this.fn=i,this.context=t,this.once=e||false;}function Fl(i,t,e,r,s){if(typeof e!="function")throw new TypeError("The listener must be a function");var o=new cx(e,r||i,s),n=Tt?Tt+t:t;return i._events[n]?i._events[n].fn?i._events[n]=[i._events[n],o]:i._events[n].push(o):(i._events[n]=o,i._eventsCount++),i}function Ji(i,t){--i._eventsCount===0?i._events=new Ur:delete i._events[t];}function vt(){this._events=new Ur,this._eventsCount=0;}vt.prototype.eventNames=function(){var t=[],e,r;if(this._eventsCount===0)return t;for(r in e=this._events)ux.call(e,r)&&t.push(Tt?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};vt.prototype.listeners=function(t){var e=Tt?Tt+t:t,r=this._events[e];if(!r)return [];if(r.fn)return [r.fn];for(var s=0,o=r.length,n=new Array(o);s<o;s++)n[s]=r[s].fn;return n};vt.prototype.listenerCount=function(t){var e=Tt?Tt+t:t,r=this._events[e];return r?r.fn?1:r.length:0};vt.prototype.emit=function(t,e,r,s,o,n){var a=Tt?Tt+t:t;if(!this._events[a])return false;var l=this._events[a],h=arguments.length,u,c;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,true),h){case 1:return l.fn.call(l.context),true;case 2:return l.fn.call(l.context,e),true;case 3:return l.fn.call(l.context,e,r),true;case 4:return l.fn.call(l.context,e,r,s),true;case 5:return l.fn.call(l.context,e,r,s,o),true;case 6:return l.fn.call(l.context,e,r,s,o,n),true}for(c=1,u=new Array(h-1);c<h;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u);}else {var f=l.length,d;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,true),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,s);break;default:if(!u)for(d=1,u=new Array(h-1);d<h;d++)u[d-1]=arguments[d];l[c].fn.apply(l[c].context,u);}}return true};vt.prototype.on=function(t,e,r){return Fl(this,t,e,r,false)};vt.prototype.once=function(t,e,r){return Fl(this,t,e,r,true)};vt.prototype.removeListener=function(t,e,r,s){var o=Tt?Tt+t:t;if(!this._events[o])return this;if(!e)return Ji(this,o),this;var n=this._events[o];if(n.fn)n.fn===e&&(!s||n.once)&&(!r||n.context===r)&&Ji(this,o);else {for(var a=0,l=[],h=n.length;a<h;a++)(n[a].fn!==e||s&&!n[a].once||r&&n[a].context!==r)&&l.push(n[a]);l.length?this._events[o]=l.length===1?l[0]:l:Ji(this,o);}return this};vt.prototype.removeAllListeners=function(t){var e;return t?(e=Tt?Tt+t:t,this._events[e]&&Ji(this,e)):(this._events=new Ur,this._eventsCount=0),this};vt.prototype.off=vt.prototype.removeListener;vt.prototype.addListener=vt.prototype.on;vt.prefixed=Tt;vt.EventEmitter=vt;typeof Ro<"u"&&(Ro.exports=vt);});var kl,N,Et=p(()=>{kl=Cl(Bl()),N=kl.default;});var dx,ae,gt,zt,zl,Gl,Do,fx,ts,Wl,Vl,Il,Rl,Dl,Or,px,mx,xx,gx,Oo,Ll,_x,Lo,Uo,Ul,zo,Nt,Ol,Hl,Nl=p(()=>{dx={grad:.9,turn:360,rad:360/(2*Math.PI)},ae=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},gt=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},zt=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},zl=function(i){return (i=isFinite(i)?i%360:0)>0?i:i+360},Gl=function(i){return {r:zt(i.r,0,255),g:zt(i.g,0,255),b:zt(i.b,0,255),a:zt(i.a)}},Do=function(i){return {r:gt(i.r),g:gt(i.g),b:gt(i.b),a:gt(i.a,3)}},fx=/^#([0-9a-f]{3,8})$/i,ts=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},Wl=function(i){var t=i.r,e=i.g,r=i.b,s=i.a,o=Math.max(t,e,r),n=o-Math.min(t,e,r),a=n?o===t?(e-r)/n:o===e?2+(r-t)/n:4+(t-e)/n:0;return {h:60*(a<0?a+6:a),s:o?n/o*100:0,v:o/255*100,a:s}},Vl=function(i){var t=i.h,e=i.s,r=i.v,s=i.a;t=t/360*6,e/=100,r/=100;var o=Math.floor(t),n=r*(1-e),a=r*(1-(t-o)*e),l=r*(1-(1-t+o)*e),h=o%6;return {r:255*[r,a,n,n,l,r][h],g:255*[l,r,r,a,n,n][h],b:255*[n,n,l,r,r,a][h],a:s}},Il=function(i){return {h:zl(i.h),s:zt(i.s,0,100),l:zt(i.l,0,100),a:zt(i.a)}},Rl=function(i){return {h:gt(i.h),s:gt(i.s),l:gt(i.l),a:gt(i.a,3)}},Dl=function(i){return Vl((e=(t=i).s,{h:t.h,s:(e*=((r=t.l)<50?r:100-r)/100)>0?2*e/(r+e)*100:0,v:r+e,a:t.a}));var t,e,r;},Or=function(i){return {h:(t=Wl(i)).h,s:(s=(200-(e=t.s))*(r=t.v)/100)>0&&s<200?e*r/100/(s<=100?s:200-s)*100:0,l:s/2,a:t.a};var t,e,r,s;},px=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,mx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Oo={string:[[function(i){var t=fx.exec(i);return t?(i=t[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?gt(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?gt(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=xx.exec(i)||gx.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:Gl({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(i){var t=px.exec(i)||mx.exec(i);if(!t)return null;var e,r,s=Il({h:(e=t[1],r=t[2],r===void 0&&(r="deg"),Number(e)*(dx[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Dl(s)},"hsl"]],object:[[function(i){var t=i.r,e=i.g,r=i.b,s=i.a,o=s===void 0?1:s;return ae(t)&&ae(e)&&ae(r)?Gl({r:Number(t),g:Number(e),b:Number(r),a:Number(o)}):null},"rgb"],[function(i){var t=i.h,e=i.s,r=i.l,s=i.a,o=s===void 0?1:s;if(!ae(t)||!ae(e)||!ae(r))return null;var n=Il({h:Number(t),s:Number(e),l:Number(r),a:Number(o)});return Dl(n)},"hsl"],[function(i){var t=i.h,e=i.s,r=i.v,s=i.a,o=s===void 0?1:s;if(!ae(t)||!ae(e)||!ae(r))return null;var n=function(a){return {h:zl(a.h),s:zt(a.s,0,100),v:zt(a.v,0,100),a:zt(a.a)}}({h:Number(t),s:Number(e),v:Number(r),a:Number(o)});return Vl(n)},"hsv"]]},Ll=function(i,t){for(var e=0;e<t.length;e++){var r=t[e][0](i);if(r)return [r,t[e][1]]}return [null,void 0]},_x=function(i){return typeof i=="string"?Ll(i.trim(),Oo.string):typeof i=="object"&&i!==null?Ll(i,Oo.object):[null,void 0]},Lo=function(i,t){var e=Or(i);return {h:e.h,s:zt(e.s+100*t,0,100),l:e.l,a:e.a}},Uo=function(i){return (299*i.r+587*i.g+114*i.b)/1e3/255},Ul=function(i,t){var e=Or(i);return {h:e.h,s:e.s,l:zt(e.l+100*t,0,100),a:e.a}},zo=function(){function i(t){this.parsed=_x(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1};}return i.prototype.isValid=function(){return this.parsed!==null},i.prototype.brightness=function(){return gt(Uo(this.rgba),2)},i.prototype.isDark=function(){return Uo(this.rgba)<.5},i.prototype.isLight=function(){return Uo(this.rgba)>=.5},i.prototype.toHex=function(){return t=Do(this.rgba),e=t.r,r=t.g,s=t.b,n=(o=t.a)<1?ts(gt(255*o)):"","#"+ts(e)+ts(r)+ts(s)+n;var t,e,r,s,o,n;},i.prototype.toRgb=function(){return Do(this.rgba)},i.prototype.toRgbString=function(){return t=Do(this.rgba),e=t.r,r=t.g,s=t.b,(o=t.a)<1?"rgba("+e+", "+r+", "+s+", "+o+")":"rgb("+e+", "+r+", "+s+")";var t,e,r,s,o;},i.prototype.toHsl=function(){return Rl(Or(this.rgba))},i.prototype.toHslString=function(){return t=Rl(Or(this.rgba)),e=t.h,r=t.s,s=t.l,(o=t.a)<1?"hsla("+e+", "+r+"%, "+s+"%, "+o+")":"hsl("+e+", "+r+"%, "+s+"%)";var t,e,r,s,o;},i.prototype.toHsv=function(){return t=Wl(this.rgba),{h:gt(t.h),s:gt(t.s),v:gt(t.v),a:gt(t.a,3)};var t;},i.prototype.invert=function(){return Nt({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t;},i.prototype.saturate=function(t){return t===void 0&&(t=.1),Nt(Lo(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),Nt(Lo(this.rgba,-t))},i.prototype.grayscale=function(){return Nt(Lo(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),Nt(Ul(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),Nt(Ul(this.rgba,-t))},i.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},i.prototype.alpha=function(t){return typeof t=="number"?Nt({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):gt(this.rgba.a,3);var e;},i.prototype.hue=function(t){var e=Or(this.rgba);return typeof t=="number"?Nt({h:t,s:e.s,l:e.l,a:e.a}):gt(e.h)},i.prototype.isEqual=function(t){return this.toHex()===Nt(t).toHex()},i}(),Nt=function(i){return i instanceof zo?i:new zo(i)},Ol=[],Hl=function(i){i.forEach(function(t){Ol.indexOf(t)<0&&(t(zo,Oo),Ol.push(t));});};});function $l(i,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"},r={};for(var s in e)r[e[s]]=s;var o={};i.prototype.toName=function(n){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return "transparent";var a,l,h=r[this.toHex()];if(h)return h;if(n?.closest){var u=this.toRgb(),c=1/0,f="black";if(!o.length)for(var d in e)o[d]=new i(e[d]).toRgb();for(var m in e){var g=(a=u,l=o[m],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));g<c&&(c=g,f=m);}return f}},t.string.push([function(n){var a=n.toLowerCase(),l=a==="transparent"?"#0000":e[a];return l?new i(l).toRgb():null},"name"]);}var Yl=p(()=>{});var Ze,H,Ft=p(()=>{Nl();Yl();Hl([$l]);Ze=class zr{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 zr)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){let r=typeof t;if(r!==typeof e)return false;if(r==="number"||r==="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?false:t.every((o,n)=>o===e[n]);if(t!==null&&e!==null){let o=Object.keys(t),n=Object.keys(e);return o.length!==n.length?false:o.every(a=>t[a]===e[a])}return t===e}toRgba(){let[t,e,r,s]=this._components;return {r:t,g:e,b:r,a:s}}toRgb(){let[t,e,r]=this._components;return {r:t,g:e,b:r}}toRgbaString(){let[t,e,r]=this.toUint8RgbArray();return `rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){let[e,r,s]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(r*255),t[2]=Math.round(s*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);let[e,r,s,o]=this._components;return t[0]=e,t[1]=r,t[2]=s,t[3]=o,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);let[e,r,s]=this._components;return t[0]=e,t[1]=r,t[2]=s,t}toNumber(){return this._int}toBgrNumber(){let[t,e,r]=this.toUint8RgbArray();return (r<<16)+(e<<8)+t}toLittleEndianNumber(){let t=this._int;return (t>>16)+(t&65280)+((t&255)<<16)}multiply(t){let[e,r,s,o]=zr._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=r,this._components[2]*=s,this._components[3]*=o,this._refreshInt(),this._value=null,this}premultiply(t,e=true){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=true){if(t===1)return (255<<24)+this._int;if(t===0)return e?0:this._int;let r=this._int>>16&255,s=this._int>>8&255,o=this._int&255;return e&&(r=r*t+.5|0,s=s*t+.5|0,o=o*t+.5|0),(t*255<<24)+(r<<16)+(s<<8)+o}toHex(){let t=this._int.toString(16);return `#${"000000".substring(0,6-t.length)+t}`}toHexa(){let 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,r,s,o;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){let n=t;e=(n>>16&255)/255,r=(n>>8&255)/255,s=(n&255)/255,o=1;}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,r,s,o=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,r,s,o=255]=t,e/=255,r/=255,s/=255,o/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){let a=zr.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`);}let n=Nt(t);n.isValid()&&({r:e,g:r,b:s,a:o}=n.rgba,e/=255,r/=255,s/=255);}if(e!==void 0)this._components[0]=e,this._components[1]=r,this._components[2]=s,this._components[3]=o,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);let[t,e,r]=this._components;this._int=(t*255<<16)+(e*255<<8)+(r*255|0);}_clamp(t,e=0,r=1){return typeof t=="number"?Math.min(Math.max(t,e),r):(t.forEach((s,o)=>{t[o]=Math.min(Math.max(s,e),r);}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof zr||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}};Ze.shared=new Ze;Ze._temp=new Ze;Ze.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;H=Ze;});var Xl,jl=p(()=>{Xl={cullArea:null,cullable:false,cullableChildren:true};});var ql,Kl,Zl,Wo=p(()=>{ql=Math.PI*2,Kl=180/Math.PI,Zl=Math.PI/180;});var $,Vo,qt=p(()=>{$=class i{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e;}clone(){return new i(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 Vo.x=0,Vo.y=0,Vo}},Vo=new $;});var M,yx,bx,tt=p(()=>{Wo();qt();M=class i{constructor(t=1,e=0,r=0,s=1,o=0,n=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=s,this.tx=o,this.ty=n;}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,r,s,o,n){return this.a=t,this.b=e,this.c=r,this.d=s,this.tx=o,this.ty=n,this}toArray(t,e){this.array||(this.array=new Float32Array(9));let r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(t,e){e=e||new $;let r=t.x,s=t.y;return e.x=this.a*r+this.c*s+this.tx,e.y=this.b*r+this.d*s+this.ty,e}applyInverse(t,e){e=e||new $;let r=this.a,s=this.b,o=this.c,n=this.d,a=this.tx,l=this.ty,h=1/(r*n+o*-s),u=t.x,c=t.y;return e.x=n*h*u+-o*h*c+(l*o-a*n)*h,e.y=r*h*c+-s*h*u+(-l*r+a*s)*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){let e=Math.cos(t),r=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*e-this.b*r,this.b=s*r+this.b*e,this.c=o*e-this.d*r,this.d=o*r+this.d*e,this.tx=n*e-this.ty*r,this.ty=n*r+this.ty*e,this}append(t){let e=this.a,r=this.b,s=this.c,o=this.d;return this.a=t.a*e+t.b*s,this.b=t.a*r+t.b*o,this.c=t.c*e+t.d*s,this.d=t.c*r+t.d*o,this.tx=t.tx*e+t.ty*s+this.tx,this.ty=t.tx*r+t.ty*o+this.ty,this}appendFrom(t,e){let r=t.a,s=t.b,o=t.c,n=t.d,a=t.tx,l=t.ty,h=e.a,u=e.b,c=e.c,f=e.d;return this.a=r*h+s*c,this.b=r*u+s*f,this.c=o*h+n*c,this.d=o*u+n*f,this.tx=a*h+l*c+e.tx,this.ty=a*u+l*f+e.ty,this}setTransform(t,e,r,s,o,n,a,l,h){return this.a=Math.cos(a+h)*o,this.b=Math.sin(a+h)*o,this.c=-Math.sin(a-l)*n,this.d=Math.cos(a-l)*n,this.tx=t-(r*this.a+s*this.c),this.ty=e-(r*this.b+s*this.d),this}prepend(t){let e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){let r=this.a,s=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*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){let e=this.a,r=this.b,s=this.c,o=this.d,n=t.pivot,a=-Math.atan2(-s,o),l=Math.atan2(r,e),h=Math.abs(a+l);return h<1e-5||Math.abs(ql-h)<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+r*r),t.scale.y=Math.sqrt(s*s+o*o),t.position.x=this.tx+(n.x*e+n.y*s),t.position.y=this.ty+(n.x*r+n.y*o),t}invert(){let t=this.a,e=this.b,r=this.c,s=this.d,o=this.tx,n=t*s-e*r;return this.a=s/n,this.b=-e/n,this.c=-r/n,this.d=t/n,this.tx=(r*this.ty-s*o)/n,this.ty=-(t*this.ty-e*o)/n,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(){let t=new i;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 bx.identity()}static get shared(){return yx.identity()}},yx=new M,bx=new M;});var wt,Ho=p(()=>{wt=class i{constructor(t,e,r){this._x=e||0,this._y=r||0,this._observer=t;}clone(t){return new i(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 Y(i="default"){return No[i]===void 0&&(No[i]=-1),++No[i]}var No,Pt=p(()=>{No={default:-1};});function G(i,t,e=3){if(Ql[t])return;let r=new Error().stack;typeof r>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${i}`):(r=r.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${i}`),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${i}`),console.warn(r))),Ql[t]=true;}var Ql,W,Jl,ht=p(()=>{Ql={},W="8.0.0",Jl="8.3.4";});var Fe,$o=p(()=>{Fe=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,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;}};});var Yo,pt,Be=p(()=>{$o();Yo=class{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 Fe(t)),this._poolsByClass.get(t)}stats(){let t={};return this._poolsByClass.forEach(e=>{let r=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[r]={free:e.totalFree,used:e.totalUsed,size:e.totalSize};}),t}},pt=new Yo;});var th,eh=p(()=>{ht();th={get isCachedAsTexture(){return !!this.renderGroup?.isCachedAsTexture},cacheAsTexture(i){typeof i=="boolean"&&i===false?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(i===true?{}:i));},updateCacheTexture(){this.renderGroup?.updateCacheTexture();},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(i){G("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(i);}};});function es(i,t,e){let r=i.length,s;if(t>=r||e===0)return;e=t+e>r?r-t:e;let o=r-e;for(s=t;s<o;++s)i[s]=i[s+e];i.length=o;}var Xo=p(()=>{});var rh,ih=p(()=>{Xo();ht();rh={allowChildren:true,removeChildren(i=0,t){let e=t??this.children.length,r=e-i,s=[];if(r>0&&r<=e){for(let n=e-1;n>=i;n--){let a=this.children[n];a&&(s.push(a),a.parent=null);}es(this.children,i,e);let o=this.renderGroup||this.parentRenderGroup;o&&o.removeChildren(s);for(let n=0;n<s.length;++n){let a=s[n];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,n),s[n].emit("removed",this);}return s.length>0&&this._didViewChangeTick++,s}else if(r===0&&this.children.length===0)return s;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(i){let t=this.getChildAt(i);return this.removeChild(t)},getChildAt(i){if(i<0||i>=this.children.length)throw new Error(`getChildAt: Index (${i}) does not exist.`);return this.children[i]},setChildIndex(i,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(i),this.addChildAt(i,t);},getChildIndex(i){let t=this.children.indexOf(i);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(i,t){this.allowChildren||G(W,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:e}=this;if(t<0||t>e.length)throw new Error(`${i}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(i.parent){let s=i.parent.children.indexOf(i);if(i.parent===this&&s===t)return i;s!==-1&&i.parent.children.splice(s,1);}t===e.length?e.push(i):e.splice(t,0,i),i.parent=this,i.didChange=true,i._updateFlags=15;let r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(i),this.sortableChildren&&(this.sortDirty=true),this.emit("childAdded",i,this,t),i.emit("added",this),i},swapChildren(i,t){if(i===t)return;let e=this.getChildIndex(i),r=this.getChildIndex(t);this.children[e]=t,this.children[r]=i;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true),this._didContainerChangeTick++;},removeFromParent(){this.parent?.removeChild(this);},reparentChild(...i){return i.length===1?this.reparentChildAt(i[0],this.children.length):(i.forEach(t=>this.reparentChildAt(t,this.children.length)),i[0])},reparentChildAt(i,t){if(i.parent===this)return this.setChildIndex(i,t),i;let e=i.worldTransform.clone();i.removeFromParent(),this.addChildAt(i,t);let r=this.worldTransform.clone();return r.invert(),e.prepend(r),i.setFromMatrix(e),i}};});var sh,oh=p(()=>{sh={collectRenderables(i,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(i,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,i):this.collectRenderablesWithEffects(i,t,e));},collectRenderablesSimple(i,t,e){let r=this.children,s=r.length;for(let o=0;o<s;o++)r[o].collectRenderables(i,t,e);},collectRenderablesWithEffects(i,t,e){let{renderPipes:r}=t;for(let s=0;s<this.effects.length;s++){let o=this.effects[s];r[o.pipe].push(o,this,i);}this.collectRenderablesSimple(i,t,e);for(let s=this.effects.length-1;s>=0;s--){let o=this.effects[s];r[o.pipe].pop(o,this,i);}}};});var Wr,nh=p(()=>{Wr=class{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;}};});var jo,rs,ah=p(()=>{B();Be();jo=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=false;}init(){this._initialized||(this._initialized=true,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++){let r=this._tests[e];if(r.test(t))return pt.get(r.maskClass,t)}return t}returnMaskEffect(t){pt.return(t);}},rs=new jo;I.handleByList(S.MaskEffect,rs._effectClasses);});var lh,hh=p(()=>{nh();ah();lh={_maskEffect:null,_maskOptions:{inverse:false},_filterEffect:null,effects:[],_markStructureAsChanged(){let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=true);},addEffect(i){this.effects.indexOf(i)===-1&&(this.effects.push(i),this.effects.sort((e,r)=>e.priority-r.priority),this._markStructureAsChanged(),this._updateIsSimple());},removeEffect(i){let t=this.effects.indexOf(i);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple());},set mask(i){let t=this._maskEffect;t?.mask!==i&&(t&&(this.removeEffect(t),rs.returnMaskEffect(t),this._maskEffect=null),i!=null&&(this._maskEffect=rs.getMaskEffect(i),this.addEffect(this._maskEffect)));},get mask(){return this._maskEffect?.mask},setMask(i){this._maskOptions={...this._maskOptions,...i},i.mask&&(this.mask=i.mask),this._markStructureAsChanged();},set filters(i){!Array.isArray(i)&&i&&(i=[i]);let t=this._filterEffect||(this._filterEffect=new Wr);i=i;let e=i?.length>0,r=t.filters?.length>0,s=e!==r;i=Array.isArray(i)?i.slice(0):i,t.filters=Object.freeze(i),s&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=i??null));},get filters(){return this._filterEffect?.filters},set filterArea(i){this._filterEffect||(this._filterEffect=new Wr),this._filterEffect.filterArea=i;},get filterArea(){return this._filterEffect?.filterArea}};});var uh,ch=p(()=>{ht();uh={label:null,get name(){return G(W,"Container.name property has been removed, use Container.label instead"),this.label},set name(i){G(W,"Container.name property has been removed, use Container.label instead"),this.label=i;},getChildByName(i,t=false){return this.getChildByLabel(i,t)},getChildByLabel(i,t=false){let e=this.children;for(let r=0;r<e.length;r++){let s=e[r];if(s.label===i||i instanceof RegExp&&i.test(s.label))return s}if(t)for(let r=0;r<e.length;r++){let o=e[r].getChildByLabel(i,true);if(o)return o}return null},getChildrenByLabel(i,t=false,e=[]){let r=this.children;for(let s=0;s<r.length;s++){let o=r[s];(o.label===i||i instanceof RegExp&&i.test(o.label))&&e.push(o);}if(t)for(let s=0;s<r.length;s++)r[s].getChildrenByLabel(i,true,e);return e}};});var is,j,Bt=p(()=>{qt();is=[new $,new $,new $,new $],j=class i{constructor(t=0,e=0,r=0,s=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(s);}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 i(0,0,0,0)}clone(){return new i(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?false:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,r,s=.5){let{width:o,height:n}=this;if(o<=0||n<=0)return false;let a=this.x,l=this.y,h=r*(1-s),u=r-h,c=a-h,f=a+o+h,d=l-h,m=l+n+h,g=a+u,x=a+o-u,_=l+u,y=l+n-u;return t>=c&&t<=f&&e>=d&&e<=m&&!(t>g&&t<x&&e>_&&e<y)}intersects(t,e){if(!e){let O=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=O)return false;let E=this.y<t.y?t.y:this.y;return (this.bottom>t.bottom?t.bottom:this.bottom)>E}let r=this.left,s=this.right,o=this.top,n=this.bottom;if(s<=r||n<=o)return false;let a=is[0].set(t.left,t.top),l=is[1].set(t.left,t.bottom),h=is[2].set(t.right,t.top),u=is[3].set(t.right,t.bottom);if(h.x<=a.x||l.y<=a.y)return false;let c=Math.sign(e.a*e.d-e.b*e.c);if(c===0||(e.apply(a,a),e.apply(l,l),e.apply(h,h),e.apply(u,u),Math.max(a.x,l.x,h.x,u.x)<=r||Math.min(a.x,l.x,h.x,u.x)>=s||Math.max(a.y,l.y,h.y,u.y)<=o||Math.min(a.y,l.y,h.y,u.y)>=n))return false;let f=c*(l.y-a.y),d=c*(a.x-l.x),m=f*r+d*o,g=f*s+d*o,x=f*r+d*n,_=f*s+d*n;if(Math.max(m,g,x,_)<=f*a.x+d*a.y||Math.min(m,g,x,_)>=f*u.x+d*u.y)return false;let y=c*(a.y-h.y),b=c*(h.x-a.x),v=y*r+b*o,P=y*s+b*o,T=y*r+b*n,w=y*s+b*n;return !(Math.max(v,P,T,w)<=y*a.x+b*a.y||Math.min(v,P,T,w)>=y*u.x+b*u.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){let e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=s,this.height=Math.max(o-s,0),this}ceil(t=1,e=.001){let r=Math.ceil((this.x+this.width-e)*t)/t,s=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=r-this.x,this.height=s-this.y,this}enlarge(t){let e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=s,this.height=o-s,this}getBounds(t){return t||(t=new i),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return false;let e=t.x,r=t.y,s=t.x+t.width,o=t.y+t.height;return e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height&&s>=this.x&&s<this.x+this.width&&o>=this.y&&o<this.y+this.height}set(t,e,r,s){return this.x=t,this.y=e,this.width=r,this.height=s,this}toString(){return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};});var dh,ot,$t=p(()=>{tt();Bt();dh=new M,ot=class i{constructor(t=1/0,e=1/0,r=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=dh,this.minX=t,this.minY=e,this.maxX=r,this.maxY=s;}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new j);let 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=dh,this}set(t,e,r,s){this.minX=t,this.minY=e,this.maxX=r,this.maxY=s;}addFrame(t,e,r,s,o){o||(o=this.matrix);let n=o.a,a=o.b,l=o.c,h=o.d,u=o.tx,c=o.ty,f=this.minX,d=this.minY,m=this.maxX,g=this.maxY,x=n*t+l*e+u,_=a*t+h*e+c;x<f&&(f=x),_<d&&(d=_),x>m&&(m=x),_>g&&(g=_),x=n*r+l*e+u,_=a*r+h*e+c,x<f&&(f=x),_<d&&(d=_),x>m&&(m=x),_>g&&(g=_),x=n*t+l*s+u,_=a*t+h*s+c,x<f&&(f=x),_<d&&(d=_),x>m&&(m=x),_>g&&(g=_),x=n*r+l*s+u,_=a*r+h*s+c,x<f&&(f=x),_<d&&(d=_),x>m&&(m=x),_>g&&(g=_),this.minX=f,this.minY=d,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){let e=this.minX,r=this.minY,s=this.maxX,o=this.maxY,{a:n,b:a,c:l,d:h,tx:u,ty:c}=t,f=n*e+l*r+u,d=a*e+h*r+c;this.minX=f,this.minY=d,this.maxX=f,this.maxY=d,f=n*s+l*r+u,d=a*s+h*r+c,this.minX=f<this.minX?f:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=d>this.maxY?d:this.maxY,f=n*e+l*o+u,d=a*e+h*o+c,this.minX=f<this.minX?f:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=d>this.maxY?d:this.maxY,f=n*s+l*o+u,d=a*s+h*o+c,this.minX=f<this.minX?f:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=d>this.maxY?d: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,r,s){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<r&&(this.minY=r),this.maxY>s&&(this.maxY=s),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 i(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){let e=this.maxX-this.minX;this.minX=t,this.maxX=t+e;}get y(){return this.minY}set y(t){let 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,r,s){let o=this.minX,n=this.minY,a=this.maxX,l=this.maxY;s||(s=this.matrix);let h=s.a,u=s.b,c=s.c,f=s.d,d=s.tx,m=s.ty;for(let g=e;g<r;g+=2){let x=t[g],_=t[g+1],y=h*x+c*_+d,b=u*x+f*_+m;o=y<o?y:o,n=b<n?b:n,a=y>a?y:a,l=b>l?b:l;}this.minX=o,this.minY=n,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 ut,Rt,ke=p(()=>{tt();$o();$t();ut=new Fe(M),Rt=new Fe(ot);});var vx,fh,ph=p(()=>{tt();$t();ke();vx=new M,fh={getFastGlobalBounds(i,t){t||(t=new ot),t.clear(),this._getGlobalBoundsRecursive(!!i,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);let e=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(e.worldTransform),t},_getGlobalBoundsRecursive(i,t,e){let r=t;if(i&&this.parentRenderLayer&&this.parentRenderLayer!==e||this.localDisplayStatus!==7||!this.measurable)return;let s=!!this.effects.length;if((this.renderGroup||s)&&(r=Rt.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else {if(this.renderPipeId){let n=this.bounds;r.addFrame(n.minX,n.minY,n.maxX,n.maxY,this.groupTransform);}let o=this.children;for(let n=0;n<o.length;n++)o[n]._getGlobalBoundsRecursive(i,r,e);}if(s){let o=false,n=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(o||(o=true,r.applyMatrix(n.worldTransform)),this.effects[a].addBounds(r,true));o&&(r.applyMatrix(n.worldTransform.copyTo(vx).invert()),t.addBounds(r,this.relativeGroupTransform)),t.addBounds(r),Rt.return(r);}else this.renderGroup&&(t.addBounds(r,this.relativeGroupTransform),Rt.return(r));}};});function ss(i,t,e){e.clear();let r,s;return i.parent?t?r=i.parent.worldTransform:(s=ut.get().identity(),r=os(i,s)):r=M.IDENTITY,mh(i,e,r,t),s&&ut.return(s),e.isValid||e.set(0,0,0,0),e}function mh(i,t,e,r){if(!i.visible||!i.measurable)return;let s;r?s=i.worldTransform:(i.updateLocalTransform(),s=ut.get(),s.appendFrom(i.localTransform,e));let o=t,n=!!i.effects.length;if(n&&(t=Rt.get().clear()),i.boundsArea)t.addRect(i.boundsArea,s);else {i.bounds&&(t.matrix=s,t.addBounds(i.bounds));for(let a=0;a<i.children.length;a++)mh(i.children[a],t,s,r);}if(n){for(let a=0;a<i.effects.length;a++)i.effects[a].addBounds?.(t);o.addBounds(t,M.IDENTITY),Rt.return(t);}r||ut.return(s);}function os(i,t){let e=i.parent;return e&&(os(e,t),e.updateLocalTransform(),t.append(e.localTransform)),t}var ns=p(()=>{tt();ke();});function as(i,t){if(i===16777215||!t)return t;if(t===16777215||!i)return i;let e=i>>16&255,r=i>>8&255,s=i&255,o=t>>16&255,n=t>>8&255,a=t&255,l=e*o/255|0,h=r*n/255|0,u=s*a/255|0;return (l<<16)+(h<<8)+u}var qo=p(()=>{});function Ko(i,t){return i===xh?t:t===xh?i:as(i,t)}var xh,gh=p(()=>{qo();xh=16777215;});function Vr(i){return ((i&255)<<16)+(i&65280)+(i>>16&255)}var _h,yh=p(()=>{ns();ke();gh();_h={getGlobalAlpha(i){if(i)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(i,t){if(t)return i.copyFrom(this.worldTransform);this.updateLocalTransform();let e=os(this,ut.get().identity());return i.appendFrom(this.localTransform,e),ut.return(e),i},getGlobalTint(i){if(i)return this.renderGroup?Vr(this.renderGroup.worldColor):this.parentRenderGroup?Vr(Ko(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=Ko(t,e.localColor),e=e.parent;return Vr(t)}};});function ls(i,t,e){return t.clear(),e||(e=M.IDENTITY),bh(i,t,e,i,true),t.isValid||t.set(0,0,0,0),t}function bh(i,t,e,r,s){let o;if(s)o=ut.get(),o=e.copyTo(o);else {if(!i.visible||!i.measurable)return;i.updateLocalTransform();let l=i.localTransform;o=ut.get(),o.appendFrom(l,e);}let n=t,a=!!i.effects.length;if(a&&(t=Rt.get().clear()),i.boundsArea)t.addRect(i.boundsArea,o);else {i.renderPipeId&&(t.matrix=o,t.addBounds(i.bounds));let l=i.children;for(let h=0;h<l.length;h++)bh(l[h],t,o,r,false);}if(a){for(let l=0;l<i.effects.length;l++)i.effects[l].addLocalBounds?.(t,r);n.addBounds(t,M.IDENTITY),Rt.return(t);}ut.return(o);}var Zo=p(()=>{tt();ke();});function Qo(i,t){let e=i.children;for(let r=0;r<e.length;r++){let s=e[r],o=s.uid,n=(s._didViewChangeTick&65535)<<16|s._didContainerChangeTick&65535,a=t.index;(t.data[a]!==o||t.data[a+1]!==n)&&(t.data[t.index]=o,t.data[t.index+1]=n,t.didChange=true),t.index=a+2,s.children.length&&Qo(s,t);}return t.didChange}var vh=p(()=>{});var Sx,Sh,Th=p(()=>{tt();$t();ns();Zo();vh();Sx=new M,Sh={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(i,t){let e=Math.sign(this.scale.x)||1;t!==0?this.scale.x=i/t*e:this.scale.x=e;},_setHeight(i,t){let e=Math.sign(this.scale.y)||1;t!==0?this.scale.y=i/t*e:this.scale.y=e;},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:false,localBounds:new ot});let i=this._localBoundsCacheData;return i.index=1,i.didChange=false,i.data[0]!==this._didViewChangeTick&&(i.didChange=true,i.data[0]=this._didViewChangeTick),Qo(this,i),i.didChange&&ls(this,i.localBounds,Sx),i.localBounds},getBounds(i,t){return ss(this,i,t||new ot)}};});var wh,Ph=p(()=>{wh={_onRender:null,set onRender(i){let t=this.renderGroup||this.parentRenderGroup;if(!i){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=i;},get onRender(){return this._onRender}};});function Tx(i,t){return i._zIndex-t._zIndex}var Mh,Ch=p(()=>{Mh={_zIndex:0,sortDirty:false,sortableChildren:false,get zIndex(){return this._zIndex},set zIndex(i){this._zIndex!==i&&(this._zIndex=i,this.depthOfChildModified());},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=true,this.parent.sortDirty=true),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true);},sortChildren(){this.sortDirty&&(this.sortDirty=false,this.children.sort(Tx));}};});var Ah,Eh=p(()=>{qt();ke();Ah={getGlobalPosition(i=new $,t=false){return this.parent?this.parent.toGlobal(this._position,i,t):(i.x=this._position.x,i.y=this._position.y),i},toGlobal(i,t,e=false){let r=this.getGlobalTransform(ut.get(),e);return t=r.apply(i,t),ut.return(r),t},toLocal(i,t,e,r){t&&(i=t.toGlobal(i,e,r));let s=this.getGlobalTransform(ut.get(),r);return e=s.applyInverse(i,e),ut.return(s),e}};});var Qe,Jo=p(()=>{Pt();Qe=class{constructor(){this.uid=Y("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0;}reset(){this.instructionSize=0;}add(t){this.instructions[this.instructionSize++]=t;}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"]);}};});function le(i){return i+=i===0?1:0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1}function tn(i){return !(i&i-1)&&!!i}var Hr=p(()=>{});function hs(i){let t={};for(let e in i)i[e]!==void 0&&(t[e]=i[e]);return t}var en=p(()=>{});function wx(i){let t=Fh[i];return t===void 0&&(Fh[i]=Y("resource")),t}var Fh,Bh,Wt,Je=p(()=>{Et();Pt();ht();Fh=Object.create(null);Bh=class kh extends N{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=false,t={...kh.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){G(W,"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(){let t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=wx(t),this._resourceId}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners();}};Bh.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};Wt=Bh;});var Gh,mt,he=p(()=>{Et();Hr();en();Pt();Je();Gh=class Ih extends N{constructor(t={}){super(),this.options=t,this.uid=Y("textureSource"),this._resourceType="textureSource",this._resourceId=Y("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=false,this.format="rgba8unorm",this.dimension="2d",this.antialias=false,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Ih.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 Wt(hs(t)),this.destroyed=false,this._refreshPOT();}get source(){return this}get style(){return this._style}set style(t){