TelegramPWA/dist/5745.f08335611aa5cc24465b.js
Alexander Zinchuk 236dfc0cd2 [Build]
2023-06-21 18:35:31 +02:00

2 lines
14 KiB
JavaScript

(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[5745],{45745:function(e,t,r){var n="/",i=void 0!==i?i:{};"undefined"!=typeof self&&self,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return 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"!=typeof Symbol&&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)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){(function(t){var r,n,o=new Promise((function(e){n=e}));t.onmessage=function(e){o.then((function(){switch(e.data.command){case"decode":r&&r.decode(e.data.pages);break;case"done":r&&(r.sendLastBuffer(),t.close());break;case"init":r=new s(e.data,i)}}))};var s=function(e,t){if(!t)throw new Error("Module with exports required to initialize a decoder instance");this.mainReady=o,this.config=Object.assign({bufferLength:4096,decoderSampleRate:48e3,outputBufferSampleRate:48e3,resampleQuality:3},e),this._opus_decoder_create=t._opus_decoder_create,this._opus_decoder_destroy=t._opus_decoder_destroy,this._speex_resampler_process_interleaved_float=t._speex_resampler_process_interleaved_float,this._speex_resampler_init=t._speex_resampler_init,this._speex_resampler_destroy=t._speex_resampler_destroy,this._opus_decode_float=t._opus_decode_float,this._free=t._free,this._malloc=t._malloc,this.HEAPU8=t.HEAPU8,this.HEAP16=t.HEAP16,this.HEAP32=t.HEAP32,this.HEAPF32=t.HEAPF32,this.outputBuffers=[]};s.prototype.decode=function(e){var t=new DataView(e.buffer),r=this.getPageBoundaries(t),n=r.length-1;r.map((function(r,i){var o=t.getUint8(r+5,!0),s=t.getUint32(r+18,!0);if(2&o&&(this.numberOfChannels=t.getUint8(r+37,!0),this.init()),s>1){for(var u=t.getUint8(r+26,!0),a=r+27+u,f=0;f<u;f++){var c=t.getUint8(r+27+f,!0);if(this.decoderBuffer.set(e.subarray(a,a+=c),this.decoderBufferIndex),this.decoderBufferIndex+=c,c<255){var p=this._opus_decode_float(this.decoder,this.decoderBufferPointer,this.decoderBufferIndex,this.decoderOutputPointer,this.decoderOutputMaxLength,0),l=Math.ceil(p*this.config.outputBufferSampleRate/this.config.decoderSampleRate);this.HEAP32[this.decoderOutputLengthPointer>>2]=p,this.HEAP32[this.resampleOutputLengthPointer>>2]=l,this._speex_resampler_process_interleaved_float(this.resampler,this.decoderOutputPointer,this.decoderOutputLengthPointer,this.resampleOutputBufferPointer,this.resampleOutputLengthPointer),this.sendToOutputBuffers(this.HEAPF32.subarray(this.resampleOutputBufferPointer>>2,(this.resampleOutputBufferPointer>>2)+l*this.numberOfChannels)),this.decoderBufferIndex=0}}(4&o||i==n)&&this.sendLastBuffer()}}),this)},s.prototype.getPageBoundaries=function(e){for(var t=[],r=0;r<e.byteLength-32;r++)1399285583==e.getUint32(r,!0)&&t.push(r);return t},s.prototype.init=function(){this.resetOutputBuffers(),this.initCodec(),this.initResampler()},s.prototype.initCodec=function(){this.decoder&&(this._opus_decoder_destroy(this.decoder),this._free(this.decoderBufferPointer),this._free(this.decoderOutputLengthPointer),this._free(this.decoderOutputPointer));var e=this._malloc(4);this.decoder=this._opus_decoder_create(this.config.decoderSampleRate,this.numberOfChannels,e),this._free(e),this.decoderBufferMaxLength=4e3,this.decoderBufferPointer=this._malloc(this.decoderBufferMaxLength),this.decoderBuffer=this.HEAPU8.subarray(this.decoderBufferPointer,this.decoderBufferPointer+this.decoderBufferMaxLength),this.decoderBufferIndex=0,this.decoderOutputLengthPointer=this._malloc(4),this.decoderOutputMaxLength=this.config.decoderSampleRate*this.numberOfChannels*120/1e3,this.decoderOutputPointer=this._malloc(4*this.decoderOutputMaxLength)},s.prototype.initResampler=function(){this.resampler&&(this._speex_resampler_destroy(this.resampler),this._free(this.resampleOutputLengthPointer),this._free(this.resampleOutputBufferPointer));var e=this._malloc(4);this.resampler=this._speex_resampler_init(this.numberOfChannels,this.config.decoderSampleRate,this.config.outputBufferSampleRate,this.config.resampleQuality,e),this._free(e),this.resampleOutputLengthPointer=this._malloc(4),this.resampleOutputMaxLength=Math.ceil(this.decoderOutputMaxLength*this.config.outputBufferSampleRate/this.config.decoderSampleRate),this.resampleOutputBufferPointer=this._malloc(4*this.resampleOutputMaxLength)},s.prototype.resetOutputBuffers=function(){this.outputBuffers=[],this.outputBufferArrayBuffers=[],this.outputBufferIndex=0;for(var e=0;e<this.numberOfChannels;e++)this.outputBuffers.push(new Float32Array(this.config.bufferLength)),this.outputBufferArrayBuffers.push(this.outputBuffers[e].buffer)},s.prototype.sendLastBuffer=function(){this.sendToOutputBuffers(new Float32Array((this.config.bufferLength-this.outputBufferIndex)*this.numberOfChannels)),t.postMessage(null)},s.prototype.sendToOutputBuffers=function(e){for(var r=0,n=e.length/this.numberOfChannels;r<n;){var i=Math.min(n-r,this.config.bufferLength-this.outputBufferIndex);if(1===this.numberOfChannels)this.outputBuffers[0].set(e.subarray(r,r+i),this.outputBufferIndex);else for(var o=0;o<i;o++)this.outputBuffers.forEach((function(t,n){t[this.outputBufferIndex+o]=e[(r+o)*this.numberOfChannels+n]}),this);r+=i,this.outputBufferIndex+=i,this.outputBufferIndex==this.config.bufferLength&&(t.postMessage(this.outputBuffers,this.outputBufferArrayBuffers),this.resetOutputBuffers())}},i||(i={}),i.mainReady=o,i.OggOpusDecoder=s,i.onRuntimeInitialized=n,e.exports=i}).call(this,r(1))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r}]);var o,s={};for(o in i)i.hasOwnProperty(o)&&(s[o]=i[o]);var u=[],a=!1,f=!1,c=!1,p=!1;a="object"==typeof window,f="function"==typeof importScripts,c="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p=!a&&!c&&!f;var l,d,h,m,_="";function y(e){return i.locateFile?i.locateFile(e,_):_+e}c?(_=f?r(26470).dirname(_)+"/":n+"/",l=function(e,t){return h||(h=r(50516)),m||(m=r(26470)),e=m.normalize(e),h.readFileSync(e,t?null:"utf8")},d=function(e){var t=l(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),u=process.argv.slice(2),e.exports=i,process.on("uncaughtException",(function(e){if(!(e instanceof ve))throw e})),process.on("unhandledRejection",Z),i.inspect=function(){return"[Emscripten Module object]"}):p?("undefined"!=typeof read&&(l=function(e){return read(e)}),d=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?u=scriptArgs:void 0!==arguments&&(u=arguments),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(a||f)&&(f?_=self.location.href:document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",l=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},f&&(d=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}));var g,b,v=i.print||console.log.bind(console),w=i.printErr||console.warn.bind(console);for(o in s)s.hasOwnProperty(o)&&(i[o]=s[o]);s=null,i.arguments&&(u=i.arguments),i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(g=i.wasmBinary),i.noExitRuntime&&i.noExitRuntime,"object"!=typeof WebAssembly&&w("no native wasm support detected");var x=new WebAssembly.Table({initial:9,maximum:9,element:"anyfunc"}),B=!1;function O(e,t){e||Z("Assertion failed: "+t)}var P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(e,t,r){for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.subarray&&P)return P.decode(e.subarray(t,i));for(var o="";t<i;){var s=e[t++];if(128&s){var u=63&e[t++];if(192!=(224&s)){var a=63&e[t++];if((s=224==(240&s)?(15&s)<<12|u<<6|a:(7&s)<<18|u<<12|a<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var f=s-65536;o+=String.fromCharCode(55296|f>>10,56320|1023&f)}}else o+=String.fromCharCode((31&s)<<6|u)}else o+=String.fromCharCode(s)}return o}function R(e,t){return e?A(S,e,t):""}var E,S,I,L=65536;function M(e){E=e,i.HEAP8=new Int8Array(e),i.HEAP16=new Int16Array(e),i.HEAP32=I=new Int32Array(e),i.HEAPU8=S=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e)}var C=5283024,H=39984,U=i.INITIAL_MEMORY||16777216;function j(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?i.dynCall_v(r):i.dynCall_vi(r,t.arg):r(void 0===t.arg?null:t.arg)}else t(i)}}(b=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:U/L,maximum:U/L}))&&(E=b.buffer),U=E.byteLength,M(E),I[H>>2]=C;var T=[],W=[],F=[],k=[];function D(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)N(i.preRun.shift());j(T)}function q(){j(W)}function z(){j(F)}function G(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)Q(i.postRun.shift());j(k)}function N(e){T.unshift(e)}function Q(e){k.unshift(e)}var X=0,V=null,Y=null;function J(e){X++,i.monitorRunDependencies&&i.monitorRunDependencies(X)}function K(e){if(X--,i.monitorRunDependencies&&i.monitorRunDependencies(X),0==X&&(null!==V&&(clearInterval(V),V=null),Y)){var t=Y;Y=null,t()}}function Z(e){throw i.onAbort&&i.onAbort(e),v(e+=""),w(e),B=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}function $(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}i.preloadedImages={},i.preloadedAudios={};var ee="data:application/octet-stream;base64,";function te(e){return $(e,ee)}var re="file://";function ne(e){return $(e,re)}var ie="decoderWorker.min.wasm";function oe(){try{if(g)return new Uint8Array(g);if(d)return d(ie);throw"both async and sync fetching of the wasm failed"}catch(e){Z(e)}}function se(){return g||!a&&!f||"function"!=typeof fetch||ne(ie)?new Promise((function(e,t){e(oe())})):fetch(ie,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+ie+"'";return e.arrayBuffer()})).catch((function(){return oe()}))}function ue(){var e={a:_e};function t(e,t){var r=e.exports;i.asm=r,K()}function r(e){t(e.instance)}function n(t){return se().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){w("failed to asynchronously prepare wasm: "+e),Z(e)}))}if(J(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return w("Module.instantiateWasm callback failed with error: "+e),!1}return function(){if(g||"function"!=typeof WebAssembly.instantiateStreaming||te(ie)||ne(ie)||"function"!=typeof fetch)return n(r);fetch(ie,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),n(r)}))}))}(),{}}function ae(){Z()}function fe(e,t,r){S.copyWithin(e,t,t+r)}function ce(e){Z("OOM")}function pe(e){ce()}te(ie)||(ie=y(ie)),W.push({func:function(){be()}});var le={mappings:{},buffers:[null,[],[]],printChar:function(e,t){var r=le.buffers[e];0===t||10===t?((1===e?v:w)(A(r,0)),r.length=0):r.push(t)},varargs:void 0,get:function(){return le.varargs+=4,I[le.varargs-4>>2]},getStr:function(e){return R(e)},get64:function(e,t){return e}};function de(e){return 0}function he(e,t,r,n,i){}function me(e,t,r,n){for(var i=0,o=0;o<r;o++){for(var s=I[t+8*o>>2],u=I[t+(8*o+4)>>2],a=0;a<u;a++)le.printChar(e,S[s+a]);i+=u}return I[n>>2]=i,0}var _e={c:ae,e:fe,f:pe,d:de,b:he,a:me,memory:b,table:x},ye=ue();i.asm=ye;var ge,be=i.___wasm_call_ctors=function(){return(be=i.___wasm_call_ctors=i.asm.g).apply(null,arguments)};function ve(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function we(e){function t(){ge||(ge=!0,i.calledRun=!0,B||(q(),z(),i.onRuntimeInitialized&&i.onRuntimeInitialized(),G()))}e=e||u,X>0||(D(),X>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}if(i._opus_decoder_create=function(){return(i._opus_decoder_create=i.asm.h).apply(null,arguments)},i._opus_decode_float=function(){return(i._opus_decode_float=i.asm.i).apply(null,arguments)},i._opus_decoder_destroy=function(){return(i._opus_decoder_destroy=i.asm.j).apply(null,arguments)},i._speex_resampler_init=function(){return(i._speex_resampler_init=i.asm.k).apply(null,arguments)},i._speex_resampler_destroy=function(){return(i._speex_resampler_destroy=i.asm.l).apply(null,arguments)},i._speex_resampler_process_interleaved_float=function(){return(i._speex_resampler_process_interleaved_float=i.asm.m).apply(null,arguments)},i._malloc=function(){return(i._malloc=i.asm.n).apply(null,arguments)},i._free=function(){return(i._free=i.asm.o).apply(null,arguments)},i.asm=ye,Y=function e(){ge||we(),ge||(Y=e)},i.run=we,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();we()},50516:()=>{}}]);
//# sourceMappingURL=5745.f08335611aa5cc24465b.js.map