From 709a8d1c7cb5db40d2d499bb6eca26f7d19f855d Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Mon, 22 Jul 2024 13:30:07 -0400 Subject: [PATCH] latest --- Cargo.lock | 114 +++++++++++++++------------ Cargo.toml | 2 +- diesel-wasm-sqlite/Cargo.toml | 11 ++- diesel-wasm-sqlite/README.md | 12 +++ diesel-wasm-sqlite/esbuild.js | 4 + diesel-wasm-sqlite/package-lock.json | 15 +++- diesel-wasm-sqlite/package.js | 3 + diesel-wasm-sqlite/package.json | 3 +- diesel-wasm-sqlite/src/lib.rs | 46 +++++++---- diesel-wasm-sqlite/src/package.js | 4 +- diesel-wasm-sqlite/src/utils.rs | 10 +++ diesel-wasm-sqlite/tests/web.rs | 27 +++++++ 12 files changed, 179 insertions(+), 72 deletions(-) create mode 100644 diesel-wasm-sqlite/src/utils.rs create mode 100755 diesel-wasm-sqlite/tests/web.rs diff --git a/Cargo.lock b/Cargo.lock index 025898ae1..d77d862ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cipher", "cpufeatures", ] @@ -326,7 +326,7 @@ checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", @@ -547,6 +547,12 @@ dependencies = [ "libc", ] +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" @@ -559,7 +565,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cipher", "cpufeatures", ] @@ -756,7 +762,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen", ] @@ -766,7 +772,7 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "hex", "proptest", @@ -816,7 +822,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -958,7 +964,7 @@ version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", @@ -1074,14 +1080,17 @@ dependencies = [ [[package]] name = "diesel-wasm-sqlite" -version = "0.1.0" +version = "0.1.1" dependencies = [ + "console_error_panic_hook", "diesel", "getrandom", "log", "rand", "wasm-bindgen", "wasm-bindgen-test", + "web-sys", + "wee_alloc", ] [[package]] @@ -1156,7 +1165,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "dirs-sys-next", ] @@ -1329,7 +1338,7 @@ version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -1682,7 +1691,7 @@ version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "const-hex", "dirs", "dunce", @@ -1736,7 +1745,7 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc04871e5ae3aa2952d552dae6b291b3099723bf779a8054281c1366a54613ef" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "log", "serde", @@ -2023,7 +2032,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "libc", "wasi", @@ -2130,7 +2139,7 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crunchy", ] @@ -2622,7 +2631,7 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -2731,7 +2740,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92a55e0ff3b72c262bcf041d9e97f1b84492b68f1c1a384de2323d3dc9403397" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "ecdsa 0.15.1", "elliptic-curve 0.12.3", "once_cell", @@ -2745,7 +2754,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "ecdsa 0.16.9", "elliptic-curve 0.13.8", "once_cell", @@ -2936,7 +2945,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "digest 0.10.7", ] @@ -2946,6 +2955,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + [[package]] name = "migrations_internals" version = "2.2.0" @@ -3036,7 +3051,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "downcast", "fragile", "lazy_static", @@ -3051,7 +3066,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3383,7 +3398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.6.0", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", "libc", "once_cell", @@ -3517,7 +3532,7 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "instant", "libc", "redox_syscall 0.2.16", @@ -3531,7 +3546,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall 0.5.3", "smallvec", @@ -3849,7 +3864,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "opaque-debug", "universal-hash", @@ -4380,7 +4395,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if", + "cfg-if 1.0.0", "getrandom", "libc", "spin 0.9.8", @@ -4437,7 +4452,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290ca1a1c8ca7edb7c3283bd44dc35dd54fdec6253a3912e201ba1072018fca8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "proc-macro2", "quote", "rustc_version", @@ -4635,7 +4650,7 @@ version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "derive_more", "parity-scale-codec", "scale-info-derive", @@ -4844,7 +4859,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest 0.10.7", ] @@ -4856,7 +4871,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -4868,7 +4883,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest 0.10.7", ] @@ -5238,7 +5253,7 @@ version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand", "rustix", "windows-sys 0.52.0", @@ -5270,21 +5285,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" -[[package]] -name = "test-wasm" -version = "0.1.0" -dependencies = [ - "chrono", - "diesel", - "diesel-wasm-sqlite", - "getrandom", - "rand", - "serde", - "wasm-bindgen", - "wasm-bindgen-test", - "web-sys", -] - [[package]] name = "thiserror" version = "1.0.63" @@ -5311,7 +5311,7 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "once_cell", ] @@ -6074,7 +6074,7 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "serde", "serde_json", "wasm-bindgen-macro", @@ -6101,7 +6101,7 @@ version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -6208,6 +6208,18 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + [[package]] name = "which" version = "4.4.2" @@ -6423,7 +6435,7 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] @@ -6433,7 +6445,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] diff --git a/Cargo.toml b/Cargo.toml index 262d5f577..78f19303c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ "xmtp_user_preferences", "xmtp_v2", "xmtp_mls", - "xmtp_id", "diesel-wasm-sqlite", "examples/test-wasm", + "xmtp_id", "diesel-wasm-sqlite" ] exclude = [ diff --git a/diesel-wasm-sqlite/Cargo.toml b/diesel-wasm-sqlite/Cargo.toml index c8fba4f7f..48ccd0ccd 100644 --- a/diesel-wasm-sqlite/Cargo.toml +++ b/diesel-wasm-sqlite/Cargo.toml @@ -1,17 +1,26 @@ [package] name = "diesel-wasm-sqlite" -version = "0.1.0" +version = "0.1.1" edition = "2021" [dependencies] diesel = { git = "https://github.com/xmtp/diesel", branch = "insipx/wasm-backend", features = ["r2d2", "i-implement-a-third-party-backend-and-opt-into-breaking-changes"] } wasm-bindgen = "0.2" log = "0.4" +rand = "0.8" +getrandom = { version = "0.2", features = ["js"] } +wee_alloc = { version = "0.4.2", optional = true } +console_error_panic_hook = { version = "0.1", optional = true } [dev-dependencies] rand = "0.8" getrandom = { version = "0.2", features = ["js"] } wasm-bindgen-test = "0.3" +web-sys = { version = "0.3", features = ["console"] } + [lib] crate-type = ["cdylib", "rlib"] + +[features] +default = ["console_error_panic_hook"] diff --git a/diesel-wasm-sqlite/README.md b/diesel-wasm-sqlite/README.md index d30161ad3..57e36feb7 100644 --- a/diesel-wasm-sqlite/README.md +++ b/diesel-wasm-sqlite/README.md @@ -1 +1,13 @@ # Custom Diesel Backend for Wasm wa-sqlite + +#### Bundle the javascript in `package.js` to rust + +`npm run esbuild` + +#### Build the JS WASM interface + +`wasm-pack build` + +#### Run the Wasm Tests + +wasm-pack test --safari --headless diff --git a/diesel-wasm-sqlite/esbuild.js b/diesel-wasm-sqlite/esbuild.js index 00164c0c4..d85602232 100644 --- a/diesel-wasm-sqlite/esbuild.js +++ b/diesel-wasm-sqlite/esbuild.js @@ -1,9 +1,13 @@ const esbuild = require("esbuild"); +const { wasmLoader } = require("esbuild-plugin-wasm"); esbuild.build({ entryPoints: ["package.js"], bundle: true, outfile: "src/package.js", + plugins: [ + wasmLoader(), + ], format: "esm", minify: true, }).catch(() => process.exit(1)); diff --git a/diesel-wasm-sqlite/package-lock.json b/diesel-wasm-sqlite/package-lock.json index ab3a8e219..d592b6d5b 100644 --- a/diesel-wasm-sqlite/package-lock.json +++ b/diesel-wasm-sqlite/package-lock.json @@ -10,7 +10,8 @@ "license": "ISC", "dependencies": { "@xmtp/wa-sqlite": "^1.0.1", - "esbuild": "^0.23.0" + "esbuild": "^0.23.0", + "esbuild-plugin-wasm": "^1.1.0" } }, "node_modules/@esbuild/aix-ppc64": { @@ -415,6 +416,18 @@ "@esbuild/win32-ia32": "0.23.0", "@esbuild/win32-x64": "0.23.0" } + }, + "node_modules/esbuild-plugin-wasm": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/esbuild-plugin-wasm/-/esbuild-plugin-wasm-1.1.0.tgz", + "integrity": "sha512-0bQ6+1tUbySSnxzn5jnXHMDvYnT0cN/Wd4Syk8g/sqAIJUg7buTIi22svS3Qz6ssx895NT+TgLPb33xi1OkZig==", + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "individual", + "url": "https://ko-fi.com/tschrock" + } } } } diff --git a/diesel-wasm-sqlite/package.js b/diesel-wasm-sqlite/package.js index fa23e127f..0f738e93a 100644 --- a/diesel-wasm-sqlite/package.js +++ b/diesel-wasm-sqlite/package.js @@ -1,7 +1,10 @@ import * as SQLite from "@xmtp/wa-sqlite"; import initModule from "@xmtp/wa-sqlite/build"; +const module = await initModule(); const sqlite3 = SQLite.Factory(module); +const vfs = await OPFSCoopSyncVFS.create("test", module); +sqlite3.vfs_register(vfs, true); export function sqlite3_result_text(context, value) { sqlite3.result_text(context, value); diff --git a/diesel-wasm-sqlite/package.json b/diesel-wasm-sqlite/package.json index 9709463a6..196f0c535 100644 --- a/diesel-wasm-sqlite/package.json +++ b/diesel-wasm-sqlite/package.json @@ -11,6 +11,7 @@ "license": "ISC", "dependencies": { "@xmtp/wa-sqlite": "^1.0.1", - "esbuild": "^0.23.0" + "esbuild": "^0.23.0", + "esbuild-plugin-wasm": "^1.1.0" } } diff --git a/diesel-wasm-sqlite/src/lib.rs b/diesel-wasm-sqlite/src/lib.rs index 0d3f07afe..668c8ea8e 100644 --- a/diesel-wasm-sqlite/src/lib.rs +++ b/diesel-wasm-sqlite/src/lib.rs @@ -4,6 +4,7 @@ pub mod connection; pub mod ffi; pub mod query_builder; pub mod sqlite_types; +pub mod utils; use diesel::{ connection::{AnsiTransactionManager, Instrumentation, SimpleConnection, TransactionManager}, @@ -11,7 +12,7 @@ use diesel::{ result::QueryResult, Connection, }; -use wasm_bindgen::JsValue; +use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; pub use backend::{SqliteType, WasmSqlite}; @@ -68,6 +69,18 @@ impl Connection for WasmSqliteConnection { } } +#[wasm_bindgen(js_name = establishDbConnection)] +pub fn establish_db_connection() { + let rng: u16 = rand::random(); + let url = format!( + "{}/wasmtest-{}.db3", + std::env::temp_dir().to_str().unwrap(), + rng + ); + let conn = WasmSqliteConnection::establish(&url).unwrap(); + println!("{:?}", conn); +} + impl From for diesel::result::Error { fn from(value: WasmSqliteError) -> diesel::result::Error { log::error!("NOT IMPLEMENTED, {:?}", value); @@ -88,21 +101,24 @@ impl From for WasmSqliteError { } } -#[cfg(test)] -mod test { +/* +mod tests { use super::*; use wasm_bindgen_test::wasm_bindgen_test; + use web_sys::console; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); - - #[wasm_bindgen_test] - fn test_establish() { - let rng: u16 = rand::random(); - let url = format!( - "{}/wasmtest-{}.db3", - std::env::temp_dir().to_str().unwrap(), - rng - ); - let mut conn = WasmSqliteConnection::establish(&url).unwrap(); - println!("{:?}", conn); - } + /* + #[wasm_bindgen_test] + fn test_establish() { + let rng: u16 = rand::random(); + let url = format!( + "{}/wasmtest-{}.db3", + std::env::temp_dir().to_str().unwrap(), + rng + ); + let mut conn = WasmSqliteConnection::establish(&url).unwrap(); + println!("{:?}", conn); + } + */ } +*/ diff --git a/diesel-wasm-sqlite/src/package.js b/diesel-wasm-sqlite/src/package.js index a6d80be28..3be63470c 100644 --- a/diesel-wasm-sqlite/src/package.js +++ b/diesel-wasm-sqlite/src/package.js @@ -1,2 +1,2 @@ -var gt=0x7fffffffffffffffn,It=-0x8000000000000000n,Lt=Object.getPrototypeOf(async function(){}).constructor,ue=class extends Error{constructor(p,K){super(p),this.code=K}},Se=!0;function xt(m){let p={};m.retryOps=[];let K=m._getSqliteFree(),n=m._malloc(8),ie=[n,n+4];function te(d){if(typeof d!="string")return 0;let f=new TextEncoder().encode(d),u=m._sqlite3_malloc(f.byteLength+1);return m.HEAPU8.set(f,u),m.HEAPU8[u+f.byteLength]=0,u}function he(d,f){return BigInt(f)<<32n|BigInt(d)&0xffffffffn}let ge=function(){let d=BigInt(Number.MAX_SAFE_INTEGER)>>32n,f=BigInt(Number.MIN_SAFE_INTEGER)>>32n;return function(u,v){return v>d||v2147483647||q<-2147483648)return 25;let w=f(u,v,q);return B(d,w,G.get(u))}}(),p.bind_int64=function(){let d="sqlite3_bind_int64",f=m.cwrap(d,...I("nnnn:n"));return function(u,v,q){if(F(u),q>gt||q>32n,D=f(u,v,Number(w),Number(R));return B(d,D,G.get(u))}}(),p.bind_null=function(){let d="sqlite3_bind_null",f=m.cwrap(d,...I("nn:n"));return function(u,v){F(u);let q=f(u,v);return B(d,q,G.get(u))}}(),p.bind_parameter_name=function(){let f=m.cwrap("sqlite3_bind_parameter_name",...I("n:s"));return function(u,v){return F(u),f(u,v)}}(),p.bind_text=function(){let d="sqlite3_bind_text",f=m.cwrap(d,...I("nnnnn:n"));return function(u,v,q){F(u);let w=te(q),R=f(u,v,w,-1,K);return B(d,R,G.get(u))}}(),p.changes=function(){let f=m.cwrap("sqlite3_changes",...I("n:n"));return function(u){return fe(u),f(u)}}(),p.close=function(){let d="sqlite3_close",f=m.cwrap(d,...I("n:n"),{async:Se});return async function(u){fe(u);let v=await f(u);return re.delete(u),B(d,v,u)}}(),p.column=function(d,f){F(d);let u=p.column_type(d,f);switch(u){case 4:return p.column_blob(d,f);case 2:return p.column_double(d,f);case 1:let v=p.column_int(d,f),q=m.getTempRet0();return ge(v,q);case 5:return null;case 3:return p.column_text(d,f);default:throw new ue("unknown type",u)}},p.column_blob=function(){let f=m.cwrap("sqlite3_column_blob",...I("nn:n"));return function(u,v){F(u);let q=p.column_bytes(u,v),w=f(u,v);return m.HEAPU8.subarray(w,w+q)}}(),p.column_bytes=function(){let f=m.cwrap("sqlite3_column_bytes",...I("nn:n"));return function(u,v){return F(u),f(u,v)}}(),p.column_count=function(){let f=m.cwrap("sqlite3_column_count",...I("n:n"));return function(u){return F(u),f(u)}}(),p.column_double=function(){let f=m.cwrap("sqlite3_column_double",...I("nn:n"));return function(u,v){return F(u),f(u,v)}}(),p.column_int=function(){let f=m.cwrap("sqlite3_column_int64",...I("nn:n"));return function(u,v){return F(u),f(u,v)}}(),p.column_int64=function(){let f=m.cwrap("sqlite3_column_int64",...I("nn:n"));return function(u,v){F(u);let q=f(u,v),w=m.getTempRet0();return he(q,w)}}(),p.column_name=function(){let f=m.cwrap("sqlite3_column_name",...I("nn:s"));return function(u,v){return F(u),f(u,v)}}(),p.column_names=function(d){let f=[],u=p.column_count(d);for(let v=0;vk(C,m.HEAP32.subarray(Z/4,Z/4+U)):(C,U,Z)=>k(C,m.HEAP32.subarray(Z/4,Z/4+U))}let j=m.create_function(d,f,u,v,q,w&&W(w),R&&W(R),D);return B("sqlite3_create_function",j,d)},p.data_count=function(){let f=m.cwrap("sqlite3_data_count",...I("n:n"));return function(u){return F(u),f(u)}}(),p.exec=async function(d,f,u){for await(let v of p.statements(d,f)){let q;for(;await p.step(v)===100;)if(u){q=q??p.column_names(v);let w=p.row(v);await u(w,q)}}return 0},p.finalize=function(){let f=m.cwrap("sqlite3_finalize",...I("n:n"),{async:Se});return async function(u){let v=await f(u);return G.delete(u),v}}(),p.get_autocommit=function(){let f=m.cwrap("sqlite3_get_autocommit",...I("n:n"));return function(u){return f(u)}}(),p.libversion=function(){let f=m.cwrap("sqlite3_libversion",...I(":s"));return function(){return f()}}(),p.libversion_number=function(){let f=m.cwrap("sqlite3_libversion_number",...I(":n"));return function(){return f()}}(),p.limit=function(){let f=m.cwrap("sqlite3_limit",...I("nnn:n"));return function(u,v,q){return f(u,v,q)}}(),p.open_v2=function(){let d="sqlite3_open_v2",f=m.cwrap(d,...I("snnn:n"),{async:Se});return async function(u,v,q){v=v||6,q=te(q);try{let w=await ae(()=>f(u,ie[0],v,q)),R=m.getValue(ie[0],"*");return re.add(R),m.ccall("RegisterExtensionFunctions","void",["number"],[R]),B(d,w),R}finally{m._sqlite3_free(q)}}}(),p.progress_handler=function(d,f,u,v){fe(d),m.progress_handler(d,f,u,v)},p.reset=function(){let d="sqlite3_reset",f=m.cwrap(d,...I("n:n"),{async:Se});return async function(u){F(u);let v=await f(u);return B(d,v,G.get(u))}}(),p.result=function(d,f){switch(typeof f){case"number":f===(f|0)?p.result_int(d,f):p.result_double(d,f);break;case"string":p.result_text(d,f);break;default:if(f instanceof Uint8Array||Array.isArray(f))p.result_blob(d,f);else if(f===null)p.result_null(d);else{if(typeof f=="bigint")return p.result_int64(d,f);console.warn("unknown result converted to null",f),p.result_null(d)}break}},p.result_blob=function(){let f=m.cwrap("sqlite3_result_blob",...I("nnnn:n"));return function(u,v){let q=v.byteLength??v.length,w=m._sqlite3_malloc(q);m.HEAPU8.subarray(w).set(v),f(u,w,q,K)}}(),p.result_double=function(){let f=m.cwrap("sqlite3_result_double",...I("nn:n"));return function(u,v){f(u,v)}}(),p.result_int=function(){let f=m.cwrap("sqlite3_result_int",...I("nn:n"));return function(u,v){f(u,v)}}(),p.result_int64=function(){let f=m.cwrap("sqlite3_result_int64",...I("nnn:n"));return function(u,v){if(v>gt||v>32n;f(u,Number(q),Number(w))}}(),p.result_null=function(){let f=m.cwrap("sqlite3_result_null",...I("n:n"));return function(u){f(u)}}(),p.result_text=function(){let f=m.cwrap("sqlite3_result_text",...I("nnnn:n"));return function(u,v){let q=te(v);f(u,q,-1,K)}}(),p.row=function(d){let f=[],u=p.data_count(d);for(let v=0;vR(v(D,W,j,k,C,U)):(D,W,j,k,C,U)=>R(v(D,W,j,k,C,U))}let w=m.set_authorizer(d,q(f),u);return B("sqlite3_set_authorizer",w,d)},p.sql=function(){let f=m.cwrap("sqlite3_sql",...I("n:s"));return function(u){return F(u),f(u)}}(),p.statements=function(d,f,u={}){let v=m.cwrap("sqlite3_prepare_v3","number",["number","number","number","number","number","number"],{async:!0});return async function*(){let q=[];try{let U=function(){C&&!u.unscoped&&p.finalize(C),C=0},w=new TextEncoder().encode(f),R=w.byteLength-w.byteLength%4+12,D=m._sqlite3_malloc(R),W=D+w.byteLength+1;q.push(()=>m._sqlite3_free(D)),m.HEAPU8.set(w,D),m.HEAPU8[W-1]=0;let j=D+R-8,k=D+R-4,C;q.push(U),m.setValue(k,D,"*");do{U();let Z=m.getValue(k,"*"),y=await ae(()=>v(d,Z,W-k,u.flags||0,j,k));y!==0&&B("sqlite3_prepare_v3",y,d),C=m.getValue(j,"*"),C&&(G.set(C,d),yield C)}while(C)}finally{for(;q.length;)q.pop()()}}()},p.step=function(){let d="sqlite3_step",f=m.cwrap(d,...I("n:n"),{async:Se});return async function(u){F(u);let v=await ae(()=>f(u));return B(d,v,G.get(u),[100,101])}}(),p.value=function(d){let f=p.value_type(d);switch(f){case 4:return p.value_blob(d);case 2:return p.value_double(d);case 1:let u=p.value_int(d),v=m.getTempRet0();return ge(u,v);case 5:return null;case 3:return p.value_text(d);default:throw new ue("unknown type",f)}},p.value_blob=function(){let f=m.cwrap("sqlite3_value_blob",...I("n:n"));return function(u){let v=p.value_bytes(u),q=f(u);return m.HEAPU8.subarray(q,q+v)}}(),p.value_bytes=function(){let f=m.cwrap("sqlite3_value_bytes",...I("n:n"));return function(u){return f(u)}}(),p.value_double=function(){let f=m.cwrap("sqlite3_value_double",...I("n:n"));return function(u){return f(u)}}(),p.value_int=function(){let f=m.cwrap("sqlite3_value_int64",...I("n:n"));return function(u){return f(u)}}(),p.value_int64=function(){let f=m.cwrap("sqlite3_value_int64",...I("n:n"));return function(u){let v=f(u),q=m.getTempRet0();return he(v,q)}}(),p.value_text=function(){let f=m.cwrap("sqlite3_value_text",...I("n:s"));return function(u){return f(u)}}(),p.value_type=function(){let f=m.cwrap("sqlite3_value_type",...I("n:n"));return function(u){return f(u)}}(),p.vfs_register=function(d,f){let u=m.vfs_register(d,f);return B("sqlite3_vfs_register",u)};function B(d,f,u=null,v=[0]){if(v.includes(f))return f;let q=u?m.ccall("sqlite3_errmsg","string",["number"],[u]):d;throw new ue(q,f)}async function ae(d){let f;do m.retryOps.length&&(await Promise.all(m.retryOps),m.retryOps=[]),f=await d();while(f&&m.retryOps.length);return f}return p}function I(m){let p=[],K=m.match(/([ns@]*):([nsv@])/);switch(K[2]){case"n":p.push("number");break;case"s":p.push("string");break;case"v":p.push(null);break}let n=[];for(let ie of K[1])switch(ie){case"n":n.push("number");break;case"s":n.push("string");break}return p.push(n),p}var Ga=(()=>{var m=import.meta.url;return function(p={}){var K,n=p,ie,te,he=new Promise((e,t)=>{ie=e,te=t}),ge=typeof window=="object",re=typeof importScripts=="function",fe=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",G=Object.assign({},n),F=[],B="./this.program",ae=(e,t)=>{throw t},d="";function f(e){return n.locateFile?n.locateFile(e,d):d+e}var u,v;(ge||re)&&(re?d=self.location.href:typeof document<"u"&&document.currentScript&&(d=document.currentScript.src),m&&(d=m),d.startsWith("blob:")?d="":d=d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1),re&&(v=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),u=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var q=n.print||console.log.bind(console),w=n.printErr||console.error.bind(console);Object.assign(n,G),G=null,n.arguments&&(F=n.arguments),n.thisProgram&&(B=n.thisProgram),n.quit&&(ae=n.quit);var R;n.wasmBinary&&(R=n.wasmBinary);var D,W=!1,j,k,C,U,Z,y,z,Oe,Qe;function He(){var e=D.buffer;n.HEAP8=k=new Int8Array(e),n.HEAP16=U=new Int16Array(e),n.HEAPU8=C=new Uint8Array(e),n.HEAPU16=Z=new Uint16Array(e),n.HEAP32=y=new Int32Array(e),n.HEAPU32=z=new Uint32Array(e),n.HEAPF32=Oe=new Float32Array(e),n.HEAPF64=Qe=new Float64Array(e)}var We=[],je=[],At=[],Ge=[],Nt=!1;function Rt(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Ct(n.preRun.shift());xe(We)}function kt(){Nt=!0,!n.noFSInit&&!s.init.initialized&&s.init(),s.ignorePermissions=!1,_e.init(),xe(je)}function Ot(){xe(At)}function Qt(){if(n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)Pt(n.postRun.shift());xe(Ge)}function Ct(e){We.unshift(e)}function Ft(e){je.unshift(e)}function Pt(e){Ge.unshift(e)}var le=0,Ce=null,be=null;function Ha(e){return e}function Fe(e){le++,n.monitorRunDependencies?.(le)}function Ie(e){if(le--,n.monitorRunDependencies?.(le),le==0&&(Ce!==null&&(clearInterval(Ce),Ce=null),be)){var t=be;be=null,t()}}function ne(e){n.onAbort?.(e),e="Aborted("+e+")",w(e),W=!0,j=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw te(t),t}var Dt="data:application/octet-stream;base64,",Ke=e=>e.startsWith(Dt);function Mt(){if(n.locateFile){var e="wa-sqlite.wasm";return Ke(e)?e:f(e)}return new URL("wa-sqlite.wasm",import.meta.url).href}var Le;function Xe(e){if(e==Le&&R)return new Uint8Array(R);if(v)return v(e);throw"both async and sync fetching of the wasm failed"}function Ut(e){return R?Promise.resolve().then(()=>Xe(e)):u(e).then(t=>new Uint8Array(t),()=>Xe(e))}function Ve(e,t,r){return Ut(e).then(_=>WebAssembly.instantiate(_,t)).then(r,_=>{w(`failed to asynchronously prepare wasm: ${_}`),ne(_)})}function zt(e,t,r,_){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Ke(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(o=>{var a=WebAssembly.instantiateStreaming(o,r);return a.then(_,function(l){return w(`wasm streaming compile failed: ${l}`),w("falling back to ArrayBuffer instantiation"),Ve(t,r,_)})}):Ve(t,r,_)}function Bt(){return{a:jn}}function Ht(){var e=Bt();function t(_,o){return i=_.exports,D=i.ja,He(),ve=i.af,Ft(i.ka),Ie("wasm-instantiate"),i}Fe("wasm-instantiate");function r(_){t(_.instance)}if(n.instantiateWasm)try{return n.instantiateWasm(e,t)}catch(_){w(`Module.instantiateWasm callback failed with error: ${_}`),te(_)}return Le||(Le=Mt()),zt(R,Le,e,r).catch(te),{}}var S,P;function Ye(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var xe=e=>{for(;e.length>0;)e.shift()(n)};function $e(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":return k[e];case"i8":return k[e];case"i16":return U[e>>1];case"i32":return y[e>>2];case"i64":ne("to do getValue(i64) use WASM_BIGINT");case"float":return Oe[e>>2];case"double":return Qe[e>>3];case"*":return z[e>>2];default:ne(`invalid type for getValue: ${t}`)}}var Wt=n.noExitRuntime||!0;function Ae(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":k[e]=t;break;case"i8":k[e]=t;break;case"i16":U[e>>1]=t;break;case"i32":y[e>>2]=t;break;case"i64":ne("to do setValue(i64) use WASM_BIGINT");case"float":Oe[e>>2]=t;break;case"double":Qe[e>>3]=t;break;case"*":z[e>>2]=t;break;default:ne(`invalid type for setValue: ${r}`)}}var jt=e=>dt(e),Gt=()=>vt(),Ze=typeof TextDecoder<"u"?new TextDecoder:void 0,de=(e,t,r)=>{for(var _=t+r,o=t;e[o]&&!(o>=_);)++o;if(o-t>16&&e.buffer&&Ze)return Ze.decode(e.subarray(t,o));for(var a="";t>10,56320|h&1023)}}return a},ce=(e,t)=>e?de(C,e,t):"",Kt=(e,t,r,_)=>{ne(`Assertion failed: ${ce(e)}, at: `+[t?ce(t):"unknown filename",r,_?ce(_):"unknown function"])},Q={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var r=0,_=e.length-1;_>=0;_--){var o=e[_];o==="."?e.splice(_,1):o===".."?(e.splice(_,1),r++):r&&(e.splice(_,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=Q.isAbs(e),r=e.substr(-1)==="/";return e=Q.normalizeArray(e.split("/").filter(_=>!!_),!t).join("/"),!e&&!t&&(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=Q.splitPath(e),r=t[0],_=t[1];return!r&&!_?".":(_&&(_=_.substr(0,_.length-1)),r+_)},basename:e=>{if(e==="/")return"/";e=Q.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>Q.normalize(e.join("/")),join2:(e,t)=>Q.normalize(e+"/"+t)},Xt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);ne("initRandomDevice")},Je=e=>(Je=Xt())(e),ee={resolve:(...e)=>{for(var t="",r=!1,_=e.length-1;_>=-1&&!r;_--){var o=_>=0?e[_]:s.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";t=o+"/"+t,r=Q.isAbs(o)}return t=Q.normalizeArray(t.split("/").filter(a=>!!a),!r).join("/"),(r?"/":"")+t||"."},relative:(e,t)=>{e=ee.resolve(e).substr(1),t=ee.resolve(t).substr(1);function r(h){for(var g=0;g=0&&h[A]==="";A--);return g>A?[]:h.slice(g,A-g+1)}for(var _=r(e.split("/")),o=r(t.split("/")),a=Math.min(_.length,o.length),l=a,c=0;c{for(var t=0,r=0;r=55296&&_<=57343?(t+=4,++r):t+=3}return t},De=(e,t,r,_)=>{if(!(_>0))return 0;for(var o=r,a=r+_-1,l=0;l=55296&&c<=57343){var E=e.charCodeAt(++l);c=65536+((c&1023)<<10)|E&1023}if(c<=127){if(r>=a)break;t[r++]=c}else if(c<=2047){if(r+1>=a)break;t[r++]=192|c>>6,t[r++]=128|c&63}else if(c<=65535){if(r+2>=a)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|c&63}else{if(r+3>=a)break;t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|c&63}}return t[r]=0,r-o};function Me(e,t,r){var _=r>0?r:pe(e)+1,o=new Array(_),a=De(e,o,0,o.length);return t&&(o.length=a),o}var Vt=()=>{if(!Pe.length){var e=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=` -`)),!e)return null;Pe=Me(e,!0)}return Pe.shift()},_e={ttys:[],init(){},shutdown(){},register(e,t){_e.ttys[e]={input:[],output:[],ops:t},s.registerDevice(e,_e.stream_ops)},stream_ops:{open(e){var t=_e.ttys[e.node.rdev];if(!t)throw new s.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,_,o){if(!e.tty||!e.tty.ops.get_char)throw new s.ErrnoError(60);for(var a=0,l=0;l<_;l++){var c;try{c=e.tty.ops.get_char(e.tty)}catch{throw new s.ErrnoError(29)}if(c===void 0&&a===0)throw new s.ErrnoError(6);if(c==null)break;a++,t[r+l]=c}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,_,o){if(!e.tty||!e.tty.ops.put_char)throw new s.ErrnoError(60);try{for(var a=0;a<_;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch{throw new s.ErrnoError(29)}return _&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char(e){return Vt()},put_char(e,t){t===null||t===10?(q(de(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(q(de(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,t,r){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(w(de(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(w(de(e.output,0)),e.output=[])}}},Yt=(e,t)=>(C.fill(0,e,e+t),e),$t=(e,t)=>Math.ceil(e/t)*t,et=e=>{e=$t(e,65536);var t=ut(65536,e);return t?Yt(t,e):0},L={ops_table:null,mount(e){return L.createNode(null,"/",16895,0)},createNode(e,t,r,_){if(s.isBlkdev(r)||s.isFIFO(r))throw new s.ErrnoError(63);L.ops_table||={dir:{node:{getattr:L.node_ops.getattr,setattr:L.node_ops.setattr,lookup:L.node_ops.lookup,mknod:L.node_ops.mknod,rename:L.node_ops.rename,unlink:L.node_ops.unlink,rmdir:L.node_ops.rmdir,readdir:L.node_ops.readdir,symlink:L.node_ops.symlink},stream:{llseek:L.stream_ops.llseek}},file:{node:{getattr:L.node_ops.getattr,setattr:L.node_ops.setattr},stream:{llseek:L.stream_ops.llseek,read:L.stream_ops.read,write:L.stream_ops.write,allocate:L.stream_ops.allocate,mmap:L.stream_ops.mmap,msync:L.stream_ops.msync}},link:{node:{getattr:L.node_ops.getattr,setattr:L.node_ops.setattr,readlink:L.node_ops.readlink},stream:{}},chrdev:{node:{getattr:L.node_ops.getattr,setattr:L.node_ops.setattr},stream:s.chrdev_stream_ops}};var o=s.createNode(e,t,r,_);return s.isDir(o.mode)?(o.node_ops=L.ops_table.dir.node,o.stream_ops=L.ops_table.dir.stream,o.contents={}):s.isFile(o.mode)?(o.node_ops=L.ops_table.file.node,o.stream_ops=L.ops_table.file.stream,o.usedBytes=0,o.contents=null):s.isLink(o.mode)?(o.node_ops=L.ops_table.link.node,o.stream_ops=L.ops_table.link.stream):s.isChrdev(o.mode)&&(o.node_ops=L.ops_table.chrdev.node,o.stream_ops=L.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){var _=1024*1024;t=Math.max(t,r*(r<_?2:1.125)>>>0),r!=0&&(t=Math.max(t,256));var o=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=s.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,s.isDir(e.mode)?t.size=4096:s.isFile(e.mode)?t.size=e.usedBytes:s.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&L.resizeFileStorage(e,t.size)},lookup(e,t){throw s.genericErrors[44]},mknod(e,t,r,_){return L.createNode(e,t,r,_)},rename(e,t,r){if(s.isDir(e.mode)){var _;try{_=s.lookupNode(t,r)}catch{}if(_)for(var o in _.contents)throw new s.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=s.lookupNode(e,t);for(var _ in r.contents)throw new s.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var _=L.createNode(e,t,41471,0);return _.link=r,_},readlink(e){if(!s.isLink(e.mode))throw new s.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,_,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var l=Math.min(e.node.usedBytes-o,_);if(l>8&&a.subarray)t.set(a.subarray(o,o+l),r);else for(var c=0;c0||r+t{var o=_?"":`al ${e}`;u(e).then(a=>{t(new Uint8Array(a)),o&&Ie(o)},a=>{if(r)r();else throw`Loading data file "${e}" failed.`}),o&&Fe(o)},Jt=(e,t,r,_,o,a)=>{s.createDataFile(e,t,r,_,o,a)},er=n.preloadPlugins||[],tr=(e,t,r,_)=>{typeof Browser<"u"&&Browser.init();var o=!1;return er.forEach(a=>{o||a.canHandle(t)&&(a.handle(e,t,r,_),o=!0)}),o},rr=(e,t,r,_,o,a,l,c,E,h)=>{var g=t?ee.resolve(Q.join2(e,t)):e,A=`cp ${g}`;function x(T){function b(M){h?.(),c||Jt(e,t,M,_,o,E),a?.(),Ie(A)}tr(T,g,b,()=>{l?.(),Ie(A)})||b(T)}Fe(A),typeof r=="string"?Zt(r,x,l):x(r)},nr=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},r=t[e];if(typeof r>"u")throw new Error(`Unknown file open mode: ${e}`);return r},Ue=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},s={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,r,_){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=s.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=_,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return s.isDir(this.mode)}get isDevice(){return s.isChrdev(this.mode)}},lookupPath(e,t={}){if(e=ee.resolve(e),!e)return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};if(t=Object.assign(r,t),t.recurse_count>8)throw new s.ErrnoError(32);for(var _=e.split("/").filter(A=>!!A),o=s.root,a="/",l=0;l<_.length;l++){var c=l===_.length-1;if(c&&t.parent)break;if(o=s.lookupNode(o,_[l]),a=Q.join2(a,_[l]),s.isMountpoint(o)&&(!c||c&&t.follow_mount)&&(o=o.mounted.root),!c||t.follow)for(var E=0;s.isLink(o.mode);){var h=s.readlink(a);a=ee.resolve(Q.dirname(a),h);var g=s.lookupPath(a,{recurse_count:t.recurse_count+1});if(o=g.node,E++>40)throw new s.ErrnoError(32)}}return{path:a,node:o}},getPath(e){for(var t;;){if(s.isRoot(e)){var r=e.mount.mountpoint;return t?r[r.length-1]!=="/"?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,_=0;_>>0)%s.nameTable.length},hashAddNode(e){var t=s.hashName(e.parent.id,e.name);e.name_next=s.nameTable[t],s.nameTable[t]=e},hashRemoveNode(e){var t=s.hashName(e.parent.id,e.name);if(s.nameTable[t]===e)s.nameTable[t]=e.name_next;else for(var r=s.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=s.mayLookup(e);if(r)throw new s.ErrnoError(r);for(var _=s.hashName(e.id,t),o=s.nameTable[_];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return s.lookup(e,t)},createNode(e,t,r,_){var o=new s.FSNode(e,t,r,_);return s.hashAddNode(o),o},destroyNode(e){s.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return s.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!s.isDir(e.mode))return 54;var t=s.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{var r=s.lookupNode(e,t);return 20}catch{}return s.nodePermissions(e,"wx")},mayDelete(e,t,r){var _;try{_=s.lookupNode(e,t)}catch(a){return a.errno}var o=s.nodePermissions(e,"wx");if(o)return o;if(r){if(!s.isDir(_.mode))return 54;if(s.isRoot(_)||s.getPath(_)===s.cwd())return 10}else if(s.isDir(_.mode))return 31;return 0},mayOpen(e,t){return e?s.isLink(e.mode)?32:s.isDir(e.mode)&&(s.flagsToPermissionString(t)!=="r"||t&512)?31:s.nodePermissions(e,s.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=s.MAX_OPEN_FDS;e++)if(!s.streams[e])return e;throw new s.ErrnoError(33)},getStreamChecked(e){var t=s.getStream(e);if(!t)throw new s.ErrnoError(8);return t},getStream:e=>s.streams[e],createStream(e,t=-1){return e=Object.assign(new s.FSStream,e),t==-1&&(t=s.nextfd()),e.fd=t,s.streams[t]=e,e},closeStream(e){s.streams[e]=null},dupStream(e,t=-1){var r=s.createStream(e,t);return r.stream_ops?.dup?.(r),r},chrdev_stream_ops:{open(e){var t=s.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new s.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){s.devices[e]={stream_ops:t}},getDevice:e=>s.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var _=r.pop();t.push(_),r.push(..._.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),s.syncFSRequests++,s.syncFSRequests>1&&w(`warning: ${s.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=s.getMounts(s.root.mount),_=0;function o(l){return s.syncFSRequests--,t(l)}function a(l){if(l)return a.errored?void 0:(a.errored=!0,o(l));++_>=r.length&&o(null)}r.forEach(l=>{if(!l.type.syncfs)return a(null);l.type.syncfs(l,e,a)})},mount(e,t,r){var _=r==="/",o=!r,a;if(_&&s.root)throw new s.ErrnoError(10);if(!_&&!o){var l=s.lookupPath(r,{follow_mount:!1});if(r=l.path,a=l.node,s.isMountpoint(a))throw new s.ErrnoError(10);if(!s.isDir(a.mode))throw new s.ErrnoError(54)}var c={type:e,opts:t,mountpoint:r,mounts:[]},E=e.mount(c);return E.mount=c,c.root=E,_?s.root=E:a&&(a.mounted=c,a.mount&&a.mount.mounts.push(c)),E},unmount(e){var t=s.lookupPath(e,{follow_mount:!1});if(!s.isMountpoint(t.node))throw new s.ErrnoError(28);var r=t.node,_=r.mounted,o=s.getMounts(_);Object.keys(s.nameTable).forEach(l=>{for(var c=s.nameTable[l];c;){var E=c.name_next;o.includes(c.mount)&&s.destroyNode(c),c=E}}),r.mounted=null;var a=r.mount.mounts.indexOf(_);r.mount.mounts.splice(a,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,r){var _=s.lookupPath(e,{parent:!0}),o=_.node,a=Q.basename(e);if(!a||a==="."||a==="..")throw new s.ErrnoError(28);var l=s.mayCreate(o,a);if(l)throw new s.ErrnoError(l);if(!o.node_ops.mknod)throw new s.ErrnoError(63);return o.node_ops.mknod(o,a,t,r)},create(e,t){return t=t!==void 0?t:438,t&=4095,t|=32768,s.mknod(e,t,0)},mkdir(e,t){return t=t!==void 0?t:511,t&=1023,t|=16384,s.mknod(e,t,0)},mkdirTree(e,t){for(var r=e.split("/"),_="",o=0;o"u"&&(r=t,t=438),t|=8192,s.mknod(e,t,r)},symlink(e,t){if(!ee.resolve(e))throw new s.ErrnoError(44);var r=s.lookupPath(t,{parent:!0}),_=r.node;if(!_)throw new s.ErrnoError(44);var o=Q.basename(t),a=s.mayCreate(_,o);if(a)throw new s.ErrnoError(a);if(!_.node_ops.symlink)throw new s.ErrnoError(63);return _.node_ops.symlink(_,o,e)},rename(e,t){var r=Q.dirname(e),_=Q.dirname(t),o=Q.basename(e),a=Q.basename(t),l,c,E;if(l=s.lookupPath(e,{parent:!0}),c=l.node,l=s.lookupPath(t,{parent:!0}),E=l.node,!c||!E)throw new s.ErrnoError(44);if(c.mount!==E.mount)throw new s.ErrnoError(75);var h=s.lookupNode(c,o),g=ee.relative(e,_);if(g.charAt(0)!==".")throw new s.ErrnoError(28);if(g=ee.relative(t,r),g.charAt(0)!==".")throw new s.ErrnoError(55);var A;try{A=s.lookupNode(E,a)}catch{}if(h!==A){var x=s.isDir(h.mode),T=s.mayDelete(c,o,x);if(T)throw new s.ErrnoError(T);if(T=A?s.mayDelete(E,a,x):s.mayCreate(E,a),T)throw new s.ErrnoError(T);if(!c.node_ops.rename)throw new s.ErrnoError(63);if(s.isMountpoint(h)||A&&s.isMountpoint(A))throw new s.ErrnoError(10);if(E!==c&&(T=s.nodePermissions(c,"w"),T))throw new s.ErrnoError(T);s.hashRemoveNode(h);try{c.node_ops.rename(h,E,a),h.parent=E}catch(b){throw b}finally{s.hashAddNode(h)}}},rmdir(e){var t=s.lookupPath(e,{parent:!0}),r=t.node,_=Q.basename(e),o=s.lookupNode(r,_),a=s.mayDelete(r,_,!0);if(a)throw new s.ErrnoError(a);if(!r.node_ops.rmdir)throw new s.ErrnoError(63);if(s.isMountpoint(o))throw new s.ErrnoError(10);r.node_ops.rmdir(r,_),s.destroyNode(o)},readdir(e){var t=s.lookupPath(e,{follow:!0}),r=t.node;if(!r.node_ops.readdir)throw new s.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var t=s.lookupPath(e,{parent:!0}),r=t.node;if(!r)throw new s.ErrnoError(44);var _=Q.basename(e),o=s.lookupNode(r,_),a=s.mayDelete(r,_,!1);if(a)throw new s.ErrnoError(a);if(!r.node_ops.unlink)throw new s.ErrnoError(63);if(s.isMountpoint(o))throw new s.ErrnoError(10);r.node_ops.unlink(r,_),s.destroyNode(o)},readlink(e){var t=s.lookupPath(e),r=t.node;if(!r)throw new s.ErrnoError(44);if(!r.node_ops.readlink)throw new s.ErrnoError(28);return ee.resolve(s.getPath(r.parent),r.node_ops.readlink(r))},stat(e,t){var r=s.lookupPath(e,{follow:!t}),_=r.node;if(!_)throw new s.ErrnoError(44);if(!_.node_ops.getattr)throw new s.ErrnoError(63);return _.node_ops.getattr(_)},lstat(e){return s.stat(e,!0)},chmod(e,t,r){var _;if(typeof e=="string"){var o=s.lookupPath(e,{follow:!r});_=o.node}else _=e;if(!_.node_ops.setattr)throw new s.ErrnoError(63);_.node_ops.setattr(_,{mode:t&4095|_.mode&-4096,timestamp:Date.now()})},lchmod(e,t){s.chmod(e,t,!0)},fchmod(e,t){var r=s.getStreamChecked(e);s.chmod(r.node,t)},chown(e,t,r,_){var o;if(typeof e=="string"){var a=s.lookupPath(e,{follow:!_});o=a.node}else o=e;if(!o.node_ops.setattr)throw new s.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,r){s.chown(e,t,r,!0)},fchown(e,t,r){var _=s.getStreamChecked(e);s.chown(_.node,t,r)},truncate(e,t){if(t<0)throw new s.ErrnoError(28);var r;if(typeof e=="string"){var _=s.lookupPath(e,{follow:!0});r=_.node}else r=e;if(!r.node_ops.setattr)throw new s.ErrnoError(63);if(s.isDir(r.mode))throw new s.ErrnoError(31);if(!s.isFile(r.mode))throw new s.ErrnoError(28);var o=s.nodePermissions(r,"w");if(o)throw new s.ErrnoError(o);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=s.getStreamChecked(e);if(!(r.flags&2097155))throw new s.ErrnoError(28);s.truncate(r.node,t)},utime(e,t,r){var _=s.lookupPath(e,{follow:!0}),o=_.node;o.node_ops.setattr(o,{timestamp:Math.max(t,r)})},open(e,t,r){if(e==="")throw new s.ErrnoError(44);t=typeof t=="string"?nr(t):t,t&64?(r=typeof r>"u"?438:r,r=r&4095|32768):r=0;var _;if(typeof e=="object")_=e;else{e=Q.normalize(e);try{var o=s.lookupPath(e,{follow:!(t&131072)});_=o.node}catch{}}var a=!1;if(t&64)if(_){if(t&128)throw new s.ErrnoError(20)}else _=s.mknod(e,r,0),a=!0;if(!_)throw new s.ErrnoError(44);if(s.isChrdev(_.mode)&&(t&=-513),t&65536&&!s.isDir(_.mode))throw new s.ErrnoError(54);if(!a){var l=s.mayOpen(_,t);if(l)throw new s.ErrnoError(l)}t&512&&!a&&s.truncate(_,0),t&=-131713;var c=s.createStream({node:_,path:s.getPath(_),flags:t,seekable:!0,position:0,stream_ops:_.stream_ops,ungotten:[],error:!1});return c.stream_ops.open&&c.stream_ops.open(c),n.logReadFiles&&!(t&1)&&(s.readFiles||(s.readFiles={}),e in s.readFiles||(s.readFiles[e]=1)),c},close(e){if(s.isClosed(e))throw new s.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{s.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,r){if(s.isClosed(e))throw new s.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new s.ErrnoError(70);if(r!=0&&r!=1&&r!=2)throw new s.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,_,o){if(_<0||o<0)throw new s.ErrnoError(28);if(s.isClosed(e))throw new s.ErrnoError(8);if((e.flags&2097155)===1)throw new s.ErrnoError(8);if(s.isDir(e.node.mode))throw new s.ErrnoError(31);if(!e.stream_ops.read)throw new s.ErrnoError(28);var a=typeof o<"u";if(!a)o=e.position;else if(!e.seekable)throw new s.ErrnoError(70);var l=e.stream_ops.read(e,t,r,_,o);return a||(e.position+=l),l},write(e,t,r,_,o,a){if(_<0||o<0)throw new s.ErrnoError(28);if(s.isClosed(e))throw new s.ErrnoError(8);if(!(e.flags&2097155))throw new s.ErrnoError(8);if(s.isDir(e.node.mode))throw new s.ErrnoError(31);if(!e.stream_ops.write)throw new s.ErrnoError(28);e.seekable&&e.flags&1024&&s.llseek(e,0,2);var l=typeof o<"u";if(!l)o=e.position;else if(!e.seekable)throw new s.ErrnoError(70);var c=e.stream_ops.write(e,t,r,_,o,a);return l||(e.position+=c),c},allocate(e,t,r){if(s.isClosed(e))throw new s.ErrnoError(8);if(t<0||r<=0)throw new s.ErrnoError(28);if(!(e.flags&2097155))throw new s.ErrnoError(8);if(!s.isFile(e.node.mode)&&!s.isDir(e.node.mode))throw new s.ErrnoError(43);if(!e.stream_ops.allocate)throw new s.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,_,o){if(_&2&&!(o&2)&&(e.flags&2097155)!==2)throw new s.ErrnoError(2);if((e.flags&2097155)===1)throw new s.ErrnoError(2);if(!e.stream_ops.mmap)throw new s.ErrnoError(43);return e.stream_ops.mmap(e,t,r,_,o)},msync(e,t,r,_,o){return e.stream_ops.msync?e.stream_ops.msync(e,t,r,_,o):0},ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new s.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error(`Invalid encoding type "${t.encoding}"`);var r,_=s.open(e,t.flags),o=s.stat(e),a=o.size,l=new Uint8Array(a);return s.read(_,l,0,a,0),t.encoding==="utf8"?r=de(l,0):t.encoding==="binary"&&(r=l),s.close(_),r},writeFile(e,t,r={}){r.flags=r.flags||577;var _=s.open(e,r.flags,r.mode);if(typeof t=="string"){var o=new Uint8Array(pe(t)+1),a=De(t,o,0,o.length);s.write(_,o,0,a,void 0,r.canOwn)}else if(ArrayBuffer.isView(t))s.write(_,t,0,t.byteLength,void 0,r.canOwn);else throw new Error("Unsupported data type");s.close(_)},cwd:()=>s.currentPath,chdir(e){var t=s.lookupPath(e,{follow:!0});if(t.node===null)throw new s.ErrnoError(44);if(!s.isDir(t.node.mode))throw new s.ErrnoError(54);var r=s.nodePermissions(t.node,"x");if(r)throw new s.ErrnoError(r);s.currentPath=t.path},createDefaultDirectories(){s.mkdir("/tmp"),s.mkdir("/home"),s.mkdir("/home/web_user")},createDefaultDevices(){s.mkdir("/dev"),s.registerDevice(s.makedev(1,3),{read:()=>0,write:(_,o,a,l,c)=>l}),s.mkdev("/dev/null",s.makedev(1,3)),_e.register(s.makedev(5,0),_e.default_tty_ops),_e.register(s.makedev(6,0),_e.default_tty1_ops),s.mkdev("/dev/tty",s.makedev(5,0)),s.mkdev("/dev/tty1",s.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(t===0&&(t=Je(e).byteLength),e[--t]);s.createDevice("/dev","random",r),s.createDevice("/dev","urandom",r),s.mkdir("/dev/shm"),s.mkdir("/dev/shm/tmp")},createSpecialDirectories(){s.mkdir("/proc");var e=s.mkdir("/proc/self");s.mkdir("/proc/self/fd"),s.mount({mount(){var t=s.createNode(e,"fd",16895,73);return t.node_ops={lookup(r,_){var o=+_,a=s.getStreamChecked(o),l={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>a.path}};return l.parent=l,l}},t}},{},"/proc/self/fd")},createStandardStreams(){n.stdin?s.createDevice("/dev","stdin",n.stdin):s.symlink("/dev/tty","/dev/stdin"),n.stdout?s.createDevice("/dev","stdout",null,n.stdout):s.symlink("/dev/tty","/dev/stdout"),n.stderr?s.createDevice("/dev","stderr",null,n.stderr):s.symlink("/dev/tty1","/dev/stderr");var e=s.open("/dev/stdin",0),t=s.open("/dev/stdout",1),r=s.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{s.genericErrors[e]=new s.ErrnoError(e),s.genericErrors[e].stack=""}),s.nameTable=new Array(4096),s.mount(L,{},"/"),s.createDefaultDirectories(),s.createDefaultDevices(),s.createSpecialDirectories(),s.filesystems={MEMFS:L}},init(e,t,r){s.init.initialized=!0,n.stdin=e||n.stdin,n.stdout=t||n.stdout,n.stderr=r||n.stderr,s.createStandardStreams()},quit(){s.init.initialized=!1;for(var e=0;ethis.length-1||T<0)){var b=T%this.chunkSize,M=T/this.chunkSize|0;return this.getter(M)[b]}}setDataGetter(T){this.getter=T}cacheLength(){var T=new XMLHttpRequest;if(T.open("HEAD",r,!1),T.send(null),!(T.status>=200&&T.status<300||T.status===304))throw new Error("Couldn't load "+r+". Status: "+T.status);var b=Number(T.getResponseHeader("Content-length")),M,X=(M=T.getResponseHeader("Accept-Ranges"))&&M==="bytes",V=(M=T.getResponseHeader("Content-Encoding"))&&M==="gzip",Y=1024*1024;X||(Y=b);var $=(J,qe)=>{if(J>qe)throw new Error("invalid range ("+J+", "+qe+") or no bytes requested!");if(qe>b-1)throw new Error("only "+b+" bytes available! programmer error!");var H=new XMLHttpRequest;if(H.open("GET",r,!1),b!==Y&&H.setRequestHeader("Range","bytes="+J+"-"+qe),H.responseType="arraybuffer",H.overrideMimeType&&H.overrideMimeType("text/plain; charset=x-user-defined"),H.send(null),!(H.status>=200&&H.status<300||H.status===304))throw new Error("Couldn't load "+r+". Status: "+H.status);return H.response!==void 0?new Uint8Array(H.response||[]):Me(H.responseText||"",!0)},ye=this;ye.setDataGetter(J=>{var qe=J*Y,H=(J+1)*Y-1;if(H=Math.min(H,b-1),typeof ye.chunks[J]>"u"&&(ye.chunks[J]=$(qe,H)),typeof ye.chunks[J]>"u")throw new Error("doXHR failed!");return ye.chunks[J]}),(V||!b)&&(Y=b=1,b=this.getter(0).length,Y=b,q("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=b,this._chunkSize=Y,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!re)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var l=new a,c={isDevice:!1,contents:l}}else var c={isDevice:!1,url:r};var E=s.createFile(e,t,c,_,o);c.contents?E.contents=c.contents:c.url&&(E.contents=null,E.url=c.url),Object.defineProperties(E,{usedBytes:{get:function(){return this.contents.length}}});var h={},g=Object.keys(E.stream_ops);g.forEach(x=>{var T=E.stream_ops[x];h[x]=(...b)=>(s.forceLoadFile(E),T(...b))});function A(x,T,b,M,X){var V=x.node.contents;if(X>=V.length)return 0;var Y=Math.min(V.length-X,M);if(V.slice)for(var $=0;$(s.forceLoadFile(E),A(x,T,b,M,X)),h.mmap=(x,T,b,M,X)=>{s.forceLoadFile(E);var V=et(T);if(!V)throw new s.ErrnoError(48);return A(x,k,V,T,b),{ptr:V,allocated:!0}},E.stream_ops=h,E}},N={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(Q.isAbs(t))return t;var _;if(e===-100)_=s.cwd();else{var o=N.getStreamFromFD(e);_=o.path}if(t.length==0){if(!r)throw new s.ErrnoError(44);return _}return Q.join2(_,t)},doStat(e,t,r){var _=e(t);y[r>>2]=_.dev,y[r+4>>2]=_.mode,z[r+8>>2]=_.nlink,y[r+12>>2]=_.uid,y[r+16>>2]=_.gid,y[r+20>>2]=_.rdev,P=[_.size>>>0,(S=_.size,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+24>>2]=P[0],y[r+28>>2]=P[1],y[r+32>>2]=4096,y[r+36>>2]=_.blocks;var o=_.atime.getTime(),a=_.mtime.getTime(),l=_.ctime.getTime();return P=[Math.floor(o/1e3)>>>0,(S=Math.floor(o/1e3),+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+40>>2]=P[0],y[r+44>>2]=P[1],z[r+48>>2]=o%1e3*1e3,P=[Math.floor(a/1e3)>>>0,(S=Math.floor(a/1e3),+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+56>>2]=P[0],y[r+60>>2]=P[1],z[r+64>>2]=a%1e3*1e3,P=[Math.floor(l/1e3)>>>0,(S=Math.floor(l/1e3),+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+72>>2]=P[0],y[r+76>>2]=P[1],z[r+80>>2]=l%1e3*1e3,P=[_.ino>>>0,(S=_.ino,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+88>>2]=P[0],y[r+92>>2]=P[1],0},doMsync(e,t,r,_,o){if(!s.isFile(t.node.mode))throw new s.ErrnoError(43);if(_&2)return 0;var a=C.slice(e,e+r);s.msync(t,a,o,r,_)},getStreamFromFD(e){var t=s.getStreamChecked(e);return t},varargs:void 0,getStr(e){var t=ce(e);return t}};function _r(e,t){try{return e=N.getStr(e),s.chmod(e,t),0}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function sr(e,t,r,_){try{if(t=N.getStr(t),t=N.calculateAt(e,t),r&-8)return-28;var o=s.lookupPath(t,{follow:!0}),a=o.node;if(!a)return-44;var l="";return r&4&&(l+="r"),r&2&&(l+="w"),r&1&&(l+="x"),l&&s.nodePermissions(a,l)?-2:0}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function or(e,t){try{return s.fchmod(e,t),0}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function ir(e,t,r){try{return s.fchown(e,t,r),0}catch(_){if(typeof s>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}function Ne(){var e=y[+N.varargs>>2];return N.varargs+=4,e}var ar=Ne;function lr(e,t,r){N.varargs=r;try{var _=N.getStreamFromFD(e);switch(t){case 0:{var o=Ne();if(o<0)return-28;for(;s.streams[o];)o++;var a;return a=s.dupStream(_,o),a.fd}case 1:case 2:return 0;case 3:return _.flags;case 4:{var o=Ne();return _.flags|=o,0}case 12:{var o=ar(),l=0;return U[o+l>>1]=2,0}case 13:case 14:return 0}return-28}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function cr(e,t){try{var r=N.getStreamFromFD(e);return N.doStat(s.stat,r.path,t)}catch(_){if(typeof s>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}var Te=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function ur(e,t,r){var _=Te(t,r);try{return isNaN(_)?61:(s.ftruncate(e,_),0)}catch(o){if(typeof s>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}var se=(e,t,r)=>De(e,C,t,r);function fr(e,t){try{if(t===0)return-28;var r=s.cwd(),_=pe(r)+1;return t<_?-68:(se(r,e,t),_)}catch(o){if(typeof s>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}function dr(e,t){try{return e=N.getStr(e),N.doStat(s.lstat,e,t)}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function pr(e,t,r){try{return t=N.getStr(t),t=N.calculateAt(e,t),t=Q.normalize(t),t[t.length-1]==="/"&&(t=t.substr(0,t.length-1)),s.mkdir(t,r,0),0}catch(_){if(typeof s>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}function vr(e,t,r,_){try{t=N.getStr(t);var o=_&256,a=_&4096;return _=_&-6401,t=N.calculateAt(e,t,a),N.doStat(o?s.lstat:s.stat,t,r)}catch(l){if(typeof s>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}function mr(e,t,r,_){N.varargs=_;try{t=N.getStr(t),t=N.calculateAt(e,t);var o=_?Ne():0;return s.open(t,r,o).fd}catch(a){if(typeof s>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}function Er(e,t,r,_){try{if(t=N.getStr(t),t=N.calculateAt(e,t),_<=0)return-28;var o=s.readlink(t),a=Math.min(_,pe(o)),l=k[r+a];return se(o,r,_+1),k[r+a]=l,a}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function qr(e){try{return e=N.getStr(e),s.rmdir(e),0}catch(t){if(typeof s>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function hr(e,t){try{return e=N.getStr(e),N.doStat(s.stat,e,t)}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function br(e,t,r){try{return t=N.getStr(t),t=N.calculateAt(e,t),r===0?s.unlink(t):r===512?s.rmdir(t):ne("Invalid flags passed to unlinkat"),0}catch(_){if(typeof s>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}var tt=e=>z[e>>2]+y[e+4>>2]*4294967296;function Tr(e,t,r,_){try{if(t=N.getStr(t),t=N.calculateAt(e,t,!0),r){var l=tt(r),c=y[r+8>>2];o=l*1e3+c/1e6,r+=16,l=tt(r),c=y[r+8>>2],a=l*1e3+c/1e6}else var o=Date.now(),a=o;return s.utime(t,o,a),0}catch(E){if(typeof s>"u"||E.name!=="ErrnoError")throw E;return-E.errno}}var wr=e=>e%4===0&&(e%100!==0||e%400===0),yr=[0,31,60,91,121,152,182,213,244,274,305,335],Sr=[0,31,59,90,120,151,181,212,243,273,304,334],gr=e=>{var t=wr(e.getFullYear()),r=t?yr:Sr,_=r[e.getMonth()]+e.getDate()-1;return _};function Ir(e,t,r){var _=Te(e,t),o=new Date(_*1e3);y[r>>2]=o.getSeconds(),y[r+4>>2]=o.getMinutes(),y[r+8>>2]=o.getHours(),y[r+12>>2]=o.getDate(),y[r+16>>2]=o.getMonth(),y[r+20>>2]=o.getFullYear()-1900,y[r+24>>2]=o.getDay();var a=gr(o)|0;y[r+28>>2]=a,y[r+36>>2]=-(o.getTimezoneOffset()*60);var l=new Date(o.getFullYear(),0,1),c=new Date(o.getFullYear(),6,1).getTimezoneOffset(),E=l.getTimezoneOffset(),h=(c!=E&&o.getTimezoneOffset()==Math.min(E,c))|0;y[r+32>>2]=h}function Lr(e,t,r,_,o,a,l,c){var E=Te(o,a);try{if(isNaN(E))return 61;var h=N.getStreamFromFD(_),g=s.mmap(h,e,E,t,r),A=g.ptr;return y[l>>2]=g.allocated,z[c>>2]=A,0}catch(x){if(typeof s>"u"||x.name!=="ErrnoError")throw x;return-x.errno}}function xr(e,t,r,_,o,a,l){var c=Te(a,l);try{var E=N.getStreamFromFD(o);r&2&&N.doMsync(e,E,t,_,c)}catch(h){if(typeof s>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}var Ar=(e,t,r,_)=>{var o=new Date().getFullYear(),a=new Date(o,0,1),l=new Date(o,6,1),c=a.getTimezoneOffset(),E=l.getTimezoneOffset(),h=Math.max(c,E);z[e>>2]=h*60,y[t>>2]=+(c!=E);var g=T=>T.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],A=g(a),x=g(l);EDate.now(),rt;rt=()=>performance.now();var Rr=()=>2147483648,kr=e=>{var t=D.buffer,r=(e-t.byteLength+65535)/65536;try{return D.grow(r),He(),1}catch{}},Or=e=>{var t=C.length;e>>>=0;var r=Rr();if(e>r)return!1;for(var _=(E,h)=>E+(h-E%h)%h,o=1;o<=4;o*=2){var a=t*(1+.2/o);a=Math.min(a,e+100663296);var l=Math.min(r,_(Math.max(e,a),65536)),c=kr(l);if(c)return!0}return!1},ze={},Qr=()=>B||"./this.program",we=()=>{if(!we.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Qr()};for(var r in ze)ze[r]===void 0?delete t[r]:t[r]=ze[r];var _=[];for(var r in t)_.push(`${r}=${t[r]}`);we.strings=_}return we.strings},Cr=(e,t)=>{for(var r=0;r{var r=0;return we().forEach((_,o)=>{var a=t+r;z[e+o*4>>2]=a,Cr(_,a),r+=_.length+1}),0},Pr=(e,t)=>{var r=we();z[e>>2]=r.length;var _=0;return r.forEach(o=>_+=o.length+1),z[t>>2]=_,0};function Dr(e){try{var t=N.getStreamFromFD(e);return s.close(t),0}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return r.errno}}function Mr(e,t){try{var r=0,_=0,o=0,a=N.getStreamFromFD(e),l=a.tty?2:s.isDir(a.mode)?3:s.isLink(a.mode)?7:4;return k[t]=l,U[t+2>>1]=o,P=[r>>>0,(S=r,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[t+8>>2]=P[0],y[t+12>>2]=P[1],P=[_>>>0,(S=_,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[t+16>>2]=P[0],y[t+20>>2]=P[1],0}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return c.errno}}var Ur=(e,t,r,_)=>{for(var o=0,a=0;a>2],c=z[t+4>>2];t+=8;var E=s.read(e,k,l,c,_);if(E<0)return-1;if(o+=E,E>2]=a,0}catch(l){if(typeof s>"u"||l.name!=="ErrnoError")throw l;return l.errno}}function Br(e,t,r,_,o){var a=Te(t,r);try{if(isNaN(a))return 61;var l=N.getStreamFromFD(e);return s.llseek(l,a,_),P=[l.position>>>0,(S=l.position,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[o>>2]=P[0],y[o+4>>2]=P[1],l.getdents&&a===0&&_===0&&(l.getdents=null),0}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return c.errno}}function Hr(e){try{var t=N.getStreamFromFD(e);return t.stream_ops?.fsync?t.stream_ops.fsync(t):0}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return r.errno}}var Wr=(e,t,r,_)=>{for(var o=0,a=0;a>2],c=z[t+4>>2];t+=8;var E=s.write(e,k,l,c,_);if(E<0)return-1;o+=E,typeof _<"u"&&(_+=E)}return o};function jr(e,t,r,_){try{var o=N.getStreamFromFD(e),a=Wr(o,t,r);return z[_>>2]=a,0}catch(l){if(typeof s>"u"||l.name!=="ErrnoError")throw l;return l.errno}}var O=function(){let e=typeof Asyncify=="object"?Asyncify.handleAsync.bind(Asyncify):null;n.handleAsync=e;let t=new Map;n.setCallback=(r,_)=>t.set(r,_),n.getCallback=r=>t.get(r),n.deleteCallback=r=>t.delete(r),O=function(r,_,...o){let a=t.get(_),l=null,c=typeof a=="function"?a:a[l=ce(o.shift())];if(r){if(e)return e(()=>c.apply(a,o));throw new Error("Synchronous WebAssembly cannot call async function")}let E=c.apply(a,o);if(typeof E?.then=="function")throw console.error("unexpected Promise",c),new Error(`${l} unexpectedly returned a Promise`);return E}};function Gr(...e){return O(!1,...e)}function Kr(...e){return O(!0,...e)}function Xr(...e){return O(!1,...e)}function Vr(...e){return O(!0,...e)}function Yr(...e){return O(!1,...e)}function $r(...e){return O(!0,...e)}function Zr(...e){return O(!1,...e)}function Jr(...e){return O(!0,...e)}function en(...e){return O(!1,...e)}function tn(...e){return O(!0,...e)}function rn(...e){return O(!1,...e)}function nn(...e){return O(!0,...e)}function _n(...e){return O(!1,...e)}function sn(...e){return O(!0,...e)}function on(...e){return O(!1,...e)}function an(...e){return O(!0,...e)}function ln(...e){return O(!1,...e)}function cn(...e){return O(!0,...e)}function un(...e){return O(!1,...e)}function fn(...e){return O(!0,...e)}function dn(...e){return O(!1,...e)}function pn(...e){return O(!0,...e)}function vn(...e){return O(!1,...e)}function mn(...e){return O(!0,...e)}function En(...e){return O(!1,...e)}function qn(...e){return O(!0,...e)}function hn(...e){return O(!1,...e)}function bn(...e){return O(!0,...e)}function Tn(...e){return O(!1,...e)}function wn(...e){return O(!0,...e)}var yn=0,Sn=()=>Wt||yn>0,gn=e=>{j=e,Sn()||(n.onExit?.(e),W=!0),ae(e,new Ye(e))},In=(e,t)=>{j=e,gn(e)},Ln=e=>{if(e instanceof Ye||e=="unwind")return j;ae(1,e)},nt=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},xn=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},_=1;_{var r=e.slice(0,1),_=e.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),nt(_.length,t);for(var a=0;a<_.length;++a)t.push(o[_[a]]);r=="v"?t.push(0):t.push(1,o[r])},Nn=(e,t)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(xn(t),e);var r=[1];An(t,r);var _=[0,97,115,109,1,0,0,0,1];nt(r.length,_),_.push(...r),_.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(_)),a=new WebAssembly.Instance(o,{e:{f:e}}),l=a.exports.f;return l},ve,Rn=e=>ve.get(e),kn=(e,t)=>{if(me)for(var r=e;r(me||(me=new WeakMap,kn(0,ve.length)),me.get(e)||0),_t=[],Qn=()=>{if(_t.length)return _t.pop();try{ve.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return ve.length-1},st=(e,t)=>ve.set(e,t),Cn=(e,t)=>{var r=On(e);if(r)return r;var _=Qn();try{st(_,e)}catch(a){if(!(a instanceof TypeError))throw a;var o=Nn(e,t);st(_,o)}return me.set(e,_),_},ot=e=>{var t=n["_"+e];return t},it=(e,t)=>{k.set(e,t)},at=e=>pt(e),Fn=e=>{var t=pe(e)+1,r=at(t);return se(e,r,t),r},Ee=(e,t,r,_,o)=>{var a={string:b=>{var M=0;return b!=null&&b!==0&&(M=Fn(b)),M},array:b=>{var M=at(b.length);return it(b,M),M}};function l(b){return t==="string"?ce(b):t==="boolean"?!!b:b}var c=ot(e),E=[],h=0;if(_)for(var g=0;g<_.length;g++){var A=a[r[g]];A?(h===0&&(h=Gt()),E[g]=A(_[g])):E[g]=_[g]}var x=c(...E);function T(b){return h!==0&&jt(h),l(b)}return x=T(x),x},Pn=(e,t,r,_)=>{var o=!r||r.every(l=>l==="number"||l==="boolean"),a=t!=="string";return a&&o&&!_?ot(e):(...l)=>Ee(e,t,r,l,_)},Dn=e=>ft(),Mn=(e,t,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var _=t,o=r>1]=l,t+=2}return U[t>>1]=0,t-_},Un=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var _=t,o=_+r-4,a=0;a=55296&&l<=57343){var c=e.charCodeAt(++a);l=65536+((l&1023)<<10)|c&1023}if(y[t>>2]=l,t+=4,t+4>o)break}return y[t>>2]=0,t-_},zn=e=>{for(var t="";;){var r=C[e++];if(!r)return t;t+=String.fromCharCode(r)}},lt=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Bn=(e,t)=>{for(var r=e,_=r>>1,o=_+t/2;!(_>=o)&&Z[_];)++_;if(r=_<<1,r-e>32&<)return lt.decode(C.subarray(e,r));for(var a="",l=0;!(l>=t/2);++l){var c=U[e+l*2>>1];if(c==0)break;a+=String.fromCharCode(c)}return a},Hn=(e,t)=>{for(var r=0,_="";!(r>=t/4);){var o=y[e+r*4>>2];if(o==0)break;if(++r,o>=65536){var a=o-65536;_+=String.fromCharCode(55296|a>>10,56320|a&1023)}else _+=String.fromCharCode(o)}return _};function Wn(e){for(var t=[],r=0;r255&&(_&=255),t.push(String.fromCharCode(_))}return t.join("")}s.createPreloadedFile=rr,s.staticInit(),O();var jn={a:Kt,Y:_r,$:sr,Z:or,X:ir,b:lr,W:cr,y:ur,Q:fr,U:dr,N:pr,T:vr,L:mr,J:Er,I:qr,V:hr,G:br,F:Tr,w:Ir,u:Lr,v:xr,M:Ar,n:Nr,m:rt,D:Or,O:Fr,P:Pr,o:Dr,E:Mr,K:zr,x:Br,S:Hr,H:jr,s:Gr,t:Kr,fa:Xr,ia:Vr,i:Yr,j:$r,c:Zr,d:Jr,ca:en,da:tn,ea:rn,ga:nn,g:_n,h:sn,z:on,A:an,e:ln,f:cn,aa:un,ba:fn,B:dn,C:pn,p:vn,q:mn,ha:En,r:qn,k:hn,l:bn,R:Tn,_:wn},i=Ht(),Gn=()=>(Gn=i.ka)(),Kn=n._sqlite3_status64=(e,t,r,_)=>(Kn=n._sqlite3_status64=i.la)(e,t,r,_),Xn=n._sqlite3_status=(e,t,r,_)=>(Xn=n._sqlite3_status=i.ma)(e,t,r,_),Vn=n._sqlite3_db_status=(e,t,r,_,o)=>(Vn=n._sqlite3_db_status=i.na)(e,t,r,_,o),Yn=n._sqlite3_msize=e=>(Yn=n._sqlite3_msize=i.oa)(e),$n=n._sqlite3_vfs_find=e=>($n=n._sqlite3_vfs_find=i.pa)(e),Zn=n._sqlite3_vfs_register=(e,t)=>(Zn=n._sqlite3_vfs_register=i.qa)(e,t),Jn=n._sqlite3_vfs_unregister=e=>(Jn=n._sqlite3_vfs_unregister=i.ra)(e),e_=n._sqlite3_release_memory=e=>(e_=n._sqlite3_release_memory=i.sa)(e),t_=n._sqlite3_soft_heap_limit64=(e,t)=>(t_=n._sqlite3_soft_heap_limit64=i.ta)(e,t),r_=n._sqlite3_memory_used=()=>(r_=n._sqlite3_memory_used=i.ua)(),n_=n._sqlite3_hard_heap_limit64=(e,t)=>(n_=n._sqlite3_hard_heap_limit64=i.va)(e,t),__=n._sqlite3_memory_highwater=e=>(__=n._sqlite3_memory_highwater=i.wa)(e),s_=n._sqlite3_malloc=e=>(s_=n._sqlite3_malloc=i.xa)(e),o_=n._sqlite3_malloc64=(e,t)=>(o_=n._sqlite3_malloc64=i.ya)(e,t),i_=n._sqlite3_free=e=>(i_=n._sqlite3_free=i.za)(e),a_=n._sqlite3_realloc=(e,t)=>(a_=n._sqlite3_realloc=i.Aa)(e,t),l_=n._sqlite3_realloc64=(e,t,r)=>(l_=n._sqlite3_realloc64=i.Ba)(e,t,r),c_=n._sqlite3_str_vappendf=(e,t,r)=>(c_=n._sqlite3_str_vappendf=i.Ca)(e,t,r),u_=n._sqlite3_str_append=(e,t,r)=>(u_=n._sqlite3_str_append=i.Da)(e,t,r),f_=n._sqlite3_str_appendchar=(e,t,r)=>(f_=n._sqlite3_str_appendchar=i.Ea)(e,t,r),d_=n._sqlite3_str_appendall=(e,t)=>(d_=n._sqlite3_str_appendall=i.Fa)(e,t),p_=n._sqlite3_str_appendf=(e,t,r)=>(p_=n._sqlite3_str_appendf=i.Ga)(e,t,r),v_=n._sqlite3_str_finish=e=>(v_=n._sqlite3_str_finish=i.Ha)(e),m_=n._sqlite3_str_errcode=e=>(m_=n._sqlite3_str_errcode=i.Ia)(e),E_=n._sqlite3_str_length=e=>(E_=n._sqlite3_str_length=i.Ja)(e),q_=n._sqlite3_str_value=e=>(q_=n._sqlite3_str_value=i.Ka)(e),h_=n._sqlite3_str_reset=e=>(h_=n._sqlite3_str_reset=i.La)(e),b_=n._sqlite3_str_new=e=>(b_=n._sqlite3_str_new=i.Ma)(e),T_=n._sqlite3_vmprintf=(e,t)=>(T_=n._sqlite3_vmprintf=i.Na)(e,t),w_=n._sqlite3_mprintf=(e,t)=>(w_=n._sqlite3_mprintf=i.Oa)(e,t),y_=n._sqlite3_vsnprintf=(e,t,r,_)=>(y_=n._sqlite3_vsnprintf=i.Pa)(e,t,r,_),S_=n._sqlite3_snprintf=(e,t,r,_)=>(S_=n._sqlite3_snprintf=i.Qa)(e,t,r,_),g_=n._sqlite3_log=(e,t,r)=>(g_=n._sqlite3_log=i.Ra)(e,t,r),I_=n._sqlite3_randomness=(e,t)=>(I_=n._sqlite3_randomness=i.Sa)(e,t),L_=n._sqlite3_stricmp=(e,t)=>(L_=n._sqlite3_stricmp=i.Ta)(e,t),x_=n._sqlite3_strnicmp=(e,t,r)=>(x_=n._sqlite3_strnicmp=i.Ua)(e,t,r),A_=n._sqlite3_os_init=()=>(A_=n._sqlite3_os_init=i.Va)(),N_=n._sqlite3_os_end=()=>(N_=n._sqlite3_os_end=i.Wa)(),R_=n._sqlite3_serialize=(e,t,r,_)=>(R_=n._sqlite3_serialize=i.Xa)(e,t,r,_),k_=n._sqlite3_prepare_v2=(e,t,r,_,o)=>(k_=n._sqlite3_prepare_v2=i.Ya)(e,t,r,_,o),O_=n._sqlite3_step=e=>(O_=n._sqlite3_step=i.Za)(e),Q_=n._sqlite3_column_int64=(e,t)=>(Q_=n._sqlite3_column_int64=i._a)(e,t),C_=n._sqlite3_reset=e=>(C_=n._sqlite3_reset=i.$a)(e),F_=n._sqlite3_exec=(e,t,r,_,o)=>(F_=n._sqlite3_exec=i.ab)(e,t,r,_,o),P_=n._sqlite3_column_int=(e,t)=>(P_=n._sqlite3_column_int=i.bb)(e,t),D_=n._sqlite3_finalize=e=>(D_=n._sqlite3_finalize=i.cb)(e),M_=n._sqlite3_deserialize=(e,t,r,_,o,a,l,c)=>(M_=n._sqlite3_deserialize=i.db)(e,t,r,_,o,a,l,c),U_=n._sqlite3_database_file_object=e=>(U_=n._sqlite3_database_file_object=i.eb)(e),z_=n._sqlite3_backup_init=(e,t,r,_)=>(z_=n._sqlite3_backup_init=i.fb)(e,t,r,_),B_=n._sqlite3_backup_step=(e,t)=>(B_=n._sqlite3_backup_step=i.gb)(e,t),H_=n._sqlite3_backup_finish=e=>(H_=n._sqlite3_backup_finish=i.hb)(e),W_=n._sqlite3_backup_remaining=e=>(W_=n._sqlite3_backup_remaining=i.ib)(e),j_=n._sqlite3_backup_pagecount=e=>(j_=n._sqlite3_backup_pagecount=i.jb)(e),G_=n._sqlite3_clear_bindings=e=>(G_=n._sqlite3_clear_bindings=i.kb)(e),K_=n._sqlite3_value_blob=e=>(K_=n._sqlite3_value_blob=i.lb)(e),X_=n._sqlite3_value_text=e=>(X_=n._sqlite3_value_text=i.mb)(e),V_=n._sqlite3_value_bytes=e=>(V_=n._sqlite3_value_bytes=i.nb)(e),Y_=n._sqlite3_value_bytes16=e=>(Y_=n._sqlite3_value_bytes16=i.ob)(e),$_=n._sqlite3_value_double=e=>($_=n._sqlite3_value_double=i.pb)(e),Z_=n._sqlite3_value_int=e=>(Z_=n._sqlite3_value_int=i.qb)(e),J_=n._sqlite3_value_int64=e=>(J_=n._sqlite3_value_int64=i.rb)(e),es=n._sqlite3_value_subtype=e=>(es=n._sqlite3_value_subtype=i.sb)(e),ts=n._sqlite3_value_pointer=(e,t)=>(ts=n._sqlite3_value_pointer=i.tb)(e,t),rs=n._sqlite3_value_text16=e=>(rs=n._sqlite3_value_text16=i.ub)(e),ns=n._sqlite3_value_text16be=e=>(ns=n._sqlite3_value_text16be=i.vb)(e),_s=n._sqlite3_value_text16le=e=>(_s=n._sqlite3_value_text16le=i.wb)(e),ss=n._sqlite3_value_type=e=>(ss=n._sqlite3_value_type=i.xb)(e),os=n._sqlite3_value_encoding=e=>(os=n._sqlite3_value_encoding=i.yb)(e),is=n._sqlite3_value_nochange=e=>(is=n._sqlite3_value_nochange=i.zb)(e),as=n._sqlite3_value_frombind=e=>(as=n._sqlite3_value_frombind=i.Ab)(e),ls=n._sqlite3_value_dup=e=>(ls=n._sqlite3_value_dup=i.Bb)(e),cs=n._sqlite3_value_free=e=>(cs=n._sqlite3_value_free=i.Cb)(e),us=n._sqlite3_result_blob=(e,t,r,_)=>(us=n._sqlite3_result_blob=i.Db)(e,t,r,_),fs=n._sqlite3_result_blob64=(e,t,r,_,o)=>(fs=n._sqlite3_result_blob64=i.Eb)(e,t,r,_,o),ds=n._sqlite3_result_double=(e,t)=>(ds=n._sqlite3_result_double=i.Fb)(e,t),ps=n._sqlite3_result_error=(e,t,r)=>(ps=n._sqlite3_result_error=i.Gb)(e,t,r),vs=n._sqlite3_result_error16=(e,t,r)=>(vs=n._sqlite3_result_error16=i.Hb)(e,t,r),ms=n._sqlite3_result_int=(e,t)=>(ms=n._sqlite3_result_int=i.Ib)(e,t),Es=n._sqlite3_result_int64=(e,t,r)=>(Es=n._sqlite3_result_int64=i.Jb)(e,t,r),qs=n._sqlite3_result_null=e=>(qs=n._sqlite3_result_null=i.Kb)(e),hs=n._sqlite3_result_pointer=(e,t,r,_)=>(hs=n._sqlite3_result_pointer=i.Lb)(e,t,r,_),bs=n._sqlite3_result_subtype=(e,t)=>(bs=n._sqlite3_result_subtype=i.Mb)(e,t),Ts=n._sqlite3_result_text=(e,t,r,_)=>(Ts=n._sqlite3_result_text=i.Nb)(e,t,r,_),ws=n._sqlite3_result_text64=(e,t,r,_,o,a)=>(ws=n._sqlite3_result_text64=i.Ob)(e,t,r,_,o,a),ys=n._sqlite3_result_text16=(e,t,r,_)=>(ys=n._sqlite3_result_text16=i.Pb)(e,t,r,_),Ss=n._sqlite3_result_text16be=(e,t,r,_)=>(Ss=n._sqlite3_result_text16be=i.Qb)(e,t,r,_),gs=n._sqlite3_result_text16le=(e,t,r,_)=>(gs=n._sqlite3_result_text16le=i.Rb)(e,t,r,_),Is=n._sqlite3_result_value=(e,t)=>(Is=n._sqlite3_result_value=i.Sb)(e,t),Ls=n._sqlite3_result_error_toobig=e=>(Ls=n._sqlite3_result_error_toobig=i.Tb)(e),xs=n._sqlite3_result_zeroblob=(e,t)=>(xs=n._sqlite3_result_zeroblob=i.Ub)(e,t),As=n._sqlite3_result_zeroblob64=(e,t,r)=>(As=n._sqlite3_result_zeroblob64=i.Vb)(e,t,r),Ns=n._sqlite3_result_error_code=(e,t)=>(Ns=n._sqlite3_result_error_code=i.Wb)(e,t),Rs=n._sqlite3_result_error_nomem=e=>(Rs=n._sqlite3_result_error_nomem=i.Xb)(e),ks=n._sqlite3_user_data=e=>(ks=n._sqlite3_user_data=i.Yb)(e),Os=n._sqlite3_context_db_handle=e=>(Os=n._sqlite3_context_db_handle=i.Zb)(e),Qs=n._sqlite3_vtab_nochange=e=>(Qs=n._sqlite3_vtab_nochange=i._b)(e),Cs=n._sqlite3_vtab_in_first=(e,t)=>(Cs=n._sqlite3_vtab_in_first=i.$b)(e,t),Fs=n._sqlite3_vtab_in_next=(e,t)=>(Fs=n._sqlite3_vtab_in_next=i.ac)(e,t),Ps=n._sqlite3_aggregate_context=(e,t)=>(Ps=n._sqlite3_aggregate_context=i.bc)(e,t),Ds=n._sqlite3_get_auxdata=(e,t)=>(Ds=n._sqlite3_get_auxdata=i.cc)(e,t),Ms=n._sqlite3_set_auxdata=(e,t,r,_)=>(Ms=n._sqlite3_set_auxdata=i.dc)(e,t,r,_),Us=n._sqlite3_column_count=e=>(Us=n._sqlite3_column_count=i.ec)(e),zs=n._sqlite3_data_count=e=>(zs=n._sqlite3_data_count=i.fc)(e),Bs=n._sqlite3_column_blob=(e,t)=>(Bs=n._sqlite3_column_blob=i.gc)(e,t),Hs=n._sqlite3_column_bytes=(e,t)=>(Hs=n._sqlite3_column_bytes=i.hc)(e,t),Ws=n._sqlite3_column_bytes16=(e,t)=>(Ws=n._sqlite3_column_bytes16=i.ic)(e,t),js=n._sqlite3_column_double=(e,t)=>(js=n._sqlite3_column_double=i.jc)(e,t),Gs=n._sqlite3_column_text=(e,t)=>(Gs=n._sqlite3_column_text=i.kc)(e,t),Ks=n._sqlite3_column_value=(e,t)=>(Ks=n._sqlite3_column_value=i.lc)(e,t),Xs=n._sqlite3_column_text16=(e,t)=>(Xs=n._sqlite3_column_text16=i.mc)(e,t),Vs=n._sqlite3_column_type=(e,t)=>(Vs=n._sqlite3_column_type=i.nc)(e,t),Ys=n._sqlite3_column_name=(e,t)=>(Ys=n._sqlite3_column_name=i.oc)(e,t),$s=n._sqlite3_column_name16=(e,t)=>($s=n._sqlite3_column_name16=i.pc)(e,t),Zs=n._sqlite3_bind_blob=(e,t,r,_,o)=>(Zs=n._sqlite3_bind_blob=i.qc)(e,t,r,_,o),Js=n._sqlite3_bind_blob64=(e,t,r,_,o,a)=>(Js=n._sqlite3_bind_blob64=i.rc)(e,t,r,_,o,a),eo=n._sqlite3_bind_double=(e,t,r)=>(eo=n._sqlite3_bind_double=i.sc)(e,t,r),to=n._sqlite3_bind_int=(e,t,r)=>(to=n._sqlite3_bind_int=i.tc)(e,t,r),ro=n._sqlite3_bind_int64=(e,t,r,_)=>(ro=n._sqlite3_bind_int64=i.uc)(e,t,r,_),no=n._sqlite3_bind_null=(e,t)=>(no=n._sqlite3_bind_null=i.vc)(e,t),_o=n._sqlite3_bind_pointer=(e,t,r,_,o)=>(_o=n._sqlite3_bind_pointer=i.wc)(e,t,r,_,o),so=n._sqlite3_bind_text=(e,t,r,_,o)=>(so=n._sqlite3_bind_text=i.xc)(e,t,r,_,o),oo=n._sqlite3_bind_text64=(e,t,r,_,o,a,l)=>(oo=n._sqlite3_bind_text64=i.yc)(e,t,r,_,o,a,l),io=n._sqlite3_bind_text16=(e,t,r,_,o)=>(io=n._sqlite3_bind_text16=i.zc)(e,t,r,_,o),ao=n._sqlite3_bind_value=(e,t,r)=>(ao=n._sqlite3_bind_value=i.Ac)(e,t,r),lo=n._sqlite3_bind_zeroblob=(e,t,r)=>(lo=n._sqlite3_bind_zeroblob=i.Bc)(e,t,r),co=n._sqlite3_bind_zeroblob64=(e,t,r,_)=>(co=n._sqlite3_bind_zeroblob64=i.Cc)(e,t,r,_),uo=n._sqlite3_bind_parameter_count=e=>(uo=n._sqlite3_bind_parameter_count=i.Dc)(e),fo=n._sqlite3_bind_parameter_name=(e,t)=>(fo=n._sqlite3_bind_parameter_name=i.Ec)(e,t),po=n._sqlite3_bind_parameter_index=(e,t)=>(po=n._sqlite3_bind_parameter_index=i.Fc)(e,t),vo=n._sqlite3_db_handle=e=>(vo=n._sqlite3_db_handle=i.Gc)(e),mo=n._sqlite3_stmt_readonly=e=>(mo=n._sqlite3_stmt_readonly=i.Hc)(e),Eo=n._sqlite3_stmt_isexplain=e=>(Eo=n._sqlite3_stmt_isexplain=i.Ic)(e),qo=n._sqlite3_stmt_explain=(e,t)=>(qo=n._sqlite3_stmt_explain=i.Jc)(e,t),ho=n._sqlite3_stmt_busy=e=>(ho=n._sqlite3_stmt_busy=i.Kc)(e),bo=n._sqlite3_next_stmt=(e,t)=>(bo=n._sqlite3_next_stmt=i.Lc)(e,t),To=n._sqlite3_stmt_status=(e,t,r)=>(To=n._sqlite3_stmt_status=i.Mc)(e,t,r),wo=n._sqlite3_sql=e=>(wo=n._sqlite3_sql=i.Nc)(e),yo=n._sqlite3_expanded_sql=e=>(yo=n._sqlite3_expanded_sql=i.Oc)(e),So=n._sqlite3_value_numeric_type=e=>(So=n._sqlite3_value_numeric_type=i.Pc)(e),go=n._sqlite3_blob_open=(e,t,r,_,o,a,l,c)=>(go=n._sqlite3_blob_open=i.Qc)(e,t,r,_,o,a,l,c),Io=n._sqlite3_blob_close=e=>(Io=n._sqlite3_blob_close=i.Rc)(e),Lo=n._sqlite3_blob_read=(e,t,r,_)=>(Lo=n._sqlite3_blob_read=i.Sc)(e,t,r,_),xo=n._sqlite3_blob_write=(e,t,r,_)=>(xo=n._sqlite3_blob_write=i.Tc)(e,t,r,_),Ao=n._sqlite3_blob_bytes=e=>(Ao=n._sqlite3_blob_bytes=i.Uc)(e),No=n._sqlite3_blob_reopen=(e,t,r)=>(No=n._sqlite3_blob_reopen=i.Vc)(e,t,r),Ro=n._sqlite3_set_authorizer=(e,t,r)=>(Ro=n._sqlite3_set_authorizer=i.Wc)(e,t,r),ko=n._sqlite3_strglob=(e,t)=>(ko=n._sqlite3_strglob=i.Xc)(e,t),Oo=n._sqlite3_strlike=(e,t,r)=>(Oo=n._sqlite3_strlike=i.Yc)(e,t,r),Qo=n._sqlite3_errmsg=e=>(Qo=n._sqlite3_errmsg=i.Zc)(e),Co=n._sqlite3_auto_extension=e=>(Co=n._sqlite3_auto_extension=i._c)(e),Fo=n._sqlite3_cancel_auto_extension=e=>(Fo=n._sqlite3_cancel_auto_extension=i.$c)(e),Po=n._sqlite3_reset_auto_extension=()=>(Po=n._sqlite3_reset_auto_extension=i.ad)(),Do=n._sqlite3_prepare=(e,t,r,_,o)=>(Do=n._sqlite3_prepare=i.bd)(e,t,r,_,o),Mo=n._sqlite3_prepare_v3=(e,t,r,_,o,a)=>(Mo=n._sqlite3_prepare_v3=i.cd)(e,t,r,_,o,a),Uo=n._sqlite3_prepare16=(e,t,r,_,o)=>(Uo=n._sqlite3_prepare16=i.dd)(e,t,r,_,o),zo=n._sqlite3_prepare16_v2=(e,t,r,_,o)=>(zo=n._sqlite3_prepare16_v2=i.ed)(e,t,r,_,o),Bo=n._sqlite3_prepare16_v3=(e,t,r,_,o,a)=>(Bo=n._sqlite3_prepare16_v3=i.fd)(e,t,r,_,o,a),Ho=n._sqlite3_get_table=(e,t,r,_,o,a)=>(Ho=n._sqlite3_get_table=i.gd)(e,t,r,_,o,a),Wo=n._sqlite3_free_table=e=>(Wo=n._sqlite3_free_table=i.hd)(e),jo=n._sqlite3_create_module=(e,t,r,_)=>(jo=n._sqlite3_create_module=i.id)(e,t,r,_),Go=n._sqlite3_create_module_v2=(e,t,r,_,o)=>(Go=n._sqlite3_create_module_v2=i.jd)(e,t,r,_,o),Ko=n._sqlite3_drop_modules=(e,t)=>(Ko=n._sqlite3_drop_modules=i.kd)(e,t),Xo=n._sqlite3_declare_vtab=(e,t)=>(Xo=n._sqlite3_declare_vtab=i.ld)(e,t),Vo=n._sqlite3_vtab_on_conflict=e=>(Vo=n._sqlite3_vtab_on_conflict=i.md)(e),Yo=n._sqlite3_vtab_config=(e,t,r)=>(Yo=n._sqlite3_vtab_config=i.nd)(e,t,r),$o=n._sqlite3_vtab_collation=(e,t)=>($o=n._sqlite3_vtab_collation=i.od)(e,t),Zo=n._sqlite3_vtab_in=(e,t,r)=>(Zo=n._sqlite3_vtab_in=i.pd)(e,t,r),Jo=n._sqlite3_vtab_rhs_value=(e,t,r)=>(Jo=n._sqlite3_vtab_rhs_value=i.qd)(e,t,r),ei=n._sqlite3_vtab_distinct=e=>(ei=n._sqlite3_vtab_distinct=i.rd)(e),ti=n._sqlite3_keyword_name=(e,t,r)=>(ti=n._sqlite3_keyword_name=i.sd)(e,t,r),ri=n._sqlite3_keyword_count=()=>(ri=n._sqlite3_keyword_count=i.td)(),ni=n._sqlite3_keyword_check=(e,t)=>(ni=n._sqlite3_keyword_check=i.ud)(e,t),_i=n._sqlite3_complete=e=>(_i=n._sqlite3_complete=i.vd)(e),si=n._sqlite3_complete16=e=>(si=n._sqlite3_complete16=i.wd)(e),oi=n._sqlite3_libversion=()=>(oi=n._sqlite3_libversion=i.xd)(),ii=n._sqlite3_libversion_number=()=>(ii=n._sqlite3_libversion_number=i.yd)(),ai=n._sqlite3_threadsafe=()=>(ai=n._sqlite3_threadsafe=i.zd)(),li=n._sqlite3_initialize=()=>(li=n._sqlite3_initialize=i.Ad)(),ci=n._sqlite3_shutdown=()=>(ci=n._sqlite3_shutdown=i.Bd)(),ui=n._sqlite3_config=(e,t)=>(ui=n._sqlite3_config=i.Cd)(e,t),fi=n._sqlite3_db_mutex=e=>(fi=n._sqlite3_db_mutex=i.Dd)(e),di=n._sqlite3_db_release_memory=e=>(di=n._sqlite3_db_release_memory=i.Ed)(e),pi=n._sqlite3_db_cacheflush=e=>(pi=n._sqlite3_db_cacheflush=i.Fd)(e),vi=n._sqlite3_db_config=(e,t,r)=>(vi=n._sqlite3_db_config=i.Gd)(e,t,r),mi=n._sqlite3_last_insert_rowid=e=>(mi=n._sqlite3_last_insert_rowid=i.Hd)(e),Ei=n._sqlite3_set_last_insert_rowid=(e,t,r)=>(Ei=n._sqlite3_set_last_insert_rowid=i.Id)(e,t,r),qi=n._sqlite3_changes64=e=>(qi=n._sqlite3_changes64=i.Jd)(e),hi=n._sqlite3_changes=e=>(hi=n._sqlite3_changes=i.Kd)(e),bi=n._sqlite3_total_changes64=e=>(bi=n._sqlite3_total_changes64=i.Ld)(e),Ti=n._sqlite3_total_changes=e=>(Ti=n._sqlite3_total_changes=i.Md)(e),wi=n._sqlite3_txn_state=(e,t)=>(wi=n._sqlite3_txn_state=i.Nd)(e,t),yi=n._sqlite3_close=e=>(yi=n._sqlite3_close=i.Od)(e),Si=n._sqlite3_close_v2=e=>(Si=n._sqlite3_close_v2=i.Pd)(e),gi=n._sqlite3_busy_handler=(e,t,r)=>(gi=n._sqlite3_busy_handler=i.Qd)(e,t,r),Ii=n._sqlite3_progress_handler=(e,t,r,_)=>(Ii=n._sqlite3_progress_handler=i.Rd)(e,t,r,_),Li=n._sqlite3_busy_timeout=(e,t)=>(Li=n._sqlite3_busy_timeout=i.Sd)(e,t),xi=n._sqlite3_interrupt=e=>(xi=n._sqlite3_interrupt=i.Td)(e),Ai=n._sqlite3_is_interrupted=e=>(Ai=n._sqlite3_is_interrupted=i.Ud)(e),Ni=n._sqlite3_create_function=(e,t,r,_,o,a,l,c)=>(Ni=n._sqlite3_create_function=i.Vd)(e,t,r,_,o,a,l,c),Ri=n._sqlite3_create_function_v2=(e,t,r,_,o,a,l,c,E)=>(Ri=n._sqlite3_create_function_v2=i.Wd)(e,t,r,_,o,a,l,c,E),ki=n._sqlite3_create_window_function=(e,t,r,_,o,a,l,c,E,h)=>(ki=n._sqlite3_create_window_function=i.Xd)(e,t,r,_,o,a,l,c,E,h),Oi=n._sqlite3_create_function16=(e,t,r,_,o,a,l,c)=>(Oi=n._sqlite3_create_function16=i.Yd)(e,t,r,_,o,a,l,c),Qi=n._sqlite3_overload_function=(e,t,r)=>(Qi=n._sqlite3_overload_function=i.Zd)(e,t,r),Ci=n._sqlite3_trace_v2=(e,t,r,_)=>(Ci=n._sqlite3_trace_v2=i._d)(e,t,r,_),Fi=n._sqlite3_commit_hook=(e,t,r)=>(Fi=n._sqlite3_commit_hook=i.$d)(e,t,r),Pi=n._sqlite3_update_hook=(e,t,r)=>(Pi=n._sqlite3_update_hook=i.ae)(e,t,r),Di=n._sqlite3_rollback_hook=(e,t,r)=>(Di=n._sqlite3_rollback_hook=i.be)(e,t,r),Mi=n._sqlite3_autovacuum_pages=(e,t,r,_)=>(Mi=n._sqlite3_autovacuum_pages=i.ce)(e,t,r,_),Ui=n._sqlite3_wal_autocheckpoint=(e,t)=>(Ui=n._sqlite3_wal_autocheckpoint=i.de)(e,t),zi=n._sqlite3_wal_hook=(e,t,r)=>(zi=n._sqlite3_wal_hook=i.ee)(e,t,r),Bi=n._sqlite3_wal_checkpoint_v2=(e,t,r,_,o)=>(Bi=n._sqlite3_wal_checkpoint_v2=i.fe)(e,t,r,_,o),Hi=n._sqlite3_wal_checkpoint=(e,t)=>(Hi=n._sqlite3_wal_checkpoint=i.ge)(e,t),Wi=n._sqlite3_error_offset=e=>(Wi=n._sqlite3_error_offset=i.he)(e),ji=n._sqlite3_errmsg16=e=>(ji=n._sqlite3_errmsg16=i.ie)(e),Gi=n._sqlite3_errcode=e=>(Gi=n._sqlite3_errcode=i.je)(e),Ki=n._sqlite3_extended_errcode=e=>(Ki=n._sqlite3_extended_errcode=i.ke)(e),Xi=n._sqlite3_system_errno=e=>(Xi=n._sqlite3_system_errno=i.le)(e),Vi=n._sqlite3_errstr=e=>(Vi=n._sqlite3_errstr=i.me)(e),Yi=n._sqlite3_limit=(e,t,r)=>(Yi=n._sqlite3_limit=i.ne)(e,t,r),$i=n._sqlite3_open=(e,t)=>($i=n._sqlite3_open=i.oe)(e,t),Zi=n._sqlite3_open_v2=(e,t,r,_)=>(Zi=n._sqlite3_open_v2=i.pe)(e,t,r,_),Ji=n._sqlite3_open16=(e,t)=>(Ji=n._sqlite3_open16=i.qe)(e,t),ea=n._sqlite3_create_collation=(e,t,r,_,o)=>(ea=n._sqlite3_create_collation=i.re)(e,t,r,_,o),ta=n._sqlite3_create_collation_v2=(e,t,r,_,o,a)=>(ta=n._sqlite3_create_collation_v2=i.se)(e,t,r,_,o,a),ra=n._sqlite3_create_collation16=(e,t,r,_,o)=>(ra=n._sqlite3_create_collation16=i.te)(e,t,r,_,o),na=n._sqlite3_collation_needed=(e,t,r)=>(na=n._sqlite3_collation_needed=i.ue)(e,t,r),_a=n._sqlite3_collation_needed16=(e,t,r)=>(_a=n._sqlite3_collation_needed16=i.ve)(e,t,r),sa=n._sqlite3_get_clientdata=(e,t)=>(sa=n._sqlite3_get_clientdata=i.we)(e,t),oa=n._sqlite3_set_clientdata=(e,t,r,_)=>(oa=n._sqlite3_set_clientdata=i.xe)(e,t,r,_),ia=n._sqlite3_get_autocommit=e=>(ia=n._sqlite3_get_autocommit=i.ye)(e),aa=n._sqlite3_table_column_metadata=(e,t,r,_,o,a,l,c,E)=>(aa=n._sqlite3_table_column_metadata=i.ze)(e,t,r,_,o,a,l,c,E),la=n._sqlite3_sleep=e=>(la=n._sqlite3_sleep=i.Ae)(e),ca=n._sqlite3_extended_result_codes=(e,t)=>(ca=n._sqlite3_extended_result_codes=i.Be)(e,t),ua=n._sqlite3_file_control=(e,t,r,_)=>(ua=n._sqlite3_file_control=i.Ce)(e,t,r,_),fa=n._sqlite3_test_control=(e,t)=>(fa=n._sqlite3_test_control=i.De)(e,t),da=n._sqlite3_create_filename=(e,t,r,_,o)=>(da=n._sqlite3_create_filename=i.Ee)(e,t,r,_,o),pa=n._sqlite3_free_filename=e=>(pa=n._sqlite3_free_filename=i.Fe)(e),va=n._sqlite3_uri_parameter=(e,t)=>(va=n._sqlite3_uri_parameter=i.Ge)(e,t),ma=n._sqlite3_uri_key=(e,t)=>(ma=n._sqlite3_uri_key=i.He)(e,t),Ea=n._sqlite3_uri_boolean=(e,t,r)=>(Ea=n._sqlite3_uri_boolean=i.Ie)(e,t,r),qa=n._sqlite3_uri_int64=(e,t,r,_)=>(qa=n._sqlite3_uri_int64=i.Je)(e,t,r,_),ha=n._sqlite3_filename_database=e=>(ha=n._sqlite3_filename_database=i.Ke)(e),ba=n._sqlite3_filename_journal=e=>(ba=n._sqlite3_filename_journal=i.Le)(e),Ta=n._sqlite3_filename_wal=e=>(Ta=n._sqlite3_filename_wal=i.Me)(e),wa=n._sqlite3_db_name=(e,t)=>(wa=n._sqlite3_db_name=i.Ne)(e,t),ya=n._sqlite3_db_filename=(e,t)=>(ya=n._sqlite3_db_filename=i.Oe)(e,t),Sa=n._sqlite3_db_readonly=(e,t)=>(Sa=n._sqlite3_db_readonly=i.Pe)(e,t),ga=n._sqlite3_compileoption_used=e=>(ga=n._sqlite3_compileoption_used=i.Qe)(e),Ia=n._sqlite3_compileoption_get=e=>(Ia=n._sqlite3_compileoption_get=i.Re)(e),La=n._sqlite3_sourceid=()=>(La=n._sqlite3_sourceid=i.Se)(),xa=n._malloc=e=>(xa=n._malloc=i.Te)(e),Aa=n._free=e=>(Aa=n._free=i.Ue)(e),Na=n._RegisterExtensionFunctions=e=>(Na=n._RegisterExtensionFunctions=i.Ve)(e),Ra=n._getSqliteFree=()=>(Ra=n._getSqliteFree=i.We)(),ct=n._main=(e,t)=>(ct=n._main=i.Xe)(e,t),ka=n._libauthorizer_set_authorizer=(e,t,r)=>(ka=n._libauthorizer_set_authorizer=i.Ye)(e,t,r),Oa=n._libfunction_create_function=(e,t,r,_,o,a,l,c)=>(Oa=n._libfunction_create_function=i.Ze)(e,t,r,_,o,a,l,c),Qa=n._libprogress_progress_handler=(e,t,r,_)=>(Qa=n._libprogress_progress_handler=i._e)(e,t,r,_),Ca=n._libvfs_vfs_register=(e,t,r,_,o,a)=>(Ca=n._libvfs_vfs_register=i.$e)(e,t,r,_,o,a),ut=(e,t)=>(ut=i.bf)(e,t),ft=()=>(ft=i.cf)(),dt=e=>(dt=i.df)(e),pt=e=>(pt=i.ef)(e),vt=()=>(vt=i.ff)(),Wa=n._sqlite3_version=5472;n.getTempRet0=Dn,n.ccall=Ee,n.cwrap=Pn,n.addFunction=Cn,n.setValue=Ae,n.getValue=$e,n.UTF8ToString=ce,n.stringToUTF8=se,n.lengthBytesUTF8=pe,n.intArrayFromString=Me,n.intArrayToString=Wn,n.AsciiToString=zn,n.UTF16ToString=Bn,n.stringToUTF16=Mn,n.UTF32ToString=Hn,n.stringToUTF32=Un,n.writeArrayToMemory=it;var Re;be=function e(){Re||mt(),Re||(be=e)};function Fa(){var e=ct,t=0,r=0;try{var _=e(t,r);return In(_,!0),_}catch(o){return Ln(o)}}function mt(){if(le>0||(Rt(),le>0))return;function e(){Re||(Re=!0,n.calledRun=!0,!W&&(kt(),Ot(),ie(n),n.onRuntimeInitialized?.(),Et&&Fa(),Qt()))}n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),e()},1)):e()}if(n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();var Et=!0;return n.noInitialRun&&(Et=!1),mt(),function(){let e=Object.getPrototypeOf(async function(){}).constructor,t=0;n.set_authorizer=function(r,_,o){t&&(n.deleteCallback(t),n._sqlite3_free(t),t=0),t=n._sqlite3_malloc(4),Ae(t,_ instanceof e?1:0,"i32");let a=Ee("libauthorizer_set_authorizer","number",["number","number","number"],[r,_?1:0,t]);return!a&&_&&n.setCallback(t,(l,c,E,h,g,A)=>_(o,c,E,h,g,A)),a}}(),function(){let e=Object.getPrototypeOf(async function(){}).constructor,t=["xFunc","xStep","xFinal"],r=new Map;n.create_function=function(_,o,a,l,c,E,h,g){let A=n._sqlite3_malloc(4),x={xFunc:E,xStep:h,xFinal:g};Ae(A,t.reduce((b,M,X)=>x[M]instanceof e?b|1<o(a))}}(),function(){let e=["xOpen","xDelete","xAccess","xFullPathname","xRandomness","xSleep","xCurrentTime","xGetLastError","xCurrentTimeInt64","xClose","xRead","xWrite","xTruncate","xSync","xFileSize","xLock","xUnlock","xCheckReservedLock","xFileControl","xSectorSize","xDeviceCharacteristics","xShmMap","xShmLock","xShmBarrier","xShmUnmap"],t=new Map;n.vfs_register=function(r,_){let o=0,a=0;e.forEach((c,E)=>{r[c]&&(o|=1<>32n,f=BigInt(Number.MIN_SAFE_INTEGER)>>32n;return function(u,v){return v>d||v2147483647||q<-2147483648)return 25;let w=f(u,v,q);return B(d,w,G.get(u))}}(),p.bind_int64=function(){let d="sqlite3_bind_int64",f=m.cwrap(d,...I("nnnn:n"));return function(u,v,q){if(F(u),q>gt||q>32n,D=f(u,v,Number(w),Number(R));return B(d,D,G.get(u))}}(),p.bind_null=function(){let d="sqlite3_bind_null",f=m.cwrap(d,...I("nn:n"));return function(u,v){F(u);let q=f(u,v);return B(d,q,G.get(u))}}(),p.bind_parameter_name=function(){let f=m.cwrap("sqlite3_bind_parameter_name",...I("n:s"));return function(u,v){return F(u),f(u,v)}}(),p.bind_text=function(){let d="sqlite3_bind_text",f=m.cwrap(d,...I("nnnnn:n"));return function(u,v,q){F(u);let w=re(q),R=f(u,v,w,-1,K);return B(d,R,G.get(u))}}(),p.changes=function(){let f=m.cwrap("sqlite3_changes",...I("n:n"));return function(u){return fe(u),f(u)}}(),p.close=function(){let d="sqlite3_close",f=m.cwrap(d,...I("n:n"),{async:Se});return async function(u){fe(u);let v=await f(u);return ne.delete(u),B(d,v,u)}}(),p.column=function(d,f){F(d);let u=p.column_type(d,f);switch(u){case 4:return p.column_blob(d,f);case 2:return p.column_double(d,f);case 1:let v=p.column_int(d,f),q=m.getTempRet0();return ge(v,q);case 5:return null;case 3:return p.column_text(d,f);default:throw new ue("unknown type",u)}},p.column_blob=function(){let f=m.cwrap("sqlite3_column_blob",...I("nn:n"));return function(u,v){F(u);let q=p.column_bytes(u,v),w=f(u,v);return m.HEAPU8.subarray(w,w+q)}}(),p.column_bytes=function(){let f=m.cwrap("sqlite3_column_bytes",...I("nn:n"));return function(u,v){return F(u),f(u,v)}}(),p.column_count=function(){let f=m.cwrap("sqlite3_column_count",...I("n:n"));return function(u){return F(u),f(u)}}(),p.column_double=function(){let f=m.cwrap("sqlite3_column_double",...I("nn:n"));return function(u,v){return F(u),f(u,v)}}(),p.column_int=function(){let f=m.cwrap("sqlite3_column_int64",...I("nn:n"));return function(u,v){return F(u),f(u,v)}}(),p.column_int64=function(){let f=m.cwrap("sqlite3_column_int64",...I("nn:n"));return function(u,v){F(u);let q=f(u,v),w=m.getTempRet0();return he(q,w)}}(),p.column_name=function(){let f=m.cwrap("sqlite3_column_name",...I("nn:s"));return function(u,v){return F(u),f(u,v)}}(),p.column_names=function(d){let f=[],u=p.column_count(d);for(let v=0;vk(C,m.HEAP32.subarray(Z/4,Z/4+U)):(C,U,Z)=>k(C,m.HEAP32.subarray(Z/4,Z/4+U))}let j=m.create_function(d,f,u,v,q,w&&W(w),R&&W(R),D);return B("sqlite3_create_function",j,d)},p.data_count=function(){let f=m.cwrap("sqlite3_data_count",...I("n:n"));return function(u){return F(u),f(u)}}(),p.exec=async function(d,f,u){for await(let v of p.statements(d,f)){let q;for(;await p.step(v)===100;)if(u){q=q??p.column_names(v);let w=p.row(v);await u(w,q)}}return 0},p.finalize=function(){let f=m.cwrap("sqlite3_finalize",...I("n:n"),{async:Se});return async function(u){let v=await f(u);return G.delete(u),v}}(),p.get_autocommit=function(){let f=m.cwrap("sqlite3_get_autocommit",...I("n:n"));return function(u){return f(u)}}(),p.libversion=function(){let f=m.cwrap("sqlite3_libversion",...I(":s"));return function(){return f()}}(),p.libversion_number=function(){let f=m.cwrap("sqlite3_libversion_number",...I(":n"));return function(){return f()}}(),p.limit=function(){let f=m.cwrap("sqlite3_limit",...I("nnn:n"));return function(u,v,q){return f(u,v,q)}}(),p.open_v2=function(){let d="sqlite3_open_v2",f=m.cwrap(d,...I("snnn:n"),{async:Se});return async function(u,v,q){v=v||6,q=re(q);try{let w=await ae(()=>f(u,ie[0],v,q)),R=m.getValue(ie[0],"*");return ne.add(R),m.ccall("RegisterExtensionFunctions","void",["number"],[R]),B(d,w),R}finally{m._sqlite3_free(q)}}}(),p.progress_handler=function(d,f,u,v){fe(d),m.progress_handler(d,f,u,v)},p.reset=function(){let d="sqlite3_reset",f=m.cwrap(d,...I("n:n"),{async:Se});return async function(u){F(u);let v=await f(u);return B(d,v,G.get(u))}}(),p.result=function(d,f){switch(typeof f){case"number":f===(f|0)?p.result_int(d,f):p.result_double(d,f);break;case"string":p.result_text(d,f);break;default:if(f instanceof Uint8Array||Array.isArray(f))p.result_blob(d,f);else if(f===null)p.result_null(d);else{if(typeof f=="bigint")return p.result_int64(d,f);console.warn("unknown result converted to null",f),p.result_null(d)}break}},p.result_blob=function(){let f=m.cwrap("sqlite3_result_blob",...I("nnnn:n"));return function(u,v){let q=v.byteLength??v.length,w=m._sqlite3_malloc(q);m.HEAPU8.subarray(w).set(v),f(u,w,q,K)}}(),p.result_double=function(){let f=m.cwrap("sqlite3_result_double",...I("nn:n"));return function(u,v){f(u,v)}}(),p.result_int=function(){let f=m.cwrap("sqlite3_result_int",...I("nn:n"));return function(u,v){f(u,v)}}(),p.result_int64=function(){let f=m.cwrap("sqlite3_result_int64",...I("nnn:n"));return function(u,v){if(v>gt||v>32n;f(u,Number(q),Number(w))}}(),p.result_null=function(){let f=m.cwrap("sqlite3_result_null",...I("n:n"));return function(u){f(u)}}(),p.result_text=function(){let f=m.cwrap("sqlite3_result_text",...I("nnnn:n"));return function(u,v){let q=re(v);f(u,q,-1,K)}}(),p.row=function(d){let f=[],u=p.data_count(d);for(let v=0;vR(v(D,W,j,k,C,U)):(D,W,j,k,C,U)=>R(v(D,W,j,k,C,U))}let w=m.set_authorizer(d,q(f),u);return B("sqlite3_set_authorizer",w,d)},p.sql=function(){let f=m.cwrap("sqlite3_sql",...I("n:s"));return function(u){return F(u),f(u)}}(),p.statements=function(d,f,u={}){let v=m.cwrap("sqlite3_prepare_v3","number",["number","number","number","number","number","number"],{async:!0});return async function*(){let q=[];try{let U=function(){C&&!u.unscoped&&p.finalize(C),C=0},w=new TextEncoder().encode(f),R=w.byteLength-w.byteLength%4+12,D=m._sqlite3_malloc(R),W=D+w.byteLength+1;q.push(()=>m._sqlite3_free(D)),m.HEAPU8.set(w,D),m.HEAPU8[W-1]=0;let j=D+R-8,k=D+R-4,C;q.push(U),m.setValue(k,D,"*");do{U();let Z=m.getValue(k,"*"),y=await ae(()=>v(d,Z,W-k,u.flags||0,j,k));y!==0&&B("sqlite3_prepare_v3",y,d),C=m.getValue(j,"*"),C&&(G.set(C,d),yield C)}while(C)}finally{for(;q.length;)q.pop()()}}()},p.step=function(){let d="sqlite3_step",f=m.cwrap(d,...I("n:n"),{async:Se});return async function(u){F(u);let v=await ae(()=>f(u));return B(d,v,G.get(u),[100,101])}}(),p.value=function(d){let f=p.value_type(d);switch(f){case 4:return p.value_blob(d);case 2:return p.value_double(d);case 1:let u=p.value_int(d),v=m.getTempRet0();return ge(u,v);case 5:return null;case 3:return p.value_text(d);default:throw new ue("unknown type",f)}},p.value_blob=function(){let f=m.cwrap("sqlite3_value_blob",...I("n:n"));return function(u){let v=p.value_bytes(u),q=f(u);return m.HEAPU8.subarray(q,q+v)}}(),p.value_bytes=function(){let f=m.cwrap("sqlite3_value_bytes",...I("n:n"));return function(u){return f(u)}}(),p.value_double=function(){let f=m.cwrap("sqlite3_value_double",...I("n:n"));return function(u){return f(u)}}(),p.value_int=function(){let f=m.cwrap("sqlite3_value_int64",...I("n:n"));return function(u){return f(u)}}(),p.value_int64=function(){let f=m.cwrap("sqlite3_value_int64",...I("n:n"));return function(u){let v=f(u),q=m.getTempRet0();return he(v,q)}}(),p.value_text=function(){let f=m.cwrap("sqlite3_value_text",...I("n:s"));return function(u){return f(u)}}(),p.value_type=function(){let f=m.cwrap("sqlite3_value_type",...I("n:n"));return function(u){return f(u)}}(),p.vfs_register=function(d,f){let u=m.vfs_register(d,f);return B("sqlite3_vfs_register",u)};function B(d,f,u=null,v=[0]){if(v.includes(f))return f;let q=u?m.ccall("sqlite3_errmsg","string",["number"],[u]):d;throw new ue(q,f)}async function ae(d){let f;do m.retryOps.length&&(await Promise.all(m.retryOps),m.retryOps=[]),f=await d();while(f&&m.retryOps.length);return f}return p}function I(m){let p=[],K=m.match(/([ns@]*):([nsv@])/);switch(K[2]){case"n":p.push("number");break;case"s":p.push("string");break;case"v":p.push(null);break}let n=[];for(let ie of K[1])switch(ie){case"n":n.push("number");break;case"s":n.push("string");break}return p.push(n),p}var ja=(()=>{var m=import.meta.url;return function(p={}){var K,n=p,ie,re,he=new Promise((e,t)=>{ie=e,re=t}),ge=typeof window=="object",ne=typeof importScripts=="function",fe=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",G=Object.assign({},n),F=[],B="./this.program",ae=(e,t)=>{throw t},d="";function f(e){return n.locateFile?n.locateFile(e,d):d+e}var u,v;(ge||ne)&&(ne?d=self.location.href:typeof document<"u"&&document.currentScript&&(d=document.currentScript.src),m&&(d=m),d.startsWith("blob:")?d="":d=d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1),ne&&(v=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),u=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var q=n.print||console.log.bind(console),w=n.printErr||console.error.bind(console);Object.assign(n,G),G=null,n.arguments&&(F=n.arguments),n.thisProgram&&(B=n.thisProgram),n.quit&&(ae=n.quit);var R;n.wasmBinary&&(R=n.wasmBinary);var D,W=!1,j,k,C,U,Z,y,z,Oe,Qe;function He(){var e=D.buffer;n.HEAP8=k=new Int8Array(e),n.HEAP16=U=new Int16Array(e),n.HEAPU8=C=new Uint8Array(e),n.HEAPU16=Z=new Uint16Array(e),n.HEAP32=y=new Int32Array(e),n.HEAPU32=z=new Uint32Array(e),n.HEAPF32=Oe=new Float32Array(e),n.HEAPF64=Qe=new Float64Array(e)}var We=[],je=[],Rt=[],Ge=[],kt=!1;function Ot(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Pt(n.preRun.shift());xe(We)}function Qt(){kt=!0,!n.noFSInit&&!s.init.initialized&&s.init(),s.ignorePermissions=!1,se.init(),xe(je)}function Ct(){xe(Rt)}function Ft(){if(n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)Mt(n.postRun.shift());xe(Ge)}function Pt(e){We.unshift(e)}function Dt(e){je.unshift(e)}function Mt(e){Ge.unshift(e)}var le=0,Ce=null,be=null;function Ka(e){return e}function Fe(e){le++,n.monitorRunDependencies?.(le)}function Ie(e){if(le--,n.monitorRunDependencies?.(le),le==0&&(Ce!==null&&(clearInterval(Ce),Ce=null),be)){var t=be;be=null,t()}}function _e(e){n.onAbort?.(e),e="Aborted("+e+")",w(e),W=!0,j=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw re(t),t}var Ut="data:application/octet-stream;base64,",Ke=e=>e.startsWith(Ut);function zt(){if(n.locateFile){var e="wa-sqlite.wasm";return Ke(e)?e:f(e)}return new URL("wa-sqlite.wasm",import.meta.url).href}var Le;function Ve(e){if(e==Le&&R)return new Uint8Array(R);if(v)return v(e);throw"both async and sync fetching of the wasm failed"}function Bt(e){return R?Promise.resolve().then(()=>Ve(e)):u(e).then(t=>new Uint8Array(t),()=>Ve(e))}function Xe(e,t,r){return Bt(e).then(_=>WebAssembly.instantiate(_,t)).then(r,_=>{w(`failed to asynchronously prepare wasm: ${_}`),_e(_)})}function Ht(e,t,r,_){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Ke(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(o=>{var a=WebAssembly.instantiateStreaming(o,r);return a.then(_,function(l){return w(`wasm streaming compile failed: ${l}`),w("falling back to ArrayBuffer instantiation"),Xe(t,r,_)})}):Xe(t,r,_)}function Wt(){return{a:Kn}}function jt(){var e=Wt();function t(_,o){return i=_.exports,D=i.ja,He(),ve=i.af,Dt(i.ka),Ie("wasm-instantiate"),i}Fe("wasm-instantiate");function r(_){t(_.instance)}if(n.instantiateWasm)try{return n.instantiateWasm(e,t)}catch(_){w(`Module.instantiateWasm callback failed with error: ${_}`),re(_)}return Le||(Le=zt()),Ht(R,Le,e,r).catch(re),{}}var S,P;function Ye(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var xe=e=>{for(;e.length>0;)e.shift()(n)};function $e(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":return k[e];case"i8":return k[e];case"i16":return U[e>>1];case"i32":return y[e>>2];case"i64":_e("to do getValue(i64) use WASM_BIGINT");case"float":return Oe[e>>2];case"double":return Qe[e>>3];case"*":return z[e>>2];default:_e(`invalid type for getValue: ${t}`)}}var Gt=n.noExitRuntime||!0;function Ae(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":k[e]=t;break;case"i8":k[e]=t;break;case"i16":U[e>>1]=t;break;case"i32":y[e>>2]=t;break;case"i64":_e("to do setValue(i64) use WASM_BIGINT");case"float":Oe[e>>2]=t;break;case"double":Qe[e>>3]=t;break;case"*":z[e>>2]=t;break;default:_e(`invalid type for setValue: ${r}`)}}var Kt=e=>dt(e),Vt=()=>vt(),Ze=typeof TextDecoder<"u"?new TextDecoder:void 0,de=(e,t,r)=>{for(var _=t+r,o=t;e[o]&&!(o>=_);)++o;if(o-t>16&&e.buffer&&Ze)return Ze.decode(e.subarray(t,o));for(var a="";t>10,56320|h&1023)}}return a},ce=(e,t)=>e?de(C,e,t):"",Xt=(e,t,r,_)=>{_e(`Assertion failed: ${ce(e)}, at: `+[t?ce(t):"unknown filename",r,_?ce(_):"unknown function"])},Q={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var r=0,_=e.length-1;_>=0;_--){var o=e[_];o==="."?e.splice(_,1):o===".."?(e.splice(_,1),r++):r&&(e.splice(_,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=Q.isAbs(e),r=e.substr(-1)==="/";return e=Q.normalizeArray(e.split("/").filter(_=>!!_),!t).join("/"),!e&&!t&&(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=Q.splitPath(e),r=t[0],_=t[1];return!r&&!_?".":(_&&(_=_.substr(0,_.length-1)),r+_)},basename:e=>{if(e==="/")return"/";e=Q.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>Q.normalize(e.join("/")),join2:(e,t)=>Q.normalize(e+"/"+t)},Yt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);_e("initRandomDevice")},Je=e=>(Je=Yt())(e),ee={resolve:(...e)=>{for(var t="",r=!1,_=e.length-1;_>=-1&&!r;_--){var o=_>=0?e[_]:s.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";t=o+"/"+t,r=Q.isAbs(o)}return t=Q.normalizeArray(t.split("/").filter(a=>!!a),!r).join("/"),(r?"/":"")+t||"."},relative:(e,t)=>{e=ee.resolve(e).substr(1),t=ee.resolve(t).substr(1);function r(h){for(var g=0;g=0&&h[A]==="";A--);return g>A?[]:h.slice(g,A-g+1)}for(var _=r(e.split("/")),o=r(t.split("/")),a=Math.min(_.length,o.length),l=a,c=0;c{for(var t=0,r=0;r=55296&&_<=57343?(t+=4,++r):t+=3}return t},De=(e,t,r,_)=>{if(!(_>0))return 0;for(var o=r,a=r+_-1,l=0;l=55296&&c<=57343){var E=e.charCodeAt(++l);c=65536+((c&1023)<<10)|E&1023}if(c<=127){if(r>=a)break;t[r++]=c}else if(c<=2047){if(r+1>=a)break;t[r++]=192|c>>6,t[r++]=128|c&63}else if(c<=65535){if(r+2>=a)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|c&63}else{if(r+3>=a)break;t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|c&63}}return t[r]=0,r-o};function Me(e,t,r){var _=r>0?r:pe(e)+1,o=new Array(_),a=De(e,o,0,o.length);return t&&(o.length=a),o}var $t=()=>{if(!Pe.length){var e=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=` +`)),!e)return null;Pe=Me(e,!0)}return Pe.shift()},se={ttys:[],init(){},shutdown(){},register(e,t){se.ttys[e]={input:[],output:[],ops:t},s.registerDevice(e,se.stream_ops)},stream_ops:{open(e){var t=se.ttys[e.node.rdev];if(!t)throw new s.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,_,o){if(!e.tty||!e.tty.ops.get_char)throw new s.ErrnoError(60);for(var a=0,l=0;l<_;l++){var c;try{c=e.tty.ops.get_char(e.tty)}catch{throw new s.ErrnoError(29)}if(c===void 0&&a===0)throw new s.ErrnoError(6);if(c==null)break;a++,t[r+l]=c}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,_,o){if(!e.tty||!e.tty.ops.put_char)throw new s.ErrnoError(60);try{for(var a=0;a<_;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch{throw new s.ErrnoError(29)}return _&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char(e){return $t()},put_char(e,t){t===null||t===10?(q(de(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(q(de(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,t,r){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(w(de(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(w(de(e.output,0)),e.output=[])}}},Zt=(e,t)=>(C.fill(0,e,e+t),e),Jt=(e,t)=>Math.ceil(e/t)*t,et=e=>{e=Jt(e,65536);var t=ut(65536,e);return t?Zt(t,e):0},L={ops_table:null,mount(e){return L.createNode(null,"/",16895,0)},createNode(e,t,r,_){if(s.isBlkdev(r)||s.isFIFO(r))throw new s.ErrnoError(63);L.ops_table||={dir:{node:{getattr:L.node_ops.getattr,setattr:L.node_ops.setattr,lookup:L.node_ops.lookup,mknod:L.node_ops.mknod,rename:L.node_ops.rename,unlink:L.node_ops.unlink,rmdir:L.node_ops.rmdir,readdir:L.node_ops.readdir,symlink:L.node_ops.symlink},stream:{llseek:L.stream_ops.llseek}},file:{node:{getattr:L.node_ops.getattr,setattr:L.node_ops.setattr},stream:{llseek:L.stream_ops.llseek,read:L.stream_ops.read,write:L.stream_ops.write,allocate:L.stream_ops.allocate,mmap:L.stream_ops.mmap,msync:L.stream_ops.msync}},link:{node:{getattr:L.node_ops.getattr,setattr:L.node_ops.setattr,readlink:L.node_ops.readlink},stream:{}},chrdev:{node:{getattr:L.node_ops.getattr,setattr:L.node_ops.setattr},stream:s.chrdev_stream_ops}};var o=s.createNode(e,t,r,_);return s.isDir(o.mode)?(o.node_ops=L.ops_table.dir.node,o.stream_ops=L.ops_table.dir.stream,o.contents={}):s.isFile(o.mode)?(o.node_ops=L.ops_table.file.node,o.stream_ops=L.ops_table.file.stream,o.usedBytes=0,o.contents=null):s.isLink(o.mode)?(o.node_ops=L.ops_table.link.node,o.stream_ops=L.ops_table.link.stream):s.isChrdev(o.mode)&&(o.node_ops=L.ops_table.chrdev.node,o.stream_ops=L.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){var _=1024*1024;t=Math.max(t,r*(r<_?2:1.125)>>>0),r!=0&&(t=Math.max(t,256));var o=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=s.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,s.isDir(e.mode)?t.size=4096:s.isFile(e.mode)?t.size=e.usedBytes:s.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&L.resizeFileStorage(e,t.size)},lookup(e,t){throw s.genericErrors[44]},mknod(e,t,r,_){return L.createNode(e,t,r,_)},rename(e,t,r){if(s.isDir(e.mode)){var _;try{_=s.lookupNode(t,r)}catch{}if(_)for(var o in _.contents)throw new s.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=s.lookupNode(e,t);for(var _ in r.contents)throw new s.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var _=L.createNode(e,t,41471,0);return _.link=r,_},readlink(e){if(!s.isLink(e.mode))throw new s.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,_,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var l=Math.min(e.node.usedBytes-o,_);if(l>8&&a.subarray)t.set(a.subarray(o,o+l),r);else for(var c=0;c0||r+t{var o=_?"":`al ${e}`;u(e).then(a=>{t(new Uint8Array(a)),o&&Ie(o)},a=>{if(r)r();else throw`Loading data file "${e}" failed.`}),o&&Fe(o)},tr=(e,t,r,_,o,a)=>{s.createDataFile(e,t,r,_,o,a)},rr=n.preloadPlugins||[],nr=(e,t,r,_)=>{typeof Browser<"u"&&Browser.init();var o=!1;return rr.forEach(a=>{o||a.canHandle(t)&&(a.handle(e,t,r,_),o=!0)}),o},_r=(e,t,r,_,o,a,l,c,E,h)=>{var g=t?ee.resolve(Q.join2(e,t)):e,A=`cp ${g}`;function x(T){function b(M){h?.(),c||tr(e,t,M,_,o,E),a?.(),Ie(A)}nr(T,g,b,()=>{l?.(),Ie(A)})||b(T)}Fe(A),typeof r=="string"?er(r,x,l):x(r)},sr=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},r=t[e];if(typeof r>"u")throw new Error(`Unknown file open mode: ${e}`);return r},Ue=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},s={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,r,_){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=s.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=_,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return s.isDir(this.mode)}get isDevice(){return s.isChrdev(this.mode)}},lookupPath(e,t={}){if(e=ee.resolve(e),!e)return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};if(t=Object.assign(r,t),t.recurse_count>8)throw new s.ErrnoError(32);for(var _=e.split("/").filter(A=>!!A),o=s.root,a="/",l=0;l<_.length;l++){var c=l===_.length-1;if(c&&t.parent)break;if(o=s.lookupNode(o,_[l]),a=Q.join2(a,_[l]),s.isMountpoint(o)&&(!c||c&&t.follow_mount)&&(o=o.mounted.root),!c||t.follow)for(var E=0;s.isLink(o.mode);){var h=s.readlink(a);a=ee.resolve(Q.dirname(a),h);var g=s.lookupPath(a,{recurse_count:t.recurse_count+1});if(o=g.node,E++>40)throw new s.ErrnoError(32)}}return{path:a,node:o}},getPath(e){for(var t;;){if(s.isRoot(e)){var r=e.mount.mountpoint;return t?r[r.length-1]!=="/"?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,_=0;_>>0)%s.nameTable.length},hashAddNode(e){var t=s.hashName(e.parent.id,e.name);e.name_next=s.nameTable[t],s.nameTable[t]=e},hashRemoveNode(e){var t=s.hashName(e.parent.id,e.name);if(s.nameTable[t]===e)s.nameTable[t]=e.name_next;else for(var r=s.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=s.mayLookup(e);if(r)throw new s.ErrnoError(r);for(var _=s.hashName(e.id,t),o=s.nameTable[_];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return s.lookup(e,t)},createNode(e,t,r,_){var o=new s.FSNode(e,t,r,_);return s.hashAddNode(o),o},destroyNode(e){s.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return s.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!s.isDir(e.mode))return 54;var t=s.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{var r=s.lookupNode(e,t);return 20}catch{}return s.nodePermissions(e,"wx")},mayDelete(e,t,r){var _;try{_=s.lookupNode(e,t)}catch(a){return a.errno}var o=s.nodePermissions(e,"wx");if(o)return o;if(r){if(!s.isDir(_.mode))return 54;if(s.isRoot(_)||s.getPath(_)===s.cwd())return 10}else if(s.isDir(_.mode))return 31;return 0},mayOpen(e,t){return e?s.isLink(e.mode)?32:s.isDir(e.mode)&&(s.flagsToPermissionString(t)!=="r"||t&512)?31:s.nodePermissions(e,s.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=s.MAX_OPEN_FDS;e++)if(!s.streams[e])return e;throw new s.ErrnoError(33)},getStreamChecked(e){var t=s.getStream(e);if(!t)throw new s.ErrnoError(8);return t},getStream:e=>s.streams[e],createStream(e,t=-1){return e=Object.assign(new s.FSStream,e),t==-1&&(t=s.nextfd()),e.fd=t,s.streams[t]=e,e},closeStream(e){s.streams[e]=null},dupStream(e,t=-1){var r=s.createStream(e,t);return r.stream_ops?.dup?.(r),r},chrdev_stream_ops:{open(e){var t=s.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new s.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){s.devices[e]={stream_ops:t}},getDevice:e=>s.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var _=r.pop();t.push(_),r.push(..._.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),s.syncFSRequests++,s.syncFSRequests>1&&w(`warning: ${s.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=s.getMounts(s.root.mount),_=0;function o(l){return s.syncFSRequests--,t(l)}function a(l){if(l)return a.errored?void 0:(a.errored=!0,o(l));++_>=r.length&&o(null)}r.forEach(l=>{if(!l.type.syncfs)return a(null);l.type.syncfs(l,e,a)})},mount(e,t,r){var _=r==="/",o=!r,a;if(_&&s.root)throw new s.ErrnoError(10);if(!_&&!o){var l=s.lookupPath(r,{follow_mount:!1});if(r=l.path,a=l.node,s.isMountpoint(a))throw new s.ErrnoError(10);if(!s.isDir(a.mode))throw new s.ErrnoError(54)}var c={type:e,opts:t,mountpoint:r,mounts:[]},E=e.mount(c);return E.mount=c,c.root=E,_?s.root=E:a&&(a.mounted=c,a.mount&&a.mount.mounts.push(c)),E},unmount(e){var t=s.lookupPath(e,{follow_mount:!1});if(!s.isMountpoint(t.node))throw new s.ErrnoError(28);var r=t.node,_=r.mounted,o=s.getMounts(_);Object.keys(s.nameTable).forEach(l=>{for(var c=s.nameTable[l];c;){var E=c.name_next;o.includes(c.mount)&&s.destroyNode(c),c=E}}),r.mounted=null;var a=r.mount.mounts.indexOf(_);r.mount.mounts.splice(a,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,r){var _=s.lookupPath(e,{parent:!0}),o=_.node,a=Q.basename(e);if(!a||a==="."||a==="..")throw new s.ErrnoError(28);var l=s.mayCreate(o,a);if(l)throw new s.ErrnoError(l);if(!o.node_ops.mknod)throw new s.ErrnoError(63);return o.node_ops.mknod(o,a,t,r)},create(e,t){return t=t!==void 0?t:438,t&=4095,t|=32768,s.mknod(e,t,0)},mkdir(e,t){return t=t!==void 0?t:511,t&=1023,t|=16384,s.mknod(e,t,0)},mkdirTree(e,t){for(var r=e.split("/"),_="",o=0;o"u"&&(r=t,t=438),t|=8192,s.mknod(e,t,r)},symlink(e,t){if(!ee.resolve(e))throw new s.ErrnoError(44);var r=s.lookupPath(t,{parent:!0}),_=r.node;if(!_)throw new s.ErrnoError(44);var o=Q.basename(t),a=s.mayCreate(_,o);if(a)throw new s.ErrnoError(a);if(!_.node_ops.symlink)throw new s.ErrnoError(63);return _.node_ops.symlink(_,o,e)},rename(e,t){var r=Q.dirname(e),_=Q.dirname(t),o=Q.basename(e),a=Q.basename(t),l,c,E;if(l=s.lookupPath(e,{parent:!0}),c=l.node,l=s.lookupPath(t,{parent:!0}),E=l.node,!c||!E)throw new s.ErrnoError(44);if(c.mount!==E.mount)throw new s.ErrnoError(75);var h=s.lookupNode(c,o),g=ee.relative(e,_);if(g.charAt(0)!==".")throw new s.ErrnoError(28);if(g=ee.relative(t,r),g.charAt(0)!==".")throw new s.ErrnoError(55);var A;try{A=s.lookupNode(E,a)}catch{}if(h!==A){var x=s.isDir(h.mode),T=s.mayDelete(c,o,x);if(T)throw new s.ErrnoError(T);if(T=A?s.mayDelete(E,a,x):s.mayCreate(E,a),T)throw new s.ErrnoError(T);if(!c.node_ops.rename)throw new s.ErrnoError(63);if(s.isMountpoint(h)||A&&s.isMountpoint(A))throw new s.ErrnoError(10);if(E!==c&&(T=s.nodePermissions(c,"w"),T))throw new s.ErrnoError(T);s.hashRemoveNode(h);try{c.node_ops.rename(h,E,a),h.parent=E}catch(b){throw b}finally{s.hashAddNode(h)}}},rmdir(e){var t=s.lookupPath(e,{parent:!0}),r=t.node,_=Q.basename(e),o=s.lookupNode(r,_),a=s.mayDelete(r,_,!0);if(a)throw new s.ErrnoError(a);if(!r.node_ops.rmdir)throw new s.ErrnoError(63);if(s.isMountpoint(o))throw new s.ErrnoError(10);r.node_ops.rmdir(r,_),s.destroyNode(o)},readdir(e){var t=s.lookupPath(e,{follow:!0}),r=t.node;if(!r.node_ops.readdir)throw new s.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var t=s.lookupPath(e,{parent:!0}),r=t.node;if(!r)throw new s.ErrnoError(44);var _=Q.basename(e),o=s.lookupNode(r,_),a=s.mayDelete(r,_,!1);if(a)throw new s.ErrnoError(a);if(!r.node_ops.unlink)throw new s.ErrnoError(63);if(s.isMountpoint(o))throw new s.ErrnoError(10);r.node_ops.unlink(r,_),s.destroyNode(o)},readlink(e){var t=s.lookupPath(e),r=t.node;if(!r)throw new s.ErrnoError(44);if(!r.node_ops.readlink)throw new s.ErrnoError(28);return ee.resolve(s.getPath(r.parent),r.node_ops.readlink(r))},stat(e,t){var r=s.lookupPath(e,{follow:!t}),_=r.node;if(!_)throw new s.ErrnoError(44);if(!_.node_ops.getattr)throw new s.ErrnoError(63);return _.node_ops.getattr(_)},lstat(e){return s.stat(e,!0)},chmod(e,t,r){var _;if(typeof e=="string"){var o=s.lookupPath(e,{follow:!r});_=o.node}else _=e;if(!_.node_ops.setattr)throw new s.ErrnoError(63);_.node_ops.setattr(_,{mode:t&4095|_.mode&-4096,timestamp:Date.now()})},lchmod(e,t){s.chmod(e,t,!0)},fchmod(e,t){var r=s.getStreamChecked(e);s.chmod(r.node,t)},chown(e,t,r,_){var o;if(typeof e=="string"){var a=s.lookupPath(e,{follow:!_});o=a.node}else o=e;if(!o.node_ops.setattr)throw new s.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,r){s.chown(e,t,r,!0)},fchown(e,t,r){var _=s.getStreamChecked(e);s.chown(_.node,t,r)},truncate(e,t){if(t<0)throw new s.ErrnoError(28);var r;if(typeof e=="string"){var _=s.lookupPath(e,{follow:!0});r=_.node}else r=e;if(!r.node_ops.setattr)throw new s.ErrnoError(63);if(s.isDir(r.mode))throw new s.ErrnoError(31);if(!s.isFile(r.mode))throw new s.ErrnoError(28);var o=s.nodePermissions(r,"w");if(o)throw new s.ErrnoError(o);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=s.getStreamChecked(e);if(!(r.flags&2097155))throw new s.ErrnoError(28);s.truncate(r.node,t)},utime(e,t,r){var _=s.lookupPath(e,{follow:!0}),o=_.node;o.node_ops.setattr(o,{timestamp:Math.max(t,r)})},open(e,t,r){if(e==="")throw new s.ErrnoError(44);t=typeof t=="string"?sr(t):t,t&64?(r=typeof r>"u"?438:r,r=r&4095|32768):r=0;var _;if(typeof e=="object")_=e;else{e=Q.normalize(e);try{var o=s.lookupPath(e,{follow:!(t&131072)});_=o.node}catch{}}var a=!1;if(t&64)if(_){if(t&128)throw new s.ErrnoError(20)}else _=s.mknod(e,r,0),a=!0;if(!_)throw new s.ErrnoError(44);if(s.isChrdev(_.mode)&&(t&=-513),t&65536&&!s.isDir(_.mode))throw new s.ErrnoError(54);if(!a){var l=s.mayOpen(_,t);if(l)throw new s.ErrnoError(l)}t&512&&!a&&s.truncate(_,0),t&=-131713;var c=s.createStream({node:_,path:s.getPath(_),flags:t,seekable:!0,position:0,stream_ops:_.stream_ops,ungotten:[],error:!1});return c.stream_ops.open&&c.stream_ops.open(c),n.logReadFiles&&!(t&1)&&(s.readFiles||(s.readFiles={}),e in s.readFiles||(s.readFiles[e]=1)),c},close(e){if(s.isClosed(e))throw new s.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{s.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,r){if(s.isClosed(e))throw new s.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new s.ErrnoError(70);if(r!=0&&r!=1&&r!=2)throw new s.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,_,o){if(_<0||o<0)throw new s.ErrnoError(28);if(s.isClosed(e))throw new s.ErrnoError(8);if((e.flags&2097155)===1)throw new s.ErrnoError(8);if(s.isDir(e.node.mode))throw new s.ErrnoError(31);if(!e.stream_ops.read)throw new s.ErrnoError(28);var a=typeof o<"u";if(!a)o=e.position;else if(!e.seekable)throw new s.ErrnoError(70);var l=e.stream_ops.read(e,t,r,_,o);return a||(e.position+=l),l},write(e,t,r,_,o,a){if(_<0||o<0)throw new s.ErrnoError(28);if(s.isClosed(e))throw new s.ErrnoError(8);if(!(e.flags&2097155))throw new s.ErrnoError(8);if(s.isDir(e.node.mode))throw new s.ErrnoError(31);if(!e.stream_ops.write)throw new s.ErrnoError(28);e.seekable&&e.flags&1024&&s.llseek(e,0,2);var l=typeof o<"u";if(!l)o=e.position;else if(!e.seekable)throw new s.ErrnoError(70);var c=e.stream_ops.write(e,t,r,_,o,a);return l||(e.position+=c),c},allocate(e,t,r){if(s.isClosed(e))throw new s.ErrnoError(8);if(t<0||r<=0)throw new s.ErrnoError(28);if(!(e.flags&2097155))throw new s.ErrnoError(8);if(!s.isFile(e.node.mode)&&!s.isDir(e.node.mode))throw new s.ErrnoError(43);if(!e.stream_ops.allocate)throw new s.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,_,o){if(_&2&&!(o&2)&&(e.flags&2097155)!==2)throw new s.ErrnoError(2);if((e.flags&2097155)===1)throw new s.ErrnoError(2);if(!e.stream_ops.mmap)throw new s.ErrnoError(43);return e.stream_ops.mmap(e,t,r,_,o)},msync(e,t,r,_,o){return e.stream_ops.msync?e.stream_ops.msync(e,t,r,_,o):0},ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new s.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error(`Invalid encoding type "${t.encoding}"`);var r,_=s.open(e,t.flags),o=s.stat(e),a=o.size,l=new Uint8Array(a);return s.read(_,l,0,a,0),t.encoding==="utf8"?r=de(l,0):t.encoding==="binary"&&(r=l),s.close(_),r},writeFile(e,t,r={}){r.flags=r.flags||577;var _=s.open(e,r.flags,r.mode);if(typeof t=="string"){var o=new Uint8Array(pe(t)+1),a=De(t,o,0,o.length);s.write(_,o,0,a,void 0,r.canOwn)}else if(ArrayBuffer.isView(t))s.write(_,t,0,t.byteLength,void 0,r.canOwn);else throw new Error("Unsupported data type");s.close(_)},cwd:()=>s.currentPath,chdir(e){var t=s.lookupPath(e,{follow:!0});if(t.node===null)throw new s.ErrnoError(44);if(!s.isDir(t.node.mode))throw new s.ErrnoError(54);var r=s.nodePermissions(t.node,"x");if(r)throw new s.ErrnoError(r);s.currentPath=t.path},createDefaultDirectories(){s.mkdir("/tmp"),s.mkdir("/home"),s.mkdir("/home/web_user")},createDefaultDevices(){s.mkdir("/dev"),s.registerDevice(s.makedev(1,3),{read:()=>0,write:(_,o,a,l,c)=>l}),s.mkdev("/dev/null",s.makedev(1,3)),se.register(s.makedev(5,0),se.default_tty_ops),se.register(s.makedev(6,0),se.default_tty1_ops),s.mkdev("/dev/tty",s.makedev(5,0)),s.mkdev("/dev/tty1",s.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(t===0&&(t=Je(e).byteLength),e[--t]);s.createDevice("/dev","random",r),s.createDevice("/dev","urandom",r),s.mkdir("/dev/shm"),s.mkdir("/dev/shm/tmp")},createSpecialDirectories(){s.mkdir("/proc");var e=s.mkdir("/proc/self");s.mkdir("/proc/self/fd"),s.mount({mount(){var t=s.createNode(e,"fd",16895,73);return t.node_ops={lookup(r,_){var o=+_,a=s.getStreamChecked(o),l={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>a.path}};return l.parent=l,l}},t}},{},"/proc/self/fd")},createStandardStreams(){n.stdin?s.createDevice("/dev","stdin",n.stdin):s.symlink("/dev/tty","/dev/stdin"),n.stdout?s.createDevice("/dev","stdout",null,n.stdout):s.symlink("/dev/tty","/dev/stdout"),n.stderr?s.createDevice("/dev","stderr",null,n.stderr):s.symlink("/dev/tty1","/dev/stderr");var e=s.open("/dev/stdin",0),t=s.open("/dev/stdout",1),r=s.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{s.genericErrors[e]=new s.ErrnoError(e),s.genericErrors[e].stack=""}),s.nameTable=new Array(4096),s.mount(L,{},"/"),s.createDefaultDirectories(),s.createDefaultDevices(),s.createSpecialDirectories(),s.filesystems={MEMFS:L}},init(e,t,r){s.init.initialized=!0,n.stdin=e||n.stdin,n.stdout=t||n.stdout,n.stderr=r||n.stderr,s.createStandardStreams()},quit(){s.init.initialized=!1;for(var e=0;ethis.length-1||T<0)){var b=T%this.chunkSize,M=T/this.chunkSize|0;return this.getter(M)[b]}}setDataGetter(T){this.getter=T}cacheLength(){var T=new XMLHttpRequest;if(T.open("HEAD",r,!1),T.send(null),!(T.status>=200&&T.status<300||T.status===304))throw new Error("Couldn't load "+r+". Status: "+T.status);var b=Number(T.getResponseHeader("Content-length")),M,V=(M=T.getResponseHeader("Accept-Ranges"))&&M==="bytes",X=(M=T.getResponseHeader("Content-Encoding"))&&M==="gzip",Y=1024*1024;V||(Y=b);var $=(J,qe)=>{if(J>qe)throw new Error("invalid range ("+J+", "+qe+") or no bytes requested!");if(qe>b-1)throw new Error("only "+b+" bytes available! programmer error!");var H=new XMLHttpRequest;if(H.open("GET",r,!1),b!==Y&&H.setRequestHeader("Range","bytes="+J+"-"+qe),H.responseType="arraybuffer",H.overrideMimeType&&H.overrideMimeType("text/plain; charset=x-user-defined"),H.send(null),!(H.status>=200&&H.status<300||H.status===304))throw new Error("Couldn't load "+r+". Status: "+H.status);return H.response!==void 0?new Uint8Array(H.response||[]):Me(H.responseText||"",!0)},ye=this;ye.setDataGetter(J=>{var qe=J*Y,H=(J+1)*Y-1;if(H=Math.min(H,b-1),typeof ye.chunks[J]>"u"&&(ye.chunks[J]=$(qe,H)),typeof ye.chunks[J]>"u")throw new Error("doXHR failed!");return ye.chunks[J]}),(X||!b)&&(Y=b=1,b=this.getter(0).length,Y=b,q("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=b,this._chunkSize=Y,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ne)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var l=new a,c={isDevice:!1,contents:l}}else var c={isDevice:!1,url:r};var E=s.createFile(e,t,c,_,o);c.contents?E.contents=c.contents:c.url&&(E.contents=null,E.url=c.url),Object.defineProperties(E,{usedBytes:{get:function(){return this.contents.length}}});var h={},g=Object.keys(E.stream_ops);g.forEach(x=>{var T=E.stream_ops[x];h[x]=(...b)=>(s.forceLoadFile(E),T(...b))});function A(x,T,b,M,V){var X=x.node.contents;if(V>=X.length)return 0;var Y=Math.min(X.length-V,M);if(X.slice)for(var $=0;$(s.forceLoadFile(E),A(x,T,b,M,V)),h.mmap=(x,T,b,M,V)=>{s.forceLoadFile(E);var X=et(T);if(!X)throw new s.ErrnoError(48);return A(x,k,X,T,b),{ptr:X,allocated:!0}},E.stream_ops=h,E}},N={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(Q.isAbs(t))return t;var _;if(e===-100)_=s.cwd();else{var o=N.getStreamFromFD(e);_=o.path}if(t.length==0){if(!r)throw new s.ErrnoError(44);return _}return Q.join2(_,t)},doStat(e,t,r){var _=e(t);y[r>>2]=_.dev,y[r+4>>2]=_.mode,z[r+8>>2]=_.nlink,y[r+12>>2]=_.uid,y[r+16>>2]=_.gid,y[r+20>>2]=_.rdev,P=[_.size>>>0,(S=_.size,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+24>>2]=P[0],y[r+28>>2]=P[1],y[r+32>>2]=4096,y[r+36>>2]=_.blocks;var o=_.atime.getTime(),a=_.mtime.getTime(),l=_.ctime.getTime();return P=[Math.floor(o/1e3)>>>0,(S=Math.floor(o/1e3),+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+40>>2]=P[0],y[r+44>>2]=P[1],z[r+48>>2]=o%1e3*1e3,P=[Math.floor(a/1e3)>>>0,(S=Math.floor(a/1e3),+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+56>>2]=P[0],y[r+60>>2]=P[1],z[r+64>>2]=a%1e3*1e3,P=[Math.floor(l/1e3)>>>0,(S=Math.floor(l/1e3),+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+72>>2]=P[0],y[r+76>>2]=P[1],z[r+80>>2]=l%1e3*1e3,P=[_.ino>>>0,(S=_.ino,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[r+88>>2]=P[0],y[r+92>>2]=P[1],0},doMsync(e,t,r,_,o){if(!s.isFile(t.node.mode))throw new s.ErrnoError(43);if(_&2)return 0;var a=C.slice(e,e+r);s.msync(t,a,o,r,_)},getStreamFromFD(e){var t=s.getStreamChecked(e);return t},varargs:void 0,getStr(e){var t=ce(e);return t}};function or(e,t){try{return e=N.getStr(e),s.chmod(e,t),0}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function ir(e,t,r,_){try{if(t=N.getStr(t),t=N.calculateAt(e,t),r&-8)return-28;var o=s.lookupPath(t,{follow:!0}),a=o.node;if(!a)return-44;var l="";return r&4&&(l+="r"),r&2&&(l+="w"),r&1&&(l+="x"),l&&s.nodePermissions(a,l)?-2:0}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function ar(e,t){try{return s.fchmod(e,t),0}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function lr(e,t,r){try{return s.fchown(e,t,r),0}catch(_){if(typeof s>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}function Ne(){var e=y[+N.varargs>>2];return N.varargs+=4,e}var cr=Ne;function ur(e,t,r){N.varargs=r;try{var _=N.getStreamFromFD(e);switch(t){case 0:{var o=Ne();if(o<0)return-28;for(;s.streams[o];)o++;var a;return a=s.dupStream(_,o),a.fd}case 1:case 2:return 0;case 3:return _.flags;case 4:{var o=Ne();return _.flags|=o,0}case 12:{var o=cr(),l=0;return U[o+l>>1]=2,0}case 13:case 14:return 0}return-28}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function fr(e,t){try{var r=N.getStreamFromFD(e);return N.doStat(s.stat,r.path,t)}catch(_){if(typeof s>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}var Te=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function dr(e,t,r){var _=Te(t,r);try{return isNaN(_)?61:(s.ftruncate(e,_),0)}catch(o){if(typeof s>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}var oe=(e,t,r)=>De(e,C,t,r);function pr(e,t){try{if(t===0)return-28;var r=s.cwd(),_=pe(r)+1;return t<_?-68:(oe(r,e,t),_)}catch(o){if(typeof s>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}function vr(e,t){try{return e=N.getStr(e),N.doStat(s.lstat,e,t)}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function mr(e,t,r){try{return t=N.getStr(t),t=N.calculateAt(e,t),t=Q.normalize(t),t[t.length-1]==="/"&&(t=t.substr(0,t.length-1)),s.mkdir(t,r,0),0}catch(_){if(typeof s>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}function Er(e,t,r,_){try{t=N.getStr(t);var o=_&256,a=_&4096;return _=_&-6401,t=N.calculateAt(e,t,a),N.doStat(o?s.lstat:s.stat,t,r)}catch(l){if(typeof s>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}function qr(e,t,r,_){N.varargs=_;try{t=N.getStr(t),t=N.calculateAt(e,t);var o=_?Ne():0;return s.open(t,r,o).fd}catch(a){if(typeof s>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}function hr(e,t,r,_){try{if(t=N.getStr(t),t=N.calculateAt(e,t),_<=0)return-28;var o=s.readlink(t),a=Math.min(_,pe(o)),l=k[r+a];return oe(o,r,_+1),k[r+a]=l,a}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return-c.errno}}function br(e){try{return e=N.getStr(e),s.rmdir(e),0}catch(t){if(typeof s>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function Tr(e,t){try{return e=N.getStr(e),N.doStat(s.stat,e,t)}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function wr(e,t,r){try{return t=N.getStr(t),t=N.calculateAt(e,t),r===0?s.unlink(t):r===512?s.rmdir(t):_e("Invalid flags passed to unlinkat"),0}catch(_){if(typeof s>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}var tt=e=>z[e>>2]+y[e+4>>2]*4294967296;function yr(e,t,r,_){try{if(t=N.getStr(t),t=N.calculateAt(e,t,!0),r){var l=tt(r),c=y[r+8>>2];o=l*1e3+c/1e6,r+=16,l=tt(r),c=y[r+8>>2],a=l*1e3+c/1e6}else var o=Date.now(),a=o;return s.utime(t,o,a),0}catch(E){if(typeof s>"u"||E.name!=="ErrnoError")throw E;return-E.errno}}var Sr=e=>e%4===0&&(e%100!==0||e%400===0),gr=[0,31,60,91,121,152,182,213,244,274,305,335],Ir=[0,31,59,90,120,151,181,212,243,273,304,334],Lr=e=>{var t=Sr(e.getFullYear()),r=t?gr:Ir,_=r[e.getMonth()]+e.getDate()-1;return _};function xr(e,t,r){var _=Te(e,t),o=new Date(_*1e3);y[r>>2]=o.getSeconds(),y[r+4>>2]=o.getMinutes(),y[r+8>>2]=o.getHours(),y[r+12>>2]=o.getDate(),y[r+16>>2]=o.getMonth(),y[r+20>>2]=o.getFullYear()-1900,y[r+24>>2]=o.getDay();var a=Lr(o)|0;y[r+28>>2]=a,y[r+36>>2]=-(o.getTimezoneOffset()*60);var l=new Date(o.getFullYear(),0,1),c=new Date(o.getFullYear(),6,1).getTimezoneOffset(),E=l.getTimezoneOffset(),h=(c!=E&&o.getTimezoneOffset()==Math.min(E,c))|0;y[r+32>>2]=h}function Ar(e,t,r,_,o,a,l,c){var E=Te(o,a);try{if(isNaN(E))return 61;var h=N.getStreamFromFD(_),g=s.mmap(h,e,E,t,r),A=g.ptr;return y[l>>2]=g.allocated,z[c>>2]=A,0}catch(x){if(typeof s>"u"||x.name!=="ErrnoError")throw x;return-x.errno}}function Nr(e,t,r,_,o,a,l){var c=Te(a,l);try{var E=N.getStreamFromFD(o);r&2&&N.doMsync(e,E,t,_,c)}catch(h){if(typeof s>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}var Rr=(e,t,r,_)=>{var o=new Date().getFullYear(),a=new Date(o,0,1),l=new Date(o,6,1),c=a.getTimezoneOffset(),E=l.getTimezoneOffset(),h=Math.max(c,E);z[e>>2]=h*60,y[t>>2]=+(c!=E);var g=T=>T.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],A=g(a),x=g(l);EDate.now(),rt;rt=()=>performance.now();var Or=()=>2147483648,Qr=e=>{var t=D.buffer,r=(e-t.byteLength+65535)/65536;try{return D.grow(r),He(),1}catch{}},Cr=e=>{var t=C.length;e>>>=0;var r=Or();if(e>r)return!1;for(var _=(E,h)=>E+(h-E%h)%h,o=1;o<=4;o*=2){var a=t*(1+.2/o);a=Math.min(a,e+100663296);var l=Math.min(r,_(Math.max(e,a),65536)),c=Qr(l);if(c)return!0}return!1},ze={},Fr=()=>B||"./this.program",we=()=>{if(!we.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Fr()};for(var r in ze)ze[r]===void 0?delete t[r]:t[r]=ze[r];var _=[];for(var r in t)_.push(`${r}=${t[r]}`);we.strings=_}return we.strings},Pr=(e,t)=>{for(var r=0;r{var r=0;return we().forEach((_,o)=>{var a=t+r;z[e+o*4>>2]=a,Pr(_,a),r+=_.length+1}),0},Mr=(e,t)=>{var r=we();z[e>>2]=r.length;var _=0;return r.forEach(o=>_+=o.length+1),z[t>>2]=_,0};function Ur(e){try{var t=N.getStreamFromFD(e);return s.close(t),0}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return r.errno}}function zr(e,t){try{var r=0,_=0,o=0,a=N.getStreamFromFD(e),l=a.tty?2:s.isDir(a.mode)?3:s.isLink(a.mode)?7:4;return k[t]=l,U[t+2>>1]=o,P=[r>>>0,(S=r,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[t+8>>2]=P[0],y[t+12>>2]=P[1],P=[_>>>0,(S=_,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[t+16>>2]=P[0],y[t+20>>2]=P[1],0}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return c.errno}}var Br=(e,t,r,_)=>{for(var o=0,a=0;a>2],c=z[t+4>>2];t+=8;var E=s.read(e,k,l,c,_);if(E<0)return-1;if(o+=E,E>2]=a,0}catch(l){if(typeof s>"u"||l.name!=="ErrnoError")throw l;return l.errno}}function Wr(e,t,r,_,o){var a=Te(t,r);try{if(isNaN(a))return 61;var l=N.getStreamFromFD(e);return s.llseek(l,a,_),P=[l.position>>>0,(S=l.position,+Math.abs(S)>=1?S>0?+Math.floor(S/4294967296)>>>0:~~+Math.ceil((S-+(~~S>>>0))/4294967296)>>>0:0)],y[o>>2]=P[0],y[o+4>>2]=P[1],l.getdents&&a===0&&_===0&&(l.getdents=null),0}catch(c){if(typeof s>"u"||c.name!=="ErrnoError")throw c;return c.errno}}function jr(e){try{var t=N.getStreamFromFD(e);return t.stream_ops?.fsync?t.stream_ops.fsync(t):0}catch(r){if(typeof s>"u"||r.name!=="ErrnoError")throw r;return r.errno}}var Gr=(e,t,r,_)=>{for(var o=0,a=0;a>2],c=z[t+4>>2];t+=8;var E=s.write(e,k,l,c,_);if(E<0)return-1;o+=E,typeof _<"u"&&(_+=E)}return o};function Kr(e,t,r,_){try{var o=N.getStreamFromFD(e),a=Gr(o,t,r);return z[_>>2]=a,0}catch(l){if(typeof s>"u"||l.name!=="ErrnoError")throw l;return l.errno}}var O=function(){let e=typeof Asyncify=="object"?Asyncify.handleAsync.bind(Asyncify):null;n.handleAsync=e;let t=new Map;n.setCallback=(r,_)=>t.set(r,_),n.getCallback=r=>t.get(r),n.deleteCallback=r=>t.delete(r),O=function(r,_,...o){let a=t.get(_),l=null,c=typeof a=="function"?a:a[l=ce(o.shift())];if(r){if(e)return e(()=>c.apply(a,o));throw new Error("Synchronous WebAssembly cannot call async function")}let E=c.apply(a,o);if(typeof E?.then=="function")throw console.error("unexpected Promise",c),new Error(`${l} unexpectedly returned a Promise`);return E}};function Vr(...e){return O(!1,...e)}function Xr(...e){return O(!0,...e)}function Yr(...e){return O(!1,...e)}function $r(...e){return O(!0,...e)}function Zr(...e){return O(!1,...e)}function Jr(...e){return O(!0,...e)}function en(...e){return O(!1,...e)}function tn(...e){return O(!0,...e)}function rn(...e){return O(!1,...e)}function nn(...e){return O(!0,...e)}function _n(...e){return O(!1,...e)}function sn(...e){return O(!0,...e)}function on(...e){return O(!1,...e)}function an(...e){return O(!0,...e)}function ln(...e){return O(!1,...e)}function cn(...e){return O(!0,...e)}function un(...e){return O(!1,...e)}function fn(...e){return O(!0,...e)}function dn(...e){return O(!1,...e)}function pn(...e){return O(!0,...e)}function vn(...e){return O(!1,...e)}function mn(...e){return O(!0,...e)}function En(...e){return O(!1,...e)}function qn(...e){return O(!0,...e)}function hn(...e){return O(!1,...e)}function bn(...e){return O(!0,...e)}function Tn(...e){return O(!1,...e)}function wn(...e){return O(!0,...e)}function yn(...e){return O(!1,...e)}function Sn(...e){return O(!0,...e)}var gn=0,In=()=>Gt||gn>0,Ln=e=>{j=e,In()||(n.onExit?.(e),W=!0),ae(e,new Ye(e))},xn=(e,t)=>{j=e,Ln(e)},An=e=>{if(e instanceof Ye||e=="unwind")return j;ae(1,e)},nt=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},Nn=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},_=1;_{var r=e.slice(0,1),_=e.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),nt(_.length,t);for(var a=0;a<_.length;++a)t.push(o[_[a]]);r=="v"?t.push(0):t.push(1,o[r])},kn=(e,t)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(Nn(t),e);var r=[1];Rn(t,r);var _=[0,97,115,109,1,0,0,0,1];nt(r.length,_),_.push(...r),_.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(_)),a=new WebAssembly.Instance(o,{e:{f:e}}),l=a.exports.f;return l},ve,On=e=>ve.get(e),Qn=(e,t)=>{if(me)for(var r=e;r(me||(me=new WeakMap,Qn(0,ve.length)),me.get(e)||0),_t=[],Fn=()=>{if(_t.length)return _t.pop();try{ve.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return ve.length-1},st=(e,t)=>ve.set(e,t),Pn=(e,t)=>{var r=Cn(e);if(r)return r;var _=Fn();try{st(_,e)}catch(a){if(!(a instanceof TypeError))throw a;var o=kn(e,t);st(_,o)}return me.set(e,_),_},ot=e=>{var t=n["_"+e];return t},it=(e,t)=>{k.set(e,t)},at=e=>pt(e),Dn=e=>{var t=pe(e)+1,r=at(t);return oe(e,r,t),r},Ee=(e,t,r,_,o)=>{var a={string:b=>{var M=0;return b!=null&&b!==0&&(M=Dn(b)),M},array:b=>{var M=at(b.length);return it(b,M),M}};function l(b){return t==="string"?ce(b):t==="boolean"?!!b:b}var c=ot(e),E=[],h=0;if(_)for(var g=0;g<_.length;g++){var A=a[r[g]];A?(h===0&&(h=Vt()),E[g]=A(_[g])):E[g]=_[g]}var x=c(...E);function T(b){return h!==0&&Kt(h),l(b)}return x=T(x),x},Mn=(e,t,r,_)=>{var o=!r||r.every(l=>l==="number"||l==="boolean"),a=t!=="string";return a&&o&&!_?ot(e):(...l)=>Ee(e,t,r,l,_)},Un=e=>ft(),zn=(e,t,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var _=t,o=r>1]=l,t+=2}return U[t>>1]=0,t-_},Bn=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var _=t,o=_+r-4,a=0;a=55296&&l<=57343){var c=e.charCodeAt(++a);l=65536+((l&1023)<<10)|c&1023}if(y[t>>2]=l,t+=4,t+4>o)break}return y[t>>2]=0,t-_},Hn=e=>{for(var t="";;){var r=C[e++];if(!r)return t;t+=String.fromCharCode(r)}},lt=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Wn=(e,t)=>{for(var r=e,_=r>>1,o=_+t/2;!(_>=o)&&Z[_];)++_;if(r=_<<1,r-e>32&<)return lt.decode(C.subarray(e,r));for(var a="",l=0;!(l>=t/2);++l){var c=U[e+l*2>>1];if(c==0)break;a+=String.fromCharCode(c)}return a},jn=(e,t)=>{for(var r=0,_="";!(r>=t/4);){var o=y[e+r*4>>2];if(o==0)break;if(++r,o>=65536){var a=o-65536;_+=String.fromCharCode(55296|a>>10,56320|a&1023)}else _+=String.fromCharCode(o)}return _};function Gn(e){for(var t=[],r=0;r255&&(_&=255),t.push(String.fromCharCode(_))}return t.join("")}s.createPreloadedFile=_r,s.staticInit(),O();var Kn={a:Xt,Y:or,$:ir,Z:ar,X:lr,b:ur,W:fr,y:dr,Q:pr,U:vr,N:mr,T:Er,L:qr,J:hr,I:br,V:Tr,G:wr,F:yr,w:xr,u:Ar,v:Nr,M:Rr,n:kr,m:rt,D:Cr,O:Dr,P:Mr,o:Ur,E:zr,K:Hr,x:Wr,S:jr,H:Kr,s:Vr,t:Xr,fa:Yr,ia:$r,i:Zr,j:Jr,c:en,d:tn,ca:rn,da:nn,ea:_n,ga:sn,g:on,h:an,z:ln,A:cn,e:un,f:fn,aa:dn,ba:pn,B:vn,C:mn,p:En,q:qn,ha:hn,r:bn,k:Tn,l:wn,R:yn,_:Sn},i=jt(),Vn=()=>(Vn=i.ka)(),Xn=n._sqlite3_status64=(e,t,r,_)=>(Xn=n._sqlite3_status64=i.la)(e,t,r,_),Yn=n._sqlite3_status=(e,t,r,_)=>(Yn=n._sqlite3_status=i.ma)(e,t,r,_),$n=n._sqlite3_db_status=(e,t,r,_,o)=>($n=n._sqlite3_db_status=i.na)(e,t,r,_,o),Zn=n._sqlite3_msize=e=>(Zn=n._sqlite3_msize=i.oa)(e),Jn=n._sqlite3_vfs_find=e=>(Jn=n._sqlite3_vfs_find=i.pa)(e),e_=n._sqlite3_vfs_register=(e,t)=>(e_=n._sqlite3_vfs_register=i.qa)(e,t),t_=n._sqlite3_vfs_unregister=e=>(t_=n._sqlite3_vfs_unregister=i.ra)(e),r_=n._sqlite3_release_memory=e=>(r_=n._sqlite3_release_memory=i.sa)(e),n_=n._sqlite3_soft_heap_limit64=(e,t)=>(n_=n._sqlite3_soft_heap_limit64=i.ta)(e,t),__=n._sqlite3_memory_used=()=>(__=n._sqlite3_memory_used=i.ua)(),s_=n._sqlite3_hard_heap_limit64=(e,t)=>(s_=n._sqlite3_hard_heap_limit64=i.va)(e,t),o_=n._sqlite3_memory_highwater=e=>(o_=n._sqlite3_memory_highwater=i.wa)(e),i_=n._sqlite3_malloc=e=>(i_=n._sqlite3_malloc=i.xa)(e),a_=n._sqlite3_malloc64=(e,t)=>(a_=n._sqlite3_malloc64=i.ya)(e,t),l_=n._sqlite3_free=e=>(l_=n._sqlite3_free=i.za)(e),c_=n._sqlite3_realloc=(e,t)=>(c_=n._sqlite3_realloc=i.Aa)(e,t),u_=n._sqlite3_realloc64=(e,t,r)=>(u_=n._sqlite3_realloc64=i.Ba)(e,t,r),f_=n._sqlite3_str_vappendf=(e,t,r)=>(f_=n._sqlite3_str_vappendf=i.Ca)(e,t,r),d_=n._sqlite3_str_append=(e,t,r)=>(d_=n._sqlite3_str_append=i.Da)(e,t,r),p_=n._sqlite3_str_appendchar=(e,t,r)=>(p_=n._sqlite3_str_appendchar=i.Ea)(e,t,r),v_=n._sqlite3_str_appendall=(e,t)=>(v_=n._sqlite3_str_appendall=i.Fa)(e,t),m_=n._sqlite3_str_appendf=(e,t,r)=>(m_=n._sqlite3_str_appendf=i.Ga)(e,t,r),E_=n._sqlite3_str_finish=e=>(E_=n._sqlite3_str_finish=i.Ha)(e),q_=n._sqlite3_str_errcode=e=>(q_=n._sqlite3_str_errcode=i.Ia)(e),h_=n._sqlite3_str_length=e=>(h_=n._sqlite3_str_length=i.Ja)(e),b_=n._sqlite3_str_value=e=>(b_=n._sqlite3_str_value=i.Ka)(e),T_=n._sqlite3_str_reset=e=>(T_=n._sqlite3_str_reset=i.La)(e),w_=n._sqlite3_str_new=e=>(w_=n._sqlite3_str_new=i.Ma)(e),y_=n._sqlite3_vmprintf=(e,t)=>(y_=n._sqlite3_vmprintf=i.Na)(e,t),S_=n._sqlite3_mprintf=(e,t)=>(S_=n._sqlite3_mprintf=i.Oa)(e,t),g_=n._sqlite3_vsnprintf=(e,t,r,_)=>(g_=n._sqlite3_vsnprintf=i.Pa)(e,t,r,_),I_=n._sqlite3_snprintf=(e,t,r,_)=>(I_=n._sqlite3_snprintf=i.Qa)(e,t,r,_),L_=n._sqlite3_log=(e,t,r)=>(L_=n._sqlite3_log=i.Ra)(e,t,r),x_=n._sqlite3_randomness=(e,t)=>(x_=n._sqlite3_randomness=i.Sa)(e,t),A_=n._sqlite3_stricmp=(e,t)=>(A_=n._sqlite3_stricmp=i.Ta)(e,t),N_=n._sqlite3_strnicmp=(e,t,r)=>(N_=n._sqlite3_strnicmp=i.Ua)(e,t,r),R_=n._sqlite3_os_init=()=>(R_=n._sqlite3_os_init=i.Va)(),k_=n._sqlite3_os_end=()=>(k_=n._sqlite3_os_end=i.Wa)(),O_=n._sqlite3_serialize=(e,t,r,_)=>(O_=n._sqlite3_serialize=i.Xa)(e,t,r,_),Q_=n._sqlite3_prepare_v2=(e,t,r,_,o)=>(Q_=n._sqlite3_prepare_v2=i.Ya)(e,t,r,_,o),C_=n._sqlite3_step=e=>(C_=n._sqlite3_step=i.Za)(e),F_=n._sqlite3_column_int64=(e,t)=>(F_=n._sqlite3_column_int64=i._a)(e,t),P_=n._sqlite3_reset=e=>(P_=n._sqlite3_reset=i.$a)(e),D_=n._sqlite3_exec=(e,t,r,_,o)=>(D_=n._sqlite3_exec=i.ab)(e,t,r,_,o),M_=n._sqlite3_column_int=(e,t)=>(M_=n._sqlite3_column_int=i.bb)(e,t),U_=n._sqlite3_finalize=e=>(U_=n._sqlite3_finalize=i.cb)(e),z_=n._sqlite3_deserialize=(e,t,r,_,o,a,l,c)=>(z_=n._sqlite3_deserialize=i.db)(e,t,r,_,o,a,l,c),B_=n._sqlite3_database_file_object=e=>(B_=n._sqlite3_database_file_object=i.eb)(e),H_=n._sqlite3_backup_init=(e,t,r,_)=>(H_=n._sqlite3_backup_init=i.fb)(e,t,r,_),W_=n._sqlite3_backup_step=(e,t)=>(W_=n._sqlite3_backup_step=i.gb)(e,t),j_=n._sqlite3_backup_finish=e=>(j_=n._sqlite3_backup_finish=i.hb)(e),G_=n._sqlite3_backup_remaining=e=>(G_=n._sqlite3_backup_remaining=i.ib)(e),K_=n._sqlite3_backup_pagecount=e=>(K_=n._sqlite3_backup_pagecount=i.jb)(e),V_=n._sqlite3_clear_bindings=e=>(V_=n._sqlite3_clear_bindings=i.kb)(e),X_=n._sqlite3_value_blob=e=>(X_=n._sqlite3_value_blob=i.lb)(e),Y_=n._sqlite3_value_text=e=>(Y_=n._sqlite3_value_text=i.mb)(e),$_=n._sqlite3_value_bytes=e=>($_=n._sqlite3_value_bytes=i.nb)(e),Z_=n._sqlite3_value_bytes16=e=>(Z_=n._sqlite3_value_bytes16=i.ob)(e),J_=n._sqlite3_value_double=e=>(J_=n._sqlite3_value_double=i.pb)(e),es=n._sqlite3_value_int=e=>(es=n._sqlite3_value_int=i.qb)(e),ts=n._sqlite3_value_int64=e=>(ts=n._sqlite3_value_int64=i.rb)(e),rs=n._sqlite3_value_subtype=e=>(rs=n._sqlite3_value_subtype=i.sb)(e),ns=n._sqlite3_value_pointer=(e,t)=>(ns=n._sqlite3_value_pointer=i.tb)(e,t),_s=n._sqlite3_value_text16=e=>(_s=n._sqlite3_value_text16=i.ub)(e),ss=n._sqlite3_value_text16be=e=>(ss=n._sqlite3_value_text16be=i.vb)(e),os=n._sqlite3_value_text16le=e=>(os=n._sqlite3_value_text16le=i.wb)(e),is=n._sqlite3_value_type=e=>(is=n._sqlite3_value_type=i.xb)(e),as=n._sqlite3_value_encoding=e=>(as=n._sqlite3_value_encoding=i.yb)(e),ls=n._sqlite3_value_nochange=e=>(ls=n._sqlite3_value_nochange=i.zb)(e),cs=n._sqlite3_value_frombind=e=>(cs=n._sqlite3_value_frombind=i.Ab)(e),us=n._sqlite3_value_dup=e=>(us=n._sqlite3_value_dup=i.Bb)(e),fs=n._sqlite3_value_free=e=>(fs=n._sqlite3_value_free=i.Cb)(e),ds=n._sqlite3_result_blob=(e,t,r,_)=>(ds=n._sqlite3_result_blob=i.Db)(e,t,r,_),ps=n._sqlite3_result_blob64=(e,t,r,_,o)=>(ps=n._sqlite3_result_blob64=i.Eb)(e,t,r,_,o),vs=n._sqlite3_result_double=(e,t)=>(vs=n._sqlite3_result_double=i.Fb)(e,t),ms=n._sqlite3_result_error=(e,t,r)=>(ms=n._sqlite3_result_error=i.Gb)(e,t,r),Es=n._sqlite3_result_error16=(e,t,r)=>(Es=n._sqlite3_result_error16=i.Hb)(e,t,r),qs=n._sqlite3_result_int=(e,t)=>(qs=n._sqlite3_result_int=i.Ib)(e,t),hs=n._sqlite3_result_int64=(e,t,r)=>(hs=n._sqlite3_result_int64=i.Jb)(e,t,r),bs=n._sqlite3_result_null=e=>(bs=n._sqlite3_result_null=i.Kb)(e),Ts=n._sqlite3_result_pointer=(e,t,r,_)=>(Ts=n._sqlite3_result_pointer=i.Lb)(e,t,r,_),ws=n._sqlite3_result_subtype=(e,t)=>(ws=n._sqlite3_result_subtype=i.Mb)(e,t),ys=n._sqlite3_result_text=(e,t,r,_)=>(ys=n._sqlite3_result_text=i.Nb)(e,t,r,_),Ss=n._sqlite3_result_text64=(e,t,r,_,o,a)=>(Ss=n._sqlite3_result_text64=i.Ob)(e,t,r,_,o,a),gs=n._sqlite3_result_text16=(e,t,r,_)=>(gs=n._sqlite3_result_text16=i.Pb)(e,t,r,_),Is=n._sqlite3_result_text16be=(e,t,r,_)=>(Is=n._sqlite3_result_text16be=i.Qb)(e,t,r,_),Ls=n._sqlite3_result_text16le=(e,t,r,_)=>(Ls=n._sqlite3_result_text16le=i.Rb)(e,t,r,_),xs=n._sqlite3_result_value=(e,t)=>(xs=n._sqlite3_result_value=i.Sb)(e,t),As=n._sqlite3_result_error_toobig=e=>(As=n._sqlite3_result_error_toobig=i.Tb)(e),Ns=n._sqlite3_result_zeroblob=(e,t)=>(Ns=n._sqlite3_result_zeroblob=i.Ub)(e,t),Rs=n._sqlite3_result_zeroblob64=(e,t,r)=>(Rs=n._sqlite3_result_zeroblob64=i.Vb)(e,t,r),ks=n._sqlite3_result_error_code=(e,t)=>(ks=n._sqlite3_result_error_code=i.Wb)(e,t),Os=n._sqlite3_result_error_nomem=e=>(Os=n._sqlite3_result_error_nomem=i.Xb)(e),Qs=n._sqlite3_user_data=e=>(Qs=n._sqlite3_user_data=i.Yb)(e),Cs=n._sqlite3_context_db_handle=e=>(Cs=n._sqlite3_context_db_handle=i.Zb)(e),Fs=n._sqlite3_vtab_nochange=e=>(Fs=n._sqlite3_vtab_nochange=i._b)(e),Ps=n._sqlite3_vtab_in_first=(e,t)=>(Ps=n._sqlite3_vtab_in_first=i.$b)(e,t),Ds=n._sqlite3_vtab_in_next=(e,t)=>(Ds=n._sqlite3_vtab_in_next=i.ac)(e,t),Ms=n._sqlite3_aggregate_context=(e,t)=>(Ms=n._sqlite3_aggregate_context=i.bc)(e,t),Us=n._sqlite3_get_auxdata=(e,t)=>(Us=n._sqlite3_get_auxdata=i.cc)(e,t),zs=n._sqlite3_set_auxdata=(e,t,r,_)=>(zs=n._sqlite3_set_auxdata=i.dc)(e,t,r,_),Bs=n._sqlite3_column_count=e=>(Bs=n._sqlite3_column_count=i.ec)(e),Hs=n._sqlite3_data_count=e=>(Hs=n._sqlite3_data_count=i.fc)(e),Ws=n._sqlite3_column_blob=(e,t)=>(Ws=n._sqlite3_column_blob=i.gc)(e,t),js=n._sqlite3_column_bytes=(e,t)=>(js=n._sqlite3_column_bytes=i.hc)(e,t),Gs=n._sqlite3_column_bytes16=(e,t)=>(Gs=n._sqlite3_column_bytes16=i.ic)(e,t),Ks=n._sqlite3_column_double=(e,t)=>(Ks=n._sqlite3_column_double=i.jc)(e,t),Vs=n._sqlite3_column_text=(e,t)=>(Vs=n._sqlite3_column_text=i.kc)(e,t),Xs=n._sqlite3_column_value=(e,t)=>(Xs=n._sqlite3_column_value=i.lc)(e,t),Ys=n._sqlite3_column_text16=(e,t)=>(Ys=n._sqlite3_column_text16=i.mc)(e,t),$s=n._sqlite3_column_type=(e,t)=>($s=n._sqlite3_column_type=i.nc)(e,t),Zs=n._sqlite3_column_name=(e,t)=>(Zs=n._sqlite3_column_name=i.oc)(e,t),Js=n._sqlite3_column_name16=(e,t)=>(Js=n._sqlite3_column_name16=i.pc)(e,t),eo=n._sqlite3_bind_blob=(e,t,r,_,o)=>(eo=n._sqlite3_bind_blob=i.qc)(e,t,r,_,o),to=n._sqlite3_bind_blob64=(e,t,r,_,o,a)=>(to=n._sqlite3_bind_blob64=i.rc)(e,t,r,_,o,a),ro=n._sqlite3_bind_double=(e,t,r)=>(ro=n._sqlite3_bind_double=i.sc)(e,t,r),no=n._sqlite3_bind_int=(e,t,r)=>(no=n._sqlite3_bind_int=i.tc)(e,t,r),_o=n._sqlite3_bind_int64=(e,t,r,_)=>(_o=n._sqlite3_bind_int64=i.uc)(e,t,r,_),so=n._sqlite3_bind_null=(e,t)=>(so=n._sqlite3_bind_null=i.vc)(e,t),oo=n._sqlite3_bind_pointer=(e,t,r,_,o)=>(oo=n._sqlite3_bind_pointer=i.wc)(e,t,r,_,o),io=n._sqlite3_bind_text=(e,t,r,_,o)=>(io=n._sqlite3_bind_text=i.xc)(e,t,r,_,o),ao=n._sqlite3_bind_text64=(e,t,r,_,o,a,l)=>(ao=n._sqlite3_bind_text64=i.yc)(e,t,r,_,o,a,l),lo=n._sqlite3_bind_text16=(e,t,r,_,o)=>(lo=n._sqlite3_bind_text16=i.zc)(e,t,r,_,o),co=n._sqlite3_bind_value=(e,t,r)=>(co=n._sqlite3_bind_value=i.Ac)(e,t,r),uo=n._sqlite3_bind_zeroblob=(e,t,r)=>(uo=n._sqlite3_bind_zeroblob=i.Bc)(e,t,r),fo=n._sqlite3_bind_zeroblob64=(e,t,r,_)=>(fo=n._sqlite3_bind_zeroblob64=i.Cc)(e,t,r,_),po=n._sqlite3_bind_parameter_count=e=>(po=n._sqlite3_bind_parameter_count=i.Dc)(e),vo=n._sqlite3_bind_parameter_name=(e,t)=>(vo=n._sqlite3_bind_parameter_name=i.Ec)(e,t),mo=n._sqlite3_bind_parameter_index=(e,t)=>(mo=n._sqlite3_bind_parameter_index=i.Fc)(e,t),Eo=n._sqlite3_db_handle=e=>(Eo=n._sqlite3_db_handle=i.Gc)(e),qo=n._sqlite3_stmt_readonly=e=>(qo=n._sqlite3_stmt_readonly=i.Hc)(e),ho=n._sqlite3_stmt_isexplain=e=>(ho=n._sqlite3_stmt_isexplain=i.Ic)(e),bo=n._sqlite3_stmt_explain=(e,t)=>(bo=n._sqlite3_stmt_explain=i.Jc)(e,t),To=n._sqlite3_stmt_busy=e=>(To=n._sqlite3_stmt_busy=i.Kc)(e),wo=n._sqlite3_next_stmt=(e,t)=>(wo=n._sqlite3_next_stmt=i.Lc)(e,t),yo=n._sqlite3_stmt_status=(e,t,r)=>(yo=n._sqlite3_stmt_status=i.Mc)(e,t,r),So=n._sqlite3_sql=e=>(So=n._sqlite3_sql=i.Nc)(e),go=n._sqlite3_expanded_sql=e=>(go=n._sqlite3_expanded_sql=i.Oc)(e),Io=n._sqlite3_value_numeric_type=e=>(Io=n._sqlite3_value_numeric_type=i.Pc)(e),Lo=n._sqlite3_blob_open=(e,t,r,_,o,a,l,c)=>(Lo=n._sqlite3_blob_open=i.Qc)(e,t,r,_,o,a,l,c),xo=n._sqlite3_blob_close=e=>(xo=n._sqlite3_blob_close=i.Rc)(e),Ao=n._sqlite3_blob_read=(e,t,r,_)=>(Ao=n._sqlite3_blob_read=i.Sc)(e,t,r,_),No=n._sqlite3_blob_write=(e,t,r,_)=>(No=n._sqlite3_blob_write=i.Tc)(e,t,r,_),Ro=n._sqlite3_blob_bytes=e=>(Ro=n._sqlite3_blob_bytes=i.Uc)(e),ko=n._sqlite3_blob_reopen=(e,t,r)=>(ko=n._sqlite3_blob_reopen=i.Vc)(e,t,r),Oo=n._sqlite3_set_authorizer=(e,t,r)=>(Oo=n._sqlite3_set_authorizer=i.Wc)(e,t,r),Qo=n._sqlite3_strglob=(e,t)=>(Qo=n._sqlite3_strglob=i.Xc)(e,t),Co=n._sqlite3_strlike=(e,t,r)=>(Co=n._sqlite3_strlike=i.Yc)(e,t,r),Fo=n._sqlite3_errmsg=e=>(Fo=n._sqlite3_errmsg=i.Zc)(e),Po=n._sqlite3_auto_extension=e=>(Po=n._sqlite3_auto_extension=i._c)(e),Do=n._sqlite3_cancel_auto_extension=e=>(Do=n._sqlite3_cancel_auto_extension=i.$c)(e),Mo=n._sqlite3_reset_auto_extension=()=>(Mo=n._sqlite3_reset_auto_extension=i.ad)(),Uo=n._sqlite3_prepare=(e,t,r,_,o)=>(Uo=n._sqlite3_prepare=i.bd)(e,t,r,_,o),zo=n._sqlite3_prepare_v3=(e,t,r,_,o,a)=>(zo=n._sqlite3_prepare_v3=i.cd)(e,t,r,_,o,a),Bo=n._sqlite3_prepare16=(e,t,r,_,o)=>(Bo=n._sqlite3_prepare16=i.dd)(e,t,r,_,o),Ho=n._sqlite3_prepare16_v2=(e,t,r,_,o)=>(Ho=n._sqlite3_prepare16_v2=i.ed)(e,t,r,_,o),Wo=n._sqlite3_prepare16_v3=(e,t,r,_,o,a)=>(Wo=n._sqlite3_prepare16_v3=i.fd)(e,t,r,_,o,a),jo=n._sqlite3_get_table=(e,t,r,_,o,a)=>(jo=n._sqlite3_get_table=i.gd)(e,t,r,_,o,a),Go=n._sqlite3_free_table=e=>(Go=n._sqlite3_free_table=i.hd)(e),Ko=n._sqlite3_create_module=(e,t,r,_)=>(Ko=n._sqlite3_create_module=i.id)(e,t,r,_),Vo=n._sqlite3_create_module_v2=(e,t,r,_,o)=>(Vo=n._sqlite3_create_module_v2=i.jd)(e,t,r,_,o),Xo=n._sqlite3_drop_modules=(e,t)=>(Xo=n._sqlite3_drop_modules=i.kd)(e,t),Yo=n._sqlite3_declare_vtab=(e,t)=>(Yo=n._sqlite3_declare_vtab=i.ld)(e,t),$o=n._sqlite3_vtab_on_conflict=e=>($o=n._sqlite3_vtab_on_conflict=i.md)(e),Zo=n._sqlite3_vtab_config=(e,t,r)=>(Zo=n._sqlite3_vtab_config=i.nd)(e,t,r),Jo=n._sqlite3_vtab_collation=(e,t)=>(Jo=n._sqlite3_vtab_collation=i.od)(e,t),ei=n._sqlite3_vtab_in=(e,t,r)=>(ei=n._sqlite3_vtab_in=i.pd)(e,t,r),ti=n._sqlite3_vtab_rhs_value=(e,t,r)=>(ti=n._sqlite3_vtab_rhs_value=i.qd)(e,t,r),ri=n._sqlite3_vtab_distinct=e=>(ri=n._sqlite3_vtab_distinct=i.rd)(e),ni=n._sqlite3_keyword_name=(e,t,r)=>(ni=n._sqlite3_keyword_name=i.sd)(e,t,r),_i=n._sqlite3_keyword_count=()=>(_i=n._sqlite3_keyword_count=i.td)(),si=n._sqlite3_keyword_check=(e,t)=>(si=n._sqlite3_keyword_check=i.ud)(e,t),oi=n._sqlite3_complete=e=>(oi=n._sqlite3_complete=i.vd)(e),ii=n._sqlite3_complete16=e=>(ii=n._sqlite3_complete16=i.wd)(e),ai=n._sqlite3_libversion=()=>(ai=n._sqlite3_libversion=i.xd)(),li=n._sqlite3_libversion_number=()=>(li=n._sqlite3_libversion_number=i.yd)(),ci=n._sqlite3_threadsafe=()=>(ci=n._sqlite3_threadsafe=i.zd)(),ui=n._sqlite3_initialize=()=>(ui=n._sqlite3_initialize=i.Ad)(),fi=n._sqlite3_shutdown=()=>(fi=n._sqlite3_shutdown=i.Bd)(),di=n._sqlite3_config=(e,t)=>(di=n._sqlite3_config=i.Cd)(e,t),pi=n._sqlite3_db_mutex=e=>(pi=n._sqlite3_db_mutex=i.Dd)(e),vi=n._sqlite3_db_release_memory=e=>(vi=n._sqlite3_db_release_memory=i.Ed)(e),mi=n._sqlite3_db_cacheflush=e=>(mi=n._sqlite3_db_cacheflush=i.Fd)(e),Ei=n._sqlite3_db_config=(e,t,r)=>(Ei=n._sqlite3_db_config=i.Gd)(e,t,r),qi=n._sqlite3_last_insert_rowid=e=>(qi=n._sqlite3_last_insert_rowid=i.Hd)(e),hi=n._sqlite3_set_last_insert_rowid=(e,t,r)=>(hi=n._sqlite3_set_last_insert_rowid=i.Id)(e,t,r),bi=n._sqlite3_changes64=e=>(bi=n._sqlite3_changes64=i.Jd)(e),Ti=n._sqlite3_changes=e=>(Ti=n._sqlite3_changes=i.Kd)(e),wi=n._sqlite3_total_changes64=e=>(wi=n._sqlite3_total_changes64=i.Ld)(e),yi=n._sqlite3_total_changes=e=>(yi=n._sqlite3_total_changes=i.Md)(e),Si=n._sqlite3_txn_state=(e,t)=>(Si=n._sqlite3_txn_state=i.Nd)(e,t),gi=n._sqlite3_close=e=>(gi=n._sqlite3_close=i.Od)(e),Ii=n._sqlite3_close_v2=e=>(Ii=n._sqlite3_close_v2=i.Pd)(e),Li=n._sqlite3_busy_handler=(e,t,r)=>(Li=n._sqlite3_busy_handler=i.Qd)(e,t,r),xi=n._sqlite3_progress_handler=(e,t,r,_)=>(xi=n._sqlite3_progress_handler=i.Rd)(e,t,r,_),Ai=n._sqlite3_busy_timeout=(e,t)=>(Ai=n._sqlite3_busy_timeout=i.Sd)(e,t),Ni=n._sqlite3_interrupt=e=>(Ni=n._sqlite3_interrupt=i.Td)(e),Ri=n._sqlite3_is_interrupted=e=>(Ri=n._sqlite3_is_interrupted=i.Ud)(e),ki=n._sqlite3_create_function=(e,t,r,_,o,a,l,c)=>(ki=n._sqlite3_create_function=i.Vd)(e,t,r,_,o,a,l,c),Oi=n._sqlite3_create_function_v2=(e,t,r,_,o,a,l,c,E)=>(Oi=n._sqlite3_create_function_v2=i.Wd)(e,t,r,_,o,a,l,c,E),Qi=n._sqlite3_create_window_function=(e,t,r,_,o,a,l,c,E,h)=>(Qi=n._sqlite3_create_window_function=i.Xd)(e,t,r,_,o,a,l,c,E,h),Ci=n._sqlite3_create_function16=(e,t,r,_,o,a,l,c)=>(Ci=n._sqlite3_create_function16=i.Yd)(e,t,r,_,o,a,l,c),Fi=n._sqlite3_overload_function=(e,t,r)=>(Fi=n._sqlite3_overload_function=i.Zd)(e,t,r),Pi=n._sqlite3_trace_v2=(e,t,r,_)=>(Pi=n._sqlite3_trace_v2=i._d)(e,t,r,_),Di=n._sqlite3_commit_hook=(e,t,r)=>(Di=n._sqlite3_commit_hook=i.$d)(e,t,r),Mi=n._sqlite3_update_hook=(e,t,r)=>(Mi=n._sqlite3_update_hook=i.ae)(e,t,r),Ui=n._sqlite3_rollback_hook=(e,t,r)=>(Ui=n._sqlite3_rollback_hook=i.be)(e,t,r),zi=n._sqlite3_autovacuum_pages=(e,t,r,_)=>(zi=n._sqlite3_autovacuum_pages=i.ce)(e,t,r,_),Bi=n._sqlite3_wal_autocheckpoint=(e,t)=>(Bi=n._sqlite3_wal_autocheckpoint=i.de)(e,t),Hi=n._sqlite3_wal_hook=(e,t,r)=>(Hi=n._sqlite3_wal_hook=i.ee)(e,t,r),Wi=n._sqlite3_wal_checkpoint_v2=(e,t,r,_,o)=>(Wi=n._sqlite3_wal_checkpoint_v2=i.fe)(e,t,r,_,o),ji=n._sqlite3_wal_checkpoint=(e,t)=>(ji=n._sqlite3_wal_checkpoint=i.ge)(e,t),Gi=n._sqlite3_error_offset=e=>(Gi=n._sqlite3_error_offset=i.he)(e),Ki=n._sqlite3_errmsg16=e=>(Ki=n._sqlite3_errmsg16=i.ie)(e),Vi=n._sqlite3_errcode=e=>(Vi=n._sqlite3_errcode=i.je)(e),Xi=n._sqlite3_extended_errcode=e=>(Xi=n._sqlite3_extended_errcode=i.ke)(e),Yi=n._sqlite3_system_errno=e=>(Yi=n._sqlite3_system_errno=i.le)(e),$i=n._sqlite3_errstr=e=>($i=n._sqlite3_errstr=i.me)(e),Zi=n._sqlite3_limit=(e,t,r)=>(Zi=n._sqlite3_limit=i.ne)(e,t,r),Ji=n._sqlite3_open=(e,t)=>(Ji=n._sqlite3_open=i.oe)(e,t),ea=n._sqlite3_open_v2=(e,t,r,_)=>(ea=n._sqlite3_open_v2=i.pe)(e,t,r,_),ta=n._sqlite3_open16=(e,t)=>(ta=n._sqlite3_open16=i.qe)(e,t),ra=n._sqlite3_create_collation=(e,t,r,_,o)=>(ra=n._sqlite3_create_collation=i.re)(e,t,r,_,o),na=n._sqlite3_create_collation_v2=(e,t,r,_,o,a)=>(na=n._sqlite3_create_collation_v2=i.se)(e,t,r,_,o,a),_a=n._sqlite3_create_collation16=(e,t,r,_,o)=>(_a=n._sqlite3_create_collation16=i.te)(e,t,r,_,o),sa=n._sqlite3_collation_needed=(e,t,r)=>(sa=n._sqlite3_collation_needed=i.ue)(e,t,r),oa=n._sqlite3_collation_needed16=(e,t,r)=>(oa=n._sqlite3_collation_needed16=i.ve)(e,t,r),ia=n._sqlite3_get_clientdata=(e,t)=>(ia=n._sqlite3_get_clientdata=i.we)(e,t),aa=n._sqlite3_set_clientdata=(e,t,r,_)=>(aa=n._sqlite3_set_clientdata=i.xe)(e,t,r,_),la=n._sqlite3_get_autocommit=e=>(la=n._sqlite3_get_autocommit=i.ye)(e),ca=n._sqlite3_table_column_metadata=(e,t,r,_,o,a,l,c,E)=>(ca=n._sqlite3_table_column_metadata=i.ze)(e,t,r,_,o,a,l,c,E),ua=n._sqlite3_sleep=e=>(ua=n._sqlite3_sleep=i.Ae)(e),fa=n._sqlite3_extended_result_codes=(e,t)=>(fa=n._sqlite3_extended_result_codes=i.Be)(e,t),da=n._sqlite3_file_control=(e,t,r,_)=>(da=n._sqlite3_file_control=i.Ce)(e,t,r,_),pa=n._sqlite3_test_control=(e,t)=>(pa=n._sqlite3_test_control=i.De)(e,t),va=n._sqlite3_create_filename=(e,t,r,_,o)=>(va=n._sqlite3_create_filename=i.Ee)(e,t,r,_,o),ma=n._sqlite3_free_filename=e=>(ma=n._sqlite3_free_filename=i.Fe)(e),Ea=n._sqlite3_uri_parameter=(e,t)=>(Ea=n._sqlite3_uri_parameter=i.Ge)(e,t),qa=n._sqlite3_uri_key=(e,t)=>(qa=n._sqlite3_uri_key=i.He)(e,t),ha=n._sqlite3_uri_boolean=(e,t,r)=>(ha=n._sqlite3_uri_boolean=i.Ie)(e,t,r),ba=n._sqlite3_uri_int64=(e,t,r,_)=>(ba=n._sqlite3_uri_int64=i.Je)(e,t,r,_),Ta=n._sqlite3_filename_database=e=>(Ta=n._sqlite3_filename_database=i.Ke)(e),wa=n._sqlite3_filename_journal=e=>(wa=n._sqlite3_filename_journal=i.Le)(e),ya=n._sqlite3_filename_wal=e=>(ya=n._sqlite3_filename_wal=i.Me)(e),Sa=n._sqlite3_db_name=(e,t)=>(Sa=n._sqlite3_db_name=i.Ne)(e,t),ga=n._sqlite3_db_filename=(e,t)=>(ga=n._sqlite3_db_filename=i.Oe)(e,t),Ia=n._sqlite3_db_readonly=(e,t)=>(Ia=n._sqlite3_db_readonly=i.Pe)(e,t),La=n._sqlite3_compileoption_used=e=>(La=n._sqlite3_compileoption_used=i.Qe)(e),xa=n._sqlite3_compileoption_get=e=>(xa=n._sqlite3_compileoption_get=i.Re)(e),Aa=n._sqlite3_sourceid=()=>(Aa=n._sqlite3_sourceid=i.Se)(),Na=n._malloc=e=>(Na=n._malloc=i.Te)(e),Ra=n._free=e=>(Ra=n._free=i.Ue)(e),ka=n._RegisterExtensionFunctions=e=>(ka=n._RegisterExtensionFunctions=i.Ve)(e),Oa=n._getSqliteFree=()=>(Oa=n._getSqliteFree=i.We)(),ct=n._main=(e,t)=>(ct=n._main=i.Xe)(e,t),Qa=n._libauthorizer_set_authorizer=(e,t,r)=>(Qa=n._libauthorizer_set_authorizer=i.Ye)(e,t,r),Ca=n._libfunction_create_function=(e,t,r,_,o,a,l,c)=>(Ca=n._libfunction_create_function=i.Ze)(e,t,r,_,o,a,l,c),Fa=n._libprogress_progress_handler=(e,t,r,_)=>(Fa=n._libprogress_progress_handler=i._e)(e,t,r,_),Pa=n._libvfs_vfs_register=(e,t,r,_,o,a)=>(Pa=n._libvfs_vfs_register=i.$e)(e,t,r,_,o,a),ut=(e,t)=>(ut=i.bf)(e,t),ft=()=>(ft=i.cf)(),dt=e=>(dt=i.df)(e),pt=e=>(pt=i.ef)(e),vt=()=>(vt=i.ff)(),Va=n._sqlite3_version=5472;n.getTempRet0=Un,n.ccall=Ee,n.cwrap=Mn,n.addFunction=Pn,n.setValue=Ae,n.getValue=$e,n.UTF8ToString=ce,n.stringToUTF8=oe,n.lengthBytesUTF8=pe,n.intArrayFromString=Me,n.intArrayToString=Gn,n.AsciiToString=Hn,n.UTF16ToString=Wn,n.stringToUTF16=zn,n.UTF32ToString=jn,n.stringToUTF32=Bn,n.writeArrayToMemory=it;var Re;be=function e(){Re||mt(),Re||(be=e)};function Da(){var e=ct,t=0,r=0;try{var _=e(t,r);return xn(_,!0),_}catch(o){return An(o)}}function mt(){if(le>0||(Ot(),le>0))return;function e(){Re||(Re=!0,n.calledRun=!0,!W&&(Qt(),Ct(),ie(n),n.onRuntimeInitialized?.(),Et&&Da(),Ft()))}n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),e()},1)):e()}if(n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();var Et=!0;return n.noInitialRun&&(Et=!1),mt(),function(){let e=Object.getPrototypeOf(async function(){}).constructor,t=0;n.set_authorizer=function(r,_,o){t&&(n.deleteCallback(t),n._sqlite3_free(t),t=0),t=n._sqlite3_malloc(4),Ae(t,_ instanceof e?1:0,"i32");let a=Ee("libauthorizer_set_authorizer","number",["number","number","number"],[r,_?1:0,t]);return!a&&_&&n.setCallback(t,(l,c,E,h,g,A)=>_(o,c,E,h,g,A)),a}}(),function(){let e=Object.getPrototypeOf(async function(){}).constructor,t=["xFunc","xStep","xFinal"],r=new Map;n.create_function=function(_,o,a,l,c,E,h,g){let A=n._sqlite3_malloc(4),x={xFunc:E,xStep:h,xFinal:g};Ae(A,t.reduce((b,M,V)=>x[M]instanceof e?b|1<o(a))}}(),function(){let e=["xOpen","xDelete","xAccess","xFullPathname","xRandomness","xSleep","xCurrentTime","xGetLastError","xCurrentTimeInt64","xClose","xRead","xWrite","xTruncate","xSync","xFileSize","xLock","xUnlock","xCheckReservedLock","xFileControl","xSectorSize","xDeviceCharacteristics","xShmMap","xShmLock","xShmBarrier","xShmUnmap"],t=new Map;n.vfs_register=function(r,_){let o=0,a=0;e.forEach((c,E)=>{r[c]&&(o|=1<