@mxtommy/kip
Version:
An advanced and versatile marine instrumentation package to display Signal K data.
1 lines • 772 kB
JavaScript
import{A as rc,B as qa,C as hn,D as Fi,E as Ga,F as ja,G as $a,H as ac,I as oc,J as sc,K as Ya,L as Xa,a as ln,b as dn,c as La,d as Dn,e as jr,f as Ei,g as cn,h as di,i as za,j as Fa,k as vr,l as Pn,m as Ba,n as Ha,o as Mi,p as ps,q as Ua,r as $r,s as ic,t as fs,u as gs,v as vs,w as ys,x as yr,y as Yr,z as nc}from"./chunk-UAXU53MS.js";import{b as hc,g as uc}from"./chunk-2LFTAKOR.js";import{a as dt,b as Yd,c as Na,d as fr,e as gr,f as Xd,g as Kd,h as Qd,i as Zd,j as Jd,k as ec,l as tc,m as Wa,n as Va}from"./chunk-BHIWMTAL.js";import"./chunk-7HGASC2C.js";import{a as zi}from"./chunk-SFOGOD7T.js";import{a as lc,b as dc,c as cc}from"./chunk-6OIYX37H.js";import{d as _i}from"./chunk-227VFT2C.js";import"./chunk-7XQ5QE47.js";import"./chunk-FPJ3XPOG.js";import{a as hd,b as ud,c as md,d as pd,e as fd,f as gd,g as lr,h as vd,i as yd,j as dr,l as bd,m as _d,n as wd,o as Cd,p as Ut,q as wt}from"./chunk-PFPMEH2B.js";import{f as Bd}from"./chunk-JHWS5VWZ.js";import{a as Ht}from"./chunk-ZDFGHJZD.js";import{a as $d}from"./chunk-MZFYZTYI.js";import{D as qd,Q as Gd,Z as jd,a as Li,b as ad,c as od,d as sr,e as Ma,g as bi,h as Da,i as ei,j as li,k as cr,l as ne,m as hr,n as on,o as Sd,p as sn,r as Hd,w as Ud}from"./chunk-2OWJVOTJ.js";import{$ as rs,$b as X,$c as an,$d as xd,A as oi,Aa as V,Ab as ye,Ac as Ye,Ad as nd,Ba as he,Bc as yt,Be as Rd,Ca as ot,Cb as Ca,Cc as Xl,Cd as rd,Da as Ji,Db as jl,De as Dt,Ea as en,Ec as De,Ee as Ia,Fa as Wi,Fb as xt,Fc as Pe,Gb as mt,Gc as Ae,Ge as Nt,H as Il,Hb as tn,Hc as Kl,He as hs,I as ts,Ic as Ql,Ie as Id,J as ya,Ja as ae,Jc as Zl,Jd as sd,Je as Nd,K as Nl,Kc as rn,Kd as ld,L as Zn,Ld as dd,Mc as rr,Md as cd,Me as us,Na as ir,Nd as Bt,Oa as nr,Ob as $l,Od as ti,P as ba,Qa as Ze,Qc as ar,R as Wl,Ra as Fl,Rb as ce,Rc as Ta,S as is,Sb as Re,Sc as Jl,Se as Wd,T as ns,Tb as Ie,Te as pr,Ub as nn,Uc as ds,Ud as ur,Ue as Vd,V as Vl,Ve as ms,W as Ll,Wa as ss,Wb as gi,Wc as rt,Wd as cs,Xb as vi,Xc as gt,Yb as q,Yc as ue,Zb as y,Zd as kd,Ze as Ld,_b as k,a as J,aa as Jn,ac as I,ad as U,ae as Td,b as ut,bc as B,bd as se,bf as zd,c as Ol,cc as ee,ce as Pa,cf as Fd,d as Zo,dc as ka,dd as Tn,e as qr,ec as xa,ed as or,f as Qn,fa as as,fe as Aa,g as ga,gc as Z,ge as Ed,ha as si,hb as _a,he as Md,ia as os,ib as wa,ic as L,id as Ea,ie as Dd,jc as Gr,je as Oa,kb as Bl,kc as $,ke as Pd,la as Qe,lb as C,lc as yi,ld as ed,m as kt,mc as It,nb as Hl,nc as kn,o as Zi,oa as ft,ob as Ul,oc as Ti,pa as pi,pb as Sa,pc as Lt,pe as Ad,qb as Jt,qc as zt,qe as Od,ra as er,re as mr,sa as tr,sb as ls,sc as oe,t as Rl,ta as P,tb as ql,tc as Ne,te as Ra,u as Jo,uc as Yl,ud as td,ue as En,va as zl,vc as be,ve as Mn,wb as G,wc as Ft,x as va,xb as fi,xd as id,yb as Vi,yc as xn,z as es,za as W,zb as Gl,zc as S}from"./chunk-W2S6R4AZ.js";var xs=Zo(io=>{(function(){"use strict";var r=function(){this.init()};r.prototype={init:function(){var l=this||n;return l._counter=1e3,l._html5AudioPool=[],l.html5PoolSize=10,l._codecs={},l._howls=[],l._muted=!1,l._volume=1,l._canPlayEvent="canplaythrough",l._navigator=typeof window<"u"&&window.navigator?window.navigator:null,l.masterGain=null,l.noAudio=!1,l.usingWebAudio=!0,l.autoSuspend=!0,l.ctx=null,l.autoUnlock=!0,l._setup(),l},volume:function(l){var c=this||n;if(l=parseFloat(l),c.ctx||p(),typeof l<"u"&&l>=0&&l<=1){if(c._volume=l,c._muted)return c;c.usingWebAudio&&c.masterGain.gain.setValueAtTime(l,n.ctx.currentTime);for(var m=0;m<c._howls.length;m++)if(!c._howls[m]._webAudio)for(var v=c._howls[m]._getSoundIds(),_=0;_<v.length;_++){var E=c._howls[m]._soundById(v[_]);E&&E._node&&(E._node.volume=E._volume*l)}return c}return c._volume},mute:function(l){var c=this||n;c.ctx||p(),c._muted=l,c.usingWebAudio&&c.masterGain.gain.setValueAtTime(l?0:c._volume,n.ctx.currentTime);for(var m=0;m<c._howls.length;m++)if(!c._howls[m]._webAudio)for(var v=c._howls[m]._getSoundIds(),_=0;_<v.length;_++){var E=c._howls[m]._soundById(v[_]);E&&E._node&&(E._node.muted=l?!0:E._muted)}return c},stop:function(){for(var l=this||n,c=0;c<l._howls.length;c++)l._howls[c].stop();return l},unload:function(){for(var l=this||n,c=l._howls.length-1;c>=0;c--)l._howls[c].unload();return l.usingWebAudio&&l.ctx&&typeof l.ctx.close<"u"&&(l.ctx.close(),l.ctx=null,p()),l},codecs:function(l){return(this||n)._codecs[l.replace(/^x-/,"")]},_setup:function(){var l=this||n;if(l.state=l.ctx&&l.ctx.state||"suspended",l._autoSuspend(),!l.usingWebAudio)if(typeof Audio<"u")try{var c=new Audio;typeof c.oncanplaythrough>"u"&&(l._canPlayEvent="canplay")}catch{l.noAudio=!0}else l.noAudio=!0;try{var c=new Audio;c.muted&&(l.noAudio=!0)}catch{}return l.noAudio||l._setupCodecs(),l},_setupCodecs:function(){var l=this||n,c=null;try{c=typeof Audio<"u"?new Audio:null}catch{return l}if(!c||typeof c.canPlayType!="function")return l;var m=c.canPlayType("audio/mpeg;").replace(/^no$/,""),v=l._navigator?l._navigator.userAgent:"",_=v.match(/OPR\/(\d+)/g),E=_&&parseInt(_[0].split("/")[1],10)<33,M=v.indexOf("Safari")!==-1&&v.indexOf("Chrome")===-1,H=v.match(/Version\/(.*?) /),Y=M&&H&&parseInt(H[1],10)<15;return l._codecs={mp3:!!(!E&&(m||c.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!m,opus:!!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(c.canPlayType('audio/wav; codecs="1"')||c.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!c.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(c.canPlayType("audio/x-m4b;")||c.canPlayType("audio/m4b;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!Y&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!Y&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!c.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(c.canPlayType("audio/x-flac;")||c.canPlayType("audio/flac;")).replace(/^no$/,"")},l},_unlockAudio:function(){var l=this||n;if(!(l._audioUnlocked||!l.ctx)){l._audioUnlocked=!1,l.autoUnlock=!1,!l._mobileUnloaded&&l.ctx.sampleRate!==44100&&(l._mobileUnloaded=!0,l.unload()),l._scratchBuffer=l.ctx.createBuffer(1,1,22050);var c=function(m){for(;l._html5AudioPool.length<l.html5PoolSize;)try{var v=new Audio;v._unlocked=!0,l._releaseHtml5Audio(v)}catch{l.noAudio=!0;break}for(var _=0;_<l._howls.length;_++)if(!l._howls[_]._webAudio)for(var E=l._howls[_]._getSoundIds(),M=0;M<E.length;M++){var H=l._howls[_]._soundById(E[M]);H&&H._node&&!H._node._unlocked&&(H._node._unlocked=!0,H._node.load())}l._autoResume();var Y=l.ctx.createBufferSource();Y.buffer=l._scratchBuffer,Y.connect(l.ctx.destination),typeof Y.start>"u"?Y.noteOn(0):Y.start(0),typeof l.ctx.resume=="function"&&l.ctx.resume(),Y.onended=function(){Y.disconnect(0),l._audioUnlocked=!0,document.removeEventListener("touchstart",c,!0),document.removeEventListener("touchend",c,!0),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",c,!0);for(var re=0;re<l._howls.length;re++)l._howls[re]._emit("unlock")}};return document.addEventListener("touchstart",c,!0),document.addEventListener("touchend",c,!0),document.addEventListener("click",c,!0),document.addEventListener("keydown",c,!0),l}},_obtainHtml5Audio:function(){var l=this||n;if(l._html5AudioPool.length)return l._html5AudioPool.pop();var c=new Audio().play();return c&&typeof Promise<"u"&&(c instanceof Promise||typeof c.then=="function")&&c.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(l){var c=this||n;return l._unlocked&&c._html5AudioPool.push(l),c},_autoSuspend:function(){var l=this;if(!(!l.autoSuspend||!l.ctx||typeof l.ctx.suspend>"u"||!n.usingWebAudio)){for(var c=0;c<l._howls.length;c++)if(l._howls[c]._webAudio){for(var m=0;m<l._howls[c]._sounds.length;m++)if(!l._howls[c]._sounds[m]._paused)return l}return l._suspendTimer&&clearTimeout(l._suspendTimer),l._suspendTimer=setTimeout(function(){if(l.autoSuspend){l._suspendTimer=null,l.state="suspending";var v=function(){l.state="suspended",l._resumeAfterSuspend&&(delete l._resumeAfterSuspend,l._autoResume())};l.ctx.suspend().then(v,v)}},3e4),l}},_autoResume:function(){var l=this;if(!(!l.ctx||typeof l.ctx.resume>"u"||!n.usingWebAudio))return l.state==="running"&&l.ctx.state!=="interrupted"&&l._suspendTimer?(clearTimeout(l._suspendTimer),l._suspendTimer=null):l.state==="suspended"||l.state==="running"&&l.ctx.state==="interrupted"?(l.ctx.resume().then(function(){l.state="running";for(var c=0;c<l._howls.length;c++)l._howls[c]._emit("resume")}),l._suspendTimer&&(clearTimeout(l._suspendTimer),l._suspendTimer=null)):l.state==="suspending"&&(l._resumeAfterSuspend=!0),l}};var n=new r,e=function(l){var c=this;if(!l.src||l.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}c.init(l)};e.prototype={init:function(l){var c=this;return n.ctx||p(),c._autoplay=l.autoplay||!1,c._format=typeof l.format!="string"?l.format:[l.format],c._html5=l.html5||!1,c._muted=l.mute||!1,c._loop=l.loop||!1,c._pool=l.pool||5,c._preload=typeof l.preload=="boolean"||l.preload==="metadata"?l.preload:!0,c._rate=l.rate||1,c._sprite=l.sprite||{},c._src=typeof l.src!="string"?l.src:[l.src],c._volume=l.volume!==void 0?l.volume:1,c._xhr={method:l.xhr&&l.xhr.method?l.xhr.method:"GET",headers:l.xhr&&l.xhr.headers?l.xhr.headers:null,withCredentials:l.xhr&&l.xhr.withCredentials?l.xhr.withCredentials:!1},c._duration=0,c._state="unloaded",c._sounds=[],c._endTimers={},c._queue=[],c._playLock=!1,c._onend=l.onend?[{fn:l.onend}]:[],c._onfade=l.onfade?[{fn:l.onfade}]:[],c._onload=l.onload?[{fn:l.onload}]:[],c._onloaderror=l.onloaderror?[{fn:l.onloaderror}]:[],c._onplayerror=l.onplayerror?[{fn:l.onplayerror}]:[],c._onpause=l.onpause?[{fn:l.onpause}]:[],c._onplay=l.onplay?[{fn:l.onplay}]:[],c._onstop=l.onstop?[{fn:l.onstop}]:[],c._onmute=l.onmute?[{fn:l.onmute}]:[],c._onvolume=l.onvolume?[{fn:l.onvolume}]:[],c._onrate=l.onrate?[{fn:l.onrate}]:[],c._onseek=l.onseek?[{fn:l.onseek}]:[],c._onunlock=l.onunlock?[{fn:l.onunlock}]:[],c._onresume=[],c._webAudio=n.usingWebAudio&&!c._html5,typeof n.ctx<"u"&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(c),c._autoplay&&c._queue.push({event:"play",action:function(){c.play()}}),c._preload&&c._preload!=="none"&&c.load(),c},load:function(){var l=this,c=null;if(n.noAudio){l._emit("loaderror",null,"No audio support.");return}typeof l._src=="string"&&(l._src=[l._src]);for(var m=0;m<l._src.length;m++){var v,_;if(l._format&&l._format[m])v=l._format[m];else{if(_=l._src[m],typeof _!="string"){l._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}v=/^data:audio\/([^;,]+);/i.exec(_),v||(v=/\.([^.]+)$/.exec(_.split("?",1)[0])),v&&(v=v[1].toLowerCase())}if(v||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),v&&n.codecs(v)){c=l._src[m];break}}if(!c){l._emit("loaderror",null,"No codec support for selected audio sources.");return}return l._src=c,l._state="loading",window.location.protocol==="https:"&&c.slice(0,5)==="http:"&&(l._html5=!0,l._webAudio=!1),new t(l),l._webAudio&&a(l),l},play:function(l,c){var m=this,v=null;if(typeof l=="number")v=l,l=null;else{if(typeof l=="string"&&m._state==="loaded"&&!m._sprite[l])return null;if(typeof l>"u"&&(l="__default",!m._playLock)){for(var _=0,E=0;E<m._sounds.length;E++)m._sounds[E]._paused&&!m._sounds[E]._ended&&(_++,v=m._sounds[E]._id);_===1?l=null:v=null}}var M=v?m._soundById(v):m._inactiveSound();if(!M)return null;if(v&&!l&&(l=M._sprite||"__default"),m._state!=="loaded"){M._sprite=l,M._ended=!1;var H=M._id;return m._queue.push({event:"play",action:function(){m.play(H)}}),H}if(v&&!M._paused)return c||m._loadQueue("play"),M._id;m._webAudio&&n._autoResume();var Y=Math.max(0,M._seek>0?M._seek:m._sprite[l][0]/1e3),re=Math.max(0,(m._sprite[l][0]+m._sprite[l][1])/1e3-Y),xe=re*1e3/Math.abs(M._rate),Xe=m._sprite[l][0]/1e3,Ke=(m._sprite[l][0]+m._sprite[l][1])/1e3;M._sprite=l,M._ended=!1;var et=function(){M._paused=!1,M._seek=Y,M._start=Xe,M._stop=Ke,M._loop=!!(M._loop||m._sprite[l][2])};if(Y>=Ke){m._ended(M);return}var me=M._node;if(m._webAudio){var ct=function(){m._playLock=!1,et(),m._refreshBuffer(M);var pt=M._muted||m._muted?0:M._volume;me.gain.setValueAtTime(pt,n.ctx.currentTime),M._playStart=n.ctx.currentTime,typeof me.bufferSource.start>"u"?M._loop?me.bufferSource.noteGrainOn(0,Y,86400):me.bufferSource.noteGrainOn(0,Y,re):M._loop?me.bufferSource.start(0,Y,86400):me.bufferSource.start(0,Y,re),xe!==1/0&&(m._endTimers[M._id]=setTimeout(m._ended.bind(m,M),xe)),c||setTimeout(function(){m._emit("play",M._id),m._loadQueue()},0)};n.state==="running"&&n.ctx.state!=="interrupted"?ct():(m._playLock=!0,m.once("resume",ct),m._clearTimer(M._id))}else{var st=function(){me.currentTime=Y,me.muted=M._muted||m._muted||n._muted||me.muted,me.volume=M._volume*n.volume(),me.playbackRate=M._rate;try{var pt=me.play();if(pt&&typeof Promise<"u"&&(pt instanceof Promise||typeof pt.then=="function")?(m._playLock=!0,et(),pt.then(function(){m._playLock=!1,me._unlocked=!0,c?m._loadQueue():m._emit("play",M._id)}).catch(function(){m._playLock=!1,m._emit("playerror",M._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),M._ended=!0,M._paused=!0})):c||(m._playLock=!1,et(),m._emit("play",M._id)),me.playbackRate=M._rate,me.paused){m._emit("playerror",M._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}l!=="__default"||M._loop?m._endTimers[M._id]=setTimeout(m._ended.bind(m,M),xe):(m._endTimers[M._id]=function(){m._ended(M),me.removeEventListener("ended",m._endTimers[M._id],!1)},me.addEventListener("ended",m._endTimers[M._id],!1))}catch(_t){m._emit("playerror",M._id,_t)}};me.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(me.src=m._src,me.load());var Vt=window&&window.ejecta||!me.readyState&&n._navigator.isCocoonJS;if(me.readyState>=3||Vt)st();else{m._playLock=!0,m._state="loading";var bt=function(){m._state="loaded",st(),me.removeEventListener(n._canPlayEvent,bt,!1)};me.addEventListener(n._canPlayEvent,bt,!1),m._clearTimer(M._id)}}return M._id},pause:function(l){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"pause",action:function(){c.pause(l)}}),c;for(var m=c._getSoundIds(l),v=0;v<m.length;v++){c._clearTimer(m[v]);var _=c._soundById(m[v]);if(_&&!_._paused&&(_._seek=c.seek(m[v]),_._rateSeek=0,_._paused=!0,c._stopFade(m[v]),_._node))if(c._webAudio){if(!_._node.bufferSource)continue;typeof _._node.bufferSource.stop>"u"?_._node.bufferSource.noteOff(0):_._node.bufferSource.stop(0),c._cleanBuffer(_._node)}else(!isNaN(_._node.duration)||_._node.duration===1/0)&&_._node.pause();arguments[1]||c._emit("pause",_?_._id:null)}return c},stop:function(l,c){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"stop",action:function(){m.stop(l)}}),m;for(var v=m._getSoundIds(l),_=0;_<v.length;_++){m._clearTimer(v[_]);var E=m._soundById(v[_]);E&&(E._seek=E._start||0,E._rateSeek=0,E._paused=!0,E._ended=!0,m._stopFade(v[_]),E._node&&(m._webAudio?E._node.bufferSource&&(typeof E._node.bufferSource.stop>"u"?E._node.bufferSource.noteOff(0):E._node.bufferSource.stop(0),m._cleanBuffer(E._node)):(!isNaN(E._node.duration)||E._node.duration===1/0)&&(E._node.currentTime=E._start||0,E._node.pause(),E._node.duration===1/0&&m._clearSound(E._node))),c||m._emit("stop",E._id))}return m},mute:function(l,c){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"mute",action:function(){m.mute(l,c)}}),m;if(typeof c>"u")if(typeof l=="boolean")m._muted=l;else return m._muted;for(var v=m._getSoundIds(c),_=0;_<v.length;_++){var E=m._soundById(v[_]);E&&(E._muted=l,E._interval&&m._stopFade(E._id),m._webAudio&&E._node?E._node.gain.setValueAtTime(l?0:E._volume,n.ctx.currentTime):E._node&&(E._node.muted=n._muted?!0:l),m._emit("mute",E._id))}return m},volume:function(){var l=this,c=arguments,m,v;if(c.length===0)return l._volume;if(c.length===1||c.length===2&&typeof c[1]>"u"){var _=l._getSoundIds(),E=_.indexOf(c[0]);E>=0?v=parseInt(c[0],10):m=parseFloat(c[0])}else c.length>=2&&(m=parseFloat(c[0]),v=parseInt(c[1],10));var M;if(typeof m<"u"&&m>=0&&m<=1){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"volume",action:function(){l.volume.apply(l,c)}}),l;typeof v>"u"&&(l._volume=m),v=l._getSoundIds(v);for(var H=0;H<v.length;H++)M=l._soundById(v[H]),M&&(M._volume=m,c[2]||l._stopFade(v[H]),l._webAudio&&M._node&&!M._muted?M._node.gain.setValueAtTime(m,n.ctx.currentTime):M._node&&!M._muted&&(M._node.volume=m*n.volume()),l._emit("volume",M._id))}else return M=v?l._soundById(v):l._sounds[0],M?M._volume:0;return l},fade:function(l,c,m,v){var _=this;if(_._state!=="loaded"||_._playLock)return _._queue.push({event:"fade",action:function(){_.fade(l,c,m,v)}}),_;l=Math.min(Math.max(0,parseFloat(l)),1),c=Math.min(Math.max(0,parseFloat(c)),1),m=parseFloat(m),_.volume(l,v);for(var E=_._getSoundIds(v),M=0;M<E.length;M++){var H=_._soundById(E[M]);if(H){if(v||_._stopFade(E[M]),_._webAudio&&!H._muted){var Y=n.ctx.currentTime,re=Y+m/1e3;H._volume=l,H._node.gain.setValueAtTime(l,Y),H._node.gain.linearRampToValueAtTime(c,re)}_._startFadeInterval(H,l,c,m,E[M],typeof v>"u")}}return _},_startFadeInterval:function(l,c,m,v,_,E){var M=this,H=c,Y=m-c,re=Math.abs(Y/.01),xe=Math.max(4,re>0?v/re:v),Xe=Date.now();l._fadeTo=m,l._interval=setInterval(function(){var Ke=(Date.now()-Xe)/v;Xe=Date.now(),H+=Y*Ke,H=Math.round(H*100)/100,Y<0?H=Math.max(m,H):H=Math.min(m,H),M._webAudio?l._volume=H:M.volume(H,l._id,!0),E&&(M._volume=H),(m<c&&H<=m||m>c&&H>=m)&&(clearInterval(l._interval),l._interval=null,l._fadeTo=null,M.volume(m,l._id),M._emit("fade",l._id))},xe)},_stopFade:function(l){var c=this,m=c._soundById(l);return m&&m._interval&&(c._webAudio&&m._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(m._interval),m._interval=null,c.volume(m._fadeTo,l),m._fadeTo=null,c._emit("fade",l)),c},loop:function(){var l=this,c=arguments,m,v,_;if(c.length===0)return l._loop;if(c.length===1)if(typeof c[0]=="boolean")m=c[0],l._loop=m;else return _=l._soundById(parseInt(c[0],10)),_?_._loop:!1;else c.length===2&&(m=c[0],v=parseInt(c[1],10));for(var E=l._getSoundIds(v),M=0;M<E.length;M++)_=l._soundById(E[M]),_&&(_._loop=m,l._webAudio&&_._node&&_._node.bufferSource&&(_._node.bufferSource.loop=m,m&&(_._node.bufferSource.loopStart=_._start||0,_._node.bufferSource.loopEnd=_._stop,l.playing(E[M])&&(l.pause(E[M],!0),l.play(E[M],!0)))));return l},rate:function(){var l=this,c=arguments,m,v;if(c.length===0)v=l._sounds[0]._id;else if(c.length===1){var _=l._getSoundIds(),E=_.indexOf(c[0]);E>=0?v=parseInt(c[0],10):m=parseFloat(c[0])}else c.length===2&&(m=parseFloat(c[0]),v=parseInt(c[1],10));var M;if(typeof m=="number"){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"rate",action:function(){l.rate.apply(l,c)}}),l;typeof v>"u"&&(l._rate=m),v=l._getSoundIds(v);for(var H=0;H<v.length;H++)if(M=l._soundById(v[H]),M){l.playing(v[H])&&(M._rateSeek=l.seek(v[H]),M._playStart=l._webAudio?n.ctx.currentTime:M._playStart),M._rate=m,l._webAudio&&M._node&&M._node.bufferSource?M._node.bufferSource.playbackRate.setValueAtTime(m,n.ctx.currentTime):M._node&&(M._node.playbackRate=m);var Y=l.seek(v[H]),re=(l._sprite[M._sprite][0]+l._sprite[M._sprite][1])/1e3-Y,xe=re*1e3/Math.abs(M._rate);(l._endTimers[v[H]]||!M._paused)&&(l._clearTimer(v[H]),l._endTimers[v[H]]=setTimeout(l._ended.bind(l,M),xe)),l._emit("rate",M._id)}}else return M=l._soundById(v),M?M._rate:l._rate;return l},seek:function(){var l=this,c=arguments,m,v;if(c.length===0)l._sounds.length&&(v=l._sounds[0]._id);else if(c.length===1){var _=l._getSoundIds(),E=_.indexOf(c[0]);E>=0?v=parseInt(c[0],10):l._sounds.length&&(v=l._sounds[0]._id,m=parseFloat(c[0]))}else c.length===2&&(m=parseFloat(c[0]),v=parseInt(c[1],10));if(typeof v>"u")return 0;if(typeof m=="number"&&(l._state!=="loaded"||l._playLock))return l._queue.push({event:"seek",action:function(){l.seek.apply(l,c)}}),l;var M=l._soundById(v);if(M)if(typeof m=="number"&&m>=0){var H=l.playing(v);H&&l.pause(v,!0),M._seek=m,M._ended=!1,l._clearTimer(v),!l._webAudio&&M._node&&!isNaN(M._node.duration)&&(M._node.currentTime=m);var Y=function(){H&&l.play(v,!0),l._emit("seek",v)};if(H&&!l._webAudio){var re=function(){l._playLock?setTimeout(re,0):Y()};setTimeout(re,0)}else Y()}else if(l._webAudio){var xe=l.playing(v)?n.ctx.currentTime-M._playStart:0,Xe=M._rateSeek?M._rateSeek-M._seek:0;return M._seek+(Xe+xe*Math.abs(M._rate))}else return M._node.currentTime;return l},playing:function(l){var c=this;if(typeof l=="number"){var m=c._soundById(l);return m?!m._paused:!1}for(var v=0;v<c._sounds.length;v++)if(!c._sounds[v]._paused)return!0;return!1},duration:function(l){var c=this,m=c._duration,v=c._soundById(l);return v&&(m=c._sprite[v._sprite][1]/1e3),m},state:function(){return this._state},unload:function(){for(var l=this,c=l._sounds,m=0;m<c.length;m++)c[m]._paused||l.stop(c[m]._id),l._webAudio||(l._clearSound(c[m]._node),c[m]._node.removeEventListener("error",c[m]._errorFn,!1),c[m]._node.removeEventListener(n._canPlayEvent,c[m]._loadFn,!1),c[m]._node.removeEventListener("ended",c[m]._endFn,!1),n._releaseHtml5Audio(c[m]._node)),delete c[m]._node,l._clearTimer(c[m]._id);var v=n._howls.indexOf(l);v>=0&&n._howls.splice(v,1);var _=!0;for(m=0;m<n._howls.length;m++)if(n._howls[m]._src===l._src||l._src.indexOf(n._howls[m]._src)>=0){_=!1;break}return i&&_&&delete i[l._src],n.noAudio=!1,l._state="unloaded",l._sounds=[],l=null,null},on:function(l,c,m,v){var _=this,E=_["_on"+l];return typeof c=="function"&&E.push(v?{id:m,fn:c,once:v}:{id:m,fn:c}),_},off:function(l,c,m){var v=this,_=v["_on"+l],E=0;if(typeof c=="number"&&(m=c,c=null),c||m)for(E=0;E<_.length;E++){var M=m===_[E].id;if(c===_[E].fn&&M||!c&&M){_.splice(E,1);break}}else if(l)v["_on"+l]=[];else{var H=Object.keys(v);for(E=0;E<H.length;E++)H[E].indexOf("_on")===0&&Array.isArray(v[H[E]])&&(v[H[E]]=[])}return v},once:function(l,c,m){var v=this;return v.on(l,c,m,1),v},_emit:function(l,c,m){for(var v=this,_=v["_on"+l],E=_.length-1;E>=0;E--)(!_[E].id||_[E].id===c||l==="load")&&(setTimeout((function(M){M.call(this,c,m)}).bind(v,_[E].fn),0),_[E].once&&v.off(l,_[E].fn,_[E].id));return v._loadQueue(l),v},_loadQueue:function(l){var c=this;if(c._queue.length>0){var m=c._queue[0];m.event===l&&(c._queue.shift(),c._loadQueue()),l||m.action()}return c},_ended:function(l){var c=this,m=l._sprite;if(!c._webAudio&&l._node&&!l._node.paused&&!l._node.ended&&l._node.currentTime<l._stop)return setTimeout(c._ended.bind(c,l),100),c;var v=!!(l._loop||c._sprite[m][2]);if(c._emit("end",l._id),!c._webAudio&&v&&c.stop(l._id,!0).play(l._id),c._webAudio&&v){c._emit("play",l._id),l._seek=l._start||0,l._rateSeek=0,l._playStart=n.ctx.currentTime;var _=(l._stop-l._start)*1e3/Math.abs(l._rate);c._endTimers[l._id]=setTimeout(c._ended.bind(c,l),_)}return c._webAudio&&!v&&(l._paused=!0,l._ended=!0,l._seek=l._start||0,l._rateSeek=0,c._clearTimer(l._id),c._cleanBuffer(l._node),n._autoSuspend()),!c._webAudio&&!v&&c.stop(l._id,!0),c},_clearTimer:function(l){var c=this;if(c._endTimers[l]){if(typeof c._endTimers[l]!="function")clearTimeout(c._endTimers[l]);else{var m=c._soundById(l);m&&m._node&&m._node.removeEventListener("ended",c._endTimers[l],!1)}delete c._endTimers[l]}return c},_soundById:function(l){for(var c=this,m=0;m<c._sounds.length;m++)if(l===c._sounds[m]._id)return c._sounds[m];return null},_inactiveSound:function(){var l=this;l._drain();for(var c=0;c<l._sounds.length;c++)if(l._sounds[c]._ended)return l._sounds[c].reset();return new t(l)},_drain:function(){var l=this,c=l._pool,m=0,v=0;if(!(l._sounds.length<c)){for(v=0;v<l._sounds.length;v++)l._sounds[v]._ended&&m++;for(v=l._sounds.length-1;v>=0;v--){if(m<=c)return;l._sounds[v]._ended&&(l._webAudio&&l._sounds[v]._node&&l._sounds[v]._node.disconnect(0),l._sounds.splice(v,1),m--)}}},_getSoundIds:function(l){var c=this;if(typeof l>"u"){for(var m=[],v=0;v<c._sounds.length;v++)m.push(c._sounds[v]._id);return m}else return[l]},_refreshBuffer:function(l){var c=this;return l._node.bufferSource=n.ctx.createBufferSource(),l._node.bufferSource.buffer=i[c._src],l._panner?l._node.bufferSource.connect(l._panner):l._node.bufferSource.connect(l._node),l._node.bufferSource.loop=l._loop,l._loop&&(l._node.bufferSource.loopStart=l._start||0,l._node.bufferSource.loopEnd=l._stop||0),l._node.bufferSource.playbackRate.setValueAtTime(l._rate,n.ctx.currentTime),c},_cleanBuffer:function(l){var c=this,m=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(!l.bufferSource)return c;if(n._scratchBuffer&&l.bufferSource&&(l.bufferSource.onended=null,l.bufferSource.disconnect(0),m))try{l.bufferSource.buffer=n._scratchBuffer}catch{}return l.bufferSource=null,c},_clearSound:function(l){var c=/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent);c||(l.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var t=function(l){this._parent=l,this.init()};t.prototype={init:function(){var l=this,c=l._parent;return l._muted=c._muted,l._loop=c._loop,l._volume=c._volume,l._rate=c._rate,l._seek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++n._counter,c._sounds.push(l),l.create(),l},create:function(){var l=this,c=l._parent,m=n._muted||l._muted||l._parent._muted?0:l._volume;return c._webAudio?(l._node=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),l._node.gain.setValueAtTime(m,n.ctx.currentTime),l._node.paused=!0,l._node.connect(n.masterGain)):n.noAudio||(l._node=n._obtainHtml5Audio(),l._errorFn=l._errorListener.bind(l),l._node.addEventListener("error",l._errorFn,!1),l._loadFn=l._loadListener.bind(l),l._node.addEventListener(n._canPlayEvent,l._loadFn,!1),l._endFn=l._endListener.bind(l),l._node.addEventListener("ended",l._endFn,!1),l._node.src=c._src,l._node.preload=c._preload===!0?"auto":c._preload,l._node.volume=m*n.volume(),l._node.load()),l},reset:function(){var l=this,c=l._parent;return l._muted=c._muted,l._loop=c._loop,l._volume=c._volume,l._rate=c._rate,l._seek=0,l._rateSeek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++n._counter,l},_errorListener:function(){var l=this;l._parent._emit("loaderror",l._id,l._node.error?l._node.error.code:0),l._node.removeEventListener("error",l._errorFn,!1)},_loadListener:function(){var l=this,c=l._parent;c._duration=Math.ceil(l._node.duration*10)/10,Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue()),l._node.removeEventListener(n._canPlayEvent,l._loadFn,!1)},_endListener:function(){var l=this,c=l._parent;c._duration===1/0&&(c._duration=Math.ceil(l._node.duration*10)/10,c._sprite.__default[1]===1/0&&(c._sprite.__default[1]=c._duration*1e3),c._ended(l)),l._node.removeEventListener("ended",l._endFn,!1)}};var i={},a=function(l){var c=l._src;if(i[c]){l._duration=i[c].duration,d(l);return}if(/^data:[^;]+;base64,/.test(c)){for(var m=atob(c.split(",")[1]),v=new Uint8Array(m.length),_=0;_<m.length;++_)v[_]=m.charCodeAt(_);s(v.buffer,l)}else{var E=new XMLHttpRequest;E.open(l._xhr.method,c,!0),E.withCredentials=l._xhr.withCredentials,E.responseType="arraybuffer",l._xhr.headers&&Object.keys(l._xhr.headers).forEach(function(M){E.setRequestHeader(M,l._xhr.headers[M])}),E.onload=function(){var M=(E.status+"")[0];if(M!=="0"&&M!=="2"&&M!=="3"){l._emit("loaderror",null,"Failed loading audio file with status: "+E.status+".");return}s(E.response,l)},E.onerror=function(){l._webAudio&&(l._html5=!0,l._webAudio=!1,l._sounds=[],delete i[c],l.load())},o(E)}},o=function(l){try{l.send()}catch{l.onerror()}},s=function(l,c){var m=function(){c._emit("loaderror",null,"Decoding audio data failed.")},v=function(_){_&&c._sounds.length>0?(i[c._src]=_,d(c,_)):m()};typeof Promise<"u"&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(l).then(v).catch(m):n.ctx.decodeAudioData(l,v,m)},d=function(l,c){c&&!l._duration&&(l._duration=c.duration),Object.keys(l._sprite).length===0&&(l._sprite={__default:[0,l._duration*1e3]}),l._state!=="loaded"&&(l._state="loaded",l._emit("load"),l._loadQueue())},p=function(){if(n.usingWebAudio){try{typeof AudioContext<"u"?n.ctx=new AudioContext:typeof webkitAudioContext<"u"?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var l=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),c=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),m=c?parseInt(c[1],10):null;if(l&&m&&m<9){var v=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!v&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};typeof define=="function"&&define.amd&&define([],function(){return{Howler:n,Howl:e}}),typeof io<"u"&&(io.Howler=n,io.Howl=e),typeof global<"u"?(global.HowlerGlobal=r,global.Howler=n,global.Howl=e,global.Sound=t):typeof window<"u"&&(window.HowlerGlobal=r,window.Howler=n,window.Howl=e,window.Sound=t)})();(function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(n){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var t=e._howls.length-1;t>=0;t--)e._howls[t].stereo(n);return e},HowlerGlobal.prototype.pos=function(n,e,t){var i=this;if(!i.ctx||!i.ctx.listener)return i;if(e=typeof e!="number"?i._pos[1]:e,t=typeof t!="number"?i._pos[2]:t,typeof n=="number")i._pos=[n,e,t],typeof i.ctx.listener.positionX<"u"?(i.ctx.listener.positionX.setTargetAtTime(i._pos[0],Howler.ctx.currentTime,.1),i.ctx.listener.positionY.setTargetAtTime(i._pos[1],Howler.ctx.currentTime,.1),i.ctx.listener.positionZ.setTargetAtTime(i._pos[2],Howler.ctx.currentTime,.1)):i.ctx.listener.setPosition(i._pos[0],i._pos[1],i._pos[2]);else return i._pos;return i},HowlerGlobal.prototype.orientation=function(n,e,t,i,a,o){var s=this;if(!s.ctx||!s.ctx.listener)return s;var d=s._orientation;if(e=typeof e!="number"?d[1]:e,t=typeof t!="number"?d[2]:t,i=typeof i!="number"?d[3]:i,a=typeof a!="number"?d[4]:a,o=typeof o!="number"?d[5]:o,typeof n=="number")s._orientation=[n,e,t,i,a,o],typeof s.ctx.listener.forwardX<"u"?(s.ctx.listener.forwardX.setTargetAtTime(n,Howler.ctx.currentTime,.1),s.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),s.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),s.ctx.listener.upX.setTargetAtTime(i,Howler.ctx.currentTime,.1),s.ctx.listener.upY.setTargetAtTime(a,Howler.ctx.currentTime,.1),s.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):s.ctx.listener.setOrientation(n,e,t,i,a,o);else return d;return s},Howl.prototype.init=function(n){return function(e){var t=this;return t._orientation=e.orientation||[1,0,0],t._stereo=e.stereo||null,t._pos=e.pos||null,t._pannerAttr={coneInnerAngle:typeof e.coneInnerAngle<"u"?e.coneInnerAngle:360,coneOuterAngle:typeof e.coneOuterAngle<"u"?e.coneOuterAngle:360,coneOuterGain:typeof e.coneOuterGain<"u"?e.coneOuterGain:0,distanceModel:typeof e.distanceModel<"u"?e.distanceModel:"inverse",maxDistance:typeof e.maxDistance<"u"?e.maxDistance:1e4,panningModel:typeof e.panningModel<"u"?e.panningModel:"HRTF",refDistance:typeof e.refDistance<"u"?e.refDistance:1,rolloffFactor:typeof e.rolloffFactor<"u"?e.rolloffFactor:1},t._onstereo=e.onstereo?[{fn:e.onstereo}]:[],t._onpos=e.onpos?[{fn:e.onpos}]:[],t._onorientation=e.onorientation?[{fn:e.onorientation}]:[],n.call(this,e)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,e){var t=this;if(!t._webAudio)return t;if(t._state!=="loaded")return t._queue.push({event:"stereo",action:function(){t.stereo(n,e)}}),t;var i=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof e>"u")if(typeof n=="number")t._stereo=n,t._pos=[n,0,0];else return t._stereo;for(var a=t._getSoundIds(e),o=0;o<a.length;o++){var s=t._soundById(a[o]);if(s)if(typeof n=="number")s._stereo=n,s._pos=[n,0,0],s._node&&(s._pannerAttr.panningModel="equalpower",(!s._panner||!s._panner.pan)&&r(s,i),i==="spatial"?typeof s._panner.positionX<"u"?(s._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):s._panner.setPosition(n,0,0):s._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),t._emit("stereo",s._id);else return s._stereo}return t},Howl.prototype.pos=function(n,e,t,i){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"pos",action:function(){a.pos(n,e,t,i)}}),a;if(e=typeof e!="number"?0:e,t=typeof t!="number"?-.5:t,typeof i>"u")if(typeof n=="number")a._pos=[n,e,t];else return a._pos;for(var o=a._getSoundIds(i),s=0;s<o.length;s++){var d=a._soundById(o[s]);if(d)if(typeof n=="number")d._pos=[n,e,t],d._node&&((!d._panner||d._panner.pan)&&r(d,"spatial"),typeof d._panner.positionX<"u"?(d._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),d._panner.positionY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.positionZ.setValueAtTime(t,Howler.ctx.currentTime)):d._panner.setPosition(n,e,t)),a._emit("pos",d._id);else return d._pos}return a},Howl.prototype.orientation=function(n,e,t,i){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"orientation",action:function(){a.orientation(n,e,t,i)}}),a;if(e=typeof e!="number"?a._orientation[1]:e,t=typeof t!="number"?a._orientation[2]:t,typeof i>"u")if(typeof n=="number")a._orientation=[n,e,t];else return a._orientation;for(var o=a._getSoundIds(i),s=0;s<o.length;s++){var d=a._soundById(o[s]);if(d)if(typeof n=="number")d._orientation=[n,e,t],d._node&&(d._panner||(d._pos||(d._pos=a._pos||[0,0,-.5]),r(d,"spatial")),typeof d._panner.orientationX<"u"?(d._panner.orientationX.setValueAtTime(n,Howler.ctx.currentTime),d._panner.orientationY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.orientationZ.setValueAtTime(t,Howler.ctx.currentTime)):d._panner.setOrientation(n,e,t)),a._emit("orientation",d._id);else return d._orientation}return a},Howl.prototype.pannerAttr=function(){var n=this,e=arguments,t,i,a;if(!n._webAudio)return n;if(e.length===0)return n._pannerAttr;if(e.length===1)if(typeof e[0]=="object")t=e[0],typeof i>"u"&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),n._pannerAttr={coneInnerAngle:typeof t.pannerAttr.coneInnerAngle<"u"?t.pannerAttr.coneInnerAngle:n._coneInnerAngle,coneOuterAngle:typeof t.pannerAttr.coneOuterAngle<"u"?t.pannerAttr.coneOuterAngle:n._coneOuterAngle,coneOuterGain:typeof t.pannerAttr.coneOuterGain<"u"?t.pannerAttr.coneOuterGain:n._coneOuterGain,distanceModel:typeof t.pannerAttr.distanceModel<"u"?t.pannerAttr.distanceModel:n._distanceModel,maxDistance:typeof t.pannerAttr.maxDistance<"u"?t.pannerAttr.maxDistance:n._maxDistance,refDistance:typeof t.pannerAttr.refDistance<"u"?t.pannerAttr.refDistance:n._refDistance,rolloffFactor:typeof t.pannerAttr.rolloffFactor<"u"?t.pannerAttr.rolloffFactor:n._rolloffFactor,panningModel:typeof t.pannerAttr.panningModel<"u"?t.pannerAttr.panningModel:n._panningModel});else return a=n._soundById(parseInt(e[0],10)),a?a._pannerAttr:n._pannerAttr;else e.length===2&&(t=e[0],i=parseInt(e[1],10));for(var o=n._getSoundIds(i),s=0;s<o.length;s++)if(a=n._soundById(o[s]),a){var d=a._pannerAttr;d={coneInnerAngle:typeof t.coneInnerAngle<"u"?t.coneInnerAngle:d.coneInnerAngle,coneOuterAngle:typeof t.coneOuterAngle<"u"?t.coneOuterAngle:d.coneOuterAngle,coneOuterGain:typeof t.coneOuterGain<"u"?t.coneOuterGain:d.coneOuterGain,distanceModel:typeof t.distanceModel<"u"?t.distanceModel:d.distanceModel,maxDistance:typeof t.maxDistance<"u"?t.maxDistance:d.maxDistance,refDistance:typeof t.refDistance<"u"?t.refDistance:d.refDistance,rolloffFactor:typeof t.rolloffFactor<"u"?t.rolloffFactor:d.rolloffFactor,panningModel:typeof t.panningModel<"u"?t.panningModel:d.panningModel};var p=a._panner;p||(a._pos||(a._pos=n._pos||[0,0,-.5]),r(a,"spatial"),p=a._panner),p.coneInnerAngle=d.coneInnerAngle,p.coneOuterAngle=d.coneOuterAngle,p.coneOuterGain=d.coneOuterGain,p.distanceModel=d.distanceModel,p.maxDistance=d.maxDistance,p.refDistance=d.refDistance,p.rolloffFactor=d.rolloffFactor,p.panningModel=d.panningModel}return n},Sound.prototype.init=function(n){return function(){var e=this,t=e._parent;e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,n.call(this),e._stereo?t.stereo(e._stereo):e._pos&&t.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}}(Sound.prototype.init),Sound.prototype.reset=function(n){return function(){var e=this,t=e._parent;return e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,e._stereo?t.stereo(e._stereo):e._pos?t.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,t._refreshBuffer(e)),n.call(this)}}(Sound.prototype.reset);var r=function(n,e){e=e||"spatial",e==="spatial"?(n._panner=Howler.ctx.createPanner(),n._panner.coneInnerAngle=n._pannerAttr.coneInnerAngle,n._panner.coneOuterAngle=n._pannerAttr.coneOuterAngle,n._panner.coneOuterGain=n._pannerAttr.coneOuterGain,n._panner.distanceModel=n._pannerAttr.distanceModel,n._panner.maxDistance=n._pannerAttr.maxDistance,n._panner.refDistance=n._pannerAttr.refDistance,n._panner.rolloffFactor=n._pannerAttr.rolloffFactor,n._panner.panningModel=n._pannerAttr.panningModel,typeof n._panner.positionX<"u"?(n._panner.positionX.setValueAtTime(n._pos[0],Howler.ctx.currentTime),n._panner.positionY.setValueAtTime(n._pos[1],Howler.ctx.currentTime),n._panner.positionZ.setValueAtTime(n._pos[2],Howler.ctx.currentTime)):n._panner.setPosition(n._pos[0],n._pos[1],n._pos[2]),typeof n._panner.orientationX<"u"?(n._panner.orientationX.setValueAtTime(n._orientation[0],Howler.ctx.currentTime),n._panner.orientationY.setValueAtTime(n._orientation[1],Howler.ctx.currentTime),n._panner.orientationZ.setValueAtTime(n._orientation[2],Howler.ctx.currentTime)):n._panner.setOrientation(n._orientation[0],n._orientation[1],n._orientation[2])):(n._panner=Howler.ctx.createStereoPanner(),n._panner.pan.setValueAtTime(n._stereo,Howler.ctx.currentTime)),n._panner.connect(n._node),n._paused||n._parent.pause(n._id,!0).play(n._id,!0)}})()});var Us=Zo((DC,fo)=>{(function(r){"use strict";function n(u){if(Array.isArray(u)){for(var h=0,f=Array(u.length);h<u.length;h++)f[h]=u[h];return f}return Array.from(u)}function e(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?u:h}function t(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}function i(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function a(u,h){if(h||(h=typeof window>"u"?global:window),h[u]!==void 0)return h[u];if(Ui===null){var f=window.getComputedStyle(document.documentElement,"");Ui=(Array.prototype.slice.call(f).join("").match(/-(moz|webkit|ms)-/)||f.OLink===""&&["","o"]||["",""])[1]}if(Ui==="")return null;var w=u.charAt(0).toUpperCase()+u.substr(1),T=h[Ui+w];return T!==void 0?T:null}function o(u,h,f,w,T,D,O){if(typeof w!="function")throw new TypeError("Invalid animation rule:",w);var z=u-f,N=z/T,F=0;N>1&&(N=1),N!==1&&(F=w(N),isFinite(F)&&!isNaN(F)&&(N=F)),h&&h(N),z<T?O.frame=ua(function(K){return o(K,h,f,w,T,D,O)}):(D&&D(),O.inProgress=!1)}function s(){Array.prototype.constructor.apply(this,arguments)}function d(u){if(!(u instanceof DOMException&&u.result===2152923147))throw u}function p(u,h){return h.replace($o,function(f,w){var T=u[w];return T!==void 0?T:f})}function l(u){return u.majorTicks instanceof Array||(u.majorTicks=u.majorTicks?[u.majorTicks]:[]),u.majorTicks.length||(u.majorTicks.push(le.formatMajorTickNumber(u.minValue,u)),u.majorTicks.push(le.formatMajorTickNumber(u.maxValue,u))),[u.tickSide!=="right",u.tickSide!=="left"]}function c(u,h,f,w,T,D){u.beginPath(),u.moveTo(h+D,f),u.lineTo(h+w-D,f),u.quadraticCurveTo(h+w,f,h+w,f+D),u.lineTo(h+w,f+T-D),u.quadraticCurveTo(h+w,f+T,h+w-D,f+T),u.lineTo(h+D,f+T),u.quadraticCurveTo(h,f+T,h,f+T-D),u.lineTo(h,f+D),u.quadraticCurveTo(h,f,h+D,f),u.closePath()}function m(u,h){var f=h.valueDec,w=h.valueInt,T=0,D=void 0,O=void 0,z=void 0;if(u=parseFloat(u),z=u<0,u=Math.abs(u),f>0){for(O=u.toFixed(f).toString().split("."),D=w-O[0].length;T<D;++T)O[0]="0"+O[0];O=(z?"-":"")+O[0]+"."+O[1]}else{for(O=Math.round(u).toString(),D=w-O.length;T<D;++T)O="0"+O;O=(z?"-":"")+O}return O}function v(u,h){var f=void 0,w=!1;return f=h.majorTicksDec===0?Math.round(u).toString():u.toFixed(h.majorTicksDec),h.majorTicksInt>1?(w=~f.indexOf("."),~f.indexOf("-")?"-"+[h.majorTicksInt+h.majorTicksDec+2+(w?1:0)-f.length].join("0")+f.replace("-",""):[h.majorTicksInt+h.majorTicksDec+1+(w?1:0)-f.length].join("0")+f):f}function _(u){return u*Math.PI/180}function E(u,h){return{x:-u*Math.sin(h),y:u*Math.cos(h)}}function M(u,h,f,w){var T=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],D=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,O=u.createLinearGradient(T?0:D,T?D:0,T?0:w,T?w:0);return O.addColorStop(0,h),O.addColorStop(1,f),O}function H(u,h){h.needleShadow&&(u.shadowOffsetX=2,u.shadowOffsetY=2,u.shadowBlur=10,u.shadowColor=h.colorNeedleShadowDown)}function Y(u,h,f){return u["font"+h+"Style"]+" "+u["font"+h+"Weight"]+" "+u["font"+h+"Size"]*f+"px "+u["font"+h]}function re(u){u.shadowOffsetX=null,u.shadowOffsetY=null,u.shadowBlur=null,u.shadowColor="",u.strokeStyle=null,u.lineWidth=0,u.save()}function xe(u,h,f,w){h.valueTextShadow&&(u.shadowOffsetX=f,u.shadowOffsetY=f,u.shadowBlur=w,u.shadowColor=h.colorValueTextShadow)}function Xe(u,h,f,w,T,D){if(h.valueBox){re(u);var O=h.valueDec?1+h.valueDec:0,z="9".repeat(Math.max.apply(null,[String(parseInt(f)).length+O].concat(h.majorTicks.map(function(Oe){return String(parseInt(Oe,10)).length+O})))),N=h.valueText||m(f,h),F=D/200,K=D/100,Q=.4*K,de=1.2*K;u.font=Y(h,"Value",F),xe(u,h,Q,de);var we=u.measureText(h.valueText?N:"-"+m(Number(z),h)).width;re(u);var ke=parseFloat(h.fontValueSize)*F+Q+de,Ue=K*parseFloat(h.valueBoxStroke),Te=2*D-2*Ue,qe=we+10*K,Ge=1.1*ke+Q+de,je=K*h.valueBoxBorderRadius,Ce=(parseFloat(h.valueBoxWidth)||0)/100*Te;Ce>qe&&(qe=Ce),qe>Te&&(qe=Te);var ze=w-qe/2,Ee=T-Ge/2,ve=T-5.75*K;if(u.beginPath(),je?c(u,ze,Ee,qe,Ge,je):u.rect(ze,Ee,qe,Ge),Ue){var Me=u.createRadialGradient(w,ve,10*K,w,ve,20*K);Me.addColorStop(0,h.colorValueBoxRect),Me.addColorStop(1,h.colorValueBoxRectEnd),u.strokeStyle=Me,u.lineWidth=Ue,u.stroke()}h.colorValueBoxShadow&&(u.shadowBlur=1.2*K,u.shadowColor=h.colorValueBoxShadow),h.colorValueBoxBackground&&(u.fillStyle=h.colorValueBoxBackground,u.fill()),u.closePath(),u.restore(),xe(u,h,Q,de),u.fillStyle=h.colorValueText,u.textAlign="center",u.textBaseline="alphabetic",u.fillText(N,ze+qe/2,T+Ge/2-ke/3),u.restore()}}function Ke(u){var h=u.value,f=u.minValue,w=u.maxValue,T=.01*(w-f);return{normal:h<f?f:h>w?w:h,indented:h<f?f-T:h>w?w+T:h}}function et(u,h,f,w,T){f.beginPath(),f.arc(0,0,Qt(u),0,2*Cn,!0),f.lineWidth=h,f.strokeStyle=T?le.linearGradient(f,w,T,u):w,f.stroke(),f.closePath()}function me(u,h){var f=ai.pixelRatio;return u.maxRadius||(u.maxRadius=u.max-h.borderShadowWidth-h.borderOuterWidth*f-h.borderMiddleWidth*f-h.borderInnerWidth*f+(h.borderOuterWidth?.5:0)+(h.borderMiddleWidth?.5:0)+(h.borderInnerWidth?.5:0)),u.maxRadius}function ct(u,h){function f(Q,de,we,ke,Ue,Te){return de&&(!Te&&h.borderShadowWidth&&(we.save(),we.shadowBlur=h.borderShadowWidth,we.shadowColor=h.colorBorderShadow),et(Q,de*w,we,ke,Ue),!Te&&h.borderShadowWidth&&(Te=!0,we.restore())),Te}var w=ai.pixelRatio,T=h.borderShadowWidth*w,D=u.max-T-h.borderOuterWidth*w/2,O=D-h.borderOuterWidth*w/2-h.borderMiddleWidth*w/2+.5,z=O-h.borderMiddleWidth*w/2-h.borderInnerWidth*w/2+.5,N=me(u,h),F=void 0,K=!1;u.save(),K=f(D,h.borderOuterWidth,u,h.colorBorderOuter,h.colorBorderOuterEnd,K),K=f(O,h.borderMiddleWidth,u,h.colorBorderMiddle,h.colorBorderMiddleEnd,K),K=f(z,h.borderInnerWidth,u,h.colorBorderInner,h.colorBorderInnerEnd,K),!K&&h.borderShadowWidth&&(u.shadowBlur=h.borderShadowWidth,u.shadowColor=h.colorBorderShadow),u.beginPath(),u.arc(0,0,Qt(N),0,2*Cn,!0),h.colorPlateEnd?(F=u.createRadialGradient(0,0,N/2,0,0,N),F.addColorStop(0,h.colorPlate),F.addColorStop(1,h.colorPlateEnd)):F=h.colorPlate,u.fillStyle=F,u.fill(),u.closePath(),u.restore()}function st(u,h){if(h.highlights!=="false"&&h.highlights.length&&h.highlightsWidth!==0){var f=u.max*(parseFloat(h.highlightsWidth)||0)/100,w=Qt(bt(u,h)-f/2),T=h.highlights.length,D=(h.maxValue-h.minValue)/h.ticksAngle;u.save();for(var O=0;O<T;O++){var z=h.highlights[O];u.lineWidth=f,u.lineCap=h.highlightsLineCap,u.strokeStyle=z.color,u.beginPath(),u.rotate($n),u.arc(0,0,w,le.radians(h.startAngle+(z.from-h.minValue)/D),le.radians(h.startAngle+(z.to-h.minValue)/D),!1),u.stroke(),u.closePath(),u.restore(),u.save()}u.restore()}}function Vt(u,h){var f=bt(u,h),w=void 0,T=void 0,D=void 0,O=0,z=Math.abs(h.minorTicks)||0,N=h.ticksAngle/(h.maxValue-h.minValue);h.exactTicks?(T=h.maxValue-h.minValue,w=z?T/z:0,O=(Zt.mod(h.majorTicks[0],z)||0)*N):w=z*(h.majorTicks.length-1),u.lineWidth=ai.pixelRatio,u.strokeStyle=h.colorMinorTicks||h.colorStrokeTicks,u.save();for(var F=0;F<w;++F)(D=h.startAngle+O+F*(h.ticksAngle/w))<=h.ticksAngle+h.startAngle&&(u.rotate(le.radians(D)),u.beginPath(),u.moveTo(0,f),u.lineTo(0,f-.075*u.max),Oi(u));u.restore()}function bt(u,h){var f=u.max/100;return me(u,h)-5*f-(h.barWidth?2*(parseFloat(h.barStrokeWidth)||0)+((parseFloat(h.barWidth)||0)+5)*f:0)}function pt(u,h){le.prepareTicks(h);var f=Qt(bt(u,h)),w=void 0,T=h.majorTicks.length,D=ai.pixelRatio;u.lineWidth=2*D,w=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(T).fill(h.colorStrokeTicks||h.colorMajorTicks);for(var O=0;O<T;++O)u.save(),u.strokeStyle=w[O],u.rotate(le.radians(_t(h,h.exactTicks?h.majorTicks[O]:O,T))),u.beginPath(),u.moveTo(0,f),u.lineTo(0,f-.15*u.max),u.stroke(),u.closePath(),u.restore();h.strokeTicks&&(u.save(),u.strokeStyle=h.colorStrokeTicks||w[0],u.rotate($n),u.beginPath(),u.arc(0,0,f,le.radians(h.startAngle),le.radians(h.startAngle+h.ticksAngle),!1),u.stroke(),u.closePath(),u.restore())}function _t(u,h,f){if(u.exactTicks){var w=u.ticksAngle/(u.maxValue-u.minValue);return u.startAngle+w*(h-u.minValue)}return u.startAngle+h*(u.ticksAngle/(f-1))}function Oi(u){u.stroke(),u.restore(),u.closePath(),u.save()}function te(u,h){var f=bt(u,h)-.15*u.max,w={},T=0,D=h.majorTicks.length,O=h.animationTarget!=="needle",z=h.colorNumbers instanceof Array?h.colorNumbers:new Array(D).fill(h.colorNumbers),N=O?-(h.value-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle:0;for(O&&(u.save(),u.rotate(-le.radians(N))),u.font=le.font(h,"Numbers",u.max/200),u.lineWidth=0,u.textAlign="center",u.textBaseline="middle";T<D;++T){var F=N+_t(h,h.exactTicks?h.majorTicks[T]:T,D),K=u.measureText(h.majorTicks[T]).width,Q=h.fontNumbersSize,de=Math.sqrt(K*K+Q*Q)/2,we=le.radialPoint(f-de-h.numbersMargin/100*u.max,le.radians(F));F===360&&(F=0),w[F]||(w[F]=!0,u.fillStyle=z[T],u.fillText(h.majorTicks[T],we.x,we.y))}O&&u.restore()}function pe(u,h){h.title&&(u.save(),u.font=le.font(h,"Title",u.max/200),u.fillStyle=h.colorTitle,u.textAlign="center",u.fillText(h.title,0,-u.max/4.25,.8*u.max),u.restore())}function _e(u,h){h.units&&(u.save(),u.font=le.font(h,"Units",u.max/200),u.fillStyle=h.colorUnits,u.textAlign="center",u.fillText(le.formatContext(h,h.units),0,u.max/3.25,.8*u.max),u.restore())}function He(u,h){if(h.needle){var f=h.animationTarget!=="needle",w=h.ticksAngle<360?le.normalizedValue(h).indented:h.value,T=f?h.startAngle:h.startAngle+(w-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle;h.barStartPosition==="right"&&(T=h.startAngle+h.ticksAngle-(w-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle);var D=me(u,h),O=Qt(D/100*h.needleCircleSize),z=Qt(D/100*h.needleCircleSize*.75),N=Qt(D/100*h.needleEnd),F=Qt(h.needleStart?D/100*h.needleStart:0),K=D/100*h.needleWidth,Q=D/100*h.needleWidth/2,de=ai.pixelRatio;u.save(),le.drawNeedleShadow(u,h),u.rotate(le.radians(T)),u.fillStyle=le.linearGradient(u,h.colorNeedle,h.colorNeedleEnd,N-F),h.needleType==="arrow"?(u.beginPath(),u.moveTo(-Q,-F),u.lineTo(-K,0),u.lineTo(-1*de,N),u.lineTo(de,N),u.lineTo(K,0),u.lineTo(Q,-F),u.closePath(),u.fill(),u.beginPath(),u.lineTo(-.5*de,N),u.lineTo(-1*de,N),u.lineTo(-K,0),u.lineTo(-Q,-F),u.lineTo(Q/2*de-2*de,-F),u.closePath(),u.fillStyle=h.colorNeedleShadowUp,u.fill()):(u.beginPath(),u.moveTo(-Q,N),u.lineTo(-Q,F),u.lineTo(Q,F),u.lineTo(Q,N),u.closePath(),u.fill()),u.restore(),h.needleCircleSize&&(u.save(),le.drawNeedleShadow(u,h),h.needleCircleOuter&&(u.beginPath(),u.arc(0,0,O,0,2*Cn,!0),u.fillStyle=le.linearGradient(u,h.colorNeedleCircleOuter,h.colorNeedleCircleOuterEnd,O),u.fill(),u.closePath()),h.needleCircleInner&&(u.beginPath(),u.arc(0,0,z,0,2*Cn,!0),u.fillStyle=le.linearGradient(u,h.colorNeedleCircleInner,h.colorNeedleCircleInnerEnd,z),u.fill(),u.closePath()),u.restore())}}function vt(u,h,f){le.drawValueBox(u,h,f,0,u.max-.33*u.max,u.max)}f