@quillmark/wasm 0.13.1 → 0.14.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/nodejs/wasm.js ADDED
@@ -0,0 +1,775 @@
1
+
2
+ let imports = {};
3
+ imports['__wbindgen_placeholder__'] = module.exports;
4
+
5
+ let cachedUint8ArrayMemory0 = null;
6
+
7
+ function getUint8ArrayMemory0() {
8
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
9
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
10
+ }
11
+ return cachedUint8ArrayMemory0;
12
+ }
13
+
14
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
15
+
16
+ cachedTextDecoder.decode();
17
+
18
+ function decodeText(ptr, len) {
19
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
20
+ }
21
+
22
+ function getStringFromWasm0(ptr, len) {
23
+ ptr = ptr >>> 0;
24
+ return decodeText(ptr, len);
25
+ }
26
+
27
+ let heap = new Array(128).fill(undefined);
28
+
29
+ heap.push(undefined, null, true, false);
30
+
31
+ let heap_next = heap.length;
32
+
33
+ function addHeapObject(obj) {
34
+ if (heap_next === heap.length) heap.push(heap.length + 1);
35
+ const idx = heap_next;
36
+ heap_next = heap[idx];
37
+
38
+ heap[idx] = obj;
39
+ return idx;
40
+ }
41
+
42
+ function getObject(idx) { return heap[idx]; }
43
+
44
+ let WASM_VECTOR_LEN = 0;
45
+
46
+ const cachedTextEncoder = new TextEncoder();
47
+
48
+ if (!('encodeInto' in cachedTextEncoder)) {
49
+ cachedTextEncoder.encodeInto = function (arg, view) {
50
+ const buf = cachedTextEncoder.encode(arg);
51
+ view.set(buf);
52
+ return {
53
+ read: arg.length,
54
+ written: buf.length
55
+ };
56
+ }
57
+ }
58
+
59
+ function passStringToWasm0(arg, malloc, realloc) {
60
+
61
+ if (realloc === undefined) {
62
+ const buf = cachedTextEncoder.encode(arg);
63
+ const ptr = malloc(buf.length, 1) >>> 0;
64
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
65
+ WASM_VECTOR_LEN = buf.length;
66
+ return ptr;
67
+ }
68
+
69
+ let len = arg.length;
70
+ let ptr = malloc(len, 1) >>> 0;
71
+
72
+ const mem = getUint8ArrayMemory0();
73
+
74
+ let offset = 0;
75
+
76
+ for (; offset < len; offset++) {
77
+ const code = arg.charCodeAt(offset);
78
+ if (code > 0x7F) break;
79
+ mem[ptr + offset] = code;
80
+ }
81
+
82
+ if (offset !== len) {
83
+ if (offset !== 0) {
84
+ arg = arg.slice(offset);
85
+ }
86
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
87
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
88
+ const ret = cachedTextEncoder.encodeInto(arg, view);
89
+
90
+ offset += ret.written;
91
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
92
+ }
93
+
94
+ WASM_VECTOR_LEN = offset;
95
+ return ptr;
96
+ }
97
+
98
+ let cachedDataViewMemory0 = null;
99
+
100
+ function getDataViewMemory0() {
101
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
102
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
103
+ }
104
+ return cachedDataViewMemory0;
105
+ }
106
+
107
+ function handleError(f, args) {
108
+ try {
109
+ return f.apply(this, args);
110
+ } catch (e) {
111
+ wasm.__wbindgen_export_2(addHeapObject(e));
112
+ }
113
+ }
114
+
115
+ function getArrayU8FromWasm0(ptr, len) {
116
+ ptr = ptr >>> 0;
117
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
118
+ }
119
+
120
+ function dropObject(idx) {
121
+ if (idx < 132) return;
122
+ heap[idx] = heap_next;
123
+ heap_next = idx;
124
+ }
125
+
126
+ function takeObject(idx) {
127
+ const ret = getObject(idx);
128
+ dropObject(idx);
129
+ return ret;
130
+ }
131
+
132
+ function isLikeNone(x) {
133
+ return x === undefined || x === null;
134
+ }
135
+
136
+ function debugString(val) {
137
+ // primitive types
138
+ const type = typeof val;
139
+ if (type == 'number' || type == 'boolean' || val == null) {
140
+ return `${val}`;
141
+ }
142
+ if (type == 'string') {
143
+ return `"${val}"`;
144
+ }
145
+ if (type == 'symbol') {
146
+ const description = val.description;
147
+ if (description == null) {
148
+ return 'Symbol';
149
+ } else {
150
+ return `Symbol(${description})`;
151
+ }
152
+ }
153
+ if (type == 'function') {
154
+ const name = val.name;
155
+ if (typeof name == 'string' && name.length > 0) {
156
+ return `Function(${name})`;
157
+ } else {
158
+ return 'Function';
159
+ }
160
+ }
161
+ // objects
162
+ if (Array.isArray(val)) {
163
+ const length = val.length;
164
+ let debug = '[';
165
+ if (length > 0) {
166
+ debug += debugString(val[0]);
167
+ }
168
+ for(let i = 1; i < length; i++) {
169
+ debug += ', ' + debugString(val[i]);
170
+ }
171
+ debug += ']';
172
+ return debug;
173
+ }
174
+ // Test for built-in
175
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
176
+ let className;
177
+ if (builtInMatches && builtInMatches.length > 1) {
178
+ className = builtInMatches[1];
179
+ } else {
180
+ // Failed to match the standard '[object ClassName]'
181
+ return toString.call(val);
182
+ }
183
+ if (className == 'Object') {
184
+ // we're a user defined class or Object
185
+ // JSON.stringify avoids problems with cycles, and is generally much
186
+ // easier than looping through ownProperties of `val`.
187
+ try {
188
+ return 'Object(' + JSON.stringify(val) + ')';
189
+ } catch (_) {
190
+ return 'Object';
191
+ }
192
+ }
193
+ // errors
194
+ if (val instanceof Error) {
195
+ return `${val.name}: ${val.message}\n${val.stack}`;
196
+ }
197
+ // TODO we could test for more things here, like `Set`s and `Map`s.
198
+ return className;
199
+ }
200
+
201
+ function getArrayJsValueFromWasm0(ptr, len) {
202
+ ptr = ptr >>> 0;
203
+ const mem = getDataViewMemory0();
204
+ const result = [];
205
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
206
+ result.push(takeObject(mem.getUint32(i, true)));
207
+ }
208
+ return result;
209
+ }
210
+ /**
211
+ * Initialize the WASM module with panic hooks for better error messages
212
+ */
213
+ exports.init = function() {
214
+ wasm.init();
215
+ };
216
+
217
+ const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
218
+ ? { register: () => {}, unregister: () => {} }
219
+ : new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr >>> 0, 1));
220
+ /**
221
+ * Quillmark WASM Engine
222
+ *
223
+ * Create once, register Quills, render markdown. That's it.
224
+ */
225
+ class Quillmark {
226
+
227
+ __destroy_into_raw() {
228
+ const ptr = this.__wbg_ptr;
229
+ this.__wbg_ptr = 0;
230
+ QuillmarkFinalization.unregister(this);
231
+ return ptr;
232
+ }
233
+
234
+ free() {
235
+ const ptr = this.__destroy_into_raw();
236
+ wasm.__wbg_quillmark_free(ptr, 0);
237
+ }
238
+ /**
239
+ * JavaScript constructor: `new Quillmark()`
240
+ */
241
+ constructor() {
242
+ const ret = wasm.quillmark_new();
243
+ this.__wbg_ptr = ret >>> 0;
244
+ QuillmarkFinalization.register(this, this.__wbg_ptr, this);
245
+ return this;
246
+ }
247
+ /**
248
+ * Parse markdown into a ParsedDocument
249
+ *
250
+ * This is the first step in the workflow. The returned ParsedDocument contains
251
+ * the parsed YAML frontmatter fields and the quill_tag (from QUILL field or "__default__").
252
+ * @param {string} markdown
253
+ * @returns {ParsedDocument}
254
+ */
255
+ static parseMarkdown(markdown) {
256
+ try {
257
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
258
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
259
+ const len0 = WASM_VECTOR_LEN;
260
+ wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
261
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
262
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
263
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
264
+ if (r2) {
265
+ throw takeObject(r1);
266
+ }
267
+ return takeObject(r0);
268
+ } finally {
269
+ wasm.__wbindgen_add_to_stack_pointer(16);
270
+ }
271
+ }
272
+ /**
273
+ * Register a Quill template bundle
274
+ *
275
+ * Accepts either a JSON string or a JsValue object representing the Quill file tree.
276
+ * Validation happens automatically on registration.
277
+ * @param {any} quill_json
278
+ * @returns {QuillInfo}
279
+ */
280
+ registerQuill(quill_json) {
281
+ try {
282
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
283
+ wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
284
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
285
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
286
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
287
+ if (r2) {
288
+ throw takeObject(r1);
289
+ }
290
+ return takeObject(r0);
291
+ } finally {
292
+ wasm.__wbindgen_add_to_stack_pointer(16);
293
+ }
294
+ }
295
+ /**
296
+ * Get shallow information about a registered Quill
297
+ *
298
+ * This returns metadata, backend info, field schemas, and supported formats
299
+ * that consumers need to configure render options for the next step.
300
+ * @param {string} name
301
+ * @returns {QuillInfo}
302
+ */
303
+ getQuillInfo(name) {
304
+ try {
305
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
306
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
307
+ const len0 = WASM_VECTOR_LEN;
308
+ wasm.quillmark_getQuillInfo(retptr, this.__wbg_ptr, ptr0, len0);
309
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
310
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
311
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
312
+ if (r2) {
313
+ throw takeObject(r1);
314
+ }
315
+ return takeObject(r0);
316
+ } finally {
317
+ wasm.__wbindgen_add_to_stack_pointer(16);
318
+ }
319
+ }
320
+ /**
321
+ * Process markdown through template engine (debugging)
322
+ *
323
+ * Returns template source code (Typst, LaTeX, etc.)
324
+ * @param {string} quill_name
325
+ * @param {string} markdown
326
+ * @returns {string}
327
+ */
328
+ processPlate(quill_name, markdown) {
329
+ let deferred4_0;
330
+ let deferred4_1;
331
+ try {
332
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
333
+ const ptr0 = passStringToWasm0(quill_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
334
+ const len0 = WASM_VECTOR_LEN;
335
+ const ptr1 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
336
+ const len1 = WASM_VECTOR_LEN;
337
+ wasm.quillmark_processPlate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
338
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
339
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
340
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
341
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
342
+ var ptr3 = r0;
343
+ var len3 = r1;
344
+ if (r3) {
345
+ ptr3 = 0; len3 = 0;
346
+ throw takeObject(r2);
347
+ }
348
+ deferred4_0 = ptr3;
349
+ deferred4_1 = len3;
350
+ return getStringFromWasm0(ptr3, len3);
351
+ } finally {
352
+ wasm.__wbindgen_add_to_stack_pointer(16);
353
+ wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
354
+ }
355
+ }
356
+ /**
357
+ * Perform a dry run validation without backend compilation.
358
+ *
359
+ * Executes parsing, schema validation, and template composition to
360
+ * surface input errors quickly. Returns successfully on valid input,
361
+ * or throws an error with diagnostic payload on failure.
362
+ *
363
+ * This is useful for fast feedback loops in LLM-driven document generation.
364
+ * @param {string} quill_name
365
+ * @param {string} markdown
366
+ */
367
+ dryRun(quill_name, markdown) {
368
+ try {
369
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
370
+ const ptr0 = passStringToWasm0(quill_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
371
+ const len0 = WASM_VECTOR_LEN;
372
+ const ptr1 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
373
+ const len1 = WASM_VECTOR_LEN;
374
+ wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
375
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
376
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
377
+ if (r1) {
378
+ throw takeObject(r0);
379
+ }
380
+ } finally {
381
+ wasm.__wbindgen_add_to_stack_pointer(16);
382
+ }
383
+ }
384
+ /**
385
+ * Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
386
+ *
387
+ * Uses the Quill specified in options.quill_name if provided,
388
+ * otherwise infers it from the ParsedDocument's quill_tag field.
389
+ * @param {ParsedDocument} parsed_wasm
390
+ * @param {RenderOptions} opts
391
+ * @returns {RenderResult}
392
+ */
393
+ render(parsed_wasm, opts) {
394
+ try {
395
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
396
+ wasm.quillmark_render(retptr, this.__wbg_ptr, addHeapObject(parsed_wasm), addHeapObject(opts));
397
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
398
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
399
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
400
+ if (r2) {
401
+ throw takeObject(r1);
402
+ }
403
+ return takeObject(r0);
404
+ } finally {
405
+ wasm.__wbindgen_add_to_stack_pointer(16);
406
+ }
407
+ }
408
+ /**
409
+ * List registered Quill names
410
+ * @returns {string[]}
411
+ */
412
+ listQuills() {
413
+ try {
414
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
415
+ wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
416
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
417
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
418
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
419
+ wasm.__wbindgen_export_3(r0, r1 * 4, 4);
420
+ return v1;
421
+ } finally {
422
+ wasm.__wbindgen_add_to_stack_pointer(16);
423
+ }
424
+ }
425
+ /**
426
+ * Unregister a Quill (free memory)
427
+ * @param {string} name
428
+ */
429
+ unregisterQuill(name) {
430
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
431
+ const len0 = WASM_VECTOR_LEN;
432
+ wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
433
+ }
434
+ }
435
+ if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
436
+
437
+ exports.Quillmark = Quillmark;
438
+
439
+ exports.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
440
+ const ret = Error(getStringFromWasm0(arg0, arg1));
441
+ return addHeapObject(ret);
442
+ };
443
+
444
+ exports.__wbg_String_eecc4a11987127d6 = function(arg0, arg1) {
445
+ const ret = String(getObject(arg1));
446
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
447
+ const len1 = WASM_VECTOR_LEN;
448
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
449
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
450
+ };
451
+
452
+ exports.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
453
+ const ret = getObject(arg0).call(getObject(arg1));
454
+ return addHeapObject(ret);
455
+ }, arguments) };
456
+
457
+ exports.__wbg_done_75ed0ee6dd243d9d = function(arg0) {
458
+ const ret = getObject(arg0).done;
459
+ return ret;
460
+ };
461
+
462
+ exports.__wbg_entries_2be2f15bd5554996 = function(arg0) {
463
+ const ret = Object.entries(getObject(arg0));
464
+ return addHeapObject(ret);
465
+ };
466
+
467
+ exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
468
+ let deferred0_0;
469
+ let deferred0_1;
470
+ try {
471
+ deferred0_0 = arg0;
472
+ deferred0_1 = arg1;
473
+ console.error(getStringFromWasm0(arg0, arg1));
474
+ } finally {
475
+ wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1);
476
+ }
477
+ };
478
+
479
+ exports.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
480
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
481
+ }, arguments) };
482
+
483
+ exports.__wbg_getTime_6bb3f64e0f18f817 = function(arg0) {
484
+ const ret = getObject(arg0).getTime();
485
+ return ret;
486
+ };
487
+
488
+ exports.__wbg_getUTCDate_e0a363240ba1c112 = function(arg0) {
489
+ const ret = getObject(arg0).getUTCDate();
490
+ return ret;
491
+ };
492
+
493
+ exports.__wbg_getUTCFullYear_811e319dd2642ac0 = function(arg0) {
494
+ const ret = getObject(arg0).getUTCFullYear();
495
+ return ret;
496
+ };
497
+
498
+ exports.__wbg_getUTCMonth_ed74da16cf6f6c98 = function(arg0) {
499
+ const ret = getObject(arg0).getUTCMonth();
500
+ return ret;
501
+ };
502
+
503
+ exports.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
504
+ const ret = getObject(arg0)[arg1 >>> 0];
505
+ return addHeapObject(ret);
506
+ };
507
+
508
+ exports.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
509
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
510
+ return addHeapObject(ret);
511
+ }, arguments) };
512
+
513
+ exports.__wbg_getwithrefkey_6550b2c093d2eb18 = function(arg0, arg1) {
514
+ const ret = getObject(arg0)[getObject(arg1)];
515
+ return addHeapObject(ret);
516
+ };
517
+
518
+ exports.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd = function(arg0) {
519
+ let result;
520
+ try {
521
+ result = getObject(arg0) instanceof ArrayBuffer;
522
+ } catch (_) {
523
+ result = false;
524
+ }
525
+ const ret = result;
526
+ return ret;
527
+ };
528
+
529
+ exports.__wbg_instanceof_Uint8Array_9a8378d955933db7 = function(arg0) {
530
+ let result;
531
+ try {
532
+ result = getObject(arg0) instanceof Uint8Array;
533
+ } catch (_) {
534
+ result = false;
535
+ }
536
+ const ret = result;
537
+ return ret;
538
+ };
539
+
540
+ exports.__wbg_isArray_030cce220591fb41 = function(arg0) {
541
+ const ret = Array.isArray(getObject(arg0));
542
+ return ret;
543
+ };
544
+
545
+ exports.__wbg_isSafeInteger_1c0d1af5542e102a = function(arg0) {
546
+ const ret = Number.isSafeInteger(getObject(arg0));
547
+ return ret;
548
+ };
549
+
550
+ exports.__wbg_iterator_f370b34483c71a1c = function() {
551
+ const ret = Symbol.iterator;
552
+ return addHeapObject(ret);
553
+ };
554
+
555
+ exports.__wbg_length_186546c51cd61acd = function(arg0) {
556
+ const ret = getObject(arg0).length;
557
+ return ret;
558
+ };
559
+
560
+ exports.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
561
+ const ret = getObject(arg0).length;
562
+ return ret;
563
+ };
564
+
565
+ exports.__wbg_new0_b0a0a38c201e6df5 = function() {
566
+ const ret = new Date();
567
+ return addHeapObject(ret);
568
+ };
569
+
570
+ exports.__wbg_new_19c25a3f2fa63a02 = function() {
571
+ const ret = new Object();
572
+ return addHeapObject(ret);
573
+ };
574
+
575
+ exports.__wbg_new_1f3a344cf3123716 = function() {
576
+ const ret = new Array();
577
+ return addHeapObject(ret);
578
+ };
579
+
580
+ exports.__wbg_new_2ff1f68f3676ea53 = function() {
581
+ const ret = new Map();
582
+ return addHeapObject(ret);
583
+ };
584
+
585
+ exports.__wbg_new_5a2ae4557f92b50e = function(arg0) {
586
+ const ret = new Date(getObject(arg0));
587
+ return addHeapObject(ret);
588
+ };
589
+
590
+ exports.__wbg_new_638ebfaedbf32a5e = function(arg0) {
591
+ const ret = new Uint8Array(getObject(arg0));
592
+ return addHeapObject(ret);
593
+ };
594
+
595
+ exports.__wbg_new_8a6f238a6ece86ea = function() {
596
+ const ret = new Error();
597
+ return addHeapObject(ret);
598
+ };
599
+
600
+ exports.__wbg_next_5b3530e612fde77d = function(arg0) {
601
+ const ret = getObject(arg0).next;
602
+ return addHeapObject(ret);
603
+ };
604
+
605
+ exports.__wbg_next_692e82279131b03c = function() { return handleError(function (arg0) {
606
+ const ret = getObject(arg0).next();
607
+ return addHeapObject(ret);
608
+ }, arguments) };
609
+
610
+ exports.__wbg_now_1e80617bcee43265 = function() {
611
+ const ret = Date.now();
612
+ return ret;
613
+ };
614
+
615
+ exports.__wbg_prototypesetcall_3d4a26c1ed734349 = function(arg0, arg1, arg2) {
616
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
617
+ };
618
+
619
+ exports.__wbg_set_3807d5f0bfc24aa7 = function(arg0, arg1, arg2) {
620
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
621
+ };
622
+
623
+ exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
624
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
625
+ };
626
+
627
+ exports.__wbg_set_90f6c0f7bd8c0415 = function(arg0, arg1, arg2) {
628
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
629
+ };
630
+
631
+ exports.__wbg_set_b7f1cf4fae26fe2a = function(arg0, arg1, arg2) {
632
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
633
+ return addHeapObject(ret);
634
+ };
635
+
636
+ exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
637
+ const ret = getObject(arg1).stack;
638
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
639
+ const len1 = WASM_VECTOR_LEN;
640
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
641
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
642
+ };
643
+
644
+ exports.__wbg_stringify_b98c93d0a190446a = function() { return handleError(function (arg0) {
645
+ const ret = JSON.stringify(getObject(arg0));
646
+ return addHeapObject(ret);
647
+ }, arguments) };
648
+
649
+ exports.__wbg_value_dd9372230531eade = function(arg0) {
650
+ const ret = getObject(arg0).value;
651
+ return addHeapObject(ret);
652
+ };
653
+
654
+ exports.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1 = function(arg0, arg1) {
655
+ const v = getObject(arg1);
656
+ const ret = typeof(v) === 'bigint' ? v : undefined;
657
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
658
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
659
+ };
660
+
661
+ exports.__wbg_wbindgenbooleanget_3fe6f642c7d97746 = function(arg0) {
662
+ const v = getObject(arg0);
663
+ const ret = typeof(v) === 'boolean' ? v : undefined;
664
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
665
+ };
666
+
667
+ exports.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
668
+ const ret = debugString(getObject(arg1));
669
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
670
+ const len1 = WASM_VECTOR_LEN;
671
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
672
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
673
+ };
674
+
675
+ exports.__wbg_wbindgenin_d7a1ee10933d2d55 = function(arg0, arg1) {
676
+ const ret = getObject(arg0) in getObject(arg1);
677
+ return ret;
678
+ };
679
+
680
+ exports.__wbg_wbindgenisbigint_ecb90cc08a5a9154 = function(arg0) {
681
+ const ret = typeof(getObject(arg0)) === 'bigint';
682
+ return ret;
683
+ };
684
+
685
+ exports.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function(arg0) {
686
+ const ret = typeof(getObject(arg0)) === 'function';
687
+ return ret;
688
+ };
689
+
690
+ exports.__wbg_wbindgenisobject_307a53c6bd97fbf8 = function(arg0) {
691
+ const val = getObject(arg0);
692
+ const ret = typeof(val) === 'object' && val !== null;
693
+ return ret;
694
+ };
695
+
696
+ exports.__wbg_wbindgenisstring_d4fa939789f003b0 = function(arg0) {
697
+ const ret = typeof(getObject(arg0)) === 'string';
698
+ return ret;
699
+ };
700
+
701
+ exports.__wbg_wbindgenisundefined_c4b71d073b92f3c5 = function(arg0) {
702
+ const ret = getObject(arg0) === undefined;
703
+ return ret;
704
+ };
705
+
706
+ exports.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58 = function(arg0, arg1) {
707
+ const ret = getObject(arg0) === getObject(arg1);
708
+ return ret;
709
+ };
710
+
711
+ exports.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1 = function(arg0, arg1) {
712
+ const ret = getObject(arg0) == getObject(arg1);
713
+ return ret;
714
+ };
715
+
716
+ exports.__wbg_wbindgennumberget_f74b4c7525ac05cb = function(arg0, arg1) {
717
+ const obj = getObject(arg1);
718
+ const ret = typeof(obj) === 'number' ? obj : undefined;
719
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
720
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
721
+ };
722
+
723
+ exports.__wbg_wbindgenstringget_0f16a6ddddef376f = function(arg0, arg1) {
724
+ const obj = getObject(arg1);
725
+ const ret = typeof(obj) === 'string' ? obj : undefined;
726
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
727
+ var len1 = WASM_VECTOR_LEN;
728
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
729
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
730
+ };
731
+
732
+ exports.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
733
+ throw new Error(getStringFromWasm0(arg0, arg1));
734
+ };
735
+
736
+ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
737
+ // Cast intrinsic for `Ref(String) -> Externref`.
738
+ const ret = getStringFromWasm0(arg0, arg1);
739
+ return addHeapObject(ret);
740
+ };
741
+
742
+ exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
743
+ // Cast intrinsic for `U64 -> Externref`.
744
+ const ret = BigInt.asUintN(64, arg0);
745
+ return addHeapObject(ret);
746
+ };
747
+
748
+ exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
749
+ // Cast intrinsic for `I64 -> Externref`.
750
+ const ret = arg0;
751
+ return addHeapObject(ret);
752
+ };
753
+
754
+ exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
755
+ // Cast intrinsic for `F64 -> Externref`.
756
+ const ret = arg0;
757
+ return addHeapObject(ret);
758
+ };
759
+
760
+ exports.__wbindgen_object_clone_ref = function(arg0) {
761
+ const ret = getObject(arg0);
762
+ return addHeapObject(ret);
763
+ };
764
+
765
+ exports.__wbindgen_object_drop_ref = function(arg0) {
766
+ takeObject(arg0);
767
+ };
768
+
769
+ const wasmPath = `${__dirname}/wasm_bg.wasm`;
770
+ const wasmBytes = require('fs').readFileSync(wasmPath);
771
+ const wasmModule = new WebAssembly.Module(wasmBytes);
772
+ const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
773
+
774
+ wasm.__wbindgen_start();
775
+