-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkc854-ui.js
83 lines (83 loc) · 39.8 KB
/
kc854-ui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
var f;f||=typeof Module != 'undefined' ? Module : {};var aa="object"==typeof window,ba="undefined"!=typeof WorkerGlobalScope,ca="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&"renderer"!=process.type,da=Object.assign({},f),ea=[],fa="./this.program",ha=(a,b)=>{throw b;},k="",ia,ja;
if(ca){var fs=require("fs"),ka=require("path");k=__dirname+"/";ja=a=>{a=la(a)?new URL(a):ka.normalize(a);return fs.readFileSync(a)};ia=a=>{a=la(a)?new URL(a):ka.normalize(a);return new Promise((b,c)=>{fs.readFile(a,void 0,(d,e)=>{d?c(d):b(e.buffer)})})};!f.thisProgram&&1<process.argv.length&&(fa=process.argv[1].replace(/\\/g,"/"));ea=process.argv.slice(2);"undefined"!=typeof module&&(module.exports=f);ha=(a,b)=>{process.exitCode=a;throw b;}}else if(aa||ba)ba?k=self.location.href:"undefined"!=typeof document&&
document.currentScript&&(k=document.currentScript.src),k=k.startsWith("blob:")?"":k.substr(0,k.replace(/[?#].*/,"").lastIndexOf("/")+1),ba&&(ja=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),ia=a=>la(a)?new Promise((b,c)=>{var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=()=>{200==d.status||0==d.status&&d.response?b(d.response):c(d.status)};d.onerror=c;d.send(null)}):fetch(a,{credentials:"same-origin"}).then(b=>
b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url)));var ma=f.print||console.log.bind(console),n=f.printErr||console.error.bind(console);Object.assign(f,da);da=null;f.arguments&&(ea=f.arguments);f.thisProgram&&(fa=f.thisProgram);var na=f.wasmBinary,oa,q=!1,pa,r,t,qa,ra,u,w,x,y;
function sa(){var a=oa.buffer;f.HEAP8=r=new Int8Array(a);f.HEAP16=qa=new Int16Array(a);f.HEAPU8=t=new Uint8Array(a);f.HEAPU16=ra=new Uint16Array(a);f.HEAP32=u=new Int32Array(a);f.HEAPU32=w=new Uint32Array(a);f.HEAPF32=x=new Float32Array(a);f.HEAPF64=y=new Float64Array(a)}var ta=[],ua=[],va=[],wa=[];function xa(){var a=f.preRun.shift();ta.unshift(a)}var z=0,ya=null,A=null;
function za(a){f.onAbort?.(a);a="Aborted("+a+")";n(a);q=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}var Aa=a=>a.startsWith("data:application/octet-stream;base64,"),la=a=>a.startsWith("file://"),Ba;function Ca(a){if(a==Ba&&na)return new Uint8Array(na);if(ja)return ja(a);throw"both async and sync fetching of the wasm failed";}function Da(a){return na?Promise.resolve().then(()=>Ca(a)):ia(a).then(b=>new Uint8Array(b),()=>Ca(a))}
function Ea(a,b,c){return Da(a).then(d=>WebAssembly.instantiate(d,b)).then(c,d=>{n(`failed to asynchronously prepare wasm: ${d}`);za(d)})}function Fa(a,b){var c=Ba;na||"function"!=typeof WebAssembly.instantiateStreaming||Aa(c)||la(c)||ca||"function"!=typeof fetch?Ea(c,a,b):fetch(c,{credentials:"same-origin"}).then(d=>WebAssembly.instantiateStreaming(d,a).then(b,function(e){n(`wasm streaming compile failed: ${e}`);n("falling back to ArrayBuffer instantiation");return Ea(c,a,b)}))}
var Ha={85848:()=>{const a=f._webapi_input;f._webapi_input=b=>{Ga(()=>a(B(b)))}}};class Ia{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}
var Ja=a=>{for(;0<a.length;)a.shift()(f)},Ka=f.noExitRuntime||!0,La="undefined"!=typeof TextDecoder?new TextDecoder:void 0,C=(a,b=0,c=NaN)=>{var d=b+c;for(c=b;a[c]&&!(c>=d);)++c;if(16<c-b&&a.buffer&&La)return La.decode(a.subarray(b,c));for(d="";b<c;){var e=a[b++];if(e&128){var h=a[b++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|h);else{var g=a[b++]&63;e=224==(e&240)?(e&15)<<12|h<<6|g:(e&7)<<18|h<<12|g<<6|a[b++]&63;65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>
10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},Ma=0,D={},Na=a=>{a instanceof Ia||"unwind"==a||ha(1,a)},Oa=a=>{pa=a;Ka||0<Ma||(f.onExit?.(a),q=!0);ha(a,new Ia(a))},Pa=a=>{pa=a;Oa(a)},Qa=()=>{if(!(Ka||0<Ma))try{var a=pa;pa=a;Oa(a)}catch(b){Na(b)}},Ra=a=>{if(!q)try{a(),Qa()}catch(b){Na(b)}},Sa=[],$a=(a,b)=>{Ta=a;Ua=b;if(E)if(Va||=!0,0==a)F=function(){setTimeout(Wa,Math.max(0,Xa+b-performance.now())|0)};else if(1==a)F=function(){Ya(Wa)};else if(2==a){if("undefined"==typeof Za)if("undefined"==
typeof setImmediate){var c=[];addEventListener("message",d=>{if("setimmediate"===d.data||"setimmediate"===d.data.target)d.stopPropagation(),c.shift()()},!0);Za=d=>{c.push(d);if(ba){let e;(e=f).setImmediates??(e.setImmediates=[]);f.setImmediates.push(d);postMessage({target:"setimmediate"})}else postMessage("setimmediate","*")}}else Za=setImmediate;F=function(){Za(Wa)}}},ib=(a,b,c,d,e)=>{function h(){return g<ab?(Qa(),!1):!0}E=a;bb=d;var g=ab;Va=!1;Wa=function(){if(!q)if(0<cb.length){var l=cb.shift();
l.te(l.ke);if(db){var m=db,p=0==m%1?m-1:Math.floor(m);db=l.me?p:(8*m+(p+.5))/9}f.setStatus&&(l=f.statusMessage||"Please wait...",m=db??0,p=eb.re??0,m?m<p?f.setStatus("{message} ({expected - remaining}/{expected})"):f.setStatus(l):f.setStatus(""));h()&&setTimeout(Wa,0)}else if(h())if(fb=fb+1|0,1==Ta&&1<Ua&&0!=fb%Ua)F();else{0==Ta&&(Xa=performance.now());a:if(!q){for(l of gb)if(!1===l())break a;Ra(a);for(m of hb)m()}h()&&F()}};e||(b&&0<b?$a(0,1E3/b):$a(1,1),F());if(c)throw"unwind";},Va=!1,F=null,ab=
0,E=null,bb=0,Ta=0,Ua=0,fb=0,cb=[],gb=[],hb=[];function jb(){F=null;ab++}var kb=0;function Ya(a){if("function"==typeof requestAnimationFrame)requestAnimationFrame(a);else{var b=Date.now();if(0===kb)kb=b+1E3/60;else for(;b+2>=kb;)kb+=1E3/60;setTimeout(a,Math.max(kb-b,0))}}var eb={},Xa,Wa,Za,db;function lb(a){var b=H.jd[a];b.target.removeEventListener(b.hd,b.Md,b.kd);H.jd.splice(a,1)}
function mb(){if(navigator.userActivation?navigator.userActivation.isActive:H.Ad&&H.be.yd){var a=H.qd;H.qd=[];for(var b of a)b.Dd(...b.Id)}}function I(a){if(!a.target)return-4;if(a.ld)a.Md=function(c){++H.Ad;H.be=a;mb();a.md(c);mb();--H.Ad},a.target.addEventListener(a.hd,a.Md,a.kd),H.jd.push(a);else for(var b=0;b<H.jd.length;++b)H.jd[b].target==a.target&&H.jd[b].hd==a.hd&&lb(b--);return 0}function nb(a){return a?a==window?"#window":a==screen?"#screen":a?.nodeName||"":""}
var H={le:0,ue:0,Bd:0,wd:0,Hd:0,Fd:0,zd:0,pe:0,ye:0,oe:0,se:0,Cd:0,Ge:0,Ed:0,we(a,b,c){r.set(r.subarray(b,b+c),a)},Ae(){for(;H.jd.length;)lb(H.jd.length-1);H.qd=[]},Ad:0,qd:[],ne(a,b,c){function d(h,g){if(h.length!=g.length)return!1;for(var l in h)if(h[l]!=g[l])return!1;return!0}for(var e of H.qd)if(e.Dd==a&&d(e.Id,c))return;H.qd.push({Dd:a,Sd:b,Id:c});H.qd.sort((h,g)=>h.Sd<g.Sd)},Ce(a){H.qd=H.qd.filter(b=>b.Dd!=a)},jd:[],Be:(a,b)=>{for(var c=0;c<H.jd.length;++c)H.jd[c].target!=a||b&&b!=H.jd[c].hd||
lb(c--)},fullscreenEnabled(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},ob=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],J=a=>{a=2<a?a?C(t,a):"":a;return ob[a]||("undefined"!=typeof document?document.querySelector(a):null)},pb=a=>0>ob.indexOf(a)?a.getBoundingClientRect():{left:0,top:0},qb=[],rb,K=a=>{var b=qb[a];b||(a>=qb.length&&(qb.length=a+1),qb[a]=b=rb.get(a));return b},L=(a,b,c)=>{var d=t;if(!(0<c))return 0;var e=b;c=b+c-1;for(var h=
0;h<a.length;++h){var g=a.charCodeAt(h);if(55296<=g&&57343>=g){var l=a.charCodeAt(++h);g=65536+((g&1023)<<10)|l&1023}if(127>=g){if(b>=c)break;d[b++]=g}else{if(2047>=g){if(b+1>=c)break;d[b++]=192|g>>6}else{if(65535>=g){if(b+2>=c)break;d[b++]=224|g>>12}else{if(b+3>=c)break;d[b++]=240|g>>18;d[b++]=128|g>>12&63}d[b++]=128|g>>6&63}d[b++]=128|g&63}}d[b]=0;return b-e},sb=(a,b,c,d,e,h)=>{H.zd||(H.zd=M(256));a={target:J(a),hd:h,ld:d,md:(g=event)=>{var l=g.target.id?g.target.id:"",m=H.zd;L(nb(g.target),m+0,
128);L(l,m+128,128);K(d)(e,m,b)&&g.preventDefault()},kd:c};return I(a)},tb=(a,b,c,d,e,h)=>{H.Bd||(H.Bd=M(160));a={target:J(a),hd:h,ld:d,md:g=>{var l=H.Bd;y[l>>3]=g.timeStamp;var m=l>>2;u[m+2]=g.location;r[l+12]=g.ctrlKey;r[l+13]=g.shiftKey;r[l+14]=g.altKey;r[l+15]=g.metaKey;r[l+16]=g.repeat;u[m+5]=g.charCode;u[m+6]=g.keyCode;u[m+7]=g.which;L(g.key||"",l+32,32);L(g.code||"",l+64,32);L(g.char||"",l+96,32);L(g.locale||"",l+128,32);K(d)(e,l,b)&&g.preventDefault()},kd:c};return I(a)},ub=(a,b,c)=>{y[a>>
3]=b.timeStamp;var d=a>>2;u[d+2]=b.screenX;u[d+3]=b.screenY;u[d+4]=b.clientX;u[d+5]=b.clientY;r[a+24]=b.ctrlKey;r[a+25]=b.shiftKey;r[a+26]=b.altKey;r[a+27]=b.metaKey;qa[2*d+14]=b.button;qa[2*d+15]=b.buttons;u[d+8]=b.movementX;u[d+9]=b.movementY;a=pb(c);u[d+10]=b.clientX-(a.left|0);u[d+11]=b.clientY-(a.top|0)},vb=(a,b,c,d,e,h)=>{H.wd||(H.wd=M(64));a=J(a);return I({target:a,yd:"mousemove"!=h&&"mouseenter"!=h&&"mouseleave"!=h,hd:h,ld:d,md:(g=event)=>{ub(H.wd,g,a);K(d)(e,H.wd,b)&&g.preventDefault()},
kd:c})},wb=(a,b,c,d,e)=>{H.Cd||(H.Cd=M(257));return I({target:a,hd:e,ld:d,md:(h=event)=>{var g=H.Cd,l=document.pointerLockElement||document.rd||document.Pd||document.Nd;r[g]=!!l;var m=l?.id||"";L(nb(l),g+1,128);L(m,g+129,128);K(d)(20,g,b)&&h.preventDefault()},kd:c})},xb=(a,b,c,d,e)=>I({target:a,hd:e,ld:d,md:(h=event)=>{K(d)(38,0,b)&&h.preventDefault()},kd:c}),yb=(a,b,c,d)=>{H.Fd||(H.Fd=M(36));a=J(a);return I({target:a,hd:"resize",ld:d,md:(e=event)=>{if(e.target==a){var h=document.body;if(h){var g=
H.Fd;u[g>>2]=0;u[g+4>>2]=h.clientWidth;u[g+8>>2]=h.clientHeight;u[g+12>>2]=innerWidth;u[g+16>>2]=innerHeight;u[g+20>>2]=outerWidth;u[g+24>>2]=outerHeight;u[g+28>>2]=pageXOffset|0;u[g+32>>2]=pageYOffset|0;K(d)(10,g,b)&&e.preventDefault()}}},kd:c})},zb=(a,b,c,d,e,h)=>{H.Ed||(H.Ed=M(1552));a=J(a);return I({target:a,yd:"touchstart"==h||"touchend"==h,hd:h,ld:d,md:g=>{var l={},m=g.touches;for(var p of m)p.Od=p.Rd=0,l[p.identifier]=p;for(var v of g.changedTouches)v.Od=1,l[v.identifier]=v;for(var Q of g.targetTouches)l[Q.identifier].Rd=
1;m=H.Ed;y[m>>3]=g.timeStamp;r[m+12]=g.ctrlKey;r[m+13]=g.shiftKey;r[m+14]=g.altKey;r[m+15]=g.metaKey;p=m+16;v=pb(a);Q=0;for(let G of Object.values(l))if(l=p>>2,u[l]=G.identifier,u[l+1]=G.screenX,u[l+2]=G.screenY,u[l+3]=G.clientX,u[l+4]=G.clientY,u[l+5]=G.pageX,u[l+6]=G.pageY,r[p+28]=G.Od,r[p+29]=G.Rd,u[l+8]=G.clientX-(v.left|0),u[l+9]=G.clientY-(v.top|0),p+=48,31<++Q)break;u[m+8>>2]=Q;K(d)(e,m,b)&&g.preventDefault()},kd:c})},N,Ab=a=>{var b=a.getExtension("ANGLE_instanced_arrays");b&&(a.vertexAttribDivisor=
(c,d)=>b.vertexAttribDivisorANGLE(c,d),a.drawArraysInstanced=(c,d,e,h)=>b.drawArraysInstancedANGLE(c,d,e,h),a.drawElementsInstanced=(c,d,e,h,g)=>b.drawElementsInstancedANGLE(c,d,e,h,g))},Bb=a=>{var b=a.getExtension("OES_vertex_array_object");b&&(a.createVertexArray=()=>b.createVertexArrayOES(),a.deleteVertexArray=c=>b.deleteVertexArrayOES(c),a.bindVertexArray=c=>b.bindVertexArrayOES(c),a.isVertexArray=c=>b.isVertexArrayOES(c))},Cb=a=>{var b=a.getExtension("WEBGL_draw_buffers");b&&(a.drawBuffers=(c,
d)=>b.drawBuffersWEBGL(c,d))},Db=a=>{a.qe=a.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")},Eb=a=>{a.ve=a.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")},Fb=a=>{var b="ANGLE_instanced_arrays EXT_blend_minmax EXT_disjoint_timer_query EXT_frag_depth EXT_shader_texture_lod EXT_sRGB OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_depth_texture WEBGL_draw_buffers EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_clip_control EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_polygon_offset_clamp EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw WEBGL_polygon_mode".split(" ");
return(a.getSupportedExtensions()||[]).filter(c=>b.includes(c))},Gb=1,Hb=[],O=[],Ib=[],Jb=[],P=[],R=[],Kb=[],Lb=[],S=[],Mb={},Nb=4,Ob=0,Pb=a=>{for(var b=Gb++,c=a.length;c<b;c++)a[c]=null;return b},U=(a,b,c,d)=>{for(var e=0;e<a;e++){var h=N[c](),g=h&&Pb(d);h?(h.name=g,d[g]=h):T||=1282;u[b+4*e>>2]=g}},Rb=(a,b)=>{a.rd||(a.rd=a.getContext,a.getContext=function(d,e){e=a.rd(d,e);return"webgl"==d==e instanceof WebGLRenderingContext?e:null});var c=1<b.Qd?a.getContext("webgl2",b):a.getContext("webgl",b);return c?
Qb(c,b):0},Qb=(a,b)=>{var c=Pb(Lb),d={handle:c,attributes:b,version:b.Qd,xd:a};a.canvas&&(a.canvas.je=d);Lb[c]=d;("undefined"==typeof b.Ld||b.Ld)&&Sb(d);return c},Sb=a=>{a||=V;if(!a.ge){a.ge=!0;var b=a.xd;b.he=b.getExtension("WEBGL_multi_draw");b.fe=b.getExtension("EXT_polygon_offset_clamp");b.ee=b.getExtension("EXT_clip_control");b.ie=b.getExtension("WEBGL_polygon_mode");Ab(b);Bb(b);Cb(b);Db(b);Eb(b);2<=a.version&&(b.Kd=b.getExtension("EXT_disjoint_timer_query_webgl2"));if(2>a.version||!b.Kd)b.Kd=
b.getExtension("EXT_disjoint_timer_query");Fb(b).forEach(c=>{c.includes("lose_context")||c.includes("debug")||b.getExtension(c)})}},T,V,Tb=(a,b,c,d,e,h)=>{a={target:J(a),hd:h,ld:d,md:(g=event)=>{K(d)(e,0,b)&&g.preventDefault()},kd:c};I(a)},Ub=(a,b,c,d)=>{H.Hd||(H.Hd=M(96));return I({target:a,yd:!0,hd:"wheel",ld:d,md:(e=event)=>{var h=H.Hd;ub(h,e,a);y[h+64>>3]=e.deltaX;y[h+72>>3]=e.deltaY;y[h+80>>3]=e.deltaZ;u[h+88>>2]=e.deltaMode;K(d)(9,h,b)&&e.preventDefault()},kd:c})},Vb=["default","low-power",
"high-performance"],Wb={},Yb=()=>{if(!Xb){var a={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",_:fa||"./this.program"},b;for(b in Wb)void 0===Wb[b]?delete a[b]:a[b]=Wb[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Xb=c}return Xb},Xb,Zb=[null,[],[]],$b=[],ac=()=>{var a=Fb(N);return a=a.concat(a.map(b=>"GL_"+b))},bc=(a,b)=>{if(b){var c=void 0;switch(a){case 36346:c=
1;break;case 36344:return;case 34814:case 36345:c=0;break;case 34466:var d=N.getParameter(34467);c=d?d.length:0;break;case 33309:if(2>V.version){T||=1282;return}c=ac().length;break;case 33307:case 33308:if(2>V.version){T||=1280;return}c=33307==a?3:0}if(void 0===c)switch(d=N.getParameter(a),typeof d){case "number":c=d;break;case "boolean":c=d?1:0;break;case "string":T||=1280;return;case "object":if(null===d)switch(a){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:c=
0;break;default:T||=1280;return}else{if(d instanceof Float32Array||d instanceof Uint32Array||d instanceof Int32Array||d instanceof Array){for(a=0;a<d.length;++a)u[b+4*a>>2]=d[a];return}try{c=d.name|0}catch(e){T||=1280;n(`GL_INVALID_ENUM in glGet${0}v: Unknown object returned from WebGL getParameter(${a})! (error: ${e})`);return}}break;default:T||=1280;n(`GL_INVALID_ENUM in glGet${0}v: Native code calling glGet${0}v(${a}) and it returns ${d} of type ${typeof d}!`);return}u[b>>2]=c}else T||=1281},cc=
a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},dc=a=>{var b=cc(a)+1,c=M(b);c&&L(a,c,b);return c},ec=a=>"]"==a.slice(-1)&&a.lastIndexOf("["),fc=a=>{a-=5120;return 0==a?r:1==a?t:2==a?qa:4==a?u:6==a?x:5==a||28922==a||28520==a||30779==a||30782==a?w:ra},gc=(a,b,c,d,e)=>{a=fc(a);b=d*((Ob||c)*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[b-6402]||1)*a.BYTES_PER_ELEMENT+Nb-1&-Nb);return a.subarray(e>>>31-Math.clz32(a.BYTES_PER_ELEMENT),
e+b>>>31-Math.clz32(a.BYTES_PER_ELEMENT))},W=a=>{var b=N.ce;if(b){var c=b.sd[a];"number"==typeof c&&(b.sd[a]=c=N.getUniformLocation(b,b.$d[a]+(0<c?`[${c}]`:"")));return c}T||=1282},X=[],hc=[],B=a=>{var b=cc(a)+1,c=ic(b);L(a,c,b);return c},Ga=a=>{var b=jc();a();kc(b)};f.requestAnimationFrame=Ya;f.pauseMainLoop=jb;f.resumeMainLoop=function(){ab++;var a=Ta,b=Ua,c=E;E=null;ib(c,0,!1,bb,!0);$a(a,b);F()};f.preMainLoop&&gb.push(f.preMainLoop);f.postMainLoop&&hb.push(f.postMainLoop);for(var Y=0;32>Y;++Y)$b.push(Array(Y));
var lc=new Float32Array(288);for(Y=0;288>=Y;++Y)X[Y]=lc.subarray(0,Y);var mc=new Int32Array(288);for(Y=0;288>=Y;++Y)hc[Y]=mc.subarray(0,Y);
var Cc={ma:function(){return 0},mb:function(){return 0},nb:function(){},rb:()=>za(""),qb:(a,b,c)=>t.copyWithin(a,b,b+c),gb:()=>{Ka=!1;Ma=0},hb:(a,b)=>{D[a]&&(clearTimeout(D[a].id),delete D[a]);if(!b)return 0;var c=setTimeout(()=>{delete D[a];Ra(()=>nc(a,performance.now()))},b);D[a]={id:c,Fe:b};return 0},bb:function(a){if(void 0===window.localStorage)return 0;a=a?C(t,a):"";return(a=window.localStorage.getItem(a))?dc(a):0},pc:function(a,b){void 0!==window.localStorage&&(a=a?C(t,a):"",b=b?C(t,b):"",
window.localStorage.setItem(a,b))},Oa:(a,b,c)=>{Sa.length=0;for(var d;d=t[b++];){var e=105!=d;e&=112!=d;c+=e&&c%8?4:0;Sa.push(112==d?w[c>>2]:105==d?u[c>>2]:y[c>>3]);c+=e?8:4}return Ha[a](...Sa)},Ma:()=>{jb();E=null},fa:()=>"number"==typeof devicePixelRatio&&devicePixelRatio||1,ha:(a,b,c)=>{a=J(a);if(!a)return-4;a=pb(a);y[b>>3]=a.width;y[c>>3]=a.height;return 0},y:()=>performance.now(),Na:()=>performance.now(),Sa:(a,b)=>{function c(d){K(a)(d,b)&&requestAnimationFrame(c)}return requestAnimationFrame(c)},
ib:a=>{var b=t.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/65536))-oa.buffer.byteLength+65535)/65536|0;try{oa.grow(d);sa();var e=1;break a}catch(h){}e=void 0}if(e)return!0}return!1},P:(a,b,c,d)=>sb(a,b,c,d,12,"blur"),ea:(a,b,c)=>{a=J(a);if(!a)return-4;a.width=b;a.height=c;return 0},Q:(a,b,c,d)=>sb(a,b,c,d,13,"focus"),Z:(a,b,c,d)=>tb(a,b,c,d,2,"keydown"),X:(a,b,c,d)=>tb(a,b,c,d,1,"keypress"),
Y:(a,b,c,d)=>tb(a,b,c,d,3,"keyup"),Ta:(a,b,c)=>{a=K(a);ib(a,b,c)},da:(a,b,c,d)=>vb(a,b,c,d,5,"mousedown"),aa:(a,b,c,d)=>vb(a,b,c,d,33,"mouseenter"),$:(a,b,c,d)=>vb(a,b,c,d,34,"mouseleave"),ba:(a,b,c,d)=>vb(a,b,c,d,8,"mousemove"),ca:(a,b,c,d)=>vb(a,b,c,d,6,"mouseup"),S:(a,b,c,d)=>{if(!document||!document.body||!(document.body.requestPointerLock||document.body.rd||document.body.Pd||document.body.Nd))return-1;a=J(a);if(!a)return-4;wb(a,b,c,d,"mozpointerlockchange");wb(a,b,c,d,"webkitpointerlockchange");
wb(a,b,c,d,"mspointerlockchange");return wb(a,b,c,d,"pointerlockchange")},R:(a,b,c,d)=>{if(!document||!(document.body.requestPointerLock||document.body.rd||document.body.Pd||document.body.Nd))return-1;a=J(a);if(!a)return-4;xb(a,b,c,d,"mozpointerlockerror");xb(a,b,c,d,"webkitpointerlockerror");xb(a,b,c,d,"mspointerlockerror");return xb(a,b,c,d,"pointerlockerror")},ga:(a,b,c,d)=>yb(a,b,c,d),T:(a,b,c,d)=>zb(a,b,c,d,25,"touchcancel"),U:(a,b,c,d)=>zb(a,b,c,d,23,"touchend"),V:(a,b,c,d)=>zb(a,b,c,d,24,"touchmove"),
W:(a,b,c,d)=>zb(a,b,c,d,22,"touchstart"),O:(a,b,c,d)=>{Tb(a,b,c,d,31,"webglcontextlost");return 0},N:(a,b,c,d)=>{Tb(a,b,c,d,32,"webglcontextrestored");return 0},_:(a,b,c,d)=>(a=J(a))?"undefined"!=typeof a.onwheel?Ub(a,b,c,d):-1:-4,Ra:(a,b)=>{var c=b>>2;b={alpha:!!r[b+0],depth:!!r[b+1],stencil:!!r[b+2],antialias:!!r[b+3],premultipliedAlpha:!!r[b+4],preserveDrawingBuffer:!!r[b+5],powerPreference:Vb[u[c+2]],failIfMajorPerformanceCaveat:!!r[b+12],Qd:u[c+4],xe:u[c+5],Ld:r[b+24],de:r[b+25],ze:u[c+7],De:r[b+
32]};a=J(a);return!a||b.de?0:Rb(a,b)},Pa:(a,b)=>{a=Lb[a];b=b?C(t,b):"";b.startsWith("GL_")&&(b=b.substr(3));"ANGLE_instanced_arrays"==b&&Ab(N);"OES_vertex_array_object"==b&&Bb(N);"WEBGL_draw_buffers"==b&&Cb(N);"WEBGL_draw_instanced_base_vertex_base_instance"==b&&Db(N);"WEBGL_multi_draw_instanced_base_vertex_base_instance"==b&&Eb(N);"WEBGL_multi_draw"==b&&(N.he=N.getExtension("WEBGL_multi_draw"));"EXT_polygon_offset_clamp"==b&&(N.fe=N.getExtension("EXT_polygon_offset_clamp"));"EXT_clip_control"==b&&
(N.ee=N.getExtension("EXT_clip_control"));"WEBGL_polygon_mode"==b&&(N.ie=N.getExtension("WEBGL_polygon_mode"));return!!a.xd.getExtension(b)},Qa:a=>{V=Lb[a];f.ctx=N=V?.xd;return!a||N?0:-5},ob:(a,b)=>{var c=0;Yb().forEach((d,e)=>{var h=b+c;e=w[a+4*e>>2]=h;for(h=0;h<d.length;++h)r[e++]=d.charCodeAt(h);r[e]=0;c+=d.length+1});return 0},pb:(a,b)=>{var c=Yb();w[a>>2]=c.length;var d=0;c.forEach(e=>d+=e.length+1);w[b>>2]=d;return 0},la:()=>52,kb:()=>52,eb:function(){return 70},jb:(a,b,c,d)=>{for(var e=0,h=
0;h<c;h++){var g=w[b>>2],l=w[b+4>>2];b+=8;for(var m=0;m<l;m++){var p=t[g+m],v=Zb[a];0===p||10===p?((1===a?ma:n)(C(v)),v.length=0):v.push(p)}e+=l}w[d>>2]=e;return 0},k:function(a,b,c){const d=a?C(t,a):"";let e;try{e=window.indexedDB.open("chips",1)}catch(h){console.log("fs_js_load_snapshot: failed to open IndexedDB with "+h)}e.onupgradeneeded=()=>{console.log("fs_js_load_snapshot: creating db");e.result.createObjectStore("store")};e.onsuccess=()=>{var h=e.result;let g;try{g=h.transaction(["store"],
"readwrite")}catch(p){console.log("fs_js_load_snapshot: db.transaction failed with",p);return}h=g.objectStore("store");const l=d+"_"+b,m=h.get(l);m.onsuccess=()=>{if(void 0!==m.result){const p=m.result.length;console.log("fs_js_load_snapshot:",l,"successfully loaded",p,"bytes");const v=oc(p);t.set(m.result,v);pc(c,v,p)}else pc(c,0,0)};m.onerror=()=>{console.log("fs_js_load_snapshot: FAILED loading",l)};g.onerror=()=>{console.log("fs_js_load_snapshot: transaction onerror")}};e.onerror=()=>{console.log("fs_js_load_snapshot: open_request onerror")}},
Va:function(a,b,c,d){const e=a?C(t,a):"";console.log("fs_js_save_snapshot: called with",e,b);let h;try{h=window.indexedDB.open("chips",1)}catch(g){console.log("fs_js_save_snapshot: failed to open IndexedDB with "+g);return}h.onupgradeneeded=()=>{console.log("fs_js_save_snapshot: creating db");h.result.createObjectStore("store")};h.onsuccess=()=>{console.log("fs_js_save_snapshot: onsuccess");const g=h.result.transaction(["store"],"readwrite");var l=g.objectStore("store");const m=e+"_"+b;l=l.put(t.subarray(c,
c+d),m);l.onsuccess=()=>{console.log("fs_js_save_snapshot:",m,"successfully stored")};l.onerror=()=>{console.log("fs_js_save_snapshot: FAILED to store",m)};g.onerror=()=>{console.log("fs_js_save_snapshot: transaction onerror")}};h.onerror=()=>{console.log("fs_js_save_snapshot: open_request onerror")}},q:a=>N.activeTexture(a),xa:(a,b)=>{N.attachShader(O[a],R[b])},b:(a,b)=>{35051==a?N.Jd=b:35052==a&&(N.pd=b);N.bindBuffer(a,Hb[b])},a:(a,b,c)=>{N.bindBufferBase(a,b,Hb[c])},m:(a,b)=>{N.bindFramebuffer(a,
Ib[b])},mc:(a,b)=>{N.bindRenderbuffer(a,Jb[b])},p:(a,b)=>{N.bindSampler(a,S[b])},d:(a,b)=>{N.bindTexture(a,P[b])},M:a=>{N.bindVertexArray(Kb[a])},I:(a,b,c,d)=>N.blendColor(a,b,c,d),J:(a,b)=>N.blendEquationSeparate(a,b),K:(a,b,c,d)=>N.blendFuncSeparate(a,b,c,d),wb:(a,b,c,d,e,h,g,l,m,p)=>N.blitFramebuffer(a,b,c,d,e,h,g,l,m,p),Aa:(a,b,c,d)=>{2<=V.version?c&&b?N.bufferData(a,t,d,c,b):N.bufferData(a,b,d):N.bufferData(a,c?t.subarray(c,c+b):b,d)},C:(a,b,c,d)=>{2<=V.version?c&&N.bufferSubData(a,b,t,d,c):
N.bufferSubData(a,b,t.subarray(d,d+c))},ra:a=>N.checkFramebufferStatus(a),Rb:(a,b,c,d)=>N.clearBufferfi(a,b,c,d),pa:(a,b,c)=>{N.clearBufferfv(a,b,x,c>>2)},Qb:(a,b,c)=>{N.clearBufferiv(a,b,u,c>>2)},r:(a,b,c,d)=>{N.colorMask(!!a,!!b,!!c,!!d)},Vb:a=>{N.compileShader(R[a])},gc:(a,b,c,d,e,h,g,l)=>{2<=V.version?N.pd||!g?N.compressedTexImage2D(a,b,c,d,e,h,g,l):N.compressedTexImage2D(a,b,c,d,e,h,t,l,g):N.compressedTexImage2D(a,b,c,d,e,h,t.subarray(l,l+g))},ec:(a,b,c,d,e,h,g,l,m)=>{N.pd?N.compressedTexImage3D(a,
b,c,d,e,h,g,l,m):N.compressedTexImage3D(a,b,c,d,e,h,g,t,m,l)},ac:()=>{var a=Pb(O),b=N.createProgram();b.name=a;b.vd=b.td=b.ud=0;b.Gd=1;O[a]=b;return a},Xb:a=>{var b=Pb(R);R[b]=N.createShader(a);return b},F:a=>N.cullFace(a),Ea:(a,b)=>{for(var c=0;c<a;c++){var d=u[b+4*c>>2],e=Hb[d];e&&(N.deleteBuffer(e),e.name=0,Hb[d]=null,d==N.Jd&&(N.Jd=0),d==N.pd&&(N.pd=0))}},f:(a,b)=>{for(var c=0;c<a;++c){var d=u[b+4*c>>2],e=Ib[d];e&&(N.deleteFramebuffer(e),e.name=0,Ib[d]=null)}},n:a=>{if(a){var b=O[a];b?(N.deleteProgram(b),
b.name=0,O[a]=null):T||=1281}},D:(a,b)=>{for(var c=0;c<a;c++){var d=u[b+4*c>>2],e=Jb[d];e&&(N.deleteRenderbuffer(e),e.name=0,Jb[d]=null)}},g:(a,b)=>{for(var c=0;c<a;c++){var d=u[b+4*c>>2],e=S[d];e&&(N.deleteSampler(e),e.name=0,S[d]=null)}},B:a=>{if(a){var b=R[a];b?(N.deleteShader(b),R[a]=null):T||=1281}},E:(a,b)=>{for(var c=0;c<a;c++){var d=u[b+4*c>>2],e=P[d];e&&(N.deleteTexture(e),e.name=0,P[d]=null)}},Ca:(a,b)=>{for(var c=0;c<a;c++){var d=u[b+4*c>>2];N.deleteVertexArray(Kb[d]);Kb[d]=null}},v:a=>
N.depthFunc(a),u:a=>{N.depthMask(!!a)},e:a=>N.disable(a),L:a=>{N.disableVertexAttribArray(a)},yb:(a,b,c)=>{N.drawArrays(a,b,c)},zb:(a,b,c,d)=>{N.drawArraysInstanced(a,b,c,d)},qa:(a,b)=>{for(var c=$b[a],d=0;d<a;d++)c[d]=u[b+4*d>>2];N.drawBuffers(c)},Ab:(a,b,c,d)=>{N.drawElements(a,b,c,d)},Bb:(a,b,c,d,e)=>{N.drawElementsInstanced(a,b,c,d,e)},j:a=>N.enable(a),Mb:a=>{N.enableVertexAttribArray(a)},sa:(a,b,c,d)=>{N.framebufferRenderbuffer(a,b,c,Jb[d])},o:(a,b,c,d,e)=>{N.framebufferTexture2D(a,b,c,P[d],
e)},A:(a,b,c,d,e)=>{N.framebufferTextureLayer(a,b,P[c],d,e)},G:a=>N.frontFace(a),Ba:(a,b)=>{U(a,b,"createBuffer",Hb)},ta:(a,b)=>{U(a,b,"createFramebuffer",Ib)},nc:(a,b)=>{U(a,b,"createRenderbuffer",Jb)},bc:(a,b)=>{U(a,b,"createSampler",S)},kc:(a,b)=>{U(a,b,"createTexture",P)},La:(a,b)=>{U(a,b,"createVertexArray",Kb)},Tb:(a,b)=>N.getAttribLocation(O[a],b?C(t,b):""),c:(a,b)=>bc(a,b),_b:(a,b,c,d)=>{a=N.getProgramInfoLog(O[a]);null===a&&(a="(unknown error)");b=0<b&&d?L(a,d,b):0;c&&(u[c>>2]=b)},wa:(a,
b,c)=>{if(c)if(a>=Gb)T||=1281;else if(a=O[a],35716==b)a=N.getProgramInfoLog(a),null===a&&(a="(unknown error)"),u[c>>2]=a.length+1;else if(35719==b){if(!a.vd){var d=N.getProgramParameter(a,35718);for(b=0;b<d;++b)a.vd=Math.max(a.vd,N.getActiveUniform(a,b).name.length+1)}u[c>>2]=a.vd}else if(35722==b){if(!a.td)for(d=N.getProgramParameter(a,35721),b=0;b<d;++b)a.td=Math.max(a.td,N.getActiveAttrib(a,b).name.length+1);u[c>>2]=a.td}else if(35381==b){if(!a.ud)for(d=N.getProgramParameter(a,35382),b=0;b<d;++b)a.ud=
Math.max(a.ud,N.getActiveUniformBlockName(a,b).length+1);u[c>>2]=a.ud}else u[c>>2]=N.getProgramParameter(a,b);else T||=1281},Ub:(a,b,c,d)=>{a=N.getShaderInfoLog(R[a]);null===a&&(a="(unknown error)");b=0<b&&d?L(a,d,b):0;c&&(u[c>>2]=b)},ua:(a,b,c)=>{c?35716==b?(a=N.getShaderInfoLog(R[a]),null===a&&(a="(unknown error)"),u[c>>2]=a?a.length+1:0):35720==b?(a=N.getShaderSource(R[a]),u[c>>2]=a?a.length+1:0):u[c>>2]=N.getShaderParameter(R[a],b):T||=1281},Ja:(a,b)=>{if(2>V.version)return T||=1282,0;var c=Mb[a];
if(c)return 0>b||b>=c.length?(T||=1281,0):c[b];switch(a){case 7939:return c=ac().map(dc),c=Mb[a]=c,0>b||b>=c.length?(T||=1281,0):c[b];default:return T||=1280,0}},va:(a,b)=>{b=b?C(t,b):"";if(a=O[a]){var c=a,d=c.sd,e=c.ae,h;if(!d){c.sd=d={};c.$d={};var g=N.getProgramParameter(c,35718);for(h=0;h<g;++h){var l=N.getActiveUniform(c,h);var m=l.name;l=l.size;var p=ec(m);p=0<p?m.slice(0,p):m;var v=c.Gd;c.Gd+=l;e[p]=[l,v];for(m=0;m<l;++m)d[v]=m,c.$d[v++]=p}}c=a.sd;d=0;e=b;h=ec(b);0<h&&(d=parseInt(b.slice(h+
1))>>>0,e=b.slice(0,h));if((e=a.ae[e])&&d<e[0]&&(d+=e[1],c[d]=c[d]||N.getUniformLocation(a,b)))return d}else T||=1281;return-1},ub:(a,b,c)=>{for(var d=$b[b],e=0;e<b;e++)d[e]=u[c+4*e>>2];N.invalidateFramebuffer(a,d)},$b:a=>{a=O[a];N.linkProgram(a);a.sd=0;a.ae={}},Ka:(a,b)=>{3317==a?Nb=b:3314==a&&(Ob=b);N.pixelStorei(a,b)},H:(a,b)=>N.polygonOffset(a,b),xb:a=>N.readBuffer(a),lc:(a,b,c,d,e)=>N.renderbufferStorageMultisample(a,b,c,d,e),ya:(a,b,c)=>{N.samplerParameterf(S[a],b,c)},h:(a,b,c)=>{N.samplerParameteri(S[a],
b,c)},s:(a,b,c,d)=>N.scissor(a,b,c,d),Wb:(a,b,c,d)=>{for(var e="",h=0;h<b;++h){var g=(g=w[c+4*h>>2])?C(t,g,d?w[d+4*h>>2]:void 0):"";e+=g}N.shaderSource(R[a],e)},Ha:(a,b,c)=>N.stencilFunc(a,b,c),oa:(a,b,c,d)=>N.stencilFuncSeparate(a,b,c,d),t:a=>N.stencilMask(a),Ga:(a,b,c)=>N.stencilOp(a,b,c),na:(a,b,c,d)=>N.stencilOpSeparate(a,b,c,d),fc:(a,b,c,d,e,h,g,l,m)=>{if(2<=V.version){if(N.pd){N.texImage2D(a,b,c,d,e,h,g,l,m);return}if(m){var p=fc(l);m>>>=31-Math.clz32(p.BYTES_PER_ELEMENT);N.texImage2D(a,b,c,
d,e,h,g,l,p,m);return}}p=m?gc(l,g,d,e,m):null;N.texImage2D(a,b,c,d,e,h,g,l,p)},cc:(a,b,c,d,e,h,g,l,m,p)=>{if(N.pd)N.texImage3D(a,b,c,d,e,h,g,l,m,p);else if(p){var v=fc(m);N.texImage3D(a,b,c,d,e,h,g,l,m,v,p>>>31-Math.clz32(v.BYTES_PER_ELEMENT))}else N.texImage3D(a,b,c,d,e,h,g,l,m,null)},jc:(a,b,c)=>N.texParameteri(a,b,c),ic:(a,b,c,d,e)=>N.texStorage2D(a,b,c,d,e),hc:(a,b,c,d,e,h)=>N.texStorage3D(a,b,c,d,e,h),tb:(a,b,c,d,e,h,g,l,m)=>{if(2<=V.version){if(N.pd){N.texSubImage2D(a,b,c,d,e,h,g,l,m);return}if(m){var p=
fc(l);N.texSubImage2D(a,b,c,d,e,h,g,l,p,m>>>31-Math.clz32(p.BYTES_PER_ELEMENT));return}}m=m?gc(l,g,e,h,m):null;N.texSubImage2D(a,b,c,d,e,h,g,l,m)},sb:(a,b,c,d,e,h,g,l,m,p,v)=>{if(N.pd)N.texSubImage3D(a,b,c,d,e,h,g,l,m,p,v);else if(v){var Q=fc(p);N.texSubImage3D(a,b,c,d,e,h,g,l,m,p,Q,v>>>31-Math.clz32(Q.BYTES_PER_ELEMENT))}else N.texSubImage3D(a,b,c,d,e,h,g,l,m,p,null)},Lb:(a,b,c)=>{if(2<=V.version)b&&N.uniform1fv(W(a),x,c>>2,b);else{if(288>=b)for(var d=X[b],e=0;e<b;++e)d[e]=x[c+4*e>>2];else d=x.subarray(c>>
2,c+4*b>>2);N.uniform1fv(W(a),d)}},Yb:(a,b)=>{N.uniform1i(W(a),b)},Hb:(a,b,c)=>{if(2<=V.version)b&&N.uniform1iv(W(a),u,c>>2,b);else{if(288>=b)for(var d=hc[b],e=0;e<b;++e)d[e]=u[c+4*e>>2];else d=u.subarray(c>>2,c+4*b>>2);N.uniform1iv(W(a),d)}},Kb:(a,b,c)=>{if(2<=V.version)b&&N.uniform2fv(W(a),x,c>>2,2*b);else{if(144>=b){b*=2;for(var d=X[b],e=0;e<b;e+=2)d[e]=x[c+4*e>>2],d[e+1]=x[c+(4*e+4)>>2]}else d=x.subarray(c>>2,c+8*b>>2);N.uniform2fv(W(a),d)}},Fb:(a,b,c)=>{if(2<=V.version)b&&N.uniform2iv(W(a),u,
c>>2,2*b);else{if(144>=b){b*=2;for(var d=hc[b],e=0;e<b;e+=2)d[e]=u[c+4*e>>2],d[e+1]=u[c+(4*e+4)>>2]}else d=u.subarray(c>>2,c+8*b>>2);N.uniform2iv(W(a),d)}},Jb:(a,b,c)=>{if(2<=V.version)b&&N.uniform3fv(W(a),x,c>>2,3*b);else{if(96>=b){b*=3;for(var d=X[b],e=0;e<b;e+=3)d[e]=x[c+4*e>>2],d[e+1]=x[c+(4*e+4)>>2],d[e+2]=x[c+(4*e+8)>>2]}else d=x.subarray(c>>2,c+12*b>>2);N.uniform3fv(W(a),d)}},Eb:(a,b,c)=>{if(2<=V.version)b&&N.uniform3iv(W(a),u,c>>2,3*b);else{if(96>=b){b*=3;for(var d=hc[b],e=0;e<b;e+=3)d[e]=
u[c+4*e>>2],d[e+1]=u[c+(4*e+4)>>2],d[e+2]=u[c+(4*e+8)>>2]}else d=u.subarray(c>>2,c+12*b>>2);N.uniform3iv(W(a),d)}},Ib:(a,b,c)=>{if(2<=V.version)b&&N.uniform4fv(W(a),x,c>>2,4*b);else{if(72>=b){var d=X[4*b],e=x;c>>=2;b*=4;for(var h=0;h<b;h+=4){var g=c+h;d[h]=e[g];d[h+1]=e[g+1];d[h+2]=e[g+2];d[h+3]=e[g+3]}}else d=x.subarray(c>>2,c+16*b>>2);N.uniform4fv(W(a),d)}},Db:(a,b,c)=>{if(2<=V.version)b&&N.uniform4iv(W(a),u,c>>2,4*b);else{if(72>=b){b*=4;for(var d=hc[b],e=0;e<b;e+=4)d[e]=u[c+4*e>>2],d[e+1]=u[c+
(4*e+4)>>2],d[e+2]=u[c+(4*e+8)>>2],d[e+3]=u[c+(4*e+12)>>2]}else d=u.subarray(c>>2,c+16*b>>2);N.uniform4iv(W(a),d)}},Cb:(a,b,c,d)=>{if(2<=V.version)b&&N.uniformMatrix4fv(W(a),!!c,x,d>>2,16*b);else{if(18>=b){var e=X[16*b],h=x;d>>=2;b*=16;for(var g=0;g<b;g+=16){var l=d+g;e[g]=h[l];e[g+1]=h[l+1];e[g+2]=h[l+2];e[g+3]=h[l+3];e[g+4]=h[l+4];e[g+5]=h[l+5];e[g+6]=h[l+6];e[g+7]=h[l+7];e[g+8]=h[l+8];e[g+9]=h[l+9];e[g+10]=h[l+10];e[g+11]=h[l+11];e[g+12]=h[l+12];e[g+13]=h[l+13];e[g+14]=h[l+14];e[g+15]=h[l+15]}}else e=
x.subarray(d>>2,d+64*b>>2);N.uniformMatrix4fv(W(a),!!c,e)}},i:a=>{a=O[a];N.useProgram(a);N.ce=a},Nb:(a,b)=>{N.vertexAttribDivisor(a,b)},Ob:(a,b,c,d,e,h)=>{N.vertexAttribPointer(a,b,c,!!d,e,h)},l:(a,b,c,d)=>N.viewport(a,b,c,d),fb:Oa,oc:function(){f.Td=a=>{0!=qc()&&(a.preventDefault(),a.returnValue=" ")};window.addEventListener("beforeunload",f.Td)},Zb:function(){f.Zd=a=>{const b=a.clipboardData.getData("text");Ga(()=>{const c=B(b);rc(c)})};window.addEventListener("paste",f.Zd)},Gb:function(){f.Ee=
[];f.Ud=b=>{b.stopPropagation();b.preventDefault()};f.Vd=b=>{b.stopPropagation();b.preventDefault()};f.Wd=b=>{b.stopPropagation();b.preventDefault()};f.Xd=b=>{b.stopPropagation();b.preventDefault();const c=b.dataTransfer.files;f.Yd=c;sc(c.length);for(let e=0;e<c.length;e++)Ga(()=>{const h=B(c[e].name);tc(e,h)});let d=0;b.shiftKey&&(d|=1);b.ctrlKey&&(d|=2);b.altKey&&(d|=4);b.metaKey&&(d|=8);uc(b.clientX,b.clientY,d)};const a=f.nd;a.addEventListener("dragenter",f.Ud,!1);a.addEventListener("dragleave",
f.Vd,!1);a.addEventListener("dragover",f.Wd,!1);a.addEventListener("drop",f.Xd,!1)},$a:function(){const a=document.getElementById("sokol-app-favicon");a&&document.head.removeChild(a)},vb:function(a){const b=f.Yd;return 0>a||a>=b.length?0:b[a].size},lb:function(a,b,c,d,e){const h=new FileReader;h.onload=g=>{g=g.target.result;g.byteLength>d?vc(a,0,1,b,0,c,d,e):(t.set(new Uint8Array(g),c),vc(a,1,0,b,g.byteLength,c,d,e))};h.onerror=()=>{vc(a,0,2,b,0,c,d,e)};h.readAsArrayBuffer(f.Yd[a])},cb:function(a){a=
a?C(t,a):"";void 0!==f.canvas&&("object"===typeof f.canvas?ob[a]=f.canvas:console.warn("sokol_app.h: Module['canvas'] is set but is not an object"));f.nd=J(a);f.nd||console.warn("sokol_app.h: can't find html5_canvas_selector ",a);f.nd.requestPointerLock||console.warn("sokol_app.h: target doesn't support requestPointerLock: ",a)},dc:function(){window.removeEventListener("beforeunload",f.Td)},Sb:function(){window.removeEventListener("paste",f.Zd)},db:function(){const a=f.nd;a.removeEventListener("dragenter",
f.Ud);a.removeEventListener("dragleave",f.Vd);a.removeEventListener("dragover",f.Wd);a.removeEventListener("drop",f.Xd)},z:function(){f.nd&&f.nd.requestPointerLock&&f.nd.requestPointerLock()},ab:function(a,b){if(f.nd){if(0===b)a="none";else switch(a){case 0:a="auto";break;case 1:a="default";break;case 2:a="text";break;case 3:a="crosshair";break;case 4:a="pointer";break;case 5:a="ew-resize";break;case 6:a="ns-resize";break;case 7:a="nwse-resize";break;case 8:a="nesw-resize";break;case 9:a="all-scroll";
break;case 10:a="not-allowed";break;default:a="auto"}f.nd.style.cursor=a}},_a:function(a,b,c){const d=document.createElement("canvas");d.width=a;d.height=b;const e=d.getContext("2d"),h=e.createImageData(a,b);h.data.set(t.subarray(c,c+a*b*4));e.putImageData(h,0,0);a=document.createElement("link");a.id="sokol-app-favicon";a.rel="shortcut icon";a.href=d.toDataURL();document.head.appendChild(a)},Pb:function(a){a=a?C(t,a):"";const b=document.createElement("textarea");b.setAttribute("autocomplete","off");
b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");b.style.left="-100px";b.style.top="-100px";b.style.height=1;b.style.width=1;b.value=a;document.body.appendChild(b);b.select();document.execCommand("copy");document.body.removeChild(b)},Ua:function(){const a=(new URLSearchParams(window.location.search)).entries();for(let b=a.next();!b.done;b=a.next()){const c=b.value[0],d=b.value[1];Ga(()=>{const e=B(c),h=B(d);wc(e,h)})}},Xa:function(){return f.od?
f.od.bufferSize:0},Za:function(a,b,c){f.gd=null;f.od=null;"undefined"!==typeof AudioContext?f.gd=new AudioContext({sampleRate:a,latencyHint:"interactive"}):(f.gd=null,console.log("sokol_audio.h: no WebAudio support"));return f.gd?(console.log("sokol_audio.h: sample rate ",f.gd.sampleRate),f.od=f.gd.createScriptProcessor(c,0,b),f.od.onaudioprocess=d=>{const e=d.outputBuffer.length,h=xc(e);if(h){const g=d.outputBuffer.numberOfChannels;for(let l=0;l<g;l++){const m=d.outputBuffer.getChannelData(l);for(let p=
0;p<e;p++)m[p]=x[(h>>2)+(g*p+l)]}}},f.od.connect(f.gd.destination),a=()=>{f.gd&&"suspended"===f.gd.state&&f.gd.resume()},document.addEventListener("click",a,{once:!0}),document.addEventListener("touchend",a,{once:!0}),document.addEventListener("keydown",a,{once:!0}),1):0},Ya:function(){return f.gd?f.gd.sampleRate:0},ka:function(){const a=f.gd;null!==a&&(f.od&&f.od.disconnect(),a.close(),f.gd=null,f.od=null)},Wa:function(){if(f.gd)return"suspended"===f.gd.state?1:0},x:function(a,b,c,d,e,h){b=b?C(t,
b):"";const g=new XMLHttpRequest;g.open("GET",b);g.responseType="arraybuffer";const l=0<d;l&&g.setRequestHeader("Range","bytes="+c+"-"+(c+d-1));g.onreadystatechange=function(){if(g.readyState==XMLHttpRequest.DONE)if(206==g.status||200==g.status&&!l){const m=new Uint8Array(g.response),p=m.length;p<=h?(t.set(m,e),yc(a,d,p)):zc(a)}else Ac(a,g.status)};g.send()},ja:function(a,b){b=b?C(t,b):"";const c=new XMLHttpRequest;c.open("HEAD",b);c.onreadystatechange=function(){if(c.readyState==XMLHttpRequest.DONE)if(200==
c.status){const d=c.getResponseHeader("Content-Length");Bc(a,d)}else Ac(a,c.status)};c.send()},za:function(){return navigator.userAgent.includes("Macintosh")?1:0},ia:function(a,b){b=b?C(t,b):"";switch(a){case 0:console.error(b);break;case 1:console.error(b);break;case 2:console.warn(b);break;default:console.info(b)}},Ia:function(){console.log("webapi_js_event_continued()");f.webapi_onContinued?f.webapi_onContinued():console.log("no Module.webapi_onContinued function")},Fa:function(){console.log("webapi_js_event_reboot()");
f.webapi_onReboot?f.webapi_onReboot():console.log("no Module.webapi_onReboot function")},Da:function(){console.log("webapi_js_event_reset()");f.webapi_onReset?f.webapi_onReset():console.log("no Module.webapi_onReset function")},w:function(a,b){console.log("webapi_js_event_stopped()");f.webapi_onStopped?f.webapi_onStopped(a,b):console.log("no Module.webapi_onStopped function")}},Z=function(){function a(c){Z=c.exports;oa=Z.qc;sa();rb=Z.ad;ua.unshift(Z.rc);z--;f.monitorRunDependencies?.(z);0==z&&(null!==
ya&&(clearInterval(ya),ya=null),A&&(c=A,A=null,c()));return Z}z++;f.monitorRunDependencies?.(z);var b={a:Cc};if(f.instantiateWasm)try{return f.instantiateWasm(b,a)}catch(c){return n(`Module.instantiateWasm callback failed with error: ${c}`),!1}Ba??=Aa("kc854-ui.wasm")?"kc854-ui.wasm":f.locateFile?f.locateFile("kc854-ui.wasm",k):k+"kc854-ui.wasm";Fa(b,function(c){a(c.instance)});return{}}(),M=a=>(M=Z.sc)(a),oc=f._fs_emsc_alloc=a=>(oc=f._fs_emsc_alloc=Z.tc)(a),pc=f._fs_emsc_load_snapshot_callback=(a,
b,c)=>(pc=f._fs_emsc_load_snapshot_callback=Z.uc)(a,b,c);f._webapi_dbg_connect=()=>(f._webapi_dbg_connect=Z.vc)();f._webapi_dbg_disconnect=()=>(f._webapi_dbg_disconnect=Z.wc)();f._webapi_alloc=a=>(f._webapi_alloc=Z.xc)(a);f._webapi_free=a=>(f._webapi_free=Z.yc)(a);f._webapi_boot=()=>(f._webapi_boot=Z.zc)();f._webapi_reset=()=>(f._webapi_reset=Z.Ac)();f._webapi_ready=()=>(f._webapi_ready=Z.Bc)();f._webapi_load=(a,b)=>(f._webapi_load=Z.Cc)(a,b);f._webapi_load_snapshot=a=>(f._webapi_load_snapshot=Z.Dc)(a);
f._webapi_save_snapshot=a=>(f._webapi_save_snapshot=Z.Ec)(a);f._webapi_dbg_add_breakpoint=a=>(f._webapi_dbg_add_breakpoint=Z.Fc)(a);f._webapi_dbg_remove_breakpoint=a=>(f._webapi_dbg_remove_breakpoint=Z.Gc)(a);f._webapi_dbg_break=()=>(f._webapi_dbg_break=Z.Hc)();f._webapi_dbg_continue=()=>(f._webapi_dbg_continue=Z.Ic)();f._webapi_dbg_step_next=()=>(f._webapi_dbg_step_next=Z.Jc)();f._webapi_dbg_step_into=()=>(f._webapi_dbg_step_into=Z.Kc)();f._webapi_dbg_cpu_state=()=>(f._webapi_dbg_cpu_state=Z.Lc)();
f._webapi_dbg_request_disassembly=(a,b,c)=>(f._webapi_dbg_request_disassembly=Z.Mc)(a,b,c);f._webapi_dbg_read_memory=(a,b)=>(f._webapi_dbg_read_memory=Z.Nc)(a,b);f._webapi_input=a=>(f._webapi_input=Z.Oc)(a);
var rc=f.__sapp_emsc_onpaste=a=>(rc=f.__sapp_emsc_onpaste=Z.Pc)(a),qc=f.__sapp_html5_get_ask_leave_site=()=>(qc=f.__sapp_html5_get_ask_leave_site=Z.Qc)(),sc=f.__sapp_emsc_begin_drop=a=>(sc=f.__sapp_emsc_begin_drop=Z.Rc)(a),tc=f.__sapp_emsc_drop=(a,b)=>(tc=f.__sapp_emsc_drop=Z.Sc)(a,b),uc=f.__sapp_emsc_end_drop=(a,b,c)=>(uc=f.__sapp_emsc_end_drop=Z.Tc)(a,b,c),vc=f.__sapp_emsc_invoke_fetch_cb=(a,b,c,d,e,h,g,l)=>(vc=f.__sapp_emsc_invoke_fetch_cb=Z.Uc)(a,b,c,d,e,h,g,l),Dc=f._main=(a,b)=>(Dc=f._main=Z.Vc)(a,
b),xc=f.__saudio_emsc_pull=a=>(xc=f.__saudio_emsc_pull=Z.Wc)(a),wc=f.__sargs_add_kvp=(a,b)=>(wc=f.__sargs_add_kvp=Z.Xc)(a,b),Bc=f.__sfetch_emsc_head_response=(a,b)=>(Bc=f.__sfetch_emsc_head_response=Z.Yc)(a,b),yc=f.__sfetch_emsc_get_response=(a,b,c)=>(yc=f.__sfetch_emsc_get_response=Z.Zc)(a,b,c),Ac=f.__sfetch_emsc_failed_http_status=(a,b)=>(Ac=f.__sfetch_emsc_failed_http_status=Z._c)(a,b),zc=f.__sfetch_emsc_failed_buffer_too_small=a=>(zc=f.__sfetch_emsc_failed_buffer_too_small=Z.$c)(a),nc=(a,b)=>
(nc=Z.bd)(a,b),kc=a=>(kc=Z.cd)(a),ic=a=>(ic=Z.dd)(a),jc=()=>(jc=Z.ed)(),Ec;A=function Fc(){Ec||Gc();Ec||(A=Fc)};function Hc(a=[]){var b=Dc;a.unshift(fa);var c=a.length,d=ic(4*(c+1)),e=d;a.forEach(g=>{w[e>>2]=B(g);e+=4});w[e>>2]=0;try{var h=b(c,d);Pa(h)}catch(g){Na(g)}}
function Gc(){var a=ea;function b(){if(!Ec&&(Ec=!0,f.calledRun=!0,!q)){Ja(ua);Ja(va);f.onRuntimeInitialized?.();Ic&&Hc(a);if(f.postRun)for("function"==typeof f.postRun&&(f.postRun=[f.postRun]);f.postRun.length;){var c=f.postRun.shift();wa.unshift(c)}Ja(wa)}}if(!(0<z)){if(f.preRun)for("function"==typeof f.preRun&&(f.preRun=[f.preRun]);f.preRun.length;)xa();Ja(ta);0<z||(f.setStatus?(f.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>f.setStatus(""),1);b()},1)):b())}}
if(f.preInit)for("function"==typeof f.preInit&&(f.preInit=[f.preInit]);0<f.preInit.length;)f.preInit.pop()();var Ic=!0;f.noInitialRun&&(Ic=!1);Gc();