(()=>{var a,w=new Array(128).fill(void 0);w.push(void 0,null,!0,!1);function c(n){return w[n]}var v=w.length;function R(n){n<132||(w[n]=v,v=n)}function T(n){let e=c(n);return R(n),e}function _(n){v===w.length&&w.push(w.length+1);let e=v;return v=w[e],w[e]=n,e}var S=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&S.decode();var k=null;function m(){return(k===null||k.byteLength===0)&&(k=new Uint8Array(a.memory.buffer)),k}function s(n,e){return n=n>>>0,S.decode(m().subarray(n,n+e))}function g(n){return n==null}var A=null;function U(){return(A===null||A.byteLength===0)&&(A=new Float64Array(a.memory.buffer)),A}var x=null;function l(){return(x===null||x.byteLength===0)&&(x=new Int32Array(a.memory.buffer)),x}function M(n){let e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){let o=n.description;return o==null?"Symbol":`Symbol(${o})`}if(e=="function"){let o=n.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(n)){let o=n.length,i="[";o>0&&(i+=M(n[0]));for(let u=1;u1)r=t[1];else return toString.call(n);if(r=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} ${n.stack}`:r}var d=0,W=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},C=typeof W.encodeInto=="function"?function(n,e){return W.encodeInto(n,e)}:function(n,e){let t=W.encode(n);return e.set(t),{read:n.length,written:t.length}};function p(n,e,t){if(t===void 0){let f=W.encode(n),h=e(f.length,1)>>>0;return m().subarray(h,h+f.length).set(f),d=f.length,h}let r=n.length,o=e(r,1)>>>0,i=m(),u=0;for(;u127)break;i[o+u]=f}if(u!==r){u!==0&&(n=n.slice(u)),o=t(o,r,r=u+n.length*3,1)>>>0;let f=m().subarray(o+u,o+r),h=C(n,f);u+=h.written}return d=u,o}function F(n,e,t,r){let o={a:n,b:e,cnt:1,dtor:t},i=(...u)=>{o.cnt++;let f=o.a;o.a=0;try{return r(f,o.b,...u)}finally{--o.cnt===0?a.__wbindgen_export_2.get(o.dtor)(f,o.b):o.a=f}};return i.original=o,i}function B(n,e){let t=e(n.length*1,1)>>>0;return m().set(n,t/1),d=n.length,t}function D(n,e,t){let r=B(t,a.__wbindgen_malloc),o=d;a.wasm_bindgen__convert__closures__invoke1_mut__h5860e381bcb9706c(n,e,r,o)}function N(n,e,t,r){let o={a:n,b:e,cnt:1,dtor:t},i=(...u)=>{o.cnt++;try{return r(o.a,o.b,...u)}finally{--o.cnt===0&&(a.__wbindgen_export_2.get(o.dtor)(o.a,o.b),o.a=0)}};return i.original=o,i}function $(n,e,t){a.wasm_bindgen__convert__closures__invoke1__h5a4fa13f3ec138ca(n,e,_(t))}function V(n,e){return n=n>>>0,m().subarray(n/1,n/1+e)}function z(n){return()=>{throw new Error(`${n} is not defined`)}}function O(){let n=a.main();return T(n)}var E=null;function q(){return(E===null||E.byteLength===0)&&(E=new Uint32Array(a.memory.buffer)),E}function J(n,e){n=n>>>0;let r=q().subarray(n/4,n/4+e),o=[];for(let i=0;i"u"&&(n=new URL("tic_tac_toe_4d_bg.wasm",location));let e=G();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));let{instance:t,module:r}=await H(await n,e);return K(t,r)}var I=j;var L=new Worker("webworker_glue.js"),y;win_callback=n=>{console.log(n),y&&(n===1?(y.unlockAchievement("ttt4Win"),y.updateMetric("ttt4Wins",e=>e+1,0)):n===2?y.updateMetric("ttt4Losses",e=>e+1,0):isDraw&&y.updateMetric("ttt4Draws",e=>e+1,0))};"points"in window&&window.points.then(n=>{y=n});I().then(n=>{let e=O();console.log("rust initiated",e),run_ai_background=t=>{L.postMessage(t),console.log("dispatching")},L.onmessage=t=>{e(t.data)}});})(); //# sourceMappingURL=app.js.map