@drincs/pixi-vn 1.3.3 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SoundGameState-BG_iPwjt.d.cts → SoundGameState-CQ7cbvIY.d.cts} +1 -1
- package/dist/{SoundGameState-BG_iPwjt.d.ts → SoundGameState-CQ7cbvIY.d.ts} +1 -1
- package/dist/canvas/index.cjs +2 -2
- package/dist/canvas/index.d.cts +1 -1
- package/dist/canvas/index.d.ts +1 -1
- package/dist/canvas/index.mjs +2 -2
- package/dist/canvas/tickers/index.cjs +2 -2
- package/dist/canvas/tickers/index.mjs +2 -2
- package/dist/character/index.cjs +1 -1
- package/dist/character/index.mjs +1 -1
- package/dist/{index-Dib5x6-D.d.ts → index-B3v7TkpX.d.ts} +8 -5
- package/dist/{index-Czfdktw9.d.ts → index-BFrahVX5.d.ts} +1 -1
- package/dist/{index-jEmIURMn.d.cts → index-Cj--qEPX.d.cts} +8 -5
- package/dist/{index-DZ1shoNp.d.cts → index-D4v4pyT6.d.cts} +1 -1
- package/dist/index.cjs +139 -139
- package/dist/index.d.cts +27 -7
- package/dist/index.d.ts +27 -7
- package/dist/index.mjs +139 -139
- package/dist/interfaces/index.d.cts +1 -1
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/narration/index.cjs +2 -2
- package/dist/narration/index.mjs +2 -2
- package/dist/sound/index.cjs +1 -1
- package/dist/sound/index.d.cts +2 -2
- package/dist/sound/index.d.ts +2 -2
- package/dist/sound/index.mjs +1 -1
- package/package.json +3 -3
package/dist/narration/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Cx=Object.create;var Ws=Object.defineProperty;var Px=Object.getOwnPropertyDescriptor;var Mx=Object.getOwnPropertyNames;var Ex=Object.getPrototypeOf,Ax=Object.prototype.hasOwnProperty;var Vh=i=>{throw TypeError(i)};var Ix=(i,t,e)=>t in i?Ws(i,t,{enumerable:true,configurable:true,writable:true,value:e}):i[t]=e;var zn=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var g=(i,t)=>()=>(i&&(t=i(i=0)),t);var Hs=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),Rx=(i,t)=>{for(var e in t)Ws(i,e,{get:t[e],enumerable:true});},Lx=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Mx(t))!Ax.call(i,s)&&s!==e&&Ws(i,s,{get:()=>t[s],enumerable:!(r=Px(t,s))||r.enumerable});return i};var Nn=(i,t,e)=>(e=i!=null?Cx(Ex(i)):{},Lx(Ws(e,"default",{value:i,enumerable:true}),i));var k=(i,t,e)=>Ix(i,typeof t!="symbol"?t+"":t,e),Vn=(i,t,e)=>t.has(i)||Vh("Cannot "+e);var _=(i,t,e)=>(Vn(i,t,"read from private field"),e?e.call(i):t.get(i)),J=(i,t,e)=>t.has(i)?Vh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),W=(i,t,e,r)=>(Vn(i,t,"write to private field"),t.set(i,e),e),F=(i,t,e)=>(Vn(i,t,"access private method"),e);var Ys=(i,t,e,r)=>({set _(s){W(i,t,s);},get _(){return _(i,t,r)}});var C,Wn,Fi,H,z=g(()=>{C=(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))(C||{}),Wn=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},Fi=(i,t)=>Wn(i).priority??t,H={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(Wn).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t));}),this},add(...i){return i.map(Wn).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)=>Fi(n.value,e)-Fi(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)=>Fi(o,e)-Fi(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 Xh=Hs((zb,Hn)=>{var Fx=Object.prototype.hasOwnProperty,Ut="~";function Bi(){}Object.create&&(Bi.prototype=Object.create(null),new Bi().__proto__||(Ut=false));function Bx(i,t,e){this.fn=i,this.context=t,this.once=e||false;}function Yh(i,t,e,r,s){if(typeof e!="function")throw new TypeError("The listener must be a function");var o=new Bx(e,r||i,s),n=Ut?Ut+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 Qs(i,t){--i._eventsCount===0?i._events=new Bi:delete i._events[t];}function kt(){this._events=new Bi,this._eventsCount=0;}kt.prototype.eventNames=function(){var t=[],e,r;if(this._eventsCount===0)return t;for(r in e=this._events)Fx.call(e,r)&&t.push(Ut?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};kt.prototype.listeners=function(t){var e=Ut?Ut+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};kt.prototype.listenerCount=function(t){var e=Ut?Ut+t:t,r=this._events[e];return r?r.fn?1:r.length:0};kt.prototype.emit=function(t,e,r,s,o,n){var a=Ut?Ut+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};kt.prototype.on=function(t,e,r){return Yh(this,t,e,r,false)};kt.prototype.once=function(t,e,r){return Yh(this,t,e,r,true)};kt.prototype.removeListener=function(t,e,r,s){var o=Ut?Ut+t:t;if(!this._events[o])return this;if(!e)return Qs(this,o),this;var n=this._events[o];if(n.fn)n.fn===e&&(!s||n.once)&&(!r||n.context===r)&&Qs(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:Qs(this,o);}return this};kt.prototype.removeAllListeners=function(t){var e;return t?(e=Ut?Ut+t:t,this._events[e]&&Qs(this,e)):(this._events=new Bi,this._eventsCount=0),this};kt.prototype.off=kt.prototype.removeListener;kt.prototype.addListener=kt.prototype.on;kt.prefixed=Ut;kt.EventEmitter=kt;typeof Hn<"u"&&(Hn.exports=kt);});var $h,tt,Yt=g(()=>{$h=Nn(Xh()),tt=$h.default;});var kx,Ge,Et,ne,eu,jh,Yn,Gx,Js,ru,iu,Kh,qh,Zh,ki,Ox,Dx,Ux,zx,jn,Qh,Nx,Xn,$n,Jh,Kn,he,tu,su,ou=g(()=>{kx={grad:.9,turn:360,rad:360/(2*Math.PI)},Ge=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},Et=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},ne=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},eu=function(i){return (i=isFinite(i)?i%360:0)>0?i:i+360},jh=function(i){return {r:ne(i.r,0,255),g:ne(i.g,0,255),b:ne(i.b,0,255),a:ne(i.a)}},Yn=function(i){return {r:Et(i.r),g:Et(i.g),b:Et(i.b),a:Et(i.a,3)}},Gx=/^#([0-9a-f]{3,8})$/i,Js=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},ru=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}},iu=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}},Kh=function(i){return {h:eu(i.h),s:ne(i.s,0,100),l:ne(i.l,0,100),a:ne(i.a)}},qh=function(i){return {h:Et(i.h),s:Et(i.s),l:Et(i.l),a:Et(i.a,3)}},Zh=function(i){return iu((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;},ki=function(i){return {h:(t=ru(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;},Ox=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Dx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ux=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jn={string:[[function(i){var t=Gx.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?Et(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?Et(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=Ux.exec(i)||zx.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:jh({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=Ox.exec(i)||Dx.exec(i);if(!t)return null;var e,r,s=Kh({h:(e=t[1],r=t[2],r===void 0&&(r="deg"),Number(e)*(kx[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Zh(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 Ge(t)&&Ge(e)&&Ge(r)?jh({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(!Ge(t)||!Ge(e)||!Ge(r))return null;var n=Kh({h:Number(t),s:Number(e),l:Number(r),a:Number(o)});return Zh(n)},"hsl"],[function(i){var t=i.h,e=i.s,r=i.v,s=i.a,o=s===void 0?1:s;if(!Ge(t)||!Ge(e)||!Ge(r))return null;var n=function(a){return {h:eu(a.h),s:ne(a.s,0,100),v:ne(a.v,0,100),a:ne(a.a)}}({h:Number(t),s:Number(e),v:Number(r),a:Number(o)});return iu(n)},"hsv"]]},Qh=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]},Nx=function(i){return typeof i=="string"?Qh(i.trim(),jn.string):typeof i=="object"&&i!==null?Qh(i,jn.object):[null,void 0]},Xn=function(i,t){var e=ki(i);return {h:e.h,s:ne(e.s+100*t,0,100),l:e.l,a:e.a}},$n=function(i){return (299*i.r+587*i.g+114*i.b)/1e3/255},Jh=function(i,t){var e=ki(i);return {h:e.h,s:e.s,l:ne(e.l+100*t,0,100),a:e.a}},Kn=function(){function i(t){this.parsed=Nx(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 Et($n(this.rgba),2)},i.prototype.isDark=function(){return $n(this.rgba)<.5},i.prototype.isLight=function(){return $n(this.rgba)>=.5},i.prototype.toHex=function(){return t=Yn(this.rgba),e=t.r,r=t.g,s=t.b,n=(o=t.a)<1?Js(Et(255*o)):"","#"+Js(e)+Js(r)+Js(s)+n;var t,e,r,s,o,n;},i.prototype.toRgb=function(){return Yn(this.rgba)},i.prototype.toRgbString=function(){return t=Yn(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 qh(ki(this.rgba))},i.prototype.toHslString=function(){return t=qh(ki(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=ru(this.rgba),{h:Et(t.h),s:Et(t.s),v:Et(t.v),a:Et(t.a,3)};var t;},i.prototype.invert=function(){return he({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),he(Xn(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),he(Xn(this.rgba,-t))},i.prototype.grayscale=function(){return he(Xn(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),he(Jh(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),he(Jh(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"?he({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):Et(this.rgba.a,3);var e;},i.prototype.hue=function(t){var e=ki(this.rgba);return typeof t=="number"?he({h:t,s:e.s,l:e.l,a:e.a}):Et(e.h)},i.prototype.isEqual=function(t){return this.toHex()===he(t).toHex()},i}(),he=function(i){return i instanceof Kn?i:new Kn(i)},tu=[],su=function(i){i.forEach(function(t){tu.indexOf(t)<0&&(t(Kn,jn),tu.push(t));});};});function nu(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 x in e){var b=(a=u,l=o[x],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));b<c&&(c=b,f=x);}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 au=g(()=>{});var Gr,at,qt=g(()=>{ou();au();su([nu]);Gr=class Gi{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 Gi)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]=Gi._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=Gi.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`);}let n=he(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 Gi||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}};Gr.shared=new Gr;Gr._temp=new Gr;Gr.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;at=Gr;});var lu,hu=g(()=>{lu={cullArea:null,cullable:false,cullableChildren:true};});var uu,cu,du,qn=g(()=>{uu=Math.PI*2,cu=180/Math.PI,du=Math.PI/180;});var et,Zn,Te=g(()=>{et=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 Zn.x=0,Zn.y=0,Zn}},Zn=new et;});var L,Vx,Wx,dt=g(()=>{qn();Te();L=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 et;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 et;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(uu-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 Wx.identity()}static get shared(){return Vx.identity()}},Vx=new L,Wx=new L;});var At,Qn=g(()=>{At=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 rt(i="default"){return Jn[i]===void 0&&(Jn[i]=-1),++Jn[i]}var Jn,zt=g(()=>{Jn={default:-1};});function D(i,t,e=3){if(fu[t])return;let r=new Error().stack;typeof r>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
|
|
1
|
+
var Cx=Object.create;var Ws=Object.defineProperty;var Px=Object.getOwnPropertyDescriptor;var Mx=Object.getOwnPropertyNames;var Ex=Object.getPrototypeOf,Ax=Object.prototype.hasOwnProperty;var Vh=i=>{throw TypeError(i)};var Ix=(i,t,e)=>t in i?Ws(i,t,{enumerable:true,configurable:true,writable:true,value:e}):i[t]=e;var zn=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var g=(i,t)=>()=>(i&&(t=i(i=0)),t);var Hs=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),Rx=(i,t)=>{for(var e in t)Ws(i,e,{get:t[e],enumerable:true});},Lx=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Mx(t))!Ax.call(i,s)&&s!==e&&Ws(i,s,{get:()=>t[s],enumerable:!(r=Px(t,s))||r.enumerable});return i};var Nn=(i,t,e)=>(e=i!=null?Cx(Ex(i)):{},Lx(Ws(e,"default",{value:i,enumerable:true}),i));var k=(i,t,e)=>Ix(i,typeof t!="symbol"?t+"":t,e),Vn=(i,t,e)=>t.has(i)||Vh("Cannot "+e);var _=(i,t,e)=>(Vn(i,t,"read from private field"),e?e.call(i):t.get(i)),J=(i,t,e)=>t.has(i)?Vh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),W=(i,t,e,r)=>(Vn(i,t,"write to private field"),t.set(i,e),e),F=(i,t,e)=>(Vn(i,t,"access private method"),e);var Ys=(i,t,e,r)=>({set _(s){W(i,t,s);},get _(){return _(i,t,r)}});var C,Wn,Fi,H,z=g(()=>{C=(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))(C||{}),Wn=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},Fi=(i,t)=>Wn(i).priority??t,H={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(Wn).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t));}),this},add(...i){return i.map(Wn).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)=>Fi(n.value,e)-Fi(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)=>Fi(o,e)-Fi(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 Xh=Hs((zb,Hn)=>{var Fx=Object.prototype.hasOwnProperty,Ut="~";function Bi(){}Object.create&&(Bi.prototype=Object.create(null),new Bi().__proto__||(Ut=false));function Bx(i,t,e){this.fn=i,this.context=t,this.once=e||false;}function Yh(i,t,e,r,s){if(typeof e!="function")throw new TypeError("The listener must be a function");var o=new Bx(e,r||i,s),n=Ut?Ut+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 Qs(i,t){--i._eventsCount===0?i._events=new Bi:delete i._events[t];}function kt(){this._events=new Bi,this._eventsCount=0;}kt.prototype.eventNames=function(){var t=[],e,r;if(this._eventsCount===0)return t;for(r in e=this._events)Fx.call(e,r)&&t.push(Ut?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};kt.prototype.listeners=function(t){var e=Ut?Ut+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};kt.prototype.listenerCount=function(t){var e=Ut?Ut+t:t,r=this._events[e];return r?r.fn?1:r.length:0};kt.prototype.emit=function(t,e,r,s,o,n){var a=Ut?Ut+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};kt.prototype.on=function(t,e,r){return Yh(this,t,e,r,false)};kt.prototype.once=function(t,e,r){return Yh(this,t,e,r,true)};kt.prototype.removeListener=function(t,e,r,s){var o=Ut?Ut+t:t;if(!this._events[o])return this;if(!e)return Qs(this,o),this;var n=this._events[o];if(n.fn)n.fn===e&&(!s||n.once)&&(!r||n.context===r)&&Qs(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:Qs(this,o);}return this};kt.prototype.removeAllListeners=function(t){var e;return t?(e=Ut?Ut+t:t,this._events[e]&&Qs(this,e)):(this._events=new Bi,this._eventsCount=0),this};kt.prototype.off=kt.prototype.removeListener;kt.prototype.addListener=kt.prototype.on;kt.prefixed=Ut;kt.EventEmitter=kt;typeof Hn<"u"&&(Hn.exports=kt);});var $h,tt,Yt=g(()=>{$h=Nn(Xh()),tt=$h.default;});var kx,Ge,Et,ne,eu,jh,Yn,Gx,Js,ru,iu,Kh,qh,Zh,ki,Ox,Dx,Ux,zx,jn,Qh,Nx,Xn,$n,Jh,Kn,he,tu,su,ou=g(()=>{kx={grad:.9,turn:360,rad:360/(2*Math.PI)},Ge=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},Et=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},ne=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},eu=function(i){return (i=isFinite(i)?i%360:0)>0?i:i+360},jh=function(i){return {r:ne(i.r,0,255),g:ne(i.g,0,255),b:ne(i.b,0,255),a:ne(i.a)}},Yn=function(i){return {r:Et(i.r),g:Et(i.g),b:Et(i.b),a:Et(i.a,3)}},Gx=/^#([0-9a-f]{3,8})$/i,Js=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},ru=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}},iu=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}},Kh=function(i){return {h:eu(i.h),s:ne(i.s,0,100),l:ne(i.l,0,100),a:ne(i.a)}},qh=function(i){return {h:Et(i.h),s:Et(i.s),l:Et(i.l),a:Et(i.a,3)}},Zh=function(i){return iu((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;},ki=function(i){return {h:(t=ru(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;},Ox=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Dx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ux=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jn={string:[[function(i){var t=Gx.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?Et(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?Et(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=Ux.exec(i)||zx.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:jh({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=Ox.exec(i)||Dx.exec(i);if(!t)return null;var e,r,s=Kh({h:(e=t[1],r=t[2],r===void 0&&(r="deg"),Number(e)*(kx[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Zh(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 Ge(t)&&Ge(e)&&Ge(r)?jh({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(!Ge(t)||!Ge(e)||!Ge(r))return null;var n=Kh({h:Number(t),s:Number(e),l:Number(r),a:Number(o)});return Zh(n)},"hsl"],[function(i){var t=i.h,e=i.s,r=i.v,s=i.a,o=s===void 0?1:s;if(!Ge(t)||!Ge(e)||!Ge(r))return null;var n=(function(a){return {h:eu(a.h),s:ne(a.s,0,100),v:ne(a.v,0,100),a:ne(a.a)}})({h:Number(t),s:Number(e),v:Number(r),a:Number(o)});return iu(n)},"hsv"]]},Qh=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]},Nx=function(i){return typeof i=="string"?Qh(i.trim(),jn.string):typeof i=="object"&&i!==null?Qh(i,jn.object):[null,void 0]},Xn=function(i,t){var e=ki(i);return {h:e.h,s:ne(e.s+100*t,0,100),l:e.l,a:e.a}},$n=function(i){return (299*i.r+587*i.g+114*i.b)/1e3/255},Jh=function(i,t){var e=ki(i);return {h:e.h,s:e.s,l:ne(e.l+100*t,0,100),a:e.a}},Kn=(function(){function i(t){this.parsed=Nx(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 Et($n(this.rgba),2)},i.prototype.isDark=function(){return $n(this.rgba)<.5},i.prototype.isLight=function(){return $n(this.rgba)>=.5},i.prototype.toHex=function(){return t=Yn(this.rgba),e=t.r,r=t.g,s=t.b,n=(o=t.a)<1?Js(Et(255*o)):"","#"+Js(e)+Js(r)+Js(s)+n;var t,e,r,s,o,n;},i.prototype.toRgb=function(){return Yn(this.rgba)},i.prototype.toRgbString=function(){return t=Yn(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 qh(ki(this.rgba))},i.prototype.toHslString=function(){return t=qh(ki(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=ru(this.rgba),{h:Et(t.h),s:Et(t.s),v:Et(t.v),a:Et(t.a,3)};var t;},i.prototype.invert=function(){return he({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),he(Xn(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),he(Xn(this.rgba,-t))},i.prototype.grayscale=function(){return he(Xn(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),he(Jh(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),he(Jh(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"?he({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):Et(this.rgba.a,3);var e;},i.prototype.hue=function(t){var e=ki(this.rgba);return typeof t=="number"?he({h:t,s:e.s,l:e.l,a:e.a}):Et(e.h)},i.prototype.isEqual=function(t){return this.toHex()===he(t).toHex()},i})(),he=function(i){return i instanceof Kn?i:new Kn(i)},tu=[],su=function(i){i.forEach(function(t){tu.indexOf(t)<0&&(t(Kn,jn),tu.push(t));});};});function nu(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 x in e){var b=(a=u,l=o[x],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));b<c&&(c=b,f=x);}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 au=g(()=>{});var Gr,at,qt=g(()=>{ou();au();su([nu]);Gr=class Gi{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 Gi)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]=Gi._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=Gi.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`);}let n=he(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 Gi||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}};Gr.shared=new Gr;Gr._temp=new Gr;Gr.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;at=Gr;});var lu,hu=g(()=>{lu={cullArea:null,cullable:false,cullableChildren:true};});var uu,cu,du,qn=g(()=>{uu=Math.PI*2,cu=180/Math.PI,du=Math.PI/180;});var et,Zn,Te=g(()=>{et=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 Zn.x=0,Zn.y=0,Zn}},Zn=new et;});var L,Vx,Wx,dt=g(()=>{qn();Te();L=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 et;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 et;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(uu-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 Wx.identity()}static get shared(){return Vx.identity()}},Vx=new L,Wx=new L;});var At,Qn=g(()=>{At=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 rt(i="default"){return Jn[i]===void 0&&(Jn[i]=-1),++Jn[i]}var Jn,zt=g(()=>{Jn={default:-1};});function D(i,t,e=3){if(fu[t])return;let r=new Error().stack;typeof r>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
|
|
2
2
|
Deprecated since v${i}`):(r=r.split(`
|
|
3
3
|
`).splice(e).join(`
|
|
4
4
|
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t}
|
|
@@ -569,5 +569,5 @@ fn mainFragment(
|
|
|
569
569
|
|
|
570
570
|
outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
|
|
571
571
|
|
|
572
|
-
`}};});var yh,bh,Mn,Fg=g(()=>{dt();Do();Ag();Wo();ns();Qe();Ft();Lg();Mn=class extends Re{constructor(){yh??(yh=Jr({name:"tiling-sprite-shader",bits:[Ps,Ig,ei]})),bh??(bh=ti({name:"tiling-sprite-shader",bits:[Eg,Rg,ri]}));let t=new Vt({uMapCoord:{value:new L,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new L,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:bh,gpuProgram:yh,resources:{localUniforms:new Vt({uTransformMatrix:{value:new L,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:t,uTexture:U.EMPTY.source,uSampler:U.EMPTY.source.style}});}updateUniforms(t,e,r,s,o,n){let a=this.resources.tilingUniforms,l=n.width,h=n.height,u=n.textureMatrix,c=a.uniforms.uTextureTransform;c.set(r.a*l/t,r.b*l/e,r.c*h/t,r.d*h/e,r.tx/t,r.ty/e),c.invert(),a.uniforms.uMapCoord=u.mapCoord,a.uniforms.uClampFrame=u.uClampFrame,a.uniforms.uClampOffset=u.uClampOffset,a.uniforms.uTextureTransform=c,a.uniforms.uSizeAnchor[0]=t,a.uniforms.uSizeAnchor[1]=e,a.uniforms.uSizeAnchor[2]=s,a.uniforms.uSizeAnchor[3]=o,n&&(this.resources.uTexture=n.source,this.resources.uSampler=n.source.style);}};});var En,Bg=g(()=>{Pn();En=class extends mi{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])});}};});function kg(i,t){let e=i.anchor.x,r=i.anchor.y;t[0]=-e*i.width,t[1]=-r*i.height,t[2]=(1-e)*i.width,t[3]=-r*i.height,t[4]=(1-e)*i.width,t[5]=(1-r)*i.height,t[6]=-e*i.width,t[7]=(1-r)*i.height;}var Gg=g(()=>{});function Og(i,t,e,r){let s=0,o=i.length/(t),n=r.a,a=r.b,l=r.c,h=r.d,u=r.tx,c=r.ty;for(e*=t;s<o;){let f=i[e],d=i[e+1];i[e]=n*f+l*d+u,i[e+1]=a*f+h*d+c,e+=t,s++;}}var Dg=g(()=>{});function Ug(i,t){let e=i.texture,r=e.frame.width,s=e.frame.height,o=0,n=0;i.applyAnchorToTexture&&(o=i.anchor.x,n=i.anchor.y),t[0]=t[6]=-o,t[2]=t[4]=1-o,t[1]=t[3]=-n,t[5]=t[7]=1-n;let a=L.shared;a.copyFrom(i._tileTransform.matrix),a.tx/=i.width,a.ty/=i.height,a.invert(),a.scale(i.width/r,i.height/s),Og(t,2,0,a);}var zg=g(()=>{dt();Dg();});var An,vh,Ms,Ng=g(()=>{z();rs();Qo();os();cs();Jo();Pn();Fg();Bg();Gg();zg();An=new En,vh=class{constructor(){this.canBatch=true,this.geometry=new mi({indices:An.indices.slice(),positions:An.positions.slice(),uvs:An.uvs.slice()});}destroy(){this.geometry.destroy(),this.shader?.destroy();}},Ms=class{constructor(t){this._state=wr.default2d,this._renderer=t;}validateRenderable(t){let e=this._getTilingSpriteData(t),r=e.canBatch;this._updateCanBatch(t);let s=e.canBatch;if(s&&s===r){let{batchableMesh:o}=e;return !o._batcher.checkAndUpdateTexture(o,t.texture)}return r!==s}addRenderable(t,e){let r=this._renderer.renderPipes.batch;this._updateCanBatch(t);let s=this._getTilingSpriteData(t),{geometry:o,canBatch:n}=s;if(n){s.batchableMesh||(s.batchableMesh=new tr);let a=s.batchableMesh;t.didViewUpdate&&(this._updateBatchableMesh(t),a.geometry=o,a.renderable=t,a.transform=t.groupTransform,a.setTexture(t._texture)),a.roundPixels=this._renderer._roundPixels|t._roundPixels,r.addToBatch(a,e);}else r.break(e),s.shader||(s.shader=new Mn),this.updateRenderable(t),e.add(t);}execute(t){let{shader:e}=this._getTilingSpriteData(t);e.groups[0]=this._renderer.globalUniforms.bindGroup;let r=e.resources.localUniforms.uniforms;r.uTransformMatrix=t.groupTransform,r.uRound=this._renderer._roundPixels|t._roundPixels,Je(t.groupColorAlpha,r.uColor,0),this._state.blendMode=Ne(t.groupBlendMode,t.texture._source),this._renderer.encoder.draw({geometry:An,shader:e,state:this._state});}updateRenderable(t){let e=this._getTilingSpriteData(t),{canBatch:r}=e;if(r){let{batchableMesh:s}=e;t.didViewUpdate&&this._updateBatchableMesh(t),s._batcher.updateElement(s);}else if(t.didViewUpdate){let{shader:s}=e;s.updateUniforms(t.width,t.height,t._tileTransform.matrix,t.anchor.x,t.anchor.y,t.texture);}}_getTilingSpriteData(t){return t._gpuData[this._renderer.uid]||this._initTilingSpriteData(t)}_initTilingSpriteData(t){let e=new vh;return e.renderable=t,t._gpuData[this._renderer.uid]=e,e}_updateBatchableMesh(t){let e=this._getTilingSpriteData(t),{geometry:r}=e,s=t.texture.source.style;s.addressMode!=="repeat"&&(s.addressMode="repeat",s.update()),Ug(t,r.uvs),kg(t,r.positions);}destroy(){this._renderer=null;}_updateCanBatch(t){let e=this._getTilingSpriteData(t),r=t.texture,s=true;return this._renderer.type===Ie.WEBGL&&(s=this._renderer.context.supports.nonPowOf2wrapping),e.canBatch=r.textureMatrix.isSimple&&(s||r.source.isPowerOfTwo),e.canBatch}};Ms.extension={type:[C.WebGLPipes,C.WebGPUPipes,C.CanvasPipes],name:"tilingSprite"};});var Sh=g(()=>{z();Ng();H.add(Ms);});var Vg,Hg,Yg=g(()=>{yt();Pn();Vg=class Wg extends mi{constructor(...t){super({});let e=t[0]??{};typeof e=="number"&&(D(Z,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),e={width:e,height:t[1],verticesX:t[2],verticesY:t[3]}),this.build(e);}build(t){t={...Wg.defaultOptions,...t},this.verticesX=this.verticesX??t.verticesX,this.verticesY=this.verticesY??t.verticesY,this.width=this.width??t.width,this.height=this.height??t.height;let e=this.verticesX*this.verticesY,r=[],s=[],o=[],n=this.verticesX-1,a=this.verticesY-1,l=this.width/n,h=this.height/a;for(let c=0;c<e;c++){let f=c%this.verticesX,d=c/this.verticesX|0;r.push(f*l,d*h),s.push(f/n,d/a);}let u=n*a;for(let c=0;c<u;c++){let f=c%n,d=c/n|0,x=d*this.verticesX+f,b=d*this.verticesX+f+1,m=(d+1)*this.verticesX+f,p=(d+1)*this.verticesX+f+1;o.push(x,b,m,b,p,m);}this.buffers[0].data=new Float32Array(r),this.buffers[1].data=new Float32Array(s),this.indexBuffer.data=new Uint32Array(o),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update();}};Vg.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};Hg=Vg;});var Xg,jg,Kg=g(()=>{Yg();Xg=class $g extends Hg{constructor(t={}){t={...$g.defaultOptions,...t},super({width:t.width,height:t.height,verticesX:4,verticesY:4}),this.update(t);}update(t){this.width=t.width??this.width,this.height=t.height??this.height,this._originalWidth=t.originalWidth??this._originalWidth,this._originalHeight=t.originalHeight??this._originalHeight,this._leftWidth=t.leftWidth??this._leftWidth,this._rightWidth=t.rightWidth??this._rightWidth,this._topHeight=t.topHeight??this._topHeight,this._bottomHeight=t.bottomHeight??this._bottomHeight,this._anchorX=t.anchor?.x,this._anchorY=t.anchor?.y,this.updateUvs(),this.updatePositions();}updatePositions(){let t=this.positions,{width:e,height:r,_leftWidth:s,_rightWidth:o,_topHeight:n,_bottomHeight:a,_anchorX:l,_anchorY:h}=this,u=s+o,c=e>u?1:e/u,f=n+a,d=r>f?1:r/f,x=Math.min(c,d),b=l*e,m=h*r;t[0]=t[8]=t[16]=t[24]=-b,t[2]=t[10]=t[18]=t[26]=s*x-b,t[4]=t[12]=t[20]=t[28]=e-o*x-b,t[6]=t[14]=t[22]=t[30]=e-b,t[1]=t[3]=t[5]=t[7]=-m,t[9]=t[11]=t[13]=t[15]=n*x-m,t[17]=t[19]=t[21]=t[23]=r-a*x-m,t[25]=t[27]=t[29]=t[31]=r-m,this.getBuffer("aPosition").update();}updateUvs(){let t=this.uvs;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1;let e=1/this._originalWidth,r=1/this._originalHeight;t[2]=t[10]=t[18]=t[26]=e*this._leftWidth,t[9]=t[11]=t[13]=t[15]=r*this._topHeight,t[4]=t[12]=t[20]=t[28]=1-e*this._rightWidth,t[17]=t[19]=t[21]=t[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update();}};Xg.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};jg=Xg;});var Th,Es,qg=g(()=>{z();Jo();Kg();Th=class extends tr{constructor(){super(),this.geometry=new jg;}destroy(){this.geometry.destroy();}},Es=class{constructor(t){this._renderer=t;}addRenderable(t,e){let r=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,r),this._renderer.renderPipes.batch.addToBatch(r,e);}updateRenderable(t){let e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e);}validateRenderable(t){let e=this._getGpuSprite(t);return !e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.geometry.update(t),e.setTexture(t._texture);}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){let e=t._gpuData[this._renderer.uid]=new Th,r=e;return r.renderable=t,r.transform=t.groupTransform,r.texture=t._texture,r.roundPixels=this._renderer._roundPixels|t._roundPixels,t.didViewUpdate||this._updateBatchableSprite(t,r),e}destroy(){this._renderer=null;}};Es.extension={type:[C.WebGLPipes,C.WebGPUPipes,C.CanvasPipes],name:"nineSliceSprite"};});var wh=g(()=>{z();qg();H.add(Es);});var As,Zg=g(()=>{z();As=class{constructor(t){this._renderer=t;}push(t,e,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:false,action:"pushFilter",container:e,filterEffect:t});}pop(t,e,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}execute(t){t.action==="pushFilter"?this._renderer.filter.push(t):t.action==="popFilter"&&this._renderer.filter.pop();}destroy(){this._renderer=null;}};As.extension={type:[C.WebGLPipes,C.WebGPUPipes,C.CanvasPipes],name:"filter"};});function Qg(i,t){t.clear();let e=t.matrix;for(let r=0;r<i.length;r++){let s=i[r];s.globalDisplayStatus<7||(t.matrix=s.worldTransform,t.addBounds(s.bounds));}return t.matrix=e,t}var Jg=g(()=>{});var Vy,Ch,Is,tx=g(()=>{z();dt();es();ss();Qe();Ft();Ur();os();ue();Jg();Gt();Vy=new Ae({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),Ch=class{constructor(){this.skip=false,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new gt,this.container=null,this.blendRequired=false,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0};}},Is=class{constructor(t){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new Vt({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new le({}),this.renderer=t;}get activeBackTexture(){return this._activeFilterData?.backTexture}push(t){let e=this.renderer,r=t.filterEffect.filters,s=this._pushFilterData();s.skip=false,s.filters=r,s.container=t.container,s.outputRenderSurface=e.renderTarget.renderSurface;let o=e.renderTarget.renderTarget.colorTexture.source,n=o.resolution,a=o.antialias;if(r.length===0){s.skip=true;return}let l=s.bounds;if(this._calculateFilterArea(t,l),this._calculateFilterBounds(s,e.renderTarget.rootViewPort,a,n,1),s.skip)return;let h=this._getPreviousFilterData(),u=this._findFilterResolution(n),c=0,f=0;h&&(c=h.bounds.minX,f=h.bounds.minY),this._calculateGlobalFrame(s,c,f,u,o.width,o.height),this._setupFilterTextures(s,l,e,h);}generateFilteredTexture({texture:t,filters:e}){let r=this._pushFilterData();this._activeFilterData=r,r.skip=false,r.filters=e;let s=t.source,o=s.resolution,n=s.antialias;if(e.length===0)return r.skip=true,t;let a=r.bounds;if(a.addRect(t.frame),this._calculateFilterBounds(r,a.rectangle,n,o,0),r.skip)return t;let l=o;this._calculateGlobalFrame(r,0,0,l,s.width,s.height),r.outputRenderSurface=Ot.getOptimalTexture(a.width,a.height,r.resolution,r.antialias),r.backTexture=U.EMPTY,r.inputTexture=t,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(r,true);let f=r.outputRenderSurface;return f.source.alphaMode="premultiplied-alpha",f}pop(){let t=this.renderer,e=this._popFilterData();e.skip||(t.globalUniforms.pop(),t.renderTarget.finishRenderPass(),this._activeFilterData=e,this._applyFiltersToTexture(e,false),e.blendRequired&&Ot.returnTexture(e.backTexture),Ot.returnTexture(e.inputTexture));}getBackTexture(t,e,r){let s=t.colorTexture.source._resolution,o=Ot.getOptimalTexture(e.width,e.height,s,false),n=e.minX,a=e.minY;r&&(n-=r.minX,a-=r.minY),n=Math.floor(n*s),a=Math.floor(a*s);let l=Math.ceil(e.width*s),h=Math.ceil(e.height*s);return this.renderer.renderTarget.copyToTexture(t,o,{x:n,y:a},{width:l,height:h},{x:0,y:0}),o}applyFilter(t,e,r,s){let o=this.renderer,n=this._activeFilterData,l=n.outputRenderSurface===r,h=o.renderTarget.rootRenderTarget.colorTexture.source._resolution,u=this._findFilterResolution(h),c=0,f=0;if(l){let d=this._findPreviousFilterOffset();c=d.x,f=d.y;}this._updateFilterUniforms(e,r,n,c,f,u,l,s),this._setupBindGroupsAndRender(t,e,o);}calculateSpriteMatrix(t,e){let r=this._activeFilterData,s=t.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),o=e.worldTransform.copyTo(L.shared),n=e.renderGroup||e.parentRenderGroup;return n&&n.cacheToLocalTransform&&o.prepend(n.cacheToLocalTransform),o.invert(),s.prepend(o),s.scale(1/e.texture.orig.width,1/e.texture.orig.height),s.translate(e.anchor.x,e.anchor.y),s}destroy(){}_setupBindGroupsAndRender(t,e,r){if(r.renderPipes.uniformBatch){let s=r.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(s,0);}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(e.source,1),this._globalFilterBindGroup.setResource(e.source.style,2),t.groups[0]=this._globalFilterBindGroup,r.encoder.draw({geometry:Vy,shader:t,state:t._state,topology:"triangle-list"}),r.type===Ie.WEBGL&&r.renderTarget.finishRenderPass();}_setupFilterTextures(t,e,r,s){if(t.backTexture=U.EMPTY,t.blendRequired){r.renderTarget.finishRenderPass();let o=r.renderTarget.getRenderTarget(t.outputRenderSurface);t.backTexture=this.getBackTexture(o,e,s?.bounds);}t.inputTexture=Ot.getOptimalTexture(e.width,e.height,t.resolution,t.antialias),r.renderTarget.bind(t.inputTexture,true),r.globalUniforms.push({offset:e});}_calculateGlobalFrame(t,e,r,s,o,n){let a=t.globalFrame;a.x=e*s,a.y=r*s,a.width=o*s,a.height=n*s;}_updateFilterUniforms(t,e,r,s,o,n,a,l){let h=this._filterGlobalUniforms.uniforms,u=h.uOutputFrame,c=h.uInputSize,f=h.uInputPixel,d=h.uInputClamp,x=h.uGlobalFrame,b=h.uOutputTexture;a?(u[0]=r.bounds.minX-s,u[1]=r.bounds.minY-o):(u[0]=0,u[1]=0),u[2]=t.frame.width,u[3]=t.frame.height,c[0]=t.source.width,c[1]=t.source.height,c[2]=1/c[0],c[3]=1/c[1],f[0]=t.source.pixelWidth,f[1]=t.source.pixelHeight,f[2]=1/f[0],f[3]=1/f[1],d[0]=.5*f[2],d[1]=.5*f[3],d[2]=t.frame.width*c[2]-.5*f[2],d[3]=t.frame.height*c[3]-.5*f[3];let m=this.renderer.renderTarget.rootRenderTarget.colorTexture;x[0]=s*n,x[1]=o*n,x[2]=m.source.width*n,x[3]=m.source.height*n,e instanceof U&&(e.source.resource=null);let p=this.renderer.renderTarget.getRenderTarget(e);this.renderer.renderTarget.bind(e,!!l),e instanceof U?(b[0]=e.frame.width,b[1]=e.frame.height):(b[0]=p.width,b[1]=p.height),b[2]=p.isRoot?-1:1,this._filterGlobalUniforms.update();}_findFilterResolution(t){let e=this._filterStackIndex-1;for(;e>0&&this._filterStack[e].skip;)--e;return e>0&&this._filterStack[e].inputTexture?this._filterStack[e].inputTexture.source._resolution:t}_findPreviousFilterOffset(){let t=0,e=0,r=this._filterStackIndex;for(;r>0;){r--;let s=this._filterStack[r];if(!s.skip){t=s.bounds.minX,e=s.bounds.minY;break}}return {x:t,y:e}}_calculateFilterArea(t,e){if(t.renderables?Qg(t.renderables,e):t.filterEffect.filterArea?(e.clear(),e.addRect(t.filterEffect.filterArea),e.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(true,e),t.container){let s=(t.container.renderGroup||t.container.parentRenderGroup).cacheToLocalTransform;s&&e.applyMatrix(s);}}_applyFiltersToTexture(t,e){let r=t.inputTexture,s=t.bounds,o=t.filters;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(t.backTexture.source,3),o.length===1)o[0].apply(this,r,t.outputRenderSurface,e);else {let n=t.inputTexture,a=Ot.getOptimalTexture(s.width,s.height,n.source._resolution,false),l=a,h=0;for(h=0;h<o.length-1;++h){o[h].apply(this,n,l,true);let c=n;n=l,l=c;}o[h].apply(this,n,t.outputRenderSurface,e),Ot.returnTexture(a);}}_calculateFilterBounds(t,e,r,s,o){let n=this.renderer,a=t.bounds,l=t.filters,h=1/0,u=0,c=true,f=false,d=false,x=true;for(let b=0;b<l.length;b++){let m=l[b];if(h=Math.min(h,m.resolution==="inherit"?s:m.resolution),u+=m.padding,m.antialias==="off"?c=false:m.antialias==="inherit"&&c&&(c=r),m.clipToViewport||(x=false),!!!(m.compatibleRenderers&n.type)){d=false;break}if(m.blendRequired&&!(n.backBuffer?.useBackBuffer??true)){K("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),d=false;break}d=m.enabled||d,f||(f=m.blendRequired);}if(!d){t.skip=true;return}if(x&&a.fitBounds(0,e.width/s,0,e.height/s),a.scale(h).ceil().scale(1/h).pad((u|0)*o),!a.isPositive){t.skip=true;return}t.antialias=c,t.resolution=h,t.blendRequired=f;}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let t,e=this._filterStackIndex-1;for(;e>1&&(e--,t=this._filterStack[e],!!t.skip););return t}_pushFilterData(){let t=this._filterStack[this._filterStackIndex];return t||(t=this._filterStack[this._filterStackIndex]=new Ch),this._filterStackIndex++,t}};Is.extension={type:[C.WebGLSystem,C.WebGPUSystem],name:"filter"};});var Ph=g(()=>{z();Zg();tx();H.add(Is);H.add(As);});var Wy={};var ex=g(()=>{Ic();wa();Gc();Dc();vo();Mo();Fl();Bl();Dl();lh();mh();_h();Sh();wh();Ph();});var Hy={};var ix=g(()=>{wa();vo();Mo();Fl();Bl();Dl();lh();mh();_h();Sh();wh();Ph();});var xx=Hs((On,gx)=>{(function(i,t){typeof On=="object"?gx.exports=On=t():typeof define=="function"&&define.amd?define([],t):i.CryptoJS=t();})(On,function(){var i=i||function(t,e){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<"u"&&global.crypto&&(r=global.crypto),!r&&typeof zn=="function")try{r=zn("crypto");}catch{}var s=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function p(){}return function(y){var v;return p.prototype=y,v=new p,p.prototype=null,v}}(),n={},a=n.lib={},l=a.Base=function(){return {extend:function(p){var y=o(this);return p&&y.mixIn(p),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var p=this.extend();return p.init.apply(p,arguments),p},init:function(){},mixIn:function(p){for(var y in p)p.hasOwnProperty(y)&&(this[y]=p[y]);p.hasOwnProperty("toString")&&(this.toString=p.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),h=a.WordArray=l.extend({init:function(p,y){p=this.words=p||[],y!=e?this.sigBytes=y:this.sigBytes=p.length*4;},toString:function(p){return (p||c).stringify(this)},concat:function(p){var y=this.words,v=p.words,S=this.sigBytes,P=p.sigBytes;if(this.clamp(),S%4)for(var T=0;T<P;T++){var w=v[T>>>2]>>>24-T%4*8&255;y[S+T>>>2]|=w<<24-(S+T)%4*8;}else for(var B=0;B<P;B+=4)y[S+B>>>2]=v[B>>>2];return this.sigBytes+=P,this},clamp:function(){var p=this.words,y=this.sigBytes;p[y>>>2]&=4294967295<<32-y%4*8,p.length=t.ceil(y/4);},clone:function(){var p=l.clone.call(this);return p.words=this.words.slice(0),p},random:function(p){for(var y=[],v=0;v<p;v+=4)y.push(s());return new h.init(y,p)}}),u=n.enc={},c=u.Hex={stringify:function(p){for(var y=p.words,v=p.sigBytes,S=[],P=0;P<v;P++){var T=y[P>>>2]>>>24-P%4*8&255;S.push((T>>>4).toString(16)),S.push((T&15).toString(16));}return S.join("")},parse:function(p){for(var y=p.length,v=[],S=0;S<y;S+=2)v[S>>>3]|=parseInt(p.substr(S,2),16)<<24-S%8*4;return new h.init(v,y/2)}},f=u.Latin1={stringify:function(p){for(var y=p.words,v=p.sigBytes,S=[],P=0;P<v;P++){var T=y[P>>>2]>>>24-P%4*8&255;S.push(String.fromCharCode(T));}return S.join("")},parse:function(p){for(var y=p.length,v=[],S=0;S<y;S++)v[S>>>2]|=(p.charCodeAt(S)&255)<<24-S%4*8;return new h.init(v,y)}},d=u.Utf8={stringify:function(p){try{return decodeURIComponent(escape(f.stringify(p)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(p){return f.parse(unescape(encodeURIComponent(p)))}},x=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new h.init,this._nDataBytes=0;},_append:function(p){typeof p=="string"&&(p=d.parse(p)),this._data.concat(p),this._nDataBytes+=p.sigBytes;},_process:function(p){var y,v=this._data,S=v.words,P=v.sigBytes,T=this.blockSize,w=T*4,B=P/w;p?B=t.ceil(B):B=t.max((B|0)-this._minBufferSize,0);var M=B*T,I=t.min(M*4,P);if(M){for(var R=0;R<M;R+=T)this._doProcessBlock(S,R);y=S.splice(0,M),v.sigBytes-=I;}return new h.init(y,I)},clone:function(){var p=l.clone.call(this);return p._data=this._data.clone(),p},_minBufferSize:0});a.Hasher=x.extend({cfg:l.extend(),init:function(p){this.cfg=this.cfg.extend(p),this.reset();},reset:function(){x.reset.call(this),this._doReset();},update:function(p){return this._append(p),this._process(),this},finalize:function(p){p&&this._append(p);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(p){return function(y,v){return new p.init(v).finalize(y)}},_createHmacHelper:function(p){return function(y,v){return new m.HMAC.init(p,v).finalize(y)}}});var m=n.algo={};return n}(Math);return i});});var yx=Hs((Dn,_x)=>{(function(i,t){typeof Dn=="object"?_x.exports=Dn=t(xx()):typeof define=="function"&&define.amd?define(["./core"],t):t(i.CryptoJS);})(Dn,function(i){return function(){var t=i,e=t.lib,r=e.WordArray,s=e.Hasher,o=t.algo,n=[],a=o.SHA1=s.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(l,h){for(var u=this._hash.words,c=u[0],f=u[1],d=u[2],x=u[3],b=u[4],m=0;m<80;m++){if(m<16)n[m]=l[h+m]|0;else {var p=n[m-3]^n[m-8]^n[m-14]^n[m-16];n[m]=p<<1|p>>>31;}var y=(c<<5|c>>>27)+b+n[m];m<20?y+=(f&d|~f&x)+1518500249:m<40?y+=(f^d^x)+1859775393:m<60?y+=(f&d|f&x|d&x)-1894007588:y+=(f^d^x)-899497514,b=x,x=d,d=f<<30|f>>>2,f=c,c=y;}u[0]=u[0]+c|0,u[1]=u[1]+f|0,u[2]=u[2]+d|0,u[3]=u[3]+x|0,u[4]=u[4]+b|0;},_doFinalize:function(){var l=this._data,h=l.words,u=this._nDataBytes*8,c=l.sigBytes*8;return h[c>>>5]|=128<<24-c%32,h[(c+64>>>9<<4)+14]=Math.floor(u/4294967296),h[(c+64>>>9<<4)+15]=u,l.sigBytes=h.length*4,this._process(),this._hash},clone:function(){var l=s.clone.call(this);return l._hash=this._hash.clone(),l}});t.SHA1=s._createHelper(a),t.HmacSHA1=s._createHmacHelper(a);}(),i.SHA1});});var Se={};Rx(Se,{DistortionFilter:()=>Xs,EqualizerFilter:()=>oe,Filter:()=>wt,MonoFilter:()=>$s,ReverbFilter:()=>js,StereoFilter:()=>Ks,StreamFilter:()=>qs,TelephoneFilter:()=>Zs});var Wh;function Hh(i){return Wh=i,i}function ot(){return Wh}var wt=class{constructor(t,e){this.init(t,e);}init(t,e){this.destination=t,this.source=e||t;}connect(t){this.source?.connect(t);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var Xs=class extends wt{constructor(t=0){let e;if(!ot().useLegacy){let{audioContext:r}=ot().context;e=r.createWaveShaper();}super(e),this._distortion=e,this.amount=t;}set amount(t){if(this._amount=t,ot().useLegacy)return;let e=t*1e3,r=44100,s=new Float32Array(r),o=Math.PI/180,n=0,a;for(;n<r;++n)a=n*2/r-1,s[n]=(3+e)*a*20*o/(Math.PI+e*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var bt=class{static setParamValue(t,e){if(t.setValueAtTime){let r=ot().context;t.setValueAtTime(e,r.audioContext.currentTime);}else t.value=e;return e}};var nt=class extends wt{constructor(i=0,t=0,e=0,r=0,s=0,o=0,n=0,a=0,l=0,h=0){let u=[],c=[{f:nt.F32,type:"lowshelf",gain:i},{f:nt.F64,type:"peaking",gain:t},{f:nt.F125,type:"peaking",gain:e},{f:nt.F250,type:"peaking",gain:r},{f:nt.F500,type:"peaking",gain:s},{f:nt.F1K,type:"peaking",gain:o},{f:nt.F2K,type:"peaking",gain:n},{f:nt.F4K,type:"peaking",gain:a},{f:nt.F8K,type:"peaking",gain:l},{f:nt.F16K,type:"highshelf",gain:h}];ot().useLegacy||(u=c.map(f=>{let d=ot().context.audioContext.createBiquadFilter();return d.type=f.type,bt.setParamValue(d.Q,1),d.frequency.value=f.f,bt.setParamValue(d.gain,f.gain),d})),super(u[0],u[u.length-1]),this.bands=u,this.bandsMap={};for(let f=0;f<this.bands.length;f++){let d=this.bands[f];f>0&&this.bands[f-1].connect(d),this.bandsMap[d.frequency.value]=d;}}setGain(i,t=0){if(!this.bandsMap[i])throw new Error(`No band found for frequency ${i}`);bt.setParamValue(this.bandsMap[i].gain,t);}getGain(i){if(!this.bandsMap[i])throw new Error(`No band found for frequency ${i}`);return this.bandsMap[i].gain.value}set f32(i){this.setGain(nt.F32,i);}get f32(){return this.getGain(nt.F32)}set f64(i){this.setGain(nt.F64,i);}get f64(){return this.getGain(nt.F64)}set f125(i){this.setGain(nt.F125,i);}get f125(){return this.getGain(nt.F125)}set f250(i){this.setGain(nt.F250,i);}get f250(){return this.getGain(nt.F250)}set f500(i){this.setGain(nt.F500,i);}get f500(){return this.getGain(nt.F500)}set f1k(i){this.setGain(nt.F1K,i);}get f1k(){return this.getGain(nt.F1K)}set f2k(i){this.setGain(nt.F2K,i);}get f2k(){return this.getGain(nt.F2K)}set f4k(i){this.setGain(nt.F4K,i);}get f4k(){return this.getGain(nt.F4K)}set f8k(i){this.setGain(nt.F8K,i);}get f8k(){return this.getGain(nt.F8K)}set f16k(i){this.setGain(nt.F16K,i);}get f16k(){return this.getGain(nt.F16K)}reset(){this.bands.forEach(i=>{bt.setParamValue(i.gain,0);});}destroy(){this.bands.forEach(i=>{i.disconnect();}),this.bands=null,this.bandsMap=null;}},oe=nt;oe.F32=32;oe.F64=64;oe.F125=125;oe.F250=250;oe.F500=500;oe.F1K=1e3;oe.F2K=2e3;oe.F4K=4e3;oe.F8K=8e3;oe.F16K=16e3;var $s=class extends wt{constructor(){let t,e;if(!ot().useLegacy){let{audioContext:r}=ot().context;e=r.createChannelSplitter(),t=r.createChannelMerger(),t.connect(e);}super(t,e),this._merger=t;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var js=class extends wt{constructor(t=3,e=2,r=false){super(null),this._seconds=this._clamp(t,1,50),this._decay=this._clamp(e,0,100),this._reverse=r,this._rebuild();}_clamp(t,e,r){return Math.min(r,Math.max(e,t))}get seconds(){return this._seconds}set seconds(t){this._seconds=this._clamp(t,1,50),this._rebuild();}get decay(){return this._decay}set decay(t){this._decay=this._clamp(t,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(t){this._reverse=t,this._rebuild();}_rebuild(){if(ot().useLegacy)return;let{audioContext:t}=ot().context,e=t.sampleRate,r=e*this._seconds,s=t.createBuffer(2,r,e),o=s.getChannelData(0),n=s.getChannelData(1),a;for(let h=0;h<r;h++)a=this._reverse?r-h:h,o[h]=(Math.random()*2-1)*Math.pow(1-a/r,this._decay),n[h]=(Math.random()*2-1)*Math.pow(1-a/r,this._decay);let l=t.createConvolver();l.buffer=s,this.init(l);}};var Ks=class extends wt{constructor(t=0){let e,r,s;if(!ot().useLegacy){let{audioContext:o}=ot().context;o.createStereoPanner?(e=o.createStereoPanner(),s=e):(r=o.createPanner(),r.panningModel="equalpower",s=r);}super(s),this._stereo=e,this._panner=r,this.pan=t;}set pan(t){this._pan=t,this._stereo?bt.setParamValue(this._stereo.pan,t):this._panner&&this._panner.setPosition(t,0,1-Math.abs(t));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var qs=class extends wt{constructor(){let t,e;if(!ot().useLegacy){let{audioContext:r}=ot().context;t=r.createMediaStreamDestination(),e=r.createMediaStreamSource(t.stream);}super(t,e),this._stream=t?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var Zs=class extends wt{constructor(){let t,e;if(!ot().useLegacy){let{audioContext:r}=ot().context,s=r.createBiquadFilter(),o=r.createBiquadFilter(),n=r.createBiquadFilter(),a=r.createBiquadFilter();s.type="lowpass",bt.setParamValue(s.frequency,2e3),o.type="lowpass",bt.setParamValue(o.frequency,2e3),n.type="highpass",bt.setParamValue(n.frequency,500),a.type="highpass",bt.setParamValue(a.frequency,500),s.connect(o),o.connect(n),n.connect(a),t=s,e=a;}super(t,e);}};z();var rx={extension:{type:C.Environment,name:"browser",priority:-1},test:()=>true,load:async()=>{await Promise.resolve().then(()=>(ex(),Wy));}};z();var sx={extension:{type:C.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>(ix(),Hy));}};z();z();Mo();vo();Fa();Jt();Ha();Nr();Yt();bo();H.add(rx,sx);var Rs=class extends tt{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(t){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};var Yy=0,Mh=class extends tt{constructor(i){super(),this.id=Yy++,this.init(i);}set(i,t){if(this[i]===void 0)throw new Error(`Property with name ${i} does not exist.`);switch(i){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "paused":this.paused=t;break;case "loop":this.loop=t;break;case "muted":this.muted=t;break}return this}get progress(){let{currentTime:i}=this._source;return i/this._duration}get paused(){return this._paused}set paused(i){this._paused=i,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(i){this._playing=false,this._duration=i.source.duration;let t=this._source=i.source.cloneNode(false);t.src=i.parent.url,t.onplay=this._onPlay.bind(this),t.onpause=this._onPause.bind(this),i.context.on("refresh",this.refresh,this),i.context.on("refreshPaused",this.refreshPaused,this),this._media=i;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(i){this._speed=i,this.refresh();}get volume(){return this._volume}set volume(i){this._volume=i,this.refresh();}get loop(){return this._loop}set loop(i){this._loop=i,this.refresh();}get muted(){return this._muted}set muted(i){this._muted=i,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(i){console.warn("HTML Audio does not support filters");}refresh(){let i=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let e=i.volume*(i.muted?0:1),r=t.volume*(t.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*e*r,this._source.playbackRate=this._speed*i.speed*t.speed;}refreshPaused(){let i=this._media.context,t=this._media.parent,e=this._paused||t.paused||i.paused;e!==this._pausedReal&&(this._pausedReal=e,e?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",e));}play(i){let{start:t,end:e,speed:r,loop:s,volume:o,muted:n}=i;e&&console.assert(e>t,"End time is before start time"),this._speed=r,this._volume=o,this._loop=!!s,this._muted=n,this.refresh(),this.loop&&e!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=t,this._end=e||this._duration,this._start=Math.max(0,this._start-Mh.PADDING),this._end=Math.min(this._end+Mh.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=t,this._source.onloadedmetadata=null,this.emit("progress",t/this._duration,this._duration),_t.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){_t.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){_t.shared.remove(this._onUpdate,this),this.removeAllListeners();let i=this._source;i&&(i.onended=null,i.onplay=null,i.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},In=Mh;In.PADDING=.1;var Ls=class extends tt{init(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url);}create(){return new In(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(t){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(t){let e=this._source,r=this.parent;if(e.readyState===4){r.isLoaded=true;let l=r.autoPlayStart();t&&setTimeout(()=>{t(null,r,l);},0);return}if(!r.url){t(new Error("sound.url or sound.source must be set"));return}e.src=r.url;let s=()=>{a(),r.isLoaded=true;let l=r.autoPlayStart();t&&t(null,r,l);},o=()=>{a(),t&&t(new Error("Sound loading has been aborted"));},n=()=>{a();let l=`Failed to load audio element (code: ${e.error.code})`;t?t(new Error(l)):console.error(l);},a=()=>{e.removeEventListener("canplaythrough",s),e.removeEventListener("load",s),e.removeEventListener("abort",o),e.removeEventListener("error",n);};e.addEventListener("canplaythrough",s,false),e.addEventListener("load",s,false),e.addEventListener("abort",o,false),e.addEventListener("error",n,false),e.load();}};var Fs=class{constructor(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var Er=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],Eh=["audio/mpeg","audio/ogg"],Ar={};function ox(i){let t={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},e=document.createElement("audio"),r={},s=/^no$/;Er.forEach(o=>{let n=e.canPlayType(`audio/${o}`).replace(s,""),a=t[o]?e.canPlayType(t[o]).replace(s,""):"";r[o]=!!n||!!a;}),Object.assign(Ar,r);}ox();var $y=0,Bs=class extends tt{constructor(t){super(),this.id=$y++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(t);}set(t,e){if(this[t]===void 0)throw new Error(`Property with name ${t} does not exist.`);switch(t){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "muted":this.muted=e;break;case "loop":this.loop=e;break;case "paused":this.paused=e;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(t){this._speed=t,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(t){this._volume=t,this.refresh();}get muted(){return this._muted}set muted(t){this._muted=t,this.refresh();}get loop(){return this._loop}set loop(t){this._loop=t,this.refresh();}get filters(){return this._filters}set filters(t){this._filters&&(this._filters?.filter(e=>e).forEach(e=>e.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=t?.length?t.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let t=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let r=t.volume*(t.muted?0:1),s=e.volume*(e.muted?0:1),o=this._volume*(this._muted?0:1);bt.setParamValue(this._gain.gain,o*s*r),bt.setParamValue(this._source.playbackRate,this._speed*e.speed*t.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let t=this._source;this._filters.forEach(e=>{t.connect(e.destination),t=e;}),t.connect(this._gain);}}refreshPaused(){let t=this._media.context,e=this._media.parent,r=this._paused||e.paused||t.paused;r!==this._pausedReal&&(this._pausedReal=r,r?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",r));}play(t){let{start:e,end:r,speed:s,loop:o,volume:n,muted:a,filters:l}=t;r&&console.assert(r>e,"End time is before start time"),this._paused=false;let{source:h,gain:u}=this._media.nodes.cloneBufferSource();this._source=h,this._gain=u,this._speed=s,this._volume=n,this._loop=!!o,this._muted=a,this._filters=l,this.refresh();let c=this._source.buffer.duration;this._duration=c,this._end=r,this._lastUpdate=this._now(),this._elapsed=e,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=r,this._source.loopStart=e,this._source.start(0,e)):r?this._source.start(0,e,r-e):this._source.start(0,e),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(t){_t.shared.remove(this._updateListener,this),t&&_t.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(t){this._paused=t,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(t=>t.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(t=false){if(this._source){let e=this._now(),r=e-this._lastUpdate;if(r>0||t){let s=this._source.playbackRate.value;this._elapsed+=r*s,this._lastUpdate=e;let o=this._duration,n;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;n=(this._source.loopStart+this._elapsed%a)/o;}else n=this._elapsed%o/o;this._progress=n,this.emit("progress",this._progress,o);}}}init(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var Ir=class{constructor(t,e){this._output=e,this._input=t;}get destination(){return this._input}get filters(){return this._filters}set filters(t){if(this._filters&&(this._filters.forEach(e=>{e&&e.disconnect();}),this._filters=null,this._input.connect(this._output)),t&&t.length){this._filters=t.slice(0),this._input.disconnect();let e=null;t.forEach(r=>{e===null?this._input.connect(r.destination):e.connect(r.destination),e=r;}),e.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var nx=class extends Ir{constructor(i){let t=i.audioContext,e=t.createBufferSource(),r=t.createGain(),s=t.createAnalyser();e.connect(s),s.connect(r),r.connect(i.destination),super(s,r),this.context=i,this.bufferSource=e,this.gain=r,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(nx.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let i=this.bufferSource,t=this.context.audioContext.createBufferSource();t.buffer=i.buffer,bt.setParamValue(t.playbackRate,i.playbackRate.value),t.loop=i.loop;let e=this.context.audioContext.createGain();return t.connect(e),e.connect(this.destination),{source:t,gain:e}}get bufferSize(){return this.script.bufferSize}},Rn=nx;Rn.BUFFER_SIZE=0;var Rr=class{init(t){this.parent=t,this._nodes=new Rn(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t);}this._source=null,this.source=null;}create(){return new Bs(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(t){this._nodes.filters=t;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(t){this._source.buffer=t;}get nodes(){return this._nodes}load(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t?t(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(t){let e=this.parent.url,r=await ut.get().fetch(e);this._decode(await r.arrayBuffer(),t);}_decode(t,e){let r=(s,o)=>{if(s)e&&e(s);else {this.parent.isLoaded=true,this.buffer=o;let n=this.parent.autoPlayStart();e&&e(null,this.parent,n);}};t instanceof AudioBuffer?r(null,t):this.parent.context.decode(t,r);}};var gi=class{static from(i){let t={};typeof i=="string"?t.url=i:i instanceof ArrayBuffer||i instanceof AudioBuffer||i instanceof HTMLAudioElement?t.source=i:Array.isArray(i)?t.url=i:t=i,t={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...t},Object.freeze(t);let e=ot().useLegacy?new Ls:new Rr;return new gi(e,t)}constructor(i,t){this.media=i,this.options=t,this._instances=[],this._sprites={},this.media.init(this);let e=t.complete;this._autoPlayOptions=e?{complete:e}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=t.autoPlay,this.singleInstance=t.singleInstance,this.preload=t.preload||this.autoPlay,this.url=Array.isArray(t.url)?this.preferUrl(t.url):t.url,this.speed=t.speed,this.volume=t.volume,this.loop=t.loop,t.sprites&&this.addSprites(t.sprites),this.preload&&this._preload(t.loaded);}preferUrl(i){let[t]=i.map(e=>({url:e,ext:$t.extname(e).slice(1)})).filter(({ext:e})=>Ar[e]).sort((e,r)=>Er.indexOf(e.ext)-Er.indexOf(r.ext));if(!t)throw new Error("No supported file type found");return t.url}get context(){return ot().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(i){this._paused=i,this.refreshPaused();}get speed(){return this._speed}set speed(i){this._speed=i,this.refresh();}get filters(){return this.media.filters}set filters(i){this.media.filters=i;}addSprites(i,t){if(typeof i=="object"){let r={};for(let s in i)r[s]=this.addSprites(s,i[s]);return r}console.assert(!this._sprites[i],`Alias ${i} is already taken`);let e=new Fs(this,t);return this._sprites[i]=e,e}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(i){if(i){let t=this._sprites[i];t!==void 0&&(t.destroy(),delete this._sprites[i]);}else for(let t in this._sprites)this.removeSprites(t);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let i=this._instances.length-1;i>=0;i--)this._instances[i].stop();return this}play(i,t){let e;if(typeof i=="string"?e={sprite:i,loop:this.loop,complete:t}:typeof i=="function"?(e={},e.complete=i):e=i,e={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...e||{}},e.sprite){let s=e.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let o=this._sprites[s];e.start=o.start+(e.start||0),e.end=o.end,e.speed=o.speed||1,e.loop=o.loop||e.loop,delete e.sprite;}if(e.offset&&(e.start=e.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(e));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=e,new Promise((s,o)=>{this._preload((n,a,l)=>{this._preloadQueue.forEach(h=>h()),this._preloadQueue=null,n?o(n):(e.loaded&&e.loaded(n,a,l),s(l));});}));(this.singleInstance||e.singleInstance)&&this._removeInstances();let r=this._createInstance();return this._instances.push(r),this.isPlaying=true,r.once("end",()=>{e.complete&&e.complete(this),this._onComplete(r);}),r.once("stop",()=>{this._onComplete(r);}),r.play(e),r}refresh(){let i=this._instances.length;for(let t=0;t<i;t++)this._instances[t].refresh();}refreshPaused(){let i=this._instances.length;for(let t=0;t<i;t++)this._instances[t].refreshPaused();}get volume(){return this._volume}set volume(i){this._volume=i,this.refresh();}get muted(){return this._muted}set muted(i){this._muted=i,this.refresh();}get loop(){return this._loop}set loop(i){this._loop=i,this.refresh();}_preload(i){this.media.load(i);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let i;return this.autoPlay&&(i=this.play(this._autoPlayOptions)),i}_removeInstances(){for(let i=this._instances.length-1;i>=0;i--)this._poolInstance(this._instances[i]);this._instances.length=0;}_onComplete(i){if(this._instances){let t=this._instances.indexOf(i);t>-1&&this._instances.splice(t,1),this.isPlaying=this._instances.length>0;}this._poolInstance(i);}_createInstance(){if(gi._pool.length>0){let i=gi._pool.pop();return i.init(this.media),i}return this.media.create()}_poolInstance(i){i.destroy(),gi._pool.indexOf(i)<0&&gi._pool.push(i);}},rr=gi;rr._pool=[];var xi=class i extends Ir{constructor(){let t=window,e=new i.AudioContext,r=e.createDynamicsCompressor(),s=e.createAnalyser();s.connect(r),r.connect(e.destination),super(s,r),this.autoPause=true,this._ctx=e,this._offlineCtx=new i.OfflineAudioContext(1,2,t.OfflineAudioContext?Math.max(8e3,Math.min(96e3,e.sampleRate)):44100),this.compressor=r,this.analyser=s,this.events=new tt,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=e.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let t=this._ctx.state;(t==="suspended"||t==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),t.context.state==="suspended"&&t.context.resume();}static get AudioContext(){let t=window;return t.AudioContext||t.webkitAudioContext||null}static get OfflineAudioContext(){let t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null}destroy(){super.destroy();let t=this._ctx;typeof t.close<"u"&&t.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(t){t&&this._ctx.state==="running"?this._ctx.suspend():!t&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=t;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(t,e){let r=o=>{e(new Error(o?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(t,o=>{e(null,o);},r);s&&s.catch(r);}};var Ln=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new xi),this._htmlAudioContext=new Rs,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(t){this.useLegacy||(this._context.filters=t);}get supported(){return xi.AudioContext!==null}add(t,e){if(typeof t=="object"){let o={};for(let n in t){let a=this._getOptions(t[n],e);o[n]=this.add(n,a);}return o}if(console.assert(!this._sounds[t],`Sound with alias ${t} already exists.`),e instanceof rr)return this._sounds[t]=e,e;let r=this._getOptions(e),s=rr.from(r);return this._sounds[t]=s,s}_getOptions(t,e){let r;return typeof t=="string"?r={url:t}:Array.isArray(t)?r={url:t}:t instanceof ArrayBuffer||t instanceof AudioBuffer||t instanceof HTMLAudioElement?r={source:t}:r=t,r={...r,...e||{}},r}get useLegacy(){return this._useLegacy}set useLegacy(t){this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(t){this._webAudioContext.autoPause=!t;}remove(t){return this.exists(t,true),this._sounds[t].destroy(),delete this._sounds[t],this}get volumeAll(){return this._context.volume}set volumeAll(t){this._context.volume=t,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(t){this._context.speed=t,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this}stopAll(){for(let t in this._sounds)this._sounds[t].stop();return this}exists(t,e=false){let r=!!this._sounds[t];return e&&console.assert(r,`No sound matching alias '${t}'.`),r}isPlaying(){for(let t in this._sounds)if(this._sounds[t].isPlaying)return true;return false}find(t){return this.exists(t,true),this._sounds[t]}play(t,e){return this.find(t).play(e)}stop(t){return this.find(t).stop()}pause(t){return this.find(t).pause()}resume(t){return this.find(t).resume()}volume(t,e){let r=this.find(t);return e!==void 0&&(r.volume=e),r.volume}speed(t,e){let r=this.find(t);return e!==void 0&&(r.speed=e),r.speed}duration(t){return this.find(t).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};var ax=i=>{let t=i.src,e=i?.alias?.[0];return (!e||i.src===e)&&(e=$t.basename(t,$t.extname(t))),e},lx={extension:C.Asset,detection:{test:async()=>true,add:async i=>[...i,...Er.filter(t=>Ar[t])],remove:async i=>i.filter(t=>i.includes(t))},loader:{name:"sound",extension:{type:[C.LoadParser],priority:Yr.High},test(i){let t=$t.extname(i).slice(1);return !!Ar[t]||Eh.some(e=>i.startsWith(`data:${e}`))},async load(i,t){let e=await new Promise((r,s)=>rr.from({...t.data,url:i,preload:true,loaded(o,n){o?s(o):r(n),t.data?.loaded?.(o,n);}}));return ot().add(ax(t),e),e},async unload(i,t){ot().remove(ax(t));}}};H.add(lx);Hh(new Ln);({DistortionFilter:Se.DistortionFilter,EqualizerFilter:Se.EqualizerFilter,MonoFilter:Se.MonoFilter,ReverbFilter:Se.ReverbFilter,StereoFilter:Se.StereoFilter,StreamFilter:Se.StreamFilter,TelephoneFilter:Se.TelephoneFilter});var Q={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var G;(s=>(s.log=(o,...n)=>console.log(`[Pixi\u2019VN] ${o}`,...n),s.warn=(o,...n)=>console.warn(`[Pixi\u2019VN] ${o}`,...n),s.error=(o,...n)=>console.error(`[Pixi\u2019VN] ${o}`,...n),s.info=(o,...n)=>console.info(`[Pixi\u2019VN] ${o}`,...n)))(G||(G={}));var Y=class Y{static init(t){Y._getStepCounter=t.getStepCounter,Y._setStepCounter=t.setStepCounter,Y._getCurrentGameStepState=t.getCurrentGameStepState,Y._restoreGameStepState=t.restoreGameStepState,Y._getOpenedLabels=t.getOpenedLabels,t.onGoNextEnd&&(Y._onGoNextEnd=t.onGoNextEnd),Y._getVariable=t.getVariable,Y._setVariable=t.setVariable,Y._removeVariable=t.removeVariable,Y._getFlag=t.getFlag,Y._setFlag=t.setFlag,t.onLabelClosing&&(Y._onLabelClosing=t.onLabelClosing),Y._addHistoryItem=t.addHistoryItem,Y._getCurrentStepsRunningNumber=t.getCurrentStepsRunningNumber,Y._getCharacter=t.getCharacter;}static get stepCounter(){return Y._getStepCounter()}static set stepCounter(t){Y._setStepCounter(t);}static get currentGameStepState(){return Y._getCurrentGameStepState()}static get restoreGameStepState(){return Y._restoreGameStepState}static get openedLabels(){return Y._getOpenedLabels()}static get onGoNextEnd(){return Y._onGoNextEnd}static get getVariable(){return Y._getVariable}static get setVariable(){return Y._setVariable}static get removeVariable(){return Y._removeVariable}static get getFlag(){return Y._getFlag}static get setFlag(){return Y._setFlag}static get onLabelClosing(){return Y._onLabelClosing}static get addHistoryItem(){return Y._addHistoryItem}static get currentStepsRunningNumber(){return Y._getCurrentStepsRunningNumber()}static get getCharacter(){return Y._getCharacter}};k(Y,"_getStepCounter",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_setStepCounter",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getCurrentGameStepState",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_restoreGameStepState",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getOpenedLabels",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_onGoNextEnd",async()=>{}),k(Y,"_getVariable",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_setVariable",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_removeVariable",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getFlag",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_setFlag",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_onLabelClosing",()=>{}),k(Y,"_addHistoryItem",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getCurrentStepsRunningNumber",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getCharacter",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),k(Y,"onEnd"),k(Y,"onError");var V=Y;function ke(i){try{if(typeof i>"u")return i;let t=JSON.stringify(i);return JSON.parse(t)}catch(t){throw G.error("Error creating exportable element",i,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var _i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,dx=new Set,Ah=typeof process=="object"&&process?process:{},fx=(i,t,e,r)=>{typeof Ah.emitWarning=="function"?Ah.emitWarning(i,t,e,r):console.error(`[${e}] ${t}: ${i}`);},kn=globalThis.AbortController,hx=globalThis.AbortSignal;if(typeof kn>"u"){hx=class{constructor(){k(this,"onabort");k(this,"_onabort",[]);k(this,"reason");k(this,"aborted",false);}addEventListener(r,s){this._onabort.push(s);}},kn=class{constructor(){k(this,"signal",new hx);t();}abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=true;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r);}}};let i=Ah.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{i&&(i=false,fx("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t));};}var qy=i=>!dx.has(i),ir=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),px=i=>ir(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?yi:null:null,yi=class extends Array{constructor(t){super(t),this.fill(0);}},bi,Lr=class Lr{constructor(t,e){k(this,"heap");k(this,"length");if(!_(Lr,bi))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0;}static create(t){let e=px(t);if(!e)return [];W(Lr,bi,true);let r=new Lr(t,e);return W(Lr,bi,false),r}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}};bi=new WeakMap,J(Lr,bi,false);var Ih=Lr,ux,cx,fe,ee,pe,Fr,me,vi,Si,Mt,ge,Tt,pt,$,Wt,re,Dt,It,xe,Rt,_e,ye,ie,be,ar,Ht,Ti,E,Rh,Br,Xe,Gs,se,mx,kr,wi,Os,sr,or,Lh,Fn,Bn,ft,Fh,ks,nr,Bh,kh=class kh{constructor(t){J(this,E);J(this,fe);J(this,ee);J(this,pe);J(this,Fr);J(this,me);J(this,vi);J(this,Si);k(this,"ttl");k(this,"ttlResolution");k(this,"ttlAutopurge");k(this,"updateAgeOnGet");k(this,"updateAgeOnHas");k(this,"allowStale");k(this,"noDisposeOnSet");k(this,"noUpdateTTL");k(this,"maxEntrySize");k(this,"sizeCalculation");k(this,"noDeleteOnFetchRejection");k(this,"noDeleteOnStaleGet");k(this,"allowStaleOnFetchAbort");k(this,"allowStaleOnFetchRejection");k(this,"ignoreFetchAbort");J(this,Mt);J(this,ge);J(this,Tt);J(this,pt);J(this,$);J(this,Wt);J(this,re);J(this,Dt);J(this,It);J(this,xe);J(this,Rt);J(this,_e);J(this,ye);J(this,ie);J(this,be);J(this,ar);J(this,Ht);J(this,Ti);J(this,Br,()=>{});J(this,Xe,()=>{});J(this,Gs,()=>{});J(this,se,()=>false);J(this,kr,t=>{});J(this,wi,(t,e,r)=>{});J(this,Os,(t,e,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});k(this,ux,"LRUCache");let{max:e=0,ttl:r,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:n,updateAgeOnHas:a,allowStale:l,dispose:h,onInsert:u,disposeAfter:c,noDisposeOnSet:f,noUpdateTTL:d,maxSize:x=0,maxEntrySize:b=0,sizeCalculation:m,fetchMethod:p,memoMethod:y,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:T,ignoreFetchAbort:w}=t;if(e!==0&&!ir(e))throw new TypeError("max option must be a nonnegative integer");let B=e?px(e):Array;if(!B)throw new Error("invalid max value: "+e);if(W(this,fe,e),W(this,ee,x),this.maxEntrySize=b||_(this,ee),this.sizeCalculation=m,this.sizeCalculation){if(!_(this,ee)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(W(this,Si,y),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(W(this,vi,p),W(this,ar,!!p),W(this,Tt,new Map),W(this,pt,new Array(e).fill(void 0)),W(this,$,new Array(e).fill(void 0)),W(this,Wt,new B(e)),W(this,re,new B(e)),W(this,Dt,0),W(this,It,0),W(this,xe,Ih.create(e)),W(this,Mt,0),W(this,ge,0),typeof h=="function"&&W(this,pe,h),typeof u=="function"&&W(this,Fr,u),typeof c=="function"?(W(this,me,c),W(this,Rt,[])):(W(this,me,void 0),W(this,Rt,void 0)),W(this,be,!!_(this,pe)),W(this,Ti,!!_(this,Fr)),W(this,Ht,!!_(this,me)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!w,this.maxEntrySize!==0){if(_(this,ee)!==0&&!ir(_(this,ee)))throw new TypeError("maxSize must be a positive integer if specified");if(!ir(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");F(this,E,mx).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!a,this.ttlResolution=ir(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!ir(this.ttl))throw new TypeError("ttl must be a positive integer if specified");F(this,E,Rh).call(this);}if(_(this,fe)===0&&this.ttl===0&&_(this,ee)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!_(this,fe)&&!_(this,ee)){let M="LRU_CACHE_UNBOUNDED";qy(M)&&(dx.add(M),fx("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,kh));}}static unsafeExposeInternals(t){return {starts:_(t,ye),ttls:_(t,ie),sizes:_(t,_e),keyMap:_(t,Tt),keyList:_(t,pt),valList:_(t,$),next:_(t,Wt),prev:_(t,re),get head(){return _(t,Dt)},get tail(){return _(t,It)},free:_(t,xe),isBackgroundFetch:e=>{var r;return F(r=t,E,ft).call(r,e)},backgroundFetch:(e,r,s,o)=>{var n;return F(n=t,E,Bn).call(n,e,r,s,o)},moveToTail:e=>{var r;return F(r=t,E,ks).call(r,e)},indexes:e=>{var r;return F(r=t,E,sr).call(r,e)},rindexes:e=>{var r;return F(r=t,E,or).call(r,e)},isStale:e=>{var r;return _(r=t,se).call(r,e)}}}get max(){return _(this,fe)}get maxSize(){return _(this,ee)}get calculatedSize(){return _(this,ge)}get size(){return _(this,Mt)}get fetchMethod(){return _(this,vi)}get memoMethod(){return _(this,Si)}get dispose(){return _(this,pe)}get onInsert(){return _(this,Fr)}get disposeAfter(){return _(this,me)}getRemainingTTL(t){return _(this,Tt).has(t)?1/0:0}*entries(){for(let t of F(this,E,sr).call(this))_(this,$)[t]!==void 0&&_(this,pt)[t]!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield [_(this,pt)[t],_(this,$)[t]]);}*rentries(){for(let t of F(this,E,or).call(this))_(this,$)[t]!==void 0&&_(this,pt)[t]!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield [_(this,pt)[t],_(this,$)[t]]);}*keys(){for(let t of F(this,E,sr).call(this)){let e=_(this,pt)[t];e!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield e);}}*rkeys(){for(let t of F(this,E,or).call(this)){let e=_(this,pt)[t];e!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield e);}}*values(){for(let t of F(this,E,sr).call(this))_(this,$)[t]!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield _(this,$)[t]);}*rvalues(){for(let t of F(this,E,or).call(this))_(this,$)[t]!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield _(this,$)[t]);}[(cx=Symbol.iterator,ux=Symbol.toStringTag,cx)](){return this.entries()}find(t,e={}){for(let r of F(this,E,sr).call(this)){let s=_(this,$)[r],o=F(this,E,ft).call(this,s)?s.__staleWhileFetching:s;if(o!==void 0&&t(o,_(this,pt)[r],this))return this.get(_(this,pt)[r],e)}}forEach(t,e=this){for(let r of F(this,E,sr).call(this)){let s=_(this,$)[r],o=F(this,E,ft).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(e,o,_(this,pt)[r],this);}}rforEach(t,e=this){for(let r of F(this,E,or).call(this)){let s=_(this,$)[r],o=F(this,E,ft).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(e,o,_(this,pt)[r],this);}}purgeStale(){let t=false;for(let e of F(this,E,or).call(this,{allowStale:true}))_(this,se).call(this,e)&&(F(this,E,nr).call(this,_(this,pt)[e],"expire"),t=true);return t}info(t){let e=_(this,Tt).get(t);if(e===void 0)return;let r=_(this,$)[e],s=F(this,E,ft).call(this,r)?r.__staleWhileFetching:r;if(s===void 0)return;let o={value:s};if(_(this,ie)&&_(this,ye)){let n=_(this,ie)[e],a=_(this,ye)[e];if(n&&a){let l=n-(_i.now()-a);o.ttl=l,o.start=Date.now();}}return _(this,_e)&&(o.size=_(this,_e)[e]),o}dump(){let t=[];for(let e of F(this,E,sr).call(this,{allowStale:true})){let r=_(this,pt)[e],s=_(this,$)[e],o=F(this,E,ft).call(this,s)?s.__staleWhileFetching:s;if(o===void 0||r===void 0)continue;let n={value:o};if(_(this,ie)&&_(this,ye)){n.ttl=_(this,ie)[e];let a=_i.now()-_(this,ye)[e];n.start=Math.floor(Date.now()-a);}_(this,_e)&&(n.size=_(this,_e)[e]),t.unshift([r,n]);}return t}load(t){this.clear();for(let[e,r]of t){if(r.start){let s=Date.now()-r.start;r.start=_i.now()-s;}this.set(e,r.value,r);}}set(t,e,r={}){var f,d,x,b;if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:o,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=r,{noUpdateTTL:h=this.noUpdateTTL}=r,u=_(this,Os).call(this,t,e,r.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),F(this,E,nr).call(this,t,"set"),this;let c=_(this,Mt)===0?void 0:_(this,Tt).get(t);if(c===void 0)c=_(this,Mt)===0?_(this,It):_(this,xe).length!==0?_(this,xe).pop():_(this,Mt)===_(this,fe)?F(this,E,Fn).call(this,false):_(this,Mt),_(this,pt)[c]=t,_(this,$)[c]=e,_(this,Tt).set(t,c),_(this,Wt)[_(this,It)]=c,_(this,re)[c]=_(this,It),W(this,It,c),Ys(this,Mt)._++,_(this,wi).call(this,c,u,l),l&&(l.set="add"),h=false,_(this,Ti)&&((f=_(this,Fr))==null||f.call(this,e,t,"add"));else {F(this,E,ks).call(this,c);let m=_(this,$)[c];if(e!==m){if(_(this,ar)&&F(this,E,ft).call(this,m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=m;p!==void 0&&!n&&(_(this,be)&&((d=_(this,pe))==null||d.call(this,p,t,"set")),_(this,Ht)&&_(this,Rt)?.push([p,t,"set"]));}else n||(_(this,be)&&((x=_(this,pe))==null||x.call(this,m,t,"set")),_(this,Ht)&&_(this,Rt)?.push([m,t,"set"]));if(_(this,kr).call(this,c),_(this,wi).call(this,c,u,l),_(this,$)[c]=e,l){l.set="replace";let p=m&&F(this,E,ft).call(this,m)?m.__staleWhileFetching:m;p!==void 0&&(l.oldValue=p);}}else l&&(l.set="update");_(this,Ti)&&this.onInsert?.(e,t,e===m?"update":"replace");}if(s!==0&&!_(this,ie)&&F(this,E,Rh).call(this),_(this,ie)&&(h||_(this,Gs).call(this,c,s,o),l&&_(this,Xe).call(this,l,c)),!n&&_(this,Ht)&&_(this,Rt)){let m=_(this,Rt),p;for(;p=m?.shift();)(b=_(this,me))==null||b.call(this,...p);}return this}pop(){var t;try{for(;_(this,Mt);){let e=_(this,$)[_(this,Dt)];if(F(this,E,Fn).call(this,!0),F(this,E,ft).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(_(this,Ht)&&_(this,Rt)){let e=_(this,Rt),r;for(;r=e?.shift();)(t=_(this,me))==null||t.call(this,...r);}}}has(t,e={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=e,o=_(this,Tt).get(t);if(o!==void 0){let n=_(this,$)[o];if(F(this,E,ft).call(this,n)&&n.__staleWhileFetching===void 0)return false;if(_(this,se).call(this,o))s&&(s.has="stale",_(this,Xe).call(this,s,o));else return r&&_(this,Br).call(this,o),s&&(s.has="hit",_(this,Xe).call(this,s,o)),true}else s&&(s.has="miss");return false}peek(t,e={}){let{allowStale:r=this.allowStale}=e,s=_(this,Tt).get(t);if(s===void 0||!r&&_(this,se).call(this,s))return;let o=_(this,$)[s];return F(this,E,ft).call(this,o)?o.__staleWhileFetching:o}async fetch(t,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:x=this.allowStaleOnFetchAbort,context:b,forceRefresh:m=false,status:p,signal:y}=e;if(!_(this,ar))return p&&(p.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:p});let v={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:n,noDisposeOnSet:a,size:l,sizeCalculation:h,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:x,ignoreFetchAbort:d,status:p,signal:y},S=_(this,Tt).get(t);if(S===void 0){p&&(p.fetch="miss");let P=F(this,E,Bn).call(this,t,S,v,b);return P.__returned=P}else {let P=_(this,$)[S];if(F(this,E,ft).call(this,P)){let I=r&&P.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",I&&(p.returnedStale=true)),I?P.__staleWhileFetching:P.__returned=P}let T=_(this,se).call(this,S);if(!m&&!T)return p&&(p.fetch="hit"),F(this,E,ks).call(this,S),s&&_(this,Br).call(this,S),p&&_(this,Xe).call(this,p,S),P;let w=F(this,E,Bn).call(this,t,S,v,b),M=w.__staleWhileFetching!==void 0&&r;return p&&(p.fetch=T?"stale":"refresh",M&&T&&(p.returnedStale=true)),M?w.__staleWhileFetching:w.__returned=w}}async forceFetch(t,e={}){let r=await this.fetch(t,e);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(t,e={}){let r=_(this,Si);if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:o,...n}=e,a=this.get(t,n);if(!o&&a!==void 0)return a;let l=r(t,a,{options:n,context:s});return this.set(t,l,n),l}get(t,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:n}=e,a=_(this,Tt).get(t);if(a!==void 0){let l=_(this,$)[a],h=F(this,E,ft).call(this,l);return n&&_(this,Xe).call(this,n,a),_(this,se).call(this,a)?(n&&(n.get="stale"),h?(n&&r&&l.__staleWhileFetching!==void 0&&(n.returnedStale=true),r?l.__staleWhileFetching:void 0):(o||F(this,E,nr).call(this,t,"expire"),n&&r&&(n.returnedStale=true),r?l:void 0)):(n&&(n.get="hit"),h?l.__staleWhileFetching:(F(this,E,ks).call(this,a),s&&_(this,Br).call(this,a),l))}else n&&(n.get="miss");}delete(t){return F(this,E,nr).call(this,t,"delete")}clear(){return F(this,E,Bh).call(this,"delete")}};fe=new WeakMap,ee=new WeakMap,pe=new WeakMap,Fr=new WeakMap,me=new WeakMap,vi=new WeakMap,Si=new WeakMap,Mt=new WeakMap,ge=new WeakMap,Tt=new WeakMap,pt=new WeakMap,$=new WeakMap,Wt=new WeakMap,re=new WeakMap,Dt=new WeakMap,It=new WeakMap,xe=new WeakMap,Rt=new WeakMap,_e=new WeakMap,ye=new WeakMap,ie=new WeakMap,be=new WeakMap,ar=new WeakMap,Ht=new WeakMap,Ti=new WeakMap,E=new WeakSet,Rh=function(){let t=new yi(_(this,fe)),e=new yi(_(this,fe));W(this,ie,t),W(this,ye,e),W(this,Gs,(o,n,a=_i.now())=>{if(e[o]=n!==0?a:0,t[o]=n,n!==0&&this.ttlAutopurge){let l=setTimeout(()=>{_(this,se).call(this,o)&&F(this,E,nr).call(this,_(this,pt)[o],"expire");},n+1);l.unref&&l.unref();}}),W(this,Br,o=>{e[o]=t[o]!==0?_i.now():0;}),W(this,Xe,(o,n)=>{if(t[n]){let a=t[n],l=e[n];if(!a||!l)return;o.ttl=a,o.start=l,o.now=r||s();let h=o.now-l;o.remainingTTL=a-h;}});let r=0,s=()=>{let o=_i.now();if(this.ttlResolution>0){r=o;let n=setTimeout(()=>r=0,this.ttlResolution);n.unref&&n.unref();}return o};this.getRemainingTTL=o=>{let n=_(this,Tt).get(o);if(n===void 0)return 0;let a=t[n],l=e[n];if(!a||!l)return 1/0;let h=(r||s())-l;return a-h},W(this,se,o=>{let n=e[o],a=t[o];return !!a&&!!n&&(r||s())-n>a});},Br=new WeakMap,Xe=new WeakMap,Gs=new WeakMap,se=new WeakMap,mx=function(){let t=new yi(_(this,fe));W(this,ge,0),W(this,_e,t),W(this,kr,e=>{W(this,ge,_(this,ge)-t[e]),t[e]=0;}),W(this,Os,(e,r,s,o)=>{if(F(this,E,ft).call(this,r))return 0;if(!ir(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(r,e),!ir(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),W(this,wi,(e,r,s)=>{if(t[e]=r,_(this,ee)){let o=_(this,ee)-t[e];for(;_(this,ge)>o;)F(this,E,Fn).call(this,true);}W(this,ge,_(this,ge)+t[e]),s&&(s.entrySize=r,s.totalCalculatedSize=_(this,ge));});},kr=new WeakMap,wi=new WeakMap,Os=new WeakMap,sr=function*({allowStale:t=this.allowStale}={}){if(_(this,Mt))for(let e=_(this,It);!(!F(this,E,Lh).call(this,e)||((t||!_(this,se).call(this,e))&&(yield e),e===_(this,Dt)));)e=_(this,re)[e];},or=function*({allowStale:t=this.allowStale}={}){if(_(this,Mt))for(let e=_(this,Dt);!(!F(this,E,Lh).call(this,e)||((t||!_(this,se).call(this,e))&&(yield e),e===_(this,It)));)e=_(this,Wt)[e];},Lh=function(t){return t!==void 0&&_(this,Tt).get(_(this,pt)[t])===t},Fn=function(t){var o;let e=_(this,Dt),r=_(this,pt)[e],s=_(this,$)[e];return _(this,ar)&&F(this,E,ft).call(this,s)?s.__abortController.abort(new Error("evicted")):(_(this,be)||_(this,Ht))&&(_(this,be)&&((o=_(this,pe))==null||o.call(this,s,r,"evict")),_(this,Ht)&&_(this,Rt)?.push([s,r,"evict"])),_(this,kr).call(this,e),t&&(_(this,pt)[e]=void 0,_(this,$)[e]=void 0,_(this,xe).push(e)),_(this,Mt)===1?(W(this,Dt,W(this,It,0)),_(this,xe).length=0):W(this,Dt,_(this,Wt)[e]),_(this,Tt).delete(r),Ys(this,Mt)._--,e},Bn=function(t,e,r,s){let o=e===void 0?void 0:_(this,$)[e];if(F(this,E,ft).call(this,o))return o;let n=new kn,{signal:a}=r;a?.addEventListener("abort",()=>n.abort(a.reason),{signal:n.signal});let l={signal:n.signal,options:r,context:s},h=(b,m=false)=>{let{aborted:p}=n.signal,y=r.ignoreFetchAbort&&b!==void 0;if(r.status&&(p&&!m?(r.status.fetchAborted=true,r.status.fetchError=n.signal.reason,y&&(r.status.fetchAbortIgnored=true)):r.status.fetchResolved=true),p&&!y&&!m)return c(n.signal.reason);let v=d;return _(this,$)[e]===d&&(b===void 0?v.__staleWhileFetching?_(this,$)[e]=v.__staleWhileFetching:F(this,E,nr).call(this,t,"fetch"):(r.status&&(r.status.fetchUpdated=true),this.set(t,b,l.options))),b},u=b=>(r.status&&(r.status.fetchRejected=true,r.status.fetchError=b),c(b)),c=b=>{let{aborted:m}=n.signal,p=m&&r.allowStaleOnFetchAbort,y=p||r.allowStaleOnFetchRejection,v=y||r.noDeleteOnFetchRejection,S=d;if(_(this,$)[e]===d&&(!v||S.__staleWhileFetching===void 0?F(this,E,nr).call(this,t,"fetch"):p||(_(this,$)[e]=S.__staleWhileFetching)),y)return r.status&&S.__staleWhileFetching!==void 0&&(r.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw b},f=(b,m)=>{var y;let p=(y=_(this,vi))==null?void 0:y.call(this,t,o,l);p&&p instanceof Promise&&p.then(v=>b(v===void 0?void 0:v),m),n.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(b(void 0),r.allowStaleOnFetchAbort&&(b=v=>h(v,true)));});};r.status&&(r.status.fetchDispatched=true);let d=new Promise(f).then(h,u),x=Object.assign(d,{__abortController:n,__staleWhileFetching:o,__returned:void 0});return e===void 0?(this.set(t,x,{...l.options,status:void 0}),e=_(this,Tt).get(t)):_(this,$)[e]=x,x},ft=function(t){if(!_(this,ar))return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof kn},Fh=function(t,e){_(this,re)[e]=t,_(this,Wt)[t]=e;},ks=function(t){t!==_(this,It)&&(t===_(this,Dt)?W(this,Dt,_(this,Wt)[t]):F(this,E,Fh).call(this,_(this,re)[t],_(this,Wt)[t]),F(this,E,Fh).call(this,_(this,It),t),W(this,It,t));},nr=function(t,e){var s,o;let r=false;if(_(this,Mt)!==0){let n=_(this,Tt).get(t);if(n!==void 0)if(r=true,_(this,Mt)===1)F(this,E,Bh).call(this,e);else {_(this,kr).call(this,n);let a=_(this,$)[n];if(F(this,E,ft).call(this,a)?a.__abortController.abort(new Error("deleted")):(_(this,be)||_(this,Ht))&&(_(this,be)&&((s=_(this,pe))==null||s.call(this,a,t,e)),_(this,Ht)&&_(this,Rt)?.push([a,t,e])),_(this,Tt).delete(t),_(this,pt)[n]=void 0,_(this,$)[n]=void 0,n===_(this,It))W(this,It,_(this,re)[n]);else if(n===_(this,Dt))W(this,Dt,_(this,Wt)[n]);else {let l=_(this,re)[n];_(this,Wt)[l]=_(this,Wt)[n];let h=_(this,Wt)[n];_(this,re)[h]=_(this,re)[n];}Ys(this,Mt)._--,_(this,xe).push(n);}}if(_(this,Ht)&&_(this,Rt)?.length){let n=_(this,Rt),a;for(;a=n?.shift();)(o=_(this,me))==null||o.call(this,...a);}return r},Bh=function(t){var e,r;for(let s of F(this,E,or).call(this,{allowStale:true})){let o=_(this,$)[s];if(F(this,E,ft).call(this,o))o.__abortController.abort(new Error("deleted"));else {let n=_(this,pt)[s];_(this,be)&&((e=_(this,pe))==null||e.call(this,o,n,t)),_(this,Ht)&&_(this,Rt)?.push([o,n,t]);}}if(_(this,Tt).clear(),_(this,$).fill(void 0),_(this,pt).fill(void 0),_(this,ie)&&_(this,ye)&&(_(this,ie).fill(0),_(this,ye).fill(0)),_(this,_e)&&_(this,_e).fill(0),W(this,Dt,0),W(this,It,0),_(this,xe).length=0,W(this,ge,0),W(this,Mt,0),_(this,Ht)&&_(this,Rt)){let s=_(this,Rt),o;for(;o=s?.shift();)(r=_(this,me))==null||r.call(this,...o);}};var Gn=kh;var Ci=class{constructor(t){k(this,"cache");k(this,"map",new Map);this.cache=new Gn({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(t){let e=this.map.delete(t);return e&&this.cache.delete(t),e}get forEach(){return this.map.forEach}get(t){let e=this.cache.get(t);return e||this.map.get(t)}has(t){return this.map.has(t)}set(t,e){return this.map.set(t,e),this.cache.set(t,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ds=new Ci({cacheSize:10}),Gh;(s=>{function i(o){let n=Ds.get(o);if(!n){G.error(`Label "${o}" not found`);return}return n}s.get=i;function t(o){if(Array.isArray(o)){o.forEach(n=>t(n));return}Ds.has(o.id)&&G.info(`Label "${o.id}" already exists, it will be overwritten`),Ds.set(o.id,o);}s.add=t;function e(){return Array.from(Ds.values())}s.values=e;function r(o){return Ds.has(o)}s.has=r;})(Gh||(Gh={}));var ve=Gh;var O=class O{constructor(){}static get allOpenedLabels(){return V.getVariable(Q.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(t){V.setVariable(Q.OPENED_LABELS_COUNTER_KEY,t);}static getCurrentStepTimesCounterData(t=""){let e=O.currentLabelStepIndex;if(e===null)return G.error("currentLabelStepIndex is null"),null;let r=`${e}${t}`,s=O.currentLabelId,o=O._currentLabel;if(!s||e===null||!o)return G.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let n=o.getStepSha(e)||"error",a=V.getVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][r]||a[s][r].stepSha1!=n)&&(a[s][r]={stepSha1:n}),a[s][r]}static setCurrentStepTimesCounterData(t="",e){let r=O.currentLabelStepIndex,s=r+t,o=O.currentLabelId;if(!o||r===null){G.error("currentLabelId or currentLabelStepIndex is null");return}let n=V.getVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[o]||(n[o]={}),n[o][s]=e,V.setVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static getCurrentStepTimesCounter(t=""){let e=O._stepCounter,r=O.getCurrentStepTimesCounterData(t);if(!r)return G.error("getCurrentStepTimesCounter obj is null"),0;let s=r.stepCounters||r.lastStepIndexs||[];return s.find(n=>n===e)||(s.push(e),delete r.lastStepIndexs,r.stepCounters=s,O.setCurrentStepTimesCounterData(t,r)),s.length}static getRandomNumber(t,e,r={}){let s=r.nestedId||"";if(r.onceOnly||false){let n=O.getCurrentStepTimesCounterData(s);if(!n)return;let a=n.usedRandomNumbers||{},l=Array.from({length:e-t+1},(c,f)=>f+t).filter(c=>!a[`${t}-${e}`]?.includes(c));if(l.length===0)return;let h=Math.floor(Math.random()*l.length),u=l[h];return a[`${t}-${e}`]||(a[`${t}-${e}`]=[]),a[`${t}-${e}`].push(u),n.usedRandomNumbers=a,O.setCurrentStepTimesCounterData(s,n),u}return Math.floor(Math.random()*(e-t+1))+t}static resetCurrentStepTimesCounter(t=""){let e=O.currentLabelStepIndex,r=e+t,s=O.currentLabelId;if(!s||e===null){G.error("currentLabelId or currentLabelStepIndex is null");return}let o=V.getVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[s]||(o[s]={}),o[s][r]={stepCounters:[],stepSha1:""},V.setVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static get allChoicesMade(){return V.getVariable(Q.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(t){V.setVariable(Q.ALL_CHOICES_MADE_KEY,t);}static increaseStepCounter(){O._stepCounter++;}static get openedLabels(){return ke(O._openedLabels)}static set openedLabels(t){O._openedLabels=ke(t);}static get originalOpenedLabels(){return ke(O._originalOpenedLabels)}static set originalOpenedLabels(t){O._originalOpenedLabels=ke(t);}static get _currentLabel(){if(O.currentLabelId)return ve.get(O.currentLabelId)}static get currentLabelId(){if(O._openedLabels.length>0)return O._openedLabels[O._openedLabels.length-1].label}static get currentLabelStepIndex(){return O._openedLabels.length>0?O._openedLabels[O._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(t,e){let r=O.allOpenedLabels,s=O.allOpenedLabels[t]?.biggestStep||0,o=O.allOpenedLabels[t]?.openCount||0;(!s||s<e)&&(r[t]={biggestStep:e,openCount:o},O.allOpenedLabels=r);}static addChoicesMade(t,e,r,s){let o=O.allChoicesMade,n=o.findIndex(a=>a.labelId===t&&a.stepIndex===e&&a.choiceIndex===s&&a.stepSha1===r);n<0?o.push({labelId:t,stepIndex:e,choiceIndex:s,stepSha1:r,madeTimes:1}):o[n].madeTimes++,O.allChoicesMade=o;}static pushNewLabel(t){if(!ve.get(t))throw new Error(`[Pixi\u2019VN] Label ${t} not found`);O._openedLabels.push({label:t,currentStepIndex:0});let r=O.allOpenedLabels,s=O.allOpenedLabels[t]?.biggestStep||0,o=O.allOpenedLabels[t]?.openCount||0;r[t]={biggestStep:s,openCount:o+1},O.allOpenedLabels=r;}static increaseCurrentStepIndex(){if(O._openedLabels.length>0){let t=O._openedLabels[O._openedLabels.length-1];O._openedLabels[O._openedLabels.length-1]={...t,currentStepIndex:t.currentStepIndex+1};}}static set onStepStart(t){O._onStepStart=t;}static get onStepStart(){return async(t,e)=>{let r=[];return O.onLoadingLabel&&t===0&&r.push(O.onLoadingLabel(t,e)),O._onStepStart&&r.push(O._onStepStart(t,e)),await Promise.all(r)}}};k(O,"stepsRunning",0),k(O,"goNextRequests",0),k(O,"choiceMadeTemp"),k(O,"lastHistoryStep",null),k(O,"_stepCounter",0),k(O,"_openedLabels",[]),k(O,"_originalOpenedLabels",[]),k(O,"_onStepStart"),k(O,"onLoadingLabel"),k(O,"onStepEnd");var A=O;var Us=class{get currentStepTimesCounter(){return A.getCurrentStepTimesCounter()}set currentStepTimesCounter(t){A.resetCurrentStepTimesCounter();}getRandomNumber(t,e,r={}){return A.getRandomNumber(t,e,r)}get stepCounter(){return A._stepCounter}get openedLabels(){return A.openedLabels}get currentLabel(){return A._currentLabel}addStepHistory(t,e={}){let{choiceMade:r,ignoreSameStep:s}=e,o,n,a,l=V.getVariable(Q.LAST_STEP_GLUED)===this.stepCounter;V.getVariable(Q.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=V.getVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY)),V.getVariable(Q.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(n=V.getVariable(Q.CURRENT_MENU_OPTIONS_MEMORY_KEY)),V.getVariable(Q.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=V.getVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY));let h=A.openedLabels,u={currentLabel:A.currentLabelId,dialogue:o,choices:n,stepSha1:t,index:this.stepCounter,labelStepIndex:A.currentLabelStepIndex,choiceIndexMade:r,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:l,openedLabels:h};A.originalOpenedLabels=h,V.addHistoryItem(u,{ignoreSameStep:s}),A.lastHistoryStep=u,A.increaseStepCounter();}closeCurrentLabel(){if(!A.currentLabelId){G.warn("No label to close");return}if(!this.currentLabel){G.error("currentLabel not found");return}let t=A.openedLabels;t.pop(),A.openedLabels=t,V.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;A.openedLabels.length>0;)this.closeCurrentLabel(),V.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(t){let e;typeof t=="string"?e=t:e=t.id;let s=A.allOpenedLabels[e]?.biggestStep||0;if(s){let o=ve.get(e);if(o)return o.stepCount<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let t=A.currentLabelStepIndex,e=this.currentLabel;if(t===null||!e)return;let r=e.getStepSha(t);return r||(G.warn("stepSha not found, setting to ERROR"),r="error"),A.allChoicesMade.filter(s=>s.labelId===e?.id&&s.stepIndex===t&&s.stepSha1===r)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(t=>t.choiceIndex)}get isCurrentStepAlreadyOpened(){let t=A.currentLabelId;if(t){let e=A.allOpenedLabels[t]?.openCount||0;if(A.currentLabelStepIndex&&e>=A.currentLabelStepIndex)return true}return false}getTimesLabelOpened(t){return A.allOpenedLabels[t]?.openCount||0}getTimesChoiceMade(t){return this.alreadyCurrentStepMadeChoicesObj?.find(e=>e.choiceIndex===t)?.madeTimes||0}addCurrentStepToHistory(){this.addStepHistory("dev",{ignoreSameStep:true});}getCanGoNext(t){let e=t?.showWarn||false,r=this.choiceMenuOptions;return r&&r.length>0?(e&&G.warn("The player must make a choice"),false):this.isRequiredInput?(e&&G.warn("The player must enter a value"),false):true}get canGoNext(){return A.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(t,e){let r=[];return t.onStepStart&&r.push(t.onStepStart(e,t)),A.onStepStart&&r.push(A.onStepStart(e,t)),await Promise.all(r)}async onStepEnd(t,e){let r=[];return t.onStepEnd&&r.push(t.onStepEnd(e,t)),A.onStepEnd&&r.push(A.onStepEnd(e,t)),await Promise.all(r)}async goNext(t,e={}){let{runNow:r=false}=e;if(!(!r&&!this.getCanGoNext({showWarn:true}))){if(!r&&A.stepsRunning!==0){A.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,A.currentLabelStepIndex||0);}catch(s){G.error("Error running onStepEnd",s);}return A.stepsRunning===0&&await V.onGoNextEnd(),A.increaseCurrentStepIndex(),await this.runCurrentStep(t,e)}}async runCurrentStep(t,e={}){let{choiceMade:r}=e;if(A.currentLabelId){let s=A.currentLabelStepIndex;if(s===null){G.error("currentLabelStepIndex is null");return}let o=A._currentLabel;if(!o){G.error("currentLabel not found");return}if(o.stepCount>s){try{await this.onStepRun(o,s);}catch(l){G.error("Error running onStepStart",l),this.onStepError&&this.onStepError(l,t);return}let n=o.getStepById(s);if(!n){G.error("step not found");return}let a=o.getStepSha(s);a||(G.warn("stepSha not found, setting to ERROR"),a="error");try{A.stepsRunning++;let l=await n(t,{labelId:o.id}),h=this.choiceMenuOptions;if(h?.length===1&&h[0].autoSelect){let c=h[0];l=await this.selectChoice(c,t);}let u=A.lastHistoryStep;if(r!==void 0&&u){let c=u.stepSha1;c||(G.warn("stepSha not found, setting to ERROR"),c="error"),A.addChoicesMade(u.currentLabel||"error",typeof u.labelStepIndex=="number"?u.labelStepIndex:-1,u.stepSha1||"error",r),A.choiceMadeTemp=r;}return A.stepsRunning--,A.stepsRunning===0&&(A.addLabelHistory(o.id,s),this.addStepHistory(a,{...e,choiceMade:A.choiceMadeTemp}),A.choiceMadeTemp=void 0,A.goNextRequests>0)?(A.goNextRequests--,await this.goNext(t)):l}catch(l){A.stepsRunning>0&&A.stepsRunning--,G.error("Error running step",l),this.onStepError&&this.onStepError(l,t);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(t,e);if(this.openedLabels.length===1)return A.openedLabels=[],V.onEnd?await V.onEnd(t,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(A.openedLabels=A.originalOpenedLabels,V.onEnd)return await V.onEnd(t,{labelId:"end"});G.error("The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else G.error("currentLabelId not found");}async callLabel(t,e,r){let{choiceMade:s}=r||{},o;typeof t=="string"?o=t:o=t.id;try{let n=ve.get(o);if(!n)throw new Error(`[Pixi\u2019VN] Label ${o} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,A.currentLabelStepIndex||0);}catch(a){G.error("Error running onStepEnd",a);}A.pushNewLabel(n.id);}catch(n){G.error("Error calling label",n);return}return await this.runCurrentStep(e,{choiceMade:s})}async jumpLabel(t,e,r){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:s}=r||{},o;typeof t=="string"?o=t:o=t.id;try{let n=ve.get(o);if(!n)throw new Error(`[Pixi\u2019VN] Label ${o} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,A.currentLabelStepIndex||0);}catch(a){G.error("Error running onStepEnd",a);}A.pushNewLabel(n.id);}catch(n){G.error("Error jumping label",n);return}return await this.runCurrentStep(e,{choiceMade:s})}async selectChoice(t,e){this.choiceMenuOptions=void 0;let r=t.type;switch(r){case "call":return await this.callLabel(t.label,{...t.props,...e},{choiceMade:t.choiceIndex});case "jump":return await this.jumpLabel(t.label,{...t.props,...e},{choiceMade:t.choiceIndex});case "close":return await this.closeChoiceMenu(t,{...t.props,...e});default:throw G.error(`Type ${r} not found`),new Error(`[Pixi\u2019VN] Type ${r} not found`)}}async closeChoiceMenu(t,e){if(t.type!=="close")throw G.error("For closeChoiceMenu, the type must be close"),new Error("[Pixi\u2019VN] For closeChoiceMenu, the type must be close");let r;return typeof t.choiceIndex=="number"&&(r=t.choiceIndex),t.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(e,{choiceMade:r})}get onStepError(){let t=V.onError;return t?(e,r)=>t("step",e,r):void 0}set onStepError(t){V.onError=(e,r,s)=>t(r,s);}get dialogue(){let t=V.getVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY);if(t)return {...t,character:t.character?V.getCharacter(t.character)||t.character:void 0}}set dialogue(t){if(!t){V.setVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof t=="string"||Array.isArray(t))&&(t={text:t}),this.dialogGlue){let e=V.getVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY);if(e){let r=[];Array.isArray(e.text)?r=[...e.text]:r=[e.text],Array.isArray(t.text)?r=[...r,...t.text]:r=[...r,t.text],t.text=r,t.character=t.character||e.character;}V.setVariable(Q.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{V.setVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY,ke({...t,character:typeof t.character=="string"?t.character:t.character?.id})),V.setVariable(Q.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(e){throw G.error("DialogueInterface cannot contain functions or classes"),e}}get choiceMenuOptions(){let t=V.getVariable(Q.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(t){let e=[],r=t.map((o,n)=>({...o,choiceIndex:n})),s=this.alreadyCurrentStepMadeChoices;if(r=r.filter((o,n)=>o.oneTime&&s&&s.includes(n)?false:o.onlyHaveNoChoice?(e.push(o),false):true),r.length>0)return r;if(e.length>0)return [e[0]]}}set choiceMenuOptions(t){if(!t||t.length===0){V.setVariable(Q.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}try{V.setVariable(Q.CURRENT_MENU_OPTIONS_MEMORY_KEY,ke(t)),V.setVariable(Q.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(e){throw G.error("ChoiceInterface cannot contain functions or classes"),e}}get dialogGlue(){return V.getFlag(Q.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(t){V.setFlag(Q.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,t);}get inputValue(){return V.getVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(t){this.removeInputRequest(),V.setVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY,t),V.setVariable(Q.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return V.getVariable(Q.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return V.getVariable(Q.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(t,e){t.isRequired=true,V.setVariable(Q.CURRENT_INPUT_INFO_MEMORY_KEY,t),e!==void 0?V.setVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY,e):V.removeVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){V.removeVariable(Q.CURRENT_INPUT_INFO_MEMORY_KEY),V.removeVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){A.openedLabels=[],A._stepCounter=0;}export(){return {openedLabels:ke(A.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(t){let e=this.openedLabels.map(async r=>{let s=[],o=ve.get(r.label);return o&&(o.onLoadingLabel&&s.push(o.onLoadingLabel(t,o)),A.onLoadingLabel&&s.push(A.onLoadingLabel(t,o))),await Promise.all(s)});return await Promise.all(e)}async restore(t,e){this.clear();try{A.lastHistoryStep=e,t.hasOwnProperty("openedLabels")?(A.openedLabels=t.openedLabels,A.originalOpenedLabels=A.openedLabels):G.warn("Could not import openedLabels data, so will be ignored"),t.hasOwnProperty("stepCounter")?A._stepCounter=t.stepCounter:t.hasOwnProperty("lastStepIndex")?A._stepCounter=t.lastStepIndex:G.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(A.currentLabelStepIndex||0);}catch(r){G.error("Error running onLoadingLabel",r);}}catch(r){G.error("Error importing data",r);}}};function Qy(i,t,e,r){let s=typeof t=="string"?t:t.id;return {...r,label:s,props:e,text:i,type:r?.type||"call"}}var Oh="close";function Jy(i,t){return {...t,type:Oh,text:i}}var bx=Nn(yx());var Pi=class{constructor(t,e){k(this,"_id");k(this,"_onStepStart");k(this,"_onLoadingLabel");k(this,"_onStepEnd");this._id=t,this._onStepStart=e?.onStepStart,this._onLoadingLabel=e?.onLoadingLabel,this._onStepEnd=e?.onStepEnd;}get id(){return this._id}get onStepStart(){return async(t,e)=>{if(this._onLoadingLabel&&t===0&&await this._onLoadingLabel(t,e),this._onStepStart)return await this._onStepStart(t,e)}}get onLoadingLabel(){return this._onLoadingLabel}get onStepEnd(){return this._onStepEnd}};var Mi=class extends Pi{constructor(e,r,s){super(e,s);k(this,"_steps");this._steps=r;}get stepCount(){return this.steps.length}getStepById(e){return this.steps[e]}get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(e){if(e<0||e>=this.steps.length)return G.warn("stepSha not found, setting to ERROR"),"error";try{let r=this.steps[e];return (0,bx.default)(r.toString().toLocaleLowerCase()).toString()}catch(r){return G.warn("stepSha not found, setting to ERROR",r),"error"}}};function vx(i,t,e){let r=new Mi(i,t,e);return ve.add(r),r}var aO=new Us;
|
|
572
|
+
`}};});var yh,bh,Mn,Fg=g(()=>{dt();Do();Ag();Wo();ns();Qe();Ft();Lg();Mn=class extends Re{constructor(){yh??(yh=Jr({name:"tiling-sprite-shader",bits:[Ps,Ig,ei]})),bh??(bh=ti({name:"tiling-sprite-shader",bits:[Eg,Rg,ri]}));let t=new Vt({uMapCoord:{value:new L,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new L,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:bh,gpuProgram:yh,resources:{localUniforms:new Vt({uTransformMatrix:{value:new L,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:t,uTexture:U.EMPTY.source,uSampler:U.EMPTY.source.style}});}updateUniforms(t,e,r,s,o,n){let a=this.resources.tilingUniforms,l=n.width,h=n.height,u=n.textureMatrix,c=a.uniforms.uTextureTransform;c.set(r.a*l/t,r.b*l/e,r.c*h/t,r.d*h/e,r.tx/t,r.ty/e),c.invert(),a.uniforms.uMapCoord=u.mapCoord,a.uniforms.uClampFrame=u.uClampFrame,a.uniforms.uClampOffset=u.uClampOffset,a.uniforms.uTextureTransform=c,a.uniforms.uSizeAnchor[0]=t,a.uniforms.uSizeAnchor[1]=e,a.uniforms.uSizeAnchor[2]=s,a.uniforms.uSizeAnchor[3]=o,n&&(this.resources.uTexture=n.source,this.resources.uSampler=n.source.style);}};});var En,Bg=g(()=>{Pn();En=class extends mi{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])});}};});function kg(i,t){let e=i.anchor.x,r=i.anchor.y;t[0]=-e*i.width,t[1]=-r*i.height,t[2]=(1-e)*i.width,t[3]=-r*i.height,t[4]=(1-e)*i.width,t[5]=(1-r)*i.height,t[6]=-e*i.width,t[7]=(1-r)*i.height;}var Gg=g(()=>{});function Og(i,t,e,r){let s=0,o=i.length/(t),n=r.a,a=r.b,l=r.c,h=r.d,u=r.tx,c=r.ty;for(e*=t;s<o;){let f=i[e],d=i[e+1];i[e]=n*f+l*d+u,i[e+1]=a*f+h*d+c,e+=t,s++;}}var Dg=g(()=>{});function Ug(i,t){let e=i.texture,r=e.frame.width,s=e.frame.height,o=0,n=0;i.applyAnchorToTexture&&(o=i.anchor.x,n=i.anchor.y),t[0]=t[6]=-o,t[2]=t[4]=1-o,t[1]=t[3]=-n,t[5]=t[7]=1-n;let a=L.shared;a.copyFrom(i._tileTransform.matrix),a.tx/=i.width,a.ty/=i.height,a.invert(),a.scale(i.width/r,i.height/s),Og(t,2,0,a);}var zg=g(()=>{dt();Dg();});var An,vh,Ms,Ng=g(()=>{z();rs();Qo();os();cs();Jo();Pn();Fg();Bg();Gg();zg();An=new En,vh=class{constructor(){this.canBatch=true,this.geometry=new mi({indices:An.indices.slice(),positions:An.positions.slice(),uvs:An.uvs.slice()});}destroy(){this.geometry.destroy(),this.shader?.destroy();}},Ms=class{constructor(t){this._state=wr.default2d,this._renderer=t;}validateRenderable(t){let e=this._getTilingSpriteData(t),r=e.canBatch;this._updateCanBatch(t);let s=e.canBatch;if(s&&s===r){let{batchableMesh:o}=e;return !o._batcher.checkAndUpdateTexture(o,t.texture)}return r!==s}addRenderable(t,e){let r=this._renderer.renderPipes.batch;this._updateCanBatch(t);let s=this._getTilingSpriteData(t),{geometry:o,canBatch:n}=s;if(n){s.batchableMesh||(s.batchableMesh=new tr);let a=s.batchableMesh;t.didViewUpdate&&(this._updateBatchableMesh(t),a.geometry=o,a.renderable=t,a.transform=t.groupTransform,a.setTexture(t._texture)),a.roundPixels=this._renderer._roundPixels|t._roundPixels,r.addToBatch(a,e);}else r.break(e),s.shader||(s.shader=new Mn),this.updateRenderable(t),e.add(t);}execute(t){let{shader:e}=this._getTilingSpriteData(t);e.groups[0]=this._renderer.globalUniforms.bindGroup;let r=e.resources.localUniforms.uniforms;r.uTransformMatrix=t.groupTransform,r.uRound=this._renderer._roundPixels|t._roundPixels,Je(t.groupColorAlpha,r.uColor,0),this._state.blendMode=Ne(t.groupBlendMode,t.texture._source),this._renderer.encoder.draw({geometry:An,shader:e,state:this._state});}updateRenderable(t){let e=this._getTilingSpriteData(t),{canBatch:r}=e;if(r){let{batchableMesh:s}=e;t.didViewUpdate&&this._updateBatchableMesh(t),s._batcher.updateElement(s);}else if(t.didViewUpdate){let{shader:s}=e;s.updateUniforms(t.width,t.height,t._tileTransform.matrix,t.anchor.x,t.anchor.y,t.texture);}}_getTilingSpriteData(t){return t._gpuData[this._renderer.uid]||this._initTilingSpriteData(t)}_initTilingSpriteData(t){let e=new vh;return e.renderable=t,t._gpuData[this._renderer.uid]=e,e}_updateBatchableMesh(t){let e=this._getTilingSpriteData(t),{geometry:r}=e,s=t.texture.source.style;s.addressMode!=="repeat"&&(s.addressMode="repeat",s.update()),Ug(t,r.uvs),kg(t,r.positions);}destroy(){this._renderer=null;}_updateCanBatch(t){let e=this._getTilingSpriteData(t),r=t.texture,s=true;return this._renderer.type===Ie.WEBGL&&(s=this._renderer.context.supports.nonPowOf2wrapping),e.canBatch=r.textureMatrix.isSimple&&(s||r.source.isPowerOfTwo),e.canBatch}};Ms.extension={type:[C.WebGLPipes,C.WebGPUPipes,C.CanvasPipes],name:"tilingSprite"};});var Sh=g(()=>{z();Ng();H.add(Ms);});var Vg,Hg,Yg=g(()=>{yt();Pn();Vg=class Wg extends mi{constructor(...t){super({});let e=t[0]??{};typeof e=="number"&&(D(Z,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),e={width:e,height:t[1],verticesX:t[2],verticesY:t[3]}),this.build(e);}build(t){t={...Wg.defaultOptions,...t},this.verticesX=this.verticesX??t.verticesX,this.verticesY=this.verticesY??t.verticesY,this.width=this.width??t.width,this.height=this.height??t.height;let e=this.verticesX*this.verticesY,r=[],s=[],o=[],n=this.verticesX-1,a=this.verticesY-1,l=this.width/n,h=this.height/a;for(let c=0;c<e;c++){let f=c%this.verticesX,d=c/this.verticesX|0;r.push(f*l,d*h),s.push(f/n,d/a);}let u=n*a;for(let c=0;c<u;c++){let f=c%n,d=c/n|0,x=d*this.verticesX+f,b=d*this.verticesX+f+1,m=(d+1)*this.verticesX+f,p=(d+1)*this.verticesX+f+1;o.push(x,b,m,b,p,m);}this.buffers[0].data=new Float32Array(r),this.buffers[1].data=new Float32Array(s),this.indexBuffer.data=new Uint32Array(o),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update();}};Vg.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};Hg=Vg;});var Xg,jg,Kg=g(()=>{Yg();Xg=class $g extends Hg{constructor(t={}){t={...$g.defaultOptions,...t},super({width:t.width,height:t.height,verticesX:4,verticesY:4}),this.update(t);}update(t){this.width=t.width??this.width,this.height=t.height??this.height,this._originalWidth=t.originalWidth??this._originalWidth,this._originalHeight=t.originalHeight??this._originalHeight,this._leftWidth=t.leftWidth??this._leftWidth,this._rightWidth=t.rightWidth??this._rightWidth,this._topHeight=t.topHeight??this._topHeight,this._bottomHeight=t.bottomHeight??this._bottomHeight,this._anchorX=t.anchor?.x,this._anchorY=t.anchor?.y,this.updateUvs(),this.updatePositions();}updatePositions(){let t=this.positions,{width:e,height:r,_leftWidth:s,_rightWidth:o,_topHeight:n,_bottomHeight:a,_anchorX:l,_anchorY:h}=this,u=s+o,c=e>u?1:e/u,f=n+a,d=r>f?1:r/f,x=Math.min(c,d),b=l*e,m=h*r;t[0]=t[8]=t[16]=t[24]=-b,t[2]=t[10]=t[18]=t[26]=s*x-b,t[4]=t[12]=t[20]=t[28]=e-o*x-b,t[6]=t[14]=t[22]=t[30]=e-b,t[1]=t[3]=t[5]=t[7]=-m,t[9]=t[11]=t[13]=t[15]=n*x-m,t[17]=t[19]=t[21]=t[23]=r-a*x-m,t[25]=t[27]=t[29]=t[31]=r-m,this.getBuffer("aPosition").update();}updateUvs(){let t=this.uvs;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1;let e=1/this._originalWidth,r=1/this._originalHeight;t[2]=t[10]=t[18]=t[26]=e*this._leftWidth,t[9]=t[11]=t[13]=t[15]=r*this._topHeight,t[4]=t[12]=t[20]=t[28]=1-e*this._rightWidth,t[17]=t[19]=t[21]=t[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update();}};Xg.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};jg=Xg;});var Th,Es,qg=g(()=>{z();Jo();Kg();Th=class extends tr{constructor(){super(),this.geometry=new jg;}destroy(){this.geometry.destroy();}},Es=class{constructor(t){this._renderer=t;}addRenderable(t,e){let r=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,r),this._renderer.renderPipes.batch.addToBatch(r,e);}updateRenderable(t){let e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e);}validateRenderable(t){let e=this._getGpuSprite(t);return !e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.geometry.update(t),e.setTexture(t._texture);}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){let e=t._gpuData[this._renderer.uid]=new Th,r=e;return r.renderable=t,r.transform=t.groupTransform,r.texture=t._texture,r.roundPixels=this._renderer._roundPixels|t._roundPixels,t.didViewUpdate||this._updateBatchableSprite(t,r),e}destroy(){this._renderer=null;}};Es.extension={type:[C.WebGLPipes,C.WebGPUPipes,C.CanvasPipes],name:"nineSliceSprite"};});var wh=g(()=>{z();qg();H.add(Es);});var As,Zg=g(()=>{z();As=class{constructor(t){this._renderer=t;}push(t,e,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:false,action:"pushFilter",container:e,filterEffect:t});}pop(t,e,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}execute(t){t.action==="pushFilter"?this._renderer.filter.push(t):t.action==="popFilter"&&this._renderer.filter.pop();}destroy(){this._renderer=null;}};As.extension={type:[C.WebGLPipes,C.WebGPUPipes,C.CanvasPipes],name:"filter"};});function Qg(i,t){t.clear();let e=t.matrix;for(let r=0;r<i.length;r++){let s=i[r];s.globalDisplayStatus<7||(t.matrix=s.worldTransform,t.addBounds(s.bounds));}return t.matrix=e,t}var Jg=g(()=>{});var Vy,Ch,Is,tx=g(()=>{z();dt();es();ss();Qe();Ft();Ur();os();ue();Jg();Gt();Vy=new Ae({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),Ch=class{constructor(){this.skip=false,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new gt,this.container=null,this.blendRequired=false,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0};}},Is=class{constructor(t){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new Vt({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new le({}),this.renderer=t;}get activeBackTexture(){return this._activeFilterData?.backTexture}push(t){let e=this.renderer,r=t.filterEffect.filters,s=this._pushFilterData();s.skip=false,s.filters=r,s.container=t.container,s.outputRenderSurface=e.renderTarget.renderSurface;let o=e.renderTarget.renderTarget.colorTexture.source,n=o.resolution,a=o.antialias;if(r.length===0){s.skip=true;return}let l=s.bounds;if(this._calculateFilterArea(t,l),this._calculateFilterBounds(s,e.renderTarget.rootViewPort,a,n,1),s.skip)return;let h=this._getPreviousFilterData(),u=this._findFilterResolution(n),c=0,f=0;h&&(c=h.bounds.minX,f=h.bounds.minY),this._calculateGlobalFrame(s,c,f,u,o.width,o.height),this._setupFilterTextures(s,l,e,h);}generateFilteredTexture({texture:t,filters:e}){let r=this._pushFilterData();this._activeFilterData=r,r.skip=false,r.filters=e;let s=t.source,o=s.resolution,n=s.antialias;if(e.length===0)return r.skip=true,t;let a=r.bounds;if(a.addRect(t.frame),this._calculateFilterBounds(r,a.rectangle,n,o,0),r.skip)return t;let l=o;this._calculateGlobalFrame(r,0,0,l,s.width,s.height),r.outputRenderSurface=Ot.getOptimalTexture(a.width,a.height,r.resolution,r.antialias),r.backTexture=U.EMPTY,r.inputTexture=t,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(r,true);let f=r.outputRenderSurface;return f.source.alphaMode="premultiplied-alpha",f}pop(){let t=this.renderer,e=this._popFilterData();e.skip||(t.globalUniforms.pop(),t.renderTarget.finishRenderPass(),this._activeFilterData=e,this._applyFiltersToTexture(e,false),e.blendRequired&&Ot.returnTexture(e.backTexture),Ot.returnTexture(e.inputTexture));}getBackTexture(t,e,r){let s=t.colorTexture.source._resolution,o=Ot.getOptimalTexture(e.width,e.height,s,false),n=e.minX,a=e.minY;r&&(n-=r.minX,a-=r.minY),n=Math.floor(n*s),a=Math.floor(a*s);let l=Math.ceil(e.width*s),h=Math.ceil(e.height*s);return this.renderer.renderTarget.copyToTexture(t,o,{x:n,y:a},{width:l,height:h},{x:0,y:0}),o}applyFilter(t,e,r,s){let o=this.renderer,n=this._activeFilterData,l=n.outputRenderSurface===r,h=o.renderTarget.rootRenderTarget.colorTexture.source._resolution,u=this._findFilterResolution(h),c=0,f=0;if(l){let d=this._findPreviousFilterOffset();c=d.x,f=d.y;}this._updateFilterUniforms(e,r,n,c,f,u,l,s),this._setupBindGroupsAndRender(t,e,o);}calculateSpriteMatrix(t,e){let r=this._activeFilterData,s=t.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),o=e.worldTransform.copyTo(L.shared),n=e.renderGroup||e.parentRenderGroup;return n&&n.cacheToLocalTransform&&o.prepend(n.cacheToLocalTransform),o.invert(),s.prepend(o),s.scale(1/e.texture.orig.width,1/e.texture.orig.height),s.translate(e.anchor.x,e.anchor.y),s}destroy(){}_setupBindGroupsAndRender(t,e,r){if(r.renderPipes.uniformBatch){let s=r.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(s,0);}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(e.source,1),this._globalFilterBindGroup.setResource(e.source.style,2),t.groups[0]=this._globalFilterBindGroup,r.encoder.draw({geometry:Vy,shader:t,state:t._state,topology:"triangle-list"}),r.type===Ie.WEBGL&&r.renderTarget.finishRenderPass();}_setupFilterTextures(t,e,r,s){if(t.backTexture=U.EMPTY,t.blendRequired){r.renderTarget.finishRenderPass();let o=r.renderTarget.getRenderTarget(t.outputRenderSurface);t.backTexture=this.getBackTexture(o,e,s?.bounds);}t.inputTexture=Ot.getOptimalTexture(e.width,e.height,t.resolution,t.antialias),r.renderTarget.bind(t.inputTexture,true),r.globalUniforms.push({offset:e});}_calculateGlobalFrame(t,e,r,s,o,n){let a=t.globalFrame;a.x=e*s,a.y=r*s,a.width=o*s,a.height=n*s;}_updateFilterUniforms(t,e,r,s,o,n,a,l){let h=this._filterGlobalUniforms.uniforms,u=h.uOutputFrame,c=h.uInputSize,f=h.uInputPixel,d=h.uInputClamp,x=h.uGlobalFrame,b=h.uOutputTexture;a?(u[0]=r.bounds.minX-s,u[1]=r.bounds.minY-o):(u[0]=0,u[1]=0),u[2]=t.frame.width,u[3]=t.frame.height,c[0]=t.source.width,c[1]=t.source.height,c[2]=1/c[0],c[3]=1/c[1],f[0]=t.source.pixelWidth,f[1]=t.source.pixelHeight,f[2]=1/f[0],f[3]=1/f[1],d[0]=.5*f[2],d[1]=.5*f[3],d[2]=t.frame.width*c[2]-.5*f[2],d[3]=t.frame.height*c[3]-.5*f[3];let m=this.renderer.renderTarget.rootRenderTarget.colorTexture;x[0]=s*n,x[1]=o*n,x[2]=m.source.width*n,x[3]=m.source.height*n,e instanceof U&&(e.source.resource=null);let p=this.renderer.renderTarget.getRenderTarget(e);this.renderer.renderTarget.bind(e,!!l),e instanceof U?(b[0]=e.frame.width,b[1]=e.frame.height):(b[0]=p.width,b[1]=p.height),b[2]=p.isRoot?-1:1,this._filterGlobalUniforms.update();}_findFilterResolution(t){let e=this._filterStackIndex-1;for(;e>0&&this._filterStack[e].skip;)--e;return e>0&&this._filterStack[e].inputTexture?this._filterStack[e].inputTexture.source._resolution:t}_findPreviousFilterOffset(){let t=0,e=0,r=this._filterStackIndex;for(;r>0;){r--;let s=this._filterStack[r];if(!s.skip){t=s.bounds.minX,e=s.bounds.minY;break}}return {x:t,y:e}}_calculateFilterArea(t,e){if(t.renderables?Qg(t.renderables,e):t.filterEffect.filterArea?(e.clear(),e.addRect(t.filterEffect.filterArea),e.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(true,e),t.container){let s=(t.container.renderGroup||t.container.parentRenderGroup).cacheToLocalTransform;s&&e.applyMatrix(s);}}_applyFiltersToTexture(t,e){let r=t.inputTexture,s=t.bounds,o=t.filters;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(t.backTexture.source,3),o.length===1)o[0].apply(this,r,t.outputRenderSurface,e);else {let n=t.inputTexture,a=Ot.getOptimalTexture(s.width,s.height,n.source._resolution,false),l=a,h=0;for(h=0;h<o.length-1;++h){o[h].apply(this,n,l,true);let c=n;n=l,l=c;}o[h].apply(this,n,t.outputRenderSurface,e),Ot.returnTexture(a);}}_calculateFilterBounds(t,e,r,s,o){let n=this.renderer,a=t.bounds,l=t.filters,h=1/0,u=0,c=true,f=false,d=false,x=true;for(let b=0;b<l.length;b++){let m=l[b];if(h=Math.min(h,m.resolution==="inherit"?s:m.resolution),u+=m.padding,m.antialias==="off"?c=false:m.antialias==="inherit"&&c&&(c=r),m.clipToViewport||(x=false),!!!(m.compatibleRenderers&n.type)){d=false;break}if(m.blendRequired&&!(n.backBuffer?.useBackBuffer??true)){K("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),d=false;break}d=m.enabled||d,f||(f=m.blendRequired);}if(!d){t.skip=true;return}if(x&&a.fitBounds(0,e.width/s,0,e.height/s),a.scale(h).ceil().scale(1/h).pad((u|0)*o),!a.isPositive){t.skip=true;return}t.antialias=c,t.resolution=h,t.blendRequired=f;}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let t,e=this._filterStackIndex-1;for(;e>1&&(e--,t=this._filterStack[e],!!t.skip););return t}_pushFilterData(){let t=this._filterStack[this._filterStackIndex];return t||(t=this._filterStack[this._filterStackIndex]=new Ch),this._filterStackIndex++,t}};Is.extension={type:[C.WebGLSystem,C.WebGPUSystem],name:"filter"};});var Ph=g(()=>{z();Zg();tx();H.add(Is);H.add(As);});var Wy={};var ex=g(()=>{Ic();wa();Gc();Dc();vo();Mo();Fl();Bl();Dl();lh();mh();_h();Sh();wh();Ph();});var Hy={};var ix=g(()=>{wa();vo();Mo();Fl();Bl();Dl();lh();mh();_h();Sh();wh();Ph();});var xx=Hs((On,gx)=>{(function(i,t){typeof On=="object"?gx.exports=On=t():typeof define=="function"&&define.amd?define([],t):i.CryptoJS=t();})(On,function(){var i=i||(function(t,e){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<"u"&&global.crypto&&(r=global.crypto),!r&&typeof zn=="function")try{r=zn("crypto");}catch{}var s=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||(function(){function p(){}return function(y){var v;return p.prototype=y,v=new p,p.prototype=null,v}})(),n={},a=n.lib={},l=a.Base=(function(){return {extend:function(p){var y=o(this);return p&&y.mixIn(p),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var p=this.extend();return p.init.apply(p,arguments),p},init:function(){},mixIn:function(p){for(var y in p)p.hasOwnProperty(y)&&(this[y]=p[y]);p.hasOwnProperty("toString")&&(this.toString=p.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),h=a.WordArray=l.extend({init:function(p,y){p=this.words=p||[],y!=e?this.sigBytes=y:this.sigBytes=p.length*4;},toString:function(p){return (p||c).stringify(this)},concat:function(p){var y=this.words,v=p.words,S=this.sigBytes,P=p.sigBytes;if(this.clamp(),S%4)for(var T=0;T<P;T++){var w=v[T>>>2]>>>24-T%4*8&255;y[S+T>>>2]|=w<<24-(S+T)%4*8;}else for(var B=0;B<P;B+=4)y[S+B>>>2]=v[B>>>2];return this.sigBytes+=P,this},clamp:function(){var p=this.words,y=this.sigBytes;p[y>>>2]&=4294967295<<32-y%4*8,p.length=t.ceil(y/4);},clone:function(){var p=l.clone.call(this);return p.words=this.words.slice(0),p},random:function(p){for(var y=[],v=0;v<p;v+=4)y.push(s());return new h.init(y,p)}}),u=n.enc={},c=u.Hex={stringify:function(p){for(var y=p.words,v=p.sigBytes,S=[],P=0;P<v;P++){var T=y[P>>>2]>>>24-P%4*8&255;S.push((T>>>4).toString(16)),S.push((T&15).toString(16));}return S.join("")},parse:function(p){for(var y=p.length,v=[],S=0;S<y;S+=2)v[S>>>3]|=parseInt(p.substr(S,2),16)<<24-S%8*4;return new h.init(v,y/2)}},f=u.Latin1={stringify:function(p){for(var y=p.words,v=p.sigBytes,S=[],P=0;P<v;P++){var T=y[P>>>2]>>>24-P%4*8&255;S.push(String.fromCharCode(T));}return S.join("")},parse:function(p){for(var y=p.length,v=[],S=0;S<y;S++)v[S>>>2]|=(p.charCodeAt(S)&255)<<24-S%4*8;return new h.init(v,y)}},d=u.Utf8={stringify:function(p){try{return decodeURIComponent(escape(f.stringify(p)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(p){return f.parse(unescape(encodeURIComponent(p)))}},x=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new h.init,this._nDataBytes=0;},_append:function(p){typeof p=="string"&&(p=d.parse(p)),this._data.concat(p),this._nDataBytes+=p.sigBytes;},_process:function(p){var y,v=this._data,S=v.words,P=v.sigBytes,T=this.blockSize,w=T*4,B=P/w;p?B=t.ceil(B):B=t.max((B|0)-this._minBufferSize,0);var M=B*T,I=t.min(M*4,P);if(M){for(var R=0;R<M;R+=T)this._doProcessBlock(S,R);y=S.splice(0,M),v.sigBytes-=I;}return new h.init(y,I)},clone:function(){var p=l.clone.call(this);return p._data=this._data.clone(),p},_minBufferSize:0});a.Hasher=x.extend({cfg:l.extend(),init:function(p){this.cfg=this.cfg.extend(p),this.reset();},reset:function(){x.reset.call(this),this._doReset();},update:function(p){return this._append(p),this._process(),this},finalize:function(p){p&&this._append(p);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(p){return function(y,v){return new p.init(v).finalize(y)}},_createHmacHelper:function(p){return function(y,v){return new m.HMAC.init(p,v).finalize(y)}}});var m=n.algo={};return n})(Math);return i});});var yx=Hs((Dn,_x)=>{(function(i,t){typeof Dn=="object"?_x.exports=Dn=t(xx()):typeof define=="function"&&define.amd?define(["./core"],t):t(i.CryptoJS);})(Dn,function(i){return (function(){var t=i,e=t.lib,r=e.WordArray,s=e.Hasher,o=t.algo,n=[],a=o.SHA1=s.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(l,h){for(var u=this._hash.words,c=u[0],f=u[1],d=u[2],x=u[3],b=u[4],m=0;m<80;m++){if(m<16)n[m]=l[h+m]|0;else {var p=n[m-3]^n[m-8]^n[m-14]^n[m-16];n[m]=p<<1|p>>>31;}var y=(c<<5|c>>>27)+b+n[m];m<20?y+=(f&d|~f&x)+1518500249:m<40?y+=(f^d^x)+1859775393:m<60?y+=(f&d|f&x|d&x)-1894007588:y+=(f^d^x)-899497514,b=x,x=d,d=f<<30|f>>>2,f=c,c=y;}u[0]=u[0]+c|0,u[1]=u[1]+f|0,u[2]=u[2]+d|0,u[3]=u[3]+x|0,u[4]=u[4]+b|0;},_doFinalize:function(){var l=this._data,h=l.words,u=this._nDataBytes*8,c=l.sigBytes*8;return h[c>>>5]|=128<<24-c%32,h[(c+64>>>9<<4)+14]=Math.floor(u/4294967296),h[(c+64>>>9<<4)+15]=u,l.sigBytes=h.length*4,this._process(),this._hash},clone:function(){var l=s.clone.call(this);return l._hash=this._hash.clone(),l}});t.SHA1=s._createHelper(a),t.HmacSHA1=s._createHmacHelper(a);})(),i.SHA1});});var Se={};Rx(Se,{DistortionFilter:()=>Xs,EqualizerFilter:()=>oe,Filter:()=>wt,MonoFilter:()=>$s,ReverbFilter:()=>js,StereoFilter:()=>Ks,StreamFilter:()=>qs,TelephoneFilter:()=>Zs});var Wh;function Hh(i){return Wh=i,i}function ot(){return Wh}var wt=class{constructor(t,e){this.init(t,e);}init(t,e){this.destination=t,this.source=e||t;}connect(t){this.source?.connect(t);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var Xs=class extends wt{constructor(t=0){let e;if(!ot().useLegacy){let{audioContext:r}=ot().context;e=r.createWaveShaper();}super(e),this._distortion=e,this.amount=t;}set amount(t){if(this._amount=t,ot().useLegacy)return;let e=t*1e3,r=44100,s=new Float32Array(r),o=Math.PI/180,n=0,a;for(;n<r;++n)a=n*2/r-1,s[n]=(3+e)*a*20*o/(Math.PI+e*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var bt=class{static setParamValue(t,e){if(t.setValueAtTime){let r=ot().context;t.setValueAtTime(e,r.audioContext.currentTime);}else t.value=e;return e}};var nt=class extends wt{constructor(i=0,t=0,e=0,r=0,s=0,o=0,n=0,a=0,l=0,h=0){let u=[],c=[{f:nt.F32,type:"lowshelf",gain:i},{f:nt.F64,type:"peaking",gain:t},{f:nt.F125,type:"peaking",gain:e},{f:nt.F250,type:"peaking",gain:r},{f:nt.F500,type:"peaking",gain:s},{f:nt.F1K,type:"peaking",gain:o},{f:nt.F2K,type:"peaking",gain:n},{f:nt.F4K,type:"peaking",gain:a},{f:nt.F8K,type:"peaking",gain:l},{f:nt.F16K,type:"highshelf",gain:h}];ot().useLegacy||(u=c.map(f=>{let d=ot().context.audioContext.createBiquadFilter();return d.type=f.type,bt.setParamValue(d.Q,1),d.frequency.value=f.f,bt.setParamValue(d.gain,f.gain),d})),super(u[0],u[u.length-1]),this.bands=u,this.bandsMap={};for(let f=0;f<this.bands.length;f++){let d=this.bands[f];f>0&&this.bands[f-1].connect(d),this.bandsMap[d.frequency.value]=d;}}setGain(i,t=0){if(!this.bandsMap[i])throw new Error(`No band found for frequency ${i}`);bt.setParamValue(this.bandsMap[i].gain,t);}getGain(i){if(!this.bandsMap[i])throw new Error(`No band found for frequency ${i}`);return this.bandsMap[i].gain.value}set f32(i){this.setGain(nt.F32,i);}get f32(){return this.getGain(nt.F32)}set f64(i){this.setGain(nt.F64,i);}get f64(){return this.getGain(nt.F64)}set f125(i){this.setGain(nt.F125,i);}get f125(){return this.getGain(nt.F125)}set f250(i){this.setGain(nt.F250,i);}get f250(){return this.getGain(nt.F250)}set f500(i){this.setGain(nt.F500,i);}get f500(){return this.getGain(nt.F500)}set f1k(i){this.setGain(nt.F1K,i);}get f1k(){return this.getGain(nt.F1K)}set f2k(i){this.setGain(nt.F2K,i);}get f2k(){return this.getGain(nt.F2K)}set f4k(i){this.setGain(nt.F4K,i);}get f4k(){return this.getGain(nt.F4K)}set f8k(i){this.setGain(nt.F8K,i);}get f8k(){return this.getGain(nt.F8K)}set f16k(i){this.setGain(nt.F16K,i);}get f16k(){return this.getGain(nt.F16K)}reset(){this.bands.forEach(i=>{bt.setParamValue(i.gain,0);});}destroy(){this.bands.forEach(i=>{i.disconnect();}),this.bands=null,this.bandsMap=null;}},oe=nt;oe.F32=32;oe.F64=64;oe.F125=125;oe.F250=250;oe.F500=500;oe.F1K=1e3;oe.F2K=2e3;oe.F4K=4e3;oe.F8K=8e3;oe.F16K=16e3;var $s=class extends wt{constructor(){let t,e;if(!ot().useLegacy){let{audioContext:r}=ot().context;e=r.createChannelSplitter(),t=r.createChannelMerger(),t.connect(e);}super(t,e),this._merger=t;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var js=class extends wt{constructor(t=3,e=2,r=false){super(null),this._seconds=this._clamp(t,1,50),this._decay=this._clamp(e,0,100),this._reverse=r,this._rebuild();}_clamp(t,e,r){return Math.min(r,Math.max(e,t))}get seconds(){return this._seconds}set seconds(t){this._seconds=this._clamp(t,1,50),this._rebuild();}get decay(){return this._decay}set decay(t){this._decay=this._clamp(t,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(t){this._reverse=t,this._rebuild();}_rebuild(){if(ot().useLegacy)return;let{audioContext:t}=ot().context,e=t.sampleRate,r=e*this._seconds,s=t.createBuffer(2,r,e),o=s.getChannelData(0),n=s.getChannelData(1),a;for(let h=0;h<r;h++)a=this._reverse?r-h:h,o[h]=(Math.random()*2-1)*Math.pow(1-a/r,this._decay),n[h]=(Math.random()*2-1)*Math.pow(1-a/r,this._decay);let l=t.createConvolver();l.buffer=s,this.init(l);}};var Ks=class extends wt{constructor(t=0){let e,r,s;if(!ot().useLegacy){let{audioContext:o}=ot().context;o.createStereoPanner?(e=o.createStereoPanner(),s=e):(r=o.createPanner(),r.panningModel="equalpower",s=r);}super(s),this._stereo=e,this._panner=r,this.pan=t;}set pan(t){this._pan=t,this._stereo?bt.setParamValue(this._stereo.pan,t):this._panner&&this._panner.setPosition(t,0,1-Math.abs(t));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var qs=class extends wt{constructor(){let t,e;if(!ot().useLegacy){let{audioContext:r}=ot().context;t=r.createMediaStreamDestination(),e=r.createMediaStreamSource(t.stream);}super(t,e),this._stream=t?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var Zs=class extends wt{constructor(){let t,e;if(!ot().useLegacy){let{audioContext:r}=ot().context,s=r.createBiquadFilter(),o=r.createBiquadFilter(),n=r.createBiquadFilter(),a=r.createBiquadFilter();s.type="lowpass",bt.setParamValue(s.frequency,2e3),o.type="lowpass",bt.setParamValue(o.frequency,2e3),n.type="highpass",bt.setParamValue(n.frequency,500),a.type="highpass",bt.setParamValue(a.frequency,500),s.connect(o),o.connect(n),n.connect(a),t=s,e=a;}super(t,e);}};z();var rx={extension:{type:C.Environment,name:"browser",priority:-1},test:()=>true,load:async()=>{await Promise.resolve().then(()=>(ex(),Wy));}};z();var sx={extension:{type:C.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>(ix(),Hy));}};z();z();Mo();vo();Fa();Jt();Ha();Nr();Yt();bo();H.add(rx,sx);var Rs=class extends tt{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(t){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};var Yy=0,Mh=class extends tt{constructor(i){super(),this.id=Yy++,this.init(i);}set(i,t){if(this[i]===void 0)throw new Error(`Property with name ${i} does not exist.`);switch(i){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "paused":this.paused=t;break;case "loop":this.loop=t;break;case "muted":this.muted=t;break}return this}get progress(){let{currentTime:i}=this._source;return i/this._duration}get paused(){return this._paused}set paused(i){this._paused=i,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(i){this._playing=false,this._duration=i.source.duration;let t=this._source=i.source.cloneNode(false);t.src=i.parent.url,t.onplay=this._onPlay.bind(this),t.onpause=this._onPause.bind(this),i.context.on("refresh",this.refresh,this),i.context.on("refreshPaused",this.refreshPaused,this),this._media=i;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(i){this._speed=i,this.refresh();}get volume(){return this._volume}set volume(i){this._volume=i,this.refresh();}get loop(){return this._loop}set loop(i){this._loop=i,this.refresh();}get muted(){return this._muted}set muted(i){this._muted=i,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(i){console.warn("HTML Audio does not support filters");}refresh(){let i=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let e=i.volume*(i.muted?0:1),r=t.volume*(t.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*e*r,this._source.playbackRate=this._speed*i.speed*t.speed;}refreshPaused(){let i=this._media.context,t=this._media.parent,e=this._paused||t.paused||i.paused;e!==this._pausedReal&&(this._pausedReal=e,e?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",e));}play(i){let{start:t,end:e,speed:r,loop:s,volume:o,muted:n}=i;e&&console.assert(e>t,"End time is before start time"),this._speed=r,this._volume=o,this._loop=!!s,this._muted=n,this.refresh(),this.loop&&e!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=t,this._end=e||this._duration,this._start=Math.max(0,this._start-Mh.PADDING),this._end=Math.min(this._end+Mh.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=t,this._source.onloadedmetadata=null,this.emit("progress",t/this._duration,this._duration),_t.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){_t.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){_t.shared.remove(this._onUpdate,this),this.removeAllListeners();let i=this._source;i&&(i.onended=null,i.onplay=null,i.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},In=Mh;In.PADDING=.1;var Ls=class extends tt{init(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url);}create(){return new In(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(t){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(t){let e=this._source,r=this.parent;if(e.readyState===4){r.isLoaded=true;let l=r.autoPlayStart();t&&setTimeout(()=>{t(null,r,l);},0);return}if(!r.url){t(new Error("sound.url or sound.source must be set"));return}e.src=r.url;let s=()=>{a(),r.isLoaded=true;let l=r.autoPlayStart();t&&t(null,r,l);},o=()=>{a(),t&&t(new Error("Sound loading has been aborted"));},n=()=>{a();let l=`Failed to load audio element (code: ${e.error.code})`;t?t(new Error(l)):console.error(l);},a=()=>{e.removeEventListener("canplaythrough",s),e.removeEventListener("load",s),e.removeEventListener("abort",o),e.removeEventListener("error",n);};e.addEventListener("canplaythrough",s,false),e.addEventListener("load",s,false),e.addEventListener("abort",o,false),e.addEventListener("error",n,false),e.load();}};var Fs=class{constructor(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var Er=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],Eh=["audio/mpeg","audio/ogg"],Ar={};function ox(i){let t={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},e=document.createElement("audio"),r={},s=/^no$/;Er.forEach(o=>{let n=e.canPlayType(`audio/${o}`).replace(s,""),a=t[o]?e.canPlayType(t[o]).replace(s,""):"";r[o]=!!n||!!a;}),Object.assign(Ar,r);}ox();var $y=0,Bs=class extends tt{constructor(t){super(),this.id=$y++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(t);}set(t,e){if(this[t]===void 0)throw new Error(`Property with name ${t} does not exist.`);switch(t){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "muted":this.muted=e;break;case "loop":this.loop=e;break;case "paused":this.paused=e;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(t){this._speed=t,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(t){this._volume=t,this.refresh();}get muted(){return this._muted}set muted(t){this._muted=t,this.refresh();}get loop(){return this._loop}set loop(t){this._loop=t,this.refresh();}get filters(){return this._filters}set filters(t){this._filters&&(this._filters?.filter(e=>e).forEach(e=>e.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=t?.length?t.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let t=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let r=t.volume*(t.muted?0:1),s=e.volume*(e.muted?0:1),o=this._volume*(this._muted?0:1);bt.setParamValue(this._gain.gain,o*s*r),bt.setParamValue(this._source.playbackRate,this._speed*e.speed*t.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let t=this._source;this._filters.forEach(e=>{t.connect(e.destination),t=e;}),t.connect(this._gain);}}refreshPaused(){let t=this._media.context,e=this._media.parent,r=this._paused||e.paused||t.paused;r!==this._pausedReal&&(this._pausedReal=r,r?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",r));}play(t){let{start:e,end:r,speed:s,loop:o,volume:n,muted:a,filters:l}=t;r&&console.assert(r>e,"End time is before start time"),this._paused=false;let{source:h,gain:u}=this._media.nodes.cloneBufferSource();this._source=h,this._gain=u,this._speed=s,this._volume=n,this._loop=!!o,this._muted=a,this._filters=l,this.refresh();let c=this._source.buffer.duration;this._duration=c,this._end=r,this._lastUpdate=this._now(),this._elapsed=e,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=r,this._source.loopStart=e,this._source.start(0,e)):r?this._source.start(0,e,r-e):this._source.start(0,e),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(t){_t.shared.remove(this._updateListener,this),t&&_t.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(t){this._paused=t,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(t=>t.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(t=false){if(this._source){let e=this._now(),r=e-this._lastUpdate;if(r>0||t){let s=this._source.playbackRate.value;this._elapsed+=r*s,this._lastUpdate=e;let o=this._duration,n;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;n=(this._source.loopStart+this._elapsed%a)/o;}else n=this._elapsed%o/o;this._progress=n,this.emit("progress",this._progress,o);}}}init(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var Ir=class{constructor(t,e){this._output=e,this._input=t;}get destination(){return this._input}get filters(){return this._filters}set filters(t){if(this._filters&&(this._filters.forEach(e=>{e&&e.disconnect();}),this._filters=null,this._input.connect(this._output)),t&&t.length){this._filters=t.slice(0),this._input.disconnect();let e=null;t.forEach(r=>{e===null?this._input.connect(r.destination):e.connect(r.destination),e=r;}),e.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var nx=class extends Ir{constructor(i){let t=i.audioContext,e=t.createBufferSource(),r=t.createGain(),s=t.createAnalyser();e.connect(s),s.connect(r),r.connect(i.destination),super(s,r),this.context=i,this.bufferSource=e,this.gain=r,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(nx.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let i=this.bufferSource,t=this.context.audioContext.createBufferSource();t.buffer=i.buffer,bt.setParamValue(t.playbackRate,i.playbackRate.value),t.loop=i.loop;let e=this.context.audioContext.createGain();return t.connect(e),e.connect(this.destination),{source:t,gain:e}}get bufferSize(){return this.script.bufferSize}},Rn=nx;Rn.BUFFER_SIZE=0;var Rr=class{init(t){this.parent=t,this._nodes=new Rn(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t);}this._source=null,this.source=null;}create(){return new Bs(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(t){this._nodes.filters=t;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(t){this._source.buffer=t;}get nodes(){return this._nodes}load(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t?t(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(t){let e=this.parent.url,r=await ut.get().fetch(e);this._decode(await r.arrayBuffer(),t);}_decode(t,e){let r=(s,o)=>{if(s)e&&e(s);else {this.parent.isLoaded=true,this.buffer=o;let n=this.parent.autoPlayStart();e&&e(null,this.parent,n);}};t instanceof AudioBuffer?r(null,t):this.parent.context.decode(t,r);}};var gi=class{static from(i){let t={};typeof i=="string"?t.url=i:i instanceof ArrayBuffer||i instanceof AudioBuffer||i instanceof HTMLAudioElement?t.source=i:Array.isArray(i)?t.url=i:t=i,t={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...t},Object.freeze(t);let e=ot().useLegacy?new Ls:new Rr;return new gi(e,t)}constructor(i,t){this.media=i,this.options=t,this._instances=[],this._sprites={},this.media.init(this);let e=t.complete;this._autoPlayOptions=e?{complete:e}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=t.autoPlay,this.singleInstance=t.singleInstance,this.preload=t.preload||this.autoPlay,this.url=Array.isArray(t.url)?this.preferUrl(t.url):t.url,this.speed=t.speed,this.volume=t.volume,this.loop=t.loop,t.sprites&&this.addSprites(t.sprites),this.preload&&this._preload(t.loaded);}preferUrl(i){let[t]=i.map(e=>({url:e,ext:$t.extname(e).slice(1)})).filter(({ext:e})=>Ar[e]).sort((e,r)=>Er.indexOf(e.ext)-Er.indexOf(r.ext));if(!t)throw new Error("No supported file type found");return t.url}get context(){return ot().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(i){this._paused=i,this.refreshPaused();}get speed(){return this._speed}set speed(i){this._speed=i,this.refresh();}get filters(){return this.media.filters}set filters(i){this.media.filters=i;}addSprites(i,t){if(typeof i=="object"){let r={};for(let s in i)r[s]=this.addSprites(s,i[s]);return r}console.assert(!this._sprites[i],`Alias ${i} is already taken`);let e=new Fs(this,t);return this._sprites[i]=e,e}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(i){if(i){let t=this._sprites[i];t!==void 0&&(t.destroy(),delete this._sprites[i]);}else for(let t in this._sprites)this.removeSprites(t);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let i=this._instances.length-1;i>=0;i--)this._instances[i].stop();return this}play(i,t){let e;if(typeof i=="string"?e={sprite:i,loop:this.loop,complete:t}:typeof i=="function"?(e={},e.complete=i):e=i,e={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...e||{}},e.sprite){let s=e.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let o=this._sprites[s];e.start=o.start+(e.start||0),e.end=o.end,e.speed=o.speed||1,e.loop=o.loop||e.loop,delete e.sprite;}if(e.offset&&(e.start=e.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(e));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=e,new Promise((s,o)=>{this._preload((n,a,l)=>{this._preloadQueue.forEach(h=>h()),this._preloadQueue=null,n?o(n):(e.loaded&&e.loaded(n,a,l),s(l));});}));(this.singleInstance||e.singleInstance)&&this._removeInstances();let r=this._createInstance();return this._instances.push(r),this.isPlaying=true,r.once("end",()=>{e.complete&&e.complete(this),this._onComplete(r);}),r.once("stop",()=>{this._onComplete(r);}),r.play(e),r}refresh(){let i=this._instances.length;for(let t=0;t<i;t++)this._instances[t].refresh();}refreshPaused(){let i=this._instances.length;for(let t=0;t<i;t++)this._instances[t].refreshPaused();}get volume(){return this._volume}set volume(i){this._volume=i,this.refresh();}get muted(){return this._muted}set muted(i){this._muted=i,this.refresh();}get loop(){return this._loop}set loop(i){this._loop=i,this.refresh();}_preload(i){this.media.load(i);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let i;return this.autoPlay&&(i=this.play(this._autoPlayOptions)),i}_removeInstances(){for(let i=this._instances.length-1;i>=0;i--)this._poolInstance(this._instances[i]);this._instances.length=0;}_onComplete(i){if(this._instances){let t=this._instances.indexOf(i);t>-1&&this._instances.splice(t,1),this.isPlaying=this._instances.length>0;}this._poolInstance(i);}_createInstance(){if(gi._pool.length>0){let i=gi._pool.pop();return i.init(this.media),i}return this.media.create()}_poolInstance(i){i.destroy(),gi._pool.indexOf(i)<0&&gi._pool.push(i);}},rr=gi;rr._pool=[];var xi=class i extends Ir{constructor(){let t=window,e=new i.AudioContext,r=e.createDynamicsCompressor(),s=e.createAnalyser();s.connect(r),r.connect(e.destination),super(s,r),this.autoPause=true,this._ctx=e,this._offlineCtx=new i.OfflineAudioContext(1,2,t.OfflineAudioContext?Math.max(8e3,Math.min(96e3,e.sampleRate)):44100),this.compressor=r,this.analyser=s,this.events=new tt,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=e.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let t=this._ctx.state;(t==="suspended"||t==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),t.context.state==="suspended"&&t.context.resume();}static get AudioContext(){let t=window;return t.AudioContext||t.webkitAudioContext||null}static get OfflineAudioContext(){let t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null}destroy(){super.destroy();let t=this._ctx;typeof t.close<"u"&&t.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(t){t&&this._ctx.state==="running"?this._ctx.suspend():!t&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=t;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(t,e){let r=o=>{e(new Error(o?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(t,o=>{e(null,o);},r);s&&s.catch(r);}};var Ln=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new xi),this._htmlAudioContext=new Rs,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(t){this.useLegacy||(this._context.filters=t);}get supported(){return xi.AudioContext!==null}add(t,e){if(typeof t=="object"){let o={};for(let n in t){let a=this._getOptions(t[n],e);o[n]=this.add(n,a);}return o}if(console.assert(!this._sounds[t],`Sound with alias ${t} already exists.`),e instanceof rr)return this._sounds[t]=e,e;let r=this._getOptions(e),s=rr.from(r);return this._sounds[t]=s,s}_getOptions(t,e){let r;return typeof t=="string"?r={url:t}:Array.isArray(t)?r={url:t}:t instanceof ArrayBuffer||t instanceof AudioBuffer||t instanceof HTMLAudioElement?r={source:t}:r=t,r={...r,...e||{}},r}get useLegacy(){return this._useLegacy}set useLegacy(t){this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(t){this._webAudioContext.autoPause=!t;}remove(t){return this.exists(t,true),this._sounds[t].destroy(),delete this._sounds[t],this}get volumeAll(){return this._context.volume}set volumeAll(t){this._context.volume=t,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(t){this._context.speed=t,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this}stopAll(){for(let t in this._sounds)this._sounds[t].stop();return this}exists(t,e=false){let r=!!this._sounds[t];return e&&console.assert(r,`No sound matching alias '${t}'.`),r}isPlaying(){for(let t in this._sounds)if(this._sounds[t].isPlaying)return true;return false}find(t){return this.exists(t,true),this._sounds[t]}play(t,e){return this.find(t).play(e)}stop(t){return this.find(t).stop()}pause(t){return this.find(t).pause()}resume(t){return this.find(t).resume()}volume(t,e){let r=this.find(t);return e!==void 0&&(r.volume=e),r.volume}speed(t,e){let r=this.find(t);return e!==void 0&&(r.speed=e),r.speed}duration(t){return this.find(t).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};var ax=i=>{let t=i.src,e=i?.alias?.[0];return (!e||i.src===e)&&(e=$t.basename(t,$t.extname(t))),e},lx={extension:C.Asset,detection:{test:async()=>true,add:async i=>[...i,...Er.filter(t=>Ar[t])],remove:async i=>i.filter(t=>i.includes(t))},loader:{name:"sound",extension:{type:[C.LoadParser],priority:Yr.High},test(i){let t=$t.extname(i).slice(1);return !!Ar[t]||Eh.some(e=>i.startsWith(`data:${e}`))},async load(i,t){let e=await new Promise((r,s)=>rr.from({...t.data,url:i,preload:true,loaded(o,n){o?s(o):r(n),t.data?.loaded?.(o,n);}}));return ot().add(ax(t),e),e},async unload(i,t){ot().remove(ax(t));}}};H.add(lx);Hh(new Ln);({DistortionFilter:Se.DistortionFilter,EqualizerFilter:Se.EqualizerFilter,MonoFilter:Se.MonoFilter,ReverbFilter:Se.ReverbFilter,StereoFilter:Se.StereoFilter,StreamFilter:Se.StreamFilter,TelephoneFilter:Se.TelephoneFilter});var Q={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var G;(s=>(s.log=(o,...n)=>console.log(`[Pixi\u2019VN] ${o}`,...n),s.warn=(o,...n)=>console.warn(`[Pixi\u2019VN] ${o}`,...n),s.error=(o,...n)=>console.error(`[Pixi\u2019VN] ${o}`,...n),s.info=(o,...n)=>console.info(`[Pixi\u2019VN] ${o}`,...n)))(G||(G={}));var Y=class Y{static init(t){Y._getStepCounter=t.getStepCounter,Y._setStepCounter=t.setStepCounter,Y._getCurrentGameStepState=t.getCurrentGameStepState,Y._restoreGameStepState=t.restoreGameStepState,Y._getOpenedLabels=t.getOpenedLabels,t.onGoNextEnd&&(Y._onGoNextEnd=t.onGoNextEnd),Y._getVariable=t.getVariable,Y._setVariable=t.setVariable,Y._removeVariable=t.removeVariable,Y._getFlag=t.getFlag,Y._setFlag=t.setFlag,t.onLabelClosing&&(Y._onLabelClosing=t.onLabelClosing),Y._addHistoryItem=t.addHistoryItem,Y._getCurrentStepsRunningNumber=t.getCurrentStepsRunningNumber,Y._getCharacter=t.getCharacter;}static get stepCounter(){return Y._getStepCounter()}static set stepCounter(t){Y._setStepCounter(t);}static get currentGameStepState(){return Y._getCurrentGameStepState()}static get restoreGameStepState(){return Y._restoreGameStepState}static get openedLabels(){return Y._getOpenedLabels()}static get onGoNextEnd(){return Y._onGoNextEnd}static get getVariable(){return Y._getVariable}static get setVariable(){return Y._setVariable}static get removeVariable(){return Y._removeVariable}static get getFlag(){return Y._getFlag}static get setFlag(){return Y._setFlag}static get onLabelClosing(){return Y._onLabelClosing}static get addHistoryItem(){return Y._addHistoryItem}static get currentStepsRunningNumber(){return Y._getCurrentStepsRunningNumber()}static get getCharacter(){return Y._getCharacter}};k(Y,"_getStepCounter",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_setStepCounter",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getCurrentGameStepState",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_restoreGameStepState",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getOpenedLabels",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_onGoNextEnd",async()=>{}),k(Y,"_getVariable",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_setVariable",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_removeVariable",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getFlag",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_setFlag",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_onLabelClosing",()=>{}),k(Y,"_addHistoryItem",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getCurrentStepsRunningNumber",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),k(Y,"_getCharacter",()=>{throw G.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),k(Y,"onEnd"),k(Y,"onError");var V=Y;function ke(i){try{if(typeof i>"u")return i;let t=JSON.stringify(i);return JSON.parse(t)}catch(t){throw G.error("Error creating exportable element",i,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var _i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,dx=new Set,Ah=typeof process=="object"&&process?process:{},fx=(i,t,e,r)=>{typeof Ah.emitWarning=="function"?Ah.emitWarning(i,t,e,r):console.error(`[${e}] ${t}: ${i}`);},kn=globalThis.AbortController,hx=globalThis.AbortSignal;if(typeof kn>"u"){hx=class{constructor(){k(this,"onabort");k(this,"_onabort",[]);k(this,"reason");k(this,"aborted",false);}addEventListener(r,s){this._onabort.push(s);}},kn=class{constructor(){k(this,"signal",new hx);t();}abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=true;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r);}}};let i=Ah.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{i&&(i=false,fx("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t));};}var qy=i=>!dx.has(i),ir=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),px=i=>ir(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?yi:null:null,yi=class extends Array{constructor(t){super(t),this.fill(0);}},bi,Lr=class Lr{constructor(t,e){k(this,"heap");k(this,"length");if(!_(Lr,bi))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0;}static create(t){let e=px(t);if(!e)return [];W(Lr,bi,true);let r=new Lr(t,e);return W(Lr,bi,false),r}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}};bi=new WeakMap,J(Lr,bi,false);var Ih=Lr,ux,cx,fe,ee,pe,Fr,me,vi,Si,Mt,ge,Tt,pt,$,Wt,re,Dt,It,xe,Rt,_e,ye,ie,be,ar,Ht,Ti,E,Rh,Br,Xe,Gs,se,mx,kr,wi,Os,sr,or,Lh,Fn,Bn,ft,Fh,ks,nr,Bh,kh=class kh{constructor(t){J(this,E);J(this,fe);J(this,ee);J(this,pe);J(this,Fr);J(this,me);J(this,vi);J(this,Si);k(this,"ttl");k(this,"ttlResolution");k(this,"ttlAutopurge");k(this,"updateAgeOnGet");k(this,"updateAgeOnHas");k(this,"allowStale");k(this,"noDisposeOnSet");k(this,"noUpdateTTL");k(this,"maxEntrySize");k(this,"sizeCalculation");k(this,"noDeleteOnFetchRejection");k(this,"noDeleteOnStaleGet");k(this,"allowStaleOnFetchAbort");k(this,"allowStaleOnFetchRejection");k(this,"ignoreFetchAbort");J(this,Mt);J(this,ge);J(this,Tt);J(this,pt);J(this,$);J(this,Wt);J(this,re);J(this,Dt);J(this,It);J(this,xe);J(this,Rt);J(this,_e);J(this,ye);J(this,ie);J(this,be);J(this,ar);J(this,Ht);J(this,Ti);J(this,Br,()=>{});J(this,Xe,()=>{});J(this,Gs,()=>{});J(this,se,()=>false);J(this,kr,t=>{});J(this,wi,(t,e,r)=>{});J(this,Os,(t,e,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});k(this,ux,"LRUCache");let{max:e=0,ttl:r,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:n,updateAgeOnHas:a,allowStale:l,dispose:h,onInsert:u,disposeAfter:c,noDisposeOnSet:f,noUpdateTTL:d,maxSize:x=0,maxEntrySize:b=0,sizeCalculation:m,fetchMethod:p,memoMethod:y,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:T,ignoreFetchAbort:w}=t;if(e!==0&&!ir(e))throw new TypeError("max option must be a nonnegative integer");let B=e?px(e):Array;if(!B)throw new Error("invalid max value: "+e);if(W(this,fe,e),W(this,ee,x),this.maxEntrySize=b||_(this,ee),this.sizeCalculation=m,this.sizeCalculation){if(!_(this,ee)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(W(this,Si,y),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(W(this,vi,p),W(this,ar,!!p),W(this,Tt,new Map),W(this,pt,new Array(e).fill(void 0)),W(this,$,new Array(e).fill(void 0)),W(this,Wt,new B(e)),W(this,re,new B(e)),W(this,Dt,0),W(this,It,0),W(this,xe,Ih.create(e)),W(this,Mt,0),W(this,ge,0),typeof h=="function"&&W(this,pe,h),typeof u=="function"&&W(this,Fr,u),typeof c=="function"?(W(this,me,c),W(this,Rt,[])):(W(this,me,void 0),W(this,Rt,void 0)),W(this,be,!!_(this,pe)),W(this,Ti,!!_(this,Fr)),W(this,Ht,!!_(this,me)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!w,this.maxEntrySize!==0){if(_(this,ee)!==0&&!ir(_(this,ee)))throw new TypeError("maxSize must be a positive integer if specified");if(!ir(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");F(this,E,mx).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!a,this.ttlResolution=ir(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!ir(this.ttl))throw new TypeError("ttl must be a positive integer if specified");F(this,E,Rh).call(this);}if(_(this,fe)===0&&this.ttl===0&&_(this,ee)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!_(this,fe)&&!_(this,ee)){let M="LRU_CACHE_UNBOUNDED";qy(M)&&(dx.add(M),fx("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,kh));}}static unsafeExposeInternals(t){return {starts:_(t,ye),ttls:_(t,ie),sizes:_(t,_e),keyMap:_(t,Tt),keyList:_(t,pt),valList:_(t,$),next:_(t,Wt),prev:_(t,re),get head(){return _(t,Dt)},get tail(){return _(t,It)},free:_(t,xe),isBackgroundFetch:e=>{var r;return F(r=t,E,ft).call(r,e)},backgroundFetch:(e,r,s,o)=>{var n;return F(n=t,E,Bn).call(n,e,r,s,o)},moveToTail:e=>{var r;return F(r=t,E,ks).call(r,e)},indexes:e=>{var r;return F(r=t,E,sr).call(r,e)},rindexes:e=>{var r;return F(r=t,E,or).call(r,e)},isStale:e=>{var r;return _(r=t,se).call(r,e)}}}get max(){return _(this,fe)}get maxSize(){return _(this,ee)}get calculatedSize(){return _(this,ge)}get size(){return _(this,Mt)}get fetchMethod(){return _(this,vi)}get memoMethod(){return _(this,Si)}get dispose(){return _(this,pe)}get onInsert(){return _(this,Fr)}get disposeAfter(){return _(this,me)}getRemainingTTL(t){return _(this,Tt).has(t)?1/0:0}*entries(){for(let t of F(this,E,sr).call(this))_(this,$)[t]!==void 0&&_(this,pt)[t]!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield [_(this,pt)[t],_(this,$)[t]]);}*rentries(){for(let t of F(this,E,or).call(this))_(this,$)[t]!==void 0&&_(this,pt)[t]!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield [_(this,pt)[t],_(this,$)[t]]);}*keys(){for(let t of F(this,E,sr).call(this)){let e=_(this,pt)[t];e!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield e);}}*rkeys(){for(let t of F(this,E,or).call(this)){let e=_(this,pt)[t];e!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield e);}}*values(){for(let t of F(this,E,sr).call(this))_(this,$)[t]!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield _(this,$)[t]);}*rvalues(){for(let t of F(this,E,or).call(this))_(this,$)[t]!==void 0&&!F(this,E,ft).call(this,_(this,$)[t])&&(yield _(this,$)[t]);}[(cx=Symbol.iterator,ux=Symbol.toStringTag,cx)](){return this.entries()}find(t,e={}){for(let r of F(this,E,sr).call(this)){let s=_(this,$)[r],o=F(this,E,ft).call(this,s)?s.__staleWhileFetching:s;if(o!==void 0&&t(o,_(this,pt)[r],this))return this.get(_(this,pt)[r],e)}}forEach(t,e=this){for(let r of F(this,E,sr).call(this)){let s=_(this,$)[r],o=F(this,E,ft).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(e,o,_(this,pt)[r],this);}}rforEach(t,e=this){for(let r of F(this,E,or).call(this)){let s=_(this,$)[r],o=F(this,E,ft).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(e,o,_(this,pt)[r],this);}}purgeStale(){let t=false;for(let e of F(this,E,or).call(this,{allowStale:true}))_(this,se).call(this,e)&&(F(this,E,nr).call(this,_(this,pt)[e],"expire"),t=true);return t}info(t){let e=_(this,Tt).get(t);if(e===void 0)return;let r=_(this,$)[e],s=F(this,E,ft).call(this,r)?r.__staleWhileFetching:r;if(s===void 0)return;let o={value:s};if(_(this,ie)&&_(this,ye)){let n=_(this,ie)[e],a=_(this,ye)[e];if(n&&a){let l=n-(_i.now()-a);o.ttl=l,o.start=Date.now();}}return _(this,_e)&&(o.size=_(this,_e)[e]),o}dump(){let t=[];for(let e of F(this,E,sr).call(this,{allowStale:true})){let r=_(this,pt)[e],s=_(this,$)[e],o=F(this,E,ft).call(this,s)?s.__staleWhileFetching:s;if(o===void 0||r===void 0)continue;let n={value:o};if(_(this,ie)&&_(this,ye)){n.ttl=_(this,ie)[e];let a=_i.now()-_(this,ye)[e];n.start=Math.floor(Date.now()-a);}_(this,_e)&&(n.size=_(this,_e)[e]),t.unshift([r,n]);}return t}load(t){this.clear();for(let[e,r]of t){if(r.start){let s=Date.now()-r.start;r.start=_i.now()-s;}this.set(e,r.value,r);}}set(t,e,r={}){var f,d,x,b;if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:o,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=r,{noUpdateTTL:h=this.noUpdateTTL}=r,u=_(this,Os).call(this,t,e,r.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),F(this,E,nr).call(this,t,"set"),this;let c=_(this,Mt)===0?void 0:_(this,Tt).get(t);if(c===void 0)c=_(this,Mt)===0?_(this,It):_(this,xe).length!==0?_(this,xe).pop():_(this,Mt)===_(this,fe)?F(this,E,Fn).call(this,false):_(this,Mt),_(this,pt)[c]=t,_(this,$)[c]=e,_(this,Tt).set(t,c),_(this,Wt)[_(this,It)]=c,_(this,re)[c]=_(this,It),W(this,It,c),Ys(this,Mt)._++,_(this,wi).call(this,c,u,l),l&&(l.set="add"),h=false,_(this,Ti)&&((f=_(this,Fr))==null||f.call(this,e,t,"add"));else {F(this,E,ks).call(this,c);let m=_(this,$)[c];if(e!==m){if(_(this,ar)&&F(this,E,ft).call(this,m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=m;p!==void 0&&!n&&(_(this,be)&&((d=_(this,pe))==null||d.call(this,p,t,"set")),_(this,Ht)&&_(this,Rt)?.push([p,t,"set"]));}else n||(_(this,be)&&((x=_(this,pe))==null||x.call(this,m,t,"set")),_(this,Ht)&&_(this,Rt)?.push([m,t,"set"]));if(_(this,kr).call(this,c),_(this,wi).call(this,c,u,l),_(this,$)[c]=e,l){l.set="replace";let p=m&&F(this,E,ft).call(this,m)?m.__staleWhileFetching:m;p!==void 0&&(l.oldValue=p);}}else l&&(l.set="update");_(this,Ti)&&this.onInsert?.(e,t,e===m?"update":"replace");}if(s!==0&&!_(this,ie)&&F(this,E,Rh).call(this),_(this,ie)&&(h||_(this,Gs).call(this,c,s,o),l&&_(this,Xe).call(this,l,c)),!n&&_(this,Ht)&&_(this,Rt)){let m=_(this,Rt),p;for(;p=m?.shift();)(b=_(this,me))==null||b.call(this,...p);}return this}pop(){var t;try{for(;_(this,Mt);){let e=_(this,$)[_(this,Dt)];if(F(this,E,Fn).call(this,!0),F(this,E,ft).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(_(this,Ht)&&_(this,Rt)){let e=_(this,Rt),r;for(;r=e?.shift();)(t=_(this,me))==null||t.call(this,...r);}}}has(t,e={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=e,o=_(this,Tt).get(t);if(o!==void 0){let n=_(this,$)[o];if(F(this,E,ft).call(this,n)&&n.__staleWhileFetching===void 0)return false;if(_(this,se).call(this,o))s&&(s.has="stale",_(this,Xe).call(this,s,o));else return r&&_(this,Br).call(this,o),s&&(s.has="hit",_(this,Xe).call(this,s,o)),true}else s&&(s.has="miss");return false}peek(t,e={}){let{allowStale:r=this.allowStale}=e,s=_(this,Tt).get(t);if(s===void 0||!r&&_(this,se).call(this,s))return;let o=_(this,$)[s];return F(this,E,ft).call(this,o)?o.__staleWhileFetching:o}async fetch(t,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:x=this.allowStaleOnFetchAbort,context:b,forceRefresh:m=false,status:p,signal:y}=e;if(!_(this,ar))return p&&(p.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:p});let v={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:n,noDisposeOnSet:a,size:l,sizeCalculation:h,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:x,ignoreFetchAbort:d,status:p,signal:y},S=_(this,Tt).get(t);if(S===void 0){p&&(p.fetch="miss");let P=F(this,E,Bn).call(this,t,S,v,b);return P.__returned=P}else {let P=_(this,$)[S];if(F(this,E,ft).call(this,P)){let I=r&&P.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",I&&(p.returnedStale=true)),I?P.__staleWhileFetching:P.__returned=P}let T=_(this,se).call(this,S);if(!m&&!T)return p&&(p.fetch="hit"),F(this,E,ks).call(this,S),s&&_(this,Br).call(this,S),p&&_(this,Xe).call(this,p,S),P;let w=F(this,E,Bn).call(this,t,S,v,b),M=w.__staleWhileFetching!==void 0&&r;return p&&(p.fetch=T?"stale":"refresh",M&&T&&(p.returnedStale=true)),M?w.__staleWhileFetching:w.__returned=w}}async forceFetch(t,e={}){let r=await this.fetch(t,e);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(t,e={}){let r=_(this,Si);if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:o,...n}=e,a=this.get(t,n);if(!o&&a!==void 0)return a;let l=r(t,a,{options:n,context:s});return this.set(t,l,n),l}get(t,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:n}=e,a=_(this,Tt).get(t);if(a!==void 0){let l=_(this,$)[a],h=F(this,E,ft).call(this,l);return n&&_(this,Xe).call(this,n,a),_(this,se).call(this,a)?(n&&(n.get="stale"),h?(n&&r&&l.__staleWhileFetching!==void 0&&(n.returnedStale=true),r?l.__staleWhileFetching:void 0):(o||F(this,E,nr).call(this,t,"expire"),n&&r&&(n.returnedStale=true),r?l:void 0)):(n&&(n.get="hit"),h?l.__staleWhileFetching:(F(this,E,ks).call(this,a),s&&_(this,Br).call(this,a),l))}else n&&(n.get="miss");}delete(t){return F(this,E,nr).call(this,t,"delete")}clear(){return F(this,E,Bh).call(this,"delete")}};fe=new WeakMap,ee=new WeakMap,pe=new WeakMap,Fr=new WeakMap,me=new WeakMap,vi=new WeakMap,Si=new WeakMap,Mt=new WeakMap,ge=new WeakMap,Tt=new WeakMap,pt=new WeakMap,$=new WeakMap,Wt=new WeakMap,re=new WeakMap,Dt=new WeakMap,It=new WeakMap,xe=new WeakMap,Rt=new WeakMap,_e=new WeakMap,ye=new WeakMap,ie=new WeakMap,be=new WeakMap,ar=new WeakMap,Ht=new WeakMap,Ti=new WeakMap,E=new WeakSet,Rh=function(){let t=new yi(_(this,fe)),e=new yi(_(this,fe));W(this,ie,t),W(this,ye,e),W(this,Gs,(o,n,a=_i.now())=>{if(e[o]=n!==0?a:0,t[o]=n,n!==0&&this.ttlAutopurge){let l=setTimeout(()=>{_(this,se).call(this,o)&&F(this,E,nr).call(this,_(this,pt)[o],"expire");},n+1);l.unref&&l.unref();}}),W(this,Br,o=>{e[o]=t[o]!==0?_i.now():0;}),W(this,Xe,(o,n)=>{if(t[n]){let a=t[n],l=e[n];if(!a||!l)return;o.ttl=a,o.start=l,o.now=r||s();let h=o.now-l;o.remainingTTL=a-h;}});let r=0,s=()=>{let o=_i.now();if(this.ttlResolution>0){r=o;let n=setTimeout(()=>r=0,this.ttlResolution);n.unref&&n.unref();}return o};this.getRemainingTTL=o=>{let n=_(this,Tt).get(o);if(n===void 0)return 0;let a=t[n],l=e[n];if(!a||!l)return 1/0;let h=(r||s())-l;return a-h},W(this,se,o=>{let n=e[o],a=t[o];return !!a&&!!n&&(r||s())-n>a});},Br=new WeakMap,Xe=new WeakMap,Gs=new WeakMap,se=new WeakMap,mx=function(){let t=new yi(_(this,fe));W(this,ge,0),W(this,_e,t),W(this,kr,e=>{W(this,ge,_(this,ge)-t[e]),t[e]=0;}),W(this,Os,(e,r,s,o)=>{if(F(this,E,ft).call(this,r))return 0;if(!ir(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(r,e),!ir(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),W(this,wi,(e,r,s)=>{if(t[e]=r,_(this,ee)){let o=_(this,ee)-t[e];for(;_(this,ge)>o;)F(this,E,Fn).call(this,true);}W(this,ge,_(this,ge)+t[e]),s&&(s.entrySize=r,s.totalCalculatedSize=_(this,ge));});},kr=new WeakMap,wi=new WeakMap,Os=new WeakMap,sr=function*({allowStale:t=this.allowStale}={}){if(_(this,Mt))for(let e=_(this,It);!(!F(this,E,Lh).call(this,e)||((t||!_(this,se).call(this,e))&&(yield e),e===_(this,Dt)));)e=_(this,re)[e];},or=function*({allowStale:t=this.allowStale}={}){if(_(this,Mt))for(let e=_(this,Dt);!(!F(this,E,Lh).call(this,e)||((t||!_(this,se).call(this,e))&&(yield e),e===_(this,It)));)e=_(this,Wt)[e];},Lh=function(t){return t!==void 0&&_(this,Tt).get(_(this,pt)[t])===t},Fn=function(t){var o;let e=_(this,Dt),r=_(this,pt)[e],s=_(this,$)[e];return _(this,ar)&&F(this,E,ft).call(this,s)?s.__abortController.abort(new Error("evicted")):(_(this,be)||_(this,Ht))&&(_(this,be)&&((o=_(this,pe))==null||o.call(this,s,r,"evict")),_(this,Ht)&&_(this,Rt)?.push([s,r,"evict"])),_(this,kr).call(this,e),t&&(_(this,pt)[e]=void 0,_(this,$)[e]=void 0,_(this,xe).push(e)),_(this,Mt)===1?(W(this,Dt,W(this,It,0)),_(this,xe).length=0):W(this,Dt,_(this,Wt)[e]),_(this,Tt).delete(r),Ys(this,Mt)._--,e},Bn=function(t,e,r,s){let o=e===void 0?void 0:_(this,$)[e];if(F(this,E,ft).call(this,o))return o;let n=new kn,{signal:a}=r;a?.addEventListener("abort",()=>n.abort(a.reason),{signal:n.signal});let l={signal:n.signal,options:r,context:s},h=(b,m=false)=>{let{aborted:p}=n.signal,y=r.ignoreFetchAbort&&b!==void 0;if(r.status&&(p&&!m?(r.status.fetchAborted=true,r.status.fetchError=n.signal.reason,y&&(r.status.fetchAbortIgnored=true)):r.status.fetchResolved=true),p&&!y&&!m)return c(n.signal.reason);let v=d;return _(this,$)[e]===d&&(b===void 0?v.__staleWhileFetching?_(this,$)[e]=v.__staleWhileFetching:F(this,E,nr).call(this,t,"fetch"):(r.status&&(r.status.fetchUpdated=true),this.set(t,b,l.options))),b},u=b=>(r.status&&(r.status.fetchRejected=true,r.status.fetchError=b),c(b)),c=b=>{let{aborted:m}=n.signal,p=m&&r.allowStaleOnFetchAbort,y=p||r.allowStaleOnFetchRejection,v=y||r.noDeleteOnFetchRejection,S=d;if(_(this,$)[e]===d&&(!v||S.__staleWhileFetching===void 0?F(this,E,nr).call(this,t,"fetch"):p||(_(this,$)[e]=S.__staleWhileFetching)),y)return r.status&&S.__staleWhileFetching!==void 0&&(r.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw b},f=(b,m)=>{var y;let p=(y=_(this,vi))==null?void 0:y.call(this,t,o,l);p&&p instanceof Promise&&p.then(v=>b(v===void 0?void 0:v),m),n.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(b(void 0),r.allowStaleOnFetchAbort&&(b=v=>h(v,true)));});};r.status&&(r.status.fetchDispatched=true);let d=new Promise(f).then(h,u),x=Object.assign(d,{__abortController:n,__staleWhileFetching:o,__returned:void 0});return e===void 0?(this.set(t,x,{...l.options,status:void 0}),e=_(this,Tt).get(t)):_(this,$)[e]=x,x},ft=function(t){if(!_(this,ar))return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof kn},Fh=function(t,e){_(this,re)[e]=t,_(this,Wt)[t]=e;},ks=function(t){t!==_(this,It)&&(t===_(this,Dt)?W(this,Dt,_(this,Wt)[t]):F(this,E,Fh).call(this,_(this,re)[t],_(this,Wt)[t]),F(this,E,Fh).call(this,_(this,It),t),W(this,It,t));},nr=function(t,e){var s,o;let r=false;if(_(this,Mt)!==0){let n=_(this,Tt).get(t);if(n!==void 0)if(r=true,_(this,Mt)===1)F(this,E,Bh).call(this,e);else {_(this,kr).call(this,n);let a=_(this,$)[n];if(F(this,E,ft).call(this,a)?a.__abortController.abort(new Error("deleted")):(_(this,be)||_(this,Ht))&&(_(this,be)&&((s=_(this,pe))==null||s.call(this,a,t,e)),_(this,Ht)&&_(this,Rt)?.push([a,t,e])),_(this,Tt).delete(t),_(this,pt)[n]=void 0,_(this,$)[n]=void 0,n===_(this,It))W(this,It,_(this,re)[n]);else if(n===_(this,Dt))W(this,Dt,_(this,Wt)[n]);else {let l=_(this,re)[n];_(this,Wt)[l]=_(this,Wt)[n];let h=_(this,Wt)[n];_(this,re)[h]=_(this,re)[n];}Ys(this,Mt)._--,_(this,xe).push(n);}}if(_(this,Ht)&&_(this,Rt)?.length){let n=_(this,Rt),a;for(;a=n?.shift();)(o=_(this,me))==null||o.call(this,...a);}return r},Bh=function(t){var e,r;for(let s of F(this,E,or).call(this,{allowStale:true})){let o=_(this,$)[s];if(F(this,E,ft).call(this,o))o.__abortController.abort(new Error("deleted"));else {let n=_(this,pt)[s];_(this,be)&&((e=_(this,pe))==null||e.call(this,o,n,t)),_(this,Ht)&&_(this,Rt)?.push([o,n,t]);}}if(_(this,Tt).clear(),_(this,$).fill(void 0),_(this,pt).fill(void 0),_(this,ie)&&_(this,ye)&&(_(this,ie).fill(0),_(this,ye).fill(0)),_(this,_e)&&_(this,_e).fill(0),W(this,Dt,0),W(this,It,0),_(this,xe).length=0,W(this,ge,0),W(this,Mt,0),_(this,Ht)&&_(this,Rt)){let s=_(this,Rt),o;for(;o=s?.shift();)(r=_(this,me))==null||r.call(this,...o);}};var Gn=kh;var Ci=class{constructor(t){k(this,"cache");k(this,"map",new Map);this.cache=new Gn({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(t){let e=this.map.delete(t);return e&&this.cache.delete(t),e}get forEach(){return this.map.forEach}get(t){let e=this.cache.get(t);return e||this.map.get(t)}has(t){return this.map.has(t)}set(t,e){return this.map.set(t,e),this.cache.set(t,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Ds=new Ci({cacheSize:10}),Gh;(s=>{function i(o){let n=Ds.get(o);if(!n){G.error(`Label "${o}" not found`);return}return n}s.get=i;function t(o){if(Array.isArray(o)){o.forEach(n=>t(n));return}Ds.has(o.id)&&G.info(`Label "${o.id}" already exists, it will be overwritten`),Ds.set(o.id,o);}s.add=t;function e(){return Array.from(Ds.values())}s.values=e;function r(o){return Ds.has(o)}s.has=r;})(Gh||(Gh={}));var ve=Gh;var O=class O{constructor(){}static get allOpenedLabels(){return V.getVariable(Q.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(t){V.setVariable(Q.OPENED_LABELS_COUNTER_KEY,t);}static getCurrentStepTimesCounterData(t=""){let e=O.currentLabelStepIndex;if(e===null)return G.error("currentLabelStepIndex is null"),null;let r=`${e}${t}`,s=O.currentLabelId,o=O._currentLabel;if(!s||e===null||!o)return G.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let n=o.getStepSha(e)||"error",a=V.getVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][r]||a[s][r].stepSha1!=n)&&(a[s][r]={stepSha1:n}),a[s][r]}static setCurrentStepTimesCounterData(t="",e){let r=O.currentLabelStepIndex,s=r+t,o=O.currentLabelId;if(!o||r===null){G.error("currentLabelId or currentLabelStepIndex is null");return}let n=V.getVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[o]||(n[o]={}),n[o][s]=e,V.setVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static getCurrentStepTimesCounter(t=""){let e=O._stepCounter,r=O.getCurrentStepTimesCounterData(t);if(!r)return G.error("getCurrentStepTimesCounter obj is null"),0;let s=r.stepCounters||r.lastStepIndexs||[];return s.find(n=>n===e)||(s.push(e),delete r.lastStepIndexs,r.stepCounters=s,O.setCurrentStepTimesCounterData(t,r)),s.length}static getRandomNumber(t,e,r={}){let s=r.nestedId||"";if(r.onceOnly||false){let n=O.getCurrentStepTimesCounterData(s);if(!n)return;let a=n.usedRandomNumbers||{},l=Array.from({length:e-t+1},(c,f)=>f+t).filter(c=>!a[`${t}-${e}`]?.includes(c));if(l.length===0)return;let h=Math.floor(Math.random()*l.length),u=l[h];return a[`${t}-${e}`]||(a[`${t}-${e}`]=[]),a[`${t}-${e}`].push(u),n.usedRandomNumbers=a,O.setCurrentStepTimesCounterData(s,n),u}return Math.floor(Math.random()*(e-t+1))+t}static resetCurrentStepTimesCounter(t=""){let e=O.currentLabelStepIndex,r=e+t,s=O.currentLabelId;if(!s||e===null){G.error("currentLabelId or currentLabelStepIndex is null");return}let o=V.getVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[s]||(o[s]={}),o[s][r]={stepCounters:[],stepSha1:""},V.setVariable(Q.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static get allChoicesMade(){return V.getVariable(Q.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(t){V.setVariable(Q.ALL_CHOICES_MADE_KEY,t);}static increaseStepCounter(){O._stepCounter++;}static get openedLabels(){return ke(O._openedLabels)}static set openedLabels(t){O._openedLabels=ke(t);}static get originalOpenedLabels(){return ke(O._originalOpenedLabels)}static set originalOpenedLabels(t){O._originalOpenedLabels=ke(t);}static get _currentLabel(){if(O.currentLabelId)return ve.get(O.currentLabelId)}static get currentLabelId(){if(O._openedLabels.length>0)return O._openedLabels[O._openedLabels.length-1].label}static get currentLabelStepIndex(){return O._openedLabels.length>0?O._openedLabels[O._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(t,e){let r=O.allOpenedLabels,s=O.allOpenedLabels[t]?.biggestStep||0,o=O.allOpenedLabels[t]?.openCount||0;(!s||s<e)&&(r[t]={biggestStep:e,openCount:o},O.allOpenedLabels=r);}static addChoicesMade(t,e,r,s){let o=O.allChoicesMade,n=o.findIndex(a=>a.labelId===t&&a.stepIndex===e&&a.choiceIndex===s&&a.stepSha1===r);n<0?o.push({labelId:t,stepIndex:e,choiceIndex:s,stepSha1:r,madeTimes:1}):o[n].madeTimes++,O.allChoicesMade=o;}static pushNewLabel(t){if(!ve.get(t))throw new Error(`[Pixi\u2019VN] Label ${t} not found`);O._openedLabels.push({label:t,currentStepIndex:0});let r=O.allOpenedLabels,s=O.allOpenedLabels[t]?.biggestStep||0,o=O.allOpenedLabels[t]?.openCount||0;r[t]={biggestStep:s,openCount:o+1},O.allOpenedLabels=r;}static increaseCurrentStepIndex(){if(O._openedLabels.length>0){let t=O._openedLabels[O._openedLabels.length-1];O._openedLabels[O._openedLabels.length-1]={...t,currentStepIndex:t.currentStepIndex+1};}}static set onStepStart(t){O._onStepStart=t;}static get onStepStart(){return async(t,e)=>{let r=[];return O.onLoadingLabel&&t===0&&r.push(O.onLoadingLabel(t,e)),O._onStepStart&&r.push(O._onStepStart(t,e)),await Promise.all(r)}}};k(O,"stepsRunning",0),k(O,"goNextRequests",0),k(O,"choiceMadeTemp"),k(O,"lastHistoryStep",null),k(O,"_stepCounter",0),k(O,"_openedLabels",[]),k(O,"_originalOpenedLabels",[]),k(O,"_onStepStart"),k(O,"onLoadingLabel"),k(O,"onStepEnd");var A=O;var Us=class{get currentStepTimesCounter(){return A.getCurrentStepTimesCounter()}set currentStepTimesCounter(t){A.resetCurrentStepTimesCounter();}getRandomNumber(t,e,r={}){return A.getRandomNumber(t,e,r)}get stepCounter(){return A._stepCounter}get openedLabels(){return A.openedLabels}get currentLabel(){return A._currentLabel}addStepHistory(t,e={}){let{choiceMade:r,ignoreSameStep:s}=e,o,n,a,l=V.getVariable(Q.LAST_STEP_GLUED)===this.stepCounter;V.getVariable(Q.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=V.getVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY)),V.getVariable(Q.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(n=V.getVariable(Q.CURRENT_MENU_OPTIONS_MEMORY_KEY)),V.getVariable(Q.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=V.getVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY));let h=A.openedLabels,u={currentLabel:A.currentLabelId,dialogue:o,choices:n,stepSha1:t,index:this.stepCounter,labelStepIndex:A.currentLabelStepIndex,choiceIndexMade:r,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:l,openedLabels:h};A.originalOpenedLabels=h,V.addHistoryItem(u,{ignoreSameStep:s}),A.lastHistoryStep=u,A.increaseStepCounter();}closeCurrentLabel(){if(!A.currentLabelId){G.warn("No label to close");return}if(!this.currentLabel){G.error("currentLabel not found");return}let t=A.openedLabels;t.pop(),A.openedLabels=t,V.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;A.openedLabels.length>0;)this.closeCurrentLabel(),V.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(t){let e;typeof t=="string"?e=t:e=t.id;let s=A.allOpenedLabels[e]?.biggestStep||0;if(s){let o=ve.get(e);if(o)return o.stepCount<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let t=A.currentLabelStepIndex,e=this.currentLabel;if(t===null||!e)return;let r=e.getStepSha(t);return r||(G.warn("stepSha not found, setting to ERROR"),r="error"),A.allChoicesMade.filter(s=>s.labelId===e?.id&&s.stepIndex===t&&s.stepSha1===r)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(t=>t.choiceIndex)}get isCurrentStepAlreadyOpened(){let t=A.currentLabelId;if(t){let e=A.allOpenedLabels[t]?.openCount||0;if(A.currentLabelStepIndex&&e>=A.currentLabelStepIndex)return true}return false}getTimesLabelOpened(t){return A.allOpenedLabels[t]?.openCount||0}getTimesChoiceMade(t){return this.alreadyCurrentStepMadeChoicesObj?.find(e=>e.choiceIndex===t)?.madeTimes||0}addCurrentStepToHistory(){this.addStepHistory("dev",{ignoreSameStep:true});}getCanGoNext(t){let e=t?.showWarn||false,r=this.choiceMenuOptions;return r&&r.length>0?(e&&G.warn("The player must make a choice"),false):this.isRequiredInput?(e&&G.warn("The player must enter a value"),false):true}get canGoNext(){return A.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(t,e){let r=[];return t.onStepStart&&r.push(t.onStepStart(e,t)),A.onStepStart&&r.push(A.onStepStart(e,t)),await Promise.all(r)}async onStepEnd(t,e){let r=[];return t.onStepEnd&&r.push(t.onStepEnd(e,t)),A.onStepEnd&&r.push(A.onStepEnd(e,t)),await Promise.all(r)}async goNext(t,e={}){let{runNow:r=false}=e;if(!(!r&&!this.getCanGoNext({showWarn:true}))){if(!r&&A.stepsRunning!==0){A.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,A.currentLabelStepIndex||0);}catch(s){G.error("Error running onStepEnd",s);}return A.stepsRunning===0&&await V.onGoNextEnd(),A.increaseCurrentStepIndex(),await this.runCurrentStep(t,e)}}async runCurrentStep(t,e={}){let{choiceMade:r}=e;if(A.currentLabelId){let s=A.currentLabelStepIndex;if(s===null){G.error("currentLabelStepIndex is null");return}let o=A._currentLabel;if(!o){G.error("currentLabel not found");return}if(o.stepCount>s){try{await this.onStepRun(o,s);}catch(l){G.error("Error running onStepStart",l),this.onStepError&&this.onStepError(l,t);return}let n=o.getStepById(s);if(!n){G.error("step not found");return}let a=o.getStepSha(s);a||(G.warn("stepSha not found, setting to ERROR"),a="error");try{A.stepsRunning++;let l=await n(t,{labelId:o.id}),h=this.choiceMenuOptions;if(h?.length===1&&h[0].autoSelect){let c=h[0];l=await this.selectChoice(c,t);}let u=A.lastHistoryStep;if(r!==void 0&&u){let c=u.stepSha1;c||(G.warn("stepSha not found, setting to ERROR"),c="error"),A.addChoicesMade(u.currentLabel||"error",typeof u.labelStepIndex=="number"?u.labelStepIndex:-1,u.stepSha1||"error",r),A.choiceMadeTemp=r;}return A.stepsRunning--,A.stepsRunning===0&&(A.addLabelHistory(o.id,s),this.addStepHistory(a,{...e,choiceMade:A.choiceMadeTemp}),A.choiceMadeTemp=void 0,A.goNextRequests>0)?(A.goNextRequests--,await this.goNext(t)):l}catch(l){A.stepsRunning>0&&A.stepsRunning--,G.error("Error running step",l),this.onStepError&&this.onStepError(l,t);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(t,e);if(this.openedLabels.length===1)return A.openedLabels=[],V.onEnd?await V.onEnd(t,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(A.openedLabels=A.originalOpenedLabels,V.onEnd)return await V.onEnd(t,{labelId:"end"});G.error("The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else G.error("currentLabelId not found");}async callLabel(t,e,r){let{choiceMade:s}=r||{},o;typeof t=="string"?o=t:o=t.id;try{let n=ve.get(o);if(!n)throw new Error(`[Pixi\u2019VN] Label ${o} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,A.currentLabelStepIndex||0);}catch(a){G.error("Error running onStepEnd",a);}A.pushNewLabel(n.id);}catch(n){G.error("Error calling label",n);return}return await this.runCurrentStep(e,{choiceMade:s})}async jumpLabel(t,e,r){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:s}=r||{},o;typeof t=="string"?o=t:o=t.id;try{let n=ve.get(o);if(!n)throw new Error(`[Pixi\u2019VN] Label ${o} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,A.currentLabelStepIndex||0);}catch(a){G.error("Error running onStepEnd",a);}A.pushNewLabel(n.id);}catch(n){G.error("Error jumping label",n);return}return await this.runCurrentStep(e,{choiceMade:s})}async selectChoice(t,e){this.choiceMenuOptions=void 0;let r=t.type;switch(r){case "call":return await this.callLabel(t.label,{...t.props,...e},{choiceMade:t.choiceIndex});case "jump":return await this.jumpLabel(t.label,{...t.props,...e},{choiceMade:t.choiceIndex});case "close":return await this.closeChoiceMenu(t,{...t.props,...e});default:throw G.error(`Type ${r} not found`),new Error(`[Pixi\u2019VN] Type ${r} not found`)}}async closeChoiceMenu(t,e){if(t.type!=="close")throw G.error("For closeChoiceMenu, the type must be close"),new Error("[Pixi\u2019VN] For closeChoiceMenu, the type must be close");let r;return typeof t.choiceIndex=="number"&&(r=t.choiceIndex),t.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(e,{choiceMade:r})}get onStepError(){let t=V.onError;return t?(e,r)=>t("step",e,r):void 0}set onStepError(t){V.onError=(e,r,s)=>t(r,s);}get dialogue(){let t=V.getVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY);if(t)return {...t,character:t.character?V.getCharacter(t.character)||t.character:void 0}}set dialogue(t){if(!t){V.setVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof t=="string"||Array.isArray(t))&&(t={text:t}),this.dialogGlue){let e=V.getVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY);if(e){let r=[];Array.isArray(e.text)?r=[...e.text]:r=[e.text],Array.isArray(t.text)?r=[...r,...t.text]:r=[...r,t.text],t.text=r,t.character=t.character||e.character;}V.setVariable(Q.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{V.setVariable(Q.CURRENT_DIALOGUE_MEMORY_KEY,ke({...t,character:typeof t.character=="string"?t.character:t.character?.id})),V.setVariable(Q.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(e){throw G.error("DialogueInterface cannot contain functions or classes"),e}}get choiceMenuOptions(){let t=V.getVariable(Q.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(t){let e=[],r=t.map((o,n)=>({...o,choiceIndex:n})),s=this.alreadyCurrentStepMadeChoices;if(r=r.filter((o,n)=>o.oneTime&&s&&s.includes(n)?false:o.onlyHaveNoChoice?(e.push(o),false):true),r.length>0)return r;if(e.length>0)return [e[0]]}}set choiceMenuOptions(t){if(!t||t.length===0){V.setVariable(Q.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}try{V.setVariable(Q.CURRENT_MENU_OPTIONS_MEMORY_KEY,ke(t)),V.setVariable(Q.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(e){throw G.error("ChoiceInterface cannot contain functions or classes"),e}}get dialogGlue(){return V.getFlag(Q.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(t){V.setFlag(Q.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,t);}get inputValue(){return V.getVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(t){this.removeInputRequest(),V.setVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY,t),V.setVariable(Q.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return V.getVariable(Q.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return V.getVariable(Q.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(t,e){t.isRequired=true,V.setVariable(Q.CURRENT_INPUT_INFO_MEMORY_KEY,t),e!==void 0?V.setVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY,e):V.removeVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){V.removeVariable(Q.CURRENT_INPUT_INFO_MEMORY_KEY),V.removeVariable(Q.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){A.openedLabels=[],A._stepCounter=0;}export(){return {openedLabels:ke(A.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(t){let e=this.openedLabels.map(async r=>{let s=[],o=ve.get(r.label);return o&&(o.onLoadingLabel&&s.push(o.onLoadingLabel(t,o)),A.onLoadingLabel&&s.push(A.onLoadingLabel(t,o))),await Promise.all(s)});return await Promise.all(e)}async restore(t,e){this.clear();try{A.lastHistoryStep=e,t.hasOwnProperty("openedLabels")?(A.openedLabels=t.openedLabels,A.originalOpenedLabels=A.openedLabels):G.warn("Could not import openedLabels data, so will be ignored"),t.hasOwnProperty("stepCounter")?A._stepCounter=t.stepCounter:t.hasOwnProperty("lastStepIndex")?A._stepCounter=t.lastStepIndex:G.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(A.currentLabelStepIndex||0);}catch(r){G.error("Error running onLoadingLabel",r);}}catch(r){G.error("Error importing data",r);}}};function Qy(i,t,e,r){let s=typeof t=="string"?t:t.id;return {...r,label:s,props:e,text:i,type:r?.type||"call"}}var Oh="close";function Jy(i,t){return {...t,type:Oh,text:i}}var bx=Nn(yx());var Pi=class{constructor(t,e){k(this,"_id");k(this,"_onStepStart");k(this,"_onLoadingLabel");k(this,"_onStepEnd");this._id=t,this._onStepStart=e?.onStepStart,this._onLoadingLabel=e?.onLoadingLabel,this._onStepEnd=e?.onStepEnd;}get id(){return this._id}get onStepStart(){return async(t,e)=>{if(this._onLoadingLabel&&t===0&&await this._onLoadingLabel(t,e),this._onStepStart)return await this._onStepStart(t,e)}}get onLoadingLabel(){return this._onLoadingLabel}get onStepEnd(){return this._onStepEnd}};var Mi=class extends Pi{constructor(e,r,s){super(e,s);k(this,"_steps");this._steps=r;}get stepCount(){return this.steps.length}getStepById(e){return this.steps[e]}get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(e){if(e<0||e>=this.steps.length)return G.warn("stepSha not found, setting to ERROR"),"error";try{let r=this.steps[e];return (0,bx.default)(r.toString().toLocaleLowerCase()).toString()}catch(r){return G.warn("stepSha not found, setting to ERROR",r),"error"}}};function vx(i,t,e){let r=new Mi(i,t,e);return ve.add(r),r}var aO=new Us;
|
|
573
573
|
export{Oh as Close,Mi as Label,Pi as LabelAbstract,A as NarrationManagerStatic,ve as RegisteredLabels,aO as narration,Qy as newChoiceOption,Jy as newCloseChoiceOption,vx as newLabel};
|