alpathfinder 0.4.0 → 0.4.1

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/alpathfinder.js CHANGED
@@ -1,9 +1,460 @@
1
1
  /* @ts-self-types="./alpathfinder.d.ts" */
2
- import * as wasm from "./alpathfinder_bg.wasm";
3
- import { __wbg_set_wasm } from "./alpathfinder_bg.js";
4
2
 
5
- __wbg_set_wasm(wasm);
3
+ /**
4
+ * @param {string} map_name
5
+ * @param {number} x1
6
+ * @param {number} y1
7
+ * @param {number} x2
8
+ * @param {number} y2
9
+ * @returns {boolean}
10
+ */
11
+ function canWalkPath(map_name, x1, y1, x2, y2) {
12
+ const ptr0 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
13
+ const len0 = WASM_VECTOR_LEN;
14
+ const ret = wasm.canWalkPath(ptr0, len0, x1, y1, x2, y2);
15
+ return ret !== 0;
16
+ }
17
+ exports.canWalkPath = canWalkPath;
18
+
19
+ function clear() {
20
+ wasm.clear();
21
+ }
22
+ exports.clear = clear;
23
+
24
+ /**
25
+ * @param {string} map_from_name
26
+ * @param {number} x_from
27
+ * @param {number} y_from
28
+ * @param {string} map_to_name
29
+ * @param {number} x_to
30
+ * @param {number} y_to
31
+ * @param {number | null} [speed]
32
+ * @returns {any}
33
+ */
34
+ function getPath(map_from_name, x_from, y_from, map_to_name, x_to, y_to, speed) {
35
+ const ptr0 = passStringToWasm0(map_from_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
36
+ const len0 = WASM_VECTOR_LEN;
37
+ const ptr1 = passStringToWasm0(map_to_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
38
+ const len1 = WASM_VECTOR_LEN;
39
+ const ret = wasm.getPath(ptr0, len0, x_from, y_from, ptr1, len1, x_to, y_to, isLikeNone(speed) ? Number.MAX_SAFE_INTEGER : Math.fround(speed));
40
+ return ret;
41
+ }
42
+ exports.getPath = getPath;
43
+
44
+ /**
45
+ * @param {string} map_name
46
+ * @param {number} x
47
+ * @param {number} y
48
+ * @returns {boolean}
49
+ */
50
+ function isWalkable(map_name, x, y) {
51
+ const ptr0 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
52
+ const len0 = WASM_VECTOR_LEN;
53
+ const ret = wasm.isWalkable(ptr0, len0, x, y);
54
+ return ret !== 0;
55
+ }
56
+ exports.isWalkable = isWalkable;
57
+
58
+ /**
59
+ * @param {any} g_js
60
+ * @param {any | null} [exclude_maps]
61
+ */
62
+ function prepare(g_js, exclude_maps) {
63
+ wasm.prepare(g_js, isLikeNone(exclude_maps) ? 0 : addToExternrefTable0(exclude_maps));
64
+ }
65
+ exports.prepare = prepare;
66
+ function __wbg_get_imports() {
67
+ const import0 = {
68
+ __proto__: null,
69
+ __wbg_Error_3639a60ed15f87e7: function(arg0, arg1) {
70
+ const ret = Error(getStringFromWasm0(arg0, arg1));
71
+ return ret;
72
+ },
73
+ __wbg_Number_a3d737fd183f7dca: function(arg0) {
74
+ const ret = Number(arg0);
75
+ return ret;
76
+ },
77
+ __wbg___wbindgen_bigint_get_as_i64_3af6d4ca77193a4b: function(arg0, arg1) {
78
+ const v = arg1;
79
+ const ret = typeof(v) === 'bigint' ? v : undefined;
80
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
81
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
82
+ },
83
+ __wbg___wbindgen_boolean_get_c3dd5c39f1b5a12b: function(arg0) {
84
+ const v = arg0;
85
+ const ret = typeof(v) === 'boolean' ? v : undefined;
86
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
87
+ },
88
+ __wbg___wbindgen_debug_string_07cb72cfcc952e2b: function(arg0, arg1) {
89
+ const ret = debugString(arg1);
90
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
91
+ const len1 = WASM_VECTOR_LEN;
92
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
93
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
94
+ },
95
+ __wbg___wbindgen_in_2617fa76397620d3: function(arg0, arg1) {
96
+ const ret = arg0 in arg1;
97
+ return ret;
98
+ },
99
+ __wbg___wbindgen_is_bigint_d6a8167cac401b95: function(arg0) {
100
+ const ret = typeof(arg0) === 'bigint';
101
+ return ret;
102
+ },
103
+ __wbg___wbindgen_is_function_2f0fd7ceb86e64c5: function(arg0) {
104
+ const ret = typeof(arg0) === 'function';
105
+ return ret;
106
+ },
107
+ __wbg___wbindgen_is_object_5b22ff2418063a9c: function(arg0) {
108
+ const val = arg0;
109
+ const ret = typeof(val) === 'object' && val !== null;
110
+ return ret;
111
+ },
112
+ __wbg___wbindgen_is_undefined_244a92c34d3b6ec0: function(arg0) {
113
+ const ret = arg0 === undefined;
114
+ return ret;
115
+ },
116
+ __wbg___wbindgen_jsval_eq_403eaa3610500a25: function(arg0, arg1) {
117
+ const ret = arg0 === arg1;
118
+ return ret;
119
+ },
120
+ __wbg___wbindgen_jsval_loose_eq_1978f1e77b4bce62: function(arg0, arg1) {
121
+ const ret = arg0 == arg1;
122
+ return ret;
123
+ },
124
+ __wbg___wbindgen_number_get_dd6d69a6079f26f1: function(arg0, arg1) {
125
+ const obj = arg1;
126
+ const ret = typeof(obj) === 'number' ? obj : undefined;
127
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
128
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
129
+ },
130
+ __wbg___wbindgen_string_get_965592073e5d848c: function(arg0, arg1) {
131
+ const obj = arg1;
132
+ const ret = typeof(obj) === 'string' ? obj : undefined;
133
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
134
+ var len1 = WASM_VECTOR_LEN;
135
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
136
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
137
+ },
138
+ __wbg___wbindgen_throw_9c75d47bf9e7731e: function(arg0, arg1) {
139
+ throw new Error(getStringFromWasm0(arg0, arg1));
140
+ },
141
+ __wbg_call_add9e5a76382e668: function() { return handleError(function (arg0, arg1) {
142
+ const ret = arg0.call(arg1);
143
+ return ret;
144
+ }, arguments); },
145
+ __wbg_done_b1afd6201ac045e0: function(arg0) {
146
+ const ret = arg0.done;
147
+ return ret;
148
+ },
149
+ __wbg_entries_bb9843ba73dc70d6: function(arg0) {
150
+ const ret = Object.entries(arg0);
151
+ return ret;
152
+ },
153
+ __wbg_get_652f640b3b0b6e3e: function(arg0, arg1) {
154
+ const ret = arg0[arg1 >>> 0];
155
+ return ret;
156
+ },
157
+ __wbg_get_9cfea9b7bbf12a15: function() { return handleError(function (arg0, arg1) {
158
+ const ret = Reflect.get(arg0, arg1);
159
+ return ret;
160
+ }, arguments); },
161
+ __wbg_get_unchecked_be562b1421656321: function(arg0, arg1) {
162
+ const ret = arg0[arg1 >>> 0];
163
+ return ret;
164
+ },
165
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
166
+ const ret = arg0[arg1];
167
+ return ret;
168
+ },
169
+ __wbg_instanceof_ArrayBuffer_eab9f28fbec23477: function(arg0) {
170
+ let result;
171
+ try {
172
+ result = arg0 instanceof ArrayBuffer;
173
+ } catch (_) {
174
+ result = false;
175
+ }
176
+ const ret = result;
177
+ return ret;
178
+ },
179
+ __wbg_instanceof_Map_10d4edf60fcf9327: function(arg0) {
180
+ let result;
181
+ try {
182
+ result = arg0 instanceof Map;
183
+ } catch (_) {
184
+ result = false;
185
+ }
186
+ const ret = result;
187
+ return ret;
188
+ },
189
+ __wbg_instanceof_Uint8Array_57d77acd50e4c44d: function(arg0) {
190
+ let result;
191
+ try {
192
+ result = arg0 instanceof Uint8Array;
193
+ } catch (_) {
194
+ result = false;
195
+ }
196
+ const ret = result;
197
+ return ret;
198
+ },
199
+ __wbg_isArray_c6c6ef8308995bcf: function(arg0) {
200
+ const ret = Array.isArray(arg0);
201
+ return ret;
202
+ },
203
+ __wbg_isSafeInteger_3c56c421a5b4cce4: function(arg0) {
204
+ const ret = Number.isSafeInteger(arg0);
205
+ return ret;
206
+ },
207
+ __wbg_iterator_9d68985a1d096fc2: function() {
208
+ const ret = Symbol.iterator;
209
+ return ret;
210
+ },
211
+ __wbg_length_0a6ce016dc1460b0: function(arg0) {
212
+ const ret = arg0.length;
213
+ return ret;
214
+ },
215
+ __wbg_length_ba3c032602efe310: function(arg0) {
216
+ const ret = arg0.length;
217
+ return ret;
218
+ },
219
+ __wbg_new_2fad8ca02fd00684: function() {
220
+ const ret = new Object();
221
+ return ret;
222
+ },
223
+ __wbg_new_3baa8d9866155c79: function() {
224
+ const ret = new Array();
225
+ return ret;
226
+ },
227
+ __wbg_new_8454eee672b2ba6e: function(arg0) {
228
+ const ret = new Uint8Array(arg0);
229
+ return ret;
230
+ },
231
+ __wbg_next_261c3c48c6e309a5: function(arg0) {
232
+ const ret = arg0.next;
233
+ return ret;
234
+ },
235
+ __wbg_next_aacee310bcfe6461: function() { return handleError(function (arg0) {
236
+ const ret = arg0.next();
237
+ return ret;
238
+ }, arguments); },
239
+ __wbg_prototypesetcall_fd4050e806e1d519: function(arg0, arg1, arg2) {
240
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
241
+ },
242
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
243
+ arg0[arg1] = arg2;
244
+ },
245
+ __wbg_set_f614f6a0608d1d1d: function(arg0, arg1, arg2) {
246
+ arg0[arg1 >>> 0] = arg2;
247
+ },
248
+ __wbg_value_f852716acdeb3e82: function(arg0) {
249
+ const ret = arg0.value;
250
+ return ret;
251
+ },
252
+ __wbindgen_cast_0000000000000001: function(arg0) {
253
+ // Cast intrinsic for `F64 -> Externref`.
254
+ const ret = arg0;
255
+ return ret;
256
+ },
257
+ __wbindgen_cast_0000000000000002: function(arg0) {
258
+ // Cast intrinsic for `I64 -> Externref`.
259
+ const ret = arg0;
260
+ return ret;
261
+ },
262
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
263
+ // Cast intrinsic for `Ref(String) -> Externref`.
264
+ const ret = getStringFromWasm0(arg0, arg1);
265
+ return ret;
266
+ },
267
+ __wbindgen_cast_0000000000000004: function(arg0) {
268
+ // Cast intrinsic for `U64 -> Externref`.
269
+ const ret = BigInt.asUintN(64, arg0);
270
+ return ret;
271
+ },
272
+ __wbindgen_init_externref_table: function() {
273
+ const table = wasm.__wbindgen_externrefs;
274
+ const offset = table.grow(4);
275
+ table.set(0, undefined);
276
+ table.set(offset + 0, undefined);
277
+ table.set(offset + 1, null);
278
+ table.set(offset + 2, true);
279
+ table.set(offset + 3, false);
280
+ },
281
+ };
282
+ return {
283
+ __proto__: null,
284
+ "./alpathfinder_bg.js": import0,
285
+ };
286
+ }
287
+
288
+ function addToExternrefTable0(obj) {
289
+ const idx = wasm.__externref_table_alloc();
290
+ wasm.__wbindgen_externrefs.set(idx, obj);
291
+ return idx;
292
+ }
293
+
294
+ function debugString(val) {
295
+ // primitive types
296
+ const type = typeof val;
297
+ if (type == 'number' || type == 'boolean' || val == null) {
298
+ return `${val}`;
299
+ }
300
+ if (type == 'string') {
301
+ return `"${val}"`;
302
+ }
303
+ if (type == 'symbol') {
304
+ const description = val.description;
305
+ if (description == null) {
306
+ return 'Symbol';
307
+ } else {
308
+ return `Symbol(${description})`;
309
+ }
310
+ }
311
+ if (type == 'function') {
312
+ const name = val.name;
313
+ if (typeof name == 'string' && name.length > 0) {
314
+ return `Function(${name})`;
315
+ } else {
316
+ return 'Function';
317
+ }
318
+ }
319
+ // objects
320
+ if (Array.isArray(val)) {
321
+ const length = val.length;
322
+ let debug = '[';
323
+ if (length > 0) {
324
+ debug += debugString(val[0]);
325
+ }
326
+ for(let i = 1; i < length; i++) {
327
+ debug += ', ' + debugString(val[i]);
328
+ }
329
+ debug += ']';
330
+ return debug;
331
+ }
332
+ // Test for built-in
333
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
334
+ let className;
335
+ if (builtInMatches && builtInMatches.length > 1) {
336
+ className = builtInMatches[1];
337
+ } else {
338
+ // Failed to match the standard '[object ClassName]'
339
+ return toString.call(val);
340
+ }
341
+ if (className == 'Object') {
342
+ // we're a user defined class or Object
343
+ // JSON.stringify avoids problems with cycles, and is generally much
344
+ // easier than looping through ownProperties of `val`.
345
+ try {
346
+ return 'Object(' + JSON.stringify(val) + ')';
347
+ } catch (_) {
348
+ return 'Object';
349
+ }
350
+ }
351
+ // errors
352
+ if (val instanceof Error) {
353
+ return `${val.name}: ${val.message}\n${val.stack}`;
354
+ }
355
+ // TODO we could test for more things here, like `Set`s and `Map`s.
356
+ return className;
357
+ }
358
+
359
+ function getArrayU8FromWasm0(ptr, len) {
360
+ ptr = ptr >>> 0;
361
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
362
+ }
363
+
364
+ let cachedDataViewMemory0 = null;
365
+ function getDataViewMemory0() {
366
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
367
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
368
+ }
369
+ return cachedDataViewMemory0;
370
+ }
371
+
372
+ function getStringFromWasm0(ptr, len) {
373
+ return decodeText(ptr >>> 0, len);
374
+ }
375
+
376
+ let cachedUint8ArrayMemory0 = null;
377
+ function getUint8ArrayMemory0() {
378
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
379
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
380
+ }
381
+ return cachedUint8ArrayMemory0;
382
+ }
383
+
384
+ function handleError(f, args) {
385
+ try {
386
+ return f.apply(this, args);
387
+ } catch (e) {
388
+ const idx = addToExternrefTable0(e);
389
+ wasm.__wbindgen_exn_store(idx);
390
+ }
391
+ }
392
+
393
+ function isLikeNone(x) {
394
+ return x === undefined || x === null;
395
+ }
396
+
397
+ function passStringToWasm0(arg, malloc, realloc) {
398
+ if (realloc === undefined) {
399
+ const buf = cachedTextEncoder.encode(arg);
400
+ const ptr = malloc(buf.length, 1) >>> 0;
401
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
402
+ WASM_VECTOR_LEN = buf.length;
403
+ return ptr;
404
+ }
405
+
406
+ let len = arg.length;
407
+ let ptr = malloc(len, 1) >>> 0;
408
+
409
+ const mem = getUint8ArrayMemory0();
410
+
411
+ let offset = 0;
412
+
413
+ for (; offset < len; offset++) {
414
+ const code = arg.charCodeAt(offset);
415
+ if (code > 0x7F) break;
416
+ mem[ptr + offset] = code;
417
+ }
418
+ if (offset !== len) {
419
+ if (offset !== 0) {
420
+ arg = arg.slice(offset);
421
+ }
422
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
423
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
424
+ const ret = cachedTextEncoder.encodeInto(arg, view);
425
+
426
+ offset += ret.written;
427
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
428
+ }
429
+
430
+ WASM_VECTOR_LEN = offset;
431
+ return ptr;
432
+ }
433
+
434
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
435
+ cachedTextDecoder.decode();
436
+ function decodeText(ptr, len) {
437
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
438
+ }
439
+
440
+ const cachedTextEncoder = new TextEncoder();
441
+
442
+ if (!('encodeInto' in cachedTextEncoder)) {
443
+ cachedTextEncoder.encodeInto = function (arg, view) {
444
+ const buf = cachedTextEncoder.encode(arg);
445
+ view.set(buf);
446
+ return {
447
+ read: arg.length,
448
+ written: buf.length
449
+ };
450
+ };
451
+ }
452
+
453
+ let WASM_VECTOR_LEN = 0;
454
+
455
+ const wasmPath = `${__dirname}/alpathfinder_bg.wasm`;
456
+ const wasmBytes = require('fs').readFileSync(wasmPath);
457
+ const wasmModule = new WebAssembly.Module(wasmBytes);
458
+ let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
459
+ let wasm = wasmInstance.exports;
6
460
  wasm.__wbindgen_start();
7
- export {
8
- canWalkPath, clear, getPath, isWalkable, prepare
9
- } from "./alpathfinder_bg.js";
Binary file
package/package.json CHANGED
@@ -1,23 +1,17 @@
1
1
  {
2
2
  "name": "alpathfinder",
3
- "type": "module",
4
3
  "collaborators": [
5
4
  "Kent Rasmussen <hyprkookeez@gmail.com>"
6
5
  ],
7
- "version": "0.4.0",
6
+ "version": "0.4.1",
8
7
  "files": [
9
8
  "alpathfinder_bg.wasm",
10
9
  "alpathfinder.js",
11
- "alpathfinder_bg.js",
12
10
  "alpathfinder.d.ts"
13
11
  ],
14
12
  "main": "alpathfinder.js",
15
13
  "types": "alpathfinder.d.ts",
16
- "sideEffects": [
17
- "./alpathfinder.js",
18
- "./snippets/*"
19
- ],
20
14
  "dependencies": {
21
15
  "typed-adventureland": "^0.0.55"
22
16
  }
23
- }
17
+ }
@@ -1,450 +0,0 @@
1
- /**
2
- * @param {string} map_name
3
- * @param {number} x1
4
- * @param {number} y1
5
- * @param {number} x2
6
- * @param {number} y2
7
- * @returns {boolean}
8
- */
9
- export function canWalkPath(map_name, x1, y1, x2, y2) {
10
- const ptr0 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11
- const len0 = WASM_VECTOR_LEN;
12
- const ret = wasm.canWalkPath(ptr0, len0, x1, y1, x2, y2);
13
- return ret !== 0;
14
- }
15
-
16
- export function clear() {
17
- wasm.clear();
18
- }
19
-
20
- /**
21
- * @param {string} map_from_name
22
- * @param {number} x_from
23
- * @param {number} y_from
24
- * @param {string} map_to_name
25
- * @param {number} x_to
26
- * @param {number} y_to
27
- * @param {number | null} [speed]
28
- * @returns {any}
29
- */
30
- export function getPath(map_from_name, x_from, y_from, map_to_name, x_to, y_to, speed) {
31
- const ptr0 = passStringToWasm0(map_from_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
32
- const len0 = WASM_VECTOR_LEN;
33
- const ptr1 = passStringToWasm0(map_to_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
34
- const len1 = WASM_VECTOR_LEN;
35
- const ret = wasm.getPath(ptr0, len0, x_from, y_from, ptr1, len1, x_to, y_to, isLikeNone(speed) ? Number.MAX_SAFE_INTEGER : Math.fround(speed));
36
- return ret;
37
- }
38
-
39
- /**
40
- * @param {string} map_name
41
- * @param {number} x
42
- * @param {number} y
43
- * @returns {boolean}
44
- */
45
- export function isWalkable(map_name, x, y) {
46
- const ptr0 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
47
- const len0 = WASM_VECTOR_LEN;
48
- const ret = wasm.isWalkable(ptr0, len0, x, y);
49
- return ret !== 0;
50
- }
51
-
52
- /**
53
- * @param {any} g_js
54
- * @param {any | null} [exclude_maps]
55
- */
56
- export function prepare(g_js, exclude_maps) {
57
- wasm.prepare(g_js, isLikeNone(exclude_maps) ? 0 : addToExternrefTable0(exclude_maps));
58
- }
59
- export function __wbg_Error_3639a60ed15f87e7(arg0, arg1) {
60
- const ret = Error(getStringFromWasm0(arg0, arg1));
61
- return ret;
62
- }
63
- export function __wbg_Number_a3d737fd183f7dca(arg0) {
64
- const ret = Number(arg0);
65
- return ret;
66
- }
67
- export function __wbg___wbindgen_bigint_get_as_i64_3af6d4ca77193a4b(arg0, arg1) {
68
- const v = arg1;
69
- const ret = typeof(v) === 'bigint' ? v : undefined;
70
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
71
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
72
- }
73
- export function __wbg___wbindgen_boolean_get_c3dd5c39f1b5a12b(arg0) {
74
- const v = arg0;
75
- const ret = typeof(v) === 'boolean' ? v : undefined;
76
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
77
- }
78
- export function __wbg___wbindgen_debug_string_07cb72cfcc952e2b(arg0, arg1) {
79
- const ret = debugString(arg1);
80
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
81
- const len1 = WASM_VECTOR_LEN;
82
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
83
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
84
- }
85
- export function __wbg___wbindgen_in_2617fa76397620d3(arg0, arg1) {
86
- const ret = arg0 in arg1;
87
- return ret;
88
- }
89
- export function __wbg___wbindgen_is_bigint_d6a8167cac401b95(arg0) {
90
- const ret = typeof(arg0) === 'bigint';
91
- return ret;
92
- }
93
- export function __wbg___wbindgen_is_function_2f0fd7ceb86e64c5(arg0) {
94
- const ret = typeof(arg0) === 'function';
95
- return ret;
96
- }
97
- export function __wbg___wbindgen_is_object_5b22ff2418063a9c(arg0) {
98
- const val = arg0;
99
- const ret = typeof(val) === 'object' && val !== null;
100
- return ret;
101
- }
102
- export function __wbg___wbindgen_is_undefined_244a92c34d3b6ec0(arg0) {
103
- const ret = arg0 === undefined;
104
- return ret;
105
- }
106
- export function __wbg___wbindgen_jsval_eq_403eaa3610500a25(arg0, arg1) {
107
- const ret = arg0 === arg1;
108
- return ret;
109
- }
110
- export function __wbg___wbindgen_jsval_loose_eq_1978f1e77b4bce62(arg0, arg1) {
111
- const ret = arg0 == arg1;
112
- return ret;
113
- }
114
- export function __wbg___wbindgen_number_get_dd6d69a6079f26f1(arg0, arg1) {
115
- const obj = arg1;
116
- const ret = typeof(obj) === 'number' ? obj : undefined;
117
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
118
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
119
- }
120
- export function __wbg___wbindgen_string_get_965592073e5d848c(arg0, arg1) {
121
- const obj = arg1;
122
- const ret = typeof(obj) === 'string' ? obj : undefined;
123
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
124
- var len1 = WASM_VECTOR_LEN;
125
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
126
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
127
- }
128
- export function __wbg___wbindgen_throw_9c75d47bf9e7731e(arg0, arg1) {
129
- throw new Error(getStringFromWasm0(arg0, arg1));
130
- }
131
- export function __wbg_call_add9e5a76382e668() { return handleError(function (arg0, arg1) {
132
- const ret = arg0.call(arg1);
133
- return ret;
134
- }, arguments); }
135
- export function __wbg_done_b1afd6201ac045e0(arg0) {
136
- const ret = arg0.done;
137
- return ret;
138
- }
139
- export function __wbg_entries_bb9843ba73dc70d6(arg0) {
140
- const ret = Object.entries(arg0);
141
- return ret;
142
- }
143
- export function __wbg_get_652f640b3b0b6e3e(arg0, arg1) {
144
- const ret = arg0[arg1 >>> 0];
145
- return ret;
146
- }
147
- export function __wbg_get_9cfea9b7bbf12a15() { return handleError(function (arg0, arg1) {
148
- const ret = Reflect.get(arg0, arg1);
149
- return ret;
150
- }, arguments); }
151
- export function __wbg_get_unchecked_be562b1421656321(arg0, arg1) {
152
- const ret = arg0[arg1 >>> 0];
153
- return ret;
154
- }
155
- export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
156
- const ret = arg0[arg1];
157
- return ret;
158
- }
159
- export function __wbg_instanceof_ArrayBuffer_eab9f28fbec23477(arg0) {
160
- let result;
161
- try {
162
- result = arg0 instanceof ArrayBuffer;
163
- } catch (_) {
164
- result = false;
165
- }
166
- const ret = result;
167
- return ret;
168
- }
169
- export function __wbg_instanceof_Map_10d4edf60fcf9327(arg0) {
170
- let result;
171
- try {
172
- result = arg0 instanceof Map;
173
- } catch (_) {
174
- result = false;
175
- }
176
- const ret = result;
177
- return ret;
178
- }
179
- export function __wbg_instanceof_Uint8Array_57d77acd50e4c44d(arg0) {
180
- let result;
181
- try {
182
- result = arg0 instanceof Uint8Array;
183
- } catch (_) {
184
- result = false;
185
- }
186
- const ret = result;
187
- return ret;
188
- }
189
- export function __wbg_isArray_c6c6ef8308995bcf(arg0) {
190
- const ret = Array.isArray(arg0);
191
- return ret;
192
- }
193
- export function __wbg_isSafeInteger_3c56c421a5b4cce4(arg0) {
194
- const ret = Number.isSafeInteger(arg0);
195
- return ret;
196
- }
197
- export function __wbg_iterator_9d68985a1d096fc2() {
198
- const ret = Symbol.iterator;
199
- return ret;
200
- }
201
- export function __wbg_length_0a6ce016dc1460b0(arg0) {
202
- const ret = arg0.length;
203
- return ret;
204
- }
205
- export function __wbg_length_ba3c032602efe310(arg0) {
206
- const ret = arg0.length;
207
- return ret;
208
- }
209
- export function __wbg_new_2fad8ca02fd00684() {
210
- const ret = new Object();
211
- return ret;
212
- }
213
- export function __wbg_new_3baa8d9866155c79() {
214
- const ret = new Array();
215
- return ret;
216
- }
217
- export function __wbg_new_8454eee672b2ba6e(arg0) {
218
- const ret = new Uint8Array(arg0);
219
- return ret;
220
- }
221
- export function __wbg_next_261c3c48c6e309a5(arg0) {
222
- const ret = arg0.next;
223
- return ret;
224
- }
225
- export function __wbg_next_aacee310bcfe6461() { return handleError(function (arg0) {
226
- const ret = arg0.next();
227
- return ret;
228
- }, arguments); }
229
- export function __wbg_prototypesetcall_fd4050e806e1d519(arg0, arg1, arg2) {
230
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
231
- }
232
- export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
233
- arg0[arg1] = arg2;
234
- }
235
- export function __wbg_set_f614f6a0608d1d1d(arg0, arg1, arg2) {
236
- arg0[arg1 >>> 0] = arg2;
237
- }
238
- export function __wbg_value_f852716acdeb3e82(arg0) {
239
- const ret = arg0.value;
240
- return ret;
241
- }
242
- export function __wbindgen_cast_0000000000000001(arg0) {
243
- // Cast intrinsic for `F64 -> Externref`.
244
- const ret = arg0;
245
- return ret;
246
- }
247
- export function __wbindgen_cast_0000000000000002(arg0) {
248
- // Cast intrinsic for `I64 -> Externref`.
249
- const ret = arg0;
250
- return ret;
251
- }
252
- export function __wbindgen_cast_0000000000000003(arg0, arg1) {
253
- // Cast intrinsic for `Ref(String) -> Externref`.
254
- const ret = getStringFromWasm0(arg0, arg1);
255
- return ret;
256
- }
257
- export function __wbindgen_cast_0000000000000004(arg0) {
258
- // Cast intrinsic for `U64 -> Externref`.
259
- const ret = BigInt.asUintN(64, arg0);
260
- return ret;
261
- }
262
- export function __wbindgen_init_externref_table() {
263
- const table = wasm.__wbindgen_externrefs;
264
- const offset = table.grow(4);
265
- table.set(0, undefined);
266
- table.set(offset + 0, undefined);
267
- table.set(offset + 1, null);
268
- table.set(offset + 2, true);
269
- table.set(offset + 3, false);
270
- }
271
- function addToExternrefTable0(obj) {
272
- const idx = wasm.__externref_table_alloc();
273
- wasm.__wbindgen_externrefs.set(idx, obj);
274
- return idx;
275
- }
276
-
277
- function debugString(val) {
278
- // primitive types
279
- const type = typeof val;
280
- if (type == 'number' || type == 'boolean' || val == null) {
281
- return `${val}`;
282
- }
283
- if (type == 'string') {
284
- return `"${val}"`;
285
- }
286
- if (type == 'symbol') {
287
- const description = val.description;
288
- if (description == null) {
289
- return 'Symbol';
290
- } else {
291
- return `Symbol(${description})`;
292
- }
293
- }
294
- if (type == 'function') {
295
- const name = val.name;
296
- if (typeof name == 'string' && name.length > 0) {
297
- return `Function(${name})`;
298
- } else {
299
- return 'Function';
300
- }
301
- }
302
- // objects
303
- if (Array.isArray(val)) {
304
- const length = val.length;
305
- let debug = '[';
306
- if (length > 0) {
307
- debug += debugString(val[0]);
308
- }
309
- for(let i = 1; i < length; i++) {
310
- debug += ', ' + debugString(val[i]);
311
- }
312
- debug += ']';
313
- return debug;
314
- }
315
- // Test for built-in
316
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
317
- let className;
318
- if (builtInMatches && builtInMatches.length > 1) {
319
- className = builtInMatches[1];
320
- } else {
321
- // Failed to match the standard '[object ClassName]'
322
- return toString.call(val);
323
- }
324
- if (className == 'Object') {
325
- // we're a user defined class or Object
326
- // JSON.stringify avoids problems with cycles, and is generally much
327
- // easier than looping through ownProperties of `val`.
328
- try {
329
- return 'Object(' + JSON.stringify(val) + ')';
330
- } catch (_) {
331
- return 'Object';
332
- }
333
- }
334
- // errors
335
- if (val instanceof Error) {
336
- return `${val.name}: ${val.message}\n${val.stack}`;
337
- }
338
- // TODO we could test for more things here, like `Set`s and `Map`s.
339
- return className;
340
- }
341
-
342
- function getArrayU8FromWasm0(ptr, len) {
343
- ptr = ptr >>> 0;
344
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
345
- }
346
-
347
- let cachedDataViewMemory0 = null;
348
- function getDataViewMemory0() {
349
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
350
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
351
- }
352
- return cachedDataViewMemory0;
353
- }
354
-
355
- function getStringFromWasm0(ptr, len) {
356
- return decodeText(ptr >>> 0, len);
357
- }
358
-
359
- let cachedUint8ArrayMemory0 = null;
360
- function getUint8ArrayMemory0() {
361
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
362
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
363
- }
364
- return cachedUint8ArrayMemory0;
365
- }
366
-
367
- function handleError(f, args) {
368
- try {
369
- return f.apply(this, args);
370
- } catch (e) {
371
- const idx = addToExternrefTable0(e);
372
- wasm.__wbindgen_exn_store(idx);
373
- }
374
- }
375
-
376
- function isLikeNone(x) {
377
- return x === undefined || x === null;
378
- }
379
-
380
- function passStringToWasm0(arg, malloc, realloc) {
381
- if (realloc === undefined) {
382
- const buf = cachedTextEncoder.encode(arg);
383
- const ptr = malloc(buf.length, 1) >>> 0;
384
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
385
- WASM_VECTOR_LEN = buf.length;
386
- return ptr;
387
- }
388
-
389
- let len = arg.length;
390
- let ptr = malloc(len, 1) >>> 0;
391
-
392
- const mem = getUint8ArrayMemory0();
393
-
394
- let offset = 0;
395
-
396
- for (; offset < len; offset++) {
397
- const code = arg.charCodeAt(offset);
398
- if (code > 0x7F) break;
399
- mem[ptr + offset] = code;
400
- }
401
- if (offset !== len) {
402
- if (offset !== 0) {
403
- arg = arg.slice(offset);
404
- }
405
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
406
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
407
- const ret = cachedTextEncoder.encodeInto(arg, view);
408
-
409
- offset += ret.written;
410
- ptr = realloc(ptr, len, offset, 1) >>> 0;
411
- }
412
-
413
- WASM_VECTOR_LEN = offset;
414
- return ptr;
415
- }
416
-
417
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
418
- cachedTextDecoder.decode();
419
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
420
- let numBytesDecoded = 0;
421
- function decodeText(ptr, len) {
422
- numBytesDecoded += len;
423
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
424
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
425
- cachedTextDecoder.decode();
426
- numBytesDecoded = len;
427
- }
428
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
429
- }
430
-
431
- const cachedTextEncoder = new TextEncoder();
432
-
433
- if (!('encodeInto' in cachedTextEncoder)) {
434
- cachedTextEncoder.encodeInto = function (arg, view) {
435
- const buf = cachedTextEncoder.encode(arg);
436
- view.set(buf);
437
- return {
438
- read: arg.length,
439
- written: buf.length
440
- };
441
- };
442
- }
443
-
444
- let WASM_VECTOR_LEN = 0;
445
-
446
-
447
- let wasm;
448
- export function __wbg_set_wasm(val) {
449
- wasm = val;
450
- }