/* tslint:disable */ import * as wasm from './only_web_bg'; /** * @returns {void} */ export function run() { return wasm.run(); } const __widl_f_create_element_Document_target = typeof Document === 'undefined' ? null : Document.prototype.createElement || function() { throw new Error(`wasm-bindgen: Document.createElement does not exist`); }; let cachegetUint32Memory = null; function getUint32Memory() { if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) { cachegetUint32Memory = new Uint32Array(wasm.memory.buffer); } return cachegetUint32Memory; } const slab = [{ obj: undefined }, { obj: null }, { obj: true }, { obj: false }]; let slab_next = slab.length; function addHeapObject(obj) { if (slab_next === slab.length) slab.push(slab.length + 1); const idx = slab_next; const next = slab[idx]; slab_next = next; slab[idx] = { obj, cnt: 1 }; return idx << 1; } const stack = []; function getObject(idx) { if ((idx & 1) === 1) { return stack[idx >> 1]; } else { const val = slab[idx >> 1]; return val.obj; } } let cachedTextDecoder = new TextDecoder('utf-8'); let cachegetUint8Memory = null; function getUint8Memory() { if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) { cachegetUint8Memory = new Uint8Array(wasm.memory.buffer); } return cachegetUint8Memory; } function getStringFromWasm(ptr, len) { return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len)); } export function __widl_f_create_element_Document(arg0, arg1, arg2, exnptr) { let varg1 = getStringFromWasm(arg1, arg2); try { return addHeapObject(__widl_f_create_element_Document_target.call(getObject(arg0), varg1)); } catch (e) { const view = getUint32Memory(); view[exnptr / 4] = 1; view[exnptr / 4 + 1] = addHeapObject(e); } } const __widl_f_create_text_node_Document_target = typeof Document === 'undefined' ? null : Document.prototype.createTextNode || function() { throw new Error(`wasm-bindgen: Document.createTextNode does not exist`); }; export function __widl_f_create_text_node_Document(arg0, arg1, arg2) { let varg1 = getStringFromWasm(arg1, arg2); return addHeapObject(__widl_f_create_text_node_Document_target.call(getObject(arg0), varg1)); } function GetOwnOrInheritedPropertyDescriptor(obj, id) { while (obj) { let desc = Object.getOwnPropertyDescriptor(obj, id); if (desc) return desc; obj = Object.getPrototypeOf(obj); } return {} } const __widl_f_body_Document_target = GetOwnOrInheritedPropertyDescriptor(typeof Document === 'undefined' ? null : Document.prototype, 'body').get || function() { throw new Error(`wasm-bindgen: Document.body does not exist`); }; function isLikeNone(x) { return x === undefined || x === null; } export function __widl_f_body_Document(arg0) { const val = __widl_f_body_Document_target.call(getObject(arg0)); return isLikeNone(val) ? 0 : addHeapObject(val); } const __widl_f_set_attribute_Element_target = typeof Element === 'undefined' ? null : Element.prototype.setAttribute || function() { throw new Error(`wasm-bindgen: Element.setAttribute does not exist`); }; export function __widl_f_set_attribute_Element(arg0, arg1, arg2, arg3, arg4, exnptr) { let varg1 = getStringFromWasm(arg1, arg2); let varg3 = getStringFromWasm(arg3, arg4); try { __widl_f_set_attribute_Element_target.call(getObject(arg0), varg1, varg3); } catch (e) { const view = getUint32Memory(); view[exnptr / 4] = 1; view[exnptr / 4 + 1] = addHeapObject(e); } } const __widl_f_append_child_Node_target = typeof Node === 'undefined' ? null : Node.prototype.appendChild || function() { throw new Error(`wasm-bindgen: Node.appendChild does not exist`); }; export function __widl_f_append_child_Node(arg0, arg1, exnptr) { try { return addHeapObject(__widl_f_append_child_Node_target.call(getObject(arg0), getObject(arg1))); } catch (e) { const view = getUint32Memory(); view[exnptr / 4] = 1; view[exnptr / 4 + 1] = addHeapObject(e); } } export function __widl_instanceof_Window(idx) { return getObject(idx) instanceof Window ? 1 : 0; } const __widl_f_document_Window_target = function() { return this.document; }; export function __widl_f_document_Window(arg0) { const val = __widl_f_document_Window_target.call(getObject(arg0)); return isLikeNone(val) ? 0 : addHeapObject(val); } export function __wbg_newnoargs_b5dbe629f3c72f37(arg0, arg1) { let varg0 = getStringFromWasm(arg0, arg1); return addHeapObject(new Function(varg0)); } const __wbg_call_80c8cb20bdc473db_target = typeof Function === 'undefined' ? null : Function.prototype.call || function() { throw new Error(`wasm-bindgen: Function.call does not exist`); }; export function __wbg_call_80c8cb20bdc473db(arg0, arg1, exnptr) { try { return addHeapObject(__wbg_call_80c8cb20bdc473db_target.call(getObject(arg0), getObject(arg1))); } catch (e) { const view = getUint32Memory(); view[exnptr / 4] = 1; view[exnptr / 4 + 1] = addHeapObject(e); } } export function __wbindgen_object_clone_ref(idx) { // If this object is on the stack promote it to the heap. if ((idx & 1) === 1) return addHeapObject(getObject(idx)); // Otherwise if the object is on the heap just bump the // refcount and move on const val = slab[idx >> 1]; val.cnt += 1; return idx; } function dropRef(idx) { idx = idx >> 1; if (idx < 4) return; let obj = slab[idx]; obj.cnt -= 1; if (obj.cnt > 0) return; // If we hit 0 then free up our space in the slab slab[idx] = slab_next; slab_next = idx; } export function __wbindgen_object_drop_ref(i) { dropRef(i); } export function __wbindgen_number_get(n, invalid) { let obj = getObject(n); if (typeof(obj) === 'number') return obj; getUint8Memory()[invalid] = 1; return 0; } export function __wbindgen_is_null(idx) { return getObject(idx) === null ? 1 : 0; } export function __wbindgen_is_undefined(idx) { return getObject(idx) === undefined ? 1 : 0; } export function __wbindgen_boolean_get(i) { let v = getObject(i); if (typeof(v) === 'boolean') { return v ? 1 : 0; } else { return 2; } } export function __wbindgen_is_symbol(i) { return typeof(getObject(i)) === 'symbol' ? 1 : 0; } let cachedTextEncoder = new TextEncoder('utf-8'); function passStringToWasm(arg) { const buf = cachedTextEncoder.encode(arg); const ptr = wasm.__wbindgen_malloc(buf.length); getUint8Memory().set(buf, ptr); return [ptr, buf.length]; } export function __wbindgen_string_get(i, len_ptr) { let obj = getObject(i); if (typeof(obj) !== 'string') return 0; const [ptr, len] = passStringToWasm(obj); getUint32Memory()[len_ptr / 4] = len; return ptr; } export function __wbindgen_throw(ptr, len) { throw new Error(getStringFromWasm(ptr, len)); }