xsound 3.0.13 → 3.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +4 -1
  2. package/build/types/AudioModule/index.d.ts +8 -2
  3. package/build/types/AudioModule/index.d.ts.map +1 -1
  4. package/build/types/MediaModule/index.d.ts +8 -2
  5. package/build/types/MediaModule/index.d.ts.map +1 -1
  6. package/build/types/MixerModule/index.d.ts +8 -2
  7. package/build/types/MixerModule/index.d.ts.map +1 -1
  8. package/build/types/NoiseModule/index.d.ts +8 -2
  9. package/build/types/NoiseModule/index.d.ts.map +1 -1
  10. package/build/types/OneshotModule/index.d.ts +8 -2
  11. package/build/types/OneshotModule/index.d.ts.map +1 -1
  12. package/build/types/OscillatorModule/index.d.ts +8 -2
  13. package/build/types/OscillatorModule/index.d.ts.map +1 -1
  14. package/build/types/ProcessorModule/index.d.ts +8 -2
  15. package/build/types/ProcessorModule/index.d.ts.map +1 -1
  16. package/build/types/SoundModule/Effectors/BitCrusher.d.ts.map +1 -1
  17. package/build/types/SoundModule/Effectors/Fuzz.d.ts +51 -0
  18. package/build/types/SoundModule/Effectors/Fuzz.d.ts.map +1 -0
  19. package/build/types/SoundModule/Effectors/OverDrive.d.ts +49 -0
  20. package/build/types/SoundModule/Effectors/OverDrive.d.ts.map +1 -0
  21. package/build/types/SoundModule/Effectors/{Distortion.d.ts → Preamp.d.ts} +23 -24
  22. package/build/types/SoundModule/Effectors/Preamp.d.ts.map +1 -0
  23. package/build/types/SoundModule/index.d.ts +14 -5
  24. package/build/types/SoundModule/index.d.ts.map +1 -1
  25. package/build/types/StreamModule/index.d.ts +8 -2
  26. package/build/types/StreamModule/index.d.ts.map +1 -1
  27. package/build/types/main.d.ts +9 -3
  28. package/build/types/main.d.ts.map +1 -1
  29. package/build/xsound.js +1 -1
  30. package/build/xsound.js.LICENSE.txt +1 -1
  31. package/build/xsound.js.map +1 -1
  32. package/build/xsound.min.js +1 -1
  33. package/build/xsound.min.js.LICENSE.txt +1 -1
  34. package/build/xsound.min.js.map +1 -1
  35. package/package.json +14 -14
  36. package/build/types/SoundModule/Effectors/Distortion.d.ts.map +0 -1
package/build/xsound.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see xsound.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.xsound=e():t.xsound=e()}(self,(()=>(()=>{"use strict";var t={1114:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.buffer=null,n.currentTime=0,n.stopped=!0,n.source=e.createBufferSource(),n}return i(e,t),e.prototype.setup=function(t){var e=null!=t?t:{},r=e.decodeCallback,n=e.updateCallback,i=e.endedCallback,s=e.errorCallback;return r&&(this.decodeCallback=r),n&&(this.updateCallback=n),i&&(this.endedCallback=i),s&&(this.errorCallback=s),this.envelopegenerator.setGenerator(0),this.envelopegenerator.param({attack:0,decay:.01,sustain:1,release:.01}),this},e.prototype.ready=function(t){var e=this;if(t instanceof ArrayBuffer){this.buffer=null;this.context.decodeAudioData(t,(function(t){e.buffer=t,e.analyser.start("timeoverview",0,e.buffer),e.analyser.start("timeoverview",1,e.buffer),e.decodeCallback&&e.decodeCallback(e.buffer)}),this.errorCallback)}else t instanceof AudioBuffer&&(this.buffer=t);return this},e.prototype.start=function(t,e){var r=this;if(null===this.buffer||!this.stopped)return this;var n=this.context.currentTime,i=null!=t?t:0,s=null!=e?e:this.buffer.duration;this.currentTime=s>=0?i>=0&&i<=s?i:0:i>=0&&i<=this.buffer.duration?i:0;var o=this.source.playbackRate.value,a=this.source.detune.value,c=this.source.loop;this.source=this.context.createBufferSource(),this.source.buffer=this.buffer,this.source.playbackRate.value=o,this.source.detune.value=a,this.source.loop=c,this.source.loopStart=this.currentTime,this.source.loopEnd=s>=0?s:this.buffer.duration,this.envelopegenerator.ready(0,this.source,this.processor),this.connect(this.processor),s>=0?this.source.start(n,this.currentTime,s-i):this.source.start(n,this.currentTime,this.buffer.duration-this.currentTime),this.analyser.start("time"),this.analyser.start("fft"),this.stopped=!1,this.envelopegenerator.start(n),s>=0?this.envelopegenerator.stop(n+(s-i)/this.source.playbackRate.value,!0):this.envelopegenerator.stop(n+(this.buffer.duration-i)/this.source.playbackRate.value,!0),this.on(n);var u=this.processor.bufferSize,l=this.analyser.domain("timeoverview",0),h=this.analyser.domain("timeoverview",1);return this.processor.onaudioprocess=function(t){var e=t.inputBuffer.getChannelData(0),n=t.inputBuffer.getChannelData(1),i=t.outputBuffer.getChannelData(0),s=t.outputBuffer.getChannelData(1);if(null!==r.buffer)if(r.currentTime<Math.trunc(r.source.loopEnd)){i.set(e),s.set(n);for(var o=0;o<u;o++){var a=r.source.detune.value,c=r.source.playbackRate.value+a/1200;r.currentTime+=c/r.buffer.sampleRate,r.updateCallback&&r.updateCallback(r.source,r.currentTime)}l.update(r.currentTime),h.update(r.currentTime)}else r.source.loop?(r.stop(),"sprite"===l.param("mode")?r.start(r.source.loopStart,r.source.loopEnd):r.start(0,r.buffer.duration)):r.end();else r.end()},this},e.prototype.stop=function(){if(null===this.buffer||this.stopped)return this;var t=this.context.currentTime;return this.source.stop(t),this.off(t),this.analyser.stop("time"),this.analyser.stop("fft"),this.mixed||(this.processor.disconnect(0),this.processor.onaudioprocess=null),this.stopped=!0,this},e.prototype.param=function(t){var e,r,n,i,s,o,a,c,u,l;if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"playbackRate":return this.source.playbackRate.value;case"detune":return this.source.detune.value;case"loop":return this.source.loop;case"currentTime":return this.currentTime;case"duration":return null!==(r=null===(e=this.source.buffer)||void 0===e?void 0:e.duration)&&void 0!==r?r:0;case"sampleRate":return null!==(i=null===(n=this.source.buffer)||void 0===n?void 0:n.sampleRate)&&void 0!==i?i:this.context.sampleRate;case"numberOfChannels":return null!==(o=null===(s=this.source.buffer)||void 0===s?void 0:s.numberOfChannels)&&void 0!==o?o:0;default:return this}for(var h=0,p=Object.entries(t);h<p.length;h++){var f=p[h],d=f[0],v=f[1];switch(d){case"mastervolume":"number"==typeof v&&(this.mastervolume.gain.value=v);break;case"playbackRate":if("number"==typeof v&&v>0){this.source.playbackRate.value=v;var y=v+this.source.detune.value/1200,m=this.context.currentTime,b=this.currentTime,g=null!==(c=null===(a=this.source.buffer)||void 0===a?void 0:a.duration)&&void 0!==c?c:0;this.envelopegenerator.start(m),this.envelopegenerator.stop(m+(g-b)/y,!0)}break;case"detune":if("number"==typeof v){this.source.detune.value=v;y=this.source.playbackRate.value+v/1200,m=this.context.currentTime,b=this.currentTime,g=null!==(l=null===(u=this.source.buffer)||void 0===u?void 0:u.duration)&&void 0!==l?l:0;this.envelopegenerator.start(m),this.envelopegenerator.stop(m+(g-b)/y,!0)}break;case"loop":"boolean"==typeof v&&(this.source.loop=v);break;case"currentTime":"number"==typeof v&&(this.currentTime=v,this.stopped||(this.stop(),this.start(v)))}}return this},e.prototype.get=function(){return this.source},e.prototype.end=function(){return this.stop(),this.currentTime=0,this.endedCallback&&this.endedCallback(this.source,0),this},e.prototype.has=function(){return null!==this.buffer},e.prototype.paused=function(){return this.stopped},e.prototype.fadeIn=function(t){var e,r;if("number"!=typeof t)return this.envelopegenerator.param("attack");this.envelopegenerator.param({attack:t});var n=this.context.currentTime,i=this.currentTime,s=null!==(r=null===(e=this.source.buffer)||void 0===e?void 0:e.duration)&&void 0!==r?r:0,o=this.source.detune.value,a=this.source.playbackRate.value+o/1200;return this.envelopegenerator.start(n),this.envelopegenerator.stop(n+(s-i)/a,!0),this},e.prototype.fadeOut=function(t){var e,r;if("number"!=typeof t)return this.envelopegenerator.param("release");this.envelopegenerator.param({release:t});var n=this.context.currentTime,i=this.currentTime,s=null!==(r=null===(e=this.source.buffer)||void 0===e?void 0:e.duration)&&void 0!==r?r:0,o=this.source.detune.value,a=this.source.playbackRate.value+o/1200;return this.envelopegenerator.start(n),this.envelopegenerator.stop(n+(s-i)/a,!0),this},e.prototype.slice=function(t,e){if(null===this.buffer)return null;var r=this.buffer.duration,n=this.buffer.sampleRate,i=this.buffer.numberOfChannels,s=Math.trunc((null!=t?t:0)*n),o=Math.trunc((null!=e?e:r)*n),a=i>0?this.buffer.getChannelData(0):null,c=i>1?this.buffer.getChannelData(1):null,u=o-s;switch(i){case 1:if(null===a)return null;for(var l=new Float32Array(u),h=s;h<o;h++)l[h-s]=a[h];return(f=this.context.createBuffer(1,u,n)).copyToChannel(l,0),f;case 2:if(null===a||null===c)return null;l=new Float32Array(u);var p=new Float32Array(u);for(h=s;h<o;h++)l[h-s]=a[h],p[h-s]=c[h];var f;return(f=this.context.createBuffer(2,u,n)).copyToChannel(l,0),f.copyToChannel(p,1),f;default:return null}},e.prototype.sprite=function(t){var e=this;return null===this.buffer?null:Object.keys(t).reduce((function(r,n){var i=t[n],s=e.slice.apply(e,i);return null!==s&&(r[n]=s),r}),{})},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"distortion":return this.distortion;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e,r,n,i,o,a,c=t.prototype.params.call(this);return s(s({},c),{playbackRate:this.source.playbackRate.value,detune:this.source.detune.value,loop:this.source.loop,currentTime:this.currentTime,duration:null!==(r=null===(e=this.buffer)||void 0===e?void 0:e.duration)&&void 0!==r?r:0,sampleRate:null!==(i=null===(n=this.buffer)||void 0===n?void 0:n.sampleRate)&&void 0!==i?i:this.context.sampleRate,numberOfChannels:null!==(a=null===(o=this.buffer)||void 0===o?void 0:o.numberOfChannels)&&void 0!==a?a:0,vocalcanceler:this.vocalcanceler.params()})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(r(2188).SoundModule);e.AudioModule=o},9206:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MIDI=void 0;var r=function(){function t(){this.midiAccess=null,this.inputs=[],this.outputs=[]}return t.prototype.setup=function(t){var e=this;if(!navigator.requestMIDIAccess)return Promise.reject();var r=t.options,n=t.successCallback,i=t.errorCallback;return navigator.requestMIDIAccess(r).then((function(t){e.midiAccess=t,t.inputs.forEach((function(t){e.inputs.push(t)})),t.outputs.forEach((function(t){e.outputs.push(t)})),n&&n(e.midiAccess,e.inputs,e.outputs)})).catch((function(t){i&&i(t)}))},t.prototype.get=function(){return this.midiAccess},t}();e.MIDI=r},5822:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Part=void 0;var n=r(6667),i=r(5146),s=r(4903),o=r(9171),a=r(9646),c=r(1358),u=function(){function t(t){this.sequences=[],this.previous=null,this.timerId=null,this.currentIndex=0,this.currentPosition=0,this.offset=0;var e=t.source,r=t.mml,n=t.offset,i=t.startCallback,s=t.stopCallback,u=t.endedCallback,l=t.errorCallback;this.source=e,this.mml=r,this.offset=null!=n?n:0,i&&(this.startCallback=i),s&&(this.stopCallback=s),u&&(this.endedCallback=u),l&&(this.errorCallback=l);var h=new o.Tokenizer(r),p=new a.TreeConstructor(h),f=new c.Sequencer(p,this.errorCallback),d=f.get();d&&(this.sequences=d),this.syntaxTree=f.getSyntaxTree()}return t.prototype.start=function(t){var e=this;if(!this.sequences[this.currentIndex])return this.stop(),void(this.endedCallback&&this.endedCallback());var r=this.sequences[this.currentIndex++];if(t){var o=this.mml.slice(0,this.currentPosition),a=this.mml.slice(this.currentPosition).replace(r.note,'<span class="x-highlight">'.concat(r.note,"</span>"));this.mml="".concat(o).concat(a),this.currentPosition+=this.mml.slice(this.currentPosition).indexOf("</span>")+"</span>".length}else{o=this.mml.slice(0,this.currentPosition),a=r.note;this.mml="".concat(o).concat(a),this.currentPosition+=a.length}if(this.source instanceof n.OscillatorModule)this.source.ready(0,r.duration).start(r.frequencies),this.startCallback&&this.startCallback(r);else if(this.source instanceof i.OneshotModule){var c=r.indexes.filter((function(t){return-1!==t})).map((function(t){return t+e.offset}));this.source.ready(0,r.duration).start(c),this.startCallback&&this.startCallback(r,this.offset)}else this.source instanceof s.NoiseModule&&(this.source.start(),this.startCallback&&this.startCallback(r));this.timerId=window.setTimeout((function(){e.source instanceof n.OscillatorModule?e.stopCallback&&e.stopCallback(r):e.source instanceof i.OneshotModule?e.stopCallback&&e.stopCallback(r,e.offset):e.source instanceof s.NoiseModule&&(e.source.stop(),e.stopCallback&&e.stopCallback(r)),e.previous=r,e.start(t)}),1e3*r.duration)},t.prototype.stop=function(){var t=this;if(null!==this.previous){if(this.source instanceof n.OscillatorModule)this.source.stop(),this.stopCallback&&this.stopCallback(this.previous);else if(this.source instanceof i.OneshotModule){var e=this.previous.indexes.filter((function(t){return-1!==t})).map((function(e){return e+t.offset}));this.source.stop(e),this.stopCallback&&this.stopCallback(this.previous,this.offset)}else this.source instanceof s.NoiseModule&&(this.source.stop(),this.stopCallback&&this.stopCallback(this.previous));this.timerId&&window.clearTimeout(this.timerId),this.timerId=null}},t.prototype.getMML=function(){return this.mml},t.prototype.getSequences=function(){return this.sequences},t.prototype.getSyntaxTree=function(){return this.syntaxTree},t.prototype.has=function(){return this.sequences.length>0},t.prototype.paused=function(){return null===this.timerId},t.prototype.getCurrentIndex=function(){return this.currentIndex},t.prototype.setCurrentIndex=function(t){t>=0&&t<this.sequences.length&&(this.currentIndex=t)},t}();e.Part=u},6478:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Sequence=void 0;var r=function(){function t(t){var e=t.id,r=t.note,n=t.indexes,i=t.frequencies,s=t.start,o=t.stop,a=t.duration;this._id=e,this._note=r,this._indexes=n,this._frequencies=i,this._start=s,this._stop=o,this._duration=a}return t.prototype.concat=function(e){return new t({id:this._id,note:"".concat(this._note,"&").concat(e.note),indexes:this._indexes,frequencies:this._frequencies,start:this._start,duration:this._duration+e.duration,stop:this._start+(this._duration+e.duration)})},Object.defineProperty(t.prototype,"note",{get:function(){return this._note},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"indexes",{get:function(){return this._indexes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frequencies",{get:function(){return this._frequencies},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stop",{get:function(){return this._stop},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return JSON.stringify({id:this._id,note:this._note,indexes:this._indexes,frequencies:this._frequencies,start:this._start,stop:this._stop,duration:this._duration})},t}();e.Sequence=r},1358:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Sequencer=void 0;var n=r(999),i=r(6806),s=r(2811),o=r(9646),a=r(6478),c=function(){function t(t,e){this.sequences=[],this.syntaxTree="",this.timeOf4note=0,this.octave=-1,this.currentTime=0,this.treeConstructor=t,this.errorCallback=e||function(t){throw t}}return t.prototype.get=function(){var t,e;o.TreeConstructor.id=0;var r=this.treeConstructor.parse();if(r){if(!(r instanceof s.MMLSyntaxError)){this.timeOf4note=0,this.octave=-1,this.currentTime=0;for(var n=r[0];null!==n;){if(!n)return void this.errorCallback(new s.MMLSyntaxError(new i.Token((this.sequences.length+1).toString(10),"UNKNOWN","")));if(n instanceof s.MMLSyntaxError)return void this.errorCallback(n);var a=n.operator,c=a.type,u=n.left,l=null!==u?u.operator.value:-1;switch(c){case"TEMPO":if(l<=0)return void this.errorCallback(new s.MMLSyntaxError(a));this.timeOf4note=60/l,n=n.right;break;case"OCTAVE":if(l<0)return void this.errorCallback(new s.MMLSyntaxError(a));this.octave=l,n=n.right;break;case"NOTE":case"REST":case"TIE":var h=this.push("TIE"===c?n.right:n);if(h instanceof s.MMLSyntaxError)return void this.errorCallback(h);"TIE"===c?(this.concat(),n=null!==(e=null===(t=n.right)||void 0===t?void 0:t.right)&&void 0!==e?e:null):n=n.right;break;case"EOS":n=n.right;break;default:return void this.errorCallback(new s.MMLSyntaxError(n.operator))}}return this.syntaxTree=r[0].toString(),this.treeConstructor.free(),this.sequences}this.errorCallback(r)}else this.errorCallback(new s.MMLSyntaxError(new i.Token("1","UNKNOWN","")))},t.prototype.getSyntaxTree=function(){return this.syntaxTree},t.prototype.push=function(t){if(null!==t){var e=t.left,r=t.right;if(null!==e&&null!==r){var i=e.operator,o=r.operator;if(null===i&&null===o)return this.push(e),void this.push(r);var c=t.operator.token,u=i.value,l=i.token,h=[],p=[];if(c){for(var f=0,d=c.length;f<d;f++){var v=c.charAt(f);if((0,n.isPitchChar)(v)){var y=(0,n.computeIndex)(this.octave,v);switch(c.charAt(f+1)){case n.HALF_UP:case n.SHARP:y++,f++;break;case n.HALF_DOWN:y--,f++}if(y>=h[0]&&(y-=n.EQUAL_TEMPERAMENT),-1!==y&&y<0)return;h.push(y)}}for(var m=0,b=h;m<b.length;m++){y=b[m];var g=(0,n.computeFrequency)(y);if(g<0)return;p.push(g)}var w=0;switch(u){case 1:case 2:case 4:case 8:case 16:case 32:case 64:case 128:case 256:if(l){var T=n.QUARTER_NOTE/u;l.includes(n.DOT)?w+=T*this.timeOf4note*1.5:w+=T*this.timeOf4note}break;case 6:w+=2*this.timeOf4note/3;break;case 12:w+=this.timeOf4note/3;break;case 18:w+=2*this.timeOf4note/9;break;case 24:w+=.5*this.timeOf4note/3;break;case 36:w+=this.timeOf4note/9;break;case 48:w+=.25*this.timeOf4note/3;break;case 72:w+=.5*this.timeOf4note/9;break;case 96:w+=.125*this.timeOf4note/3;break;case 144:w+=.25*this.timeOf4note/9;break;case 192:w+=.0625*this.timeOf4note/3;break;default:return void this.errorCallback(new s.MMLSyntaxError(i))}var k=(this.sequences.length+1).toString(10),A="".concat(c).concat(l),_=this.currentTime,O=_+w;this.sequences.push(new a.Sequence({id:k,note:A,indexes:h,frequencies:p,start:_,stop:O,duration:w})),this.currentTime+=w}}}},t.prototype.concat=function(){var t=this.sequences.pop(),e=this.sequences.pop();e&&t&&this.sequences.push(e.concat(t))},t}();e.Sequencer=c},6806:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Token=e.TokenMap=void 0,e.TokenMap=new Map([["T","TEMPO"],["O","OCTAVE"],["C","NOTE"],["D","NOTE"],["E","NOTE"],["F","NOTE"],["G","NOTE"],["A","NOTE"],["B","NOTE"],["+","NOTE"],["-","NOTE"],["#","NOTE"],["R","REST"],["0","NUMBER"],["1","NUMBER"],["2","NUMBER"],["3","NUMBER"],["4","NUMBER"],["5","NUMBER"],["6","NUMBER"],["7","NUMBER"],["8","NUMBER"],["9","NUMBER"],[".","NUMBER"],["&","TIE"],[" ","SPACE"],[void 0,"EOS"]]);var r=function(){function t(t,e,r){this._id=t,this._type=e,this._token=r,this._value=r?Number(r):-1}return Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return Number.isNaN(this._value)?-1:this._value},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return JSON.stringify({id:this._id,type:this._type,token:this._token,value:this._value})},t}();e.Token=r},9171:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Tokenizer=void 0;var n=r(6806),i=function(){function t(t){this.tokens=[],this.notes=[],this.numbers=[],this.tokens=t.trim().toUpperCase().split("").reverse()}return t.prototype.get=function(){var e=this.tokens.pop(),r=n.TokenMap.get(e);if(t.id++,!r)return new n.Token(t.id.toString(10),"UNKNOWN",e);for(;"SPACE"===r;)if(e=this.tokens.pop(),!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e);if("EOS"===r)return new n.Token(t.id.toString(10),"EOS",e);switch(this.notes.length=0,this.numbers.length=0,r){case"TEMPO":if(e)return new n.Token(t.id.toString(10),"TEMPO",e);break;case"OCTAVE":if(e)return new n.Token(t.id.toString(10),"OCTAVE",e);break;case"NOTE":if(e){if(this.notes.push(e),!(e=this.tokens.pop()))return new n.Token(t.id.toString(10),"NOTE",this.notes.join(""));if(!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e);for(;"NOTE"===r;){if(this.notes.push(e),!(e=this.tokens.pop()))return new n.Token(t.id.toString(10),"NOTE",this.notes.join(""));if(!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e)}return this.tokens.push(e),new n.Token(t.id.toString(10),"NOTE",this.notes.join(""))}break;case"REST":if(e)return new n.Token(t.id.toString(10),"REST",e);break;case"NUMBER":if(e){if(this.numbers.push(e),!(e=this.tokens.pop()))return new n.Token(t.id.toString(10),"NUMBER",this.numbers.join(""));if(!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e);for(;"NUMBER"===r;){if(this.numbers.push(e),!(e=this.tokens.pop()))return new n.Token(t.id.toString(10),"NUMBER",this.numbers.join(""));if(!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e)}return this.tokens.push(e),new n.Token(t.id.toString(10),"NUMBER",this.numbers.join(""))}break;case"TIE":if(e)return new n.Token(t.id.toString(10),"TIE",e);break;default:if(e)return new n.Token(t.id.toString(10),"UNKNOWN",e)}return null},t.id=0,t}();e.Tokenizer=i},2811:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MMLSyntaxError=e.Tree=void 0;var r=function(){function t(t,e,r,n){this._id=t,this._operator=e,this._left=r,this._right=n}return t.prototype.concat=function(t){this._right=t},Object.defineProperty(t.prototype,"operator",{get:function(){return this._operator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this._left},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._right},enumerable:!1,configurable:!0}),t.prototype.clear=function(){t.indent=0},t.prototype.toString=function(){for(var e,r,n="",i=0;i<t.indent;i++)n+=" ";return t.indent++,"\n".concat(n," ").concat("".concat(this._operator.token," (id = ").concat(this._id,")"),"\n").concat(n," /\\\n").concat(n).concat(null!==(r=null===(e=this._left)||void 0===e?void 0:e.operator.token)&&void 0!==r?r:"").concat(null!==this._right&&void 0!==this._right._operator.token?this.toString.call(this._right):"EOS","\n")},t.indent=0,t}();e.Tree=r;var n=function(){function t(t){this._token=t}return Object.defineProperty(t.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),t}();e.MMLSyntaxError=n},9646:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeConstructor=void 0;var n=r(9171),i=r(2811),s=function(){function t(t){this.syntaxTree=[],this.tokenizer=t}return t.prototype.parse=function(){n.Tokenizer.id=0;for(var e=this.tokenizer.get(),r=this.tokenizer.get();;){if(!e||!r)return this.syntaxTree;switch(t.id+=2,e.type){case"TEMPO":if("NUMBER"===r.type){var s=new i.Tree((t.id-0).toString(10),r,null,null),o=new i.Tree((t.id-1).toString(10),e,s,null);this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"OCTAVE":if(this.syntaxTree.length>0&&"NUMBER"===r.type){s=new i.Tree((t.id-0).toString(10),r,null,null),o=new i.Tree((t.id-1).toString(10),e,s,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"NOTE":if(this.syntaxTree.length>0&&"NUMBER"===r.type){s=new i.Tree((t.id-0).toString(10),r,null,null),o=new i.Tree((t.id-1).toString(10),e,s,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"REST":if(this.syntaxTree.length>0&&"NUMBER"===r.type){s=new i.Tree((t.id-0).toString(10),r,null,null),o=new i.Tree((t.id-1).toString(10),e,s,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"NUMBER":t.id-=2;break;case"TIE":if(this.syntaxTree.length>0){t.id--;o=new i.Tree((t.id-0).toString(10),e,null,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"EOS":if(this.syntaxTree.length>0){o=new i.Tree((t.id-1).toString(10),e,null,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o)}else{o=new i.Tree((t.id-1).toString(10),e,null,null);this.syntaxTree.push(o)}return this.syntaxTree;default:return new i.MMLSyntaxError(e)}e=r,r=this.tokenizer.get()}},t.prototype.free=function(){this.syntaxTree.length=0},t.id=0,t}();e.TreeConstructor=s},7087:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MML=void 0;r(6806),r(2811),r(6478);var n=r(5822),i=function(){function t(){this.parts=[]}return t.prototype.setup=function(t){return(null==t?void 0:t.startCallback)&&(this.startCallback=t.startCallback),(null==t?void 0:t.stopCallback)&&(this.stopCallback=t.stopCallback),(null==t?void 0:t.endedCallback)&&(this.endedCallback=t.endedCallback),(null==t?void 0:t.errorCallback)&&(this.errorCallback=t.errorCallback),this},t.prototype.ready=function(t){var e=t.source,r=t.mmls,i=t.offset;this.stop(),this.clear();for(var s=this.startCallback,o=this.stopCallback,a=this.endedCallback,c=this.errorCallback,u=0,l=r;u<l.length;u++){var h=l[u];this.parts.push(new n.Part({source:e,mml:h,offset:i,startCallback:s,stopCallback:o,endedCallback:a,errorCallback:c}))}return this},t.prototype.start=function(t,e){t>=0&&t<this.parts.length&&this.parts[t].start(null!=e&&e);return this},t.prototype.stop=function(){for(var t=0,e=this.parts;t<e.length;t++){e[t].stop()}return this},t.prototype.getMML=function(t){return t>=0&&t<this.parts.length?this.parts[t].getMML():""},t.prototype.getMMLs=function(){return this.parts.map((function(t){return t.getMML()}))},t.prototype.has=function(){return this.parts.length>0&&this.parts.every((function(t){return t.has()}))},t.prototype.getSequences=function(t){return t>=0&&t<this.parts.length?this.parts[t].getSequences():[]},t.prototype.getAllSequences=function(){return this.parts.map((function(t){return t.getSequences()}))},t.prototype.getSyntaxTree=function(t){return t>=0&&t<this.parts.length?this.parts[t].getSyntaxTree():""},t.prototype.paused=function(){return 0===this.parts.length||this.parts.every((function(t){return t.paused()}))},t.prototype.currentIndex=function(t,e){return t<0||t>=this.parts.length?this:e?(this.parts[t].setCurrentIndex(e),this):this.parts[t].getCurrentIndex()},t.prototype.clear=function(){for(var t=0,e=this.parts;t<e.length;t++){e[t].stop()}return this.parts.length=0,this},t.prototype.toABC=function(t,e,r,n,i,s){var o,a="";a+="X:".concat(e||1,"\n"),a+="T:".concat(r||"","\n"),a+="M:".concat(n||"4/4","\n"),a+="L:".concat(i||"1/256","\n"),a+="K:".concat(s||"","\n");var c=t.match(/\s*(?:T\d+)\s*|\s*(?:O\d+)\s*|\s*(?:(?:[CDEFGABR][#+-]?)+(?:256|192|144|128|96|72|64|48|36|32|24|18|16|12|8|6|4|2|1)\.?)(?:&(?:[CDEFGABR][#+-]?)+(?:256|192|144|128|96|72|64|48|36|32|24|18|16|12|8|6|4|2|1)\.?)*\s*/gi);if(null===c)return a;for(var u=null,l=0;c.length>0;){var h=null===(o=c.shift())||void 0===o?void 0:o.trim();if(!h)return a;if(/T\d+/i.test(h)){var p=Number(h.slice(1));if(p<=0)return a;a+="Q:1/4=".concat(p,"\n")}else if(/O\d+/i.test(h)){if((u=Number(h.slice(1)))<0)return a}else if(/(?:(?:[CDEFGABR][#+-]?)+)(?:256|192|144|128|96|72|64|48|36|32|24|18|16|12|8|6|4|2|1)(?:&(?:[CDEFGABR][#+-]?)+(?:256|192|144|128|96|72|64|48|36|32|24|18|16|12|8|6|4|2|1)\.?)*/i.test(h)){if(null===u)return a;var f=null;f=h.includes("&")?h.split("&"):[h];for(var d="";f.length>0;){var v=f.shift();if(!v)return a;var y="",m=0;switch(Number(v.replace(/^.+?(\d+)\.*$/,"$1"))){case 1:y=v.replace("1","256");break;case 2:y=v.replace("2","128");break;case 4:y=v.replace("4","64");break;case 8:y=v.replace("8","32");break;case 16:y=v.replace("16","16");break;case 32:y=v.replace("32","8");break;case 64:y=v.replace("64","4");break;case 128:y=v.replace("128","2");break;case 256:y=v.replace("256","1");break;case 6:y="(3".concat(v.replace("6","128")),m=128/3;break;case 12:y="(3".concat(v.replace("12","64")),m=64/3;break;case 18:y="(9".concat(v.replace("18","128")),m=128/9;break;case 24:y="(3".concat(v.replace("24","32")),m=32/3;break;case 36:y="(9".concat(v.replace("36","64")),m=64/9;break;case 48:y="(3".concat(v.replace("48","16")),m=16/3;break;case 72:y="(9".concat(v.replace("72","32")),m=32/9;break;case 96:y="(3".concat(v.replace("96","8")),m=8/3;break;case 144:y="(9".concat(v.replace("144","16")),m=16/9;break;case 192:y="(3".concat(v.replace("192","4")),m=4/3;break;default:return a}if(y.includes(".")&&(y=y.replace(/^(.+?)\d+\.+$/,"$1".concat(1.5*Number(y.replace(/^.+?(\d+)\.+$/,"$1"))))),y.includes("(")?l+=Number(y.replace(/^.+?(\d+)\.*$/i,"$1")):l+=m,l>=256&&(y+=" | ",l=0),/R/i.test(y))a+="".concat(y," ");else{var b="";switch(u){case 0:b=",,,,";break;case 1:b=",,,";break;case 2:b=",,";break;case 3:b=",";break;case 5:b="'";break;case 6:b="''";break;case 7:b="'''"}var g=y.match(/^(\(\d+)?((?:[CDEFGAB][#+-]?)+)(.*)$/i);if(null===g)return a;var w=g[1]?g[1]:"",T=g[2].length,k=g[3]?g[3]:"",A=0;if(w.length>0&&(y=y.replace(/^(?:\(\d+)?((?:[CDEFGAB][#+-]?)+)(.*)$/i,"$1$2")),1===T)d+="".concat(w).concat(y.slice(0,1)).concat(b).concat(k);else if(2===T&&/[#+-]/.test(y.charAt(1)))d+="".concat(w).concat(y.slice(1,2)).concat(y.slice(0,1)).concat(b).concat(k);else for(;A<T;)0===A&&(d+="".concat(w,"[")),/[#+-]/.test(y.charAt(A+1))?(d+="".concat(y.slice(A+1,A+2)).concat(y.slice(A,A+1)).concat(b),A+=2):(d+="".concat(y.slice(A,A+1)).concat(b),A++),A===T&&(d+="]".concat(k));f.length>0?d+="&":a+="".concat(d," ")}}}}return a.replace(/R/gi,"z").replace(/[#+]/g,"^").replace(/-/g,"_").replace(/&/g,"-").replace(/\s{2}/g," ").trim()},t}();e.MML=i},7878:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.MediaModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.source=null,n.media=null,n.ext="",n.autoplay=!1,n.mediaSource=null,n.sourceBuffer=null,n.file="",n.mimeType="",n.listeners={},n.onSourceOpen=n.onSourceOpen.bind(n),n.onSourceEnded=n.onSourceEnded.bind(n),n.onSourceClose=n.onSourceClose.bind(n),n.onSourceBufferUpdateEnd=n.onSourceBufferUpdateEnd.bind(n),n.onSourceBufferError=n.onSourceBufferError.bind(n),n}return i(e,t),e.prototype.setup=function(t){var e=this;this.envelopegenerator.setGenerator(0),this.envelopegenerator.param({attack:0,decay:.01,sustain:1,release:.01});var r=t.media,n=t.formats,i=t.listeners,s=t.autoplay;if(!r)return this;this.media=r;for(var o=0,a=null!=n?n:[];o<a.length;o++){var c=a[o],u="audio/".concat(c),l="video/".concat(c),h=this.media.canPlayType(u),p=this.media.canPlayType(l);if(/^(?:maybe|probably)/.test(h)||/^(?:maybe|probably)/.test(p)){this.ext=c;break}}return i&&(this.listeners=i,Object.keys(i).forEach((function(t){var r=i[t];"function"==typeof r&&(i[t]=r),e.media&&e.media.addEventListener(t,r,!1)}))),this.media.addEventListener("loadstart",(function(){null!==e.media&&null===e.source&&(e.source=e.context.createMediaElementSource(e.media))}),!1),this.media.addEventListener("ended",(function(){null!==e.media&&(e.media.pause(),e.off(e.context.currentTime),e.analyser.stop("time"),e.analyser.stop("fft"),e.processor.disconnect(0),e.processor.onaudioprocess=null)}),!1),this.autoplay=null!=s&&s,this.autoplay&&null===this.source&&(this.source=this.context.createMediaElementSource(this.media)),this.autoplay&&this.media.src&&this.context.resume().then((function(){var t,r;e.start(null!==(r=null===(t=e.media)||void 0===t?void 0:t.currentTime)&&void 0!==r?r:0)})).catch((function(){throw new Error("Autoplay is failed")})),this},e.prototype.ready=function(t,e){if(null===this.media)return this;this.mediaSource&&"open"===this.mediaSource.readyState&&(this.mediaSource.endOfStream(),window.URL.revokeObjectURL(this.media.src),this.mediaSource.removeEventListener("sourceopen",this.onSourceOpen,!1),this.mediaSource.removeEventListener("sourceended",this.onSourceEnded,!1),this.mediaSource.removeEventListener("sourceclose",this.onSourceClose,!1),this.sourceBuffer&&(this.sourceBuffer.removeEventListener("updateend",this.onSourceBufferUpdateEnd,!1),this.sourceBuffer.removeEventListener("error",this.onSourceBufferError,!1)));try{if(e){if(!MediaSource||!MediaSource.isTypeSupported(e))throw new Error("This Browser does not support `MediaSource` or MIME type");this.media.removeAttribute("src"),this.media.load(),this.mediaSource=new MediaSource,this.media.src=window.URL.createObjectURL(this.mediaSource),this.mimeType=e,this.file=t,this.mediaSource.addEventListener("sourceopen",this.onSourceOpen,!1),this.mediaSource.addEventListener("sourceended",this.onSourceEnded,!1),this.mediaSource.addEventListener("sourceclose",this.onSourceClose,!1)}else t.startsWith("blob:")||""===this.ext?this.media.src=t:this.media.src="".concat(t,".").concat(this.ext)}catch(t){if(t instanceof Error)throw new Error(t.message)}return this},e.prototype.start=function(t,e){var r=this;return null===this.source||null===this.media||(this.envelopegenerator.ready(0,this.source,this.processor),this.connect(this.processor),this.media.play().then((function(){if(null!==r.media){var e=r.context.currentTime;r.media.currentTime=null!=t?t:0,r.envelopegenerator.start(e),Number.isFinite(r.media.duration)&&r.envelopegenerator.stop(e+(r.media.duration-r.media.currentTime)/r.media.playbackRate,!0),r.on(e),r.analyser.start("time"),r.analyser.start("fft"),r.processor.onaudioprocess=function(t){var e=t.inputBuffer.getChannelData(0),r=t.inputBuffer.getChannelData(1),n=t.outputBuffer.getChannelData(0),i=t.outputBuffer.getChannelData(1);n.set(e),i.set(r)}}})).catch((function(){r.stop((function(){null!==r.media&&(r.autoplay&&(r.media.muted=!0,r.media.volume=0),r.start(t))}),e)}))),this},e.prototype.stop=function(t,e){var r=this;return null===this.source||null===this.media||this.media.play().then((function(){null!==r.media&&(r.media.pause(),r.off(r.context.currentTime),r.analyser.stop("time"),r.analyser.stop("fft"),r.media||(r.processor.disconnect(0),r.processor.onaudioprocess=null),t&&t())})).catch((function(t){e&&e(t)})),this},e.prototype.param=function(t){var e,r,n,i,s,o,a,c,u,l,h,p,f;if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"autoplay":return this.autoplay;case"playbackRate":return null!==(r=null===(e=this.media)||void 0===e?void 0:e.playbackRate)&&void 0!==r?r:1;case"currentTime":return null!==(i=null===(n=this.media)||void 0===n?void 0:n.currentTime)&&void 0!==i?i:0;case"controls":return null!==(o=null===(s=this.media)||void 0===s?void 0:s.controls)&&void 0!==o&&o;case"loop":return null!==(c=null===(a=this.media)||void 0===a?void 0:a.loop)&&void 0!==c&&c;case"muted":return null!==(l=null===(u=this.media)||void 0===u?void 0:u.muted)&&void 0!==l&&l;case"duration":return Number.isNaN(null===(h=this.media)||void 0===h?void 0:h.duration)?0:null!==(f=null===(p=this.media)||void 0===p?void 0:p.duration)&&void 0!==f?f:0;default:return this}for(var d=0,v=Object.entries(t);d<v.length;d++){var y=v[d],m=y[0],b=y[1];switch(m){case"mastervolume":"number"==typeof b&&(this.mastervolume.gain.value=b);break;case"playbackRate":if(this.media&&"number"==typeof b&&b>0){this.media.playbackRate=b;var g=this.context.currentTime,w=this.media.currentTime,T=this.media.duration;this.envelopegenerator.start(g),Number.isFinite(T)&&this.envelopegenerator.stop(g+(T-w)/b,!0)}break;case"currentTime":if(this.media&&"number"==typeof b){this.media.currentTime=b;g=this.context.currentTime,T=this.media.duration;var k=this.media.playbackRate;this.envelopegenerator.start(g),Number.isFinite(T)&&this.envelopegenerator.stop(g+(T-b)/k,!0)}break;case"controls":this.media&&"boolean"==typeof b&&(this.media.controls=b);break;case"loop":this.media&&"boolean"==typeof b&&(this.media.loop=b);break;case"muted":this.media&&"boolean"==typeof b&&(this.media.muted=b)}}return this},e.prototype.get=function(){return this.source},e.prototype.hasMedia=function(){return null!==this.media},e.prototype.hasSource=function(){return null!==this.source},e.prototype.paused=function(){return null===this.media||this.media.paused},e.prototype.fadeIn=function(t){var e,r,n,i,s,o;if("number"!=typeof t)return this.envelopegenerator.param("attack");this.envelopegenerator.param({attack:t});var a=this.context.currentTime,c=null!==(r=null===(e=this.media)||void 0===e?void 0:e.currentTime)&&void 0!==r?r:0,u=null!==(i=null===(n=this.media)||void 0===n?void 0:n.duration)&&void 0!==i?i:0,l=null!==(o=null===(s=this.media)||void 0===s?void 0:s.playbackRate)&&void 0!==o?o:1;return this.envelopegenerator.start(a),this.envelopegenerator.stop(a+(u-c)/l,!0),this},e.prototype.fadeOut=function(t){var e,r,n,i,s,o;if("number"!=typeof t)return this.envelopegenerator.param("release");this.envelopegenerator.param({release:t});var a=this.context.currentTime,c=null!==(r=null===(e=this.media)||void 0===e?void 0:e.currentTime)&&void 0!==r?r:0,u=null!==(i=null===(n=this.media)||void 0===n?void 0:n.duration)&&void 0!==i?i:0,l=null!==(o=null===(s=this.media)||void 0===s?void 0:s.playbackRate)&&void 0!==o?o:1;return this.envelopegenerator.start(a),this.envelopegenerator.stop(a+(u-c)/l,!0),this},e.prototype.requestPictureInPicture=function(){return this.media instanceof HTMLVideoElement&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled?this.media.disablePictureInPicture||0===this.media.readyState||this.media===document.pictureInPictureElement?Promise.reject():this.media.requestPictureInPicture():Promise.reject()},e.prototype.exitPictureInPicture=function(){return this.media instanceof HTMLVideoElement&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled?this.media.disablePictureInPicture||0===this.media.readyState||this.media!==document.pictureInPictureElement?Promise.reject():document.exitPictureInPicture():Promise.reject()},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"distortion":return this.distortion;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e,r,n,i,o,a,c,u,l,h,p,f,d,v,y=t.prototype.params.call(this);return s(s({},y),{autoplay:this.autoplay,playbackRate:null!==(r=null===(e=this.media)||void 0===e?void 0:e.playbackRate)&&void 0!==r?r:1,controls:null!==(i=null===(n=this.media)||void 0===n?void 0:n.controls)&&void 0!==i&&i,loop:null!==(a=null===(o=this.media)||void 0===o?void 0:o.loop)&&void 0!==a&&a,muted:null!==(u=null===(c=this.media)||void 0===c?void 0:c.muted)&&void 0!==u&&u,currentTime:null!==(h=null===(l=this.media)||void 0===l?void 0:l.currentTime)&&void 0!==h?h:0,duration:Number.isNaN(null!==(f=null===(p=this.media)||void 0===p?void 0:p.duration)&&void 0!==f?f:0)?0:null!==(v=null===(d=this.media)||void 0===d?void 0:d.duration)&&void 0!==v?v:0,vocalcanceler:this.vocalcanceler.params()})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e.prototype.onSourceOpen=function(t){var e=this;if(null!==this.mediaSource){this.sourceBuffer=this.mediaSource.addSourceBuffer(this.mimeType),this.sourceBuffer.mode="sequence",this.sourceBuffer.addEventListener("updateend",this.onSourceBufferUpdateEnd,!1),this.sourceBuffer.addEventListener("error",this.onSourceBufferError,!1);var r=new Request(this.file);fetch(r).then((function(t){return t.arrayBuffer()})).then((function(t){e.sourceBuffer&&e.sourceBuffer.appendBuffer(t)})).catch((function(t){e.listeners.error&&e.listeners.error(t)})).finally((function(){e.listeners.sourceopen&&e.listeners.sourceopen(t)}))}},e.prototype.onSourceEnded=function(t){this.listeners.sourceended&&this.listeners.sourceended(t)},e.prototype.onSourceClose=function(t){this.listeners.sourceclose&&this.listeners.sourceclose(t)},e.prototype.onSourceBufferUpdateEnd=function(t){this.listeners.updateend&&this.listeners.updateend(t)},e.prototype.onSourceBufferError=function(t){this.listeners.error&&this.listeners.error(t)},e}(r(2188).SoundModule);e.MediaModule=o},6567:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.MixerModule=void 0;var s=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.sources=[],n.gainNodes=[],n}return i(e,t),e.prototype.setup=function(){return this},e.prototype.ready=function(){return this},e.prototype.start=function(t,e){this.sources=t;for(var r=0,n=this.sources.length;r<n;r++){var i=this.sources[r],s=this.context.currentTime;i.off(s),i.suspend(),i.mix(),i.INPUT&&(this.gainNodes[r]=this.context.createGain(),this.gainNodes[r].gain.value=e?e[r]:1,i.INPUT.connect(this.gainNodes[r]),this.gainNodes[r].connect(this.processor))}this.connect(this.processor);var o=this.context.currentTime;return this.on(o),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.processor.onaudioprocess=function(t){var e=t.inputBuffer.getChannelData(0),r=t.inputBuffer.getChannelData(1),n=t.outputBuffer.getChannelData(0),i=t.outputBuffer.getChannelData(1);n.set(e),i.set(r)},this},e.prototype.stop=function(){var t=this.context.currentTime;this.off(t),this.suspend();for(var e=0,r=this.sources;e<r.length;e++){var n=r[e];n.demix(),n.INPUT&&(n.INPUT.disconnect(0),n.connect(n.INPUT))}for(var i=0,s=this.gainNodes;i<s.length;i++){s[i].disconnect(0)}return this},e.prototype.param=function(t){if("string"==typeof t)return"mastervolume"===t?this.mastervolume.gain.value:this;for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];if("mastervolume"===i)"number"==typeof s&&(this.mastervolume.gain.value=s)}return this},e.prototype.get=function(){return this.sources},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"distortion":return this.distortion;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(r(2188).SoundModule);e.MixerModule=s},4903:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.NoiseModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.type="whitenoise",n.envelopegenerator.setGenerator(0),n}return i(e,t),e.prototype.setup=function(){return this},e.prototype.ready=function(){return this},e.prototype.start=function(){var t=this,e=this.context.currentTime;if(!this.mixed){this.envelopegenerator.clear(!0),this.processor.disconnect(0),this.processor.onaudioprocess=null;var r=this.envelopegenerator.getGenerator(0);r&&this.connect(r)}this.envelopegenerator.ready(0,this.processor,null),this.envelopegenerator.start(e),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.on(e);var n=this.processor.bufferSize,i=0,s=0,o=0,a=0,c=0,u=0,l=0,h=0;return this.processor.onaudioprocess=function(e){var r=e.outputBuffer.getChannelData(0),p=e.outputBuffer.getChannelData(1);if(t.envelopegenerator.paused())t.mixed||(t.processor.disconnect(0),t.processor.onaudioprocess=null),t.analyser.stop("time"),t.analyser.stop("fft"),t.runningAnalyser=!1;else switch(t.type){case"whitenoise":for(var f=0;f<n;f++)r[f]=2*(Math.random()-.5),p[f]=2*(Math.random()-.5);break;case"pinknoise":for(f=0;f<n;f++){var d=2*Math.random()-1;i=.99886*i+.0555179*d,s=.99332*s+.0750759*d,o=.969*o+.153852*d,a=.8665*a+.3104856*d,c=.55*c+.5329522*d,u=-.7616*u-.016898*d,r[f]=i+s+o+a+c+u+l+.5362*d,p[f]=i+s+o+a+c+u+l+.5362*d,r[f]*=.11,p[f]*=.11,l=.115926*d}break;case"browniannoise":for(f=0;f<n;f++){d=2*Math.random()-1;r[f]=(h+.02*d)/1.02,p[f]=(h+.02*d)/1.02,h=(h+.02*d)/1.02,r[f]*=3.5,p[f]*=3.5}}},this},e.prototype.stop=function(){var t=this.context.currentTime;return this.envelopegenerator.stop(t),this.off(t),this},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"type":return this.type;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"mastervolume":"number"==typeof s&&(this.mastervolume.gain.value=s);break;case"type":"string"==typeof s&&(this.type=s)}}return this},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"distortion":return this.distortion;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){t.prototype.suspend.call(this);var e=this.envelopegenerator.getGenerator(0);return e&&(e.disconnect(0),this.processor.connect(e)),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e=t.prototype.params.call(this);return s(s({},e),{type:this.type})},Object.defineProperty(e.prototype,"INPUT",{get:function(){var t=this.envelopegenerator.getGenerator(0);return t||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(r(2188).SoundModule);e.NoiseModule=o},5146:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.OneshotModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.sources=[],n.resources=[],n.buffers=[],n.volumes=[],n.states=[],n.settings=[],n.startTime=0,n.duration=0,n.transpose=0,n.paused=!0,n.loadError=!1,n}return i(e,t),e.prototype.setup=function(t){for(var e=t.resources,r=t.settings,n=t.timeout,i=t.successCallback,s=t.errorCallback,o=t.progressCallback,a=0,c=r.length;a<c;a++)this.states[a]=!1,this.volumes[a]=this.context.createGain(),this.settings[a]=r[a],this.envelopegenerator.setGenerator(a);var u=0;for(c=e.length;u<c;u++){this.resources[u]=e[u];var l=this.resources[u];"string"==typeof l?this.load({url:l,index:u,timeout:n,successCallback:i,errorCallback:s,progressCallback:o}):this.buffers[u]=l}return this},e.prototype.ready=function(t,e){return this.startTime=null!=t?t:this.context.currentTime,this.duration=null!=e?e:0,this.envelopegenerator.clear(!1),this},e.prototype.start=function(t){var e=this,r=this.context.currentTime+this.startTime;this.mixed||(this.envelopegenerator.clear(!1),this.connect(this.processor));for(var n=function(t){if(t<0||t>=i.settings.length)return"continue";var n=i.settings[t],s=n.bufferIndex,o=n.playbackRate,a=n.loop,c=n.loopStart,u=n.loopEnd,l=n.volume,h=i.context.createBufferSource();h.buffer=i.buffers[s],h.playbackRate.value=null!=o?o:1,h.detune.value=100*i.transpose,h.loop=null!=a&&a,h.loopStart=null!=c?c:0,h.loopEnd=null!=u?u:h.buffer.duration,i.volumes[t].gain.value=null!=l?l:1,i.envelopegenerator.ready(t,h,i.volumes[t]),i.volumes[t].connect(i.processor),h.loop?h.start(r,r+h.loopStart,h.loopEnd-r):h.start(r),i.sources[t]=h,i.states[t]=!0,h.onended=function(){e.states[t]=!1}},i=this,s=0,o=t;s<o.length;s++){n(o[s])}return this.envelopegenerator.start(r),this.on(r),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.processor.onaudioprocess=function(r){if(e.paused=!e.states.some((function(t){return t})),e.paused)e.stop(t),e.off(e.context.currentTime),e.envelopegenerator.clear(!1),e.analyser.stop("time"),e.analyser.stop("fft"),e.runningAnalyser=!1,e.mixed||(e.processor.disconnect(0),e.processor.onaudioprocess=null);else{var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1);s.set(n),o.set(i)}},this},e.prototype.stop=function(t){var e=this;if(t.every((function(t){return!(t<0||t>=e.settings.length)&&"number"==typeof e.settings[t].bufferIndex}))){var r=this.context.currentTime+this.startTime+this.duration;this.envelopegenerator.stop(r),this.filter.stop(r)}return this},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"transpose":return this.transpose;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"mastervolume":"number"==typeof s&&(this.mastervolume.gain.value=s);break;case"transpose":"number"==typeof s&&(this.transpose=s)}}return this},e.prototype.get=function(t){return"number"==typeof t&&t>=0&&t<this.buffers.length?this.buffers[t]:this.buffers},e.prototype.reset=function(t,e,r){if(t>=0&&t<this.settings.length)switch(e){case"bufferIndex":case"playbackRate":case"loopStart":case"loopEnd":case"volume":"number"==typeof r&&(this.settings[t][e]=r);break;case"loop":"boolean"==typeof r&&(this.settings[t][e]=r)}return this},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"distortion":return this.distortion;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e=t.prototype.params.call(this);return s(s({},e),{transpose:this.transpose})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e.prototype.load=function(t){var e=this,r=t.url,n=t.index,i=t.timeout,s=t.successCallback,o=t.errorCallback,a=t.progressCallback,c=new XMLHttpRequest;c.timeout=null!=i?i:6e4,c.ontimeout=function(t){!e.loadError&&o&&o(t,"timeout"),e.loadError=!0},c.onprogress=function(t){e.loadError?c.abort():a&&a(t)},c.onerror=function(t){!e.loadError&&o&&o(t,"error"),e.loadError=!0},c.onload=function(t){if(200===c.status){var r=c.response;if(!(r instanceof ArrayBuffer))return;e.context.decodeAudioData(r,(function(r){e.buffers[n]=r;for(var i=0,o=e.buffers;i<o.length;i++){if(void 0===o[i])return}s&&s(t,e.buffers)}),(function(t){o&&o(t,"decode")}))}},c.open("GET",r,!0),c.responseType="arraybuffer",c.send(null)},e}(r(2188).SoundModule);e.OneshotModule=o},9069:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Glide=void 0;var r=function(){function t(t){this.type="linear",this.time=0,this.prevFrequency=-1,this.nextFrequency=0,this.isActive=!0,this.context=t}return t.prototype.ready=function(t){this.nextFrequency=t;var e=-1===this.prevFrequency?0:this.nextFrequency-this.prevFrequency;this.isActive&&0!==this.time&&0!==e||(this.prevFrequency=this.nextFrequency)},t.prototype.start=function(t,e){var r=null!=e?e:this.context.currentTime,n=r+this.time;t.frequency.cancelScheduledValues(r),t.frequency.setValueAtTime(this.prevFrequency,r),"exponential"===this.type?t.frequency.exponentialRampToValueAtTime(this.nextFrequency,n):t.frequency.linearRampToValueAtTime(this.nextFrequency,n)},t.prototype.stop=function(){this.prevFrequency=this.nextFrequency},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"type":return this.type;case"time":return this.time;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"type":"string"==typeof s&&(this.type=s);break;case"time":"number"==typeof s&&(this.time=s)}}return this},t.prototype.params=function(){return{state:this.isActive,type:this.type,time:this.time}},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this},t.prototype.deactivate=function(){return this.isActive=!1,this},t}();e.Glide=r},9565:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Oscillator=void 0;var r=function(){function t(t,e){this.octave=0,this.fine=0,this.custom={real:new Float32Array([0,1]),imag:new Float32Array([0,1])},this.paused=!0,this.context=t,this.source=t.createOscillator(),this.volume=t.createGain(),this.isActive=e}return t.prototype.ready=function(t){if(this.isActive){var e=this.source.type,r=this.source.frequency.value,n=this.source.detune.value;if(this.paused||(this.source.stop(this.context.currentTime),this.source.disconnect(0)),this.source=this.context.createOscillator(),"custom"===e){var i=this.custom.real,s=this.custom.imag,o=this.context.createPeriodicWave(i,s);this.source.setPeriodicWave(o)}else this.source.type=e;this.source.frequency.value=r,this.source.detune.value=n,this.volume.connect(t)}},t.prototype.start=function(t){this.isActive?(this.source.start(null!=t?t:this.context.currentTime),this.paused=!1):(this.paused||(this.source.stop(this.context.currentTime),this.paused=!0),this.source.disconnect(0))},t.prototype.stop=function(t){this.paused||(this.source.stop(null!=t?t:this.context.currentTime),this.source.disconnect(0),this.paused=!0)},t.prototype.param=function(e){if("string"==typeof e)switch(e){case"state":return this.isActive;case"type":return this.source.type;case"octave":return this.octave;case"fine":return this.fine;case"volume":return this.volume.gain.value;default:return this}for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],s=i[0],o=i[1];switch(s){case"state":"boolean"==typeof o&&(this.isActive=o);break;case"type":if("string"==typeof o)this.source.type=o;else if("object"==typeof o){var a=o.real,c=o.imag,u=4096;a.length>u&&(a=a.subarray(0,u)),c.length>u&&(c=c.subarray(0,u)),0!==a[0]&&(a[0]=0),0!==c[0]&&(c[0]=0);var l=this.context.createPeriodicWave(a,c);this.source.setPeriodicWave(l),this.custom.real=a,this.custom.imag=c}break;case"octave":"number"==typeof o&&(this.octave=o,this.source.detune.value=this.fine+o*t.OCTAVE);break;case"fine":"number"==typeof o&&(this.fine=o,this.source.detune.value=o+this.octave*t.OCTAVE);break;case"volume":"number"==typeof o&&(this.volume.gain.value=o)}}return this},t.prototype.get=function(){return this.source},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this},t.prototype.deactivate=function(){return this.isActive=!1,this},t.prototype.params=function(){return{state:this.isActive,type:this.source.type,octave:this.octave,fine:this.fine,volume:this.volume.gain.value}},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.source},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.volume},enumerable:!1,configurable:!0}),t.OCTAVE=1200,t}();e.Oscillator=r},6667:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.OscillatorModule=void 0;var o=r(2188),a=r(9069),c=r(9565),u=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.sources=[],n.startTime=0,n.duration=0,n.glide=new a.Glide(e),n}return i(e,t),e.prototype.setup=function(t){this.sources.length=0;for(var e=0,r=t.length;e<r;e++)this.sources[e]=new c.Oscillator(this.context,t[e]),this.envelopegenerator.setGenerator(e);return this},e.prototype.ready=function(t,e){return this.startTime=null!=t?t:this.context.currentTime,this.duration=null!=e?e:0,this.envelopegenerator.clear(!0),this},e.prototype.start=function(t){var e=this,r=this.context.currentTime+this.startTime;this.mixed||(this.envelopegenerator.clear(!0),this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect(this.processor));for(var n=0,i=t.length;n<i&&!(n>=this.sources.length);n++){var s=this.sources[n],o=t[n];s.ready(this.processor),this.envelopegenerator.ready(n,s.INPUT,s.OUTPUT),this.glide.ready(o),this.glide.start(s.INPUT,r),s.start(r)}return this.envelopegenerator.start(r),this.on(r),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.processor.onaudioprocess=function(t){var r=t.inputBuffer.getChannelData(0),n=t.inputBuffer.getChannelData(1),i=t.outputBuffer.getChannelData(0),s=t.outputBuffer.getChannelData(1);if(e.envelopegenerator.paused()){for(var o=e.context.currentTime,a=0,c=e.sources;a<c.length;a++){c[a].stop(o)}e.off(o),e.analyser.stop("time"),e.analyser.stop("fft"),e.runningAnalyser=!1,e.mixed||(e.processor.disconnect(0),e.processor.onaudioprocess=null)}else i.set(r),s.set(n)},this},e.prototype.stop=function(){var t=this.context.currentTime+this.startTime+this.duration;return this.envelopegenerator.stop(t,!1),this.glide.stop(),this.filter.stop(t),this},e.prototype.param=function(t){if("string"==typeof t)return"mastervolume"===t?this.mastervolume.gain.value:this;for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];if("mastervolume"===i)"number"==typeof s&&(this.mastervolume.gain.value=s)}return this},e.prototype.get=function(t){return"number"==typeof t&&t>=0&&t<this.sources.length?this.sources[t]:this.sources},e.prototype.length=function(){return this.sources.length},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"distortion":return this.distortion;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;case"glide":return this.glide;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e=t.prototype.params.call(this);return s(s({},e),{oscillator:{glide:this.glide.params(),params:this.sources.map((function(t){return t.params()}))}})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(o.SoundModule);e.OscillatorModule=u},6954:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.ProcessorModule=void 0;var s=r(2188),o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.workletNode=null,n.processorName="",n.options={},n.moduleURL="",n.envelopegenerator.setGenerator(0),window.AudioWorkletNode||(n.workletNode=n.context.createScriptProcessor(r,s.SoundModule.NUMBER_OF_INPUTS,s.SoundModule.NUMBER_OF_OUTPUTS)),n}return i(e,t),e.prototype.setup=function(t,e){return this.processorName=t,this.options=null!=e?e:{},this},e.prototype.ready=function(t,e){var r=this;return window.AudioWorkletNode?(this.moduleURL=t,this.context.audioWorklet.addModule(this.moduleURL,null!=e?e:{credentials:"same-origin"}).then((function(){r.workletNode=new AudioWorkletNode(r.context,r.processorName,r.options)}))):Promise.reject()},e.prototype.start=function(t){var e=this.envelopegenerator.getGenerator(0);if(null===this.workletNode||null===e)return this;var r=this.context.currentTime;return this.mixed||(this.envelopegenerator.clear(!0),this.workletNode.disconnect(0),this.workletNode instanceof ScriptProcessorNode&&(this.workletNode.onaudioprocess=null),this.connect(e)),this.envelopegenerator.ready(0,this.workletNode,null),this.envelopegenerator.start(r),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.on(r),this.workletNode instanceof ScriptProcessorNode&&t&&(this.workletNode.onaudioprocess=t),this},e.prototype.stop=function(){if(null===this.workletNode)return this;var t=this.context.currentTime;return this.mixed||this.workletNode.disconnect(0),this.envelopegenerator.stop(t),this.off(t),this},e.prototype.postMessage=function(t){return null===this.workletNode||this.workletNode instanceof ScriptProcessorNode||this.workletNode.port.postMessage(t),this},e.prototype.onMessage=function(t){return null===this.workletNode||this.workletNode instanceof ScriptProcessorNode||(this.workletNode.port.onmessage=t),this},e.prototype.onMessageError=function(t){return null===this.workletNode||this.workletNode instanceof ScriptProcessorNode||(this.workletNode.port.onmessageerror=t),this},e.prototype.map=function(){return null===this.workletNode||this.workletNode instanceof ScriptProcessorNode?null:this.workletNode.parameters},e.prototype.get=function(){return this.workletNode},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"distortion":return this.distortion;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){t.prototype.suspend.call(this);var e=this.envelopegenerator.getGenerator(0);return this.workletNode&&e&&(e.disconnect(0),this.workletNode.connect(e)),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},Object.defineProperty(e.prototype,"INPUT",{get:function(){var t=this.envelopegenerator.getGenerator(0);return t||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(s.SoundModule);e.ProcessorModule=o},6354:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.FFT=void 0;var s=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.type="uint",n.size=256,n.textInterval=1e3,n}return i(e,t),e.prototype.setup=function(e){return t.prototype.setup.call(this,e),this},e.prototype.param=function(e){if("string"==typeof e)switch(e){case"type":return this.type;case"size":return this.size;case"textInterval":return this.textInterval;case"interval":case"styles":return t.prototype.param.call(this,e);default:return this}for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],s=i[0],o=i[1];switch(s){case"type":"string"==typeof o&&("uint"!==o&&"float"!==o||(this.type=o));break;case"size":"number"==typeof o&&(this.size=o);break;case"textInterval":"number"==typeof o&&(this.textInterval=o)}}return t.prototype.param.call(this,e),this},e.prototype.clear=function(){return t.prototype.clear.call(this),this},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.visualizeOnCanvas=function(t,e,r){var n,i,s,o,a,c,u,l,h,p,f,d;if(null!==this.canvas&&null!==this.context&&this.isActive){var v=null!=e?e:-100,y=null!=r?r:-30,m=y-v,b=this.context,g=this.canvas.width,w=this.canvas.height,T=null!==(n=this.styles.top)&&void 0!==n?n:0,k=null!==(i=this.styles.bottom)&&void 0!==i?i:0,A=null!==(s=this.styles.left)&&void 0!==s?s:30,_=g-(A+(null!==(o=this.styles.right)&&void 0!==o?o:30)),O=w-(T+k),x=null!==(a=this.styles.width)&&void 0!==a?a:1.5,S=null!==(c=this.styles.cap)&&void 0!==c?c:"round",M=null!==(u=this.styles.join)&&void 0!==u?u:"miter",E=null!==(l=this.styles.wave)&&void 0!==l?l:"rgba(0, 0, 255, 1.0)",C=null!==(h=this.styles.grid)&&void 0!==h?h:"none",P=null!==(p=this.styles.text)&&void 0!==p?p:"none",N=parseInt(null!==(d=null===(f=this.styles.font)||void 0===f?void 0:f.size)&&void 0!==d?d:"13px",10),R=this.size>t.length?t.length:this.size,j=this.sampleRate/(2*t.length),I=Math.trunc(this.textInterval/j);if(b.clearRect(0,0,g,w),"float"===this.type){b.strokeStyle=E,b.lineWidth=x,b.lineCap=S,b.lineJoin=M,b.beginPath();for(var q=0;q<R;q++){var D=q/R*_+A,U=Math.trunc(-1*(t[q]-y)*(O/m))+T;0===q?b.moveTo(D+x/2,U):b.lineTo(D,U)}b.stroke()}else switch(this.styles.shape){case"line":b.strokeStyle=E,b.lineWidth=x,b.lineCap=S,b.lineJoin=M,b.beginPath();for(q=0;q<R;q++){D=q/R*_+A,U=(1-t[q]/255)*O+T;0===q?b.moveTo(D+x/2,U):b.lineTo(D,U)}b.stroke();break;case"rect":for(q=0;q<R;q++){D=q/R*_+A,U=t[q]/255*O*-1;if(this.styles.gradients){for(var F=O+T,L=b.createLinearGradient(0,F,0,F+U),z=0,B=this.styles.gradients;z<B.length;z++){var G=B[z];L.addColorStop(G.offset,G.color)}b.fillStyle=L}else b.fillStyle=E;b.fillRect(D,O+T,x,U)}}if("none"!==C||"none"!==P){for(q=0;q<R;q++)if(q%I==0){D=Math.trunc(q/R*_)+A;var Q=Math.trunc(this.textInterval*(q/I)),X=Q<1e3?"".concat(Q," Hz"):"".concat((Q/1e3).toString(10).slice(0,3)," kHz");"none"!==C&&(b.fillStyle=C,b.fillRect(D,T,1,O)),"none"!==P&&(b.fillStyle=P,b.font=this.createFontString(),b.fillText(X,D-b.measureText(X).width/2,T+O+N))}if("float"===this.type)for(q=v;q<=y;q+=10){X="".concat(q," dB"),D=Math.trunc(A-b.measureText(X).width),U=Math.trunc(-1*(q-y)/m*O)+T;"none"!==C&&(b.fillStyle=C,b.fillRect(A,U,_,1)),"none"!==P&&(b.fillStyle=P,b.font=this.createFontString(),b.fillText(X,D,U))}else for(var V=0,W=["0.00","0.25","0.50","0.75","1.00"];V<W.length;V++){X=W[V],D=Math.trunc(A-b.measureText(X).width),U=(1-Number(X))*O+T;"none"!==C&&(b.fillStyle=C,b.fillRect(A,U,_,1)),"none"!==P&&(b.fillStyle=P,b.font=this.createFontString(),b.fillText(X,D,U))}}}},e.prototype.visualizeBySVG=function(t,r,n){var i,s,o,a,c,u,l,h,p,f,d,v,y,m,b,g,w,T,k,A,_,O,x,S,M,E,C,P,N,R,j,I;if(null!==this.svg&&this.isActive){var q=null!=r?r:-100,D=null!=n?n:-30,U=D-q,F=this.svg,L=Number(null!==(i=F.getAttribute("width"))&&void 0!==i?i:"0"),z=Number(null!==(s=F.getAttribute("height"))&&void 0!==s?s:"0"),B=null!==(o=this.styles.top)&&void 0!==o?o:0,G=null!==(a=this.styles.bottom)&&void 0!==a?a:0,Q=null!==(c=this.styles.left)&&void 0!==c?c:30,X=L-(Q+(null!==(u=this.styles.right)&&void 0!==u?u:30)),V=z-(B+G),W=null!==(l=this.styles.wave)&&void 0!==l?l:"rgba(0, 0, 255, 1.0)",H=null!==(h=this.styles.width)&&void 0!==h?h:1.5,Y=null!==(p=this.styles.cap)&&void 0!==p?p:"round",$=null!==(f=this.styles.join)&&void 0!==f?f:"miter",J=null!==(d=this.styles.grid)&&void 0!==d?d:"none",K=null!==(v=this.styles.text)&&void 0!==v?v:"none",Z=parseInt(null!==(m=null===(y=this.styles.font)||void 0===y?void 0:y.size)&&void 0!==m?m:"13px",10),tt=this.size>t.length?t.length:this.size,et=this.sampleRate/(2*t.length),rt=Math.trunc(this.textInterval/et);if(F.innerHTML="","float"===this.type){for(var nt=document.createElementNS(e.XMLNS,"path"),it="",st=0;st<tt;st++){var ot=Math.trunc(st/tt*X)+Q,at=Math.trunc(-1*(t[st]-D)*(V/U))+B;it+=0===st?"M".concat(ot+H/2," ").concat(at):" L".concat(ot," ").concat(at)}nt.setAttribute("d",it),nt.setAttribute("stroke",W),nt.setAttribute("fill","none"),nt.setAttribute("stroke-width",H.toString(10)),nt.setAttribute("stroke-linecap",Y),nt.setAttribute("stroke-linejoin",$),F.appendChild(nt)}else switch(this.styles.shape){case"line":for(nt=document.createElementNS(e.XMLNS,"path"),it="",st=0;st<tt;st++){ot=Math.trunc(st/tt*X)+Q,at=Math.trunc((1-t[st]/255)*V)+B;it+=0===st?"M".concat(ot+H/2," ").concat(at):" L".concat(ot," ").concat(at)}nt.setAttribute("d",it),nt.setAttribute("stroke",W),nt.setAttribute("fill","none"),nt.setAttribute("stroke-width",H.toString(10)),nt.setAttribute("stroke-linecap",Y),nt.setAttribute("stroke-linejoin",$),F.appendChild(nt);break;case"rect":var ct=null;this.styles.gradients&&(ct=this.createSVGLinearGradient("".concat(e.SVG_LINEAR_GRADIENT_ID_FFT,"-").concat(this.channel)));var ut=document.createElementNS(e.XMLNS,"g");null!==ct&&ut.appendChild(ct);for(st=0;st<tt;st++){var lt=document.createElementNS(e.XMLNS,"rect");ot=Math.trunc(st/tt*X)+Q,at=Math.trunc(t[st]/255*V);lt.setAttribute("x",ot.toString(10)),lt.setAttribute("y",(B+V).toString(10)),lt.setAttribute("width",H.toString(10)),lt.setAttribute("height",Math.abs(at).toString(10)),at>=0&&lt.setAttribute("transform","rotate(180 ".concat(ot+H/2," ").concat(B+V,")")),lt.setAttribute("stroke","none"),lt.setAttribute("fill",null===ct?W:"url(#".concat(e.SVG_LINEAR_GRADIENT_ID_FFT,"-").concat(this.channel,")")),ut.appendChild(lt)}F.appendChild(ut)}if("none"!==J||"none"!==K){for(st=0;st<tt;st++)if(st%rt==0){ot=Math.trunc(st/tt*X)+Q;var ht=Math.trunc(this.textInterval*(st/rt)),pt=ht<1e3?"".concat(ht," Hz"):"".concat((ht/1e3).toString(10).slice(0,3)," kHz");if("none"!==J)(lt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",ot.toString(10)),lt.setAttribute("y",B.toString(10)),lt.setAttribute("width","1"),lt.setAttribute("height",V.toString(10)),lt.setAttribute("stroke","none"),lt.setAttribute("fill",J),F.appendChild(lt);if("none"!==K)(vt=document.createElementNS(e.XMLNS,"text")).textContent=pt,vt.setAttribute("x",ot.toString(10)),vt.setAttribute("y",(B+V).toString(10)),vt.setAttribute("text-anchor","middle"),vt.setAttribute("stroke","none"),vt.setAttribute("fill",K),vt.setAttribute("font-family",null!==(g=null===(b=this.styles.font)||void 0===b?void 0:b.family)&&void 0!==g?g:"Arial"),vt.setAttribute("font-size",Z.toString(10)),vt.setAttribute("font-style",null!==(T=null===(w=this.styles.font)||void 0===w?void 0:w.style)&&void 0!==T?T:"normal"),vt.setAttribute("font-weight",null!==(A=null===(k=this.styles.font)||void 0===k?void 0:k.weight)&&void 0!==A?A:"normal"),F.appendChild(vt)}if("float"===this.type)for(st=q;st<=D;st+=10){pt="".concat(st,"dB"),ot=Q,at=Math.trunc(-1*(st-D)/U*V)+B;if("none"!==J)(lt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",ot.toString(10)),lt.setAttribute("y",at.toString(10)),lt.setAttribute("width",X.toString(10)),lt.setAttribute("height","1"),lt.setAttribute("stroke","none"),lt.setAttribute("fill",J),F.appendChild(lt);if("none"!==J)(vt=document.createElementNS(e.XMLNS,"text")).textContent=pt,vt.setAttribute("x",ot.toString(10)),vt.setAttribute("y",(at-Math.trunc(Z/4)).toString(10)),vt.setAttribute("text-anchor","end"),vt.setAttribute("stroke","none"),vt.setAttribute("fill",K),vt.setAttribute("font-family",null!==(O=null===(_=this.styles.font)||void 0===_?void 0:_.family)&&void 0!==O?O:"Arial"),vt.setAttribute("font-size",Z.toString(10)),vt.setAttribute("font-style",null!==(S=null===(x=this.styles.font)||void 0===x?void 0:x.style)&&void 0!==S?S:"normal"),vt.setAttribute("font-weight",null!==(E=null===(M=this.styles.font)||void 0===M?void 0:M.weight)&&void 0!==E?E:"normal"),F.appendChild(vt)}else for(var ft=0,dt=["0.00","0.25","0.50","0.75","1.00"];ft<dt.length;ft++){var vt;pt=dt[ft],ot=Q,at=(1-Number(pt))*V+B;if("none"!==J)(lt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",ot.toString(10)),lt.setAttribute("y",at.toString(10)),lt.setAttribute("width",X.toString(10)),lt.setAttribute("height","1"),lt.setAttribute("stroke","none"),lt.setAttribute("fill",J),F.appendChild(lt);if("none"!==K)(vt=document.createElementNS(e.XMLNS,"text")).textContent=pt,vt.setAttribute("x",ot.toString(10)),vt.setAttribute("y",(at-Math.trunc(Z/4)).toString(10)),vt.setAttribute("text-anchor","end"),vt.setAttribute("stroke","none"),vt.setAttribute("fill",K),vt.setAttribute("font-family",null!==(P=null===(C=this.styles.font)||void 0===C?void 0:C.family)&&void 0!==P?P:"Arial"),vt.setAttribute("font-size",Z.toString(10)),vt.setAttribute("font-style",null!==(R=null===(N=this.styles.font)||void 0===N?void 0:N.style)&&void 0!==R?R:"normal"),vt.setAttribute("font-weight",null!==(I=null===(j=this.styles.font)||void 0===j?void 0:j.weight)&&void 0!==I?I:"normal"),F.appendChild(vt)}}}},e}(r(1386).Visualizer);e.FFT=s},235:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Time=void 0;var s=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.type="uint",n.textInterval=.005,n}return i(e,t),e.prototype.setup=function(e){return t.prototype.setup.call(this,e),this},e.prototype.param=function(e){if("string"==typeof e)switch(e){case"type":return this.type;case"textInterval":return this.textInterval;case"interval":case"styles":return t.prototype.param.call(this,e);default:return this}for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],s=i[0],o=i[1];switch(s){case"type":"string"==typeof o&&("uint"!==o&&"float"!==o||(this.type=o));break;case"textInterval":"number"==typeof o&&(this.textInterval=o)}}return t.prototype.param.call(this,e),this},e.prototype.clear=function(){return t.prototype.clear.call(this),this},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.visualizeOnCanvas=function(t,e,r){var n,i,s,o,a,c,u,l,h,p,f,d;if(null!==this.canvas&&null!==this.context&&this.isActive){var v=this.context,y=this.canvas.width,m=this.canvas.height,b=null!==(n=this.styles.top)&&void 0!==n?n:15,g=null!==(i=this.styles.bottom)&&void 0!==i?i:15,w=null!==(s=this.styles.left)&&void 0!==s?s:30,T=y-(w+(null!==(o=this.styles.right)&&void 0!==o?o:30)),k=m-(b+g),A=Math.trunc(k/2)+b,_=null!==(a=this.styles.width)&&void 0!==a?a:1.5,O=null!==(c=this.styles.cap)&&void 0!==c?c:"round",x=null!==(u=this.styles.join)&&void 0!==u?u:"miter",S=null!==(l=this.styles.wave)&&void 0!==l?l:"rgba(0, 0, 255, 1.0)",M=null!==(h=this.styles.grid)&&void 0!==h?h:"none",E=null!==(p=this.styles.text)&&void 0!==p?p:"none",C=parseInt(null!==(d=null===(f=this.styles.font)||void 0===f?void 0:f.size)&&void 0!==d?d:"13px",10),P=Math.trunc(this.textInterval*this.sampleRate);if(v.clearRect(0,0,y,m),"float"===this.type)t instanceof Float32Array&&this.visualizeTimeDomainFloat32ArrayOnCanvas(v,t,T,k,A);else switch(this.styles.shape){case"line":v.strokeStyle=S,v.lineWidth=_,v.lineCap=O,v.lineJoin=x,v.beginPath();for(var N=0,R=t.length;N<R;N++){var j=N/R*T+w,I=(1-t[N]/255)*k+b;0===N?v.moveTo(j+_/2,I):v.lineTo(j,I)}v.stroke();break;case"rect":for(N=0,R=t.length;N<R;N++){j=N/R*T+w,I=(.5-t[N]/255)*k;if(this.styles.gradients){for(var q=k/2+b,D=v.createLinearGradient(0,q,0,q+I),U=0,F=this.styles.gradients;U<F.length;U++){var L=F[U];D.addColorStop(L.offset,L.color)}v.fillStyle=D}else v.fillStyle=S;v.fillRect(j,A,1,I)}}if("none"!==M||"none"!==E){for(N=0,R=t.length;N<R;N++)if(N%P==0){j=Math.trunc(N/R*T)+w;var z="".concat(Math.trunc(N/this.sampleRate*1e3)," ms");"none"!==M&&(v.fillStyle=M,v.fillRect(j,b,1,k)),"none"!==E&&(v.fillStyle=E,v.font=this.createFontString(),v.fillText(z,j-v.measureText(z).width/2,b+k+C))}for(var B=0,G=["-1.00","-0.50"," 0.00"," 0.50"," 1.00"];B<G.length;B++){z=G[B],j=Math.trunc(w-v.measureText(z).width),I=Math.trunc((1-Number(z.trim()))*(k/2))+b;"none"!==M&&(v.fillStyle=M,v.fillRect(w,I,T,1)),"none"!==E&&(v.fillStyle=E,v.font=this.createFontString(),v.fillText(z,j,I-Math.trunc(C/4)))}}}},e.prototype.visualizeBySVG=function(t,r,n){var i,s,o,a,c,u,l,h,p,f,d,v,y,m,b,g,w,T,k,A,_,O,x,S,M,E;if(null!==this.svg&&this.isActive){var C=this.svg,P=Number(null!==(i=C.getAttribute("width"))&&void 0!==i?i:"0"),N=Number(null!==(s=C.getAttribute("height"))&&void 0!==s?s:"0"),R=null!==(o=this.styles.top)&&void 0!==o?o:15,j=null!==(a=this.styles.bottom)&&void 0!==a?a:15,I=null!==(c=this.styles.left)&&void 0!==c?c:30,q=P-(I+(null!==(u=this.styles.right)&&void 0!==u?u:30)),D=N-(R+j),U=Math.trunc(D/2)+R,F=null!==(l=this.styles.width)&&void 0!==l?l:1.5,L=null!==(h=this.styles.cap)&&void 0!==h?h:"round",z=null!==(p=this.styles.join)&&void 0!==p?p:"miter",B=null!==(f=this.styles.wave)&&void 0!==f?f:"rgba(0, 0, 255, 1.0)",G=null!==(d=this.styles.grid)&&void 0!==d?d:"none",Q=null!==(v=this.styles.text)&&void 0!==v?v:"none",X=parseInt(null!==(m=null===(y=this.styles.font)||void 0===y?void 0:y.size)&&void 0!==m?m:"13px",10),V=Math.trunc(this.textInterval*this.sampleRate);if(C.innerHTML="","float"===this.type){if(t instanceof Float32Array){var W=this.visualizeTimeDomainFloat32ArrayBySVG(t,q,D,U,0,e.SVG_LINEAR_GRADIENT_ID_TIME);null!==W&&C.appendChild(W)}}else switch(this.styles.shape){case"line":for(var H=document.createElementNS(e.XMLNS,"path"),Y="",$=0,J=t.length;$<J;$++){var K=$/J*q+I,Z=(1-t[$]/255)*D+R;Y+=0===$?"M".concat(K+F/2," ").concat(Z):" L".concat(K," ").concat(Z)}H.setAttribute("d",Y),H.setAttribute("stroke",B),H.setAttribute("fill","none"),H.setAttribute("stroke-width",F.toString(10)),H.setAttribute("stroke-linecap",L),H.setAttribute("stroke-linejoin",z),C.appendChild(H);break;case"rect":var tt=null;this.styles.gradients&&(tt=this.createSVGLinearGradient("".concat(e.SVG_LINEAR_GRADIENT_ID_TIME,"-").concat(this.channel)));var et=document.createElementNS(e.XMLNS,"g");null!==tt&&et.appendChild(tt);for($=0,J=t.length;$<J;$++){var rt=document.createElementNS(e.XMLNS,"rect");K=$/J*q+I,Z=(t[$]/255-.5)*D;rt.setAttribute("x",K.toString(10)),rt.setAttribute("y",U.toString(10)),rt.setAttribute("width",F.toString(10)),rt.setAttribute("height",Math.abs(Z).toString(10)),Z>=0&&rt.setAttribute("transform","rotate(180 ".concat(K+F/2," ").concat(U,")")),rt.setAttribute("stroke","none"),rt.setAttribute("fill",null===tt?B:"url(#".concat(e.SVG_LINEAR_GRADIENT_ID_TIME,"-").concat(this.channel,")")),et.appendChild(rt)}C.appendChild(et)}if("none"!==G||"none"!==Q){for($=0,J=t.length;$<J;$++)if($%V==0){K=Math.trunc($/J*q)+I;var nt="".concat(Math.trunc($/this.sampleRate*1e3)," ms");if("none"!==G)(rt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",K.toString(10)),rt.setAttribute("y",R.toString(10)),rt.setAttribute("width","1"),rt.setAttribute("height",D.toString(10)),rt.setAttribute("stroke","none"),rt.setAttribute("fill",G),C.appendChild(rt);if("none"!==Q)(ot=document.createElementNS(e.XMLNS,"text")).textContent=nt,ot.setAttribute("x",K.toString(10)),ot.setAttribute("y",(R+D+X).toString(10)),ot.setAttribute("text-anchor","middle"),ot.setAttribute("stroke","none"),ot.setAttribute("fill",Q),ot.setAttribute("font-family",null!==(g=null===(b=this.styles.font)||void 0===b?void 0:b.family)&&void 0!==g?g:"Arial"),ot.setAttribute("font-size",X.toString(10)),ot.setAttribute("font-style",null!==(T=null===(w=this.styles.font)||void 0===w?void 0:w.style)&&void 0!==T?T:"normal"),ot.setAttribute("font-weight",null!==(A=null===(k=this.styles.font)||void 0===k?void 0:k.weight)&&void 0!==A?A:"normal"),C.appendChild(ot)}for(var it=0,st=["-1.00","-0.50"," 0.00"," 0.50"," 1.00"];it<st.length;it++){var ot;nt=st[it],K=I,Z=Math.trunc((1-Number(nt.trim()))*(D/2))+R;if("none"!==G)(rt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",K.toString(10)),rt.setAttribute("y",Z.toString(10)),rt.setAttribute("width",q.toString(10)),rt.setAttribute("height","1"),rt.setAttribute("stroke","none"),rt.setAttribute("fill",G),C.appendChild(rt);if("none"!==Q)(ot=document.createElementNS(e.XMLNS,"text")).textContent=nt,ot.setAttribute("x",K.toString(10)),ot.setAttribute("y",(Z-Math.trunc(X/4)).toString(10)),ot.setAttribute("text-anchor","end"),ot.setAttribute("stroke","none"),ot.setAttribute("fill",Q),ot.setAttribute("font-family",null!==(O=null===(_=this.styles.font)||void 0===_?void 0:_.family)&&void 0!==O?O:"Arial"),ot.setAttribute("font-size",X.toString(10)),ot.setAttribute("font-style",null!==(S=null===(x=this.styles.font)||void 0===x?void 0:x.style)&&void 0!==S?S:"normal"),ot.setAttribute("font-weight",null!==(E=null===(M=this.styles.font)||void 0===M?void 0:M.weight)&&void 0!==E?E:"normal"),C.appendChild(ot)}}}},e}(r(1386).Visualizer);e.Time=s},9076:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.TimeOverview=void 0;var o=r(1386),a="xsound-svg-current-time",c="xsound-svg-sprite",u=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.callback=function(){},n.currentImageData=null,n.currentSVGElement=null,n.currentDataSize=0,n.currentTime={width:1,color:"rgba(0, 0, 0, 0.5)"},n.sprite="rgba(255, 255, 255, 0.25)",n.plotInterval=.0625,n.textInterval=60,n.isDown=!1,n.mode="update",n.offsetX=0,n.startTime=0,n.endTime=0,n.onMouseStart=n.onMouseStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n.onTouchStart=n.onTouchStart.bind(n),n.onTouchMove=n.onTouchMove.bind(n),n.onTouchEnd=n.onTouchEnd.bind(n),n}return i(e,t),e.prototype.setup=function(e){return t.prototype.setup.call(this,e),this},e.prototype.param=function(e){if("string"==typeof e)switch(e){case"currentTime":return this.currentTime;case"sprite":return this.sprite;case"plotInterval":return this.plotInterval;case"textInterval":return this.textInterval;case"mode":return this.mode;case"interval":case"styles":return t.prototype.param.call(this,e);default:return this}for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],o=i[0],a=i[1];switch(o){case"currentTime":"object"==typeof a&&(this.currentTime=s(s({},this.currentTime),a));break;case"sprite":"string"==typeof a&&(this.sprite=a);break;case"plotInterval":"number"==typeof a&&(this.plotInterval=a);break;case"textInterval":"number"==typeof a&&(this.textInterval=a);break;case"mode":"string"==typeof a&&("update"!==a&&"sprite"!==a||(this.mode=a))}}return t.prototype.param.call(this,e),this},e.prototype.update=function(t){var r,n,i,s,o,u,l,h,p,f,d,v,y;switch(this.graphics){case"canvas":if(null===this.currentImageData)return this;if(null===this.canvas||null===this.context)return this;var m=this.context,b=this.canvas.width,g=this.canvas.height,w=b-((null!==(r=this.styles.left)&&void 0!==r?r:30)+(null!==(n=this.styles.right)&&void 0!==n?n:30)),T=g-((null!==(i=this.styles.top)&&void 0!==i?i:15)+(null!==(s=this.styles.bottom)&&void 0!==s?s:15)),k=t*this.sampleRate/this.currentDataSize*w,A=null!==(o=this.styles.left)&&void 0!==o?o:30,_=null!==(u=this.styles.top)&&void 0!==u?u:15,O=null!==(l=this.currentTime.color)&&void 0!==l?l:"rgba(0, 0, 0, 0.5)";switch(m.clearRect(0,0,b,g),m.putImageData(this.currentImageData,0,0),this.mode){case"update":m.fillStyle=O,m.fillRect(A,_+1,k,T-1);break;case"sprite":if(0!==this.endTime){var x=Math.trunc(Math.abs(this.endTime-this.startTime)*this.sampleRate/this.currentDataSize*w);m.fillStyle=this.sprite,k>=this.offsetX?m.fillRect(A+this.offsetX,_+1,x,T-1):m.fillRect(A+this.offsetX-x,_+1,x,T-1)}m.fillStyle=O,k>=this.offsetX?m.fillRect(A+this.offsetX,_+1,Math.abs(k-this.offsetX),T-1):m.fillRect(A+k,_+1,Math.abs(k-this.offsetX),T-1)}break;case"svg":if(null===this.currentSVGElement)return this;if(this.svg){var S=this.svg.querySelector(".".concat(a));if(null===S)return this;b=Number(null!==(h=this.svg.getAttribute("width"))&&void 0!==h?h:"0"),_=null!==(p=this.styles.top)&&void 0!==p?p:15,w=b-((A=null!==(f=this.styles.left)&&void 0!==f?f:30)+(null!==(d=this.styles.right)&&void 0!==d?d:30)),k=t*this.sampleRate/this.currentDataSize*w;if("update"===this.mode)S.setAttribute("x",A.toString(10)),S.setAttribute("width",k.toString(10)),S.setAttribute("aria-label","current time");else if("sprite"===this.mode){if(0!==this.endTime){var M=this.svg.querySelector(".".concat(c));M&&(null===(v=M.parentNode)||void 0===v||v.removeChild(M));var E=document.createElementNS(e.XMLNS,"rect");E.classList.add(c);x=Math.trunc(Math.abs(this.endTime-this.startTime)*this.sampleRate/this.currentDataSize*w);E.setAttribute("y",(_+1).toString(10)),E.setAttribute("height",null!==(y=S.getAttribute("height"))&&void 0!==y?y:"0"),E.setAttribute("stroke","none"),E.setAttribute("fill",this.sprite),E.setAttribute("aria-label","current time"),k>=this.offsetX?E.setAttribute("x",(A+this.offsetX).toString(10)):E.setAttribute("x",(A+this.offsetX-x).toString(10)),E.setAttribute("width",x.toString(10)),this.svg.appendChild(E),this.svg.appendChild(S)}k>=this.offsetX?S.setAttribute("x",(A+this.offsetX).toString(10)):S.setAttribute("x",(A+k).toString(10)),S.setAttribute("width",Math.abs(k-this.offsetX).toString(10)),S.setAttribute("aria-label","sprite time")}}}return this},e.prototype.drag=function(t){var e=null;switch(this.graphics){case"canvas":if(null===this.canvas)return this;e=this.canvas;break;case"svg":if(null===this.svg)return this;e=this.svg;break;default:return this}return null===e||(t&&(this.callback=t),e.removeEventListener("mousedown",{handleEvent:this.onMouseStart},!1),e.removeEventListener("mousemove",{handleEvent:this.onMouseMove},!1),window.removeEventListener("mouseup",{handleEvent:this.onMouseUp},!1),e.removeEventListener("touchstart",{handleEvent:this.onTouchStart},!1),e.removeEventListener("touchmove",{handleEvent:this.onTouchMove},!1),window.removeEventListener("touchend",{handleEvent:this.onTouchEnd},!1),e.addEventListener("mousedown",{handleEvent:this.onMouseStart},!1),e.addEventListener("mousemove",{handleEvent:this.onMouseMove},!1),window.addEventListener("mouseup",{handleEvent:this.onMouseUp},!1),e.addEventListener("touchstart",{handleEvent:this.onTouchStart},!1),e.addEventListener("touchmove",{handleEvent:this.onTouchMove},!1),window.addEventListener("touchend",{handleEvent:this.onTouchEnd},!1)),this},e.prototype.clear=function(){return t.prototype.clear.call(this),this},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.visualizeOnCanvas=function(t,e,r){var n,i,s,o,a,c,u,l,h;if(null!==this.canvas&&null!==this.context&&this.isActive&&!(t instanceof Uint8Array)){var p=this.context,f=this.canvas.width,d=this.canvas.height,v=null!==(n=this.styles.top)&&void 0!==n?n:15,y=null!==(i=this.styles.bottom)&&void 0!==i?i:15,m=null!==(s=this.styles.left)&&void 0!==s?s:30,b=f-(m+(null!==(o=this.styles.right)&&void 0!==o?o:30)),g=d-(v+y),w=Math.trunc(g/2)+v,T=null!==(a=this.styles.grid)&&void 0!==a?a:"none",k=null!==(c=this.styles.text)&&void 0!==c?c:"none",A=parseInt(null!==(l=null===(u=this.styles.font)||void 0===u?void 0:u.size)&&void 0!==l?l:"13px",10),_=Math.trunc(this.plotInterval*this.sampleRate),O=Math.trunc(this.textInterval*this.sampleRate);if(p.clearRect(0,0,f,d),this.visualizeTimeDomainFloat32ArrayOnCanvas(p,t,b,g,w,_),"none"!==T||"none"!==k){for(var x=0,S=t.length;x<S;x++)if(x%O==0){var M=Math.trunc(x/S*b)+m,E="".concat(Math.trunc(x/this.sampleRate/60)," min");"none"!==T&&(p.fillStyle=T,p.fillRect(M,v,1,g)),"none"!==k&&(p.fillStyle=k,p.font=this.createFontString(),p.fillText(E,M-p.measureText(E).width/2,v+g+A))}for(var C=0,P=["-1.00","-0.50"," 0.00"," 0.50"," 1.00"];C<P.length;C++){E=P[C],M=Math.trunc(m-p.measureText(E).width);var N=Math.trunc((1-Number(E.trim()))*(g/2))+v;"none"!==T&&(p.fillStyle=T,p.fillRect(m,N,b,1)),"none"!==k&&(p.fillStyle=k,p.font=this.createFontString(),p.fillText(E,M,N-Math.trunc(A/4)))}}this.currentImageData=p.getImageData(0,0,f,d),this.currentDataSize=t.length,p.fillStyle=null!==(h=this.currentTime.color)&&void 0!==h?h:"rgba(0, 0, 0, 0.5)",p.fillRect(m,v,1,g)}},e.prototype.visualizeBySVG=function(t,r,n){var i,s,o,c,u,l,h,p,f,d,v,y,m,b,g,w,T,k,A,_,O,x,S;if(null!==this.svg&&this.isActive&&!(t instanceof Uint8Array)){var M=this.svg,E=Number(null!==(i=M.getAttribute("width"))&&void 0!==i?i:"0"),C=Number(null!==(s=M.getAttribute("height"))&&void 0!==s?s:"0"),P=null!==(o=this.styles.top)&&void 0!==o?o:15,N=null!==(c=this.styles.bottom)&&void 0!==c?c:15,R=null!==(u=this.styles.left)&&void 0!==u?u:30,j=E-(R+(null!==(l=this.styles.right)&&void 0!==l?l:30)),I=C-(P+N),q=Math.trunc(I/2)+P,D=null!==(h=this.styles.grid)&&void 0!==h?h:"none",U=null!==(p=this.styles.text)&&void 0!==p?p:"none",F=parseInt(null!==(d=null===(f=this.styles.font)||void 0===f?void 0:f.size)&&void 0!==d?d:"13px",10),L=Math.trunc(this.plotInterval*this.sampleRate),z=Math.trunc(this.textInterval*this.sampleRate);M.innerHTML="";var B=this.visualizeTimeDomainFloat32ArrayBySVG(t,j,I,q,L,"".concat(e.SVG_LINEAR_GRADIENT_ID_TIME_OVERVIEW,"-").concat(this.channel));if(B&&M.appendChild(B),"none"!==D||"none"!==U){for(var G=0,Q=t.length;G<Q;G++)if(G%z==0){var X=Math.trunc(G/Q*j)+R,V="".concat(Math.trunc(G/this.sampleRate/60)," min");if("none"!==D){var W=document.createElementNS(e.XMLNS,"rect");W.setAttribute("x",X.toString(10)),W.setAttribute("y",P.toString(10)),W.setAttribute("width","1"),W.setAttribute("height",I.toString(10)),W.setAttribute("stroke","none"),W.setAttribute("fill",D),M.appendChild(W)}if("none"!==U)($=document.createElementNS(e.XMLNS,"text")).textContent=V,$.setAttribute("x",X.toString(10)),$.setAttribute("y",(P+I+F).toString(10)),$.setAttribute("text-anchor","middle"),$.setAttribute("stroke","none"),$.setAttribute("fill",U),$.setAttribute("font-family",null!==(y=null===(v=this.styles.font)||void 0===v?void 0:v.family)&&void 0!==y?y:"Arial"),$.setAttribute("font-size",F.toString(10)),$.setAttribute("font-style",null!==(b=null===(m=this.styles.font)||void 0===m?void 0:m.style)&&void 0!==b?b:"normal"),$.setAttribute("font-weight",null!==(w=null===(g=this.styles.font)||void 0===g?void 0:g.weight)&&void 0!==w?w:"normal"),M.appendChild($)}for(var H=0,Y=["-1.00","-0.50"," 0.00"," 0.50"," 1.00"];H<Y.length;H++){V=Y[H],X=R;var $,J=Math.trunc((1-Number(V.trim()))*(I/2))+P;if("none"!==D){var K=document.createElementNS(e.XMLNS,"rect");K.setAttribute("x",X.toString(10)),K.setAttribute("y",J.toString(10)),K.setAttribute("width",j.toString(10)),K.setAttribute("height","1"),K.setAttribute("stroke","none"),K.setAttribute("fill",D),M.appendChild(K)}if("none"!==U)($=document.createElementNS(e.XMLNS,"text")).textContent=V,$.setAttribute("x",X.toString(10)),$.setAttribute("y",(J-Math.trunc(F/4)).toString(10)),$.setAttribute("text-anchor","end"),$.setAttribute("stroke","none"),$.setAttribute("fill",U),$.setAttribute("font-family",null!==(k=null===(T=this.styles.font)||void 0===T?void 0:T.family)&&void 0!==k?k:"Arial"),$.setAttribute("font-size",F.toString(10)),$.setAttribute("font-style",null!==(_=null===(A=this.styles.font)||void 0===A?void 0:A.style)&&void 0!==_?_:"normal"),$.setAttribute("font-weight",null!==(x=null===(O=this.styles.font)||void 0===O?void 0:O.weight)&&void 0!==x?x:"normal"),M.appendChild($)}}var Z=document.createElementNS(e.XMLNS,"rect");Z.classList.add(a),Z.setAttribute("y",(P+1).toString(10)),Z.setAttribute("height",(I-1).toString(10)),Z.setAttribute("stroke","none"),Z.setAttribute("fill",null!==(S=this.currentTime.color)&&void 0!==S?S:"rgba(0, 0, 0, 0.5)"),M.appendChild(Z),this.currentSVGElement=M,this.currentDataSize=t.length}},e.prototype.visualize=function(t,e,r){var n,i,s,o,a,c,u,l,h=0,p=0;switch(this.graphics){case"canvas":if(null===this.canvas)return;h=this.canvas.offsetLeft,p=this.canvas.width;break;case"svg":if(null===this.svg)return;h=null!==(i=null===(n=this.svg.parentElement)||void 0===n?void 0:n.offsetLeft)&&void 0!==i?i:0,p=Number(null!==(s=this.svg.getAttribute("width"))&&void 0!==s?s:"0")}var f=r-(h+(null!==(o=this.styles.left)&&void 0!==o?o:30));"canvas"===this.graphics&&(null===(a=this.canvas)||void 0===a?void 0:a.parentElement)&&(f+=this.canvas.parentElement.scrollLeft),"svg"===this.graphics&&(null===(c=this.svg)||void 0===c?void 0:c.parentElement)&&(f+=this.svg.parentElement.scrollLeft),f<0&&(f=0),f>(p-=(null!==(u=this.styles.left)&&void 0!==u?u:30)+(null!==(l=this.styles.right)&&void 0!==l?l:30))&&(f=p);var d=f/p*this.currentDataSize/this.sampleRate;"mousedown"!==e&&"touchstart"!==e||(this.offsetX=f,this.startTime=d,this.endTime=0),"mouseup"!==e&&"touchend"!==e||(this.endTime=d),this.update(d),this.startTime<=d?this.callback(t,this.startTime,d,this.mode,!0):this.startTime>d&&this.callback(t,d,this.startTime,this.mode,!1)},e.prototype.onMouseStart=function(t){"mousedown"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)),this.isDown=!0},e.prototype.onMouseMove=function(t){this.isDown&&(t.stopPropagation(),"mousemove"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)))},e.prototype.onMouseUp=function(t){this.isDown&&("mouseup"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)),this.isDown=!1)},e.prototype.onTouchStart=function(t){"touchstart"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)),this.isDown=!0},e.prototype.onTouchMove=function(t){this.isDown&&(t.stopPropagation(),t.preventDefault(),"touchmove"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)))},e.prototype.onTouchEnd=function(t){this.isDown&&("touchend"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)),this.isDown=!1)},e.prototype.getOffsetX=function(t){return t instanceof MouseEvent?t.pageX:t instanceof TouchEvent?t.touches[0].pageX:0},e}(o.Visualizer);e.TimeOverview=u},1386:function(t,e){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Visualizer=void 0;var n=function(){function t(t,e){this.isActive=!1,this.graphics="",this.canvas=null,this.context=null,this.svg=null,this.interval=1e3,this.styles={shape:"line",gradients:[{offset:0,color:"rgba(0, 128, 255, 1.0)"},{offset:1,color:"rgba(0, 0, 255, 1.0)"}],wave:"rgba(0, 0, 255, 1.0)",grid:"rgba(255, 0, 0, 1.0)",text:"rgba(255, 255, 255, 1.0)",font:{family:"Arial",size:"13px",style:"normal",weight:"normal"},width:1.5,cap:"round",join:"miter",top:15,right:30,bottom:15,left:30},this.sampleRate=t,this.channel=e}return t.prototype.setup=function(t){return t instanceof HTMLCanvasElement?(this.graphics="canvas",this.canvas=t,this.context=this.canvas.getContext("2d")):t instanceof SVGSVGElement&&(this.graphics="svg",this.svg=t),this},t.prototype.start=function(t,e,r){switch(this.graphics){case"canvas":this.visualizeOnCanvas(t,e,r);break;case"svg":this.visualizeBySVG(t,e,r)}return this},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"interval":return this.interval;case"styles":return this.styles;default:return}for(var e=0,n=Object.entries(t);e<n.length;e++){var i=n[e],s=i[0],o=i[1];switch(s){case"interval":"number"==typeof o&&(this.interval=o);break;case"styles":"object"==typeof o&&(this.styles=r(r({},this.styles),o))}}},t.prototype.get=function(){switch(this.graphics){case"canvas":return this.canvas;case"svg":return this.svg;default:return null}},t.prototype.clear=function(){switch(this.graphics){case"canvas":this.canvas&&this.context&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height);break;case"svg":this.svg&&(this.svg.innerHTML="")}return this},t.prototype.create=function(){switch(this.graphics){case"canvas":return null===this.canvas?"":this.canvas.toDataURL("image/png").replace("image/png","image/octet-stream");case"svg":return null===this.svg?"":this.svg.outerHTML;default:return""}},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this},t.prototype.deactivate=function(){return this.isActive=!1,this},t.prototype.visualizeTimeDomainFloat32ArrayOnCanvas=function(t,e,r,n,i,s){var o,a,c,u,l,h,p=null!==(o=this.styles.top)&&void 0!==o?o:15,f=null!==(a=this.styles.left)&&void 0!==a?a:30,d=null!==(c=this.styles.width)&&void 0!==c?c:1.5,v=null!==(u=this.styles.cap)&&void 0!==u?u:"round",y=null!==(l=this.styles.join)&&void 0!==l?l:"miter",m=null!==(h=this.styles.wave)&&void 0!==h?h:"rgba(0, 0, 255, 1.0)";switch(this.styles.shape){case"line":t.strokeStyle=m,t.lineWidth=d,t.lineCap=v,t.lineJoin=y,t.beginPath();for(var b=0,g=e.length;b<g;b++)if(!s||b%s==0){var w=b/g*r+f,T=(1-e[b])*(n/2)+p;0===b?t.moveTo(w+t.lineWidth/2,T):t.lineTo(w,T)}t.stroke();break;case"rect":for(b=0,g=e.length;b<g;b++)if(!s||b%s==0){w=b/g*r+f,T=e[b]*(n/2)*-1;if(this.styles.gradients){for(var k=n/2+p,A=t.createLinearGradient(0,k,0,k+T),_=0,O=this.styles.gradients;_<O.length;_++){var x=O[_];A.addColorStop(x.offset,x.color)}t.fillStyle=A}else t.fillStyle=m;t.fillRect(w,i,d,T)}}},t.prototype.visualizeTimeDomainFloat32ArrayBySVG=function(e,r,n,i,s,o){var a,c,u,l,h,p,f,d=null!==(a=this.styles.top)&&void 0!==a?a:15,v=null!==(c=this.styles.left)&&void 0!==c?c:30,y=null!==(u=this.styles.width)&&void 0!==u?u:1.5,m=null!==(l=this.styles.cap)&&void 0!==l?l:"round",b=null!==(h=this.styles.join)&&void 0!==h?h:"miter",g=null!==(p=this.styles.wave)&&void 0!==p?p:"rgba(0, 0, 255, 1.0)";switch(this.styles.shape){case"line":for(var w=document.createElementNS(t.XMLNS,"path"),T="",k=0,A=e.length;k<A;k++)if(k%s==0){var _=k/A*r+v,O=(1-e[k])*(n/2)+d;T+=0===k?"M".concat(_+(null!==(f=this.styles.width)&&void 0!==f?f:1.5)/2," ").concat(O):" L".concat(_," ").concat(O)}return w.setAttribute("d",T),w.setAttribute("stroke",g),w.setAttribute("fill","none"),w.setAttribute("stroke-width",y.toString(10)),w.setAttribute("stroke-linecap",m),w.setAttribute("stroke-linejoin",b),w;case"rect":var x=null;this.styles.gradients&&(x=this.createSVGLinearGradient(o));var S=document.createElementNS(t.XMLNS,"g");null!==x&&S.appendChild(x);for(k=0,A=e.length;k<A;k++)if(k%s==0){var M=document.createElementNS(t.XMLNS,"rect");_=k/A*r+v,O=e[k]*(n/2);M.setAttribute("x",_.toString(10)),M.setAttribute("y",i.toString(10)),M.setAttribute("width",y.toString(10)),M.setAttribute("height",Math.abs(O).toString(10)),O>=0&&M.setAttribute("transform","rotate(180 ".concat(_+y/2," ").concat(i,")")),M.setAttribute("stroke","none"),M.setAttribute("fill",null===x?g:"url(#".concat(o,")")),S.appendChild(M)}return S;default:return null}},t.prototype.createSVGLinearGradient=function(e){if(!this.styles.gradients)return null;var r=document.createElementNS(t.XMLNS,"defs"),n=document.createElementNS(t.XMLNS,"linearGradient");n.setAttribute("id",e),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2","0%"),n.setAttribute("y2","100%");for(var i=0,s=this.styles.gradients;i<s.length;i++){var o=s[i],a=document.createElementNS(t.XMLNS,"stop");a.setAttribute("offset",o.offset.toString(10)),a.setAttribute("stop-color",o.color),n.appendChild(a)}return r.appendChild(n),r},t.prototype.createFontString=function(){var t,e=null!==(t=this.styles.font)&&void 0!==t?t:{},r=e.style,n=e.weight,i=e.size,s=e.family;return"".concat(null!=r?r:"normal"," ").concat(null!=n?n:"normal"," ").concat(null!=i?i:"13px",' "').concat(null!=s?s:"Arial",'"')},t.XMLNS="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.SVG_LINEAR_GRADIENT_ID_TIME_OVERVIEW="svg-linear-gradient-time-overview",t.SVG_LINEAR_GRADIENT_ID_TIME="svg-linear-gradient-time",t.SVG_LINEAR_GRADIENT_ID_FFT="svg-linear-gradient-fft",t}();e.Visualizer=n},8397:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Analyser=void 0;r(1386);var n=r(9076),i=r(235),s=r(6354),o=function(){function t(t){this.timeDomainAnimationId=null,this.timeDomainTimerId=null,this.frequencyDomainAnimationId=null,this.frequencyDomainTimerId=null,this.analyser=t.createAnalyser(),this.input=t.createGain(),this.input.connect(this.analyser),this.timeOverviewL=new n.TimeOverview(t.sampleRate,0),this.timeOverviewR=new n.TimeOverview(t.sampleRate,1),this.time=new i.Time(t.sampleRate,0),this.fft=new s.FFT(t.sampleRate,0),this.analyser.fftSize=2048,this.analyser.minDecibels=-100,this.analyser.maxDecibels=-30,this.analyser.smoothingTimeConstant=.8}return t.prototype.start=function(t,e,r){var n=this;switch(t){case"timeoverview":if((0===e||1===e)&&r)switch(e){case 0:if(r.numberOfChannels>e)(s=new Float32Array(r.length)).set(r.getChannelData(e)),this.timeOverviewL.start(s);break;case 1:if(r.numberOfChannels>e)(s=new Float32Array(r.length)).set(r.getChannelData(e)),this.timeOverviewR.start(s)}break;case"time":var i=this.time.param("interval");switch(this.time.param("type")){case"uint":var s=new Uint8Array(this.analyser.fftSize);this.analyser.getByteTimeDomainData(s),this.time.start(s);break;case"float":s=new Float32Array(this.analyser.fftSize);this.analyser.getFloatTimeDomainData(s),this.time.start(s)}"number"==typeof i&&(this.stop(t),i<0?this.timeDomainAnimationId=window.requestAnimationFrame((function(){n.start(t)})):this.timeDomainTimerId=window.setTimeout((function(){n.start(t)}),i));break;case"fft":i=this.fft.param("interval");switch(this.fft.param("type")){case"uint":s=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(s),this.fft.start(s);break;case"float":s=new Float32Array(this.analyser.frequencyBinCount);this.analyser.getFloatFrequencyData(s),this.fft.start(s,this.analyser.minDecibels,this.analyser.maxDecibels)}"number"==typeof i&&(this.stop(t),i<0?this.frequencyDomainAnimationId=window.requestAnimationFrame((function(){n.start(t)})):this.frequencyDomainTimerId=window.setTimeout((function(){n.start(t)}),i))}return this},t.prototype.stop=function(t){switch(t){case"time":"number"==typeof(e=this.time.param("interval"))&&(e<0&&this.timeDomainAnimationId?(window.cancelAnimationFrame(this.timeDomainAnimationId),this.timeDomainAnimationId=null):this.timeDomainTimerId&&(window.clearTimeout(this.timeDomainTimerId),this.timeDomainTimerId=null));break;case"fft":var e;"number"==typeof(e=this.fft.param("interval"))&&(e<0&&this.frequencyDomainAnimationId?(window.cancelAnimationFrame(this.frequencyDomainAnimationId),this.frequencyDomainAnimationId=null):this.frequencyDomainTimerId&&(window.clearTimeout(this.frequencyDomainTimerId),this.frequencyDomainTimerId=null))}return this},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"fftSize":return this.analyser.fftSize;case"frequencyBinCount":return this.analyser.frequencyBinCount;case"minDecibels":return this.analyser.minDecibels;case"maxDecibels":return this.analyser.maxDecibels;case"smoothingTimeConstant":return this.analyser.smoothingTimeConstant;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"fftSize":this.analyser.fftSize=s;break;case"minDecibels":this.analyser.minDecibels=s;break;case"maxDecibels":this.analyser.maxDecibels=s;break;case"smoothingTimeConstant":this.analyser.smoothingTimeConstant=s}}return this},t.prototype.domain=function(t,e){switch(t){case"timeoverview":switch(e){case 0:default:return this.timeOverviewL;case 1:return this.timeOverviewR}case"time":return this.time;case"fft":return this.fft;default:return this}return this},t.prototype.get=function(){return this.analyser},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.input},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.input},enumerable:!1,configurable:!0}),t}();e.Analyser=o},8044:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Autopanner=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.panner=r.context.createStereoPanner(),r.panner.pan.value=0,r.depth.gain.value=0,r.rate.value=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.panner.pan),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.panner.pan))},e.prototype.connect=function(){return this.input.disconnect(0),this.panner.disconnect(0),this.isActive?(this.input.connect(this.panner),this.panner.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"depth":return this.depth.gain.value;case"rate":return this.rate.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"depth":"number"==typeof s&&(this.depth.gain.value=s);break;case"rate":"number"==typeof s&&(this.rate.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,depth:this.depth.gain.value,rate:this.rate.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Autopanner=s},8649:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Chorus=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.depthRate=0,r.delay=e.createDelay(),r.mix=e.createGain(),r.tone=e.createBiquadFilter(),r.feedback=e.createGain(),r.delay.delayTime.value=0,r.depth.gain.value=0,r.rate.value=0,r.mix.gain.value=0,r.tone.type="lowpass",r.tone.frequency.value=350,r.tone.Q.value=Math.SQRT1_2,r.tone.gain.value=0,r.feedback.gain.value=0,r.depthRate=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.delay.delayTime),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.delay.delayTime))},e.prototype.connect=function(){return this.input.disconnect(0),this.delay.disconnect(0),this.mix.disconnect(0),this.tone.disconnect(0),this.feedback.disconnect(0),this.input.connect(this.output),this.isActive&&(this.input.connect(this.tone),this.tone.connect(this.delay),this.delay.connect(this.mix),this.mix.connect(this.output),this.delay.connect(this.feedback),this.feedback.connect(this.delay)),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"time":return this.delay.delayTime.value;case"depth":return this.depthRate;case"rate":return this.rate.value;case"mix":return this.mix.gain.value;case"tone":return this.tone.frequency.value;case"feedback":return this.feedback.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"time":"number"==typeof s&&(this.delay.delayTime.value=s,this.depth.gain.value=this.delay.delayTime.value*this.depthRate);break;case"depth":"number"==typeof s&&(this.depthRate=s,this.depth.gain.value=this.delay.delayTime.value*s);break;case"rate":"number"==typeof s&&(this.rate.value=s);break;case"mix":"number"==typeof s&&(this.mix.gain.value=s);break;case"tone":"number"==typeof s&&(this.tone.frequency.value=s);break;case"feedback":"number"==typeof s&&(this.feedback.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,time:this.delay.delayTime.value,depth:this.depthRate,rate:this.rate.value,mix:this.mix.gain.value,tone:this.tone.frequency.value,feedback:this.feedback.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Chorus=s},346:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Compressor=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.compressor=e.createDynamicsCompressor(),r.compressor.threshold.value=-24,r.compressor.knee.value=30,r.compressor.ratio.value=12,r.compressor.attack.value=.003,r.compressor.release.value=.25,r.activate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.compressor.disconnect(0),this.isActive?(this.input.connect(this.compressor),this.compressor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"threshold":return this.compressor.threshold.value;case"knee":return this.compressor.knee.value;case"ratio":return this.compressor.ratio.value;case"attack":return this.compressor.attack.value;case"release":return this.compressor.release.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"threshold":"number"==typeof s&&(this.compressor.threshold.value=s);break;case"knee":"number"==typeof s&&(this.compressor.knee.value=s);break;case"ratio":"number"==typeof s&&(this.compressor.ratio.value=s);break;case"attack":"number"==typeof s&&(this.compressor.attack.value=s);break;case"release":"number"==typeof s&&(this.compressor.release.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,threshold:this.compressor.threshold.value,knee:this.compressor.knee.value,ratio:this.compressor.ratio.value,attack:this.compressor.attack.value,release:this.compressor.release.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Compressor=s},4535:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Delay=void 0;var s=function(t){function e(r){var n=t.call(this,r,0)||this;return n.delay=r.createDelay(e.MAX_DELAY_TIME),n.dry=r.createGain(),n.wet=r.createGain(),n.tone=r.createBiquadFilter(),n.feedback=r.createGain(),n.delay.delayTime.value=0,n.dry.gain.value=1,n.wet.gain.value=0,n.tone.type="lowpass",n.tone.frequency.value=350,n.tone.Q.value=Math.SQRT1_2,n.tone.gain.value=0,n.feedback.gain.value=0,n.deactivate(),n}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.delay.disconnect(0),this.dry.disconnect(0),this.wet.disconnect(0),this.tone.disconnect(0),this.feedback.disconnect(0),this.isActive?(this.input.connect(this.dry),this.dry.connect(this.output),this.input.connect(this.tone),this.tone.connect(this.delay),this.delay.connect(this.wet),this.wet.connect(this.output),this.delay.connect(this.feedback),this.feedback.connect(this.delay)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"time":return this.delay.delayTime.value;case"dry":return this.dry.gain.value;case"wet":return this.wet.gain.value;case"tone":return this.tone.frequency.value;case"feedback":return this.feedback.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"time":"number"==typeof s&&(this.delay.delayTime.value=s);break;case"dry":"number"==typeof s&&(this.dry.gain.value=s);break;case"wet":"number"==typeof s&&(this.wet.gain.value=s);break;case"tone":"number"==typeof s&&(this.tone.frequency.value=s);break;case"feedback":"number"==typeof s&&(this.feedback.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,time:this.delay.delayTime.value,dry:this.dry.gain.value,wet:this.wet.gain.value,tone:this.tone.frequency.value,feedback:this.feedback.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.MAX_DELAY_TIME=5,e}(r(1643).Effector);e.Delay=s},1605:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Distortion=e.Cabinet=e.PostEqualizer=e.PreEqualizer=void 0;var s=r(1643),o=function(t){function e(e){var r=t.call(this,e,0)||this;return r.preAmp=e.createWaveShaper(),r.gain=e.createGain(),r.leadGain=e.createGain(),r.lowpass=e.createBiquadFilter(),r.highpass1=e.createBiquadFilter(),r.highpass2=e.createBiquadFilter(),r.highpass3=e.createBiquadFilter(),r.gain.gain.value=.5,r.leadGain.gain.value=.5,r.lowpass.type="lowpass",r.lowpass.frequency.value=3200,r.lowpass.Q.value=Math.SQRT1_2,r.lowpass.gain.value=0,r.highpass1.type="highpass",r.highpass1.frequency.value=80,r.highpass1.Q.value=Math.SQRT1_2,r.highpass1.gain.value=0,r.highpass2.type="highpass",r.highpass2.frequency.value=640,r.highpass2.Q.value=Math.SQRT1_2,r.highpass2.gain.value=0,r.highpass3.type="highpass",r.highpass3.frequency.value=80,r.highpass3.Q.value=Math.SQRT1_2,r.highpass3.gain.value=0,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.isActive?(this.input.connect(this.highpass1),this.highpass1.connect(this.gain),this.gain.connect(this.highpass3),this.input.connect(this.highpass2),this.highpass2.connect(this.leadGain),this.leadGain.connect(this.highpass3),this.highpass3.connect(this.preAmp),this.preAmp.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"curve":return this.preAmp.curve;case"gain":return this.gain.gain.value;case"lead":return this.leadGain.gain.value;default:return}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(s?this.activate():this.deactivate());break;case"curve":"number"!=typeof s&&"boolean"!=typeof s&&(this.preAmp.curve=s);break;case"gain":"number"==typeof s&&(this.gain.gain.value=s);break;case"lead":"number"==typeof s&&(this.leadGain.gain.value=s)}}},e.prototype.params=function(){return{state:this.isActive,curve:this.preAmp.curve,gain:this.gain.gain.value,lead:this.leadGain.gain.value}},e}(s.Effector);e.PreEqualizer=o;var a=function(t){function e(e){var r=t.call(this,e,0)||this;return r.distortion=e.createWaveShaper(),r.bass=e.createBiquadFilter(),r.middle=e.createBiquadFilter(),r.treble=e.createBiquadFilter(),r.bass.type="lowshelf",r.middle.type="peaking",r.treble.type="highshelf",r.bass.frequency.value=240,r.middle.frequency.value=500,r.treble.frequency.value=1600,r.bass.Q.value=Math.SQRT1_2,r.middle.Q.value=Math.SQRT1_2,r.treble.Q.value=Math.SQRT1_2,r.bass.gain.value=0,r.middle.gain.value=0,r.treble.gain.value=0,r.lowpass=e.createBiquadFilter(),r.highpass=e.createBiquadFilter(),r.lowpass.type="lowpass",r.lowpass.frequency.value=24e3,r.lowpass.Q.value=Math.SQRT1_2,r.lowpass.gain.value=0,r.highpass.type="highpass",r.highpass.frequency.value=40,r.highpass.Q.value=Math.SQRT1_2,r.highpass.gain.value=0,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.isActive?(this.input.connect(this.lowpass),this.lowpass.connect(this.highpass),this.highpass.connect(this.distortion),this.distortion.connect(this.bass),this.bass.connect(this.middle),this.middle.connect(this.treble),this.treble.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"curve":return this.distortion.curve;case"bass":return this.bass.gain.value;case"middle":return this.middle.gain.value;case"treble":return this.treble.gain.value;case"frequency":return this.middle.frequency.value;default:return}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(s?this.activate():this.deactivate());break;case"curve":"number"!=typeof s&&"boolean"!=typeof s&&(this.distortion.curve=s);break;case"bass":"number"==typeof s&&(this.bass.gain.value=s);break;case"middle":"number"==typeof s&&(this.middle.gain.value=s);break;case"treble":"number"==typeof s&&(this.treble.gain.value=s);break;case"frequency":"number"==typeof s&&(this.middle.frequency.value=s)}}},e.prototype.params=function(){return{state:this.isActive,curve:this.distortion.curve,bass:this.bass.gain.value,middle:this.middle.gain.value,treble:this.treble.gain.value,frequency:this.middle.frequency.value}},e}(s.Effector);e.PostEqualizer=a;var c=function(t){function e(e){var r=t.call(this,e,0)||this;return r.lowpass=e.createBiquadFilter(),r.notch=e.createBiquadFilter(),r.lowpass.type="lowpass",r.lowpass.frequency.value=3200,r.lowpass.Q.value=6,r.lowpass.gain.value=0,r.notch.type="notch",r.notch.frequency.value=8e3,r.notch.Q.value=1,r.notch.gain.value=0,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.isActive?(this.input.connect(this.notch),this.notch.connect(this.lowpass),this.lowpass.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)return"state"===t?this.isActive:void 0;for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];if("state"===i)"boolean"==typeof s&&(s?this.activate():this.deactivate())}},e.prototype.params=function(){return{state:this.isActive}},e}(s.Effector);e.Cabinet=c;var u=function(t){function e(e){var r=t.call(this,e,0)||this;return r.numberOfSamples=256,r.preEQ=new o(e),r.postEQ=new a(e),r.cabinet=new c(e),r.type="clean",r.param({curve:"clean"}),r.deactivate(),r}return i(e,t),e.createCurve=function(t,e){var r=Math.trunc((e-1)/2),n=new Float32Array(e),i=(Math.pow(10,t/5-1)-.1)/5+1,s=.4;1===i?s=1:i>1&&i<1.04&&(s=-15.5*i+16.52);for(var o=0;o<r;o++)n[r+o]=s*(1-Math.pow(i,-o)+o*Math.pow(i,-r)/r),n[r-o]=s*(-1+Math.pow(i,-o)-o*Math.pow(i,-r)/r);return n[r]=0,n},e.prototype.connect=function(){return this.input.disconnect(0),this.isActive?(this.input.connect(this.preEQ.INPUT),this.preEQ.OUTPUT.connect(this.postEQ.INPUT),this.postEQ.OUTPUT.connect(this.cabinet.INPUT),this.cabinet.OUTPUT.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"curve":return this.type;case"samples":return this.numberOfSamples;case"pre":return this.preEQ.params();case"post":return this.postEQ.params();case"cabinet":return this.cabinet.params();default:return this}for(var r=0,n=Object.entries(t);r<n.length;r++){var i=n[r],s=i[0],o=i[1];switch(s){case"state":"boolean"==typeof o&&(this.isActive=o);break;case"curve":var a=null;switch(o){case"clean":this.type="clean",a=e.createCurve(0,this.numberOfSamples);break;case"crunch":this.type="crunch",a=e.createCurve(3,this.numberOfSamples);break;case"overdrive":this.type="overdrive",a=e.createCurve(5,this.numberOfSamples);break;case"distortion":this.type="distortion",a=e.createCurve(8,this.numberOfSamples);break;case"fuzz":this.type="fuzz",a=e.createCurve(10,this.numberOfSamples);break;default:o instanceof Float32Array&&(a=o)}this.preEQ.param({curve:a}),this.postEQ.param({curve:a});break;case"samples":"number"==typeof o&&(this.numberOfSamples=o);break;case"pre":"object"==typeof o&&this.preEQ.param(o);break;case"post":"object"==typeof o&&this.postEQ.param(o);break;case"cabinet":"object"==typeof o&&this.cabinet.param(o)}}return this},e.prototype.params=function(){return{state:this.isActive,curve:this.type,samples:this.numberOfSamples,pre:this.preEQ.params(),post:this.postEQ.params(),cabinet:this.cabinet.params()}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(s.Effector);e.Distortion=u},1643:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Effector=void 0;var r=function(){function t(t,e){this.isActive=!0,this.paused=!0,this.context=t,this.input=t.createGain(),this.output=t.createGain(),this.lfo=t.createOscillator(),this.depth=t.createGain(),this.rate=this.lfo.frequency,this.processor=t.createScriptProcessor(e,2,2)}return t.prototype.start=function(t){this.isActive&&this.paused&&(this.lfo.start(null!=t?t:this.context.currentTime),this.paused=!1)},t.prototype.stop=function(t,e){if(this.isActive&&!this.paused){var r=this.lfo.type,n=this.lfo.frequency.value;this.lfo.stop((null!=t?t:this.context.currentTime)+(null!=e?e:0)),this.lfo=this.context.createOscillator(),this.lfo.type=r,this.lfo.frequency.value=n,this.rate=this.lfo.frequency,this.paused=!0}},t.prototype.toJSON=function(){return JSON.stringify(this.params())},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this.connect(),this.start(0),this},t.prototype.deactivate=function(){return this.stop(0),this.isActive=!1,this.connect(),this},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.input},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.output},enumerable:!1,configurable:!0}),t}();e.Effector=r},8137:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EnvelopeGenerator=void 0;var r=function(){function t(t){this.generators=[],this.activeIndexes=[],this.activeCounter=0,this.attack=.01,this.decay=.3,this.sustain=.5,this.release=1,this.isActive=!0,this.context=t}return t.prototype.ready=function(t,e,r){e&&r&&this.generators[t]?(e.connect(this.generators[t]),this.generators[t].connect(r)):e&&null===r&&this.generators[t]?e.connect(this.generators[t]):null===e&&r&&this.generators[t]&&this.generators[t].connect(r),this.activeIndexes[t]=t,this.activeCounter++},t.prototype.start=function(t){for(var e=t,r=e+this.attack,n=this.decay,i=this.sustain,s=0,o=this.activeIndexes;s<o.length;s++){var a=o[s];void 0!==a&&(this.isActive?(this.generators[a].gain.cancelScheduledValues(e),this.generators[a].gain.setValueAtTime(0,e),this.generators[a].gain.linearRampToValueAtTime(1,r),this.generators[a].gain.setTargetAtTime(i,r,n)):this.generators[a].gain.value=1)}},t.prototype.stop=function(t,e){for(var r=t-this.release,n=r>=this.context.currentTime?r:this.context.currentTime,i=this.release,s=0,o=this.activeIndexes;s<o.length;s++){var a=o[s];void 0!==a&&(this.isActive?(this.generators[a].gain.cancelScheduledValues(n),e?this.generators[a].gain.setValueCurveAtTime(new Float32Array([1,.5,.25,0]),n,i):this.generators[a].gain.setTargetAtTime(0,n,i)):this.generators[a].gain.value=0)}},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"attack":return this.attack;case"decay":return this.decay;case"sustain":return this.sustain;case"release":return this.release;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"attack":"number"==typeof s&&(this.attack=s);break;case"decay":"number"==typeof s&&(this.decay=s);break;case"sustain":"number"==typeof s&&(this.sustain=s);break;case"release":"number"==typeof s&&(this.release=s)}}return this},t.prototype.getGenerator=function(t){return t>=0&&t<this.generators.length?this.generators[t]:null},t.prototype.setGenerator=function(t){this.generators[t]=this.context.createGain()},t.prototype.paused=function(){for(var e=0,r=0,n=this.activeIndexes;r<n.length;r++){var i=n[r];if(void 0!==i){if(this.generators[i].gain.value>t.MIN_GAIN)return!1;if(++e===this.activeCounter)return!0}}return!1},t.prototype.clear=function(t){this.activeIndexes.length=0,this.activeCounter=0;for(var e=0,r=this.generators;e<r.length;e++){var n=r[e];n.gain.cancelScheduledValues(this.context.currentTime),n.gain.value=1,t&&n.disconnect(0)}},t.prototype.params=function(){return{state:this.isActive,attack:this.attack,decay:this.decay,sustain:this.sustain,release:this.release}},t.prototype.toJSON=function(){return JSON.stringify(this.params())},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this},t.prototype.deactivate=function(){return this.isActive=!1,this},t.MIN_GAIN=.001,t}();e.EnvelopeGenerator=r},111:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Equalizer=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.bass=e.createBiquadFilter(),r.middle=e.createBiquadFilter(),r.treble=e.createBiquadFilter(),r.presence=e.createBiquadFilter(),r.bass.type="lowshelf",r.middle.type="peaking",r.treble.type="highshelf",r.presence.type="highshelf",r.bass.frequency.value=500,r.middle.frequency.value=1e3,r.treble.frequency.value=2e3,r.presence.frequency.value=4e3,r.bass.Q.value=Math.SQRT1_2,r.middle.Q.value=Math.SQRT1_2,r.treble.Q.value=Math.SQRT1_2,r.presence.Q.value=Math.SQRT1_2,r.bass.gain.value=0,r.middle.gain.value=0,r.treble.gain.value=0,r.presence.gain.value=0,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.bass.disconnect(0),this.middle.disconnect(0),this.treble.disconnect(0),this.presence.disconnect(0),this.isActive?(this.input.connect(this.bass),this.bass.connect(this.middle),this.middle.connect(this.treble),this.treble.connect(this.presence),this.presence.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"bass":return this.bass.gain.value;case"middle":return this.middle.gain.value;case"treble":return this.treble.gain.value;case"presence":return this.presence.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"bass":"number"==typeof s&&(this.bass.gain.value=s);break;case"middle":"number"==typeof s&&(this.middle.gain.value=s);break;case"treble":"number"==typeof s&&(this.treble.gain.value=s);break;case"presence":"number"==typeof s&&(this.presence.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,bass:this.bass.gain.value,middle:this.middle.gain.value,treble:this.treble.gain.value,presence:this.presence.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Equalizer=s},7369:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Filter=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.range=.1,r.attack=.01,r.decay=.3,r.sustain=1,r.release=1,r.filter=e.createBiquadFilter(),r.filter.type="lowpass",r.filter.frequency.value=350,r.filter.Q.value=1,r.filter.gain.value=0,r.maxFrequency=r.filter.frequency.value,r.deactivate(),r}return i(e,t),e.prototype.start=function(t){if(this.isActive){var e=null!=t?t:this.context.currentTime,r=e+this.attack,n=this.decay,i=this.sustain*this.maxFrequency,s=this.maxFrequency*this.range;this.filter.frequency.cancelScheduledValues(e),this.filter.frequency.setValueAtTime(s,e),this.filter.frequency.linearRampToValueAtTime(this.maxFrequency,r),this.filter.frequency.setTargetAtTime(i,r,n)}},e.prototype.stop=function(t){if(this.isActive){var e=null!=t?t:this.context.currentTime,r=this.release,n=this.maxFrequency*this.range;this.filter.frequency.cancelScheduledValues(e),this.filter.frequency.setValueAtTime(this.filter.frequency.value,e),this.filter.frequency.setTargetAtTime(n,e,r)}},e.prototype.connect=function(){return this.input.disconnect(0),this.filter.disconnect(0),this.isActive?(this.input.connect(this.filter),this.filter.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"type":return this.filter.type;case"frequency":return this.filter.frequency.value;case"Q":return this.filter.Q.value;case"gain":return this.filter.gain.value;case"range":return this.range;case"attack":return this.attack;case"decay":return this.decay;case"sustain":return this.sustain;case"release":return this.release;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"type":"string"==typeof s&&(this.filter.type=s);break;case"frequency":"number"==typeof s&&(this.filter.frequency.value=s,this.maxFrequency=s);break;case"Q":"number"==typeof s&&(this.filter.Q.value=s);break;case"gain":"number"==typeof s&&(this.filter.gain.value=s);break;case"range":"number"==typeof s&&(this.range=s);break;case"attack":"number"==typeof s&&(this.attack=s);break;case"decay":"number"==typeof s&&(this.decay=s);break;case"sustain":"number"==typeof s&&(this.sustain=s);break;case"release":"number"==typeof s&&(this.release=s)}}return this},e.prototype.params=function(){return{state:this.isActive,type:this.filter.type,frequency:this.filter.frequency.value,Q:this.filter.Q.value,gain:this.filter.gain.value,range:this.range,attack:this.attack,decay:this.decay,sustain:this.sustain,release:this.release}},e.prototype.activate=function(){return this.isActive=!0,this.connect(),this},e.prototype.deactivate=function(){return this.isActive=!1,this.connect(),this},e}(r(1643).Effector);e.Filter=s},6548:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Flanger=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.depthRate=0,r.delay=e.createDelay(),r.mix=e.createGain(),r.tone=e.createBiquadFilter(),r.feedback=e.createGain(),r.delay.delayTime.value=0,r.depth.gain.value=0,r.rate.value=0,r.mix.gain.value=0,r.tone.type="lowpass",r.tone.frequency.value=350,r.tone.Q.value=Math.SQRT1_2,r.tone.gain.value=0,r.feedback.gain.value=0,r.depthRate=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.delay.delayTime),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.delay.delayTime))},e.prototype.connect=function(){return this.input.disconnect(0),this.delay.disconnect(0),this.mix.disconnect(0),this.tone.disconnect(0),this.feedback.disconnect(0),this.input.connect(this.output),this.isActive&&(this.input.connect(this.tone),this.tone.connect(this.delay),this.delay.connect(this.mix),this.mix.connect(this.output),this.delay.connect(this.feedback),this.feedback.connect(this.delay)),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"time":return this.delay.delayTime.value;case"depth":return this.depthRate;case"rate":return this.rate.value;case"mix":return this.mix.gain.value;case"tone":return this.tone.frequency.value;case"feedback":return this.feedback.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"time":"number"==typeof s&&(this.delay.delayTime.value=s,this.depth.gain.value=this.delay.delayTime.value*this.depthRate);break;case"depth":"number"==typeof s&&(this.depthRate=s,this.depth.gain.value=this.delay.delayTime.value*s);break;case"rate":"number"==typeof s&&(this.rate.value=s);break;case"mix":"number"==typeof s&&(this.mix.gain.value=s);break;case"tone":"number"==typeof s&&(this.tone.frequency.value=s);break;case"feedback":"number"==typeof s&&(this.feedback.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,time:this.delay.delayTime.value,depth:this.depthRate,rate:this.rate.value,mix:this.mix.gain.value,tone:this.tone.frequency.value,feedback:this.feedback.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Flanger=s},4226:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Listener=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.listener=e.listener,r.positions={x:0,y:0,z:0},r.forwards={x:0,y:0,z:-1},r.ups={x:0,y:1,z:0},r.listener.setPosition(r.positions.x,r.positions.y,r.positions.z),r.listener.setOrientation(r.forwards.x,r.forwards.y,r.forwards.z,r.ups.x,r.ups.y,r.ups.z),r}return i(e,t),e.prototype.connect=function(){return this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"x":return this.positions.x;case"y":return this.positions.y;case"z":return this.positions.z;case"fx":return this.forwards.x;case"fy":return this.forwards.y;case"fz":return this.forwards.z;case"ux":return this.ups.x;case"uy":return this.ups.y;case"uz":return this.ups.z;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"x":"number"==typeof s&&(this.positions.x=s,this.listener.setPosition(this.positions.x,this.positions.y,this.positions.z));break;case"y":"number"==typeof s&&(this.positions.y=s,this.listener.setPosition(this.positions.x,this.positions.y,this.positions.z));break;case"z":"number"==typeof s&&(this.positions.z=s,this.listener.setPosition(this.positions.x,this.positions.y,this.positions.z));break;case"fx":"number"==typeof s&&(this.forwards.x=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"fy":"number"==typeof s&&(this.forwards.y=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"fz":"number"==typeof s&&(this.forwards.z=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"ux":"number"==typeof s&&(this.ups.x=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"uy":"number"==typeof s&&(this.ups.y=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"uz":"number"==typeof s&&(this.ups.z=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z))}}return this},e.prototype.params=function(){return{x:this.positions.x,y:this.positions.y,z:this.positions.z,fx:this.forwards.x,fy:this.forwards.y,fz:this.forwards.z,ux:this.ups.x,uy:this.ups.y,uz:this.ups.z}},e}(r(1643).Effector);e.Listener=s},610:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.NoiseGate=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.level=0,r.activate(),r}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var e=this.processor.bufferSize;this.processor.onaudioprocess=function(r){for(var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1),a=0;a<e;a++)s[a]=t.gate(n[a]),o[a]=t.gate(i[a])}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.processor.disconnect(0),this.isActive?(this.input.connect(this.processor),this.processor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"level":return this.level;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"level":"number"==typeof s&&(this.level=s)}}return this},e.prototype.params=function(){return{state:this.isActive,level:this.level}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.gate=function(t){return this.isActive?Math.abs(t)>this.level?t:0:t},e}(r(1643).Effector);e.NoiseGate=s},2187:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.NoiseSuppressor=void 0;var s=r(999),o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.threshold=0,n.activate(),n}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var e=this.processor.bufferSize;this.processor.onaudioprocess=function(r){var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1);t.suppress(n,s,e),t.suppress(i,o,e)}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.processor.disconnect(0),this.isActive?(this.input.connect(this.processor),this.processor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"threshold":return this.threshold;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"threshold":"number"==typeof s&&s>=0&&(this.threshold=s)}}return this},e.prototype.params=function(){return{state:this.isActive,threshold:this.threshold}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.suppress=function(t,e,r){if(this.isActive&&0!==this.threshold){var n=new Float32Array(t),i=new Float32Array(r),o=new Float32Array(r),a=new Float32Array(r),c=new Float32Array(r),u=new Float32Array(r);(0,s.fft)(n,i,r);for(var l=0;l<r;l++)c[l]=Math.sqrt(Math.pow(n[l],2)+Math.pow(i[l],2)),0!==n[l]&&0!==i[l]&&(u[l]=Math.atan2(i[l],n[l]));for(l=0;l<r;l++)c[l]-=this.threshold,c[l]<0&&(c[l]=0);for(l=0;l<r;l++)o[l]=c[l]*Math.cos(u[l]),a[l]=c[l]*Math.sin(u[l]);(0,s.ifft)(o,a,r),e.set(o)}else e.set(t)},e}(r(1643).Effector);e.NoiseSuppressor=o},3751:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Panner=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.panner=e.createPanner(),r.positions={x:0,y:0,z:0},r.orientations={x:1,y:0,z:0},r.panner.refDistance=1,r.panner.maxDistance=1e4,r.panner.rolloffFactor=1,r.panner.coneInnerAngle=360,r.panner.coneOuterAngle=360,r.panner.coneOuterGain=0,r.panner.panningModel="HRTF",r.panner.distanceModel="inverse",r.panner.positionX.value=r.positions.x,r.panner.positionY.value=r.positions.y,r.panner.positionZ.value=r.positions.z,r.panner.orientationX.value=r.orientations.x,r.panner.orientationY.value=r.orientations.y,r.panner.orientationZ.value=r.orientations.z,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.panner.disconnect(0),this.isActive?(this.input.connect(this.panner),this.panner.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"x":return this.panner.positionX.value;case"y":return this.panner.positionY.value;case"z":return this.panner.positionZ.value;case"ox":return this.panner.orientationX.value;case"oy":return this.panner.orientationY.value;case"oz":return this.panner.orientationZ.value;case"refDistance":return this.panner.refDistance;case"maxDistance":return this.panner.maxDistance;case"rolloffFactor":return this.panner.rolloffFactor;case"coneInnerAngle":return this.panner.coneInnerAngle;case"coneOuterAngle":return this.panner.coneOuterAngle;case"coneOuterGain":return this.panner.coneOuterGain;case"panningModel":return this.panner.panningModel;case"distanceModel":return this.panner.distanceModel;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"x":"number"==typeof s&&(this.panner.positionX.value=s);break;case"y":"number"==typeof s&&(this.panner.positionY.value=s);break;case"z":"number"==typeof s&&(this.panner.positionZ.value=s);break;case"ox":"number"==typeof s&&(this.panner.orientationX.value=s);break;case"oy":"number"==typeof s&&(this.panner.orientationY.value=s);break;case"oz":"number"==typeof s&&(this.panner.orientationZ.value=s);break;case"refDistance":"number"==typeof s&&(this.panner.refDistance=s);break;case"maxDistance":"number"==typeof s&&(this.panner.maxDistance=s);break;case"rolloffFactor":"number"==typeof s&&(this.panner.rolloffFactor=s);break;case"coneInnerAngle":"number"==typeof s&&(this.panner.coneInnerAngle=s);break;case"coneOuterAngle":"number"==typeof s&&(this.panner.coneOuterAngle=s);break;case"coneOuterGain":"number"==typeof s&&(this.panner.coneOuterGain=s);break;case"panningModel":"HRTF"!==s&&"equalpower"!==s||(this.panner.panningModel=s);break;case"distanceModel":"linear"!==s&&"inverse"!==s&&"exponential"!==s||(this.panner.distanceModel=s)}}return this},e.prototype.params=function(){return{state:this.isActive,x:this.positions.x,y:this.positions.y,z:this.positions.z,ox:this.orientations.x,oy:this.orientations.y,oz:this.orientations.z,refDistance:this.panner.refDistance,maxDistance:this.panner.maxDistance,rolloffFactor:this.panner.rolloffFactor,coneInnerAngle:this.panner.coneInnerAngle,coneOuterAngle:this.panner.coneOuterAngle,coneOuterGain:this.panner.coneOuterGain,panningModel:this.panner.panningModel,distanceModel:this.panner.distanceModel}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Panner=s},2393:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Phaser=void 0;var s=function(t){function e(r){var n=t.call(this,r,0)||this;n.numberOfStages=12,n.filters=[],n.depthRate=0;for(var i=0;i<e.MAX_STAGES;i++){var s=r.createBiquadFilter();s.type="allpass",s.frequency.value=350,s.Q.value=1,s.gain.value=0,n.filters.push(s)}n.mix=r.createGain(),n.depth.gain.value=0,n.rate.value=0,n.mix.gain.value=0,n.deactivate(),n.lfo.connect(n.depth);for(i=0;i<e.MAX_STAGES;i++)n.depth.connect(n.filters[i].frequency);return n}return i(e,t),e.prototype.stop=function(r,n){if(t.prototype.stop.call(this,r,n),this.isActive){this.lfo.connect(this.depth);for(var i=0;i<e.MAX_STAGES;i++)this.depth.connect(this.filters[i].frequency)}},e.prototype.connect=function(){this.input.disconnect(0);for(var t=0;t<e.MAX_STAGES;t++)this.filters[t].disconnect(0);if(this.mix.disconnect(0),this.input.connect(this.output),this.isActive&&this.numberOfStages>0){this.input.connect(this.filters[0]);for(t=0;t<this.numberOfStages;t++)t<this.numberOfStages-1?this.filters[t].connect(this.filters[t+1]):(this.filters[t].connect(this.mix),this.mix.connect(this.output))}return this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"stage":return this.numberOfStages;case"frequency":return this.filters[0].frequency.value;case"resonance":return this.filters[0].Q.value;case"depth":return this.depthRate;case"rate":return this.rate.value;case"mix":return this.mix.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"stage":switch(s){case 0:case 2:case 4:case 8:case 12:case 24:this.numberOfStages=s,this.connect()}break;case"frequency":if("number"==typeof s){for(var o=0,a=this.filters;o<a.length;o++){a[o].frequency.value=s}this.depth.gain.value=s*this.depthRate}break;case"resonance":if("number"==typeof s)for(var c=0,u=this.filters;c<u.length;c++){u[c].Q.value=s}break;case"depth":"number"==typeof s&&(this.depthRate=s,this.depth.gain.value=this.filters[0].frequency.value*s);break;case"rate":"number"==typeof s&&(this.rate.value=s);break;case"mix":"number"==typeof s&&(this.mix.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,stage:this.numberOfStages,frequency:this.filters[0].frequency.value,resonance:this.filters[0].Q.value,depth:this.depthRate,rate:this.rate.value,mix:this.mix.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.MAX_STAGES=24,e}(r(1643).Effector);e.Phaser=s},4833:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.PitchShifter=void 0;var s=r(999),o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.pitch=1,n.deactivate(),n.connect(),n}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var r=this.processor.bufferSize;this.processor.onaudioprocess=function(n){var i=n.inputBuffer.getChannelData(0),o=n.inputBuffer.getChannelData(1),a=n.outputBuffer.getChannelData(0),c=n.outputBuffer.getChannelData(1);if(t.isActive&&1!==t.pitch){var u=new Float32Array(i),l=new Float32Array(o),h=new Float32Array(r),p=new Float32Array(r);(0,s.fft)(u,h,r),(0,s.fft)(l,p,r);for(var f=new Float32Array(r),d=new Float32Array(r),v=new Float32Array(r),y=new Float32Array(r),m=0;m<r;m++){var b=Math.trunc(t.pitch*m),g=1;m>r/2&&(g=0),b>=0&&b<r&&(f[b]+=e.GAIN_CORRECTION*g*u[m],v[b]+=e.GAIN_CORRECTION*g*h[m],d[b]+=e.GAIN_CORRECTION*g*l[m],y[b]+=e.GAIN_CORRECTION*g*p[m])}(0,s.ifft)(f,v,r),(0,s.ifft)(d,y,r),a.set(f),c.set(d)}else a.set(i),c.set(o)}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.processor.disconnect(0),this.isActive?(this.input.connect(this.processor),this.processor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"pitch":return this.pitch;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"pitch":"number"==typeof s&&s>0&&(this.pitch=s)}}return this},e.prototype.params=function(){return{state:this.isActive,pitch:this.pitch}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.GAIN_CORRECTION=2,e}(r(1643).Effector);e.PitchShifter=o},1063:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Reverb=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.rirs=[],r.loadError=!1,r.convolver=e.createConvolver(),r.dry=e.createGain(),r.wet=e.createGain(),r.tone=e.createBiquadFilter(),r.dry.gain.value=1,r.wet.gain.value=0,r.tone.type="lowpass",r.tone.frequency.value=350,r.tone.Q.value=Math.SQRT1_2,r.tone.gain.value=0,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.convolver.disconnect(0),this.dry.disconnect(0),this.wet.disconnect(0),this.tone.disconnect(0),this.isActive?(this.input.connect(this.dry),this.dry.connect(this.output),this.input.connect(this.tone),this.tone.connect(this.convolver),this.convolver.connect(this.wet),this.wet.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"buffer":return this.convolver.buffer;case"dry":return this.dry.gain.value;case"wet":return this.wet.gain.value;case"tone":return this.tone.frequency.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"buffer":"number"==typeof s?s>=0&&s<this.rirs.length&&(this.convolver.buffer=this.rirs[s],this.connect()):s instanceof AudioBuffer?(this.convolver.buffer=s,this.connect()):null===s&&(this.convolver.buffer=null,this.input.disconnect(0),this.input.connect(this.output));break;case"dry":"number"==typeof s&&(this.dry.gain.value=s);break;case"wet":"number"==typeof s&&(this.wet.gain.value=s);break;case"tone":"number"==typeof s&&(this.tone.frequency.value=s)}}return this},e.prototype.add=function(t,e){var r=this;if(t instanceof AudioBuffer)this.convolver.buffer=t,this.rirs.push(t);else if(t instanceof ArrayBuffer){this.context.decodeAudioData(t,(function(t){r.convolver.buffer=t,r.rirs.push(t)}),null!=e?e:function(){})}return this},e.prototype.preset=function(t){for(var e=t.rirs,r=t.timeout,n=t.successCallback,i=t.errorCallback,s=t.progressCallback,o=0,a=e.length;o<a;o++){var c=e[o];"string"==typeof c?this.load({rir:c,index:o,timeout:r,successCallback:n,errorCallback:i,progressCallback:s}):this.rirs[o]=c}},e.prototype.params=function(){return{state:this.isActive,dry:this.dry.gain.value,wet:this.wet.gain.value,tone:this.tone.frequency.value}},e.prototype.activate=function(){return this.isActive=!0,this.connect(),this},e.prototype.deactivate=function(){return this.isActive=!1,this.connect(),this},e.prototype.load=function(t){var e=this,r=t.rir,n=t.index,i=t.timeout,s=t.successCallback,o=t.errorCallback,a=t.progressCallback,c=new XMLHttpRequest;c.timeout=null!=i?i:6e4,c.ontimeout=function(t){!e.loadError&&o&&o(t,"timeout"),e.loadError=!0},c.onprogress=function(t){e.loadError?c.abort():a&&a(t)},c.onerror=function(t){!e.loadError&&o&&o(t,"error"),e.loadError=!0},c.onload=function(t){if(200===c.status){var r=c.response;e.context.decodeAudioData(r,(function(r){e.rirs[n]=r;for(var i=0,o=e.rirs;i<o.length;i++){if(void 0===o[i])return}s&&s(t)}),(function(t){o&&o(t,"decode")}))}},c.open("GET",r,!0),c.responseType="arraybuffer",c.send(null)},e}(r(1643).Effector);e.Reverb=s},7223:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Ringmodulator=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.amplitude=e.createGain(),r.amplitude.gain.value=0,r.depth.gain.value=1,r.rate.value=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.amplitude.gain),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.amplitude.gain))},e.prototype.connect=function(){return this.input.disconnect(0),this.amplitude.disconnect(0),this.isActive?(this.input.connect(this.amplitude),this.amplitude.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"depth":return this.depth.gain.value;case"rate":return this.rate.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"depth":"number"==typeof s&&(this.depth.gain.value=s);break;case"rate":"number"==typeof s&&(this.rate.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,depth:this.depth.gain.value,rate:this.rate.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Ringmodulator=s},8976:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Stereo=void 0;var s=function(t){function e(r,n){var i=t.call(this,r,n)||this;return i.splitter=r.createChannelSplitter(2),i.merger=r.createScriptProcessor(n,2,2),i.delayL=r.createDelay(e.MAX_DELAY_TIME),i.delayR=r.createDelay(e.MAX_DELAY_TIME),i.delayL.delayTime.value=0,i.delayR.delayTime.value=0,i.deactivate(),i}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var e=this.processor.bufferSize;this.processor.onaudioprocess=function(r){var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1);if(t.isActive&&0!==t.delayL.delayTime.value&&0!==t.delayR.delayTime.value)for(var a=0;a<e;a++)s[a]=n[a],o[a]=-i[a];else s.set(n),o.set(i)}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.splitter.disconnect(0),this.delayL.disconnect(0),this.delayR.disconnect(0),this.merger.disconnect(0),this.isActive?(this.input.connect(this.splitter),this.splitter.connect(this.delayL,0,0),this.splitter.connect(this.delayR,1,0),this.delayL.connect(this.merger),this.delayR.connect(this.merger),this.merger.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"time":return this.delayL.delayTime.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"time":"number"==typeof s&&(this.delayL.delayTime.value=s,this.delayR.delayTime.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,time:this.delayL.delayTime.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.MAX_DELAY_TIME=1,e}(r(1643).Effector);e.Stereo=s},4979:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Tremolo=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.amplitude=e.createGain(),r.amplitude.gain.value=1,r.lfo.type="sine",r.depth.gain.value=0,r.rate.value=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.amplitude.gain),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.amplitude.gain))},e.prototype.connect=function(){return this.input.disconnect(0),this.amplitude.disconnect(0),this.isActive?(this.input.connect(this.amplitude),this.amplitude.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"type":return this.lfo.type;case"depth":return this.depth.gain.value;case"rate":return this.rate.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"type":"string"==typeof s&&(this.lfo.type=s);break;case"depth":"number"==typeof s&&(this.depth.gain.value=s);break;case"rate":"number"==typeof s&&(this.rate.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,type:this.lfo.type,depth:this.depth.gain.value,rate:this.rate.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Tremolo=s},3449:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.VocalCanceler=void 0;var s=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.depth.gain.value=0,n.activate(),n}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var e=this.processor.bufferSize;this.processor.onaudioprocess=function(r){for(var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1),a=0;a<e;a++)s[a]=t.cancel(n[a],i[a]),o[a]=t.cancel(i[a],n[a])}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.processor.disconnect(0),this.isActive?(this.input.connect(this.processor),this.processor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"depth":return this.depth.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"depth":"number"==typeof s&&(this.depth.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,depth:this.depth.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.cancel=function(t,e){return this.isActive?t-this.depth.gain.value*e:t},e}(r(1643).Effector);e.VocalCanceler=s},6813:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Wah=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.auto=!1,r.depthRate=0,r.lowpass=e.createBiquadFilter(),r.envelopeFollower=e.createWaveShaper(),r.sensitivity=e.createBiquadFilter(),r.lowpass.type="lowpass",r.lowpass.frequency.value=r.auto?20:350,r.lowpass.Q.value=1,r.lowpass.gain.value=0,r.envelopeFollower.curve=new Float32Array([1,0,1]),r.sensitivity.type="lowpass",r.sensitivity.frequency.value=350,r.sensitivity.Q.value=1,r.sensitivity.gain.value=0,r.depth.gain.value=0,r.rate.value=0,r.deactivate(),r.connect(),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),!this.auto&&this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.lowpass.frequency))},e.prototype.connect=function(){return this.input.disconnect(0),this.sensitivity.disconnect(0),this.envelopeFollower.disconnect(0),this.lowpass.disconnect(0),this.depth.disconnect(0),this.isActive?this.auto?(this.input.connect(this.sensitivity),this.sensitivity.connect(this.output),this.input.connect(this.envelopeFollower),this.envelopeFollower.connect(this.lowpass),this.lowpass.connect(this.depth),this.depth.connect(this.sensitivity.frequency)):(this.input.connect(this.lowpass),this.lowpass.connect(this.output),this.lfo.connect(this.depth),this.depth.connect(this.lowpass.frequency)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"auto":return this.auto;case"cutoff":return this.auto?this.sensitivity.frequency.value:this.lowpass.frequency.value;case"depth":return this.depthRate;case"rate":return this.rate.value;case"resonance":return this.auto?this.sensitivity.Q.value:this.lowpass.Q.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"auto":"boolean"==typeof s&&(this.auto=s,this.connect());break;case"cutoff":"number"==typeof s&&(this.auto?(this.sensitivity.frequency.value=s,this.lowpass.frequency.value=20):this.lowpass.frequency.value=s);break;case"depth":"number"==typeof s&&(this.depthRate=s,this.depth.gain.value=this.auto?1e4*s:this.lowpass.frequency.value*s);break;case"rate":"number"==typeof s&&(this.rate.value=s);break;case"resonance":"number"==typeof s&&(this.auto?(this.sensitivity.Q.value=s,this.lowpass.Q.value=1):this.lowpass.Q.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,auto:this.auto,cutoff:this.auto?this.sensitivity.frequency.value:this.lowpass.frequency.value,depth:this.auto?this.depth.gain.value:this.depthRate,rate:this.rate.value,resonance:this.auto?this.sensitivity.Q.value:this.lowpass.Q.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Wah=s},422:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Channel=void 0;var r=function(){function t(t){this.tracks=[],this.channelGain=1,this.id=t}return t.prototype.append=function(t){return this.tracks.push(t),this},t.prototype.get=function(t){return"number"==typeof t&&t>=0&&t<this.tracks.length?this.tracks[t]:this.tracks},t.prototype.gain=function(t){if(!("number"==typeof t&&t>=0&&t<=1))return this.channelGain;this.channelGain=t},t.prototype.length=function(){return this.tracks.length},t.prototype.toString=function(){return this.id},t}();e.Channel=r},81:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Track=void 0;var r=function(){function t(t){this.dataBlocks=[],this.id=t}return t.prototype.get=function(){return this.dataBlocks},t.prototype.append=function(t){return this.dataBlocks.push(t),this},t.prototype.clear=function(){this.dataBlocks.length=0},t.prototype.has=function(){return this.dataBlocks.length>0},t.prototype.toString=function(){return this.id},t}();e.Track=r},7806:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Recorder=void 0;var n=r(81),i=r(422),s=function(){function t(t,e,r,n){this.channels=[],this.activeTrack=-1,this.paused=!0,this.processor=t.createScriptProcessor(e,r,n),this.sampleRate=t.sampleRate}return t.prototype.setup=function(t,e){this.channels.push(new i.Channel("0")),this.channels.push(new i.Channel("1"));for(var r=0,s=this.channels;r<s.length;r++)for(var o=s[r],a=0;a<e;a++)o.append(new n.Track(a.toString(10)));return this},t.prototype.ready=function(t){return this.hasTrack(t)?this.activeTrack=t:this.activeTrack=-1,this},t.prototype.start=function(){var t=this;if(-1===this.activeTrack||!this.paused)return this;this.paused=!1;var e=this.channels[0].gain(),r=this.channels[1].gain(),n=this.channels[0].get(this.activeTrack),i=this.channels[1].get(this.activeTrack),s=this.processor.bufferSize;return this.processor.onaudioprocess=function(o){if(-1!==t.activeTrack){for(var a=o.inputBuffer.getChannelData(0),c=o.inputBuffer.getChannelData(1),u=new Float32Array(s),l=new Float32Array(s),h=0;h<s;h++)u[h]=e*a[h],l[h]=r*c[h];null==n||n.append(u),null==i||i.append(l)}else t.processor.disconnect(0),t.processor.onaudioprocess=null},this},t.prototype.stop=function(){return this.activeTrack=-1,this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"0":if(this.channels[0])return this.channels[0].gain();break;case"1":if(this.channels[1])return this.channels[1].gain();break;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"0":this.channels[0]&&"number"==typeof s&&this.channels[0].gain(s);break;case"1":this.channels[1]&&"number"==typeof s&&this.channels[1].gain(s)}}return this},t.prototype.get=function(){return this.activeTrack},t.prototype.clear=function(t){if(-1!==this.activeTrack&&this.stop(),-1===t)for(var e=0,r=this.channels;e<r.length;e++)for(var n=0,i=r[e].get();n<i.length;n++){(a=i[n]).clear()}else if(this.hasTrack(t))for(var s=0,o=this.channels;s<o.length;s++){var a;null==(a=o[s].get(t))||a.clear()}return this},t.prototype.create=function(t,e,r,n){-1!==this.activeTrack&&this.stop();var i=null,s=null;if(-1===t&&this.has(-1,-1))i=this.mixTrack(0),s=this.mixTrack(1);else{if(!this.has(0,t)||!this.has(1,t))return"";i=this.flatTrack(0,t),s=this.flatTrack(1,t)}if(null===i||null===s)return"";var o=this.sampleRate,a=r,c=e,u=c*Math.min(i.length,s.length),l=36+(8+u*(a/8)),h=l-8,p=o*c*(a/8),f=u*(a/8),d=null;switch(a){case 8:d=new Uint8Array(u);for(var v=0;v<u;v++){var y=0;(y=v%c==0?Math.round((i[Math.trunc(v/c)]+1)/2*(Math.pow(2,8)-1)):Math.round((s[Math.trunc(v/c)]+1)/2*(Math.pow(2,8)-1)))>Math.pow(2,8)-1&&(y=Math.pow(2,8)-1),y<Math.pow(2,0)-1&&(y=Math.pow(2,0)-1),d[v]=y}break;case 16:d=new Int16Array(u);for(v=0;v<u;v++){y=0;(y=v%c==0?Math.round(i[Math.trunc(v/c)]*Math.pow(2,15)):Math.round(s[Math.trunc(v/c)]*Math.pow(2,15)))>+Math.pow(2,15)-1&&(y=+Math.pow(2,15)-1),y<-Math.pow(2,15)-0&&(y=-Math.pow(2,15)-0),d[v]=y}}if(null===d)return"";var m=new Uint8Array(l);m[0]=82,m[1]=73,m[2]=70,m[3]=70,m[4]=h>>0&255,m[5]=h>>8&255,m[6]=h>>16&255,m[7]=h>>24&255,m[8]=87,m[9]=65,m[10]=86,m[11]=69,m[12]=102,m[13]=109,m[14]=116,m[15]=32,m[16]=16,m[17]=0,m[18]=0,m[19]=0,m[20]=1,m[21]=0,m[22]=c,m[23]=0,m[24]=o>>0&255,m[25]=o>>8&255,m[26]=o>>16&255,m[27]=o>>24&255,m[28]=p>>0&255,m[29]=p>>8&255,m[30]=p>>16&255,m[31]=p>>24&255,m[32]=c*(a/8),m[33]=0,m[34]=a,m[35]=0,m[36]=100,m[37]=97,m[38]=116,m[39]=97,m[40]=f>>0&255,m[41]=f>>8&255,m[42]=f>>16&255,m[43]=f>>24&255;for(v=0;v<u;v++){var b=l-f;switch(a){case 8:m[b+v]=d[v];break;case 16:m[b+2*v+0]=d[v]>>0&255,m[b+2*v+1]=d[v]>>8&255}}switch(n){case"base64":case"dataURL":var g=window.btoa(Array.from(m).map((function(t){return String.fromCodePoint(t)})).join(""));return"base64"===n?g:"data:audio/wav;base64,".concat(g);case"blob":case"objectURL":var w=new Blob([m],{type:"audio/wav"});return"blob"===n?w:window.URL.createObjectURL(w);default:return""}},t.prototype.has=function(t,e){var r;if(!this.hasChannel(t))return this.channels.some((function(t){return t.get().some((function(t){return t.has()}))}));var n=this.channels[t].get();if(!this.hasTrack(e))return n.some((function(t){return t.has()}));var i=this.channels[t].get(e);return null!==(r=null==i?void 0:i.has())&&void 0!==r&&r},t.prototype.hasChannel=function(t){return t>=0&&t<this.channels.length},t.prototype.hasTrack=function(t){return t>=0&&this.channels.every((function(e){return t<e.length()}))},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),t.prototype.flatTrack=function(t,e){if(!this.hasChannel(t)||!this.hasTrack(e))return null;var r=this.channels[t].get(e);if(null===r)return null;for(var n=r.get(),i=this.processor.bufferSize,s=new Float32Array(n.length*i),o=0,a=n.length;o<a;o++)for(var c=n[o],u=0;u<i;u++)s[o*i+u]=c[u];return s},t.prototype.mixTrack=function(t){if(!this.hasChannel(t))return null;for(var e=this.channels[t].get(),r=this.processor.bufferSize,n=0,i=0,s=0,o=0,a=0,c=0,u=e;c<u.length;c++){a<(f=u[c].get()).length&&(a=f.length)}for(var l=new Float32Array(a*r);;){for(var h=0,p=e.length;h<p;h++){var f,d=(f=e[h].get())[s];d&&o>=0&&o<=d.length&&(n+=d[o],i++)}if(i<=0)return l;l[s*r+o]=n/i,n=0,i=0,o<r-1?o++:(s++,o=0)}},t}();e.Recorder=s},7836:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Room=void 0;var r=function(){function t(e,r){this.websocket=null;var n=r.roomId,i=r.bufferSize,s=r.numberOfInputs,o=r.numberOfOutputs,a=r.analyser;this.id=n,this.context=e,this.analyser=a,this.sender=e.createScriptProcessor(t.BUFFER_SIZE||i,s,o),this.receiver=e.createScriptProcessor(t.BUFFER_SIZE||i,s,o)}return t.prototype.join=function(t){var e=this,r=t.tls,n=t.host,i=t.port,s=t.path,o=t.openCallback,a=t.closeCallback,c=t.errorCallback,u=r?"wss://":"ws://";this.websocket=new WebSocket("".concat(u).concat(n,":").concat(i).concat(s)),this.websocket.binaryType="arraybuffer",this.websocket.onopen=function(t){null!==e.websocket&&(e.websocket.send(e.id),o&&o(t))},this.websocket.onclose=function(t){a&&a(t)},this.websocket.onerror=function(t){c&&c(t)},this.websocket.onmessage=function(t){if(null!==e.websocket&&t.data instanceof ArrayBuffer){var r=t.data.byteLength/Float32Array.BYTES_PER_ELEMENT,n=Math.trunc(r/2),i=n*Float32Array.BYTES_PER_ELEMENT,s=new Float32Array(t.data,0,n),o=new Float32Array(t.data,i,n);e.connect(),e.analyser.start("time"),e.analyser.start("fft"),e.receiver.onaudioprocess=function(t){var r=t.outputBuffer.getChannelData(0),n=t.outputBuffer.getChannelData(1);r.set(s),n.set(o),e.connected()||(e.analyser.stop("time"),e.analyser.stop("fft"))}}}},t.prototype.send=function(){var t=this;if(null!==this.websocket){var e=this.sender.bufferSize;this.sender.onaudioprocess=function(r){if(t.connected()){for(var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=new Float32Array(2*e),o=Math.trunc(s.length/2),a=0;a<e;a++)s[a]=n[a],s[o+a]=i[a];null!==t.websocket&&0===t.websocket.bufferedAmount&&(t.websocket.send(t.id),t.websocket.send(s))}}}},t.prototype.leave=function(){this.connected()&&(this.sender.disconnect(0),this.receiver.disconnect(0))},t.prototype.clear=function(){null!==this.websocket&&(this.websocket.send(this.id),this.websocket.close(),this.websocket=null)},t.prototype.connect=function(){this.receiver.connect(this.analyser.INPUT),this.receiver.connect(this.context.destination)},t.prototype.connected=function(){return null!==this.websocket&&this.websocket.readyState===WebSocket.OPEN},t.prototype.get=function(){var t;return(t={})[this.id]=this.websocket,t},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.sender},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.sender},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this.id},t.BUFFER_SIZE=2048,t}();e.Room=r},173:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Session=void 0;var n=r(7836),i=function(){function t(t){this.rooms=[],this.context=t,this.input=t.createGain(),this.output=t.createGain()}return t.prototype.setup=function(t){return this.rooms.push(new n.Room(this.context,t)),this},t.prototype.ready=function(t){var e=this.get(t.roomId);return null===e||e.join(t),this},t.prototype.start=function(t){var e=this.get(t);return null===e||(this.connect(t),e.send()),this},t.prototype.stop=function(t){var e=this.get(t);return null===e||e.leave(),this},t.prototype.clear=function(t){var e=this.get(t);return null===e||e.clear(),this},t.prototype.connect=function(t){var e=this.get(t);return null===e||(this.input.connect(e.INPUT),e.OUTPUT.connect(this.output)),this},t.prototype.connected=function(t){var e=this.get(t);return null!==e&&e.connected()},t.prototype.get=function(t){return this.rooms.find((function(e){return e.toString()===t}))||null},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.input},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.output},enumerable:!1,configurable:!0}),t}();e.Session=i},2188:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SoundModule=void 0;var n=r(8397),i=r(7806),s=r(173),o=r(8044),a=r(8649),c=r(346),u=r(4535),l=r(1605),h=r(8137),p=r(111),f=r(7369),d=r(6548),v=r(4226),y=r(610),m=r(2187),b=r(3751),g=r(2393),w=r(4833),T=r(1063),k=r(7223),A=r(8976),_=r(4979),O=r(3449),x=r(6813),S=function(){function t(e,r){this.modules=[],this.runningAnalyser=!1,this.mixed=!1,this.context=e,this.mastervolume=e.createGain(),this.processor=e.createScriptProcessor(r,t.NUMBER_OF_INPUTS,t.NUMBER_OF_OUTPUTS),this.analyser=new n.Analyser(e),this.recorder=new i.Recorder(e,r,2,2),this.session=new s.Session(e),this.stereo=new A.Stereo(e,r),this.compressor=new c.Compressor(e),this.distortion=new l.Distortion(e),this.wah=new x.Wah(e),this.pitchshifter=new w.PitchShifter(e,r),this.equalizer=new p.Equalizer(e),this.filter=new f.Filter(e),this.autopanner=new o.Autopanner(e),this.tremolo=new _.Tremolo(e),this.ringmodulator=new k.Ringmodulator(e),this.phaser=new g.Phaser(e),this.flanger=new d.Flanger(e),this.chorus=new a.Chorus(e),this.delay=new u.Delay(e),this.reverb=new T.Reverb(e),this.panner=new b.Panner(e),this.listener=new v.Listener(e),this.envelopegenerator=new h.EnvelopeGenerator(e),this.noisegate=new y.NoiseGate(e),this.noisesuppressor=new m.NoiseSuppressor(e,r),this.vocalcanceler=new O.VocalCanceler(e,r),this.modules=[this.stereo,this.compressor,this.distortion,this.wah,this.pitchshifter,this.equalizer,this.filter,this.autopanner,this.tremolo,this.ringmodulator,this.phaser,this.flanger,this.chorus,this.delay,this.reverb,this.panner,this.noisegate,this.noisesuppressor,this.vocalcanceler]}return t.prototype.connect=function(t){var e=this.modules[0].INPUT;if(null!==e){t.disconnect(0),this.modules.length>0?t.connect(e):t.connect(this.mastervolume);for(var r=0,n=this.modules.length;r<n;r++){var i=this.modules[r].OUTPUT;if(null!==i)if(i.disconnect(0),r<this.modules.length-1){var s=this.modules[r+1].INPUT;if(null===s)continue;i.connect(s)}else i.connect(this.mastervolume)}this.mastervolume.connect(this.context.destination),this.mastervolume.connect(this.analyser.INPUT),this.mastervolume.connect(this.recorder.INPUT),this.recorder.OUTPUT.connect(this.context.destination),this.mastervolume.connect(this.session.INPUT),this.session.OUTPUT.connect(this.context.destination)}},t.prototype.resize=function(t){return this.init(this.context,t),this},t.prototype.getBufferSize=function(){return this.processor.bufferSize},t.prototype.install=function(t,e){return this.modules.every((function(t){return t!==e}))&&this.modules.push(e),e},t.prototype.on=function(t){var e=null!=t?t:this.context.currentTime;return this.stereo.start(),this.chorus.start(e),this.flanger.start(e),this.phaser.start(e),this.autopanner.start(e),this.tremolo.start(e),this.ringmodulator.start(e),this.wah.start(e),this.filter.start(e),this},t.prototype.off=function(t){var e=null!=t?t:this.context.currentTime;return this.stereo.stop(),this.chorus.stop(e),this.flanger.stop(e),this.phaser.stop(e),this.autopanner.stop(e),this.tremolo.stop(e),this.ringmodulator.stop(e),this.wah.stop(e),this.filter.stop(e),this},t.prototype.suspend=function(){return this.analyser.stop("time"),this.analyser.stop("fft"),this.runningAnalyser=!1,this.recorder.stop(),this.processor.disconnect(0),this},t.prototype.mix=function(){return this.mixed=!0,this},t.prototype.demix=function(){return this.mixed=!1,this},t.prototype.params=function(){return{mastervolume:this.mastervolume.gain.value,stereo:this.stereo.params(),compressor:this.compressor.params(),distortion:this.distortion.params(),wah:this.wah.params(),pitchshifter:this.pitchshifter.params(),equalizer:this.equalizer.params(),filter:this.filter.params(),autopanner:this.autopanner.params(),tremolo:this.tremolo.params(),ringmodulator:this.ringmodulator.params(),phaser:this.phaser.params(),flanger:this.flanger.params(),chorus:this.chorus.params(),delay:this.delay.params(),reverb:this.reverb.params(),panner:this.panner.params(),listener:this.listener.params(),envelopegenerator:this.envelopegenerator.params(),noisegate:this.noisegate.params(),noisesuppressor:this.noisesuppressor.params(),vocalcanceler:this.vocalcanceler.params()}},t.prototype.toJSON=function(){return JSON.stringify(this.params())},t.prototype.init=function(e,r){if(this.modules.length>0){this.mastervolume.disconnect(0),this.processor.disconnect(0),this.analyser.INPUT.disconnect(0),this.recorder.INPUT.disconnect(0),this.session.INPUT.disconnect(0);for(var S=0,M=this.modules;S<M.length;S++){var E=M[S];E.INPUT&&E.INPUT.disconnect(0),E.OUTPUT&&E.OUTPUT.disconnect(0)}this.modules.length=0}this.processor=e.createScriptProcessor(r,t.NUMBER_OF_INPUTS,t.NUMBER_OF_OUTPUTS),this.analyser=new n.Analyser(e),this.recorder=new i.Recorder(e,r,2,2),this.session=new s.Session(e),this.stereo=new A.Stereo(e,r),this.compressor=new c.Compressor(e),this.distortion=new l.Distortion(e),this.wah=new x.Wah(e),this.pitchshifter=new w.PitchShifter(e,r),this.equalizer=new p.Equalizer(e),this.filter=new f.Filter(e),this.autopanner=new o.Autopanner(e),this.tremolo=new _.Tremolo(e),this.ringmodulator=new k.Ringmodulator(e),this.phaser=new g.Phaser(e),this.flanger=new d.Flanger(e),this.chorus=new a.Chorus(e),this.delay=new u.Delay(e),this.reverb=new T.Reverb(e),this.panner=new b.Panner(e),this.listener=new v.Listener(e),this.envelopegenerator=new h.EnvelopeGenerator(e),this.noisegate=new y.NoiseGate(e),this.noisesuppressor=new m.NoiseSuppressor(e,r),this.vocalcanceler=new O.VocalCanceler(e,r),this.modules=[this.stereo,this.compressor,this.distortion,this.wah,this.pitchshifter,this.equalizer,this.filter,this.autopanner,this.tremolo,this.ringmodulator,this.phaser,this.flanger,this.chorus,this.delay,this.reverb,this.panner,this.noisegate,this.noisesuppressor,this.vocalcanceler]},t.NUMBER_OF_INPUTS=2,t.NUMBER_OF_OUTPUTS=2,t}();e.SoundModule=S},3594:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.StreamModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.sources=[],n.stream=null,n.constraints={audio:!0,video:!1},n.output=!0,n.track=!1,n.paused=!0,n}return i(e,t),e.prototype.setup=function(t){return t&&(this.constraints=s(s({},this.constraints),t)),this},e.prototype.ready=function(t){var e=this;return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&window.MediaStream?(this.paused=!1,(null==t?void 0:t.stream)?(this.stream=t.stream,Promise.resolve(this.stream)):navigator.mediaDevices.getUserMedia(this.constraints).then((function(r){return e.paused||(e.stream=r,(null==t?void 0:t.successCallback)&&t.successCallback(r)),r})).catch((function(e){return(null==t?void 0:t.errorCallback)&&t.errorCallback(e),e}))):Promise.reject()},e.prototype.start=function(){if(null===this.stream)return this;if(this.track)for(var t=this.stream.getAudioTracks(),e=0,r=t.length;e<r;e++)this.sources[e]=this.context.createMediaStreamTrackSource(t[e]),this.sources[e].connect(this.processor),this.connect(this.processor);else this.sources[0]=this.context.createMediaStreamSource(this.stream),this.sources[0].connect(this.processor),this.connect(this.processor);return this.output||(this.mastervolume.disconnect(0),this.mastervolume.connect(this.analyser.INPUT),this.mastervolume.connect(this.recorder.INPUT),this.recorder.OUTPUT.connect(this.context.destination),this.mastervolume.connect(this.session.INPUT),this.session.OUTPUT.connect(this.context.destination)),this.on(this.context.currentTime),this.analyser.start("time"),this.analyser.start("fft"),this.processor.onaudioprocess=function(t){var e=t.inputBuffer.getChannelData(0),r=t.inputBuffer.getChannelData(1),n=t.outputBuffer.getChannelData(0),i=t.outputBuffer.getChannelData(1);n.set(e),i.set(r)},this},e.prototype.stop=function(){return this.sources.length=0,this.off(this.context.currentTime),this.analyser.stop("time"),this.analyser.stop("fft"),this.mixed||(this.processor.disconnect(0),this.processor.onaudioprocess=null),this.paused=!0,this},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"output":return this.output;case"track":return this.track;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"mastervolume":"number"==typeof s&&(this.mastervolume.gain.value=s);break;case"output":"boolean"==typeof s&&(this.output=s);break;case"track":"boolean"==typeof s&&(this.track=s)}}return this},e.prototype.get=function(t){return"number"==typeof t&&t>=0&&t<this.sources.length?this.sources[t]:this.sources},e.prototype.getStream=function(){return this.stream},e.prototype.clear=function(){return this.stop(),this.clearAudioDevices(),this.clearVideoDevices(),this.stream=null,this},e.prototype.clearAudioDevices=function(){if(null===this.stream)return this;this.stop();for(var t=0,e=this.stream.getAudioTracks();t<e.length;t++){e[t].stop()}return this},e.prototype.clearVideoDevices=function(){if(null===this.stream)return this;this.stop();for(var t=0,e=this.stream.getVideoTracks();t<e.length;t++){e[t].stop()}return this.stream=null,this},e.prototype.devices=function(){return navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():Promise.reject()},e.prototype.streaming=function(){return!this.paused},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"distortion":return this.distortion;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e=t.prototype.params.call(this);return s(s({},e),{output:this.output,track:this.track,noisegate:this.noisegate.params(),noisesuppressor:this.noisesuppressor.params()})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(r(2188).SoundModule);e.StreamModule=o},999:(t,e)=>{function r(t){return t>=0?e.MIN_A*Math.pow(e.FREQUENCY_RATIO,t):0}function n(t){var e=t.file,r=t.type,n=t.successCallback,i=t.errorCallback,s=t.progressCallback,o=new FileReader;switch(o.onprogress=function(t){s&&s(t)},o.onerror=function(t){var e,r,n,s,a;if(i){var c;switch(null===(e=o.error)||void 0===e?void 0:e.code){case null===(r=o.error)||void 0===r?void 0:r.NOT_FOUND_ERR:c="NOT_FOUND_ERR";break;case null===(n=o.error)||void 0===n?void 0:n.SECURITY_ERR:c="SECURITY_ERR";break;case null===(s=o.error)||void 0===s?void 0:s.ABORT_ERR:c="ABORT_ERR";break;case null===(a=o.error)||void 0===a?void 0:a.NOT_SUPPORTED_ERR:c="NOT_READABLE_ERR";break;default:c="ERR"}i(t,c)}},o.onload=function(t){if(n){var e=o.result;switch(r){case"text":"string"==typeof e&&(e=e.replace(/<(\/?script.*?)>/gi,"&lt;$1&gt;"));break;case"json":"string"==typeof e&&(e=JSON.parse(e.replace(/<(\/?script.*?)>/gi,"&lt;$1&gt;")))}n(t,e)}},r){case"arraybuffer":o.readAsArrayBuffer(e);break;case"dataURL":o.readAsDataURL(e);break;case"text":case"json":o.readAsText(e,"UTF-8")}}Object.defineProperty(e,"__esModule",{value:!0}),e.toTextFile=e.toFrequencies=e.file=e.drop=e.read=e.exitFullscreen=e.requestFullscreen=e.decode=e.convertTime=e.ajax=e.ifft=e.fft=e.computeFrequency=e.computeIndex=e.isPitchChar=e.DOT=e.HALF_DOWN=e.HALF_UP=e.SHARP=e.QUARTER_NOTE=e.MIN_A=e.FREQUENCY_RATIO=e.EQUAL_TEMPERAMENT=void 0,e.EQUAL_TEMPERAMENT=12,e.FREQUENCY_RATIO=1.0594630943592953,e.MIN_A=27.5,e.QUARTER_NOTE=4,e.SHARP="#",e.HALF_UP="+",e.HALF_DOWN="-",e.DOT=".",e.isPitchChar=function(t){switch(t.toUpperCase()){case"C":case"D":case"E":case"F":case"G":case"A":case"B":case"R":return!0;default:return!1}},e.computeIndex=function(t,r){var n=0;switch(r){case"C":n=3;break;case"D":n=5;break;case"E":n=7;break;case"F":n=8;break;case"G":n=10;break;case"A":n=12;break;case"B":n=14;break;case"R":return-1}var i=e.EQUAL_TEMPERAMENT*(t-1)+n;return i>=0?i:-1},e.computeFrequency=r,e.fft=function(t,e,r){for(var n=function(t){return Math.pow(2,t)},i=new Uint16Array(r),s=Math.log2(r),o=1;o<=s;o++)for(var a=0;a<n(o-1);a++)for(var c=s-o,u=0;u<n(c);u++){var l=a*n(c+1)+u,h=n(c)+l,p=u*n(o-1),f=t[l],d=e[l],v=t[h],y=e[h],m=Math.cos(2*Math.PI*p/r),b=-1*Math.sin(2*Math.PI*p/r);o<s?(t[l]=f+v,e[l]=d+y,t[h]=m*(f-v)-b*(d-y),e[h]=m*(d-y)+b*(f-v)):(t[l]=f+v,e[l]=d+y,t[h]=f-v,e[h]=d-y)}for(o=1;o<=s;o++)for(c=s-o,a=0;a<n(o-1);a++)i[n(o-1)+a]=i[a]+n(c);for(var g=0;g<r;g++)if(!(i[g]<=g)){var w=t[i[g]],T=e[i[g]];t[i[g]]=t[g],e[i[g]]=e[g],t[g]=w,e[g]=T}},e.ifft=function(t,e,r){for(var n=function(t){return Math.pow(2,t)},i=new Uint16Array(r),s=Math.log2(r),o=1;o<=s;o++)for(var a=0;a<n(o-1);a++)for(var c=s-o,u=0;u<n(c);u++){var l=a*n(c+1)+u,h=n(c)+l,p=u*n(o-1),f=t[l],d=e[l],v=t[h],y=e[h],m=Math.cos(2*Math.PI*p/r),b=Math.sin(2*Math.PI*p/r);o<s?(t[l]=f+v,e[l]=d+y,t[h]=m*(f-v)-b*(d-y),e[h]=m*(d-y)+b*(f-v)):(t[l]=f+v,e[l]=d+y,t[h]=f-v,e[h]=d-y)}for(o=1;o<=s;o++)for(c=s-o,a=0;a<n(o-1);a++)i[n(o-1)+a]=i[a]+n(c);for(var g=0;g<r;g++)if(!(i[g]<=g)){var w=t[i[g]],T=e[i[g]];t[i[g]]=t[g],e[i[g]]=e[g],t[g]=w,e[g]=T}for(g=0;g<r;g++)t[g]/=r,e[g]/=r},e.ajax=function(t){var e=t.url,r=t.type,n=t.timeout,i=t.successCallback,s=t.errorCallback,o=t.progressCallback,a=new XMLHttpRequest;a.timeout=null!=n?n:6e4,a.ontimeout=function(t){s&&s(t,"timeout")},a.onprogress=function(t){o&&o(t)},a.onerror=function(t){s&&s(t,"error")},a.onload=function(t){i&&200===a.status&&i(t,a.response)},a.open("GET",e,!0),a.responseType=null!=r?r:"arraybuffer",a.send(null)},e.convertTime=function(t){return t<0?{minutes:-1,seconds:-1,milliseconds:-1}:{minutes:Math.trunc(t/60),seconds:Math.trunc(t%60),milliseconds:t-Math.trunc(t)}},e.decode=function(t,e,r,n){r||(r=function(){}),n||(n=function(){}),t.decodeAudioData(e,r,n)},e.requestFullscreen=function(t){return t.requestFullscreen()},e.exitFullscreen=function(){return document.exitFullscreen()},e.read=n,e.drop=function(t){var e,r,i=t.event,s=t.type,o=t.successCallback,a=t.errorCallback,c=t.progressCallback;i.preventDefault();var u=null!==(r=null===(e=i.dataTransfer)||void 0===e?void 0:e.items[0].getAsFile())&&void 0!==r?r:null;return null===u?null:"objectURL"===s?window.URL.createObjectURL(u):(n({file:u,type:s,successCallback:o,errorCallback:a,progressCallback:c}),u)},e.file=function(t){var e,r,i=t.event,s=t.type,o=t.successCallback,a=t.errorCallback,c=t.progressCallback,u=null!==(r=null===(e=i.target.files)||void 0===e?void 0:e.item(0))&&void 0!==r?r:null;return null===u?null:"objectURL"===s?window.URL.createObjectURL(u):(n({file:u,type:s,successCallback:o,errorCallback:a,progressCallback:c}),u)},e.toFrequencies=function(t){return t.map((function(t){return r(t)}))},e.toTextFile=function(t,e){if(e){var r=new Blob([t],{type:"text/plain"});return window.URL.createObjectURL(r)}return"data:,".concat(encodeURIComponent(t))}},2309:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}var n={};return(()=>{var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.X=t.XSound=void 0,r(2309);r(2188);var e=r(6667),i=r(5146),s=r(4903),o=r(1114),a=r(7878),c=r(3594),u=r(6954),l=r(6567),h=r(9206),p=r(7087),f=r(8397),d=r(7806),v=r(173),y=r(1643),m=r(8044),b=r(8649),g=r(346),w=r(4535),T=r(1605),k=(r(8137),r(111)),A=r(7369),_=r(6548),O=r(4226),x=r(610),S=r(2187),M=r(3751),E=r(2393),C=r(4833),P=r(1063),N=r(7223),R=r(8976),j=r(4979),I=r(3449),q=r(6813),D=r(999);window.AudioContext=window.AudioContext||window.webkitAudioContext,window.URL=window.URL||window.webkitURL;var U=new AudioContext,F={oscillator:new e.OscillatorModule(U,0),oneshot:new i.OneshotModule(U,0),noise:new s.NoiseModule(U,0),audio:new o.AudioModule(U,0),media:new a.MediaModule(U,0),stream:new c.StreamModule(U,0),processor:new u.ProcessorModule(U,0),mixer:new l.MixerModule(U,0),midi:new h.MIDI,mml:new p.MML};function L(t){switch(t){case"oscillator":return F.oscillator;case"oneshot":return F.oneshot;case"noise":return F.noise;case"audio":return F.audio;case"media":return F.media;case"stream":return F.stream;case"processor":return F.processor;case"mixer":return F.mixer;case"midi":return F.midi;case"mml":return F.mml;default:return null}}t.XSound=L,t.X=L,L.SAMPLE_RATE=U.sampleRate,L.EQUAL_TEMPERAMENT=D.EQUAL_TEMPERAMENT,L.FREQUENCY_RATIO=D.FREQUENCY_RATIO,L.MIN_A=D.MIN_A,L.QUARTER_NOT=D.QUARTER_NOTE,L.HALF_UP=D.HALF_UP,L.HALF_DOWN=D.HALF_DOWN,L.DOT=D.DOT,L.isPitchChar=D.isPitchChar,L.computeIndex=D.computeIndex,L.computeFrequency=D.computeFrequency,L.fft=D.fft,L.ifft=D.ifft,L.ajax=D.ajax,L.convertTime=D.convertTime,L.decode=D.decode,L.requestFullscreen=D.requestFullscreen,L.exitFullscreen=D.exitFullscreen,L.read=D.read,L.drop=D.drop,L.file=D.file,L.toFrequencies=D.toFrequencies,L.toTextFile=D.toTextFile,L.Analyser=f.Analyser,L.Recorder=d.Recorder,L.Session=v.Session,L.Effector=y.Effector,L.Autopanner=m.Autopanner,L.Chorus=b.Chorus,L.Compressor=g.Compressor,L.Delay=w.Delay,L.Distortion=T.Distortion,L.Equalizer=k.Equalizer,L.Filter=A.Filter,L.Flanger=_.Flanger,L.Listener=O.Listener,L.NoiseGate=x.NoiseGate,L.NoiseSuppressor=S.NoiseSuppressor,L.Panner=M.Panner,L.Phaser=E.Phaser,L.PitchShifter=C.PitchShifter,L.Reverb=P.Reverb,L.Ringmodulator=N.Ringmodulator,L.Stereo=R.Stereo,L.Tremolo=j.Tremolo,L.VocalCanceler=I.VocalCanceler,L.Wah=q.Wah,L.setup=function(){return"running"!==U.state?U.resume():Promise.reject()},L.clone=function(){var t={oscillator:new e.OscillatorModule(U,0),oneshot:new i.OneshotModule(U,0),noise:new s.NoiseModule(U,0),audio:new o.AudioModule(U,0),media:new a.MediaModule(U,0),stream:new c.StreamModule(U,0),mixer:new l.MixerModule(U,0),processor:new u.ProcessorModule(U,0),midi:new h.MIDI,mml:new p.MML};function r(e){switch(e){case"oscillator":return t.oscillator;case"oneshot":return t.oneshot;case"noise":return t.noise;case"audio":return t.audio;case"media":return t.media;case"stream":return t.stream;case"processor":return t.processor;case"mixer":return t.mixer;case"midi":return t.midi;case"mml":return t.mml;default:return null}}return r.free=function(e){for(var r=function(e){if(null===e)return"continue";Object.entries(t).forEach((function(r){var n=r[0],i=r[1];e===i&&(t[n]=null)}))},n=0,i=e;n<i.length;n++){r(i[n])}},r},L.free=function(t){for(var e=function(t){if(null===t)return"continue";Object.entries(F).forEach((function(e){var r=e[0],n=e[1];t===n&&(F[r]=null)}))},r=0,n=t;r<n.length;r++){e(n[r])}},L.noConflict=function(t){return window.X===L&&(window.X=void 0),t&&window.XSound===L&&(window.XSound=void 0),L},L.get=function(){return U},L.getCurrentTime=function(){return U.currentTime};var z=function(){L.setup().then((function(){})).catch((function(){})),document.removeEventListener("click",z,!1),document.removeEventListener("mousedown",z,!1),document.removeEventListener("mouseup",z,!1),document.removeEventListener("touchstart",z,!1),document.removeEventListener("touchend",z,!1)};document.addEventListener("click",z,!1),document.addEventListener("mousedown",z,!1),document.addEventListener("mouseup",z,!1),document.addEventListener("touchstart",z,!1),document.addEventListener("touchend",z,!1)})(),n})()));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.xsound=e():t.xsound=e()}(self,(()=>(()=>{"use strict";var t={1114:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.buffer=null,n.currentTime=0,n.stopped=!0,n.source=e.createBufferSource(),n}return i(e,t),e.prototype.setup=function(t){var e=null!=t?t:{},r=e.decodeCallback,n=e.updateCallback,i=e.endedCallback,s=e.errorCallback;return r&&(this.decodeCallback=r),n&&(this.updateCallback=n),i&&(this.endedCallback=i),s&&(this.errorCallback=s),this.envelopegenerator.setGenerator(0),this.envelopegenerator.param({attack:0,decay:.01,sustain:1,release:.01}),this},e.prototype.ready=function(t){var e=this;if(t instanceof ArrayBuffer){this.buffer=null;this.context.decodeAudioData(t,(function(t){e.buffer=t,e.analyser.start("timeoverview",0,e.buffer),e.analyser.start("timeoverview",1,e.buffer),e.decodeCallback&&e.decodeCallback(e.buffer)}),this.errorCallback)}else t instanceof AudioBuffer&&(this.buffer=t);return this},e.prototype.start=function(t,e){var r=this;if(null===this.buffer||!this.stopped)return this;var n=this.context.currentTime,i=null!=t?t:0,s=null!=e?e:this.buffer.duration;this.currentTime=s>=0?i>=0&&i<=s?i:0:i>=0&&i<=this.buffer.duration?i:0;var o=this.source.playbackRate.value,a=this.source.detune.value,c=this.source.loop;this.source=this.context.createBufferSource(),this.source.buffer=this.buffer,this.source.playbackRate.value=o,this.source.detune.value=a,this.source.loop=c,this.source.loopStart=this.currentTime,this.source.loopEnd=s>=0?s:this.buffer.duration,this.envelopegenerator.ready(0,this.source,this.processor),this.connect(this.processor),s>=0?this.source.start(n,this.currentTime,s-i):this.source.start(n,this.currentTime,this.buffer.duration-this.currentTime),this.analyser.start("time"),this.analyser.start("fft"),this.stopped=!1,this.envelopegenerator.start(n),s>=0?this.envelopegenerator.stop(n+(s-i)/this.source.playbackRate.value,!0):this.envelopegenerator.stop(n+(this.buffer.duration-i)/this.source.playbackRate.value,!0),this.on(n);var u=this.processor.bufferSize,l=this.analyser.domain("timeoverview",0),h=this.analyser.domain("timeoverview",1);return this.processor.onaudioprocess=function(t){var e=t.inputBuffer.getChannelData(0),n=t.inputBuffer.getChannelData(1),i=t.outputBuffer.getChannelData(0),s=t.outputBuffer.getChannelData(1);if(null!==r.buffer)if(r.currentTime<Math.trunc(r.source.loopEnd)){i.set(e),s.set(n);for(var o=0;o<u;o++){var a=r.source.detune.value,c=r.source.playbackRate.value+a/1200;r.currentTime+=c/r.buffer.sampleRate,r.updateCallback&&r.updateCallback(r.source,r.currentTime)}l.update(r.currentTime),h.update(r.currentTime)}else r.source.loop?(r.stop(),"sprite"===l.param("mode")?r.start(r.source.loopStart,r.source.loopEnd):r.start(0,r.buffer.duration)):r.end();else r.end()},this},e.prototype.stop=function(){if(null===this.buffer||this.stopped)return this;var t=this.context.currentTime;return this.source.stop(t),this.off(t),this.analyser.stop("time"),this.analyser.stop("fft"),this.mixed||(this.processor.disconnect(0),this.processor.onaudioprocess=null),this.stopped=!0,this},e.prototype.param=function(t){var e,r,n,i,s,o,a,c,u,l;if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"playbackRate":return this.source.playbackRate.value;case"detune":return this.source.detune.value;case"loop":return this.source.loop;case"currentTime":return this.currentTime;case"duration":return null!==(r=null===(e=this.source.buffer)||void 0===e?void 0:e.duration)&&void 0!==r?r:0;case"sampleRate":return null!==(i=null===(n=this.source.buffer)||void 0===n?void 0:n.sampleRate)&&void 0!==i?i:this.context.sampleRate;case"numberOfChannels":return null!==(o=null===(s=this.source.buffer)||void 0===s?void 0:s.numberOfChannels)&&void 0!==o?o:0;default:return this}for(var h=0,p=Object.entries(t);h<p.length;h++){var f=p[h],d=f[0],v=f[1];switch(d){case"mastervolume":"number"==typeof v&&(this.mastervolume.gain.value=v);break;case"playbackRate":if("number"==typeof v&&v>0){this.source.playbackRate.value=v;var y=v+this.source.detune.value/1200,m=this.context.currentTime,b=this.currentTime,g=null!==(c=null===(a=this.source.buffer)||void 0===a?void 0:a.duration)&&void 0!==c?c:0;this.envelopegenerator.start(m),this.envelopegenerator.stop(m+(g-b)/y,!0)}break;case"detune":if("number"==typeof v){this.source.detune.value=v;y=this.source.playbackRate.value+v/1200,m=this.context.currentTime,b=this.currentTime,g=null!==(l=null===(u=this.source.buffer)||void 0===u?void 0:u.duration)&&void 0!==l?l:0;this.envelopegenerator.start(m),this.envelopegenerator.stop(m+(g-b)/y,!0)}break;case"loop":"boolean"==typeof v&&(this.source.loop=v);break;case"currentTime":"number"==typeof v&&(this.currentTime=v,this.stopped||(this.stop(),this.start(v)))}}return this},e.prototype.get=function(){return this.source},e.prototype.end=function(){return this.stop(),this.currentTime=0,this.endedCallback&&this.endedCallback(this.source,0),this},e.prototype.has=function(){return null!==this.buffer},e.prototype.paused=function(){return this.stopped},e.prototype.fadeIn=function(t){var e,r;if("number"!=typeof t)return this.envelopegenerator.param("attack");this.envelopegenerator.param({attack:t});var n=this.context.currentTime,i=this.currentTime,s=null!==(r=null===(e=this.source.buffer)||void 0===e?void 0:e.duration)&&void 0!==r?r:0,o=this.source.detune.value,a=this.source.playbackRate.value+o/1200;return this.envelopegenerator.start(n),this.envelopegenerator.stop(n+(s-i)/a,!0),this},e.prototype.fadeOut=function(t){var e,r;if("number"!=typeof t)return this.envelopegenerator.param("release");this.envelopegenerator.param({release:t});var n=this.context.currentTime,i=this.currentTime,s=null!==(r=null===(e=this.source.buffer)||void 0===e?void 0:e.duration)&&void 0!==r?r:0,o=this.source.detune.value,a=this.source.playbackRate.value+o/1200;return this.envelopegenerator.start(n),this.envelopegenerator.stop(n+(s-i)/a,!0),this},e.prototype.slice=function(t,e){if(null===this.buffer)return null;var r=this.buffer.duration,n=this.buffer.sampleRate,i=this.buffer.numberOfChannels,s=Math.trunc((null!=t?t:0)*n),o=Math.trunc((null!=e?e:r)*n),a=i>0?this.buffer.getChannelData(0):null,c=i>1?this.buffer.getChannelData(1):null,u=o-s;switch(i){case 1:if(null===a)return null;for(var l=new Float32Array(u),h=s;h<o;h++)l[h-s]=a[h];return(f=this.context.createBuffer(1,u,n)).copyToChannel(l,0),f;case 2:if(null===a||null===c)return null;l=new Float32Array(u);var p=new Float32Array(u);for(h=s;h<o;h++)l[h-s]=a[h],p[h-s]=c[h];var f;return(f=this.context.createBuffer(2,u,n)).copyToChannel(l,0),f.copyToChannel(p,1),f;default:return null}},e.prototype.sprite=function(t){var e=this;return null===this.buffer?null:Object.keys(t).reduce((function(r,n){var i=t[n],s=e.slice.apply(e,i);return null!==s&&(r[n]=s),r}),{})},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"bitcrusher":return this.bitcrusher;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"fuzz":return this.fuzz;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"overdrive":return this.overdrive;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"preamp":return this.preamp;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e,r,n,i,o,a,c=t.prototype.params.call(this);return s(s({},c),{playbackRate:this.source.playbackRate.value,detune:this.source.detune.value,loop:this.source.loop,currentTime:this.currentTime,duration:null!==(r=null===(e=this.buffer)||void 0===e?void 0:e.duration)&&void 0!==r?r:0,sampleRate:null!==(i=null===(n=this.buffer)||void 0===n?void 0:n.sampleRate)&&void 0!==i?i:this.context.sampleRate,numberOfChannels:null!==(a=null===(o=this.buffer)||void 0===o?void 0:o.numberOfChannels)&&void 0!==a?a:0,vocalcanceler:this.vocalcanceler.params()})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(r(2188).SoundModule);e.AudioModule=o},9206:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MIDI=void 0;var r=function(){function t(){this.midiAccess=null,this.inputs=[],this.outputs=[]}return t.prototype.setup=function(t){var e=this;if(!navigator.requestMIDIAccess)return Promise.reject();var r=t.options,n=t.successCallback,i=t.errorCallback;return navigator.requestMIDIAccess(r).then((function(t){e.midiAccess=t,t.inputs.forEach((function(t){e.inputs.push(t)})),t.outputs.forEach((function(t){e.outputs.push(t)})),n&&n(e.midiAccess,e.inputs,e.outputs)})).catch((function(t){i&&i(t)}))},t.prototype.get=function(){return this.midiAccess},t}();e.MIDI=r},5822:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Part=void 0;var n=r(6667),i=r(5146),s=r(4903),o=r(9171),a=r(9646),c=r(1358),u=function(){function t(t){this.sequences=[],this.previous=null,this.timerId=null,this.currentIndex=0,this.currentPosition=0,this.offset=0;var e=t.source,r=t.mml,n=t.offset,i=t.startCallback,s=t.stopCallback,u=t.endedCallback,l=t.errorCallback;this.source=e,this.mml=r,this.offset=null!=n?n:0,i&&(this.startCallback=i),s&&(this.stopCallback=s),u&&(this.endedCallback=u),l&&(this.errorCallback=l);var h=new o.Tokenizer(r),p=new a.TreeConstructor(h),f=new c.Sequencer(p,this.errorCallback),d=f.get();d&&(this.sequences=d),this.syntaxTree=f.getSyntaxTree()}return t.prototype.start=function(t){var e=this;if(!this.sequences[this.currentIndex])return this.stop(),void(this.endedCallback&&this.endedCallback());var r=this.sequences[this.currentIndex++];if(t){var o=this.mml.slice(0,this.currentPosition),a=this.mml.slice(this.currentPosition).replace(r.note,'<span class="x-highlight">'.concat(r.note,"</span>"));this.mml="".concat(o).concat(a),this.currentPosition+=this.mml.slice(this.currentPosition).indexOf("</span>")+"</span>".length}else{o=this.mml.slice(0,this.currentPosition),a=r.note;this.mml="".concat(o).concat(a),this.currentPosition+=a.length}if(this.source instanceof n.OscillatorModule)this.source.ready(0,r.duration).start(r.frequencies),this.startCallback&&this.startCallback(r);else if(this.source instanceof i.OneshotModule){var c=r.indexes.filter((function(t){return-1!==t})).map((function(t){return t+e.offset}));this.source.ready(0,r.duration).start(c),this.startCallback&&this.startCallback(r,this.offset)}else this.source instanceof s.NoiseModule&&(this.source.start(),this.startCallback&&this.startCallback(r));this.timerId=window.setTimeout((function(){e.source instanceof n.OscillatorModule?e.stopCallback&&e.stopCallback(r):e.source instanceof i.OneshotModule?e.stopCallback&&e.stopCallback(r,e.offset):e.source instanceof s.NoiseModule&&(e.source.stop(),e.stopCallback&&e.stopCallback(r)),e.previous=r,e.start(t)}),1e3*r.duration)},t.prototype.stop=function(){var t=this;if(null!==this.previous){if(this.source instanceof n.OscillatorModule)this.source.stop(),this.stopCallback&&this.stopCallback(this.previous);else if(this.source instanceof i.OneshotModule){var e=this.previous.indexes.filter((function(t){return-1!==t})).map((function(e){return e+t.offset}));this.source.stop(e),this.stopCallback&&this.stopCallback(this.previous,this.offset)}else this.source instanceof s.NoiseModule&&(this.source.stop(),this.stopCallback&&this.stopCallback(this.previous));this.timerId&&window.clearTimeout(this.timerId),this.timerId=null}},t.prototype.getMML=function(){return this.mml},t.prototype.getSequences=function(){return this.sequences},t.prototype.getSyntaxTree=function(){return this.syntaxTree},t.prototype.has=function(){return this.sequences.length>0},t.prototype.paused=function(){return null===this.timerId},t.prototype.getCurrentIndex=function(){return this.currentIndex},t.prototype.setCurrentIndex=function(t){t>=0&&t<this.sequences.length&&(this.currentIndex=t)},t}();e.Part=u},6478:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Sequence=void 0;var r=function(){function t(t){var e=t.id,r=t.note,n=t.indexes,i=t.frequencies,s=t.start,o=t.stop,a=t.duration;this._id=e,this._note=r,this._indexes=n,this._frequencies=i,this._start=s,this._stop=o,this._duration=a}return t.prototype.concat=function(e){return new t({id:this._id,note:"".concat(this._note,"&").concat(e.note),indexes:this._indexes,frequencies:this._frequencies,start:this._start,duration:this._duration+e.duration,stop:this._start+(this._duration+e.duration)})},Object.defineProperty(t.prototype,"note",{get:function(){return this._note},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"indexes",{get:function(){return this._indexes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frequencies",{get:function(){return this._frequencies},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stop",{get:function(){return this._stop},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return JSON.stringify({id:this._id,note:this._note,indexes:this._indexes,frequencies:this._frequencies,start:this._start,stop:this._stop,duration:this._duration})},t}();e.Sequence=r},1358:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Sequencer=void 0;var n=r(999),i=r(6806),s=r(2811),o=r(9646),a=r(6478),c=function(){function t(t,e){this.sequences=[],this.syntaxTree="",this.timeOf4note=0,this.octave=-1,this.currentTime=0,this.treeConstructor=t,this.errorCallback=e||function(t){throw t}}return t.prototype.get=function(){var t,e;o.TreeConstructor.id=0;var r=this.treeConstructor.parse();if(r){if(!(r instanceof s.MMLSyntaxError)){this.timeOf4note=0,this.octave=-1,this.currentTime=0;for(var n=r[0];null!==n;){if(!n)return void this.errorCallback(new s.MMLSyntaxError(new i.Token((this.sequences.length+1).toString(10),"UNKNOWN","")));if(n instanceof s.MMLSyntaxError)return void this.errorCallback(n);var a=n.operator,c=a.type,u=n.left,l=null!==u?u.operator.value:-1;switch(c){case"TEMPO":if(l<=0)return void this.errorCallback(new s.MMLSyntaxError(a));this.timeOf4note=60/l,n=n.right;break;case"OCTAVE":if(l<0)return void this.errorCallback(new s.MMLSyntaxError(a));this.octave=l,n=n.right;break;case"NOTE":case"REST":case"TIE":var h=this.push("TIE"===c?n.right:n);if(h instanceof s.MMLSyntaxError)return void this.errorCallback(h);"TIE"===c?(this.concat(),n=null!==(e=null===(t=n.right)||void 0===t?void 0:t.right)&&void 0!==e?e:null):n=n.right;break;case"EOS":n=n.right;break;default:return void this.errorCallback(new s.MMLSyntaxError(n.operator))}}return this.syntaxTree=r[0].toString(),this.treeConstructor.free(),this.sequences}this.errorCallback(r)}else this.errorCallback(new s.MMLSyntaxError(new i.Token("1","UNKNOWN","")))},t.prototype.getSyntaxTree=function(){return this.syntaxTree},t.prototype.push=function(t){if(null!==t){var e=t.left,r=t.right;if(null!==e&&null!==r){var i=e.operator,o=r.operator;if(null===i&&null===o)return this.push(e),void this.push(r);var c=t.operator.token,u=i.value,l=i.token,h=[],p=[];if(c){for(var f=0,d=c.length;f<d;f++){var v=c.charAt(f);if((0,n.isPitchChar)(v)){var y=(0,n.computeIndex)(this.octave,v);switch(c.charAt(f+1)){case n.HALF_UP:case n.SHARP:y++,f++;break;case n.HALF_DOWN:y--,f++}if(y>=h[0]&&(y-=n.EQUAL_TEMPERAMENT),-1!==y&&y<0)return;h.push(y)}}for(var m=0,b=h;m<b.length;m++){y=b[m];var g=(0,n.computeFrequency)(y);if(g<0)return;p.push(g)}var w=0;switch(u){case 1:case 2:case 4:case 8:case 16:case 32:case 64:case 128:case 256:if(l){var A=n.QUARTER_NOTE/u;l.includes(n.DOT)?w+=A*this.timeOf4note*1.5:w+=A*this.timeOf4note}break;case 6:w+=2*this.timeOf4note/3;break;case 12:w+=this.timeOf4note/3;break;case 18:w+=2*this.timeOf4note/9;break;case 24:w+=.5*this.timeOf4note/3;break;case 36:w+=this.timeOf4note/9;break;case 48:w+=.25*this.timeOf4note/3;break;case 72:w+=.5*this.timeOf4note/9;break;case 96:w+=.125*this.timeOf4note/3;break;case 144:w+=.25*this.timeOf4note/9;break;case 192:w+=.0625*this.timeOf4note/3;break;default:return void this.errorCallback(new s.MMLSyntaxError(i))}var T=(this.sequences.length+1).toString(10),_="".concat(c).concat(l),k=this.currentTime,x=k+w;this.sequences.push(new a.Sequence({id:T,note:_,indexes:h,frequencies:p,start:k,stop:x,duration:w})),this.currentTime+=w}}}},t.prototype.concat=function(){var t=this.sequences.pop(),e=this.sequences.pop();e&&t&&this.sequences.push(e.concat(t))},t}();e.Sequencer=c},6806:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Token=e.TokenMap=void 0,e.TokenMap=new Map([["T","TEMPO"],["O","OCTAVE"],["C","NOTE"],["D","NOTE"],["E","NOTE"],["F","NOTE"],["G","NOTE"],["A","NOTE"],["B","NOTE"],["+","NOTE"],["-","NOTE"],["#","NOTE"],["R","REST"],["0","NUMBER"],["1","NUMBER"],["2","NUMBER"],["3","NUMBER"],["4","NUMBER"],["5","NUMBER"],["6","NUMBER"],["7","NUMBER"],["8","NUMBER"],["9","NUMBER"],[".","NUMBER"],["&","TIE"],[" ","SPACE"],[void 0,"EOS"]]);var r=function(){function t(t,e,r){this._id=t,this._type=e,this._token=r,this._value=r?Number(r):-1}return Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return Number.isNaN(this._value)?-1:this._value},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return JSON.stringify({id:this._id,type:this._type,token:this._token,value:this._value})},t}();e.Token=r},9171:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Tokenizer=void 0;var n=r(6806),i=function(){function t(t){this.tokens=[],this.notes=[],this.numbers=[],this.tokens=t.trim().toUpperCase().split("").reverse()}return t.prototype.get=function(){var e=this.tokens.pop(),r=n.TokenMap.get(e);if(t.id++,!r)return new n.Token(t.id.toString(10),"UNKNOWN",e);for(;"SPACE"===r;)if(e=this.tokens.pop(),!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e);if("EOS"===r)return new n.Token(t.id.toString(10),"EOS",e);switch(this.notes.length=0,this.numbers.length=0,r){case"TEMPO":if(e)return new n.Token(t.id.toString(10),"TEMPO",e);break;case"OCTAVE":if(e)return new n.Token(t.id.toString(10),"OCTAVE",e);break;case"NOTE":if(e){if(this.notes.push(e),!(e=this.tokens.pop()))return new n.Token(t.id.toString(10),"NOTE",this.notes.join(""));if(!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e);for(;"NOTE"===r;){if(this.notes.push(e),!(e=this.tokens.pop()))return new n.Token(t.id.toString(10),"NOTE",this.notes.join(""));if(!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e)}return this.tokens.push(e),new n.Token(t.id.toString(10),"NOTE",this.notes.join(""))}break;case"REST":if(e)return new n.Token(t.id.toString(10),"REST",e);break;case"NUMBER":if(e){if(this.numbers.push(e),!(e=this.tokens.pop()))return new n.Token(t.id.toString(10),"NUMBER",this.numbers.join(""));if(!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e);for(;"NUMBER"===r;){if(this.numbers.push(e),!(e=this.tokens.pop()))return new n.Token(t.id.toString(10),"NUMBER",this.numbers.join(""));if(!(r=n.TokenMap.get(e)))return new n.Token(t.id.toString(10),"UNKNOWN",e)}return this.tokens.push(e),new n.Token(t.id.toString(10),"NUMBER",this.numbers.join(""))}break;case"TIE":if(e)return new n.Token(t.id.toString(10),"TIE",e);break;default:if(e)return new n.Token(t.id.toString(10),"UNKNOWN",e)}return null},t.id=0,t}();e.Tokenizer=i},2811:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MMLSyntaxError=e.Tree=void 0;var r=function(){function t(t,e,r,n){this._id=t,this._operator=e,this._left=r,this._right=n}return t.prototype.concat=function(t){this._right=t},Object.defineProperty(t.prototype,"operator",{get:function(){return this._operator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this._left},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._right},enumerable:!1,configurable:!0}),t.prototype.clear=function(){t.indent=0},t.prototype.toString=function(){for(var e,r,n="",i=0;i<t.indent;i++)n+=" ";return t.indent++,"\n".concat(n," ").concat("".concat(this._operator.token," (id = ").concat(this._id,")"),"\n").concat(n," /\\\n").concat(n).concat(null!==(r=null===(e=this._left)||void 0===e?void 0:e.operator.token)&&void 0!==r?r:"").concat(null!==this._right&&void 0!==this._right._operator.token?this.toString.call(this._right):"EOS","\n")},t.indent=0,t}();e.Tree=r;var n=function(){function t(t){this._token=t}return Object.defineProperty(t.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),t}();e.MMLSyntaxError=n},9646:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeConstructor=void 0;var n=r(9171),i=r(2811),s=function(){function t(t){this.syntaxTree=[],this.tokenizer=t}return t.prototype.parse=function(){n.Tokenizer.id=0;for(var e=this.tokenizer.get(),r=this.tokenizer.get();;){if(!e||!r)return this.syntaxTree;switch(t.id+=2,e.type){case"TEMPO":if("NUMBER"===r.type){var s=new i.Tree((t.id-0).toString(10),r,null,null),o=new i.Tree((t.id-1).toString(10),e,s,null);this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"OCTAVE":if(this.syntaxTree.length>0&&"NUMBER"===r.type){s=new i.Tree((t.id-0).toString(10),r,null,null),o=new i.Tree((t.id-1).toString(10),e,s,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"NOTE":if(this.syntaxTree.length>0&&"NUMBER"===r.type){s=new i.Tree((t.id-0).toString(10),r,null,null),o=new i.Tree((t.id-1).toString(10),e,s,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"REST":if(this.syntaxTree.length>0&&"NUMBER"===r.type){s=new i.Tree((t.id-0).toString(10),r,null,null),o=new i.Tree((t.id-1).toString(10),e,s,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"NUMBER":t.id-=2;break;case"TIE":if(this.syntaxTree.length>0){t.id--;o=new i.Tree((t.id-0).toString(10),e,null,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o);break}return new i.MMLSyntaxError(e);case"EOS":if(this.syntaxTree.length>0){o=new i.Tree((t.id-1).toString(10),e,null,null);this.syntaxTree[this.syntaxTree.length-1].concat(o),this.syntaxTree.push(o)}else{o=new i.Tree((t.id-1).toString(10),e,null,null);this.syntaxTree.push(o)}return this.syntaxTree;default:return new i.MMLSyntaxError(e)}e=r,r=this.tokenizer.get()}},t.prototype.free=function(){this.syntaxTree.length=0},t.id=0,t}();e.TreeConstructor=s},7087:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MML=void 0;r(6806),r(2811),r(6478);var n=r(5822),i=function(){function t(){this.parts=[]}return t.prototype.setup=function(t){return(null==t?void 0:t.startCallback)&&(this.startCallback=t.startCallback),(null==t?void 0:t.stopCallback)&&(this.stopCallback=t.stopCallback),(null==t?void 0:t.endedCallback)&&(this.endedCallback=t.endedCallback),(null==t?void 0:t.errorCallback)&&(this.errorCallback=t.errorCallback),this},t.prototype.ready=function(t){var e=t.source,r=t.mmls,i=t.offset;this.stop(),this.clear();for(var s=this.startCallback,o=this.stopCallback,a=this.endedCallback,c=this.errorCallback,u=0,l=r;u<l.length;u++){var h=l[u];this.parts.push(new n.Part({source:e,mml:h,offset:i,startCallback:s,stopCallback:o,endedCallback:a,errorCallback:c}))}return this},t.prototype.start=function(t,e){t>=0&&t<this.parts.length&&this.parts[t].start(null!=e&&e);return this},t.prototype.stop=function(){for(var t=0,e=this.parts;t<e.length;t++){e[t].stop()}return this},t.prototype.getMML=function(t){return t>=0&&t<this.parts.length?this.parts[t].getMML():""},t.prototype.getMMLs=function(){return this.parts.map((function(t){return t.getMML()}))},t.prototype.has=function(){return this.parts.length>0&&this.parts.every((function(t){return t.has()}))},t.prototype.getSequences=function(t){return t>=0&&t<this.parts.length?this.parts[t].getSequences():[]},t.prototype.getAllSequences=function(){return this.parts.map((function(t){return t.getSequences()}))},t.prototype.getSyntaxTree=function(t){return t>=0&&t<this.parts.length?this.parts[t].getSyntaxTree():""},t.prototype.paused=function(){return 0===this.parts.length||this.parts.every((function(t){return t.paused()}))},t.prototype.currentIndex=function(t,e){return t<0||t>=this.parts.length?this:e?(this.parts[t].setCurrentIndex(e),this):this.parts[t].getCurrentIndex()},t.prototype.clear=function(){for(var t=0,e=this.parts;t<e.length;t++){e[t].stop()}return this.parts.length=0,this},t.prototype.toABC=function(t,e,r,n,i,s){var o,a="";a+="X:".concat(e||1,"\n"),a+="T:".concat(r||"","\n"),a+="M:".concat(n||"4/4","\n"),a+="L:".concat(i||"1/256","\n"),a+="K:".concat(s||"","\n");var c=t.match(/\s*(?:T\d+)\s*|\s*(?:O\d+)\s*|\s*(?:(?:[CDEFGABR][#+-]?)+(?:256|192|144|128|96|72|64|48|36|32|24|18|16|12|8|6|4|2|1)\.?)(?:&(?:[CDEFGABR][#+-]?)+(?:256|192|144|128|96|72|64|48|36|32|24|18|16|12|8|6|4|2|1)\.?)*\s*/gi);if(null===c)return a;for(var u=null,l=0;c.length>0;){var h=null===(o=c.shift())||void 0===o?void 0:o.trim();if(!h)return a;if(/T\d+/i.test(h)){var p=Number(h.slice(1));if(p<=0)return a;a+="Q:1/4=".concat(p,"\n")}else if(/O\d+/i.test(h)){if((u=Number(h.slice(1)))<0)return a}else if(/(?:(?:[CDEFGABR][#+-]?)+)(?:256|192|144|128|96|72|64|48|36|32|24|18|16|12|8|6|4|2|1)(?:&(?:[CDEFGABR][#+-]?)+(?:256|192|144|128|96|72|64|48|36|32|24|18|16|12|8|6|4|2|1)\.?)*/i.test(h)){if(null===u)return a;var f=null;f=h.includes("&")?h.split("&"):[h];for(var d="";f.length>0;){var v=f.shift();if(!v)return a;var y="",m=0;switch(Number(v.replace(/^.+?(\d+)\.*$/,"$1"))){case 1:y=v.replace("1","256");break;case 2:y=v.replace("2","128");break;case 4:y=v.replace("4","64");break;case 8:y=v.replace("8","32");break;case 16:y=v.replace("16","16");break;case 32:y=v.replace("32","8");break;case 64:y=v.replace("64","4");break;case 128:y=v.replace("128","2");break;case 256:y=v.replace("256","1");break;case 6:y="(3".concat(v.replace("6","128")),m=128/3;break;case 12:y="(3".concat(v.replace("12","64")),m=64/3;break;case 18:y="(9".concat(v.replace("18","128")),m=128/9;break;case 24:y="(3".concat(v.replace("24","32")),m=32/3;break;case 36:y="(9".concat(v.replace("36","64")),m=64/9;break;case 48:y="(3".concat(v.replace("48","16")),m=16/3;break;case 72:y="(9".concat(v.replace("72","32")),m=32/9;break;case 96:y="(3".concat(v.replace("96","8")),m=8/3;break;case 144:y="(9".concat(v.replace("144","16")),m=16/9;break;case 192:y="(3".concat(v.replace("192","4")),m=4/3;break;default:return a}if(y.includes(".")&&(y=y.replace(/^(.+?)\d+\.+$/,"$1".concat(1.5*Number(y.replace(/^.+?(\d+)\.+$/,"$1"))))),y.includes("(")?l+=Number(y.replace(/^.+?(\d+)\.*$/i,"$1")):l+=m,l>=256&&(y+=" | ",l=0),/R/i.test(y))a+="".concat(y," ");else{var b="";switch(u){case 0:b=",,,,";break;case 1:b=",,,";break;case 2:b=",,";break;case 3:b=",";break;case 5:b="'";break;case 6:b="''";break;case 7:b="'''"}var g=y.match(/^(\(\d+)?((?:[CDEFGAB][#+-]?)+)(.*)$/i);if(null===g)return a;var w=g[1]?g[1]:"",A=g[2].length,T=g[3]?g[3]:"",_=0;if(w.length>0&&(y=y.replace(/^(?:\(\d+)?((?:[CDEFGAB][#+-]?)+)(.*)$/i,"$1$2")),1===A)d+="".concat(w).concat(y.slice(0,1)).concat(b).concat(T);else if(2===A&&/[#+-]/.test(y.charAt(1)))d+="".concat(w).concat(y.slice(1,2)).concat(y.slice(0,1)).concat(b).concat(T);else for(;_<A;)0===_&&(d+="".concat(w,"[")),/[#+-]/.test(y.charAt(_+1))?(d+="".concat(y.slice(_+1,_+2)).concat(y.slice(_,_+1)).concat(b),_+=2):(d+="".concat(y.slice(_,_+1)).concat(b),_++),_===A&&(d+="]".concat(T));f.length>0?d+="&":a+="".concat(d," ")}}}}return a.replace(/R/gi,"z").replace(/[#+]/g,"^").replace(/-/g,"_").replace(/&/g,"-").replace(/\s{2}/g," ").trim()},t}();e.MML=i},7878:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.MediaModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.source=null,n.media=null,n.ext="",n.autoplay=!1,n.mediaSource=null,n.sourceBuffer=null,n.file="",n.mimeType="",n.listeners={},n.onSourceOpen=n.onSourceOpen.bind(n),n.onSourceEnded=n.onSourceEnded.bind(n),n.onSourceClose=n.onSourceClose.bind(n),n.onSourceBufferUpdateEnd=n.onSourceBufferUpdateEnd.bind(n),n.onSourceBufferError=n.onSourceBufferError.bind(n),n}return i(e,t),e.prototype.setup=function(t){var e=this;this.envelopegenerator.setGenerator(0),this.envelopegenerator.param({attack:0,decay:.01,sustain:1,release:.01});var r=t.media,n=t.formats,i=t.listeners,s=t.autoplay;if(!r)return this;this.media=r;for(var o=0,a=null!=n?n:[];o<a.length;o++){var c=a[o],u="audio/".concat(c),l="video/".concat(c),h=this.media.canPlayType(u),p=this.media.canPlayType(l);if(/^(?:maybe|probably)/.test(h)||/^(?:maybe|probably)/.test(p)){this.ext=c;break}}return i&&(this.listeners=i,Object.keys(i).forEach((function(t){var r=i[t];"function"==typeof r&&(i[t]=r),e.media&&e.media.addEventListener(t,r,!1)}))),this.media.addEventListener("loadstart",(function(){null!==e.media&&null===e.source&&(e.source=e.context.createMediaElementSource(e.media))}),!1),this.media.addEventListener("ended",(function(){null!==e.media&&(e.media.pause(),e.off(e.context.currentTime),e.analyser.stop("time"),e.analyser.stop("fft"),e.processor.disconnect(0),e.processor.onaudioprocess=null)}),!1),this.autoplay=null!=s&&s,this.autoplay&&null===this.source&&(this.source=this.context.createMediaElementSource(this.media)),this.autoplay&&this.media.src&&this.context.resume().then((function(){var t,r;e.start(null!==(r=null===(t=e.media)||void 0===t?void 0:t.currentTime)&&void 0!==r?r:0)})).catch((function(){throw new Error("Autoplay is failed")})),this},e.prototype.ready=function(t,e){if(null===this.media)return this;this.mediaSource&&"open"===this.mediaSource.readyState&&(this.mediaSource.endOfStream(),window.URL.revokeObjectURL(this.media.src),this.mediaSource.removeEventListener("sourceopen",this.onSourceOpen,!1),this.mediaSource.removeEventListener("sourceended",this.onSourceEnded,!1),this.mediaSource.removeEventListener("sourceclose",this.onSourceClose,!1),this.sourceBuffer&&(this.sourceBuffer.removeEventListener("updateend",this.onSourceBufferUpdateEnd,!1),this.sourceBuffer.removeEventListener("error",this.onSourceBufferError,!1)));try{if(e){if(!MediaSource||!MediaSource.isTypeSupported(e))throw new Error("This Browser does not support `MediaSource` or MIME type");this.media.removeAttribute("src"),this.media.load(),this.mediaSource=new MediaSource,this.media.src=window.URL.createObjectURL(this.mediaSource),this.mimeType=e,this.file=t,this.mediaSource.addEventListener("sourceopen",this.onSourceOpen,!1),this.mediaSource.addEventListener("sourceended",this.onSourceEnded,!1),this.mediaSource.addEventListener("sourceclose",this.onSourceClose,!1)}else t.startsWith("blob:")||""===this.ext?this.media.src=t:this.media.src="".concat(t,".").concat(this.ext)}catch(t){if(t instanceof Error)throw new Error(t.message)}return this},e.prototype.start=function(t,e){var r=this;return null===this.source||null===this.media||(this.envelopegenerator.ready(0,this.source,this.processor),this.connect(this.processor),this.media.play().then((function(){if(null!==r.media){var e=r.context.currentTime;r.media.currentTime=null!=t?t:0,r.envelopegenerator.start(e),Number.isFinite(r.media.duration)&&r.envelopegenerator.stop(e+(r.media.duration-r.media.currentTime)/r.media.playbackRate,!0),r.on(e),r.analyser.start("time"),r.analyser.start("fft"),r.processor.onaudioprocess=function(t){var e=t.inputBuffer.getChannelData(0),r=t.inputBuffer.getChannelData(1),n=t.outputBuffer.getChannelData(0),i=t.outputBuffer.getChannelData(1);n.set(e),i.set(r)}}})).catch((function(){r.stop((function(){null!==r.media&&(r.autoplay&&(r.media.muted=!0,r.media.volume=0),r.start(t))}),e)}))),this},e.prototype.stop=function(t,e){var r=this;return null===this.source||null===this.media||this.media.play().then((function(){null!==r.media&&(r.media.pause(),r.off(r.context.currentTime),r.analyser.stop("time"),r.analyser.stop("fft"),r.media||(r.processor.disconnect(0),r.processor.onaudioprocess=null),t&&t())})).catch((function(t){e&&e(t)})),this},e.prototype.param=function(t){var e,r,n,i,s,o,a,c,u,l,h,p,f;if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"autoplay":return this.autoplay;case"playbackRate":return null!==(r=null===(e=this.media)||void 0===e?void 0:e.playbackRate)&&void 0!==r?r:1;case"currentTime":return null!==(i=null===(n=this.media)||void 0===n?void 0:n.currentTime)&&void 0!==i?i:0;case"controls":return null!==(o=null===(s=this.media)||void 0===s?void 0:s.controls)&&void 0!==o&&o;case"loop":return null!==(c=null===(a=this.media)||void 0===a?void 0:a.loop)&&void 0!==c&&c;case"muted":return null!==(l=null===(u=this.media)||void 0===u?void 0:u.muted)&&void 0!==l&&l;case"duration":return Number.isNaN(null===(h=this.media)||void 0===h?void 0:h.duration)?0:null!==(f=null===(p=this.media)||void 0===p?void 0:p.duration)&&void 0!==f?f:0;default:return this}for(var d=0,v=Object.entries(t);d<v.length;d++){var y=v[d],m=y[0],b=y[1];switch(m){case"mastervolume":"number"==typeof b&&(this.mastervolume.gain.value=b);break;case"playbackRate":if(this.media&&"number"==typeof b&&b>0){this.media.playbackRate=b;var g=this.context.currentTime,w=this.media.currentTime,A=this.media.duration;this.envelopegenerator.start(g),Number.isFinite(A)&&this.envelopegenerator.stop(g+(A-w)/b,!0)}break;case"currentTime":if(this.media&&"number"==typeof b){this.media.currentTime=b;g=this.context.currentTime,A=this.media.duration;var T=this.media.playbackRate;this.envelopegenerator.start(g),Number.isFinite(A)&&this.envelopegenerator.stop(g+(A-b)/T,!0)}break;case"controls":this.media&&"boolean"==typeof b&&(this.media.controls=b);break;case"loop":this.media&&"boolean"==typeof b&&(this.media.loop=b);break;case"muted":this.media&&"boolean"==typeof b&&(this.media.muted=b)}}return this},e.prototype.get=function(){return this.source},e.prototype.hasMedia=function(){return null!==this.media},e.prototype.hasSource=function(){return null!==this.source},e.prototype.paused=function(){return null===this.media||this.media.paused},e.prototype.fadeIn=function(t){var e,r,n,i,s,o;if("number"!=typeof t)return this.envelopegenerator.param("attack");this.envelopegenerator.param({attack:t});var a=this.context.currentTime,c=null!==(r=null===(e=this.media)||void 0===e?void 0:e.currentTime)&&void 0!==r?r:0,u=null!==(i=null===(n=this.media)||void 0===n?void 0:n.duration)&&void 0!==i?i:0,l=null!==(o=null===(s=this.media)||void 0===s?void 0:s.playbackRate)&&void 0!==o?o:1;return this.envelopegenerator.start(a),this.envelopegenerator.stop(a+(u-c)/l,!0),this},e.prototype.fadeOut=function(t){var e,r,n,i,s,o;if("number"!=typeof t)return this.envelopegenerator.param("release");this.envelopegenerator.param({release:t});var a=this.context.currentTime,c=null!==(r=null===(e=this.media)||void 0===e?void 0:e.currentTime)&&void 0!==r?r:0,u=null!==(i=null===(n=this.media)||void 0===n?void 0:n.duration)&&void 0!==i?i:0,l=null!==(o=null===(s=this.media)||void 0===s?void 0:s.playbackRate)&&void 0!==o?o:1;return this.envelopegenerator.start(a),this.envelopegenerator.stop(a+(u-c)/l,!0),this},e.prototype.requestPictureInPicture=function(){return this.media instanceof HTMLVideoElement&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled?this.media.disablePictureInPicture||0===this.media.readyState||this.media===document.pictureInPictureElement?Promise.reject():this.media.requestPictureInPicture():Promise.reject()},e.prototype.exitPictureInPicture=function(){return this.media instanceof HTMLVideoElement&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled?this.media.disablePictureInPicture||0===this.media.readyState||this.media!==document.pictureInPictureElement?Promise.reject():document.exitPictureInPicture():Promise.reject()},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"bitcrusher":return this.bitcrusher;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"fuzz":return this.fuzz;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"overdrive":return this.overdrive;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"preamp":return this.preamp;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e,r,n,i,o,a,c,u,l,h,p,f,d,v,y=t.prototype.params.call(this);return s(s({},y),{autoplay:this.autoplay,playbackRate:null!==(r=null===(e=this.media)||void 0===e?void 0:e.playbackRate)&&void 0!==r?r:1,controls:null!==(i=null===(n=this.media)||void 0===n?void 0:n.controls)&&void 0!==i&&i,loop:null!==(a=null===(o=this.media)||void 0===o?void 0:o.loop)&&void 0!==a&&a,muted:null!==(u=null===(c=this.media)||void 0===c?void 0:c.muted)&&void 0!==u&&u,currentTime:null!==(h=null===(l=this.media)||void 0===l?void 0:l.currentTime)&&void 0!==h?h:0,duration:Number.isNaN(null!==(f=null===(p=this.media)||void 0===p?void 0:p.duration)&&void 0!==f?f:0)?0:null!==(v=null===(d=this.media)||void 0===d?void 0:d.duration)&&void 0!==v?v:0,vocalcanceler:this.vocalcanceler.params()})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e.prototype.onSourceOpen=function(t){var e=this;if(null!==this.mediaSource){this.sourceBuffer=this.mediaSource.addSourceBuffer(this.mimeType),this.sourceBuffer.mode="sequence",this.sourceBuffer.addEventListener("updateend",this.onSourceBufferUpdateEnd,!1),this.sourceBuffer.addEventListener("error",this.onSourceBufferError,!1);var r=new Request(this.file);fetch(r).then((function(t){return t.arrayBuffer()})).then((function(t){e.sourceBuffer&&e.sourceBuffer.appendBuffer(t)})).catch((function(t){e.listeners.error&&e.listeners.error(t)})).finally((function(){e.listeners.sourceopen&&e.listeners.sourceopen(t)}))}},e.prototype.onSourceEnded=function(t){this.listeners.sourceended&&this.listeners.sourceended(t)},e.prototype.onSourceClose=function(t){this.listeners.sourceclose&&this.listeners.sourceclose(t)},e.prototype.onSourceBufferUpdateEnd=function(t){this.listeners.updateend&&this.listeners.updateend(t)},e.prototype.onSourceBufferError=function(t){this.listeners.error&&this.listeners.error(t)},e}(r(2188).SoundModule);e.MediaModule=o},6567:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.MixerModule=void 0;var s=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.sources=[],n.gainNodes=[],n}return i(e,t),e.prototype.setup=function(){return this},e.prototype.ready=function(){return this},e.prototype.start=function(t,e){this.sources=t;for(var r=0,n=this.sources.length;r<n;r++){var i=this.sources[r],s=this.context.currentTime;i.off(s),i.suspend(),i.mix(),i.INPUT&&(this.gainNodes[r]=this.context.createGain(),this.gainNodes[r].gain.value=e?e[r]:1,i.INPUT.connect(this.gainNodes[r]),this.gainNodes[r].connect(this.processor))}this.connect(this.processor);var o=this.context.currentTime;return this.on(o),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.processor.onaudioprocess=function(t){var e=t.inputBuffer.getChannelData(0),r=t.inputBuffer.getChannelData(1),n=t.outputBuffer.getChannelData(0),i=t.outputBuffer.getChannelData(1);n.set(e),i.set(r)},this},e.prototype.stop=function(){var t=this.context.currentTime;this.off(t),this.suspend();for(var e=0,r=this.sources;e<r.length;e++){var n=r[e];n.demix(),n.INPUT&&(n.INPUT.disconnect(0),n.connect(n.INPUT))}for(var i=0,s=this.gainNodes;i<s.length;i++){s[i].disconnect(0)}return this},e.prototype.param=function(t){if("string"==typeof t)return"mastervolume"===t?this.mastervolume.gain.value:this;for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];if("mastervolume"===i)"number"==typeof s&&(this.mastervolume.gain.value=s)}return this},e.prototype.get=function(){return this.sources},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"bitcrusher":return this.bitcrusher;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"fuzz":return this.fuzz;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"overdrive":return this.overdrive;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"preamp":return this.preamp;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(r(2188).SoundModule);e.MixerModule=s},4903:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.NoiseModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.type="whitenoise",n.envelopegenerator.setGenerator(0),n}return i(e,t),e.prototype.setup=function(){return this},e.prototype.ready=function(){return this},e.prototype.start=function(){var t=this,e=this.context.currentTime;if(!this.mixed){this.envelopegenerator.clear(!0),this.processor.disconnect(0),this.processor.onaudioprocess=null;var r=this.envelopegenerator.getGenerator(0);r&&this.connect(r)}this.envelopegenerator.ready(0,this.processor,null),this.envelopegenerator.start(e),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.on(e);var n=this.processor.bufferSize,i=0,s=0,o=0,a=0,c=0,u=0,l=0,h=0;return this.processor.onaudioprocess=function(e){var r=e.outputBuffer.getChannelData(0),p=e.outputBuffer.getChannelData(1);if(t.envelopegenerator.paused())t.mixed||(t.processor.disconnect(0),t.processor.onaudioprocess=null),t.analyser.stop("time"),t.analyser.stop("fft"),t.runningAnalyser=!1;else switch(t.type){case"whitenoise":for(var f=0;f<n;f++)r[f]=2*(Math.random()-.5),p[f]=2*(Math.random()-.5);break;case"pinknoise":for(f=0;f<n;f++){var d=2*Math.random()-1;i=.99886*i+.0555179*d,s=.99332*s+.0750759*d,o=.969*o+.153852*d,a=.8665*a+.3104856*d,c=.55*c+.5329522*d,u=-.7616*u-.016898*d,r[f]=i+s+o+a+c+u+l+.5362*d,p[f]=i+s+o+a+c+u+l+.5362*d,r[f]*=.11,p[f]*=.11,l=.115926*d}break;case"browniannoise":for(f=0;f<n;f++){d=2*Math.random()-1;r[f]=(h+.02*d)/1.02,p[f]=(h+.02*d)/1.02,h=(h+.02*d)/1.02,r[f]*=3.5,p[f]*=3.5}}},this},e.prototype.stop=function(){var t=this.context.currentTime;return this.envelopegenerator.stop(t),this.off(t),this},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"type":return this.type;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"mastervolume":"number"==typeof s&&(this.mastervolume.gain.value=s);break;case"type":"string"==typeof s&&(this.type=s)}}return this},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"bitcrusher":return this.bitcrusher;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"fuzz":return this.fuzz;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"overdrive":return this.overdrive;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"preamp":return this.preamp;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){t.prototype.suspend.call(this);var e=this.envelopegenerator.getGenerator(0);return e&&(e.disconnect(0),this.processor.connect(e)),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e=t.prototype.params.call(this);return s(s({},e),{type:this.type})},Object.defineProperty(e.prototype,"INPUT",{get:function(){var t=this.envelopegenerator.getGenerator(0);return t||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(r(2188).SoundModule);e.NoiseModule=o},5146:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.OneshotModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.sources=[],n.resources=[],n.buffers=[],n.volumes=[],n.states=[],n.settings=[],n.startTime=0,n.duration=0,n.transpose=0,n.paused=!0,n.loadError=!1,n}return i(e,t),e.prototype.setup=function(t){for(var e=t.resources,r=t.settings,n=t.timeout,i=t.successCallback,s=t.errorCallback,o=t.progressCallback,a=0,c=r.length;a<c;a++)this.states[a]=!1,this.volumes[a]=this.context.createGain(),this.settings[a]=r[a],this.envelopegenerator.setGenerator(a);var u=0;for(c=e.length;u<c;u++){this.resources[u]=e[u];var l=this.resources[u];"string"==typeof l?this.load({url:l,index:u,timeout:n,successCallback:i,errorCallback:s,progressCallback:o}):this.buffers[u]=l}return this},e.prototype.ready=function(t,e){return this.startTime=null!=t?t:this.context.currentTime,this.duration=null!=e?e:0,this.envelopegenerator.clear(!1),this},e.prototype.start=function(t){var e=this,r=this.context.currentTime+this.startTime;this.mixed||(this.envelopegenerator.clear(!1),this.connect(this.processor));for(var n=function(t){if(t<0||t>=i.settings.length)return"continue";var n=i.settings[t],s=n.bufferIndex,o=n.playbackRate,a=n.loop,c=n.loopStart,u=n.loopEnd,l=n.volume,h=i.context.createBufferSource();h.buffer=i.buffers[s],h.playbackRate.value=null!=o?o:1,h.detune.value=100*i.transpose,h.loop=null!=a&&a,h.loopStart=null!=c?c:0,h.loopEnd=null!=u?u:h.buffer.duration,i.volumes[t].gain.value=null!=l?l:1,i.envelopegenerator.ready(t,h,i.volumes[t]),i.volumes[t].connect(i.processor),h.loop?h.start(r,r+h.loopStart,h.loopEnd-r):h.start(r),i.sources[t]=h,i.states[t]=!0,h.onended=function(){e.states[t]=!1}},i=this,s=0,o=t;s<o.length;s++){n(o[s])}return this.envelopegenerator.start(r),this.on(r),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.processor.onaudioprocess=function(r){if(e.paused=!e.states.some((function(t){return t})),e.paused)e.stop(t),e.off(e.context.currentTime),e.envelopegenerator.clear(!1),e.analyser.stop("time"),e.analyser.stop("fft"),e.runningAnalyser=!1,e.mixed||(e.processor.disconnect(0),e.processor.onaudioprocess=null);else{var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1);s.set(n),o.set(i)}},this},e.prototype.stop=function(t){var e=this;if(t.every((function(t){return!(t<0||t>=e.settings.length)&&"number"==typeof e.settings[t].bufferIndex}))){var r=this.context.currentTime+this.startTime+this.duration;this.envelopegenerator.stop(r),this.filter.stop(r)}return this},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"transpose":return this.transpose;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"mastervolume":"number"==typeof s&&(this.mastervolume.gain.value=s);break;case"transpose":"number"==typeof s&&(this.transpose=s)}}return this},e.prototype.get=function(t){return"number"==typeof t&&t>=0&&t<this.buffers.length?this.buffers[t]:this.buffers},e.prototype.reset=function(t,e,r){if(t>=0&&t<this.settings.length)switch(e){case"bufferIndex":case"playbackRate":case"loopStart":case"loopEnd":case"volume":"number"==typeof r&&(this.settings[t][e]=r);break;case"loop":"boolean"==typeof r&&(this.settings[t][e]=r)}return this},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"bitcrusher":return this.bitcrusher;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"fuzz":return this.fuzz;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"overdrive":return this.overdrive;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"preamp":return this.preamp;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e=t.prototype.params.call(this);return s(s({},e),{transpose:this.transpose})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e.prototype.load=function(t){var e=this,r=t.url,n=t.index,i=t.timeout,s=t.successCallback,o=t.errorCallback,a=t.progressCallback,c=new XMLHttpRequest;c.timeout=null!=i?i:6e4,c.ontimeout=function(t){!e.loadError&&o&&o(t,"timeout"),e.loadError=!0},c.onprogress=function(t){e.loadError?c.abort():a&&a(t)},c.onerror=function(t){!e.loadError&&o&&o(t,"error"),e.loadError=!0},c.onload=function(t){if(200===c.status){var r=c.response;if(!(r instanceof ArrayBuffer))return;e.context.decodeAudioData(r,(function(r){e.buffers[n]=r;for(var i=0,o=e.buffers;i<o.length;i++){if(void 0===o[i])return}s&&s(t,e.buffers)}),(function(t){o&&o(t,"decode")}))}},c.open("GET",r,!0),c.responseType="arraybuffer",c.send(null)},e}(r(2188).SoundModule);e.OneshotModule=o},9069:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Glide=void 0;var r=function(){function t(t){this.type="linear",this.time=0,this.prevFrequency=-1,this.nextFrequency=0,this.isActive=!0,this.context=t}return t.prototype.ready=function(t){this.nextFrequency=t;var e=-1===this.prevFrequency?0:this.nextFrequency-this.prevFrequency;this.isActive&&0!==this.time&&0!==e||(this.prevFrequency=this.nextFrequency)},t.prototype.start=function(t,e){var r=null!=e?e:this.context.currentTime,n=r+this.time;t.frequency.cancelScheduledValues(r),t.frequency.setValueAtTime(this.prevFrequency,r),"exponential"===this.type?t.frequency.exponentialRampToValueAtTime(this.nextFrequency,n):t.frequency.linearRampToValueAtTime(this.nextFrequency,n)},t.prototype.stop=function(){this.prevFrequency=this.nextFrequency},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"type":return this.type;case"time":return this.time;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"type":"string"==typeof s&&(this.type=s);break;case"time":"number"==typeof s&&(this.time=s)}}return this},t.prototype.params=function(){return{state:this.isActive,type:this.type,time:this.time}},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this},t.prototype.deactivate=function(){return this.isActive=!1,this},t}();e.Glide=r},9565:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Oscillator=void 0;var r=function(){function t(t,e){this.octave=0,this.fine=0,this.custom={real:new Float32Array([0,1]),imag:new Float32Array([0,1])},this.paused=!0,this.context=t,this.source=t.createOscillator(),this.volume=t.createGain(),this.isActive=e}return t.prototype.ready=function(t){if(this.isActive){var e=this.source.type,r=this.source.frequency.value,n=this.source.detune.value;if(this.paused||(this.source.stop(this.context.currentTime),this.source.disconnect(0)),this.source=this.context.createOscillator(),"custom"===e){var i=this.custom.real,s=this.custom.imag,o=this.context.createPeriodicWave(i,s);this.source.setPeriodicWave(o)}else this.source.type=e;this.source.frequency.value=r,this.source.detune.value=n,this.volume.connect(t)}},t.prototype.start=function(t){this.isActive?(this.source.start(null!=t?t:this.context.currentTime),this.paused=!1):(this.paused||(this.source.stop(this.context.currentTime),this.paused=!0),this.source.disconnect(0))},t.prototype.stop=function(t){this.paused||(this.source.stop(null!=t?t:this.context.currentTime),this.source.disconnect(0),this.paused=!0)},t.prototype.param=function(e){if("string"==typeof e)switch(e){case"state":return this.isActive;case"type":return this.source.type;case"octave":return this.octave;case"fine":return this.fine;case"volume":return this.volume.gain.value;default:return this}for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],s=i[0],o=i[1];switch(s){case"state":"boolean"==typeof o&&(this.isActive=o);break;case"type":if("string"==typeof o)this.source.type=o;else if("object"==typeof o){var a=o.real,c=o.imag,u=4096;a.length>u&&(a=a.subarray(0,u)),c.length>u&&(c=c.subarray(0,u)),0!==a[0]&&(a[0]=0),0!==c[0]&&(c[0]=0);var l=this.context.createPeriodicWave(a,c);this.source.setPeriodicWave(l),this.custom.real=a,this.custom.imag=c}break;case"octave":"number"==typeof o&&(this.octave=o,this.source.detune.value=this.fine+o*t.OCTAVE);break;case"fine":"number"==typeof o&&(this.fine=o,this.source.detune.value=o+this.octave*t.OCTAVE);break;case"volume":"number"==typeof o&&(this.volume.gain.value=o)}}return this},t.prototype.get=function(){return this.source},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this},t.prototype.deactivate=function(){return this.isActive=!1,this},t.prototype.params=function(){return{state:this.isActive,type:this.source.type,octave:this.octave,fine:this.fine,volume:this.volume.gain.value}},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.source},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.volume},enumerable:!1,configurable:!0}),t.OCTAVE=1200,t}();e.Oscillator=r},6667:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.OscillatorModule=void 0;var o=r(2188),a=r(9069),c=r(9565),u=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.sources=[],n.startTime=0,n.duration=0,n.glide=new a.Glide(e),n}return i(e,t),e.prototype.setup=function(t){this.sources.length=0;for(var e=0,r=t.length;e<r;e++)this.sources[e]=new c.Oscillator(this.context,t[e]),this.envelopegenerator.setGenerator(e);return this},e.prototype.ready=function(t,e){return this.startTime=null!=t?t:this.context.currentTime,this.duration=null!=e?e:0,this.envelopegenerator.clear(!0),this},e.prototype.start=function(t){var e=this,r=this.context.currentTime+this.startTime;this.mixed||(this.envelopegenerator.clear(!0),this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect(this.processor));for(var n=0,i=t.length;n<i&&!(n>=this.sources.length);n++){var s=this.sources[n],o=t[n];s.ready(this.processor),this.envelopegenerator.ready(n,s.INPUT,s.OUTPUT),this.glide.ready(o),this.glide.start(s.INPUT,r),s.start(r)}return this.envelopegenerator.start(r),this.on(r),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.processor.onaudioprocess=function(t){var r=t.inputBuffer.getChannelData(0),n=t.inputBuffer.getChannelData(1),i=t.outputBuffer.getChannelData(0),s=t.outputBuffer.getChannelData(1);if(e.envelopegenerator.paused()){for(var o=e.context.currentTime,a=0,c=e.sources;a<c.length;a++){c[a].stop(o)}e.off(o),e.analyser.stop("time"),e.analyser.stop("fft"),e.runningAnalyser=!1,e.mixed||(e.processor.disconnect(0),e.processor.onaudioprocess=null)}else i.set(r),s.set(n)},this},e.prototype.stop=function(){var t=this.context.currentTime+this.startTime+this.duration;return this.envelopegenerator.stop(t,!1),this.glide.stop(),this.filter.stop(t),this},e.prototype.param=function(t){if("string"==typeof t)return"mastervolume"===t?this.mastervolume.gain.value:this;for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];if("mastervolume"===i)"number"==typeof s&&(this.mastervolume.gain.value=s)}return this},e.prototype.get=function(t){return"number"==typeof t&&t>=0&&t<this.sources.length?this.sources[t]:this.sources},e.prototype.length=function(){return this.sources.length},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"bitcrusher":return this.bitcrusher;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"fuzz":return this.fuzz;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"overdrive":return this.overdrive;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"preamp":return this.preamp;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;case"glide":return this.glide;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e=t.prototype.params.call(this);return s(s({},e),{oscillator:{glide:this.glide.params(),params:this.sources.map((function(t){return t.params()}))}})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(o.SoundModule);e.OscillatorModule=u},6954:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.ProcessorModule=void 0;var s=r(2188),o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.workletNode=null,n.processorName="",n.options={},n.moduleURL="",n.envelopegenerator.setGenerator(0),window.AudioWorkletNode||(n.workletNode=n.context.createScriptProcessor(r,s.SoundModule.NUMBER_OF_INPUTS,s.SoundModule.NUMBER_OF_OUTPUTS)),n}return i(e,t),e.prototype.setup=function(t,e){return this.processorName=t,this.options=null!=e?e:{},this},e.prototype.ready=function(t,e){var r=this;return window.AudioWorkletNode?(this.moduleURL=t,this.context.audioWorklet.addModule(this.moduleURL,null!=e?e:{credentials:"same-origin"}).then((function(){r.workletNode=new AudioWorkletNode(r.context,r.processorName,r.options)}))):Promise.reject()},e.prototype.start=function(t){var e=this.envelopegenerator.getGenerator(0);if(null===this.workletNode||null===e)return this;var r=this.context.currentTime;return this.mixed||(this.envelopegenerator.clear(!0),this.workletNode.disconnect(0),this.workletNode instanceof ScriptProcessorNode&&(this.workletNode.onaudioprocess=null),this.connect(e)),this.envelopegenerator.ready(0,this.workletNode,null),this.envelopegenerator.start(r),this.runningAnalyser||(this.analyser.start("time"),this.analyser.start("fft"),this.runningAnalyser=!0),this.on(r),this.workletNode instanceof ScriptProcessorNode&&t&&(this.workletNode.onaudioprocess=t),this},e.prototype.stop=function(){if(null===this.workletNode)return this;var t=this.context.currentTime;return this.mixed||this.workletNode.disconnect(0),this.envelopegenerator.stop(t),this.off(t),this},e.prototype.postMessage=function(t){return null===this.workletNode||this.workletNode instanceof ScriptProcessorNode||this.workletNode.port.postMessage(t),this},e.prototype.onMessage=function(t){return null===this.workletNode||this.workletNode instanceof ScriptProcessorNode||(this.workletNode.port.onmessage=t),this},e.prototype.onMessageError=function(t){return null===this.workletNode||this.workletNode instanceof ScriptProcessorNode||(this.workletNode.port.onmessageerror=t),this},e.prototype.map=function(){return null===this.workletNode||this.workletNode instanceof ScriptProcessorNode?null:this.workletNode.parameters},e.prototype.get=function(){return this.workletNode},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"bitcrusher":return this.bitcrusher;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"fuzz":return this.fuzz;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"overdrive":return this.overdrive;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"preamp":return this.preamp;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){t.prototype.suspend.call(this);var e=this.envelopegenerator.getGenerator(0);return this.workletNode&&e&&(e.disconnect(0),this.workletNode.connect(e)),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},Object.defineProperty(e.prototype,"INPUT",{get:function(){var t=this.envelopegenerator.getGenerator(0);return t||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(s.SoundModule);e.ProcessorModule=o},6354:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.FFT=void 0;var s=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.type="uint",n.size=256,n.textInterval=1e3,n}return i(e,t),e.prototype.setup=function(e){return t.prototype.setup.call(this,e),this},e.prototype.param=function(e){if("string"==typeof e)switch(e){case"type":return this.type;case"size":return this.size;case"textInterval":return this.textInterval;case"interval":case"styles":return t.prototype.param.call(this,e);default:return this}for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],s=i[0],o=i[1];switch(s){case"type":"string"==typeof o&&("uint"!==o&&"float"!==o||(this.type=o));break;case"size":"number"==typeof o&&(this.size=o);break;case"textInterval":"number"==typeof o&&(this.textInterval=o)}}return t.prototype.param.call(this,e),this},e.prototype.clear=function(){return t.prototype.clear.call(this),this},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.visualizeOnCanvas=function(t,e,r){var n,i,s,o,a,c,u,l,h,p,f,d;if(null!==this.canvas&&null!==this.context&&this.isActive){var v=null!=e?e:-100,y=null!=r?r:-30,m=y-v,b=this.context,g=this.canvas.width,w=this.canvas.height,A=null!==(n=this.styles.top)&&void 0!==n?n:0,T=null!==(i=this.styles.bottom)&&void 0!==i?i:0,_=null!==(s=this.styles.left)&&void 0!==s?s:30,k=g-(_+(null!==(o=this.styles.right)&&void 0!==o?o:30)),x=w-(A+T),O=null!==(a=this.styles.width)&&void 0!==a?a:1.5,S=null!==(c=this.styles.cap)&&void 0!==c?c:"round",M=null!==(u=this.styles.join)&&void 0!==u?u:"miter",E=null!==(l=this.styles.wave)&&void 0!==l?l:"rgba(0, 0, 255, 1.0)",C=null!==(h=this.styles.grid)&&void 0!==h?h:"none",P=null!==(p=this.styles.text)&&void 0!==p?p:"none",N=parseInt(null!==(d=null===(f=this.styles.font)||void 0===f?void 0:f.size)&&void 0!==d?d:"13px",10),R=this.size>t.length?t.length:this.size,j=this.sampleRate/(2*t.length),I=Math.trunc(this.textInterval/j);if(b.clearRect(0,0,g,w),"float"===this.type){b.strokeStyle=E,b.lineWidth=O,b.lineCap=S,b.lineJoin=M,b.beginPath();for(var z=0;z<R;z++){var q=z/R*k+_,F=Math.trunc(-1*(t[z]-y)*(x/m))+A;0===z?b.moveTo(q+O/2,F):b.lineTo(q,F)}b.stroke()}else switch(this.styles.shape){case"line":b.strokeStyle=E,b.lineWidth=O,b.lineCap=S,b.lineJoin=M,b.beginPath();for(z=0;z<R;z++){q=z/R*k+_,F=(1-t[z]/255)*x+A;0===z?b.moveTo(q+O/2,F):b.lineTo(q,F)}b.stroke();break;case"rect":for(z=0;z<R;z++){q=z/R*k+_,F=t[z]/255*x*-1;if(this.styles.gradients){for(var D=x+A,U=b.createLinearGradient(0,D,0,D+F),L=0,B=this.styles.gradients;L<B.length;L++){var G=B[L];U.addColorStop(G.offset,G.color)}b.fillStyle=U}else b.fillStyle=E;b.fillRect(q,x+A,O,F)}}if("none"!==C||"none"!==P){for(z=0;z<R;z++)if(z%I==0){q=Math.trunc(z/R*k)+_;var Q=Math.trunc(this.textInterval*(z/I)),X=Q<1e3?"".concat(Q," Hz"):"".concat((Q/1e3).toString(10).slice(0,3)," kHz");"none"!==C&&(b.fillStyle=C,b.fillRect(q,A,1,x)),"none"!==P&&(b.fillStyle=P,b.font=this.createFontString(),b.fillText(X,q-b.measureText(X).width/2,A+x+N))}if("float"===this.type)for(z=v;z<=y;z+=10){X="".concat(z," dB"),q=Math.trunc(_-b.measureText(X).width),F=Math.trunc(-1*(z-y)/m*x)+A;"none"!==C&&(b.fillStyle=C,b.fillRect(_,F,k,1)),"none"!==P&&(b.fillStyle=P,b.font=this.createFontString(),b.fillText(X,q,F))}else for(var V=0,W=["0.00","0.25","0.50","0.75","1.00"];V<W.length;V++){X=W[V],q=Math.trunc(_-b.measureText(X).width),F=(1-Number(X))*x+A;"none"!==C&&(b.fillStyle=C,b.fillRect(_,F,k,1)),"none"!==P&&(b.fillStyle=P,b.font=this.createFontString(),b.fillText(X,q,F))}}}},e.prototype.visualizeBySVG=function(t,r,n){var i,s,o,a,c,u,l,h,p,f,d,v,y,m,b,g,w,A,T,_,k,x,O,S,M,E,C,P,N,R,j,I;if(null!==this.svg&&this.isActive){var z=null!=r?r:-100,q=null!=n?n:-30,F=q-z,D=this.svg,U=Number(null!==(i=D.getAttribute("width"))&&void 0!==i?i:"0"),L=Number(null!==(s=D.getAttribute("height"))&&void 0!==s?s:"0"),B=null!==(o=this.styles.top)&&void 0!==o?o:0,G=null!==(a=this.styles.bottom)&&void 0!==a?a:0,Q=null!==(c=this.styles.left)&&void 0!==c?c:30,X=U-(Q+(null!==(u=this.styles.right)&&void 0!==u?u:30)),V=L-(B+G),W=null!==(l=this.styles.wave)&&void 0!==l?l:"rgba(0, 0, 255, 1.0)",H=null!==(h=this.styles.width)&&void 0!==h?h:1.5,Y=null!==(p=this.styles.cap)&&void 0!==p?p:"round",$=null!==(f=this.styles.join)&&void 0!==f?f:"miter",J=null!==(d=this.styles.grid)&&void 0!==d?d:"none",K=null!==(v=this.styles.text)&&void 0!==v?v:"none",Z=parseInt(null!==(m=null===(y=this.styles.font)||void 0===y?void 0:y.size)&&void 0!==m?m:"13px",10),tt=this.size>t.length?t.length:this.size,et=this.sampleRate/(2*t.length),rt=Math.trunc(this.textInterval/et);if(D.innerHTML="","float"===this.type){for(var nt=document.createElementNS(e.XMLNS,"path"),it="",st=0;st<tt;st++){var ot=Math.trunc(st/tt*X)+Q,at=Math.trunc(-1*(t[st]-q)*(V/F))+B;it+=0===st?"M".concat(ot+H/2," ").concat(at):" L".concat(ot," ").concat(at)}nt.setAttribute("d",it),nt.setAttribute("stroke",W),nt.setAttribute("fill","none"),nt.setAttribute("stroke-width",H.toString(10)),nt.setAttribute("stroke-linecap",Y),nt.setAttribute("stroke-linejoin",$),D.appendChild(nt)}else switch(this.styles.shape){case"line":for(nt=document.createElementNS(e.XMLNS,"path"),it="",st=0;st<tt;st++){ot=Math.trunc(st/tt*X)+Q,at=Math.trunc((1-t[st]/255)*V)+B;it+=0===st?"M".concat(ot+H/2," ").concat(at):" L".concat(ot," ").concat(at)}nt.setAttribute("d",it),nt.setAttribute("stroke",W),nt.setAttribute("fill","none"),nt.setAttribute("stroke-width",H.toString(10)),nt.setAttribute("stroke-linecap",Y),nt.setAttribute("stroke-linejoin",$),D.appendChild(nt);break;case"rect":var ct=null;this.styles.gradients&&(ct=this.createSVGLinearGradient("".concat(e.SVG_LINEAR_GRADIENT_ID_FFT,"-").concat(this.channel)));var ut=document.createElementNS(e.XMLNS,"g");null!==ct&&ut.appendChild(ct);for(st=0;st<tt;st++){var lt=document.createElementNS(e.XMLNS,"rect");ot=Math.trunc(st/tt*X)+Q,at=Math.trunc(t[st]/255*V);lt.setAttribute("x",ot.toString(10)),lt.setAttribute("y",(B+V).toString(10)),lt.setAttribute("width",H.toString(10)),lt.setAttribute("height",Math.abs(at).toString(10)),at>=0&&lt.setAttribute("transform","rotate(180 ".concat(ot+H/2," ").concat(B+V,")")),lt.setAttribute("stroke","none"),lt.setAttribute("fill",null===ct?W:"url(#".concat(e.SVG_LINEAR_GRADIENT_ID_FFT,"-").concat(this.channel,")")),ut.appendChild(lt)}D.appendChild(ut)}if("none"!==J||"none"!==K){for(st=0;st<tt;st++)if(st%rt==0){ot=Math.trunc(st/tt*X)+Q;var ht=Math.trunc(this.textInterval*(st/rt)),pt=ht<1e3?"".concat(ht," Hz"):"".concat((ht/1e3).toString(10).slice(0,3)," kHz");if("none"!==J)(lt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",ot.toString(10)),lt.setAttribute("y",B.toString(10)),lt.setAttribute("width","1"),lt.setAttribute("height",V.toString(10)),lt.setAttribute("stroke","none"),lt.setAttribute("fill",J),D.appendChild(lt);if("none"!==K)(vt=document.createElementNS(e.XMLNS,"text")).textContent=pt,vt.setAttribute("x",ot.toString(10)),vt.setAttribute("y",(B+V).toString(10)),vt.setAttribute("text-anchor","middle"),vt.setAttribute("stroke","none"),vt.setAttribute("fill",K),vt.setAttribute("font-family",null!==(g=null===(b=this.styles.font)||void 0===b?void 0:b.family)&&void 0!==g?g:"Arial"),vt.setAttribute("font-size",Z.toString(10)),vt.setAttribute("font-style",null!==(A=null===(w=this.styles.font)||void 0===w?void 0:w.style)&&void 0!==A?A:"normal"),vt.setAttribute("font-weight",null!==(_=null===(T=this.styles.font)||void 0===T?void 0:T.weight)&&void 0!==_?_:"normal"),D.appendChild(vt)}if("float"===this.type)for(st=z;st<=q;st+=10){pt="".concat(st,"dB"),ot=Q,at=Math.trunc(-1*(st-q)/F*V)+B;if("none"!==J)(lt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",ot.toString(10)),lt.setAttribute("y",at.toString(10)),lt.setAttribute("width",X.toString(10)),lt.setAttribute("height","1"),lt.setAttribute("stroke","none"),lt.setAttribute("fill",J),D.appendChild(lt);if("none"!==J)(vt=document.createElementNS(e.XMLNS,"text")).textContent=pt,vt.setAttribute("x",ot.toString(10)),vt.setAttribute("y",(at-Math.trunc(Z/4)).toString(10)),vt.setAttribute("text-anchor","end"),vt.setAttribute("stroke","none"),vt.setAttribute("fill",K),vt.setAttribute("font-family",null!==(x=null===(k=this.styles.font)||void 0===k?void 0:k.family)&&void 0!==x?x:"Arial"),vt.setAttribute("font-size",Z.toString(10)),vt.setAttribute("font-style",null!==(S=null===(O=this.styles.font)||void 0===O?void 0:O.style)&&void 0!==S?S:"normal"),vt.setAttribute("font-weight",null!==(E=null===(M=this.styles.font)||void 0===M?void 0:M.weight)&&void 0!==E?E:"normal"),D.appendChild(vt)}else for(var ft=0,dt=["0.00","0.25","0.50","0.75","1.00"];ft<dt.length;ft++){var vt;pt=dt[ft],ot=Q,at=(1-Number(pt))*V+B;if("none"!==J)(lt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",ot.toString(10)),lt.setAttribute("y",at.toString(10)),lt.setAttribute("width",X.toString(10)),lt.setAttribute("height","1"),lt.setAttribute("stroke","none"),lt.setAttribute("fill",J),D.appendChild(lt);if("none"!==K)(vt=document.createElementNS(e.XMLNS,"text")).textContent=pt,vt.setAttribute("x",ot.toString(10)),vt.setAttribute("y",(at-Math.trunc(Z/4)).toString(10)),vt.setAttribute("text-anchor","end"),vt.setAttribute("stroke","none"),vt.setAttribute("fill",K),vt.setAttribute("font-family",null!==(P=null===(C=this.styles.font)||void 0===C?void 0:C.family)&&void 0!==P?P:"Arial"),vt.setAttribute("font-size",Z.toString(10)),vt.setAttribute("font-style",null!==(R=null===(N=this.styles.font)||void 0===N?void 0:N.style)&&void 0!==R?R:"normal"),vt.setAttribute("font-weight",null!==(I=null===(j=this.styles.font)||void 0===j?void 0:j.weight)&&void 0!==I?I:"normal"),D.appendChild(vt)}}}},e}(r(1386).Visualizer);e.FFT=s},235:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Time=void 0;var s=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.type="uint",n.textInterval=.005,n}return i(e,t),e.prototype.setup=function(e){return t.prototype.setup.call(this,e),this},e.prototype.param=function(e){if("string"==typeof e)switch(e){case"type":return this.type;case"textInterval":return this.textInterval;case"interval":case"styles":return t.prototype.param.call(this,e);default:return this}for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],s=i[0],o=i[1];switch(s){case"type":"string"==typeof o&&("uint"!==o&&"float"!==o||(this.type=o));break;case"textInterval":"number"==typeof o&&(this.textInterval=o)}}return t.prototype.param.call(this,e),this},e.prototype.clear=function(){return t.prototype.clear.call(this),this},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.visualizeOnCanvas=function(t,e,r){var n,i,s,o,a,c,u,l,h,p,f,d;if(null!==this.canvas&&null!==this.context&&this.isActive){var v=this.context,y=this.canvas.width,m=this.canvas.height,b=null!==(n=this.styles.top)&&void 0!==n?n:15,g=null!==(i=this.styles.bottom)&&void 0!==i?i:15,w=null!==(s=this.styles.left)&&void 0!==s?s:30,A=y-(w+(null!==(o=this.styles.right)&&void 0!==o?o:30)),T=m-(b+g),_=Math.trunc(T/2)+b,k=null!==(a=this.styles.width)&&void 0!==a?a:1.5,x=null!==(c=this.styles.cap)&&void 0!==c?c:"round",O=null!==(u=this.styles.join)&&void 0!==u?u:"miter",S=null!==(l=this.styles.wave)&&void 0!==l?l:"rgba(0, 0, 255, 1.0)",M=null!==(h=this.styles.grid)&&void 0!==h?h:"none",E=null!==(p=this.styles.text)&&void 0!==p?p:"none",C=parseInt(null!==(d=null===(f=this.styles.font)||void 0===f?void 0:f.size)&&void 0!==d?d:"13px",10),P=Math.trunc(this.textInterval*this.sampleRate);if(v.clearRect(0,0,y,m),"float"===this.type)t instanceof Float32Array&&this.visualizeTimeDomainFloat32ArrayOnCanvas(v,t,A,T,_);else switch(this.styles.shape){case"line":v.strokeStyle=S,v.lineWidth=k,v.lineCap=x,v.lineJoin=O,v.beginPath();for(var N=0,R=t.length;N<R;N++){var j=N/R*A+w,I=(1-t[N]/255)*T+b;0===N?v.moveTo(j+k/2,I):v.lineTo(j,I)}v.stroke();break;case"rect":for(N=0,R=t.length;N<R;N++){j=N/R*A+w,I=(.5-t[N]/255)*T;if(this.styles.gradients){for(var z=T/2+b,q=v.createLinearGradient(0,z,0,z+I),F=0,D=this.styles.gradients;F<D.length;F++){var U=D[F];q.addColorStop(U.offset,U.color)}v.fillStyle=q}else v.fillStyle=S;v.fillRect(j,_,1,I)}}if("none"!==M||"none"!==E){for(N=0,R=t.length;N<R;N++)if(N%P==0){j=Math.trunc(N/R*A)+w;var L="".concat(Math.trunc(N/this.sampleRate*1e3)," ms");"none"!==M&&(v.fillStyle=M,v.fillRect(j,b,1,T)),"none"!==E&&(v.fillStyle=E,v.font=this.createFontString(),v.fillText(L,j-v.measureText(L).width/2,b+T+C))}for(var B=0,G=["-1.00","-0.50"," 0.00"," 0.50"," 1.00"];B<G.length;B++){L=G[B],j=Math.trunc(w-v.measureText(L).width),I=Math.trunc((1-Number(L.trim()))*(T/2))+b;"none"!==M&&(v.fillStyle=M,v.fillRect(w,I,A,1)),"none"!==E&&(v.fillStyle=E,v.font=this.createFontString(),v.fillText(L,j,I-Math.trunc(C/4)))}}}},e.prototype.visualizeBySVG=function(t,r,n){var i,s,o,a,c,u,l,h,p,f,d,v,y,m,b,g,w,A,T,_,k,x,O,S,M,E;if(null!==this.svg&&this.isActive){var C=this.svg,P=Number(null!==(i=C.getAttribute("width"))&&void 0!==i?i:"0"),N=Number(null!==(s=C.getAttribute("height"))&&void 0!==s?s:"0"),R=null!==(o=this.styles.top)&&void 0!==o?o:15,j=null!==(a=this.styles.bottom)&&void 0!==a?a:15,I=null!==(c=this.styles.left)&&void 0!==c?c:30,z=P-(I+(null!==(u=this.styles.right)&&void 0!==u?u:30)),q=N-(R+j),F=Math.trunc(q/2)+R,D=null!==(l=this.styles.width)&&void 0!==l?l:1.5,U=null!==(h=this.styles.cap)&&void 0!==h?h:"round",L=null!==(p=this.styles.join)&&void 0!==p?p:"miter",B=null!==(f=this.styles.wave)&&void 0!==f?f:"rgba(0, 0, 255, 1.0)",G=null!==(d=this.styles.grid)&&void 0!==d?d:"none",Q=null!==(v=this.styles.text)&&void 0!==v?v:"none",X=parseInt(null!==(m=null===(y=this.styles.font)||void 0===y?void 0:y.size)&&void 0!==m?m:"13px",10),V=Math.trunc(this.textInterval*this.sampleRate);if(C.innerHTML="","float"===this.type){if(t instanceof Float32Array){var W=this.visualizeTimeDomainFloat32ArrayBySVG(t,z,q,F,0,e.SVG_LINEAR_GRADIENT_ID_TIME);null!==W&&C.appendChild(W)}}else switch(this.styles.shape){case"line":for(var H=document.createElementNS(e.XMLNS,"path"),Y="",$=0,J=t.length;$<J;$++){var K=$/J*z+I,Z=(1-t[$]/255)*q+R;Y+=0===$?"M".concat(K+D/2," ").concat(Z):" L".concat(K," ").concat(Z)}H.setAttribute("d",Y),H.setAttribute("stroke",B),H.setAttribute("fill","none"),H.setAttribute("stroke-width",D.toString(10)),H.setAttribute("stroke-linecap",U),H.setAttribute("stroke-linejoin",L),C.appendChild(H);break;case"rect":var tt=null;this.styles.gradients&&(tt=this.createSVGLinearGradient("".concat(e.SVG_LINEAR_GRADIENT_ID_TIME,"-").concat(this.channel)));var et=document.createElementNS(e.XMLNS,"g");null!==tt&&et.appendChild(tt);for($=0,J=t.length;$<J;$++){var rt=document.createElementNS(e.XMLNS,"rect");K=$/J*z+I,Z=(t[$]/255-.5)*q;rt.setAttribute("x",K.toString(10)),rt.setAttribute("y",F.toString(10)),rt.setAttribute("width",D.toString(10)),rt.setAttribute("height",Math.abs(Z).toString(10)),Z>=0&&rt.setAttribute("transform","rotate(180 ".concat(K+D/2," ").concat(F,")")),rt.setAttribute("stroke","none"),rt.setAttribute("fill",null===tt?B:"url(#".concat(e.SVG_LINEAR_GRADIENT_ID_TIME,"-").concat(this.channel,")")),et.appendChild(rt)}C.appendChild(et)}if("none"!==G||"none"!==Q){for($=0,J=t.length;$<J;$++)if($%V==0){K=Math.trunc($/J*z)+I;var nt="".concat(Math.trunc($/this.sampleRate*1e3)," ms");if("none"!==G)(rt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",K.toString(10)),rt.setAttribute("y",R.toString(10)),rt.setAttribute("width","1"),rt.setAttribute("height",q.toString(10)),rt.setAttribute("stroke","none"),rt.setAttribute("fill",G),C.appendChild(rt);if("none"!==Q)(ot=document.createElementNS(e.XMLNS,"text")).textContent=nt,ot.setAttribute("x",K.toString(10)),ot.setAttribute("y",(R+q+X).toString(10)),ot.setAttribute("text-anchor","middle"),ot.setAttribute("stroke","none"),ot.setAttribute("fill",Q),ot.setAttribute("font-family",null!==(g=null===(b=this.styles.font)||void 0===b?void 0:b.family)&&void 0!==g?g:"Arial"),ot.setAttribute("font-size",X.toString(10)),ot.setAttribute("font-style",null!==(A=null===(w=this.styles.font)||void 0===w?void 0:w.style)&&void 0!==A?A:"normal"),ot.setAttribute("font-weight",null!==(_=null===(T=this.styles.font)||void 0===T?void 0:T.weight)&&void 0!==_?_:"normal"),C.appendChild(ot)}for(var it=0,st=["-1.00","-0.50"," 0.00"," 0.50"," 1.00"];it<st.length;it++){var ot;nt=st[it],K=I,Z=Math.trunc((1-Number(nt.trim()))*(q/2))+R;if("none"!==G)(rt=document.createElementNS(e.XMLNS,"rect")).setAttribute("x",K.toString(10)),rt.setAttribute("y",Z.toString(10)),rt.setAttribute("width",z.toString(10)),rt.setAttribute("height","1"),rt.setAttribute("stroke","none"),rt.setAttribute("fill",G),C.appendChild(rt);if("none"!==Q)(ot=document.createElementNS(e.XMLNS,"text")).textContent=nt,ot.setAttribute("x",K.toString(10)),ot.setAttribute("y",(Z-Math.trunc(X/4)).toString(10)),ot.setAttribute("text-anchor","end"),ot.setAttribute("stroke","none"),ot.setAttribute("fill",Q),ot.setAttribute("font-family",null!==(x=null===(k=this.styles.font)||void 0===k?void 0:k.family)&&void 0!==x?x:"Arial"),ot.setAttribute("font-size",X.toString(10)),ot.setAttribute("font-style",null!==(S=null===(O=this.styles.font)||void 0===O?void 0:O.style)&&void 0!==S?S:"normal"),ot.setAttribute("font-weight",null!==(E=null===(M=this.styles.font)||void 0===M?void 0:M.weight)&&void 0!==E?E:"normal"),C.appendChild(ot)}}}},e}(r(1386).Visualizer);e.Time=s},9076:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.TimeOverview=void 0;var o=r(1386),a="xsound-svg-current-time",c="xsound-svg-sprite",u=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.callback=function(){},n.currentImageData=null,n.currentSVGElement=null,n.currentDataSize=0,n.currentTime={width:1,color:"rgba(0, 0, 0, 0.5)"},n.sprite="rgba(255, 255, 255, 0.25)",n.plotInterval=.0625,n.textInterval=60,n.isDown=!1,n.mode="update",n.offsetX=0,n.startTime=0,n.endTime=0,n.onMouseStart=n.onMouseStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n.onTouchStart=n.onTouchStart.bind(n),n.onTouchMove=n.onTouchMove.bind(n),n.onTouchEnd=n.onTouchEnd.bind(n),n}return i(e,t),e.prototype.setup=function(e){return t.prototype.setup.call(this,e),this},e.prototype.param=function(e){if("string"==typeof e)switch(e){case"currentTime":return this.currentTime;case"sprite":return this.sprite;case"plotInterval":return this.plotInterval;case"textInterval":return this.textInterval;case"mode":return this.mode;case"interval":case"styles":return t.prototype.param.call(this,e);default:return this}for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],o=i[0],a=i[1];switch(o){case"currentTime":"object"==typeof a&&(this.currentTime=s(s({},this.currentTime),a));break;case"sprite":"string"==typeof a&&(this.sprite=a);break;case"plotInterval":"number"==typeof a&&(this.plotInterval=a);break;case"textInterval":"number"==typeof a&&(this.textInterval=a);break;case"mode":"string"==typeof a&&("update"!==a&&"sprite"!==a||(this.mode=a))}}return t.prototype.param.call(this,e),this},e.prototype.update=function(t){var r,n,i,s,o,u,l,h,p,f,d,v,y;switch(this.graphics){case"canvas":if(null===this.currentImageData)return this;if(null===this.canvas||null===this.context)return this;var m=this.context,b=this.canvas.width,g=this.canvas.height,w=b-((null!==(r=this.styles.left)&&void 0!==r?r:30)+(null!==(n=this.styles.right)&&void 0!==n?n:30)),A=g-((null!==(i=this.styles.top)&&void 0!==i?i:15)+(null!==(s=this.styles.bottom)&&void 0!==s?s:15)),T=t*this.sampleRate/this.currentDataSize*w,_=null!==(o=this.styles.left)&&void 0!==o?o:30,k=null!==(u=this.styles.top)&&void 0!==u?u:15,x=null!==(l=this.currentTime.color)&&void 0!==l?l:"rgba(0, 0, 0, 0.5)";switch(m.clearRect(0,0,b,g),m.putImageData(this.currentImageData,0,0),this.mode){case"update":m.fillStyle=x,m.fillRect(_,k+1,T,A-1);break;case"sprite":if(0!==this.endTime){var O=Math.trunc(Math.abs(this.endTime-this.startTime)*this.sampleRate/this.currentDataSize*w);m.fillStyle=this.sprite,T>=this.offsetX?m.fillRect(_+this.offsetX,k+1,O,A-1):m.fillRect(_+this.offsetX-O,k+1,O,A-1)}m.fillStyle=x,T>=this.offsetX?m.fillRect(_+this.offsetX,k+1,Math.abs(T-this.offsetX),A-1):m.fillRect(_+T,k+1,Math.abs(T-this.offsetX),A-1)}break;case"svg":if(null===this.currentSVGElement)return this;if(this.svg){var S=this.svg.querySelector(".".concat(a));if(null===S)return this;b=Number(null!==(h=this.svg.getAttribute("width"))&&void 0!==h?h:"0"),k=null!==(p=this.styles.top)&&void 0!==p?p:15,w=b-((_=null!==(f=this.styles.left)&&void 0!==f?f:30)+(null!==(d=this.styles.right)&&void 0!==d?d:30)),T=t*this.sampleRate/this.currentDataSize*w;if("update"===this.mode)S.setAttribute("x",_.toString(10)),S.setAttribute("width",T.toString(10)),S.setAttribute("aria-label","current time");else if("sprite"===this.mode){if(0!==this.endTime){var M=this.svg.querySelector(".".concat(c));M&&(null===(v=M.parentNode)||void 0===v||v.removeChild(M));var E=document.createElementNS(e.XMLNS,"rect");E.classList.add(c);O=Math.trunc(Math.abs(this.endTime-this.startTime)*this.sampleRate/this.currentDataSize*w);E.setAttribute("y",(k+1).toString(10)),E.setAttribute("height",null!==(y=S.getAttribute("height"))&&void 0!==y?y:"0"),E.setAttribute("stroke","none"),E.setAttribute("fill",this.sprite),E.setAttribute("aria-label","current time"),T>=this.offsetX?E.setAttribute("x",(_+this.offsetX).toString(10)):E.setAttribute("x",(_+this.offsetX-O).toString(10)),E.setAttribute("width",O.toString(10)),this.svg.appendChild(E),this.svg.appendChild(S)}T>=this.offsetX?S.setAttribute("x",(_+this.offsetX).toString(10)):S.setAttribute("x",(_+T).toString(10)),S.setAttribute("width",Math.abs(T-this.offsetX).toString(10)),S.setAttribute("aria-label","sprite time")}}}return this},e.prototype.drag=function(t){var e=null;switch(this.graphics){case"canvas":if(null===this.canvas)return this;e=this.canvas;break;case"svg":if(null===this.svg)return this;e=this.svg;break;default:return this}return null===e||(t&&(this.callback=t),e.removeEventListener("mousedown",{handleEvent:this.onMouseStart},!1),e.removeEventListener("mousemove",{handleEvent:this.onMouseMove},!1),window.removeEventListener("mouseup",{handleEvent:this.onMouseUp},!1),e.removeEventListener("touchstart",{handleEvent:this.onTouchStart},!1),e.removeEventListener("touchmove",{handleEvent:this.onTouchMove},!1),window.removeEventListener("touchend",{handleEvent:this.onTouchEnd},!1),e.addEventListener("mousedown",{handleEvent:this.onMouseStart},!1),e.addEventListener("mousemove",{handleEvent:this.onMouseMove},!1),window.addEventListener("mouseup",{handleEvent:this.onMouseUp},!1),e.addEventListener("touchstart",{handleEvent:this.onTouchStart},!1),e.addEventListener("touchmove",{handleEvent:this.onTouchMove},!1),window.addEventListener("touchend",{handleEvent:this.onTouchEnd},!1)),this},e.prototype.clear=function(){return t.prototype.clear.call(this),this},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.visualizeOnCanvas=function(t,e,r){var n,i,s,o,a,c,u,l,h;if(null!==this.canvas&&null!==this.context&&this.isActive&&!(t instanceof Uint8Array)){var p=this.context,f=this.canvas.width,d=this.canvas.height,v=null!==(n=this.styles.top)&&void 0!==n?n:15,y=null!==(i=this.styles.bottom)&&void 0!==i?i:15,m=null!==(s=this.styles.left)&&void 0!==s?s:30,b=f-(m+(null!==(o=this.styles.right)&&void 0!==o?o:30)),g=d-(v+y),w=Math.trunc(g/2)+v,A=null!==(a=this.styles.grid)&&void 0!==a?a:"none",T=null!==(c=this.styles.text)&&void 0!==c?c:"none",_=parseInt(null!==(l=null===(u=this.styles.font)||void 0===u?void 0:u.size)&&void 0!==l?l:"13px",10),k=Math.trunc(this.plotInterval*this.sampleRate),x=Math.trunc(this.textInterval*this.sampleRate);if(p.clearRect(0,0,f,d),this.visualizeTimeDomainFloat32ArrayOnCanvas(p,t,b,g,w,k),"none"!==A||"none"!==T){for(var O=0,S=t.length;O<S;O++)if(O%x==0){var M=Math.trunc(O/S*b)+m,E="".concat(Math.trunc(O/this.sampleRate/60)," min");"none"!==A&&(p.fillStyle=A,p.fillRect(M,v,1,g)),"none"!==T&&(p.fillStyle=T,p.font=this.createFontString(),p.fillText(E,M-p.measureText(E).width/2,v+g+_))}for(var C=0,P=["-1.00","-0.50"," 0.00"," 0.50"," 1.00"];C<P.length;C++){E=P[C],M=Math.trunc(m-p.measureText(E).width);var N=Math.trunc((1-Number(E.trim()))*(g/2))+v;"none"!==A&&(p.fillStyle=A,p.fillRect(m,N,b,1)),"none"!==T&&(p.fillStyle=T,p.font=this.createFontString(),p.fillText(E,M,N-Math.trunc(_/4)))}}this.currentImageData=p.getImageData(0,0,f,d),this.currentDataSize=t.length,p.fillStyle=null!==(h=this.currentTime.color)&&void 0!==h?h:"rgba(0, 0, 0, 0.5)",p.fillRect(m,v,1,g)}},e.prototype.visualizeBySVG=function(t,r,n){var i,s,o,c,u,l,h,p,f,d,v,y,m,b,g,w,A,T,_,k,x,O,S;if(null!==this.svg&&this.isActive&&!(t instanceof Uint8Array)){var M=this.svg,E=Number(null!==(i=M.getAttribute("width"))&&void 0!==i?i:"0"),C=Number(null!==(s=M.getAttribute("height"))&&void 0!==s?s:"0"),P=null!==(o=this.styles.top)&&void 0!==o?o:15,N=null!==(c=this.styles.bottom)&&void 0!==c?c:15,R=null!==(u=this.styles.left)&&void 0!==u?u:30,j=E-(R+(null!==(l=this.styles.right)&&void 0!==l?l:30)),I=C-(P+N),z=Math.trunc(I/2)+P,q=null!==(h=this.styles.grid)&&void 0!==h?h:"none",F=null!==(p=this.styles.text)&&void 0!==p?p:"none",D=parseInt(null!==(d=null===(f=this.styles.font)||void 0===f?void 0:f.size)&&void 0!==d?d:"13px",10),U=Math.trunc(this.plotInterval*this.sampleRate),L=Math.trunc(this.textInterval*this.sampleRate);M.innerHTML="";var B=this.visualizeTimeDomainFloat32ArrayBySVG(t,j,I,z,U,"".concat(e.SVG_LINEAR_GRADIENT_ID_TIME_OVERVIEW,"-").concat(this.channel));if(B&&M.appendChild(B),"none"!==q||"none"!==F){for(var G=0,Q=t.length;G<Q;G++)if(G%L==0){var X=Math.trunc(G/Q*j)+R,V="".concat(Math.trunc(G/this.sampleRate/60)," min");if("none"!==q){var W=document.createElementNS(e.XMLNS,"rect");W.setAttribute("x",X.toString(10)),W.setAttribute("y",P.toString(10)),W.setAttribute("width","1"),W.setAttribute("height",I.toString(10)),W.setAttribute("stroke","none"),W.setAttribute("fill",q),M.appendChild(W)}if("none"!==F)($=document.createElementNS(e.XMLNS,"text")).textContent=V,$.setAttribute("x",X.toString(10)),$.setAttribute("y",(P+I+D).toString(10)),$.setAttribute("text-anchor","middle"),$.setAttribute("stroke","none"),$.setAttribute("fill",F),$.setAttribute("font-family",null!==(y=null===(v=this.styles.font)||void 0===v?void 0:v.family)&&void 0!==y?y:"Arial"),$.setAttribute("font-size",D.toString(10)),$.setAttribute("font-style",null!==(b=null===(m=this.styles.font)||void 0===m?void 0:m.style)&&void 0!==b?b:"normal"),$.setAttribute("font-weight",null!==(w=null===(g=this.styles.font)||void 0===g?void 0:g.weight)&&void 0!==w?w:"normal"),M.appendChild($)}for(var H=0,Y=["-1.00","-0.50"," 0.00"," 0.50"," 1.00"];H<Y.length;H++){V=Y[H],X=R;var $,J=Math.trunc((1-Number(V.trim()))*(I/2))+P;if("none"!==q){var K=document.createElementNS(e.XMLNS,"rect");K.setAttribute("x",X.toString(10)),K.setAttribute("y",J.toString(10)),K.setAttribute("width",j.toString(10)),K.setAttribute("height","1"),K.setAttribute("stroke","none"),K.setAttribute("fill",q),M.appendChild(K)}if("none"!==F)($=document.createElementNS(e.XMLNS,"text")).textContent=V,$.setAttribute("x",X.toString(10)),$.setAttribute("y",(J-Math.trunc(D/4)).toString(10)),$.setAttribute("text-anchor","end"),$.setAttribute("stroke","none"),$.setAttribute("fill",F),$.setAttribute("font-family",null!==(T=null===(A=this.styles.font)||void 0===A?void 0:A.family)&&void 0!==T?T:"Arial"),$.setAttribute("font-size",D.toString(10)),$.setAttribute("font-style",null!==(k=null===(_=this.styles.font)||void 0===_?void 0:_.style)&&void 0!==k?k:"normal"),$.setAttribute("font-weight",null!==(O=null===(x=this.styles.font)||void 0===x?void 0:x.weight)&&void 0!==O?O:"normal"),M.appendChild($)}}var Z=document.createElementNS(e.XMLNS,"rect");Z.classList.add(a),Z.setAttribute("y",(P+1).toString(10)),Z.setAttribute("height",(I-1).toString(10)),Z.setAttribute("stroke","none"),Z.setAttribute("fill",null!==(S=this.currentTime.color)&&void 0!==S?S:"rgba(0, 0, 0, 0.5)"),M.appendChild(Z),this.currentSVGElement=M,this.currentDataSize=t.length}},e.prototype.visualize=function(t,e,r){var n,i,s,o,a,c,u,l,h=0,p=0;switch(this.graphics){case"canvas":if(null===this.canvas)return;h=this.canvas.offsetLeft,p=this.canvas.width;break;case"svg":if(null===this.svg)return;h=null!==(i=null===(n=this.svg.parentElement)||void 0===n?void 0:n.offsetLeft)&&void 0!==i?i:0,p=Number(null!==(s=this.svg.getAttribute("width"))&&void 0!==s?s:"0")}var f=r-(h+(null!==(o=this.styles.left)&&void 0!==o?o:30));"canvas"===this.graphics&&(null===(a=this.canvas)||void 0===a?void 0:a.parentElement)&&(f+=this.canvas.parentElement.scrollLeft),"svg"===this.graphics&&(null===(c=this.svg)||void 0===c?void 0:c.parentElement)&&(f+=this.svg.parentElement.scrollLeft),f<0&&(f=0),f>(p-=(null!==(u=this.styles.left)&&void 0!==u?u:30)+(null!==(l=this.styles.right)&&void 0!==l?l:30))&&(f=p);var d=f/p*this.currentDataSize/this.sampleRate;"mousedown"!==e&&"touchstart"!==e||(this.offsetX=f,this.startTime=d,this.endTime=0),"mouseup"!==e&&"touchend"!==e||(this.endTime=d),this.update(d),this.startTime<=d?this.callback(t,this.startTime,d,this.mode,!0):this.startTime>d&&this.callback(t,d,this.startTime,this.mode,!1)},e.prototype.onMouseStart=function(t){"mousedown"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)),this.isDown=!0},e.prototype.onMouseMove=function(t){this.isDown&&(t.stopPropagation(),"mousemove"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)))},e.prototype.onMouseUp=function(t){this.isDown&&("mouseup"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)),this.isDown=!1)},e.prototype.onTouchStart=function(t){"touchstart"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)),this.isDown=!0},e.prototype.onTouchMove=function(t){this.isDown&&(t.stopPropagation(),t.preventDefault(),"touchmove"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)))},e.prototype.onTouchEnd=function(t){this.isDown&&("touchend"===t.type&&this.visualize(t,t.type,this.getOffsetX(t)),this.isDown=!1)},e.prototype.getOffsetX=function(t){return t instanceof MouseEvent?t.pageX:t instanceof TouchEvent?t.touches[0].pageX:0},e}(o.Visualizer);e.TimeOverview=u},1386:function(t,e){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Visualizer=void 0;var n=function(){function t(t,e){this.isActive=!1,this.graphics="",this.canvas=null,this.context=null,this.svg=null,this.interval=1e3,this.styles={shape:"line",gradients:[{offset:0,color:"rgba(0, 128, 255, 1.0)"},{offset:1,color:"rgba(0, 0, 255, 1.0)"}],wave:"rgba(0, 0, 255, 1.0)",grid:"rgba(255, 0, 0, 1.0)",text:"rgba(255, 255, 255, 1.0)",font:{family:"Arial",size:"13px",style:"normal",weight:"normal"},width:1.5,cap:"round",join:"miter",top:15,right:30,bottom:15,left:30},this.sampleRate=t,this.channel=e}return t.prototype.setup=function(t){return t instanceof HTMLCanvasElement?(this.graphics="canvas",this.canvas=t,this.context=this.canvas.getContext("2d")):t instanceof SVGSVGElement&&(this.graphics="svg",this.svg=t),this},t.prototype.start=function(t,e,r){switch(this.graphics){case"canvas":this.visualizeOnCanvas(t,e,r);break;case"svg":this.visualizeBySVG(t,e,r)}return this},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"interval":return this.interval;case"styles":return this.styles;default:return}for(var e=0,n=Object.entries(t);e<n.length;e++){var i=n[e],s=i[0],o=i[1];switch(s){case"interval":"number"==typeof o&&(this.interval=o);break;case"styles":"object"==typeof o&&(this.styles=r(r({},this.styles),o))}}},t.prototype.get=function(){switch(this.graphics){case"canvas":return this.canvas;case"svg":return this.svg;default:return null}},t.prototype.clear=function(){switch(this.graphics){case"canvas":this.canvas&&this.context&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height);break;case"svg":this.svg&&(this.svg.innerHTML="")}return this},t.prototype.create=function(){switch(this.graphics){case"canvas":return null===this.canvas?"":this.canvas.toDataURL("image/png").replace("image/png","image/octet-stream");case"svg":return null===this.svg?"":this.svg.outerHTML;default:return""}},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this},t.prototype.deactivate=function(){return this.isActive=!1,this},t.prototype.visualizeTimeDomainFloat32ArrayOnCanvas=function(t,e,r,n,i,s){var o,a,c,u,l,h,p=null!==(o=this.styles.top)&&void 0!==o?o:15,f=null!==(a=this.styles.left)&&void 0!==a?a:30,d=null!==(c=this.styles.width)&&void 0!==c?c:1.5,v=null!==(u=this.styles.cap)&&void 0!==u?u:"round",y=null!==(l=this.styles.join)&&void 0!==l?l:"miter",m=null!==(h=this.styles.wave)&&void 0!==h?h:"rgba(0, 0, 255, 1.0)";switch(this.styles.shape){case"line":t.strokeStyle=m,t.lineWidth=d,t.lineCap=v,t.lineJoin=y,t.beginPath();for(var b=0,g=e.length;b<g;b++)if(!s||b%s==0){var w=b/g*r+f,A=(1-e[b])*(n/2)+p;0===b?t.moveTo(w+t.lineWidth/2,A):t.lineTo(w,A)}t.stroke();break;case"rect":for(b=0,g=e.length;b<g;b++)if(!s||b%s==0){w=b/g*r+f,A=e[b]*(n/2)*-1;if(this.styles.gradients){for(var T=n/2+p,_=t.createLinearGradient(0,T,0,T+A),k=0,x=this.styles.gradients;k<x.length;k++){var O=x[k];_.addColorStop(O.offset,O.color)}t.fillStyle=_}else t.fillStyle=m;t.fillRect(w,i,d,A)}}},t.prototype.visualizeTimeDomainFloat32ArrayBySVG=function(e,r,n,i,s,o){var a,c,u,l,h,p,f,d=null!==(a=this.styles.top)&&void 0!==a?a:15,v=null!==(c=this.styles.left)&&void 0!==c?c:30,y=null!==(u=this.styles.width)&&void 0!==u?u:1.5,m=null!==(l=this.styles.cap)&&void 0!==l?l:"round",b=null!==(h=this.styles.join)&&void 0!==h?h:"miter",g=null!==(p=this.styles.wave)&&void 0!==p?p:"rgba(0, 0, 255, 1.0)";switch(this.styles.shape){case"line":for(var w=document.createElementNS(t.XMLNS,"path"),A="",T=0,_=e.length;T<_;T++)if(T%s==0){var k=T/_*r+v,x=(1-e[T])*(n/2)+d;A+=0===T?"M".concat(k+(null!==(f=this.styles.width)&&void 0!==f?f:1.5)/2," ").concat(x):" L".concat(k," ").concat(x)}return w.setAttribute("d",A),w.setAttribute("stroke",g),w.setAttribute("fill","none"),w.setAttribute("stroke-width",y.toString(10)),w.setAttribute("stroke-linecap",m),w.setAttribute("stroke-linejoin",b),w;case"rect":var O=null;this.styles.gradients&&(O=this.createSVGLinearGradient(o));var S=document.createElementNS(t.XMLNS,"g");null!==O&&S.appendChild(O);for(T=0,_=e.length;T<_;T++)if(T%s==0){var M=document.createElementNS(t.XMLNS,"rect");k=T/_*r+v,x=e[T]*(n/2);M.setAttribute("x",k.toString(10)),M.setAttribute("y",i.toString(10)),M.setAttribute("width",y.toString(10)),M.setAttribute("height",Math.abs(x).toString(10)),x>=0&&M.setAttribute("transform","rotate(180 ".concat(k+y/2," ").concat(i,")")),M.setAttribute("stroke","none"),M.setAttribute("fill",null===O?g:"url(#".concat(o,")")),S.appendChild(M)}return S;default:return null}},t.prototype.createSVGLinearGradient=function(e){if(!this.styles.gradients)return null;var r=document.createElementNS(t.XMLNS,"defs"),n=document.createElementNS(t.XMLNS,"linearGradient");n.setAttribute("id",e),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2","0%"),n.setAttribute("y2","100%");for(var i=0,s=this.styles.gradients;i<s.length;i++){var o=s[i],a=document.createElementNS(t.XMLNS,"stop");a.setAttribute("offset",o.offset.toString(10)),a.setAttribute("stop-color",o.color),n.appendChild(a)}return r.appendChild(n),r},t.prototype.createFontString=function(){var t,e=null!==(t=this.styles.font)&&void 0!==t?t:{},r=e.style,n=e.weight,i=e.size,s=e.family;return"".concat(null!=r?r:"normal"," ").concat(null!=n?n:"normal"," ").concat(null!=i?i:"13px",' "').concat(null!=s?s:"Arial",'"')},t.XMLNS="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.SVG_LINEAR_GRADIENT_ID_TIME_OVERVIEW="svg-linear-gradient-time-overview",t.SVG_LINEAR_GRADIENT_ID_TIME="svg-linear-gradient-time",t.SVG_LINEAR_GRADIENT_ID_FFT="svg-linear-gradient-fft",t}();e.Visualizer=n},8397:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Analyser=void 0;r(1386);var n=r(9076),i=r(235),s=r(6354),o=function(){function t(t){this.timeDomainAnimationId=null,this.timeDomainTimerId=null,this.frequencyDomainAnimationId=null,this.frequencyDomainTimerId=null,this.analyser=t.createAnalyser(),this.input=t.createGain(),this.input.connect(this.analyser),this.timeOverviewL=new n.TimeOverview(t.sampleRate,0),this.timeOverviewR=new n.TimeOverview(t.sampleRate,1),this.time=new i.Time(t.sampleRate,0),this.fft=new s.FFT(t.sampleRate,0),this.analyser.fftSize=2048,this.analyser.minDecibels=-100,this.analyser.maxDecibels=-30,this.analyser.smoothingTimeConstant=.8}return t.prototype.start=function(t,e,r){var n=this;switch(t){case"timeoverview":if((0===e||1===e)&&r)switch(e){case 0:if(r.numberOfChannels>e)(s=new Float32Array(r.length)).set(r.getChannelData(e)),this.timeOverviewL.start(s);break;case 1:if(r.numberOfChannels>e)(s=new Float32Array(r.length)).set(r.getChannelData(e)),this.timeOverviewR.start(s)}break;case"time":var i=this.time.param("interval");switch(this.time.param("type")){case"uint":var s=new Uint8Array(this.analyser.fftSize);this.analyser.getByteTimeDomainData(s),this.time.start(s);break;case"float":s=new Float32Array(this.analyser.fftSize);this.analyser.getFloatTimeDomainData(s),this.time.start(s)}"number"==typeof i&&(this.stop(t),i<0?this.timeDomainAnimationId=window.requestAnimationFrame((function(){n.start(t)})):this.timeDomainTimerId=window.setTimeout((function(){n.start(t)}),i));break;case"fft":i=this.fft.param("interval");switch(this.fft.param("type")){case"uint":s=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(s),this.fft.start(s);break;case"float":s=new Float32Array(this.analyser.frequencyBinCount);this.analyser.getFloatFrequencyData(s),this.fft.start(s,this.analyser.minDecibels,this.analyser.maxDecibels)}"number"==typeof i&&(this.stop(t),i<0?this.frequencyDomainAnimationId=window.requestAnimationFrame((function(){n.start(t)})):this.frequencyDomainTimerId=window.setTimeout((function(){n.start(t)}),i))}return this},t.prototype.stop=function(t){switch(t){case"time":"number"==typeof(e=this.time.param("interval"))&&(e<0&&this.timeDomainAnimationId?(window.cancelAnimationFrame(this.timeDomainAnimationId),this.timeDomainAnimationId=null):this.timeDomainTimerId&&(window.clearTimeout(this.timeDomainTimerId),this.timeDomainTimerId=null));break;case"fft":var e;"number"==typeof(e=this.fft.param("interval"))&&(e<0&&this.frequencyDomainAnimationId?(window.cancelAnimationFrame(this.frequencyDomainAnimationId),this.frequencyDomainAnimationId=null):this.frequencyDomainTimerId&&(window.clearTimeout(this.frequencyDomainTimerId),this.frequencyDomainTimerId=null))}return this},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"fftSize":return this.analyser.fftSize;case"frequencyBinCount":return this.analyser.frequencyBinCount;case"minDecibels":return this.analyser.minDecibels;case"maxDecibels":return this.analyser.maxDecibels;case"smoothingTimeConstant":return this.analyser.smoothingTimeConstant;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"fftSize":this.analyser.fftSize=s;break;case"minDecibels":this.analyser.minDecibels=s;break;case"maxDecibels":this.analyser.maxDecibels=s;break;case"smoothingTimeConstant":this.analyser.smoothingTimeConstant=s}}return this},t.prototype.domain=function(t,e){switch(t){case"timeoverview":switch(e){case 0:default:return this.timeOverviewL;case 1:return this.timeOverviewR}case"time":return this.time;case"fft":return this.fft;default:return this}return this},t.prototype.get=function(){return this.analyser},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.input},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.input},enumerable:!1,configurable:!0}),t}();e.Analyser=o},8044:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Autopanner=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.panner=r.context.createStereoPanner(),r.panner.pan.value=0,r.depth.gain.value=0,r.rate.value=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.panner.pan),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.panner.pan))},e.prototype.connect=function(){return this.input.disconnect(0),this.panner.disconnect(0),this.isActive?(this.input.connect(this.panner),this.panner.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"depth":return this.depth.gain.value;case"rate":return this.rate.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"depth":"number"==typeof s&&(this.depth.gain.value=s);break;case"rate":"number"==typeof s&&(this.rate.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,depth:this.depth.gain.value,rate:this.rate.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Autopanner=s},2648:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.BitCrusher=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;r.bits=0,r.shaper=r.context.createWaveShaper(),r.inputShaper=r.context.createWaveShaper(),r.outputShaper=r.context.createWaveShaper(),r.inputLevel=r.context.createGain(),r.outputLevel=r.context.createGain(),r.bitsInput=r.context.createConstantSource(),r.bitsGain=r.context.createGain();for(var n=new Float32Array(1023),i=0;i<512;i++){var s=(i/512*128|0)/128;n[511+i]=s,n[511-i]=-s}for(var o=new Float32Array(10),a=new Float32Array(10),c=(i=0,64);i<6;i++,c*=.5)o[0+i]=1/64,o[4+i]=1/c,a[0+i]=64,a[4+i]=c;return r.shaper.curve=n,r.inputShaper.curve=o,r.outputShaper.curve=a,r.inputLevel.gain.value=0,r.outputLevel.gain.value=0,r.bitsInput.offset.value=r.bits,r.bitsGain.gain.value=1/8,r.deactivate(),r}return i(e,t),e.prototype.start=function(t){this.isActive&&this.paused&&(this.bitsInput.start(this.context.currentTime),this.paused=!1)},e.prototype.stop=function(t,e){this.isActive&&!this.paused&&(this.bitsInput.stop(this.context.currentTime),this.bitsInput=this.context.createConstantSource(),this.bitsInput.offset.value=this.bits,this.paused=!0,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.shaper.disconnect(0),this.inputShaper.disconnect(0),this.outputShaper.disconnect(0),this.inputLevel.disconnect(0),this.outputLevel.disconnect(0),this.bitsInput.disconnect(0),this.bitsGain.disconnect(0),this.isActive?(this.input.connect(this.inputLevel),this.inputLevel.connect(this.shaper),this.shaper.connect(this.outputLevel),this.outputLevel.connect(this.output),this.bitsInput.connect(this.bitsGain),this.bitsGain.connect(this.inputShaper),this.inputShaper.connect(this.inputLevel.gain),this.bitsGain.connect(this.outputShaper),this.outputShaper.connect(this.outputLevel.gain)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"bits":return this.bits;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"bits":"number"==typeof s&&(this.bits=s,this.bitsInput.offset.value=this.bits)}}return this},e.prototype.params=function(){return{state:this.isActive,bits:this.bits}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.BitCrusher=s},8649:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Chorus=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.depthRate=0,r.delay=e.createDelay(),r.mix=e.createGain(),r.tone=e.createBiquadFilter(),r.feedback=e.createGain(),r.delay.delayTime.value=0,r.depth.gain.value=0,r.rate.value=0,r.mix.gain.value=0,r.tone.type="lowpass",r.tone.frequency.value=350,r.tone.Q.value=Math.SQRT1_2,r.tone.gain.value=0,r.feedback.gain.value=0,r.depthRate=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.delay.delayTime),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.delay.delayTime))},e.prototype.connect=function(){return this.input.disconnect(0),this.delay.disconnect(0),this.mix.disconnect(0),this.tone.disconnect(0),this.feedback.disconnect(0),this.input.connect(this.output),this.isActive&&(this.input.connect(this.tone),this.tone.connect(this.delay),this.delay.connect(this.mix),this.mix.connect(this.output),this.delay.connect(this.feedback),this.feedback.connect(this.delay)),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"time":return this.delay.delayTime.value;case"depth":return this.depthRate;case"rate":return this.rate.value;case"mix":return this.mix.gain.value;case"tone":return this.tone.frequency.value;case"feedback":return this.feedback.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"time":"number"==typeof s&&(this.delay.delayTime.value=s,this.depth.gain.value=this.delay.delayTime.value*this.depthRate);break;case"depth":"number"==typeof s&&(this.depthRate=s,this.depth.gain.value=this.delay.delayTime.value*s);break;case"rate":"number"==typeof s&&(this.rate.value=s);break;case"mix":"number"==typeof s&&(this.mix.gain.value=s);break;case"tone":"number"==typeof s&&(this.tone.frequency.value=s);break;case"feedback":"number"==typeof s&&(this.feedback.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,time:this.delay.delayTime.value,depth:this.depthRate,rate:this.rate.value,mix:this.mix.gain.value,tone:this.tone.frequency.value,feedback:this.feedback.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Chorus=s},346:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Compressor=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.compressor=e.createDynamicsCompressor(),r.compressor.threshold.value=-24,r.compressor.knee.value=30,r.compressor.ratio.value=12,r.compressor.attack.value=.003,r.compressor.release.value=.25,r.activate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.compressor.disconnect(0),this.isActive?(this.input.connect(this.compressor),this.compressor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"threshold":return this.compressor.threshold.value;case"knee":return this.compressor.knee.value;case"ratio":return this.compressor.ratio.value;case"attack":return this.compressor.attack.value;case"release":return this.compressor.release.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"threshold":"number"==typeof s&&(this.compressor.threshold.value=s);break;case"knee":"number"==typeof s&&(this.compressor.knee.value=s);break;case"ratio":"number"==typeof s&&(this.compressor.ratio.value=s);break;case"attack":"number"==typeof s&&(this.compressor.attack.value=s);break;case"release":"number"==typeof s&&(this.compressor.release.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,threshold:this.compressor.threshold.value,knee:this.compressor.knee.value,ratio:this.compressor.ratio.value,attack:this.compressor.attack.value,release:this.compressor.release.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Compressor=s},4535:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Delay=void 0;var s=function(t){function e(r){var n=t.call(this,r,0)||this;return n.delay=r.createDelay(e.MAX_DELAY_TIME),n.dry=r.createGain(),n.wet=r.createGain(),n.tone=r.createBiquadFilter(),n.feedback=r.createGain(),n.delay.delayTime.value=0,n.dry.gain.value=1,n.wet.gain.value=0,n.tone.type="lowpass",n.tone.frequency.value=350,n.tone.Q.value=Math.SQRT1_2,n.tone.gain.value=0,n.feedback.gain.value=0,n.deactivate(),n}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.delay.disconnect(0),this.dry.disconnect(0),this.wet.disconnect(0),this.tone.disconnect(0),this.feedback.disconnect(0),this.isActive?(this.input.connect(this.dry),this.dry.connect(this.output),this.input.connect(this.tone),this.tone.connect(this.delay),this.delay.connect(this.wet),this.wet.connect(this.output),this.delay.connect(this.feedback),this.feedback.connect(this.delay)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"time":return this.delay.delayTime.value;case"dry":return this.dry.gain.value;case"wet":return this.wet.gain.value;case"tone":return this.tone.frequency.value;case"feedback":return this.feedback.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"time":"number"==typeof s&&(this.delay.delayTime.value=s);break;case"dry":"number"==typeof s&&(this.dry.gain.value=s);break;case"wet":"number"==typeof s&&(this.wet.gain.value=s);break;case"tone":"number"==typeof s&&(this.tone.frequency.value=s);break;case"feedback":"number"==typeof s&&(this.feedback.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,time:this.delay.delayTime.value,dry:this.dry.gain.value,wet:this.wet.gain.value,tone:this.tone.frequency.value,feedback:this.feedback.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.MAX_DELAY_TIME=5,e}(r(1643).Effector);e.Delay=s},1643:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Effector=void 0;var r=function(){function t(t,e){this.isActive=!0,this.paused=!0,this.context=t,this.input=t.createGain(),this.output=t.createGain(),this.lfo=t.createOscillator(),this.depth=t.createGain(),this.rate=this.lfo.frequency,this.processor=t.createScriptProcessor(e,2,2)}return t.prototype.start=function(t){this.isActive&&this.paused&&(this.lfo.start(null!=t?t:this.context.currentTime),this.paused=!1)},t.prototype.stop=function(t,e){if(this.isActive&&!this.paused){var r=this.lfo.type,n=this.lfo.frequency.value;this.lfo.stop((null!=t?t:this.context.currentTime)+(null!=e?e:0)),this.lfo=this.context.createOscillator(),this.lfo.type=r,this.lfo.frequency.value=n,this.rate=this.lfo.frequency,this.paused=!0}},t.prototype.toJSON=function(){return JSON.stringify(this.params())},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this.connect(),this.start(0),this},t.prototype.deactivate=function(){return this.stop(0),this.isActive=!1,this.connect(),this},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.input},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.output},enumerable:!1,configurable:!0}),t}();e.Effector=r},8137:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EnvelopeGenerator=void 0;var r=function(){function t(t){this.generators=[],this.activeIndexes=[],this.activeCounter=0,this.attack=.01,this.decay=.3,this.sustain=.5,this.release=1,this.isActive=!0,this.context=t}return t.prototype.ready=function(t,e,r){e&&r&&this.generators[t]?(e.connect(this.generators[t]),this.generators[t].connect(r)):e&&null===r&&this.generators[t]?e.connect(this.generators[t]):null===e&&r&&this.generators[t]&&this.generators[t].connect(r),this.activeIndexes[t]=t,this.activeCounter++},t.prototype.start=function(t){for(var e=t,r=e+this.attack,n=this.decay,i=this.sustain,s=0,o=this.activeIndexes;s<o.length;s++){var a=o[s];void 0!==a&&(this.isActive?(this.generators[a].gain.cancelScheduledValues(e),this.generators[a].gain.setValueAtTime(0,e),this.generators[a].gain.linearRampToValueAtTime(1,r),this.generators[a].gain.setTargetAtTime(i,r,n)):this.generators[a].gain.value=1)}},t.prototype.stop=function(t,e){for(var r=t-this.release,n=r>=this.context.currentTime?r:this.context.currentTime,i=this.release,s=0,o=this.activeIndexes;s<o.length;s++){var a=o[s];void 0!==a&&(this.isActive?(this.generators[a].gain.cancelScheduledValues(n),e?this.generators[a].gain.setValueCurveAtTime(new Float32Array([1,.5,.25,0]),n,i):this.generators[a].gain.setTargetAtTime(0,n,i)):this.generators[a].gain.value=0)}},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"attack":return this.attack;case"decay":return this.decay;case"sustain":return this.sustain;case"release":return this.release;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"attack":"number"==typeof s&&(this.attack=s);break;case"decay":"number"==typeof s&&(this.decay=s);break;case"sustain":"number"==typeof s&&(this.sustain=s);break;case"release":"number"==typeof s&&(this.release=s)}}return this},t.prototype.getGenerator=function(t){return t>=0&&t<this.generators.length?this.generators[t]:null},t.prototype.setGenerator=function(t){this.generators[t]=this.context.createGain()},t.prototype.paused=function(){for(var e=0,r=0,n=this.activeIndexes;r<n.length;r++){var i=n[r];if(void 0!==i){if(this.generators[i].gain.value>t.MIN_GAIN)return!1;if(++e===this.activeCounter)return!0}}return!1},t.prototype.clear=function(t){this.activeIndexes.length=0,this.activeCounter=0;for(var e=0,r=this.generators;e<r.length;e++){var n=r[e];n.gain.cancelScheduledValues(this.context.currentTime),n.gain.value=1,t&&n.disconnect(0)}},t.prototype.params=function(){return{state:this.isActive,attack:this.attack,decay:this.decay,sustain:this.sustain,release:this.release}},t.prototype.toJSON=function(){return JSON.stringify(this.params())},t.prototype.state=function(){return this.isActive},t.prototype.activate=function(){return this.isActive=!0,this},t.prototype.deactivate=function(){return this.isActive=!1,this},t.MIN_GAIN=.001,t}();e.EnvelopeGenerator=r},111:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Equalizer=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.bass=e.createBiquadFilter(),r.middle=e.createBiquadFilter(),r.treble=e.createBiquadFilter(),r.presence=e.createBiquadFilter(),r.bass.type="lowshelf",r.middle.type="peaking",r.treble.type="highshelf",r.presence.type="highshelf",r.bass.frequency.value=500,r.middle.frequency.value=1e3,r.treble.frequency.value=2e3,r.presence.frequency.value=4e3,r.bass.Q.value=Math.SQRT1_2,r.middle.Q.value=Math.SQRT1_2,r.treble.Q.value=Math.SQRT1_2,r.presence.Q.value=Math.SQRT1_2,r.bass.gain.value=0,r.middle.gain.value=0,r.treble.gain.value=0,r.presence.gain.value=0,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.bass.disconnect(0),this.middle.disconnect(0),this.treble.disconnect(0),this.presence.disconnect(0),this.isActive?(this.input.connect(this.bass),this.bass.connect(this.middle),this.middle.connect(this.treble),this.treble.connect(this.presence),this.presence.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"bass":return this.bass.gain.value;case"middle":return this.middle.gain.value;case"treble":return this.treble.gain.value;case"presence":return this.presence.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"bass":"number"==typeof s&&(this.bass.gain.value=s);break;case"middle":"number"==typeof s&&(this.middle.gain.value=s);break;case"treble":"number"==typeof s&&(this.treble.gain.value=s);break;case"presence":"number"==typeof s&&(this.presence.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,bass:this.bass.gain.value,middle:this.middle.gain.value,treble:this.treble.gain.value,presence:this.presence.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Equalizer=s},7369:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Filter=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.range=.1,r.attack=.01,r.decay=.3,r.sustain=1,r.release=1,r.filter=e.createBiquadFilter(),r.filter.type="lowpass",r.filter.frequency.value=350,r.filter.Q.value=1,r.filter.gain.value=0,r.maxFrequency=r.filter.frequency.value,r.deactivate(),r}return i(e,t),e.prototype.start=function(t){if(this.isActive){var e=null!=t?t:this.context.currentTime,r=e+this.attack,n=this.decay,i=this.sustain*this.maxFrequency,s=this.maxFrequency*this.range;this.filter.frequency.cancelScheduledValues(e),this.filter.frequency.setValueAtTime(s,e),this.filter.frequency.linearRampToValueAtTime(this.maxFrequency,r),this.filter.frequency.setTargetAtTime(i,r,n)}},e.prototype.stop=function(t){if(this.isActive){var e=null!=t?t:this.context.currentTime,r=this.release,n=this.maxFrequency*this.range;this.filter.frequency.cancelScheduledValues(e),this.filter.frequency.setValueAtTime(this.filter.frequency.value,e),this.filter.frequency.setTargetAtTime(n,e,r)}},e.prototype.connect=function(){return this.input.disconnect(0),this.filter.disconnect(0),this.isActive?(this.input.connect(this.filter),this.filter.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"type":return this.filter.type;case"frequency":return this.filter.frequency.value;case"Q":return this.filter.Q.value;case"gain":return this.filter.gain.value;case"range":return this.range;case"attack":return this.attack;case"decay":return this.decay;case"sustain":return this.sustain;case"release":return this.release;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"type":"string"==typeof s&&(this.filter.type=s);break;case"frequency":"number"==typeof s&&(this.filter.frequency.value=s,this.maxFrequency=s);break;case"Q":"number"==typeof s&&(this.filter.Q.value=s);break;case"gain":"number"==typeof s&&(this.filter.gain.value=s);break;case"range":"number"==typeof s&&(this.range=s);break;case"attack":"number"==typeof s&&(this.attack=s);break;case"decay":"number"==typeof s&&(this.decay=s);break;case"sustain":"number"==typeof s&&(this.sustain=s);break;case"release":"number"==typeof s&&(this.release=s)}}return this},e.prototype.params=function(){return{state:this.isActive,type:this.filter.type,frequency:this.filter.frequency.value,Q:this.filter.Q.value,gain:this.filter.gain.value,range:this.range,attack:this.attack,decay:this.decay,sustain:this.sustain,release:this.release}},e.prototype.activate=function(){return this.isActive=!0,this.connect(),this},e.prototype.deactivate=function(){return this.isActive=!1,this.connect(),this},e}(r(1643).Effector);e.Filter=s},6548:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Flanger=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.depthRate=0,r.delay=e.createDelay(),r.mix=e.createGain(),r.tone=e.createBiquadFilter(),r.feedback=e.createGain(),r.delay.delayTime.value=0,r.depth.gain.value=0,r.rate.value=0,r.mix.gain.value=0,r.tone.type="lowpass",r.tone.frequency.value=350,r.tone.Q.value=Math.SQRT1_2,r.tone.gain.value=0,r.feedback.gain.value=0,r.depthRate=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.delay.delayTime),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.delay.delayTime))},e.prototype.connect=function(){return this.input.disconnect(0),this.delay.disconnect(0),this.mix.disconnect(0),this.tone.disconnect(0),this.feedback.disconnect(0),this.input.connect(this.output),this.isActive&&(this.input.connect(this.tone),this.tone.connect(this.delay),this.delay.connect(this.mix),this.mix.connect(this.output),this.delay.connect(this.feedback),this.feedback.connect(this.delay)),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"time":return this.delay.delayTime.value;case"depth":return this.depthRate;case"rate":return this.rate.value;case"mix":return this.mix.gain.value;case"tone":return this.tone.frequency.value;case"feedback":return this.feedback.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"time":"number"==typeof s&&(this.delay.delayTime.value=s,this.depth.gain.value=this.delay.delayTime.value*this.depthRate);break;case"depth":"number"==typeof s&&(this.depthRate=s,this.depth.gain.value=this.delay.delayTime.value*s);break;case"rate":"number"==typeof s&&(this.rate.value=s);break;case"mix":"number"==typeof s&&(this.mix.gain.value=s);break;case"tone":"number"==typeof s&&(this.tone.frequency.value=s);break;case"feedback":"number"==typeof s&&(this.feedback.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,time:this.delay.delayTime.value,depth:this.depthRate,rate:this.rate.value,mix:this.mix.gain.value,tone:this.tone.frequency.value,feedback:this.feedback.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Flanger=s},4560:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Fuzz=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;r.drive=0,r.positiveShaper=r.context.createWaveShaper(),r.negativeShaper=r.context.createWaveShaper(),r.positiveInputGain=r.context.createGain(),r.negativeInputGain=r.context.createGain(),r.positiveOutputGain=r.context.createGain(),r.negativeOutputGain=r.context.createGain(),r.driveInput=r.context.createConstantSource(),r.outFilter=r.context.createBiquadFilter(),r.level=r.context.createGain();for(var n=new Float32Array(1024),i=0;i<512;i++){var s=.5*Math.tanh(4*i/512),o=1-i/512;n[512+i]=s,n[511-i]=s*Math.pow(o,4)}return r.positiveShaper.curve=n,r.negativeShaper.curve=n,r.positiveInputGain.gain.value=1,r.negativeInputGain.gain.value=-1,r.positiveOutputGain.gain.value=1,r.negativeOutputGain.gain.value=-1,r.driveInput.offset.value=r.drive,r.outFilter.type="highpass",r.outFilter.frequency.value=80,r.outFilter.Q.value=1,r.outFilter.gain.value=0,r.level.gain.value=1,r.deactivate(),r}return i(e,t),e.prototype.start=function(t){this.isActive&&this.paused&&(this.driveInput.start(this.context.currentTime),this.paused=!1)},e.prototype.stop=function(t,e){this.isActive&&!this.paused&&(this.driveInput.stop(this.context.currentTime),this.driveInput=this.context.createConstantSource(),this.driveInput.offset.value=this.drive,this.paused=!0,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.positiveShaper.disconnect(0),this.negativeShaper.disconnect(0),this.positiveInputGain.disconnect(0),this.negativeInputGain.disconnect(0),this.positiveOutputGain.disconnect(0),this.negativeOutputGain.disconnect(0),this.driveInput.disconnect(0),this.outFilter.disconnect(0),this.level.disconnect(0),this.isActive?(this.input.connect(this.positiveInputGain),this.positiveInputGain.connect(this.positiveShaper),this.positiveShaper.connect(this.positiveOutputGain),this.positiveOutputGain.connect(this.outFilter),this.input.connect(this.negativeInputGain),this.negativeInputGain.connect(this.negativeShaper),this.negativeShaper.connect(this.negativeOutputGain),this.negativeOutputGain.connect(this.outFilter),this.driveInput.connect(this.negativeOutputGain.gain),this.outFilter.connect(this.level),this.level.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"drive":return this.drive;case"level":return this.level.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"drive":"number"==typeof s&&(this.drive=s,this.driveInput.offset.value=this.drive);break;case"level":"number"==typeof s&&(this.level.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,drive:this.drive,level:this.level.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Fuzz=s},4226:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Listener=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.listener=e.listener,r.positions={x:0,y:0,z:0},r.forwards={x:0,y:0,z:-1},r.ups={x:0,y:1,z:0},r.listener.setPosition(r.positions.x,r.positions.y,r.positions.z),r.listener.setOrientation(r.forwards.x,r.forwards.y,r.forwards.z,r.ups.x,r.ups.y,r.ups.z),r}return i(e,t),e.prototype.connect=function(){return this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"x":return this.positions.x;case"y":return this.positions.y;case"z":return this.positions.z;case"fx":return this.forwards.x;case"fy":return this.forwards.y;case"fz":return this.forwards.z;case"ux":return this.ups.x;case"uy":return this.ups.y;case"uz":return this.ups.z;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"x":"number"==typeof s&&(this.positions.x=s,this.listener.setPosition(this.positions.x,this.positions.y,this.positions.z));break;case"y":"number"==typeof s&&(this.positions.y=s,this.listener.setPosition(this.positions.x,this.positions.y,this.positions.z));break;case"z":"number"==typeof s&&(this.positions.z=s,this.listener.setPosition(this.positions.x,this.positions.y,this.positions.z));break;case"fx":"number"==typeof s&&(this.forwards.x=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"fy":"number"==typeof s&&(this.forwards.y=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"fz":"number"==typeof s&&(this.forwards.z=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"ux":"number"==typeof s&&(this.ups.x=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"uy":"number"==typeof s&&(this.ups.y=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z));break;case"uz":"number"==typeof s&&(this.ups.z=s,this.listener.setOrientation(this.forwards.x,this.forwards.y,this.forwards.z,this.ups.x,this.ups.y,this.ups.z))}}return this},e.prototype.params=function(){return{x:this.positions.x,y:this.positions.y,z:this.positions.z,fx:this.forwards.x,fy:this.forwards.y,fz:this.forwards.z,ux:this.ups.x,uy:this.ups.y,uz:this.ups.z}},e}(r(1643).Effector);e.Listener=s},610:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.NoiseGate=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.level=0,r.activate(),r}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var e=this.processor.bufferSize;this.processor.onaudioprocess=function(r){for(var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1),a=0;a<e;a++)s[a]=t.gate(n[a]),o[a]=t.gate(i[a])}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.processor.disconnect(0),this.isActive?(this.input.connect(this.processor),this.processor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"level":return this.level;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"level":"number"==typeof s&&(this.level=s)}}return this},e.prototype.params=function(){return{state:this.isActive,level:this.level}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.gate=function(t){return this.isActive?Math.abs(t)>this.level?t:0:t},e}(r(1643).Effector);e.NoiseGate=s},2187:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.NoiseSuppressor=void 0;var s=r(999),o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.threshold=0,n.activate(),n}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var e=this.processor.bufferSize;this.processor.onaudioprocess=function(r){var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1);t.suppress(n,s,e),t.suppress(i,o,e)}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.processor.disconnect(0),this.isActive?(this.input.connect(this.processor),this.processor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"threshold":return this.threshold;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"threshold":"number"==typeof s&&s>=0&&(this.threshold=s)}}return this},e.prototype.params=function(){return{state:this.isActive,threshold:this.threshold}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.suppress=function(t,e,r){if(this.isActive&&0!==this.threshold){var n=new Float32Array(t),i=new Float32Array(r),o=new Float32Array(r),a=new Float32Array(r),c=new Float32Array(r),u=new Float32Array(r);(0,s.fft)(n,i,r);for(var l=0;l<r;l++)c[l]=Math.sqrt(Math.pow(n[l],2)+Math.pow(i[l],2)),0!==n[l]&&0!==i[l]&&(u[l]=Math.atan2(i[l],n[l]));for(l=0;l<r;l++)c[l]-=this.threshold,c[l]<0&&(c[l]=0);for(l=0;l<r;l++)o[l]=c[l]*Math.cos(u[l]),a[l]=c[l]*Math.sin(u[l]);(0,s.ifft)(o,a,r),e.set(o)}else e.set(t)},e}(r(1643).Effector);e.NoiseSuppressor=o},3627:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.OverDrive=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;r.drive=0,r.shaper=r.context.createWaveShaper(),r.inputShaper=r.context.createWaveShaper(),r.outputShaper=r.context.createWaveShaper(),r.inputGain=r.context.createGain(),r.outputGain=r.context.createGain(),r.driveInput=r.context.createConstantSource(),r.level=r.context.createGain();for(var n=new Float32Array(1024),i=0;i<512;i++){var s=.5*Math.tanh(4*i/512);n[512+i]=s,n[511-i]=-s}var o=new Float32Array(101);for(i=0;i<101;i++)o[i]=.25;i=52;for(var a=.25;i<101;i++,a*=1.1)o[i]=a;var c=new Float32Array([2,2,2,2,2,.9,.5,.35,.3]);return r.shaper.curve=n,r.inputShaper.curve=o,r.outputShaper.curve=c,r.inputGain.gain.value=0,r.outputGain.gain.value=0,r.driveInput.offset.value=r.drive,r.level.gain.value=1,r.deactivate(),r}return i(e,t),e.prototype.start=function(t){this.isActive&&this.paused&&(this.driveInput.start(this.context.currentTime),this.paused=!1)},e.prototype.stop=function(t,e){this.isActive&&!this.paused&&(this.driveInput.stop(this.context.currentTime),this.driveInput=this.context.createConstantSource(),this.driveInput.offset.value=this.drive,this.paused=!0,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.shaper.disconnect(0),this.inputShaper.disconnect(0),this.outputShaper.disconnect(0),this.inputGain.disconnect(0),this.outputGain.disconnect(0),this.driveInput.disconnect(0),this.level.disconnect(0),this.isActive?(this.input.connect(this.inputGain),this.inputGain.connect(this.shaper),this.shaper.connect(this.outputGain),this.outputGain.connect(this.level),this.level.connect(this.output),this.driveInput.connect(this.inputShaper),this.inputShaper.connect(this.inputGain.gain),this.driveInput.connect(this.outputShaper),this.outputShaper.connect(this.outputGain.gain)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"drive":return this.drive;case"level":return this.level.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"drive":"number"==typeof s&&(this.drive=s,this.driveInput.offset.value=this.drive);break;case"level":"number"==typeof s&&(this.level.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,drive:this.drive,level:this.level.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.OverDrive=s},3751:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Panner=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.panner=e.createPanner(),r.positions={x:0,y:0,z:0},r.orientations={x:1,y:0,z:0},r.panner.refDistance=1,r.panner.maxDistance=1e4,r.panner.rolloffFactor=1,r.panner.coneInnerAngle=360,r.panner.coneOuterAngle=360,r.panner.coneOuterGain=0,r.panner.panningModel="HRTF",r.panner.distanceModel="inverse",r.panner.positionX.value=r.positions.x,r.panner.positionY.value=r.positions.y,r.panner.positionZ.value=r.positions.z,r.panner.orientationX.value=r.orientations.x,r.panner.orientationY.value=r.orientations.y,r.panner.orientationZ.value=r.orientations.z,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.panner.disconnect(0),this.isActive?(this.input.connect(this.panner),this.panner.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"x":return this.panner.positionX.value;case"y":return this.panner.positionY.value;case"z":return this.panner.positionZ.value;case"ox":return this.panner.orientationX.value;case"oy":return this.panner.orientationY.value;case"oz":return this.panner.orientationZ.value;case"refDistance":return this.panner.refDistance;case"maxDistance":return this.panner.maxDistance;case"rolloffFactor":return this.panner.rolloffFactor;case"coneInnerAngle":return this.panner.coneInnerAngle;case"coneOuterAngle":return this.panner.coneOuterAngle;case"coneOuterGain":return this.panner.coneOuterGain;case"panningModel":return this.panner.panningModel;case"distanceModel":return this.panner.distanceModel;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"x":"number"==typeof s&&(this.panner.positionX.value=s);break;case"y":"number"==typeof s&&(this.panner.positionY.value=s);break;case"z":"number"==typeof s&&(this.panner.positionZ.value=s);break;case"ox":"number"==typeof s&&(this.panner.orientationX.value=s);break;case"oy":"number"==typeof s&&(this.panner.orientationY.value=s);break;case"oz":"number"==typeof s&&(this.panner.orientationZ.value=s);break;case"refDistance":"number"==typeof s&&(this.panner.refDistance=s);break;case"maxDistance":"number"==typeof s&&(this.panner.maxDistance=s);break;case"rolloffFactor":"number"==typeof s&&(this.panner.rolloffFactor=s);break;case"coneInnerAngle":"number"==typeof s&&(this.panner.coneInnerAngle=s);break;case"coneOuterAngle":"number"==typeof s&&(this.panner.coneOuterAngle=s);break;case"coneOuterGain":"number"==typeof s&&(this.panner.coneOuterGain=s);break;case"panningModel":"HRTF"!==s&&"equalpower"!==s||(this.panner.panningModel=s);break;case"distanceModel":"linear"!==s&&"inverse"!==s&&"exponential"!==s||(this.panner.distanceModel=s)}}return this},e.prototype.params=function(){return{state:this.isActive,x:this.positions.x,y:this.positions.y,z:this.positions.z,ox:this.orientations.x,oy:this.orientations.y,oz:this.orientations.z,refDistance:this.panner.refDistance,maxDistance:this.panner.maxDistance,rolloffFactor:this.panner.rolloffFactor,coneInnerAngle:this.panner.coneInnerAngle,coneOuterAngle:this.panner.coneOuterAngle,coneOuterGain:this.panner.coneOuterGain,panningModel:this.panner.panningModel,distanceModel:this.panner.distanceModel}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Panner=s},2393:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Phaser=void 0;var s=function(t){function e(r){var n=t.call(this,r,0)||this;n.numberOfStages=12,n.filters=[],n.depthRate=0;for(var i=0;i<e.MAX_STAGES;i++){var s=r.createBiquadFilter();s.type="allpass",s.frequency.value=350,s.Q.value=1,s.gain.value=0,n.filters.push(s)}n.mix=r.createGain(),n.depth.gain.value=0,n.rate.value=0,n.mix.gain.value=0,n.deactivate(),n.lfo.connect(n.depth);for(i=0;i<e.MAX_STAGES;i++)n.depth.connect(n.filters[i].frequency);return n}return i(e,t),e.prototype.stop=function(r,n){if(t.prototype.stop.call(this,r,n),this.isActive){this.lfo.connect(this.depth);for(var i=0;i<e.MAX_STAGES;i++)this.depth.connect(this.filters[i].frequency)}},e.prototype.connect=function(){this.input.disconnect(0);for(var t=0;t<e.MAX_STAGES;t++)this.filters[t].disconnect(0);if(this.mix.disconnect(0),this.input.connect(this.output),this.isActive&&this.numberOfStages>0){this.input.connect(this.filters[0]);for(t=0;t<this.numberOfStages;t++)t<this.numberOfStages-1?this.filters[t].connect(this.filters[t+1]):(this.filters[t].connect(this.mix),this.mix.connect(this.output))}return this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"stage":return this.numberOfStages;case"frequency":return this.filters[0].frequency.value;case"resonance":return this.filters[0].Q.value;case"depth":return this.depthRate;case"rate":return this.rate.value;case"mix":return this.mix.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"stage":switch(s){case 0:case 2:case 4:case 8:case 12:case 24:this.numberOfStages=s,this.connect()}break;case"frequency":if("number"==typeof s){for(var o=0,a=this.filters;o<a.length;o++){a[o].frequency.value=s}this.depth.gain.value=s*this.depthRate}break;case"resonance":if("number"==typeof s)for(var c=0,u=this.filters;c<u.length;c++){u[c].Q.value=s}break;case"depth":"number"==typeof s&&(this.depthRate=s,this.depth.gain.value=this.filters[0].frequency.value*s);break;case"rate":"number"==typeof s&&(this.rate.value=s);break;case"mix":"number"==typeof s&&(this.mix.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,stage:this.numberOfStages,frequency:this.filters[0].frequency.value,resonance:this.filters[0].Q.value,depth:this.depthRate,rate:this.rate.value,mix:this.mix.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.MAX_STAGES=24,e}(r(1643).Effector);e.Phaser=s},4833:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.PitchShifter=void 0;var s=r(999),o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.pitch=1,n.deactivate(),n.connect(),n}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var r=this.processor.bufferSize;this.processor.onaudioprocess=function(n){var i=n.inputBuffer.getChannelData(0),o=n.inputBuffer.getChannelData(1),a=n.outputBuffer.getChannelData(0),c=n.outputBuffer.getChannelData(1);if(t.isActive&&1!==t.pitch){var u=new Float32Array(i),l=new Float32Array(o),h=new Float32Array(r),p=new Float32Array(r);(0,s.fft)(u,h,r),(0,s.fft)(l,p,r);for(var f=new Float32Array(r),d=new Float32Array(r),v=new Float32Array(r),y=new Float32Array(r),m=0;m<r;m++){var b=Math.trunc(t.pitch*m),g=1;m>r/2&&(g=0),b>=0&&b<r&&(f[b]+=e.GAIN_CORRECTION*g*u[m],v[b]+=e.GAIN_CORRECTION*g*h[m],d[b]+=e.GAIN_CORRECTION*g*l[m],y[b]+=e.GAIN_CORRECTION*g*p[m])}(0,s.ifft)(f,v,r),(0,s.ifft)(d,y,r),a.set(f),c.set(d)}else a.set(i),c.set(o)}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.processor.disconnect(0),this.isActive?(this.input.connect(this.processor),this.processor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"pitch":return this.pitch;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"pitch":"number"==typeof s&&s>0&&(this.pitch=s)}}return this},e.prototype.params=function(){return{state:this.isActive,pitch:this.pitch}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.GAIN_CORRECTION=2,e}(r(1643).Effector);e.PitchShifter=o},4091:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Preamp=e.Cabinet=e.PostEqualizer=e.PreEqualizer=void 0;var s=r(1643),o=function(t){function e(e){var r=t.call(this,e,0)||this;return r.shaper=e.createWaveShaper(),r.gain=e.createGain(),r.leadGain=e.createGain(),r.lowpass=e.createBiquadFilter(),r.highpass1=e.createBiquadFilter(),r.highpass2=e.createBiquadFilter(),r.highpass3=e.createBiquadFilter(),r.gain.gain.value=.5,r.leadGain.gain.value=.5,r.lowpass.type="lowpass",r.lowpass.frequency.value=3200,r.lowpass.Q.value=Math.SQRT1_2,r.lowpass.gain.value=0,r.highpass1.type="highpass",r.highpass1.frequency.value=80,r.highpass1.Q.value=Math.SQRT1_2,r.highpass1.gain.value=0,r.highpass2.type="highpass",r.highpass2.frequency.value=640,r.highpass2.Q.value=Math.SQRT1_2,r.highpass2.gain.value=0,r.highpass3.type="highpass",r.highpass3.frequency.value=80,r.highpass3.Q.value=Math.SQRT1_2,r.highpass3.gain.value=0,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.isActive?(this.input.connect(this.highpass1),this.highpass1.connect(this.gain),this.gain.connect(this.highpass3),this.input.connect(this.highpass2),this.highpass2.connect(this.leadGain),this.leadGain.connect(this.highpass3),this.highpass3.connect(this.shaper),this.shaper.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"curve":return this.shaper.curve;case"gain":return this.gain.gain.value;case"lead":return this.leadGain.gain.value;default:return}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(s?this.activate():this.deactivate());break;case"curve":"number"!=typeof s&&"boolean"!=typeof s&&(s instanceof Float32Array||null===s)&&(this.shaper.curve=s);break;case"gain":"number"==typeof s&&(this.gain.gain.value=s);break;case"lead":"number"==typeof s&&(this.leadGain.gain.value=s)}}},e.prototype.params=function(){return{state:this.isActive,curve:this.shaper.curve,gain:this.gain.gain.value,lead:this.leadGain.gain.value}},e}(s.Effector);e.PreEqualizer=o;var a=function(t){function e(e){var r=t.call(this,e,0)||this;return r.shaper=e.createWaveShaper(),r.bass=e.createBiquadFilter(),r.middle=e.createBiquadFilter(),r.treble=e.createBiquadFilter(),r.bass.type="lowshelf",r.middle.type="peaking",r.treble.type="highshelf",r.bass.frequency.value=240,r.middle.frequency.value=500,r.treble.frequency.value=1600,r.bass.Q.value=Math.SQRT1_2,r.middle.Q.value=Math.SQRT1_2,r.treble.Q.value=Math.SQRT1_2,r.bass.gain.value=0,r.middle.gain.value=0,r.treble.gain.value=0,r.lowpass=e.createBiquadFilter(),r.highpass=e.createBiquadFilter(),r.lowpass.type="lowpass",r.lowpass.frequency.value=24e3,r.lowpass.Q.value=Math.SQRT1_2,r.lowpass.gain.value=0,r.highpass.type="highpass",r.highpass.frequency.value=40,r.highpass.Q.value=Math.SQRT1_2,r.highpass.gain.value=0,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.isActive?(this.input.connect(this.lowpass),this.lowpass.connect(this.highpass),this.highpass.connect(this.shaper),this.shaper.connect(this.bass),this.bass.connect(this.middle),this.middle.connect(this.treble),this.treble.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"curve":return this.shaper.curve;case"bass":return this.bass.gain.value;case"middle":return this.middle.gain.value;case"treble":return this.treble.gain.value;case"frequency":return this.middle.frequency.value;default:return}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(s?this.activate():this.deactivate());break;case"curve":"number"!=typeof s&&"boolean"!=typeof s&&(s instanceof Float32Array||null===s)&&(this.shaper.curve=s);break;case"bass":"number"==typeof s&&(this.bass.gain.value=s);break;case"middle":"number"==typeof s&&(this.middle.gain.value=s);break;case"treble":"number"==typeof s&&(this.treble.gain.value=s);break;case"frequency":"number"==typeof s&&(this.middle.frequency.value=s)}}},e.prototype.params=function(){return{state:this.isActive,curve:this.shaper.curve,bass:this.bass.gain.value,middle:this.middle.gain.value,treble:this.treble.gain.value,frequency:this.middle.frequency.value}},e}(s.Effector);e.PostEqualizer=a;var c=function(t){function e(e){var r=t.call(this,e,0)||this;return r.lowpass=e.createBiquadFilter(),r.notch=e.createBiquadFilter(),r.lowpass.type="lowpass",r.lowpass.frequency.value=3200,r.lowpass.Q.value=6,r.lowpass.gain.value=0,r.notch.type="notch",r.notch.frequency.value=8e3,r.notch.Q.value=1,r.notch.gain.value=0,r.activate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.isActive?(this.input.connect(this.notch),this.notch.connect(this.lowpass),this.lowpass.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)return"state"===t?this.isActive:void 0;for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];if("state"===i)"boolean"==typeof s&&(s?this.activate():this.deactivate())}},e.prototype.params=function(){return{state:this.isActive}},e}(s.Effector);e.Cabinet=c;var u=function(t){function e(e){var r=t.call(this,e,0)||this;return r.level=0,r.numberOfSamples=1024,r.preEQ=new o(e),r.postEQ=new a(e),r.cabinet=new c(e),r.deactivate(),r}return i(e,t),e.createCurve=function(t,e){var r=Math.trunc((e-1)/2),n=new Float32Array(e),i=(Math.pow(10,t/5-1)-.1)/5+1,s=.4;1===i?s=1:i>1&&i<1.04&&(s=-15.5*i+16.52);for(var o=0;o<r;o++)n[r+o]=s*(1-Math.pow(i,-o)+o*Math.pow(i,-r)/r),n[r-o]=s*(-1+Math.pow(i,-o)-o*Math.pow(i,-r)/r);return n[r]=0,n},e.prototype.connect=function(){return this.input.disconnect(0),this.isActive?(this.input.connect(this.preEQ.INPUT),this.preEQ.OUTPUT.connect(this.postEQ.INPUT),this.postEQ.OUTPUT.connect(this.cabinet.INPUT),this.cabinet.OUTPUT.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"level":return this.level;case"samples":return this.numberOfSamples;case"pre":return this.preEQ.params();case"post":return this.postEQ.params();case"cabinet":return this.cabinet.params();default:return this}for(var r=0,n=Object.entries(t);r<n.length;r++){var i=n[r],s=i[0],o=i[1];switch(s){case"state":"boolean"==typeof o&&(this.isActive=o);break;case"level":if("number"==typeof o){this.level=o;var a=e.createCurve(this.level,this.numberOfSamples);this.preEQ.param({curve:a}),this.postEQ.param({curve:a})}break;case"samples":"number"==typeof o&&(this.numberOfSamples=o);break;case"pre":"object"==typeof o&&this.preEQ.param(o);break;case"post":"object"==typeof o&&this.postEQ.param(o);break;case"cabinet":"object"==typeof o&&this.cabinet.param(o)}}return this},e.prototype.params=function(){return{state:this.isActive,level:this.level,samples:this.numberOfSamples,pre:this.preEQ.params(),post:this.postEQ.params(),cabinet:this.cabinet.params()}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(s.Effector);e.Preamp=u},1063:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Reverb=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.rirs=[],r.loadError=!1,r.convolver=e.createConvolver(),r.dry=e.createGain(),r.wet=e.createGain(),r.tone=e.createBiquadFilter(),r.dry.gain.value=1,r.wet.gain.value=0,r.tone.type="lowpass",r.tone.frequency.value=350,r.tone.Q.value=Math.SQRT1_2,r.tone.gain.value=0,r.deactivate(),r}return i(e,t),e.prototype.connect=function(){return this.input.disconnect(0),this.convolver.disconnect(0),this.dry.disconnect(0),this.wet.disconnect(0),this.tone.disconnect(0),this.isActive?(this.input.connect(this.dry),this.dry.connect(this.output),this.input.connect(this.tone),this.tone.connect(this.convolver),this.convolver.connect(this.wet),this.wet.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"buffer":return this.convolver.buffer;case"dry":return this.dry.gain.value;case"wet":return this.wet.gain.value;case"tone":return this.tone.frequency.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"buffer":"number"==typeof s?s>=0&&s<this.rirs.length&&(this.convolver.buffer=this.rirs[s],this.connect()):s instanceof AudioBuffer?(this.convolver.buffer=s,this.connect()):null===s&&(this.convolver.buffer=null,this.input.disconnect(0),this.input.connect(this.output));break;case"dry":"number"==typeof s&&(this.dry.gain.value=s);break;case"wet":"number"==typeof s&&(this.wet.gain.value=s);break;case"tone":"number"==typeof s&&(this.tone.frequency.value=s)}}return this},e.prototype.add=function(t,e){var r=this;if(t instanceof AudioBuffer)this.convolver.buffer=t,this.rirs.push(t);else if(t instanceof ArrayBuffer){this.context.decodeAudioData(t,(function(t){r.convolver.buffer=t,r.rirs.push(t)}),null!=e?e:function(){})}return this},e.prototype.preset=function(t){for(var e=t.rirs,r=t.timeout,n=t.successCallback,i=t.errorCallback,s=t.progressCallback,o=0,a=e.length;o<a;o++){var c=e[o];"string"==typeof c?this.load({rir:c,index:o,timeout:r,successCallback:n,errorCallback:i,progressCallback:s}):this.rirs[o]=c}},e.prototype.params=function(){return{state:this.isActive,dry:this.dry.gain.value,wet:this.wet.gain.value,tone:this.tone.frequency.value}},e.prototype.activate=function(){return this.isActive=!0,this.connect(),this},e.prototype.deactivate=function(){return this.isActive=!1,this.connect(),this},e.prototype.load=function(t){var e=this,r=t.rir,n=t.index,i=t.timeout,s=t.successCallback,o=t.errorCallback,a=t.progressCallback,c=new XMLHttpRequest;c.timeout=null!=i?i:6e4,c.ontimeout=function(t){!e.loadError&&o&&o(t,"timeout"),e.loadError=!0},c.onprogress=function(t){e.loadError?c.abort():a&&a(t)},c.onerror=function(t){!e.loadError&&o&&o(t,"error"),e.loadError=!0},c.onload=function(t){if(200===c.status){var r=c.response;e.context.decodeAudioData(r,(function(r){e.rirs[n]=r;for(var i=0,o=e.rirs;i<o.length;i++){if(void 0===o[i])return}s&&s(t)}),(function(t){o&&o(t,"decode")}))}},c.open("GET",r,!0),c.responseType="arraybuffer",c.send(null)},e}(r(1643).Effector);e.Reverb=s},7223:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Ringmodulator=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.amplitude=e.createGain(),r.amplitude.gain.value=0,r.depth.gain.value=1,r.rate.value=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.amplitude.gain),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.amplitude.gain))},e.prototype.connect=function(){return this.input.disconnect(0),this.amplitude.disconnect(0),this.isActive?(this.input.connect(this.amplitude),this.amplitude.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"depth":return this.depth.gain.value;case"rate":return this.rate.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"depth":"number"==typeof s&&(this.depth.gain.value=s);break;case"rate":"number"==typeof s&&(this.rate.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,depth:this.depth.gain.value,rate:this.rate.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Ringmodulator=s},8976:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Stereo=void 0;var s=function(t){function e(r,n){var i=t.call(this,r,n)||this;return i.splitter=r.createChannelSplitter(2),i.merger=r.createScriptProcessor(n,2,2),i.delayL=r.createDelay(e.MAX_DELAY_TIME),i.delayR=r.createDelay(e.MAX_DELAY_TIME),i.delayL.delayTime.value=0,i.delayR.delayTime.value=0,i.deactivate(),i}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var e=this.processor.bufferSize;this.processor.onaudioprocess=function(r){var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1);if(t.isActive&&0!==t.delayL.delayTime.value&&0!==t.delayR.delayTime.value)for(var a=0;a<e;a++)s[a]=n[a],o[a]=-i[a];else s.set(n),o.set(i)}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.splitter.disconnect(0),this.delayL.disconnect(0),this.delayR.disconnect(0),this.merger.disconnect(0),this.isActive?(this.input.connect(this.splitter),this.splitter.connect(this.delayL,0,0),this.splitter.connect(this.delayR,1,0),this.delayL.connect(this.merger),this.delayR.connect(this.merger),this.merger.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"time":return this.delayL.delayTime.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"time":"number"==typeof s&&(this.delayL.delayTime.value=s,this.delayR.delayTime.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,time:this.delayL.delayTime.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.MAX_DELAY_TIME=1,e}(r(1643).Effector);e.Stereo=s},4979:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Tremolo=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.amplitude=e.createGain(),r.amplitude.gain.value=1,r.lfo.type="sine",r.depth.gain.value=0,r.rate.value=0,r.deactivate(),r.lfo.connect(r.depth),r.depth.connect(r.amplitude.gain),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.amplitude.gain))},e.prototype.connect=function(){return this.input.disconnect(0),this.amplitude.disconnect(0),this.isActive?(this.input.connect(this.amplitude),this.amplitude.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"type":return this.lfo.type;case"depth":return this.depth.gain.value;case"rate":return this.rate.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"type":"string"==typeof s&&(this.lfo.type=s);break;case"depth":"number"==typeof s&&(this.depth.gain.value=s);break;case"rate":"number"==typeof s&&(this.rate.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,type:this.lfo.type,depth:this.depth.gain.value,rate:this.rate.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Tremolo=s},3449:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.VocalCanceler=void 0;var s=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.depth.gain.value=0,n.activate(),n}return i(e,t),e.prototype.start=function(){var t=this;if(this.isActive&&this.paused){this.paused=!1;var e=this.processor.bufferSize;this.processor.onaudioprocess=function(r){for(var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=r.outputBuffer.getChannelData(0),o=r.outputBuffer.getChannelData(1),a=0;a<e;a++)s[a]=t.cancel(n[a],i[a]),o[a]=t.cancel(i[a],n[a])}}},e.prototype.stop=function(){this.isActive&&(this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this.connect())},e.prototype.connect=function(){return this.input.disconnect(0),this.processor.disconnect(0),this.isActive?(this.input.connect(this.processor),this.processor.connect(this.output)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"depth":return this.depth.gain.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"depth":"number"==typeof s&&(this.depth.gain.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,depth:this.depth.gain.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e.prototype.cancel=function(t,e){return this.isActive?t-this.depth.gain.value*e:t},e}(r(1643).Effector);e.VocalCanceler=s},6813:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Wah=void 0;var s=function(t){function e(e){var r=t.call(this,e,0)||this;return r.auto=!1,r.depthRate=0,r.lowpass=e.createBiquadFilter(),r.envelopeFollower=e.createWaveShaper(),r.sensitivity=e.createBiquadFilter(),r.lowpass.type="lowpass",r.lowpass.frequency.value=r.auto?20:350,r.lowpass.Q.value=1,r.lowpass.gain.value=0,r.envelopeFollower.curve=new Float32Array([1,0,1]),r.sensitivity.type="lowpass",r.sensitivity.frequency.value=350,r.sensitivity.Q.value=1,r.sensitivity.gain.value=0,r.depth.gain.value=0,r.rate.value=0,r.deactivate(),r.connect(),r}return i(e,t),e.prototype.stop=function(e,r){t.prototype.stop.call(this,e,r),!this.auto&&this.isActive&&(this.lfo.connect(this.depth),this.depth.connect(this.lowpass.frequency))},e.prototype.connect=function(){return this.input.disconnect(0),this.sensitivity.disconnect(0),this.envelopeFollower.disconnect(0),this.lowpass.disconnect(0),this.depth.disconnect(0),this.isActive?this.auto?(this.input.connect(this.sensitivity),this.sensitivity.connect(this.output),this.input.connect(this.envelopeFollower),this.envelopeFollower.connect(this.lowpass),this.lowpass.connect(this.depth),this.depth.connect(this.sensitivity.frequency)):(this.input.connect(this.lowpass),this.lowpass.connect(this.output),this.lfo.connect(this.depth),this.depth.connect(this.lowpass.frequency)):this.input.connect(this.output),this.output},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"state":return this.isActive;case"auto":return this.auto;case"cutoff":return this.auto?this.sensitivity.frequency.value:this.lowpass.frequency.value;case"depth":return this.depthRate;case"rate":return this.rate.value;case"resonance":return this.auto?this.sensitivity.Q.value:this.lowpass.Q.value;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"state":"boolean"==typeof s&&(this.isActive=s);break;case"auto":"boolean"==typeof s&&(this.auto=s,this.connect());break;case"cutoff":"number"==typeof s&&(this.auto?(this.sensitivity.frequency.value=s,this.lowpass.frequency.value=20):this.lowpass.frequency.value=s);break;case"depth":"number"==typeof s&&(this.depthRate=s,this.depth.gain.value=this.auto?1e4*s:this.lowpass.frequency.value*s);break;case"rate":"number"==typeof s&&(this.rate.value=s);break;case"resonance":"number"==typeof s&&(this.auto?(this.sensitivity.Q.value=s,this.lowpass.Q.value=1):this.lowpass.Q.value=s)}}return this},e.prototype.params=function(){return{state:this.isActive,auto:this.auto,cutoff:this.auto?this.sensitivity.frequency.value:this.lowpass.frequency.value,depth:this.auto?this.depth.gain.value:this.depthRate,rate:this.rate.value,resonance:this.auto?this.sensitivity.Q.value:this.lowpass.Q.value}},e.prototype.activate=function(){return t.prototype.activate.call(this),this},e.prototype.deactivate=function(){return t.prototype.deactivate.call(this),this},e}(r(1643).Effector);e.Wah=s},422:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Channel=void 0;var r=function(){function t(t){this.tracks=[],this.channelGain=1,this.id=t}return t.prototype.append=function(t){return this.tracks.push(t),this},t.prototype.get=function(t){return"number"==typeof t&&t>=0&&t<this.tracks.length?this.tracks[t]:this.tracks},t.prototype.gain=function(t){if(!("number"==typeof t&&t>=0&&t<=1))return this.channelGain;this.channelGain=t},t.prototype.length=function(){return this.tracks.length},t.prototype.toString=function(){return this.id},t}();e.Channel=r},81:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Track=void 0;var r=function(){function t(t){this.dataBlocks=[],this.id=t}return t.prototype.get=function(){return this.dataBlocks},t.prototype.append=function(t){return this.dataBlocks.push(t),this},t.prototype.clear=function(){this.dataBlocks.length=0},t.prototype.has=function(){return this.dataBlocks.length>0},t.prototype.toString=function(){return this.id},t}();e.Track=r},7806:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Recorder=void 0;var n=r(81),i=r(422),s=function(){function t(t,e,r,n){this.channels=[],this.activeTrack=-1,this.paused=!0,this.processor=t.createScriptProcessor(e,r,n),this.sampleRate=t.sampleRate}return t.prototype.setup=function(t,e){this.channels.push(new i.Channel("0")),this.channels.push(new i.Channel("1"));for(var r=0,s=this.channels;r<s.length;r++)for(var o=s[r],a=0;a<e;a++)o.append(new n.Track(a.toString(10)));return this},t.prototype.ready=function(t){return this.hasTrack(t)?this.activeTrack=t:this.activeTrack=-1,this},t.prototype.start=function(){var t=this;if(-1===this.activeTrack||!this.paused)return this;this.paused=!1;var e=this.channels[0].gain(),r=this.channels[1].gain(),n=this.channels[0].get(this.activeTrack),i=this.channels[1].get(this.activeTrack),s=this.processor.bufferSize;return this.processor.onaudioprocess=function(o){if(-1!==t.activeTrack){for(var a=o.inputBuffer.getChannelData(0),c=o.inputBuffer.getChannelData(1),u=new Float32Array(s),l=new Float32Array(s),h=0;h<s;h++)u[h]=e*a[h],l[h]=r*c[h];null==n||n.append(u),null==i||i.append(l)}else t.processor.disconnect(0),t.processor.onaudioprocess=null},this},t.prototype.stop=function(){return this.activeTrack=-1,this.paused=!0,this.processor.disconnect(0),this.processor.onaudioprocess=null,this},t.prototype.param=function(t){if("string"==typeof t)switch(t){case"0":if(this.channels[0])return this.channels[0].gain();break;case"1":if(this.channels[1])return this.channels[1].gain();break;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"0":this.channels[0]&&"number"==typeof s&&this.channels[0].gain(s);break;case"1":this.channels[1]&&"number"==typeof s&&this.channels[1].gain(s)}}return this},t.prototype.get=function(){return this.activeTrack},t.prototype.clear=function(t){if(-1!==this.activeTrack&&this.stop(),-1===t)for(var e=0,r=this.channels;e<r.length;e++)for(var n=0,i=r[e].get();n<i.length;n++){(a=i[n]).clear()}else if(this.hasTrack(t))for(var s=0,o=this.channels;s<o.length;s++){var a;null==(a=o[s].get(t))||a.clear()}return this},t.prototype.create=function(t,e,r,n){-1!==this.activeTrack&&this.stop();var i=null,s=null;if(-1===t&&this.has(-1,-1))i=this.mixTrack(0),s=this.mixTrack(1);else{if(!this.has(0,t)||!this.has(1,t))return"";i=this.flatTrack(0,t),s=this.flatTrack(1,t)}if(null===i||null===s)return"";var o=this.sampleRate,a=r,c=e,u=c*Math.min(i.length,s.length),l=36+(8+u*(a/8)),h=l-8,p=o*c*(a/8),f=u*(a/8),d=null;switch(a){case 8:d=new Uint8Array(u);for(var v=0;v<u;v++){var y=0;(y=v%c==0?Math.round((i[Math.trunc(v/c)]+1)/2*(Math.pow(2,8)-1)):Math.round((s[Math.trunc(v/c)]+1)/2*(Math.pow(2,8)-1)))>Math.pow(2,8)-1&&(y=Math.pow(2,8)-1),y<Math.pow(2,0)-1&&(y=Math.pow(2,0)-1),d[v]=y}break;case 16:d=new Int16Array(u);for(v=0;v<u;v++){y=0;(y=v%c==0?Math.round(i[Math.trunc(v/c)]*Math.pow(2,15)):Math.round(s[Math.trunc(v/c)]*Math.pow(2,15)))>+Math.pow(2,15)-1&&(y=+Math.pow(2,15)-1),y<-Math.pow(2,15)-0&&(y=-Math.pow(2,15)-0),d[v]=y}}if(null===d)return"";var m=new Uint8Array(l);m[0]=82,m[1]=73,m[2]=70,m[3]=70,m[4]=h>>0&255,m[5]=h>>8&255,m[6]=h>>16&255,m[7]=h>>24&255,m[8]=87,m[9]=65,m[10]=86,m[11]=69,m[12]=102,m[13]=109,m[14]=116,m[15]=32,m[16]=16,m[17]=0,m[18]=0,m[19]=0,m[20]=1,m[21]=0,m[22]=c,m[23]=0,m[24]=o>>0&255,m[25]=o>>8&255,m[26]=o>>16&255,m[27]=o>>24&255,m[28]=p>>0&255,m[29]=p>>8&255,m[30]=p>>16&255,m[31]=p>>24&255,m[32]=c*(a/8),m[33]=0,m[34]=a,m[35]=0,m[36]=100,m[37]=97,m[38]=116,m[39]=97,m[40]=f>>0&255,m[41]=f>>8&255,m[42]=f>>16&255,m[43]=f>>24&255;for(v=0;v<u;v++){var b=l-f;switch(a){case 8:m[b+v]=d[v];break;case 16:m[b+2*v+0]=d[v]>>0&255,m[b+2*v+1]=d[v]>>8&255}}switch(n){case"base64":case"dataURL":var g=window.btoa(Array.from(m).map((function(t){return String.fromCodePoint(t)})).join(""));return"base64"===n?g:"data:audio/wav;base64,".concat(g);case"blob":case"objectURL":var w=new Blob([m],{type:"audio/wav"});return"blob"===n?w:window.URL.createObjectURL(w);default:return""}},t.prototype.has=function(t,e){var r;if(!this.hasChannel(t))return this.channels.some((function(t){return t.get().some((function(t){return t.has()}))}));var n=this.channels[t].get();if(!this.hasTrack(e))return n.some((function(t){return t.has()}));var i=this.channels[t].get(e);return null!==(r=null==i?void 0:i.has())&&void 0!==r&&r},t.prototype.hasChannel=function(t){return t>=0&&t<this.channels.length},t.prototype.hasTrack=function(t){return t>=0&&this.channels.every((function(e){return t<e.length()}))},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),t.prototype.flatTrack=function(t,e){if(!this.hasChannel(t)||!this.hasTrack(e))return null;var r=this.channels[t].get(e);if(null===r)return null;for(var n=r.get(),i=this.processor.bufferSize,s=new Float32Array(n.length*i),o=0,a=n.length;o<a;o++)for(var c=n[o],u=0;u<i;u++)s[o*i+u]=c[u];return s},t.prototype.mixTrack=function(t){if(!this.hasChannel(t))return null;for(var e=this.channels[t].get(),r=this.processor.bufferSize,n=0,i=0,s=0,o=0,a=0,c=0,u=e;c<u.length;c++){a<(f=u[c].get()).length&&(a=f.length)}for(var l=new Float32Array(a*r);;){for(var h=0,p=e.length;h<p;h++){var f,d=(f=e[h].get())[s];d&&o>=0&&o<=d.length&&(n+=d[o],i++)}if(i<=0)return l;l[s*r+o]=n/i,n=0,i=0,o<r-1?o++:(s++,o=0)}},t}();e.Recorder=s},7836:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Room=void 0;var r=function(){function t(e,r){this.websocket=null;var n=r.roomId,i=r.bufferSize,s=r.numberOfInputs,o=r.numberOfOutputs,a=r.analyser;this.id=n,this.context=e,this.analyser=a,this.sender=e.createScriptProcessor(t.BUFFER_SIZE||i,s,o),this.receiver=e.createScriptProcessor(t.BUFFER_SIZE||i,s,o)}return t.prototype.join=function(t){var e=this,r=t.tls,n=t.host,i=t.port,s=t.path,o=t.openCallback,a=t.closeCallback,c=t.errorCallback,u=r?"wss://":"ws://";this.websocket=new WebSocket("".concat(u).concat(n,":").concat(i).concat(s)),this.websocket.binaryType="arraybuffer",this.websocket.onopen=function(t){null!==e.websocket&&(e.websocket.send(e.id),o&&o(t))},this.websocket.onclose=function(t){a&&a(t)},this.websocket.onerror=function(t){c&&c(t)},this.websocket.onmessage=function(t){if(null!==e.websocket&&t.data instanceof ArrayBuffer){var r=t.data.byteLength/Float32Array.BYTES_PER_ELEMENT,n=Math.trunc(r/2),i=n*Float32Array.BYTES_PER_ELEMENT,s=new Float32Array(t.data,0,n),o=new Float32Array(t.data,i,n);e.connect(),e.analyser.start("time"),e.analyser.start("fft"),e.receiver.onaudioprocess=function(t){var r=t.outputBuffer.getChannelData(0),n=t.outputBuffer.getChannelData(1);r.set(s),n.set(o),e.connected()||(e.analyser.stop("time"),e.analyser.stop("fft"))}}}},t.prototype.send=function(){var t=this;if(null!==this.websocket){var e=this.sender.bufferSize;this.sender.onaudioprocess=function(r){if(t.connected()){for(var n=r.inputBuffer.getChannelData(0),i=r.inputBuffer.getChannelData(1),s=new Float32Array(2*e),o=Math.trunc(s.length/2),a=0;a<e;a++)s[a]=n[a],s[o+a]=i[a];null!==t.websocket&&0===t.websocket.bufferedAmount&&(t.websocket.send(t.id),t.websocket.send(s))}}}},t.prototype.leave=function(){this.connected()&&(this.sender.disconnect(0),this.receiver.disconnect(0))},t.prototype.clear=function(){null!==this.websocket&&(this.websocket.send(this.id),this.websocket.close(),this.websocket=null)},t.prototype.connect=function(){this.receiver.connect(this.analyser.INPUT),this.receiver.connect(this.context.destination)},t.prototype.connected=function(){return null!==this.websocket&&this.websocket.readyState===WebSocket.OPEN},t.prototype.get=function(){var t;return(t={})[this.id]=this.websocket,t},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.sender},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.sender},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this.id},t.BUFFER_SIZE=2048,t}();e.Room=r},173:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Session=void 0;var n=r(7836),i=function(){function t(t){this.rooms=[],this.context=t,this.input=t.createGain(),this.output=t.createGain()}return t.prototype.setup=function(t){return this.rooms.push(new n.Room(this.context,t)),this},t.prototype.ready=function(t){var e=this.get(t.roomId);return null===e||e.join(t),this},t.prototype.start=function(t){var e=this.get(t);return null===e||(this.connect(t),e.send()),this},t.prototype.stop=function(t){var e=this.get(t);return null===e||e.leave(),this},t.prototype.clear=function(t){var e=this.get(t);return null===e||e.clear(),this},t.prototype.connect=function(t){var e=this.get(t);return null===e||(this.input.connect(e.INPUT),e.OUTPUT.connect(this.output)),this},t.prototype.connected=function(t){var e=this.get(t);return null!==e&&e.connected()},t.prototype.get=function(t){return this.rooms.find((function(e){return e.toString()===t}))||null},Object.defineProperty(t.prototype,"INPUT",{get:function(){return this.input},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OUTPUT",{get:function(){return this.output},enumerable:!1,configurable:!0}),t}();e.Session=i},2188:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SoundModule=void 0;var n=r(8397),i=r(7806),s=r(173),o=r(8044),a=r(2648),c=r(8649),u=r(346),l=r(4535),h=r(8137),p=r(111),f=r(7369),d=r(6548),v=r(4560),y=r(4226),m=r(610),b=r(2187),g=r(3627),w=r(3751),A=r(2393),T=r(4833),_=r(4091),k=r(1063),x=r(7223),O=r(8976),S=r(4979),M=r(3449),E=r(6813),C=function(){function t(e,r){this.modules=[],this.runningAnalyser=!1,this.mixed=!1,this.context=e,this.mastervolume=e.createGain(),this.processor=e.createScriptProcessor(r,t.NUMBER_OF_INPUTS,t.NUMBER_OF_OUTPUTS),this.analyser=new n.Analyser(e),this.recorder=new i.Recorder(e,r,2,2),this.session=new s.Session(e),this.stereo=new O.Stereo(e,r),this.compressor=new u.Compressor(e),this.bitcrusher=new a.BitCrusher(e),this.overdrive=new g.OverDrive(e),this.fuzz=new v.Fuzz(e),this.preamp=new _.Preamp(e),this.wah=new E.Wah(e),this.pitchshifter=new T.PitchShifter(e,r),this.equalizer=new p.Equalizer(e),this.filter=new f.Filter(e),this.autopanner=new o.Autopanner(e),this.tremolo=new S.Tremolo(e),this.ringmodulator=new x.Ringmodulator(e),this.phaser=new A.Phaser(e),this.flanger=new d.Flanger(e),this.chorus=new c.Chorus(e),this.delay=new l.Delay(e),this.reverb=new k.Reverb(e),this.panner=new w.Panner(e),this.listener=new y.Listener(e),this.envelopegenerator=new h.EnvelopeGenerator(e),this.noisegate=new m.NoiseGate(e),this.noisesuppressor=new b.NoiseSuppressor(e,r),this.vocalcanceler=new M.VocalCanceler(e,r),this.modules=[this.stereo,this.compressor,this.bitcrusher,this.overdrive,this.fuzz,this.preamp,this.wah,this.pitchshifter,this.equalizer,this.filter,this.autopanner,this.tremolo,this.ringmodulator,this.phaser,this.flanger,this.chorus,this.delay,this.reverb,this.panner,this.noisegate,this.noisesuppressor,this.vocalcanceler]}return t.prototype.connect=function(t){var e=this.modules[0].INPUT;if(null!==e){t.disconnect(0),this.modules.length>0?t.connect(e):t.connect(this.mastervolume);for(var r=0,n=this.modules.length;r<n;r++){var i=this.modules[r].OUTPUT;if(null!==i)if(i.disconnect(0),r<this.modules.length-1){var s=this.modules[r+1].INPUT;if(null===s)continue;i.connect(s)}else i.connect(this.mastervolume)}this.mastervolume.connect(this.context.destination),this.mastervolume.connect(this.analyser.INPUT),this.mastervolume.connect(this.recorder.INPUT),this.recorder.OUTPUT.connect(this.context.destination),this.mastervolume.connect(this.session.INPUT),this.session.OUTPUT.connect(this.context.destination)}},t.prototype.resize=function(t){return this.init(this.context,t),this},t.prototype.getBufferSize=function(){return this.processor.bufferSize},t.prototype.install=function(t,e){return this.modules.every((function(t){return t!==e}))&&this.modules.push(e),e},t.prototype.on=function(t){var e=null!=t?t:this.context.currentTime;return this.stereo.start(),this.bitcrusher.start(),this.overdrive.start(),this.fuzz.start(),this.chorus.start(e),this.flanger.start(e),this.phaser.start(e),this.autopanner.start(e),this.tremolo.start(e),this.ringmodulator.start(e),this.wah.start(e),this.filter.start(e),this},t.prototype.off=function(t){var e=null!=t?t:this.context.currentTime;return this.stereo.stop(),this.bitcrusher.stop(),this.overdrive.stop(),this.fuzz.stop(),this.chorus.stop(e),this.flanger.stop(e),this.phaser.stop(e),this.autopanner.stop(e),this.tremolo.stop(e),this.ringmodulator.stop(e),this.wah.stop(e),this.filter.stop(e),this},t.prototype.suspend=function(){return this.analyser.stop("time"),this.analyser.stop("fft"),this.runningAnalyser=!1,this.recorder.stop(),this.processor.disconnect(0),this},t.prototype.mix=function(){return this.mixed=!0,this},t.prototype.demix=function(){return this.mixed=!1,this},t.prototype.params=function(){return{mastervolume:this.mastervolume.gain.value,stereo:this.stereo.params(),compressor:this.compressor.params(),bitcrusher:this.bitcrusher.params(),overdrive:this.overdrive.params(),fuzz:this.fuzz.params(),preamp:this.preamp.params(),wah:this.wah.params(),pitchshifter:this.pitchshifter.params(),equalizer:this.equalizer.params(),filter:this.filter.params(),autopanner:this.autopanner.params(),tremolo:this.tremolo.params(),ringmodulator:this.ringmodulator.params(),phaser:this.phaser.params(),flanger:this.flanger.params(),chorus:this.chorus.params(),delay:this.delay.params(),reverb:this.reverb.params(),panner:this.panner.params(),listener:this.listener.params(),envelopegenerator:this.envelopegenerator.params(),noisegate:this.noisegate.params(),noisesuppressor:this.noisesuppressor.params(),vocalcanceler:this.vocalcanceler.params()}},t.prototype.toJSON=function(){return JSON.stringify(this.params())},t.prototype.init=function(e,r){if(this.modules.length>0){this.mastervolume.disconnect(0),this.processor.disconnect(0),this.analyser.INPUT.disconnect(0),this.recorder.INPUT.disconnect(0),this.session.INPUT.disconnect(0);for(var C=0,P=this.modules;C<P.length;C++){var N=P[C];N.INPUT&&N.INPUT.disconnect(0),N.OUTPUT&&N.OUTPUT.disconnect(0)}this.modules.length=0}this.processor=e.createScriptProcessor(r,t.NUMBER_OF_INPUTS,t.NUMBER_OF_OUTPUTS),this.analyser=new n.Analyser(e),this.recorder=new i.Recorder(e,r,2,2),this.session=new s.Session(e),this.stereo=new O.Stereo(e,r),this.compressor=new u.Compressor(e),this.bitcrusher=new a.BitCrusher(e),this.overdrive=new g.OverDrive(e),this.fuzz=new v.Fuzz(e),this.preamp=new _.Preamp(e),this.wah=new E.Wah(e),this.pitchshifter=new T.PitchShifter(e,r),this.equalizer=new p.Equalizer(e),this.filter=new f.Filter(e),this.autopanner=new o.Autopanner(e),this.tremolo=new S.Tremolo(e),this.ringmodulator=new x.Ringmodulator(e),this.phaser=new A.Phaser(e),this.flanger=new d.Flanger(e),this.chorus=new c.Chorus(e),this.delay=new l.Delay(e),this.reverb=new k.Reverb(e),this.panner=new w.Panner(e),this.listener=new y.Listener(e),this.envelopegenerator=new h.EnvelopeGenerator(e),this.noisegate=new m.NoiseGate(e),this.noisesuppressor=new b.NoiseSuppressor(e,r),this.vocalcanceler=new M.VocalCanceler(e,r),this.modules=[this.stereo,this.compressor,this.bitcrusher,this.overdrive,this.fuzz,this.preamp,this.wah,this.pitchshifter,this.equalizer,this.filter,this.autopanner,this.tremolo,this.ringmodulator,this.phaser,this.flanger,this.chorus,this.delay,this.reverb,this.panner,this.noisegate,this.noisesuppressor,this.vocalcanceler]},t.NUMBER_OF_INPUTS=2,t.NUMBER_OF_OUTPUTS=2,t}();e.SoundModule=C},3594:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.StreamModule=void 0;var o=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.sources=[],n.stream=null,n.constraints={audio:!0,video:!1},n.output=!0,n.track=!1,n.paused=!0,n}return i(e,t),e.prototype.setup=function(t){return t&&(this.constraints=s(s({},this.constraints),t)),this},e.prototype.ready=function(t){var e=this;return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&window.MediaStream?(this.paused=!1,(null==t?void 0:t.stream)?(this.stream=t.stream,Promise.resolve(this.stream)):navigator.mediaDevices.getUserMedia(this.constraints).then((function(r){return e.paused||(e.stream=r,(null==t?void 0:t.successCallback)&&t.successCallback(r)),r})).catch((function(e){return(null==t?void 0:t.errorCallback)&&t.errorCallback(e),e}))):Promise.reject()},e.prototype.start=function(){if(null===this.stream)return this;if(this.track)for(var t=this.stream.getAudioTracks(),e=0,r=t.length;e<r;e++)this.sources[e]=this.context.createMediaStreamTrackSource(t[e]),this.sources[e].connect(this.processor),this.connect(this.processor);else this.sources[0]=this.context.createMediaStreamSource(this.stream),this.sources[0].connect(this.processor),this.connect(this.processor);return this.output||(this.mastervolume.disconnect(0),this.mastervolume.connect(this.analyser.INPUT),this.mastervolume.connect(this.recorder.INPUT),this.recorder.OUTPUT.connect(this.context.destination),this.mastervolume.connect(this.session.INPUT),this.session.OUTPUT.connect(this.context.destination)),this.on(this.context.currentTime),this.analyser.start("time"),this.analyser.start("fft"),this.processor.onaudioprocess=function(t){var e=t.inputBuffer.getChannelData(0),r=t.inputBuffer.getChannelData(1),n=t.outputBuffer.getChannelData(0),i=t.outputBuffer.getChannelData(1);n.set(e),i.set(r)},this},e.prototype.stop=function(){return this.sources.length=0,this.off(this.context.currentTime),this.analyser.stop("time"),this.analyser.stop("fft"),this.mixed||(this.processor.disconnect(0),this.processor.onaudioprocess=null),this.paused=!0,this},e.prototype.param=function(t){if("string"==typeof t)switch(t){case"mastervolume":return this.mastervolume.gain.value;case"output":return this.output;case"track":return this.track;default:return this}for(var e=0,r=Object.entries(t);e<r.length;e++){var n=r[e],i=n[0],s=n[1];switch(i){case"mastervolume":"number"==typeof s&&(this.mastervolume.gain.value=s);break;case"output":"boolean"==typeof s&&(this.output=s);break;case"track":"boolean"==typeof s&&(this.track=s)}}return this},e.prototype.get=function(t){return"number"==typeof t&&t>=0&&t<this.sources.length?this.sources[t]:this.sources},e.prototype.getStream=function(){return this.stream},e.prototype.clear=function(){return this.stop(),this.clearAudioDevices(),this.clearVideoDevices(),this.stream=null,this},e.prototype.clearAudioDevices=function(){if(null===this.stream)return this;this.stop();for(var t=0,e=this.stream.getAudioTracks();t<e.length;t++){e[t].stop()}return this},e.prototype.clearVideoDevices=function(){if(null===this.stream)return this;this.stop();for(var t=0,e=this.stream.getVideoTracks();t<e.length;t++){e[t].stop()}return this.stream=null,this},e.prototype.devices=function(){return navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():Promise.reject()},e.prototype.streaming=function(){return!this.paused},e.prototype.module=function(t){switch(t){case"analyser":return this.analyser;case"recorder":return this.recorder;case"session":return this.session;case"autopanner":return this.autopanner;case"bitcrusher":return this.bitcrusher;case"chorus":return this.chorus;case"compressor":return this.compressor;case"delay":return this.delay;case"envelopegenerator":return this.envelopegenerator;case"equalizer":return this.equalizer;case"filter":return this.filter;case"flanger":return this.flanger;case"fuzz":return this.fuzz;case"listener":return this.listener;case"noisegate":return this.noisegate;case"noisesuppressor":return this.noisesuppressor;case"overdrive":return this.overdrive;case"panner":return this.panner;case"phaser":return this.phaser;case"pitchshifter":return this.pitchshifter;case"preamp":return this.preamp;case"reverb":return this.reverb;case"ringmodulator":return this.ringmodulator;case"stereo":return this.stereo;case"tremolo":return this.tremolo;case"vocalcanceler":return this.vocalcanceler;case"wah":return this.wah;default:return null}},e.prototype.resize=function(e){return t.prototype.init.call(this,this.context,e),this},e.prototype.on=function(e){return t.prototype.on.call(this,e),this},e.prototype.off=function(e){return t.prototype.off.call(this,e),this},e.prototype.suspend=function(){return t.prototype.suspend.call(this),this},e.prototype.mix=function(){return t.prototype.mix.call(this),this},e.prototype.demix=function(){return t.prototype.demix.call(this),this},e.prototype.params=function(){var e=t.prototype.params.call(this);return s(s({},e),{output:this.output,track:this.track,noisegate:this.noisegate.params(),noisesuppressor:this.noisesuppressor.params()})},Object.defineProperty(e.prototype,"INPUT",{get:function(){return this.processor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OUTPUT",{get:function(){return this.mastervolume},enumerable:!1,configurable:!0}),e}(r(2188).SoundModule);e.StreamModule=o},999:(t,e)=>{function r(t){return t>=0?e.MIN_A*Math.pow(e.FREQUENCY_RATIO,t):0}function n(t){var e=t.file,r=t.type,n=t.successCallback,i=t.errorCallback,s=t.progressCallback,o=new FileReader;switch(o.onprogress=function(t){s&&s(t)},o.onerror=function(t){var e,r,n,s,a;if(i){var c;switch(null===(e=o.error)||void 0===e?void 0:e.code){case null===(r=o.error)||void 0===r?void 0:r.NOT_FOUND_ERR:c="NOT_FOUND_ERR";break;case null===(n=o.error)||void 0===n?void 0:n.SECURITY_ERR:c="SECURITY_ERR";break;case null===(s=o.error)||void 0===s?void 0:s.ABORT_ERR:c="ABORT_ERR";break;case null===(a=o.error)||void 0===a?void 0:a.NOT_SUPPORTED_ERR:c="NOT_READABLE_ERR";break;default:c="ERR"}i(t,c)}},o.onload=function(t){if(n){var e=o.result;switch(r){case"text":"string"==typeof e&&(e=e.replace(/<(\/?script.*?)>/gi,"&lt;$1&gt;"));break;case"json":"string"==typeof e&&(e=JSON.parse(e.replace(/<(\/?script.*?)>/gi,"&lt;$1&gt;")))}n(t,e)}},r){case"arraybuffer":o.readAsArrayBuffer(e);break;case"dataURL":o.readAsDataURL(e);break;case"text":case"json":o.readAsText(e,"UTF-8")}}Object.defineProperty(e,"__esModule",{value:!0}),e.toTextFile=e.toFrequencies=e.file=e.drop=e.read=e.exitFullscreen=e.requestFullscreen=e.decode=e.convertTime=e.ajax=e.ifft=e.fft=e.computeFrequency=e.computeIndex=e.isPitchChar=e.DOT=e.HALF_DOWN=e.HALF_UP=e.SHARP=e.QUARTER_NOTE=e.MIN_A=e.FREQUENCY_RATIO=e.EQUAL_TEMPERAMENT=void 0,e.EQUAL_TEMPERAMENT=12,e.FREQUENCY_RATIO=1.0594630943592953,e.MIN_A=27.5,e.QUARTER_NOTE=4,e.SHARP="#",e.HALF_UP="+",e.HALF_DOWN="-",e.DOT=".",e.isPitchChar=function(t){switch(t.toUpperCase()){case"C":case"D":case"E":case"F":case"G":case"A":case"B":case"R":return!0;default:return!1}},e.computeIndex=function(t,r){var n=0;switch(r){case"C":n=3;break;case"D":n=5;break;case"E":n=7;break;case"F":n=8;break;case"G":n=10;break;case"A":n=12;break;case"B":n=14;break;case"R":return-1}var i=e.EQUAL_TEMPERAMENT*(t-1)+n;return i>=0?i:-1},e.computeFrequency=r,e.fft=function(t,e,r){for(var n=function(t){return Math.pow(2,t)},i=new Uint16Array(r),s=Math.log2(r),o=1;o<=s;o++)for(var a=0;a<n(o-1);a++)for(var c=s-o,u=0;u<n(c);u++){var l=a*n(c+1)+u,h=n(c)+l,p=u*n(o-1),f=t[l],d=e[l],v=t[h],y=e[h],m=Math.cos(2*Math.PI*p/r),b=-1*Math.sin(2*Math.PI*p/r);o<s?(t[l]=f+v,e[l]=d+y,t[h]=m*(f-v)-b*(d-y),e[h]=m*(d-y)+b*(f-v)):(t[l]=f+v,e[l]=d+y,t[h]=f-v,e[h]=d-y)}for(o=1;o<=s;o++)for(c=s-o,a=0;a<n(o-1);a++)i[n(o-1)+a]=i[a]+n(c);for(var g=0;g<r;g++)if(!(i[g]<=g)){var w=t[i[g]],A=e[i[g]];t[i[g]]=t[g],e[i[g]]=e[g],t[g]=w,e[g]=A}},e.ifft=function(t,e,r){for(var n=function(t){return Math.pow(2,t)},i=new Uint16Array(r),s=Math.log2(r),o=1;o<=s;o++)for(var a=0;a<n(o-1);a++)for(var c=s-o,u=0;u<n(c);u++){var l=a*n(c+1)+u,h=n(c)+l,p=u*n(o-1),f=t[l],d=e[l],v=t[h],y=e[h],m=Math.cos(2*Math.PI*p/r),b=Math.sin(2*Math.PI*p/r);o<s?(t[l]=f+v,e[l]=d+y,t[h]=m*(f-v)-b*(d-y),e[h]=m*(d-y)+b*(f-v)):(t[l]=f+v,e[l]=d+y,t[h]=f-v,e[h]=d-y)}for(o=1;o<=s;o++)for(c=s-o,a=0;a<n(o-1);a++)i[n(o-1)+a]=i[a]+n(c);for(var g=0;g<r;g++)if(!(i[g]<=g)){var w=t[i[g]],A=e[i[g]];t[i[g]]=t[g],e[i[g]]=e[g],t[g]=w,e[g]=A}for(g=0;g<r;g++)t[g]/=r,e[g]/=r},e.ajax=function(t){var e=t.url,r=t.type,n=t.timeout,i=t.successCallback,s=t.errorCallback,o=t.progressCallback,a=new XMLHttpRequest;a.timeout=null!=n?n:6e4,a.ontimeout=function(t){s&&s(t,"timeout")},a.onprogress=function(t){o&&o(t)},a.onerror=function(t){s&&s(t,"error")},a.onload=function(t){i&&200===a.status&&i(t,a.response)},a.open("GET",e,!0),a.responseType=null!=r?r:"arraybuffer",a.send(null)},e.convertTime=function(t){return t<0?{minutes:-1,seconds:-1,milliseconds:-1}:{minutes:Math.trunc(t/60),seconds:Math.trunc(t%60),milliseconds:t-Math.trunc(t)}},e.decode=function(t,e,r,n){r||(r=function(){}),n||(n=function(){}),t.decodeAudioData(e,r,n)},e.requestFullscreen=function(t){return t.requestFullscreen()},e.exitFullscreen=function(){return document.exitFullscreen()},e.read=n,e.drop=function(t){var e,r,i=t.event,s=t.type,o=t.successCallback,a=t.errorCallback,c=t.progressCallback;i.preventDefault();var u=null!==(r=null===(e=i.dataTransfer)||void 0===e?void 0:e.items[0].getAsFile())&&void 0!==r?r:null;return null===u?null:"objectURL"===s?window.URL.createObjectURL(u):(n({file:u,type:s,successCallback:o,errorCallback:a,progressCallback:c}),u)},e.file=function(t){var e,r,i=t.event,s=t.type,o=t.successCallback,a=t.errorCallback,c=t.progressCallback,u=null!==(r=null===(e=i.target.files)||void 0===e?void 0:e.item(0))&&void 0!==r?r:null;return null===u?null:"objectURL"===s?window.URL.createObjectURL(u):(n({file:u,type:s,successCallback:o,errorCallback:a,progressCallback:c}),u)},e.toFrequencies=function(t){return t.map((function(t){return r(t)}))},e.toTextFile=function(t,e){if(e){var r=new Blob([t],{type:"text/plain"});return window.URL.createObjectURL(r)}return"data:,".concat(encodeURIComponent(t))}},2309:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}var n={};return(()=>{var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.X=t.XSound=void 0,r(2309);r(2188);var e=r(6667),i=r(5146),s=r(4903),o=r(1114),a=r(7878),c=r(3594),u=r(6954),l=r(6567),h=r(9206),p=r(7087),f=r(8397),d=r(7806),v=r(173),y=r(1643),m=r(8044),b=r(2648),g=r(8649),w=r(346),A=r(4535),T=(r(8137),r(111)),_=r(7369),k=r(6548),x=r(4560),O=r(4226),S=r(610),M=r(2187),E=r(3627),C=r(3751),P=r(2393),N=r(4833),R=r(4091),j=r(1063),I=r(7223),z=r(8976),q=r(4979),F=r(3449),D=r(6813),U=r(999);window.AudioContext=window.AudioContext||window.webkitAudioContext,window.URL=window.URL||window.webkitURL;var L=new AudioContext,B={oscillator:new e.OscillatorModule(L,0),oneshot:new i.OneshotModule(L,0),noise:new s.NoiseModule(L,0),audio:new o.AudioModule(L,0),media:new a.MediaModule(L,0),stream:new c.StreamModule(L,0),processor:new u.ProcessorModule(L,0),mixer:new l.MixerModule(L,0),midi:new h.MIDI,mml:new p.MML};function G(t){switch(t){case"oscillator":return B.oscillator;case"oneshot":return B.oneshot;case"noise":return B.noise;case"audio":return B.audio;case"media":return B.media;case"stream":return B.stream;case"processor":return B.processor;case"mixer":return B.mixer;case"midi":return B.midi;case"mml":return B.mml;default:return null}}t.XSound=G,t.X=G,G.SAMPLE_RATE=L.sampleRate,G.EQUAL_TEMPERAMENT=U.EQUAL_TEMPERAMENT,G.FREQUENCY_RATIO=U.FREQUENCY_RATIO,G.MIN_A=U.MIN_A,G.QUARTER_NOT=U.QUARTER_NOTE,G.HALF_UP=U.HALF_UP,G.HALF_DOWN=U.HALF_DOWN,G.DOT=U.DOT,G.isPitchChar=U.isPitchChar,G.computeIndex=U.computeIndex,G.computeFrequency=U.computeFrequency,G.fft=U.fft,G.ifft=U.ifft,G.ajax=U.ajax,G.convertTime=U.convertTime,G.decode=U.decode,G.requestFullscreen=U.requestFullscreen,G.exitFullscreen=U.exitFullscreen,G.read=U.read,G.drop=U.drop,G.file=U.file,G.toFrequencies=U.toFrequencies,G.toTextFile=U.toTextFile,G.Analyser=f.Analyser,G.Recorder=d.Recorder,G.Session=v.Session,G.Effector=y.Effector,G.Autopanner=m.Autopanner,G.BitCrusher=b.BitCrusher,G.Chorus=g.Chorus,G.Compressor=w.Compressor,G.Delay=A.Delay,G.Equalizer=T.Equalizer,G.Filter=_.Filter,G.Flanger=k.Flanger,G.Fuzz=x.Fuzz,G.Listener=O.Listener,G.NoiseGate=S.NoiseGate,G.NoiseSuppressor=M.NoiseSuppressor,G.OverDrive=E.OverDrive,G.Panner=C.Panner,G.Phaser=P.Phaser,G.PitchShifter=N.PitchShifter,G.Preamp=R.Preamp,G.Reverb=j.Reverb,G.Ringmodulator=I.Ringmodulator,G.Stereo=z.Stereo,G.Tremolo=q.Tremolo,G.VocalCanceler=F.VocalCanceler,G.Wah=D.Wah,G.setup=function(){return"running"!==L.state?L.resume():Promise.reject()},G.clone=function(){var t={oscillator:new e.OscillatorModule(L,0),oneshot:new i.OneshotModule(L,0),noise:new s.NoiseModule(L,0),audio:new o.AudioModule(L,0),media:new a.MediaModule(L,0),stream:new c.StreamModule(L,0),mixer:new l.MixerModule(L,0),processor:new u.ProcessorModule(L,0),midi:new h.MIDI,mml:new p.MML};function r(e){switch(e){case"oscillator":return t.oscillator;case"oneshot":return t.oneshot;case"noise":return t.noise;case"audio":return t.audio;case"media":return t.media;case"stream":return t.stream;case"processor":return t.processor;case"mixer":return t.mixer;case"midi":return t.midi;case"mml":return t.mml;default:return null}}return r.free=function(e){for(var r=function(e){if(null===e)return"continue";Object.entries(t).forEach((function(r){var n=r[0],i=r[1];e===i&&(t[n]=null)}))},n=0,i=e;n<i.length;n++){r(i[n])}},r},G.free=function(t){for(var e=function(t){if(null===t)return"continue";Object.entries(B).forEach((function(e){var r=e[0],n=e[1];t===n&&(B[r]=null)}))},r=0,n=t;r<n.length;r++){e(n[r])}},G.noConflict=function(t){return window.X===G&&(window.X=void 0),t&&window.XSound===G&&(window.XSound=void 0),G},G.get=function(){return L},G.getCurrentTime=function(){return L.currentTime};var Q=function(){G.setup().then((function(){})).catch((function(){})),document.removeEventListener("click",Q,!1),document.removeEventListener("mousedown",Q,!1),document.removeEventListener("mouseup",Q,!1),document.removeEventListener("touchstart",Q,!1),document.removeEventListener("touchend",Q,!1)};document.addEventListener("click",Q,!1),document.addEventListener("mousedown",Q,!1),document.addEventListener("mouseup",Q,!1),document.addEventListener("touchstart",Q,!1),document.addEventListener("touchend",Q,!1)})(),n})()));
3
3
  //# sourceMappingURL=xsound.js.map