mimium-web 2.4.1-alpha → 2.4.2-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/mimium_web.js CHANGED
@@ -1,5 +1,711 @@
1
- import * as wasm from "./mimium_web_bg.wasm";
2
- export * from "./mimium_web_bg.js";
3
- import { __wbg_set_wasm } from "./mimium_web_bg.js";
4
- __wbg_set_wasm(wasm);
5
- wasm.__wbindgen_start();
1
+ import { read_file } from './snippets/mimium-lang-9f8f53fd92615b3b/src/utils/fileloader.cjs';
2
+
3
+ let wasm;
4
+
5
+ function addToExternrefTable0(obj) {
6
+ const idx = wasm.__externref_table_alloc();
7
+ wasm.__wbindgen_export_2.set(idx, obj);
8
+ return idx;
9
+ }
10
+
11
+ function handleError(f, args) {
12
+ try {
13
+ return f.apply(this, args);
14
+ } catch (e) {
15
+ const idx = addToExternrefTable0(e);
16
+ wasm.__wbindgen_exn_store(idx);
17
+ }
18
+ }
19
+
20
+ let cachedUint8ArrayMemory0 = null;
21
+
22
+ function getUint8ArrayMemory0() {
23
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
24
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
25
+ }
26
+ return cachedUint8ArrayMemory0;
27
+ }
28
+
29
+ let WASM_VECTOR_LEN = 0;
30
+
31
+ function passArray8ToWasm0(arg, malloc) {
32
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
33
+ getUint8ArrayMemory0().set(arg, ptr / 1);
34
+ WASM_VECTOR_LEN = arg.length;
35
+ return ptr;
36
+ }
37
+
38
+ let cachedDataViewMemory0 = null;
39
+
40
+ function getDataViewMemory0() {
41
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
42
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
43
+ }
44
+ return cachedDataViewMemory0;
45
+ }
46
+
47
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
48
+
49
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
50
+
51
+ function getStringFromWasm0(ptr, len) {
52
+ ptr = ptr >>> 0;
53
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
54
+ }
55
+
56
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
57
+
58
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
59
+ ? function (arg, view) {
60
+ return cachedTextEncoder.encodeInto(arg, view);
61
+ }
62
+ : function (arg, view) {
63
+ const buf = cachedTextEncoder.encode(arg);
64
+ view.set(buf);
65
+ return {
66
+ read: arg.length,
67
+ written: buf.length
68
+ };
69
+ });
70
+
71
+ function passStringToWasm0(arg, malloc, realloc) {
72
+
73
+ if (realloc === undefined) {
74
+ const buf = cachedTextEncoder.encode(arg);
75
+ const ptr = malloc(buf.length, 1) >>> 0;
76
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
77
+ WASM_VECTOR_LEN = buf.length;
78
+ return ptr;
79
+ }
80
+
81
+ let len = arg.length;
82
+ let ptr = malloc(len, 1) >>> 0;
83
+
84
+ const mem = getUint8ArrayMemory0();
85
+
86
+ let offset = 0;
87
+
88
+ for (; offset < len; offset++) {
89
+ const code = arg.charCodeAt(offset);
90
+ if (code > 0x7F) break;
91
+ mem[ptr + offset] = code;
92
+ }
93
+
94
+ if (offset !== len) {
95
+ if (offset !== 0) {
96
+ arg = arg.slice(offset);
97
+ }
98
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
99
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
100
+ const ret = encodeString(arg, view);
101
+
102
+ offset += ret.written;
103
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
104
+ }
105
+
106
+ WASM_VECTOR_LEN = offset;
107
+ return ptr;
108
+ }
109
+
110
+ function isLikeNone(x) {
111
+ return x === undefined || x === null;
112
+ }
113
+
114
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
115
+ ? { register: () => {}, unregister: () => {} }
116
+ : new FinalizationRegistry(state => {
117
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b)
118
+ });
119
+
120
+ function makeMutClosure(arg0, arg1, dtor, f) {
121
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
122
+ const real = (...args) => {
123
+ // First up with a closure we increment the internal reference
124
+ // count. This ensures that the Rust closure environment won't
125
+ // be deallocated while we're invoking it.
126
+ state.cnt++;
127
+ const a = state.a;
128
+ state.a = 0;
129
+ try {
130
+ return f(a, state.b, ...args);
131
+ } finally {
132
+ if (--state.cnt === 0) {
133
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
134
+ CLOSURE_DTORS.unregister(state);
135
+ } else {
136
+ state.a = a;
137
+ }
138
+ }
139
+ };
140
+ real.original = state;
141
+ CLOSURE_DTORS.register(real, state, state);
142
+ return real;
143
+ }
144
+
145
+ function getArrayU8FromWasm0(ptr, len) {
146
+ ptr = ptr >>> 0;
147
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
148
+ }
149
+
150
+ function debugString(val) {
151
+ // primitive types
152
+ const type = typeof val;
153
+ if (type == 'number' || type == 'boolean' || val == null) {
154
+ return `${val}`;
155
+ }
156
+ if (type == 'string') {
157
+ return `"${val}"`;
158
+ }
159
+ if (type == 'symbol') {
160
+ const description = val.description;
161
+ if (description == null) {
162
+ return 'Symbol';
163
+ } else {
164
+ return `Symbol(${description})`;
165
+ }
166
+ }
167
+ if (type == 'function') {
168
+ const name = val.name;
169
+ if (typeof name == 'string' && name.length > 0) {
170
+ return `Function(${name})`;
171
+ } else {
172
+ return 'Function';
173
+ }
174
+ }
175
+ // objects
176
+ if (Array.isArray(val)) {
177
+ const length = val.length;
178
+ let debug = '[';
179
+ if (length > 0) {
180
+ debug += debugString(val[0]);
181
+ }
182
+ for(let i = 1; i < length; i++) {
183
+ debug += ', ' + debugString(val[i]);
184
+ }
185
+ debug += ']';
186
+ return debug;
187
+ }
188
+ // Test for built-in
189
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
190
+ let className;
191
+ if (builtInMatches && builtInMatches.length > 1) {
192
+ className = builtInMatches[1];
193
+ } else {
194
+ // Failed to match the standard '[object ClassName]'
195
+ return toString.call(val);
196
+ }
197
+ if (className == 'Object') {
198
+ // we're a user defined class or Object
199
+ // JSON.stringify avoids problems with cycles, and is generally much
200
+ // easier than looping through ownProperties of `val`.
201
+ try {
202
+ return 'Object(' + JSON.stringify(val) + ')';
203
+ } catch (_) {
204
+ return 'Object';
205
+ }
206
+ }
207
+ // errors
208
+ if (val instanceof Error) {
209
+ return `${val.name}: ${val.message}\n${val.stack}`;
210
+ }
211
+ // TODO we could test for more things here, like `Set`s and `Map`s.
212
+ return className;
213
+ }
214
+
215
+ function _assertClass(instance, klass) {
216
+ if (!(instance instanceof klass)) {
217
+ throw new Error(`expected instance of ${klass.name}`);
218
+ }
219
+ }
220
+
221
+ let cachedFloat32ArrayMemory0 = null;
222
+
223
+ function getFloat32ArrayMemory0() {
224
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
225
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
226
+ }
227
+ return cachedFloat32ArrayMemory0;
228
+ }
229
+
230
+ function passArrayF32ToWasm0(arg, malloc) {
231
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
232
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
233
+ WASM_VECTOR_LEN = arg.length;
234
+ return ptr;
235
+ }
236
+ function __wbg_adapter_18(arg0, arg1, arg2) {
237
+ wasm.closure71_externref_shim(arg0, arg1, arg2);
238
+ }
239
+
240
+ function __wbg_adapter_21(arg0, arg1, arg2) {
241
+ wasm.closure76_externref_shim(arg0, arg1, arg2);
242
+ }
243
+
244
+ function __wbg_adapter_72(arg0, arg1, arg2, arg3) {
245
+ wasm.closure92_externref_shim(arg0, arg1, arg2, arg3);
246
+ }
247
+
248
+ const ConfigFinalization = (typeof FinalizationRegistry === 'undefined')
249
+ ? { register: () => {}, unregister: () => {} }
250
+ : new FinalizationRegistry(ptr => wasm.__wbg_config_free(ptr >>> 0, 1));
251
+
252
+ export class Config {
253
+
254
+ static __wrap(ptr) {
255
+ ptr = ptr >>> 0;
256
+ const obj = Object.create(Config.prototype);
257
+ obj.__wbg_ptr = ptr;
258
+ ConfigFinalization.register(obj, obj.__wbg_ptr, obj);
259
+ return obj;
260
+ }
261
+
262
+ __destroy_into_raw() {
263
+ const ptr = this.__wbg_ptr;
264
+ this.__wbg_ptr = 0;
265
+ ConfigFinalization.unregister(this);
266
+ return ptr;
267
+ }
268
+
269
+ free() {
270
+ const ptr = this.__destroy_into_raw();
271
+ wasm.__wbg_config_free(ptr, 0);
272
+ }
273
+ /**
274
+ * @returns {number}
275
+ */
276
+ get sample_rate() {
277
+ const ret = wasm.__wbg_get_config_sample_rate(this.__wbg_ptr);
278
+ return ret;
279
+ }
280
+ /**
281
+ * @param {number} arg0
282
+ */
283
+ set sample_rate(arg0) {
284
+ wasm.__wbg_set_config_sample_rate(this.__wbg_ptr, arg0);
285
+ }
286
+ /**
287
+ * @returns {number}
288
+ */
289
+ get input_channels() {
290
+ const ret = wasm.__wbg_get_config_input_channels(this.__wbg_ptr);
291
+ return ret >>> 0;
292
+ }
293
+ /**
294
+ * @param {number} arg0
295
+ */
296
+ set input_channels(arg0) {
297
+ wasm.__wbg_set_config_input_channels(this.__wbg_ptr, arg0);
298
+ }
299
+ /**
300
+ * @returns {number}
301
+ */
302
+ get output_channels() {
303
+ const ret = wasm.__wbg_get_config_output_channels(this.__wbg_ptr);
304
+ return ret >>> 0;
305
+ }
306
+ /**
307
+ * @param {number} arg0
308
+ */
309
+ set output_channels(arg0) {
310
+ wasm.__wbg_set_config_output_channels(this.__wbg_ptr, arg0);
311
+ }
312
+ /**
313
+ * @returns {number}
314
+ */
315
+ get buffer_size() {
316
+ const ret = wasm.__wbg_get_config_buffer_size(this.__wbg_ptr);
317
+ return ret >>> 0;
318
+ }
319
+ /**
320
+ * @param {number} arg0
321
+ */
322
+ set buffer_size(arg0) {
323
+ wasm.__wbg_set_config_buffer_size(this.__wbg_ptr, arg0);
324
+ }
325
+ /**
326
+ * @returns {Config}
327
+ */
328
+ static new() {
329
+ const ret = wasm.config_new();
330
+ return Config.__wrap(ret);
331
+ }
332
+ }
333
+
334
+ const ContextFinalization = (typeof FinalizationRegistry === 'undefined')
335
+ ? { register: () => {}, unregister: () => {} }
336
+ : new FinalizationRegistry(ptr => wasm.__wbg_context_free(ptr >>> 0, 1));
337
+
338
+ export class Context {
339
+
340
+ __destroy_into_raw() {
341
+ const ptr = this.__wbg_ptr;
342
+ this.__wbg_ptr = 0;
343
+ ContextFinalization.unregister(this);
344
+ return ptr;
345
+ }
346
+
347
+ free() {
348
+ const ptr = this.__destroy_into_raw();
349
+ wasm.__wbg_context_free(ptr, 0);
350
+ }
351
+ /**
352
+ * @param {Config} config
353
+ */
354
+ constructor(config) {
355
+ _assertClass(config, Config);
356
+ var ptr0 = config.__destroy_into_raw();
357
+ const ret = wasm.context_new(ptr0);
358
+ this.__wbg_ptr = ret >>> 0;
359
+ ContextFinalization.register(this, this.__wbg_ptr, this);
360
+ return this;
361
+ }
362
+ /**
363
+ * @param {string} src
364
+ */
365
+ compile(src) {
366
+ const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
367
+ const len0 = WASM_VECTOR_LEN;
368
+ wasm.context_compile(this.__wbg_ptr, ptr0, len0);
369
+ }
370
+ /**
371
+ * @returns {number}
372
+ */
373
+ get_input_channels() {
374
+ const ret = wasm.context_get_input_channels(this.__wbg_ptr);
375
+ return ret >>> 0;
376
+ }
377
+ /**
378
+ * @returns {number}
379
+ */
380
+ get_output_channels() {
381
+ const ret = wasm.context_get_output_channels(this.__wbg_ptr);
382
+ return ret >>> 0;
383
+ }
384
+ /**
385
+ * .
386
+ *
387
+ * # Safety
388
+ * Array size of input and output must be equal to `input_channels * buffer_size` and `output_channels * buffer_size` respectively.
389
+ * .
390
+ * @param {Float32Array} input
391
+ * @param {Float32Array} output
392
+ * @returns {bigint}
393
+ */
394
+ process(input, output) {
395
+ const ptr0 = passArrayF32ToWasm0(input, wasm.__wbindgen_malloc);
396
+ const len0 = WASM_VECTOR_LEN;
397
+ var ptr1 = passArrayF32ToWasm0(output, wasm.__wbindgen_malloc);
398
+ var len1 = WASM_VECTOR_LEN;
399
+ const ret = wasm.context_process(this.__wbg_ptr, ptr0, len0, ptr1, len1, output);
400
+ return BigInt.asUintN(64, ret);
401
+ }
402
+ }
403
+
404
+ async function __wbg_load(module, imports) {
405
+ if (typeof Response === 'function' && module instanceof Response) {
406
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
407
+ try {
408
+ return await WebAssembly.instantiateStreaming(module, imports);
409
+
410
+ } catch (e) {
411
+ if (module.headers.get('Content-Type') != 'application/wasm') {
412
+ 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);
413
+
414
+ } else {
415
+ throw e;
416
+ }
417
+ }
418
+ }
419
+
420
+ const bytes = await module.arrayBuffer();
421
+ return await WebAssembly.instantiate(bytes, imports);
422
+
423
+ } else {
424
+ const instance = await WebAssembly.instantiate(module, imports);
425
+
426
+ if (instance instanceof WebAssembly.Instance) {
427
+ return { instance, module };
428
+
429
+ } else {
430
+ return instance;
431
+ }
432
+ }
433
+ }
434
+
435
+ function __wbg_get_imports() {
436
+ const imports = {};
437
+ imports.wbg = {};
438
+ imports.wbg.__wbg_call_b0d8e36992d9900d = function() { return handleError(function (arg0, arg1) {
439
+ const ret = arg0.call(arg1);
440
+ return ret;
441
+ }, arguments) };
442
+ imports.wbg.__wbg_data_d2ef8a36fe06fc0a = function() { return handleError(function (arg0, arg1) {
443
+ const ret = arg1.data;
444
+ const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
445
+ const len1 = WASM_VECTOR_LEN;
446
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
447
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
448
+ }, arguments) };
449
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
450
+ let deferred0_0;
451
+ let deferred0_1;
452
+ try {
453
+ deferred0_0 = arg0;
454
+ deferred0_1 = arg1;
455
+ console.error(getStringFromWasm0(arg0, arg1));
456
+ } finally {
457
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
458
+ }
459
+ };
460
+ imports.wbg.__wbg_forEach_960fd897546c2cc7 = function(arg0, arg1, arg2) {
461
+ try {
462
+ var state0 = {a: arg1, b: arg2};
463
+ var cb0 = (arg0, arg1) => {
464
+ const a = state0.a;
465
+ state0.a = 0;
466
+ try {
467
+ return __wbg_adapter_72(a, state0.b, arg0, arg1);
468
+ } finally {
469
+ state0.a = a;
470
+ }
471
+ };
472
+ arg0.forEach(cb0);
473
+ } finally {
474
+ state0.a = state0.b = 0;
475
+ }
476
+ };
477
+ imports.wbg.__wbg_id_342672fabcb69265 = function(arg0, arg1) {
478
+ const ret = arg1.id;
479
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
480
+ const len1 = WASM_VECTOR_LEN;
481
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
482
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
483
+ };
484
+ imports.wbg.__wbg_inputs_b38a2701063a9f19 = function(arg0) {
485
+ const ret = arg0.inputs;
486
+ return ret;
487
+ };
488
+ imports.wbg.__wbg_instanceof_MidiAccess_0a300b3304ef3202 = function(arg0) {
489
+ let result;
490
+ try {
491
+ result = arg0 instanceof MIDIAccess;
492
+ } catch (_) {
493
+ result = false;
494
+ }
495
+ const ret = result;
496
+ return ret;
497
+ };
498
+ imports.wbg.__wbg_instanceof_MidiInput_8847af17a1bd9e0a = function(arg0) {
499
+ let result;
500
+ try {
501
+ result = arg0 instanceof MIDIInput;
502
+ } catch (_) {
503
+ result = false;
504
+ }
505
+ const ret = result;
506
+ return ret;
507
+ };
508
+ imports.wbg.__wbg_instanceof_Window_d2514c6a7ee7ba60 = function(arg0) {
509
+ let result;
510
+ try {
511
+ result = arg0 instanceof Window;
512
+ } catch (_) {
513
+ result = false;
514
+ }
515
+ const ret = result;
516
+ return ret;
517
+ };
518
+ imports.wbg.__wbg_name_476a3f59d488a92a = function(arg0, arg1) {
519
+ const ret = arg1.name;
520
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
521
+ var len1 = WASM_VECTOR_LEN;
522
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
523
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
524
+ };
525
+ imports.wbg.__wbg_navigator_0fe968937104eaa7 = function(arg0) {
526
+ const ret = arg0.navigator;
527
+ return ret;
528
+ };
529
+ imports.wbg.__wbg_new_688846f374351c92 = function() {
530
+ const ret = new Object();
531
+ return ret;
532
+ };
533
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
534
+ const ret = new Error();
535
+ return ret;
536
+ };
537
+ imports.wbg.__wbg_newnoargs_fd9e4bf8be2bc16d = function(arg0, arg1) {
538
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
539
+ return ret;
540
+ };
541
+ imports.wbg.__wbg_open_bad7415c7076f4d4 = function(arg0) {
542
+ const ret = arg0.open();
543
+ return ret;
544
+ };
545
+ imports.wbg.__wbg_readfile_1ef6cb22ab5269df = function() { return handleError(function (arg0, arg1, arg2) {
546
+ const ret = read_file(getStringFromWasm0(arg1, arg2));
547
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
548
+ const len1 = WASM_VECTOR_LEN;
549
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
550
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
551
+ }, arguments) };
552
+ imports.wbg.__wbg_requestMIDIAccess_e5de2909f77fdf72 = function() { return handleError(function (arg0, arg1) {
553
+ const ret = arg0.requestMIDIAccess(arg1);
554
+ return ret;
555
+ }, arguments) };
556
+ imports.wbg.__wbg_setonmidimessage_cc963fd52d629fb2 = function(arg0, arg1) {
557
+ arg0.onmidimessage = arg1;
558
+ };
559
+ imports.wbg.__wbg_setsysex_634999d73a9f19a9 = function(arg0, arg1) {
560
+ arg0.sysex = arg1 !== 0;
561
+ };
562
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
563
+ const ret = arg1.stack;
564
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
565
+ const len1 = WASM_VECTOR_LEN;
566
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
567
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
568
+ };
569
+ imports.wbg.__wbg_static_accessor_GLOBAL_0be7472e492ad3e3 = function() {
570
+ const ret = typeof global === 'undefined' ? null : global;
571
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
572
+ };
573
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_1a6eb482d12c9bfb = function() {
574
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
575
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
576
+ };
577
+ imports.wbg.__wbg_static_accessor_SELF_1dc398a895c82351 = function() {
578
+ const ret = typeof self === 'undefined' ? null : self;
579
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
580
+ };
581
+ imports.wbg.__wbg_static_accessor_WINDOW_ae1c80c7eea8d64a = function() {
582
+ const ret = typeof window === 'undefined' ? null : window;
583
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
584
+ };
585
+ imports.wbg.__wbg_then_0ffafeddf0e182a4 = function(arg0, arg1, arg2) {
586
+ const ret = arg0.then(arg1, arg2);
587
+ return ret;
588
+ };
589
+ imports.wbg.__wbg_timeStamp_0aab179f39f96348 = function(arg0) {
590
+ const ret = arg0.timeStamp;
591
+ return ret;
592
+ };
593
+ imports.wbg.__wbindgen_cb_drop = function(arg0) {
594
+ const obj = arg0.original;
595
+ if (obj.cnt-- == 1) {
596
+ obj.a = 0;
597
+ return true;
598
+ }
599
+ const ret = false;
600
+ return ret;
601
+ };
602
+ imports.wbg.__wbindgen_closure_wrapper183 = function(arg0, arg1, arg2) {
603
+ const ret = makeMutClosure(arg0, arg1, 72, __wbg_adapter_18);
604
+ return ret;
605
+ };
606
+ imports.wbg.__wbindgen_closure_wrapper196 = function(arg0, arg1, arg2) {
607
+ const ret = makeMutClosure(arg0, arg1, 77, __wbg_adapter_21);
608
+ return ret;
609
+ };
610
+ imports.wbg.__wbindgen_copy_to_typed_array = function(arg0, arg1, arg2) {
611
+ new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));
612
+ };
613
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
614
+ const ret = debugString(arg1);
615
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
616
+ const len1 = WASM_VECTOR_LEN;
617
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
618
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
619
+ };
620
+ imports.wbg.__wbindgen_init_externref_table = function() {
621
+ const table = wasm.__wbindgen_export_2;
622
+ const offset = table.grow(4);
623
+ table.set(0, undefined);
624
+ table.set(offset + 0, undefined);
625
+ table.set(offset + 1, null);
626
+ table.set(offset + 2, true);
627
+ table.set(offset + 3, false);
628
+ ;
629
+ };
630
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
631
+ const ret = arg0 === undefined;
632
+ return ret;
633
+ };
634
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
635
+ throw new Error(getStringFromWasm0(arg0, arg1));
636
+ };
637
+
638
+ return imports;
639
+ }
640
+
641
+ function __wbg_init_memory(imports, memory) {
642
+
643
+ }
644
+
645
+ function __wbg_finalize_init(instance, module) {
646
+ wasm = instance.exports;
647
+ __wbg_init.__wbindgen_wasm_module = module;
648
+ cachedDataViewMemory0 = null;
649
+ cachedFloat32ArrayMemory0 = null;
650
+ cachedUint8ArrayMemory0 = null;
651
+
652
+
653
+ wasm.__wbindgen_start();
654
+ return wasm;
655
+ }
656
+
657
+ function initSync(module) {
658
+ if (wasm !== undefined) return wasm;
659
+
660
+
661
+ if (typeof module !== 'undefined') {
662
+ if (Object.getPrototypeOf(module) === Object.prototype) {
663
+ ({module} = module)
664
+ } else {
665
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
666
+ }
667
+ }
668
+
669
+ const imports = __wbg_get_imports();
670
+
671
+ __wbg_init_memory(imports);
672
+
673
+ if (!(module instanceof WebAssembly.Module)) {
674
+ module = new WebAssembly.Module(module);
675
+ }
676
+
677
+ const instance = new WebAssembly.Instance(module, imports);
678
+
679
+ return __wbg_finalize_init(instance, module);
680
+ }
681
+
682
+ async function __wbg_init(module_or_path) {
683
+ if (wasm !== undefined) return wasm;
684
+
685
+
686
+ if (typeof module_or_path !== 'undefined') {
687
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
688
+ ({module_or_path} = module_or_path)
689
+ } else {
690
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
691
+ }
692
+ }
693
+
694
+ if (typeof module_or_path === 'undefined') {
695
+ module_or_path = new URL('mimium_web_bg.wasm', import.meta.url);
696
+ }
697
+ const imports = __wbg_get_imports();
698
+
699
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
700
+ module_or_path = fetch(module_or_path);
701
+ }
702
+
703
+ __wbg_init_memory(imports);
704
+
705
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
706
+
707
+ return __wbg_finalize_init(instance, module);
708
+ }
709
+
710
+ export { initSync };
711
+ export default __wbg_init;
Binary file