4 const cachedTextDecoder
= new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
6 cachedTextDecoder
.decode();
8 let cachedUint8Memory0
= new Uint8Array();
10 function getUint8Memory0() {
11 if (cachedUint8Memory0
.byteLength
=== 0) {
12 cachedUint8Memory0
= new Uint8Array(wasm
.memory
.buffer
);
14 return cachedUint8Memory0
;
17 function getStringFromWasm0(ptr
, len
) {
18 return cachedTextDecoder
.decode(getUint8Memory0().subarray(ptr
, ptr
+ len
));
21 const heap
= new Array(32).fill(undefined);
23 heap
.push(undefined, null, true, false);
25 let heap_next
= heap
.length
;
27 function addHeapObject(obj
) {
28 if (heap_next
=== heap
.length
) heap
.push(heap
.length
+ 1);
29 const idx
= heap_next
;
30 heap_next
= heap
[idx
];
36 function getObject(idx
) { return heap
[idx
]; }
38 function dropObject(idx
) {
40 heap
[idx
] = heap_next
;
44 function takeObject(idx
) {
45 const ret
= getObject(idx
);
50 let WASM_VECTOR_LEN
= 0;
52 const cachedTextEncoder
= new TextEncoder('utf-8');
54 const encodeString
= (typeof cachedTextEncoder
.encodeInto
=== 'function'
55 ? function (arg
, view
) {
56 return cachedTextEncoder
.encodeInto(arg
, view
);
58 : function (arg
, view
) {
59 const buf
= cachedTextEncoder
.encode(arg
);
67 function passStringToWasm0(arg
, malloc
, realloc
) {
69 if (realloc
=== undefined) {
70 const buf
= cachedTextEncoder
.encode(arg
);
71 const ptr
= malloc(buf
.length
);
72 getUint8Memory0().subarray(ptr
, ptr
+ buf
.length
).set(buf
);
73 WASM_VECTOR_LEN
= buf
.length
;
78 let ptr
= malloc(len
);
80 const mem
= getUint8Memory0();
84 for (; offset
< len
; offset
++) {
85 const code
= arg
.charCodeAt(offset
);
86 if (code
> 0x7F) break;
87 mem
[ptr
+ offset
] = code
;
92 arg
= arg
.slice(offset
);
94 ptr
= realloc(ptr
, len
, len
= offset
+ arg
.length
* 3);
95 const view
= getUint8Memory0().subarray(ptr
+ offset
, ptr
+ len
);
96 const ret
= encodeString(arg
, view
);
98 offset
+= ret
.written
;
101 WASM_VECTOR_LEN
= offset
;
105 * @param {string} name
107 export function greet(name
) {
108 const ptr0
= passStringToWasm0(name
, wasm
.__wbindgen_export_0
, wasm
.__wbindgen_export_1
);
109 const len0
= WASM_VECTOR_LEN
;
110 wasm
.greet(ptr0
, len0
);
115 export function main() {
119 function handleError(f
, args
) {
121 return f
.apply(this, args
);
123 wasm
.__wbindgen_export_2(addHeapObject(e
));
127 function isLikeNone(x
) {
128 return x
=== undefined || x
=== null;
131 async
function load(module
, imports
) {
132 if (typeof Response
=== 'function' && module
instanceof Response
) {
133 if (typeof WebAssembly
.instantiateStreaming
=== 'function') {
135 return await WebAssembly
.instantiateStreaming(module
, imports
);
138 if (module
.headers
.get('Content-Type') != 'application/wasm') {
139 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
);
147 const bytes
= await module
.arrayBuffer();
148 return await WebAssembly
.instantiate(bytes
, imports
);
151 const instance
= await WebAssembly
.instantiate(module
, imports
);
153 if (instance
instanceof WebAssembly
.Instance
) {
154 return { instance
, module
};
162 function getImports() {
165 imports
.wbg
.__wbg_alert_02b82f812a9453a9 = function(arg0
, arg1
) {
166 alert(getStringFromWasm0(arg0
, arg1
));
168 imports
.wbg
.__wbindgen_string_new = function(arg0
, arg1
) {
169 const ret
= getStringFromWasm0(arg0
, arg1
);
170 return addHeapObject(ret
);
172 imports
.wbg
.__wbg_log_4b5638ad60bdc54a = function(arg0
) {
173 console
.log(getObject(arg0
));
175 imports
.wbg
.__wbindgen_object_drop_ref = function(arg0
) {
178 imports
.wbg
.__wbg_self_6d479506f72c6a71 = function() { return handleError(function () {
179 const ret
= self
.self
;
180 return addHeapObject(ret
);
182 imports
.wbg
.__wbg_window_f2557cc78490aceb = function() { return handleError(function () {
183 const ret
= window
.window
;
184 return addHeapObject(ret
);
186 imports
.wbg
.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () {
187 const ret
= globalThis
.globalThis
;
188 return addHeapObject(ret
);
190 imports
.wbg
.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () {
191 const ret
= global
.global
;
192 return addHeapObject(ret
);
194 imports
.wbg
.__wbindgen_is_undefined = function(arg0
) {
195 const ret
= getObject(arg0
) === undefined;
198 imports
.wbg
.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0
, arg1
) {
199 const ret
= new Function(getStringFromWasm0(arg0
, arg1
));
200 return addHeapObject(ret
);
202 imports
.wbg
.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0
, arg1
) {
203 const ret
= getObject(arg0
).call(getObject(arg1
));
204 return addHeapObject(ret
);
206 imports
.wbg
.__wbindgen_object_clone_ref = function(arg0
) {
207 const ret
= getObject(arg0
);
208 return addHeapObject(ret
);
210 imports
.wbg
.__wbg_instanceof_Window_acc97ff9f5d2c7b4 = function(arg0
) {
213 result
= getObject(arg0
) instanceof Window
;
220 imports
.wbg
.__wbg_document_3ead31dbcad65886 = function(arg0
) {
221 const ret
= getObject(arg0
).document
;
222 return isLikeNone(ret
) ? 0 : addHeapObject(ret
);
224 imports
.wbg
.__wbg_body_3cb4b4042b9a632b = function(arg0
) {
225 const ret
= getObject(arg0
).body
;
226 return isLikeNone(ret
) ? 0 : addHeapObject(ret
);
228 imports
.wbg
.__wbg_createElement_976dbb84fe1661b5 = function() { return handleError(function (arg0
, arg1
, arg2
) {
229 const ret
= getObject(arg0
).createElement(getStringFromWasm0(arg1
, arg2
));
230 return addHeapObject(ret
);
232 imports
.wbg
.__wbg_setinnerHTML_32081d8a164e6dc4 = function(arg0
, arg1
, arg2
) {
233 getObject(arg0
).innerHTML
= getStringFromWasm0(arg1
, arg2
);
235 imports
.wbg
.__wbg_appendChild_e513ef0e5098dfdd = function() { return handleError(function (arg0
, arg1
) {
236 const ret
= getObject(arg0
).appendChild(getObject(arg1
));
237 return addHeapObject(ret
);
239 imports
.wbg
.__wbindgen_throw = function(arg0
, arg1
) {
240 throw new Error(getStringFromWasm0(arg0
, arg1
));
242 imports
.wbg
.__wbindgen_rethrow = function(arg0
) {
243 throw takeObject(arg0
);
249 function initMemory(imports
, maybe_memory
) {
253 function finalizeInit(instance
, module
) {
254 wasm
= instance
.exports
;
255 init
.__wbindgen_wasm_module
= module
;
256 cachedUint8Memory0
= new Uint8Array();
258 wasm
.__wbindgen_start();
262 function initSync(module
) {
263 const imports
= getImports();
267 if (!(module
instanceof WebAssembly
.Module
)) {
268 module
= new WebAssembly
.Module(module
);
271 const instance
= new WebAssembly
.Instance(module
, imports
);
273 return finalizeInit(instance
, module
);
276 async
function init(input
) {
277 if (typeof input
=== 'undefined') {
278 input
= new URL('frontend_bg.wasm', import.meta
.url
);
280 const imports
= getImports();
282 if (typeof input
=== 'string' || (typeof Request
=== 'function' && input
instanceof Request
) || (typeof URL
=== 'function' && input
instanceof URL
)) {
283 input
= fetch(input
);
288 const { instance
, module
} = await
load(await input
, imports
);
290 return finalizeInit(instance
, module
);