gy-roslib
Version:
gy
1 lines • 1.15 kB
JavaScript
var initWasm=async(_0xa84c0f={},_0x263278)=>{let _0x4e961e;if(_0x263278['startsWith']('data:')){const _0x169476=_0x263278['replace'](/^data:.*?base64,/,'');let _0xed2bd1;if(typeof Buffer==='function'&&typeof Buffer['from']==='function')_0xed2bd1=Buffer['from'](_0x169476,'base64');else{if(typeof atob==='function'){const _0x226b53=atob(_0x169476);_0xed2bd1=new Uint8Array(_0x226b53['length']);for(let _0x2721ef=0x0;_0x2721ef<_0x226b53['length'];_0x2721ef++){_0xed2bd1[_0x2721ef]=_0x226b53['charCodeAt'](_0x2721ef);}}else throw new Error('Failed\x20to\x20decode\x20base64-encoded\x20data\x20URL,\x20Buffer\x20and\x20atob\x20are\x20not\x20supported');}_0x4e961e=await WebAssembly['instantiate'](_0xed2bd1,_0xa84c0f);}else{const _0x190619=await fetch(_0x263278),_0x95c20d=_0x190619['headers']['get']('Content-Type')||'';if('instantiateStreaming'in WebAssembly&&_0x95c20d['startsWith']('application/wasm'))_0x4e961e=await WebAssembly['instantiateStreaming'](_0x190619,_0xa84c0f);else{const _0x416797=await _0x190619['arrayBuffer']();_0x4e961e=await WebAssembly['instantiate'](_0x416797,_0xa84c0f);}}return _0x4e961e['instance'];};export{initWasm as i};