diff --git a/firebase.json b/firebase.json index aebd3e6..4082605 100644 --- a/firebase.json +++ b/firebase.json @@ -5,6 +5,34 @@ "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "cleanUrls": true, "trailingSlash": false, - "predeploy": ["npm run lint", "npm run build"] + "predeploy": ["npm run lint", "npm run build"], + "headers": [ + { + "source": "/", + "headers": [ + { + "key": "Cross-Origin-Embedder-Policy", + "value": "require-corp" + }, + { + "key": "Cross-Origin-Opener-Policy", + "value": "same-origin" + } + ] + }, + { + "source": "/engines/stockfish-wasm/stockfish-nnue-16.js", + "headers": [ + { + "key": "Cross-Origin-Embedder-Policy", + "value": "require-corp" + }, + { + "key": "Cross-Origin-Opener-Policy", + "value": "same-origin" + } + ] + } + ] } } diff --git a/next.config.js b/next.config.js index 2a02684..f3f5b8e 100644 --- a/next.config.js +++ b/next.config.js @@ -1,11 +1,44 @@ -/** @type {import('next').NextConfig} */ -const nextConfig = { - output: "export", - trailingSlash: false, - reactStrictMode: true, - images: { - unoptimized: true, - }, -}; +const { PHASE_PRODUCTION_BUILD } = require("next/constants"); + +const nextConfig = (phase) => + /** @type {import('next').NextConfig} */ ({ + output: phase === PHASE_PRODUCTION_BUILD ? "export" : undefined, + trailingSlash: false, + reactStrictMode: true, + images: { + unoptimized: true, + }, + headers: + phase === PHASE_PRODUCTION_BUILD + ? undefined + : () => [ + { + source: "/", + headers: [ + { + key: "Cross-Origin-Embedder-Policy", + value: "require-corp", + }, + { + key: "Cross-Origin-Opener-Policy", + value: "same-origin", + }, + ], + }, + { + source: "/engines/stockfish-wasm/stockfish-nnue-16.js", + headers: [ + { + key: "Cross-Origin-Embedder-Policy", + value: "require-corp", + }, + { + key: "Cross-Origin-Opener-Policy", + value: "same-origin", + }, + ], + }, + ], + }); module.exports = nextConfig; diff --git a/public/engines/stockfish-wasm/stockfish-nnue-16-single.js b/public/engines/stockfish-wasm/stockfish-nnue-16-single.js deleted file mode 100644 index a65eee4..0000000 --- a/public/engines/stockfish-wasm/stockfish-nnue-16-single.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * Stockfish.js 16 (c) 2023, Chess.com, LLC - * https://github.com/nmrugg/stockfish.js - * License: GPLv3 - * - * Based on stockfish.wasm (c) - * Niklas Fiekas - * Hiroshi Ogawa - * https://github.com/niklasf/stockfish.wasm - * https://github.com/hi-ogawa/Stockfish - * - * Based on Stockfish (c) T. Romstad, M. Costalba, J. Kiiski, G. Linscott and other contributors. - * https://github.com/official-stockfish/Stockfish - */!function(){var t,n,r,e,o,a;function i(){function e(e){var i,D,I,n,t;e=e||{},(i=i||(void 0!==e?e:{})).ready=new Promise(function(e,n){D=e,I=n}),"undefined"==typeof XMLHttpRequest&&(global.XMLHttpRequest=function(){var t,r={open:function(e,n){t=n},send:function(){require("fs").readFile(t,function(e,n){r.readyState=4,e?(console.error(e),r.status=404,r.onerror(e)):(r.status=200,r.response=n,r.onreadystatechange(),r.onload())})}};return r}),"undefined"!=typeof global&&"[object process]"===Object.prototype.toString.call(global.process)&&"undefined"!=typeof fetch&&(fetch=null),i.postCustomMessage=function(e){if("undefined"!=typeof PThread)for(var n of PThread.ba)n.postMessage({cmd:"custom",userData:e})},i.queue=(t=[],{get:async function(){return 0>10,56320|1023&i)))):r+=String.fromCharCode(i)}return r}function C(e){return e?K(R,e,void 0):""}function O(e,n,t,r){if(0>6}else{if(a<=65535){if(r<=t+2)break;n[t++]=224|a>>12}else{if(r<=t+3)break;n[t++]=240|a>>18,n[t++]=128|a>>12&63}n[t++]=128|a>>6&63}n[t++]=128|63&a}}n[t]=0}}function J(e){for(var n=0,t=0;t>2]=n,T[e+4>>2]=n/4294967296|0}function de(r,t,o,a,n){function i(e){var n=0,t=0;e&&(t=w.response?w.response.byteLength:0,n=j(t),R.set(new Uint8Array(w.response),n)),T[r+12>>2]=n,U(r+16,t)}if(d=T[r+8>>2]){var e=C(d),u=(u=C(g=r+112))||"GET",s=T[g+52>>2],c=T[g+56>>2],f=!!T[g+60>>2],l=T[g+68>>2],p=T[g+72>>2],d=T[g+76>>2],m=T[g+80>>2],y=T[g+84>>2],g=T[g+88>>2],h=!!(1&s),v=!!(2&s),s=!!(64&s),l=l?C(l):void 0,p=p?C(p):void 0,_=m?C(m):void 0,w=new XMLHttpRequest;if(w.withCredentials=f,w.open(u,e,!s,l,p),s||(w.timeout=c),w.Z=e,w.responseType="arraybuffer",m&&w.overrideMimeType(_),d)for(;(u=T[d>>2])&&(e=T[d+4>>2]);)d+=8,u=C(u),e=C(e),w.setRequestHeader(u,e);pe.push(w),T[r+0>>2]=pe.length,d=y&&g?R.slice(y,y+g):null,w.onload=function(e){i(h&&!v);var n=w.response?w.response.byteLength:0;U(r+24,0),n&&U(r+32,n),x[r+40>>1]=w.readyState,x[r+42>>1]=w.status,w.statusText&&O(w.statusText,R,r+44,64),200<=w.status&&w.status<300?t&&t(r,w,e):o&&o(r,w,e)},w.onerror=function(e){i(h);var n=w.status;U(r+24,0),U(r+32,w.response?w.response.byteLength:0),x[r+40>>1]=w.readyState,x[r+42>>1]=n,o&&o(r,w,e)},w.ontimeout=function(e){o&&o(r,w,e)},w.onprogress=function(e){var n=h&&v&&w.response?w.response.byteLength:0,t=0;h&&v&&(t=j(n),R.set(new Uint8Array(w.response),t)),T[r+12>>2]=t,U(r+16,n),U(r+24,e.loaded-n),U(r+32,e.total),x[r+40>>1]=w.readyState,3<=w.readyState&&0===w.status&&0>1]=w.status,w.statusText&&O(w.statusText,R,r+44,64),a&&a(r,w,e),t&&Ue(t)},w.onreadystatechange=function(e){x[r+40>>1]=w.readyState,2<=w.readyState&&(x[r+42>>1]=w.status),n&&n(r,w,e)};try{w.send(d)}catch(e){o&&o(r,w,e)}}else o(r,0,"no url specified!")}function P(e,n){if(!m)if(n)e();else try{e()}catch(e){if(!(e instanceof He)&&"unwind"!==e)throw e&&"object"==typeof e&&e.stack&&d("exception thrown: "+[e,e.stack]),e}}function me(n,e,t,r){var o=L;if(o){var a=C(T[n+112+64>>2]||T[n+8>>2]);try{var i=o.transaction(["FILES"],"readwrite").objectStore("FILES").put(e,a);i.onsuccess=function(){x[n+40>>1]=4,x[n+42>>1]=200,O("OK",R,n+44,64),t(n,0,a)},i.onerror=function(e){x[n+40>>1]=4,x[n+42>>1]=413,O("Payload Too Large",R,n+44,64),r(n,0,e)}}catch(e){r(n,0,e)}}else r(n,0,"IndexedDB not available!")}var ye,ge={};function he(){if(!ye){var e,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(e in ge)void 0===ge[e]?delete n[e]:n[e]=ge[e];var t=[];for(e in n)t.push(e+"="+n[e]);ye=t}return ye}function S(e){return 0==e%4&&(0!=e%100||0==e%400)}function ve(e,n){for(var t=0,r=0;r<=n;t+=e[r++]);return t}var E=[31,29,31,30,31,30,31,31,30,31,30,31],_e=[31,28,31,30,31,30,31,31,30,31,30,31];function we(e,n){for(e=new Date(e.getTime());0r-e.getDate())){e.setDate(e.getDate()+n);break}n-=r-e.getDate()+1,e.setDate(1),t<11?e.setMonth(t+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function be(e,n,t,r){function o(e,n,t){for(e="number"==typeof e?e.toString():e||"";e.length>2];for(c in r={X:g[r>>2],W:g[r+4>>2],O:g[r+8>>2],N:g[r+12>>2],M:g[r+16>>2],F:g[r+20>>2],P:g[r+24>>2],R:g[r+28>>2],ea:g[r+32>>2],V:g[r+36>>2],Y:f?C(f):""},t=C(t),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})t=t.replace(new RegExp(c,"g"),f[c]);var l,p,d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),m="January February March April May June July August September October November December".split(" ");for(c in f={"%a":function(e){return d[e.P].substring(0,3)},"%A":function(e){return d[e.P]},"%b":function(e){return m[e.M].substring(0,3)},"%B":function(e){return m[e.M]},"%C":function(e){return a((e.F+1900)/100|0,2)},"%d":function(e){return a(e.N,2)},"%e":function(e){return o(e.N,2," ")},"%g":function(e){return s(e).toString().substring(2)},"%G":s,"%H":function(e){return a(e.O,2)},"%I":function(e){return 0==(e=e.O)?e=12:12n?0:(y.set(c,e),c.length-1)}function Se(e){try{e()}catch(e){w(e)}}var M=0,F=null,Ee=0,Me=[],Fe={},De={},Ie=0,Ae=null,Ce=[],Oe=[];function Re(t){var e,r={};for(e in t)!function(e){var n=t[e];r[e]="function"==typeof n?function(){Me.push(e);try{return n.apply(null,arguments)}catch(e){if(-1===e.message.indexOf("unreachable"))throw e}finally{m||(Me.pop()!==e&&w("Assertion failed: undefined"),F&&1===M&&0===Me.length&&(M=0,Se(i._asyncify_stop_unwind),"undefined"!=typeof Fibers&&Fibers.fa(),Ae)&&(Ae(),Ae=null))}}:n}(e);return r}function xe(e){var t,r,n,o;if(!m)return 0===M?(r=t=!1,e(function(e){var n;!m&&(Ee=e||0,t=!0,r)&&(M=2,Se(function(){i._asyncify_start_rewind(F)}),"undefined"!=typeof Browser&&Browser.T.U&&Browser.T.resume(),n=(0,i.asm[De[g[F+8>>2]]])(),F||(e=Ce,Ce=[],e.forEach(function(e){e(n)})))}),r=!0,t||(M=1,e=j(4108),n=e+12,g[e>>2]=n,g[e+4>>2]=n+4096,n=Me[0],void 0===(o=Fe[n])&&(o=Ie++,Fe[n]=o,De[o]=n),g[e+8>>2]=o,F=e,Se(function(){i._asyncify_start_unwind(F)}),"undefined"!=typeof Browser&&Browser.T.U&&Browser.T.pause())):2===M?(M=0,Se(i._asyncify_stop_rewind),Ue(F),F=null,Oe.forEach(function(e){P(e)})):w("invalid state: "+M),Ee}!function(n){try{var e=indexedDB.open("emscripten_filesystem",1)}catch(e){return n()}e.onupgradeneeded=function(e){(e=e.target.result).objectStoreNames.contains("FILES")&&e.deleteObjectStore("FILES"),e.createObjectStore("FILES")},e.onsuccess=function(e){e=e.target.result,L=e,ie()},e.onerror=function(e){n()}}(function(){L=!1,ie()}),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER||ae();var Te,Le={f:function(){return 0},p:function(){return 0},q:function(){},i:function(e){delete pe[e-1]},a:function(){w()},h:function(e,n){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return g[Pe()>>2]=28,-1;e=le()}return g[n>>2]=e/1e3|0,g[n+4>>2]=e%1e3*1e6|0,0},k:function(){return!l},o:function(e,n,t){R.copyWithin(e,n,n+t)},d:function(){w("OOM")},b:function(t){xe(function(e){var n;n=e,setTimeout(function(){P(n)},t)})},j:function(e,t,n,r,o){function a(e,n){me(e,n.response,function(e){P(function(){p?k.apply(null,[p,e]):t&&t(e)},w)},function(e){P(function(){p?k.apply(null,[p,e]):t&&t(e)},w)})}function i(e){P(function(){y?k.apply(null,[y,e]):o&&o(e)},w)}function u(e){P(function(){d?k.apply(null,[d,e]):n&&n(e)},w)}function s(e){P(function(){m?k.apply(null,[m,e]):r&&r(e)},w)}function c(e){P(function(){p?k.apply(null,[p,e]):t&&t(e)},w)}var f=e+112,l=C(f),p=T[f+36>>2],d=T[f+40>>2],m=T[f+44>>2],y=T[f+48>>2],g=T[f+52>>2],h=!!(4&g),v=!!(32&g),_=!!(16&g),w=!!(64&g);if("EM_IDB_STORE"===l)l=T[f+84>>2],me(e,R.slice(l,l+T[f+88>>2]),c,u);else if("EM_IDB_DELETE"===l){var b=e;var S=c;var E=u;g=L;if(g){f=T[b+112+64>>2];f=C(f=f||T[b+8>>2]);try{var M=g.transaction(["FILES"],"readwrite").objectStore("FILES").delete(f);M.onsuccess=function(e){e=e.target.result,T[b+12>>2]=0,U(b+16,0),U(b+24,0),U(b+32,0),x[b+40>>1]=4,x[b+42>>1]=200,O("OK",R,b+44,64),S(b,0,e)},M.onerror=function(e){x[b+40>>1]=4,x[b+42>>1]=404,O("Not Found",R,b+44,64),E(b,0,e)}}catch(e){E(b,0,e)}}else E(b,0,"IndexedDB not available!")}else if(_){if(v)return 0;de(e,h?a:c,u,s,i)}else{var F=e;var D=c;var I=v?u:h?function(e){de(e,a,u,s,i)}:function(e){de(e,c,u,s,i)};l=L;if(l){g=T[F+112+64>>2];g=C(g=g||T[F+8>>2]);try{var A=l.transaction(["FILES"],"readonly").objectStore("FILES").get(g);A.onsuccess=function(e){var n,t;e.target.result?(n=(e=e.target.result).byteLength||e.length,t=j(n),R.set(new Uint8Array(e),t),T[F+12>>2]=t,U(F+16,n),U(F+24,0),U(F+32,n),x[F+40>>1]=4,x[F+42>>1]=200,O("OK",R,F+44,64),D(F,0,e)):(x[F+40>>1]=4,x[F+42>>1]=404,O("Not Found",R,F+44,64),I(F,0,"no data"))},A.onerror=function(e){x[F+40>>1]=4,x[F+42>>1]=404,O("Not Found",R,F+44,64),I(F,0,e)}}catch(e){I(F,0,e)}}else I(F,0,"IndexedDB not available!")}return e},l:function(){return n=async()=>{var e=await i.queue.get(),n=J(e)+1,t=j(n);return O(e,R,t,n),t},xe(function(e){n().then(e)});var n},u:function(r,o){var a=0;return he().forEach(function(e,n){var t=o+a;for(n=g[r+4*n>>2]=t,t=0;t>0]=e.charCodeAt(t);y[n>>0]=0,a+=e.length+1}),0},v:function(e,n){var t=he(),r=(g[e>>2]=t.length,0);return t.forEach(function(e){r+=e.length+1}),g[n>>2]=r,0},c:function(e){Ye(e)},g:function(){return 0},s:function(e,n,t,r){return e=fe.aa(e),n=fe.$(e,n,t),g[r>>2]=n,0},n:function(){},r:function(e,n,t,r){for(var o=0,a=0;a>2],u=g[n+(8*a+4)>>2],s=0;s>2]=o,0},m:function(){i.pauseQueue()},t:be,e:function(){i.unpauseQueue()}},Ue=(!function(){function n(e){e=Re(e=e.exports),i.asm=e,e=i.asm.w.buffer,i.HEAP8=y=new Int8Array(e),i.HEAP16=new Int16Array(e),i.HEAP32=g=new Int32Array(e),i.HEAPU8=R=new Uint8Array(e),i.HEAPU16=x=new Uint16Array(e),i.HEAPU32=T=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e),ee.unshift(i.asm.x),ie()}function t(e){n(e.instance)}function r(e){return(f||!B&&!l||"function"!=typeof fetch?Promise.resolve().then(se):fetch(h,{credentials:"same-origin"}).then(function(e){if(e.ok)return e.arrayBuffer();throw"failed to load wasm binary file at '"+h+"'"}).catch(se)).then(function(e){return WebAssembly.instantiate(e,o)}).then(e,function(e){d("failed to asynchronously prepare wasm: "+e),w(e)})}var o={a:Le};if(ae(),i.instantiateWasm)try{var e=i.instantiateWasm(o,n);return Re(e)}catch(e){return d("Module.instantiateWasm callback failed with error: "+e)}(f||"function"!=typeof WebAssembly.instantiateStreaming||ue()||"function"!=typeof fetch?r(t):fetch(h,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,o).then(t,function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),r(t)})})).catch(I)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.x).apply(null,arguments)},i._main=function(){return(i._main=i.asm.y).apply(null,arguments)},i._free=function(){return(Ue=i._free=i.asm.z).apply(null,arguments)}),j=(i._stop=function(){return(i._stop=i.asm.A).apply(null,arguments)},i._ponderhit=function(){return(i._ponderhit=i.asm.B).apply(null,arguments)},i._malloc=function(){return(j=i._malloc=i.asm.C).apply(null,arguments)}),Pe=i.___errno_location=function(){return(Pe=i.___errno_location=i.asm.D).apply(null,arguments)},je=i.stackAlloc=function(){return(je=i.stackAlloc=i.asm.E).apply(null,arguments)},k=i.dynCall_vi=function(){return(k=i.dynCall_vi=i.asm.G).apply(null,arguments)},ke=i.dynCall_v=function(){return(ke=i.dynCall_v=i.asm.H).apply(null,arguments)};function He(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ne(a){function e(){if(!Te&&(Te=!0,i.calledRun=!0,!m)){if(b(ee),b(ne),D(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),qe){var n=a,e=i._main,t=(n=n||[]).length+1,r=je(4*(t+1));g[r>>2]=Q(u);for(var o=1;o>2)+o]=Q(n[o-1]);g[(r>>2)+t]=0;try{Ye(e(t,r))}catch(e){e instanceof He||"unwind"==e||((n=e)&&"object"==typeof e&&e.stack&&(n=[e,e.stack]),d("exception thrown: "+n),s(1,e))}}if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)n=i.postRun.shift(),te.unshift(n);b(te)}}if(a=a||N,!(0 + * Hiroshi Ogawa + * https://github.com/niklasf/stockfish.wasm + * https://github.com/hi-ogawa/Stockfish + * + * Based on Stockfish (c) T. Romstad, M. Costalba, J. Kiiski, G. Linscott and other contributors. + * https://github.com/official-stockfish/Stockfish + */!function(){var e,n,t,r,a;function i(){function e(e){var i,M,k,T,q;e=e||{},(i=i||(void 0!==e?e:{})).ready=new Promise(function(e,t){M=e,k=t}),"undefined"==typeof XMLHttpRequest&&(global.XMLHttpRequest=function(){var n,r={open:function(e,t){n=t},send:function(){require("fs").readFile(n,function(e,t){r.readyState=4,e?(console.error(e),r.status=404,r.onerror(e)):(r.status=200,r.response=t,r.onreadystatechange(),r.onload())})}};return r}),"undefined"!=typeof global&&"[object process]"===Object.prototype.toString.call(global.process)&&"undefined"!=typeof fetch&&(fetch=null),i.postCustomMessage=function(e){if(void 0!==g)for(var t of g.za)t.postMessage({cmd:"custom",userData:e})},i.queue=(q=[],{get:async function(){return 0>10,56320|1023&i)))):r+=String.fromCharCode(i)}return r}function O(e){return e?se(I,e,void 0):""}function F(e,t,n,r){if(0>6}else{if(o<=65535){if(r<=n+2)break;t[n++]=224|o>>12}else{if(r<=n+3)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63}t[n++]=128|o>>6&63}t[n++]=128|63&o}}t[n]=0}}function ue(e){for(var t=0,n=0;nh.length||1&e||t<0)return-28;if(0==t)return 0;2147483647<=t&&(t=1/0);var n=Atomics.load(_,x>>2),r=0;if(n==e&&Atomics.compareExchange(_,x>>2,n,0)==n&&(r=1,--t<=0))return 1;if(0<=(e=Atomics.notify(_,e>>2,t)))return e+r;throw"Atomics.notify returned an unexpected value "+e}function Se(e){if(l)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!e)throw"Internal Error! Null pthread_ptr in cleanupThread!";var t=g.xa[e];t&&(_[e+12>>2]=0,g.La(t.worker))}i._emscripten_futex_wake=xe;var g={Aa:[],za:[],Ua:[],Eb:function(){},hb:function(){for(var e=P(228),t=0;t<57;++t)C[e/4+t]=0;_[e+12>>2]=e,_[(t=e+152)>>2]=t;for(var n=P(512),t=0;t<128;++t)C[n/4+t]=0;Atomics.store(C,e+100>>2,n),Atomics.store(C,e+40>>2,e),Rt(e,!o,1),Mt(e)},ib:function(){g.receiveObjectTransfer=g.lb,g.threadInit=g.qb,g.threadCancel=g.pb,g.threadExit=g.ab,g.setExitStatus=g.nb},xa:{},Ta:[],Za:function(){for(;0>2,1),Atomics.store(C,e+60>>2,0),g.Za(),Atomics.store(C,e+4>>2,t),Atomics.store(C,e+0>>2,1),xe(e+0,2147483647),Rt(0,0,0)},nb:function(e){ne=e},ab:function(e){var t=E();t&&(g.$a(t,e),l)&&postMessage({cmd:"exit"})},pb:function(){g.$a(E(),-1),postMessage({cmd:"cancelDone"})},Sa:function(){for(var e in g.xa){var t=g.xa[e];t&&t.worker&&g.La(t.worker)}for(g.xa={},e=0;e>2],_[e.ya+100>>2]=0,A(t),A(e.ya)),e.ya=0,e.Pa&&e.Ba&&A(e.Ba),e.Ba=0,e.worker)&&(e.worker.wa=null)},La:function(e){g.mb(function(){delete g.xa[e.wa.ya],g.Aa.push(e),g.za.splice(g.za.indexOf(e),1),g.Qa(e.wa),e.wa=void 0})},mb:function(e){_[Yt>>2]=0;try{e()}finally{_[Yt>>2]=1}},lb:function(){},qb:function(){for(var e in g.Ua)g.Ua[e]()},jb:function(a,o){a.onmessage=function(e){var t=e.data,n=t.cmd;if(a.wa&&(g.cb=a.wa.ya),t.targetThread&&t.targetThread!=E()){var r=g.xa[t.Jb];r?r.worker.postMessage(e.data,t.transferList):d('Internal error! Worker sent a message "'+n+'" to target pthread '+t.targetThread+", but that thread no longer exists!")}else if("processQueuedMainThreadWork"===n)It();else if("spawnThread"===n)Me(e.data);else if("cleanupThread"===n)Se(t.thread);else if("killThread"===n){if(e=t.thread,l)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!e)throw"Internal Error! Null pthread_ptr in killThread!";_[e+12>>2]=0,t=g.xa[e],delete g.xa[e],t.worker.terminate(),g.Qa(t),g.za.splice(g.za.indexOf(t.worker),1),t.worker.wa=void 0}else if("cancelThread"===n){if(e=t.thread,l)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!e)throw"Internal Error! Null pthread_ptr in cancelThread!";g.xa[e].worker.postMessage({cmd:"cancel"})}else if("loaded"===n)a.loaded=!0,o&&o(a),a.Fa&&(a.Fa(),delete a.Fa);else if("print"===n)$("Thread "+t.threadId+": "+t.text);else if("printErr"===n)d("Thread "+t.threadId+": "+t.text);else if("alert"===n)alert("Thread "+t.threadId+": "+t.text);else if("exit"===n)a.wa&&Atomics.load(C,a.wa.ya+64>>2)&&g.La(a);else if("exitProcess"===n)try{zt(t.returnCode)}catch(e){if(e instanceof S)return;throw e}else"cancelDone"===n?g.La(a):"objectTransfer"!==n&&("setimmediate"===e.data.target?a.postMessage(e.data):d("worker sent an unknown command "+n));g.cb=void 0},a.onerror=function(e){d("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)},s&&(a.on("message",function(e){a.onmessage({data:e})}),a.on("error",function(e){a.onerror(e)}),a.on("exit",function(){})),a.postMessage({cmd:"load",urlOrBlob:i.mainScriptUrlOrBlob||Kt,wasmMemory:u,wasmModule:te})},bb:function(){var e=Q("stockfish.worker.js");g.Aa.push(new Worker(e))},fb:function(){return 0==g.Aa.length&&(g.bb(),g.jb(g.Aa[0])),g.Aa.pop()},xb:function(e){for(e=performance.now()+e;performance.now()>2]=0;var a=e.Ba+e.Ca,o=(r=g.xa[e.Ka]={worker:t,Ba:e.Ba,Ca:e.Ca,Pa:e.Pa,ya:e.Ka}).ya>>2,i=(Atomics.store(C,16+o,e.detached),Atomics.store(C,25+o,n),Atomics.store(C,10+o,r.ya),Atomics.store(C,20+o,e.Ca),Atomics.store(C,19+o,a),Atomics.store(C,26+o,e.Ca),Atomics.store(C,28+o,a),Atomics.store(C,29+o,e.detached),n=jt()+40,Atomics.store(C,43+o,n),t.wa=r,{cmd:"run",start_routine:e.ob,arg:e.Ea,threadInfoStruct:e.Ka,stackBase:e.Ba,stackSize:e.Ca});return t.Fa=function(){i.time=performance.now(),t.postMessage(i,e.vb)},t.loaded&&(t.Fa(),delete t.Fa),0}function ke(e,t,n){if(e<=0||e>h.length||1&e)return-28;if(z){if(Atomics.load(_,e>>2)!=t)return-6;for(n=performance.now()+n,Atomics.exchange(_,x>>2,e);;){if(n>2,0),-73;if(0==Atomics.exchange(_,x>>2,0))break;if(It(),Atomics.load(_,e>>2)!=t)return-6;Atomics.exchange(_,x>>2,e)}return 0}if("timed-out"===(e=Atomics.wait(_,e>>2,t,n)))return-73;if("not-equal"===e)return-6;if("ok"===e)return 0;throw"Atomics.wait returned an unexpected value "+e}function Te(){s||o||(J=J||{})["Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"]||(J["Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"]=1,d("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"))}i.establishStackSpace=function(e,t){Wt(e,t),qt(e)},i.invokeEntryPoint=function(e,t){return Ht.apply(null,[e,t])};var Ie=s?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:l?function(){return performance.now()-i.__performance_now_clock_drift}:function(){return performance.now()},De=[null,[],[]],Ce={};function Oe(e,t,n){return l?w(2,1,e,t,n):0}function Fe(e,t,n){return l?w(3,1,e,t,n):0}function Re(e,t,n){if(l)return w(4,1,e,t,n)}function je(){if(l)return w(5,1);y()}var Le=[];function Pe(e){if(l)return w(6,1,e);ee=!1,R=0,zt(e)}function w(e,t){for(var n=arguments.length-2,r=Bt(),a=Ut(8*n),o=a>>3,i=0;i>2]=t,_[s.Ja+4>>2]=n),!s.Ya&&s.zb?s.Ja?(s=_[s.Ja+8>>2],e=e?O(e):"",r=Bt(),a=Ut(12),o=0,e&&(o=ue(e)+1,i=P(o),F(e,I,i,o),o=i),_[a>>2]=o,_[a+4>>2]=t,_[a+8>>2]=n,Ct(0,s,657457152,0,o,a),qt(r),1):-4:(e=!1,(s=s.Ya?s.Ya:s).Ia&&s.Ia.Ha&&(e=0===(e=s.Ia.Ha.getParameter(2978))[0]&&0===e[1]&&e[2]===s.width&&e[3]===s.height),s.width=t,s.height=n,e&&s.Ia.Ha.viewport(0,0,t,n),0)):-4}function Ne(e,t,n){return l?w(7,1,e,t,n):We(e,t,n)}function j(e,t){if(!c)if(t)e();else{try{e()}catch(e){if(e instanceof S)return;if("unwind"!==e)throw e&&"object"==typeof e&&e.stack&&d("exception thrown: "+[e,e.stack]),e}if(l&&!he())try{(l?Ft:zt)(ne)}catch(e){if(!(e instanceof S))throw e}}}var He,Ve=[];function L(e,t){C[e>>2]=t,C[e+4>>2]=t/4294967296|0}function Ye(r,n,a,o,t){function i(e){var t=0,n=0;e&&(n=v.response?v.response.byteLength:0,t=P(n),I.set(new Uint8Array(v.response),t)),C[r+12>>2]=t,L(r+16,n)}if(p=C[r+8>>2]){var e=O(p),s=(s=O(_=r+112))||"GET",u=C[_+52>>2],c=C[_+56>>2],f=!!C[_+60>>2],l=C[_+68>>2],d=C[_+72>>2],p=C[_+76>>2],m=C[_+80>>2],h=C[_+84>>2],_=C[_+88>>2],y=!!(1&u),g=!!(2&u),u=!!(64&u),l=l?O(l):void 0,d=d?O(d):void 0,w=m?O(m):void 0,v=new XMLHttpRequest;if(v.withCredentials=f,v.open(s,e,!u,l,d),u||(v.timeout=c),v.wb=e,v.responseType="arraybuffer",m&&v.overrideMimeType(w),p)for(;(s=C[p>>2])&&(e=C[p+4>>2]);)p+=8,s=O(s),e=O(e),v.setRequestHeader(s,e);Ve.push(v),C[r+0>>2]=Ve.length,p=h&&_?I.slice(h,h+_):null,v.onload=function(e){i(y&&!g);var t=v.response?v.response.byteLength:0;L(r+24,0),t&&L(r+32,t),D[r+40>>1]=v.readyState,D[r+42>>1]=v.status,v.statusText&&F(v.statusText,I,r+44,64),200<=v.status&&v.status<300?n&&n(r,v,e):a&&a(r,v,e)},v.onerror=function(e){i(y);var t=v.status;L(r+24,0),L(r+32,v.response?v.response.byteLength:0),D[r+40>>1]=v.readyState,D[r+42>>1]=t,a&&a(r,v,e)},v.ontimeout=function(e){a&&a(r,v,e)},v.onprogress=function(e){var t=y&&g&&v.response?v.response.byteLength:0,n=0;y&&g&&(n=P(t),I.set(new Uint8Array(v.response),n)),C[r+12>>2]=n,L(r+16,t),L(r+24,e.loaded-t),L(r+32,e.total),D[r+40>>1]=v.readyState,3<=v.readyState&&0===v.status&&0>1]=v.status,v.statusText&&F(v.statusText,I,r+44,64),o&&o(r,v,e),n&&A(n)},v.onreadystatechange=function(e){D[r+40>>1]=v.readyState,2<=v.readyState&&(D[r+42>>1]=v.status),t&&t(r,v,e)};try{v.send(p)}catch(e){a&&a(r,v,e)}}else a(r,0,"no url specified!")}function Ge(t,e,n,r){var a=He;if(a){var o=O(C[t+112+64>>2]||C[t+8>>2]);try{var i=a.transaction(["FILES"],"readwrite").objectStore("FILES").put(e,o);i.onsuccess=function(){D[t+40>>1]=4,D[t+42>>1]=200,F("OK",I,t+44,64),n(t,0,o)},i.onerror=function(e){D[t+40>>1]=4,D[t+42>>1]=413,F("Payload Too Large",I,t+44,64),r(t,0,e)}}catch(e){r(t,0,e)}}else r(t,0,"IndexedDB not available!")}function ze(n,e){n.Xa||(n.Xa=n.getContext,n.getContext=function(e,t){return"webgl"==e==(t=n.Xa(e,t))instanceof WebGLRenderingContext?t:null});var t,r,a,o=n.getContext("webgl",e);{if(o){if(o=o,e=e,r=P(8),_[r+4>>2]=E(),a={Db:r,attributes:e,version:e.kb,Ha:o},o.canvas&&(o.canvas.Ia=a),(void 0===e.Va||e.Va)&&!(o=(o=a)||Qe).gb){o.gb=!0;var i=t=o.Ha,s=i.getExtension("ANGLE_instanced_arrays"),u=(s&&(i.vertexAttribDivisor=function(e,t){s.vertexAttribDivisorANGLE(e,t)},i.drawArraysInstanced=function(e,t,n,r){s.drawArraysInstancedANGLE(e,t,n,r)},i.drawElementsInstanced=function(e,t,n,r,a){s.drawElementsInstancedANGLE(e,t,n,r,a)}),t),c=u.getExtension("OES_vertex_array_object"),f=(c&&(u.createVertexArray=function(){return c.createVertexArrayOES()},u.deleteVertexArray=function(e){c.deleteVertexArrayOES(e)},u.bindVertexArray=function(e){c.bindVertexArrayOES(e)},u.isVertexArray=function(e){return c.isVertexArrayOES(e)}),t),l=f.getExtension("WEBGL_draw_buffers");l&&(f.drawBuffers=function(e,t){l.drawBuffersWEBGL(e,t)}),t.Ab=t.getExtension("EXT_disjoint_timer_query"),t.Gb=t.getExtension("WEBGL_multi_draw"),(t.getSupportedExtensions()||[]).forEach(function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)})}return r}return 0}}var Qe,Ke,Xe=["default","low-power","high-performance"],Je={};function Ze(){if(!Ke){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:V||"./this.program"};for(e in Je)void 0===Je[e]?delete t[e]:t[e]=Je[e];var n=[];for(e in t)n.push(e+"="+t[e]);Ke=n}return Ke}function $e(r,a){var o;return l?w(8,1,r,a):(o=0,Ze().forEach(function(e,t){var n=a+o;for(t=_[r+4*t>>2]=n,n=0;n>0]=e.charCodeAt(n);h[t>>0]=0,o+=e.length+1}),0)}function et(e,t){var n,r;return l?w(9,1,e,t):(n=Ze(),_[e>>2]=n.length,r=0,n.forEach(function(e){r+=e.length+1}),_[t>>2]=r,0)}function tt(e){return l?w(10,1,e):0}function nt(e,t,n,r){return l?w(11,1,e,t,n,r):(e=Ce.Cb(e),t=Ce.Bb(e,t,n),_[r>>2]=t,0)}function rt(e,t,n,r,a){if(l)return w(12,1,e,t,n,r,a)}function at(e,t,n,r){if(l)return w(13,1,e,t,n,r);for(var a=0,o=0;o>2],s=_[t+(8*o+4)>>2],u=0;u>2]=a,0}function ot(e){return 0==e%4&&(0!=e%100||0==e%400)}function it(e,t){for(var n=0,r=0;r<=t;n+=e[r++]);return n}var st=[31,29,31,30,31,30,31,31,30,31,30,31],ut=[31,28,31,30,31,30,31,31,30,31,30,31];function ct(e,t){for(e=new Date(e.getTime());0r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),n<11?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function ft(e,t,n,r){function a(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length>2];for(c in r={tb:_[r>>2],sb:_[r+4>>2],Ma:_[r+8>>2],Ga:_[r+12>>2],Da:_[r+16>>2],V:_[r+20>>2],Na:_[r+24>>2],Oa:_[r+28>>2],Kb:_[r+32>>2],rb:_[r+36>>2],ub:f?O(f):""},n=O(n),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(c,"g"),f[c]);var l,d,p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),m="January February March April May June July August September October November December".split(" ");for(c in f={"%a":function(e){return p[e.Na].substring(0,3)},"%A":function(e){return p[e.Na]},"%b":function(e){return m[e.Da].substring(0,3)},"%B":function(e){return m[e.Da]},"%C":function(e){return o((e.V+1900)/100|0,2)},"%d":function(e){return o(e.Ga,2)},"%e":function(e){return a(e.Ga,2," ")},"%g":function(e){return u(e).toString().substring(2)},"%G":u,"%H":function(e){return o(e.Ma,2)},"%I":function(e){return 0==(e=e.Ma)?e=12:12t?0:(h.set(c,e),c.length-1)}function lt(e){try{e()}catch(e){y(e)}}var v=0,b=null,dt=0,pt=[],mt={},ht={},_t=0,yt=null,gt=[],wt=[];function vt(n){var e,r={};for(e in n)!function(e){var t=n[e];r[e]="function"==typeof t?function(){pt.push(e);try{return t.apply(null,arguments)}catch(e){if(-1===e.message.indexOf("unreachable"))throw e}finally{c||(re(pt.pop()===e),b&&1===v&&0===pt.length&&(R+=1,v=0,lt(i._asyncify_stop_unwind),"undefined"!=typeof Fibers&&Fibers.Lb(),yt)&&(yt(),yt=null))}}:t}(e);return r}function bt(e){var r,a,t,n;if(!c)return 0===v?(a=r=!1,e(function(e){var t,n;!c&&(dt=e||0,r=!0,a)&&(v=2,lt(function(){i._asyncify_start_rewind(b)}),"undefined"!=typeof Browser&&Browser.Ra.Wa&&Browser.Ra.resume(),n=i.asm[ht[_[b+8>>2]]],--R,t=n(),b||(e=gt,gt=[],e.forEach(function(e){e(t)})))}),a=!0,r||(v=1,e=P(4108),t=e+12,_[e>>2]=t,_[e+4>>2]=t+4096,t=pt[0],void 0===(n=mt[t])&&(n=_t++,mt[t]=n,ht[n]=t),_[e+8>>2]=n,b=e,lt(function(){i._asyncify_start_unwind(b)}),"undefined"!=typeof Browser&&Browser.Ra.Wa&&Browser.Ra.pause())):2===v?(v=0,lt(i._asyncify_stop_rewind),A(b),b=null,wt.forEach(function(e){j(e)})):y("invalid state: "+v),dt}l||(function(t,n){try{var e=indexedDB.open("emscripten_filesystem",1)}catch(e){return n(e)}e.onupgradeneeded=function(e){(e=e.target.result).objectStoreNames.contains("FILES")&&e.deleteObjectStore("FILES"),e.createObjectStore("FILES")},e.onsuccess=function(e){t(e.target.result)},e.onerror=function(e){n(e)}}(function(e){He=e,we()},function(){He=!1,we()}),"undefined"!=typeof ENVIRONMENT_IS_FETCH_WORKER&&ENVIRONMENT_IS_FETCH_WORKER)||ge();var At,Et=[null,function(e,t){if(l)return w(1,1,e,t)},Oe,Fe,Re,je,Pe,Ne,$e,et,tt,nt,rt,at],xt={c:function(e,t,n,r){y("Assertion failed: "+O(e)+", at: "+[t?O(t):"unknown filename",n,r?O(r):"unknown function"])},E:function(e,t){St(e,t)},n:function(e,t){g.Ta.push(function(){B.apply(null,[e,t])})},L:function(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return d("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;if(!e)return d("pthread_create called with a null thread pointer!"),28;var a=[];if(l&&0===a.length)return Tt(687865856,e,t,n,r);var o,i=0,s=0;t&&-1!=t?(o=_[t>>2],o+=81920,i=_[t+8>>2],s=0!==_[t+12>>2]):o=2097152,(t=0==i)?i=Nt(16,o):re(0<(i-=o));for(var u=P(228),c=0;c<57;++c)C[(u>>2)+c]=0;return _[e>>2]=u,_[u+12>>2]=u,_[(e=u+152)>>2]=e,n={Ba:i,Ca:o,Pa:t,detached:s,ob:n,Ka:u,Ea:r,vb:a},l?(n.yb="spawnThread",postMessage(n,a),0):Me(n)},J:function(e){throw l?g.ab(e):(g.Za(),zt(e)),"unwind"},K:function(e,t){var n=e,r=t;if(!n)return d("pthread_join attempted on a null thread pointer!"),71;if(l&&E()==n)return d("PThread "+n+" is attempting to join to itself!"),16;if(!l&&kt()==n)return d("Main thread "+n+" is attempting to join to itself!"),16;if(_[n+12>>2]!==n)return d("pthread_join attempted on thread "+n+", which does not point to a valid thread, or does not exist anymore!"),71;if(Atomics.load(C,n+64>>2))return d("Attempted to join thread "+n+", which was already detached!"),28;for(Te();;){var a=Atomics.load(C,n>>2);if(1==a)return a=Atomics.load(C,n+4>>2),r&&(_[r>>2]=a),Atomics.store(C,n+64>>2,1),l?postMessage({cmd:"cleanupThread",thread:n}):Se(n),0;Ot(),l||It(),ke(n,a,l?100:1)}},h:Oe,u:Fe,v:Re,P:function(e){delete Ve[e-1]},O:function(e,t){if(e==t)postMessage({cmd:"processQueuedMainThreadWork"});else if(l)postMessage({targetThread:e,cmd:"processThreadQueue"});else{if(!(e=(e=g.xa[e])&&e.worker))return;e.postMessage({cmd:"processThreadQueue"})}return 1},b:je,C:function(e,t){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return _[Lt()>>2]=28,-1;e=Ie()}return _[t>>2]=e/1e3|0,_[t+4>>2]=e%1e3*1e6|0,0},Q:function(e,t,n){var r;for(Le.length=0,n>>=2;r=I[t++];)(r=r<105)&&1&n&&n++,Le.push(r?oe[n++>>1]:_[n]),++n;return Ae[e].apply(null,Le)},D:Te,l:function(){},o:Pe,d:ke,e:xe,f:Ie,r:function(e,t,n){I.copyWithin(e,t,t+n)},G:function(e,t,n){Be.length=t,n>>=3;for(var r=0;r>2],p=C[f+40>>2],m=C[f+44>>2],h=C[f+48>>2],_=C[f+52>>2],y=!!(4&_),g=!!(32&_),w=!!(16&_),v=!!(64&_);if("EM_IDB_STORE"===l)l=C[f+84>>2],Ge(e,I.slice(l,l+C[f+88>>2]),c,s);else if("EM_IDB_DELETE"===l){var b=e;var A=c;var E=s;_=He;if(_){f=C[b+112+64>>2];f=O(f=f||C[b+8>>2]);try{var x=_.transaction(["FILES"],"readwrite").objectStore("FILES").delete(f);x.onsuccess=function(e){e=e.target.result,C[b+12>>2]=0,L(b+16,0),L(b+24,0),L(b+32,0),D[b+40>>1]=4,D[b+42>>1]=200,F("OK",I,b+44,64),A(b,0,e)},x.onerror=function(e){D[b+40>>1]=4,D[b+42>>1]=404,F("Not Found",I,b+44,64),E(b,0,e)}}catch(e){E(b,0,e)}}else E(b,0,"IndexedDB not available!")}else if(w){if(g)return 0;Ye(e,y?o:c,s,u,i)}else{var S=e;var M=c;var k=g?s:y?function(e){Ye(e,o,s,u,i)}:function(e){Ye(e,c,s,u,i)};l=He;if(l){_=C[S+112+64>>2];_=O(_=_||C[S+8>>2]);try{var T=l.transaction(["FILES"],"readonly").objectStore("FILES").get(_);T.onsuccess=function(e){var t,n;e.target.result?(t=(e=e.target.result).byteLength||e.length,n=P(t),I.set(new Uint8Array(e),n),C[S+12>>2]=n,L(S+16,t),L(S+24,0),L(S+32,t),D[S+40>>1]=4,D[S+42>>1]=200,F("OK",I,S+44,64),M(S,0,e)):(D[S+40>>1]=4,D[S+42>>1]=404,F("Not Found",I,S+44,64),k(S,0,"no data"))},T.onerror=function(e){D[S+40>>1]=4,D[S+42>>1]=404,F("Not Found",I,S+44,64),k(S,0,e)}}catch(e){k(S,0,e)}}else k(S,0,"IndexedDB not available!")}return e},s:function(){return t=async()=>{var e=await i.queue.get(),t=ue(e)+1,n=P(t);return F(e,I,n,t),n},bt(function(e){t().then(e)});var t},I:function(e,t){return t={alpha:!!_[t>>=2],depth:!!_[t+1],stencil:!!_[t+2],antialias:!!_[t+3],premultipliedAlpha:!!_[t+4],preserveDrawingBuffer:!!_[t+5],powerPreference:Xe[_[t+6]],failIfMajorPerformanceCaveat:!!_[t+7],kb:_[t+8],Fb:_[t+9],Va:_[t+10],eb:_[t+11],Hb:_[t+12],Ib:_[t+13]},!(e=Ue(e))||t.eb?0:ze(e,t)},z:$e,A:et,g:function(e){zt(e)},i:tt,x:nt,q:rt,w:at,M:function(){g.hb()},a:u||i.wasmMemory,B:function(){i.pauseQueue()},y:ft,j:function(){i.unpauseQueue()}},St=(!function(){function t(e,t){e=vt(e=e.exports),i.asm=e,de.unshift(i.asm.R),g.Ua.push(i.asm.U),te=t,l||we()}function n(e){t(e.instance,e.module)}function r(e){return(Z||!z&&!o||"function"!=typeof fetch?Promise.resolve().then(be):fetch(p,{credentials:"same-origin"}).then(function(e){if(e.ok)return e.arrayBuffer();throw"failed to load wasm binary file at '"+p+"'"}).catch(be)).then(function(e){return WebAssembly.instantiate(e,a)}).then(e,function(e){d("failed to asynchronously prepare wasm: "+e),y(e)})}var a={a:xt};if(l||ge(),i.instantiateWasm)try{var e=i.instantiateWasm(a,t);return vt(e)}catch(e){return d("Module.instantiateWasm callback failed with error: "+e)}(Z||"function"!=typeof WebAssembly.instantiateStreaming||ve()||"function"!=typeof fetch?r(n):fetch(p,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,a).then(n,function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),r(n)})})).catch(k)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.R).apply(null,arguments)},i._main=function(){return(St=i._main=i.asm.S).apply(null,arguments)}),A=i._free=function(){return(A=i._free=i.asm.T).apply(null,arguments)},P=(i._emscripten_tls_init=function(){return(i._emscripten_tls_init=i.asm.U).apply(null,arguments)},i._malloc=function(){return(P=i._malloc=i.asm.W).apply(null,arguments)}),Mt=(i._emscripten_current_thread_process_queued_calls=function(){return(i._emscripten_current_thread_process_queued_calls=i.asm.X).apply(null,arguments)},i._emscripten_register_main_browser_thread_id=function(){return(Mt=i._emscripten_register_main_browser_thread_id=i.asm.Y).apply(null,arguments)}),kt=i._emscripten_main_browser_thread_id=function(){return(kt=i._emscripten_main_browser_thread_id=i.asm.Z).apply(null,arguments)},Tt=i._emscripten_sync_run_in_main_thread_4=function(){return(Tt=i._emscripten_sync_run_in_main_thread_4=i.asm._).apply(null,arguments)},It=i._emscripten_main_thread_process_queued_calls=function(){return(It=i._emscripten_main_thread_process_queued_calls=i.asm.$).apply(null,arguments)},Dt=i._emscripten_run_in_main_runtime_thread_js=function(){return(Dt=i._emscripten_run_in_main_runtime_thread_js=i.asm.aa).apply(null,arguments)},Ct=i.__emscripten_call_on_thread=function(){return(Ct=i.__emscripten_call_on_thread=i.asm.ba).apply(null,arguments)},Ot=(i._emscripten_proxy_main=function(){return(i._emscripten_proxy_main=i.asm.ca).apply(null,arguments)},i._pthread_testcancel=function(){return(Ot=i._pthread_testcancel=i.asm.da).apply(null,arguments)}),E=i._pthread_self=function(){return(E=i._pthread_self=i.asm.ea).apply(null,arguments)},Ft=i._pthread_exit=function(){return(Ft=i._pthread_exit=i.asm.fa).apply(null,arguments)},Rt=i.__emscripten_thread_init=function(){return(Rt=i.__emscripten_thread_init=i.asm.ga).apply(null,arguments)},jt=i._emscripten_get_global_libc=function(){return(jt=i._emscripten_get_global_libc=i.asm.ha).apply(null,arguments)},Lt=i.___errno_location=function(){return(Lt=i.___errno_location=i.asm.ia).apply(null,arguments)},Pt=i.___pthread_tsd_run_dtors=function(){return(Pt=i.___pthread_tsd_run_dtors=i.asm.ja).apply(null,arguments)},Bt=i.stackSave=function(){return(Bt=i.stackSave=i.asm.ka).apply(null,arguments)},qt=i.stackRestore=function(){return(qt=i.stackRestore=i.asm.la).apply(null,arguments)},Ut=i.stackAlloc=function(){return(Ut=i.stackAlloc=i.asm.ma).apply(null,arguments)},Wt=i._emscripten_stack_set_limits=function(){return(Wt=i._emscripten_stack_set_limits=i.asm.na).apply(null,arguments)},Nt=i._memalign=function(){return(Nt=i._memalign=i.asm.oa).apply(null,arguments)},B=i.dynCall_vi=function(){return(B=i.dynCall_vi=i.asm.pa).apply(null,arguments)},Ht=i.dynCall_ii=function(){return(Ht=i.dynCall_ii=i.asm.qa).apply(null,arguments)},Vt=i.dynCall_v=function(){return(Vt=i.dynCall_v=i.asm.ra).apply(null,arguments)},Yt=(i._asyncify_start_unwind=function(){return(i._asyncify_start_unwind=i.asm.sa).apply(null,arguments)},i._asyncify_stop_unwind=function(){return(i._asyncify_stop_unwind=i.asm.ta).apply(null,arguments)},i._asyncify_start_rewind=function(){return(i._asyncify_start_rewind=i.asm.ua).apply(null,arguments)},i._asyncify_stop_rewind=function(){return(i._asyncify_stop_rewind=i.asm.va).apply(null,arguments)},i.__emscripten_allow_main_runtime_queued_calls=29752),x=i.__emscripten_main_thread_futex=1246696;function S(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Gt(o){function e(){if(!At&&(At=!0,i.calledRun=!0,!c)){if(l||Ee(de),l||Ee(pe),M(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Qt){var e=o,t=i._emscripten_proxy_main,n=(e=e||[]).length+1,r=Ut(4*(n+1));_[r>>2]=ce(V);for(var a=1;a>2)+a]=ce(e[a-1]);_[(r>>2)+n]=0,t(n,r)}if(!l){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),me.unshift(e);Ee(me)}}}if(o=o||H,!(0{"custom"===e.data.cmd?"function"==typeof a.onCustomMessage&&a.onCustomMessage(e.data.userData):r(e)}}():"undefined"!=typeof onmessage&&("undefined"==typeof window||void 0===window.document)||"undefined"!=typeof global&&"[object process]"===Object.prototype.toString.call(global.process)?(r="undefined"!=typeof global&&"[object process]"===Object.prototype.toString.call(global.process),a=[],r?require.main===module?(t=require("path").join(__dirname,"stockfish-nnue-16.wasm"),e={locateFile:function(e){return-1 {`${gameEval?.accuracy.white.toFixed(1)} %`} @@ -37,7 +37,7 @@ export default function Accuracies() { lineHeight={1} padding={1} fontWeight="bold" - border={`1px solid #424242`} + border="1px solid #424242" > {`${gameEval?.accuracy.black.toFixed(1)} %`}