diff --git a/assets/workers/814.ffmpeg.js b/assets/workers/814.ffmpeg.js new file mode 100644 index 0000000..47e0fcd --- /dev/null +++ b/assets/workers/814.ffmpeg.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FFmpegWASM=t():e.FFmpegWASM=t()}(self,(()=>(()=>{"use strict";const e="https://unpkg.com/@ffmpeg/core@0.12.6/dist/umd/ffmpeg-core.js";var t;!function(e){e.LOAD="LOAD",e.EXEC="EXEC",e.WRITE_FILE="WRITE_FILE",e.READ_FILE="READ_FILE",e.DELETE_FILE="DELETE_FILE",e.RENAME="RENAME",e.CREATE_DIR="CREATE_DIR",e.LIST_DIR="LIST_DIR",e.DELETE_DIR="DELETE_DIR",e.ERROR="ERROR",e.DOWNLOAD="DOWNLOAD",e.PROGRESS="PROGRESS",e.LOG="LOG",e.MOUNT="MOUNT",e.UNMOUNT="UNMOUNT"}(t||(t={}));const r=new Error("unknown message type"),a=new Error("ffmpeg is not loaded, call `await ffmpeg.load()` first"),s=(new Error("called FFmpeg.terminate()"),new Error("failed to import ffmpeg-core.js"));let o;return self.onmessage=async({data:{id:n,type:E,data:c}})=>{const i=[];let p;try{if(E!==t.LOAD&&!o)throw a;switch(E){case t.LOAD:p=await(async({coreURL:r,wasmURL:a,workerURL:n})=>{const E=!o;try{r||(r=e),importScripts(r)}catch{if(r||(r=e.replace("/umd/","/esm/")),self.createFFmpegCore=(await import(r)).default,!self.createFFmpegCore)throw s}const c=r,i=a||r.replace(/.js$/g,".wasm"),p=n||r.replace(/.js$/g,".worker.js");return o=await self.createFFmpegCore({mainScriptUrlOrBlob:`${c}#${btoa(JSON.stringify({wasmURL:i,workerURL:p}))}`}),o.setLogger((e=>self.postMessage({type:t.LOG,data:e}))),o.setProgress((e=>self.postMessage({type:t.PROGRESS,data:e}))),E})(c);break;case t.EXEC:p=(({args:e,timeout:t=-1})=>{o.setTimeout(t),o.exec(...e);const r=o.ret;return o.reset(),r})(c);break;case t.WRITE_FILE:p=(({path:e,data:t})=>(o.FS.writeFile(e,t),!0))(c);break;case t.READ_FILE:p=(({path:e,encoding:t})=>o.FS.readFile(e,{encoding:t}))(c);break;case t.DELETE_FILE:p=(({path:e})=>(o.FS.unlink(e),!0))(c);break;case t.RENAME:p=(({oldPath:e,newPath:t})=>(o.FS.rename(e,t),!0))(c);break;case t.CREATE_DIR:p=(({path:e})=>(o.FS.mkdir(e),!0))(c);break;case t.LIST_DIR:p=(({path:e})=>{const t=o.FS.readdir(e),r=[];for(const a of t){const t=o.FS.stat(`${e}/${a}`),s=o.FS.isDir(t.mode);r.push({name:a,isDir:s})}return r})(c);break;case t.DELETE_DIR:p=(({path:e})=>(o.FS.rmdir(e),!0))(c);break;case t.MOUNT:p=(({fsType:e,options:t,mountPoint:r})=>{const a=e,s=o.FS.filesystems[a];return!!s&&(o.FS.mount(s,t,r),!0)})(c);break;case t.UNMOUNT:p=(({mountPoint:e})=>(o.FS.unmount(e),!0))(c);break;default:throw r}}catch(e){return void self.postMessage({id:n,type:t.ERROR,data:e.toString()})}p instanceof Uint8Array&&i.push(p.buffer),self.postMessage({id:n,type:E,data:p},i)},{}})())); \ No newline at end of file diff --git a/game.07fbc92e96183851a74d.js b/game.07fbc92e96183851a74d.js deleted file mode 100644 index b0e9fa9..0000000 --- a/game.07fbc92e96183851a74d.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(){"use strict";var e,t={65918:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MapAudio=t.Audio=void 0;const n=i(20825);class s{audio;source;mediaSource;mediaAudioElement;id;get isPaused(){return!!this._useMediaSource&&this.mediaAudioElement.paused}get isPlaying(){return!this._useMediaSource||!this.mediaAudioElement.paused}nodes=[];tempArrayMain=new Float32Array(256);tempArrayL=new Float32Array(64);tempArrayR=new Float32Array(64);LeftChannel=0;RightChannel=0;FrequencyAmplitudes=new Float32Array(256);_connectedToContext=!1;_useMediaSource=!1;_onEndCallback;timeStarted=0;paused=!1;GetMaximumAudioLevel(){return Math.max(this.LeftChannel,this.RightChannel)}GetAverageAudioLevel(){return(this.LeftChannel+this.RightChannel)/2}Create(e,t){if(this._useMediaSource=t||!1,t){if(!this.mediaAudioElement)throw new Error("HTML Audio Element was not initialized!");this.mediaSource=e.createMediaElementSource(this.mediaAudioElement),this.mediaAudioElement.onpause=()=>{this.paused||this.mediaAudioElement.ended||this.Play()}}else this.source=e.createBufferSource(),this.source.buffer=this.audio}AddAudioNode(e){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");this.nodes.push(e)}GetNode(e){let t=this.nodes.filter((t=>t instanceof e));return t.length>0?t:null}ConnectToContext(e,t){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");this._connectedToContext||(this._connectedToContext=!0,this.nodes.length>0?t?t(this.nodes,this._useMediaSource?this.mediaSource:this.source):this.nodes.forEach(((t,i)=>{this.source.connect(t),t instanceof AnalyserNode||t.connect(e.destination)})):this._useMediaSource?this.mediaSource.connect(e.destination):this.source.connect(e.destination))}Play(){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");this.paused=!1,this._useMediaSource?this.mediaAudioElement.play():this.source.start()}Pause(){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");if(!this._useMediaSource)throw new Error("Pause is not supported on AudioSourceBuffer!");this.paused=!0,this.mediaAudioElement.pause()}Stop(){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");this.paused=!0,this._useMediaSource?(this.mediaAudioElement.pause(),this._onEndCallback&&this._onEndCallback()):this.source.stop()}SetTime(e){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");if(!this._useMediaSource)throw new Error("SetTime is not supported on AudioSourceBuffer!");this.mediaAudioElement.currentTime=e/1e3}GetDuration(){return this._useMediaSource?1e3*this.mediaAudioElement.duration:this.audio.duration}GetCurrentTime(){return this._useMediaSource?1e3*this.mediaAudioElement.currentTime:0!=this.timeStarted?Date.now()-this.timeStarted:0}RegisterEndCallBack(e){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");this._onEndCallback=e,this._useMediaSource?this.mediaAudioElement.onended=()=>{this.paused=!0,e()}:this.source.onended=()=>{this.isPaused||(this.paused=!0,e())}}}t.Audio=s;t.MapAudio=class extends s{beatmap;fadingOut=!1;fadeOutTimeout;playingCallback;FadeOut(){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");if(!this._useMediaSource)throw new Error("FadeOut is not supported on AudioSourceBuffer!");if(this.fadingOut)return;this.fadingOut=!0,clearTimeout(this.fadeOutTimeout);let e=this.GetNode(GainNode);if(null==e)throw new Error("Gain Node doesn't exist on Audio Object!");e[0].gain.linearRampToValueAtTime(0,n.Main.AudioEngine.audioContext.currentTime+1),setTimeout((()=>{this.Stop()}),1e3)}}},85437:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.AudioEngine=void 0;const n=i(14981),s=i(65918),o=i(17898),a=i(20825),r=i(87816),l=i(22331);t.AudioEngine=class{audioContext;_playingAudios;_musicQueue=[];_audioIdTicker=0;_changeCallbacks=[];silentMusic=this.createSilentMusic();useSilentMusic=!0;constructor(){this.audioContext=new AudioContext,this._playingAudios=new n.PlayingAudios,a.Main.app.ticker.add((()=>{this.update()}))}UpdateMusicQueue(){this._musicQueue[0]&&(this._musicQueue[0].fadingOut||0!=this._musicQueue[0].GetCurrentTime()||(this._play(this._musicQueue[0]),this._changeCallbacks.forEach((e=>e(this._musicQueue[0])))),this._musicQueue[0].fadingOut&&this._musicQueue[1]&&this._musicQueue[1]&&(this._play(this._musicQueue[1]),this._changeCallbacks.forEach((e=>e(this._musicQueue[1]))))),this._musicQueue.length>=1?this.useSilentMusic=!1:(this.silentMusic=this.createSilentMusic(),this.useSilentMusic=!0)}createSilentMusic(){let e=new s.MapAudio;e.timeStarted=Date.now(),e.beatmap=new o.BeatmapData;let t=new r.UnInheritedTimingPoint;return t.time=0,t.beatLength=1e3,t.effects=l.Effect.None,e.beatmap.TimingPoints.TimingPoints.push(t),e}addMusicChangeEventListener(e){this._changeCallbacks.push(e)}removeMusicChangeEventListener(e){this._changeCallbacks=this._changeCallbacks.filter((t=>t!=e))}GetCurrentPlayingMusic(){return this.useSilentMusic?this.silentMusic:this._musicQueue[0]}GetCurrentPlayingMusicNoSilent(){return this._musicQueue[0]}PlayEffect(e,t){let i=new s.Audio;i.audio=e,i.id=this._audioIdTicker,this._play(i,t),this._audioIdTicker++}AddToMusicQueue(e,t,i){let n=new s.MapAudio;return n.mediaAudioElement=document.createElement("audio"),n.mediaAudioElement.src=e,n.beatmap=t,n.id=this._audioIdTicker,i&&(n.playingCallback=i),this._musicQueue.push(n),this._audioIdTicker++,this.UpdateMusicQueue(),n.id}PlayMusicImmediately(e,t,i){let n=this.GetCurrentPlayingMusicNoSilent();this._musicQueue=[],n&&n.FadeOut(),this.AddToMusicQueue(e,t,i)}update(){let e=this.GetCurrentPlayingMusic(),t=this.GetCurrentPlayingMusicNoSilent();if(t)if(t.isPaused)this.useSilentMusic=!0;else if(this.useSilentMusic&&(this.useSilentMusic=!1,e=this.GetCurrentPlayingMusic()),!this.useSilentMusic){let t=e.GetNode(AnalyserNode)[0],i=e.GetNode(AnalyserNode)[1],n=e.GetNode(AnalyserNode)[2];t.getFloatFrequencyData(e.tempArrayMain);for(let t=0;t{s+=(e+1)/2})),e.tempArrayR.forEach((e=>{o+=(e+1)/2})),s/=e.tempArrayL.length,o/=e.tempArrayR.length,e.LeftChannel=s,e.RightChannel=o}}_play(e,t){if("beatmap"in e&&e.beatmap){e.Create(this.audioContext,!0);let t=this.audioContext.createGain();t.gain.value=0;let i=this.audioContext.createAnalyser();i.fftSize=512,i.smoothingTimeConstant=0;let n=this.audioContext.createChannelSplitter(2),s=this.audioContext.createAnalyser();s.smoothingTimeConstant=0,s.fftSize=128;let o=this.audioContext.createAnalyser();o.smoothingTimeConstant=0,o.fftSize=128,e.AddAudioNode(t),e.AddAudioNode(i),e.AddAudioNode(s),e.AddAudioNode(o),e.ConnectToContext(this.audioContext,((e,a)=>{a.connect(t),t.connect(this.audioContext.destination),a.connect(i),a.connect(n),n.connect(s,0),n.connect(o,1)})),e.Play(),this._playingAudios.audios.push(e),e.playingCallback&&e.playingCallback();let a=Date.now();e.mediaAudioElement.onloadedmetadata=()=>{e.fadeOutTimeout=setTimeout((()=>{t.gain.linearRampToValueAtTime(0,this.audioContext.currentTime+1)}),Math.max(0,1e3*(e.mediaAudioElement.duration-1)-(Date.now()-a)))},t.gain.linearRampToValueAtTime(1,this.audioContext.currentTime+.5)}else e.Create(this.audioContext,!1),e.ConnectToContext(this.audioContext),t&&e.source&&(e.source.playbackRate.value=t),e.Play(),this._playingAudios.audios.push(e);e.RegisterEndCallBack((()=>{"beatmap"in e&&e.beatmap&&(this._musicQueue[0]==e&&this._musicQueue.splice(0,1),this.UpdateMusicQueue()),this._playingAudios.audios.forEach(((t,i)=>{t!==e||this._playingAudios.audios.splice(i,1)}))}))}}},14981:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PlayingAudios=void 0;t.PlayingAudios=class{audios=[]}},9611:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LogoVisualizer=void 0;const a=i(20825),r=o(i(58687)),l=i(5825),u=i(22331);class c extends r.Container{static size=900;frequencyAmplitudes=new Float32Array(256);audio;temporalAmplitudes=new Float32Array(256);graphics=new r.Graphics;index_change=5;bar_length=600;bars_per_visualiser=200;visualiser_rounds=5;decay_per_millisecond=.0024;time_between_updates=50;amplitude_dead_zone=1/this.bar_length;indexOffset=0;firstDraw=!0;set alpha(e){super.alpha=.2*e}get alpha(){return 5*super.alpha}constructor(){super(),this.alpha=1}start(){this.graphics.blendMode="add",this.addChild(this.graphics),this.graphics.eventMode="none",this.eventMode="none",setInterval((()=>{this.updateAmplitudes()}),this.time_between_updates)}draw(e){if(this.firstDraw)for(let e=0;ethis.frequencyAmplitudes[e]&&(this.frequencyAmplitudes[e]=i)}this.indexOffset=(this.indexOffset+this.index_change)%this.bars_per_visualiser}}t.LogoVisualizer=c},8211:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MenuLogoVisualizer=void 0;const n=i(9611);class s extends n.LogoVisualizer{draw(e){super.draw(e)}}t.MenuLogoVisualizer=s},49323:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LoadAnim=void 0;const a=o(i(58687)),r=o(i(29172)),l=i(92915);class u extends a.Container{bg;arc;arcContainer;animInterval;container;bgContainer;bgRotation=0;constructor(e,t){super(),this.pivot.set(.5,.5),this.container=new a.Container,this.container.alpha=0,this.rotation=2.5*Math.PI,this.bgContainer=new a.Container,this.bg=new a.Graphics,this.bg.roundRect(-50,-50,100,100,25),this.bg.fill(e),this.arcContainer=new a.Container,this.arc=new a.Graphics,this.arc.arc(0,0,27,Math.PI+.26,2.92*Math.PI),this.arc.stroke({width:8,color:t,cap:"round"}),this.arc.scale.set(-1,1),this.container.scale.set(.5,.5),this.bgContainer.addChild(this.bg),this.arcContainer.addChild(this.arc),this.bgContainer.addChild(this.arcContainer),this.container.addChild(this.bgContainer),this.addChild(this.container),l.Ease.getEase(this.container).ScaleTo(1,400,r.Easing.Quadratic.InOut).FadeIn(400,r.Easing.Quadratic.InOut),this.doAnims(),this.animInterval=setInterval((()=>{this.doAnims()}),800)}doAnims(){this.bgRotation+=90,l.Ease.getEase(this.bgContainer).createTween({value:this.bgContainer.angle},{value:this.bgRotation},!0,"angle",600,r.Easing.Quadratic.InOut)}getWidth(){return 100*this.scale.x}getHeight(){return 100*this.scale.y}draw(e){this.arcContainer.angle+=3*e.deltaTime}destroy(e){l.Ease.getEase(this.container).FadeOut(400,r.Easing.Quadratic.InOut).ScaleTo(.5,400,r.Easing.Quadratic.InOut),setTimeout((()=>{clearInterval(this.animInterval),super.destroy(e)}),400)}}t.LoadAnim=u},70723:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ButtonSystem=void 0;const a=o(i(58687)),r=o(i(29172)),l=i(92915),u=i(84283),c=i(57853);class d extends a.Container{menuBG=new a.Graphics;isOpened=!1;logo;state=h.Initial;logoTrackingContainer=new c.LogoTrackingContainer;menuHeight=150;get State(){return this.state}set State(e){if(this.state==e)return;const t=this.state;this.state=e,this.updateLogoState(t),console.log(`${this.constructor.name}'s state changed from ${t} to ${e}`)}updateLogoState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.Initial;switch(this.state){case h.Exit:case h.Initial:this.Close();break;case h.TopLevel:case h.Play:switch(e){case h.TopLevel:break;case h.Initial:this.Open(),l.Ease.getEase(this.logo).ClearEasings().ScaleTo(.5*u.Screen.getScaleBasedOffScreenSize(),200,r.Easing.Linear.In);break;default:this.Open(),l.Ease.getEase(this.logo).ClearEasings().ScaleTo(.5*u.Screen.getScaleBasedOffScreenSize(),200,r.Easing.Quintic.Out)}}}constructor(e){super(),this.logo=e,this.drawMenuBG(),this.scale.y=0,this.alpha=0,this.addChild(this.menuBG),this.addChild(this.logoTrackingContainer),this.logo.Action=()=>this.onOsuLogo()}drawMenuBG(){this.menuBG.rect(0,u.Screen.getScaleBasedOffScreenSize()*(-this.menuHeight/2),1,u.Screen.getScaleBasedOffScreenSize()*this.menuHeight),this.menuBG.fill({color:"rgb(50,50,50)"})}onOsuLogo(){switch(this.state){default:return!1;case h.Initial:return this.State=h.TopLevel,!0;case h.TopLevel:case h.Play:case h.Edit:return!1}}Open(){setTimeout((()=>{this.isOpened=!0,l.Ease.getEase(this).ScaleTo(1,400,r.Easing.Quintic.Out).FadeIn(400,r.Easing.Quintic.Out)}),150)}Close(){this.isOpened=!1,l.Ease.getEase(this).ClearEasings().ScaleTo({x:1,y:0},300,r.Easing.Sinusoidal.In).FadeOut(300,r.Easing.Sinusoidal.In)}isOpen(){return this.isOpened}onResize(){this.menuBG.clear(),this.drawMenuBG(),this.position.set(0,window.innerHeight/2),this.menuBG.width=window.innerWidth}}var h;t.ButtonSystem=d,function(e){e.Exit="Exit",e.Initial="Initial",e.TopLevel="TopLevel",e.Play="Play",e.Edit="Edit",e.EnteringMode="EnteringMode"}(h||(h={}))},57853:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LogoTrackingContainer=void 0;const a=o(i(58687)),r=o(i(29172));class l extends a.Container{Logo=null;easing;startPosition=null;startTime=null;duration;visual_box_size=72;StartTracking(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.Easing.Linear.None;if(e.IsTracking&&null==this.Logo)throw new Error("Cannot track an instance of OsuLogo to multiple LogoTrackingContainers");this.Logo!=e&&null!=this.Logo&&(this.Logo.IsTracking=!1),this.Logo=e,this.Logo.IsTracking=!0,this.duration=t,this.easing=i,this.startTime=null,this.startPosition=null}StopTracking(){null!=this.Logo&&(this.Logo.IsTracking=!1,this.Logo=null)}ComputeLogoTrackingPosition(){let e=this.Logo.position;return e.x=window.innerWidth/3,e}Update(){this.Logo}}t.LogoTrackingContainer=l},73703:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OsuLogo=void 0;const a=o(i(58687)),r=i(44961),l=o(i(29172)),u=i(92915),c=i(20825),d=i(12235),h=i(8211),g=i(9611),f=i(22331),p=i(5825);class m extends a.Container{outline;visualizer=new h.MenuLogoVisualizer;triangles=new r.Triangles;flash;logoContainer=new a.Container;logoBounceContainer=new a.Container;logoBeatContainer=new a.Container;logoAmplitudeContainer=new a.Container;logoHoverContainer=new a.Container;rippleContainer=new a.Container;ripple;defaultVisualizerAlpha=.5;early_activation=60;timeElapsedSinceLastBeat=0;timeUntilNextBeat=0;lastTimeElapasedSinceLastBeat=0;selectSample=d.Loader.GetAudio("mainMenu.osuLogo.select");backToLogoSample=d.Loader.GetAudio("mainMenu.osuLogo.backToLogo");isMouseDown=!1;mouseDownPosition={x:0,y:0};Action=null;IsTracking=!1;get SizeForFlow(){return this.outline.width*this.logoBounceContainer.scale.x*this.logoHoverContainer.scale.x}constructor(){super(),this.visualizer.start(),this.outline=a.Sprite.from("mainMenu.logoOutline"),this.outline.anchor.set(.5,.5);let e=.7;this.visualizer.scale.set(e),this.visualizer.pivot.set(g.LogoVisualizer.size/2,g.LogoVisualizer.size/2),this.visualizer.alpha=this.defaultVisualizerAlpha;let t=new a.Graphics;t.circle(0,0,450),t.fill({color:"white"}),t.scale=e,this.flash=a.Sprite.from("mainMenu.logoMask"),this.flash.anchor.set(.5,.5),this.flash.scale=e,this.flash.blendMode="add",this.flash.alpha=0,this.triangles.flash.anchor.set(.5,.5),this.triangles.flash.scale=e,this.outline.scale.set(e),this.triangles.scale.set(e),this.triangles.position.set(-this.outline.width/2,-this.outline.height/2),this.triangles.mask=t,this.ripple=a.Sprite.from("mainMenu.logoMask"),this.ripple.anchor.set(.5,.5),this.ripple.scale=e,this.ripple.alpha=0,this.ripple.blendMode="add",this.rippleContainer.addChild(this.ripple),this.logoContainer.addChild(this.visualizer),this.logoContainer.addChild(this.triangles),this.logoContainer.addChild(this.triangles.flash),this.logoContainer.addChild(t),this.logoContainer.addChild(this.flash),this.logoContainer.addChild(this.outline),this.logoContainer.hitArea=new a.Circle(0,0,336),this.logoContainer.eventMode="static",this.logoContainer.onmouseenter=this._onmouseenter,this.logoContainer.onmouseleave=this._onmouseleave,this.logoContainer.onmousedown=this._onmousedown,this.logoContainer.onclick=this._onclick,this.logoBeatContainer.addChild(this.logoContainer),this.logoAmplitudeContainer.addChild(this.logoBeatContainer),this.logoBounceContainer.addChild(this.rippleContainer),this.logoBounceContainer.addChild(this.logoAmplitudeContainer),this.logoHoverContainer.addChild(this.logoBounceContainer),this.addChild(this.logoHoverContainer),c.Main.app.stage.addEventListener("mouseup",(e=>{this._onmouseup(e)}))}_onmouseenter=e=>{u.Ease.getEase(this.logoHoverContainer).ScaleTo(1.1,500,l.Easing.Elastic.Out)};_onmouseleave=e=>{u.Ease.getEase(this.logoHoverContainer).ScaleTo(1,500,l.Easing.Elastic.Out)};_onmousedown=e=>{this.isMouseDown=!0,u.Ease.getEase(this.logoBounceContainer).ClearEasings().ScaleTo(.9,1e3,l.Easing.Sinusoidal.Out),this.mouseDownPosition={x:c.Main.mousePos.x,y:c.Main.mousePos.y}};_onclick=e=>{this.flash.alpha=.4,u.Ease.getEase(this.flash).ClearEasings().FadeOut(1500,l.Easing.Exponential.Out),this.Action&&this.Action()&&c.Main.AudioEngine.PlayEffect(d.Loader.GetAudio("mainMenu.osuLogo.select"))};_onmouseup=e=>{this.isMouseDown=!1,u.Ease.getEase(this.logoBounceContainer).ClearEasings().ScaleTo(1,500,l.Easing.Elastic.Out).TransformTo({x:0,y:0},800,l.Easing.Elastic.Out)};draw(e){this.visualizer.draw(e),this.triangles.draw(e);let t=c.Main.AudioEngine.GetCurrentPlayingMusic(),i=t.GetCurrentTime(),n=t.beatmap.TimingPoints.GetCurrentUninheritedTimingPoint(i);if(this.timeUntilNextBeat=(n.time-i)%n.beatLength,this.timeUntilNextBeat<=0&&(this.timeUntilNextBeat+=n.beatLength),this.timeElapsedSinceLastBeat=n.beatLength-this.timeUntilNextBeat,c.Main.AudioEngine.useSilentMusic)this.logoAmplitudeContainer.scale=1,this.triangles.Velocity=p.MathUtil.Damp(this.triangles.Velocity,.5,.9,e.deltaMS);else{let i=t.GetMaximumAudioLevel();this.logoAmplitudeContainer.scale.set(p.MathUtil.Damp(this.logoAmplitudeContainer.scale.x,1-.04*Math.max(0,i-.4),.9,e.deltaMS)),this.triangles.Velocity=p.MathUtil.Damp(this.triangles.Velocity,.5*(n.effects==f.Effect.KiaiTime?4:2),.995,e.deltaMS)}if(this.lastTimeElapasedSinceLastBeat>this.timeElapsedSinceLastBeat&&this.onNewBeat(),this.lastTimeElapasedSinceLastBeat=this.timeElapsedSinceLastBeat,this.isMouseDown){let e={x:c.Main.mousePos.x-this.mouseDownPosition.x,y:c.Main.mousePos.y-this.mouseDownPosition.y},t=Math.sqrt(e.x*e.x+e.y*e.y);e.x*=t<=0?0:Math.pow(t,.6)/t,e.y*=t<=0?0:Math.pow(t,.6)/t,this.logoBounceContainer.x=e.x,this.logoBounceContainer.y=e.y}}onNewBeat(){let e=c.Main.AudioEngine.GetCurrentPlayingMusic(),t=e.GetCurrentTime(),i=e.beatmap.TimingPoints.GetCurrentUninheritedTimingPoint(t).beatLength,n=e.beatmap.TimingPoints.GetCurrentTimingPoints(t)[0],s=c.Main.AudioEngine.useSilentMusic?0:e.GetMaximumAudioLevel(),o=Math.min(1,.2+s);u.Ease.getEase(this.logoBeatContainer).ScaleTo(1-.02*o,this.early_activation,l.Easing.Linear.None).Then().ScaleTo(1,2*i,l.Easing.Quintic.Out),this.rippleContainer.scale=1.02,u.Ease.getEase(this.rippleContainer).ClearEasings().ScaleTo(1.02*(1+.04*o),i,l.Easing.Quintic.Out),this.ripple.alpha=.15*o,u.Ease.getEase(this.ripple).ClearEasings().FadeOut(i,l.Easing.Quintic.Out),n.effects==f.Effect.KiaiTime&&(u.Ease.getEase(this.triangles.flash).ClearEasings().FadeTo(.2*o,this.early_activation,l.Easing.Linear.None).Then().FadeTo(0,i,l.Easing.Linear.None),u.Ease.getEase(this.visualizer).ClearEasings().FadeTo(1.8*this.defaultVisualizerAlpha*o,this.early_activation,l.Easing.Linear.None).Then().FadeTo(this.defaultVisualizerAlpha,i,l.Easing.Linear.None)),setTimeout((()=>{this.triangles.Velocity+=o*(n.effects==f.Effect.KiaiTime?6:3)}),60)}}t.OsuLogo=m},44961:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Triangles=void 0;const r=o(i(58687)),l=i(20825),u=a(i(46404)),c=a(i(58689)),d=a(i(61630));class h extends r.Container{flash;Velocity=1;bgGradient;triangles=[];graphics=new r.Graphics;timeSinceLastSpawn=0;instancePositionBuffer;totalTriangles=15;constructor(){super();let e=[16737963,13390473];this.bgGradient=new r.FillGradient(0,0,0,1024),e.forEach(((t,i)=>{const n=i/e.length;this.bgGradient.addColorStop(n,t)}));for(let e=0;e{this.mouseButtonClicked=e.button,this.visible&&(this.posMouseDown={x:r.Main.mousePos.x,y:r.Main.mousePos.y},this.mouseIsDown=!0,this.dragRotationState=f.DragStarted,d.Ease.getEase(this.animContainer).ClearEasings().ScaleTo(.9,800,h.Easing.Quintic.Out),d.Ease.getEase(this.mouseCursorAdditive).ClearEasings().FadeIn(800,h.Easing.Quintic.Out),r.Main.AudioEngine.PlayEffect(this.cursorTapSample))})),r.Main.app.stage.addEventListener("mouseup",(e=>{this.visible&&e.button==this.mouseButtonClicked&&(this.mouseIsDown=!1,d.Ease.getEase(this.animContainer).ClearEasings().ScaleTo(1,500,h.Easing.Elastic.Out),d.Ease.getEase(this.mouseCursorAdditive).ClearEasings().FadeOut(500,h.Easing.Quintic.Out),this.dragRotationState!=f.NotDragging&&(this.dragRotationState==f.Rotating&&d.Ease.getEase(this.animRotationContainer).ClearEasings().createTween({value:this.animRotationContainer.angle},{value:0},!0,"angle",800*(.5+Math.abs(this.animRotationContainer.angle/960)),(e=>Math.pow(2,-10*e)*Math.sin((.25*e-this.elastic_const2)*this.elastic_const)+1-this.elastic_offset_quarter*e)),this.dragRotationState=f.NotDragging),r.Main.AudioEngine.PlayEffect(this.cursorTapSample,.8))}))}PopIn(){d.Ease.getEase(this.animRotationContainer).ClearEasings(),this.visible=!0,d.Ease.getEase(this.mouseHideContainer).ClearEasings().FadeIn(250,h.Easing.Quintic.Out).ScaleTo(1,400,h.Easing.Quintic.Out),this.dragRotationState=f.NotDragging}PopOut(){d.Ease.getEase(this.mouseHideContainer).ClearEasings().FadeOut(250,h.Easing.Quintic.Out).ScaleTo(.6,250,h.Easing.Quintic.Out),d.Ease.getEase(this.animRotationContainer).ClearEasings().createTween({value:this.animRotationContainer.angle},{value:0},!0,"angle",400,h.Easing.Quintic.Out),this.dragRotationState=f.NotDragging}updateMouse(){if(this.mouseContainer.scale.set(.07*c.Screen.getScaleBasedOffScreenSize()),this.position.set(r.Main.mousePos.x,r.Main.mousePos.y),this.dragRotationState!=f.NotDragging&&this.visible){let e=Math.sqrt((2^Math.abs(this.posMouseDown.x-r.Main.mousePos.x))+(2^Math.abs(this.posMouseDown.y-r.Main.mousePos.y)));if(this.dragRotationState==f.DragStarted&&e>15&&(this.dragRotationState=f.Rotating,this.lastDragRotationState!=this.dragRotationState&&(this.posMouseDown={x:r.Main.mousePos.x,y:r.Main.mousePos.y})),this.dragRotationState==f.Rotating&&e>0){let e=r.Main.mousePos.x-this.posMouseDown.x,t=r.Main.mousePos.y-this.posMouseDown.y,i=u.MathUtil.RadiansToDegrees(Math.atan2(-e,t))+24.3,n=(i-this.animRotationContainer.angle)%360;n<-180&&(n+=360),n>180&&(n-=360),i=this.animRotationContainer.angle+n,this.animRotationContainer.angle=i,d.Ease.getEase(this.animRotationContainer).createTween({value:this.animRotationContainer.angle},{value:i},!0,"angle",120,h.Easing.Quintic.Out)}}this.lastDragRotationState=this.dragRotationState}}var f;t.MenuCursor=g,function(e){e[e.NotDragging=0]="NotDragging",e[e.DragStarted=1]="DragStarted",e[e.Rotating=2]="Rotating"}(f||(f={}))},67991:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Background=void 0;const a=o(i(58687)),r=i(92915),l=o(i(29172));class u extends a.Sprite{constructor(e){super(),this.texture=e,this.visible=!1,this.anchor.set(.5,.5)}show(){this.visible=!0}destroy(e){r.Ease.getEase(this).FadeOut(800,l.Easing.Linear.None).Then((()=>{this.visible=!1,super.destroy(e)})),this.zIndex=1}}t.Background=u},36721:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RandomBackground=void 0;const a=o(i(58687)),r=i(12235),l=i(84283),u=i(20825),c=i(67991);class d extends l.Screen{bgContainer=new a.Container;parallaxMultiplier=60;start(){this.bgContainer.pivot.set(.5,.5),this.bgContainer.position.set((u.Main.mousePos.x-this.getScreenWidth()/2)/this.parallaxMultiplier,(u.Main.mousePos.y-this.getScreenHeight()/2)/this.parallaxMultiplier),this.addChild(this.bgContainer),this.newRandomBG(),u.Main.AudioEngine.addMusicChangeEventListener((e=>{if(e.beatmap.background){let t=URL.createObjectURL(e.beatmap.background);a.Assets.load({src:t,loadParser:"loadTextures"}).then((e=>{this.setBG(e)}))}else this.newRandomBG()})),this.zIndex=-100}setBG(e){let t=new c.Background(e);if(this.bgContainer.addChild(t),t.show(),0==this.bgContainer.children?.length);else{this.bgContainer.children[0].destroy()}this.onResize()}newRandomBG(){let e=r.Loader.seasonalBackgroundsNum>0,t=(i=1,n=e?r.Loader.seasonalBackgroundsNum:r.Loader.defaultBackgroundsNum,Math.round(Math.random()*(n-i)+i));var i,n;this.setBG(a.Texture.from((e?"seasonal_bg":"default_bg")+t))}draw(e){this.bgContainer.position.set((u.Main.mousePos.x-this.getScreenWidth()/2)/this.parallaxMultiplier,(u.Main.mousePos.y-this.getScreenHeight()/2)/this.parallaxMultiplier)}onClose(){return Promise.resolve(this)}onResize(){this.bgContainer.children.forEach((e=>{if(e instanceof c.Background){let t,i=e.texture.width,n=e.texture.height;t=window.innerWidth>window.innerHeight?window.innerWidth/i:window.innerHeight/n,n*t{i.id==e&&(t=i.data)})),!t)throw new Error("Asset not found!");return t}static GetString(e){let t;if(this.loadedList.forEach((i=>{i.id==e&&(t=i.dataString)})),!t)throw new Error("Asset not found or is not a string!");return t}static GetAudio(e){let t;if(this.loadedList.forEach((i=>{i.id==e&&(t=i.dataAudio)})),!t)throw new Error("Asset not found or was not marked as audio during loading!");return t}static addBackgrounds(){return new Promise((e=>{for(let e=1;ee.json())).then((t=>{t.backgrounds.forEach(((e,t)=>{this.loadList.push({id:"seasonal_bg"+(t+1),url:"https://corsproxy.io/?"+encodeURIComponent(e.url),pixiBundleName:"textures",loadParser:"loadTextures"}),this.seasonalBackgroundsNum=t+1})),e()})).catch((t=>{console.warn("Could not fetch seasonal backgrounds.",t),e()}))}))}static Load(e){return this.addToLoadList(),new Promise((t=>{this.addBackgrounds().then((()=>{let i=[],n=[],s=[],o=0,r=0;this.loadList.forEach((e=>{e.pixiBundleName?n.push(e):i.push(e)})),n.forEach((e=>{let t=!1;s.forEach((i=>{i.length>0&&i[0].pixiBundleName==e.pixiBundleName&&(i.push(e),t=!0)})),t||s.push([e])}));const l=e=>{e?r++:o++,r+o>=this.loadList.length&&t()};i.forEach((t=>{fetch(t.url).then((e=>e.blob())).then((i=>{t.isText||t.isAudio?t.isText?i.text().then((e=>{l(),this.loadedList.push({id:t.id,data:i,dataString:e})})):t.isAudio&&i.arrayBuffer().then((t=>e.decodeAudioData(t))).then((e=>{l(),this.loadedList.push({id:t.id,data:i,dataAudio:e})})):(l(),this.loadedList.push({id:t.id,data:i}))})).catch((e=>{l(!0),console.warn("Asset '"+t.id+"' failed to load: "+e)}))})),s.forEach((e=>{if(e.length>0){if(!e[0].pixiBundleName)throw new Error("wtf????");let t=[];e.forEach((e=>{e.loadParser?t.push({alias:e.id,src:e.url,loadParser:e.loadParser}):t.push({alias:e.id,src:e.url})})),a.Assets.addBundle(e[0].pixiBundleName,t),a.Assets.loadBundle(e[0].pixiBundleName).then((()=>{e.forEach((()=>{l()}))}))}}))}))}))}}},25373:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.InteractScreen=void 0;const a=i(84283),r=o(i(58687)),l=i(20825),u=i(94433),c=o(i(29172)),d=i(92915);class h extends a.Screen{text;text2;textContainer=new r.Container;textContainerContainer=new r.Container;introTrack;clickSound;clickArea=new r.Graphics;constructor(e,t){super(),this.introTrack=e,this.clickSound=t,this.text=new r.Text({text:"Click anywhere to play!",style:{fontFamily:"TorusRegular",fontSize:36,fill:"white"}}),this.text2=new r.Text({text:"(this is for enabling audio because it's required by web-browsers\n to have interaction on this webpage before playing audio.)",style:{fontFamily:"TorusRegular",fontSize:26,fill:"gray",align:"center"}})}start(){this.text.anchor.set(.5,.5),this.text2.anchor.set(.5,.5),this.text2.position.set(0,this.text.height+15),this.textContainer.addChild(this.text),this.textContainer.addChild(this.text2),this.textContainer.scale.set(.5),this.textContainer.alpha=0,this.textContainerContainer.addChild(this.textContainer),this.textContainerContainer.scale=a.Screen.getScaleBasedOffScreenSize(),this.textContainerContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.addChild(this.textContainerContainer),this.clickArea.rect(0,0,1,1),this.clickArea.fill("rgba(0,0,0,0)"),this.clickArea.width=this.getScreenWidth(),this.clickArea.height=this.getScreenHeight(),this.clickArea.position.set(0,0),this.addChild(this.clickArea),this.clickArea.eventMode="static",this.clickArea.cursor="pointer";const e=()=>{this.clickArea.eventMode="none",l.Main.AudioEngine.PlayEffect(this.clickSound),l.Main.switchScreen(new u.IntroScreen(this.introTrack)),document.body.style.cursor="none",l.Main.pointerLock(),l.Main.lockKeyboard()};this.clickArea.onclick=()=>{e()},this.clickArea.ontap=()=>{e()},d.Ease.getEase(this.textContainer).FadeIn(400,c.Easing.Quadratic.Out).ScaleTo(1,400,c.Easing.Quadratic.Out)}onClose(){return new Promise((e=>{d.Ease.getEase(this.textContainer).FadeOut(200,c.Easing.Quadratic.Out).ScaleTo(.5,200,c.Easing.Quadratic.InOut),setTimeout((()=>{e(this)}),200)}))}draw(e){}onResize(){this.textContainerContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.clickArea.width=this.getScreenWidth(),this.clickArea.height=this.getScreenHeight(),this.clickArea.position.set(0,0),this.textContainerContainer.scale=a.Screen.getScaleBasedOffScreenSize()}}t.InteractScreen=h},88662:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.GlitchingTriangles=void 0;const a=o(i(58687)),r=i(92915),l=o(i(29172));class u extends a.Container{constructor(e){super();let t=new a.Graphics,i=n(.2,1.2);function n(e,t){return Math.random()*(t-e)+e}t.moveTo(0,0),t.lineTo(-50*i,100*i),t.lineTo(50*i,100*i),t.lineTo(0,0),Math.random()<.5?t.fill("white"):t.stroke({color:"white",width:1});let s=n(e.x1,e.x2),o=n(e.y1,e.y2);t.position.set(s,o),r.Ease.getEase(t,!0).FadeOut(200,l.Easing.Linear.None),setTimeout((()=>{this.destroy()}),200),this.addChild(t)}}t.GlitchingTriangles=u},94433:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.IntroScreen=void 0;const a=i(84283),r=o(i(58687)),l=i(53931),u=i(20825),c=i(88662),d=i(58940),h=i(55402),g=i(9752),f=o(i(29172)),p=i(92915),m=i(5168),v=i(94461);class S extends a.Screen{introTrackUrl;doTextSpacingAnim=!1;triangles=new r.Container;ruleSetContainer=new r.Container;ruleSetList=new v.CenteredList({});flash=new r.Graphics;logoContainerContainer=new r.Container;logoContainer=new r.Container;lazerLogo=new h.LazerLogo;flashed=!1;standard=r.Sprite.from("icon_ruleset_std");taiko=r.Sprite.from("icon_ruleset_taiko");ctb=r.Sprite.from("icon_ruleset_ctb");mania=r.Sprite.from("icon_ruleset_mania");bg=new r.Graphics;completionPromise;welcomeText=new r.Text({text:"",style:{fontFamily:"TorusThin",fontSize:42,fill:"white",letterSpacing:5}});constructor(e){super(),this.introTrackUrl=URL.createObjectURL(e),this.bg.rect(0,0,1,1),this.bg.fill("black")}start(){this.bg.width=window.innerWidth,this.bg.height=window.innerHeight,this.bg.x=0,this.bg.y=0,this.addChild(this.bg),this.lazerLogo.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.logoContainer.addChild(this.lazerLogo),this.logoContainer.scale.set(1.2),this.logoContainerContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.logoContainerContainer.pivot.set(.5,.5),this.logoContainerContainer.addChild(this.logoContainer),this.logoContainerContainer.alpha=0,this.addChild(this.logoContainerContainer),this.flash.rect(0,0,1,1),this.flash.fill("white"),this.flash.position.set(0,0),this.flash.width=this.getScreenWidth(),this.flash.height=this.getScreenHeight(),this.flash.blendMode="add",this.welcomeText.anchor.set(.5,.5),this.welcomeText.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),setTimeout((async()=>{const{entries:e}=await(0,l.unzip)(this.introTrackUrl);for(const[t,i]of Object.entries(e))if(t.endsWith(".osu")){i.text().then((t=>{let i=g.BeatmapParser.Parse(t);console.log(i);for(const[t,n]of Object.entries(e))t==i.General.AudioFilename&&n.blob().then((e=>{let t=URL.createObjectURL(e);setTimeout((()=>{u.Main.AudioEngine.PlayMusicImmediately(t,i,(()=>{this.afterAudioPlay()}))}),200)}))}));break}}),0)}afterAudioPlay(){this.completionPromise=new Promise((e=>{let t;this.welcomeText.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.addChild(this.welcomeText),setTimeout((()=>{this.welcomeText.text="wel",this.onResize()}),200),setTimeout((()=>{this.welcomeText.text="welcome",this.onResize()}),400),setTimeout((()=>{this.welcomeText.text="welcome to",this.onResize()}),700),this.triangles.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.triangles.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.addChild(this.triangles),setTimeout((()=>{this.welcomeText.text="welcome to kosu!",this.doTextSpacingAnim=!0,t=setInterval((()=>{let e=new c.GlitchingTriangles({x1:-this.welcomeText.width/2-100,x2:this.welcomeText.width/2+100,y1:-this.welcomeText.height/2-150,y2:this.welcomeText.height/2+100});this.triangles.addChild(e)}),30),this.onResize()}),900),this.standard.scale=.5*a.Screen.getScaleBasedOffScreenSize(),this.ctb.scale=.5*a.Screen.getScaleBasedOffScreenSize(),this.mania.scale=.5*a.Screen.getScaleBasedOffScreenSize(),this.taiko.scale=.5*a.Screen.getScaleBasedOffScreenSize(),this.ruleSetList.addChild(this.standard),this.ruleSetList.addChild(this.taiko),this.ruleSetList.addChild(this.ctb),this.ruleSetList.addChild(this.mania),this.ruleSetList.padding=0,this.ruleSetList.elementsMargin=200*a.Screen.getScaleBasedOffScreenSize(),this.ruleSetList.type="horizontal",this.ruleSetList.scale=1,this.ruleSetContainer.addChild(this.ruleSetList),setTimeout((()=>{this.doTextSpacingAnim=!1,this.onResize(),clearInterval(t),this.welcomeText.destroy(),this.triangles.destroy(),this.ruleSetContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.addChild(this.ruleSetContainer),this.ruleSetList.elementsMargin=200*a.Screen.getScaleBasedOffScreenSize(),p.Ease.getEase(this.ruleSetContainer).ScaleTo(.8,1e3,f.Easing.Linear.None)}),1450),setTimeout((()=>{this.ruleSetList.elementsMargin=30*a.Screen.getScaleBasedOffScreenSize(),this.ruleSetList.scale=2,m.UIUtils.centerPivotOfList(this.ruleSetList)}),1650),setTimeout((()=>{this.ruleSetList.elementsMargin=10*a.Screen.getScaleBasedOffScreenSize(),this.ruleSetList.scale=4,p.Ease.getEase(this.ruleSetContainer).ScaleTo(1.3,1e3,f.Easing.Linear.None)}),1850),setTimeout((()=>{this.ruleSetContainer.destroy(),this.lazerLogo.start(),this.logoContainerContainer.alpha=1,this.logoContainerContainer.scale.set(1.2),p.Ease.getEase(this.logoContainerContainer).ScaleTo(1,920,f.Easing.Quadratic.In),setTimeout((()=>{p.Ease.getEase(this.logoContainer).ScaleTo(1.2-.8,276,f.Easing.Quintic.In)}),644)}),2080),setTimeout((()=>{this.addChild(this.flash),this.bg.destroy(),this.flash.eventMode="none",this.flashed=!0,this.logoContainerContainer.visible=!1,p.Ease.getEase(this.flash).FadeOut(1e3,f.Easing.Quadratic.Out).Then((()=>{e()})),u.Main.cursor.PopIn()}),3e3)})),u.Main.switchScreen(new d.MainMenu)}draw(e){this.doTextSpacingAnim&&(this.welcomeText.style.letterSpacing+=.15*e.deltaTime,this.onResize())}onClose(){return new Promise((e=>{this.completionPromise.then((()=>{e(this)}))}))}onResize(){this.bg.destroyed||(this.bg.width=window.innerWidth,this.bg.height=window.innerHeight,this.bg.x=0,this.bg.y=0),this.welcomeText.destroyed||this.welcomeText.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.triangles.destroyed||(this.triangles.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.triangles.scale.set(a.Screen.getScaleBasedOffScreenSize())),this.ruleSetContainer.destroyed||this.ruleSetContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.flash.destroyed||(this.flash.position.set(0,0),this.flash.width=this.getScreenWidth(),this.flash.height=this.getScreenHeight()),this.logoContainerContainer.destroyed||this.logoContainerContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.lazerLogo.destroyed||this.lazerLogo.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.welcomeText.destroyed||this.welcomeText.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.standard.destroyed||this.standard.scale.set(.5*a.Screen.getScaleBasedOffScreenSize()),this.mania.destroyed||this.mania.scale.set(.5*a.Screen.getScaleBasedOffScreenSize()),this.ctb.destroyed||this.ctb.scale.set(.5*a.Screen.getScaleBasedOffScreenSize()),this.taiko.destroyed||this.taiko.scale.set(.5*a.Screen.getScaleBasedOffScreenSize()),this.ruleSetList.destroyed||this.ruleSetList.ReCenter()}}t.IntroScreen=S},55402:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LazerLogo=void 0;const a=o(i(58687)),r=i(87525),l=o(i(29172)),u=i(92915);class c extends a.Container{highlight;background;textureHighlight=a.Texture.from("intro_triangles_osuLogo_anim_highlight");textureBackground=a.Texture.from("intro_triangles_osuLogo_anim_background");constructor(){super(),this.highlight=new r.LogoAnimation(this.textureHighlight,new a.Color("white")),this.background=new r.LogoAnimation(this.textureBackground,new a.Color("rgb(128, 128, 128)")),this.addChild(this.highlight),this.addChild(this.background)}start(){let e=new a.Container;e.scale.set(0,0),u.Ease.getEase(e).ScaleTo(1,920,l.Easing.Linear.None).OnEach((()=>{this.highlight.setProgress(e.scale.x),this.background.setProgress(e.scale.x)}))}}t.LazerLogo=c},87525:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogoAnimation=void 0;const r=o(i(58687)),l=a(i(26045)),u=a(i(44160)),c=a(i(46110));class d extends r.Container{shader;texture;constructor(e,t){super(),this.texture=e,this.shader=r.Shader.from({gl:{vertex:l.default,fragment:u.default},gpu:{vertex:{entryPoint:"mainVert",source:c.default},fragment:{entryPoint:"mainFrag",source:c.default}},resources:{uTexture:this.texture.source,uSampler:this.texture.source.style,uProgress:{progress:{value:0,type:"f32"}}}});const i=new r.Geometry({attributes:{aPosition:[-this.texture.width/2,-this.texture.height/2,this.texture.width/2,-this.texture.height/2,this.texture.width/2,this.texture.width/2,-this.texture.width/2,this.texture.width/2],aUV:[0,0,1,0,1,1,0,1],aColor:[t.red,t.green,t.blue,t.alpha,t.red,t.green,t.blue,t.alpha,t.red,t.green,t.blue,t.alpha,t.red,t.green,t.blue,t.alpha]},indexBuffer:[0,1,2,0,2,3]}),n=new r.Mesh({geometry:i,shader:this.shader});this.addChild(n)}setProgress(e){this.shader.resources.uProgress.uniforms.progress=e}}t.LogoAnimation=d},76969:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.LoadScreen=void 0;const n=i(84283),s=i(49323);class o extends n.Screen{loadAnim=new s.LoadAnim("rgba(255,255,255,0.7)","black");start(){this.loadAnim.scale.set(.8*n.Screen.getScaleBasedOffScreenSize()),this.loadAnim.position.set(this.getScreenWidth()-this.loadAnim.getWidth()-15,this.getScreenHeight()-this.loadAnim.getHeight()-15),this.addChild(this.loadAnim)}draw(e){this.loadAnim?.draw(e)}onClose(){return new Promise((e=>{null!=this.loadAnim&&this.loadAnim.destroy(),setTimeout((()=>{e(this)}),400)}))}onResize(){this.loadAnim.position.set(this.getScreenWidth()-this.loadAnim.getWidth()-20,this.getScreenHeight()-this.loadAnim.getHeight()-20),this.loadAnim.scale.set(.8*n.Screen.getScaleBasedOffScreenSize())}}t.LoadScreen=o},58940:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MainMenu=void 0;const n=i(84283),s=i(36721),o=i(73703),a=i(70723);class r extends n.Screen{bg=new s.RandomBackground;osuCircle=new o.OsuLogo;menu=new a.ButtonSystem(this.osuCircle);start(){this.bg.start(),this.addChild(this.bg),this.osuCircle.scale=n.Screen.getScaleBasedOffScreenSize(),this.addChild(this.menu),this.menu.onResize(),this.addChild(this.osuCircle)}draw(e){this.bg.draw(e),this.osuCircle.draw(e)}onClose(){return new Promise((e=>{this.bg.onClose().then((()=>{e(this)}))}))}onResize(){this.osuCircle.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.bg.onResize(),this.menu.onResize(),this.osuCircle.scale=this.menu.isOpen()?.5*n.Screen.getScaleBasedOffScreenSize():n.Screen.getScaleBasedOffScreenSize()}}t.MainMenu=r},84283:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Screen=void 0;const a=o(i(58687)),r=i(58293),l=i(64681);class u extends a.Container{constructor(){super()}static getScaleBasedOffScreenSize(){const e=r.Settings.getSetting(l.UIScale).getValue();return(window.innerWidth/1920+window.innerHeight/1080)/2*e}getScreenWidth(){return window.innerWidth}getScreenHeight(){return window.innerHeight}}t.Screen=u},75341:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SettingsCategory=t.Setting=void 0;const n=i(58293);var s;t.Setting=class{info;constructor(e){this.info=e,n.Settings.register({setting:this,info:e})}onValueChanged(){}},function(e){e.General="General",e.Skin="Skin",e.Input="Input",e.UserInterface="User Interface",e.Gameplay="Gameplay",e.Rulesets="Rulesets",e.Audio="Audio",e.Graphics="Graphics",e.Online="Online",e.Maintenance="Maintenance",e.Debug="Debug"}(s||(t.SettingsCategory=s={}))},74975:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.DropdownSetting=void 0;const n=i(75341),s=i(58293);class o extends n.Setting{value;getValue(){if(!this.value)throw new Error("Value is undefined!");return this.value}getDefaultValue(){return this.defaultValue}setValue(e){this.list.find((t=>t.value==e.value&&t.displayName==e.displayName))?(this.value=e,s.Settings.save(),this.onValueChanged()):console.warn("The value provided to this DropDownSetting does not exist in the option list! Ignoring value provided.")}loadFromSaveValue(e){this.list.find((t=>t.value==e.value&&t.displayName==e.displayName))?(this.value=e,this.onValueChanged()):console.warn("The value provided to this DropDownSetting does not exist in the option list! Ignoring value provided.")}}t.DropdownSetting=o},78642:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeSetting=void 0;const n=i(75341),s=i(58293),o=i(5825);class a extends n.Setting{value=0;getValue(){return this.value}getDefaultValue(){return this.defaultValue}setValue(e){this.value=o.MathUtil.clamp(this.minValue,this.maxValue,e),s.Settings.save(),this.onValueChanged()}loadFromSaveValue(e){this.value=o.MathUtil.clamp(this.minValue,this.maxValue,e),this.onValueChanged()}}t.RangeSetting=a},58293:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Settings=void 0;const n=i(64681),s=i(44256),o=i(59029);t.Settings=class{static settingsList=[];static registerAll(){new n.UIScale,new s.Renderer,new o.MouseSensitivity}static load(){let e=window.localStorage.getItem("settings");if(null==e)return;let t=this.getList();try{JSON.parse(e).forEach((e=>{let i=!1;try{e.value||(console.warn("Setting '"+JSON.stringify(e)+"' may be corrupted, skipping!"),i=!0),e.info?(e.info.name||(console.warn("Setting '"+JSON.stringify(e)+"' may be corrupted, skipping!"),i=!0),e.info.category||(console.warn("Setting '"+JSON.stringify(e)+"' may be corrupted, skipping!"),i=!0)):(console.warn("Setting '"+JSON.stringify(e)+"' may be corrupted, skipping!"),i=!0)}catch(e){console.warn("Something went wrong when validating saved settings!",e),console.warn("The setting may be REALLY corrupted, skipping!"),i=!0}if(!i){let i=t.filter((t=>t.info.name==e.info.name&&t.info.category==e.info.category))[0];i?i.setting.loadFromSaveValue(e.value):console.warn("Could not find setting object '"+e.info.name+"', maybe it has been removed in this version of kosu?, skipping setting")}}))}catch(e){console.warn("Failed to load settings! Resetting Settings due to corrupted save!",e),this.reset()}}static save(){let e=this.getList(),t=[];e.forEach((e=>{e.setting.getValue()!=e.setting.getDefaultValue()&&t.push({info:e.info,value:e.setting.getValue()})})),window.localStorage.setItem("settings",JSON.stringify(t))}static reset(){console.warn("Resetting Settings!"),window.localStorage.removeItem("settings")}static register(e){this.settingsList.push(e)}static getSetting(e){return this.settingsList.filter((t=>t.setting instanceof e))[0].setting}static getSettingData(e){return this.settingsList.filter((t=>t.setting instanceof e))[0]}static getList(){return this.settingsList}}},44256:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;const n=i(75341),s=i(74975);class o extends s.DropdownSetting{list=[];webglOption={displayName:"WebGL",value:"webgl"};webGpuOption={displayName:"WebGPU",value:"webgpu"};defaultValue=this.webglOption;constructor(){super({name:"Renderer",category:n.SettingsCategory.Graphics}),this.list.push(this.webglOption,this.webGpuOption),this.value=this.defaultValue}}t.Renderer=o},64681:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.UIScale=void 0;const n=i(78642),s=i(75341);class o extends n.RangeSetting{maxValue=1.6;minValue=.8;increment=.1;defaultValue=1;constructor(){super({name:"UI scaling",category:s.SettingsCategory.Graphics}),this.value=this.defaultValue}}t.UIScale=o},59029:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MouseSensitivity=void 0;const n=i(78642),s=i(75341),o=i(58687);class a extends n.RangeSetting{defaultValue=1;increment=.01;maxValue=10;minValue=.1;constructor(){super({name:"Sensitivity",category:s.SettingsCategory.Input}),this.value=this.defaultValue,this.onValueChanged()}onValueChanged(){o.EventSystem.cursorSensitivity=this.getValue()}}t.MouseSensitivity=a},17898:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.BeatmapData=void 0;const n=i(85932),s=i(20352),o=i(32007),a=i(78878),r=i(54611),l=i(6386),u=i(43354);t.BeatmapData=class{background=null;General=new n.GeneralData;Editor=new s.EditorData;Metadata=new o.Metadata;Difficulty=new a.DifficultyData;Events=new r.EventsData;TimingPoints=new l.TimingPointsData;Colors=new u.ColorsData}},43354:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorsData=void 0;t.ColorsData=class{Colors=[]}},78878:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DifficultyData=void 0;t.DifficultyData=class{HPDrainRate;CircleSize;OverallDifficulty;ApproachRate;SliderMultiplier;SliderTickRate}},20352:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EditorData=void 0;t.EditorData=class{Bookmarks=[];DistanceSpacing;BeatDivisor;GridSize;TimelineZoom}},90361:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;t.Event=class{eventType;startTime=0;eventParams}},64432:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.EventBackground=void 0;const n=i(90361),s=i(15041);class o extends n.Event{eventType=s.EventTypes.BACKGROUND;startTime=0;filename;xOffset;yOffset}t.EventBackground=o},15041:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.EventTypes=void 0,function(e){e[e.BACKGROUND=0]="BACKGROUND",e.VIDEO="Video",e.SPRITE="Sprite",e.ANIMATION="Animation"}(i||(t.EventTypes=i={}))},54611:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EventsData=void 0;t.EventsData=class{Events=[]}},37940:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Countdown=void 0,function(e){e[e.NoCountdown=0]="NoCountdown",e[e.Normal=1]="Normal",e[e.Half=2]="Half",e[e.Double=3]="Double"}(i||(t.Countdown=i={}))},85932:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralData=void 0;const n=i(37940),s=i(41080),o=i(90857),a=i(45274);t.GeneralData=class{AudioFilename=null;AudioLeadIn=0;AudioHash=null;PreviewTime=-1;Countdown=n.Countdown.Normal;SampleSet=s.SampleSet.Normal;StackLeniency=.7;Mode=o.Mode.OSU;LetterboxInBreaks=!1;StoryFireInFront=!0;UseSkinSprites=!1;AlwaysShowPlayfield=!1;OverlayPosition=a.OverlayPosition.NoChange;SkinPreference=null;EpilepsyWarning=!1;CountdownOffset=0;SpecialStyle=!1;WidescreenStoryboard=!1;SamplesMatchPlaybackRate=!1}},90857:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Mode=void 0,function(e){e[e.OSU=0]="OSU",e[e.TAIKO=1]="TAIKO",e[e.CATCH=2]="CATCH",e[e.MANIA=3]="MANIA"}(i||(t.Mode=i={}))},45274:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.OverlayPosition=void 0,function(e){e.NoChange="NoChange",e.Below="Below",e.Above="Above"}(i||(t.OverlayPosition=i={}))},41080:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.SampleSet=void 0,function(e){e.Normal="Normal",e.Soft="Soft",e.Drum="Drum"}(i||(t.SampleSet=i={}))},32007:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;t.Metadata=class{Title;TitleUnicode;Artist;ArtistUnicode;Creator;Version;Source;Tags;BeatmapID;BeatmapSetID}},22331:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Effect=void 0,function(e){e[e.KiaiTime=1]="KiaiTime",e[e.None=0]="None",e[e.FirstBarLineOmittedInOsuTaikoAndOsuMania=3]="FirstBarLineOmittedInOsuTaikoAndOsuMania"}(i||(t.Effect=i={}))},3143:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.InheritedTimingPoint=void 0;const n=i(52032);class s extends n.TimingPoint{sliderVelocityMultiplier}t.InheritedTimingPoint=s},52032:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimingPoint=void 0;t.TimingPoint=class{time;sampleSet;sampleIndex;volume;effects}},6386:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.TimingPointsData=void 0;const n=i(87816),s=i(3143);t.TimingPointsData=class{TimingPoints=[];GetCurrentTimingPoints(e){let t=[],i=this.TimingPoints.filter((t=>{if(t.time<=e)return t}));if(0==i.length&&i.push(this.TimingPoints[0]),t.push(i[i.length-1]),t[0]instanceof s.InheritedTimingPoint){let i=this.TimingPoints.filter((e=>e instanceof n.UnInheritedTimingPoint)).filter((t=>{if(t.time<=e)return t}));if(0==i.length)throw new Error("Could not find a parent timing point for the un-inherited timing point!");t.push(i[i.length-1])}if(0==t.length)throw new Error("Could not find any timing points!");return t}GetCurrentUninheritedTimingPoint(e){let t,i=this.GetCurrentTimingPoints(e);if(i[0]instanceof n.UnInheritedTimingPoint)t=i[0];else{if(!(i[1]instanceof n.UnInheritedTimingPoint))throw new Error("Could not find any UnInherited Timing Points!");t=i[1]}return t}}},87816:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.UnInheritedTimingPoint=void 0;const n=i(52032);class s extends n.TimingPoint{beatLength;meter}t.UnInheritedTimingPoint=s},9752:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.BeatmapParser=void 0;const n=i(17898),s=i(30444),o=i(81347),a=i(23114),r=i(98803),l=i(92880),u=i(25820);class c{static Parse(e,t){const i=new n.BeatmapData;let d=e.split(/\r?\n|\r|\n/g);return o.GeneralParser.ParseGeneral(i,c.GetSection("General",d)),a.EditorParser.ParseEditor(i,c.GetSection("Editor",d)),r.MetadataParser.ParseMetadata(i,c.GetSection("Metadata",d)),l.DifficultyParser.ParseDifficulty(i,c.GetSection("Difficulty",d)),u.EventsParser.ParseEvents(i,c.GetSection("Events",d)),s.TimingPointsParser.ParseTimingPoints(i,c.GetSection("TimingPoints",d)),i}static GetSection(e,t){let i=[];return t.forEach(((n,s)=>{if(n=="["+e+"]")for(let e=s+1;e{let i=t.split(":");i[1].startsWith(" ")&&(i[1]=i[1].substring(1,i[1].length)),n.BeatmapParser.AutoParse(s.DifficultyData,i,e.Difficulty)}))}}},23114:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.EditorParser=void 0;const n=i(9752),s=i(20352);t.EditorParser=class{static ParseEditor(e,t){t.forEach((t=>{let i=t.split(":");i[1].startsWith(" ")&&(i[1]=i[1].substring(1,i[1].length)),"Bookmarks"!=i[0]?n.BeatmapParser.AutoParse(s.EditorData,i,e.Editor):i[1].split(",").forEach((t=>{e.Editor.Bookmarks.push(parseFloat(t))}))}))}}},25820:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.EventsParser=void 0;const n=i(15041),s=i(64432);t.EventsParser=class{static ParseEvents(e,t){t.forEach((t=>{let i,o=t.split(",");parseInt(o[0])==n.EventTypes.BACKGROUND&&(i=new s.EventBackground,i.filename=o[2].replaceAll('"',""),i.xOffset=parseInt(o[3]),i.yOffset=parseInt(o[3]),i.startTime=0),i&&e.Events.Events.push(i)}))}}},81347:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralParser=void 0;const n=i(85932),s=i(9752);t.GeneralParser=class{static ParseGeneral(e,t){t.forEach((t=>{let i=t.split(":");i[1].startsWith(" ")&&(i[1]=i[1].substring(1,i[1].length)),s.BeatmapParser.AutoParse(n.GeneralData,i,e.General)}))}}},98803:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataParser=void 0;const n=i(9752),s=i(32007);t.MetadataParser=class{static ParseMetadata(e,t){t.forEach((t=>{let i=t.split(":");i[1].startsWith(" ")&&(i[1]=i[1].substring(1,i[1].length)),n.BeatmapParser.AutoParse(s.Metadata,i,e.Metadata)}))}}},30444:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.TimingPointsParser=void 0;const n=i(87816),s=i(3143),o=i(22331);t.TimingPointsParser=class{static ParseTimingPoints(e,t){t.forEach((t=>{let i,a=t.split(",");"1"==a[6]?(i=new n.UnInheritedTimingPoint,i.beatLength=Number.parseFloat(a[1]),i.meter=Number.parseInt(a[2])):(i=new s.InheritedTimingPoint,i.sliderVelocityMultiplier=Number.parseFloat(a[1])),i.time=Number.parseInt(a[0]),i.sampleSet=Number.parseInt(a[3]),i.sampleIndex=Number.parseInt(a[4]),i.volume=Number.parseInt(a[5]),"1"==a[7]||"3"==a[7]?i.effects=Number.parseInt(a[7]):i.effects=o.Effect.None,e.TimingPoints.TimingPoints.push(i)}))}}},5825:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MathUtil=void 0;class i{static RadiansToDegrees(e){return 180*e/Math.PI}static DegreesToRadians(e){return e*Math.PI/180}static clamp(e,t,i){return Math.min(Math.max(i,e),t)}static clamp01(e){return i.clamp(0,1,e)}static Damp(e,t,n,s){return i.Lerp(e,t,1-Math.pow(n,s))}static Lerp(e,t,i){return e+(t-e)*i}}t.MathUtil=i},92915:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Ease=void 0;const a=o(i(29172));class r{static previousEases=[];easings=[];obj;delay=null;constructor(e,t){this.obj=e,t||r.previousEases.push(this)}static getEase(e,t){null==t&&(t=!1);let i=r.previousEases.filter((t=>t.obj==e));return i.length>0?i[0]:new r(e,t)}createTween(e,t,i,n,s,o){const r={value:0},u=new a.Tween(i?r:e),c=new l(u);return u.to(i?{value:1}:t,s),u.easing(o),u.onUpdate((()=>{this.obj.destroyed||(this.obj[n]=i?r.value*(t.value-e.value)+e.value:e),c.onUpdate()})),u.onStart((()=>{i&&(e.value=this.obj[n])})),null==this.delay?u.start():(this.delay.chain(u),this.delay=null),this.easings.push(c),u.onStop((()=>{this.onDone(u)})),u.onComplete((()=>{this.onDone(u)})),this}TransformTo(e,t,i){return this.createTween(this.obj.position,e,!1,"position",t,i),this}onDone(e){this.easings=this.easings.filter((t=>t.tween!=e))}ScaleTo(e,t,i){let n={x:0,y:0};return"number"==typeof e&&(n.x=e,n.y=e),this.createTween(this.obj.scale,n,!1,"scale",t,i),this}FadeTo(e,t,i){return this.createTween({value:this.obj.alpha},{value:e},!0,"alpha",t,i),this}FadeOut(e,t){return this.FadeTo(0,e,t),this}FadeIn(e,t){return this.FadeTo(1,e,t),this}ClearEasings(){return this.easings.forEach((e=>{e.tween.stop()})),this.easings=[],this}Then(e){let t=this.easings.sort(((e,t)=>e.tween.getDuration()-t.tween.getDuration()));return t.length>0&&(this.delay=t[0].tween,null!=e&&(t[0].tween.onComplete((()=>{this.onDone(t[0].tween),e()})),t[0].tween.onStop((()=>{this.onDone(t[0].tween),e()})))),this}OnEach(e){let t=this.easings.sort(((e,t)=>e.tween.getDuration()-t.tween.getDuration()));t.length>0&&t[0].registerOnUpdate(e)}}t.Ease=r;class l{tween;updateEventListeners=[];constructor(e){this.tween=e}onUpdate(){this.updateEventListeners.forEach((e=>{e()}))}registerOnUpdate(e){this.updateEventListeners.push(e)}unRegisterOnUpdate(e){this.updateEventListeners=this.updateEventListeners.filter((t=>!(e===t)))}}},94461:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.CenteredList=void 0;const n=i(70828),s=i(5168);class o extends n.List{get elementsMargin(){return super.elementsMargin}set elementsMargin(e){super.elementsMargin=e,s.UIUtils.centerPivotOfList(this)}ReCenter(){s.UIUtils.centerPivotOfList(this)}}t.CenteredList=o},5168:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIUtils=void 0;t.UIUtils=class{static centerPivotOfList(e){let t=e.leftPadding,i=e.topPadding;for(let n=0;n{const e=o.Settings.getSetting(a.Renderer).getValue().value;d.init({backgroundColor:"black",width:u,height:c,antialias:!0,preference:e,resolution:window.devicePixelRatio,autoDensity:!0}).then((()=>{new s.Main(d)}))},navigator.mediaSession.setActionHandler("play",(()=>{s.Main.AudioEngine.GetCurrentPlayingMusicNoSilent()?.Play()})),navigator.mediaSession.setActionHandler("pause",(()=>{s.Main.AudioEngine.GetCurrentPlayingMusicNoSilent()?.Pause()})),navigator.mediaSession.setActionHandler("stop",(()=>{})),navigator.mediaSession.setActionHandler("seekbackward",(()=>{})),navigator.mediaSession.setActionHandler("seekforward",(()=>{})),navigator.mediaSession.setActionHandler("seekto",(()=>{})),navigator.mediaSession.setActionHandler("previoustrack",(()=>{})),navigator.mediaSession.setActionHandler("nexttrack",(()=>{})),Object.defineProperty(window,"setSensitivity",{value:e=>{o.Settings.getSetting(r.MouseSensitivity).setValue(e)}}),Object.defineProperty(window,"setRenderer",{value:e=>{let t=o.Settings.getSetting(a.Renderer);t.setValue("webgl"==e?t.webglOption:t.webGpuOption),window.location.reload()}}),Object.defineProperty(window,"setUIScale",{value:e=>{o.Settings.getSetting(l.UIScale).setValue(e),window.location.reload()}})},20825:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Main=void 0;const a=o(i(58687)),r=i(76969),l=i(25373),u=i(12235),c=i(55686),d=i(85437),h=o(i(29172)),g=i(29847),f=i(53931),p=i(9752),m=i(64432);class v{static app;static mousePos={x:0,y:0};static pointerLockExitTime;static cursor;static AudioEngine;static currentScreen;static allScreens=[];static clickArea=new a.Graphics;static doPointerLock=!1;static settingsPane;constructor(e){v.app=e,Object.defineProperty(window,"onDropEvent",{value:e=>{if(e.preventDefault(),e.dataTransfer.items){let t=[...e.dataTransfer.items][0];if("file"==t.kind){const e=t.getAsFile();(0,f.unzip)(e).then((e=>{let{entries:t}=e;for(const[e,i]of Object.entries(t))if(e.endsWith(".osu")){i.text().then((async e=>{let i=p.BeatmapParser.Parse(e),n=i.Events.Events.find((e=>{if(e instanceof m.EventBackground)return e}));if(n)for(const[e,s]of Object.entries(t))e==n.filename&&(i.background=await s.blob());for(const[e,n]of Object.entries(t))if(e==i.General.AudioFilename){let e=await n.blob(),t=URL.createObjectURL(e);v.AudioEngine.PlayMusicImmediately(t,i,(()=>{console.log("Now playing "+i.Metadata.TitleUnicode+" - "+i.Metadata.ArtistUnicode+" ("+i.Metadata.Title+" - "+i.Metadata.Artist+")")})),console.log(i)}}));break}}))}}}}),Object.defineProperty(window,"onDragEvent",{value:e=>{e.preventDefault()}}),v.app.canvas.setAttribute("ondrop","window.onDropEvent(event);"),v.app.canvas.setAttribute("ondragover","window.onDragEvent(event);"),document.body.appendChild(v.app.canvas),v.settingsPane=new g.SettingsPane,v.settingsPane.zIndex=999998,v.app.stage.addChild(v.settingsPane),document.addEventListener("keydown",(e=>{e.ctrlKey&&"KeyO"==e.code&&v.settingsPane.toggle()})),this.doResize(),window.addEventListener("resize",this.doResize),v.app.ticker.add((()=>{h.update()})),v.app.stage.eventMode="static",v.AudioEngine=new d.AudioEngine,v.app.stage.addEventListener("mousemove",(e=>{v.mousePos.x=e.clientX,v.mousePos.y=e.clientY,v.cursor&&v.cursor.updateMouse()})),document.addEventListener("pointerlockchange",this.pointerLockChanged,!1),v.switchScreen(new r.LoadScreen),u.Loader.Load(v.AudioEngine.audioContext).then((()=>{v.cursor=new c.MenuCursor(!1);let e=u.Loader.GetAudio("sample_dialog_ok"),t=u.Loader.Get("introTrianglesTrack");v.switchScreen(new l.InteractScreen(t,e))}))}static lockKeyboard(){navigator.keyboard&&navigator.keyboard.lock([]).then((()=>{console.log("Locked keyboard!"),document.fullscreenElement||console.warn("Keyboard lock won't work unless the user is in fullscreen (as requested by the game, not if the user just presses F11)!")}))}static pointerLock(){try{this.doPointerLock=!0,v.app.canvas.requestPointerLock({unadjustedMovement:!0})}catch(e){console.warn("Failed to lock cursor, error:",e),this.doPointerLock=!1}}static exitPointerLock(){this.doPointerLock=!1,v.app.canvas.exitPointerLock()}static switchScreen(e){null!=this.currentScreen&&(this.currentScreen.zIndex=1,this.currentScreen.onClose().then((e=>{for(let t=0;t{e.onResize()})),v.settingsPane.resize()}pointerLockChanged(){!document.pointerLockElement&&v.doPointerLock?(a.EventSystem.isPointerLocked=!1,v.pointerLockExitTime=Date.now(),v.clickArea=new a.Graphics,v.clickArea.rect(0,0,1,1),v.clickArea.fill("rgba(0,0,0,0.1)"),v.clickArea.width=window.innerWidth,v.clickArea.height=window.innerHeight,v.clickArea.position.set(0,0),v.app.stage.addChild(v.clickArea),v.clickArea.eventMode="static",v.clickArea.cursor="pointer",v.cursor.PopOut(),v.clickArea.zIndex=9999999,v.clickArea.onclick=()=>{Date.now()-v.pointerLockExitTime<1500||(v.clickArea.removeFromParent(),v.clickArea.destroy(),v.pointerLock(),v.cursor.PopIn())}):a.EventSystem.isPointerLocked=!0}}t.Main=v},11307:function(e,t,i){i.r(t)},58689:function(e,t,i){i.r(t),t.default="in vec2 vUV;\nin vec2 vPositionOffset;\nin vec2 vPosition;\nin vec4 vColorTint;\nuniform sampler2D uTexture;\nuniform float time;\n\nvoid main() {\n float a = ((vPositionOffset.y + vPosition.y)/1200.0) - 0.1;\n vec4 color = texture(uTexture, vUV);\n if (a > 1.0) {\n a = 1.0;\n }\n gl_FragColor = (color*vColorTint)*a;\n}"},46404:function(e,t,i){i.r(t),t.default="in vec2 aPosition;\nin vec2 aUV;\nin vec2 aPositionOffset;\nin vec4 aColorTint;\n\nout vec2 vUV;\nout vec2 vPositionOffset;\nout vec2 vPosition;\nout vec4 vColorTint;\n\nuniform mat3 uProjectionMatrix;\nuniform mat3 uWorldTransformMatrix;\nuniform mat3 uTransformMatrix;\n\n\nvoid main() {\n\n mat3 mvp = uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\n gl_Position = vec4((mvp * vec3(aPosition + aPositionOffset, 1.0)).xy, 0.0, 1.0);\n vPositionOffset = aPositionOffset;\n vUV = aUV;\n vPosition = aPosition;\n vColorTint = aColorTint;\n}"},61630:function(e,t,i){i.r(t),t.default="struct GlobalUniforms {\n uProjectionMatrix:mat3x3,\n uWorldTransformMatrix:mat3x3,\n uWorldColorAlpha: vec4,\n uResolution: vec2,\n}\n\nstruct LocalUniforms {\n uTransformMatrix:mat3x3,\n uColor:vec4,\n uRound:f32,\n}\n\n\n@group(0) @binding(0) var globalUniforms : GlobalUniforms;\n@group(1) @binding(0) var localUniforms : LocalUniforms;\n\nstruct VertexOutput {\n @builtin(position) position: vec4,\n @location(0) vUV: vec2,\n @location(1) vPositionOffset: vec2,\n @location(2) vPosition: vec2,\n @location(3) vColorTint: vec4\n};\n\n\n@vertex\nfn mainVert(\n @location(0) aPosition : vec2,\n @location(1) aUV : vec2,\n @location(2) aColorTint : vec4,\n @location(3) aPositionOffset : vec2,\n) -> VertexOutput {\n var mvp = globalUniforms.uProjectionMatrix\n * globalUniforms.uWorldTransformMatrix\n * localUniforms.uTransformMatrix;\n\n var output: VertexOutput;\n\n output.position = vec4(mvp * vec3(aPosition+aPositionOffset, 1.0), 1.0);\n output.vUV = aUV;\n output.vPosition = aPosition;\n output.vPositionOffset = aPositionOffset;\n output.vColorTint = aColorTint;\n\n return output;\n};\n\nstruct WaveUniforms {\n time:f32,\n}\n\n@group(2) @binding(1) var uTexture : texture_2d;\n@group(2) @binding(2) var uSampler : sampler;\n@group(2) @binding(3) var waveUniforms : WaveUniforms;\n\n@fragment\nfn mainFrag(\n @location(0) vUV: vec2,\n @location(1) vPositionOffset: vec2,\n @location(2) vPosition: vec2,\n @location(3) vColorTint: vec4\n) -> @location(0) vec4 {\n var a: f32 = ((vPositionOffset.y + vPosition.y)/1200.0) - 0.1;\n let color: vec4 = textureSample(uTexture, uSampler, vUV);\n if (a > 1.0){\n a = 1.0;\n }\n return (color*vColorTint)*a;\n};"},44160:function(e,t,i){i.r(t),t.default="in vec4 vColor;\nin vec2 vUV;\n\nuniform sampler2D uTexture;\nuniform float progress;\n\nvoid main() {\n vec4 color = texture2D(uTexture, vUV);\n float a = vColor.a * color.a;\n vec4 _vColor = vec4(smoothstep(0.88, 1.0, color.a))*vColor;\n vec4 outColor = (color.r < progress) ? vec4(_vColor.rgb * a, a) : vec4(0.0);\n gl_FragColor = outColor;\n}\n"},26045:function(e,t,i){i.r(t),t.default="in vec2 aPosition;\nin vec4 aColor;\nin vec2 aUV;\n\nout vec4 vColor;\nout vec2 vUV;\n\nuniform mat3 uProjectionMatrix;\nuniform mat3 uWorldTransformMatrix;\n\nuniform mat3 uTransformMatrix;\n\n\nvoid main() {\n\n mat3 mvp = uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\n gl_Position = vec4((mvp * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n\n vColor = aColor;\n vUV = aUV;\n}\n"},46110:function(e,t,i){i.r(t),t.default="struct GlobalUniforms {\n uProjectionMatrix:mat3x3,\n uWorldTransformMatrix:mat3x3,\n uWorldColorAlpha: vec4,\n uResolution: vec2,\n}\n\nstruct LocalUniforms {\n uTransformMatrix:mat3x3,\n uColor:vec4,\n uRound:f32,\n}\n\n\n@group(0) @binding(0) var globalUniforms : GlobalUniforms;\n@group(1) @binding(0) var localUniforms : LocalUniforms;\n\nstruct VertexOutput {\n @builtin(position) position: vec4,\n @location(0) vUV: vec2,\n @location(1) vColor: vec4,\n};\n\n\n@vertex\nfn mainVert(@location(0) aPosition : vec2, @location(1) aUV : vec2, @location(2) aColor: vec4\n) -> VertexOutput {\n var mvp = globalUniforms.uProjectionMatrix\n * globalUniforms.uWorldTransformMatrix\n * localUniforms.uTransformMatrix;\n\n var output: VertexOutput;\n\n output.position = vec4(mvp * vec3(aPosition, 1.0), 1.0);\n output.vUV = aUV;\n output.vColor = aColor;\n\n return output;\n};\n\nstruct ProgressUniform {\n progress:f32\n}\n\n@group(2) @binding(1) var uTexture : texture_2d;\n@group(2) @binding(2) var uSampler : sampler;\n@group(2) @binding(3) var uProgress : ProgressUniform;\n\n@fragment\nfn mainFrag(@location(0) vUV: vec2, @location(1) vColor: vec4) -> @location(0) vec4 {\n let color: vec4 = textureSample(uTexture, uSampler, vUV);\n let a: f32 = color.a;\n let _vColor: vec4 = smoothstep(0.88, 1.0, color.a) * vColor;\n var outColor: vec4 = vec4(0.0);\n if (color.r < uProgress.progress) {\n outColor = vec4(_vColor.rgb * a, a);\n }\n return outColor;\n};\n"}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var o=i[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=t,e=[],n.O=function(t,i,s,o){if(!i){var a=1/0;for(c=0;c=o)&&Object.keys(n.O).every((function(e){return n.O[e](i[l])}))?i.splice(l--,1):(r=!1,o0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[i,s,o]},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={179:0};n.O.j=function(t){return 0===e[t]};var t=function(t,i){var s,o,a=i[0],r=i[1],l=i[2],u=0;if(a.some((function(t){return 0!==e[t]}))){for(s in r)n.o(r,s)&&(n.m[s]=r[s]);if(l)var c=l(n)}for(t&&t(i);u 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import {BeatmapData} from \"../Util/Beatmap/Data/BeatmapData\";\nimport {Main} from \"../main\";\n\nexport class Audio {\n public audio!: AudioBuffer;\n public source?: AudioBufferSourceNode;\n public mediaSource?: MediaElementAudioSourceNode;\n public mediaAudioElement!: HTMLAudioElement;\n public id!: number;\n public get isPaused() {\n return this._useMediaSource ? this.mediaAudioElement.paused : false;\n }\n public get isPlaying() {\n return this._useMediaSource ? !this.mediaAudioElement.paused : true;\n }\n public nodes: AudioNode[] = [];\n public tempArrayMain = new Float32Array(256);\n public tempArrayL = new Float32Array(64);\n public tempArrayR = new Float32Array(64);\n public LeftChannel: number = 0;\n public RightChannel: number = 0;\n public FrequencyAmplitudes = new Float32Array(256);\n protected _connectedToContext = false;\n protected _useMediaSource = false;\n protected _onEndCallback?: () => void;\n public timeStarted = 0; // only for silent audio when real music is paused\n protected paused = false; // used to check if music was paused outside of Audio class (i.e. pressing stop media button on the keyboard)\n\n public GetMaximumAudioLevel() {\n return Math.max(this.LeftChannel, this.RightChannel);\n }\n\n public GetAverageAudioLevel() {\n return (this.LeftChannel + this.RightChannel) / 2;\n }\n\n public Create(audioContext: AudioContext, useMediaSource?: boolean) {\n this._useMediaSource = useMediaSource ? useMediaSource : false;\n if (!useMediaSource) {\n this.source = audioContext.createBufferSource();\n this.source.buffer = this.audio;\n }\n else {\n if (!this.mediaAudioElement) {\n throw new Error(\"HTML Audio Element was not initialized!\")\n }\n this.mediaSource = audioContext.createMediaElementSource(this.mediaAudioElement);\n this.mediaAudioElement.onpause = () => {\n if (!this.paused && !this.mediaAudioElement.ended) { // check if music was paused outside of Audio class\n this.Play();\n }\n }\n }\n }\n\n public AddAudioNode(node: AudioNode) {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n this.nodes.push(node);\n }\n\n public GetNode(type: new (...args: any[]) => T): T[] | null {\n let nodes = this.nodes.filter(node => node instanceof type) as T[];\n if (nodes.length > 0) {\n return nodes;\n } else {\n return null;\n }\n }\n\n public ConnectToContext(audioContext: AudioContext, howToConnectFunction?: (nodes: AudioNode[], source: AudioBufferSourceNode | MediaElementAudioSourceNode) => void) {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (this._connectedToContext) {\n return;\n }\n this._connectedToContext = true;\n if (this.nodes.length > 0) {\n if (howToConnectFunction) {\n howToConnectFunction(this.nodes, (!this._useMediaSource ? this.source : this.mediaSource)!);\n } else {\n this.nodes.forEach((node, index) => {\n this.source!.connect(node);\n if (!(node instanceof AnalyserNode)) {\n node.connect(audioContext.destination);\n }\n });\n }\n } else {\n if (!this._useMediaSource) {\n this.source!.connect(audioContext.destination);\n }\n else {\n this.mediaSource!.connect(audioContext.destination);\n }\n }\n }\n\n public Play() {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n this.paused = false;\n if (!this._useMediaSource) {\n this.source!.start();\n }\n else {\n this.mediaAudioElement!.play();\n }\n }\n\n public Pause() {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n if (!this._useMediaSource) {\n throw new Error(\"Pause is not supported on AudioSourceBuffer!\");\n }\n this.paused = true;\n this.mediaAudioElement!.pause();\n }\n\n public Stop() {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n this.paused = true;\n if (!this._useMediaSource) {\n this.source!.stop();\n }\n else {\n this.mediaAudioElement!.pause();\n if (this._onEndCallback) {\n this._onEndCallback();\n }\n }\n }\n\n public SetTime(timeMS: number) {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n if (!this._useMediaSource) {\n throw new Error(\"SetTime is not supported on AudioSourceBuffer!\");\n }\n this.mediaAudioElement.currentTime = timeMS/1000;\n }\n\n public GetDuration() {\n return (!this._useMediaSource ? this.audio.duration : this.mediaAudioElement.duration * 1000)\n }\n\n public GetCurrentTime() {\n return this._useMediaSource ? this.mediaAudioElement.currentTime * 1000 : (this.timeStarted != 0 ? Date.now() - this.timeStarted : 0);\n }\n\n public RegisterEndCallBack(callback: () => void) {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n this._onEndCallback = callback;\n if (!this._useMediaSource) {\n this.source!.onended = () => {\n if (!this.isPaused) {\n this.paused = true;\n callback();\n }\n }\n }\n else {\n this.mediaAudioElement.onended = () => {\n this.paused = true;\n callback();\n }\n }\n }\n\n}\n\nexport class MapAudio extends Audio {\n public beatmap!: BeatmapData;\n public fadingOut: boolean = false;\n // @ts-ignore\n public fadeOutTimeout!: Timeout\n public playingCallback?: () => void;\n\n public FadeOut() {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n if (!this._useMediaSource) {\n throw new Error(\"FadeOut is not supported on AudioSourceBuffer!\");\n }\n if (this.fadingOut) {\n return;\n }\n this.fadingOut = true;\n clearTimeout(this.fadeOutTimeout);\n let gainNodes = this.GetNode(GainNode);\n if (gainNodes == null) {\n throw new Error(\"Gain Node doesn't exist on Audio Object!\");\n }\n let gain = gainNodes[0];\n gain.gain.linearRampToValueAtTime(0, Main.AudioEngine.audioContext.currentTime + 1)\n setTimeout(() => {\n this.Stop();\n }, 1000);\n }\n}\n","import {PlayingAudios} from \"./PlayingAudios\";\nimport {Audio, MapAudio} from \"./Audio\";\nimport {BeatmapData} from \"../Util/Beatmap/Data/BeatmapData\";\nimport {Main} from \"../main\";\nimport {UnInheritedTimingPoint} from \"../Util/Beatmap/Data/Sections/TimingPoints/UnInheritedTimingPoint\";\nimport {Effect} from \"../Util/Beatmap/Data/Sections/TimingPoints/Effect\";\n\nexport class AudioEngine {\n public readonly audioContext: AudioContext;\n private readonly _playingAudios: PlayingAudios;\n private _musicQueue: MapAudio[] = [];\n private _audioIdTicker: number = 0;\n private _changeCallbacks: ((mapAudio: MapAudio) => void)[] = [];\n private silentMusic = this.createSilentMusic();\n public useSilentMusic = true;\n\n public constructor() {\n this.audioContext = new AudioContext();\n this._playingAudios = new PlayingAudios();\n Main.app.ticker.add(() => {\n this.update();\n });\n }\n\n public UpdateMusicQueue() {\n if (this._musicQueue[0]) {\n if (!this._musicQueue[0].fadingOut && this._musicQueue[0].GetCurrentTime() == 0) {\n this._play(this._musicQueue[0]);\n this._changeCallbacks.forEach((cb) => cb(this._musicQueue[0]));\n }\n if (this._musicQueue[0].fadingOut && this._musicQueue[1]) {\n if (this._musicQueue[1]) {\n this._play(this._musicQueue[1]);\n this._changeCallbacks.forEach((cb) => cb(this._musicQueue[1]));\n }\n }\n }\n if (!(this._musicQueue.length >= 1)) {\n this.silentMusic = this.createSilentMusic();\n this.useSilentMusic = true;\n }\n else {\n this.useSilentMusic = false;\n }\n }\n\n public createSilentMusic() {\n let mapAudio = new MapAudio();\n mapAudio.timeStarted = Date.now();\n mapAudio.beatmap = new BeatmapData();\n let timingPoint = new UnInheritedTimingPoint();\n timingPoint.time = 0;\n timingPoint.beatLength = 1000;\n timingPoint.effects = Effect.None;\n mapAudio.beatmap.TimingPoints.TimingPoints.push(timingPoint);\n return mapAudio;\n }\n\n public addMusicChangeEventListener(cb: (() => void) | ((mapAudio: MapAudio) => void)) {\n this._changeCallbacks.push(cb);\n }\n\n public removeMusicChangeEventListener(cb: (() => void) | ((mapAudio: MapAudio) => void)) {\n this._changeCallbacks = this._changeCallbacks.filter(callback => callback != cb);\n }\n\n public GetCurrentPlayingMusic(): MapAudio {\n return this.useSilentMusic ? this.silentMusic : this._musicQueue[0];\n }\n\n public GetCurrentPlayingMusicNoSilent(): MapAudio {\n return this._musicQueue[0];\n }\n\n public PlayEffect(audio: AudioBuffer, pitch?: number) {\n let audioObj = new Audio();\n audioObj.audio = audio;\n audioObj.id = this._audioIdTicker;\n this._play(audioObj, pitch);\n this._audioIdTicker++;\n }\n\n public AddToMusicQueue(mapAudio: string, beatMapData: BeatmapData, musicPlayingCallback?: () => void) {\n let mapAudioObj = new MapAudio();\n mapAudioObj.mediaAudioElement = document.createElement(\"audio\");\n mapAudioObj.mediaAudioElement.src = mapAudio;\n mapAudioObj.beatmap = beatMapData;\n mapAudioObj.id = this._audioIdTicker;\n if (musicPlayingCallback) {\n mapAudioObj.playingCallback = musicPlayingCallback;\n }\n this._musicQueue.push(mapAudioObj);\n this._audioIdTicker++;\n this.UpdateMusicQueue();\n return mapAudioObj.id;\n }\n\n public PlayMusicImmediately(mapAudio: string, beatMapData: BeatmapData, musicPlayingCallback?: () => void) {\n let currentPlaying = this.GetCurrentPlayingMusicNoSilent();\n this._musicQueue = [];\n if (currentPlaying) {\n currentPlaying.FadeOut();\n }\n this.AddToMusicQueue(mapAudio, beatMapData, musicPlayingCallback);\n }\n\n public update() {\n let currentPlaying = this.GetCurrentPlayingMusic();\n let currentPlayingNoSilent = this.GetCurrentPlayingMusicNoSilent();\n if (!currentPlayingNoSilent)\n return;\n if (currentPlayingNoSilent.isPaused) {\n this.useSilentMusic = true;\n return;\n }\n else if (this.useSilentMusic) {\n this.useSilentMusic = false;\n currentPlaying = this.GetCurrentPlayingMusic();\n }\n if (!this.useSilentMusic) {\n let analyzerMain = currentPlaying.GetNode(AnalyserNode)![0];\n let analyzerL = currentPlaying.GetNode(AnalyserNode)![1];\n let analyzerR = currentPlaying.GetNode(AnalyserNode)![2];\n\n analyzerMain.getFloatFrequencyData(currentPlaying.tempArrayMain);\n for (let i = 0; i < currentPlaying.FrequencyAmplitudes.length; i++) {\n currentPlaying.tempArrayMain[i] += 140;\n currentPlaying.tempArrayMain[i] /= 340;\n if (i < 3) {\n currentPlaying.tempArrayMain[i] *= (12 * currentPlaying.tempArrayMain[i]);\n } else if (i < 6) {\n currentPlaying.tempArrayMain[i] *= (9 * currentPlaying.tempArrayMain[i]);\n } else if (i < 100) {\n currentPlaying.tempArrayMain[i] *= (6 * currentPlaying.tempArrayMain[i]);\n }\n currentPlaying.tempArrayMain[i] /= 2;\n if (currentPlaying.tempArrayMain[i] == Infinity || currentPlaying.tempArrayMain[i] == -Infinity) {\n currentPlaying.FrequencyAmplitudes[i] = 0;\n }\n else {\n currentPlaying.FrequencyAmplitudes[i] = currentPlaying.tempArrayMain[i];\n }\n }\n\n analyzerL.getFloatTimeDomainData(currentPlaying.tempArrayL);\n analyzerR.getFloatTimeDomainData(currentPlaying.tempArrayR);\n let avgL = 0;\n let avgR = 0;\n currentPlaying.tempArrayL.forEach((value) => {\n avgL += (value + 1)/2;\n });\n currentPlaying.tempArrayR.forEach((value) => {\n avgR += (value + 1)/2;\n });\n avgL /= currentPlaying.tempArrayL.length;\n avgR /= currentPlaying.tempArrayR.length;\n currentPlaying.LeftChannel = avgL;\n currentPlaying.RightChannel = avgR;\n }\n }\n\n private _play(audio: Audio | MapAudio, pitch?: number) {\n // check if audio is type of MapAudio\n if (\"beatmap\" in audio && audio.beatmap) {\n audio.Create(this.audioContext, true);\n let gain = this.audioContext.createGain();\n gain.gain.value = 0;\n let analyzer = this.audioContext.createAnalyser();\n analyzer.fftSize = 512;\n analyzer.smoothingTimeConstant = 0;\n let splitter = this.audioContext.createChannelSplitter(2);\n let analyzerL = this.audioContext.createAnalyser();\n analyzerL.smoothingTimeConstant = 0;\n analyzerL.fftSize = 128;\n let analyzerR = this.audioContext.createAnalyser();\n analyzerR.smoothingTimeConstant = 0;\n analyzerR.fftSize = 128;\n audio.AddAudioNode(gain);\n audio.AddAudioNode(analyzer);\n audio.AddAudioNode(analyzerL);\n audio.AddAudioNode(analyzerR);\n audio.ConnectToContext(this.audioContext, (nodes, source) => {\n source.connect(gain);\n gain.connect(this.audioContext.destination);\n source.connect(analyzer);\n source.connect(splitter);\n splitter.connect(analyzerL, 0);\n splitter.connect(analyzerR, 1);\n });\n audio.Play();\n this._playingAudios.audios.push(audio);\n if (audio.playingCallback) {\n audio.playingCallback();\n }\n let timeOffset = Date.now();\n audio.mediaAudioElement.onloadedmetadata = () => {\n audio.fadeOutTimeout = setTimeout(() => {\n gain.gain.linearRampToValueAtTime(0, this.audioContext.currentTime + 1);\n }, Math.max(0, ((audio.mediaAudioElement.duration - 1) * 1000) - (Date.now() - timeOffset)));\n }\n gain.gain.linearRampToValueAtTime(1, this.audioContext.currentTime + 0.5);\n\n } else {\n audio.Create(this.audioContext, false);\n audio.ConnectToContext(this.audioContext);\n if (pitch) {\n if (audio.source) {\n audio.source.playbackRate.value = pitch;\n }\n }\n audio.Play();\n this._playingAudios.audios.push(audio);\n }\n\n\n audio.RegisterEndCallBack(() => {\n if (\"beatmap\" in audio && audio.beatmap) {\n if (this._musicQueue[0] == audio) {\n this._musicQueue.splice(0, 1);\n }\n this.UpdateMusicQueue();\n }\n this._playingAudios.audios.forEach((audioInArr, index) => {\n if (audioInArr === audio) {\n this._playingAudios.audios.splice(index, 1);\n return;\n }\n });\n });\n }\n\n}\n","import {Audio, MapAudio} from \"./Audio\";\n\nexport class PlayingAudios {\n public audios: (Audio | MapAudio)[] = [];\n}\n","import {Main} from \"../../main\";\nimport {MapAudio} from \"../../Audio/Audio\";\nimport * as PIXI from \"pixi.js\";\nimport {MathUtil} from \"../../Util/MathUtil\";\nimport {Effect} from \"../../Util/Beatmap/Data/Sections/TimingPoints/Effect\";\nimport {UnInheritedTimingPoint} from \"../../Util/Beatmap/Data/Sections/TimingPoints/UnInheritedTimingPoint\";\n\nexport class LogoVisualizer extends PIXI.Container {\n\n public static readonly size = 900;\n public frequencyAmplitudes: Float32Array = new Float32Array(256);\n protected audio!: MapAudio;\n protected temporalAmplitudes: Float32Array = new Float32Array(256);\n protected graphics: PIXI.Graphics = new PIXI.Graphics();\n // The number of bars to jump each update iteration.\n private readonly index_change = 5;\n // The maximum length of each bar in the visualiser. Will be reduced when kiai is not activated.\n private readonly bar_length = 600;\n // The number of bars in one rotation of the visualiser.\n private bars_per_visualiser = 200;\n // How many times we should stretch around the circumference (overlapping overselves).\n private readonly visualiser_rounds = 5;\n // How much should each bar go down each millisecond (based on a full bar).\n private readonly decay_per_millisecond = 0.0024;\n // Number of milliseconds between each amplitude update.\n private readonly time_between_updates = 50;\n // The minimum amplitude to show a bar.\n private readonly amplitude_dead_zone = 1 / this.bar_length;\n private indexOffset = 0;\n private firstDraw = true;\n\n public set alpha(number: number) {\n super.alpha = number * 0.2;\n }\n public get alpha() {\n return super.alpha * 5;\n }\n\n public constructor() {\n super();\n this.alpha = 1;\n }\n\n public start() {\n this.graphics.blendMode = \"add\";\n this.addChild(this.graphics);\n this.graphics.eventMode = \"none\";\n this.eventMode = \"none\";\n setInterval(() => {\n this.updateAmplitudes()\n }, this.time_between_updates);\n\n }\n\n public draw(ticker: PIXI.Ticker) {\n if (this.firstDraw) {\n for (let i = 0; i < this.frequencyAmplitudes.length; i++) {\n this.frequencyAmplitudes[i] = 0;\n }\n }\n this.graphics.clear();\n let decayFactor = ticker.deltaMS * this.decay_per_millisecond;\n for (let i = 0; i < this.bars_per_visualiser; i++) {\n //3% of extra bar length to make it a little faster when bar is almost at it's minimum\n this.frequencyAmplitudes[i] -= decayFactor * (this.frequencyAmplitudes[i] + 0.03);\n if (this.frequencyAmplitudes[i] < 0) {\n this.frequencyAmplitudes[i] = 0;\n }\n }\n\n for (let j = 0; j < this.visualiser_rounds; j++) {\n for (let i = 0; i < this.bars_per_visualiser; i++) {\n if (this.frequencyAmplitudes[i] < this.amplitude_dead_zone) {\n continue;\n }\n\n let rotation = MathUtil.DegreesToRadians(i / this.bars_per_visualiser * 360 + j * 360 / this.visualiser_rounds);\n let rotationCos = Math.cos(rotation);\n let rotationSin = Math.sin(rotation);\n // taking the cos and sin to the 0..1 range\n let barPosition = {\n x: (rotationCos / 2 + 0.5) * LogoVisualizer.size,\n y: (rotationSin / 2 + 0.5) * LogoVisualizer.size\n };\n\n let barSize = {\n x: LogoVisualizer.size * Math.sqrt(2 * (1 - Math.cos(MathUtil.DegreesToRadians(360 / this.bars_per_visualiser)))) / 2,\n y: this.bar_length * this.frequencyAmplitudes[i]\n };\n // The distance between the bottom side of the bar and the top side.\n let amplitudeOffset = {x: rotationCos * barSize.y, y: rotationSin * barSize.y};\n\n this.graphics.moveTo(barPosition.x, barPosition.y);\n this.graphics.lineTo(barPosition.x + amplitudeOffset.x, barPosition.y + amplitudeOffset.y);\n this.graphics.stroke({color: \"rgb(255, 255, 255)\", width: 14});\n }\n }\n this.firstDraw = false;\n }\n\n private updateAmplitudes() {\n this.audio = Main.AudioEngine.GetCurrentPlayingMusic();\n for (let i = 0; i < this.audio.FrequencyAmplitudes.length; i++) {\n this.temporalAmplitudes[i] = this.audio.FrequencyAmplitudes[i];\n }\n let audioTime = this.audio.GetCurrentTime();\n let timingPoint = this.audio.beatmap.TimingPoints.GetCurrentTimingPoints(audioTime)[0];\n for (let i = 0; i < this.bars_per_visualiser; i++) {\n let targetAmplitude = (this.temporalAmplitudes[(i + this.indexOffset) % this.bars_per_visualiser]) *\n (timingPoint.effects == Effect.KiaiTime ? 1 : 0.5);\n if (targetAmplitude > this.frequencyAmplitudes[i]) {\n this.frequencyAmplitudes[i] = targetAmplitude;\n }\n }\n this.indexOffset = (this.indexOffset + this.index_change) % this.bars_per_visualiser;\n }\n}\n","import {LogoVisualizer} from \"../LogoVisualizer\";\nimport * as PIXI from \"pixi.js\";\n\nexport class MenuLogoVisualizer extends LogoVisualizer {\n\n\n public draw(ticker: PIXI.Ticker) {\n super.draw(ticker);\n\n }\n}\n","import * as PIXI from \"pixi.js\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\n\nexport class LoadAnim extends PIXI.Container {\n private readonly bg: PIXI.Graphics;\n private readonly arc: PIXI.Graphics;\n private readonly arcContainer: PIXI.Container;\n private readonly animInterval: NodeJS.Timeout;\n private readonly container: PIXI.Container;\n private readonly bgContainer: PIXI.Container;\n private bgRotation: number = 0;\n\n public constructor(bgColor: string, arcColor: string) {\n super();\n this.pivot.set(0.5, 0.5);\n this.container = new PIXI.Container();\n this.container.alpha = 0;\n this.rotation = Math.PI * 2.5;\n this.bgContainer = new PIXI.Container();\n this.bg = new PIXI.Graphics();\n this.bg.roundRect(-50, -50, 100, 100, 25);\n this.bg.fill(bgColor);\n this.arcContainer = new PIXI.Container();\n this.arc = new PIXI.Graphics();\n this.arc.arc(0, 0, 27, Math.PI + .26, 2.92 * Math.PI);\n this.arc.stroke({\n width: 8,\n color: arcColor,\n cap: \"round\"\n });\n this.arc.scale.set(-1, 1);\n this.container.scale.set(0.5, 0.5);\n this.bgContainer.addChild(this.bg);\n this.arcContainer.addChild(this.arc);\n this.bgContainer.addChild(this.arcContainer);\n this.container.addChild(this.bgContainer);\n this.addChild(this.container);\n Ease.getEase(this.container).ScaleTo(1, 400, TWEEN.Easing.Quadratic.InOut)\n .FadeIn(400, TWEEN.Easing.Quadratic.InOut)\n this.doAnims();\n\n this.animInterval = setInterval(() => {\n this.doAnims();\n }, 800);\n }\n\n public doAnims() {\n this.bgRotation += 90;\n Ease.getEase(this.bgContainer).createTween({value: this.bgContainer.angle},\n {value: this.bgRotation}, true, \"angle\", 600, TWEEN.Easing.Quadratic.InOut);\n }\n\n public getWidth() {\n return 100 * this.scale.x;\n }\n\n public getHeight() {\n return 100 * this.scale.y;\n }\n\n public draw(deltaTime: PIXI.Ticker) {\n this.arcContainer.angle += (3 * deltaTime.deltaTime);\n }\n\n public destroy(_options?: PIXI.DestroyOptions | boolean) {\n Ease.getEase(this.container).FadeOut(400, TWEEN.Easing.Quadratic.InOut)\n .ScaleTo(0.5, 400, TWEEN.Easing.Quadratic.InOut);\n setTimeout(() => {\n clearInterval(this.animInterval);\n super.destroy(_options);\n }, 400);\n }\n\n}\n","import * as PIXI from \"pixi.js\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../../../Util/TweenWrapper/Ease\";\nimport {OsuLogo} from \"../OsuLogo\";\nimport {Screen} from \"../../../../Screens/Screen\";\nimport {LogoTrackingContainer} from \"./LogoTrackingContainer\";\n\nexport class ButtonSystem extends PIXI.Container {\n\n private menuBG = new PIXI.Graphics();\n private isOpened = false;\n private logo: OsuLogo;\n private state = ButtonSystemState.Initial;\n private logoTrackingContainer = new LogoTrackingContainer();\n private readonly menuHeight = 150;\n\n private get State() {\n return this.state;\n }\n\n private set State(state: ButtonSystemState) {\n if (this.state == state) return;\n\n const lastState = this.state;\n this.state = state;\n\n this.updateLogoState(lastState);\n\n console.log(`${this.constructor.name}'s state changed from ${lastState} to ${state}`)\n }\n\n private updateLogoState(lastState = ButtonSystemState.Initial) {\n switch (this.state) {\n case ButtonSystemState.Exit:\n case ButtonSystemState.Initial:\n this.Close();\n break;\n case ButtonSystemState.TopLevel:\n case ButtonSystemState.Play:\n switch (lastState) {\n case ButtonSystemState.TopLevel: // coming from toplevel to play\n break;\n\n case ButtonSystemState.Initial:\n this.Open();\n Ease.getEase(this.logo).ClearEasings().ScaleTo(Screen.getScaleBasedOffScreenSize() * 0.5, 200, TWEEN.Easing.Linear.In);\n break;\n\n default:\n this.Open();\n Ease.getEase(this.logo).ClearEasings().ScaleTo(Screen.getScaleBasedOffScreenSize() * 0.5, 200, TWEEN.Easing.Quintic.Out);\n break;\n }\n break;\n }\n }\n\n public constructor(logo: OsuLogo) {\n super();\n this.logo = logo;\n this.drawMenuBG();\n this.scale.y = 0;\n this.alpha = 0;\n this.addChild(this.menuBG);\n this.addChild(this.logoTrackingContainer);\n this.logo.Action = () => {return this.onOsuLogo();};\n }\n\n private drawMenuBG() {\n this.menuBG.rect(0, Screen.getScaleBasedOffScreenSize() * -(this.menuHeight/2), 1, Screen.getScaleBasedOffScreenSize() * this.menuHeight);\n this.menuBG.fill({color: \"rgb(50,50,50)\"});\n }\n\n private onOsuLogo(): boolean {\n switch (this.state) {\n default:\n return false;\n\n case ButtonSystemState.Initial:\n this.State = ButtonSystemState.TopLevel;\n return true;\n\n case ButtonSystemState.TopLevel:\n\n return false;\n\n case ButtonSystemState.Play:\n\n return false;\n\n case ButtonSystemState.Edit:\n\n return false;\n }\n }\n\n private Open() {\n setTimeout(() => {\n this.isOpened = true;\n Ease.getEase(this).ScaleTo(1, 400, TWEEN.Easing.Quintic.Out)\n .FadeIn(400, TWEEN.Easing.Quintic.Out);\n }, 150);\n }\n\n private Close() {\n this.isOpened = false;\n Ease.getEase(this).ClearEasings().ScaleTo({x: 1, y: 0}, 300, TWEEN.Easing.Sinusoidal.In)\n .FadeOut(300, TWEEN.Easing.Sinusoidal.In);\n }\n\n public isOpen() {\n return this.isOpened;\n }\n\n public onResize() {\n this.menuBG.clear();\n this.drawMenuBG();\n this.position.set(0, window.innerHeight/2);\n this.menuBG.width = window.innerWidth;\n }\n}\n\nenum ButtonSystemState {\n Exit = \"Exit\",\n Initial = \"Initial\",\n TopLevel = \"TopLevel\",\n Play = \"Play\",\n Edit = \"Edit\",\n EnteringMode = \"EnteringMode\",\n}\n","import * as PIXI from \"pixi.js\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {OsuLogo} from \"../OsuLogo\";\n\nexport class LogoTrackingContainer extends PIXI.Container {\n protected Logo: OsuLogo | null = null;\n\n private easing!: (amount: number) => number;\n private startPosition: {x: number, y: number} | null = null;\n private startTime: number | null = null;\n private duration!: number;\n\n private readonly visual_box_size = 72;\n\n public StartTracking(logo: OsuLogo, duration: number = 0, easing: (amount: number) => number = TWEEN.Easing.Linear.None) {\n if (logo.IsTracking && this.Logo == null)\n throw new Error(\"Cannot track an instance of OsuLogo to multiple LogoTrackingContainers\");\n\n if (this.Logo != logo && this.Logo != null)\n {\n // If we're replacing the logo to be tracked, the old one no longer has a tracking container\n this.Logo.IsTracking = false;\n }\n\n this.Logo = logo;\n this.Logo.IsTracking = true;\n\n this.duration = duration;\n this.easing = easing;\n\n this.startTime = null;\n this.startPosition = null;\n }\n\n public StopTracking() {\n if (this.Logo != null)\n {\n this.Logo.IsTracking = false;\n this.Logo = null;\n }\n }\n\n protected ComputeLogoTrackingPosition() {\n let pos = this.Logo!.position;\n pos.x = window.innerWidth/3;\n return pos;\n }\n\n public Update() {\n if (this.Logo == null)\n return;\n }\n\n}\n","import * as PIXI from \"pixi.js\";\nimport {Triangles} from \"./Triangles\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../../Util/TweenWrapper/Ease\";\nimport {Main} from \"../../../main\";\nimport {Loader} from \"../../../Loader\";\nimport {ButtonSystem} from \"./Menu/ButtonSystem\";\nimport {MenuLogoVisualizer} from \"../../AudioVisualizers/impl/MenuLogoVisualizer\";\nimport {LogoVisualizer} from \"../../AudioVisualizers/LogoVisualizer\";\nimport {Effect} from \"../../../Util/Beatmap/Data/Sections/TimingPoints/Effect\";\nimport {UnInheritedTimingPoint} from \"../../../Util/Beatmap/Data/Sections/TimingPoints/UnInheritedTimingPoint\";\nimport {MathUtil} from \"../../../Util/MathUtil\";\n\nexport class OsuLogo extends PIXI.Container {\n\n private readonly outline: PIXI.Sprite;\n private readonly visualizer: MenuLogoVisualizer = new MenuLogoVisualizer();\n private readonly triangles: Triangles = new Triangles();\n private readonly flash;\n private readonly logoContainer = new PIXI.Container;\n private readonly logoBounceContainer = new PIXI.Container();\n private readonly logoBeatContainer = new PIXI.Container();\n private readonly logoAmplitudeContainer = new PIXI.Container();\n private readonly logoHoverContainer = new PIXI.Container();\n private readonly rippleContainer = new PIXI.Container();\n private readonly ripple;\n private readonly defaultVisualizerAlpha = 0.5;\n private readonly early_activation = 60;\n private timeElapsedSinceLastBeat = 0;\n private timeUntilNextBeat = 0;\n private lastTimeElapasedSinceLastBeat = 0;\n\n private selectSample = Loader.GetAudio(\"mainMenu.osuLogo.select\");\n private backToLogoSample = Loader.GetAudio(\"mainMenu.osuLogo.backToLogo\");\n\n private isMouseDown = false;\n private mouseDownPosition = {x: 0, y: 0};\n\n public Action: (() => boolean) | null = null;\n\n public IsTracking: boolean = false;\n\n public get SizeForFlow() {\n return this.outline.width * this.logoBounceContainer.scale.x * this.logoHoverContainer.scale.x;\n }\n\n\n public constructor() {\n super();\n this.visualizer.start();\n\n\n this.outline = PIXI.Sprite.from(\"mainMenu.logoOutline\");\n this.outline.anchor.set(0.5, 0.5);\n //approximation of size in actual osu!lazer\n let scale = 0.7;\n this.visualizer.scale.set(scale);\n this.visualizer.pivot.set(LogoVisualizer.size/2, LogoVisualizer.size/2);\n this.visualizer.alpha = this.defaultVisualizerAlpha;\n\n let mask = new PIXI.Graphics();\n mask.circle(0,0,450);\n mask.fill({color:\"white\"});\n mask.scale = scale;\n\n\n this.flash = PIXI.Sprite.from(\"mainMenu.logoMask\");\n this.flash.anchor.set(0.5, 0.5);\n this.flash.scale = scale;\n this.flash.blendMode = \"add\";\n this.flash.alpha = 0;\n\n this.triangles.flash.anchor.set(0.5, 0.5);\n this.triangles.flash.scale = scale;\n\n this.outline.scale.set(scale);\n this.triangles.scale.set(scale);\n this.triangles.position.set(-(this.outline.width / 2), -(this.outline.height / 2));\n this.triangles.mask = mask;\n\n this.ripple = PIXI.Sprite.from(\"mainMenu.logoMask\");\n this.ripple.anchor.set(0.5, 0.5);\n this.ripple.scale = scale;\n this.ripple.alpha = 0;\n this.ripple.blendMode = \"add\";\n\n this.rippleContainer.addChild(this.ripple);\n this.logoContainer.addChild(this.visualizer);\n this.logoContainer.addChild(this.triangles);\n this.logoContainer.addChild(this.triangles.flash);\n this.logoContainer.addChild(mask);\n this.logoContainer.addChild(this.flash);\n this.logoContainer.addChild(this.outline);\n this.logoContainer.hitArea = new PIXI.Circle(0, 0, 480 * scale);\n this.logoContainer.eventMode = \"static\";\n\n this.logoContainer.onmouseenter = this._onmouseenter;\n this.logoContainer.onmouseleave = this._onmouseleave;\n this.logoContainer.onmousedown = this._onmousedown;\n this.logoContainer.onclick = this._onclick;\n\n this.logoBeatContainer.addChild(this.logoContainer);\n this.logoAmplitudeContainer.addChild(this.logoBeatContainer);\n this.logoBounceContainer.addChild(this.rippleContainer);\n this.logoBounceContainer.addChild(this.logoAmplitudeContainer);\n this.logoHoverContainer.addChild(this.logoBounceContainer);\n this.addChild(this.logoHoverContainer)\n\n // register event listeners\n Main.app.stage.addEventListener(\"mouseup\", (e) => {\n this._onmouseup(e);\n });\n\n }\n\n\n public _onmouseenter = (e: PIXI.FederatedMouseEvent) => {\n Ease.getEase(this.logoHoverContainer).ScaleTo(1.1, 500, TWEEN.Easing.Elastic.Out);\n }\n\n public _onmouseleave = (e: PIXI.FederatedMouseEvent) => {\n Ease.getEase(this.logoHoverContainer).ScaleTo(1, 500, TWEEN.Easing.Elastic.Out);\n }\n\n public _onmousedown = (e: PIXI.FederatedMouseEvent) => {\n this.isMouseDown = true;\n Ease.getEase(this.logoBounceContainer).ClearEasings().ScaleTo(0.9, 1000, TWEEN.Easing.Sinusoidal.Out);\n this.mouseDownPosition = {x: Main.mousePos.x, y: Main.mousePos.y};\n }\n\n public _onclick = (e: PIXI.FederatedMouseEvent) => {\n this.flash.alpha = 0.4;\n Ease.getEase(this.flash).ClearEasings()\n .FadeOut(1500, TWEEN.Easing.Exponential.Out);\n if (this.Action) {\n if(this.Action()){\n Main.AudioEngine.PlayEffect(Loader.GetAudio(\"mainMenu.osuLogo.select\"));\n }\n }\n }\n\n public _onmouseup = (e: PIXI.FederatedMouseEvent) => {\n this.isMouseDown = false;\n Ease.getEase(this.logoBounceContainer).ClearEasings().ScaleTo(1, 500, TWEEN.Easing.Elastic.Out)\n .TransformTo({x: 0, y: 0}, 800, TWEEN.Easing.Elastic.Out);\n }\n\n public draw(ticker: PIXI.Ticker) {\n this.visualizer.draw(ticker);\n this.triangles.draw(ticker);\n //this.timeElapsedSinceLastBeat += ticker.deltaMS;\n let audio = Main.AudioEngine.GetCurrentPlayingMusic();\n let audioTime = audio.GetCurrentTime();\n let timingPoint = audio.beatmap.TimingPoints.GetCurrentUninheritedTimingPoint(audioTime);\n this.timeUntilNextBeat = (timingPoint.time - audioTime) % timingPoint.beatLength;\n if (this.timeUntilNextBeat <= 0) {\n this.timeUntilNextBeat += timingPoint.beatLength;\n }\n this.timeElapsedSinceLastBeat = timingPoint.beatLength - this.timeUntilNextBeat;\n if (!Main.AudioEngine.useSilentMusic) {\n let maxAmplitude = audio.GetMaximumAudioLevel();\n this.logoAmplitudeContainer.scale.set(MathUtil.Damp(this.logoAmplitudeContainer.scale.x,\n 1 - Math.max(0, maxAmplitude - 0.4) * 0.04, 0.9, ticker.deltaMS))\n this.triangles.Velocity = MathUtil.Damp(this.triangles.Velocity,\n 0.5 * (timingPoint.effects == Effect.KiaiTime ? 4 : 2), 0.995, ticker.deltaMS);\n } else {\n this.logoAmplitudeContainer.scale = 1;\n this.triangles.Velocity = MathUtil.Damp(this.triangles.Velocity, 0.5, 0.9, ticker.deltaMS);\n }\n if (this.lastTimeElapasedSinceLastBeat > this.timeElapsedSinceLastBeat) {\n this.onNewBeat();\n }\n\n this.lastTimeElapasedSinceLastBeat = this.timeElapsedSinceLastBeat;\n\n if (this.isMouseDown) {\n let change = {x: Main.mousePos.x - this.mouseDownPosition.x, y: Main.mousePos.y - this.mouseDownPosition.y};\n let length = Math.sqrt(change.x * change.x + change.y * change.y);\n // Diminish the drag distance as we go further to simulate \"rubber band\" feeling.\n change.x *= length <= 0 ? 0 : Math.pow(length, 0.6) / length;\n change.y *= length <= 0 ? 0 : Math.pow(length, 0.6) / length;\n this.logoBounceContainer.x = change.x;\n this.logoBounceContainer.y = change.y;\n }\n\n\n }\n\n private onNewBeat() {\n let audio = Main.AudioEngine.GetCurrentPlayingMusic();\n let audioTime = audio.GetCurrentTime();\n let timingPointUninherited = audio.beatmap.TimingPoints.GetCurrentUninheritedTimingPoint(audioTime);\n let beatLength = timingPointUninherited.beatLength;\n let timingPoint = audio.beatmap.TimingPoints.GetCurrentTimingPoints(audioTime)[0];\n let maxAmplitude = !Main.AudioEngine.useSilentMusic ? audio.GetMaximumAudioLevel() : 0;\n let amplitudeAdjust = Math.min(1, 0.2 + maxAmplitude);\n Ease.getEase(this.logoBeatContainer).ScaleTo(1 - 0.02 * amplitudeAdjust, this.early_activation, TWEEN.Easing.Linear.None).Then()\n .ScaleTo(1, beatLength * 2, TWEEN.Easing.Quintic.Out);\n this.rippleContainer.scale = 1.02;\n Ease.getEase(this.rippleContainer).ClearEasings().ScaleTo(1.02 * (1 + 0.04 * amplitudeAdjust), beatLength, TWEEN.Easing.Quintic.Out);\n this.ripple.alpha = 0.15 * amplitudeAdjust;\n Ease.getEase(this.ripple).ClearEasings().FadeOut(beatLength, TWEEN.Easing.Quintic.Out);\n\n\n if (timingPoint.effects == Effect.KiaiTime) {\n Ease.getEase(this.triangles.flash).ClearEasings()\n .FadeTo(0.2 * amplitudeAdjust, this.early_activation, TWEEN.Easing.Linear.None).Then()\n .FadeTo(0, beatLength, TWEEN.Easing.Linear.None);\n Ease.getEase(this.visualizer).ClearEasings()\n .FadeTo(this.defaultVisualizerAlpha * 1.8 * amplitudeAdjust, this.early_activation, TWEEN.Easing.Linear.None).Then()\n .FadeTo(this.defaultVisualizerAlpha, beatLength, TWEEN.Easing.Linear.None);\n }\n setTimeout(() => {\n this.triangles.Velocity += amplitudeAdjust * (timingPoint.effects == Effect.KiaiTime ? 6 : 3);\n }, 60)\n\n }\n\n}\n","import * as PIXI from \"pixi.js\";\nimport {Main} from \"../../../main\";\nimport glVertShader from \"./osuCircleTriangles.vert\";\nimport glFragShader from \"./osuCircleTriangles.frag\";\nimport gpuShader from \"./osuCircleTriangles.wgsl\";\n\nexport class Triangles extends PIXI.Container {\n\n public flash: PIXI.Sprite;\n public Velocity: number = 1;\n private readonly bgGradient: PIXI.FillGradient;\n private triangles: Triangle[] = [];\n private graphics: PIXI.Graphics = new PIXI.Graphics();\n private timeSinceLastSpawn = 0;\n private instancePositionBuffer;\n private readonly totalTriangles = 15;\n\n public constructor() {\n super();\n\n let colorStops = [0xff66ab, 0xcc5289];\n this.bgGradient = new PIXI.FillGradient(0, 0, 0, 1024);\n colorStops.forEach((number, index) => {\n const ratio = index / colorStops.length;\n this.bgGradient.addColorStop(ratio, number);\n });\n\n for (let i = 0; i < this.totalTriangles; i++) {\n this.triangles.push({x: this.random(0, 1024), y: this.random(0, 1024), velocity: this.randVelocity()});\n }\n this.timeSinceLastSpawn = Date.now();\n\n this.graphics.rect(0, 0, 1024, 1024);\n this.graphics.fill(this.bgGradient);\n this.addChild(this.graphics);\n\n this.flash = PIXI.Sprite.from(\"mainMenu.logoMask\");\n //this.flash.anchor.set(0.5, 0.5);\n this.flash.alpha = 0;\n this.flash.blendMode = \"add\";\n\n this.instancePositionBuffer = new PIXI.Buffer({\n data: new Float32Array(this.totalTriangles * 2),\n usage: PIXI.BufferUsage.VERTEX | PIXI.BufferUsage.COPY_DST\n });\n const color = new PIXI.Color(\"rgb(182, 52, 111)\");\n const size = 30;\n const geometry = new PIXI.Geometry({\n attributes: {\n aPosition: [\n -10*size,\n -10*size, // x, y\n 10*size,\n -10*size, // x, y\n 10*size,\n 7.5*size, // x, y,\n -10*size,\n 7.5*size, // x, y,\n ],\n aUV: [0, 0, 1, 0, 1, 1, 0, 1],\n aColorTint: [\n color.red, color.green, color.blue, 1,\n color.red, color.green, color.blue, 1,\n color.red, color.green, color.blue, 1,\n color.red, color.green, color.blue, 1\n ],\n aPositionOffset: {\n buffer: this.instancePositionBuffer,\n instance: true\n }\n },\n indexBuffer: [0, 1, 2, 0, 2, 3],\n instanceCount: this.totalTriangles\n });\n const gl = {\n vertex: glVertShader,\n fragment: glFragShader\n };\n\n const gpu = {\n vertex: {\n entryPoint: \"mainVert\",\n source: gpuShader\n },\n fragment: {\n entryPoint: \"mainFrag\",\n source: gpuShader\n }\n };\n\n const triangleGraphic = new PIXI.Graphics();\n triangleGraphic.moveTo(0, 0);\n triangleGraphic.lineTo(-256, 512);\n triangleGraphic.lineTo(256, 512);\n triangleGraphic.lineTo(0, 0);\n triangleGraphic.stroke({color: \"white\", width: 4});\n\n const triangleTexture = Main.app.renderer.generateTexture(triangleGraphic);\n\n const shader = PIXI.Shader.from({\n gl,\n gpu,\n resources: {\n uTexture: triangleTexture.source,\n uSampler: triangleTexture.source.style,\n waveUniforms: {\n time: { value: 1, type: \"f32\" }\n }\n }\n });\n\n const triangleMesh = new PIXI.Mesh({\n geometry,\n shader\n });\n\n this.addChild(triangleMesh);\n\n\n\n }\n\n public destroy(options?: PIXI.DestroyOptions) {\n super.destroy(options);\n }\n\n public draw(ticker: PIXI.Ticker) {\n const data = this.instancePositionBuffer.data;\n let count = 0;\n\n for (let i = 0; i < this.totalTriangles; i++) {\n const triangle = this.triangles[i];\n\n triangle.y -= ((ticker.deltaTime * this.Velocity * triangle.velocity)*1.2);\n\n if (triangle.y + 100 < 0) {\n triangle.y = 1024 + 250;\n }\n\n data[count++] = triangle.x;\n data[count++] = triangle.y;\n }\n\n this.instancePositionBuffer.update();\n }\n\n private random(min: number, max: number) {\n return Math.random() * (max - min) + min;\n }\n\n private randVelocity() {\n let u1 = 1 - this.random(0, 1);\n let u2 = 1 - this.random(0, 1);\n let randStdNormal = (Math.sqrt(-2.0 * Math.log(u1)) * Math.sin(2.0 * Math.PI * u2));\n return Math.max(0.5 + 0.16 * randStdNormal, 0.1);\n }\n}\n\nexport interface Triangle {\n x: number;\n y: number;\n velocity: number;\n}\n","import * as PIXI from \"pixi.js\";\nimport {Main} from \"../../main\";\nimport {Loader} from \"../../Loader\";\nimport {MathUtil} from \"../../Util/MathUtil\";\nimport {Screen} from \"../../Screens/Screen\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\n\nexport class MenuCursor extends PIXI.Container {\n private mouseCursor = PIXI.Sprite.from(\"menu.cursor\");\n private mouseCursorAdditive = PIXI.Sprite.from(\"menu.cursor.additive\");\n private mouseContainer = new PIXI.Container();\n private animContainer = new PIXI.Container();\n private animRotationContainer = new PIXI.Container();\n private dragRotationState: DragRotationState = DragRotationState.NotDragging;\n private lastDragRotationState: DragRotationState = DragRotationState.NotDragging;\n private mouseHideContainer = new PIXI.Container();\n private readonly elastic_const2 = 0.075;\n private readonly elastic_const = 20.943951023931955;\n private readonly elastic_offset_quarter = Math.pow(2, -10) * Math.sin((.25 - this.elastic_const2) * this.elastic_const);\n\n private posMouseDown: { x: number, y: number } = {x: 0, y: 0};\n\n private mouseIsDown = false;\n\n private cursorTapSample = Loader.GetAudio(\"menu.cursor.sample.tap\");\n\n private mouseButtonClicked: number = -9999;\n\n public constructor(visible: boolean) {\n super();\n this.updateMouse();\n this.mouseContainer.scale.set(0.07 * Screen.getScaleBasedOffScreenSize());\n this.mouseCursorAdditive.alpha = 0;\n this.mouseCursorAdditive.blendMode = \"add\";\n this.mouseCursorAdditive.tint = \"0xFF66AA\"\n this.mouseContainer.addChild(this.mouseCursor);\n this.mouseContainer.addChild(this.mouseCursorAdditive);\n this.animContainer.addChild(this.mouseContainer);\n this.animRotationContainer.addChild(this.animContainer);\n this.mouseHideContainer.addChild(this.animRotationContainer);\n this.addChild(this.mouseHideContainer);\n if (!visible) {\n this.mouseHideContainer.scale.set(0.6);\n this.mouseHideContainer.alpha = 0;\n this.animRotationContainer.angle = 0;\n }\n this.zIndex = 999999;\n this.eventMode = \"none\";\n Main.app.stage.addChild(this);\n this.addEventListeners();\n }\n\n public addEventListeners() {\n Main.app.stage.addEventListener(\"mousedown\", (e) => {\n this.mouseButtonClicked = e.button;\n if (this.visible) {\n this.posMouseDown = {x: Main.mousePos.x, y: Main.mousePos.y};\n this.mouseIsDown = true;\n this.dragRotationState = DragRotationState.DragStarted;\n Ease.getEase(this.animContainer).ClearEasings().ScaleTo(0.9, 800, TWEEN.Easing.Quintic.Out);\n Ease.getEase(this.mouseCursorAdditive).ClearEasings().FadeIn(800, TWEEN.Easing.Quintic.Out);\n Main.AudioEngine.PlayEffect(this.cursorTapSample);\n }\n });\n Main.app.stage.addEventListener(\"mouseup\", (e) => {\n if (this.visible && e.button == this.mouseButtonClicked) {\n this.mouseIsDown = false;\n Ease.getEase(this.animContainer).ClearEasings().ScaleTo(1, 500, TWEEN.Easing.Elastic.Out);\n Ease.getEase(this.mouseCursorAdditive).ClearEasings().FadeOut(500, TWEEN.Easing.Quintic.Out);\n if (this.dragRotationState != DragRotationState.NotDragging) {\n if (this.dragRotationState == DragRotationState.Rotating) {\n Ease.getEase(this.animRotationContainer).ClearEasings().createTween({value: this.animRotationContainer.angle},\n {value: 0}, true, \"angle\", 800 * (0.5 + Math.abs(this.animRotationContainer.angle / 960)), (time: number) => {\n return Math.pow(2, -10 * time) * \n Math.sin((.25 * time - this.elastic_const2) * this.elastic_const) + 1 - this.elastic_offset_quarter * time;\n });\n }\n this.dragRotationState = DragRotationState.NotDragging;\n }\n Main.AudioEngine.PlayEffect(this.cursorTapSample, 0.8);\n }\n });\n }\n\n public PopIn() {\n Ease.getEase(this.animRotationContainer).ClearEasings();\n this.visible = true;\n Ease.getEase(this.mouseHideContainer).ClearEasings().FadeIn(250, TWEEN.Easing.Quintic.Out)\n .ScaleTo(1, 400, TWEEN.Easing.Quintic.Out);\n this.dragRotationState = DragRotationState.NotDragging\n }\n\n public PopOut() {\n Ease.getEase(this.mouseHideContainer).ClearEasings().FadeOut(250, TWEEN.Easing.Quintic.Out)\n .ScaleTo(0.6, 250, TWEEN.Easing.Quintic.Out);\n Ease.getEase(this.animRotationContainer).ClearEasings().createTween({value: this.animRotationContainer.angle},\n {value: 0}, true, \"angle\", 400, TWEEN.Easing.Quintic.Out);\n this.dragRotationState = DragRotationState.NotDragging;\n }\n\n public updateMouse() {\n this.mouseContainer.scale.set(0.07 * Screen.getScaleBasedOffScreenSize());\n this.position.set(Main.mousePos.x, Main.mousePos.y);\n if (this.dragRotationState != DragRotationState.NotDragging && this.visible) {\n let distance = Math.sqrt((((Math.abs(this.posMouseDown.x - Main.mousePos.x)) ^ 2) +\n ((Math.abs(this.posMouseDown.y - Main.mousePos.y)) ^ 2)));\n if (this.dragRotationState == DragRotationState.DragStarted && distance > 15) {\n this.dragRotationState = DragRotationState.Rotating;\n if (this.lastDragRotationState != this.dragRotationState) {\n this.posMouseDown = {x: Main.mousePos.x, y: Main.mousePos.y};\n }\n }\n\n if (this.dragRotationState == DragRotationState.Rotating && distance > 0) {\n let offsetX = Main.mousePos.x - this.posMouseDown.x;\n let offsetY = Main.mousePos.y - this.posMouseDown.y;\n let degrees = MathUtil.RadiansToDegrees(Math.atan2(-offsetX, offsetY)) + 24.3;\n\n let diff = (degrees - this.animRotationContainer.angle) % 360;\n if (diff < -180) {\n diff += 360;\n }\n if (diff > 180) {\n diff -= 360;\n }\n degrees = this.animRotationContainer.angle + diff;\n this.animRotationContainer.angle = degrees\n Ease.getEase(this.animRotationContainer).createTween({value: this.animRotationContainer.angle},\n {value: degrees}, true, \"angle\", 120, TWEEN.Easing.Quintic.Out);\n }\n }\n this.lastDragRotationState = this.dragRotationState;\n\n }\n\n\n}\n\nenum DragRotationState {\n NotDragging,\n DragStarted,\n Rotating\n}\n","import * as PIXI from \"pixi.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\n\nexport class Background extends PIXI.Sprite {\n public constructor(texture: PIXI.Texture) {\n super();\n this.texture = texture;\n this.visible = false;\n this.anchor.set(0.5, 0.5);\n\n }\n\n public show() {\n this.visible = true;\n }\n\n public destroy(options?: PIXI.DestroyOptions) {\n Ease.getEase(this).FadeOut(800, TWEEN.Easing.Linear.None).Then(() => {\n this.visible = false;\n super.destroy(options);\n });\n this.zIndex = 1;\n }\n}","import * as PIXI from \"pixi.js\";\nimport {Loader} from \"../../Loader\";\nimport {Screen} from \"../../Screens/Screen\";\nimport {Main} from \"../../main\";\nimport {Background} from \"./Background\";\n\nexport class RandomBackground extends Screen {\n\n private bgContainer = new PIXI.Container;\n\n private readonly parallaxMultiplier = 60;\n\n public start() {\n this.bgContainer.pivot.set(0.5, 0.5);\n this.bgContainer.position.set((Main.mousePos.x - (this.getScreenWidth() / 2)) / this.parallaxMultiplier,\n (Main.mousePos.y - (this.getScreenHeight() / 2)) / this.parallaxMultiplier);\n this.addChild(this.bgContainer);\n this.newRandomBG();\n Main.AudioEngine.addMusicChangeEventListener((audio) => {\n if (audio.beatmap.background) {\n let url = URL.createObjectURL(audio.beatmap.background);\n let texture = PIXI.Assets.load({src: url, loadParser: 'loadTextures'});\n texture.then((texture) => {\n this.setBG(texture);\n })\n }\n else {\n this.newRandomBG();\n }\n });\n this.zIndex = -100;\n }\n\n public setBG(texture: PIXI.Texture) {\n let bgSprite = new Background(texture);\n this.bgContainer.addChild(bgSprite);\n bgSprite.show();\n if (this.bgContainer.children?.length == 0) {\n } else {\n let previous = this.bgContainer.children[0] as Background;\n previous.destroy();\n }\n this.onResize();\n }\n\n public newRandomBG() {\n function random(min: number, max: number) {\n return Math.round(Math.random() * (max - min) + min);\n }\n\n let useSeasonalBackgrounds = Loader.seasonalBackgroundsNum > 0;\n let randomNum = random(1, useSeasonalBackgrounds ? Loader.seasonalBackgroundsNum : Loader.defaultBackgroundsNum);\n this.setBG(PIXI.Texture.from((useSeasonalBackgrounds ? \"seasonal_bg\" : \"default_bg\") + randomNum));\n }\n\n public draw(deltaTime: PIXI.Ticker) {\n this.bgContainer.position.set((Main.mousePos.x - (this.getScreenWidth() / 2)) / this.parallaxMultiplier,\n (Main.mousePos.y - (this.getScreenHeight() / 2)) / this.parallaxMultiplier);\n }\n\n public onClose(): Promise {\n return Promise.resolve(this);\n }\n\n public onResize() {\n this.bgContainer.children.forEach((sprite) => {\n if (sprite instanceof Background) {\n let texWidth = sprite.texture.width;\n let texHeight = sprite.texture.height;\n\n let scaleFactor: number;\n if (window.innerWidth > window.innerHeight) {\n scaleFactor = window.innerWidth / texWidth;\n } else {\n scaleFactor = window.innerHeight / texHeight;\n }\n\n if (texHeight * scaleFactor < window.innerHeight) {\n scaleFactor = window.innerHeight / texHeight;\n } else if (texWidth * scaleFactor < window.innerWidth) {\n\n }\n\n sprite.scale.set(scaleFactor + 0.05);\n sprite.position.set((this.getScreenWidth() / 2) - (this.getScreenWidth() / (this.parallaxMultiplier * 2)),\n this.getScreenHeight() / 2 - (this.getScreenHeight() / (this.parallaxMultiplier * 2)));\n }\n });\n\n\n }\n\n}\n","import * as PIXI from \"pixi.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Screen} from \"../../Screens/Screen\";\n\nexport class SettingsPane extends PIXI.Container {\n private bg: PIXI.Graphics = new PIXI.Graphics();\n private isOpen = false;\n\n public constructor() {\n super();\n this.bg.rect(0, 0, 1, 1);\n this.bg.fill({color: \"rgb(20,20,20)\"});\n this.addChild(this.bg);\n this.resize();\n }\n\n public open() {\n Ease.getEase(this).TransformTo({x: 0, y: 0}, 400, TWEEN.Easing.Cubic.Out);\n this.isOpen = true;\n }\n\n public toggle() {\n if (this.isOpen) {this.close()} else {this.open()}\n }\n\n public close() {\n Ease.getEase(this).TransformTo({x: -this.getWidth(), y: 0}, 400, TWEEN.Easing.Cubic.Out);\n this.isOpen = false;\n }\n\n private getWidth() {\n return 500 * Screen.getScaleBasedOffScreenSize();\n }\n\n public resize() {\n this.width = this.getWidth();\n this.height = window.innerHeight;\n this.x = this.isOpen ? 0 : -this.getWidth();\n this.y = 0;\n }\n}","import * as PIXI from \"pixi.js\";\n\nexport class Loader {\n private static loadList: LoaderObject[] = [];\n private static loadedList: LoadedObject[] = [];\n public static readonly defaultBackgroundsNum = 8;\n public static seasonalBackgroundsNum: number = 0;\n\n private static addToLoadList() {\n // intro and interaction screen\n this.loadList.push({id: \"introTrianglesTrack\", url: \"assets/osu-assets/osu.Game.Resources/Tracks/triangles.osz\"});\n this.loadList.push({id: \"sample_dialog_ok\", url: \"assets/osu-assets/osu.Game.Resources/Samples/UI/dialog-ok-select.wav\", isAudio: true});\n this.loadList.push({id: \"TorusRegular\", url: \"assets/fonts/TorusRegular.otf\", pixiBundleName: \"fonts\"});\n this.loadList.push({id: \"TorusLight\", url: \"assets/fonts/TorusLight.otf\", pixiBundleName: \"fonts\"});\n this.loadList.push({id: \"TorusThin\", url: \"assets/fonts/TorusThin.otf\", pixiBundleName: \"fonts\"});\n this.loadList.push({id: \"icon_ruleset_std\", url: \"assets/icons/ruleset-standard.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"icon_ruleset_mania\", url: \"assets/icons/ruleset-mania.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"icon_ruleset_taiko\", url: \"assets/icons/ruleset-taiko.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"icon_ruleset_ctb\", url: \"assets/icons/ruleset-ctb.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"intro_triangles_osuLogo_anim_highlight\",\n url: \"assets/osu-assets/osu.Game.Resources/Textures/Intro/Triangles/logo-highlight.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"intro_triangles_osuLogo_anim_background\",\n url: \"assets/osu-assets/osu.Game.Resources/Textures/Intro/Triangles/logo-background.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"mainMenu.logoOutline\", url: \"assets/osu-assets/osu.Game.Resources/Textures/Menu/logo.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"mainMenu.logoMask\", url: \"assets/menu/logo-mask.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"mainMenu.osuLogo.select\", url: \"assets/osu-assets/osu.Game.Resources/Samples/Menu/osu-logo-select.wav\", isAudio: true});\n this.loadList.push({id: \"mainMenu.osuLogo.backToLogo\", url: \"assets/osu-assets/osu.Game.Resources/Samples/Menu/back-to-logo.wav\", isAudio: true});\n this.loadList.push({id: \"menu.cursor\", url: \"assets/osu-assets/osu.Game.Resources/Textures/Cursor/menu-cursor.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"menu.cursor.additive\", url: \"assets/osu-assets/osu.Game.Resources/Textures/Cursor/menu-cursor-additive.png\",\n pixiBundleName: \"textures\"});\n this.loadList.push({id: \"menu.cursor.sample.tap\", url: \"assets/osu-assets/osu.Game.Resources/Samples/UI/cursor-tap.wav\", isAudio: true});\n this.loadList.push({id: \"menu.kiaiFountains.star\", url: \"assets/osu-assets/osu.Game.Resources/Textures/Menu/fountain-star.png\", pixiBundleName: \"textures\"});\n }\n\n public static Get(id: string): Blob {\n let result;\n this.loadedList.forEach((loadedObj) => {\n if (loadedObj.id == id){\n result = loadedObj.data;\n }\n });\n if (!result){\n throw new Error(\"Asset not found!\");\n }\n return result;\n }\n\n public static GetString(id: string): string {\n let result;\n this.loadedList.forEach((loadedObj) => {\n if (loadedObj.id == id){\n result = loadedObj.dataString;\n }\n });\n if (!result){\n throw new Error(\"Asset not found or is not a string!\");\n }\n return result;\n }\n\n public static GetAudio(id: string): AudioBuffer {\n let result;\n this.loadedList.forEach((loadedObj) => {\n if (loadedObj.id == id){\n result = loadedObj.dataAudio;\n }\n });\n if (!result){\n throw new Error(\"Asset not found or was not marked as audio during loading!\");\n }\n return result;\n }\n\n private static addBackgrounds() {\n return new Promise(resolve => {\n for (let i = 1; i < this.defaultBackgroundsNum + 1; i++) {\n this.loadList.push({id: \"default_bg\"+i, url: \"assets/osu-assets/osu.Game.Resources/Textures/Menu/menu-background-\"+i+\".jpg\", pixiBundleName: \"textures\"});\n }\n fetch(\"https://corsproxy.io/?\"+ encodeURIComponent(\"https://osu.ppy.sh/api/v2/seasonal-backgrounds\"))\n .then(res => res.json()).then(res => {\n res.backgrounds.forEach((background: any, index: number) => {\n this.loadList.push({id: \"seasonal_bg\"+(index+1), url: \"https://corsproxy.io/?\"+ encodeURIComponent(background.url),\n pixiBundleName: \"textures\", loadParser: \"loadTextures\"});\n this.seasonalBackgroundsNum = index+1;\n });\n resolve();\n }).catch(error => {\n console.warn(\"Could not fetch seasonal backgrounds.\", error);\n resolve();\n });\n });\n }\n\n public static Load(audioContext: AudioContext) {\n this.addToLoadList();\n return new Promise((resolve) => {\n this.addBackgrounds().then(() => {\n let nonPixi: LoaderObject[] = [];\n let pixi: LoaderObject[] = [];\n let pixiwithBundles: LoaderObject[][] = [];\n\n let loadedAssets: number = 0;\n let erroredAssets: number = 0;\n\n this.loadList.forEach((loadObj) => {\n if (loadObj.pixiBundleName){\n pixi.push(loadObj);\n }\n else {\n nonPixi.push(loadObj);\n }\n });\n\n pixi.forEach((loadObj) => {\n let added = false;\n pixiwithBundles.forEach((loadObjs) => {\n if (loadObjs.length > 0){\n if (loadObjs[0].pixiBundleName == loadObj.pixiBundleName){\n loadObjs.push(loadObj);\n added = true;\n }\n }\n });\n if (!added){\n pixiwithBundles.push([loadObj]);\n }\n });\n\n const incrementLoadAssetNumber = (errored?: boolean) => {\n if (errored){\n erroredAssets++;\n }\n else {\n loadedAssets++;\n }\n\n if (erroredAssets + loadedAssets >= this.loadList.length){\n resolve();\n }\n }\n\n nonPixi.forEach((loadObj) => {\n fetch(loadObj.url)\n .then(response => response.blob())\n .then((response) => {\n if (!loadObj.isText && !loadObj.isAudio){\n incrementLoadAssetNumber();\n this.loadedList.push({id: loadObj.id, data: response});\n }\n else if (loadObj.isText) {\n response.text().then((text) => {\n incrementLoadAssetNumber();\n this.loadedList.push({id: loadObj.id, data: response, dataString: text});\n });\n }\n else if (loadObj.isAudio){\n response.arrayBuffer().then(arrBuff => audioContext.decodeAudioData(arrBuff))\n .then((audioBuff) => {\n incrementLoadAssetNumber();\n this.loadedList.push({id: loadObj.id, data: response, dataAudio: audioBuff});\n });\n }\n\n })\n .catch((error) => {\n incrementLoadAssetNumber(true);\n console.warn(\"Asset '\"+loadObj.id+\"' failed to load: \"+error);\n });\n });\n\n pixiwithBundles.forEach((bundle) => {\n if (bundle.length > 0){\n if (!bundle[0].pixiBundleName){\n throw new Error(\"wtf????\");\n }\n let assets: PIXI.UnresolvedAsset[] = [];\n bundle.forEach((loadObj) => {\n if (loadObj.loadParser){\n assets.push({alias: loadObj.id, src: loadObj.url, loadParser: loadObj.loadParser});\n }\n else {\n assets.push({alias: loadObj.id, src: loadObj.url});\n }\n\n });\n PIXI.Assets.addBundle(bundle[0].pixiBundleName, assets);\n PIXI.Assets.loadBundle(bundle[0].pixiBundleName).then(() => {\n bundle.forEach(() => {\n incrementLoadAssetNumber();\n });\n });\n }\n\n })\n });\n });\n }\n}\n\ninterface LoaderObject {\n id: string;\n url: string;\n pixiBundleName?: string;\n isText?: boolean;\n isAudio?: boolean;\n loadParser?: PIXI.LoadParserName;\n}\n\ninterface LoadedObject {\n id: string;\n data: Blob;\n dataString?: string;\n dataAudio?: AudioBuffer;\n}\n","import {Screen} from \"../Screen\";\nimport * as PIXI from \"pixi.js\";\nimport {Ticker} from \"pixi.js\";\nimport {Main} from \"../../main\";\nimport {IntroScreen} from \"../IntroScreen/IntroScreen\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\n\nexport class InteractScreen extends Screen {\n\n private readonly text: PIXI.Text;\n private readonly text2: PIXI.Text;\n private readonly textContainer = new PIXI.Container();\n private readonly textContainerContainer = new PIXI.Container();\n\n private readonly introTrack: Blob;\n private clickSound: AudioBuffer;\n\n private readonly clickArea: PIXI.Graphics = new PIXI.Graphics();\n\n public constructor(introTrack: Blob, clickSound: AudioBuffer) {\n super();\n this.introTrack = introTrack;\n this.clickSound = clickSound;\n\n this.text = new PIXI.Text({\n text: \"Click anywhere to play!\",\n style: {\n fontFamily: 'TorusRegular',\n fontSize: 36,\n fill: \"white\"\n }\n });\n this.text2 = new PIXI.Text({\n text: \"(this is for enabling audio because it's required by web-browsers\\n to have interaction on this webpage before playing audio.)\",\n style: {\n fontFamily: 'TorusRegular',\n fontSize: 26,\n fill: \"gray\",\n align: \"center\"\n }\n });\n }\n\n public start() {\n this.text.anchor.set(0.5, 0.5);\n this.text2.anchor.set(0.5, 0.5);\n this.text2.position.set(0, this.text.height + 15);\n this.textContainer.addChild(this.text);\n this.textContainer.addChild(this.text2);\n this.textContainer.scale.set(0.5);\n this.textContainer.alpha = 0;\n this.textContainerContainer.addChild(this.textContainer);\n this.textContainerContainer.scale = Screen.getScaleBasedOffScreenSize();\n this.textContainerContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.addChild(this.textContainerContainer);\n\n this.clickArea.rect(0, 0, 1, 1);\n this.clickArea.fill(\"rgba(0,0,0,0)\");\n this.clickArea.width = this.getScreenWidth();\n this.clickArea.height = this.getScreenHeight();\n this.clickArea.position.set(0, 0);\n this.addChild(this.clickArea);\n\n this.clickArea.eventMode = \"static\";\n this.clickArea.cursor = \"pointer\";\n\n const clicked = () => {\n this.clickArea.eventMode = \"none\";\n Main.AudioEngine.PlayEffect(this.clickSound);\n Main.switchScreen(new IntroScreen(this.introTrack));\n document.body.style.cursor = \"none\";\n Main.pointerLock();\n Main.lockKeyboard();\n }\n\n this.clickArea.onclick = () => {\n clicked();\n\n }\n this.clickArea.ontap = () => {\n clicked();\n }\n Ease.getEase(this.textContainer).FadeIn(400, TWEEN.Easing.Quadratic.Out)\n .ScaleTo(1, 400, TWEEN.Easing.Quadratic.Out);\n }\n\n public onClose(): Promise {\n return new Promise((resolve) => {\n Ease.getEase(this.textContainer).FadeOut(200, TWEEN.Easing.Quadratic.Out)\n .ScaleTo(0.5, 200, TWEEN.Easing.Quadratic.InOut);\n setTimeout(() => {\n resolve(this);\n }, 200);\n });\n }\n\n public draw(deltaTime: Ticker) {\n\n }\n\n public onResize() {\n this.textContainerContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.clickArea.width = this.getScreenWidth();\n this.clickArea.height = this.getScreenHeight();\n this.clickArea.position.set(0, 0);\n this.textContainerContainer.scale = Screen.getScaleBasedOffScreenSize();\n }\n}\n","import * as PIXI from \"pixi.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\n\nexport class GlitchingTriangles extends PIXI.Container {\n public constructor(bounds: GlitchingTrianglesBounds) {\n super();\n let triangle = new PIXI.Graphics();\n let scale = random(0.2, 1.2);\n triangle.moveTo(0, 0);\n triangle.lineTo(-50 * scale, 100 * scale);\n triangle.lineTo(50 * scale, 100 * scale);\n triangle.lineTo(0, 0);\n if (Math.random() < 0.5) {\n triangle.fill(\"white\");\n } else {\n triangle.stroke({color: \"white\", width: 1});\n }\n\n //triangle.anchor.set(0.5, 0.5)\n function random(min: number, max: number) {\n return Math.random() * (max - min) + min;\n }\n\n let randX = random(bounds.x1, bounds.x2);\n let randY = random(bounds.y1, bounds.y2);\n\n triangle.position.set(randX, randY);\n\n Ease.getEase(triangle, true).FadeOut(200, TWEEN.Easing.Linear.None);\n setTimeout(() => {\n this.destroy();\n }, 200);\n\n this.addChild(triangle);\n }\n\n}\n\nexport interface GlitchingTrianglesBounds {\n x1: number;\n x2: number;\n y1: number;\n y2: number;\n}\n","import {Screen} from \"../Screen\";\nimport * as PIXI from \"pixi.js\";\nimport {Ticker} from \"pixi.js\";\nimport {unzip} from 'unzipit';\nimport {Main} from \"../../main\";\nimport {GlitchingTriangles} from \"./GlitchingTriangles\";\nimport {MainMenu} from \"../MainMenu/MainMenu\";\nimport {LazerLogo} from \"./LazerLogo\";\nimport {BeatmapParser} from \"../../Util/Beatmap/Parser/BeatmapParser\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport {UIUtils} from \"../../Util/UI/UIUtils\";\nimport {CenteredList} from \"../../Util/UI/CenteredList\";\n\nexport class IntroScreen extends Screen {\n\n private readonly introTrackUrl: string;\n\n private doTextSpacingAnim = false;\n private triangles = new PIXI.Container();\n private ruleSetContainer = new PIXI.Container();\n private ruleSetList = new CenteredList({});\n private flash = new PIXI.Graphics();\n\n private logoContainerContainer = new PIXI.Container();\n\n private logoContainer = new PIXI.Container();\n\n private lazerLogo = new LazerLogo();\n\n private flashed = false;\n\n private standard = PIXI.Sprite.from('icon_ruleset_std');\n private taiko = PIXI.Sprite.from('icon_ruleset_taiko');\n private ctb = PIXI.Sprite.from('icon_ruleset_ctb');\n private mania = PIXI.Sprite.from('icon_ruleset_mania');\n\n private bg: PIXI.Graphics = new PIXI.Graphics();\n\n private completionPromise!: Promise;\n\n private welcomeText: PIXI.Text = new PIXI.Text({\n text: \"\",\n style: {\n fontFamily: \"TorusThin\",\n fontSize: 42,\n fill: \"white\",\n letterSpacing: 5\n }\n });\n\n public constructor(introTrack: Blob) {\n super();\n this.introTrackUrl = URL.createObjectURL(introTrack);\n this.bg.rect(0, 0, 1, 1,);\n this.bg.fill(\"black\");\n }\n\n public start() {\n this.bg.width = window.innerWidth;\n this.bg.height = window.innerHeight;\n this.bg.x = 0;\n this.bg.y = 0;\n this.addChild(this.bg);\n this.lazerLogo.scale.set(Screen.getScaleBasedOffScreenSize());\n this.logoContainer.addChild(this.lazerLogo);\n this.logoContainer.scale.set(1.2);\n\n this.logoContainerContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.logoContainerContainer.pivot.set(0.5, 0.5);\n this.logoContainerContainer.addChild(this.logoContainer);\n this.logoContainerContainer.alpha = 0;\n this.addChild(this.logoContainerContainer);\n\n this.flash.rect(0, 0, 1, 1);\n this.flash.fill(\"white\");\n this.flash.position.set(0, 0);\n this.flash.width = this.getScreenWidth();\n this.flash.height = this.getScreenHeight();\n this.flash.blendMode = \"add\";\n this.welcomeText.anchor.set(0.5, 0.5);\n this.welcomeText.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n setTimeout(async () => {\n const {entries} = await unzip(this.introTrackUrl);\n for (const [name, entry] of Object.entries(entries)) {\n if (name.endsWith(\".osu\")) {\n entry.text().then((osuFile) => {\n let beatmapData = BeatmapParser.Parse(osuFile);\n console.log(beatmapData);\n for (const [name, entry] of Object.entries(entries)) {\n if (name == beatmapData.General.AudioFilename) {\n entry.blob().then(blob => {\n let url = URL.createObjectURL(blob);\n setTimeout(() => {\n Main.AudioEngine.PlayMusicImmediately(url, beatmapData, () => {\n this.afterAudioPlay();\n });\n }, 200);\n });\n }\n }\n\n });\n\n\n break;\n }\n }\n }, 0);\n }\n\n public afterAudioPlay() {\n this.completionPromise = new Promise((resolve) => {\n this.welcomeText.scale.set(Screen.getScaleBasedOffScreenSize());\n this.addChild(this.welcomeText);\n setTimeout(() => {\n this.welcomeText.text = \"wel\";\n this.onResize();\n }, 200);\n setTimeout(() => {\n this.welcomeText.text = \"welcome\";\n this.onResize();\n }, 400);\n setTimeout(() => {\n this.welcomeText.text = \"welcome to\";\n this.onResize();\n }, 700);\n let glitchingInterval: NodeJS.Timeout;\n\n this.triangles.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.triangles.scale.set(Screen.getScaleBasedOffScreenSize());\n this.addChild(this.triangles);\n setTimeout(() => {\n this.welcomeText.text = \"welcome to kosu!\";\n this.doTextSpacingAnim = true;\n glitchingInterval = setInterval(() => {\n let triangle = new GlitchingTriangles({\n x1: -(this.welcomeText.width / 2) - 100,\n x2: (this.welcomeText.width / 2) + 100,\n y1: -(this.welcomeText.height / 2) - 150,\n y2: (this.welcomeText.height / 2) + 100\n });\n this.triangles.addChild(triangle);\n }, 30);\n this.onResize();\n }, 900);\n\n this.standard.scale = 0.5 * Screen.getScaleBasedOffScreenSize();\n this.ctb.scale = 0.5 * Screen.getScaleBasedOffScreenSize();\n this.mania.scale = 0.5 * Screen.getScaleBasedOffScreenSize();\n this.taiko.scale = 0.5 * Screen.getScaleBasedOffScreenSize();\n\n\n this.ruleSetList.addChild(this.standard);\n this.ruleSetList.addChild(this.taiko);\n this.ruleSetList.addChild(this.ctb);\n this.ruleSetList.addChild(this.mania);\n this.ruleSetList.padding = 0;\n this.ruleSetList.elementsMargin = 200 * Screen.getScaleBasedOffScreenSize();\n this.ruleSetList.type = \"horizontal\";\n this.ruleSetList.scale = 1;\n this.ruleSetContainer.addChild(this.ruleSetList);\n\n setTimeout(() => {\n this.doTextSpacingAnim = false;\n this.onResize();\n clearInterval(glitchingInterval);\n this.welcomeText.destroy();\n this.triangles.destroy();\n this.ruleSetContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.addChild(this.ruleSetContainer);\n this.ruleSetList.elementsMargin = 200 * Screen.getScaleBasedOffScreenSize();\n Ease.getEase(this.ruleSetContainer).ScaleTo(0.8, 1000, TWEEN.Easing.Linear.None);\n }, 1450);\n\n setTimeout(() => {\n this.ruleSetList.elementsMargin = 30 * Screen.getScaleBasedOffScreenSize();\n this.ruleSetList.scale = 2;\n UIUtils.centerPivotOfList(this.ruleSetList);\n }, 1650);\n\n setTimeout(() => {\n this.ruleSetList.elementsMargin = 10 * Screen.getScaleBasedOffScreenSize();\n this.ruleSetList.scale = 4;\n Ease.getEase(this.ruleSetContainer).ScaleTo(1.3, 1000, TWEEN.Easing.Linear.None);\n }, 1850);\n\n setTimeout(() => {\n this.ruleSetContainer.destroy();\n this.lazerLogo.start();\n\n this.logoContainerContainer.alpha = 1;\n\n this.logoContainerContainer.scale.set(1.2);\n Ease.getEase(this.logoContainerContainer).ScaleTo(1.2 - 0.8 * 0.25, 920, TWEEN.Easing.Quadratic.In);\n\n setTimeout(() => {\n Ease.getEase(this.logoContainer).ScaleTo(1.2 - 0.8, 920 * 0.3, TWEEN.Easing.Quintic.In);\n }, 920 * 0.7);\n }, 2080);\n\n setTimeout(() => {\n this.addChild(this.flash);\n this.bg.destroy();\n this.flash.eventMode = \"none\";\n this.flashed = true;\n this.logoContainerContainer.visible = false;\n Ease.getEase(this.flash).FadeOut(1000, TWEEN.Easing.Quadratic.Out).Then(() => {resolve();});\n Main.cursor.PopIn();\n }, 3000);\n });\n Main.switchScreen(new MainMenu());\n }\n\n public draw(deltaTime: Ticker) {\n if (this.doTextSpacingAnim) {\n this.welcomeText.style.letterSpacing += 0.15 * deltaTime.deltaTime;\n this.onResize();\n }\n }\n\n public onClose(): Promise {\n return new Promise((resolve) => {\n this.completionPromise.then(()=> {\n resolve(this);\n })\n });\n }\n\n public onResize() {\n if (!this.bg.destroyed){\n this.bg.width = window.innerWidth;\n this.bg.height = window.innerHeight;\n this.bg.x = 0;\n this.bg.y = 0;\n }\n if (!this.welcomeText.destroyed) {\n this.welcomeText.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n }\n if (!this.triangles.destroyed) {\n this.triangles.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.triangles.scale.set(Screen.getScaleBasedOffScreenSize());\n }\n if (!this.ruleSetContainer.destroyed) {\n this.ruleSetContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n }\n if (!this.flash.destroyed) {\n this.flash.position.set(0, 0);\n this.flash.width = this.getScreenWidth();\n this.flash.height = this.getScreenHeight();\n }\n if (!this.logoContainerContainer.destroyed) {\n this.logoContainerContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n }\n if (!this.lazerLogo.destroyed) {\n this.lazerLogo.scale.set(Screen.getScaleBasedOffScreenSize());\n }\n if (!this.welcomeText.destroyed) {\n this.welcomeText.scale.set(Screen.getScaleBasedOffScreenSize());\n }\n if (!this.standard.destroyed) {\n this.standard.scale.set(0.5 * Screen.getScaleBasedOffScreenSize());\n }\n if (!this.mania.destroyed) {\n this.mania.scale.set(0.5 * Screen.getScaleBasedOffScreenSize());\n }\n if (!this.ctb.destroyed) {\n this.ctb.scale.set(0.5 * Screen.getScaleBasedOffScreenSize());\n }\n if (!this.taiko.destroyed) {\n this.taiko.scale.set(0.5 * Screen.getScaleBasedOffScreenSize());\n }\n if (!this.ruleSetList.destroyed) {\n this.ruleSetList.ReCenter();\n }\n }\n}\n","import * as PIXI from \"pixi.js\";\nimport {LogoAnimation} from \"./LogoAnimation\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\n\nexport class LazerLogo extends PIXI.Container {\n private readonly highlight: LogoAnimation;\n private readonly background: LogoAnimation;\n private textureHighlight = PIXI.Texture.from(\"intro_triangles_osuLogo_anim_highlight\");\n private textureBackground = PIXI.Texture.from(\"intro_triangles_osuLogo_anim_background\");\n\n public constructor() {\n super();\n this.highlight = new LogoAnimation(this.textureHighlight, new PIXI.Color(\"white\"));\n this.background = new LogoAnimation(this.textureBackground, new PIXI.Color(\"rgb(128, 128, 128)\"));\n this.addChild(this.highlight);\n this.addChild(this.background);\n }\n\n public start() {\n let dummy = new PIXI.Container();\n dummy.scale.set(0.0, 0.0);\n Ease.getEase(dummy).ScaleTo(1, 920, TWEEN.Easing.Linear.None).OnEach(() => {\n this.highlight.setProgress(dummy.scale.x);\n this.background.setProgress(dummy.scale.x);\n });\n }\n}\n","import * as PIXI from \"pixi.js\"\nimport glVertShader from \"./logoAnimation.vert\";\nimport glFragShader from \"./logoAnimation.frag\";\nimport gpuShader from \"./logoAnimation.wgsl\";\n\nexport class LogoAnimation extends PIXI.Container {\n private shader: PIXI.Shader;\n private texture: PIXI.Texture;\n\n public constructor(texture: PIXI.Texture, color: PIXI.Color) {\n super();\n this.texture = texture\n this.shader = PIXI.Shader.from({\n gl: {\n vertex: glVertShader,\n fragment: glFragShader,\n },\n gpu: {\n vertex: {\n entryPoint: 'mainVert',\n source: gpuShader\n },\n fragment: {\n entryPoint: 'mainFrag',\n source: gpuShader\n }\n },\n resources: {\n uTexture: this.texture.source,\n uSampler: this.texture.source.style,\n uProgress: {\n progress: {value: 0.0, type: 'f32'},\n },\n },\n });\n const quadGeometry = new PIXI.Geometry({\n attributes: {\n aPosition: [\n -this.texture.width / 2,\n -this.texture.height / 2, // x, y\n this.texture.width / 2,\n -this.texture.height / 2, // x, y\n this.texture.width / 2,\n this.texture.width / 2, // x, y,\n -this.texture.width / 2,\n this.texture.width / 2, // x, y,\n ],\n aUV: [0, 0, 1, 0, 1, 1, 0, 1],\n aColor: [\n color.red, color.green, color.blue, color.alpha,\n color.red, color.green, color.blue, color.alpha,\n color.red, color.green, color.blue, color.alpha,\n color.red, color.green, color.blue, color.alpha\n ]\n },\n indexBuffer: [0, 1, 2, 0, 2, 3],\n });\n const quad = new PIXI.Mesh({\n geometry: quadGeometry,\n shader: this.shader,\n });\n this.addChild(quad);\n }\n\n public setProgress(progress: number) {\n this.shader.resources.uProgress.uniforms.progress = progress;\n }\n}\n","import {Screen} from \"../Screen\";\nimport {LoadAnim} from \"../../Elements/LoadAnim/LoadAnim\";\nimport * as PIXI from \"pixi.js\";\n\nexport class LoadScreen extends Screen {\n\n private loadAnim = new LoadAnim(\"rgba(255,255,255,0.7)\", \"black\");\n\n public start() {\n this.loadAnim.scale.set(0.8 * Screen.getScaleBasedOffScreenSize());\n this.loadAnim.position.set(this.getScreenWidth() - this.loadAnim.getWidth() - 15, this.getScreenHeight() - this.loadAnim.getHeight() - 15);\n this.addChild(this.loadAnim);\n }\n\n public draw(deltaTime: PIXI.Ticker) {\n this.loadAnim?.draw(deltaTime);\n }\n\n public onClose(): Promise {\n return new Promise((resolve) => {\n if (this.loadAnim != null) {\n this.loadAnim.destroy();\n }\n setTimeout(() => {\n resolve(this);\n }, 400);\n });\n }\n\n public onResize() {\n this.loadAnim.position.set(this.getScreenWidth() - this.loadAnim.getWidth() - 20, this.getScreenHeight() - this.loadAnim.getHeight() - 20);\n this.loadAnim.scale.set(0.8 * Screen.getScaleBasedOffScreenSize());\n }\n}\n","import {Screen} from \"../Screen\";\nimport * as PIXI from \"pixi.js\";\nimport {RandomBackground} from \"../../Elements/RandomBackground/RandomBackground\";\nimport {OsuLogo} from \"../../Elements/MainMenu/OsuCircle/OsuLogo\";\nimport {ButtonSystem} from \"../../Elements/MainMenu/OsuCircle/Menu/ButtonSystem\";\n\nexport class MainMenu extends Screen {\n private bg = new RandomBackground();\n private osuCircle = new OsuLogo();\n private menu: ButtonSystem = new ButtonSystem(this.osuCircle);\n\n public start() {\n this.bg.start();\n this.addChild(this.bg);\n this.osuCircle.scale = Screen.getScaleBasedOffScreenSize();\n this.addChild(this.menu);\n this.menu.onResize();\n this.addChild(this.osuCircle);\n }\n\n public draw(deltaTime: PIXI.Ticker) {\n this.bg.draw(deltaTime);\n this.osuCircle.draw(deltaTime);\n }\n\n public onClose(): Promise {\n return new Promise((resolve) => {\n this.bg.onClose().then(() => {\n resolve(this);\n });\n })\n }\n\n public onResize() {\n this.osuCircle.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.bg.onResize();\n this.menu.onResize();\n this.osuCircle.scale = !this.menu.isOpen() ? Screen.getScaleBasedOffScreenSize() :\n Screen.getScaleBasedOffScreenSize() * 0.5;\n }\n}\n","import * as PIXI from \"pixi.js\";\nimport {Settings} from \"../Settings/Settings\";\nimport {UIScale} from \"../Settings/impl/Graphics/UIScale\";\n\nexport abstract class Screen extends PIXI.Container {\n\n public constructor() {\n super();\n }\n\n public static getScaleBasedOffScreenSize() {\n // this was made with 1080p screens in mind.\n const uiScale = Settings.getSetting(UIScale).getValue();\n return ((((window.innerWidth / 1920) + (window.innerHeight / 1080)) / 2)) * uiScale\n }\n\n /**\n * Called once before the first frame is drawn\n */\n public abstract start(): void;\n\n\n /**\n * Called every frame\n */\n public abstract draw(deltaTime: PIXI.Ticker): void;\n\n /**\n * Called when screen will be closed, but has to return a promise to clean up after, for example, the screen's close animations are done.\n * Make sure you also pass in `this` into the promise's resolve.\n */\n public abstract onClose(): Promise;\n\n public abstract onResize(): void;\n\n protected getScreenWidth(): number {\n return window.innerWidth;\n }\n\n protected getScreenHeight(): number {\n return window.innerHeight;\n }\n}\n","import {Settings} from \"./Settings\";\n\nexport abstract class Setting {\n public readonly info: Settings;\n\n public constructor(SettingData: SettingInfo) {\n this.info = SettingData;\n Settings.register({setting: this, info: SettingData});\n }\n\n public abstract getValue(): any;\n\n public abstract getDefaultValue(): any;\n\n public abstract setValue(value: any): void;\n\n protected onValueChanged(): void {}\n\n /** When implementing this method, do **NOT** save the settings. This is so that loading won't reset most settings. */\n public abstract loadFromSaveValue(value: any): void;\n}\n\nexport interface SettingInfo {\n name: string;\n category: SettingsCategory;\n}\n\nexport enum SettingsCategory {\n General = \"General\",\n Skin = \"Skin\",\n Input = \"Input\",\n UserInterface = \"User Interface\",\n Gameplay = \"Gameplay\",\n Rulesets = \"Rulesets\",\n Audio = \"Audio\",\n Graphics = \"Graphics\",\n Online = \"Online\",\n Maintenance = \"Maintenance\",\n Debug = \"Debug\"\n}\n","import {Setting} from \"../Setting\";\nimport {Settings} from \"../Settings\";\n\nexport abstract class DropdownSetting extends Setting {\n public abstract readonly list: DropDownOption[];\n public abstract readonly defaultValue: DropDownOption;\n protected value: DropDownOption | undefined;\n\n public getValue(): DropDownOption {\n if (!this.value)\n throw new Error(\"Value is undefined!\");\n return this.value;\n }\n\n public getDefaultValue(): DropDownOption {\n return this.defaultValue;\n }\n\n public setValue(value: DropDownOption) {\n if (this.list.find((option) => option.value == value.value && option.displayName == value.displayName )) {\n this.value = value;\n Settings.save();\n this.onValueChanged();\n } else {\n console.warn('The value provided to this DropDownSetting does not exist in the option list! Ignoring value provided.');\n }\n }\n\n public loadFromSaveValue(value: DropDownOption) {\n if (this.list.find((option) => option.value == value.value && option.displayName == value.displayName)) {\n this.value = value;\n this.onValueChanged();\n } else {\n console.warn('The value provided to this DropDownSetting does not exist in the option list! Ignoring value provided.');\n }\n }\n}\n\nexport interface DropDownOption {\n displayName: string;\n value: string;\n}\n","import {Setting} from \"../Setting\";\nimport {Settings} from \"../Settings\";\nimport {MathUtil} from \"../../Util/MathUtil\";\n\nexport abstract class RangeSetting extends Setting {\n public abstract readonly minValue: number;\n public abstract readonly maxValue: number;\n public abstract readonly increment: number;\n public abstract readonly defaultValue: number;\n protected value: number = 0;\n\n public getValue(): number {\n return this.value;\n }\n\n public getDefaultValue(): number {\n return this.defaultValue;\n }\n\n public setValue(value: number) {\n this.value = MathUtil.clamp(this.minValue, this.maxValue, value);\n Settings.save();\n this.onValueChanged();\n }\n\n public loadFromSaveValue(value: number) {\n this.value = MathUtil.clamp(this.minValue, this.maxValue, value);\n this.onValueChanged();\n }\n}\n","import {Setting, SettingInfo} from \"./Setting\";\nimport {UIScale} from \"./impl/Graphics/UIScale\";\nimport {Renderer} from \"./impl/Graphics/Renderer\";\nimport {MouseSensitivity} from \"./impl/Input/MouseSensitivity\";\n\nexport class Settings {\n private static settingsList: SettingData[] = [];\n\n public static registerAll() {\n new UIScale();\n new Renderer();\n new MouseSensitivity();\n }\n\n public static load() {\n let settingSaveDataString = window.localStorage.getItem(\"settings\");\n if (settingSaveDataString == null) {\n return;\n }\n let settings = this.getList();\n try {\n let settingSaveData: SettingSaveData[] = JSON.parse(settingSaveDataString) as SettingSaveData[];\n settingSaveData.forEach((setting) => {\n let corrupt = false;\n try {\n if (!setting.value) {\n console.warn(\"Setting '\" + JSON.stringify(setting) + \"' may be corrupted, skipping!\");\n corrupt = true;\n }\n if (setting.info) {\n if (!setting.info.name) {\n console.warn(\"Setting '\" + JSON.stringify(setting) + \"' may be corrupted, skipping!\");\n corrupt = true;\n }\n if (!setting.info.category) {\n console.warn(\"Setting '\" + JSON.stringify(setting) + \"' may be corrupted, skipping!\");\n corrupt = true;\n }\n }\n else {\n console.warn(\"Setting '\" + JSON.stringify(setting) + \"' may be corrupted, skipping!\");\n corrupt = true;\n }\n }\n catch (e) {\n console.warn(\"Something went wrong when validating saved settings!\", e);\n console.warn(\"The setting may be REALLY corrupted, skipping!\");\n corrupt = true;\n }\n if (!corrupt) {\n let settingObj = settings.filter((_settingObj) => (_settingObj.info.name == setting.info.name) &&\n _settingObj.info.category == setting.info.category)[0];\n if (settingObj) {\n settingObj.setting.loadFromSaveValue(setting.value);\n } else {\n console.warn(\"Could not find setting object '\" + setting.info.name + \"', maybe it has been removed in this version of kosu?, skipping setting\")\n }\n }\n });\n }\n catch (e) {\n console.warn(\"Failed to load settings! Resetting Settings due to corrupted save!\", e);\n this.reset();\n }\n }\n\n public static save() {\n let settings = this.getList();\n let settingSaveData: SettingSaveData[] = [];\n settings.forEach((setting: SettingData) => {\n // only save if setting is different from default value\n if (setting.setting.getValue() != setting.setting.getDefaultValue()) {\n settingSaveData.push({info: setting.info, value: setting.setting.getValue()});\n }\n });\n window.localStorage.setItem(\"settings\", JSON.stringify(settingSaveData));\n }\n\n public static reset() {\n console.warn(\"Resetting Settings!\");\n window.localStorage.removeItem(\"settings\");\n }\n\n public static register(setting: SettingData) {\n this.settingsList.push(setting);\n }\n\n public static getSetting(setting: new (...args: any[]) => T): T {\n return this.settingsList.filter((_setting) => {\n return _setting.setting instanceof setting\n })[0].setting as T;\n }\n\n public static getSettingData(setting: new (...args: any[]) => T): SettingData {\n return this.settingsList.filter((_setting) => {\n return _setting.setting instanceof setting\n })[0];\n }\n\n public static getList() {\n return this.settingsList;\n }\n}\n\nexport interface SettingData {\n readonly setting: Setting;\n readonly info: SettingInfo;\n}\n\nexport interface SettingSaveData {\n readonly info: SettingInfo;\n readonly value: any;\n}\n","import {SettingsCategory} from \"../../Setting\";\nimport {DropDownOption, DropdownSetting} from \"../../SettingType/DropdownSetting\";\n\nexport class Renderer extends DropdownSetting {\n public readonly list: DropDownOption[] = [];\n\n public readonly webglOption: DropDownOption = {displayName: \"WebGL\", value: \"webgl\"}\n public readonly webGpuOption: DropDownOption = {displayName: \"WebGPU\", value: \"webgpu\"}\n public readonly defaultValue = this.webglOption;\n\n public constructor() {\n super({name: \"Renderer\", category: SettingsCategory.Graphics});\n this.list.push(this.webglOption, this.webGpuOption);\n this.value = this.defaultValue;\n }\n}\n","import {RangeSetting} from \"../../SettingType/RangeSetting\";\nimport {SettingsCategory} from \"../../Setting\";\n\nexport class UIScale extends RangeSetting {\n public readonly maxValue = 1.6;\n public readonly minValue = 0.8;\n public readonly increment = 0.1;\n public readonly defaultValue = 1;\n\n public constructor() {\n super({name: \"UI scaling\", category: SettingsCategory.Graphics});\n this.value = this.defaultValue;\n }\n}\n","import {RangeSetting} from \"../../SettingType/RangeSetting\";\nimport {SettingsCategory} from \"../../Setting\";\nimport {EventSystem} from \"pixi.js\";\n\nexport class MouseSensitivity extends RangeSetting{\n public readonly defaultValue: number = 1.0;\n public readonly increment: number = 0.01;\n public readonly maxValue: number = 10.0;\n public readonly minValue: number = 0.10;\n\n public constructor() {\n super({name: \"Sensitivity\", category: SettingsCategory.Input});\n this.value = this.defaultValue;\n this.onValueChanged();\n }\n\n public onValueChanged() {\n EventSystem.cursorSensitivity = this.getValue();\n }\n}\n","import {GeneralData} from \"./Sections/General/GeneralData\";\nimport {EditorData} from \"./Sections/Editor/EditorData\";\nimport {Metadata} from \"./Sections/Metadata/Metadata\";\nimport {DifficultyData} from \"./Sections/Difficulty/DifficultyData\";\nimport {EventsData} from \"./Sections/Events/EventsData\";\nimport {TimingPoint} from \"./Sections/TimingPoints/TimingPoint\";\nimport {TimingPointsData} from \"./Sections/TimingPoints/TimingPointsData\";\nimport {ColorsData} from \"./Sections/Colors/ColorsData\";\n\n/**\n * .osu (file format)\n */\nexport class BeatmapData {\n public background: Blob | null = null;\n\n /**\n * General information about the beatmap\n */\n public General: GeneralData = new GeneralData();\n /**\n * Saved settings for the beatmap editor\n */\n public Editor: EditorData = new EditorData();\n /**\n * Information used to identify the beatmap\n */\n public Metadata: Metadata = new Metadata();\n /**\n * Difficulty settings\n */\n public Difficulty: DifficultyData = new DifficultyData();\n /**\n * Beatmap and storyboard graphic events\n */\n public Events: EventsData = new EventsData();\n /**\n * Timing and control points\n */\n public TimingPoints: TimingPointsData = new TimingPointsData();\n /**\n * Combo and skin colours\n */\n public Colors: ColorsData = new ColorsData();\n\n //TODO: add hitobject data\n\n}\n","import {Color} from \"./Color\";\n\n/**\n * \tCombo and skin colours\n */\nexport class ColorsData {\n public Colors: Color[] = [];\n}\n","/**\n * Difficulty settings\n */\nexport class DifficultyData {\n /**\n * HP setting (0–10)\n */\n public HPDrainRate!: number;\n /**\n * CS setting (0–10)\n */\n public CircleSize!: number;\n /**\n * OD setting (0–10)\n */\n public OverallDifficulty!: number;\n /**\n * AR setting (0–10)\n */\n public ApproachRate!: number;\n /**\n * Base slider velocity in hundreds of osu! pixels per beat\n */\n public SliderMultiplier!: number;\n /**\n * Amount of slider ticks per beat\n */\n public SliderTickRate!: number;\n}\n","/**\n * Saved settings for the beatmap editor\n */\nexport class EditorData {\n /**\n * Time in milliseconds of bookmarks\n */\n public Bookmarks: number[] = [];\n /**\n * Distance snap multiplier\n */\n public DistanceSpacing: number | undefined;\n /**\n * Beat snap divisor\n */\n public BeatDivisor: number | undefined;\n /**\n * Grid size\n */\n public GridSize: number | undefined;\n /**\n * Scale factor for the object timeline\n */\n public TimelineZoom: number | undefined;\n}\n","import {EventTypes} from \"./EventTypes\";\n\nexport class Event {\n /**\n * Type of the event. Some events may be referred to by either a name or a number.\n */\n public eventType!: EventTypes;\n /**\n * Start time of the event, in milliseconds from the beginning of the beatmap's audio. For events that do not use a start time, the default is 0.\n */\n public startTime: number = 0;\n /**\n * Extra parameters specific to the event's type.\n */\n public eventParams!: (string | number)[];\n}\n","import {Event} from \"./Event\";\nimport {EventTypes} from \"./EventTypes\";\nexport class EventBackground extends Event {\n public eventType = EventTypes.BACKGROUND;\n public startTime = 0;\n /**\n * Location of the background image relative to the beatmap directory. Double quotes are\n * usually included surrounding the filename, but they are not required.\n */\n public filename!: string;\n /**\n * Offset in osu! pixels from the centre of the screen.\n * For example, an offset of 50,100 would have the background shown 50 osu! pixels to the\n * right and 100 osu! pixels down from the centre of the screen. If the offset is 0,0, writing it is optional.\n */\n public xOffset!: number;\n /**\n * Offset in osu! pixels from the centre of the screen.\n * For example, an offset of 50,100 would have the background shown 50 osu! pixels to the\n * right and 100 osu! pixels down from the centre of the screen. If the offset is 0,0, writing it is optional.\n */\n public yOffset!: number;\n}\n","export enum EventTypes {\n BACKGROUND = 0,\n VIDEO = \"Video\",\n // storyboard\n SPRITE = \"Sprite\",\n ANIMATION = \"Animation\"\n}\n","import {Event} from \"./Event\";\n\n/**\n * Beatmap and storyboard graphic events\n */\nexport class EventsData {\n public Events: Event[] = [];\n}\n","export enum Countdown {\n NoCountdown = 0,\n Normal = 1,\n Half = 2,\n Double = 3\n}","import {Countdown} from \"./Countdown\";\nimport {SampleSet} from \"./SampleSet\";\nimport {Mode} from \"./Mode\";\nimport {OverlayPosition} from \"./OverlayPosition\";\n/**\n * General information about the beatmap\n */\nexport class GeneralData {\n /**\n * Location of the audio file relative to the current folder.\n */\n public AudioFilename: string | null = null;\n /**\n * Milliseconds of silence before the audio starts playing\n */\n public AudioLeadIn: number = 0;\n /**\n * @deprecated The `AudioHash` property is deprecated according to the osu! wiki.\n */\n public AudioHash: string | null = null;\n /**\n * Time in milliseconds when the audio preview should start\n */\n public PreviewTime: number = -1;\n /**\n * Speed of the countdown before the first hit object (0 = no countdown, 1 = normal, 2 = half, 3 = double)\n */\n public Countdown: Countdown = Countdown.Normal;\n /**\n * Sample set that will be used if timing points do not override it (Normal, Soft, Drum)\n */\n public SampleSet: SampleSet = SampleSet.Normal;\n /**\n * Multiplier for the\n * threshold in time where hit objects placed close together stack (0–1)\n */\n public StackLeniency: number = 0.7;\n /**\n * Game mode (0 = osu!, 1 = osu!taiko, 2 = osu!catch, 3 = osu!mania)\n */\n public Mode: Mode = Mode.OSU;\n /**\n * Whether or not breaks have a letterboxing effect\n */\n public LetterboxInBreaks: boolean = false;\n /**\n * @deprecated The `StoryFireInFront` property is deprecated according to the osu! wiki.\n */\n public StoryFireInFront: boolean = true;\n /**\n * Whether or not the storyboard can use the user's skin images\n */\n public UseSkinSprites: boolean = false;\n /**\n * @deprecated The `AlwaysShowPlayfield` property is deprecated according to the osu! wiki.\n */\n public AlwaysShowPlayfield: boolean = false;\n /**\n * Draw order of hit circle overlays compared to hit numbers (NoChange = use skin setting,\n * Below = draw overlays under numbers, Above = draw overlays on top of numbers)\n */\n public OverlayPosition: OverlayPosition = OverlayPosition.NoChange;\n /**\n * Preferred skin to use during gameplay\n */\n public SkinPreference: string | null = null;\n /**\n * Whether or not a warning about flashing colours should be shown at the beginning of the map\n */\n public EpilepsyWarning: boolean = false;\n /**\n * Time in beats that the countdown starts before the first hit object\n */\n public CountdownOffset: number = 0;\n /**\n * Whether or not the \"N+1\" style key layout is used for osu!mania\n */\n public SpecialStyle: boolean = false;\n /**\n * Whether or not the storyboard allows widescreen viewing\n */\n public WidescreenStoryboard: boolean = false;\n /**\n * Whether or not sound samples will change rate when playing with speed-changing mods\n */\n public SamplesMatchPlaybackRate: boolean = false;\n}\n","export enum Mode {\n OSU = 0,\n TAIKO = 1,\n CATCH = 2,\n MANIA = 3\n}","export enum OverlayPosition {\n NoChange = \"NoChange\",\n Below = \"Below\",\n Above = \"Above\"\n}\n","export enum SampleSet {\n Normal = \"Normal\",\n Soft = \"Soft\",\n Drum = \"Drum\"\n}","/**\n * Information used to identify the beatmap\n */\nexport class Metadata {\n /**\n * Romanised song title\n */\n public Title!: string;\n /**\n * Song title\n */\n public TitleUnicode!: string;\n /**\n * Romanised song artist\n */\n public Artist!: string;\n /**\n * Song artist\n */\n public ArtistUnicode!: string;\n /**\n * Beatmap creator\n */\n public Creator!: string;\n /**\n * Difficulty name\n */\n public Version!: string;\n /**\n * Original media the song was produced for\n */\n public Source: string | undefined;\n /**\n * Search terms\n */\n public Tags!: string[];\n /**\n * Difficulty ID\n */\n public BeatmapID!: number;\n /**\n * Beatmap ID\n */\n public BeatmapSetID!: number;\n}\n","export enum Effect {\n KiaiTime = 1,\n None = 0,\n FirstBarLineOmittedInOsuTaikoAndOsuMania = 3\n}\n","import {TimingPoint} from \"./TimingPoint\";\n\nexport class InheritedTimingPoint extends TimingPoint {\n /**\n * a negative inverse slider velocity multiplier, as a percentage.\n * For example, `-50` would make all sliders in this timing section twice as fast as `SliderMultiplier`.\n */\n public sliderVelocityMultiplier!: number;\n\n}","import {TimingPointSampleSet} from \"./TimingPointSampleSet\";\nimport {Effect} from \"./Effect\";\n\nexport abstract class TimingPoint {\n /**\n * Start time of the timing section, in milliseconds from the beginning of the beatmap's audio.\n * The end of the timing section is the next timing point's time (or never, if this is the last timing point).\n */\n public time!: number;\n /**\n * Default sample set for hit objects (0 = beatmap default, 1 = normal, 2 = soft, 3 = drum).\n */\n public sampleSet!: TimingPointSampleSet;\n /**\n * Custom sample index for hit objects. 0 indicates osu!'s default hitsounds.\n */\n public sampleIndex!: number;\n /**\n * Volume percentage for hit objects.\n */\n public volume!: number;\n /**\n * Bit flags that give the timing point extra effects.\n * See the effects section.\n */\n public effects!: Effect\n}","import {TimingPoint} from \"./TimingPoint\";\nimport {UnInheritedTimingPoint} from \"./UnInheritedTimingPoint\";\nimport {InheritedTimingPoint} from \"./InheritedTimingPoint\";\n\n/**\n * Timing and control points\n */\nexport class TimingPointsData {\n public TimingPoints: TimingPoint[] = [];\n\n /**\n * Returns the current timing point in an array using the time provided.\n * If the current timing point is inherited, it will also return the parent\n * timing point along with it in the array as the second index.\n */\n public GetCurrentTimingPoints(time: number) {\n let toReturn: TimingPoint[] = [];\n let filter = this.TimingPoints.filter((timingPoint) => {if (timingPoint.time <= time) {return timingPoint}});\n if (filter.length == 0) {\n filter.push(this.TimingPoints[0]);\n }\n toReturn.push(filter[filter.length-1]);\n\n if (toReturn[0] instanceof InheritedTimingPoint) {\n let filter = this.TimingPoints.filter((timingPoint) => {return timingPoint instanceof UnInheritedTimingPoint})\n .filter((timingPoint) => {if (timingPoint.time <= time) {return timingPoint}});\n if (filter.length == 0) {\n throw new Error(\"Could not find a parent timing point for the un-inherited timing point!\");\n }\n toReturn.push(filter[filter.length-1]);\n }\n if (toReturn.length == 0) {\n throw new Error(\"Could not find any timing points!\");\n }\n return toReturn;\n }\n\n public GetCurrentUninheritedTimingPoint(time: number) {\n let timingPoint = this.GetCurrentTimingPoints(time);\n let unInheritedTimingPoint: UnInheritedTimingPoint;\n if (timingPoint[0] instanceof UnInheritedTimingPoint) {\n unInheritedTimingPoint = timingPoint[0];\n }\n else if(timingPoint[1] instanceof UnInheritedTimingPoint){\n unInheritedTimingPoint = timingPoint[1];\n }\n else {\n throw new Error(\"Could not find any UnInherited Timing Points!\")\n }\n return unInheritedTimingPoint;\n }\n\n}\n","import {TimingPoint} from \"./TimingPoint\";\n\nexport class UnInheritedTimingPoint extends TimingPoint {\n /**\n * The duration of a beat, in milliseconds.\n */\n public beatLength!: number;\n /**\n * Amount of beats in a measure.\n */\n public meter!: number;\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {TimingPointsParser} from \"./TimingPointsParser\";\nimport {GeneralParser} from \"./GeneralParser\";\nimport {EditorParser} from \"./EditorParser\";\nimport {MetadataParser} from \"./MetadataParser\";\nimport {DifficultyParser} from \"./DifficultyParser\";\nimport {EventsParser} from \"./EventsParser\";\n\nexport class BeatmapParser {\n public static Parse(osuFileContent: string, storyBoardFileContent?: string): BeatmapData {\n const beatMapData = new BeatmapData();\n let osuFileContentLines = osuFileContent.split(/\\r?\\n|\\r|\\n/g);\n GeneralParser.ParseGeneral(beatMapData, BeatmapParser.GetSection(\"General\", osuFileContentLines));\n EditorParser.ParseEditor(beatMapData, BeatmapParser.GetSection(\"Editor\", osuFileContentLines));\n MetadataParser.ParseMetadata(beatMapData, BeatmapParser.GetSection(\"Metadata\", osuFileContentLines));\n DifficultyParser.ParseDifficulty(beatMapData, BeatmapParser.GetSection(\"Difficulty\", osuFileContentLines));\n EventsParser.ParseEvents(beatMapData, BeatmapParser.GetSection(\"Events\", osuFileContentLines));\n TimingPointsParser.ParseTimingPoints(beatMapData, BeatmapParser.GetSection(\"TimingPoints\", osuFileContentLines));\n return beatMapData\n }\n public static GetSection(sectionName: string, osuFileContentLines: string[]) {\n let section: string[] = [];\n osuFileContentLines.forEach((str, index) => {\n if (str == \"[\"+sectionName+\"]\") {\n for (let i = index + 1; i < osuFileContentLines.length; i++) {\n if (osuFileContentLines[i] == \"\"){\n continue;\n }\n if (osuFileContentLines[i].startsWith(\"[\")){\n break;\n }\n section.push(osuFileContentLines[i]);\n }\n }\n });\n return section;\n }\n public static AutoParse(sectionType: new (...args: any[]) => T, propValue: string[], beatmapDataSection: T) {\n let key = propValue[0] as keyof T;\n let keyExists = false;\n for (let sectionKey in beatmapDataSection) {\n if (sectionKey == key){\n keyExists = true;\n }\n }\n if (!keyExists) {\n console.warn(key.toString() + \" does not exist on \" + sectionType.name +\"!\");\n return;\n }\n let isNumber = /^[0-9]+$|^[0-9]+.+$|^-[0-9]+$|^-[0-9]+.+$/.test(propValue[1]);\n let isBoolean = typeof beatmapDataSection[key] == \"boolean\";\n let value;\n if (isBoolean) {\n value = propValue[1] == \"1\";\n }\n else if (isNumber) {\n value = parseFloat(propValue[1]);\n }\n else {\n value = propValue[1];\n }\n\n // @ts-ignore\n beatmapDataSection[key] = value;\n }\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {BeatmapParser} from \"./BeatmapParser\";\nimport {DifficultyData} from \"../Data/Sections/Difficulty/DifficultyData\";\n\nexport class DifficultyParser {\n public static ParseDifficulty(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let propValue = str.split(\":\");\n if (propValue[1].startsWith(\" \")){\n propValue[1] = propValue[1].substring(1, propValue[1].length);\n }\n\n BeatmapParser.AutoParse(DifficultyData, propValue, beatmapData.Difficulty);\n });\n }\n\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {BeatmapParser} from \"./BeatmapParser\";\nimport {EditorData} from \"../Data/Sections/Editor/EditorData\";\n\nexport class EditorParser {\n public static ParseEditor(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let propValue = str.split(\":\");\n if (propValue[1].startsWith(\" \")){\n propValue[1] = propValue[1].substring(1, propValue[1].length);\n }\n if (propValue[0] != \"Bookmarks\") {\n BeatmapParser.AutoParse(EditorData, propValue, beatmapData.Editor);\n }\n else {\n propValue[1].split(\",\")\n .forEach((num) => {beatmapData.Editor.Bookmarks.push(parseFloat(num));});\n }\n });\n }\n\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {EventTypes} from \"../Data/Sections/Events/EventTypes\";\nimport {EventBackground} from \"../Data/Sections/Events/EventBackground\";\n\nexport class EventsParser {\n public static ParseEvents(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let values = str.split(\",\");\n let event;\n if (parseInt(values[0]) == EventTypes.BACKGROUND) {\n event = new EventBackground();\n event.filename = values[2].replaceAll('\"', \"\");\n event.xOffset = parseInt(values[3]);\n event.yOffset = parseInt(values[3]);\n event.startTime = 0;\n }\n if (event) {\n beatmapData.Events.Events.push(event);\n }\n });\n }\n}","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {GeneralData} from \"../Data/Sections/General/GeneralData\";\nimport {BeatmapParser} from \"./BeatmapParser\";\n\nexport class GeneralParser {\n public static ParseGeneral(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let propValue = str.split(\":\");\n if (propValue[1].startsWith(\" \")){\n propValue[1] = propValue[1].substring(1, propValue[1].length);\n }\n\n BeatmapParser.AutoParse(GeneralData, propValue, beatmapData.General);\n });\n }\n\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {BeatmapParser} from \"./BeatmapParser\";\nimport {Metadata} from \"../Data/Sections/Metadata/Metadata\";\n\nexport class MetadataParser {\n public static ParseMetadata(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let propValue = str.split(\":\");\n if (propValue[1].startsWith(\" \")){\n propValue[1] = propValue[1].substring(1, propValue[1].length);\n }\n\n BeatmapParser.AutoParse(Metadata, propValue, beatmapData.Metadata);\n });\n }\n\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {UnInheritedTimingPoint} from \"../Data/Sections/TimingPoints/UnInheritedTimingPoint\";\nimport {InheritedTimingPoint} from \"../Data/Sections/TimingPoints/InheritedTimingPoint\";\nimport {Effect} from \"../Data/Sections/TimingPoints/Effect\";\n\nexport class TimingPointsParser {\n public static ParseTimingPoints(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let prop = str.split(\",\");\n let timingPoint;\n if (prop[6] == \"1\") {\n timingPoint = new UnInheritedTimingPoint();\n timingPoint.beatLength = Number.parseFloat(prop[1]);\n timingPoint.meter = Number.parseInt(prop[2]);\n }\n else {\n timingPoint = new InheritedTimingPoint();\n timingPoint.sliderVelocityMultiplier = Number.parseFloat(prop[1]);\n }\n timingPoint.time = Number.parseInt(prop[0]);\n timingPoint.sampleSet = Number.parseInt(prop[3]);\n timingPoint.sampleIndex = Number.parseInt(prop[4]);\n timingPoint.volume = Number.parseInt(prop[5]);\n if (prop[7] == \"1\" || prop[7] == \"3\"){\n timingPoint.effects = Number.parseInt(prop[7]);\n } else {\n timingPoint.effects = Effect.None;\n }\n\n beatmapData.TimingPoints.TimingPoints.push(timingPoint);\n });\n }\n}\n","export class MathUtil {\n public static RadiansToDegrees(radians: number) {\n return radians * 180 / Math.PI;\n }\n\n public static DegreesToRadians(degrees: number) {\n return degrees * Math.PI / 180;\n }\n\n public static clamp(min: number, max: number, value: number) {\n return Math.min(Math.max(value, min), max);\n }\n\n public static clamp01(value: number) {\n return MathUtil.clamp(0, 1, value);\n }\n\n public static Damp(start: number, final: number, base: number, exponent: number) {\n return MathUtil.Lerp(start, final, 1 - Math.pow(base, exponent));\n }\n\n public static Lerp(start: number, final: number, ammount: number) {\n return start + (final - start) * ammount;\n }\n\n}\n","import * as TWEEN from \"@tweenjs/tween.js\";\nimport * as PIXI from \"pixi.js\";\n\nexport class Ease {\n private static previousEases: Ease[] = [];\n private easings: Easing[] = [];\n private readonly obj: PIXI.Container;\n private delay: TWEEN.Tween | null = null;\n\n private constructor(obj: PIXI.Container, dontStore: boolean) {\n this.obj = obj;\n if (!dontStore) {\n Ease.previousEases.push(this);\n }\n }\n\n public static getEase(obj: PIXI.Container, dontStore?: boolean) {\n if (dontStore == null) {\n dontStore = false;\n }\n let checkIfEaseExists = Ease.previousEases.filter((ease) => {\n return ease.obj == obj;\n });\n if (checkIfEaseExists.length > 0) {\n return checkIfEaseExists[0];\n }\n return new Ease(obj, dontStore);\n }\n\n public createTween>(value: T, newValue: T, isPrimitive: boolean, property: keyof PIXI.Container, duration: number, easingFunc: (ammount: number) => number) {\n const tweenValue = {value: 0}\n const tween = new TWEEN.Tween(isPrimitive ? tweenValue : value);\n const easing = new Easing(tween);\n tween.to(isPrimitive ? {value: 1} : newValue, duration);\n tween.easing(easingFunc);\n tween.onUpdate(() => {\n if (!this.obj.destroyed) {\n if (!isPrimitive) {\n // @ts-ignore\n this.obj[property] = value;\n } else {\n // @ts-ignore\n this.obj[property] = (tweenValue.value * (newValue.value - value.value)) + value.value;\n }\n }\n easing.onUpdate();\n });\n\n tween.onStart(() => {\n if (isPrimitive) {\n // @ts-ignore\n value.value = this.obj[property];\n }\n });\n\n\n if (this.delay == null) {\n\n tween.start();\n } else {\n this.delay.chain(tween);\n this.delay = null;\n }\n this.easings.push(easing);\n\n tween.onStop(() => {\n this.onDone(tween);\n });\n tween.onComplete(() => {\n this.onDone(tween);\n });\n return this;\n }\n\n public TransformTo(newPosition: PIXI.PointData, duration: number, easing: (ammount: number) => number) {\n this.createTween(this.obj.position, newPosition, false, \"position\", duration, easing);\n return this;\n }\n\n private onDone(tween: TWEEN.Tween) {\n this.easings = this.easings.filter((tweenInArray) => {\n return tweenInArray.tween != tween\n })\n }\n\n public ScaleTo(newScale: PIXI.PointData | number, duration: number, easing: (ammount: number) => number) {\n let _newScale: PIXI.PointData = {x: 0, y: 0};\n if (typeof newScale == \"number\") {\n _newScale.x = newScale;\n _newScale.y = newScale;\n }\n this.createTween(this.obj.scale, _newScale, false, \"scale\", duration, easing);\n return this;\n }\n\n public FadeTo(newAlpha: number, duration: number, easing: (ammount: number) => number) {\n this.createTween({value: this.obj.alpha}, {value: newAlpha}, true, \"alpha\", duration, easing);\n return this;\n }\n\n public FadeOut(duration: number, easing: (ammount: number) => number) {\n this.FadeTo(0, duration, easing);\n return this;\n }\n\n public FadeIn(duration: number, easing: (ammount: number) => number) {\n this.FadeTo(1, duration, easing);\n return this;\n }\n\n public ClearEasings() {\n this.easings.forEach((tween) => {\n tween.tween.stop();\n });\n this.easings = [];\n return this;\n }\n\n public Then(cb?: () => void) {\n let largestDuration = this.easings.sort((a, b) => {\n return a.tween.getDuration() - b.tween.getDuration()\n });\n if (largestDuration.length > 0) {\n this.delay = largestDuration[0].tween;\n if (cb != undefined) {\n largestDuration[0].tween.onComplete(() => {this.onDone(largestDuration[0].tween); cb();});\n largestDuration[0].tween.onStop(() => {this.onDone(largestDuration[0].tween); cb();});\n }\n }\n return this;\n }\n\n public OnEach(cb: () => void) {\n let largestDuration = this.easings.sort((a, b) => {\n return a.tween.getDuration() - b.tween.getDuration()\n });\n if (largestDuration.length > 0) {\n largestDuration[0].registerOnUpdate(cb);\n }\n }\n}\n\nclass Easing {\n public tween: TWEEN.Tween;\n private updateEventListeners: (() => void)[] = [];\n public constructor(tween: TWEEN.Tween) {\n this.tween = tween;\n }\n public onUpdate() {\n this.updateEventListeners.forEach((eventListener) => {\n eventListener();\n })\n }\n public registerOnUpdate(cb: () => void) {\n this.updateEventListeners.push(cb);\n }\n public unRegisterOnUpdate(cb: () => void) {\n this.updateEventListeners = this.updateEventListeners.filter((ev) => {return !(cb === ev);});\n }\n}\n","import {List} from \"@pixi/ui\";\nimport {UIUtils} from \"./UIUtils\";\n\nexport class CenteredList extends List {\n public get elementsMargin() {\n return super.elementsMargin;\n }\n public set elementsMargin(margin: number) {\n super.elementsMargin = margin;\n UIUtils.centerPivotOfList(this);\n }\n\n\n public ReCenter() {\n UIUtils.centerPivotOfList(this);\n }\n}\n","import {List} from \"@pixi/ui\";\n\nexport class UIUtils {\n public static centerPivotOfList(list: List) {\n let width = list.leftPadding;\n let height = list.topPadding;\n for (let i = 0; i < list.children.length; i++) {\n let isLast = i + 1 == list.children.length;\n switch (list.type) {\n case \"horizontal\":\n width += list.children[i].width + (!isLast? list.elementsMargin : 0);\n height += list.children[i].height;\n break;\n case \"vertical\":\n width += list.children[i].width;\n height += list.children[i].height + (!isLast? list.elementsMargin : 0);\n break;\n default:\n width += list.children[i].width + (!isLast? list.elementsMargin : 0);\n height += list.children[i].height + (!isLast? list.elementsMargin : 0);\n break;\n }\n }\n switch (list.type) {\n case \"horizontal\":\n height /= list.children.length;\n break;\n case \"vertical\":\n width /= list.children.length;\n break;\n }\n width += list.rightPadding;\n height += list.bottomPadding;\n\n list.pivot.set(width/2, height/2);\n }\n}\n","import \"./style.css\";\nimport {Application, EventSystem} from \"pixi.js\";\nimport {Main} from \"./main\";\nimport {Settings} from \"./Settings/Settings\";\nimport {Renderer} from \"./Settings/impl/Graphics/Renderer\";\nimport {MouseSensitivity} from \"./Settings/impl/Input/MouseSensitivity\";\nimport {UIScale} from \"./Settings/impl/Graphics/UIScale\";\nSettings.registerAll();\nSettings.load();\nconst gameWidth = window.innerWidth;\nconst gameHeight = window.innerHeight;\n\nconst app = new Application();\n// @ts-ignore\nglobalThis.__PIXI_APP__ = app;\nwindow.onload = async (): Promise => {\n // @ts-ignore\n const renderer = Settings.getSetting(Renderer).getValue().value as \"webgl\" | \"webgpu\";\n app.init({\n backgroundColor: \"black\",\n width: gameWidth,\n height: gameHeight,\n antialias: true,\n preference: renderer,\n resolution: window.devicePixelRatio,\n autoDensity: true\n }).then(() => {\n new Main(app);\n });\n};\n\nnavigator.mediaSession.setActionHandler('play', () => {Main.AudioEngine.GetCurrentPlayingMusicNoSilent()?.Play();});\nnavigator.mediaSession.setActionHandler('pause', () => {Main.AudioEngine.GetCurrentPlayingMusicNoSilent()?.Pause();});\nnavigator.mediaSession.setActionHandler('stop', () => {});\nnavigator.mediaSession.setActionHandler('seekbackward', () => {});\nnavigator.mediaSession.setActionHandler('seekforward', () => {});\nnavigator.mediaSession.setActionHandler('seekto', () => {});\nnavigator.mediaSession.setActionHandler('previoustrack', () => {});\nnavigator.mediaSession.setActionHandler('nexttrack', () => {});\n\nObject.defineProperty(window, \"setSensitivity\", {value: (sensitivity: number) => {\n Settings.getSetting(MouseSensitivity).setValue(sensitivity);\n}});\n\nObject.defineProperty(window, \"setRenderer\", {value: (renderer: string) => {\n let rendererSetting = Settings.getSetting(Renderer);\n rendererSetting.setValue(renderer == \"webgl\" ? rendererSetting.webglOption : rendererSetting.webGpuOption);\n window.location.reload();\n}});\n\nObject.defineProperty(window, \"setUIScale\", {value: (scale: number) => {\n Settings.getSetting(UIScale).setValue(scale);\n window.location.reload();\n}});\n","import * as PIXI from \"pixi.js\";\nimport {Application} from \"pixi.js\";\nimport {Screen} from \"./Screens/Screen\";\nimport {LoadScreen} from \"./Screens/LoadScreen/LoadScreen\";\nimport {InteractScreen} from \"./Screens/InteractScreen/InteractScreen\";\nimport {Loader} from \"./Loader\";\nimport {MenuCursor} from \"./Elements/MenuCursor/MenuCursor\";\nimport {AudioEngine} from \"./Audio/AudioEngine\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {SettingsPane} from \"./Elements/Settings/SettingsPane\";\nimport {unzip} from \"unzipit\";\nimport {BeatmapParser} from \"./Util/Beatmap/Parser/BeatmapParser\";\nimport {EventTypes} from \"./Util/Beatmap/Data/Sections/Events/EventTypes\";\nimport {EventBackground} from \"./Util/Beatmap/Data/Sections/Events/EventBackground\";\n\nexport class Main {\n public static app: Application;\n public static mousePos = {x: 0, y: 0};\n public static pointerLockExitTime: number;\n public static cursor: MenuCursor;\n public static AudioEngine: AudioEngine;\n private static currentScreen: Screen | null;\n private static allScreens: Screen[] = [];\n private static clickArea: PIXI.Graphics = new PIXI.Graphics();\n private static doPointerLock: boolean = false;\n private static settingsPane: SettingsPane;\n\n public constructor(app: Application) {\n Main.app = app;\n // for testing purposes\n Object.defineProperty(window, \"onDropEvent\", {value: (e: DragEvent) => {\n e.preventDefault();\n if (e.dataTransfer!.items) {\n let item = [...e.dataTransfer!.items][0];\n if (item.kind == \"file\") {\n const file = item.getAsFile()!;\n unzip(file).then(({entries}) => {\n for (const [name, entry] of Object.entries(entries)) {\n if (name.endsWith(\".osu\")) {\n entry.text().then(async (osuFile) => {\n let beatmapData = BeatmapParser.Parse(osuFile);\n let bgEvent: EventBackground | undefined =\n beatmapData.Events.Events.find((event) => {\n if (event instanceof EventBackground) return event;\n }) as EventBackground;\n if (bgEvent) {\n for (const [name, entry] of Object.entries(entries)) {\n if (name == bgEvent.filename) {\n beatmapData.background = await entry.blob();\n }\n }\n }\n for (const [name, entry] of Object.entries(entries)) {\n if (name == beatmapData.General.AudioFilename) {\n let blob = await entry.blob()\n let url = URL.createObjectURL(blob);\n Main.AudioEngine.PlayMusicImmediately(url, beatmapData, () => {\n console.log(\"Now playing \" + beatmapData.Metadata.TitleUnicode + \" - \" + beatmapData.Metadata.ArtistUnicode +\n \" (\" + beatmapData.Metadata.Title + \" - \" + beatmapData.Metadata.Artist + \")\");\n });\n console.log(beatmapData);\n }\n }\n });\n break;\n }\n }\n });\n }\n }\n }});\n\n Object.defineProperty(window, \"onDragEvent\", {value: (e: DragEvent) => {\n e.preventDefault();\n }});\n Main.app.canvas.setAttribute(\"ondrop\", \"window.onDropEvent(event);\");\n Main.app.canvas.setAttribute(\"ondragover\", \"window.onDragEvent(event);\");\n\n document.body.appendChild(Main.app.canvas);\n\n Main.settingsPane = new SettingsPane();\n Main.settingsPane.zIndex = 999998;\n Main.app.stage.addChild(Main.settingsPane);\n\n document.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.ctrlKey && e.code == \"KeyO\"){\n Main.settingsPane.toggle();\n }\n });\n\n this.doResize();\n window.addEventListener(\"resize\", this.doResize);\n Main.app.ticker.add(() => {\n TWEEN.update();\n })\n Main.app.stage.eventMode = \"static\";\n Main.AudioEngine = new AudioEngine();\n Main.app.stage.addEventListener(\"mousemove\", (e) => {\n Main.mousePos.x = e.clientX;\n Main.mousePos.y = e.clientY;\n if (Main.cursor) {\n Main.cursor.updateMouse();\n }\n });\n document.addEventListener(\"pointerlockchange\", this.pointerLockChanged, false);\n Main.switchScreen(new LoadScreen());\n Loader.Load(Main.AudioEngine.audioContext).then(() => {\n Main.cursor = new MenuCursor(false);\n let dialogOk = Loader.GetAudio(\"sample_dialog_ok\");\n let introTrack = Loader.Get(\"introTrianglesTrack\");\n Main.switchScreen(new InteractScreen(introTrack, dialogOk));\n });\n }\n\n public static lockKeyboard() {\n // @ts-ignore\n if (navigator.keyboard) {\n // @ts-ignore\n navigator.keyboard.lock([]).then(() => {\n console.log(\"Locked keyboard!\");\n if (!document.fullscreenElement) {\n console.warn(\"Keyboard lock won't work unless the user is in fullscreen (as requested by the game, not if the user just presses F11)!\");\n }\n });\n }\n }\n\n public static pointerLock() {\n try {\n this.doPointerLock = true;\n // @ts-ignore\n Main.app.canvas.requestPointerLock({\n unadjustedMovement: true,\n });\n } catch (e) {\n console.warn(\"Failed to lock cursor, error:\", e);\n this.doPointerLock = false;\n }\n\n }\n\n public static exitPointerLock() {\n this.doPointerLock = false;\n // @ts-ignore\n Main.app.canvas.exitPointerLock();\n }\n\n public static switchScreen(screen: Screen) {\n if (this.currentScreen != null) {\n this.currentScreen.zIndex = 1;\n this.currentScreen.onClose().then((lastScreen) => {\n for (let i = 0; i < this.allScreens.length; i++) {\n if (this.allScreens[i] == lastScreen) {\n this.allScreens.splice(i, 1);\n }\n }\n Main.app.ticker.remove(lastScreen.draw);\n Main.app.stage.removeChild(lastScreen);\n lastScreen.destroy();\n });\n }\n Main.app.stage.addChild(screen);\n this.allScreens.push(screen);\n this.currentScreen = screen;\n screen.start();\n screen.onResize();\n Main.app.ticker.add(screen.draw, screen);\n }\n\n public doResize(): void {\n Main.app.renderer.resize(window.innerWidth, window.innerHeight);\n Main.app.stage.scale.x = 1;\n Main.app.stage.scale.y = 1;\n if (!Main.clickArea.destroyed) {\n Main.clickArea.width = window.innerWidth;\n Main.clickArea.height = window.innerHeight;\n Main.clickArea.position.set(0, 0);\n }\n Main.allScreens.forEach((screen) => {\n screen.onResize();\n })\n Main.settingsPane.resize();\n }\n\n private pointerLockChanged(): void {\n if (!document.pointerLockElement && Main.doPointerLock) {\n PIXI.EventSystem.isPointerLocked = false;\n Main.pointerLockExitTime = Date.now();\n Main.clickArea = new PIXI.Graphics();\n Main.clickArea.rect(0, 0, 1, 1);\n Main.clickArea.fill(\"rgba(0,0,0,0.1)\");\n Main.clickArea.width = window.innerWidth;\n Main.clickArea.height = window.innerHeight;\n Main.clickArea.position.set(0, 0);\n Main.app.stage.addChild(Main.clickArea);\n Main.clickArea.eventMode = \"static\";\n Main.clickArea.cursor = \"pointer\";\n Main.cursor.PopOut();\n Main.clickArea.zIndex = 9999999;\n Main.clickArea.onclick = () => {\n if (Date.now() - Main.pointerLockExitTime < 1500) {\n return;\n }\n Main.clickArea.removeFromParent();\n Main.clickArea.destroy();\n Main.pointerLock();\n Main.cursor.PopIn();\n }\n } else {\n PIXI.EventSystem.isPointerLocked = true;\n }\n }\n\n}\n","export default \"in vec2 vUV;\\nin vec2 vPositionOffset;\\nin vec2 vPosition;\\nin vec4 vColorTint;\\nuniform sampler2D uTexture;\\nuniform float time;\\n\\nvoid main() {\\n float a = ((vPositionOffset.y + vPosition.y)/1200.0) - 0.1;\\n vec4 color = texture(uTexture, vUV);\\n if (a > 1.0) {\\n a = 1.0;\\n }\\n gl_FragColor = (color*vColorTint)*a;\\n}\";","export default \"in vec2 aPosition;\\nin vec2 aUV;\\nin vec2 aPositionOffset;\\nin vec4 aColorTint;\\n\\nout vec2 vUV;\\nout vec2 vPositionOffset;\\nout vec2 vPosition;\\nout vec4 vColorTint;\\n\\nuniform mat3 uProjectionMatrix;\\nuniform mat3 uWorldTransformMatrix;\\nuniform mat3 uTransformMatrix;\\n\\n\\nvoid main() {\\n\\n mat3 mvp = uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\\n gl_Position = vec4((mvp * vec3(aPosition + aPositionOffset, 1.0)).xy, 0.0, 1.0);\\n vPositionOffset = aPositionOffset;\\n vUV = aUV;\\n vPosition = aPosition;\\n vColorTint = aColorTint;\\n}\";","export default \"struct GlobalUniforms {\\n uProjectionMatrix:mat3x3,\\n uWorldTransformMatrix:mat3x3,\\n uWorldColorAlpha: vec4,\\n uResolution: vec2,\\n}\\n\\nstruct LocalUniforms {\\n uTransformMatrix:mat3x3,\\n uColor:vec4,\\n uRound:f32,\\n}\\n\\n\\n@group(0) @binding(0) var globalUniforms : GlobalUniforms;\\n@group(1) @binding(0) var localUniforms : LocalUniforms;\\n\\nstruct VertexOutput {\\n @builtin(position) position: vec4,\\n @location(0) vUV: vec2,\\n @location(1) vPositionOffset: vec2,\\n @location(2) vPosition: vec2,\\n @location(3) vColorTint: vec4\\n};\\n\\n\\n@vertex\\nfn mainVert(\\n @location(0) aPosition : vec2,\\n @location(1) aUV : vec2,\\n @location(2) aColorTint : vec4,\\n @location(3) aPositionOffset : vec2,\\n) -> VertexOutput {\\n var mvp = globalUniforms.uProjectionMatrix\\n * globalUniforms.uWorldTransformMatrix\\n * localUniforms.uTransformMatrix;\\n\\n var output: VertexOutput;\\n\\n output.position = vec4(mvp * vec3(aPosition+aPositionOffset, 1.0), 1.0);\\n output.vUV = aUV;\\n output.vPosition = aPosition;\\n output.vPositionOffset = aPositionOffset;\\n output.vColorTint = aColorTint;\\n\\n return output;\\n};\\n\\nstruct WaveUniforms {\\n time:f32,\\n}\\n\\n@group(2) @binding(1) var uTexture : texture_2d;\\n@group(2) @binding(2) var uSampler : sampler;\\n@group(2) @binding(3) var waveUniforms : WaveUniforms;\\n\\n@fragment\\nfn mainFrag(\\n @location(0) vUV: vec2,\\n @location(1) vPositionOffset: vec2,\\n @location(2) vPosition: vec2,\\n @location(3) vColorTint: vec4\\n) -> @location(0) vec4 {\\n var a: f32 = ((vPositionOffset.y + vPosition.y)/1200.0) - 0.1;\\n let color: vec4 = textureSample(uTexture, uSampler, vUV);\\n if (a > 1.0){\\n a = 1.0;\\n }\\n return (color*vColorTint)*a;\\n};\";","export default \"in vec4 vColor;\\nin vec2 vUV;\\n\\nuniform sampler2D uTexture;\\nuniform float progress;\\n\\nvoid main() {\\n vec4 color = texture2D(uTexture, vUV);\\n float a = vColor.a * color.a;\\n vec4 _vColor = vec4(smoothstep(0.88, 1.0, color.a))*vColor;\\n vec4 outColor = (color.r < progress) ? vec4(_vColor.rgb * a, a) : vec4(0.0);\\n gl_FragColor = outColor;\\n}\\n\";","export default \"in vec2 aPosition;\\nin vec4 aColor;\\nin vec2 aUV;\\n\\nout vec4 vColor;\\nout vec2 vUV;\\n\\nuniform mat3 uProjectionMatrix;\\nuniform mat3 uWorldTransformMatrix;\\n\\nuniform mat3 uTransformMatrix;\\n\\n\\nvoid main() {\\n\\n mat3 mvp = uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\\n gl_Position = vec4((mvp * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vColor = aColor;\\n vUV = aUV;\\n}\\n\";","export default \"struct GlobalUniforms {\\n uProjectionMatrix:mat3x3,\\n uWorldTransformMatrix:mat3x3,\\n uWorldColorAlpha: vec4,\\n uResolution: vec2,\\n}\\n\\nstruct LocalUniforms {\\n uTransformMatrix:mat3x3,\\n uColor:vec4,\\n uRound:f32,\\n}\\n\\n\\n@group(0) @binding(0) var globalUniforms : GlobalUniforms;\\n@group(1) @binding(0) var localUniforms : LocalUniforms;\\n\\nstruct VertexOutput {\\n @builtin(position) position: vec4,\\n @location(0) vUV: vec2,\\n @location(1) vColor: vec4,\\n};\\n\\n\\n@vertex\\nfn mainVert(@location(0) aPosition : vec2, @location(1) aUV : vec2, @location(2) aColor: vec4\\n) -> VertexOutput {\\n var mvp = globalUniforms.uProjectionMatrix\\n * globalUniforms.uWorldTransformMatrix\\n * localUniforms.uTransformMatrix;\\n\\n var output: VertexOutput;\\n\\n output.position = vec4(mvp * vec3(aPosition, 1.0), 1.0);\\n output.vUV = aUV;\\n output.vColor = aColor;\\n\\n return output;\\n};\\n\\nstruct ProgressUniform {\\n progress:f32\\n}\\n\\n@group(2) @binding(1) var uTexture : texture_2d;\\n@group(2) @binding(2) var uSampler : sampler;\\n@group(2) @binding(3) var uProgress : ProgressUniform;\\n\\n@fragment\\nfn mainFrag(@location(0) vUV: vec2, @location(1) vColor: vec4) -> @location(0) vec4 {\\n let color: vec4 = textureSample(uTexture, uSampler, vUV);\\n let a: f32 = color.a;\\n let _vColor: vec4 = smoothstep(0.88, 1.0, color.a) * vColor;\\n var outColor: vec4 = vec4(0.0);\\n if (color.r < uProgress.progress) {\\n outColor = vec4(_vColor.rgb * a, a);\\n }\\n return outColor;\\n};\\n\";","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.hmd = function(module) {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: function() {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkkosu\"] = self[\"webpackChunkkosu\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [39], function() { return __webpack_require__(29820); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","main_1","require","Audio","audio","source","mediaSource","mediaAudioElement","id","isPaused","this","_useMediaSource","paused","isPlaying","nodes","tempArrayMain","Float32Array","tempArrayL","tempArrayR","LeftChannel","RightChannel","FrequencyAmplitudes","_connectedToContext","_onEndCallback","timeStarted","GetMaximumAudioLevel","Math","max","GetAverageAudioLevel","Create","audioContext","useMediaSource","Error","createMediaElementSource","onpause","ended","Play","createBufferSource","buffer","AddAudioNode","node","push","GetNode","type","filter","length","ConnectToContext","howToConnectFunction","forEach","index","connect","AnalyserNode","destination","play","start","Pause","pause","Stop","stop","SetTime","timeMS","currentTime","GetDuration","duration","GetCurrentTime","Date","now","RegisterEndCallBack","callback","onended","exports","beatmap","fadingOut","fadeOutTimeout","playingCallback","FadeOut","clearTimeout","gainNodes","GainNode","gain","linearRampToValueAtTime","Main","AudioEngine","setTimeout","PlayingAudios_1","Audio_1","BeatmapData_1","UnInheritedTimingPoint_1","Effect_1","_playingAudios","_musicQueue","_audioIdTicker","_changeCallbacks","silentMusic","createSilentMusic","useSilentMusic","constructor","AudioContext","PlayingAudios","app","ticker","add","update","UpdateMusicQueue","_play","cb","mapAudio","MapAudio","BeatmapData","timingPoint","UnInheritedTimingPoint","time","beatLength","effects","Effect","None","TimingPoints","addMusicChangeEventListener","removeMusicChangeEventListener","GetCurrentPlayingMusic","GetCurrentPlayingMusicNoSilent","PlayEffect","pitch","audioObj","AddToMusicQueue","beatMapData","musicPlayingCallback","mapAudioObj","document","createElement","src","PlayMusicImmediately","currentPlaying","currentPlayingNoSilent","analyzerMain","analyzerL","analyzerR","getFloatFrequencyData","i","Infinity","getFloatTimeDomainData","avgL","avgR","value","createGain","analyzer","createAnalyser","fftSize","smoothingTimeConstant","splitter","createChannelSplitter","audios","timeOffset","onloadedmetadata","playbackRate","splice","audioInArr","PIXI","__importStar","MathUtil_1","LogoVisualizer","Container","static","frequencyAmplitudes","temporalAmplitudes","graphics","Graphics","index_change","bar_length","bars_per_visualiser","visualiser_rounds","decay_per_millisecond","time_between_updates","amplitude_dead_zone","indexOffset","firstDraw","alpha","number","super","blendMode","addChild","eventMode","setInterval","updateAmplitudes","draw","clear","decayFactor","deltaMS","j","rotation","MathUtil","DegreesToRadians","rotationCos","cos","rotationSin","sin","barPosition","x","size","y","barSize","sqrt","amplitudeOffset","moveTo","lineTo","stroke","color","width","audioTime","GetCurrentTimingPoints","targetAmplitude","KiaiTime","LogoVisualizer_1","MenuLogoVisualizer","TWEEN","Ease_1","LoadAnim","bg","arc","arcContainer","animInterval","container","bgContainer","bgRotation","bgColor","arcColor","pivot","set","PI","roundRect","fill","cap","scale","Ease","getEase","ScaleTo","Easing","Quadratic","InOut","FadeIn","doAnims","createTween","angle","getWidth","getHeight","deltaTime","destroy","_options","clearInterval","Screen_1","LogoTrackingContainer_1","ButtonSystem","menuBG","isOpened","logo","state","ButtonSystemState","Initial","logoTrackingContainer","LogoTrackingContainer","menuHeight","State","lastState","updateLogoState","console","log","name","arguments","undefined","Exit","Close","TopLevel","Open","ClearEasings","Screen","getScaleBasedOffScreenSize","Linear","In","Quintic","Out","drawMenuBG","Action","onOsuLogo","rect","Edit","Sinusoidal","isOpen","onResize","position","window","innerHeight","innerWidth","Logo","easing","startPosition","startTime","visual_box_size","StartTracking","IsTracking","StopTracking","ComputeLogoTrackingPosition","pos","Update","Triangles_1","Loader_1","MenuLogoVisualizer_1","OsuLogo","outline","visualizer","triangles","Triangles","flash","logoContainer","logoBounceContainer","logoBeatContainer","logoAmplitudeContainer","logoHoverContainer","rippleContainer","ripple","defaultVisualizerAlpha","early_activation","timeElapsedSinceLastBeat","timeUntilNextBeat","lastTimeElapasedSinceLastBeat","selectSample","Loader","GetAudio","backToLogoSample","isMouseDown","mouseDownPosition","SizeForFlow","Sprite","from","anchor","mask","circle","height","hitArea","Circle","onmouseenter","_onmouseenter","onmouseleave","_onmouseleave","onmousedown","_onmousedown","onclick","_onclick","stage","addEventListener","e","_onmouseup","Elastic","mousePos","Exponential","TransformTo","GetCurrentUninheritedTimingPoint","Velocity","Damp","maxAmplitude","onNewBeat","change","pow","amplitudeAdjust","min","Then","FadeTo","osuCircleTriangles_vert_1","__importDefault","osuCircleTriangles_frag_1","osuCircleTriangles_wgsl_1","bgGradient","timeSinceLastSpawn","instancePositionBuffer","totalTriangles","colorStops","FillGradient","ratio","addColorStop","random","velocity","randVelocity","Buffer","data","usage","BufferUsage","VERTEX","COPY_DST","Color","geometry","Geometry","attributes","aPosition","aUV","aColorTint","red","green","blue","aPositionOffset","instance","indexBuffer","instanceCount","gl","vertex","default","fragment","gpu","entryPoint","triangleGraphic","triangleTexture","renderer","generateTexture","shader","Shader","resources","uTexture","uSampler","style","waveUniforms","triangleMesh","Mesh","options","count","triangle","u1","u2","randStdNormal","MenuCursor","mouseCursor","mouseCursorAdditive","mouseContainer","animContainer","animRotationContainer","dragRotationState","DragRotationState","NotDragging","lastDragRotationState","mouseHideContainer","elastic_const2","elastic_const","elastic_offset_quarter","posMouseDown","mouseIsDown","cursorTapSample","mouseButtonClicked","visible","updateMouse","tint","zIndex","addEventListeners","button","DragStarted","Rotating","abs","PopIn","PopOut","distance","offsetX","offsetY","degrees","RadiansToDegrees","atan2","diff","Background","texture","show","Background_1","RandomBackground","parallaxMultiplier","getScreenWidth","getScreenHeight","newRandomBG","background","url","URL","createObjectURL","Assets","load","loadParser","then","setBG","bgSprite","children","useSeasonalBackgrounds","seasonalBackgroundsNum","randomNum","defaultBackgroundsNum","round","Texture","onClose","Promise","resolve","sprite","scaleFactor","texWidth","texHeight","SettingsPane","resize","open","Cubic","toggle","close","addToLoadList","loadList","isAudio","pixiBundleName","Get","result","loadedList","loadedObj","GetString","dataString","dataAudio","addBackgrounds","fetch","encodeURIComponent","res","json","backgrounds","catch","error","warn","Load","nonPixi","pixi","pixiwithBundles","loadedAssets","erroredAssets","loadObj","added","loadObjs","incrementLoadAssetNumber","errored","response","blob","isText","text","arrayBuffer","arrBuff","decodeAudioData","audioBuff","bundle","assets","alias","addBundle","loadBundle","IntroScreen_1","InteractScreen","text2","textContainer","textContainerContainer","introTrack","clickSound","clickArea","Text","fontFamily","fontSize","align","cursor","clicked","switchScreen","IntroScreen","body","pointerLock","lockKeyboard","ontap","GlitchingTriangles","bounds","randX","x1","x2","randY","y1","y2","unzipit_1","GlitchingTriangles_1","MainMenu_1","LazerLogo_1","BeatmapParser_1","UIUtils_1","CenteredList_1","introTrackUrl","doTextSpacingAnim","ruleSetContainer","ruleSetList","CenteredList","logoContainerContainer","lazerLogo","LazerLogo","flashed","standard","taiko","ctb","mania","completionPromise","welcomeText","letterSpacing","async","entries","unzip","entry","Object","endsWith","osuFile","beatmapData","BeatmapParser","Parse","General","AudioFilename","afterAudioPlay","glitchingInterval","padding","elementsMargin","UIUtils","centerPivotOfList","MainMenu","destroyed","ReCenter","LogoAnimation_1","highlight","textureHighlight","textureBackground","LogoAnimation","dummy","OnEach","setProgress","logoAnimation_vert_1","logoAnimation_frag_1","logoAnimation_wgsl_1","uProgress","progress","quadGeometry","aColor","quad","uniforms","LoadAnim_1","LoadScreen","loadAnim","RandomBackground_1","OsuLogo_1","ButtonSystem_1","osuCircle","menu","Settings_1","UIScale_1","uiScale","Settings","getSetting","UIScale","getValue","SettingsCategory","info","SettingData","register","setting","onValueChanged","Setting_1","DropdownSetting","Setting","getDefaultValue","defaultValue","setValue","list","find","option","displayName","save","loadFromSaveValue","RangeSetting","clamp","minValue","maxValue","Renderer_1","MouseSensitivity_1","registerAll","Renderer","MouseSensitivity","settingSaveDataString","localStorage","getItem","settings","getList","JSON","parse","corrupt","stringify","category","settingObj","_settingObj","reset","settingSaveData","setItem","removeItem","settingsList","_setting","getSettingData","DropdownSetting_1","webglOption","webGpuOption","RangeSetting_1","increment","pixi_js_1","Input","EventSystem","cursorSensitivity","GeneralData_1","EditorData_1","Metadata_1","DifficultyData_1","EventsData_1","TimingPointsData_1","ColorsData_1","GeneralData","Editor","EditorData","Metadata","Difficulty","DifficultyData","Events","EventsData","TimingPointsData","Colors","ColorsData","HPDrainRate","CircleSize","OverallDifficulty","ApproachRate","SliderMultiplier","SliderTickRate","Bookmarks","DistanceSpacing","BeatDivisor","GridSize","TimelineZoom","eventType","eventParams","Event_1","EventTypes_1","EventBackground","Event","EventTypes","BACKGROUND","filename","xOffset","yOffset","Countdown","Countdown_1","SampleSet_1","Mode_1","OverlayPosition_1","AudioLeadIn","AudioHash","PreviewTime","Normal","SampleSet","StackLeniency","Mode","OSU","LetterboxInBreaks","StoryFireInFront","UseSkinSprites","AlwaysShowPlayfield","OverlayPosition","NoChange","SkinPreference","EpilepsyWarning","CountdownOffset","SpecialStyle","WidescreenStoryboard","SamplesMatchPlaybackRate","Title","TitleUnicode","Artist","ArtistUnicode","Creator","Version","Source","Tags","BeatmapID","BeatmapSetID","TimingPoint_1","InheritedTimingPoint","TimingPoint","sliderVelocityMultiplier","sampleSet","sampleIndex","volume","InheritedTimingPoint_1","toReturn","unInheritedTimingPoint","meter","TimingPointsParser_1","GeneralParser_1","EditorParser_1","MetadataParser_1","DifficultyParser_1","EventsParser_1","osuFileContent","storyBoardFileContent","osuFileContentLines","split","GeneralParser","ParseGeneral","GetSection","EditorParser","ParseEditor","MetadataParser","ParseMetadata","DifficultyParser","ParseDifficulty","EventsParser","ParseEvents","TimingPointsParser","ParseTimingPoints","sectionName","section","str","startsWith","AutoParse","sectionType","propValue","beatmapDataSection","key","keyExists","sectionKey","toString","isNumber","test","parseFloat","substring","num","EventBackground_1","event","values","parseInt","replaceAll","prop","Number","radians","clamp01","final","base","exponent","Lerp","ammount","easings","obj","delay","dontStore","previousEases","checkIfEaseExists","ease","newValue","isPrimitive","property","easingFunc","tweenValue","tween","Tween","to","onUpdate","onStart","chain","onStop","onDone","onComplete","newPosition","tweenInArray","newScale","_newScale","newAlpha","largestDuration","sort","a","b","getDuration","registerOnUpdate","updateEventListeners","eventListener","unRegisterOnUpdate","ev","ui_1","List","margin","leftPadding","topPadding","isLast","rightPadding","bottomPadding","gameWidth","gameHeight","Application","globalThis","__PIXI_APP__","onload","init","backgroundColor","antialias","preference","resolution","devicePixelRatio","autoDensity","navigator","mediaSession","setActionHandler","defineProperty","sensitivity","rendererSetting","location","reload","LoadScreen_1","InteractScreen_1","MenuCursor_1","AudioEngine_1","SettingsPane_1","preventDefault","dataTransfer","items","item","kind","file","getAsFile","_ref","bgEvent","canvas","setAttribute","appendChild","settingsPane","ctrlKey","code","doResize","clientX","clientY","pointerLockChanged","dialogOk","keyboard","lock","fullscreenElement","doPointerLock","requestPointerLock","unadjustedMovement","exitPointerLock","screen","currentScreen","lastScreen","allScreens","remove","removeChild","pointerLockElement","isPointerLocked","pointerLockExitTime","removeFromParent","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","module","loaded","__webpack_modules__","call","m","O","chunkIds","fn","priority","notFulfilled","fulfilled","keys","every","r","d","definition","o","enumerable","get","hmd","create","prototype","hasOwnProperty","Symbol","toStringTag","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","self","bind","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/game.18f3b279d71e3a6b2405.js b/game.18f3b279d71e3a6b2405.js new file mode 100644 index 0000000..ca2a993 --- /dev/null +++ b/game.18f3b279d71e3a6b2405.js @@ -0,0 +1,2 @@ +!function(){"use strict";var e,t={65918:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MapAudio=t.Audio=void 0;const n=i(20825),s=i(15041);class o{audio;source;mediaSource;mediaAudioElement;id;get isPaused(){return!!this._useMediaSource&&this.mediaAudioElement.paused}get isPlaying(){return!this._useMediaSource||!this.mediaAudioElement.paused}nodes=[];tempArrayMain=new Float32Array(256);tempArrayL=new Float32Array(64);tempArrayR=new Float32Array(64);LeftChannel=0;RightChannel=0;FrequencyAmplitudes=new Float32Array(256);_connectedToContext=!1;_useMediaSource=!1;_onEndCallback;timeStarted=0;paused=!1;beatmap;GetMaximumAudioLevel(){return Math.max(this.LeftChannel,this.RightChannel)}GetAverageAudioLevel(){return(this.LeftChannel+this.RightChannel)/2}Create(e,t){if(this._useMediaSource=t||!1,t){if(!this.mediaAudioElement)throw new Error("HTML Audio Element was not initialized!");this.mediaSource=e.createMediaElementSource(this.mediaAudioElement),this.mediaAudioElement.onpause=()=>{this.paused||this.mediaAudioElement.ended||this.Play()}}else this.source=e.createBufferSource(),this.source.buffer=this.audio}AddAudioNode(e){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");this.nodes.push(e)}GetNode(e){let t=this.nodes.filter((t=>t instanceof e));return t.length>0?t:null}ConnectToContext(e,t){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");this._connectedToContext||(this._connectedToContext=!0,this.nodes.length>0?t?t(this.nodes,this._useMediaSource?this.mediaSource:this.source):this.nodes.forEach(((t,i)=>{this.source.connect(t),t instanceof AnalyserNode||t.connect(e.destination)})):this._useMediaSource?this.mediaSource.connect(e.destination):this.source.connect(e.destination))}Play(){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");if(this.paused=!1,this._useMediaSource){this.mediaAudioElement.play();let e=this.beatmap.Events.Events.find((e=>{if(e.eventType==s.EventTypes.VIDEO)return e}));e&&e.texture&&e.texture.source.resource.startPromise&&e.texture.source.resource.startPromise.then((()=>{e.texture.source.resource.play()}))}else this.source.start()}Pause(){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");if(!this._useMediaSource)throw new Error("Pause is not supported on AudioSourceBuffer!");this.paused=!0,this.mediaAudioElement.pause();let e=this.beatmap.Events.Events.find((e=>{if(e.eventType==s.EventTypes.VIDEO)return e}));e&&e.texture&&e.texture.source.resource.startPromise&&e.texture.source.resource.startPromise.then((()=>{e.texture.source.resource.pause()}))}Stop(){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");this.paused=!0,this._useMediaSource?(this.mediaAudioElement.pause(),this._onEndCallback&&this._onEndCallback()):this.source.stop()}SetTime(e){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");if(!this._useMediaSource)throw new Error("SetTime is not supported on AudioSourceBuffer!");this.mediaAudioElement.currentTime=e/1e3}GetDuration(){return this._useMediaSource?1e3*this.mediaAudioElement.duration:this.audio.duration}GetCurrentTime(){return this._useMediaSource?1e3*this.mediaAudioElement.currentTime:0!=this.timeStarted?Date.now()-this.timeStarted:0}RegisterEndCallBack(e){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");this._onEndCallback=e,this._useMediaSource?this.mediaAudioElement.onended=()=>{this.paused=!0,e()}:this.source.onended=()=>{this.isPaused||(this.paused=!0,e())}}}t.Audio=o;t.MapAudio=class extends o{fadingOut=!1;fadeOutTimeout;playingCallback;FadeOut(){if(!(this._useMediaSource?this.mediaSource:this.source))throw new Error("Source not created yet!");if(!this._connectedToContext)throw new Error("Not connected to audio context yet!");if(!this._useMediaSource)throw new Error("FadeOut is not supported on AudioSourceBuffer!");if(this.fadingOut)return;this.fadingOut=!0,clearTimeout(this.fadeOutTimeout);let e=this.GetNode(GainNode);if(null==e)throw new Error("Gain Node doesn't exist on Audio Object!");e[0].gain.linearRampToValueAtTime(0,n.Main.AudioEngine.audioContext.currentTime+1),setTimeout((()=>{this.Stop()}),1e3)}}},85437:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.AudioEngine=void 0;const n=i(14981),s=i(65918),o=i(17898),a=i(20825),r=i(87816),l=i(22331);t.AudioEngine=class{audioContext;_playingAudios;_musicQueue=[];_audioIdTicker=0;_changeCallbacks=[];silentMusic=this.createSilentMusic();useSilentMusic=!0;constructor(){this.audioContext=new AudioContext,this._playingAudios=new n.PlayingAudios,a.Main.app.ticker.add((()=>{this.update()}))}UpdateMusicQueue(){this._musicQueue[0]&&(this._musicQueue[0].fadingOut||0!=this._musicQueue[0].GetCurrentTime()||(this._play(this._musicQueue[0]),this._changeCallbacks.forEach((e=>e(this._musicQueue[0])))),this._musicQueue[0].fadingOut&&this._musicQueue[1]&&this._musicQueue[1]&&(this._play(this._musicQueue[1]),this._changeCallbacks.forEach((e=>e(this._musicQueue[1]))))),this._musicQueue.length>=1?this.useSilentMusic=!1:(this.silentMusic=this.createSilentMusic(),this.useSilentMusic=!0)}createSilentMusic(){let e=new s.MapAudio;e.timeStarted=Date.now(),e.beatmap=new o.BeatmapData;let t=new r.UnInheritedTimingPoint;return t.time=0,t.beatLength=1e3,t.effects=l.Effect.None,e.beatmap.TimingPoints.TimingPoints.push(t),e}addMusicChangeEventListener(e){this._changeCallbacks.push(e)}removeMusicChangeEventListener(e){this._changeCallbacks=this._changeCallbacks.filter((t=>t!=e))}GetCurrentPlayingMusic(){return this.useSilentMusic?this.silentMusic:this._musicQueue[0]}GetCurrentPlayingMusicNoSilent(){return this._musicQueue[0]}PlayEffect(e,t){let i=new s.Audio;i.audio=e,i.id=this._audioIdTicker,this._play(i,t),this._audioIdTicker++}AddToMusicQueue(e,t,i){let n=new s.MapAudio;return n.mediaAudioElement=document.createElement("audio"),n.mediaAudioElement.src=e,n.beatmap=t,n.id=this._audioIdTicker,i&&(n.playingCallback=i),this._musicQueue.push(n),this._audioIdTicker++,this.UpdateMusicQueue(),n.id}PlayMusicImmediately(e,t,i){let n=this.GetCurrentPlayingMusicNoSilent();this._musicQueue=[],n&&n.FadeOut(),this.AddToMusicQueue(e,t,i)}update(){let e=this.GetCurrentPlayingMusic(),t=this.GetCurrentPlayingMusicNoSilent();if(t)if(t.isPaused)this.useSilentMusic=!0;else if(this.useSilentMusic&&(this.useSilentMusic=!1,e=this.GetCurrentPlayingMusic()),!this.useSilentMusic){e.fadingOut||e.GetDuration()-e.GetCurrentTime()<=1e3&&e.FadeOut();let t=e.GetNode(AnalyserNode)[0],i=e.GetNode(AnalyserNode)[1],n=e.GetNode(AnalyserNode)[2];t.getFloatFrequencyData(e.tempArrayMain);for(let t=0;t{s+=(e+1)/2})),e.tempArrayR.forEach((e=>{o+=(e+1)/2})),s/=e.tempArrayL.length,o/=e.tempArrayR.length,e.LeftChannel=s,e.RightChannel=o}}_play(e,t){if(e instanceof s.MapAudio){e.Create(this.audioContext,!0);let t=this.audioContext.createGain();t.gain.value=0;let i=this.audioContext.createAnalyser();i.fftSize=512,i.smoothingTimeConstant=0;let n=this.audioContext.createChannelSplitter(2),s=this.audioContext.createAnalyser();s.smoothingTimeConstant=0,s.fftSize=128;let o=this.audioContext.createAnalyser();o.smoothingTimeConstant=0,o.fftSize=128,e.AddAudioNode(t),e.AddAudioNode(i),e.AddAudioNode(s),e.AddAudioNode(o),e.ConnectToContext(this.audioContext,((e,a)=>{a.connect(t),t.connect(this.audioContext.destination),a.connect(i),a.connect(n),n.connect(s,0),n.connect(o,1)})),e.Play(),this._playingAudios.audios.push(e),e.playingCallback&&e.playingCallback(),t.gain.linearRampToValueAtTime(1,this.audioContext.currentTime+.5)}else e.Create(this.audioContext,!1),e.ConnectToContext(this.audioContext),t&&e.source&&(e.source.playbackRate.value=t),e.Play(),this._playingAudios.audios.push(e);e.RegisterEndCallBack((()=>{e instanceof s.MapAudio&&(this._musicQueue[0]==e&&this._musicQueue.splice(0,1),this.UpdateMusicQueue()),this._playingAudios.audios.forEach(((t,i)=>{t!==e||this._playingAudios.audios.splice(i,1)}))}))}}},14981:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PlayingAudios=void 0;t.PlayingAudios=class{audios=[]}},9611:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LogoVisualizer=void 0;const a=i(20825),r=o(i(58687)),l=i(5825),u=i(22331);class c extends r.Container{static size=900;frequencyAmplitudes=new Float32Array(256);audio;temporalAmplitudes=new Float32Array(256);graphics=new r.Graphics;index_change=5;bar_length=600;bars_per_visualiser=200;visualiser_rounds=5;decay_per_millisecond=.0024;time_between_updates=50;amplitude_dead_zone=1/this.bar_length;indexOffset=0;firstDraw=!0;set alpha(e){super.alpha=.2*e}get alpha(){return 5*super.alpha}constructor(){super(),this.alpha=1}start(){this.graphics.blendMode="add",this.addChild(this.graphics),this.graphics.eventMode="none",this.eventMode="none",setInterval((()=>{this.updateAmplitudes()}),this.time_between_updates)}draw(e){if(this.firstDraw)for(let e=0;ethis.frequencyAmplitudes[e]&&(this.frequencyAmplitudes[e]=i)}this.indexOffset=(this.indexOffset+this.index_change)%this.bars_per_visualiser}}t.LogoVisualizer=c},8211:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MenuLogoVisualizer=void 0;const n=i(9611);class s extends n.LogoVisualizer{draw(e){super.draw(e)}}t.MenuLogoVisualizer=s},49323:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LoadAnim=void 0;const a=o(i(58687)),r=o(i(29172)),l=i(92915);class u extends a.Container{bg;arc;arcContainer;animInterval;container;bgContainer;bgRotation=0;constructor(e,t){super(),this.pivot.set(.5,.5),this.container=new a.Container,this.container.alpha=0,this.rotation=2.5*Math.PI,this.bgContainer=new a.Container,this.bg=new a.Graphics,this.bg.roundRect(-50,-50,100,100,25),this.bg.fill(e),this.arcContainer=new a.Container,this.arc=new a.Graphics,this.arc.arc(0,0,27,Math.PI+.26,2.92*Math.PI),this.arc.stroke({width:8,color:t,cap:"round"}),this.arc.scale.set(-1,1),this.container.scale.set(.5,.5),this.bgContainer.addChild(this.bg),this.arcContainer.addChild(this.arc),this.bgContainer.addChild(this.arcContainer),this.container.addChild(this.bgContainer),this.addChild(this.container),l.Ease.getEase(this.container).ScaleTo(1,400,r.Easing.Quadratic.InOut).FadeIn(400,r.Easing.Quadratic.InOut),this.doAnims(),this.animInterval=setInterval((()=>{this.doAnims()}),800)}doAnims(){this.bgRotation+=90,l.Ease.getEase(this.bgContainer).createTween({value:this.bgContainer.angle},{value:this.bgRotation},!0,"angle",600,r.Easing.Quadratic.InOut)}getWidth(){return 100*this.scale.x}getHeight(){return 100*this.scale.y}draw(e){this.arcContainer.angle+=3*e.deltaTime}destroy(e){l.Ease.getEase(this.container).FadeOut(400,r.Easing.Quadratic.InOut).ScaleTo(.5,400,r.Easing.Quadratic.InOut),setTimeout((()=>{clearInterval(this.animInterval),super.destroy(e)}),400)}}t.LoadAnim=u},70723:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ButtonSystem=void 0;const a=o(i(58687)),r=o(i(29172)),l=i(92915),u=i(84283),c=i(57853);class d extends a.Container{menuBG=new a.Graphics;isOpened=!1;logo;state=h.Initial;logoTrackingContainer=new c.LogoTrackingContainer;menuHeight=150;get State(){return this.state}set State(e){if(this.state==e)return;const t=this.state;this.state=e,this.updateLogoState(t),console.log(`${this.constructor.name}'s state changed from ${t} to ${e}`)}updateLogoState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.Initial;switch(this.state){case h.Exit:case h.Initial:this.Close();break;case h.TopLevel:case h.Play:switch(e){case h.TopLevel:break;case h.Initial:this.Open(),l.Ease.getEase(this.logo).ClearEasings().ScaleTo(.5*u.Screen.getScaleBasedOffScreenSize(),200,r.Easing.Linear.In);break;default:this.Open(),l.Ease.getEase(this.logo).ClearEasings().ScaleTo(.5*u.Screen.getScaleBasedOffScreenSize(),200,r.Easing.Quintic.Out)}}}constructor(e){super(),this.logo=e,this.drawMenuBG(),this.scale.y=0,this.alpha=0,this.addChild(this.menuBG),this.addChild(this.logoTrackingContainer),this.logo.Action=()=>this.onOsuLogo()}drawMenuBG(){this.menuBG.rect(0,u.Screen.getScaleBasedOffScreenSize()*(-this.menuHeight/2),1,u.Screen.getScaleBasedOffScreenSize()*this.menuHeight),this.menuBG.fill({color:"rgb(50,50,50)"})}onOsuLogo(){switch(this.state){default:return!1;case h.Initial:return this.State=h.TopLevel,!0;case h.TopLevel:case h.Play:case h.Edit:return!1}}Open(){setTimeout((()=>{this.isOpened=!0,l.Ease.getEase(this).ScaleTo(1,400,r.Easing.Quintic.Out).FadeIn(400,r.Easing.Quintic.Out)}),150)}Close(){this.isOpened=!1,l.Ease.getEase(this).ClearEasings().ScaleTo({x:1,y:0},300,r.Easing.Sinusoidal.In).FadeOut(300,r.Easing.Sinusoidal.In)}isOpen(){return this.isOpened}onResize(){this.menuBG.clear(),this.drawMenuBG(),this.position.set(0,window.innerHeight/2),this.menuBG.width=window.innerWidth}}var h;t.ButtonSystem=d,function(e){e.Exit="Exit",e.Initial="Initial",e.TopLevel="TopLevel",e.Play="Play",e.Edit="Edit",e.EnteringMode="EnteringMode"}(h||(h={}))},57853:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LogoTrackingContainer=void 0;const a=o(i(58687)),r=o(i(29172));class l extends a.Container{Logo=null;easing;startPosition=null;startTime=null;duration;visual_box_size=72;StartTracking(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.Easing.Linear.None;if(e.IsTracking&&null==this.Logo)throw new Error("Cannot track an instance of OsuLogo to multiple LogoTrackingContainers");this.Logo!=e&&null!=this.Logo&&(this.Logo.IsTracking=!1),this.Logo=e,this.Logo.IsTracking=!0,this.duration=t,this.easing=i,this.startTime=null,this.startPosition=null}StopTracking(){null!=this.Logo&&(this.Logo.IsTracking=!1,this.Logo=null)}ComputeLogoTrackingPosition(){let e=this.Logo.position;return e.x=window.innerWidth/3,e}Update(){this.Logo}}t.LogoTrackingContainer=l},73703:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OsuLogo=void 0;const a=o(i(58687)),r=i(44961),l=o(i(29172)),u=i(92915),c=i(20825),d=i(12235),h=i(8211),g=i(9611),f=i(22331),p=i(5825);class m extends a.Container{outline;visualizer=new h.MenuLogoVisualizer;triangles=new r.Triangles;flash;logoContainer=new a.Container;logoBounceContainer=new a.Container;logoBeatContainer=new a.Container;logoAmplitudeContainer=new a.Container;logoHoverContainer=new a.Container;rippleContainer=new a.Container;ripple;defaultVisualizerAlpha=.5;early_activation=60;timeElapsedSinceLastBeat=0;timeUntilNextBeat=0;lastTimeElapasedSinceLastBeat=0;selectSample=d.Loader.GetAudio("mainMenu.osuLogo.select");backToLogoSample=d.Loader.GetAudio("mainMenu.osuLogo.backToLogo");isMouseDown=!1;mouseDownPosition={x:0,y:0};Action=null;IsTracking=!1;get SizeForFlow(){return this.outline.width*this.logoBounceContainer.scale.x*this.logoHoverContainer.scale.x}constructor(){super(),this.visualizer.start(),this.outline=a.Sprite.from("mainMenu.logoOutline"),this.outline.anchor.set(.5,.5);let e=.7;this.visualizer.scale.set(e),this.visualizer.pivot.set(g.LogoVisualizer.size/2,g.LogoVisualizer.size/2),this.visualizer.alpha=this.defaultVisualizerAlpha;let t=new a.Graphics;t.circle(0,0,450),t.fill({color:"white"}),t.scale=e,this.flash=a.Sprite.from("mainMenu.logoMask"),this.flash.anchor.set(.5,.5),this.flash.scale=e,this.flash.blendMode="add",this.flash.alpha=0,this.triangles.flash.anchor.set(.5,.5),this.triangles.flash.scale=e,this.outline.scale.set(e),this.triangles.scale.set(e),this.triangles.position.set(-this.outline.width/2,-this.outline.height/2),this.triangles.mask=t,this.ripple=a.Sprite.from("mainMenu.logoMask"),this.ripple.anchor.set(.5,.5),this.ripple.scale=e,this.ripple.alpha=0,this.ripple.blendMode="add",this.rippleContainer.addChild(this.ripple),this.logoContainer.addChild(this.visualizer),this.logoContainer.addChild(this.triangles),this.logoContainer.addChild(this.triangles.flash),this.logoContainer.addChild(t),this.logoContainer.addChild(this.flash),this.logoContainer.addChild(this.outline),this.logoContainer.hitArea=new a.Circle(0,0,336),this.logoContainer.eventMode="static",this.logoContainer.onmouseenter=this._onmouseenter,this.logoContainer.onmouseleave=this._onmouseleave,this.logoContainer.onmousedown=this._onmousedown,this.logoContainer.onclick=this._onclick,this.logoBeatContainer.addChild(this.logoContainer),this.logoAmplitudeContainer.addChild(this.logoBeatContainer),this.logoBounceContainer.addChild(this.rippleContainer),this.logoBounceContainer.addChild(this.logoAmplitudeContainer),this.logoHoverContainer.addChild(this.logoBounceContainer),this.addChild(this.logoHoverContainer),c.Main.app.stage.addEventListener("mouseup",(e=>{this._onmouseup(e)}))}_onmouseenter=e=>{u.Ease.getEase(this.logoHoverContainer).ScaleTo(1.1,500,l.Easing.Elastic.Out)};_onmouseleave=e=>{u.Ease.getEase(this.logoHoverContainer).ScaleTo(1,500,l.Easing.Elastic.Out)};_onmousedown=e=>{this.isMouseDown=!0,u.Ease.getEase(this.logoBounceContainer).ClearEasings().ScaleTo(.9,1e3,l.Easing.Sinusoidal.Out),this.mouseDownPosition={x:c.Main.mousePos.x,y:c.Main.mousePos.y}};_onclick=e=>{this.flash.alpha=.4,u.Ease.getEase(this.flash).ClearEasings().FadeOut(1500,l.Easing.Exponential.Out),this.Action&&this.Action()&&c.Main.AudioEngine.PlayEffect(d.Loader.GetAudio("mainMenu.osuLogo.select"))};_onmouseup=e=>{this.isMouseDown=!1,u.Ease.getEase(this.logoBounceContainer).ClearEasings().ScaleTo(1,500,l.Easing.Elastic.Out).TransformTo({x:0,y:0},800,l.Easing.Elastic.Out)};draw(e){this.visualizer.draw(e),this.triangles.draw(e);let t=c.Main.AudioEngine.GetCurrentPlayingMusic(),i=t.GetCurrentTime(),n=t.beatmap.TimingPoints.GetCurrentUninheritedTimingPoint(i);if(this.timeUntilNextBeat=(n.time-i)%n.beatLength,this.timeUntilNextBeat<=0&&(this.timeUntilNextBeat+=n.beatLength),this.timeElapsedSinceLastBeat=n.beatLength-this.timeUntilNextBeat,c.Main.AudioEngine.useSilentMusic)this.logoAmplitudeContainer.scale=1,this.triangles.Velocity=p.MathUtil.Damp(this.triangles.Velocity,.5,.9,e.deltaMS);else{let i=t.GetMaximumAudioLevel();this.logoAmplitudeContainer.scale.set(p.MathUtil.Damp(this.logoAmplitudeContainer.scale.x,1-.04*Math.max(0,i-.4),.9,e.deltaMS)),this.triangles.Velocity=p.MathUtil.Damp(this.triangles.Velocity,.5*(n.effects==f.Effect.KiaiTime?4:2),.995,e.deltaMS)}if(this.lastTimeElapasedSinceLastBeat>this.timeElapsedSinceLastBeat&&this.onNewBeat(),this.lastTimeElapasedSinceLastBeat=this.timeElapsedSinceLastBeat,this.isMouseDown){let e={x:c.Main.mousePos.x-this.mouseDownPosition.x,y:c.Main.mousePos.y-this.mouseDownPosition.y},t=Math.sqrt(e.x*e.x+e.y*e.y);e.x*=t<=0?0:Math.pow(t,.6)/t,e.y*=t<=0?0:Math.pow(t,.6)/t,this.logoBounceContainer.x=e.x,this.logoBounceContainer.y=e.y}}onNewBeat(){let e=c.Main.AudioEngine.GetCurrentPlayingMusic(),t=e.GetCurrentTime(),i=e.beatmap.TimingPoints.GetCurrentUninheritedTimingPoint(t).beatLength,n=e.beatmap.TimingPoints.GetCurrentTimingPoints(t)[0],s=c.Main.AudioEngine.useSilentMusic?0:e.GetMaximumAudioLevel(),o=Math.min(1,.2+s);u.Ease.getEase(this.logoBeatContainer).ScaleTo(1-.02*o,this.early_activation,l.Easing.Linear.None).Then().ScaleTo(1,2*i,l.Easing.Quintic.Out),this.rippleContainer.scale=1.02,u.Ease.getEase(this.rippleContainer).ClearEasings().ScaleTo(1.02*(1+.04*o),i,l.Easing.Quintic.Out),this.ripple.alpha=.15*o,u.Ease.getEase(this.ripple).ClearEasings().FadeOut(i,l.Easing.Quintic.Out),n.effects==f.Effect.KiaiTime&&(u.Ease.getEase(this.triangles.flash).ClearEasings().FadeTo(.2*o,this.early_activation,l.Easing.Linear.None).Then().FadeTo(0,i,l.Easing.Linear.None),u.Ease.getEase(this.visualizer).ClearEasings().FadeTo(1.8*this.defaultVisualizerAlpha*o,this.early_activation,l.Easing.Linear.None).Then().FadeTo(this.defaultVisualizerAlpha,i,l.Easing.Linear.None)),setTimeout((()=>{this.triangles.Velocity+=o*(n.effects==f.Effect.KiaiTime?6:3)}),60)}}t.OsuLogo=m},44961:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Triangles=void 0;const r=o(i(58687)),l=i(20825),u=a(i(46404)),c=a(i(58689)),d=a(i(61630));class h extends r.Container{flash;Velocity=1;bgGradient;triangles=[];graphics=new r.Graphics;timeSinceLastSpawn=0;instancePositionBuffer;totalTriangles=15;constructor(){super();let e=[16737963,13390473];this.bgGradient=new r.FillGradient(0,0,0,1024),e.forEach(((t,i)=>{const n=i/e.length;this.bgGradient.addColorStop(n,t)}));for(let e=0;e{this.mouseButtonClicked=e.button,this.visible&&(this.posMouseDown={x:r.Main.mousePos.x,y:r.Main.mousePos.y},this.mouseIsDown=!0,this.dragRotationState=f.DragStarted,d.Ease.getEase(this.animContainer).ClearEasings().ScaleTo(.9,800,h.Easing.Quintic.Out),d.Ease.getEase(this.mouseCursorAdditive).ClearEasings().FadeIn(800,h.Easing.Quintic.Out),r.Main.AudioEngine.PlayEffect(this.cursorTapSample))})),r.Main.app.stage.addEventListener("mouseup",(e=>{this.visible&&e.button==this.mouseButtonClicked&&(this.mouseIsDown=!1,d.Ease.getEase(this.animContainer).ClearEasings().ScaleTo(1,500,h.Easing.Elastic.Out),d.Ease.getEase(this.mouseCursorAdditive).ClearEasings().FadeOut(500,h.Easing.Quintic.Out),this.dragRotationState!=f.NotDragging&&(this.dragRotationState==f.Rotating&&d.Ease.getEase(this.animRotationContainer).ClearEasings().createTween({value:this.animRotationContainer.angle},{value:0},!0,"angle",800*(.5+Math.abs(this.animRotationContainer.angle/960)),(e=>Math.pow(2,-10*e)*Math.sin((.25*e-this.elastic_const2)*this.elastic_const)+1-this.elastic_offset_quarter*e)),this.dragRotationState=f.NotDragging),r.Main.AudioEngine.PlayEffect(this.cursorTapSample,.8))}))}PopIn(){d.Ease.getEase(this.animRotationContainer).ClearEasings(),this.visible=!0,d.Ease.getEase(this.mouseHideContainer).ClearEasings().FadeIn(250,h.Easing.Quintic.Out).ScaleTo(1,400,h.Easing.Quintic.Out),this.dragRotationState=f.NotDragging}PopOut(){d.Ease.getEase(this.mouseHideContainer).ClearEasings().FadeOut(250,h.Easing.Quintic.Out).ScaleTo(.6,250,h.Easing.Quintic.Out),d.Ease.getEase(this.animRotationContainer).ClearEasings().createTween({value:this.animRotationContainer.angle},{value:0},!0,"angle",400,h.Easing.Quintic.Out),this.dragRotationState=f.NotDragging}updateMouse(){if(this.mouseContainer.scale.set(.07*c.Screen.getScaleBasedOffScreenSize()),this.position.set(r.Main.mousePos.x,r.Main.mousePos.y),this.dragRotationState!=f.NotDragging&&this.visible){let e=Math.sqrt((2^Math.abs(this.posMouseDown.x-r.Main.mousePos.x))+(2^Math.abs(this.posMouseDown.y-r.Main.mousePos.y)));if(this.dragRotationState==f.DragStarted&&e>15&&(this.dragRotationState=f.Rotating,this.lastDragRotationState!=this.dragRotationState&&(this.posMouseDown={x:r.Main.mousePos.x,y:r.Main.mousePos.y})),this.dragRotationState==f.Rotating&&e>0){let e=r.Main.mousePos.x-this.posMouseDown.x,t=r.Main.mousePos.y-this.posMouseDown.y,i=u.MathUtil.RadiansToDegrees(Math.atan2(-e,t))+24.3,n=(i-this.animRotationContainer.angle)%360;n<-180&&(n+=360),n>180&&(n-=360),i=this.animRotationContainer.angle+n,this.animRotationContainer.angle=i,d.Ease.getEase(this.animRotationContainer).createTween({value:this.animRotationContainer.angle},{value:i},!0,"angle",120,h.Easing.Quintic.Out)}}this.lastDragRotationState=this.dragRotationState}}var f;t.MenuCursor=g,function(e){e[e.NotDragging=0]="NotDragging",e[e.DragStarted=1]="DragStarted",e[e.Rotating=2]="Rotating"}(f||(f={}))},67991:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BackgroundContainer=t.Background=void 0;const a=o(i(58687)),r=i(92915),l=o(i(29172));class u extends a.Sprite{static fadeOutDuration=800;destroying=!1;constructor(e){super(),this.texture=e,this.visible=!1,this.anchor.set(.5,.5)}show(){this.visible=!0}destroy(e){this.destroying=!0,r.Ease.getEase(this).FadeOut(u.fadeOutDuration,l.Easing.Linear.None).Then((()=>{this.visible=!1,super.destroy(e),this.destroying=!1})),this.zIndex=1}}t.Background=u;class c extends a.Container{constructor(){super(),this.visible=!1}show(){this.visible=!0;for(let e=0;e{super.destroy(e)}),u.fadeOutDuration),this.zIndex=1}}t.BackgroundContainer=c},36721:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RandomBackground=void 0;const a=o(i(58687)),r=i(12235),l=i(84283),u=i(20825),c=i(67991),d=i(15041);class h extends l.Screen{bgContainer=new a.Container;parallaxMultiplier=60;start(){this.bgContainer.pivot.set(.5,.5),this.bgContainer.position.set((u.Main.mousePos.x-this.getScreenWidth()/2)/this.parallaxMultiplier,(u.Main.mousePos.y-this.getScreenHeight()/2)/this.parallaxMultiplier),this.addChild(this.bgContainer),this.newRandomBG(),u.Main.AudioEngine.addMusicChangeEventListener((e=>{let t=e.beatmap.Events.Events.find((e=>{if(e.eventType==d.EventTypes.BACKGROUND)return e})),i=e.beatmap.Events.Events.find((e=>{if(e.eventType==d.EventTypes.VIDEO)return e})),n=new c.BackgroundContainer;if(t&&t.texture&&n.addChild(new c.Background(t.texture)),i&&i.texture){let e=i.texture.source.resource,t=new c.Background(i.texture);n.addChild(t),i.texture.source.resource.startPromise=new Promise((t=>{i.startTime>0?setTimeout((()=>{e.play(),t()}),i.startTime):(e.currentTime=Math.abs(i.startTime)/1e3,e.play(),t())})),e.onended=()=>{t.destroy()}}(t||i)&&this.setBGContainer(n),t||i||this.newRandomBG()})),this.zIndex=-100}setBG(e){let t=new c.Background(e);if(this.bgContainer.addChild(t),t.show(),0==this.bgContainer.children?.length);else{this.bgContainer.children[0].destroy()}this.onResize()}setBGContainer(e){if(this.bgContainer.addChild(e),e.show(),0==this.bgContainer.children?.length);else{this.bgContainer.children[0].destroy()}this.onResize()}newRandomBG(){let e=r.Loader.seasonalBackgroundsNum>0,t=(i=1,n=e?r.Loader.seasonalBackgroundsNum:r.Loader.defaultBackgroundsNum,Math.round(Math.random()*(n-i)+i));var i,n;this.setBG(a.Texture.from((e?"seasonal_bg":"default_bg")+t))}draw(e){this.bgContainer.position.set((u.Main.mousePos.x-this.getScreenWidth()/2)/this.parallaxMultiplier,(u.Main.mousePos.y-this.getScreenHeight()/2)/this.parallaxMultiplier)}onClose(){return Promise.resolve(this)}onResize(){this.bgContainer.children.forEach((e=>{e instanceof c.BackgroundContainer&&e.children?.forEach((e=>{e instanceof c.Background&&this.resizeSprite(e)})),e instanceof c.Background&&this.resizeSprite(e)}))}resizeSprite(e){let t,i=e.texture.width,n=e.texture.height;t=window.innerWidth>window.innerHeight?window.innerWidth/i:window.innerHeight/n,n*t{i.id==e&&(t=i.data)})),!t)throw new Error("Asset not found!");return t}static GetString(e){let t;if(this.loadedList.forEach((i=>{i.id==e&&(t=i.dataString)})),!t)throw new Error("Asset not found or is not a string!");return t}static GetAudio(e){let t;if(this.loadedList.forEach((i=>{i.id==e&&(t=i.dataAudio)})),!t)throw new Error("Asset not found or was not marked as audio during loading!");return t}static addBackgrounds(){return new Promise((e=>{for(let e=1;ee.json())).then((t=>{t.backgrounds.forEach(((e,t)=>{this.loadList.push({id:"seasonal_bg"+(t+1),url:"https://corsproxy.io/?"+encodeURIComponent(e.url),pixiBundleName:"textures",loadParser:"loadTextures"}),this.seasonalBackgroundsNum=t+1})),e()})).catch((t=>{console.warn("Could not fetch seasonal backgrounds.",t),e()}))}))}static Load(e){return this.addToLoadList(),new Promise((t=>{this.addBackgrounds().then((()=>{let i=[],n=[],s=[],o=0,r=0;this.loadList.forEach((e=>{e.pixiBundleName?n.push(e):i.push(e)})),n.forEach((e=>{let t=!1;s.forEach((i=>{i.length>0&&i[0].pixiBundleName==e.pixiBundleName&&(i.push(e),t=!0)})),t||s.push([e])}));const l=e=>{e?r++:o++,r+o>=this.loadList.length&&t()};i.forEach((t=>{fetch(t.url).then((e=>e.blob())).then((i=>{t.isText||t.isAudio?t.isText?i.text().then((e=>{l(),this.loadedList.push({id:t.id,data:i,dataString:e})})):t.isAudio&&i.arrayBuffer().then((t=>e.decodeAudioData(t))).then((e=>{l(),this.loadedList.push({id:t.id,data:i,dataAudio:e})})):(l(),this.loadedList.push({id:t.id,data:i}))})).catch((e=>{l(!0),console.warn("Asset '"+t.id+"' failed to load: "+e)}))})),s.forEach((e=>{if(e.length>0){if(!e[0].pixiBundleName)throw new Error("wtf????");let t=[];e.forEach((e=>{e.loadParser?t.push({alias:e.id,src:e.url,loadParser:e.loadParser}):t.push({alias:e.id,src:e.url})})),a.Assets.addBundle(e[0].pixiBundleName,t),a.Assets.loadBundle(e[0].pixiBundleName).then((()=>{e.forEach((()=>{l()}))}))}}))}))}))}}},25373:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.InteractScreen=void 0;const a=i(84283),r=o(i(58687)),l=i(20825),u=i(94433),c=o(i(29172)),d=i(92915);class h extends a.Screen{text;text2;textContainer=new r.Container;textContainerContainer=new r.Container;introTrack;clickSound;clickArea=new r.Graphics;constructor(e,t){super(),this.introTrack=e,this.clickSound=t,this.text=new r.Text({text:"Click anywhere to play!",style:{fontFamily:"TorusRegular",fontSize:36,fill:"white"}}),this.text2=new r.Text({text:"(this is for enabling audio because it's required by web-browsers\n to have interaction on this webpage before playing audio.)",style:{fontFamily:"TorusRegular",fontSize:26,fill:"gray",align:"center"}})}start(){this.text.anchor.set(.5,.5),this.text2.anchor.set(.5,.5),this.text2.position.set(0,this.text.height+15),this.textContainer.addChild(this.text),this.textContainer.addChild(this.text2),this.textContainer.scale.set(.5),this.textContainer.alpha=0,this.textContainerContainer.addChild(this.textContainer),this.textContainerContainer.scale=a.Screen.getScaleBasedOffScreenSize(),this.textContainerContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.addChild(this.textContainerContainer),this.clickArea.rect(0,0,1,1),this.clickArea.fill("rgba(0,0,0,0)"),this.clickArea.width=this.getScreenWidth(),this.clickArea.height=this.getScreenHeight(),this.clickArea.position.set(0,0),this.addChild(this.clickArea),this.clickArea.eventMode="static",this.clickArea.cursor="pointer";const e=()=>{this.clickArea.eventMode="none",l.Main.AudioEngine.PlayEffect(this.clickSound),l.Main.switchScreen(new u.IntroScreen(this.introTrack)),document.body.style.cursor="none",l.Main.pointerLock(),l.Main.lockKeyboard()};this.clickArea.onclick=()=>{e()},this.clickArea.ontap=()=>{e()},d.Ease.getEase(this.textContainer).FadeIn(400,c.Easing.Quadratic.Out).ScaleTo(1,400,c.Easing.Quadratic.Out)}onClose(){return new Promise((e=>{d.Ease.getEase(this.textContainer).FadeOut(200,c.Easing.Quadratic.Out).ScaleTo(.5,200,c.Easing.Quadratic.InOut),setTimeout((()=>{e(this)}),200)}))}draw(e){}onResize(){this.textContainerContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.clickArea.width=this.getScreenWidth(),this.clickArea.height=this.getScreenHeight(),this.clickArea.position.set(0,0),this.textContainerContainer.scale=a.Screen.getScaleBasedOffScreenSize()}}t.InteractScreen=h},88662:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.GlitchingTriangles=void 0;const a=o(i(58687)),r=i(92915),l=o(i(29172));class u extends a.Container{constructor(e){super();let t=new a.Graphics,i=n(.2,1.2);function n(e,t){return Math.random()*(t-e)+e}t.moveTo(0,0),t.lineTo(-50*i,100*i),t.lineTo(50*i,100*i),t.lineTo(0,0),Math.random()<.5?t.fill("white"):t.stroke({color:"white",width:1});let s=n(e.x1,e.x2),o=n(e.y1,e.y2);t.position.set(s,o),r.Ease.getEase(t,!0).FadeOut(200,l.Easing.Linear.None),setTimeout((()=>{this.destroy()}),200),this.addChild(t)}}t.GlitchingTriangles=u},94433:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.IntroScreen=void 0;const a=i(84283),r=o(i(58687)),l=i(53931),u=i(20825),c=i(88662),d=i(58940),h=i(55402),g=i(9752),f=o(i(29172)),p=i(92915),m=i(5168),v=i(94461);class b extends a.Screen{introTrackUrl;doTextSpacingAnim=!1;triangles=new r.Container;ruleSetContainer=new r.Container;ruleSetList=new v.CenteredList({});flash=new r.Graphics;logoContainerContainer=new r.Container;logoContainer=new r.Container;lazerLogo=new h.LazerLogo;flashed=!1;standard=r.Sprite.from("icon_ruleset_std");taiko=r.Sprite.from("icon_ruleset_taiko");ctb=r.Sprite.from("icon_ruleset_ctb");mania=r.Sprite.from("icon_ruleset_mania");bg=new r.Graphics;completionPromise;welcomeText=new r.Text({text:"",style:{fontFamily:"TorusThin",fontSize:42,fill:"white",letterSpacing:5}});constructor(e){super(),this.introTrackUrl=URL.createObjectURL(e),this.bg.rect(0,0,1,1),this.bg.fill("black")}start(){this.bg.width=window.innerWidth,this.bg.height=window.innerHeight,this.bg.x=0,this.bg.y=0,this.addChild(this.bg),this.lazerLogo.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.logoContainer.addChild(this.lazerLogo),this.logoContainer.scale.set(1.2),this.logoContainerContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.logoContainerContainer.pivot.set(.5,.5),this.logoContainerContainer.addChild(this.logoContainer),this.logoContainerContainer.alpha=0,this.addChild(this.logoContainerContainer),this.flash.rect(0,0,1,1),this.flash.fill("white"),this.flash.position.set(0,0),this.flash.width=this.getScreenWidth(),this.flash.height=this.getScreenHeight(),this.flash.blendMode="add",this.welcomeText.anchor.set(.5,.5),this.welcomeText.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),(async()=>{const{entries:e}=await(0,l.unzip)(this.introTrackUrl);for(const[t,i]of Object.entries(e))if(t.endsWith(".osu")){i.text().then((async t=>{let i=g.BeatmapParser.Parse(t);for(const[t,n]of Object.entries(e)){let e=await n.blob();i.files.set(t,e)}await g.BeatmapParser.LoadFiles(i);let n=i.General.audioFile;if(n){let e=URL.createObjectURL(n);setTimeout((()=>{u.Main.AudioEngine.PlayMusicImmediately(e,i,(()=>{this.afterAudioPlay()}))}),200)}console.log(i)}));break}})()}afterAudioPlay(){this.completionPromise=new Promise((e=>{let t;this.welcomeText.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.addChild(this.welcomeText),setTimeout((()=>{this.welcomeText.text="wel",this.onResize()}),200),setTimeout((()=>{this.welcomeText.text="welcome",this.onResize()}),400),setTimeout((()=>{this.welcomeText.text="welcome to",this.onResize()}),700),this.triangles.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.triangles.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.addChild(this.triangles),setTimeout((()=>{this.welcomeText.text="welcome to kosu!",this.doTextSpacingAnim=!0,t=setInterval((()=>{let e=new c.GlitchingTriangles({x1:-this.welcomeText.width/2-100,x2:this.welcomeText.width/2+100,y1:-this.welcomeText.height/2-150,y2:this.welcomeText.height/2+100});this.triangles.addChild(e)}),30),this.onResize()}),900),this.standard.scale=.5*a.Screen.getScaleBasedOffScreenSize(),this.ctb.scale=.5*a.Screen.getScaleBasedOffScreenSize(),this.mania.scale=.5*a.Screen.getScaleBasedOffScreenSize(),this.taiko.scale=.5*a.Screen.getScaleBasedOffScreenSize(),this.ruleSetList.addChild(this.standard),this.ruleSetList.addChild(this.taiko),this.ruleSetList.addChild(this.ctb),this.ruleSetList.addChild(this.mania),this.ruleSetList.padding=0,this.ruleSetList.elementsMargin=200*a.Screen.getScaleBasedOffScreenSize(),this.ruleSetList.type="horizontal",this.ruleSetList.scale=1,this.ruleSetContainer.addChild(this.ruleSetList),setTimeout((()=>{this.doTextSpacingAnim=!1,this.onResize(),clearInterval(t),this.welcomeText.destroy(),this.triangles.destroy(),this.ruleSetContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.addChild(this.ruleSetContainer),this.ruleSetList.elementsMargin=200*a.Screen.getScaleBasedOffScreenSize(),p.Ease.getEase(this.ruleSetContainer).ScaleTo(.8,1e3,f.Easing.Linear.None)}),1450),setTimeout((()=>{this.ruleSetList.elementsMargin=30*a.Screen.getScaleBasedOffScreenSize(),this.ruleSetList.scale=2,m.UIUtils.centerPivotOfList(this.ruleSetList)}),1650),setTimeout((()=>{this.ruleSetList.elementsMargin=10*a.Screen.getScaleBasedOffScreenSize(),this.ruleSetList.scale=4,p.Ease.getEase(this.ruleSetContainer).ScaleTo(1.3,1e3,f.Easing.Linear.None)}),1850),setTimeout((()=>{this.ruleSetContainer.destroy(),this.lazerLogo.start(),this.logoContainerContainer.alpha=1,this.logoContainerContainer.scale.set(1.2),p.Ease.getEase(this.logoContainerContainer).ScaleTo(1,920,f.Easing.Quadratic.In),setTimeout((()=>{p.Ease.getEase(this.logoContainer).ScaleTo(1.2-.8,276,f.Easing.Quintic.In)}),644)}),2080),setTimeout((()=>{this.addChild(this.flash),this.bg.destroy(),this.flash.eventMode="none",this.flashed=!0,this.logoContainerContainer.visible=!1,p.Ease.getEase(this.flash).FadeOut(1e3,f.Easing.Quadratic.Out).Then((()=>{e()})),u.Main.cursor.PopIn()}),3e3)})),u.Main.switchScreen(new d.MainMenu)}draw(e){this.doTextSpacingAnim&&(this.welcomeText.style.letterSpacing+=.15*e.deltaTime,this.onResize())}onClose(){return new Promise((e=>{this.completionPromise.then((()=>{e(this)}))}))}onResize(){this.bg.destroyed||(this.bg.width=window.innerWidth,this.bg.height=window.innerHeight,this.bg.x=0,this.bg.y=0),this.welcomeText.destroyed||this.welcomeText.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.triangles.destroyed||(this.triangles.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.triangles.scale.set(a.Screen.getScaleBasedOffScreenSize())),this.ruleSetContainer.destroyed||this.ruleSetContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.flash.destroyed||(this.flash.position.set(0,0),this.flash.width=this.getScreenWidth(),this.flash.height=this.getScreenHeight()),this.logoContainerContainer.destroyed||this.logoContainerContainer.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.lazerLogo.destroyed||this.lazerLogo.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.welcomeText.destroyed||this.welcomeText.scale.set(a.Screen.getScaleBasedOffScreenSize()),this.standard.destroyed||this.standard.scale.set(.5*a.Screen.getScaleBasedOffScreenSize()),this.mania.destroyed||this.mania.scale.set(.5*a.Screen.getScaleBasedOffScreenSize()),this.ctb.destroyed||this.ctb.scale.set(.5*a.Screen.getScaleBasedOffScreenSize()),this.taiko.destroyed||this.taiko.scale.set(.5*a.Screen.getScaleBasedOffScreenSize()),this.ruleSetList.destroyed||this.ruleSetList.ReCenter()}}t.IntroScreen=b},55402:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LazerLogo=void 0;const a=o(i(58687)),r=i(87525),l=o(i(29172)),u=i(92915);class c extends a.Container{highlight;background;textureHighlight=a.Texture.from("intro_triangles_osuLogo_anim_highlight");textureBackground=a.Texture.from("intro_triangles_osuLogo_anim_background");constructor(){super(),this.highlight=new r.LogoAnimation(this.textureHighlight,new a.Color("white")),this.background=new r.LogoAnimation(this.textureBackground,new a.Color("rgb(128, 128, 128)")),this.addChild(this.highlight),this.addChild(this.background)}start(){let e=new a.Container;e.scale.set(0,0),u.Ease.getEase(e).ScaleTo(1,920,l.Easing.Linear.None).OnEach((()=>{this.highlight.setProgress(e.scale.x),this.background.setProgress(e.scale.x)}))}}t.LazerLogo=c},87525:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogoAnimation=void 0;const r=o(i(58687)),l=a(i(26045)),u=a(i(44160)),c=a(i(46110));class d extends r.Container{shader;texture;constructor(e,t){super(),this.texture=e,this.shader=r.Shader.from({gl:{vertex:l.default,fragment:u.default},gpu:{vertex:{entryPoint:"mainVert",source:c.default},fragment:{entryPoint:"mainFrag",source:c.default}},resources:{uTexture:this.texture.source,uSampler:this.texture.source.style,uProgress:{progress:{value:0,type:"f32"}}}});const i=new r.Geometry({attributes:{aPosition:[-this.texture.width/2,-this.texture.height/2,this.texture.width/2,-this.texture.height/2,this.texture.width/2,this.texture.width/2,-this.texture.width/2,this.texture.width/2],aUV:[0,0,1,0,1,1,0,1],aColor:[t.red,t.green,t.blue,t.alpha,t.red,t.green,t.blue,t.alpha,t.red,t.green,t.blue,t.alpha,t.red,t.green,t.blue,t.alpha]},indexBuffer:[0,1,2,0,2,3]}),n=new r.Mesh({geometry:i,shader:this.shader});this.addChild(n)}setProgress(e){this.shader.resources.uProgress.uniforms.progress=e}}t.LogoAnimation=d},76969:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.LoadScreen=void 0;const n=i(84283),s=i(49323);class o extends n.Screen{loadAnim=new s.LoadAnim("rgba(255,255,255,0.7)","black");start(){this.loadAnim.scale.set(.8*n.Screen.getScaleBasedOffScreenSize()),this.loadAnim.position.set(this.getScreenWidth()-this.loadAnim.getWidth()-15,this.getScreenHeight()-this.loadAnim.getHeight()-15),this.addChild(this.loadAnim)}draw(e){this.loadAnim?.draw(e)}onClose(){return new Promise((e=>{null!=this.loadAnim&&this.loadAnim.destroy(),setTimeout((()=>{e(this)}),400)}))}onResize(){this.loadAnim.position.set(this.getScreenWidth()-this.loadAnim.getWidth()-20,this.getScreenHeight()-this.loadAnim.getHeight()-20),this.loadAnim.scale.set(.8*n.Screen.getScaleBasedOffScreenSize())}}t.LoadScreen=o},58940:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MainMenu=void 0;const n=i(84283),s=i(36721),o=i(73703),a=i(70723);class r extends n.Screen{bg=new s.RandomBackground;osuCircle=new o.OsuLogo;menu=new a.ButtonSystem(this.osuCircle);start(){this.bg.start(),this.addChild(this.bg),this.osuCircle.scale=n.Screen.getScaleBasedOffScreenSize(),this.addChild(this.menu),this.menu.onResize(),this.addChild(this.osuCircle)}draw(e){this.bg.draw(e),this.osuCircle.draw(e)}onClose(){return new Promise((e=>{this.bg.onClose().then((()=>{e(this)}))}))}onResize(){this.osuCircle.position.set(this.getScreenWidth()/2,this.getScreenHeight()/2),this.bg.onResize(),this.menu.onResize(),this.osuCircle.scale=this.menu.isOpen()?.5*n.Screen.getScaleBasedOffScreenSize():n.Screen.getScaleBasedOffScreenSize()}}t.MainMenu=r},84283:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Screen=void 0;const a=o(i(58687)),r=i(58293),l=i(64681);class u extends a.Container{constructor(){super()}static getScaleBasedOffScreenSize(){const e=r.Settings.getSetting(l.UIScale).getValue();return(window.innerWidth/1920+window.innerHeight/1080)/2*e}getScreenWidth(){return window.innerWidth}getScreenHeight(){return window.innerHeight}}t.Screen=u},75341:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SettingsCategory=t.Setting=void 0;const n=i(58293);var s;t.Setting=class{info;constructor(e){this.info=e,n.Settings.register({setting:this,info:e})}onValueChanged(){}},function(e){e.General="General",e.Skin="Skin",e.Input="Input",e.UserInterface="User Interface",e.Gameplay="Gameplay",e.Rulesets="Rulesets",e.Audio="Audio",e.Graphics="Graphics",e.Online="Online",e.Maintenance="Maintenance",e.Debug="Debug"}(s||(t.SettingsCategory=s={}))},74975:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.DropdownSetting=void 0;const n=i(75341),s=i(58293);class o extends n.Setting{value;getValue(){if(!this.value)throw new Error("Value is undefined!");return this.value}getDefaultValue(){return this.defaultValue}setValue(e){this.list.find((t=>t.value==e.value&&t.displayName==e.displayName))?(this.value=e,s.Settings.save(),this.onValueChanged()):console.warn("The value provided to this DropDownSetting does not exist in the option list! Ignoring value provided.")}loadFromSaveValue(e){this.list.find((t=>t.value==e.value&&t.displayName==e.displayName))?(this.value=e,this.onValueChanged()):console.warn("The value provided to this DropDownSetting does not exist in the option list! Ignoring value provided.")}}t.DropdownSetting=o},78642:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeSetting=void 0;const n=i(75341),s=i(58293),o=i(5825);class a extends n.Setting{value=0;getValue(){return this.value}getDefaultValue(){return this.defaultValue}setValue(e){this.value=o.MathUtil.clamp(this.minValue,this.maxValue,e),s.Settings.save(),this.onValueChanged()}loadFromSaveValue(e){this.value=o.MathUtil.clamp(this.minValue,this.maxValue,e),this.onValueChanged()}}t.RangeSetting=a},58293:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Settings=void 0;const n=i(64681),s=i(44256),o=i(59029);t.Settings=class{static settingsList=[];static registerAll(){new n.UIScale,new s.Renderer,new o.MouseSensitivity}static load(){let e=window.localStorage.getItem("settings");if(null==e)return;let t=this.getList();try{JSON.parse(e).forEach((e=>{let i=!1;try{e.value||(console.warn("Setting '"+JSON.stringify(e)+"' may be corrupted, skipping!"),i=!0),e.info?(e.info.name||(console.warn("Setting '"+JSON.stringify(e)+"' may be corrupted, skipping!"),i=!0),e.info.category||(console.warn("Setting '"+JSON.stringify(e)+"' may be corrupted, skipping!"),i=!0)):(console.warn("Setting '"+JSON.stringify(e)+"' may be corrupted, skipping!"),i=!0)}catch(e){console.warn("Something went wrong when validating saved settings!",e),console.warn("The setting may be REALLY corrupted, skipping!"),i=!0}if(!i){let i=t.filter((t=>t.info.name==e.info.name&&t.info.category==e.info.category))[0];i?i.setting.loadFromSaveValue(e.value):console.warn("Could not find setting object '"+e.info.name+"', maybe it has been removed in this version of kosu?, skipping setting")}}))}catch(e){console.warn("Failed to load settings! Resetting Settings due to corrupted save!",e),this.reset()}}static save(){let e=this.getList(),t=[];e.forEach((e=>{e.setting.getValue()!=e.setting.getDefaultValue()&&t.push({info:e.info,value:e.setting.getValue()})})),window.localStorage.setItem("settings",JSON.stringify(t))}static reset(){console.warn("Resetting Settings!"),window.localStorage.removeItem("settings")}static register(e){this.settingsList.push(e)}static getSetting(e){return this.settingsList.filter((t=>t.setting instanceof e))[0].setting}static getSettingData(e){return this.settingsList.filter((t=>t.setting instanceof e))[0]}static getList(){return this.settingsList}}},44256:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;const n=i(75341),s=i(74975);class o extends s.DropdownSetting{list=[];webglOption={displayName:"WebGL",value:"webgl"};webGpuOption={displayName:"WebGPU",value:"webgpu"};defaultValue=this.webglOption;constructor(){super({name:"Renderer",category:n.SettingsCategory.Graphics}),this.list.push(this.webglOption,this.webGpuOption),this.value=this.defaultValue}}t.Renderer=o},64681:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.UIScale=void 0;const n=i(78642),s=i(75341);class o extends n.RangeSetting{maxValue=1.6;minValue=.8;increment=.1;defaultValue=1;constructor(){super({name:"UI scaling",category:s.SettingsCategory.Graphics}),this.value=this.defaultValue}}t.UIScale=o},59029:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MouseSensitivity=void 0;const n=i(78642),s=i(75341),o=i(58687);class a extends n.RangeSetting{defaultValue=1;increment=.01;maxValue=10;minValue=.1;constructor(){super({name:"Sensitivity",category:s.SettingsCategory.Input}),this.value=this.defaultValue,this.onValueChanged()}onValueChanged(){o.EventSystem.cursorSensitivity=this.getValue()}}t.MouseSensitivity=a},17898:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.BeatmapData=void 0;const n=i(85932),s=i(20352),o=i(32007),a=i(78878),r=i(54611),l=i(6386),u=i(43354);t.BeatmapData=class{files=new Map;General=new n.GeneralData;Editor=new s.EditorData;Metadata=new o.Metadata;Difficulty=new a.DifficultyData;Events=new r.EventsData;TimingPoints=new l.TimingPointsData;Colors=new u.ColorsData}},43354:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorsData=void 0;t.ColorsData=class{Colors=[]}},78878:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DifficultyData=void 0;t.DifficultyData=class{HPDrainRate;CircleSize;OverallDifficulty;ApproachRate;SliderMultiplier;SliderTickRate}},20352:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EditorData=void 0;t.EditorData=class{Bookmarks=[];DistanceSpacing;BeatDivisor;GridSize;TimelineZoom}},90361:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;t.Event=class{eventType;startTime=0}},64432:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.EventBackground=void 0;const n=i(90361),s=i(15041);class o extends n.Event{eventType=s.EventTypes.BACKGROUND;startTime=0;filename;xOffset;yOffset;texture}t.EventBackground=o},21191:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.EventBreak=void 0;const n=i(90361),s=i(15041);class o extends n.Event{eventType=s.EventTypes.BREAK;endTime=0}t.EventBreak=o},15041:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.EventTypes=void 0,function(e){e.BACKGROUND="0",e.VIDEO="Video",e.BREAK="Break",e.SPRITE="Sprite",e.ANIMATION="Animation"}(i||(t.EventTypes=i={}))},19437:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.EventVideo=void 0;const n=i(90361),s=i(15041);class o extends n.Event{eventType=s.EventTypes.VIDEO;filename;xOffset;yOffset;texture}t.EventVideo=o},54611:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EventsData=void 0;t.EventsData=class{Events=[]}},37940:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Countdown=void 0,function(e){e[e.NoCountdown=0]="NoCountdown",e[e.Normal=1]="Normal",e[e.Half=2]="Half",e[e.Double=3]="Double"}(i||(t.Countdown=i={}))},85932:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralData=void 0;const n=i(37940),s=i(41080),o=i(90857),a=i(45274);t.GeneralData=class{audioFile;AudioFilename=null;AudioLeadIn=0;AudioHash=null;PreviewTime=-1;Countdown=n.Countdown.Normal;SampleSet=s.SampleSet.Normal;StackLeniency=.7;Mode=o.Mode.OSU;LetterboxInBreaks=!1;StoryFireInFront=!0;UseSkinSprites=!1;AlwaysShowPlayfield=!1;OverlayPosition=a.OverlayPosition.NoChange;SkinPreference=null;EpilepsyWarning=!1;CountdownOffset=0;SpecialStyle=!1;WidescreenStoryboard=!1;SamplesMatchPlaybackRate=!1}},90857:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Mode=void 0,function(e){e[e.OSU=0]="OSU",e[e.TAIKO=1]="TAIKO",e[e.CATCH=2]="CATCH",e[e.MANIA=3]="MANIA"}(i||(t.Mode=i={}))},45274:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.OverlayPosition=void 0,function(e){e.NoChange="NoChange",e.Below="Below",e.Above="Above"}(i||(t.OverlayPosition=i={}))},41080:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.SampleSet=void 0,function(e){e.Normal="Normal",e.Soft="Soft",e.Drum="Drum"}(i||(t.SampleSet=i={}))},32007:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;t.Metadata=class{Title;TitleUnicode;Artist;ArtistUnicode;Creator;Version;Source;Tags;BeatmapID;BeatmapSetID}},22331:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Effect=void 0,function(e){e[e.KiaiTime=1]="KiaiTime",e[e.None=0]="None",e[e.FirstBarLineOmittedInOsuTaikoAndOsuMania=3]="FirstBarLineOmittedInOsuTaikoAndOsuMania"}(i||(t.Effect=i={}))},3143:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.InheritedTimingPoint=void 0;const n=i(52032);class s extends n.TimingPoint{sliderVelocityMultiplier}t.InheritedTimingPoint=s},52032:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimingPoint=void 0;t.TimingPoint=class{time;sampleSet;sampleIndex;volume;effects}},6386:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.TimingPointsData=void 0;const n=i(87816),s=i(3143);t.TimingPointsData=class{TimingPoints=[];GetCurrentTimingPoints(e){let t=[],i=this.TimingPoints.filter((t=>{if(t.time<=e)return t}));if(0==i.length&&i.push(this.TimingPoints[0]),t.push(i[i.length-1]),t[0]instanceof s.InheritedTimingPoint){let i=this.TimingPoints.filter((e=>e instanceof n.UnInheritedTimingPoint)).filter((t=>{if(t.time<=e)return t}));if(0==i.length)throw new Error("Could not find a parent timing point for the un-inherited timing point!");t.push(i[i.length-1])}if(0==t.length)throw new Error("Could not find any timing points!");return t}GetCurrentUninheritedTimingPoint(e){let t,i=this.GetCurrentTimingPoints(e);if(i[0]instanceof n.UnInheritedTimingPoint)t=i[0];else{if(!(i[1]instanceof n.UnInheritedTimingPoint))throw new Error("Could not find any UnInherited Timing Points!");t=i[1]}return t}}},87816:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.UnInheritedTimingPoint=void 0;const n=i(52032);class s extends n.TimingPoint{beatLength;meter}t.UnInheritedTimingPoint=s},9752:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.BeatmapParser=void 0;const n=i(17898),s=i(30444),o=i(81347),a=i(23114),r=i(98803),l=i(92880),u=i(25820);class c{static Parse(e,t){const i=new n.BeatmapData;let d=e.split(/\r?\n|\r|\n/g);return o.GeneralParser.ParseGeneral(i,c.GetSection("General",d)),a.EditorParser.ParseEditor(i,c.GetSection("Editor",d)),r.MetadataParser.ParseMetadata(i,c.GetSection("Metadata",d)),l.DifficultyParser.ParseDifficulty(i,c.GetSection("Difficulty",d)),u.EventsParser.ParseEvents(i,c.GetSection("Events",d)),s.TimingPointsParser.ParseTimingPoints(i,c.GetSection("TimingPoints",d)),i}static async LoadFiles(e){await o.GeneralParser.LoadFiles(e),await u.EventsParser.LoadFiles(e)}static GetSection(e,t){let i=[];return t.forEach(((n,s)=>{if(n=="["+e+"]")for(let e=s+1;e{let i=t.split(":");i[1].startsWith(" ")&&(i[1]=i[1].substring(1,i[1].length)),n.BeatmapParser.AutoParse(s.DifficultyData,i,e.Difficulty)}))}}},23114:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.EditorParser=void 0;const n=i(9752),s=i(20352);t.EditorParser=class{static ParseEditor(e,t){t.forEach((t=>{let i=t.split(":");i[1].startsWith(" ")&&(i[1]=i[1].substring(1,i[1].length)),"Bookmarks"!=i[0]?n.BeatmapParser.AutoParse(s.EditorData,i,e.Editor):i[1].split(",").forEach((t=>{e.Editor.Bookmarks.push(parseFloat(t))}))}))}}},25820:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.EventsParser=void 0;const a=i(15041),r=i(64432),l=i(19437),u=i(21191),c=i(81354),d=o(i(58687)),h=i(12235);t.EventsParser=class{static aviTranscodedVideoCache=[];static ParseEvents(e,t){t.forEach((t=>{let i,n=t.split(",");switch(n[0]){case a.EventTypes.BACKGROUND:i=new r.EventBackground,i.filename=n[2].replaceAll('"',""),i.xOffset=parseInt(n[3]),i.yOffset=parseInt(n[4]),isNaN(i.xOffset)&&(i.xOffset=0),isNaN(i.yOffset)&&(i.yOffset=0);break;case a.EventTypes.VIDEO:case"1":i=new l.EventVideo,i.startTime=parseInt(n[1]),i.filename=n[2].replaceAll('"',""),i.xOffset=parseInt(n[3]),i.yOffset=parseInt(n[4]),isNaN(i.xOffset)&&(i.xOffset=0),isNaN(i.yOffset)&&(i.yOffset=0);break;case a.EventTypes.BREAK:case"2":i=new u.EventBreak,i.startTime=parseInt(n[1]),i.endTime=parseInt(n[2])}i&&e.Events.Events.push(i)}))}static async LoadFiles(e){for(const t of e.Events.Events)for(let i in t)if("filename"==i||"filepath"==i){let n=e.files.get(t[i]);if(n){let s=URL.createObjectURL(n);if(t instanceof r.EventBackground)try{t.texture=await d.Assets.load({src:s,loadParser:"loadTextures"})}catch(e){console.warn(e)}if(t instanceof l.EventVideo){let o=!1;if(t[i].endsWith(".avi")){let a=this.aviTranscodedVideoCache.find((n=>{if(n.beatmapSID==e.Metadata.BeatmapSetID&&n.filePath==t[i])return n}));try{if(a)e.files.delete(t[i]),t[i]=t[i].substring(0,t[i].length-4)+".mp4",e.files.set(t[i],a.blob),URL.revokeObjectURL(s),s=URL.createObjectURL(a.blob);else{console.warn("AVI video is not natively supported! Transcoding to .mp4, this may take a few minutes!");let o=new c.FFmpeg;o.on("progress",(e=>{let{progress:t,time:i}=e;console.log(`.avi to .mp4 transcoding: ${Math.round(1e3*t)/10}% (transcoded time: ${Math.round(i/1e5)/10}s)`)})),console.log("FFmpeg initialized");let a=h.Loader.Get("workers.ffmpeg"),r=h.Loader.Get("ffmpeg.core"),l=h.Loader.Get("ffmpeg.wasm"),u=h.Loader.Get("ffmpeg.coreWorker");await o.load({classWorkerURL:URL.createObjectURL(a),coreURL:URL.createObjectURL(r),wasmURL:URL.createObjectURL(l),workerURL:URL.createObjectURL(u)}),console.log("FFmpeg loaded"),await o.writeFile("input.avi",new Uint8Array(await n.arrayBuffer())),console.log("Written file to FFmpeg's vfs"),await o.exec(["-i","input.avi","-c:v","libx264","-preset","ultrafast","-an","-movflags","faststart","output.mp4"]),console.log("Transcoding done");const d=await o.readFile("output.mp4");o.terminate(),console.log("FFmpeg terminated");let g=new Blob([d],{type:"video/mp4"});this.aviTranscodedVideoCache.push({beatmapSID:e.Metadata.BeatmapSetID,filePath:t[i],blob:g}),e.files.delete(t[i]),t[i]=t[i].substring(0,t[i].length-4)+".mp4",e.files.set(t[i],g),URL.revokeObjectURL(s),s=URL.createObjectURL(g),console.log("Successfully transcoded from .avi to .mp4!")}}catch(e){console.warn(e),o=!0}}if(!o)try{t.texture=await d.Assets.load({src:s,loadParser:"loadVideo"}),t.texture&&(t.texture.source.resource.volume=0,t.texture.source.resource.pause())}catch(e){console.warn(e)}}}else console.warn("Could not find referenced file: "+t[i])}}}},81347:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralParser=void 0;const n=i(85932),s=i(9752);t.GeneralParser=class{static ParseGeneral(e,t){t.forEach((t=>{let i=t.split(":");i[1].startsWith(" ")&&(i[1]=i[1].substring(1,i[1].length)),s.BeatmapParser.AutoParse(n.GeneralData,i,e.General)}))}static async LoadFiles(e){e.General.AudioFilename&&(e.General.audioFile=e.files.get(e.General.AudioFilename))}}},98803:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataParser=void 0;const n=i(9752),s=i(32007);t.MetadataParser=class{static ParseMetadata(e,t){t.forEach((t=>{let i=t.split(":");i[1].startsWith(" ")&&(i[1]=i[1].substring(1,i[1].length)),n.BeatmapParser.AutoParse(s.Metadata,i,e.Metadata)}))}}},30444:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.TimingPointsParser=void 0;const n=i(87816),s=i(3143),o=i(22331);t.TimingPointsParser=class{static ParseTimingPoints(e,t){t.forEach((t=>{let i,a=t.split(",");"1"==a[6]?(i=new n.UnInheritedTimingPoint,i.beatLength=Number.parseFloat(a[1]),i.meter=Number.parseInt(a[2])):(i=new s.InheritedTimingPoint,i.sliderVelocityMultiplier=Number.parseFloat(a[1])),i.time=Number.parseInt(a[0]),i.sampleSet=Number.parseInt(a[3]),i.sampleIndex=Number.parseInt(a[4]),i.volume=Number.parseInt(a[5]),"1"==a[7]||"3"==a[7]?i.effects=Number.parseInt(a[7]):i.effects=o.Effect.None,e.TimingPoints.TimingPoints.push(i)}))}}},5825:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MathUtil=void 0;class i{static RadiansToDegrees(e){return 180*e/Math.PI}static DegreesToRadians(e){return e*Math.PI/180}static clamp(e,t,i){return Math.min(Math.max(i,e),t)}static clamp01(e){return i.clamp(0,1,e)}static Damp(e,t,n,s){return i.Lerp(e,t,1-Math.pow(n,s))}static Lerp(e,t,i){return e+(t-e)*i}}t.MathUtil=i},92915:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Ease=void 0;const a=o(i(29172));class r{static previousEases=[];easings=[];obj;delay=null;constructor(e,t){this.obj=e,t||r.previousEases.push(this)}static getEase(e,t){null==t&&(t=!1);let i=r.previousEases.filter((t=>t.obj==e));return i.length>0?i[0]:new r(e,t)}createTween(e,t,i,n,s,o){const r={value:0},u=new a.Tween(i?r:e),c=new l(u);return u.to(i?{value:1}:t,s),u.easing(o),u.onUpdate((()=>{this.obj.destroyed||(this.obj[n]=i?r.value*(t.value-e.value)+e.value:e),c.onUpdate()})),u.onStart((()=>{i&&(e.value=this.obj[n])})),null==this.delay?u.start():(this.delay.chain(u),this.delay=null),this.easings.push(c),u.onStop((()=>{this.onDone(u)})),u.onComplete((()=>{this.onDone(u)})),this}TransformTo(e,t,i){return this.createTween(this.obj.position,e,!1,"position",t,i),this}onDone(e){this.easings=this.easings.filter((t=>t.tween!=e))}ScaleTo(e,t,i){let n={x:0,y:0};return"number"==typeof e&&(n.x=e,n.y=e),this.createTween(this.obj.scale,n,!1,"scale",t,i),this}FadeTo(e,t,i){return this.createTween({value:this.obj.alpha},{value:e},!0,"alpha",t,i),this}FadeOut(e,t){return this.FadeTo(0,e,t),this}FadeIn(e,t){return this.FadeTo(1,e,t),this}ClearEasings(){return this.easings.forEach((e=>{e.tween.stop()})),this.easings=[],this}Then(e){let t=this.easings.sort(((e,t)=>e.tween.getDuration()-t.tween.getDuration()));return t.length>0&&(this.delay=t[0].tween,null!=e&&(t[0].tween.onComplete((()=>{this.onDone(t[0].tween),e()})),t[0].tween.onStop((()=>{this.onDone(t[0].tween),e()})))),this}OnEach(e){let t=this.easings.sort(((e,t)=>e.tween.getDuration()-t.tween.getDuration()));t.length>0&&t[0].registerOnUpdate(e)}}t.Ease=r;class l{tween;updateEventListeners=[];constructor(e){this.tween=e}onUpdate(){this.updateEventListeners.forEach((e=>{e()}))}registerOnUpdate(e){this.updateEventListeners.push(e)}unRegisterOnUpdate(e){this.updateEventListeners=this.updateEventListeners.filter((t=>!(e===t)))}}},94461:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.CenteredList=void 0;const n=i(70828),s=i(5168);class o extends n.List{get elementsMargin(){return super.elementsMargin}set elementsMargin(e){super.elementsMargin=e,s.UIUtils.centerPivotOfList(this)}ReCenter(){s.UIUtils.centerPivotOfList(this)}}t.CenteredList=o},5168:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIUtils=void 0;t.UIUtils=class{static centerPivotOfList(e){let t=e.leftPadding,i=e.topPadding;for(let n=0;n{const e=o.Settings.getSetting(a.Renderer).getValue().value;d.init({backgroundColor:"black",width:u,height:c,antialias:!0,preference:e,resolution:window.devicePixelRatio,autoDensity:!0}).then((()=>{new s.Main(d)}))},navigator.mediaSession.setActionHandler("play",(()=>{s.Main.AudioEngine.GetCurrentPlayingMusicNoSilent()?.Play()})),navigator.mediaSession.setActionHandler("pause",(()=>{s.Main.AudioEngine.GetCurrentPlayingMusicNoSilent()?.Pause()})),navigator.mediaSession.setActionHandler("stop",(()=>{})),navigator.mediaSession.setActionHandler("seekbackward",(()=>{})),navigator.mediaSession.setActionHandler("seekforward",(()=>{})),navigator.mediaSession.setActionHandler("seekto",(()=>{})),navigator.mediaSession.setActionHandler("previoustrack",(()=>{})),navigator.mediaSession.setActionHandler("nexttrack",(()=>{})),Object.defineProperty(window,"setSensitivity",{value:e=>{o.Settings.getSetting(r.MouseSensitivity).setValue(e)}}),Object.defineProperty(window,"setRenderer",{value:e=>{let t=o.Settings.getSetting(a.Renderer);t.setValue("webgl"==e?t.webglOption:t.webGpuOption),window.location.reload()}}),Object.defineProperty(window,"setUIScale",{value:e=>{o.Settings.getSetting(l.UIScale).setValue(e),window.location.reload()}})},20825:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Main=void 0;const a=o(i(58687)),r=i(76969),l=i(25373),u=i(12235),c=i(55686),d=i(85437),h=o(i(29172)),g=i(29847),f=i(53931),p=i(9752);class m{static app;static mousePos={x:0,y:0};static pointerLockExitTime;static cursor;static AudioEngine;static currentScreen;static allScreens=[];static clickArea=new a.Graphics;static doPointerLock=!1;static settingsPane;static processingOsuFile=!1;constructor(e){m.app=e,m.setDropEvents(),document.body.appendChild(m.app.canvas),m.settingsPane=new g.SettingsPane,m.settingsPane.zIndex=999998,m.app.stage.addChild(m.settingsPane),document.addEventListener("keydown",(e=>{e.ctrlKey&&"KeyO"==e.code&&m.settingsPane.toggle()})),this.doResize(),window.addEventListener("resize",this.doResize),m.app.ticker.add((()=>{h.update()})),m.app.stage.eventMode="static",m.AudioEngine=new d.AudioEngine,m.app.stage.addEventListener("mousemove",(e=>{m.mousePos.x=e.clientX,m.mousePos.y=e.clientY,m.cursor&&m.cursor.updateMouse()})),document.addEventListener("pointerlockchange",this.pointerLockChanged,!1),m.switchScreen(new r.LoadScreen),u.Loader.Load(m.AudioEngine.audioContext).then((()=>{m.cursor=new c.MenuCursor(!1);let e=u.Loader.GetAudio("sample_dialog_ok"),t=u.Loader.Get("introTrianglesTrack");m.switchScreen(new l.InteractScreen(t,e))}))}static setDropEvents(){Object.defineProperty(window,"onDropEvent",{value:e=>{if(e.preventDefault(),m.processingOsuFile)alert("Another BeatMap is still processing. (Most likely transcoding a .avi file, check the console for progress) Please wait for it to process and start playing before processing another one!");else if(m.processingOsuFile=!0,e.dataTransfer.items){let t=[...e.dataTransfer.items][0];if("file"==t.kind){const e=t.getAsFile();(0,f.unzip)(e).then((e=>{let{entries:t}=e;for(const[e,i]of Object.entries(t))if(e.endsWith(".osu")){i.text().then((async e=>{let i=p.BeatmapParser.Parse(e);for(const[e,n]of Object.entries(t)){let t=await n.blob();i.files.set(e,t)}await p.BeatmapParser.LoadFiles(i);let n=i.General.audioFile;if(n){let e=URL.createObjectURL(n);m.AudioEngine.PlayMusicImmediately(e,i,(()=>{console.log("Now playing "+i.Metadata.TitleUnicode+" - "+i.Metadata.ArtistUnicode+" ("+i.Metadata.Title+" - "+i.Metadata.Artist+")")}))}m.processingOsuFile=!1,console.log(i)}));break}}))}}}}),Object.defineProperty(window,"onDragEvent",{value:e=>{e.preventDefault()}}),m.app.canvas.setAttribute("ondrop","window.onDropEvent(event);"),m.app.canvas.setAttribute("ondragover","window.onDragEvent(event);")}static lockKeyboard(){navigator.keyboard&&navigator.keyboard.lock([]).then((()=>{console.log("Locked keyboard!"),document.fullscreenElement||console.warn("Keyboard lock won't work unless the user is in fullscreen (as requested by the game, not if the user just presses F11)!")}))}static pointerLock(){try{this.doPointerLock=!0,m.app.canvas.requestPointerLock({unadjustedMovement:!0})}catch(e){console.warn("Failed to lock cursor, error:",e),this.doPointerLock=!1}}static exitPointerLock(){this.doPointerLock=!1,m.app.canvas.exitPointerLock()}static switchScreen(e){null!=this.currentScreen&&(this.currentScreen.zIndex=1,this.currentScreen.onClose().then((e=>{for(let t=0;t{e.onResize()})),m.settingsPane.resize()}pointerLockChanged(){!document.pointerLockElement&&m.doPointerLock?(a.EventSystem.isPointerLocked=!1,m.pointerLockExitTime=Date.now(),m.clickArea=new a.Graphics,m.clickArea.rect(0,0,1,1),m.clickArea.fill("rgba(0,0,0,0.1)"),m.clickArea.width=window.innerWidth,m.clickArea.height=window.innerHeight,m.clickArea.position.set(0,0),m.app.stage.addChild(m.clickArea),m.clickArea.eventMode="static",m.clickArea.cursor="pointer",m.cursor.PopOut(),m.clickArea.zIndex=9999999,m.clickArea.onclick=()=>{Date.now()-m.pointerLockExitTime<1500||(m.clickArea.removeFromParent(),m.clickArea.destroy(),m.pointerLock(),m.cursor.PopIn())}):a.EventSystem.isPointerLocked=!0}}t.Main=m},11307:function(e,t,i){i.r(t)},58689:function(e,t,i){i.r(t),t.default="in vec2 vUV;\nin vec2 vPositionOffset;\nin vec2 vPosition;\nin vec4 vColorTint;\nuniform sampler2D uTexture;\nuniform float time;\n\nvoid main() {\n float a = ((vPositionOffset.y + vPosition.y)/1200.0) - 0.1;\n vec4 color = texture(uTexture, vUV);\n if (a > 1.0) {\n a = 1.0;\n }\n gl_FragColor = (color*vColorTint)*a;\n}"},46404:function(e,t,i){i.r(t),t.default="in vec2 aPosition;\nin vec2 aUV;\nin vec2 aPositionOffset;\nin vec4 aColorTint;\n\nout vec2 vUV;\nout vec2 vPositionOffset;\nout vec2 vPosition;\nout vec4 vColorTint;\n\nuniform mat3 uProjectionMatrix;\nuniform mat3 uWorldTransformMatrix;\nuniform mat3 uTransformMatrix;\n\n\nvoid main() {\n\n mat3 mvp = uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\n gl_Position = vec4((mvp * vec3(aPosition + aPositionOffset, 1.0)).xy, 0.0, 1.0);\n vPositionOffset = aPositionOffset;\n vUV = aUV;\n vPosition = aPosition;\n vColorTint = aColorTint;\n}"},61630:function(e,t,i){i.r(t),t.default="struct GlobalUniforms {\n uProjectionMatrix:mat3x3,\n uWorldTransformMatrix:mat3x3,\n uWorldColorAlpha: vec4,\n uResolution: vec2,\n}\n\nstruct LocalUniforms {\n uTransformMatrix:mat3x3,\n uColor:vec4,\n uRound:f32,\n}\n\n\n@group(0) @binding(0) var globalUniforms : GlobalUniforms;\n@group(1) @binding(0) var localUniforms : LocalUniforms;\n\nstruct VertexOutput {\n @builtin(position) position: vec4,\n @location(0) vUV: vec2,\n @location(1) vPositionOffset: vec2,\n @location(2) vPosition: vec2,\n @location(3) vColorTint: vec4\n};\n\n\n@vertex\nfn mainVert(\n @location(0) aPosition : vec2,\n @location(1) aUV : vec2,\n @location(2) aColorTint : vec4,\n @location(3) aPositionOffset : vec2,\n) -> VertexOutput {\n var mvp = globalUniforms.uProjectionMatrix\n * globalUniforms.uWorldTransformMatrix\n * localUniforms.uTransformMatrix;\n\n var output: VertexOutput;\n\n output.position = vec4(mvp * vec3(aPosition+aPositionOffset, 1.0), 1.0);\n output.vUV = aUV;\n output.vPosition = aPosition;\n output.vPositionOffset = aPositionOffset;\n output.vColorTint = aColorTint;\n\n return output;\n};\n\nstruct WaveUniforms {\n time:f32,\n}\n\n@group(2) @binding(1) var uTexture : texture_2d;\n@group(2) @binding(2) var uSampler : sampler;\n@group(2) @binding(3) var waveUniforms : WaveUniforms;\n\n@fragment\nfn mainFrag(\n @location(0) vUV: vec2,\n @location(1) vPositionOffset: vec2,\n @location(2) vPosition: vec2,\n @location(3) vColorTint: vec4\n) -> @location(0) vec4 {\n var a: f32 = ((vPositionOffset.y + vPosition.y)/1200.0) - 0.1;\n let color: vec4 = textureSample(uTexture, uSampler, vUV);\n if (a > 1.0){\n a = 1.0;\n }\n return (color*vColorTint)*a;\n};"},44160:function(e,t,i){i.r(t),t.default="in vec4 vColor;\nin vec2 vUV;\n\nuniform sampler2D uTexture;\nuniform float progress;\n\nvoid main() {\n vec4 color = texture2D(uTexture, vUV);\n float a = vColor.a * color.a;\n vec4 _vColor = vec4(smoothstep(0.88, 1.0, color.a))*vColor;\n vec4 outColor = (color.r < progress) ? vec4(_vColor.rgb * a, a) : vec4(0.0);\n gl_FragColor = outColor;\n}\n"},26045:function(e,t,i){i.r(t),t.default="in vec2 aPosition;\nin vec4 aColor;\nin vec2 aUV;\n\nout vec4 vColor;\nout vec2 vUV;\n\nuniform mat3 uProjectionMatrix;\nuniform mat3 uWorldTransformMatrix;\n\nuniform mat3 uTransformMatrix;\n\n\nvoid main() {\n\n mat3 mvp = uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\n gl_Position = vec4((mvp * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n\n vColor = aColor;\n vUV = aUV;\n}\n"},46110:function(e,t,i){i.r(t),t.default="struct GlobalUniforms {\n uProjectionMatrix:mat3x3,\n uWorldTransformMatrix:mat3x3,\n uWorldColorAlpha: vec4,\n uResolution: vec2,\n}\n\nstruct LocalUniforms {\n uTransformMatrix:mat3x3,\n uColor:vec4,\n uRound:f32,\n}\n\n\n@group(0) @binding(0) var globalUniforms : GlobalUniforms;\n@group(1) @binding(0) var localUniforms : LocalUniforms;\n\nstruct VertexOutput {\n @builtin(position) position: vec4,\n @location(0) vUV: vec2,\n @location(1) vColor: vec4,\n};\n\n\n@vertex\nfn mainVert(@location(0) aPosition : vec2, @location(1) aUV : vec2, @location(2) aColor: vec4\n) -> VertexOutput {\n var mvp = globalUniforms.uProjectionMatrix\n * globalUniforms.uWorldTransformMatrix\n * localUniforms.uTransformMatrix;\n\n var output: VertexOutput;\n\n output.position = vec4(mvp * vec3(aPosition, 1.0), 1.0);\n output.vUV = aUV;\n output.vColor = aColor;\n\n return output;\n};\n\nstruct ProgressUniform {\n progress:f32\n}\n\n@group(2) @binding(1) var uTexture : texture_2d;\n@group(2) @binding(2) var uSampler : sampler;\n@group(2) @binding(3) var uProgress : ProgressUniform;\n\n@fragment\nfn mainFrag(@location(0) vUV: vec2, @location(1) vColor: vec4) -> @location(0) vec4 {\n let color: vec4 = textureSample(uTexture, uSampler, vUV);\n let a: f32 = color.a;\n let _vColor: vec4 = smoothstep(0.88, 1.0, color.a) * vColor;\n var outColor: vec4 = vec4(0.0);\n if (color.r < uProgress.progress) {\n outColor = vec4(_vColor.rgb * a, a);\n }\n return outColor;\n};\n"}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var o=i[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=t,e=[],n.O=function(t,i,s,o){if(!i){var a=1/0;for(c=0;c=o)&&Object.keys(n.O).every((function(e){return n.O[e](i[l])}))?i.splice(l--,1):(r=!1,o0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[i,s,o]},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={179:0};n.O.j=function(t){return 0===e[t]};var t=function(t,i){var s,o,a=i[0],r=i[1],l=i[2],u=0;if(a.some((function(t){return 0!==e[t]}))){for(s in r)n.o(r,s)&&(n.m[s]=r[s]);if(l)var c=l(n)}for(t&&t(i);u 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import {BeatmapData} from \"../Util/Beatmap/Data/BeatmapData\";\nimport {Main} from \"../main\";\nimport {EventTypes} from \"../Util/Beatmap/Data/Sections/Events/EventTypes\";\nimport {EventVideo} from \"../Util/Beatmap/Data/Sections/Events/EventVideo\";\n\nexport class Audio {\n public audio!: AudioBuffer;\n public source?: AudioBufferSourceNode;\n public mediaSource?: MediaElementAudioSourceNode;\n public mediaAudioElement!: HTMLAudioElement;\n public id!: number;\n public get isPaused() {\n return this._useMediaSource ? this.mediaAudioElement.paused : false;\n }\n public get isPlaying() {\n return this._useMediaSource ? !this.mediaAudioElement.paused : true;\n }\n public nodes: AudioNode[] = [];\n public tempArrayMain = new Float32Array(256);\n public tempArrayL = new Float32Array(64);\n public tempArrayR = new Float32Array(64);\n public LeftChannel: number = 0;\n public RightChannel: number = 0;\n public FrequencyAmplitudes = new Float32Array(256);\n protected _connectedToContext = false;\n protected _useMediaSource = false;\n protected _onEndCallback?: () => void;\n public timeStarted = 0; // only for silent audio when real music is paused\n protected paused = false; // used to check if music was paused outside of Audio class (i.e. pressing stop media button on the keyboard)\n public beatmap!: BeatmapData;\n\n public GetMaximumAudioLevel() {\n return Math.max(this.LeftChannel, this.RightChannel);\n }\n\n public GetAverageAudioLevel() {\n return (this.LeftChannel + this.RightChannel) / 2;\n }\n\n public Create(audioContext: AudioContext, useMediaSource?: boolean) {\n this._useMediaSource = useMediaSource ? useMediaSource : false;\n if (!useMediaSource) {\n this.source = audioContext.createBufferSource();\n this.source.buffer = this.audio;\n }\n else {\n if (!this.mediaAudioElement) {\n throw new Error(\"HTML Audio Element was not initialized!\")\n }\n this.mediaSource = audioContext.createMediaElementSource(this.mediaAudioElement);\n this.mediaAudioElement.onpause = () => {\n if (!this.paused && !this.mediaAudioElement.ended) { // check if music was paused outside of Audio class\n this.Play();\n }\n }\n }\n }\n\n public AddAudioNode(node: AudioNode) {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n this.nodes.push(node);\n }\n\n public GetNode(type: new (...args: any[]) => T): T[] | null {\n let nodes = this.nodes.filter(node => node instanceof type) as T[];\n if (nodes.length > 0) {\n return nodes;\n } else {\n return null;\n }\n }\n\n public ConnectToContext(audioContext: AudioContext, howToConnectFunction?: (nodes: AudioNode[], source: AudioBufferSourceNode | MediaElementAudioSourceNode) => void) {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (this._connectedToContext) {\n return;\n }\n this._connectedToContext = true;\n if (this.nodes.length > 0) {\n if (howToConnectFunction) {\n howToConnectFunction(this.nodes, (!this._useMediaSource ? this.source : this.mediaSource)!);\n } else {\n this.nodes.forEach((node, index) => {\n this.source!.connect(node);\n if (!(node instanceof AnalyserNode)) {\n node.connect(audioContext.destination);\n }\n });\n }\n } else {\n if (!this._useMediaSource) {\n this.source!.connect(audioContext.destination);\n }\n else {\n this.mediaSource!.connect(audioContext.destination);\n }\n }\n }\n\n public Play() {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n this.paused = false;\n if (!this._useMediaSource) {\n this.source!.start();\n }\n else {\n this.mediaAudioElement!.play();\n let backgroundVideo = this.beatmap.Events.Events.find((e) => {\n if (e.eventType == EventTypes.VIDEO){\n return e;\n }\n }) as EventVideo;\n if (backgroundVideo) {\n if (backgroundVideo.texture) {\n if (backgroundVideo.texture.source.resource.startPromise) {\n backgroundVideo.texture.source.resource.startPromise.then(() => {\n let video = backgroundVideo.texture!.source.resource as HTMLVideoElement;\n video.play();\n });\n }\n }\n }\n }\n }\n\n public Pause() {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n if (!this._useMediaSource) {\n throw new Error(\"Pause is not supported on AudioSourceBuffer!\");\n }\n this.paused = true;\n this.mediaAudioElement!.pause();\n let backgroundVideo = this.beatmap.Events.Events.find((e) => {\n if (e.eventType == EventTypes.VIDEO){\n return e;\n }\n }) as EventVideo;\n if (backgroundVideo) {\n if (backgroundVideo.texture) {\n if (backgroundVideo.texture.source.resource.startPromise) {\n backgroundVideo.texture.source.resource.startPromise.then(() => {\n let video = backgroundVideo.texture!.source.resource as HTMLVideoElement;\n video.pause();\n });\n }\n }\n }\n }\n\n public Stop() {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n this.paused = true;\n if (!this._useMediaSource) {\n this.source!.stop();\n }\n else {\n this.mediaAudioElement!.pause();\n if (this._onEndCallback) {\n this._onEndCallback();\n }\n }\n }\n\n public SetTime(timeMS: number) {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n if (!this._useMediaSource) {\n throw new Error(\"SetTime is not supported on AudioSourceBuffer!\");\n }\n this.mediaAudioElement.currentTime = timeMS/1000;\n }\n\n public GetDuration() {\n return (!this._useMediaSource ? this.audio.duration : this.mediaAudioElement.duration * 1000)\n }\n\n public GetCurrentTime() {\n return this._useMediaSource ? this.mediaAudioElement.currentTime * 1000 : (this.timeStarted != 0 ? Date.now() - this.timeStarted : 0);\n }\n\n public RegisterEndCallBack(callback: () => void) {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n this._onEndCallback = callback;\n if (!this._useMediaSource) {\n this.source!.onended = () => {\n if (!this.isPaused) {\n this.paused = true;\n callback();\n }\n }\n }\n else {\n this.mediaAudioElement.onended = () => {\n this.paused = true;\n callback();\n }\n }\n }\n\n}\n\nexport class MapAudio extends Audio {\n public fadingOut: boolean = false;\n // @ts-ignore\n public fadeOutTimeout!: Timeout\n public playingCallback?: () => void;\n\n public FadeOut() {\n if (!(!this._useMediaSource ? this.source : this.mediaSource)) {\n throw new Error(\"Source not created yet!\");\n }\n if (!this._connectedToContext) {\n throw new Error(\"Not connected to audio context yet!\");\n }\n if (!this._useMediaSource) {\n throw new Error(\"FadeOut is not supported on AudioSourceBuffer!\");\n }\n if (this.fadingOut) {\n return;\n }\n this.fadingOut = true;\n clearTimeout(this.fadeOutTimeout);\n let gainNodes = this.GetNode(GainNode);\n if (gainNodes == null) {\n throw new Error(\"Gain Node doesn't exist on Audio Object!\");\n }\n let gain = gainNodes[0];\n gain.gain.linearRampToValueAtTime(0, Main.AudioEngine.audioContext.currentTime + 1)\n setTimeout(() => {\n this.Stop();\n }, 1000);\n }\n}\n","import {PlayingAudios} from \"./PlayingAudios\";\nimport {Audio, MapAudio} from \"./Audio\";\nimport {BeatmapData} from \"../Util/Beatmap/Data/BeatmapData\";\nimport {Main} from \"../main\";\nimport {UnInheritedTimingPoint} from \"../Util/Beatmap/Data/Sections/TimingPoints/UnInheritedTimingPoint\";\nimport {Effect} from \"../Util/Beatmap/Data/Sections/TimingPoints/Effect\";\n\nexport class AudioEngine {\n public readonly audioContext: AudioContext;\n private readonly _playingAudios: PlayingAudios;\n private _musicQueue: MapAudio[] = [];\n private _audioIdTicker: number = 0;\n private _changeCallbacks: ((mapAudio: MapAudio) => void)[] = [];\n private silentMusic = this.createSilentMusic();\n public useSilentMusic = true;\n\n public constructor() {\n this.audioContext = new AudioContext();\n this._playingAudios = new PlayingAudios();\n Main.app.ticker.add(() => {\n this.update();\n });\n }\n\n public UpdateMusicQueue() {\n if (this._musicQueue[0]) {\n if (!this._musicQueue[0].fadingOut && this._musicQueue[0].GetCurrentTime() == 0) {\n this._play(this._musicQueue[0]);\n this._changeCallbacks.forEach((cb) => cb(this._musicQueue[0]));\n }\n if (this._musicQueue[0].fadingOut && this._musicQueue[1]) {\n if (this._musicQueue[1]) {\n this._play(this._musicQueue[1]);\n this._changeCallbacks.forEach((cb) => cb(this._musicQueue[1]));\n }\n }\n }\n if (!(this._musicQueue.length >= 1)) {\n this.silentMusic = this.createSilentMusic();\n this.useSilentMusic = true;\n }\n else {\n this.useSilentMusic = false;\n }\n }\n\n public createSilentMusic() {\n let mapAudio = new MapAudio();\n mapAudio.timeStarted = Date.now();\n mapAudio.beatmap = new BeatmapData();\n let timingPoint = new UnInheritedTimingPoint();\n timingPoint.time = 0;\n timingPoint.beatLength = 1000;\n timingPoint.effects = Effect.None;\n mapAudio.beatmap.TimingPoints.TimingPoints.push(timingPoint);\n return mapAudio;\n }\n\n public addMusicChangeEventListener(cb: (() => void) | ((mapAudio: MapAudio) => void)) {\n this._changeCallbacks.push(cb);\n }\n\n public removeMusicChangeEventListener(cb: (() => void) | ((mapAudio: MapAudio) => void)) {\n this._changeCallbacks = this._changeCallbacks.filter(callback => callback != cb);\n }\n\n public GetCurrentPlayingMusic(): MapAudio {\n return this.useSilentMusic ? this.silentMusic : this._musicQueue[0];\n }\n\n public GetCurrentPlayingMusicNoSilent(): MapAudio {\n return this._musicQueue[0];\n }\n\n public PlayEffect(audio: AudioBuffer, pitch?: number) {\n let audioObj = new Audio();\n audioObj.audio = audio;\n audioObj.id = this._audioIdTicker;\n this._play(audioObj, pitch);\n this._audioIdTicker++;\n }\n\n public AddToMusicQueue(mapAudio: string, beatMapData: BeatmapData, musicPlayingCallback?: () => void) {\n let mapAudioObj = new MapAudio();\n mapAudioObj.mediaAudioElement = document.createElement(\"audio\");\n mapAudioObj.mediaAudioElement.src = mapAudio;\n mapAudioObj.beatmap = beatMapData;\n mapAudioObj.id = this._audioIdTicker;\n if (musicPlayingCallback) {\n mapAudioObj.playingCallback = musicPlayingCallback;\n }\n this._musicQueue.push(mapAudioObj);\n this._audioIdTicker++;\n this.UpdateMusicQueue();\n return mapAudioObj.id;\n }\n\n public PlayMusicImmediately(mapAudio: string, beatMapData: BeatmapData, musicPlayingCallback?: () => void) {\n let currentPlaying = this.GetCurrentPlayingMusicNoSilent();\n this._musicQueue = [];\n if (currentPlaying) {\n currentPlaying.FadeOut();\n }\n this.AddToMusicQueue(mapAudio, beatMapData, musicPlayingCallback);\n }\n\n public update() {\n let currentPlaying = this.GetCurrentPlayingMusic();\n let currentPlayingNoSilent = this.GetCurrentPlayingMusicNoSilent();\n if (!currentPlayingNoSilent)\n return;\n if (currentPlayingNoSilent.isPaused) {\n this.useSilentMusic = true;\n return;\n }\n else if (this.useSilentMusic) {\n this.useSilentMusic = false;\n currentPlaying = this.GetCurrentPlayingMusic();\n }\n if (!this.useSilentMusic) {\n if (!currentPlaying.fadingOut) {\n if (currentPlaying.GetDuration() - currentPlaying.GetCurrentTime() <= 1000){\n currentPlaying.FadeOut();\n }\n }\n let analyzerMain = currentPlaying.GetNode(AnalyserNode)![0];\n let analyzerL = currentPlaying.GetNode(AnalyserNode)![1];\n let analyzerR = currentPlaying.GetNode(AnalyserNode)![2];\n\n analyzerMain.getFloatFrequencyData(currentPlaying.tempArrayMain);\n for (let i = 0; i < currentPlaying.FrequencyAmplitudes.length; i++) {\n currentPlaying.tempArrayMain[i] += 140;\n currentPlaying.tempArrayMain[i] /= 340;\n if (i < 3) {\n currentPlaying.tempArrayMain[i] *= (12 * currentPlaying.tempArrayMain[i]);\n } else if (i < 6) {\n currentPlaying.tempArrayMain[i] *= (9 * currentPlaying.tempArrayMain[i]);\n } else if (i < 100) {\n currentPlaying.tempArrayMain[i] *= (6 * currentPlaying.tempArrayMain[i]);\n }\n currentPlaying.tempArrayMain[i] /= 2;\n if (currentPlaying.tempArrayMain[i] == Infinity || currentPlaying.tempArrayMain[i] == -Infinity) {\n currentPlaying.FrequencyAmplitudes[i] = 0;\n }\n else {\n currentPlaying.FrequencyAmplitudes[i] = currentPlaying.tempArrayMain[i];\n }\n }\n\n analyzerL.getFloatTimeDomainData(currentPlaying.tempArrayL);\n analyzerR.getFloatTimeDomainData(currentPlaying.tempArrayR);\n let avgL = 0;\n let avgR = 0;\n currentPlaying.tempArrayL.forEach((value) => {\n avgL += (value + 1)/2;\n });\n currentPlaying.tempArrayR.forEach((value) => {\n avgR += (value + 1)/2;\n });\n avgL /= currentPlaying.tempArrayL.length;\n avgR /= currentPlaying.tempArrayR.length;\n currentPlaying.LeftChannel = avgL;\n currentPlaying.RightChannel = avgR;\n }\n }\n\n private _play(audio: Audio | MapAudio, pitch?: number) {\n // check if audio is type of MapAudio\n if (audio instanceof MapAudio) {\n audio.Create(this.audioContext, true);\n let gain = this.audioContext.createGain();\n gain.gain.value = 0;\n let analyzer = this.audioContext.createAnalyser();\n analyzer.fftSize = 512;\n analyzer.smoothingTimeConstant = 0;\n let splitter = this.audioContext.createChannelSplitter(2);\n let analyzerL = this.audioContext.createAnalyser();\n analyzerL.smoothingTimeConstant = 0;\n analyzerL.fftSize = 128;\n let analyzerR = this.audioContext.createAnalyser();\n analyzerR.smoothingTimeConstant = 0;\n analyzerR.fftSize = 128;\n audio.AddAudioNode(gain);\n audio.AddAudioNode(analyzer);\n audio.AddAudioNode(analyzerL);\n audio.AddAudioNode(analyzerR);\n audio.ConnectToContext(this.audioContext, (nodes, source) => {\n source.connect(gain);\n gain.connect(this.audioContext.destination);\n source.connect(analyzer);\n source.connect(splitter);\n splitter.connect(analyzerL, 0);\n splitter.connect(analyzerR, 1);\n });\n audio.Play();\n this._playingAudios.audios.push(audio);\n if (audio.playingCallback) {\n audio.playingCallback();\n }\n gain.gain.linearRampToValueAtTime(1, this.audioContext.currentTime + 0.5);\n\n } else {\n audio.Create(this.audioContext, false);\n audio.ConnectToContext(this.audioContext);\n if (pitch) {\n if (audio.source) {\n audio.source.playbackRate.value = pitch;\n }\n }\n audio.Play();\n this._playingAudios.audios.push(audio);\n }\n\n\n audio.RegisterEndCallBack(() => {\n if (audio instanceof MapAudio) {\n if (this._musicQueue[0] == audio) {\n this._musicQueue.splice(0, 1);\n }\n this.UpdateMusicQueue();\n }\n this._playingAudios.audios.forEach((audioInArr, index) => {\n if (audioInArr === audio) {\n this._playingAudios.audios.splice(index, 1);\n return;\n }\n });\n });\n }\n\n}\n","import {Audio, MapAudio} from \"./Audio\";\n\nexport class PlayingAudios {\n public audios: (Audio | MapAudio)[] = [];\n}\n","import {Main} from \"../../main\";\nimport {MapAudio} from \"../../Audio/Audio\";\nimport * as PIXI from \"pixi.js\";\nimport {MathUtil} from \"../../Util/MathUtil\";\nimport {Effect} from \"../../Util/Beatmap/Data/Sections/TimingPoints/Effect\";\nimport {UnInheritedTimingPoint} from \"../../Util/Beatmap/Data/Sections/TimingPoints/UnInheritedTimingPoint\";\n\nexport class LogoVisualizer extends PIXI.Container {\n\n public static readonly size = 900;\n public frequencyAmplitudes: Float32Array = new Float32Array(256);\n protected audio!: MapAudio;\n protected temporalAmplitudes: Float32Array = new Float32Array(256);\n protected graphics: PIXI.Graphics = new PIXI.Graphics();\n // The number of bars to jump each update iteration.\n private readonly index_change = 5;\n // The maximum length of each bar in the visualiser. Will be reduced when kiai is not activated.\n private readonly bar_length = 600;\n // The number of bars in one rotation of the visualiser.\n private bars_per_visualiser = 200;\n // How many times we should stretch around the circumference (overlapping overselves).\n private readonly visualiser_rounds = 5;\n // How much should each bar go down each millisecond (based on a full bar).\n private readonly decay_per_millisecond = 0.0024;\n // Number of milliseconds between each amplitude update.\n private readonly time_between_updates = 50;\n // The minimum amplitude to show a bar.\n private readonly amplitude_dead_zone = 1 / this.bar_length;\n private indexOffset = 0;\n private firstDraw = true;\n\n public set alpha(number: number) {\n super.alpha = number * 0.2;\n }\n public get alpha() {\n return super.alpha * 5;\n }\n\n public constructor() {\n super();\n this.alpha = 1;\n }\n\n public start() {\n this.graphics.blendMode = \"add\";\n this.addChild(this.graphics);\n this.graphics.eventMode = \"none\";\n this.eventMode = \"none\";\n setInterval(() => {\n this.updateAmplitudes()\n }, this.time_between_updates);\n\n }\n\n public draw(ticker: PIXI.Ticker) {\n if (this.firstDraw) {\n for (let i = 0; i < this.frequencyAmplitudes.length; i++) {\n this.frequencyAmplitudes[i] = 0;\n }\n }\n this.graphics.clear();\n let decayFactor = ticker.deltaMS * this.decay_per_millisecond;\n for (let i = 0; i < this.bars_per_visualiser; i++) {\n //3% of extra bar length to make it a little faster when bar is almost at it's minimum\n this.frequencyAmplitudes[i] -= decayFactor * (this.frequencyAmplitudes[i] + 0.03);\n if (this.frequencyAmplitudes[i] < 0) {\n this.frequencyAmplitudes[i] = 0;\n }\n }\n\n for (let j = 0; j < this.visualiser_rounds; j++) {\n for (let i = 0; i < this.bars_per_visualiser; i++) {\n if (this.frequencyAmplitudes[i] < this.amplitude_dead_zone) {\n continue;\n }\n\n let rotation = MathUtil.DegreesToRadians(i / this.bars_per_visualiser * 360 + j * 360 / this.visualiser_rounds);\n let rotationCos = Math.cos(rotation);\n let rotationSin = Math.sin(rotation);\n // taking the cos and sin to the 0..1 range\n let barPosition = {\n x: (rotationCos / 2 + 0.5) * LogoVisualizer.size,\n y: (rotationSin / 2 + 0.5) * LogoVisualizer.size\n };\n\n let barSize = {\n x: LogoVisualizer.size * Math.sqrt(2 * (1 - Math.cos(MathUtil.DegreesToRadians(360 / this.bars_per_visualiser)))) / 2,\n y: this.bar_length * this.frequencyAmplitudes[i]\n };\n // The distance between the bottom side of the bar and the top side.\n let amplitudeOffset = {x: rotationCos * barSize.y, y: rotationSin * barSize.y};\n\n this.graphics.moveTo(barPosition.x, barPosition.y);\n this.graphics.lineTo(barPosition.x + amplitudeOffset.x, barPosition.y + amplitudeOffset.y);\n this.graphics.stroke({color: \"rgb(255, 255, 255)\", width: 14});\n }\n }\n this.firstDraw = false;\n }\n\n private updateAmplitudes() {\n this.audio = Main.AudioEngine.GetCurrentPlayingMusic();\n for (let i = 0; i < this.audio.FrequencyAmplitudes.length; i++) {\n this.temporalAmplitudes[i] = this.audio.FrequencyAmplitudes[i];\n }\n let audioTime = this.audio.GetCurrentTime();\n let timingPoint = this.audio.beatmap.TimingPoints.GetCurrentTimingPoints(audioTime)[0];\n for (let i = 0; i < this.bars_per_visualiser; i++) {\n let targetAmplitude = (this.temporalAmplitudes[(i + this.indexOffset) % this.bars_per_visualiser]) *\n (timingPoint.effects == Effect.KiaiTime ? 1 : 0.5);\n if (targetAmplitude > this.frequencyAmplitudes[i]) {\n this.frequencyAmplitudes[i] = targetAmplitude;\n }\n }\n this.indexOffset = (this.indexOffset + this.index_change) % this.bars_per_visualiser;\n }\n}\n","import {LogoVisualizer} from \"../LogoVisualizer\";\nimport * as PIXI from \"pixi.js\";\n\nexport class MenuLogoVisualizer extends LogoVisualizer {\n\n\n public draw(ticker: PIXI.Ticker) {\n super.draw(ticker);\n\n }\n}\n","import * as PIXI from \"pixi.js\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\n\nexport class LoadAnim extends PIXI.Container {\n private readonly bg: PIXI.Graphics;\n private readonly arc: PIXI.Graphics;\n private readonly arcContainer: PIXI.Container;\n private readonly animInterval: NodeJS.Timeout;\n private readonly container: PIXI.Container;\n private readonly bgContainer: PIXI.Container;\n private bgRotation: number = 0;\n\n public constructor(bgColor: string, arcColor: string) {\n super();\n this.pivot.set(0.5, 0.5);\n this.container = new PIXI.Container();\n this.container.alpha = 0;\n this.rotation = Math.PI * 2.5;\n this.bgContainer = new PIXI.Container();\n this.bg = new PIXI.Graphics();\n this.bg.roundRect(-50, -50, 100, 100, 25);\n this.bg.fill(bgColor);\n this.arcContainer = new PIXI.Container();\n this.arc = new PIXI.Graphics();\n this.arc.arc(0, 0, 27, Math.PI + .26, 2.92 * Math.PI);\n this.arc.stroke({\n width: 8,\n color: arcColor,\n cap: \"round\"\n });\n this.arc.scale.set(-1, 1);\n this.container.scale.set(0.5, 0.5);\n this.bgContainer.addChild(this.bg);\n this.arcContainer.addChild(this.arc);\n this.bgContainer.addChild(this.arcContainer);\n this.container.addChild(this.bgContainer);\n this.addChild(this.container);\n Ease.getEase(this.container).ScaleTo(1, 400, TWEEN.Easing.Quadratic.InOut)\n .FadeIn(400, TWEEN.Easing.Quadratic.InOut)\n this.doAnims();\n\n this.animInterval = setInterval(() => {\n this.doAnims();\n }, 800);\n }\n\n public doAnims() {\n this.bgRotation += 90;\n Ease.getEase(this.bgContainer).createTween({value: this.bgContainer.angle},\n {value: this.bgRotation}, true, \"angle\", 600, TWEEN.Easing.Quadratic.InOut);\n }\n\n public getWidth() {\n return 100 * this.scale.x;\n }\n\n public getHeight() {\n return 100 * this.scale.y;\n }\n\n public draw(deltaTime: PIXI.Ticker) {\n this.arcContainer.angle += (3 * deltaTime.deltaTime);\n }\n\n public destroy(_options?: PIXI.DestroyOptions | boolean) {\n Ease.getEase(this.container).FadeOut(400, TWEEN.Easing.Quadratic.InOut)\n .ScaleTo(0.5, 400, TWEEN.Easing.Quadratic.InOut);\n setTimeout(() => {\n clearInterval(this.animInterval);\n super.destroy(_options);\n }, 400);\n }\n\n}\n","import * as PIXI from \"pixi.js\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../../../Util/TweenWrapper/Ease\";\nimport {OsuLogo} from \"../OsuLogo\";\nimport {Screen} from \"../../../../Screens/Screen\";\nimport {LogoTrackingContainer} from \"./LogoTrackingContainer\";\n\nexport class ButtonSystem extends PIXI.Container {\n\n private menuBG = new PIXI.Graphics();\n private isOpened = false;\n private logo: OsuLogo;\n private state = ButtonSystemState.Initial;\n private logoTrackingContainer = new LogoTrackingContainer();\n private readonly menuHeight = 150;\n\n private get State() {\n return this.state;\n }\n\n private set State(state: ButtonSystemState) {\n if (this.state == state) return;\n\n const lastState = this.state;\n this.state = state;\n\n this.updateLogoState(lastState);\n\n console.log(`${this.constructor.name}'s state changed from ${lastState} to ${state}`)\n }\n\n private updateLogoState(lastState = ButtonSystemState.Initial) {\n switch (this.state) {\n case ButtonSystemState.Exit:\n case ButtonSystemState.Initial:\n this.Close();\n break;\n case ButtonSystemState.TopLevel:\n case ButtonSystemState.Play:\n switch (lastState) {\n case ButtonSystemState.TopLevel: // coming from toplevel to play\n break;\n\n case ButtonSystemState.Initial:\n this.Open();\n Ease.getEase(this.logo).ClearEasings().ScaleTo(Screen.getScaleBasedOffScreenSize() * 0.5, 200, TWEEN.Easing.Linear.In);\n break;\n\n default:\n this.Open();\n Ease.getEase(this.logo).ClearEasings().ScaleTo(Screen.getScaleBasedOffScreenSize() * 0.5, 200, TWEEN.Easing.Quintic.Out);\n break;\n }\n break;\n }\n }\n\n public constructor(logo: OsuLogo) {\n super();\n this.logo = logo;\n this.drawMenuBG();\n this.scale.y = 0;\n this.alpha = 0;\n this.addChild(this.menuBG);\n this.addChild(this.logoTrackingContainer);\n this.logo.Action = () => {return this.onOsuLogo();};\n }\n\n private drawMenuBG() {\n this.menuBG.rect(0, Screen.getScaleBasedOffScreenSize() * -(this.menuHeight/2), 1, Screen.getScaleBasedOffScreenSize() * this.menuHeight);\n this.menuBG.fill({color: \"rgb(50,50,50)\"});\n }\n\n private onOsuLogo(): boolean {\n switch (this.state) {\n default:\n return false;\n\n case ButtonSystemState.Initial:\n this.State = ButtonSystemState.TopLevel;\n return true;\n\n case ButtonSystemState.TopLevel:\n\n return false;\n\n case ButtonSystemState.Play:\n\n return false;\n\n case ButtonSystemState.Edit:\n\n return false;\n }\n }\n\n private Open() {\n setTimeout(() => {\n this.isOpened = true;\n Ease.getEase(this).ScaleTo(1, 400, TWEEN.Easing.Quintic.Out)\n .FadeIn(400, TWEEN.Easing.Quintic.Out);\n }, 150);\n }\n\n private Close() {\n this.isOpened = false;\n Ease.getEase(this).ClearEasings().ScaleTo({x: 1, y: 0}, 300, TWEEN.Easing.Sinusoidal.In)\n .FadeOut(300, TWEEN.Easing.Sinusoidal.In);\n }\n\n public isOpen() {\n return this.isOpened;\n }\n\n public onResize() {\n this.menuBG.clear();\n this.drawMenuBG();\n this.position.set(0, window.innerHeight/2);\n this.menuBG.width = window.innerWidth;\n }\n}\n\nenum ButtonSystemState {\n Exit = \"Exit\",\n Initial = \"Initial\",\n TopLevel = \"TopLevel\",\n Play = \"Play\",\n Edit = \"Edit\",\n EnteringMode = \"EnteringMode\",\n}\n","import * as PIXI from \"pixi.js\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {OsuLogo} from \"../OsuLogo\";\n\nexport class LogoTrackingContainer extends PIXI.Container {\n protected Logo: OsuLogo | null = null;\n\n private easing!: (amount: number) => number;\n private startPosition: {x: number, y: number} | null = null;\n private startTime: number | null = null;\n private duration!: number;\n\n private readonly visual_box_size = 72;\n\n public StartTracking(logo: OsuLogo, duration: number = 0, easing: (amount: number) => number = TWEEN.Easing.Linear.None) {\n if (logo.IsTracking && this.Logo == null)\n throw new Error(\"Cannot track an instance of OsuLogo to multiple LogoTrackingContainers\");\n\n if (this.Logo != logo && this.Logo != null)\n {\n // If we're replacing the logo to be tracked, the old one no longer has a tracking container\n this.Logo.IsTracking = false;\n }\n\n this.Logo = logo;\n this.Logo.IsTracking = true;\n\n this.duration = duration;\n this.easing = easing;\n\n this.startTime = null;\n this.startPosition = null;\n }\n\n public StopTracking() {\n if (this.Logo != null)\n {\n this.Logo.IsTracking = false;\n this.Logo = null;\n }\n }\n\n protected ComputeLogoTrackingPosition() {\n let pos = this.Logo!.position;\n pos.x = window.innerWidth/3;\n return pos;\n }\n\n public Update() {\n if (this.Logo == null)\n return;\n }\n\n}\n","import * as PIXI from \"pixi.js\";\nimport {Triangles} from \"./Triangles\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../../Util/TweenWrapper/Ease\";\nimport {Main} from \"../../../main\";\nimport {Loader} from \"../../../Loader\";\nimport {ButtonSystem} from \"./Menu/ButtonSystem\";\nimport {MenuLogoVisualizer} from \"../../AudioVisualizers/impl/MenuLogoVisualizer\";\nimport {LogoVisualizer} from \"../../AudioVisualizers/LogoVisualizer\";\nimport {Effect} from \"../../../Util/Beatmap/Data/Sections/TimingPoints/Effect\";\nimport {UnInheritedTimingPoint} from \"../../../Util/Beatmap/Data/Sections/TimingPoints/UnInheritedTimingPoint\";\nimport {MathUtil} from \"../../../Util/MathUtil\";\n\nexport class OsuLogo extends PIXI.Container {\n\n private readonly outline: PIXI.Sprite;\n private readonly visualizer: MenuLogoVisualizer = new MenuLogoVisualizer();\n private readonly triangles: Triangles = new Triangles();\n private readonly flash;\n private readonly logoContainer = new PIXI.Container;\n private readonly logoBounceContainer = new PIXI.Container();\n private readonly logoBeatContainer = new PIXI.Container();\n private readonly logoAmplitudeContainer = new PIXI.Container();\n private readonly logoHoverContainer = new PIXI.Container();\n private readonly rippleContainer = new PIXI.Container();\n private readonly ripple;\n private readonly defaultVisualizerAlpha = 0.5;\n private readonly early_activation = 60;\n private timeElapsedSinceLastBeat = 0;\n private timeUntilNextBeat = 0;\n private lastTimeElapasedSinceLastBeat = 0;\n\n private selectSample = Loader.GetAudio(\"mainMenu.osuLogo.select\");\n private backToLogoSample = Loader.GetAudio(\"mainMenu.osuLogo.backToLogo\");\n\n private isMouseDown = false;\n private mouseDownPosition = {x: 0, y: 0};\n\n public Action: (() => boolean) | null = null;\n\n public IsTracking: boolean = false;\n\n public get SizeForFlow() {\n return this.outline.width * this.logoBounceContainer.scale.x * this.logoHoverContainer.scale.x;\n }\n\n\n public constructor() {\n super();\n this.visualizer.start();\n\n\n this.outline = PIXI.Sprite.from(\"mainMenu.logoOutline\");\n this.outline.anchor.set(0.5, 0.5);\n //approximation of size in actual osu!lazer\n let scale = 0.7;\n this.visualizer.scale.set(scale);\n this.visualizer.pivot.set(LogoVisualizer.size/2, LogoVisualizer.size/2);\n this.visualizer.alpha = this.defaultVisualizerAlpha;\n\n let mask = new PIXI.Graphics();\n mask.circle(0,0,450);\n mask.fill({color:\"white\"});\n mask.scale = scale;\n\n\n this.flash = PIXI.Sprite.from(\"mainMenu.logoMask\");\n this.flash.anchor.set(0.5, 0.5);\n this.flash.scale = scale;\n this.flash.blendMode = \"add\";\n this.flash.alpha = 0;\n\n this.triangles.flash.anchor.set(0.5, 0.5);\n this.triangles.flash.scale = scale;\n\n this.outline.scale.set(scale);\n this.triangles.scale.set(scale);\n this.triangles.position.set(-(this.outline.width / 2), -(this.outline.height / 2));\n this.triangles.mask = mask;\n\n this.ripple = PIXI.Sprite.from(\"mainMenu.logoMask\");\n this.ripple.anchor.set(0.5, 0.5);\n this.ripple.scale = scale;\n this.ripple.alpha = 0;\n this.ripple.blendMode = \"add\";\n\n this.rippleContainer.addChild(this.ripple);\n this.logoContainer.addChild(this.visualizer);\n this.logoContainer.addChild(this.triangles);\n this.logoContainer.addChild(this.triangles.flash);\n this.logoContainer.addChild(mask);\n this.logoContainer.addChild(this.flash);\n this.logoContainer.addChild(this.outline);\n this.logoContainer.hitArea = new PIXI.Circle(0, 0, 480 * scale);\n this.logoContainer.eventMode = \"static\";\n\n this.logoContainer.onmouseenter = this._onmouseenter;\n this.logoContainer.onmouseleave = this._onmouseleave;\n this.logoContainer.onmousedown = this._onmousedown;\n this.logoContainer.onclick = this._onclick;\n\n this.logoBeatContainer.addChild(this.logoContainer);\n this.logoAmplitudeContainer.addChild(this.logoBeatContainer);\n this.logoBounceContainer.addChild(this.rippleContainer);\n this.logoBounceContainer.addChild(this.logoAmplitudeContainer);\n this.logoHoverContainer.addChild(this.logoBounceContainer);\n this.addChild(this.logoHoverContainer)\n\n // register event listeners\n Main.app.stage.addEventListener(\"mouseup\", (e) => {\n this._onmouseup(e);\n });\n\n }\n\n\n public _onmouseenter = (e: PIXI.FederatedMouseEvent) => {\n Ease.getEase(this.logoHoverContainer).ScaleTo(1.1, 500, TWEEN.Easing.Elastic.Out);\n }\n\n public _onmouseleave = (e: PIXI.FederatedMouseEvent) => {\n Ease.getEase(this.logoHoverContainer).ScaleTo(1, 500, TWEEN.Easing.Elastic.Out);\n }\n\n public _onmousedown = (e: PIXI.FederatedMouseEvent) => {\n this.isMouseDown = true;\n Ease.getEase(this.logoBounceContainer).ClearEasings().ScaleTo(0.9, 1000, TWEEN.Easing.Sinusoidal.Out);\n this.mouseDownPosition = {x: Main.mousePos.x, y: Main.mousePos.y};\n }\n\n public _onclick = (e: PIXI.FederatedMouseEvent) => {\n this.flash.alpha = 0.4;\n Ease.getEase(this.flash).ClearEasings()\n .FadeOut(1500, TWEEN.Easing.Exponential.Out);\n if (this.Action) {\n if(this.Action()){\n Main.AudioEngine.PlayEffect(Loader.GetAudio(\"mainMenu.osuLogo.select\"));\n }\n }\n }\n\n public _onmouseup = (e: PIXI.FederatedMouseEvent) => {\n this.isMouseDown = false;\n Ease.getEase(this.logoBounceContainer).ClearEasings().ScaleTo(1, 500, TWEEN.Easing.Elastic.Out)\n .TransformTo({x: 0, y: 0}, 800, TWEEN.Easing.Elastic.Out);\n }\n\n public draw(ticker: PIXI.Ticker) {\n this.visualizer.draw(ticker);\n this.triangles.draw(ticker);\n //this.timeElapsedSinceLastBeat += ticker.deltaMS;\n let audio = Main.AudioEngine.GetCurrentPlayingMusic();\n let audioTime = audio.GetCurrentTime();\n let timingPoint = audio.beatmap.TimingPoints.GetCurrentUninheritedTimingPoint(audioTime);\n this.timeUntilNextBeat = (timingPoint.time - audioTime) % timingPoint.beatLength;\n if (this.timeUntilNextBeat <= 0) {\n this.timeUntilNextBeat += timingPoint.beatLength;\n }\n this.timeElapsedSinceLastBeat = timingPoint.beatLength - this.timeUntilNextBeat;\n if (!Main.AudioEngine.useSilentMusic) {\n let maxAmplitude = audio.GetMaximumAudioLevel();\n this.logoAmplitudeContainer.scale.set(MathUtil.Damp(this.logoAmplitudeContainer.scale.x,\n 1 - Math.max(0, maxAmplitude - 0.4) * 0.04, 0.9, ticker.deltaMS))\n this.triangles.Velocity = MathUtil.Damp(this.triangles.Velocity,\n 0.5 * (timingPoint.effects == Effect.KiaiTime ? 4 : 2), 0.995, ticker.deltaMS);\n } else {\n this.logoAmplitudeContainer.scale = 1;\n this.triangles.Velocity = MathUtil.Damp(this.triangles.Velocity, 0.5, 0.9, ticker.deltaMS);\n }\n if (this.lastTimeElapasedSinceLastBeat > this.timeElapsedSinceLastBeat) {\n this.onNewBeat();\n }\n\n this.lastTimeElapasedSinceLastBeat = this.timeElapsedSinceLastBeat;\n\n if (this.isMouseDown) {\n let change = {x: Main.mousePos.x - this.mouseDownPosition.x, y: Main.mousePos.y - this.mouseDownPosition.y};\n let length = Math.sqrt(change.x * change.x + change.y * change.y);\n // Diminish the drag distance as we go further to simulate \"rubber band\" feeling.\n change.x *= length <= 0 ? 0 : Math.pow(length, 0.6) / length;\n change.y *= length <= 0 ? 0 : Math.pow(length, 0.6) / length;\n this.logoBounceContainer.x = change.x;\n this.logoBounceContainer.y = change.y;\n }\n\n\n }\n\n private onNewBeat() {\n let audio = Main.AudioEngine.GetCurrentPlayingMusic();\n let audioTime = audio.GetCurrentTime();\n let timingPointUninherited = audio.beatmap.TimingPoints.GetCurrentUninheritedTimingPoint(audioTime);\n let beatLength = timingPointUninherited.beatLength;\n let timingPoint = audio.beatmap.TimingPoints.GetCurrentTimingPoints(audioTime)[0];\n let maxAmplitude = !Main.AudioEngine.useSilentMusic ? audio.GetMaximumAudioLevel() : 0;\n let amplitudeAdjust = Math.min(1, 0.2 + maxAmplitude);\n Ease.getEase(this.logoBeatContainer).ScaleTo(1 - 0.02 * amplitudeAdjust, this.early_activation, TWEEN.Easing.Linear.None).Then()\n .ScaleTo(1, beatLength * 2, TWEEN.Easing.Quintic.Out);\n this.rippleContainer.scale = 1.02;\n Ease.getEase(this.rippleContainer).ClearEasings().ScaleTo(1.02 * (1 + 0.04 * amplitudeAdjust), beatLength, TWEEN.Easing.Quintic.Out);\n this.ripple.alpha = 0.15 * amplitudeAdjust;\n Ease.getEase(this.ripple).ClearEasings().FadeOut(beatLength, TWEEN.Easing.Quintic.Out);\n\n\n if (timingPoint.effects == Effect.KiaiTime) {\n Ease.getEase(this.triangles.flash).ClearEasings()\n .FadeTo(0.2 * amplitudeAdjust, this.early_activation, TWEEN.Easing.Linear.None).Then()\n .FadeTo(0, beatLength, TWEEN.Easing.Linear.None);\n Ease.getEase(this.visualizer).ClearEasings()\n .FadeTo(this.defaultVisualizerAlpha * 1.8 * amplitudeAdjust, this.early_activation, TWEEN.Easing.Linear.None).Then()\n .FadeTo(this.defaultVisualizerAlpha, beatLength, TWEEN.Easing.Linear.None);\n }\n setTimeout(() => {\n this.triangles.Velocity += amplitudeAdjust * (timingPoint.effects == Effect.KiaiTime ? 6 : 3);\n }, 60)\n\n }\n\n}\n","import * as PIXI from \"pixi.js\";\nimport {Main} from \"../../../main\";\nimport glVertShader from \"./osuCircleTriangles.vert\";\nimport glFragShader from \"./osuCircleTriangles.frag\";\nimport gpuShader from \"./osuCircleTriangles.wgsl\";\n\nexport class Triangles extends PIXI.Container {\n\n public flash: PIXI.Sprite;\n public Velocity: number = 1;\n private readonly bgGradient: PIXI.FillGradient;\n private triangles: Triangle[] = [];\n private graphics: PIXI.Graphics = new PIXI.Graphics();\n private timeSinceLastSpawn = 0;\n private instancePositionBuffer;\n private readonly totalTriangles = 15;\n\n public constructor() {\n super();\n\n let colorStops = [0xff66ab, 0xcc5289];\n this.bgGradient = new PIXI.FillGradient(0, 0, 0, 1024);\n colorStops.forEach((number, index) => {\n const ratio = index / colorStops.length;\n this.bgGradient.addColorStop(ratio, number);\n });\n\n for (let i = 0; i < this.totalTriangles; i++) {\n this.triangles.push({x: this.random(0, 1024), y: this.random(0, 1024), velocity: this.randVelocity()});\n }\n this.timeSinceLastSpawn = Date.now();\n\n this.graphics.rect(0, 0, 1024, 1024);\n this.graphics.fill(this.bgGradient);\n this.addChild(this.graphics);\n\n this.flash = PIXI.Sprite.from(\"mainMenu.logoMask\");\n //this.flash.anchor.set(0.5, 0.5);\n this.flash.alpha = 0;\n this.flash.blendMode = \"add\";\n\n this.instancePositionBuffer = new PIXI.Buffer({\n data: new Float32Array(this.totalTriangles * 2),\n usage: PIXI.BufferUsage.VERTEX | PIXI.BufferUsage.COPY_DST\n });\n const color = new PIXI.Color(\"rgb(182, 52, 111)\");\n const size = 30;\n const geometry = new PIXI.Geometry({\n attributes: {\n aPosition: [\n -10*size,\n -10*size, // x, y\n 10*size,\n -10*size, // x, y\n 10*size,\n 7.5*size, // x, y,\n -10*size,\n 7.5*size, // x, y,\n ],\n aUV: [0, 0, 1, 0, 1, 1, 0, 1],\n aColorTint: [\n color.red, color.green, color.blue, 1,\n color.red, color.green, color.blue, 1,\n color.red, color.green, color.blue, 1,\n color.red, color.green, color.blue, 1\n ],\n aPositionOffset: {\n buffer: this.instancePositionBuffer,\n instance: true\n }\n },\n indexBuffer: [0, 1, 2, 0, 2, 3],\n instanceCount: this.totalTriangles\n });\n const gl = {\n vertex: glVertShader,\n fragment: glFragShader\n };\n\n const gpu = {\n vertex: {\n entryPoint: \"mainVert\",\n source: gpuShader\n },\n fragment: {\n entryPoint: \"mainFrag\",\n source: gpuShader\n }\n };\n\n const triangleGraphic = new PIXI.Graphics();\n triangleGraphic.moveTo(0, 0);\n triangleGraphic.lineTo(-256, 512);\n triangleGraphic.lineTo(256, 512);\n triangleGraphic.lineTo(0, 0);\n triangleGraphic.stroke({color: \"white\", width: 4});\n\n const triangleTexture = Main.app.renderer.generateTexture(triangleGraphic);\n\n const shader = PIXI.Shader.from({\n gl,\n gpu,\n resources: {\n uTexture: triangleTexture.source,\n uSampler: triangleTexture.source.style,\n waveUniforms: {\n time: { value: 1, type: \"f32\" }\n }\n }\n });\n\n const triangleMesh = new PIXI.Mesh({\n geometry,\n shader\n });\n\n this.addChild(triangleMesh);\n\n\n\n }\n\n public destroy(options?: PIXI.DestroyOptions) {\n super.destroy(options);\n }\n\n public draw(ticker: PIXI.Ticker) {\n const data = this.instancePositionBuffer.data;\n let count = 0;\n\n for (let i = 0; i < this.totalTriangles; i++) {\n const triangle = this.triangles[i];\n\n triangle.y -= ((ticker.deltaTime * this.Velocity * triangle.velocity)*1.2);\n\n if (triangle.y + 100 < 0) {\n triangle.y = 1024 + 250;\n }\n\n data[count++] = triangle.x;\n data[count++] = triangle.y;\n }\n\n this.instancePositionBuffer.update();\n }\n\n private random(min: number, max: number) {\n return Math.random() * (max - min) + min;\n }\n\n private randVelocity() {\n let u1 = 1 - this.random(0, 1);\n let u2 = 1 - this.random(0, 1);\n let randStdNormal = (Math.sqrt(-2.0 * Math.log(u1)) * Math.sin(2.0 * Math.PI * u2));\n return Math.max(0.5 + 0.16 * randStdNormal, 0.1);\n }\n}\n\nexport interface Triangle {\n x: number;\n y: number;\n velocity: number;\n}\n","import * as PIXI from \"pixi.js\";\nimport {Main} from \"../../main\";\nimport {Loader} from \"../../Loader\";\nimport {MathUtil} from \"../../Util/MathUtil\";\nimport {Screen} from \"../../Screens/Screen\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\n\nexport class MenuCursor extends PIXI.Container {\n private mouseCursor = PIXI.Sprite.from(\"menu.cursor\");\n private mouseCursorAdditive = PIXI.Sprite.from(\"menu.cursor.additive\");\n private mouseContainer = new PIXI.Container();\n private animContainer = new PIXI.Container();\n private animRotationContainer = new PIXI.Container();\n private dragRotationState: DragRotationState = DragRotationState.NotDragging;\n private lastDragRotationState: DragRotationState = DragRotationState.NotDragging;\n private mouseHideContainer = new PIXI.Container();\n private readonly elastic_const2 = 0.075;\n private readonly elastic_const = 20.943951023931955;\n private readonly elastic_offset_quarter = Math.pow(2, -10) * Math.sin((.25 - this.elastic_const2) * this.elastic_const);\n\n private posMouseDown: { x: number, y: number } = {x: 0, y: 0};\n\n private mouseIsDown = false;\n\n private cursorTapSample = Loader.GetAudio(\"menu.cursor.sample.tap\");\n\n private mouseButtonClicked: number = -9999;\n\n public constructor(visible: boolean) {\n super();\n this.updateMouse();\n this.mouseContainer.scale.set(0.07 * Screen.getScaleBasedOffScreenSize());\n this.mouseCursorAdditive.alpha = 0;\n this.mouseCursorAdditive.blendMode = \"add\";\n this.mouseCursorAdditive.tint = \"0xFF66AA\"\n this.mouseContainer.addChild(this.mouseCursor);\n this.mouseContainer.addChild(this.mouseCursorAdditive);\n this.animContainer.addChild(this.mouseContainer);\n this.animRotationContainer.addChild(this.animContainer);\n this.mouseHideContainer.addChild(this.animRotationContainer);\n this.addChild(this.mouseHideContainer);\n if (!visible) {\n this.mouseHideContainer.scale.set(0.6);\n this.mouseHideContainer.alpha = 0;\n this.animRotationContainer.angle = 0;\n }\n this.zIndex = 999999;\n this.eventMode = \"none\";\n Main.app.stage.addChild(this);\n this.addEventListeners();\n }\n\n public addEventListeners() {\n Main.app.stage.addEventListener(\"mousedown\", (e) => {\n this.mouseButtonClicked = e.button;\n if (this.visible) {\n this.posMouseDown = {x: Main.mousePos.x, y: Main.mousePos.y};\n this.mouseIsDown = true;\n this.dragRotationState = DragRotationState.DragStarted;\n Ease.getEase(this.animContainer).ClearEasings().ScaleTo(0.9, 800, TWEEN.Easing.Quintic.Out);\n Ease.getEase(this.mouseCursorAdditive).ClearEasings().FadeIn(800, TWEEN.Easing.Quintic.Out);\n Main.AudioEngine.PlayEffect(this.cursorTapSample);\n }\n });\n Main.app.stage.addEventListener(\"mouseup\", (e) => {\n if (this.visible && e.button == this.mouseButtonClicked) {\n this.mouseIsDown = false;\n Ease.getEase(this.animContainer).ClearEasings().ScaleTo(1, 500, TWEEN.Easing.Elastic.Out);\n Ease.getEase(this.mouseCursorAdditive).ClearEasings().FadeOut(500, TWEEN.Easing.Quintic.Out);\n if (this.dragRotationState != DragRotationState.NotDragging) {\n if (this.dragRotationState == DragRotationState.Rotating) {\n Ease.getEase(this.animRotationContainer).ClearEasings().createTween({value: this.animRotationContainer.angle},\n {value: 0}, true, \"angle\", 800 * (0.5 + Math.abs(this.animRotationContainer.angle / 960)), (time: number) => {\n return Math.pow(2, -10 * time) * \n Math.sin((.25 * time - this.elastic_const2) * this.elastic_const) + 1 - this.elastic_offset_quarter * time;\n });\n }\n this.dragRotationState = DragRotationState.NotDragging;\n }\n Main.AudioEngine.PlayEffect(this.cursorTapSample, 0.8);\n }\n });\n }\n\n public PopIn() {\n Ease.getEase(this.animRotationContainer).ClearEasings();\n this.visible = true;\n Ease.getEase(this.mouseHideContainer).ClearEasings().FadeIn(250, TWEEN.Easing.Quintic.Out)\n .ScaleTo(1, 400, TWEEN.Easing.Quintic.Out);\n this.dragRotationState = DragRotationState.NotDragging\n }\n\n public PopOut() {\n Ease.getEase(this.mouseHideContainer).ClearEasings().FadeOut(250, TWEEN.Easing.Quintic.Out)\n .ScaleTo(0.6, 250, TWEEN.Easing.Quintic.Out);\n Ease.getEase(this.animRotationContainer).ClearEasings().createTween({value: this.animRotationContainer.angle},\n {value: 0}, true, \"angle\", 400, TWEEN.Easing.Quintic.Out);\n this.dragRotationState = DragRotationState.NotDragging;\n }\n\n public updateMouse() {\n this.mouseContainer.scale.set(0.07 * Screen.getScaleBasedOffScreenSize());\n this.position.set(Main.mousePos.x, Main.mousePos.y);\n if (this.dragRotationState != DragRotationState.NotDragging && this.visible) {\n let distance = Math.sqrt((((Math.abs(this.posMouseDown.x - Main.mousePos.x)) ^ 2) +\n ((Math.abs(this.posMouseDown.y - Main.mousePos.y)) ^ 2)));\n if (this.dragRotationState == DragRotationState.DragStarted && distance > 15) {\n this.dragRotationState = DragRotationState.Rotating;\n if (this.lastDragRotationState != this.dragRotationState) {\n this.posMouseDown = {x: Main.mousePos.x, y: Main.mousePos.y};\n }\n }\n\n if (this.dragRotationState == DragRotationState.Rotating && distance > 0) {\n let offsetX = Main.mousePos.x - this.posMouseDown.x;\n let offsetY = Main.mousePos.y - this.posMouseDown.y;\n let degrees = MathUtil.RadiansToDegrees(Math.atan2(-offsetX, offsetY)) + 24.3;\n\n let diff = (degrees - this.animRotationContainer.angle) % 360;\n if (diff < -180) {\n diff += 360;\n }\n if (diff > 180) {\n diff -= 360;\n }\n degrees = this.animRotationContainer.angle + diff;\n this.animRotationContainer.angle = degrees\n Ease.getEase(this.animRotationContainer).createTween({value: this.animRotationContainer.angle},\n {value: degrees}, true, \"angle\", 120, TWEEN.Easing.Quintic.Out);\n }\n }\n this.lastDragRotationState = this.dragRotationState;\n\n }\n\n\n}\n\nenum DragRotationState {\n NotDragging,\n DragStarted,\n Rotating\n}\n","import * as PIXI from \"pixi.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {DestroyOptions} from \"pixi.js\";\n\nexport class Background extends PIXI.Sprite {\n public static readonly fadeOutDuration = 800;\n public destroying = false;\n\n public constructor(texture: PIXI.Texture) {\n super();\n this.texture = texture;\n this.visible = false;\n this.anchor.set(0.5, 0.5);\n\n }\n\n public show() {\n this.visible = true;\n }\n\n public destroy(options?: PIXI.DestroyOptions) {\n this.destroying = true;\n Ease.getEase(this).FadeOut(Background.fadeOutDuration, TWEEN.Easing.Linear.None).Then(() => {\n this.visible = false;\n super.destroy(options);\n this.destroying = false;\n });\n this.zIndex = 1;\n }\n}\n\nexport class BackgroundContainer extends PIXI.Container {\n public constructor() {\n super();\n this.visible = false;\n }\n\n public show() {\n this.visible = true;\n for (let i = 0; i < this.children?.length; i++) {\n let child = this.children[i];\n if (child instanceof Background) {\n child.show();\n }\n }\n }\n\n public destroy(options?: DestroyOptions) {\n for (let i = 0; i < this.children?.length; i++) {\n let child = this.children[i];\n if (child instanceof Background) {\n if (!child.destroyed && !child.destroying) {\n child.destroy(options);\n }\n }\n }\n setTimeout(() => {\n super.destroy(options);\n }, Background.fadeOutDuration);\n this.zIndex = 1;\n }\n\n\n}","import * as PIXI from \"pixi.js\";\nimport {Loader} from \"../../Loader\";\nimport {Screen} from \"../../Screens/Screen\";\nimport {Main} from \"../../main\";\nimport {Background, BackgroundContainer} from \"./Background\";\nimport {EventTypes} from \"../../Util/Beatmap/Data/Sections/Events/EventTypes\";\nimport {EventVideo} from \"../../Util/Beatmap/Data/Sections/Events/EventVideo\";\nimport {EventBackground} from \"../../Util/Beatmap/Data/Sections/Events/EventBackground\";\n\nexport class RandomBackground extends Screen {\n\n private bgContainer = new PIXI.Container;\n\n private readonly parallaxMultiplier = 60;\n\n public start() {\n this.bgContainer.pivot.set(0.5, 0.5);\n this.bgContainer.position.set((Main.mousePos.x - (this.getScreenWidth() / 2)) / this.parallaxMultiplier,\n (Main.mousePos.y - (this.getScreenHeight() / 2)) / this.parallaxMultiplier);\n this.addChild(this.bgContainer);\n this.newRandomBG();\n Main.AudioEngine.addMusicChangeEventListener((audio) => {\n let background = audio.beatmap.Events.Events.find((e) => {\n if (e.eventType == EventTypes.BACKGROUND){\n return e;\n }\n }) as EventBackground;\n\n let backgroundVideo = audio.beatmap.Events.Events.find((e) => {\n if (e.eventType == EventTypes.VIDEO){\n return e;\n }\n }) as EventVideo;\n\n let bgContainer = new BackgroundContainer();\n\n if (background) {\n if (background.texture) {\n bgContainer.addChild(new Background(background.texture));\n }\n }\n if (backgroundVideo) {\n if (backgroundVideo.texture) {\n let video = backgroundVideo.texture.source.resource as HTMLVideoElement;\n let bg = new Background(backgroundVideo.texture);\n bgContainer.addChild(bg);\n backgroundVideo.texture.source.resource.startPromise = new Promise((resolve) => {\n if (backgroundVideo.startTime > 0) {\n setTimeout(() => {\n video.play();\n resolve();\n }, backgroundVideo.startTime);\n } else {\n video.currentTime = Math.abs(backgroundVideo.startTime)/1000;\n video.play();\n resolve();\n }\n });\n video.onended = () => {\n bg.destroy();\n }\n }\n }\n if (background || backgroundVideo) {\n this.setBGContainer(bgContainer);\n }\n if (!background && !backgroundVideo) {\n this.newRandomBG();\n }\n });\n this.zIndex = -100;\n }\n\n public setBG(texture: PIXI.Texture) {\n let bgSprite = new Background(texture);\n this.bgContainer.addChild(bgSprite);\n bgSprite.show();\n if (this.bgContainer.children?.length == 0) {\n } else {\n let previous = this.bgContainer.children[0] as Background;\n previous.destroy();\n }\n this.onResize();\n }\n\n public setBGContainer(container: BackgroundContainer) {\n this.bgContainer.addChild(container);\n container.show();\n if (this.bgContainer.children?.length == 0) {\n } else {\n let previous = this.bgContainer.children[0] as Background;\n previous.destroy();\n }\n this.onResize();\n }\n\n public newRandomBG() {\n function random(min: number, max: number) {\n return Math.round(Math.random() * (max - min) + min);\n }\n\n let useSeasonalBackgrounds = Loader.seasonalBackgroundsNum > 0;\n let randomNum = random(1, useSeasonalBackgrounds ? Loader.seasonalBackgroundsNum : Loader.defaultBackgroundsNum);\n this.setBG(PIXI.Texture.from((useSeasonalBackgrounds ? \"seasonal_bg\" : \"default_bg\") + randomNum));\n }\n\n public draw(deltaTime: PIXI.Ticker) {\n this.bgContainer.position.set((Main.mousePos.x - (this.getScreenWidth() / 2)) / this.parallaxMultiplier,\n (Main.mousePos.y - (this.getScreenHeight() / 2)) / this.parallaxMultiplier);\n }\n\n public onClose(): Promise {\n return Promise.resolve(this);\n }\n\n public onResize() {\n this.bgContainer.children.forEach((sprite) => {\n if (sprite instanceof BackgroundContainer) {\n sprite.children?.forEach((sprite) => {\n if (sprite instanceof Background) {\n this.resizeSprite(sprite);\n }\n });\n }\n if (sprite instanceof Background) {\n this.resizeSprite(sprite)\n }\n });\n }\n\n private resizeSprite(sprite: Background) {\n let texWidth = sprite.texture.width;\n let texHeight = sprite.texture.height;\n\n let scaleFactor: number;\n if (window.innerWidth > window.innerHeight) {\n scaleFactor = window.innerWidth / texWidth;\n } else {\n scaleFactor = window.innerHeight / texHeight;\n }\n\n if (texHeight * scaleFactor < window.innerHeight) {\n scaleFactor = window.innerHeight / texHeight;\n } else if (texWidth * scaleFactor < window.innerWidth) {\n\n }\n\n sprite.scale.set(scaleFactor + 0.05);\n sprite.position.set((this.getScreenWidth() / 2) - (this.getScreenWidth() / (this.parallaxMultiplier * 2)),\n this.getScreenHeight() / 2 - (this.getScreenHeight() / (this.parallaxMultiplier * 2)));\n }\n}\n","import * as PIXI from \"pixi.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Screen} from \"../../Screens/Screen\";\n\nexport class SettingsPane extends PIXI.Container {\n private bg: PIXI.Graphics = new PIXI.Graphics();\n private isOpen = false;\n\n public constructor() {\n super();\n this.bg.rect(0, 0, 1, 1);\n this.bg.fill({color: \"rgb(20,20,20)\"});\n this.addChild(this.bg);\n this.resize();\n }\n\n public open() {\n Ease.getEase(this).TransformTo({x: 0, y: 0}, 400, TWEEN.Easing.Cubic.Out);\n this.isOpen = true;\n }\n\n public toggle() {\n if (this.isOpen) {this.close()} else {this.open()}\n }\n\n public close() {\n Ease.getEase(this).TransformTo({x: -this.getWidth(), y: 0}, 400, TWEEN.Easing.Cubic.Out);\n this.isOpen = false;\n }\n\n private getWidth() {\n return 500 * Screen.getScaleBasedOffScreenSize();\n }\n\n public resize() {\n this.width = this.getWidth();\n this.height = window.innerHeight;\n this.x = this.isOpen ? 0 : -this.getWidth();\n this.y = 0;\n }\n}","import * as PIXI from \"pixi.js\";\n\nexport class Loader {\n private static loadList: LoaderObject[] = [];\n private static loadedList: LoadedObject[] = [];\n public static readonly defaultBackgroundsNum = 8;\n public static seasonalBackgroundsNum: number = 0;\n\n private static addToLoadList() {\n // intro and interaction screen\n this.loadList.push({id: \"introTrianglesTrack\", url: \"assets/osu-assets/osu.Game.Resources/Tracks/triangles.osz\"});\n this.loadList.push({id: \"sample_dialog_ok\", url: \"assets/osu-assets/osu.Game.Resources/Samples/UI/dialog-ok-select.wav\", isAudio: true});\n this.loadList.push({id: \"TorusRegular\", url: \"assets/fonts/TorusRegular.otf\", pixiBundleName: \"fonts\"});\n this.loadList.push({id: \"TorusLight\", url: \"assets/fonts/TorusLight.otf\", pixiBundleName: \"fonts\"});\n this.loadList.push({id: \"TorusThin\", url: \"assets/fonts/TorusThin.otf\", pixiBundleName: \"fonts\"});\n this.loadList.push({id: \"icon_ruleset_std\", url: \"assets/icons/ruleset-standard.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"icon_ruleset_mania\", url: \"assets/icons/ruleset-mania.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"icon_ruleset_taiko\", url: \"assets/icons/ruleset-taiko.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"icon_ruleset_ctb\", url: \"assets/icons/ruleset-ctb.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"intro_triangles_osuLogo_anim_highlight\",\n url: \"assets/osu-assets/osu.Game.Resources/Textures/Intro/Triangles/logo-highlight.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"intro_triangles_osuLogo_anim_background\",\n url: \"assets/osu-assets/osu.Game.Resources/Textures/Intro/Triangles/logo-background.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"mainMenu.logoOutline\", url: \"assets/osu-assets/osu.Game.Resources/Textures/Menu/logo.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"mainMenu.logoMask\", url: \"assets/menu/logo-mask.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"mainMenu.osuLogo.select\", url: \"assets/osu-assets/osu.Game.Resources/Samples/Menu/osu-logo-select.wav\", isAudio: true});\n this.loadList.push({id: \"mainMenu.osuLogo.backToLogo\", url: \"assets/osu-assets/osu.Game.Resources/Samples/Menu/back-to-logo.wav\", isAudio: true});\n this.loadList.push({id: \"menu.cursor\", url: \"assets/osu-assets/osu.Game.Resources/Textures/Cursor/menu-cursor.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"menu.cursor.additive\", url: \"assets/osu-assets/osu.Game.Resources/Textures/Cursor/menu-cursor-additive.png\",\n pixiBundleName: \"textures\"});\n this.loadList.push({id: \"menu.cursor.sample.tap\", url: \"assets/osu-assets/osu.Game.Resources/Samples/UI/cursor-tap.wav\", isAudio: true});\n this.loadList.push({id: \"menu.kiaiFountains.star\", url: \"assets/osu-assets/osu.Game.Resources/Textures/Menu/fountain-star.png\", pixiBundleName: \"textures\"});\n this.loadList.push({id: \"workers.ffmpeg\", url: \"assets/workers/814.ffmpeg.js\"});\n this.loadList.push({id: \"ffmpeg.core\", url: \"https://unpkg.com/@ffmpeg/core-mt@0.12.6/dist/esm/ffmpeg-core.js\"});\n this.loadList.push({id: \"ffmpeg.wasm\", url: \"https://unpkg.com/@ffmpeg/core-mt@0.12.6/dist/esm/ffmpeg-core.wasm\"});\n this.loadList.push({id: \"ffmpeg.coreWorker\", url: \"https://unpkg.com/@ffmpeg/core-mt@0.12.6/dist/esm/ffmpeg-core.worker.js\"});\n }\n\n public static Get(id: string): Blob {\n let result;\n this.loadedList.forEach((loadedObj) => {\n if (loadedObj.id == id){\n result = loadedObj.data;\n }\n });\n if (!result){\n throw new Error(\"Asset not found!\");\n }\n return result;\n }\n\n public static GetString(id: string): string {\n let result;\n this.loadedList.forEach((loadedObj) => {\n if (loadedObj.id == id){\n result = loadedObj.dataString;\n }\n });\n if (!result){\n throw new Error(\"Asset not found or is not a string!\");\n }\n return result;\n }\n\n public static GetAudio(id: string): AudioBuffer {\n let result;\n this.loadedList.forEach((loadedObj) => {\n if (loadedObj.id == id){\n result = loadedObj.dataAudio;\n }\n });\n if (!result){\n throw new Error(\"Asset not found or was not marked as audio during loading!\");\n }\n return result;\n }\n\n private static addBackgrounds() {\n return new Promise(resolve => {\n for (let i = 1; i < this.defaultBackgroundsNum + 1; i++) {\n this.loadList.push({id: \"default_bg\"+i, url: \"assets/osu-assets/osu.Game.Resources/Textures/Menu/menu-background-\"+i+\".jpg\", pixiBundleName: \"textures\"});\n }\n fetch(\"https://corsproxy.io/?\"+ encodeURIComponent(\"https://osu.ppy.sh/api/v2/seasonal-backgrounds\"))\n .then(res => res.json()).then(res => {\n res.backgrounds.forEach((background: any, index: number) => {\n this.loadList.push({id: \"seasonal_bg\"+(index+1), url: \"https://corsproxy.io/?\"+ encodeURIComponent(background.url),\n pixiBundleName: \"textures\", loadParser: \"loadTextures\"});\n this.seasonalBackgroundsNum = index+1;\n });\n resolve();\n }).catch(error => {\n console.warn(\"Could not fetch seasonal backgrounds.\", error);\n resolve();\n });\n });\n }\n\n public static Load(audioContext: AudioContext) {\n this.addToLoadList();\n return new Promise((resolve) => {\n this.addBackgrounds().then(() => {\n let nonPixi: LoaderObject[] = [];\n let pixi: LoaderObject[] = [];\n let pixiwithBundles: LoaderObject[][] = [];\n\n let loadedAssets: number = 0;\n let erroredAssets: number = 0;\n\n this.loadList.forEach((loadObj) => {\n if (loadObj.pixiBundleName){\n pixi.push(loadObj);\n }\n else {\n nonPixi.push(loadObj);\n }\n });\n\n pixi.forEach((loadObj) => {\n let added = false;\n pixiwithBundles.forEach((loadObjs) => {\n if (loadObjs.length > 0){\n if (loadObjs[0].pixiBundleName == loadObj.pixiBundleName){\n loadObjs.push(loadObj);\n added = true;\n }\n }\n });\n if (!added){\n pixiwithBundles.push([loadObj]);\n }\n });\n\n const incrementLoadAssetNumber = (errored?: boolean) => {\n if (errored){\n erroredAssets++;\n }\n else {\n loadedAssets++;\n }\n\n if (erroredAssets + loadedAssets >= this.loadList.length){\n resolve();\n }\n }\n\n nonPixi.forEach((loadObj) => {\n fetch(loadObj.url)\n .then(response => response.blob())\n .then((response) => {\n if (!loadObj.isText && !loadObj.isAudio){\n incrementLoadAssetNumber();\n this.loadedList.push({id: loadObj.id, data: response});\n }\n else if (loadObj.isText) {\n response.text().then((text) => {\n incrementLoadAssetNumber();\n this.loadedList.push({id: loadObj.id, data: response, dataString: text});\n });\n }\n else if (loadObj.isAudio){\n response.arrayBuffer().then(arrBuff => audioContext.decodeAudioData(arrBuff))\n .then((audioBuff) => {\n incrementLoadAssetNumber();\n this.loadedList.push({id: loadObj.id, data: response, dataAudio: audioBuff});\n });\n }\n\n })\n .catch((error) => {\n incrementLoadAssetNumber(true);\n console.warn(\"Asset '\"+loadObj.id+\"' failed to load: \"+error);\n });\n });\n\n pixiwithBundles.forEach((bundle) => {\n if (bundle.length > 0){\n if (!bundle[0].pixiBundleName){\n throw new Error(\"wtf????\");\n }\n let assets: PIXI.UnresolvedAsset[] = [];\n bundle.forEach((loadObj) => {\n if (loadObj.loadParser){\n assets.push({alias: loadObj.id, src: loadObj.url, loadParser: loadObj.loadParser});\n }\n else {\n assets.push({alias: loadObj.id, src: loadObj.url});\n }\n\n });\n PIXI.Assets.addBundle(bundle[0].pixiBundleName, assets);\n PIXI.Assets.loadBundle(bundle[0].pixiBundleName).then(() => {\n bundle.forEach(() => {\n incrementLoadAssetNumber();\n });\n });\n }\n\n })\n });\n });\n }\n}\n\ninterface LoaderObject {\n id: string;\n url: string;\n pixiBundleName?: string;\n isText?: boolean;\n isAudio?: boolean;\n loadParser?: PIXI.LoadParserName;\n}\n\ninterface LoadedObject {\n id: string;\n data: Blob;\n dataString?: string;\n dataAudio?: AudioBuffer;\n}\n","import {Screen} from \"../Screen\";\nimport * as PIXI from \"pixi.js\";\nimport {Ticker} from \"pixi.js\";\nimport {Main} from \"../../main\";\nimport {IntroScreen} from \"../IntroScreen/IntroScreen\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\n\nexport class InteractScreen extends Screen {\n\n private readonly text: PIXI.Text;\n private readonly text2: PIXI.Text;\n private readonly textContainer = new PIXI.Container();\n private readonly textContainerContainer = new PIXI.Container();\n\n private readonly introTrack: Blob;\n private clickSound: AudioBuffer;\n\n private readonly clickArea: PIXI.Graphics = new PIXI.Graphics();\n\n public constructor(introTrack: Blob, clickSound: AudioBuffer) {\n super();\n this.introTrack = introTrack;\n this.clickSound = clickSound;\n\n this.text = new PIXI.Text({\n text: \"Click anywhere to play!\",\n style: {\n fontFamily: 'TorusRegular',\n fontSize: 36,\n fill: \"white\"\n }\n });\n this.text2 = new PIXI.Text({\n text: \"(this is for enabling audio because it's required by web-browsers\\n to have interaction on this webpage before playing audio.)\",\n style: {\n fontFamily: 'TorusRegular',\n fontSize: 26,\n fill: \"gray\",\n align: \"center\"\n }\n });\n }\n\n public start() {\n this.text.anchor.set(0.5, 0.5);\n this.text2.anchor.set(0.5, 0.5);\n this.text2.position.set(0, this.text.height + 15);\n this.textContainer.addChild(this.text);\n this.textContainer.addChild(this.text2);\n this.textContainer.scale.set(0.5);\n this.textContainer.alpha = 0;\n this.textContainerContainer.addChild(this.textContainer);\n this.textContainerContainer.scale = Screen.getScaleBasedOffScreenSize();\n this.textContainerContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.addChild(this.textContainerContainer);\n\n this.clickArea.rect(0, 0, 1, 1);\n this.clickArea.fill(\"rgba(0,0,0,0)\");\n this.clickArea.width = this.getScreenWidth();\n this.clickArea.height = this.getScreenHeight();\n this.clickArea.position.set(0, 0);\n this.addChild(this.clickArea);\n\n this.clickArea.eventMode = \"static\";\n this.clickArea.cursor = \"pointer\";\n\n const clicked = () => {\n this.clickArea.eventMode = \"none\";\n Main.AudioEngine.PlayEffect(this.clickSound);\n Main.switchScreen(new IntroScreen(this.introTrack));\n document.body.style.cursor = \"none\";\n Main.pointerLock();\n Main.lockKeyboard();\n }\n\n this.clickArea.onclick = () => {\n clicked();\n\n }\n this.clickArea.ontap = () => {\n clicked();\n }\n Ease.getEase(this.textContainer).FadeIn(400, TWEEN.Easing.Quadratic.Out)\n .ScaleTo(1, 400, TWEEN.Easing.Quadratic.Out);\n }\n\n public onClose(): Promise {\n return new Promise((resolve) => {\n Ease.getEase(this.textContainer).FadeOut(200, TWEEN.Easing.Quadratic.Out)\n .ScaleTo(0.5, 200, TWEEN.Easing.Quadratic.InOut);\n setTimeout(() => {\n resolve(this);\n }, 200);\n });\n }\n\n public draw(deltaTime: Ticker) {\n\n }\n\n public onResize() {\n this.textContainerContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.clickArea.width = this.getScreenWidth();\n this.clickArea.height = this.getScreenHeight();\n this.clickArea.position.set(0, 0);\n this.textContainerContainer.scale = Screen.getScaleBasedOffScreenSize();\n }\n}\n","import * as PIXI from \"pixi.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\n\nexport class GlitchingTriangles extends PIXI.Container {\n public constructor(bounds: GlitchingTrianglesBounds) {\n super();\n let triangle = new PIXI.Graphics();\n let scale = random(0.2, 1.2);\n triangle.moveTo(0, 0);\n triangle.lineTo(-50 * scale, 100 * scale);\n triangle.lineTo(50 * scale, 100 * scale);\n triangle.lineTo(0, 0);\n if (Math.random() < 0.5) {\n triangle.fill(\"white\");\n } else {\n triangle.stroke({color: \"white\", width: 1});\n }\n\n //triangle.anchor.set(0.5, 0.5)\n function random(min: number, max: number) {\n return Math.random() * (max - min) + min;\n }\n\n let randX = random(bounds.x1, bounds.x2);\n let randY = random(bounds.y1, bounds.y2);\n\n triangle.position.set(randX, randY);\n\n Ease.getEase(triangle, true).FadeOut(200, TWEEN.Easing.Linear.None);\n setTimeout(() => {\n this.destroy();\n }, 200);\n\n this.addChild(triangle);\n }\n\n}\n\nexport interface GlitchingTrianglesBounds {\n x1: number;\n x2: number;\n y1: number;\n y2: number;\n}\n","import {Screen} from \"../Screen\";\nimport * as PIXI from \"pixi.js\";\nimport {Ticker} from \"pixi.js\";\nimport {unzip} from 'unzipit';\nimport {Main} from \"../../main\";\nimport {GlitchingTriangles} from \"./GlitchingTriangles\";\nimport {MainMenu} from \"../MainMenu/MainMenu\";\nimport {LazerLogo} from \"./LazerLogo\";\nimport {BeatmapParser} from \"../../Util/Beatmap/Parser/BeatmapParser\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\nimport {UIUtils} from \"../../Util/UI/UIUtils\";\nimport {CenteredList} from \"../../Util/UI/CenteredList\";\n\nexport class IntroScreen extends Screen {\n\n private readonly introTrackUrl: string;\n\n private doTextSpacingAnim = false;\n private triangles = new PIXI.Container();\n private ruleSetContainer = new PIXI.Container();\n private ruleSetList = new CenteredList({});\n private flash = new PIXI.Graphics();\n\n private logoContainerContainer = new PIXI.Container();\n\n private logoContainer = new PIXI.Container();\n\n private lazerLogo = new LazerLogo();\n\n private flashed = false;\n\n private standard = PIXI.Sprite.from('icon_ruleset_std');\n private taiko = PIXI.Sprite.from('icon_ruleset_taiko');\n private ctb = PIXI.Sprite.from('icon_ruleset_ctb');\n private mania = PIXI.Sprite.from('icon_ruleset_mania');\n\n private bg: PIXI.Graphics = new PIXI.Graphics();\n\n private completionPromise!: Promise;\n\n private welcomeText: PIXI.Text = new PIXI.Text({\n text: \"\",\n style: {\n fontFamily: \"TorusThin\",\n fontSize: 42,\n fill: \"white\",\n letterSpacing: 5\n }\n });\n\n public constructor(introTrack: Blob) {\n super();\n this.introTrackUrl = URL.createObjectURL(introTrack);\n this.bg.rect(0, 0, 1, 1,);\n this.bg.fill(\"black\");\n }\n\n public start() {\n this.bg.width = window.innerWidth;\n this.bg.height = window.innerHeight;\n this.bg.x = 0;\n this.bg.y = 0;\n this.addChild(this.bg);\n this.lazerLogo.scale.set(Screen.getScaleBasedOffScreenSize());\n this.logoContainer.addChild(this.lazerLogo);\n this.logoContainer.scale.set(1.2);\n\n this.logoContainerContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.logoContainerContainer.pivot.set(0.5, 0.5);\n this.logoContainerContainer.addChild(this.logoContainer);\n this.logoContainerContainer.alpha = 0;\n this.addChild(this.logoContainerContainer);\n\n this.flash.rect(0, 0, 1, 1);\n this.flash.fill(\"white\");\n this.flash.position.set(0, 0);\n this.flash.width = this.getScreenWidth();\n this.flash.height = this.getScreenHeight();\n this.flash.blendMode = \"add\";\n this.welcomeText.anchor.set(0.5, 0.5);\n this.welcomeText.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n (async () => {\n const {entries} = await unzip(this.introTrackUrl);\n for (const [name, entry] of Object.entries(entries)) {\n if (name.endsWith(\".osu\")) {\n entry.text().then(async (osuFile) => {\n let beatmapData = BeatmapParser.Parse(osuFile);\n for (const [name, entry] of Object.entries(entries)) {\n let blob = await entry.blob();\n beatmapData.files.set(name, blob);\n }\n await BeatmapParser.LoadFiles(beatmapData);\n let audioFile = beatmapData.General.audioFile;\n if (audioFile) {\n let url = URL.createObjectURL(audioFile);\n setTimeout(() => {\n Main.AudioEngine.PlayMusicImmediately(url, beatmapData, () => {\n this.afterAudioPlay();\n });\n }, 200);\n }\n console.log(beatmapData);\n });\n break;\n }\n }\n })();\n }\n\n public afterAudioPlay() {\n this.completionPromise = new Promise((resolve) => {\n this.welcomeText.scale.set(Screen.getScaleBasedOffScreenSize());\n this.addChild(this.welcomeText);\n setTimeout(() => {\n this.welcomeText.text = \"wel\";\n this.onResize();\n }, 200);\n setTimeout(() => {\n this.welcomeText.text = \"welcome\";\n this.onResize();\n }, 400);\n setTimeout(() => {\n this.welcomeText.text = \"welcome to\";\n this.onResize();\n }, 700);\n let glitchingInterval: NodeJS.Timeout;\n\n this.triangles.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.triangles.scale.set(Screen.getScaleBasedOffScreenSize());\n this.addChild(this.triangles);\n setTimeout(() => {\n this.welcomeText.text = \"welcome to kosu!\";\n this.doTextSpacingAnim = true;\n glitchingInterval = setInterval(() => {\n let triangle = new GlitchingTriangles({\n x1: -(this.welcomeText.width / 2) - 100,\n x2: (this.welcomeText.width / 2) + 100,\n y1: -(this.welcomeText.height / 2) - 150,\n y2: (this.welcomeText.height / 2) + 100\n });\n this.triangles.addChild(triangle);\n }, 30);\n this.onResize();\n }, 900);\n\n this.standard.scale = 0.5 * Screen.getScaleBasedOffScreenSize();\n this.ctb.scale = 0.5 * Screen.getScaleBasedOffScreenSize();\n this.mania.scale = 0.5 * Screen.getScaleBasedOffScreenSize();\n this.taiko.scale = 0.5 * Screen.getScaleBasedOffScreenSize();\n\n\n this.ruleSetList.addChild(this.standard);\n this.ruleSetList.addChild(this.taiko);\n this.ruleSetList.addChild(this.ctb);\n this.ruleSetList.addChild(this.mania);\n this.ruleSetList.padding = 0;\n this.ruleSetList.elementsMargin = 200 * Screen.getScaleBasedOffScreenSize();\n this.ruleSetList.type = \"horizontal\";\n this.ruleSetList.scale = 1;\n this.ruleSetContainer.addChild(this.ruleSetList);\n\n setTimeout(() => {\n this.doTextSpacingAnim = false;\n this.onResize();\n clearInterval(glitchingInterval);\n this.welcomeText.destroy();\n this.triangles.destroy();\n this.ruleSetContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.addChild(this.ruleSetContainer);\n this.ruleSetList.elementsMargin = 200 * Screen.getScaleBasedOffScreenSize();\n Ease.getEase(this.ruleSetContainer).ScaleTo(0.8, 1000, TWEEN.Easing.Linear.None);\n }, 1450);\n\n setTimeout(() => {\n this.ruleSetList.elementsMargin = 30 * Screen.getScaleBasedOffScreenSize();\n this.ruleSetList.scale = 2;\n UIUtils.centerPivotOfList(this.ruleSetList);\n }, 1650);\n\n setTimeout(() => {\n this.ruleSetList.elementsMargin = 10 * Screen.getScaleBasedOffScreenSize();\n this.ruleSetList.scale = 4;\n Ease.getEase(this.ruleSetContainer).ScaleTo(1.3, 1000, TWEEN.Easing.Linear.None);\n }, 1850);\n\n setTimeout(() => {\n this.ruleSetContainer.destroy();\n this.lazerLogo.start();\n\n this.logoContainerContainer.alpha = 1;\n\n this.logoContainerContainer.scale.set(1.2);\n Ease.getEase(this.logoContainerContainer).ScaleTo(1.2 - 0.8 * 0.25, 920, TWEEN.Easing.Quadratic.In);\n\n setTimeout(() => {\n Ease.getEase(this.logoContainer).ScaleTo(1.2 - 0.8, 920 * 0.3, TWEEN.Easing.Quintic.In);\n }, 920 * 0.7);\n }, 2080);\n\n setTimeout(() => {\n this.addChild(this.flash);\n this.bg.destroy();\n this.flash.eventMode = \"none\";\n this.flashed = true;\n this.logoContainerContainer.visible = false;\n Ease.getEase(this.flash).FadeOut(1000, TWEEN.Easing.Quadratic.Out).Then(() => {\n resolve();\n });\n Main.cursor.PopIn();\n }, 3000);\n });\n Main.switchScreen(new MainMenu());\n }\n\n public draw(deltaTime: Ticker) {\n if (this.doTextSpacingAnim) {\n this.welcomeText.style.letterSpacing += 0.15 * deltaTime.deltaTime;\n this.onResize();\n }\n }\n\n public onClose(): Promise {\n return new Promise((resolve) => {\n this.completionPromise.then(() => {\n resolve(this);\n })\n });\n }\n\n public onResize() {\n if (!this.bg.destroyed) {\n this.bg.width = window.innerWidth;\n this.bg.height = window.innerHeight;\n this.bg.x = 0;\n this.bg.y = 0;\n }\n if (!this.welcomeText.destroyed) {\n this.welcomeText.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n }\n if (!this.triangles.destroyed) {\n this.triangles.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.triangles.scale.set(Screen.getScaleBasedOffScreenSize());\n }\n if (!this.ruleSetContainer.destroyed) {\n this.ruleSetContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n }\n if (!this.flash.destroyed) {\n this.flash.position.set(0, 0);\n this.flash.width = this.getScreenWidth();\n this.flash.height = this.getScreenHeight();\n }\n if (!this.logoContainerContainer.destroyed) {\n this.logoContainerContainer.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n }\n if (!this.lazerLogo.destroyed) {\n this.lazerLogo.scale.set(Screen.getScaleBasedOffScreenSize());\n }\n if (!this.welcomeText.destroyed) {\n this.welcomeText.scale.set(Screen.getScaleBasedOffScreenSize());\n }\n if (!this.standard.destroyed) {\n this.standard.scale.set(0.5 * Screen.getScaleBasedOffScreenSize());\n }\n if (!this.mania.destroyed) {\n this.mania.scale.set(0.5 * Screen.getScaleBasedOffScreenSize());\n }\n if (!this.ctb.destroyed) {\n this.ctb.scale.set(0.5 * Screen.getScaleBasedOffScreenSize());\n }\n if (!this.taiko.destroyed) {\n this.taiko.scale.set(0.5 * Screen.getScaleBasedOffScreenSize());\n }\n if (!this.ruleSetList.destroyed) {\n this.ruleSetList.ReCenter();\n }\n }\n}\n","import * as PIXI from \"pixi.js\";\nimport {LogoAnimation} from \"./LogoAnimation\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {Ease} from \"../../Util/TweenWrapper/Ease\";\n\nexport class LazerLogo extends PIXI.Container {\n private readonly highlight: LogoAnimation;\n private readonly background: LogoAnimation;\n private textureHighlight = PIXI.Texture.from(\"intro_triangles_osuLogo_anim_highlight\");\n private textureBackground = PIXI.Texture.from(\"intro_triangles_osuLogo_anim_background\");\n\n public constructor() {\n super();\n this.highlight = new LogoAnimation(this.textureHighlight, new PIXI.Color(\"white\"));\n this.background = new LogoAnimation(this.textureBackground, new PIXI.Color(\"rgb(128, 128, 128)\"));\n this.addChild(this.highlight);\n this.addChild(this.background);\n }\n\n public start() {\n let dummy = new PIXI.Container();\n dummy.scale.set(0.0, 0.0);\n Ease.getEase(dummy).ScaleTo(1, 920, TWEEN.Easing.Linear.None).OnEach(() => {\n this.highlight.setProgress(dummy.scale.x);\n this.background.setProgress(dummy.scale.x);\n });\n }\n}\n","import * as PIXI from \"pixi.js\"\nimport glVertShader from \"./logoAnimation.vert\";\nimport glFragShader from \"./logoAnimation.frag\";\nimport gpuShader from \"./logoAnimation.wgsl\";\n\nexport class LogoAnimation extends PIXI.Container {\n private shader: PIXI.Shader;\n private texture: PIXI.Texture;\n\n public constructor(texture: PIXI.Texture, color: PIXI.Color) {\n super();\n this.texture = texture\n this.shader = PIXI.Shader.from({\n gl: {\n vertex: glVertShader,\n fragment: glFragShader,\n },\n gpu: {\n vertex: {\n entryPoint: 'mainVert',\n source: gpuShader\n },\n fragment: {\n entryPoint: 'mainFrag',\n source: gpuShader\n }\n },\n resources: {\n uTexture: this.texture.source,\n uSampler: this.texture.source.style,\n uProgress: {\n progress: {value: 0.0, type: 'f32'},\n },\n },\n });\n const quadGeometry = new PIXI.Geometry({\n attributes: {\n aPosition: [\n -this.texture.width / 2,\n -this.texture.height / 2, // x, y\n this.texture.width / 2,\n -this.texture.height / 2, // x, y\n this.texture.width / 2,\n this.texture.width / 2, // x, y,\n -this.texture.width / 2,\n this.texture.width / 2, // x, y,\n ],\n aUV: [0, 0, 1, 0, 1, 1, 0, 1],\n aColor: [\n color.red, color.green, color.blue, color.alpha,\n color.red, color.green, color.blue, color.alpha,\n color.red, color.green, color.blue, color.alpha,\n color.red, color.green, color.blue, color.alpha\n ]\n },\n indexBuffer: [0, 1, 2, 0, 2, 3],\n });\n const quad = new PIXI.Mesh({\n geometry: quadGeometry,\n shader: this.shader,\n });\n this.addChild(quad);\n }\n\n public setProgress(progress: number) {\n this.shader.resources.uProgress.uniforms.progress = progress;\n }\n}\n","import {Screen} from \"../Screen\";\nimport {LoadAnim} from \"../../Elements/LoadAnim/LoadAnim\";\nimport * as PIXI from \"pixi.js\";\n\nexport class LoadScreen extends Screen {\n\n private loadAnim = new LoadAnim(\"rgba(255,255,255,0.7)\", \"black\");\n\n public start() {\n this.loadAnim.scale.set(0.8 * Screen.getScaleBasedOffScreenSize());\n this.loadAnim.position.set(this.getScreenWidth() - this.loadAnim.getWidth() - 15, this.getScreenHeight() - this.loadAnim.getHeight() - 15);\n this.addChild(this.loadAnim);\n }\n\n public draw(deltaTime: PIXI.Ticker) {\n this.loadAnim?.draw(deltaTime);\n }\n\n public onClose(): Promise {\n return new Promise((resolve) => {\n if (this.loadAnim != null) {\n this.loadAnim.destroy();\n }\n setTimeout(() => {\n resolve(this);\n }, 400);\n });\n }\n\n public onResize() {\n this.loadAnim.position.set(this.getScreenWidth() - this.loadAnim.getWidth() - 20, this.getScreenHeight() - this.loadAnim.getHeight() - 20);\n this.loadAnim.scale.set(0.8 * Screen.getScaleBasedOffScreenSize());\n }\n}\n","import {Screen} from \"../Screen\";\nimport * as PIXI from \"pixi.js\";\nimport {RandomBackground} from \"../../Elements/RandomBackground/RandomBackground\";\nimport {OsuLogo} from \"../../Elements/MainMenu/OsuCircle/OsuLogo\";\nimport {ButtonSystem} from \"../../Elements/MainMenu/OsuCircle/Menu/ButtonSystem\";\n\nexport class MainMenu extends Screen {\n private bg = new RandomBackground();\n private osuCircle = new OsuLogo();\n private menu: ButtonSystem = new ButtonSystem(this.osuCircle);\n\n public start() {\n this.bg.start();\n this.addChild(this.bg);\n this.osuCircle.scale = Screen.getScaleBasedOffScreenSize();\n this.addChild(this.menu);\n this.menu.onResize();\n this.addChild(this.osuCircle);\n }\n\n public draw(deltaTime: PIXI.Ticker) {\n this.bg.draw(deltaTime);\n this.osuCircle.draw(deltaTime);\n }\n\n public onClose(): Promise {\n return new Promise((resolve) => {\n this.bg.onClose().then(() => {\n resolve(this);\n });\n })\n }\n\n public onResize() {\n this.osuCircle.position.set(this.getScreenWidth() / 2, this.getScreenHeight() / 2);\n this.bg.onResize();\n this.menu.onResize();\n this.osuCircle.scale = !this.menu.isOpen() ? Screen.getScaleBasedOffScreenSize() :\n Screen.getScaleBasedOffScreenSize() * 0.5;\n }\n}\n","import * as PIXI from \"pixi.js\";\nimport {Settings} from \"../Settings/Settings\";\nimport {UIScale} from \"../Settings/impl/Graphics/UIScale\";\n\nexport abstract class Screen extends PIXI.Container {\n\n public constructor() {\n super();\n }\n\n public static getScaleBasedOffScreenSize() {\n // this was made with 1080p screens in mind.\n const uiScale = Settings.getSetting(UIScale).getValue();\n return ((((window.innerWidth / 1920) + (window.innerHeight / 1080)) / 2)) * uiScale\n }\n\n /**\n * Called once before the first frame is drawn\n */\n public abstract start(): void;\n\n\n /**\n * Called every frame\n */\n public abstract draw(deltaTime: PIXI.Ticker): void;\n\n /**\n * Called when screen will be closed, but has to return a promise to clean up after, for example, the screen's close animations are done.\n * Make sure you also pass in `this` into the promise's resolve.\n */\n public abstract onClose(): Promise;\n\n public abstract onResize(): void;\n\n protected getScreenWidth(): number {\n return window.innerWidth;\n }\n\n protected getScreenHeight(): number {\n return window.innerHeight;\n }\n}\n","import {Settings} from \"./Settings\";\n\nexport abstract class Setting {\n public readonly info: Settings;\n\n public constructor(SettingData: SettingInfo) {\n this.info = SettingData;\n Settings.register({setting: this, info: SettingData});\n }\n\n public abstract getValue(): any;\n\n public abstract getDefaultValue(): any;\n\n public abstract setValue(value: any): void;\n\n protected onValueChanged(): void {}\n\n /** When implementing this method, do **NOT** save the settings. This is so that loading won't reset most settings. */\n public abstract loadFromSaveValue(value: any): void;\n}\n\nexport interface SettingInfo {\n name: string;\n category: SettingsCategory;\n}\n\nexport enum SettingsCategory {\n General = \"General\",\n Skin = \"Skin\",\n Input = \"Input\",\n UserInterface = \"User Interface\",\n Gameplay = \"Gameplay\",\n Rulesets = \"Rulesets\",\n Audio = \"Audio\",\n Graphics = \"Graphics\",\n Online = \"Online\",\n Maintenance = \"Maintenance\",\n Debug = \"Debug\"\n}\n","import {Setting} from \"../Setting\";\nimport {Settings} from \"../Settings\";\n\nexport abstract class DropdownSetting extends Setting {\n public abstract readonly list: DropDownOption[];\n public abstract readonly defaultValue: DropDownOption;\n protected value: DropDownOption | undefined;\n\n public getValue(): DropDownOption {\n if (!this.value)\n throw new Error(\"Value is undefined!\");\n return this.value;\n }\n\n public getDefaultValue(): DropDownOption {\n return this.defaultValue;\n }\n\n public setValue(value: DropDownOption) {\n if (this.list.find((option) => option.value == value.value && option.displayName == value.displayName )) {\n this.value = value;\n Settings.save();\n this.onValueChanged();\n } else {\n console.warn('The value provided to this DropDownSetting does not exist in the option list! Ignoring value provided.');\n }\n }\n\n public loadFromSaveValue(value: DropDownOption) {\n if (this.list.find((option) => option.value == value.value && option.displayName == value.displayName)) {\n this.value = value;\n this.onValueChanged();\n } else {\n console.warn('The value provided to this DropDownSetting does not exist in the option list! Ignoring value provided.');\n }\n }\n}\n\nexport interface DropDownOption {\n displayName: string;\n value: string;\n}\n","import {Setting} from \"../Setting\";\nimport {Settings} from \"../Settings\";\nimport {MathUtil} from \"../../Util/MathUtil\";\n\nexport abstract class RangeSetting extends Setting {\n public abstract readonly minValue: number;\n public abstract readonly maxValue: number;\n public abstract readonly increment: number;\n public abstract readonly defaultValue: number;\n protected value: number = 0;\n\n public getValue(): number {\n return this.value;\n }\n\n public getDefaultValue(): number {\n return this.defaultValue;\n }\n\n public setValue(value: number) {\n this.value = MathUtil.clamp(this.minValue, this.maxValue, value);\n Settings.save();\n this.onValueChanged();\n }\n\n public loadFromSaveValue(value: number) {\n this.value = MathUtil.clamp(this.minValue, this.maxValue, value);\n this.onValueChanged();\n }\n}\n","import {Setting, SettingInfo} from \"./Setting\";\nimport {UIScale} from \"./impl/Graphics/UIScale\";\nimport {Renderer} from \"./impl/Graphics/Renderer\";\nimport {MouseSensitivity} from \"./impl/Input/MouseSensitivity\";\n\nexport class Settings {\n private static settingsList: SettingData[] = [];\n\n public static registerAll() {\n new UIScale();\n new Renderer();\n new MouseSensitivity();\n }\n\n public static load() {\n let settingSaveDataString = window.localStorage.getItem(\"settings\");\n if (settingSaveDataString == null) {\n return;\n }\n let settings = this.getList();\n try {\n let settingSaveData: SettingSaveData[] = JSON.parse(settingSaveDataString) as SettingSaveData[];\n settingSaveData.forEach((setting) => {\n let corrupt = false;\n try {\n if (!setting.value) {\n console.warn(\"Setting '\" + JSON.stringify(setting) + \"' may be corrupted, skipping!\");\n corrupt = true;\n }\n if (setting.info) {\n if (!setting.info.name) {\n console.warn(\"Setting '\" + JSON.stringify(setting) + \"' may be corrupted, skipping!\");\n corrupt = true;\n }\n if (!setting.info.category) {\n console.warn(\"Setting '\" + JSON.stringify(setting) + \"' may be corrupted, skipping!\");\n corrupt = true;\n }\n }\n else {\n console.warn(\"Setting '\" + JSON.stringify(setting) + \"' may be corrupted, skipping!\");\n corrupt = true;\n }\n }\n catch (e) {\n console.warn(\"Something went wrong when validating saved settings!\", e);\n console.warn(\"The setting may be REALLY corrupted, skipping!\");\n corrupt = true;\n }\n if (!corrupt) {\n let settingObj = settings.filter((_settingObj) => (_settingObj.info.name == setting.info.name) &&\n _settingObj.info.category == setting.info.category)[0];\n if (settingObj) {\n settingObj.setting.loadFromSaveValue(setting.value);\n } else {\n console.warn(\"Could not find setting object '\" + setting.info.name + \"', maybe it has been removed in this version of kosu?, skipping setting\")\n }\n }\n });\n }\n catch (e) {\n console.warn(\"Failed to load settings! Resetting Settings due to corrupted save!\", e);\n this.reset();\n }\n }\n\n public static save() {\n let settings = this.getList();\n let settingSaveData: SettingSaveData[] = [];\n settings.forEach((setting: SettingData) => {\n // only save if setting is different from default value\n if (setting.setting.getValue() != setting.setting.getDefaultValue()) {\n settingSaveData.push({info: setting.info, value: setting.setting.getValue()});\n }\n });\n window.localStorage.setItem(\"settings\", JSON.stringify(settingSaveData));\n }\n\n public static reset() {\n console.warn(\"Resetting Settings!\");\n window.localStorage.removeItem(\"settings\");\n }\n\n public static register(setting: SettingData) {\n this.settingsList.push(setting);\n }\n\n public static getSetting(setting: new (...args: any[]) => T): T {\n return this.settingsList.filter((_setting) => {\n return _setting.setting instanceof setting\n })[0].setting as T;\n }\n\n public static getSettingData(setting: new (...args: any[]) => T): SettingData {\n return this.settingsList.filter((_setting) => {\n return _setting.setting instanceof setting\n })[0];\n }\n\n public static getList() {\n return this.settingsList;\n }\n}\n\nexport interface SettingData {\n readonly setting: Setting;\n readonly info: SettingInfo;\n}\n\nexport interface SettingSaveData {\n readonly info: SettingInfo;\n readonly value: any;\n}\n","import {SettingsCategory} from \"../../Setting\";\nimport {DropDownOption, DropdownSetting} from \"../../SettingType/DropdownSetting\";\n\nexport class Renderer extends DropdownSetting {\n public readonly list: DropDownOption[] = [];\n\n public readonly webglOption: DropDownOption = {displayName: \"WebGL\", value: \"webgl\"}\n public readonly webGpuOption: DropDownOption = {displayName: \"WebGPU\", value: \"webgpu\"}\n public readonly defaultValue = this.webglOption;\n\n public constructor() {\n super({name: \"Renderer\", category: SettingsCategory.Graphics});\n this.list.push(this.webglOption, this.webGpuOption);\n this.value = this.defaultValue;\n }\n}\n","import {RangeSetting} from \"../../SettingType/RangeSetting\";\nimport {SettingsCategory} from \"../../Setting\";\n\nexport class UIScale extends RangeSetting {\n public readonly maxValue = 1.6;\n public readonly minValue = 0.8;\n public readonly increment = 0.1;\n public readonly defaultValue = 1;\n\n public constructor() {\n super({name: \"UI scaling\", category: SettingsCategory.Graphics});\n this.value = this.defaultValue;\n }\n}\n","import {RangeSetting} from \"../../SettingType/RangeSetting\";\nimport {SettingsCategory} from \"../../Setting\";\nimport {EventSystem} from \"pixi.js\";\n\nexport class MouseSensitivity extends RangeSetting{\n public readonly defaultValue: number = 1.0;\n public readonly increment: number = 0.01;\n public readonly maxValue: number = 10.0;\n public readonly minValue: number = 0.10;\n\n public constructor() {\n super({name: \"Sensitivity\", category: SettingsCategory.Input});\n this.value = this.defaultValue;\n this.onValueChanged();\n }\n\n public onValueChanged() {\n EventSystem.cursorSensitivity = this.getValue();\n }\n}\n","import {GeneralData} from \"./Sections/General/GeneralData\";\nimport {EditorData} from \"./Sections/Editor/EditorData\";\nimport {Metadata} from \"./Sections/Metadata/Metadata\";\nimport {DifficultyData} from \"./Sections/Difficulty/DifficultyData\";\nimport {EventsData} from \"./Sections/Events/EventsData\";\nimport {TimingPoint} from \"./Sections/TimingPoints/TimingPoint\";\nimport {TimingPointsData} from \"./Sections/TimingPoints/TimingPointsData\";\nimport {ColorsData} from \"./Sections/Colors/ColorsData\";\n\n/**\n * .osu (file format)\n */\nexport class BeatmapData {\n public files: Map = new Map();\n\n /**\n * General information about the beatmap\n */\n public General: GeneralData = new GeneralData();\n /**\n * Saved settings for the beatmap editor\n */\n public Editor: EditorData = new EditorData();\n /**\n * Information used to identify the beatmap\n */\n public Metadata: Metadata = new Metadata();\n /**\n * Difficulty settings\n */\n public Difficulty: DifficultyData = new DifficultyData();\n /**\n * Beatmap and storyboard graphic events\n */\n public Events: EventsData = new EventsData();\n /**\n * Timing and control points\n */\n public TimingPoints: TimingPointsData = new TimingPointsData();\n /**\n * Combo and skin colours\n */\n public Colors: ColorsData = new ColorsData();\n\n //TODO: add hitobject data\n\n}\n","import {Color} from \"./Color\";\n\n/**\n * \tCombo and skin colours\n */\nexport class ColorsData {\n public Colors: Color[] = [];\n}\n","/**\n * Difficulty settings\n */\nexport class DifficultyData {\n /**\n * HP setting (0–10)\n */\n public HPDrainRate!: number;\n /**\n * CS setting (0–10)\n */\n public CircleSize!: number;\n /**\n * OD setting (0–10)\n */\n public OverallDifficulty!: number;\n /**\n * AR setting (0–10)\n */\n public ApproachRate!: number;\n /**\n * Base slider velocity in hundreds of osu! pixels per beat\n */\n public SliderMultiplier!: number;\n /**\n * Amount of slider ticks per beat\n */\n public SliderTickRate!: number;\n}\n","/**\n * Saved settings for the beatmap editor\n */\nexport class EditorData {\n /**\n * Time in milliseconds of bookmarks\n */\n public Bookmarks: number[] = [];\n /**\n * Distance snap multiplier\n */\n public DistanceSpacing: number | undefined;\n /**\n * Beat snap divisor\n */\n public BeatDivisor: number | undefined;\n /**\n * Grid size\n */\n public GridSize: number | undefined;\n /**\n * Scale factor for the object timeline\n */\n public TimelineZoom: number | undefined;\n}\n","import {EventTypes} from \"./EventTypes\";\n\nexport class Event {\n /**\n * Type of the event. Some events may be referred to by either a name or a number.\n */\n public eventType!: EventTypes;\n /**\n * Start time of the event, in milliseconds from the beginning of the beatmap's audio. For events that do not use a start time, the default is 0.\n */\n public startTime: number = 0;\n}\n","import {Event} from \"./Event\";\nimport {EventTypes} from \"./EventTypes\";\nimport * as PIXI from \"pixi.js\";\n\nexport class EventBackground extends Event {\n public eventType = EventTypes.BACKGROUND;\n public startTime = 0;\n /**\n * Location of the background image relative to the beatmap directory. Double quotes are\n * usually included surrounding the filename, but they are not required.\n */\n public filename!: string;\n /**\n * Offset in osu! pixels from the centre of the screen.\n * For example, an offset of 50,100 would have the background shown 50 osu! pixels to the\n * right and 100 osu! pixels down from the centre of the screen. If the offset is 0,0, writing it is optional.\n */\n public xOffset!: number;\n /**\n * Offset in osu! pixels from the centre of the screen.\n * For example, an offset of 50,100 would have the background shown 50 osu! pixels to the\n * right and 100 osu! pixels down from the centre of the screen. If the offset is 0,0, writing it is optional.\n */\n public yOffset!: number;\n\n public texture?: PIXI.Texture;\n}\n","import {Event} from \"./Event\";\nimport {EventTypes} from \"./EventTypes\";\n\nexport class EventBreak extends Event {\n public eventType = EventTypes.BREAK;\n public endTime: number = 0;\n}","export enum EventTypes {\n BACKGROUND = \"0\",\n VIDEO = \"Video\",\n BREAK = \"Break\",\n // storyboard\n SPRITE = \"Sprite\",\n ANIMATION = \"Animation\"\n}\n","import {Event} from \"./Event\";\nimport {EventTypes} from \"./EventTypes\";\nimport * as PIXI from \"pixi.js\";\n\nexport class EventVideo extends Event {\n public eventType = EventTypes.VIDEO;\n /**\n * Location of the background video relative to the beatmap directory. Double quotes are\n * usually included surrounding the filename, but they are not required.\n */\n public filename!: string;\n /**\n * Offset in osu! pixels from the centre of the screen.\n * For example, an offset of 50,100 would have the background shown 50 osu! pixels to the\n * right and 100 osu! pixels down from the centre of the screen. If the offset is 0,0, writing it is optional.\n */\n public xOffset!: number;\n /**\n * Offset in osu! pixels from the centre of the screen.\n * For example, an offset of 50,100 would have the background shown 50 osu! pixels to the\n * right and 100 osu! pixels down from the centre of the screen. If the offset is 0,0, writing it is optional.\n */\n public yOffset!: number;\n\n\n public texture?: PIXI.Texture;\n}\n","import {Event} from \"./Event\";\n\n/**\n * Beatmap and storyboard graphic events\n */\nexport class EventsData {\n public Events: Event[] = [];\n}\n","export enum Countdown {\n NoCountdown = 0,\n Normal = 1,\n Half = 2,\n Double = 3\n}","import {Countdown} from \"./Countdown\";\nimport {SampleSet} from \"./SampleSet\";\nimport {Mode} from \"./Mode\";\nimport {OverlayPosition} from \"./OverlayPosition\";\n/**\n * General information about the beatmap\n */\nexport class GeneralData {\n\n public audioFile?: Blob;\n\n /**\n * Location of the audio file relative to the current folder.\n */\n public AudioFilename: string | null = null;\n /**\n * Milliseconds of silence before the audio starts playing\n */\n public AudioLeadIn: number = 0;\n /**\n * @deprecated The `AudioHash` property is deprecated according to the osu! wiki.\n */\n public AudioHash: string | null = null;\n /**\n * Time in milliseconds when the audio preview should start\n */\n public PreviewTime: number = -1;\n /**\n * Speed of the countdown before the first hit object (0 = no countdown, 1 = normal, 2 = half, 3 = double)\n */\n public Countdown: Countdown = Countdown.Normal;\n /**\n * Sample set that will be used if timing points do not override it (Normal, Soft, Drum)\n */\n public SampleSet: SampleSet = SampleSet.Normal;\n /**\n * Multiplier for the\n * threshold in time where hit objects placed close together stack (0–1)\n */\n public StackLeniency: number = 0.7;\n /**\n * Game mode (0 = osu!, 1 = osu!taiko, 2 = osu!catch, 3 = osu!mania)\n */\n public Mode: Mode = Mode.OSU;\n /**\n * Whether or not breaks have a letterboxing effect\n */\n public LetterboxInBreaks: boolean = false;\n /**\n * @deprecated The `StoryFireInFront` property is deprecated according to the osu! wiki.\n */\n public StoryFireInFront: boolean = true;\n /**\n * Whether or not the storyboard can use the user's skin images\n */\n public UseSkinSprites: boolean = false;\n /**\n * @deprecated The `AlwaysShowPlayfield` property is deprecated according to the osu! wiki.\n */\n public AlwaysShowPlayfield: boolean = false;\n /**\n * Draw order of hit circle overlays compared to hit numbers (NoChange = use skin setting,\n * Below = draw overlays under numbers, Above = draw overlays on top of numbers)\n */\n public OverlayPosition: OverlayPosition = OverlayPosition.NoChange;\n /**\n * Preferred skin to use during gameplay\n */\n public SkinPreference: string | null = null;\n /**\n * Whether or not a warning about flashing colours should be shown at the beginning of the map\n */\n public EpilepsyWarning: boolean = false;\n /**\n * Time in beats that the countdown starts before the first hit object\n */\n public CountdownOffset: number = 0;\n /**\n * Whether or not the \"N+1\" style key layout is used for osu!mania\n */\n public SpecialStyle: boolean = false;\n /**\n * Whether or not the storyboard allows widescreen viewing\n */\n public WidescreenStoryboard: boolean = false;\n /**\n * Whether or not sound samples will change rate when playing with speed-changing mods\n */\n public SamplesMatchPlaybackRate: boolean = false;\n}\n","export enum Mode {\n OSU = 0,\n TAIKO = 1,\n CATCH = 2,\n MANIA = 3\n}","export enum OverlayPosition {\n NoChange = \"NoChange\",\n Below = \"Below\",\n Above = \"Above\"\n}\n","export enum SampleSet {\n Normal = \"Normal\",\n Soft = \"Soft\",\n Drum = \"Drum\"\n}","/**\n * Information used to identify the beatmap\n */\nexport class Metadata {\n /**\n * Romanised song title\n */\n public Title!: string;\n /**\n * Song title\n */\n public TitleUnicode!: string;\n /**\n * Romanised song artist\n */\n public Artist!: string;\n /**\n * Song artist\n */\n public ArtistUnicode!: string;\n /**\n * Beatmap creator\n */\n public Creator!: string;\n /**\n * Difficulty name\n */\n public Version!: string;\n /**\n * Original media the song was produced for\n */\n public Source: string | undefined;\n /**\n * Search terms\n */\n public Tags!: string[];\n /**\n * Difficulty ID\n */\n public BeatmapID!: number;\n /**\n * Beatmap ID\n */\n public BeatmapSetID!: number;\n}\n","export enum Effect {\n KiaiTime = 1,\n None = 0,\n FirstBarLineOmittedInOsuTaikoAndOsuMania = 3\n}\n","import {TimingPoint} from \"./TimingPoint\";\n\nexport class InheritedTimingPoint extends TimingPoint {\n /**\n * a negative inverse slider velocity multiplier, as a percentage.\n * For example, `-50` would make all sliders in this timing section twice as fast as `SliderMultiplier`.\n */\n public sliderVelocityMultiplier!: number;\n\n}","import {TimingPointSampleSet} from \"./TimingPointSampleSet\";\nimport {Effect} from \"./Effect\";\n\nexport abstract class TimingPoint {\n /**\n * Start time of the timing section, in milliseconds from the beginning of the beatmap's audio.\n * The end of the timing section is the next timing point's time (or never, if this is the last timing point).\n */\n public time!: number;\n /**\n * Default sample set for hit objects (0 = beatmap default, 1 = normal, 2 = soft, 3 = drum).\n */\n public sampleSet!: TimingPointSampleSet;\n /**\n * Custom sample index for hit objects. 0 indicates osu!'s default hitsounds.\n */\n public sampleIndex!: number;\n /**\n * Volume percentage for hit objects.\n */\n public volume!: number;\n /**\n * Bit flags that give the timing point extra effects.\n * See the effects section.\n */\n public effects!: Effect\n}","import {TimingPoint} from \"./TimingPoint\";\nimport {UnInheritedTimingPoint} from \"./UnInheritedTimingPoint\";\nimport {InheritedTimingPoint} from \"./InheritedTimingPoint\";\n\n/**\n * Timing and control points\n */\nexport class TimingPointsData {\n public TimingPoints: TimingPoint[] = [];\n\n /**\n * Returns the current timing point in an array using the time provided.\n * If the current timing point is inherited, it will also return the parent\n * timing point along with it in the array as the second index.\n */\n public GetCurrentTimingPoints(time: number) {\n let toReturn: TimingPoint[] = [];\n let filter = this.TimingPoints.filter((timingPoint) => {if (timingPoint.time <= time) {return timingPoint}});\n if (filter.length == 0) {\n filter.push(this.TimingPoints[0]);\n }\n toReturn.push(filter[filter.length-1]);\n\n if (toReturn[0] instanceof InheritedTimingPoint) {\n let filter = this.TimingPoints.filter((timingPoint) => {return timingPoint instanceof UnInheritedTimingPoint})\n .filter((timingPoint) => {if (timingPoint.time <= time) {return timingPoint}});\n if (filter.length == 0) {\n throw new Error(\"Could not find a parent timing point for the un-inherited timing point!\");\n }\n toReturn.push(filter[filter.length-1]);\n }\n if (toReturn.length == 0) {\n throw new Error(\"Could not find any timing points!\");\n }\n return toReturn;\n }\n\n public GetCurrentUninheritedTimingPoint(time: number) {\n let timingPoint = this.GetCurrentTimingPoints(time);\n let unInheritedTimingPoint: UnInheritedTimingPoint;\n if (timingPoint[0] instanceof UnInheritedTimingPoint) {\n unInheritedTimingPoint = timingPoint[0];\n }\n else if(timingPoint[1] instanceof UnInheritedTimingPoint){\n unInheritedTimingPoint = timingPoint[1];\n }\n else {\n throw new Error(\"Could not find any UnInherited Timing Points!\")\n }\n return unInheritedTimingPoint;\n }\n\n}\n","import {TimingPoint} from \"./TimingPoint\";\n\nexport class UnInheritedTimingPoint extends TimingPoint {\n /**\n * The duration of a beat, in milliseconds.\n */\n public beatLength!: number;\n /**\n * Amount of beats in a measure.\n */\n public meter!: number;\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {TimingPointsParser} from \"./TimingPointsParser\";\nimport {GeneralParser} from \"./GeneralParser\";\nimport {EditorParser} from \"./EditorParser\";\nimport {MetadataParser} from \"./MetadataParser\";\nimport {DifficultyParser} from \"./DifficultyParser\";\nimport {EventsParser} from \"./EventsParser\";\n\nexport class BeatmapParser {\n public static Parse(osuFileContent: string, storyBoardFileContent?: string): BeatmapData {\n const beatMapData = new BeatmapData();\n let osuFileContentLines = osuFileContent.split(/\\r?\\n|\\r|\\n/g);\n GeneralParser.ParseGeneral(beatMapData, BeatmapParser.GetSection(\"General\", osuFileContentLines));\n EditorParser.ParseEditor(beatMapData, BeatmapParser.GetSection(\"Editor\", osuFileContentLines));\n MetadataParser.ParseMetadata(beatMapData, BeatmapParser.GetSection(\"Metadata\", osuFileContentLines));\n DifficultyParser.ParseDifficulty(beatMapData, BeatmapParser.GetSection(\"Difficulty\", osuFileContentLines));\n EventsParser.ParseEvents(beatMapData, BeatmapParser.GetSection(\"Events\", osuFileContentLines));\n TimingPointsParser.ParseTimingPoints(beatMapData, BeatmapParser.GetSection(\"TimingPoints\", osuFileContentLines));\n return beatMapData\n }\n\n public static async LoadFiles(beatMapData: BeatmapData) {\n await GeneralParser.LoadFiles(beatMapData);\n await EventsParser.LoadFiles(beatMapData);\n }\n\n public static GetSection(sectionName: string, osuFileContentLines: string[]) {\n let section: string[] = [];\n osuFileContentLines.forEach((str, index) => {\n if (str == \"[\" + sectionName + \"]\") {\n for (let i = index + 1; i < osuFileContentLines.length; i++) {\n if (osuFileContentLines[i] == \"\") {\n continue;\n }\n if (osuFileContentLines[i].startsWith(\"[\")) {\n break;\n }\n section.push(osuFileContentLines[i]);\n }\n }\n });\n return section;\n }\n\n public static AutoParse(sectionType: new (...args: any[]) => T, propValue: string[], beatmapDataSection: T) {\n let key = propValue[0] as keyof T;\n let keyExists = false;\n for (let sectionKey in beatmapDataSection) {\n if (sectionKey == key) {\n keyExists = true;\n }\n }\n if (!keyExists) {\n console.warn(key.toString() + \" does not exist on \" + sectionType.name + \"!\");\n return;\n }\n let isNumber = /^[0-9]+$|^[0-9]+.+$|^-[0-9]+$|^-[0-9]+.+$/.test(propValue[1]);\n let isBoolean = typeof beatmapDataSection[key] == \"boolean\";\n let value;\n if (isBoolean) {\n value = propValue[1] == \"1\";\n } else if (isNumber) {\n value = parseFloat(propValue[1]);\n } else {\n value = propValue[1];\n }\n\n // @ts-ignore\n beatmapDataSection[key] = value;\n }\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {BeatmapParser} from \"./BeatmapParser\";\nimport {DifficultyData} from \"../Data/Sections/Difficulty/DifficultyData\";\n\nexport class DifficultyParser {\n public static ParseDifficulty(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let propValue = str.split(\":\");\n if (propValue[1].startsWith(\" \")){\n propValue[1] = propValue[1].substring(1, propValue[1].length);\n }\n\n BeatmapParser.AutoParse(DifficultyData, propValue, beatmapData.Difficulty);\n });\n }\n\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {BeatmapParser} from \"./BeatmapParser\";\nimport {EditorData} from \"../Data/Sections/Editor/EditorData\";\n\nexport class EditorParser {\n public static ParseEditor(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let propValue = str.split(\":\");\n if (propValue[1].startsWith(\" \")){\n propValue[1] = propValue[1].substring(1, propValue[1].length);\n }\n if (propValue[0] != \"Bookmarks\") {\n BeatmapParser.AutoParse(EditorData, propValue, beatmapData.Editor);\n }\n else {\n propValue[1].split(\",\")\n .forEach((num) => {beatmapData.Editor.Bookmarks.push(parseFloat(num));});\n }\n });\n }\n\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {EventTypes} from \"../Data/Sections/Events/EventTypes\";\nimport {EventBackground} from \"../Data/Sections/Events/EventBackground\";\nimport {EventVideo} from \"../Data/Sections/Events/EventVideo\";\nimport {EventBreak} from \"../Data/Sections/Events/EventBreak\";\nimport { FFmpeg } from '@ffmpeg/ffmpeg';\nimport * as PIXI from \"pixi.js\";\nimport {Loader} from \"../../../Loader\";\n\nexport class EventsParser {\n public static aviTranscodedVideoCache: {beatmapSID: number, filePath: string, blob: Blob}[] = [];\n\n public static ParseEvents(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let values = str.split(\",\");\n let event;\n switch (values[0]) {\n case EventTypes.BACKGROUND:\n event = new EventBackground();\n event.filename = values[2].replaceAll('\"', \"\");\n event.xOffset = parseInt(values[3]);\n event.yOffset = parseInt(values[4]);\n if (isNaN(event.xOffset)) {\n event.xOffset = 0;\n }\n if (isNaN(event.yOffset)) {\n event.yOffset = 0;\n }\n break;\n case EventTypes.VIDEO:\n case \"1\":\n event = new EventVideo();\n event.startTime = parseInt(values[1]);\n event.filename = values[2].replaceAll('\"', \"\");\n event.xOffset = parseInt(values[3]);\n event.yOffset = parseInt(values[4]);\n if (isNaN(event.xOffset)) {\n event.xOffset = 0;\n }\n if (isNaN(event.yOffset)) {\n event.yOffset = 0;\n }\n break;\n case EventTypes.BREAK:\n case \"2\":\n event = new EventBreak();\n event.startTime = parseInt(values[1]);\n event.endTime = parseInt(values[2]);\n break;\n }\n if (event) {\n beatmapData.Events.Events.push(event);\n }\n });\n }\n\n public static async LoadFiles(beatmapData: BeatmapData) {\n for (const event of beatmapData.Events.Events) {\n for (let eventKey in event) {\n if (eventKey == \"filename\" || eventKey == \"filepath\") {\n // @ts-ignore\n let file = beatmapData.files.get(event[eventKey]);\n if (file) {\n let url = URL.createObjectURL(file);\n if (event instanceof EventBackground) {\n try {\n event.texture = await PIXI.Assets.load({src: url, loadParser: \"loadTextures\"});\n } catch (e) {\n console.warn(e);\n }\n }\n if (event instanceof EventVideo) {\n let failed = false;\n // @ts-ignore\n if (event[eventKey].endsWith(\".avi\")) {\n // @ts-ignore\n let cacheHit = this.aviTranscodedVideoCache.find(\n (cache) => {\n // @ts-ignore\n if (cache.beatmapSID == beatmapData.Metadata.BeatmapSetID && cache.filePath == event[eventKey]) {\n return cache;\n }\n }\n );\n try {\n if (!cacheHit) {\n console.warn(\"AVI video is not natively supported! Transcoding to .mp4, this may take a few minutes!\");\n let ffmpeg = new FFmpeg();\n ffmpeg.on('progress', ({progress, time}) => {\n console.log(`.avi to .mp4 transcoding: ${Math.round(progress * 1000) / 10}% (transcoded time: ${Math.round(time / 100000) / 10}s)`);\n });\n console.log(\"FFmpeg initialized\");\n const baseURL = 'https://unpkg.com/@ffmpeg/core-mt@0.12.6/dist/esm';\n let classWorker = Loader.Get(\"workers.ffmpeg\");\n let core = Loader.Get(\"ffmpeg.core\");\n let wasm = Loader.Get(\"ffmpeg.wasm\");\n let worker = Loader.Get(\"ffmpeg.coreWorker\");\n await ffmpeg.load({\n classWorkerURL: URL.createObjectURL(classWorker),\n coreURL: URL.createObjectURL(core),\n wasmURL: URL.createObjectURL(wasm),\n workerURL: URL.createObjectURL(worker)\n });\n console.log(\"FFmpeg loaded\");\n await ffmpeg.writeFile('input.avi', new Uint8Array(await file.arrayBuffer()));\n console.log(\"Written file to FFmpeg's vfs\");\n await ffmpeg.exec([\"-i\", \"input.avi\", \"-c:v\", \"libx264\", \"-preset\",\n \"ultrafast\", \"-an\", \"-movflags\", \"faststart\", \"output.mp4\"]);\n console.log(\"Transcoding done\");\n const data = await ffmpeg.readFile(\"output.mp4\");\n ffmpeg.terminate();\n console.log(\"FFmpeg terminated\");\n let newFile = new Blob([data], {type: 'video/mp4'});\n this.aviTranscodedVideoCache.push({\n beatmapSID: beatmapData.Metadata.BeatmapSetID,\n // @ts-ignore\n filePath: event[eventKey],\n blob: newFile\n });\n // @ts-ignore\n beatmapData.files.delete(event[eventKey]);\n // @ts-ignore\n event[eventKey] = event[eventKey].substring(0, event[eventKey].length - 4) + \".mp4\";\n // @ts-ignore\n beatmapData.files.set(event[eventKey], newFile);\n URL.revokeObjectURL(url);\n url = URL.createObjectURL(newFile);\n console.log(\"Successfully transcoded from .avi to .mp4!\");\n } else {\n // @ts-ignore\n beatmapData.files.delete(event[eventKey]);\n // @ts-ignore\n event[eventKey] = event[eventKey].substring(0, event[eventKey].length - 4) + \".mp4\";\n // @ts-ignore\n beatmapData.files.set(event[eventKey], cacheHit.blob);\n URL.revokeObjectURL(url);\n url = URL.createObjectURL(cacheHit.blob);\n }\n } catch (e) {\n console.warn(e);\n failed = true;\n }\n }\n if (!failed) {\n try {\n event.texture = await PIXI.Assets.load({src: url, loadParser: \"loadVideo\"});\n if (event.texture) {\n event.texture.source.resource.volume = 0;\n event.texture.source.resource.pause();\n }\n } catch (e) {\n console.warn(e);\n }\n }\n }\n } else {\n // @ts-ignore\n console.warn(\"Could not find referenced file: \" + event[eventKey]);\n }\n }\n }\n }\n }\n}","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {GeneralData} from \"../Data/Sections/General/GeneralData\";\nimport {BeatmapParser} from \"./BeatmapParser\";\n\nexport class GeneralParser {\n public static ParseGeneral(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let propValue = str.split(\":\");\n if (propValue[1].startsWith(\" \")) {\n propValue[1] = propValue[1].substring(1, propValue[1].length);\n }\n\n BeatmapParser.AutoParse(GeneralData, propValue, beatmapData.General);\n });\n }\n\n public static async LoadFiles(beatmapData: BeatmapData) {\n if (beatmapData.General.AudioFilename) {\n beatmapData.General.audioFile = beatmapData.files.get(beatmapData.General.AudioFilename);\n }\n }\n\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {BeatmapParser} from \"./BeatmapParser\";\nimport {Metadata} from \"../Data/Sections/Metadata/Metadata\";\n\nexport class MetadataParser {\n public static ParseMetadata(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let propValue = str.split(\":\");\n if (propValue[1].startsWith(\" \")){\n propValue[1] = propValue[1].substring(1, propValue[1].length);\n }\n\n BeatmapParser.AutoParse(Metadata, propValue, beatmapData.Metadata);\n });\n }\n\n}\n","import {BeatmapData} from \"../Data/BeatmapData\";\nimport {UnInheritedTimingPoint} from \"../Data/Sections/TimingPoints/UnInheritedTimingPoint\";\nimport {InheritedTimingPoint} from \"../Data/Sections/TimingPoints/InheritedTimingPoint\";\nimport {Effect} from \"../Data/Sections/TimingPoints/Effect\";\n\nexport class TimingPointsParser {\n public static ParseTimingPoints(beatmapData: BeatmapData, section: string[]) {\n section.forEach((str) => {\n let prop = str.split(\",\");\n let timingPoint;\n if (prop[6] == \"1\") {\n timingPoint = new UnInheritedTimingPoint();\n timingPoint.beatLength = Number.parseFloat(prop[1]);\n timingPoint.meter = Number.parseInt(prop[2]);\n }\n else {\n timingPoint = new InheritedTimingPoint();\n timingPoint.sliderVelocityMultiplier = Number.parseFloat(prop[1]);\n }\n timingPoint.time = Number.parseInt(prop[0]);\n timingPoint.sampleSet = Number.parseInt(prop[3]);\n timingPoint.sampleIndex = Number.parseInt(prop[4]);\n timingPoint.volume = Number.parseInt(prop[5]);\n if (prop[7] == \"1\" || prop[7] == \"3\"){\n timingPoint.effects = Number.parseInt(prop[7]);\n } else {\n timingPoint.effects = Effect.None;\n }\n\n beatmapData.TimingPoints.TimingPoints.push(timingPoint);\n });\n }\n}\n","export class MathUtil {\n public static RadiansToDegrees(radians: number) {\n return radians * 180 / Math.PI;\n }\n\n public static DegreesToRadians(degrees: number) {\n return degrees * Math.PI / 180;\n }\n\n public static clamp(min: number, max: number, value: number) {\n return Math.min(Math.max(value, min), max);\n }\n\n public static clamp01(value: number) {\n return MathUtil.clamp(0, 1, value);\n }\n\n public static Damp(start: number, final: number, base: number, exponent: number) {\n return MathUtil.Lerp(start, final, 1 - Math.pow(base, exponent));\n }\n\n public static Lerp(start: number, final: number, ammount: number) {\n return start + (final - start) * ammount;\n }\n\n}\n","import * as TWEEN from \"@tweenjs/tween.js\";\nimport * as PIXI from \"pixi.js\";\n\nexport class Ease {\n private static previousEases: Ease[] = [];\n private easings: Easing[] = [];\n private readonly obj: PIXI.Container;\n private delay: TWEEN.Tween | null = null;\n\n private constructor(obj: PIXI.Container, dontStore: boolean) {\n this.obj = obj;\n if (!dontStore) {\n Ease.previousEases.push(this);\n }\n }\n\n public static getEase(obj: PIXI.Container, dontStore?: boolean) {\n if (dontStore == null) {\n dontStore = false;\n }\n let checkIfEaseExists = Ease.previousEases.filter((ease) => {\n return ease.obj == obj;\n });\n if (checkIfEaseExists.length > 0) {\n return checkIfEaseExists[0];\n }\n return new Ease(obj, dontStore);\n }\n\n public createTween>(value: T, newValue: T, isPrimitive: boolean, property: keyof PIXI.Container, duration: number, easingFunc: (ammount: number) => number) {\n const tweenValue = {value: 0}\n const tween = new TWEEN.Tween(isPrimitive ? tweenValue : value);\n const easing = new Easing(tween);\n tween.to(isPrimitive ? {value: 1} : newValue, duration);\n tween.easing(easingFunc);\n tween.onUpdate(() => {\n if (!this.obj.destroyed) {\n if (!isPrimitive) {\n // @ts-ignore\n this.obj[property] = value;\n } else {\n // @ts-ignore\n this.obj[property] = (tweenValue.value * (newValue.value - value.value)) + value.value;\n }\n }\n easing.onUpdate();\n });\n\n tween.onStart(() => {\n if (isPrimitive) {\n // @ts-ignore\n value.value = this.obj[property];\n }\n });\n\n\n if (this.delay == null) {\n\n tween.start();\n } else {\n this.delay.chain(tween);\n this.delay = null;\n }\n this.easings.push(easing);\n\n tween.onStop(() => {\n this.onDone(tween);\n });\n tween.onComplete(() => {\n this.onDone(tween);\n });\n return this;\n }\n\n public TransformTo(newPosition: PIXI.PointData, duration: number, easing: (ammount: number) => number) {\n this.createTween(this.obj.position, newPosition, false, \"position\", duration, easing);\n return this;\n }\n\n private onDone(tween: TWEEN.Tween) {\n this.easings = this.easings.filter((tweenInArray) => {\n return tweenInArray.tween != tween\n })\n }\n\n public ScaleTo(newScale: PIXI.PointData | number, duration: number, easing: (ammount: number) => number) {\n let _newScale: PIXI.PointData = {x: 0, y: 0};\n if (typeof newScale == \"number\") {\n _newScale.x = newScale;\n _newScale.y = newScale;\n }\n this.createTween(this.obj.scale, _newScale, false, \"scale\", duration, easing);\n return this;\n }\n\n public FadeTo(newAlpha: number, duration: number, easing: (ammount: number) => number) {\n this.createTween({value: this.obj.alpha}, {value: newAlpha}, true, \"alpha\", duration, easing);\n return this;\n }\n\n public FadeOut(duration: number, easing: (ammount: number) => number) {\n this.FadeTo(0, duration, easing);\n return this;\n }\n\n public FadeIn(duration: number, easing: (ammount: number) => number) {\n this.FadeTo(1, duration, easing);\n return this;\n }\n\n public ClearEasings() {\n this.easings.forEach((tween) => {\n tween.tween.stop();\n });\n this.easings = [];\n return this;\n }\n\n public Then(cb?: () => void) {\n let largestDuration = this.easings.sort((a, b) => {\n return a.tween.getDuration() - b.tween.getDuration()\n });\n if (largestDuration.length > 0) {\n this.delay = largestDuration[0].tween;\n if (cb != undefined) {\n largestDuration[0].tween.onComplete(() => {this.onDone(largestDuration[0].tween); cb();});\n largestDuration[0].tween.onStop(() => {this.onDone(largestDuration[0].tween); cb();});\n }\n }\n return this;\n }\n\n public OnEach(cb: () => void) {\n let largestDuration = this.easings.sort((a, b) => {\n return a.tween.getDuration() - b.tween.getDuration()\n });\n if (largestDuration.length > 0) {\n largestDuration[0].registerOnUpdate(cb);\n }\n }\n}\n\nclass Easing {\n public tween: TWEEN.Tween;\n private updateEventListeners: (() => void)[] = [];\n public constructor(tween: TWEEN.Tween) {\n this.tween = tween;\n }\n public onUpdate() {\n this.updateEventListeners.forEach((eventListener) => {\n eventListener();\n })\n }\n public registerOnUpdate(cb: () => void) {\n this.updateEventListeners.push(cb);\n }\n public unRegisterOnUpdate(cb: () => void) {\n this.updateEventListeners = this.updateEventListeners.filter((ev) => {return !(cb === ev);});\n }\n}\n","import {List} from \"@pixi/ui\";\nimport {UIUtils} from \"./UIUtils\";\n\nexport class CenteredList extends List {\n public get elementsMargin() {\n return super.elementsMargin;\n }\n public set elementsMargin(margin: number) {\n super.elementsMargin = margin;\n UIUtils.centerPivotOfList(this);\n }\n\n\n public ReCenter() {\n UIUtils.centerPivotOfList(this);\n }\n}\n","import {List} from \"@pixi/ui\";\n\nexport class UIUtils {\n public static centerPivotOfList(list: List) {\n let width = list.leftPadding;\n let height = list.topPadding;\n for (let i = 0; i < list.children.length; i++) {\n let isLast = i + 1 == list.children.length;\n switch (list.type) {\n case \"horizontal\":\n width += list.children[i].width + (!isLast? list.elementsMargin : 0);\n height += list.children[i].height;\n break;\n case \"vertical\":\n width += list.children[i].width;\n height += list.children[i].height + (!isLast? list.elementsMargin : 0);\n break;\n default:\n width += list.children[i].width + (!isLast? list.elementsMargin : 0);\n height += list.children[i].height + (!isLast? list.elementsMargin : 0);\n break;\n }\n }\n switch (list.type) {\n case \"horizontal\":\n height /= list.children.length;\n break;\n case \"vertical\":\n width /= list.children.length;\n break;\n }\n width += list.rightPadding;\n height += list.bottomPadding;\n\n list.pivot.set(width/2, height/2);\n }\n}\n","import \"./style.css\";\nimport {Application, EventSystem} from \"pixi.js\";\nimport {Main} from \"./main\";\nimport {Settings} from \"./Settings/Settings\";\nimport {Renderer} from \"./Settings/impl/Graphics/Renderer\";\nimport {MouseSensitivity} from \"./Settings/impl/Input/MouseSensitivity\";\nimport {UIScale} from \"./Settings/impl/Graphics/UIScale\";\nSettings.registerAll();\nSettings.load();\nconst gameWidth = window.innerWidth;\nconst gameHeight = window.innerHeight;\n\nconst app = new Application();\n// @ts-ignore\nglobalThis.__PIXI_APP__ = app;\nwindow.onload = async (): Promise => {\n // @ts-ignore\n const renderer = Settings.getSetting(Renderer).getValue().value as \"webgl\" | \"webgpu\";\n app.init({\n backgroundColor: \"black\",\n width: gameWidth,\n height: gameHeight,\n antialias: true,\n preference: renderer,\n resolution: window.devicePixelRatio,\n autoDensity: true\n }).then(() => {\n new Main(app);\n });\n};\n\nnavigator.mediaSession.setActionHandler('play', () => {Main.AudioEngine.GetCurrentPlayingMusicNoSilent()?.Play();});\nnavigator.mediaSession.setActionHandler('pause', () => {Main.AudioEngine.GetCurrentPlayingMusicNoSilent()?.Pause();});\nnavigator.mediaSession.setActionHandler('stop', () => {});\nnavigator.mediaSession.setActionHandler('seekbackward', () => {});\nnavigator.mediaSession.setActionHandler('seekforward', () => {});\nnavigator.mediaSession.setActionHandler('seekto', () => {});\nnavigator.mediaSession.setActionHandler('previoustrack', () => {});\nnavigator.mediaSession.setActionHandler('nexttrack', () => {});\n\nObject.defineProperty(window, \"setSensitivity\", {value: (sensitivity: number) => {\n Settings.getSetting(MouseSensitivity).setValue(sensitivity);\n}});\n\nObject.defineProperty(window, \"setRenderer\", {value: (renderer: string) => {\n let rendererSetting = Settings.getSetting(Renderer);\n rendererSetting.setValue(renderer == \"webgl\" ? rendererSetting.webglOption : rendererSetting.webGpuOption);\n window.location.reload();\n}});\n\nObject.defineProperty(window, \"setUIScale\", {value: (scale: number) => {\n Settings.getSetting(UIScale).setValue(scale);\n window.location.reload();\n}});\n","import * as PIXI from \"pixi.js\";\nimport {Application} from \"pixi.js\";\nimport {Screen} from \"./Screens/Screen\";\nimport {LoadScreen} from \"./Screens/LoadScreen/LoadScreen\";\nimport {InteractScreen} from \"./Screens/InteractScreen/InteractScreen\";\nimport {Loader} from \"./Loader\";\nimport {MenuCursor} from \"./Elements/MenuCursor/MenuCursor\";\nimport {AudioEngine} from \"./Audio/AudioEngine\";\nimport * as TWEEN from \"@tweenjs/tween.js\";\nimport {SettingsPane} from \"./Elements/Settings/SettingsPane\";\nimport {unzip} from \"unzipit\";\nimport {BeatmapParser} from \"./Util/Beatmap/Parser/BeatmapParser\";\n\nexport class Main {\n public static app: Application;\n public static mousePos = {x: 0, y: 0};\n public static pointerLockExitTime: number;\n public static cursor: MenuCursor;\n public static AudioEngine: AudioEngine;\n private static currentScreen: Screen | null;\n private static allScreens: Screen[] = [];\n private static clickArea: PIXI.Graphics = new PIXI.Graphics();\n private static doPointerLock: boolean = false;\n private static settingsPane: SettingsPane;\n private static processingOsuFile: boolean = false;\n\n public constructor(app: Application) {\n Main.app = app;\n // for testing purposes\n Main.setDropEvents();\n\n document.body.appendChild(Main.app.canvas);\n\n Main.settingsPane = new SettingsPane();\n Main.settingsPane.zIndex = 999998;\n Main.app.stage.addChild(Main.settingsPane);\n\n document.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.ctrlKey && e.code == \"KeyO\") {\n Main.settingsPane.toggle();\n }\n });\n\n this.doResize();\n window.addEventListener(\"resize\", this.doResize);\n Main.app.ticker.add(() => {\n TWEEN.update();\n })\n Main.app.stage.eventMode = \"static\";\n Main.AudioEngine = new AudioEngine();\n Main.app.stage.addEventListener(\"mousemove\", (e) => {\n Main.mousePos.x = e.clientX;\n Main.mousePos.y = e.clientY;\n if (Main.cursor) {\n Main.cursor.updateMouse();\n }\n });\n document.addEventListener(\"pointerlockchange\", this.pointerLockChanged, false);\n Main.switchScreen(new LoadScreen());\n Loader.Load(Main.AudioEngine.audioContext).then(() => {\n Main.cursor = new MenuCursor(false);\n let dialogOk = Loader.GetAudio(\"sample_dialog_ok\");\n let introTrack = Loader.Get(\"introTrianglesTrack\");\n Main.switchScreen(new InteractScreen(introTrack, dialogOk));\n });\n }\n\n // for testing purposes\n private static setDropEvents() {\n Object.defineProperty(window, \"onDropEvent\", {\n value: (e: DragEvent) => {\n e.preventDefault();\n if (Main.processingOsuFile) {\n alert(\"Another BeatMap is still processing. (Most likely transcoding a .avi file, check the console for progress) \" +\n \"Please wait for it to process and start playing before processing another one!\");\n return;\n }\n Main.processingOsuFile = true;\n if (e.dataTransfer!.items) {\n let item = [...e.dataTransfer!.items][0];\n if (item.kind == \"file\") {\n\n const file = item.getAsFile()!;\n unzip(file).then(({entries}) => {\n for (const [name, entry] of Object.entries(entries)) {\n if (name.endsWith(\".osu\")) {\n entry.text().then(async (osuFile) => {\n let beatmapData = BeatmapParser.Parse(osuFile);\n for (const [name, entry] of Object.entries(entries)) {\n let blob = await entry.blob();\n beatmapData.files.set(name, blob);\n }\n await BeatmapParser.LoadFiles(beatmapData);\n let audioFile = beatmapData.General.audioFile;\n if (audioFile) {\n let url = URL.createObjectURL(audioFile);\n Main.AudioEngine.PlayMusicImmediately(url, beatmapData, () => {\n console.log(\"Now playing \" + beatmapData.Metadata.TitleUnicode + \" - \" + beatmapData.Metadata.ArtistUnicode +\n \" (\" + beatmapData.Metadata.Title + \" - \" + beatmapData.Metadata.Artist + \")\");\n });\n }\n Main.processingOsuFile = false;\n console.log(beatmapData);\n });\n break;\n }\n }\n });\n\n }\n }\n }\n });\n\n Object.defineProperty(window, \"onDragEvent\", {\n value: (e: DragEvent) => {\n e.preventDefault();\n }\n });\n Main.app.canvas.setAttribute(\"ondrop\", \"window.onDropEvent(event);\");\n Main.app.canvas.setAttribute(\"ondragover\", \"window.onDragEvent(event);\");\n }\n\n public static lockKeyboard() {\n // @ts-ignore\n if (navigator.keyboard) {\n // @ts-ignore\n navigator.keyboard.lock([]).then(() => {\n console.log(\"Locked keyboard!\");\n if (!document.fullscreenElement) {\n console.warn(\"Keyboard lock won't work unless the user is in fullscreen (as requested by the game, not if the user just presses F11)!\");\n }\n });\n }\n }\n\n public static pointerLock() {\n try {\n this.doPointerLock = true;\n // @ts-ignore\n Main.app.canvas.requestPointerLock({\n unadjustedMovement: true,\n });\n } catch (e) {\n console.warn(\"Failed to lock cursor, error:\", e);\n this.doPointerLock = false;\n }\n\n }\n\n public static exitPointerLock() {\n this.doPointerLock = false;\n // @ts-ignore\n Main.app.canvas.exitPointerLock();\n }\n\n public static switchScreen(screen: Screen) {\n if (this.currentScreen != null) {\n this.currentScreen.zIndex = 1;\n this.currentScreen.onClose().then((lastScreen) => {\n for (let i = 0; i < this.allScreens.length; i++) {\n if (this.allScreens[i] == lastScreen) {\n this.allScreens.splice(i, 1);\n }\n }\n Main.app.ticker.remove(lastScreen.draw);\n Main.app.stage.removeChild(lastScreen);\n lastScreen.destroy();\n });\n }\n Main.app.stage.addChild(screen);\n this.allScreens.push(screen);\n this.currentScreen = screen;\n screen.start();\n screen.onResize();\n Main.app.ticker.add(screen.draw, screen);\n }\n\n public doResize(): void {\n Main.app.renderer.resize(window.innerWidth, window.innerHeight);\n Main.app.stage.scale.x = 1;\n Main.app.stage.scale.y = 1;\n if (!Main.clickArea.destroyed) {\n Main.clickArea.width = window.innerWidth;\n Main.clickArea.height = window.innerHeight;\n Main.clickArea.position.set(0, 0);\n }\n Main.allScreens.forEach((screen) => {\n screen.onResize();\n })\n Main.settingsPane.resize();\n }\n\n private pointerLockChanged(): void {\n if (!document.pointerLockElement && Main.doPointerLock) {\n PIXI.EventSystem.isPointerLocked = false;\n Main.pointerLockExitTime = Date.now();\n Main.clickArea = new PIXI.Graphics();\n Main.clickArea.rect(0, 0, 1, 1);\n Main.clickArea.fill(\"rgba(0,0,0,0.1)\");\n Main.clickArea.width = window.innerWidth;\n Main.clickArea.height = window.innerHeight;\n Main.clickArea.position.set(0, 0);\n Main.app.stage.addChild(Main.clickArea);\n Main.clickArea.eventMode = \"static\";\n Main.clickArea.cursor = \"pointer\";\n Main.cursor.PopOut();\n Main.clickArea.zIndex = 9999999;\n Main.clickArea.onclick = () => {\n if (Date.now() - Main.pointerLockExitTime < 1500) {\n return;\n }\n Main.clickArea.removeFromParent();\n Main.clickArea.destroy();\n Main.pointerLock();\n Main.cursor.PopIn();\n }\n } else {\n PIXI.EventSystem.isPointerLocked = true;\n }\n }\n\n}\n","export default \"in vec2 vUV;\\nin vec2 vPositionOffset;\\nin vec2 vPosition;\\nin vec4 vColorTint;\\nuniform sampler2D uTexture;\\nuniform float time;\\n\\nvoid main() {\\n float a = ((vPositionOffset.y + vPosition.y)/1200.0) - 0.1;\\n vec4 color = texture(uTexture, vUV);\\n if (a > 1.0) {\\n a = 1.0;\\n }\\n gl_FragColor = (color*vColorTint)*a;\\n}\";","export default \"in vec2 aPosition;\\nin vec2 aUV;\\nin vec2 aPositionOffset;\\nin vec4 aColorTint;\\n\\nout vec2 vUV;\\nout vec2 vPositionOffset;\\nout vec2 vPosition;\\nout vec4 vColorTint;\\n\\nuniform mat3 uProjectionMatrix;\\nuniform mat3 uWorldTransformMatrix;\\nuniform mat3 uTransformMatrix;\\n\\n\\nvoid main() {\\n\\n mat3 mvp = uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\\n gl_Position = vec4((mvp * vec3(aPosition + aPositionOffset, 1.0)).xy, 0.0, 1.0);\\n vPositionOffset = aPositionOffset;\\n vUV = aUV;\\n vPosition = aPosition;\\n vColorTint = aColorTint;\\n}\";","export default \"struct GlobalUniforms {\\n uProjectionMatrix:mat3x3,\\n uWorldTransformMatrix:mat3x3,\\n uWorldColorAlpha: vec4,\\n uResolution: vec2,\\n}\\n\\nstruct LocalUniforms {\\n uTransformMatrix:mat3x3,\\n uColor:vec4,\\n uRound:f32,\\n}\\n\\n\\n@group(0) @binding(0) var globalUniforms : GlobalUniforms;\\n@group(1) @binding(0) var localUniforms : LocalUniforms;\\n\\nstruct VertexOutput {\\n @builtin(position) position: vec4,\\n @location(0) vUV: vec2,\\n @location(1) vPositionOffset: vec2,\\n @location(2) vPosition: vec2,\\n @location(3) vColorTint: vec4\\n};\\n\\n\\n@vertex\\nfn mainVert(\\n @location(0) aPosition : vec2,\\n @location(1) aUV : vec2,\\n @location(2) aColorTint : vec4,\\n @location(3) aPositionOffset : vec2,\\n) -> VertexOutput {\\n var mvp = globalUniforms.uProjectionMatrix\\n * globalUniforms.uWorldTransformMatrix\\n * localUniforms.uTransformMatrix;\\n\\n var output: VertexOutput;\\n\\n output.position = vec4(mvp * vec3(aPosition+aPositionOffset, 1.0), 1.0);\\n output.vUV = aUV;\\n output.vPosition = aPosition;\\n output.vPositionOffset = aPositionOffset;\\n output.vColorTint = aColorTint;\\n\\n return output;\\n};\\n\\nstruct WaveUniforms {\\n time:f32,\\n}\\n\\n@group(2) @binding(1) var uTexture : texture_2d;\\n@group(2) @binding(2) var uSampler : sampler;\\n@group(2) @binding(3) var waveUniforms : WaveUniforms;\\n\\n@fragment\\nfn mainFrag(\\n @location(0) vUV: vec2,\\n @location(1) vPositionOffset: vec2,\\n @location(2) vPosition: vec2,\\n @location(3) vColorTint: vec4\\n) -> @location(0) vec4 {\\n var a: f32 = ((vPositionOffset.y + vPosition.y)/1200.0) - 0.1;\\n let color: vec4 = textureSample(uTexture, uSampler, vUV);\\n if (a > 1.0){\\n a = 1.0;\\n }\\n return (color*vColorTint)*a;\\n};\";","export default \"in vec4 vColor;\\nin vec2 vUV;\\n\\nuniform sampler2D uTexture;\\nuniform float progress;\\n\\nvoid main() {\\n vec4 color = texture2D(uTexture, vUV);\\n float a = vColor.a * color.a;\\n vec4 _vColor = vec4(smoothstep(0.88, 1.0, color.a))*vColor;\\n vec4 outColor = (color.r < progress) ? vec4(_vColor.rgb * a, a) : vec4(0.0);\\n gl_FragColor = outColor;\\n}\\n\";","export default \"in vec2 aPosition;\\nin vec4 aColor;\\nin vec2 aUV;\\n\\nout vec4 vColor;\\nout vec2 vUV;\\n\\nuniform mat3 uProjectionMatrix;\\nuniform mat3 uWorldTransformMatrix;\\n\\nuniform mat3 uTransformMatrix;\\n\\n\\nvoid main() {\\n\\n mat3 mvp = uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\\n gl_Position = vec4((mvp * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vColor = aColor;\\n vUV = aUV;\\n}\\n\";","export default \"struct GlobalUniforms {\\n uProjectionMatrix:mat3x3,\\n uWorldTransformMatrix:mat3x3,\\n uWorldColorAlpha: vec4,\\n uResolution: vec2,\\n}\\n\\nstruct LocalUniforms {\\n uTransformMatrix:mat3x3,\\n uColor:vec4,\\n uRound:f32,\\n}\\n\\n\\n@group(0) @binding(0) var globalUniforms : GlobalUniforms;\\n@group(1) @binding(0) var localUniforms : LocalUniforms;\\n\\nstruct VertexOutput {\\n @builtin(position) position: vec4,\\n @location(0) vUV: vec2,\\n @location(1) vColor: vec4,\\n};\\n\\n\\n@vertex\\nfn mainVert(@location(0) aPosition : vec2, @location(1) aUV : vec2, @location(2) aColor: vec4\\n) -> VertexOutput {\\n var mvp = globalUniforms.uProjectionMatrix\\n * globalUniforms.uWorldTransformMatrix\\n * localUniforms.uTransformMatrix;\\n\\n var output: VertexOutput;\\n\\n output.position = vec4(mvp * vec3(aPosition, 1.0), 1.0);\\n output.vUV = aUV;\\n output.vColor = aColor;\\n\\n return output;\\n};\\n\\nstruct ProgressUniform {\\n progress:f32\\n}\\n\\n@group(2) @binding(1) var uTexture : texture_2d;\\n@group(2) @binding(2) var uSampler : sampler;\\n@group(2) @binding(3) var uProgress : ProgressUniform;\\n\\n@fragment\\nfn mainFrag(@location(0) vUV: vec2, @location(1) vColor: vec4) -> @location(0) vec4 {\\n let color: vec4 = textureSample(uTexture, uSampler, vUV);\\n let a: f32 = color.a;\\n let _vColor: vec4 = smoothstep(0.88, 1.0, color.a) * vColor;\\n var outColor: vec4 = vec4(0.0);\\n if (color.r < uProgress.progress) {\\n outColor = vec4(_vColor.rgb * a, a);\\n }\\n return outColor;\\n};\\n\";","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.hmd = function(module) {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: function() {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkkosu\"] = self[\"webpackChunkkosu\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [151], function() { return __webpack_require__(29820); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","main_1","require","EventTypes_1","Audio","audio","source","mediaSource","mediaAudioElement","id","isPaused","this","_useMediaSource","paused","isPlaying","nodes","tempArrayMain","Float32Array","tempArrayL","tempArrayR","LeftChannel","RightChannel","FrequencyAmplitudes","_connectedToContext","_onEndCallback","timeStarted","beatmap","GetMaximumAudioLevel","Math","max","GetAverageAudioLevel","Create","audioContext","useMediaSource","Error","createMediaElementSource","onpause","ended","Play","createBufferSource","buffer","AddAudioNode","node","push","GetNode","type","filter","length","ConnectToContext","howToConnectFunction","forEach","index","connect","AnalyserNode","destination","play","backgroundVideo","Events","find","e","eventType","EventTypes","VIDEO","texture","resource","startPromise","then","start","Pause","pause","Stop","stop","SetTime","timeMS","currentTime","GetDuration","duration","GetCurrentTime","Date","now","RegisterEndCallBack","callback","onended","exports","fadingOut","fadeOutTimeout","playingCallback","FadeOut","clearTimeout","gainNodes","GainNode","gain","linearRampToValueAtTime","Main","AudioEngine","setTimeout","PlayingAudios_1","Audio_1","BeatmapData_1","UnInheritedTimingPoint_1","Effect_1","_playingAudios","_musicQueue","_audioIdTicker","_changeCallbacks","silentMusic","createSilentMusic","useSilentMusic","constructor","AudioContext","PlayingAudios","app","ticker","add","update","UpdateMusicQueue","_play","cb","mapAudio","MapAudio","BeatmapData","timingPoint","UnInheritedTimingPoint","time","beatLength","effects","Effect","None","TimingPoints","addMusicChangeEventListener","removeMusicChangeEventListener","GetCurrentPlayingMusic","GetCurrentPlayingMusicNoSilent","PlayEffect","pitch","audioObj","AddToMusicQueue","beatMapData","musicPlayingCallback","mapAudioObj","document","createElement","src","PlayMusicImmediately","currentPlaying","currentPlayingNoSilent","analyzerMain","analyzerL","analyzerR","getFloatFrequencyData","i","Infinity","getFloatTimeDomainData","avgL","avgR","value","createGain","analyzer","createAnalyser","fftSize","smoothingTimeConstant","splitter","createChannelSplitter","audios","playbackRate","splice","audioInArr","PIXI","__importStar","MathUtil_1","LogoVisualizer","Container","static","frequencyAmplitudes","temporalAmplitudes","graphics","Graphics","index_change","bar_length","bars_per_visualiser","visualiser_rounds","decay_per_millisecond","time_between_updates","amplitude_dead_zone","indexOffset","firstDraw","alpha","number","super","blendMode","addChild","eventMode","setInterval","updateAmplitudes","draw","clear","decayFactor","deltaMS","j","rotation","MathUtil","DegreesToRadians","rotationCos","cos","rotationSin","sin","barPosition","x","size","y","barSize","sqrt","amplitudeOffset","moveTo","lineTo","stroke","color","width","audioTime","GetCurrentTimingPoints","targetAmplitude","KiaiTime","LogoVisualizer_1","MenuLogoVisualizer","TWEEN","Ease_1","LoadAnim","bg","arc","arcContainer","animInterval","container","bgContainer","bgRotation","bgColor","arcColor","pivot","set","PI","roundRect","fill","cap","scale","Ease","getEase","ScaleTo","Easing","Quadratic","InOut","FadeIn","doAnims","createTween","angle","getWidth","getHeight","deltaTime","destroy","_options","clearInterval","Screen_1","LogoTrackingContainer_1","ButtonSystem","menuBG","isOpened","logo","state","ButtonSystemState","Initial","logoTrackingContainer","LogoTrackingContainer","menuHeight","State","lastState","updateLogoState","console","log","name","arguments","undefined","Exit","Close","TopLevel","Open","ClearEasings","Screen","getScaleBasedOffScreenSize","Linear","In","Quintic","Out","drawMenuBG","Action","onOsuLogo","rect","Edit","Sinusoidal","isOpen","onResize","position","window","innerHeight","innerWidth","Logo","easing","startPosition","startTime","visual_box_size","StartTracking","IsTracking","StopTracking","ComputeLogoTrackingPosition","pos","Update","Triangles_1","Loader_1","MenuLogoVisualizer_1","OsuLogo","outline","visualizer","triangles","Triangles","flash","logoContainer","logoBounceContainer","logoBeatContainer","logoAmplitudeContainer","logoHoverContainer","rippleContainer","ripple","defaultVisualizerAlpha","early_activation","timeElapsedSinceLastBeat","timeUntilNextBeat","lastTimeElapasedSinceLastBeat","selectSample","Loader","GetAudio","backToLogoSample","isMouseDown","mouseDownPosition","SizeForFlow","Sprite","from","anchor","mask","circle","height","hitArea","Circle","onmouseenter","_onmouseenter","onmouseleave","_onmouseleave","onmousedown","_onmousedown","onclick","_onclick","stage","addEventListener","_onmouseup","Elastic","mousePos","Exponential","TransformTo","GetCurrentUninheritedTimingPoint","Velocity","Damp","maxAmplitude","onNewBeat","change","pow","amplitudeAdjust","min","Then","FadeTo","osuCircleTriangles_vert_1","__importDefault","osuCircleTriangles_frag_1","osuCircleTriangles_wgsl_1","bgGradient","timeSinceLastSpawn","instancePositionBuffer","totalTriangles","colorStops","FillGradient","ratio","addColorStop","random","velocity","randVelocity","Buffer","data","usage","BufferUsage","VERTEX","COPY_DST","Color","geometry","Geometry","attributes","aPosition","aUV","aColorTint","red","green","blue","aPositionOffset","instance","indexBuffer","instanceCount","gl","vertex","default","fragment","gpu","entryPoint","triangleGraphic","triangleTexture","renderer","generateTexture","shader","Shader","resources","uTexture","uSampler","style","waveUniforms","triangleMesh","Mesh","options","count","triangle","u1","u2","randStdNormal","MenuCursor","mouseCursor","mouseCursorAdditive","mouseContainer","animContainer","animRotationContainer","dragRotationState","DragRotationState","NotDragging","lastDragRotationState","mouseHideContainer","elastic_const2","elastic_const","elastic_offset_quarter","posMouseDown","mouseIsDown","cursorTapSample","mouseButtonClicked","visible","updateMouse","tint","zIndex","addEventListeners","button","DragStarted","Rotating","abs","PopIn","PopOut","distance","offsetX","offsetY","degrees","RadiansToDegrees","atan2","diff","Background","destroying","show","fadeOutDuration","BackgroundContainer","children","child","destroyed","Background_1","RandomBackground","parallaxMultiplier","getScreenWidth","getScreenHeight","newRandomBG","background","BACKGROUND","video","Promise","resolve","setBGContainer","setBG","bgSprite","useSeasonalBackgrounds","seasonalBackgroundsNum","randomNum","defaultBackgroundsNum","round","Texture","onClose","sprite","resizeSprite","scaleFactor","texWidth","texHeight","SettingsPane","resize","open","Cubic","toggle","close","addToLoadList","loadList","url","isAudio","pixiBundleName","Get","result","loadedList","loadedObj","GetString","dataString","dataAudio","addBackgrounds","fetch","encodeURIComponent","res","json","backgrounds","loadParser","catch","error","warn","Load","nonPixi","pixi","pixiwithBundles","loadedAssets","erroredAssets","loadObj","added","loadObjs","incrementLoadAssetNumber","errored","response","blob","isText","text","arrayBuffer","arrBuff","decodeAudioData","audioBuff","bundle","assets","alias","Assets","addBundle","loadBundle","IntroScreen_1","InteractScreen","text2","textContainer","textContainerContainer","introTrack","clickSound","clickArea","Text","fontFamily","fontSize","align","cursor","clicked","switchScreen","IntroScreen","body","pointerLock","lockKeyboard","ontap","GlitchingTriangles","bounds","randX","x1","x2","randY","y1","y2","unzipit_1","GlitchingTriangles_1","MainMenu_1","LazerLogo_1","BeatmapParser_1","UIUtils_1","CenteredList_1","introTrackUrl","doTextSpacingAnim","ruleSetContainer","ruleSetList","CenteredList","logoContainerContainer","lazerLogo","LazerLogo","flashed","standard","taiko","ctb","mania","completionPromise","welcomeText","letterSpacing","URL","createObjectURL","entries","unzip","entry","Object","endsWith","async","beatmapData","BeatmapParser","Parse","osuFile","files","LoadFiles","audioFile","General","afterAudioPlay","glitchingInterval","padding","elementsMargin","UIUtils","centerPivotOfList","MainMenu","ReCenter","LogoAnimation_1","highlight","textureHighlight","textureBackground","LogoAnimation","dummy","OnEach","setProgress","logoAnimation_vert_1","logoAnimation_frag_1","logoAnimation_wgsl_1","uProgress","progress","quadGeometry","aColor","quad","uniforms","LoadAnim_1","LoadScreen","loadAnim","RandomBackground_1","OsuLogo_1","ButtonSystem_1","osuCircle","menu","Settings_1","UIScale_1","uiScale","Settings","getSetting","UIScale","getValue","SettingsCategory","info","SettingData","register","setting","onValueChanged","Setting_1","DropdownSetting","Setting","getDefaultValue","defaultValue","setValue","list","option","displayName","save","loadFromSaveValue","RangeSetting","clamp","minValue","maxValue","Renderer_1","MouseSensitivity_1","registerAll","Renderer","MouseSensitivity","load","settingSaveDataString","localStorage","getItem","settings","getList","JSON","parse","corrupt","stringify","category","settingObj","_settingObj","reset","settingSaveData","setItem","removeItem","settingsList","_setting","getSettingData","DropdownSetting_1","webglOption","webGpuOption","RangeSetting_1","increment","pixi_js_1","Input","EventSystem","cursorSensitivity","GeneralData_1","EditorData_1","Metadata_1","DifficultyData_1","EventsData_1","TimingPointsData_1","ColorsData_1","Map","GeneralData","Editor","EditorData","Metadata","Difficulty","DifficultyData","EventsData","TimingPointsData","Colors","ColorsData","HPDrainRate","CircleSize","OverallDifficulty","ApproachRate","SliderMultiplier","SliderTickRate","Bookmarks","DistanceSpacing","BeatDivisor","GridSize","TimelineZoom","Event_1","EventBackground","Event","filename","xOffset","yOffset","EventBreak","BREAK","endTime","EventVideo","Countdown","Countdown_1","SampleSet_1","Mode_1","OverlayPosition_1","AudioFilename","AudioLeadIn","AudioHash","PreviewTime","Normal","SampleSet","StackLeniency","Mode","OSU","LetterboxInBreaks","StoryFireInFront","UseSkinSprites","AlwaysShowPlayfield","OverlayPosition","NoChange","SkinPreference","EpilepsyWarning","CountdownOffset","SpecialStyle","WidescreenStoryboard","SamplesMatchPlaybackRate","Title","TitleUnicode","Artist","ArtistUnicode","Creator","Version","Source","Tags","BeatmapID","BeatmapSetID","TimingPoint_1","InheritedTimingPoint","TimingPoint","sliderVelocityMultiplier","sampleSet","sampleIndex","volume","InheritedTimingPoint_1","toReturn","unInheritedTimingPoint","meter","TimingPointsParser_1","GeneralParser_1","EditorParser_1","MetadataParser_1","DifficultyParser_1","EventsParser_1","osuFileContent","storyBoardFileContent","osuFileContentLines","split","GeneralParser","ParseGeneral","GetSection","EditorParser","ParseEditor","MetadataParser","ParseMetadata","DifficultyParser","ParseDifficulty","EventsParser","ParseEvents","TimingPointsParser","ParseTimingPoints","sectionName","section","str","startsWith","AutoParse","sectionType","propValue","beatmapDataSection","key","keyExists","sectionKey","toString","isNumber","test","parseFloat","substring","num","EventBackground_1","EventVideo_1","EventBreak_1","ffmpeg_1","event","values","replaceAll","parseInt","isNaN","eventKey","file","get","failed","cacheHit","aviTranscodedVideoCache","cache","beatmapSID","filePath","delete","revokeObjectURL","ffmpeg","FFmpeg","on","_ref","classWorker","core","wasm","worker","classWorkerURL","coreURL","wasmURL","workerURL","writeFile","Uint8Array","exec","readFile","terminate","newFile","Blob","prop","Number","radians","clamp01","final","base","exponent","Lerp","ammount","easings","obj","delay","dontStore","previousEases","checkIfEaseExists","ease","newValue","isPrimitive","property","easingFunc","tweenValue","tween","Tween","to","onUpdate","onStart","chain","onStop","onDone","onComplete","newPosition","tweenInArray","newScale","_newScale","newAlpha","largestDuration","sort","a","b","getDuration","registerOnUpdate","updateEventListeners","eventListener","unRegisterOnUpdate","ev","ui_1","List","margin","leftPadding","topPadding","isLast","rightPadding","bottomPadding","gameWidth","gameHeight","Application","globalThis","__PIXI_APP__","onload","init","backgroundColor","antialias","preference","resolution","devicePixelRatio","autoDensity","navigator","mediaSession","setActionHandler","defineProperty","sensitivity","rendererSetting","location","reload","LoadScreen_1","InteractScreen_1","MenuCursor_1","AudioEngine_1","SettingsPane_1","setDropEvents","appendChild","canvas","settingsPane","ctrlKey","code","doResize","clientX","clientY","pointerLockChanged","dialogOk","preventDefault","processingOsuFile","alert","dataTransfer","items","item","kind","getAsFile","setAttribute","keyboard","lock","fullscreenElement","doPointerLock","requestPointerLock","unadjustedMovement","exitPointerLock","screen","currentScreen","lastScreen","allScreens","remove","removeChild","pointerLockElement","isPointerLocked","pointerLockExitTime","removeFromParent","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","module","loaded","__webpack_modules__","call","m","O","chunkIds","fn","priority","notFulfilled","fulfilled","keys","every","r","d","definition","o","enumerable","hmd","create","prototype","hasOwnProperty","Symbol","toStringTag","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","self","bind","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/game.a8e399e83f9d5478ec47.js b/game.a8e399e83f9d5478ec47.js new file mode 100644 index 0000000..2cb8889 --- /dev/null +++ b/game.a8e399e83f9d5478ec47.js @@ -0,0 +1,3 @@ +/*! For license information please see game.a8e399e83f9d5478ec47.js.LICENSE.txt */ +(self.webpackChunkkosu=self.webpackChunkkosu||[]).push([[151],{81354:function(e){var t;self,t=()=>(()=>{"use strict";var e={m:{},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},u:e=>e+".ffmpeg.js"};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var t;e.g.importScripts&&(t=e.g.location+"");var r=e.g.document;if(!t&&r&&(r.currentScript&&(t=r.currentScript.src),!t)){var i=r.getElementsByTagName("script");if(i.length)for(var n=i.length-1;n>-1&&!t;)t=i[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t})(),e.b=document.baseURI||self.location.href;var t,r={};e.r(r),e.d(r,{FFmpeg:()=>o}),function(e){e.LOAD="LOAD",e.EXEC="EXEC",e.WRITE_FILE="WRITE_FILE",e.READ_FILE="READ_FILE",e.DELETE_FILE="DELETE_FILE",e.RENAME="RENAME",e.CREATE_DIR="CREATE_DIR",e.LIST_DIR="LIST_DIR",e.DELETE_DIR="DELETE_DIR",e.ERROR="ERROR",e.DOWNLOAD="DOWNLOAD",e.PROGRESS="PROGRESS",e.LOG="LOG",e.MOUNT="MOUNT",e.UNMOUNT="UNMOUNT"}(t||(t={}));const i=(()=>{let e=0;return()=>e++})(),n=(new Error("unknown message type"),new Error("ffmpeg is not loaded, call `await ffmpeg.load()` first")),s=new Error("called FFmpeg.terminate()");new Error("failed to import ffmpeg-core.js");class o{#e=null;#t={};#r={};#i=[];#n=[];loaded=!1;#s=()=>{this.#e&&(this.#e.onmessage=({data:{id:e,type:r,data:i}})=>{switch(r){case t.LOAD:this.loaded=!0,this.#t[e](i);break;case t.MOUNT:case t.UNMOUNT:case t.EXEC:case t.WRITE_FILE:case t.READ_FILE:case t.DELETE_FILE:case t.RENAME:case t.CREATE_DIR:case t.LIST_DIR:case t.DELETE_DIR:this.#t[e](i);break;case t.LOG:this.#i.forEach((e=>e(i)));break;case t.PROGRESS:this.#n.forEach((e=>e(i)));break;case t.ERROR:this.#r[e](i)}delete this.#t[e],delete this.#r[e]})};#o=({type:e,data:t},r=[],s)=>this.#e?new Promise(((n,o)=>{const a=i();this.#e&&this.#e.postMessage({id:a,type:e,data:t},r),this.#t[a]=n,this.#r[a]=o,s?.addEventListener("abort",(()=>{o(new DOMException(`Message # ${a} was aborted`,"AbortError"))}),{once:!0})})):Promise.reject(n);on(e,t){"log"===e?this.#i.push(t):"progress"===e&&this.#n.push(t)}off(e,t){"log"===e?this.#i=this.#i.filter((e=>e!==t)):"progress"===e&&(this.#n=this.#n.filter((e=>e!==t)))}load=({classWorkerURL:r,...i}={},{signal:n}={})=>(this.#e||(this.#e=r?new Worker(new URL(r,"file:///home/jeromewu/ffmpeg.wasm/packages/ffmpeg/dist/esm/classes.js"),{type:"module"}):new Worker(new URL(e.p+e.u(814),e.b),{type:void 0}),this.#s()),this.#o({type:t.LOAD,data:i},void 0,n));exec=(e,r=-1,{signal:i}={})=>this.#o({type:t.EXEC,data:{args:e,timeout:r}},void 0,i);terminate=()=>{const e=Object.keys(this.#r);for(const t of e)this.#r[t](s),delete this.#r[t],delete this.#t[t];this.#e&&(this.#e.terminate(),this.#e=null,this.loaded=!1)};writeFile=(e,r,{signal:i}={})=>{const n=[];return r instanceof Uint8Array&&n.push(r.buffer),this.#o({type:t.WRITE_FILE,data:{path:e,data:r}},n,i)};mount=(e,r,i)=>this.#o({type:t.MOUNT,data:{fsType:e,options:r,mountPoint:i}},[]);unmount=e=>this.#o({type:t.UNMOUNT,data:{mountPoint:e}},[]);readFile=(e,r="binary",{signal:i}={})=>this.#o({type:t.READ_FILE,data:{path:e,encoding:r}},void 0,i);deleteFile=(e,{signal:r}={})=>this.#o({type:t.DELETE_FILE,data:{path:e}},void 0,r);rename=(e,r,{signal:i}={})=>this.#o({type:t.RENAME,data:{oldPath:e,newPath:r}},void 0,i);createDir=(e,{signal:r}={})=>this.#o({type:t.CREATE_DIR,data:{path:e}},void 0,r);listDir=(e,{signal:r}={})=>this.#o({type:t.LIST_DIR,data:{path:e}},void 0,r);deleteDir=(e,{signal:r}={})=>this.#o({type:t.DELETE_DIR,data:{path:e}},void 0,r)}return r})(),e.exports=t()},5538:function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r={grad:.9,turn:360,rad:360/(2*Math.PI)},i=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},n=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},s=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},o=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},a=function(e){return{r:s(e.r,0,255),g:s(e.g,0,255),b:s(e.b,0,255),a:s(e.a)}},l=function(e){return{r:n(e.r),g:n(e.g),b:n(e.b),a:n(e.a,3)}},u=/^#([0-9a-f]{3,8})$/i,h=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},c=function(e){var t=e.r,r=e.g,i=e.b,n=e.a,s=Math.max(t,r,i),o=s-Math.min(t,r,i),a=o?s===t?(r-i)/o:s===r?2+(i-t)/o:4+(t-r)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:n}},d=function(e){var t=e.h,r=e.s,i=e.v,n=e.a;t=t/360*6,r/=100,i/=100;var s=Math.floor(t),o=i*(1-r),a=i*(1-(t-s)*r),l=i*(1-(1-t+s)*r),u=s%6;return{r:255*[i,a,o,o,l,i][u],g:255*[l,i,i,a,o,o][u],b:255*[o,o,l,i,i,a][u],a:n}},p=function(e){return{h:o(e.h),s:s(e.s,0,100),l:s(e.l,0,100),a:s(e.a)}},f=function(e){return{h:n(e.h),s:n(e.s),l:n(e.l),a:n(e.a,3)}},m=function(e){return d((r=(t=e).s,{h:t.h,s:(r*=((i=t.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:t.a}));var t,r,i},g=function(e){return{h:(t=c(e)).h,s:(n=(200-(r=t.s))*(i=t.v)/100)>0&&n<200?r*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,r,i,n},_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,x=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(e){var t=u.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?n(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?n(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=b.exec(e)||v.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({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:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=_.exec(e)||x.exec(e);if(!t)return null;var i,n,s=p({h:(i=t[1],n=t[2],void 0===n&&(n="deg"),Number(i)*(r[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return m(s)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,s=e.a,o=void 0===s?1:s;return i(t)&&i(r)&&i(n)?a({r:Number(t),g:Number(r),b:Number(n),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,s=e.a,o=void 0===s?1:s;if(!i(t)||!i(r)||!i(n))return null;var a=p({h:Number(t),s:Number(r),l:Number(n),a:Number(o)});return m(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,a=e.a,l=void 0===a?1:a;if(!i(t)||!i(r)||!i(n))return null;var u=function(e){return{h:o(e.h),s:s(e.s,0,100),v:s(e.v,0,100),a:s(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(l)});return d(u)},"hsv"]]},T=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=l(this.rgba)).r,r=e.g,i=e.b,o=(s=e.a)<1?h(n(255*s)):"","#"+h(t)+h(r)+h(i)+o;var e,t,r,i,s,o},e.prototype.toRgb=function(){return l(this.rgba)},e.prototype.toRgbString=function(){return t=(e=l(this.rgba)).r,r=e.g,i=e.b,(n=e.a)<1?"rgba("+t+", "+r+", "+i+", "+n+")":"rgb("+t+", "+r+", "+i+")";var e,t,r,i,n},e.prototype.toHsl=function(){return f(g(this.rgba))},e.prototype.toHslString=function(){return t=(e=f(g(this.rgba))).h,r=e.s,i=e.l,(n=e.a)<1?"hsla("+t+", "+r+"%, "+i+"%, "+n+")":"hsl("+t+", "+r+"%, "+i+"%)";var e,t,r,i,n},e.prototype.toHsv=function(){return e=c(this.rgba),{h:n(e.h),s:n(e.s),v:n(e.v),a:n(e.a,3)};var e},e.prototype.invert=function(){return P({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),P(E(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),P(E(this.rgba,-e))},e.prototype.grayscale=function(){return P(E(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),P(A(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),P(A(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?P({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):n(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=g(this.rgba);return"number"==typeof e?P({h:e,s:t.s,l:t.l,a:t.a}):n(t.h)},e.prototype.isEqual=function(e){return this.toHex()===P(e).toHex()},e}(),P=function(e){return e instanceof M?e:new M(e)},R=[];t.Colord=M,t.colord=P,t.extend=function(e){e.forEach((function(e){R.indexOf(e)<0&&(e(M,y),R.push(e))}))},t.getFormat=function(e){return S(e)[1]},t.random=function(){return new M({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}},13185:function(e){e.exports=function(e,t){var r={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"},i={};for(var n in r)i[r[n]]=n;var s={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var n,o,a=i[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var l=this.toRgb(),u=1/0,h="black";if(!s.length)for(var c in r)s[c]=new e(r[c]).toRgb();for(var d in r){var p=(n=l,o=s[d],Math.pow(n.r-o.r,2)+Math.pow(n.g-o.g,2)+Math.pow(n.b-o.b,2));p(((e,t,r)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class a extends n.ButtonEvents{constructor(e){super(),o(this,"_view"),e&&(this.view=e,this.enabled=!0)}set view(e){!!this._view&&this.disconnectEvents(this._view),this._view=e,this.connectEvents(this._view)}get view(){return this._view}set enabled(e){this.view?(this.view.eventMode=e?"static":"auto",this.view.cursor=e?"pointer":"default",!e&&this.isDown&&this.processUp()):console.error("Button view is not set. Please set it before enabling the button.")}get enabled(){return"static"===this.view.eventMode}}class l extends i.Container{constructor(e){super(),o(this,"button"),o(this,"onDown"),o(this,"onUp"),o(this,"onUpOut"),o(this,"onOut"),o(this,"onPress"),o(this,"onHover"),this.button=new a(this),this.button.enabled=!0,e&&this.addChild(e),this.onPress=this.button.onPress,this.onDown=this.button.onDown,this.onUp=this.button.onUp,this.onHover=this.button.onHover,this.onOut=this.button.onOut,this.onUpOut=this.button.onUpOut}set enabled(e){this.button.enabled=e}get enabled(){return this.button.enabled}}t.Button=a,t.ButtonContainer=l},53435:function(e,t,r){"use strict";var i=r(58687),n=r(24242),s=Object.defineProperty,o=(e,t,r)=>(((e,t,r)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);t.ButtonEvents=class{constructor(){o(this,"_isMouseIn"),o(this,"_isDown"),o(this,"onDown"),o(this,"onUp"),o(this,"onUpOut"),o(this,"onOut"),o(this,"onPress"),o(this,"onHover"),this.onPress=new n.Signal,this.onDown=new n.Signal,this.onUp=new n.Signal,this.onHover=new n.Signal,this.onOut=new n.Signal,this.onUpOut=new n.Signal}connectEvents(e){i.isMobile.any?(e.on("pointerdown",this.processDown,this),e.on("pointerup",this.processUp,this),e.on("pointerupoutside",this.processUpOut,this),e.on("pointerout",this.processOut,this),e.on("pointertap",this.processPress,this),e.on("pointerover",this.processOver,this)):(e.on("mousedown",this.processDown,this),e.on("mouseup",this.processUp,this),e.on("mouseupoutside",this.processUpOut,this),e.on("mouseout",this.processOut,this),e.on("click",this.processPress,this),e.on("mouseover",this.processOver,this))}disconnectEvents(e){i.isMobile.any?(e.off("pointerdown",this.processDown,this),e.off("pointerup",this.processUp,this),e.off("pointerupoutside",this.processUpOut,this),e.off("pointerout",this.processOut,this),e.off("pointertap",this.processPress,this),e.off("pointerover",this.processOver,this)):(e.off("mousedown",this.processDown,this),e.off("mouseup",this.processUp,this),e.off("mouseupoutside",this.processUpOut,this),e.off("mouseout",this.processOut,this),e.off("click",this.processPress,this),e.off("mouseover",this.processOver,this))}processDown(e){this._isDown=!0,this.onDown.emit(this,e),this.down(e)}processUp(e){this._isDown&&(this.onUp.emit(this,e),this.up(e)),this._isDown=!1}processUpOut(e){this._isDown&&(this.onUp.emit(this,e),this.onUpOut.emit(this,e),this.up(e),this.upOut(e)),this._isDown=!1}processOut(e){this._isMouseIn&&(this._isMouseIn=!1,this.onOut.emit(this,e),this.out(e))}processPress(e){this._isDown=!1,this.onPress.emit(this,e),this.press(e)}processOver(e){i.isMobile.any||(this._isMouseIn=!0,this.onHover.emit(this,e),this.hover(e))}down(e){}up(e){}upOut(e){}out(e){}press(e){}hover(e){}get isDown(){return this._isDown}}},15856:function(e,t,r){"use strict";var i=r(58687),n=r(24242),s=r(62683),o=r(45641),a=r(25529),l=Object.defineProperty,u=(e,t,r)=>(((e,t,r)=>{t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class h extends s.Switcher{constructor(e){super(),u(this,"labelText"),u(this,"onCheck"),u(this,"_style"),u(this,"_textClass"),this._textClass=e.TextClass??i.Text,this.text=e.text,this.style=e.style,this.checked=e.checked,this.triggerEvents=["onPress"],this.innerView.cursor="pointer",this.onCheck=new n.Signal,this.onChange.connect((()=>this.onCheck.emit(this.checked)))}addLabel(e,t){e&&(this.labelText=new this._textClass({text:e??"",style:t??this._style?.text}),this.addChild(this.labelText),this.labelText.cursor="pointer",this.labelText.eventMode="static",this.labelText.on("pointertap",(()=>this.checked=!this.checked)))}set text(e){e?this.labelText?this.labelText.text=e:this.addLabel(e):o.cleanup(this.labelText)}get text(){return this.labelText?.text??""}set style(e){const t=this.checked;this._style=e;const{unchecked:r,checked:i}=e,n=a.getView(r),s=a.getView(i);this.views=[n,s],t?(s.visible=!0,this.active=1):n.visible=!0,this.labelText?(s.visible=!0,this.active=1,e.text&&(this.labelText.style=e.text),this.labelText.x=n.width+10+(e.textOffset?.x??0),this.labelText.y=(n.height-this.labelText.height)/2+(e.textOffset?.y??0)):n.visible=!0}get style(){return this._style}get checked(){return 1===this.active}set checked(e){this.switch(e?1:0)}forceCheck(e){this.forceSwitch(e?1:0)}}t.CheckBox=h},21112:function(e,t,r){"use strict";var i=r(58687),n=Object.defineProperty,s=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class o extends i.Container{constructor(e){super(),s(this,"_progress",0),s(this,"options"),s(this,"bgCircle",new i.Graphics),s(this,"fillCircle",new i.Graphics),s(this,"innerView",new i.Container),this.options=e,this.addChild(this.innerView),this.innerView.addChild(this.bgCircle,this.fillCircle),this.addBackground(),e.value&&(this.progress=e.value)}addBackground(){const{backgroundColor:e,lineWidth:t,radius:r,backgroundAlpha:i}=this.options;let n=1;i>0&&(n=i),void 0===e&&(n=1e-6),this.bgCircle.circle(0,0,r).stroke({width:t,color:e,alpha:n})}set progress(e){e>100&&(e=100),e<0&&(e=0),this._progress=e;const{lineWidth:t,radius:r,fillColor:n,fillAlpha:s,cap:o}=this.options;if(0===e&&0===s)return void this.fillCircle.clear();const a=3.6*e;this.fillCircle.clear().arc(0,0,r,-90*i.DEG_TO_RAD,(-90+a)*i.DEG_TO_RAD).stroke({width:t,color:n,cap:o,alpha:s})}get progress(){return this._progress}}t.CircularProgressBar=o},99781:function(e,t,r){"use strict";var i=r(24242),n=r(99069),s=Object.defineProperty,o=(e,t,r)=>(((e,t,r)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class a extends n.SliderBase{constructor(e){super(e),o(this,"sliderOptions"),o(this,"activeValue"),o(this,"onChange",new i.Signal),o(this,"onUpdate",new i.Signal),this.sliderOptions=e,this.setInitialState()}setInitialState(){this.validateValues();const{value1:e,value2:t}=this.sliderOptions;this.updateProgress(e,t),this.value2=t,this.value1=e}updateProgress(e=this.value1,t=this.value2){this.progressStart=(e-this.min)/(this.max-this.min)*100,this.progress=(t-this.min)/(this.max-this.min)*100}validateValues(){this.sliderOptions.value1||(this.sliderOptions.value1=this.min),this.sliderOptions.value2||(this.sliderOptions.value2=this.sliderOptions.max),this.sliderOptions.value2this.sliderOptions.max&&(this.sliderOptions.value1=this.sliderOptions.max),this.sliderOptions.value2>this.sliderOptions.max&&(this.sliderOptions.value2=this.sliderOptions.max)}get value1(){return this._value1}set value1(e){e!==this._value1&&(ethis._value2&&(e=this._value2),this._value1=e,this.updateSlider1(),this.onUpdate?.emit(this.value1,this.value2))}get value2(){return this._value2}set value2(e){e!==this._value2&&(ethis.max&&(e=this.max),this._value2=e,this.updateSlider2(),this.onUpdate?.emit(this.value1,this.value2))}update(e){if(super.update(e),!this.dragging)return;const t=e.currentTarget,{x:r}=t.parent.worldTransform.applyInverse(e.global),i=Math.abs(r-this._slider1.x-this._slider1.width),n=Math.abs(r-this._slider2.x);this.activeValue||(this.slider1&&rthis.slider2.x?this.activeValue="value2":this.activeValue=ithis._slider2.x&&(this._slider1.x=this._slider2.x),this.sliderOptions?.showValue){this.value1Text.text=`${Math.round(this.value1)}`;const e=this._slider1.x+this._slider1.width/2,t=this._slider1.y;this.value1Text.x=e+(this.sliderOptions.valueTextOffset?.x??0),this.value1Text.y=t+(this.sliderOptions.valueTextOffset?.y??0)}}updateSlider2(){if(this.updateProgress(this.value1,this.value2),this._slider2.x=this.bg?.width/100*this.progress-this._slider2.width/2,this._slider2.y=this.bg?.height/2,this._slider2.x(((e,t,r)=>{t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class c extends s.ButtonContainer{constructor(e){super(),h(this,"animations"),h(this,"originalInnerViewState"),h(this,"defaultDuration",100),h(this,"options"),h(this,"_padding"),h(this,"_offset"),h(this,"_textOffset"),h(this,"iconOffset"),h(this,"innerView",new i.Container),h(this,"_views",{}),h(this,"state"),h(this,"anchor"),h(this,"_defaultTextScale",{x:1,y:1}),h(this,"_defaultIconScale",{x:1,y:1}),h(this,"_defaultTextAnchor",{x:.5,y:.5}),h(this,"_defaultIconAnchor",{x:.5,y:.5}),this.options=e??{};const{defaultView:t,hoverView:r,pressedView:s,disabledView:o,text:a,padding:l,offset:u,textOffset:c,iconOffset:d,defaultTextScale:p,defaultIconScale:f,defaultTextAnchor:m,defaultIconAnchor:g,scale:_,anchor:x,anchorX:b,anchorY:v,icon:y,animations:T}=e??{};this.addChild(this.innerView),this.anchor=new i.ObservablePoint({_onUpdate:()=>this.updateAnchor()}),this.anchor.set(b??x??0,v??x??0),this.padding=l??0,this.offset=u,this.textOffset=c,this.iconOffset=d,this.defaultTextScale=p,this.defaultIconScale=f,this.defaultTextAnchor=m,this.defaultIconAnchor=g,this.scale.set(_??1),T&&(this.animations=T,i.Ticker.shared.add((()=>n.Group.shared.update()))),this.setState("default"),this.defaultView=t,this.hoverView=r,this.pressedView=s,this.disabledView=o,this.text=a,this.iconView=y,this.initStateControl()}set text(e){e&&0!==e?this._views.textView?this._views.textView.text=e.toString():this.createTextView(e):this.removeView("textView")}get text(){return this._views.textView?.text}set enabled(e){this.button.enabled=e,this.setState(e?"default":"disabled")}get enabled(){return this.button.enabled}setState(e,t=!1){if(!t&&this.state===e)return;const r=this.getStateView(this.state);r&&(r.visible=!1),this.state=e;const i=this.getStateView(e);i&&(this.setOffset(i,e,this.offset),i.visible=!0),this.updateAnchor(),this.playAnimations(e)}createTextView(e){if(this._views.textView=a.getTextView(e),void 0===this.options?.defaultTextScale){const{x:e,y:t}=this._views.textView.scale;this._defaultTextScale={x:e,y:t}}this.innerView.addChild(this._views.textView),this.adjustTextView(this.state)}setOffset(e,t,r){const i=r?r[t]:{x:0,y:0},n=r?.default;i?(e.x+=i.x??0,e.y+=i.y??0):n?(e.x+=n.x??0,e.y+=n.y??0):(r.x||r.y)&&(e.x+=r.x??0,e.y+=r.y??0)}getStateView(e){if(this._views)switch(e){case"hover":return this._views.hoverView??this._views.defaultView??void 0;case"pressed":return this._views.pressedView??this._views.hoverView??this._views.defaultView??void 0;case"disabled":return this._views.disabledView??this._views.defaultView??void 0;case"default":return this._views.defaultView??void 0;default:return}}adjustTextView(e){if(!this.text)return;const t=this.getStateView(this.state),{x:r,y:i}=this._defaultTextAnchor;t&&(this.options?.ignoreRefitting||this._views.textView.scale.set(this._defaultTextScale.x,this._defaultTextScale.y),o.fitToView(t,this._views.textView,this.padding,!1),this._views.textView.x=t.x+t.width/2,this._views.textView.y=t.y+t.height/2),this._views.textView.anchor.set(r,i),this.setOffset(this._views.textView,e,this.textOffset)}adjustIconView(e){if(!this._views.iconView)return;const t=this.getStateView(e);if(!t)return;this.options?.ignoreRefitting||this._views.iconView.scale.set(this._defaultIconScale.x,this._defaultIconScale.y);const{x:r,y:i}=this._defaultIconAnchor;o.fitToView(t,this._views.iconView,this.padding,!1),"anchor"in this._views.iconView?this._views.iconView.anchor.set(r,i):this._views.iconView.pivot.set(r*(this._views.iconView.width/this._views.iconView.scale.x),i*(this._views.iconView.height/this._views.iconView.scale.y)),this._views.iconView.x=t.x+t.width/2,this._views.iconView.y=t.y+t.height/2,this.setOffset(this._views.iconView,e,this.iconOffset)}updateAnchor(){if(!this._views)return;const e=this.anchor.x??0,t=this.anchor.y??0;if([this._views.defaultView,this._views.hoverView,this._views.pressedView,this._views.disabledView].forEach((r=>{r&&(r.anchor?.set(0),r.x=-r.width*e,r.y=-r.height*t)})),this._views.defaultView){const{x:e,y:t,width:r,height:n}=this._views.defaultView;this.hitArea=new i.Rectangle(e,t,r,n)}this.adjustIconView(this.state),this.adjustTextView(this.state)}set defaultView(e){this.updateView("defaultView",e)}get defaultView(){return this._views.defaultView}set hoverView(e){this.updateView("hoverView",e),this._views.hoverView&&"hover"!==this.state&&(this._views.hoverView.visible=!1)}get hoverView(){return this._views.hoverView}set pressedView(e){this.updateView("pressedView",e),this._views.pressedView&&(this._views.pressedView.visible=!1)}get pressedView(){return this._views.pressedView}set disabledView(e){this.updateView("disabledView",e),this._views.disabledView&&(this._views.disabledView.visible=!1)}get disabledView(){return this._views.disabledView}updateView(e,t){void 0!==t&&(this.removeView(e),null!==t&&(this.options?.nineSliceSprite&&("string"==typeof t?this._views[e]=new i.NineSliceSprite({texture:i.Texture.from(t),leftWidth:this.options.nineSliceSprite[0],topHeight:this.options.nineSliceSprite[1],rightWidth:this.options.nineSliceSprite[2],bottomHeight:this.options.nineSliceSprite[3]}):console.warn("NineSliceSprite can not be used with views set as Container.")),this._views[e]||(this._views[e]=l.getView(t)),this.setOffset(this._views[e],this.state,this.offset),this._views[e].parent||this.innerView.addChild(this._views[e]),this.updateAnchor(),this._views.iconView&&this.innerView.addChild(this._views.iconView),this._views.textView&&this.innerView.addChild(this._views.textView),this.setState(this.state,!0)))}removeView(e){this._views[e]&&(this.innerView.removeChild(this._views[e]),this._views[e]=null)}set textView(e){void 0!==e&&(this.removeView("textView"),null!==e&&this.createTextView(e))}get textView(){return this._views.textView}set iconView(e){if(void 0!==e&&(this.removeView("iconView"),null!==e)){if(this._views.iconView=l.getView(e),void 0===this.options?.defaultIconScale){const{x:e,y:t}=this._views.iconView.scale;this._defaultIconScale={x:e,y:t}}this._views.iconView.parent||this.innerView.addChild(this._views.iconView),this.setState(this.state,!0)}}get iconView(){return this._views.iconView}playAnimations(e){if(!this.animations)return;if("default"===e&&!this.originalInnerViewState){this.originalInnerViewState={x:this.innerView.x,y:this.innerView.y,width:this.innerView.width,height:this.innerView.height,scale:{x:this.innerView.scale.x,y:this.innerView.scale.y}};const e=this.animations?.default;if(e)return this.innerView.x=e.props.x??this.originalInnerViewState.x,this.innerView.y=e.props.y??this.originalInnerViewState.y,this.innerView.width=e.props.width??this.originalInnerViewState.width,this.innerView.height=e.props.height??this.originalInnerViewState.height,this.innerView.scale.x=e.props.scale.x??this.originalInnerViewState.scale.x,void(this.innerView.scale.y=e.props.scale.y??this.originalInnerViewState.scale.y)}const t=this.animations[e]??this.animations.default;if(t){const e=t;return this.defaultDuration=e.duration,void new n.Tween(this.innerView).to(e.props,e.duration).start()}new n.Tween(this.innerView).to(this.originalInnerViewState,this.defaultDuration).start()}initStateControl(){this.onDown.connect((()=>{this.setState("pressed")})),this.onUp.connect((()=>{i.isMobile.any?this.setState("default"):this.setState("hover")})),this.onUpOut.connect((()=>{this.setState("default")})),this.onOut.connect((()=>{this.button.isDown||this.setState("default")})),this.onPress.connect((()=>{i.isMobile.any?this.setState("default"):this.setState("hover")})),this.onHover.connect((()=>{this.button.isDown||(i.isMobile.any?this.setState("default"):this.setState("hover"))}))}set padding(e){this._padding=e,this.adjustTextView(this.state),this.adjustIconView(this.state)}get padding(){return this._padding}set offset(e){this._offset=e,this.updateAnchor()}get offset(){return this._offset}set textOffset(e){this._textOffset=e,this.adjustTextView(this.state)}get textOffset(){return this._textOffset}set defaultTextScale(e){if(void 0===e)return;this.options.defaultTextScale=e;const t="number"==typeof e;this._defaultTextScale.x=t?e:e.x??1,this._defaultTextScale.y=t?e:e.y??1,this.adjustTextView(this.state)}get defaultTextScale(){return this.defaultTextScale}set defaultIconScale(e){if(void 0===e)return;this.options.defaultIconScale=e;const t="number"==typeof e;this._defaultIconScale.x=t?e:e.x??1,this._defaultIconScale.y=t?e:e.y??1,this.adjustIconView(this.state)}get defaultIconScale(){return this.defaultIconScale}set defaultTextAnchor(e){if(void 0===e)return;this.options.defaultTextAnchor=e;const t="number"==typeof e;this._defaultTextAnchor.x=t?e:e.x??1,this._defaultTextAnchor.y=t?e:e.y??1,this.adjustTextView(this.state)}get defaultTextAnchor(){return this.defaultTextAnchor}set defaultIconAnchor(e){if(void 0===e)return;this.options.defaultIconAnchor=e;const t="number"==typeof e;this._defaultIconAnchor.x=t?e:e.x??1,this._defaultIconAnchor.y=t?e:e.y??1,this.adjustIconView(this.state)}get defaultIconAnchor(){return this.defaultIconAnchor}set width(e){this.options?.nineSliceSprite?(this._views.defaultView&&(this._views.defaultView.width=e),this._views.hoverView&&(this._views.hoverView.width=e),this._views.pressedView&&(this._views.pressedView.width=e),this._views.disabledView&&(this._views.disabledView.width=e),this.adjustTextView(this.state),this.adjustIconView(this.state),this.updateAnchor()):super.width=e}get width(){return super.width}set height(e){this.options?.nineSliceSprite?(this._views.defaultView&&(this._views.defaultView.height=e),this._views.hoverView&&(this._views.hoverView.height=e),this._views.pressedView&&(this._views.pressedView.height=e),this._views.disabledView&&(this._views.disabledView.height=e),this.adjustTextView(this.state),this.adjustIconView(this.state),this.updateAnchor()):super.height=e}get height(){return super.height}setSize(e,t){this.options?.nineSliceSprite?(this._views.defaultView&&this._views.defaultView.setSize(e,t),this._views.hoverView&&this._views.hoverView.setSize(e,t),this._views.pressedView&&this._views.pressedView.setSize(e,t),this._views.disabledView&&this._views.disabledView.setSize(e,t),this.adjustTextView(this.state),this.adjustIconView(this.state),this.updateAnchor()):super.setSize(e,t)}}t.FancyButton=c},32748:function(e,t,r){"use strict";var i=r(58687),n=r(24242),s=r(25529),o=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class l extends i.Container{constructor(e){super(),a(this,"_bg"),a(this,"inputMask"),a(this,"_cursor"),a(this,"inputField"),a(this,"placeholder"),a(this,"editing",!1),a(this,"tick",0),a(this,"lastInputData"),a(this,"activation",!1),a(this,"options"),a(this,"input"),a(this,"handleActivationBinding",this.handleActivation.bind(this)),a(this,"onKeyUpBinding",this.onKeyUp.bind(this)),a(this,"stopEditingBinding",this.stopEditing.bind(this)),a(this,"onInputBinding",this.onInput.bind(this)),a(this,"onEnter"),a(this,"onChange"),a(this,"paddingTop",0),a(this,"paddingRight",0),a(this,"paddingBottom",0),a(this,"paddingLeft",0),this.options=e,this.options=e,this.padding=e.padding,this.cursor="text",this.interactive=!0,this.on("pointertap",(()=>{this.activation=!0,i.isMobile.any&&this.handleActivation()})),i.isMobile.any?window.addEventListener("touchstart",this.handleActivationBinding):i.isMobile.any||(window.addEventListener("click",this.handleActivationBinding),window.addEventListener("keyup",this.onKeyUpBinding),window.addEventListener("input",this.onInputBinding)),this.onEnter=new n.Signal,this.onChange=new n.Signal,i.Ticker.shared.add((e=>this.update(e.deltaTime))),e.bg?this.bg=e.bg:console.error("Input: bg is not defined, please define it.")}onInput(e){this.lastInputData=e.data}onKeyUp(e){const t=e.key;"Backspace"===t?this._delete():"Escape"===t||"Enter"===t?this.stopEditing():1===t.length?this._add(t):this.lastInputData&&1===this.lastInputData.length&&this._add(this.lastInputData)}init(){const e=this.options,t={fill:0,align:"center"};this.options.textStyle=e.textStyle??t,this.options.TextClass=e.TextClass??i.Text;const r={...t,...e.textStyle};this.inputField=new this.options.TextClass({text:"",style:r}),this._cursor=new i.Sprite(i.Texture.WHITE),this._cursor.tint=Number(e.textStyle.fill)||0,this._cursor.anchor.set(.5),this._cursor.width=2,this._cursor.height=.8*this.inputField.height,this._cursor.alpha=0,this.placeholder=new this.options.TextClass({text:e.placeholder,style:r??t}),this.placeholder.visible=!!e.placeholder,this.addChild(this.inputField,this.placeholder,this._cursor),this.value=e.value??"",this.align()}set bg(e){this._bg&&this._bg.destroy(),this.options?.nineSliceSprite&&("string"==typeof e?this._bg=new i.NineSliceSprite({texture:i.Texture.from(e),leftWidth:this.options.nineSliceSprite[0],topHeight:this.options.nineSliceSprite[1],rightWidth:this.options.nineSliceSprite[2],bottomHeight:this.options.nineSliceSprite[3]}):console.warn("NineSliceSprite can not be used with views set as Container.")),this._bg||(this._bg=s.getView(e)),this._bg.cursor="text",this._bg.interactive=!0,this.addChildAt(this._bg,0),this.inputField||this.init(),this.options.addMask&&(this.inputMask&&(this.inputField.mask=null,this._cursor.mask=null,this.inputMask.destroy()),this.options?.nineSliceSprite&&"string"==typeof e?this.inputMask=new i.NineSliceSprite({texture:i.Texture.from(e),leftWidth:this.options.nineSliceSprite[0],topHeight:this.options.nineSliceSprite[1],rightWidth:this.options.nineSliceSprite[2],bottomHeight:this.options.nineSliceSprite[3]}):e instanceof i.Sprite?this.inputMask=new i.Sprite(e.texture):e instanceof i.Graphics?this.inputMask=e.clone(!0):this.inputMask=s.getView(e),this.inputField.mask=this.inputMask,this._cursor.mask=this.inputMask,this.addChildAt(this.inputMask,0))}get bg(){return this._bg}_add(e){this.editing&&(this.options.maxLength&&this.value.length>=this.options.maxLength||(this.value=this.value+e,this.onChange.emit(this.value)))}_delete(){if(!this.editing||0===this.value.length)return;const e=this.value.split("");e.pop(),this.value=e.join(""),this.onChange.emit(this.value)}_startEditing(){this.options.cleanOnFocus&&(this.value=""),this.tick=0,this.editing=!0,this.placeholder.visible=!1,this._cursor.alpha=1,i.isMobile.any&&this.createInputField(),this.align()}createInputField(){this.input&&(this.input.removeEventListener("blur",this.stopEditingBinding),this.input.removeEventListener("keyup",this.onKeyUpBinding),this.input.removeEventListener("input",this.onInputBinding),this.input?.blur(),this.input?.remove(),this.input=null);const e=document.createElement("input");document.body.appendChild(e),e.style.position="fixed",e.style.left=`${this.getGlobalPosition().x}px`,e.style.top=`${this.getGlobalPosition().y}px`,e.style.opacity="0.0000001",e.style.width=`${this._bg.width}px`,e.style.height=`${this._bg.height}px`,e.style.border="none",e.style.outline="none",e.style.background="white",i.isMobile.android.device?setTimeout((()=>{e.focus(),e.click()}),100):(e.focus(),e.click()),e.addEventListener("blur",this.stopEditingBinding),e.addEventListener("keyup",this.onKeyUpBinding),e.addEventListener("input",this.onInputBinding),this.input=e,this.align()}handleActivation(){this.stopEditing(),this.activation&&(this._startEditing(),this.activation=!1)}stopEditing(){this.editing&&(this._cursor.alpha=0,this.editing=!1,""===this.inputField.text&&(this.placeholder.visible=!0),0===this.value.length&&(this.placeholder.visible=!0),i.isMobile.any&&(this.input?.blur(),this.input?.remove(),this.input=null),this.align(),this.onEnter.emit(this.value))}update(e){this.editing&&(this.tick+=.1*e,this._cursor.alpha=Math.round(.5*Math.sin(this.tick)+.5))}align(){if(!this._bg)return;const e=this.getAlign();this.inputField.anchor.set(e,.5),this.inputField.x=this._bg.width*e+(1===e?-this.paddingRight:this.paddingLeft),this.inputField.y=this._bg.height/2+this.paddingTop-this.paddingBottom,this.placeholder.anchor.set(e,.5),this.placeholder.x=this._bg.width*e+(1===e?-this.paddingRight:this.paddingLeft),this.placeholder.y=this._bg.height/2,this._cursor.x=this.getCursorPosX(),this._cursor.y=this.inputField.y}getAlign(){const e=.95*this._bg.width,t=this.paddingLeft+this.paddingRight-10;if(this.inputField.width+t>e)return this.editing?1:0;switch(this.options.align){case"left":default:return 0;case"center":return.5;case"right":return 1}}getCursorPosX(){switch(this.getAlign()){case 0:return this.inputField.x+this.inputField.width;case.5:return this.inputField.x+.5*this.inputField.width;case 1:return this.inputField.x;default:return 0}}set value(e){this.inputField.text=e,0!==e.length?this.placeholder.visible=!1:this.placeholder.visible=!this.editing,this.align()}get value(){return this.inputField.text}set padding(e){"number"==typeof e&&(this.paddingTop=e,this.paddingRight=e,this.paddingBottom=e,this.paddingLeft=e),Array.isArray(e)?(this.paddingTop=e[0]??0,this.paddingRight=e[1]??e[0]??0,this.paddingBottom=e[2]??e[0]??0,this.paddingLeft=e[3]??e[1]??e[0]??0):"object"==typeof e&&(this.paddingTop=e.top??0,this.paddingRight=e.right??0,this.paddingBottom=e.bottom??0,this.paddingLeft=e.left??0)}get padding(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft]}destroy(e){this.off("pointertap"),i.isMobile.any?window.removeEventListener("touchstart",this.handleActivationBinding):i.isMobile.any||(window.removeEventListener("click",this.handleActivationBinding),window.removeEventListener("keyup",this.onKeyUpBinding),window.removeEventListener("input",this.onInputBinding)),super.destroy(e)}set width(e){this.options?.nineSliceSprite?(this._bg&&(this._bg.width=e),this.inputMask&&(this.inputMask.width=e-this.paddingLeft-this.paddingRight,this.inputMask.x=this.paddingLeft),this.align()):super.width=e}get width(){return super.width}set height(e){this.options?.nineSliceSprite?(this._bg&&(this._bg.height=e),this.inputMask&&(this.inputMask.height=e-this.paddingTop-this.paddingBottom,this.inputMask.y=this.paddingTop),this.align()):super.height=e}get height(){return super.height}setSize(e,t){this.options?.nineSliceSprite?(this._bg&&this._bg.setSize(e,t),this.inputMask&&("object"==typeof e?(t=e.height??e.width,e=e.width):t=t??e,this.inputMask.setSize(e-this.paddingLeft-this.paddingRight,t-this.paddingTop-this.paddingBottom),this.inputMask.position.set(this.paddingLeft,this.paddingTop)),this.align()):super.setSize(e,t)}}t.Input=l},38335:function(e,t,r){"use strict";var i=r(58687),n=Object.defineProperty,s=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class o extends i.Container{constructor(e){super(),s(this,"options"),s(this,"view"),s(this,"_type"),s(this,"children",[]),e&&this.init(e),e?.items?.forEach((e=>this.addChild(e))),this.on("added",(()=>this.arrangeChildren())),this.on("childAdded",(()=>this.arrangeChildren()))}init(e){this.options=e,e?.type&&(this.type=e.type),e?.children&&e.children.forEach((e=>this.addChild(e)))}set type(e){this._type=e,this.arrangeChildren()}get type(){return this._type}set elementsMargin(e){if(!this.options)throw new Error("List has not been initiated!");this.options.elementsMargin=e,this.arrangeChildren()}get elementsMargin(){return this.options?.elementsMargin??0}set padding(e){if(!this.options)throw new Error("List has not been initiated!");this.options.padding=e,this.options.vertPadding=e,this.options.horPadding=e,this.options.leftPadding=e,this.options.rightPadding=e,this.options.topPadding=e,this.options.bottomPadding=e,this.arrangeChildren()}get padding(){return this.options?.padding??0}set vertPadding(e){if(!this.options)throw new Error("List has not been initiated!");this.options.vertPadding=e,this.options.topPadding=e,this.options.bottomPadding=e,this.arrangeChildren()}get vertPadding(){return this.options?.vertPadding??this.padding??0}set horPadding(e){if(!this.options)throw new Error("List has not been initiated!");this.options.horPadding=e,this.options.leftPadding=e,this.options.rightPadding=e,this.arrangeChildren()}get horPadding(){return this.options?.horPadding??this.padding??0}set leftPadding(e){if(!this.options)throw new Error("List has not been initiated!");this.options.leftPadding=e,this.arrangeChildren()}get leftPadding(){return this.options?.leftPadding??this.horPadding}set rightPadding(e){if(!this.options)throw new Error("List has not been initiated!");this.options.rightPadding=e,this.arrangeChildren()}get rightPadding(){return this.options?.rightPadding??this.horPadding}set topPadding(e){if(!this.options)throw new Error("List has not been initiated!");this.options.topPadding=e,this.arrangeChildren()}get topPadding(){return this.options?.topPadding??this.vertPadding}set bottomPadding(e){if(!this.options)throw new Error("List has not been initiated!");this.options.bottomPadding=e,this.arrangeChildren()}get bottomPadding(){return this.options?.bottomPadding??this.vertPadding}arrangeChildren(){let e=0,t=this.leftPadding,r=this.topPadding;const i=this.options?.elementsMargin??0;let n=this.parent?.width;this.rightPadding&&(n-=this.rightPadding),this.children.forEach(((s,o)=>{switch(this.type){case"vertical":s.y=r,s.x=t,r+=i+s.height;break;case"horizontal":s.x=t,s.y=r,t+=i+s.width;break;default:s.x=t,s.y=r,s.x+s.width>n&&o>0&&(r+=i+e,t=this.leftPadding,s.x=t,s.y=r,e=0),e=Math.max(e,s.height),t+=i+s.width}}))}removeItem(e){const t=this.children[e];t&&(this.removeChild(t),this.arrangeChildren())}}t.List=o},39450:function(e,t,r){"use strict";var i=r(58687),n=r(25529),s=Object.defineProperty,o=(e,t,r)=>(((e,t,r)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class a extends i.Container{constructor(e){super(),o(this,"target"),o(this,"border",new i.Graphics),o(this,"_targetMask"),o(this,"maskData"),o(this,"borderWidth"),o(this,"borderColor"),e?.target&&this.init(e)}init({target:e,mask:t,borderWidth:r,borderColor:i}){this.target&&this.removeChild(this.target),this.target=n.getView(e),this.addChild(this.border,this.target),t&&this.setMask(t),r&&this.setBorder(r,i)}setMask(e){this.maskData=e,this._targetMask=n.getView(e),this.addChild(this._targetMask),this.target.mask=this._targetMask}setBorder(e,t){if(this.borderWidth=e,this.borderColor=t,this.showBorder(),this.maskData){const t="string"==typeof this.maskData?i.Sprite.from(this.maskData):this.maskData.clone(!0);t.width+=2*e,t.height+=2*e,this.mask=t,this.addChild(t),this._targetMask.position.set(e)}}showBorder(){const e=2*this.borderWidth;this.border.clear().rect(0,0,this.target.width+e,this.target.height+e).fill(this.borderColor),this.target.x=this.borderWidth,this.target.y=this.borderWidth}hideBorder(){this.border.clear()}}t.MaskedFrame=a},52749:function(e,t,r){"use strict";var i=r(58687),n=r(25529),s=Object.defineProperty,o=(e,t,r)=>(((e,t,r)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class a extends i.Container{constructor(e){super(),o(this,"bg"),o(this,"fill"),o(this,"fillMask"),o(this,"progressStart",0),o(this,"_progress",0),o(this,"options"),o(this,"innerView"),o(this,"_view"),this.options=e,this.innerView=new i.Container,this.addChild(this.innerView),e?.bg&&e?.fill&&this.init(e)}init({bg:e,fill:t,fillPaddings:r,progress:i}){this.setBackground(e),this.setFill(t,r),this.progress=i}setBackground(e){this.bg&&this.bg.destroy(),this.options?.nineSliceSprite&&("string"==typeof e?this.bg=new i.NineSliceSprite({texture:i.Texture.from(e),leftWidth:this.options.nineSliceSprite.bg[0],topHeight:this.options.nineSliceSprite.bg[1],rightWidth:this.options.nineSliceSprite.bg[2],bottomHeight:this.options.nineSliceSprite.bg[3]}):console.warn("NineSliceSprite can not be used with views set as Container.")),e instanceof i.Graphics&&(this.bg=e),!this.bg&&("string"==typeof e||e instanceof i.Sprite)&&(this.bg=n.getSpriteView(e)),this.innerView.addChildAt(this.bg,0)}setFill(e,t){if(this.fill&&this.fill.destroy(),this.bg instanceof i.Sprite&&e===this.bg)return void console.warn("Can not use same Sprite instance for bg and fill.");this.options?.nineSliceSprite&&("string"==typeof e?this.fill=new i.NineSliceSprite({texture:i.Texture.from(e),leftWidth:this.options.nineSliceSprite.fill[0],topHeight:this.options.nineSliceSprite.fill[1],rightWidth:this.options.nineSliceSprite.fill[2],bottomHeight:this.options.nineSliceSprite.fill[3]}):console.warn("NineSliceSprite can not be used with views set as Container.")),this.fill||(e instanceof i.Graphics?this.fill=e:this.fill=n.getSpriteView(e)),this.innerView.addChildAt(this.fill,1);const r=t?.left??0,s=t?.top??0;this.fill.x=r,this.fill.y=s,this.fillMask&&(this.fill.mask=null,this.fillMask.destroy());const o=this.fill.width/2,a=this.fill.width/2,l=this.fill.height/2,u=this.fill.height/2;let h=i.Texture.WHITE;this.fill instanceof i.Sprite&&this.fill.texture&&(h=this.fill.texture),this.fillMask=new i.NineSliceSprite({texture:h,leftWidth:o,topHeight:l,rightWidth:a,bottomHeight:u}),this.fillMask.position.copyFrom(this.fill),this.addChild(this.fillMask),this.fill.mask=this.fillMask}validate(e){return(e=Math.round(e))<0?0:e>100?100:e}set progress(e){this._progress=this.validate(e),this.fill&&this.fillMask&&(this.fill.mask=null,this.fillMask.width=this.fill.width/100*(this._progress-this.progressStart),this.fillMask.x=this.progressStart/100*this.fill.width+this.fill.x,this.fillMask.height=this.fill.height,this.fill.mask=this.fillMask)}get progress(){return this._progress}set width(e){if(this.options?.nineSliceSprite){if(this.bg&&(this.bg.width=e),this.fill){const t=this.options.fillPaddings?.left??0,r=this.options.fillPaddings?.right??0;this.fill.width=e-t-r,this.fillMask.width=e-t-r}this.progress=this._progress}else super.width=e}get width(){return super.width}set height(e){if(this.options?.nineSliceSprite){if(this.bg&&(this.bg.height=e),this.fill){const t=this.options.fillPaddings?.top??0,r=this.options.fillPaddings?.bottom??0;this.fill.height=e-t-r,this.fillMask.height=e-t-r}this.progress=this._progress}else super.height=e}get height(){return super.height}setSize(e,t){if(this.options?.nineSliceSprite){if(this.bg&&this.bg.setSize(e,t),this.fill){"object"==typeof e?(t=e.height??e.width,e=e.width):t=t??e;const r=this.options.fillPaddings?.top??0,i=this.options.fillPaddings?.bottom??0,n=this.options.fillPaddings?.left??0,s=this.options.fillPaddings?.right??0;this.fill.setSize(e-n-s,t-r-i),this.fillMask.setSize(e-n-s,t-r-i)}this.progress=this._progress}else super.setSize(e,t)}}t.ProgressBar=a},32757:function(e,t,r){"use strict";var i=r(58687),n=r(24242),s=r(38335),o=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class l extends i.Container{constructor(e){super(),a(this,"items",[]),a(this,"innerView"),a(this,"value"),a(this,"selected"),a(this,"onChange"),a(this,"options"),e&&this.init(e),this.onChange=new n.Signal}init(e){this.options=e,this.value=e.items[e.selectedItem||0].labelText?.text,this.selected=e.selectedItem??0,this.innerView?(this.innerView.type=e.type,this.innerView.elementsMargin=e.elementsMargin):this.innerView=new s.List({type:e.type,elementsMargin:e.elementsMargin}),this.addItems(e.items),this.addChild(this.innerView),this.selectItem(this.selected)}addItems(e){e.forEach(((e,t)=>{e.onChange.connect((()=>this.selectItem(t))),this.items.push(e),this.innerView.addChild(e)}))}removeItems(e){e.forEach((e=>{const t=this.items[e];t&&(t.onChange.disconnectAll(),this.innerView.removeChild(t),this.items.splice(e,1))}))}selectItem(e){this.items.forEach(((t,r)=>{t.forceCheck(r===e)})),this.selected!==e&&this.onChange.emit(e,this.items[e].labelText?.text),this.value=this.options.items[e].labelText?.text,this.selected=e}}t.RadioGroup=l},41917:function(e,t,r){"use strict";var i=r(58687),n=r(24242),s=r(38335),o=r(85723),a=Object.defineProperty,l=(e,t,r)=>(((e,t,r)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class u extends i.Container{constructor(e){super(),l(this,"background"),l(this,"borderMask"),l(this,"lastWidth"),l(this,"lastHeight"),l(this,"__width",0),l(this,"__height",0),l(this,"_dimensionChanged",!1),l(this,"list"),l(this,"_trackpad"),l(this,"isDragging",0),l(this,"interactiveStorage",[]),l(this,"visibleItems",[]),l(this,"pressedChild"),l(this,"ticker",i.Ticker.shared),l(this,"options"),l(this,"stopRenderHiddenItemsTimeout"),l(this,"onMouseScrollBinding",this.onMouseScroll.bind(this)),l(this,"dragStarTouchPoint"),l(this,"isOver",!1),l(this,"proximityRange"),l(this,"proximityStatusCache",[]),l(this,"lastScrollX"),l(this,"lastScrollY"),l(this,"proximityCheckFrameCounter",0),l(this,"onProximityChange",new n.Signal),l(this,"onScroll",new n.Signal),e&&this.init(e),this.ticker.add(this.update,this)}init(e){this.options=e,this.setBackground(e.background),this.__width=e.width|this.background.width,this.__height=e.height|this.background.height,this.proximityRange=e.proximityRange??0,this.list||(this.list=new s.List,super.addChild(this.list)),this.list.init({type:e.type,elementsMargin:e.elementsMargin,padding:e.padding,vertPadding:e.vertPadding,horPadding:e.horPadding,topPadding:e.topPadding,bottomPadding:e.bottomPadding,leftPadding:e.leftPadding,rightPadding:e.rightPadding}),this.addItems(e.items),this.hasBounds&&(this.addMask(),this.makeScrollable()),this._trackpad.xAxis.value=0,this._trackpad.yAxis.value=0,this.options.globalScroll=e.globalScroll??!0,this.options.shiftScroll=e.shiftScroll??!1,this.resize()}get hasBounds(){return!!this.__width||!!this.__height}addItems(e){e?.length&&e.forEach((e=>this.addItem(e)))}removeItems(){this.proximityStatusCache.length=0,this.list.removeChildren()}addItem(...e){if(e.length>1)e.forEach((e=>this.addItem(e)));else{const t=e[0];t.width&&t.height||console.error("ScrollBox item should have size"),t.eventMode="static",this.list.addChild(t),this.proximityStatusCache.push(!1),this.options.disableDynamicRendering||(t.renderable=this.isItemVisible(t))}return this.resize(),e[0]}removeItem(e){this.list.removeItem(e),this.proximityStatusCache.splice(e,1),this.resize()}isItemVisible(e,t=0){const r="vertical"===this.options.type||!this.options.type;let i=!1;const n=this.list;if(r){const r=e.y+n.y;r+e.height>=-t&&r<=this.options.height+t&&(i=!0)}else{const r=e.x+n.x;r+e.width>=-t&&r<=this.options.width+t&&(i=!0)}return i}get items(){return this.list?.children??[]}setBackground(e){this.background&&this.removeChild(this.background),this.options.background=e,this.background=new i.Graphics,this.addChildAt(this.background,0),this.resize()}addMask(){this.borderMask||(this.borderMask=new i.Graphics,super.addChild(this.borderMask),this.mask=this.borderMask),this.resize()}makeScrollable(){this._trackpad||(this._trackpad=new o.Trackpad({disableEasing:this.options.disableEasing})),this.on("pointerdown",(e=>{this.renderAllItems(),this.isDragging=1,this.dragStarTouchPoint=this.worldTransform.applyInverse(e.global),this._trackpad.pointerDown(this.dragStarTouchPoint);const t=this.list.worldTransform.applyInverse(e.global);this.visibleItems.forEach((e=>{e.xt.x&&e.yt.y&&(this.pressedChild=e)}))})),this.on("pointerup",(()=>{this.isDragging=0,this._trackpad.pointerUp(),this.restoreItemsInteractivity(),this.pressedChild=null,this.stopRenderHiddenItems()})),this.on("pointerover",(()=>{this.isOver=!0})),this.on("pointerout",(()=>{this.isOver=!1})),this.on("pointerupoutside",(()=>{this.isDragging=0,this._trackpad.pointerUp(),this.restoreItemsInteractivity(),this.pressedChild=null,this.stopRenderHiddenItems()})),this.on("globalpointermove",(e=>{if(!this.isDragging)return;const t="horizontal"!==this.options.type,r=this.worldTransform.applyInverse(e.global);if(this.dragStarTouchPoint){const e=this.options.dragTrashHold??10;if("horizontal"===this.options.type){const t=r.x-this.dragStarTouchPoint.x;Math.abs(t)>e&&(this.isDragging=2)}else{const t=r.y-this.dragStarTouchPoint.y;Math.abs(t)>e&&(this.isDragging=2)}}this.dragStarTouchPoint&&2!==this.isDragging||(this._trackpad.pointerMove(r),this.pressedChild&&(this.revertClick(this.pressedChild),this.pressedChild=null),this.onScroll?.emit(t?this.scrollY:this.scrollX))})),document.addEventListener("wheel",this.onMouseScrollBinding,!0)}setInteractive(e){this.eventMode=e?"static":"auto"}get listHeight(){return this.list.height+this.list.topPadding+this.list.bottomPadding}get listWidth(){return this.list.width+this.list.leftPadding+this.list.rightPadding}resize(e=!1){if(this.hasBounds){if(this.renderAllItems(),this.borderMask&&(e||this._dimensionChanged||this.lastWidth!==this.listWidth||this.lastHeight!==this.listHeight)){this.options.width||(this.__width+=this.listWidth),this.options.height||(this.__height+=this.listHeight),this.borderMask.clear().roundRect(0,0,this.__width,this.__height,0|this.options.radius).fill(16711935).stroke(0),this.borderMask.eventMode="none";const e=this.options.background;this.background.clear().roundRect(0,0,this.__width,this.__height,0|this.options.radius).fill({color:e??0,alpha:e?1:1e-7}),"horizontal"===this.options.type?this.setInteractive(this.listWidth>this.__width):this.setInteractive(this.listHeight>this.__height),this.lastWidth=this.listWidth,this.lastHeight=this.listHeight}if(this._trackpad){const e=this.borderMask.width-this.list.width-this.list.leftPadding-this.list.rightPadding,t=this.borderMask.height-this.list.height-this.list.topPadding-this.list.bottomPadding;"vertical"===this.options.type?this._trackpad.yAxis.max=-Math.abs(t):("horizontal"===this.options.type||(this._trackpad.yAxis.max=-Math.abs(t)),this._trackpad.xAxis.max=-Math.abs(e))}this._dimensionChanged?(this.list.arrangeChildren(),this.stopRenderHiddenItems(),this._dimensionChanged=!1):this.updateVisibleItems(),this.lastScrollX=null,this.lastScrollY=null}}onMouseScroll(e){if(!this.isOver&&!this.options.globalScroll)return;this.renderAllItems();const t=this.options.shiftScroll?void 0!==e.deltaX||void 0!==e.deltaY:void 0!==e.deltaX;if("horizontal"===this.options.type&&t){const t=this.options.shiftScroll?e.deltaX:e.deltaY,r=this.list.x-t;if(this.listWidth{e.renderable=!0}))}stopRenderHiddenItems(){this.options.disableDynamicRendering||(this.stopRenderHiddenItemsTimeout&&(clearTimeout(this.stopRenderHiddenItemsTimeout),this.stopRenderHiddenItemsTimeout=null),this.stopRenderHiddenItemsTimeout=setTimeout((()=>this.updateVisibleItems()),2e3))}updateVisibleItems(){this.visibleItems.length=0,this.items.forEach((e=>{e.renderable=this.isItemVisible(e),this.visibleItems.push(e)}))}scrollTo(e){if(!this.interactive)return;const t=this.list.children[e];t&&(this.renderAllItems(),this._trackpad.xAxis.value="horizontal"===this.options.type?this.__width-t.x-t.width-this.list.rightPadding:0,this._trackpad.yAxis.value=this.options.type&&"vertical"!==this.options.type?0:this.__height-t.y-t.height-this.list.bottomPadding,this.stopRenderHiddenItems())}scrollToPosition({x:e,y:t}){void 0===e&&void 0===t||(this.renderAllItems(),void 0!==e&&(this.scrollX=-e),void 0!==t&&(this.scrollY=-t),this.stopRenderHiddenItems())}get height(){return this.__height}set height(e){this.__height=e,this._dimensionChanged=!0,this.resize(),this.scrollTop()}get width(){return this.__width}set width(e){this.__width=e,this._dimensionChanged=!0,this.resize(),this.scrollTop()}setSize(e,t){"object"==typeof e?(t=e.height??e.width,e=e.width):t=t??e,this.__width=e,this.__height=t,this._dimensionChanged=!0,this.resize(),this.scrollTop()}getSize(e){return(e=e||{width:0,height:0}).width=this.__width,e.height=this.__height,e}get scrollX(){return this._trackpad.xAxis.value}set scrollX(e){this._trackpad.xAxis.value=e}get scrollY(){return this._trackpad.yAxis.value}set scrollY(e){this._trackpad.yAxis.value=e}update(){if(!this.list)return;this._trackpad.update();const e="horizontal"===this.options.type?"x":"y";this.list[e]!==this._trackpad[e]&&(this.list[e]=this._trackpad[e]),this.options.disableProximityCheck||this._trackpad.x===this.lastScrollX&&this._trackpad.y===this.lastScrollY||(this.proximityCheckFrameCounter++,this.proximityCheckFrameCounter>=(this.options.proximityDebounce??10)&&(this.items.forEach(((e,t)=>{const r=this.isItemVisible(e,this.proximityRange);r!==this.proximityStatusCache[t]&&(this.proximityStatusCache[t]=r,this.onProximityChange.emit({item:e,index:t,inRange:r}))})),this.lastScrollX=this._trackpad.x,this.lastScrollY=this._trackpad.y,this.proximityCheckFrameCounter=0))}destroy(e){this.ticker.remove(this.update,this),document.removeEventListener("wheel",this.onMouseScrollBinding,!0),this.background.destroy(),this.list.destroy(),super.destroy(e)}restoreItemsInteractivity(){this.interactiveStorage.forEach((e=>{e.item.eventMode=e.eventMode})),this.interactiveStorage.length=0}revertClick(e){"auto"!==e.eventMode&&(i.isMobile.any?e.emit("pointerupoutside",null):e.emit("mouseupoutside",null),this.interactiveStorage.push({item:e,eventMode:e.eventMode}),e.eventMode="auto"),e instanceof i.Container&&e.children&&e.children.forEach((e=>this.revertClick(e)))}get scrollHeight(){return this.list.height}get scrollWidth(){return this.list.width}}t.ScrollBox=u},17247:function(e,t,r){"use strict";var i=r(58687),n=r(24242),s=r(41192),o=r(41917),a=r(25529),l=Object.defineProperty,u=(e,t,r)=>(((e,t,r)=>{t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class h extends i.Container{constructor(e){super(),u(this,"view",new i.Container),u(this,"openButton"),u(this,"closeButton"),u(this,"openView"),u(this,"scrollBox"),u(this,"value"),u(this,"onSelect"),this.addChild(this.view),this.onSelect=new n.Signal,e&&this.init(e)}init({closedBG:e,textStyle:t,TextClass:r,items:n,openBG:l,selected:u,selectedTextOffset:h,scrollBox:c,visibleItems:d}){r=r??i.Text,this.openView&&this.openView!==l&&this.view.removeChild(this.openView),this.openButton?(this.openButton.defaultView=a.getView(e),this.openButton.textView=new r({text:n?.items?n.items[0]:"",style:t}),this.openButton.textOffset=h):(this.openButton=new s.FancyButton({defaultView:a.getView(e),text:new r({text:n?.items?n.items[0]:"",style:t}),textOffset:h}),this.openButton.onPress.connect((()=>this.toggle())),this.addChild(this.openButton)),this.openView!==l&&(this.openView=a.getView(l),this.view.visible=!1,this.view.addChild(this.openView)),this.closeButton?(this.closeButton.defaultView=(new i.Graphics).rect(0,0,this.openButton.width,this.openButton.height).fill({color:0,alpha:1e-5}),this.closeButton.textView=new r({text:n?.items?n.items[0]:"",style:t}),this.openButton.textOffset=h):(this.closeButton=new s.FancyButton({defaultView:(new i.Graphics).rect(0,0,this.openButton.width,this.openButton.height).fill({color:0,alpha:1e-5}),text:new r({text:n?.items?n.items[0]:"",style:t}),textOffset:h}),this.closeButton.onPress.connect((()=>this.toggle())),this.view.addChild(this.closeButton)),this.scrollBox?this.scrollBox.removeItems():(this.scrollBox=new o.ScrollBox,this.view.addChild(this.scrollBox)),this.scrollBox.init({type:"vertical",elementsMargin:0,width:this.openButton.width,height:this.openButton.height*(d??5),radius:0,padding:0,...c}),this.scrollBox.y=this.openButton.height,c?.offset&&(this.scrollBox.x=c.offset.x??0,this.scrollBox.y+=c.offset.y??0),this.addItems(n,u)}addItems(e,t=0){this.convertItemsToButtons(e).forEach(((e,r)=>{const i=e.text;r===t&&(this.openButton.text=i,this.closeButton.text=i),e.onPress.connect((()=>{this.value=r,this.onSelect.emit(r,i),this.openButton.text=i,this.closeButton.text=i,this.close()})),this.scrollBox.addItem(e)}))}removeItem(e){this.scrollBox.removeItem(e)}toggle(){this.view.visible=!this.view.visible,this.openButton.visible=!this.openButton.visible}open(){this.view.visible=!0,this.openButton.visible=!1}close(){this.view.visible=!1,this.openButton.visible=!0}convertItemsToButtons({items:e,backgroundColor:t,hoverColor:r,width:n,height:o,textStyle:a,TextClass:l,radius:u}){l=l??i.Text;const h=[];return e.forEach((e=>{const c=(new i.Graphics).roundRect(0,0,n,o,u).fill(t),d=r??t,p=(new i.Graphics).roundRect(0,0,n,o,u).fill(d),f=new l({text:e,style:a}),m=new s.FancyButton({defaultView:c,hoverView:p,text:f});h.push(m)})),h}}t.Select=h},83524:function(e,t,r){"use strict";var i=r(24242),n=r(99069),s=Object.defineProperty,o=(e,t,r)=>(((e,t,r)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class a extends n.SliderBase{constructor(e){super({slider1:e.slider,value1:e.value,...e}),o(this,"sliderOptions"),o(this,"onUpdate",new i.Signal),o(this,"onChange",new i.Signal),this.sliderOptions=e,this.step=e.step||1,this.value=e.value??this.min,this.updateSlider()}get value(){return this._value1}set value(e){e!==this._value1&&(ethis.max&&(e=this.max),this._value1=e,this.updateSlider(),this.onUpdate?.emit(this.value))}set max(e){super.max=e,this.updateSlider()}get max(){return super.max}set min(e){super.min=e,this.updateSlider()}get min(){return super.min}set step(e){super.step=e,this.updateSlider()}get step(){return super.step}set slider(e){this.slider1=e,this.updateSlider()}update(e){if(super.update(e),!this.dragging)return;const t=e.currentTarget,{x:r}=t.parent.worldTransform.applyInverse(e.global),i=r/(this.bg?.width||1),n=this.min+i*(this.max-this.min);this.value=Math.round(n/this.step)*this.step}change(){this.onChange?.emit(this.value)}updateSlider(){if(this.progress=((this.value??this.min)-this.min)/(this.max-this.min)*100,this._slider1.x=this.bg?.width/100*this.progress-this._slider1.width/2,this._slider1.y=this.bg?.height/2,this.sliderOptions?.showValue){this.value1Text.text=`${Math.round(this.value)}`;const e=this._slider1.x+this._slider1.width/2,t=this._slider1.y;this.value1Text.x=e+(this.sliderOptions.valueTextOffset?.x??0),this.value1Text.y=t+(this.sliderOptions.valueTextOffset?.y??0)}}set width(e){super.width=e,this.updateSlider()}get width(){return super.width}set height(e){super.height=e,this.updateSlider()}get height(){return super.height}setSize(e,t){super.setSize(e,t),this.updateSlider()}}t.Slider=a},99069:function(e,t,r){"use strict";var i=r(58687),n=r(52749),s=r(25529),o=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class l extends n.ProgressBar{constructor(e){super(e),a(this,"_slider1"),a(this,"_slider2"),a(this,"value1Text"),a(this,"value2Text"),a(this,"_value1"),a(this,"_value2"),a(this,"dragging",0),a(this,"_min",0),a(this,"_max",100),a(this,"_step",1),a(this,"startX"),a(this,"startUpdateValue1"),a(this,"startUpdateValue2"),a(this,"settings"),this.settings=e,this.slider1=e.slider1,this.slider2=e.slider2,this.min=e.min??0,this.max=e.max??100}init(e){super.init(e),this.fill&&(this.fill.eventMode="none")}set slider1(e){if(e&&(this._slider1&&(this.slider1.removeAllListeners(),this.slider1.destroy()),this._slider1=this.createSlider(e),this.settings.showValue&&!this.value1Text)){const e=this.settings.valueTextClass??i.Text;this.value1Text=new e({text:"",style:this.settings.valueTextStyle||{fill:16777215}}),this.value1Text.anchor.set(.5),this.addChild(this.value1Text)}}get slider1(){return this._slider1}set slider2(e){if(e&&(this._slider2&&(this.slider2.removeAllListeners(),this.slider2.destroy()),this._slider2=this.createSlider(e),this.settings.showValue&&!this.value2Text)){const e=this.settings.valueTextClass??i.Text;this.value2Text=new e({text:"",style:this.settings.valueTextStyle||{fill:16777215}}),this.value2Text.anchor.set(.5),this.addChild(this.value2Text)}}get slider2(){return this._slider2}setBackground(e){this.bg&&this.bg.removeAllListeners(),super.setBackground(e),this.activateBG()}activateBG(){this.bg.eventMode="static",this.bg.on("pointerdown",this.startUpdate,this).on("globalpointermove",this.update,this).on("pointerup",this.endUpdate,this).on("pointerupoutside",this.endUpdate,this)}createSlider(e){const t=s.getView(e);t.eventMode="static",t.on("pointerdown",(e=>{this.bg&&(e.currentTarget=this.bg),this.startUpdate(e)})).on("pointerup",this.endUpdate,this).on("pointerupoutside",this.endUpdate,this),t.x=t.width/2;const r=new i.Container;return r.addChild(t),t instanceof i.Sprite&&t.anchor.set(.5),r.y=this.bg?.height/2,this.addChild(r),r}startUpdate(e){this.dragging=1;const t=e.currentTarget;this.startX=t.parent.worldTransform.applyInverse(e.global).x,this.startUpdateValue1=this._value1,this.startUpdateValue2=this._value2,this.update(e)}endUpdate(){this.dragging&&(this.dragging=0,(this.startX||this.startUpdateValue1!==this._value1||this.startUpdateValue2!==this._value2)&&this.change(),this.startUpdateValue1=null,this.startUpdateValue2=null)}onClick(){this.change()}update(e){const t=e.currentTarget,{x:r}=t.parent.worldTransform.applyInverse(e.global);r!==this.startX&&(this.startX=null)}change(){}set max(e){this._max=e}get max(){return this._max}set min(e){this._min=e}get min(){return this._min}set step(e){this._step=e}get step(){return this._step}}t.SliderBase=l},62683:function(e,t,r){"use strict";var i=r(58687),n=r(24242),s=r(25529),o=Object.defineProperty,a=(e,t,r)=>(((e,t,r)=>{t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class l extends i.Container{constructor(e,t,r){super(),a(this,"_triggerEvents",new Set(["onPress"])),a(this,"innerView"),a(this,"_active"),a(this,"onChange"),this.innerView=new i.Container,this.addChild(this.innerView),this.onChange=new n.Signal,e&&(this.views=e),t&&(this.triggerEvents=t),r&&this.views.length>0&&(this.active=r),this.setInteractionEvents()}setInteractionEvents(){this.innerView.eventMode="static",this.innerView.on("pointerdown",(()=>this.handleEvents("onDown"))),this.innerView.on("pointerup",(()=>this.handleEvents("onUp"))),this.innerView.on("pointerupoutside",(()=>this.handleEvents("onUpOut"))),this.innerView.on("pointerout",(()=>this.handleEvents("onOut"))),this.innerView.on("pointertap",(()=>this.handleEvents("onPress"))),this.innerView.on("pointerover",(()=>this.handleEvents("onHover")))}handleEvents(e){this._triggerEvents.has(e)&&this.switch()}get activeView(){if(this.views&&this.views[this.active])return this.views[this.active]}set views(e){this.innerView.removeChildren(),e.forEach((e=>this.add(e)))}get views(){return this.innerView.children}add(e){const t=s.getView(e);this.innerView.addChild(t),t.visible=!1,1===this.views.length&&(this.active=0)}remove(e){this.views[e]&&this.innerView.removeChild(this.views[e])}set triggerEvents(e){this._triggerEvents=new Set(Array.isArray(e)?e:[e])}get triggerEvents(){return Array.from(this._triggerEvents)}switch(e){if(void 0!==e&&e===this.active)return;const t=this.active;if(this.forceSwitch(e),t!==this.active){const e=this.views.length>2?this.active:1===this.active;this.onChange.emit(e)}}forceSwitch(e){if(void 0===e||e!==this.active){if(this.activeView&&(this.activeView.visible=!1),void 0!==e&&!this.views[e])throw new Error(`View with id ${e} does not exist.`);this._active=void 0!==e?e:this.nextActive,void 0!==this._active&&(this.views[this.active].visible=!0)}}get nextActive(){if(0!==this.views.length)return this.active(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);t.default=class{constructor(){s(this,"done"),s(this,"to"),s(this,"_spring"),s(this,"_pos"),s(this,"_speed"),s(this,"_correctSpeed"),this._spring=new i.Spring,this._pos=0,this.to=0}start(e,t,r){this._speed=e,this._pos=t,this.to=r,this.done=!1,this._spring.x=this._pos,this._spring.tx=this.to;const i=this.to-this._pos,n=Math.abs(i)/i,s=Math.abs(this._speed)/this._speed;this._correctSpeed=n!==s}update(){if(this._correctSpeed)this._speed*=.6,Math.abs(this._speed)<2&&(this._correctSpeed=!1),this._pos+=this._speed,this._spring.x=this._pos;else{const e=this.to-this._pos;Math.abs(e)<.05?(this._pos=this.to,this.done=!0):(this._spring.tx=this.to,this._spring.update(),this._pos=this._spring.x)}return this._pos}cancel(){}}},40696:function(e,t,r){"use strict";var i=r(69966),n=Object.defineProperty,s=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);t.SlidingNumber=class{constructor(e={}){s(this,"position",0),s(this,"constrain",!0),s(this,"min",0),s(this,"max",0),s(this,"maxSpeed",400),s(this,"_ease"),s(this,"_offset",0),s(this,"_prev",0),s(this,"_speed",0),s(this,"_hasStopped"),s(this,"_targetSpeed",0),s(this,"_speedChecker",0),s(this,"_grab",0),s(this,"_activeEase"),this.constrain=e.constrain??!0,this.maxSpeed=e.maxSpeed??400,this._ease=e.ease??new i.default}set value(e){this._speed=0,this.position=e}get value(){return this.position}grab(e){this._grab=e,this._offset=this.position-e,this._speedChecker=0,this._targetSpeed=this._speed=0,this._hasStopped=!1}hold(e){this._speedChecker++,this.position=e+this._offset,this._speedChecker>1&&(this._targetSpeed=this.position-this._prev),this._speed+=(this._targetSpeed-this._speed)/2,this._speed>this.maxSpeed?this._speed=this.maxSpeed:this._speed<-this.maxSpeed&&(this._speed=-this.maxSpeed),this._prev=this.position,this.constrain&&(this._activeEase=null,this.position>this.min?this.position-=(this.position-this.min)/1.5:this.position0&&(this.value=0),this.value>0&&(this.value=0),this.valuethis.min||this.positionthis.min?this._activeEase.start(this._speed,this.position,this.min):this._activeEase.start(this._speed,this.position,t)),this.position=this._activeEase.update(),this._activeEase.done&&(this.position=this._activeEase.to,this._speed=0,this._activeEase=null)):this._updateDefault()}}},6601:function(e,t){"use strict";var r=Object.defineProperty,i=(e,t,i)=>(((e,t,i)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i);t.Spring=class{constructor(e={}){i(this,"x"),i(this,"ax"),i(this,"dx"),i(this,"tx"),i(this,"_options"),this.x=0,this.ax=0,this.dx=0,this.tx=0,this._options=e,this._options.max=e.max||160,this._options.damp=e.damp||.8,this._options.springiness=e.springiness||.1}update(){this.ax=(this.tx-this.x)*this._options.springiness,this.dx+=this.ax,this.dx*=this._options.damp,this.dx<-this._options.max?this.dx=-this._options.max:this.dx>this._options.max&&(this.dx=this._options.max),this.x+=this.dx}reset(){this.x=0,this.ax=0,this.dx=0,this.tx=0}get max(){return this._options.max}set max(e){this._options.max=e}get damp(){return this._options.damp}set damp(e){this._options.damp=e}get springiness(){return this._options.springiness}set springiness(e){this._options.springiness=e}}},85723:function(e,t,r){"use strict";var i=r(58687),n=r(40696),s=Object.defineProperty,o=(e,t,r)=>(((e,t,r)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);t.Trackpad=class{constructor(e){o(this,"xAxis"),o(this,"yAxis"),o(this,"_isDown"),o(this,"_globalPosition"),o(this,"_frame"),o(this,"_bounds"),o(this,"_dirty"),o(this,"disableEasing",!1),this.xAxis=new n.SlidingNumber({ease:e.xEase,maxSpeed:e.maxSpeed,constrain:e.constrain}),this.yAxis=new n.SlidingNumber({ease:e.yEase,maxSpeed:e.maxSpeed,constrain:e.constrain}),this.disableEasing=e.disableEasing??!1,this._frame=new i.Rectangle,this._bounds=new i.Rectangle,this._globalPosition=new i.Point}pointerDown(e){this._globalPosition=e,this.xAxis.grab(e.x),this.yAxis.grab(e.y),this._isDown=!0}pointerUp(){this._isDown=!1}pointerMove(e){this._globalPosition=e}update(){this._dirty&&(this._dirty=!1,this.xAxis.min=this._bounds.left,this.xAxis.min=this._bounds.right-this._frame.width,this.xAxis.min=this._bounds.top,this.xAxis.min=this._bounds.bottom-this._frame.height),this._isDown?(this.xAxis.hold(this._globalPosition.x),this.yAxis.hold(this._globalPosition.y)):(this.xAxis.slide(this.disableEasing),this.yAxis.slide(this.disableEasing))}resize(e,t){this._frame.x=0,this._frame.width=e,this._frame.y=0,this._frame.height=t,this._dirty=!0}setBounds(e,t,r,i){this._bounds.x=e,this._bounds.width=t-e,this._bounds.y=r,this._bounds.height=i-r,this._dirty=!0}get x(){return this.xAxis.value}get y(){return this.yAxis.value}}},72167:function(e,t){"use strict";function r(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var i=r({HTML:"text/html",isHTML:function(e){return e===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),n=r({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===n.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.find=function(e,t,r){if(void 0===r&&(r=Array.prototype),e&&"function"==typeof r.find)return r.find.call(e,t);for(var i=0;i=t+r||t?new java.lang.String(e,t,r)+"":e}function _(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}d.prototype.parseFromString=function(e,t){var r=this.options,i=new h,n=r.domBuilder||new p,o=r.errorHandler,a=r.locator,u=r.xmlns||{},d=/\/x?html?$/.test(t),f=d?s.HTML_ENTITIES:s.XML_ENTITIES;a&&n.setDocumentLocator(a),i.errorHandler=function(e,t,r){if(!e){if(t instanceof p)return t;e=t}var i={},n=e instanceof Function;function s(t){var s=e[t];!s&&n&&(s=2==e.length?function(r){e(t,r)}:e),i[t]=s&&function(e){s("[xmldom "+t+"]\t"+e+m(r))}||function(){}}return r=r||{},s("warning"),s("error"),s("fatalError"),i}(o,n,a),i.domBuilder=r.domBuilder||n,d&&(u[""]=l.HTML),u.xml=u.xml||l.XML;var g=r.normalizeLineEndings||c;return e&&"string"==typeof e?i.parse(g(e),u,f):i.errorHandler.error("invalid doc source"),n.doc},p.prototype={startDocument:function(){this.doc=(new a).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,r,i){var n=this.doc,s=n.createElementNS(e,r||t),o=i.length;_(this,s),this.currentElement=s,this.locator&&f(this.locator,s);for(var a=0;a=0))throw new R(M,new Error(e.tagName+"@"+r));for(var n=t.length-1;i"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function N(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(N(e,t))return!0}while(e=e.nextSibling)}function V(){this.ownerDocument=this}function H(e,t,r,i){e&&e._inc++,r.namespaceURI===s.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function X(e,t,r){if(e&&e._inc){e._inc++;var i=t.childNodes;if(r)i[i.length++]=r;else{for(var n=t.firstChild,s=0;n;)i[s++]=n,n=n.nextSibling;i.length=s,delete i[i.length]}}}function z(e,t){var r=t.previousSibling,i=t.nextSibling;return r?r.nextSibling=i:e.firstChild=i,i?i.previousSibling=r:e.lastChild=r,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,X(e.ownerDocument,e),t}function W(e){return e&&e.nodeType===k.DOCUMENT_TYPE_NODE}function Y(e){return e&&e.nodeType===k.ELEMENT_NODE}function j(e){return e&&e.nodeType===k.TEXT_NODE}function $(e,t){var r=e.childNodes||[];if(n(r,Y)||W(t))return!1;var i=n(r,W);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function q(e,t){var r=e.childNodes||[];if(n(r,(function(e){return Y(e)&&e!==t})))return!1;var i=n(r,W);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function K(e,t,r){if(!function(e){return e&&(e.nodeType===k.DOCUMENT_NODE||e.nodeType===k.DOCUMENT_FRAGMENT_NODE||e.nodeType===k.ELEMENT_NODE)}(e))throw new R(A,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new R(M,"child not in parent");if(!function(e){return e&&(Y(e)||j(e)||W(e)||e.nodeType===k.DOCUMENT_FRAGMENT_NODE||e.nodeType===k.COMMENT_NODE||e.nodeType===k.PROCESSING_INSTRUCTION_NODE)}(t)||W(t)&&e.nodeType!==k.DOCUMENT_NODE)throw new R(A,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function Q(e,t,r){var i=e.childNodes||[],s=t.childNodes||[];if(t.nodeType===k.DOCUMENT_FRAGMENT_NODE){var o=s.filter(Y);if(o.length>1||n(s,j))throw new R(A,"More than one element or text in fragment");if(1===o.length&&!$(e,r))throw new R(A,"Element in fragment can not be inserted before doctype")}if(Y(t)&&!$(e,r))throw new R(A,"Only one element can be added and only after doctype");if(W(t)){if(n(i,W))throw new R(A,"Only one doctype is allowed");var a=n(i,Y);if(r&&i.indexOf(a)1||n(s,j))throw new R(A,"More than one element or text in fragment");if(1===o.length&&!q(e,r))throw new R(A,"Element in fragment can not be inserted before doctype")}if(Y(t)&&!q(e,r))throw new R(A,"Only one element can be added and only after doctype");if(W(t)){if(n(i,(function(e){return W(e)&&e!==r})))throw new R(A,"Only one doctype is allowed");var a=n(i,Y);if(r&&i.indexOf(a)=0;S--){if(""===(E=n[S]).prefix&&E.namespace===e.namespaceURI){c=E.namespace;break}}if(c!==e.namespaceURI)for(S=n.length-1;S>=0;S--){var E;if((E=n[S]).namespace===e.namespaceURI){E.prefix&&(h=E.prefix+":"+u);break}}}t.push("<",h);for(var w=0;w"),r&&/^script$/i.test(u))for(;l;)l.data?t.push(l.data):ge(l,t,r,i,n.slice()),l=l.nextSibling;else for(;l;)ge(l,t,r,i,n.slice()),l=l.nextSibling;t.push("")}else t.push("/>");return;case v:case T:for(l=e.firstChild;l;)ge(l,t,r,i,n.slice()),l=l.nextSibling;return;case p:return me(t,e.name,e.value);case f:return t.push(e.data.replace(/[<&>]/g,L));case m:return t.push("");case b:return t.push("\x3c!--",e.data,"--\x3e");case y:var R=e.publicId,C=e.systemId;if(t.push("");else if(C&&"."!=C)t.push(" SYSTEM ",C,">");else{var B=e.internalSubset;B&&t.push(" [",B,"]"),t.push(">")}return;case x:return t.push("");case g:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function _e(e,t,r){var i;switch(t.nodeType){case d:(i=t.cloneNode(!1)).ownerDocument=e;case T:break;case p:r=!0}if(i||(i=t.cloneNode(!1)),i.ownerDocument=e,i.parentNode=null,r)for(var n=t.firstChild;n;)i.appendChild(_e(e,n,r)),n=n.nextSibling;return i}function xe(e,t,r){var i=new t.constructor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var s=t[n];"object"!=typeof s&&s!=i[n]&&(i[n]=s)}switch(t.childNodes&&(i.childNodes=new C),i.ownerDocument=e,i.nodeType){case d:var o=t.attributes,a=i.attributes=new F,l=o.length;a._ownerElement=i;for(var u=0;u=0&&e0},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r)for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&r[i]===e)return i;t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},u(c,k),u(c,k.prototype),V.prototype={nodeName:"#document",nodeType:v,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==T){for(var r=e.firstChild;r;){var i=r.nextSibling;this.insertBefore(r,t),r=i}return e}return J(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===d&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),z(this,e)},replaceChild:function(e,t){J(this,e,t,Z),e.ownerDocument=this,t&&this.removeChild(t),Y(e)&&(this.documentElement=e)},importNode:function(e,t){return _e(this,e,t)},getElementById:function(e){var t=null;return N(this.documentElement,(function(r){if(r.nodeType==d&&r.getAttribute("id")==e)return t=r,!0})),t},getElementsByClassName:function(e){var t=l(e);return new B(this,(function(r){var i=[];return t.length>0&&N(r.documentElement,(function(n){if(n!==r&&n.nodeType===d){var s=n.getAttribute("class");if(s){var o=e===s;if(!o){var a=l(s);o=t.every((u=a,function(e){return u&&-1!==u.indexOf(e)}))}o&&i.push(n)}}var u})),i}))},createElement:function(e){var t=new ee;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new C,(t.attributes=new F)._ownerElement=t,t},createDocumentFragment:function(){var e=new he;return e.ownerDocument=this,e.childNodes=new C,e},createTextNode:function(e){var t=new ie;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new se;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new ce;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){var t=new te;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ue;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var r=new ee,i=t.split(":"),n=r.attributes=new F;return r.childNodes=new C,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=e,2==i.length?(r.prefix=i[0],r.localName=i[1]):r.localName=t,n._ownerElement=r,r},createAttributeNS:function(e,t){var r=new te,i=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=e,r.specified=!0,2==i.length?(r.prefix=i[0],r.localName=i[1]):r.localName=t,r}},h(V,k),ee.prototype={nodeType:d,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===T?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,X(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r&&r.value||""},setAttributeNS:function(e,t,r){var i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+r,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new B(this,(function(t){var r=[];return N(t,(function(i){i===t||i.nodeType!=d||"*"!==e&&i.tagName!=e||r.push(i)})),r}))},getElementsByTagNameNS:function(e,t){return new B(this,(function(r){var i=[];return N(r,(function(n){n===r||n.nodeType!==d||"*"!==e&&n.namespaceURI!==e||"*"!==t&&n.localName!=t||i.push(n)})),i}))}},V.prototype.getElementsByTagName=ee.prototype.getElementsByTagName,V.prototype.getElementsByTagNameNS=ee.prototype.getElementsByTagNameNS,h(ee,k),te.prototype.nodeType=p,h(te,k),re.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(w[A])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){r=this.data.substring(0,e)+r+this.data.substring(e+t),this.nodeValue=this.data=r,this.length=r.length}},h(re,k),ie.prototype={nodeName:"#text",nodeType:f,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var i=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},h(ie,re),ne.prototype={nodeName:"#comment",nodeType:b},h(ne,re),se.prototype={nodeName:"#cdata-section",nodeType:m},h(se,re),oe.prototype.nodeType=y,h(oe,k),ae.prototype.nodeType=S,h(ae,k),le.prototype.nodeType=_,h(le,k),ue.prototype.nodeType=g,h(ue,k),he.prototype.nodeName="#document-fragment",he.prototype.nodeType=T,h(he,k),ce.prototype.nodeType=x,h(ce,k),de.prototype.serializeToString=function(e,t,r){return pe.call(e,t,r)},k.prototype.toString=pe;try{if(Object.defineProperty){function ve(e){switch(e.nodeType){case d:case T:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(ve(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(B.prototype,"length",{get:function(){return G(this),this.$$length}}),Object.defineProperty(k.prototype,"textContent",{get:function(){return ve(this)},set:function(e){switch(this.nodeType){case d:case T:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),be=function(e,t,r){e["$$"+t]=r}}}catch(ye){}t.DocumentType=oe,t.DOMException=R,t.DOMImplementation=U,t.Element=ee,t.Node=k,t.NodeList=C,t.XMLSerializer=de},31045:function(e,t,r){"use strict";var i=r(72167).freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES},3969:function(e,t,r){var i=r(41146);t.DOMImplementation=i.DOMImplementation,t.XMLSerializer=i.XMLSerializer,t.DOMParser=r(86129).DOMParser},76925:function(e,t,r){var i=r(72167).NAMESPACE,n=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,s=new RegExp("[\\-\\.0-9"+n.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),o=new RegExp("^"+n.source+s.source+"*(?::"+n.source+s.source+"*)?$"),a=0,l=1,u=2,h=3,c=4,d=5,p=6,f=7;function m(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,m)}function g(){}function _(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function x(e,t,r,n,s,o){function m(e,t,i){r.attributeNames.hasOwnProperty(e)&&o.fatalError("Attribute "+e+" redefined"),r.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),i)}for(var g,_=++t,x=a;;){var b=e.charAt(_);switch(b){case"=":if(x===l)g=e.slice(t,_),x=h;else{if(x!==u)throw new Error("attribute equal must after attrName");x=h}break;case"'":case'"':if(x===h||x===l){if(x===l&&(o.warning('attribute value must after "="'),g=e.slice(t,_)),t=_+1,!((_=e.indexOf(b,t))>0))throw new Error("attribute value no end '"+b+"' match");m(g,v=e.slice(t,_),t-1),x=d}else{if(x!=c)throw new Error('attribute value must after "="');m(g,v=e.slice(t,_),t),o.warning('attribute "'+g+'" missed start quot('+b+")!!"),t=_+1,x=d}break;case"/":switch(x){case a:r.setTagName(e.slice(t,_));case d:case p:case f:x=f,r.closed=!0;case c:case l:break;case u:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),x==a&&r.setTagName(e.slice(t,_)),_;case">":switch(x){case a:r.setTagName(e.slice(t,_));case d:case p:case f:break;case c:case l:"/"===(v=e.slice(t,_)).slice(-1)&&(r.closed=!0,v=v.slice(0,-1));case u:x===u&&(v=g),x==c?(o.warning('attribute "'+v+'" missed quot(")!'),m(g,v,t)):(i.isHTML(n[""])&&v.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+v+'" missed value!! "'+v+'" instead!!'),m(v,v,t));break;case h:throw new Error("attribute value missed!!")}return _;case"€":b=" ";default:if(b<=" ")switch(x){case a:r.setTagName(e.slice(t,_)),x=p;break;case l:g=e.slice(t,_),x=u;break;case c:var v=e.slice(t,_);o.warning('attribute "'+v+'" missed quot(")!!'),m(g,v,t);case d:x=p}else switch(x){case u:r.tagName;i.isHTML(n[""])&&g.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+g+'" missed value!! "'+g+'" instead2!!'),m(g,g,t),t=_,x=l;break;case d:o.warning('attribute space is required"'+g+'"!!');case p:x=l,t=_;break;case h:x=c,t=_;break;case f:throw new Error("elements closed character '/' and '>' must be connected to")}}_++}}function b(e,t,r){for(var n=e.tagName,s=null,o=e.length;o--;){var a=e[o],l=a.qName,u=a.value;if((p=l.indexOf(":"))>0)var h=a.prefix=l.slice(0,p),c=l.slice(p+1),d="xmlns"===h&&c;else c=l,h=null,d="xmlns"===l&&"";a.localName=c,!1!==d&&(null==s&&(s={},T(r,r={})),r[d]=s[d]=u,a.uri=i.XMLNS,t.startPrefixMapping(d,u))}for(o=e.length;o--;){(h=(a=e[o]).prefix)&&("xml"===h&&(a.uri=i.XML),"xmlns"!==h&&(a.uri=r[h||""]))}var p;(p=n.indexOf(":"))>0?(h=e.prefix=n.slice(0,p),c=e.localName=n.slice(p+1)):(h=null,c=e.localName=n);var f=e.uri=r[h||""];if(t.startElement(f,c,n,e),!e.closed)return e.currentNSMap=r,e.localNSMap=s,!0;if(t.endElement(f,c,n),s)for(h in s)Object.prototype.hasOwnProperty.call(s,h)&&t.endPrefixMapping(h)}function v(e,t,r,i,n){if(/^(?:script|textarea)$/i.test(r)){var s=e.indexOf("",t),o=e.substring(t+1,s);if(/[&<]/.test(o))return/^script$/i.test(r)?(n.characters(o,0,o.length),s):(o=o.replace(/&#?\w+;/g,i),n.characters(o,0,o.length),s)}return t+1}function y(e,t,r,i){var n=i[r];return null==n&&((n=e.lastIndexOf(""))t?(r.comment(e,t+4,n-t-4),n+3):(i.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var n=e.indexOf("]]>",t+9);return r.startCDATA(),r.characters(e,t+9,n-t-9),r.endCDATA(),n+3}var s=function(e,t){var r,i=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;n.lastIndex=t,n.exec(e);for(;r=n.exec(e);)if(i.push(r),r[1])return i}(e,t),o=s.length;if(o>1&&/!doctype/i.test(s[0][0])){var a=s[1][0],l=!1,u=!1;o>3&&(/^public$/i.test(s[2][0])?(l=s[3][0],u=o>4&&s[4][0]):/^system$/i.test(s[2][0])&&(u=s[3][0]));var h=s[o-1];return r.startDTD(a,l,u),r.endDTD(),h.index+h[0].length}return-1}function E(e,t,r){var i=e.indexOf("?>",t);if(i){var n=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(n){n[0].length;return r.processingInstruction(n[1],n[2]),i+2}return-1}return-1}function w(){this.attributeNames={}}m.prototype=new Error,m.prototype.name=m.name,g.prototype={parse:function(e,t,r){var n=this.domBuilder;n.startDocument(),T(t,t={}),function(e,t,r,n,s){function o(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(r,t)?r[t]:"#"===t.charAt(0)?o(parseInt(t.substr(1).replace("x","0x"))):(s.error("entity not found:"+e),e)}function l(t){if(t>T){var r=e.substring(T,t).replace(/&#?\w+;/g,a);p&&u(T),n.characters(r,0,t-T),T=t}}function u(t,r){for(;t>=c&&(r=d.exec(e));)h=r.index,c=h+r[0].length,p.lineNumber++;p.columnNumber=t-h+1}var h=0,c=0,d=/.*(?:\r\n?|\n)|.*$/g,p=n.locator,f=[{currentNSMap:t}],g={},T=0;for(;;){try{var A=e.indexOf("<",T);if(A<0){if(!e.substr(T).match(/^\s*$/)){var M=n.doc,P=M.createTextNode(e.substr(T));M.appendChild(P),n.currentElement=P}return}switch(A>T&&l(A),e.charAt(A+1)){case"/":var R=e.indexOf(">",A+3),C=e.substring(A+2,R).replace(/[ \t\n\r]+$/g,""),B=f.pop();R<0?(C=e.substring(A+2).replace(/[\s<].*/,""),s.error("end tag name: "+C+" is not complete:"+B.tagName),R=A+1+C.length):C.match(/\sT?T=R:l(Math.max(A,T)+1)}}(e,t,r,n,this.errorHandler),n.endDocument()}},w.prototype={setTagName:function(e){if(!o.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!o.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=g,t.ParseError=m},9187:function(e){"use strict";function t(e,t,i){i=i||2;var s,o,a,l,c,d,f,m=t&&t.length,g=m?t[0]*i:e.length,_=r(e,0,g,i,!0),x=[];if(!_||_.next===_.prev)return x;if(m&&(_=function(e,t,i,n){var s,o,a,l=[];for(s=0,o=t.length;s80*i){s=a=e[0],o=l=e[1];for(var b=i;ba&&(a=c),d>l&&(l=d);f=0!==(f=Math.max(a-s,l-o))?32767/f:0}return n(_,x,i,s,o,f,0),x}function r(e,t,r,i,n){var s,o;if(n===A(e,t,r,i)>0)for(s=t;s=t;s-=i)o=S(s,e[s],e[s+1],o);return o&&_(o,o.next)&&(E(o),o=o.next),o}function i(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!_(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(E(i),(i=t=i.prev)===i.next)break;r=!0}}while(r||i!==t);return t}function n(e,t,r,u,h,c,p){if(e){!p&&c&&function(e,t,r,i){var n=e;do{0===n.z&&(n.z=d(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,r,i,n,s,o,a,l,u=1;do{for(r=e,e=null,s=null,o=0;r;){for(o++,i=r,a=0,t=0;t0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;r=i}s.nextZ=null,u*=2}while(o>1)}(n)}(e,u,h,c);for(var f,m,g=e;e.prev!==e.next;)if(f=e.prev,m=e.next,c?o(e,u,h,c):s(e))t.push(f.i/r|0),t.push(e.i/r|0),t.push(m.i/r|0),E(e),e=m.next,g=m.next;else if((e=m)===g){p?1===p?n(e=a(i(e),t,r),t,r,u,h,c,2):2===p&&l(e,t,r,u,h,c):n(i(e),t,r,u,h,c,1);break}}}function s(e){var t=e.prev,r=e,i=e.next;if(g(t,r,i)>=0)return!1;for(var n=t.x,s=r.x,o=i.x,a=t.y,l=r.y,u=i.y,h=ns?n>o?n:o:s>o?s:o,p=a>l?a>u?a:u:l>u?l:u,m=i.next;m!==t;){if(m.x>=h&&m.x<=d&&m.y>=c&&m.y<=p&&f(n,a,s,l,o,u,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(e,t,r,i){var n=e.prev,s=e,o=e.next;if(g(n,s,o)>=0)return!1;for(var a=n.x,l=s.x,u=o.x,h=n.y,c=s.y,p=o.y,m=al?a>u?a:u:l>u?l:u,b=h>c?h>p?h:p:c>p?c:p,v=d(m,_,t,r,i),y=d(x,b,t,r,i),T=e.prevZ,S=e.nextZ;T&&T.z>=v&&S&&S.z<=y;){if(T.x>=m&&T.x<=x&&T.y>=_&&T.y<=b&&T!==n&&T!==o&&f(a,h,l,c,u,p,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;if(T=T.prevZ,S.x>=m&&S.x<=x&&S.y>=_&&S.y<=b&&S!==n&&S!==o&&f(a,h,l,c,u,p,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;T&&T.z>=v;){if(T.x>=m&&T.x<=x&&T.y>=_&&T.y<=b&&T!==n&&T!==o&&f(a,h,l,c,u,p,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;S&&S.z<=y;){if(S.x>=m&&S.x<=x&&S.y>=_&&S.y<=b&&S!==n&&S!==o&&f(a,h,l,c,u,p,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function a(e,t,r){var n=e;do{var s=n.prev,o=n.next.next;!_(s,o)&&x(s,n,n.next,o)&&y(s,o)&&y(o,s)&&(t.push(s.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),E(n),E(n.next),n=e=o),n=n.next}while(n!==e);return i(n)}function l(e,t,r,s,o,a){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var h=T(l,u);return l=i(l,l.next),h=i(h,h.next),n(l,t,r,s,o,a,0),void n(h,t,r,s,o,a,0)}u=u.next}l=l.next}while(l!==e)}function u(e,t){return e.x-t.x}function h(e,t){var r=function(e,t){var r,i=t,n=e.x,s=e.y,o=-1/0;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){var a=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>o&&(o=a,r=i.x=i.x&&i.x>=h&&n!==i.x&&f(sr.x||i.x===r.x&&c(r,i)))&&(r=i,p=l)),i=i.next}while(i!==u);return r}(e,t);if(!r)return t;var n=T(r,e);return i(n,n.next),i(r,r.next)}function c(e,t){return g(e.prev,e,t.prev)<0&&g(t.next,e,e.next)<0}function d(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,r=e;do{(t.x=(e-o)*(s-a)&&(e-o)*(i-a)>=(r-o)*(t-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&x(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(y(e,t)&&y(t,e)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}(e,t)&&(g(e.prev,e,t.prev)||g(e,t.prev,t))||_(e,t)&&g(e.prev,e,e.next)>0&&g(t.prev,t,t.next)>0)}function g(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function _(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,r,i){var n=v(g(e,t,r)),s=v(g(e,t,i)),o=v(g(r,i,e)),a=v(g(r,i,t));return n!==s&&o!==a||(!(0!==n||!b(e,r,t))||(!(0!==s||!b(e,i,t))||(!(0!==o||!b(r,e,i))||!(0!==a||!b(r,t,i)))))}function b(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function v(e){return e>0?1:e<0?-1:0}function y(e,t){return g(e.prev,e,e.next)<0?g(e,t,e.next)>=0&&g(e,e.prev,t)>=0:g(e,t,e.prev)<0||g(e,e.next,t)<0}function T(e,t){var r=new w(e.i,e.x,e.y),i=new w(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function S(e,t,r,i){var n=new w(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function E(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function w(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(e,t,r,i){for(var n=0,s=t,o=r-i;s0&&(i+=e[n-1].length,r.holes.push(i))}return r}},90891:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return b}});var i=/iPhone/i,n=/iPod/i,s=/iPad/i,o=/\biOS-universal(?:.+)Mac\b/i,a=/\bAndroid(?:.+)Mobile\b/i,l=/Android/i,u=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,h=/Silk/i,c=/Windows Phone/i,d=/\bWindows(?:.+)ARM\b/i,p=/BlackBerry/i,f=/BB10/i,m=/Opera Mini/i,g=/\b(CriOS|Chrome)(?:.+)Mobile/i,_=/Mobile(?:.+)Firefox\b/i,x=function(e){return void 0!==e&&"MacIntel"===e.platform&&"number"==typeof e.maxTouchPoints&&e.maxTouchPoints>1&&"undefined"==typeof MSStream};function b(e){var t={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"==typeof navigator?"string"==typeof e?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=t.userAgent,b=r.split("[FBAN");void 0!==b[1]&&(r=b[0]),void 0!==(b=r.split("Twitter"))[1]&&(r=b[0]);var v=function(e){return function(t){return t.test(e)}}(r),y={apple:{phone:v(i)&&!v(c),ipod:v(n),tablet:!v(i)&&(v(s)||x(t))&&!v(c),universal:v(o),device:(v(i)||v(n)||v(s)||v(o)||x(t))&&!v(c)},amazon:{phone:v(u),tablet:!v(u)&&v(h),device:v(u)||v(h)},android:{phone:!v(c)&&v(u)||!v(c)&&v(a),tablet:!v(c)&&!v(u)&&!v(a)&&(v(h)||v(l)),device:!v(c)&&(v(u)||v(h)||v(a)||v(l))||v(/\bokhttp\b/i)},windows:{phone:v(c),tablet:v(d),device:v(c)||v(d)},other:{blackberry:v(p),blackberry10:v(f),opera:v(m),firefox:v(_),chrome:v(g),device:v(p)||v(f)||v(m)||v(_)||v(g)},any:!1,phone:!1,tablet:!1};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}},94462:function(e){e.exports=function(e){var n=[];return e.replace(r,(function(e,r,s){var o=r.toLowerCase();for(s=function(e){var t=e.match(i);return t?t.map(Number):[]}(s),"m"==o&&s.length>2&&(n.push([r].concat(s.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(s.length==t[o])return s.unshift(r),n.push(s);if(s.length {\n BASIS({\n locateFile: (_file) => absoluteWasmUrl\n }).then((module) => {\n module.initializeBasis();\n resolve(module.BasisFile);\n });\n });\n }\n return basisPromise;\n }\n async function fetchBasisTexture(url, BasisTexture) {\n const basisResponse = await fetch(url);\n if (basisResponse.ok) {\n const basisArrayBuffer = await basisResponse.arrayBuffer();\n return new BasisTexture(new Uint8Array(basisArrayBuffer));\n }\n throw new Error(`Failed to load Basis texture: ${url}`);\n }\n const preferredTranscodedFormat = [\n "bc7-rgba-unorm",\n "astc-4x4-unorm",\n "etc2-rgba8unorm",\n "bc3-rgba-unorm",\n "rgba8unorm"\n ];\n async function load(url) {\n const BasisTexture = await getBasis();\n const basisTexture = await fetchBasisTexture(url, BasisTexture);\n const levelBuffers = createLevelBuffers(basisTexture, basisTranscoderFormat);\n return {\n width: basisTexture.getImageWidth(0, 0),\n height: basisTexture.getImageHeight(0, 0),\n format: basisTranscodedTextureFormat,\n resource: levelBuffers,\n alphaMode: "no-premultiply-alpha"\n };\n }\n async function init(jsUrl, wasmUrl, supportedTextures) {\n if (jsUrl)\n settings.jsUrl = jsUrl;\n if (wasmUrl)\n settings.wasmUrl = wasmUrl;\n basisTranscodedTextureFormat = preferredTranscodedFormat.filter((format) => supportedTextures.includes(format))[0];\n basisTranscoderFormat = gpuFormatToBasisTranscoderFormat(basisTranscodedTextureFormat);\n await getBasis();\n }\n const messageHandlers = {\n init: async (data) => {\n const { jsUrl, wasmUrl, supportedTextures } = data;\n await init(jsUrl, wasmUrl, supportedTextures);\n },\n load: async (data) => {\n try {\n const textureOptions = await load(data.url);\n return {\n type: "load",\n url: data.url,\n success: true,\n textureOptions,\n transferables: textureOptions.resource?.map((arr) => arr.buffer)\n };\n } catch (e) {\n throw e;\n }\n }\n };\n self.onmessage = async (messageEvent) => {\n const message = messageEvent.data;\n const response = await messageHandlers[message.type](message);\n if (response) {\n self.postMessage(response, response.transferables);\n }\n };\n\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(r)}}i.revokeObjectURL=function(){r&&(URL.revokeObjectURL(r),r=null)},t.default=i},9083:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=null;class i{constructor(){r||(r=URL.createObjectURL(new Blob(['(function () {\n \'use strict\';\n\n const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";\n async function checkImageBitmap() {\n try {\n if (typeof createImageBitmap !== "function")\n return false;\n const response = await fetch(WHITE_PNG);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap.width === 1 && imageBitmap.height === 1;\n } catch (e) {\n return false;\n }\n }\n void checkImageBitmap().then((result) => {\n self.postMessage(result);\n });\n\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(r)}}i.revokeObjectURL=function(){r&&(URL.revokeObjectURL(r),r=null)},t.default=i},86312:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=null;class i{constructor(){r||(r=URL.createObjectURL(new Blob(['(function () {\n \'use strict\';\n\n const converters = {\n rgb8unorm: {\n convertedFormat: "rgba8unorm",\n convertFunction: convertRGBtoRGBA\n },\n "rgb8unorm-srgb": {\n convertedFormat: "rgba8unorm-srgb",\n convertFunction: convertRGBtoRGBA\n }\n };\n function convertFormatIfRequired(textureOptions) {\n const format = textureOptions.format;\n if (converters[format]) {\n const convertFunction = converters[format].convertFunction;\n const levelBuffers = textureOptions.resource;\n for (let i = 0; i < levelBuffers.length; i++) {\n levelBuffers[i] = convertFunction(levelBuffers[i]);\n }\n textureOptions.format = converters[format].convertedFormat;\n }\n }\n function convertRGBtoRGBA(levelBuffer) {\n const pixelCount = levelBuffer.byteLength / 3;\n const levelBufferWithAlpha = new Uint32Array(pixelCount);\n for (let i = 0; i < pixelCount; ++i) {\n levelBufferWithAlpha[i] = levelBuffer[i * 3] + (levelBuffer[i * 3 + 1] << 8) + (levelBuffer[i * 3 + 2] << 16) + 4278190080;\n }\n return new Uint8Array(levelBufferWithAlpha.buffer);\n }\n\n function createLevelBuffersFromKTX(ktxTexture) {\n const levelBuffers = [];\n for (let i = 0; i < ktxTexture.numLevels; i++) {\n const imageData = ktxTexture.getImageData(i, 0, 0);\n const levelBuffer = new Uint8Array(imageData.byteLength);\n levelBuffer.set(imageData);\n levelBuffers.push(levelBuffer);\n }\n return levelBuffers;\n }\n\n const glFormatToGPUFormatMap = {\n 6408: "rgba8unorm",\n 32856: "bgra8unorm",\n //\n 32857: "rgb10a2unorm",\n 33189: "depth16unorm",\n 33190: "depth24plus",\n 33321: "r8unorm",\n 33323: "rg8unorm",\n 33325: "r16float",\n 33326: "r32float",\n 33327: "rg16float",\n 33328: "rg32float",\n 33329: "r8sint",\n 33330: "r8uint",\n 33331: "r16sint",\n 33332: "r16uint",\n 33333: "r32sint",\n 33334: "r32uint",\n 33335: "rg8sint",\n 33336: "rg8uint",\n 33337: "rg16sint",\n 33338: "rg16uint",\n 33339: "rg32sint",\n 33340: "rg32uint",\n 33778: "bc2-rgba-unorm",\n 33779: "bc3-rgba-unorm",\n 34836: "rgba32float",\n 34842: "rgba16float",\n 35056: "depth24plus-stencil8",\n 35898: "rg11b10ufloat",\n 35901: "rgb9e5ufloat",\n 35907: "rgba8unorm-srgb",\n // bgra8unorm-srgb\n 36012: "depth32float",\n 36013: "depth32float-stencil8",\n 36168: "stencil8",\n 36208: "rgba32uint",\n 36214: "rgba16uint",\n 36220: "rgba8uint",\n 36226: "rgba32sint",\n 36232: "rgba16sint",\n 36238: "rgba8sint",\n 36492: "bc7-rgba-unorm",\n 36756: "r8snorm",\n 36757: "rg8snorm",\n 36759: "rgba8snorm",\n 37496: "etc2-rgba8unorm",\n 37808: "astc-4x4-unorm"\n };\n function glFormatToGPUFormat(glInternalFormat) {\n const format = glFormatToGPUFormatMap[glInternalFormat];\n if (format) {\n return format;\n }\n throw new Error(`Unsupported glInternalFormat: ${glInternalFormat}`);\n }\n\n const vkFormatToGPUFormatMap = {\n 23: "rgb8unorm",\n // VK_FORMAT_R8G8B8_UNORM\n 37: "rgba8unorm",\n // VK_FORMAT_R8G8B8A8_UNORM\n 43: "rgba8unorm-srgb"\n // VK_FORMAT_R8G8B8A8_SRGB\n // TODO add more!\n };\n function vkFormatToGPUFormat(vkFormat) {\n const format = vkFormatToGPUFormatMap[vkFormat];\n if (format) {\n return format;\n }\n throw new Error(`Unsupported VkFormat: ${vkFormat}`);\n }\n\n function getTextureFormatFromKTXTexture(ktxTexture) {\n if (ktxTexture.classId === 2) {\n return vkFormatToGPUFormat(ktxTexture.vkFormat);\n }\n return glFormatToGPUFormat(ktxTexture.glInternalformat);\n }\n\n const gpuFormatToBasisTranscoderFormatMap = {\n "bc3-rgba-unorm": "BC3_RGBA",\n "bc7-rgba-unorm": "BC7_M5_RGBA",\n "etc2-rgba8unorm": "ETC2_RGBA",\n "astc-4x4-unorm": "ASTC_4x4_RGBA",\n // Uncompressed\n rgba8unorm: "RGBA32",\n rg11b10ufloat: "R11F_G11F_B10F"\n };\n function gpuFormatToKTXBasisTranscoderFormat(transcoderFormat) {\n const format = gpuFormatToBasisTranscoderFormatMap[transcoderFormat];\n if (format) {\n return format;\n }\n throw new Error(`Unsupported transcoderFormat: ${transcoderFormat}`);\n }\n\n const settings = {\n jsUrl: "",\n wasmUrl: ""\n };\n let basisTranscoderFormat;\n let basisTranscodedTextureFormat;\n let ktxPromise;\n async function getKTX() {\n if (!ktxPromise) {\n const absoluteJsUrl = new URL(settings.jsUrl, location.origin).href;\n const absoluteWasmUrl = new URL(settings.wasmUrl, location.origin).href;\n importScripts(absoluteJsUrl);\n ktxPromise = new Promise((resolve) => {\n LIBKTX({\n locateFile: (_file) => absoluteWasmUrl\n }).then((libktx) => {\n resolve(libktx);\n });\n });\n }\n return ktxPromise;\n }\n async function fetchKTXTexture(url, ktx) {\n const ktx2Response = await fetch(url);\n if (ktx2Response.ok) {\n const ktx2ArrayBuffer = await ktx2Response.arrayBuffer();\n return new ktx.ktxTexture(new Uint8Array(ktx2ArrayBuffer));\n }\n throw new Error(`Failed to load KTX(2) texture: ${url}`);\n }\n const preferredTranscodedFormat = [\n "bc7-rgba-unorm",\n "astc-4x4-unorm",\n "etc2-rgba8unorm",\n "bc3-rgba-unorm",\n "rgba8unorm"\n ];\n async function load(url) {\n const ktx = await getKTX();\n const ktxTexture = await fetchKTXTexture(url, ktx);\n let format;\n if (ktxTexture.needsTranscoding) {\n format = basisTranscodedTextureFormat;\n const transcodeFormat = ktx.TranscodeTarget[basisTranscoderFormat];\n const result = ktxTexture.transcodeBasis(transcodeFormat, 0);\n if (result !== ktx.ErrorCode.SUCCESS) {\n throw new Error("Unable to transcode basis texture.");\n }\n } else {\n format = getTextureFormatFromKTXTexture(ktxTexture);\n }\n const levelBuffers = createLevelBuffersFromKTX(ktxTexture);\n const textureOptions = {\n width: ktxTexture.baseWidth,\n height: ktxTexture.baseHeight,\n format,\n mipLevelCount: ktxTexture.numLevels,\n resource: levelBuffers,\n alphaMode: "no-premultiply-alpha"\n };\n convertFormatIfRequired(textureOptions);\n return textureOptions;\n }\n async function init(jsUrl, wasmUrl, supportedTextures) {\n if (jsUrl)\n settings.jsUrl = jsUrl;\n if (wasmUrl)\n settings.wasmUrl = wasmUrl;\n basisTranscodedTextureFormat = preferredTranscodedFormat.filter((format) => supportedTextures.includes(format))[0];\n basisTranscoderFormat = gpuFormatToKTXBasisTranscoderFormat(basisTranscodedTextureFormat);\n await getKTX();\n }\n const messageHandlers = {\n init: async (data) => {\n const { jsUrl, wasmUrl, supportedTextures } = data;\n await init(jsUrl, wasmUrl, supportedTextures);\n },\n load: async (data) => {\n try {\n const textureOptions = await load(data.url);\n return {\n type: "load",\n url: data.url,\n success: true,\n textureOptions,\n transferables: textureOptions.resource?.map((arr) => arr.buffer)\n };\n } catch (e) {\n throw e;\n }\n }\n };\n self.onmessage = async (messageEvent) => {\n const message = messageEvent.data;\n const response = await messageHandlers[message.type]?.(message);\n if (response) {\n self.postMessage(response, response.transferables);\n }\n };\n\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(r)}}i.revokeObjectURL=function(){r&&(URL.revokeObjectURL(r),r=null)},t.default=i},61567:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=null;class i{constructor(){r||(r=URL.createObjectURL(new Blob(['(function () {\n \'use strict\';\n\n async function loadImageBitmap(url, alphaMode) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n }\n const imageBlob = await response.blob();\n return alphaMode === "premultiplied-alpha" ? createImageBitmap(imageBlob, { premultiplyAlpha: "none" }) : createImageBitmap(imageBlob);\n }\n self.onmessage = async (event) => {\n try {\n const imageBitmap = await loadImageBitmap(event.data.data[0], event.data.data[1]);\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n }, [imageBitmap]);\n } catch (e) {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id\n });\n }\n };\n\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(r)}}i.revokeObjectURL=function(){r&&(URL.revokeObjectURL(r),r=null)},t.default=i},96480:function(e,t,r){"use strict";var i=r(49410),n=r(17073),s=r(2636),o=r(39654);class a{constructor(e,t=s.isMobile){this._mobileInfo=t,this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook();const r=document.createElement("div");r.style.width="100px",r.style.height="100px",r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex=2..toString(),this._div=r,this._renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2..toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",(()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()})),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.add(this),this._renderer.view.canvas.parentNode?.appendChild(this._div))}_deactivate(){this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this),this._div.parentNode?.removeChild(this._div))}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let e=0;e title : ${e.title}
tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:r}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>r&&(e.height=r-e.y)}_addChild(e){let t=this._pool.pop();t||(t=document.createElement("button"),t.style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2..toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title=`container ${e.tabIndex}`),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{container:r}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new i.FederatedEvent(n),{target:r});n.rootTarget=this._renderer.lastObjectRendered,t.forEach((e=>n.dispatchEvent(s,e)))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){9===e.keyCode&&this._activate()}_onMouseMove(e){0===e.movementX&&0===e.movementY||this._deactivate()}destroy(){this._destroyTouchHook(),this._div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this._pool=null,this._children=null,this._renderer=null}}a.extension={type:[n.ExtensionType.WebGLSystem,n.ExtensionType.WebGPUSystem],name:"accessibility"},t.AccessibilitySystem=a},49507:function(e,t){"use strict";t.accessibilityTarget={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1}},46807:function(e,t,r){"use strict";var i=r(96480),n=r(49507);t.AccessibilitySystem=i.AccessibilitySystem,t.accessibilityTarget=n.accessibilityTarget},29377:function(e,t,r){"use strict";var i=r(17073),n=r(74599),s=r(96480),o=r(49507);i.extensions.add(s.AccessibilitySystem),n.Container.mixin(o.accessibilityTarget)},43931:function(e,t,r){"use strict";var i=r(17073),n=r(81210),s=r(57422),o=r(79474);class a extends n.BlendModeFilter{constructor(){super({gl:{functions:`\n ${s.hslgl}\n\n vec3 blendColor(vec3 base, vec3 blend, float opacity)\n {\n return (setLuminosity(blend, getLuminosity(base)) * opacity + base * (1.0 - opacity));\n }\n `,main:"\n finalColor = vec4(blendColor(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:`\n ${o.hslgpu}\n\n fn blendColorOpacity(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n return (setLuminosity(blend, getLuminosity(base)) * opacity + base * (1.0 - opacity));\n }\n `,main:"\n out = vec4(blendColorOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}a.extension={name:"color",type:i.ExtensionType.BlendMode},t.ColorBlend=a},20607:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float colorBurn(float base, float blend)\n {\n return max((1.0 - ((1.0 - base) / blend)), 0.0);\n }\n\n vec3 blendColorBurn(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n colorBurn(base.r, blend.r),\n colorBurn(base.g, blend.g),\n colorBurn(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendColorBurn(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn colorBurn(base:f32, blend:f32) -> f32\n {\n return max((1.0-((1.0-base)/blend)),0.0);\n }\n\n fn blendColorBurn(base: vec3, blend: vec3, opacity: f32) -> vec3\n {\n let blended = vec3(\n colorBurn(base.r, blend.r),\n colorBurn(base.g, blend.g),\n colorBurn(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendColorBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"color-burn",type:i.ExtensionType.BlendMode},t.ColorBurnBlend=s},96755:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float colorDodge(float base, float blend)\n {\n return base / (1.0 - blend);\n }\n\n vec3 blendColorDodge(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n colorDodge(base.r, blend.r),\n colorDodge(base.g, blend.g),\n colorDodge(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendColorDodge(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn colorDodge(base: f32, blend: f32) -> f32\n {\n return base / (1.0 - blend);\n }\n\n fn blendColorDodge(base: vec3, blend: vec3, opacity: f32) -> vec3\n {\n let blended = vec3(\n colorDodge(base.r, blend.r),\n colorDodge(base.g, blend.g),\n colorDodge(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendColorDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"color-dodge",type:i.ExtensionType.BlendMode},t.ColorDodgeBlend=s},12488:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n vec3 blendDarken(vec3 base, vec3 blend, float opacity)\n {\n return (min(base, blend) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendDarken(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn blendDarken(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n return (min(blend,base) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendDarken(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"darken",type:i.ExtensionType.BlendMode},t.DarkenBlend=s},56442:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n vec3 blendDifference(vec3 base, vec3 blend, float opacity)\n {\n return (abs(blend - base) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendDifference(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn blendDifference(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n return (abs(blend - base) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendDifference(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"difference",type:i.ExtensionType.BlendMode},t.DifferenceBlend=s},97914:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float divide(float base, float blend)\n {\n return (blend > 0.0) ? clamp(base / blend, 0.0, 1.0) : 1.0;\n }\n\n vec3 blendDivide(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n divide(base.r, blend.r),\n divide(base.g, blend.g),\n divide(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendDivide(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn divide(base: f32, blend: f32) -> f32\n {\n return select(1.0, clamp(base / blend, 0.0, 1.0), blend > 0.0);\n }\n\n fn blendDivide(base: vec3, blend: vec3, opacity: f32) -> vec3\n {\n let blended = vec3(\n divide(base.r, blend.r),\n divide(base.g, blend.g),\n divide(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendDivide(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"divide",type:i.ExtensionType.BlendMode},t.DivideBlend=s},64909:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n vec3 exclusion(vec3 base, vec3 blend)\n {\n return base + blend - 2.0 * base * blend;\n }\n\n vec3 blendExclusion(vec3 base, vec3 blend, float opacity)\n {\n return (exclusion(base, blend) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendExclusion(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn exclusion(base: vec3, blend: vec3) -> vec3\n {\n return base+blend-2.0*base*blend;\n }\n\n fn blendExclusion(base: vec3, blend: vec3, opacity: f32) -> vec3\n {\n return (exclusion(base, blend) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendExclusion(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"exclusion",type:i.ExtensionType.BlendMode},t.ExclusionBlend=s},26004:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float hardLight(float base, float blend)\n {\n return (blend < 0.5) ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);\n }\n\n vec3 blendHardLight(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n hardLight(base.r, blend.r),\n hardLight(base.g, blend.g),\n hardLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendHardLight(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn hardLight(base: f32, blend: f32) -> f32\n {\n return select(1.0 - 2.0 * (1.0 - base) * (1.0 - blend), 2.0 * base * blend, blend < 0.5);\n }\n\n fn blendHardLight(base: vec3, blend: vec3, opacity: f32) -> vec3\n {\n let blended = vec3(\n hardLight(base.r, blend.r),\n hardLight(base.g, blend.g),\n hardLight(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendHardLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"hard-light",type:i.ExtensionType.BlendMode},t.HardLightBlend=s},92219:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float hardMix(float base, float blend)\n {\n return (base + blend >= 1.0) ? 1.0 : 0.0;\n }\n\n vec3 blendHardMix(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n hardMix(base.r, blend.r),\n hardMix(base.g, blend.g),\n hardMix(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendHardMix(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn hardMix(base: f32, blend: f32) -> f32\n {\n return select(0.0, 1.0, base + blend >= 1.0);\n }\n\n fn blendHardMix(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n let blended: vec3 = vec3(\n hardMix(base.r, blend.r),\n hardMix(base.g, blend.g),\n hardMix(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendHardMix(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"hard-mix",type:i.ExtensionType.BlendMode},t.HardMixBlend=s},31660:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n vec3 blendLighten(vec3 base, vec3 blend, float opacity)\n {\n return (max(base, blend) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendLighten(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn blendLighten(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n return (max(base, blend) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendLighten(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"lighten",type:i.ExtensionType.BlendMode},t.LightenBlend=s},34412:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float linearBurn(float base, float blend)\n {\n return max(0.0, base + blend - 1.0);\n }\n\n vec3 blendLinearBurn(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n linearBurn(base.r, blend.r),\n linearBurn(base.g, blend.g),\n linearBurn(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendLinearBurn(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn linearBurn(base: f32, blend: f32) -> f32\n {\n return max(0.0, base + blend - 1.0);\n }\n\n fn blendLinearBurn(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n let blended = vec3(\n linearBurn(base.r, blend.r),\n linearBurn(base.g, blend.g),\n linearBurn(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendLinearBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"linear-burn",type:i.ExtensionType.BlendMode},t.LinearBurnBlend=s},24258:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float linearDodge(float base, float blend) {\n return min(1.0, base + blend);\n }\n\n vec3 blendLinearDodge(vec3 base, vec3 blend, float opacity) {\n vec3 blended = vec3(\n linearDodge(base.r, blend.r),\n linearDodge(base.g, blend.g),\n linearDodge(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendLinearDodge(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn linearDodge(base: f32, blend: f32) -> f32\n {\n return min(1, base + blend);\n }\n\n fn blendLinearDodge(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n let blended = vec3(\n linearDodge(base.r, blend.r),\n linearDodge(base.g, blend.g),\n linearDodge(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendLinearDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"linear-dodge",type:i.ExtensionType.BlendMode},t.LinearDodgeBlend=s},93040:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float linearBurn(float base, float blend) {\n return max(0.0, base + blend - 1.0);\n }\n\n float linearDodge(float base, float blend) {\n return min(1.0, base + blend);\n }\n\n float linearLight(float base, float blend) {\n return (blend <= 0.5) ? linearBurn(base,2.0*blend) : linearBurn(base,2.0*(blend-0.5));\n }\n\n vec3 blendLinearLight(vec3 base, vec3 blend, float opacity) {\n vec3 blended = vec3(\n linearLight(base.r, blend.r),\n linearLight(base.g, blend.g),\n linearLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendLinearLight(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn linearBurn(base: f32, blend: f32) -> f32\n {\n return max(0.0, base + blend - 1.0);\n }\n\n fn linearDodge(base: f32, blend: f32) -> f32\n {\n return min(1.0, base + blend);\n }\n\n fn linearLight(base: f32, blend: f32) -> f32\n {\n return select(linearBurn(base,2.0*(blend-0.5)), linearBurn(base,2.0*blend), blend <= 0.5);\n }\n\n fn blendLinearLightOpacity(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n let blended = vec3(\n linearLight(base.r, blend.r),\n linearLight(base.g, blend.g),\n linearLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendLinearLightOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"linear-light",type:i.ExtensionType.BlendMode},t.LinearLightBlend=s},63846:function(e,t,r){"use strict";var i=r(17073),n=r(81210),s=r(57422),o=r(79474);class a extends n.BlendModeFilter{constructor(){super({gl:{functions:`\n ${s.hslgl}\n\n vec3 blendLuminosity(vec3 base, vec3 blend, float opacity)\n {\n vec3 blendLuminosity = setLuminosity(base, getLuminosity(blend));\n return (blendLuminosity * opacity + base * (1.0 - opacity));\n }\n `,main:"\n finalColor = vec4(blendLuminosity(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:`\n ${o.hslgpu}\n\n fn blendLuminosity(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n let blendLuminosity: vec3 = setLuminosity(base, getLuminosity(blend));\n return (blendLuminosity * opacity + base * (1.0 - opacity));\n }\n `,main:"\n out = vec4(blendLuminosity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}a.extension={name:"luminosity",type:i.ExtensionType.BlendMode},t.LuminosityBlend=a},61843:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n vec3 negation(vec3 base, vec3 blend)\n {\n return 1.0-abs(1.0-base-blend);\n }\n\n vec3 blendNegation(vec3 base, vec3 blend, float opacity)\n {\n return (negation(base, blend) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendNegation(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn blendNegation(base: vec3, blend: vec3) -> vec3\n {\n return 1.0-abs(1.0-base-blend);\n }\n\n fn blendNegationOpacity(base: vec3, blend: vec3, opacity: f32) -> vec3\n {\n return (blendNegation(base, blend) * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendNegationOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"negation",type:i.ExtensionType.BlendMode},t.NegationBlend=s},98815:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float overlay(float base, float blend)\n {\n return (base < 0.5) ? (2.0*base*blend) : (1.0-2.0*(1.0-base)*(1.0-blend));\n }\n\n vec3 blendOverlay(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n overlay(base.r, blend.r),\n overlay(base.g, blend.g),\n overlay(base.b, blend.b)\n );\n \n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendOverlay(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn overlay(base: f32, blend: f32) -> f32\n {\n return select((1.0-2.0*(1.0-base)*(1.0-blend)), (2.0*base*blend), base < 0.5);\n }\n\n fn blendOverlay(base: vec3, blend: vec3, opacity: f32) -> vec3\n {\n let blended = vec3(\n overlay(base.r, blend.r),\n overlay(base.g, blend.g),\n overlay(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendOverlay(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"overlay",type:i.ExtensionType.BlendMode},t.OverlayBlend=s},37976:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float pinLight(float base, float blend)\n {\n return (blend <= 0.5) ? min(base, 2.0 * blend) : max(base, 2.0 * (blend - 0.5));\n }\n\n vec3 blendPinLight(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n pinLight(base.r, blend.r),\n pinLight(base.g, blend.g),\n pinLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn pinLight(base: f32, blend: f32) -> f32\n {\n return select(max(base,2.0*(blend-0.5)), min(base,2.0*blend), blend <= 0.5);\n }\n\n fn blendPinLight(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n let blended = vec3(\n pinLight(base.r, blend.r),\n pinLight(base.g, blend.g),\n pinLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"pin-light",type:i.ExtensionType.BlendMode},t.PinLightBlend=s},47864:function(e,t,r){"use strict";var i=r(17073),n=r(81210),s=r(57422),o=r(79474);class a extends n.BlendModeFilter{constructor(){super({gl:{functions:`\n ${s.hslgl}\n\n vec3 blendSaturation(vec3 base, vec3 blend, float opacity)\n {\n vec3 blendSaturation = setLuminosity(setSaturation(base, getSaturation(blend)), getLuminosity(base));\n return (blendSaturation * opacity + base * (1.0 - opacity));\n }\n `,main:"\n finalColor = vec4(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:`\n ${o.hslgpu}\n\n fn blendSaturation(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n let blendSaturation = setLuminosity(setSaturation(base, getSaturation(blend)), getLuminosity(base));\n return (blendSaturation * opacity + base * (1.0 - opacity));\n }\n `,main:"\n out = vec4(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}a.extension={name:"saturation",type:i.ExtensionType.BlendMode},t.SaturationBlend=a},70922:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float softLight(float base, float blend)\n {\n return (blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));\n }\n\n vec3 blendSoftLight(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n softLight(base.r, blend.r),\n softLight(base.g, blend.g),\n softLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn softLight(base: f32, blend: f32) -> f32\n {\n return select(2.0 * base * blend + base * base * (1.0 - 2.0 * blend), sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend), blend < 0.5);\n }\n\n fn blendSoftLight(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n let blended: vec3 = vec3(\n softLight(base.r, blend.r),\n softLight(base.g, blend.g),\n softLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"soft-light",type:i.ExtensionType.BlendMode},t.SoftLightBlend=s},56697:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float subtract(float base, float blend)\n {\n return max(0.0, base - blend);\n }\n\n vec3 blendSubtract(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n subtract(base.r, blend.r),\n subtract(base.g, blend.g),\n subtract(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn subtract(base: f32, blend: f32) -> f32\n {\n return max(0, base - blend);\n }\n\n fn blendSubtract(base:vec3, blend:vec3, opacity:f32) -> vec3\n {\n let blended = vec3(\n subtract(base.r, blend.r),\n subtract(base.g, blend.g),\n subtract(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"subtract",type:i.ExtensionType.BlendMode},t.SubtractBlend=s},89660:function(e,t,r){"use strict";var i=r(17073),n=r(81210);class s extends n.BlendModeFilter{constructor(){super({gl:{functions:"\n float colorBurn(float base, float blend)\n {\n return max((1.0-((1.0-base)/blend)),0.0);\n }\n\n float colorDodge(float base, float blend)\n {\n return min(1.0, base / (1.0-blend));\n }\n\n float vividLight(float base, float blend)\n {\n return (blend < 0.5) ? colorBurn(base,(2.0*blend)) : colorDodge(base,(2.0*(blend-0.5)));\n }\n\n vec3 blendVividLight(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n vividLight(base.r, blend.r),\n vividLight(base.g, blend.g),\n vividLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n finalColor = vec4(blendVividLight(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n "},gpu:{functions:"\n fn colorBurn(base:f32, blend:f32) -> f32\n {\n return max((1.0-((1.0-base)/blend)),0.0);\n }\n\n fn colorDodge(base: f32, blend: f32) -> f32\n {\n return min(1.0, base / (1.0-blend));\n }\n\n fn vividLight(base: f32, blend: f32) -> f32\n {\n return select(colorDodge(base,(2.0*(blend-0.5))), colorBurn(base,(2.0*blend)), blend<0.5);\n }\n\n fn blendVividLight(base: vec3, blend: vec3, opacity: f32) -> vec3\n {\n let blended: vec3 = vec3(\n vividLight(base.r, blend.r),\n vividLight(base.g, blend.g),\n vividLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ",main:"\n out = vec4(blendVividLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n "}})}}s.extension={name:"vivid-light",type:i.ExtensionType.BlendMode},t.VividLightBlend=s},24217:function(e,t,r){"use strict";var i=r(43931),n=r(20607),s=r(96755),o=r(12488),a=r(56442),l=r(97914),u=r(64909),h=r(26004),c=r(92219),d=r(31660),p=r(34412),f=r(24258),m=r(93040),g=r(63846),_=r(61843),x=r(98815),b=r(37976),v=r(47864),y=r(70922),T=r(56697),S=r(89660);t.ColorBlend=i.ColorBlend,t.ColorBurnBlend=n.ColorBurnBlend,t.ColorDodgeBlend=s.ColorDodgeBlend,t.DarkenBlend=o.DarkenBlend,t.DifferenceBlend=a.DifferenceBlend,t.DivideBlend=l.DivideBlend,t.ExclusionBlend=u.ExclusionBlend,t.HardLightBlend=h.HardLightBlend,t.HardMixBlend=c.HardMixBlend,t.LightenBlend=d.LightenBlend,t.LinearBurnBlend=p.LinearBurnBlend,t.LinearDodgeBlend=f.LinearDodgeBlend,t.LinearLightBlend=m.LinearLightBlend,t.LuminosityBlend=g.LuminosityBlend,t.NegationBlend=_.NegationBlend,t.OverlayBlend=x.OverlayBlend,t.PinLightBlend=b.PinLightBlend,t.SaturationBlend=v.SaturationBlend,t.SoftLightBlend=y.SoftLightBlend,t.SubtractBlend=T.SubtractBlend,t.VividLightBlend=S.VividLightBlend},38531:function(e,t,r){"use strict";var i=r(17073),n=r(4722),s=r(74599),o=r(77078),a=r(60094);const l=class e{constructor(...e){this.stage=new s.Container,void 0!==e[0]&&a.deprecation(a.v8_0_0,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await n.autoDetectRenderer(t),e._plugins.forEach((e=>{e.init.call(this,t)}))}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return a.deprecation(a.v8_0_0,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,r=!1){const i=e._plugins.slice(0);i.reverse(),i.forEach((e=>{e.destroy.call(this)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(t),this.renderer=null}};l._plugins=[];let u=l;i.extensions.handleByList(i.ExtensionType.Application,u._plugins),i.extensions.add(o.ApplicationInitHook),t.Application=u},45747:function(e,t,r){"use strict";var i=r(17073);class n{static init(e){Object.defineProperty(this,"resizeTo",{set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame((()=>this.resize())))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;let e,t;if(this._cancelResize(),this._resizeTo===globalThis.window)e=globalThis.innerWidth,t=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:i}=this._resizeTo;e=r,t=i}this.renderer.resize(e,t),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}n.extension=i.ExtensionType.Application,t.ResizePlugin=n},81729:function(e,t,r){"use strict";var i=r(17073),n=r(35292),s=r(63983);class o{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,n.UPDATE_PRIORITY.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?s.Ticker.shared:new s.Ticker,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}o.extension=i.ExtensionType.Application,t.TickerPlugin=o},58305:function(e,t,r){"use strict";var i=r(38531),n=r(45747),s=r(81729);t.Application=i.Application,t.ResizePlugin=n.ResizePlugin,t.TickerPlugin=s.TickerPlugin},9266:function(e,t,r){"use strict";var i=r(17073),n=r(45747),s=r(81729);i.extensions.add(n.ResizePlugin),i.extensions.add(s.TickerPlugin)},3033:function(){},18800:function(e,t,r){"use strict";var i=r(17073),n=r(45847),s=r(95190),o=r(45724),a=r(56509),l=r(62392),u=r(58433),h=r(28881),c=r(55673),d=r(62972),p=r(36214),f=r(17178),m=r(32181),g=r(20246),_=r(20763),x=r(76529),b=r(80428),v=r(27273),y=r(13189),T=r(6195),S=r(34361),E=r(95997),w=r(5866),A=r(82493);class M{constructor(){this._detections=[],this._initialized=!1,this.resolver=new E.Resolver,this.loader=new m.Loader,this.cache=a.Cache,this._backgroundLoader=new o.BackgroundLoader(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){if(this._initialized)return void s.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let t=e.manifest;"string"==typeof t&&(t=await this.load(t)),this.resolver.addManifest(t)}const t=e.texturePreference?.resolution??1,r="number"==typeof t?[t]:t,i=await this._detectFormats({preferredFormats:e.texturePreference?.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:i,resolution:r}}),e.preferences&&this.setPreferences(e.preferences)}add(e){this.resolver.add(e)}async load(e,t){this._initialized||await this.init();const r=A.isSingleItem(e),i=w.convertToList(e).map((e=>{if("string"!=typeof e){const t=this.resolver.getAlias(e);return t.some((e=>!this.resolver.hasKey(e)))&&this.add(e),Array.isArray(t)?t[0]:t}return this.resolver.hasKey(e)||this.add({alias:e,src:e}),e})),n=this.resolver.resolve(i),s=await this._mapLoadToResolve(n,t);return r?s[i[0]]:s}addBundle(e,t){this.resolver.addBundle(e,t)}async loadBundle(e,t){this._initialized||await this.init();let r=!1;"string"==typeof e&&(r=!0,e=[e]);const i=this.resolver.resolveBundle(e),n={},s=Object.keys(i);let o=0,a=0;const l=()=>{t?.(++o/a)},u=s.map((e=>{const t=i[e];return a+=Object.keys(t).length,this._mapLoadToResolve(t,l).then((t=>{n[e]=t}))}));return await Promise.all(u),r?n[e[0]]:n}async backgroundLoad(e){this._initialized||await this.init(),"string"==typeof e&&(e=[e]);const t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t))}async backgroundLoadBundle(e){this._initialized||await this.init(),"string"==typeof e&&(e=[e]);const t=this.resolver.resolveBundle(e);Object.values(t).forEach((e=>{this._backgroundLoader.add(Object.values(e))}))}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if("string"==typeof e)return a.Cache.get(e);const t={};for(let r=0;r{const t=i[e.src],r=[e.src];e.alias&&r.push(...e.alias),r.forEach((e=>{n[e]=t})),a.Cache.set(r,t)})),n}async unload(e){this._initialized||await this.init();const t=w.convertToList(e).map((e=>"string"!=typeof e?e.src:e)),r=this.resolver.resolve(t);await this._unloadFromResolved(r)}async unloadBundle(e){this._initialized||await this.init(),e=w.convertToList(e);const t=this.resolver.resolveBundle(e),r=Object.keys(t).map((e=>this._unloadFromResolved(t[e])));await Promise.all(r)}async _unloadFromResolved(e){const t=Object.values(e);t.forEach((e=>{a.Cache.remove(e.src)})),await this.loader.unload(t)}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const r of e.detections)e.skipDetections||await r.test()?t=await r.add(t):e.skipDetections||(t=await r.remove(t));return t=t.filter(((e,r)=>t.indexOf(e)===r)),t}get detections(){return this._detections}setPreferences(e){this.loader.parsers.forEach((t=>{t.config&&Object.keys(t.config).filter((t=>t in e)).forEach((r=>{t.config[r]=e[r]}))}))}}const P=new M;i.extensions.handleByList(i.ExtensionType.LoadParser,P.loader.parsers).handleByList(i.ExtensionType.ResolveParser,P.resolver.parsers).handleByList(i.ExtensionType.CacheParser,P.cache.parsers).handleByList(i.ExtensionType.DetectionParser,P.detections),i.extensions.add(l.cacheTextureArray,h.detectDefaults,u.detectAvif,f.detectWebp,c.detectMp4,d.detectOgv,p.detectWebm,g.loadJson,_.loadTxt,x.loadWebFont,b.loadSvg,v.loadTextures,y.loadVideoTextures,n.loadBitmapFont,n.bitmapFontCachePlugin,S.resolveTextureUrl,T.resolveJsonUrl);const R={loader:i.ExtensionType.LoadParser,resolver:i.ExtensionType.ResolveParser,cache:i.ExtensionType.CacheParser,detection:i.ExtensionType.DetectionParser};i.extensions.handle(i.ExtensionType.Asset,(e=>{const t=e.ref;Object.entries(R).filter((([e])=>!!t[e])).forEach((([e,r])=>i.extensions.add(Object.assign(t[e],{extension:t[e].extension??r}))))}),(e=>{const t=e.ref;Object.keys(R).filter((e=>!!t[e])).forEach((e=>i.extensions.remove(t[e])))})),t.Assets=P,t.AssetsClass=M},45724:function(e,t){"use strict";t.BackgroundLoader=class{constructor(e,t=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}add(e){e.forEach((e=>{this._assetList.push(e)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let r=0;r{o.set(e,t)}));const a=[...o.keys()],l={cacheKeys:a,keys:r};r.forEach((e=>{this._cacheMap.set(e,l)})),a.forEach((e=>{const r=s?s[e]:t;this._cache.has(e)&&this._cache.get(e)!==r&&i.warn("[Cache] already has key:",e),this._cache.set(e,o.get(e))}))}remove(e){if(!this._cacheMap.has(e))return void i.warn(`[Assets] Asset id ${e} was not found in the Cache`);const t=this._cacheMap.get(e);t.cacheKeys.forEach((e=>{this._cache.delete(e)})),t.keys.forEach((e=>{this._cacheMap.delete(e)}))}get parsers(){return this._parsers}};t.Cache=s},74858:function(){},62392:function(e,t,r){"use strict";var i=r(17073),n=r(84463);const s={extension:{type:i.ExtensionType.CacheParser,name:"cacheTextureArray"},test:e=>Array.isArray(e)&&e.every((e=>e instanceof n.Texture)),getCacheableAssets:(e,t)=>{const r={};return e.forEach((e=>{t.forEach(((t,i)=>{r[e+(0===i?"":i+1)]=t}))})),r}};t.cacheTextureArray=s},58433:function(e,t,r){"use strict";var i=r(17073),n=r(11560);const s={extension:{type:i.ExtensionType.DetectionParser,priority:1},test:async()=>n.testImageFormat("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async e=>[...e,"avif"],remove:async e=>e.filter((e=>"avif"!==e))};t.detectAvif=s},28881:function(e,t,r){"use strict";var i=r(17073);const n=["png","jpg","jpeg"],s={extension:{type:i.ExtensionType.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async e=>[...e,...n],remove:async e=>e.filter((e=>!n.includes(e)))};t.detectDefaults=s},55673:function(e,t,r){"use strict";var i=r(17073),n=r(44994);const s={extension:{type:i.ExtensionType.DetectionParser,priority:0},test:async()=>n.testVideoFormat("video/mp4"),add:async e=>[...e,"mp4","m4v"],remove:async e=>e.filter((e=>"mp4"!==e&&"m4v"!==e))};t.detectMp4=s},62972:function(e,t,r){"use strict";var i=r(17073),n=r(44994);const s={extension:{type:i.ExtensionType.DetectionParser,priority:0},test:async()=>n.testVideoFormat("video/ogg"),add:async e=>[...e,"ogv"],remove:async e=>e.filter((e=>"ogv"!==e))};t.detectOgv=s},36214:function(e,t,r){"use strict";var i=r(17073),n=r(44994);const s={extension:{type:i.ExtensionType.DetectionParser,priority:0},test:async()=>n.testVideoFormat("video/webm"),add:async e=>[...e,"webm"],remove:async e=>e.filter((e=>"webm"!==e))};t.detectWebm=s},17178:function(e,t,r){"use strict";var i=r(17073),n=r(11560);const s={extension:{type:i.ExtensionType.DetectionParser,priority:0},test:async()=>n.testImageFormat("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async e=>[...e,"webp"],remove:async e=>e.filter((e=>"webp"!==e))};t.detectWebp=s},77645:function(){},11560:function(e,t){"use strict";t.testImageFormat=async function(e){if("Image"in globalThis)return new Promise((t=>{const r=new Image;r.onload=()=>{t(!0)},r.onerror=()=>{t(!1)},r.src=e}));if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const t=await(await fetch(e)).blob();await createImageBitmap(t)}catch(e){return!1}return!0}return!1}},44994:function(e,t){"use strict";const r="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;t.testVideoFormat=function(e){return!r&&""!==document.createElement("video").canPlayType(e)}},98430:function(e,t,r){"use strict";r(3033);var i=r(18800),n=r(45724),s=r(56509);r(74858);var o=r(62392),a=r(58433),l=r(28881),u=r(55673),h=r(62972),c=r(36214),d=r(17178);r(77645);var p=r(11560),f=r(44994),m=r(32181),g=r(8774),_=r(20246),x=r(20763),b=r(76529),v=r(80428),y=r(27273),T=r(13189),S=r(64822);r(48024);var E=r(76836),w=r(6195),A=r(34361),M=r(95997);r(33717),r(44971);var P=r(73036),R=r(90206),C=r(5866),B=r(90973),G=r(42196),F=r(82493);t.Assets=i.Assets,t.AssetsClass=i.AssetsClass,t.BackgroundLoader=n.BackgroundLoader,t.Cache=s.Cache,t.cacheTextureArray=o.cacheTextureArray,t.detectAvif=a.detectAvif,t.detectDefaults=l.detectDefaults,t.detectMp4=u.detectMp4,t.detectOgv=h.detectOgv,t.detectWebm=c.detectWebm,t.detectWebp=d.detectWebp,t.testImageFormat=p.testImageFormat,t.testVideoFormat=f.testVideoFormat,t.Loader=m.Loader,t.LoaderParserPriority=g.LoaderParserPriority,t.loadJson=_.loadJson,t.loadTxt=x.loadTxt,t.getFontFamilyName=b.getFontFamilyName,t.loadWebFont=b.loadWebFont,t.loadSvg=v.loadSvg,t.loadImageBitmap=y.loadImageBitmap,t.loadTextures=y.loadTextures,t.crossOrigin=T.crossOrigin,t.determineCrossOrigin=T.determineCrossOrigin,t.loadVideoTextures=T.loadVideoTextures,t.preloadVideo=T.preloadVideo,t.createTexture=S.createTexture,t.WorkerManager=E.WorkerManager,t.resolveJsonUrl=w.resolveJsonUrl,t.resolveTextureUrl=A.resolveTextureUrl,t.Resolver=M.Resolver,t.getUrlExtension=M.getUrlExtension,t.checkDataUrl=P.checkDataUrl,t.checkExtension=R.checkExtension,t.convertToList=C.convertToList,t.copySearchParams=B.copySearchParams,t.createStringVariations=G.createStringVariations,t.isSingleItem=F.isSingleItem},32181:function(e,t,r){"use strict";var i=r(95190),n=r(36491),s=r(5866),o=r(82493);t.Loader=class{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,t,r)=>(this._parsersValidated=!1,e[t]=r,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,t){const r={promise:null,parser:null};return r.promise=(async()=>{let n=null,s=null;if(t.loadParser&&(s=this._parserHash[t.loadParser],s||i.warn(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!s){for(let r=0;r({alias:[e],src:e,data:{}}))),u=l.length,h=l.map((async e=>{const s=n.path.toAbsolute(e.src);if(!i[e.src])try{this.promiseCache[s]||(this.promiseCache[s]=this._getLoadPromiseAndParser(s,e)),i[e.src]=await this.promiseCache[s].promise,t&&t(++r/u)}catch(t){throw delete this.promiseCache[s],delete i[e.src],new Error(`[Loader.load] Failed to load ${s}.\n${t}`)}}));return await Promise.all(h),a?i[l[0].src]:i}async unload(e){const t=s.convertToList(e,(e=>({alias:[e],src:e}))).map((async e=>{const t=n.path.toAbsolute(e.src),r=this.promiseCache[t];if(r){const i=await r.promise;delete this.promiseCache[t],await(r.parser?.unload?.(i,e,this))}}));await Promise.all(t)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter((e=>e.name)).reduce(((e,t)=>(t.name?e[t.name]&&i.warn(`[Assets] loadParser name conflict "${t.name}"`):i.warn("[Assets] loadParser should have a name"),{...e,[t.name]:t})),{})}}},8774:function(e,t){"use strict";var r=(e=>(e[e.Low=0]="Low",e[e.Normal=1]="Normal",e[e.High=2]="High",e))(r||{});t.LoaderParserPriority=r},20246:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(73036),o=r(90206),a=r(8774);const l={extension:{type:n.ExtensionType.LoadParser,priority:a.LoaderParserPriority.Low},name:"loadJson",test(e){return s.checkDataUrl(e,"application/json")||o.checkExtension(e,".json")},async load(e){const t=await i.DOMAdapter.get().fetch(e);return await t.json()}};t.loadJson=l},20763:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(73036),o=r(90206),a=r(8774);const l={name:"loadTxt",extension:{type:n.ExtensionType.LoadParser,priority:a.LoaderParserPriority.Low,name:"loadTxt"},test(e){return s.checkDataUrl(e,"text/plain")||o.checkExtension(e,".txt")},async load(e){const t=await i.DOMAdapter.get().fetch(e);return await t.text()}};t.loadTxt=l},76529:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(95190),o=r(36491),a=r(56509),l=r(73036),u=r(90206),h=r(8774);const c=["normal","bold","100","200","300","400","500","600","700","800","900"],d=[".ttf",".otf",".woff",".woff2"],p=["font/ttf","font/otf","font/woff","font/woff2"],f=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function m(e){const t=o.path.extname(e),r=o.path.basename(e,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1)));let i=r.length>0;for(const e of r)if(!e.match(f)){i=!1;break}let n=r.join(" ");return i||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const g=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;const _={extension:{type:n.ExtensionType.LoadParser,priority:h.LoaderParserPriority.Low},name:"loadWebFont",test(e){return l.checkDataUrl(e,p)||u.checkExtension(e,d)},async load(e,t){const r=i.DOMAdapter.get().getFontFaceSet();if(r){const i=[],s=t.data?.family??m(e),o=t.data?.weights?.filter((e=>c.includes(e)))??["normal"],l=t.data??{};for(let t=0;t{a.Cache.remove(e.family),i.DOMAdapter.get().getFontFaceSet().delete(e)}))}};t.getFontFamilyName=m,t.loadWebFont=_},80428:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(75813),o=r(90537),a=r(87876),l=r(73036),u=r(90206),h=r(8774),c=r(64822);const d={extension:{type:n.ExtensionType.LoadParser,priority:h.LoaderParserPriority.Low,name:"loadSVG"},name:"loadSVG",config:{crossOrigin:"anonymous",parseAsGraphicsContext:!1},test(e){return l.checkDataUrl(e,"image/svg+xml")||u.checkExtension(e,".svg")},async load(e,t,r){return t.data.parseAsGraphicsContext??this.config.parseAsGraphicsContext?async function(e){const t=await i.DOMAdapter.get().fetch(e),r=await t.text(),n=new o.GraphicsContext;return n.svg(r),n}(e):async function(e,t,r,n){const o=await i.DOMAdapter.get().fetch(e),l=await o.blob(),u=URL.createObjectURL(l),h=new Image;h.src=u,h.crossOrigin=n,await h.decode(),URL.revokeObjectURL(u);const d=document.createElement("canvas"),p=d.getContext("2d"),f=t.data?.resolution||a.getResolutionOfUrl(e),m=t.data?.width??h.width,g=t.data?.height??h.height;d.width=m*f,d.height=g*f,p.drawImage(h,0,0,m*f,g*f);const{parseAsGraphicsContext:_,...x}=t.data,b=new s.ImageSource({resource:d,alphaMode:"premultiply-alpha-on-upload",resolution:f,...x});return c.createTexture(b,r,e)}(e,t,r,this.config.crossOrigin)},unload(e){e.destroy(!0)}};t.loadSvg=d},27273:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(75813),o=r(87876),a=r(73036),l=r(90206),u=r(76836),h=r(8774),c=r(64822);const d=[".jpeg",".jpg",".png",".webp",".avif"],p=["image/jpeg","image/png","image/webp","image/avif"];async function f(e,t){const r=await i.DOMAdapter.get().fetch(e);if(!r.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${e}: ${r.status} ${r.statusText}`);const n=await r.blob();return"premultiplied-alpha"===t?.data?.alphaMode?createImageBitmap(n,{premultiplyAlpha:"none"}):createImageBitmap(n)}const m={name:"loadTextures",extension:{type:n.ExtensionType.LoadParser,priority:h.LoaderParserPriority.High,name:"loadTextures"},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(e){return a.checkDataUrl(e,p)||l.checkExtension(e,d)},async load(e,t,r){let i=null;i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await u.WorkerManager.isImageBitmapSupported()?await u.WorkerManager.loadImageBitmap(e,t):await f(e,t):await new Promise((t=>{i=new Image,i.crossOrigin=this.config.crossOrigin,i.src=e,i.complete?t(i):i.onload=()=>{t(i)}}));const n=new s.ImageSource({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:t.data?.resolution||o.getResolutionOfUrl(e),...t.data});return c.createTexture(n,r,e)},unload(e){e.destroy(!0)}};t.loadImageBitmap=f,t.loadTextures=m},13189:function(e,t,r){"use strict";var i=r(17073),n=r(62480),s=r(86105),o=r(87876),a=r(73036),l=r(90206),u=r(64822);const h=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],c=h.map((e=>`video/${e.substring(1)}`));function d(e,t,r){void 0!==r||t.startsWith("data:")?!1!==r&&(e.crossOrigin="string"==typeof r?r:"anonymous"):e.crossOrigin=f(t)}function p(e){return new Promise(((t,r)=>{function i(){s(),t()}function n(e){s(),r(e)}function s(){e.removeEventListener("canplaythrough",i),e.removeEventListener("error",n)}e.addEventListener("canplaythrough",i),e.addEventListener("error",n),e.load()}))}function f(e,t=globalThis.location){if(e.startsWith("data:"))return"";t=t||globalThis.location;const r=new URL(e,document.baseURI);return r.hostname!==t.hostname||r.port!==t.port||r.protocol!==t.protocol?"anonymous":""}const m={name:"loadVideo",extension:{type:i.ExtensionType.LoadParser,name:"loadVideo"},test(e){const t=a.checkDataUrl(e,c),r=l.checkExtension(e,h);return t||r},async load(e,t,r){const i={...n.VideoSource.defaultOptions,resolution:t.data?.resolution||o.getResolutionOfUrl(e),alphaMode:t.data?.alphaMode||await s.detectVideoAlphaMode(),...t.data},a=document.createElement("video"),l={preload:!1!==i.autoLoad?"auto":void 0,"webkit-playsinline":!1!==i.playsinline?"":void 0,playsinline:!1!==i.playsinline?"":void 0,muted:!0===i.muted?"":void 0,loop:!0===i.loop?"":void 0,autoplay:!1!==i.autoPlay?"":void 0};Object.keys(l).forEach((e=>{const t=l[e];void 0!==t&&a.setAttribute(e,t)})),!0===i.muted&&(a.muted=!0),d(a,e,i.crossorigin);const h=document.createElement("source");let c;if(e.startsWith("data:"))c=e.slice(5,e.indexOf(";"));else if(!e.startsWith("blob:")){const t=e.split("?")[0].slice(e.lastIndexOf(".")+1).toLowerCase();c=n.VideoSource.MIME_TYPES[t]||`video/${t}`}return h.src=e,c&&(h.type=c),new Promise((s=>{const o=async()=>{const l=new n.VideoSource({...i,resource:a});a.removeEventListener("canplay",o),t.data.preload&&await p(a),s(u.createTexture(l,r,e))};a.addEventListener("canplay",o),a.appendChild(h)}))},unload(e){e.destroy(!0)}};t.crossOrigin=d,t.determineCrossOrigin=f,t.loadVideoTextures=m,t.preloadVideo=p},64822:function(e,t,r){"use strict";var i=r(84463),n=r(95190),s=r(56509);t.createTexture=function(e,t,r){e.label=r,e._sourceOrigin=r;const o=new i.Texture({source:e,label:r}),a=()=>{delete t.promiseCache[r],s.Cache.has(r)&&s.Cache.remove(r)};return o.source.once("destroy",(()=>{t.promiseCache[r]&&(n.warn("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."),a())})),o.once("destroy",(()=>{e.destroyed||(n.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),a())})),o}},48024:function(){},76836:function(e,t,r){"use strict";var i=r(9083),n=r(61567);let s,o=0;const a=new class{constructor(){this._initialized=!1,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={}}isImageBitmapSupported(){return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise((e=>{const{worker:t}=new i.default;t.addEventListener("message",(r=>{t.terminate(),i.default.revokeObjectURL(),e(r.data)}))}))),this._isImageBitmapSupported}loadImageBitmap(e,t){return this._run("loadImageBitmap",[e,t?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=!0)}_getWorker(){void 0===s&&(s=navigator.hardwareConcurrency||4);let e=this._workerPool.pop();return!e&&this._createdWorkers{this._complete(e.data),this._returnWorker(e.target),this._next()}))),e}_returnWorker(e){this._workerPool.push(e)}_complete(e){void 0!==e.error?this._resolveHash[e.uuid].reject(e.error):this._resolveHash[e.uuid].resolve(e.data),this._resolveHash[e.uuid]=null}async _run(e,t){await this._initWorkers();const r=new Promise(((r,i)=>{this._queue.push({id:e,arguments:t,resolve:r,reject:i})}));return this._next(),r}_next(){if(!this._queue.length)return;const e=this._getWorker();if(!e)return;const t=this._queue.pop(),r=t.id;this._resolveHash[o]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:o++,id:r})}};t.WorkerManager=a},95997:function(e,t,r){"use strict";var i=r(95190),n=r(36491),s=r(5866),o=r(42196),a=r(82493);class l{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach((e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))})),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if("string"==typeof e)this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&")}}getAlias(e){const{alias:t,src:r}=e;return s.convertToList(t||r,(e=>"string"==typeof e?e:Array.isArray(e)?e.map((e=>e?.src??e)):e?.src?e.src:e),!0)}addManifest(e){this._manifest&&i.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach((e=>{this.addBundle(e.name,e.assets)}))}addBundle(e,t){const r=[];let i=t;Array.isArray(t)||(i=Object.entries(t).map((([e,t])=>"string"==typeof t||Array.isArray(t)?{alias:e,src:t}:{alias:e,...t}))),i.forEach((t=>{const i=t.src,n=t.alias;let s;if("string"==typeof n){const t=this._createBundleAssetId(e,n);r.push(t),s=[n,t]}else{const t=n.map((t=>this._createBundleAssetId(e,t)));r.push(...t),s=[...n,...t]}this.add({...t,alias:s,src:i})})),this._bundles[e]=r}add(e){const t=[];let r;Array.isArray(e)?t.push(...e):t.push(e),r=e=>{this.hasKey(e)&&i.warn(`[Resolver] already has key: ${e} overwriting`)};s.convertToList(t).forEach((e=>{const{src:t}=e;let{data:i,format:n,loadParser:a}=e;const l=s.convertToList(t).map((e=>"string"==typeof e?o.createStringVariations(e):Array.isArray(e)?e:[e])),u=this.getAlias(e);Array.isArray(u)?u.forEach(r):r(u);const h=[];l.forEach((e=>{e.forEach((e=>{let t={};if("object"!=typeof e){t.src=e;for(let r=0;r{this._assetMap[e]=h}))}))}resolveBundle(e){const t=a.isSingleItem(e);e=s.convertToList(e);const r={};return e.forEach((e=>{const t=this._bundles[e];if(t){const i=this.resolve(t),n={};for(const t in i){const r=i[t];n[this._extractAssetIdFromBundle(e,t)]=r}r[e]=n}})),t?r[e[0]]:r}resolveUrl(e){const t=this.resolve(e);if("string"!=typeof e){const e={};for(const r in t)e[r]=t[r].src;return e}return t.src}resolve(e){const t=a.isSingleItem(e);e=s.convertToList(e);const r={};return e.forEach((e=>{if(!this._resolverHash[e])if(this._assetMap[e]){let t=this._assetMap[e];const r=this._getPreferredOrder(t);r?.priority.forEach((e=>{r.params[e].forEach((r=>{const i=t.filter((t=>!!t[e]&&t[e]===r));i.length&&(t=i)}))})),this._resolverHash[e]=t[0]}else this._resolverHash[e]=this._buildResolvedAsset({alias:[e],src:e},{});r[e]=this._resolverHash[e]})),t?r[e[0]]:r}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;te.params.format.includes(t.format)));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;return`${e}${/\?/.test(e)?"&":"?"}${this._defaultSearchParams}`}_buildResolvedAsset(e,t){const{aliases:r,data:i,loadParser:s,format:o}=t;return(this._basePath||this._rootPath)&&(e.src=n.path.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=r??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...i||{},...e.data},e.loadParser=s??e.loadParser,e.format=o??e.format??u(e.src),e}}function u(e){return e.split(".").pop().split("?").shift().split("#").shift()}l.RETINA_PREFIX=/@([0-9\.]+)x/,t.Resolver=l,t.getUrlExtension=u},6195:function(e,t,r){"use strict";var i=r(17073),n=r(95997),s=r(34361);const o={extension:{type:i.ExtensionType.ResolveParser,priority:-2,name:"resolveJson"},test:e=>n.Resolver.RETINA_PREFIX.test(e)&&e.endsWith(".json"),parse:s.resolveTextureUrl.parse};t.resolveJsonUrl=o},34361:function(e,t,r){"use strict";var i=r(17073),n=r(27273),s=r(95997);const o={extension:{type:i.ExtensionType.ResolveParser,name:"resolveTexture"},test:n.loadTextures.test,parse:e=>({resolution:parseFloat(s.Resolver.RETINA_PREFIX.exec(e)?.[1]??"1"),format:e.split(".").pop(),src:e})};t.resolveTextureUrl=o},33717:function(){},44971:function(){},73036:function(e,t){"use strict";t.checkDataUrl=function(e,t){if(Array.isArray(t)){for(const r of t)if(e.startsWith(`data:${r}`))return!0;return!1}return e.startsWith(`data:${t}`)}},90206:function(e,t,r){"use strict";var i=r(36491);t.checkExtension=function(e,t){const r=e.split("?")[0],n=i.path.extname(r).toLowerCase();return Array.isArray(t)?t.includes(n):n===t}},5866:function(e,t){"use strict";t.convertToList=(e,t,r=!1)=>(Array.isArray(e)||(e=[e]),t?e.map((e=>"string"==typeof e||r?t(e):e)):e)},90973:function(e,t){"use strict";t.copySearchParams=(e,t)=>{const r=t.split("?")[1];return r&&(e+=`?${r}`),e}},42196:function(e,t){"use strict";function r(e,t,i,n,s){const o=t[i];for(let a=0;a{const t=e.substring(1,e.length-1).split(",");n.push(t)})),r(e,n,0,t,i)}else i.push(e);return i}},82493:function(e,t){"use strict";t.isSingleItem=e=>!Array.isArray(e)},58778:function(e,t,r){"use strict";var i=r(5538),n=r(13185);i.extend([n]);const s=class e{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}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(e){return this.value=e,this}set value(t){if(t instanceof e)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(null===t)throw new Error("Cannot set Color#value to null");null!==this._value&&this._isSourceEqual(this._value,t)||(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(e){return"string"==typeof e||"number"==typeof e||e instanceof Number||null===e?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):"object"==typeof e&&null!==e?{...e}:e}_isSourceEqual(e,t){const r=typeof e;if(r!==typeof t)return!1;if("number"===r||"string"===r||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length===t.length&&e.every(((e,r)=>e===t[r]));if(null!==e&&null!==t){const r=Object.keys(e),i=Object.keys(t);return r.length===i.length&&r.every((r=>e[r]===t[r]))}return e===t}toRgba(){const[e,t,r,i]=this._components;return{r:e,g:t,b:r,a:i}}toRgb(){const[e,t,r]=this._components;return{r:e,g:t,b:r}}toRgbaString(){const[e,t,r]=this.toUint8RgbArray();return`rgba(${e},${t},${r},${this.alpha})`}toUint8RgbArray(e){const[t,r,i]=this._components;return this._arrayRgb||(this._arrayRgb=[]),(e=e||this._arrayRgb)[0]=Math.round(255*t),e[1]=Math.round(255*r),e[2]=Math.round(255*i),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e=e||this._arrayRgba;const[t,r,i,n]=this._components;return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e=e||this._arrayRgb;const[t,r,i]=this._components;return e[0]=t,e[1]=r,e[2]=i,e}toNumber(){return this._int}toBgrNumber(){const[e,t,r]=this.toUint8RgbArray();return(r<<16)+(t<<8)+e}toLittleEndianNumber(){const e=this._int;return(e>>16)+(65280&e)+((255&e)<<16)}multiply(t){const[r,i,n,s]=e._temp.setValue(t)._components;return this._components[0]*=r,this._components[1]*=i,this._components[2]*=n,this._components[3]*=s,this._refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(1===e)return(255<<24)+this._int;if(0===e)return t?0:this._int;let r=this._int>>16&255,i=this._int>>8&255,n=255&this._int;return t&&(r=r*e+.5|0,i=i*e+.5|0,n=n*e+.5|0),(255*e<<24)+(r<<16)+(i<<8)+n}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const e=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}_normalize(t){let r,n,s,o;if(("number"==typeof t||t instanceof Number)&&t>=0&&t<=16777215){r=(t>>16&255)/255,n=(t>>8&255)/255,s=(255&t)/255,o=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[r,n,s,o=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[r,n,s,o=255]=t,r/=255,n/=255,s/=255,o/=255;else if("string"==typeof t||"object"==typeof t){if("string"==typeof t){const r=e.HEX_PATTERN.exec(t);r&&(t=`#${r[2]}`)}const a=i.colord(t);a.isValid()&&(({r:r,g:n,b:s,a:o}=a.rgba),r/=255,n/=255,s/=255)}if(void 0===r)throw new Error(`Unable to convert color ${t}`);this._components[0]=r,this._components[1]=n,this._components[2]=s,this._components[3]=o,this._refreshInt()}_refreshInt(){this._clamp(this._components);const[e,t,r]=this._components;this._int=(255*e<<16)+(255*t<<8)+(255*r|0)}_clamp(e,t=0,r=1){return"number"==typeof e?Math.min(Math.max(e,t),r):(e.forEach(((i,n)=>{e[n]=Math.min(Math.max(i,t),r)})),e)}static isColorLike(t){return"number"==typeof t||"string"==typeof t||t instanceof Number||t instanceof e||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||void 0!==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}};s.shared=new s,s._temp=new s,s.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let o=s;t.Color=o},77235:function(e,t,r){"use strict";var i=r(58778);t.Color=i.Color},25917:function(e,t,r){"use strict";var i=r(17073),n=r(58050),s=r(73533);const o={extension:{type:i.ExtensionType.DetectionParser,priority:3},test:async()=>!!await s.isWebGPUSupported()||!!n.isWebGLSupported(),add:async e=>[...e,"basis"],remove:async e=>e.filter((e=>"basis"!==e))};t.detectBasis=o},49728:function(e,t,r){"use strict";var i=r(8774),n=r(64822),s=r(90206),o=r(17073),a=r(68651),l=r(55484),u=r(94086);const h={extension:{type:o.ExtensionType.LoadParser,priority:i.LoaderParserPriority.High,name:"loadBasis"},name:"loadBasis",test(e){return s.checkExtension(e,[".basis"])},async load(e,t,r){const i=await l.getSupportedTextureFormats(),s=await u.loadBasisOnWorker(e,i),o=new a.CompressedSource(s);return n.createTexture(o,r,e)},unload(e){Array.isArray(e)?e.forEach((e=>e.destroy(!0))):e.destroy(!0)}};t.loadBasis=h},82923:function(){},31166:function(e,t){"use strict";t.createLevelBuffers=function(e,t){const r=e.getNumImages(),i=e.getNumLevels(0);if(!e.startTranscoding())throw new Error("startTranscoding failed");const n=[];for(let s=0;s{const{success:t,url:r,textureOptions:i}=e.data;t||console.warn("Failed to load Basis texture",r),o[r](i)},s.postMessage({type:"init",jsUrl:n.basisTranscoderUrls.jsUrl,wasmUrl:n.basisTranscoderUrls.wasmUrl,supportedTextures:e})),s}(t);return new Promise((t=>{o[e]=t,r.postMessage({type:"load",url:e})}))}},95966:function(e,t){"use strict";var r=(e=>(e[e.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",e[e.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",e[e.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",e[e.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",e[e.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",e[e.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",e[e.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",e[e.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",e[e.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",e[e.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",e[e.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",e[e.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",e[e.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",e[e.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",e[e.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",e[e.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",e[e.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",e[e.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",e[e.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",e[e.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",e[e.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",e[e.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",e[e.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",e[e.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",e[e.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",e[e.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",e[e.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",e[e.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",e[e.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",e[e.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",e[e.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",e[e.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",e[e.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",e[e.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",e[e.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",e[e.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",e[e.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",e[e.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",e[e.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",e[e.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",e[e.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",e[e.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",e[e.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",e[e.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",e[e.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",e[e.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",e[e.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",e[e.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",e[e.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",e[e.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",e[e.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",e[e.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",e[e.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",e[e.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",e[e.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",e[e.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",e[e.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",e[e.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",e[e.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",e[e.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",e[e.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",e[e.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",e[e.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",e[e.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",e[e.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",e[e.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",e[e.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",e[e.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",e[e.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",e[e.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",e[e.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",e[e.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",e[e.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",e[e.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",e[e.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",e[e.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",e[e.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",e[e.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",e[e.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",e[e.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",e[e.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",e[e.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",e[e.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",e[e.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",e[e.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",e[e.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",e[e.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",e[e.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",e[e.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",e[e.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",e[e.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",e[e.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",e[e.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",e[e.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",e[e.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",e[e.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",e[e.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",e[e.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",e[e.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",e[e.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",e[e.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",e[e.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",e[e.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",e[e.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",e[e.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",e[e.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",e[e.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",e[e.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",e[e.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",e[e.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",e[e.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",e[e.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",e[e.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",e[e.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",e[e.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",e[e.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",e[e.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",e[e.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",e[e.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",e[e.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",e[e.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",e[e.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",e))(r||{}),i=(e=>(e[e.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",e[e.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",e[e.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",e))(i||{});function n(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var s,o=((s=o||{})[s.UNKNOWN=0]="UNKNOWN",s[s.R8G8B8=20]="R8G8B8",s[s.A8R8G8B8=21]="A8R8G8B8",s[s.X8R8G8B8=22]="X8R8G8B8",s[s.R5G6B5=23]="R5G6B5",s[s.X1R5G5B5=24]="X1R5G5B5",s[s.A1R5G5B5=25]="A1R5G5B5",s[s.A4R4G4B4=26]="A4R4G4B4",s[s.R3G3B2=27]="R3G3B2",s[s.A8=28]="A8",s[s.A8R3G3B2=29]="A8R3G3B2",s[s.X4R4G4B4=30]="X4R4G4B4",s[s.A2B10G10R10=31]="A2B10G10R10",s[s.A8B8G8R8=32]="A8B8G8R8",s[s.X8B8G8R8=33]="X8B8G8R8",s[s.G16R16=34]="G16R16",s[s.A2R10G10B10=35]="A2R10G10B10",s[s.A16B16G16R16=36]="A16B16G16R16",s[s.A8P8=40]="A8P8",s[s.P8=41]="P8",s[s.L8=50]="L8",s[s.A8L8=51]="A8L8",s[s.A4L4=52]="A4L4",s[s.V8U8=60]="V8U8",s[s.L6V5U5=61]="L6V5U5",s[s.X8L8V8U8=62]="X8L8V8U8",s[s.Q8W8V8U8=63]="Q8W8V8U8",s[s.V16U16=64]="V16U16",s[s.A2W10V10U10=67]="A2W10V10U10",s[s.Q16W16V16U16=110]="Q16W16V16U16",s[s.R16F=111]="R16F",s[s.G16R16F=112]="G16R16F",s[s.A16B16G16R16F=113]="A16B16G16R16F",s[s.R32F=114]="R32F",s[s.G32R32F=115]="G32R32F",s[s.A32B32G32R32F=116]="A32B32G32R32F",s[s.UYVY=n("UYVY")]="UYVY",s[s.R8G8_B8G8=n("RGBG")]="R8G8_B8G8",s[s.YUY2=n("YUY2")]="YUY2",s[s.D3DFMT_G8R8_G8B8=n("GRGB")]="D3DFMT_G8R8_G8B8",s[s.DXT1=n("DXT1")]="DXT1",s[s.DXT2=n("DXT2")]="DXT2",s[s.DXT3=n("DXT3")]="DXT3",s[s.DXT4=n("DXT4")]="DXT4",s[s.DXT5=n("DXT5")]="DXT5",s[s.ATI1=n("ATI1")]="ATI1",s[s.AT1N=n("AT1N")]="AT1N",s[s.ATI2=n("ATI2")]="ATI2",s[s.AT2N=n("AT2N")]="AT2N",s[s.BC4U=n("BC4U")]="BC4U",s[s.BC4S=n("BC4S")]="BC4S",s[s.BC5U=n("BC5U")]="BC5U",s[s.BC5S=n("BC5S")]="BC5S",s[s.DX10=n("DX10")]="DX10",s);const a={[o.DXT1]:"bc1-rgba-unorm",[o.DXT2]:"bc2-rgba-unorm",[o.DXT3]:"bc2-rgba-unorm",[o.DXT4]:"bc3-rgba-unorm",[o.DXT5]:"bc3-rgba-unorm",[o.ATI1]:"bc4-r-unorm",[o.BC4U]:"bc4-r-unorm",[o.BC4S]:"bc4-r-snorm",[o.ATI2]:"bc5-rg-unorm",[o.BC5U]:"bc5-rg-unorm",[o.BC5S]:"bc5-rg-snorm",36:"rgba16uint",110:"rgba16sint",111:"r16float",112:"rg16float",113:"rgba16float",114:"r32float",115:"rg32float",116:"rgba32float"},l={70:"bc1-rgba-unorm",71:"bc1-rgba-unorm",72:"bc1-rgba-unorm-srgb",73:"bc2-rgba-unorm",74:"bc2-rgba-unorm",75:"bc2-rgba-unorm-srgb",76:"bc3-rgba-unorm",77:"bc3-rgba-unorm",78:"bc3-rgba-unorm-srgb",79:"bc4-r-unorm",80:"bc4-r-unorm",81:"bc4-r-snorm",82:"bc5-rg-unorm",83:"bc5-rg-unorm",84:"bc5-rg-snorm",94:"bc6h-rgb-ufloat",95:"bc6h-rgb-ufloat",96:"bc6h-rgb-float",97:"bc7-rgba-unorm",98:"bc7-rgba-unorm",99:"bc7-rgba-unorm-srgb",28:"rgba8unorm",29:"rgba8unorm-srgb",87:"bgra8unorm",91:"bgra8unorm-srgb",41:"r32float",49:"rg8unorm",56:"r16uint",61:"r8unorm",24:"rgb10a2unorm",11:"rgba16uint",13:"rgba16sint",10:"rgba16float",54:"r16float",34:"rg16float",16:"rg32float",2:"rgba32float"},u={MAGIC_VALUE:542327876,MAGIC_SIZE:4,HEADER_SIZE:124,HEADER_DX10_SIZE:20,PIXEL_FORMAT_FLAGS:{ALPHAPIXELS:1,ALPHA:2,FOURCC:4,RGB:64,RGBA:65,YUV:512,LUMINANCE:131072,LUMINANCEA:131073},RESOURCE_MISC_TEXTURECUBE:4,HEADER_FIELDS:{MAGIC:0,SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19,PF_FLAGS:20,FOURCC:21,RGB_BITCOUNT:22,R_BIT_MASK:23,G_BIT_MASK:24,B_BIT_MASK:25,A_BIT_MASK:26},HEADER_DX10_FIELDS:{DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},DXGI_FORMAT:r,D3D10_RESOURCE_DIMENSION:i,D3DFMT:o};t.D3D10_RESOURCE_DIMENSION=i,t.D3DFMT=o,t.DDS=u,t.DXGI_FORMAT=r,t.DXGI_TO_TEXTURE_FORMAT=l,t.FOURCC_TO_TEXTURE_FORMAT=a,t.TEXTURE_FORMAT_BLOCK_SIZE={"bc1-rgba-unorm":8,"bc1-rgba-unorm-srgb":8,"bc2-rgba-unorm":16,"bc2-rgba-unorm-srgb":16,"bc3-rgba-unorm":16,"bc3-rgba-unorm-srgb":16,"bc4-r-unorm":8,"bc4-r-snorm":8,"bc5-rg-unorm":16,"bc5-rg-snorm":16,"bc6h-rgb-ufloat":16,"bc6h-rgb-float":16,"bc7-rgba-unorm":16,"bc7-rgba-unorm-srgb":16}},69040:function(e,t,r){"use strict";var i=r(8774),n=r(64822),s=r(90206),o=r(17073),a=r(68651),l=r(55484),u=r(55418);const h={extension:{type:o.ExtensionType.LoadParser,priority:i.LoaderParserPriority.High,name:"loadDDS"},name:"loadDDS",test(e){return s.checkExtension(e,[".dds"])},async load(e,t,r){const i=await l.getSupportedTextureFormats(),s=await fetch(e),o=await s.arrayBuffer(),h=u.parseDDS(o,i),c=new a.CompressedSource(h);return n.createTexture(c,r,e)},unload(e){Array.isArray(e)?e.forEach((e=>e.destroy(!0))):e.destroy(!0)}};t.loadDDS=h},55418:function(e,t,r){"use strict";var i=r(95966);t.parseDDS=function(e,t){const{format:r,fourCC:n,width:s,height:o,dataOffset:a,mipmapCount:l}=function(e){const t=new Uint32Array(e,0,i.DDS.HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(t[i.DDS.HEADER_FIELDS.MAGIC]!==i.DDS.MAGIC_VALUE)throw new Error("Invalid magic number in DDS header");const r=t[i.DDS.HEADER_FIELDS.HEIGHT],n=t[i.DDS.HEADER_FIELDS.WIDTH],s=Math.max(1,t[i.DDS.HEADER_FIELDS.MIPMAP_COUNT]),o=t[i.DDS.HEADER_FIELDS.PF_FLAGS],a=t[i.DDS.HEADER_FIELDS.FOURCC],l=function(e,t,r,n){if(t&i.DDS.PIXEL_FORMAT_FLAGS.FOURCC){if(r===i.DDS.D3DFMT.DX10){const e=new Uint32Array(n,i.DDS.MAGIC_SIZE+i.DDS.HEADER_SIZE,i.DDS.HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(e[i.DDS.HEADER_DX10_FIELDS.MISC_FLAG]===i.DDS.RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(e[i.DDS.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]===i.DDS.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");const t=e[i.DDS.HEADER_DX10_FIELDS.DXGI_FORMAT];if(t in i.DXGI_TO_TEXTURE_FORMAT)return i.DXGI_TO_TEXTURE_FORMAT[t];throw new Error(`DDSParser cannot parse texture data with DXGI format ${t}`)}if(r in i.FOURCC_TO_TEXTURE_FORMAT)return i.FOURCC_TO_TEXTURE_FORMAT[r];throw new Error(`DDSParser cannot parse texture data with fourCC format ${r}`)}if(t&i.DDS.PIXEL_FORMAT_FLAGS.RGB||t&i.DDS.PIXEL_FORMAT_FLAGS.RGBA)return function(e){const t=e[i.DDS.HEADER_FIELDS.RGB_BITCOUNT],r=e[i.DDS.HEADER_FIELDS.R_BIT_MASK],n=e[i.DDS.HEADER_FIELDS.G_BIT_MASK],s=e[i.DDS.HEADER_FIELDS.B_BIT_MASK],o=e[i.DDS.HEADER_FIELDS.A_BIT_MASK];switch(t){case 32:if(255===r&&65280===n&&16711680===s&&4278190080===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM];if(16711680===r&&65280===n&&255===s&&4278190080===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM];if(1072693248===r&&1047552===n&&1023===s&&3221225472===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM];if(65535===r&&4294901760===n&&0===s&&0===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM];if(4294967295===r&&0===n&&0===s&&0===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT];break;case 24:break;case 16:if(31744===r&&992===n&&31===s&&32768===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM];if(63488===r&&2016===n&&31===s&&0===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM];if(3840===r&&240===n&&15===s&&61440===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM];if(255===r&&0===n&&0===s&&65280===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM];if(65535===r&&0===n&&0===s&&0===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM];break;case 8:if(255===r&&0===n&&0===s&&0===o)return i.DXGI_TO_TEXTURE_FORMAT[i.DDS.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM]}throw new Error(`DDSParser does not support uncompressed texture with configuration:\n bitCount = ${t}, rBitMask = ${r}, gBitMask = ${n}, aBitMask = ${o}`)}(e);if(t&i.DDS.PIXEL_FORMAT_FLAGS.YUV)throw new Error("DDSParser does not supported YUV uncompressed texture data.");if(t&i.DDS.PIXEL_FORMAT_FLAGS.LUMINANCE||t&i.DDS.PIXEL_FORMAT_FLAGS.LUMINANCEA)throw new Error("DDSParser does not support single-channel (lumninance) texture data!");if(t&i.DDS.PIXEL_FORMAT_FLAGS.ALPHA||t&i.DDS.PIXEL_FORMAT_FLAGS.ALPHAPIXELS)throw new Error("DDSParser does not support single-channel (alpha) texture data!");throw new Error("DDSParser failed to load a texture file due to an unknown reason!")}(t,o,a,e),u=i.DDS.MAGIC_SIZE+i.DDS.HEADER_SIZE+(a===i.DDS.D3DFMT.DX10?i.DDS.HEADER_DX10_SIZE:0);return{format:l,fourCC:a,width:n,height:r,dataOffset:u,mipmapCount:s}}(e);if(!t.includes(r))throw new Error(`Unsupported texture format: ${n} ${r}, supported: ${t}`);if(l<=1)return{format:r,width:s,height:o,resource:[new Uint8Array(e,a)],alphaMode:"no-premultiply-alpha"};const u=function(e,t,r,n,s,o){const a=[],l=i.TEXTURE_FORMAT_BLOCK_SIZE[e];let u=t,h=r,c=n;for(let e=0;e>1,1),h=Math.max(h>>1,1)}return a}(r,s,o,a,l,e);return{format:r,width:s,height:o,resource:u,alphaMode:"no-premultiply-alpha"}}},80385:function(e,t,r){"use strict";var i=r(25917),n=r(49728);r(82923);var s=r(31166),o=r(2383),a=r(45031),l=r(94086),u=r(95966),h=r(69040),c=r(55418),d=r(5566),p=r(7451),f=r(79531),m=r(97051);r(61155);var g=r(87976),_=r(41177),x=r(67172),b=r(54143),v=r(48834),y=r(12055),T=r(8198),S=r(17125),E=r(56899),w=r(13320);t.detectBasis=i.detectBasis,t.loadBasis=n.loadBasis,t.createLevelBuffers=s.createLevelBuffers,t.gpuFormatToBasisTranscoderFormat=o.gpuFormatToBasisTranscoderFormat,t.basisTranscoderUrls=a.basisTranscoderUrls,t.setBasisTranscoderPath=a.setBasisTranscoderPath,t.loadBasisOnWorker=l.loadBasisOnWorker,t.D3D10_RESOURCE_DIMENSION=u.D3D10_RESOURCE_DIMENSION,t.D3DFMT=u.D3DFMT,t.DDS=u.DDS,t.DXGI_FORMAT=u.DXGI_FORMAT,t.DXGI_TO_TEXTURE_FORMAT=u.DXGI_TO_TEXTURE_FORMAT,t.FOURCC_TO_TEXTURE_FORMAT=u.FOURCC_TO_TEXTURE_FORMAT,t.TEXTURE_FORMAT_BLOCK_SIZE=u.TEXTURE_FORMAT_BLOCK_SIZE,t.loadDDS=h.loadDDS,t.parseDDS=c.parseDDS,t.loadKTX=d.loadKTX,t.parseKTX=p.parseKTX,t.GL_INTERNAL_FORMAT=f.GL_INTERNAL_FORMAT,t.KTX=f.KTX,t.loadKTX2=m.loadKTX2,t.convertFormatIfRequired=g.convertFormatIfRequired,t.createLevelBuffersFromKTX=_.createLevelBuffersFromKTX,t.getTextureFormatFromKTXTexture=x.getTextureFormatFromKTXTexture,t.glFormatToGPUFormat=b.glFormatToGPUFormat,t.gpuFormatToKTXBasisTranscoderFormat=v.gpuFormatToKTXBasisTranscoderFormat,t.ktxTranscoderUrls=y.ktxTranscoderUrls,t.setKTXTranscoderPath=y.setKTXTranscoderPath,t.vkFormatToGPUFormat=T.vkFormatToGPUFormat,t.loadKTX2onWorker=S.loadKTX2onWorker,t.detectCompressed=E.detectCompressed,t.resolveCompressedTextureUrl=w.resolveCompressedTextureUrl,t.validFormats=w.validFormats},5566:function(e,t,r){"use strict";var i=r(8774),n=r(64822),s=r(90206),o=r(17073),a=r(68651),l=r(55484),u=r(7451);const h={extension:{type:o.ExtensionType.LoadParser,priority:i.LoaderParserPriority.High,name:"loadKTX"},name:"loadKTX",test(e){return s.checkExtension(e,".ktx")},async load(e,t,r){const i=await l.getSupportedTextureFormats(),s=await fetch(e),o=await s.arrayBuffer(),h=u.parseKTX(o,i),c=new a.CompressedSource(h);return n.createTexture(c,r,e)},unload(e){Array.isArray(e)?e.forEach((e=>e.destroy(!0))):e.destroy(!0)}};t.loadKTX=h},7451:function(e,t,r){"use strict";var i=r(79531);t.parseKTX=function(e,t){const r=new DataView(e);if(!function(e){for(let t=0;t>1||1,p=p>>1||1,f=d+4-1&-4,m=p+4-1&-4,c=f*m*r}return _}(r,s,p,l,u,c,h,n);return{format:d,width:l,height:u,resource:f,alphaMode:"no-premultiply-alpha"}}},79531:function(e,t){"use strict";var r=(e=>(e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGBA=6408]="RGBA",e[e.RGBA8UI=36220]="RGBA8UI",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.RGBA8I=36238]="RGBA8I",e[e.RGBA8=32856]="RGBA8",e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",e[e.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",e[e.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",e[e.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",e[e.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",e[e.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",e[e.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",e[e.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",e[e.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",e[e.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",e[e.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",e[e.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",e[e.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",e[e.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",e[e.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",e[e.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",e[e.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",e[e.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",e[e.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",e[e.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",e[e.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",e))(r||{});const i={FILE_HEADER_SIZE:64,FILE_IDENTIFIER:[171,75,84,88,32,49,49,187,13,10,26,10],FORMATS_TO_COMPONENTS:{6408:4,6407:3,33319:2,6403:1,6409:1,6410:2,6406:1},INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:{33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,36283:.5,36284:.5,36285:1,36286:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,37808:1,37840:1,37809:.8,37841:.8,37810:.64,37842:.64,37811:.53375,37843:.53375,37812:.445,37844:.445,37813:.4,37845:.4,37814:.33375,37846:.33375,37815:.25,37847:.25,37816:.32,37848:.32,37817:.26625,37849:.26625,37818:.2,37850:.2,37819:.16,37851:.16,37820:.13375,37852:.13375,37821:.11125,37853:.11125,36492:1,36493:1,36494:1,36495:1},INTERNAL_FORMAT_TO_TEXTURE_FORMATS:{33776:"bc1-rgba-unorm",33777:"bc1-rgba-unorm",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",35916:"bc1-rgba-unorm-srgb",35917:"bc1-rgba-unorm-srgb",35918:"bc2-rgba-unorm-srgb",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37488:"eac-r11unorm",37490:"eac-rg11snorm",37492:"etc2-rgb8unorm",37496:"etc2-rgba8unorm",37493:"etc2-rgb8unorm-srgb",37497:"etc2-rgba8unorm-srgb",37494:"etc2-rgb8a1unorm",37495:"etc2-rgb8a1unorm-srgb",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",36492:"bc7-rgba-unorm",36493:"bc7-rgba-unorm-srgb",36494:"bc6h-rgb-float",36495:"bc6h-rgb-ufloat",35907:"rgba8unorm-srgb",36759:"rgba8snorm",36220:"rgba8uint",36238:"rgba8sint",6408:"rgba8unorm"},FIELDS:{FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},TYPES_TO_BYTES_PER_COMPONENT:{5121:1,5123:2,5124:4,5125:4,5126:4,36193:8},TYPES_TO_BYTES_PER_PIXEL:{32819:2,32820:2,33635:2},ENDIANNESS:67305985};t.GL_INTERNAL_FORMAT=r,t.KTX=i},97051:function(e,t,r){"use strict";var i=r(8774),n=r(64822),s=r(90206),o=r(17073),a=r(68651),l=r(55484),u=r(17125);const h={extension:{type:o.ExtensionType.LoadParser,priority:i.LoaderParserPriority.High,name:"loadKTX2"},name:"loadKTX2",test(e){return s.checkExtension(e,".ktx2")},async load(e,t,r){const i=await l.getSupportedTextureFormats(),s=await u.loadKTX2onWorker(e,i),o=new a.CompressedSource(s);return n.createTexture(o,r,e)},async unload(e){Array.isArray(e)?e.forEach((e=>e.destroy(!0))):e.destroy(!0)}};t.loadKTX2=h},61155:function(){},87976:function(e,t){"use strict";const r={rgb8unorm:{convertedFormat:"rgba8unorm",convertFunction:i},"rgb8unorm-srgb":{convertedFormat:"rgba8unorm-srgb",convertFunction:i}};function i(e){const t=e.byteLength/3,r=new Uint32Array(t);for(let i=0;i{const{success:t,url:r,textureOptions:i}=e.data;t||console.warn("Failed to load KTX texture",r),o[r](i)},s.postMessage({type:"init",jsUrl:n.ktxTranscoderUrls.jsUrl,wasmUrl:n.ktxTranscoderUrls.wasmUrl,supportedTextures:e})),s}(t);return new Promise((t=>{o[e]=t,r.postMessage({type:"load",url:e})}))}},56899:function(e,t,r){"use strict";var i=r(17073),n=r(34155),s=r(58050),o=r(73533),a=r(13320);let l;const u={extension:{type:i.ExtensionType.DetectionParser,priority:2},test:async()=>!!await o.isWebGPUSupported()||!!s.isWebGLSupported(),add:async e=>{const t=await n.getSupportedCompressedTextureFormats();return l=function(e){const t=["basis"],r={};return e.forEach((e=>{const i=e.split("-")[0];i&&!r[i]&&(r[i]=!0,t.push(i))})),t.sort(((e,t)=>{const r=a.validFormats.indexOf(e),i=a.validFormats.indexOf(t);return-1===r?1:-1===i?-1:r-i})),t}(t),[...l,...e]},remove:async e=>l?e.filter((e=>!(e in l))):e};t.detectCompressed=u},13320:function(e,t,r){"use strict";var i=r(95997),n=r(90206),s=r(17073);const o=["basis","bc7","bc6h","astc","etc2","bc5","bc4","bc3","bc2","bc1","eac"],a={extension:s.ExtensionType.ResolveParser,test:e=>n.checkExtension(e,[".ktx",".ktx2",".dds"]),parse:e=>{let t;const r=e.split(".");if(r.length>2){const e=r[r.length-2];o.includes(e)&&(t=e)}else t=r[r.length-1];return{resolution:parseFloat(i.Resolver.RETINA_PREFIX.exec(e)?.[1]??"1"),format:t,src:e}}};t.resolveCompressedTextureUrl=a,t.validFormats=o},1394:function(e,t,r){"use strict";var i=r(14786),n=r(9565);const s=new i.Bounds,o=class{cull(e,t,r=!0){this._cullRecursive(e,t,r)}_cullRecursive(e,t,r=!0){if(e.cullable&&e.measurable&&e.includeInBuild){const i=e.cullArea??n.getGlobalBounds(e,r,s);e.culled=i.x>=t.x+t.width||i.y>=t.y+t.height||i.x+i.width<=t.x||i.y+i.height<=t.y}else e.culled=!1;if(e.cullableChildren&&!e.culled&&e.renderable&&e.measurable&&e.includeInBuild)for(let i=0;i{n.Culler.shared.cull(this.stage,this.renderer.screen),this.renderer.render({container:this.stage})}}static destroy(){this.render=this._renderRef}}s.extension={priority:10,type:i.ExtensionType.Application,name:"culler"},t.CullerPlugin=s},10051:function(e,t){"use strict";t.cullingMixin={cullArea:null,cullable:!1,cullableChildren:!0}},76143:function(e,t,r){"use strict";var i=r(1394),n=r(165),s=r(10051);t.Culler=i.Culler,t.CullerPlugin=n.CullerPlugin,t.cullingMixin=s.cullingMixin},36484:function(e,t){"use strict";const r={createCanvas:(e,t)=>{const r=document.createElement("canvas");return r.width=e,r.height=t,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>(new DOMParser).parseFromString(e,"text/xml")};t.BrowserAdapter=r},30149:function(e,t,r){"use strict";r(29377),r(9266),r(79322),r(55102),r(55063),r(83016),r(60862),r(34266),r(4862),r(38717),r(51654),r(58537),r(72400)},59759:function(e,t,r){"use strict";const i={extension:{type:r(17073).ExtensionType.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.resolve().then((function(){return r(30149)}))}};t.browserExt=i},38496:function(e,t,r){"use strict";var i=r(36484),n=r(59759);t.BrowserAdapter=i.BrowserAdapter,t.browserExt=n.browserExt},24306:function(e,t,r){"use strict";var i=r(3969);const n={createCanvas:(e,t)=>new OffscreenCanvas(e??0,t??0),getCanvasRenderingContext2D:()=>OffscreenCanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>globalThis.location.href,getFontFaceSet:()=>globalThis.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>(new i.DOMParser).parseFromString(e,"text/xml")};t.WebWorkerAdapter=n},59868:function(e,t,r){"use strict";var i=r(24306),n=r(147);t.WebWorkerAdapter=i.WebWorkerAdapter,t.webworkerExt=n.webworkerExt},23874:function(e,t,r){"use strict";r(9266),r(55102),r(55063),r(83016),r(60862),r(34266),r(4862),r(38717),r(51654),r(58537),r(72400)},147:function(e,t,r){"use strict";const i={extension:{type:r(17073).ExtensionType.Environment,name:"webworker",priority:0},test:()=>"undefined"!=typeof self&&void 0!==self.WorkerGlobalScope,load:async()=>{await Promise.resolve().then((function(){return r(23874)}))}};t.webworkerExt=i},42932:function(e,t,r){"use strict";let i=r(36484).BrowserAdapter;const n={get(){return i},set(e){i=e}};t.DOMAdapter=n},98182:function(e,t,r){"use strict";var i=r(17073);const n=[];async function s(e){if(!e)for(let e=0;ee.priority-t.priority))}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let r=0,i=t.length;r=0;i--)if(e.currentTarget=r[i],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,r=this._allInteractiveElements){if(0===r.length)return;e.eventPhase=e.BUBBLING_PHASE;const i=Array.isArray(t)?t:[t];for(let t=r.length-1;t>=0;t--)i.forEach((i=>{e.currentTarget=r[t],this.notifyTarget(e,i)}))}propagationPath(e){const t=[e];for(let r=0;r<2048&&e!==this.rootTarget&&e.parent;r++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,r,i,n,s=!1){let a=!1;if(this._interactivePrune(e))return null;if("dynamic"!==e.eventMode&&"dynamic"!==t||(o.EventsTicker.pauseUpdate=!1),e.interactiveChildren&&e.children){const o=e.children;for(let l=o.length-1;l>=0;l--){const u=o[l],h=this.hitTestMoveRecursive(u,this._isInteractive(t)?t:u.eventMode,r,i,n,s||n(e,r));if(h){if(h.length>0&&!h[h.length-1].parent)continue;const t=e.isInteractive();(h.length>0||t)&&(t&&this._allInteractiveElements.push(e),h.push(e)),0===this._hitElements.length&&(this._hitElements=h),a=!0}}}const l=this._isInteractive(t),u=e.isInteractive();return u&&u&&this._allInteractiveElements.push(e),s||this._hitElements.length>0?null:a?this._hitElements:l&&!n(e,r)&&i(e,r)?u?[e]:[]:null}hitTestRecursive(e,t,r,i,n){if(this._interactivePrune(e)||n(e,r))return null;if("dynamic"!==e.eventMode&&"dynamic"!==t||(o.EventsTicker.pauseUpdate=!1),e.interactiveChildren&&e.children){const s=e.children,o=r;for(let r=s.length-1;r>=0;r--){const a=s[r],l=this.hitTestRecursive(a,this._isInteractive(t)?t:a.eventMode,o,i,n);if(l){if(l.length>0&&!l[l.length-1].parent)continue;const t=e.isInteractive();return(l.length>0||t)&&l.push(e),l}}}const s=this._isInteractive(t),a=e.isInteractive();return s&&i(e,r)?a?[e]:[]:null}_isInteractive(e){return"static"===e||"dynamic"===e}_interactivePrune(e){return!(e&&e.visible&&e.renderable&&e.includeInBuild&&e.measurable)||("none"===e.eventMode||"passive"===e.eventMode&&!e.interactiveChildren)}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,c),!e.hitArea.contains(c.x,c.y)))return!0;if(e.effects&&e.effects.length)for(let r=0;r0&&n!==t.target){const i="mousemove"===e.type?"mouseout":"pointerout",s=this.createPointerEvent(e,i,n);if(this.dispatchEvent(s,"pointerout"),r&&this.dispatchEvent(s,"mouseout"),!t.composedPath().includes(n)){const i=this.createPointerEvent(e,"pointerleave",n);for(i.eventPhase=i.AT_TARGET;i.target&&!t.composedPath().includes(i.target);)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,"mouseleave"),i.target=i.target.parent;this.freeEvent(i)}this.freeEvent(s)}if(n!==t.target){const i="mousemove"===e.type?"mouseover":"pointerover",s=this.clonePointerEvent(t,i);this.dispatchEvent(s,"pointerover"),r&&this.dispatchEvent(s,"mouseover");let o=n?.parent;for(;o&&o!==this.rootTarget.parent&&o!==t.target;)o=o.parent;if(!o||o===this.rootTarget.parent){const e=this.clonePointerEvent(t,"pointerenter");for(e.eventPhase=e.AT_TARGET;e.target&&e.target!==n&&e.target!==this.rootTarget.parent;)e.currentTarget=e.target,this.notifyTarget(e),r&&this.notifyTarget(e,"mouseenter"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(s)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),"touch"===t.pointerType&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),r&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=t.target?.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,i.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof l.FederatedPointerEvent))return void s.warn("EventBoundary cannot map a non-pointer event as a pointer event");const t=this.trackingData(e.pointerId),r=this.createPointerEvent(e),i="mouse"===r.pointerType||"pen"===r.pointerType;this.dispatchEvent(r,"pointerover"),i&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursor=r.target?.cursor);const n=this.clonePointerEvent(r,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),i&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;t.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(n)}mapPointerOut(e){if(!(e instanceof l.FederatedPointerEvent))return void s.warn("EventBoundary cannot map a non-pointer event as a pointer event");const t=this.trackingData(e.pointerId);if(t.overTargets){const r="mouse"===e.pointerType||"pen"===e.pointerType,i=this.findMountedTarget(t.overTargets),n=this.createPointerEvent(e,"pointerout",i);this.dispatchEvent(n),r&&this.dispatchEvent(n,"mouseout");const s=this.createPointerEvent(e,"pointerleave",i);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;t.overTargets=null,this.freeEvent(n),this.freeEvent(s)}this.cursor=null}mapPointerUp(e){if(!(e instanceof l.FederatedPointerEvent))return void s.warn("EventBoundary cannot map a non-pointer event as a pointer event");const t=performance.now(),r=this.createPointerEvent(e);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){const e=2===r.button;this.dispatchEvent(r,e?"rightup":"mouseup")}const i=this.trackingData(e.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[e.button]);let o=n;if(n&&!r.composedPath().includes(n)){let t=n;for(;t&&!r.composedPath().includes(t);){if(r.currentTarget=t,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){const e=2===r.button;this.notifyTarget(r,e?"rightupoutside":"mouseupoutside")}t=t.parent}delete i.pressTargetsByButton[e.button],o=t}if(o){const n=this.clonePointerEvent(r,"click");n.target=o,n.path=null,i.clicksByButton[e.button]||(i.clicksByButton[e.button]={clickCount:0,target:n.target,timeStamp:t});const s=i.clicksByButton[e.button];if(s.target===n.target&&t-s.timeStamp<200?++s.clickCount:s.clickCount=1,s.target=n.target,s.timeStamp=t,n.detail=s.clickCount,"mouse"===n.pointerType){const e=2===n.button;this.dispatchEvent(n,e?"rightclick":"click")}else"touch"===n.pointerType&&this.dispatchEvent(n,"tap");this.dispatchEvent(n,"pointertap"),this.freeEvent(n)}this.freeEvent(r)}mapPointerUpOutside(e){if(!(e instanceof l.FederatedPointerEvent))return void s.warn("EventBoundary cannot map a non-pointer event as a pointer event");const t=this.trackingData(e.pointerId),r=this.findMountedTarget(t.pressTargetsByButton[e.button]),i=this.createPointerEvent(e);if(r){let n=r;for(;n;)i.currentTarget=n,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?this.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||this.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),n=n.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(i)}mapWheel(e){if(!(e instanceof u.FederatedWheelEvent))return void s.warn("EventBoundary cannot map a non-wheel event as a wheel event");const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let r=1;r("globalMove"===t&&(this.rootBoundary.enableGlobalMoveEvents=r),e[t]=r,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){const{canvas:r,resolution:i}=this.renderer;this.setTargetElement(r),this.resolution=i,e._defaultEventMode=t.eventMode??"passive",Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const r=this.cursorStyles[e];if(r)switch(typeof r){case"string":t&&(this.domElement.style.cursor=r);break;case"function":r(e);break;case"object":t&&Object.assign(this.domElement.style,r)}else t&&"string"==typeof e&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);if(this.autoPreventDefault&&t[0].isNormalized){(e.cancelable||!("cancelable"in e))&&e.preventDefault()}for(let e=0,r=t.length;e0&&(t=e.composedPath()[0]);const r=t!==this.domElement?"outside":"",i=this._normalizeToPointerData(e);for(let e=0,t=i.length;e{l.off(e,a,o)})),s?l.once(e,a,o):l.on(e,a,o)},removeEventListener(e,t,r){const i="function"==typeof t?void 0:t;e="boolean"==typeof r&&r||"object"==typeof r&&r.capture?`${e}capture`:e,t="function"==typeof t?t:t.handleEvent,this.off(e,t,i)},dispatchEvent(e){if(!(e instanceof n.FederatedEvent))throw new Error("Container cannot propagate events outside of the Federated Events API");return e.defaultPrevented=!1,e.path=null,e.target=this,e.manager.dispatchEvent(e),!e.defaultPrevented}};t.FederatedContainer=s},19250:function(e,t,r){"use strict";var i=r(26553),n=r(49410);class s extends n.FederatedEvent{constructor(){super(...arguments),this.client=new i.Point,this.movement=new i.Point,this.offset=new i.Point,this.global=new i.Point,this.screen=new i.Point}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,r){return e.worldTransform.applyInverse(r||this.global,t)}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,r,i,n,s,o,a,l,u,h,c,d,p,f){throw new Error("Method not implemented.")}}t.FederatedMouseEvent=s},45345:function(e,t,r){"use strict";var i=r(19250);class n extends i.FederatedMouseEvent{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}t.FederatedPointerEvent=n},81483:function(e,t,r){"use strict";var i=r(19250);class n extends i.FederatedMouseEvent{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}n.DOM_DELTA_PIXEL=0,n.DOM_DELTA_LINE=1,n.DOM_DELTA_PAGE=2,t.FederatedWheelEvent=n},30672:function(){},14073:function(e,t,r){"use strict";r(30672);var i=r(41863);r(14406);var n=r(8599),s=r(5443),o=r(49410);r(43094);var a=r(14235),l=r(19250),u=r(45345),h=r(81483);t.EventBoundary=i.EventBoundary,t.EventSystem=n.EventSystem,t.EventsTicker=s.EventsTicker,t.FederatedEvent=o.FederatedEvent,t.FederatedContainer=a.FederatedContainer,t.FederatedMouseEvent=l.FederatedMouseEvent,t.FederatedPointerEvent=u.FederatedPointerEvent,t.FederatedWheelEvent=h.FederatedWheelEvent},79322:function(e,t,r){"use strict";var i=r(17073),n=r(74599),s=r(8599),o=r(14235);i.extensions.add(s.EventSystem),n.Container.mixin(o.FederatedContainer)},17073:function(e,t){"use strict";var r=(e=>(e.Application="application",e.WebGLPipes="webgl-pipes",e.WebGLPipesAdaptor="webgl-pipes-adaptor",e.WebGLSystem="webgl-system",e.WebGPUPipes="webgpu-pipes",e.WebGPUPipesAdaptor="webgpu-pipes-adaptor",e.WebGPUSystem="webgpu-system",e.CanvasSystem="canvas-system",e.CanvasPipesAdaptor="canvas-pipes-adaptor",e.CanvasPipes="canvas-pipes",e.Asset="asset",e.LoadParser="load-parser",e.ResolveParser="resolve-parser",e.CacheParser="cache-parser",e.DetectionParser="detection-parser",e.MaskEffect="mask-effect",e.BlendMode="blend-mode",e.TextureSource="texture-source",e.Environment="environment",e.ShapeBuilder="shape-builder",e.Batcher="batcher",e))(r||{});const i=e=>{if("function"==typeof e||"object"==typeof e&&e.extension){if(!e.extension)throw new Error("Extension class must have an extension object");e={..."object"!=typeof e.extension?{type:e.extension}:e.extension,ref:e}}if("object"!=typeof e)throw new Error("Invalid extension type");return"string"==typeof(e={...e}).type&&(e.type=[e.type]),e},n=(e,t)=>i(e).priority??t,s={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(i).forEach((e=>{e.type.forEach((t=>this._removeHandlers[t]?.(e)))})),this},add(...e){return e.map(i).forEach((e=>{e.type.forEach((t=>{const r=this._addHandlers,i=this._queue;r[t]?r[t]?.(e):(i[t]=i[t]||[],i[t]?.push(e))}))})),this},handle(e,t,r){const i=this._addHandlers,n=this._removeHandlers;if(i[e]||n[e])throw new Error(`Extension type ${e} already has a handler`);i[e]=t,n[e]=r;const s=this._queue;return s[e]&&(s[e]?.forEach((e=>t(e))),delete s[e]),this},handleByMap(e,t){return this.handle(e,(e=>{e.name&&(t[e.name]=e.ref)}),(e=>{e.name&&delete t[e.name]}))},handleByNamedList(e,t,r=-1){return this.handle(e,(e=>{t.findIndex((t=>t.name===e.name))>=0||(t.push({name:e.name,value:e.ref}),t.sort(((e,t)=>n(t.value,r)-n(e.value,r))))}),(e=>{const r=t.findIndex((t=>t.name===e.name));-1!==r&&t.splice(r,1)}))},handleByList(e,t,r=-1){return this.handle(e,(e=>{t.includes(e.ref)||(t.push(e.ref),t.sort(((e,t)=>n(t,r)-n(e,r))))}),(e=>{const r=t.indexOf(e.ref);-1!==r&&t.splice(r,1)}))}};t.ExtensionType=r,t.extensions=s,t.normalizeExtensionPriority=n},46569:function(e,t,r){"use strict";var i=r(17073);t.ExtensionType=i.ExtensionType,t.extensions=i.extensions,t.normalizeExtensionPriority=i.normalizeExtensionPriority},44023:function(e,t,r){"use strict";var i=r(62991),n=r(50543),s=r(97505),o=r(55141);const a=class e extends s.Shader{constructor(t){super(t={...e.defaultOptions,...t}),this.enabled=!0,this._state=o.State.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,"boolean"==typeof t.antialias?this.antialias=t.antialias?"on":"off":this.antialias=t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.addResource("uTexture",0,1)}apply(e,t,r,i){e.applyFilter(this,t,r,i)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(t){const{gpu:r,gl:s,...o}=t;let a,l;return r&&(a=n.GpuProgram.from(r)),s&&(l=i.GlProgram.from(s)),new e({gpuProgram:a,glProgram:l,...o})}};a.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1};let l=a;t.Filter=l},71210:function(e,t){"use strict";t.FilterEffect=class{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let e=0;e"},uInputPixel:{value:new Float32Array(4),type:"vec4"},uInputClamp:{value:new Float32Array(4),type:"vec4"},uOutputFrame:{value:new Float32Array(4),type:"vec4"},uGlobalFrame:{value:new Float32Array(4),type:"vec4"},uOutputTexture:{value:new Float32Array(4),type:"vec4"}}),this._globalFilterBindGroup=new o.BindGroup({}),this.renderer=e}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){const t=this.renderer,r=e.filterEffect.filters;this._filterStack[this._filterStackIndex]||(this._filterStack[this._filterStackIndex]=this._getFilterData());const i=this._filterStack[this._filterStackIndex];if(this._filterStackIndex++,0===r.length)return void(i.skip=!0);const n=i.bounds;e.renderables?f.getGlobalRenderableBounds(e.renderables,n):e.filterEffect.filterArea?(n.clear(),n.addRect(e.filterEffect.filterArea),n.applyMatrix(e.container.worldTransform)):p.getFastGlobalBounds(e.container,n);const s=t.renderTarget.renderTarget.colorTexture.source;let o=1/0,a=0,l=!0,u=!1,c=!1;for(let e=0;e0?this._filterStack[this._filterStackIndex-1].bounds:null,s=e.renderTarget.getRenderTarget(t.previousRenderSurface);n=this.getBackTexture(s,i,r)}t.backTexture=n;const s=t.filterEffect.filters;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(n.source,3),e.globalUniforms.pop(),1===s.length)s[0].apply(this,r,t.previousRenderSurface,!1),h.TexturePool.returnTexture(r);else{let e=t.inputTexture,r=h.TexturePool.getOptimalTexture(i.width,i.height,e.source._resolution,!1),n=0;for(n=0;n0&&this._filterStack[p].skip;)--p;p>0&&(d=this._filterStack[p].inputTexture.source._resolution);const f=this._filterGlobalUniforms,m=f.uniforms,_=m.uOutputFrame,x=m.uInputSize,b=m.uInputPixel,v=m.uInputClamp,y=m.uGlobalFrame,T=m.uOutputTexture;if(h){let e=this._filterStackIndex;for(;e>0;){e--;const t=this._filterStack[this._filterStackIndex-1];if(!t.skip){l.x=t.bounds.minX,l.y=t.bounds.minY;break}}_[0]=a.minX-l.x,_[1]=a.minY-l.y}else _[0]=0,_[1]=0;_[2]=t.frame.width,_[3]=t.frame.height,x[0]=t.source.width,x[1]=t.source.height,x[2]=1/x[0],x[3]=1/x[1],b[0]=t.source.pixelWidth,b[1]=t.source.pixelHeight,b[2]=1/b[0],b[3]=1/b[1],v[0]=.5*b[2],v[1]=.5*b[3],v[2]=t.frame.width*x[2]-.5*b[2],v[3]=t.frame.height*x[3]-.5*b[3];const S=this.renderer.renderTarget.rootRenderTarget.colorTexture;y[0]=l.x*d,y[1]=l.y*d,y[2]=S.source.width*d,y[3]=S.source.height*d;const E=this.renderer.renderTarget.getRenderTarget(r);if(n.renderTarget.bind(r,!!i),r instanceof u.Texture?(T[0]=r.frame.width,T[1]=r.frame.height):(T[0]=E.width,T[1]=E.height),T[2]=E.isRoot?-1:1,f.update(),n.renderPipes.uniformBatch){const e=n.renderPipes.uniformBatch.getUboResource(f);this._globalFilterBindGroup.setResource(e,0)}else this._globalFilterBindGroup.setResource(f,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,n.encoder.draw({geometry:g,shader:e,state:e._state,topology:"triangle-list"}),n.type===c.RendererType.WEBGL&&n.renderTarget.finishRenderPass()}_getFilterData(){return{skip:!1,inputTexture:null,bounds:new d.Bounds,container:null,filterEffect:null,blendRequired:!1,previousRenderSurface:null}}calculateSpriteMatrix(e,t){const r=this._activeFilterData,i=e.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),s=t.worldTransform.copyTo(n.Matrix.shared);return s.invert(),i.prepend(s),i.scale(1/t.texture.frame.width,1/t.texture.frame.height),i.translate(t.anchor.x,t.anchor.y),i}}_.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem],name:"filter"},t.FilterSystem=_},81210:function(e,t,r){"use strict";var i=r(62991),n=r(50543),s=r(65518),o=r(84463),a=r(44023),l=r(70475),u=r(40265),h=r(53784);class c extends a.Filter{constructor(e){const t=e.gpu,r=d({source:h.default,...t}),a=n.GpuProgram.from({vertex:{source:r,entryPoint:"mainVertex"},fragment:{source:r,entryPoint:"mainFragment"}}),c=e.gl,p=d({source:l.default,...c});super({gpuProgram:a,glProgram:i.GlProgram.from({vertex:u.default,fragment:p}),blendRequired:!0,resources:{blendUniforms:new s.UniformGroup({uBlend:{value:1,type:"f32"}}),uBackTexture:o.Texture.EMPTY}})}}function d(e){const{source:t,functions:r,main:i}=e;return t.replace("{FUNCTIONS}",r).replace("{MAIN}",i)}t.BlendModeFilter=c},70475:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="\r\nin vec2 vTextureCoord;\r\nin vec4 vColor;\r\n\r\nout vec4 finalColor;\r\n\r\nuniform float uBlend;\r\n\r\nuniform sampler2D uTexture;\r\nuniform sampler2D uBackTexture;\r\n\r\n{FUNCTIONS}\r\n\r\nvoid main()\r\n{ \r\n vec4 back = texture(uBackTexture, vTextureCoord);\r\n vec4 front = texture(uTexture, vTextureCoord);\r\n float blendedAlpha = front.a + back.a * (1.0 - front.a);\r\n \r\n {MAIN}\r\n}\r\n"},40265:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="in vec2 aPosition;\r\nout vec2 vTextureCoord;\r\nout vec2 backgroundUv;\r\n\r\nuniform vec4 uInputSize;\r\nuniform vec4 uOutputFrame;\r\nuniform vec4 uOutputTexture;\r\n\r\nvec4 filterVertexPosition( void )\r\n{\r\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\r\n \r\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\r\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\r\n\r\n return vec4(position, 0.0, 1.0);\r\n}\r\n\r\nvec2 filterTextureCoord( void )\r\n{\r\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\r\n}\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = filterVertexPosition();\r\n vTextureCoord = filterTextureCoord();\r\n}\r\n"},53784:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="\r\nstruct GlobalFilterUniforms {\r\n uInputSize:vec4,\r\n uInputPixel:vec4,\r\n uInputClamp:vec4,\r\n uOutputFrame:vec4,\r\n uGlobalFrame:vec4,\r\n uOutputTexture:vec4,\r\n};\r\n\r\nstruct BlendUniforms {\r\n uBlend:f32,\r\n};\r\n\r\n@group(0) @binding(0) var gfu: GlobalFilterUniforms;\r\n@group(0) @binding(1) var uTexture: texture_2d;\r\n@group(0) @binding(2) var uSampler : sampler;\r\n@group(0) @binding(3) var uBackTexture: texture_2d;\r\n\r\n@group(1) @binding(0) var blendUniforms : BlendUniforms;\r\n\r\n\r\nstruct VSOutput {\r\n @builtin(position) position: vec4,\r\n @location(0) uv : vec2\r\n };\r\n\r\nfn filterVertexPosition(aPosition:vec2) -> vec4\r\n{\r\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\r\n\r\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\r\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\r\n\r\n return vec4(position, 0.0, 1.0);\r\n}\r\n\r\nfn filterTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\r\n}\r\n\r\nfn globalTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \r\n}\r\n \r\n@vertex\r\nfn mainVertex(\r\n @location(0) aPosition : vec2, \r\n) -> VSOutput {\r\n return VSOutput(\r\n filterVertexPosition(aPosition),\r\n filterTextureCoord(aPosition)\r\n );\r\n}\r\n\r\n{FUNCTIONS}\r\n\r\n@fragment\r\nfn mainFragment(\r\n @location(0) uv: vec2\r\n) -> @location(0) vec4 {\r\n\r\n\r\n var back = textureSample(uBackTexture, uSampler, uv);\r\n var front = textureSample(uTexture, uSampler, uv);\r\n var blendedAlpha = front.a + back.a * (1.0 - front.a);\r\n \r\n var out = vec4(0.0,0.0,0.0,0.0);\r\n\r\n {MAIN}\r\n\r\n return out;\r\n}"},57422:function(e,t){"use strict";t.hslgl="\n\tfloat getLuminosity(vec3 c) {\n\t\treturn 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;\n\t}\n\n\tvec3 setLuminosity(vec3 c, float lum) {\n\t\tfloat modLum = lum - getLuminosity(c);\n\t\tvec3 color = c.rgb + vec3(modLum);\n\n\t\t// clip back into legal range\n\t\tmodLum = getLuminosity(color);\n\t\tvec3 modLumVec = vec3(modLum);\n\n\t\tfloat cMin = min(color.r, min(color.g, color.b));\n\t\tfloat cMax = max(color.r, max(color.g, color.b));\n\n\t\tif(cMin < 0.0) {\n\t\t\tcolor = mix(modLumVec, color, modLum / (modLum - cMin));\n\t\t}\n\n\t\tif(cMax > 1.0) {\n\t\t\tcolor = mix(modLumVec, color, (1.0 - modLum) / (cMax - modLum));\n\t\t}\n\n\t\treturn color;\n\t}\n\n\tfloat getSaturation(vec3 c) {\n\t\treturn max(c.r, max(c.g, c.b)) - min(c.r, min(c.g, c.b));\n\t}\n\n\tvec3 setSaturationMinMidMax(vec3 cSorted, float s) {\n\t\tvec3 colorSorted = cSorted;\n\n\t\tif(colorSorted.z > colorSorted.x) {\n\t\t\tcolorSorted.y = (((colorSorted.y - colorSorted.x) * s) / (colorSorted.z - colorSorted.x));\n\t\t\tcolorSorted.z = s;\n\t\t}\n\t\telse {\n\t\t\tcolorSorted.y = 0.0;\n\t\t\tcolorSorted.z = 0.0;\n\t\t}\n\n\t\tcolorSorted.x = 0.0;\n\n\t\treturn colorSorted;\n\t}\n\n\tvec3 setSaturation(vec3 c, float s) {\n\t\tvec3 color = c;\n\n\t\tif(color.r <= color.g && color.r <= color.b) {\n\t\t\tif(color.g <= color.b) {\n\t\t\t\tcolor = setSaturationMinMidMax(color.rgb, s).rgb;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcolor = setSaturationMinMidMax(color.rbg, s).rbg;\n\t\t\t}\n\t\t}\n\t\telse if(color.g <= color.r && color.g <= color.b) {\n\t\t\tif(color.r <= color.b) {\n\t\t\t\tcolor = setSaturationMinMidMax(color.grb, s).grb;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcolor = setSaturationMinMidMax(color.gbr, s).gbr;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Using bgr for both fixes part of hue\n\t\t\tif(color.r <= color.g) {\n\t\t\t\tcolor = setSaturationMinMidMax(color.brg, s).brg;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcolor = setSaturationMinMidMax(color.bgr, s).bgr;\n\t\t\t}\n\t\t}\n\n\t\treturn color;\n\t}\n "},79474:function(e,t){"use strict";t.hslgpu="\n\tfn getLuminosity(c: vec3) -> f32\n\t{\n\t\treturn 0.3*c.r + 0.59*c.g + 0.11*c.b;\n\t}\n\n\tfn setLuminosity(c: vec3, lum: f32) -> vec3\n\t{\n\t\tvar modLum: f32 = lum - getLuminosity(c);\n\t\tvar color: vec3 = c.rgb + modLum;\n\n\t\t// clip back into legal range\n\t\tmodLum = getLuminosity(color);\n\t\tlet modLumVec = vec3(modLum);\n\n\t\tlet cMin: f32 = min(color.r, min(color.g, color.b));\n\t\tlet cMax: f32 = max(color.r, max(color.g, color.b));\n\n\t\tif(cMin < 0.0)\n\t\t{\n\t\t\tcolor = mix(modLumVec, color, modLum / (modLum - cMin));\n\t\t}\n\n\t\tif(cMax > 1.0)\n\t\t{\n\t\t\tcolor = mix(modLumVec, color, (1 - modLum) / (cMax - modLum));\n\t\t}\n\n\t\treturn color;\n\t}\n\n\tfn getSaturation(c: vec3) -> f32\n\t{\n\t\treturn max(c.r, max(c.g, c.b)) - min(c.r, min(c.g, c.b));\n\t}\n\n\tfn setSaturationMinMidMax(cSorted: vec3, s: f32) -> vec3\n\t{\n\t\tvar colorSorted = cSorted;\n\n\t\tif(colorSorted.z > colorSorted.x)\n\t\t{\n\t\t\tcolorSorted.y = (((colorSorted.y - colorSorted.x) * s) / (colorSorted.z - colorSorted.x));\n\t\t\tcolorSorted.z = s;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcolorSorted.y = 0;\n\t\t\tcolorSorted.z = 0;\n\t\t}\n\n\t\tcolorSorted.x = 0;\n\n\t\treturn colorSorted;\n\t}\n\n\tfn setSaturation(c: vec3, s: f32) -> vec3\n\t{\n\t\tvar color = c;\n\n\t\tif (color.r <= color.g && color.r <= color.b)\n\t\t{\n\t\t\tif (color.g <= color.b)\n\t\t\t{\n\t\t\t\tcolor = vec3(setSaturationMinMidMax(color.rgb, s)).rgb;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcolor = vec3(setSaturationMinMidMax(color.rbg, s)).rbg;\n\t\t\t}\n\t\t}\n\t\telse if (color.g <= color.r && color.g <= color.b)\n\t\t{\n\t\t\tif (color.r <= color.b)\n\t\t\t{\n\t\t\t\tcolor = vec3(setSaturationMinMidMax(color.grb, s)).grb;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcolor = vec3(setSaturationMinMidMax(color.gbr, s)).gbr;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Using bgr for both fixes part of hue\n\t\t\tif (color.r <= color.g)\n\t\t\t{\n\t\t\t\tcolor = vec3(setSaturationMinMidMax(color.brg, s)).brg;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcolor = vec3(setSaturationMinMidMax(color.bgr, s)).bgr;\n\t\t\t}\n\t\t}\n\n\t\treturn color;\n\t}\n\t"},26508:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="fn getLuminosity(c: vec3) -> f32 {\r\n return 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;\r\n}\r\n\r\nfn setLuminosity(c: vec3, lum: f32) -> vec3 {\r\n let d: f32 = lum - getLuminosity(c);\r\n let newColor: vec3 = c.rgb + vec3(d, d, d);\r\n\r\n // clip back into legal range\r\n let newLum: f32 = getLuminosity(newColor);\r\n let cMin: f32 = min(newColor.r, min(newColor.g, newColor.b));\r\n let cMax: f32 = max(newColor.r, max(newColor.g, newColor.b));\r\n\r\n let t1: f32 = newLum / (newLum - cMin);\r\n let t2: f32 = (1.0 - newLum) / (cMax - newLum);\r\n\r\n let finalColor = mix(vec3(newLum, newLum, newLum), newColor, select(select(1.0, t2, cMax > 1.0), t1, cMin < 0.0));\r\n\r\n return finalColor;\r\n}\r\n\r\nfn getSaturation(c: vec3) -> f32 {\r\n return max(c.r, max(c.g, c.b)) - min(c.r, min(c.g, c.b));\r\n}\r\n\r\n// Set saturation if color components are sorted in ascending order.\r\nfn setSaturationMinMidMax(cSorted: vec3, s: f32) -> vec3 {\r\n var result: vec3;\r\n if (cSorted.z > cSorted.x) {\r\n let newY = (((cSorted.y - cSorted.x) * s) / (cSorted.z - cSorted.x));\r\n result = vec3(0.0, newY, s);\r\n } else {\r\n result = vec3(0.0, 0.0, 0.0);\r\n }\r\n return vec3(result.x, result.y, result.z);\r\n}\r\n\r\nfn setSaturation(c: vec3, s: f32) -> vec3 {\r\n var result: vec3 = c;\r\n\r\n if (c.r <= c.g && c.r <= c.b) {\r\n if (c.g <= c.b) {\r\n result = setSaturationMinMidMax(result, s);\r\n } else {\r\n var temp: vec3 = vec3(result.r, result.b, result.g);\r\n temp = setSaturationMinMidMax(temp, s);\r\n result = vec3(temp.r, temp.b, temp.g);\r\n }\r\n } else if (c.g <= c.r && c.g <= c.b) {\r\n if (c.r <= c.b) {\r\n var temp: vec3 = vec3(result.g, result.r, result.b);\r\n temp = setSaturationMinMidMax(temp, s);\r\n result = vec3(temp.g, temp.r, temp.b);\r\n } else {\r\n var temp: vec3 = vec3(result.g, result.b, result.r);\r\n temp = setSaturationMinMidMax(temp, s);\r\n result = vec3(temp.g, temp.b, temp.r);\r\n }\r\n } else {\r\n if (c.r <= c.g) {\r\n var temp: vec3 = vec3(result.b, result.r, result.g);\r\n temp = setSaturationMinMidMax(temp, s);\r\n result = vec3(temp.b, temp.r, temp.g);\r\n } else {\r\n var temp: vec3 = vec3(result.b, result.g, result.r);\r\n temp = setSaturationMinMidMax(temp, s);\r\n result = vec3(temp.b, temp.g, temp.r);\r\n }\r\n }\r\n\r\n return result;\r\n}"},77047:function(e,t,r){"use strict";var i=r(62991),n=r(50543),s=r(65518),o=r(44023),a=r(41792),l=r(85860),u=r(90588);const h=class e extends o.Filter{constructor(t){t={...e.defaultOptions,...t};const r=n.GpuProgram.from({vertex:{source:u.default,entryPoint:"mainVertex"},fragment:{source:u.default,entryPoint:"mainFragment"}}),o=i.GlProgram.from({vertex:a.default,fragment:l.default,name:"alpha-filter"}),{alpha:h,...c}=t;super({...c,gpuProgram:r,glProgram:o,resources:{alphaUniforms:new s.UniformGroup({uAlpha:{value:h,type:"f32"}})}})}get alpha(){return this.resources.alphaUniforms.uniforms.uAlpha}set alpha(e){this.resources.alphaUniforms.uniforms.uAlpha=e}};h.defaultOptions={alpha:1};let c=h;t.AlphaFilter=c},85860:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="\r\nin vec2 vTextureCoord;\r\n\r\nout vec4 finalColor;\r\n\r\nuniform float uAlpha;\r\nuniform sampler2D uTexture;\r\n\r\nvoid main()\r\n{\r\n finalColor = texture(uTexture, vTextureCoord) * uAlpha;\r\n}\r\n"},90588:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="struct GlobalFilterUniforms {\r\n uInputSize:vec4,\r\n uInputPixel:vec4,\r\n uInputClamp:vec4,\r\n uOutputFrame:vec4,\r\n uGlobalFrame:vec4,\r\n uOutputTexture:vec4,\r\n};\r\n\r\nstruct AlphaUniforms {\r\n uAlpha:f32,\r\n};\r\n\r\n@group(0) @binding(0) var gfu: GlobalFilterUniforms;\r\n@group(0) @binding(1) var uTexture: texture_2d;\r\n@group(0) @binding(2) var uSampler : sampler;\r\n\r\n@group(1) @binding(0) var alphaUniforms : AlphaUniforms;\r\n\r\nstruct VSOutput {\r\n @builtin(position) position: vec4,\r\n @location(0) uv : vec2\r\n };\r\n\r\nfn filterVertexPosition(aPosition:vec2) -> vec4\r\n{\r\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\r\n\r\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\r\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\r\n\r\n return vec4(position, 0.0, 1.0);\r\n}\r\n\r\nfn filterTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\r\n}\r\n\r\nfn globalTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \r\n}\r\n\r\nfn getSize() -> vec2\r\n{\r\n return gfu.uGlobalFrame.zw;\r\n}\r\n \r\n@vertex\r\nfn mainVertex(\r\n @location(0) aPosition : vec2, \r\n) -> VSOutput {\r\n return VSOutput(\r\n filterVertexPosition(aPosition),\r\n filterTextureCoord(aPosition)\r\n );\r\n}\r\n\r\n@fragment\r\nfn mainFragment(\r\n @location(0) uv: vec2,\r\n @builtin(position) position: vec4\r\n) -> @location(0) vec4 {\r\n \r\n var sample = textureSample(uTexture, uSampler, uv);\r\n \r\n return sample * alphaUniforms.uAlpha;\r\n}"},82510:function(e,t,r){"use strict";var i=r(38759),n=r(2559),s=r(60094),o=r(44023),a=r(27657);class l extends o.Filter{constructor(...e){let t=e[0]??{};"number"==typeof t&&(s.deprecation(s.v8_0_0,"BlurFilter constructor params are now options object. See params: { strength, quality, resolution, kernelSize }"),t={strength:t},void 0!==e[1]&&(t.quality=e[1]),void 0!==e[2]&&(t.resolution=e[2]||"inherit"),void 0!==e[3]&&(t.kernelSize=e[3])),t={...a.BlurFilterPass.defaultOptions,...t};const{strength:r,strengthX:i,strengthY:o,quality:l,...u}=t;super({...u,compatibleRenderers:n.RendererType.BOTH,resources:{}}),this._repeatEdgePixels=!1,this.blurXFilter=new a.BlurFilterPass({horizontal:!0,...t}),this.blurYFilter=new a.BlurFilterPass({horizontal:!1,...t}),this.quality=l,this.strengthX=i??r,this.strengthY=o??r,this.repeatEdgePixels=!1}apply(e,t,r,n){const s=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(s&&o){const s=i.TexturePool.getSameSizeTexture(t);this.blurXFilter.blendMode="normal",this.blurXFilter.apply(e,t,s,!0),this.blurYFilter.blendMode=this.blendMode,this.blurYFilter.apply(e,s,r,n),i.TexturePool.returnTexture(s)}else o?(this.blurYFilter.blendMode=this.blendMode,this.blurYFilter.apply(e,t,r,n)):(this.blurXFilter.blendMode=this.blendMode,this.blurXFilter.apply(e,t,r,n))}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.blur),Math.abs(this.blurYFilter.blur))}get strength(){if(this.strengthX!==this.strengthY)throw new Error("BlurFilter's strengthX and strengthY are different");return this.strengthX}set strength(e){this.blurXFilter.blur=this.blurYFilter.blur=e,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(e){this.blurXFilter.quality=this.blurYFilter.quality=e}get strengthX(){return this.blurXFilter.blur}set strengthX(e){this.blurXFilter.blur=e,this.updatePadding()}get strengthY(){return this.blurYFilter.blur}set strengthY(e){this.blurYFilter.blur=e,this.updatePadding()}get blur(){return s.deprecation("8.3.0","BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),this.strength}set blur(e){s.deprecation("8.3.0","BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),this.strength=e}get blurX(){return s.deprecation("8.3.0","BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),this.strengthX}set blurX(e){s.deprecation("8.3.0","BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),this.strengthX=e}get blurY(){return s.deprecation("8.3.0","BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),this.strengthY}set blurY(e){s.deprecation("8.3.0","BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),this.strengthY=e}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(e){this._repeatEdgePixels=e,this.updatePadding()}}l.defaultOptions={strength:8,quality:4,kernelSize:5},t.BlurFilter=l},27657:function(e,t,r){"use strict";var i=r(38759),n=r(2559),s=r(44023),o=r(713),a=r(3824);const l=class e extends s.Filter{constructor(t){t={...e.defaultOptions,...t};super({glProgram:o.generateBlurGlProgram(t.horizontal,t.kernelSize),gpuProgram:a.generateBlurProgram(t.horizontal,t.kernelSize),resources:{blurUniforms:{uStrength:{value:0,type:"f32"}}},...t}),this.horizontal=t.horizontal,this._quality=0,this.quality=t.quality,this.blur=t.strength,this._uniforms=this.resources.blurUniforms.uniforms}apply(e,t,r,s){if(this._uniforms.uStrength=this.strength/this.passes,1===this.passes)e.applyFilter(this,t,r,s);else{const o=i.TexturePool.getSameSizeTexture(t);let a=t,l=o;this._state.blend=!1;const u=e.renderer.type===n.RendererType.WEBGPU;for(let t=0;t=r&&(s=e-i-1),n=n.replace("%value%",t[s].toString()),a+=n,a+="\n"}return o=o.replace("%blur%",a),o=o.replace("%size%",e.toString()),o}},713:function(e,t,r){"use strict";var i=r(62991),n=r(29028),s=r(40806);t.generateBlurGlProgram=function(e,t){const r=s.generateBlurVertSource(t,e),o=n.generateBlurFragSource(t);return i.GlProgram.from({vertex:r,fragment:o,name:`blur-${e?"horizontal":"vertical"}-pass-filter`})}},40806:function(e,t){"use strict";t.generateBlurVertSource=function(e,t){const r=Math.ceil(e/2);let i,n="\n in vec2 aPosition;\n\n uniform float uStrength;\n\n out vec2 vBlurTexCoords[%size%];\n\n uniform vec4 uInputSize;\n uniform vec4 uOutputFrame;\n uniform vec4 uOutputTexture;\n\n vec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\n vec2 filterTextureCoord( void )\n {\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n float pixelStrength = uInputSize.%dimension% * uStrength;\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }",s="";i=t?"vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * pixelStrength, 0.0);":"vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * pixelStrength);";for(let t=0;t,`,l[i]=e?`filteredCord + vec2(${i-o+1} * pixelStrength, 0.0),`:`filteredCord + vec2(0.0, ${i-o+1} * pixelStrength),`;const n=r[i"},uScale:{value:m,type:"vec2"},uRotation:{value:new Float32Array([0,0,0,0]),type:"mat2x2"}}),_=s.GlProgram.from({vertex:d.default,fragment:c.default,name:"displacement-filter"}),x=o.GpuProgram.from({vertex:{source:p.default,entryPoint:"mainVertex"},fragment:{source:p.default,entryPoint:"mainFragment"}}),b=r.texture.source;super({...f,gpuProgram:x,glProgram:_,resources:{filterUniforms:g,uMapTexture:b,uMapSampler:b.style}}),this._sprite=t.sprite,this._sprite.renderable=!1}apply(e,t,r,i){const n=this.resources.filterUniforms.uniforms;e.calculateSpriteMatrix(n.uFilterMatrix,this._sprite);const s=this._sprite.worldTransform,o=Math.sqrt(s.a*s.a+s.b*s.b),a=Math.sqrt(s.c*s.c+s.d*s.d);0!==o&&0!==a&&(n.uRotation[0]=s.a/o,n.uRotation[1]=s.b/o,n.uRotation[2]=s.c/a,n.uRotation[3]=s.d/a),this.resources.uMapTexture=this._sprite.texture.source,e.applyFilter(this,t,r,i)}get scale(){return this.resources.filterUniforms.uniforms.uScale}}t.DisplacementFilter=f},85001:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="\r\nin vec2 vTextureCoord;\r\nin vec2 vFilterUv;\r\n\r\nout vec4 finalColor;\r\n\r\nuniform sampler2D uTexture;\r\nuniform sampler2D uMapTexture;\r\n\r\nuniform vec4 uInputClamp;\r\nuniform highp vec4 uInputSize;\r\nuniform mat2 uRotation;\r\nuniform vec2 uScale;\r\n\r\nvoid main()\r\n{\r\n vec4 map = texture(uMapTexture, vFilterUv);\r\n \r\n vec2 offset = uInputSize.zw * (uRotation * (map.xy - 0.5)) * uScale; \r\n\r\n finalColor = texture(uTexture, clamp(vTextureCoord + offset, uInputClamp.xy, uInputClamp.zw));\r\n}\r\n"},33610:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="in vec2 aPosition;\r\nout vec2 vTextureCoord;\r\nout vec2 vFilterUv;\r\n\r\n\r\nuniform vec4 uInputSize;\r\nuniform vec4 uOutputFrame;\r\nuniform vec4 uOutputTexture;\r\n\r\nuniform mat3 uFilterMatrix;\r\n\r\nvec4 filterVertexPosition( void )\r\n{\r\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\r\n \r\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\r\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\r\n\r\n return vec4(position, 0.0, 1.0);\r\n}\r\n\r\nvec2 filterTextureCoord( void )\r\n{\r\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\r\n}\r\n\r\nvec2 getFilterCoord( void )\r\n{\r\n return ( uFilterMatrix * vec3( filterTextureCoord(), 1.0) ).xy;\r\n}\r\n\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = filterVertexPosition();\r\n vTextureCoord = filterTextureCoord();\r\n vFilterUv = getFilterCoord();\r\n}\r\n"},25044:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="\r\nstruct GlobalFilterUniforms {\r\n uInputSize:vec4,\r\n uInputPixel:vec4,\r\n uInputClamp:vec4,\r\n uOutputFrame:vec4,\r\n uGlobalFrame:vec4,\r\n uOutputTexture:vec4,\r\n};\r\n\r\nstruct DisplacementUniforms {\r\n uFilterMatrix:mat3x3,\r\n uScale:vec2,\r\n uRotation:mat2x2\r\n};\r\n\r\n\r\n\r\n@group(0) @binding(0) var gfu: GlobalFilterUniforms;\r\n@group(0) @binding(1) var uTexture: texture_2d;\r\n@group(0) @binding(2) var uSampler : sampler;\r\n\r\n@group(1) @binding(0) var filterUniforms : DisplacementUniforms;\r\n@group(1) @binding(1) var uMapTexture: texture_2d;\r\n@group(1) @binding(2) var uMapSampler : sampler;\r\n\r\nstruct VSOutput {\r\n @builtin(position) position: vec4,\r\n @location(0) uv : vec2,\r\n @location(1) filterUv : vec2,\r\n };\r\n\r\nfn filterVertexPosition(aPosition:vec2) -> vec4\r\n{\r\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\r\n\r\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\r\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\r\n\r\n return vec4(position, 0.0, 1.0);\r\n}\r\n\r\nfn filterTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\r\n}\r\n\r\nfn globalTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \r\n}\r\n\r\nfn getFilterCoord(aPosition:vec2 ) -> vec2\r\n{\r\n return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\r\n}\r\n\r\nfn getSize() -> vec2\r\n{\r\n\r\n \r\n return gfu.uGlobalFrame.zw;\r\n}\r\n \r\n@vertex\r\nfn mainVertex(\r\n @location(0) aPosition : vec2, \r\n) -> VSOutput {\r\n return VSOutput(\r\n filterVertexPosition(aPosition),\r\n filterTextureCoord(aPosition),\r\n getFilterCoord(aPosition)\r\n );\r\n}\r\n\r\n@fragment\r\nfn mainFragment(\r\n @location(0) uv: vec2,\r\n @location(1) filterUv: vec2,\r\n @builtin(position) position: vec4\r\n) -> @location(0) vec4 {\r\n\r\n var map = textureSample(uMapTexture, uMapSampler, filterUv);\r\n\r\n var offset = gfu.uInputSize.zw * (filterUniforms.uRotation * (map.xy - 0.5)) * filterUniforms.uScale; \r\n \r\n return textureSample(uTexture, uSampler, clamp(uv + offset, gfu.uInputClamp.xy, gfu.uInputClamp.zw));\r\n}"},95547:function(e,t,r){"use strict";var i=r(62991),n=r(50543),s=r(65518),o=r(44023),a=r(41792),l=r(25999),u=r(24310);const h=class e extends o.Filter{constructor(t={}){t={...e.defaultOptions,...t};const r=n.GpuProgram.from({vertex:{source:u.default,entryPoint:"mainVertex"},fragment:{source:u.default,entryPoint:"mainFragment"}}),o=i.GlProgram.from({vertex:a.default,fragment:l.default,name:"noise-filter"}),{noise:h,seed:c,...d}=t;super({...d,gpuProgram:r,glProgram:o,resources:{noiseUniforms:new s.UniformGroup({uNoise:{value:1,type:"f32"},uSeed:{value:1,type:"f32"}})}}),this.noise=h,this.seed=c??Math.random()}get noise(){return this.resources.noiseUniforms.uniforms.uNoise}set noise(e){this.resources.noiseUniforms.uniforms.uNoise=e}get seed(){return this.resources.noiseUniforms.uniforms.uSeed}set seed(e){this.resources.noiseUniforms.uniforms.uSeed=e}};h.defaultOptions={noise:.5};let c=h;t.NoiseFilter=c},25999:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="\r\nin vec2 vTextureCoord;\r\nin vec4 vColor;\r\n\r\nout vec4 finalColor;\r\n\r\nuniform float uNoise;\r\nuniform float uSeed;\r\nuniform sampler2D uTexture;\r\n\r\nfloat rand(vec2 co)\r\n{\r\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\r\n}\r\n\r\nvoid main()\r\n{\r\n vec4 color = texture(uTexture, vTextureCoord);\r\n float randomValue = rand(gl_FragCoord.xy * uSeed);\r\n float diff = (randomValue - 0.5) * uNoise;\r\n\r\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\r\n if (color.a > 0.0) {\r\n color.rgb /= color.a;\r\n }\r\n\r\n color.r += diff;\r\n color.g += diff;\r\n color.b += diff;\r\n\r\n // Premultiply alpha again.\r\n color.rgb *= color.a;\r\n\r\n finalColor = color;\r\n}\r\n"},24310:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="\r\n\r\nstruct GlobalFilterUniforms {\r\n uInputSize:vec4,\r\n uInputPixel:vec4,\r\n uInputClamp:vec4,\r\n uOutputFrame:vec4,\r\n uGlobalFrame:vec4,\r\n uOutputTexture:vec4,\r\n};\r\n\r\nstruct NoiseUniforms {\r\n uNoise:f32,\r\n uSeed:f32,\r\n};\r\n\r\n@group(0) @binding(0) var gfu: GlobalFilterUniforms;\r\n@group(0) @binding(1) var uTexture: texture_2d;\r\n@group(0) @binding(2) var uSampler : sampler;\r\n\r\n@group(1) @binding(0) var noiseUniforms : NoiseUniforms;\r\n\r\nstruct VSOutput {\r\n @builtin(position) position: vec4,\r\n @location(0) uv : vec2\r\n };\r\n\r\nfn filterVertexPosition(aPosition:vec2) -> vec4\r\n{\r\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\r\n\r\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\r\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\r\n\r\n return vec4(position, 0.0, 1.0);\r\n}\r\n\r\nfn filterTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\r\n}\r\n\r\nfn globalTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \r\n}\r\n\r\nfn getSize() -> vec2\r\n{\r\n return gfu.uGlobalFrame.zw;\r\n}\r\n \r\n@vertex\r\nfn mainVertex(\r\n @location(0) aPosition : vec2, \r\n) -> VSOutput {\r\n return VSOutput(\r\n filterVertexPosition(aPosition),\r\n filterTextureCoord(aPosition)\r\n );\r\n}\r\n\r\nfn rand(co:vec2) -> f32\r\n{\r\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\r\n}\r\n\r\n\r\n\r\n@fragment\r\nfn mainFragment(\r\n @location(0) uv: vec2,\r\n @builtin(position) position: vec4\r\n) -> @location(0) vec4 {\r\n\r\n var pixelPosition = globalTextureCoord(position.xy);// / (getSize());//- gfu.uOutputFrame.xy);\r\n \r\n \r\n var sample = textureSample(uTexture, uSampler, uv);\r\n var randomValue = rand(pixelPosition.xy * noiseUniforms.uSeed);\r\n var diff = (randomValue - 0.5) * noiseUniforms.uNoise;\r\n \r\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\r\n if (sample.a > 0.0) {\r\n sample.r /= sample.a;\r\n sample.g /= sample.a;\r\n sample.b /= sample.a;\r\n }\r\n\r\n sample.r += diff;\r\n sample.g += diff;\r\n sample.b += diff;\r\n\r\n // Premultiply alpha again.\r\n sample.r *= sample.a;\r\n sample.g *= sample.a;\r\n sample.b *= sample.a;\r\n \r\n return sample;\r\n}"},33430:function(e,t,r){"use strict";var i=r(81210),n=r(57422),s=r(79474),o=r(77047),a=r(82510),l=r(27657),u=r(58758),h=r(29028),c=r(713),d=r(40806),p=r(3824),f=r(41012),m=r(43795),g=r(95547),_=r(44023),x=r(71210),b=r(85644),v=r(24516),y=r(24745),T=r(70475),S=r(40265),E=r(53784),w=r(26508),A=r(85860),M=r(90588),P=r(6857),R=r(15255),C=r(62494),B=r(41792),G=r(85001),F=r(33610),D=r(25044),I=r(25999),O=r(24310),U=r(20018),k=r(98955),L=r(40059);t.BlendModeFilter=i.BlendModeFilter,t.hslgl=n.hslgl,t.hslgpu=s.hslgpu,t.AlphaFilter=o.AlphaFilter,t.BlurFilter=a.BlurFilter,t.BlurFilterPass=l.BlurFilterPass,t.GAUSSIAN_VALUES=u.GAUSSIAN_VALUES,t.generateBlurFragSource=h.generateBlurFragSource,t.generateBlurGlProgram=c.generateBlurGlProgram,t.generateBlurVertSource=d.generateBlurVertSource,t.generateBlurProgram=p.generateBlurProgram,t.ColorMatrixFilter=f.ColorMatrixFilter,t.DisplacementFilter=m.DisplacementFilter,t.NoiseFilter=g.NoiseFilter,t.Filter=_.Filter,t.FilterEffect=x.FilterEffect,t.FilterPipe=b.FilterPipe,t.FilterSystem=v.FilterSystem,t.MaskFilter=y.MaskFilter,t.blendTemplateFrag=T.default,t.blendTemplateVert=S.default,t.blendTemplateWgsl=E.default,t.hslWgsl=w.default,t.alphaFrag=A.default,t.alphaWgsl=M.default,t.blurTemplateWgsl=P.default,t.colorMatrixFilterFrag=R.default,t.colorMatrixFilterWgsl=C.default,t.defaultFilterVert=B.default,t.displacementFrag=G.default,t.displacementVert=F.default,t.displacementWgsl=D.default,t.noiseFrag=I.default,t.noiseWgsl=O.default,t.maskFrag=U.default,t.maskVert=k.default,t.maskWgsl=L.default},72400:function(e,t,r){"use strict";var i=r(17073),n=r(85644),s=r(24516);i.extensions.add(s.FilterSystem),i.extensions.add(n.FilterPipe)},24745:function(e,t,r){"use strict";var i=r(15685),n=r(62991),s=r(50543),o=r(65518),a=r(94058),l=r(44023),u=r(20018),h=r(98955),c=r(40059);class d extends l.Filter{constructor(e){const{sprite:t,...r}=e,l=new a.TextureMatrix(t.texture),d=new o.UniformGroup({uFilterMatrix:{value:new i.Matrix,type:"mat3x3"},uMaskClamp:{value:l.uClampFrame,type:"vec4"},uAlpha:{value:1,type:"f32"}});super({...r,gpuProgram:s.GpuProgram.from({vertex:{source:c.default,entryPoint:"mainVertex"},fragment:{source:c.default,entryPoint:"mainFragment"}}),glProgram:n.GlProgram.from({vertex:h.default,fragment:u.default,name:"mask-filter"}),resources:{filterUniforms:d,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=l}apply(e,t,r,i){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,r,i)}}t.MaskFilter=d},20018:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="in vec2 vMaskCoord;\r\nin vec2 vTextureCoord;\r\n\r\nuniform sampler2D uTexture;\r\nuniform sampler2D uMaskTexture;\r\n\r\nuniform float uAlpha;\r\nuniform vec4 uMaskClamp;\r\n\r\nout vec4 finalColor;\r\n\r\nvoid main(void)\r\n{\r\n float clip = step(3.5,\r\n step(uMaskClamp.x, vMaskCoord.x) +\r\n step(uMaskClamp.y, vMaskCoord.y) +\r\n step(vMaskCoord.x, uMaskClamp.z) +\r\n step(vMaskCoord.y, uMaskClamp.w));\r\n\r\n // TODO look into why this is needed\r\n float npmAlpha = uAlpha; \r\n vec4 original = texture(uTexture, vTextureCoord);\r\n vec4 masky = texture(uMaskTexture, vMaskCoord);\r\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\r\n\r\n original *= (alphaMul * masky.r * uAlpha * clip);\r\n\r\n finalColor = original;\r\n}\r\n"},98955:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="in vec2 aPosition;\r\n\r\nout vec2 vTextureCoord;\r\nout vec2 vMaskCoord;\r\n\r\n\r\nuniform vec4 uInputSize;\r\nuniform vec4 uOutputFrame;\r\nuniform vec4 uOutputTexture;\r\nuniform mat3 uFilterMatrix;\r\n\r\nvec4 filterVertexPosition( vec2 aPosition )\r\n{\r\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\r\n \r\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\r\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\r\n\r\n return vec4(position, 0.0, 1.0);\r\n}\r\n\r\nvec2 filterTextureCoord( vec2 aPosition )\r\n{\r\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\r\n}\r\n\r\nvec2 getFilterCoord( vec2 aPosition )\r\n{\r\n return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\r\n} \r\n\r\nvoid main(void)\r\n{\r\n gl_Position = filterVertexPosition(aPosition);\r\n vTextureCoord = filterTextureCoord(aPosition);\r\n vMaskCoord = getFilterCoord(aPosition);\r\n}\r\n"},40059:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default="struct GlobalFilterUniforms {\r\n uInputSize:vec4,\r\n uInputPixel:vec4,\r\n uInputClamp:vec4,\r\n uOutputFrame:vec4,\r\n uGlobalFrame:vec4,\r\n uOutputTexture:vec4, \r\n};\r\n\r\nstruct MaskUniforms {\r\n uFilterMatrix:mat3x3,\r\n uMaskClamp:vec4,\r\n uAlpha:f32,\r\n};\r\n\r\n\r\n@group(0) @binding(0) var gfu: GlobalFilterUniforms;\r\n@group(0) @binding(1) var uTexture: texture_2d;\r\n@group(0) @binding(2) var uSampler : sampler;\r\n\r\n@group(1) @binding(0) var filterUniforms : MaskUniforms;\r\n@group(1) @binding(1) var uMaskTexture: texture_2d;\r\n\r\nstruct VSOutput {\r\n @builtin(position) position: vec4,\r\n @location(0) uv : vec2,\r\n @location(1) filterUv : vec2,\r\n };\r\n\r\nfn filterVertexPosition(aPosition:vec2) -> vec4\r\n{\r\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\r\n\r\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\r\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\r\n\r\n return vec4(position, 0.0, 1.0);\r\n}\r\n\r\nfn filterTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\r\n}\r\n\r\nfn globalTextureCoord( aPosition:vec2 ) -> vec2\r\n{\r\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \r\n}\r\n\r\nfn getFilterCoord(aPosition:vec2 ) -> vec2\r\n{\r\n return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\r\n}\r\n\r\nfn getSize() -> vec2\r\n{\r\n\r\n \r\n return gfu.uGlobalFrame.zw;\r\n}\r\n \r\n@vertex\r\nfn mainVertex(\r\n @location(0) aPosition : vec2, \r\n) -> VSOutput {\r\n return VSOutput(\r\n filterVertexPosition(aPosition),\r\n filterTextureCoord(aPosition),\r\n getFilterCoord(aPosition)\r\n );\r\n}\r\n\r\n@fragment\r\nfn mainFragment(\r\n @location(0) uv: vec2,\r\n @location(1) filterUv: vec2,\r\n @builtin(position) position: vec4\r\n) -> @location(0) vec4 {\r\n\r\n var maskClamp = filterUniforms.uMaskClamp;\r\n\r\n var clip = step(3.5,\r\n step(maskClamp.x, filterUv.x) +\r\n step(maskClamp.y, filterUv.y) +\r\n step(filterUv.x, maskClamp.z) +\r\n step(filterUv.y, maskClamp.w));\r\n\r\n var mask = textureSample(uMaskTexture, uSampler, filterUv);\r\n var source = textureSample(uTexture, uSampler, uv);\r\n \r\n var npmAlpha = 0.0;\r\n\r\n var alphaMul = 1.0 - npmAlpha * (1.0 - mask.a);\r\n\r\n var a = (alphaMul * mask.r) * clip;\r\n\r\n return vec4(source.rgb, source.a) * a;\r\n}"},58687:function(e,t,r){"use strict";var i=r(59759),n=r(147),s=r(17073);r(55063),r(55102),r(46807),r(24217),r(58305),r(98430),r(77235),r(80385),r(76143),r(9653),r(38496),r(59868),r(14073),r(46569),r(33430),r(45517),r(79878),r(12878),r(6514),r(95991),r(42508),r(34005);var o=r(96480),a=r(49507),l=r(43931),u=r(20607),h=r(96755),c=r(12488),d=r(56442),p=r(97914),f=r(64909),m=r(26004),g=r(92219),_=r(31660),x=r(34412),b=r(24258),v=r(93040),y=r(63846),T=r(61843),S=r(98815),E=r(37976),w=r(47864),A=r(70922),M=r(56697),P=r(89660),R=r(38531),C=r(45747),B=r(81729),G=r(18800),F=r(45724),D=r(56509),I=r(62392),O=r(58433),U=r(28881),k=r(55673),L=r(62972),N=r(36214),V=r(17178),H=r(11560),X=r(44994),z=r(32181),W=r(8774),Y=r(20246),j=r(20763),$=r(76529),q=r(80428),K=r(27273),Q=r(13189),Z=r(64822),J=r(76836),ee=r(6195),te=r(34361),re=r(95997),ie=r(73036),ne=r(90206),se=r(5866),oe=r(90973),ae=r(42196),le=r(82493),ue=r(58778),he=r(25917),ce=r(49728),de=r(31166),pe=r(2383),fe=r(45031),me=r(94086),ge=r(95966),_e=r(69040),xe=r(55418),be=r(5566),ve=r(7451),ye=r(79531),Te=r(97051),Se=r(87976),Ee=r(41177),we=r(67172),Ae=r(54143),Me=r(48834),Pe=r(12055),Re=r(8198),Ce=r(17125),Be=r(56899),Ge=r(13320),Fe=r(1394),De=r(165),Ie=r(10051),Oe=r(42932),Ue=r(98182),ke=r(36484),Le=r(24306),Ne=r(41863),Ve=r(8599),He=r(5443),Xe=r(49410),ze=r(14235),We=r(19250),Ye=r(45345),je=r(81483),$e=r(70475),qe=r(40265),Ke=r(53784),Qe=r(26508),Ze=r(85860),Je=r(90588),et=r(6857),tt=r(15255),rt=r(62494),it=r(41792),nt=r(85001),st=r(33610),ot=r(25044),at=r(25999),lt=r(24310),ut=r(20018),ht=r(98955),ct=r(40059),dt=r(81210),pt=r(57422),ft=r(79474),mt=r(77047),gt=r(82510),_t=r(27657),xt=r(58758),bt=r(29028),vt=r(713),yt=r(40806),Tt=r(3824),St=r(41012),Et=r(43795),wt=r(95547),At=r(44023),Mt=r(71210),Pt=r(85644),Rt=r(24516),Ct=r(24745),Bt=r(81955),Gt=r(15685),Ft=r(29705),Dt=r(39018),It=r(28985),Ot=r(62792),Ut=r(26553),kt=r(27994),Lt=r(21778),Nt=r(66736),Vt=r(58173),Ht=r(42181),Xt=r(66321),zt=r(69474),Wt=r(73940),Yt=r(3422),jt=r(72780),$t=r(26116),qt=r(58578),Kt=r(51719),Qt=r(1766),Zt=r(93154),Jt=r(72459),er=r(33388),tr=r(9803),rr=r(87866),ir=r(33961),nr=r(23254),sr=r(74404),or=r(99821),ar=r(33304),lr=r(21380),ur=r(42403),hr=r(58674),cr=r(15183),dr=r(95233),pr=r(98319),fr=r(11206),mr=r(60079),gr=r(59615),_r=r(84215),xr=r(19209),br=r(39320),vr=r(74813),yr=r(4116),Tr=r(36114),Sr=r(48718),Er=r(14673),wr=r(50020),Ar=r(62579),Mr=r(81480),Pr=r(32258),Rr=r(99022),Cr=r(33648),Br=r(38782),Gr=r(17957),Fr=r(4722),Dr=r(85520),Ir=r(3839),Or=r(7540),Ur=r(32985),kr=r(36351),Lr=r(96307),Nr=r(90493),Vr=r(42026),Hr=r(57066),Xr=r(79211),zr=r(45769),Wr=r(50264),Yr=r(4308),jr=r(9779),$r=r(54346),qr=r(65706),Kr=r(9488),Qr=r(62991),Zr=r(94230),Jr=r(2071),ei=r(53864),ti=r(49245),ri=r(27124),ii=r(32377),ni=r(71820),si=r(61913),oi=r(3480),ai=r(3871),li=r(51525),ui=r(51895),hi=r(6887),ci=r(19336),di=r(86380),pi=r(44135),fi=r(9778),mi=r(4023),gi=r(77944),_i=r(48142),xi=r(3553),bi=r(98121),vi=r(90708),yi=r(40074),Ti=r(66171),Si=r(8279),Ei=r(93199),wi=r(40655),Ai=r(30290),Mi=r(52470),Pi=r(62123),Ri=r(35416),Ci=r(82953),Bi=r(75705),Gi=r(53321),Fi=r(88588),Di=r(84157),Ii=r(5020),Oi=r(51727),Ui=r(16310),ki=r(59758),Li=r(7358),Ni=r(61435),Vi=r(98826),Hi=r(71901),Xi=r(40736),zi=r(30679),Wi=r(61265),Yi=r(65586),ji=r(32920),$i=r(96150),qi=r(4812),Ki=r(93812),Qi=r(50967),Zi=r(91428),Ji=r(86136),en=r(9143),tn=r(24628),rn=r(83582),nn=r(50543),sn=r(25947),on=r(41036),an=r(84214),ln=r(29926),un=r(16126),hn=r(1513),cn=r(80863),dn=r(47242),pn=r(79320),fn=r(53299),mn=r(81242),gn=r(36826),_n=r(56042),xn=r(97394),bn=r(1956),vn=r(37135),yn=r(2766),Tn=r(43213),Sn=r(87929),En=r(69264),wn=r(6852),An=r(69862),Mn=r(21839),Pn=r(1793),Rn=r(18919),Cn=r(70766),Bn=r(95041),Gn=r(42310),Fn=r(80163),Dn=r(33829),In=r(44307),On=r(84026),Un=r(52783),kn=r(14740),Ln=r(54132),Nn=r(31540),Vn=r(54572),Hn=r(11987),Xn=r(33764),zn=r(16952),Wn=r(3695),Yn=r(24510),jn=r(19450),$n=r(97505),qn=r(21384),Kn=r(6864),Qn=r(65518),Zn=r(1021),Jn=r(90887),es=r(63981),ts=r(46876),rs=r(22334),is=r(56445),ns=r(254),ss=r(55141),os=r(95931),as=r(62856),ls=r(17627),us=r(60932),hs=r(6121),cs=r(56225),ds=r(32064),ps=r(4720),fs=r(91525),ms=r(68651),gs=r(75813),_s=r(27666),xs=r(62480),bs=r(84463),vs=r(95224),ys=r(94058),Ts=r(38759),Ss=r(44174),Es=r(92756),ws=r(95026),As=r(40190),Ms=r(34155),Ps=r(55484),Rs=r(39394),Cs=r(6066),Bs=r(60527),Gs=r(80177),Fs=r(2559),Ds=r(14786),Is=r(91858),Os=r(9565),Us=r(19025),ks=r(47306),Ls=r(29541),Ns=r(5408),Vs=r(25136),Hs=r(36695),Xs=r(59009),zs=r(8125),Ws=r(36422),Ys=r(84748),js=r(74599),$s=r(2934),qs=r(76713),Ks=r(49341),Qs=r(9176),Zs=r(13056),Js=r(15486),eo=r(58216),to=r(12057),ro=r(51643),io=r(29409),no=r(6877),so=r(41482),oo=r(82397),ao=r(55747),lo=r(89358),uo=r(24417),ho=r(48496),co=r(65766),po=r(67589),fo=r(81448),mo=r(76818),go=r(77107),_o=r(46141),xo=r(76393),bo=r(69169),vo=r(86570),yo=r(92572),To=r(67563),So=r(76788),Eo=r(968),wo=r(57469),Ao=r(53976),Mo=r(64778),Po=r(88365),Ro=r(37553),Co=r(16315),Bo=r(69639),Go=r(90537),Fo=r(2608),Do=r(20832),Io=r(7639),Oo=r(84385),Uo=r(26289),ko=r(92248),Lo=r(93940),No=r(42892),Vo=r(60374),Ho=r(97886),Xo=r(20593),zo=r(47464),Wo=r(58494),Yo=r(23433),jo=r(62538),$o=r(28599),qo=r(92020),Ko=r(27574),Qo=r(14313),Zo=r(14749),Jo=r(11291),ea=r(65935),ta=r(45136),ra=r(58507),ia=r(86957),na=r(37086),sa=r(46525),oa=r(25784),aa=r(2600),la=r(76596),ua=r(33449),ha=r(87577),ca=r(63522),da=r(67919),pa=r(74839),fa=r(3857),ma=r(42598),ga=r(20872),_a=r(44260),xa=r(50426),ba=r(22972),va=r(10701),ya=r(1894),Ta=r(76887),Sa=r(82556),Ea=r(88061),wa=r(17668),Aa=r(45847),Ma=r(10476),Pa=r(91195),Ra=r(80265),Ca=r(43969),Ba=r(22082),Ga=r(30610),Fa=r(38513),Da=r(54125),Ia=r(93968),Oa=r(2668),Ua=r(47308),ka=r(73543),La=r(62074),Na=r(46242),Va=r(27252),Ha=r(20628),Xa=r(23026),za=r(75761),Wa=r(85669),Ya=r(11296),ja=r(19790),$a=r(89523),qa=r(31030),Ka=r(76869),Qa=r(58054),Za=r(61868),Ja=r(73602),el=r(34988),tl=r(40206),rl=r(71424),il=r(62434),nl=r(79517),sl=r(24328),ol=r(64597),al=r(30705),ll=r(26138),ul=r(89757),hl=r(65540),cl=r(35292),dl=r(63983),pl=r(31137),fl=r(86105),ml=r(2636),gl=r(57296),_l=r(58050),xl=r(73533),bl=r(4037),vl=r(50034),yl=r(54591),Tl=r(5323),Sl=r(39654),El=r(78739),wl=r(64293),Al=r(67200),Ml=r(77078),Pl=r(60094),Rl=r(37277),Cl=r(50469),Bl=r(95190),Gl=r(98449),Fl=r(23522),Dl=r(87876),Il=r(36491),Ol=r(82568),Ul=r(86169),kl=r(37087),Ll=r(9187);s.extensions.add(i.browserExt,n.webworkerExt),t.browserExt=i.browserExt,t.webworkerExt=n.webworkerExt,t.ExtensionType=s.ExtensionType,t.extensions=s.extensions,t.normalizeExtensionPriority=s.normalizeExtensionPriority,t.AccessibilitySystem=o.AccessibilitySystem,t.accessibilityTarget=a.accessibilityTarget,t.ColorBlend=l.ColorBlend,t.ColorBurnBlend=u.ColorBurnBlend,t.ColorDodgeBlend=h.ColorDodgeBlend,t.DarkenBlend=c.DarkenBlend,t.DifferenceBlend=d.DifferenceBlend,t.DivideBlend=p.DivideBlend,t.ExclusionBlend=f.ExclusionBlend,t.HardLightBlend=m.HardLightBlend,t.HardMixBlend=g.HardMixBlend,t.LightenBlend=_.LightenBlend,t.LinearBurnBlend=x.LinearBurnBlend,t.LinearDodgeBlend=b.LinearDodgeBlend,t.LinearLightBlend=v.LinearLightBlend,t.LuminosityBlend=y.LuminosityBlend,t.NegationBlend=T.NegationBlend,t.OverlayBlend=S.OverlayBlend,t.PinLightBlend=E.PinLightBlend,t.SaturationBlend=w.SaturationBlend,t.SoftLightBlend=A.SoftLightBlend,t.SubtractBlend=M.SubtractBlend,t.VividLightBlend=P.VividLightBlend,t.Application=R.Application,t.ResizePlugin=C.ResizePlugin,t.TickerPlugin=B.TickerPlugin,t.Assets=G.Assets,t.AssetsClass=G.AssetsClass,t.BackgroundLoader=F.BackgroundLoader,t.Cache=D.Cache,t.cacheTextureArray=I.cacheTextureArray,t.detectAvif=O.detectAvif,t.detectDefaults=U.detectDefaults,t.detectMp4=k.detectMp4,t.detectOgv=L.detectOgv,t.detectWebm=N.detectWebm,t.detectWebp=V.detectWebp,t.testImageFormat=H.testImageFormat,t.testVideoFormat=X.testVideoFormat,t.Loader=z.Loader,t.LoaderParserPriority=W.LoaderParserPriority,t.loadJson=Y.loadJson,t.loadTxt=j.loadTxt,t.getFontFamilyName=$.getFontFamilyName,t.loadWebFont=$.loadWebFont,t.loadSvg=q.loadSvg,t.loadImageBitmap=K.loadImageBitmap,t.loadTextures=K.loadTextures,t.crossOrigin=Q.crossOrigin,t.determineCrossOrigin=Q.determineCrossOrigin,t.loadVideoTextures=Q.loadVideoTextures,t.preloadVideo=Q.preloadVideo,t.createTexture=Z.createTexture,t.WorkerManager=J.WorkerManager,t.resolveJsonUrl=ee.resolveJsonUrl,t.resolveTextureUrl=te.resolveTextureUrl,t.Resolver=re.Resolver,t.getUrlExtension=re.getUrlExtension,t.checkDataUrl=ie.checkDataUrl,t.checkExtension=ne.checkExtension,t.convertToList=se.convertToList,t.copySearchParams=oe.copySearchParams,t.createStringVariations=ae.createStringVariations,t.isSingleItem=le.isSingleItem,t.Color=ue.Color,t.detectBasis=he.detectBasis,t.loadBasis=ce.loadBasis,t.createLevelBuffers=de.createLevelBuffers,t.gpuFormatToBasisTranscoderFormat=pe.gpuFormatToBasisTranscoderFormat,t.basisTranscoderUrls=fe.basisTranscoderUrls,t.setBasisTranscoderPath=fe.setBasisTranscoderPath,t.loadBasisOnWorker=me.loadBasisOnWorker,t.D3D10_RESOURCE_DIMENSION=ge.D3D10_RESOURCE_DIMENSION,t.D3DFMT=ge.D3DFMT,t.DDS=ge.DDS,t.DXGI_FORMAT=ge.DXGI_FORMAT,t.DXGI_TO_TEXTURE_FORMAT=ge.DXGI_TO_TEXTURE_FORMAT,t.FOURCC_TO_TEXTURE_FORMAT=ge.FOURCC_TO_TEXTURE_FORMAT,t.TEXTURE_FORMAT_BLOCK_SIZE=ge.TEXTURE_FORMAT_BLOCK_SIZE,t.loadDDS=_e.loadDDS,t.parseDDS=xe.parseDDS,t.loadKTX=be.loadKTX,t.parseKTX=ve.parseKTX,t.GL_INTERNAL_FORMAT=ye.GL_INTERNAL_FORMAT,t.KTX=ye.KTX,t.loadKTX2=Te.loadKTX2,t.convertFormatIfRequired=Se.convertFormatIfRequired,t.createLevelBuffersFromKTX=Ee.createLevelBuffersFromKTX,t.getTextureFormatFromKTXTexture=we.getTextureFormatFromKTXTexture,t.glFormatToGPUFormat=Ae.glFormatToGPUFormat,t.gpuFormatToKTXBasisTranscoderFormat=Me.gpuFormatToKTXBasisTranscoderFormat,t.ktxTranscoderUrls=Pe.ktxTranscoderUrls,t.setKTXTranscoderPath=Pe.setKTXTranscoderPath,t.vkFormatToGPUFormat=Re.vkFormatToGPUFormat,t.loadKTX2onWorker=Ce.loadKTX2onWorker,t.detectCompressed=Be.detectCompressed,t.resolveCompressedTextureUrl=Ge.resolveCompressedTextureUrl,t.validFormats=Ge.validFormats,t.Culler=Fe.Culler,t.CullerPlugin=De.CullerPlugin,t.cullingMixin=Ie.cullingMixin,t.DOMAdapter=Oe.DOMAdapter,t.autoDetectEnvironment=Ue.autoDetectEnvironment,t.loadEnvironmentExtensions=Ue.loadEnvironmentExtensions,t.BrowserAdapter=ke.BrowserAdapter,t.WebWorkerAdapter=Le.WebWorkerAdapter,t.EventBoundary=Ne.EventBoundary,t.EventSystem=Ve.EventSystem,t.EventsTicker=He.EventsTicker,t.FederatedEvent=Xe.FederatedEvent,t.FederatedContainer=ze.FederatedContainer,t.FederatedMouseEvent=We.FederatedMouseEvent,t.FederatedPointerEvent=Ye.FederatedPointerEvent,t.FederatedWheelEvent=je.FederatedWheelEvent,t.blendTemplateFrag=$e.default,t.blendTemplateVert=qe.default,t.blendTemplateWgsl=Ke.default,t.hslWgsl=Qe.default,t.alphaFrag=Ze.default,t.alphaWgsl=Je.default,t.blurTemplateWgsl=et.default,t.colorMatrixFilterFrag=tt.default,t.colorMatrixFilterWgsl=rt.default,t.defaultFilterVert=it.default,t.displacementFrag=nt.default,t.displacementVert=st.default,t.displacementWgsl=ot.default,t.noiseFrag=at.default,t.noiseWgsl=lt.default,t.maskFrag=ut.default,t.maskVert=ht.default,t.maskWgsl=ct.default,t.BlendModeFilter=dt.BlendModeFilter,t.hslgl=pt.hslgl,t.hslgpu=ft.hslgpu,t.AlphaFilter=mt.AlphaFilter,t.BlurFilter=gt.BlurFilter,t.BlurFilterPass=_t.BlurFilterPass,t.GAUSSIAN_VALUES=xt.GAUSSIAN_VALUES,t.generateBlurFragSource=bt.generateBlurFragSource,t.generateBlurGlProgram=vt.generateBlurGlProgram,t.generateBlurVertSource=yt.generateBlurVertSource,t.generateBlurProgram=Tt.generateBlurProgram,t.ColorMatrixFilter=St.ColorMatrixFilter,t.DisplacementFilter=Et.DisplacementFilter,t.NoiseFilter=wt.NoiseFilter,t.Filter=At.Filter,t.FilterEffect=Mt.FilterEffect,t.FilterPipe=Pt.FilterPipe,t.FilterSystem=Rt.FilterSystem,t.MaskFilter=Ct.MaskFilter,t.groupD8=Bt.groupD8,t.Matrix=Gt.Matrix,t.DEG_TO_RAD=Ft.DEG_TO_RAD,t.PI_2=Ft.PI_2,t.RAD_TO_DEG=Ft.RAD_TO_DEG,t.isPow2=Dt.isPow2,t.log2=Dt.log2,t.nextPow2=Dt.nextPow2,t.squaredDistanceToLineSegment=It.squaredDistanceToLineSegment,t.ObservablePoint=Ot.ObservablePoint,t.Point=Ut.Point,t.pointInTriangle=kt.pointInTriangle,t.Circle=Lt.Circle,t.Ellipse=Nt.Ellipse,t.Polygon=Vt.Polygon,t.Rectangle=Ht.Rectangle,t.RoundedRectangle=Xt.RoundedRectangle,t.Triangle=zt.Triangle,t.PrepareBase=Wt.PrepareBase,t.PrepareQueue=Yt.PrepareQueue,t.PrepareSystem=jt.PrepareSystem,t.PrepareUpload=$t.PrepareUpload,t.GlBatchAdaptor=qt.GlBatchAdaptor,t.checkMaxIfStatementsInShader=Kt.checkMaxIfStatementsInShader,t.getMaxTexturesPerBatch=Qt.getMaxTexturesPerBatch,t.generateGPULayout=Zt.generateGPULayout,t.generateLayout=Jt.generateLayout,t.getTextureBatchBindGroup=er.getTextureBatchBindGroup,t.GpuBatchAdaptor=tr.GpuBatchAdaptor,t.Batch=rr.Batch,t.Batcher=rr.Batcher,t.BatcherPipe=ir.BatcherPipe,t.BatchGeometry=nr.BatchGeometry,t.BatchTextureArray=sr.BatchTextureArray,t.DefaultBatcher=or.DefaultBatcher,t.DefaultShader=ar.DefaultShader,t.compileHighShaderGlProgram=lr.compileHighShaderGlProgram,t.compileHighShaderGpuProgram=lr.compileHighShaderGpuProgram,t.compileHighShader=ur.compileHighShader,t.compileHighShaderGl=ur.compileHighShaderGl,t.addBits=hr.addBits,t.compileHooks=cr.compileHooks,t.findHooksRx=cr.findHooksRx,t.compileInputs=dr.compileInputs,t.compileOutputs=pr.compileOutputs,t.formatShader=fr.formatShader,t.injectBits=mr.injectBits,t.fragmentGPUTemplate=gr.fragmentGPUTemplate,t.fragmentGlTemplate=gr.fragmentGlTemplate,t.vertexGPUTemplate=gr.vertexGPUTemplate,t.vertexGlTemplate=gr.vertexGlTemplate,t.colorBit=_r.colorBit,t.colorBitGl=_r.colorBitGl,t.generateTextureBatchBit=xr.generateTextureBatchBit,t.generateTextureBatchBitGl=xr.generateTextureBatchBitGl,t.globalUniformsBit=br.globalUniformsBit,t.globalUniformsBitGl=br.globalUniformsBitGl,t.globalUniformsUBOBitGl=br.globalUniformsUBOBitGl,t.localUniformBit=vr.localUniformBit,t.localUniformBitGl=vr.localUniformBitGl,t.localUniformBitGroup2=vr.localUniformBitGroup2,t.roundPixelsBit=yr.roundPixelsBit,t.roundPixelsBitGl=yr.roundPixelsBitGl,t.textureBit=Tr.textureBit,t.textureBitGl=Tr.textureBitGl,t.AlphaMask=Sr.AlphaMask,t.AlphaMaskPipe=Er.AlphaMaskPipe,t.ColorMask=wr.ColorMask,t.ColorMaskPipe=Ar.ColorMaskPipe,t.MaskEffectManager=Mr.MaskEffectManager,t.MaskEffectManagerClass=Mr.MaskEffectManagerClass,t.ScissorMask=Pr.ScissorMask,t.StencilMask=Rr.StencilMask,t.StencilMaskPipe=Cr.StencilMaskPipe,t.addMaskBounds=Br.addMaskBounds,t.addMaskLocalBounds=Gr.addMaskLocalBounds,t.getMatrixRelativeToParent=Gr.getMatrixRelativeToParent,t.autoDetectRenderer=Fr.autoDetectRenderer,t.BUFFER_TYPE=Dr.BUFFER_TYPE,t.GlBuffer=Ir.GlBuffer,t.GlBufferSystem=Or.GlBufferSystem,t.CLEAR=Ur.CLEAR,t.GlContextSystem=kr.GlContextSystem,t.GlGeometrySystem=Lr.GlGeometrySystem,t.getGlTypeFromFormat=Nr.getGlTypeFromFormat,t.GlBackBufferSystem=Vr.GlBackBufferSystem,t.GlColorMaskSystem=Hr.GlColorMaskSystem,t.GlEncoderSystem=Xr.GlEncoderSystem,t.GlRenderTarget=zr.GlRenderTarget,t.GlStencilSystem=Wr.GlStencilSystem,t.GlUboSystem=Yr.GlUboSystem,t.GlRenderTargetAdaptor=jr.GlRenderTargetAdaptor,t.GlRenderTargetSystem=$r.GlRenderTargetSystem,t.generateShaderSyncCode=qr.generateShaderSyncCode,t.getBatchSamplersUniformGroup=Kr.getBatchSamplersUniformGroup,t.GlProgram=Qr.GlProgram,t.GlProgramData=Zr.GlProgramData,t.IGLUniformData=Zr.IGLUniformData,t.GlShaderSystem=Jr.GlShaderSystem,t.GlUniformGroupSystem=ei.GlUniformGroupSystem,t.migrateFragmentFromV7toV8=ti.migrateFragmentFromV7toV8,t.compileShader=ri.compileShader,t.defaultValue=ii.defaultValue,t.ensureAttributes=ni.ensureAttributes,t.extractAttributesFromGlProgram=si.extractAttributesFromGlProgram,t.generateProgram=oi.generateProgram,t.getMaxFragmentPrecision=ai.getMaxFragmentPrecision,t.getTestContext=li.getTestContext,t.getUboData=ui.getUboData,t.getUniformData=hi.getUniformData,t.logProgramError=ci.logProgramError,t.mapSize=di.mapSize,t.mapGlToVertexFormat=pi.mapGlToVertexFormat,t.mapType=pi.mapType,t.addProgramDefines=fi.addProgramDefines,t.ensurePrecision=mi.ensurePrecision,t.insertVersion=gi.insertVersion,t.setProgramName=_i.setProgramName,t.stripVersion=xi.stripVersion,t.WGSL_TO_STD40_SIZE=bi.WGSL_TO_STD40_SIZE,t.createUboElementsSTD40=bi.createUboElementsSTD40,t.createUboSyncFunctionSTD40=vi.createUboSyncFunctionSTD40,t.generateArraySyncSTD40=yi.generateArraySyncSTD40,t.generateUniformsSync=Ti.generateUniformsSync,t.UNIFORM_TO_ARRAY_SETTERS=Si.UNIFORM_TO_ARRAY_SETTERS,t.UNIFORM_TO_SINGLE_SETTERS=Si.UNIFORM_TO_SINGLE_SETTERS,t.GlStateSystem=Ei.GlStateSystem,t.mapWebGLBlendModesToPixi=wi.mapWebGLBlendModesToPixi,t.GL_FORMATS=Ai.GL_FORMATS,t.GL_TARGETS=Ai.GL_TARGETS,t.GL_TYPES=Ai.GL_TYPES,t.GL_WRAP_MODES=Ai.GL_WRAP_MODES,t.GlTexture=Mi.GlTexture,t.GlTextureSystem=Pi.GlTextureSystem,t.glUploadBufferImageResource=Ri.glUploadBufferImageResource,t.glUploadCompressedTextureResource=Ci.glUploadCompressedTextureResource,t.glUploadImageResource=Bi.glUploadImageResource,t.glUploadVideoResource=Gi.glUploadVideoResource,t.applyStyleParams=Fi.applyStyleParams,t.getSupportedGlCompressedTextureFormats=Di.getSupportedGlCompressedTextureFormats,t.mapFormatToGlFormat=Ii.mapFormatToGlFormat,t.mapFormatToGlInternalFormat=Oi.mapFormatToGlInternalFormat,t.mapFormatToGlType=Ui.mapFormatToGlType,t.compareModeToGlCompare=ki.compareModeToGlCompare,t.mipmapScaleModeToGlFilter=ki.mipmapScaleModeToGlFilter,t.scaleModeToGlFilter=ki.scaleModeToGlFilter,t.wrapModeToGlAddress=ki.wrapModeToGlAddress,t.unpremultiplyAlpha=Li.unpremultiplyAlpha,t.WebGLRenderer=Ni.WebGLRenderer,t.BindGroupSystem=Vi.BindGroupSystem,t.GpuBufferSystem=Hi.GpuBufferSystem,t.GpuReadBuffer=Xi.GpuReadBuffer,t.UboBatch=zi.UboBatch,t.GpuColorMaskSystem=Wi.GpuColorMaskSystem,t.GpuDeviceSystem=Yi.GpuDeviceSystem,t.GpuEncoderSystem=ji.GpuEncoderSystem,t.GpuStencilSystem=$i.GpuStencilSystem,t.GpuUboSystem=qi.GpuUboSystem,t.GpuUniformBatchPipe=Ki.GpuUniformBatchPipe,t.PipelineSystem=Qi.PipelineSystem,t.calculateProjection=Zi.calculateProjection,t.GpuRenderTarget=Ji.GpuRenderTarget,t.GpuRenderTargetAdaptor=en.GpuRenderTargetAdaptor,t.GpuRenderTargetSystem=tn.GpuRenderTargetSystem,t.BindGroup=rn.BindGroup,t.GpuProgram=nn.GpuProgram,t.GpuShaderSystem=sn.GpuShaderSystem,t.WGSL_ALIGN_SIZE_DATA=on.WGSL_ALIGN_SIZE_DATA,t.createUboElementsWGSL=on.createUboElementsWGSL,t.createUboSyncFunctionWGSL=an.createUboSyncFunctionWGSL,t.extractAttributesFromGpuProgram=ln.extractAttributesFromGpuProgram,t.extractStructAndGroups=un.extractStructAndGroups,t.generateArraySyncWGSL=hn.generateArraySyncWGSL,t.generateGpuLayoutGroups=cn.generateGpuLayoutGroups,t.generateLayoutHash=dn.generateLayoutHash,t.removeStructAndGroupDuplicates=pn.removeStructAndGroupDuplicates,t.GpuBlendModesToPixi=fn.GpuBlendModesToPixi,t.GpuStateSystem=mn.GpuStateSystem,t.GpuStencilModesToPixi=gn.GpuStencilModesToPixi,t.GpuTextureSystem=_n.GpuTextureSystem,t.gpuUploadBufferImageResource=xn.gpuUploadBufferImageResource,t.blockDataMap=bn.blockDataMap,t.gpuUploadCompressedTextureResource=bn.gpuUploadCompressedTextureResource,t.gpuUploadImageResource=vn.gpuUploadImageResource,t.gpuUploadVideoResource=yn.gpuUploadVideoResource,t.getSupportedGPUCompressedTextureFormats=Tn.getSupportedGPUCompressedTextureFormats,t.GpuMipmapGenerator=Sn.GpuMipmapGenerator,t.WebGPURenderer=En.WebGPURenderer,t.BackgroundSystem=wn.BackgroundSystem,t.BlendModePipe=An.BlendModePipe,t.Buffer=Mn.Buffer,t.BufferResource=Pn.BufferResource,t.BufferUsage=Rn.BufferUsage,t.fastCopy=Cn.fastCopy,t.ExtractSystem=Bn.ExtractSystem,t.GenerateTextureSystem=Gn.GenerateTextureSystem,t.DRAW_MODES=Fn.DRAW_MODES,t.Geometry=Dn.Geometry,t.buildSimpleUvs=In.buildSimpleUvs,t.buildUvs=In.buildUvs,t.ensureIsBuffer=On.ensureIsBuffer,t.getAttributeInfoFromFormat=Un.getAttributeInfoFromFormat,t.getGeometryBounds=kn.getGeometryBounds,t.transformVertices=Ln.transformVertices,t.InstructionSet=Nn.InstructionSet,t.GlobalUniformSystem=Vn.GlobalUniformSystem,t.isRenderingToScreen=Hn.isRenderingToScreen,t.RenderTarget=Xn.RenderTarget,t.RenderTargetSystem=zn.RenderTargetSystem,t.viewportFromFrame=Wn.viewportFromFrame,t.SchedulerSystem=Yn.SchedulerSystem,t.ShaderStage=jn.ShaderStage,t.Shader=$n.Shader,t.UNIFORM_TYPES_MAP=qn.UNIFORM_TYPES_MAP,t.UNIFORM_TYPES_VALUES=qn.UNIFORM_TYPES_VALUES,t.UboSystem=Kn.UboSystem,t.UniformGroup=Qn.UniformGroup,t.createUboSyncFunction=Zn.createUboSyncFunction,t.getDefaultUniformValue=Jn.getDefaultUniformValue,t.uboSyncFunctionsSTD40=es.uboSyncFunctionsSTD40,t.uboSyncFunctionsWGSL=es.uboSyncFunctionsWGSL,t.uniformParsers=ts.uniformParsers,t.HelloSystem=rs.HelloSystem,t.BLEND_TO_NPM=is.BLEND_TO_NPM,t.STENCIL_MODES=is.STENCIL_MODES,t.getAdjustedBlendModeBlend=ns.getAdjustedBlendModeBlend,t.State=ss.State,t.AbstractRenderer=os.AbstractRenderer,t.SharedRenderPipes=as.SharedRenderPipes,t.SharedSystems=as.SharedSystems,t.SystemRunner=ls.SystemRunner,t.CanvasPool=us.CanvasPool,t.CanvasPoolClass=us.CanvasPoolClass,t.DEPRECATED_SCALE_MODES=hs.DEPRECATED_SCALE_MODES,t.DEPRECATED_WRAP_MODES=hs.DEPRECATED_WRAP_MODES,t.MSAA_QUALITY=hs.MSAA_QUALITY,t.SCALE_MODES=hs.SCALE_MODES,t.WRAP_MODES=hs.WRAP_MODES,t.RenderableGCSystem=cs.RenderableGCSystem,t.RenderTexture=ds.RenderTexture,t.BufferImageSource=ps.BufferImageSource,t.CanvasSource=fs.CanvasSource,t.CompressedSource=ms.CompressedSource,t.ImageSource=gs.ImageSource,t.TextureSource=_s.TextureSource,t.VideoSource=xs.VideoSource,t.Texture=bs.Texture,t.TextureGCSystem=vs.TextureGCSystem,t.TextureMatrix=ys.TextureMatrix,t.TexturePool=Ts.TexturePool,t.TexturePoolClass=Ts.TexturePoolClass,t.TextureStyle=Ss.TextureStyle,t.TextureUvs=Es.TextureUvs,t.generateUID=ws.generateUID,t.getCanvasTexture=As.getCanvasTexture,t.hasCachedCanvasTexture=As.hasCachedCanvasTexture,t.getSupportedCompressedTextureFormats=Ms.getSupportedCompressedTextureFormats,t.getSupportedTextureFormats=Ps.getSupportedTextureFormats,t.nonCompressedFormats=Ps.nonCompressedFormats,t.autoDetectSource=Rs.autoDetectSource,t.resourceToTexture=Rs.resourceToTexture,t.textureFrom=Rs.textureFrom,t.createIdFromString=Cs.createIdFromString,t.parseFunctionBody=Bs.parseFunctionBody,t.ViewSystem=Gs.ViewSystem,t.RendererType=Fs.RendererType,t.Bounds=Ds.Bounds,t._getGlobalBoundsRecursive=Is._getGlobalBoundsRecursive,t.getFastGlobalBounds=Is.getFastGlobalBounds,t._getGlobalBounds=Os._getGlobalBounds,t.getGlobalBounds=Os.getGlobalBounds,t.updateTransformBackwards=Os.updateTransformBackwards,t.getLocalBounds=Us.getLocalBounds,t.getParent=Us.getParent,t.getGlobalRenderableBounds=ks.getGlobalRenderableBounds,t.boundsPool=Ls.boundsPool,t.matrixPool=Ls.matrixPool,t.childrenHelperMixin=Ns.childrenHelperMixin,t.effectsMixin=Vs.effectsMixin,t.findMixin=Hs.findMixin,t.measureMixin=Xs.measureMixin,t.onRenderMixin=zs.onRenderMixin,t.sortMixin=Ws.sortMixin,t.toLocalGlobalMixin=Ys.toLocalGlobalMixin,t.Container=js.Container,t.UPDATE_BLEND=js.UPDATE_BLEND,t.UPDATE_COLOR=js.UPDATE_COLOR,t.UPDATE_TRANSFORM=js.UPDATE_TRANSFORM,t.UPDATE_VISIBLE=js.UPDATE_VISIBLE,t.CustomRenderPipe=$s.CustomRenderPipe,t.RenderContainer=qs.RenderContainer,t.RenderGroup=Ks.RenderGroup,t.RenderGroupPipe=Qs.RenderGroupPipe,t.RenderGroupSystem=Zs.RenderGroupSystem,t.assignWithIgnore=Js.assignWithIgnore,t.buildInstructions=eo.buildInstructions,t.collectAllRenderables=eo.collectAllRenderables,t.checkChildrenDidChange=to.checkChildrenDidChange,t.clearList=ro.clearList,t.collectRenderGroups=io.collectRenderGroups,t.definedProps=no.definedProps,t.executeInstructions=so.executeInstructions,t.mixColors=oo.mixColors,t.mixStandardAnd32BitColors=oo.mixStandardAnd32BitColors,t.mixHexColors=ao.mixHexColors,t.multiplyHexColors=lo.multiplyHexColors,t.updateLocalTransform=uo.updateLocalTransform,t.updateRenderGroupTransform=ho.updateRenderGroupTransform,t.updateRenderGroupTransforms=ho.updateRenderGroupTransforms,t.updateTransformAndChildren=ho.updateTransformAndChildren,t.updateWorldTransform=co.updateWorldTransform,t.validateRenderables=po.validateRenderables,t.GlGraphicsAdaptor=fo.GlGraphicsAdaptor,t.color32BitToUniform=mo.color32BitToUniform,t.colorToUniform=mo.colorToUniform,t.GpuGraphicsAdaptor=go.GpuGraphicsAdaptor,t.BatchableGraphics=_o.BatchableGraphics,t.buildAdaptiveBezier=xo.buildAdaptiveBezier,t.buildAdaptiveQuadratic=bo.buildAdaptiveQuadratic,t.buildArc=vo.buildArc,t.buildArcTo=yo.buildArcTo,t.buildArcToSvg=To.buildArcToSvg,t.buildCircle=So.buildCircle,t.buildEllipse=So.buildEllipse,t.buildRoundedRectangle=So.buildRoundedRectangle,t.buildLine=Eo.buildLine,t.buildPolygon=wo.buildPolygon,t.buildRectangle=Ao.buildRectangle,t.buildTriangle=Mo.buildTriangle,t.closePointEps=Po.closePointEps,t.curveEps=Po.curveEps,t.FillGradient=Ro.FillGradient,t.FillPattern=Co.FillPattern,t.Graphics=Bo.Graphics,t.GraphicsContext=Go.GraphicsContext,t.GpuGraphicsContext=Fo.GpuGraphicsContext,t.GraphicsContextRenderData=Fo.GraphicsContextRenderData,t.GraphicsContextSystem=Fo.GraphicsContextSystem,t.GraphicsPipe=Do.GraphicsPipe,t.GraphicsPath=Io.GraphicsPath,t.roundedShapeArc=Oo.roundedShapeArc,t.roundedShapeQuadraticCurve=Oo.roundedShapeQuadraticCurve,t.ShapePath=Uo.ShapePath,t.SVGParser=ko.SVGParser,t.SVGToGraphicsPath=Lo.SVGToGraphicsPath,t.buildContextBatches=No.buildContextBatches,t.shapeBuilders=No.shapeBuilders,t.buildGeometryFromPath=Vo.buildGeometryFromPath,t.toFillStyle=Ho.toFillStyle,t.toStrokeStyle=Ho.toStrokeStyle,t.getOrientationOfPoints=Xo.getOrientationOfPoints,t.triangulateWithHoles=zo.triangulateWithHoles,t.PerspectiveMesh=Wo.PerspectiveMesh,t.PerspectivePlaneGeometry=Yo.PerspectivePlaneGeometry,t.applyProjectiveTransformationToPlane=jo.applyProjectiveTransformationToPlane,t.compute2DProjection=$o.compute2DProjection,t.MeshPlane=qo.MeshPlane,t.PlaneGeometry=Ko.PlaneGeometry,t.MeshRope=Qo.MeshRope,t.MeshSimple=Zo.MeshSimple,t.RopeGeometry=Jo.RopeGeometry,t.GlMeshAdaptor=ea.GlMeshAdaptor,t.GpuMeshAdapter=ta.GpuMeshAdapter,t.BatchableMesh=ra.BatchableMesh,t.getTextureDefaultMatrix=ia.getTextureDefaultMatrix,t.Mesh=na.Mesh,t.MeshGeometry=sa.MeshGeometry,t.MeshPipe=oa.MeshPipe,t.AnimatedSprite=aa.AnimatedSprite,t.NineSliceGeometry=la.NineSliceGeometry,t.NineSlicePlane=ua.NineSlicePlane,t.NineSliceSprite=ua.NineSliceSprite,t.NineSliceSpritePipe=ha.NineSliceSpritePipe,t.tilingBit=ca.tilingBit,t.tilingBitGl=ca.tilingBitGl,t.TilingSpriteShader=da.TilingSpriteShader,t.TilingSprite=pa.TilingSprite,t.TilingSpritePipe=fa.TilingSpritePipe,t.applyMatrix=ma.applyMatrix,t.QuadGeometry=ga.QuadGeometry,t.setPositions=_a.setPositions,t.setUvs=xa.setUvs,t.BatchableSprite=ba.BatchableSprite,t.Sprite=va.Sprite,t.SpritePipe=ya.SpritePipe,t.AbstractBitmapFont=Ta.AbstractBitmapFont,t.bitmapFontTextParser=Sa.bitmapFontTextParser,t.bitmapFontXMLParser=Ea.bitmapFontXMLParser,t.bitmapFontXMLStringParser=wa.bitmapFontXMLStringParser,t.bitmapFontCachePlugin=Aa.bitmapFontCachePlugin,t.loadBitmapFont=Aa.loadBitmapFont,t.BitmapFont=Ma.BitmapFont,t.BitmapFontManager=Pa.BitmapFontManager,t.BitmapText=Ra.BitmapText,t.BitmapTextPipe=Ca.BitmapTextPipe,t.DynamicBitmapFont=Ba.DynamicBitmapFont,t.getBitmapTextLayout=Ga.getBitmapTextLayout,t.resolveCharacters=Fa.resolveCharacters,t.HTMLText=Da.HTMLText,t.HTMLTextPipe=Ia.HTMLTextPipe,t.HTMLTextRenderData=Oa.HTMLTextRenderData,t.nssvg=Oa.nssvg,t.nsxhtml=Oa.nsxhtml,t.HTMLTextStyle=Ua.HTMLTextStyle,t.HTMLTextSystem=ka.HTMLTextSystem,t.extractFontFamilies=La.extractFontFamilies,t.FontStylePromiseCache=Na.FontStylePromiseCache,t.getFontCss=Na.getFontCss,t.getSVGUrl=Va.getSVGUrl,t.getTemporaryCanvasFromImage=Ha.getTemporaryCanvasFromImage,t.loadFontAsBase64=Xa.loadFontAsBase64,t.loadFontCSS=za.loadFontCSS,t.loadSVGImage=Wa.loadSVGImage,t.measureHtmlText=Ya.measureHtmlText,t.textStyleToCSS=ja.textStyleToCSS,t.AbstractText=$a.AbstractText,t.ensureOptions=$a.ensureOptions,t.CanvasTextMetrics=qa.CanvasTextMetrics,t.CanvasTextPipe=Ka.CanvasTextPipe,t.CanvasTextSystem=Qa.CanvasTextSystem,t.fontStringFromTextStyle=Za.fontStringFromTextStyle,t.getCanvasFillStyle=Ja.getCanvasFillStyle,t.SdfShader=el.SdfShader,t.localUniformMSDFBit=tl.localUniformMSDFBit,t.localUniformMSDFBitGl=tl.localUniformMSDFBitGl,t.mSDFBit=rl.mSDFBit,t.mSDFBitGl=rl.mSDFBitGl,t.Text=il.Text,t.TextStyle=nl.TextStyle,t.ensureTextStyle=sl.ensureTextStyle,t.generateTextStyleKey=ol.generateTextStyleKey,t.getPo2TextureFromSource=al.getPo2TextureFromSource,t.ViewContainer=ll.ViewContainer,t.Spritesheet=ul.Spritesheet,t.spritesheetAsset=hl.spritesheetAsset,t.UPDATE_PRIORITY=cl.UPDATE_PRIORITY,t.Ticker=dl.Ticker,t.TickerListener=pl.TickerListener,t.detectVideoAlphaMode=fl.detectVideoAlphaMode,t.isMobile=ml.isMobile,t.isSafari=gl.isSafari,t.isWebGLSupported=_l.isWebGLSupported,t.isWebGPUSupported=xl.isWebGPUSupported,t.unsafeEvalSupported=bl.unsafeEvalSupported,t.getCanvasBoundingBox=vl.getCanvasBoundingBox,t.DATA_URI=yl.DATA_URI,t.VERSION=yl.VERSION,t.EventEmitter=Tl,t.removeItems=Sl.removeItems,t.resetUids=El.resetUids,t.uid=El.uid,t.updateQuadBounds=wl.updateQuadBounds,t.ViewableBuffer=Al.ViewableBuffer,t.ApplicationInitHook=Ml.ApplicationInitHook,t.RendererInitHook=Ml.RendererInitHook,t.deprecation=Pl.deprecation,t.v8_0_0=Pl.v8_0_0,t.v8_3_4=Pl.v8_3_4,t.logDebugTexture=Rl.logDebugTexture,t.logRenderGroupScene=Cl.logRenderGroupScene,t.logScene=Cl.logScene,t.warn=Bl.warn,t.NOOP=Gl.NOOP,t.Transform=Fl.Transform,t.getResolutionOfUrl=Dl.getResolutionOfUrl,t.path=Il.path,t.Pool=Ol.Pool,t.BigPool=Ul.BigPool,t.PoolGroupClass=Ul.PoolGroupClass,t.sayHello=kl.sayHello,t.earcut=Ll},45517:function(e,t,r){"use strict";var i=r(81955),n=r(15685),s=r(29705),o=r(39018);r(2601);var a=r(28985),l=r(62792),u=r(26553);r(37471);var h=r(27994);r(80643);var c=r(21778),d=r(66736),p=r(58173),f=r(42181),m=r(66321);r(51851);var g=r(69474);t.groupD8=i.groupD8,t.Matrix=n.Matrix,t.DEG_TO_RAD=s.DEG_TO_RAD,t.PI_2=s.PI_2,t.RAD_TO_DEG=s.RAD_TO_DEG,t.isPow2=o.isPow2,t.log2=o.log2,t.nextPow2=o.nextPow2,t.squaredDistanceToLineSegment=a.squaredDistanceToLineSegment,t.ObservablePoint=l.ObservablePoint,t.Point=u.Point,t.pointInTriangle=h.pointInTriangle,t.Circle=c.Circle,t.Ellipse=d.Ellipse,t.Polygon=p.Polygon,t.Rectangle=f.Rectangle,t.RoundedRectangle=m.RoundedRectangle,t.Triangle=g.Triangle},15685:function(e,t,r){"use strict";var i=r(29705),n=r(26553);class s{constructor(e=1,t=0,r=0,i=1,n=0,s=0){this.array=null,this.a=e,this.b=t,this.c=r,this.d=i,this.tx=n,this.ty=s}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,r,i,n,s){return this.a=e,this.b=t,this.c=r,this.d=i,this.tx=n,this.ty=s,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const r=t||this.array;return e?(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(e,t){t=t||new n.Point;const r=e.x,i=e.y;return t.x=this.a*r+this.c*i+this.tx,t.y=this.b*r+this.d*i+this.ty,t}applyInverse(e,t){t=t||new n.Point;const r=this.a,i=this.b,s=this.c,o=this.d,a=this.tx,l=this.ty,u=1/(r*o+s*-i),h=e.x,c=e.y;return t.x=o*u*h+-s*u*c+(l*s-a*o)*u,t.y=r*u*c+-i*u*h+(-l*r+a*i)*u,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),r=Math.sin(e),i=this.a,n=this.c,s=this.tx;return this.a=i*t-this.b*r,this.b=i*r+this.b*t,this.c=n*t-this.d*r,this.d=n*r+this.d*t,this.tx=s*t-this.ty*r,this.ty=s*r+this.ty*t,this}append(e){const t=this.a,r=this.b,i=this.c,n=this.d;return this.a=e.a*t+e.b*i,this.b=e.a*r+e.b*n,this.c=e.c*t+e.d*i,this.d=e.c*r+e.d*n,this.tx=e.tx*t+e.ty*i+this.tx,this.ty=e.tx*r+e.ty*n+this.ty,this}appendFrom(e,t){const r=e.a,i=e.b,n=e.c,s=e.d,o=e.tx,a=e.ty,l=t.a,u=t.b,h=t.c,c=t.d;return this.a=r*l+i*h,this.b=r*u+i*c,this.c=n*l+s*h,this.d=n*u+s*c,this.tx=o*l+a*h+t.tx,this.ty=o*u+a*c+t.ty,this}setTransform(e,t,r,i,n,s,o,a,l){return this.a=Math.cos(o+l)*n,this.b=Math.sin(o+l)*n,this.c=-Math.sin(o-a)*s,this.d=Math.cos(o-a)*s,this.tx=e-(r*this.a+i*this.c),this.ty=t-(r*this.b+i*this.d),this}prepend(e){const t=this.tx;if(1!==e.a||0!==e.b||0!==e.c||1!==e.d){const t=this.a,r=this.c;this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,r=this.b,n=this.c,s=this.d,o=e.pivot,a=-Math.atan2(-n,s),l=Math.atan2(r,t),u=Math.abs(a+l);return u<1e-5||Math.abs(i.PI_2-u)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=l),e.scale.x=Math.sqrt(t*t+r*r),e.scale.y=Math.sqrt(n*n+s*s),e.position.x=this.tx+(o.x*t+o.y*n),e.position.y=this.ty+(o.x*r+o.y*s),e}invert(){const e=this.a,t=this.b,r=this.c,i=this.d,n=this.tx,s=e*i-t*r;return this.a=i/s,this.b=-t/s,this.c=-r/s,this.d=e/s,this.tx=(r*this.ty-i*n)/s,this.ty=-(e*this.ty-t*n)/s,this}isIdentity(){return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.tx&&0===this.ty}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new s;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.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 a.identity()}static get shared(){return o.identity()}}const o=new s,a=new s;t.Matrix=s},81955:function(e,t,r){"use strict";var i=r(15685);const n=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],o=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],a=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],l=[],u=[],h=Math.sign;!function(){for(let e=0;e<16;e++){const t=[];l.push(t);for(let r=0;r<16;r++){const i=h(n[e]*n[r]+o[e]*s[r]),l=h(s[e]*n[r]+a[e]*s[r]),u=h(n[e]*o[r]+o[e]*a[r]),c=h(s[e]*o[r]+a[e]*a[r]);for(let e=0;e<16;e++)if(n[e]===i&&s[e]===l&&o[e]===u&&a[e]===c){t.push(e);break}}}for(let e=0;e<16;e++){const t=new i.Matrix;t.set(n[e],s[e],o[e],a[e],0,0),u.push(t)}}();const c={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:e=>n[e],uY:e=>s[e],vX:e=>o[e],vY:e=>a[e],inv:e=>8&e?15&e:7&-e,add:(e,t)=>l[e][t],sub:(e,t)=>l[e][c.inv(t)],rotate180:e=>4^e,isVertical:e=>2==(3&e),byDirection:(e,t)=>2*Math.abs(e)<=Math.abs(t)?t>=0?c.S:c.N:2*Math.abs(t)<=Math.abs(e)?e>0?c.E:c.W:t>0?e>0?c.SE:c.SW:e>0?c.NE:c.NW,matrixAppendRotationInv:(e,t,r=0,i=0)=>{const n=u[c.inv(t)];n.tx=r,n.ty=i,e.append(n)}};t.groupD8=c},2601:function(){},29705:function(e,t){"use strict";const r=2*Math.PI,i=180/Math.PI,n=Math.PI/180;t.DEG_TO_RAD=n,t.PI_2=r,t.RAD_TO_DEG=i},39018:function(e,t){"use strict";t.isPow2=function(e){return!(e&e-1||!e)},t.log2=function(e){let t=(e>65535?1:0)<<4,r=((e>>>=t)>255?1:0)<<3;return t|=r,r=((e>>>=r)>15?1:0)<<2,t|=r,r=((e>>>=r)>3?1:0)<<1,t|=r,t|(e>>>=r)>>1},t.nextPow2=function(e){return e+=0===e?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1}},28985:function(e,t){"use strict";t.squaredDistanceToLineSegment=function(e,t,r,i,n,s){const o=n-r,a=s-i,l=o*o+a*a;let u,h,c=-1;0!==l&&(c=((e-r)*o+(t-i)*a)/l),c<0?(u=r,h=i):c>1?(u=n,h=s):(u=r+c*o,h=i+c*a);const d=e-u,p=t-h;return d*d+p*p}},62792:function(e,t){"use strict";class r{constructor(e,t,r){this._x=t||0,this._y=r||0,this._observer=e}clone(e){return new r(e??this._observer,this._x,this._y)}set(e=0,t=e){return this._x===e&&this._y===t||(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return this._x===e.x&&this._y===e.y||(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}t.ObservablePoint=r},26553:function(e,t){"use strict";class r{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new r(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return i.x=0,i.y=0,i}}const i=new r;t.Point=r},37471:function(){},80643:function(){},27994:function(e,t){"use strict";t.pointInTriangle=function(e,t,r,i,n,s,o,a){const l=o-r,u=a-i,h=n-r,c=s-i,d=e-r,p=t-i,f=l*l+u*u,m=l*h+u*c,g=l*d+u*p,_=h*h+c*c,x=h*d+c*p,b=1/(f*_-m*m),v=(_*g-m*x)*b,y=(f*x-m*g)*b;return v>=0&&y>=0&&v+y<1}},21778:function(e,t,r){"use strict";var i=r(42181);class n{constructor(e=0,t=0,r=0){this.type="circle",this.x=e,this.y=t,this.radius=r}clone(){return new n(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;const r=this.radius*this.radius;let i=this.x-e,n=this.y-t;return i*=i,n*=n,i+n<=r}strokeContains(e,t,r){if(0===this.radius)return!1;const i=this.x-e,n=this.y-t,s=this.radius,o=r/2,a=Math.sqrt(i*i+n*n);return as-o}getBounds(e){return(e=e||new i.Rectangle).x=this.x-this.radius,e.y=this.y-this.radius,e.width=2*this.radius,e.height=2*this.radius,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}t.Circle=n},66736:function(e,t,r){"use strict";var i=r(42181);class n{constructor(e=0,t=0,r=0,i=0){this.type="ellipse",this.x=e,this.y=t,this.halfWidth=r,this.halfHeight=i}clone(){return new n(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let r=(e-this.x)/this.halfWidth,i=(t-this.y)/this.halfHeight;return r*=r,i*=i,r+i<=1}strokeContains(e,t,r){const{halfWidth:i,halfHeight:n}=this;if(i<=0||n<=0)return!1;const s=r/2,o=i-s,a=n-s,l=i+s,u=n+s,h=e-this.x,c=t-this.y;return h*h/(o*o)+c*c/(a*a)>1&&h*h/(l*l)+c*c/(u*u)<=1}getBounds(e){return(e=e||new i.Rectangle).x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=2*this.halfWidth,e.height=2*this.halfHeight,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}t.Ellipse=n},58173:function(e,t,r){"use strict";var i=r(28985),n=r(42181);class s{constructor(...e){this.type="polygon";let t=Array.isArray(e[0])?e[0]:e;if("number"!=typeof t[0]){const e=[];for(let r=0,i=t.length;rt!=l>t&&e<(t-o)/(l-o)*(a-i)+i&&(r=!r)}return r}strokeContains(e,t,r){const n=r/2,s=n*n,{points:o}=this,a=o.length-(this.closePath?0:2);for(let r=0;ri?n:i,s=ao?a:o}return e.x=r,e.width=i-r,e.y=s,e.height=o-s,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce(((e,t)=>`${e}, ${t}`),"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}}t.Polygon=s},42181:function(e,t,r){"use strict";var i=r(26553);const n=[new i.Point,new i.Point,new i.Point,new i.Point];class s{constructor(e=0,t=0,r=0,i=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(r),this.height=Number(i)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new s(0,0,0,0)}clone(){return new s(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return!(this.width<=0||this.height<=0)&&(e>=this.x&&e=this.y&&t=s-r/2&&e<=s+i+r/2&&t>=o-r/2&&t<=o+n+r/2&&!(e>s+r/2&&eo+r/2&&te.right?e.right:this.right)<=t)return!1;const r=this.ye.bottom?e.bottom:this.bottom)>r}const r=this.left,i=this.right,s=this.top,o=this.bottom;if(i<=r||o<=s)return!1;const a=n[0].set(e.left,e.top),l=n[1].set(e.left,e.bottom),u=n[2].set(e.right,e.top),h=n[3].set(e.right,e.bottom);if(u.x<=a.x||l.y<=a.y)return!1;const c=Math.sign(t.a*t.d-t.b*t.c);if(0===c)return!1;if(t.apply(a,a),t.apply(l,l),t.apply(u,u),t.apply(h,h),Math.max(a.x,l.x,u.x,h.x)<=r||Math.min(a.x,l.x,u.x,h.x)>=i||Math.max(a.y,l.y,u.y,h.y)<=s||Math.min(a.y,l.y,u.y,h.y)>=o)return!1;const d=c*(l.y-a.y),p=c*(a.x-l.x),f=d*r+p*s,m=d*i+p*s,g=d*r+p*o,_=d*i+p*o;if(Math.max(f,m,g,_)<=d*a.x+p*a.y||Math.min(f,m,g,_)>=d*h.x+p*h.y)return!1;const x=c*(a.y-u.y),b=c*(u.x-a.x),v=x*r+b*s,y=x*i+b*s,T=x*r+b*o,S=x*i+b*o;return!(Math.max(v,y,T,S)<=x*a.x+b*a.y||Math.min(v,y,T,S)>=x*h.x+b*h.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=2*e,this.height+=2*t,this}fit(e){const t=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),n=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(r-t,0),this.y=i,this.height=Math.max(n-i,0),this}ceil(e=1,t=.001){const r=Math.ceil((this.x+this.width-t)*e)/e,i=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=r-this.x,this.height=i-this.y,this}enlarge(e){const t=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),n=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=r-t,this.y=i,this.height=n-i,this}getBounds(e){return(e=e||new s).copyFrom(this),e}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}t.Rectangle=s},66321:function(e,t,r){"use strict";var i=r(42181);const n=(e,t,r,i,n,s)=>{const o=e-r,a=t-i,l=Math.sqrt(o*o+a*a);return l>=n-s&&l<=n+s};class s{constructor(e=0,t=0,r=0,i=0,n=20){this.type="roundedRectangle",this.x=e,this.y=t,this.width=r,this.height=i,this.radius=n}getBounds(e){return(e=e||new i.Rectangle).x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new s(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){const r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+r&&t<=this.y+this.height-r||e>=this.x+r&&e<=this.x+this.width-r)return!0;let i=e-(this.x+r),n=t-(this.y+r);const s=r*r;if(i*i+n*n<=s)return!0;if(i=e-(this.x+this.width-r),i*i+n*n<=s)return!0;if(n=t-(this.y+this.height-r),i*i+n*n<=s)return!0;if(i=e-(this.x+r),i*i+n*n<=s)return!0}return!1}strokeContains(e,t,r){const{x:i,y:s,width:o,height:a,radius:l}=this,u=r/2,h=i+l,c=s+l,d=i+o,p=s+a;return(e>=i-u&&e<=i+u||e>=d-u&&e<=d+u)&&t>=c&&t<=c+(a-2*l)||((t>=s-u&&t<=s+u||t>=p-u&&t<=p+u)&&e>=h&&e<=h+(o-2*l)||(ed-l&&td-l&&t>p-l&&n(e,t,d-l,p-l,l,u)||ep-l&&n(e,t,h,p-l,l,u)))}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}t.RoundedRectangle=s},51851:function(){},69474:function(e,t,r){"use strict";var i=r(28985),n=r(42181);class s{constructor(e=0,t=0,r=0,i=0,n=0,s=0){this.type="triangle",this.x=e,this.y=t,this.x2=r,this.y2=i,this.x3=n,this.y3=s}contains(e,t){const r=(this.x-this.x3)*(t-this.y3)-(this.y-this.y3)*(e-this.x3),i=(this.x2-this.x)*(t-this.y)-(this.y2-this.y)*(e-this.x);if(r<0!=i<0&&0!==r&&0!==i)return!1;const n=(this.x3-this.x2)*(t-this.y2)-(this.y3-this.y2)*(e-this.x2);return 0===n||n<0==r+i<=0}strokeContains(e,t,r){const n=r/2,s=n*n,{x:o,x2:a,x3:l,y:u,y2:h,y3:c}=this;return i.squaredDistanceToLineSegment(e,t,o,u,a,c)<=s||i.squaredDistanceToLineSegment(e,t,a,h,l,c)<=s||i.squaredDistanceToLineSegment(e,t,l,c,o,u)<=s}clone(){return new s(this.x,this.y,this.x2,this.y2,this.x3,this.y3)}copyFrom(e){return this.x=e.x,this.y=e.y,this.x2=e.x2,this.y2=e.y2,this.x3=e.x3,this.y3=e.y3,this}copyTo(e){return e.copyFrom(this),e}getBounds(e){e=e||new n.Rectangle;const t=Math.min(this.x,this.x2,this.x3),r=Math.max(this.x,this.x2,this.x3),i=Math.min(this.y,this.y2,this.y3),s=Math.max(this.y,this.y2,this.y3);return e.x=t,e.y=i,e.width=r-t,e.height=s-i,e}}t.Triangle=s},73940:function(e,t,r){"use strict";var i=r(74599),n=r(35292),s=r(63983);const o=class e{constructor(t){this._tick=()=>{this.timeout=setTimeout(this._processQueue,0)},this._processQueue=()=>{const{queue:t}=this;let r=0;for(;t.length&&r{this.queue.length?(this.resolves.push(e),this.dedupeQueue(),s.Ticker.system.addOnce(this._tick,this,n.UPDATE_PRIORITY.UTILITY)):e()}))}dedupeQueue(){const e=Object.create(null);let t=0;for(let r=0;r{e.source?t.push(e.source):t.push(e.texture.source)}))}resolveGraphicsContextQueueItem(e){this.renderer.graphicsContext.getContextRenderData(e);const{instructions:t}=e;for(const e of t){if("texture"===e.action){const{image:t}=e.data;return t.source}if("fill"===e.action){const{texture:t}=e.data.style;return t.source}}return null}}t.PrepareQueue=f},72780:function(e,t,r){"use strict";var i=r(17073),n=r(26116);class s extends n.PrepareUpload{destroy(){clearTimeout(this.timeout),this.renderer=null,this.queue=null,this.resolves=null}}s.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem],name:"prepare"},t.PrepareSystem=s},26116:function(e,t,r){"use strict";var i=r(27666),n=r(90537),s=r(62434),o=r(80265),a=r(54125),l=r(3422);class u extends l.PrepareQueue{uploadQueueItem(e){e instanceof i.TextureSource?this.uploadTextureSource(e):e instanceof s.Text?this.uploadText(e):e instanceof a.HTMLText?this.uploadHTMLText(e):e instanceof o.BitmapText?this.uploadBitmapText(e):e instanceof n.GraphicsContext&&this.uploadGraphicsContext(e)}uploadTextureSource(e){this.renderer.texture.initSource(e)}uploadText(e){this.renderer.renderPipes.text.initGpuText(e)}uploadBitmapText(e){this.renderer.renderPipes.bitmapText.initGpuText(e)}uploadHTMLText(e){this.renderer.renderPipes.htmlText.initGpuText(e)}uploadGraphicsContext(e){this.renderer.graphicsContext.getContextRenderData(e);const{instructions:t}=e;for(const e of t)if("texture"===e.action){const{image:t}=e.data;this.uploadTextureSource(t.source)}else if("fill"===e.action){const{texture:t}=e.data.style;this.uploadTextureSource(t.source)}return null}}t.PrepareUpload=u},79878:function(e,t,r){"use strict";var i=r(73940),n=r(3422),s=r(72780),o=r(26116);t.PrepareBase=i.PrepareBase,t.PrepareQueue=n.PrepareQueue,t.PrepareSystem=s.PrepareSystem,t.PrepareUpload=o.PrepareUpload},58578:function(e,t,r){"use strict";var i=r(17073),n=r(55141);class s{constructor(){this._didUpload=!1,this._tempState=n.State.for2d()}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUpload=!1}start(e,t,r){const i=e.renderer;i.shader.bind(r,this._didUpload),i.shader.updateUniformGroup(i.globalUniforms.uniformGroup),i.geometry.bind(t,r.glProgram)}execute(e,t){const r=e.renderer;this._didUpload=!0,this._tempState.blendMode=t.blendMode,r.state.set(this._tempState);const i=t.textures.textures;for(let e=0;e0&&(t+="\nelse "),r>>=0;return o[r]||function(e,t,r){const l={};let u=0;a||(a=s.getMaxTexturesPerBatch());for(let r=0;r0?h[--c]:new u}function p(e){h[c++]=e}let f=0;const m=class e{constructor(t={}){this.uid=i.uid("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],e.defaultOptions.maxTextures=e.defaultOptions.maxTextures??a.getMaxTexturesPerBatch(),t={...e.defaultOptions,...t};const{maxTextures:r,attributesInitialSize:s,indicesInitialSize:o}=t;this.attributeBuffer=new n.ViewableBuffer(4*s),this.indexBuffer=new Uint16Array(o),this.maxTextures=r}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;ethis.attributeBuffer.size&&this._resizeAttributeBuffer(4*this.attributeSize),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const a=this.attributeBuffer.float32View,l=this.attributeBuffer.uint32View,u=this.indexBuffer;let h=this._batchIndexSize,c=this._batchIndexStart,p="startBatch";const m=this.maxTextures;for(let n=this.elementStart;n=m||b)&&(this._finishBatch(r,c,h-c,i,s,e,p),p="renderBatch",c=h,s=x,r=d(),i=r.textures,i.clear(),++f),g._textureId=_._textureBindLocation=i.count,i.ids[_.uid]=i.count,i.textures[i.count++]=_,g._batch=r,h+=g.indexSize,g.packAsQuad?(this.packQuadAttributes(g,a,l,g._attributeStart,g._textureId),this.packQuadIndex(u,g._indexStart,g._attributeStart/this.vertexSize)):(this.packAttributes(g,a,l,g._attributeStart,g._textureId),this.packIndex(g,u,g._indexStart,g._attributeStart/this.vertexSize))):(g._textureId=_._textureBindLocation,h+=g.indexSize,g.packAsQuad?(this.packQuadAttributes(g,a,l,g._attributeStart,g._textureId),this.packQuadIndex(u,g._indexStart,g._attributeStart/this.vertexSize)):(this.packAttributes(g,a,l,g._attributeStart,g._textureId),this.packIndex(g,u,g._indexStart,g._attributeStart/this.vertexSize)),g._batch=r)}i.count>0&&(this._finishBatch(r,c,h-c,i,s,e,p),c=h,++f),this.elementStart=this.elementSize,this._batchIndexStart=c,this._batchIndexSize=h}_finishBatch(e,t,r,i,n,s,o){e.gpuBindGroup=null,e.bindGroup=null,e.action=o,e.batcher=this,e.textures=i,e.blendMode=n,e.start=t,e.size=r,++f,this.batches[this.batchIndex++]=e,s.add(e)}finish(e){this.break(e)}ensureAttributeBuffer(e){4*e<=this.attributeBuffer.size||this._resizeAttributeBuffer(4*e)}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e)}_resizeAttributeBuffer(e){const t=Math.max(e,2*this.attributeBuffer.size),r=new n.ViewableBuffer(t);s.fastCopy(this.attributeBuffer.rawBinaryData,r.rawBinaryData),this.attributeBuffer=r}_resizeIndexBuffer(e){const t=this.indexBuffer;let r=Math.max(e,1.5*t.length);r+=r%2;const i=r>65535?new Uint32Array(r):new Uint16Array(r);if(i.BYTES_PER_ELEMENT!==t.BYTES_PER_ELEMENT)for(let e=0;e(u.has(e)||u.set(e,h++),u.get(e)))).sort(((e,t)=>e-t)).join("-")+e.vertex+e.fragment}function d(e,t,r){const s=n.compileHooks(e),o=n.compileHooks(t);return r.forEach((e=>{i.addBits(e.vertex,s,e.name),i.addBits(e.fragment,o,e.name)})),{vertex:a.injectBits(e,s),fragment:a.injectBits(t,o)}}t.compileHighShader=function({template:e,bits:t}){const r=c(e,t);if(l[r])return l[r];const{vertex:i,fragment:n}=function(e,t){const r=t.map((e=>e.vertex)).filter((e=>!!e)),i=t.map((e=>e.fragment)).filter((e=>!!e));let n=s.compileInputs(r,e.vertex,!0);n=o.compileOutputs(r,n);const a=s.compileInputs(i,e.fragment,!0);return{vertex:n,fragment:a}}(e,t);return l[r]=d(i,n,t),l[r]},t.compileHighShaderGl=function({template:e,bits:t}){const r=c(e,t);return l[r]||(l[r]=d(e.vertex,e.fragment,t)),l[r]}},75817:function(){},58674:function(e,t,r){"use strict";var i=r(95190);t.addBits=function(e,t,r){if(e)for(const n in e){const s=t[n.toLocaleLowerCase()];if(s){let t=e[n];"header"===n&&(t=t.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),r&&s.push(`//----${r}----//`),s.push(t)}else i.warn(`${n} placement hook does not exist in shader`)}}},15183:function(e,t){"use strict";const r=/\{\{(.*?)\}\}/g;t.compileHooks=function(e){const t={};return(e.match(r)?.map((e=>e.replace(/[{()}]/g,"")))??[]).forEach((e=>{t[e]=[]})),t},t.findHooksRx=r},95233:function(e,t){"use strict";function r(e,t){let r;const i=/@in\s+([^;]+);/g;for(;null!==(r=i.exec(e));)t.push(r[1])}t.compileInputs=function(e,t,i=!1){const n=[];r(t,n),e.forEach((e=>{e.header&&r(e.header,n)}));const s=n;i&&s.sort();const o=s.map(((e,t)=>` @location(${t}) ${e},`)).join("\n");let a=t.replace(/@in\s+[^;]+;\s*/g,"");return a=a.replace("{{in}}",`\n${o}\n`),a}},98319:function(e,t){"use strict";function r(e,t){let r;const i=/@out\s+([^;]+);/g;for(;null!==(r=i.exec(e));)t.push(r[1])}t.compileOutputs=function(e,t){const i=[];r(t,i),e.forEach((e=>{e.header&&r(e.header,i)}));let n=0;const s=i.sort().map((e=>e.indexOf("builtin")>-1?e:`@location(${n++}) ${e}`)).join(",\n"),o=i.sort().map((e=>{return` var ${t=e,t.replace(/@.*?\s+/g,"")};`;var t})).join("\n"),a=`return VSOutput(\n ${i.sort().map((e=>` ${function(e){const t=/\b(\w+)\s*:/g.exec(e);return t?t[1]:""}(e)}`)).join(",\n")});`;let l=t.replace(/@out\s+[^;]+;\s*/g,"");return l=l.replace("{{struct}}",`\n${s}\n`),l=l.replace("{{start}}",`\n${o}\n`),l=l.replace("{{return}}",`\n${a}\n`),l}},11206:function(e,t){"use strict";t.formatShader=function(e){const t=e.split(/([\n{}])/g).map((e=>e.trim())).filter((e=>e.length));let r="";return t.map((e=>{let t=r+e;return"{"===e?r+=" ":"}"===e&&(r=r.substr(0,r.length-4),t=r+e),t})).join("\n")}},60079:function(e,t){"use strict";t.injectBits=function(e,t){let r=e;for(const e in t){const i=t[e];r=i.join("\n").length?r.replace(`{{${e}}}`,`//-----${e} START-----//\n${i.join("\n")}\n//----${e} FINISH----//`):r.replace(`{{${e}}}`,"")}return r}},59615:function(e,t){"use strict";t.fragmentGPUTemplate="\n @in vUV : vec2;\n @in vColor : vec4;\n \n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4 {\n \n {{start}}\n\n var outColor:vec4;\n \n {{main}}\n \n var finalColor:vec4 = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n",t.fragmentGlTemplate="\n \n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n \n {{start}}\n\n vec4 outColor;\n \n {{main}}\n \n finalColor = outColor * vColor;\n \n {{end}}\n }\n",t.vertexGPUTemplate="\n @in aPosition: vec2;\n @in aUV: vec2;\n\n @out @builtin(position) vPosition: vec4;\n @out vUV : vec2;\n @out vColor : vec4;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n \n vColor = vec4(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n \n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n",t.vertexGlTemplate="\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n vec2 position = aPosition;\n vec2 uv = aUV;\n \n {{start}}\n \n vColor = vec4(1.);\n \n {{main}}\n \n vUV = uv;\n \n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n"},84215:function(e,t){"use strict";const r={name:"color-bit",vertex:{header:"\n @in aColor: vec4;\n ",main:"\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n "}},i={name:"color-bit",vertex:{header:"\n in vec4 aColor;\n ",main:"\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n "}};t.colorBit=r,t.colorBitGl=i},19209:function(e,t){"use strict";const r={};function i(e){const t=[];if(1===e)t.push("@group(1) @binding(0) var textureSource1: texture_2d;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let r=0;for(let i=0;i;`),t.push(`@group(1) @binding(${r++}) var textureSampler${i+1}: sampler;`)}return t.join("\n")}function n(e){const t=[];if(1===e)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let r=0;r0&&t.push("else"),r;\n @out @interpolate(flat) vTextureId : u32;\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "},fragment:{header:`\n @in @interpolate(flat) vTextureId: u32;\n\n ${i(e)}\n `,main:`\n var uvDx = dpdx(vUV);\n var uvDy = dpdy(vUV);\n\n ${n(e)}\n `}}),r[e]},t.generateTextureBatchBitGl=function(e){return s[e]||(s[e]={name:"texture-batch-bit",vertex:{header:"\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "},fragment:{header:`\n in float vTextureId;\n\n uniform sampler2D uTextures[${e}];\n\n `,main:`\n\n ${o(e)}\n `}}),s[e]}},39320:function(e,t){"use strict";const r={name:"global-uniforms-bit",vertex:{header:"\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3,\n uWorldTransformMatrix:mat3x3,\n uWorldColorAlpha: vec4,\n uResolution: vec2,\n }\n\n @group(0) @binding(0) var globalUniforms : GlobalUniforms;\n "}},i={name:"global-uniforms-ubo-bit",vertex:{header:"\n uniform globalUniforms {\n mat3 uProjectionMatrix;\n mat3 uWorldTransformMatrix;\n vec4 uWorldColorAlpha;\n vec2 uResolution;\n };\n "}},n={name:"global-uniforms-bit",vertex:{header:"\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n "}};t.globalUniformsBit=r,t.globalUniformsBitGl=n,t.globalUniformsUBOBitGl=i},74813:function(e,t){"use strict";const r={name:"local-uniform-bit",vertex:{header:"\n\n struct LocalUniforms {\n uTransformMatrix:mat3x3,\n uColor:vec4,\n uRound:f32,\n }\n\n @group(1) @binding(0) var localUniforms : LocalUniforms;\n ",main:"\n vColor *= localUniforms.uColor;\n modelMatrix *= localUniforms.uTransformMatrix;\n ",end:"\n if(localUniforms.uRound == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "}},i={...r,vertex:{...r.vertex,header:r.vertex.header.replace("group(1)","group(2)")}},n={name:"local-uniform-bit",vertex:{header:"\n\n uniform mat3 uTransformMatrix;\n uniform vec4 uColor;\n uniform float uRound;\n ",main:"\n vColor *= uColor;\n modelMatrix = uTransformMatrix;\n ",end:"\n if(uRound == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "}};t.localUniformBit=r,t.localUniformBitGl=n,t.localUniformBitGroup2=i},4116:function(e,t){"use strict";const r={name:"round-pixels-bit",vertex:{header:"\n fn roundPixels(position: vec2, targetSize: vec2) -> vec2 \n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}},i={name:"round-pixels-bit",vertex:{header:" \n vec2 roundPixels(vec2 position, vec2 targetSize)\n { \n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}};t.roundPixelsBit=r,t.roundPixelsBitGl=i},36114:function(e,t){"use strict";const r={name:"texture-bit",vertex:{header:"\n\n struct TextureUniforms {\n uTextureMatrix:mat3x3,\n }\n\n @group(2) @binding(2) var textureUniforms : TextureUniforms;\n ",main:"\n uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;\n "},fragment:{header:"\n @group(2) @binding(0) var uTexture: texture_2d;\n @group(2) @binding(1) var uSampler: sampler;\n\n \n ",main:"\n outColor = textureSample(uTexture, uSampler, vUV);\n "}},i={name:"texture-bit",vertex:{header:"\n uniform mat3 uTextureMatrix;\n ",main:"\n uv = (uTextureMatrix * vec3(uv, 1.0)).xy;\n "},fragment:{header:"\n uniform sampler2D uTexture;\n\n \n ",main:"\n outColor = texture(uTexture, vUV);\n "}};t.textureBit=r,t.textureBitGl=i},12878:function(e,t,r){"use strict";var i=r(58578),n=r(51719),s=r(1766),o=r(93154),a=r(72459),l=r(33388),u=r(9803),h=r(87866),c=r(33961),d=r(23254),p=r(74404),f=r(99821),m=r(33304),g=r(21380),_=r(42403);r(75817);var x=r(58674),b=r(15183),v=r(95233),y=r(98319),T=r(11206),S=r(60079),E=r(59615),w=r(84215),A=r(19209),M=r(39320),P=r(74813),R=r(4116),C=r(36114),B=r(48718),G=r(14673),F=r(50020),D=r(62579),I=r(81480),O=r(32258),U=r(99022),k=r(33648),L=r(38782),N=r(17957),V=r(4722),H=r(85520),X=r(3839),z=r(7540),W=r(32985),Y=r(36351);r(39711),r(39996);var j=r(96307),$=r(90493),q=r(42026),K=r(57066),Q=r(79211),Z=r(45769),J=r(50264),ee=r(4308),te=r(9779),re=r(54346);r(26156);var ie=r(65706),ne=r(9488),se=r(62991),oe=r(94230),ae=r(2071),le=r(53864),ue=r(49245),he=r(27124),ce=r(32377),de=r(71820),pe=r(61913),fe=r(3480),me=r(3871),ge=r(51525),_e=r(51895),xe=r(6887),be=r(19336),ve=r(86380),ye=r(44135),Te=r(9778),Se=r(4023),Ee=r(77944),we=r(48142),Ae=r(3553),Me=r(98121),Pe=r(90708),Re=r(40074),Ce=r(66171),Be=r(8279),Ge=r(93199),Fe=r(40655),De=r(30290),Ie=r(52470),Oe=r(62123);r(96157);var Ue=r(35416),ke=r(82953),Le=r(75705),Ne=r(53321),Ve=r(88588),He=r(84157),Xe=r(5020),ze=r(51727),We=r(16310),Ye=r(59758),je=r(7358),$e=r(61435),qe=r(98826),Ke=r(71901),Qe=r(40736),Ze=r(30679),Je=r(61265),et=r(65586),tt=r(32920),rt=r(96150),it=r(4812),nt=r(93812),st=r(50967),ot=r(91428),at=r(86136),lt=r(9143),ut=r(24628),ht=r(83582);r(1805);var ct=r(50543),dt=r(25947),pt=r(41036),ft=r(84214),mt=r(29926),gt=r(16126),_t=r(1513),xt=r(80863),bt=r(47242),vt=r(79320),yt=r(53299),Tt=r(81242),St=r(36826),Et=r(56042);r(83040);var wt=r(97394),At=r(1956),Mt=r(37135),Pt=r(2766),Rt=r(43213),Ct=r(87929),Bt=r(69264),Gt=r(6852),Ft=r(69862),Dt=r(21839),It=r(1793),Ot=r(18919),Ut=r(70766),kt=r(95041),Lt=r(42310),Nt=r(80163),Vt=r(33829),Ht=r(44307),Xt=r(84026),zt=r(52783),Wt=r(14740),Yt=r(54132);r(37758);var jt=r(31540);r(16085),r(42725);var $t=r(54572),qt=r(11987),Kt=r(33764),Qt=r(16952),Zt=r(3695),Jt=r(24510),er=r(19450),tr=r(97505);r(80505);var rr=r(21384),ir=r(6864),nr=r(65518),sr=r(1021),or=r(90887),ar=r(63981),lr=r(46876),ur=r(22334),hr=r(56445),cr=r(254),dr=r(55141),pr=r(95931),fr=r(62856);r(79480);var mr=r(17627);r(17885);var gr=r(60932),_r=r(6121);r(76349);var xr=r(56225),br=r(32064),vr=r(4720),yr=r(91525),Tr=r(68651),Sr=r(75813),Er=r(27666),wr=r(62480),Ar=r(84463),Mr=r(95224),Pr=r(94058),Rr=r(38759),Cr=r(44174),Br=r(92756),Gr=r(95026),Fr=r(40190),Dr=r(34155),Ir=r(55484),Or=r(39394),Ur=r(6066),kr=r(60527);r(27571);var Lr=r(80177),Nr=r(2559);t.GlBatchAdaptor=i.GlBatchAdaptor,t.checkMaxIfStatementsInShader=n.checkMaxIfStatementsInShader,t.getMaxTexturesPerBatch=s.getMaxTexturesPerBatch,t.generateGPULayout=o.generateGPULayout,t.generateLayout=a.generateLayout,t.getTextureBatchBindGroup=l.getTextureBatchBindGroup,t.GpuBatchAdaptor=u.GpuBatchAdaptor,t.Batch=h.Batch,t.Batcher=h.Batcher,t.BatcherPipe=c.BatcherPipe,t.BatchGeometry=d.BatchGeometry,t.BatchTextureArray=p.BatchTextureArray,t.DefaultBatcher=f.DefaultBatcher,t.DefaultShader=m.DefaultShader,t.compileHighShaderGlProgram=g.compileHighShaderGlProgram,t.compileHighShaderGpuProgram=g.compileHighShaderGpuProgram,t.compileHighShader=_.compileHighShader,t.compileHighShaderGl=_.compileHighShaderGl,t.addBits=x.addBits,t.compileHooks=b.compileHooks,t.findHooksRx=b.findHooksRx,t.compileInputs=v.compileInputs,t.compileOutputs=y.compileOutputs,t.formatShader=T.formatShader,t.injectBits=S.injectBits,t.fragmentGPUTemplate=E.fragmentGPUTemplate,t.fragmentGlTemplate=E.fragmentGlTemplate,t.vertexGPUTemplate=E.vertexGPUTemplate,t.vertexGlTemplate=E.vertexGlTemplate,t.colorBit=w.colorBit,t.colorBitGl=w.colorBitGl,t.generateTextureBatchBit=A.generateTextureBatchBit,t.generateTextureBatchBitGl=A.generateTextureBatchBitGl,t.globalUniformsBit=M.globalUniformsBit,t.globalUniformsBitGl=M.globalUniformsBitGl,t.globalUniformsUBOBitGl=M.globalUniformsUBOBitGl,t.localUniformBit=P.localUniformBit,t.localUniformBitGl=P.localUniformBitGl,t.localUniformBitGroup2=P.localUniformBitGroup2,t.roundPixelsBit=R.roundPixelsBit,t.roundPixelsBitGl=R.roundPixelsBitGl,t.textureBit=C.textureBit,t.textureBitGl=C.textureBitGl,t.AlphaMask=B.AlphaMask,t.AlphaMaskPipe=G.AlphaMaskPipe,t.ColorMask=F.ColorMask,t.ColorMaskPipe=D.ColorMaskPipe,t.MaskEffectManager=I.MaskEffectManager,t.MaskEffectManagerClass=I.MaskEffectManagerClass,t.ScissorMask=O.ScissorMask,t.StencilMask=U.StencilMask,t.StencilMaskPipe=k.StencilMaskPipe,t.addMaskBounds=L.addMaskBounds,t.addMaskLocalBounds=N.addMaskLocalBounds,t.getMatrixRelativeToParent=N.getMatrixRelativeToParent,t.autoDetectRenderer=V.autoDetectRenderer,t.BUFFER_TYPE=H.BUFFER_TYPE,t.GlBuffer=X.GlBuffer,t.GlBufferSystem=z.GlBufferSystem,t.CLEAR=W.CLEAR,t.GlContextSystem=Y.GlContextSystem,t.GlGeometrySystem=j.GlGeometrySystem,t.getGlTypeFromFormat=$.getGlTypeFromFormat,t.GlBackBufferSystem=q.GlBackBufferSystem,t.GlColorMaskSystem=K.GlColorMaskSystem,t.GlEncoderSystem=Q.GlEncoderSystem,t.GlRenderTarget=Z.GlRenderTarget,t.GlStencilSystem=J.GlStencilSystem,t.GlUboSystem=ee.GlUboSystem,t.GlRenderTargetAdaptor=te.GlRenderTargetAdaptor,t.GlRenderTargetSystem=re.GlRenderTargetSystem,t.generateShaderSyncCode=ie.generateShaderSyncCode,t.getBatchSamplersUniformGroup=ne.getBatchSamplersUniformGroup,t.GlProgram=se.GlProgram,t.GlProgramData=oe.GlProgramData,t.IGLUniformData=oe.IGLUniformData,t.GlShaderSystem=ae.GlShaderSystem,t.GlUniformGroupSystem=le.GlUniformGroupSystem,t.migrateFragmentFromV7toV8=ue.migrateFragmentFromV7toV8,t.compileShader=he.compileShader,t.defaultValue=ce.defaultValue,t.ensureAttributes=de.ensureAttributes,t.extractAttributesFromGlProgram=pe.extractAttributesFromGlProgram,t.generateProgram=fe.generateProgram,t.getMaxFragmentPrecision=me.getMaxFragmentPrecision,t.getTestContext=ge.getTestContext,t.getUboData=_e.getUboData,t.getUniformData=xe.getUniformData,t.logProgramError=be.logProgramError,t.mapSize=ve.mapSize,t.mapGlToVertexFormat=ye.mapGlToVertexFormat,t.mapType=ye.mapType,t.addProgramDefines=Te.addProgramDefines,t.ensurePrecision=Se.ensurePrecision,t.insertVersion=Ee.insertVersion,t.setProgramName=we.setProgramName,t.stripVersion=Ae.stripVersion,t.WGSL_TO_STD40_SIZE=Me.WGSL_TO_STD40_SIZE,t.createUboElementsSTD40=Me.createUboElementsSTD40,t.createUboSyncFunctionSTD40=Pe.createUboSyncFunctionSTD40,t.generateArraySyncSTD40=Re.generateArraySyncSTD40,t.generateUniformsSync=Ce.generateUniformsSync,t.UNIFORM_TO_ARRAY_SETTERS=Be.UNIFORM_TO_ARRAY_SETTERS,t.UNIFORM_TO_SINGLE_SETTERS=Be.UNIFORM_TO_SINGLE_SETTERS,t.GlStateSystem=Ge.GlStateSystem,t.mapWebGLBlendModesToPixi=Fe.mapWebGLBlendModesToPixi,t.GL_FORMATS=De.GL_FORMATS,t.GL_TARGETS=De.GL_TARGETS,t.GL_TYPES=De.GL_TYPES,t.GL_WRAP_MODES=De.GL_WRAP_MODES,t.GlTexture=Ie.GlTexture,t.GlTextureSystem=Oe.GlTextureSystem,t.glUploadBufferImageResource=Ue.glUploadBufferImageResource,t.glUploadCompressedTextureResource=ke.glUploadCompressedTextureResource,t.glUploadImageResource=Le.glUploadImageResource,t.glUploadVideoResource=Ne.glUploadVideoResource,t.applyStyleParams=Ve.applyStyleParams,t.getSupportedGlCompressedTextureFormats=He.getSupportedGlCompressedTextureFormats,t.mapFormatToGlFormat=Xe.mapFormatToGlFormat,t.mapFormatToGlInternalFormat=ze.mapFormatToGlInternalFormat,t.mapFormatToGlType=We.mapFormatToGlType,t.compareModeToGlCompare=Ye.compareModeToGlCompare,t.mipmapScaleModeToGlFilter=Ye.mipmapScaleModeToGlFilter,t.scaleModeToGlFilter=Ye.scaleModeToGlFilter,t.wrapModeToGlAddress=Ye.wrapModeToGlAddress,t.unpremultiplyAlpha=je.unpremultiplyAlpha,t.WebGLRenderer=$e.WebGLRenderer,t.BindGroupSystem=qe.BindGroupSystem,t.GpuBufferSystem=Ke.GpuBufferSystem,t.GpuReadBuffer=Qe.GpuReadBuffer,t.UboBatch=Ze.UboBatch,t.GpuColorMaskSystem=Je.GpuColorMaskSystem,t.GpuDeviceSystem=et.GpuDeviceSystem,t.GpuEncoderSystem=tt.GpuEncoderSystem,t.GpuStencilSystem=rt.GpuStencilSystem,t.GpuUboSystem=it.GpuUboSystem,t.GpuUniformBatchPipe=nt.GpuUniformBatchPipe,t.PipelineSystem=st.PipelineSystem,t.calculateProjection=ot.calculateProjection,t.GpuRenderTarget=at.GpuRenderTarget,t.GpuRenderTargetAdaptor=lt.GpuRenderTargetAdaptor,t.GpuRenderTargetSystem=ut.GpuRenderTargetSystem,t.BindGroup=ht.BindGroup,t.GpuProgram=ct.GpuProgram,t.GpuShaderSystem=dt.GpuShaderSystem,t.WGSL_ALIGN_SIZE_DATA=pt.WGSL_ALIGN_SIZE_DATA,t.createUboElementsWGSL=pt.createUboElementsWGSL,t.createUboSyncFunctionWGSL=ft.createUboSyncFunctionWGSL,t.extractAttributesFromGpuProgram=mt.extractAttributesFromGpuProgram,t.extractStructAndGroups=gt.extractStructAndGroups,t.generateArraySyncWGSL=_t.generateArraySyncWGSL,t.generateGpuLayoutGroups=xt.generateGpuLayoutGroups,t.generateLayoutHash=bt.generateLayoutHash,t.removeStructAndGroupDuplicates=vt.removeStructAndGroupDuplicates,t.GpuBlendModesToPixi=yt.GpuBlendModesToPixi,t.GpuStateSystem=Tt.GpuStateSystem,t.GpuStencilModesToPixi=St.GpuStencilModesToPixi,t.GpuTextureSystem=Et.GpuTextureSystem,t.gpuUploadBufferImageResource=wt.gpuUploadBufferImageResource,t.blockDataMap=At.blockDataMap,t.gpuUploadCompressedTextureResource=At.gpuUploadCompressedTextureResource,t.gpuUploadImageResource=Mt.gpuUploadImageResource,t.gpuUploadVideoResource=Pt.gpuUploadVideoResource,t.getSupportedGPUCompressedTextureFormats=Rt.getSupportedGPUCompressedTextureFormats,t.GpuMipmapGenerator=Ct.GpuMipmapGenerator,t.WebGPURenderer=Bt.WebGPURenderer,t.BackgroundSystem=Gt.BackgroundSystem,t.BlendModePipe=Ft.BlendModePipe,t.Buffer=Dt.Buffer,t.BufferResource=It.BufferResource,t.BufferUsage=Ot.BufferUsage,t.fastCopy=Ut.fastCopy,t.ExtractSystem=kt.ExtractSystem,t.GenerateTextureSystem=Lt.GenerateTextureSystem,t.DRAW_MODES=Nt.DRAW_MODES,t.Geometry=Vt.Geometry,t.buildSimpleUvs=Ht.buildSimpleUvs,t.buildUvs=Ht.buildUvs,t.ensureIsBuffer=Xt.ensureIsBuffer,t.getAttributeInfoFromFormat=zt.getAttributeInfoFromFormat,t.getGeometryBounds=Wt.getGeometryBounds,t.transformVertices=Yt.transformVertices,t.InstructionSet=jt.InstructionSet,t.GlobalUniformSystem=$t.GlobalUniformSystem,t.isRenderingToScreen=qt.isRenderingToScreen,t.RenderTarget=Kt.RenderTarget,t.RenderTargetSystem=Qt.RenderTargetSystem,t.viewportFromFrame=Zt.viewportFromFrame,t.SchedulerSystem=Jt.SchedulerSystem,t.ShaderStage=er.ShaderStage,t.Shader=tr.Shader,t.UNIFORM_TYPES_MAP=rr.UNIFORM_TYPES_MAP,t.UNIFORM_TYPES_VALUES=rr.UNIFORM_TYPES_VALUES,t.UboSystem=ir.UboSystem,t.UniformGroup=nr.UniformGroup,t.createUboSyncFunction=sr.createUboSyncFunction,t.getDefaultUniformValue=or.getDefaultUniformValue,t.uboSyncFunctionsSTD40=ar.uboSyncFunctionsSTD40,t.uboSyncFunctionsWGSL=ar.uboSyncFunctionsWGSL,t.uniformParsers=lr.uniformParsers,t.HelloSystem=ur.HelloSystem,t.BLEND_TO_NPM=hr.BLEND_TO_NPM,t.STENCIL_MODES=hr.STENCIL_MODES,t.getAdjustedBlendModeBlend=cr.getAdjustedBlendModeBlend,t.State=dr.State,t.AbstractRenderer=pr.AbstractRenderer,t.SharedRenderPipes=fr.SharedRenderPipes,t.SharedSystems=fr.SharedSystems,t.SystemRunner=mr.SystemRunner,t.CanvasPool=gr.CanvasPool,t.CanvasPoolClass=gr.CanvasPoolClass,t.DEPRECATED_SCALE_MODES=_r.DEPRECATED_SCALE_MODES,t.DEPRECATED_WRAP_MODES=_r.DEPRECATED_WRAP_MODES,t.MSAA_QUALITY=_r.MSAA_QUALITY,t.SCALE_MODES=_r.SCALE_MODES,t.WRAP_MODES=_r.WRAP_MODES,t.RenderableGCSystem=xr.RenderableGCSystem,t.RenderTexture=br.RenderTexture,t.BufferImageSource=vr.BufferImageSource,t.CanvasSource=yr.CanvasSource,t.CompressedSource=Tr.CompressedSource,t.ImageSource=Sr.ImageSource,t.TextureSource=Er.TextureSource,t.VideoSource=wr.VideoSource,t.Texture=Ar.Texture,t.TextureGCSystem=Mr.TextureGCSystem,t.TextureMatrix=Pr.TextureMatrix,t.TexturePool=Rr.TexturePool,t.TexturePoolClass=Rr.TexturePoolClass,t.TextureStyle=Cr.TextureStyle,t.TextureUvs=Br.TextureUvs,t.generateUID=Gr.generateUID,t.getCanvasTexture=Fr.getCanvasTexture,t.hasCachedCanvasTexture=Fr.hasCachedCanvasTexture,t.getSupportedCompressedTextureFormats=Dr.getSupportedCompressedTextureFormats,t.getSupportedTextureFormats=Ir.getSupportedTextureFormats,t.nonCompressedFormats=Ir.nonCompressedFormats,t.autoDetectSource=Or.autoDetectSource,t.resourceToTexture=Or.resourceToTexture,t.textureFrom=Or.textureFrom,t.createIdFromString=Ur.createIdFromString,t.parseFunctionBody=kr.parseFunctionBody,t.ViewSystem=Lr.ViewSystem,t.RendererType=Nr.RendererType},55063:function(e,t,r){"use strict";var i=r(17073),n=r(48718),s=r(50020),o=r(99022),a=r(4720),l=r(91525),u=r(75813),h=r(62480);r(39394),r(81480),i.extensions.add(n.AlphaMask,s.ColorMask,o.StencilMask,h.VideoSource,u.ImageSource,l.CanvasSource,a.BufferImageSource)},81480:function(e,t,r){"use strict";var i=r(17073),n=r(86169);class s{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach((e=>{this.add({test:e.test,maskClass:e})})))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let t=0;t{t!==e.preference&&a.push(t)}))):a=o.slice();let l={};for(let o=0;o=e.data.byteLength)t.bufferSubData(r.type,0,i,0,e._updateSize/i.BYTES_PER_ELEMENT);else{const s=e.descriptor.usage&n.BufferUsage.STATIC?t.STATIC_DRAW:t.DYNAMIC_DRAW;r.byteLength=i.byteLength,t.bufferData(r.type,i,s)}return r}destroyAll(){const e=this._gl;for(const t in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[t].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,t){const r=this._gpuBuffers[e.uid],i=this._gl;t||i.deleteBuffer(r.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:t}=this;let r=s.BUFFER_TYPE.ARRAY_BUFFER;e.descriptor.usage&n.BufferUsage.INDEX?r=s.BUFFER_TYPE.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&n.BufferUsage.UNIFORM&&(r=s.BUFFER_TYPE.UNIFORM_BUFFER);const i=new o.GlBuffer(t.createBuffer(),r);return this._gpuBuffers[e.uid]=i,e.on("destroy",this.onBufferDestroy,this),i}}a.extension={type:[i.ExtensionType.WebGLSystem],name:"buffer"},t.GlBufferSystem=a},85520:function(e,t){"use strict";var r=(e=>(e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e))(r||{});t.BUFFER_TYPE=r},32985:function(e,t){"use strict";var r=(e=>(e[e.NONE=0]="NONE",e[e.COLOR=16384]="COLOR",e[e.STENCIL=1024]="STENCIL",e[e.DEPTH=256]="DEPTH",e[e.COLOR_DEPTH=16640]="COLOR_DEPTH",e[e.COLOR_STENCIL=17408]="COLOR_STENCIL",e[e.DEPTH_STENCIL=1280]="DEPTH_STENCIL",e[e.ALL=17664]="ALL",e))(r||{});t.CLEAR=r},36351:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(95190);const o=class e{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(t){t={...e.defaultOptions,...t};let r=this.multiView=t.multiView;if(t.context&&r&&(s.warn("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),this.canvas=r?i.DOMAdapter.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this._renderer.view.canvas,t.context)this.initFromContext(t.context);else{const e=this._renderer.background.alpha<1,r=t.premultipliedAlpha??!0,i=t.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(t.preferWebGLVersion,{alpha:e,premultipliedAlpha:r,antialias:i,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView)return void(e!==this.canvas&&s.warn("multiView is disabled, but targetCanvas is not the main canvas"));const{canvas:t}=this;(t.width{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()}),0))}handleContextRestored(){this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const t=e.getContextAttributes();t&&!t.stencil&&s.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const r=this.supports,i=2===this.webGLVersion,n=this.extensions;r.uint32Indices=i||!!n.uint32ElementIndex,r.uniformBufferObject=i,r.vertexArrayObject=i||!!n.vertexArrayObject,r.srgbTextures=i||!!n.srgb,r.nonPowOf2wrapping=i,r.nonPowOf2mipmaps=i,r.msaa=i,r.uint32Indices||s.warn("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};o.extension={type:[n.ExtensionType.WebGLSystem],name:"context"},o.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let a=o;t.GlContextSystem=a},39711:function(){},39996:function(){},96307:function(e,t,r){"use strict";var i=r(17073),n=r(52783),s=r(71820),o=r(90493);const a={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class l{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const t=this._renderer.context.extensions.vertexArrayObject;t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.bindVertexArray=e=>t.bindVertexArrayOES(e),e.deleteVertexArray=e=>t.deleteVertexArrayOES(e));const r=this._renderer.context.extensions.vertexAttribDivisorANGLE;r&&(e.drawArraysInstanced=(e,t,i,n)=>{r.drawArraysInstancedANGLE(e,t,i,n)},e.drawElementsInstanced=(e,t,i,n,s)=>{r.drawElementsInstancedANGLE(e,t,i,n,s)},e.vertexAttribDivisor=(e,t)=>r.vertexAttribDivisorANGLE(e,t)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,t){const r=this.gl;this._activeGeometry=e;const i=this.getVao(e,t);this._activeVao!==i&&(this._activeVao=i,r.bindVertexArray(i)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,t=this._renderer.buffer;for(let r=0;r1?n.drawElementsInstanced(o,t||s.indexBuffer.data.length,a,(r||0)*e,i):n.drawElements(o,t||s.indexBuffer.data.length,a,(r||0)*e)}else i>1?n.drawArraysInstanced(o,r||0,t||s.getSize(),i):n.drawArrays(o,r||0,t||s.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}l.extension={type:[i.ExtensionType.WebGLSystem],name:"geometry"},t.GlGeometrySystem=l},90493:function(e,t,r){"use strict";var i=r(30290);const n={uint8x2:i.GL_TYPES.UNSIGNED_BYTE,uint8x4:i.GL_TYPES.UNSIGNED_BYTE,sint8x2:i.GL_TYPES.BYTE,sint8x4:i.GL_TYPES.BYTE,unorm8x2:i.GL_TYPES.UNSIGNED_BYTE,unorm8x4:i.GL_TYPES.UNSIGNED_BYTE,snorm8x2:i.GL_TYPES.BYTE,snorm8x4:i.GL_TYPES.BYTE,uint16x2:i.GL_TYPES.UNSIGNED_SHORT,uint16x4:i.GL_TYPES.UNSIGNED_SHORT,sint16x2:i.GL_TYPES.SHORT,sint16x4:i.GL_TYPES.SHORT,unorm16x2:i.GL_TYPES.UNSIGNED_SHORT,unorm16x4:i.GL_TYPES.UNSIGNED_SHORT,snorm16x2:i.GL_TYPES.SHORT,snorm16x4:i.GL_TYPES.SHORT,float16x2:i.GL_TYPES.HALF_FLOAT,float16x4:i.GL_TYPES.HALF_FLOAT,float32:i.GL_TYPES.FLOAT,float32x2:i.GL_TYPES.FLOAT,float32x3:i.GL_TYPES.FLOAT,float32x4:i.GL_TYPES.FLOAT,uint32:i.GL_TYPES.UNSIGNED_INT,uint32x2:i.GL_TYPES.UNSIGNED_INT,uint32x3:i.GL_TYPES.UNSIGNED_INT,uint32x4:i.GL_TYPES.UNSIGNED_INT,sint32:i.GL_TYPES.INT,sint32x2:i.GL_TYPES.INT,sint32x3:i.GL_TYPES.INT,sint32x4:i.GL_TYPES.INT};t.getGlTypeFromFormat=function(e){return n[e]??n.float32}},9779:function(e,t,r){"use strict";var i=r(42181),n=r(95190),s=r(91525),o=r(32985),a=r(45769);t.GlRenderTargetAdaptor=class{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new i.Rectangle}init(e,t){this._renderer=e,this._renderTargetSystem=t,e.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new i.Rectangle}copyToTexture(e,t,r,i,n){const s=this._renderTargetSystem,o=this._renderer,a=s.getGpuRenderTarget(e),l=o.gl;return this.finishRenderPass(e),l.bindFramebuffer(l.FRAMEBUFFER,a.resolveTargetFramebuffer),o.texture.bind(t,0),l.copyTexSubImage2D(l.TEXTURE_2D,0,n.x,n.y,r.x,r.y,i.width,i.height),t}startRenderPass(e,t=!0,r,i){const n=this._renderTargetSystem,s=e.colorTexture,o=n.getGpuRenderTarget(e);let a=i.y;e.isRoot&&(a=s.pixelHeight-i.height),e.colorTextures.forEach((e=>{this._renderer.texture.unbind(e)}));const l=this._renderer.gl;l.bindFramebuffer(l.FRAMEBUFFER,o.framebuffer);const u=this._viewPortCache;u.x===i.x&&u.y===a&&u.width===i.width&&u.height===i.height||(u.x=i.x,u.y=a,u.width=i.width,u.height=i.height,l.viewport(i.x,a,i.width,i.height)),o.depthStencilRenderBuffer||!e.stencil&&!e.depth||this._initStencil(o),this.clear(e,t,r)}finishRenderPass(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);if(!t.msaa)return;const r=this._renderer.gl;r.bindFramebuffer(r.FRAMEBUFFER,t.resolveTargetFramebuffer),r.bindFramebuffer(r.READ_FRAMEBUFFER,t.framebuffer),r.blitFramebuffer(0,0,t.width,t.height,0,0,t.width,t.height,r.COLOR_BUFFER_BIT,r.NEAREST),r.bindFramebuffer(r.FRAMEBUFFER,t.framebuffer)}initGpuRenderTarget(e){const t=this._renderer.gl,r=new a.GlRenderTarget,i=e.colorTexture;return s.CanvasSource.test(i.resource)?(this._renderer.context.ensureCanvasSize(e.colorTexture.resource),r.framebuffer=null,r):(this._initColor(e,r),t.bindFramebuffer(t.FRAMEBUFFER,null),r)}destroyGpuRenderTarget(e){const t=this._renderer.gl;e.framebuffer&&(t.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(t.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(t.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach((e=>{t.deleteRenderbuffer(e)})),e.msaaRenderBuffer=null}clear(e,t,r){if(!t)return;const i=this._renderTargetSystem;"boolean"==typeof t&&(t=t?o.CLEAR.ALL:o.CLEAR.NONE);const n=this._renderer.gl;if(t&o.CLEAR.COLOR){r??(r=i.defaultClearColor);const e=this._clearColorCache,t=r;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]||(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],n.clearColor(t[0],t[1],t[2],t[3]))}n.clear(t)}resizeGpuRenderTarget(e){if(e.isRoot)return;const t=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,t),(e.stencil||e.depth)&&this._resizeStencil(t)}_initColor(e,t){const r=this._renderer,i=r.gl,s=i.createFramebuffer();if(t.resolveTargetFramebuffer=s,i.bindFramebuffer(i.FRAMEBUFFER,s),t.width=e.colorTexture.source.pixelWidth,t.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach(((e,s)=>{const o=e.source;o.antialias&&(r.context.supports.msaa?t.msaa=!0:n.warn("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),r.texture.bindSource(o,0);const a=r.texture.getGlSource(o).texture;i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+s,3553,a,0)})),t.msaa){const r=i.createFramebuffer();t.framebuffer=r,i.bindFramebuffer(i.FRAMEBUFFER,r),e.colorTextures.forEach(((e,r)=>{const n=i.createRenderbuffer();t.msaaRenderBuffer[r]=n}))}else t.framebuffer=s;this._resizeColor(e,t)}_resizeColor(e,t){const r=e.colorTexture.source;if(t.width=r.pixelWidth,t.height=r.pixelHeight,e.colorTextures.forEach(((e,t)=>{0!==t&&e.source.resize(r.width,r.height,r._resolution)})),t.msaa){const r=this._renderer,i=r.gl,n=t.framebuffer;i.bindFramebuffer(i.FRAMEBUFFER,n),e.colorTextures.forEach(((e,n)=>{const s=e.source;r.texture.bindSource(s,0);const o=r.texture.getGlSource(s).internalFormat,a=t.msaaRenderBuffer[n];i.bindRenderbuffer(i.RENDERBUFFER,a),i.renderbufferStorageMultisample(i.RENDERBUFFER,4,o,s.pixelWidth,s.pixelHeight),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+n,i.RENDERBUFFER,a)}))}}_initStencil(e){if(null===e.framebuffer)return;const t=this._renderer.gl,r=t.createRenderbuffer();e.depthStencilRenderBuffer=r,t.bindRenderbuffer(t.RENDERBUFFER,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,r),this._resizeStencil(e)}_resizeStencil(e){const t=this._renderer.gl;t.bindRenderbuffer(t.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?t.renderbufferStorageMultisample(t.RENDERBUFFER,4,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,2===this._renderer.context.webGLVersion?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL,e.width,e.height)}postrender(e){if(this._renderer.context.multiView&&s.CanvasSource.test(e.colorTexture.resource)){const t=this._renderer.context.canvas,r=e.colorTexture;r.context2D.drawImage(t,0,r.pixelHeight-t.height)}}}},54346:function(e,t,r){"use strict";var i=r(17073),n=r(16952),s=r(9779);class o extends n.RenderTargetSystem{constructor(e){super(e),this.adaptor=new s.GlRenderTargetAdaptor,this.adaptor.init(e,this)}}o.extension={type:[i.ExtensionType.WebGLSystem],name:"renderTarget"},t.GlRenderTargetSystem=o},65706:function(e,t,r){"use strict";var i=r(1793),n=r(65518),s=r(27666);t.generateShaderSyncCode=function(e,t){const r=[],o=["\n var g = s.groups;\n var sS = r.shader;\n var p = s.glProgram;\n var ugS = r.uniformGroup;\n var resources;\n "];let a=!1,l=0,u=0;const h=t._getProgramData(e.glProgram);for(const c in e.groups){const d=e.groups[c];r.push(`\n resources = g[${c}].resources;\n `);for(const p in d.resources){const f=d.resources[p];if(f instanceof n.UniformGroup)f.ubo?r.push(`\n sS.bindUniformBlock(\n resources[${p}],\n sS._uniformBindMap[${c}[${p}],\n ${l++}\n );\n `):r.push(`\n ugS.updateUniformGroup(resources[${p}], p, sD);\n `);else if(f instanceof i.BufferResource)r.push(`\n sS.bindUniformBlock(\n resources[${p}],\n sS._uniformBindMap[${c}[${p}],\n ${l++}\n );\n `);else if(f instanceof s.TextureSource){const i=e._uniformBindMap[c][p],n=h.uniformData[i];n&&(a||(a=!0,o.push("\n var tS = r.texture;\n ")),t._gl.uniform1i(n.location,u),r.push(`\n tS.bind(resources[${p}], ${u});\n `),u++)}}}const c=[...o,...r].join("\n");return new Function("r","s","sD",c)}},62991:function(e,t,r){"use strict";var i=r(6066),n=r(3871),s=r(9778),o=r(4023),a=r(77944),l=r(48142);const u={stripVersion:r(3553).stripVersion,ensurePrecision:o.ensurePrecision,addProgramDefines:s.addProgramDefines,setProgramName:l.setProgramName,insertVersion:a.insertVersion},h=Object.create(null),c=class e{constructor(t){const r=-1!==(t={...e.defaultOptions,...t}).fragment.indexOf("#version 300 es"),s={stripVersion:r,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:n.getMaxFragmentPrecision()},setProgramName:{name:t.name},addProgramDefines:r,insertVersion:r};let o=t.fragment,a=t.vertex;Object.keys(u).forEach((e=>{const t=s[e];o=u[e](o,t,!0),a=u[e](a,t,!1)})),this.fragment=o,this.vertex=a,this._key=i.createIdFromString(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null}static from(t){const r=`${t.vertex}:${t.fragment}`;return h[r]||(h[r]=new e(t)),h[r]}};c.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let d=c;t.GlProgram=d},94230:function(e,t){"use strict";t.GlProgramData=class{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}},t.IGLUniformData=class{}},2071:function(e,t,r){"use strict";var i=r(17073),n=r(1766),s=r(65706),o=r(3480);const a={textureCount:0,blockIndex:0};class l{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._nextIndex=0,this._boundUniformsIdsToIndexHash=Object.create(null),this._boundIndexToUniformsHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e}contextChange(e){this._gl=e,this._maxBindings=e.MAX_UNIFORM_BUFFER_BINDINGS?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0,this._programDataHash=Object.create(null),this._boundUniformsIdsToIndexHash=Object.create(null),this._boundIndexToUniformsHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null,this.maxTextures=n.getMaxTexturesPerBatch()}bind(e,t){if(this._setProgram(e.glProgram),t)return;a.textureCount=0,a.blockIndex=0;let r=this._shaderSyncFunctions[e.glProgram._key];r||(r=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),r(this._renderer,e,a)}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,a)}bindUniformBlock(e,t,r=0){const i=this._renderer.buffer,n=this._getProgramData(this._activeProgram),s=e._bufferResource;s&&this._renderer.ubo.updateUniformGroup(e),i.updateBuffer(e.buffer);let o=this._boundUniformsIdsToIndexHash[e.uid];if(void 0===o){const t=this._nextIndex++%this._maxBindings,r=this._boundIndexToUniformsHash[t];r&&(this._boundUniformsIdsToIndexHash[r.uid]=void 0),o=this._boundUniformsIdsToIndexHash[e.uid]=t,this._boundIndexToUniformsHash[t]=e,s?i.bindBufferRange(e.buffer,t,e.offset):i.bindBufferBase(e.buffer,t)}const a=this._gl,l=this._activeProgram._uniformBlockData[t].index;n.uniformBlockBindings[r]!==o&&(n.uniformBlockBindings[r]=o,a.uniformBlockBinding(n.program,l,o))}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;const t=this._getProgramData(e);this._gl.useProgram(t.program)}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){const t=e._key;return this._programDataHash[t]=o.generateProgram(this._gl,e),this._programDataHash[t]}destroy(){for(const e of Object.keys(this._programDataHash)){this._programDataHash[e].destroy(),this._programDataHash[e]=null}this._programDataHash=null,this._boundUniformsIdsToIndexHash=null}_generateShaderSync(e,t){return s.generateShaderSyncCode(e,t)}}l.extension={type:[i.ExtensionType.WebGLSystem],name:"shader"},t.GlShaderSystem=l},53864:function(e,t,r){"use strict";var i=r(17073),n=r(66171);class s{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={}}contextChange(e){this.gl=e}updateUniformGroup(e,t,r){const i=this._renderer.shader._getProgramData(t);if(!e.isStatic||e._dirtyId!==i.uniformDirtyGroups[e.uid]){i.uniformDirtyGroups[e.uid]=e._dirtyId;this._getUniformSyncFunction(e,t)(i.uniformData,e.uniforms,this._renderer,r)}}_getUniformSyncFunction(e,t){return this._uniformGroupSyncHash[e._signature]?.[t._key]||this._createUniformSyncFunction(e,t)}_createUniformSyncFunction(e,t){const r=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),i=this._getSignature(e,t._uniformData,"u");return this._cache[i]||(this._cache[i]=this._generateUniformsSync(e,t._uniformData)),r[t._key]=this._cache[i],r[t._key]}_generateUniformsSync(e,t){return n.generateUniformsSync(e,t)}_getSignature(e,t,r){const i=e.uniforms,n=[`${r}-`];for(const e in i)n.push(e),t[e]&&n.push(t[e].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null}}s.extension={type:[i.ExtensionType.WebGLSystem],name:"uniformGroup"},t.GlUniformGroupSystem=s},26156:function(){},9488:function(e,t,r){"use strict";var i=r(65518);const n={};t.getBatchSamplersUniformGroup=function(e){let t=n[e];if(t)return t;const r=new Int32Array(e);for(let t=0;te>t?1:-1));for(let r=0;r`${t}: ${e}`)),i=e.getShaderInfoLog(t),n=i.split("\n"),s={},o=n.map((e=>parseFloat(e.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1")))).filter((e=>!(!e||s[e])&&(s[e]=!0,!0))),a=[""];o.forEach((e=>{r[e-1]=`%c${r[e-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));const l=r.join("\n");a[0]=l,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}t.logProgramError=function(e,t,i,n){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(i,e.COMPILE_STATUS)||r(e,i),e.getShaderParameter(n,e.COMPILE_STATUS)||r(e,n),console.error("PixiJS Error: Could not initialize shader."),""!==e.getProgramInfoLog(t)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(t)))}},86380:function(e,t){"use strict";const r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};t.mapSize=function(e){return r[e]}},44135:function(e,t){"use strict";let r=null;const i={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},n={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};function s(e,t){if(!r){const t=Object.keys(i);r={};for(let n=0;n":8,"vec3":12,"vec4":16,"mat2x2":32,"mat3x3":48,"mat4x4":64};t.WGSL_TO_STD40_SIZE=r,t.createUboElementsSTD40=function(e){const t=e.map((e=>({data:e,offset:0,size:0})));let i=0,n=0,s=0;for(let e=0;e1&&(i=Math.max(i,16)*o.data.size),o.size=i,n%i!=0&&n<16){const e=n%i%16;n+=e,s+=e}n+i>16?(s=16*Math.ceil(s/16),o.offset=s,s+=i,n=i):(o.offset=s,n+=i,s+=i)}return s=16*Math.ceil(s/16),{uboElements:t,size:s}}},90708:function(e,t,r){"use strict";var i=r(1021),n=r(63981),s=r(40074);t.createUboSyncFunctionSTD40=function(e){return i.createUboSyncFunction(e,"uboStd40",s.generateArraySyncSTD40,n.uboSyncFunctionsSTD40)}},40074:function(e,t,r){"use strict";var i=r(98121);t.generateArraySyncSTD40=function(e,t){const r=Math.max(i.WGSL_TO_STD40_SIZE[e.data.type]/16,1),n=e.data.value.length/e.data.size,s=(4-n%4)%4;return`\n v = uv.${e.data.name};\n offset += ${t};\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ${e.data.size*r}; i++)\n {\n for(var j = 0; j < ${n}; j++)\n {\n data[arrayOffset++] = v[t++];\n }\n ${0!==s?`arrayOffset += ${s};`:""}\n }\n `}},66171:function(e,t,r){"use strict";var i=r(1793),n=r(65518),s=r(46876),o=r(8279);t.generateUniformsSync=function(e,t){const r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n var name = null;\n "];for(const a in e.uniforms){if(!t[a]){e.uniforms[a]instanceof n.UniformGroup?e.uniforms[a].ubo?r.push(`\n renderer.shader.bindUniformBlock(uv.${a}, "${a}");\n `):r.push(`\n renderer.shader.updateUniformGroup(uv.${a});\n `):e.uniforms[a]instanceof i.BufferResource&&r.push(`\n renderer.shader.bindBufferResource(uv.${a}, "${a}");\n `);continue}const l=e.uniformStructures[a];let u=!1;for(let e=0;e":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1]);\n }","vec3":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3f(location, v[0], v[1], v[2]);\n }","vec4":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",i32:"if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }","vec2":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }","vec3":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }","vec4":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",u32:"if (cv !== v) {\n cu.value = v;\n gl.uniform1ui(location, v);\n }","vec2":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2ui(location, v[0], v[1]);\n }","vec3":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }","vec4":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",bool:"if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }","vec2":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }","vec3":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }","vec4":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }","mat2x2":"gl.uniformMatrix2fv(location, false, v);","mat3x3":"gl.uniformMatrix3fv(location, false, v);","mat4x4":"gl.uniformMatrix4fv(location, false, v);"},i={f32:"gl.uniform1fv(location, v);","vec2":"gl.uniform2fv(location, v);","vec3":"gl.uniform3fv(location, v);","vec4":"gl.uniform4fv(location, v);","mat2x2":"gl.uniformMatrix2fv(location, false, v);","mat3x3":"gl.uniformMatrix3fv(location, false, v);","mat4x4":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2":"gl.uniform2iv(location, v);","vec3":"gl.uniform3iv(location, v);","vec4":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2":"gl.uniform2iv(location, v);","vec3":"gl.uniform3iv(location, v);","vec4":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2":"gl.uniform2iv(location, v);","vec3":"gl.uniform3iv(location, v);","vec4":"gl.uniform4iv(location, v);"};t.UNIFORM_TO_ARRAY_SETTERS=i,t.UNIFORM_TO_SINGLE_SETTERS=r},93199:function(e,t,r){"use strict";var i=r(17073),n=r(55141),s=r(40655);const o=class e{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=n.State.for2d()}contextChange(e){this.gl=e,this.blendModesMap=s.mapWebGLBlendModesToPixi(e),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,r=0;for(;t;)1&t&&this.map[r].call(this,!!(e.data&1<>=1,r++;this.stateId=e.data}for(let t=0;t1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",r.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,t)}onSourceUnload(e){const t=this._glTextures[e.uid];t&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(t.texture))}onSourceUpdate(e){const t=this._gl,r=this.getGlSource(e);t.bindTexture(t.TEXTURE_2D,r.texture),this._boundTextures[this._activeTextureLocation]=e,this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,r,t,this._renderer.context.webGLVersion):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e.pixelWidth,e.pixelHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,!1)}onUpdateMipmaps(e,t=!0){t&&this.bindSource(e,0);const r=this.getGlSource(e);this._gl.generateMipmap(r.target)}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}_initSampler(e){const t=this._gl,r=this._gl.createSampler();return this._glSamplers[e._resourceId]=r,c.applyStyleParams(e,t,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",r,!1,!0),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){const{pixels:t,width:r,height:n}=this.getPixels(e),s=i.DOMAdapter.get().createCanvas();s.width=r,s.height=n;const o=s.getContext("2d");if(o){const e=o.createImageData(r,n);e.data.set(t),o.putImageData(e,0,0)}return s}getPixels(e){const t=e.source.resolution,r=e.frame,i=Math.max(Math.round(r.width*t),1),n=Math.max(Math.round(r.height*t),1),s=new Uint8Array(4*i*n),o=this._renderer,a=o.renderTarget.getRenderTarget(e),l=o.renderTarget.getGpuRenderTarget(a),u=o.gl;return u.bindFramebuffer(u.FRAMEBUFFER,l.resolveTargetFramebuffer),u.readPixels(Math.round(r.x*t),Math.round(r.y*t),i,n,u.RGBA,u.UNSIGNED_BYTE,s),{pixels:new Uint8ClampedArray(s.buffer),width:i,height:n}}destroy(){this.managedTextures.slice().forEach((e=>this.onSourceDestroy(e))),this.managedTextures=null,this._renderer=null}}m.extension={type:[n.ExtensionType.WebGLSystem],name:"texture"},t.GlTextureSystem=m},30290:function(e,t){"use strict";var r=(e=>(e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e))(r||{}),i=(e=>(e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e))(i||{}),n=(e=>(e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e))(n||{}),s=(e=>(e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT",e))(s||{});t.GL_FORMATS=r,t.GL_TARGETS=i,t.GL_TYPES=s,t.GL_WRAP_MODES=n},96157:function(){},35416:function(e,t){"use strict";const r={id:"buffer",upload(e,t,r){t.width===e.width||t.height===e.height?r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.width,e.height,t.format,t.type,e.resource):r.texImage2D(t.target,0,t.internalFormat,e.width,e.height,0,t.format,t.type,e.resource),t.width=e.width,t.height=e.height}};t.glUploadBufferImageResource=r},82953:function(e,t){"use strict";const r={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},i={id:"compressed",upload(e,t,i){i.pixelStorei(i.UNPACK_ALIGNMENT,4);let n=e.pixelWidth,s=e.pixelHeight;const o=!!r[e.format];for(let r=0;r>1,1),s=Math.max(s>>1,1)}}};t.glUploadCompressedTextureResource=i},75705:function(e,t){"use strict";const r={id:"image",upload(e,t,r,i){const n="premultiply-alpha-on-upload"===e.alphaMode;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n);const s=t.width,o=t.height,a=e.pixelWidth,l=e.pixelHeight,u=e.resourceWidth,h=e.resourceHeight;u1){const r=Math.min(e.maxAnisotropy,t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[s](u,n.TEXTURE_MAX_ANISOTROPY_EXT,r)}e.compare&&t[s](u,t.TEXTURE_COMPARE_FUNC,i.compareModeToGlCompare[e.compare])}},84157:function(e,t){"use strict";let r;t.getSupportedGlCompressedTextureFormats=function(){if(r)return r;const e=document.createElement("canvas").getContext("webgl");return e?(r=[...e.getExtension("EXT_texture_compression_bptc")?["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc")?["bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc_srgb")?["bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"]:[],...e.getExtension("EXT_texture_compression_rgtc")?["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"]:[],...e.getExtension("WEBGL_compressed_texture_etc")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","eac-r11unorm","eac-rg11unorm"]:[],...e.getExtension("WEBGL_compressed_texture_astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],r):[]}},5020:function(e,t){"use strict";t.mapFormatToGlFormat=function(e){return{r8unorm:e.RED,r8snorm:e.RED,r8uint:e.RED,r8sint:e.RED,r16uint:e.RED,r16sint:e.RED,r16float:e.RED,rg8unorm:e.RG,rg8snorm:e.RG,rg8uint:e.RG,rg8sint:e.RG,r32uint:e.RED,r32sint:e.RED,r32float:e.RED,rg16uint:e.RG,rg16sint:e.RG,rg16float:e.RG,rgba8unorm:e.RGBA,"rgba8unorm-srgb":e.RGBA,rgba8snorm:e.RGBA,rgba8uint:e.RGBA,rgba8sint:e.RGBA,bgra8unorm:e.RGBA,"bgra8unorm-srgb":e.RGBA,rgb9e5ufloat:e.RGB,rgb10a2unorm:e.RGBA,rg11b10ufloat:e.RGB,rg32uint:e.RG,rg32sint:e.RG,rg32float:e.RG,rgba16uint:e.RGBA,rgba16sint:e.RGBA,rgba16float:e.RGBA,rgba32uint:e.RGBA,rgba32sint:e.RGBA,rgba32float:e.RGBA,stencil8:e.STENCIL_INDEX8,depth16unorm:e.DEPTH_COMPONENT,depth24plus:e.DEPTH_COMPONENT,"depth24plus-stencil8":e.DEPTH_STENCIL,depth32float:e.DEPTH_COMPONENT,"depth32float-stencil8":e.DEPTH_STENCIL}}},51727:function(e,t,r){"use strict";var i=r(42932);t.mapFormatToGlInternalFormat=function(e,t){let r={},n=e.RGBA;return e instanceof i.DOMAdapter.get().getWebGLRenderingContext()?t.srgb&&(r={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(r={"rgba8unorm-srgb":e.SRGB8_ALPHA8,"bgra8unorm-srgb":e.SRGB8_ALPHA8},n=e.RGBA8),{r8unorm:e.R8,r8snorm:e.R8_SNORM,r8uint:e.R8UI,r8sint:e.R8I,r16uint:e.R16UI,r16sint:e.R16I,r16float:e.R16F,rg8unorm:e.RG8,rg8snorm:e.RG8_SNORM,rg8uint:e.RG8UI,rg8sint:e.RG8I,r32uint:e.R32UI,r32sint:e.R32I,r32float:e.R32F,rg16uint:e.RG16UI,rg16sint:e.RG16I,rg16float:e.RG16F,rgba8unorm:e.RGBA,...r,rgba8snorm:e.RGBA8_SNORM,rgba8uint:e.RGBA8UI,rgba8sint:e.RGBA8I,bgra8unorm:n,rgb9e5ufloat:e.RGB9_E5,rgb10a2unorm:e.RGB10_A2,rg11b10ufloat:e.R11F_G11F_B10F,rg32uint:e.RG32UI,rg32sint:e.RG32I,rg32float:e.RG32F,rgba16uint:e.RGBA16UI,rgba16sint:e.RGBA16I,rgba16float:e.RGBA16F,rgba32uint:e.RGBA32UI,rgba32sint:e.RGBA32I,rgba32float:e.RGBA32F,stencil8:e.STENCIL_INDEX8,depth16unorm:e.DEPTH_COMPONENT16,depth24plus:e.DEPTH_COMPONENT24,"depth24plus-stencil8":e.DEPTH24_STENCIL8,depth32float:e.DEPTH_COMPONENT32F,"depth32float-stencil8":e.DEPTH32F_STENCIL8,...t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}},16310:function(e,t){"use strict";t.mapFormatToGlType=function(e){return{r8unorm:e.UNSIGNED_BYTE,r8snorm:e.BYTE,r8uint:e.UNSIGNED_BYTE,r8sint:e.BYTE,r16uint:e.UNSIGNED_SHORT,r16sint:e.SHORT,r16float:e.HALF_FLOAT,rg8unorm:e.UNSIGNED_BYTE,rg8snorm:e.BYTE,rg8uint:e.UNSIGNED_BYTE,rg8sint:e.BYTE,r32uint:e.UNSIGNED_INT,r32sint:e.INT,r32float:e.FLOAT,rg16uint:e.UNSIGNED_SHORT,rg16sint:e.SHORT,rg16float:e.HALF_FLOAT,rgba8unorm:e.UNSIGNED_BYTE,"rgba8unorm-srgb":e.UNSIGNED_BYTE,rgba8snorm:e.BYTE,rgba8uint:e.UNSIGNED_BYTE,rgba8sint:e.BYTE,bgra8unorm:e.UNSIGNED_BYTE,"bgra8unorm-srgb":e.UNSIGNED_BYTE,rgb9e5ufloat:e.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:e.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:e.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:e.UNSIGNED_INT,rg32sint:e.INT,rg32float:e.FLOAT,rgba16uint:e.UNSIGNED_SHORT,rgba16sint:e.SHORT,rgba16float:e.HALF_FLOAT,rgba32uint:e.UNSIGNED_INT,rgba32sint:e.INT,rgba32float:e.FLOAT,stencil8:e.UNSIGNED_BYTE,depth16unorm:e.UNSIGNED_SHORT,depth24plus:e.UNSIGNED_INT,"depth24plus-stencil8":e.UNSIGNED_INT_24_8,depth32float:e.FLOAT,"depth32float-stencil8":e.FLOAT_32_UNSIGNED_INT_24_8_REV}}},59758:function(e,t){"use strict";t.compareModeToGlCompare={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519},t.mipmapScaleModeToGlFilter={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},t.scaleModeToGlFilter={linear:9729,nearest:9728},t.wrapModeToGlAddress={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648}},7358:function(e,t){"use strict";t.unpremultiplyAlpha=function(e){e instanceof Uint8ClampedArray&&(e=new Uint8Array(e.buffer));const t=e.length;for(let r=0;r{this.gpu=e,this._renderer.runners.contextChange.emit(this.gpu)}))),this._initPromise}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await i.DOMAdapter.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter((e=>t.features.has(e))),n=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:n}}destroy(){this.gpu=null,this._renderer=null}}s.extension={type:[n.ExtensionType.WebGPUSystem],name:"device"},s.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1},t.GpuDeviceSystem=s},32920:function(e,t,r){"use strict";var i=r(17073);class n{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise((e=>{this._resolveCommandFinished=e})),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,i){const n=this._renderer.pipeline.getPipeline(e,t,r,i);this.setPipeline(n)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=2===e.data.BYTES_PER_ELEMENT?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const i=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,i)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const t in r)this._setVertexBuffer(t,e.attributes[r[t]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const i=e.groups[r];t||this._syncBindGroup(i),this.setBindGroup(r,i,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:i,topology:n,size:s,start:o,instanceCount:a,skipSync:l}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,i,n),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,l),t.indexBuffer?this.renderPassEncoder.drawIndexed(s||t.indexBuffer.data.length,a||t.instanceCount,o||0):this.renderPassEncoder.draw(s||t.getSize(),a||t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},i=this._boundIndexBuffer,n={...this._boundBindGroup};this._clearCache();const s=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(s.x,s.y,s.width,s.height,0,1),this.setPipeline(t);for(const e in r)this._setVertexBuffer(e,r[e]);for(const e in n)this.setBindGroup(e,n[e],null);this._setIndexBuffer(i)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}n.extension={type:[i.ExtensionType.WebGPUSystem],name:"encoder",priority:1},t.GpuEncoderSystem=n},96150:function(e,t,r){"use strict";var i=r(17073),n=r(56445);class s{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:n.STENCIL_MODES.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const i=this._renderer;i.pipeline.setStencilMode(e),i.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}s.extension={type:[i.ExtensionType.WebGPUSystem],name:"stencil"},t.GpuStencilSystem=s},4812:function(e,t,r){"use strict";var i=r(17073),n=r(6864),s=r(41036),o=r(84214);class a extends n.UboSystem{constructor(){super({createUboElements:s.createUboElementsWGSL,generateUboSync:o.createUboSyncFunctionWGSL})}}a.extension={type:[i.ExtensionType.WebGPUSystem],name:"ubo"},t.GpuUboSystem=a},93812:function(e,t,r){"use strict";var i=r(17073),n=r(21839),s=r(1793),o=r(18919),a=r(30679),l=r(83582);const u=128;class h{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._batchBuffer=new a.UboBatch({minUniformOffsetAlignment:u});for(let e=0;e<2;e++){let t=o.BufferUsage.UNIFORM|o.BufferUsage.COPY_DST;0===e&&(t|=o.BufferUsage.COPY_SRC),this._buffers.push(new n.Buffer({data:this._batchBuffer.data,usage:t}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){for(const e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear()}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);const r=e.buffer.data,i=this._batchBuffer.addEmptyGroup(r.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,i/4),this._bindGroupHash[e.uid]=this._getBindGroup(i/u),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);const t=e.buffer.data,r=this._batchBuffer.addGroup(t);return this._getBufferResource(r/u)}getArrayBindGroup(e){const t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/u)}getArrayBufferResource(e){const t=this._batchBuffer.addGroup(e)/u;return this._getBufferResource(t)}_getBufferResource(e){if(!this._bufferResources[e]){const t=this._buffers[e%2];this._bufferResources[e]=new s.BufferResource({buffer:t,offset:256*(e/2|0),size:u})}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){const t=new l.BindGroup({0:this._getBufferResource(e)});this._bindGroups[e]=t}return this._bindGroups[e]}_uploadBindGroups(){const e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);const r=this._renderer.gpu.device.createCommandEncoder();for(let i=1;ithis._destroyBuffer(e))),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}s.extension={type:[i.ExtensionType.WebGPUSystem],name:"buffer"},t.GpuBufferSystem=s},40736:function(e,t,r){"use strict";var i=r(21839),n=r(18919);t.GpuReadBuffer=function(e,t){const r=e.descriptor.size,s=t.gpu.device,o=new i.Buffer({data:new Float32Array(24e5),usage:n.BufferUsage.MAP_READ|n.BufferUsage.COPY_DST}),a=t.buffer.createGPUBuffer(o),l=s.createCommandEncoder();l.copyBufferToBuffer(t.buffer.getGPUBuffer(e),0,a,0,r),s.queue.submit([l.finish()]),a.mapAsync(GPUMapMode.READ,0,r).then((()=>{a.getMappedRange(0,r),a.unmap()}))}},30679:function(e,t){"use strict";t.UboBatch=class{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error("UniformBufferBatch: array is too large: "+4*e);const t=this.byteIndex;let r=t+4*e;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>4*this.data.length)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r{const s={arrayStride:0,stepMode:"vertex",attributes:[]},o=s.attributes;for(const i in t.attributeData){const a=e.attributes[i];1!==(a.divisor??1)&&n.warn(`Attribute ${i} has an invalid divisor value of '${a.divisor}'. WebGPU only supports a divisor value of 1`),a.buffer===r&&(s.arrayStride=a.stride,s.stepMode=a.instance?"instance":"vertex",o.push({shaderLocation:t.attributeData[i].location,offset:a.offset,format:a.format}))}o.length&&i.push(s)})),this._bufferLayoutsCache[r]=i,i}_updatePipeHash(){const e=(t=this._stencilMode,r=this._multisampleCount,i=this._colorMask,n=this._depthStencilAttachment,i<<6|t<<3|n<<1|r);var t,r,i,n;this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}h.extension={type:[i.ExtensionType.WebGPUSystem],name:"pipeline"},t.PipelineSystem=h},86136:function(e,t){"use strict";t.GpuRenderTarget=class{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}},9143:function(e,t,r){"use strict";var i=r(32985),n=r(91525),s=r(27666),o=r(86136);t.GpuRenderTargetAdaptor=class{init(e,t){this._renderer=e,this._renderTargetSystem=t}copyToTexture(e,t,r,i,n){const s=this._renderer,o=this._getGpuColorTexture(e),a=s.texture.getGpuSource(t.source);return s.encoder.commandEncoder.copyTextureToTexture({texture:o,origin:r},{texture:a,origin:n},i),t}startRenderPass(e,t=!0,r,i){const n=this._renderTargetSystem.getGpuRenderTarget(e),s=this.getDescriptor(e,t,r);n.descriptor=s,this._renderer.pipeline.setRenderTarget(n),this._renderer.encoder.beginRenderPass(n),this._renderer.encoder.setViewport(i)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,r){"boolean"==typeof t&&(t=t?i.CLEAR.ALL:i.CLEAR.NONE);const n=this._renderTargetSystem,s=n.getGpuRenderTarget(e),o=e.colorTextures.map(((e,o)=>{const a=s.contexts[o];let l,u;if(a){l=a.getCurrentTexture().createView()}else l=this._renderer.texture.getGpuSource(e).createView({mipLevelCount:1});s.msaaTextures[o]&&(u=l,l=this._renderer.texture.getTextureView(s.msaaTextures[o]));const h=t&i.CLEAR.COLOR?"clear":"load";return r??(r=n.defaultClearColor),{view:l,resolveTarget:u,clearValue:r,storeOp:"store",loadOp:h}}));let a;if(!e.stencil&&!e.depth||e.depthStencilTexture||(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=s.msaa?4:1),e.depthStencilTexture){const r=t&i.CLEAR.STENCIL?"clear":"load",n=t&i.CLEAR.DEPTH?"clear":"load";a={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:r,depthClearValue:1,depthLoadOp:n,depthStoreOp:"store"}}return{colorAttachments:o,depthStencilAttachment:a}}clear(e,t=!0,r,i){if(!t)return;const{gpu:n,encoder:s}=this._renderer,o=n.device;if(null===s.commandEncoder){const n=o.createCommandEncoder(),s=this.getDescriptor(e,t,r),a=n.beginRenderPass(s);a.setViewport(i.x,i.y,i.width,i.height,0,1),a.end();const l=n.finish();o.queue.submit([l])}else this.startRenderPass(e,t,r,i)}initGpuRenderTarget(e){e.isRoot=!0;const t=new o.GpuRenderTarget;return e.colorTextures.forEach(((e,r)=>{if(n.CanvasSource.test(e.resource)){const i=e.resource.getContext("webgpu"),n=e.transparent?"premultiplied":"opaque";try{i.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:n})}catch(e){console.error(e)}t.contexts[r]=i}if(t.msaa=e.source.antialias,e.source.antialias){const e=new s.TextureSource({width:0,height:0,sampleCount:4});t.msaaTextures[r]=e}})),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach((e=>{e.unconfigure()})),e.msaaTextures.forEach((e=>{e.destroy()})),e.msaaTextures.length=0,e.contexts.length=0}ensureDepthStencilTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach(((e,r)=>{const i=t.msaaTextures[r];i?.resize(e.source.width,e.source.height,e.source._resolution)}))}}},24628:function(e,t,r){"use strict";var i=r(17073),n=r(16952),s=r(9143);class o extends n.RenderTargetSystem{constructor(e){super(e),this.adaptor=new s.GpuRenderTargetAdaptor,this.adaptor.init(e,this)}}o.extension={type:[i.ExtensionType.WebGPUSystem],name:"renderTarget"},t.GpuRenderTargetSystem=o},91428:function(e,t){"use strict";t.calculateProjection=function(e,t,r,i,n,s){const o=s?1:-1;return e.identity(),e.a=1/i*2,e.d=o*(1/n*2),e.tx=-1-t*e.a,e.ty=-o-r*e.d,e}},83582:function(e,t){"use strict";t.BindGroup=class{constructor(e){this.resources=Object.create(null),this._dirty=!0;let t=0;for(const r in e){const i=e[r];this.setResource(i,t++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let t=0;for(const r in this.resources)e[t++]=this.resources[r]._resourceId;this._key=e.join("|")}setResource(e,t){const r=this.resources[t];e!==r&&(r&&e.off?.("change",this.onResourceChange,this),e.on?.("change",this.onResourceChange,this),this.resources[t]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e){const t=this.resources;for(const r in t)t[r]._touched=e}destroy(){const e=this.resources;for(const t in e){const r=e[t];r.off?.("change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){if(this._dirty=!0,e.destroyed){const t=this.resources;for(const r in t)t[r]===e&&(t[r]=null)}else this._updateKey()}}},1805:function(){},50543:function(e,t,r){"use strict";var i=r(6066),n=r(29926),s=r(16126),o=r(80863),a=r(47242),l=r(79320);const u=Object.create(null);class h{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:t,vertex:r,layout:i,gpuLayout:n,name:u}=e;if(this.name=u,this.fragment=t,this.vertex=r,t.source===r.source){const e=s.extractStructAndGroups(t.source);this.structsAndGroups=e}else{const e=s.extractStructAndGroups(r.source),i=s.extractStructAndGroups(t.source);this.structsAndGroups=l.removeStructAndGroupDuplicates(e,i)}this.layout=i??a.generateLayoutHash(this.structsAndGroups),this.gpuLayout=n??o.generateGpuLayoutGroups(this.structsAndGroups),this.autoAssignGlobalUniforms=!(void 0===this.layout[0]?.globalUniforms),this.autoAssignLocalUniforms=!(void 0===this.layout[1]?.localUniforms),this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:t}=this,r=e.source+t.source+e.entryPoint+t.entryPoint;this._layoutKey=i.createIdFromString(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=n.extractAttributesFromGpuProgram(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(e){const t=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return u[t]||(u[t]=new h(e)),u[t]}}t.GpuProgram=h},25947:function(e,t,r){"use strict";var i=r(17073);class n{constructor(){this._gpuProgramData=Object.create(null)}contextChange(e){this._gpu=e,this.maxTextures=e.device.limits.maxSampledTexturesPerShaderStage}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){const t=this._gpu.device,r=e.gpuLayout.map((e=>t.createBindGroupLayout({entries:e}))),i={bindGroupLayouts:r};return this._gpuProgramData[e._layoutKey]={bindGroups:r,pipeline:t.createPipelineLayout(i)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}n.extension={type:[i.ExtensionType.WebGPUSystem],name:"shader"},t.GpuShaderSystem=n},41036:function(e,t){"use strict";const r={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:4,size:4},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:8,size:6},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:8,size:8},"mat2x2":{align:8,size:16},"mat2x2":{align:4,size:8},"mat3x2":{align:8,size:24},"mat3x2":{align:4,size:12},"mat4x2":{align:8,size:32},"mat4x2":{align:4,size:16},"mat2x3":{align:16,size:32},"mat2x3":{align:8,size:16},"mat3x3":{align:16,size:48},"mat3x3":{align:8,size:24},"mat4x3":{align:16,size:64},"mat4x3":{align:8,size:32},"mat2x4":{align:16,size:32},"mat2x4":{align:8,size:16},"mat3x4":{align:16,size:48},"mat3x4":{align:8,size:24},"mat4x4":{align:16,size:64},"mat4x4":{align:8,size:32}};t.WGSL_ALIGN_SIZE_DATA=r,t.createUboElementsWGSL=function(e){const t=e.map((e=>({data:e,offset:0,size:0})));let i=0;for(let e=0;e1&&(s=Math.max(s,o)*n.data.size),i=Math.ceil(i/o)*o,n.size=s,n.offset=i,i+=s}return i=16*Math.ceil(i/16),{uboElements:t,size:i}}},84214:function(e,t,r){"use strict";var i=r(1021),n=r(63981),s=r(1513);t.createUboSyncFunctionWGSL=function(e){return i.createUboSyncFunction(e,"uboWgsl",s.generateArraySyncWGSL,n.uboSyncFunctionsWGSL)}},29926:function(e,t,r){"use strict";var i=r(52783);const n={f32:"float32","vec2":"float32x2","vec3":"float32x3","vec4":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2":"sint32x2","vec3":"sint32x3","vec4":"sint32x4",u32:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4",bool:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4"};t.extractAttributesFromGpuProgram=function({source:e,entryPoint:t}){const r={},s=e.indexOf(`fn ${t}`);if(-1!==s){const t=e.indexOf("->",s);if(-1!==t){const o=e.substring(s,t),a=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let l;for(;null!==(l=a.exec(o));){const e=n[l[3]]??"float32";r[l[2]]={location:parseInt(l[1],10),format:e,stride:i.getAttributeInfoFromFormat(e).stride,offset:0,instance:!1,start:0}}}}return r}},16126:function(e,t){"use strict";t.extractStructAndGroups=function(e){const t=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,s=/(\w+)\s*:\s*([\w\<\>]+)/g,o=/struct\s+(\w+)/,a=e.match(/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g)?.map((e=>({group:parseInt(e.match(t)[1],10),binding:parseInt(e.match(r)[1],10),name:e.match(i)[2],isUniform:""===e.match(i)[1],type:e.match(n)[1]})));if(!a)return{groups:[],structs:[]};const l=e.match(/struct\s+(\w+)\s*{([^}]+)}/g)?.map((e=>{const t=e.match(o)[1],r=e.match(s).reduce(((e,t)=>{const[r,i]=t.split(":");return e[r.trim()]=i.trim(),e}),{});return r?{name:t,members:r}:null})).filter((({name:e})=>a.some((t=>t.type===e))))??[];return{groups:a,structs:l}}},1513:function(e,t,r){"use strict";var i=r(41036);t.generateArraySyncWGSL=function(e,t){const{size:r,align:n}=i.WGSL_ALIGN_SIZE_DATA[e.data.type],s=(n-r)/4;return`\n v = uv.${e.data.name};\n ${0!==t?`offset += ${t};`:""}\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ${e.data.size*(r/4)}; i++)\n {\n for(var j = 0; j < ${r/4}; j++)\n {\n data[arrayOffset++] = v[t++];\n }\n ${0!==s?`arrayOffset += ${s};`:""}\n }\n `}},80863:function(e,t,r){"use strict";var i=r(19450);t.generateGpuLayoutGroups=function({groups:e}){const t=[];for(let r=0;r!r.has(e.name)&&(r.add(e.name),!0))),groups:[...e.groups,...t.groups].filter((e=>{const t=`${e.name}-${e.binding}`;return!i.has(t)&&(i.add(t),!0)}))}}},53299:function(e,t){"use strict";const r={normal:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}},add:{alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}},multiply:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}},screen:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},overlay:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},none:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}},"normal-npm":{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}},"add-npm":{alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}},"screen-npm":{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}},erase:{alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}},min:{alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}},max:{alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}}};t.GpuBlendModesToPixi=r},81242:function(e,t,r){"use strict";var i=r(17073),n=r(55141),s=r(53299);class o{constructor(){this.defaultState=new n.State,this.defaultState.blend=!0}contextChange(e){this.gpu=e}getColorTargets(e){return[{format:"bgra8unorm",writeMask:0,blend:s.GpuBlendModesToPixi[e.blendMode]||s.GpuBlendModesToPixi.normal}]}destroy(){this.gpu=null}}o.extension={type:[i.ExtensionType.WebGPUSystem],name:"state"},t.GpuStateSystem=o},36826:function(e,t,r){"use strict";var i=r(56445);const n=[];n[i.STENCIL_MODES.NONE]=void 0,n[i.STENCIL_MODES.DISABLED]={stencilWriteMask:0,stencilReadMask:0},n[i.STENCIL_MODES.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}},n[i.STENCIL_MODES.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}},n[i.STENCIL_MODES.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}},t.GpuStencilModesToPixi=n},56042:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(65518),o=r(60932),a=r(83582),l=r(97394),u=r(1956),h=r(37135),c=r(2766),d=r(87929);class p{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:h.gpuUploadImageResource,buffer:l.gpuUploadBufferImageResource,video:c.gpuUploadVideoResource,compressed:u.gpuUploadCompressedTextureResource},this._renderer=e}contextChange(e){this._gpu=e}initSource(e){if(e.autoGenerateMipmaps){const t=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(t))+1}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;"compressed"!==e.uploadMethodId&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);const r=u.blockDataMap[e.format]||{blockBytes:4,blockWidth:1,blockHeight:1},i=Math.ceil(e.pixelWidth/r.blockWidth)*r.blockWidth,n=Math.ceil(e.pixelHeight/r.blockHeight)*r.blockHeight,s={label:e.label,size:{width:i,height:n},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},o=this._gpu.device.createTexture(s);return this._gpuSources[e.uid]=o,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),o}onSourceUpdate(e){const t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e))}onSourceUnload(e){const t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy())}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new d.GpuMipmapGenerator(this._gpu.device));const t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}onSourceResize(e){const t=this._gpuSources[e.uid];t?t.width===e.pixelWidth&&t.height===e.pixelHeight||(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){const t=e.source;return this._bindGroupHash[e.uid]=new a.BindGroup({0:t,1:t.style,2:new s.UniformGroup({uTextureMatrix:{type:"mat3x3",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){const t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){const t=this._renderer,r=t.gpu.device.createCommandEncoder(),n=i.DOMAdapter.get().createCanvas();n.width=e.source.pixelWidth,n.height=e.source.pixelHeight;const s=n.getContext("webgpu");return s.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:i.DOMAdapter.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),r.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:s.getCurrentTexture()},{width:n.width,height:n.height}),t.gpu.device.queue.submit([r.finish()]),n}getPixels(e){const t=this.generateCanvas(e),r=o.CanvasPool.getOptimalCanvasAndContext(t.width,t.height),i=r.context;i.drawImage(t,0,0);const{width:n,height:s}=t,a=i.getImageData(0,0,n,s),l=new Uint8ClampedArray(a.data.buffer);return o.CanvasPool.returnCanvasAndContext(r),{pixels:l,width:n,height:s}}destroy(){this.managedTextures.slice().forEach((e=>this.onSourceDestroy(e))),this.managedTextures=null;for(const e of Object.keys(this._bindGroupHash)){const t=Number(e),r=this._bindGroupHash[t];r?.destroy(),this._bindGroupHash[t]=null}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null}}p.extension={type:[n.ExtensionType.WebGPUSystem],name:"texture"},t.GpuTextureSystem=p},83040:function(){},97394:function(e,t){"use strict";const r={type:"image",upload(e,t,r){const i=e.resource,n=(0|e.pixelWidth)*(0|e.pixelHeight),s=i.byteLength/n;r.device.queue.writeTexture({texture:t},i,{offset:0,rowsPerImage:e.pixelHeight,bytesPerRow:e.pixelHeight*s},{width:e.pixelWidth,height:e.pixelHeight,depthOrArrayLayers:1})}};t.gpuUploadBufferImageResource=r},1956:function(e,t){"use strict";const r={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},i={blockBytes:4,blockWidth:1,blockHeight:1},n={type:"compressed",upload(e,t,n){let s=e.pixelWidth,o=e.pixelHeight;const a=r[e.format]||i;for(let r=0;r>1,1),o=Math.max(o>>1,1)}}};t.blockDataMap=r,t.gpuUploadCompressedTextureResource=n},37135:function(e,t){"use strict";const r={type:"image",upload(e,t,r){const i=e.resource;if(!i)return;const n=Math.min(t.width,e.resourceWidth||e.pixelWidth),s=Math.min(t.height,e.resourceHeight||e.pixelHeight),o="premultiply-alpha-on-upload"===e.alphaMode;r.device.queue.copyExternalImageToTexture({source:i},{texture:t,premultipliedAlpha:o},{width:n,height:s})}};t.gpuUploadImageResource=r},2766:function(e,t,r){"use strict";var i=r(37135);const n={type:"video",upload(e,t,r){i.gpuUploadImageResource.upload(e,t,r)}};t.gpuUploadVideoResource=n},87929:function(e,t){"use strict";t.GpuMipmapGenerator=class{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:"\n var pos : array, 3> = array, 3>(\n vec2(-1.0, -1.0), vec2(-1.0, 3.0), vec2(3.0, -1.0));\n\n struct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) texCoord : vec2,\n };\n\n @vertex\n fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {\n var output : VertexOutput;\n output.texCoord = pos[vertexIndex] * vec2(0.5, -0.5) + vec2(0.5);\n output.position = vec4(pos[vertexIndex], 0.0, 1.0);\n return output;\n }\n\n @group(0) @binding(0) var imgSampler : sampler;\n @group(0) @binding(1) var img : texture_2d;\n\n @fragment\n fn fragmentMain(@location(0) texCoord : vec2) -> @location(0) vec4 {\n return textureSample(img, imgSampler, texCoord);\n }\n "})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){const t=this._getMipmapPipeline(e.format);if("3d"===e.dimension||"1d"===e.dimension)throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let r=e;const i=e.depthOrArrayLayers||1,n=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!n){const t={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:i},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};r=this.device.createTexture(t)}const s=this.device.createCommandEncoder({}),o=t.getBindGroupLayout(0);for(let a=0;a=r.duration){const t=e-r.start;r.func(t),r.last=e}}}destroy(){n.Ticker.system.remove(this._update,this),this._tasks.length=0}}o.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem,i.ExtensionType.CanvasSystem],name:"scheduler",priority:0},t.SchedulerSystem=o},6852:function(e,t,r){"use strict";var i=r(58778),n=r(17073);const s=class e{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new i.Color(0),this.color=this._backgroundColor,this.alpha=1}init(t){t={...e.defaultOptions,...t},this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};s.extension={type:[n.ExtensionType.WebGLSystem,n.ExtensionType.WebGPUSystem,n.ExtensionType.CanvasSystem],name:"background",priority:0},s.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let o=s;t.BackgroundSystem=o},69862:function(e,t,r){"use strict";var i=r(17073),n=r(71210),s=r(95190);const o={};i.extensions.handle(i.ExtensionType.BlendMode,(e=>{if(!e.name)throw new Error("BlendMode extension must have a name property");o[e.name]=e.ref}),(e=>{delete o[e.name]}));class a{constructor(e){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=e}setBlendMode(e,t,r){this._activeBlendMode!==t?(this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(r),this._isAdvanced=!!o[t],this._isAdvanced&&(this._beginAdvancedBlendMode(r),this._renderableList.push(e))):this._isAdvanced&&this._renderableList.push(e)}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);const t=this._activeBlendMode;if(!o[t])return void s.warn(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);let r=this._filterHash[t];r||(r=this._filterHash[t]=new n.FilterEffect,r.filters=[new o[t]]);const i={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:r,canBundle:!1};this._renderableList=i.renderables,e.add(i)}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e)}destroy(){this._renderer=null,this._renderableList=null;for(const e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null}}a.extension={type:[i.ExtensionType.WebGLPipes,i.ExtensionType.WebGPUPipes,i.ExtensionType.CanvasPipes],name:"blendMode"},t.BlendModePipe=a},21839:function(e,t,r){"use strict";var i=r(5323),n=r(78739),s=r(18919);t.Buffer=class extends i{constructor(e){let{data:t,size:r}=e;const{usage:i,label:s,shrinkToFit:o}=e;super(),this.uid=n.uid("buffer"),this._resourceType="buffer",this._resourceId=n.uid("resource"),this._touched=0,this._updateID=1,this.shrinkToFit=!0,this.destroyed=!1,t instanceof Array&&(t=new Float32Array(t)),this._data=t,r=r??t?.byteLength;const a=!!t;this.descriptor={size:r,usage:i,mappedAtCreation:a,label:s},this.shrinkToFit=o??!0}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,!0)}get static(){return!!(this.descriptor.usage&s.BufferUsage.STATIC)}set static(e){e?this.descriptor.usage|=s.BufferUsage.STATIC:this.descriptor.usage&=~s.BufferUsage.STATIC}setDataWithSize(e,t,r){if(this._updateID++,this._updateSize=t*e.BYTES_PER_ELEMENT,this._data===e)return void(r&&this.emit("update",this));const i=this._data;this._data=e,i.length===e.length||!this.shrinkToFit&&e.byteLength(e[e.MAP_READ=1]="MAP_READ",e[e.MAP_WRITE=2]="MAP_WRITE",e[e.COPY_SRC=4]="COPY_SRC",e[e.COPY_DST=8]="COPY_DST",e[e.INDEX=16]="INDEX",e[e.VERTEX=32]="VERTEX",e[e.UNIFORM=64]="UNIFORM",e[e.STORAGE=128]="STORAGE",e[e.INDIRECT=256]="INDIRECT",e[e.QUERY_RESOLVE=512]="QUERY_RESOLVE",e[e.STATIC=1024]="STATIC",e))(r||{});t.BufferUsage=r},70766:function(e,t){"use strict";t.fastCopy=function(e,t){const r=e.byteLength/8|0,i=new Float64Array(e,0,r);new Float64Array(t,0,r).set(i);const n=e.byteLength-8*r;if(n>0){const i=new Uint8Array(e,8*r,n);new Uint8Array(t,8*r,n).set(i)}}},95041:function(e,t,r){"use strict";var i=r(17073),n=r(74599),s=r(84463);const o={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},a=class e{constructor(e){this._renderer=e}_normalizeOptions(e,t={}){return e instanceof n.Container||e instanceof s.Texture?{target:e,...t}:{...t,...e}}async image(e){const t=new Image;return t.src=await this.base64(e),t}async base64(t){t=this._normalizeOptions(t,e.defaultImageOptions);const{format:r,quality:i}=t,n=this.canvas(t);if(void 0!==n.toBlob)return new Promise(((e,t)=>{n.toBlob((r=>{if(!r)return void t(new Error("ICanvas.toBlob failed!"));const i=new FileReader;i.onload=()=>e(i.result),i.onerror=t,i.readAsDataURL(r)}),o[r],i)}));if(void 0!==n.toDataURL)return n.toDataURL(o[r],i);if(void 0!==n.convertToBlob){const e=await n.convertToBlob({type:o[r],quality:i});return new Promise(((t,r)=>{const i=new FileReader;i.onload=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)}))}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){const t=(e=this._normalizeOptions(e)).target,r=this._renderer;if(t instanceof s.Texture)return r.texture.generateCanvas(t);const i=r.textureGenerator.generateTexture(e),n=r.texture.generateCanvas(i);return i.destroy(),n}pixels(e){const t=(e=this._normalizeOptions(e)).target,r=this._renderer,i=t instanceof s.Texture?t:r.textureGenerator.generateTexture(e),o=r.texture.getPixels(i);return t instanceof n.Container&&i.destroy(),o}texture(e){return(e=this._normalizeOptions(e)).target instanceof s.Texture?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);const t=this.canvas(e),r=document.createElement("a");r.download=e.filename??"image.png",r.href=t.toDataURL("image/png"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}log(e){const t=e.width??200;e=this._normalizeOptions(e);const r=this.canvas(e),i=r.toDataURL();console.log(`[Pixi Texture] ${r.width}px ${r.height}px`);const n=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n)}destroy(){this._renderer=null}};a.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem],name:"extract"},a.defaultImageOptions={format:"png",quality:1};let l=a;t.ExtractSystem=l},42310:function(e,t,r){"use strict";var i=r(58778),n=r(17073),s=r(15685),o=r(42181),a=r(14786),l=r(19025),u=r(74599),h=r(32064);const c=new o.Rectangle,d=new a.Bounds,p=[0,0,0,0];class f{constructor(e){this._renderer=e}generateTexture(e){e instanceof u.Container&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});const t=e.resolution||this._renderer.resolution,r=e.antialias||this._renderer.view.antialias,n=e.target;let o=e.clearColor;if(o){o=Array.isArray(o)&&4===o.length?o:i.Color.shared.setValue(o).toArray()}else o=p;const a=e.frame?.copyTo(c)||l.getLocalBounds(n,d).rectangle;a.width=0|Math.max(a.width,1/t),a.height=0|Math.max(a.height,1/t);const f=h.RenderTexture.create({...e.textureSourceOptions,width:a.width,height:a.height,resolution:t,antialias:r}),m=s.Matrix.shared.translate(-a.x,-a.y);return this._renderer.render({container:n,transform:m,target:f,clearColor:o}),f.source.updateMipmaps(),f}destroy(){this._renderer=null}}f.extension={type:[n.ExtensionType.WebGLSystem,n.ExtensionType.WebGPUSystem],name:"textureGenerator"},t.GenerateTextureSystem=f},33829:function(e,t,r){"use strict";var i=r(5323),n=r(14786),s=r(78739),o=r(21839),a=r(84026),l=r(14740);function u(e){return(e instanceof o.Buffer||Array.isArray(e)||e.BYTES_PER_ELEMENT)&&(e={buffer:e}),e.buffer=a.ensureIsBuffer(e.buffer,!1),e}t.Geometry=class extends i{constructor(e){const{attributes:t,indexBuffer:r,topology:i}=e;super(),this.uid=s.uid("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new n.Bounds,this._boundsDirty=!0,this.attributes=t,this.buffers=[],this.instanceCount=e.instanceCount||1;for(const e in t){const r=t[e]=u(t[e]);-1===this.buffers.indexOf(r.buffer)&&(this.buffers.push(r.buffer),r.buffer.on("update",this.onBufferUpdate,this),r.buffer.on("change",this.onBufferUpdate,this))}r&&(this.indexBuffer=a.ensureIsBuffer(r,!0),this.buffers.push(this.indexBuffer)),this.topology=i||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(const e in this.attributes){const t=this.attributes[e];return t.buffer.data.length/(t.stride/4||t.size)}return 0}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,l.getGeometryBounds(this,"aPosition",this._bounds)):this._bounds}destroy(e=!1){this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach((e=>e.destroy())),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}},80163:function(e,t,r){"use strict";var i=r(60094);const n={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},s=new Proxy(n,{get(e,t){return i.deprecation(i.v8_0_0,`DRAW_MODES.${t} is deprecated, use '${n[t]}' instead`),e[t]}});t.DRAW_MODES=s},44307:function(e,t){"use strict";t.buildSimpleUvs=function(e,t,r,i){let n=0;for(t*=r;na&&(a=t),r>l&&(l=r),t"},uWorldTransformMatrix:{value:new n.Matrix,type:"mat3x3"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4"},uResolution:{value:[0,0],type:"vec2"}},{isStatic:!0})}destroy(){this._renderer=null}}h.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem,i.ExtensionType.CanvasSystem],name:"globalUniforms"},t.GlobalUniformSystem=h},33764:function(e,t,r){"use strict";var i=r(78739),n=r(27666),s=r(84463);const o=class e{constructor(t={}){if(this.uid=i.uid("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,t={...e.defaultOptions,...t},this.stencil=t.stencil,this.depth=t.depth,this.isRoot=t.isRoot,"number"==typeof t.colorTextures){this._managedColorTextures=!0;for(let e=0;ee.source))];const e=this.colorTexture.source;this.resize(e.width,e.height,e._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(t.depthStencilTexture||this.stencil)&&(t.depthStencilTexture instanceof s.Texture||t.depthStencilTexture instanceof n.TextureSource?this.depthStencilTexture=t.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new n.TextureSource({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(e,t,r=this.resolution,i=!1){this.dirtyId++,this.colorTextures.forEach(((n,s)=>{i&&0===s||n.source.resize(e,t,r)})),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,r)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach((e=>{e.destroy()})),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};o.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let a=o;t.RenderTarget=a},16952:function(e,t,r){"use strict";var i=r(15685),n=r(42181),s=r(32985),o=r(91428),a=r(17627),l=r(91525),u=r(27666),h=r(84463),c=r(40190),d=r(11987),p=r(33764);t.RenderTargetSystem=class{constructor(e){this.rootViewPort=new n.Rectangle,this.viewport=new n.Rectangle,this.onRenderTargetChange=new a.SystemRunner("onRenderTargetChange"),this.projectionMatrix=new i.Matrix,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:e,clear:t,clearColor:r,frame:i}){this._renderTargetStack.length=0,this.push(e,t,r,i),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=d.isRenderingToScreen(this.rootRenderTarget)}postrender(){this.adaptor.postrender?.(this.rootRenderTarget)}bind(e,t=!0,r,i){const n=this.getRenderTarget(e),s=this.renderTarget!==n;this.renderTarget=n,this.renderSurface=e;const a=this.getGpuRenderTarget(n);n.pixelWidth===a.width&&n.pixelHeight===a.height||(this.adaptor.resizeGpuRenderTarget(n),a.width=n.pixelWidth,a.height=n.pixelHeight);const l=n.colorTexture,u=this.viewport,c=l.pixelWidth,d=l.pixelHeight;if(!i&&e instanceof h.Texture&&(i=e.frame),i){const e=l._resolution;u.x=i.x*e+.5|0,u.y=i.y*e+.5|0,u.width=i.width*e+.5|0,u.height=i.height*e+.5|0}else u.x=0,u.y=0,u.width=c,u.height=d;return o.calculateProjection(this.projectionMatrix,0,0,u.width/l.resolution,u.height/l.resolution,!n.isRoot),this.adaptor.startRenderPass(n,t,r,u),s&&this.onRenderTargetChange.emit(n),n}clear(e,t=s.CLEAR.ALL,r){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,r,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(e,t=s.CLEAR.ALL,r,i){const n=this.bind(e,t,r,i);return this._renderTargetStack.push({renderTarget:n,frame:i}),n}pop(){this._renderTargetStack.pop();const e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,!1,null,e.frame)}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,r,i,n){r.x<0&&(i.width+=r.x,n.x-=r.x,r.x=0),r.y<0&&(i.height+=r.y,n.y-=r.y,r.y=0);const{pixelWidth:s,pixelHeight:o}=e;return i.width=Math.min(i.width,s-r.x),i.height=Math.min(i.height,o-r.y),this.adaptor.copyToTexture(e,t,r,i,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach(((e,t)=>{e!==t&&e.destroy()})),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(e){let t=null;return l.CanvasSource.test(e)&&(e=c.getCanvasTexture(e).source),e instanceof p.RenderTarget?t=e:e instanceof u.TextureSource&&(t=new p.RenderTarget({colorTextures:[e]}),l.CanvasSource.test(e.source.resource)&&(t.isRoot=!0),e.once("destroy",(()=>{t.destroy(),this._renderSurfaceToRenderTargetHash.delete(e);const r=this._gpuRenderTargetHash[t.uid];r&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(r))}))),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}}},11987:function(e,t){"use strict";t.isRenderingToScreen=function(e){const t=e.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement&&document.body.contains(t)}},3695:function(e,t,r){"use strict";const i=new(r(42181).Rectangle)(0,0,1,1);t.viewportFromFrame=function(e,t,r){r||(r=i);const n=t.pixelWidth,s=t.pixelHeight;return e.x=r.x*n|0,e.y=r.y*s|0,e.width=r.width*n|0,e.height=r.height*s|0,e}},97505:function(e,t,r){"use strict";var i=r(5323),n=r(62991),s=r(83582),o=r(50543),a=r(2559),l=r(65518);class u extends i{constructor(e){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:r,groups:i,resources:n,compatibleRenderers:o,groupMap:u}=e;this.gpuProgram=t,this.glProgram=r,void 0===o&&(o=0,t&&(o|=a.RendererType.WEBGPU),r&&(o|=a.RendererType.WEBGL)),this.compatibleRenderers=o;const h={};if(n||i||(n={}),n&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!t&&i&&!u)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!t&&i&&u)for(const e in u)for(const t in u[e]){const r=u[e][t];h[r]={group:e,binding:t,name:r}}else if(t&&i&&!u){const e=t.structsAndGroups.groups;u={},e.forEach((e=>{u[e.group]=u[e.group]||{},u[e.group][e.binding]=e.name,h[e.name]=e}))}else if(n){if(i={},u={},t){t.structsAndGroups.groups.forEach((e=>{u[e.group]=u[e.group]||{},u[e.group][e.binding]=e.name,h[e.name]=e}))}let e=0;for(const t in n)h[t]||(i[99]||(i[99]=new s.BindGroup,this._ownedBindGroups.push(i[99])),h[t]={group:99,binding:e,name:t},u[99]=u[99]||{},u[99][e]=t,e++);for(const e in n){const t=e;let r=n[e];r.source||r._resourceType||(r=new l.UniformGroup(r));const o=h[t];o&&(i[o.group]||(i[o.group]=new s.BindGroup,this._ownedBindGroups.push(i[o.group])),i[o.group].setResource(r,o.binding))}}this.groups=i,this._uniformBindMap=u,this.resources=this._buildResourceAccessor(i,h)}addResource(e,t,r){var i,n;(i=this._uniformBindMap)[t]||(i[t]={}),(n=this._uniformBindMap[t])[r]||(n[r]=e),this.groups[t]||(this.groups[t]=new s.BindGroup,this._ownedBindGroups.push(this.groups[t]))}_buildResourceAccessor(e,t){const r={};for(const i in t){const n=t[i];Object.defineProperty(r,n.name,{get(){return e[n.group].getResource(n.binding)},set(t){e[n.group].setResource(t,n.binding)}})}return r}destroy(e=!1){this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach((e=>{e.destroy()})),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(e){const{gpu:t,gl:r,...i}=e;let s,a;return t&&(s=o.GpuProgram.from(t)),r&&(a=n.GlProgram.from(r)),new u({gpuProgram:s,glProgram:a,...i})}}t.Shader=u},80505:function(){},6864:function(e,t,r){"use strict";var i=r(4037),n=r(21839),s=r(18919);t.UboSystem=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck()}_systemCheck(){if(!i.unsafeEvalSupported())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){const t=this.getUniformGroupData(e);e.buffer||(e.buffer=new n.Buffer({data:new Float32Array(t.layout.size/4),usage:s.BufferUsage.UNIFORM|s.BufferUsage.COPY_DST}))}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){const t=e._signature;let r=this._syncFunctionHash[t];if(!r){const i=Object.keys(e.uniformStructures).map((t=>e.uniformStructures[t])),n=this._adaptor.createUboElements(i),s=this._generateUboSync(n.uboElements);r=this._syncFunctionHash[t]={layout:n,syncFunction:s}}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,r){const i=this.getUniformGroupData(e);return e.buffer||(e.buffer=new n.Buffer({data:new Float32Array(i.layout.size/4),usage:s.BufferUsage.UNIFORM|s.BufferUsage.COPY_DST})),t||(t=e.buffer.data),r||(r=0),i.syncFunction(e.uniforms,t,r),!0}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return!1;e._dirtyId=0;const t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null}}},65518:function(e,t,r){"use strict";var i=r(78739),n=r(6066),s=r(21384),o=r(90887);const a=class e{constructor(t,r){this._touched=0,this.uid=i.uid("uniform"),this._resourceType="uniformGroup",this._resourceId=i.uid("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,r={...e.defaultOptions,...r},this.uniformStructures=t;const a={};for(const e in t){const r=t[e];if(r.name=e,r.size=r.size??1,!s.UNIFORM_TYPES_MAP[r.type])throw new Error(`Uniform type ${r.type} is not supported. Supported uniform types are: ${s.UNIFORM_TYPES_VALUES.join(", ")}`);r.value??(r.value=o.getDefaultUniformValue(r.type,r.size)),a[e]=r.value}this.uniforms=a,this._dirtyId=1,this.ubo=r.ubo,this.isStatic=r.isStatic,this._signature=n.createIdFromString(Object.keys(a).map((e=>`${e}-${t[e].type}`)).join("-"),"uniform-group")}update(){this._dirtyId++}};a.defaultOptions={ubo:!1,isStatic:!1};let l=a;t.UniformGroup=l},19450:function(e,t){"use strict";var r=(e=>(e[e.VERTEX=1]="VERTEX",e[e.FRAGMENT=2]="FRAGMENT",e[e.COMPUTE=4]="COMPUTE",e))(r||{});t.ShaderStage=r},21384:function(e,t){"use strict";const r=["f32","i32","vec2","vec3","vec4","mat2x2","mat3x3","mat4x4","mat3x2","mat4x2","mat2x3","mat4x3","mat2x4","mat3x4"],i=r.reduce(((e,t)=>(e[t]=!0,e)),{});t.UNIFORM_TYPES_MAP=i,t.UNIFORM_TYPES_VALUES=r},1021:function(e,t,r){"use strict";var i=r(46876);t.createUboSyncFunction=function(e,t,r,n){const s=["\n var v = null;\n var v2 = null;\n var t = 0;\n var index = 0;\n var name = null;\n var arrayOffset = null;\n "];let o=0;for(let a=0;a1)c=l.offset/4,s.push(r(l,c-o));else{const e=n[l.data.type];c=l.offset/4,s.push(`\n v = uv.${u};\n offset += ${c-o};\n ${e};\n `)}o=c}const a=s.join("\n");return new Function("uv","data","offset",a)}},90887:function(e,t){"use strict";t.getDefaultUniformValue=function(e,t){switch(e){case"f32":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"mat2x2":return new Float32Array([1,0,0,1]);case"mat3x3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}},63981:function(e,t){"use strict";function r(e,t){return`\n for (let i = 0; i < ${e*t}; i++) {\n data[offset + (((i / ${e})|0) * 4) + (i % ${e})] = v[i];\n }\n `}const i={f32:"\n data[offset] = v;",i32:"\n data[offset] = v;","vec2":"\n data[offset] = v[0];\n data[offset + 1] = v[1];","vec3":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];","vec4":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 3] = v[3];","mat2x2":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 4] = v[2];\n data[offset + 5] = v[3];","mat3x3":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];","mat4x4":"\n for (let i = 0; i < 16; i++) {\n data[offset + i] = v[i];\n }","mat3x2":r(3,2),"mat4x2":r(4,2),"mat2x3":r(2,3),"mat4x3":r(4,3),"mat2x4":r(2,4),"mat3x4":r(3,4)},n={...i,"mat2x2":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 3] = v[3];\n "};t.uboSyncFunctionsSTD40=i,t.uboSyncFunctionsWGSL=n},46876:function(e,t){"use strict";const r=[{type:"mat3x3",test:e=>void 0!==e.value.a,ubo:"\n var matrix = uv[name].toArray(true);\n data[offset] = matrix[0];\n data[offset + 1] = matrix[1];\n data[offset + 2] = matrix[2];\n data[offset + 4] = matrix[3];\n data[offset + 5] = matrix[4];\n data[offset + 6] = matrix[5];\n data[offset + 8] = matrix[6];\n data[offset + 9] = matrix[7];\n data[offset + 10] = matrix[8];\n ",uniform:"\n gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));\n "},{type:"vec4",test:e=>"vec4"===e.type&&1===e.size&&void 0!==e.value.width,ubo:"\n v = uv[name];\n data[offset] = v.x;\n data[offset + 1] = v.y;\n data[offset + 2] = v.width;\n data[offset + 3] = v.height;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);\n }\n "},{type:"vec2",test:e=>"vec2"===e.type&&1===e.size&&void 0!==e.value.x,ubo:"\n v = uv[name];\n data[offset] = v.x;\n data[offset + 1] = v.y;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.x || cv[1] !== v.y) {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud[name].location, v.x, v.y);\n }\n "},{type:"vec4",test:e=>"vec4"===e.type&&1===e.size&&void 0!==e.value.red,ubo:"\n v = uv[name];\n data[offset] = v.red;\n data[offset + 1] = v.green;\n data[offset + 2] = v.blue;\n data[offset + 3] = v.alpha;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n cv[3] = v.alpha;\n gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);\n }\n "},{type:"vec3",test:e=>"vec3"===e.type&&1===e.size&&void 0!==e.value.red,ubo:"\n v = uv[name];\n data[offset] = v.red;\n data[offset + 1] = v.green;\n data[offset + 2] = v.blue;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n gl.uniform3f(ud[name].location, v.red, v.green, v.blue);\n }\n "}];t.uniformParsers=r},22334:function(e,t,r){"use strict";var i=r(17073),n=r(37087),s=r(2559);class o{constructor(e){this._renderer=e}init(e){if(e.hello){let e=this._renderer.name;this._renderer.type===s.RendererType.WEBGL&&(e+=` ${this._renderer.context.webGLVersion}`),n.sayHello(e)}}}o.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem,i.ExtensionType.CanvasSystem],name:"hello",priority:-2},o.defaultOptions={hello:!1},t.HelloSystem=o},55141:function(e,t){"use strict";const r={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},i=class e{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(e){!!(1&this.data)!==e&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(e){!!(2&this.data)!==e&&(this.data^=2)}set cullMode(e){"none"!==e?(this.culling=!0,this.clockwiseFrontFace="front"===e):this.culling=!1}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(4&this.data)}set culling(e){!!(4&this.data)!==e&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(e){!!(8&this.data)!==e&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(e){!!(32&this.data)!==e&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(e){!!(16&this.data)!==e&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(e){this.blend="none"!==e,this._blendMode=e,this._blendModeId=r[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new e;return t.depthTest=!1,t.blend=!0,t}};i.default2d=i.for2d();let n=i;t.State=n},56445:function(e,t){"use strict";var r=(e=>(e[e.DISABLED=0]="DISABLED",e[e.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",e[e.MASK_ACTIVE=2]="MASK_ACTIVE",e[e.RENDERING_MASK_REMOVE=3]="RENDERING_MASK_REMOVE",e[e.NONE=4]="NONE",e))(r||{});t.BLEND_TO_NPM={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},t.STENCIL_MODES=r},254:function(e,t,r){"use strict";var i=r(56445);t.getAdjustedBlendModeBlend=function(e,t){return"no-premultiply-alpha"===t.alphaMode&&i.BLEND_TO_NPM[e]||e}},95931:function(e,t,r){"use strict";var i=r(58778),n=r(98182),s=r(74599),o=r(4037),a=r(60094);r(59121);var l=r(32985),u=r(17627),h=r(5323);const c=["init","destroy","contextChange","resolutionChange","reset","renderEnd","renderStart","render","update","postrender","prerender"],d=class e extends h{constructor(e){super(),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const t=[...c,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck()}async init(t={}){const r=!0===t.skipExtensionImports||!1===t.manageImports;await n.loadEnvironmentExtensions(r),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const e in this._systemsHash){t={...this._systemsHash[e].constructor.defaultOptions,...t}}t={...e.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let e=0;e{this.runners[e]=new u.SystemRunner(e)}))}_addSystems(e){let t;for(t in e){const r=e[t];this._addSystem(r.value,r.name)}}_addSystem(e,t){const r=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=r,this._systemsHash[t]=r;for(const e in this.runners)this.runners[e].add(r);return this}_addPipes(e,t){const r=t.reduce(((e,t)=>(e[t.name]=t.value,e)),{});e.forEach((e=>{const t=e.value,i=e.name,n=r[i];this.renderPipes[i]=new t(this,n?new n:null)}))}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),Object.values(this.runners).forEach((e=>{e.destroy()})),this._systemsHash=null,this.renderPipes=null}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!o.unsafeEvalSupported())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};d.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let p=d;t.AbstractRenderer=p},62856:function(e,t,r){"use strict";var i=r(2934),n=r(9176),s=r(13056),o=r(1894),a=r(77078),l=r(33961),u=r(14673),h=r(62579),c=r(33648),d=r(6852),p=r(69862),f=r(95041),m=r(42310),g=r(54572),_=r(24510),x=r(22334),b=r(56225),v=r(95224),y=r(80177);const T=[d.BackgroundSystem,g.GlobalUniformSystem,x.HelloSystem,y.ViewSystem,s.RenderGroupSystem,v.TextureGCSystem,m.GenerateTextureSystem,f.ExtractSystem,a.RendererInitHook,b.RenderableGCSystem,_.SchedulerSystem],S=[p.BlendModePipe,l.BatcherPipe,o.SpritePipe,n.RenderGroupPipe,u.AlphaMaskPipe,c.StencilMaskPipe,h.ColorMaskPipe,i.CustomRenderPipe];t.SharedRenderPipes=S,t.SharedSystems=T},79480:function(){},17627:function(e,t){"use strict";t.SystemRunner=class{constructor(e){this.items=[],this._name=e}emit(e,t,r,i,n,s,o,a){const{name:l,items:u}=this;for(let h=0,c=u.length;hthis.run()),this._frequency):this._renderer.scheduler.cancel(this._handler))}prerender(){this._now=performance.now()}addRenderable(e,t){this.enabled&&(e._lastUsed=this._now,-1===e._lastInstructionTick&&(this._managedRenderables.push(e),e.once("destroyed",this._removeRenderable,this)),e._lastInstructionTick=t.tick)}run(){const e=performance.now(),t=this._managedRenderables,r=this._renderer.renderPipes;let i=0;for(let n=0;nthis.maxUnusedTime){if(!s.destroyed){r[s.renderPipeId].destroyRenderable(s)}s._lastInstructionTick=-1,i++,s.off("destroyed",this._removeRenderable,this)}else t[n-i]=s}t.length=t.length-i}destroy(){this.enabled=!1,this._renderer=null,this._managedRenderables.length=0}_removeRenderable(e){const t=this._managedRenderables.indexOf(e);t>=0&&(e.off("destroyed",this._removeRenderable,this),this._managedRenderables[t]=null)}};n.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem],name:"renderableGC"},n.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};let s=n;t.RenderableGCSystem=s},84463:function(e,t,r){"use strict";var i=r(5323),n=r(81955),s=r(42181),o=r(78739),a=r(60094),l=r(98449),u=r(4720),h=r(27666),c=r(94058);class d extends i{constructor({source:e,label:t,frame:r,orig:i,trim:n,defaultAnchor:a,defaultBorders:l,rotate:u,dynamic:c}={}){if(super(),this.uid=o.uid("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new s.Rectangle,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=t,this.source=e?.source??new h.TextureSource,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:e,height:t}=this._source;this.frame.width=e,this.frame.height=t}this.orig=i||this.frame,this.trim=n,this.rotate=u??0,this.defaultAnchor=a,this.defaultBorders=l,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new c.TextureMatrix(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:t}=this,{width:r,height:i}=this._source,s=t.x/r,o=t.y/i,a=t.width/r,l=t.height/i;let u=this.rotate;if(u){const t=a/2,r=l/2,i=s+t,h=o+r;u=n.groupD8.add(u,n.groupD8.NW),e.x0=i+t*n.groupD8.uX(u),e.y0=h+r*n.groupD8.uY(u),u=n.groupD8.add(u,2),e.x1=i+t*n.groupD8.uX(u),e.y1=h+r*n.groupD8.uY(u),u=n.groupD8.add(u,2),e.x2=i+t*n.groupD8.uX(u),e.y2=h+r*n.groupD8.uY(u),u=n.groupD8.add(u,2),e.x3=i+t*n.groupD8.uX(u),e.y3=h+r*n.groupD8.uY(u)}else e.x0=s,e.y0=o,e.x1=s+a,e.y1=o,e.x2=s+a,e.y2=o+l,e.x3=s,e.y3=o+l}destroy(e=!1){this._source&&e&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return a.deprecation(a.v8_0_0,"Texture.baseTexture is now Texture.source"),this._source}}d.EMPTY=new d({label:"EMPTY",source:new h.TextureSource({label:"EMPTY"})}),d.EMPTY.destroy=l.NOOP,d.WHITE=new d({source:new u.BufferImageSource({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),d.WHITE.destroy=l.NOOP,t.Texture=d},95224:function(e,t,r){"use strict";var i=r(17073);const n=class e{constructor(e){this._renderer=e,this.count=0,this.checkCount=0}init(t){t={...e.defaultOptions,...t},this.checkCountMax=t.textureGCCheckCountMax,this.maxIdle=t.textureGCAMaxIdle??t.textureGCMaxIdle,this.active=t.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this._renderer.texture.managedTextures;for(let t=0;t-1&&this.count-r._touched>this.maxIdle&&(r._touched=-1,r.unload())}}destroy(){this._renderer=null}};n.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem],name:"textureGC"},n.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};let s=n;t.TextureGCSystem=s},94058:function(e,t,r){"use strict";var i=r(15685);const n=new i.Matrix;t.TextureMatrix=class{constructor(e,t){this.mapCoord=new i.Matrix,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===t?e.width<10?0:.5:t,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){this.texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(e,t){void 0===t&&(t=e);const r=this.mapCoord;for(let i=0;i1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=function(e){const t=o[e];return void 0===t&&(o[e]=n.uid("resource")),t}(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};a.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let l=a;t.TextureStyle=l},92756:function(e,t,r){"use strict";var i=r(81955);t.TextureUvs=class{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,t,r){const n=t.width,s=t.height;if(r){const t=e.width/2/n,o=e.height/2/s,a=e.x/n+t,l=e.y/s+o;r=i.groupD8.add(r,i.groupD8.NW),this.x0=a+t*i.groupD8.uX(r),this.y0=l+o*i.groupD8.uY(r),r=i.groupD8.add(r,2),this.x1=a+t*i.groupD8.uX(r),this.y1=l+o*i.groupD8.uY(r),r=i.groupD8.add(r,2),this.x2=a+t*i.groupD8.uX(r),this.y2=l+o*i.groupD8.uY(r),r=i.groupD8.add(r,2),this.x3=a+t*i.groupD8.uX(r),this.y3=l+o*i.groupD8.uY(r)}else this.x0=e.x/n,this.y0=e.y/s,this.x1=(e.x+e.width)/n,this.y1=e.y/s,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/s,this.x3=e.x/n,this.y3=(e.y+e.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[pixi.js/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}},6121:function(e,t,r){"use strict";var i=r(60094),n=(e=>(e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH",e))(n||{}),s=(e=>(e.CLAMP="clamp-to-edge",e.REPEAT="repeat",e.MIRRORED_REPEAT="mirror-repeat",e))(s||{});const o=new Proxy(s,{get(e,t){return i.deprecation(i.v8_0_0,`DRAW_MODES.${t} is deprecated, use '${s[t]}' instead`),e[t]}});var a=(e=>(e.NEAREST="nearest",e.LINEAR="linear",e))(a||{});const l=new Proxy(a,{get(e,t){return i.deprecation(i.v8_0_0,`DRAW_MODES.${t} is deprecated, use '${a[t]}' instead`),e[t]}});t.DEPRECATED_SCALE_MODES=a,t.DEPRECATED_WRAP_MODES=s,t.MSAA_QUALITY=n,t.SCALE_MODES=l,t.WRAP_MODES=o},4720:function(e,t,r){"use strict";var i=r(17073),n=r(27666);class s extends n.TextureSource{constructor(e){const t=e.resource||new Float32Array(e.width*e.height*4);let r=e.format;r||(r=t instanceof Float32Array?"rgba32float":t instanceof Int32Array||t instanceof Uint32Array?"rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?"rgba16uint":(Int8Array,"bgra8unorm")),super({...e,resource:t,format:r}),this.uploadMethodId="buffer"}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}s.extension=i.ExtensionType.TextureSource,t.BufferImageSource=s},91525:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(27666);class o extends s.TextureSource{constructor(e){e.resource||(e.resource=i.DOMAdapter.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity;const t=e.resource;this.pixelWidth===t.width&&this.pixelWidth===t.height||this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),this.resource.width===this.pixelWidth&&this.resource.height===this.pixelHeight||(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,t=this.height,r=this._resolution){const i=super.resize(e,t,r);return i&&this.resizeCanvas(),i}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}o.extension=n.ExtensionType.TextureSource,t.CanvasSource=o},68651:function(e,t,r){"use strict";var i=r(27666);class n extends i.TextureSource{constructor(e){super(e),this.uploadMethodId="compressed",this.resource=e.resource,this.mipLevelCount=this.resource.length}}t.CompressedSource=n},75813:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(95190),o=r(27666);class a extends o.TextureSource{constructor(e){if(e.resource&&globalThis.HTMLImageElement&&e.resource instanceof HTMLImageElement){const t=i.DOMAdapter.get().createCanvas(e.resource.width,e.resource.height);t.getContext("2d").drawImage(e.resource,0,0,e.resource.width,e.resource.height),e.resource=t,s.warn("ImageSource: Image element passed, converting to canvas. Use CanvasSource instead.")}super(e),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}}a.extension=n.ExtensionType.TextureSource,t.ImageSource=a},27666:function(e,t,r){"use strict";var i=r(5323),n=r(39018),s=r(6877),o=r(78739),a=r(44174);const l=class e extends i{constructor(t={}){super(),this.options=t,this.uid=o.uid("textureSource"),this._resourceType="textureSource",this._resourceId=o.uid("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...e.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new a.TextureStyle(s.definedProps(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=o.uid("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,t,r){r=r||this._resolution,e=e||this.width,t=t||this.height;const i=Math.round(e*r),n=Math.round(t*r);return this.width=i/r,this.height=n/r,this._resolution=r,(this.pixelWidth!==i||this.pixelHeight!==n)&&(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=n,this.emit("resize",this),this._resourceId=o.uid("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=n.isPow2(this.pixelWidth)&&n.isPow2(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};l.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let u=l;t.TextureSource=u},62480:function(e,t,r){"use strict";var i=r(17073),n=r(63983),s=r(86105),o=r(27666);const a=class e extends o.TextureSource{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...e.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==t.autoPlay,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),!1!==t.autoLoad&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const e=n.Ticker.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,!0)),this.alphaMode=await s.detectVideoAlphaMode(),this._load=new Promise(((r,i)=>{this.isValid?r(this):(this._resolve=r,this._reject=i,void 0!==t.preloadTimeoutMs&&(this._preloadTimeout=setTimeout((()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))}))),e.load())})),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(n.Ticker.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(n.Ticker.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(n.Ticker.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};a.extension=i.ExtensionType.TextureSource,a.defaultOptions={...o.TextureSource.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},a.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let l=a;t.VideoSource=l},95026:function(e,t){"use strict";let r=0;t.generateUID=function(){return r++}},40190:function(e,t,r){"use strict";var i=r(91525),n=r(84463);const s=new Map;t.getCanvasTexture=function(e,t){if(!s.has(e)){const r=new n.Texture({source:new i.CanvasSource({resource:e,...t})}),o=()=>{s.get(e)===r&&s.delete(e)};r.once("destroy",o),r.source.once("destroy",o),s.set(e,r)}return s.get(e)},t.hasCachedCanvasTexture=function(e){return s.has(e)}},34155:function(e,t,r){"use strict";var i=r(58050),n=r(73533),s=r(84157),o=r(43213);let a;t.getSupportedCompressedTextureFormats=async function(){return void 0!==a||(a=await(async()=>{const e=await n.isWebGPUSupported(),t=i.isWebGLSupported();if(e&&t){const e=await o.getSupportedGPUCompressedTextureFormats(),t=s.getSupportedGlCompressedTextureFormats();return e.filter((e=>t.includes(e)))}return e?await o.getSupportedGPUCompressedTextureFormats():t?s.getSupportedGlCompressedTextureFormats():[]})()),a}},55484:function(e,t,r){"use strict";var i=r(34155);const n=["r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb9e5ufloat","rgb10a2unorm","rg11b10ufloat","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8"];let s;t.getSupportedTextureFormats=async function(){if(void 0!==s)return s;const e=await i.getSupportedCompressedTextureFormats();return s=[...n,...e],s},t.nonCompressedFormats=n},39394:function(e,t,r){"use strict";var i=r(56509),n=r(17073),s=r(27666),o=r(84463);const a=[];function l(e={}){const t=e&&e.resource,r=t?e.resource:e,i=t?e:{resource:e};for(let e=0;e{i.Cache.has(n)&&i.Cache.remove(n)})),t||i.Cache.set(n,a),a}function h(e,t=!1){return"string"==typeof e?i.Cache.get(e):e instanceof s.TextureSource?new o.Texture({source:e}):u(e,t)}n.extensions.handleByList(n.ExtensionType.TextureSource,a),o.Texture.from=h,s.TextureSource.from=l,t.autoDetectSource=function(e={}){return l(e)},t.resourceToTexture=u,t.textureFrom=h},6066:function(e,t){"use strict";const r=Object.create(null),i=Object.create(null);t.createIdFromString=function(e,t){let n=i[e];return void 0===n&&(void 0===r[t]&&(r[t]=1),i[e]=n=r[t]++),n}},60527:function(e,t){"use strict";t.parseFunctionBody=function(e){const t=e.toString(),r=t.indexOf("{"),i=t.lastIndexOf("}");if(-1===r||-1===i)throw new Error("getFunctionBody: No body found in function definition");return t.slice(r+1,i).trim()}},27571:function(){},80177:function(e,t,r){"use strict";var i=r(42932),n=r(17073),s=r(42181),o=r(60094),a=r(33764),l=r(40190);const u=class e{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(e){this.texture.source.autoDensity=e}get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e)}init(t){(t={...e.defaultOptions,...t}).view&&(o.deprecation(o.v8_0_0,"ViewSystem.view has been renamed to ViewSystem.canvas"),t.canvas=t.view),this.screen=new s.Rectangle(0,0,t.width,t.height),this.canvas=t.canvas||i.DOMAdapter.get().createCanvas(),this.antialias=!!t.antialias,this.texture=l.getCanvasTexture(this.canvas,t),this.renderTarget=new a.RenderTarget({colorTextures:[this.texture],depth:!!t.depth,isRoot:!0}),this.texture.source.transparent=t.backgroundAlpha<1,this.resolution=t.resolution}resize(e,t,r){this.texture.source.resize(e,t,r),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(e=!1){("boolean"==typeof e?e:!!e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};u.extension={type:[n.ExtensionType.WebGLSystem,n.ExtensionType.WebGPUSystem,n.ExtensionType.CanvasSystem],name:"view",priority:0},u.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let h=u;t.ViewSystem=h},2559:function(e,t){"use strict";var r=(e=>(e[e.WEBGL=1]="WEBGL",e[e.WEBGPU=2]="WEBGPU",e[e.BOTH=3]="BOTH",e))(r||{});t.RendererType=r},74599:function(e,t,r){"use strict";var i=r(5323),n=r(58778),s=r(10051),o=r(15685),a=r(29705),l=r(62792),u=r(78739),h=r(60094),c=r(86169),d=r(5408),p=r(25136),f=r(36695),m=r(59009),g=r(8125),_=r(36422),x=r(84748),b=r(49341),v=r(15486);const y=new l.ObservablePoint(null),T=new l.ObservablePoint(null),S=new l.ObservablePoint(null,1,1);class E extends i{constructor(e={}){super(),this.uid=u.uid("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.updateTick=-1,this.localTransform=new o.Matrix,this.relativeGroupTransform=new o.Matrix,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new l.ObservablePoint(this,0,0),this._scale=S,this._pivot=T,this._skew=y,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],v.assignWithIgnore(this,e,{children:!0,parent:!0,effects:!0}),e.children?.forEach((e=>this.addChild(e))),e.parent?.addChild(this)}static mixin(e){Object.defineProperties(E.prototype,Object.getOwnPropertyDescriptors(e))}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=4095&e}get _didChangeId(){return 4095&this._didContainerChangeTick|(4095&this._didViewChangeTick)<<12}addChild(...e){if(this.allowChildren||h.deprecation(h.v8_0_0,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let t=0;t1){for(let t=0;t-1&&(this._didViewChangeTick++,this.children.splice(r,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parent=null,this.emit("childRemoved",t,this,r),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,this.didChange||(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=c.BigPool.get(b.RenderGroup,this),this.groupTransform=o.Matrix.IDENTITY,e?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const e=this.parentRenderGroup;e?.removeChild(this),c.BigPool.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&0===this.effects.length}get worldTransform(){return this._worldTransform||(this._worldTransform=new o.Matrix),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*a.RAD_TO_DEG}set angle(e){this.rotation=e*a.DEG_TO_RAD}get pivot(){return this._pivot===T&&(this._pivot=new l.ObservablePoint(this,0,0)),this._pivot}set pivot(e){this._pivot===T&&(this._pivot=new l.ObservablePoint(this,0,0)),"number"==typeof e?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===y&&(this._skew=new l.ObservablePoint(this,0,0)),this._skew}set skew(e){this._skew===y&&(this._skew=new l.ObservablePoint(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===S&&(this._scale=new l.ObservablePoint(this,1,1)),this._scale}set scale(e){this._scale===S&&(this._scale=new l.ObservablePoint(this,0,0)),"number"==typeof e?this._scale.set(e):this._scale.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){const t=this.getLocalBounds().width;this._setWidth(e,t)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){const t=this.getLocalBounds().height;this._setHeight(e,t)}getSize(e){e||(e={});const t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){const r=this.getLocalBounds();"object"==typeof e?(t=e.height??e.width,e=e.width):t??(t=e),void 0!==e&&this._setWidth(e,r.width),void 0!==t&&this._setHeight(t,r.height)}_updateSkew(){const e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x)}updateTransform(e){return this.position.set("number"==typeof e.x?e.x:this.position.x,"number"==typeof e.y?e.y:this.position.y),this.scale.set("number"==typeof e.scaleX?e.scaleX||1:this.scale.x,"number"==typeof e.scaleY?e.scaleY||1:this.scale.y),this.rotation="number"==typeof e.rotation?e.rotation:this.rotation,this.skew.set("number"==typeof e.skewX?e.skewX:this.skew.x,"number"==typeof e.skewY?e.skewY:this.skew.y),this.pivot.set("number"==typeof e.pivotX?e.pivotX:this.pivot.x,"number"==typeof e.pivotY?e.pivotY:this.pivot.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){const e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;const t=this.localTransform,r=this._scale,i=this._pivot,n=this._position,s=r._x,o=r._y,a=i._x,l=i._y;t.a=this._cx*s,t.b=this._sx*s,t.c=this._cy*o,t.d=this._sy*o,t.tx=n._x-(a*t.a+l*t.c),t.ty=n._y-(a*t.b+l*t.d)}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=1,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){const t=n.Color.shared.setValue(e??16777215).toBgrNumber();t!==this.localColor&&(this.localColor=t,this._updateFlags|=1,this._onUpdate())}get tint(){const e=this.localColor;return((255&e)<<16)+(65280&e)+(e>>16&255)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=2,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(2&this.localDisplayStatus)}set visible(e){const t=e?2:0;(2&this.localDisplayStatus)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(4&this.localDisplayStatus)}set culled(e){const t=e?0:4;(4&this.localDisplayStatus)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(1&this.localDisplayStatus)}set renderable(e){const t=e?1:0;(1&this.localDisplayStatus)!==t&&(this._updateFlags|=4,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return 7===this.localDisplayStatus&&this.groupAlpha>0}destroy(e=!1){if(this.destroyed)return;this.destroyed=!0;const t=this.removeChildren(0,this.children.length);this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners();if("boolean"==typeof e?e:e?.children)for(let r=0;r!1),this.addBounds=e.addBounds??(()=>!1)}render(e){}}t.RenderContainer=s},49341:function(e,t,r){"use strict";var i=r(15685),n=r(31540);t.RenderGroup=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new i.Matrix,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new n.InstructionSet,this._onRenderContainers=[]}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;const t=e.children;for(let e=0;e-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup)return void this.addRenderGroupChild(e.renderGroup);e._onRender&&this.addOnRender(e);const t=e.children;for(let e=0;e0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(){for(let e=0;ethis.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new n.Rectangle);const e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=s,this}set(e,t,r,i){this.minX=e,this.minY=t,this.maxX=r,this.maxY=i}addFrame(e,t,r,i,n){n||(n=this.matrix);const s=n.a,o=n.b,a=n.c,l=n.d,u=n.tx,h=n.ty;let c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,m=s*e+a*t+u,g=o*e+l*t+h;mp&&(p=m),g>f&&(f=g),m=s*r+a*t+u,g=o*r+l*t+h,mp&&(p=m),g>f&&(f=g),m=s*e+a*i+u,g=o*e+l*i+h,mp&&(p=m),g>f&&(f=g),m=s*r+a*i+u,g=o*r+l*i+h,mp&&(p=m),g>f&&(f=g),this.minX=c,this.minY=d,this.maxX=p,this.maxY=f}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t)}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxXthis.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY,c=s*t+a*n+u,d=o*t+l*n+h,this.minX=cthis.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY,c=s*i+a*n+u,d=o*i+l*n+h,this.minX=cthis.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(e){return this.minXe.right&&(this.maxX=e.right),this.minYe.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,r,i){return this.minXt&&(this.maxX=t),this.minYi&&(this.maxY=i),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new o(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){const t=this.maxX-this.minX;this.minX=e,this.maxX=e+t}get y(){return this.minY}set y(e){const t=this.maxY-this.minY;this.minY=e,this.maxY=e+t}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,r,i){let n=this.minX,s=this.minY,o=this.maxX,a=this.maxY;i||(i=this.matrix);const l=i.a,u=i.b,h=i.c,c=i.d,d=i.tx,p=i.ty;for(let i=t;io?f:o,a=m>a?m:a}this.minX=n,this.minY=s,this.maxX=o,this.maxY=a}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}}t.Bounds=o},91858:function(e,t,r){"use strict";var i=r(15685),n=r(29541);const s=new i.Matrix;function o(e,t){if(7!==e.localDisplayStatus||!e.measurable)return;const r=!!e.effects.length;let i=t;if((e.renderGroup||r)&&(i=n.boundsPool.get().clear()),e.boundsArea)t.addRect(e.boundsArea,e.worldTransform);else{if(e.renderPipeId){const t=e.bounds;i.addFrame(t.minX,t.minY,t.maxX,t.maxY,e.groupTransform)}const t=e.children;for(let e=0;e0&&n<=r){for(let t=r-1;t>=e;t--){const e=this.children[t];e&&(s.push(e),e.parent=null)}i.removeItems(this.children,e,r);const t=this.renderGroup||this.parentRenderGroup;t&&t.removeChildren(s);for(let e=0;e=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]},setChildIndex(e,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(e),this.addChildAt(e,t)},getChildIndex(e){const t=this.children.indexOf(e);if(-1===t)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(e,t){this.allowChildren||n.deprecation(n.v8_0_0,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:r}=this;if(t<0||t>r.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${r.length}`);if(e.parent){const r=e.parent.children.indexOf(e);if(e.parent===this&&r===t)return e;-1!==r&&e.parent.children.splice(r,1)}t===r.length?r.push(e):r.splice(t,0,e),e.parent=this,e.didChange=!0,e.didViewUpdate=!1,e._updateFlags=15;const i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(e),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",e,this,t),e.emit("added",this),e},swapChildren(e,t){if(e===t)return;const r=this.getChildIndex(e),i=this.getChildIndex(t);this.children[r]=t,this.children[i]=e;const n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...e){return 1===e.length?this.reparentChildAt(e[0],this.children.length):(e.forEach((e=>this.reparentChildAt(e,this.children.length))),e[0])},reparentChildAt(e,t){if(e.parent===this)return this.setChildIndex(e,t),e;const r=e.worldTransform.clone();e.removeFromParent(),this.addChildAt(e,t);const i=this.worldTransform.clone();return i.invert(),r.prepend(i),e.setFromMatrix(r),e}};t.childrenHelperMixin=s},25136:function(e,t,r){"use strict";var i=r(71210),n=r(81480);const s={_maskEffect:null,_filterEffect:null,effects:[],addEffect(e){if(-1!==this.effects.indexOf(e))return;this.effects.push(e),this.effects.sort(((e,t)=>e.priority-t.priority));const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0),this._updateIsSimple()},removeEffect(e){const t=this.effects.indexOf(e);-1!==t&&(this.effects.splice(t,1),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateIsSimple())},set mask(e){const t=this._maskEffect;t?.mask!==e&&(t&&(this.removeEffect(t),n.MaskEffectManager.returnMaskEffect(t),this._maskEffect=null),null!=e&&(this._maskEffect=n.MaskEffectManager.getMaskEffect(e),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},set filters(e){!Array.isArray(e)&&e&&(e=[e]);const t=this._filterEffect||(this._filterEffect=new i.FilterEffect),r=e?.length>0,n=r!==t.filters?.length>0;e=Array.isArray(e)?e.slice(0):e,t.filters=Object.freeze(e),n&&(r?this.addEffect(t):(this.removeEffect(t),t.filters=e??null))},get filters(){return this._filterEffect?.filters},set filterArea(e){this._filterEffect||(this._filterEffect=new i.FilterEffect),this._filterEffect.filterArea=e},get filterArea(){return this._filterEffect?.filterArea}};t.effectsMixin=s},36695:function(e,t,r){"use strict";var i=r(60094);const n={label:null,get name(){return i.deprecation(i.v8_0_0,"Container.name property has been removed, use Container.label instead"),this.label},set name(e){i.deprecation(i.v8_0_0,"Container.name property has been removed, use Container.label instead"),this.label=e},getChildByName(e,t=!1){return this.getChildByLabel(e,t)},getChildByLabel(e,t=!1){const r=this.children;for(let t=0;t=0;r--){const i=e.effects[r];s[i.pipe].pop(i,e,t)}}}t.buildInstructions=function(e,t){const r=e.root,n=e.instructionSet;n.reset();const s=t.renderPipes?t:t.batch.renderer,o=s.renderPipes;o.batch.buildStart(n),o.blendMode.buildStart(),o.colorMask.buildStart(),r.sortableChildren&&r.sortChildren(),i(r,n,s,!0),o.batch.buildEnd(n),o.blendMode.buildEnd(n)},t.collectAllRenderables=r},12057:function(e,t){"use strict";t.checkChildrenDidChange=function e(t,r){const i=t.children;for(let t=0;t>24&255)/255)*255,o=((255&e)<<16)+(65280&e)+(e>>16&255),a=16777215&r;let l;return l=o===n||a===n?o+a-n:i.mixHexColors(o,a,.5),l+(s<<24)}},55747:function(e,t){"use strict";t.mixHexColors=function(e,t,r){const i=e>>16&255,n=e>>8&255,s=255&e;return(i+((t>>16&255)-i)*r<<16)+(n+((t>>8&255)-n)*r<<8)+(s+((255&t)-s)*r)}},89358:function(e,t){"use strict";t.multiplyHexColors=function(e,t){return 16777215!==e&&t?16777215!==t&&e?((e>>16&255)*(t>>16&255)/255<<16)+((e>>8&255)*(t>>8&255)/255<<8)+(255&e)*(255&t)/255:e:t}},24417:function(e,t){"use strict";t.updateLocalTransform=function(e,t){const r=t._scale,i=t._pivot,n=t._position,s=r._x,o=r._y,a=i._x,l=i._y;e.a=t._cx*s,e.b=t._sx*s,e.c=t._cy*o,e.d=t._sy*o,e.tx=n._x-(a*e.a+l*e.c),e.ty=n._y-(a*e.b+l*e.d)}},48496:function(e,t,r){"use strict";var i=r(74599),n=r(51643),s=r(82397);const o=new i.Container,a=i.UPDATE_VISIBLE|i.UPDATE_COLOR|i.UPDATE_BLEND;function l(e){const t=e.root;let r;if(e.renderGroupParent){const i=e.renderGroupParent;e.worldTransform.appendFrom(t.relativeGroupTransform,i.worldTransform),e.worldColor=s.mixColors(t.groupColor,i.worldColor),r=t.groupAlpha*i.worldAlpha}else e.worldTransform.copyFrom(t.localTransform),e.worldColor=t.localColor,r=t.localAlpha;r=r<0?0:r>1?1:r,e.worldAlpha=r,e.worldColorAlpha=e.worldColor+((255*r|0)<<24)}function u(e,t,r){if(t===e.updateTick)return;e.updateTick=t,e.didChange=!1;const i=e.localTransform;e.updateLocalTransform();const n=e.parent;if(n&&!n.renderGroup?(r|=e._updateFlags,e.relativeGroupTransform.appendFrom(i,n.relativeGroupTransform),r&a&&h(e,n,r)):(r=e._updateFlags,e.relativeGroupTransform.copyFrom(i),r&a&&h(e,o,r)),!e.renderGroup){const i=e.children,n=i.length;for(let e=0;e1?1:r,e.groupAlpha=r,e.groupColorAlpha=e.groupColor+((255*r|0)<<24)}r&i.UPDATE_BLEND&&(e.groupBlendMode="inherit"===e.localBlendMode?t.groupBlendMode:e.localBlendMode),r&i.UPDATE_VISIBLE&&(e.globalDisplayStatus=e.localDisplayStatus&t.globalDisplayStatus),e._updateFlags=0}t.updateRenderGroupTransform=l,t.updateRenderGroupTransforms=function e(t,r=!1){l(t);const i=t.childrenToUpdate,s=t.updateTick++;for(const e in i){const r=Number(e),o=i[e],a=o.list,l=o.index;for(let e=0;e"},uTransformMatrix:{value:new n.Matrix,type:"mat3x3"},uRound:{value:0,type:"f32"}}),t=s.getMaxTexturesPerBatch(),r=o.compileHighShaderGlProgram({name:"graphics",bits:[a.colorBitGl,l.generateTextureBatchBitGl(t),u.localUniformBitGl,h.roundPixelsBitGl]});this.shader=new d.Shader({glProgram:r,resources:{localUniforms:e,batchSamplers:c.getBatchSamplersUniformGroup(t)}})}execute(e,t){const r=t.context,i=r.customShader||this.shader,n=e.renderer,s=n.graphicsContext,{batcher:o,instructions:a}=s.getContextRenderData(r);i.groups[0]=n.globalUniforms.bindGroup,n.state.set(e.state),n.shader.bind(i),n.geometry.bind(o.geometry,i.glProgram);const l=a.instructions;for(let e=0;e"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uRound:{value:0,type:"f32"}}),t=a.compileHighShaderGpuProgram({name:"graphics",bits:[l.colorBit,u.generateTextureBatchBit(s.getMaxTexturesPerBatch()),h.localUniformBitGroup2,c.roundPixelsBit]});this.shader=new d.Shader({gpuProgram:t,resources:{localUniforms:e}})}execute(e,t){const r=t.context,i=r.customShader||this.shader,n=e.renderer,s=n.graphicsContext,{batcher:a,instructions:l}=s.getContextRenderData(r),u=n.encoder;u.setPipelineFromGeometryProgramAndState(a.geometry,i.gpuProgram,e.state),u.setGeometry(a.geometry,i.gpuProgram);const h=n.globalUniforms.bindGroup;u.setBindGroup(0,h,i.gpuProgram);const c=n.renderPipes.uniformBatch.getUniformBindGroup(i.resources.localUniforms,!0);u.setBindGroup(2,c,i.gpuProgram);const d=l.instructions;for(let e=0;e>24&255)/255;t[r++]=(255&e)/255*i,t[r++]=(e>>8&255)/255*i,t[r++]=(e>>16&255)/255*i,t[r++]=i},t.colorToUniform=function(e,t,r,i){r[i++]=(e>>16&255)/255,r[i++]=(e>>8&255)/255,r[i++]=(255&e)/255,r[i++]=t}},83016:function(e,t,r){"use strict";var i=r(17073),n=r(2608),s=r(20832);i.extensions.add(s.GraphicsPipe),i.extensions.add(n.GraphicsContextSystem)},46141:function(e,t,r){"use strict";var i=r(15685),n=r(89358);const s=new i.Matrix;t.BatchableGraphics=class{constructor(){this.packAsQuad=!1,this.batcherName="default",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const e=this.baseColor,t=e>>16|65280&e|(255&e)<<16,r=this.renderable;return r?n.multiplyHexColors(t,r.groupColor)+(this.alpha*r.groupAlpha*255<<24):t+(255*this.alpha<<24)}get transform(){return this.renderable?.groupTransform||s}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData}reset(){this.applyTransform=!0,this.renderable=null}}},45455:function(){},69639:function(e,t,r){"use strict";var i=r(60094),n=r(26138),s=r(90537);class o extends n.ViewContainer{constructor(e){e instanceof s.GraphicsContext&&(e={context:e});const{context:t,roundPixels:r,...i}=e||{};super({label:"Graphics",...i}),this.renderPipeId="graphics",this._context=t||(this._ownedContext=new s.GraphicsContext),this._context.on("update",this.onViewUpdate,this),this.allowChildren=!1,this.roundPixels=r??!1}set context(e){e!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=e,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}addBounds(e){e.addBounds(this._context.bounds)}containsPoint(e){return this._context.containsPoint(e)}onViewUpdate(){if(this._didViewChangeTick++,this._didGraphicsUpdate=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):!0!==e&&!0!==e?.context||this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e)}_callContextMethod(e,t){return this.context[e](...t),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e}clone(e=!1){if(e)return new o(this._context.clone());this._ownedContext=null;return new o(this._context)}lineStyle(e,t,r){i.deprecation(i.v8_0_0,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const n={};return e&&(n.width=e),t&&(n.color=t),r&&(n.alpha=r),this.context.strokeStyle=n,this}beginFill(e,t){i.deprecation(i.v8_0_0,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const r={};return e&&(r.color=e),t&&(r.alpha=t),this.context.fillStyle=r,this}endFill(){i.deprecation(i.v8_0_0,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const e=this.context.strokeStyle;return e.width===s.GraphicsContext.defaultStrokeStyle.width&&e.color===s.GraphicsContext.defaultStrokeStyle.color&&e.alpha===s.GraphicsContext.defaultStrokeStyle.alpha||this.context.stroke(),this}drawCircle(...e){return i.deprecation(i.v8_0_0,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return i.deprecation(i.v8_0_0,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return i.deprecation(i.v8_0_0,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return i.deprecation(i.v8_0_0,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return i.deprecation(i.v8_0_0,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return i.deprecation(i.v8_0_0,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}}t.Graphics=o},90537:function(e,t,r){"use strict";var i=r(5323),n=r(58778),s=r(15685),o=r(26553),a=r(84463),l=r(78739),u=r(60094),h=r(14786),c=r(7639),d=r(92248),p=r(97886);const f=new o.Point,m=new s.Matrix,g=class e extends i{constructor(){super(...arguments),this.uid=l.uid("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this._activePath=new c.GraphicsPath,this._transform=new s.Matrix,this._fillStyle={...e.defaultFillStyle},this._strokeStyle={...e.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new h.Bounds,this._boundsDirty=!0}clone(){const t=new e;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=p.toFillStyle(t,e.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=p.toStrokeStyle(t,e.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=p.toFillStyle(t,e.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=p.toFillStyle(t,e.defaultStrokeStyle),this}texture(e,t,r,i,s,o){return this.instructions.push({action:"texture",data:{image:e,dx:r||0,dy:i||0,dw:s||e.frame.width,dh:o||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t?n.Color.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new c.GraphicsPath,this}fill(t,r){let i;const n=this.instructions[this.instructions.length-1];return i=0===this._tick&&n&&"stroke"===n.action?n.data.path:this._activePath.clone(),i?(null!=t&&(void 0!==r&&"number"==typeof t&&(u.deprecation(u.v8_0_0,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:r}),this._fillStyle=p.toFillStyle(t,e.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:e,y:t}=this._activePath.getLastPoint(o.Point.shared);this._activePath.clear(),this._activePath.moveTo(e,t)}stroke(t){let r;const i=this.instructions[this.instructions.length-1];return r=0===this._tick&&i&&"fill"===i.action?i.data.path:this._activePath.clone(),r?(null!=t&&(this._strokeStyle=p.toStrokeStyle(t,e.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){const t=this.instructions[this.instructions.length-1-e],r=this._activePath.clone();if(t&&("stroke"===t.action||"fill"===t.action)){if(!t.data.hole){t.data.hole=r;break}t.data.hole.addPath(r)}}return this._initNextPathLocation(),this}arc(e,t,r,i,n,s){this._tick++;const o=this._transform;return this._activePath.arc(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,r,i,n,s),this}arcTo(e,t,r,i,n){this._tick++;const s=this._transform;return this._activePath.arcTo(s.a*e+s.c*t+s.tx,s.b*e+s.d*t+s.ty,s.a*r+s.c*i+s.tx,s.b*r+s.d*i+s.ty,n),this}arcToSvg(e,t,r,i,n,s,o){this._tick++;const a=this._transform;return this._activePath.arcToSvg(e,t,r,i,n,a.a*s+a.c*o+a.tx,a.b*s+a.d*o+a.ty),this}bezierCurveTo(e,t,r,i,n,s,o){this._tick++;const a=this._transform;return this._activePath.bezierCurveTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*r+a.c*i+a.tx,a.b*r+a.d*i+a.ty,a.a*n+a.c*s+a.tx,a.b*n+a.d*s+a.ty,o),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,r,i){return this._tick++,this._activePath.ellipse(e,t,r,i,this._transform.clone()),this}circle(e,t,r){return this._tick++,this._activePath.circle(e,t,r,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;const r=this._transform;return this._activePath.lineTo(r.a*e+r.c*t+r.tx,r.b*e+r.d*t+r.ty),this}moveTo(e,t){this._tick++;const r=this._transform,i=this._activePath.instructions,n=r.a*e+r.c*t+r.tx,s=r.b*e+r.d*t+r.ty;return 1===i.length&&"moveTo"===i[0].action?(i[0].data[0]=n,i[0].data[1]=s,this):(this._activePath.moveTo(n,s),this)}quadraticCurveTo(e,t,r,i,n){this._tick++;const s=this._transform;return this._activePath.quadraticCurveTo(s.a*e+s.c*t+s.tx,s.b*e+s.d*t+s.ty,s.a*r+s.c*i+s.tx,s.b*r+s.d*i+s.ty,n),this}rect(e,t,r,i){return this._tick++,this._activePath.rect(e,t,r,i,this._transform.clone()),this}roundRect(e,t,r,i,n){return this._tick++,this._activePath.roundRect(e,t,r,i,n,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,r,i,n=0,s){return this._tick++,this._activePath.regularPoly(e,t,r,i,n,s),this}roundPoly(e,t,r,i,n,s){return this._tick++,this._activePath.roundPoly(e,t,r,i,n,s),this}roundShape(e,t,r,i){return this._tick++,this._activePath.roundShape(e,t,r,i),this}filletRect(e,t,r,i,n){return this._tick++,this._activePath.filletRect(e,t,r,i,n),this}chamferRect(e,t,r,i,n,s){return this._tick++,this._activePath.chamferRect(e,t,r,i,n,s),this}star(e,t,r,i,n=0,s=0){return this._tick++,this._activePath.star(e,t,r,i,n,s,this._transform.clone()),this}svg(e){return this._tick++,d.SVGParser(e,this),this}restore(){const e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,r,i,n,o){return e instanceof s.Matrix?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,r,i,n,o),this)}transform(e,t,r,i,n,o){return e instanceof s.Matrix?(this._transform.append(e),this):(m.set(e,t,r,i,n,o),this._transform.append(m),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=!0,this._boundsDirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;const e=this._bounds;e.clear();for(let t=0;t{l.BigPool.return(e)}))}destroy(){for(const e in this._gpuContextHash)this._gpuContextHash[e]&&this.onGraphicsContextDestroy(this._gpuContextHash[e].context)}};d.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem,i.ExtensionType.CanvasSystem],name:"graphicsContext"},d.defaultOptions={bezierSmoothness:.5};let p=d;t.GpuGraphicsContext=h,t.GraphicsContextRenderData=c,t.GraphicsContextSystem=p},20832:function(e,t,r){"use strict";var i=r(17073),n=r(55141),s=r(86169),o=r(76818),a=r(46141);class l{constructor(e,t){this.state=n.State.for2d(),this._graphicsBatchesHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=e.context,r=!!this._graphicsBatchesHash[e.uid],i=this.renderer.graphicsContext.updateGpuContext(t);return!(!i.isBatchable&&r===i.isBatchable)}addRenderable(e,t){const r=this.renderer.graphicsContext.updateGpuContext(e.context);e._didGraphicsUpdate&&(e._didGraphicsUpdate=!1,this._rebuild(e)),r.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e))}updateRenderable(e){const t=this._graphicsBatchesHash[e.uid];if(t)for(let e=0;e{const r=s.BigPool.get(a.BatchableGraphics);return t.copyTo(r),r.renderable=e,r.roundPixels=i,r}));return void 0===this._graphicsBatchesHash[e.uid]&&e.on("destroyed",this._destroyRenderableBound),this._graphicsBatchesHash[e.uid]=n,n}_removeBatchForRenderable(e){this._graphicsBatchesHash[e].forEach((e=>{s.BigPool.return(e)})),this._graphicsBatchesHash[e]=null}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;for(const e in this._graphicsBatchesHash)this._removeBatchForRenderable(e);this._graphicsBatchesHash=null}}l.extension={type:[i.ExtensionType.WebGLPipes,i.ExtensionType.WebGPUPipes,i.ExtensionType.CanvasPipes],name:"graphics"},t.GraphicsPipe=l},50071:function(){},76393:function(e,t,r){"use strict";var i=r(2608);const n=8,s=1.1920929e-7,o=.01,a=0,l=0;function u(e,t,r,i,h,c,d,p,f,m,g){if(g>n)return;const _=Math.PI,x=(e+r)/2,b=(t+i)/2,v=(r+h)/2,y=(i+c)/2,T=(h+d)/2,S=(c+p)/2,E=(x+v)/2,w=(b+y)/2,A=(v+T)/2,M=(y+S)/2,P=(E+A)/2,R=(w+M)/2;if(g>0){let n=d-e,u=p-t;const g=Math.abs((r-d)*u-(i-p)*n),x=Math.abs((h-d)*u-(c-p)*n);let b,v;if(g>s&&x>s){if((g+x)*(g+x)<=m*(n*n+u*u)){if(a=_&&(b=2*_-b),v>=_&&(v=2*_-v),b+vl)return void f.push(r,i);if(v>l)return void f.push(h,c)}}}else if(g>s){if(g*g<=m*(n*n+u*u)){if(a=_&&(b=2*_-b),bl)return void f.push(r,i)}}else if(x>s){if(x*x<=m*(n*n+u*u)){if(a=_&&(b=2*_-b),bl)return void f.push(h,c)}}else if(n=P-(e+d)/2,u=R-(t+p)/2,n*n+u*u<=m)return void f.push(P,R)}u(e,t,x,b,E,w,P,R,f,m,g+1),u(P,R,A,M,T,S,d,p,f,m,g+1)}t.buildAdaptiveBezier=function(e,t,r,n,s,o,a,l,h,c){let d=(1-Math.min(.99,Math.max(0,c??i.GraphicsContextSystem.defaultOptions.bezierSmoothness)))/1;return d*=d,function(e,t,r,i,n,s,o,a,l,h){u(e,t,r,i,n,s,o,a,l,h,0),l.push(o,a)}(t,r,n,s,o,a,l,h,e,d),e}},69169:function(e,t,r){"use strict";var i=r(2608);const n=8,s=1.1920929e-7,o=.01,a=0;function l(e,t,r,i,u,h,c,d,p){if(p>n)return;const f=Math.PI,m=(t+i)/2,g=(r+u)/2,_=(i+h)/2,x=(u+c)/2,b=(m+_)/2,v=(g+x)/2;let y=h-t,T=c-r;const S=Math.abs((i-h)*T-(u-c)*y);if(S>s){if(S*S<=d*(y*y+T*T)){if(a=f&&(n=2*f-n),ns||o&&s>n)&&(l=2*Math.PI-l),a=a||Math.max(6,Math.floor(6*Math.pow(i,1/3)*(l/Math.PI)));let u=l/(a=Math.max(a,3)),h=n;u*=o?-1:1;for(let n=0;nc*l)}},67563:function(e,t,r){"use strict";var i=r(76393);const n=2*Math.PI,s={centerX:0,centerY:0,ang1:0,ang2:0},o=({x:e,y:t},r,i,n,s,o,a,l)=>{const u=n*(e*=r)-s*(t*=i),h=s*e+n*t;return l.x=u+o,l.y=h+a,l};function a(e,t){const r=-1.5707963267948966===t?-.551915024494:4/3*Math.tan(t/4),i=1.5707963267948966===t?.551915024494:r,n=Math.cos(e),s=Math.sin(e),o=Math.cos(e+t),a=Math.sin(e+t);return[{x:n-s*i,y:s+n*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}const l=(e,t,r,i)=>{let n=e*r+t*i;return n>1&&(n=1),n<-1&&(n=-1),(e*i-t*r<0?-1:1)*Math.acos(n)};t.buildArcToSvg=function(e,t,r,u,h,c,d,p=0,f=0,m=0){if(0===c||0===d)return;const g=Math.sin(p*n/360),_=Math.cos(p*n/360),x=_*(t-u)/2+g*(r-h)/2,b=-g*(t-u)/2+_*(r-h)/2;if(0===x&&0===b)return;c=Math.abs(c),d=Math.abs(d);const v=Math.pow(x,2)/Math.pow(c,2)+Math.pow(b,2)/Math.pow(d,2);v>1&&(c*=Math.sqrt(v),d*=Math.sqrt(v)),((e,t,r,i,s,o,a,u,h,c,d,p,f)=>{const m=Math.pow(s,2),g=Math.pow(o,2),_=Math.pow(d,2),x=Math.pow(p,2);let b=m*g-m*x-g*_;b<0&&(b=0),b/=m*x+g*_,b=Math.sqrt(b)*(a===u?-1:1);const v=b*s/o*p,y=b*-o/s*d,T=c*v-h*y+(e+r)/2,S=h*v+c*y+(t+i)/2,E=(d-v)/s,w=(p-y)/o,A=(-d-v)/s,M=(-p-y)/o,P=l(1,0,E,w);let R=l(E,w,A,M);0===u&&R>0&&(R-=n),1===u&&R<0&&(R+=n),f.centerX=T,f.centerY=S,f.ang1=P,f.ang2=R})(t,r,u,h,c,d,f,m,g,_,x,b,s);let{ang1:y,ang2:T}=s;const{centerX:S,centerY:E}=s;let w=Math.abs(T)/(n/4);Math.abs(1-w)<1e-7&&(w=1);const A=Math.max(Math.ceil(w),1);T/=A;let M=e[e.length-2],P=e[e.length-1];const R={x:0,y:0};for(let t=0;t=0&&a>=0&&n>=0&&s>=0))return t;const l=Math.ceil(2.3*Math.sqrt(o+a)),u=8*l+(n?4:0)+(s?4:0);if(0===u)return t;if(0===l)return t[0]=t[6]=r+n,t[1]=t[3]=i+s,t[2]=t[4]=r-n,t[5]=t[7]=i-s,t;let h=0,c=4*l+(n?2:0)+2,d=c,p=u,f=n+o,m=s,g=r+f,_=r-f,x=i+m;if(t[h++]=g,t[h++]=x,t[--c]=x,t[--c]=_,s){const e=i-m;t[d++]=_,t[d++]=e,t[--p]=e,t[--p]=g}for(let e=1;e0&&(n[s++]=l,n[s++]=u,n[s++]=l-1),l++;n[s++]=u+1,n[s++]=u,n[s++]=l-1}},n={...i,extension:{...i.extension,name:"ellipse"}},s={...i,extension:{...i.extension,name:"roundedRectangle"}};t.buildCircle=i,t.buildEllipse=n,t.buildRoundedRectangle=s},968:function(e,t,r){"use strict";var i=r(26553),n=r(88365),s=r(20593);function o(e,t,r,i,n,s,o,a){let l,u;o?(l=i,u=-r):(l=-i,u=r);const h=e-r*n+l,c=t-i*n+u,d=e+r*s+l,p=t+i*s+u;return a.push(h,c),a.push(d,p),2}function a(e,t,r,i,n,s,o,a){const l=r-e,u=i-t;let h=Math.atan2(l,u),c=Math.atan2(n-e,s-t);a&&hc&&(c+=2*Math.PI);let d=h;const p=c-h,f=Math.abs(p),m=Math.sqrt(l*l+u*u),g=1+(15*f*Math.sqrt(m)/Math.PI>>0),_=p/g;if(d+=_,a){o.push(e,t),o.push(r,i);for(let r=1,i=d;r=0&&("round"===m.join?S+=a(C,B,C-D*L,B-I*L,C-O*L,B-U*L,y,!1)+4:S+=2,y.push(C-O*N,B-U*N),y.push(C+O*L,B+U*L));continue}const h=(-D+P)*(-I+B)-(-D+C)*(-I+R),c=(-O+G)*(-U+B)-(-O+C)*(-U+F),d=(r*c-n*h)/l,p=(s*h-i*c)/l,f=(d-C)*(d-C)+(p-B)*(p-B),g=C+(d-C)*L,_=B+(p-B)*L,x=C-(d-C)*N,b=B-(p-B)*N,v=u?L:N;f<=Math.min(r*r+i*i,n*n+s*s)+v*v*A?"bevel"===m.join||f/A>M?(u?(y.push(g,_),y.push(C+D*N,B+I*N),y.push(g,_),y.push(C+O*N,B+U*N)):(y.push(C-D*L,B-I*L),y.push(x,b),y.push(C-O*L,B-U*L),y.push(x,b)),S+=2):"round"===m.join?u?(y.push(g,_),y.push(C+D*N,B+I*N),S+=a(C,B,C+D*N,B+I*N,C+O*N,B+U*N,y,!0)+4,y.push(g,_),y.push(C+O*N,B+U*N)):(y.push(C-D*L,B-I*L),y.push(x,b),S+=a(C,B,C-D*L,B-I*L,C-O*L,B-U*L,y,!1)+4,y.push(C-O*L,B-U*L),y.push(x,b)):(y.push(g,_),y.push(x,b)):(y.push(C-D*L,B-I*L),y.push(C+D*N,B+I*N),"round"===m.join?S+=u?a(C,B,C+D*N,B+I*N,C+O*N,B+U*N,y,!0)+2:a(C,B,C-D*L,B-I*L,C-O*L,B-U*L,y,!1)+2:"miter"===m.join&&f/A<=M&&(u?(y.push(x,b),y.push(x,b)):(y.push(g,_),y.push(g,_)),S+=2),y.push(C-O*L,B-U*L),y.push(C+O*N,B+U*N),S+=2)}P=e[2*(T-2)],R=e[2*(T-2)+1],C=e[2*(T-1)],B=e[2*(T-1)+1],D=-(R-B),I=P-C,k=Math.sqrt(D*D+I*I),D/=k,I/=k,D*=w,I*=w,y.push(C-D*L,B-I*L),y.push(C+D*N,B+I*N),b||("round"===m.cap?S+=a(C-D*(L-N)*.5,B-I*(L-N)*.5,C-D*L,B-I*L,C+D*N,B+I*N,y,!1)+2:"square"===m.cap&&(S+=o(C,B,D,I,L,N,!1,y)));const V=n.curveEps*n.curveEps;for(let e=E;e=0&&o>=0?(t[0]=i,t[1]=n,t[2]=i+s,t[3]=n,t[4]=i+s,t[5]=n+o,t[6]=i,t[7]=n+o,t):t},triangulate(e,t,r,i,n,s){let o=0;t[(i*=r)+o]=e[0],t[i+o+1]=e[1],o+=r,t[i+o]=e[2],t[i+o+1]=e[3],o+=r,t[i+o]=e[6],t[i+o+1]=e[7],o+=r,t[i+o]=e[4],t[i+o+1]=e[5],o+=r;const a=i/r;n[s++]=a,n[s++]=a+1,n[s++]=a+2,n[s++]=a+1,n[s++]=a+3,n[s++]=a+2}};t.buildRectangle=i},64778:function(e,t,r){"use strict";const i={extension:{type:r(17073).ExtensionType.ShapeBuilder,name:"triangle"},build(e,t){return t[0]=e.x,t[1]=e.y,t[2]=e.x2,t[3]=e.y2,t[4]=e.x3,t[5]=e.y3,t},triangulate(e,t,r,i,n,s){let o=0;t[(i*=r)+o]=e[0],t[i+o+1]=e[1],o+=r,t[i+o]=e[2],t[i+o+1]=e[3],o+=r,t[i+o]=e[4],t[i+o+1]=e[5];const a=i/r;n[s++]=a,n[s++]=a+1,n[s++]=a+2}};t.buildTriangle=i},88365:function(e,t){"use strict";t.closePointEps=1e-4,t.curveEps=1e-4},37553:function(e,t,r){"use strict";var i=r(58778),n=r(42932),s=r(15685),o=r(75813),a=r(84463),l=r(78739);const u=class e{constructor(e,t,r,i){this.uid=l.uid("fillGradient"),this.type="linear",this.gradientStops=[],this._styleKey=null,this.x0=e,this.y0=t,this.x1=r,this.y1=i}addColorStop(e,t){return this.gradientStops.push({offset:e,color:i.Color.shared.setValue(t).toHexa()}),this._styleKey=null,this}buildLinearGradient(){const t=e.defaultTextureSize,{gradientStops:r}=this,i=n.DOMAdapter.get().createCanvas();i.width=t,i.height=t;const l=i.getContext("2d"),u=l.createLinearGradient(0,0,e.defaultTextureSize,1);for(let e=0;e`${e.offset}-${e.color}`)).join("-"),t=this.texture.uid,r=this.transform.toArray().join("-");return`fill-gradient-${this.uid}-${e}-${t}-${r}-${this.x0}-${this.y0}-${this.x1}-${this.y1}`}};u.defaultTextureSize=256;let h=u;t.FillGradient=h},16315:function(e,t,r){"use strict";var i=r(15685),n=r(78739);const s={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};t.FillPattern=class{constructor(e,t){this.uid=n.uid("fillPattern"),this.transform=new i.Matrix,this._styleKey=null,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=s[t].addressModeU,e.source.style.addressModeV=s[t].addressModeV)}setTransform(e){const t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._styleKey=null}get styleKey(){return this._styleKey||(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`),this._styleKey}}},7639:function(e,t,r){"use strict";var i=r(26553),n=r(78739),s=r(95190),o=r(93940),a=r(26289);class l{constructor(e){this.instructions=[],this.uid=n.uid("graphicsPath"),this._dirty=!0,"string"==typeof e?o.SVGToGraphicsPath(e,this):this.instructions=e?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new a.ShapePath(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,t]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=!0,this}bezierCurveToShort(e,t,r,n,s){const o=this.instructions[this.instructions.length-1],a=this.getLastPoint(i.Point.shared);let l=0,u=0;if(o&&"bezierCurveTo"===o.action){l=o.data[2],u=o.data[3];const e=a.x,t=a.y;l=e+(e-l),u=t+(t-u)}else l=a.x,u=a.y;return this.instructions.push({action:"bezierCurveTo",data:[l,u,e,t,r,n,s]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=!0,this}quadraticCurveToShort(e,t,r){const n=this.instructions[this.instructions.length-1],s=this.getLastPoint(i.Point.shared);let o=0,a=0;if(n&&"quadraticCurveTo"===n.action){o=n.data[0],a=n.data[1];const e=s.x,t=s.y;o=e+(e-o),a=t+(t-a)}else o=s.x,a=s.y;return this.instructions.push({action:"quadraticCurveTo",data:[o,a,e,t,r]}),this._dirty=!0,this}rect(e,t,r,i,n){return this.instructions.push({action:"rect",data:[e,t,r,i,n]}),this._dirty=!0,this}circle(e,t,r,i){return this.instructions.push({action:"circle",data:[e,t,r,i]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=!0,this}star(e,t,r,i,n,s,o){n=n||i/2;const a=-1*Math.PI/2+s,l=2*r,u=2*Math.PI/l,h=[];for(let r=0;r=2;e-=2)u[e]===u[e-2]&&u[e-1]===u[e-3]&&u.splice(e-1,2);return this.poly(u,!0,s)}ellipse(e,t,r,i,s){return this.drawShape(new n.Ellipse(e,t,r,i),s),this}roundRect(e,t,r,i,n,s){return this.drawShape(new a.RoundedRectangle(e,t,r,i,n),s),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let r=this._currentPoly;return r&&this.endPoly(),r=new s.Polygon,r.points.push(e,t),this._currentPoly=r,this}endPoly(e=!1){const t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new s.Polygon,e)){const e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let t=e.shape.x,r=e.shape.y;if(e.transform&&!e.transform.isIdentity()){const i=e.transform,n=t;t=i.a*t+i.c*r+i.tx,r=i.b*n+i.d*r+i.ty}this._currentPoly.points.push(t,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t{const r=t.x-e.x,i=t.y-e.y,n=Math.sqrt(r*r+i*i);return{len:n,nx:r/n,ny:i/n}},n=(t,r)=>{0===t?e.moveTo(r.x,r.y):e.lineTo(r.x,r.y)};let s=t[t.length-1];for(let o=0;o0&&(p=-1,f=!0);const m=d/2;let g,_=Math.abs(Math.cos(m)*l/Math.sin(m));_>Math.min(h.len/2,c.len/2)?(_=Math.min(h.len/2,c.len/2),g=Math.abs(_*Math.sin(m)/Math.cos(m))):g=l;const x=a.x+c.nx*_+-c.ny*g*p,b=a.y+c.ny*_+c.nx*g*p,v=Math.atan2(h.ny,h.nx)+Math.PI/2*p,y=Math.atan2(c.ny,c.nx)-Math.PI/2*p;0===o&&e.moveTo(x+Math.cos(v)*g,b+Math.sin(v)*g),e.arc(x,b,g,v,y,f),s=a}},t.roundedShapeQuadraticCurve=function(e,t,r,i){const n=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),s=(e,t,r)=>({x:e.x+(t.x-e.x)*r,y:e.y+(t.y-e.y)*r}),o=t.length;for(let a=0;aparseInt(e,10))),t.context.poly(T,!0),r&&t.context.fill(),a&&t.context.stroke();break;case"polyline":S=e.getAttribute("points"),T=S.match(/\d+/g).map((e=>parseInt(e,10))),t.context.poly(T,!1),a&&t.context.stroke();break;case"g":case"svg":break;default:console.info(`[SVG parser] <${e.nodeName}> elements unsupported`)}for(let e=0;e0&&(o=s.pop(),o?(a=o.startX,l=o.startY):(a=0,l=0)),o=null;break;default:n.warn(`Unknown SVG path command: ${u}`)}"Z"!==u&&"z"!==u&&null===o&&(o={startX:a,startY:l},s.push(o))}return t}},42892:function(e,t,r){"use strict";var i=r(17073),n=r(42181),s=r(44307),o=r(54132),a=r(84463),l=r(86169),u=r(46141),h=r(76788),c=r(968),d=r(57469),p=r(53976),f=r(64778),m=r(47464);const g={};i.extensions.handleByMap(i.ExtensionType.ShapeBuilder,g),i.extensions.add(p.buildRectangle,d.buildPolygon,f.buildTriangle,h.buildCircle,h.buildEllipse,h.buildRoundedRectangle);const _=new n.Rectangle;function x(e,t,r){const{vertices:i,uvs:n,indices:s}=r,a=s.length,h=i.length/2,c=[],d=g.rectangle,p=_,f=e.image;p.x=e.dx,p.y=e.dy,p.width=e.dw,p.height=e.dh;const m=e.transform;d.build(p,c),m&&o.transformVertices(c,m),d.triangulate(c,i,2,h,s,a);const x=f.uvs;n.push(x.x0,x.y0,x.x1,x.y1,x.x3,x.y3,x.x2,x.y2);const b=l.BigPool.get(u.BatchableGraphics);b.indexOffset=a,b.indexSize=s.length-a,b.attributeOffset=h,b.attributeSize=i.length/2-h,b.baseColor=e.style,b.alpha=e.alpha,b.texture=f,b.geometryData=r,t.push(b)}function b(e,t,r,i,n,h){const{vertices:d,uvs:p,indices:f}=h,_=e.shapePrimitives.length-1;e.shapePrimitives.forEach((({shape:e,transform:x},b)=>{const v=f.length,y=d.length/2,T=[],S=g[e.type];if(S.build(e,T),x&&o.transformVertices(T,x),i){const r=e.closePath??!0,i=t;c.buildLine(T,i,!1,r,d,2,y,f,v)}else if(r&&_===b){0!==_&&console.warn("[Pixi Graphics] only the last shape have be cut out");const e=[],t=T.slice(),i=function(e){if(!e)return[];const t=e.shapePrimitives,r=[];for(let e=0;e{e.push(t.length/2),t.push(...r)})),m.triangulateWithHoles(t,e,d,2,y,f,v)}else S.triangulate(T,d,2,y,f,v);const E=p.length/2,w=t.texture;if(w!==a.Texture.WHITE){const e=t.matrix;e&&(x&&e.append(x.clone().invert()),s.buildUvs(d,2,y,p,E,2,d.length/2-y,e))}else s.buildSimpleUvs(p,E,2,d.length/2-y);const A=l.BigPool.get(u.BatchableGraphics);A.indexOffset=v,A.indexSize=f.length-v,A.attributeOffset=y,A.attributeSize=d.length/2-y,A.baseColor=t.color,A.alpha=t.alpha,A.texture=w,A.geometryData=h,n.push(A)}))}t.buildContextBatches=function(e,t){const{geometryData:r,batches:i}=t;i.length=0,r.indices.length=0,r.vertices.length=0,r.uvs.length=0;for(let t=0;t{const a=o.length,u=t.length/2,h=[],d=c[e.type];d.build(e,h),s&&n.transformVertices(h,s),d.triangulate(h,t,2,u,o,a);const p=r.length/2;l?(s&&l.append(s.clone().invert()),i.buildUvs(t,2,u,r,p,2,t.length/2-u,l)):i.buildSimpleUvs(r,p,2,t.length/2-u)}));const u=e.out;return u?(u.positions=new Float32Array(t),u.uvs=new Float32Array(r),u.indices=new Uint32Array(o),u):new s.MeshGeometry({positions:new Float32Array(t),uvs:new Float32Array(r),indices:new Uint32Array(o)})}},97886:function(e,t,r){"use strict";var i=r(58778),n=r(15685),s=r(84463),o=r(37553),a=r(16315);function l(e){return e instanceof a.FillPattern}function u(e){return e instanceof o.FillGradient}function h(e,t,r){return e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,{...r,...e}}function c(e,t,r){return t.buildLinearGradient(),e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,{...r,...e}}function d(e,t){if(null==e)return null;const r={},o=e;return function(e){return i.Color.isColorLike(e)}(e)?function(e,t,r){const n=i.Color.shared.setValue(t??0);return e.color=n.toNumber(),e.alpha=1===n.alpha?r.alpha:n.alpha,e.texture=s.Texture.WHITE,{...r,...e}}(r,e,t):l(e)?h(r,e,t):u(e)?c(r,e,t):o.fill&&l(o.fill)?h(o,o.fill,t):o.fill&&u(o.fill)?c(o,o.fill,t):function(e,t){const r={...t,...e};if(r.texture){if(r.texture!==s.Texture.WHITE){const e=r.matrix?.invert()||new n.Matrix;e.translate(r.texture.frame.x,r.texture.frame.y),e.scale(1/r.texture.source.width,1/r.texture.source.height),r.matrix=e}const e=r.texture.source.style;"clamp-to-edge"===e.addressMode&&(e.addressMode="repeat",e.update())}const o=i.Color.shared.setValue(r.color);return r.alpha*=o.alpha,r.color=o.toNumber(),r.matrix=r.matrix?r.matrix.clone():null,r}(o,t)}t.toFillStyle=d,t.toStrokeStyle=function(e,t){const{width:r,alignment:i,miterLimit:n,cap:s,join:o,...a}=t,l=d(e,a);return l?{width:r,alignment:i,miterLimit:n,cap:s,join:o,...l}:null}},20593:function(e,t){"use strict";t.getOrientationOfPoints=function(e){const t=e.length;if(t<6)return 1;let r=0;for(let i=0,n=e[t-2],s=e[t-1];i0&&(r.source.style.addressMode="repeat"),super(i.definedProps({...a,texture:r,geometry:l})),this.autoUpdate=!0,this.onRender=this._render}_render(){const e=this.geometry;(this.autoUpdate||e._width!==this.texture.height)&&(e._width=this.texture.height,e.update())}};o.defaultOptions={textureScale:0};let a=o;t.MeshRope=a},14749:function(e,t,r){"use strict";var i=r(6877),n=r(37086),s=r(46525);class o extends n.Mesh{constructor(e){const{texture:t,vertices:r,uvs:n,indices:o,topology:a,...l}=e,u=new s.MeshGeometry(i.definedProps({positions:r,uvs:n,indices:o,topology:a}));super(i.definedProps({...l,texture:t,geometry:u})),this.autoUpdate=!0,this.onRender=this._render}get vertices(){return this.geometry.getBuffer("aPosition").data}set vertices(e){this.geometry.getBuffer("aPosition").data=e}_render(){this.autoUpdate&&this.geometry.getBuffer("aPosition").update()}}t.MeshSimple=o},11291:function(e,t,r){"use strict";var i=r(46525);const n=class e extends i.MeshGeometry{constructor(t){const{width:r,points:i,textureScale:n}={...e.defaultOptions,...t};super({positions:new Float32Array(4*i.length),uvs:new Float32Array(4*i.length),indices:new Uint32Array(6*(i.length-1))}),this.points=i,this._width=r,this.textureScale=n,this._build()}get width(){return this._width}_build(){const e=this.points;if(!e)return;const t=this.getBuffer("aPosition"),r=this.getBuffer("aUV"),i=this.getIndex();if(e.length<1)return;t.data.length/4!==e.length&&(t.data=new Float32Array(4*e.length),r.data=new Float32Array(4*e.length),i.data=new Uint16Array(6*(e.length-1)));const n=r.data,s=i.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;let o=0,a=e[0];const l=this._width*this.textureScale,u=e.length;for(let t=0;t0){const r=a.x-e[t].x,i=a.y-e[t].y,n=Math.sqrt(r*r+i*i);a=e[t],o+=n/l}else o=t/(u-1);n[r]=o,n[r+1]=0,n[r+2]=o,n[r+3]=1}let h=0;for(let e=0;e0?this.textureScale*this._width/2:this._width/2;for(let l=0;l1&&(c=1);const d=Math.sqrt(i*i+n*n);d<1e-6?(i=0,n=0):(i/=d,n/=d,i*=a,n*=a),s[h]=u.x+i,s[h+1]=u.y+n,s[h+2]=u.x-i,s[h+3]=u.y-n,r=u}this.buffers[0].update()}update(){this.textureScale>0?this._build():this.updateVertices()}};n.defaultOptions={width:200,points:[],textureScale:0};let s=n;t.RopeGeometry=s},65935:function(e,t,r){"use strict";var i=r(17073),n=r(15685),s=r(21380),o=r(74813),a=r(4116),l=r(36114),u=r(97505),h=r(84463),c=r(95190);class d{init(){const e=s.compileHighShaderGlProgram({name:"mesh",bits:[o.localUniformBitGl,l.textureBitGl,a.roundPixelsBitGl]});this._shader=new u.Shader({glProgram:e,resources:{uTexture:h.Texture.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3",value:new n.Matrix}}}})}execute(e,t){const r=e.renderer;let i=t._shader;if(i){if(!i.glProgram)return void c.warn("Mesh shader has no glProgram",t.shader)}else{i=this._shader;const e=t.texture,r=e.source;i.resources.uTexture=r,i.resources.uSampler=r.style,i.resources.textureUniforms.uniforms.uTextureMatrix=e.textureMatrix.mapCoord}i.groups[100]=r.globalUniforms.bindGroup,i.groups[101]=e.localUniformsBindGroup,r.encoder.draw({geometry:t._geometry,shader:i,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}d.extension={type:[i.ExtensionType.WebGLPipesAdaptor],name:"mesh"},t.GlMeshAdaptor=d},45136:function(e,t,r){"use strict";var i=r(17073),n=r(15685),s=r(21380),o=r(74813),a=r(4116),l=r(36114),u=r(97505),h=r(84463),c=r(95190);class d{init(){const e=s.compileHighShaderGpuProgram({name:"mesh",bits:[o.localUniformBit,l.textureBit,a.roundPixelsBit]});this._shader=new u.Shader({gpuProgram:e,resources:{uTexture:h.Texture.EMPTY._source,uSampler:h.Texture.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3",value:new n.Matrix}}}})}execute(e,t){const r=e.renderer;let i=t._shader;if(i){if(!i.gpuProgram)return void c.warn("Mesh shader has no gpuProgram",t.shader)}else i=this._shader,i.groups[2]=r.texture.getTextureBindGroup(t.texture);const n=i.gpuProgram;if(n.autoAssignGlobalUniforms&&(i.groups[0]=r.globalUniforms.bindGroup),n.autoAssignLocalUniforms){const t=e.localUniforms;i.groups[1]=r.renderPipes.uniformBatch.getUniformBindGroup(t,!0)}r.encoder.draw({geometry:t._geometry,shader:i,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}d.extension={type:[i.ExtensionType.WebGPUPipesAdaptor],name:"mesh"},t.GpuMeshAdapter=d},60862:function(e,t,r){"use strict";var i=r(17073),n=r(25784);i.extensions.add(n.MeshPipe)},58507:function(e,t){"use strict";t.BatchableMesh=class{constructor(){this.batcherName="default",this.packAsQuad=!1,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}get blendMode(){return this.renderable.groupBlendMode}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}get uvs(){const e=this.geometry.getBuffer("aUV"),t=e.data;let r=t;const i=this.texture.textureMatrix;return i.isSimple||(r=this._transformedUvs,this._textureMatrixUpdateId===i._updateID&&this._uvUpdateId===e._updateID||((!r||r.length"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new s.BindGroup({0:this.localUniforms}),this._meshDataHash=Object.create(null),this._gpuBatchableMeshHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=this._getMeshData(e),r=t.batched,i=e.batched;if(t.batched=i,r!==i)return!0;if(i){const r=e._geometry;if(r.indices.length!==t.indexSize||r.positions.length!==t.vertexSize)return t.indexSize=r.indices.length,t.vertexSize=r.positions.length,!0;const i=this._getBatchableMesh(e),n=e.texture;if(i.texture._source!==n._source&&i.texture._source!==n._source)return!i._batcher.checkAndUpdateTexture(i,n)}return!1}addRenderable(e,t){const r=this.renderer.renderPipes.batch,{batched:i}=this._getMeshData(e);if(i){const i=this._getBatchableMesh(e);i.texture=e._texture,i.geometry=e._geometry,r.addToBatch(i,t)}else r.break(t),t.add(e)}updateRenderable(e){if(e.batched){const t=this._gpuBatchableMeshHash[e.uid];t.texture=e._texture,t.geometry=e._geometry,t._batcher.updateElement(t)}}destroyRenderable(e){this._meshDataHash[e.uid]=null;const t=this._gpuBatchableMeshHash[e.uid];t&&(l.BigPool.return(t),this._gpuBatchableMeshHash[e.uid]=null),e.off("destroyed",this._destroyRenderableBound)}execute(e){if(!e.isRenderable)return;e.state.blendMode=a.getAdjustedBlendModeBlend(e.groupBlendMode,e.texture._source);const t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),u.color32BitToUniform(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e)}_getMeshData(e){return this._meshDataHash[e.uid]||this._initMeshData(e)}_initMeshData(e){return this._meshDataHash[e.uid]={batched:e.batched,indexSize:e._geometry.indices?.length,vertexSize:e._geometry.positions?.length},e.on("destroyed",this._destroyRenderableBound),this._meshDataHash[e.uid]}_getBatchableMesh(e){return this._gpuBatchableMeshHash[e.uid]||this._initBatchableMesh(e)}_initBatchableMesh(e){const t=l.BigPool.get(h.BatchableMesh);return t.renderable=e,t.texture=e._texture,t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,this._gpuBatchableMeshHash[e.uid]=t,t}destroy(){for(const e in this._gpuBatchableMeshHash)this._gpuBatchableMeshHash[e]&&l.BigPool.return(this._gpuBatchableMeshHash[e]);this._gpuBatchableMeshHash=null,this._meshDataHash=null,this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}c.extension={type:[i.ExtensionType.WebGLPipes,i.ExtensionType.WebGPUPipes,i.ExtensionType.CanvasPipes],name:"mesh"},t.MeshPipe=c},86957:function(e,t){"use strict";t.getTextureDefaultMatrix=function(e,t){const{width:r,height:i}=e.frame;return t.scale(1/r,1/i),t}},2600:function(e,t,r){"use strict";var i=r(84463),n=r(35292),s=r(63983),o=r(10701);class a extends o.Sprite{constructor(...e){let t=e[0];Array.isArray(e[0])&&(t={textures:e[0],autoUpdate:e[1]});const{textures:r,autoUpdate:n,...s}=t,[o]=r;super({...s,texture:o instanceof i.Texture?o:o.texture}),this._textures=null,this._durations=null,this._autoUpdate=n??!0,this._isConnectedToTicker=!1,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=r}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(s.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(s.Ticker.shared.add(this.update,this,n.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(e){this.stop(),this.currentFrame=e}gotoAndPlay(e){this.currentFrame=e,this.play()}update(e){if(!this._playing)return;const t=e.deltaTime,r=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){let e=this._currentTime%1*this._durations[this.currentFrame];for(e+=r/60*1e3;e<0;)this._currentTime--,e+=this._durations[this.currentFrame];const i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);e>=this._durations[this.currentFrame];)e-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=e/this._durations[this.currentFrame]}else this._currentTime+=r;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei)&&this.onLoop(),this._updateTexture())}_updateTexture(){const e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this.texture=this._textures[e],this.updateAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(){this.stop(),super.destroy(),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(e){const t=[];for(let r=0;rthis.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${e}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this._updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(s.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(s.Ticker.shared.add(this.update,this),this._isConnectedToTicker=!0))}}t.AnimatedSprite=a},76596:function(e,t,r){"use strict";var i=r(27574);const n=class e extends i.PlaneGeometry{constructor(t={}){super({width:(t={...e.defaultOptions,...t}).width,height:t.height,verticesX:4,verticesY:4}),this.update(t)}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this.updateUvs(),this.updatePositions()}updatePositions(){const e=this.positions,t=this._leftWidth+this._rightWidth,r=this.width>t?1:this.width/t,i=this._topHeight+this._bottomHeight,n=this.height>i?1:this.height/i,s=Math.min(r,n);e[9]=e[11]=e[13]=e[15]=this._topHeight*s,e[17]=e[19]=e[21]=e[23]=this.height-this._bottomHeight*s,e[25]=e[27]=e[29]=e[31]=this.height,e[2]=e[10]=e[18]=e[26]=this._leftWidth*s,e[4]=e[12]=e[20]=e[28]=this.width-this._rightWidth*s,e[6]=e[14]=e[22]=e[30]=this.width,this.getBuffer("aPosition").update()}updateUvs(){const e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;const t=1/this._originalWidth,r=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update()}};n.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let s=n;t.NineSliceGeometry=s},33449:function(e,t,r){"use strict";var i=r(84463),n=r(60094),s=r(26138),o=r(76596);const a=class e extends s.ViewContainer{constructor(t){t instanceof i.Texture&&(t={texture:t});const{width:r,height:n,leftWidth:s,rightWidth:a,topHeight:l,bottomHeight:u,texture:h,roundPixels:c,...d}=t;super({label:"NineSliceSprite",...d}),this.renderPipeId="nineSliceSprite",this.batched=!0,this._didSpriteUpdate=!0,this._leftWidth=s??h?.defaultBorders?.left??o.NineSliceGeometry.defaultOptions.leftWidth,this._topHeight=l??h?.defaultBorders?.top??o.NineSliceGeometry.defaultOptions.topHeight,this._rightWidth=a??h?.defaultBorders?.right??o.NineSliceGeometry.defaultOptions.rightWidth,this._bottomHeight=u??h?.defaultBorders?.bottom??o.NineSliceGeometry.defaultOptions.bottomHeight,this.bounds.maxX=this._width=r??h.width??o.NineSliceGeometry.defaultOptions.width,this.bounds.maxY=this._height=n??h.height??o.NineSliceGeometry.defaultOptions.height,this.allowChildren=!1,this.texture=h??e.defaultOptions.texture,this.roundPixels=c??!1}get bounds(){return this._bounds}get width(){return this._width}set width(e){this.bounds.maxX=this._width=e,this.onViewUpdate()}get height(){return this._height}set height(e){this.bounds.maxY=this._height=e,this.onViewUpdate()}setSize(e,t){"object"==typeof e&&(t=e.height??e.width,e=e.width),this.bounds.maxX=this._width=e,this.bounds.maxY=this._height=t??e,this.onViewUpdate()}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate()}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate()}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate()}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate()}get texture(){return this._texture}set texture(e){e||(e=i.Texture.EMPTY);const t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate())}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}onViewUpdate(){if(this._didViewChangeTick++,this._didSpriteUpdate=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}addBounds(e){const t=this.bounds;e.addFrame(t.minX,t.minY,t.maxX,t.maxY)}destroy(e){super.destroy(e);if("boolean"==typeof e?e:e?.texture){const t="boolean"==typeof e?e:e?.textureSource;this._texture.destroy(t)}this._texture=null}};a.defaultOptions={texture:i.Texture.EMPTY};let l=a;t.NineSlicePlane=class extends l{constructor(...e){let t=e[0];t instanceof i.Texture&&(n.deprecation(n.v8_0_0,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),n.deprecation(n.v8_0_0,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t)}},t.NineSliceSprite=l},87577:function(e,t,r){"use strict";var i=r(17073),n=r(86169),s=r(58507),o=r(76596);class a{constructor(e){this._gpuSpriteHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e}addRenderable(e,t){const r=this._getGpuSprite(e);e._didSpriteUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r,t)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e._didSpriteUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t)}validateRenderable(e){const t=e._texture,r=this._getGpuSprite(e);return r.texture._source!==t._source&&!r._batcher.checkAndUpdateTexture(r,t)}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];n.BigPool.return(t.geometry),n.BigPool.return(t),this._gpuSpriteHash[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}_updateBatchableSprite(e,t){e._didSpriteUpdate=!1,t.geometry.update(e),t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=n.BigPool.get(s.BatchableMesh);return t.geometry=n.BigPool.get(o.NineSliceGeometry),t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._didSpriteUpdate=!0,this._gpuSpriteHash[e.uid]=t,e.on("destroyed",this._destroyRenderableBound),t}destroy(){for(const e in this._gpuSpriteHash){this._gpuSpriteHash[e].geometry.destroy()}this._gpuSpriteHash=null,this._renderer=null}}a.extension={type:[i.ExtensionType.WebGLPipes,i.ExtensionType.WebGPUPipes,i.ExtensionType.CanvasPipes],name:"nineSliceSprite"},t.NineSliceSpritePipe=a},58537:function(e,t,r){"use strict";var i=r(17073),n=r(87577);i.extensions.add(n.NineSliceSpritePipe)},74839:function(e,t,r){"use strict";var i=r(56509),n=r(62792),s=r(84463),o=r(60094),a=r(23522),l=r(26138);const u=class e extends l.ViewContainer{constructor(...t){let r=t[0]||{};r instanceof s.Texture&&(r={texture:r}),t.length>1&&(o.deprecation(o.v8_0_0,"use new TilingSprite({ texture, width:100, height:100 }) instead"),r.width=t[1],r.height=t[2]),r={...e.defaultOptions,...r};const{texture:i,anchor:l,tilePosition:u,tileScale:h,tileRotation:c,width:d,height:p,applyAnchorToTexture:f,roundPixels:m,...g}=r??{};super({label:"TilingSprite",...g}),this.renderPipeId="tilingSprite",this.batched=!0,this.allowChildren=!1,this._anchor=new n.ObservablePoint({_onUpdate:()=>{this.onViewUpdate()}}),this._applyAnchorToTexture=f,this.texture=i,this._width=d??i.width,this._height=p??i.height,this._tileTransform=new a.Transform({observer:{_onUpdate:()=>this.onViewUpdate()}}),l&&(this.anchor=l),this.tilePosition=u,this.tileScale=h,this.tileRotation=c,this.roundPixels=m??!1}static from(t,r={}){return new e("string"==typeof t?{texture:i.Cache.get(t),...r}:{texture:t,...r})}get clampMargin(){return this._texture.textureMatrix.clampMargin}set clampMargin(e){this._texture.textureMatrix.clampMargin=e}get anchor(){return this._anchor}set anchor(e){"number"==typeof e?this._anchor.set(e):this._anchor.copyFrom(e)}get tilePosition(){return this._tileTransform.position}set tilePosition(e){this._tileTransform.position.copyFrom(e)}get tileScale(){return this._tileTransform.scale}set tileScale(e){"number"==typeof e?this._tileTransform.scale.set(e):this._tileTransform.scale.copyFrom(e)}set tileRotation(e){this._tileTransform.rotation=e}get tileRotation(){return this._tileTransform.rotation}get tileTransform(){return this._tileTransform}get bounds(){return this._boundsDirty&&(this._updateBounds(),this._boundsDirty=!1),this._bounds}set texture(e){e||(e=s.Texture.EMPTY);const t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate())}get texture(){return this._texture}set width(e){this._width=e,this.onViewUpdate()}get width(){return this._width}set height(e){this._height=e,this.onViewUpdate()}get height(){return this._height}setSize(e,t){"object"==typeof e&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate()}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}_updateBounds(){const e=this._bounds,t=this._anchor,r=this._width,i=this._height;e.maxX=-t._x*r,e.minX=e.maxX+r,e.maxY=-t._y*i,e.minY=e.maxY+i}addBounds(e){const t=this.bounds;e.addFrame(t.minX,t.minY,t.maxX,t.maxY)}containsPoint(e){const t=this._width,r=this._height,i=-t*this._anchor._x;let n=0;return e.x>=i&&e.x<=i+t&&(n=-r*this._anchor._y,e.y>=n&&e.y<=n+r)}onViewUpdate(){if(this._boundsDirty=!0,this._didTilingSpriteUpdate=!0,this._didViewChangeTick++,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}destroy(e=!1){super.destroy(e),this._anchor=null,this._tileTransform=null,this._bounds=null;if("boolean"==typeof e?e:e?.texture){const t="boolean"==typeof e?e:e?.textureSource;this._texture.destroy(t)}this._texture=null}};u.defaultOptions={texture:s.Texture.EMPTY,anchor:{x:0,y:0},tilePosition:{x:0,y:0},tileScale:{x:1,y:1},tileRotation:0,applyAnchorToTexture:!1};let h=u;t.TilingSprite=h},3857:function(e,t,r){"use strict";var i=r(17073),n=r(254),s=r(55141),o=r(2559),a=r(76818),l=r(58507),u=r(46525),h=r(67919),c=r(20872),d=r(44260),p=r(50426);const f=new c.QuadGeometry;class m{constructor(e){this._state=s.State.default2d,this._tilingSpriteDataHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e}validateRenderable(e){const t=this._getTilingSpriteData(e),r=t.canBatch;this._updateCanBatch(e);const i=t.canBatch;if(i&&i===r){const{batchableMesh:r}=t;if(r&&r.texture._source!==e.texture._source)return!r._batcher.checkAndUpdateTexture(r,e.texture)}return r!==i}addRenderable(e,t){const r=this._renderer.renderPipes.batch;this._updateCanBatch(e);const i=this._getTilingSpriteData(e),{geometry:n,canBatch:s}=i;if(s){i.batchableMesh||(i.batchableMesh=new l.BatchableMesh);const s=i.batchableMesh;e._didTilingSpriteUpdate&&(e._didTilingSpriteUpdate=!1,this._updateBatchableMesh(e),s.geometry=n,s.renderable=e,s.transform=e.groupTransform,s.texture=e._texture),s.roundPixels=this._renderer._roundPixels|e._roundPixels,r.addToBatch(s,t)}else r.break(t),i.shader||(i.shader=new h.TilingSpriteShader),this.updateRenderable(e),t.add(e)}execute(e){const{shader:t}=this._tilingSpriteDataHash[e.uid];t.groups[0]=this._renderer.globalUniforms.bindGroup;const r=t.resources.localUniforms.uniforms;r.uTransformMatrix=e.groupTransform,r.uRound=this._renderer._roundPixels|e._roundPixels,a.color32BitToUniform(e.groupColorAlpha,r.uColor,0),this._state.blendMode=n.getAdjustedBlendModeBlend(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:f,shader:t,state:this._state})}updateRenderable(e){const t=this._getTilingSpriteData(e),{canBatch:r}=t;if(r){const{batchableMesh:r}=t;e._didTilingSpriteUpdate&&this._updateBatchableMesh(e),r._batcher.updateElement(r)}else if(e._didTilingSpriteUpdate){const{shader:r}=t;r.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture)}e._didTilingSpriteUpdate=!1}destroyRenderable(e){const t=this._getTilingSpriteData(e);t.batchableMesh=null,t.shader?.destroy(),this._tilingSpriteDataHash[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}_getTilingSpriteData(e){return this._tilingSpriteDataHash[e.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){const t=new u.MeshGeometry({indices:f.indices,positions:f.positions.slice(),uvs:f.uvs.slice()});return this._tilingSpriteDataHash[e.uid]={canBatch:!0,renderable:e,geometry:t},e.on("destroyed",this._destroyRenderableBound),this._tilingSpriteDataHash[e.uid]}_updateBatchableMesh(e){const t=this._getTilingSpriteData(e),{geometry:r}=t,i=e.texture.source.style;"repeat"!==i.addressMode&&(i.addressMode="repeat",i.update()),p.setUvs(e,r.uvs),d.setPositions(e,r.positions)}destroy(){for(const e in this._tilingSpriteDataHash)this.destroyRenderable(this._tilingSpriteDataHash[e].renderable);this._tilingSpriteDataHash=null,this._renderer=null}_updateCanBatch(e){const t=this._getTilingSpriteData(e),r=e.texture;let i=!0;return this._renderer.type===o.RendererType.WEBGL&&(i=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=r.textureMatrix.isSimple&&(i||r.source.isPowerOfTwo),t.canBatch}}m.extension={type:[i.ExtensionType.WebGLPipes,i.ExtensionType.WebGPUPipes,i.ExtensionType.CanvasPipes],name:"tilingSprite"},t.TilingSpritePipe=m},51654:function(e,t,r){"use strict";var i=r(17073),n=r(3857);i.extensions.add(n.TilingSpritePipe)},67919:function(e,t,r){"use strict";var i=r(15685),n=r(21380),s=r(74813),o=r(4116),a=r(97505),l=r(65518),u=r(84463),h=r(63522);let c,d;class p extends a.Shader{constructor(){c??(c=n.compileHighShaderGpuProgram({name:"tiling-sprite-shader",bits:[s.localUniformBit,h.tilingBit,o.roundPixelsBit]})),d??(d=n.compileHighShaderGlProgram({name:"tiling-sprite-shader",bits:[s.localUniformBitGl,h.tilingBitGl,o.roundPixelsBitGl]}));const e=new l.UniformGroup({uMapCoord:{value:new i.Matrix,type:"mat3x3"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2"},uTextureTransform:{value:new i.Matrix,type:"mat3x3"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4"}});super({glProgram:d,gpuProgram:c,resources:{localUniforms:new l.UniformGroup({uTransformMatrix:{value:new i.Matrix,type:"mat3x3"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:u.Texture.EMPTY.source,uSampler:u.Texture.EMPTY.source.style}})}updateUniforms(e,t,r,i,n,s){const o=this.resources.tilingUniforms,a=s.width,l=s.height,u=s.textureMatrix,h=o.uniforms.uTextureTransform;h.set(r.a*a/e,r.b*a/t,r.c*l/e,r.d*l/t,r.tx/e,r.ty/t),h.invert(),o.uniforms.uMapCoord=u.mapCoord,o.uniforms.uClampFrame=u.uClampFrame,o.uniforms.uClampOffset=u.uClampOffset,o.uniforms.uTextureTransform=h,o.uniforms.uSizeAnchor[0]=e,o.uniforms.uSizeAnchor[1]=t,o.uniforms.uSizeAnchor[2]=i,o.uniforms.uSizeAnchor[3]=n,s&&(this.resources.uTexture=s.source,this.resources.uSampler=s.source.style)}}t.TilingSpriteShader=p},63522:function(e,t){"use strict";const r={name:"tiling-bit",vertex:{header:"\n struct TilingUniforms {\n uMapCoord:mat3x3,\n uClampFrame:vec4,\n uClampOffset:vec2,\n uTextureTransform:mat3x3,\n uSizeAnchor:vec4\n };\n\n @group(2) @binding(0) var tilingUniforms: TilingUniforms;\n @group(2) @binding(1) var uTexture: texture_2d;\n @group(2) @binding(2) var uSampler: sampler;\n ",main:"\n uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;\n\n position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;\n "},fragment:{header:"\n struct TilingUniforms {\n uMapCoord:mat3x3,\n uClampFrame:vec4,\n uClampOffset:vec2,\n uTextureTransform:mat3x3,\n uSizeAnchor:vec4\n };\n\n @group(2) @binding(0) var tilingUniforms: TilingUniforms;\n @group(2) @binding(1) var uTexture: texture_2d;\n @group(2) @binding(2) var uSampler: sampler;\n ",main:"\n\n var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);\n coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;\n var unclamped = coord;\n coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);\n\n var bias = 0.;\n\n if(unclamped.x == coord.x && unclamped.y == coord.y)\n {\n bias = -32.;\n } \n\n outColor = textureSampleBias(uTexture, uSampler, coord, bias);\n "}},i={name:"tiling-bit",vertex:{header:"\n uniform mat3 uTextureTransform;\n uniform vec4 uSizeAnchor;\n \n ",main:"\n uv = (uTextureTransform * vec3(aUV, 1.0)).xy;\n\n position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;\n "},fragment:{header:"\n uniform sampler2D uTexture;\n uniform mat3 uMapCoord;\n uniform vec4 uClampFrame;\n uniform vec2 uClampOffset;\n ",main:"\n\n vec2 coord = vUV + ceil(uClampOffset - vUV);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n \n outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0\n \n "}};t.tilingBit=r,t.tilingBitGl=i},20872:function(e,t,r){"use strict";var i=r(46525);class n extends i.MeshGeometry{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])})}}t.QuadGeometry=n},42598:function(e,t){"use strict";t.applyMatrix=function(e,t,r,i){let n=0;const s=e.length/(t||2),o=i.a,a=i.b,l=i.c,u=i.d,h=i.tx,c=i.ty;for(r*=t;n{this.onViewUpdate()}}),r?this.anchor=r:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=!1,this.roundPixels=s??!1,void 0!==o&&(this.width=o),void 0!==a&&(this.height=a)}static from(e,t=!1){return e instanceof n.Texture?new a(e):new a(n.Texture.from(e,t))}set texture(e){e||(e=n.Texture.EMPTY);const t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get bounds(){return this._boundsDirty&&(this._updateBounds(),this._boundsDirty=!1),this._bounds}get sourceBounds(){return this._sourceBoundsDirty&&(this._updateSourceBounds(),this._sourceBoundsDirty=!1),this._sourceBounds}containsPoint(e){const t=this.sourceBounds;return e.x>=t.maxX&&e.x<=t.minX&&e.y>=t.maxY&&e.y<=t.minY}addBounds(e){const t=this._texture.trim?this.sourceBounds:this.bounds;e.addFrame(t.minX,t.minY,t.maxX,t.maxY)}onViewUpdate(){if(this._didViewChangeTick++,this._didSpriteUpdate=!0,this._sourceBoundsDirty=this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}_updateBounds(){s.updateQuadBounds(this._bounds,this._anchor,this._texture,0)}_updateSourceBounds(){const e=this._anchor,t=this._texture,r=this._sourceBounds,{width:i,height:n}=t.orig;r.maxX=-e._x*i,r.minX=r.maxX+i,r.maxY=-e._y*n,r.minY=r.maxY+n}destroy(e=!1){super.destroy(e);if("boolean"==typeof e?e:e?.texture){const t="boolean"==typeof e?e:e?.textureSource;this._texture.destroy(t)}this._texture=null,this._bounds=null,this._sourceBounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){"number"==typeof e?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){"object"==typeof e?(t=e.height??e.width,e=e.width):t??(t=e),void 0!==e&&this._setWidth(e,this._texture.orig.width),void 0!==t&&this._setHeight(t,this._texture.orig.height)}}t.Sprite=a},1894:function(e,t,r){"use strict";var i=r(17073),n=r(86169),s=r(22972);class o{constructor(e){this._gpuSpriteHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e}addRenderable(e,t){const r=this._getGpuSprite(e);e._didSpriteUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r,t)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e._didSpriteUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t)}validateRenderable(e){const t=e._texture,r=this._getGpuSprite(e);return r.texture._source!==t._source&&!r._batcher.checkAndUpdateTexture(r,t)}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];n.BigPool.return(t),this._gpuSpriteHash[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}_updateBatchableSprite(e,t){e._didSpriteUpdate=!1,t.bounds=e.bounds,t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=n.BigPool.get(s.BatchableSprite);return t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.bounds=e.bounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuSpriteHash[e.uid]=t,e._didSpriteUpdate=!1,e.on("destroyed",this._destroyRenderableBound),t}destroy(){for(const e in this._gpuSpriteHash)n.BigPool.return(this._gpuSpriteHash[e]);this._gpuSpriteHash=null,this._renderer=null}}o.extension={type:[i.ExtensionType.WebGLPipes,i.ExtensionType.WebGPUPipes,i.ExtensionType.CanvasPipes],name:"sprite"},t.SpritePipe=o},76887:function(e,t,r){"use strict";var i=r(5323),n=r(60094);t.AbstractBitmapFont=class extends i{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return n.deprecation(n.v8_0_0,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return n.deprecation(n.v8_0_0,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return n.deprecation(n.v8_0_0,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return n.deprecation(n.v8_0_0,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return n.deprecation(n.v8_0_0,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=!1){this.emit("destroy",this),this.removeAllListeners();for(const e in this.chars)this.chars[e].texture?.destroy();this.chars=null,e&&(this.pages.forEach((e=>e.texture.destroy(!0))),this.pages=null)}}},10476:function(e,t,r){"use strict";var i=r(42181),n=r(84463),s=r(76887),o=r(91195);class a extends s.AbstractBitmapFont{constructor(e,t){super();const{textures:r,data:s}=e;Object.keys(s.pages).forEach((e=>{const t=s.pages[parseInt(e,10)],i=r[t.id];this.pages.push({texture:i})})),Object.keys(s.chars).forEach((e=>{const t=s.chars[e],{frame:o,source:a}=r[t.page],l=new i.Rectangle(t.x+o.x,t.y+o.y,t.width,t.height),u=new n.Texture({source:a,frame:l});this.chars[e]={id:e.codePointAt(0),xOffset:t.xOffset,yOffset:t.yOffset,xAdvance:t.xAdvance,kerning:t.kerning??{},texture:u}})),this.baseRenderedFontSize=s.fontSize,this.baseMeasurementFontSize=s.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:s.fontSize},this.baseLineOffset=s.baseLineOffset,this.lineHeight=s.lineHeight,this.fontFamily=s.fontFamily,this.distanceField=s.distanceField??{type:"none",range:0},this.url=t}destroy(){super.destroy();for(let e=0;e50&&s.warn("BitmapText",`You have dynamically created ${h} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),e.once("destroy",(()=>{h--,i.Cache.remove(r)})),i.Cache.set(r,e)}const o=i.Cache.get(r);return o.ensureCharacters?.(e),o}getLayout(e,t,r=!0){const i=this.getFont(e,t);return l.getBitmapTextLayout([...e],t,i,r)}measureText(e,t,r=!0){return this.getLayout(e,t,r)}install(...e){let t=e[0];"string"==typeof t&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},n.deprecation(n.v8_0_0,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const r=t?.name;if(!r)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};const s=t.style,l=s instanceof o.TextStyle?s:new o.TextStyle(s),h=null!==l._fill.fill&&void 0!==l._fill.fill,c=new a.DynamicBitmapFont({style:l,overrideFill:h,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:!1}),d=u.resolveCharacters(t.chars);return c.ensureCharacters(d.join("")),i.Cache.set(`${r}-bitmap`,c),c.once("destroy",(()=>i.Cache.remove(`${r}-bitmap`))),c}uninstall(e){const t=`${e}-bitmap`,r=i.Cache.get(t);r&&(i.Cache.remove(t),r.destroy())}};t.BitmapFontManager=c},80265:function(e,t,r){"use strict";var i=r(89523),n=r(79517),s=r(91195);class o extends i.AbstractText{constructor(...e){var t;const r=i.ensureOptions(e,"BitmapText");r.style??(r.style=r.style||{}),(t=r.style).fill??(t.fill=16777215),super(r,n.TextStyle),this.renderPipeId="bitmapText"}_updateBounds(){const e=this._bounds,t=this._anchor,r=s.BitmapFontManager.measureText(this.text,this._style),i=r.scale,n=r.offsetY*i;let o=r.width*i,a=r.height*i;const l=this._style._stroke;l&&(o+=l.width,a+=l.width),e.minX=-t._x*o,e.maxX=e.minX+o,e.minY=-t._y*(a+n),e.maxY=e.minY+a}}t.BitmapText=o},43969:function(e,t,r){"use strict";var i=r(56509),n=r(17073),s=r(86169),o=r(69639),a=r(34988),l=r(91195),u=r(30610);class h{constructor(e){this._gpuBitmapText={},this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e}validateRenderable(e){const t=this._getGpuBitmapText(e);return e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,t)),this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){const r=this._getGpuBitmapText(e);c(e,r),e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,r)),this._renderer.renderPipes.graphics.addRenderable(r,t),r.context.customShader&&this._updateDistanceField(e)}destroyRenderable(e){e.off("destroyed",this._destroyRenderableBound),this._destroyRenderableByUid(e.uid)}_destroyRenderableByUid(e){const t=this._gpuBitmapText[e].context;t.customShader&&(s.BigPool.return(t.customShader),t.customShader=null),s.BigPool.return(this._gpuBitmapText[e]),this._gpuBitmapText[e]=null}updateRenderable(e){const t=this._getGpuBitmapText(e);c(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e)}_updateContext(e,t){const{context:r}=t,i=l.BitmapFontManager.getFont(e.text,e._style);r.clear(),"none"!==i.distanceField.type&&(r.customShader||(r.customShader=s.BigPool.get(a.SdfShader)));const n=Array.from(e.text),o=e._style;let h=i.baseLineOffset;const c=u.getBitmapTextLayout(n,o,i,!0);let d=0;const p=o.padding,f=c.scale;let m=c.width,g=c.height+c.offsetY;o._stroke&&(m+=o._stroke.width/f,g+=o._stroke.width/f),r.translate(-e._anchor._x*m-p,-e._anchor._y*g-p).scale(f,f);const _=i.applyFillAsTint?o._fill.color:16777215;for(let e=0;e!this._currentChars.includes(e))).filter(((e,t,r)=>r.indexOf(e)===t));if(!t.length)return;let r;this._currentChars=[...this._currentChars,...t],r=-1===this._currentPageIndex?this._nextPage():this.pages[this._currentPageIndex];let{canvas:i,context:s}=r.canvasAndContext,o=r.texture.source;const l=this._style;let h=this._currentX,c=this._currentY;const d=this.baseRenderedFontSize/this.baseMeasurementFontSize,p=this._padding*d,m="italic"===l.fontStyle?2:1;let g=0,_=!1;for(let e=0;ethis._textureSize&&(c+=g,g=v,h=0,c+g>this._textureSize)){o.update();const e=this._nextPage();i=e.canvasAndContext.canvas,s=e.canvasAndContext.context,o=e.texture.source,c=0}const y=x/d-(l.dropShadow?.distance??0)-(l._stroke?.width??0);if(this.chars[r]={id:r.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:y,kerning:{}},_){this._drawGlyph(s,f,h+p,c+p,d,l);const e=o.width*d,t=o.height*d,i=new n.Rectangle(h/e*o.width,c/t*o.height,b/e*o.width,v/t*o.height);this.chars[r].texture=new a.Texture({source:o,frame:i}),h+=Math.ceil(b)}}o.update(),this._currentX=h,this._currentY=c,this._skipKerning&&this._applyKerning(t,s)}get pageTextures(){return l.deprecation(l.v8_0_0,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){const r=this._measureCache;for(let i=0;i"))&&n.bitmapFontXMLParser.test(i.DOMAdapter.get().parseXML(e))},parse(e){return n.bitmapFontXMLParser.parse(i.DOMAdapter.get().parseXML(e))}};t.bitmapFontXMLStringParser=s},45847:function(e,t,r){"use strict";var i=r(8774),n=r(90973),s=r(42932),o=r(17073),a=r(36491),l=r(10476),u=r(82556),h=r(17668);const c=[".xml",".fnt"],d={extension:{type:o.ExtensionType.CacheParser,name:"cacheBitmapFont"},test:e=>e instanceof l.BitmapFont,getCacheableAssets(e,t){const r={};return e.forEach((e=>{r[e]=t,r[`${e}-bitmap`]=t})),r[`${t.fontFamily}-bitmap`]=t,r}},p={extension:{type:o.ExtensionType.LoadParser,priority:i.LoaderParserPriority.Normal},name:"loadBitmapFont",test(e){return c.includes(a.path.extname(e).toLowerCase())},async testParse(e){return u.bitmapFontTextParser.test(e)||h.bitmapFontXMLStringParser.test(e)},async parse(e,t,r){const i=u.bitmapFontTextParser.test(e)?u.bitmapFontTextParser.parse(e):h.bitmapFontXMLStringParser.parse(e),{src:s}=t,{pages:o}=i,c=[],d=i.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:!1,resolution:1}:{};for(let e=0;ep[e.src]));return new l.BitmapFont({data:i,textures:f},s)},async load(e,t){const r=await s.DOMAdapter.get().fetch(e);return await r.text()},async unload(e,t,r){await Promise.all(e.pages.map((e=>r.unload(e.texture.source._sourceOrigin)))),e.destroy()}};t.bitmapFontCachePlugin=d,t.loadBitmapFont=p},4862:function(e,t,r){"use strict";var i=r(17073),n=r(43969);i.extensions.add(n.BitmapTextPipe)},30610:function(e,t){"use strict";t.getBitmapTextLayout=function(e,t,r,i){const n={width:0,height:0,offsetY:0,scale:t.fontSize/r.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};n.offsetY=r.baseLineOffset;let s=n.lines[0],o=null,a=!0;const l={spaceWord:!1,width:0,start:0,index:0,positions:[],chars:[]},u=e=>{const t=s.width;for(let r=0;r{let e=s.chars.length-1;if(i){let t=s.chars[e];for(;" "===t;)s.width-=r.chars[t].xAdvance,t=s.chars[--e]}n.width=Math.max(n.width,s.width),s={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},a=!0,n.lines.push(s),n.height+=r.lineHeight},c=r.baseMeasurementFontSize/t.fontSize,d=t.letterSpacing*c,p=t.wordWrapWidth*c;for(let i=0;ip?(h(),u(l),c||s.charPositions.push(0)):(l.start=s.width,u(l),c||s.charPositions.push(0)),"\r"===n||"\n"===n)0!==s.width&&h();else if(!c){const e=f.xAdvance+(f.kerning[o]||0)+d;s.width+=e,s.spaceWidth=e,s.spacesIndex.push(s.charPositions.length),s.chars.push(n)}}else{const e=f.kerning[o]||0,t=f.xAdvance+e+d;l.positions[l.index++]=l.width+e,l.chars.push(n),l.width+=t}o=n}return h(),"center"===t.align?function(e){for(let t=0;t{console.error(e)})),e._didTextUpdate=!1;const n=e._style.padding;s.updateQuadBounds(i.bounds,e._anchor,i.texture,n)}async _updateGpuText(e){e._didTextUpdate=!1;const t=this._getGpuText(e);if(t.generatingTexture)return;const r=e._getKey();this._renderer.htmlText.decreaseReferenceCount(t.currentKey),t.generatingTexture=!0,t.currentKey=r;const i=e.resolution??this._renderer.resolution,n=await this._renderer.htmlText.getManagedTexture(e.text,i,e._style,e._getKey()),o=t.batchableSprite;o.texture=t.texture=n,t.generatingTexture=!1,t.textureNeedsUploading=!0,e.onViewUpdate();const a=e._style.padding;s.updateQuadBounds(o.bounds,e._anchor,o.texture,a)}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:n.Texture.EMPTY,currentKey:"--",batchableSprite:o.BigPool.get(a.BatchableSprite),textureNeedsUploading:!1,generatingTexture:!1},r=t.batchableSprite;return r.renderable=e,r.transform=e.groupTransform,r.texture=n.Texture.EMPTY,r.bounds={minX:0,maxX:1,minY:0,maxY:0},r.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,this._gpuText[e.uid]=t,e.on("destroyed",this._destroyRenderableBound),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}l.extension={type:[i.ExtensionType.WebGLPipes,i.ExtensionType.WebGPUPipes,i.ExtensionType.CanvasPipes],name:"htmlText"},t.HTMLTextPipe=l},2668:function(e,t){"use strict";const r="http://www.w3.org/2000/svg",i="http://www.w3.org/1999/xhtml";t.HTMLTextRenderData=class{constructor(){this.svgRoot=document.createElementNS(r,"svg"),this.foreignObject=document.createElementNS(r,"foreignObject"),this.domElement=document.createElementNS(i,"div"),this.styleElement=document.createElementNS(i,"style"),this.image=new Image;const{foreignObject:e,svgRoot:t,styleElement:n,domElement:s}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(n),e.appendChild(s)}},t.nssvg=r,t.nsxhtml=i},73543:function(e,t,r){"use strict";var i=r(17073),n=r(38759),s=r(2559),o=r(57296),a=r(95190),l=r(86169),u=r(30705),h=r(2668),c=r(47308),d=r(62074),p=r(46242),f=r(27252),m=r(20628),g=r(85669),_=r(11296);class x{constructor(e){this._activeTextures={},this._renderer=e,this._createCanvas=e.type===s.RendererType.WEBGPU}getTexture(e){return this._buildTexturePromise(e.text,e.resolution,e.style)}getManagedTexture(e,t,r,i){if(this._activeTextures[i])return this._increaseReferenceCount(i),this._activeTextures[i].promise;const n=this._buildTexturePromise(e,t,r).then((e=>(this._activeTextures[i].texture=e,e)));return this._activeTextures[i]={texture:null,promise:n,usageCount:1},n}async _buildTexturePromise(e,t,r){const i=l.BigPool.get(h.HTMLTextRenderData),n=d.extractFontFamilies(e,r),s=await p.getFontCss(n,r,c.HTMLTextStyle.defaultTextStyle),a=_.measureHtmlText(e,r,s,i),x=Math.ceil(Math.ceil(Math.max(1,a.width)+2*r.padding)*t),b=Math.ceil(Math.ceil(Math.max(1,a.height)+2*r.padding)*t),v=i.image;v.width=2+(0|x),v.height=2+(0|b);const y=f.getSVGUrl(e,r,t,s,i);await g.loadSVGImage(v,y,o.isSafari()&&n.length>0);let T=v;this._createCanvas&&(T=m.getTemporaryCanvasFromImage(v,t));const S=u.getPo2TextureFromSource(T,v.width-2,v.height-2,t);return this._createCanvas&&this._renderer.texture.initSource(S.source),l.BigPool.return(i),S}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];t&&(t.usageCount--,0===t.usageCount&&(t.texture?this._cleanUp(t):t.promise.then((e=>{t.texture=e,this._cleanUp(t)})).catch((()=>{a.warn("HTMLTextSystem: Failed to clean texture")})),this._activeTextures[e]=null))}_cleanUp(e){n.TexturePool.returnTexture(e.texture),e.texture.source.resource=null,e.texture.source.uploadMethodId="unknown"}getReferenceCount(e){return this._activeTextures[e].usageCount}destroy(){this._activeTextures=null}}x.extension={type:[i.ExtensionType.WebGLSystem,i.ExtensionType.WebGPUSystem,i.ExtensionType.CanvasSystem],name:"htmlText"},x.defaultFontOptions={fontFamily:"Arial",fontStyle:"normal",fontWeight:"normal"},t.HTMLTextSystem=x},47308:function(e,t,r){"use strict";var i=r(95190),n=r(79517),s=r(64597),o=r(19790);class a extends n.TextStyle{constructor(e={}){super(e),this._cssOverrides=[],this.cssOverrides??(this.cssOverrides=e.cssOverrides),this.tagStyles=e.tagStyles??{}}set cssOverrides(e){this._cssOverrides=e instanceof Array?e:[e],this.update()}get cssOverrides(){return this._cssOverrides}_generateKey(){return this._styleKey=s.generateTextStyleKey(this)+this._cssOverrides.join("-"),this._styleKey}update(){this._cssStyle=null,super.update()}clone(){return new a({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides})}get cssStyle(){return this._cssStyle||(this._cssStyle=o.textStyleToCSS(this)),this._cssStyle}addOverride(...e){const t=e.filter((e=>!this.cssOverrides.includes(e)));t.length>0&&(this.cssOverrides.push(...t),this.update())}removeOverride(...e){const t=e.filter((e=>this.cssOverrides.includes(e)));t.length>0&&(this.cssOverrides=this.cssOverrides.filter((e=>!t.includes(e))),this.update())}set fill(e){"string"!=typeof e&&"number"!=typeof e&&i.warn("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e}set stroke(e){e&&"string"!=typeof e&&"number"!=typeof e&&i.warn("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e}}t.HTMLTextStyle=a},38717:function(e,t,r){"use strict";var i=r(17073),n=r(93968),s=r(73543);i.extensions.add(s.HTMLTextSystem),i.extensions.add(n.HTMLTextPipe)},62074:function(e,t){"use strict";t.extractFontFamilies=function(e,t){const r=t.fontFamily,i=[],n={},s=e.match(/font-family:([^;"\s]+)/g);function o(e){n[e]||(i.push(e),n[e]=!0)}if(Array.isArray(r))for(let e=0;e{o(e.split(":")[1].trim())}));for(const e in t.tagStyles){o(t.tagStyles[e].fontFamily)}return i}},46242:function(e,t,r){"use strict";var i=r(56509),n=r(75761);const s=new Map;t.FontStylePromiseCache=s,t.getFontCss=async function(e,t,r){const o=e.filter((e=>i.Cache.has(`${e}-and-url`))).map(((e,o)=>{if(!s.has(e)){const{url:a}=i.Cache.get(`${e}-and-url`);0===o?s.set(e,n.loadFontCSS({fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:e},a)):s.set(e,n.loadFontCSS({fontWeight:r.fontWeight,fontStyle:r.fontStyle,fontFamily:e},a))}return s.get(e)}));return(await Promise.all(o)).join("\n")}},27252:function(e,t){"use strict";t.getSVGUrl=function(e,t,r,i,n){const{domElement:s,styleElement:o,svgRoot:a}=n;s.innerHTML=`
${e}
`,s.setAttribute("style",`transform: scale(${r});transform-origin: top left; display: inline-block`),o.textContent=i;const{width:l,height:u}=n.image;return a.setAttribute("width",l.toString()),a.setAttribute("height",u.toString()),(new XMLSerializer).serializeToString(a)}},20628:function(e,t,r){"use strict";var i=r(60932);t.getTemporaryCanvasFromImage=function(e,t){const r=i.CanvasPool.getOptimalCanvasAndContext(e.width,e.height,t),{context:n}=r;return n.clearRect(0,0,e.width,e.height),n.drawImage(e,0,0),i.CanvasPool.returnCanvasAndContext(r),r.canvas}},23026:function(e,t,r){"use strict";var i=r(42932);t.loadFontAsBase64=async function(e){const t=await i.DOMAdapter.get().fetch(e),r=await t.blob(),n=new FileReader;return await new Promise(((e,t)=>{n.onloadend=()=>e(n.result),n.onerror=t,n.readAsDataURL(r)}))}},75761:function(e,t,r){"use strict";var i=r(23026);t.loadFontCSS=async function(e,t){const r=await i.loadFontAsBase64(t);return`@font-face {\n font-family: "${e.fontFamily}";\n src: url('${r}');\n font-weight: ${e.fontWeight};\n font-style: ${e.fontStyle};\n }`}},85669:function(e,t){"use strict";t.loadSVGImage=function(e,t,r){return new Promise((async i=>{r&&await new Promise((e=>setTimeout(e,100))),e.onload=()=>{i()},e.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(t)}`,e.crossOrigin="anonymous"}))}},11296:function(e,t,r){"use strict";var i=r(31030),n=r(2668);let s;t.measureHtmlText=function(e,t,r,o){o=o||s||(s=new n.HTMLTextRenderData);const{domElement:a,styleElement:l,svgRoot:u}=o;a.innerHTML=`
${e}
`,a.setAttribute("style","transform-origin: top left; display: inline-block"),r&&(l.textContent=r),document.body.appendChild(u);const h=a.getBoundingClientRect();u.remove();const c=i.CanvasTextMetrics.measureFont(t.fontStyle).descent,d=2*t.padding;return{width:h.width-d,height:h.height+c-d}}},19790:function(e,t,r){"use strict";var i=r(58778);function n(e){const t=i.Color.shared.setValue(e.color).setAlpha(e.alpha).toHexa(),r=`${Math.round(Math.cos(e.angle)*e.distance)}px ${Math.round(Math.sin(e.angle)*e.distance)}px`;return e.blur>0?`text-shadow: ${r} ${e.blur}px ${t}`:`text-shadow: ${r} ${t}`}function s(e){return[`-webkit-text-stroke-width: ${e.width}px`,`-webkit-text-stroke-color: ${i.Color.shared.setValue(e.color).toHex()}`,`text-stroke-width: ${e.width}px`,`text-stroke-color: ${i.Color.shared.setValue(e.color).toHex()}`,"paint-order: stroke"].join(";")}const o={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},a={fill:e=>`color: ${i.Color.shared.setValue(e).toHex()}`,breakWords:e=>"word-wrap: "+(e?"break-all":"break-word"),stroke:s,dropShadow:n};t.textStyleToCSS=function(e){const t=e._stroke,r=e._fill,l=[`div { ${[`color: ${i.Color.shared.setValue(r.color).toHex()}`,`font-size: ${e.fontSize}px`,`font-family: ${e.fontFamily}`,`font-weight: ${e.fontWeight}`,`font-style: ${e.fontStyle}`,`font-variant: ${e.fontVariant}`,`letter-spacing: ${e.letterSpacing}px`,`text-align: ${e.align}`,`padding: ${e.padding}px`,`white-space: ${"pre"===e.whiteSpace&&e.wordWrap?"pre-wrap":e.whiteSpace}`,...e.lineHeight?[`line-height: ${e.lineHeight}px`]:[],...e.wordWrap?["word-wrap: "+(e.breakWords?"break-all":"break-word"),`max-width: ${e.wordWrapWidth}px`]:[],...t?[s(t)]:[],...e.dropShadow?[n(e.dropShadow)]:[],...e.cssOverrides].join(";")} }`];return function(e,t){for(const r in e){const i=e[r],n=[];for(const e in i)a[e]?n.push(a[e](i[e])):o[e]&&n.push(o[e].replace("{{VALUE}}",i[e]));t.push(`${r} { ${n.join(";")} }`)}}(e.tagStyles,l),l.join(" ")}},89523:function(e,t,r){"use strict";var i=r(62792),n=r(60094),s=r(26138);class o extends s.ViewContainer{constructor(e,t){const{text:r,resolution:n,style:s,anchor:o,width:a,height:l,roundPixels:u,...h}=e;super({...h}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=t,this.text=r??"",this.style=s,this.resolution=n??null,this.allowChildren=!1,this._anchor=new i.ObservablePoint({_onUpdate:()=>{this.onViewUpdate()}}),o&&(this.anchor=o),this.roundPixels=u??!1,void 0!==a&&(this.width=a),void 0!==l&&(this.height=l)}get anchor(){return this._anchor}set anchor(e){"number"==typeof e?this._anchor.set(e):this._anchor.copyFrom(e)}set text(e){e=e.toString(),this._text!==e&&(this._text=e,this.onViewUpdate())}get text(){return this._text}set resolution(e){this._autoResolution=null===e,this._resolution=e,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(e){e=e||{},this._style?.off("update",this.onViewUpdate,this),e instanceof this._styleClass?this._style=e:this._style=new this._styleClass(e),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get bounds(){return this._boundsDirty&&(this._updateBounds(),this._boundsDirty=!1),this._bounds}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(e){this._setWidth(e,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(e){this._setHeight(e,this.bounds.height)}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this.bounds.width,e.height=Math.abs(this.scale.y)*this.bounds.height,e}setSize(e,t){"object"==typeof e?(t=e.height??e.width,e=e.width):t??(t=e),void 0!==e&&this._setWidth(e,this.bounds.width),void 0!==t&&this._setHeight(t,this.bounds.height)}addBounds(e){const t=this.bounds;e.addFrame(t.minX,t.minY,t.maxX,t.maxY)}containsPoint(e){const t=this.bounds.width,r=this.bounds.height,i=-t*this.anchor.x;let n=0;return e.x>=i&&e.x<=i+t&&(n=-r*this.anchor.y,e.y>=n&&e.y<=n+r)}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0,this._didTextUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}_getKey(){return`${this.text}:${this._style.styleKey}:${this._resolution}`}destroy(e=!1){super.destroy(e),this.owner=null,this._bounds=null,this._anchor=null,("boolean"==typeof e?e:e?.style)&&this._style.destroy(e),this._style=null,this._text=null}}t.AbstractText=o,t.ensureOptions=function(e,t){let r=e[0]??{};return("string"==typeof r||e[1])&&(n.deprecation(n.v8_0_0,`use new ${t}({ text: "hi!", style }) instead`),r={text:r,style:e[1]}),r}},62434:function(e,t,r){"use strict";var i=r(89523),n=r(31030),s=r(79517);class o extends i.AbstractText{constructor(...e){super(i.ensureOptions(e,"Text"),s.TextStyle),this.renderPipeId="text"}_updateBounds(){const e=this._bounds,t=this._anchor,r=n.CanvasTextMetrics.measureText(this._text,this._style),{width:i,height:s}=r;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s}}t.Text=o},79517:function(e,t,r){"use strict";var i=r(5323),n=r(58778),s=r(60094),o=r(37553),a=r(16315),l=r(90537),u=r(97886),h=r(64597);const c=class e extends i{constructor(t={}){super(),function(e){const t=e;if("boolean"==typeof t.dropShadow&&t.dropShadow){const r=d.defaultDropShadow;e.dropShadow={alpha:t.dropShadowAlpha??r.alpha,angle:t.dropShadowAngle??r.angle,blur:t.dropShadowBlur??r.blur,color:t.dropShadowColor??r.color,distance:t.dropShadowDistance??r.distance}}if(void 0!==t.strokeThickness){s.deprecation(s.v8_0_0,"strokeThickness is now a part of stroke");const r=t.stroke;let i={};if(n.Color.isColorLike(r))i.color=r;else if(r instanceof o.FillGradient||r instanceof a.FillPattern)i.fill=r;else{if(!Object.hasOwnProperty.call(r,"color")&&!Object.hasOwnProperty.call(r,"fill"))throw new Error("Invalid stroke value.");i=r}e.stroke={...i,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){let r;s.deprecation(s.v8_0_0,"gradient fill is now a fill pattern: `new FillGradient(...)`"),null==e.fontSize?e.fontSize=d.defaultTextStyle.fontSize:r="string"==typeof e.fontSize?parseInt(e.fontSize,10):e.fontSize;const i=new o.FillGradient(0,0,0,1.7*r),a=t.fillGradientStops.map((e=>n.Color.shared.setValue(e).toNumber()));a.forEach(((e,t)=>{const r=t/(a.length-1);i.addColorStop(r,e)})),e.fill={fill:i}}}(t);const r={...e.defaultTextStyle,...t};for(const e in r){this[e]=r[e]}this.update()}get align(){return this._align}set align(e){this._align=e,this.update()}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update()}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow=null!==t&&"object"==typeof t?this._createProxy({...e.defaultDropShadow,...t}):t?this._createProxy({...e.defaultDropShadow}):null,this.update()}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update()}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize="string"==typeof e?parseInt(e,10):e,this.update()}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e,this.update()}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update()}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update()}get leading(){return this._leading}set leading(e){this._leading=e,this.update()}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update()}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update()}get padding(){return this._padding}set padding(e){this._padding=e,this.update()}get trim(){return this._trim}set trim(e){this._trim=e,this.update()}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update()}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update()}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update()}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update()}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...l.GraphicsContext.defaultFillStyle,...e},(()=>{this._fill=u.toFillStyle({...this._originalFill},l.GraphicsContext.defaultFillStyle)}))),this._fill=u.toFillStyle(0===e?"black":e,l.GraphicsContext.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...l.GraphicsContext.defaultStrokeStyle,...e},(()=>{this._stroke=u.toStrokeStyle({...this._originalStroke},l.GraphicsContext.defaultStrokeStyle)}))),this._stroke=u.toStrokeStyle(e,l.GraphicsContext.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=h.generateTextStyleKey(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const t=e.defaultTextStyle;for(const e in t)this[e]=t[e]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new e({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth})}destroy(e=!1){this.removeAllListeners();if("boolean"==typeof e?e:e?.texture){const t="boolean"==typeof e?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(t),this._originalFill?.texture&&this._originalFill.texture.destroy(t),this._stroke?.texture&&this._stroke.texture.destroy(t),this._originalStroke?.texture&&this._originalStroke.texture.destroy(t)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(e,r,i)=>(e[r]=i,t?.(r,i),this.update(),!0)})}_isFillStyle(e){return null!==(e??null)&&!(n.Color.isColorLike(e)||e instanceof o.FillGradient||e instanceof a.FillPattern)}};c.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5},c.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let d=c;t.TextStyle=d},31030:function(e,t,r){"use strict";var i=r(42932),n=r(61868);const s={willReadFrequently:!0},o=class e{static get experimentalLetterSpacingSupported(){let t=e._experimentalLetterSpacingSupported;if(void 0!==t){const r=i.DOMAdapter.get().getCanvasRenderingContext2D().prototype;t=e._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return t}constructor(e,t,r,i,n,s,o,a,l){this.text=e,this.style=t,this.width=r,this.height=i,this.lines=n,this.lineWidths=s,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=l}static measureText(t=" ",r,i=e._canvas,s=r.wordWrap){const o=`${t}:${r.styleKey}`;if(e._measurementCache[o])return e._measurementCache[o];const a=n.fontStringFromTextStyle(r),l=e.measureFont(a);0===l.fontSize&&(l.fontSize=r.fontSize,l.ascent=r.fontSize);const u=e.__context;u.font=a;const h=(s?e._wordWrap(t,r,i):t).split(/(?:\r\n|\r|\n)/),c=new Array(h.length);let d=0;for(let t=0;t0&&(n?s-=r:s+=(e.graphemeSegmenter(t).length-1)*r),s}static _wordWrap(t,r,i=e._canvas){const n=i.getContext("2d",s);let o=0,a="",l="";const u=Object.create(null),{letterSpacing:h,whiteSpace:c}=r,d=e._collapseSpaces(c),p=e._collapseNewlines(c);let f=!d;const m=r.wordWrapWidth+h,g=e._tokenize(t);for(let t=0;tm)if(""!==a&&(l+=e._addLine(a),a="",o=0),e.canBreakWords(i,r.breakWords)){const t=e.wordWrapSplit(i);for(let s=0;sm&&(l+=e._addLine(a),f=!1,a="",o=0),a+=c,o+=g}}else{a.length>0&&(l+=e._addLine(a),a="",o=0);const r=t===g.length-1;l+=e._addLine(i,!r),f=!1,a="",o=0}else s+o>m&&(f=!1,l+=e._addLine(a),a="",o=0),(a.length>0||!e.isBreakingSpace(i)||f)&&(a+=i,o+=s)}return l+=e._addLine(a,!1),l}static _addLine(t,r=!0){return t=e._trimRight(t),t=r?`${t}\n`:t}static _getFromCache(t,r,i,n){let s=i[t];return"number"!=typeof s&&(s=e._measureText(t,r,n)+r,i[t]=s),s}static _collapseSpaces(e){return"normal"===e||"pre-line"===e}static _collapseNewlines(e){return"normal"===e}static _trimRight(t){if("string"!=typeof t)return"";for(let r=t.length-1;r>=0;r--){const i=t[r];if(!e.isBreakingSpace(i))break;t=t.slice(0,-1)}return t}static _isNewline(t){return"string"==typeof t&&e._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,r){return"string"==typeof t&&e._breakingSpaces.includes(t.charCodeAt(0))}static _tokenize(t){const r=[];let i="";if("string"!=typeof t)return r;for(let n=0;n{if("function"==typeof Intl?.Segmenter){const e=new Intl.Segmenter;return t=>[...e.segment(t)].map((e=>e.segment))}return e=>[...e]})(),o.experimentalLetterSpacing=!1,o._fonts={},o._newlines=[10,13],o._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],o._measurementCache={};let a=o;t.CanvasTextMetrics=a},76869:function(e,t,r){"use strict";var i=r(17073),n=r(64293),s=r(86169),o=r(22972);class a{constructor(e){this._gpuText=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e,this._renderer.runners.resolutionChange.add(this)}resolutionChange(){for(const e in this._gpuText){const t=this._gpuText[e];if(!t)continue;const r=t.batchableSprite.renderable;r._autoResolution&&(r._resolution=this._renderer.resolution,r.onViewUpdate())}}validateRenderable(e){const t=this._getGpuText(e),r=e._getKey();if(t.currentKey!==r){const{width:r,height:i}=this._renderer.canvasText.getTextureSize(e.text,e.resolution,e._style);return 1!==this._renderer.canvasText.getReferenceCount(t.currentKey)||r!==t.texture._source.width||i!==t.texture._source.height}return!1}addRenderable(e,t){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),this._renderer.renderPipes.batch.addToBatch(r,t)}updateRenderable(e){const t=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),t._batcher.updateElement(t)}destroyRenderable(e){e.off("destroyed",this._destroyRenderableBound),this._destroyRenderableById(e.uid)}_destroyRenderableById(e){const t=this._gpuText[e];this._renderer.canvasText.decreaseReferenceCount(t.currentKey),s.BigPool.return(t.batchableSprite),this._gpuText[e]=null}_updateText(e){const t=e._getKey(),r=this._getGpuText(e),i=r.batchableSprite;r.currentKey!==t&&this._updateGpuText(e),e._didTextUpdate=!1;const s=e._style.padding;n.updateQuadBounds(i.bounds,e._anchor,i.texture,s)}_updateGpuText(e){const t=this._getGpuText(e),r=t.batchableSprite;t.texture&&this._renderer.canvasText.decreaseReferenceCount(t.currentKey),t.texture=r.texture=this._renderer.canvasText.getManagedTexture(e),t.currentKey=e._getKey(),r.texture=t.texture}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:null,currentKey:"--",batchableSprite:s.BigPool.get(o.BatchableSprite)};return t.batchableSprite.renderable=e,t.batchableSprite.transform=e.groupTransform,t.batchableSprite.bounds={minX:0,maxX:1,minY:0,maxY:0},t.batchableSprite.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuText[e.uid]=t,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,this._updateText(e),e.on("destroyed",this._destroyRenderableBound),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}a.extension={type:[i.ExtensionType.WebGLPipes,i.ExtensionType.WebGPUPipes,i.ExtensionType.CanvasPipes],name:"text"},t.CanvasTextPipe=a},58054:function(e,t,r){"use strict";var i=r(58778),n=r(17073),s=r(39018),o=r(60932),a=r(38759),l=r(50034),u=r(60094),h=r(79517),c=r(30705),d=r(31030),p=r(61868),f=r(73602);class m{constructor(e){this._activeTextures={},this._renderer=e}getTextureSize(e,t,r){const i=d.CanvasTextMetrics.measureText(e||" ",r);let n=Math.ceil(Math.ceil(Math.max(1,i.width)+2*r.padding)*t),o=Math.ceil(Math.ceil(Math.max(1,i.height)+2*r.padding)*t);return n=Math.ceil(n-1e-6),o=Math.ceil(o-1e-6),n=s.nextPow2(n),o=s.nextPow2(o),{width:n,height:o}}getTexture(e,t,r,i){"string"==typeof e&&(u.deprecation("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:r,resolution:t}),e.style instanceof h.TextStyle||(e.style=new h.TextStyle(e.style));const{texture:n,canvasAndContext:s}=this.createTextureAndCanvas(e);return this._renderer.texture.initSource(n._source),o.CanvasPool.returnCanvasAndContext(s),n}createTextureAndCanvas(e){const{text:t,style:r}=e,i=e.resolution??this._renderer.resolution,n=d.CanvasTextMetrics.measureText(t||" ",r),s=Math.ceil(Math.ceil(Math.max(1,n.width)+2*r.padding)*i),a=Math.ceil(Math.ceil(Math.max(1,n.height)+2*r.padding)*i),u=o.CanvasPool.getOptimalCanvasAndContext(s,a),{canvas:h}=u;this.renderTextToCanvas(t,r,i,u);const p=c.getPo2TextureFromSource(h,s,a,i);if(r.trim){const e=l.getCanvasBoundingBox(h,i);p.frame.copyFrom(e),p.updateUvs()}return{texture:p,canvasAndContext:u}}getManagedTexture(e){e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;const t=e._getKey();if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].texture;const{texture:r,canvasAndContext:i}=this.createTextureAndCanvas(e);return this._activeTextures[t]={canvasAndContext:i,texture:r,usageCount:1},r}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];if(t.usageCount--,0===t.usageCount){o.CanvasPool.returnCanvasAndContext(t.canvasAndContext),a.TexturePool.returnTexture(t.texture);const r=t.texture.source;r.resource=null,r.uploadMethodId="unknown",r.alphaMode="no-premultiply-alpha",this._activeTextures[e]=null}}getReferenceCount(e){return this._activeTextures[e].usageCount}renderTextToCanvas(e,t,r,n){const{canvas:s,context:o}=n,a=p.fontStringFromTextStyle(t),l=d.CanvasTextMetrics.measureText(e||" ",t),u=l.lines,h=l.lineHeight,c=l.lineWidths,m=l.maxLineWidth,g=l.fontProperties,_=s.height;o.resetTransform(),o.scale(r,r);const x=2*t.padding;if(o.clearRect(0,0,l.width+4+x,l.height+4+x),t._stroke?.width){const e=t._stroke;o.lineWidth=e.width,o.miterLimit=e.miterLimit,o.lineJoin=e.join,o.lineCap=e.cap}let b,v;o.font=a;const y=t.dropShadow?2:1;for(let e=0;e=0;e--){let t=i[e].trim();/([\"\'])[^\'\"]+\1/.test(t)||r.includes(t)||(t=`"${t}"`),i[e]=t}return`${e.fontStyle} ${e.fontVariant} ${e.fontWeight} ${t} ${i.join(",")}`}},73602:function(e,t,r){"use strict";var i=r(58778),n=r(15685),s=r(84463),o=r(95190),a=r(37553),l=r(16315);t.getCanvasFillStyle=function(e,t){if(e.texture===s.Texture.WHITE&&!e.fill)return i.Color.shared.setValue(e.color).setAlpha(e.alpha??1).toHexa();if(!e.fill){const r=t.createPattern(e.texture.source.resource,"repeat"),i=e.matrix.copyTo(n.Matrix.shared);return i.scale(e.texture.frame.width,e.texture.frame.height),r.setTransform(i),r}if(e.fill instanceof l.FillPattern){const r=e.fill,i=t.createPattern(r.texture.source.resource,"repeat"),s=r.transform.copyTo(n.Matrix.shared);return s.scale(r.texture.frame.width,r.texture.frame.height),i.setTransform(s),i}if(e.fill instanceof a.FillGradient){const r=e.fill;if("linear"===r.type){const e=t.createLinearGradient(r.x0,r.y0,r.x1,r.y1);return r.gradientStops.forEach((t=>{e.addColorStop(t.offset,i.Color.shared.setValue(t.color).toHex())})),e}}return o.warn("FillStyle not recognised",e),"red"}},34266:function(e,t,r){"use strict";var i=r(17073),n=r(76869),s=r(58054);i.extensions.add(s.CanvasTextSystem),i.extensions.add(n.CanvasTextPipe)},34988:function(e,t,r){"use strict";var i=r(15685),n=r(1766),s=r(21380),o=r(84215),a=r(19209),l=r(4116),u=r(9488),h=r(97505),c=r(65518),d=r(40206),p=r(71424);let f,m;class g extends h.Shader{constructor(){const e=new c.UniformGroup({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uTransformMatrix:{value:new i.Matrix,type:"mat3x3"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}}),t=n.getMaxTexturesPerBatch();f??(f=s.compileHighShaderGpuProgram({name:"sdf-shader",bits:[o.colorBit,a.generateTextureBatchBit(t),d.localUniformMSDFBit,p.mSDFBit,l.roundPixelsBit]})),m??(m=s.compileHighShaderGlProgram({name:"sdf-shader",bits:[o.colorBitGl,a.generateTextureBatchBitGl(t),d.localUniformMSDFBitGl,p.mSDFBitGl,l.roundPixelsBitGl]})),super({glProgram:m,gpuProgram:f,resources:{localUniforms:e,batchSamplers:u.getBatchSamplersUniformGroup(t)}})}}t.SdfShader=g},40206:function(e,t){"use strict";const r={name:"local-uniform-msdf-bit",vertex:{header:"\n struct LocalUniforms {\n uColor:vec4,\n uTransformMatrix:mat3x3,\n uDistance: f32,\n uRound:f32,\n }\n\n @group(2) @binding(0) var localUniforms : LocalUniforms;\n ",main:"\n vColor *= localUniforms.uColor;\n modelMatrix *= localUniforms.uTransformMatrix;\n ",end:"\n if(localUniforms.uRound == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "},fragment:{header:"\n struct LocalUniforms {\n uColor:vec4,\n uTransformMatrix:mat3x3,\n uDistance: f32\n }\n\n @group(2) @binding(0) var localUniforms : LocalUniforms;\n ",main:" \n outColor = vec4(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));\n "}},i={name:"local-uniform-msdf-bit",vertex:{header:"\n uniform mat3 uTransformMatrix;\n uniform vec4 uColor;\n uniform float uRound;\n ",main:"\n vColor *= uColor;\n modelMatrix *= uTransformMatrix;\n ",end:"\n if(uRound == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "},fragment:{header:"\n uniform float uDistance;\n ",main:" \n outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));\n "}};t.localUniformMSDFBit=r,t.localUniformMSDFBitGl=i},71424:function(e,t){"use strict";const r={name:"msdf-bit",fragment:{header:"\n fn calculateMSDFAlpha(msdfColor:vec4, shapeColor:vec4, distance:f32) -> f32 {\n \n // MSDF\n var median = msdfColor.r + msdfColor.g + msdfColor.b -\n min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -\n max(msdfColor.r, max(msdfColor.g, msdfColor.b));\n \n // SDF\n median = min(median, msdfColor.a);\n\n var screenPxDistance = distance * (median - 0.5);\n var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\n if (median < 0.01) {\n alpha = 0.0;\n } else if (median > 0.99) {\n alpha = 1.0;\n }\n\n // Gamma correction for coverage-like alpha\n var luma: f32 = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));\n var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);\n var coverage: f32 = pow(shapeColor.a * alpha, gamma);\n\n return coverage;\n \n }\n "}},i={name:"msdf-bit",fragment:{header:"\n float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {\n \n // MSDF\n float median = msdfColor.r + msdfColor.g + msdfColor.b -\n min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -\n max(msdfColor.r, max(msdfColor.g, msdfColor.b));\n \n // SDF\n median = min(median, msdfColor.a);\n \n float screenPxDistance = distance * (median - 0.5);\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\n \n if (median < 0.01) {\n alpha = 0.0;\n } else if (median > 0.99) {\n alpha = 1.0;\n }\n\n // Gamma correction for coverage-like alpha\n float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));\n float gamma = mix(1.0, 1.0 / 2.2, luma);\n float coverage = pow(shapeColor.a * alpha, gamma); \n \n return coverage;\n }\n "}};t.mSDFBit=r,t.mSDFBitGl=i},24328:function(e,t,r){"use strict";var i=r(47308),n=r(79517);t.ensureTextStyle=function(e,t){return t instanceof n.TextStyle||t instanceof i.HTMLTextStyle?t:"html"===e?new i.HTMLTextStyle(t):new n.TextStyle(t)}},64597:function(e,t,r){"use strict";var i=r(58778);const n=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function s(e,t,r){return e?(t[r++]=e.color,t[r++]=e.alpha,t[r++]=e.fill?.styleKey,r):r}t.generateTextStyleKey=function(e){const t=[];let r=0;for(let i=0;i=t.minX&&r<=t.maxX&&i>=t.minY&&i<=t.maxY}destroy(e){super.destroy(e),this._bounds=null}}t.ViewContainer=s},89757:function(e,t,r){"use strict";var i=r(42181),n=r(84463);const s=class e{constructor(e,t){this.linkedSheets=[],this._texture=e instanceof n.Texture?e:null,this.textureSource=e.source,this.textures={},this.animations={},this.data=t;const r=parseFloat(t.meta.scale);r?(this.resolution=r,e.source.resolution=this.resolution):this.resolution=e.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise((t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=e.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()}))}_processFrames(t){let r=t;const s=e.BATCH_SIZE;for(;r-t{this._batchIndex*e.BATCH_SIZE{i[e]=t})),Object.keys(t.textures).forEach((e=>{i[e]=t.textures[e]})),!r){const r=l.path.dirname(e[0]);t.linkedSheets.forEach(((e,n)=>{const s=c([`${r}/${t.data.meta.related_multi_packs[n]}`],e,!0);Object.assign(i,s)}))}return i}const d={extension:o.ExtensionType.Asset,cache:{test:e=>e instanceof u.Spritesheet,getCacheableAssets:(e,t)=>c(e,t,!1)},resolver:{extension:{type:o.ExtensionType.ResolveParser,name:"resolveSpritesheet"},test:e=>{const t=e.split("?")[0].split("."),r=t.pop(),i=t.pop();return"json"===r&&h.includes(i)},parse:e=>{const t=e.split(".");return{resolution:parseFloat(n.Resolver.RETINA_PREFIX.exec(e)?.[1]??"1"),format:t[t.length-2],src:e}}},loader:{name:"spritesheetLoader",extension:{type:o.ExtensionType.LoadParser,priority:i.LoaderParserPriority.Normal,name:"spritesheetLoader"},async testParse(e,t){return".json"===l.path.extname(t.src).toLowerCase()&&!!e.frames},async parse(e,t,r){const{texture:i,imageFilename:n}=t?.data??{};let o,h=l.path.dirname(t.src);if(h&&h.lastIndexOf("/")!==h.length-1&&(h+="/"),i instanceof a.Texture)o=i;else{const i=s.copySearchParams(h+(n??e.meta.image),t.src);o=(await r.load([i]))[i]}const c=new u.Spritesheet(o.source,e);await c.parse();const d=e?.meta?.related_multi_packs;if(Array.isArray(d)){const e=[];for(const i of d){if("string"!=typeof i)continue;let n=h+i;t.data?.ignoreMultiPack||(n=s.copySearchParams(n,t.src),e.push(r.load({src:n,data:{ignoreMultiPack:!0}})))}const i=await Promise.all(e);c.linkedSheets=i,i.forEach((e=>{e.linkedSheets=[c].concat(c.linkedSheets.filter((t=>t!==e)))}))}return c},async unload(e,t,r){await r.unload(e.textureSource._sourceOrigin),e.destroy(!1)}}};t.spritesheetAsset=d},63983:function(e,t,r){"use strict";var i=r(35292),n=r(31137);const s=class e{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new n.TickerListener(null,null,1/0),this.deltaMS=1/e.targetFPMS,this.elapsedMS=1/e.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,r=i.UPDATE_PRIORITY.NORMAL){return this._addListener(new n.TickerListener(e,t,r))}addOnce(e,t,r=i.UPDATE_PRIORITY.NORMAL){return this._addListener(new n.TickerListener(e,t,r,!0))}_addListener(e){let t=this._head.next,r=this._head;if(t){for(;t;){if(e.priority>t.priority){e.connect(r);break}r=t,t=t.next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this}remove(e,t){let r=this._head.next;for(;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let r;if(t>this.lastTime){if(r=this.elapsedMS=t-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const e=t-this._lastFrame|0;if(e(e[e.INTERACTION=50]="INTERACTION",e[e.HIGH=25]="HIGH",e[e.NORMAL=0]="NORMAL",e[e.LOW=-25]="LOW",e[e.UTILITY=-50]="UTILITY",e))(r||{});t.UPDATE_PRIORITY=r},42508:function(e,t,r){"use strict";var i=r(35292),n=r(63983),s=r(31137);t.UPDATE_PRIORITY=i.UPDATE_PRIORITY,t.Ticker=n.Ticker,t.TickerListener=s.TickerListener},86105:function(e,t){"use strict";let r;t.detectVideoAlphaMode=async function(){return r??(r=(async()=>{const e=document.createElement("canvas").getContext("webgl");if(!e)return"premultiply-alpha-on-upload";const t=await new Promise((e=>{const t=document.createElement("video");t.onloadeddata=()=>e(t),t.onerror=()=>e(null),t.autoplay=!1,t.crossOrigin="anonymous",t.preload="auto",t.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",t.load()}));if(!t)return"premultiply-alpha-on-upload";const r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);const i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);const n=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,n),e.deleteFramebuffer(i),e.deleteTexture(r),e.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),r}},2636:function(e,t,r){"use strict";var i=r(90891);const n=(i.default??i)(globalThis.navigator);t.isMobile=n},57296:function(e,t,r){"use strict";var i=r(42932);t.isSafari=function(){const{userAgent:e}=i.DOMAdapter.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}},58050:function(e,t,r){"use strict";var i=r(42932),n=r(95931);let s;t.isWebGLSupported=function(e){return void 0!==s||(s=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:e??n.AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat};try{if(!i.DOMAdapter.get().getWebGLRenderingContext())return!1;let e=i.DOMAdapter.get().createCanvas().getContext("webgl",t);const r=!!e?.getContextAttributes()?.stencil;if(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}return e=null,r}catch(e){return!1}})()),s}},73533:function(e,t,r){"use strict";var i=r(42932);let n;t.isWebGPUSupported=async function(e={}){return void 0!==n||(n=await(async()=>{const t=i.DOMAdapter.get().getNavigator().gpu;if(!t)return!1;try{const r=await t.requestAdapter(e);return await r.requestDevice(),!0}catch(e){return!1}})()),n}},4037:function(e,t){"use strict";let r;t.unsafeEvalSupported=function(){if("boolean"==typeof r)return r;try{const e=new Function("param1","param2","param3","return param1[param2] === param3;");r=!0===e({a:"b"},"a","b")}catch(e){r=!1}return r}},50034:function(e,t,r){"use strict";var i=r(42181);function n(e,t,r){for(let i=0,n=4*r*t;i=i||0===r)return;const s=i-(r=t+r>i?i-t:r);for(n=t;n{}},23522:function(e,t,r){"use strict";var i=r(15685),n=r(62792);t.Transform=class{constructor({matrix:e,observer:t}={}){this.dirty=!0,this._matrix=e??new i.Matrix,this.observer=t,this.position=new n.ObservablePoint(this,0,0),this.scale=new n.ObservablePoint(this,1,1),this.pivot=new n.ObservablePoint(this,0,0),this.skew=new n.ObservablePoint(this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1}get matrix(){const e=this._matrix;return this.dirty?(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this.dirty=!1,e):e}_onUpdate(e){this.dirty=!0,e===this.skew&&this.updateSkew(),this.observer?._onUpdate(this)}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this.dirty=!0}toString(){return`[pixi.js/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}setFromMatrix(e){e.decompose(this),this.dirty=!0}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this.skew))}}},87876:function(e,t,r){"use strict";var i=r(95997);t.getResolutionOfUrl=function(e,t=1){const r=i.Resolver.RETINA_PREFIX?.exec(e);return r?parseFloat(r[1]):t}},36491:function(e,t,r){"use strict";var i=r(42932);function n(e){if("string"!=typeof e)throw new TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function s(e){return e.split("?")[0].split("#")[0]}const o={toPosix(e){return t="\\",r="/",e.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),r);var t,r},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith("blob:")},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){n(e),e=this.toPosix(e);const t=/^file:\/\/\//.exec(e);if(t)return t[0];const r=/^[^/:]+:\/{0,2}/.exec(e);return r?r[0]:""},toAbsolute(e,t,r){if(n(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;const a=s(this.toPosix(t??i.DOMAdapter.get().getBaseUrl())),l=s(this.toPosix(r??this.rootname(a)));if((e=this.toPosix(e)).startsWith("/"))return o.join(l,e.slice(1));return this.isAbsolute(e)?e:this.join(a,e)},normalize(e){if(n(e),0===e.length)return".";if(this.isDataUrl(e)||this.isBlobUrl(e))return e;let t="";const r=(e=this.toPosix(e)).startsWith("/");this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));const i=e.endsWith("/");return(e=function(e,t){let r="",i=0,n=-1,s=0,o=-1;for(let a=0;a<=e.length;++a){if(a2){const e=r.lastIndexOf("/");if(e!==r.length-1){-1===e?(r="",i=0):(r=r.slice(0,e),i=r.length-1-r.lastIndexOf("/")),n=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,n=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+=`/${e.slice(n+1,a)}`:r=e.slice(n+1,a),i=a-n-1;n=a,s=0}else 46===o&&-1!==s?++s:s=-1}return r}(e,!1)).length>0&&i&&(e+="/"),r?`/${e}`:t+e},isAbsolute(e){return n(e),e=this.toPosix(e),!!this.hasProtocol(e)||e.startsWith("/")},join(...e){if(0===e.length)return".";let t;for(let r=0;r0)if(void 0===t)t=i;else{const n=e[r-1]??"";this.joinExtensions.includes(this.extname(n).toLowerCase())?t+=`/../${i}`:t+=`/${i}`}}return void 0===t?".":this.normalize(t)},dirname(e){if(n(e),0===e.length)return".";let t=(e=this.toPosix(e)).charCodeAt(0);const r=47===t;let i=-1,s=!0;const o=this.getProtocol(e),a=e;for(let r=(e=e.slice(o.length)).length-1;r>=1;--r)if(t=e.charCodeAt(r),47===t){if(!s){i=r;break}}else s=!1;return-1===i?r?"/":this.isUrl(a)?o+e:o:r&&1===i?"//":o+e.slice(0,i)},rootname(e){n(e);let t="";if(t=(e=this.toPosix(e)).startsWith("/")?"/":this.getProtocol(e),this.isUrl(e)){const r=e.indexOf("/",t.length);t=-1!==r?e.slice(0,r):e,t.endsWith("/")||(t+="/")}return t},basename(e,t){n(e),t&&n(t),e=s(this.toPosix(e));let r,i=0,o=-1,a=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let n=t.length-1,s=-1;for(r=e.length-1;r>=0;--r){const l=e.charCodeAt(r);if(47===l){if(!a){i=r+1;break}}else-1===s&&(a=!1,s=r+1),n>=0&&(l===t.charCodeAt(n)?-1==--n&&(o=r):(n=-1,o=s))}return i===o?o=s:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!a){i=r+1;break}}else-1===o&&(a=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname(e){n(e);let t=-1,r=0,i=-1,o=!0,a=0;for(let n=(e=s(this.toPosix(e))).length-1;n>=0;--n){const s=e.charCodeAt(n);if(47!==s)-1===i&&(o=!1,i=n+1),46===s?-1===t?t=n:1!==a&&(a=1):-1!==t&&(a=-1);else if(!o){r=n+1;break}}return-1===t||-1===i||0===a||1===a&&t===i-1&&t===r+1?"":e.slice(t,i)},parse(e){n(e);const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;let r=(e=s(this.toPosix(e))).charCodeAt(0);const i=this.isAbsolute(e);let o;t.root=this.rootname(e),o=i||this.hasProtocol(e)?1:0;let a=-1,l=0,u=-1,h=!0,c=e.length-1,d=0;for(;c>=o;--c)if(r=e.charCodeAt(c),47!==r)-1===u&&(h=!1,u=c+1),46===r?-1===a?a=c:1!==d&&(d=1):-1!==a&&(d=-1);else if(!h){l=c+1;break}return-1===a||-1===u||0===d||1===d&&a===u-1&&a===l+1?-1!==u&&(t.base=t.name=0===l&&i?e.slice(1,u):e.slice(l,u)):(0===l&&i?(t.name=e.slice(1,a),t.base=e.slice(1,u)):(t.name=e.slice(l,a),t.base=e.slice(l,u)),t.ext=e.slice(a,u)),t.dir=this.dirname(e),t},sep:"/",delimiter:":",joinExtensions:[".html"]};t.path=o},82568:function(e,t){"use strict";t.Pool=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t)}prepopulate(e){for(let t=0;t0?this._pool[--this._index]:new this._classType,t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0}}},86169:function(e,t,r){"use strict";var i=r(82568);class n{constructor(){this._poolsByClass=new Map}prepopulate(e,t){this.getPool(e).prepopulate(t)}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new i.Pool(e)),this._poolsByClass.get(e)}stats(){const e={};return this._poolsByClass.forEach((t=>{const r=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[r]={free:t.totalFree,used:t.totalUsed,size:t.totalSize}})),e}}const s=new n;t.BigPool=s,t.PoolGroupClass=n},37087:function(e,t,r){"use strict";var i=r(42932),n=r(54591);let s=!1;t.sayHello=function(e){if(!s){if(i.DOMAdapter.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`%c %c %c %c %c PixiJS %c v${n.VERSION} (${e}) http://www.pixijs.com/\n\n`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...t)}else globalThis.console&&globalThis.console.log(`PixiJS ${n.VERSION} - ${e} - http://www.pixijs.com/`);s=!0}}},65863:function(){},59121:function(e,t,r){"use strict";var i=r(5323),n=r(9187);t.EventEmitter=i,t.earcut=n},5323:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function i(){}function n(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,i,s,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,s||e,o),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,i,n=[];if(0===this._eventsCount)return n;for(i in e=this._events)t.call(e,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},a.prototype.listeners=function(e){var t=r?r+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=new Array(s);nthis._tweens[e]))}removeAll(){this._tweens={}}add(e){this._tweens[e.getId()]=e}remove(e){delete this._tweens[e.getId()]}update(e,t=!1){if(null==e&&(null==this._lastUpdateTime?(this._lastUpdateTime=this.now(),e=0):e=this.now()-this._lastUpdateTime),this._lastUpdateTime=this.now(),this._paused)return!1;const r=Object.keys(this._tweens);if(0==r.length)return!1;for(let i=0;i1?s(e[r],e[r-1],r-i):s(e[n],e[n+1>r?r:n+1],i-n)},Bezier(e,t){let r=0;const i=e.length-1,n=Math.pow,s=o.Utils.Bernstein;for(let o=0;o<=i;o++)r+=s(i,o)*n(1-t,i-o)*n(t,o)*e[o];return r},QuadraticBezier(e,t){let r=0;const i=e.length-1;if(1==t)return e[i];const n=Math.pow,s=o.Utils.Bernstein,a=i*t,l=Math.floor(a),u=.5*(a-l)+l%2*.5,h=l-l%2,c=h+1,d=h+2;return r+=s(2,0)*n(1-u,2)*n(u,0)*e[h],r+=s(2,1)*n(1-u,1)*n(u,1)*e[c],r+=s(2,2)*n(1-u,0)*n(u,2)*e[d],r},CubicBezier(e,t){let r=0;const i=e.length-1;if(1==t)return e[i];const n=Math.pow,s=o.Utils.Bernstein,a=i*t,l=Math.floor(a),u=1/3*(a-l)+1/3*(l%3),h=l-l%3,c=h+1,d=h+2,p=h+3;return r+=s(3,0)*n(1-u,3)*n(u,0)*e[h],r+=s(3,1)*n(1-u,2)*n(u,1)*e[c],r+=s(3,2)*n(1-u,1)*n(u,2)*e[d],r+=s(3,3)*n(1-u,0)*n(u,3)*e[p],r},CatmullRom(e,t){const r=e.length-1;let i=r*t,n=Math.floor(i);const s=o.Utils.CatmullRom;return e[0]==e[r]?(t<0&&(n=Math.floor(i=r*(1+t))),s(e[(n-1+r)%r],e[n],e[(n+1)%r],e[(n+2)%r],i-n)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[r]-(s(e[r],e[r],e[r-1],e[r-1],i-r)-e[r]):s(e[n?n-1:0],e[n],e[r1?s(e[r],e[r-1],r-i,2*Math.PI):s(e[n],e[n+1>r?r:n+1],i-n,2*Math.PI)},Degrees(e,t){const r=e.length-1,i=r*t,n=Math.floor(i),s=o.Utils.WrapLinear;return t<0?s(e[0],e[1],i,360):t>1?s(e[r],e[r-1],r-i,360):s(e[n],e[n+1>r?r:n+1],i-n,360)}},Color:{RGB(e,t){const r=e.length-1,i=r*t,n=Math.floor(i),s=o.Utils.RGBLinear;return t<0?s(e[0],e[1],i):t>1?s(e[r],e[r-1],r-i):s(e[n],e[n+1>r?r:n+1],i-n)},HSV(e,t){const r=e.length-1,i=r*t,n=Math.floor(i),s=o.Utils.HSVLinear;return t<0?s(e[0],e[1],i):t>1?s(e[r],e[r-1],r-i):s(e[n],e[n+1>r?r:n+1],i-n)},HCL(e,t){const r=e.length-1,i=r*t,n=Math.floor(i),s=o.Utils.HCLLinear;return t<0?s(e[0],e[1],i):t>1?s(e[r],e[r-1],r-i):s(e[n],e[n+1>r?r:n+1],i-n)}},Utils:{RGBsplit(e){return{a:e>>24&255,r:e>>16&255,g:e>>8&255,b:255&e}},HSVsplit(e){const t=o.Utils.RGBsplit(e);t.r/=255,t.g/=255,t.b/=255;const r=Math.max(t.r,t.g,t.b),i=Math.min(t.r,t.g,t.b);let n;const s=r,a=r-i,l=0==r?0:a/r;if(r==i)n=0;else{switch(r){case t.r:n=(t.g-t.b)/a+(t.g1;e--)r*=e;return e[t]=r,r}}(),CatmullRom(e,t,r,i,n){const s=.5*(r-e),o=.5*(i-t),a=n*n;return(2*t-2*r+s+o)*(n*a)+(-3*t+3*r-2*s-o)*a+s*n+t}}};class a{static __initStatic(){this._nextId=0}static nextId(){return a._nextId++}}a.__initStatic();const l={safetyCheckFunction:e=>!0,easingFunction:s.Linear.None,yoyoEasingFunction:void 0,interpolationFunction:o.Geom.Linear};class u{__init(){this._isPaused=!1}__init2(){this._valuesStart={}}__init3(){this._valuesEnd={}}__init4(){this._valuesStartRepeat={}}__init5(){this._duration=0}__init6(){this._repeatCount=0}__init7(){this._repeat=0}__init8(){this._yoyo=!1}__init9(){this._isPlaying=!1}get _reversed(){return this.yoyo&&this._repeatCount%2!=0}__init10(){this._delayTime=0}__init11(){this._startTime=0}__init12(){this._elapsedTime=0}__init13(){this._timescale=1}__init14(){this._safetyCheckFunction=l.safetyCheckFunction}__init15(){this._easingFunction=l.easingFunction}__init16(){this._yoyoEasingFunction=l.yoyoEasingFunction}__init17(){this._interpolationFunction=l.interpolationFunction}__init18(){this._chainedTweens=[]}__init19(){this._onStartCallbackFired=!1}__init20(){this._onAfterDelayCallbackFired=!1}__init21(){this._id=a.nextId()}__init22(){this._isChainStopped=!1}get _group(){return this._groupRef?this._groupRef:n.shared}set _group(e){this._groupRef=e}constructor(e,t){u.prototype.__init.call(this),u.prototype.__init2.call(this),u.prototype.__init3.call(this),u.prototype.__init4.call(this),u.prototype.__init5.call(this),u.prototype.__init6.call(this),u.prototype.__init7.call(this),u.prototype.__init8.call(this),u.prototype.__init9.call(this),u.prototype.__init10.call(this),u.prototype.__init11.call(this),u.prototype.__init12.call(this),u.prototype.__init13.call(this),u.prototype.__init14.call(this),u.prototype.__init15.call(this),u.prototype.__init16.call(this),u.prototype.__init17.call(this),u.prototype.__init18.call(this),u.prototype.__init19.call(this),u.prototype.__init20.call(this),u.prototype.__init21.call(this),u.prototype.__init22.call(this),this._object=e,this._group=t}getId(){return this._id}getGroup(){return this._group}getTimescale(){return this._timescale}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}from(e){try{JSON.stringify(e)}catch(e){throw new Error("The object you provided to the from() method has a circular reference!")}return this._setupProperties(e,this._valuesStart,e,this._valuesStartRepeat,!0),this}to(e,t){try{this._valuesEnd=JSON.parse(JSON.stringify(e))}catch(r){return console.warn("The object you provided to the to() method has a circular reference!. It can't be cloned. Falling back to dynamic targeting"),this.dynamicTo(e,t)}return void 0!==t&&(this._duration=t),this}dynamicTo(e,t){return this._valuesEnd=e,void 0!==t&&(this._duration=t),this}duration(e){return this._duration=e,this}start(e){return this._isPlaying||(null!=e&&(this._delayTime=e),this._group.add(this),this._reversed&&(this._swapEndStartRepeatValues(this._valuesStartRepeat,this._valuesEnd),this._valuesStart=JSON.parse(JSON.stringify(this._valuesStartRepeat))),this._repeatCount=0,this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onAfterDelayCallbackFired=!1,this._isChainStopped=!1,this._startTime=-this._delayTime,this._elapsedTime=0,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,!1)),this}restart(e){return this.reset(),this.start(e)}reset(){return this._isPlaying&&this.stop(),this._valuesStart={},this._valuesStartRepeat={},this}rewind(){this._isPlaying&&this.stop(),this._reversed&&this._swapEndStartRepeatValues(this._valuesStartRepeat,this._valuesEnd);const e=this._easingFunction(0);return this._updateProperties(this._object,this._valuesStart,this._valuesEnd,e),this}_setupProperties(e,t,r,i,n){for(const s in r){const o=e[s],a=Array.isArray(o),l=!Number.isNaN(Number(o)),u=a?"array":typeof o,h="object"==u,c="object"==typeof r[s],d=!a&&Array.isArray(r[s]);"undefined"!=u&&"function"!=u&&null!=r[s]&&(a||l||h)&&((h||a||c)&&o&&!d?(void 0===t[s]&&(t[s]=a?[]:{}),void 0===i[s]&&(i[s]=a?[]:{}),this._setupProperties(o,t[s],r[s],i[s],n)):((void 0===t[s]||n)&&(t[s]=o),(void 0===i[s]||n)&&(i[s]=d?r[s].slice().reverse()[0]:t[s]||0)))}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object,this),this):this}end(e=!1){let t=[];if(e||(t=this._chainedTweens,this._chainedTweens=[]),this.resume(),this.update(1/0),!e){this._chainedTweens=t;for(let e=0,t=this._chainedTweens.length;er&&!this._isPlaying)return!1;this.isPlaying||this.start(),0==this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object,this),this._onStartCallbackFired=!0),0==this._onAfterDelayCallbackFired&&i>=0&&(this._onAfterDelayCallback&&this._onAfterDelayCallback(this._object,this),this._onAfterDelayCallbackFired=!0),t=i/this._duration,0==this._duration&&(t=i>=0?1:0),t=Math.min(1,t),t=Math.max(0,t);let n=Number.isFinite(i)?i%this._duration:i;Number.isNaN(n)&&(n=0);const s=Math.floor(i/this._duration);let o;if(o=this._reversed&&this._yoyoEasingFunction?this._yoyoEasingFunction(t):this._easingFunction(t),this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&(1!=t||this._repeat-this._repeatCount<=0)&&this._onUpdateCallback(this._object,t,this),1==t){if(this._repeat-this._repeatCount>0){const e=this._repeatCount;if(this._repeatCount=Math.min(this._repeat+1,this._repeatCount+s),this._onUpdateCallback&&(this._repeat-this._repeatCount<0||n<=0)&&this._onUpdateCallback(this._object,t,this),this._yoyo?this._swapEndStartRepeatValues(this._valuesStartRepeat,this._valuesEnd):this._moveForwardStartRepeatValues(this._valuesStartRepeat,this._valuesEnd),this._valuesStart=JSON.parse(JSON.stringify(this._valuesStartRepeat)),void 0!==this._repeatDelayTime?this._startTime=-this._repeatDelayTime:this._startTime=0,this._onRepeatCallback){let t=1;Number.isFinite(s)?t=this._repeatCount-e:Number.isFinite(this._repeat)&&(t=this._repeat-e);for(let r=0;r=0)return n>0&&Number.isFinite(this._repeat)&&this._internalUpdate(n),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object,this);for(let e=0,t=this._chainedTweens.length;e0&&this._chainedTweens[e].update(n);return this._isPlaying=!1,!1}return!0}_updateProperties(e,t,r,i){for(const n in r){if(null==t[n])continue;const s=t[n];let o=r[n];const a=Array.isArray(e[n]),l=Array.isArray(o);!a&&l?this._reversed?e[n]=this._interpolationFunction(o.concat([s]),i):e[n]=this._interpolationFunction([s].concat(o),i):"object"==typeof o&&o?this._updateProperties(e[n],s,o,i):(o=this._handleRelativeValue(s,o),"number"!=typeof o||"number"!=typeof s&&"string"!=typeof s||(e[n]=Number(s)+(o-Number(s))*i,"string"==typeof s&&(e[n]=String(e[n]))))}}_handleRelativeValue(e,t){return"string"!=typeof t?t:"+"==t.charAt(0)||"-"==t.charAt(0)?e+Number(t):Number(t)}_swapEndStartRepeatValues(e,t){for(const r in e){const i=!Array.isArray(e[r])&&Array.isArray(t[r]);if("object"==typeof e[r])this._swapEndStartRepeatValues(e[r],t[r]);else{const n=e[r];if("string"==typeof t[r])e[r]=Number(e[r])+Number(t[r]),t[r]=n;else if(i){const i=t[r].slice().reverse();e[r]=i[0],t[r]=i}else e[r]=t[r],t[r]=n}}}_moveForwardStartRepeatValues(e,t){for(const r in e)"object"==typeof t[r]?this._moveForwardStartRepeatValues(e[r],t[r]):"string"==typeof t[r]&&(e[r]=Number(e[r])+Number(t[r]))}}const h="2.1.0"},68100:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collector=void 0;t.Collector=class{constructor(e){this.emit=(...t)=>{e.emitCollecting(this,t)}}}},65032:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectorArray=void 0;const i=r(68100);class n extends i.Collector{constructor(){super(...arguments),this.result=[]}handleResult(e){return this.result.push(e),!0}getResult(){return this.result}reset(){this.result.length=0}}t.CollectorArray=n},48484:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectorLast=void 0;const i=r(68100);class n extends i.Collector{handleResult(e){return this.result=e,!0}getResult(){return this.result}reset(){delete this.result}}t.CollectorLast=n},90688:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectorUntil0=void 0;const i=r(68100);class n extends i.Collector{constructor(){super(...arguments),this.result=!1}handleResult(e){return this.result=e,this.result}getResult(){return this.result}reset(){this.result=!1}}t.CollectorUntil0=n},71764:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectorWhile0=void 0;const i=r(68100);class n extends i.Collector{constructor(){super(...arguments),this.result=!1}handleResult(e){return this.result=e,!this.result}getResult(){return this.result}reset(){this.result=!1}}t.CollectorWhile0=n},97919:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signal=void 0;const i=r(2513),n=r(30470);t.Signal=class{constructor(){this.head=new n.SignalLink,this.hasNewLinks=!1,this.emitDepth=0,this.connectionsCount=0}getConnectionsCount(){return this.connectionsCount}hasConnections(){return this.connectionsCount>0}connect(e,t=0){this.connectionsCount++;const r=this.head.insert(e,t);return this.emitDepth>0&&(this.hasNewLinks=!0,r.newLink=!0),new i.SignalConnectionImpl(r,(()=>this.decrementConnectionCount()))}decrementConnectionCount(){this.connectionsCount--}disconnect(e){for(let t=this.head.next;t!==this.head;t=t.next)if(t.callback===e)return this.decrementConnectionCount(),t.unlink(),!0;return!1}disconnectAll(){for(;this.head.next!==this.head;)this.head.next.unlink();this.connectionsCount=0}emit(...e){this.emitDepth++;for(let t=this.head.next;t!==this.head;t=t.next)t.isEnabled()&&t.callback&&t.callback.apply(null,e);this.emitDepth--,this.unsetNewLink()}emitCollecting(e,t){this.emitDepth++;for(let r=this.head.next;r!==this.head;r=r.next)if(r.isEnabled()&&r.callback){const i=r.callback.apply(null,t);if(!e.handleResult(i))break}this.emitDepth--,this.unsetNewLink()}unsetNewLink(){if(this.hasNewLinks&&0===this.emitDepth){for(let e=this.head.next;e!==this.head;e=e.next)e.newLink=!1;this.hasNewLinks=!1}}}},2513:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignalConnectionImpl=void 0;t.SignalConnectionImpl=class{constructor(e,t){this.link=e,this.parentCleanup=t}disconnect(){return null!==this.link&&(this.link.unlink(),this.link=null,this.parentCleanup(),this.parentCleanup=null,!0)}set enabled(e){this.link&&this.link.setEnabled(e)}get enabled(){return null!==this.link&&this.link.isEnabled()}}},21669:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignalConnections=void 0;t.SignalConnections=class{constructor(){this.list=[]}add(e){this.list.push(e)}disconnectAll(){for(const e of this.list)e.disconnect();this.list=[]}getCount(){return this.list.length}isEmpty(){return 0===this.list.length}}},30470:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignalLink=void 0;class r{constructor(e=null,t=null,r=0){this.enabled=!0,this.newLink=!1,this.callback=null,this.prev=null!=e?e:this,this.next=null!=t?t:this,this.order=r}isEnabled(){return this.enabled&&!this.newLink}setEnabled(e){this.enabled=e}unlink(){this.callback=null,this.next.prev=this.prev,this.prev.next=this.next}insert(e,t){let i=this.prev;for(;i!==this&&!(i.order<=t);)i=i.prev;const n=new r(i,i.next,t);return n.callback=e,i.next=n,n.next.prev=n,n}}t.SignalLink=r},24242:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignalConnections=t.Signal=t.CollectorWhile0=t.CollectorUntil0=t.CollectorLast=t.CollectorArray=t.Collector=void 0;var i=r(68100);Object.defineProperty(t,"Collector",{enumerable:!0,get:function(){return i.Collector}});var n=r(65032);Object.defineProperty(t,"CollectorArray",{enumerable:!0,get:function(){return n.CollectorArray}});var s=r(48484);Object.defineProperty(t,"CollectorLast",{enumerable:!0,get:function(){return s.CollectorLast}});var o=r(90688);Object.defineProperty(t,"CollectorUntil0",{enumerable:!0,get:function(){return o.CollectorUntil0}});var a=r(71764);Object.defineProperty(t,"CollectorWhile0",{enumerable:!0,get:function(){return a.CollectorWhile0}});var l=r(97919);Object.defineProperty(t,"Signal",{enumerable:!0,get:function(){return l.Signal}});var u=r(21669);Object.defineProperty(t,"SignalConnections",{enumerable:!0,get:function(){return u.SignalConnections}})},53931:function(e,t,r){"use strict";function i(e){return e.arrayBuffer?e.arrayBuffer():new Promise(((t,r)=>{const i=new FileReader;i.addEventListener("loadend",(()=>{t(i.result)})),i.addEventListener("error",r),i.readAsArrayBuffer(e)}))}async function n(e){const t=await i(e);return new Uint8Array(t)}function s(e){return"undefined"!=typeof Blob&&e instanceof Blob}function o(e){return"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}r.r(t),r.d(t,{HTTPRangeReader:function(){return h},cleanup:function(){return le},setOptions:function(){return se},unzip:function(){return ae},unzipRaw:function(){return oe}}),e=r.hmd(e);const a="undefined"!=typeof process&&process.versions&&void 0!==process.versions.node&&void 0===process.versions.electron;class l{constructor(e){this.typedArray=e instanceof ArrayBuffer||o(e)?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}async getLength(){return this.typedArray.byteLength}async read(e,t){return new Uint8Array(this.typedArray.buffer,this.typedArray.byteOffset+e,t)}}class u{constructor(e){this.blob=e}async getLength(){return this.blob.size}async read(e,t){const r=this.blob.slice(e,e+t),n=await i(r);return new Uint8Array(n)}async sliceAsBlob(e,t,r=""){return this.blob.slice(e,e+t,r)}}class h{constructor(e){this.url=e}async getLength(){if(void 0===this.length){const e=await fetch(this.url,{method:"HEAD"});if(!e.ok)throw new Error(`failed http request ${this.url}, status: ${e.status}: ${e.statusText}`);if(this.length=parseInt(e.headers.get("content-length")),Number.isNaN(this.length))throw Error("could not get length")}return this.length}async read(e,t){if(0===t)return new Uint8Array(0);const r=await fetch(this.url,{headers:{Range:`bytes=${e}-${e+t-1}`}});if(!r.ok)throw new Error(`failed http request ${this.url}, status: ${r.status} offset: ${e} size: ${t}: ${r.statusText}`);const i=await r.arrayBuffer();return new Uint8Array(i)}}function c(e,t){var r=e.length;if(t<=r)return e;var i=new Uint8Array(Math.max(r<<1,t));return i.set(e,0),i}function d(e,t,r,i,n,s){for(var o=_,a=b,l=0;l>>4;if(h<=15)s[l]=h,l++;else{var c=0,d=0;16==h?(d=3+o(i,n,2),n+=2,c=s[l-1]):17==h?(d=3+o(i,n,3),n+=3):18==h&&(d=11+o(i,n,7),n+=7);for(var p=l+d;l>>1;sn&&(n=a),s++}for(;s>1,a=e[s+1],l=o<<4|a,u=t-a,h=e[s]<>>15-t]=l,h++}}function g(e,t){for(var r=v.rev15,i=15-t,n=0;n>>i}}function _(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)}const v=(y=Uint16Array,T=Uint32Array,{next_code:new y(16),bl_count:new y(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new y(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new T(32),flmap:new y(512),fltree:[],fdmap:new y(32),fdtree:[],lmap:new y(32768),ltree:[],ttree:[],dmap:new y(32768),dtree:[],imap:new y(512),itree:[],rev15:new y(32768),lhst:new T(286),dhst:new T(30),ihst:new T(19),lits:new T(15e3),strt:new y(65536),prev:new y(32768)});var y,T;!function(){for(var e=0;e<32768;e++){var t=e;t=(4278255360&(t=(4042322160&(t=(3435973836&(t=(2863311530&t)>>>1|(1431655765&t)<<1))>>>2|(858993459&t)<<2))>>>4|(252645135&t)<<4))>>>8|(16711935&t)<<8,v.rev15[e]=(t>>>16|t<<16)>>>17}function r(e,t,r){for(;0!=t--;)e.push(0,r)}for(e=0;e<32;e++)v.ldef[e]=v.of0[e]<<3|v.exb[e],v.ddef[e]=v.df0[e]<<4|v.dxb[e];r(v.fltree,144,8),r(v.fltree,112,9),r(v.fltree,24,7),r(v.fltree,8,8),f(v.fltree,9),m(v.fltree,9,v.flmap),g(v.fltree,9),r(v.fdtree,32,5),f(v.fdtree,5),m(v.fdtree,5,v.fdmap),g(v.fdtree,5),r(v.itree,19,0),r(v.ltree,286,0),r(v.dtree,30,0),r(v.ttree,320,0)}();const S={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var r=t,i=0;i<8;i++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update:function(e,t,r,i){for(var n=0;n>>8;return e},crc:function(e,t,r){return 4294967295^S.update(4294967295,e,t,r)}};function E(e,t){return function(e,t){var r=Uint8Array;if(3==e[0]&&0==e[1])return t||new r(0);var i=x,n=_,s=d,o=b,a=null==t;a&&(t=new r(e.length>>>2<<3));for(var l,u,h=0,g=0,y=0,T=0,S=0,E=0,w=0,A=0,M=0;0==h;)if(h=i(e,M,1),g=i(e,M+1,2),M+=3,0!=g){if(a&&(t=c(t,A+(1<<17))),1==g&&(l=v.flmap,u=v.fdmap,E=511,w=31),2==g){y=n(e,M,5)+257,T=n(e,M+5,5)+1,S=n(e,M+10,4)+4,M+=14;for(var P=0;P<38;P+=2)v.itree[P]=0,v.itree[P+1]=0;var R=1;for(P=0;PR&&(R=C)}M+=3*S,f(v.itree,R),m(v.itree,R,v.imap),l=v.lmap,u=v.dmap,M=s(v.imap,(1<>>4;if(D>>>8==0)t[A++]=D;else{if(256==D)break;var I=A+D-254;if(D>264){var O=v.ldef[D-257];I=A+(O>>>3)+n(e,M,7&O),M+=7&O}var U=u[o(e,M)&w];M+=15&U;var k=U>>>4,L=v.ddef[k],N=(L>>>4)+i(e,M,15&L);for(M+=15&L,a&&(t=c(t,A+(1<<17)));A>>3),H=e[V-4]|e[V-3]<<8;a&&(t=c(t,A+H)),t.set(new r(e.buffer,e.byteOffset+V,H),A),M=V+H<<3,A+=H}return t.length==A?t:t.slice(0,A)}(e,t)}const w={numWorkers:1,workerURL:"",useWorkers:!1};let A=0,M=0,P=!0;const R=[],C=[],B=[],G=new Map;function F(e){O(e.target);const{id:t,error:r,data:i}=e.data,n=G.get(t);G.delete(t),r?n.reject(r):n.resolve(i)}function D(e){return new Promise(((t,r)=>{const i=new Worker(e);i.onmessage=e=>{"start"===e.data?(i.onerror=void 0,i.onmessage=void 0,t(i)):r(new Error(`unexpected message: ${e.data}`))},i.onerror=r}))}const I=function(){if(a){const{Worker:i}=(r="worker_threads",(t=e).require?t.require(r):{});return{async createWorker(e){return new i(e)},addEventListener(e,t){e.on("message",(r=>{t({target:e,data:r})}))},async terminate(e){await e.terminate()}}}return{async createWorker(e){try{return await D(e)}catch(t){console.warn("could not load worker:",e)}let t;try{const r=await fetch(e,{mode:"cors"});if(!r.ok)throw new Error(`could not load: ${e}`);t=await r.text(),e=URL.createObjectURL(new Blob([t],{type:"application/javascript"}));const i=await D(e);return w.workerURL=e,i}catch(t){console.warn("could not load worker via fetch:",e)}if(void 0!==t)try{e=`data:application/javascript;base64,${btoa(t)}`;const r=await D(e);return w.workerURL=e,r}catch(e){console.warn("could not load worker via dataURI")}throw console.warn("workers will not be used"),new Error("can not start workers")},addEventListener(e,t){e.addEventListener("message",t)},async terminate(e){e.terminate()}};var t,r}();function O(e){C.push(e),k()}function U(e,t,r,i){const n=new Uint8Array(t);E(e,n),i(r?new Blob([n],{type:r}):n.buffer)}async function k(){if(0!==B.length){if(w.useWorkers&&P){const e=await async function(){if(0===C.length&&M{B.push({src:e,uncompressedSize:t,type:r,resolve:i,reject:n,id:A++}),k()}))}function N(e){e.splice(0,e.length)}class V{constructor(e,t){var r,i;this._reader=e,this._rawEntry=t,this.name=t.name,this.nameBytes=t.nameBytes,this.size=t.uncompressedSize,this.compressedSize=t.compressedSize,this.comment=t.comment,this.commentBytes=t.commentBytes,this.compressionMethod=t.compressionMethod,this.lastModDate=(r=t.lastModFileDate,i=t.lastModFileTime,new Date(1980+(r>>9&127),(r>>5&15)-1,31&r,i>>11&31,i>>5&63,2*(31&i),0)),this.isDirectory=0===t.uncompressedSize&&t.name.endsWith("/"),this.encrypted=!!(1&t.generalPurposeBitFlag),this.externalFileAttributes=t.externalFileAttributes,this.versionMadeBy=t.versionMadeBy}async blob(e="application/octet-stream"){return await async function(e,t,r){const{decompress:i,fileDataStart:n}=await ne(e,t);if(!i){const i=await j(e,n,t.compressedSize,r);return s(i)?i:new Blob([o(i.buffer)?new Uint8Array(i):i],{type:r})}const a=await j(e,n,t.compressedSize),l=await L(a,t.uncompressedSize,r);return l}(this._reader,this._rawEntry,e)}async arrayBuffer(){return await async function(e,t){const{decompress:r,fileDataStart:i}=await ne(e,t);if(!r){const r=await Y(e,i,t.compressedSize);return 0===(n=r).byteOffset&&n.byteLength===n.buffer.byteLength?r.buffer:r.slice().buffer}var n;const s=await j(e,i,t.compressedSize);return await L(s,t.uncompressedSize)}(this._reader,this._rawEntry)}async text(){const e=await this.arrayBuffer();return J(new Uint8Array(e))}async json(){const e=await this.text();return JSON.parse(e)}}const H=22,X=65535,z=101010256,W=101075792;async function Y(e,t,r){return await e.read(t,r)}async function j(e,t,r,i){return e.sliceAsBlob?await e.sliceAsBlob(t,r,i):await e.read(t,r)}const $={unsigned(){return 0}};function q(e,t){return e[t]+256*e[t+1]}function K(e,t){return e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function Q(e,t){return K(e,t)+4294967296*K(e,t+4)}const Z=new TextDecoder;function J(e,t){return o(e.buffer)&&(e=new Uint8Array(e)),Z.decode(e)}const ee=117853008;async function te(e,t,r,i){const n=t-20,s=await Y(e,n,20);if(K(s,0)!==ee)throw new Error("invalid zip64 end of central directory locator signature");const o=Q(s,8),a=await Y(e,o,56);if(K(a,0)!==W)throw new Error("invalid zip64 end of central directory record signature");const l=Q(a,32),u=Q(a,40);return ie(e,Q(a,48),u,l,r,i)}const re=33639248;async function ie(e,t,r,i,n,s){let o=0;const a=await Y(e,t,r),l=[];for(let e=0;es.length)throw new Error("extra field length exceeds extra field buffer size");r.extraFields.push({id:e,data:s.slice(t,i)}),u=i}if(r.commentBytes=i.slice(n,n+r.fileCommentLength),r.comment=J(r.commentBytes),o+=i.length,4294967295===r.uncompressedSize||4294967295===r.compressedSize||4294967295===r.relativeOffsetOfLocalHeader){const e=r.extraFields.find((e=>1===e.id));if(!e)throw new Error("expected zip64 extended information extra field");const t=e.data;let i=0;if(4294967295===r.uncompressedSize){if(i+8>t.length)throw new Error("zip64 extended information extra field does not include uncompressed size");r.uncompressedSize=Q(t,i),i+=8}if(4294967295===r.compressedSize){if(i+8>t.length)throw new Error("zip64 extended information extra field does not include compressed size");r.compressedSize=Q(t,i),i+=8}if(4294967295===r.relativeOffsetOfLocalHeader){if(i+8>t.length)throw new Error("zip64 extended information extra field does not include relative header offset");r.relativeOffsetOfLocalHeader=Q(t,i),i+=8}}const h=r.extraFields.find((e=>28789===e.id&&e.data.length>=6&&1===e.data[0]&&K(e.data,1)),$.unsigned(r.nameBytes));if(h&&(r.fileName=J(h.data.slice(5))),0===r.compressionMethod){let e=r.uncompressedSize;if(0!=(1&r.generalPurposeBitFlag)&&(e+=12),r.compressedSize!==e)throw new Error(`compressed size mismatch for stored file: ${r.compressedSize} != ${e}`)}l.push(r)}return{zip:{comment:n,commentBytes:s},entries:l.map((t=>new V(e,t)))}}async function ne(e,t){if(1&t.generalPurposeBitFlag)throw new Error("encrypted entries not supported");const r=await Y(e,t.relativeOffsetOfLocalHeader,30),i=await e.getLength(),n=K(r,0);if(67324752!==n)throw new Error(`invalid local file header signature: 0x${n.toString(16)}`);const s=q(r,26),o=q(r,28),a=t.relativeOffsetOfLocalHeader+r.length+s+o;let l;if(0===t.compressionMethod)l=!1;else{if(8!==t.compressionMethod)throw new Error(`unsupported compression method: ${t.compressionMethod}`);l=!0}const u=a,h=u+t.compressedSize;if(0!==t.compressedSize&&h>i)throw new Error(`file data overflows file bounds: ${u} + ${t.compressedSize} > ${i}`);return{decompress:l,fileDataStart:u}}function se(e){!function(e){w.workerURL=e.workerURL||w.workerURL,e.workerURL&&(w.useWorkers=!0),w.useWorkers=void 0!==e.useWorkers?e.useWorkers:w.useWorkers,w.numWorkers=e.numWorkers||w.numWorkers}(e)}async function oe(e){let t;if("undefined"!=typeof Blob&&e instanceof Blob)t=new u(e);else if(e instanceof ArrayBuffer||e&&e.buffer&&e.buffer instanceof ArrayBuffer)t=new l(e);else if(o(e)||o(e.buffer))t=new l(e);else if("string"==typeof e){const r=await fetch(e);if(!r.ok)throw new Error(`failed http request ${e}, status: ${r.status}: ${r.statusText}`);const i=await r.blob();t=new u(i)}else{if("function"!=typeof e.getLength||"function"!=typeof e.read)throw new Error("unsupported source type");t=e}const r=await t.getLength();if(r>Number.MAX_SAFE_INTEGER)throw new Error(`file too large. size: ${r}. Only file sizes up 4503599627370496 bytes are supported`);return await async function(e,t){const r=Math.min(H+X,t),i=t-r,n=await Y(e,i,r);for(let t=r-H;t>=0;--t){if(K(n,t)!==z)continue;const r=new Uint8Array(n.buffer,n.byteOffset+t,n.byteLength-t),s=q(r,4);if(0!==s)throw new Error(`multi-volume zip files are not supported. This is volume: ${s}`);const o=q(r,10),a=K(r,12),l=K(r,16),u=q(r,20),h=r.length-H;if(u!==h)throw new Error(`invalid comment length. expected: ${h}, actual: ${u}`);const c=new Uint8Array(r.buffer,r.byteOffset+22,u),d=J(c);return 65535===o||4294967295===l?await te(e,i+t,d,c):await ie(e,l,a,o,d,c)}throw new Error("could not find end of central directory. maybe not zip file")}(t,r)}async function ae(e){const{zip:t,entries:r}=await oe(e);return{zip:t,entries:Object.fromEntries(r.map((e=>[e.name,e])))}}function le(){!async function(){for(const e of R)await I.terminate(e);N(R),N(C),N(B),G.clear(),M=0,P=!0}()}},29172:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(e){var t=1.70158;return 1===e?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return 0===e?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-i.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*i.Bounce.In(2*e):.5*i.Bounce.Out(2*e-1)+.5}}),generatePow:function(e){return void 0===e&&(e=4),e=(e=e1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(2*t,e)/2:(1-Math.pow(2-2*t,e))/2+.5}}}}),n=function(){return performance.now()},s=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},e.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},e.prototype.update=function(e,t){void 0===e&&(e=n()),void 0===t&&(t=!1);var r=Object.keys(this._tweens);if(0===r.length)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i1?s(e[r],e[r-1],r-i):s(e[n],e[n+1>r?r:n+1],i-n)},Bezier:function(e,t){for(var r=0,i=e.length-1,n=Math.pow,s=o.Utils.Bernstein,a=0;a<=i;a++)r+=n(1-t,i-a)*n(t,a)*e[a]*s(i,a);return r},CatmullRom:function(e,t){var r=e.length-1,i=r*t,n=Math.floor(i),s=o.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(n=Math.floor(i=r*(1+t))),s(e[(n-1+r)%r],e[n],e[(n+1)%r],e[(n+2)%r],i-n)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[r]-(s(e[r],e[r],e[r-1],e[r-1],i-r)-e[r]):s(e[n?n-1:0],e[n],e[r1;i--)t*=i;return r[e]=t,t}),CatmullRom:function(e,t,r,i,n){var s=.5*(r-e),o=.5*(i-t),a=n*n;return(2*t-2*r+s+o)*(n*a)+(-3*t+3*r-2*s-o)*a+s*n+t}}},a=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),l=new s,u=function(){function e(e,t){void 0===t&&(t=l),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=i.Linear.None,this._interpolationFunction=o.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=a.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,t){if(void 0===t&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(e){return void 0===e&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return void 0===e&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,t){if(void 0===e&&(e=n()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var s in this._valuesEnd)i[s]=this._valuesEnd[s];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,t,r,i,n){for(var s in r){var o=e[s],a=Array.isArray(o),l=a?"array":typeof o,u=!a&&Array.isArray(r[s]);if("undefined"!==l&&"function"!==l){if(u){if(0===(g=r[s]).length)continue;for(var h=[o],c=0,d=g.length;ci)return!1;t&&this.start(e,!0)}if(this._goToEnd=!1,er)return 1;var i=e%t,n=Math.min(i/this._duration,1);return 0===n&&0!==e&&e%this._duration==0?1:n},e.prototype._calculateCompletionStatus=function(e,t){return 0!==this._duration&&e(()=>{\"use strict\";var e={m:{},d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},u:e=>e+\".ffmpeg.js\"};e.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},(()=>{var t;e.g.importScripts&&(t=e.g.location+\"\");var s=e.g.document;if(!t&&s&&(s.currentScript&&(t=s.currentScript.src),!t)){var r=s.getElementsByTagName(\"script\");if(r.length)for(var a=r.length-1;a>-1&&!t;)t=r[a--].src}if(!t)throw new Error(\"Automatic publicPath is not supported in this browser\");t=t.replace(/#.*$/,\"\").replace(/\\?.*$/,\"\").replace(/\\/[^\\/]+$/,\"/\"),e.p=t})(),e.b=document.baseURI||self.location.href;var t,s={};e.r(s),e.d(s,{FFmpeg:()=>i}),function(e){e.LOAD=\"LOAD\",e.EXEC=\"EXEC\",e.WRITE_FILE=\"WRITE_FILE\",e.READ_FILE=\"READ_FILE\",e.DELETE_FILE=\"DELETE_FILE\",e.RENAME=\"RENAME\",e.CREATE_DIR=\"CREATE_DIR\",e.LIST_DIR=\"LIST_DIR\",e.DELETE_DIR=\"DELETE_DIR\",e.ERROR=\"ERROR\",e.DOWNLOAD=\"DOWNLOAD\",e.PROGRESS=\"PROGRESS\",e.LOG=\"LOG\",e.MOUNT=\"MOUNT\",e.UNMOUNT=\"UNMOUNT\"}(t||(t={}));const r=(()=>{let e=0;return()=>e++})(),a=(new Error(\"unknown message type\"),new Error(\"ffmpeg is not loaded, call `await ffmpeg.load()` first\")),o=new Error(\"called FFmpeg.terminate()\");new Error(\"failed to import ffmpeg-core.js\");class i{#e=null;#t={};#s={};#r=[];#a=[];loaded=!1;#o=()=>{this.#e&&(this.#e.onmessage=({data:{id:e,type:s,data:r}})=>{switch(s){case t.LOAD:this.loaded=!0,this.#t[e](r);break;case t.MOUNT:case t.UNMOUNT:case t.EXEC:case t.WRITE_FILE:case t.READ_FILE:case t.DELETE_FILE:case t.RENAME:case t.CREATE_DIR:case t.LIST_DIR:case t.DELETE_DIR:this.#t[e](r);break;case t.LOG:this.#r.forEach((e=>e(r)));break;case t.PROGRESS:this.#a.forEach((e=>e(r)));break;case t.ERROR:this.#s[e](r)}delete this.#t[e],delete this.#s[e]})};#i=({type:e,data:t},s=[],o)=>this.#e?new Promise(((a,i)=>{const n=r();this.#e&&this.#e.postMessage({id:n,type:e,data:t},s),this.#t[n]=a,this.#s[n]=i,o?.addEventListener(\"abort\",(()=>{i(new DOMException(`Message # ${n} was aborted`,\"AbortError\"))}),{once:!0})})):Promise.reject(a);on(e,t){\"log\"===e?this.#r.push(t):\"progress\"===e&&this.#a.push(t)}off(e,t){\"log\"===e?this.#r=this.#r.filter((e=>e!==t)):\"progress\"===e&&(this.#a=this.#a.filter((e=>e!==t)))}load=({classWorkerURL:s,...r}={},{signal:a}={})=>(this.#e||(this.#e=s?new Worker(new URL(s,\"file:///home/jeromewu/ffmpeg.wasm/packages/ffmpeg/dist/esm/classes.js\"),{type:\"module\"}):new Worker(new URL(e.p+e.u(814),e.b),{type:void 0}),this.#o()),this.#i({type:t.LOAD,data:r},void 0,a));exec=(e,s=-1,{signal:r}={})=>this.#i({type:t.EXEC,data:{args:e,timeout:s}},void 0,r);terminate=()=>{const e=Object.keys(this.#s);for(const t of e)this.#s[t](o),delete this.#s[t],delete this.#t[t];this.#e&&(this.#e.terminate(),this.#e=null,this.loaded=!1)};writeFile=(e,s,{signal:r}={})=>{const a=[];return s instanceof Uint8Array&&a.push(s.buffer),this.#i({type:t.WRITE_FILE,data:{path:e,data:s}},a,r)};mount=(e,s,r)=>this.#i({type:t.MOUNT,data:{fsType:e,options:s,mountPoint:r}},[]);unmount=e=>this.#i({type:t.UNMOUNT,data:{mountPoint:e}},[]);readFile=(e,s=\"binary\",{signal:r}={})=>this.#i({type:t.READ_FILE,data:{path:e,encoding:s}},void 0,r);deleteFile=(e,{signal:s}={})=>this.#i({type:t.DELETE_FILE,data:{path:e}},void 0,s);rename=(e,s,{signal:r}={})=>this.#i({type:t.RENAME,data:{oldPath:e,newPath:s}},void 0,r);createDir=(e,{signal:s}={})=>this.#i({type:t.CREATE_DIR,data:{path:e}},void 0,s);listDir=(e,{signal:s}={})=>this.#i({type:t.LIST_DIR,data:{path:e}},void 0,s);deleteDir=(e,{signal:s}={})=>this.#i({type:t.DELETE_DIR,data:{path:e}},void 0,s)}return s})()));\n//# sourceMappingURL=ffmpeg.js.map","Object.defineProperty(exports,\"__esModule\",{value:!0});var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return\"string\"==typeof r?r.length>0:\"number\"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},o=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},a=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},s=/^#([0-9a-f]{3,8})$/i,i=function(r){var t=r.toString(16);return t.length<2?\"0\"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,o=Math.max(t,n,e),a=o-Math.min(t,n,e),s=a?o===t?(n-e)/a:o===n?2+(e-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:o?a/o*100:0,v:o/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var o=Math.floor(t),a=e*(1-n),s=e*(1-(t-o)*n),i=e*(1-(1-t+o)*n),h=o%6;return{r:255*[e,s,a,a,i,e][h],g:255*[i,e,e,s,a,a][h],b:255*[a,a,i,e,e,s][h],a:u}},d=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},g=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},p=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,c=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s+([+-]?\\d*\\.?\\d+)%\\s+([+-]?\\d*\\.?\\d+)%\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,v=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,m=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,y={string:[[function(r){var t=s.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},\"hex\"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:o({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:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},\"rgb\"],[function(t){var n=l.exec(t)||c.exec(t);if(!n)return null;var e,u,o=d({h:(e=n[1],u=n[2],void 0===u&&(u=\"deg\"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(o)},\"hsl\"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,a=r.a,s=void 0===a?1:a;return t(n)&&t(e)&&t(u)?o({r:Number(n),g:Number(e),b:Number(u),a:Number(s)}):null},\"rgb\"],[function(r){var n=r.h,e=r.s,u=r.l,o=r.a,a=void 0===o?1:o;if(!t(n)||!t(e)||!t(u))return null;var s=d({h:Number(n),s:Number(e),l:Number(u),a:Number(a)});return f(s)},\"hsl\"],[function(r){var n=r.h,o=r.s,a=r.v,s=r.a,i=void 0===s?1:s;if(!t(n)||!t(o)||!t(a))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(o),v:Number(a),a:Number(i)});return b(h)},\"hsv\"]]},N=function(r,t){for(var n=0;n=.5},r.prototype.toHex=function(){return r=a(this.rgba),t=r.r,e=r.g,u=r.b,s=(o=r.a)<1?i(n(255*o)):\"\",\"#\"+i(t)+i(e)+i(u)+s;var r,t,e,u,o,s},r.prototype.toRgb=function(){return a(this.rgba)},r.prototype.toRgbString=function(){return r=a(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?\"rgba(\"+t+\", \"+n+\", \"+e+\", \"+u+\")\":\"rgb(\"+t+\", \"+n+\", \"+e+\")\";var r,t,n,e,u},r.prototype.toHsl=function(){return g(p(this.rgba))},r.prototype.toHslString=function(){return r=g(p(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?\"hsla(\"+t+\", \"+n+\"%, \"+e+\"%, \"+u+\")\":\"hsl(\"+t+\", \"+n+\"%, \"+e+\"%)\";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return j({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),j(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),j(M(this.rgba,-r))},r.prototype.grayscale=function(){return j(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),j(H(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),j(H(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return\"number\"==typeof r?j({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=p(this.rgba);return\"number\"==typeof r?j({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===j(r).toHex()},r}(),j=function(r){return r instanceof $?r:new $(r)},w=[];exports.Colord=$,exports.colord=j,exports.extend=function(r){r.forEach(function(r){w.indexOf(r)<0&&(r($,y),w.push(r))})},exports.getFormat=function(r){return x(r)[1]},exports.random=function(){return new $({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};\n","module.exports=function(e,f){var a={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 d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return\"transparent\";var d,i,o=r[this.toHex()];if(o)return o;if(null==f?void 0:f.closest){var n=this.toRgb(),t=1/0,b=\"black\";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=n,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass Button extends ButtonEvents.ButtonEvents {\n /**\n * Turns a given container-based view into a button by adding all button events.\n * @param {Container} view - instance of container, to be turned into button.\n */\n constructor(view) {\n super();\n /** Container, given as a constructor parameter that is a button view. */\n __publicField(this, \"_view\");\n if (view) {\n this.view = view;\n this.enabled = true;\n }\n }\n /** Set button view, that all the interaction events are applied to. */\n set view(view) {\n const wasItInitiated = !!this._view;\n if (wasItInitiated)\n this.disconnectEvents(this._view);\n this._view = view;\n this.connectEvents(this._view);\n }\n /** Get button view, thar all the interaction events are applied to. */\n get view() {\n return this._view;\n }\n /**\n * Switcher, which prevents all button events from firing if off.\n * @param {boolean} enabled\n */\n set enabled(enabled) {\n if (!this.view) {\n console.error(\"Button view is not set. Please set it before enabling the button.\");\n return;\n }\n this.view.eventMode = enabled ? \"static\" : \"auto\";\n this.view.cursor = enabled ? \"pointer\" : \"default\";\n if (!enabled && this.isDown) {\n this.processUp();\n }\n }\n /** Getter that returns button state. */\n get enabled() {\n return this.view.eventMode === \"static\";\n }\n}\nclass ButtonContainer extends pixi_js.Container {\n constructor(view) {\n super();\n __publicField(this, \"button\");\n __publicField(this, \"onDown\");\n __publicField(this, \"onUp\");\n __publicField(this, \"onUpOut\");\n __publicField(this, \"onOut\");\n __publicField(this, \"onPress\");\n __publicField(this, \"onHover\");\n this.button = new Button(this);\n this.button.enabled = true;\n if (view) {\n this.addChild(view);\n }\n this.onPress = this.button.onPress;\n this.onDown = this.button.onDown;\n this.onUp = this.button.onUp;\n this.onHover = this.button.onHover;\n this.onOut = this.button.onOut;\n this.onUpOut = this.button.onUpOut;\n }\n set enabled(enabled) {\n this.button.enabled = enabled;\n }\n get enabled() {\n return this.button.enabled;\n }\n}\n\nexports.Button = Button;\nexports.ButtonContainer = ButtonContainer;\n//# sourceMappingURL=Button.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar typedSignals = require('typed-signals');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass ButtonEvents {\n constructor() {\n __publicField(this, \"_isMouseIn\");\n __publicField(this, \"_isDown\");\n /** Event that is fired when the button is down. */\n __publicField(this, \"onDown\");\n /**\n * Event that fired when a down event happened inside the button\n * and up event happened inside or outside of the button\n */\n __publicField(this, \"onUp\");\n /**\n * Event that fired when mouse up event happens outside of the button\n * after the down event happened inside the button boundaries.\n */\n __publicField(this, \"onUpOut\");\n /** Event that fired when the mouse is out of the view */\n __publicField(this, \"onOut\");\n /** Event that is fired when the button is pressed. */\n __publicField(this, \"onPress\");\n /** Event that is fired when the mouse hovers the button. Fired only if device is not mobile.*/\n __publicField(this, \"onHover\");\n this.onPress = new typedSignals.Signal();\n this.onDown = new typedSignals.Signal();\n this.onUp = new typedSignals.Signal();\n this.onHover = new typedSignals.Signal();\n this.onOut = new typedSignals.Signal();\n this.onUpOut = new typedSignals.Signal();\n }\n connectEvents(view) {\n if (pixi_js.isMobile.any) {\n view.on(\"pointerdown\", this.processDown, this);\n view.on(\"pointerup\", this.processUp, this);\n view.on(\"pointerupoutside\", this.processUpOut, this);\n view.on(\"pointerout\", this.processOut, this);\n view.on(\"pointertap\", this.processPress, this);\n view.on(\"pointerover\", this.processOver, this);\n } else {\n view.on(\"mousedown\", this.processDown, this);\n view.on(\"mouseup\", this.processUp, this);\n view.on(\"mouseupoutside\", this.processUpOut, this);\n view.on(\"mouseout\", this.processOut, this);\n view.on(\"click\", this.processPress, this);\n view.on(\"mouseover\", this.processOver, this);\n }\n }\n disconnectEvents(view) {\n if (pixi_js.isMobile.any) {\n view.off(\"pointerdown\", this.processDown, this);\n view.off(\"pointerup\", this.processUp, this);\n view.off(\"pointerupoutside\", this.processUpOut, this);\n view.off(\"pointerout\", this.processOut, this);\n view.off(\"pointertap\", this.processPress, this);\n view.off(\"pointerover\", this.processOver, this);\n } else {\n view.off(\"mousedown\", this.processDown, this);\n view.off(\"mouseup\", this.processUp, this);\n view.off(\"mouseupoutside\", this.processUpOut, this);\n view.off(\"mouseout\", this.processOut, this);\n view.off(\"click\", this.processPress, this);\n view.off(\"mouseover\", this.processOver, this);\n }\n }\n processDown(e) {\n this._isDown = true;\n this.onDown.emit(this, e);\n this.down(e);\n }\n processUp(e) {\n if (this._isDown) {\n this.onUp.emit(this, e);\n this.up(e);\n }\n this._isDown = false;\n }\n processUpOut(e) {\n if (this._isDown) {\n this.onUp.emit(this, e);\n this.onUpOut.emit(this, e);\n this.up(e);\n this.upOut(e);\n }\n this._isDown = false;\n }\n processOut(e) {\n if (this._isMouseIn) {\n this._isMouseIn = false;\n this.onOut.emit(this, e);\n this.out(e);\n }\n }\n processPress(e) {\n this._isDown = false;\n this.onPress.emit(this, e);\n this.press(e);\n }\n processOver(e) {\n if (pixi_js.isMobile.any)\n return;\n this._isMouseIn = true;\n this.onHover.emit(this, e);\n this.hover(e);\n }\n /**\n * Method called when the button pressed.\n * To be overridden.\n * @param {FederatedPointerEvent} _e - event data\n */\n down(_e) {\n }\n /**\n * Method called when the button is up.\n * To be overridden.\n * @param {FederatedPointerEvent} _e - event data\n */\n up(_e) {\n }\n /**\n * Method called when the up event happens outside of the button,\n * after the down event happened inside the button boundaries.\n * To be overridden.\n * @param {FederatedPointerEvent} _e - event data\n */\n upOut(_e) {\n }\n /**\n * Method called when the mouse leaves the button.\n * To be overridden.\n * @param {FederatedPointerEvent} _e - event data\n */\n out(_e) {\n }\n /**\n * Method called when the mouse press down the button.\n * To be overridden.\n * @param {FederatedPointerEvent} _e - event data\n */\n press(_e) {\n }\n /**\n * Method called when the mouse hovers the button.\n * To be overridden.\n * Fired only if device is not mobile.\n * @param {FederatedPointerEvent} _e - event data\n */\n hover(_e) {\n }\n /** Getter that returns if the button is down. */\n get isDown() {\n return this._isDown;\n }\n}\n\nexports.ButtonEvents = ButtonEvents;\n//# sourceMappingURL=ButtonEvents.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar typedSignals = require('typed-signals');\nvar Switcher = require('./Switcher.js');\nvar cleanup = require('./utils/helpers/cleanup.js');\nvar view = require('./utils/helpers/view.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass CheckBox extends Switcher.Switcher {\n constructor(options) {\n super();\n //* Text label */\n __publicField(this, \"labelText\");\n /** Signal emitted when checkbox state changes. */\n __publicField(this, \"onCheck\");\n __publicField(this, \"_style\");\n __publicField(this, \"_textClass\");\n this._textClass = options.TextClass ?? pixi_js.Text;\n this.text = options.text;\n this.style = options.style;\n this.checked = options.checked;\n this.triggerEvents = [\"onPress\"];\n this.innerView.cursor = \"pointer\";\n this.onCheck = new typedSignals.Signal();\n this.onChange.connect(() => this.onCheck.emit(this.checked));\n }\n addLabel(text, style) {\n if (!text)\n return;\n this.labelText = new this._textClass({\n text: text ?? \"\",\n style: style ?? this._style?.text\n });\n this.addChild(this.labelText);\n this.labelText.cursor = \"pointer\";\n this.labelText.eventMode = \"static\";\n this.labelText.on(\"pointertap\", () => this.checked = !this.checked);\n }\n /** Setter, which sets a checkbox text. */\n set text(text) {\n if (!text) {\n cleanup.cleanup(this.labelText);\n return;\n }\n this.labelText ? this.labelText.text = text : this.addLabel(text);\n }\n /** Getter, which returns a checkbox text. */\n get text() {\n return this.labelText?.text ?? \"\";\n }\n /** Setter, which sets a checkbox style settings. */\n set style(style) {\n const wasChecked = this.checked;\n this._style = style;\n const { unchecked, checked } = style;\n const uncheckedView = view.getView(unchecked);\n const checkedView = view.getView(checked);\n this.views = [uncheckedView, checkedView];\n if (wasChecked) {\n checkedView.visible = true;\n this.active = 1;\n } else {\n uncheckedView.visible = true;\n }\n if (this.labelText) {\n checkedView.visible = true;\n this.active = 1;\n if (style.text) {\n this.labelText.style = style.text;\n }\n this.labelText.x = uncheckedView.width + 10 + (style.textOffset?.x ?? 0);\n this.labelText.y = (uncheckedView.height - this.labelText.height) / 2 + (style.textOffset?.y ?? 0);\n } else {\n uncheckedView.visible = true;\n }\n }\n /** Getter, which returns a checkbox style settings. */\n get style() {\n return this._style;\n }\n /** Getter, which returns a checkbox state. */\n get checked() {\n return this.active === 1;\n }\n /** Setter, which sets a checkbox state. */\n set checked(checked) {\n this.switch(checked ? 1 : 0);\n }\n /**\n * Setter, that sets a checkbox state without emitting a signal.\n * @param checked\n */\n forceCheck(checked) {\n this.forceSwitch(checked ? 1 : 0);\n }\n}\n\nexports.CheckBox = CheckBox;\n//# sourceMappingURL=CheckBox.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass CircularProgressBar extends pixi_js.Container {\n /**\n * Creates a Circular ProgressBar.\n * @param { number } options - Options object to use.\n * @param { ColorSource } options.backgroundColor - Background color.\n * @param { ColorSource } options.fillColor - Fill color.\n * @param { number } options.lineWidth - Line width.\n * @param { number } options.radius - Radius.\n * @param { number } options.value - Progress value.\n * @param { number } options.backgroundAlpha - Background alpha.\n * @param { number } options.fillAlpha - Fill alpha.\n * @param { 'butt' | 'round' | 'square' } options.cap - Line cap.\n */\n constructor(options) {\n super();\n __publicField(this, \"_progress\", 0);\n __publicField(this, \"options\");\n __publicField(this, \"bgCircle\", new pixi_js.Graphics());\n __publicField(this, \"fillCircle\", new pixi_js.Graphics());\n /** Container, that holds all inner views. */\n __publicField(this, \"innerView\", new pixi_js.Container());\n this.options = options;\n this.addChild(this.innerView);\n this.innerView.addChild(this.bgCircle, this.fillCircle);\n this.addBackground();\n if (options.value) {\n this.progress = options.value;\n }\n }\n addBackground() {\n const {\n backgroundColor,\n lineWidth,\n radius,\n backgroundAlpha\n } = this.options;\n let alpha = 1;\n if (backgroundAlpha > 0) {\n alpha = backgroundAlpha;\n }\n if (backgroundColor === void 0) {\n alpha = 1e-6;\n }\n this.bgCircle.circle(0, 0, radius).stroke({\n width: lineWidth,\n color: backgroundColor,\n alpha\n });\n }\n /**\n * Set progress value.\n * @param { number } value - Progress value.\n */\n set progress(value) {\n if (value > 100) {\n value = 100;\n }\n if (value < 0) {\n value = 0;\n }\n this._progress = value;\n const {\n lineWidth,\n radius,\n fillColor,\n fillAlpha,\n cap\n } = this.options;\n if (value === 0 && fillAlpha === 0) {\n this.fillCircle.clear();\n return;\n }\n const startAngle = 0;\n const endAngle = 360 / 100 * value;\n this.fillCircle.clear().arc(0, 0, radius, (0 - 90 + startAngle) * pixi_js.DEG_TO_RAD, (0 - 90 + startAngle + endAngle) * pixi_js.DEG_TO_RAD).stroke({\n width: lineWidth,\n color: fillColor,\n cap,\n alpha: fillAlpha\n });\n }\n /**\n * Current progress value.\n * @returns { number } - Progress value.\n */\n get progress() {\n return this._progress;\n }\n}\n\nexports.CircularProgressBar = CircularProgressBar;\n//# sourceMappingURL=CircularProgressBar.js.map\n","'use strict';\n\nvar typedSignals = require('typed-signals');\nvar SliderBase = require('./SliderBase.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass DoubleSlider extends SliderBase.SliderBase {\n constructor(options) {\n super(options);\n __publicField(this, \"sliderOptions\");\n __publicField(this, \"activeValue\");\n /** Signal that fires when value have changed. */\n __publicField(this, \"onChange\", new typedSignals.Signal());\n /** Signal that fires when value is changing. */\n __publicField(this, \"onUpdate\", new typedSignals.Signal());\n this.sliderOptions = options;\n this.setInitialState();\n }\n setInitialState() {\n this.validateValues();\n const { value1, value2 } = this.sliderOptions;\n this.updateProgress(value1, value2);\n this.value2 = value2;\n this.value1 = value1;\n }\n updateProgress(value1 = this.value1, value2 = this.value2) {\n this.progressStart = (value1 - this.min) / (this.max - this.min) * 100;\n this.progress = (value2 - this.min) / (this.max - this.min) * 100;\n }\n validateValues() {\n if (!this.sliderOptions.value1) {\n this.sliderOptions.value1 = this.min;\n }\n if (!this.sliderOptions.value2) {\n this.sliderOptions.value2 = this.sliderOptions.max;\n }\n if (this.sliderOptions.value2 < this.sliderOptions.value1) {\n this.sliderOptions.value2 = this.sliderOptions.value1;\n }\n if (this.sliderOptions.value1 < this.sliderOptions.min) {\n this.sliderOptions.value1 = this.sliderOptions.min;\n }\n if (this.sliderOptions.value1 > this.sliderOptions.max) {\n this.sliderOptions.value1 = this.sliderOptions.max;\n }\n if (this.sliderOptions.value2 > this.sliderOptions.max) {\n this.sliderOptions.value2 = this.sliderOptions.max;\n }\n }\n /** Returns left value. */\n get value1() {\n return this._value1;\n }\n /** Sets left value. */\n set value1(value1) {\n if (value1 === this._value1)\n return;\n if (value1 < this.min)\n value1 = this.min;\n if (value1 > this._value2)\n value1 = this._value2;\n this._value1 = value1;\n this.updateSlider1();\n this.onUpdate?.emit(this.value1, this.value2);\n }\n /** Returns right value. */\n get value2() {\n return this._value2;\n }\n /** Sets right value. */\n set value2(value2) {\n if (value2 === this._value2)\n return;\n if (value2 < this._value1)\n value2 = this._value1;\n if (value2 > this.max)\n value2 = this.max;\n this._value2 = value2;\n this.updateSlider2();\n this.onUpdate?.emit(this.value1, this.value2);\n }\n update(event) {\n super.update(event);\n if (!this.dragging)\n return;\n const obj = event.currentTarget;\n const { x } = obj.parent.worldTransform.applyInverse(event.global);\n const slider1Dist = Math.abs(x - this._slider1.x - this._slider1.width);\n const slider2Dist = Math.abs(x - this._slider2.x);\n if (!this.activeValue) {\n if (this.slider1 && x < this.slider1.x) {\n this.activeValue = \"value1\";\n } else if (this.slider2 && x > this.slider2.x) {\n this.activeValue = \"value2\";\n } else {\n this.activeValue = slider1Dist < slider2Dist ? \"value1\" : \"value2\";\n }\n }\n const progress = this.validate(x / this.bg?.width * 100);\n if (this.activeValue === \"value1\") {\n this.progressStart = progress;\n this.value1 = this.min + (this.max - this.min) / 100 * progress;\n this.updateProgress(this.value1, this.value2);\n } else {\n this.progress = progress;\n this.value2 = this.min + (this.max - this.min) / 100 * progress;\n this.updateProgress(this.value1, this.value2);\n }\n }\n endUpdate() {\n super.endUpdate();\n this.activeValue = null;\n }\n change() {\n this.onChange?.emit(this.value1, this.value2);\n }\n /**\n * Set Slider1 instance.\n * @param value - Container or string with texture name.\n */\n set slider1(value) {\n super.slider1 = value;\n this.updateSlider1();\n }\n /** Get Slider1 instance. */\n get slider1() {\n return this._slider1;\n }\n /**\n * Sets Slider instance.\n * @param value - Container or string with texture name.\n */\n set slider2(value) {\n super.slider2 = value;\n this.updateSlider2();\n }\n /** Get Slider2 instance. */\n get slider2() {\n return this._slider2;\n }\n updateSlider1() {\n this.updateProgress(this.value1, this.value2);\n this._slider1.x = this.bg?.width / 100 * this.progressStart - this._slider1.width / 2;\n this._slider1.y = this.bg?.height / 2;\n if (this._slider2 && this._slider1.x > this._slider2.x) {\n this._slider1.x = this._slider2.x;\n }\n if (this.sliderOptions?.showValue) {\n this.value1Text.text = `${Math.round(this.value1)}`;\n const sliderPosX = this._slider1.x + this._slider1.width / 2;\n const sliderPosY = this._slider1.y;\n this.value1Text.x = sliderPosX + (this.sliderOptions.valueTextOffset?.x ?? 0);\n this.value1Text.y = sliderPosY + (this.sliderOptions.valueTextOffset?.y ?? 0);\n }\n }\n updateSlider2() {\n this.updateProgress(this.value1, this.value2);\n this._slider2.x = this.bg?.width / 100 * this.progress - this._slider2.width / 2;\n this._slider2.y = this.bg?.height / 2;\n if (this._slider2.x < this._slider1.x) {\n this._slider2.x = this._slider1.x;\n }\n if (this.sliderOptions?.showValue) {\n this.value2Text.text = `${Math.round(this.value2)}`;\n const sliderPosX = this._slider2.x + this._slider2.width / 2;\n const sliderPosY = this._slider2.y;\n this.value2Text.x = sliderPosX + (this.sliderOptions.valueTextOffset?.x ?? 0);\n this.value2Text.y = sliderPosY + (this.sliderOptions.valueTextOffset?.y ?? 0);\n }\n }\n /**\n * Sets width of a Sliders background and fill.\n * If nineSliceSprite is set, then width will be set to nineSliceSprite.\n * If nineSliceSprite is not set, then width will control components width as Container.\n * @param value - Width value.\n */\n set width(value) {\n super.width = value;\n this.updateSlider1();\n this.updateSlider2();\n }\n /** Gets width of a Slider. */\n get width() {\n return super.width;\n }\n /**\n * Sets height of a Sliders background and fill.\n * If nineSliceSprite is set, then height will be set to nineSliceSprite.\n * If nineSliceSprite is not set, then height will control components height as Container.\n * @param value - Height value.\n */\n set height(value) {\n super.height = value;\n this.updateSlider1();\n this.updateSlider2();\n }\n /** Gets height of a Slider. */\n get height() {\n return super.height;\n }\n setSize(value, height) {\n super.setSize(value, height);\n this.updateSlider1();\n this.updateSlider2();\n }\n}\n\nexports.DoubleSlider = DoubleSlider;\n//# sourceMappingURL=DoubleSlider.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar tweedle_js = require('tweedle.js');\nvar Button = require('./Button.js');\nvar fit = require('./utils/helpers/fit.js');\nvar text = require('./utils/helpers/text.js');\nvar view = require('./utils/helpers/view.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass FancyButton extends Button.ButtonContainer {\n /**\n * Creates a button with a lot of tweaks.\n * @param {object} options - Button options.\n * @param {Container} options.defaultView - Container-based view that is shown when non of the button events are active.\n * @param {Container} options.hoverView - Container-based view that is shown when the mouse hovers over the button.\n * @param {Container} options.pressedView - Container-based view, shown when the mouse press on the component.\n * @param {Container} options.disabledView - Container-based view shown when the button is disabled.\n * @param {Container} options.icon - Container-based view for the button icon.\n * @param {Text} options.text - Text-based view for the button text.\n * @param {number} options.padding - Padding of the button text and icon views.\n * If button text or icon does not fit active view + padding it will scale down to fit.\n * @param {Point} options.offset - Offset of the button state views.\n * @param {Point} options.textOffset - Offset of the text view.\n * @param {Point} options.iconOffset - Offset of the icon view.\n * @param {number} options.scale - Scale of the button. Scale will be applied to a main container,\n * when all animations scales will be applied to the inner view.\n * @param {number} options.defaultTextScale - Base text scaling to take into account when fitting inside the button.\n * @param {number} options.defaultIconScale - Base icon scaling to take into account when fitting inside the button.\n * @param {number} options.defaultTextAnchor - Base text anchor to take into account when fitting and placing inside the button.\n * @param {number} options.defaultIconAnchor - Base icon anchor to take into account when fitting and placing inside the button.\n * @param {number} options.anchor - Anchor point of the button.\n * @param {number} options.anchorX - Horizontal anchor point of the button.\n * @param {number} options.anchorY - Vertical anchor point of the button.\n * @param options.animations - Animations that will be played when the button state changes.\n */\n constructor(options) {\n super();\n __publicField(this, \"animations\");\n __publicField(this, \"originalInnerViewState\");\n __publicField(this, \"defaultDuration\", 100);\n /** FancyButton options. */\n __publicField(this, \"options\");\n /** Padding of the button text view. If button text does not fit active view + padding it will scale down to fit. */\n __publicField(this, \"_padding\");\n /** Offset of the button state views. If state views have different sizes, this option can help adjust them. */\n __publicField(this, \"_offset\");\n /** Offset of the text view. Can be set to any state of the button. */\n __publicField(this, \"_textOffset\");\n /** Offset of the icon view. Can be set to any state of the button. */\n __publicField(this, \"iconOffset\");\n //* View that holds all button inner views */\n __publicField(this, \"innerView\", new pixi_js.Container());\n __publicField(this, \"_views\", {});\n /** State of the button. Possible valuers are: 'default', 'hover', 'pressed', 'disabled' */\n __publicField(this, \"state\");\n /** Anchor point of the button. */\n __publicField(this, \"anchor\");\n /** Base text scaling to take into account when fitting inside the button */\n __publicField(this, \"_defaultTextScale\", { x: 1, y: 1 });\n /** Base icon scaling to take into account when fitting inside the button */\n __publicField(this, \"_defaultIconScale\", { x: 1, y: 1 });\n /** Base text anchor to take into account when fitting and placing inside the button */\n __publicField(this, \"_defaultTextAnchor\", { x: 0.5, y: 0.5 });\n /** Base icon anchor to take into account when fitting and placing inside the button */\n __publicField(this, \"_defaultIconAnchor\", { x: 0.5, y: 0.5 });\n this.options = options ?? {};\n const {\n defaultView,\n hoverView,\n pressedView,\n disabledView,\n text,\n padding,\n offset,\n textOffset,\n iconOffset,\n defaultTextScale: textScale,\n defaultIconScale: iconScale,\n defaultTextAnchor: textAnchor,\n defaultIconAnchor: iconAnchor,\n scale,\n anchor,\n anchorX,\n anchorY,\n icon,\n animations\n } = options ?? {};\n this.addChild(this.innerView);\n this.anchor = new pixi_js.ObservablePoint({\n _onUpdate: () => this.updateAnchor()\n });\n this.anchor.set(anchorX ?? anchor ?? 0, anchorY ?? anchor ?? 0);\n this.padding = padding ?? 0;\n this.offset = offset;\n this.textOffset = textOffset;\n this.iconOffset = iconOffset;\n this.defaultTextScale = textScale;\n this.defaultIconScale = iconScale;\n this.defaultTextAnchor = textAnchor;\n this.defaultIconAnchor = iconAnchor;\n this.scale.set(scale ?? 1);\n if (animations) {\n this.animations = animations;\n pixi_js.Ticker.shared.add(() => tweedle_js.Group.shared.update());\n }\n this.setState(\"default\");\n this.defaultView = defaultView;\n this.hoverView = hoverView;\n this.pressedView = pressedView;\n this.disabledView = disabledView;\n this.text = text;\n this.iconView = icon;\n this.initStateControl();\n }\n /**\n * Updates the text of the button and updates its scaling basing on the new size.\n * @param {string | number} text\n */\n set text(text) {\n if (!text || text === 0) {\n this.removeView(\"textView\");\n return;\n }\n if (!this._views.textView) {\n this.createTextView(text);\n return;\n }\n this._views.textView.text = text.toString();\n }\n /** Returns the text string of the button text element. */\n get text() {\n return this._views.textView?.text;\n }\n /**\n * Setter, that prevents all button events from firing.\n * @param {boolean} enabled\n */\n set enabled(enabled) {\n this.button.enabled = enabled;\n this.setState(enabled ? \"default\" : \"disabled\");\n }\n get enabled() {\n return this.button.enabled;\n }\n /**\n * Updates button state and shows the according views.\n *\n * Updates positions and offsets of the views.\n *\n * Plays animations if they are set.\n * @param {State} newState\n * @param force\n */\n setState(newState, force = false) {\n if (!force && this.state === newState) {\n return;\n }\n const currentView = this.getStateView(this.state);\n if (currentView)\n currentView.visible = false;\n this.state = newState;\n const activeView = this.getStateView(newState);\n if (activeView) {\n this.setOffset(activeView, newState, this.offset);\n activeView.visible = true;\n }\n this.updateAnchor();\n this.playAnimations(newState);\n }\n /**\n *\n * Manage button text view.\n * @param {string | Text} text - can be a string, Text, BitmapText ot HTMLText (Container-based element).\n */\n createTextView(text$1) {\n this._views.textView = text.getTextView(text$1);\n if (this.options?.defaultTextScale === void 0) {\n const { x, y } = this._views.textView.scale;\n this._defaultTextScale = { x, y };\n }\n this.innerView.addChild(this._views.textView);\n this.adjustTextView(this.state);\n }\n /**\n * Manages views offsets if it's set.\n * @param view\n * @param state\n * @param offset\n */\n setOffset(view, state, offset) {\n const stateOffset = offset ? offset[state] : {\n x: 0,\n y: 0\n };\n const defaultStateOffset = offset?.default;\n if (stateOffset) {\n view.x += stateOffset.x ?? 0;\n view.y += stateOffset.y ?? 0;\n } else if (defaultStateOffset) {\n view.x += defaultStateOffset.x ?? 0;\n view.y += defaultStateOffset.y ?? 0;\n } else if (offset.x || offset.y) {\n view.x += offset.x ?? 0;\n view.y += offset.y ?? 0;\n }\n }\n /**\n * Returns active view for the state.\n * @param state\n */\n getStateView(state) {\n if (!this._views)\n return void 0;\n switch (state) {\n case \"hover\":\n return this._views.hoverView ?? this._views.defaultView ?? void 0;\n case \"pressed\":\n return this._views.pressedView ?? this._views.hoverView ?? this._views.defaultView ?? void 0;\n case \"disabled\":\n return this._views.disabledView ?? this._views.defaultView ?? void 0;\n case \"default\":\n return this._views.defaultView ?? void 0;\n default:\n return void 0;\n }\n }\n /**\n * Adjusts text view position and scale.\n * @param {State} state\n */\n adjustTextView(state) {\n if (!this.text)\n return;\n const activeView = this.getStateView(this.state);\n const { x: anchorX, y: anchorY } = this._defaultTextAnchor;\n if (activeView) {\n if (!this.options?.ignoreRefitting) {\n this._views.textView.scale.set(this._defaultTextScale.x, this._defaultTextScale.y);\n }\n fit.fitToView(activeView, this._views.textView, this.padding, false);\n this._views.textView.x = activeView.x + activeView.width / 2;\n this._views.textView.y = activeView.y + activeView.height / 2;\n }\n this._views.textView.anchor.set(anchorX, anchorY);\n this.setOffset(this._views.textView, state, this.textOffset);\n }\n /**\n * Adjusts icon view position and scale.\n * @param {State} state\n */\n adjustIconView(state) {\n if (!this._views.iconView) {\n return;\n }\n const activeView = this.getStateView(state);\n if (!activeView) {\n return;\n }\n if (!this.options?.ignoreRefitting) {\n this._views.iconView.scale.set(this._defaultIconScale.x, this._defaultIconScale.y);\n }\n const { x: anchorX, y: anchorY } = this._defaultIconAnchor;\n fit.fitToView(activeView, this._views.iconView, this.padding, false);\n if (\"anchor\" in this._views.iconView) {\n this._views.iconView.anchor.set(anchorX, anchorY);\n } else {\n this._views.iconView.pivot.set(\n anchorX * (this._views.iconView.width / this._views.iconView.scale.x),\n anchorY * (this._views.iconView.height / this._views.iconView.scale.y)\n );\n }\n this._views.iconView.x = activeView.x + activeView.width / 2;\n this._views.iconView.y = activeView.y + activeView.height / 2;\n this.setOffset(this._views.iconView, state, this.iconOffset);\n }\n /**\n * Reset views positions according to the button anchor setting.\n * We have to set the anchor position for each view individually, as each of them\n * can be a different type of view (container without anchor, sprite with anchor, etc)\n * we have to reset all anchors to 0,0 and then set the positions manually.\n */\n updateAnchor() {\n if (!this._views)\n return;\n const anchorX = this.anchor.x ?? 0;\n const anchorY = this.anchor.y ?? 0;\n const views = [this._views.defaultView, this._views.hoverView, this._views.pressedView, this._views.disabledView];\n views.forEach((view) => {\n if (!view)\n return;\n view.anchor?.set(0);\n view.x = -view.width * anchorX;\n view.y = -view.height * anchorY;\n });\n if (this._views.defaultView) {\n const { x, y, width, height } = this._views.defaultView;\n this.hitArea = new pixi_js.Rectangle(x, y, width, height);\n }\n this.adjustIconView(this.state);\n this.adjustTextView(this.state);\n }\n /**\n * Sets the default view of the button.\n * @param { string | Container } view - string (path to the image) or a Container-based view\n */\n set defaultView(view) {\n this.updateView(\"defaultView\", view);\n }\n /** Returns the default view of the button. */\n get defaultView() {\n return this._views.defaultView;\n }\n /**\n * Sets the hover view of the button.\n * @param { string | Container } view - string (path to the image) or a Container-based view\n */\n set hoverView(view) {\n this.updateView(\"hoverView\", view);\n if (this._views.hoverView && this.state !== \"hover\") {\n this._views.hoverView.visible = false;\n }\n }\n /** Returns the hover view of the button. */\n get hoverView() {\n return this._views.hoverView;\n }\n /** Sets the pressed view of the button. */\n set pressedView(view) {\n this.updateView(\"pressedView\", view);\n if (this._views.pressedView) {\n this._views.pressedView.visible = false;\n }\n }\n /** Returns the pressed view of the button. */\n get pressedView() {\n return this._views.pressedView;\n }\n /** Sets the disabled view of the button. */\n set disabledView(view) {\n this.updateView(\"disabledView\", view);\n if (this._views.disabledView) {\n this._views.disabledView.visible = false;\n }\n }\n /** Returns the disabled view of the button. */\n get disabledView() {\n return this._views.disabledView;\n }\n /**\n * Helper method to update or cleanup button views.\n * @param { 'defaultView' | 'hoverView' | 'pressedView' | 'disabledView' } viewType - type of the view to update\n * @param { string | Container | null } view - new view\n */\n updateView(viewType, view$1) {\n if (view$1 === void 0)\n return;\n this.removeView(viewType);\n if (view$1 === null) {\n return;\n }\n if (this.options?.nineSliceSprite) {\n if (typeof view$1 === \"string\") {\n this._views[viewType] = new pixi_js.NineSliceSprite({\n texture: pixi_js.Texture.from(view$1),\n leftWidth: this.options.nineSliceSprite[0],\n topHeight: this.options.nineSliceSprite[1],\n rightWidth: this.options.nineSliceSprite[2],\n bottomHeight: this.options.nineSliceSprite[3]\n });\n } else {\n console.warn(\"NineSliceSprite can not be used with views set as Container.\");\n }\n }\n if (!this._views[viewType]) {\n this._views[viewType] = view.getView(view$1);\n }\n this.setOffset(this._views[viewType], this.state, this.offset);\n if (!this._views[viewType].parent) {\n this.innerView.addChild(this._views[viewType]);\n }\n this.updateAnchor();\n if (this._views.iconView) {\n this.innerView.addChild(this._views.iconView);\n }\n if (this._views.textView) {\n this.innerView.addChild(this._views.textView);\n }\n this.setState(this.state, true);\n }\n /**\n * Removes button view by type\n * @param {'defaultView' | 'hoverView' | 'pressedView' | 'disabledView'} viewType - type of the view to remove\n */\n removeView(viewType) {\n if (this._views[viewType]) {\n this.innerView.removeChild(this._views[viewType]);\n this._views[viewType] = null;\n }\n }\n /**\n * Sets the textView of the button.\n * @param { string | number | PixiText | Text | BitmapText | HTMLText } textView - string, text or pixi text instance.\n */\n set textView(textView) {\n if (textView === void 0)\n return;\n this.removeView(\"textView\");\n if (textView === null) {\n return;\n }\n this.createTextView(textView);\n }\n /**\n * Returns the text view of the button.\n * @returns pixi text instance or undefined.\n */\n get textView() {\n return this._views.textView;\n }\n /**\n * Sets the iconView of the button.\n * @param { string | Container } view - string (path to the image) or a Container-based view\n */\n set iconView(view$1) {\n if (view$1 === void 0)\n return;\n this.removeView(\"iconView\");\n if (view$1 === null) {\n return;\n }\n this._views.iconView = view.getView(view$1);\n if (this.options?.defaultIconScale === void 0) {\n const { x, y } = this._views.iconView.scale;\n this._defaultIconScale = { x, y };\n }\n if (!this._views.iconView.parent) {\n this.innerView.addChild(this._views.iconView);\n }\n this.setState(this.state, true);\n }\n /** Returns the icon view of the button. */\n get iconView() {\n return this._views.iconView;\n }\n /**\n * Starts animation for the current button state if configured.\n * @param {State} state\n */\n playAnimations(state) {\n if (!this.animations)\n return;\n if (state === \"default\" && !this.originalInnerViewState) {\n this.originalInnerViewState = {\n x: this.innerView.x,\n y: this.innerView.y,\n width: this.innerView.width,\n height: this.innerView.height,\n scale: {\n x: this.innerView.scale.x,\n y: this.innerView.scale.y\n }\n };\n const defaultStateAnimation = this.animations?.default;\n if (defaultStateAnimation) {\n this.innerView.x = defaultStateAnimation.props.x ?? this.originalInnerViewState.x;\n this.innerView.y = defaultStateAnimation.props.y ?? this.originalInnerViewState.y;\n this.innerView.width = defaultStateAnimation.props.width ?? this.originalInnerViewState.width;\n this.innerView.height = defaultStateAnimation.props.height ?? this.originalInnerViewState.height;\n this.innerView.scale.x = defaultStateAnimation.props.scale.x ?? this.originalInnerViewState.scale.x;\n this.innerView.scale.y = defaultStateAnimation.props.scale.y ?? this.originalInnerViewState.scale.y;\n return;\n }\n }\n const stateAnimation = this.animations[state] ?? this.animations.default;\n if (stateAnimation) {\n const data = stateAnimation;\n this.defaultDuration = data.duration;\n new tweedle_js.Tween(this.innerView).to(data.props, data.duration).start();\n return;\n }\n new tweedle_js.Tween(this.innerView).to(this.originalInnerViewState, this.defaultDuration).start();\n }\n initStateControl() {\n this.onDown.connect(() => {\n this.setState(\"pressed\");\n });\n this.onUp.connect(() => {\n pixi_js.isMobile.any ? this.setState(\"default\") : this.setState(\"hover\");\n });\n this.onUpOut.connect(() => {\n this.setState(\"default\");\n });\n this.onOut.connect(() => {\n if (!this.button.isDown) {\n this.setState(\"default\");\n }\n });\n this.onPress.connect(() => {\n pixi_js.isMobile.any ? this.setState(\"default\") : this.setState(\"hover\");\n });\n this.onHover.connect(() => {\n if (!this.button.isDown) {\n pixi_js.isMobile.any ? this.setState(\"default\") : this.setState(\"hover\");\n }\n });\n }\n /**\n * Sets the button padding.\n * @param {number} padding - padding of the button text and icon views.\n */\n set padding(padding) {\n this._padding = padding;\n this.adjustTextView(this.state);\n this.adjustIconView(this.state);\n }\n /** Returns the button padding. */\n get padding() {\n return this._padding;\n }\n /**\n * Sets the button offset.\n * @param { { x?: number; y?: number } } offset - offset of the button.\n * Can be set for each state of the button.\n */\n set offset(offset) {\n this._offset = offset;\n this.updateAnchor();\n }\n /** Returns the button offset. */\n get offset() {\n return this._offset;\n }\n /**\n * Sets the button text offset.\n * @param { { x?: number; y?: number } } textOffset - offsets of the button text view.\n * can be set for each state of the button.\n */\n set textOffset(textOffset) {\n this._textOffset = textOffset;\n this.adjustTextView(this.state);\n }\n /** Returns the button text offset. */\n get textOffset() {\n return this._textOffset;\n }\n /**\n * Sets the base scale for the text view to take into account when fitting inside the button.\n * @param {Pos | number} scale - base scale of the text view.\n */\n set defaultTextScale(scale) {\n if (scale === void 0)\n return;\n this.options.defaultTextScale = scale;\n const isNumber = typeof scale === \"number\";\n this._defaultTextScale.x = isNumber ? scale : scale.x ?? 1;\n this._defaultTextScale.y = isNumber ? scale : scale.y ?? 1;\n this.adjustTextView(this.state);\n }\n /** Returns the text view base scale. */\n get defaultTextScale() {\n return this.defaultTextScale;\n }\n /**\n * Sets the base scale for the icon view to take into account when fitting inside the button.\n * @param {Pos | number} scale - base scale of the icon view.\n */\n set defaultIconScale(scale) {\n if (scale === void 0)\n return;\n this.options.defaultIconScale = scale;\n const isNumber = typeof scale === \"number\";\n this._defaultIconScale.x = isNumber ? scale : scale.x ?? 1;\n this._defaultIconScale.y = isNumber ? scale : scale.y ?? 1;\n this.adjustIconView(this.state);\n }\n /** Returns the icon view base scale. */\n get defaultIconScale() {\n return this.defaultIconScale;\n }\n /**\n * Sets the base anchor for the text view to take into account when fitting and placing inside the button.\n * @param {Pos | number} anchor - base anchor of the text view.\n */\n set defaultTextAnchor(anchor) {\n if (anchor === void 0)\n return;\n this.options.defaultTextAnchor = anchor;\n const isNumber = typeof anchor === \"number\";\n this._defaultTextAnchor.x = isNumber ? anchor : anchor.x ?? 1;\n this._defaultTextAnchor.y = isNumber ? anchor : anchor.y ?? 1;\n this.adjustTextView(this.state);\n }\n /** Returns the text view base anchor. */\n get defaultTextAnchor() {\n return this.defaultTextAnchor;\n }\n /**\n * Sets the base anchor for the icon view to take into account when fitting and placing inside the button.\n * @param {Pos | number} anchor - base anchor of the icon view.\n */\n set defaultIconAnchor(anchor) {\n if (anchor === void 0)\n return;\n this.options.defaultIconAnchor = anchor;\n const isNumber = typeof anchor === \"number\";\n this._defaultIconAnchor.x = isNumber ? anchor : anchor.x ?? 1;\n this._defaultIconAnchor.y = isNumber ? anchor : anchor.y ?? 1;\n this.adjustIconView(this.state);\n }\n /** Returns the icon view base anchor. */\n get defaultIconAnchor() {\n return this.defaultIconAnchor;\n }\n /**\n * Sets width of a FancyButtons state views.\n * If nineSliceSprite is set, then width will be set to nineSliceSprites of a views.\n * If nineSliceSprite is not set, then width will control components width as Container.\n * @param width - Width value.\n */\n set width(width) {\n if (this.options?.nineSliceSprite) {\n if (this._views.defaultView) {\n this._views.defaultView.width = width;\n }\n if (this._views.hoverView) {\n this._views.hoverView.width = width;\n }\n if (this._views.pressedView) {\n this._views.pressedView.width = width;\n }\n if (this._views.disabledView) {\n this._views.disabledView.width = width;\n }\n this.adjustTextView(this.state);\n this.adjustIconView(this.state);\n this.updateAnchor();\n } else {\n super.width = width;\n }\n }\n /** Gets width of a FancyButton. */\n get width() {\n return super.width;\n }\n /**\n * Sets height of a FancyButtons state views.\n * If nineSliceSprite is set, then height will be set to nineSliceSprites of a views.\n * If nineSliceSprite is not set, then height will control components height as Container.\n * @param height - Height value.\n */\n set height(height) {\n if (this.options?.nineSliceSprite) {\n if (this._views.defaultView) {\n this._views.defaultView.height = height;\n }\n if (this._views.hoverView) {\n this._views.hoverView.height = height;\n }\n if (this._views.pressedView) {\n this._views.pressedView.height = height;\n }\n if (this._views.disabledView) {\n this._views.disabledView.height = height;\n }\n this.adjustTextView(this.state);\n this.adjustIconView(this.state);\n this.updateAnchor();\n } else {\n super.height = height;\n }\n }\n /** Gets height of a FancyButton. */\n get height() {\n return super.height;\n }\n setSize(value, height) {\n if (this.options?.nineSliceSprite) {\n if (this._views.defaultView) {\n this._views.defaultView.setSize(value, height);\n }\n if (this._views.hoverView) {\n this._views.hoverView.setSize(value, height);\n }\n if (this._views.pressedView) {\n this._views.pressedView.setSize(value, height);\n }\n if (this._views.disabledView) {\n this._views.disabledView.setSize(value, height);\n }\n this.adjustTextView(this.state);\n this.adjustIconView(this.state);\n this.updateAnchor();\n } else {\n super.setSize(value, height);\n }\n }\n}\n\nexports.FancyButton = FancyButton;\n//# sourceMappingURL=FancyButton.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar typedSignals = require('typed-signals');\nvar view = require('./utils/helpers/view.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass Input extends pixi_js.Container {\n /**\n * Creates an input.\n * @param { number } options - Options object to use.\n * @param { Sprite | Graphics | string } options.bg - Background of the Input.\n * @param { PixiTextStyle } options.textStyle - Text style of the Input.\n * @param { string } options.placeholder - Placeholder of the Input.\n * @param { string } options.value - Value of the Input.\n * @param { number } options.maxLength - Max length of the Input.\n * @param { 'left' | 'center' | 'right' } options.align - Align of the Input.\n * @param { Padding } options.padding - Padding of the Input.\n * @param { number } options.padding.top - Top padding of the Input.\n * @param { number } options.padding.right - Right padding of the Input.\n * @param { number } options.padding.bottom - Bottom padding of the Input.\n * @param { number } options.padding.left - Left padding of the Input.\n * @param { boolean } options.cleanOnFocus - Clean Input on focus.\n * @param { Array } options.nineSliceSprite - NineSliceSprite values for bg and fill ([number, number, number, number]).\n */\n constructor(options) {\n super();\n __publicField(this, \"_bg\");\n __publicField(this, \"inputMask\");\n __publicField(this, \"_cursor\");\n __publicField(this, \"inputField\");\n __publicField(this, \"placeholder\");\n __publicField(this, \"editing\", false);\n __publicField(this, \"tick\", 0);\n __publicField(this, \"lastInputData\");\n __publicField(this, \"activation\", false);\n __publicField(this, \"options\");\n __publicField(this, \"input\");\n __publicField(this, \"handleActivationBinding\", this.handleActivation.bind(this));\n __publicField(this, \"onKeyUpBinding\", this.onKeyUp.bind(this));\n __publicField(this, \"stopEditingBinding\", this.stopEditing.bind(this));\n __publicField(this, \"onInputBinding\", this.onInput.bind(this));\n /** Fires when input loses focus. */\n __publicField(this, \"onEnter\");\n /** Fires every time input string is changed. */\n __publicField(this, \"onChange\");\n /** Top side padding */\n __publicField(this, \"paddingTop\", 0);\n /** Right side padding */\n __publicField(this, \"paddingRight\", 0);\n /** Bottom side padding */\n __publicField(this, \"paddingBottom\", 0);\n /** Left side padding */\n __publicField(this, \"paddingLeft\", 0);\n this.options = options;\n this.options = options;\n this.padding = options.padding;\n this.cursor = \"text\";\n this.interactive = true;\n this.on(\"pointertap\", () => {\n this.activation = true;\n pixi_js.isMobile.any && this.handleActivation();\n });\n if (pixi_js.isMobile.any) {\n window.addEventListener(\"touchstart\", this.handleActivationBinding);\n } else if (!pixi_js.isMobile.any) {\n window.addEventListener(\"click\", this.handleActivationBinding);\n window.addEventListener(\"keyup\", this.onKeyUpBinding);\n window.addEventListener(\"input\", this.onInputBinding);\n }\n this.onEnter = new typedSignals.Signal();\n this.onChange = new typedSignals.Signal();\n pixi_js.Ticker.shared.add((ticker) => this.update(ticker.deltaTime));\n if (options.bg) {\n this.bg = options.bg;\n } else {\n console.error(\"Input: bg is not defined, please define it.\");\n }\n }\n onInput(e) {\n this.lastInputData = e.data;\n }\n onKeyUp(e) {\n const key = e.key;\n if (key === \"Backspace\") {\n this._delete();\n } else if (key === \"Escape\" || key === \"Enter\") {\n this.stopEditing();\n } else if (key.length === 1) {\n this._add(key);\n } else if (this.lastInputData && this.lastInputData.length === 1) {\n this._add(this.lastInputData);\n }\n }\n init() {\n const options = this.options;\n const defaultTextStyle = {\n fill: 0,\n align: \"center\"\n };\n this.options.textStyle = options.textStyle ?? defaultTextStyle;\n this.options.TextClass = options.TextClass ?? pixi_js.Text;\n const textStyle = { ...defaultTextStyle, ...options.textStyle };\n this.inputField = new this.options.TextClass({ text: \"\", style: textStyle });\n this._cursor = new pixi_js.Sprite(pixi_js.Texture.WHITE);\n this._cursor.tint = Number(options.textStyle.fill) || 0;\n this._cursor.anchor.set(0.5);\n this._cursor.width = 2;\n this._cursor.height = this.inputField.height * 0.8;\n this._cursor.alpha = 0;\n this.placeholder = new this.options.TextClass({ text: options.placeholder, style: textStyle ?? defaultTextStyle });\n this.placeholder.visible = !!options.placeholder;\n this.addChild(this.inputField, this.placeholder, this._cursor);\n this.value = options.value ?? \"\";\n this.align();\n }\n set bg(bg) {\n if (this._bg) {\n this._bg.destroy();\n }\n if (this.options?.nineSliceSprite) {\n if (typeof bg === \"string\") {\n this._bg = new pixi_js.NineSliceSprite({\n texture: pixi_js.Texture.from(bg),\n leftWidth: this.options.nineSliceSprite[0],\n topHeight: this.options.nineSliceSprite[1],\n rightWidth: this.options.nineSliceSprite[2],\n bottomHeight: this.options.nineSliceSprite[3]\n });\n } else {\n console.warn(\"NineSliceSprite can not be used with views set as Container.\");\n }\n }\n if (!this._bg) {\n this._bg = view.getView(bg);\n }\n this._bg.cursor = \"text\";\n this._bg.interactive = true;\n this.addChildAt(this._bg, 0);\n if (!this.inputField) {\n this.init();\n }\n if (this.options.addMask) {\n if (this.inputMask) {\n this.inputField.mask = null;\n this._cursor.mask = null;\n this.inputMask.destroy();\n }\n if (this.options?.nineSliceSprite && typeof bg === \"string\") {\n this.inputMask = new pixi_js.NineSliceSprite({\n texture: pixi_js.Texture.from(bg),\n leftWidth: this.options.nineSliceSprite[0],\n topHeight: this.options.nineSliceSprite[1],\n rightWidth: this.options.nineSliceSprite[2],\n bottomHeight: this.options.nineSliceSprite[3]\n });\n } else if (bg instanceof pixi_js.Sprite) {\n this.inputMask = new pixi_js.Sprite(bg.texture);\n } else if (bg instanceof pixi_js.Graphics) {\n this.inputMask = bg.clone(true);\n } else {\n this.inputMask = view.getView(bg);\n }\n this.inputField.mask = this.inputMask;\n this._cursor.mask = this.inputMask;\n this.addChildAt(this.inputMask, 0);\n }\n }\n get bg() {\n return this._bg;\n }\n _add(key) {\n if (!this.editing) {\n return;\n }\n if (this.options.maxLength && this.value.length >= this.options.maxLength) {\n return;\n }\n this.value = this.value + key;\n this.onChange.emit(this.value);\n }\n _delete() {\n if (!this.editing || this.value.length === 0)\n return;\n const array = this.value.split(\"\");\n array.pop();\n this.value = array.join(\"\");\n this.onChange.emit(this.value);\n }\n _startEditing() {\n if (this.options.cleanOnFocus) {\n this.value = \"\";\n }\n this.tick = 0;\n this.editing = true;\n this.placeholder.visible = false;\n this._cursor.alpha = 1;\n if (pixi_js.isMobile.any) {\n this.createInputField();\n }\n this.align();\n }\n createInputField() {\n if (this.input) {\n this.input.removeEventListener(\"blur\", this.stopEditingBinding);\n this.input.removeEventListener(\"keyup\", this.onKeyUpBinding);\n this.input.removeEventListener(\"input\", this.onInputBinding);\n this.input?.blur();\n this.input?.remove();\n this.input = null;\n }\n const input = document.createElement(\"input\");\n document.body.appendChild(input);\n input.style.position = \"fixed\";\n input.style.left = `${this.getGlobalPosition().x}px`;\n input.style.top = `${this.getGlobalPosition().y}px`;\n input.style.opacity = \"0.0000001\";\n input.style.width = `${this._bg.width}px`;\n input.style.height = `${this._bg.height}px`;\n input.style.border = \"none\";\n input.style.outline = \"none\";\n input.style.background = \"white\";\n if (pixi_js.isMobile.android.device) {\n setTimeout(() => {\n input.focus();\n input.click();\n }, 100);\n } else {\n input.focus();\n input.click();\n }\n input.addEventListener(\"blur\", this.stopEditingBinding);\n input.addEventListener(\"keyup\", this.onKeyUpBinding);\n input.addEventListener(\"input\", this.onInputBinding);\n this.input = input;\n this.align();\n }\n handleActivation() {\n this.stopEditing();\n if (this.activation) {\n this._startEditing();\n this.activation = false;\n }\n }\n stopEditing() {\n if (!this.editing)\n return;\n this._cursor.alpha = 0;\n this.editing = false;\n if (this.inputField.text === \"\") {\n this.placeholder.visible = true;\n }\n if (this.value.length === 0)\n this.placeholder.visible = true;\n if (pixi_js.isMobile.any) {\n this.input?.blur();\n this.input?.remove();\n this.input = null;\n }\n this.align();\n this.onEnter.emit(this.value);\n }\n update(dt) {\n if (!this.editing)\n return;\n this.tick += dt * 0.1;\n this._cursor.alpha = Math.round(Math.sin(this.tick) * 0.5 + 0.5);\n }\n align() {\n if (!this._bg)\n return;\n const align = this.getAlign();\n this.inputField.anchor.set(align, 0.5);\n this.inputField.x = this._bg.width * align + (align === 1 ? -this.paddingRight : this.paddingLeft);\n this.inputField.y = this._bg.height / 2 + this.paddingTop - this.paddingBottom;\n this.placeholder.anchor.set(align, 0.5);\n this.placeholder.x = this._bg.width * align + (align === 1 ? -this.paddingRight : this.paddingLeft);\n this.placeholder.y = this._bg.height / 2;\n this._cursor.x = this.getCursorPosX();\n this._cursor.y = this.inputField.y;\n }\n getAlign() {\n const maxWidth = this._bg.width * 0.95;\n const paddings = this.paddingLeft + this.paddingRight - 10;\n const isOverflowed = this.inputField.width + paddings > maxWidth;\n if (isOverflowed) {\n return this.editing ? 1 : 0;\n }\n switch (this.options.align) {\n case \"left\":\n return 0;\n case \"center\":\n return 0.5;\n case \"right\":\n return 1;\n default:\n return 0;\n }\n }\n getCursorPosX() {\n const align = this.getAlign();\n switch (align) {\n case 0:\n return this.inputField.x + this.inputField.width;\n case 0.5:\n return this.inputField.x + this.inputField.width * 0.5;\n case 1:\n return this.inputField.x;\n default:\n return 0;\n }\n }\n /** Sets the input text. */\n set value(text) {\n this.inputField.text = text;\n if (text.length !== 0) {\n this.placeholder.visible = false;\n } else {\n this.placeholder.visible = !this.editing;\n }\n this.align();\n }\n /** Return text of the input. */\n get value() {\n return this.inputField.text;\n }\n /**\n * Set paddings\n * @param value - number, array of 4 numbers or object with keys: top, right, bottom, left\n * or: [top, right, bottom, left]\n * or: [top&bottom, right&left]\n * or: {\n * left: 10,\n * right: 10,\n * top: 10,\n * bottom: 10,\n * }\n */\n set padding(value) {\n if (typeof value === \"number\") {\n this.paddingTop = value;\n this.paddingRight = value;\n this.paddingBottom = value;\n this.paddingLeft = value;\n }\n if (Array.isArray(value)) {\n this.paddingTop = value[0] ?? 0;\n this.paddingRight = value[1] ?? value[0] ?? 0;\n this.paddingBottom = value[2] ?? value[0] ?? 0;\n this.paddingLeft = value[3] ?? value[1] ?? value[0] ?? 0;\n } else if (typeof value === \"object\") {\n this.paddingTop = value.top ?? 0;\n this.paddingRight = value.right ?? 0;\n this.paddingBottom = value.bottom ?? 0;\n this.paddingLeft = value.left ?? 0;\n }\n }\n // Return array of paddings [top, right, bottom, left]\n get padding() {\n return [this.paddingTop, this.paddingRight, this.paddingBottom, this.paddingLeft];\n }\n destroy(options) {\n this.off(\"pointertap\");\n if (pixi_js.isMobile.any) {\n window.removeEventListener(\"touchstart\", this.handleActivationBinding);\n } else if (!pixi_js.isMobile.any) {\n window.removeEventListener(\"click\", this.handleActivationBinding);\n window.removeEventListener(\"keyup\", this.onKeyUpBinding);\n window.removeEventListener(\"input\", this.onInputBinding);\n }\n super.destroy(options);\n }\n /**\n * Sets width of a Input.\n * If nineSliceSprite is set, then width will be set to nineSliceSprite.\n * If nineSliceSprite is not set, then width will control components width as Container.\n * @param width - Width value.\n */\n set width(width) {\n if (this.options?.nineSliceSprite) {\n if (this._bg) {\n this._bg.width = width;\n }\n if (this.inputMask) {\n this.inputMask.width = width - this.paddingLeft - this.paddingRight;\n this.inputMask.x = this.paddingLeft;\n }\n this.align();\n } else {\n super.width = width;\n }\n }\n /** Gets width of Input. */\n get width() {\n return super.width;\n }\n /**\n * Sets height of a Input.\n * If nineSliceSprite is set, then height will be set to nineSliceSprite.\n * If nineSliceSprite is not set, then height will control components height as Container.\n * @param height - Height value.\n */\n set height(height) {\n if (this.options?.nineSliceSprite) {\n if (this._bg) {\n this._bg.height = height;\n }\n if (this.inputMask) {\n this.inputMask.height = height - this.paddingTop - this.paddingBottom;\n this.inputMask.y = this.paddingTop;\n }\n this.align();\n } else {\n super.height = height;\n }\n }\n /** Gets height of Input. */\n get height() {\n return super.height;\n }\n setSize(value, height) {\n if (this.options?.nineSliceSprite) {\n if (this._bg) {\n this._bg.setSize(value, height);\n }\n if (this.inputMask) {\n if (typeof value === \"object\") {\n height = value.height ?? value.width;\n value = value.width;\n } else {\n height = height ?? value;\n }\n this.inputMask.setSize(\n value - this.paddingLeft - this.paddingRight,\n height - this.paddingTop - this.paddingBottom\n );\n this.inputMask.position.set(this.paddingLeft, this.paddingTop);\n }\n this.align();\n } else {\n super.setSize(value, height);\n }\n }\n}\n\nexports.Input = Input;\n//# sourceMappingURL=Input.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass List extends pixi_js.Container {\n constructor(options) {\n super();\n __publicField(this, \"options\");\n /** Container, that holds all inner elements. */\n __publicField(this, \"view\");\n /** Arrange direction. */\n __publicField(this, \"_type\");\n /** Returns all arranged elements. */\n __publicField(this, \"children\", []);\n if (options) {\n this.init(options);\n }\n options?.items?.forEach((item) => this.addChild(item));\n this.on(\"added\", () => this.arrangeChildren());\n this.on(\"childAdded\", () => this.arrangeChildren());\n }\n /**\n * Initiates list component.\n * @param options\n */\n init(options) {\n this.options = options;\n if (options?.type) {\n this.type = options.type;\n }\n if (options?.children) {\n options.children.forEach((child) => this.addChild(child));\n }\n }\n /**\n * Set items arrange direction.\n * @param type - Arrange direction.\n */\n set type(type) {\n this._type = type;\n this.arrangeChildren();\n }\n /**\n * Get items arrange direction.\n * @returns Arrange direction.\n */\n get type() {\n return this._type;\n }\n /**\n * Set element margin.\n * @param margin - Margin between elements.\n */\n set elementsMargin(margin) {\n if (!this.options)\n throw new Error(\"List has not been initiated!\");\n this.options.elementsMargin = margin;\n this.arrangeChildren();\n }\n /**\n * Get element margin.\n * @returns Margin between elements.\n */\n get elementsMargin() {\n return this.options?.elementsMargin ?? 0;\n }\n /**\n * Set padding, overriding all padding options.\n * @param padding - Padding surrounding list elements and its border.\n */\n set padding(padding) {\n if (!this.options)\n throw new Error(\"List has not been initiated!\");\n this.options.padding = padding;\n this.options.vertPadding = padding;\n this.options.horPadding = padding;\n this.options.leftPadding = padding;\n this.options.rightPadding = padding;\n this.options.topPadding = padding;\n this.options.bottomPadding = padding;\n this.arrangeChildren();\n }\n /**\n * Get padding.\n * @returns Padding surrounding list elements and its border.\n */\n get padding() {\n return this.options?.padding ?? 0;\n }\n /**\n * Set vertical padding, overriding all top and bottom padding options.\n * @param padding - Vertical padding between list border and its elements.\n */\n set vertPadding(padding) {\n if (!this.options)\n throw new Error(\"List has not been initiated!\");\n this.options.vertPadding = padding;\n this.options.topPadding = padding;\n this.options.bottomPadding = padding;\n this.arrangeChildren();\n }\n /**\n * Get vertical padding.\n * @returns Vertical padding between list border and its elements.\n */\n get vertPadding() {\n return this.options?.vertPadding ?? this.padding ?? 0;\n }\n /**\n * Set horizontal padding, overriding all left and right padding options.\n * @param padding - Horizontal padding between list border and its elements.\n */\n set horPadding(padding) {\n if (!this.options)\n throw new Error(\"List has not been initiated!\");\n this.options.horPadding = padding;\n this.options.leftPadding = padding;\n this.options.rightPadding = padding;\n this.arrangeChildren();\n }\n /**\n * Get horizontal padding.\n * @returns Horizontal padding between list border and its elements.\n */\n get horPadding() {\n return this.options?.horPadding ?? this.padding ?? 0;\n }\n /**\n * Set left padding.\n * @param padding - Left padding between list border and its elements.\n */\n set leftPadding(padding) {\n if (!this.options)\n throw new Error(\"List has not been initiated!\");\n this.options.leftPadding = padding;\n this.arrangeChildren();\n }\n /**\n * Get left padding.\n * @returns Left padding between list border and its elements.\n */\n get leftPadding() {\n return this.options?.leftPadding ?? this.horPadding;\n }\n /**\n * Set right padding.\n * @param padding - Right padding between list border and its elements.\n */\n set rightPadding(padding) {\n if (!this.options)\n throw new Error(\"List has not been initiated!\");\n this.options.rightPadding = padding;\n this.arrangeChildren();\n }\n /**\n * Get right padding.\n * @returns Right padding between list border and its elements.\n */\n get rightPadding() {\n return this.options?.rightPadding ?? this.horPadding;\n }\n /**\n * Set top padding.\n * @param padding - Top padding between list border and its elements.\n */\n set topPadding(padding) {\n if (!this.options)\n throw new Error(\"List has not been initiated!\");\n this.options.topPadding = padding;\n this.arrangeChildren();\n }\n /**\n * Get top padding.\n * @returns Top padding between list border and its elements.\n */\n get topPadding() {\n return this.options?.topPadding ?? this.vertPadding;\n }\n /**\n * Set bottom padding.\n * @param padding - Bottom padding between list border and its elements.\n */\n set bottomPadding(padding) {\n if (!this.options)\n throw new Error(\"List has not been initiated!\");\n this.options.bottomPadding = padding;\n this.arrangeChildren();\n }\n /**\n * Get bottom padding.\n * @returns Bottom padding between list border and its elements.\n */\n get bottomPadding() {\n return this.options?.bottomPadding ?? this.vertPadding;\n }\n /**\n * Arrange all elements basing in their sizes and component options.\n * Can be arranged vertically, horizontally or bidirectional.\n */\n arrangeChildren() {\n let maxHeight = 0;\n let x = this.leftPadding;\n let y = this.topPadding;\n const elementsMargin = this.options?.elementsMargin ?? 0;\n let maxWidth = this.parent?.width;\n if (this.rightPadding) {\n maxWidth -= this.rightPadding;\n }\n this.children.forEach((child, id) => {\n switch (this.type) {\n case \"vertical\":\n child.y = y;\n child.x = x;\n y += elementsMargin + child.height;\n break;\n case \"horizontal\":\n child.x = x;\n child.y = y;\n x += elementsMargin + child.width;\n break;\n default:\n child.x = x;\n child.y = y;\n if (child.x + child.width > maxWidth && id > 0) {\n y += elementsMargin + maxHeight;\n x = this.leftPadding;\n child.x = x;\n child.y = y;\n maxHeight = 0;\n }\n maxHeight = Math.max(maxHeight, child.height);\n x += elementsMargin + child.width;\n break;\n }\n });\n }\n /**\n * Removes items from the list. (Does not destroy them)\n * @param itemID - Item to remove (starting from 0).\n */\n removeItem(itemID) {\n const child = this.children[itemID];\n if (!child) {\n return;\n }\n this.removeChild(child);\n this.arrangeChildren();\n }\n}\n\nexports.List = List;\n//# sourceMappingURL=List.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar view = require('./utils/helpers/view.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass MaskedFrame extends pixi_js.Container {\n constructor(options) {\n super();\n /** Target container. */\n __publicField(this, \"target\");\n __publicField(this, \"border\", new pixi_js.Graphics());\n __publicField(this, \"_targetMask\");\n __publicField(this, \"maskData\");\n __publicField(this, \"borderWidth\");\n __publicField(this, \"borderColor\");\n if (options?.target) {\n this.init(options);\n }\n }\n /**\n * Initializes a component.\n * @param root0\n * @param root0.target - Container to apply a mask or a border.\n * @param root0.mask - Mask.\n * @param root0.borderWidth - Border width.\n * @param root0.borderColor - Border color.\n */\n init({ target, mask, borderWidth, borderColor }) {\n if (this.target) {\n this.removeChild(this.target);\n }\n this.target = view.getView(target);\n this.addChild(this.border, this.target);\n if (mask)\n this.setMask(mask);\n if (borderWidth)\n this.setBorder(borderWidth, borderColor);\n }\n /**\n * Applies a mask to a target container.\n * @param mask\n */\n setMask(mask) {\n this.maskData = mask;\n this._targetMask = view.getView(mask);\n this.addChild(this._targetMask);\n this.target.mask = this._targetMask;\n }\n /**\n * Shows a border around the target Container, same shape as the mask.\n * @param borderWidth\n * @param borderColor\n */\n setBorder(borderWidth, borderColor) {\n this.borderWidth = borderWidth;\n this.borderColor = borderColor;\n this.showBorder();\n if (this.maskData) {\n const borderMask = typeof this.maskData === \"string\" ? pixi_js.Sprite.from(this.maskData) : this.maskData.clone(true);\n borderMask.width += borderWidth * 2;\n borderMask.height += borderWidth * 2;\n this.mask = borderMask;\n this.addChild(borderMask);\n this._targetMask.position.set(borderWidth);\n }\n }\n /** Hides a border. */\n showBorder() {\n const width = this.borderWidth * 2;\n this.border.clear().rect(0, 0, this.target.width + width, this.target.height + width).fill(this.borderColor);\n this.target.x = this.borderWidth;\n this.target.y = this.borderWidth;\n }\n /** Hides a border. */\n hideBorder() {\n this.border.clear();\n }\n}\n\nexports.MaskedFrame = MaskedFrame;\n//# sourceMappingURL=MaskedFrame.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar view = require('./utils/helpers/view.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass ProgressBar extends pixi_js.Container {\n /**\n * Creates a ProgressBar.\n * @param options - Options.\n * @param { Sprite | Graphics | string } options.bg - Background of the ProgressBar.\n * @param { Sprite | Graphics | string } options.fill - Fill of the ProgressBar.\n * @param { FillPaddings } options.fillPaddings - Fill offsets.\n * @param { number } options.fillPaddings.top - Fill top offset.\n * @param { number } options.fillPaddings.right - Fill right offset.\n * @param { number } options.fillPaddings.bottom - Fill bottom offset.\n * @param { number } options.fillPaddings.left - Fill left offset.\n * @param { NineSliceSprite } options.nineSliceSprite - NineSliceSprite values for bg and fill.\n * @param { Array } options.nineSliceSprite.bg - NineSliceSprite config for bg ([number, number, number, number]).\n * @param { Array } options.nineSliceSprite.fill - NineSliceSprite config fill ([number, number, number, number]).\n * @param { number } options.progress - Initial progress value.\n */\n constructor(options) {\n super();\n __publicField(this, \"bg\");\n __publicField(this, \"fill\");\n __publicField(this, \"fillMask\");\n __publicField(this, \"progressStart\", 0);\n __publicField(this, \"_progress\", 0);\n __publicField(this, \"options\");\n /** Container, that holds all inner views. */\n __publicField(this, \"innerView\");\n /** Container, given as a constructor parameter that is a button view. */\n __publicField(this, \"_view\");\n this.options = options;\n this.innerView = new pixi_js.Container();\n this.addChild(this.innerView);\n if (options?.bg && options?.fill) {\n this.init(options);\n }\n }\n /**\n * Initialize ProgressBar.\n * @param root0\n * @param root0.bg - Background texture.\n * @param root0.fill - Fill texture.\n * @param root0.fillPaddings - Fill offset.\n * @param root0.progress - Initial progress value.\n */\n init({ bg, fill, fillPaddings, progress }) {\n this.setBackground(bg);\n this.setFill(fill, fillPaddings);\n this.progress = progress;\n }\n /**\n * Set bg.\n * @param bg\n */\n setBackground(bg) {\n if (this.bg) {\n this.bg.destroy();\n }\n if (this.options?.nineSliceSprite) {\n if (typeof bg === \"string\") {\n this.bg = new pixi_js.NineSliceSprite({\n texture: pixi_js.Texture.from(bg),\n leftWidth: this.options.nineSliceSprite.bg[0],\n topHeight: this.options.nineSliceSprite.bg[1],\n rightWidth: this.options.nineSliceSprite.bg[2],\n bottomHeight: this.options.nineSliceSprite.bg[3]\n });\n } else {\n console.warn(\"NineSliceSprite can not be used with views set as Container.\");\n }\n }\n if (bg instanceof pixi_js.Graphics) {\n this.bg = bg;\n }\n if (!this.bg && (typeof bg === \"string\" || bg instanceof pixi_js.Sprite)) {\n this.bg = view.getSpriteView(bg);\n }\n this.innerView.addChildAt(this.bg, 0);\n }\n /**\n * Set fill.\n * @param fill\n * @param fillPadding\n */\n setFill(fill, fillPadding) {\n if (this.fill) {\n this.fill.destroy();\n }\n if (this.bg instanceof pixi_js.Sprite && fill === this.bg) {\n console.warn(\"Can not use same Sprite instance for bg and fill.\");\n return;\n }\n if (this.options?.nineSliceSprite) {\n if (typeof fill === \"string\") {\n this.fill = new pixi_js.NineSliceSprite({\n texture: pixi_js.Texture.from(fill),\n leftWidth: this.options.nineSliceSprite.fill[0],\n topHeight: this.options.nineSliceSprite.fill[1],\n rightWidth: this.options.nineSliceSprite.fill[2],\n bottomHeight: this.options.nineSliceSprite.fill[3]\n });\n } else {\n console.warn(\"NineSliceSprite can not be used with views set as Container.\");\n }\n }\n if (!this.fill) {\n if (fill instanceof pixi_js.Graphics) {\n this.fill = fill;\n } else {\n this.fill = view.getSpriteView(fill);\n }\n }\n this.innerView.addChildAt(this.fill, 1);\n const offsetX = fillPadding?.left ?? 0;\n const offsetY = fillPadding?.top ?? 0;\n this.fill.x = offsetX;\n this.fill.y = offsetY;\n if (this.fillMask) {\n this.fill.mask = null;\n this.fillMask.destroy();\n }\n const leftWidth = this.fill.width / 2;\n const rightWidth = this.fill.width / 2;\n const topHeight = this.fill.height / 2;\n const bottomHeight = this.fill.height / 2;\n let texture = pixi_js.Texture.WHITE;\n if (this.fill instanceof pixi_js.Sprite && this.fill.texture) {\n texture = this.fill.texture;\n }\n this.fillMask = new pixi_js.NineSliceSprite({ texture, leftWidth, topHeight, rightWidth, bottomHeight });\n this.fillMask.position.copyFrom(this.fill);\n this.addChild(this.fillMask);\n this.fill.mask = this.fillMask;\n }\n validate(progress) {\n progress = Math.round(progress);\n if (progress < 0) {\n return 0;\n }\n if (progress > 100) {\n return 100;\n }\n return progress;\n }\n /** Set current progress percentage value. */\n set progress(progress) {\n this._progress = this.validate(progress);\n if (!this.fill)\n return;\n if (this.fillMask) {\n this.fill.mask = null;\n this.fillMask.width = this.fill.width / 100 * (this._progress - this.progressStart);\n this.fillMask.x = this.progressStart / 100 * this.fill.width + this.fill.x;\n this.fillMask.height = this.fill.height;\n this.fill.mask = this.fillMask;\n }\n }\n /** Return current progress percentage value. */\n get progress() {\n return this._progress;\n }\n /**\n * Sets width of a ProgressBars background and fill.\n * If nineSliceSprite is set, then width will be set to nineSliceSprite.\n * If nineSliceSprite is not set, then width will control components width as Container.\n * @param width - Width value.\n */\n set width(width) {\n if (this.options?.nineSliceSprite) {\n if (this.bg) {\n this.bg.width = width;\n }\n if (this.fill) {\n const leftPadding = this.options.fillPaddings?.left ?? 0;\n const rightPadding = this.options.fillPaddings?.right ?? 0;\n this.fill.width = width - leftPadding - rightPadding;\n this.fillMask.width = width - leftPadding - rightPadding;\n }\n this.progress = this._progress;\n } else {\n super.width = width;\n }\n }\n /** Gets width of a ProgressBar. */\n get width() {\n return super.width;\n }\n /**\n * Sets height of a ProgressBars background and fill.\n * If nineSliceSprite is set, then height will be set to nineSliceSprite.\n * If nineSliceSprite is not set, then height will control components height as Container.\n * @param height - Height value.\n */\n set height(height) {\n if (this.options?.nineSliceSprite) {\n if (this.bg) {\n this.bg.height = height;\n }\n if (this.fill) {\n const topPadding = this.options.fillPaddings?.top ?? 0;\n const bottomPadding = this.options.fillPaddings?.bottom ?? 0;\n this.fill.height = height - topPadding - bottomPadding;\n this.fillMask.height = height - topPadding - bottomPadding;\n }\n this.progress = this._progress;\n } else {\n super.height = height;\n }\n }\n /** Gets height of a ProgressBar. */\n get height() {\n return super.height;\n }\n setSize(value, height) {\n if (this.options?.nineSliceSprite) {\n if (this.bg) {\n this.bg.setSize(value, height);\n }\n if (this.fill) {\n if (typeof value === \"object\") {\n height = value.height ?? value.width;\n value = value.width;\n } else {\n height = height ?? value;\n }\n const topPadding = this.options.fillPaddings?.top ?? 0;\n const bottomPadding = this.options.fillPaddings?.bottom ?? 0;\n const leftPadding = this.options.fillPaddings?.left ?? 0;\n const rightPadding = this.options.fillPaddings?.right ?? 0;\n this.fill.setSize(value - leftPadding - rightPadding, height - topPadding - bottomPadding);\n this.fillMask.setSize(value - leftPadding - rightPadding, height - topPadding - bottomPadding);\n }\n this.progress = this._progress;\n } else {\n super.setSize(value, height);\n }\n }\n}\n\nexports.ProgressBar = ProgressBar;\n//# sourceMappingURL=ProgressBar.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar typedSignals = require('typed-signals');\nvar List = require('./List.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass RadioGroup extends pixi_js.Container {\n constructor(options) {\n super();\n __publicField(this, \"items\", []);\n /** {@link List}, that holds and control all inned checkboxes. */\n __publicField(this, \"innerView\");\n /** Text value of the selected item. */\n __publicField(this, \"value\");\n /** ID of the selected item. */\n __publicField(this, \"selected\");\n /** Fires, when new item is selected. */\n __publicField(this, \"onChange\");\n __publicField(this, \"options\");\n if (options) {\n this.init(options);\n }\n this.onChange = new typedSignals.Signal();\n }\n /**\n * Initiates a group.\n * @param options\n */\n init(options) {\n this.options = options;\n this.value = options.items[options.selectedItem || 0].labelText?.text;\n this.selected = options.selectedItem ?? 0;\n if (this.innerView) {\n this.innerView.type = options.type;\n this.innerView.elementsMargin = options.elementsMargin;\n } else {\n this.innerView = new List.List({\n type: options.type,\n elementsMargin: options.elementsMargin\n });\n }\n this.addItems(options.items);\n this.addChild(this.innerView);\n this.selectItem(this.selected);\n }\n /**\n * Add items to a group.\n * @param {CheckBox[]} items - array of {@link CheckBox} instances.\n */\n addItems(items) {\n items.forEach((checkBox, id) => {\n checkBox.onChange.connect(() => this.selectItem(id));\n this.items.push(checkBox);\n this.innerView.addChild(checkBox);\n });\n }\n /**\n * Remove items from a group.\n * @param ids\n */\n removeItems(ids) {\n ids.forEach((id) => {\n const item = this.items[id];\n if (!item)\n return;\n item.onChange.disconnectAll();\n this.innerView.removeChild(item);\n this.items.splice(id, 1);\n });\n }\n /**\n * Select item by ID.\n * @param id\n */\n selectItem(id) {\n this.items.forEach((item, key) => {\n item.forceCheck(key === id);\n });\n if (this.selected !== id) {\n this.onChange.emit(id, this.items[id].labelText?.text);\n }\n this.value = this.options.items[id].labelText?.text;\n this.selected = id;\n }\n}\n\nexports.RadioGroup = RadioGroup;\n//# sourceMappingURL=RadioGroup.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar typedSignals = require('typed-signals');\nvar List = require('./List.js');\nvar Trackpad = require('./utils/trackpad/Trackpad.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass ScrollBox extends pixi_js.Container {\n /**\n * @param options\n * @param {number} options.background - background color of the ScrollBox.\n * @param {number} options.width - width of the ScrollBox.\n * @param {number} options.height - height of the ScrollBox.\n * @param {number} options.radius - radius of the ScrollBox and its masks corners.\n * @param {number} options.elementsMargin - margin between elements.\n * @param {number} options.vertPadding - vertical padding of the ScrollBox.\n * @param {number} options.horPadding - horizontal padding of the ScrollBox.\n * @param {number} options.padding - padding of the ScrollBox (same horizontal and vertical).\n * @param {boolean} options.disableDynamicRendering - disables dynamic rendering of the ScrollBox,\n * so even elements the are not visible will be rendered. Be careful with this options as it can impact performance.\n * @param {boolean} [options.globalScroll=true] - if true, the ScrollBox will scroll even if the mouse is not over it.\n * @param {boolean} [options.shiftScroll=false] - if true, the ScrollBox will only scroll horizontally if the shift key\n * is pressed, and the type is set to 'horizontal'.\n */\n constructor(options) {\n super();\n __publicField(this, \"background\");\n __publicField(this, \"borderMask\");\n __publicField(this, \"lastWidth\");\n __publicField(this, \"lastHeight\");\n __publicField(this, \"__width\", 0);\n __publicField(this, \"__height\", 0);\n __publicField(this, \"_dimensionChanged\", false);\n __publicField(this, \"list\");\n __publicField(this, \"_trackpad\");\n __publicField(this, \"isDragging\", 0);\n __publicField(this, \"interactiveStorage\", []);\n __publicField(this, \"visibleItems\", []);\n __publicField(this, \"pressedChild\");\n __publicField(this, \"ticker\", pixi_js.Ticker.shared);\n __publicField(this, \"options\");\n __publicField(this, \"stopRenderHiddenItemsTimeout\");\n __publicField(this, \"onMouseScrollBinding\", this.onMouseScroll.bind(this));\n __publicField(this, \"dragStarTouchPoint\");\n __publicField(this, \"isOver\", false);\n __publicField(this, \"proximityRange\");\n __publicField(this, \"proximityStatusCache\", []);\n __publicField(this, \"lastScrollX\");\n __publicField(this, \"lastScrollY\");\n __publicField(this, \"proximityCheckFrameCounter\", 0);\n __publicField(this, \"onProximityChange\", new typedSignals.Signal());\n __publicField(this, \"onScroll\", new typedSignals.Signal());\n if (options) {\n this.init(options);\n }\n this.ticker.add(this.update, this);\n }\n /**\n * Initiates ScrollBox.\n * @param options\n * @param {number} options.background - background color of the ScrollBox.\n * @param {number} options.width - width of the ScrollBox.\n * @param {number} options.height - height of the ScrollBox.\n * @param {number} options.radius - radius of the ScrollBox and its masks corners.\n * @param {number} options.elementsMargin - margin between elements.\n * @param {number} options.vertPadding - vertical padding of the ScrollBox.\n * @param {number} options.horPadding - horizontal padding of the ScrollBox.\n * @param {number} options.padding - padding of the ScrollBox (same horizontal and vertical).\n * @param {boolean} options.disableDynamicRendering - disables dynamic rendering of the ScrollBox,\n * so even elements the are not visible will be rendered. Be careful with this options as it can impact performance.\n * @param {boolean} [options.globalScroll=true] - if true, the ScrollBox will scroll even if the mouse is not over it.\n * @param {boolean} [options.shiftScroll=false] - if true, the ScrollBox will only scroll horizontally if the shift key\n */\n init(options) {\n this.options = options;\n this.setBackground(options.background);\n this.__width = options.width | this.background.width;\n this.__height = options.height | this.background.height;\n this.proximityRange = options.proximityRange ?? 0;\n if (!this.list) {\n this.list = new List.List();\n super.addChild(this.list);\n }\n this.list.init({\n type: options.type,\n elementsMargin: options.elementsMargin,\n padding: options.padding,\n vertPadding: options.vertPadding,\n horPadding: options.horPadding,\n topPadding: options.topPadding,\n bottomPadding: options.bottomPadding,\n leftPadding: options.leftPadding,\n rightPadding: options.rightPadding\n });\n this.addItems(options.items);\n if (this.hasBounds) {\n this.addMask();\n this.makeScrollable();\n }\n this._trackpad.xAxis.value = 0;\n this._trackpad.yAxis.value = 0;\n this.options.globalScroll = options.globalScroll ?? true;\n this.options.shiftScroll = options.shiftScroll ?? false;\n this.resize();\n }\n get hasBounds() {\n return !!this.__width || !!this.__height;\n }\n /**\n * Adds array of items to a scrollable list.\n * @param {Container[]} items - items to add.\n */\n addItems(items) {\n if (!items?.length)\n return;\n items.forEach((item) => this.addItem(item));\n }\n /** Remove all items from a scrollable list. */\n removeItems() {\n this.proximityStatusCache.length = 0;\n this.list.removeChildren();\n }\n /**\n * Adds one or more items to a scrollable list.\n * @param {Container} items - one or more items to add.\n */\n addItem(...items) {\n if (items.length > 1) {\n items.forEach((item) => this.addItem(item));\n } else {\n const child = items[0];\n if (!child.width || !child.height) {\n console.error(\"ScrollBox item should have size\");\n }\n child.eventMode = \"static\";\n this.list.addChild(child);\n this.proximityStatusCache.push(false);\n if (!this.options.disableDynamicRendering) {\n child.renderable = this.isItemVisible(child);\n }\n }\n this.resize();\n return items[0];\n }\n /**\n * Removes an item from a scrollable list.\n * @param {number} itemID - id of the item to remove.\n */\n removeItem(itemID) {\n this.list.removeItem(itemID);\n this.proximityStatusCache.splice(itemID, 1);\n this.resize();\n }\n /**\n * Checks if the item is visible or scrolled out of the visible part of the view.* Adds an item to a scrollable list.\n * @param {Container} item - item to check.\n * @param padding - proximity padding to consider the item visible.\n */\n isItemVisible(item, padding = 0) {\n const isVertical = this.options.type === \"vertical\" || !this.options.type;\n let isVisible = false;\n const list = this.list;\n if (isVertical) {\n const posY = item.y + list.y;\n if (posY + item.height >= -padding && posY <= this.options.height + padding) {\n isVisible = true;\n }\n } else {\n const posX = item.x + list.x;\n if (posX + item.width >= -padding && posX <= this.options.width + padding) {\n isVisible = true;\n }\n }\n return isVisible;\n }\n /**\n * Returns all inner items in a list.\n * @returns {Array | Array} - list of items.\n */\n get items() {\n return this.list?.children ?? [];\n }\n /**\n * Set ScrollBox background.\n * @param {number | string} background - background color or texture.\n */\n setBackground(background) {\n if (this.background) {\n this.removeChild(this.background);\n }\n this.options.background = background;\n this.background = new pixi_js.Graphics();\n this.addChildAt(this.background, 0);\n this.resize();\n }\n addMask() {\n if (!this.borderMask) {\n this.borderMask = new pixi_js.Graphics();\n super.addChild(this.borderMask);\n this.mask = this.borderMask;\n }\n this.resize();\n }\n makeScrollable() {\n if (!this._trackpad) {\n this._trackpad = new Trackpad.Trackpad({\n disableEasing: this.options.disableEasing\n });\n }\n this.on(\"pointerdown\", (e) => {\n this.renderAllItems();\n this.isDragging = 1;\n this.dragStarTouchPoint = this.worldTransform.applyInverse(e.global);\n this._trackpad.pointerDown(this.dragStarTouchPoint);\n const listTouchPoint = this.list.worldTransform.applyInverse(e.global);\n this.visibleItems.forEach((item) => {\n if (item.x < listTouchPoint.x && item.x + item.width > listTouchPoint.x && item.y < listTouchPoint.y && item.y + item.height > listTouchPoint.y) {\n this.pressedChild = item;\n }\n });\n });\n this.on(\"pointerup\", () => {\n this.isDragging = 0;\n this._trackpad.pointerUp();\n this.restoreItemsInteractivity();\n this.pressedChild = null;\n this.stopRenderHiddenItems();\n });\n this.on(\"pointerover\", () => {\n this.isOver = true;\n });\n this.on(\"pointerout\", () => {\n this.isOver = false;\n });\n this.on(\"pointerupoutside\", () => {\n this.isDragging = 0;\n this._trackpad.pointerUp();\n this.restoreItemsInteractivity();\n this.pressedChild = null;\n this.stopRenderHiddenItems();\n });\n this.on(\"globalpointermove\", (e) => {\n if (!this.isDragging)\n return;\n const isVertical = this.options.type !== \"horizontal\";\n const touchPoint = this.worldTransform.applyInverse(e.global);\n if (this.dragStarTouchPoint) {\n const dragTrashHold = this.options.dragTrashHold ?? 10;\n if (this.options.type === \"horizontal\") {\n const xDist = touchPoint.x - this.dragStarTouchPoint.x;\n if (Math.abs(xDist) > dragTrashHold) {\n this.isDragging = 2;\n }\n } else {\n const yDist = touchPoint.y - this.dragStarTouchPoint.y;\n if (Math.abs(yDist) > dragTrashHold) {\n this.isDragging = 2;\n }\n }\n }\n if (this.dragStarTouchPoint && this.isDragging !== 2)\n return;\n this._trackpad.pointerMove(touchPoint);\n if (this.pressedChild) {\n this.revertClick(this.pressedChild);\n this.pressedChild = null;\n }\n this.onScroll?.emit(isVertical ? this.scrollY : this.scrollX);\n });\n document.addEventListener(\"wheel\", this.onMouseScrollBinding, true);\n }\n setInteractive(interactive) {\n this.eventMode = interactive ? \"static\" : \"auto\";\n }\n get listHeight() {\n return this.list.height + this.list.topPadding + this.list.bottomPadding;\n }\n get listWidth() {\n return this.list.width + this.list.leftPadding + this.list.rightPadding;\n }\n /**\n * Controls item positions and visibility.\n * @param force\n */\n resize(force = false) {\n if (!this.hasBounds)\n return;\n this.renderAllItems();\n if (this.borderMask && (force || this._dimensionChanged || this.lastWidth !== this.listWidth || this.lastHeight !== this.listHeight)) {\n if (!this.options.width) {\n this.__width += this.listWidth;\n }\n if (!this.options.height) {\n this.__height += this.listHeight;\n }\n this.borderMask.clear().roundRect(\n 0,\n 0,\n this.__width,\n this.__height,\n this.options.radius | 0\n ).fill(16711935).stroke(0);\n this.borderMask.eventMode = \"none\";\n const color = this.options.background;\n this.background.clear().roundRect(\n 0,\n 0,\n this.__width,\n this.__height,\n this.options.radius | 0\n ).fill({\n color: color ?? 0,\n alpha: color ? 1 : 1e-7\n // if color is not set, set alpha to 0 to be able to drag by click on bg\n });\n if (this.options.type === \"horizontal\") {\n this.setInteractive(this.listWidth > this.__width);\n } else {\n this.setInteractive(this.listHeight > this.__height);\n }\n this.lastWidth = this.listWidth;\n this.lastHeight = this.listHeight;\n }\n if (this._trackpad) {\n const maxWidth = this.borderMask.width - this.list.width - this.list.leftPadding - this.list.rightPadding;\n const maxHeight = this.borderMask.height - this.list.height - this.list.topPadding - this.list.bottomPadding;\n if (this.options.type === \"vertical\") {\n this._trackpad.yAxis.max = -Math.abs(maxHeight);\n } else if (this.options.type === \"horizontal\") {\n this._trackpad.xAxis.max = -Math.abs(maxWidth);\n } else {\n this._trackpad.yAxis.max = -Math.abs(maxHeight);\n this._trackpad.xAxis.max = -Math.abs(maxWidth);\n }\n }\n if (this._dimensionChanged) {\n this.list.arrangeChildren();\n this.stopRenderHiddenItems();\n this._dimensionChanged = false;\n } else\n this.updateVisibleItems();\n this.lastScrollX = null;\n this.lastScrollY = null;\n }\n onMouseScroll(event) {\n if (!this.isOver && !this.options.globalScroll)\n return;\n this.renderAllItems();\n const scrollOnX = this.options.shiftScroll ? typeof event.deltaX !== \"undefined\" || typeof event.deltaY !== \"undefined\" : typeof event.deltaX !== \"undefined\";\n if (this.options.type === \"horizontal\" && scrollOnX) {\n const delta = this.options.shiftScroll ? event.deltaX : event.deltaY;\n const targetPos = this.list.x - delta;\n if (this.listWidth < this.__width) {\n this._trackpad.xAxis.value = 0;\n } else {\n const min = this.__width - this.listWidth;\n const max = 0;\n this._trackpad.xAxis.value = Math.min(max, Math.max(min, targetPos));\n }\n this.onScroll?.emit(this._trackpad.xAxis.value);\n } else if (typeof event.deltaY !== \"undefined\") {\n const targetPos = this.list.y - event.deltaY;\n if (this.listHeight < this.__height) {\n this._trackpad.yAxis.value = 0;\n } else {\n const min = this.__height - this.listHeight;\n const max = 0;\n this._trackpad.yAxis.value = Math.min(max, Math.max(min, targetPos));\n }\n this.onScroll?.emit(this._trackpad.yAxis.value);\n }\n this.stopRenderHiddenItems();\n }\n /** Makes it scroll down to the last element. */\n scrollBottom() {\n if (!this.interactive) {\n this.scrollTop();\n } else {\n this.scrollTo(this.list.children.length - 1);\n }\n }\n /** Makes it scroll up to the first element. */\n scrollTop() {\n this.renderAllItems();\n this._trackpad.xAxis.value = 0;\n this._trackpad.yAxis.value = 0;\n this.stopRenderHiddenItems();\n }\n renderAllItems() {\n clearTimeout(this.stopRenderHiddenItemsTimeout);\n this.stopRenderHiddenItemsTimeout = null;\n if (this.options.disableDynamicRendering) {\n return;\n }\n this.items.forEach((child) => {\n child.renderable = true;\n });\n }\n stopRenderHiddenItems() {\n if (this.options.disableDynamicRendering) {\n return;\n }\n if (this.stopRenderHiddenItemsTimeout) {\n clearTimeout(this.stopRenderHiddenItemsTimeout);\n this.stopRenderHiddenItemsTimeout = null;\n }\n this.stopRenderHiddenItemsTimeout = setTimeout(() => this.updateVisibleItems(), 2e3);\n }\n updateVisibleItems() {\n this.visibleItems.length = 0;\n this.items.forEach((child) => {\n child.renderable = this.isItemVisible(child);\n this.visibleItems.push(child);\n });\n }\n /**\n * Scrolls to the element with the given ID.\n * @param elementID\n */\n scrollTo(elementID) {\n if (!this.interactive) {\n return;\n }\n const target = this.list.children[elementID];\n if (!target) {\n return;\n }\n this.renderAllItems();\n this._trackpad.xAxis.value = this.options.type === \"horizontal\" ? this.__width - target.x - target.width - this.list.rightPadding : 0;\n this._trackpad.yAxis.value = !this.options.type || this.options.type === \"vertical\" ? this.__height - target.y - target.height - this.list.bottomPadding : 0;\n this.stopRenderHiddenItems();\n }\n /**\n * Scrolls to the given position.\n * @param position - x and y position object.\n * @param position.x - x position.\n * @param position.y - y position.\n */\n scrollToPosition({ x, y }) {\n if (x === void 0 && y === void 0)\n return;\n this.renderAllItems();\n if (x !== void 0)\n this.scrollX = -x;\n if (y !== void 0)\n this.scrollY = -y;\n this.stopRenderHiddenItems();\n }\n /** Gets component height. */\n get height() {\n return this.__height;\n }\n set height(value) {\n this.__height = value;\n this._dimensionChanged = true;\n this.resize();\n this.scrollTop();\n }\n /** Gets component width. */\n get width() {\n return this.__width;\n }\n set width(value) {\n this.__width = value;\n this._dimensionChanged = true;\n this.resize();\n this.scrollTop();\n }\n setSize(value, height) {\n if (typeof value === \"object\") {\n height = value.height ?? value.width;\n value = value.width;\n } else {\n height = height ?? value;\n }\n this.__width = value;\n this.__height = height;\n this._dimensionChanged = true;\n this.resize();\n this.scrollTop();\n }\n getSize(out) {\n out = out || { width: 0, height: 0 };\n out.width = this.__width;\n out.height = this.__height;\n return out;\n }\n /** Gets the current raw scroll position on the x-axis (Negated Value). */\n get scrollX() {\n return this._trackpad.xAxis.value;\n }\n /** Sets the current raw scroll position on the x-axis (Negated Value). */\n set scrollX(value) {\n this._trackpad.xAxis.value = value;\n }\n /** Gets the current raw scroll position on the y-axis (Negated Value). */\n get scrollY() {\n return this._trackpad.yAxis.value;\n }\n /** Sets the current raw scroll position on the y-axis (Negated Value). */\n set scrollY(value) {\n this._trackpad.yAxis.value = value;\n }\n update() {\n if (!this.list)\n return;\n this._trackpad.update();\n const type = this.options.type === \"horizontal\" ? \"x\" : \"y\";\n if (this.list[type] !== this._trackpad[type]) {\n this.list[type] = this._trackpad[type];\n }\n if (!this.options.disableProximityCheck && (this._trackpad.x !== this.lastScrollX || this._trackpad.y !== this.lastScrollY)) {\n this.proximityCheckFrameCounter++;\n if (this.proximityCheckFrameCounter >= (this.options.proximityDebounce ?? 10)) {\n this.items.forEach((item, index) => {\n const inRange = this.isItemVisible(item, this.proximityRange);\n const wasInRange = this.proximityStatusCache[index];\n if (inRange !== wasInRange) {\n this.proximityStatusCache[index] = inRange;\n this.onProximityChange.emit({ item, index, inRange });\n }\n });\n this.lastScrollX = this._trackpad.x;\n this.lastScrollY = this._trackpad.y;\n this.proximityCheckFrameCounter = 0;\n }\n }\n }\n /**\n * Destroys the component.\n * @param {boolean | DestroyOptions} [options] - Options parameter.\n * A boolean will act as if all options have been set to that value\n */\n destroy(options) {\n this.ticker.remove(this.update, this);\n document.removeEventListener(\"wheel\", this.onMouseScrollBinding, true);\n this.background.destroy();\n this.list.destroy();\n super.destroy(options);\n }\n restoreItemsInteractivity() {\n this.interactiveStorage.forEach((element) => {\n element.item.eventMode = element.eventMode;\n });\n this.interactiveStorage.length = 0;\n }\n revertClick(item) {\n if (item.eventMode !== \"auto\") {\n pixi_js.isMobile.any ? item.emit(\"pointerupoutside\", null) : item.emit(\"mouseupoutside\", null);\n this.interactiveStorage.push({\n item,\n eventMode: item.eventMode\n });\n item.eventMode = \"auto\";\n }\n if (item instanceof pixi_js.Container && item.children) {\n item.children.forEach((child) => this.revertClick(child));\n }\n }\n get scrollHeight() {\n return this.list.height;\n }\n get scrollWidth() {\n return this.list.width;\n }\n}\n\nexports.ScrollBox = ScrollBox;\n//# sourceMappingURL=ScrollBox.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar typedSignals = require('typed-signals');\nvar FancyButton = require('./FancyButton.js');\nvar ScrollBox = require('./ScrollBox.js');\nvar view = require('./utils/helpers/view.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nconst defaultVisibleItems = 5;\nclass Select extends pixi_js.Container {\n constructor(options) {\n super();\n __publicField(this, \"view\", new pixi_js.Container());\n __publicField(this, \"openButton\");\n __publicField(this, \"closeButton\");\n __publicField(this, \"openView\");\n __publicField(this, \"scrollBox\");\n /** Selected value ID. */\n __publicField(this, \"value\");\n /** Fires when selected value is changed. */\n __publicField(this, \"onSelect\");\n this.addChild(this.view);\n this.onSelect = new typedSignals.Signal();\n if (options) {\n this.init(options);\n }\n }\n /**\n * Initiates Select.\n * @param root0\n * @param root0.closedBG\n * @param root0.textStyle\n * @param root0.items\n * @param root0.openBG\n * @param root0.selected\n * @param root0.selectedTextOffset\n * @param root0.scrollBox\n * @param root0.visibleItems\n * @param root0.TextClass\n */\n init({\n closedBG,\n textStyle,\n TextClass,\n items,\n openBG,\n selected,\n selectedTextOffset,\n scrollBox,\n visibleItems\n }) {\n TextClass = TextClass ?? pixi_js.Text;\n if (this.openView && this.openView !== openBG) {\n this.view.removeChild(this.openView);\n }\n if (!this.openButton) {\n this.openButton = new FancyButton.FancyButton({\n defaultView: view.getView(closedBG),\n text: new TextClass({ text: items?.items ? items.items[0] : \"\", style: textStyle }),\n textOffset: selectedTextOffset\n });\n this.openButton.onPress.connect(() => this.toggle());\n this.addChild(this.openButton);\n } else {\n this.openButton.defaultView = view.getView(closedBG);\n this.openButton.textView = new TextClass({ text: items?.items ? items.items[0] : \"\", style: textStyle });\n this.openButton.textOffset = selectedTextOffset;\n }\n if (this.openView !== openBG) {\n this.openView = view.getView(openBG);\n this.view.visible = false;\n this.view.addChild(this.openView);\n }\n if (!this.closeButton) {\n this.closeButton = new FancyButton.FancyButton({\n defaultView: new pixi_js.Graphics().rect(0, 0, this.openButton.width, this.openButton.height).fill({ color: 0, alpha: 1e-5 }),\n text: new TextClass({ text: items?.items ? items.items[0] : \"\", style: textStyle }),\n textOffset: selectedTextOffset\n });\n this.closeButton.onPress.connect(() => this.toggle());\n this.view.addChild(this.closeButton);\n } else {\n this.closeButton.defaultView = new pixi_js.Graphics().rect(0, 0, this.openButton.width, this.openButton.height).fill({ color: 0, alpha: 1e-5 });\n this.closeButton.textView = new TextClass({ text: items?.items ? items.items[0] : \"\", style: textStyle });\n this.openButton.textOffset = selectedTextOffset;\n }\n if (!this.scrollBox) {\n this.scrollBox = new ScrollBox.ScrollBox();\n this.view.addChild(this.scrollBox);\n } else {\n this.scrollBox.removeItems();\n }\n this.scrollBox.init({\n type: \"vertical\",\n elementsMargin: 0,\n width: this.openButton.width,\n height: this.openButton.height * (visibleItems ?? defaultVisibleItems),\n radius: 0,\n padding: 0,\n ...scrollBox\n });\n this.scrollBox.y = this.openButton.height;\n if (scrollBox?.offset) {\n this.scrollBox.x = scrollBox.offset.x ?? 0;\n this.scrollBox.y += scrollBox.offset.y ?? 0;\n }\n this.addItems(items, selected);\n }\n /**\n * Adds items to the dropdown.\n * @param items\n * @param selected\n */\n addItems(items, selected = 0) {\n this.convertItemsToButtons(items).forEach((button, id) => {\n const text = button.text;\n if (id === selected) {\n this.openButton.text = text;\n this.closeButton.text = text;\n }\n button.onPress.connect(() => {\n this.value = id;\n this.onSelect.emit(id, text);\n this.openButton.text = text;\n this.closeButton.text = text;\n this.close();\n });\n this.scrollBox.addItem(button);\n });\n }\n /**\n * Remove items from the dropdown.\n * @param itemID - Item to remove (starting from 0).\n */\n removeItem(itemID) {\n this.scrollBox.removeItem(itemID);\n }\n /** Toggle the select state (open if closed, closes - id open). */\n toggle() {\n this.view.visible = !this.view.visible;\n this.openButton.visible = !this.openButton.visible;\n }\n /** Show dropdown. */\n open() {\n this.view.visible = true;\n this.openButton.visible = false;\n }\n /** Hide dropdown. */\n close() {\n this.view.visible = false;\n this.openButton.visible = true;\n }\n convertItemsToButtons({\n items,\n backgroundColor,\n hoverColor,\n width,\n height,\n textStyle,\n TextClass,\n radius\n }) {\n TextClass = TextClass ?? pixi_js.Text;\n const buttons = [];\n items.forEach((item) => {\n const defaultView = new pixi_js.Graphics().roundRect(0, 0, width, height, radius).fill(backgroundColor);\n const color = hoverColor ?? backgroundColor;\n const hoverView = new pixi_js.Graphics().roundRect(0, 0, width, height, radius).fill(color);\n const text = new TextClass({ text: item, style: textStyle });\n const button = new FancyButton.FancyButton({ defaultView, hoverView, text });\n buttons.push(button);\n });\n return buttons;\n }\n}\n\nexports.Select = Select;\n//# sourceMappingURL=Select.js.map\n","'use strict';\n\nvar typedSignals = require('typed-signals');\nvar SliderBase = require('./SliderBase.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass Slider extends SliderBase.SliderBase {\n constructor(options) {\n super({\n slider1: options.slider,\n value1: options.value,\n ...options\n });\n __publicField(this, \"sliderOptions\");\n /** Fires when value is changing, on every move of slider. */\n __publicField(this, \"onUpdate\", new typedSignals.Signal());\n /** Fires when value changed, only when slider is released. */\n __publicField(this, \"onChange\", new typedSignals.Signal());\n this.sliderOptions = options;\n this.step = options.step || 1;\n this.value = options.value ?? this.min;\n this.updateSlider();\n }\n /** Return selected value. */\n get value() {\n return this._value1;\n }\n /** Set selected value. */\n set value(value) {\n if (value === this._value1)\n return;\n if (value < this.min)\n value = this.min;\n if (value > this.max)\n value = this.max;\n this._value1 = value;\n this.updateSlider();\n this.onUpdate?.emit(this.value);\n }\n set max(value) {\n super.max = value;\n this.updateSlider();\n }\n get max() {\n return super.max;\n }\n set min(value) {\n super.min = value;\n this.updateSlider();\n }\n get min() {\n return super.min;\n }\n set step(value) {\n super.step = value;\n this.updateSlider();\n }\n get step() {\n return super.step;\n }\n /** Set slider instance ot texture. */\n // eslint-disable-next-line accessor-pairs\n set slider(value) {\n this.slider1 = value;\n this.updateSlider();\n }\n update(event) {\n super.update(event);\n if (!this.dragging)\n return;\n const obj = event.currentTarget;\n const { x } = obj.parent.worldTransform.applyInverse(event.global);\n const positionRatio = x / (this.bg?.width || 1);\n const rawValue = this.min + positionRatio * (this.max - this.min);\n this.value = Math.round(rawValue / this.step) * this.step;\n }\n change() {\n this.onChange?.emit(this.value);\n }\n updateSlider() {\n this.progress = ((this.value ?? this.min) - this.min) / (this.max - this.min) * 100;\n this._slider1.x = this.bg?.width / 100 * this.progress - this._slider1.width / 2;\n this._slider1.y = this.bg?.height / 2;\n if (this.sliderOptions?.showValue) {\n this.value1Text.text = `${Math.round(this.value)}`;\n const sliderPosX = this._slider1.x + this._slider1.width / 2;\n const sliderPosY = this._slider1.y;\n this.value1Text.x = sliderPosX + (this.sliderOptions.valueTextOffset?.x ?? 0);\n this.value1Text.y = sliderPosY + (this.sliderOptions.valueTextOffset?.y ?? 0);\n }\n }\n /**\n * Sets width of a Sliders background and fill.\n * If nineSliceSprite is set, then width will be set to nineSliceSprite.\n * If nineSliceSprite is not set, then width will control components width as Container.\n * @param value - Width value.\n */\n set width(value) {\n super.width = value;\n this.updateSlider();\n }\n /** Gets width of a Slider. */\n get width() {\n return super.width;\n }\n /**\n * Sets height of a Sliders background and fill.\n * If nineSliceSprite is set, then height will be set to nineSliceSprite.\n * If nineSliceSprite is not set, then height will control components height as Container.\n * @param value - Height value.\n */\n set height(value) {\n super.height = value;\n this.updateSlider();\n }\n /** Gets height of a Slider. */\n get height() {\n return super.height;\n }\n setSize(value, height) {\n super.setSize(value, height);\n this.updateSlider();\n }\n}\n\nexports.Slider = Slider;\n//# sourceMappingURL=Slider.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar ProgressBar = require('./ProgressBar.js');\nvar view = require('./utils/helpers/view.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass SliderBase extends ProgressBar.ProgressBar {\n constructor(options) {\n super(options);\n __publicField(this, \"_slider1\");\n __publicField(this, \"_slider2\");\n __publicField(this, \"value1Text\");\n __publicField(this, \"value2Text\");\n __publicField(this, \"_value1\");\n __publicField(this, \"_value2\");\n __publicField(this, \"dragging\", 0);\n /** Minimal value. */\n __publicField(this, \"_min\", 0);\n /** Maximal value. */\n __publicField(this, \"_max\", 100);\n /** Progress value step */\n __publicField(this, \"_step\", 1);\n __publicField(this, \"startX\");\n __publicField(this, \"startUpdateValue1\");\n __publicField(this, \"startUpdateValue2\");\n __publicField(this, \"settings\");\n this.settings = options;\n this.slider1 = options.slider1;\n this.slider2 = options.slider2;\n this.min = options.min ?? 0;\n this.max = options.max ?? 100;\n }\n init(progressBarOptions) {\n super.init(progressBarOptions);\n if (this.fill) {\n this.fill.eventMode = \"none\";\n }\n }\n /**\n * Sets Slider1 instance.\n * @param value - Container or string with texture name.\n */\n set slider1(value) {\n if (!value)\n return;\n if (this._slider1) {\n this.slider1.removeAllListeners();\n this.slider1.destroy();\n }\n this._slider1 = this.createSlider(value);\n if (this.settings.showValue && !this.value1Text) {\n const TextClass = this.settings.valueTextClass ?? pixi_js.Text;\n this.value1Text = new TextClass({ text: \"\", style: this.settings.valueTextStyle || { fill: 16777215 } });\n this.value1Text.anchor.set(0.5);\n this.addChild(this.value1Text);\n }\n }\n /** Get Slider1 instance. */\n get slider1() {\n return this._slider1;\n }\n /**\n * Sets Slider2 instance.\n * @param value - Container or string with texture name.\n */\n set slider2(value) {\n if (!value)\n return;\n if (this._slider2) {\n this.slider2.removeAllListeners();\n this.slider2.destroy();\n }\n this._slider2 = this.createSlider(value);\n if (this.settings.showValue && !this.value2Text) {\n const TextClass = this.settings.valueTextClass ?? pixi_js.Text;\n this.value2Text = new TextClass({ text: \"\", style: this.settings.valueTextStyle || { fill: 16777215 } });\n this.value2Text.anchor.set(0.5);\n this.addChild(this.value2Text);\n }\n }\n /** Get Slider2 instance. */\n get slider2() {\n return this._slider2;\n }\n /**\n * Set bg.\n * @param bg\n */\n setBackground(bg) {\n if (this.bg) {\n this.bg.removeAllListeners();\n }\n super.setBackground(bg);\n this.activateBG();\n }\n activateBG() {\n this.bg.eventMode = \"static\";\n this.bg.on(\"pointerdown\", this.startUpdate, this).on(\"globalpointermove\", this.update, this).on(\"pointerup\", this.endUpdate, this).on(\"pointerupoutside\", this.endUpdate, this);\n }\n createSlider(sliderData) {\n const slider = view.getView(sliderData);\n const onPointerDown = (event) => {\n if (this.bg) {\n event.currentTarget = this.bg;\n }\n this.startUpdate(event);\n };\n slider.eventMode = \"static\";\n slider.on(\"pointerdown\", onPointerDown).on(\"pointerup\", this.endUpdate, this).on(\"pointerupoutside\", this.endUpdate, this);\n slider.x = slider.width / 2;\n const container = new pixi_js.Container();\n container.addChild(slider);\n if (slider instanceof pixi_js.Sprite) {\n slider.anchor.set(0.5);\n }\n container.y = this.bg?.height / 2;\n this.addChild(container);\n return container;\n }\n startUpdate(event) {\n this.dragging = 1;\n const obj = event.currentTarget;\n this.startX = obj.parent.worldTransform.applyInverse(event.global).x;\n this.startUpdateValue1 = this._value1;\n this.startUpdateValue2 = this._value2;\n this.update(event);\n }\n endUpdate() {\n if (!this.dragging)\n return;\n this.dragging = 0;\n if (!!this.startX || (this.startUpdateValue1 !== this._value1 || this.startUpdateValue2 !== this._value2)) {\n this.change();\n }\n this.startUpdateValue1 = null;\n this.startUpdateValue2 = null;\n }\n onClick() {\n this.change();\n }\n /* Called when dragging started and on every move. */\n update(_event) {\n const obj = _event.currentTarget;\n const { x } = obj.parent.worldTransform.applyInverse(_event.global);\n if (x !== this.startX) {\n this.startX = null;\n }\n }\n /** Called when dragging stopped. */\n change() {\n }\n /**\n * Set max value.\n * @param value\n */\n set max(value) {\n this._max = value;\n }\n /** Get max value. */\n get max() {\n return this._max;\n }\n /**\n * Set min value.\n * @param value\n */\n set min(value) {\n this._min = value;\n }\n /** Get min value. */\n get min() {\n return this._min;\n }\n /**\n * Set step value.\n * @param value\n */\n set step(value) {\n this._step = value;\n }\n /** Get step value. */\n get step() {\n return this._step;\n }\n}\n\nexports.SliderBase = SliderBase;\n//# sourceMappingURL=SliderBase.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar typedSignals = require('typed-signals');\nvar view = require('./utils/helpers/view.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass Switcher extends pixi_js.Container {\n /**\n * @param {Array} views - Array of views or textures that will be switching.\n * @param triggerEvents - Button events, to switch views (can be one event or an array of events).\n * @param activeViewID - The id of the view, visible by default.\n */\n constructor(views, triggerEvents, activeViewID) {\n super();\n __publicField(this, \"_triggerEvents\", /* @__PURE__ */ new Set([\"onPress\"]));\n /** Container that holds all the content of the component. */\n __publicField(this, \"innerView\");\n /** The id of the visible(active) view. */\n __publicField(this, \"_active\");\n /** Fired when active view changes. */\n __publicField(this, \"onChange\");\n this.innerView = new pixi_js.Container();\n this.addChild(this.innerView);\n this.onChange = new typedSignals.Signal();\n if (views)\n this.views = views;\n if (triggerEvents)\n this.triggerEvents = triggerEvents;\n if (activeViewID && this.views.length > 0)\n this.active = activeViewID;\n this.setInteractionEvents();\n }\n setInteractionEvents() {\n this.innerView.eventMode = \"static\";\n this.innerView.on(\"pointerdown\", () => this.handleEvents(\"onDown\"));\n this.innerView.on(\"pointerup\", () => this.handleEvents(\"onUp\"));\n this.innerView.on(\"pointerupoutside\", () => this.handleEvents(\"onUpOut\"));\n this.innerView.on(\"pointerout\", () => this.handleEvents(\"onOut\"));\n this.innerView.on(\"pointertap\", () => this.handleEvents(\"onPress\"));\n this.innerView.on(\"pointerover\", () => this.handleEvents(\"onHover\"));\n }\n handleEvents(event) {\n if (this._triggerEvents.has(event)) {\n this.switch();\n }\n }\n /** Returns the active view. */\n get activeView() {\n if (this.views && this.views[this.active]) {\n return this.views[this.active];\n }\n return void 0;\n }\n /** Sets the list of instances for switching. */\n set views(views) {\n this.innerView.removeChildren();\n views.forEach((stateView) => this.add(stateView));\n }\n /** Returns all the switchable views */\n get views() {\n return this.innerView.children;\n }\n /**\n * Adds view instance to a switching list.\n * @param view\n */\n add(view$1) {\n const viewInstance = view.getView(view$1);\n this.innerView.addChild(viewInstance);\n viewInstance.visible = false;\n if (this.views.length === 1) {\n this.active = 0;\n }\n }\n /**\n * Removes view instance from a switching list by id.\n * @param id - id of the view to remove.\n */\n remove(id) {\n if (this.views[id]) {\n this.innerView.removeChild(this.views[id]);\n }\n }\n /**\n * Sets a list of events that will make a switcher switch to the next view.\n * @param {ButtonEvent | ButtonEvent[]} triggerEvents - Button events,\n * to switch views (can be one event or an array of events).\n */\n set triggerEvents(triggerEvents) {\n this._triggerEvents = new Set(Array.isArray(triggerEvents) ? triggerEvents : [triggerEvents]);\n }\n /** Returns a list of events that will make a switcher switch to the next view. */\n get triggerEvents() {\n return Array.from(this._triggerEvents);\n }\n /**\n * Show a view by id, or to next one by order, if no ID provided.\n * @param {number} id - optional id of the view to show. If not set, will switch to the next view.\n */\n switch(id) {\n if (id !== void 0 && id === this.active)\n return;\n const exID = this.active;\n this.forceSwitch(id);\n if (exID !== this.active) {\n const res = this.views.length > 2 ? this.active : this.active === 1;\n this.onChange.emit(res);\n }\n }\n /**\n * Switches a view to a given one without triggering the onChange event.\n * @param {number} id - optional id of the view to show. If not set, will switch to the next view.\n */\n forceSwitch(id) {\n if (id !== void 0 && id === this.active)\n return;\n if (this.activeView) {\n this.activeView.visible = false;\n }\n if (id !== void 0 && !this.views[id]) {\n throw new Error(`View with id ${id} does not exist.`);\n }\n this._active = id !== void 0 ? id : this.nextActive;\n if (this._active === void 0) {\n return;\n }\n this.views[this.active].visible = true;\n }\n /** Returns the id of the next view in order. Or undefined, if order is empty. */\n get nextActive() {\n if (this.views.length === 0)\n return void 0;\n return this.active < this.views.length - 1 ? this.active + 1 : 0;\n }\n /** Sets the id of the visible(active) view and shows to it. */\n set active(id) {\n this.switch(id);\n }\n /** Gets the id of the visible(active) view. */\n get active() {\n return this._active;\n }\n}\n\nexports.Switcher = Switcher;\n//# sourceMappingURL=Switcher.js.map\n","'use strict';\n\nvar Button = require('./Button.js');\nvar CheckBox = require('./CheckBox.js');\nvar CircularProgressBar = require('./CircularProgressBar.js');\nvar DoubleSlider = require('./DoubleSlider.js');\nvar FancyButton = require('./FancyButton.js');\nvar Input = require('./Input.js');\nvar List = require('./List.js');\nvar MaskedFrame = require('./MaskedFrame.js');\nvar ProgressBar = require('./ProgressBar.js');\nvar RadioGroup = require('./RadioGroup.js');\nvar ScrollBox = require('./ScrollBox.js');\nvar Select = require('./Select.js');\nvar Slider = require('./Slider.js');\nvar Switcher = require('./Switcher.js');\n\n\n\nexports.Button = Button.Button;\nexports.ButtonContainer = Button.ButtonContainer;\nexports.CheckBox = CheckBox.CheckBox;\nexports.CircularProgressBar = CircularProgressBar.CircularProgressBar;\nexports.DoubleSlider = DoubleSlider.DoubleSlider;\nexports.FancyButton = FancyButton.FancyButton;\nexports.Input = Input.Input;\nexports.List = List.List;\nexports.MaskedFrame = MaskedFrame.MaskedFrame;\nexports.ProgressBar = ProgressBar.ProgressBar;\nexports.RadioGroup = RadioGroup.RadioGroup;\nexports.ScrollBox = ScrollBox.ScrollBox;\nexports.Select = Select.Select;\nexports.Slider = Slider.Slider;\nexports.Switcher = Switcher.Switcher;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nfunction cleanup(element) {\n if (!element)\n return;\n if (element.parent) {\n element.parent.removeChild(element);\n }\n element.destroy();\n element = null;\n}\n\nexports.cleanup = cleanup;\n//# sourceMappingURL=cleanup.js.map\n","'use strict';\n\nfunction fitToView(parent, child, padding = 0, uniformScaling = true) {\n let scaleX = child.scale.x;\n let scaleY = child.scale.y;\n if (!parent) {\n throw new Error(\"Parent is not defined\");\n }\n const maxWidth = parent.width - padding * 2;\n const maxHeight = parent.height - padding * 2;\n const widthOverflow = maxWidth - Math.round(child.width);\n const heightOverflow = maxHeight - Math.round(child.height);\n if (widthOverflow < 0) {\n scaleX = maxWidth / (child.width / scaleX);\n }\n if (heightOverflow < 0) {\n scaleY = maxHeight / (child.height / scaleY);\n }\n if (scaleX <= 0 || scaleY <= 0) {\n child.scale.set(0);\n return;\n }\n if (uniformScaling || child.scale.x === child.scale.y) {\n const scale = Math.min(scaleX, scaleY);\n child.scale.set(scale, scale);\n } else {\n const ratio = child.scale.x / child.scale.y;\n if (widthOverflow < heightOverflow) {\n child.scale.set(scaleX, scaleX / ratio);\n } else {\n child.scale.set(scaleY * ratio, scaleY);\n }\n }\n}\n\nexports.fitToView = fitToView;\n//# sourceMappingURL=fit.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\n\nfunction getTextView(text) {\n if (typeof text === \"string\" || typeof text === \"number\") {\n return new pixi_js.Text({ text: String(text) });\n }\n return text;\n}\n\nexports.getTextView = getTextView;\n//# sourceMappingURL=text.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\n\nfunction getView(view) {\n if (typeof view === \"string\") {\n return pixi_js.Sprite.from(view);\n }\n return view;\n}\nfunction getSpriteView(view) {\n if (typeof view === \"string\") {\n return pixi_js.Sprite.from(view);\n }\n return view;\n}\n\nexports.getSpriteView = getSpriteView;\nexports.getView = getView;\n//# sourceMappingURL=view.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar Spring = require('./Spring.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass ScrollSpring {\n constructor() {\n __publicField(this, \"done\");\n __publicField(this, \"to\");\n __publicField(this, \"_spring\");\n __publicField(this, \"_pos\");\n __publicField(this, \"_speed\");\n __publicField(this, \"_correctSpeed\");\n this._spring = new Spring.Spring();\n this._pos = 0;\n this.to = 0;\n }\n start(speed, pos, to) {\n this._speed = speed;\n this._pos = pos;\n this.to = to;\n this.done = false;\n this._spring.x = this._pos;\n this._spring.tx = this.to;\n const diff = this.to - this._pos;\n const toDirection = Math.abs(diff) / diff;\n const currentDirection = Math.abs(this._speed) / this._speed;\n if (toDirection !== currentDirection) {\n this._correctSpeed = true;\n } else {\n this._correctSpeed = false;\n }\n }\n update() {\n if (this._correctSpeed) {\n this._speed *= 0.6;\n if (Math.abs(this._speed) < 2) {\n this._correctSpeed = false;\n }\n this._pos += this._speed;\n this._spring.x = this._pos;\n } else {\n const diff = this.to - this._pos;\n if (Math.abs(diff) < 0.05) {\n this._pos = this.to;\n this.done = true;\n } else {\n this._spring.tx = this.to;\n this._spring.update();\n this._pos = this._spring.x;\n }\n }\n return this._pos;\n }\n cancel() {\n }\n}\n\nexports.default = ScrollSpring;\n//# sourceMappingURL=ScrollSpring.js.map\n","'use strict';\n\nvar ScrollSpring = require('./ScrollSpring.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass SlidingNumber {\n constructor(options = {}) {\n __publicField(this, \"position\", 0);\n __publicField(this, \"constrain\", true);\n __publicField(this, \"min\", 0);\n // the window width of the drag\n __publicField(this, \"max\", 0);\n // the window width of the drag\n __publicField(this, \"maxSpeed\", 400);\n __publicField(this, \"_ease\");\n __publicField(this, \"_offset\", 0);\n __publicField(this, \"_prev\", 0);\n __publicField(this, \"_speed\", 0);\n __publicField(this, \"_hasStopped\");\n __publicField(this, \"_targetSpeed\", 0);\n __publicField(this, \"_speedChecker\", 0);\n __publicField(this, \"_grab\", 0);\n __publicField(this, \"_activeEase\");\n this.constrain = options.constrain ?? true;\n this.maxSpeed = options.maxSpeed ?? 400;\n this._ease = options.ease ?? new ScrollSpring.default();\n }\n set value(n) {\n this._speed = 0;\n this.position = n;\n }\n get value() {\n return this.position;\n }\n grab(offset) {\n this._grab = offset;\n this._offset = this.position - offset;\n this._speedChecker = 0;\n this._targetSpeed = this._speed = 0;\n this._hasStopped = false;\n }\n hold(newPosition) {\n this._speedChecker++;\n this.position = newPosition + this._offset;\n if (this._speedChecker > 1) {\n this._targetSpeed = this.position - this._prev;\n }\n this._speed += (this._targetSpeed - this._speed) / 2;\n if (this._speed > this.maxSpeed)\n this._speed = this.maxSpeed;\n else if (this._speed < -this.maxSpeed)\n this._speed = -this.maxSpeed;\n this._prev = this.position;\n if (this.constrain) {\n this._activeEase = null;\n if (this.position > this.min) {\n this.position -= (this.position - this.min) / 1.5;\n } else if (this.position < this.max) {\n this.position += (this.max - this.position) / 1.5;\n }\n }\n }\n slide(instant = false) {\n if (this._hasStopped)\n return;\n if (this.constrain) {\n this._updateConstrain(instant);\n } else {\n this._updateDefault();\n }\n }\n get moveAmount() {\n return -(this.position - this._offset - this._grab);\n }\n _updateDefault() {\n this._speed *= 0.9;\n this.position += this._speed;\n if ((this._speed < 0 ? this._speed * -1 : this._speed) < 0.01) {\n this._hasStopped = true;\n }\n }\n _updateConstrain(instant = false) {\n const max = this.max;\n if (instant) {\n if (this.value > 0) {\n this.value = 0;\n }\n if (this.value > 0) {\n this.value = 0;\n }\n if (this.value < this.max) {\n this.value = this.max;\n }\n if (this.value < this.max) {\n this.value = this.max;\n }\n } else if (this.position > this.min || this.position < max || this._activeEase) {\n if (!this._activeEase) {\n this._activeEase = this._ease;\n if (this.position > this.min) {\n this._activeEase.start(this._speed, this.position, this.min);\n } else {\n this._activeEase.start(this._speed, this.position, max);\n }\n }\n this.position = this._activeEase.update();\n if (this._activeEase.done) {\n this.position = this._activeEase.to;\n this._speed = 0;\n this._activeEase = null;\n }\n } else {\n this._updateDefault();\n }\n }\n}\n\nexports.SlidingNumber = SlidingNumber;\n//# sourceMappingURL=SlidingNumber.js.map\n","'use strict';\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass Spring {\n constructor(options = {}) {\n __publicField(this, \"x\");\n __publicField(this, \"ax\");\n __publicField(this, \"dx\");\n __publicField(this, \"tx\");\n __publicField(this, \"_options\");\n this.x = 0;\n this.ax = 0;\n this.dx = 0;\n this.tx = 0;\n this._options = options;\n this._options.max = options.max || 160;\n this._options.damp = options.damp || 0.8;\n this._options.springiness = options.springiness || 0.1;\n }\n update() {\n this.ax = (this.tx - this.x) * this._options.springiness;\n this.dx += this.ax;\n this.dx *= this._options.damp;\n if (this.dx < -this._options.max)\n this.dx = -this._options.max;\n else if (this.dx > this._options.max)\n this.dx = this._options.max;\n this.x += this.dx;\n }\n reset() {\n this.x = 0;\n this.ax = 0;\n this.dx = 0;\n this.tx = 0;\n }\n get max() {\n return this._options.max;\n }\n set max(value) {\n this._options.max = value;\n }\n get damp() {\n return this._options.damp;\n }\n set damp(value) {\n this._options.damp = value;\n }\n get springiness() {\n return this._options.springiness;\n }\n set springiness(value) {\n this._options.springiness = value;\n }\n}\n\nexports.Spring = Spring;\n//# sourceMappingURL=Spring.js.map\n","'use strict';\n\nvar pixi_js = require('pixi.js');\nvar SlidingNumber = require('./SlidingNumber.js');\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass Trackpad {\n constructor(options) {\n __publicField(this, \"xAxis\");\n __publicField(this, \"yAxis\");\n __publicField(this, \"_isDown\");\n __publicField(this, \"_globalPosition\");\n __publicField(this, \"_frame\");\n __publicField(this, \"_bounds\");\n __publicField(this, \"_dirty\");\n __publicField(this, \"disableEasing\", false);\n this.xAxis = new SlidingNumber.SlidingNumber({\n ease: options.xEase,\n maxSpeed: options.maxSpeed,\n constrain: options.constrain\n });\n this.yAxis = new SlidingNumber.SlidingNumber({\n ease: options.yEase,\n maxSpeed: options.maxSpeed,\n constrain: options.constrain\n });\n this.disableEasing = options.disableEasing ?? false;\n this._frame = new pixi_js.Rectangle();\n this._bounds = new pixi_js.Rectangle();\n this._globalPosition = new pixi_js.Point();\n }\n pointerDown(pos) {\n this._globalPosition = pos;\n this.xAxis.grab(pos.x);\n this.yAxis.grab(pos.y);\n this._isDown = true;\n }\n pointerUp() {\n this._isDown = false;\n }\n pointerMove(pos) {\n this._globalPosition = pos;\n }\n update() {\n if (this._dirty) {\n this._dirty = false;\n this.xAxis.min = this._bounds.left;\n this.xAxis.min = this._bounds.right - this._frame.width;\n this.xAxis.min = this._bounds.top;\n this.xAxis.min = this._bounds.bottom - this._frame.height;\n }\n if (this._isDown) {\n this.xAxis.hold(this._globalPosition.x);\n this.yAxis.hold(this._globalPosition.y);\n } else {\n this.xAxis.slide(this.disableEasing);\n this.yAxis.slide(this.disableEasing);\n }\n }\n resize(w, h) {\n this._frame.x = 0;\n this._frame.width = w;\n this._frame.y = 0;\n this._frame.height = h;\n this._dirty = true;\n }\n setBounds(minX, maxX, minY, maxY) {\n this._bounds.x = minX;\n this._bounds.width = maxX - minX;\n this._bounds.y = minY;\n this._bounds.height = maxY - minY;\n this._dirty = true;\n }\n get x() {\n return this.xAxis.value;\n }\n get y() {\n return this.yAxis.value;\n }\n}\n\nexports.Trackpad = Trackpad;\n//# sourceMappingURL=Trackpad.js.map\n","'use strict'\n\n/**\n * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.\n *\n * Works with anything that has a `length` property and index access properties, including NodeList.\n *\n * @template {unknown} T\n * @param {Array | ({length:number, [number]: T})} list\n * @param {function (item: T, index: number, list:Array | ({length:number, [number]: T})):boolean} predicate\n * @param {Partial>?} ac `Array.prototype` by default,\n * \t\t\t\tallows injecting a custom implementation in tests\n * @returns {T | undefined}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find\n */\nfunction find(list, predicate, ac) {\n\tif (ac === undefined) {\n\t\tac = Array.prototype;\n\t}\n\tif (list && typeof ac.find === 'function') {\n\t\treturn ac.find.call(list, predicate);\n\t}\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (Object.prototype.hasOwnProperty.call(list, i)) {\n\t\t\tvar item = list[i];\n\t\t\tif (predicate.call(undefined, item, i, list)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * \"Shallow freezes\" an object to render it immutable.\n * Uses `Object.freeze` if available,\n * otherwise the immutability is only in the type.\n *\n * Is used to create \"enum like\" objects.\n *\n * @template T\n * @param {T} object the object to freeze\n * @param {Pick = Object} oc `Object` by default,\n * \t\t\t\tallows to inject custom object constructor for tests\n * @returns {Readonly}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n */\nfunction freeze(object, oc) {\n\tif (oc === undefined) {\n\t\toc = Object\n\t}\n\treturn oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object\n}\n\n/**\n * Since we can not rely on `Object.assign` we provide a simplified version\n * that is sufficient for our needs.\n *\n * @param {Object} target\n * @param {Object | null | undefined} source\n *\n * @returns {Object} target\n * @throws TypeError if target is not an object\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign\n */\nfunction assign(target, source) {\n\tif (target === null || typeof target !== 'object') {\n\t\tthrow new TypeError('target is not an object')\n\t}\n\tfor (var key in source) {\n\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\ttarget[key] = source[key]\n\t\t}\n\t}\n\treturn target\n}\n\n/**\n * All mime types that are allowed as input to `DOMParser.parseFromString`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec\n * @see DOMParser.prototype.parseFromString\n */\nvar MIME_TYPE = freeze({\n\t/**\n\t * `text/html`, the only mime type that triggers treating an XML document as HTML.\n\t *\n\t * @see DOMParser.SupportedType.isHTML\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec\n\t */\n\tHTML: 'text/html',\n\n\t/**\n\t * Helper method to check a mime type if it indicates an HTML document\n\t *\n\t * @param {string} [value]\n\t * @returns {boolean}\n\t *\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring \t */\n\tisHTML: function (value) {\n\t\treturn value === MIME_TYPE.HTML\n\t},\n\n\t/**\n\t * `application/xml`, the standard mime type for XML documents.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_APPLICATION: 'application/xml',\n\n\t/**\n\t * `text/html`, an alias for `application/xml`.\n\t *\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303\n\t * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_TEXT: 'text/xml',\n\n\t/**\n\t * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,\n\t * but is parsed as an XML document.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec\n\t * @see https://en.wikipedia.org/wiki/XHTML Wikipedia\n\t */\n\tXML_XHTML_APPLICATION: 'application/xhtml+xml',\n\n\t/**\n\t * `image/svg+xml`,\n\t *\n\t * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration\n\t * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1\n\t * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia\n\t */\n\tXML_SVG_IMAGE: 'image/svg+xml',\n})\n\n/**\n * Namespaces that are used in this code base.\n *\n * @see http://www.w3.org/TR/REC-xml-names\n */\nvar NAMESPACE = freeze({\n\t/**\n\t * The XHTML namespace.\n\t *\n\t * @see http://www.w3.org/1999/xhtml\n\t */\n\tHTML: 'http://www.w3.org/1999/xhtml',\n\n\t/**\n\t * Checks if `uri` equals `NAMESPACE.HTML`.\n\t *\n\t * @param {string} [uri]\n\t *\n\t * @see NAMESPACE.HTML\n\t */\n\tisHTML: function (uri) {\n\t\treturn uri === NAMESPACE.HTML\n\t},\n\n\t/**\n\t * The SVG namespace.\n\t *\n\t * @see http://www.w3.org/2000/svg\n\t */\n\tSVG: 'http://www.w3.org/2000/svg',\n\n\t/**\n\t * The `xml:` namespace.\n\t *\n\t * @see http://www.w3.org/XML/1998/namespace\n\t */\n\tXML: 'http://www.w3.org/XML/1998/namespace',\n\n\t/**\n\t * The `xmlns:` namespace\n\t *\n\t * @see https://www.w3.org/2000/xmlns/\n\t */\n\tXMLNS: 'http://www.w3.org/2000/xmlns/',\n})\n\nexports.assign = assign;\nexports.find = find;\nexports.freeze = freeze;\nexports.MIME_TYPE = MIME_TYPE;\nexports.NAMESPACE = NAMESPACE;\n","var conventions = require(\"./conventions\");\nvar dom = require('./dom')\nvar entities = require('./entities');\nvar sax = require('./sax');\n\nvar DOMImplementation = dom.DOMImplementation;\n\nvar NAMESPACE = conventions.NAMESPACE;\n\nvar ParseError = sax.ParseError;\nvar XMLReader = sax.XMLReader;\n\n/**\n * Normalizes line ending according to https://www.w3.org/TR/xml11/#sec-line-ends:\n *\n * > XML parsed entities are often stored in computer files which,\n * > for editing convenience, are organized into lines.\n * > These lines are typically separated by some combination\n * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).\n * >\n * > To simplify the tasks of applications, the XML processor must behave\n * > as if it normalized all line breaks in external parsed entities (including the document entity)\n * > on input, before parsing, by translating all of the following to a single #xA character:\n * >\n * > 1. the two-character sequence #xD #xA\n * > 2. the two-character sequence #xD #x85\n * > 3. the single character #x85\n * > 4. the single character #x2028\n * > 5. any #xD character that is not immediately followed by #xA or #x85.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizeLineEndings(input) {\n\treturn input\n\t\t.replace(/\\r[\\n\\u0085]/g, '\\n')\n\t\t.replace(/[\\r\\u0085\\u2028]/g, '\\n')\n}\n\n/**\n * @typedef Locator\n * @property {number} [columnNumber]\n * @property {number} [lineNumber]\n */\n\n/**\n * @typedef DOMParserOptions\n * @property {DOMHandler} [domBuilder]\n * @property {Function} [errorHandler]\n * @property {(string) => string} [normalizeLineEndings] used to replace line endings before parsing\n * \t\t\t\t\t\tdefaults to `normalizeLineEndings`\n * @property {Locator} [locator]\n * @property {Record} [xmlns]\n *\n * @see normalizeLineEndings\n */\n\n/**\n * The DOMParser interface provides the ability to parse XML or HTML source code\n * from a string into a DOM `Document`.\n *\n * _xmldom is different from the spec in that it allows an `options` parameter,\n * to override the default behavior._\n *\n * @param {DOMParserOptions} [options]\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization\n */\nfunction DOMParser(options){\n\tthis.options = options ||{locator:{}};\n}\n\nDOMParser.prototype.parseFromString = function(source,mimeType){\n\tvar options = this.options;\n\tvar sax = new XMLReader();\n\tvar domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler\n\tvar errorHandler = options.errorHandler;\n\tvar locator = options.locator;\n\tvar defaultNSMap = options.xmlns||{};\n\tvar isHTML = /\\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;\n \tvar entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;\n\tif(locator){\n\t\tdomBuilder.setDocumentLocator(locator)\n\t}\n\n\tsax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);\n\tsax.domBuilder = options.domBuilder || domBuilder;\n\tif(isHTML){\n\t\tdefaultNSMap[''] = NAMESPACE.HTML;\n\t}\n\tdefaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;\n\tvar normalize = options.normalizeLineEndings || normalizeLineEndings;\n\tif (source && typeof source === 'string') {\n\t\tsax.parse(\n\t\t\tnormalize(source),\n\t\t\tdefaultNSMap,\n\t\t\tentityMap\n\t\t)\n\t} else {\n\t\tsax.errorHandler.error('invalid doc source')\n\t}\n\treturn domBuilder.doc;\n}\nfunction buildErrorHandler(errorImpl,domBuilder,locator){\n\tif(!errorImpl){\n\t\tif(domBuilder instanceof DOMHandler){\n\t\t\treturn domBuilder;\n\t\t}\n\t\terrorImpl = domBuilder ;\n\t}\n\tvar errorHandler = {}\n\tvar isCallback = errorImpl instanceof Function;\n\tlocator = locator||{}\n\tfunction build(key){\n\t\tvar fn = errorImpl[key];\n\t\tif(!fn && isCallback){\n\t\t\tfn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;\n\t\t}\n\t\terrorHandler[key] = fn && function(msg){\n\t\t\tfn('[xmldom '+key+']\\t'+msg+_locator(locator));\n\t\t}||function(){};\n\t}\n\tbuild('warning');\n\tbuild('error');\n\tbuild('fatalError');\n\treturn errorHandler;\n}\n\n//console.log('#\\n\\n\\n\\n\\n\\n\\n####')\n/**\n * +ContentHandler+ErrorHandler\n * +LexicalHandler+EntityResolver2\n * -DeclHandler-DTDHandler\n *\n * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler\n * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2\n * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html\n */\nfunction DOMHandler() {\n this.cdata = false;\n}\nfunction position(locator,node){\n\tnode.lineNumber = locator.lineNumber;\n\tnode.columnNumber = locator.columnNumber;\n}\n/**\n * @see org.xml.sax.ContentHandler#startDocument\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html\n */\nDOMHandler.prototype = {\n\tstartDocument : function() {\n \tthis.doc = new DOMImplementation().createDocument(null, null, null);\n \tif (this.locator) {\n \tthis.doc.documentURI = this.locator.systemId;\n \t}\n\t},\n\tstartElement:function(namespaceURI, localName, qName, attrs) {\n\t\tvar doc = this.doc;\n\t var el = doc.createElementNS(namespaceURI, qName||localName);\n\t var len = attrs.length;\n\t appendElement(this, el);\n\t this.currentElement = el;\n\n\t\tthis.locator && position(this.locator,el)\n\t for (var i = 0 ; i < len; i++) {\n\t var namespaceURI = attrs.getURI(i);\n\t var value = attrs.getValue(i);\n\t var qName = attrs.getQName(i);\n\t\t\tvar attr = doc.createAttributeNS(namespaceURI, qName);\n\t\t\tthis.locator &&position(attrs.getLocator(i),attr);\n\t\t\tattr.value = attr.nodeValue = value;\n\t\t\tel.setAttributeNode(attr)\n\t }\n\t},\n\tendElement:function(namespaceURI, localName, qName) {\n\t\tvar current = this.currentElement\n\t\tvar tagName = current.tagName;\n\t\tthis.currentElement = current.parentNode;\n\t},\n\tstartPrefixMapping:function(prefix, uri) {\n\t},\n\tendPrefixMapping:function(prefix) {\n\t},\n\tprocessingInstruction:function(target, data) {\n\t var ins = this.doc.createProcessingInstruction(target, data);\n\t this.locator && position(this.locator,ins)\n\t appendElement(this, ins);\n\t},\n\tignorableWhitespace:function(ch, start, length) {\n\t},\n\tcharacters:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t\t//console.log(chars)\n\t\tif(chars){\n\t\t\tif (this.cdata) {\n\t\t\t\tvar charNode = this.doc.createCDATASection(chars);\n\t\t\t} else {\n\t\t\t\tvar charNode = this.doc.createTextNode(chars);\n\t\t\t}\n\t\t\tif(this.currentElement){\n\t\t\t\tthis.currentElement.appendChild(charNode);\n\t\t\t}else if(/^\\s*$/.test(chars)){\n\t\t\t\tthis.doc.appendChild(charNode);\n\t\t\t\t//process xml\n\t\t\t}\n\t\t\tthis.locator && position(this.locator,charNode)\n\t\t}\n\t},\n\tskippedEntity:function(name) {\n\t},\n\tendDocument:function() {\n\t\tthis.doc.normalize();\n\t},\n\tsetDocumentLocator:function (locator) {\n\t if(this.locator = locator){// && !('lineNumber' in locator)){\n\t \tlocator.lineNumber = 0;\n\t }\n\t},\n\t//LexicalHandler\n\tcomment:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t var comm = this.doc.createComment(chars);\n\t this.locator && position(this.locator,comm)\n\t appendElement(this, comm);\n\t},\n\n\tstartCDATA:function() {\n\t //used in characters() methods\n\t this.cdata = true;\n\t},\n\tendCDATA:function() {\n\t this.cdata = false;\n\t},\n\n\tstartDTD:function(name, publicId, systemId) {\n\t\tvar impl = this.doc.implementation;\n\t if (impl && impl.createDocumentType) {\n\t var dt = impl.createDocumentType(name, publicId, systemId);\n\t this.locator && position(this.locator,dt)\n\t appendElement(this, dt);\n\t\t\t\t\tthis.doc.doctype = dt;\n\t }\n\t},\n\t/**\n\t * @see org.xml.sax.ErrorHandler\n\t * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html\n\t */\n\twarning:function(error) {\n\t\tconsole.warn('[xmldom warning]\\t'+error,_locator(this.locator));\n\t},\n\terror:function(error) {\n\t\tconsole.error('[xmldom error]\\t'+error,_locator(this.locator));\n\t},\n\tfatalError:function(error) {\n\t\tthrow new ParseError(error, this.locator);\n\t}\n}\nfunction _locator(l){\n\tif(l){\n\t\treturn '\\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'\n\t}\n}\nfunction _toString(chars,start,length){\n\tif(typeof chars == 'string'){\n\t\treturn chars.substr(start,length)\n\t}else{//java sax connect width xmldom on rhino(what about: \"? && !(chars instanceof String)\")\n\t\tif(chars.length >= start+length || start){\n\t\t\treturn new java.lang.String(chars,start,length)+'';\n\t\t}\n\t\treturn chars;\n\t}\n}\n\n/*\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html\n * used method of org.xml.sax.ext.LexicalHandler:\n * #comment(chars, start, length)\n * #startCDATA()\n * #endCDATA()\n * #startDTD(name, publicId, systemId)\n *\n *\n * IGNORED method of org.xml.sax.ext.LexicalHandler:\n * #endDTD()\n * #startEntity(name)\n * #endEntity(name)\n *\n *\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html\n * IGNORED method of org.xml.sax.ext.DeclHandler\n * \t#attributeDecl(eName, aName, type, mode, value)\n * #elementDecl(name, model)\n * #externalEntityDecl(name, publicId, systemId)\n * #internalEntityDecl(name, value)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html\n * IGNORED method of org.xml.sax.EntityResolver2\n * #resolveEntity(String name,String publicId,String baseURI,String systemId)\n * #resolveEntity(publicId, systemId)\n * #getExternalSubset(name, baseURI)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html\n * IGNORED method of org.xml.sax.DTDHandler\n * #notationDecl(name, publicId, systemId) {};\n * #unparsedEntityDecl(name, publicId, systemId, notationName) {};\n */\n\"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl\".replace(/\\w+/g,function(key){\n\tDOMHandler.prototype[key] = function(){return null}\n})\n\n/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */\nfunction appendElement (hander,node) {\n if (!hander.currentElement) {\n hander.doc.appendChild(node);\n } else {\n hander.currentElement.appendChild(node);\n }\n}//appendChild and setAttributeNS are preformance key\n\nexports.__DOMHandler = DOMHandler;\nexports.normalizeLineEndings = normalizeLineEndings;\nexports.DOMParser = DOMParser;\n","var conventions = require(\"./conventions\");\n\nvar find = conventions.find;\nvar NAMESPACE = conventions.NAMESPACE;\n\n/**\n * A prerequisite for `[].filter`, to drop elements that are empty\n * @param {string} input\n * @returns {boolean}\n */\nfunction notEmptyString (input) {\n\treturn input !== ''\n}\n/**\n * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * @param {string} input\n * @returns {string[]} (can be empty)\n */\nfunction splitOnASCIIWhitespace(input) {\n\t// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE\n\treturn input ? input.split(/[\\t\\n\\f\\r ]+/).filter(notEmptyString) : []\n}\n\n/**\n * Adds element as a key to current if it is not already present.\n *\n * @param {Record} current\n * @param {string} element\n * @returns {Record}\n */\nfunction orderedSetReducer (current, element) {\n\tif (!current.hasOwnProperty(element)) {\n\t\tcurrent[element] = true;\n\t}\n\treturn current;\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ordered-set\n * @param {string} input\n * @returns {string[]}\n */\nfunction toOrderedSet(input) {\n\tif (!input) return [];\n\tvar list = splitOnASCIIWhitespace(input);\n\treturn Object.keys(list.reduce(orderedSetReducer, {}))\n}\n\n/**\n * Uses `list.indexOf` to implement something like `Array.prototype.includes`,\n * which we can not rely on being available.\n *\n * @param {any[]} list\n * @returns {function(any): boolean}\n */\nfunction arrayIncludes (list) {\n\treturn function(element) {\n\t\treturn list && list.indexOf(element) !== -1;\n\t}\n}\n\nfunction copy(src,dest){\n\tfor(var p in src){\n\t\tif (Object.prototype.hasOwnProperty.call(src, p)) {\n\t\t\tdest[p] = src[p];\n\t\t}\n\t}\n}\n\n/**\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*((?:.*\\{\\s*?[\\r\\n][\\s\\S]*?^})|\\S.*?(?=[;\\r\\n]));?\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*(\\S.*?(?=[;\\r\\n]));?\n */\nfunction _extends(Class,Super){\n\tvar pt = Class.prototype;\n\tif(!(pt instanceof Super)){\n\t\tfunction t(){};\n\t\tt.prototype = Super.prototype;\n\t\tt = new t();\n\t\tcopy(pt,t);\n\t\tClass.prototype = pt = t;\n\t}\n\tif(pt.constructor != Class){\n\t\tif(typeof Class != 'function'){\n\t\t\tconsole.error(\"unknown Class:\"+Class)\n\t\t}\n\t\tpt.constructor = Class\n\t}\n}\n\n// Node Types\nvar NodeType = {}\nvar ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;\nvar ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;\nvar TEXT_NODE = NodeType.TEXT_NODE = 3;\nvar CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;\nvar ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;\nvar ENTITY_NODE = NodeType.ENTITY_NODE = 6;\nvar PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;\nvar COMMENT_NODE = NodeType.COMMENT_NODE = 8;\nvar DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;\nvar DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;\nvar DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;\nvar NOTATION_NODE = NodeType.NOTATION_NODE = 12;\n\n// ExceptionCode\nvar ExceptionCode = {}\nvar ExceptionMessage = {};\nvar INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]=\"Index size error\"),1);\nvar DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]=\"DOMString size error\"),2);\nvar HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]=\"Hierarchy request error\"),3);\nvar WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]=\"Wrong document\"),4);\nvar INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]=\"Invalid character\"),5);\nvar NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]=\"No data allowed\"),6);\nvar NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]=\"No modification allowed\"),7);\nvar NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]=\"Not found\"),8);\nvar NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]=\"Not supported\"),9);\nvar INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]=\"Attribute in use\"),10);\n//level2\nvar INVALID_STATE_ERR \t= ExceptionCode.INVALID_STATE_ERR \t= ((ExceptionMessage[11]=\"Invalid state\"),11);\nvar SYNTAX_ERR \t= ExceptionCode.SYNTAX_ERR \t= ((ExceptionMessage[12]=\"Syntax error\"),12);\nvar INVALID_MODIFICATION_ERR \t= ExceptionCode.INVALID_MODIFICATION_ERR \t= ((ExceptionMessage[13]=\"Invalid modification\"),13);\nvar NAMESPACE_ERR \t= ExceptionCode.NAMESPACE_ERR \t= ((ExceptionMessage[14]=\"Invalid namespace\"),14);\nvar INVALID_ACCESS_ERR \t= ExceptionCode.INVALID_ACCESS_ERR \t= ((ExceptionMessage[15]=\"Invalid access\"),15);\n\n/**\n * DOM Level 2\n * Object DOMException\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html\n */\nfunction DOMException(code, message) {\n\tif(message instanceof Error){\n\t\tvar error = message;\n\t}else{\n\t\terror = this;\n\t\tError.call(this, ExceptionMessage[code]);\n\t\tthis.message = ExceptionMessage[code];\n\t\tif(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);\n\t}\n\terror.code = code;\n\tif(message) this.message = this.message + \": \" + message;\n\treturn error;\n};\nDOMException.prototype = Error.prototype;\ncopy(ExceptionCode,DOMException)\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177\n * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.\n * The items in the NodeList are accessible via an integral index, starting from 0.\n */\nfunction NodeList() {\n};\nNodeList.prototype = {\n\t/**\n\t * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.\n\t * @standard level1\n\t */\n\tlength:0,\n\t/**\n\t * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.\n\t * @standard level1\n\t * @param index unsigned long\n\t * Index into the collection.\n\t * @return Node\n\t * \tThe node at the indexth position in the NodeList, or null if that is not a valid index.\n\t */\n\titem: function(index) {\n\t\treturn index >= 0 && index < this.length ? this[index] : null;\n\t},\n\ttoString:function(isHTML,nodeFilter){\n\t\tfor(var buf = [], i = 0;i=0){\n\t\tvar lastIndex = list.length-1\n\t\twhile(i0 || key == 'xmlns'){\n//\t\t\treturn null;\n//\t\t}\n\t\t//console.log()\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar attr = this[i];\n\t\t\t//console.log(attr.nodeName,key)\n\t\t\tif(attr.nodeName == key){\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t}\n\t},\n\tsetNamedItem: function(attr) {\n\t\tvar el = attr.ownerElement;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\tvar oldAttr = this.getNamedItem(attr.nodeName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\t/* returns Node */\n\tsetNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR\n\t\tvar el = attr.ownerElement, oldAttr;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\toldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\n\t/* returns Node */\n\tremoveNamedItem: function(key) {\n\t\tvar attr = this.getNamedItem(key);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\n\n\t},// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR\n\n\t//for level2\n\tremoveNamedItemNS:function(namespaceURI,localName){\n\t\tvar attr = this.getNamedItemNS(namespaceURI,localName);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t},\n\tgetNamedItemNS: function(namespaceURI, localName) {\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar node = this[i];\n\t\t\tif(node.localName == localName && node.namespaceURI == namespaceURI){\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n};\n\n/**\n * The DOMImplementation interface represents an object providing methods\n * which are not dependent on any particular document.\n * Such an object is returned by the `Document.implementation` property.\n *\n * __The individual methods describe the differences compared to the specs.__\n *\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN\n * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)\n * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core\n * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core\n * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard\n */\nfunction DOMImplementation() {\n}\n\nDOMImplementation.prototype = {\n\t/**\n\t * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.\n\t * The different implementations fairly diverged in what kind of features were reported.\n\t * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.\n\t *\n\t * @deprecated It is deprecated and modern browsers return true in all cases.\n\t *\n\t * @param {string} feature\n\t * @param {string} [version]\n\t * @returns {boolean} always true\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN\n\t * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard\n\t */\n\thasFeature: function(feature, version) {\n\t\t\treturn true;\n\t},\n\t/**\n\t * Creates an XML Document object of the specified type with its document element.\n\t *\n\t * __It behaves slightly different from the description in the living standard__:\n\t * - There is no interface/class `XMLDocument`, it returns a `Document` instance.\n\t * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string|null} namespaceURI\n\t * @param {string} qualifiedName\n\t * @param {DocumentType=null} doctype\n\t * @returns {Document}\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocument: function(namespaceURI, qualifiedName, doctype){\n\t\tvar doc = new Document();\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tdoc.doctype = doctype || null;\n\t\tif (doctype){\n\t\t\tdoc.appendChild(doctype);\n\t\t}\n\t\tif (qualifiedName){\n\t\t\tvar root = doc.createElementNS(namespaceURI, qualifiedName);\n\t\t\tdoc.appendChild(root);\n\t\t}\n\t\treturn doc;\n\t},\n\t/**\n\t * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.\n\t *\n\t * __This behavior is slightly different from the in the specs__:\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string} qualifiedName\n\t * @param {string} [publicId]\n\t * @param {string} [systemId]\n\t * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation\n\t * \t\t\t\t or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocumentType: function(qualifiedName, publicId, systemId){\n\t\tvar node = new DocumentType();\n\t\tnode.name = qualifiedName;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.publicId = publicId || '';\n\t\tnode.systemId = systemId || '';\n\n\t\treturn node;\n\t}\n};\n\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247\n */\n\nfunction Node() {\n};\n\nNode.prototype = {\n\tfirstChild : null,\n\tlastChild : null,\n\tpreviousSibling : null,\n\tnextSibling : null,\n\tattributes : null,\n\tparentNode : null,\n\tchildNodes : null,\n\townerDocument : null,\n\tnodeValue : null,\n\tnamespaceURI : null,\n\tprefix : null,\n\tlocalName : null,\n\t// Modified in DOM Level 2:\n\tinsertBefore:function(newChild, refChild){//raises\n\t\treturn _insertBefore(this,newChild,refChild);\n\t},\n\treplaceChild:function(newChild, oldChild){//raises\n\t\t_insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);\n\t\tif(oldChild){\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t},\n\tremoveChild:function(oldChild){\n\t\treturn _removeChild(this,oldChild);\n\t},\n\tappendChild:function(newChild){\n\t\treturn this.insertBefore(newChild,null);\n\t},\n\thasChildNodes:function(){\n\t\treturn this.firstChild != null;\n\t},\n\tcloneNode:function(deep){\n\t\treturn cloneNode(this.ownerDocument||this,this,deep);\n\t},\n\t// Modified in DOM Level 2:\n\tnormalize:function(){\n\t\tvar child = this.firstChild;\n\t\twhile(child){\n\t\t\tvar next = child.nextSibling;\n\t\t\tif(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){\n\t\t\t\tthis.removeChild(next);\n\t\t\t\tchild.appendData(next.data);\n\t\t\t}else{\n\t\t\t\tchild.normalize();\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t}\n\t},\n \t// Introduced in DOM Level 2:\n\tisSupported:function(feature, version){\n\t\treturn this.ownerDocument.implementation.hasFeature(feature,version);\n\t},\n // Introduced in DOM Level 2:\n hasAttributes:function(){\n \treturn this.attributes.length>0;\n },\n\t/**\n\t * Look up the prefix associated to the given namespace URI, starting from this node.\n\t * **The default namespace declarations are ignored by this method.**\n\t * See Namespace Prefix Lookup for details on the algorithm used by this method.\n\t *\n\t * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._\n\t *\n\t * @param {string | null} namespaceURI\n\t * @returns {string | null}\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo\n\t * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix\n\t * @see https://github.com/xmldom/xmldom/issues/322\n\t */\n lookupPrefix:function(namespaceURI){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tfor(var n in map){\n\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {\n\t\t\t\t\t\t\treturn n;\n\t\t\t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n lookupNamespaceURI:function(prefix){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tif(Object.prototype.hasOwnProperty.call(map, prefix)){\n \t\t\t\treturn map[prefix] ;\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n isDefaultNamespace:function(namespaceURI){\n \tvar prefix = this.lookupPrefix(namespaceURI);\n \treturn prefix == null;\n }\n};\n\n\nfunction _xmlEncoder(c){\n\treturn c == '<' && '<' ||\n c == '>' && '>' ||\n c == '&' && '&' ||\n c == '\"' && '"' ||\n '&#'+c.charCodeAt()+';'\n}\n\n\ncopy(NodeType,Node);\ncopy(NodeType,Node.prototype);\n\n/**\n * @param callback return true for continue,false for break\n * @return boolean true: break visit;\n */\nfunction _visitNode(node,callback){\n\tif(callback(node)){\n\t\treturn true;\n\t}\n\tif(node = node.firstChild){\n\t\tdo{\n\t\t\tif(_visitNode(node,callback)){return true}\n }while(node=node.nextSibling)\n }\n}\n\n\n\nfunction Document(){\n\tthis.ownerDocument = this;\n}\n\nfunction _onAddAttribute(doc,el,newAttr){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tel._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value\n\t}\n}\n\nfunction _onRemoveAttribute(doc,el,newAttr,remove){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tdelete el._nsMap[newAttr.prefix?newAttr.localName:'']\n\t}\n}\n\n/**\n * Updates `el.childNodes`, updating the indexed items and it's `length`.\n * Passing `newChild` means it will be appended.\n * Otherwise it's assumed that an item has been removed,\n * and `el.firstNode` and it's `.nextSibling` are used\n * to walk the current list of child nodes.\n *\n * @param {Document} doc\n * @param {Node} el\n * @param {Node} [newChild]\n * @private\n */\nfunction _onUpdateChild (doc, el, newChild) {\n\tif(doc && doc._inc){\n\t\tdoc._inc++;\n\t\t//update childNodes\n\t\tvar cs = el.childNodes;\n\t\tif (newChild) {\n\t\t\tcs[cs.length++] = newChild;\n\t\t} else {\n\t\t\tvar child = el.firstChild;\n\t\t\tvar i = 0;\n\t\t\twhile (child) {\n\t\t\t\tcs[i++] = child;\n\t\t\t\tchild = child.nextSibling;\n\t\t\t}\n\t\t\tcs.length = i;\n\t\t\tdelete cs[cs.length];\n\t\t}\n\t}\n}\n\n/**\n * Removes the connections between `parentNode` and `child`\n * and any existing `child.previousSibling` or `child.nextSibling`.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n *\n * @param {Node} parentNode\n * @param {Node} child\n * @returns {Node} the child that was removed.\n * @private\n */\nfunction _removeChild (parentNode, child) {\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif (previous) {\n\t\tprevious.nextSibling = next;\n\t} else {\n\t\tparentNode.firstChild = next;\n\t}\n\tif (next) {\n\t\tnext.previousSibling = previous;\n\t} else {\n\t\tparentNode.lastChild = previous;\n\t}\n\tchild.parentNode = null;\n\tchild.previousSibling = null;\n\tchild.nextSibling = null;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode);\n\treturn child;\n}\n\n/**\n * Returns `true` if `node` can be a parent for insertion.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasValidParentNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)\n\t);\n}\n\n/**\n * Returns `true` if `node` can be inserted according to it's `nodeType`.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasInsertableNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(isElementNode(node) ||\n\t\t\tisTextNode(node) ||\n\t\t\tisDocTypeNode(node) ||\n\t\t\tnode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||\n\t\t\tnode.nodeType === Node.COMMENT_NODE ||\n\t\t\tnode.nodeType === Node.PROCESSING_INSTRUCTION_NODE)\n\t);\n}\n\n/**\n * Returns true if `node` is a DOCTYPE node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isDocTypeNode(node) {\n\treturn node && node.nodeType === Node.DOCUMENT_TYPE_NODE;\n}\n\n/**\n * Returns true if the node is an element\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isElementNode(node) {\n\treturn node && node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Returns true if `node` is a text node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isTextNode(node) {\n\treturn node && node.nodeType === Node.TEXT_NODE;\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Document} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementInsertionPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\tif (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Node} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementReplacementPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\n\tfunction hasElementChildThatIsNotChild(node) {\n\t\treturn isElementNode(node) && node !== child;\n\t}\n\n\tif (find(parentChildNodes, hasElementChildThatIsNotChild)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * @private\n * Steps 1-5 of the checks before inserting and before replacing a child are the same.\n *\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidity1to5(parent, node, child) {\n\t// 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a \"HierarchyRequestError\" DOMException.\n\tif (!hasValidParentNodeType(parent)) {\n\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);\n\t}\n\t// 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a \"HierarchyRequestError\" DOMException.\n\t// not implemented!\n\t// 3. If `child` is non-null and its parent is not `parent`, then throw a \"NotFoundError\" DOMException.\n\tif (child && child.parentNode !== parent) {\n\t\tthrow new DOMException(NOT_FOUND_ERR, 'child not in parent');\n\t}\n\tif (\n\t\t// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a \"HierarchyRequestError\" DOMException.\n\t\t!hasInsertableNodeType(node) ||\n\t\t// 5. If either `node` is a Text node and `parent` is a document,\n\t\t// the sax parser currently adds top level text nodes, this will be fixed in 0.9.0\n\t\t// || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)\n\t\t// or `node` is a doctype and `parent` is not a document, then throw a \"HierarchyRequestError\" DOMException.\n\t\t(isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)\n\t) {\n\t\tthrow new DOMException(\n\t\t\tHIERARCHY_REQUEST_ERR,\n\t\t\t'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType\n\t\t);\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If node has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child,\n\t\t// `child` is a doctype, or `child` is non-null and a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child, `child` is a doctype,\n\t\t// or `child` is non-null and a doctype is following `child`.\n\t\tif (!isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\t// `parent` has a doctype child,\n\t\tif (find(parentChildNodes, isDocTypeNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// `child` is non-null and an element is preceding `child`,\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t\t// or `child` is null and `parent` has an element child.\n\t\tif (!child && parentElementChild) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreReplacementValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If `node` has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (!isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\tfunction hasDoctypeChildThatIsNotChild(node) {\n\t\t\treturn isDocTypeNode(node) && node !== child;\n\t\t}\n\n\t\t// `parent` has a doctype child that is not `child`,\n\t\tif (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// or an element is preceding `child`.\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction _insertBefore(parent, node, child, _inDocumentAssertion) {\n\t// To ensure pre-insertion validity of a node into a parent before a child, run these steps:\n\tassertPreInsertionValidity1to5(parent, node, child);\n\n\t// If parent is a document, and any of the statements below, switched on the interface node implements,\n\t// are true, then throw a \"HierarchyRequestError\" DOMException.\n\tif (parent.nodeType === Node.DOCUMENT_NODE) {\n\t\t(_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);\n\t}\n\n\tvar cp = node.parentNode;\n\tif(cp){\n\t\tcp.removeChild(node);//remove and update\n\t}\n\tif(node.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = node.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn node;\n\t\t}\n\t\tvar newLast = node.lastChild;\n\t}else{\n\t\tnewFirst = newLast = node;\n\t}\n\tvar pre = child ? child.previousSibling : parent.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = child;\n\n\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparent.firstChild = newFirst;\n\t}\n\tif(child == null){\n\t\tparent.lastChild = newLast;\n\t}else{\n\t\tchild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parent;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parent.ownerDocument||parent, parent);\n\t//console.log(parent.lastChild.nextSibling == null)\n\tif (node.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnode.firstChild = node.lastChild = null;\n\t}\n\treturn node;\n}\n\n/**\n * Appends `newChild` to `parentNode`.\n * If `newChild` is already connected to a `parentNode` it is first removed from it.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n * @param {Node} parentNode\n * @param {Node} newChild\n * @returns {Node}\n * @private\n */\nfunction _appendSingleChild (parentNode, newChild) {\n\tif (newChild.parentNode) {\n\t\tnewChild.parentNode.removeChild(newChild);\n\t}\n\tnewChild.parentNode = parentNode;\n\tnewChild.previousSibling = parentNode.lastChild;\n\tnewChild.nextSibling = null;\n\tif (newChild.previousSibling) {\n\t\tnewChild.previousSibling.nextSibling = newChild;\n\t} else {\n\t\tparentNode.firstChild = newChild;\n\t}\n\tparentNode.lastChild = newChild;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode, newChild);\n\treturn newChild;\n}\n\nDocument.prototype = {\n\t//implementation : null,\n\tnodeName : '#document',\n\tnodeType : DOCUMENT_NODE,\n\t/**\n\t * The DocumentType node of the document.\n\t *\n\t * @readonly\n\t * @type DocumentType\n\t */\n\tdoctype : null,\n\tdocumentElement : null,\n\t_inc : 1,\n\n\tinsertBefore : function(newChild, refChild){//raises\n\t\tif(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){\n\t\t\tvar child = newChild.firstChild;\n\t\t\twhile(child){\n\t\t\t\tvar next = child.nextSibling;\n\t\t\t\tthis.insertBefore(child,refChild);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\treturn newChild;\n\t\t}\n\t\t_insertBefore(this, newChild, refChild);\n\t\tnewChild.ownerDocument = this;\n\t\tif (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\n\t\treturn newChild;\n\t},\n\tremoveChild : function(oldChild){\n\t\tif(this.documentElement == oldChild){\n\t\t\tthis.documentElement = null;\n\t\t}\n\t\treturn _removeChild(this,oldChild);\n\t},\n\treplaceChild: function (newChild, oldChild) {\n\t\t//raises\n\t\t_insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);\n\t\tnewChild.ownerDocument = this;\n\t\tif (oldChild) {\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t\tif (isElementNode(newChild)) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\t},\n\t// Introduced in DOM Level 2:\n\timportNode : function(importedNode,deep){\n\t\treturn importNode(this,importedNode,deep);\n\t},\n\t// Introduced in DOM Level 2:\n\tgetElementById :\tfunction(id){\n\t\tvar rtv = null;\n\t\t_visitNode(this.documentElement,function(node){\n\t\t\tif(node.nodeType == ELEMENT_NODE){\n\t\t\t\tif(node.getAttribute('id') == id){\n\t\t\t\t\trtv = node;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\treturn rtv;\n\t},\n\n\t/**\n\t * The `getElementsByClassName` method of `Document` interface returns an array-like object\n\t * of all child elements which have **all** of the given class name(s).\n\t *\n\t * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.\n\t *\n\t *\n\t * Warning: This is a live LiveNodeList.\n\t * Changes in the DOM will reflect in the array as the changes occur.\n\t * If an element selected by this array no longer qualifies for the selector,\n\t * it will automatically be removed. Be aware of this for iteration purposes.\n\t *\n\t * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName\n\t * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname\n\t */\n\tgetElementsByClassName: function(classNames) {\n\t\tvar classNamesSet = toOrderedSet(classNames)\n\t\treturn new LiveNodeList(this, function(base) {\n\t\t\tvar ls = [];\n\t\t\tif (classNamesSet.length > 0) {\n\t\t\t\t_visitNode(base.documentElement, function(node) {\n\t\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE) {\n\t\t\t\t\t\tvar nodeClassNames = node.getAttribute('class')\n\t\t\t\t\t\t// can be null if the attribute does not exist\n\t\t\t\t\t\tif (nodeClassNames) {\n\t\t\t\t\t\t\t// before splitting and iterating just compare them for the most common case\n\t\t\t\t\t\t\tvar matches = classNames === nodeClassNames;\n\t\t\t\t\t\t\tif (!matches) {\n\t\t\t\t\t\t\t\tvar nodeClassNamesSet = toOrderedSet(nodeClassNames)\n\t\t\t\t\t\t\t\tmatches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(matches) {\n\t\t\t\t\t\t\t\tls.push(node);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn ls;\n\t\t});\n\t},\n\n\t//document factory method:\n\tcreateElement :\tfunction(tagName){\n\t\tvar node = new Element();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = tagName;\n\t\tnode.tagName = tagName;\n\t\tnode.localName = tagName;\n\t\tnode.childNodes = new NodeList();\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\tcreateDocumentFragment :\tfunction(){\n\t\tvar node = new DocumentFragment();\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\treturn node;\n\t},\n\tcreateTextNode :\tfunction(data){\n\t\tvar node = new Text();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateComment :\tfunction(data){\n\t\tvar node = new Comment();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateCDATASection :\tfunction(data){\n\t\tvar node = new CDATASection();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateProcessingInstruction :\tfunction(target,data){\n\t\tvar node = new ProcessingInstruction();\n\t\tnode.ownerDocument = this;\n\t\tnode.tagName = node.nodeName = node.target = target;\n\t\tnode.nodeValue = node.data = data;\n\t\treturn node;\n\t},\n\tcreateAttribute :\tfunction(name){\n\t\tvar node = new Attr();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.name = name;\n\t\tnode.nodeName\t= name;\n\t\tnode.localName = name;\n\t\tnode.specified = true;\n\t\treturn node;\n\t},\n\tcreateEntityReference :\tfunction(name){\n\t\tvar node = new EntityReference();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.nodeName\t= name;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateElementNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Element();\n\t\tvar pl = qualifiedName.split(':');\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tnode.childNodes = new NodeList();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.tagName = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateAttributeNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Attr();\n\t\tvar pl = qualifiedName.split(':');\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.name = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tnode.specified = true;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\treturn node;\n\t}\n};\n_extends(Document,Node);\n\n\nfunction Element() {\n\tthis._nsMap = {};\n};\nElement.prototype = {\n\tnodeType : ELEMENT_NODE,\n\thasAttribute : function(name){\n\t\treturn this.getAttributeNode(name)!=null;\n\t},\n\tgetAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name);\n\t\treturn attr && attr.value || '';\n\t},\n\tgetAttributeNode : function(name){\n\t\treturn this.attributes.getNamedItem(name);\n\t},\n\tsetAttribute : function(name, value){\n\t\tvar attr = this.ownerDocument.createAttribute(name);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tremoveAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name)\n\t\tattr && this.removeAttributeNode(attr);\n\t},\n\n\t//four real opeartion method\n\tappendChild:function(newChild){\n\t\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\t\treturn this.insertBefore(newChild,null);\n\t\t}else{\n\t\t\treturn _appendSingleChild(this,newChild);\n\t\t}\n\t},\n\tsetAttributeNode : function(newAttr){\n\t\treturn this.attributes.setNamedItem(newAttr);\n\t},\n\tsetAttributeNodeNS : function(newAttr){\n\t\treturn this.attributes.setNamedItemNS(newAttr);\n\t},\n\tremoveAttributeNode : function(oldAttr){\n\t\t//console.log(this == oldAttr.ownerElement)\n\t\treturn this.attributes.removeNamedItem(oldAttr.nodeName);\n\t},\n\t//get real attribute name,and remove it by removeAttributeNode\n\tremoveAttributeNS : function(namespaceURI, localName){\n\t\tvar old = this.getAttributeNodeNS(namespaceURI, localName);\n\t\told && this.removeAttributeNode(old);\n\t},\n\n\thasAttributeNS : function(namespaceURI, localName){\n\t\treturn this.getAttributeNodeNS(namespaceURI, localName)!=null;\n\t},\n\tgetAttributeNS : function(namespaceURI, localName){\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\treturn attr && attr.value || '';\n\t},\n\tsetAttributeNS : function(namespaceURI, qualifiedName, value){\n\t\tvar attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tgetAttributeNodeNS : function(namespaceURI, localName){\n\t\treturn this.attributes.getNamedItemNS(namespaceURI, localName);\n\t},\n\n\tgetElementsByTagName : function(tagName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n\tgetElementsByTagNameNS : function(namespaceURI, localName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\n\t\t});\n\t}\n};\nDocument.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;\nDocument.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;\n\n\n_extends(Element,Node);\nfunction Attr() {\n};\nAttr.prototype.nodeType = ATTRIBUTE_NODE;\n_extends(Attr,Node);\n\n\nfunction CharacterData() {\n};\nCharacterData.prototype = {\n\tdata : '',\n\tsubstringData : function(offset, count) {\n\t\treturn this.data.substring(offset, offset+count);\n\t},\n\tappendData: function(text) {\n\t\ttext = this.data+text;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n\tinsertData: function(offset,text) {\n\t\tthis.replaceData(offset,0,text);\n\n\t},\n\tappendChild:function(newChild){\n\t\tthrow new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])\n\t},\n\tdeleteData: function(offset, count) {\n\t\tthis.replaceData(offset,count,\"\");\n\t},\n\treplaceData: function(offset, count, text) {\n\t\tvar start = this.data.substring(0,offset);\n\t\tvar end = this.data.substring(offset+count);\n\t\ttext = start + text + end;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t}\n}\n_extends(CharacterData,Node);\nfunction Text() {\n};\nText.prototype = {\n\tnodeName : \"#text\",\n\tnodeType : TEXT_NODE,\n\tsplitText : function(offset) {\n\t\tvar text = this.data;\n\t\tvar newText = text.substring(offset);\n\t\ttext = text.substring(0, offset);\n\t\tthis.data = this.nodeValue = text;\n\t\tthis.length = text.length;\n\t\tvar newNode = this.ownerDocument.createTextNode(newText);\n\t\tif(this.parentNode){\n\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);\n\t\t}\n\t\treturn newNode;\n\t}\n}\n_extends(Text,CharacterData);\nfunction Comment() {\n};\nComment.prototype = {\n\tnodeName : \"#comment\",\n\tnodeType : COMMENT_NODE\n}\n_extends(Comment,CharacterData);\n\nfunction CDATASection() {\n};\nCDATASection.prototype = {\n\tnodeName : \"#cdata-section\",\n\tnodeType : CDATA_SECTION_NODE\n}\n_extends(CDATASection,CharacterData);\n\n\nfunction DocumentType() {\n};\nDocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;\n_extends(DocumentType,Node);\n\nfunction Notation() {\n};\nNotation.prototype.nodeType = NOTATION_NODE;\n_extends(Notation,Node);\n\nfunction Entity() {\n};\nEntity.prototype.nodeType = ENTITY_NODE;\n_extends(Entity,Node);\n\nfunction EntityReference() {\n};\nEntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;\n_extends(EntityReference,Node);\n\nfunction DocumentFragment() {\n};\nDocumentFragment.prototype.nodeName =\t\"#document-fragment\";\nDocumentFragment.prototype.nodeType =\tDOCUMENT_FRAGMENT_NODE;\n_extends(DocumentFragment,Node);\n\n\nfunction ProcessingInstruction() {\n}\nProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;\n_extends(ProcessingInstruction,Node);\nfunction XMLSerializer(){}\nXMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){\n\treturn nodeSerializeToString.call(node,isHtml,nodeFilter);\n}\nNode.prototype.toString = nodeSerializeToString;\nfunction nodeSerializeToString(isHtml,nodeFilter){\n\tvar buf = [];\n\tvar refNode = this.nodeType == 9 && this.documentElement || this;\n\tvar prefix = refNode.prefix;\n\tvar uri = refNode.namespaceURI;\n\n\tif(uri && prefix == null){\n\t\t//console.log(prefix)\n\t\tvar prefix = refNode.lookupPrefix(uri);\n\t\tif(prefix == null){\n\t\t\t//isHTML = true;\n\t\t\tvar visibleNamespaces=[\n\t\t\t{namespace:uri,prefix:null}\n\t\t\t//{namespace:uri,prefix:''}\n\t\t\t]\n\t\t}\n\t}\n\tserializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);\n\t//console.log('###',this.nodeType,uri,prefix,buf.join(''))\n\treturn buf.join('');\n}\n\nfunction needNamespaceDefine(node, isHTML, visibleNamespaces) {\n\tvar prefix = node.prefix || '';\n\tvar uri = node.namespaceURI;\n\t// According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,\n\t// and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :\n\t// > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.\n\t// in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)\n\t// and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :\n\t// > [...] Furthermore, the attribute value [...] must not be an empty string.\n\t// so serializing empty namespace value like xmlns:ds=\"\" would produce an invalid XML document.\n\tif (!uri) {\n\t\treturn false;\n\t}\n\tif (prefix === \"xml\" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {\n\t\treturn false;\n\t}\n\n\tvar i = visibleNamespaces.length\n\twhile (i--) {\n\t\tvar ns = visibleNamespaces[i];\n\t\t// get namespace prefix\n\t\tif (ns.prefix === prefix) {\n\t\t\treturn ns.namespace !== uri;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n * Well-formed constraint: No < in Attribute Values\n * > The replacement text of any entity referred to directly or indirectly\n * > in an attribute value must not contain a <.\n * @see https://www.w3.org/TR/xml11/#CleanAttrVals\n * @see https://www.w3.org/TR/xml11/#NT-AttValue\n *\n * Literal whitespace other than space that appear in attribute values\n * are serialized as their entity references, so they will be preserved.\n * (In contrast to whitespace literals in the input which are normalized to spaces)\n * @see https://www.w3.org/TR/xml11/#AVNormalize\n * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes\n */\nfunction addSerializedAttribute(buf, qualifiedName, value) {\n\tbuf.push(' ', qualifiedName, '=\"', value.replace(/[<>&\"\\t\\n\\r]/g, _xmlEncoder), '\"')\n}\n\nfunction serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){\n\tif (!visibleNamespaces) {\n\t\tvisibleNamespaces = [];\n\t}\n\n\tif(nodeFilter){\n\t\tnode = nodeFilter(node);\n\t\tif(node){\n\t\t\tif(typeof node == 'string'){\n\t\t\t\tbuf.push(node);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t//buf.sort.apply(attrs, attributeSorter);\n\t}\n\n\tswitch(node.nodeType){\n\tcase ELEMENT_NODE:\n\t\tvar attrs = node.attributes;\n\t\tvar len = attrs.length;\n\t\tvar child = node.firstChild;\n\t\tvar nodeName = node.tagName;\n\n\t\tisHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML\n\n\t\tvar prefixedNodeName = nodeName\n\t\tif (!isHTML && !node.prefix && node.namespaceURI) {\n\t\t\tvar defaultNS\n\t\t\t// lookup current default ns from `xmlns` attribute\n\t\t\tfor (var ai = 0; ai < attrs.length; ai++) {\n\t\t\t\tif (attrs.item(ai).name === 'xmlns') {\n\t\t\t\t\tdefaultNS = attrs.item(ai).value\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!defaultNS) {\n\t\t\t\t// lookup current default ns in visibleNamespaces\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tdefaultNS = namespace.namespace\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (defaultNS !== node.namespaceURI) {\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tif (namespace.prefix) {\n\t\t\t\t\t\t\tprefixedNodeName = namespace.prefix + ':' + nodeName\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuf.push('<', prefixedNodeName);\n\n\t\tfor(var i=0;i');\n\t\t\t//if is cdata child node\n\t\t\tif(isHTML && /^script$/i.test(nodeName)){\n\t\t\t\twhile(child){\n\t\t\t\t\tif(child.data){\n\t\t\t\t\t\tbuf.push(child.data);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\t}\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\twhile(child){\n\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf.push('');\n\t\t}else{\n\t\t\tbuf.push('/>');\n\t\t}\n\t\t// remove added visible namespaces\n\t\t//visibleNamespaces.length = startVisibleNamespaces;\n\t\treturn;\n\tcase DOCUMENT_NODE:\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t\treturn;\n\tcase ATTRIBUTE_NODE:\n\t\treturn addSerializedAttribute(buf, node.name, node.value);\n\tcase TEXT_NODE:\n\t\t/**\n\t\t * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,\n\t\t * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.\n\t\t * If they are needed elsewhere, they must be escaped using either numeric character references or the strings\n\t\t * `&` and `<` respectively.\n\t\t * The right angle bracket (>) may be represented using the string \" > \", and must, for compatibility,\n\t\t * be escaped using either `>` or a character reference when it appears in the string `]]>` in content,\n\t\t * when that string is not marking the end of a CDATA section.\n\t\t *\n\t\t * In the content of elements, character data is any string of characters\n\t\t * which does not contain the start-delimiter of any markup\n\t\t * and does not include the CDATA-section-close delimiter, `]]>`.\n\t\t *\n\t\t * @see https://www.w3.org/TR/xml/#NT-CharData\n\t\t * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node\n\t\t */\n\t\treturn buf.push(node.data\n\t\t\t.replace(/[<&>]/g,_xmlEncoder)\n\t\t);\n\tcase CDATA_SECTION_NODE:\n\t\treturn buf.push( '');\n\tcase COMMENT_NODE:\n\t\treturn buf.push( \"\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM ', sysid, '>');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i',\n\tlt: '<',\n\tquot: '\"',\n});\n\n/**\n * A map of all entities that are detected in an HTML document.\n * They contain all entries from `XML_ENTITIES`.\n *\n * @see XML_ENTITIES\n * @see DOMParser.parseFromString\n * @see DOMImplementation.prototype.createHTMLDocument\n * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec\n * @see https://html.spec.whatwg.org/entities.json JSON\n * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names\n * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)\n */\nexports.HTML_ENTITIES = freeze({\n\tAacute: '\\u00C1',\n\taacute: '\\u00E1',\n\tAbreve: '\\u0102',\n\tabreve: '\\u0103',\n\tac: '\\u223E',\n\tacd: '\\u223F',\n\tacE: '\\u223E\\u0333',\n\tAcirc: '\\u00C2',\n\tacirc: '\\u00E2',\n\tacute: '\\u00B4',\n\tAcy: '\\u0410',\n\tacy: '\\u0430',\n\tAElig: '\\u00C6',\n\taelig: '\\u00E6',\n\taf: '\\u2061',\n\tAfr: '\\uD835\\uDD04',\n\tafr: '\\uD835\\uDD1E',\n\tAgrave: '\\u00C0',\n\tagrave: '\\u00E0',\n\talefsym: '\\u2135',\n\taleph: '\\u2135',\n\tAlpha: '\\u0391',\n\talpha: '\\u03B1',\n\tAmacr: '\\u0100',\n\tamacr: '\\u0101',\n\tamalg: '\\u2A3F',\n\tAMP: '\\u0026',\n\tamp: '\\u0026',\n\tAnd: '\\u2A53',\n\tand: '\\u2227',\n\tandand: '\\u2A55',\n\tandd: '\\u2A5C',\n\tandslope: '\\u2A58',\n\tandv: '\\u2A5A',\n\tang: '\\u2220',\n\tange: '\\u29A4',\n\tangle: '\\u2220',\n\tangmsd: '\\u2221',\n\tangmsdaa: '\\u29A8',\n\tangmsdab: '\\u29A9',\n\tangmsdac: '\\u29AA',\n\tangmsdad: '\\u29AB',\n\tangmsdae: '\\u29AC',\n\tangmsdaf: '\\u29AD',\n\tangmsdag: '\\u29AE',\n\tangmsdah: '\\u29AF',\n\tangrt: '\\u221F',\n\tangrtvb: '\\u22BE',\n\tangrtvbd: '\\u299D',\n\tangsph: '\\u2222',\n\tangst: '\\u00C5',\n\tangzarr: '\\u237C',\n\tAogon: '\\u0104',\n\taogon: '\\u0105',\n\tAopf: '\\uD835\\uDD38',\n\taopf: '\\uD835\\uDD52',\n\tap: '\\u2248',\n\tapacir: '\\u2A6F',\n\tapE: '\\u2A70',\n\tape: '\\u224A',\n\tapid: '\\u224B',\n\tapos: '\\u0027',\n\tApplyFunction: '\\u2061',\n\tapprox: '\\u2248',\n\tapproxeq: '\\u224A',\n\tAring: '\\u00C5',\n\taring: '\\u00E5',\n\tAscr: '\\uD835\\uDC9C',\n\tascr: '\\uD835\\uDCB6',\n\tAssign: '\\u2254',\n\tast: '\\u002A',\n\tasymp: '\\u2248',\n\tasympeq: '\\u224D',\n\tAtilde: '\\u00C3',\n\tatilde: '\\u00E3',\n\tAuml: '\\u00C4',\n\tauml: '\\u00E4',\n\tawconint: '\\u2233',\n\tawint: '\\u2A11',\n\tbackcong: '\\u224C',\n\tbackepsilon: '\\u03F6',\n\tbackprime: '\\u2035',\n\tbacksim: '\\u223D',\n\tbacksimeq: '\\u22CD',\n\tBackslash: '\\u2216',\n\tBarv: '\\u2AE7',\n\tbarvee: '\\u22BD',\n\tBarwed: '\\u2306',\n\tbarwed: '\\u2305',\n\tbarwedge: '\\u2305',\n\tbbrk: '\\u23B5',\n\tbbrktbrk: '\\u23B6',\n\tbcong: '\\u224C',\n\tBcy: '\\u0411',\n\tbcy: '\\u0431',\n\tbdquo: '\\u201E',\n\tbecaus: '\\u2235',\n\tBecause: '\\u2235',\n\tbecause: '\\u2235',\n\tbemptyv: '\\u29B0',\n\tbepsi: '\\u03F6',\n\tbernou: '\\u212C',\n\tBernoullis: '\\u212C',\n\tBeta: '\\u0392',\n\tbeta: '\\u03B2',\n\tbeth: '\\u2136',\n\tbetween: '\\u226C',\n\tBfr: '\\uD835\\uDD05',\n\tbfr: '\\uD835\\uDD1F',\n\tbigcap: '\\u22C2',\n\tbigcirc: '\\u25EF',\n\tbigcup: '\\u22C3',\n\tbigodot: '\\u2A00',\n\tbigoplus: '\\u2A01',\n\tbigotimes: '\\u2A02',\n\tbigsqcup: '\\u2A06',\n\tbigstar: '\\u2605',\n\tbigtriangledown: '\\u25BD',\n\tbigtriangleup: '\\u25B3',\n\tbiguplus: '\\u2A04',\n\tbigvee: '\\u22C1',\n\tbigwedge: '\\u22C0',\n\tbkarow: '\\u290D',\n\tblacklozenge: '\\u29EB',\n\tblacksquare: '\\u25AA',\n\tblacktriangle: '\\u25B4',\n\tblacktriangledown: '\\u25BE',\n\tblacktriangleleft: '\\u25C2',\n\tblacktriangleright: '\\u25B8',\n\tblank: '\\u2423',\n\tblk12: '\\u2592',\n\tblk14: '\\u2591',\n\tblk34: '\\u2593',\n\tblock: '\\u2588',\n\tbne: '\\u003D\\u20E5',\n\tbnequiv: '\\u2261\\u20E5',\n\tbNot: '\\u2AED',\n\tbnot: '\\u2310',\n\tBopf: '\\uD835\\uDD39',\n\tbopf: '\\uD835\\uDD53',\n\tbot: '\\u22A5',\n\tbottom: '\\u22A5',\n\tbowtie: '\\u22C8',\n\tboxbox: '\\u29C9',\n\tboxDL: '\\u2557',\n\tboxDl: '\\u2556',\n\tboxdL: '\\u2555',\n\tboxdl: '\\u2510',\n\tboxDR: '\\u2554',\n\tboxDr: '\\u2553',\n\tboxdR: '\\u2552',\n\tboxdr: '\\u250C',\n\tboxH: '\\u2550',\n\tboxh: '\\u2500',\n\tboxHD: '\\u2566',\n\tboxHd: '\\u2564',\n\tboxhD: '\\u2565',\n\tboxhd: '\\u252C',\n\tboxHU: '\\u2569',\n\tboxHu: '\\u2567',\n\tboxhU: '\\u2568',\n\tboxhu: '\\u2534',\n\tboxminus: '\\u229F',\n\tboxplus: '\\u229E',\n\tboxtimes: '\\u22A0',\n\tboxUL: '\\u255D',\n\tboxUl: '\\u255C',\n\tboxuL: '\\u255B',\n\tboxul: '\\u2518',\n\tboxUR: '\\u255A',\n\tboxUr: '\\u2559',\n\tboxuR: '\\u2558',\n\tboxur: '\\u2514',\n\tboxV: '\\u2551',\n\tboxv: '\\u2502',\n\tboxVH: '\\u256C',\n\tboxVh: '\\u256B',\n\tboxvH: '\\u256A',\n\tboxvh: '\\u253C',\n\tboxVL: '\\u2563',\n\tboxVl: '\\u2562',\n\tboxvL: '\\u2561',\n\tboxvl: '\\u2524',\n\tboxVR: '\\u2560',\n\tboxVr: '\\u255F',\n\tboxvR: '\\u255E',\n\tboxvr: '\\u251C',\n\tbprime: '\\u2035',\n\tBreve: '\\u02D8',\n\tbreve: '\\u02D8',\n\tbrvbar: '\\u00A6',\n\tBscr: '\\u212C',\n\tbscr: '\\uD835\\uDCB7',\n\tbsemi: '\\u204F',\n\tbsim: '\\u223D',\n\tbsime: '\\u22CD',\n\tbsol: '\\u005C',\n\tbsolb: '\\u29C5',\n\tbsolhsub: '\\u27C8',\n\tbull: '\\u2022',\n\tbullet: '\\u2022',\n\tbump: '\\u224E',\n\tbumpE: '\\u2AAE',\n\tbumpe: '\\u224F',\n\tBumpeq: '\\u224E',\n\tbumpeq: '\\u224F',\n\tCacute: '\\u0106',\n\tcacute: '\\u0107',\n\tCap: '\\u22D2',\n\tcap: '\\u2229',\n\tcapand: '\\u2A44',\n\tcapbrcup: '\\u2A49',\n\tcapcap: '\\u2A4B',\n\tcapcup: '\\u2A47',\n\tcapdot: '\\u2A40',\n\tCapitalDifferentialD: '\\u2145',\n\tcaps: '\\u2229\\uFE00',\n\tcaret: '\\u2041',\n\tcaron: '\\u02C7',\n\tCayleys: '\\u212D',\n\tccaps: '\\u2A4D',\n\tCcaron: '\\u010C',\n\tccaron: '\\u010D',\n\tCcedil: '\\u00C7',\n\tccedil: '\\u00E7',\n\tCcirc: '\\u0108',\n\tccirc: '\\u0109',\n\tCconint: '\\u2230',\n\tccups: '\\u2A4C',\n\tccupssm: '\\u2A50',\n\tCdot: '\\u010A',\n\tcdot: '\\u010B',\n\tcedil: '\\u00B8',\n\tCedilla: '\\u00B8',\n\tcemptyv: '\\u29B2',\n\tcent: '\\u00A2',\n\tCenterDot: '\\u00B7',\n\tcenterdot: '\\u00B7',\n\tCfr: '\\u212D',\n\tcfr: '\\uD835\\uDD20',\n\tCHcy: '\\u0427',\n\tchcy: '\\u0447',\n\tcheck: '\\u2713',\n\tcheckmark: '\\u2713',\n\tChi: '\\u03A7',\n\tchi: '\\u03C7',\n\tcir: '\\u25CB',\n\tcirc: '\\u02C6',\n\tcirceq: '\\u2257',\n\tcirclearrowleft: '\\u21BA',\n\tcirclearrowright: '\\u21BB',\n\tcircledast: '\\u229B',\n\tcircledcirc: '\\u229A',\n\tcircleddash: '\\u229D',\n\tCircleDot: '\\u2299',\n\tcircledR: '\\u00AE',\n\tcircledS: '\\u24C8',\n\tCircleMinus: '\\u2296',\n\tCirclePlus: '\\u2295',\n\tCircleTimes: '\\u2297',\n\tcirE: '\\u29C3',\n\tcire: '\\u2257',\n\tcirfnint: '\\u2A10',\n\tcirmid: '\\u2AEF',\n\tcirscir: '\\u29C2',\n\tClockwiseContourIntegral: '\\u2232',\n\tCloseCurlyDoubleQuote: '\\u201D',\n\tCloseCurlyQuote: '\\u2019',\n\tclubs: '\\u2663',\n\tclubsuit: '\\u2663',\n\tColon: '\\u2237',\n\tcolon: '\\u003A',\n\tColone: '\\u2A74',\n\tcolone: '\\u2254',\n\tcoloneq: '\\u2254',\n\tcomma: '\\u002C',\n\tcommat: '\\u0040',\n\tcomp: '\\u2201',\n\tcompfn: '\\u2218',\n\tcomplement: '\\u2201',\n\tcomplexes: '\\u2102',\n\tcong: '\\u2245',\n\tcongdot: '\\u2A6D',\n\tCongruent: '\\u2261',\n\tConint: '\\u222F',\n\tconint: '\\u222E',\n\tContourIntegral: '\\u222E',\n\tCopf: '\\u2102',\n\tcopf: '\\uD835\\uDD54',\n\tcoprod: '\\u2210',\n\tCoproduct: '\\u2210',\n\tCOPY: '\\u00A9',\n\tcopy: '\\u00A9',\n\tcopysr: '\\u2117',\n\tCounterClockwiseContourIntegral: '\\u2233',\n\tcrarr: '\\u21B5',\n\tCross: '\\u2A2F',\n\tcross: '\\u2717',\n\tCscr: '\\uD835\\uDC9E',\n\tcscr: '\\uD835\\uDCB8',\n\tcsub: '\\u2ACF',\n\tcsube: '\\u2AD1',\n\tcsup: '\\u2AD0',\n\tcsupe: '\\u2AD2',\n\tctdot: '\\u22EF',\n\tcudarrl: '\\u2938',\n\tcudarrr: '\\u2935',\n\tcuepr: '\\u22DE',\n\tcuesc: '\\u22DF',\n\tcularr: '\\u21B6',\n\tcularrp: '\\u293D',\n\tCup: '\\u22D3',\n\tcup: '\\u222A',\n\tcupbrcap: '\\u2A48',\n\tCupCap: '\\u224D',\n\tcupcap: '\\u2A46',\n\tcupcup: '\\u2A4A',\n\tcupdot: '\\u228D',\n\tcupor: '\\u2A45',\n\tcups: '\\u222A\\uFE00',\n\tcurarr: '\\u21B7',\n\tcurarrm: '\\u293C',\n\tcurlyeqprec: '\\u22DE',\n\tcurlyeqsucc: '\\u22DF',\n\tcurlyvee: '\\u22CE',\n\tcurlywedge: '\\u22CF',\n\tcurren: '\\u00A4',\n\tcurvearrowleft: '\\u21B6',\n\tcurvearrowright: '\\u21B7',\n\tcuvee: '\\u22CE',\n\tcuwed: '\\u22CF',\n\tcwconint: '\\u2232',\n\tcwint: '\\u2231',\n\tcylcty: '\\u232D',\n\tDagger: '\\u2021',\n\tdagger: '\\u2020',\n\tdaleth: '\\u2138',\n\tDarr: '\\u21A1',\n\tdArr: '\\u21D3',\n\tdarr: '\\u2193',\n\tdash: '\\u2010',\n\tDashv: '\\u2AE4',\n\tdashv: '\\u22A3',\n\tdbkarow: '\\u290F',\n\tdblac: '\\u02DD',\n\tDcaron: '\\u010E',\n\tdcaron: '\\u010F',\n\tDcy: '\\u0414',\n\tdcy: '\\u0434',\n\tDD: '\\u2145',\n\tdd: '\\u2146',\n\tddagger: '\\u2021',\n\tddarr: '\\u21CA',\n\tDDotrahd: '\\u2911',\n\tddotseq: '\\u2A77',\n\tdeg: '\\u00B0',\n\tDel: '\\u2207',\n\tDelta: '\\u0394',\n\tdelta: '\\u03B4',\n\tdemptyv: '\\u29B1',\n\tdfisht: '\\u297F',\n\tDfr: '\\uD835\\uDD07',\n\tdfr: '\\uD835\\uDD21',\n\tdHar: '\\u2965',\n\tdharl: '\\u21C3',\n\tdharr: '\\u21C2',\n\tDiacriticalAcute: '\\u00B4',\n\tDiacriticalDot: '\\u02D9',\n\tDiacriticalDoubleAcute: '\\u02DD',\n\tDiacriticalGrave: '\\u0060',\n\tDiacriticalTilde: '\\u02DC',\n\tdiam: '\\u22C4',\n\tDiamond: '\\u22C4',\n\tdiamond: '\\u22C4',\n\tdiamondsuit: '\\u2666',\n\tdiams: '\\u2666',\n\tdie: '\\u00A8',\n\tDifferentialD: '\\u2146',\n\tdigamma: '\\u03DD',\n\tdisin: '\\u22F2',\n\tdiv: '\\u00F7',\n\tdivide: '\\u00F7',\n\tdivideontimes: '\\u22C7',\n\tdivonx: '\\u22C7',\n\tDJcy: '\\u0402',\n\tdjcy: '\\u0452',\n\tdlcorn: '\\u231E',\n\tdlcrop: '\\u230D',\n\tdollar: '\\u0024',\n\tDopf: '\\uD835\\uDD3B',\n\tdopf: '\\uD835\\uDD55',\n\tDot: '\\u00A8',\n\tdot: '\\u02D9',\n\tDotDot: '\\u20DC',\n\tdoteq: '\\u2250',\n\tdoteqdot: '\\u2251',\n\tDotEqual: '\\u2250',\n\tdotminus: '\\u2238',\n\tdotplus: '\\u2214',\n\tdotsquare: '\\u22A1',\n\tdoublebarwedge: '\\u2306',\n\tDoubleContourIntegral: '\\u222F',\n\tDoubleDot: '\\u00A8',\n\tDoubleDownArrow: '\\u21D3',\n\tDoubleLeftArrow: '\\u21D0',\n\tDoubleLeftRightArrow: '\\u21D4',\n\tDoubleLeftTee: '\\u2AE4',\n\tDoubleLongLeftArrow: '\\u27F8',\n\tDoubleLongLeftRightArrow: '\\u27FA',\n\tDoubleLongRightArrow: '\\u27F9',\n\tDoubleRightArrow: '\\u21D2',\n\tDoubleRightTee: '\\u22A8',\n\tDoubleUpArrow: '\\u21D1',\n\tDoubleUpDownArrow: '\\u21D5',\n\tDoubleVerticalBar: '\\u2225',\n\tDownArrow: '\\u2193',\n\tDownarrow: '\\u21D3',\n\tdownarrow: '\\u2193',\n\tDownArrowBar: '\\u2913',\n\tDownArrowUpArrow: '\\u21F5',\n\tDownBreve: '\\u0311',\n\tdowndownarrows: '\\u21CA',\n\tdownharpoonleft: '\\u21C3',\n\tdownharpoonright: '\\u21C2',\n\tDownLeftRightVector: '\\u2950',\n\tDownLeftTeeVector: '\\u295E',\n\tDownLeftVector: '\\u21BD',\n\tDownLeftVectorBar: '\\u2956',\n\tDownRightTeeVector: '\\u295F',\n\tDownRightVector: '\\u21C1',\n\tDownRightVectorBar: '\\u2957',\n\tDownTee: '\\u22A4',\n\tDownTeeArrow: '\\u21A7',\n\tdrbkarow: '\\u2910',\n\tdrcorn: '\\u231F',\n\tdrcrop: '\\u230C',\n\tDscr: '\\uD835\\uDC9F',\n\tdscr: '\\uD835\\uDCB9',\n\tDScy: '\\u0405',\n\tdscy: '\\u0455',\n\tdsol: '\\u29F6',\n\tDstrok: '\\u0110',\n\tdstrok: '\\u0111',\n\tdtdot: '\\u22F1',\n\tdtri: '\\u25BF',\n\tdtrif: '\\u25BE',\n\tduarr: '\\u21F5',\n\tduhar: '\\u296F',\n\tdwangle: '\\u29A6',\n\tDZcy: '\\u040F',\n\tdzcy: '\\u045F',\n\tdzigrarr: '\\u27FF',\n\tEacute: '\\u00C9',\n\teacute: '\\u00E9',\n\teaster: '\\u2A6E',\n\tEcaron: '\\u011A',\n\tecaron: '\\u011B',\n\tecir: '\\u2256',\n\tEcirc: '\\u00CA',\n\tecirc: '\\u00EA',\n\tecolon: '\\u2255',\n\tEcy: '\\u042D',\n\tecy: '\\u044D',\n\teDDot: '\\u2A77',\n\tEdot: '\\u0116',\n\teDot: '\\u2251',\n\tedot: '\\u0117',\n\tee: '\\u2147',\n\tefDot: '\\u2252',\n\tEfr: '\\uD835\\uDD08',\n\tefr: '\\uD835\\uDD22',\n\teg: '\\u2A9A',\n\tEgrave: '\\u00C8',\n\tegrave: '\\u00E8',\n\tegs: '\\u2A96',\n\tegsdot: '\\u2A98',\n\tel: '\\u2A99',\n\tElement: '\\u2208',\n\telinters: '\\u23E7',\n\tell: '\\u2113',\n\tels: '\\u2A95',\n\telsdot: '\\u2A97',\n\tEmacr: '\\u0112',\n\temacr: '\\u0113',\n\tempty: '\\u2205',\n\temptyset: '\\u2205',\n\tEmptySmallSquare: '\\u25FB',\n\temptyv: '\\u2205',\n\tEmptyVerySmallSquare: '\\u25AB',\n\temsp: '\\u2003',\n\temsp13: '\\u2004',\n\temsp14: '\\u2005',\n\tENG: '\\u014A',\n\teng: '\\u014B',\n\tensp: '\\u2002',\n\tEogon: '\\u0118',\n\teogon: '\\u0119',\n\tEopf: '\\uD835\\uDD3C',\n\teopf: '\\uD835\\uDD56',\n\tepar: '\\u22D5',\n\teparsl: '\\u29E3',\n\teplus: '\\u2A71',\n\tepsi: '\\u03B5',\n\tEpsilon: '\\u0395',\n\tepsilon: '\\u03B5',\n\tepsiv: '\\u03F5',\n\teqcirc: '\\u2256',\n\teqcolon: '\\u2255',\n\teqsim: '\\u2242',\n\teqslantgtr: '\\u2A96',\n\teqslantless: '\\u2A95',\n\tEqual: '\\u2A75',\n\tequals: '\\u003D',\n\tEqualTilde: '\\u2242',\n\tequest: '\\u225F',\n\tEquilibrium: '\\u21CC',\n\tequiv: '\\u2261',\n\tequivDD: '\\u2A78',\n\teqvparsl: '\\u29E5',\n\terarr: '\\u2971',\n\terDot: '\\u2253',\n\tEscr: '\\u2130',\n\tescr: '\\u212F',\n\tesdot: '\\u2250',\n\tEsim: '\\u2A73',\n\tesim: '\\u2242',\n\tEta: '\\u0397',\n\teta: '\\u03B7',\n\tETH: '\\u00D0',\n\teth: '\\u00F0',\n\tEuml: '\\u00CB',\n\teuml: '\\u00EB',\n\teuro: '\\u20AC',\n\texcl: '\\u0021',\n\texist: '\\u2203',\n\tExists: '\\u2203',\n\texpectation: '\\u2130',\n\tExponentialE: '\\u2147',\n\texponentiale: '\\u2147',\n\tfallingdotseq: '\\u2252',\n\tFcy: '\\u0424',\n\tfcy: '\\u0444',\n\tfemale: '\\u2640',\n\tffilig: '\\uFB03',\n\tfflig: '\\uFB00',\n\tffllig: '\\uFB04',\n\tFfr: '\\uD835\\uDD09',\n\tffr: '\\uD835\\uDD23',\n\tfilig: '\\uFB01',\n\tFilledSmallSquare: '\\u25FC',\n\tFilledVerySmallSquare: '\\u25AA',\n\tfjlig: '\\u0066\\u006A',\n\tflat: '\\u266D',\n\tfllig: '\\uFB02',\n\tfltns: '\\u25B1',\n\tfnof: '\\u0192',\n\tFopf: '\\uD835\\uDD3D',\n\tfopf: '\\uD835\\uDD57',\n\tForAll: '\\u2200',\n\tforall: '\\u2200',\n\tfork: '\\u22D4',\n\tforkv: '\\u2AD9',\n\tFouriertrf: '\\u2131',\n\tfpartint: '\\u2A0D',\n\tfrac12: '\\u00BD',\n\tfrac13: '\\u2153',\n\tfrac14: '\\u00BC',\n\tfrac15: '\\u2155',\n\tfrac16: '\\u2159',\n\tfrac18: '\\u215B',\n\tfrac23: '\\u2154',\n\tfrac25: '\\u2156',\n\tfrac34: '\\u00BE',\n\tfrac35: '\\u2157',\n\tfrac38: '\\u215C',\n\tfrac45: '\\u2158',\n\tfrac56: '\\u215A',\n\tfrac58: '\\u215D',\n\tfrac78: '\\u215E',\n\tfrasl: '\\u2044',\n\tfrown: '\\u2322',\n\tFscr: '\\u2131',\n\tfscr: '\\uD835\\uDCBB',\n\tgacute: '\\u01F5',\n\tGamma: '\\u0393',\n\tgamma: '\\u03B3',\n\tGammad: '\\u03DC',\n\tgammad: '\\u03DD',\n\tgap: '\\u2A86',\n\tGbreve: '\\u011E',\n\tgbreve: '\\u011F',\n\tGcedil: '\\u0122',\n\tGcirc: '\\u011C',\n\tgcirc: '\\u011D',\n\tGcy: '\\u0413',\n\tgcy: '\\u0433',\n\tGdot: '\\u0120',\n\tgdot: '\\u0121',\n\tgE: '\\u2267',\n\tge: '\\u2265',\n\tgEl: '\\u2A8C',\n\tgel: '\\u22DB',\n\tgeq: '\\u2265',\n\tgeqq: '\\u2267',\n\tgeqslant: '\\u2A7E',\n\tges: '\\u2A7E',\n\tgescc: '\\u2AA9',\n\tgesdot: '\\u2A80',\n\tgesdoto: '\\u2A82',\n\tgesdotol: '\\u2A84',\n\tgesl: '\\u22DB\\uFE00',\n\tgesles: '\\u2A94',\n\tGfr: '\\uD835\\uDD0A',\n\tgfr: '\\uD835\\uDD24',\n\tGg: '\\u22D9',\n\tgg: '\\u226B',\n\tggg: '\\u22D9',\n\tgimel: '\\u2137',\n\tGJcy: '\\u0403',\n\tgjcy: '\\u0453',\n\tgl: '\\u2277',\n\tgla: '\\u2AA5',\n\tglE: '\\u2A92',\n\tglj: '\\u2AA4',\n\tgnap: '\\u2A8A',\n\tgnapprox: '\\u2A8A',\n\tgnE: '\\u2269',\n\tgne: '\\u2A88',\n\tgneq: '\\u2A88',\n\tgneqq: '\\u2269',\n\tgnsim: '\\u22E7',\n\tGopf: '\\uD835\\uDD3E',\n\tgopf: '\\uD835\\uDD58',\n\tgrave: '\\u0060',\n\tGreaterEqual: '\\u2265',\n\tGreaterEqualLess: '\\u22DB',\n\tGreaterFullEqual: '\\u2267',\n\tGreaterGreater: '\\u2AA2',\n\tGreaterLess: '\\u2277',\n\tGreaterSlantEqual: '\\u2A7E',\n\tGreaterTilde: '\\u2273',\n\tGscr: '\\uD835\\uDCA2',\n\tgscr: '\\u210A',\n\tgsim: '\\u2273',\n\tgsime: '\\u2A8E',\n\tgsiml: '\\u2A90',\n\tGt: '\\u226B',\n\tGT: '\\u003E',\n\tgt: '\\u003E',\n\tgtcc: '\\u2AA7',\n\tgtcir: '\\u2A7A',\n\tgtdot: '\\u22D7',\n\tgtlPar: '\\u2995',\n\tgtquest: '\\u2A7C',\n\tgtrapprox: '\\u2A86',\n\tgtrarr: '\\u2978',\n\tgtrdot: '\\u22D7',\n\tgtreqless: '\\u22DB',\n\tgtreqqless: '\\u2A8C',\n\tgtrless: '\\u2277',\n\tgtrsim: '\\u2273',\n\tgvertneqq: '\\u2269\\uFE00',\n\tgvnE: '\\u2269\\uFE00',\n\tHacek: '\\u02C7',\n\thairsp: '\\u200A',\n\thalf: '\\u00BD',\n\thamilt: '\\u210B',\n\tHARDcy: '\\u042A',\n\thardcy: '\\u044A',\n\thArr: '\\u21D4',\n\tharr: '\\u2194',\n\tharrcir: '\\u2948',\n\tharrw: '\\u21AD',\n\tHat: '\\u005E',\n\thbar: '\\u210F',\n\tHcirc: '\\u0124',\n\thcirc: '\\u0125',\n\thearts: '\\u2665',\n\theartsuit: '\\u2665',\n\thellip: '\\u2026',\n\thercon: '\\u22B9',\n\tHfr: '\\u210C',\n\thfr: '\\uD835\\uDD25',\n\tHilbertSpace: '\\u210B',\n\thksearow: '\\u2925',\n\thkswarow: '\\u2926',\n\thoarr: '\\u21FF',\n\thomtht: '\\u223B',\n\thookleftarrow: '\\u21A9',\n\thookrightarrow: '\\u21AA',\n\tHopf: '\\u210D',\n\thopf: '\\uD835\\uDD59',\n\thorbar: '\\u2015',\n\tHorizontalLine: '\\u2500',\n\tHscr: '\\u210B',\n\thscr: '\\uD835\\uDCBD',\n\thslash: '\\u210F',\n\tHstrok: '\\u0126',\n\thstrok: '\\u0127',\n\tHumpDownHump: '\\u224E',\n\tHumpEqual: '\\u224F',\n\thybull: '\\u2043',\n\thyphen: '\\u2010',\n\tIacute: '\\u00CD',\n\tiacute: '\\u00ED',\n\tic: '\\u2063',\n\tIcirc: '\\u00CE',\n\ticirc: '\\u00EE',\n\tIcy: '\\u0418',\n\ticy: '\\u0438',\n\tIdot: '\\u0130',\n\tIEcy: '\\u0415',\n\tiecy: '\\u0435',\n\tiexcl: '\\u00A1',\n\tiff: '\\u21D4',\n\tIfr: '\\u2111',\n\tifr: '\\uD835\\uDD26',\n\tIgrave: '\\u00CC',\n\tigrave: '\\u00EC',\n\tii: '\\u2148',\n\tiiiint: '\\u2A0C',\n\tiiint: '\\u222D',\n\tiinfin: '\\u29DC',\n\tiiota: '\\u2129',\n\tIJlig: '\\u0132',\n\tijlig: '\\u0133',\n\tIm: '\\u2111',\n\tImacr: '\\u012A',\n\timacr: '\\u012B',\n\timage: '\\u2111',\n\tImaginaryI: '\\u2148',\n\timagline: '\\u2110',\n\timagpart: '\\u2111',\n\timath: '\\u0131',\n\timof: '\\u22B7',\n\timped: '\\u01B5',\n\tImplies: '\\u21D2',\n\tin: '\\u2208',\n\tincare: '\\u2105',\n\tinfin: '\\u221E',\n\tinfintie: '\\u29DD',\n\tinodot: '\\u0131',\n\tInt: '\\u222C',\n\tint: '\\u222B',\n\tintcal: '\\u22BA',\n\tintegers: '\\u2124',\n\tIntegral: '\\u222B',\n\tintercal: '\\u22BA',\n\tIntersection: '\\u22C2',\n\tintlarhk: '\\u2A17',\n\tintprod: '\\u2A3C',\n\tInvisibleComma: '\\u2063',\n\tInvisibleTimes: '\\u2062',\n\tIOcy: '\\u0401',\n\tiocy: '\\u0451',\n\tIogon: '\\u012E',\n\tiogon: '\\u012F',\n\tIopf: '\\uD835\\uDD40',\n\tiopf: '\\uD835\\uDD5A',\n\tIota: '\\u0399',\n\tiota: '\\u03B9',\n\tiprod: '\\u2A3C',\n\tiquest: '\\u00BF',\n\tIscr: '\\u2110',\n\tiscr: '\\uD835\\uDCBE',\n\tisin: '\\u2208',\n\tisindot: '\\u22F5',\n\tisinE: '\\u22F9',\n\tisins: '\\u22F4',\n\tisinsv: '\\u22F3',\n\tisinv: '\\u2208',\n\tit: '\\u2062',\n\tItilde: '\\u0128',\n\titilde: '\\u0129',\n\tIukcy: '\\u0406',\n\tiukcy: '\\u0456',\n\tIuml: '\\u00CF',\n\tiuml: '\\u00EF',\n\tJcirc: '\\u0134',\n\tjcirc: '\\u0135',\n\tJcy: '\\u0419',\n\tjcy: '\\u0439',\n\tJfr: '\\uD835\\uDD0D',\n\tjfr: '\\uD835\\uDD27',\n\tjmath: '\\u0237',\n\tJopf: '\\uD835\\uDD41',\n\tjopf: '\\uD835\\uDD5B',\n\tJscr: '\\uD835\\uDCA5',\n\tjscr: '\\uD835\\uDCBF',\n\tJsercy: '\\u0408',\n\tjsercy: '\\u0458',\n\tJukcy: '\\u0404',\n\tjukcy: '\\u0454',\n\tKappa: '\\u039A',\n\tkappa: '\\u03BA',\n\tkappav: '\\u03F0',\n\tKcedil: '\\u0136',\n\tkcedil: '\\u0137',\n\tKcy: '\\u041A',\n\tkcy: '\\u043A',\n\tKfr: '\\uD835\\uDD0E',\n\tkfr: '\\uD835\\uDD28',\n\tkgreen: '\\u0138',\n\tKHcy: '\\u0425',\n\tkhcy: '\\u0445',\n\tKJcy: '\\u040C',\n\tkjcy: '\\u045C',\n\tKopf: '\\uD835\\uDD42',\n\tkopf: '\\uD835\\uDD5C',\n\tKscr: '\\uD835\\uDCA6',\n\tkscr: '\\uD835\\uDCC0',\n\tlAarr: '\\u21DA',\n\tLacute: '\\u0139',\n\tlacute: '\\u013A',\n\tlaemptyv: '\\u29B4',\n\tlagran: '\\u2112',\n\tLambda: '\\u039B',\n\tlambda: '\\u03BB',\n\tLang: '\\u27EA',\n\tlang: '\\u27E8',\n\tlangd: '\\u2991',\n\tlangle: '\\u27E8',\n\tlap: '\\u2A85',\n\tLaplacetrf: '\\u2112',\n\tlaquo: '\\u00AB',\n\tLarr: '\\u219E',\n\tlArr: '\\u21D0',\n\tlarr: '\\u2190',\n\tlarrb: '\\u21E4',\n\tlarrbfs: '\\u291F',\n\tlarrfs: '\\u291D',\n\tlarrhk: '\\u21A9',\n\tlarrlp: '\\u21AB',\n\tlarrpl: '\\u2939',\n\tlarrsim: '\\u2973',\n\tlarrtl: '\\u21A2',\n\tlat: '\\u2AAB',\n\tlAtail: '\\u291B',\n\tlatail: '\\u2919',\n\tlate: '\\u2AAD',\n\tlates: '\\u2AAD\\uFE00',\n\tlBarr: '\\u290E',\n\tlbarr: '\\u290C',\n\tlbbrk: '\\u2772',\n\tlbrace: '\\u007B',\n\tlbrack: '\\u005B',\n\tlbrke: '\\u298B',\n\tlbrksld: '\\u298F',\n\tlbrkslu: '\\u298D',\n\tLcaron: '\\u013D',\n\tlcaron: '\\u013E',\n\tLcedil: '\\u013B',\n\tlcedil: '\\u013C',\n\tlceil: '\\u2308',\n\tlcub: '\\u007B',\n\tLcy: '\\u041B',\n\tlcy: '\\u043B',\n\tldca: '\\u2936',\n\tldquo: '\\u201C',\n\tldquor: '\\u201E',\n\tldrdhar: '\\u2967',\n\tldrushar: '\\u294B',\n\tldsh: '\\u21B2',\n\tlE: '\\u2266',\n\tle: '\\u2264',\n\tLeftAngleBracket: '\\u27E8',\n\tLeftArrow: '\\u2190',\n\tLeftarrow: '\\u21D0',\n\tleftarrow: '\\u2190',\n\tLeftArrowBar: '\\u21E4',\n\tLeftArrowRightArrow: '\\u21C6',\n\tleftarrowtail: '\\u21A2',\n\tLeftCeiling: '\\u2308',\n\tLeftDoubleBracket: '\\u27E6',\n\tLeftDownTeeVector: '\\u2961',\n\tLeftDownVector: '\\u21C3',\n\tLeftDownVectorBar: '\\u2959',\n\tLeftFloor: '\\u230A',\n\tleftharpoondown: '\\u21BD',\n\tleftharpoonup: '\\u21BC',\n\tleftleftarrows: '\\u21C7',\n\tLeftRightArrow: '\\u2194',\n\tLeftrightarrow: '\\u21D4',\n\tleftrightarrow: '\\u2194',\n\tleftrightarrows: '\\u21C6',\n\tleftrightharpoons: '\\u21CB',\n\tleftrightsquigarrow: '\\u21AD',\n\tLeftRightVector: '\\u294E',\n\tLeftTee: '\\u22A3',\n\tLeftTeeArrow: '\\u21A4',\n\tLeftTeeVector: '\\u295A',\n\tleftthreetimes: '\\u22CB',\n\tLeftTriangle: '\\u22B2',\n\tLeftTriangleBar: '\\u29CF',\n\tLeftTriangleEqual: '\\u22B4',\n\tLeftUpDownVector: '\\u2951',\n\tLeftUpTeeVector: '\\u2960',\n\tLeftUpVector: '\\u21BF',\n\tLeftUpVectorBar: '\\u2958',\n\tLeftVector: '\\u21BC',\n\tLeftVectorBar: '\\u2952',\n\tlEg: '\\u2A8B',\n\tleg: '\\u22DA',\n\tleq: '\\u2264',\n\tleqq: '\\u2266',\n\tleqslant: '\\u2A7D',\n\tles: '\\u2A7D',\n\tlescc: '\\u2AA8',\n\tlesdot: '\\u2A7F',\n\tlesdoto: '\\u2A81',\n\tlesdotor: '\\u2A83',\n\tlesg: '\\u22DA\\uFE00',\n\tlesges: '\\u2A93',\n\tlessapprox: '\\u2A85',\n\tlessdot: '\\u22D6',\n\tlesseqgtr: '\\u22DA',\n\tlesseqqgtr: '\\u2A8B',\n\tLessEqualGreater: '\\u22DA',\n\tLessFullEqual: '\\u2266',\n\tLessGreater: '\\u2276',\n\tlessgtr: '\\u2276',\n\tLessLess: '\\u2AA1',\n\tlesssim: '\\u2272',\n\tLessSlantEqual: '\\u2A7D',\n\tLessTilde: '\\u2272',\n\tlfisht: '\\u297C',\n\tlfloor: '\\u230A',\n\tLfr: '\\uD835\\uDD0F',\n\tlfr: '\\uD835\\uDD29',\n\tlg: '\\u2276',\n\tlgE: '\\u2A91',\n\tlHar: '\\u2962',\n\tlhard: '\\u21BD',\n\tlharu: '\\u21BC',\n\tlharul: '\\u296A',\n\tlhblk: '\\u2584',\n\tLJcy: '\\u0409',\n\tljcy: '\\u0459',\n\tLl: '\\u22D8',\n\tll: '\\u226A',\n\tllarr: '\\u21C7',\n\tllcorner: '\\u231E',\n\tLleftarrow: '\\u21DA',\n\tllhard: '\\u296B',\n\tlltri: '\\u25FA',\n\tLmidot: '\\u013F',\n\tlmidot: '\\u0140',\n\tlmoust: '\\u23B0',\n\tlmoustache: '\\u23B0',\n\tlnap: '\\u2A89',\n\tlnapprox: '\\u2A89',\n\tlnE: '\\u2268',\n\tlne: '\\u2A87',\n\tlneq: '\\u2A87',\n\tlneqq: '\\u2268',\n\tlnsim: '\\u22E6',\n\tloang: '\\u27EC',\n\tloarr: '\\u21FD',\n\tlobrk: '\\u27E6',\n\tLongLeftArrow: '\\u27F5',\n\tLongleftarrow: '\\u27F8',\n\tlongleftarrow: '\\u27F5',\n\tLongLeftRightArrow: '\\u27F7',\n\tLongleftrightarrow: '\\u27FA',\n\tlongleftrightarrow: '\\u27F7',\n\tlongmapsto: '\\u27FC',\n\tLongRightArrow: '\\u27F6',\n\tLongrightarrow: '\\u27F9',\n\tlongrightarrow: '\\u27F6',\n\tlooparrowleft: '\\u21AB',\n\tlooparrowright: '\\u21AC',\n\tlopar: '\\u2985',\n\tLopf: '\\uD835\\uDD43',\n\tlopf: '\\uD835\\uDD5D',\n\tloplus: '\\u2A2D',\n\tlotimes: '\\u2A34',\n\tlowast: '\\u2217',\n\tlowbar: '\\u005F',\n\tLowerLeftArrow: '\\u2199',\n\tLowerRightArrow: '\\u2198',\n\tloz: '\\u25CA',\n\tlozenge: '\\u25CA',\n\tlozf: '\\u29EB',\n\tlpar: '\\u0028',\n\tlparlt: '\\u2993',\n\tlrarr: '\\u21C6',\n\tlrcorner: '\\u231F',\n\tlrhar: '\\u21CB',\n\tlrhard: '\\u296D',\n\tlrm: '\\u200E',\n\tlrtri: '\\u22BF',\n\tlsaquo: '\\u2039',\n\tLscr: '\\u2112',\n\tlscr: '\\uD835\\uDCC1',\n\tLsh: '\\u21B0',\n\tlsh: '\\u21B0',\n\tlsim: '\\u2272',\n\tlsime: '\\u2A8D',\n\tlsimg: '\\u2A8F',\n\tlsqb: '\\u005B',\n\tlsquo: '\\u2018',\n\tlsquor: '\\u201A',\n\tLstrok: '\\u0141',\n\tlstrok: '\\u0142',\n\tLt: '\\u226A',\n\tLT: '\\u003C',\n\tlt: '\\u003C',\n\tltcc: '\\u2AA6',\n\tltcir: '\\u2A79',\n\tltdot: '\\u22D6',\n\tlthree: '\\u22CB',\n\tltimes: '\\u22C9',\n\tltlarr: '\\u2976',\n\tltquest: '\\u2A7B',\n\tltri: '\\u25C3',\n\tltrie: '\\u22B4',\n\tltrif: '\\u25C2',\n\tltrPar: '\\u2996',\n\tlurdshar: '\\u294A',\n\tluruhar: '\\u2966',\n\tlvertneqq: '\\u2268\\uFE00',\n\tlvnE: '\\u2268\\uFE00',\n\tmacr: '\\u00AF',\n\tmale: '\\u2642',\n\tmalt: '\\u2720',\n\tmaltese: '\\u2720',\n\tMap: '\\u2905',\n\tmap: '\\u21A6',\n\tmapsto: '\\u21A6',\n\tmapstodown: '\\u21A7',\n\tmapstoleft: '\\u21A4',\n\tmapstoup: '\\u21A5',\n\tmarker: '\\u25AE',\n\tmcomma: '\\u2A29',\n\tMcy: '\\u041C',\n\tmcy: '\\u043C',\n\tmdash: '\\u2014',\n\tmDDot: '\\u223A',\n\tmeasuredangle: '\\u2221',\n\tMediumSpace: '\\u205F',\n\tMellintrf: '\\u2133',\n\tMfr: '\\uD835\\uDD10',\n\tmfr: '\\uD835\\uDD2A',\n\tmho: '\\u2127',\n\tmicro: '\\u00B5',\n\tmid: '\\u2223',\n\tmidast: '\\u002A',\n\tmidcir: '\\u2AF0',\n\tmiddot: '\\u00B7',\n\tminus: '\\u2212',\n\tminusb: '\\u229F',\n\tminusd: '\\u2238',\n\tminusdu: '\\u2A2A',\n\tMinusPlus: '\\u2213',\n\tmlcp: '\\u2ADB',\n\tmldr: '\\u2026',\n\tmnplus: '\\u2213',\n\tmodels: '\\u22A7',\n\tMopf: '\\uD835\\uDD44',\n\tmopf: '\\uD835\\uDD5E',\n\tmp: '\\u2213',\n\tMscr: '\\u2133',\n\tmscr: '\\uD835\\uDCC2',\n\tmstpos: '\\u223E',\n\tMu: '\\u039C',\n\tmu: '\\u03BC',\n\tmultimap: '\\u22B8',\n\tmumap: '\\u22B8',\n\tnabla: '\\u2207',\n\tNacute: '\\u0143',\n\tnacute: '\\u0144',\n\tnang: '\\u2220\\u20D2',\n\tnap: '\\u2249',\n\tnapE: '\\u2A70\\u0338',\n\tnapid: '\\u224B\\u0338',\n\tnapos: '\\u0149',\n\tnapprox: '\\u2249',\n\tnatur: '\\u266E',\n\tnatural: '\\u266E',\n\tnaturals: '\\u2115',\n\tnbsp: '\\u00A0',\n\tnbump: '\\u224E\\u0338',\n\tnbumpe: '\\u224F\\u0338',\n\tncap: '\\u2A43',\n\tNcaron: '\\u0147',\n\tncaron: '\\u0148',\n\tNcedil: '\\u0145',\n\tncedil: '\\u0146',\n\tncong: '\\u2247',\n\tncongdot: '\\u2A6D\\u0338',\n\tncup: '\\u2A42',\n\tNcy: '\\u041D',\n\tncy: '\\u043D',\n\tndash: '\\u2013',\n\tne: '\\u2260',\n\tnearhk: '\\u2924',\n\tneArr: '\\u21D7',\n\tnearr: '\\u2197',\n\tnearrow: '\\u2197',\n\tnedot: '\\u2250\\u0338',\n\tNegativeMediumSpace: '\\u200B',\n\tNegativeThickSpace: '\\u200B',\n\tNegativeThinSpace: '\\u200B',\n\tNegativeVeryThinSpace: '\\u200B',\n\tnequiv: '\\u2262',\n\tnesear: '\\u2928',\n\tnesim: '\\u2242\\u0338',\n\tNestedGreaterGreater: '\\u226B',\n\tNestedLessLess: '\\u226A',\n\tNewLine: '\\u000A',\n\tnexist: '\\u2204',\n\tnexists: '\\u2204',\n\tNfr: '\\uD835\\uDD11',\n\tnfr: '\\uD835\\uDD2B',\n\tngE: '\\u2267\\u0338',\n\tnge: '\\u2271',\n\tngeq: '\\u2271',\n\tngeqq: '\\u2267\\u0338',\n\tngeqslant: '\\u2A7E\\u0338',\n\tnges: '\\u2A7E\\u0338',\n\tnGg: '\\u22D9\\u0338',\n\tngsim: '\\u2275',\n\tnGt: '\\u226B\\u20D2',\n\tngt: '\\u226F',\n\tngtr: '\\u226F',\n\tnGtv: '\\u226B\\u0338',\n\tnhArr: '\\u21CE',\n\tnharr: '\\u21AE',\n\tnhpar: '\\u2AF2',\n\tni: '\\u220B',\n\tnis: '\\u22FC',\n\tnisd: '\\u22FA',\n\tniv: '\\u220B',\n\tNJcy: '\\u040A',\n\tnjcy: '\\u045A',\n\tnlArr: '\\u21CD',\n\tnlarr: '\\u219A',\n\tnldr: '\\u2025',\n\tnlE: '\\u2266\\u0338',\n\tnle: '\\u2270',\n\tnLeftarrow: '\\u21CD',\n\tnleftarrow: '\\u219A',\n\tnLeftrightarrow: '\\u21CE',\n\tnleftrightarrow: '\\u21AE',\n\tnleq: '\\u2270',\n\tnleqq: '\\u2266\\u0338',\n\tnleqslant: '\\u2A7D\\u0338',\n\tnles: '\\u2A7D\\u0338',\n\tnless: '\\u226E',\n\tnLl: '\\u22D8\\u0338',\n\tnlsim: '\\u2274',\n\tnLt: '\\u226A\\u20D2',\n\tnlt: '\\u226E',\n\tnltri: '\\u22EA',\n\tnltrie: '\\u22EC',\n\tnLtv: '\\u226A\\u0338',\n\tnmid: '\\u2224',\n\tNoBreak: '\\u2060',\n\tNonBreakingSpace: '\\u00A0',\n\tNopf: '\\u2115',\n\tnopf: '\\uD835\\uDD5F',\n\tNot: '\\u2AEC',\n\tnot: '\\u00AC',\n\tNotCongruent: '\\u2262',\n\tNotCupCap: '\\u226D',\n\tNotDoubleVerticalBar: '\\u2226',\n\tNotElement: '\\u2209',\n\tNotEqual: '\\u2260',\n\tNotEqualTilde: '\\u2242\\u0338',\n\tNotExists: '\\u2204',\n\tNotGreater: '\\u226F',\n\tNotGreaterEqual: '\\u2271',\n\tNotGreaterFullEqual: '\\u2267\\u0338',\n\tNotGreaterGreater: '\\u226B\\u0338',\n\tNotGreaterLess: '\\u2279',\n\tNotGreaterSlantEqual: '\\u2A7E\\u0338',\n\tNotGreaterTilde: '\\u2275',\n\tNotHumpDownHump: '\\u224E\\u0338',\n\tNotHumpEqual: '\\u224F\\u0338',\n\tnotin: '\\u2209',\n\tnotindot: '\\u22F5\\u0338',\n\tnotinE: '\\u22F9\\u0338',\n\tnotinva: '\\u2209',\n\tnotinvb: '\\u22F7',\n\tnotinvc: '\\u22F6',\n\tNotLeftTriangle: '\\u22EA',\n\tNotLeftTriangleBar: '\\u29CF\\u0338',\n\tNotLeftTriangleEqual: '\\u22EC',\n\tNotLess: '\\u226E',\n\tNotLessEqual: '\\u2270',\n\tNotLessGreater: '\\u2278',\n\tNotLessLess: '\\u226A\\u0338',\n\tNotLessSlantEqual: '\\u2A7D\\u0338',\n\tNotLessTilde: '\\u2274',\n\tNotNestedGreaterGreater: '\\u2AA2\\u0338',\n\tNotNestedLessLess: '\\u2AA1\\u0338',\n\tnotni: '\\u220C',\n\tnotniva: '\\u220C',\n\tnotnivb: '\\u22FE',\n\tnotnivc: '\\u22FD',\n\tNotPrecedes: '\\u2280',\n\tNotPrecedesEqual: '\\u2AAF\\u0338',\n\tNotPrecedesSlantEqual: '\\u22E0',\n\tNotReverseElement: '\\u220C',\n\tNotRightTriangle: '\\u22EB',\n\tNotRightTriangleBar: '\\u29D0\\u0338',\n\tNotRightTriangleEqual: '\\u22ED',\n\tNotSquareSubset: '\\u228F\\u0338',\n\tNotSquareSubsetEqual: '\\u22E2',\n\tNotSquareSuperset: '\\u2290\\u0338',\n\tNotSquareSupersetEqual: '\\u22E3',\n\tNotSubset: '\\u2282\\u20D2',\n\tNotSubsetEqual: '\\u2288',\n\tNotSucceeds: '\\u2281',\n\tNotSucceedsEqual: '\\u2AB0\\u0338',\n\tNotSucceedsSlantEqual: '\\u22E1',\n\tNotSucceedsTilde: '\\u227F\\u0338',\n\tNotSuperset: '\\u2283\\u20D2',\n\tNotSupersetEqual: '\\u2289',\n\tNotTilde: '\\u2241',\n\tNotTildeEqual: '\\u2244',\n\tNotTildeFullEqual: '\\u2247',\n\tNotTildeTilde: '\\u2249',\n\tNotVerticalBar: '\\u2224',\n\tnpar: '\\u2226',\n\tnparallel: '\\u2226',\n\tnparsl: '\\u2AFD\\u20E5',\n\tnpart: '\\u2202\\u0338',\n\tnpolint: '\\u2A14',\n\tnpr: '\\u2280',\n\tnprcue: '\\u22E0',\n\tnpre: '\\u2AAF\\u0338',\n\tnprec: '\\u2280',\n\tnpreceq: '\\u2AAF\\u0338',\n\tnrArr: '\\u21CF',\n\tnrarr: '\\u219B',\n\tnrarrc: '\\u2933\\u0338',\n\tnrarrw: '\\u219D\\u0338',\n\tnRightarrow: '\\u21CF',\n\tnrightarrow: '\\u219B',\n\tnrtri: '\\u22EB',\n\tnrtrie: '\\u22ED',\n\tnsc: '\\u2281',\n\tnsccue: '\\u22E1',\n\tnsce: '\\u2AB0\\u0338',\n\tNscr: '\\uD835\\uDCA9',\n\tnscr: '\\uD835\\uDCC3',\n\tnshortmid: '\\u2224',\n\tnshortparallel: '\\u2226',\n\tnsim: '\\u2241',\n\tnsime: '\\u2244',\n\tnsimeq: '\\u2244',\n\tnsmid: '\\u2224',\n\tnspar: '\\u2226',\n\tnsqsube: '\\u22E2',\n\tnsqsupe: '\\u22E3',\n\tnsub: '\\u2284',\n\tnsubE: '\\u2AC5\\u0338',\n\tnsube: '\\u2288',\n\tnsubset: '\\u2282\\u20D2',\n\tnsubseteq: '\\u2288',\n\tnsubseteqq: '\\u2AC5\\u0338',\n\tnsucc: '\\u2281',\n\tnsucceq: '\\u2AB0\\u0338',\n\tnsup: '\\u2285',\n\tnsupE: '\\u2AC6\\u0338',\n\tnsupe: '\\u2289',\n\tnsupset: '\\u2283\\u20D2',\n\tnsupseteq: '\\u2289',\n\tnsupseteqq: '\\u2AC6\\u0338',\n\tntgl: '\\u2279',\n\tNtilde: '\\u00D1',\n\tntilde: '\\u00F1',\n\tntlg: '\\u2278',\n\tntriangleleft: '\\u22EA',\n\tntrianglelefteq: '\\u22EC',\n\tntriangleright: '\\u22EB',\n\tntrianglerighteq: '\\u22ED',\n\tNu: '\\u039D',\n\tnu: '\\u03BD',\n\tnum: '\\u0023',\n\tnumero: '\\u2116',\n\tnumsp: '\\u2007',\n\tnvap: '\\u224D\\u20D2',\n\tnVDash: '\\u22AF',\n\tnVdash: '\\u22AE',\n\tnvDash: '\\u22AD',\n\tnvdash: '\\u22AC',\n\tnvge: '\\u2265\\u20D2',\n\tnvgt: '\\u003E\\u20D2',\n\tnvHarr: '\\u2904',\n\tnvinfin: '\\u29DE',\n\tnvlArr: '\\u2902',\n\tnvle: '\\u2264\\u20D2',\n\tnvlt: '\\u003C\\u20D2',\n\tnvltrie: '\\u22B4\\u20D2',\n\tnvrArr: '\\u2903',\n\tnvrtrie: '\\u22B5\\u20D2',\n\tnvsim: '\\u223C\\u20D2',\n\tnwarhk: '\\u2923',\n\tnwArr: '\\u21D6',\n\tnwarr: '\\u2196',\n\tnwarrow: '\\u2196',\n\tnwnear: '\\u2927',\n\tOacute: '\\u00D3',\n\toacute: '\\u00F3',\n\toast: '\\u229B',\n\tocir: '\\u229A',\n\tOcirc: '\\u00D4',\n\tocirc: '\\u00F4',\n\tOcy: '\\u041E',\n\tocy: '\\u043E',\n\todash: '\\u229D',\n\tOdblac: '\\u0150',\n\todblac: '\\u0151',\n\todiv: '\\u2A38',\n\todot: '\\u2299',\n\todsold: '\\u29BC',\n\tOElig: '\\u0152',\n\toelig: '\\u0153',\n\tofcir: '\\u29BF',\n\tOfr: '\\uD835\\uDD12',\n\tofr: '\\uD835\\uDD2C',\n\togon: '\\u02DB',\n\tOgrave: '\\u00D2',\n\tograve: '\\u00F2',\n\togt: '\\u29C1',\n\tohbar: '\\u29B5',\n\tohm: '\\u03A9',\n\toint: '\\u222E',\n\tolarr: '\\u21BA',\n\tolcir: '\\u29BE',\n\tolcross: '\\u29BB',\n\toline: '\\u203E',\n\tolt: '\\u29C0',\n\tOmacr: '\\u014C',\n\tomacr: '\\u014D',\n\tOmega: '\\u03A9',\n\tomega: '\\u03C9',\n\tOmicron: '\\u039F',\n\tomicron: '\\u03BF',\n\tomid: '\\u29B6',\n\tominus: '\\u2296',\n\tOopf: '\\uD835\\uDD46',\n\toopf: '\\uD835\\uDD60',\n\topar: '\\u29B7',\n\tOpenCurlyDoubleQuote: '\\u201C',\n\tOpenCurlyQuote: '\\u2018',\n\toperp: '\\u29B9',\n\toplus: '\\u2295',\n\tOr: '\\u2A54',\n\tor: '\\u2228',\n\torarr: '\\u21BB',\n\tord: '\\u2A5D',\n\torder: '\\u2134',\n\torderof: '\\u2134',\n\tordf: '\\u00AA',\n\tordm: '\\u00BA',\n\torigof: '\\u22B6',\n\toror: '\\u2A56',\n\torslope: '\\u2A57',\n\torv: '\\u2A5B',\n\toS: '\\u24C8',\n\tOscr: '\\uD835\\uDCAA',\n\toscr: '\\u2134',\n\tOslash: '\\u00D8',\n\toslash: '\\u00F8',\n\tosol: '\\u2298',\n\tOtilde: '\\u00D5',\n\totilde: '\\u00F5',\n\tOtimes: '\\u2A37',\n\totimes: '\\u2297',\n\totimesas: '\\u2A36',\n\tOuml: '\\u00D6',\n\touml: '\\u00F6',\n\tovbar: '\\u233D',\n\tOverBar: '\\u203E',\n\tOverBrace: '\\u23DE',\n\tOverBracket: '\\u23B4',\n\tOverParenthesis: '\\u23DC',\n\tpar: '\\u2225',\n\tpara: '\\u00B6',\n\tparallel: '\\u2225',\n\tparsim: '\\u2AF3',\n\tparsl: '\\u2AFD',\n\tpart: '\\u2202',\n\tPartialD: '\\u2202',\n\tPcy: '\\u041F',\n\tpcy: '\\u043F',\n\tpercnt: '\\u0025',\n\tperiod: '\\u002E',\n\tpermil: '\\u2030',\n\tperp: '\\u22A5',\n\tpertenk: '\\u2031',\n\tPfr: '\\uD835\\uDD13',\n\tpfr: '\\uD835\\uDD2D',\n\tPhi: '\\u03A6',\n\tphi: '\\u03C6',\n\tphiv: '\\u03D5',\n\tphmmat: '\\u2133',\n\tphone: '\\u260E',\n\tPi: '\\u03A0',\n\tpi: '\\u03C0',\n\tpitchfork: '\\u22D4',\n\tpiv: '\\u03D6',\n\tplanck: '\\u210F',\n\tplanckh: '\\u210E',\n\tplankv: '\\u210F',\n\tplus: '\\u002B',\n\tplusacir: '\\u2A23',\n\tplusb: '\\u229E',\n\tpluscir: '\\u2A22',\n\tplusdo: '\\u2214',\n\tplusdu: '\\u2A25',\n\tpluse: '\\u2A72',\n\tPlusMinus: '\\u00B1',\n\tplusmn: '\\u00B1',\n\tplussim: '\\u2A26',\n\tplustwo: '\\u2A27',\n\tpm: '\\u00B1',\n\tPoincareplane: '\\u210C',\n\tpointint: '\\u2A15',\n\tPopf: '\\u2119',\n\tpopf: '\\uD835\\uDD61',\n\tpound: '\\u00A3',\n\tPr: '\\u2ABB',\n\tpr: '\\u227A',\n\tprap: '\\u2AB7',\n\tprcue: '\\u227C',\n\tprE: '\\u2AB3',\n\tpre: '\\u2AAF',\n\tprec: '\\u227A',\n\tprecapprox: '\\u2AB7',\n\tpreccurlyeq: '\\u227C',\n\tPrecedes: '\\u227A',\n\tPrecedesEqual: '\\u2AAF',\n\tPrecedesSlantEqual: '\\u227C',\n\tPrecedesTilde: '\\u227E',\n\tpreceq: '\\u2AAF',\n\tprecnapprox: '\\u2AB9',\n\tprecneqq: '\\u2AB5',\n\tprecnsim: '\\u22E8',\n\tprecsim: '\\u227E',\n\tPrime: '\\u2033',\n\tprime: '\\u2032',\n\tprimes: '\\u2119',\n\tprnap: '\\u2AB9',\n\tprnE: '\\u2AB5',\n\tprnsim: '\\u22E8',\n\tprod: '\\u220F',\n\tProduct: '\\u220F',\n\tprofalar: '\\u232E',\n\tprofline: '\\u2312',\n\tprofsurf: '\\u2313',\n\tprop: '\\u221D',\n\tProportion: '\\u2237',\n\tProportional: '\\u221D',\n\tpropto: '\\u221D',\n\tprsim: '\\u227E',\n\tprurel: '\\u22B0',\n\tPscr: '\\uD835\\uDCAB',\n\tpscr: '\\uD835\\uDCC5',\n\tPsi: '\\u03A8',\n\tpsi: '\\u03C8',\n\tpuncsp: '\\u2008',\n\tQfr: '\\uD835\\uDD14',\n\tqfr: '\\uD835\\uDD2E',\n\tqint: '\\u2A0C',\n\tQopf: '\\u211A',\n\tqopf: '\\uD835\\uDD62',\n\tqprime: '\\u2057',\n\tQscr: '\\uD835\\uDCAC',\n\tqscr: '\\uD835\\uDCC6',\n\tquaternions: '\\u210D',\n\tquatint: '\\u2A16',\n\tquest: '\\u003F',\n\tquesteq: '\\u225F',\n\tQUOT: '\\u0022',\n\tquot: '\\u0022',\n\trAarr: '\\u21DB',\n\trace: '\\u223D\\u0331',\n\tRacute: '\\u0154',\n\tracute: '\\u0155',\n\tradic: '\\u221A',\n\traemptyv: '\\u29B3',\n\tRang: '\\u27EB',\n\trang: '\\u27E9',\n\trangd: '\\u2992',\n\trange: '\\u29A5',\n\trangle: '\\u27E9',\n\traquo: '\\u00BB',\n\tRarr: '\\u21A0',\n\trArr: '\\u21D2',\n\trarr: '\\u2192',\n\trarrap: '\\u2975',\n\trarrb: '\\u21E5',\n\trarrbfs: '\\u2920',\n\trarrc: '\\u2933',\n\trarrfs: '\\u291E',\n\trarrhk: '\\u21AA',\n\trarrlp: '\\u21AC',\n\trarrpl: '\\u2945',\n\trarrsim: '\\u2974',\n\tRarrtl: '\\u2916',\n\trarrtl: '\\u21A3',\n\trarrw: '\\u219D',\n\trAtail: '\\u291C',\n\tratail: '\\u291A',\n\tratio: '\\u2236',\n\trationals: '\\u211A',\n\tRBarr: '\\u2910',\n\trBarr: '\\u290F',\n\trbarr: '\\u290D',\n\trbbrk: '\\u2773',\n\trbrace: '\\u007D',\n\trbrack: '\\u005D',\n\trbrke: '\\u298C',\n\trbrksld: '\\u298E',\n\trbrkslu: '\\u2990',\n\tRcaron: '\\u0158',\n\trcaron: '\\u0159',\n\tRcedil: '\\u0156',\n\trcedil: '\\u0157',\n\trceil: '\\u2309',\n\trcub: '\\u007D',\n\tRcy: '\\u0420',\n\trcy: '\\u0440',\n\trdca: '\\u2937',\n\trdldhar: '\\u2969',\n\trdquo: '\\u201D',\n\trdquor: '\\u201D',\n\trdsh: '\\u21B3',\n\tRe: '\\u211C',\n\treal: '\\u211C',\n\trealine: '\\u211B',\n\trealpart: '\\u211C',\n\treals: '\\u211D',\n\trect: '\\u25AD',\n\tREG: '\\u00AE',\n\treg: '\\u00AE',\n\tReverseElement: '\\u220B',\n\tReverseEquilibrium: '\\u21CB',\n\tReverseUpEquilibrium: '\\u296F',\n\trfisht: '\\u297D',\n\trfloor: '\\u230B',\n\tRfr: '\\u211C',\n\trfr: '\\uD835\\uDD2F',\n\trHar: '\\u2964',\n\trhard: '\\u21C1',\n\trharu: '\\u21C0',\n\trharul: '\\u296C',\n\tRho: '\\u03A1',\n\trho: '\\u03C1',\n\trhov: '\\u03F1',\n\tRightAngleBracket: '\\u27E9',\n\tRightArrow: '\\u2192',\n\tRightarrow: '\\u21D2',\n\trightarrow: '\\u2192',\n\tRightArrowBar: '\\u21E5',\n\tRightArrowLeftArrow: '\\u21C4',\n\trightarrowtail: '\\u21A3',\n\tRightCeiling: '\\u2309',\n\tRightDoubleBracket: '\\u27E7',\n\tRightDownTeeVector: '\\u295D',\n\tRightDownVector: '\\u21C2',\n\tRightDownVectorBar: '\\u2955',\n\tRightFloor: '\\u230B',\n\trightharpoondown: '\\u21C1',\n\trightharpoonup: '\\u21C0',\n\trightleftarrows: '\\u21C4',\n\trightleftharpoons: '\\u21CC',\n\trightrightarrows: '\\u21C9',\n\trightsquigarrow: '\\u219D',\n\tRightTee: '\\u22A2',\n\tRightTeeArrow: '\\u21A6',\n\tRightTeeVector: '\\u295B',\n\trightthreetimes: '\\u22CC',\n\tRightTriangle: '\\u22B3',\n\tRightTriangleBar: '\\u29D0',\n\tRightTriangleEqual: '\\u22B5',\n\tRightUpDownVector: '\\u294F',\n\tRightUpTeeVector: '\\u295C',\n\tRightUpVector: '\\u21BE',\n\tRightUpVectorBar: '\\u2954',\n\tRightVector: '\\u21C0',\n\tRightVectorBar: '\\u2953',\n\tring: '\\u02DA',\n\trisingdotseq: '\\u2253',\n\trlarr: '\\u21C4',\n\trlhar: '\\u21CC',\n\trlm: '\\u200F',\n\trmoust: '\\u23B1',\n\trmoustache: '\\u23B1',\n\trnmid: '\\u2AEE',\n\troang: '\\u27ED',\n\troarr: '\\u21FE',\n\trobrk: '\\u27E7',\n\tropar: '\\u2986',\n\tRopf: '\\u211D',\n\tropf: '\\uD835\\uDD63',\n\troplus: '\\u2A2E',\n\trotimes: '\\u2A35',\n\tRoundImplies: '\\u2970',\n\trpar: '\\u0029',\n\trpargt: '\\u2994',\n\trppolint: '\\u2A12',\n\trrarr: '\\u21C9',\n\tRrightarrow: '\\u21DB',\n\trsaquo: '\\u203A',\n\tRscr: '\\u211B',\n\trscr: '\\uD835\\uDCC7',\n\tRsh: '\\u21B1',\n\trsh: '\\u21B1',\n\trsqb: '\\u005D',\n\trsquo: '\\u2019',\n\trsquor: '\\u2019',\n\trthree: '\\u22CC',\n\trtimes: '\\u22CA',\n\trtri: '\\u25B9',\n\trtrie: '\\u22B5',\n\trtrif: '\\u25B8',\n\trtriltri: '\\u29CE',\n\tRuleDelayed: '\\u29F4',\n\truluhar: '\\u2968',\n\trx: '\\u211E',\n\tSacute: '\\u015A',\n\tsacute: '\\u015B',\n\tsbquo: '\\u201A',\n\tSc: '\\u2ABC',\n\tsc: '\\u227B',\n\tscap: '\\u2AB8',\n\tScaron: '\\u0160',\n\tscaron: '\\u0161',\n\tsccue: '\\u227D',\n\tscE: '\\u2AB4',\n\tsce: '\\u2AB0',\n\tScedil: '\\u015E',\n\tscedil: '\\u015F',\n\tScirc: '\\u015C',\n\tscirc: '\\u015D',\n\tscnap: '\\u2ABA',\n\tscnE: '\\u2AB6',\n\tscnsim: '\\u22E9',\n\tscpolint: '\\u2A13',\n\tscsim: '\\u227F',\n\tScy: '\\u0421',\n\tscy: '\\u0441',\n\tsdot: '\\u22C5',\n\tsdotb: '\\u22A1',\n\tsdote: '\\u2A66',\n\tsearhk: '\\u2925',\n\tseArr: '\\u21D8',\n\tsearr: '\\u2198',\n\tsearrow: '\\u2198',\n\tsect: '\\u00A7',\n\tsemi: '\\u003B',\n\tseswar: '\\u2929',\n\tsetminus: '\\u2216',\n\tsetmn: '\\u2216',\n\tsext: '\\u2736',\n\tSfr: '\\uD835\\uDD16',\n\tsfr: '\\uD835\\uDD30',\n\tsfrown: '\\u2322',\n\tsharp: '\\u266F',\n\tSHCHcy: '\\u0429',\n\tshchcy: '\\u0449',\n\tSHcy: '\\u0428',\n\tshcy: '\\u0448',\n\tShortDownArrow: '\\u2193',\n\tShortLeftArrow: '\\u2190',\n\tshortmid: '\\u2223',\n\tshortparallel: '\\u2225',\n\tShortRightArrow: '\\u2192',\n\tShortUpArrow: '\\u2191',\n\tshy: '\\u00AD',\n\tSigma: '\\u03A3',\n\tsigma: '\\u03C3',\n\tsigmaf: '\\u03C2',\n\tsigmav: '\\u03C2',\n\tsim: '\\u223C',\n\tsimdot: '\\u2A6A',\n\tsime: '\\u2243',\n\tsimeq: '\\u2243',\n\tsimg: '\\u2A9E',\n\tsimgE: '\\u2AA0',\n\tsiml: '\\u2A9D',\n\tsimlE: '\\u2A9F',\n\tsimne: '\\u2246',\n\tsimplus: '\\u2A24',\n\tsimrarr: '\\u2972',\n\tslarr: '\\u2190',\n\tSmallCircle: '\\u2218',\n\tsmallsetminus: '\\u2216',\n\tsmashp: '\\u2A33',\n\tsmeparsl: '\\u29E4',\n\tsmid: '\\u2223',\n\tsmile: '\\u2323',\n\tsmt: '\\u2AAA',\n\tsmte: '\\u2AAC',\n\tsmtes: '\\u2AAC\\uFE00',\n\tSOFTcy: '\\u042C',\n\tsoftcy: '\\u044C',\n\tsol: '\\u002F',\n\tsolb: '\\u29C4',\n\tsolbar: '\\u233F',\n\tSopf: '\\uD835\\uDD4A',\n\tsopf: '\\uD835\\uDD64',\n\tspades: '\\u2660',\n\tspadesuit: '\\u2660',\n\tspar: '\\u2225',\n\tsqcap: '\\u2293',\n\tsqcaps: '\\u2293\\uFE00',\n\tsqcup: '\\u2294',\n\tsqcups: '\\u2294\\uFE00',\n\tSqrt: '\\u221A',\n\tsqsub: '\\u228F',\n\tsqsube: '\\u2291',\n\tsqsubset: '\\u228F',\n\tsqsubseteq: '\\u2291',\n\tsqsup: '\\u2290',\n\tsqsupe: '\\u2292',\n\tsqsupset: '\\u2290',\n\tsqsupseteq: '\\u2292',\n\tsqu: '\\u25A1',\n\tSquare: '\\u25A1',\n\tsquare: '\\u25A1',\n\tSquareIntersection: '\\u2293',\n\tSquareSubset: '\\u228F',\n\tSquareSubsetEqual: '\\u2291',\n\tSquareSuperset: '\\u2290',\n\tSquareSupersetEqual: '\\u2292',\n\tSquareUnion: '\\u2294',\n\tsquarf: '\\u25AA',\n\tsquf: '\\u25AA',\n\tsrarr: '\\u2192',\n\tSscr: '\\uD835\\uDCAE',\n\tsscr: '\\uD835\\uDCC8',\n\tssetmn: '\\u2216',\n\tssmile: '\\u2323',\n\tsstarf: '\\u22C6',\n\tStar: '\\u22C6',\n\tstar: '\\u2606',\n\tstarf: '\\u2605',\n\tstraightepsilon: '\\u03F5',\n\tstraightphi: '\\u03D5',\n\tstrns: '\\u00AF',\n\tSub: '\\u22D0',\n\tsub: '\\u2282',\n\tsubdot: '\\u2ABD',\n\tsubE: '\\u2AC5',\n\tsube: '\\u2286',\n\tsubedot: '\\u2AC3',\n\tsubmult: '\\u2AC1',\n\tsubnE: '\\u2ACB',\n\tsubne: '\\u228A',\n\tsubplus: '\\u2ABF',\n\tsubrarr: '\\u2979',\n\tSubset: '\\u22D0',\n\tsubset: '\\u2282',\n\tsubseteq: '\\u2286',\n\tsubseteqq: '\\u2AC5',\n\tSubsetEqual: '\\u2286',\n\tsubsetneq: '\\u228A',\n\tsubsetneqq: '\\u2ACB',\n\tsubsim: '\\u2AC7',\n\tsubsub: '\\u2AD5',\n\tsubsup: '\\u2AD3',\n\tsucc: '\\u227B',\n\tsuccapprox: '\\u2AB8',\n\tsucccurlyeq: '\\u227D',\n\tSucceeds: '\\u227B',\n\tSucceedsEqual: '\\u2AB0',\n\tSucceedsSlantEqual: '\\u227D',\n\tSucceedsTilde: '\\u227F',\n\tsucceq: '\\u2AB0',\n\tsuccnapprox: '\\u2ABA',\n\tsuccneqq: '\\u2AB6',\n\tsuccnsim: '\\u22E9',\n\tsuccsim: '\\u227F',\n\tSuchThat: '\\u220B',\n\tSum: '\\u2211',\n\tsum: '\\u2211',\n\tsung: '\\u266A',\n\tSup: '\\u22D1',\n\tsup: '\\u2283',\n\tsup1: '\\u00B9',\n\tsup2: '\\u00B2',\n\tsup3: '\\u00B3',\n\tsupdot: '\\u2ABE',\n\tsupdsub: '\\u2AD8',\n\tsupE: '\\u2AC6',\n\tsupe: '\\u2287',\n\tsupedot: '\\u2AC4',\n\tSuperset: '\\u2283',\n\tSupersetEqual: '\\u2287',\n\tsuphsol: '\\u27C9',\n\tsuphsub: '\\u2AD7',\n\tsuplarr: '\\u297B',\n\tsupmult: '\\u2AC2',\n\tsupnE: '\\u2ACC',\n\tsupne: '\\u228B',\n\tsupplus: '\\u2AC0',\n\tSupset: '\\u22D1',\n\tsupset: '\\u2283',\n\tsupseteq: '\\u2287',\n\tsupseteqq: '\\u2AC6',\n\tsupsetneq: '\\u228B',\n\tsupsetneqq: '\\u2ACC',\n\tsupsim: '\\u2AC8',\n\tsupsub: '\\u2AD4',\n\tsupsup: '\\u2AD6',\n\tswarhk: '\\u2926',\n\tswArr: '\\u21D9',\n\tswarr: '\\u2199',\n\tswarrow: '\\u2199',\n\tswnwar: '\\u292A',\n\tszlig: '\\u00DF',\n\tTab: '\\u0009',\n\ttarget: '\\u2316',\n\tTau: '\\u03A4',\n\ttau: '\\u03C4',\n\ttbrk: '\\u23B4',\n\tTcaron: '\\u0164',\n\ttcaron: '\\u0165',\n\tTcedil: '\\u0162',\n\ttcedil: '\\u0163',\n\tTcy: '\\u0422',\n\ttcy: '\\u0442',\n\ttdot: '\\u20DB',\n\ttelrec: '\\u2315',\n\tTfr: '\\uD835\\uDD17',\n\ttfr: '\\uD835\\uDD31',\n\tthere4: '\\u2234',\n\tTherefore: '\\u2234',\n\ttherefore: '\\u2234',\n\tTheta: '\\u0398',\n\ttheta: '\\u03B8',\n\tthetasym: '\\u03D1',\n\tthetav: '\\u03D1',\n\tthickapprox: '\\u2248',\n\tthicksim: '\\u223C',\n\tThickSpace: '\\u205F\\u200A',\n\tthinsp: '\\u2009',\n\tThinSpace: '\\u2009',\n\tthkap: '\\u2248',\n\tthksim: '\\u223C',\n\tTHORN: '\\u00DE',\n\tthorn: '\\u00FE',\n\tTilde: '\\u223C',\n\ttilde: '\\u02DC',\n\tTildeEqual: '\\u2243',\n\tTildeFullEqual: '\\u2245',\n\tTildeTilde: '\\u2248',\n\ttimes: '\\u00D7',\n\ttimesb: '\\u22A0',\n\ttimesbar: '\\u2A31',\n\ttimesd: '\\u2A30',\n\ttint: '\\u222D',\n\ttoea: '\\u2928',\n\ttop: '\\u22A4',\n\ttopbot: '\\u2336',\n\ttopcir: '\\u2AF1',\n\tTopf: '\\uD835\\uDD4B',\n\ttopf: '\\uD835\\uDD65',\n\ttopfork: '\\u2ADA',\n\ttosa: '\\u2929',\n\ttprime: '\\u2034',\n\tTRADE: '\\u2122',\n\ttrade: '\\u2122',\n\ttriangle: '\\u25B5',\n\ttriangledown: '\\u25BF',\n\ttriangleleft: '\\u25C3',\n\ttrianglelefteq: '\\u22B4',\n\ttriangleq: '\\u225C',\n\ttriangleright: '\\u25B9',\n\ttrianglerighteq: '\\u22B5',\n\ttridot: '\\u25EC',\n\ttrie: '\\u225C',\n\ttriminus: '\\u2A3A',\n\tTripleDot: '\\u20DB',\n\ttriplus: '\\u2A39',\n\ttrisb: '\\u29CD',\n\ttritime: '\\u2A3B',\n\ttrpezium: '\\u23E2',\n\tTscr: '\\uD835\\uDCAF',\n\ttscr: '\\uD835\\uDCC9',\n\tTScy: '\\u0426',\n\ttscy: '\\u0446',\n\tTSHcy: '\\u040B',\n\ttshcy: '\\u045B',\n\tTstrok: '\\u0166',\n\ttstrok: '\\u0167',\n\ttwixt: '\\u226C',\n\ttwoheadleftarrow: '\\u219E',\n\ttwoheadrightarrow: '\\u21A0',\n\tUacute: '\\u00DA',\n\tuacute: '\\u00FA',\n\tUarr: '\\u219F',\n\tuArr: '\\u21D1',\n\tuarr: '\\u2191',\n\tUarrocir: '\\u2949',\n\tUbrcy: '\\u040E',\n\tubrcy: '\\u045E',\n\tUbreve: '\\u016C',\n\tubreve: '\\u016D',\n\tUcirc: '\\u00DB',\n\tucirc: '\\u00FB',\n\tUcy: '\\u0423',\n\tucy: '\\u0443',\n\tudarr: '\\u21C5',\n\tUdblac: '\\u0170',\n\tudblac: '\\u0171',\n\tudhar: '\\u296E',\n\tufisht: '\\u297E',\n\tUfr: '\\uD835\\uDD18',\n\tufr: '\\uD835\\uDD32',\n\tUgrave: '\\u00D9',\n\tugrave: '\\u00F9',\n\tuHar: '\\u2963',\n\tuharl: '\\u21BF',\n\tuharr: '\\u21BE',\n\tuhblk: '\\u2580',\n\tulcorn: '\\u231C',\n\tulcorner: '\\u231C',\n\tulcrop: '\\u230F',\n\tultri: '\\u25F8',\n\tUmacr: '\\u016A',\n\tumacr: '\\u016B',\n\tuml: '\\u00A8',\n\tUnderBar: '\\u005F',\n\tUnderBrace: '\\u23DF',\n\tUnderBracket: '\\u23B5',\n\tUnderParenthesis: '\\u23DD',\n\tUnion: '\\u22C3',\n\tUnionPlus: '\\u228E',\n\tUogon: '\\u0172',\n\tuogon: '\\u0173',\n\tUopf: '\\uD835\\uDD4C',\n\tuopf: '\\uD835\\uDD66',\n\tUpArrow: '\\u2191',\n\tUparrow: '\\u21D1',\n\tuparrow: '\\u2191',\n\tUpArrowBar: '\\u2912',\n\tUpArrowDownArrow: '\\u21C5',\n\tUpDownArrow: '\\u2195',\n\tUpdownarrow: '\\u21D5',\n\tupdownarrow: '\\u2195',\n\tUpEquilibrium: '\\u296E',\n\tupharpoonleft: '\\u21BF',\n\tupharpoonright: '\\u21BE',\n\tuplus: '\\u228E',\n\tUpperLeftArrow: '\\u2196',\n\tUpperRightArrow: '\\u2197',\n\tUpsi: '\\u03D2',\n\tupsi: '\\u03C5',\n\tupsih: '\\u03D2',\n\tUpsilon: '\\u03A5',\n\tupsilon: '\\u03C5',\n\tUpTee: '\\u22A5',\n\tUpTeeArrow: '\\u21A5',\n\tupuparrows: '\\u21C8',\n\turcorn: '\\u231D',\n\turcorner: '\\u231D',\n\turcrop: '\\u230E',\n\tUring: '\\u016E',\n\turing: '\\u016F',\n\turtri: '\\u25F9',\n\tUscr: '\\uD835\\uDCB0',\n\tuscr: '\\uD835\\uDCCA',\n\tutdot: '\\u22F0',\n\tUtilde: '\\u0168',\n\tutilde: '\\u0169',\n\tutri: '\\u25B5',\n\tutrif: '\\u25B4',\n\tuuarr: '\\u21C8',\n\tUuml: '\\u00DC',\n\tuuml: '\\u00FC',\n\tuwangle: '\\u29A7',\n\tvangrt: '\\u299C',\n\tvarepsilon: '\\u03F5',\n\tvarkappa: '\\u03F0',\n\tvarnothing: '\\u2205',\n\tvarphi: '\\u03D5',\n\tvarpi: '\\u03D6',\n\tvarpropto: '\\u221D',\n\tvArr: '\\u21D5',\n\tvarr: '\\u2195',\n\tvarrho: '\\u03F1',\n\tvarsigma: '\\u03C2',\n\tvarsubsetneq: '\\u228A\\uFE00',\n\tvarsubsetneqq: '\\u2ACB\\uFE00',\n\tvarsupsetneq: '\\u228B\\uFE00',\n\tvarsupsetneqq: '\\u2ACC\\uFE00',\n\tvartheta: '\\u03D1',\n\tvartriangleleft: '\\u22B2',\n\tvartriangleright: '\\u22B3',\n\tVbar: '\\u2AEB',\n\tvBar: '\\u2AE8',\n\tvBarv: '\\u2AE9',\n\tVcy: '\\u0412',\n\tvcy: '\\u0432',\n\tVDash: '\\u22AB',\n\tVdash: '\\u22A9',\n\tvDash: '\\u22A8',\n\tvdash: '\\u22A2',\n\tVdashl: '\\u2AE6',\n\tVee: '\\u22C1',\n\tvee: '\\u2228',\n\tveebar: '\\u22BB',\n\tveeeq: '\\u225A',\n\tvellip: '\\u22EE',\n\tVerbar: '\\u2016',\n\tverbar: '\\u007C',\n\tVert: '\\u2016',\n\tvert: '\\u007C',\n\tVerticalBar: '\\u2223',\n\tVerticalLine: '\\u007C',\n\tVerticalSeparator: '\\u2758',\n\tVerticalTilde: '\\u2240',\n\tVeryThinSpace: '\\u200A',\n\tVfr: '\\uD835\\uDD19',\n\tvfr: '\\uD835\\uDD33',\n\tvltri: '\\u22B2',\n\tvnsub: '\\u2282\\u20D2',\n\tvnsup: '\\u2283\\u20D2',\n\tVopf: '\\uD835\\uDD4D',\n\tvopf: '\\uD835\\uDD67',\n\tvprop: '\\u221D',\n\tvrtri: '\\u22B3',\n\tVscr: '\\uD835\\uDCB1',\n\tvscr: '\\uD835\\uDCCB',\n\tvsubnE: '\\u2ACB\\uFE00',\n\tvsubne: '\\u228A\\uFE00',\n\tvsupnE: '\\u2ACC\\uFE00',\n\tvsupne: '\\u228B\\uFE00',\n\tVvdash: '\\u22AA',\n\tvzigzag: '\\u299A',\n\tWcirc: '\\u0174',\n\twcirc: '\\u0175',\n\twedbar: '\\u2A5F',\n\tWedge: '\\u22C0',\n\twedge: '\\u2227',\n\twedgeq: '\\u2259',\n\tweierp: '\\u2118',\n\tWfr: '\\uD835\\uDD1A',\n\twfr: '\\uD835\\uDD34',\n\tWopf: '\\uD835\\uDD4E',\n\twopf: '\\uD835\\uDD68',\n\twp: '\\u2118',\n\twr: '\\u2240',\n\twreath: '\\u2240',\n\tWscr: '\\uD835\\uDCB2',\n\twscr: '\\uD835\\uDCCC',\n\txcap: '\\u22C2',\n\txcirc: '\\u25EF',\n\txcup: '\\u22C3',\n\txdtri: '\\u25BD',\n\tXfr: '\\uD835\\uDD1B',\n\txfr: '\\uD835\\uDD35',\n\txhArr: '\\u27FA',\n\txharr: '\\u27F7',\n\tXi: '\\u039E',\n\txi: '\\u03BE',\n\txlArr: '\\u27F8',\n\txlarr: '\\u27F5',\n\txmap: '\\u27FC',\n\txnis: '\\u22FB',\n\txodot: '\\u2A00',\n\tXopf: '\\uD835\\uDD4F',\n\txopf: '\\uD835\\uDD69',\n\txoplus: '\\u2A01',\n\txotime: '\\u2A02',\n\txrArr: '\\u27F9',\n\txrarr: '\\u27F6',\n\tXscr: '\\uD835\\uDCB3',\n\txscr: '\\uD835\\uDCCD',\n\txsqcup: '\\u2A06',\n\txuplus: '\\u2A04',\n\txutri: '\\u25B3',\n\txvee: '\\u22C1',\n\txwedge: '\\u22C0',\n\tYacute: '\\u00DD',\n\tyacute: '\\u00FD',\n\tYAcy: '\\u042F',\n\tyacy: '\\u044F',\n\tYcirc: '\\u0176',\n\tycirc: '\\u0177',\n\tYcy: '\\u042B',\n\tycy: '\\u044B',\n\tyen: '\\u00A5',\n\tYfr: '\\uD835\\uDD1C',\n\tyfr: '\\uD835\\uDD36',\n\tYIcy: '\\u0407',\n\tyicy: '\\u0457',\n\tYopf: '\\uD835\\uDD50',\n\tyopf: '\\uD835\\uDD6A',\n\tYscr: '\\uD835\\uDCB4',\n\tyscr: '\\uD835\\uDCCE',\n\tYUcy: '\\u042E',\n\tyucy: '\\u044E',\n\tYuml: '\\u0178',\n\tyuml: '\\u00FF',\n\tZacute: '\\u0179',\n\tzacute: '\\u017A',\n\tZcaron: '\\u017D',\n\tzcaron: '\\u017E',\n\tZcy: '\\u0417',\n\tzcy: '\\u0437',\n\tZdot: '\\u017B',\n\tzdot: '\\u017C',\n\tzeetrf: '\\u2128',\n\tZeroWidthSpace: '\\u200B',\n\tZeta: '\\u0396',\n\tzeta: '\\u03B6',\n\tZfr: '\\u2128',\n\tzfr: '\\uD835\\uDD37',\n\tZHcy: '\\u0416',\n\tzhcy: '\\u0436',\n\tzigrarr: '\\u21DD',\n\tZopf: '\\u2124',\n\tzopf: '\\uD835\\uDD6B',\n\tZscr: '\\uD835\\uDCB5',\n\tzscr: '\\uD835\\uDCCF',\n\tzwj: '\\u200D',\n\tzwnj: '\\u200C',\n});\n\n/**\n * @deprecated use `HTML_ENTITIES` instead\n * @see HTML_ENTITIES\n */\nexports.entityMap = exports.HTML_ENTITIES;\n","var dom = require('./dom')\nexports.DOMImplementation = dom.DOMImplementation\nexports.XMLSerializer = dom.XMLSerializer\nexports.DOMParser = require('./dom-parser').DOMParser\n","var NAMESPACE = require(\"./conventions\").NAMESPACE;\n\n//[4] \tNameStartChar\t ::= \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n//[4a] \tNameChar\t ::= \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\n//[5] \tName\t ::= \tNameStartChar (NameChar)*\nvar nameStartChar = /[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]///\\u10000-\\uEFFFF\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\n\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\nvar S_TAG = 0;//tag name offerring\nvar S_ATTR = 1;//attr name offerring\nvar S_ATTR_SPACE=2;//attr name end and space offer\nvar S_EQ = 3;//=space?\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\nvar S_TAG_CLOSE = 7;//closed el\n\n/**\n * Creates an error that will not be caught by XMLReader aka the SAX parser.\n *\n * @param {string} message\n * @param {any?} locator Optional, can provide details about the location in the source\n * @constructor\n */\nfunction ParseError(message, locator) {\n\tthis.message = message\n\tthis.locator = locator\n\tif(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);\n}\nParseError.prototype = new Error();\nParseError.prototype.name = ParseError.name\n\nfunction XMLReader(){\n\n}\n\nXMLReader.prototype = {\n\tparse:function(source,defaultNSMap,entityMap){\n\t\tvar domBuilder = this.domBuilder;\n\t\tdomBuilder.startDocument();\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\n\t\tparse(source,defaultNSMap,entityMap,\n\t\t\t\tdomBuilder,this.errorHandler);\n\t\tdomBuilder.endDocument();\n\t}\n}\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\n\tfunction fixedFromCharCode(code) {\n\t\t// String.prototype.fromCharCode does not supports\n\t\t// > 2 bytes unicode chars directly\n\t\tif (code > 0xffff) {\n\t\t\tcode -= 0x10000;\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\n\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\n\t\t} else {\n\t\t\treturn String.fromCharCode(code);\n\t\t}\n\t}\n\tfunction entityReplacer(a){\n\t\tvar k = a.slice(1,-1);\n\t\tif (Object.hasOwnProperty.call(entityMap, k)) {\n\t\t\treturn entityMap[k];\n\t\t}else if(k.charAt(0) === '#'){\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\n\t\t}else{\n\t\t\terrorHandler.error('entity not found:'+a);\n\t\t\treturn a;\n\t\t}\n\t}\n\tfunction appendText(end){//has some bugs\n\t\tif(end>start){\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\tlocator&&position(start);\n\t\t\tdomBuilder.characters(xt,0,end-start);\n\t\t\tstart = end\n\t\t}\n\t}\n\tfunction position(p,m){\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\n\t\t\tlineStart = m.index;\n\t\t\tlineEnd = lineStart + m[0].length;\n\t\t\tlocator.lineNumber++;\n\t\t\t//console.log('line++:',locator,startPos,endPos)\n\t\t}\n\t\tlocator.columnNumber = p-lineStart+1;\n\t}\n\tvar lineStart = 0;\n\tvar lineEnd = 0;\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\n\tvar locator = domBuilder.locator;\n\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\n\tvar closeMap = {};\n\tvar start = 0;\n\twhile(true){\n\t\ttry{\n\t\t\tvar tagStart = source.indexOf('<',start);\n\t\t\tif(tagStart<0){\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\n\t\t\t\t\tvar doc = domBuilder.doc;\n\t \t\t\tvar text = doc.createTextNode(source.substr(start));\n\t \t\t\tdoc.appendChild(text);\n\t \t\t\tdomBuilder.currentElement = text;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tagStart>start){\n\t\t\t\tappendText(tagStart);\n\t\t\t}\n\t\t\tswitch(source.charAt(tagStart+1)){\n\t\t\tcase '/':\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\n\t\t\t\tvar tagName = source.substring(tagStart + 2, end).replace(/[ \\t\\n\\r]+$/g, '');\n\t\t\t\tvar config = parseStack.pop();\n\t\t\t\tif(end<0){\n\n\t \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\n\t \t\tend = tagStart+1+tagName.length;\n\t \t}else if(tagName.match(/\\s\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\n\t\t\t\tbreak;\n\t\t\tcase '!':// start){\n\t\t\tstart = end;\n\t\t}else{\n\t\t\t//TODO: 这里有可能sax回退,有位置错误风险\n\t\t\tappendText(Math.max(tagStart,start)+1);\n\t\t}\n\t}\n}\nfunction copyLocator(f,t){\n\tt.lineNumber = f.lineNumber;\n\tt.columnNumber = f.columnNumber;\n\treturn t;\n}\n\n/**\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\n */\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\n\n\t/**\n\t * @param {string} qname\n\t * @param {string} value\n\t * @param {number} startIndex\n\t */\n\tfunction addAttribute(qname, value, startIndex) {\n\t\tif (el.attributeNames.hasOwnProperty(qname)) {\n\t\t\terrorHandler.fatalError('Attribute ' + qname + ' redefined')\n\t\t}\n\t\tel.addValue(\n\t\t\tqname,\n\t\t\t// @see https://www.w3.org/TR/xml/#AVNormalize\n\t\t\t// since the xmldom sax parser does not \"interpret\" DTD the following is not implemented:\n\t\t\t// - recursive replacement of (DTD) entity references\n\t\t\t// - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA\n\t\t\tvalue.replace(/[\\t\\n\\r]/g, ' ').replace(/&#?\\w+;/g, entityReplacer),\n\t\t\tstartIndex\n\t\t)\n\t}\n\tvar attrName;\n\tvar value;\n\tvar p = ++start;\n\tvar s = S_TAG;//status\n\twhile(true){\n\t\tvar c = source.charAt(p);\n\t\tswitch(c){\n\t\tcase '=':\n\t\t\tif(s === S_ATTR){//attrName\n\t\t\t\tattrName = source.slice(start,p);\n\t\t\t\ts = S_EQ;\n\t\t\t}else if(s === S_ATTR_SPACE){\n\t\t\t\ts = S_EQ;\n\t\t\t}else{\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\n\t\t\t\tthrow new Error('attribute equal must after attrName'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '\\'':\n\t\tcase '\"':\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\n\t\t\t\t){//equal\n\t\t\t\tif(s === S_ATTR){\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t}\n\t\t\t\tstart = p+1;\n\t\t\t\tp = source.indexOf(c,start)\n\t\t\t\tif(p>0){\n\t\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\t\taddAttribute(attrName, value, start-1);\n\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t}else{\n\t\t\t\t\t//fatalError: no end quot match\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\n\t\t\t\t}\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\n\t\t\t\tstart = p+1;\n\t\t\t\ts = S_ATTR_END\n\t\t\t}else{\n\t\t\t\t//fatalError: no equal before\n\t\t\t\tthrow new Error('attribute value must after \"=\"'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\ts =S_TAG_CLOSE;\n\t\t\t\tel.closed = true;\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\tcase S_ATTR:\n\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tel.closed = true;\n\t\t\t\tbreak;\n\t\t\t//case S_EQ:\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\") // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ''://end document\n\t\t\terrorHandler.error('unexpected end of input');\n\t\t\tif(s == S_TAG){\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\t}\n\t\t\treturn p;\n\t\tcase '>':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\tbreak;//normal\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\n\t\t\tcase S_ATTR:\n\t\t\t\tvalue = source.slice(start,p);\n\t\t\t\tif(value.slice(-1) === '/'){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tvalue = value.slice(0,-1)\n\t\t\t\t}\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tif(s === S_ATTR_SPACE){\n\t\t\t\t\tvalue = attrName;\n\t\t\t\t}\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\t}else{\n\t\t\t\t\tif(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(value, value, start)\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase S_EQ:\n\t\t\t\tthrow new Error('attribute value missed!!');\n\t\t\t}\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\n\t\t\treturn p;\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\n\t\tcase '\\u0080':\n\t\t\tc = ' ';\n\t\tdefault:\n\t\t\tif(c<= ' '){//space\n\t\t\t\tswitch(s){\n\t\t\t\tcase S_TAG:\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR:\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t\ts = S_ATTR_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\tvar value = source.slice(start, p);\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\t//case S_TAG_SPACE:\n\t\t\t\t//case S_EQ:\n\t\t\t\t//case S_ATTR_SPACE:\n\t\t\t\t//\tvoid();break;\n\t\t\t\t//case S_TAG_CLOSE:\n\t\t\t\t\t//ignore warning\n\t\t\t\t}\n\t\t\t}else{//not space\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\n\t\t\t\tswitch(s){\n\t\t\t\t//case S_TAG:void();break;\n\t\t\t\t//case S_ATTR:void();break;\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tvar tagName = el.tagName;\n\t\t\t\t\tif (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(attrName, attrName, start);\n\t\t\t\t\tstart = p;\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\n\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_EQ:\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\n\t\t\t\t}\n\t\t\t}\n\t\t}//end outer switch\n\t\t//console.log('p++',p)\n\t\tp++;\n\t}\n}\n/**\n * @return true if has new namespace define\n */\nfunction appendElement(el,domBuilder,currentNSMap){\n\tvar tagName = el.tagName;\n\tvar localNSMap = null;\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\tvar i = el.length;\n\twhile(i--){\n\t\tvar a = el[i];\n\t\tvar qName = a.qName;\n\t\tvar value = a.value;\n\t\tvar nsp = qName.indexOf(':');\n\t\tif(nsp>0){\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\n\t\t\tvar localName = qName.slice(nsp+1);\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\n\t\t}else{\n\t\t\tlocalName = qName;\n\t\t\tprefix = null\n\t\t\tnsPrefix = qName === 'xmlns' && ''\n\t\t}\n\t\t//can not set prefix,because prefix !== ''\n\t\ta.localName = localName ;\n\t\t//prefix == null for no ns prefix attribute\n\t\tif(nsPrefix !== false){//hack!!\n\t\t\tif(localNSMap == null){\n\t\t\t\tlocalNSMap = {}\n\t\t\t\t//console.log(currentNSMap,0)\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\n\t\t\t\t//console.log(currentNSMap,1)\n\t\t\t}\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\n\t\t\ta.uri = NAMESPACE.XMLNS\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value)\n\t\t}\n\t}\n\tvar i = el.length;\n\twhile(i--){\n\t\ta = el[i];\n\t\tvar prefix = a.prefix;\n\t\tif(prefix){//no prefix attribute has no namespace\n\t\t\tif(prefix === 'xml'){\n\t\t\t\ta.uri = NAMESPACE.XML;\n\t\t\t}if(prefix !== 'xmlns'){\n\t\t\t\ta.uri = currentNSMap[prefix || '']\n\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\n\t\t\t}\n\t\t}\n\t}\n\tvar nsp = tagName.indexOf(':');\n\tif(nsp>0){\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\n\t}else{\n\t\tprefix = null;//important!!\n\t\tlocalName = el.localName = tagName;\n\t}\n\t//no prefix element has default namespace\n\tvar ns = el.uri = currentNSMap[prefix || ''];\n\tdomBuilder.startElement(ns,localName,tagName,el);\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\n\t//localNSMap = null\n\tif(el.closed){\n\t\tdomBuilder.endElement(ns,localName,tagName);\n\t\tif(localNSMap){\n\t\t\tfor (prefix in localNSMap) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\tel.currentNSMap = currentNSMap;\n\t\tel.localNSMap = localNSMap;\n\t\t//parseStack.push(el);\n\t\treturn true;\n\t}\n}\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\n\tif(/^(?:script|textarea)$/i.test(tagName)){\n\t\tvar elEndStart = source.indexOf('',elStartEnd);\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\n\t\tif(/[&<]/.test(text)){\n\t\t\tif(/^script$/i.test(tagName)){\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\n\t\t\t\t\t//lexHandler.startCDATA();\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\t\t//lexHandler.endCDATA();\n\t\t\t\t\treturn elEndStart;\n\t\t\t\t//}\n\t\t\t}//}else{//text area\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\treturn elEndStart;\n\t\t\t//}\n\n\t\t}\n\t}\n\treturn elStartEnd+1;\n}\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\n\t//if(tagName in closeMap){\n\tvar pos = closeMap[tagName];\n\tif(pos == null){\n\t\t//console.log(tagName)\n\t\tpos = source.lastIndexOf('')\n\t\tif(pos',start+4);\n\t\t\t//append comment source.substring(4,end)//\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM ', sysid, '>');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i',\n\tlt: '<',\n\tquot: '\"',\n});\n\n/**\n * A map of all entities that are detected in an HTML document.\n * They contain all entries from `XML_ENTITIES`.\n *\n * @see XML_ENTITIES\n * @see DOMParser.parseFromString\n * @see DOMImplementation.prototype.createHTMLDocument\n * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec\n * @see https://html.spec.whatwg.org/entities.json JSON\n * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names\n * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)\n */\nexports.HTML_ENTITIES = freeze({\n\tAacute: '\\u00C1',\n\taacute: '\\u00E1',\n\tAbreve: '\\u0102',\n\tabreve: '\\u0103',\n\tac: '\\u223E',\n\tacd: '\\u223F',\n\tacE: '\\u223E\\u0333',\n\tAcirc: '\\u00C2',\n\tacirc: '\\u00E2',\n\tacute: '\\u00B4',\n\tAcy: '\\u0410',\n\tacy: '\\u0430',\n\tAElig: '\\u00C6',\n\taelig: '\\u00E6',\n\taf: '\\u2061',\n\tAfr: '\\uD835\\uDD04',\n\tafr: '\\uD835\\uDD1E',\n\tAgrave: '\\u00C0',\n\tagrave: '\\u00E0',\n\talefsym: '\\u2135',\n\taleph: '\\u2135',\n\tAlpha: '\\u0391',\n\talpha: '\\u03B1',\n\tAmacr: '\\u0100',\n\tamacr: '\\u0101',\n\tamalg: '\\u2A3F',\n\tAMP: '\\u0026',\n\tamp: '\\u0026',\n\tAnd: '\\u2A53',\n\tand: '\\u2227',\n\tandand: '\\u2A55',\n\tandd: '\\u2A5C',\n\tandslope: '\\u2A58',\n\tandv: '\\u2A5A',\n\tang: '\\u2220',\n\tange: '\\u29A4',\n\tangle: '\\u2220',\n\tangmsd: '\\u2221',\n\tangmsdaa: '\\u29A8',\n\tangmsdab: '\\u29A9',\n\tangmsdac: '\\u29AA',\n\tangmsdad: '\\u29AB',\n\tangmsdae: '\\u29AC',\n\tangmsdaf: '\\u29AD',\n\tangmsdag: '\\u29AE',\n\tangmsdah: '\\u29AF',\n\tangrt: '\\u221F',\n\tangrtvb: '\\u22BE',\n\tangrtvbd: '\\u299D',\n\tangsph: '\\u2222',\n\tangst: '\\u00C5',\n\tangzarr: '\\u237C',\n\tAogon: '\\u0104',\n\taogon: '\\u0105',\n\tAopf: '\\uD835\\uDD38',\n\taopf: '\\uD835\\uDD52',\n\tap: '\\u2248',\n\tapacir: '\\u2A6F',\n\tapE: '\\u2A70',\n\tape: '\\u224A',\n\tapid: '\\u224B',\n\tapos: '\\u0027',\n\tApplyFunction: '\\u2061',\n\tapprox: '\\u2248',\n\tapproxeq: '\\u224A',\n\tAring: '\\u00C5',\n\taring: '\\u00E5',\n\tAscr: '\\uD835\\uDC9C',\n\tascr: '\\uD835\\uDCB6',\n\tAssign: '\\u2254',\n\tast: '\\u002A',\n\tasymp: '\\u2248',\n\tasympeq: '\\u224D',\n\tAtilde: '\\u00C3',\n\tatilde: '\\u00E3',\n\tAuml: '\\u00C4',\n\tauml: '\\u00E4',\n\tawconint: '\\u2233',\n\tawint: '\\u2A11',\n\tbackcong: '\\u224C',\n\tbackepsilon: '\\u03F6',\n\tbackprime: '\\u2035',\n\tbacksim: '\\u223D',\n\tbacksimeq: '\\u22CD',\n\tBackslash: '\\u2216',\n\tBarv: '\\u2AE7',\n\tbarvee: '\\u22BD',\n\tBarwed: '\\u2306',\n\tbarwed: '\\u2305',\n\tbarwedge: '\\u2305',\n\tbbrk: '\\u23B5',\n\tbbrktbrk: '\\u23B6',\n\tbcong: '\\u224C',\n\tBcy: '\\u0411',\n\tbcy: '\\u0431',\n\tbdquo: '\\u201E',\n\tbecaus: '\\u2235',\n\tBecause: '\\u2235',\n\tbecause: '\\u2235',\n\tbemptyv: '\\u29B0',\n\tbepsi: '\\u03F6',\n\tbernou: '\\u212C',\n\tBernoullis: '\\u212C',\n\tBeta: '\\u0392',\n\tbeta: '\\u03B2',\n\tbeth: '\\u2136',\n\tbetween: '\\u226C',\n\tBfr: '\\uD835\\uDD05',\n\tbfr: '\\uD835\\uDD1F',\n\tbigcap: '\\u22C2',\n\tbigcirc: '\\u25EF',\n\tbigcup: '\\u22C3',\n\tbigodot: '\\u2A00',\n\tbigoplus: '\\u2A01',\n\tbigotimes: '\\u2A02',\n\tbigsqcup: '\\u2A06',\n\tbigstar: '\\u2605',\n\tbigtriangledown: '\\u25BD',\n\tbigtriangleup: '\\u25B3',\n\tbiguplus: '\\u2A04',\n\tbigvee: '\\u22C1',\n\tbigwedge: '\\u22C0',\n\tbkarow: '\\u290D',\n\tblacklozenge: '\\u29EB',\n\tblacksquare: '\\u25AA',\n\tblacktriangle: '\\u25B4',\n\tblacktriangledown: '\\u25BE',\n\tblacktriangleleft: '\\u25C2',\n\tblacktriangleright: '\\u25B8',\n\tblank: '\\u2423',\n\tblk12: '\\u2592',\n\tblk14: '\\u2591',\n\tblk34: '\\u2593',\n\tblock: '\\u2588',\n\tbne: '\\u003D\\u20E5',\n\tbnequiv: '\\u2261\\u20E5',\n\tbNot: '\\u2AED',\n\tbnot: '\\u2310',\n\tBopf: '\\uD835\\uDD39',\n\tbopf: '\\uD835\\uDD53',\n\tbot: '\\u22A5',\n\tbottom: '\\u22A5',\n\tbowtie: '\\u22C8',\n\tboxbox: '\\u29C9',\n\tboxDL: '\\u2557',\n\tboxDl: '\\u2556',\n\tboxdL: '\\u2555',\n\tboxdl: '\\u2510',\n\tboxDR: '\\u2554',\n\tboxDr: '\\u2553',\n\tboxdR: '\\u2552',\n\tboxdr: '\\u250C',\n\tboxH: '\\u2550',\n\tboxh: '\\u2500',\n\tboxHD: '\\u2566',\n\tboxHd: '\\u2564',\n\tboxhD: '\\u2565',\n\tboxhd: '\\u252C',\n\tboxHU: '\\u2569',\n\tboxHu: '\\u2567',\n\tboxhU: '\\u2568',\n\tboxhu: '\\u2534',\n\tboxminus: '\\u229F',\n\tboxplus: '\\u229E',\n\tboxtimes: '\\u22A0',\n\tboxUL: '\\u255D',\n\tboxUl: '\\u255C',\n\tboxuL: '\\u255B',\n\tboxul: '\\u2518',\n\tboxUR: '\\u255A',\n\tboxUr: '\\u2559',\n\tboxuR: '\\u2558',\n\tboxur: '\\u2514',\n\tboxV: '\\u2551',\n\tboxv: '\\u2502',\n\tboxVH: '\\u256C',\n\tboxVh: '\\u256B',\n\tboxvH: '\\u256A',\n\tboxvh: '\\u253C',\n\tboxVL: '\\u2563',\n\tboxVl: '\\u2562',\n\tboxvL: '\\u2561',\n\tboxvl: '\\u2524',\n\tboxVR: '\\u2560',\n\tboxVr: '\\u255F',\n\tboxvR: '\\u255E',\n\tboxvr: '\\u251C',\n\tbprime: '\\u2035',\n\tBreve: '\\u02D8',\n\tbreve: '\\u02D8',\n\tbrvbar: '\\u00A6',\n\tBscr: '\\u212C',\n\tbscr: '\\uD835\\uDCB7',\n\tbsemi: '\\u204F',\n\tbsim: '\\u223D',\n\tbsime: '\\u22CD',\n\tbsol: '\\u005C',\n\tbsolb: '\\u29C5',\n\tbsolhsub: '\\u27C8',\n\tbull: '\\u2022',\n\tbullet: '\\u2022',\n\tbump: '\\u224E',\n\tbumpE: '\\u2AAE',\n\tbumpe: '\\u224F',\n\tBumpeq: '\\u224E',\n\tbumpeq: '\\u224F',\n\tCacute: '\\u0106',\n\tcacute: '\\u0107',\n\tCap: '\\u22D2',\n\tcap: '\\u2229',\n\tcapand: '\\u2A44',\n\tcapbrcup: '\\u2A49',\n\tcapcap: '\\u2A4B',\n\tcapcup: '\\u2A47',\n\tcapdot: '\\u2A40',\n\tCapitalDifferentialD: '\\u2145',\n\tcaps: '\\u2229\\uFE00',\n\tcaret: '\\u2041',\n\tcaron: '\\u02C7',\n\tCayleys: '\\u212D',\n\tccaps: '\\u2A4D',\n\tCcaron: '\\u010C',\n\tccaron: '\\u010D',\n\tCcedil: '\\u00C7',\n\tccedil: '\\u00E7',\n\tCcirc: '\\u0108',\n\tccirc: '\\u0109',\n\tCconint: '\\u2230',\n\tccups: '\\u2A4C',\n\tccupssm: '\\u2A50',\n\tCdot: '\\u010A',\n\tcdot: '\\u010B',\n\tcedil: '\\u00B8',\n\tCedilla: '\\u00B8',\n\tcemptyv: '\\u29B2',\n\tcent: '\\u00A2',\n\tCenterDot: '\\u00B7',\n\tcenterdot: '\\u00B7',\n\tCfr: '\\u212D',\n\tcfr: '\\uD835\\uDD20',\n\tCHcy: '\\u0427',\n\tchcy: '\\u0447',\n\tcheck: '\\u2713',\n\tcheckmark: '\\u2713',\n\tChi: '\\u03A7',\n\tchi: '\\u03C7',\n\tcir: '\\u25CB',\n\tcirc: '\\u02C6',\n\tcirceq: '\\u2257',\n\tcirclearrowleft: '\\u21BA',\n\tcirclearrowright: '\\u21BB',\n\tcircledast: '\\u229B',\n\tcircledcirc: '\\u229A',\n\tcircleddash: '\\u229D',\n\tCircleDot: '\\u2299',\n\tcircledR: '\\u00AE',\n\tcircledS: '\\u24C8',\n\tCircleMinus: '\\u2296',\n\tCirclePlus: '\\u2295',\n\tCircleTimes: '\\u2297',\n\tcirE: '\\u29C3',\n\tcire: '\\u2257',\n\tcirfnint: '\\u2A10',\n\tcirmid: '\\u2AEF',\n\tcirscir: '\\u29C2',\n\tClockwiseContourIntegral: '\\u2232',\n\tCloseCurlyDoubleQuote: '\\u201D',\n\tCloseCurlyQuote: '\\u2019',\n\tclubs: '\\u2663',\n\tclubsuit: '\\u2663',\n\tColon: '\\u2237',\n\tcolon: '\\u003A',\n\tColone: '\\u2A74',\n\tcolone: '\\u2254',\n\tcoloneq: '\\u2254',\n\tcomma: '\\u002C',\n\tcommat: '\\u0040',\n\tcomp: '\\u2201',\n\tcompfn: '\\u2218',\n\tcomplement: '\\u2201',\n\tcomplexes: '\\u2102',\n\tcong: '\\u2245',\n\tcongdot: '\\u2A6D',\n\tCongruent: '\\u2261',\n\tConint: '\\u222F',\n\tconint: '\\u222E',\n\tContourIntegral: '\\u222E',\n\tCopf: '\\u2102',\n\tcopf: '\\uD835\\uDD54',\n\tcoprod: '\\u2210',\n\tCoproduct: '\\u2210',\n\tCOPY: '\\u00A9',\n\tcopy: '\\u00A9',\n\tcopysr: '\\u2117',\n\tCounterClockwiseContourIntegral: '\\u2233',\n\tcrarr: '\\u21B5',\n\tCross: '\\u2A2F',\n\tcross: '\\u2717',\n\tCscr: '\\uD835\\uDC9E',\n\tcscr: '\\uD835\\uDCB8',\n\tcsub: '\\u2ACF',\n\tcsube: '\\u2AD1',\n\tcsup: '\\u2AD0',\n\tcsupe: '\\u2AD2',\n\tctdot: '\\u22EF',\n\tcudarrl: '\\u2938',\n\tcudarrr: '\\u2935',\n\tcuepr: '\\u22DE',\n\tcuesc: '\\u22DF',\n\tcularr: '\\u21B6',\n\tcularrp: '\\u293D',\n\tCup: '\\u22D3',\n\tcup: '\\u222A',\n\tcupbrcap: '\\u2A48',\n\tCupCap: '\\u224D',\n\tcupcap: '\\u2A46',\n\tcupcup: '\\u2A4A',\n\tcupdot: '\\u228D',\n\tcupor: '\\u2A45',\n\tcups: '\\u222A\\uFE00',\n\tcurarr: '\\u21B7',\n\tcurarrm: '\\u293C',\n\tcurlyeqprec: '\\u22DE',\n\tcurlyeqsucc: '\\u22DF',\n\tcurlyvee: '\\u22CE',\n\tcurlywedge: '\\u22CF',\n\tcurren: '\\u00A4',\n\tcurvearrowleft: '\\u21B6',\n\tcurvearrowright: '\\u21B7',\n\tcuvee: '\\u22CE',\n\tcuwed: '\\u22CF',\n\tcwconint: '\\u2232',\n\tcwint: '\\u2231',\n\tcylcty: '\\u232D',\n\tDagger: '\\u2021',\n\tdagger: '\\u2020',\n\tdaleth: '\\u2138',\n\tDarr: '\\u21A1',\n\tdArr: '\\u21D3',\n\tdarr: '\\u2193',\n\tdash: '\\u2010',\n\tDashv: '\\u2AE4',\n\tdashv: '\\u22A3',\n\tdbkarow: '\\u290F',\n\tdblac: '\\u02DD',\n\tDcaron: '\\u010E',\n\tdcaron: '\\u010F',\n\tDcy: '\\u0414',\n\tdcy: '\\u0434',\n\tDD: '\\u2145',\n\tdd: '\\u2146',\n\tddagger: '\\u2021',\n\tddarr: '\\u21CA',\n\tDDotrahd: '\\u2911',\n\tddotseq: '\\u2A77',\n\tdeg: '\\u00B0',\n\tDel: '\\u2207',\n\tDelta: '\\u0394',\n\tdelta: '\\u03B4',\n\tdemptyv: '\\u29B1',\n\tdfisht: '\\u297F',\n\tDfr: '\\uD835\\uDD07',\n\tdfr: '\\uD835\\uDD21',\n\tdHar: '\\u2965',\n\tdharl: '\\u21C3',\n\tdharr: '\\u21C2',\n\tDiacriticalAcute: '\\u00B4',\n\tDiacriticalDot: '\\u02D9',\n\tDiacriticalDoubleAcute: '\\u02DD',\n\tDiacriticalGrave: '\\u0060',\n\tDiacriticalTilde: '\\u02DC',\n\tdiam: '\\u22C4',\n\tDiamond: '\\u22C4',\n\tdiamond: '\\u22C4',\n\tdiamondsuit: '\\u2666',\n\tdiams: '\\u2666',\n\tdie: '\\u00A8',\n\tDifferentialD: '\\u2146',\n\tdigamma: '\\u03DD',\n\tdisin: '\\u22F2',\n\tdiv: '\\u00F7',\n\tdivide: '\\u00F7',\n\tdivideontimes: '\\u22C7',\n\tdivonx: '\\u22C7',\n\tDJcy: '\\u0402',\n\tdjcy: '\\u0452',\n\tdlcorn: '\\u231E',\n\tdlcrop: '\\u230D',\n\tdollar: '\\u0024',\n\tDopf: '\\uD835\\uDD3B',\n\tdopf: '\\uD835\\uDD55',\n\tDot: '\\u00A8',\n\tdot: '\\u02D9',\n\tDotDot: '\\u20DC',\n\tdoteq: '\\u2250',\n\tdoteqdot: '\\u2251',\n\tDotEqual: '\\u2250',\n\tdotminus: '\\u2238',\n\tdotplus: '\\u2214',\n\tdotsquare: '\\u22A1',\n\tdoublebarwedge: '\\u2306',\n\tDoubleContourIntegral: '\\u222F',\n\tDoubleDot: '\\u00A8',\n\tDoubleDownArrow: '\\u21D3',\n\tDoubleLeftArrow: '\\u21D0',\n\tDoubleLeftRightArrow: '\\u21D4',\n\tDoubleLeftTee: '\\u2AE4',\n\tDoubleLongLeftArrow: '\\u27F8',\n\tDoubleLongLeftRightArrow: '\\u27FA',\n\tDoubleLongRightArrow: '\\u27F9',\n\tDoubleRightArrow: '\\u21D2',\n\tDoubleRightTee: '\\u22A8',\n\tDoubleUpArrow: '\\u21D1',\n\tDoubleUpDownArrow: '\\u21D5',\n\tDoubleVerticalBar: '\\u2225',\n\tDownArrow: '\\u2193',\n\tDownarrow: '\\u21D3',\n\tdownarrow: '\\u2193',\n\tDownArrowBar: '\\u2913',\n\tDownArrowUpArrow: '\\u21F5',\n\tDownBreve: '\\u0311',\n\tdowndownarrows: '\\u21CA',\n\tdownharpoonleft: '\\u21C3',\n\tdownharpoonright: '\\u21C2',\n\tDownLeftRightVector: '\\u2950',\n\tDownLeftTeeVector: '\\u295E',\n\tDownLeftVector: '\\u21BD',\n\tDownLeftVectorBar: '\\u2956',\n\tDownRightTeeVector: '\\u295F',\n\tDownRightVector: '\\u21C1',\n\tDownRightVectorBar: '\\u2957',\n\tDownTee: '\\u22A4',\n\tDownTeeArrow: '\\u21A7',\n\tdrbkarow: '\\u2910',\n\tdrcorn: '\\u231F',\n\tdrcrop: '\\u230C',\n\tDscr: '\\uD835\\uDC9F',\n\tdscr: '\\uD835\\uDCB9',\n\tDScy: '\\u0405',\n\tdscy: '\\u0455',\n\tdsol: '\\u29F6',\n\tDstrok: '\\u0110',\n\tdstrok: '\\u0111',\n\tdtdot: '\\u22F1',\n\tdtri: '\\u25BF',\n\tdtrif: '\\u25BE',\n\tduarr: '\\u21F5',\n\tduhar: '\\u296F',\n\tdwangle: '\\u29A6',\n\tDZcy: '\\u040F',\n\tdzcy: '\\u045F',\n\tdzigrarr: '\\u27FF',\n\tEacute: '\\u00C9',\n\teacute: '\\u00E9',\n\teaster: '\\u2A6E',\n\tEcaron: '\\u011A',\n\tecaron: '\\u011B',\n\tecir: '\\u2256',\n\tEcirc: '\\u00CA',\n\tecirc: '\\u00EA',\n\tecolon: '\\u2255',\n\tEcy: '\\u042D',\n\tecy: '\\u044D',\n\teDDot: '\\u2A77',\n\tEdot: '\\u0116',\n\teDot: '\\u2251',\n\tedot: '\\u0117',\n\tee: '\\u2147',\n\tefDot: '\\u2252',\n\tEfr: '\\uD835\\uDD08',\n\tefr: '\\uD835\\uDD22',\n\teg: '\\u2A9A',\n\tEgrave: '\\u00C8',\n\tegrave: '\\u00E8',\n\tegs: '\\u2A96',\n\tegsdot: '\\u2A98',\n\tel: '\\u2A99',\n\tElement: '\\u2208',\n\telinters: '\\u23E7',\n\tell: '\\u2113',\n\tels: '\\u2A95',\n\telsdot: '\\u2A97',\n\tEmacr: '\\u0112',\n\temacr: '\\u0113',\n\tempty: '\\u2205',\n\temptyset: '\\u2205',\n\tEmptySmallSquare: '\\u25FB',\n\temptyv: '\\u2205',\n\tEmptyVerySmallSquare: '\\u25AB',\n\temsp: '\\u2003',\n\temsp13: '\\u2004',\n\temsp14: '\\u2005',\n\tENG: '\\u014A',\n\teng: '\\u014B',\n\tensp: '\\u2002',\n\tEogon: '\\u0118',\n\teogon: '\\u0119',\n\tEopf: '\\uD835\\uDD3C',\n\teopf: '\\uD835\\uDD56',\n\tepar: '\\u22D5',\n\teparsl: '\\u29E3',\n\teplus: '\\u2A71',\n\tepsi: '\\u03B5',\n\tEpsilon: '\\u0395',\n\tepsilon: '\\u03B5',\n\tepsiv: '\\u03F5',\n\teqcirc: '\\u2256',\n\teqcolon: '\\u2255',\n\teqsim: '\\u2242',\n\teqslantgtr: '\\u2A96',\n\teqslantless: '\\u2A95',\n\tEqual: '\\u2A75',\n\tequals: '\\u003D',\n\tEqualTilde: '\\u2242',\n\tequest: '\\u225F',\n\tEquilibrium: '\\u21CC',\n\tequiv: '\\u2261',\n\tequivDD: '\\u2A78',\n\teqvparsl: '\\u29E5',\n\terarr: '\\u2971',\n\terDot: '\\u2253',\n\tEscr: '\\u2130',\n\tescr: '\\u212F',\n\tesdot: '\\u2250',\n\tEsim: '\\u2A73',\n\tesim: '\\u2242',\n\tEta: '\\u0397',\n\teta: '\\u03B7',\n\tETH: '\\u00D0',\n\teth: '\\u00F0',\n\tEuml: '\\u00CB',\n\teuml: '\\u00EB',\n\teuro: '\\u20AC',\n\texcl: '\\u0021',\n\texist: '\\u2203',\n\tExists: '\\u2203',\n\texpectation: '\\u2130',\n\tExponentialE: '\\u2147',\n\texponentiale: '\\u2147',\n\tfallingdotseq: '\\u2252',\n\tFcy: '\\u0424',\n\tfcy: '\\u0444',\n\tfemale: '\\u2640',\n\tffilig: '\\uFB03',\n\tfflig: '\\uFB00',\n\tffllig: '\\uFB04',\n\tFfr: '\\uD835\\uDD09',\n\tffr: '\\uD835\\uDD23',\n\tfilig: '\\uFB01',\n\tFilledSmallSquare: '\\u25FC',\n\tFilledVerySmallSquare: '\\u25AA',\n\tfjlig: '\\u0066\\u006A',\n\tflat: '\\u266D',\n\tfllig: '\\uFB02',\n\tfltns: '\\u25B1',\n\tfnof: '\\u0192',\n\tFopf: '\\uD835\\uDD3D',\n\tfopf: '\\uD835\\uDD57',\n\tForAll: '\\u2200',\n\tforall: '\\u2200',\n\tfork: '\\u22D4',\n\tforkv: '\\u2AD9',\n\tFouriertrf: '\\u2131',\n\tfpartint: '\\u2A0D',\n\tfrac12: '\\u00BD',\n\tfrac13: '\\u2153',\n\tfrac14: '\\u00BC',\n\tfrac15: '\\u2155',\n\tfrac16: '\\u2159',\n\tfrac18: '\\u215B',\n\tfrac23: '\\u2154',\n\tfrac25: '\\u2156',\n\tfrac34: '\\u00BE',\n\tfrac35: '\\u2157',\n\tfrac38: '\\u215C',\n\tfrac45: '\\u2158',\n\tfrac56: '\\u215A',\n\tfrac58: '\\u215D',\n\tfrac78: '\\u215E',\n\tfrasl: '\\u2044',\n\tfrown: '\\u2322',\n\tFscr: '\\u2131',\n\tfscr: '\\uD835\\uDCBB',\n\tgacute: '\\u01F5',\n\tGamma: '\\u0393',\n\tgamma: '\\u03B3',\n\tGammad: '\\u03DC',\n\tgammad: '\\u03DD',\n\tgap: '\\u2A86',\n\tGbreve: '\\u011E',\n\tgbreve: '\\u011F',\n\tGcedil: '\\u0122',\n\tGcirc: '\\u011C',\n\tgcirc: '\\u011D',\n\tGcy: '\\u0413',\n\tgcy: '\\u0433',\n\tGdot: '\\u0120',\n\tgdot: '\\u0121',\n\tgE: '\\u2267',\n\tge: '\\u2265',\n\tgEl: '\\u2A8C',\n\tgel: '\\u22DB',\n\tgeq: '\\u2265',\n\tgeqq: '\\u2267',\n\tgeqslant: '\\u2A7E',\n\tges: '\\u2A7E',\n\tgescc: '\\u2AA9',\n\tgesdot: '\\u2A80',\n\tgesdoto: '\\u2A82',\n\tgesdotol: '\\u2A84',\n\tgesl: '\\u22DB\\uFE00',\n\tgesles: '\\u2A94',\n\tGfr: '\\uD835\\uDD0A',\n\tgfr: '\\uD835\\uDD24',\n\tGg: '\\u22D9',\n\tgg: '\\u226B',\n\tggg: '\\u22D9',\n\tgimel: '\\u2137',\n\tGJcy: '\\u0403',\n\tgjcy: '\\u0453',\n\tgl: '\\u2277',\n\tgla: '\\u2AA5',\n\tglE: '\\u2A92',\n\tglj: '\\u2AA4',\n\tgnap: '\\u2A8A',\n\tgnapprox: '\\u2A8A',\n\tgnE: '\\u2269',\n\tgne: '\\u2A88',\n\tgneq: '\\u2A88',\n\tgneqq: '\\u2269',\n\tgnsim: '\\u22E7',\n\tGopf: '\\uD835\\uDD3E',\n\tgopf: '\\uD835\\uDD58',\n\tgrave: '\\u0060',\n\tGreaterEqual: '\\u2265',\n\tGreaterEqualLess: '\\u22DB',\n\tGreaterFullEqual: '\\u2267',\n\tGreaterGreater: '\\u2AA2',\n\tGreaterLess: '\\u2277',\n\tGreaterSlantEqual: '\\u2A7E',\n\tGreaterTilde: '\\u2273',\n\tGscr: '\\uD835\\uDCA2',\n\tgscr: '\\u210A',\n\tgsim: '\\u2273',\n\tgsime: '\\u2A8E',\n\tgsiml: '\\u2A90',\n\tGt: '\\u226B',\n\tGT: '\\u003E',\n\tgt: '\\u003E',\n\tgtcc: '\\u2AA7',\n\tgtcir: '\\u2A7A',\n\tgtdot: '\\u22D7',\n\tgtlPar: '\\u2995',\n\tgtquest: '\\u2A7C',\n\tgtrapprox: '\\u2A86',\n\tgtrarr: '\\u2978',\n\tgtrdot: '\\u22D7',\n\tgtreqless: '\\u22DB',\n\tgtreqqless: '\\u2A8C',\n\tgtrless: '\\u2277',\n\tgtrsim: '\\u2273',\n\tgvertneqq: '\\u2269\\uFE00',\n\tgvnE: '\\u2269\\uFE00',\n\tHacek: '\\u02C7',\n\thairsp: '\\u200A',\n\thalf: '\\u00BD',\n\thamilt: '\\u210B',\n\tHARDcy: '\\u042A',\n\thardcy: '\\u044A',\n\thArr: '\\u21D4',\n\tharr: '\\u2194',\n\tharrcir: '\\u2948',\n\tharrw: '\\u21AD',\n\tHat: '\\u005E',\n\thbar: '\\u210F',\n\tHcirc: '\\u0124',\n\thcirc: '\\u0125',\n\thearts: '\\u2665',\n\theartsuit: '\\u2665',\n\thellip: '\\u2026',\n\thercon: '\\u22B9',\n\tHfr: '\\u210C',\n\thfr: '\\uD835\\uDD25',\n\tHilbertSpace: '\\u210B',\n\thksearow: '\\u2925',\n\thkswarow: '\\u2926',\n\thoarr: '\\u21FF',\n\thomtht: '\\u223B',\n\thookleftarrow: '\\u21A9',\n\thookrightarrow: '\\u21AA',\n\tHopf: '\\u210D',\n\thopf: '\\uD835\\uDD59',\n\thorbar: '\\u2015',\n\tHorizontalLine: '\\u2500',\n\tHscr: '\\u210B',\n\thscr: '\\uD835\\uDCBD',\n\thslash: '\\u210F',\n\tHstrok: '\\u0126',\n\thstrok: '\\u0127',\n\tHumpDownHump: '\\u224E',\n\tHumpEqual: '\\u224F',\n\thybull: '\\u2043',\n\thyphen: '\\u2010',\n\tIacute: '\\u00CD',\n\tiacute: '\\u00ED',\n\tic: '\\u2063',\n\tIcirc: '\\u00CE',\n\ticirc: '\\u00EE',\n\tIcy: '\\u0418',\n\ticy: '\\u0438',\n\tIdot: '\\u0130',\n\tIEcy: '\\u0415',\n\tiecy: '\\u0435',\n\tiexcl: '\\u00A1',\n\tiff: '\\u21D4',\n\tIfr: '\\u2111',\n\tifr: '\\uD835\\uDD26',\n\tIgrave: '\\u00CC',\n\tigrave: '\\u00EC',\n\tii: '\\u2148',\n\tiiiint: '\\u2A0C',\n\tiiint: '\\u222D',\n\tiinfin: '\\u29DC',\n\tiiota: '\\u2129',\n\tIJlig: '\\u0132',\n\tijlig: '\\u0133',\n\tIm: '\\u2111',\n\tImacr: '\\u012A',\n\timacr: '\\u012B',\n\timage: '\\u2111',\n\tImaginaryI: '\\u2148',\n\timagline: '\\u2110',\n\timagpart: '\\u2111',\n\timath: '\\u0131',\n\timof: '\\u22B7',\n\timped: '\\u01B5',\n\tImplies: '\\u21D2',\n\tin: '\\u2208',\n\tincare: '\\u2105',\n\tinfin: '\\u221E',\n\tinfintie: '\\u29DD',\n\tinodot: '\\u0131',\n\tInt: '\\u222C',\n\tint: '\\u222B',\n\tintcal: '\\u22BA',\n\tintegers: '\\u2124',\n\tIntegral: '\\u222B',\n\tintercal: '\\u22BA',\n\tIntersection: '\\u22C2',\n\tintlarhk: '\\u2A17',\n\tintprod: '\\u2A3C',\n\tInvisibleComma: '\\u2063',\n\tInvisibleTimes: '\\u2062',\n\tIOcy: '\\u0401',\n\tiocy: '\\u0451',\n\tIogon: '\\u012E',\n\tiogon: '\\u012F',\n\tIopf: '\\uD835\\uDD40',\n\tiopf: '\\uD835\\uDD5A',\n\tIota: '\\u0399',\n\tiota: '\\u03B9',\n\tiprod: '\\u2A3C',\n\tiquest: '\\u00BF',\n\tIscr: '\\u2110',\n\tiscr: '\\uD835\\uDCBE',\n\tisin: '\\u2208',\n\tisindot: '\\u22F5',\n\tisinE: '\\u22F9',\n\tisins: '\\u22F4',\n\tisinsv: '\\u22F3',\n\tisinv: '\\u2208',\n\tit: '\\u2062',\n\tItilde: '\\u0128',\n\titilde: '\\u0129',\n\tIukcy: '\\u0406',\n\tiukcy: '\\u0456',\n\tIuml: '\\u00CF',\n\tiuml: '\\u00EF',\n\tJcirc: '\\u0134',\n\tjcirc: '\\u0135',\n\tJcy: '\\u0419',\n\tjcy: '\\u0439',\n\tJfr: '\\uD835\\uDD0D',\n\tjfr: '\\uD835\\uDD27',\n\tjmath: '\\u0237',\n\tJopf: '\\uD835\\uDD41',\n\tjopf: '\\uD835\\uDD5B',\n\tJscr: '\\uD835\\uDCA5',\n\tjscr: '\\uD835\\uDCBF',\n\tJsercy: '\\u0408',\n\tjsercy: '\\u0458',\n\tJukcy: '\\u0404',\n\tjukcy: '\\u0454',\n\tKappa: '\\u039A',\n\tkappa: '\\u03BA',\n\tkappav: '\\u03F0',\n\tKcedil: '\\u0136',\n\tkcedil: '\\u0137',\n\tKcy: '\\u041A',\n\tkcy: '\\u043A',\n\tKfr: '\\uD835\\uDD0E',\n\tkfr: '\\uD835\\uDD28',\n\tkgreen: '\\u0138',\n\tKHcy: '\\u0425',\n\tkhcy: '\\u0445',\n\tKJcy: '\\u040C',\n\tkjcy: '\\u045C',\n\tKopf: '\\uD835\\uDD42',\n\tkopf: '\\uD835\\uDD5C',\n\tKscr: '\\uD835\\uDCA6',\n\tkscr: '\\uD835\\uDCC0',\n\tlAarr: '\\u21DA',\n\tLacute: '\\u0139',\n\tlacute: '\\u013A',\n\tlaemptyv: '\\u29B4',\n\tlagran: '\\u2112',\n\tLambda: '\\u039B',\n\tlambda: '\\u03BB',\n\tLang: '\\u27EA',\n\tlang: '\\u27E8',\n\tlangd: '\\u2991',\n\tlangle: '\\u27E8',\n\tlap: '\\u2A85',\n\tLaplacetrf: '\\u2112',\n\tlaquo: '\\u00AB',\n\tLarr: '\\u219E',\n\tlArr: '\\u21D0',\n\tlarr: '\\u2190',\n\tlarrb: '\\u21E4',\n\tlarrbfs: '\\u291F',\n\tlarrfs: '\\u291D',\n\tlarrhk: '\\u21A9',\n\tlarrlp: '\\u21AB',\n\tlarrpl: '\\u2939',\n\tlarrsim: '\\u2973',\n\tlarrtl: '\\u21A2',\n\tlat: '\\u2AAB',\n\tlAtail: '\\u291B',\n\tlatail: '\\u2919',\n\tlate: '\\u2AAD',\n\tlates: '\\u2AAD\\uFE00',\n\tlBarr: '\\u290E',\n\tlbarr: '\\u290C',\n\tlbbrk: '\\u2772',\n\tlbrace: '\\u007B',\n\tlbrack: '\\u005B',\n\tlbrke: '\\u298B',\n\tlbrksld: '\\u298F',\n\tlbrkslu: '\\u298D',\n\tLcaron: '\\u013D',\n\tlcaron: '\\u013E',\n\tLcedil: '\\u013B',\n\tlcedil: '\\u013C',\n\tlceil: '\\u2308',\n\tlcub: '\\u007B',\n\tLcy: '\\u041B',\n\tlcy: '\\u043B',\n\tldca: '\\u2936',\n\tldquo: '\\u201C',\n\tldquor: '\\u201E',\n\tldrdhar: '\\u2967',\n\tldrushar: '\\u294B',\n\tldsh: '\\u21B2',\n\tlE: '\\u2266',\n\tle: '\\u2264',\n\tLeftAngleBracket: '\\u27E8',\n\tLeftArrow: '\\u2190',\n\tLeftarrow: '\\u21D0',\n\tleftarrow: '\\u2190',\n\tLeftArrowBar: '\\u21E4',\n\tLeftArrowRightArrow: '\\u21C6',\n\tleftarrowtail: '\\u21A2',\n\tLeftCeiling: '\\u2308',\n\tLeftDoubleBracket: '\\u27E6',\n\tLeftDownTeeVector: '\\u2961',\n\tLeftDownVector: '\\u21C3',\n\tLeftDownVectorBar: '\\u2959',\n\tLeftFloor: '\\u230A',\n\tleftharpoondown: '\\u21BD',\n\tleftharpoonup: '\\u21BC',\n\tleftleftarrows: '\\u21C7',\n\tLeftRightArrow: '\\u2194',\n\tLeftrightarrow: '\\u21D4',\n\tleftrightarrow: '\\u2194',\n\tleftrightarrows: '\\u21C6',\n\tleftrightharpoons: '\\u21CB',\n\tleftrightsquigarrow: '\\u21AD',\n\tLeftRightVector: '\\u294E',\n\tLeftTee: '\\u22A3',\n\tLeftTeeArrow: '\\u21A4',\n\tLeftTeeVector: '\\u295A',\n\tleftthreetimes: '\\u22CB',\n\tLeftTriangle: '\\u22B2',\n\tLeftTriangleBar: '\\u29CF',\n\tLeftTriangleEqual: '\\u22B4',\n\tLeftUpDownVector: '\\u2951',\n\tLeftUpTeeVector: '\\u2960',\n\tLeftUpVector: '\\u21BF',\n\tLeftUpVectorBar: '\\u2958',\n\tLeftVector: '\\u21BC',\n\tLeftVectorBar: '\\u2952',\n\tlEg: '\\u2A8B',\n\tleg: '\\u22DA',\n\tleq: '\\u2264',\n\tleqq: '\\u2266',\n\tleqslant: '\\u2A7D',\n\tles: '\\u2A7D',\n\tlescc: '\\u2AA8',\n\tlesdot: '\\u2A7F',\n\tlesdoto: '\\u2A81',\n\tlesdotor: '\\u2A83',\n\tlesg: '\\u22DA\\uFE00',\n\tlesges: '\\u2A93',\n\tlessapprox: '\\u2A85',\n\tlessdot: '\\u22D6',\n\tlesseqgtr: '\\u22DA',\n\tlesseqqgtr: '\\u2A8B',\n\tLessEqualGreater: '\\u22DA',\n\tLessFullEqual: '\\u2266',\n\tLessGreater: '\\u2276',\n\tlessgtr: '\\u2276',\n\tLessLess: '\\u2AA1',\n\tlesssim: '\\u2272',\n\tLessSlantEqual: '\\u2A7D',\n\tLessTilde: '\\u2272',\n\tlfisht: '\\u297C',\n\tlfloor: '\\u230A',\n\tLfr: '\\uD835\\uDD0F',\n\tlfr: '\\uD835\\uDD29',\n\tlg: '\\u2276',\n\tlgE: '\\u2A91',\n\tlHar: '\\u2962',\n\tlhard: '\\u21BD',\n\tlharu: '\\u21BC',\n\tlharul: '\\u296A',\n\tlhblk: '\\u2584',\n\tLJcy: '\\u0409',\n\tljcy: '\\u0459',\n\tLl: '\\u22D8',\n\tll: '\\u226A',\n\tllarr: '\\u21C7',\n\tllcorner: '\\u231E',\n\tLleftarrow: '\\u21DA',\n\tllhard: '\\u296B',\n\tlltri: '\\u25FA',\n\tLmidot: '\\u013F',\n\tlmidot: '\\u0140',\n\tlmoust: '\\u23B0',\n\tlmoustache: '\\u23B0',\n\tlnap: '\\u2A89',\n\tlnapprox: '\\u2A89',\n\tlnE: '\\u2268',\n\tlne: '\\u2A87',\n\tlneq: '\\u2A87',\n\tlneqq: '\\u2268',\n\tlnsim: '\\u22E6',\n\tloang: '\\u27EC',\n\tloarr: '\\u21FD',\n\tlobrk: '\\u27E6',\n\tLongLeftArrow: '\\u27F5',\n\tLongleftarrow: '\\u27F8',\n\tlongleftarrow: '\\u27F5',\n\tLongLeftRightArrow: '\\u27F7',\n\tLongleftrightarrow: '\\u27FA',\n\tlongleftrightarrow: '\\u27F7',\n\tlongmapsto: '\\u27FC',\n\tLongRightArrow: '\\u27F6',\n\tLongrightarrow: '\\u27F9',\n\tlongrightarrow: '\\u27F6',\n\tlooparrowleft: '\\u21AB',\n\tlooparrowright: '\\u21AC',\n\tlopar: '\\u2985',\n\tLopf: '\\uD835\\uDD43',\n\tlopf: '\\uD835\\uDD5D',\n\tloplus: '\\u2A2D',\n\tlotimes: '\\u2A34',\n\tlowast: '\\u2217',\n\tlowbar: '\\u005F',\n\tLowerLeftArrow: '\\u2199',\n\tLowerRightArrow: '\\u2198',\n\tloz: '\\u25CA',\n\tlozenge: '\\u25CA',\n\tlozf: '\\u29EB',\n\tlpar: '\\u0028',\n\tlparlt: '\\u2993',\n\tlrarr: '\\u21C6',\n\tlrcorner: '\\u231F',\n\tlrhar: '\\u21CB',\n\tlrhard: '\\u296D',\n\tlrm: '\\u200E',\n\tlrtri: '\\u22BF',\n\tlsaquo: '\\u2039',\n\tLscr: '\\u2112',\n\tlscr: '\\uD835\\uDCC1',\n\tLsh: '\\u21B0',\n\tlsh: '\\u21B0',\n\tlsim: '\\u2272',\n\tlsime: '\\u2A8D',\n\tlsimg: '\\u2A8F',\n\tlsqb: '\\u005B',\n\tlsquo: '\\u2018',\n\tlsquor: '\\u201A',\n\tLstrok: '\\u0141',\n\tlstrok: '\\u0142',\n\tLt: '\\u226A',\n\tLT: '\\u003C',\n\tlt: '\\u003C',\n\tltcc: '\\u2AA6',\n\tltcir: '\\u2A79',\n\tltdot: '\\u22D6',\n\tlthree: '\\u22CB',\n\tltimes: '\\u22C9',\n\tltlarr: '\\u2976',\n\tltquest: '\\u2A7B',\n\tltri: '\\u25C3',\n\tltrie: '\\u22B4',\n\tltrif: '\\u25C2',\n\tltrPar: '\\u2996',\n\tlurdshar: '\\u294A',\n\tluruhar: '\\u2966',\n\tlvertneqq: '\\u2268\\uFE00',\n\tlvnE: '\\u2268\\uFE00',\n\tmacr: '\\u00AF',\n\tmale: '\\u2642',\n\tmalt: '\\u2720',\n\tmaltese: '\\u2720',\n\tMap: '\\u2905',\n\tmap: '\\u21A6',\n\tmapsto: '\\u21A6',\n\tmapstodown: '\\u21A7',\n\tmapstoleft: '\\u21A4',\n\tmapstoup: '\\u21A5',\n\tmarker: '\\u25AE',\n\tmcomma: '\\u2A29',\n\tMcy: '\\u041C',\n\tmcy: '\\u043C',\n\tmdash: '\\u2014',\n\tmDDot: '\\u223A',\n\tmeasuredangle: '\\u2221',\n\tMediumSpace: '\\u205F',\n\tMellintrf: '\\u2133',\n\tMfr: '\\uD835\\uDD10',\n\tmfr: '\\uD835\\uDD2A',\n\tmho: '\\u2127',\n\tmicro: '\\u00B5',\n\tmid: '\\u2223',\n\tmidast: '\\u002A',\n\tmidcir: '\\u2AF0',\n\tmiddot: '\\u00B7',\n\tminus: '\\u2212',\n\tminusb: '\\u229F',\n\tminusd: '\\u2238',\n\tminusdu: '\\u2A2A',\n\tMinusPlus: '\\u2213',\n\tmlcp: '\\u2ADB',\n\tmldr: '\\u2026',\n\tmnplus: '\\u2213',\n\tmodels: '\\u22A7',\n\tMopf: '\\uD835\\uDD44',\n\tmopf: '\\uD835\\uDD5E',\n\tmp: '\\u2213',\n\tMscr: '\\u2133',\n\tmscr: '\\uD835\\uDCC2',\n\tmstpos: '\\u223E',\n\tMu: '\\u039C',\n\tmu: '\\u03BC',\n\tmultimap: '\\u22B8',\n\tmumap: '\\u22B8',\n\tnabla: '\\u2207',\n\tNacute: '\\u0143',\n\tnacute: '\\u0144',\n\tnang: '\\u2220\\u20D2',\n\tnap: '\\u2249',\n\tnapE: '\\u2A70\\u0338',\n\tnapid: '\\u224B\\u0338',\n\tnapos: '\\u0149',\n\tnapprox: '\\u2249',\n\tnatur: '\\u266E',\n\tnatural: '\\u266E',\n\tnaturals: '\\u2115',\n\tnbsp: '\\u00A0',\n\tnbump: '\\u224E\\u0338',\n\tnbumpe: '\\u224F\\u0338',\n\tncap: '\\u2A43',\n\tNcaron: '\\u0147',\n\tncaron: '\\u0148',\n\tNcedil: '\\u0145',\n\tncedil: '\\u0146',\n\tncong: '\\u2247',\n\tncongdot: '\\u2A6D\\u0338',\n\tncup: '\\u2A42',\n\tNcy: '\\u041D',\n\tncy: '\\u043D',\n\tndash: '\\u2013',\n\tne: '\\u2260',\n\tnearhk: '\\u2924',\n\tneArr: '\\u21D7',\n\tnearr: '\\u2197',\n\tnearrow: '\\u2197',\n\tnedot: '\\u2250\\u0338',\n\tNegativeMediumSpace: '\\u200B',\n\tNegativeThickSpace: '\\u200B',\n\tNegativeThinSpace: '\\u200B',\n\tNegativeVeryThinSpace: '\\u200B',\n\tnequiv: '\\u2262',\n\tnesear: '\\u2928',\n\tnesim: '\\u2242\\u0338',\n\tNestedGreaterGreater: '\\u226B',\n\tNestedLessLess: '\\u226A',\n\tNewLine: '\\u000A',\n\tnexist: '\\u2204',\n\tnexists: '\\u2204',\n\tNfr: '\\uD835\\uDD11',\n\tnfr: '\\uD835\\uDD2B',\n\tngE: '\\u2267\\u0338',\n\tnge: '\\u2271',\n\tngeq: '\\u2271',\n\tngeqq: '\\u2267\\u0338',\n\tngeqslant: '\\u2A7E\\u0338',\n\tnges: '\\u2A7E\\u0338',\n\tnGg: '\\u22D9\\u0338',\n\tngsim: '\\u2275',\n\tnGt: '\\u226B\\u20D2',\n\tngt: '\\u226F',\n\tngtr: '\\u226F',\n\tnGtv: '\\u226B\\u0338',\n\tnhArr: '\\u21CE',\n\tnharr: '\\u21AE',\n\tnhpar: '\\u2AF2',\n\tni: '\\u220B',\n\tnis: '\\u22FC',\n\tnisd: '\\u22FA',\n\tniv: '\\u220B',\n\tNJcy: '\\u040A',\n\tnjcy: '\\u045A',\n\tnlArr: '\\u21CD',\n\tnlarr: '\\u219A',\n\tnldr: '\\u2025',\n\tnlE: '\\u2266\\u0338',\n\tnle: '\\u2270',\n\tnLeftarrow: '\\u21CD',\n\tnleftarrow: '\\u219A',\n\tnLeftrightarrow: '\\u21CE',\n\tnleftrightarrow: '\\u21AE',\n\tnleq: '\\u2270',\n\tnleqq: '\\u2266\\u0338',\n\tnleqslant: '\\u2A7D\\u0338',\n\tnles: '\\u2A7D\\u0338',\n\tnless: '\\u226E',\n\tnLl: '\\u22D8\\u0338',\n\tnlsim: '\\u2274',\n\tnLt: '\\u226A\\u20D2',\n\tnlt: '\\u226E',\n\tnltri: '\\u22EA',\n\tnltrie: '\\u22EC',\n\tnLtv: '\\u226A\\u0338',\n\tnmid: '\\u2224',\n\tNoBreak: '\\u2060',\n\tNonBreakingSpace: '\\u00A0',\n\tNopf: '\\u2115',\n\tnopf: '\\uD835\\uDD5F',\n\tNot: '\\u2AEC',\n\tnot: '\\u00AC',\n\tNotCongruent: '\\u2262',\n\tNotCupCap: '\\u226D',\n\tNotDoubleVerticalBar: '\\u2226',\n\tNotElement: '\\u2209',\n\tNotEqual: '\\u2260',\n\tNotEqualTilde: '\\u2242\\u0338',\n\tNotExists: '\\u2204',\n\tNotGreater: '\\u226F',\n\tNotGreaterEqual: '\\u2271',\n\tNotGreaterFullEqual: '\\u2267\\u0338',\n\tNotGreaterGreater: '\\u226B\\u0338',\n\tNotGreaterLess: '\\u2279',\n\tNotGreaterSlantEqual: '\\u2A7E\\u0338',\n\tNotGreaterTilde: '\\u2275',\n\tNotHumpDownHump: '\\u224E\\u0338',\n\tNotHumpEqual: '\\u224F\\u0338',\n\tnotin: '\\u2209',\n\tnotindot: '\\u22F5\\u0338',\n\tnotinE: '\\u22F9\\u0338',\n\tnotinva: '\\u2209',\n\tnotinvb: '\\u22F7',\n\tnotinvc: '\\u22F6',\n\tNotLeftTriangle: '\\u22EA',\n\tNotLeftTriangleBar: '\\u29CF\\u0338',\n\tNotLeftTriangleEqual: '\\u22EC',\n\tNotLess: '\\u226E',\n\tNotLessEqual: '\\u2270',\n\tNotLessGreater: '\\u2278',\n\tNotLessLess: '\\u226A\\u0338',\n\tNotLessSlantEqual: '\\u2A7D\\u0338',\n\tNotLessTilde: '\\u2274',\n\tNotNestedGreaterGreater: '\\u2AA2\\u0338',\n\tNotNestedLessLess: '\\u2AA1\\u0338',\n\tnotni: '\\u220C',\n\tnotniva: '\\u220C',\n\tnotnivb: '\\u22FE',\n\tnotnivc: '\\u22FD',\n\tNotPrecedes: '\\u2280',\n\tNotPrecedesEqual: '\\u2AAF\\u0338',\n\tNotPrecedesSlantEqual: '\\u22E0',\n\tNotReverseElement: '\\u220C',\n\tNotRightTriangle: '\\u22EB',\n\tNotRightTriangleBar: '\\u29D0\\u0338',\n\tNotRightTriangleEqual: '\\u22ED',\n\tNotSquareSubset: '\\u228F\\u0338',\n\tNotSquareSubsetEqual: '\\u22E2',\n\tNotSquareSuperset: '\\u2290\\u0338',\n\tNotSquareSupersetEqual: '\\u22E3',\n\tNotSubset: '\\u2282\\u20D2',\n\tNotSubsetEqual: '\\u2288',\n\tNotSucceeds: '\\u2281',\n\tNotSucceedsEqual: '\\u2AB0\\u0338',\n\tNotSucceedsSlantEqual: '\\u22E1',\n\tNotSucceedsTilde: '\\u227F\\u0338',\n\tNotSuperset: '\\u2283\\u20D2',\n\tNotSupersetEqual: '\\u2289',\n\tNotTilde: '\\u2241',\n\tNotTildeEqual: '\\u2244',\n\tNotTildeFullEqual: '\\u2247',\n\tNotTildeTilde: '\\u2249',\n\tNotVerticalBar: '\\u2224',\n\tnpar: '\\u2226',\n\tnparallel: '\\u2226',\n\tnparsl: '\\u2AFD\\u20E5',\n\tnpart: '\\u2202\\u0338',\n\tnpolint: '\\u2A14',\n\tnpr: '\\u2280',\n\tnprcue: '\\u22E0',\n\tnpre: '\\u2AAF\\u0338',\n\tnprec: '\\u2280',\n\tnpreceq: '\\u2AAF\\u0338',\n\tnrArr: '\\u21CF',\n\tnrarr: '\\u219B',\n\tnrarrc: '\\u2933\\u0338',\n\tnrarrw: '\\u219D\\u0338',\n\tnRightarrow: '\\u21CF',\n\tnrightarrow: '\\u219B',\n\tnrtri: '\\u22EB',\n\tnrtrie: '\\u22ED',\n\tnsc: '\\u2281',\n\tnsccue: '\\u22E1',\n\tnsce: '\\u2AB0\\u0338',\n\tNscr: '\\uD835\\uDCA9',\n\tnscr: '\\uD835\\uDCC3',\n\tnshortmid: '\\u2224',\n\tnshortparallel: '\\u2226',\n\tnsim: '\\u2241',\n\tnsime: '\\u2244',\n\tnsimeq: '\\u2244',\n\tnsmid: '\\u2224',\n\tnspar: '\\u2226',\n\tnsqsube: '\\u22E2',\n\tnsqsupe: '\\u22E3',\n\tnsub: '\\u2284',\n\tnsubE: '\\u2AC5\\u0338',\n\tnsube: '\\u2288',\n\tnsubset: '\\u2282\\u20D2',\n\tnsubseteq: '\\u2288',\n\tnsubseteqq: '\\u2AC5\\u0338',\n\tnsucc: '\\u2281',\n\tnsucceq: '\\u2AB0\\u0338',\n\tnsup: '\\u2285',\n\tnsupE: '\\u2AC6\\u0338',\n\tnsupe: '\\u2289',\n\tnsupset: '\\u2283\\u20D2',\n\tnsupseteq: '\\u2289',\n\tnsupseteqq: '\\u2AC6\\u0338',\n\tntgl: '\\u2279',\n\tNtilde: '\\u00D1',\n\tntilde: '\\u00F1',\n\tntlg: '\\u2278',\n\tntriangleleft: '\\u22EA',\n\tntrianglelefteq: '\\u22EC',\n\tntriangleright: '\\u22EB',\n\tntrianglerighteq: '\\u22ED',\n\tNu: '\\u039D',\n\tnu: '\\u03BD',\n\tnum: '\\u0023',\n\tnumero: '\\u2116',\n\tnumsp: '\\u2007',\n\tnvap: '\\u224D\\u20D2',\n\tnVDash: '\\u22AF',\n\tnVdash: '\\u22AE',\n\tnvDash: '\\u22AD',\n\tnvdash: '\\u22AC',\n\tnvge: '\\u2265\\u20D2',\n\tnvgt: '\\u003E\\u20D2',\n\tnvHarr: '\\u2904',\n\tnvinfin: '\\u29DE',\n\tnvlArr: '\\u2902',\n\tnvle: '\\u2264\\u20D2',\n\tnvlt: '\\u003C\\u20D2',\n\tnvltrie: '\\u22B4\\u20D2',\n\tnvrArr: '\\u2903',\n\tnvrtrie: '\\u22B5\\u20D2',\n\tnvsim: '\\u223C\\u20D2',\n\tnwarhk: '\\u2923',\n\tnwArr: '\\u21D6',\n\tnwarr: '\\u2196',\n\tnwarrow: '\\u2196',\n\tnwnear: '\\u2927',\n\tOacute: '\\u00D3',\n\toacute: '\\u00F3',\n\toast: '\\u229B',\n\tocir: '\\u229A',\n\tOcirc: '\\u00D4',\n\tocirc: '\\u00F4',\n\tOcy: '\\u041E',\n\tocy: '\\u043E',\n\todash: '\\u229D',\n\tOdblac: '\\u0150',\n\todblac: '\\u0151',\n\todiv: '\\u2A38',\n\todot: '\\u2299',\n\todsold: '\\u29BC',\n\tOElig: '\\u0152',\n\toelig: '\\u0153',\n\tofcir: '\\u29BF',\n\tOfr: '\\uD835\\uDD12',\n\tofr: '\\uD835\\uDD2C',\n\togon: '\\u02DB',\n\tOgrave: '\\u00D2',\n\tograve: '\\u00F2',\n\togt: '\\u29C1',\n\tohbar: '\\u29B5',\n\tohm: '\\u03A9',\n\toint: '\\u222E',\n\tolarr: '\\u21BA',\n\tolcir: '\\u29BE',\n\tolcross: '\\u29BB',\n\toline: '\\u203E',\n\tolt: '\\u29C0',\n\tOmacr: '\\u014C',\n\tomacr: '\\u014D',\n\tOmega: '\\u03A9',\n\tomega: '\\u03C9',\n\tOmicron: '\\u039F',\n\tomicron: '\\u03BF',\n\tomid: '\\u29B6',\n\tominus: '\\u2296',\n\tOopf: '\\uD835\\uDD46',\n\toopf: '\\uD835\\uDD60',\n\topar: '\\u29B7',\n\tOpenCurlyDoubleQuote: '\\u201C',\n\tOpenCurlyQuote: '\\u2018',\n\toperp: '\\u29B9',\n\toplus: '\\u2295',\n\tOr: '\\u2A54',\n\tor: '\\u2228',\n\torarr: '\\u21BB',\n\tord: '\\u2A5D',\n\torder: '\\u2134',\n\torderof: '\\u2134',\n\tordf: '\\u00AA',\n\tordm: '\\u00BA',\n\torigof: '\\u22B6',\n\toror: '\\u2A56',\n\torslope: '\\u2A57',\n\torv: '\\u2A5B',\n\toS: '\\u24C8',\n\tOscr: '\\uD835\\uDCAA',\n\toscr: '\\u2134',\n\tOslash: '\\u00D8',\n\toslash: '\\u00F8',\n\tosol: '\\u2298',\n\tOtilde: '\\u00D5',\n\totilde: '\\u00F5',\n\tOtimes: '\\u2A37',\n\totimes: '\\u2297',\n\totimesas: '\\u2A36',\n\tOuml: '\\u00D6',\n\touml: '\\u00F6',\n\tovbar: '\\u233D',\n\tOverBar: '\\u203E',\n\tOverBrace: '\\u23DE',\n\tOverBracket: '\\u23B4',\n\tOverParenthesis: '\\u23DC',\n\tpar: '\\u2225',\n\tpara: '\\u00B6',\n\tparallel: '\\u2225',\n\tparsim: '\\u2AF3',\n\tparsl: '\\u2AFD',\n\tpart: '\\u2202',\n\tPartialD: '\\u2202',\n\tPcy: '\\u041F',\n\tpcy: '\\u043F',\n\tpercnt: '\\u0025',\n\tperiod: '\\u002E',\n\tpermil: '\\u2030',\n\tperp: '\\u22A5',\n\tpertenk: '\\u2031',\n\tPfr: '\\uD835\\uDD13',\n\tpfr: '\\uD835\\uDD2D',\n\tPhi: '\\u03A6',\n\tphi: '\\u03C6',\n\tphiv: '\\u03D5',\n\tphmmat: '\\u2133',\n\tphone: '\\u260E',\n\tPi: '\\u03A0',\n\tpi: '\\u03C0',\n\tpitchfork: '\\u22D4',\n\tpiv: '\\u03D6',\n\tplanck: '\\u210F',\n\tplanckh: '\\u210E',\n\tplankv: '\\u210F',\n\tplus: '\\u002B',\n\tplusacir: '\\u2A23',\n\tplusb: '\\u229E',\n\tpluscir: '\\u2A22',\n\tplusdo: '\\u2214',\n\tplusdu: '\\u2A25',\n\tpluse: '\\u2A72',\n\tPlusMinus: '\\u00B1',\n\tplusmn: '\\u00B1',\n\tplussim: '\\u2A26',\n\tplustwo: '\\u2A27',\n\tpm: '\\u00B1',\n\tPoincareplane: '\\u210C',\n\tpointint: '\\u2A15',\n\tPopf: '\\u2119',\n\tpopf: '\\uD835\\uDD61',\n\tpound: '\\u00A3',\n\tPr: '\\u2ABB',\n\tpr: '\\u227A',\n\tprap: '\\u2AB7',\n\tprcue: '\\u227C',\n\tprE: '\\u2AB3',\n\tpre: '\\u2AAF',\n\tprec: '\\u227A',\n\tprecapprox: '\\u2AB7',\n\tpreccurlyeq: '\\u227C',\n\tPrecedes: '\\u227A',\n\tPrecedesEqual: '\\u2AAF',\n\tPrecedesSlantEqual: '\\u227C',\n\tPrecedesTilde: '\\u227E',\n\tpreceq: '\\u2AAF',\n\tprecnapprox: '\\u2AB9',\n\tprecneqq: '\\u2AB5',\n\tprecnsim: '\\u22E8',\n\tprecsim: '\\u227E',\n\tPrime: '\\u2033',\n\tprime: '\\u2032',\n\tprimes: '\\u2119',\n\tprnap: '\\u2AB9',\n\tprnE: '\\u2AB5',\n\tprnsim: '\\u22E8',\n\tprod: '\\u220F',\n\tProduct: '\\u220F',\n\tprofalar: '\\u232E',\n\tprofline: '\\u2312',\n\tprofsurf: '\\u2313',\n\tprop: '\\u221D',\n\tProportion: '\\u2237',\n\tProportional: '\\u221D',\n\tpropto: '\\u221D',\n\tprsim: '\\u227E',\n\tprurel: '\\u22B0',\n\tPscr: '\\uD835\\uDCAB',\n\tpscr: '\\uD835\\uDCC5',\n\tPsi: '\\u03A8',\n\tpsi: '\\u03C8',\n\tpuncsp: '\\u2008',\n\tQfr: '\\uD835\\uDD14',\n\tqfr: '\\uD835\\uDD2E',\n\tqint: '\\u2A0C',\n\tQopf: '\\u211A',\n\tqopf: '\\uD835\\uDD62',\n\tqprime: '\\u2057',\n\tQscr: '\\uD835\\uDCAC',\n\tqscr: '\\uD835\\uDCC6',\n\tquaternions: '\\u210D',\n\tquatint: '\\u2A16',\n\tquest: '\\u003F',\n\tquesteq: '\\u225F',\n\tQUOT: '\\u0022',\n\tquot: '\\u0022',\n\trAarr: '\\u21DB',\n\trace: '\\u223D\\u0331',\n\tRacute: '\\u0154',\n\tracute: '\\u0155',\n\tradic: '\\u221A',\n\traemptyv: '\\u29B3',\n\tRang: '\\u27EB',\n\trang: '\\u27E9',\n\trangd: '\\u2992',\n\trange: '\\u29A5',\n\trangle: '\\u27E9',\n\traquo: '\\u00BB',\n\tRarr: '\\u21A0',\n\trArr: '\\u21D2',\n\trarr: '\\u2192',\n\trarrap: '\\u2975',\n\trarrb: '\\u21E5',\n\trarrbfs: '\\u2920',\n\trarrc: '\\u2933',\n\trarrfs: '\\u291E',\n\trarrhk: '\\u21AA',\n\trarrlp: '\\u21AC',\n\trarrpl: '\\u2945',\n\trarrsim: '\\u2974',\n\tRarrtl: '\\u2916',\n\trarrtl: '\\u21A3',\n\trarrw: '\\u219D',\n\trAtail: '\\u291C',\n\tratail: '\\u291A',\n\tratio: '\\u2236',\n\trationals: '\\u211A',\n\tRBarr: '\\u2910',\n\trBarr: '\\u290F',\n\trbarr: '\\u290D',\n\trbbrk: '\\u2773',\n\trbrace: '\\u007D',\n\trbrack: '\\u005D',\n\trbrke: '\\u298C',\n\trbrksld: '\\u298E',\n\trbrkslu: '\\u2990',\n\tRcaron: '\\u0158',\n\trcaron: '\\u0159',\n\tRcedil: '\\u0156',\n\trcedil: '\\u0157',\n\trceil: '\\u2309',\n\trcub: '\\u007D',\n\tRcy: '\\u0420',\n\trcy: '\\u0440',\n\trdca: '\\u2937',\n\trdldhar: '\\u2969',\n\trdquo: '\\u201D',\n\trdquor: '\\u201D',\n\trdsh: '\\u21B3',\n\tRe: '\\u211C',\n\treal: '\\u211C',\n\trealine: '\\u211B',\n\trealpart: '\\u211C',\n\treals: '\\u211D',\n\trect: '\\u25AD',\n\tREG: '\\u00AE',\n\treg: '\\u00AE',\n\tReverseElement: '\\u220B',\n\tReverseEquilibrium: '\\u21CB',\n\tReverseUpEquilibrium: '\\u296F',\n\trfisht: '\\u297D',\n\trfloor: '\\u230B',\n\tRfr: '\\u211C',\n\trfr: '\\uD835\\uDD2F',\n\trHar: '\\u2964',\n\trhard: '\\u21C1',\n\trharu: '\\u21C0',\n\trharul: '\\u296C',\n\tRho: '\\u03A1',\n\trho: '\\u03C1',\n\trhov: '\\u03F1',\n\tRightAngleBracket: '\\u27E9',\n\tRightArrow: '\\u2192',\n\tRightarrow: '\\u21D2',\n\trightarrow: '\\u2192',\n\tRightArrowBar: '\\u21E5',\n\tRightArrowLeftArrow: '\\u21C4',\n\trightarrowtail: '\\u21A3',\n\tRightCeiling: '\\u2309',\n\tRightDoubleBracket: '\\u27E7',\n\tRightDownTeeVector: '\\u295D',\n\tRightDownVector: '\\u21C2',\n\tRightDownVectorBar: '\\u2955',\n\tRightFloor: '\\u230B',\n\trightharpoondown: '\\u21C1',\n\trightharpoonup: '\\u21C0',\n\trightleftarrows: '\\u21C4',\n\trightleftharpoons: '\\u21CC',\n\trightrightarrows: '\\u21C9',\n\trightsquigarrow: '\\u219D',\n\tRightTee: '\\u22A2',\n\tRightTeeArrow: '\\u21A6',\n\tRightTeeVector: '\\u295B',\n\trightthreetimes: '\\u22CC',\n\tRightTriangle: '\\u22B3',\n\tRightTriangleBar: '\\u29D0',\n\tRightTriangleEqual: '\\u22B5',\n\tRightUpDownVector: '\\u294F',\n\tRightUpTeeVector: '\\u295C',\n\tRightUpVector: '\\u21BE',\n\tRightUpVectorBar: '\\u2954',\n\tRightVector: '\\u21C0',\n\tRightVectorBar: '\\u2953',\n\tring: '\\u02DA',\n\trisingdotseq: '\\u2253',\n\trlarr: '\\u21C4',\n\trlhar: '\\u21CC',\n\trlm: '\\u200F',\n\trmoust: '\\u23B1',\n\trmoustache: '\\u23B1',\n\trnmid: '\\u2AEE',\n\troang: '\\u27ED',\n\troarr: '\\u21FE',\n\trobrk: '\\u27E7',\n\tropar: '\\u2986',\n\tRopf: '\\u211D',\n\tropf: '\\uD835\\uDD63',\n\troplus: '\\u2A2E',\n\trotimes: '\\u2A35',\n\tRoundImplies: '\\u2970',\n\trpar: '\\u0029',\n\trpargt: '\\u2994',\n\trppolint: '\\u2A12',\n\trrarr: '\\u21C9',\n\tRrightarrow: '\\u21DB',\n\trsaquo: '\\u203A',\n\tRscr: '\\u211B',\n\trscr: '\\uD835\\uDCC7',\n\tRsh: '\\u21B1',\n\trsh: '\\u21B1',\n\trsqb: '\\u005D',\n\trsquo: '\\u2019',\n\trsquor: '\\u2019',\n\trthree: '\\u22CC',\n\trtimes: '\\u22CA',\n\trtri: '\\u25B9',\n\trtrie: '\\u22B5',\n\trtrif: '\\u25B8',\n\trtriltri: '\\u29CE',\n\tRuleDelayed: '\\u29F4',\n\truluhar: '\\u2968',\n\trx: '\\u211E',\n\tSacute: '\\u015A',\n\tsacute: '\\u015B',\n\tsbquo: '\\u201A',\n\tSc: '\\u2ABC',\n\tsc: '\\u227B',\n\tscap: '\\u2AB8',\n\tScaron: '\\u0160',\n\tscaron: '\\u0161',\n\tsccue: '\\u227D',\n\tscE: '\\u2AB4',\n\tsce: '\\u2AB0',\n\tScedil: '\\u015E',\n\tscedil: '\\u015F',\n\tScirc: '\\u015C',\n\tscirc: '\\u015D',\n\tscnap: '\\u2ABA',\n\tscnE: '\\u2AB6',\n\tscnsim: '\\u22E9',\n\tscpolint: '\\u2A13',\n\tscsim: '\\u227F',\n\tScy: '\\u0421',\n\tscy: '\\u0441',\n\tsdot: '\\u22C5',\n\tsdotb: '\\u22A1',\n\tsdote: '\\u2A66',\n\tsearhk: '\\u2925',\n\tseArr: '\\u21D8',\n\tsearr: '\\u2198',\n\tsearrow: '\\u2198',\n\tsect: '\\u00A7',\n\tsemi: '\\u003B',\n\tseswar: '\\u2929',\n\tsetminus: '\\u2216',\n\tsetmn: '\\u2216',\n\tsext: '\\u2736',\n\tSfr: '\\uD835\\uDD16',\n\tsfr: '\\uD835\\uDD30',\n\tsfrown: '\\u2322',\n\tsharp: '\\u266F',\n\tSHCHcy: '\\u0429',\n\tshchcy: '\\u0449',\n\tSHcy: '\\u0428',\n\tshcy: '\\u0448',\n\tShortDownArrow: '\\u2193',\n\tShortLeftArrow: '\\u2190',\n\tshortmid: '\\u2223',\n\tshortparallel: '\\u2225',\n\tShortRightArrow: '\\u2192',\n\tShortUpArrow: '\\u2191',\n\tshy: '\\u00AD',\n\tSigma: '\\u03A3',\n\tsigma: '\\u03C3',\n\tsigmaf: '\\u03C2',\n\tsigmav: '\\u03C2',\n\tsim: '\\u223C',\n\tsimdot: '\\u2A6A',\n\tsime: '\\u2243',\n\tsimeq: '\\u2243',\n\tsimg: '\\u2A9E',\n\tsimgE: '\\u2AA0',\n\tsiml: '\\u2A9D',\n\tsimlE: '\\u2A9F',\n\tsimne: '\\u2246',\n\tsimplus: '\\u2A24',\n\tsimrarr: '\\u2972',\n\tslarr: '\\u2190',\n\tSmallCircle: '\\u2218',\n\tsmallsetminus: '\\u2216',\n\tsmashp: '\\u2A33',\n\tsmeparsl: '\\u29E4',\n\tsmid: '\\u2223',\n\tsmile: '\\u2323',\n\tsmt: '\\u2AAA',\n\tsmte: '\\u2AAC',\n\tsmtes: '\\u2AAC\\uFE00',\n\tSOFTcy: '\\u042C',\n\tsoftcy: '\\u044C',\n\tsol: '\\u002F',\n\tsolb: '\\u29C4',\n\tsolbar: '\\u233F',\n\tSopf: '\\uD835\\uDD4A',\n\tsopf: '\\uD835\\uDD64',\n\tspades: '\\u2660',\n\tspadesuit: '\\u2660',\n\tspar: '\\u2225',\n\tsqcap: '\\u2293',\n\tsqcaps: '\\u2293\\uFE00',\n\tsqcup: '\\u2294',\n\tsqcups: '\\u2294\\uFE00',\n\tSqrt: '\\u221A',\n\tsqsub: '\\u228F',\n\tsqsube: '\\u2291',\n\tsqsubset: '\\u228F',\n\tsqsubseteq: '\\u2291',\n\tsqsup: '\\u2290',\n\tsqsupe: '\\u2292',\n\tsqsupset: '\\u2290',\n\tsqsupseteq: '\\u2292',\n\tsqu: '\\u25A1',\n\tSquare: '\\u25A1',\n\tsquare: '\\u25A1',\n\tSquareIntersection: '\\u2293',\n\tSquareSubset: '\\u228F',\n\tSquareSubsetEqual: '\\u2291',\n\tSquareSuperset: '\\u2290',\n\tSquareSupersetEqual: '\\u2292',\n\tSquareUnion: '\\u2294',\n\tsquarf: '\\u25AA',\n\tsquf: '\\u25AA',\n\tsrarr: '\\u2192',\n\tSscr: '\\uD835\\uDCAE',\n\tsscr: '\\uD835\\uDCC8',\n\tssetmn: '\\u2216',\n\tssmile: '\\u2323',\n\tsstarf: '\\u22C6',\n\tStar: '\\u22C6',\n\tstar: '\\u2606',\n\tstarf: '\\u2605',\n\tstraightepsilon: '\\u03F5',\n\tstraightphi: '\\u03D5',\n\tstrns: '\\u00AF',\n\tSub: '\\u22D0',\n\tsub: '\\u2282',\n\tsubdot: '\\u2ABD',\n\tsubE: '\\u2AC5',\n\tsube: '\\u2286',\n\tsubedot: '\\u2AC3',\n\tsubmult: '\\u2AC1',\n\tsubnE: '\\u2ACB',\n\tsubne: '\\u228A',\n\tsubplus: '\\u2ABF',\n\tsubrarr: '\\u2979',\n\tSubset: '\\u22D0',\n\tsubset: '\\u2282',\n\tsubseteq: '\\u2286',\n\tsubseteqq: '\\u2AC5',\n\tSubsetEqual: '\\u2286',\n\tsubsetneq: '\\u228A',\n\tsubsetneqq: '\\u2ACB',\n\tsubsim: '\\u2AC7',\n\tsubsub: '\\u2AD5',\n\tsubsup: '\\u2AD3',\n\tsucc: '\\u227B',\n\tsuccapprox: '\\u2AB8',\n\tsucccurlyeq: '\\u227D',\n\tSucceeds: '\\u227B',\n\tSucceedsEqual: '\\u2AB0',\n\tSucceedsSlantEqual: '\\u227D',\n\tSucceedsTilde: '\\u227F',\n\tsucceq: '\\u2AB0',\n\tsuccnapprox: '\\u2ABA',\n\tsuccneqq: '\\u2AB6',\n\tsuccnsim: '\\u22E9',\n\tsuccsim: '\\u227F',\n\tSuchThat: '\\u220B',\n\tSum: '\\u2211',\n\tsum: '\\u2211',\n\tsung: '\\u266A',\n\tSup: '\\u22D1',\n\tsup: '\\u2283',\n\tsup1: '\\u00B9',\n\tsup2: '\\u00B2',\n\tsup3: '\\u00B3',\n\tsupdot: '\\u2ABE',\n\tsupdsub: '\\u2AD8',\n\tsupE: '\\u2AC6',\n\tsupe: '\\u2287',\n\tsupedot: '\\u2AC4',\n\tSuperset: '\\u2283',\n\tSupersetEqual: '\\u2287',\n\tsuphsol: '\\u27C9',\n\tsuphsub: '\\u2AD7',\n\tsuplarr: '\\u297B',\n\tsupmult: '\\u2AC2',\n\tsupnE: '\\u2ACC',\n\tsupne: '\\u228B',\n\tsupplus: '\\u2AC0',\n\tSupset: '\\u22D1',\n\tsupset: '\\u2283',\n\tsupseteq: '\\u2287',\n\tsupseteqq: '\\u2AC6',\n\tsupsetneq: '\\u228B',\n\tsupsetneqq: '\\u2ACC',\n\tsupsim: '\\u2AC8',\n\tsupsub: '\\u2AD4',\n\tsupsup: '\\u2AD6',\n\tswarhk: '\\u2926',\n\tswArr: '\\u21D9',\n\tswarr: '\\u2199',\n\tswarrow: '\\u2199',\n\tswnwar: '\\u292A',\n\tszlig: '\\u00DF',\n\tTab: '\\u0009',\n\ttarget: '\\u2316',\n\tTau: '\\u03A4',\n\ttau: '\\u03C4',\n\ttbrk: '\\u23B4',\n\tTcaron: '\\u0164',\n\ttcaron: '\\u0165',\n\tTcedil: '\\u0162',\n\ttcedil: '\\u0163',\n\tTcy: '\\u0422',\n\ttcy: '\\u0442',\n\ttdot: '\\u20DB',\n\ttelrec: '\\u2315',\n\tTfr: '\\uD835\\uDD17',\n\ttfr: '\\uD835\\uDD31',\n\tthere4: '\\u2234',\n\tTherefore: '\\u2234',\n\ttherefore: '\\u2234',\n\tTheta: '\\u0398',\n\ttheta: '\\u03B8',\n\tthetasym: '\\u03D1',\n\tthetav: '\\u03D1',\n\tthickapprox: '\\u2248',\n\tthicksim: '\\u223C',\n\tThickSpace: '\\u205F\\u200A',\n\tthinsp: '\\u2009',\n\tThinSpace: '\\u2009',\n\tthkap: '\\u2248',\n\tthksim: '\\u223C',\n\tTHORN: '\\u00DE',\n\tthorn: '\\u00FE',\n\tTilde: '\\u223C',\n\ttilde: '\\u02DC',\n\tTildeEqual: '\\u2243',\n\tTildeFullEqual: '\\u2245',\n\tTildeTilde: '\\u2248',\n\ttimes: '\\u00D7',\n\ttimesb: '\\u22A0',\n\ttimesbar: '\\u2A31',\n\ttimesd: '\\u2A30',\n\ttint: '\\u222D',\n\ttoea: '\\u2928',\n\ttop: '\\u22A4',\n\ttopbot: '\\u2336',\n\ttopcir: '\\u2AF1',\n\tTopf: '\\uD835\\uDD4B',\n\ttopf: '\\uD835\\uDD65',\n\ttopfork: '\\u2ADA',\n\ttosa: '\\u2929',\n\ttprime: '\\u2034',\n\tTRADE: '\\u2122',\n\ttrade: '\\u2122',\n\ttriangle: '\\u25B5',\n\ttriangledown: '\\u25BF',\n\ttriangleleft: '\\u25C3',\n\ttrianglelefteq: '\\u22B4',\n\ttriangleq: '\\u225C',\n\ttriangleright: '\\u25B9',\n\ttrianglerighteq: '\\u22B5',\n\ttridot: '\\u25EC',\n\ttrie: '\\u225C',\n\ttriminus: '\\u2A3A',\n\tTripleDot: '\\u20DB',\n\ttriplus: '\\u2A39',\n\ttrisb: '\\u29CD',\n\ttritime: '\\u2A3B',\n\ttrpezium: '\\u23E2',\n\tTscr: '\\uD835\\uDCAF',\n\ttscr: '\\uD835\\uDCC9',\n\tTScy: '\\u0426',\n\ttscy: '\\u0446',\n\tTSHcy: '\\u040B',\n\ttshcy: '\\u045B',\n\tTstrok: '\\u0166',\n\ttstrok: '\\u0167',\n\ttwixt: '\\u226C',\n\ttwoheadleftarrow: '\\u219E',\n\ttwoheadrightarrow: '\\u21A0',\n\tUacute: '\\u00DA',\n\tuacute: '\\u00FA',\n\tUarr: '\\u219F',\n\tuArr: '\\u21D1',\n\tuarr: '\\u2191',\n\tUarrocir: '\\u2949',\n\tUbrcy: '\\u040E',\n\tubrcy: '\\u045E',\n\tUbreve: '\\u016C',\n\tubreve: '\\u016D',\n\tUcirc: '\\u00DB',\n\tucirc: '\\u00FB',\n\tUcy: '\\u0423',\n\tucy: '\\u0443',\n\tudarr: '\\u21C5',\n\tUdblac: '\\u0170',\n\tudblac: '\\u0171',\n\tudhar: '\\u296E',\n\tufisht: '\\u297E',\n\tUfr: '\\uD835\\uDD18',\n\tufr: '\\uD835\\uDD32',\n\tUgrave: '\\u00D9',\n\tugrave: '\\u00F9',\n\tuHar: '\\u2963',\n\tuharl: '\\u21BF',\n\tuharr: '\\u21BE',\n\tuhblk: '\\u2580',\n\tulcorn: '\\u231C',\n\tulcorner: '\\u231C',\n\tulcrop: '\\u230F',\n\tultri: '\\u25F8',\n\tUmacr: '\\u016A',\n\tumacr: '\\u016B',\n\tuml: '\\u00A8',\n\tUnderBar: '\\u005F',\n\tUnderBrace: '\\u23DF',\n\tUnderBracket: '\\u23B5',\n\tUnderParenthesis: '\\u23DD',\n\tUnion: '\\u22C3',\n\tUnionPlus: '\\u228E',\n\tUogon: '\\u0172',\n\tuogon: '\\u0173',\n\tUopf: '\\uD835\\uDD4C',\n\tuopf: '\\uD835\\uDD66',\n\tUpArrow: '\\u2191',\n\tUparrow: '\\u21D1',\n\tuparrow: '\\u2191',\n\tUpArrowBar: '\\u2912',\n\tUpArrowDownArrow: '\\u21C5',\n\tUpDownArrow: '\\u2195',\n\tUpdownarrow: '\\u21D5',\n\tupdownarrow: '\\u2195',\n\tUpEquilibrium: '\\u296E',\n\tupharpoonleft: '\\u21BF',\n\tupharpoonright: '\\u21BE',\n\tuplus: '\\u228E',\n\tUpperLeftArrow: '\\u2196',\n\tUpperRightArrow: '\\u2197',\n\tUpsi: '\\u03D2',\n\tupsi: '\\u03C5',\n\tupsih: '\\u03D2',\n\tUpsilon: '\\u03A5',\n\tupsilon: '\\u03C5',\n\tUpTee: '\\u22A5',\n\tUpTeeArrow: '\\u21A5',\n\tupuparrows: '\\u21C8',\n\turcorn: '\\u231D',\n\turcorner: '\\u231D',\n\turcrop: '\\u230E',\n\tUring: '\\u016E',\n\turing: '\\u016F',\n\turtri: '\\u25F9',\n\tUscr: '\\uD835\\uDCB0',\n\tuscr: '\\uD835\\uDCCA',\n\tutdot: '\\u22F0',\n\tUtilde: '\\u0168',\n\tutilde: '\\u0169',\n\tutri: '\\u25B5',\n\tutrif: '\\u25B4',\n\tuuarr: '\\u21C8',\n\tUuml: '\\u00DC',\n\tuuml: '\\u00FC',\n\tuwangle: '\\u29A7',\n\tvangrt: '\\u299C',\n\tvarepsilon: '\\u03F5',\n\tvarkappa: '\\u03F0',\n\tvarnothing: '\\u2205',\n\tvarphi: '\\u03D5',\n\tvarpi: '\\u03D6',\n\tvarpropto: '\\u221D',\n\tvArr: '\\u21D5',\n\tvarr: '\\u2195',\n\tvarrho: '\\u03F1',\n\tvarsigma: '\\u03C2',\n\tvarsubsetneq: '\\u228A\\uFE00',\n\tvarsubsetneqq: '\\u2ACB\\uFE00',\n\tvarsupsetneq: '\\u228B\\uFE00',\n\tvarsupsetneqq: '\\u2ACC\\uFE00',\n\tvartheta: '\\u03D1',\n\tvartriangleleft: '\\u22B2',\n\tvartriangleright: '\\u22B3',\n\tVbar: '\\u2AEB',\n\tvBar: '\\u2AE8',\n\tvBarv: '\\u2AE9',\n\tVcy: '\\u0412',\n\tvcy: '\\u0432',\n\tVDash: '\\u22AB',\n\tVdash: '\\u22A9',\n\tvDash: '\\u22A8',\n\tvdash: '\\u22A2',\n\tVdashl: '\\u2AE6',\n\tVee: '\\u22C1',\n\tvee: '\\u2228',\n\tveebar: '\\u22BB',\n\tveeeq: '\\u225A',\n\tvellip: '\\u22EE',\n\tVerbar: '\\u2016',\n\tverbar: '\\u007C',\n\tVert: '\\u2016',\n\tvert: '\\u007C',\n\tVerticalBar: '\\u2223',\n\tVerticalLine: '\\u007C',\n\tVerticalSeparator: '\\u2758',\n\tVerticalTilde: '\\u2240',\n\tVeryThinSpace: '\\u200A',\n\tVfr: '\\uD835\\uDD19',\n\tvfr: '\\uD835\\uDD33',\n\tvltri: '\\u22B2',\n\tvnsub: '\\u2282\\u20D2',\n\tvnsup: '\\u2283\\u20D2',\n\tVopf: '\\uD835\\uDD4D',\n\tvopf: '\\uD835\\uDD67',\n\tvprop: '\\u221D',\n\tvrtri: '\\u22B3',\n\tVscr: '\\uD835\\uDCB1',\n\tvscr: '\\uD835\\uDCCB',\n\tvsubnE: '\\u2ACB\\uFE00',\n\tvsubne: '\\u228A\\uFE00',\n\tvsupnE: '\\u2ACC\\uFE00',\n\tvsupne: '\\u228B\\uFE00',\n\tVvdash: '\\u22AA',\n\tvzigzag: '\\u299A',\n\tWcirc: '\\u0174',\n\twcirc: '\\u0175',\n\twedbar: '\\u2A5F',\n\tWedge: '\\u22C0',\n\twedge: '\\u2227',\n\twedgeq: '\\u2259',\n\tweierp: '\\u2118',\n\tWfr: '\\uD835\\uDD1A',\n\twfr: '\\uD835\\uDD34',\n\tWopf: '\\uD835\\uDD4E',\n\twopf: '\\uD835\\uDD68',\n\twp: '\\u2118',\n\twr: '\\u2240',\n\twreath: '\\u2240',\n\tWscr: '\\uD835\\uDCB2',\n\twscr: '\\uD835\\uDCCC',\n\txcap: '\\u22C2',\n\txcirc: '\\u25EF',\n\txcup: '\\u22C3',\n\txdtri: '\\u25BD',\n\tXfr: '\\uD835\\uDD1B',\n\txfr: '\\uD835\\uDD35',\n\txhArr: '\\u27FA',\n\txharr: '\\u27F7',\n\tXi: '\\u039E',\n\txi: '\\u03BE',\n\txlArr: '\\u27F8',\n\txlarr: '\\u27F5',\n\txmap: '\\u27FC',\n\txnis: '\\u22FB',\n\txodot: '\\u2A00',\n\tXopf: '\\uD835\\uDD4F',\n\txopf: '\\uD835\\uDD69',\n\txoplus: '\\u2A01',\n\txotime: '\\u2A02',\n\txrArr: '\\u27F9',\n\txrarr: '\\u27F6',\n\tXscr: '\\uD835\\uDCB3',\n\txscr: '\\uD835\\uDCCD',\n\txsqcup: '\\u2A06',\n\txuplus: '\\u2A04',\n\txutri: '\\u25B3',\n\txvee: '\\u22C1',\n\txwedge: '\\u22C0',\n\tYacute: '\\u00DD',\n\tyacute: '\\u00FD',\n\tYAcy: '\\u042F',\n\tyacy: '\\u044F',\n\tYcirc: '\\u0176',\n\tycirc: '\\u0177',\n\tYcy: '\\u042B',\n\tycy: '\\u044B',\n\tyen: '\\u00A5',\n\tYfr: '\\uD835\\uDD1C',\n\tyfr: '\\uD835\\uDD36',\n\tYIcy: '\\u0407',\n\tyicy: '\\u0457',\n\tYopf: '\\uD835\\uDD50',\n\tyopf: '\\uD835\\uDD6A',\n\tYscr: '\\uD835\\uDCB4',\n\tyscr: '\\uD835\\uDCCE',\n\tYUcy: '\\u042E',\n\tyucy: '\\u044E',\n\tYuml: '\\u0178',\n\tyuml: '\\u00FF',\n\tZacute: '\\u0179',\n\tzacute: '\\u017A',\n\tZcaron: '\\u017D',\n\tzcaron: '\\u017E',\n\tZcy: '\\u0417',\n\tzcy: '\\u0437',\n\tZdot: '\\u017B',\n\tzdot: '\\u017C',\n\tzeetrf: '\\u2128',\n\tZeroWidthSpace: '\\u200B',\n\tZeta: '\\u0396',\n\tzeta: '\\u03B6',\n\tZfr: '\\u2128',\n\tzfr: '\\uD835\\uDD37',\n\tZHcy: '\\u0416',\n\tzhcy: '\\u0436',\n\tzigrarr: '\\u21DD',\n\tZopf: '\\u2124',\n\tzopf: '\\uD835\\uDD6B',\n\tZscr: '\\uD835\\uDCB5',\n\tzscr: '\\uD835\\uDCCF',\n\tzwj: '\\u200D',\n\tzwnj: '\\u200C',\n});\n\n/**\n * @deprecated use `HTML_ENTITIES` instead\n * @see HTML_ENTITIES\n */\nexports.entityMap = exports.HTML_ENTITIES;\n","var dom = require('./dom')\nexports.DOMImplementation = dom.DOMImplementation\nexports.XMLSerializer = dom.XMLSerializer\nexports.DOMParser = require('./dom-parser').DOMParser\n","var NAMESPACE = require(\"./conventions\").NAMESPACE;\n\n//[4] \tNameStartChar\t ::= \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n//[4a] \tNameChar\t ::= \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\n//[5] \tName\t ::= \tNameStartChar (NameChar)*\nvar nameStartChar = /[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]///\\u10000-\\uEFFFF\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\n\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\nvar S_TAG = 0;//tag name offerring\nvar S_ATTR = 1;//attr name offerring\nvar S_ATTR_SPACE=2;//attr name end and space offer\nvar S_EQ = 3;//=space?\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\nvar S_TAG_CLOSE = 7;//closed el\n\n/**\n * Creates an error that will not be caught by XMLReader aka the SAX parser.\n *\n * @param {string} message\n * @param {any?} locator Optional, can provide details about the location in the source\n * @constructor\n */\nfunction ParseError(message, locator) {\n\tthis.message = message\n\tthis.locator = locator\n\tif(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);\n}\nParseError.prototype = new Error();\nParseError.prototype.name = ParseError.name\n\nfunction XMLReader(){\n\n}\n\nXMLReader.prototype = {\n\tparse:function(source,defaultNSMap,entityMap){\n\t\tvar domBuilder = this.domBuilder;\n\t\tdomBuilder.startDocument();\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\n\t\tparse(source,defaultNSMap,entityMap,\n\t\t\t\tdomBuilder,this.errorHandler);\n\t\tdomBuilder.endDocument();\n\t}\n}\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\n\tfunction fixedFromCharCode(code) {\n\t\t// String.prototype.fromCharCode does not supports\n\t\t// > 2 bytes unicode chars directly\n\t\tif (code > 0xffff) {\n\t\t\tcode -= 0x10000;\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\n\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\n\t\t} else {\n\t\t\treturn String.fromCharCode(code);\n\t\t}\n\t}\n\tfunction entityReplacer(a){\n\t\tvar k = a.slice(1,-1);\n\t\tif (Object.hasOwnProperty.call(entityMap, k)) {\n\t\t\treturn entityMap[k];\n\t\t}else if(k.charAt(0) === '#'){\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\n\t\t}else{\n\t\t\terrorHandler.error('entity not found:'+a);\n\t\t\treturn a;\n\t\t}\n\t}\n\tfunction appendText(end){//has some bugs\n\t\tif(end>start){\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\tlocator&&position(start);\n\t\t\tdomBuilder.characters(xt,0,end-start);\n\t\t\tstart = end\n\t\t}\n\t}\n\tfunction position(p,m){\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\n\t\t\tlineStart = m.index;\n\t\t\tlineEnd = lineStart + m[0].length;\n\t\t\tlocator.lineNumber++;\n\t\t\t//console.log('line++:',locator,startPos,endPos)\n\t\t}\n\t\tlocator.columnNumber = p-lineStart+1;\n\t}\n\tvar lineStart = 0;\n\tvar lineEnd = 0;\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\n\tvar locator = domBuilder.locator;\n\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\n\tvar closeMap = {};\n\tvar start = 0;\n\twhile(true){\n\t\ttry{\n\t\t\tvar tagStart = source.indexOf('<',start);\n\t\t\tif(tagStart<0){\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\n\t\t\t\t\tvar doc = domBuilder.doc;\n\t \t\t\tvar text = doc.createTextNode(source.substr(start));\n\t \t\t\tdoc.appendChild(text);\n\t \t\t\tdomBuilder.currentElement = text;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tagStart>start){\n\t\t\t\tappendText(tagStart);\n\t\t\t}\n\t\t\tswitch(source.charAt(tagStart+1)){\n\t\t\tcase '/':\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\n\t\t\t\tvar tagName = source.substring(tagStart + 2, end).replace(/[ \\t\\n\\r]+$/g, '');\n\t\t\t\tvar config = parseStack.pop();\n\t\t\t\tif(end<0){\n\n\t \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\n\t \t\tend = tagStart+1+tagName.length;\n\t \t}else if(tagName.match(/\\s\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\n\t\t\t\tbreak;\n\t\t\tcase '!':// start){\n\t\t\tstart = end;\n\t\t}else{\n\t\t\t//TODO: 这里有可能sax回退,有位置错误风险\n\t\t\tappendText(Math.max(tagStart,start)+1);\n\t\t}\n\t}\n}\nfunction copyLocator(f,t){\n\tt.lineNumber = f.lineNumber;\n\tt.columnNumber = f.columnNumber;\n\treturn t;\n}\n\n/**\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\n */\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\n\n\t/**\n\t * @param {string} qname\n\t * @param {string} value\n\t * @param {number} startIndex\n\t */\n\tfunction addAttribute(qname, value, startIndex) {\n\t\tif (el.attributeNames.hasOwnProperty(qname)) {\n\t\t\terrorHandler.fatalError('Attribute ' + qname + ' redefined')\n\t\t}\n\t\tel.addValue(\n\t\t\tqname,\n\t\t\t// @see https://www.w3.org/TR/xml/#AVNormalize\n\t\t\t// since the xmldom sax parser does not \"interpret\" DTD the following is not implemented:\n\t\t\t// - recursive replacement of (DTD) entity references\n\t\t\t// - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA\n\t\t\tvalue.replace(/[\\t\\n\\r]/g, ' ').replace(/&#?\\w+;/g, entityReplacer),\n\t\t\tstartIndex\n\t\t)\n\t}\n\tvar attrName;\n\tvar value;\n\tvar p = ++start;\n\tvar s = S_TAG;//status\n\twhile(true){\n\t\tvar c = source.charAt(p);\n\t\tswitch(c){\n\t\tcase '=':\n\t\t\tif(s === S_ATTR){//attrName\n\t\t\t\tattrName = source.slice(start,p);\n\t\t\t\ts = S_EQ;\n\t\t\t}else if(s === S_ATTR_SPACE){\n\t\t\t\ts = S_EQ;\n\t\t\t}else{\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\n\t\t\t\tthrow new Error('attribute equal must after attrName'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '\\'':\n\t\tcase '\"':\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\n\t\t\t\t){//equal\n\t\t\t\tif(s === S_ATTR){\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t}\n\t\t\t\tstart = p+1;\n\t\t\t\tp = source.indexOf(c,start)\n\t\t\t\tif(p>0){\n\t\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\t\taddAttribute(attrName, value, start-1);\n\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t}else{\n\t\t\t\t\t//fatalError: no end quot match\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\n\t\t\t\t}\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\n\t\t\t\tstart = p+1;\n\t\t\t\ts = S_ATTR_END\n\t\t\t}else{\n\t\t\t\t//fatalError: no equal before\n\t\t\t\tthrow new Error('attribute value must after \"=\"'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\ts =S_TAG_CLOSE;\n\t\t\t\tel.closed = true;\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\tcase S_ATTR:\n\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tel.closed = true;\n\t\t\t\tbreak;\n\t\t\t//case S_EQ:\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\") // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ''://end document\n\t\t\terrorHandler.error('unexpected end of input');\n\t\t\tif(s == S_TAG){\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\t}\n\t\t\treturn p;\n\t\tcase '>':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\tbreak;//normal\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\n\t\t\tcase S_ATTR:\n\t\t\t\tvalue = source.slice(start,p);\n\t\t\t\tif(value.slice(-1) === '/'){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tvalue = value.slice(0,-1)\n\t\t\t\t}\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tif(s === S_ATTR_SPACE){\n\t\t\t\t\tvalue = attrName;\n\t\t\t\t}\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\t}else{\n\t\t\t\t\tif(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(value, value, start)\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase S_EQ:\n\t\t\t\tthrow new Error('attribute value missed!!');\n\t\t\t}\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\n\t\t\treturn p;\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\n\t\tcase '\\u0080':\n\t\t\tc = ' ';\n\t\tdefault:\n\t\t\tif(c<= ' '){//space\n\t\t\t\tswitch(s){\n\t\t\t\tcase S_TAG:\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR:\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t\ts = S_ATTR_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\tvar value = source.slice(start, p);\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\t//case S_TAG_SPACE:\n\t\t\t\t//case S_EQ:\n\t\t\t\t//case S_ATTR_SPACE:\n\t\t\t\t//\tvoid();break;\n\t\t\t\t//case S_TAG_CLOSE:\n\t\t\t\t\t//ignore warning\n\t\t\t\t}\n\t\t\t}else{//not space\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\n\t\t\t\tswitch(s){\n\t\t\t\t//case S_TAG:void();break;\n\t\t\t\t//case S_ATTR:void();break;\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tvar tagName = el.tagName;\n\t\t\t\t\tif (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(attrName, attrName, start);\n\t\t\t\t\tstart = p;\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\n\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_EQ:\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\n\t\t\t\t}\n\t\t\t}\n\t\t}//end outer switch\n\t\t//console.log('p++',p)\n\t\tp++;\n\t}\n}\n/**\n * @return true if has new namespace define\n */\nfunction appendElement(el,domBuilder,currentNSMap){\n\tvar tagName = el.tagName;\n\tvar localNSMap = null;\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\tvar i = el.length;\n\twhile(i--){\n\t\tvar a = el[i];\n\t\tvar qName = a.qName;\n\t\tvar value = a.value;\n\t\tvar nsp = qName.indexOf(':');\n\t\tif(nsp>0){\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\n\t\t\tvar localName = qName.slice(nsp+1);\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\n\t\t}else{\n\t\t\tlocalName = qName;\n\t\t\tprefix = null\n\t\t\tnsPrefix = qName === 'xmlns' && ''\n\t\t}\n\t\t//can not set prefix,because prefix !== ''\n\t\ta.localName = localName ;\n\t\t//prefix == null for no ns prefix attribute\n\t\tif(nsPrefix !== false){//hack!!\n\t\t\tif(localNSMap == null){\n\t\t\t\tlocalNSMap = {}\n\t\t\t\t//console.log(currentNSMap,0)\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\n\t\t\t\t//console.log(currentNSMap,1)\n\t\t\t}\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\n\t\t\ta.uri = NAMESPACE.XMLNS\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value)\n\t\t}\n\t}\n\tvar i = el.length;\n\twhile(i--){\n\t\ta = el[i];\n\t\tvar prefix = a.prefix;\n\t\tif(prefix){//no prefix attribute has no namespace\n\t\t\tif(prefix === 'xml'){\n\t\t\t\ta.uri = NAMESPACE.XML;\n\t\t\t}if(prefix !== 'xmlns'){\n\t\t\t\ta.uri = currentNSMap[prefix || '']\n\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\n\t\t\t}\n\t\t}\n\t}\n\tvar nsp = tagName.indexOf(':');\n\tif(nsp>0){\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\n\t}else{\n\t\tprefix = null;//important!!\n\t\tlocalName = el.localName = tagName;\n\t}\n\t//no prefix element has default namespace\n\tvar ns = el.uri = currentNSMap[prefix || ''];\n\tdomBuilder.startElement(ns,localName,tagName,el);\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\n\t//localNSMap = null\n\tif(el.closed){\n\t\tdomBuilder.endElement(ns,localName,tagName);\n\t\tif(localNSMap){\n\t\t\tfor (prefix in localNSMap) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\tel.currentNSMap = currentNSMap;\n\t\tel.localNSMap = localNSMap;\n\t\t//parseStack.push(el);\n\t\treturn true;\n\t}\n}\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\n\tif(/^(?:script|textarea)$/i.test(tagName)){\n\t\tvar elEndStart = source.indexOf('',elStartEnd);\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\n\t\tif(/[&<]/.test(text)){\n\t\t\tif(/^script$/i.test(tagName)){\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\n\t\t\t\t\t//lexHandler.startCDATA();\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\t\t//lexHandler.endCDATA();\n\t\t\t\t\treturn elEndStart;\n\t\t\t\t//}\n\t\t\t}//}else{//text area\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\treturn elEndStart;\n\t\t\t//}\n\n\t\t}\n\t}\n\treturn elStartEnd+1;\n}\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\n\t//if(tagName in closeMap){\n\tvar pos = closeMap[tagName];\n\tif(pos == null){\n\t\t//console.log(tagName)\n\t\tpos = source.lastIndexOf('')\n\t\tif(pos',start+4);\n\t\t\t//append comment source.substring(4,end)//