From b324670992a5bcd6827ee7bb651973e1a889129f Mon Sep 17 00:00:00 2001 From: Active Date: Mon, 29 Jan 2024 07:13:43 -0600 Subject: [PATCH] update submodules --- dist/core.min.mjs | 6 +++--- package.json | 2 +- src/submodules/Resonance | 2 +- src/submodules/Utils | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/core.min.mjs b/dist/core.min.mjs index 5cd1e85..aa08b30 100644 --- a/dist/core.min.mjs +++ b/dist/core.min.mjs @@ -1,9 +1,9 @@ /** - * core@1.2.0 https://github.com/EvitcaStudio/Core - * Compiled 1/24/2024, 12:45:34 PM UTC + * core@1.5.0 https://github.com/EvitcaStudio/Core + * Compiled 1/29/2024, 1:12:54 PM UTC * * core is licensed under a MIT styled License. See LICENSE.md for more info. * * Copyright 2024, Evitca Studio, All Rights Reserved */ - var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={},s=(t.d(e,{Q:()=>Mt}),{d:(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),i={},r=(s.d(i,{k:()=>h}),{d:(t,e)=>{for(var s in e)r.o(e,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),a={};r.d(a,{Y:()=>n});class n{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;tMath.abs(Math.round(t)).toString(16).padStart(2,"0")).join("")}version="1.0.0";_build(t,e,s,i){this.start=t,this.end=e,this.duration=s,this.easing="function"==typeof i?i:h.linear,this.events={},this.exportedValues={},this.tweening=!1,this.update=null,this.paused=!1,this.lastTime=0,this.elapsed=0}build({start:t={},end:e={},duration:s=1e3,easing:i=h.linear}={}){return this._build(t,e,s,i),this}on(t,e){if("function"==typeof e)switch(t){case"start":case"end":case"pause":case"resume":this.events[t]=e;break;default:l.prefix("Tween-Module").error(`The event "${t}" is not supported.`)}else l.prefix("Tween-Module").error(`The callback for event "${t}" is not a function.`);return this}animationFrame=()=>{if(this.tweening&&!this.paused){var i,r,t=Date.now();this.lastTime||(this.lastTime=t),this.elapsed+=t-this.lastTime;let s=this.elapsed/this.duration;for(i in 1<(s=this.oscillating?(1-Math.cos(s*Math.PI))/2:s)&&(s=1),this.end){let t=this.start[i],e=this.end[i];"string"==typeof t&&(3===t.length||6===t.length)||4===t.length||7===t.length?(t=h._hexToRgb(t),e=h._hexToRgb(e),r=[this.easing(s,t[0],e[0]-t[0],1),this.easing(s,t[1],e[1]-t[1],1),this.easing(s,t[2],e[2]-t[2],1)],this.exportedValues[i]=h._rgbToHex(r)):this.exportedValues[i]=this.easing(s,t,e-t,1)}this.update(this.exportedValues),1!==s||this.oscillating?requestAnimationFrame(this.animationFrame):(this.stop(),this.events.end&&this.events.end()),this.lastTime=t}};animate(s,i=!1){if("function"!=typeof s)l.prefix("Tween-Module").error("The pUpdate parameter passed to animate is not a function.");else if(!this.tweening){let t=Object.keys(this.start),e=Object.keys(this.end);if(t.length&&e.length){if(t.every(t=>e.includes(t)))return this.update=s,this.tweening=!0,this.elapsed=0,this.oscillating=i,this.events.start&&this.events.start(),requestAnimationFrame(this.animationFrame),this;l.prefix("Tween-Module").error("The end object is missing properties that the start object has.")}else l.prefix("Tween-Module").error("The start object or the end object has no properties.")}}resume(){return this.paused&&(this.lastTime=Date.now(),this.paused=!1,this.events.resume&&this.events.resume(),requestAnimationFrame(this.animationFrame)),this}pause(){return this.paused||(this.paused=!0,this.events.pause&&this.events.pause()),this}stop(){this.tweening=!1,this.oscillating=!1,this.update=null,this.elapsed=0,this.lastTime=0,this.paused=!1;for(const t in this.exportedValues)this.exportedValues.hasOwnProperty(t)&&delete this.exportedValues[t]}}const l=new o;l.registerType("Tween-Module","#ff6600");var u=i.k,c={d:(t,e)=>{for(var s in e)c.o(e,s)&&!c.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},d={},p=(c.d(d,{P:()=>O}),{d:(t,e)=>{for(var s in e)p.o(e,s)&&!p.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),m={},f=(p.d(m,{k:()=>E}),{d:(t,e)=>{for(var s in e)f.o(e,s)&&!f.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),g={};f.d(g,{Y:()=>y});class y{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;tMath.abs(Math.round(t)).toString(16).padStart(2,"0")).join("")}version="1.0.0";_build(t,e,s,i){this.start=t,this.end=e,this.duration=s,this.easing="function"==typeof i?i:E.linear,this.events={},this.exportedValues={},this.tweening=!1,this.update=null,this.paused=!1,this.lastTime=0,this.elapsed=0}build({start:t={},end:e={},duration:s=1e3,easing:i=E.linear}={}){return this._build(t,e,s,i),this}on(t,e){if("function"==typeof e)switch(t){case"start":case"end":case"pause":case"resume":this.events[t]=e;break;default:M.prefix("Tween-Module").error(`The event "${t}" is not supported.`)}else M.prefix("Tween-Module").error(`The callback for event "${t}" is not a function.`);return this}animationFrame=()=>{if(this.tweening&&!this.paused){var i,r,t=Date.now();this.lastTime||(this.lastTime=t),this.elapsed+=t-this.lastTime;let s=this.elapsed/this.duration;for(i in 1<(s=this.oscillating?(1-Math.cos(s*Math.PI))/2:s)&&(s=1),this.end){let t=this.start[i],e=this.end[i];"string"==typeof t&&(3===t.length||6===t.length)||4===t.length||7===t.length?(t=E._hexToRgb(t),e=E._hexToRgb(e),r=[this.easing(s,t[0],e[0]-t[0],1),this.easing(s,t[1],e[1]-t[1],1),this.easing(s,t[2],e[2]-t[2],1)],this.exportedValues[i]=E._rgbToHex(r)):this.exportedValues[i]=this.easing(s,t,e-t,1)}this.update(this.exportedValues),1!==s||this.oscillating?requestAnimationFrame(this.animationFrame):(this.stop(),this.events.end&&this.events.end()),this.lastTime=t}};animate(s,i=!1){if("function"!=typeof s)M.prefix("Tween-Module").error("The pUpdate parameter passed to animate is not a function.");else if(!this.tweening){let t=Object.keys(this.start),e=Object.keys(this.end);if(t.length&&e.length){if(t.every(t=>e.includes(t)))return this.update=s,this.tweening=!0,this.elapsed=0,this.oscillating=i,this.events.start&&this.events.start(),requestAnimationFrame(this.animationFrame),this;M.prefix("Tween-Module").error("The end object is missing properties that the start object has.")}else M.prefix("Tween-Module").error("The start object or the end object has no properties.")}}resume(){return this.paused&&(this.lastTime=Date.now(),this.paused=!1,this.events.resume&&this.events.resume(),requestAnimationFrame(this.animationFrame)),this}pause(){return this.paused||(this.paused=!0,this.events.pause&&this.events.pause()),this}stop(){this.tweening=!1,this.oscillating=!1,this.update=null,this.elapsed=0,this.lastTime=0,this.paused=!1;for(const t in this.exportedValues)this.exportedValues.hasOwnProperty(t)&&delete this.exportedValues[t]}}const M=new T;M.registerType("Tween-Module","#ff6600");var _=m.k;class b{soundPath=null;startTime=null;endTime=null;save=null;duration=null;source=null;gainNode=null;loaded=!1;playAfterLoad=!1;muted=!1;state=null;startedTimeStamp=null;pausedTimeStamp=0;playUnfocused=null;fader={};events={};stopSignal=!1;_loop=!1;_playbackRate=1;_volume=100;_info={soundPath:null,duration:null};constructor(t,e,s,i,r,a,n,o){this.build(t,e,s,i,r,a,n,o)}get volume(){return this._volume}set volume(t){this._volume=O.constructor.clamp(t,O.constructor.MIN_VOLUME,O.constructor.MAX_VOLUME),this.loaded&&(this.gainNode.gain.value=O.constructor.normalize(this._volume))}on(t,e){if("function"==typeof e)switch(t){case"start":case"stop":case"end":case"pause":case"resume":this.events[t]=e;break;default:O.logger.prefix("Resonance-Module").error(`The event "${t}" is not supported.`)}else O.logger.prefix("Resonance-Module").error(`The callback for event "${t}" is not a function.`);return this}toggleMute(){if(this.loaded&&this.source)return this.muted=!this.muted,this.muted?this.gainNode.gain.value=0:this.gainNode.gain.value=O.constructor.normalize(this._volume),this}get loop(){return this._loop}set loop(t){this._loop=!!t,this.source&&(this.source.loop=this._loop)}toggleLoop(){return this._loop=!this._loop,this.source&&(this.source.loop=this._loop),this}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=O.constructor.clamp(t,1,O.constructor.MAX_PLAYBACK_RATE),this.source&&(this.source.playbackRate.value=this._playbackRate)}set info(t){this._info=this._info}get info(){return this.loaded&&this.source&&(this._info.duration=this.duration),this._info.soundPath=this.soundPath,{...this._info}}build(t,e=100,s=0,i=0,r=!1,a=!1,n=1,o=!1){this.soundPath=t,this.startTime=Math.max(s,0),this.endTime=Math.max(i,0),this.save=!!o||r,this._playbackRate=O.constructor.clamp(n,1,O.constructor.MAX_PLAYBACK_RATE),this.playUnfocused=!!a,this.state=null,this._loop=!!o,this._volume=O.constructor.clamp(e,O.constructor.MIN_VOLUME,O.constructor.MAX_VOLUME),O.loadedBuffers[this.soundPath]?this.loaded=!0:this.load()}load(){const e=new XMLHttpRequest,s=this;e.open("GET",s.soundPath),e.responseType="arraybuffer",e.onload=function(){var t=e.response;O.audioCtx.decodeAudioData(t,t=>{s.loaded=!0,O.loadedBuffers[s.soundPath]=t,s.playAfterLoad&&(s.stopSignal?s.stopSignal=!1:s.play())},t=>{s.loaded=!1,O.logger.prefix("Resonance-Module").error(`Error with decoding audio data "${s.soundPath}" This sound has been killed.`),s.kill()})},e.send()}pause(){if(this.loaded)return this.stop("suspended"),this.state="suspended",this.pausedTimeStamp=O.audioCtx.currentTime-this.startedTimeStamp,O.soundsPlaying.includes(this)&&O.soundsPlaying.splice(O.soundsPlaying.indexOf(this),1),O.pausedSounds.includes(this)||O.pausedSounds.push(this),"function"==typeof this.events.pause&&this.events.pause(),this}resume(){if(this.loaded)return O.pausedSounds.includes(this)&&O.pausedSounds.splice(O.pausedSounds.indexOf(this),1),O.soundsPlaying.includes(this)||O.soundsPlaying.push(this),this.play(!0),this.state=this.fader.raf?"fading":"playing","function"==typeof this.events.resume&&this.events.resume(),this}stop(t){var e;if(this.source)return e="playing"===this.state||"fading"===this.state||"suspended"===this.state,O.soundsPlaying.includes(this)&&O.soundsPlaying.splice(O.soundsPlaying.indexOf(this),1),this.source&&(this.source.stop||(this.source.stop=this.source.noteOff),this.source.stop(),this.source.disconnect(),this.gainNode.disconnect(),this.source=null,this.gainNode=null),this.state=t||"stopped","stopped"===this.state&&e&&"function"==typeof this.events.stop&&this.events.stop(),this;this.stopSignal=!0}play(t){if(this.soundPath&&"recycled"!==this.state&&O.canPlaySound())if(this.loaded||O.loadedBuffers[this.soundPath]){if(O.focused||this.canPlayUnfocused()){this.source&&(this.source.disconnect(),this.gainNode.disconnect(),this.source=null,this.gainNode=null),O.pausedSounds.includes(this)&&O.pausedSounds.splice(O.pausedSounds.indexOf(this),1);const e=O.audioCtx.createBufferSource(),s=O.audioCtx.createGain(),i=this;return s.gain.value=O.constructor.normalize(this._volume),s.connect(O.gainNode),e.connect(s),e.buffer=O.loadedBuffers[this.soundPath],e.playbackRate.value=this._playbackRate,e.onended=function(){"stopped"===i.state&&i.save||("restart"!==i.state?"suspended"!==i.state&&("stopped"!==i.state&&"function"==typeof i.events.end&&i.events.end(),i._loop?i.play():i.save||i.kill()):i.play())},this.source=e,this.gainNode=s,this.duration=e.buffer.duration,this.playAfterLoad=null,e.start||(e.start=e.noteOn),e.start(0,this.pausedTimeStamp?this.pausedTimeStamp*this._playbackRate:this.startTime,this.endTime||this.duration),this.state="playing",this.startedTimeStamp=O.audioCtx.currentTime-(this.pausedTimeStamp||this.startTime),this.pausedTimeStamp=0,O.soundsPlaying.includes(this)||O.soundsPlaying.push(this),t||"function"!=typeof this.events.start||this.events.start(),this}O.queuedSoundsToPlay.includes(this)||O.queuedSoundsToPlay.push(this)}else this.playAfterLoad=!0}restart(){return this.stop("restart"),this}canPlayUnfocused(){return!!this.playUnfocused}kill(){if(this.wipe(),O.recycledSounds.length{for(var s in e)C.o(e,s)&&!C.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},S={};C.d(S,{Y:()=>v});class v{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;tMath.max(e,Math.min(t,s));static normalize=(t,e=0,s=100,i=1)=>(t-e)/(s-e)*i;version="1.0.0";constructor(){window.AudioContext||window.webkitAudioContext?(this.logger=new A,this.logger.registerType("Resonance-Module","#ff6600"),window.AudioContext=window.AudioContext||window.webkitAudioContext,window.addEventListener("mousedown",this.resumeAudioCtx.bind(this)),window.addEventListener("touchstart",this.resumeAudioCtx.bind(this)),window.addEventListener("load",this.resumeAudioCtx.bind(this)),window.addEventListener("blur",()=>{this.focused=!1,this.soundsPlaying.length&&this.pauseAllSounds(!0)}),window.addEventListener("focus",()=>{this.focused=!0,this.pausedSounds.length&&this.resumeAllSounds(!0),(this.queuedSoundsToPlay.length||this.queuedSoundsToFade.length)&&this.playQueuedSounds()}),this.audioCtx=new AudioContext,!this.audioCtx.createGain&&this.audioCtx.createGainNode&&(this.audioCtx.createGain=this.audioCtx.createGainNode),this.gainNode=this.audioCtx.createGain(),this.gainNode.gain.value=R.normalize(R.MAX_VOLUME),this.gainNode.connect(this.audioCtx.destination),this.soundsPlaying=[],this.pausedSounds=[],this.recycledSounds=[],this.queuedSoundsToPlay=[],this.queuedSoundsToFade=[],this.loadedBuffers={},this.fader={},this.volume=100,this.muted=!1,this.state=null,this.focused=!0,this.abilityToPlaySound=null):this.logger.prefix("Resonance-Module").error("Your device does not support window.AudioContext || window.webkitAudioContext. This library cannot be used")}canPlaySound(){return!(this.abilityToPlaySound&&!this.abilityToPlaySound())}enableChecker(t){return"function"==typeof t&&(this.abilityToPlaySound=t),this}adjustVolume(t){return this.volume=R.clamp(t,R.MIN_VOLUME,R.MAX_VOLUME),this.gainNode.gain.value=R.normalize(this.volume),this}fade(s=100,t=5e3,i="easeOutCubic",r){if(!isNaN(s)&&!isNaN(t)&&"fading"!==this.state){s=R.clamp(s,R.MIN_VOLUME,R.MAX_VOLUME),_[i]||this.logger.prefix("Resonance-Module").error("Invalid pEase value. Reverted to default."),this.state="fading",this.fader.duration=Math.max(t,0),this.fader.currentIteration=0,this.fader.initialValue=this.volume,this.fader.changeInValue=s-this.fader.initialValue,this.fader.totalIterations=this.fader.duration/(1e3/R.FRAME_RATE),this.fader.startStamp=null,this.fader.previousTimeStamp=null,this.fader.durationOffScreen=[0,0];const a=this,n=function(t){var e;a.focused?(null===a.fader.startStamp&&(a.fader.startStamp=t),a.adjustVolume(_[i](a.fader.currentIteration,a.fader.initialValue,a.fader.changeInValue,a.fader.totalIterations)),a.fader.durationOffScreen[1]&&(a.fader.durationOffScreen[0]+=a.fader.durationOffScreen[1],a.fader.durationOffScreen[1]=0),e=t-a.fader.durationOffScreen[0]-a.fader.startStamp,a.fader.currentIteration{n.loadedBuffers[e]=t,o.queuedToStop||h()},t=>{this.logger.prefix("Resonance-Module").error(`Error with decoding audio data "${e}"`)})},s.send()}return o}}createSound(t,e,s,i,r,a,n,o){var h;return this.recycledSounds.length?((h=this.recycledSounds.pop()).build(t,e,s,i,r,a,n,o),h):new b(t,e,s,i,r,a,n,o)}stopAllSounds(e){for(let t=this.soundsPlaying.length-1;0<=t;t--){var s=this.soundsPlaying[t];Array.isArray(e)&&e.includes(s)||s.stop()}return this}killAllSounds(){for(let t=this.soundsPlaying.length-1;0<=t;t--)this.soundsPlaying[t].kill();return this}pauseAllSounds(e){for(let t=this.soundsPlaying.length-1;0<=t;t--){var s=this.soundsPlaying[t];e&&s.canPlayUnfocused()||s.pause()}return this}resumeAllSounds(t){for(let t=this.pausedSounds.length-1;0<=t;t--)this.pausedSounds[t].resume();return this}playQueuedSounds(){for(let t=this.queuedSoundsToPlay.length-1;0<=t;t--){var e=this.queuedSoundsToPlay[t];this.queuedSoundsToPlay.splice(t,1),e.play()}for(let t=this.queuedSoundsToFade.length-1;0<=t;t--){var s=this.queuedSoundsToFade[t];this.queuedSoundsToFade.splice(t,1),s.queuedFade()}}unloadSound(t){return this.loadedBuffers[t]&&delete this.loadedBuffers[t],this}recycleSound(t){return t instanceof b&&t.kill(),this}resumeAudioCtx(){"running"!==this.audioCtx.state&&this.audioCtx.resume().then(()=>{},()=>{}),this.ready=!0}}const O=new R;var x=d.P,G={d:(t,e)=>{for(var s in e)G.o(e,s)&&!G.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},I={},P=(G.d(I,{P:()=>B}),{d:(t,e)=>{for(var s in e)P.o(e,s)&&!P.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),w={};P.d(w,{Y:()=>L});class L{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;t{var t=VYLO.newDiob(),e=t.__proto__.constructor;return VYLO.delDiob(t),e})();collectionLimit=20;static WARNING_LIMIT=200;basicCollection=[];constructor(){this.logger=new k,this.logger.registerType("Collector-Module","#ff6600")}setMaxLimit(t){"number"==typeof t&&(this.collectionLimit=Math.round(t),this.collectionLimit>B.WARNING_LIMIT)&&this.logger.prefix("Collector-Module").warn("Collector: This is a high value to use for a max limit in a collection! Only use this high of a value if you know what you are doing.")}collect(e,s){const i=Array.isArray(e);if(e)if("object"!=typeof e||i||Object.keys(e).length)if(e.type||i){if(Array.isArray(s)){if(s.includes(e))return void this.logger.prefix("Collector-Module").error("Collector: OOPS! %cpCollected","font-weight: bold","already belongs to the provided collection.");if(i&&!e.length)return void this.logger.prefix("Collector-Module").error("Collector: OOPS! %cpCollected","font-weight: bold","is an array. But it contains nothing to recycle.");if(i){if(s.length>=this.collectionLimit){for(let t=e.length-1;0<=t;t--){const i=e[t];i instanceof H.DiobConstructor?(this.cleanInstance(i),VYLO.delDiob(i)):(this.cleanInstance(i),VYLO.delObject(i))}return}if(e.length+s.length>this.collectionLimit)for(let t=e.length-(this.collectionLimit-s.length);0=this.collectionLimit?void(e instanceof H.DiobConstructor?(this.cleanInstance(e),VYLO.delDiob(e)):(this.cleanInstance(e),VYLO.delObject(e))):("function"==typeof e.onCollected&&e.onCollected(),s.includes(e)||s.push(e),void this.cleanInstance(e))}this.logger.prefix("Collector-Module").error("Collector: Invalid variable type passed for the %cpCollection","font-weight: bold","parameter. Expecting an array. Collect failed.")}else this.logger.prefix("Collector-Module").error("Collector: OOPS! %cpCollected","font-weight: bold"," is not a valid object It has no type.");else this.logger.prefix("Collector-Module").error("Collector: OOPS! %cpCollected","font-weight: bold"," is an empty object and will NOT be collected.");else this.logger.prefix("Collector-Module").error("Collector: There was nothing passed for the %cpCollected","font-weight: bold","parameter. Expecting a instance or an object.")}isInCollection(e="Diob",s=1,i=[],...r){var a,n=[];let o=0,h=s,l=!VYLO.Type.getVariable(e,"baseType");if(i.length){for(let t=i.length-1;0<=t;t--)h&&(a=i[t]).type===e&&(i.splice(t,1),n.push(a),a.collectorCollected=!1,"function"==typeof a.onDumped&&a.onDumped(...r),o++,h--);if(s>o){const i=s-o;for(let t=0;t{for(var s in e)F.o(e,s)&&!F.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},D={};F.d(D,{_:()=>Y});class Y{MIN_TICK_RATE=10;timeScale=1;flow=1;startMs=0;startStamp=0;currentTick=0;tickRate=10;scaledTickRate=1;lastStamp=0;expectedStamp=0;canFinish=!0;deltaTime=0;duration=1/0;loop=!1;hasDuration=!1;completionCount=0;acceptedEvents=["tick","complete","rollback","destroy","pause","resume","start","stop","reset"];onHandler={};timeHandler={};intervalHandler={};ticking=!1;paused=!1;storedIDs=[];timeoutId=0;constructor(t){if("object"!=typeof t||Array.isArray(t)||null===t||("number"==typeof t.duration&&(this.duration=Math.max(Math.round(t.duration),this.tickRate),this.hasDuration=!0),"number"==typeof t.startAt&&this.startAtHandler(t.startAt),"number"==typeof t.flow&&(this.flow=this.clamp(t.flow,-1,1)),"number"==typeof t.tickRate&&(this.tickRate=Math.max(Math.round(t.tickRate),this.MIN_TICK_RATE)),"number"==typeof t.completionCount&&(this.completionCount=Math.round(t.completionCount)),"number"==typeof t.timeScale&&(this.timeScale=t.timeScale),this.loop=!!t.loop),globalThis.document){let t,e;void 0!==document.hidden?(t="hidden",e="visibilitychange"):void 0!==document.msHidden?(t="msHidden",e="msvisibilitychange"):void 0!==document.webkitHidden&&(t="webkitHidden",e="webkitvisibilitychange"),document.addEventListener(e,()=>{document[t]?this.pause():this.resume()},!1)}const s=this;s.adjuster=()=>{var t,e;s.isTicking()&&(t=Date.now(),s.lastStamp||(s.lastStamp=t),s.expectedStamp||(s.expectedStamp=t),e=t-s.lastStamp,s.deltaTime=e/1e3,s.scaledTickRate=s.tickRate/this.timeScale,e=this.clamp(t-s.expectedStamp,0,this.scaledTickRate),s.expectedStamp=t+s.scaledTickRate,s.adjustedTickRate=s.scaledTickRate-e,s.timeoutId=setTimeout(s.adjuster,s.adjustedTickRate),s.isPaused()||(s.now=t,s.tick(s.deltaTime),s.eventHandler()),s.lastStamp=t)}}getTimeScale(){return this.timeScale}getStartStamp(){return this.startStamp}getDeltaTime(){return this.deltaTime}getMs(){return this.ticksToTime(this.currentTick)}getCurrentTick(){return this.currentTick}getCompletionCount(){return this.completionCount}getFlow(){return this.flow}getDuration(){return this.duration}setDuration(t){return"number"==typeof t&&(t=Math.round(t),this.duration=t,this.startAt(this.startMs)),this}getPercentage(){return this.hasDuration?100*this.getMs()/this.duration:0}getMsFromSeconds(t=0){if("number"==typeof t)return 1e3*t}getSecondsFromMs(t=0){if("number"==typeof t)return t/1e3}ticksToTime(t){if("number"==typeof t)return this.clamp(t*this.tickRate,0,this.duration)}timeToTicks(t){if("number"==typeof t)return t/this.tickRate}isTicking(){return this.ticking}isPaused(){return this.paused}clamp(t,e,s){return Math.max(e,Math.min(t,s))}generateID(s=7){function t(){let e="";for(let t=0;tthis.duration)return this;this.timeHandler[t]||(this.timeHandler[t]={}),this.timeHandler[t][this.generateID()]=e}return this}removeAt(t,e){if(this.timeHandler[t])for(const s of Object.keys(this.timeHandler[t]))if(e){if(this.timeHandler[t][s]===e){delete this.timeHandler[t][s],Object.keys(this.timeHandler[t]).length||(this.timeHandler[t]=null);break}}else delete this.timeHandler[t][s];return this}atHandler(t){if(this.timeHandler[t])for(const e in this.timeHandler[t])this.timeHandler[t][e]()}every(t,e){if("function"==typeof e&&"number"==typeof t){if((t=Math.max(Math.round(t),this.MIN_TICK_RATE))>this.duration)return this;this.intervalHandler[t]||(this.intervalHandler[t]={}),this.intervalHandler[t][this.generateID()]={startStamp:Date.now(),cb:e}}return this}removeEvery(t,e){if(this.intervalHandler[t])for(const s of Object.keys(this.intervalHandler[t]))if(e){if(this.intervalHandler[t][s]===e){delete this.intervalHandler[t][s],Object.keys(this.intervalHandler[t]).length||(this.intervalHandler[t]=null);break}}else delete this.intervalHandler[t][s];return this}startAt(t){return"number"==typeof t&&this.startAtHandler(t),this}startAtHandler(t){t>=this.duration||t<=0?this.startMs=0:this.startMs=Math.max(Math.round(t),this.tickRate),this.startMs&&this.duration&&(this.duration=Math.max(this.duration-this.startMs,this.tickRate))}startHandler(){var t=Date.now();this.startStamp=t,this.currentTick=1===this.getFlow()?0:this.timeToTicks(this.duration),this.ticking=!0,this.scaledTickRate=this.tickRate/this.timeScale,this.timeoutId=setTimeout(this.adjuster,this.scaledTickRate)}startEveryHandler(){for(const e in this.intervalHandler)for(const s in this.intervalHandler[e]){const i=this.intervalHandler[e][s],r=this;this.intervalHandler[e][s].adjuster||(this.intervalHandler[e][s].adjuster=()=>{var t;r.isTicking()&&(t=Date.now(),(!i.maxCallbackCount||i.callbackCount<=i.maxCallbackCount)&&(i.cb(),i.callbackCount++,i.callbackCount===i.maxCallbackCount)?(r.canFinish=!0,r.eventHandler()):(i.expectedStamp||(i.expectedStamp=t),t-=i.expectedStamp,i.scaledTickRate=i.tickRate/r.timeScale,i.expectedStamp+=i.scaledTickRate,i.adjustedTickRate=i.scaledTickRate-t,i.timeoutId=setTimeout(i.adjuster,i.adjustedTickRate)))});var t=Number(e);this.canFinish=!1,i.tickRate=t,i.scaledTickRate=i.tickRate/this.timeScale,i.callbackCount=0,i.maxCallbackCount=0,this.hasDuration&&(i.maxCallbackCount=Math.floor(this.duration/i.tickRate)),i.timeoutId=setTimeout(i.adjuster,i.scaledTickRate)}}stopEveryHandler(){for(const t in this.intervalHandler)for(const e in this.intervalHandler[t])clearTimeout(this.intervalHandler[t][e].timeoutId)}pauseEveryHandler(){for(const t in this.intervalHandler)for(const e in this.intervalHandler[t])clearTimeout(this.intervalHandler[t][e].timeoutId),this.intervalHandler[t][e].durationBeforeexpectedStamp=this.intervalHandler[t][e].expectedStamp-self.now}resumeEveryHandler(){for(const t in this.intervalHandler)for(const e in this.intervalHandler[t])this.intervalHandler[t][e].expectedStamp=0,this.intervalHandler[t][e].timeoutId=setTimeout(this.intervalHandler[t][e].adjuster,this.intervalHandler[t][e].durationBeforeexpectedStamp)}eventHandler(){this.hasDuration&&(-1===this.flow?this.currentTick<=0&&this.canFinish&&this.rollback():this.getMs()>=this.duration&&this.canFinish&&this.complete())}tick(t){this.currentTick+=+this.flow*this.timeScale,this.trigger("tick",t),this.atHandler(this.getMs())}reverse(){return this.flow*=-1,this}start(){return this.reset(!0),this.trigger("start"),this.startHandler(),this.startEveryHandler(),this}stop(){return this.isTicking()&&(this.stopEveryHandler(),this.reset(!0),this.trigger("stop")),this}pause(){return this.isTicking()&&!this.isPaused()&&(this.pauseEveryHandler(),this.paused=!0,this.trigger("pause")),this}resume(){return this.isTicking()&&this.isPaused()&&(this.resumeEveryHandler(),this.paused=!1,this.lastStamp=0,this.expectedStamp=0,this.trigger("resume")),this}reset(t){return this.currentTick=0,this.ticking=!1,this.paused=!1,this.lastStamp=0,this.startStamp=0,this.canFinish=!0,clearInterval(this.timeoutId),t||this.trigger("reset"),this}destroy(){for(var t in clearTimeout(this.timeoutId),this.trigger("destroy"),this)this.hasOwnProperty(t)&&delete this[t];return this}increase(e){if("number"==typeof e){if(this.isTicking()){let t=this.getMs()+e;if(this.loop&&this.hasDuration)for(;t>this.duration;)this.complete(),(t-=this.duration)<=this.duration&&(this.currentTick=this.timeToTicks(t));else t>=this.duration?this.complete():this.currentTick=this.timeToTicks(t)}return this}}decrease(e){if("number"==typeof e){if(this.isTicking()){let t=this.getMs()-e;if(this.loop&&this.hasDuration)for(;t<0;)this.rollback(),0<=(t+=this.duration)&&(this.currentTick=this.timeToTicks(t));else t<=0?this.rollback():this.currentTick=this.timeToTicks(t)}return this}}complete(){return this.isTicking()&&this.hasDuration&&(this.loop||this.reset(!0),this.completionCount++,this.trigger("complete"),this.loop)&&this.start(),this}rollback(){return this.isTicking()&&this.hasDuration&&(this.loop||this.reset(!0),this.completionCount--,this.trigger("rollback"),this.loop)&&this.start(),this}}var j=D._,V={d:(t,e)=>{for(var s in e)V.o(e,s)&&!V.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},W={},q=(V.d(W,{c:()=>$}),{d:(t,e)=>{for(var s in e)q.o(e,s)&&!q.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),U={};q.d(U,{Y:()=>K});class K{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;t{if(m.transitions[a]){if(n){if(!h.info)return void(m.transitions[a]&&this.cancelTransitionColor(a));if(h.info.owner&&h.info.owner.settings.paused)return}m.transitions[a].lastTime||(m.transitions[a].lastTime=t);var e=t-m.transitions[a].lastTime,s=(m.transitions[a].timeTracker+=e,e=Math.min(m.transitions[a].timeTracker/m.transitions[a].duration,1),parseInt(m.lerp(d[0],p[0],e),10)),i=parseInt(m.lerp(d[1],p[1],e),10),r=parseInt(m.lerp(d[2],p[2],e),10),s=m.grabColor(s,i,r);u&&u(s),h&&(o?(h.color.tint=s.decimal,h.color=h.color):h.color=s.hex),1<=e||m.transitions[a].timeTracker>=l?(m.transitions[a]&&this.cancelTransitionColor(a),c&&c(s)):(m.transitions[a].req=globalThis.requestAnimationFrame(m.transitions[a].step),m.transitions[a].lastTime=t)}},this.transitions[a].req=globalThis.requestAnimationFrame(this.transitions[a].step),a}}cancelTransitionColor(t){this.transitions[t]&&(globalThis.cancelAnimationFrame(this.transitions[t].req),delete this.transitions[t])}getPointRotated(t,e,s){var i=t.x+t.width*("object"==typeof t.anchor&&t.anchor.x?t.anchor.x:.5),r=(t=t.y+t.height*("object"==typeof t.anchor&&t.anchor.y?t.anchor.y:.5),s.x-i);return s=s.y-t,{x:r*Math.cos(e)-s*-Math.sin(e)+i,y:r*-Math.sin(e)+s*Math.cos(e)+t}}getPointsOfRotatedRect(t,e){return{tl:this.getPointRotated(t,e,{x:t.x,y:t.y}),tr:this.getPointRotated(t,e,{x:t.x+t.width,y:t.y}),bl:this.getPointRotated(t,e,{x:t.x,y:t.y+t.height}),br:this.getPointRotated(t,e,{x:t.x+t.width,y:t.y+t.height}),center:this.getPointRotated(t,e,{x:t.x+t.width/2,y:t.y+t.height/2})}}calculateIconOffset(t={width:32,height:32},e={x:.5,y:.5},s={x:1,y:1}){var i=t.width*s.x,s=t.height*s.y;return{x:e.x*(i-t.width),y:e.y*(s-t.height)}}};var X=W.c,z={d:(t,e)=>{for(var s in e)z.o(e,s)&&!z.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Z={},J=(z.d(Z,{Z:()=>rt,O:()=>it}),{d:(t,e)=>{for(var s in e)J.o(e,s)&&!J.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),tt={};J.d(tt,{Y:()=>et});class et{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;t{for(var s in e)ot.o(e,s)&&!ot.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},ht={},lt=(ot.d(ht,{G:()=>mt}),{d:(t,e)=>{for(var s in e)lt.o(e,s)&&!lt.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),ut={};lt.d(ut,{Y:()=>ct});class ct{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;t{for(var s in e)gt.o(e,s)&&!gt.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},yt={};gt.d(yt,{Z:()=>Tt});class Tt{collectionWeakMap=new WeakMap;static storedIDs=[];version="1.0.0";constructor(t,e){if(Array.isArray(t)&&(this.collection=[...t],this.collection.forEach(t=>{this.collectionWeakMap.set(t,{id:this.generateID()}),this.collectionWeakMap.set(this.collectionWeakMap.get(t),{})})),"object"==typeof e&&e.constructor===Object)for(const t in e)this.attachMethod(t,e[t])}generateID(s=7){function t(){let e="";for(let t=0;t{this.collectionWeakMap.get(this.collectionWeakMap.get(t))[s]=e.bind(this)}),this[s]=function(...e){this.collection.forEach(t=>{this.collectionWeakMap.get(this.collectionWeakMap.get(t))[s](t,...e)})},this}}var Et=yt.Z;const Mt=new class{Group=Et;Tween=u;Chronos=j;StateManager=nt;State=at;resonance=x;collector=N;utils=X;pulse=ft;version="1.2.0"},_t="Core@v"+Mt.version;console.log("%c"+_t,"\n background-color: #435058;\n color: #fff;\n padding: 6px 15px;\n font-family: Arial, sans-serif;\n font-weight: bold;\n font-style: italic;\n border-left: 5px solid #dcf763;\n text-shadow: rgb(0, 0, 0) 2px 0px 0px, rgb(0, 0, 0) 1.75517px 0.958851px 0px, rgb(0, 0, 0) 1.0806px 1.68294px 0px, rgb(0, 0, 0) 0.141474px 1.99499px 0px, rgb(0, 0, 0) -0.832294px 1.81859px 0px, rgb(0, 0, 0) -1.60229px 1.19694px 0px, rgb(0, 0, 0) -1.97998px 0.28224px 0px, rgb(0, 0, 0) -1.87291px -0.701566px 0px, rgb(0, 0, 0) -1.30729px -1.5136px 0px, rgb(0, 0, 0) -0.421592px -1.95506px 0px, rgb(0, 0, 0) 0.567324px -1.91785px 0px, rgb(0, 0, 0) 1.41734px -1.41108px 0px, rgb(0, 0, 0) 1.92034px -0.558831px 0px;\n","https://github.com/EvitcaStudio/Core");var bt=e.Q;export{bt as Core}; \ No newline at end of file + var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={},s=(t.d(e,{Q:()=>Mt}),{d:(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),i={},r=(s.d(i,{k:()=>h}),{d:(t,e)=>{for(var s in e)r.o(e,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),a={};r.d(a,{Y:()=>n});class n{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;tMath.abs(Math.round(t)).toString(16).padStart(2,"0")).join("")}version="1.0.0";_build(t,e,s,i){this.start=t,this.end=e,this.duration=s,this.easing="function"==typeof i?i:h.linear,this.events={},this.exportedValues={},this.tweening=!1,this.update=null,this.paused=!1,this.lastTime=0,this.elapsed=0}build({start:t={},end:e={},duration:s=1e3,easing:i=h.linear}={}){return this._build(t,e,s,i),this}on(t,e){if("function"==typeof e)switch(t){case"start":case"end":case"pause":case"resume":this.events[t]=e;break;default:l.prefix("Tween-Module").error(`The event "${t}" is not supported.`)}else l.prefix("Tween-Module").error(`The callback for event "${t}" is not a function.`);return this}animationFrame=()=>{if(this.tweening&&!this.paused){var i,r,t=Date.now();this.lastTime||(this.lastTime=t),this.elapsed+=t-this.lastTime;let s=this.elapsed/this.duration;for(i in 1<(s=this.oscillating?(1-Math.cos(s*Math.PI))/2:s)&&(s=1),this.end){let t=this.start[i],e=this.end[i];"string"==typeof t&&(3===t.length||6===t.length)||4===t.length||7===t.length?(t=h._hexToRgb(t),e=h._hexToRgb(e),r=[this.easing(s,t[0],e[0]-t[0],1),this.easing(s,t[1],e[1]-t[1],1),this.easing(s,t[2],e[2]-t[2],1)],this.exportedValues[i]=h._rgbToHex(r)):this.exportedValues[i]=this.easing(s,t,e-t,1)}this.update(this.exportedValues),1!==s||this.oscillating?requestAnimationFrame(this.animationFrame):(this.stop(),this.events.end&&this.events.end()),this.lastTime=t}};animate(s,i=!1){if("function"!=typeof s)l.prefix("Tween-Module").error("The pUpdate parameter passed to animate is not a function.");else if(!this.tweening){let t=Object.keys(this.start),e=Object.keys(this.end);if(t.length&&e.length){if(t.every(t=>e.includes(t)))return this.update=s,this.tweening=!0,this.elapsed=0,this.oscillating=i,this.events.start&&this.events.start(),requestAnimationFrame(this.animationFrame),this;l.prefix("Tween-Module").error("The end object is missing properties that the start object has.")}else l.prefix("Tween-Module").error("The start object or the end object has no properties.")}}resume(){return this.paused&&(this.lastTime=Date.now(),this.paused=!1,this.events.resume&&this.events.resume(),requestAnimationFrame(this.animationFrame)),this}pause(){return this.paused||(this.paused=!0,this.events.pause&&this.events.pause()),this}stop(){this.tweening=!1,this.oscillating=!1,this.update=null,this.elapsed=0,this.lastTime=0,this.paused=!1;for(const t in this.exportedValues)this.exportedValues.hasOwnProperty(t)&&delete this.exportedValues[t]}}const l=new o;l.registerType("Tween-Module","#ff6600");var u=i.k,c={d:(t,e)=>{for(var s in e)c.o(e,s)&&!c.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},d={},p=(c.d(d,{P:()=>O}),{d:(t,e)=>{for(var s in e)p.o(e,s)&&!p.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),m={},f=(p.d(m,{k:()=>E}),{d:(t,e)=>{for(var s in e)f.o(e,s)&&!f.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),g={};f.d(g,{Y:()=>y});class y{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;tMath.abs(Math.round(t)).toString(16).padStart(2,"0")).join("")}version="1.0.0";_build(t,e,s,i){this.start=t,this.end=e,this.duration=s,this.easing="function"==typeof i?i:E.linear,this.events={},this.exportedValues={},this.tweening=!1,this.update=null,this.paused=!1,this.lastTime=0,this.elapsed=0}build({start:t={},end:e={},duration:s=1e3,easing:i=E.linear}={}){return this._build(t,e,s,i),this}on(t,e){if("function"==typeof e)switch(t){case"start":case"end":case"pause":case"resume":this.events[t]=e;break;default:M.prefix("Tween-Module").error(`The event "${t}" is not supported.`)}else M.prefix("Tween-Module").error(`The callback for event "${t}" is not a function.`);return this}animationFrame=()=>{if(this.tweening&&!this.paused){var i,r,t=Date.now();this.lastTime||(this.lastTime=t),this.elapsed+=t-this.lastTime;let s=this.elapsed/this.duration;for(i in 1<(s=this.oscillating?(1-Math.cos(s*Math.PI))/2:s)&&(s=1),this.end){let t=this.start[i],e=this.end[i];"string"==typeof t&&(3===t.length||6===t.length)||4===t.length||7===t.length?(t=E._hexToRgb(t),e=E._hexToRgb(e),r=[this.easing(s,t[0],e[0]-t[0],1),this.easing(s,t[1],e[1]-t[1],1),this.easing(s,t[2],e[2]-t[2],1)],this.exportedValues[i]=E._rgbToHex(r)):this.exportedValues[i]=this.easing(s,t,e-t,1)}this.update(this.exportedValues),1!==s||this.oscillating?requestAnimationFrame(this.animationFrame):(this.stop(),this.events.end&&this.events.end()),this.lastTime=t}};animate(s,i=!1){if("function"!=typeof s)M.prefix("Tween-Module").error("The pUpdate parameter passed to animate is not a function.");else if(!this.tweening){let t=Object.keys(this.start),e=Object.keys(this.end);if(t.length&&e.length){if(t.every(t=>e.includes(t)))return this.update=s,this.tweening=!0,this.elapsed=0,this.oscillating=i,this.events.start&&this.events.start(),requestAnimationFrame(this.animationFrame),this;M.prefix("Tween-Module").error("The end object is missing properties that the start object has.")}else M.prefix("Tween-Module").error("The start object or the end object has no properties.")}}resume(){return this.paused&&(this.lastTime=Date.now(),this.paused=!1,this.events.resume&&this.events.resume(),requestAnimationFrame(this.animationFrame)),this}pause(){return this.paused||(this.paused=!0,this.events.pause&&this.events.pause()),this}stop(){this.tweening=!1,this.oscillating=!1,this.update=null,this.elapsed=0,this.lastTime=0,this.paused=!1;for(const t in this.exportedValues)this.exportedValues.hasOwnProperty(t)&&delete this.exportedValues[t]}}const M=new T;M.registerType("Tween-Module","#ff6600");var _=m.k;class b{soundPath=null;startTime=null;endTime=null;save=null;duration=null;source=null;gainNode=null;loaded=!1;playAfterLoad=!1;muted=!1;state=null;startedTimeStamp=null;pausedTimeStamp=0;playUnfocused=null;fader={};events={};stopSignal=!1;_loop=!1;_playbackRate=1;_volume=100;_info={soundPath:null,duration:null};constructor(t,e,s,i,r,a,n,o){this.build(t,e,s,i,r,a,n,o)}get volume(){return this._volume}set volume(t){this._volume=O.constructor.clamp(t,O.constructor.MIN_VOLUME,O.constructor.MAX_VOLUME),this.loaded&&this.gainNode&&(this.gainNode.gain.value=O.constructor.normalize(this._volume))}on(t,e){if("function"==typeof e)switch(t){case"start":case"stop":case"end":case"pause":case"resume":this.events[t]=e;break;default:O.logger.prefix("Resonance-Module").error(`The event "${t}" is not supported.`)}else O.logger.prefix("Resonance-Module").error(`The callback for event "${t}" is not a function.`);return this}toggleMute(){if(this.loaded&&this.source)return this.muted=!this.muted,this.muted?this.gainNode&&(this.gainNode.gain.value=0):this.gainNode&&(this.gainNode.gain.value=O.constructor.normalize(this._volume)),this}get loop(){return this._loop}set loop(t){this._loop=!!t,this.source&&(this.source.loop=this._loop)}toggleLoop(){return this._loop=!this._loop,this.source&&(this.source.loop=this._loop),this}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=O.constructor.clamp(t,1,O.constructor.MAX_PLAYBACK_RATE),this.source&&(this.source.playbackRate.value=this._playbackRate)}set info(t){this._info=this._info}get info(){return this.loaded&&this.source&&(this._info.duration=this.duration),this._info.soundPath=this.soundPath,{...this._info}}build(t,e=100,s=0,i=0,r=!1,a=!1,n=1,o=!1){this.soundPath=t,this.startTime=Math.max(s,0),this.endTime=Math.max(i,0),this.save=!!o||r,this._playbackRate=O.constructor.clamp(n,1,O.constructor.MAX_PLAYBACK_RATE),this.playUnfocused=!!a,this.state=null,this._loop=!!o,this._volume=O.constructor.clamp(e,O.constructor.MIN_VOLUME,O.constructor.MAX_VOLUME),O.loadedBuffers[this.soundPath]?this.loaded=!0:this.load()}load(){const e=new XMLHttpRequest,s=this;e.open("GET",s.soundPath),e.responseType="arraybuffer",e.onload=function(){var t=e.response;O.audioCtx.decodeAudioData(t,t=>{s.loaded=!0,O.loadedBuffers[s.soundPath]=t,s.playAfterLoad&&(s.stopSignal?s.stopSignal=!1:s.play())},t=>{s.loaded=!1,O.logger.prefix("Resonance-Module").error(`Error with decoding audio data "${s.soundPath}" This sound has been killed.`),s.kill()})},e.send()}pause(){if(this.loaded)return this.stop("suspended"),this.state="suspended",this.pausedTimeStamp=O.audioCtx.currentTime-this.startedTimeStamp,O.soundsPlaying.includes(this)&&O.soundsPlaying.splice(O.soundsPlaying.indexOf(this),1),O.pausedSounds.includes(this)||O.pausedSounds.push(this),"function"==typeof this.events.pause&&this.events.pause(),this}resume(){if(this.loaded)return O.pausedSounds.includes(this)&&O.pausedSounds.splice(O.pausedSounds.indexOf(this),1),O.soundsPlaying.includes(this)||O.soundsPlaying.push(this),this.play(!0),this.state=this.fader.raf?"fading":"playing","function"==typeof this.events.resume&&this.events.resume(),this}stop(t){var e;if(this.source)return e="playing"===this.state||"fading"===this.state||"suspended"===this.state,O.soundsPlaying.includes(this)&&O.soundsPlaying.splice(O.soundsPlaying.indexOf(this),1),this.source&&(this.source.stop||(this.source.stop=this.source.noteOff),this.source.stop(),this.source.disconnect(),this.gainNode.disconnect(),this.source=null,this.gainNode=null),this.state=t||"stopped","stopped"===this.state&&e&&"function"==typeof this.events.stop&&this.events.stop(),this;this.stopSignal=!0}play(t){if(this.soundPath&&"recycled"!==this.state&&O.canPlaySound())if(this.loaded||O.loadedBuffers[this.soundPath]){if(O.focused||this.canPlayUnfocused()){this.source&&(this.source.disconnect(),this.gainNode.disconnect(),this.source=null,this.gainNode=null),O.pausedSounds.includes(this)&&O.pausedSounds.splice(O.pausedSounds.indexOf(this),1);const e=O.audioCtx.createBufferSource(),s=O.audioCtx.createGain(),i=this;return s.gain.value=O.constructor.normalize(this._volume),s.connect(O.gainNode),e.connect(s),e.buffer=O.loadedBuffers[this.soundPath],e.playbackRate.value=this._playbackRate,e.onended=function(){"stopped"===i.state&&i.save||("restart"!==i.state?"suspended"!==i.state&&("stopped"!==i.state&&"function"==typeof i.events.end&&i.events.end(),i._loop?i.play():i.save||i.kill()):i.play())},this.source=e,this.gainNode=s,this.duration=e.buffer.duration,this.playAfterLoad=null,e.start||(e.start=e.noteOn),e.start(0,this.pausedTimeStamp?this.pausedTimeStamp*this._playbackRate:this.startTime,this.endTime||this.duration),this.state="playing",this.startedTimeStamp=O.audioCtx.currentTime-(this.pausedTimeStamp||this.startTime),this.pausedTimeStamp=0,O.soundsPlaying.includes(this)||O.soundsPlaying.push(this),t||"function"!=typeof this.events.start||this.events.start(),this}O.queuedSoundsToPlay.includes(this)||O.queuedSoundsToPlay.push(this)}else this.playAfterLoad=!0}restart(){return this.stop("restart"),this}canPlayUnfocused(){return!!this.playUnfocused}kill(){if(this.wipe(),O.recycledSounds.length{for(var s in e)C.o(e,s)&&!C.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},S={};C.d(S,{Y:()=>v});class v{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;tMath.max(e,Math.min(t,s));static normalize=(t,e=0,s=100,i=1)=>(t-e)/(s-e)*i;version="1.0.0";constructor(){window.AudioContext||window.webkitAudioContext?(this.logger=new A,this.logger.registerType("Resonance-Module","#ff6600"),window.AudioContext=window.AudioContext||window.webkitAudioContext,window.addEventListener("mousedown",this.resumeAudioCtx.bind(this)),window.addEventListener("touchstart",this.resumeAudioCtx.bind(this)),window.addEventListener("load",this.resumeAudioCtx.bind(this)),window.addEventListener("blur",()=>{this.focused=!1,this.soundsPlaying.length&&this.pauseAllSounds(!0)}),window.addEventListener("focus",()=>{this.focused=!0,this.pausedSounds.length&&this.resumeAllSounds(!0),(this.queuedSoundsToPlay.length||this.queuedSoundsToFade.length)&&this.playQueuedSounds()}),this.audioCtx=new AudioContext,!this.audioCtx.createGain&&this.audioCtx.createGainNode&&(this.audioCtx.createGain=this.audioCtx.createGainNode),this.gainNode=this.audioCtx.createGain(),this.gainNode.gain.value=R.normalize(R.MAX_VOLUME),this.gainNode.connect(this.audioCtx.destination),this.soundsPlaying=[],this.pausedSounds=[],this.recycledSounds=[],this.queuedSoundsToPlay=[],this.queuedSoundsToFade=[],this.loadedBuffers={},this.fader={},this.volume=100,this.muted=!1,this.state=null,this.focused=!0,this.abilityToPlaySound=null):this.logger.prefix("Resonance-Module").error("Your device does not support window.AudioContext || window.webkitAudioContext. This library cannot be used")}canPlaySound(){return!(this.abilityToPlaySound&&!this.abilityToPlaySound())}enableChecker(t){return"function"==typeof t&&(this.abilityToPlaySound=t),this}adjustVolume(t){return this.volume=R.clamp(t,R.MIN_VOLUME,R.MAX_VOLUME),this.gainNode&&(this.gainNode.gain.value=R.normalize(this.volume)),this}fade(s=100,t=5e3,i="easeOutCubic",r){if(!isNaN(s)&&!isNaN(t)&&"fading"!==this.state){s=R.clamp(s,R.MIN_VOLUME,R.MAX_VOLUME),_[i]||this.logger.prefix("Resonance-Module").error("Invalid pEase value. Reverted to default."),this.state="fading",this.fader.duration=Math.max(t,0),this.fader.currentIteration=0,this.fader.initialValue=this.volume,this.fader.changeInValue=s-this.fader.initialValue,this.fader.totalIterations=this.fader.duration/(1e3/R.FRAME_RATE),this.fader.startStamp=null,this.fader.previousTimeStamp=null,this.fader.durationOffScreen=[0,0];const a=this,n=function(t){var e;a.focused?(null===a.fader.startStamp&&(a.fader.startStamp=t),a.adjustVolume(_[i](a.fader.currentIteration,a.fader.initialValue,a.fader.changeInValue,a.fader.totalIterations)),a.fader.durationOffScreen[1]&&(a.fader.durationOffScreen[0]+=a.fader.durationOffScreen[1],a.fader.durationOffScreen[1]=0),e=t-a.fader.durationOffScreen[0]-a.fader.startStamp,a.fader.currentIteration{n.loadedBuffers[e]=t,o.queuedToStop||h()},t=>{this.logger.prefix("Resonance-Module").error(`Error with decoding audio data "${e}"`)})},s.send()}return o}}createSound(t,e,s,i,r,a,n,o){var h;return this.recycledSounds.length?((h=this.recycledSounds.pop()).build(t,e,s,i,r,a,n,o),h):new b(t,e,s,i,r,a,n,o)}stopAllSounds(e){for(let t=this.soundsPlaying.length-1;0<=t;t--){var s=this.soundsPlaying[t];Array.isArray(e)&&e.includes(s)||s.stop()}return this}killAllSounds(){for(let t=this.soundsPlaying.length-1;0<=t;t--)this.soundsPlaying[t].kill();return this}pauseAllSounds(e){for(let t=this.soundsPlaying.length-1;0<=t;t--){var s=this.soundsPlaying[t];e&&s.canPlayUnfocused()||s.pause()}return this}resumeAllSounds(t){for(let t=this.pausedSounds.length-1;0<=t;t--)this.pausedSounds[t].resume();return this}playQueuedSounds(){for(let t=this.queuedSoundsToPlay.length-1;0<=t;t--){var e=this.queuedSoundsToPlay[t];this.queuedSoundsToPlay.splice(t,1),e.play()}for(let t=this.queuedSoundsToFade.length-1;0<=t;t--){var s=this.queuedSoundsToFade[t];this.queuedSoundsToFade.splice(t,1),s.queuedFade()}}unloadSound(t){return this.loadedBuffers[t]&&delete this.loadedBuffers[t],this}recycleSound(t){return t instanceof b&&t.kill(),this}resumeAudioCtx(){"running"!==this.audioCtx.state&&this.audioCtx.resume().then(()=>{},()=>{}),this.ready=!0}}const O=new R;var x=d.P,G={d:(t,e)=>{for(var s in e)G.o(e,s)&&!G.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},I={},P=(G.d(I,{P:()=>B}),{d:(t,e)=>{for(var s in e)P.o(e,s)&&!P.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),w={};P.d(w,{Y:()=>L});class L{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;t{var t=VYLO.newDiob(),e=t.__proto__.constructor;return VYLO.delDiob(t),e})();collectionLimit=20;static WARNING_LIMIT=200;basicCollection=[];constructor(){this.logger=new k,this.logger.registerType("Collector-Module","#ff6600")}setMaxLimit(t){"number"==typeof t&&(this.collectionLimit=Math.round(t),this.collectionLimit>B.WARNING_LIMIT)&&this.logger.prefix("Collector-Module").warn("Collector: This is a high value to use for a max limit in a collection! Only use this high of a value if you know what you are doing.")}collect(e,s){const i=Array.isArray(e);if(e)if("object"!=typeof e||i||Object.keys(e).length)if(e.type||i){if(Array.isArray(s)){if(s.includes(e))return void this.logger.prefix("Collector-Module").error("Collector: OOPS! %cpCollected","font-weight: bold","already belongs to the provided collection.");if(i&&!e.length)return void this.logger.prefix("Collector-Module").error("Collector: OOPS! %cpCollected","font-weight: bold","is an array. But it contains nothing to recycle.");if(i){if(s.length>=this.collectionLimit){for(let t=e.length-1;0<=t;t--){const i=e[t];i instanceof H.DiobConstructor?(this.cleanInstance(i),VYLO.delDiob(i)):(this.cleanInstance(i),VYLO.delObject(i))}return}if(e.length+s.length>this.collectionLimit)for(let t=e.length-(this.collectionLimit-s.length);0=this.collectionLimit?void(e instanceof H.DiobConstructor?(this.cleanInstance(e),VYLO.delDiob(e)):(this.cleanInstance(e),VYLO.delObject(e))):("function"==typeof e.onCollected&&e.onCollected(),s.includes(e)||s.push(e),void this.cleanInstance(e))}this.logger.prefix("Collector-Module").error("Collector: Invalid variable type passed for the %cpCollection","font-weight: bold","parameter. Expecting an array. Collect failed.")}else this.logger.prefix("Collector-Module").error("Collector: OOPS! %cpCollected","font-weight: bold"," is not a valid object It has no type.");else this.logger.prefix("Collector-Module").error("Collector: OOPS! %cpCollected","font-weight: bold"," is an empty object and will NOT be collected.");else this.logger.prefix("Collector-Module").error("Collector: There was nothing passed for the %cpCollected","font-weight: bold","parameter. Expecting a instance or an object.")}isInCollection(e="Diob",s=1,i=[],...r){var a,n=[];let o=0,h=s,l=!VYLO.Type.getVariable(e,"baseType");if(i.length){for(let t=i.length-1;0<=t;t--)h&&(a=i[t]).type===e&&(i.splice(t,1),n.push(a),a.collectorCollected=!1,"function"==typeof a.onDumped&&a.onDumped(...r),o++,h--);if(s>o){const i=s-o;for(let t=0;t{for(var s in e)F.o(e,s)&&!F.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},D={};F.d(D,{_:()=>Y});class Y{MIN_TICK_RATE=10;timeScale=1;flow=1;startMs=0;startStamp=0;currentTick=0;tickRate=10;scaledTickRate=1;lastStamp=0;expectedStamp=0;canFinish=!0;deltaTime=0;duration=1/0;loop=!1;hasDuration=!1;completionCount=0;acceptedEvents=["tick","complete","rollback","destroy","pause","resume","start","stop","reset"];onHandler={};timeHandler={};intervalHandler={};ticking=!1;paused=!1;storedIDs=[];timeoutId=0;constructor(t){if("object"!=typeof t||Array.isArray(t)||null===t||("number"==typeof t.duration&&(this.duration=Math.max(Math.round(t.duration),this.tickRate),this.hasDuration=!0),"number"==typeof t.startAt&&this.startAtHandler(t.startAt),"number"==typeof t.flow&&(this.flow=this.clamp(t.flow,-1,1)),"number"==typeof t.tickRate&&(this.tickRate=Math.max(Math.round(t.tickRate),this.MIN_TICK_RATE)),"number"==typeof t.completionCount&&(this.completionCount=Math.round(t.completionCount)),"number"==typeof t.timeScale&&(this.timeScale=t.timeScale),this.loop=!!t.loop),globalThis.document){let t,e;void 0!==document.hidden?(t="hidden",e="visibilitychange"):void 0!==document.msHidden?(t="msHidden",e="msvisibilitychange"):void 0!==document.webkitHidden&&(t="webkitHidden",e="webkitvisibilitychange"),document.addEventListener(e,()=>{document[t]?this.pause():this.resume()},!1)}const s=this;s.adjuster=()=>{var t,e;s.isTicking()&&(t=Date.now(),s.lastStamp||(s.lastStamp=t),s.expectedStamp||(s.expectedStamp=t),e=t-s.lastStamp,s.deltaTime=e/1e3,s.scaledTickRate=s.tickRate/this.timeScale,e=this.clamp(t-s.expectedStamp,0,this.scaledTickRate),s.expectedStamp=t+s.scaledTickRate,s.adjustedTickRate=s.scaledTickRate-e,s.timeoutId=setTimeout(s.adjuster,s.adjustedTickRate),s.isPaused()||(s.now=t,s.tick(s.deltaTime),s.eventHandler()),s.lastStamp=t)}}getTimeScale(){return this.timeScale}getStartStamp(){return this.startStamp}getDeltaTime(){return this.deltaTime}getMs(){return this.ticksToTime(this.currentTick)}getCurrentTick(){return this.currentTick}getCompletionCount(){return this.completionCount}getFlow(){return this.flow}getDuration(){return this.duration}setDuration(t){return"number"==typeof t&&(t=Math.round(t),this.duration=t,this.startAt(this.startMs)),this}getPercentage(){return this.hasDuration?100*this.getMs()/this.duration:0}getMsFromSeconds(t=0){if("number"==typeof t)return 1e3*t}getSecondsFromMs(t=0){if("number"==typeof t)return t/1e3}ticksToTime(t){if("number"==typeof t)return this.clamp(t*this.tickRate,0,this.duration)}timeToTicks(t){if("number"==typeof t)return t/this.tickRate}isTicking(){return this.ticking}isPaused(){return this.paused}clamp(t,e,s){return Math.max(e,Math.min(t,s))}generateID(s=7){function t(){let e="";for(let t=0;tthis.duration)return this;this.timeHandler[t]||(this.timeHandler[t]={}),this.timeHandler[t][this.generateID()]=e}return this}removeAt(t,e){if(this.timeHandler[t])for(const s of Object.keys(this.timeHandler[t]))if(e){if(this.timeHandler[t][s]===e){delete this.timeHandler[t][s],Object.keys(this.timeHandler[t]).length||(this.timeHandler[t]=null);break}}else delete this.timeHandler[t][s];return this}atHandler(t){if(this.timeHandler[t])for(const e in this.timeHandler[t])this.timeHandler[t][e]()}every(t,e){if("function"==typeof e&&"number"==typeof t){if((t=Math.max(Math.round(t),this.MIN_TICK_RATE))>this.duration)return this;this.intervalHandler[t]||(this.intervalHandler[t]={}),this.intervalHandler[t][this.generateID()]={startStamp:Date.now(),cb:e}}return this}removeEvery(t,e){if(this.intervalHandler[t])for(const s of Object.keys(this.intervalHandler[t]))if(e){if(this.intervalHandler[t][s]===e){delete this.intervalHandler[t][s],Object.keys(this.intervalHandler[t]).length||(this.intervalHandler[t]=null);break}}else delete this.intervalHandler[t][s];return this}startAt(t){return"number"==typeof t&&this.startAtHandler(t),this}startAtHandler(t){t>=this.duration||t<=0?this.startMs=0:this.startMs=Math.max(Math.round(t),this.tickRate),this.startMs&&this.duration&&(this.duration=Math.max(this.duration-this.startMs,this.tickRate))}startHandler(){var t=Date.now();this.startStamp=t,this.currentTick=1===this.getFlow()?0:this.timeToTicks(this.duration),this.ticking=!0,this.scaledTickRate=this.tickRate/this.timeScale,this.timeoutId=setTimeout(this.adjuster,this.scaledTickRate)}startEveryHandler(){for(const e in this.intervalHandler)for(const s in this.intervalHandler[e]){const i=this.intervalHandler[e][s],r=this;this.intervalHandler[e][s].adjuster||(this.intervalHandler[e][s].adjuster=()=>{var t;r.isTicking()&&(t=Date.now(),(!i.maxCallbackCount||i.callbackCount<=i.maxCallbackCount)&&(i.cb(),i.callbackCount++,i.callbackCount===i.maxCallbackCount)?(r.canFinish=!0,r.eventHandler()):(i.expectedStamp||(i.expectedStamp=t),t-=i.expectedStamp,i.scaledTickRate=i.tickRate/r.timeScale,i.expectedStamp+=i.scaledTickRate,i.adjustedTickRate=i.scaledTickRate-t,i.timeoutId=setTimeout(i.adjuster,i.adjustedTickRate)))});var t=Number(e);this.canFinish=!1,i.tickRate=t,i.scaledTickRate=i.tickRate/this.timeScale,i.callbackCount=0,i.maxCallbackCount=0,this.hasDuration&&(i.maxCallbackCount=Math.floor(this.duration/i.tickRate)),i.timeoutId=setTimeout(i.adjuster,i.scaledTickRate)}}stopEveryHandler(){for(const t in this.intervalHandler)for(const e in this.intervalHandler[t])clearTimeout(this.intervalHandler[t][e].timeoutId)}pauseEveryHandler(){for(const t in this.intervalHandler)for(const e in this.intervalHandler[t])clearTimeout(this.intervalHandler[t][e].timeoutId),this.intervalHandler[t][e].durationBeforeexpectedStamp=this.intervalHandler[t][e].expectedStamp-self.now}resumeEveryHandler(){for(const t in this.intervalHandler)for(const e in this.intervalHandler[t])this.intervalHandler[t][e].expectedStamp=0,this.intervalHandler[t][e].timeoutId=setTimeout(this.intervalHandler[t][e].adjuster,this.intervalHandler[t][e].durationBeforeexpectedStamp)}eventHandler(){this.hasDuration&&(-1===this.flow?this.currentTick<=0&&this.canFinish&&this.rollback():this.getMs()>=this.duration&&this.canFinish&&this.complete())}tick(t){this.currentTick+=+this.flow*this.timeScale,this.trigger("tick",t),this.atHandler(this.getMs())}reverse(){return this.flow*=-1,this}start(){return this.reset(!0),this.trigger("start"),this.startHandler(),this.startEveryHandler(),this}stop(){return this.isTicking()&&(this.stopEveryHandler(),this.reset(!0),this.trigger("stop")),this}pause(){return this.isTicking()&&!this.isPaused()&&(this.pauseEveryHandler(),this.paused=!0,this.trigger("pause")),this}resume(){return this.isTicking()&&this.isPaused()&&(this.resumeEveryHandler(),this.paused=!1,this.lastStamp=0,this.expectedStamp=0,this.trigger("resume")),this}reset(t){return this.currentTick=0,this.ticking=!1,this.paused=!1,this.lastStamp=0,this.startStamp=0,this.canFinish=!0,clearInterval(this.timeoutId),t||this.trigger("reset"),this}destroy(){for(var t in clearTimeout(this.timeoutId),this.trigger("destroy"),this)this.hasOwnProperty(t)&&delete this[t];return this}increase(e){if("number"==typeof e){if(this.isTicking()){let t=this.getMs()+e;if(this.loop&&this.hasDuration)for(;t>this.duration;)this.complete(),(t-=this.duration)<=this.duration&&(this.currentTick=this.timeToTicks(t));else t>=this.duration?this.complete():this.currentTick=this.timeToTicks(t)}return this}}decrease(e){if("number"==typeof e){if(this.isTicking()){let t=this.getMs()-e;if(this.loop&&this.hasDuration)for(;t<0;)this.rollback(),0<=(t+=this.duration)&&(this.currentTick=this.timeToTicks(t));else t<=0?this.rollback():this.currentTick=this.timeToTicks(t)}return this}}complete(){return this.isTicking()&&this.hasDuration&&(this.loop||this.reset(!0),this.completionCount++,this.trigger("complete"),this.loop)&&this.start(),this}rollback(){return this.isTicking()&&this.hasDuration&&(this.loop||this.reset(!0),this.completionCount--,this.trigger("rollback"),this.loop)&&this.start(),this}}var j=D._,V={d:(t,e)=>{for(var s in e)V.o(e,s)&&!V.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},W={},q=(V.d(W,{c:()=>$}),{d:(t,e)=>{for(var s in e)q.o(e,s)&&!q.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),U={};q.d(U,{Y:()=>K});class K{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;t{if(m.transitions[a]){if(n){if(!h.info)return void(m.transitions[a]&&this.cancelTransitionColor(a));if(h.info.owner&&h.info.owner.settings.paused)return}m.transitions[a].lastTime||(m.transitions[a].lastTime=t);var e=t-m.transitions[a].lastTime,s=(m.transitions[a].timeTracker+=e,e=Math.min(m.transitions[a].timeTracker/m.transitions[a].duration,1),parseInt(m.lerp(d[0],p[0],e),10)),i=parseInt(m.lerp(d[1],p[1],e),10),r=parseInt(m.lerp(d[2],p[2],e),10),s=m.grabColor(s,i,r);u&&u(s),h&&(o?(h.color.tint=s.decimal,h.color=h.color):h.color=s.hex),1<=e||m.transitions[a].timeTracker>=l?(m.transitions[a]&&this.cancelTransitionColor(a),c&&c(s)):(m.transitions[a].req=globalThis.requestAnimationFrame(m.transitions[a].step),m.transitions[a].lastTime=t)}},this.transitions[a].req=globalThis.requestAnimationFrame(this.transitions[a].step),a}}cancelTransitionColor(t){this.transitions[t]&&(globalThis.cancelAnimationFrame(this.transitions[t].req),delete this.transitions[t])}getPointRotated(t,e,s){var i=t.x+t.width*("object"==typeof t.anchor&&t.anchor.x?t.anchor.x:.5),r=(t=t.y+t.height*("object"==typeof t.anchor&&t.anchor.y?t.anchor.y:.5),s.x-i);return s=s.y-t,{x:r*Math.cos(e)-s*-Math.sin(e)+i,y:r*-Math.sin(e)+s*Math.cos(e)+t}}getPointsOfRotatedRect(t,e){return{tl:this.getPointRotated(t,e,{x:t.x,y:t.y}),tr:this.getPointRotated(t,e,{x:t.x+t.width,y:t.y}),bl:this.getPointRotated(t,e,{x:t.x,y:t.y+t.height}),br:this.getPointRotated(t,e,{x:t.x+t.width,y:t.y+t.height}),center:this.getPointRotated(t,e,{x:t.x+t.width/2,y:t.y+t.height/2})}}calculateIconOffset(t={width:32,height:32},e={x:.5,y:.5},s={x:1,y:1}){var i=t.width*s.x,s=t.height*s.y;return{x:e.x*(i-t.width),y:e.y*(s-t.height)}}};var X=W.c,z={d:(t,e)=>{for(var s in e)z.o(e,s)&&!z.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Z={},J=(z.d(Z,{Z:()=>rt,O:()=>it}),{d:(t,e)=>{for(var s in e)J.o(e,s)&&!J.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),tt={};J.d(tt,{Y:()=>et});class et{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;t{for(var s in e)ot.o(e,s)&&!ot.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},ht={},lt=(ot.d(ht,{G:()=>mt}),{d:(t,e)=>{for(var s in e)lt.o(e,s)&&!lt.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)}),ut={};lt.d(ut,{Y:()=>ct});class ct{constructor(t){this.RESET="",this.BRIGHT="",this.DIM="",this.UNDERSCORE="",this.BLINK="",this.REVERSE="",this.HIDDEN="",this.FG_BLACK="",this.FG_RED="",this.FG_GREEN="",this.FG_YELLOW="",this.FG_BLUE="",this.FG_MAGENTA="",this.FG_CYAN="",this.FG_WHITE="",this.FG_GRAY="",this.BG_BLACK="",this.BG_RED="",this.BG_GREEN="",this.BG_YELLOW="",this.BG_BLUE="",this.BG_MAGENTA="",this.BG_CYAN="",this.BG_WHITE="",this.BG_GRAY="",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let t=0;t<=255;t++)this.FG_COLORS[t]="[38;5;"+t+"m";this.BG_COLORS={};for(let t=0;t<=255;t++)this.BG_COLORS[t]="[48;5;"+t+"m";Array.isArray(t)&&this.registerTypes(t)}prefix(t){return"string"==typeof t&&(this.currentType=t),this}message(e="log",...s){var i=this.currentType||"";if(0===i.length)console[e](...s);else{var r=i.length>=this.TYPE_SPACER_LENGTH;let t=this.types[i.toLowerCase()]?this.types[i.toLowerCase()]:this.types.default;var a=t.includes("");a||(t="color: "+t),!globalThis.window||a?console[e](t+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|"+this.RESET,...s):console[e]("%c"+i+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-i.length,r?1:0))+"|",t,...s)}this.currentType=""}log(...t){this.message("log",...t)}info(...t){this.message("info",...t)}error(...t){this.message("error",...t)}warn(...t){this.message("warn",...t)}assert(...t){console.assert(...t)}debug(...t){this.message("debug",...t)}count(t){console.count(t)}countReset(t){console.countReset(t)}table(t,e){console.table(t,e)}time(t){this.message("time",t)}timeLog(t){this.message("timeLog",t)}timeEnd(t){this.message("timeEnd",t)}trace(...t){this.message("trace",...t)}group(t){this.message("group",t)}groupCollapsed(t){console.groupCollapsed(t)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(t,e){this.types[t]||"string"==typeof t&&"string"==typeof e&&(this.types[t.toLowerCase()]=e)}registerTypes(e){if(Array.isArray(e))for(let t=0;t{for(var s in e)gt.o(e,s)&&!gt.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},yt={};gt.d(yt,{Z:()=>Tt});class Tt{collectionWeakMap=new WeakMap;static storedIDs=[];version="1.0.0";constructor(t,e){if(Array.isArray(t)&&(this.collection=[...t],this.collection.forEach(t=>{this.collectionWeakMap.set(t,{id:this.generateID()}),this.collectionWeakMap.set(this.collectionWeakMap.get(t),{})})),"object"==typeof e&&e.constructor===Object)for(const t in e)this.attachMethod(t,e[t])}generateID(s=7){function t(){let e="";for(let t=0;t{this.collectionWeakMap.get(this.collectionWeakMap.get(t))[s]=e.bind(this)}),this[s]=function(...e){this.collection.forEach(t=>{this.collectionWeakMap.get(this.collectionWeakMap.get(t))[s](t,...e)})},this}}var Et=yt.Z;const Mt=new class{Group=Et;Tween=u;Chronos=j;StateManager=nt;State=at;resonance=x;collector=N;utils=X;pulse=ft;version="1.5.0"},_t="Core@v"+Mt.version;console.log("%c"+_t,"\n background-color: #435058;\n color: #fff;\n padding: 6px 15px;\n font-family: Arial, sans-serif;\n font-weight: bold;\n font-style: italic;\n border-left: 5px solid #dcf763;\n text-shadow: rgb(0, 0, 0) 2px 0px 0px, rgb(0, 0, 0) 1.75517px 0.958851px 0px, rgb(0, 0, 0) 1.0806px 1.68294px 0px, rgb(0, 0, 0) 0.141474px 1.99499px 0px, rgb(0, 0, 0) -0.832294px 1.81859px 0px, rgb(0, 0, 0) -1.60229px 1.19694px 0px, rgb(0, 0, 0) -1.97998px 0.28224px 0px, rgb(0, 0, 0) -1.87291px -0.701566px 0px, rgb(0, 0, 0) -1.30729px -1.5136px 0px, rgb(0, 0, 0) -0.421592px -1.95506px 0px, rgb(0, 0, 0) 0.567324px -1.91785px 0px, rgb(0, 0, 0) 1.41734px -1.41108px 0px, rgb(0, 0, 0) 1.92034px -0.558831px 0px;\n","https://github.com/EvitcaStudio/Core");var bt=e.Q;export{bt as Core}; \ No newline at end of file diff --git a/package.json b/package.json index b97dd61..6aaad7d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "core", - "version": "1.2.0", + "version": "1.5.0", "description": "The Core module is a versatile collection of specialized modules designed to enhance the game development experience.", "main": "dist/core.min.mjs", "scripts": { diff --git a/src/submodules/Resonance b/src/submodules/Resonance index da95497..8f9858c 160000 --- a/src/submodules/Resonance +++ b/src/submodules/Resonance @@ -1 +1 @@ -Subproject commit da954978c1ccb44c07a936c4948bf56cab0bab3b +Subproject commit 8f9858cda19673654d40cba5a83de06ef88cbb17 diff --git a/src/submodules/Utils b/src/submodules/Utils index 8435ee5..c293e2a 160000 --- a/src/submodules/Utils +++ b/src/submodules/Utils @@ -1 +1 @@ -Subproject commit 8435ee53d22532cd380d139cac9d1379d0b97fe6 +Subproject commit c293e2a8bb5e62bc02d7c43e9527bcfaba875e88