@denisecase/mandart-wasm 0.0.0-stage → 0.2.0
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/CITATION.cff +66 -0
- package/LICENSE +202 -0
- package/NOTICE +21 -0
- package/README.md +363 -2
- package/mandart_wasm.d.ts +253 -0
- package/mandart_wasm.js +956 -0
- package/mandart_wasm_bg.wasm +0 -0
- package/mandart_wasm_bg.wasm.d.ts +54 -0
- package/package.json +34 -4
- package/verification/numerical-agreement.json +1 -0
package/mandart_wasm.js
ADDED
|
@@ -0,0 +1,956 @@
|
|
|
1
|
+
/* @ts-self-types="./mandart_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents color inputs in a WASM-compatible structure
|
|
5
|
+
*/
|
|
6
|
+
export class JsArtImageColorInputs {
|
|
7
|
+
__destroy_into_raw() {
|
|
8
|
+
const ptr = this.__wbg_ptr;
|
|
9
|
+
this.__wbg_ptr = 0;
|
|
10
|
+
JsArtImageColorInputsFinalization.unregister(this);
|
|
11
|
+
return ptr;
|
|
12
|
+
}
|
|
13
|
+
free() {
|
|
14
|
+
const ptr = this.__destroy_into_raw();
|
|
15
|
+
wasm.__wbg_jsartimagecolorinputs_free(ptr, 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @returns {number}
|
|
19
|
+
*/
|
|
20
|
+
get n_blocks() {
|
|
21
|
+
const ret = wasm.__wbg_get_jsartimagecolorinputs_n_blocks(this.__wbg_ptr);
|
|
22
|
+
return ret >>> 0;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @returns {number}
|
|
26
|
+
*/
|
|
27
|
+
get n_colors() {
|
|
28
|
+
const ret = wasm.__wbg_get_jsartimagecolorinputs_n_colors(this.__wbg_ptr);
|
|
29
|
+
return ret >>> 0;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @returns {number}
|
|
33
|
+
*/
|
|
34
|
+
get spacing_color_far() {
|
|
35
|
+
const ret = wasm.__wbg_get_jsartimagecolorinputs_spacing_color_far(this.__wbg_ptr);
|
|
36
|
+
return ret;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @returns {number}
|
|
40
|
+
*/
|
|
41
|
+
get spacing_color_near() {
|
|
42
|
+
const ret = wasm.__wbg_get_jsartimagecolorinputs_spacing_color_near(this.__wbg_ptr);
|
|
43
|
+
return ret;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @returns {number}
|
|
47
|
+
*/
|
|
48
|
+
get y_y_input() {
|
|
49
|
+
const ret = wasm.__wbg_get_jsartimagecolorinputs_y_y_input(this.__wbg_ptr);
|
|
50
|
+
return ret;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get mand_color as Float64Array
|
|
54
|
+
* @returns {Float64Array}
|
|
55
|
+
*/
|
|
56
|
+
get mand_color() {
|
|
57
|
+
const ret = wasm.jsartimagecolorinputs_mand_color(this.__wbg_ptr);
|
|
58
|
+
return ret;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @param {number} n_blocks
|
|
62
|
+
* @param {number} n_colors
|
|
63
|
+
* @param {number} spacing_color_far
|
|
64
|
+
* @param {number} spacing_color_near
|
|
65
|
+
* @param {number} y_y_input
|
|
66
|
+
* @param {Float64Array} mand_color_js
|
|
67
|
+
* @param {Array<any>} colors_js
|
|
68
|
+
* @param {Array<any>} hues_js
|
|
69
|
+
*/
|
|
70
|
+
constructor(n_blocks, n_colors, spacing_color_far, spacing_color_near, y_y_input, mand_color_js, colors_js, hues_js) {
|
|
71
|
+
const ret = wasm.jsartimagecolorinputs_new(n_blocks, n_colors, spacing_color_far, spacing_color_near, y_y_input, mand_color_js, colors_js, hues_js);
|
|
72
|
+
if (ret[2]) {
|
|
73
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
74
|
+
}
|
|
75
|
+
this.__wbg_ptr = ret[0];
|
|
76
|
+
JsArtImageColorInputsFinalization.register(this, this.__wbg_ptr, this);
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Set mand_color from Float64Array
|
|
81
|
+
* @param {Float64Array} value
|
|
82
|
+
*/
|
|
83
|
+
set mand_color(value) {
|
|
84
|
+
wasm.jsartimagecolorinputs_set_mand_color(this.__wbg_ptr, value);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @param {number} arg0
|
|
88
|
+
*/
|
|
89
|
+
set n_blocks(arg0) {
|
|
90
|
+
wasm.__wbg_set_jsartimagecolorinputs_n_blocks(this.__wbg_ptr, arg0);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @param {number} arg0
|
|
94
|
+
*/
|
|
95
|
+
set n_colors(arg0) {
|
|
96
|
+
wasm.__wbg_set_jsartimagecolorinputs_n_colors(this.__wbg_ptr, arg0);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @param {number} arg0
|
|
100
|
+
*/
|
|
101
|
+
set spacing_color_far(arg0) {
|
|
102
|
+
wasm.__wbg_set_jsartimagecolorinputs_spacing_color_far(this.__wbg_ptr, arg0);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @param {number} arg0
|
|
106
|
+
*/
|
|
107
|
+
set spacing_color_near(arg0) {
|
|
108
|
+
wasm.__wbg_set_jsartimagecolorinputs_spacing_color_near(this.__wbg_ptr, arg0);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @param {number} arg0
|
|
112
|
+
*/
|
|
113
|
+
set y_y_input(arg0) {
|
|
114
|
+
wasm.__wbg_set_jsartimagecolorinputs_y_y_input(this.__wbg_ptr, arg0);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (Symbol.dispose) JsArtImageColorInputs.prototype[Symbol.dispose] = JsArtImageColorInputs.prototype.free;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Represents shape inputs in a WASM-compatible structure
|
|
121
|
+
*/
|
|
122
|
+
export class JsArtImageShapeInputs {
|
|
123
|
+
__destroy_into_raw() {
|
|
124
|
+
const ptr = this.__wbg_ptr;
|
|
125
|
+
this.__wbg_ptr = 0;
|
|
126
|
+
JsArtImageShapeInputsFinalization.unregister(this);
|
|
127
|
+
return ptr;
|
|
128
|
+
}
|
|
129
|
+
free() {
|
|
130
|
+
const ptr = this.__destroy_into_raw();
|
|
131
|
+
wasm.__wbg_jsartimageshapeinputs_free(ptr, 0);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @returns {number}
|
|
135
|
+
*/
|
|
136
|
+
get d_f_iter_min() {
|
|
137
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_d_f_iter_min(this.__wbg_ptr);
|
|
138
|
+
return ret;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @returns {number}
|
|
142
|
+
*/
|
|
143
|
+
get image_height() {
|
|
144
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_image_height(this.__wbg_ptr);
|
|
145
|
+
return ret >>> 0;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* @returns {number}
|
|
149
|
+
*/
|
|
150
|
+
get image_width() {
|
|
151
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_image_width(this.__wbg_ptr);
|
|
152
|
+
return ret >>> 0;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @returns {number}
|
|
156
|
+
*/
|
|
157
|
+
get iterations_max() {
|
|
158
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_iterations_max(this.__wbg_ptr);
|
|
159
|
+
return ret;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @returns {number}
|
|
163
|
+
*/
|
|
164
|
+
get mand_power_real() {
|
|
165
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_mand_power_real(this.__wbg_ptr);
|
|
166
|
+
return ret;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* @returns {number}
|
|
170
|
+
*/
|
|
171
|
+
get r_sq_limit() {
|
|
172
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_r_sq_limit(this.__wbg_ptr);
|
|
173
|
+
return ret;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* @returns {number}
|
|
177
|
+
*/
|
|
178
|
+
get scale() {
|
|
179
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_scale(this.__wbg_ptr);
|
|
180
|
+
return ret;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* @returns {number}
|
|
184
|
+
*/
|
|
185
|
+
get theta() {
|
|
186
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_theta(this.__wbg_ptr);
|
|
187
|
+
return ret;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* @returns {number}
|
|
191
|
+
*/
|
|
192
|
+
get x_center() {
|
|
193
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_x_center(this.__wbg_ptr);
|
|
194
|
+
return ret;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* @returns {number}
|
|
198
|
+
*/
|
|
199
|
+
get y_center() {
|
|
200
|
+
const ret = wasm.__wbg_get_jsartimageshapeinputs_y_center(this.__wbg_ptr);
|
|
201
|
+
return ret;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* @param {number} image_width
|
|
205
|
+
* @param {number} image_height
|
|
206
|
+
* @param {number} iterations_max
|
|
207
|
+
* @param {number} scale
|
|
208
|
+
* @param {number} x_center
|
|
209
|
+
* @param {number} y_center
|
|
210
|
+
* @param {number} theta
|
|
211
|
+
* @param {number} r_sq_limit
|
|
212
|
+
* @param {number} mand_power_real
|
|
213
|
+
* @param {number} d_f_iter_min
|
|
214
|
+
*/
|
|
215
|
+
constructor(image_width, image_height, iterations_max, scale, x_center, y_center, theta, r_sq_limit, mand_power_real, d_f_iter_min) {
|
|
216
|
+
const ret = wasm.jsartimageshapeinputs_new(image_width, image_height, iterations_max, scale, x_center, y_center, theta, r_sq_limit, mand_power_real, d_f_iter_min);
|
|
217
|
+
this.__wbg_ptr = ret;
|
|
218
|
+
JsArtImageShapeInputsFinalization.register(this, this.__wbg_ptr, this);
|
|
219
|
+
return this;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* @param {number} arg0
|
|
223
|
+
*/
|
|
224
|
+
set d_f_iter_min(arg0) {
|
|
225
|
+
wasm.__wbg_set_jsartimageshapeinputs_d_f_iter_min(this.__wbg_ptr, arg0);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @param {number} arg0
|
|
229
|
+
*/
|
|
230
|
+
set image_height(arg0) {
|
|
231
|
+
wasm.__wbg_set_jsartimageshapeinputs_image_height(this.__wbg_ptr, arg0);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* @param {number} arg0
|
|
235
|
+
*/
|
|
236
|
+
set image_width(arg0) {
|
|
237
|
+
wasm.__wbg_set_jsartimageshapeinputs_image_width(this.__wbg_ptr, arg0);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* @param {number} arg0
|
|
241
|
+
*/
|
|
242
|
+
set iterations_max(arg0) {
|
|
243
|
+
wasm.__wbg_set_jsartimageshapeinputs_iterations_max(this.__wbg_ptr, arg0);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* @param {number} arg0
|
|
247
|
+
*/
|
|
248
|
+
set mand_power_real(arg0) {
|
|
249
|
+
wasm.__wbg_set_jsartimageshapeinputs_mand_power_real(this.__wbg_ptr, arg0);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* @param {number} arg0
|
|
253
|
+
*/
|
|
254
|
+
set r_sq_limit(arg0) {
|
|
255
|
+
wasm.__wbg_set_jsartimageshapeinputs_r_sq_limit(this.__wbg_ptr, arg0);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* @param {number} arg0
|
|
259
|
+
*/
|
|
260
|
+
set scale(arg0) {
|
|
261
|
+
wasm.__wbg_set_jsartimageshapeinputs_scale(this.__wbg_ptr, arg0);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* @param {number} arg0
|
|
265
|
+
*/
|
|
266
|
+
set theta(arg0) {
|
|
267
|
+
wasm.__wbg_set_jsartimageshapeinputs_theta(this.__wbg_ptr, arg0);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @param {number} arg0
|
|
271
|
+
*/
|
|
272
|
+
set x_center(arg0) {
|
|
273
|
+
wasm.__wbg_set_jsartimageshapeinputs_x_center(this.__wbg_ptr, arg0);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* @param {number} arg0
|
|
277
|
+
*/
|
|
278
|
+
set y_center(arg0) {
|
|
279
|
+
wasm.__wbg_set_jsartimageshapeinputs_y_center(this.__wbg_ptr, arg0);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (Symbol.dispose) JsArtImageShapeInputs.prototype[Symbol.dispose] = JsArtImageShapeInputs.prototype.free;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* **WASM API: Clear the grid cache**
|
|
286
|
+
*
|
|
287
|
+
* This function allows clients to explicitly clear the grid cache,
|
|
288
|
+
* which might be useful for low-memory situations.
|
|
289
|
+
*
|
|
290
|
+
* # Returns
|
|
291
|
+
* * The number of cache entries that were cleared
|
|
292
|
+
* @returns {number}
|
|
293
|
+
*/
|
|
294
|
+
export function api_clear_grid_cache() {
|
|
295
|
+
const ret = wasm.api_clear_grid_cache();
|
|
296
|
+
return ret >>> 0;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* **WASM API: Compute a Mandelbrot grid from shape inputs**
|
|
301
|
+
*
|
|
302
|
+
* Takes shape inputs from JavaScript and returns a 2D grid of iteration values.
|
|
303
|
+
*
|
|
304
|
+
* # Arguments
|
|
305
|
+
* * `js_inputs` - Shape inputs in JavaScript format
|
|
306
|
+
*
|
|
307
|
+
* # Returns
|
|
308
|
+
* * A 2D array of iteration values as a JsValue
|
|
309
|
+
* @param {any} js_inputs
|
|
310
|
+
* @returns {any}
|
|
311
|
+
*/
|
|
312
|
+
export function api_get_grid_from_shape_inputs(js_inputs) {
|
|
313
|
+
const ret = wasm.api_get_grid_from_shape_inputs(js_inputs);
|
|
314
|
+
if (ret[2]) {
|
|
315
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
316
|
+
}
|
|
317
|
+
return takeFromExternrefTable0(ret[0]);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* **WASM API: Generate an image directly from shape and color inputs**
|
|
322
|
+
*
|
|
323
|
+
* This function optimizes performance by caching uncolored grids and
|
|
324
|
+
* reusing them when possible.
|
|
325
|
+
*
|
|
326
|
+
* # Arguments
|
|
327
|
+
* * `js_shape_inputs` - Shape inputs in JavaScript format
|
|
328
|
+
* * `js_color_inputs` - Color inputs in JavaScript format
|
|
329
|
+
*
|
|
330
|
+
* # Returns
|
|
331
|
+
* * An image data structure as a JsValue
|
|
332
|
+
* @param {any} js_shape_inputs
|
|
333
|
+
* @param {any} js_color_inputs
|
|
334
|
+
* @returns {any}
|
|
335
|
+
*/
|
|
336
|
+
export function api_get_image_from_inputs(js_shape_inputs, js_color_inputs) {
|
|
337
|
+
const ret = wasm.api_get_image_from_inputs(js_shape_inputs, js_color_inputs);
|
|
338
|
+
if (ret[2]) {
|
|
339
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
340
|
+
}
|
|
341
|
+
return takeFromExternrefTable0(ret[0]);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* @param {string} picdef_json
|
|
346
|
+
* @returns {any}
|
|
347
|
+
*/
|
|
348
|
+
export function api_get_inputs_from_picdef_string(picdef_json) {
|
|
349
|
+
const ptr0 = passStringToWasm0(picdef_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
350
|
+
const len0 = WASM_VECTOR_LEN;
|
|
351
|
+
const ret = wasm.api_get_inputs_from_picdef_string(ptr0, len0);
|
|
352
|
+
return ret;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Returns version information about the MandArt library
|
|
357
|
+
* @returns {string}
|
|
358
|
+
*/
|
|
359
|
+
export function api_get_version() {
|
|
360
|
+
let deferred1_0;
|
|
361
|
+
let deferred1_1;
|
|
362
|
+
try {
|
|
363
|
+
const ret = wasm.api_get_version();
|
|
364
|
+
deferred1_0 = ret[0];
|
|
365
|
+
deferred1_1 = ret[1];
|
|
366
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
367
|
+
} finally {
|
|
368
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Exposes `load_or_compute_default_grid()` to JavaScript.
|
|
374
|
+
* @returns {Float64Array}
|
|
375
|
+
*/
|
|
376
|
+
export function api_load_or_compute_default_grid() {
|
|
377
|
+
const ret = wasm.api_load_or_compute_default_grid();
|
|
378
|
+
if (ret[2]) {
|
|
379
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
380
|
+
}
|
|
381
|
+
return takeFromExternrefTable0(ret[0]);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export function init() {
|
|
385
|
+
wasm.init();
|
|
386
|
+
}
|
|
387
|
+
function __wbg_get_imports() {
|
|
388
|
+
const import0 = {
|
|
389
|
+
__proto__: null,
|
|
390
|
+
__wbg_Error_208446807d0d1e30: function(arg0, arg1) {
|
|
391
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
392
|
+
return ret;
|
|
393
|
+
},
|
|
394
|
+
__wbg_Number_ff192a72a0dcdf6d: function(arg0) {
|
|
395
|
+
const ret = Number(arg0);
|
|
396
|
+
return ret;
|
|
397
|
+
},
|
|
398
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
399
|
+
const ret = String(arg1);
|
|
400
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
401
|
+
const len1 = WASM_VECTOR_LEN;
|
|
402
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
403
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
404
|
+
},
|
|
405
|
+
__wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef: function(arg0, arg1) {
|
|
406
|
+
const v = arg1;
|
|
407
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
408
|
+
getDataViewMemory0().setBigInt64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
409
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
|
|
410
|
+
},
|
|
411
|
+
__wbg___wbindgen_boolean_get_4f1baf9a00be3c74: function(arg0) {
|
|
412
|
+
const v = arg0;
|
|
413
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
414
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
415
|
+
},
|
|
416
|
+
__wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
|
|
417
|
+
const ret = debugString(arg1);
|
|
418
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
419
|
+
const len1 = WASM_VECTOR_LEN;
|
|
420
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
421
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
422
|
+
},
|
|
423
|
+
__wbg___wbindgen_in_3f58a9d3b3a7eed2: function(arg0, arg1) {
|
|
424
|
+
const ret = arg0 in arg1;
|
|
425
|
+
return ret;
|
|
426
|
+
},
|
|
427
|
+
__wbg___wbindgen_is_bigint_5fa10641e039d3ef: function(arg0) {
|
|
428
|
+
const ret = typeof(arg0) === 'bigint';
|
|
429
|
+
return ret;
|
|
430
|
+
},
|
|
431
|
+
__wbg___wbindgen_is_function_741ff2bb612836f5: function(arg0) {
|
|
432
|
+
const ret = typeof(arg0) === 'function';
|
|
433
|
+
return ret;
|
|
434
|
+
},
|
|
435
|
+
__wbg___wbindgen_is_object_8b968c3ab8e96595: function(arg0) {
|
|
436
|
+
const val = arg0;
|
|
437
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
438
|
+
return ret;
|
|
439
|
+
},
|
|
440
|
+
__wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
|
|
441
|
+
const ret = arg0 === undefined;
|
|
442
|
+
return ret;
|
|
443
|
+
},
|
|
444
|
+
__wbg___wbindgen_jsval_eq_38d7bfbe4cc84039: function(arg0, arg1) {
|
|
445
|
+
const ret = arg0 === arg1;
|
|
446
|
+
return ret;
|
|
447
|
+
},
|
|
448
|
+
__wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36: function(arg0, arg1) {
|
|
449
|
+
const ret = arg0 == arg1;
|
|
450
|
+
return ret;
|
|
451
|
+
},
|
|
452
|
+
__wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
|
|
453
|
+
const obj = arg1;
|
|
454
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
455
|
+
getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
456
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
|
|
457
|
+
},
|
|
458
|
+
__wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
|
|
459
|
+
const obj = arg1;
|
|
460
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
461
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
462
|
+
var len1 = WASM_VECTOR_LEN;
|
|
463
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
464
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
465
|
+
},
|
|
466
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
467
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
468
|
+
},
|
|
469
|
+
__wbg_call_40b008ba32f73991: function() { return handleError(function (arg0, arg1) {
|
|
470
|
+
const ret = arg0.call(arg1);
|
|
471
|
+
return ret;
|
|
472
|
+
}, arguments); },
|
|
473
|
+
__wbg_debug_29e5044b8c3730bb: function(arg0) {
|
|
474
|
+
console.debug(arg0);
|
|
475
|
+
},
|
|
476
|
+
__wbg_done_57e08d0be6e30c02: function(arg0) {
|
|
477
|
+
const ret = arg0.done;
|
|
478
|
+
return ret;
|
|
479
|
+
},
|
|
480
|
+
__wbg_error_757e9472f8410341: function(arg0, arg1) {
|
|
481
|
+
let deferred0_0;
|
|
482
|
+
let deferred0_1;
|
|
483
|
+
try {
|
|
484
|
+
deferred0_0 = arg0;
|
|
485
|
+
deferred0_1 = arg1;
|
|
486
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
487
|
+
} finally {
|
|
488
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
__wbg_error_d1fc0193610e0e39: function(arg0) {
|
|
492
|
+
console.error(arg0);
|
|
493
|
+
},
|
|
494
|
+
__wbg_get_635eea311fa1a291: function() { return handleError(function (arg0, arg1) {
|
|
495
|
+
const ret = Reflect.get(arg0, arg1);
|
|
496
|
+
return ret;
|
|
497
|
+
}, arguments); },
|
|
498
|
+
__wbg_get_d7176cfb76d71114: function(arg0, arg1) {
|
|
499
|
+
const ret = arg0[arg1 >>> 0];
|
|
500
|
+
return ret;
|
|
501
|
+
},
|
|
502
|
+
__wbg_get_index_4b7ea14f5ecf64df: function(arg0, arg1) {
|
|
503
|
+
const ret = arg0[arg1 >>> 0];
|
|
504
|
+
return ret;
|
|
505
|
+
},
|
|
506
|
+
__wbg_get_unchecked_e6325ad374eff861: function(arg0, arg1) {
|
|
507
|
+
const ret = arg0[arg1 >>> 0];
|
|
508
|
+
return ret;
|
|
509
|
+
},
|
|
510
|
+
__wbg_get_with_ref_key_fc601247060b7204: function(arg0, arg1) {
|
|
511
|
+
const ret = arg0[arg1];
|
|
512
|
+
return ret;
|
|
513
|
+
},
|
|
514
|
+
__wbg_info_ef9e889444913d2f: function(arg0) {
|
|
515
|
+
console.info(arg0);
|
|
516
|
+
},
|
|
517
|
+
__wbg_instanceof_ArrayBuffer_12cdaa4161423e6b: function(arg0) {
|
|
518
|
+
let result;
|
|
519
|
+
try {
|
|
520
|
+
result = arg0 instanceof ArrayBuffer;
|
|
521
|
+
} catch (_) {
|
|
522
|
+
result = false;
|
|
523
|
+
}
|
|
524
|
+
const ret = result;
|
|
525
|
+
return ret;
|
|
526
|
+
},
|
|
527
|
+
__wbg_instanceof_Uint8Array_d7aeb0dcb3108fea: function(arg0) {
|
|
528
|
+
let result;
|
|
529
|
+
try {
|
|
530
|
+
result = arg0 instanceof Uint8Array;
|
|
531
|
+
} catch (_) {
|
|
532
|
+
result = false;
|
|
533
|
+
}
|
|
534
|
+
const ret = result;
|
|
535
|
+
return ret;
|
|
536
|
+
},
|
|
537
|
+
__wbg_isArray_bcf1376d0d732d08: function(arg0) {
|
|
538
|
+
const ret = Array.isArray(arg0);
|
|
539
|
+
return ret;
|
|
540
|
+
},
|
|
541
|
+
__wbg_isSafeInteger_1a35ba4d31e71d38: function(arg0) {
|
|
542
|
+
const ret = Number.isSafeInteger(arg0);
|
|
543
|
+
return ret;
|
|
544
|
+
},
|
|
545
|
+
__wbg_iterator_e4c5e8f68ada7b58: function() {
|
|
546
|
+
const ret = Symbol.iterator;
|
|
547
|
+
return ret;
|
|
548
|
+
},
|
|
549
|
+
__wbg_length_186163212ffe79c3: function(arg0) {
|
|
550
|
+
const ret = arg0.length;
|
|
551
|
+
return ret;
|
|
552
|
+
},
|
|
553
|
+
__wbg_length_5a8bb8abe1e54e15: function(arg0) {
|
|
554
|
+
const ret = arg0.length;
|
|
555
|
+
return ret;
|
|
556
|
+
},
|
|
557
|
+
__wbg_length_b03a0fabb109b1e9: function(arg0) {
|
|
558
|
+
const ret = arg0.length;
|
|
559
|
+
return ret;
|
|
560
|
+
},
|
|
561
|
+
__wbg_log_ff86bbb34c295e21: function(arg0) {
|
|
562
|
+
console.log(arg0);
|
|
563
|
+
},
|
|
564
|
+
__wbg_new_13de428334042d26: function(arg0) {
|
|
565
|
+
const ret = new Uint8Array(arg0);
|
|
566
|
+
return ret;
|
|
567
|
+
},
|
|
568
|
+
__wbg_new_37eb45aaf5eeb820: function() {
|
|
569
|
+
const ret = new Array();
|
|
570
|
+
return ret;
|
|
571
|
+
},
|
|
572
|
+
__wbg_new_bb74001155cb8ca8: function() {
|
|
573
|
+
const ret = new Error();
|
|
574
|
+
return ret;
|
|
575
|
+
},
|
|
576
|
+
__wbg_new_cd4348290afae586: function() {
|
|
577
|
+
const ret = new Object();
|
|
578
|
+
return ret;
|
|
579
|
+
},
|
|
580
|
+
__wbg_new_from_slice_aaf85a9746711968: function(arg0, arg1) {
|
|
581
|
+
const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
|
|
582
|
+
return ret;
|
|
583
|
+
},
|
|
584
|
+
__wbg_new_with_length_07edd8a7019b8c30: function(arg0) {
|
|
585
|
+
const ret = new Float64Array(arg0 >>> 0);
|
|
586
|
+
return ret;
|
|
587
|
+
},
|
|
588
|
+
__wbg_next_178c1651c11432b3: function(arg0) {
|
|
589
|
+
const ret = arg0.next;
|
|
590
|
+
return ret;
|
|
591
|
+
},
|
|
592
|
+
__wbg_next_af5ac6a08bb0a717: function() { return handleError(function (arg0) {
|
|
593
|
+
const ret = arg0.next();
|
|
594
|
+
return ret;
|
|
595
|
+
}, arguments); },
|
|
596
|
+
__wbg_prototypesetcall_13162965d1fe7aa3: function(arg0, arg1, arg2) {
|
|
597
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
598
|
+
},
|
|
599
|
+
__wbg_set_59dc36dce85e2698: function(arg0, arg1, arg2) {
|
|
600
|
+
arg0.set(getArrayF64FromWasm0(arg1, arg2));
|
|
601
|
+
},
|
|
602
|
+
__wbg_set_d2d33b52458e984a: function(arg0, arg1, arg2) {
|
|
603
|
+
arg0[arg1 >>> 0] = arg2;
|
|
604
|
+
},
|
|
605
|
+
__wbg_set_e4b9a833d288759a: function(arg0, arg1, arg2) {
|
|
606
|
+
arg0[arg1] = arg2;
|
|
607
|
+
},
|
|
608
|
+
__wbg_stack_575c4e0918581b9c: function(arg0, arg1) {
|
|
609
|
+
const ret = arg1.stack;
|
|
610
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
611
|
+
const len1 = WASM_VECTOR_LEN;
|
|
612
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
613
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
614
|
+
},
|
|
615
|
+
__wbg_valueOf_6db341d77a0b1da4: function(arg0) {
|
|
616
|
+
const ret = arg0.valueOf();
|
|
617
|
+
return ret;
|
|
618
|
+
},
|
|
619
|
+
__wbg_value_e0f328965e184931: function(arg0) {
|
|
620
|
+
const ret = arg0.value;
|
|
621
|
+
return ret;
|
|
622
|
+
},
|
|
623
|
+
__wbg_warn_228ff2257384d295: function(arg0) {
|
|
624
|
+
console.warn(arg0);
|
|
625
|
+
},
|
|
626
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
627
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
628
|
+
const ret = arg0;
|
|
629
|
+
return ret;
|
|
630
|
+
},
|
|
631
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
632
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
633
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
634
|
+
return ret;
|
|
635
|
+
},
|
|
636
|
+
__wbindgen_generic_0000000000000003: function(arg0) {
|
|
637
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
638
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
639
|
+
return ret;
|
|
640
|
+
},
|
|
641
|
+
__wbindgen_init_externref_table: function() {
|
|
642
|
+
const table = wasm.__wbindgen_externrefs;
|
|
643
|
+
table.set(0, undefined);
|
|
644
|
+
table.set(1024, undefined);
|
|
645
|
+
table.set(1025, null);
|
|
646
|
+
table.set(1026, true);
|
|
647
|
+
table.set(1027, false);
|
|
648
|
+
},
|
|
649
|
+
};
|
|
650
|
+
return {
|
|
651
|
+
__proto__: null,
|
|
652
|
+
"./mandart_wasm_bg.js": import0,
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
const JsArtImageColorInputsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
657
|
+
? { register: () => {}, unregister: () => {} }
|
|
658
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_jsartimagecolorinputs_free(ptr, 1));
|
|
659
|
+
const JsArtImageShapeInputsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
660
|
+
? { register: () => {}, unregister: () => {} }
|
|
661
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_jsartimageshapeinputs_free(ptr, 1));
|
|
662
|
+
|
|
663
|
+
function addToExternrefTable0(obj) {
|
|
664
|
+
const idx = wasm.__externref_table_alloc();
|
|
665
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
666
|
+
return idx;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
function debugString(val) {
|
|
670
|
+
switch (typeof val) {
|
|
671
|
+
// primitive types
|
|
672
|
+
case 'number':
|
|
673
|
+
case 'boolean':
|
|
674
|
+
case 'undefined':
|
|
675
|
+
return `${val}`;
|
|
676
|
+
case 'string':
|
|
677
|
+
return JSON.stringify(val);
|
|
678
|
+
case 'bigint':
|
|
679
|
+
return `${val}n`;
|
|
680
|
+
case 'symbol':
|
|
681
|
+
return val.description !== undefined
|
|
682
|
+
? `Symbol(${val.description})`
|
|
683
|
+
: 'Symbol';
|
|
684
|
+
case 'function':
|
|
685
|
+
return typeof val.name === 'string' && val.name !== ''
|
|
686
|
+
? `Function(${val.name})`
|
|
687
|
+
: 'Function';
|
|
688
|
+
case 'object': {
|
|
689
|
+
if (val === null) {
|
|
690
|
+
return 'null';
|
|
691
|
+
}
|
|
692
|
+
// objects
|
|
693
|
+
if (Array.isArray(val)) {
|
|
694
|
+
return '[' + Array.from(val, debugString).join(', ') + ']';
|
|
695
|
+
}
|
|
696
|
+
// errors
|
|
697
|
+
if (val instanceof Error) {
|
|
698
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const toStringOutput = toString.call(val);
|
|
702
|
+
// Test for built-in
|
|
703
|
+
const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
|
|
704
|
+
|
|
705
|
+
// Failed to match the standard '[object ClassName]'
|
|
706
|
+
if (className === undefined) {
|
|
707
|
+
return toStringOutput;
|
|
708
|
+
}
|
|
709
|
+
if (className === 'Object') {
|
|
710
|
+
// we're a user defined class or Object
|
|
711
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
712
|
+
// easier than looping through ownProperties of `val`.
|
|
713
|
+
try {
|
|
714
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
715
|
+
} catch (_) {
|
|
716
|
+
return 'Object';
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
720
|
+
return className;
|
|
721
|
+
}
|
|
722
|
+
// Per MDN: 'This list of values is exhaustive.'
|
|
723
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
function getArrayF64FromWasm0(ptr, len) {
|
|
728
|
+
ptr = ptr >>> 0;
|
|
729
|
+
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
733
|
+
ptr = ptr >>> 0;
|
|
734
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
let cachedDataViewMemory0 = null;
|
|
738
|
+
function getDataViewMemory0() {
|
|
739
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
740
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
741
|
+
}
|
|
742
|
+
return cachedDataViewMemory0;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
746
|
+
function getFloat64ArrayMemory0() {
|
|
747
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
748
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
749
|
+
}
|
|
750
|
+
return cachedFloat64ArrayMemory0;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
function getStringFromWasm0(ptr, len) {
|
|
754
|
+
ptr = ptr >>> 0;
|
|
755
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
let cachedUint8ArrayMemory0 = null;
|
|
759
|
+
function getUint8ArrayMemory0() {
|
|
760
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
761
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
762
|
+
}
|
|
763
|
+
return cachedUint8ArrayMemory0;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
function handleError(f, args) {
|
|
767
|
+
try {
|
|
768
|
+
return f.apply(this, args);
|
|
769
|
+
} catch (e) {
|
|
770
|
+
const idx = addToExternrefTable0(e);
|
|
771
|
+
wasm.__wbindgen_exn_store(idx);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
function isLikeNone(x) {
|
|
776
|
+
return x === undefined || x === null;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
780
|
+
if (realloc === undefined) {
|
|
781
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
782
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
783
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
784
|
+
WASM_VECTOR_LEN = buf.length;
|
|
785
|
+
return ptr;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
let len = arg.length;
|
|
789
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
790
|
+
|
|
791
|
+
const mem = getUint8ArrayMemory0();
|
|
792
|
+
|
|
793
|
+
let offset = 0;
|
|
794
|
+
|
|
795
|
+
for (; offset < len; offset++) {
|
|
796
|
+
const code = arg.charCodeAt(offset);
|
|
797
|
+
if (code > 0x7F) break;
|
|
798
|
+
mem[ptr + offset] = code;
|
|
799
|
+
}
|
|
800
|
+
if (offset !== len) {
|
|
801
|
+
if (offset !== 0) {
|
|
802
|
+
arg = arg.slice(offset);
|
|
803
|
+
}
|
|
804
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
805
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
806
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
807
|
+
|
|
808
|
+
offset += ret.written;
|
|
809
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
WASM_VECTOR_LEN = offset;
|
|
813
|
+
return ptr;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function takeFromExternrefTable0(idx) {
|
|
817
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
818
|
+
wasm.__externref_table_dealloc(idx);
|
|
819
|
+
return value;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
823
|
+
cachedTextDecoder.decode();
|
|
824
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
825
|
+
let numBytesDecoded = 0;
|
|
826
|
+
function decodeText(bytes) {
|
|
827
|
+
numBytesDecoded += bytes.length;
|
|
828
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
829
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
830
|
+
cachedTextDecoder.decode();
|
|
831
|
+
numBytesDecoded = bytes.length;
|
|
832
|
+
}
|
|
833
|
+
return cachedTextDecoder.decode(bytes);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
const cachedTextEncoder = new TextEncoder();
|
|
837
|
+
|
|
838
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
839
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
840
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
841
|
+
view.set(buf);
|
|
842
|
+
return {
|
|
843
|
+
read: arg.length,
|
|
844
|
+
written: buf.length
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
let WASM_VECTOR_LEN = 0;
|
|
850
|
+
|
|
851
|
+
let wasmModule, wasmInstance, wasm;
|
|
852
|
+
function __wbg_finalize_init(instance, module) {
|
|
853
|
+
wasmInstance = instance;
|
|
854
|
+
wasm = instance.exports;
|
|
855
|
+
wasmModule = module;
|
|
856
|
+
cachedDataViewMemory0 = null;
|
|
857
|
+
cachedFloat64ArrayMemory0 = null;
|
|
858
|
+
cachedUint8ArrayMemory0 = null;
|
|
859
|
+
wasm.__wbindgen_start();
|
|
860
|
+
return wasm;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
async function __wbg_load(module, imports) {
|
|
864
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
865
|
+
if (!module.ok) {
|
|
866
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
870
|
+
try {
|
|
871
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
872
|
+
} catch (e) {
|
|
873
|
+
const validResponse = expectedResponseType(module.type);
|
|
874
|
+
|
|
875
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
876
|
+
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);
|
|
877
|
+
|
|
878
|
+
} else { throw e; }
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
const bytes = await module.arrayBuffer();
|
|
883
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
884
|
+
} else {
|
|
885
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
886
|
+
|
|
887
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
888
|
+
return { instance, module };
|
|
889
|
+
} else {
|
|
890
|
+
return instance;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
function expectedResponseType(type) {
|
|
895
|
+
switch (type) {
|
|
896
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
897
|
+
}
|
|
898
|
+
return false;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
function initSync(module) {
|
|
903
|
+
if (wasm !== undefined) return wasm;
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
if (module !== undefined) {
|
|
907
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
908
|
+
({module} = module)
|
|
909
|
+
} else {
|
|
910
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
const imports = __wbg_get_imports();
|
|
915
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
916
|
+
module = new WebAssembly.Module(module);
|
|
917
|
+
}
|
|
918
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
919
|
+
return __wbg_finalize_init(instance, module);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
let __wbg_init_promise;
|
|
923
|
+
async function __wbg_init(module_or_path) {
|
|
924
|
+
if (wasm !== undefined) return wasm;
|
|
925
|
+
if (__wbg_init_promise === undefined) {
|
|
926
|
+
__wbg_init_promise = __wbg_init_once(module_or_path);
|
|
927
|
+
__wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
|
|
928
|
+
}
|
|
929
|
+
return __wbg_init_promise;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
async function __wbg_init_once(module_or_path) {
|
|
933
|
+
|
|
934
|
+
if (module_or_path !== undefined) {
|
|
935
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
936
|
+
({module_or_path} = module_or_path)
|
|
937
|
+
} else {
|
|
938
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
if (module_or_path === undefined) {
|
|
943
|
+
module_or_path = new URL('mandart_wasm_bg.wasm', import.meta.url);
|
|
944
|
+
}
|
|
945
|
+
const imports = __wbg_get_imports();
|
|
946
|
+
|
|
947
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
948
|
+
module_or_path = fetch(module_or_path);
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
952
|
+
|
|
953
|
+
return __wbg_finalize_init(instance, module);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export { initSync, __wbg_init as default };
|