@hypen-space/core 0.2.2 → 0.2.3

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.
@@ -0,0 +1,751 @@
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
+ function addToExternrefTable0(obj) {
28
+ const idx = wasm.__externref_table_alloc();
29
+ wasm.__wbindgen_export_2.set(idx, obj);
30
+ return idx;
31
+ }
32
+
33
+ function handleError(f, args) {
34
+ try {
35
+ return f.apply(this, args);
36
+ } catch (e) {
37
+ const idx = addToExternrefTable0(e);
38
+ wasm.__wbindgen_exn_store(idx);
39
+ }
40
+ }
41
+
42
+ function getArrayU8FromWasm0(ptr, len) {
43
+ ptr = ptr >>> 0;
44
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
45
+ }
46
+
47
+ function isLikeNone(x) {
48
+ return x === undefined || x === null;
49
+ }
50
+
51
+ let cachedDataViewMemory0 = null;
52
+
53
+ function getDataViewMemory0() {
54
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
55
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
56
+ }
57
+ return cachedDataViewMemory0;
58
+ }
59
+
60
+ function debugString(val) {
61
+ // primitive types
62
+ const type = typeof val;
63
+ if (type == 'number' || type == 'boolean' || val == null) {
64
+ return `${val}`;
65
+ }
66
+ if (type == 'string') {
67
+ return `"${val}"`;
68
+ }
69
+ if (type == 'symbol') {
70
+ const description = val.description;
71
+ if (description == null) {
72
+ return 'Symbol';
73
+ } else {
74
+ return `Symbol(${description})`;
75
+ }
76
+ }
77
+ if (type == 'function') {
78
+ const name = val.name;
79
+ if (typeof name == 'string' && name.length > 0) {
80
+ return `Function(${name})`;
81
+ } else {
82
+ return 'Function';
83
+ }
84
+ }
85
+ // objects
86
+ if (Array.isArray(val)) {
87
+ const length = val.length;
88
+ let debug = '[';
89
+ if (length > 0) {
90
+ debug += debugString(val[0]);
91
+ }
92
+ for(let i = 1; i < length; i++) {
93
+ debug += ', ' + debugString(val[i]);
94
+ }
95
+ debug += ']';
96
+ return debug;
97
+ }
98
+ // Test for built-in
99
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
100
+ let className;
101
+ if (builtInMatches && builtInMatches.length > 1) {
102
+ className = builtInMatches[1];
103
+ } else {
104
+ // Failed to match the standard '[object ClassName]'
105
+ return toString.call(val);
106
+ }
107
+ if (className == 'Object') {
108
+ // we're a user defined class or Object
109
+ // JSON.stringify avoids problems with cycles, and is generally much
110
+ // easier than looping through ownProperties of `val`.
111
+ try {
112
+ return 'Object(' + JSON.stringify(val) + ')';
113
+ } catch (_) {
114
+ return 'Object';
115
+ }
116
+ }
117
+ // errors
118
+ if (val instanceof Error) {
119
+ return `${val.name}: ${val.message}\n${val.stack}`;
120
+ }
121
+ // TODO we could test for more things here, like `Set`s and `Map`s.
122
+ return className;
123
+ }
124
+
125
+ let WASM_VECTOR_LEN = 0;
126
+
127
+ const cachedTextEncoder = new TextEncoder();
128
+
129
+ if (!('encodeInto' in cachedTextEncoder)) {
130
+ cachedTextEncoder.encodeInto = function (arg, view) {
131
+ const buf = cachedTextEncoder.encode(arg);
132
+ view.set(buf);
133
+ return {
134
+ read: arg.length,
135
+ written: buf.length
136
+ };
137
+ }
138
+ }
139
+
140
+ function passStringToWasm0(arg, malloc, realloc) {
141
+
142
+ if (realloc === undefined) {
143
+ const buf = cachedTextEncoder.encode(arg);
144
+ const ptr = malloc(buf.length, 1) >>> 0;
145
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
146
+ WASM_VECTOR_LEN = buf.length;
147
+ return ptr;
148
+ }
149
+
150
+ let len = arg.length;
151
+ let ptr = malloc(len, 1) >>> 0;
152
+
153
+ const mem = getUint8ArrayMemory0();
154
+
155
+ let offset = 0;
156
+
157
+ for (; offset < len; offset++) {
158
+ const code = arg.charCodeAt(offset);
159
+ if (code > 0x7F) break;
160
+ mem[ptr + offset] = code;
161
+ }
162
+
163
+ if (offset !== len) {
164
+ if (offset !== 0) {
165
+ arg = arg.slice(offset);
166
+ }
167
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
168
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
169
+ const ret = cachedTextEncoder.encodeInto(arg, view);
170
+
171
+ offset += ret.written;
172
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
173
+ }
174
+
175
+ WASM_VECTOR_LEN = offset;
176
+ return ptr;
177
+ }
178
+
179
+ function takeFromExternrefTable0(idx) {
180
+ const value = wasm.__wbindgen_export_2.get(idx);
181
+ wasm.__externref_table_dealloc(idx);
182
+ return value;
183
+ }
184
+
185
+ function passArrayJsValueToWasm0(array, malloc) {
186
+ const ptr = malloc(array.length * 4, 4) >>> 0;
187
+ for (let i = 0; i < array.length; i++) {
188
+ const add = addToExternrefTable0(array[i]);
189
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
190
+ }
191
+ WASM_VECTOR_LEN = array.length;
192
+ return ptr;
193
+ }
194
+ /**
195
+ * Export patches as JSON string (for debugging)
196
+ * @param {any} patches
197
+ * @returns {string}
198
+ */
199
+ exports.patchesToJson = function(patches) {
200
+ let deferred2_0;
201
+ let deferred2_1;
202
+ try {
203
+ const ret = wasm.patchesToJson(patches);
204
+ var ptr1 = ret[0];
205
+ var len1 = ret[1];
206
+ if (ret[3]) {
207
+ ptr1 = 0; len1 = 0;
208
+ throw takeFromExternrefTable0(ret[2]);
209
+ }
210
+ deferred2_0 = ptr1;
211
+ deferred2_1 = len1;
212
+ return getStringFromWasm0(ptr1, len1);
213
+ } finally {
214
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
215
+ }
216
+ };
217
+
218
+ /**
219
+ * Parse Hypen DSL and return AST as JSON
220
+ * @param {string} source
221
+ * @returns {string}
222
+ */
223
+ exports.parseToJson = function(source) {
224
+ let deferred3_0;
225
+ let deferred3_1;
226
+ try {
227
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
228
+ const len0 = WASM_VECTOR_LEN;
229
+ const ret = wasm.parseToJson(ptr0, len0);
230
+ var ptr2 = ret[0];
231
+ var len2 = ret[1];
232
+ if (ret[3]) {
233
+ ptr2 = 0; len2 = 0;
234
+ throw takeFromExternrefTable0(ret[2]);
235
+ }
236
+ deferred3_0 = ptr2;
237
+ deferred3_1 = len2;
238
+ return getStringFromWasm0(ptr2, len2);
239
+ } finally {
240
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
241
+ }
242
+ };
243
+
244
+ exports.main = function() {
245
+ wasm.main();
246
+ };
247
+
248
+ const WasmEngineFinalization = (typeof FinalizationRegistry === 'undefined')
249
+ ? { register: () => {}, unregister: () => {} }
250
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmengine_free(ptr >>> 0, 1));
251
+ /**
252
+ * WASM-exported engine instance
253
+ * Uses Rc<RefCell<>> instead of Send+Sync for WASM single-threaded environment
254
+ */
255
+ class WasmEngine {
256
+
257
+ __destroy_into_raw() {
258
+ const ptr = this.__wbg_ptr;
259
+ this.__wbg_ptr = 0;
260
+ WasmEngineFinalization.unregister(this);
261
+ return ptr;
262
+ }
263
+
264
+ free() {
265
+ const ptr = this.__destroy_into_raw();
266
+ wasm.__wbg_wasmengine_free(ptr, 0);
267
+ }
268
+ /**
269
+ * Create a new engine instance
270
+ */
271
+ constructor() {
272
+ const ret = wasm.wasmengine_new();
273
+ this.__wbg_ptr = ret >>> 0;
274
+ WasmEngineFinalization.register(this, this.__wbg_ptr, this);
275
+ return this;
276
+ }
277
+ /**
278
+ * Parse and render Hypen DSL source code
279
+ * @param {string} source
280
+ */
281
+ renderSource(source) {
282
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
283
+ const len0 = WASM_VECTOR_LEN;
284
+ const ret = wasm.wasmengine_renderSource(this.__wbg_ptr, ptr0, len0);
285
+ if (ret[1]) {
286
+ throw takeFromExternrefTable0(ret[0]);
287
+ }
288
+ }
289
+ /**
290
+ * Set the render callback that receives patches
291
+ * @param {Function} callback
292
+ */
293
+ setRenderCallback(callback) {
294
+ wasm.wasmengine_setRenderCallback(this.__wbg_ptr, callback);
295
+ }
296
+ /**
297
+ * Set the component resolver callback
298
+ * The resolver receives (componentName, contextPath) and should return
299
+ * { source: string, path: string } or null
300
+ *
301
+ * contextPath is the path of the component that's referencing this component
302
+ * The returned path should be the resolved absolute path to the component file
303
+ * @param {Function} resolver
304
+ */
305
+ setComponentResolver(resolver) {
306
+ wasm.wasmengine_setComponentResolver(this.__wbg_ptr, resolver);
307
+ }
308
+ /**
309
+ * Register a primitive element (like Text, Button, etc.) to skip component resolution
310
+ * This prevents unnecessary resolver calls for built-in DOM elements
311
+ * @param {string} name
312
+ */
313
+ registerPrimitive(name) {
314
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
315
+ const len0 = WASM_VECTOR_LEN;
316
+ wasm.wasmengine_registerPrimitive(this.__wbg_ptr, ptr0, len0);
317
+ }
318
+ /**
319
+ * Render a component source (for lazy loading routes)
320
+ * This allows rendering a component on-demand
321
+ * @param {string} source
322
+ */
323
+ renderLazyComponent(source) {
324
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
325
+ const len0 = WASM_VECTOR_LEN;
326
+ const ret = wasm.wasmengine_renderLazyComponent(this.__wbg_ptr, ptr0, len0);
327
+ if (ret[1]) {
328
+ throw takeFromExternrefTable0(ret[0]);
329
+ }
330
+ }
331
+ /**
332
+ * Render a component into a specific parent node (subtree rendering)
333
+ * This is used for lazy routing where components are rendered on-demand into route containers
334
+ *
335
+ * # Arguments
336
+ * * `source` - The Hypen DSL source to parse and render
337
+ * * `parent_node_id_str` - The serialized node ID string of the parent element
338
+ * * `state_js` - The state to use for rendering (as JsValue)
339
+ * @param {string} source
340
+ * @param {string} parent_node_id_str
341
+ * @param {any} state_js
342
+ */
343
+ renderInto(source, parent_node_id_str, state_js) {
344
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
345
+ const len0 = WASM_VECTOR_LEN;
346
+ const ptr1 = passStringToWasm0(parent_node_id_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
347
+ const len1 = WASM_VECTOR_LEN;
348
+ const ret = wasm.wasmengine_renderInto(this.__wbg_ptr, ptr0, len0, ptr1, len1, state_js);
349
+ if (ret[1]) {
350
+ throw takeFromExternrefTable0(ret[0]);
351
+ }
352
+ }
353
+ /**
354
+ * Update state from JavaScript
355
+ * @param {any} state_patch
356
+ */
357
+ updateState(state_patch) {
358
+ const ret = wasm.wasmengine_updateState(this.__wbg_ptr, state_patch);
359
+ if (ret[1]) {
360
+ throw takeFromExternrefTable0(ret[0]);
361
+ }
362
+ }
363
+ /**
364
+ * Update state using sparse path-value pairs
365
+ * More efficient than updateState for large state objects when only a few paths changed
366
+ *
367
+ * # Arguments
368
+ * * `paths_js` - Array of changed paths (e.g., ["user.name", "count"])
369
+ * * `values_js` - Object mapping paths to their new values (e.g., { "user.name": "Bob", "count": 42 })
370
+ * @param {any} paths_js
371
+ * @param {any} values_js
372
+ */
373
+ updateStateSparse(paths_js, values_js) {
374
+ const ret = wasm.wasmengine_updateStateSparse(this.__wbg_ptr, paths_js, values_js);
375
+ if (ret[1]) {
376
+ throw takeFromExternrefTable0(ret[0]);
377
+ }
378
+ }
379
+ /**
380
+ * Dispatch an action
381
+ * @param {string} name
382
+ * @param {any} payload
383
+ */
384
+ dispatchAction(name, payload) {
385
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
386
+ const len0 = WASM_VECTOR_LEN;
387
+ const ret = wasm.wasmengine_dispatchAction(this.__wbg_ptr, ptr0, len0, payload);
388
+ if (ret[1]) {
389
+ throw takeFromExternrefTable0(ret[0]);
390
+ }
391
+ }
392
+ /**
393
+ * Register an action handler
394
+ * @param {string} action_name
395
+ * @param {Function} handler
396
+ */
397
+ onAction(action_name, handler) {
398
+ const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
399
+ const len0 = WASM_VECTOR_LEN;
400
+ wasm.wasmengine_onAction(this.__wbg_ptr, ptr0, len0, handler);
401
+ }
402
+ /**
403
+ * Clear the engine tree (useful when switching samples)
404
+ */
405
+ clearTree() {
406
+ wasm.wasmengine_clearTree(this.__wbg_ptr);
407
+ }
408
+ /**
409
+ * Debug method to inspect parsed components
410
+ * @param {string} source
411
+ * @returns {string}
412
+ */
413
+ debugParseComponent(source) {
414
+ let deferred3_0;
415
+ let deferred3_1;
416
+ try {
417
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
418
+ const len0 = WASM_VECTOR_LEN;
419
+ const ret = wasm.wasmengine_debugParseComponent(this.__wbg_ptr, ptr0, len0);
420
+ var ptr2 = ret[0];
421
+ var len2 = ret[1];
422
+ if (ret[3]) {
423
+ ptr2 = 0; len2 = 0;
424
+ throw takeFromExternrefTable0(ret[2]);
425
+ }
426
+ deferred3_0 = ptr2;
427
+ deferred3_1 = len2;
428
+ return getStringFromWasm0(ptr2, len2);
429
+ } finally {
430
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
431
+ }
432
+ }
433
+ /**
434
+ * Initialize a module
435
+ * @param {string} name
436
+ * @param {string[]} actions
437
+ * @param {string[]} state_keys
438
+ * @param {any} initial_state
439
+ */
440
+ setModule(name, actions, state_keys, initial_state) {
441
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
442
+ const len0 = WASM_VECTOR_LEN;
443
+ const ptr1 = passArrayJsValueToWasm0(actions, wasm.__wbindgen_malloc);
444
+ const len1 = WASM_VECTOR_LEN;
445
+ const ptr2 = passArrayJsValueToWasm0(state_keys, wasm.__wbindgen_malloc);
446
+ const len2 = WASM_VECTOR_LEN;
447
+ const ret = wasm.wasmengine_setModule(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, initial_state);
448
+ if (ret[1]) {
449
+ throw takeFromExternrefTable0(ret[0]);
450
+ }
451
+ }
452
+ /**
453
+ * Get the current revision number
454
+ * @returns {bigint}
455
+ */
456
+ getRevision() {
457
+ const ret = wasm.wasmengine_getRevision(this.__wbg_ptr);
458
+ return BigInt.asUintN(64, ret);
459
+ }
460
+ }
461
+ if (Symbol.dispose) WasmEngine.prototype[Symbol.dispose] = WasmEngine.prototype.free;
462
+
463
+ exports.WasmEngine = WasmEngine;
464
+
465
+ exports.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
466
+ const ret = Error(getStringFromWasm0(arg0, arg1));
467
+ return ret;
468
+ };
469
+
470
+ exports.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
471
+ const ret = arg0.call(arg1);
472
+ return ret;
473
+ }, arguments) };
474
+
475
+ exports.__wbg_call_641db1bb5db5a579 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
476
+ const ret = arg0.call(arg1, arg2, arg3);
477
+ return ret;
478
+ }, arguments) };
479
+
480
+ exports.__wbg_call_a5400b25a865cfd8 = function() { return handleError(function (arg0, arg1, arg2) {
481
+ const ret = arg0.call(arg1, arg2);
482
+ return ret;
483
+ }, arguments) };
484
+
485
+ exports.__wbg_done_75ed0ee6dd243d9d = function(arg0) {
486
+ const ret = arg0.done;
487
+ return ret;
488
+ };
489
+
490
+ exports.__wbg_entries_2be2f15bd5554996 = function(arg0) {
491
+ const ret = Object.entries(arg0);
492
+ return ret;
493
+ };
494
+
495
+ exports.__wbg_error_99981e16d476aa5c = function(arg0) {
496
+ console.error(arg0);
497
+ };
498
+
499
+ exports.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
500
+ const ret = arg0[arg1 >>> 0];
501
+ return ret;
502
+ };
503
+
504
+ exports.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
505
+ const ret = Reflect.get(arg0, arg1);
506
+ return ret;
507
+ }, arguments) };
508
+
509
+ exports.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd = function(arg0) {
510
+ let result;
511
+ try {
512
+ result = arg0 instanceof ArrayBuffer;
513
+ } catch (_) {
514
+ result = false;
515
+ }
516
+ const ret = result;
517
+ return ret;
518
+ };
519
+
520
+ exports.__wbg_instanceof_Map_ebb01a5b6b5ffd0b = function(arg0) {
521
+ let result;
522
+ try {
523
+ result = arg0 instanceof Map;
524
+ } catch (_) {
525
+ result = false;
526
+ }
527
+ const ret = result;
528
+ return ret;
529
+ };
530
+
531
+ exports.__wbg_instanceof_Uint8Array_9a8378d955933db7 = function(arg0) {
532
+ let result;
533
+ try {
534
+ result = arg0 instanceof Uint8Array;
535
+ } catch (_) {
536
+ result = false;
537
+ }
538
+ const ret = result;
539
+ return ret;
540
+ };
541
+
542
+ exports.__wbg_isArray_030cce220591fb41 = function(arg0) {
543
+ const ret = Array.isArray(arg0);
544
+ return ret;
545
+ };
546
+
547
+ exports.__wbg_isSafeInteger_1c0d1af5542e102a = function(arg0) {
548
+ const ret = Number.isSafeInteger(arg0);
549
+ return ret;
550
+ };
551
+
552
+ exports.__wbg_iterator_f370b34483c71a1c = function() {
553
+ const ret = Symbol.iterator;
554
+ return ret;
555
+ };
556
+
557
+ exports.__wbg_length_186546c51cd61acd = function(arg0) {
558
+ const ret = arg0.length;
559
+ return ret;
560
+ };
561
+
562
+ exports.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
563
+ const ret = arg0.length;
564
+ return ret;
565
+ };
566
+
567
+ exports.__wbg_log_6c7b5f4f00b8ce3f = function(arg0) {
568
+ console.log(arg0);
569
+ };
570
+
571
+ exports.__wbg_new_19c25a3f2fa63a02 = function() {
572
+ const ret = new Object();
573
+ return ret;
574
+ };
575
+
576
+ exports.__wbg_new_1f3a344cf3123716 = function() {
577
+ const ret = new Array();
578
+ return ret;
579
+ };
580
+
581
+ exports.__wbg_new_2ff1f68f3676ea53 = function() {
582
+ const ret = new Map();
583
+ return ret;
584
+ };
585
+
586
+ exports.__wbg_new_638ebfaedbf32a5e = function(arg0) {
587
+ const ret = new Uint8Array(arg0);
588
+ return ret;
589
+ };
590
+
591
+ exports.__wbg_next_5b3530e612fde77d = function(arg0) {
592
+ const ret = arg0.next;
593
+ return ret;
594
+ };
595
+
596
+ exports.__wbg_next_692e82279131b03c = function() { return handleError(function (arg0) {
597
+ const ret = arg0.next();
598
+ return ret;
599
+ }, arguments) };
600
+
601
+ exports.__wbg_prototypesetcall_3d4a26c1ed734349 = function(arg0, arg1, arg2) {
602
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
603
+ };
604
+
605
+ exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
606
+ arg0[arg1] = arg2;
607
+ };
608
+
609
+ exports.__wbg_set_90f6c0f7bd8c0415 = function(arg0, arg1, arg2) {
610
+ arg0[arg1 >>> 0] = arg2;
611
+ };
612
+
613
+ exports.__wbg_set_b7f1cf4fae26fe2a = function(arg0, arg1, arg2) {
614
+ const ret = arg0.set(arg1, arg2);
615
+ return ret;
616
+ };
617
+
618
+ exports.__wbg_value_dd9372230531eade = function(arg0) {
619
+ const ret = arg0.value;
620
+ return ret;
621
+ };
622
+
623
+ exports.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1 = function(arg0, arg1) {
624
+ const v = arg1;
625
+ const ret = typeof(v) === 'bigint' ? v : undefined;
626
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
627
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
628
+ };
629
+
630
+ exports.__wbg_wbindgenbooleanget_3fe6f642c7d97746 = function(arg0) {
631
+ const v = arg0;
632
+ const ret = typeof(v) === 'boolean' ? v : undefined;
633
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
634
+ };
635
+
636
+ exports.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
637
+ const ret = debugString(arg1);
638
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
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_wbindgenin_d7a1ee10933d2d55 = function(arg0, arg1) {
645
+ const ret = arg0 in arg1;
646
+ return ret;
647
+ };
648
+
649
+ exports.__wbg_wbindgenisbigint_ecb90cc08a5a9154 = function(arg0) {
650
+ const ret = typeof(arg0) === 'bigint';
651
+ return ret;
652
+ };
653
+
654
+ exports.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function(arg0) {
655
+ const ret = typeof(arg0) === 'function';
656
+ return ret;
657
+ };
658
+
659
+ exports.__wbg_wbindgenisnull_f3037694abe4d97a = function(arg0) {
660
+ const ret = arg0 === null;
661
+ return ret;
662
+ };
663
+
664
+ exports.__wbg_wbindgenisobject_307a53c6bd97fbf8 = function(arg0) {
665
+ const val = arg0;
666
+ const ret = typeof(val) === 'object' && val !== null;
667
+ return ret;
668
+ };
669
+
670
+ exports.__wbg_wbindgenisstring_d4fa939789f003b0 = function(arg0) {
671
+ const ret = typeof(arg0) === 'string';
672
+ return ret;
673
+ };
674
+
675
+ exports.__wbg_wbindgenisundefined_c4b71d073b92f3c5 = function(arg0) {
676
+ const ret = arg0 === undefined;
677
+ return ret;
678
+ };
679
+
680
+ exports.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58 = function(arg0, arg1) {
681
+ const ret = arg0 === arg1;
682
+ return ret;
683
+ };
684
+
685
+ exports.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1 = function(arg0, arg1) {
686
+ const ret = arg0 == arg1;
687
+ return ret;
688
+ };
689
+
690
+ exports.__wbg_wbindgennumberget_f74b4c7525ac05cb = function(arg0, arg1) {
691
+ const obj = arg1;
692
+ const ret = typeof(obj) === 'number' ? obj : undefined;
693
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
694
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
695
+ };
696
+
697
+ exports.__wbg_wbindgenstringget_0f16a6ddddef376f = function(arg0, arg1) {
698
+ const obj = arg1;
699
+ const ret = typeof(obj) === 'string' ? obj : undefined;
700
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
701
+ var len1 = WASM_VECTOR_LEN;
702
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
703
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
704
+ };
705
+
706
+ exports.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
707
+ throw new Error(getStringFromWasm0(arg0, arg1));
708
+ };
709
+
710
+ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
711
+ // Cast intrinsic for `Ref(String) -> Externref`.
712
+ const ret = getStringFromWasm0(arg0, arg1);
713
+ return ret;
714
+ };
715
+
716
+ exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
717
+ // Cast intrinsic for `U64 -> Externref`.
718
+ const ret = BigInt.asUintN(64, arg0);
719
+ return ret;
720
+ };
721
+
722
+ exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
723
+ // Cast intrinsic for `I64 -> Externref`.
724
+ const ret = arg0;
725
+ return ret;
726
+ };
727
+
728
+ exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
729
+ // Cast intrinsic for `F64 -> Externref`.
730
+ const ret = arg0;
731
+ return ret;
732
+ };
733
+
734
+ exports.__wbindgen_init_externref_table = function() {
735
+ const table = wasm.__wbindgen_export_2;
736
+ const offset = table.grow(4);
737
+ table.set(0, undefined);
738
+ table.set(offset + 0, undefined);
739
+ table.set(offset + 1, null);
740
+ table.set(offset + 2, true);
741
+ table.set(offset + 3, false);
742
+ ;
743
+ };
744
+
745
+ const wasmPath = `${__dirname}/hypen_engine_bg.wasm`;
746
+ const wasmBytes = require('fs').readFileSync(wasmPath);
747
+ const wasmModule = new WebAssembly.Module(wasmBytes);
748
+ const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
749
+
750
+ wasm.__wbindgen_start();
751
+