absurder-sql 0.1.23

AbsurderSQL - SQLite + IndexedDB that's absurdly better than absurd-sql
Documentation
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./examples/absurd-worker.js":
/*!***********************************!*\
  !*** ./examples/absurd-worker.js ***!
  \***********************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _jlongster_sql_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jlongster/sql.js */ \"./node_modules/@jlongster/sql.js/dist/sql-wasm.js\");\n/* harmony import */ var absurd_sql__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! absurd-sql */ \"./node_modules/absurd-sql/dist/index.js\");\n/* harmony import */ var absurd_sql_dist_indexeddb_backend_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! absurd-sql/dist/indexeddb-backend.js */ \"./node_modules/absurd-sql/dist/indexeddb-backend.js\");\n\n\n\n\nlet db = null;\n\nasync function initDatabase() {\n    const SQL = await _jlongster_sql_js__WEBPACK_IMPORTED_MODULE_0__({ \n        locateFile: file => `/node_modules/@jlongster/sql.js/dist/${file}` \n    });\n    const sqlFS = new absurd_sql__WEBPACK_IMPORTED_MODULE_1__.SQLiteFS(SQL.FS, new absurd_sql_dist_indexeddb_backend_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]());\n    SQL.register_for_idb(sqlFS);\n\n    SQL.FS.mkdir('/sql');\n    SQL.FS.mount(sqlFS, {}, '/sql');\n\n    const path = '/sql/benchmark.sqlite';\n    \n    // Handle SharedArrayBuffer fallback\n    if (typeof SharedArrayBuffer === 'undefined') {\n        try {\n            let stream = SQL.FS.open(path, 'a+');\n            await stream.node.contents.readIfFallback();\n            SQL.FS.close(stream);\n        } catch (e) {\n            console.warn('SharedArrayBuffer fallback failed, continuing anyway:', e);\n        }\n    }\n\n    db = new SQL.Database(path, { filename: true });\n    db.exec(`\n        PRAGMA page_size=8192;\n        PRAGMA journal_mode=MEMORY;\n    `);\n    \n    return true;\n}\n\n// Message handler\nself.onmessage = async function(e) {\n    const { type, sql, id } = e.data;\n    \n    try {\n        if (type === 'init') {\n            await initDatabase();\n            self.postMessage({ type: 'init', success: true, id });\n        } else if (type === 'exec') {\n            const start = performance.now();\n            db.exec(sql);\n            const duration = performance.now() - start;\n            self.postMessage({ type: 'exec', success: true, duration, id });\n        } else if (type === 'close') {\n            if (db) {\n                db.close();\n                db = null;\n            }\n            self.postMessage({ type: 'close', success: true, id });\n        }\n    } catch (error) {\n        self.postMessage({ \n            type: type, \n            success: false, \n            error: error.message,\n            id \n        });\n    }\n};\n\n\n//# sourceURL=webpack://sqlite-indexeddb-benchmark/./examples/absurd-worker.js?\n}");

/***/ }),

/***/ "./node_modules/@jlongster/sql.js/dist/sql-wasm.js":
/*!*********************************************************!*\
  !*** ./node_modules/@jlongster/sql.js/dist/sql-wasm.js ***!
  \*********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("{var __dirname = \"/\";\n/* module decorator */ module = __webpack_require__.nmd(module);\n\n// We are modularizing this manually because the current modularize setting in Emscripten has some issues:\n// https://github.com/kripken/emscripten/issues/5820\n// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`,\n// which is able to be used/called before the WASM is loaded.\n// The modularization below exports a promise that loads and resolves to the actual sql.js module.\n// That way, this module can't be used before the WASM is finished loading.\n\n// We are going to define a function that a user will call to start loading initializing our Sql.js library\n// However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module\n// Instead, we want to return the previously loaded module\n\n// TODO: Make this not declare a global if used in the browser\nvar initSqlJsPromise = undefined;\n\nvar initSqlJs = function (moduleConfig) {\n\n    if (initSqlJsPromise){\n      return initSqlJsPromise;\n    }\n    // If we're here, we've never called this function before\n    initSqlJsPromise = new Promise(function (resolveModule, reject) {\n\n        // We are modularizing this manually because the current modularize setting in Emscripten has some issues:\n        // https://github.com/kripken/emscripten/issues/5820\n\n        // The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add\n        // properties to it, like `preRun`, `postRun`, etc\n        // We are using that to get notified when the WASM has finished loading.\n        // Only then will we return our promise\n\n        // If they passed in a moduleConfig object, use that\n        // Otherwise, initialize Module to the empty object\n        var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {};\n\n        // EMCC only allows for a single onAbort function (not an array of functions)\n        // So if the user defined their own onAbort function, we remember it and call it\n        var originalOnAbortFunction = Module['onAbort'];\n        Module['onAbort'] = function (errorThatCausedAbort) {\n            reject(new Error(errorThatCausedAbort));\n            if (originalOnAbortFunction){\n              originalOnAbortFunction(errorThatCausedAbort);\n            }\n        };\n\n        Module['postRun'] = Module['postRun'] || [];\n        Module['postRun'].push(function () {\n            // When Emscripted calls postRun, this promise resolves with the built Module\n            resolveModule(Module);\n        });\n\n        // There is a section of code in the emcc-generated code below that looks like this:\n        // (Note that this is lowercase `module`)\n        // if (typeof module !== 'undefined') {\n        //     module['exports'] = Module;\n        // }\n        // When that runs, it's going to overwrite our own modularization export efforts in shell-post.js!\n        // The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags,\n        // but that carries with it additional unnecessary baggage/bugs we don't want either.\n        // So, we have three options:\n        // 1) We undefine `module`\n        // 2) We remember what `module['exports']` was at the beginning of this function and we restore it later\n        // 3) We write a script to remove those lines of code as part of the Make process.\n        //\n        // Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward\n        // of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future.\n        // That's a nice side effect since we're handling the modularization efforts ourselves\n        module = undefined;\n\n        // The emcc-generated code and shell-post.js code goes below,\n        // meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort\n\nvar Module;Module||(Module=typeof Module !== 'undefined' ? Module : {});null;\nModule.onRuntimeInitialized=function(){function a(h,n){this.Qa=h;this.db=n;this.Pa=1;this.wb=[]}function b(h,n){this.db=n;n=d(h)+1;this.hb=aa(n);if(null===this.hb)throw Error(\"Unable to allocate memory for the SQL string\");p(h,u,this.hb,n);this.sb=this.hb;this.eb=this.Mb=null}function c(h,{filename:n=!1}={}){!1===n?(this.filename=\"dbfile_\"+(4294967295*Math.random()>>>0),this.Xc=!0,null!=h&&w.zb(\"/\",this.filename,h,!0,!0)):this.filename=h;this.handleError(g(this.filename,e));this.db=z(e,\"i32\");Cb(this.db);\nthis.nb={};this.Xa={}}var e=C(4),f=Module.cwrap,g=f(\"sqlite3_open\",\"number\",[\"string\",\"number\"]),k=f(\"sqlite3_close_v2\",\"number\",[\"number\"]),l=f(\"sqlite3_exec\",\"number\",[\"number\",\"string\",\"number\",\"number\",\"number\"]),q=f(\"sqlite3_changes\",\"number\",[\"number\"]),m=f(\"sqlite3_prepare_v2\",\"number\",[\"number\",\"string\",\"number\",\"number\",\"number\"]),r=f(\"sqlite3_sql\",\"string\",[\"number\"]),x=f(\"sqlite3_normalized_sql\",\"string\",[\"number\"]),B=f(\"sqlite3_prepare_v2\",\"number\",[\"number\",\"number\",\"number\",\"number\",\n\"number\"]),E=f(\"sqlite3_bind_text\",\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\"]),A=f(\"sqlite3_bind_blob\",\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\"]),J=f(\"sqlite3_bind_double\",\"number\",[\"number\",\"number\",\"number\"]),Z=f(\"sqlite3_bind_int\",\"number\",[\"number\",\"number\",\"number\"]),U=f(\"sqlite3_bind_parameter_index\",\"number\",[\"number\",\"string\"]),Ka=f(\"sqlite3_step\",\"number\",[\"number\"]),G=f(\"sqlite3_errmsg\",\"string\",[\"number\"]),Db=f(\"sqlite3_column_count\",\"number\",[\"number\"]),Eb=f(\"sqlite3_data_count\",\n\"number\",[\"number\"]),Fb=f(\"sqlite3_column_double\",\"number\",[\"number\",\"number\"]),Gb=f(\"sqlite3_column_text\",\"string\",[\"number\",\"number\"]),Hb=f(\"sqlite3_column_blob\",\"number\",[\"number\",\"number\"]),Ib=f(\"sqlite3_column_bytes\",\"number\",[\"number\",\"number\"]),Jb=f(\"sqlite3_column_type\",\"number\",[\"number\",\"number\"]),Kb=f(\"sqlite3_column_name\",\"string\",[\"number\",\"number\"]),Lb=f(\"sqlite3_reset\",\"number\",[\"number\"]),Mb=f(\"sqlite3_clear_bindings\",\"number\",[\"number\"]),Nb=f(\"sqlite3_finalize\",\"number\",[\"number\"]),\nOb=f(\"sqlite3_create_function_v2\",\"number\",\"number string number number number number number number number\".split(\" \")),Pb=f(\"sqlite3_value_type\",\"number\",[\"number\"]),Qb=f(\"sqlite3_value_bytes\",\"number\",[\"number\"]),Rb=f(\"sqlite3_value_text\",\"string\",[\"number\"]),Sb=f(\"sqlite3_value_blob\",\"number\",[\"number\"]),Tb=f(\"sqlite3_value_double\",\"number\",[\"number\"]),Ub=f(\"sqlite3_result_double\",\"\",[\"number\",\"number\"]),db=f(\"sqlite3_result_null\",\"\",[\"number\"]),Vb=f(\"sqlite3_result_text\",\"\",[\"number\",\"string\",\n\"number\",\"number\"]),Wb=f(\"sqlite3_result_blob\",\"\",[\"number\",\"number\",\"number\",\"number\"]),Xb=f(\"sqlite3_result_int\",\"\",[\"number\",\"number\"]),eb=f(\"sqlite3_result_error\",\"\",[\"number\",\"string\",\"number\"]),Cb=f(\"RegisterExtensionFunctions\",\"number\",[\"number\"]);a.prototype.bind=function(h){if(!this.Qa)throw\"Statement closed\";this.reset();return Array.isArray(h)?this.vc(h):null!=h&&\"object\"===typeof h?this.wc(h):!0};a.prototype.step=function(){if(!this.Qa)throw\"Statement closed\";this.Pa=1;var h=Ka(this.Qa);\nswitch(h){case 100:return!0;case 101:return!1;default:throw this.db.handleError(h);}};a.prototype.Pc=function(h){null==h&&(h=this.Pa,this.Pa+=1);return Fb(this.Qa,h)};a.prototype.Qc=function(h){null==h&&(h=this.Pa,this.Pa+=1);return Gb(this.Qa,h)};a.prototype.getBlob=function(h){null==h&&(h=this.Pa,this.Pa+=1);var n=Ib(this.Qa,h);h=Hb(this.Qa,h);for(var t=new Uint8Array(n),v=0;v<n;v+=1)t[v]=D[h+v];return t};a.prototype.get=function(h){null!=h&&this.bind(h)&&this.step();h=[];for(var n=Eb(this.Qa),\nt=0;t<n;t+=1)switch(Jb(this.Qa,t)){case 1:case 2:h.push(this.Pc(t));break;case 3:h.push(this.Qc(t));break;case 4:h.push(this.getBlob(t));break;default:h.push(null)}return h};a.prototype.getColumnNames=function(){for(var h=[],n=Db(this.Qa),t=0;t<n;t+=1)h.push(Kb(this.Qa,t));return h};a.prototype.getAsObject=function(h){h=this.get(h);for(var n=this.getColumnNames(),t={},v=0;v<n.length;v+=1)t[n[v]]=h[v];return t};a.prototype.getSQL=function(){return r(this.Qa)};a.prototype.getNormalizedSQL=function(){return x(this.Qa)};\na.prototype.run=function(h){null!=h&&this.bind(h);this.step();return this.reset()};a.prototype.zc=function(h,n){null==n&&(n=this.Pa,this.Pa+=1);h=ba(h);var t=ca(h);this.wb.push(t);this.db.handleError(E(this.Qa,n,t,h.length-1,0))};a.prototype.uc=function(h,n){null==n&&(n=this.Pa,this.Pa+=1);var t=ca(h);this.wb.push(t);this.db.handleError(A(this.Qa,n,t,h.length,0))};a.prototype.yc=function(h,n){null==n&&(n=this.Pa,this.Pa+=1);this.db.handleError((h===(h|0)?Z:J)(this.Qa,n,h))};a.prototype.xc=function(h){null==\nh&&(h=this.Pa,this.Pa+=1);A(this.Qa,h,0,0,0)};a.prototype.Tb=function(h,n){null==n&&(n=this.Pa,this.Pa+=1);switch(typeof h){case \"string\":this.zc(h,n);return;case \"number\":case \"boolean\":this.yc(h+0,n);return;case \"object\":if(null===h){this.xc(n);return}if(null!=h.length){this.uc(h,n);return}}throw\"Wrong API use : tried to bind a value of an unknown type (\"+h+\").\";};a.prototype.wc=function(h){var n=this;Object.keys(h).forEach(function(t){var v=U(n.Qa,t);0!==v&&n.Tb(h[t],v)});return!0};a.prototype.vc=\nfunction(h){for(var n=0;n<h.length;n+=1)this.Tb(h[n],n+1);return!0};a.prototype.reset=function(){return 0===Mb(this.Qa)&&0===Lb(this.Qa)};a.prototype.freemem=function(){for(var h;void 0!==(h=this.wb.pop());)da(h)};a.prototype.free=function(){var h=0===Nb(this.Qa);delete this.db.nb[this.Qa];this.Qa=0;return h};b.prototype.next=function(){if(null===this.hb)return{done:!0};null!==this.eb&&(this.eb.free(),this.eb=null);if(!this.db.db)throw this.Bb(),Error(\"Database closed\");var h=ha(),n=C(4);ia(e);ia(n);\ntry{this.db.handleError(B(this.db.db,this.sb,-1,e,n));this.sb=z(n,\"i32\");var t=z(e,\"i32\");if(0===t)return this.Bb(),{done:!0};this.eb=new a(t,this.db);this.db.nb[t]=this.eb;return{value:this.eb,done:!1}}catch(v){throw this.Mb=F(this.sb),this.Bb(),v;}finally{ja(h)}};b.prototype.Bb=function(){da(this.hb);this.hb=null};b.prototype.getRemainingSQL=function(){return null!==this.Mb?this.Mb:F(this.sb)};\"function\"===typeof Symbol&&\"symbol\"===typeof Symbol.iterator&&(b.prototype[Symbol.iterator]=function(){return this});\nc.prototype.run=function(h,n){if(!this.db)throw\"Database closed\";if(n){h=this.prepare(h,n);try{h.step()}finally{h.free()}}else this.handleError(l(this.db,h,0,0,e));return this};c.prototype.exec=function(h,n){if(!this.db)throw\"Database closed\";var t=ha(),v=null;try{var y=d(h)+1,N=C(y);p(h,D,N,y);var H=N;var ea=C(4);for(h=[];0!==z(H,\"i8\");){ia(e);ia(ea);this.handleError(B(this.db,H,-1,e,ea));var fa=z(e,\"i32\");H=z(ea,\"i32\");if(0!==fa){y=null;v=new a(fa,this);for(null!=n&&v.bind(n);v.step();)null===y&&\n(y={columns:v.getColumnNames(),values:[]},h.push(y)),y.values.push(v.get());v.free()}}return h}catch(I){throw v&&v.free(),I;}finally{ja(t)}};c.prototype.each=function(h,n,t,v){\"function\"===typeof n&&(v=t,t=n,n=void 0);h=this.prepare(h,n);try{for(;h.step();)t(h.getAsObject())}finally{h.free()}if(\"function\"===typeof v)return v()};c.prototype.prepare=function(h,n){ia(e);this.handleError(m(this.db,h,-1,e,0));h=z(e,\"i32\");if(0===h)throw\"Nothing to prepare\";var t=new a(h,this);null!=n&&t.bind(n);return this.nb[h]=\nt};c.prototype.iterateStatements=function(h){return new b(h,this)};c.prototype[\"export\"]=function(){Object.values(this.nb).forEach(function(n){n.free()});Object.values(this.Xa).forEach(ka);this.Xa={};this.handleError(k(this.db));var h=w.readFile(this.filename,{encoding:\"binary\"});this.handleError(g(this.filename,e));this.db=z(e,\"i32\");return h};c.prototype.close=function(){null!==this.db&&(Object.values(this.nb).forEach(function(h){h.free()}),Object.values(this.Xa).forEach(ka),this.Xa={},this.handleError(k(this.db)),\nthis.Xc&&w.unlink(\"/\"+this.filename),this.db=null)};c.prototype.handleError=function(h){if(0===h)return null;h=G(this.db);throw Error(h);};c.prototype.getRowsModified=function(){return q(this.db)};c.prototype.create_function=function(h,n){Object.prototype.hasOwnProperty.call(this.Xa,h)&&(ka(this.Xa[h]),delete this.Xa[h]);var t=la(function(v,y,N){for(var H,ea=[],fa=0;fa<y;fa+=1){var I=z(N+4*fa,\"i32\"),S=Pb(I);if(1===S||2===S)I=Tb(I);else if(3===S)I=Rb(I);else if(4===S){S=I;I=Qb(S);S=Sb(S);for(var fb=\nnew Uint8Array(I),Aa=0;Aa<I;Aa+=1)fb[Aa]=D[S+Aa];I=fb}else I=null;ea.push(I)}try{H=n.apply(null,ea)}catch(Yb){eb(v,Yb,-1);return}switch(typeof H){case \"boolean\":Xb(v,H?1:0);break;case \"number\":Ub(v,H);break;case \"string\":Vb(v,H,-1,-1);break;case \"object\":null===H?db(v):null!=H.length?(y=ca(H),Wb(v,y,H.length,-1),da(y)):eb(v,\"Wrong API use : tried to return a value of an unknown type (\"+H+\").\",-1);break;default:db(v)}},\"viii\");this.Xa[h]=t;this.handleError(Ob(this.db,h,n.length,1,0,t,0,0,0));return this};\nModule.Database=c;var ra=new Map;Module.register_for_idb=h=>{let n=la(function(y,N){y=ra.get(y);return h.lock(y,N)?0:5},\"iii\"),t=la(function(y,N){y=ra.get(y);h.unlock(y,N);return 0},\"iii\"),v=la(function(y,N){y=F(y);ra.set(N,y)},\"vii\");Module._register_for_idb(n,t,v)};Module.cleanup_file=h=>{let n=[...ra.entries()].find(t=>t[1]===h);ra.delete(n[0])};Module.reset_filesystem=()=>{w.root=null;w.lc()}};var ma={},K;for(K in Module)Module.hasOwnProperty(K)&&(ma[K]=Module[K]);\nvar na=\"./this.program\",oa=\"object\"===typeof window,pa=\"function\"===typeof importScripts,qa=\"object\"===typeof process&&\"object\"===typeof process.versions&&\"string\"===typeof process.versions.node,L=\"\",sa,ta,ua,va,wa;\nif(qa)L=pa?(__webpack_require__(/*! path */ \"?2a46\").dirname)(L)+\"/\":__dirname+\"/\",sa=function(a,b){va||(va=__webpack_require__(/*! fs */ \"?180a\"));wa||(wa=__webpack_require__(/*! path */ \"?2a46\"));a=wa.normalize(a);return va.readFileSync(a,b?null:\"utf8\")},ua=function(a){a=sa(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a},ta=function(a,b,c){va||(va=__webpack_require__(/*! fs */ \"?180a\"));wa||(wa=__webpack_require__(/*! path */ \"?2a46\"));a=wa.normalize(a);va.readFile(a,function(e,f){e?c(e):b(f.buffer)})},1<process.argv.length&&(na=process.argv[1].replace(/\\\\/g,\"/\")),process.argv.slice(2), true&&\n(module.exports=Module),Module.inspect=function(){return\"[Emscripten Module object]\"};else if(oa||pa)pa?L=self.location.href:\"undefined\"!==typeof document&&document.currentScript&&(L=document.currentScript.src),L=0!==L.indexOf(\"blob:\")?L.substr(0,L.lastIndexOf(\"/\")+1):\"\",sa=function(a){var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.send(null);return b.responseText},pa&&(ua=function(a){var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.responseType=\"arraybuffer\";b.send(null);return new Uint8Array(b.response)}),\nta=function(a,b,c){var e=new XMLHttpRequest;e.open(\"GET\",a,!0);e.responseType=\"arraybuffer\";e.onload=function(){200==e.status||0==e.status&&e.response?b(e.response):c()};e.onerror=c;e.send(null)};var xa=Module.print||console.log.bind(console),M=Module.printErr||console.warn.bind(console);for(K in ma)ma.hasOwnProperty(K)&&(Module[K]=ma[K]);ma=null;Module.thisProgram&&(na=Module.thisProgram);var ya=[],za;function ka(a){za.delete(O.get(a));ya.push(a)}\nfunction la(a,b){if(!za){za=new WeakMap;for(var c=0;c<O.length;c++){var e=O.get(c);e&&za.set(e,c)}}if(za.has(a))a=za.get(a);else{if(ya.length)c=ya.pop();else{try{O.grow(1)}catch(l){if(!(l instanceof RangeError))throw l;throw\"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.\";}c=O.length-1}try{O.set(c,a)}catch(l){if(!(l instanceof TypeError))throw l;if(\"function\"===typeof WebAssembly.Function){var f={i:\"i32\",j:\"i64\",f:\"f32\",d:\"f64\"},g={parameters:[],results:\"v\"==b[0]?[]:[f[b[0]]]};for(e=1;e<b.length;++e)g.parameters.push(f[b[e]]);\nb=new WebAssembly.Function(g,a)}else{f=[1,0,1,96];g=b.slice(0,1);b=b.slice(1);var k={i:127,j:126,f:125,d:124};f.push(b.length);for(e=0;e<b.length;++e)f.push(k[b[e]]);\"v\"==g?f.push(0):f=f.concat([1,k[g]]);f[1]=f.length-2;b=new Uint8Array([0,97,115,109,1,0,0,0].concat(f,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0]));b=new WebAssembly.Module(b);b=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f}O.set(c,b)}za.set(a,c);a=c}return a}var Ba;Module.wasmBinary&&(Ba=Module.wasmBinary);\nvar noExitRuntime=Module.noExitRuntime||!0;\"object\"!==typeof WebAssembly&&P(\"no native wasm support detected\");\nfunction ia(a){var b=\"i32\";\"*\"===b.charAt(b.length-1)&&(b=\"i32\");switch(b){case \"i1\":D[a>>0]=0;break;case \"i8\":D[a>>0]=0;break;case \"i16\":Ca[a>>1]=0;break;case \"i32\":Q[a>>2]=0;break;case \"i64\":R=[0,(T=0,1<=+Math.abs(T)?0<T?(Math.min(+Math.floor(T/4294967296),4294967295)|0)>>>0:~~+Math.ceil((T-+(~~T>>>0))/4294967296)>>>0:0)];Q[a>>2]=R[0];Q[a+4>>2]=R[1];break;case \"float\":Da[a>>2]=0;break;case \"double\":Ea[a>>3]=0;break;default:P(\"invalid type for setValue: \"+b)}}\nfunction z(a,b){b=b||\"i8\";\"*\"===b.charAt(b.length-1)&&(b=\"i32\");switch(b){case \"i1\":return D[a>>0];case \"i8\":return D[a>>0];case \"i16\":return Ca[a>>1];case \"i32\":return Q[a>>2];case \"i64\":return Q[a>>2];case \"float\":return Da[a>>2];case \"double\":return Ea[a>>3];default:P(\"invalid type for getValue: \"+b)}return null}var Fa,Ga=!1;function assert(a,b){a||P(\"Assertion failed: \"+b)}function Ha(a){var b=Module[\"_\"+a];assert(b,\"Cannot call unknown function \"+a+\", make sure it is exported\");return b}\nfunction Ia(a,b,c,e){var f={string:function(m){var r=0;if(null!==m&&void 0!==m&&0!==m){var x=(m.length<<2)+1;r=C(x);p(m,u,r,x)}return r},array:function(m){var r=C(m.length);D.set(m,r);return r}},g=Ha(a),k=[];a=0;if(e)for(var l=0;l<e.length;l++){var q=f[c[l]];q?(0===a&&(a=ha()),k[l]=q(e[l])):k[l]=e[l]}c=g.apply(null,k);c=function(m){return\"string\"===b?F(m):\"boolean\"===b?!!m:m}(c);0!==a&&ja(a);return c}var Ja=0,La=1;\nfunction ca(a){var b=Ja==La?C(a.length):aa(a.length);a.subarray||a.slice?u.set(a,b):u.set(new Uint8Array(a),b);return b}var Ma=\"undefined\"!==typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;\nfunction Na(a,b,c){var e=b+c;for(c=b;a[c]&&!(c>=e);)++c;if(16<c-b&&a.subarray&&Ma)return Ma.decode(a.subarray(b,c));for(e=\"\";b<c;){var f=a[b++];if(f&128){var g=a[b++]&63;if(192==(f&224))e+=String.fromCharCode((f&31)<<6|g);else{var k=a[b++]&63;f=224==(f&240)?(f&15)<<12|g<<6|k:(f&7)<<18|g<<12|k<<6|a[b++]&63;65536>f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e}function F(a,b){return a?Na(u,a,b):\"\"}\nfunction p(a,b,c,e){if(!(0<e))return 0;var f=c;e=c+e-1;for(var g=0;g<a.length;++g){var k=a.charCodeAt(g);if(55296<=k&&57343>=k){var l=a.charCodeAt(++g);k=65536+((k&1023)<<10)|l&1023}if(127>=k){if(c>=e)break;b[c++]=k}else{if(2047>=k){if(c+1>=e)break;b[c++]=192|k>>6}else{if(65535>=k){if(c+2>=e)break;b[c++]=224|k>>12}else{if(c+3>=e)break;b[c++]=240|k>>18;b[c++]=128|k>>12&63}b[c++]=128|k>>6&63}b[c++]=128|k&63}}b[c]=0;return c-f}\nfunction d(a){for(var b=0,c=0;c<a.length;++c){var e=a.charCodeAt(c);55296<=e&&57343>=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++c)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b}function Oa(a){var b=d(a)+1,c=aa(b);c&&p(a,D,c,b);return c}var Pa,D,u,Ca,Q,Da,Ea;\nfunction Qa(){var a=Fa.buffer;Pa=a;Module.HEAP8=D=new Int8Array(a);Module.HEAP16=Ca=new Int16Array(a);Module.HEAP32=Q=new Int32Array(a);Module.HEAPU8=u=new Uint8Array(a);Module.HEAPU16=new Uint16Array(a);Module.HEAPU32=new Uint32Array(a);Module.HEAPF32=Da=new Float32Array(a);Module.HEAPF64=Ea=new Float64Array(a)}var O,Ra=[],Sa=[],Ta=[];function Ua(){var a=Module.preRun.shift();Ra.unshift(a)}var Va=0,Wa=null,Xa=null;\nfunction Ya(){Va++;Module.monitorRunDependencies&&Module.monitorRunDependencies(Va)}function Za(){Va--;Module.monitorRunDependencies&&Module.monitorRunDependencies(Va);if(0==Va&&(null!==Wa&&(clearInterval(Wa),Wa=null),Xa)){var a=Xa;Xa=null;a()}}Module.preloadedImages={};Module.preloadedAudios={};function P(a){if(Module.onAbort)Module.onAbort(a);M(a);Ga=!0;throw new WebAssembly.RuntimeError(\"abort(\"+a+\"). Build with -s ASSERTIONS=1 for more info.\");}\nfunction $a(){return V.startsWith(\"data:application/octet-stream;base64,\")}var V;V=\"sql-wasm.wasm\";if(!$a()){var ab=V;V=Module.locateFile?Module.locateFile(ab,L):L+ab}function bb(){var a=V;try{if(a==V&&Ba)return new Uint8Array(Ba);if(ua)return ua(a);throw\"both async and sync fetching of the wasm failed\";}catch(b){P(b)}}\nfunction cb(){if(!Ba&&(oa||pa)){if(\"function\"===typeof fetch&&!V.startsWith(\"file://\"))return fetch(V,{credentials:\"same-origin\"}).then(function(a){if(!a.ok)throw\"failed to load wasm binary file at '\"+V+\"'\";return a.arrayBuffer()}).catch(function(){return bb()});if(ta)return new Promise(function(a,b){ta(V,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return bb()})}var T,R;\nfunction gb(a){for(;0<a.length;){var b=a.shift();if(\"function\"==typeof b)b(Module);else{var c=b.pd;\"number\"===typeof c?void 0===b.yb?O.get(c)():O.get(c)(b.yb):c(void 0===b.yb?null:b.yb)}}}function hb(a){return a.replace(/\\b_Z[\\w\\d_]+/g,function(b){return b===b?b:b+\" [\"+b+\"]\"})}\nfunction ib(){function a(k){return(k=k.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?k[1]:\"GMT\"}if(!jb){jb=!0;var b=(new Date).getFullYear(),c=new Date(b,0,1),e=new Date(b,6,1);b=c.getTimezoneOffset();var f=e.getTimezoneOffset(),g=Math.max(b,f);Q[kb()>>2]=60*g;Q[lb()>>2]=Number(b!=f);c=a(c);e=a(e);c=Oa(c);e=Oa(e);f<b?(Q[mb()>>2]=c,Q[mb()+4>>2]=e):(Q[mb()>>2]=e,Q[mb()+4>>2]=c)}}var jb;\nfunction nb(a,b){for(var c=0,e=a.length-1;0<=e;e--){var f=a[e];\".\"===f?a.splice(e,1):\"..\"===f?(a.splice(e,1),c++):c&&(a.splice(e,1),c--)}if(b)for(;c;c--)a.unshift(\"..\");return a}function ob(a){var b=\"/\"===a.charAt(0),c=\"/\"===a.substr(-1);(a=nb(a.split(\"/\").filter(function(e){return!!e}),!b).join(\"/\"))||b||(a=\".\");a&&c&&(a+=\"/\");return(b?\"/\":\"\")+a}\nfunction pb(a){var b=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return\".\";b&&(b=b.substr(0,b.length-1));return a+b}function W(a){if(\"/\"===a)return\"/\";a=ob(a);a=a.replace(/\\/$/,\"\");var b=a.lastIndexOf(\"/\");return-1===b?a:a.substr(b+1)}function qb(a,b){return ob(a+\"/\"+b)}\nfunction rb(){if(\"object\"===typeof crypto&&\"function\"===typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(qa)try{var b=__webpack_require__(/*! crypto */ \"?6b37\");return function(){return b.randomBytes(1)[0]}}catch(c){}return function(){P(\"randomDevice\")}}\nfunction sb(){for(var a=\"\",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:w.cwd();if(\"string\"!==typeof b)throw new TypeError(\"Arguments to path.resolve must be strings\");if(!b)return\"\";a=b+\"/\"+a;b=\"/\"===b.charAt(0)}a=nb(a.split(\"/\").filter(function(e){return!!e}),!b).join(\"/\");return(b?\"/\":\"\")+a||\".\"}\nfunction tb(a,b){function c(k){for(var l=0;l<k.length&&\"\"===k[l];l++);for(var q=k.length-1;0<=q&&\"\"===k[q];q--);return l>q?[]:k.slice(l,q-l+1)}a=sb(a).substr(1);b=sb(b).substr(1);a=c(a.split(\"/\"));b=c(b.split(\"/\"));for(var e=Math.min(a.length,b.length),f=e,g=0;g<e;g++)if(a[g]!==b[g]){f=g;break}e=[];for(g=f;g<a.length;g++)e.push(\"..\");e=e.concat(b.slice(f));return e.join(\"/\")}var ub=[];function vb(a,b){ub[a]={input:[],output:[],gb:b};w.Qb(a,wb)}\nvar wb={open:function(a){var b=ub[a.node.rdev];if(!b)throw new w.ErrnoError(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.gb.flush(a.tty)},flush:function(a){a.tty.gb.flush(a.tty)},read:function(a,b,c,e){if(!a.tty||!a.tty.gb.cc)throw new w.ErrnoError(60);for(var f=0,g=0;g<e;g++){try{var k=a.tty.gb.cc(a.tty)}catch(l){throw new w.ErrnoError(29);}if(void 0===k&&0===f)throw new w.ErrnoError(6);if(null===k||void 0===k)break;f++;b[c+g]=k}f&&(a.node.timestamp=Date.now());return f},write:function(a,b,\nc,e){if(!a.tty||!a.tty.gb.Nb)throw new w.ErrnoError(60);try{for(var f=0;f<e;f++)a.tty.gb.Nb(a.tty,b[c+f])}catch(g){throw new w.ErrnoError(29);}e&&(a.node.timestamp=Date.now());return f}},xb={cc:function(a){if(!a.input.length){var b=null;if(qa){var c=Buffer.alloc(256),e=0;try{e=va.readSync(process.stdin.fd,c,0,256,null)}catch(f){if(f.toString().includes(\"EOF\"))e=0;else throw f;}0<e?b=c.slice(0,e).toString(\"utf-8\"):b=null}else\"undefined\"!=typeof window&&\"function\"==typeof window.prompt?(b=window.prompt(\"Input: \"),\nnull!==b&&(b+=\"\\n\")):\"function\"==typeof readline&&(b=readline(),null!==b&&(b+=\"\\n\"));if(!b)return null;a.input=ba(b,!0)}return a.input.shift()},Nb:function(a,b){null===b||10===b?(xa(Na(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(xa(Na(a.output,0)),a.output=[])}},yb={Nb:function(a,b){null===b||10===b?(M(Na(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(M(Na(a.output,0)),a.output=[])}};\nfunction zb(a){a=65536*Math.ceil(a/65536);var b=Ab(65536,a);if(!b)return 0;u.fill(0,b,b+a);return b}\nvar X={Va:null,mount:function(){return X.createNode(null,\"/\",16895,0)},createNode:function(a,b,c,e){if(w.Rc(c)||w.isFIFO(c))throw new w.ErrnoError(63);X.Va||(X.Va={dir:{node:{getattr:X.node_ops.getattr,setattr:X.node_ops.setattr,lookup:X.node_ops.lookup,mknod:X.node_ops.mknod,rename:X.node_ops.rename,unlink:X.node_ops.unlink,rmdir:X.node_ops.rmdir,readdir:X.node_ops.readdir,symlink:X.node_ops.symlink},stream:{llseek:X.stream_ops.llseek}},file:{node:{getattr:X.node_ops.getattr,setattr:X.node_ops.setattr},\nstream:{llseek:X.stream_ops.llseek,read:X.stream_ops.read,write:X.stream_ops.write,allocate:X.stream_ops.allocate,mmap:X.stream_ops.mmap,msync:X.stream_ops.msync}},link:{node:{getattr:X.node_ops.getattr,setattr:X.node_ops.setattr,readlink:X.node_ops.readlink},stream:{}},Vb:{node:{getattr:X.node_ops.getattr,setattr:X.node_ops.setattr},stream:w.Cc}});c=w.createNode(a,b,c,e);w.isDir(c.mode)?(c.node_ops=X.Va.dir.node,c.stream_ops=X.Va.dir.stream,c.Na={}):w.isFile(c.mode)?(c.node_ops=X.Va.file.node,c.stream_ops=\nX.Va.file.stream,c.Ra=0,c.Na=null):w.fb(c.mode)?(c.node_ops=X.Va.link.node,c.stream_ops=X.Va.link.stream):w.pb(c.mode)&&(c.node_ops=X.Va.Vb.node,c.stream_ops=X.Va.Vb.stream);c.timestamp=Date.now();a&&(a.Na[b]=c,a.timestamp=c.timestamp);return c},qd:function(a){return a.Na?a.Na.subarray?a.Na.subarray(0,a.Ra):new Uint8Array(a.Na):new Uint8Array(0)},Zb:function(a,b){var c=a.Na?a.Na.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.Na,a.Na=new Uint8Array(b),0<a.Ra&&\na.Na.set(c.subarray(0,a.Ra),0))},gd:function(a,b){if(a.Ra!=b)if(0==b)a.Na=null,a.Ra=0;else{var c=a.Na;a.Na=new Uint8Array(b);c&&a.Na.set(c.subarray(0,Math.min(b,a.Ra)));a.Ra=b}},node_ops:{getattr:function(a){var b={};b.dev=w.pb(a.mode)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=a.rdev;w.isDir(a.mode)?b.size=4096:w.isFile(a.mode)?b.size=a.Ra:w.fb(a.mode)?b.size=a.link.length:b.size=0;b.atime=new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.Ac=\n4096;b.blocks=Math.ceil(b.size/b.Ac);return b},setattr:function(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);void 0!==b.size&&X.gd(a,b.size)},lookup:function(){throw w.Db[44];},mknod:function(a,b,c,e){return X.createNode(a,b,c,e)},rename:function(a,b,c){if(w.isDir(a.mode)){try{var e=w.lookupNode(b,c)}catch(g){}if(e)for(var f in e.Na)throw new w.ErrnoError(55);}delete a.parent.Na[a.name];a.parent.timestamp=Date.now();a.name=c;b.Na[c]=a;b.timestamp=a.parent.timestamp;\na.parent=b},unlink:function(a,b){delete a.Na[b];a.timestamp=Date.now()},rmdir:function(a,b){var c=w.lookupNode(a,b),e;for(e in c.Na)throw new w.ErrnoError(55);delete a.Na[b];a.timestamp=Date.now()},readdir:function(a){var b=[\".\",\"..\"],c;for(c in a.Na)a.Na.hasOwnProperty(c)&&b.push(c);return b},symlink:function(a,b,c){a=X.createNode(a,b,41471,0);a.link=c;return a},readlink:function(a){if(!w.fb(a.mode))throw new w.ErrnoError(28);return a.link}},stream_ops:{read:function(a,b,c,e,f){var g=a.node.Na;if(f>=\na.node.Ra)return 0;a=Math.min(a.node.Ra-f,e);if(8<a&&g.subarray)b.set(g.subarray(f,f+a),c);else for(e=0;e<a;e++)b[c+e]=g[f+e];return a},write:function(a,b,c,e,f,g){b.buffer===D.buffer&&(g=!1);if(!e)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.Na||a.Na.subarray)){if(g)return a.Na=b.subarray(c,c+e),a.Ra=e;if(0===a.Ra&&0===f)return a.Na=b.slice(c,c+e),a.Ra=e;if(f+e<=a.Ra)return a.Na.set(b.subarray(c,c+e),f),e}X.Zb(a,f+e);if(a.Na.subarray&&b.subarray)a.Na.set(b.subarray(c,c+e),f);else for(g=\n0;g<e;g++)a.Na[f+g]=b[c+g];a.Ra=Math.max(a.Ra,f+e);return e},llseek:function(a,b,c){1===c?b+=a.position:2===c&&w.isFile(a.node.mode)&&(b+=a.node.Ra);if(0>b)throw new w.ErrnoError(28);return b},allocate:function(a,b,c){X.Zb(a.node,b+c);a.node.Ra=Math.max(a.node.Ra,b+c)},mmap:function(a,b,c,e,f,g){if(0!==b)throw new w.ErrnoError(28);if(!w.isFile(a.node.mode))throw new w.ErrnoError(43);a=a.node.Na;if(g&2||a.buffer!==Pa){if(0<e||e+c<a.length)a.subarray?a=a.subarray(e,e+c):a=Array.prototype.slice.call(a,\ne,e+c);e=!0;c=zb(c);if(!c)throw new w.ErrnoError(48);D.set(a,c)}else e=!1,c=a.byteOffset;return{ed:c,vb:e}},msync:function(a,b,c,e,f){if(!w.isFile(a.node.mode))throw new w.ErrnoError(43);if(f&2)return 0;X.stream_ops.write(a,b,0,e,c,!1);return 0}}};function Bb(a,b,c){var e=\"al \"+a;ta(a,function(f){assert(f,'Loading data file \"'+a+'\" failed (no arrayBuffer).');b(new Uint8Array(f));e&&Za()},function(){if(c)c();else throw'Loading data file \"'+a+'\" failed.';});e&&Ya()}\nvar w={root:null,mb:[],Xb:{},streams:[],Zc:1,Ua:null,Wb:\"/\",Hb:!1,hc:!0,Sa:{},nc:{kc:{qc:1,rc:2}},ErrnoError:null,Db:{},Lc:null,tb:0,lookupPath:function(a,b){a=sb(w.cwd(),a);b=b||{};if(!a)return{path:\"\",node:null};var c={Cb:!0,Pb:0},e;for(e in c)void 0===b[e]&&(b[e]=c[e]);if(8<b.Pb)throw new w.ErrnoError(32);a=nb(a.split(\"/\").filter(function(k){return!!k}),!1);var f=w.root;c=\"/\";for(e=0;e<a.length;e++){var g=e===a.length-1;if(g&&b.parent)break;f=w.lookupNode(f,a[e]);c=qb(c,a[e]);w.ab(f)&&(!g||g&&\nb.Cb)&&(f=f.lb.root);if(!g||b.Ta)for(g=0;w.fb(f.mode);)if(f=w.readlink(c),c=sb(pb(c),f),f=w.lookupPath(c,{Pb:b.Pb}).node,40<g++)throw new w.ErrnoError(32);}return{path:c,node:f}},Ya:function(a){for(var b;;){if(w.isRoot(a))return a=a.mount.jc,b?\"/\"!==a[a.length-1]?a+\"/\"+b:a+b:a;b=b?a.name+\"/\"+b:a.name;a=a.parent}},Gb:function(a,b){for(var c=0,e=0;e<b.length;e++)c=(c<<5)-c+b.charCodeAt(e)|0;return(a+c>>>0)%w.Ua.length},ec:function(a){var b=w.Gb(a.parent.id,a.name);a.cb=w.Ua[b];w.Ua[b]=a},fc:function(a){var b=\nw.Gb(a.parent.id,a.name);if(w.Ua[b]===a)w.Ua[b]=a.cb;else for(b=w.Ua[b];b;){if(b.cb===a){b.cb=a.cb;break}b=b.cb}},lookupNode:function(a,b){var c=w.Vc(a);if(c)throw new w.ErrnoError(c,a);for(c=w.Ua[w.Gb(a.id,b)];c;c=c.cb){var e=c.name;if(c.parent.id===a.id&&e===b)return c}return w.lookup(a,b)},createNode:function(a,b,c,e){a=new w.FSNode(a,b,c,e);w.ec(a);return a},Ab:function(a){w.fc(a)},isRoot:function(a){return a===a.parent},ab:function(a){return!!a.lb},isFile:function(a){return 32768===(a&61440)},\nisDir:function(a){return 16384===(a&61440)},fb:function(a){return 40960===(a&61440)},pb:function(a){return 8192===(a&61440)},Rc:function(a){return 24576===(a&61440)},isFIFO:function(a){return 4096===(a&61440)},isSocket:function(a){return 49152===(a&49152)},Mc:{r:0,\"r+\":2,w:577,\"w+\":578,a:1089,\"a+\":1090},Yc:function(a){var b=w.Mc[a];if(\"undefined\"===typeof b)throw Error(\"Unknown file open mode: \"+a);return b},$b:function(a){var b=[\"r\",\"w\",\"rw\"][a&3];a&512&&(b+=\"w\");return b},Za:function(a,b){if(w.hc)return 0;\nif(!b.includes(\"r\")||a.mode&292){if(b.includes(\"w\")&&!(a.mode&146)||b.includes(\"x\")&&!(a.mode&73))return 2}else return 2;return 0},Vc:function(a){var b=w.Za(a,\"x\");return b?b:a.node_ops.lookup?0:2},Lb:function(a,b){try{return w.lookupNode(a,b),20}catch(c){}return w.Za(a,\"wx\")},qb:function(a,b,c){try{var e=w.lookupNode(a,b)}catch(f){return f.Oa}if(a=w.Za(a,\"wx\"))return a;if(c){if(!w.isDir(e.mode))return 54;if(w.isRoot(e)||w.Ya(e)===w.cwd())return 10}else if(w.isDir(e.mode))return 31;return 0},Wc:function(a,\nb){return a?w.fb(a.mode)?32:w.isDir(a.mode)&&(\"r\"!==w.$b(b)||b&512)?31:w.Za(a,w.$b(b)):44},oc:4096,$c:function(a,b){b=b||w.oc;for(a=a||0;a<=b;a++)if(!w.streams[a])return a;throw new w.ErrnoError(33);},$a:function(a){return w.streams[a]},Jc:function(a,b,c){w.ub||(w.ub=function(){},w.ub.prototype={object:{get:function(){return this.node},set:function(g){this.node=g}}});var e=new w.ub,f;for(f in a)e[f]=a[f];a=e;b=w.$c(b,c);a.fd=b;return w.streams[b]=a},Dc:function(a){w.streams[a]=null},Cc:{open:function(a){a.stream_ops=\nw.Oc(a.node.rdev).stream_ops;a.stream_ops.open&&a.stream_ops.open(a)},llseek:function(){throw new w.ErrnoError(70);}},Kb:function(a){return a>>8},sd:function(a){return a&255},bb:function(a,b){return a<<8|b},Qb:function(a,b){w.Xb[a]={stream_ops:b}},Oc:function(a){return w.Xb[a]},bc:function(a){var b=[];for(a=[a];a.length;){var c=a.pop();b.push(c);a.push.apply(a,c.mb)}return b},mc:function(a,b){function c(k){w.tb--;return b(k)}function e(k){if(k){if(!e.Kc)return e.Kc=!0,c(k)}else++g>=f.length&&c(null)}\n\"function\"===typeof a&&(b=a,a=!1);w.tb++;1<w.tb&&M(\"warning: \"+w.tb+\" FS.syncfs operations in flight at once, probably just doing extra work\");var f=w.bc(w.root.mount),g=0;f.forEach(function(k){if(!k.type.mc)return e(null);k.type.mc(k,a,e)})},mount:function(a,b,c){var e=\"/\"===c,f=!c;if(e&&w.root)throw new w.ErrnoError(10);if(!e&&!f){var g=w.lookupPath(c,{Cb:!1});c=g.path;g=g.node;if(w.ab(g))throw new w.ErrnoError(10);if(!w.isDir(g.mode))throw new w.ErrnoError(54);}b={type:a,vd:b,jc:c,mb:[]};a=a.mount(b);\na.mount=b;b.root=a;e?w.root=a:g&&(g.lb=b,g.mount&&g.mount.mb.push(b));return a},yd:function(a){a=w.lookupPath(a,{Cb:!1});if(!w.ab(a.node))throw new w.ErrnoError(28);a=a.node;var b=a.lb,c=w.bc(b);Object.keys(w.Ua).forEach(function(e){for(e=w.Ua[e];e;){var f=e.cb;c.includes(e.mount)&&w.Ab(e);e=f}});a.lb=null;a.mount.mb.splice(a.mount.mb.indexOf(b),1)},lookup:function(a,b){return a.node_ops.lookup(a,b)},mknod:function(a,b,c){var e=w.lookupPath(a,{parent:!0}).node;a=W(a);if(!a||\".\"===a||\"..\"===a)throw new w.ErrnoError(28);\nvar f=w.Lb(e,a);if(f)throw new w.ErrnoError(f);if(!e.node_ops.mknod)throw new w.ErrnoError(63);return e.node_ops.mknod(e,a,b,c)},create:function(a,b){return w.mknod(a,(void 0!==b?b:438)&4095|32768,0)},mkdir:function(a,b){return w.mknod(a,(void 0!==b?b:511)&1023|16384,0)},td:function(a,b){a=a.split(\"/\");for(var c=\"\",e=0;e<a.length;++e)if(a[e]){c+=\"/\"+a[e];try{w.mkdir(c,b)}catch(f){if(20!=f.Oa)throw f;}}},rb:function(a,b,c){\"undefined\"===typeof c&&(c=b,b=438);return w.mknod(a,b|8192,c)},symlink:function(a,\nb){if(!sb(a))throw new w.ErrnoError(44);var c=w.lookupPath(b,{parent:!0}).node;if(!c)throw new w.ErrnoError(44);b=W(b);var e=w.Lb(c,b);if(e)throw new w.ErrnoError(e);if(!c.node_ops.symlink)throw new w.ErrnoError(63);return c.node_ops.symlink(c,b,a)},rename:function(a,b){var c=pb(a),e=pb(b),f=W(a),g=W(b);var k=w.lookupPath(a,{parent:!0});var l=k.node;k=w.lookupPath(b,{parent:!0});k=k.node;if(!l||!k)throw new w.ErrnoError(44);if(l.mount!==k.mount)throw new w.ErrnoError(75);var q=w.lookupNode(l,f);e=\ntb(a,e);if(\".\"!==e.charAt(0))throw new w.ErrnoError(28);e=tb(b,c);if(\".\"!==e.charAt(0))throw new w.ErrnoError(55);try{var m=w.lookupNode(k,g)}catch(r){}if(q!==m){c=w.isDir(q.mode);if(f=w.qb(l,f,c))throw new w.ErrnoError(f);if(f=m?w.qb(k,g,c):w.Lb(k,g))throw new w.ErrnoError(f);if(!l.node_ops.rename)throw new w.ErrnoError(63);if(w.ab(q)||m&&w.ab(m))throw new w.ErrnoError(10);if(k!==l&&(f=w.Za(l,\"w\")))throw new w.ErrnoError(f);try{w.Sa.willMovePath&&w.Sa.willMovePath(a,b)}catch(r){M(\"FS.trackingDelegate['willMovePath']('\"+\na+\"', '\"+b+\"') threw an exception: \"+r.message)}w.fc(q);try{l.node_ops.rename(q,k,g)}catch(r){throw r;}finally{w.ec(q)}try{if(w.Sa.onMovePath)w.Sa.onMovePath(a,b)}catch(r){M(\"FS.trackingDelegate['onMovePath']('\"+a+\"', '\"+b+\"') threw an exception: \"+r.message)}}},rmdir:function(a){var b=w.lookupPath(a,{parent:!0}).node,c=W(a),e=w.lookupNode(b,c),f=w.qb(b,c,!0);if(f)throw new w.ErrnoError(f);if(!b.node_ops.rmdir)throw new w.ErrnoError(63);if(w.ab(e))throw new w.ErrnoError(10);try{w.Sa.willDeletePath&&\nw.Sa.willDeletePath(a)}catch(g){M(\"FS.trackingDelegate['willDeletePath']('\"+a+\"') threw an exception: \"+g.message)}b.node_ops.rmdir(b,c);w.Ab(e);try{if(w.Sa.onDeletePath)w.Sa.onDeletePath(a)}catch(g){M(\"FS.trackingDelegate['onDeletePath']('\"+a+\"') threw an exception: \"+g.message)}},readdir:function(a){a=w.lookupPath(a,{Ta:!0}).node;if(!a.node_ops.readdir)throw new w.ErrnoError(54);return a.node_ops.readdir(a)},unlink:function(a){var b=w.lookupPath(a,{parent:!0}).node,c=W(a),e=w.lookupNode(b,c),f=\nw.qb(b,c,!1);if(f)throw new w.ErrnoError(f);if(!b.node_ops.unlink)throw new w.ErrnoError(63);if(w.ab(e))throw new w.ErrnoError(10);try{w.Sa.willDeletePath&&w.Sa.willDeletePath(a)}catch(g){M(\"FS.trackingDelegate['willDeletePath']('\"+a+\"') threw an exception: \"+g.message)}b.node_ops.unlink(b,c);w.Ab(e);try{if(w.Sa.onDeletePath)w.Sa.onDeletePath(a)}catch(g){M(\"FS.trackingDelegate['onDeletePath']('\"+a+\"') threw an exception: \"+g.message)}},readlink:function(a){a=w.lookupPath(a).node;if(!a)throw new w.ErrnoError(44);\nif(!a.node_ops.readlink)throw new w.ErrnoError(28);return sb(w.Ya(a.parent),a.node_ops.readlink(a))},stat:function(a,b){a=w.lookupPath(a,{Ta:!b}).node;if(!a)throw new w.ErrnoError(44);if(!a.node_ops.getattr)throw new w.ErrnoError(63);return a.node_ops.getattr(a)},lstat:function(a){return w.stat(a,!0)},chmod:function(a,b,c){a=\"string\"===typeof a?w.lookupPath(a,{Ta:!c}).node:a;if(!a.node_ops.setattr)throw new w.ErrnoError(63);a.node_ops.setattr(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})},lchmod:function(a,\nb){w.chmod(a,b,!0)},fchmod:function(a,b){a=w.$a(a);if(!a)throw new w.ErrnoError(8);w.chmod(a.node,b)},chown:function(a,b,c,e){a=\"string\"===typeof a?w.lookupPath(a,{Ta:!e}).node:a;if(!a.node_ops.setattr)throw new w.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown:function(a,b,c){w.chown(a,b,c,!0)},fchown:function(a,b,c){a=w.$a(a);if(!a)throw new w.ErrnoError(8);w.chown(a.node,b,c)},truncate:function(a,b){if(0>b)throw new w.ErrnoError(28);a=\"string\"===typeof a?w.lookupPath(a,{Ta:!0}).node:\na;if(!a.node_ops.setattr)throw new w.ErrnoError(63);if(w.isDir(a.mode))throw new w.ErrnoError(31);if(!w.isFile(a.mode))throw new w.ErrnoError(28);var c=w.Za(a,\"w\");if(c)throw new w.ErrnoError(c);a.node_ops.setattr(a,{size:b,timestamp:Date.now()})},Nc:function(a,b){a=w.$a(a);if(!a)throw new w.ErrnoError(8);if(0===(a.flags&2097155))throw new w.ErrnoError(28);w.truncate(a.node,b)},kd:function(a,b,c){a=w.lookupPath(a,{Ta:!0}).node;a.node_ops.setattr(a,{timestamp:Math.max(b,c)})},open:function(a,b,c,e,\nf){if(\"\"===a)throw new w.ErrnoError(44);b=\"string\"===typeof b?w.Yc(b):b;c=b&64?(\"undefined\"===typeof c?438:c)&4095|32768:0;if(\"object\"===typeof a)var g=a;else{a=ob(a);try{g=w.lookupPath(a,{Ta:!(b&131072)}).node}catch(l){}}var k=!1;if(b&64)if(g){if(b&128)throw new w.ErrnoError(20);}else g=w.mknod(a,c,0),k=!0;if(!g)throw new w.ErrnoError(44);w.pb(g.mode)&&(b&=-513);if(b&65536&&!w.isDir(g.mode))throw new w.ErrnoError(54);if(!k&&(c=w.Wc(g,b)))throw new w.ErrnoError(c);b&512&&w.truncate(g,0);b&=-131713;\ne=w.Jc({node:g,path:w.Ya(g),flags:b,seekable:!0,position:0,stream_ops:g.stream_ops,jd:[],error:!1},e,f);e.stream_ops.open&&e.stream_ops.open(e);!Module.logReadFiles||b&1||(w.Ob||(w.Ob={}),a in w.Ob||(w.Ob[a]=1,M(\"FS.trackingDelegate error on read file: \"+a)));try{w.Sa.onOpenFile&&(f=0,1!==(b&2097155)&&(f|=w.nc.kc.qc),0!==(b&2097155)&&(f|=w.nc.kc.rc),w.Sa.onOpenFile(a,f))}catch(l){M(\"FS.trackingDelegate['onOpenFile']('\"+a+\"', flags) threw an exception: \"+l.message)}return e},close:function(a){if(w.kb(a))throw new w.ErrnoError(8);\na.Fb&&(a.Fb=null);try{a.stream_ops.close&&a.stream_ops.close(a)}catch(b){throw b;}finally{w.Dc(a.fd)}a.fd=null},kb:function(a){return null===a.fd},llseek:function(a,b,c){if(w.kb(a))throw new w.ErrnoError(8);if(!a.seekable||!a.stream_ops.llseek)throw new w.ErrnoError(70);if(0!=c&&1!=c&&2!=c)throw new w.ErrnoError(28);a.position=a.stream_ops.llseek(a,b,c);a.jd=[];return a.position},read:function(a,b,c,e,f){if(0>e||0>f)throw new w.ErrnoError(28);if(w.kb(a))throw new w.ErrnoError(8);if(1===(a.flags&2097155))throw new w.ErrnoError(8);\nif(w.isDir(a.node.mode))throw new w.ErrnoError(31);if(!a.stream_ops.read)throw new w.ErrnoError(28);var g=\"undefined\"!==typeof f;if(!g)f=a.position;else if(!a.seekable)throw new w.ErrnoError(70);b=a.stream_ops.read(a,b,c,e,f);g||(a.position+=b);return b},write:function(a,b,c,e,f,g){if(0>e||0>f)throw new w.ErrnoError(28);if(w.kb(a))throw new w.ErrnoError(8);if(0===(a.flags&2097155))throw new w.ErrnoError(8);if(w.isDir(a.node.mode))throw new w.ErrnoError(31);if(!a.stream_ops.write)throw new w.ErrnoError(28);\na.seekable&&a.flags&1024&&w.llseek(a,0,2);var k=\"undefined\"!==typeof f;if(!k)f=a.position;else if(!a.seekable)throw new w.ErrnoError(70);b=a.stream_ops.write(a,b,c,e,f,g);k||(a.position+=b);try{if(a.path&&w.Sa.onWriteToFile)w.Sa.onWriteToFile(a.path)}catch(l){M(\"FS.trackingDelegate['onWriteToFile']('\"+a.path+\"') threw an exception: \"+l.message)}return b},allocate:function(a,b,c){if(w.kb(a))throw new w.ErrnoError(8);if(0>b||0>=c)throw new w.ErrnoError(28);if(0===(a.flags&2097155))throw new w.ErrnoError(8);\nif(!w.isFile(a.node.mode)&&!w.isDir(a.node.mode))throw new w.ErrnoError(43);if(!a.stream_ops.allocate)throw new w.ErrnoError(138);a.stream_ops.allocate(a,b,c)},mmap:function(a,b,c,e,f,g){if(0!==(f&2)&&0===(g&2)&&2!==(a.flags&2097155))throw new w.ErrnoError(2);if(1===(a.flags&2097155))throw new w.ErrnoError(2);if(!a.stream_ops.mmap)throw new w.ErrnoError(43);return a.stream_ops.mmap(a,b,c,e,f,g)},msync:function(a,b,c,e,f){return a&&a.stream_ops.msync?a.stream_ops.msync(a,b,c,e,f):0},ud:function(){return 0},\nic:function(a,b,c){if(!a.stream_ops.ic)throw new w.ErrnoError(59);return a.stream_ops.ic(a,b,c)},readFile:function(a,b){b=b||{};b.flags=b.flags||0;b.encoding=b.encoding||\"binary\";if(\"utf8\"!==b.encoding&&\"binary\"!==b.encoding)throw Error('Invalid encoding type \"'+b.encoding+'\"');var c,e=w.open(a,b.flags);a=w.stat(a).size;var f=new Uint8Array(a);w.read(e,f,0,a,0);\"utf8\"===b.encoding?c=Na(f,0):\"binary\"===b.encoding&&(c=f);w.close(e);return c},writeFile:function(a,b,c){c=c||{};c.flags=c.flags||577;a=\nw.open(a,c.flags,c.mode);if(\"string\"===typeof b){var e=new Uint8Array(d(b)+1);b=p(b,e,0,e.length);w.write(a,e,0,b,void 0,c.Bc)}else if(ArrayBuffer.isView(b))w.write(a,b,0,b.byteLength,void 0,c.Bc);else throw Error(\"Unsupported data type\");w.close(a)},cwd:function(){return w.Wb},chdir:function(a){a=w.lookupPath(a,{Ta:!0});if(null===a.node)throw new w.ErrnoError(44);if(!w.isDir(a.node.mode))throw new w.ErrnoError(54);var b=w.Za(a.node,\"x\");if(b)throw new w.ErrnoError(b);w.Wb=a.path},Fc:function(){w.mkdir(\"/tmp\");\nw.mkdir(\"/home\");w.mkdir(\"/home/web_user\")},Ec:function(){w.mkdir(\"/dev\");w.Qb(w.bb(1,3),{read:function(){return 0},write:function(b,c,e,f){return f}});w.rb(\"/dev/null\",w.bb(1,3));vb(w.bb(5,0),xb);vb(w.bb(6,0),yb);w.rb(\"/dev/tty\",w.bb(5,0));w.rb(\"/dev/tty1\",w.bb(6,0));var a=rb();w.Wa(\"/dev\",\"random\",a);w.Wa(\"/dev\",\"urandom\",a);w.mkdir(\"/dev/shm\");w.mkdir(\"/dev/shm/tmp\")},Hc:function(){w.mkdir(\"/proc\");var a=w.mkdir(\"/proc/self\");w.mkdir(\"/proc/self/fd\");w.mount({mount:function(){var b=w.createNode(a,\n\"fd\",16895,73);b.node_ops={lookup:function(c,e){var f=w.$a(+e);if(!f)throw new w.ErrnoError(8);c={parent:null,mount:{jc:\"fake\"},node_ops:{readlink:function(){return f.path}}};return c.parent=c}};return b}},{},\"/proc/self/fd\")},Ic:function(){Module.stdin?w.Wa(\"/dev\",\"stdin\",Module.stdin):w.symlink(\"/dev/tty\",\"/dev/stdin\");Module.stdout?w.Wa(\"/dev\",\"stdout\",null,Module.stdout):w.symlink(\"/dev/tty\",\"/dev/stdout\");Module.stderr?w.Wa(\"/dev\",\"stderr\",null,Module.stderr):w.symlink(\"/dev/tty1\",\"/dev/stderr\");\nw.open(\"/dev/stdin\",0);w.open(\"/dev/stdout\",1);w.open(\"/dev/stderr\",1)},Yb:function(){w.ErrnoError||(w.ErrnoError=function(a,b){this.node=b;this.hd=function(c){this.Oa=c};this.hd(a);this.message=\"FS error\"},w.ErrnoError.prototype=Error(),w.ErrnoError.prototype.constructor=w.ErrnoError,[44].forEach(function(a){w.Db[a]=new w.ErrnoError(a);w.Db[a].stack=\"<generic error, no stack>\"}))},lc:function(){w.Yb();w.Ua=Array(4096);w.mount(X,{},\"/\");w.Fc();w.Ec();w.Hc();w.Lc={MEMFS:X}},jb:function(a,b,c){w.jb.Hb=\n!0;w.Yb();Module.stdin=a||Module.stdin;Module.stdout=b||Module.stdout;Module.stderr=c||Module.stderr;w.Ic()},wd:function(){w.jb.Hb=!1;var a=Module._fflush;a&&a(0);for(a=0;a<w.streams.length;a++){var b=w.streams[a];b&&w.close(b)}},Eb:function(a,b){var c=0;a&&(c|=365);b&&(c|=146);return c},od:function(a,b){a=w.xb(a,b);return a.exists?a.object:null},xb:function(a,b){try{var c=w.lookupPath(a,{Ta:!b});a=c.path}catch(f){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,ad:!1,cd:null,bd:null};\ntry{c=w.lookupPath(a,{parent:!0}),e.ad=!0,e.cd=c.path,e.bd=c.node,e.name=W(a),c=w.lookupPath(a,{Ta:!b}),e.exists=!0,e.path=c.path,e.object=c.node,e.name=c.node.name,e.isRoot=\"/\"===c.path}catch(f){e.error=f.Oa}return e},md:function(a,b){a=\"string\"===typeof a?a:w.Ya(a);for(b=b.split(\"/\").reverse();b.length;){var c=b.pop();if(c){var e=qb(a,c);try{w.mkdir(e)}catch(f){}a=e}}return e},Gc:function(a,b,c,e,f){a=qb(\"string\"===typeof a?a:w.Ya(a),b);return w.create(a,w.Eb(e,f))},zb:function(a,b,c,e,f,g){a=b?\nqb(\"string\"===typeof a?a:w.Ya(a),b):a;e=w.Eb(e,f);f=w.create(a,e);if(c){if(\"string\"===typeof c){a=Array(c.length);b=0;for(var k=c.length;b<k;++b)a[b]=c.charCodeAt(b);c=a}w.chmod(f,e|146);a=w.open(f,577);w.write(a,c,0,c.length,0,g);w.close(a);w.chmod(f,e)}return f},Wa:function(a,b,c,e){a=qb(\"string\"===typeof a?a:w.Ya(a),b);b=w.Eb(!!c,!!e);w.Wa.Kb||(w.Wa.Kb=64);var f=w.bb(w.Wa.Kb++,0);w.Qb(f,{open:function(g){g.seekable=!1},close:function(){e&&e.buffer&&e.buffer.length&&e(10)},read:function(g,k,l,q){for(var m=\n0,r=0;r<q;r++){try{var x=c()}catch(B){throw new w.ErrnoError(29);}if(void 0===x&&0===m)throw new w.ErrnoError(6);if(null===x||void 0===x)break;m++;k[l+r]=x}m&&(g.node.timestamp=Date.now());return m},write:function(g,k,l,q){for(var m=0;m<q;m++)try{e(k[l+m])}catch(r){throw new w.ErrnoError(29);}q&&(g.node.timestamp=Date.now());return m}});return w.rb(a,b,f)},ac:function(a){if(a.Ib||a.Sc||a.link||a.Na)return!0;if(\"undefined\"!==typeof XMLHttpRequest)throw Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");\nif(sa)try{a.Na=ba(sa(a.url),!0),a.Ra=a.Na.length}catch(b){throw new w.ErrnoError(29);}else throw Error(\"Cannot load without read() or XMLHttpRequest.\");},ld:function(a,b,c,e,f){function g(){this.Jb=!1;this.ob=[]}g.prototype.get=function(m){if(!(m>this.length-1||0>m)){var r=m%this.chunkSize;return this.dc(m/this.chunkSize|0)[r]}};g.prototype.pc=function(m){this.dc=m};g.prototype.Ub=function(){var m=new XMLHttpRequest;m.open(\"HEAD\",c,!1);m.send(null);if(!(200<=m.status&&300>m.status||304===m.status))throw Error(\"Couldn't load \"+\nc+\". Status: \"+m.status);var r=Number(m.getResponseHeader(\"Content-length\")),x,B=(x=m.getResponseHeader(\"Accept-Ranges\"))&&\"bytes\"===x;m=(x=m.getResponseHeader(\"Content-Encoding\"))&&\"gzip\"===x;var E=1048576;B||(E=r);var A=this;A.pc(function(J){var Z=J*E,U=(J+1)*E-1;U=Math.min(U,r-1);if(\"undefined\"===typeof A.ob[J]){var Ka=A.ob;if(Z>U)throw Error(\"invalid range (\"+Z+\", \"+U+\") or no bytes requested!\");if(U>r-1)throw Error(\"only \"+r+\" bytes available! programmer error!\");var G=new XMLHttpRequest;G.open(\"GET\",\nc,!1);r!==E&&G.setRequestHeader(\"Range\",\"bytes=\"+Z+\"-\"+U);\"undefined\"!=typeof Uint8Array&&(G.responseType=\"arraybuffer\");G.overrideMimeType&&G.overrideMimeType(\"text/plain; charset=x-user-defined\");G.send(null);if(!(200<=G.status&&300>G.status||304===G.status))throw Error(\"Couldn't load \"+c+\". Status: \"+G.status);Z=void 0!==G.response?new Uint8Array(G.response||[]):ba(G.responseText||\"\",!0);Ka[J]=Z}if(\"undefined\"===typeof A.ob[J])throw Error(\"doXHR failed!\");return A.ob[J]});if(m||!r)E=r=1,E=r=this.dc(0).length,\nxa(\"LazyFiles on gzip forces download of the whole file when length is accessed\");this.tc=r;this.sc=E;this.Jb=!0};if(\"undefined\"!==typeof XMLHttpRequest){if(!pa)throw\"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc\";var k=new g;Object.defineProperties(k,{length:{get:function(){this.Jb||this.Ub();return this.tc}},chunkSize:{get:function(){this.Jb||this.Ub();return this.sc}}});k={Ib:!1,Na:k}}else k={Ib:!1,url:c};var l=w.Gc(a,b,k,e,\nf);k.Na?l.Na=k.Na:k.url&&(l.Na=null,l.url=k.url);Object.defineProperties(l,{Ra:{get:function(){return this.Na.length}}});var q={};Object.keys(l.stream_ops).forEach(function(m){var r=l.stream_ops[m];q[m]=function(){w.ac(l);return r.apply(null,arguments)}});q.read=function(m,r,x,B,E){w.ac(l);m=m.node.Na;if(E>=m.length)return 0;B=Math.min(m.length-E,B);if(m.slice)for(var A=0;A<B;A++)r[x+A]=m[E+A];else for(A=0;A<B;A++)r[x+A]=m.get(E+A);return B};l.stream_ops=q;return l},nd:function(a,b,c,e,f,g,k,l,q,\nm){function r(B){function E(J){m&&m();l||w.zb(a,b,J,e,f,q);g&&g();Za()}var A=!1;Module.preloadPlugins.forEach(function(J){!A&&J.canHandle(x)&&(J.handle(B,x,E,function(){k&&k();Za()}),A=!0)});A||E(B)}Zb.jb();var x=b?sb(qb(a,b)):a;Ya();\"string\"==typeof c?Bb(c,function(B){r(B)},k):r(c)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},Rb:function(){return\"EM_FS_\"+window.location.pathname},Sb:20,ib:\"FILE_DATA\",xd:function(a,b,c){b=b||function(){};\nc=c||function(){};var e=w.indexedDB();try{var f=e.open(w.Rb(),w.Sb)}catch(g){return c(g)}f.onupgradeneeded=function(){xa(\"creating db\");f.result.createObjectStore(w.ib)};f.onsuccess=function(){var g=f.result.transaction([w.ib],\"readwrite\"),k=g.objectStore(w.ib),l=0,q=0,m=a.length;a.forEach(function(r){r=k.put(w.xb(r).object.Na,r);r.onsuccess=function(){l++;l+q==m&&(0==q?b():c())};r.onerror=function(){q++;l+q==m&&(0==q?b():c())}});g.onerror=c};f.onerror=c},rd:function(a,b,c){b=b||function(){};c=c||\nfunction(){};var e=w.indexedDB();try{var f=e.open(w.Rb(),w.Sb)}catch(g){return c(g)}f.onupgradeneeded=c;f.onsuccess=function(){var g=f.result;try{var k=g.transaction([w.ib],\"readonly\")}catch(x){c(x);return}var l=k.objectStore(w.ib),q=0,m=0,r=a.length;a.forEach(function(x){var B=l.get(x);B.onsuccess=function(){w.xb(x).exists&&w.unlink(x);w.zb(pb(x),W(x),B.result,!0,!0,!0);q++;q+m==r&&(0==m?b():c())};B.onerror=function(){m++;q+m==r&&(0==m?b():c())}});k.onerror=c};f.onerror=c}},$b={};\nfunction ac(a,b,c){try{var e=a(b)}catch(f){if(f&&f.node&&ob(b)!==ob(w.Ya(f.node)))return-54;throw f;}Q[c>>2]=e.dev;Q[c+4>>2]=0;Q[c+8>>2]=e.ino;Q[c+12>>2]=e.mode;Q[c+16>>2]=e.nlink;Q[c+20>>2]=e.uid;Q[c+24>>2]=e.gid;Q[c+28>>2]=e.rdev;Q[c+32>>2]=0;R=[e.size>>>0,(T=e.size,1<=+Math.abs(T)?0<T?(Math.min(+Math.floor(T/4294967296),4294967295)|0)>>>0:~~+Math.ceil((T-+(~~T>>>0))/4294967296)>>>0:0)];Q[c+40>>2]=R[0];Q[c+44>>2]=R[1];Q[c+48>>2]=4096;Q[c+52>>2]=e.blocks;Q[c+56>>2]=e.atime.getTime()/1E3|0;Q[c+60>>\n2]=0;Q[c+64>>2]=e.mtime.getTime()/1E3|0;Q[c+68>>2]=0;Q[c+72>>2]=e.ctime.getTime()/1E3|0;Q[c+76>>2]=0;R=[e.ino>>>0,(T=e.ino,1<=+Math.abs(T)?0<T?(Math.min(+Math.floor(T/4294967296),4294967295)|0)>>>0:~~+Math.ceil((T-+(~~T>>>0))/4294967296)>>>0:0)];Q[c+80>>2]=R[0];Q[c+84>>2]=R[1];return 0}var bc=void 0;function cc(){bc+=4;return Q[bc-4>>2]}function Y(a){a=w.$a(a);if(!a)throw new w.ErrnoError(8);return a}var dc;dc=qa?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:function(){return performance.now()};\nvar ec={};function fc(){if(!gc){var a={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"===typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:na||\"./this.program\"},b;for(b in ec)void 0===ec[b]?delete a[b]:a[b]=ec[b];var c=[];for(b in a)c.push(b+\"=\"+a[b]);gc=c}return gc}var gc;\nfunction hc(a,b,c,e){a||(a=this);this.parent=a;this.mount=a.mount;this.lb=null;this.id=w.Zc++;this.name=b;this.mode=c;this.node_ops={};this.stream_ops={};this.rdev=e}Object.defineProperties(hc.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},Sc:{get:function(){return w.isDir(this.mode)}},Ib:{get:function(){return w.pb(this.mode)}}});\nw.FSNode=hc;w.lc();var Zb;function ba(a,b){var c=Array(d(a)+1);a=p(a,c,0,c.length);b&&(c.length=a);return c}\nvar jc={a:function(a,b,c,e){P(\"Assertion failed: \"+F(a)+\", at: \"+[b?F(b):\"unknown filename\",c,e?F(e):\"unknown function\"])},u:function(a,b){ib();a=new Date(1E3*Q[a>>2]);Q[b>>2]=a.getSeconds();Q[b+4>>2]=a.getMinutes();Q[b+8>>2]=a.getHours();Q[b+12>>2]=a.getDate();Q[b+16>>2]=a.getMonth();Q[b+20>>2]=a.getFullYear()-1900;Q[b+24>>2]=a.getDay();var c=new Date(a.getFullYear(),0,1);Q[b+28>>2]=(a.getTime()-c.getTime())/864E5|0;Q[b+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();\nc=c.getTimezoneOffset();a=(e!=c&&a.getTimezoneOffset()==Math.min(c,e))|0;Q[b+32>>2]=a;a=Q[mb()+(a?4:0)>>2];Q[b+40>>2]=a;return b},m:function(a,b){try{a=F(a);if(b&-8)var c=-28;else{var e;(e=w.lookupPath(a,{Ta:!0}).node)?(a=\"\",b&4&&(a+=\"r\"),b&2&&(a+=\"w\"),b&1&&(a+=\"x\"),c=a&&w.Za(e,a)?-2:0):c=-44}return c}catch(f){return\"undefined\"!==typeof w&&f instanceof w.ErrnoError||P(f),-f.Oa}},A:function(a,b){try{return a=F(a),w.chmod(a,b),0}catch(c){return\"undefined\"!==typeof w&&c instanceof w.ErrnoError||P(c),\n-c.Oa}},H:function(a,b,c){try{return a=F(a),w.chown(a,b,c),0}catch(e){return\"undefined\"!==typeof w&&e instanceof w.ErrnoError||P(e),-e.Oa}},B:function(a,b){try{return w.fchmod(a,b),0}catch(c){return\"undefined\"!==typeof w&&c instanceof w.ErrnoError||P(c),-c.Oa}},I:function(a,b,c){try{return w.fchown(a,b,c),0}catch(e){return\"undefined\"!==typeof w&&e instanceof w.ErrnoError||P(e),-e.Oa}},b:function(a,b,c){bc=c;try{var e=Y(a);switch(b){case 0:var f=cc();return 0>f?-28:w.open(e.path,e.flags,0,f).fd;case 1:case 2:return 0;\ncase 3:return e.flags;case 4:return f=cc(),e.flags|=f,0;case 12:return f=cc(),Ca[f+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return Q[ic()>>2]=28,-1;default:return-28}}catch(g){return\"undefined\"!==typeof w&&g instanceof w.ErrnoError||P(g),-g.Oa}},E:function(a,b){try{var c=Y(a);return ac(w.stat,c.path,b)}catch(e){return\"undefined\"!==typeof w&&e instanceof w.ErrnoError||P(e),-e.Oa}},n:function(a,b,c){try{return w.Nc(a,c),0}catch(e){return\"undefined\"!==typeof w&&e instanceof\nw.ErrnoError||P(e),-e.Oa}},l:function(a,b){try{if(0===b)return-28;var c=w.cwd();if(b<d(c)+1)return-68;p(c,u,a,b);return a}catch(e){return\"undefined\"!==typeof w&&e instanceof w.ErrnoError||P(e),-e.Oa}},G:function(){return 0},d:function(){return 42},z:function(a,b){try{return a=F(a),ac(w.lstat,a,b)}catch(c){return\"undefined\"!==typeof w&&c instanceof w.ErrnoError||P(c),-c.Oa}},C:function(a,b){try{return a=F(a),a=ob(a),\"/\"===a[a.length-1]&&(a=a.substr(0,a.length-1)),w.mkdir(a,b,0),0}catch(c){return\"undefined\"!==\ntypeof w&&c instanceof w.ErrnoError||P(c),-c.Oa}},y:function(a,b,c,e,f,g){try{a:{g<<=12;var k=!1;if(0!==(e&16)&&0!==a%65536)var l=-28;else{if(0!==(e&32)){var q=zb(b);if(!q){l=-48;break a}k=!0}else{var m=w.$a(f);if(!m){l=-8;break a}var r=w.mmap(m,a,b,g,c,e);q=r.ed;k=r.vb}$b[q]={Uc:q,Tc:b,vb:k,fd:f,dd:c,flags:e,offset:g};l=q}}return l}catch(x){return\"undefined\"!==typeof w&&x instanceof w.ErrnoError||P(x),-x.Oa}},x:function(a,b){try{var c=$b[a];if(0!==b&&c){if(b===c.Tc){var e=w.$a(c.fd);if(e&&c.dd&2){var f=\nc.flags,g=c.offset,k=u.slice(a,a+b);w.msync(e,k,g,b,f)}$b[a]=null;c.vb&&da(c.Uc)}var l=0}else l=-28;return l}catch(q){return\"undefined\"!==typeof w&&q instanceof w.ErrnoError||P(q),-q.Oa}},w:function(a,b,c){bc=c;try{var e=F(a),f=c?cc():0;return w.open(e,b,f).fd}catch(g){return\"undefined\"!==typeof w&&g instanceof w.ErrnoError||P(g),-g.Oa}},J:function(a,b,c){try{a=F(a);if(0>=c)var e=-28;else{var f=w.readlink(a),g=Math.min(c,d(f)),k=D[b+g];p(f,u,b,c+1);D[b+g]=k;e=g}return e}catch(l){return\"undefined\"!==\ntypeof w&&l instanceof w.ErrnoError||P(l),-l.Oa}},F:function(a){try{return a=F(a),w.rmdir(a),0}catch(b){return\"undefined\"!==typeof w&&b instanceof w.ErrnoError||P(b),-b.Oa}},e:function(a,b){try{return a=F(a),ac(w.stat,a,b)}catch(c){return\"undefined\"!==typeof w&&c instanceof w.ErrnoError||P(c),-c.Oa}},i:function(a){try{return a=F(a),w.unlink(a),0}catch(b){return\"undefined\"!==typeof w&&b instanceof w.ErrnoError||P(b),-b.Oa}},v:function(){return 2147483648},p:function(a,b,c){u.copyWithin(a,b,b+c)},c:function(a){var b=\nu.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);e=Math.max(a,e);0<e%65536&&(e+=65536-e%65536);a:{try{Fa.grow(Math.min(2147483648,e)-Pa.byteLength+65535>>>16);Qa();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},t:function(a){for(var b=dc();dc()-b<a;);},r:function(a,b){try{var c=0;fc().forEach(function(e,f){var g=b+c;f=Q[a+4*f>>2]=g;for(g=0;g<e.length;++g)D[f++>>0]=e.charCodeAt(g);D[f>>0]=0;c+=e.length+1});return 0}catch(e){return\"undefined\"!==\ntypeof w&&e instanceof w.ErrnoError||P(e),e.Oa}},s:function(a,b){try{var c=fc();Q[a>>2]=c.length;var e=0;c.forEach(function(f){e+=f.length+1});Q[b>>2]=e;return 0}catch(f){return\"undefined\"!==typeof w&&f instanceof w.ErrnoError||P(f),f.Oa}},f:function(a){try{var b=Y(a);w.close(b);return 0}catch(c){return\"undefined\"!==typeof w&&c instanceof w.ErrnoError||P(c),c.Oa}},q:function(a,b){try{var c=Y(a),e=c.tty?2:w.isDir(c.mode)?3:w.fb(c.mode)?7:4;D[b>>0]=e;return 0}catch(f){return\"undefined\"!==typeof w&&\nf instanceof w.ErrnoError||P(f),f.Oa}},j:function(a,b,c,e){try{a:{for(var f=Y(a),g=a=0;g<c;g++){var k=Q[b+(8*g+4)>>2],l=w.read(f,D,Q[b+8*g>>2],k,void 0);if(0>l){var q=-1;break a}a+=l;if(l<k)break}q=a}Q[e>>2]=q;return 0}catch(m){return\"undefined\"!==typeof w&&m instanceof w.ErrnoError||P(m),m.Oa}},o:function(a,b,c,e,f){try{var g=Y(a);a=4294967296*c+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;w.llseek(g,a,e);R=[g.position>>>0,(T=g.position,1<=+Math.abs(T)?0<T?(Math.min(+Math.floor(T/\n4294967296),4294967295)|0)>>>0:~~+Math.ceil((T-+(~~T>>>0))/4294967296)>>>0:0)];Q[f>>2]=R[0];Q[f+4>>2]=R[1];g.Fb&&0===a&&0===e&&(g.Fb=null);return 0}catch(k){return\"undefined\"!==typeof w&&k instanceof w.ErrnoError||P(k),k.Oa}},k:function(a){try{var b=Y(a);return b.stream_ops&&b.stream_ops.fsync?-b.stream_ops.fsync(b):0}catch(c){return\"undefined\"!==typeof w&&c instanceof w.ErrnoError||P(c),c.Oa}},g:function(a,b,c,e){try{a:{for(var f=Y(a),g=a=0;g<c;g++){var k=w.write(f,D,Q[b+8*g>>2],Q[b+(8*g+4)>>2],\nvoid 0);if(0>k){var l=-1;break a}a+=k}l=a}Q[e>>2]=l;return 0}catch(q){return\"undefined\"!==typeof w&&q instanceof w.ErrnoError||P(q),q.Oa}},h:function(a){var b=Date.now();Q[a>>2]=b/1E3|0;Q[a+4>>2]=b%1E3*1E3|0;return 0},K:function(a){var b=Date.now()/1E3|0;a&&(Q[a>>2]=b);return b},D:function(a,b){if(b){var c=b+8;b=1E3*Q[c>>2];b+=Q[c+4>>2]/1E3}else b=Date.now();a=F(a);try{w.kd(a,b,b);var e=0}catch(f){if(!(f instanceof w.ErrnoError)){b:{e=Error();if(!e.stack){try{throw Error();}catch(g){e=g}if(!e.stack){e=\n\"(no stack trace available)\";break b}}e=e.stack.toString()}Module.extraStackTrace&&(e+=\"\\n\"+Module.extraStackTrace());e=hb(e);throw f+\" : \"+e;}e=f.Oa;Q[ic()>>2]=e;e=-1}return e}};\n(function(){function a(f){Module.asm=f.exports;Fa=Module.asm.L;Qa();O=Module.asm.Da;Sa.unshift(Module.asm.M);Za()}function b(f){a(f.instance)}function c(f){return cb().then(function(g){return WebAssembly.instantiate(g,e)}).then(f,function(g){M(\"failed to asynchronously prepare wasm: \"+g);P(g)})}var e={a:jc};Ya();if(Module.instantiateWasm)try{return Module.instantiateWasm(e,a)}catch(f){return M(\"Module.instantiateWasm callback failed with error: \"+f),!1}(function(){return Ba||\"function\"!==typeof WebAssembly.instantiateStreaming||\n$a()||V.startsWith(\"file://\")||\"function\"!==typeof fetch?c(b):fetch(V,{credentials:\"same-origin\"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(b,function(g){M(\"wasm streaming compile failed: \"+g);M(\"falling back to ArrayBuffer instantiation\");return c(b)})})})();return{}})();Module.___wasm_call_ctors=function(){return(Module.___wasm_call_ctors=Module.asm.M).apply(null,arguments)};Module._sqlite3_vfs_find=function(){return(Module._sqlite3_vfs_find=Module.asm.N).apply(null,arguments)};\nModule._sqlite3_free=function(){return(Module._sqlite3_free=Module.asm.O).apply(null,arguments)};var ic=Module.___errno_location=function(){return(ic=Module.___errno_location=Module.asm.P).apply(null,arguments)};Module._sqlite3_finalize=function(){return(Module._sqlite3_finalize=Module.asm.Q).apply(null,arguments)};Module._sqlite3_reset=function(){return(Module._sqlite3_reset=Module.asm.R).apply(null,arguments)};\nModule._sqlite3_clear_bindings=function(){return(Module._sqlite3_clear_bindings=Module.asm.S).apply(null,arguments)};Module._sqlite3_value_blob=function(){return(Module._sqlite3_value_blob=Module.asm.T).apply(null,arguments)};Module._sqlite3_value_text=function(){return(Module._sqlite3_value_text=Module.asm.U).apply(null,arguments)};Module._sqlite3_value_bytes=function(){return(Module._sqlite3_value_bytes=Module.asm.V).apply(null,arguments)};\nModule._sqlite3_value_double=function(){return(Module._sqlite3_value_double=Module.asm.W).apply(null,arguments)};Module._sqlite3_value_int=function(){return(Module._sqlite3_value_int=Module.asm.X).apply(null,arguments)};Module._sqlite3_value_type=function(){return(Module._sqlite3_value_type=Module.asm.Y).apply(null,arguments)};Module._sqlite3_result_blob=function(){return(Module._sqlite3_result_blob=Module.asm.Z).apply(null,arguments)};\nModule._sqlite3_result_double=function(){return(Module._sqlite3_result_double=Module.asm._).apply(null,arguments)};Module._sqlite3_result_error=function(){return(Module._sqlite3_result_error=Module.asm.$).apply(null,arguments)};Module._sqlite3_result_int=function(){return(Module._sqlite3_result_int=Module.asm.aa).apply(null,arguments)};Module._sqlite3_result_int64=function(){return(Module._sqlite3_result_int64=Module.asm.ba).apply(null,arguments)};\nModule._sqlite3_result_null=function(){return(Module._sqlite3_result_null=Module.asm.ca).apply(null,arguments)};Module._sqlite3_result_text=function(){return(Module._sqlite3_result_text=Module.asm.da).apply(null,arguments)};Module._sqlite3_step=function(){return(Module._sqlite3_step=Module.asm.ea).apply(null,arguments)};Module._sqlite3_column_count=function(){return(Module._sqlite3_column_count=Module.asm.fa).apply(null,arguments)};\nModule._sqlite3_data_count=function(){return(Module._sqlite3_data_count=Module.asm.ga).apply(null,arguments)};Module._sqlite3_column_blob=function(){return(Module._sqlite3_column_blob=Module.asm.ha).apply(null,arguments)};Module._sqlite3_column_bytes=function(){return(Module._sqlite3_column_bytes=Module.asm.ia).apply(null,arguments)};Module._sqlite3_column_double=function(){return(Module._sqlite3_column_double=Module.asm.ja).apply(null,arguments)};\nModule._sqlite3_column_text=function(){return(Module._sqlite3_column_text=Module.asm.ka).apply(null,arguments)};Module._sqlite3_column_type=function(){return(Module._sqlite3_column_type=Module.asm.la).apply(null,arguments)};Module._sqlite3_column_name=function(){return(Module._sqlite3_column_name=Module.asm.ma).apply(null,arguments)};Module._sqlite3_bind_blob=function(){return(Module._sqlite3_bind_blob=Module.asm.na).apply(null,arguments)};\nModule._sqlite3_bind_double=function(){return(Module._sqlite3_bind_double=Module.asm.oa).apply(null,arguments)};Module._sqlite3_bind_int=function(){return(Module._sqlite3_bind_int=Module.asm.pa).apply(null,arguments)};Module._sqlite3_bind_text=function(){return(Module._sqlite3_bind_text=Module.asm.qa).apply(null,arguments)};Module._sqlite3_bind_parameter_index=function(){return(Module._sqlite3_bind_parameter_index=Module.asm.ra).apply(null,arguments)};\nModule._sqlite3_sql=function(){return(Module._sqlite3_sql=Module.asm.sa).apply(null,arguments)};Module._sqlite3_normalized_sql=function(){return(Module._sqlite3_normalized_sql=Module.asm.ta).apply(null,arguments)};Module._sqlite3_errmsg=function(){return(Module._sqlite3_errmsg=Module.asm.ua).apply(null,arguments)};Module._sqlite3_exec=function(){return(Module._sqlite3_exec=Module.asm.va).apply(null,arguments)};\nModule._sqlite3_prepare_v2=function(){return(Module._sqlite3_prepare_v2=Module.asm.wa).apply(null,arguments)};Module._sqlite3_changes=function(){return(Module._sqlite3_changes=Module.asm.xa).apply(null,arguments)};Module._sqlite3_close_v2=function(){return(Module._sqlite3_close_v2=Module.asm.ya).apply(null,arguments)};Module._sqlite3_create_function_v2=function(){return(Module._sqlite3_create_function_v2=Module.asm.za).apply(null,arguments)};\nModule._sqlite3_open=function(){return(Module._sqlite3_open=Module.asm.Aa).apply(null,arguments)};var aa=Module._malloc=function(){return(aa=Module._malloc=Module.asm.Ba).apply(null,arguments)},da=Module._free=function(){return(da=Module._free=Module.asm.Ca).apply(null,arguments)};Module._RegisterExtensionFunctions=function(){return(Module._RegisterExtensionFunctions=Module.asm.Ea).apply(null,arguments)};\nModule._register_for_idb=function(){return(Module._register_for_idb=Module.asm.Fa).apply(null,arguments)};\nvar mb=Module.__get_tzname=function(){return(mb=Module.__get_tzname=Module.asm.Ga).apply(null,arguments)},lb=Module.__get_daylight=function(){return(lb=Module.__get_daylight=Module.asm.Ha).apply(null,arguments)},kb=Module.__get_timezone=function(){return(kb=Module.__get_timezone=Module.asm.Ia).apply(null,arguments)},ha=Module.stackSave=function(){return(ha=Module.stackSave=Module.asm.Ja).apply(null,arguments)},ja=Module.stackRestore=function(){return(ja=Module.stackRestore=Module.asm.Ka).apply(null,\narguments)},C=Module.stackAlloc=function(){return(C=Module.stackAlloc=Module.asm.La).apply(null,arguments)},Ab=Module._memalign=function(){return(Ab=Module._memalign=Module.asm.Ma).apply(null,arguments)};Module.cwrap=function(a,b,c,e){c=c||[];var f=c.every(function(g){return\"number\"===g});return\"string\"!==b&&f&&!e?Ha(a):function(){return Ia(a,b,c,arguments)}};Module.UTF8ToString=F;Module.FS=w;Module.stackSave=ha;Module.stackRestore=ja;Module.stackAlloc=C;var kc;Xa=function lc(){kc||mc();kc||(Xa=lc)};\nfunction mc(){function a(){if(!kc&&(kc=!0,Module.calledRun=!0,!Ga)){Module.noFSInit||w.jb.Hb||w.jb();w.hc=!1;gb(Sa);if(Module.onRuntimeInitialized)Module.onRuntimeInitialized();if(Module.postRun)for(\"function\"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;){var b=Module.postRun.shift();Ta.unshift(b)}gb(Ta)}}if(!(0<Va)){if(Module.preRun)for(\"function\"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)Ua();gb(Ra);0<Va||(Module.setStatus?(Module.setStatus(\"Running...\"),\nsetTimeout(function(){setTimeout(function(){Module.setStatus(\"\")},1);a()},1)):a())}}Module.run=mc;if(Module.preInit)for(\"function\"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);0<Module.preInit.length;)Module.preInit.pop()();mc();\n\n\n        // The shell-pre.js and emcc-generated code goes above\n        return Module;\n    }); // The end of the promise being returned\n\n  return initSqlJsPromise;\n} // The end of our initSqlJs function\n\n// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc\n// However, we don't want to use the emcc modularization. See shell-pre.js\nif (true){\n    module.exports = initSqlJs;\n    // This will allow the module to be used in ES6 or CommonJS\n    module.exports[\"default\"] = initSqlJs;\n}\nelse // removed by dead control flow\n{}\n\n\n//# sourceURL=webpack://sqlite-indexeddb-benchmark/./node_modules/@jlongster/sql.js/dist/sql-wasm.js?\n}");

/***/ }),

/***/ "./node_modules/absurd-sql/dist/index.js":
/*!***********************************************!*\
  !*** ./node_modules/absurd-sql/dist/index.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   SQLiteFS: () => (/* binding */ SQLiteFS)\n/* harmony export */ });\nconst ERRNO_CODES = {\n  EPERM: 63,\n  ENOENT: 44\n};\n\n// This implements an emscripten-compatible filesystem that is means\n// to be mounted to the one from `sql.js`. Example:\n//\n// let BFS = new SQLiteFS(SQL.FS, idbBackend);\n// SQL.FS.mount(BFS, {}, '/blocked');\n//\n// Now any files created under '/blocked' will be handled by this\n// filesystem, which creates a special file that handles read/writes\n// in the way that we want.\nclass SQLiteFS$1 {\n  constructor(FS, backend) {\n    this.FS = FS;\n    this.backend = backend;\n\n    this.node_ops = {\n      getattr: node => {\n        let fileattr = FS.isFile(node.mode) ? node.contents.getattr() : null;\n\n        let attr = {};\n        attr.dev = 1;\n        attr.ino = node.id;\n        attr.mode = fileattr ? fileattr.mode : node.mode;\n        attr.nlink = 1;\n        attr.uid = 0;\n        attr.gid = 0;\n        attr.rdev = node.rdev;\n        attr.size = fileattr ? fileattr.size : FS.isDir(node.mode) ? 4096 : 0;\n        attr.atime = new Date(0);\n        attr.mtime = new Date(0);\n        attr.ctime = new Date(0);\n        attr.blksize = fileattr ? fileattr.blockSize : 4096;\n        attr.blocks = Math.ceil(attr.size / attr.blksize);\n        return attr;\n      },\n      setattr: (node, attr) => {\n        if (this.FS.isFile(node.mode)) {\n          node.contents.setattr(attr);\n        } else {\n          if (attr.mode != null) {\n            node.mode = attr.mode;\n          }\n          if (attr.size != null) {\n            node.size = attr.size;\n          }\n        }\n      },\n      lookup: (parent, name) => {\n        throw new this.FS.ErrnoError(ERRNO_CODES.ENOENT);\n      },\n      mknod: (parent, name, mode, dev) => {\n        if (name.endsWith('.lock')) {\n          throw new Error('Locking via lockfiles is not supported');\n        }\n\n        return this.createNode(parent, name, mode, dev);\n      },\n      rename: (old_node, new_dir, new_name) => {\n        throw new Error('rename not implemented');\n      },\n      unlink: (parent, name) => {\n        let node = this.FS.lookupNode(parent, name);\n        node.contents.delete(name);\n      },\n      readdir: node => {\n        // We could list all the available databases here if `node` is\n        // the root directory. However Firefox does not implemented\n        // such a methods. Other browsers do, but since it's not\n        // supported on all browsers users will need to track it\n        // separate anyway right now\n\n        throw new Error('readdir not implemented');\n      },\n      symlink: (parent, newname, oldpath) => {\n        throw new Error('symlink not implemented');\n      },\n      readlink: node => {\n        throw new Error('symlink not implemented');\n      }\n    };\n\n    this.stream_ops = {\n      open: stream => {\n        if (this.FS.isFile(stream.node.mode)) {\n          stream.node.contents.open();\n        }\n      },\n\n      close: stream => {\n        if (this.FS.isFile(stream.node.mode)) {\n          stream.node.contents.close();\n        }\n      },\n\n      read: (stream, buffer, offset, length, position) => {\n        // console.log('read', offset, length, position)\n        return stream.node.contents.read(buffer, offset, length, position);\n      },\n\n      write: (stream, buffer, offset, length, position) => {\n        // console.log('write', offset, length, position);\n        return stream.node.contents.write(buffer, offset, length, position);\n      },\n\n      llseek: (stream, offset, whence) => {\n        // Copied from MEMFS\n        var position = offset;\n        if (whence === 1) {\n          position += stream.position;\n        } else if (whence === 2) {\n          if (FS.isFile(stream.node.mode)) {\n            position += stream.node.contents.getattr().size;\n          }\n        }\n        if (position < 0) {\n          throw new this.FS.ErrnoError(28);\n        }\n        return position;\n      },\n      allocate: (stream, offset, length) => {\n        stream.node.contents.setattr({ size: offset + length });\n      },\n      mmap: (stream, address, length, position, prot, flags) => {\n        throw new Error('mmap not implemented');\n      },\n      msync: (stream, buffer, offset, length, mmapFlags) => {\n        throw new Error('msync not implemented');\n      },\n      fsync: (stream, buffer, offset, length, mmapFlags) => {\n        stream.node.contents.fsync();\n      }\n    };\n  }\n\n  mount() {\n    return this.createNode(null, '/', 16384 /* dir */ | 511 /* 0777 */, 0);\n  }\n\n  lock(path, lockType) {\n    let { node } = this.FS.lookupPath(path);\n\n    if (node && node.contents) {\n      return node.contents.lock(lockType);\n    }\n\n    return true;\n  }\n\n  unlock(path, lockType) {\n    let { node } = this.FS.lookupPath(path);\n\n    if (node && node.contents) {\n      return node.contents.unlock(lockType);\n    }\n\n    return true;\n  }\n\n  createNode(parent, name, mode, dev) {\n    // Only files and directories supported\n    if (!(this.FS.isDir(mode) || this.FS.isFile(mode))) {\n      throw new this.FS.ErrnoError(ERRNO_CODES.EPERM);\n    }\n\n    var node = this.FS.createNode(parent, name, mode, dev);\n    if (this.FS.isDir(node.mode)) {\n      node.node_ops = {\n        mknod: this.node_ops.mknod,\n        lookup: this.node_ops.lookup,\n        unlink: this.node_ops.unlink,\n        setattr: this.node_ops.setattr\n      };\n      node.stream_ops = {};\n      node.contents = {};\n    } else if (this.FS.isFile(node.mode)) {\n      node.node_ops = this.node_ops;\n      node.stream_ops = this.stream_ops;\n\n      // Create file!\n      node.contents = this.backend.createFile(name);\n    }\n\n    // add the new node to the parent\n    if (parent) {\n      parent.contents[name] = node;\n      parent.timestamp = node.timestamp;\n    }\n\n    return node;\n  }\n}\n\n// Right now we don't support `export from` so we do this manually\nconst SQLiteFS = SQLiteFS$1;\n\n\n\n\n//# sourceURL=webpack://sqlite-indexeddb-benchmark/./node_modules/absurd-sql/dist/index.js?\n}");

/***/ }),

/***/ "./node_modules/absurd-sql/dist/indexeddb-backend.js":
/*!***********************************************************!*\
  !*** ./node_modules/absurd-sql/dist/indexeddb-backend.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nlet LOCK_TYPES = {\n  NONE: 0,\n  SHARED: 1,\n  RESERVED: 2,\n  PENDING: 3,\n  EXCLUSIVE: 4\n};\n\nfunction getPageSize(bufferView) {\n  // See 1.3.2 on https://www.sqlite.org/fileformat.html The page size\n  // is stored as a 2 byte integer at the 16th byte. It's stored as\n  // big-endian so the first byte is the larger one. Combine it into a\n  // single integer.\n  let int1 = bufferView[16];\n  let int2 = bufferView[17];\n  return (int1 << 8) + int2;\n}\n\nfunction isSafeToWrite(localData, diskData) {\n  if (localData != null && diskData != null) {\n    let localView = new Uint8Array(localData);\n    let diskView = new Uint8Array(diskData);\n\n    // See\n    // https://github.com/sqlite/sqlite/blob/master/src/pager.c#L93-L96\n    // (might be documented somewhere? I didn't see it this clearly in\n    // the docs). At least one of these bytes change when sqlite3 writes\n    // data. We can check this against our in-memory data to see if it's\n    // safe to write (if something changes underneath us, it's not)\n    for (let i = 24; i < 40; i++) {\n      if (localView[i] !== diskView[i]) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  // One of them is null, so it's only safe if to write if both are\n  // null, otherwise they are different\n  return localData == null && diskData == null;\n}\n\nfunction range(start, end, step) {\n  let r = [];\n  for (let i = start; i <= end; i += step) {\n    r.push(i);\n  }\n  return r;\n}\n\nfunction getBoundaryIndexes(blockSize, start, end) {\n  let startC = start - (start % blockSize);\n  let endC = end - 1 - ((end - 1) % blockSize);\n\n  return range(startC, endC, blockSize);\n}\n\nfunction readChunks(chunks, start, end) {\n  let buffer = new ArrayBuffer(end - start);\n  let bufferView = new Uint8Array(buffer);\n  for (let i = 0; i < chunks.length; i++) {\n    let chunk = chunks[i];\n\n    // TODO: jest has a bug where we can't do `instanceof ArrayBuffer`\n    if (chunk.data.constructor.name !== 'ArrayBuffer') {\n      throw new Error('Chunk data is not an ArrayBuffer');\n    }\n\n    let cstart = 0;\n    let cend = chunk.data.byteLength;\n\n    if (start > chunk.pos) {\n      cstart = start - chunk.pos;\n    }\n    if (end < chunk.pos + chunk.data.byteLength) {\n      cend = end - chunk.pos;\n    }\n\n    if (cstart > chunk.data.byteLength || cend < 0) {\n      continue;\n    }\n\n    let len = cend - cstart;\n\n    bufferView.set(\n      new Uint8Array(chunk.data, cstart, len),\n      chunk.pos - start + cstart\n    );\n  }\n\n  return buffer;\n}\n\nfunction writeChunks(bufferView, blockSize, start, end) {\n  let indexes = getBoundaryIndexes(blockSize, start, end);\n  let cursor = 0;\n\n  return indexes\n    .map(index => {\n      let cstart = 0;\n      let cend = blockSize;\n      if (start > index && start < index + blockSize) {\n        cstart = start - index;\n      }\n      if (end > index && end < index + blockSize) {\n        cend = end - index;\n      }\n\n      let len = cend - cstart;\n      let chunkBuffer = new ArrayBuffer(blockSize);\n\n      if (start > index + blockSize || end <= index) {\n        return null;\n      }\n\n      let off = bufferView.byteOffset + cursor;\n\n      let available = bufferView.buffer.byteLength - off;\n      if (available <= 0) {\n        return null;\n      }\n\n      let readLength = Math.min(len, available);\n\n      new Uint8Array(chunkBuffer).set(\n        new Uint8Array(bufferView.buffer, off, readLength),\n        cstart\n      );\n      cursor += readLength;\n\n      return {\n        pos: index,\n        data: chunkBuffer,\n        offset: cstart,\n        length: readLength\n      };\n    })\n    .filter(Boolean);\n}\n\nclass File {\n  constructor(filename, ops, meta = null) {\n    this.filename = filename;\n    this.buffer = new Map();\n    this.ops = ops;\n    this.meta = meta;\n    this._metaDirty = false;\n    this.writeLock = false;\n    this.openHandles = 0;\n  }\n\n  bufferChunks(chunks) {\n    for (let i = 0; i < chunks.length; i++) {\n      let chunk = chunks[i];\n      this.buffer.set(chunk.pos, chunk);\n    }\n  }\n\n  open() {\n    this.openHandles++;\n\n    // Don't open the file again if it's already open\n    if (this.openHandles === 1) {\n      this.ops.open();\n      let meta = this.ops.readMeta();\n\n      // It's possible that `setattr` has already been called if opening\n      // the file in a mode that truncates it to 0\n      if (this.meta == null) {\n        if (meta == null) {\n          // New file\n\n          meta = { size: 0 };\n        }\n\n        this.meta = meta;\n      }\n    }\n\n    return this.meta;\n  }\n\n  close() {\n    this.fsync();\n\n    this.openHandles = Math.max(this.openHandles - 1, 0);\n\n    // Only close it if there are no existing open handles\n    if (this.openHandles === 0) {\n      this.ops.close();\n    }\n  }\n\n  delete() {\n    this.ops.delete();\n  }\n\n  load(indexes) {\n    let status = indexes.reduce(\n      (acc, b) => {\n        let inMemory = this.buffer.get(b);\n        if (inMemory) {\n          acc.chunks.push(inMemory);\n        } else {\n          acc.missing.push(b);\n        }\n        return acc;\n      },\n      { chunks: [], missing: [] }\n    );\n\n    let missingChunks = [];\n    if (status.missing.length > 0) {\n      missingChunks = this.ops.readBlocks(status.missing, this.meta.blockSize);\n    }\n    return status.chunks.concat(missingChunks);\n  }\n\n  read(bufferView, offset, length, position) {\n    // console.log('reading', this.filename, offset, length, position);\n    let buffer = bufferView.buffer;\n\n    if (length <= 0) {\n      return 0;\n    }\n    if (position < 0) {\n      // TODO: is this right?\n      return 0;\n    }\n    if (position >= this.meta.size) {\n      let view = new Uint8Array(buffer, offset);\n      for (let i = 0; i < length; i++) {\n        view[i] = 0;\n      }\n\n      return length;\n    }\n\n    position = Math.max(position, 0);\n    let dataLength = Math.min(length, this.meta.size - position);\n\n    let start = position;\n    let end = position + dataLength;\n\n    let indexes = getBoundaryIndexes(this.meta.blockSize, start, end);\n\n    let chunks = this.load(indexes);\n    let readBuffer = readChunks(chunks, start, end);\n\n    if (buffer.byteLength - offset < readBuffer.byteLength) {\n      throw new Error('Buffer given to `read` is too small');\n    }\n    let view = new Uint8Array(buffer);\n    view.set(new Uint8Array(readBuffer), offset);\n\n    // TODO: I don't need to do this. `unixRead` does this for us.\n    for (let i = dataLength; i < length; i++) {\n      view[offset + i] = 0;\n    }\n\n    return length;\n  }\n\n  write(bufferView, offset, length, position) {\n    // console.log('writing', this.filename, offset, length, position);\n\n    if (this.meta.blockSize == null) {\n      // We don't have a block size yet (an empty file). The first\n      // write MUST be the beginning of the file. This is a new file\n      // and the first block contains the page size which we need.\n      // sqlite will write this block first, and if you are directly\n      // writing a db file to disk you can't write random parts of it.\n      // Just write the whole thing and we'll get the first block\n      // first.\n\n      let pageSize = getPageSize(\n        new Uint8Array(bufferView.buffer, bufferView.byteOffset + offset)\n      );\n\n      // Page sizes must be a power of 2 between 512 and 65536.\n      // These was generated by doing `Math.pow(2, N)` where N >= 9\n      // and N <= 16.\n      if (\n        ![512, 1024, 2048, 4096, 8192, 16384, 32768, 65536].includes(pageSize)\n      ) {\n        throw new Error(\n          'File has invalid page size. (the first block of a new file must be written first)'\n        );\n      }\n\n      this.setattr({ blockSize: pageSize });\n    }\n\n    let buffer = bufferView.buffer;\n\n    if (length <= 0) {\n      return 0;\n    }\n    if (position < 0) {\n      return 0;\n    }\n    if (buffer.byteLength === 0) {\n      return 0;\n    }\n\n    length = Math.min(length, buffer.byteLength - offset);\n\n    let writes = writeChunks(\n      new Uint8Array(buffer, offset, length),\n      this.meta.blockSize,\n      position,\n      position + length\n    );\n\n    // Find any partial chunks and read them in and merge with\n    // existing data\n    let { partialWrites, fullWrites } = writes.reduce(\n      (state, write) => {\n        if (write.length !== this.meta.blockSize) {\n          state.partialWrites.push(write);\n        } else {\n          state.fullWrites.push({\n            pos: write.pos,\n            data: write.data\n          });\n        }\n        return state;\n      },\n      { fullWrites: [], partialWrites: [] }\n    );\n\n    let reads = [];\n    if (partialWrites.length > 0) {\n      reads = this.load(partialWrites.map(w => w.pos));\n    }\n\n    let allWrites = fullWrites.concat(\n      reads.map(read => {\n        let write = partialWrites.find(w => w.pos === read.pos);\n\n        // MuTatIoN!\n        new Uint8Array(read.data).set(\n          new Uint8Array(write.data, write.offset, write.length),\n          write.offset,\n          write.length\n        );\n\n        return read;\n      })\n    );\n\n    this.bufferChunks(allWrites);\n\n    if (position + length > this.meta.size) {\n      this.setattr({ size: position + length });\n    }\n\n    return length;\n  }\n\n  async readIfFallback() {\n    if (this.ops.readIfFallback) {\n      // Reset the meta\n      let meta = await this.ops.readIfFallback();\n      this.meta = meta || { size: 0 };\n    }\n  }\n\n  lock(lockType) {\n    // TODO: Perf APIs need improvement\n    if (!this._recordingLock) {\n      this._recordingLock = true;\n    }\n\n    if (this.ops.lock(lockType)) {\n      if (lockType >= LOCK_TYPES.RESERVED) {\n        this.writeLock = true;\n      }\n      return true;\n    }\n    return false;\n  }\n\n  unlock(lockType) {\n    if (lockType === 0) {\n      this._recordingLock = false;\n    }\n\n    if (this.writeLock) {\n      // In certain cases (I saw this while running VACUUM after\n      // changing page size) sqlite changes the size of the file\n      // _after_ `fsync` for some reason. In our case, this is\n      // critical because we are relying on fsync to write everything\n      // out. If we just did some writes, do another fsync which will\n      // check the meta and make sure it's persisted if dirty (all\n      // other writes should already be flushed by now)\n      this.fsync();\n      this.writeLock = false;\n    }\n\n    return this.ops.unlock(lockType);\n  }\n\n  fsync() {\n    if (this.buffer.size > 0) {\n      // We need to handle page size changes which restructures the\n      // whole db. We check if the page size is being written and\n      // handle it\n      let first = this.buffer.get(0);\n      if (first) {\n        let pageSize = getPageSize(new Uint8Array(first.data));\n\n        if (pageSize !== this.meta.blockSize) {\n          // The page size changed! We need to reflect that in our\n          // storage. We need to restructure all pending writes and\n          // change our page size so all future writes reflect the new\n          // size.\n          let buffer = this.buffer;\n          this.buffer = new Map();\n\n          // We take all pending writes, concat them into a single\n          // buffer, and rewrite it out with the new size. This would\n          // be dangerous if the page size could be changed at any\n          // point in time since we don't handle partial reads here.\n          // However sqlite only ever actually changes the page size\n          // in 2 cases:\n          //\n          // * The db is empty (no data yet, so nothing to read)\n          // * A VACUUM command is rewriting the entire db\n          //\n          // In both cases, we can assume we have _all_ the needed\n          // data in the pending buffer, and we don't have to worry\n          // about overwriting anything.\n\n          let writes = [...buffer.values()];\n          let totalSize = writes.length * this.meta.blockSize;\n          let buf = new ArrayBuffer(totalSize);\n          let view = new Uint8Array(buf);\n\n          for (let write of writes) {\n            view.set(new Uint8Array(write.data), write.pos);\n          }\n\n          // Rewrite the buffer with the new page size\n          this.bufferChunks(writeChunks(view, pageSize, 0, totalSize));\n\n          // Change our page size\n          this.setattr({ blockSize: pageSize });\n        }\n      }\n\n      this.ops.writeBlocks([...this.buffer.values()], this.meta.blockSize);\n    }\n\n    if (this._metaDirty) {\n      // We only store the size right now. Block size is already\n      // stored in the sqlite file and we don't need the rest\n      //\n      // TODO: Currently we don't delete any extra blocks after the\n      // end of the file. This isn't super important, and in fact\n      // could cause perf regressions (sqlite doesn't compress files\n      // either!) but what we probably should do is detect a VACUUM\n      // command (the whole db is being rewritten) and at that point\n      // delete anything after the end of the file\n      this.ops.writeMeta({ size: this.meta.size });\n      this._metaDirty = false;\n    }\n\n    this.buffer = new Map();\n  }\n\n  setattr(attr) {\n    if (this.meta == null) {\n      this.meta = {};\n    }\n\n    // Size is the only attribute we actually persist. The rest are\n    // stored in memory\n\n    if (attr.mode !== undefined) {\n      this.meta.mode = attr.mode;\n    }\n\n    if (attr.blockSize !== undefined) {\n      this.meta.blockSize = attr.blockSize;\n    }\n\n    if (attr.size !== undefined) {\n      this.meta.size = attr.size;\n      this._metaDirty = true;\n    }\n  }\n\n  getattr() {\n    return this.meta;\n  }\n}\n\nlet FINALIZED = 0xdeadbeef;\n\nlet WRITEABLE = 0;\nlet READABLE = 1;\n\nclass Reader {\n  constructor(\n    buffer,\n    { initialOffset = 4, useAtomics = true, stream = true, debug, name } = {}\n  ) {\n    this.buffer = buffer;\n    this.atomicView = new Int32Array(buffer);\n    this.offset = initialOffset;\n    this.useAtomics = useAtomics;\n    this.stream = stream;\n    this.debug = debug;\n    this.name = name;\n  }\n\n  log(...args) {\n    if (this.debug) {\n      console.log(`[reader: ${this.name}]`, ...args);\n    }\n  }\n\n  waitWrite(name, timeout = null) {\n    if (this.useAtomics) {\n      this.log(`waiting for ${name}`);\n\n      while (Atomics.load(this.atomicView, 0) === WRITEABLE) {\n        if (timeout != null) {\n          if (\n            Atomics.wait(this.atomicView, 0, WRITEABLE, timeout) === 'timed-out'\n          ) {\n            throw new Error('timeout');\n          }\n        }\n\n        Atomics.wait(this.atomicView, 0, WRITEABLE, 500);\n      }\n\n      this.log(`resumed for ${name}`);\n    } else {\n      if (this.atomicView[0] !== READABLE) {\n        throw new Error('`waitWrite` expected array to be readable');\n      }\n    }\n  }\n\n  flip() {\n    this.log('flip');\n    if (this.useAtomics) {\n      let prev = Atomics.compareExchange(\n        this.atomicView,\n        0,\n        READABLE,\n        WRITEABLE\n      );\n\n      if (prev !== READABLE) {\n        throw new Error('Read data out of sync! This is disastrous');\n      }\n\n      Atomics.notify(this.atomicView, 0);\n    } else {\n      this.atomicView[0] = WRITEABLE;\n    }\n\n    this.offset = 4;\n  }\n\n  done() {\n    this.waitWrite('done');\n\n    let dataView = new DataView(this.buffer, this.offset);\n    let done = dataView.getUint32(0) === FINALIZED;\n\n    if (done) {\n      this.log('done');\n      this.flip();\n    }\n\n    return done;\n  }\n\n  peek(fn) {\n    this.peekOffset = this.offset;\n    let res = fn();\n    this.offset = this.peekOffset;\n    this.peekOffset = null;\n    return res;\n  }\n\n  string(timeout) {\n    this.waitWrite('string', timeout);\n\n    let byteLength = this._int32();\n    let length = byteLength / 2;\n\n    let dataView = new DataView(this.buffer, this.offset, byteLength);\n    let chars = [];\n    for (let i = 0; i < length; i++) {\n      chars.push(dataView.getUint16(i * 2));\n    }\n    let str = String.fromCharCode.apply(null, chars);\n    this.log('string', str);\n\n    this.offset += byteLength;\n\n    if (this.peekOffset == null) {\n      this.flip();\n    }\n    return str;\n  }\n\n  _int32() {\n    let byteLength = 4;\n\n    let dataView = new DataView(this.buffer, this.offset);\n    let num = dataView.getInt32();\n    this.log('_int32', num);\n\n    this.offset += byteLength;\n    return num;\n  }\n\n  int32() {\n    this.waitWrite('int32');\n    let num = this._int32();\n    this.log('int32', num);\n\n    if (this.peekOffset == null) {\n      this.flip();\n    }\n    return num;\n  }\n\n  bytes() {\n    this.waitWrite('bytes');\n\n    let byteLength = this._int32();\n\n    let bytes = new ArrayBuffer(byteLength);\n    new Uint8Array(bytes).set(\n      new Uint8Array(this.buffer, this.offset, byteLength)\n    );\n    this.log('bytes', bytes);\n\n    this.offset += byteLength;\n\n    if (this.peekOffset == null) {\n      this.flip();\n    }\n    return bytes;\n  }\n}\n\nclass Writer {\n  constructor(\n    buffer,\n    { initialOffset = 4, useAtomics = true, stream = true, debug, name } = {}\n  ) {\n    this.buffer = buffer;\n    this.atomicView = new Int32Array(buffer);\n    this.offset = initialOffset;\n    this.useAtomics = useAtomics;\n    this.stream = stream;\n\n    this.debug = debug;\n    this.name = name;\n\n    if (this.useAtomics) {\n      // The buffer starts out as writeable\n      Atomics.store(this.atomicView, 0, WRITEABLE);\n    } else {\n      this.atomicView[0] = WRITEABLE;\n    }\n  }\n\n  log(...args) {\n    if (this.debug) {\n      console.log(`[writer: ${this.name}]`, ...args);\n    }\n  }\n\n  waitRead(name) {\n    if (this.useAtomics) {\n      this.log(`waiting for ${name}`);\n      // Switch to writable\n      // Atomics.store(this.atomicView, 0, 1);\n\n      let prev = Atomics.compareExchange(\n        this.atomicView,\n        0,\n        WRITEABLE,\n        READABLE\n      );\n\n      if (prev !== WRITEABLE) {\n        throw new Error(\n          'Wrote something into unwritable buffer! This is disastrous'\n        );\n      }\n\n      Atomics.notify(this.atomicView, 0);\n\n      while (Atomics.load(this.atomicView, 0) === READABLE) {\n        // console.log('waiting to be read...');\n        Atomics.wait(this.atomicView, 0, READABLE, 500);\n      }\n\n      this.log(`resumed for ${name}`);\n    } else {\n      this.atomicView[0] = READABLE;\n    }\n\n    this.offset = 4;\n  }\n\n  finalize() {\n    this.log('finalizing');\n    let dataView = new DataView(this.buffer, this.offset);\n    dataView.setUint32(0, FINALIZED);\n    this.waitRead('finalize');\n  }\n\n  string(str) {\n    this.log('string', str);\n\n    let byteLength = str.length * 2;\n    this._int32(byteLength);\n\n    let dataView = new DataView(this.buffer, this.offset, byteLength);\n    for (let i = 0; i < str.length; i++) {\n      dataView.setUint16(i * 2, str.charCodeAt(i));\n    }\n\n    this.offset += byteLength;\n    this.waitRead('string');\n  }\n\n  _int32(num) {\n    let byteLength = 4;\n\n    let dataView = new DataView(this.buffer, this.offset);\n    dataView.setInt32(0, num);\n\n    this.offset += byteLength;\n  }\n\n  int32(num) {\n    this.log('int32', num);\n    this._int32(num);\n    this.waitRead('int32');\n  }\n\n  bytes(buffer) {\n    this.log('bytes', buffer);\n\n    let byteLength = buffer.byteLength;\n    this._int32(byteLength);\n    new Uint8Array(this.buffer, this.offset).set(new Uint8Array(buffer));\n\n    this.offset += byteLength;\n    this.waitRead('bytes');\n  }\n}\n\nfunction positionToKey$1(pos, blockSize) {\n  // We are forced to round because of floating point error. `pos`\n  // should always be divisible by `blockSize`\n  return Math.round(pos / blockSize);\n}\n\nfunction startWorker(reader, writer) {\n  // In a normal world, we'd spawn the worker here as a child worker.\n  // However Safari doesn't support nested workers, so we have to\n  // proxy them through the main thread\n  self.postMessage({\n    type: '__absurd:spawn-idb-worker',\n    argBuffer: writer.buffer,\n    resultBuffer: reader.buffer\n  });\n\n  self.addEventListener('message', e => {\n    switch (e.data.type) {\n      // Normally you would use `postMessage` control the profiler in\n      // a worker (just like this worker go those events), and the\n      // perf library automatically handles those events. We don't do\n      // that for the special backend worker though because it's\n      // always blocked when it's not processing. Instead we forward\n      // these events by going through the atomics layer to unblock it\n      // to make sure it starts immediately\n      case '__perf-deets:start-profile':\n        writer.string('profile-start');\n        writer.finalize();\n        reader.int32();\n        reader.done();\n        break;\n\n      case '__perf-deets:stop-profile':\n        writer.string('profile-stop');\n        writer.finalize();\n        reader.int32();\n        reader.done();\n        break;\n    }\n  });\n}\n\nclass FileOps {\n  constructor(filename) {\n    this.filename = filename;\n  }\n\n  // TODO: This should be renamed to `getDatabaseName`\n  getStoreName() {\n    return this.filename.replace(/\\//g, '-');\n  }\n\n  invokeWorker(method, args) {\n    if (this.reader == null || this.writer == null) {\n      throw new Error(\n        `Attempted ${method} on ${this.filename} but file not open`\n      );\n    }\n\n    let reader = this.reader;\n    let writer = this.writer;\n\n    switch (method) {\n      case 'readBlocks': {\n        let { name, positions, blockSize } = args;\n\n        let res = [];\n        for (let pos of positions) {\n          writer.string('readBlock');\n          writer.string(name);\n          writer.int32(positionToKey$1(pos, blockSize));\n          writer.finalize();\n\n          let data = reader.bytes();\n          reader.done();\n          res.push({\n            pos,\n            // If th length is 0, the block didn't exist. We return a\n            // blank block in that case\n            data: data.byteLength === 0 ? new ArrayBuffer(blockSize) : data\n          });\n        }\n\n        return res;\n      }\n\n      case 'writeBlocks': {\n        let { name, writes, blockSize } = args;\n        writer.string('writeBlocks');\n        writer.string(name);\n        for (let write of writes) {\n          writer.int32(positionToKey$1(write.pos, blockSize));\n          writer.bytes(write.data);\n        }\n        writer.finalize();\n\n        let res = reader.int32();\n        reader.done();\n        return res;\n      }\n\n      case 'readMeta': {\n        writer.string('readMeta');\n        writer.string(args.name);\n        writer.finalize();\n\n        let size = reader.int32();\n        let blockSize = reader.int32();\n        reader.done();\n        return size === -1 ? null : { size, blockSize };\n      }\n\n      case 'writeMeta': {\n        let { name, meta } = args;\n        writer.string('writeMeta');\n        writer.string(name);\n        writer.int32(meta.size);\n        // writer.int32(meta.blockSize);\n        writer.finalize();\n\n        let res = reader.int32();\n        reader.done();\n        return res;\n      }\n\n      case 'closeFile': {\n        writer.string('closeFile');\n        writer.string(args.name);\n        writer.finalize();\n\n        let res = reader.int32();\n        reader.done();\n        return res;\n      }\n\n      case 'lockFile': {\n        writer.string('lockFile');\n        writer.string(args.name);\n        writer.int32(args.lockType);\n        writer.finalize();\n\n        let res = reader.int32();\n        reader.done();\n        return res === 0;\n      }\n\n      case 'unlockFile': {\n        writer.string('unlockFile');\n        writer.string(args.name);\n        writer.int32(args.lockType);\n        writer.finalize();\n\n        let res = reader.int32();\n        reader.done();\n        return res === 0;\n      }\n    }\n  }\n\n  lock(lockType) {\n    return this.invokeWorker('lockFile', {\n      name: this.getStoreName(),\n      lockType\n    });\n  }\n\n  unlock(lockType) {\n    return this.invokeWorker('unlockFile', {\n      name: this.getStoreName(),\n      lockType\n    });\n  }\n\n  delete() {\n    // Close the file if it's open\n    if (this.reader || this.writer) {\n      this.close();\n    }\n\n    // We delete it here because we can't do it in the worker; the\n    // worker is stopped when the file closes. If we didn't do that,\n    // workers would leak in the case of closing a file but not\n    // deleting it. We could potentially restart the worker here if\n    // needed, but for now just assume that the deletion is a success\n    let req = globalThis.indexedDB.deleteDatabase(this.getStoreName());\n    req.onerror = () => {\n      console.warn(`Deleting ${this.filename} database failed`);\n    };\n    req.onsuccess = () => {};\n  }\n\n  open() {\n    let argBuffer = new SharedArrayBuffer(4096 * 9);\n    this.writer = new Writer(argBuffer, {\n      name: 'args (backend)',\n      debug: false\n    });\n\n    let resultBuffer = new SharedArrayBuffer(4096 * 9);\n    this.reader = new Reader(resultBuffer, {\n      name: 'results',\n      debug: false\n    });\n\n    // TODO: We could pool workers and reuse them so opening files\n    // aren't so slow\n    startWorker(this.reader, this.writer);\n  }\n\n  close() {\n    this.invokeWorker('closeFile', { name: this.getStoreName() });\n    this.reader = null;\n    this.writer = null;\n    this.worker = null;\n  }\n\n  readMeta() {\n    return this.invokeWorker('readMeta', { name: this.getStoreName() });\n  }\n\n  writeMeta(meta) {\n    return this.invokeWorker('writeMeta', { name: this.getStoreName(), meta });\n  }\n\n  readBlocks(positions, blockSize) {\n    if (this.stats) {\n      this.stats.read += positions.length;\n    }\n\n    return this.invokeWorker('readBlocks', {\n      name: this.getStoreName(),\n      positions,\n      blockSize\n    });\n  }\n\n  writeBlocks(writes, blockSize) {\n    if (this.stats) {\n      this.stats.writes += writes.length;\n    }\n\n    return this.invokeWorker('writeBlocks', {\n      name: this.getStoreName(),\n      writes,\n      blockSize\n    });\n  }\n}\n\n/**\n * https://bugs.webkit.org/show_bug.cgi?id=226547\n * Safari has a horrible bug where IDB requests can hang while the browser is starting up.\n * The only solution is to keep nudging it until it's awake.\n * This probably creates garbage, but garbage is better than totally failing.\n */\nfunction idbReady() {\n    const isSafari = !navigator.userAgentData &&\n        /Safari\\//.test(navigator.userAgent) &&\n        !/Chrom(e|ium)\\//.test(navigator.userAgent);\n    // No point putting other browsers or older versions of Safari through this mess.\n    if (!isSafari || !indexedDB.databases)\n        return Promise.resolve();\n    let intervalId;\n    return new Promise((resolve) => {\n        const tryIdb = () => indexedDB.databases().finally(resolve);\n        intervalId = setInterval(tryIdb, 100);\n        tryIdb();\n    }).finally(() => clearInterval(intervalId));\n}\n\nfunction positionToKey(pos, blockSize) {\n  // We are forced to round because of floating point error. `pos`\n  // should always be divisible by `blockSize`\n  return Math.round(pos / blockSize);\n}\n\nasync function openDb(name) {\n  await idbReady();\n\n  return new Promise((resolve, reject) => {\n    let req = globalThis.indexedDB.open(name, 2);\n    req.onsuccess = event => {\n      let db = event.target.result;\n\n      db.onversionchange = () => {\n        console.log('closing because version changed');\n        db.close();\n      };\n      db.onclose = () => {};\n\n      resolve(db);\n    };\n    req.onupgradeneeded = event => {\n      let db = event.target.result;\n      if (!db.objectStoreNames.contains('data')) {\n        db.createObjectStore('data');\n      }\n    };\n    req.onblocked = e => console.log('blocked', e);\n    req.onerror = req.onabort = e => reject(e.target.error);\n  });\n}\n\n// Using a separate class makes it easier to follow the code, and\n// importantly it removes any reliance on internal state in\n// `FileOpsFallback`. That would be problematic since these method\n// happen async; the args to `write` must be closed over so they don't\n// change\nclass Persistance {\n  constructor(dbName, onFallbackFailure) {\n    this.dbName = dbName;\n    this._openDb = null;\n    this.hasAlertedFailure = false;\n    this.onFallbackFailure = onFallbackFailure;\n  }\n\n  async getDb() {\n    if (this._openDb) {\n      return this._openDb;\n    }\n\n    this._openDb = await openDb(this.dbName);\n    return this._openDb;\n  }\n\n  closeDb() {\n    if (this._openDb) {\n      this._openDb.close();\n      this._openDb = null;\n    }\n  }\n\n  // Both `readAll` and `write` rely on IndexedDB transactional\n  // semantics to work, otherwise we'd have to coordinate them. If\n  // there are pending writes, the `readonly` transaction in `readAll`\n  // will block until they are all flushed out. If `write` is called\n  // multiple times, `readwrite` transactions can only run one at a\n  // time so it will naturally apply the writes sequentially (and\n  // atomically)\n\n  async readAll() {\n    let db = await this.getDb(this.dbName);\n    let blocks = new Map();\n\n    let trans = db.transaction(['data'], 'readonly');\n    let store = trans.objectStore('data');\n\n    return new Promise((resolve, reject) => {\n      // Open a cursor and iterate through the entire file\n      let req = store.openCursor(IDBKeyRange.lowerBound(-1));\n      req.onerror = reject;\n      req.onsuccess = e => {\n        let cursor = e.target.result;\n        if (cursor) {\n          blocks.set(cursor.key, cursor.value);\n          cursor.continue();\n        } else {\n          resolve(blocks);\n        }\n      };\n    });\n  }\n\n  async write(writes, cachedFirstBlock, hasLocked) {\n    let db = await this.getDb(this.dbName);\n\n    // We need grab a readwrite lock on the db, and then read to check\n    // to make sure we can write to it\n    let trans = db.transaction(['data'], 'readwrite');\n    let store = trans.objectStore('data');\n\n    await new Promise((resolve, reject) => {\n      let req = store.get(0);\n      req.onsuccess = e => {\n        if (hasLocked) {\n          if (!isSafeToWrite(req.result, cachedFirstBlock)) {\n            if (this.onFallbackFailure && !this.hasAlertedFailure) {\n              this.hasAlertedFailure = true;\n              this.onFallbackFailure();\n            }\n            reject(new Error('Fallback mode unable to write file changes'));\n            return;\n          }\n        }\n\n        // Flush all the writes\n        for (let write of writes) {\n          store.put(write.value, write.key);\n        }\n\n        trans.onsuccess = () => resolve();\n        trans.onerror = () => reject();\n      };\n      req.onerror = reject;\n    });\n  }\n}\n\nclass FileOpsFallback {\n  constructor(filename, onFallbackFailure) {\n    this.filename = filename;\n    this.dbName = this.filename.replace(/\\//g, '-');\n    this.cachedFirstBlock = null;\n    this.writeQueue = null;\n    this.blocks = new Map();\n    this.lockType = 0;\n    this.transferBlockOwnership = false;\n\n    this.persistance = new Persistance(this.dbName, onFallbackFailure);\n  }\n\n  async readIfFallback() {\n    this.transferBlockOwnership = true;\n    this.blocks = await this.persistance.readAll();\n\n    return this.readMeta();\n  }\n\n  lock(lockType) {\n    // Locks always succeed here. Essentially we're only working\n    // locally (we can't see any writes from anybody else) and we just\n    // want to track the lock so we know when it downgrades from write\n    // to read\n    this.cachedFirstBlock = this.blocks.get(0);\n    this.lockType = lockType;\n    return true;\n  }\n\n  unlock(lockType) {\n    if (this.lockType > LOCK_TYPES.SHARED && lockType === LOCK_TYPES.SHARED) {\n      // Within a write lock, we delay all writes until the end of the\n      // lock. We probably don't have to do this since we already\n      // delay writes until an `fsync`, however this is an extra\n      // measure to make sure we are writing everything atomically\n      this.flush();\n    }\n    this.lockType = lockType;\n    return true;\n  }\n\n  delete() {\n    let req = globalThis.indexedDB.deleteDatabase(this.dbName);\n    req.onerror = () => {\n      console.warn(`Deleting ${this.filename} database failed`);\n    };\n    req.onsuccess = () => {};\n  }\n\n  open() {\n    this.writeQueue = [];\n    this.lockType = 0;\n  }\n\n  close() {\n    this.flush();\n\n    if (this.transferBlockOwnership) {\n      this.transferBlockOwnership = false;\n    } else {\n      this.blocks = new Map();\n    }\n\n    this.persistance.closeDb();\n  }\n\n  readMeta() {\n    let metaBlock = this.blocks.get(-1);\n    if (metaBlock) {\n      let block = this.blocks.get(0);\n\n      return {\n        size: metaBlock.size,\n        blockSize: getPageSize(new Uint8Array(block))\n      };\n    }\n    return null;\n  }\n\n  writeMeta(meta) {\n    this.blocks.set(-1, meta);\n    this.queueWrite(-1, meta);\n  }\n\n  readBlocks(positions, blockSize) {\n    let res = [];\n    for (let pos of positions) {\n      res.push({\n        pos,\n        data: this.blocks.get(positionToKey(pos, blockSize))\n      });\n    }\n    return res;\n  }\n\n  writeBlocks(writes, blockSize) {\n    for (let write of writes) {\n      let key = positionToKey(write.pos, blockSize);\n      this.blocks.set(key, write.data);\n      this.queueWrite(key, write.data);\n    }\n\n    // No write lock; flush them out immediately\n    if (this.lockType <= LOCK_TYPES.SHARED) {\n      this.flush();\n    }\n  }\n\n  queueWrite(key, value) {\n    this.writeQueue.push({ key, value });\n  }\n\n  flush() {\n    if (this.writeQueue.length > 0) {\n      this.persistance.write(\n        this.writeQueue,\n        this.cachedFirstBlock,\n        this.lockType > LOCK_TYPES.SHARED\n      );\n      this.writeQueue = [];\n    }\n    this.cachedFirstBlock = null;\n  }\n}\n\nclass IndexedDBBackend {\n  constructor(onFallbackFailure) {\n    this.onFallbackFailure = onFallbackFailure;\n  }\n\n  createFile(filename) {\n    let ops;\n    if (typeof SharedArrayBuffer !== 'undefined') {\n      // SharedArrayBuffer exists! We can run this fully\n      ops = new FileOps(filename);\n    } else {\n      // SharedArrayBuffer is not supported. Use the fallback methods\n      // which provide a somewhat working version, but doesn't\n      // support mutations across connections (tabs)\n      ops = new FileOpsFallback(filename, this.onFallbackFailure);\n    }\n\n    let file = new File(filename, ops);\n\n    // If we don't need perf data, there's no reason for us to hold a\n    // reference to the files. If we did we'd have to worry about\n    // memory leaks\n    if (true) {\n      if (this._files == null) {\n        this._files = new Set();\n      }\n      this._files.add(file);\n    }\n\n    return file;\n  }\n\n  // Instead of controlling the profiler from the main thread by\n  // posting a message to this worker, you can control it inside the\n  // worker manually with these methods\n  startProfile() {\n    for (let file of this._files) {\n      // If the writer doesn't exist, that means the file has been\n      // deleted\n      if (file.ops.writer) {\n        let writer = file.ops.writer;\n        let reader = file.ops.reader;\n        writer.string('profile-start');\n        writer.finalize();\n        reader.int32();\n        reader.done();\n      }\n    }\n  }\n\n  stopProfile() {\n    for (let file of this._files) {\n      if (file.ops.writer) {\n        let writer = file.ops.writer;\n        let reader = file.ops.reader;\n        writer.string('profile-stop');\n        writer.finalize();\n        reader.int32();\n        reader.done();\n      }\n    }\n  }\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IndexedDBBackend);\n\n\n//# sourceURL=webpack://sqlite-indexeddb-benchmark/./node_modules/absurd-sql/dist/indexeddb-backend.js?\n}");

/***/ }),

/***/ "?180a":
/*!********************!*\
  !*** fs (ignored) ***!
  \********************/
/***/ (() => {

eval("{/* (ignored) */\n\n//# sourceURL=webpack://sqlite-indexeddb-benchmark/fs_(ignored)?\n}");

/***/ }),

/***/ "?2a46":
/*!**********************!*\
  !*** path (ignored) ***!
  \**********************/
/***/ (() => {

eval("{/* (ignored) */\n\n//# sourceURL=webpack://sqlite-indexeddb-benchmark/path_(ignored)?\n}");

/***/ }),

/***/ "?6b37":
/*!************************!*\
  !*** crypto (ignored) ***!
  \************************/
/***/ (() => {

eval("{/* (ignored) */\n\n//# sourceURL=webpack://sqlite-indexeddb-benchmark/crypto_(ignored)?\n}");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			loaded: false,
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/node module decorator */
/******/ 	(() => {
/******/ 		__webpack_require__.nmd = (module) => {
/******/ 			module.paths = [];
/******/ 			if (!module.children) module.children = [];
/******/ 			return module;
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = __webpack_require__("./examples/absurd-worker.js");
/******/ 	
/******/ })()
;