File: //var/packages/UniversalViewer/target/dist/assets/codepage-Bc0X_7fV.js
var Be=(()=>{var v=import.meta.url;return function(_={}){var r=_,k,P;r.ready=new Promise((e,n)=>{k=e,P=n});var M=Object.assign({},r),q=!0,m="";function G(e){return r.locateFile?r.locateFile(e,m):m+e}typeof document<"u"&&document.currentScript&&(m=document.currentScript.src),v&&(m=v),m.indexOf("blob:")!==0?m=m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):m="";var x=r.print||console.log.bind(console),w=r.printErr||console.error.bind(console);Object.assign(r,M),M=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit;var p;r.wasmBinary&&(p=r.wasmBinary),typeof WebAssembly!="object"&&T("no native wasm support detected");var U,H=!1,D,R,C;function W(){var e=U.buffer;r.HEAP8=D=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAPU8=R=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAP32=new Int32Array(e),r.HEAPU32=C=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var I=[],O=[],z=[];function ee(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)te(r.preRun.shift());S(I)}function ne(){S(O)}function re(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)ie(r.postRun.shift());S(z)}function te(e){I.unshift(e)}function ae(e){O.unshift(e)}function ie(e){z.unshift(e)}var g=0,b=null;function fe(e){g++,r.monitorRunDependencies?.(g)}function oe(e){if(g--,r.monitorRunDependencies?.(g),g==0&&b){var n=b;b=null,n()}}function T(e){r.onAbort?.(e),e="Aborted("+e+")",w(e),H=!0,e+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(e);throw P(n),n}var se="data:application/octet-stream;base64,",N=e=>e.startsWith(se),y;r.locateFile?(y="ced-wasm.wasm",N(y)||(y=G(y))):y=new URL(""+new URL("../ced-wasm.BwbPa4Fc.wasm",import.meta.url).href,import.meta.url).href;function L(e){if(e==y&&p)return new Uint8Array(p);throw"both async and sync fetching of the wasm failed"}function ce(e){return!p&&q&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw"failed to load wasm binary file at '"+e+"'";return n.arrayBuffer()}).catch(()=>L(e)):Promise.resolve().then(()=>L(e))}function j(e,n,t){return ce(e).then(a=>WebAssembly.instantiate(a,n)).then(a=>a).then(t,a=>{w(`failed to asynchronously prepare wasm: ${a}`),T(a)})}function ue(e,n,t,a){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!N(n)&&typeof fetch=="function"?fetch(n,{credentials:"same-origin"}).then(s=>{var o=WebAssembly.instantiateStreaming(s,t);return o.then(a,function(i){return w(`wasm streaming compile failed: ${i}`),w("falling back to ArrayBuffer instantiation"),j(n,t,a)})}):j(n,t,a)}function le(){var e={a:Te};function n(a,s){return d=a.exports,U=d.f,W(),ae(d.g),oe(),d}fe();function t(a){n(a.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(e,n)}catch(a){w(`Module.instantiateWasm callback failed with error: ${a}`),P(a)}return ue(p,y,e,t).catch(P),{}}var S=e=>{for(;e.length>0;)e.shift()(r)};r.noExitRuntime;var ve=()=>{T("")},me=()=>2147483648,de=e=>{var n=U.buffer,t=(e-n.byteLength+65535)/65536;try{return U.grow(t),W(),1}catch{}},ge=e=>{var n=R.length;e>>>=0;var t=me();if(e>t)return!1;for(var a=(c,l)=>c+(l-c%l)%l,s=1;s<=4;s*=2){var o=n*(1+.2/s);o=Math.min(o,e+100663296);var i=Math.min(t,a(Math.max(e,o),65536)),f=de(i);if(f)return!0}return!1},V=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,$=(e,n,t)=>{for(var a=n+t,s=n;e[s]&&!(s>=a);)++s;if(s-n>16&&e.buffer&&V)return V.decode(e.subarray(n,s));for(var o="";n<s;){var i=e[n++];if(!(i&128)){o+=String.fromCharCode(i);continue}var f=e[n++]&63;if((i&224)==192){o+=String.fromCharCode((i&31)<<6|f);continue}var c=e[n++]&63;if((i&240)==224?i=(i&15)<<12|f<<6|c:i=(i&7)<<18|f<<12|c<<6|e[n++]&63,i<65536)o+=String.fromCharCode(i);else{var l=i-65536;o+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return o},ye=(e,n)=>e?$(R,e,n):"",he=e=>52;function we(e,n,t,a,s){return 70}var pe=[null,[],[]],Re=(e,n)=>{var t=pe[e];n===0||n===10?((e===1?x:w)($(t,0)),t.length=0):t.push(n)},be=(e,n,t,a)=>{for(var s=0,o=0;o<t;o++){var i=C[n>>2],f=C[n+4>>2];n+=8;for(var c=0;c<f;c++)Re(e,R[i+c]);s+=f}return C[a>>2]=s,0},J=e=>{var n=r["_"+e];return n},Ae=(e,n)=>{D.set(e,n)},_e=e=>{for(var n=0,t=0;t<e.length;++t){var a=e.charCodeAt(t);a<=127?n++:a<=2047?n+=2:a>=55296&&a<=57343?(n+=4,++t):n+=3}return n},Pe=(e,n,t,a)=>{if(!(a>0))return 0;for(var s=t,o=t+a-1,i=0;i<e.length;++i){var f=e.charCodeAt(i);if(f>=55296&&f<=57343){var c=e.charCodeAt(++i);f=65536+((f&1023)<<10)|c&1023}if(f<=127){if(t>=o)break;n[t++]=f}else if(f<=2047){if(t+1>=o)break;n[t++]=192|f>>6,n[t++]=128|f&63}else if(f<=65535){if(t+2>=o)break;n[t++]=224|f>>12,n[t++]=128|f>>6&63,n[t++]=128|f&63}else{if(t+3>=o)break;n[t++]=240|f>>18,n[t++]=128|f>>12&63,n[t++]=128|f>>6&63,n[t++]=128|f&63}}return n[t]=0,t-s},Ue=(e,n,t)=>Pe(e,R,n,t),Ce=e=>{var n=_e(e)+1,t=B(n);return Ue(e,t,n),t},K=(e,n,t,a,s)=>{var o={string:u=>{var A=0;return u!=null&&u!==0&&(A=Ce(u)),A},array:u=>{var A=B(u.length);return Ae(u,A),A}};function i(u){return n==="string"?ye(u):n==="boolean"?!!u:u}var f=J(e),c=[],l=0;if(a)for(var h=0;h<a.length;h++){var Z=o[t[h]];Z?(l===0&&(l=Q()),c[h]=Z(a[h])):c[h]=a[h]}var F=f.apply(null,c);function Se(u){return l!==0&&X(l),i(u)}return F=Se(F),F},Ee=(e,n,t,a)=>{var s=!t||t.every(i=>i==="number"||i==="boolean"),o=n!=="string";return o&&s&&!a?J(e):function(){return K(e,n,t,arguments)}},Te={a:ve,c:ge,e:he,b:we,d:be},d=le();r._analyze_encoding=(e,n)=>(r._analyze_encoding=d.h)(e,n);var Q=()=>(Q=d.j)(),X=e=>(X=d.k)(e),B=e=>(B=d.l)(e);r.ccall=K,r.cwrap=Ee;var E;b=function e(){E||Y(),E||(b=e)};function Y(){if(g>0||(ee(),g>0))return;function e(){E||(E=!0,r.calledRun=!0,!H&&(ne(),k(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),re()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),e()},1)):e()}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return Y(),_.ready}})();async function Fe(v){return(await Be(v)).cwrap("analyze_encoding","string",["array","number"])}const ke=""+new URL("../ced-wasm.BwbPa4Fc.wasm",import.meta.url).href,Me=Fe({locateFile:()=>ke});async function He(v){return v.length>8192&&(v=v.slice(0,8192)),(await Me)(v,v.length)}export{He as d};