diff --git a/.gitignore b/.gitignore index 3f836ad..dfd8354 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /target /web-build -.local \ No newline at end of file +.local +.bak +*/dist/ diff --git a/Cargo.lock b/Cargo.lock index e380c18..34dbcee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,6 +331,15 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fractal-engine" +version = "0.1.0" +dependencies = [ + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "futures-channel" version = "0.3.31" @@ -1104,6 +1113,16 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "web-sys" +version = "0.3.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "windows-link" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index eb2ac70..a542e61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = [ "crates/cli", + "crates/fractal-engine", "crates/message-tools", "crates/server" ] diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index aebcdbd..7608ee4 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -255,7 +255,7 @@ fn handle_command_status(status_result: std::io::Result, command_nam } fn build() { - println!("Building wasm package..."); + println!("Building wasm package (message-tools)..."); // build the wasm package let status = Command::new("wasm-pack") .arg("build") @@ -265,7 +265,18 @@ fn build() { .arg("--target") .arg("no-modules") .status(); - handle_command_status(status, "wasm-pack build"); + handle_command_status(status, "wasm-pack build message-tools"); + + println!("Building wasm package (fractal-engine)..."); + let status = Command::new("wasm-pack") + .arg("build") + .arg("--out-dir") + .arg("../../routes/root/pkg") + .arg("crates/fractal-engine") + .arg("--target") + .arg("no-modules") + .status(); + handle_command_status(status, "wasm-pack build fractal-engine"); println!("Building server executable..."); // build the server executable @@ -285,10 +296,10 @@ fn build() { handle_command_status(status, "mkdir web-build"); println!("Copying files..."); - // copy relevant files + // copy relevant files (use trailing slash to merge into existing directory) let status = Command::new("cp") .args(["-R", "-f", "routes"]) - .arg(format!("{WEB_BUILD_DIR}/routes")) + .arg(WEB_BUILD_DIR) .status(); handle_command_status(status, "cp routes"); diff --git a/crates/fractal-engine/Cargo.toml b/crates/fractal-engine/Cargo.toml new file mode 100644 index 0000000..123a1cf --- /dev/null +++ b/crates/fractal-engine/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "fractal-engine" +version = "0.1.0" +edition = "2024" + +[lib] +crate-type = ["cdylib", "rlib"] + +[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] +wasm-bindgen = "0.2.105" +web-sys = { version = "0.3", features = [ + "Window", "Document", "HtmlCanvasElement", + "CanvasRenderingContext2d", "ImageData" +]} +js-sys = "0.3" diff --git a/crates/fractal-engine/src/color.rs b/crates/fractal-engine/src/color.rs new file mode 100644 index 0000000..719094d --- /dev/null +++ b/crates/fractal-engine/src/color.rs @@ -0,0 +1,25 @@ +/// Ocean color palette for Newton's fractal + +/// Ocean color palette for three roots +/// root_index: 0, 1, or 2 +/// iterations: number of iterations to converge (affects brightness) +/// max_iterations: maximum iterations (for normalization) +pub fn ocean_palette(root_index: u8, iterations: u32, max_iterations: u32) -> (u8, u8, u8) { + // Brightness based on iteration count - fewer iterations = brighter + let t = (iterations as f64) / (max_iterations as f64); + let brightness = (1.0 - t * 0.7).max(0.3); + + // Ocean theme colors for each root basin + let (r, g, b) = match root_index { + 0 => (0.05, 0.25, 0.55), // Deep ocean blue + 1 => (0.0, 0.45, 0.50), // Teal + 2 => (0.15, 0.55, 0.65), // Cyan/turquoise + _ => (0.05, 0.25, 0.55), + }; + + ( + (r * brightness * 255.0) as u8, + (g * brightness * 255.0) as u8, + (b * brightness * 255.0) as u8, + ) +} diff --git a/crates/fractal-engine/src/lib.rs b/crates/fractal-engine/src/lib.rs new file mode 100644 index 0000000..10c428c --- /dev/null +++ b/crates/fractal-engine/src/lib.rs @@ -0,0 +1,5 @@ +pub mod color; +pub mod newton; + +#[cfg(all(target_arch = "wasm32", target_os = "unknown"))] +pub mod wasm; diff --git a/crates/fractal-engine/src/newton.rs b/crates/fractal-engine/src/newton.rs new file mode 100644 index 0000000..8274e0c --- /dev/null +++ b/crates/fractal-engine/src/newton.rs @@ -0,0 +1,76 @@ +/// Newton's method fractal for z^3 - 1 +/// The three roots are at 120 degree intervals on the unit circle + +const MAX_ITERATIONS: u32 = 32; +const TOLERANCE_SQ: f64 = 1e-6; + +/// Compute Newton's method iteration for z^3 - 1 +/// Returns (root_index, iterations) where root_index is 0, 1, or 2 +/// Time parameter rotates the viewing angle for animation +pub fn compute(z_re: f64, z_im: f64, time: f64) -> (u8, u32) { + // Rotate input coordinates to animate the fractal + let cos_t = time.cos(); + let sin_t = time.sin(); + let mut zr = z_re * cos_t - z_im * sin_t; + let mut zi = z_re * sin_t + z_im * cos_t; + + // The three roots of z^3 - 1 + const ROOTS: [(f64, f64); 3] = [ + (1.0, 0.0), // 1 + (-0.5, 0.866025403784439), // e^(2πi/3) + (-0.5, -0.866025403784439), // e^(4πi/3) + ]; + + for iter in 0..MAX_ITERATIONS { + // Compute z^2 + let z2_re = zr * zr - zi * zi; + let z2_im = 2.0 * zr * zi; + + // Compute z^3 + let z3_re = zr * z2_re - zi * z2_im; + let z3_im = zr * z2_im + zi * z2_re; + + // Check distance to each root + for (idx, &(root_re, root_im)) in ROOTS.iter().enumerate() { + let dr = zr - root_re; + let di = zi - root_im; + if dr * dr + di * di < TOLERANCE_SQ { + return (idx as u8, iter); + } + } + + // Newton's method: z = z - (z^3 - 1)/(3z^2) + // Simplifies to: z = (2z^3 + 1)/(3z^2) + + // Denominator: 3z^2 + let denom_re = 3.0 * z2_re; + let denom_im = 3.0 * z2_im; + let denom_mag_sq = denom_re * denom_re + denom_im * denom_im; + + if denom_mag_sq < 1e-12 { + return (0, MAX_ITERATIONS); + } + + // Numerator: 2z^3 + 1 + let num_re = 2.0 * z3_re + 1.0; + let num_im = 2.0 * z3_im; + + // Complex division + zr = (num_re * denom_re + num_im * denom_im) / denom_mag_sq; + zi = (num_im * denom_re - num_re * denom_im) / denom_mag_sq; + } + + // Find closest root + let mut closest = 0u8; + let mut min_dist = f64::MAX; + for (idx, &(root_re, root_im)) in ROOTS.iter().enumerate() { + let dr = zr - root_re; + let di = zi - root_im; + let dist = dr * dr + di * di; + if dist < min_dist { + min_dist = dist; + closest = idx as u8; + } + } + (closest, MAX_ITERATIONS) +} diff --git a/crates/fractal-engine/src/wasm.rs b/crates/fractal-engine/src/wasm.rs new file mode 100644 index 0000000..f49fe17 --- /dev/null +++ b/crates/fractal-engine/src/wasm.rs @@ -0,0 +1,106 @@ +use wasm_bindgen::prelude::*; +use web_sys::{CanvasRenderingContext2d, HtmlCanvasElement, ImageData}; + +use crate::color::ocean_palette; +use crate::newton::compute; + +const MAX_ITERATIONS: u32 = 32; + +/// Get the canvas element and 2D context +fn get_canvas_and_context(canvas_id: &str) -> Result<(HtmlCanvasElement, CanvasRenderingContext2d), JsValue> { + let window = web_sys::window().ok_or("no window")?; + let document = window.document().ok_or("no document")?; + let canvas = document + .get_element_by_id(canvas_id) + .ok_or("no canvas element")? + .dyn_into::()?; + + let context = canvas + .get_context("2d")? + .ok_or("no 2d context")? + .dyn_into::()?; + + Ok((canvas, context)) +} + +/// Render the Newton fractal with animation (time parameter rotates the view) +#[wasm_bindgen] +pub fn render_fractal_animated(canvas_id: &str, time: f64, scale: u32) -> Result<(), JsValue> { + let (canvas, context) = get_canvas_and_context(canvas_id)?; + + let canvas_width = canvas.width() as usize; + let canvas_height = canvas.height() as usize; + + // Render at reduced resolution + let scale = scale.max(1) as usize; + let width = canvas_width / scale; + let height = canvas_height / scale; + + // Create RGBA buffer + let mut pixels: Vec = vec![0; width * height * 4]; + + // Complex plane bounds + let view_size = 3.0; + let aspect = width as f64 / height as f64; + + for y in 0..height { + for x in 0..width { + // Map pixel to complex plane (centered at origin) + let z_re = (x as f64 / width as f64 - 0.5) * view_size * aspect; + let z_im = (y as f64 / height as f64 - 0.5) * view_size; + + // Compute Newton iteration + let (root_index, iterations) = compute(z_re, z_im, time); + + // Get color from ocean palette + let (r, g, b) = ocean_palette(root_index, iterations, MAX_ITERATIONS); + + // Write to pixel buffer (RGBA) + let idx = (y * width + x) * 4; + pixels[idx] = r; + pixels[idx + 1] = g; + pixels[idx + 2] = b; + pixels[idx + 3] = 255; + } + } + + // Create ImageData at reduced size + let clamped = wasm_bindgen::Clamped(&pixels[..]); + let image_data = ImageData::new_with_u8_clamped_array_and_sh(clamped, width as u32, height as u32)?; + + // Scale up when drawing to canvas + if scale > 1 { + // Draw to a temporary position then scale + context.put_image_data(&image_data, 0.0, 0.0)?; + + // Use drawImage to scale up + let temp_canvas = document_create_canvas(width as u32, height as u32)?; + let temp_ctx = temp_canvas + .get_context("2d")? + .ok_or("no temp 2d context")? + .dyn_into::()?; + temp_ctx.put_image_data(&image_data, 0.0, 0.0)?; + + context.set_image_smoothing_enabled(false); + context.draw_image_with_html_canvas_element_and_dw_and_dh( + &temp_canvas, + 0.0, 0.0, + canvas_width as f64, canvas_height as f64 + )?; + } else { + context.put_image_data(&image_data, 0.0, 0.0)?; + } + + Ok(()) +} + +fn document_create_canvas(width: u32, height: u32) -> Result { + let window = web_sys::window().ok_or("no window")?; + let document = window.document().ok_or("no document")?; + let canvas = document + .create_element("canvas")? + .dyn_into::()?; + canvas.set_width(width); + canvas.set_height(height); + Ok(canvas) +} diff --git a/crates/pages/message-box/dist/message-box-ce532c58cb981b7a.js b/crates/pages/message-box/dist/message-box-ce532c58cb981b7a.js new file mode 100644 index 0000000..3ce18fe --- /dev/null +++ b/crates/pages/message-box/dist/message-box-ce532c58cb981b7a.js @@ -0,0 +1,1686 @@ +let wasm; + +function isLikeNone(x) { + return x === undefined || x === null; +} + +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; +} + +let WASM_VECTOR_LEN = 0; + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +const cachedTextEncoder = new TextEncoder(); + +if (!('encodeInto' in cachedTextEncoder)) { + cachedTextEncoder.encodeInto = 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 = cachedTextEncoder.encodeInto(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; +} + +let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +const MAX_SAFARI_DECODE_BYTES = 2146435072; +let numBytesDecoded = 0; +function decodeText(ptr, len) { + numBytesDecoded += len; + if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) { + cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + cachedTextDecoder.decode(); + numBytesDecoded = len; + } + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return decodeText(ptr, len); +} + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_externrefs.set(idx, obj); + return idx; +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + const idx = addToExternrefTable0(e); + wasm.__wbindgen_exn_store(idx); + } +} + +function getArrayU8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); +} + +const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(state => 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 { + state.a = a; + real._wbg_cb_unref(); + } + }; + real._wbg_cb_unref = () => { + if (--state.cnt === 0) { + state.dtor(state.a, state.b); + state.a = 0; + CLOSURE_DTORS.unregister(state); + } + }; + CLOSURE_DTORS.register(real, state, state); + return real; +} + +let cachedUint32ArrayMemory0 = null; + +function getUint32ArrayMemory0() { + if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) { + cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer); + } + return cachedUint32ArrayMemory0; +} + +function getArrayU32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} + +let cachedInt32ArrayMemory0 = null; + +function getInt32ArrayMemory0() { + if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) { + cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer); + } + return cachedInt32ArrayMemory0; +} + +function getArrayI32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} + +let cachedUint16ArrayMemory0 = null; + +function getUint16ArrayMemory0() { + if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.byteLength === 0) { + cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer); + } + return cachedUint16ArrayMemory0; +} + +function getArrayU16FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len); +} + +let cachedFloat32ArrayMemory0 = null; + +function getFloat32ArrayMemory0() { + if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) { + cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer); + } + return cachedFloat32ArrayMemory0; +} + +function getArrayF32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} + +let cachedInt16ArrayMemory0 = null; + +function getInt16ArrayMemory0() { + if (cachedInt16ArrayMemory0 === null || cachedInt16ArrayMemory0.byteLength === 0) { + cachedInt16ArrayMemory0 = new Int16Array(wasm.memory.buffer); + } + return cachedInt16ArrayMemory0; +} + +function getArrayI16FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len); +} + +let cachedInt8ArrayMemory0 = null; + +function getInt8ArrayMemory0() { + if (cachedInt8ArrayMemory0 === null || cachedInt8ArrayMemory0.byteLength === 0) { + cachedInt8ArrayMemory0 = new Int8Array(wasm.memory.buffer); + } + return cachedInt8ArrayMemory0; +} + +function getArrayI8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); +} +function wasm_bindgen__convert__closures_____invoke__he1b801c09172a949(arg0, arg1, arg2) { + wasm.wasm_bindgen__convert__closures_____invoke__he1b801c09172a949(arg0, arg1, arg2); +} + +function wasm_bindgen__convert__closures_____invoke__h85dfd1a0a1a675fd(arg0, arg1, arg2) { + wasm.wasm_bindgen__convert__closures_____invoke__h85dfd1a0a1a675fd(arg0, arg1, arg2); +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_externrefs.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} +function wasm_bindgen__convert__closures_____invoke__h116bbac12d4e3d34(arg0, arg1) { + const ret = wasm.wasm_bindgen__convert__closures_____invoke__h116bbac12d4e3d34(arg0, arg1); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} + +const __wbindgen_enum_ResizeObserverBoxOptions = ["border-box", "content-box", "device-pixel-content-box"]; + +const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']); + +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) { + const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type); + + if (validResponse && 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___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) { + const v = arg0; + const ret = typeof(v) === 'boolean' ? v : undefined; + return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0; + }; + imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = 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.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) { + const ret = arg0 in arg1; + return ret; + }; + imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) { + const ret = typeof(arg0) === 'function'; + return ret; + }; + imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) { + const ret = arg0 === undefined; + return ret; + }; + imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = 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.__wbg___wbindgen_string_get_e4f06c90489ad01b = 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.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9 = function(arg0) { + arg0._wbg_cb_unref(); + }; + imports.wbg.__wbg_activeElement_acfd089919b80462 = function(arg0) { + const ret = arg0.activeElement; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_activeElement_c22f19bd2aa07d3e = function(arg0) { + const ret = arg0.activeElement; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_activeTexture_48c9bc28acaaa54d = function(arg0, arg1) { + arg0.activeTexture(arg1 >>> 0); + }; + imports.wbg.__wbg_activeTexture_f84308a5d2b7001d = function(arg0, arg1) { + arg0.activeTexture(arg1 >>> 0); + }; + imports.wbg.__wbg_addEventListener_534b9f715f44517f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3, arg4); + }, arguments) }; + imports.wbg.__wbg_altKey_1afb1a12d93938b0 = function(arg0) { + const ret = arg0.altKey; + return ret; + }; + imports.wbg.__wbg_altKey_ab1e889cd83cf088 = function(arg0) { + const ret = arg0.altKey; + return ret; + }; + imports.wbg.__wbg_appendChild_aec7a8a4bd6cac61 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.appendChild(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_arrayBuffer_5930938a049abc90 = function(arg0) { + const ret = arg0.arrayBuffer(); + return ret; + }; + imports.wbg.__wbg_at_a848c0ce365c6832 = function(arg0, arg1) { + const ret = arg0.at(arg1); + return ret; + }; + imports.wbg.__wbg_attachShader_28ab04bfd0eeb19d = function(arg0, arg1, arg2) { + arg0.attachShader(arg1, arg2); + }; + imports.wbg.__wbg_attachShader_4729f6e4e28e3c47 = function(arg0, arg1, arg2) { + arg0.attachShader(arg1, arg2); + }; + imports.wbg.__wbg_bindBuffer_3c6f3ecc1a210ca3 = function(arg0, arg1, arg2) { + arg0.bindBuffer(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindBuffer_54099db8f6d4b751 = function(arg0, arg1, arg2) { + arg0.bindBuffer(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindTexture_ada4abace31e0749 = function(arg0, arg1, arg2) { + arg0.bindTexture(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindTexture_d9b13673706adf9e = function(arg0, arg1, arg2) { + arg0.bindTexture(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindVertexArrayOES_86f8b49c99908d4a = function(arg0, arg1) { + arg0.bindVertexArrayOES(arg1); + }; + imports.wbg.__wbg_bindVertexArray_c061c24c9d2fbfef = function(arg0, arg1) { + arg0.bindVertexArray(arg1); + }; + imports.wbg.__wbg_blendEquationSeparate_30f938178b4bf4ea = function(arg0, arg1, arg2) { + arg0.blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); + }; + imports.wbg.__wbg_blendEquationSeparate_8fd8b8c2468c0d49 = function(arg0, arg1, arg2) { + arg0.blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); + }; + imports.wbg.__wbg_blendFuncSeparate_01e331a4feaf2532 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); + }; + imports.wbg.__wbg_blendFuncSeparate_efd2b4ec166727db = function(arg0, arg1, arg2, arg3, arg4) { + arg0.blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); + }; + imports.wbg.__wbg_blockSize_f20a7ec2c5bcce10 = function(arg0) { + const ret = arg0.blockSize; + return ret; + }; + imports.wbg.__wbg_blur_8d22d76019f9d6a0 = function() { return handleError(function (arg0) { + arg0.blur(); + }, arguments) }; + imports.wbg.__wbg_body_8c26b54829a0c4cb = function(arg0) { + const ret = arg0.body; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_bottom_48779afa7b750239 = function(arg0) { + const ret = arg0.bottom; + return ret; + }; + imports.wbg.__wbg_bufferData_121b54242e0dabb1 = function(arg0, arg1, arg2, arg3) { + arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0); + }; + imports.wbg.__wbg_bufferData_6c7fa43be0e969d6 = function(arg0, arg1, arg2, arg3) { + arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0); + }; + imports.wbg.__wbg_button_cd095d6d829d3270 = function(arg0) { + const ret = arg0.button; + return ret; + }; + imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) { + const ret = arg0.call(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_cancelAnimationFrame_f6c090ea700b5a50 = function() { return handleError(function (arg0, arg1) { + arg0.cancelAnimationFrame(arg1); + }, arguments) }; + imports.wbg.__wbg_changedTouches_42c07e8d12d1bbcc = function(arg0) { + const ret = arg0.changedTouches; + return ret; + }; + imports.wbg.__wbg_clearColor_95a9ab5565d42083 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.clearColor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_clearColor_e7b3ddf4fdaaecaa = function(arg0, arg1, arg2, arg3, arg4) { + arg0.clearColor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_clearInterval_0675249bbe52da7b = function(arg0, arg1) { + arg0.clearInterval(arg1); + }; + imports.wbg.__wbg_clear_21e859b27ff741c4 = function(arg0, arg1) { + arg0.clear(arg1 >>> 0); + }; + imports.wbg.__wbg_clear_bd1d14ac12f3d45d = function(arg0, arg1) { + arg0.clear(arg1 >>> 0); + }; + imports.wbg.__wbg_clientX_1166635f13c2a22e = function(arg0) { + const ret = arg0.clientX; + return ret; + }; + imports.wbg.__wbg_clientX_97c1ab5b7abf71d4 = function(arg0) { + const ret = arg0.clientX; + return ret; + }; + imports.wbg.__wbg_clientY_6b2560a0984b55af = function(arg0) { + const ret = arg0.clientY; + return ret; + }; + imports.wbg.__wbg_clientY_d0eab302753c17d9 = function(arg0) { + const ret = arg0.clientY; + return ret; + }; + imports.wbg.__wbg_clipboardData_1f4d4e422564e133 = function(arg0) { + const ret = arg0.clipboardData; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_clipboard_83c63b95503bfec1 = function(arg0) { + const ret = arg0.clipboard; + return ret; + }; + imports.wbg.__wbg_colorMask_27f4ed2cabe913b5 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); + }; + imports.wbg.__wbg_colorMask_ac1f3bfc9431295b = function(arg0, arg1, arg2, arg3, arg4) { + arg0.colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); + }; + imports.wbg.__wbg_compileShader_8be7809a35b5b8d1 = function(arg0, arg1) { + arg0.compileShader(arg1); + }; + imports.wbg.__wbg_compileShader_b6b9c3922553e2b5 = function(arg0, arg1) { + arg0.compileShader(arg1); + }; + imports.wbg.__wbg_contentBoxSize_554560be57215ee6 = function(arg0) { + const ret = arg0.contentBoxSize; + return ret; + }; + imports.wbg.__wbg_contentRect_26af16e75cc97c65 = function(arg0) { + const ret = arg0.contentRect; + return ret; + }; + imports.wbg.__wbg_createBuffer_5d773097dcb49bc5 = function(arg0) { + const ret = arg0.createBuffer(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createBuffer_9ec61509720be784 = function(arg0) { + const ret = arg0.createBuffer(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createElement_964ab674a0176cd8 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.createElement(getStringFromWasm0(arg1, arg2)); + return ret; + }, arguments) }; + imports.wbg.__wbg_createProgram_3de15304f8ebbc28 = function(arg0) { + const ret = arg0.createProgram(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createProgram_76f1b3b1649a6a70 = function(arg0) { + const ret = arg0.createProgram(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createShader_800924f280388e4d = function(arg0, arg1) { + const ret = arg0.createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createShader_8956396370304fdd = function(arg0, arg1) { + const ret = arg0.createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createTexture_b4154609b3be9454 = function(arg0) { + const ret = arg0.createTexture(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createTexture_f088ddfa0b4394ed = function(arg0) { + const ret = arg0.createTexture(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createVertexArrayOES_72077a0d85a95427 = function(arg0) { + const ret = arg0.createVertexArrayOES(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createVertexArray_0060b507a03b9521 = function(arg0) { + const ret = arg0.createVertexArray(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_ctrlKey_5621e1a6fd6decc2 = function(arg0) { + const ret = arg0.ctrlKey; + return ret; + }; + imports.wbg.__wbg_ctrlKey_566441f821ad6b91 = function(arg0) { + const ret = arg0.ctrlKey; + return ret; + }; + imports.wbg.__wbg_dataTransfer_ac196d77762b90f5 = function(arg0) { + const ret = arg0.dataTransfer; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_data_375e6b6c9e4e372b = 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_1045c17441388fce = function(arg0, arg1) { + console.debug(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbg_deleteBuffer_12e435724ee42b31 = function(arg0, arg1) { + arg0.deleteBuffer(arg1); + }; + imports.wbg.__wbg_deleteBuffer_1d3ed354bfcc9cc1 = function(arg0, arg1) { + arg0.deleteBuffer(arg1); + }; + imports.wbg.__wbg_deleteProgram_14d7e1bba4c2a048 = function(arg0, arg1) { + arg0.deleteProgram(arg1); + }; + imports.wbg.__wbg_deleteProgram_57e178b9a4712e5d = function(arg0, arg1) { + arg0.deleteProgram(arg1); + }; + imports.wbg.__wbg_deleteShader_8c57ca62bb68c92a = function(arg0, arg1) { + arg0.deleteShader(arg1); + }; + imports.wbg.__wbg_deleteShader_fc28d3e4e0b5dce1 = function(arg0, arg1) { + arg0.deleteShader(arg1); + }; + imports.wbg.__wbg_deleteTexture_52d70a9a7a6185f5 = function(arg0, arg1) { + arg0.deleteTexture(arg1); + }; + imports.wbg.__wbg_deleteTexture_e8ccb15bc8feb76d = function(arg0, arg1) { + arg0.deleteTexture(arg1); + }; + imports.wbg.__wbg_deltaMode_07ce5244f9725729 = function(arg0) { + const ret = arg0.deltaMode; + return ret; + }; + imports.wbg.__wbg_deltaX_52dbec35cfc88ef2 = function(arg0) { + const ret = arg0.deltaX; + return ret; + }; + imports.wbg.__wbg_deltaY_533a14decfb96f6b = function(arg0) { + const ret = arg0.deltaY; + return ret; + }; + imports.wbg.__wbg_detachShader_739e7d9f35b46be1 = function(arg0, arg1, arg2) { + arg0.detachShader(arg1, arg2); + }; + imports.wbg.__wbg_detachShader_8b95c9f94c9288ce = function(arg0, arg1, arg2) { + arg0.detachShader(arg1, arg2); + }; + imports.wbg.__wbg_devicePixelContentBoxSize_36e338e852526803 = function(arg0) { + const ret = arg0.devicePixelContentBoxSize; + return ret; + }; + imports.wbg.__wbg_devicePixelRatio_495c092455fdf6b1 = function(arg0) { + const ret = arg0.devicePixelRatio; + return ret; + }; + imports.wbg.__wbg_disableVertexAttribArray_b05c9e7b1b3ecc2f = function(arg0, arg1) { + arg0.disableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_disableVertexAttribArray_e9d52218e665768f = function(arg0, arg1) { + arg0.disableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_disable_3c01320ea56d1bad = function(arg0, arg1) { + arg0.disable(arg1 >>> 0); + }; + imports.wbg.__wbg_disable_8a379385ec68f6aa = function(arg0, arg1) { + arg0.disable(arg1 >>> 0); + }; + imports.wbg.__wbg_disconnect_26bdefa21f6e8a2f = function(arg0) { + arg0.disconnect(); + }; + imports.wbg.__wbg_document_725ae06eb442a6db = function(arg0) { + const ret = arg0.document; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_drawElements_7c2a1a67924d993d = function(arg0, arg1, arg2, arg3, arg4) { + arg0.drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); + }; + imports.wbg.__wbg_drawElements_8259eee7121b4791 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); + }; + imports.wbg.__wbg_elementFromPoint_4dca36851eb6c5d2 = function(arg0, arg1, arg2) { + const ret = arg0.elementFromPoint(arg1, arg2); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_elementFromPoint_a53d78ac95bcc438 = function(arg0, arg1, arg2) { + const ret = arg0.elementFromPoint(arg1, arg2); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_enableVertexAttribArray_10d871fb9fd0846c = function(arg0, arg1) { + arg0.enableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_enableVertexAttribArray_a2d36c7d18a4a692 = function(arg0, arg1) { + arg0.enableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_enable_3c4fab29e1f03b55 = function(arg0, arg1) { + arg0.enable(arg1 >>> 0); + }; + imports.wbg.__wbg_enable_e086a91d756e13d4 = function(arg0, arg1) { + arg0.enable(arg1 >>> 0); + }; + imports.wbg.__wbg_error_9e96f6dc2ec8f160 = 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_files_b3322d9a4bdc60ef = function(arg0) { + const ret = arg0.files; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_focus_f18e304f287a2dd3 = function() { return handleError(function (arg0) { + arg0.focus(); + }, arguments) }; + imports.wbg.__wbg_force_eb1a0ff68a50a61d = function(arg0) { + const ret = arg0.force; + return ret; + }; + imports.wbg.__wbg_generateMipmap_a4d48a9eb569ee7b = function(arg0, arg1) { + arg0.generateMipmap(arg1 >>> 0); + }; + imports.wbg.__wbg_generateMipmap_f14e38fd660f54c4 = function(arg0, arg1) { + arg0.generateMipmap(arg1 >>> 0); + }; + imports.wbg.__wbg_getAttribLocation_49bd303d768cecdc = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getAttribLocation(arg1, getStringFromWasm0(arg2, arg3)); + return ret; + }; + imports.wbg.__wbg_getAttribLocation_b544bb90d1c65c92 = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getAttribLocation(arg1, getStringFromWasm0(arg2, arg3)); + return ret; + }; + imports.wbg.__wbg_getBoundingClientRect_eb2f68e504025fb4 = function(arg0) { + const ret = arg0.getBoundingClientRect(); + return ret; + }; + imports.wbg.__wbg_getComputedStyle_a9cd917337bb8d6e = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getComputedStyle(arg1); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getContext_0b80ccb9547db509 = 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_3788e2545bd763f8 = 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_c365dd703c4a88c3 = function(arg0, arg1, arg2) { + const ret = arg0.getElementById(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getError_0f97dbb7af4af28b = function(arg0) { + const ret = arg0.getError(); + return ret; + }; + imports.wbg.__wbg_getError_63344ab78b980409 = function(arg0) { + const ret = arg0.getError(); + return ret; + }; + imports.wbg.__wbg_getExtension_44f035398aceaa92 = 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_bbf0b2c292c17fd9 = 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_89f57d6acc51a876 = 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_1b50ca7ab8b81a6c = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getParameter(arg1 >>> 0); + return ret; + }, arguments) }; + imports.wbg.__wbg_getParameter_4261d100d0d13cdd = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getParameter(arg1 >>> 0); + return ret; + }, arguments) }; + imports.wbg.__wbg_getProgramInfoLog_579753d7443e93d0 = 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_ce6f5e0603a4927f = 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_9e84a8e91d9bd349 = function(arg0, arg1, arg2) { + const ret = arg0.getProgramParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getProgramParameter_c7c229864f96a134 = function(arg0, arg1, arg2) { + const ret = arg0.getProgramParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getPropertyValue_6d3f3b556847452f = 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_getRootNode_1a92832d2a2c2584 = function(arg0) { + const ret = arg0.getRootNode(); + return ret; + }; + imports.wbg.__wbg_getShaderInfoLog_77e0c47daa4370bb = 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_8802198fabe2d112 = 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_e3163f97690735a5 = function(arg0, arg1, arg2) { + const ret = arg0.getShaderParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getShaderParameter_f7a968e7357add60 = function(arg0, arg1, arg2) { + const ret = arg0.getShaderParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getSupportedExtensions_2ebb12658429578b = function(arg0) { + const ret = arg0.getSupportedExtensions(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getSupportedExtensions_b646b9d1a2bc4476 = function(arg0) { + const ret = arg0.getSupportedExtensions(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getUniformLocation_595d98b1f60ef0bd = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getUniformLocation(arg1, getStringFromWasm0(arg2, arg3)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getUniformLocation_eec60dd414033654 = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getUniformLocation(arg1, getStringFromWasm0(arg2, arg3)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_6657bdb7125f55e6 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return ret; + }; + imports.wbg.__wbg_get_cf5c9f2800c60966 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_e87449b189af3c78 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(arg0, arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_hash_2aa6a54fb8342cef = 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_119077665279308c = function(arg0) { + const ret = arg0.height; + return ret; + }; + imports.wbg.__wbg_height_4ec1d9540f62ef0a = function(arg0) { + const ret = arg0.height; + return ret; + }; + imports.wbg.__wbg_hidden_e2d0392f3af0749f = function(arg0) { + const ret = arg0.hidden; + return ret; + }; + imports.wbg.__wbg_host_42828f818b9dc26c = 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_b3afa4677fba29d1 = 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_6d02c53ff820b6ae = 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_d58b7351e62811fa = 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_62287c55f12f8d26 = function(arg0) { + const ret = arg0.identifier; + return ret; + }; + imports.wbg.__wbg_info_23156e94e02524fa = function(arg0, arg1) { + console.info(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbg_inlineSize_917f52e805414525 = function(arg0) { + const ret = arg0.inlineSize; + return ret; + }; + imports.wbg.__wbg_instanceof_Document_c741de15f1a592fa = function(arg0) { + let result; + try { + result = arg0 instanceof Document; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Element_437534ce3e96fe49 = function(arg0) { + let result; + try { + result = arg0 instanceof Element; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlCanvasElement_3e2e95b109dae976 = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLCanvasElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlElement_e20a729df22f9e1c = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlInputElement_b8672abb32fe4ab7 = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLInputElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ResizeObserverEntry_f5dd16c0b18c0095 = function(arg0) { + let result; + try { + result = arg0 instanceof ResizeObserverEntry; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ResizeObserverSize_614222674456d4e1 = function(arg0) { + let result; + try { + result = arg0 instanceof ResizeObserverSize; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ShadowRoot_e6792e25a38f0857 = function(arg0) { + let result; + try { + result = arg0 instanceof ShadowRoot; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_WebGl2RenderingContext_21eea93591d7c571 = function(arg0) { + let result; + try { + result = arg0 instanceof WebGL2RenderingContext; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_WebGlRenderingContext_29ac37f0cb7afc9b = function(arg0) { + let result; + try { + result = arg0 instanceof WebGLRenderingContext; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Window_4846dbb3de56c84c = function(arg0) { + let result; + try { + result = arg0 instanceof Window; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_isComposing_880aefe4b7c1f188 = function(arg0) { + const ret = arg0.isComposing; + return ret; + }; + imports.wbg.__wbg_isComposing_edc391922399c564 = function(arg0) { + const ret = arg0.isComposing; + return ret; + }; + imports.wbg.__wbg_isSecureContext_5de99ce3634f8265 = function(arg0) { + const ret = arg0.isSecureContext; + return ret; + }; + imports.wbg.__wbg_is_3a0656e6f61f2e9a = function(arg0, arg1) { + const ret = Object.is(arg0, arg1); + return ret; + }; + imports.wbg.__wbg_item_b844543d1e47f842 = function(arg0, arg1) { + const ret = arg0.item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_items_6f6ee442137b5379 = function(arg0) { + const ret = arg0.items; + return ret; + }; + imports.wbg.__wbg_keyCode_065f5848e677fafd = function(arg0) { + const ret = arg0.keyCode; + return ret; + }; + imports.wbg.__wbg_key_32aa43e1cae08d29 = 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_8a42a70c9d48f5d1 = function(arg0) { + const ret = arg0.lastModified; + return ret; + }; + imports.wbg.__wbg_left_899de713c50d5346 = function(arg0) { + const ret = arg0.left; + return ret; + }; + imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_7ac941be82f614bb = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_7b84328ffb2e7b44 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_dc1fcbb3c4169df7 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_linkProgram_18ffcc2016a8ef92 = function(arg0, arg1) { + arg0.linkProgram(arg1); + }; + imports.wbg.__wbg_linkProgram_95ada1a5ea318894 = function(arg0, arg1) { + arg0.linkProgram(arg1); + }; + imports.wbg.__wbg_localStorage_3034501cd2b3da3f = function() { return handleError(function (arg0) { + const ret = arg0.localStorage; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_location_ef1665506d996dd9 = function(arg0) { + const ret = arg0.location; + return ret; + }; + imports.wbg.__wbg_matchMedia_711d65a9da8824cf = 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_52e77fafd1b3a974 = function(arg0) { + const ret = arg0.matches; + return ret; + }; + imports.wbg.__wbg_metaKey_5e1cfce6326629a8 = function(arg0) { + const ret = arg0.metaKey; + return ret; + }; + imports.wbg.__wbg_metaKey_a1cde9a816929936 = function(arg0) { + const ret = arg0.metaKey; + return ret; + }; + imports.wbg.__wbg_name_2922909227d511f5 = 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_971384882e8ea23a = function(arg0) { + const ret = arg0.navigator; + return ret; + }; + imports.wbg.__wbg_new_1acc0b6eea89d040 = function() { + const ret = new Object(); + return ret; + }; + imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) { + const ret = new Uint8Array(arg0); + return ret; + }; + imports.wbg.__wbg_new_85a4defe7ad17c22 = function() { + const ret = new Error(); + return ret; + }; + imports.wbg.__wbg_new_b909111eafced042 = function() { return handleError(function (arg0) { + const ret = new ResizeObserver(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_e17d9f43105b08be = function() { + const ret = new Array(); + return ret; + }; + imports.wbg.__wbg_new_from_slice_92f4d78ca282a2d2 = function(arg0, arg1) { + const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_new_with_record_from_str_to_blob_promise_cdef046f8d46ab5b = function() { return handleError(function (arg0) { + const ret = new ClipboardItem(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_with_u8_array_sequence_and_options_0c1d0bd56d93d25a = 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_f5ba683d8ce2c571 = function(arg0) { + const ret = arg0.now(); + return ret; + }; + imports.wbg.__wbg_observe_228709a845044950 = function(arg0, arg1, arg2) { + arg0.observe(arg1, arg2); + }; + imports.wbg.__wbg_of_035271b9e67a3bd9 = function(arg0) { + const ret = Array.of(arg0); + return ret; + }; + imports.wbg.__wbg_offsetTop_e7becacb6a76a499 = function(arg0) { + const ret = arg0.offsetTop; + return ret; + }; + imports.wbg.__wbg_open_2fa659dfc3f6d723 = 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_2b5e7986f349f4f3 = 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_7a3ffd0b17f663ad = function(arg0) { + const ret = arg0.performance; + return ret; + }; + imports.wbg.__wbg_performance_e8315b5ae987e93f = function(arg0) { + const ret = arg0.performance; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_pixelStorei_1e29a64e4b8b9b03 = function(arg0, arg1, arg2) { + arg0.pixelStorei(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_pixelStorei_bb82795e08644ed9 = function(arg0, arg1, arg2) { + arg0.pixelStorei(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_port_3600de3e4e460160 = 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_1f362670ce7ef430 = function(arg0) { + arg0.preventDefault(); + }; + imports.wbg.__wbg_protocol_3fa0fc2db8145bfb = 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_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) { + Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2); + }; + imports.wbg.__wbg_push_df81a39d04db858c = function(arg0, arg1) { + const ret = arg0.push(arg1); + return ret; + }; + imports.wbg.__wbg_queueMicrotask_34d692c25c47d05b = function(arg0) { + const ret = arg0.queueMicrotask; + return ret; + }; + imports.wbg.__wbg_queueMicrotask_9d76cacb20c84d58 = function(arg0) { + queueMicrotask(arg0); + }; + imports.wbg.__wbg_readPixels_0d03ebdf3d0d157c = 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_d2e13d1e3525be28 = 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_fe98362668ca0295 = 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_aa21ef619e743518 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.removeEventListener(getStringFromWasm0(arg1, arg2), arg3); + }, arguments) }; + imports.wbg.__wbg_remove_4ba46706a8e17d9d = function(arg0) { + arg0.remove(); + }; + imports.wbg.__wbg_requestAnimationFrame_7ecf8bfece418f08 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.requestAnimationFrame(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_resolve_caf97c30b83f7053 = function(arg0) { + const ret = Promise.resolve(arg0); + return ret; + }; + imports.wbg.__wbg_right_bec501ed000bfe81 = function(arg0) { + const ret = arg0.right; + return ret; + }; + imports.wbg.__wbg_scissor_486e259b969a99fa = function(arg0, arg1, arg2, arg3, arg4) { + arg0.scissor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_scissor_8dc97f3cd80c6d04 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.scissor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_search_86f864580e97479d = 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_9bad76f39609daac = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setItem_64dfb54d7b20d84c = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setProperty_7b188d7e71d4aca8 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setProperty(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_set_autofocus_b0877c61b61f9fb8 = function() { return handleError(function (arg0, arg1) { + arg0.autofocus = arg1 !== 0; + }, arguments) }; + imports.wbg.__wbg_set_box_5e651af64b5f1213 = function(arg0, arg1) { + arg0.box = __wbindgen_enum_ResizeObserverBoxOptions[arg1]; + }; + imports.wbg.__wbg_set_c2abbebe8b9ebee1 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = Reflect.set(arg0, arg1, arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_set_height_89110f48f7fd0817 = function(arg0, arg1) { + arg0.height = arg1 >>> 0; + }; + imports.wbg.__wbg_set_innerHTML_fb5a7e25198fc344 = function(arg0, arg1, arg2) { + arg0.innerHTML = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_once_6faa794a6bcd7d25 = function(arg0, arg1) { + arg0.once = arg1 !== 0; + }; + imports.wbg.__wbg_set_tabIndex_e7779a059c59f7d8 = function(arg0, arg1) { + arg0.tabIndex = arg1; + }; + imports.wbg.__wbg_set_type_3d1ac6cb9b3c2411 = function(arg0, arg1, arg2) { + arg0.type = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_type_63fa4c18251f6545 = function(arg0, arg1, arg2) { + arg0.type = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_value_1fd424cb99963707 = function(arg0, arg1, arg2) { + arg0.value = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_width_dcc02c61dd01cff6 = function(arg0, arg1) { + arg0.width = arg1 >>> 0; + }; + imports.wbg.__wbg_shaderSource_328f9044e2c98a85 = function(arg0, arg1, arg2, arg3) { + arg0.shaderSource(arg1, getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbg_shaderSource_3d2fab949529ee31 = function(arg0, arg1, arg2, arg3) { + arg0.shaderSource(arg1, getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbg_shiftKey_02a93ca3ce31a4f4 = function(arg0) { + const ret = arg0.shiftKey; + return ret; + }; + imports.wbg.__wbg_shiftKey_e0b189884cc0d006 = function(arg0) { + const ret = arg0.shiftKey; + return ret; + }; + imports.wbg.__wbg_size_0a5a003dbf5dfee8 = function(arg0) { + const ret = arg0.size; + return ret; + }; + imports.wbg.__wbg_stack_c4052f73ae6c538a = 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_89e1d9ac6a1b250e = function() { + const ret = typeof global === 'undefined' ? null : global; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() { + const ret = typeof globalThis === 'undefined' ? null : globalThis; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() { + const ret = typeof self === 'undefined' ? null : self; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() { + const ret = typeof window === 'undefined' ? null : window; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_stopPropagation_c77434a66c3604c3 = function(arg0) { + arg0.stopPropagation(); + }; + imports.wbg.__wbg_style_763a7ccfd47375da = function(arg0) { + const ret = arg0.style; + return ret; + }; + imports.wbg.__wbg_texImage2D_17fddf27ffd77cad = 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_c6af39a17286ae67 = 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_c83ec45089cb6aca = 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_20dfff54dc2efc8b = function(arg0, arg1, arg2, arg3) { + arg0.texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); + }; + imports.wbg.__wbg_texParameteri_b2871a22f57e806d = function(arg0, arg1, arg2, arg3) { + arg0.texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); + }; + imports.wbg.__wbg_texSubImage2D_1c1567eb7be0a2e3 = 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_4fe6aa0c7b8c95e7 = 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_7d74ab027406c91e = 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_4f46f6544e6b4a28 = function(arg0, arg1) { + const ret = arg0.then(arg1); + return ret; + }; + imports.wbg.__wbg_then_70d05cf780a18d77 = function(arg0, arg1, arg2) { + const ret = arg0.then(arg1, arg2); + return ret; + }; + imports.wbg.__wbg_top_e4eeead6b19051fb = function(arg0) { + const ret = arg0.top; + return ret; + }; + imports.wbg.__wbg_touches_bec8a0e164b02c16 = function(arg0) { + const ret = arg0.touches; + return ret; + }; + imports.wbg.__wbg_type_c146e3ebeb6d6284 = 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_d5d4dbe840f65b14 = 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_uniform1i_23e72424961ee8d0 = function(arg0, arg1, arg2) { + arg0.uniform1i(arg1, arg2); + }; + imports.wbg.__wbg_uniform1i_fe4307a416c7e7aa = function(arg0, arg1, arg2) { + arg0.uniform1i(arg1, arg2); + }; + imports.wbg.__wbg_uniform2f_24cdd97984906bea = function(arg0, arg1, arg2, arg3) { + arg0.uniform2f(arg1, arg2, arg3); + }; + imports.wbg.__wbg_uniform2f_587619767a15ed7e = function(arg0, arg1, arg2, arg3) { + arg0.uniform2f(arg1, arg2, arg3); + }; + imports.wbg.__wbg_useProgram_20101ed5f7e0d637 = function(arg0, arg1) { + arg0.useProgram(arg1); + }; + imports.wbg.__wbg_useProgram_3cc28f936528f842 = function(arg0, arg1) { + arg0.useProgram(arg1); + }; + imports.wbg.__wbg_userAgent_b20949aa6be940a6 = 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_f470db44e5a60ad8 = 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_316e3d795c40b758 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + arg0.vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + imports.wbg.__wbg_vertexAttribPointer_4c4826c855c381d0 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + arg0.vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + imports.wbg.__wbg_viewport_6e8b657130b529c0 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.viewport(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_viewport_774feeb955171e3d = function(arg0, arg1, arg2, arg3, arg4) { + arg0.viewport(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_warn_12614e45d4c01245 = function(arg0, arg1) { + console.warn(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbg_width_9ea2df52b5d2c909 = function(arg0) { + const ret = arg0.width; + return ret; + }; + imports.wbg.__wbg_width_d02e5c8cc6e335b7 = function(arg0) { + const ret = arg0.width; + return ret; + }; + imports.wbg.__wbg_writeText_0337219b13348e84 = function(arg0, arg1, arg2) { + const ret = arg0.writeText(getStringFromWasm0(arg1, arg2)); + return ret; + }; + imports.wbg.__wbg_write_9bf74e4aa45bf5d6 = function(arg0, arg1) { + const ret = arg0.write(arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) { + // Cast intrinsic for `Ref(String) -> Externref`. + const ret = getStringFromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_5658cff3a25dec6e = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 159, function: Function { arguments: [NamedExternref("Array")], shim_idx: 160, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0a3c9d3a09b22705, wasm_bindgen__convert__closures_____invoke__he1b801c09172a949); + return ret; + }; + imports.wbg.__wbindgen_cast_79ea827f7819c35d = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 274, function: Function { arguments: [Externref], shim_idx: 275, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h9766a4658f44191f, wasm_bindgen__convert__closures_____invoke__h85dfd1a0a1a675fd); + return ret; + }; + imports.wbg.__wbindgen_cast_7c316abdc43840a3 = function(arg0, arg1) { + // Cast intrinsic for `Ref(Slice(U32)) -> NamedExternref("Uint32Array")`. + const ret = getArrayU32FromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_9575fb55a66c262b = function(arg0, arg1) { + // Cast intrinsic for `Ref(Slice(I32)) -> NamedExternref("Int32Array")`. + const ret = getArrayI32FromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_9d76640d1cec14a9 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 159, function: Function { arguments: [NamedExternref("Event")], shim_idx: 160, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0a3c9d3a09b22705, wasm_bindgen__convert__closures_____invoke__he1b801c09172a949); + return ret; + }; + imports.wbg.__wbindgen_cast_bbb4883c6389f1de = function(arg0, arg1) { + // Cast intrinsic for `Ref(Slice(U16)) -> NamedExternref("Uint16Array")`. + const ret = getArrayU16FromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_bd6c40892cb35821 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 159, function: Function { arguments: [], shim_idx: 162, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0a3c9d3a09b22705, wasm_bindgen__convert__closures_____invoke__h116bbac12d4e3d34); + return ret; + }; + imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) { + // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`. + const ret = getArrayU8FromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_cd07b1914aa3d62c = function(arg0, arg1) { + // Cast intrinsic for `Ref(Slice(F32)) -> NamedExternref("Float32Array")`. + const ret = getArrayF32FromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_e47ceb6027f5c92c = function(arg0, arg1) { + // Cast intrinsic for `Ref(Slice(I16)) -> NamedExternref("Int16Array")`. + const ret = getArrayI16FromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_feefb5fadd6457fd = function(arg0, arg1) { + // Cast intrinsic for `Ref(Slice(I8)) -> NamedExternref("Int8Array")`. + const ret = getArrayI8FromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_externrefs; + 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); + ; + }; + + return imports; +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedDataViewMemory0 = null; + cachedFloat32ArrayMemory0 = null; + cachedInt16ArrayMemory0 = null; + cachedInt32ArrayMemory0 = null; + cachedInt8ArrayMemory0 = null; + cachedUint16ArrayMemory0 = null; + cachedUint32ArrayMemory0 = 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(); + + 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('message-box_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); + } + + 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/pages/message-box/dist/message-box-ce532c58cb981b7a_bg.wasm b/crates/pages/message-box/dist/message-box-ce532c58cb981b7a_bg.wasm new file mode 100644 index 0000000..a589a09 Binary files /dev/null and b/crates/pages/message-box/dist/message-box-ce532c58cb981b7a_bg.wasm differ diff --git a/crates/pages/message-box/src/app.rs.bak b/crates/pages/message-box/src/app.rs.bak new file mode 100644 index 0000000..4a2d0ad --- /dev/null +++ b/crates/pages/message-box/src/app.rs.bak @@ -0,0 +1,83 @@ +use pages_common::{Navbar, traits::Module}; +use crate::modules::PasscodeInfo; + +/// We derive Deserialize/Serialize so we can persist app state on shutdown. +#[derive(serde::Deserialize, serde::Serialize, Default)] +#[serde(default)] // if we add new fields, give them default values when deserializing old state +pub struct MessageBoxApp { + navbar: Navbar, + + // Message box app + message_box: MessageBox, + + // Displays QR code, password seed, and link information for saving + passcode_info: PasscodeInfo, + + // The selected view for display + page: PageView, +} + +#[derive(Debug, Default, serde::Deserialize, serde::Serialize)] +pub enum PageView { + #[default] + Welcome, + MessageBox, + PasscodeInfo, +} + +#[derive(Default, serde::Deserialize, serde::Serialize)] +struct MessageBox(()); + +impl MessageBoxApp { + pub fn new(cc: &eframe::CreationContext<'_>) -> Self { + // Load previous app state (if any). + // Note that you must enable the `persistence` feature for this to work. + if let Some(_storage) = cc.storage { + let navbar = Navbar::new(cc); + let message_box = MessageBox::default(); + let passcode_info = PasscodeInfo::new(cc); + let page = PageView::default(); + Self { + navbar, + message_box, + passcode_info, + page, + } + } else { + Default::default() + } + } + + fn welcome_page(&mut self, ctx: &egui::Context) { + egui::CentralPanel::default().show(ctx, |ui| { + ui.vertical_centered(|ui| { + ui.heading("Send me a message:"); + if ui.add(egui::Button::new("Generate New Key")).clicked() { + self.page = PageView::PasscodeInfo; + } + }); + + // return home + ui.vertical_centered(|ui| { + ui.hyperlink_to("back to home", "/"); + }); + }); + } +} + +impl eframe::App for MessageBoxApp { + /// Called by the framework to save state before shutdown. + fn save(&mut self, storage: &mut dyn eframe::Storage) { + self.navbar.save(storage); + } + + fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { + self.navbar.update(ctx); + + match self.page { + PageView::Welcome => self.welcome_page(ctx), + PageView::PasscodeInfo => self.passcode_info.update(ctx), + _ => (), // do nothing... + }; + } +} diff --git a/crates/pages/message-box/src/modules/passcode_info.rs.bak b/crates/pages/message-box/src/modules/passcode_info.rs.bak new file mode 100644 index 0000000..8a83926 --- /dev/null +++ b/crates/pages/message-box/src/modules/passcode_info.rs.bak @@ -0,0 +1,57 @@ +use egui::Widget; +use egui_qr::QrCodeWidget; +use pages_common::traits::Module; +use util::crypto::PublicKey; + +const USER_PUBLIC_KEY_STORAGE: &str = "user_pubkey_storage"; + +// FIXME: Grab this from env when building +const URL: &str = "https://zachery.lol/contact"; + +#[derive(Debug, Default, serde::Deserialize, serde::Serialize)] +pub struct PasscodeInfo { + public_key: String, +} + +impl Module for PasscodeInfo { + const STORAGE_KEY: &str = "passcode_info_storage_key"; + fn new(cc: &eframe::CreationContext<'_>) -> Self { + // get or set public key + let mut public_key = None; + if let Some(storage) = cc.storage { + if let Some(pk) = eframe::get_value(storage, USER_PUBLIC_KEY_STORAGE) { + public_key = Some(pk) + } + } + + Self { + public_key: public_key.unwrap_or_else(|| { + let key: PublicKey = message_tools::gen_keys::Keypair::new_random() + .pubkey_bytes() + .try_into() + .expect("Failed to generate keypair"); + key.to_string() + }), + } + } + fn update(&mut self, ctx: &egui::Context) { + egui::CentralPanel::default().show(ctx, |ui| { + let url = format!("{}?pubkey={}", URL, &self.public_key); + ui.label(&url); + ui.vertical_centered(|ui| { + ui.allocate_ui( + egui::Vec2 { x: 120.0, y: 120.0 }, + |ui| match QrCodeWidget::from_data(&url.as_bytes()) { + Ok(w) => w.ui(ui), + Err(e) => { + ui.label(format!("Failed to create QR code display. Error: {e:?}")) + } + }, + ); + }); + }); + } + fn save(&self, storage: &mut dyn eframe::Storage) { + eframe::set_value(storage, Self::STORAGE_KEY, self); + } +} diff --git a/routes/root/index.html b/routes/root/index.html index 12d296f..052f0de 100755 --- a/routes/root/index.html +++ b/routes/root/index.html @@ -6,17 +6,39 @@ -
-

Zachery Aaron Shores-Chmielewski

-
+ -