chardetng-wasm
Version:
Makes chardetng, Firefox's character encoding detection, available to JS through Web Assembly
1 lines • 3.66 kB
JavaScript
(()=>{"use strict";var e,t,r,n,o,a,i={583:(e,t,r)=>{let n=[];r.e(415).then(r.bind(r,415)).then((e=>{self.chardetng.detect=e.detect,self.chardetng.EncodingDetector=e.EncodingDetector,n.forEach((e=>e())),n=null})).catch(console.error),self.chardetng={onReady:function(e){self.chardetng.detect?e():n.push(e)}}}},c={};function s(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={id:e,exports:{}};return i[e](r,r.exports,s),r.exports}s.m=i,s.c=c,s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,r)=>(s.f[r](e,t),t)),[])),s.u=e=>e+".chardetng.es5.min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="chardetng-wasm:",s.l=(r,n,o,a)=>{if(e[r])e[r].push(n);else{var i,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+o){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",t+o),i.src=r),e[r]=[n];var f=(t,n)=>{i.onerror=i.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),c&&document.head.appendChild(i)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={179:0};s.f.j=(t,r)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var a=s.p+s.u(t),i=new Error;s.l(a,(r=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[a,i,c]=r,u=0;for(n in i)s.o(i,n)&&(s.m[n]=i[n]);for(c&&c(s),t&&t(r);u<a.length;u++)o=a[u],s.o(e,o)&&e[o]&&e[o][0](),e[a[u]]=0},r=self.webpackChunkchardetng_wasm=self.webpackChunkchardetng_wasm||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),n={},o={75:function(){return{"./chardetng_wasm_bg.js":{__wbindgen_throw:function(e,t){return void 0===r&&(r=s.c[784].exports),r.Or(e,t)}}}}},a={415:[75]},s.w={},s.f.wasm=function(e,t){(a[e]||[]).forEach((function(r,a){var i=n[r];if(i)t.push(i);else{var c,u=o[r](),l=fetch(s.p+""+{415:{75:"8dc3939b0f0cc922110c"}}[e][r]+".module.wasm");c=u instanceof Promise&&"function"==typeof WebAssembly.compileStreaming?Promise.all([WebAssembly.compileStreaming(l),u]).then((function(e){return WebAssembly.instantiate(e[0],e[1])})):"function"==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(l,u):l.then((function(e){return e.arrayBuffer()})).then((function(e){return WebAssembly.instantiate(e,u)})),t.push(n[r]=c.then((function(e){return s.w[r]=(e.instance||e).exports})))}}))},s(583)})();