diff --git a/Cargo.lock b/Cargo.lock index 72ffea9..dea5b89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5058,6 +5058,7 @@ dependencies = [ "console_error_panic_hook", "eframe", "egui", + "egui_glow", "serde", "tracing", "tracing-subscriber", diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml new file mode 100644 index 0000000..de1f9b4 --- /dev/null +++ b/crates/client/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "wxbox-client" +version = "0.1.0" +edition = "2021" + +[dependencies] +tracing = "0.1" +tracing-subscriber = "0.3" +eframe = { version = "0.31" } +egui = "0.31" +egui_glow = "0.31" +serde = { version = "1", features = ["derive"] } + +[target.'cfg(target_arch = "wasm32")'.dependencies] +tracing-web = "0.1" +wasm-bindgen-futures = "0.4" +web-sys = "0.3" +console_error_panic_hook = "0.1" \ No newline at end of file diff --git a/crates/client/dist/index.html b/crates/client/dist/index.html new file mode 100644 index 0000000..1af9e2b --- /dev/null +++ b/crates/client/dist/index.html @@ -0,0 +1,254 @@ + + + + + + + + + + wxbox + + + + + + + + + +
+

+ Loading… +

+
+
+ + + + + \ No newline at end of file diff --git a/crates/client/dist/wxbox-client-cc3fc7938f2d1250.js b/crates/client/dist/wxbox-client-cc3fc7938f2d1250.js new file mode 100644 index 0000000..71dcbac --- /dev/null +++ b/crates/client/dist/wxbox-client-cc3fc7938f2d1250.js @@ -0,0 +1,1649 @@ +let wasm; + +function isLikeNone(x) { + return x === undefined || x === null; +} + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_1.set(idx, obj); + return idx; +} + +const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); + +if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + const idx = addToExternrefTable0(e); + wasm.__wbindgen_exn_store(idx); + } +} + +let WASM_VECTOR_LEN = 0; + +const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(state => { + wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b) +}); + +function makeMutClosure(arg0, arg1, dtor, f) { + const state = { a: arg0, b: arg1, cnt: 1, dtor }; + const real = (...args) => { + // First up with a closure we increment the internal reference + // count. This ensures that the Rust closure environment won't + // be deallocated while we're invoking it. + state.cnt++; + const a = state.a; + state.a = 0; + try { + return f(a, state.b, ...args); + } finally { + if (--state.cnt === 0) { + wasm.__wbindgen_export_6.get(state.dtor)(a, state.b); + CLOSURE_DTORS.unregister(state); + } else { + state.a = a; + } + } + }; + real.original = state; + CLOSURE_DTORS.register(real, state, state); + return real; +} + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches && builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_export_1.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} +function __wbg_adapter_30(arg0, arg1) { + const ret = wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h071c709f79650b21_multivalue_shim(arg0, arg1); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} + +function __wbg_adapter_33(arg0, arg1, arg2) { + wasm.closure292_externref_shim(arg0, arg1, arg2); +} + +function __wbg_adapter_38(arg0, arg1, arg2) { + wasm.closure379_externref_shim(arg0, arg1, arg2); +} + +const __wbindgen_enum_ResizeObserverBoxOptions = ["border-box", "content-box", "device-pixel-content-box"]; + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_activeElement_ea31ecc5423c6046 = function(arg0) { + const ret = arg0.activeElement; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_activeTexture_446c979476d36a40 = function(arg0, arg1) { + arg0.activeTexture(arg1 >>> 0); + }; + imports.wbg.__wbg_activeTexture_aec8c249ceb838d2 = function(arg0, arg1) { + arg0.activeTexture(arg1 >>> 0); + }; + imports.wbg.__wbg_addEventListener_37872d53aeb4c65a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3, arg4); + }, arguments) }; + imports.wbg.__wbg_altKey_d5409f5ddaa29593 = function(arg0) { + const ret = arg0.altKey; + return ret; + }; + imports.wbg.__wbg_altKey_d54599b3b6b6cf22 = function(arg0) { + const ret = arg0.altKey; + return ret; + }; + imports.wbg.__wbg_appendChild_d22bc7af6b96b3f1 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.appendChild(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_arrayBuffer_1be504e3eb62daa4 = function(arg0) { + const ret = arg0.arrayBuffer(); + return ret; + }; + imports.wbg.__wbg_at_479807bfddde3a33 = function(arg0, arg1) { + const ret = arg0.at(arg1); + return ret; + }; + imports.wbg.__wbg_attachShader_4dc5977795b5d865 = function(arg0, arg1, arg2) { + arg0.attachShader(arg1, arg2); + }; + imports.wbg.__wbg_attachShader_9b79a4896fee779d = function(arg0, arg1, arg2) { + arg0.attachShader(arg1, arg2); + }; + imports.wbg.__wbg_bindBuffer_e9412cc77f8130d6 = function(arg0, arg1, arg2) { + arg0.bindBuffer(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindBuffer_ff7c55f1062014bc = function(arg0, arg1, arg2) { + arg0.bindBuffer(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindTexture_8b97cf7511a725d0 = function(arg0, arg1, arg2) { + arg0.bindTexture(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindTexture_f65d2e377e3de352 = function(arg0, arg1, arg2) { + arg0.bindTexture(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindVertexArrayOES_19ed43bbe1241f7a = function(arg0, arg1) { + arg0.bindVertexArrayOES(arg1); + }; + imports.wbg.__wbg_bindVertexArray_67a807a1cd64976a = function(arg0, arg1) { + arg0.bindVertexArray(arg1); + }; + imports.wbg.__wbg_blendEquationSeparate_26681d98390d0057 = function(arg0, arg1, arg2) { + arg0.blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); + }; + imports.wbg.__wbg_blendEquationSeparate_e81d45aebb0a6f22 = function(arg0, arg1, arg2) { + arg0.blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); + }; + imports.wbg.__wbg_blendFuncSeparate_0031130a17fd5eb8 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); + }; + imports.wbg.__wbg_blendFuncSeparate_4d5cc402dcf7389f = function(arg0, arg1, arg2, arg3, arg4) { + arg0.blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); + }; + imports.wbg.__wbg_blockSize_6464e214800294a9 = function(arg0) { + const ret = arg0.blockSize; + return ret; + }; + imports.wbg.__wbg_blur_51f415004ecbe327 = function() { return handleError(function (arg0) { + arg0.blur(); + }, arguments) }; + imports.wbg.__wbg_body_8d7d8c4aa91dcad8 = function(arg0) { + const ret = arg0.body; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_bottom_72e7516e4f4e156a = function(arg0) { + const ret = arg0.bottom; + return ret; + }; + imports.wbg.__wbg_bufferData_0643498950a2292f = function(arg0, arg1, arg2, arg3) { + arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0); + }; + imports.wbg.__wbg_bufferData_7e2b6059c35c9291 = function(arg0, arg1, arg2, arg3) { + arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0); + }; + imports.wbg.__wbg_buffer_61b7ce01341d7f88 = function(arg0) { + const ret = arg0.buffer; + return ret; + }; + imports.wbg.__wbg_button_12b22015f2d5993d = function(arg0) { + const ret = arg0.button; + return ret; + }; + imports.wbg.__wbg_call_b0d8e36992d9900d = function() { return handleError(function (arg0, arg1) { + const ret = arg0.call(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_cancelAnimationFrame_5f7904867f6ab804 = function() { return handleError(function (arg0, arg1) { + arg0.cancelAnimationFrame(arg1); + }, arguments) }; + imports.wbg.__wbg_cancel_32c379e69f397185 = function(arg0) { + arg0.cancel(); + }; + imports.wbg.__wbg_changedTouches_86448a1d3a872098 = function(arg0) { + const ret = arg0.changedTouches; + return ret; + }; + imports.wbg.__wbg_clearColor_7e5806f100e4cd7a = function(arg0, arg1, arg2, arg3, arg4) { + arg0.clearColor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_clearColor_d58166c97d5eef07 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.clearColor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_clearInterval_998151d924a72ab2 = function(arg0, arg1) { + arg0.clearInterval(arg1); + }; + imports.wbg.__wbg_clear_16ffdcc1a1d6f0c9 = function(arg0, arg1) { + arg0.clear(arg1 >>> 0); + }; + imports.wbg.__wbg_clear_c182acb53176ea8b = function(arg0, arg1) { + arg0.clear(arg1 >>> 0); + }; + imports.wbg.__wbg_clientX_18c5fbacc6398ad8 = function(arg0) { + const ret = arg0.clientX; + return ret; + }; + imports.wbg.__wbg_clientX_f73b86b8aba3591d = function(arg0) { + const ret = arg0.clientX; + return ret; + }; + imports.wbg.__wbg_clientY_0974153484cf0d09 = function(arg0) { + const ret = arg0.clientY; + return ret; + }; + imports.wbg.__wbg_clientY_af033356579f2b9c = function(arg0) { + const ret = arg0.clientY; + return ret; + }; + imports.wbg.__wbg_clipboardData_d188aa1b339f8637 = function(arg0) { + const ret = arg0.clipboardData; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_clipboard_b634c08b310bca2e = function(arg0) { + const ret = arg0.clipboard; + return ret; + }; + imports.wbg.__wbg_colorMask_04bc7392c9d1b568 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); + }; + imports.wbg.__wbg_colorMask_401f99e62155b996 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); + }; + imports.wbg.__wbg_compileShader_afcc43901f14a922 = function(arg0, arg1) { + arg0.compileShader(arg1); + }; + imports.wbg.__wbg_compileShader_fab2df50ae89c5e1 = function(arg0, arg1) { + arg0.compileShader(arg1); + }; + imports.wbg.__wbg_contentBoxSize_c8dcd6b272f821ba = function(arg0) { + const ret = arg0.contentBoxSize; + return ret; + }; + imports.wbg.__wbg_contentRect_6fadfee6731ac5df = function(arg0) { + const ret = arg0.contentRect; + return ret; + }; + imports.wbg.__wbg_createBuffer_567b536a03db30d2 = function(arg0) { + const ret = arg0.createBuffer(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createBuffer_8692729b8ac9caaf = function(arg0) { + const ret = arg0.createBuffer(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createElement_89923fcb809656b7 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.createElement(getStringFromWasm0(arg1, arg2)); + return ret; + }, arguments) }; + imports.wbg.__wbg_createProgram_b8f69529220fb50b = function(arg0) { + const ret = arg0.createProgram(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createProgram_e2141127012594b0 = function(arg0) { + const ret = arg0.createProgram(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createShader_442f69b8f536a786 = function(arg0, arg1) { + const ret = arg0.createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createShader_809bd3abe629ad7a = function(arg0, arg1) { + const ret = arg0.createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createTexture_3c9e731e954515fa = function(arg0) { + const ret = arg0.createTexture(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createTexture_677a150f3f985ce0 = function(arg0) { + const ret = arg0.createTexture(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createVertexArrayOES_950dd712f273bb06 = function(arg0) { + const ret = arg0.createVertexArrayOES(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createVertexArray_68ae270682fc14aa = function(arg0) { + const ret = arg0.createVertexArray(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_create_861381d799b454bc = function(arg0) { + const ret = Object.create(arg0); + return ret; + }; + imports.wbg.__wbg_ctrlKey_5a324c8556fbce1c = function(arg0) { + const ret = arg0.ctrlKey; + return ret; + }; + imports.wbg.__wbg_ctrlKey_5c308955b0d5492d = function(arg0) { + const ret = arg0.ctrlKey; + return ret; + }; + imports.wbg.__wbg_dataTransfer_c29d7d69c9576def = function(arg0) { + const ret = arg0.dataTransfer; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_data_8980cafa6731c6b5 = function(arg0, arg1) { + const ret = arg1.data; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_debug_156ca727dbc3150f = function(arg0) { + console.debug(arg0); + }; + imports.wbg.__wbg_debug_19114f11037e4658 = function(arg0, arg1, arg2, arg3) { + console.debug(arg0, arg1, arg2, arg3); + }; + imports.wbg.__wbg_deleteBuffer_783d60e842697847 = function(arg0, arg1) { + arg0.deleteBuffer(arg1); + }; + imports.wbg.__wbg_deleteBuffer_bf5a34580654a42a = function(arg0, arg1) { + arg0.deleteBuffer(arg1); + }; + imports.wbg.__wbg_deleteProgram_3ca13ed49ca24a48 = function(arg0, arg1) { + arg0.deleteProgram(arg1); + }; + imports.wbg.__wbg_deleteProgram_47e8c8c7f0923d3d = function(arg0, arg1) { + arg0.deleteProgram(arg1); + }; + imports.wbg.__wbg_deleteShader_e1f71043508b6951 = function(arg0, arg1) { + arg0.deleteShader(arg1); + }; + imports.wbg.__wbg_deleteShader_e4fe2574d9c3afab = function(arg0, arg1) { + arg0.deleteShader(arg1); + }; + imports.wbg.__wbg_deleteTexture_36653aa53d4a29e9 = function(arg0, arg1) { + arg0.deleteTexture(arg1); + }; + imports.wbg.__wbg_deleteTexture_eaf729f97b59aaf4 = function(arg0, arg1) { + arg0.deleteTexture(arg1); + }; + imports.wbg.__wbg_deleteVertexArrayOES_0de32bd8adddeecb = function(arg0, arg1) { + arg0.deleteVertexArrayOES(arg1); + }; + imports.wbg.__wbg_deleteVertexArray_cff2c6ab55f2c8b6 = function(arg0, arg1) { + arg0.deleteVertexArray(arg1); + }; + imports.wbg.__wbg_deltaMode_b2e9bb0dca5cf196 = function(arg0) { + const ret = arg0.deltaMode; + return ret; + }; + imports.wbg.__wbg_deltaX_5c26d3b55d406732 = function(arg0) { + const ret = arg0.deltaX; + return ret; + }; + imports.wbg.__wbg_deltaY_1683a859ce933add = function(arg0) { + const ret = arg0.deltaY; + return ret; + }; + imports.wbg.__wbg_detachShader_17ec388351e24b61 = function(arg0, arg1, arg2) { + arg0.detachShader(arg1, arg2); + }; + imports.wbg.__wbg_detachShader_444b29fa4e93147e = function(arg0, arg1, arg2) { + arg0.detachShader(arg1, arg2); + }; + imports.wbg.__wbg_devicePixelContentBoxSize_f91b326c21f7e3d5 = function(arg0) { + const ret = arg0.devicePixelContentBoxSize; + return ret; + }; + imports.wbg.__wbg_devicePixelRatio_973abafaa5e8254b = function(arg0) { + const ret = arg0.devicePixelRatio; + return ret; + }; + imports.wbg.__wbg_disableVertexAttribArray_1bf5b473f133c8ab = function(arg0, arg1) { + arg0.disableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_disableVertexAttribArray_f49780d5b42e6b0d = function(arg0, arg1) { + arg0.disableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_disable_2f09f593bf0f5573 = function(arg0, arg1) { + arg0.disable(arg1 >>> 0); + }; + imports.wbg.__wbg_disable_302597eacd491d44 = function(arg0, arg1) { + arg0.disable(arg1 >>> 0); + }; + imports.wbg.__wbg_disconnect_6e7f07912b7a73c6 = function(arg0) { + arg0.disconnect(); + }; + imports.wbg.__wbg_document_f11bc4f7c03e1745 = function(arg0) { + const ret = arg0.document; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_drawArrays_01e26acf05821932 = function(arg0, arg1, arg2, arg3) { + arg0.drawArrays(arg1 >>> 0, arg2, arg3); + }; + imports.wbg.__wbg_drawArrays_32d97bfaf282c738 = function(arg0, arg1, arg2, arg3) { + arg0.drawArrays(arg1 >>> 0, arg2, arg3); + }; + imports.wbg.__wbg_drawElements_28e4f5037fe8c665 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); + }; + imports.wbg.__wbg_drawElements_3d61ffb17b84bc9d = function(arg0, arg1, arg2, arg3, arg4) { + arg0.drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); + }; + imports.wbg.__wbg_elementFromPoint_4d710989dedbb0f3 = function(arg0, arg1, arg2) { + const ret = arg0.elementFromPoint(arg1, arg2); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_enableVertexAttribArray_211547224fc25327 = function(arg0, arg1) { + arg0.enableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_enableVertexAttribArray_60827f2a43782639 = function(arg0, arg1) { + arg0.enableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_enable_2bacfac56e802b11 = function(arg0, arg1) { + arg0.enable(arg1 >>> 0); + }; + imports.wbg.__wbg_enable_a7767e03f7973ca8 = function(arg0, arg1) { + arg0.enable(arg1 >>> 0); + }; + imports.wbg.__wbg_error_483d659117b6f3f6 = function(arg0, arg1, arg2, arg3) { + console.error(arg0, arg1, arg2, arg3); + }; + imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_error_bbc7e5d1a0911165 = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_error_fab41a42d22bf2bc = function(arg0) { + console.error(arg0); + }; + imports.wbg.__wbg_files_95d9491da88a54b5 = function(arg0) { + const ret = arg0.files; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_focus_35fe945f7268dd62 = function() { return handleError(function (arg0) { + arg0.focus(); + }, arguments) }; + imports.wbg.__wbg_force_82b5a32305812290 = function(arg0) { + const ret = arg0.force; + return ret; + }; + imports.wbg.__wbg_generateMipmap_82e271fcb6f70fdc = function(arg0, arg1) { + arg0.generateMipmap(arg1 >>> 0); + }; + imports.wbg.__wbg_generateMipmap_b78fb575f19cb920 = function(arg0, arg1) { + arg0.generateMipmap(arg1 >>> 0); + }; + imports.wbg.__wbg_getAttribLocation_a3fffeb134874426 = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getAttribLocation(arg1, getStringFromWasm0(arg2, arg3)); + return ret; + }; + imports.wbg.__wbg_getAttribLocation_e104a96119fd0bbd = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getAttribLocation(arg1, getStringFromWasm0(arg2, arg3)); + return ret; + }; + imports.wbg.__wbg_getBoundingClientRect_05c4b9e3701bb372 = function(arg0) { + const ret = arg0.getBoundingClientRect(); + return ret; + }; + imports.wbg.__wbg_getComputedStyle_8e58bbd76370e2b1 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getComputedStyle(arg1); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getContext_5eaf5645cd6acb46 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getContext(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getData_a7e2258d0a97ce17 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = arg1.getData(getStringFromWasm0(arg2, arg3)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getElementById_dcc9f1f3cfdca0bc = function(arg0, arg1, arg2) { + const ret = arg0.getElementById(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getError_440987efeb6b80e1 = function(arg0) { + const ret = arg0.getError(); + return ret; + }; + imports.wbg.__wbg_getError_74cd1cb3c131ece0 = function(arg0) { + const ret = arg0.getError(); + return ret; + }; + imports.wbg.__wbg_getExtension_b96fdd5b9c1f7271 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getExtension(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getExtension_f31653ddc3f1cef9 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getExtension(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getItem_badd23d1a06e7b19 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = arg1.getItem(getStringFromWasm0(arg2, arg3)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getParameter_6f7bc820485dbae4 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getParameter(arg1 >>> 0); + return ret; + }, arguments) }; + imports.wbg.__wbg_getParameter_fc177c1d22da930b = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getParameter(arg1 >>> 0); + return ret; + }, arguments) }; + imports.wbg.__wbg_getProgramInfoLog_70d114345e15d2c1 = function(arg0, arg1, arg2) { + const ret = arg1.getProgramInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getProgramInfoLog_760af7d6753bc699 = function(arg0, arg1, arg2) { + const ret = arg1.getProgramInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getProgramParameter_8a6b724d42d813b3 = function(arg0, arg1, arg2) { + const ret = arg0.getProgramParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getProgramParameter_d328869400b82698 = function(arg0, arg1, arg2) { + const ret = arg0.getProgramParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getPropertyValue_66c16bac362c6d90 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = arg1.getPropertyValue(getStringFromWasm0(arg2, arg3)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getShaderInfoLog_23dd787b504d5f4e = function(arg0, arg1, arg2) { + const ret = arg1.getShaderInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getShaderInfoLog_da62e75d61fbf8a8 = function(arg0, arg1, arg2) { + const ret = arg1.getShaderInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getShaderParameter_e9098a633e6cf618 = function(arg0, arg1, arg2) { + const ret = arg0.getShaderParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getShaderParameter_f9c66f7ac8114c69 = function(arg0, arg1, arg2) { + const ret = arg0.getShaderParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getSupportedExtensions_3ce4548166177471 = function(arg0) { + const ret = arg0.getSupportedExtensions(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getSupportedExtensions_6f069a552bc69ef2 = function(arg0) { + const ret = arg0.getSupportedExtensions(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getUniformLocation_95f3933486db473c = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getUniformLocation(arg1, getStringFromWasm0(arg2, arg3)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getUniformLocation_b9be4fbca76ab9a4 = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getUniformLocation(arg1, getStringFromWasm0(arg2, arg3)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_014bbb75e258e645 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_198bfcfce5b3a38f = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_9aa3dff3f0266054 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return ret; + }; + imports.wbg.__wbg_get_dfac72a5ffb577cc = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_hash_4227a319264c4ca1 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.hash; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_height_08fd44318e18021d = function(arg0) { + const ret = arg0.height; + return ret; + }; + imports.wbg.__wbg_height_f36c36e27347cf38 = function(arg0) { + const ret = arg0.height; + return ret; + }; + imports.wbg.__wbg_hidden_2f28ae7f1a034fbc = function(arg0) { + const ret = arg0.hidden; + return ret; + }; + imports.wbg.__wbg_host_7131cd3aac9f8fd5 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.host; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_hostname_b4908a01df1be9f2 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.hostname; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_href_d04a5d3c2e6b361a = function() { return handleError(function (arg0, arg1) { + const ret = arg1.href; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_id_87f2e8c82a04a251 = function(arg0, arg1) { + const ret = arg1.id; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_identifier_14d5888db18610bb = function(arg0) { + const ret = arg0.identifier; + return ret; + }; + imports.wbg.__wbg_info_18e75e6ce8a36a90 = function(arg0, arg1, arg2, arg3) { + console.info(arg0, arg1, arg2, arg3); + }; + imports.wbg.__wbg_info_c3044c86ae29faab = function(arg0) { + console.info(arg0); + }; + imports.wbg.__wbg_inlineSize_60da5bea0a6275d2 = function(arg0) { + const ret = arg0.inlineSize; + return ret; + }; + imports.wbg.__wbg_instanceof_Element_0f1680908791f190 = function(arg0) { + let result; + try { + result = arg0 instanceof Element; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlCanvasElement_f764441ef5ddb63f = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLCanvasElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlElement_d94ed69c6883a691 = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlInputElement_47b3e827f364773c = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLInputElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ResizeObserverEntry_145c533d0e7cf2f4 = function(arg0) { + let result; + try { + result = arg0 instanceof ResizeObserverEntry; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ResizeObserverSize_8c7b496ccb6db38e = function(arg0) { + let result; + try { + result = arg0 instanceof ResizeObserverSize; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_WebGl2RenderingContext_ed03a40cd6d9a6c5 = function(arg0) { + let result; + try { + result = arg0 instanceof WebGL2RenderingContext; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_WebGlRenderingContext_934db43ae44dbdac = function(arg0) { + let result; + try { + result = arg0 instanceof WebGLRenderingContext; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Window_d2514c6a7ee7ba60 = function(arg0) { + let result; + try { + result = arg0 instanceof Window; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_isComposing_34930e03980aa623 = function(arg0) { + const ret = arg0.isComposing; + return ret; + }; + imports.wbg.__wbg_isComposing_e6c0e75812df1d39 = function(arg0) { + const ret = arg0.isComposing; + return ret; + }; + imports.wbg.__wbg_isSecureContext_56a612937252b7c4 = function(arg0) { + const ret = arg0.isSecureContext; + return ret; + }; + imports.wbg.__wbg_is_e442492d1fb7967b = function(arg0, arg1) { + const ret = Object.is(arg0, arg1); + return ret; + }; + imports.wbg.__wbg_item_7c8b01a4bd9230d3 = function(arg0, arg1) { + const ret = arg0.item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_items_9e6108f345463d2c = function(arg0) { + const ret = arg0.items; + return ret; + }; + imports.wbg.__wbg_keyCode_e673401ed53dfc2c = function(arg0) { + const ret = arg0.keyCode; + return ret; + }; + imports.wbg.__wbg_key_9a40d4f6defa675b = function(arg0, arg1) { + const ret = arg1.key; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_lastModified_0094dc85b1157ef5 = function(arg0) { + const ret = arg0.lastModified; + return ret; + }; + imports.wbg.__wbg_left_d79d7167a89a5169 = function(arg0) { + const ret = arg0.left; + return ret; + }; + imports.wbg.__wbg_length_65d1cd11729ced11 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_86e2f100fef1fecc = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_a2ea1b46bcec2b5e = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_c4528fc455e58194 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_d65cf0786bfc5739 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_linkProgram_9b1029885a37b70d = function(arg0, arg1) { + arg0.linkProgram(arg1); + }; + imports.wbg.__wbg_linkProgram_bcf6286423b25b5c = function(arg0, arg1) { + arg0.linkProgram(arg1); + }; + imports.wbg.__wbg_localStorage_9ca2da984fd56239 = function() { return handleError(function (arg0) { + const ret = arg0.localStorage; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_location_b2ec7e36fec8a8ff = function(arg0) { + const ret = arg0.location; + return ret; + }; + imports.wbg.__wbg_mark_05056c522bddc362 = function() { return handleError(function (arg0, arg1, arg2) { + arg0.mark(getStringFromWasm0(arg1, arg2)); + }, arguments) }; + imports.wbg.__wbg_mark_24a1a597f4f00679 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.mark(getStringFromWasm0(arg1, arg2), arg3); + }, arguments) }; + imports.wbg.__wbg_matchMedia_4adca948756a5784 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.matchMedia(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_matches_a69a36077c4f07ad = function(arg0) { + const ret = arg0.matches; + return ret; + }; + imports.wbg.__wbg_matches_f7ab6204c1d7b30d = function(arg0) { + const ret = arg0.matches; + return ret; + }; + imports.wbg.__wbg_measure_0b7379f5cfacac6d = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + arg0.measure(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getStringFromWasm0(arg5, arg6)); + }, arguments) }; + imports.wbg.__wbg_measure_7728846525e2cced = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.measure(getStringFromWasm0(arg1, arg2), arg3); + }, arguments) }; + imports.wbg.__wbg_metaKey_90fbd812345a7e0c = function(arg0) { + const ret = arg0.metaKey; + return ret; + }; + imports.wbg.__wbg_metaKey_de1f08a4d1e84bd1 = function(arg0) { + const ret = arg0.metaKey; + return ret; + }; + imports.wbg.__wbg_name_37e12d7b980bc5bd = function(arg0, arg1) { + const ret = arg1.name; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_navigator_0fe968937104eaa7 = function(arg0) { + const ret = arg0.navigator; + return ret; + }; + imports.wbg.__wbg_new_0565c3001775c60a = function() { return handleError(function (arg0) { + const ret = new ResizeObserver(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_254fa9eac11932ae = function() { + const ret = new Array(); + return ret; + }; + imports.wbg.__wbg_new_3ff5b33b1ce712df = function(arg0) { + const ret = new Uint8Array(arg0); + return ret; + }; + imports.wbg.__wbg_new_5136e00935bbc0fc = function() { + const ret = new Error(); + return ret; + }; + imports.wbg.__wbg_new_688846f374351c92 = function() { + const ret = new Object(); + return ret; + }; + imports.wbg.__wbg_new_8a6f238a6ece86ea = function() { + const ret = new Error(); + return ret; + }; + imports.wbg.__wbg_newnoargs_fd9e4bf8be2bc16d = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_4b01f207bed23fc0 = function(arg0, arg1, arg2) { + const ret = new Int8Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_5910bdf845a168eb = function(arg0, arg1, arg2) { + const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_6991ab0478cc4a43 = function(arg0, arg1, arg2) { + const ret = new Int32Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_69ec77b20853ae02 = function(arg0, arg1, arg2) { + const ret = new Uint16Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_b0192e1adfca2df1 = function(arg0, arg1, arg2) { + const ret = new Int16Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_ba35896968751d91 = function(arg0, arg1, arg2) { + const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_f113a96374814bb2 = function(arg0, arg1, arg2) { + const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithrecordfromstrtoblobpromise_43dee664be2df4ab = function() { return handleError(function (arg0) { + const ret = new ClipboardItem(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_newwithtext_f2ebd2622e9d451b = function() { return handleError(function (arg0, arg1) { + const ret = new SpeechSynthesisUtterance(getStringFromWasm0(arg0, arg1)); + return ret; + }, arguments) }; + imports.wbg.__wbg_newwithu8arraysequenceandoptions_75a3b40c32d6c988 = function() { return handleError(function (arg0, arg1) { + const ret = new Blob(arg0, arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) { + const ret = arg0.now(); + return ret; + }; + imports.wbg.__wbg_now_62a101fe35b60230 = function(arg0) { + const ret = arg0.now(); + return ret; + }; + imports.wbg.__wbg_observe_71a44d88a2880088 = function(arg0, arg1, arg2) { + arg0.observe(arg1, arg2); + }; + imports.wbg.__wbg_of_924412d32367b13d = function(arg0) { + const ret = Array.of(arg0); + return ret; + }; + imports.wbg.__wbg_offsetTop_eb7c481e74c6fa50 = function(arg0) { + const ret = arg0.offsetTop; + return ret; + }; + imports.wbg.__wbg_open_94e1e54493f5c069 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + const ret = arg0.open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_origin_8c23d49bc1f609e9 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.origin; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_performance_121b9855d716e029 = function() { + const ret = globalThis.performance; + return ret; + }; + imports.wbg.__wbg_performance_2e69ce813a883f21 = function(arg0) { + const ret = arg0.performance; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_performance_7a3ffd0b17f663ad = function(arg0) { + const ret = arg0.performance; + return ret; + }; + imports.wbg.__wbg_pixelStorei_7c93ee0ad7bf0763 = function(arg0, arg1, arg2) { + arg0.pixelStorei(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_pixelStorei_7dc331e4d85de1a3 = function(arg0, arg1, arg2) { + arg0.pixelStorei(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_port_14b0bf6b72b06565 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.port; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_preventDefault_3c86e59772d015e6 = function(arg0) { + arg0.preventDefault(); + }; + imports.wbg.__wbg_protocol_ceaedd334dc7dbaf = function() { return handleError(function (arg0, arg1) { + const ret = arg1.protocol; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_push_6edad0df4b546b2c = function(arg0, arg1) { + const ret = arg0.push(arg1); + return ret; + }; + imports.wbg.__wbg_queueMicrotask_2181040e064c0dc8 = function(arg0) { + queueMicrotask(arg0); + }; + imports.wbg.__wbg_queueMicrotask_ef9ac43769cbcc4f = function(arg0) { + const ret = arg0.queueMicrotask; + return ret; + }; + imports.wbg.__wbg_readPixels_33f7af7601585ec6 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + arg0.readPixels(arg1, arg2, arg3, arg4, arg5 >>> 0, arg6 >>> 0, arg7); + }, arguments) }; + imports.wbg.__wbg_readPixels_bc526324b691316a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + arg0.readPixels(arg1, arg2, arg3, arg4, arg5 >>> 0, arg6 >>> 0, arg7); + }, arguments) }; + imports.wbg.__wbg_readPixels_ca434c18552fc5bc = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + arg0.readPixels(arg1, arg2, arg3, arg4, arg5 >>> 0, arg6 >>> 0, arg7); + }, arguments) }; + imports.wbg.__wbg_removeEventListener_a9ca9f05245321f0 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.removeEventListener(getStringFromWasm0(arg1, arg2), arg3); + }, arguments) }; + imports.wbg.__wbg_remove_530b4f3163f72a83 = function(arg0) { + arg0.remove(); + }; + imports.wbg.__wbg_requestAnimationFrame_169cbbda5861d9ca = function() { return handleError(function (arg0, arg1) { + const ret = arg0.requestAnimationFrame(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_resolve_0bf7c44d641804f9 = function(arg0) { + const ret = Promise.resolve(arg0); + return ret; + }; + imports.wbg.__wbg_right_74bde7fc03836700 = function(arg0) { + const ret = arg0.right; + return ret; + }; + imports.wbg.__wbg_scissor_63c22bd552b53b16 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.scissor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_scissor_eebb3b755c95ca32 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.scissor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_search_feca3869d55ecd5c = function() { return handleError(function (arg0, arg1) { + const ret = arg1.search; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_setAttribute_148e0e65e20e5f27 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setItem_37bd15ddee3594af = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setProperty_0eb9705cf1b05650 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setProperty(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) { + arg0.set(arg1, arg2 >>> 0); + }; + imports.wbg.__wbg_set_4e647025551483bd = function() { return handleError(function (arg0, arg1, arg2) { + const ret = Reflect.set(arg0, arg1, arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_setautofocus_6ebfa477d4cba31b = function() { return handleError(function (arg0, arg1) { + arg0.autofocus = arg1 !== 0; + }, arguments) }; + imports.wbg.__wbg_setbox_2c55cd020a2888a8 = function(arg0, arg1) { + arg0.box = __wbindgen_enum_ResizeObserverBoxOptions[arg1]; + }; + imports.wbg.__wbg_setheight_16d76e7fa9d506ea = function(arg0, arg1) { + arg0.height = arg1 >>> 0; + }; + imports.wbg.__wbg_setinnerHTML_2d75307ba8832258 = function(arg0, arg1, arg2) { + arg0.innerHTML = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_setonce_87cf501e67ee47f7 = function(arg0, arg1) { + arg0.once = arg1 !== 0; + }; + imports.wbg.__wbg_setpitch_575e6c4d3c08396d = function(arg0, arg1) { + arg0.pitch = arg1; + }; + imports.wbg.__wbg_setrate_b2b113bd358677fc = function(arg0, arg1) { + arg0.rate = arg1; + }; + imports.wbg.__wbg_settabIndex_52ec33536f016c41 = function(arg0, arg1) { + arg0.tabIndex = arg1; + }; + imports.wbg.__wbg_settype_e19ab551722d5681 = function(arg0, arg1, arg2) { + arg0.type = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_settype_fd39465d237c2f36 = function(arg0, arg1, arg2) { + arg0.type = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_setvalue_44c59c360ad57cf0 = function(arg0, arg1, arg2) { + arg0.value = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_setvolume_aff584ffa2c97910 = function(arg0, arg1) { + arg0.volume = arg1; + }; + imports.wbg.__wbg_setwidth_c588fe07a7982aca = function(arg0, arg1) { + arg0.width = arg1 >>> 0; + }; + imports.wbg.__wbg_shaderSource_3bbf44221529c149 = function(arg0, arg1, arg2, arg3) { + arg0.shaderSource(arg1, getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbg_shaderSource_6a657afd48edb05a = function(arg0, arg1, arg2, arg3) { + arg0.shaderSource(arg1, getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbg_shiftKey_0d6625838238aee8 = function(arg0) { + const ret = arg0.shiftKey; + return ret; + }; + imports.wbg.__wbg_shiftKey_4b30f68655b97001 = function(arg0) { + const ret = arg0.shiftKey; + return ret; + }; + imports.wbg.__wbg_size_5ead5cc358246113 = function(arg0) { + const ret = arg0.size; + return ret; + }; + imports.wbg.__wbg_speak_d88fa5f225a44c0a = function(arg0, arg1) { + arg0.speak(arg1); + }; + imports.wbg.__wbg_speechSynthesis_26d3bf90f6a508c7 = function() { return handleError(function (arg0) { + const ret = arg0.speechSynthesis; + return ret; + }, arguments) }; + imports.wbg.__wbg_stack_0b83281de580e52f = function(arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_0be7472e492ad3e3 = function() { + const ret = typeof global === 'undefined' ? null : global; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_THIS_1a6eb482d12c9bfb = function() { + const ret = typeof globalThis === 'undefined' ? null : globalThis; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_SELF_1dc398a895c82351 = function() { + const ret = typeof self === 'undefined' ? null : self; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_WINDOW_ae1c80c7eea8d64a = function() { + const ret = typeof window === 'undefined' ? null : window; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_stopPropagation_da43a41fec77962c = function(arg0) { + arg0.stopPropagation(); + }; + imports.wbg.__wbg_style_53bb2d762dd1c030 = function(arg0) { + const ret = arg0.style; + return ret; + }; + imports.wbg.__wbg_texImage2D_488bd0838560f2fd = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texImage2D_54f87bf0ff987e47 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texImage2D_d83566263a20c144 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texParameteri_45603287be57d25e = function(arg0, arg1, arg2, arg3) { + arg0.texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); + }; + imports.wbg.__wbg_texParameteri_d550886a76f21258 = function(arg0, arg1, arg2, arg3) { + arg0.texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); + }; + imports.wbg.__wbg_texSubImage2D_0eeb9856a37cc769 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texSubImage2D_355ed8d7c2b07c22 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texSubImage2D_7af37da149ecfb8e = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_then_0438fad860fe38e1 = function(arg0, arg1) { + const ret = arg0.then(arg1); + return ret; + }; + imports.wbg.__wbg_then_0ffafeddf0e182a4 = function(arg0, arg1, arg2) { + const ret = arg0.then(arg1, arg2); + return ret; + }; + imports.wbg.__wbg_top_640e0509d882f0ee = function(arg0) { + const ret = arg0.top; + return ret; + }; + imports.wbg.__wbg_touches_464d67ccc79e7632 = function(arg0) { + const ret = arg0.touches; + return ret; + }; + imports.wbg.__wbg_type_1cad8117b64accc6 = function(arg0, arg1) { + const ret = arg1.type; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_type_394bc3bf9b919d18 = function(arg0, arg1) { + const ret = arg1.type; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_uniform1f_355e1f6a61fccb63 = function(arg0, arg1, arg2) { + arg0.uniform1f(arg1, arg2); + }; + imports.wbg.__wbg_uniform1f_a8765c5b2bedff99 = function(arg0, arg1, arg2) { + arg0.uniform1f(arg1, arg2); + }; + imports.wbg.__wbg_uniform1i_33a6ced29e8c7297 = function(arg0, arg1, arg2) { + arg0.uniform1i(arg1, arg2); + }; + imports.wbg.__wbg_uniform1i_fd66f39a37e6a753 = function(arg0, arg1, arg2) { + arg0.uniform1i(arg1, arg2); + }; + imports.wbg.__wbg_uniform2f_78492045e002e4eb = function(arg0, arg1, arg2, arg3) { + arg0.uniform2f(arg1, arg2, arg3); + }; + imports.wbg.__wbg_uniform2f_8174f619e86c3ba2 = function(arg0, arg1, arg2, arg3) { + arg0.uniform2f(arg1, arg2, arg3); + }; + imports.wbg.__wbg_useProgram_1a5a4be134db012a = function(arg0, arg1) { + arg0.useProgram(arg1); + }; + imports.wbg.__wbg_useProgram_88e7787408765ccf = function(arg0, arg1) { + arg0.useProgram(arg1); + }; + imports.wbg.__wbg_userAgent_918b064b4cd32842 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.userAgent; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_value_47fde8ea2d9fdcd5 = function(arg0, arg1) { + const ret = arg1.value; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_vertexAttribPointer_1f280ac2d8994592 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + arg0.vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + imports.wbg.__wbg_vertexAttribPointer_c6b1ccfa43bbca96 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + arg0.vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + imports.wbg.__wbg_viewport_1ca83fff581a8f22 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.viewport(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_viewport_770469a07e2d9772 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.viewport(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_warn_123db6aa8948382e = function(arg0) { + console.warn(arg0); + }; + imports.wbg.__wbg_warn_cb8be8bbf790a5d6 = function(arg0, arg1, arg2, arg3) { + console.warn(arg0, arg1, arg2, arg3); + }; + imports.wbg.__wbg_width_0d7b0b5ad3c2009f = function(arg0) { + const ret = arg0.width; + return ret; + }; + imports.wbg.__wbg_width_9927e6a7adb23d6d = function(arg0) { + const ret = arg0.width; + return ret; + }; + imports.wbg.__wbg_writeText_e65e98e75a2a92b8 = function(arg0, arg1, arg2) { + const ret = arg0.writeText(getStringFromWasm0(arg1, arg2)); + return ret; + }; + imports.wbg.__wbg_write_595020cd67830644 = function(arg0, arg1) { + const ret = arg0.write(arg1); + return ret; + }; + imports.wbg.__wbindgen_boolean_get = function(arg0) { + const v = arg0; + const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; + return ret; + }; + imports.wbg.__wbindgen_cb_drop = function(arg0) { + const obj = arg0.original; + if (obj.cnt-- == 1) { + obj.a = 0; + return true; + } + const ret = false; + return ret; + }; + imports.wbg.__wbindgen_closure_wrapper1119 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_38); + return ret; + }; + imports.wbg.__wbindgen_closure_wrapper827 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 289, __wbg_adapter_30); + return ret; + }; + imports.wbg.__wbindgen_closure_wrapper829 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 289, __wbg_adapter_33); + return ret; + }; + imports.wbg.__wbindgen_closure_wrapper831 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 289, __wbg_adapter_33); + return ret; + }; + imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { + const ret = debugString(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_in = function(arg0, arg1) { + const ret = arg0 in arg1; + return ret; + }; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_export_1; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; + }; + imports.wbg.__wbindgen_is_function = function(arg0) { + const ret = typeof(arg0) === 'function'; + return ret; + }; + imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = arg0 === undefined; + return ret; + }; + imports.wbg.__wbindgen_memory = function() { + const ret = wasm.memory; + return ret; + }; + imports.wbg.__wbindgen_number_get = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'number' ? obj : undefined; + getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); + }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + + return imports; +} + +function __wbg_init_memory(imports, memory) { + +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedDataViewMemory0 = null; + cachedUint8ArrayMemory0 = null; + + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('wxbox-client_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync }; +export default __wbg_init; diff --git a/crates/client/dist/wxbox-client-cc3fc7938f2d1250_bg.wasm b/crates/client/dist/wxbox-client-cc3fc7938f2d1250_bg.wasm new file mode 100644 index 0000000..13d6028 Binary files /dev/null and b/crates/client/dist/wxbox-client-cc3fc7938f2d1250_bg.wasm differ diff --git a/crates/client/index.html b/crates/client/index.html new file mode 100644 index 0000000..3a42c3c --- /dev/null +++ b/crates/client/index.html @@ -0,0 +1,114 @@ + + + + + + + + + + wxbox + + + + + + + + + +
+

+ Loading… +

+
+
+ + + + \ No newline at end of file diff --git a/crates/client/src/app.rs b/crates/client/src/app.rs new file mode 100644 index 0000000..2074891 --- /dev/null +++ b/crates/client/src/app.rs @@ -0,0 +1,57 @@ +use std::sync::{Arc, Mutex}; +use eframe::{Frame, Storage}; +use egui::{Context, Sense, Vec2}; +use crate::map::Map; + +pub struct App { + map: Arc>, + angle: f32 +} + +impl App { + pub fn new(cc: &eframe::CreationContext<'_>) -> Self { + let gl = cc.gl.as_ref().unwrap(); + Self { + map: Arc::new(Mutex::new(Map::new(gl).unwrap())), + angle: 0.0 + } + } +} + +impl eframe::App for App { + fn update(&mut self, ctx: &Context, frame: &mut Frame) { + egui::SidePanel::left("sidebar") + .resizable(false) + .show(ctx, |ui| { + ui.heading("wxbox"); + }); + + egui::CentralPanel::default() + .show(ctx, |ui| { + let (rect, response) = ui.allocate_exact_size( + ui.available_size(), + Sense::all() + ); + self.angle += response.drag_motion().x * 0.01; + + let angle = self.angle; + let map = self.map.clone(); + + let cb = egui_glow::CallbackFn::new(move |_info, painter| { + map.lock().unwrap().paint(painter.gl(), angle); + }); + + let callback = egui::PaintCallback { + rect, + callback: Arc::new(cb) + }; + + ui.painter().add(callback); + }); + } + fn on_exit(&mut self, gl: Option<&eframe::glow::Context>) { + if let Some(gl) = gl { + self.map.lock().unwrap().destroy(gl); + } + } +} \ No newline at end of file diff --git a/crates/client/src/lib.rs b/crates/client/src/lib.rs new file mode 100644 index 0000000..2ea8c20 --- /dev/null +++ b/crates/client/src/lib.rs @@ -0,0 +1,3 @@ +pub mod app; +pub mod map; + diff --git a/crates/client/src/main.rs b/crates/client/src/main.rs new file mode 100644 index 0000000..71af968 --- /dev/null +++ b/crates/client/src/main.rs @@ -0,0 +1,81 @@ +#[cfg(not(target_arch = "wasm32"))] +fn main() -> eframe::Result { + tracing_subscriber::fmt::init(); + + let native_options = eframe::NativeOptions { + viewport: egui::ViewportBuilder::default(), + ..Default::default() + }; + + eframe::run_native( + "wxbox", + native_options, + Box::new( + |cc| Ok(Box::new(wxbox_client::app::App::new(cc))) + ) + ) +} + +#[cfg(target_arch = "wasm32")] +fn main() { + use tracing::Level; + use tracing_subscriber::fmt::format::Pretty; + use tracing_subscriber::prelude::*; + use tracing_web::{performance_layer, MakeWebConsoleWriter}; + + console_error_panic_hook::set_once(); + + let fmt_layer = tracing_subscriber::fmt::layer() + .with_ansi(false) // not supported in browsers + .without_time() // std::time doesn't exist in wasm + .with_writer(MakeWebConsoleWriter::new().with_max_level(Level::DEBUG)); // wgpu spams the console, and this is slow as hell + + let perf_layer = performance_layer() // enable performance tracing + .with_details_from_fields(Pretty::default()); // ... with pretty fields + + tracing_subscriber::registry() + .with(fmt_layer) + .with(perf_layer) + .init(); // register the logger + + + use eframe::wasm_bindgen::JsCast as _; + + let web_options = eframe::WebOptions::default(); + + wasm_bindgen_futures::spawn_local(async { + let document = web_sys::window() + .expect("No window") + .document() + .expect("No document"); + + let canvas = document + .get_element_by_id("the_canvas_id") + .expect("Failed to find the_canvas_id") + .dyn_into::() + .expect("the_canvas_id was not a HtmlCanvasElement"); + + let start_result = eframe::WebRunner::new() + .start( + canvas, + web_options, + Box::new(|cc| Ok(Box::new(wxbox_client::app::App::new(cc)))), + ) + .await; + + // Remove the loading text and spinner: + if let Some(loading_text) = document.get_element_by_id("loading_text") { + match start_result { + Ok(_) => { + loading_text.remove(); + } + Err(e) => { + loading_text.set_inner_html( + "

The app has crashed. See the developer console for details.

", + ); + panic!("Failed to start eframe: {e:?}"); + } + } + } + }); +} \ No newline at end of file diff --git a/crates/client/src/map.rs b/crates/client/src/map.rs new file mode 100644 index 0000000..c71b940 --- /dev/null +++ b/crates/client/src/map.rs @@ -0,0 +1,131 @@ +use eframe::glow; +use tracing::warn; + +pub struct Map { + program: glow::Program, + vertex_array: glow::VertexArray +} + +#[allow(unsafe_code)] // we need unsafe code to use glow +impl Map { + pub fn new(gl: &glow::Context) -> Option { + use glow::HasContext as _; + + let shader_version = egui_glow::ShaderVersion::get(gl); + + unsafe { + let program = gl.create_program().expect("Cannot create program"); + + if !shader_version.is_new_shader_interface() { + warn!( + "Custom 3D painting hasn't been ported to {:?}", + shader_version + ); + return None; + } + + let (vertex_shader_source, fragment_shader_source) = ( + r#" + const vec2 verts[3] = vec2[3]( + vec2(0.0, 1.0), + vec2(-1.0, -1.0), + vec2(1.0, -1.0) + ); + const vec4 colors[3] = vec4[3]( + vec4(1.0, 0.0, 0.0, 1.0), + vec4(0.0, 1.0, 0.0, 1.0), + vec4(0.0, 0.0, 1.0, 1.0) + ); + out vec4 v_color; + uniform float u_angle; + void main() { + v_color = colors[gl_VertexID]; + gl_Position = vec4(verts[gl_VertexID], 0.0, 1.0); + gl_Position.x *= cos(u_angle); + } + "#, + r#" + precision mediump float; + in vec4 v_color; + out vec4 out_color; + void main() { + out_color = v_color; + } + "#, + ); + + let shader_sources = [ + (glow::VERTEX_SHADER, vertex_shader_source), + (glow::FRAGMENT_SHADER, fragment_shader_source), + ]; + + let shaders: Vec<_> = shader_sources + .iter() + .map(|(shader_type, shader_source)| { + let shader = gl + .create_shader(*shader_type) + .expect("Cannot create shader"); + gl.shader_source( + shader, + &format!( + "{}\n{}", + shader_version.version_declaration(), + shader_source + ), + ); + gl.compile_shader(shader); + assert!( + gl.get_shader_compile_status(shader), + "Failed to compile custom_3d_glow {shader_type}: {}", + gl.get_shader_info_log(shader) + ); + + gl.attach_shader(program, shader); + shader + }) + .collect(); + + gl.link_program(program); + assert!( + gl.get_program_link_status(program), + "{}", + gl.get_program_info_log(program) + ); + + for shader in shaders { + gl.detach_shader(program, shader); + gl.delete_shader(shader); + } + + let vertex_array = gl + .create_vertex_array() + .expect("Cannot create vertex array"); + + Some(Self { + program, + vertex_array, + }) + } + } + + pub fn destroy(&self, gl: &glow::Context) { + use glow::HasContext as _; + unsafe { + gl.delete_program(self.program); + gl.delete_vertex_array(self.vertex_array); + } + } + + pub fn paint(&self, gl: &glow::Context, angle: f32) { + use glow::HasContext as _; + unsafe { + gl.use_program(Some(self.program)); + gl.uniform_1_f32( + gl.get_uniform_location(self.program, "u_angle").as_ref(), + angle, + ); + gl.bind_vertex_array(Some(self.vertex_array)); + gl.draw_arrays(glow::TRIANGLES, 0, 3); + } + } +} \ No newline at end of file