473 lines
16 KiB
JavaScript
473 lines
16 KiB
JavaScript
let wasm;
|
|
|
|
let heap = new Array(128).fill(undefined);
|
|
|
|
heap.push(undefined, null, true, false);
|
|
|
|
function getObject(idx) { return heap[idx]; }
|
|
|
|
let cachedUint8ArrayMemory0 = null;
|
|
|
|
function getUint8ArrayMemory0() {
|
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
}
|
|
return cachedUint8ArrayMemory0;
|
|
}
|
|
|
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
|
|
cachedTextDecoder.decode();
|
|
|
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
let numBytesDecoded = 0;
|
|
function decodeText(ptr, len) {
|
|
numBytesDecoded += len;
|
|
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
cachedTextDecoder.decode();
|
|
numBytesDecoded = len;
|
|
}
|
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
}
|
|
|
|
function getStringFromWasm0(ptr, len) {
|
|
ptr = ptr >>> 0;
|
|
return decodeText(ptr, len);
|
|
}
|
|
|
|
let heap_next = heap.length;
|
|
|
|
function addHeapObject(obj) {
|
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
const idx = heap_next;
|
|
heap_next = heap[idx];
|
|
|
|
heap[idx] = obj;
|
|
return idx;
|
|
}
|
|
|
|
function handleError(f, args) {
|
|
try {
|
|
return f.apply(this, args);
|
|
} catch (e) {
|
|
wasm.__wbindgen_export_0(addHeapObject(e));
|
|
}
|
|
}
|
|
|
|
function isLikeNone(x) {
|
|
return x === undefined || x === null;
|
|
}
|
|
|
|
let WASM_VECTOR_LEN = 0;
|
|
|
|
const cachedTextEncoder = new TextEncoder();
|
|
|
|
if (!('encodeInto' in cachedTextEncoder)) {
|
|
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
const buf = cachedTextEncoder.encode(arg);
|
|
view.set(buf);
|
|
return {
|
|
read: arg.length,
|
|
written: buf.length
|
|
};
|
|
}
|
|
}
|
|
|
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
|
|
if (realloc === undefined) {
|
|
const buf = cachedTextEncoder.encode(arg);
|
|
const ptr = malloc(buf.length, 1) >>> 0;
|
|
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
WASM_VECTOR_LEN = buf.length;
|
|
return ptr;
|
|
}
|
|
|
|
let len = arg.length;
|
|
let ptr = malloc(len, 1) >>> 0;
|
|
|
|
const mem = getUint8ArrayMemory0();
|
|
|
|
let offset = 0;
|
|
|
|
for (; offset < len; offset++) {
|
|
const code = arg.charCodeAt(offset);
|
|
if (code > 0x7F) break;
|
|
mem[ptr + offset] = code;
|
|
}
|
|
|
|
if (offset !== len) {
|
|
if (offset !== 0) {
|
|
arg = arg.slice(offset);
|
|
}
|
|
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
|
|
offset += ret.written;
|
|
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
}
|
|
|
|
WASM_VECTOR_LEN = offset;
|
|
return ptr;
|
|
}
|
|
|
|
let cachedDataViewMemory0 = null;
|
|
|
|
function getDataViewMemory0() {
|
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
}
|
|
return cachedDataViewMemory0;
|
|
}
|
|
|
|
function dropObject(idx) {
|
|
if (idx < 132) return;
|
|
heap[idx] = heap_next;
|
|
heap_next = idx;
|
|
}
|
|
|
|
function takeObject(idx) {
|
|
const ret = getObject(idx);
|
|
dropObject(idx);
|
|
return ret;
|
|
}
|
|
|
|
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(
|
|
state => {
|
|
wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b);
|
|
}
|
|
);
|
|
|
|
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
const real = (...args) => {
|
|
|
|
// First up with a closure we increment the internal reference
|
|
// count. This ensures that the Rust closure environment won't
|
|
// be deallocated while we're invoking it.
|
|
state.cnt++;
|
|
const a = state.a;
|
|
state.a = 0;
|
|
try {
|
|
return f(a, state.b, ...args);
|
|
} finally {
|
|
if (--state.cnt === 0) {
|
|
wasm.__wbindgen_export_3.get(state.dtor)(a, state.b);
|
|
CLOSURE_DTORS.unregister(state);
|
|
} else {
|
|
state.a = a;
|
|
}
|
|
}
|
|
};
|
|
real.original = state;
|
|
CLOSURE_DTORS.register(real, state, state);
|
|
return real;
|
|
}
|
|
|
|
export function main() {
|
|
wasm.main();
|
|
}
|
|
|
|
function __wbg_adapter_4(arg0, arg1, arg2, arg3) {
|
|
wasm.__wbindgen_export_4(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
}
|
|
|
|
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
|
|
async function __wbg_load(module, imports) {
|
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
try {
|
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
|
|
} catch (e) {
|
|
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
|
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
|
|
} else {
|
|
throw e;
|
|
}
|
|
}
|
|
}
|
|
|
|
const bytes = await module.arrayBuffer();
|
|
return await WebAssembly.instantiate(bytes, imports);
|
|
|
|
} else {
|
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
|
|
if (instance instanceof WebAssembly.Instance) {
|
|
return { instance, module };
|
|
|
|
} else {
|
|
return instance;
|
|
}
|
|
}
|
|
}
|
|
|
|
function __wbg_get_imports() {
|
|
const imports = {};
|
|
imports.wbg = {};
|
|
imports.wbg.__wbg_add_4e0283c00f7ecabe = function() { return handleError(function (arg0, arg1, arg2) {
|
|
getObject(arg0).add(getStringFromWasm0(arg1, arg2));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_appendChild_87a6cc0aeb132c06 = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg0).appendChild(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_body_8822ca55cb3730d2 = function(arg0) {
|
|
const ret = getObject(arg0).body;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_classList_61149e0de7c668c5 = function(arg0) {
|
|
const ret = getObject(arg0).classList;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_createElement_4909dfa2011f2abe = function() { return handleError(function (arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_document_7d29d139bd619045 = function(arg0) {
|
|
const ret = getObject(arg0).document;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_getAttribute_8bfaf67e99ed2ee3 = function(arg0, arg1, arg2, arg3) {
|
|
const ret = getObject(arg1).getAttribute(getStringFromWasm0(arg2, arg3));
|
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
var len1 = WASM_VECTOR_LEN;
|
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
};
|
|
imports.wbg.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
|
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_instanceof_Element_162e4334c7d6f450 = function(arg0) {
|
|
let result;
|
|
try {
|
|
result = getObject(arg0) instanceof Element;
|
|
} catch (_) {
|
|
result = false;
|
|
}
|
|
const ret = result;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_instanceof_IntersectionObserverEntry_819e56422a481344 = function(arg0) {
|
|
let result;
|
|
try {
|
|
result = getObject(arg0) instanceof IntersectionObserverEntry;
|
|
} catch (_) {
|
|
result = false;
|
|
}
|
|
const ret = result;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_instanceof_Window_12d20d558ef92592 = function(arg0) {
|
|
let result;
|
|
try {
|
|
result = getObject(arg0) instanceof Window;
|
|
} catch (_) {
|
|
result = false;
|
|
}
|
|
const ret = result;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_isIntersecting_31dfa252ee048a6f = function(arg0) {
|
|
const ret = getObject(arg0).isIntersecting;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_item_e5c3452334bca83f = function(arg0, arg1) {
|
|
const ret = getObject(arg0).item(arg1 >>> 0);
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_length_186546c51cd61acd = function(arg0) {
|
|
const ret = getObject(arg0).length;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_length_e7f4a6e30ea139e7 = function(arg0) {
|
|
const ret = getObject(arg0).length;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_log_6c7b5f4f00b8ce3f = function(arg0) {
|
|
console.log(getObject(arg0));
|
|
};
|
|
imports.wbg.__wbg_new_19c25a3f2fa63a02 = function() {
|
|
const ret = new Object();
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_newnoargs_254190557c45b4ec = function(arg0, arg1) {
|
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_newwithoptions_f6e0820321465a5c = function() { return handleError(function (arg0, arg1) {
|
|
const ret = new IntersectionObserver(getObject(arg0), getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_observe_d5620e0d99e20a09 = function(arg0, arg1) {
|
|
getObject(arg0).observe(getObject(arg1));
|
|
};
|
|
imports.wbg.__wbg_querySelectorAll_71b924f0e83d096b = function() { return handleError(function (arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).querySelectorAll(getStringFromWasm0(arg1, arg2));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
imports.wbg.__wbg_setAttribute_d1baf9023ad5696f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
}, arguments) };
|
|
imports.wbg.__wbg_setclassName_c8bccad917b973f4 = function(arg0, arg1, arg2) {
|
|
getObject(arg0).className = getStringFromWasm0(arg1, arg2);
|
|
};
|
|
imports.wbg.__wbg_setinnerHTML_34e240d6b8e8260c = function(arg0, arg1, arg2) {
|
|
getObject(arg0).innerHTML = getStringFromWasm0(arg1, arg2);
|
|
};
|
|
imports.wbg.__wbg_settextContent_b55fe2f5f1399466 = function(arg0, arg1, arg2) {
|
|
getObject(arg0).textContent = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
|
|
};
|
|
imports.wbg.__wbg_setthreshold_7daca4126268ea47 = function(arg0, arg1) {
|
|
getObject(arg0).threshold = getObject(arg1);
|
|
};
|
|
imports.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12 = function() {
|
|
const ret = typeof global === 'undefined' ? null : global;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184 = function() {
|
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_static_accessor_SELF_995b214ae681ff99 = function() {
|
|
const ret = typeof self === 'undefined' ? null : self;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea = function() {
|
|
const ret = typeof window === 'undefined' ? null : window;
|
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_target_161cb00cc3daf872 = function(arg0) {
|
|
const ret = getObject(arg0).target;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbg_wbindgencbdrop_eb10308566512b88 = function(arg0) {
|
|
const obj = getObject(arg0).original;
|
|
if (obj.cnt-- == 1) {
|
|
obj.a = 0;
|
|
return true;
|
|
}
|
|
const ret = false;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5 = function(arg0) {
|
|
const ret = getObject(arg0) === undefined;
|
|
return ret;
|
|
};
|
|
imports.wbg.__wbg_wbindgenrethrow_01815c9239d70cc2 = function(arg0) {
|
|
throw takeObject(arg0);
|
|
};
|
|
imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
|
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
};
|
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
// Cast intrinsic for `F64 -> Externref`.
|
|
const ret = arg0;
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_cast_fe9164a03cdb0b6b = function(arg0, arg1) {
|
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("Array<any>"), NamedExternref("IntersectionObserver")], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
const ret = makeMutClosure(arg0, arg1, 1, __wbg_adapter_4);
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
const ret = getObject(arg0);
|
|
return addHeapObject(ret);
|
|
};
|
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
takeObject(arg0);
|
|
};
|
|
|
|
return imports;
|
|
}
|
|
|
|
function __wbg_init_memory(imports, memory) {
|
|
|
|
}
|
|
|
|
function __wbg_finalize_init(instance, module) {
|
|
wasm = instance.exports;
|
|
__wbg_init.__wbindgen_wasm_module = module;
|
|
cachedDataViewMemory0 = null;
|
|
cachedUint8ArrayMemory0 = null;
|
|
|
|
|
|
wasm.__wbindgen_start();
|
|
return wasm;
|
|
}
|
|
|
|
function initSync(module) {
|
|
if (wasm !== undefined) return wasm;
|
|
|
|
|
|
if (typeof module !== 'undefined') {
|
|
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
({module} = module)
|
|
} else {
|
|
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
}
|
|
}
|
|
|
|
const imports = __wbg_get_imports();
|
|
|
|
__wbg_init_memory(imports);
|
|
|
|
if (!(module instanceof WebAssembly.Module)) {
|
|
module = new WebAssembly.Module(module);
|
|
}
|
|
|
|
const instance = new WebAssembly.Instance(module, imports);
|
|
|
|
return __wbg_finalize_init(instance, module);
|
|
}
|
|
|
|
async function __wbg_init(module_or_path) {
|
|
if (wasm !== undefined) return wasm;
|
|
|
|
|
|
if (typeof module_or_path !== 'undefined') {
|
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
({module_or_path} = module_or_path)
|
|
} else {
|
|
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
}
|
|
}
|
|
|
|
if (typeof module_or_path === 'undefined') {
|
|
module_or_path = new URL('railwayka_landing_bg.wasm', import.meta.url);
|
|
}
|
|
const imports = __wbg_get_imports();
|
|
|
|
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
module_or_path = fetch(module_or_path);
|
|
}
|
|
|
|
__wbg_init_memory(imports);
|
|
|
|
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
|
|
return __wbg_finalize_init(instance, module);
|
|
}
|
|
|
|
export { initSync };
|
|
export default __wbg_init;
|