!function(e){vart={};functionr(n){if(t[n])returnt[n].exports;vars=t[n]={i:n,l:!1,exports:{}};returne[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)returne;if(4&t&&"object"==typeofe&&e&&e.__esModule)returne;varn=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeofe)for(varsine)r.d(n,s,function(t){returne[t]}.bind(null,s));returnn},r.n=function(e){vart=e&&e.__esModule?function(){returne.default}:function(){returne};returnr.d(t,"a",t),t},r.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"undefined"!=typeofself&&self,e.exports=function(e){vart={};functionr(n){if(t[n])returnt[n].exports;vars=t[n]={i:n,l:!1,exports:{}};returne[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}returnr.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)returne;if(4&t&&"object"==typeofe&&e&&e.__esModule)returne;varn=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeofe)for(varsine)r.d(n,s,function(t){returne[t]}.bind(null,s));returnn},r.n=function(e){vart=e&&e.__esModule?function(){returne.default}:function(){returne};returnr.d(t,"a",t),t},r.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";(function(t){varr;t.onmessage=function(e){switch(e.data.command){case"encode":r&&r.record(e.data.buffers);break;case"done":r&&(r.requestData(),r=null);break;case"close":t.close();break;case"init":r=newn(e.data),t.postMessage({message:"ready"})}};varn=function(e){if(!(e=Object.assign({wavBitDepth:16},e)).wavSampleRate)thrownewError("wavSampleRate value is required to record. NOTE: Audio is not resampled!");if(-1===[8,16,24,32].indexOf(e.wavBitDepth))thrownewError("Only 8, 16, 24 and 32 bits per sample are supported");this.bitDepth=e.wavBitDepth,this.sampleRate=e.wavSampleRate,this.recordedBuffers=[],this.bytesPerSample=this.bitDepth/8};n.prototype.record=function(e){this.numberOfChannels=this.numberOfChannels||e.length;for(vart=e[0].length,r=newUint8Array(t*this.numberOfChannels*this.bytesPerSample),n=0;n<t;n++)for(vars=0;s<this.numberOfChannels;s++){vara=(n*this.numberOfChannels+s)*this.bytesPerSample,o=Math.max(-1,Math.min(1,e[s][n]));switch(this.bytesPerSample){case4:o=2147483647.5*o-.5,r[a]=o,r[a+1]=o>>8,r[a+2]=o>>16,r[a+3]=o>>24;break;case3:o=8388607.5*o-.5,r[a]=o,r[a+1]=o>>8,r[a+2]=o>>16;break;case2:o=32767.5*o-.5,r[a]=o,r[a+1]=o>>8;break;case1:r[a]=127.5*(o+1);break;default:thrownewError("Only 8, 16, 24 and 32 bits per sample are supported")}}this.recordedBuffers.push(r)},n.prototype.requestData=function(){vare=this.recordedBuffers[0].length,r=this.recordedBuffers.length*e,n=newUint8Array(44+r),s=newDataView(n.buffer);s.setUint32(0,1380533830,!1),s.setUint32(4,36+r,!0),s.setUint32(8,1463899717,!1),s.setUint32(12,1718449184,!1),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,this.numberOfChannels,!0),s.setUint32(24,this.sampleRate,!0),s.setUint32(28,this.sampleRate*this.bytesPerSample*this.numberOfChannels,!0),s.setUint16(32,this.bytesPerSample*this.numberOfChannels,!0),s.setUint16(34,this.bitDepth,!0),s.setUint32(36,1684108385,!1),s.setUint32(40,r,!0);for(vara=0;a<this.recordedBuffers.length;a++)n.set(this.recordedBuffers[a],a*e+44);t.postMessage({message:"page",page:n},[n.buffer]),t.postMessage({message:"done"})},e.exports=n}).call(this,r(1))},function(e,t){varr;r=function(){returnthis}();try{r=r||new