@rivetkit/rivetkit-wasm 0.0.0-main.b81dab2

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,1937 @@
1
+ let wasm;
2
+
3
+ let WASM_VECTOR_LEN = 0;
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
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
15
+
16
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
17
+ ? function (arg, view) {
18
+ return cachedTextEncoder.encodeInto(arg, view);
19
+ }
20
+ : function (arg, view) {
21
+ const buf = cachedTextEncoder.encode(arg);
22
+ view.set(buf);
23
+ return {
24
+ read: arg.length,
25
+ written: buf.length
26
+ };
27
+ });
28
+
29
+ function passStringToWasm0(arg, malloc, realloc) {
30
+
31
+ if (realloc === undefined) {
32
+ const buf = cachedTextEncoder.encode(arg);
33
+ const ptr = malloc(buf.length, 1) >>> 0;
34
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
35
+ WASM_VECTOR_LEN = buf.length;
36
+ return ptr;
37
+ }
38
+
39
+ let len = arg.length;
40
+ let ptr = malloc(len, 1) >>> 0;
41
+
42
+ const mem = getUint8ArrayMemory0();
43
+
44
+ let offset = 0;
45
+
46
+ for (; offset < len; offset++) {
47
+ const code = arg.charCodeAt(offset);
48
+ if (code > 0x7F) break;
49
+ mem[ptr + offset] = code;
50
+ }
51
+
52
+ if (offset !== len) {
53
+ if (offset !== 0) {
54
+ arg = arg.slice(offset);
55
+ }
56
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
57
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
58
+ const ret = encodeString(arg, view);
59
+
60
+ offset += ret.written;
61
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
62
+ }
63
+
64
+ WASM_VECTOR_LEN = offset;
65
+ return ptr;
66
+ }
67
+
68
+ let cachedDataViewMemory0 = null;
69
+
70
+ function getDataViewMemory0() {
71
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
72
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
73
+ }
74
+ return cachedDataViewMemory0;
75
+ }
76
+
77
+ function addToExternrefTable0(obj) {
78
+ const idx = wasm.__externref_table_alloc();
79
+ wasm.__wbindgen_export_4.set(idx, obj);
80
+ return idx;
81
+ }
82
+
83
+ function handleError(f, args) {
84
+ try {
85
+ return f.apply(this, args);
86
+ } catch (e) {
87
+ const idx = addToExternrefTable0(e);
88
+ wasm.__wbindgen_exn_store(idx);
89
+ }
90
+ }
91
+
92
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
93
+
94
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
95
+
96
+ function getStringFromWasm0(ptr, len) {
97
+ ptr = ptr >>> 0;
98
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
99
+ }
100
+
101
+ function getArrayU8FromWasm0(ptr, len) {
102
+ ptr = ptr >>> 0;
103
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
104
+ }
105
+
106
+ function isLikeNone(x) {
107
+ return x === undefined || x === null;
108
+ }
109
+
110
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
111
+ ? { register: () => {}, unregister: () => {} }
112
+ : new FinalizationRegistry(state => {
113
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b)
114
+ });
115
+
116
+ function makeMutClosure(arg0, arg1, dtor, f) {
117
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
118
+ const real = (...args) => {
119
+ // First up with a closure we increment the internal reference
120
+ // count. This ensures that the Rust closure environment won't
121
+ // be deallocated while we're invoking it.
122
+ state.cnt++;
123
+ const a = state.a;
124
+ state.a = 0;
125
+ try {
126
+ return f(a, state.b, ...args);
127
+ } finally {
128
+ if (--state.cnt === 0) {
129
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
130
+ CLOSURE_DTORS.unregister(state);
131
+ } else {
132
+ state.a = a;
133
+ }
134
+ }
135
+ };
136
+ real.original = state;
137
+ CLOSURE_DTORS.register(real, state, state);
138
+ return real;
139
+ }
140
+
141
+ function debugString(val) {
142
+ // primitive types
143
+ const type = typeof val;
144
+ if (type == 'number' || type == 'boolean' || val == null) {
145
+ return `${val}`;
146
+ }
147
+ if (type == 'string') {
148
+ return `"${val}"`;
149
+ }
150
+ if (type == 'symbol') {
151
+ const description = val.description;
152
+ if (description == null) {
153
+ return 'Symbol';
154
+ } else {
155
+ return `Symbol(${description})`;
156
+ }
157
+ }
158
+ if (type == 'function') {
159
+ const name = val.name;
160
+ if (typeof name == 'string' && name.length > 0) {
161
+ return `Function(${name})`;
162
+ } else {
163
+ return 'Function';
164
+ }
165
+ }
166
+ // objects
167
+ if (Array.isArray(val)) {
168
+ const length = val.length;
169
+ let debug = '[';
170
+ if (length > 0) {
171
+ debug += debugString(val[0]);
172
+ }
173
+ for(let i = 1; i < length; i++) {
174
+ debug += ', ' + debugString(val[i]);
175
+ }
176
+ debug += ']';
177
+ return debug;
178
+ }
179
+ // Test for built-in
180
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
181
+ let className;
182
+ if (builtInMatches && builtInMatches.length > 1) {
183
+ className = builtInMatches[1];
184
+ } else {
185
+ // Failed to match the standard '[object ClassName]'
186
+ return toString.call(val);
187
+ }
188
+ if (className == 'Object') {
189
+ // we're a user defined class or Object
190
+ // JSON.stringify avoids problems with cycles, and is generally much
191
+ // easier than looping through ownProperties of `val`.
192
+ try {
193
+ return 'Object(' + JSON.stringify(val) + ')';
194
+ } catch (_) {
195
+ return 'Object';
196
+ }
197
+ }
198
+ // errors
199
+ if (val instanceof Error) {
200
+ return `${val.name}: ${val.message}\n${val.stack}`;
201
+ }
202
+ // TODO we could test for more things here, like `Set`s and `Map`s.
203
+ return className;
204
+ }
205
+
206
+ function passArray8ToWasm0(arg, malloc) {
207
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
208
+ getUint8ArrayMemory0().set(arg, ptr / 1);
209
+ WASM_VECTOR_LEN = arg.length;
210
+ return ptr;
211
+ }
212
+
213
+ function takeFromExternrefTable0(idx) {
214
+ const value = wasm.__wbindgen_export_4.get(idx);
215
+ wasm.__externref_table_dealloc(idx);
216
+ return value;
217
+ }
218
+
219
+ function _assertClass(instance, klass) {
220
+ if (!(instance instanceof klass)) {
221
+ throw new Error(`expected instance of ${klass.name}`);
222
+ }
223
+ }
224
+ /**
225
+ * @param {Promise<any>} promise
226
+ * @returns {Promise<any>}
227
+ */
228
+ export function awaitPromise(promise) {
229
+ const ret = wasm.awaitPromise(promise);
230
+ return ret;
231
+ }
232
+
233
+ /**
234
+ * @param {Uint8Array} bytes
235
+ * @returns {Uint8Array}
236
+ */
237
+ export function roundTripBytes(bytes) {
238
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
239
+ const len0 = WASM_VECTOR_LEN;
240
+ const ret = wasm.roundTripBytes(ptr0, len0);
241
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
242
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
243
+ return v2;
244
+ }
245
+
246
+ export function start() {
247
+ wasm.start();
248
+ }
249
+
250
+ /**
251
+ * @param {Uint8Array} bytes
252
+ * @returns {Uint8Array}
253
+ */
254
+ export function uint8ArrayFromBytes(bytes) {
255
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
256
+ const len0 = WASM_VECTOR_LEN;
257
+ const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
258
+ return ret;
259
+ }
260
+
261
+ /**
262
+ * @returns {string}
263
+ */
264
+ export function bridgeRivetErrorPrefix() {
265
+ let deferred1_0;
266
+ let deferred1_1;
267
+ try {
268
+ const ret = wasm.bridgeRivetErrorPrefix();
269
+ deferred1_0 = ret[0];
270
+ deferred1_1 = ret[1];
271
+ return getStringFromWasm0(ret[0], ret[1]);
272
+ } finally {
273
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
274
+ }
275
+ }
276
+
277
+ function __wbg_adapter_46(arg0, arg1, arg2) {
278
+ wasm.closure1601_externref_shim(arg0, arg1, arg2);
279
+ }
280
+
281
+ function __wbg_adapter_55(arg0, arg1, arg2) {
282
+ wasm.closure1804_externref_shim(arg0, arg1, arg2);
283
+ }
284
+
285
+ function __wbg_adapter_222(arg0, arg1, arg2, arg3) {
286
+ wasm.closure2017_externref_shim(arg0, arg1, arg2, arg3);
287
+ }
288
+
289
+ const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
290
+
291
+ const ActorContextFinalization = (typeof FinalizationRegistry === 'undefined')
292
+ ? { register: () => {}, unregister: () => {} }
293
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorcontext_free(ptr >>> 0, 1));
294
+
295
+ export class ActorContext {
296
+
297
+ static __wrap(ptr) {
298
+ ptr = ptr >>> 0;
299
+ const obj = Object.create(ActorContext.prototype);
300
+ obj.__wbg_ptr = ptr;
301
+ ActorContextFinalization.register(obj, obj.__wbg_ptr, obj);
302
+ return obj;
303
+ }
304
+
305
+ __destroy_into_raw() {
306
+ const ptr = this.__wbg_ptr;
307
+ this.__wbg_ptr = 0;
308
+ ActorContextFinalization.unregister(this);
309
+ return ptr;
310
+ }
311
+
312
+ free() {
313
+ const ptr = this.__destroy_into_raw();
314
+ wasm.__wbg_actorcontext_free(ptr, 0);
315
+ }
316
+ /**
317
+ * @param {Promise<any>} promise
318
+ * @returns {Promise<any>}
319
+ */
320
+ keepAwake(promise) {
321
+ const ret = wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
322
+ return ret;
323
+ }
324
+ /**
325
+ * @param {any} payload
326
+ * @returns {Promise<void>}
327
+ */
328
+ saveState(payload) {
329
+ const ret = wasm.actorcontext_saveState(this.__wbg_ptr, payload);
330
+ return ret;
331
+ }
332
+ /**
333
+ * @param {Promise<any>} promise
334
+ */
335
+ waitUntil(promise) {
336
+ wasm.actorcontext_waitUntil(this.__wbg_ptr, promise);
337
+ }
338
+ /**
339
+ * @returns {any}
340
+ */
341
+ abortSignal() {
342
+ const ret = wasm.actorcontext_abortSignal(this.__wbg_ptr);
343
+ if (ret[2]) {
344
+ throw takeFromExternrefTable0(ret[1]);
345
+ }
346
+ return takeFromExternrefTable0(ret[0]);
347
+ }
348
+ /**
349
+ * @param {Uint8Array} params
350
+ * @param {any} request
351
+ * @returns {Promise<ConnHandle>}
352
+ */
353
+ connectConn(params, request) {
354
+ const ptr0 = passArray8ToWasm0(params, wasm.__wbindgen_malloc);
355
+ const len0 = WASM_VECTOR_LEN;
356
+ const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
357
+ return ret;
358
+ }
359
+ /**
360
+ * @param {any} opts
361
+ */
362
+ requestSave(opts) {
363
+ wasm.actorcontext_requestSave(this.__wbg_ptr, opts);
364
+ }
365
+ /**
366
+ * @param {Promise<any>} promise
367
+ */
368
+ registerTask(promise) {
369
+ wasm.actorcontext_registerTask(this.__wbg_ptr, promise);
370
+ }
371
+ /**
372
+ * @returns {any}
373
+ */
374
+ runtimeState() {
375
+ const ret = wasm.actorcontext_runtimeState(this.__wbg_ptr);
376
+ return ret;
377
+ }
378
+ /**
379
+ * @returns {object}
380
+ */
381
+ inspectorSnapshot() {
382
+ const ret = wasm.actorcontext_inspectorSnapshot(this.__wbg_ptr);
383
+ if (ret[2]) {
384
+ throw takeFromExternrefTable0(ret[1]);
385
+ }
386
+ return takeFromExternrefTable0(ret[0]);
387
+ }
388
+ endOnStateChange() {
389
+ wasm.actorcontext_endOnStateChange(this.__wbg_ptr);
390
+ }
391
+ restartRunHandler() {
392
+ wasm.actorcontext_restartRunHandler(this.__wbg_ptr);
393
+ }
394
+ beginOnStateChange() {
395
+ wasm.actorcontext_beginOnStateChange(this.__wbg_ptr);
396
+ }
397
+ /**
398
+ * @param {any} opts
399
+ * @returns {Promise<void>}
400
+ */
401
+ requestSaveAndWait(opts) {
402
+ const ret = wasm.actorcontext_requestSaveAndWait(this.__wbg_ptr, opts);
403
+ return ret;
404
+ }
405
+ /**
406
+ * @param {string | null} [bearer_token]
407
+ * @returns {Promise<void>}
408
+ */
409
+ verifyInspectorAuth(bearer_token) {
410
+ var ptr0 = isLikeNone(bearer_token) ? 0 : passStringToWasm0(bearer_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
411
+ var len0 = WASM_VECTOR_LEN;
412
+ const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
413
+ return ret;
414
+ }
415
+ /**
416
+ * @param {number} region_id
417
+ */
418
+ endWebsocketCallback(region_id) {
419
+ wasm.actorcontext_endWebsocketCallback(this.__wbg_ptr, region_id);
420
+ }
421
+ /**
422
+ * @returns {number}
423
+ */
424
+ beginWebsocketCallback() {
425
+ const ret = wasm.actorcontext_beginWebsocketCallback(this.__wbg_ptr);
426
+ return ret >>> 0;
427
+ }
428
+ /**
429
+ * @returns {Array<any>}
430
+ */
431
+ dirtyHibernatableConns() {
432
+ const ret = wasm.actorcontext_dirtyHibernatableConns(this.__wbg_ptr);
433
+ return ret;
434
+ }
435
+ /**
436
+ * @returns {Kv}
437
+ */
438
+ kv() {
439
+ const ret = wasm.actorcontext_kv(this.__wbg_ptr);
440
+ return Kv.__wrap(ret);
441
+ }
442
+ /**
443
+ * @returns {Array<any>}
444
+ */
445
+ takePendingHibernationChanges() {
446
+ const ret = wasm.actorcontext_takePendingHibernationChanges(this.__wbg_ptr);
447
+ return ret;
448
+ }
449
+ /**
450
+ * @returns {any}
451
+ */
452
+ key() {
453
+ const ret = wasm.actorcontext_key(this.__wbg_ptr);
454
+ if (ret[2]) {
455
+ throw takeFromExternrefTable0(ret[1]);
456
+ }
457
+ return takeFromExternrefTable0(ret[0]);
458
+ }
459
+ constructor() {
460
+ const ret = wasm.actorcontext_new();
461
+ if (ret[2]) {
462
+ throw takeFromExternrefTable0(ret[1]);
463
+ }
464
+ this.__wbg_ptr = ret[0] >>> 0;
465
+ ActorContextFinalization.register(this, this.__wbg_ptr, this);
466
+ return this;
467
+ }
468
+ /**
469
+ * @returns {SqliteDb}
470
+ */
471
+ sql() {
472
+ const ret = wasm.actorcontext_sql(this.__wbg_ptr);
473
+ return SqliteDb.__wrap(ret);
474
+ }
475
+ /**
476
+ * @returns {string}
477
+ */
478
+ name() {
479
+ let deferred1_0;
480
+ let deferred1_1;
481
+ try {
482
+ const ret = wasm.actorcontext_name(this.__wbg_ptr);
483
+ deferred1_0 = ret[0];
484
+ deferred1_1 = ret[1];
485
+ return getStringFromWasm0(ret[0], ret[1]);
486
+ } finally {
487
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
488
+ }
489
+ }
490
+ /**
491
+ * @returns {Array<any>}
492
+ */
493
+ conns() {
494
+ const ret = wasm.actorcontext_conns(this.__wbg_ptr);
495
+ return ret;
496
+ }
497
+ /**
498
+ * @returns {Queue}
499
+ */
500
+ queue() {
501
+ const ret = wasm.actorcontext_kv(this.__wbg_ptr);
502
+ return Queue.__wrap(ret);
503
+ }
504
+ sleep() {
505
+ const ret = wasm.actorcontext_sleep(this.__wbg_ptr);
506
+ if (ret[1]) {
507
+ throw takeFromExternrefTable0(ret[0]);
508
+ }
509
+ }
510
+ /**
511
+ * @returns {Uint8Array}
512
+ */
513
+ state() {
514
+ const ret = wasm.actorcontext_state(this.__wbg_ptr);
515
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
516
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
517
+ return v1;
518
+ }
519
+ /**
520
+ * @returns {string}
521
+ */
522
+ region() {
523
+ let deferred1_0;
524
+ let deferred1_1;
525
+ try {
526
+ const ret = wasm.actorcontext_region(this.__wbg_ptr);
527
+ deferred1_0 = ret[0];
528
+ deferred1_1 = ret[1];
529
+ return getStringFromWasm0(ret[0], ret[1]);
530
+ } finally {
531
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
532
+ }
533
+ }
534
+ destroy() {
535
+ const ret = wasm.actorcontext_destroy(this.__wbg_ptr);
536
+ if (ret[1]) {
537
+ throw takeFromExternrefTable0(ret[0]);
538
+ }
539
+ }
540
+ /**
541
+ * @returns {string}
542
+ */
543
+ actorId() {
544
+ let deferred1_0;
545
+ let deferred1_1;
546
+ try {
547
+ const ret = wasm.actorcontext_actorId(this.__wbg_ptr);
548
+ deferred1_0 = ret[0];
549
+ deferred1_1 = ret[1];
550
+ return getStringFromWasm0(ret[0], ret[1]);
551
+ } finally {
552
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
553
+ }
554
+ }
555
+ /**
556
+ * @returns {Schedule}
557
+ */
558
+ schedule() {
559
+ const ret = wasm.actorcontext_kv(this.__wbg_ptr);
560
+ return Schedule.__wrap(ret);
561
+ }
562
+ /**
563
+ * @param {string} name
564
+ * @param {Uint8Array} args
565
+ */
566
+ broadcast(name, args) {
567
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
568
+ const len0 = WASM_VECTOR_LEN;
569
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
570
+ const len1 = WASM_VECTOR_LEN;
571
+ wasm.actorcontext_broadcast(this.__wbg_ptr, ptr0, len0, ptr1, len1);
572
+ }
573
+ /**
574
+ * @param {number | null} [timestamp_ms]
575
+ */
576
+ setAlarm(timestamp_ms) {
577
+ const ret = wasm.actorcontext_setAlarm(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
578
+ if (ret[1]) {
579
+ throw takeFromExternrefTable0(ret[0]);
580
+ }
581
+ }
582
+ }
583
+
584
+ const ActorFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
585
+ ? { register: () => {}, unregister: () => {} }
586
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorfactory_free(ptr >>> 0, 1));
587
+
588
+ export class ActorFactory {
589
+
590
+ __destroy_into_raw() {
591
+ const ptr = this.__wbg_ptr;
592
+ this.__wbg_ptr = 0;
593
+ ActorFactoryFinalization.unregister(this);
594
+ return ptr;
595
+ }
596
+
597
+ free() {
598
+ const ptr = this.__destroy_into_raw();
599
+ wasm.__wbg_actorfactory_free(ptr, 0);
600
+ }
601
+ /**
602
+ * @param {any} callbacks
603
+ * @param {any} config
604
+ */
605
+ constructor(callbacks, config) {
606
+ const ret = wasm.actorfactory_new(callbacks, config);
607
+ if (ret[2]) {
608
+ throw takeFromExternrefTable0(ret[1]);
609
+ }
610
+ this.__wbg_ptr = ret[0] >>> 0;
611
+ ActorFactoryFinalization.register(this, this.__wbg_ptr, this);
612
+ return this;
613
+ }
614
+ }
615
+
616
+ const CancellationTokenFinalization = (typeof FinalizationRegistry === 'undefined')
617
+ ? { register: () => {}, unregister: () => {} }
618
+ : new FinalizationRegistry(ptr => wasm.__wbg_cancellationtoken_free(ptr >>> 0, 1));
619
+
620
+ export class CancellationToken {
621
+
622
+ __destroy_into_raw() {
623
+ const ptr = this.__wbg_ptr;
624
+ this.__wbg_ptr = 0;
625
+ CancellationTokenFinalization.unregister(this);
626
+ return ptr;
627
+ }
628
+
629
+ free() {
630
+ const ptr = this.__destroy_into_raw();
631
+ wasm.__wbg_cancellationtoken_free(ptr, 0);
632
+ }
633
+ /**
634
+ * @param {Function} callback
635
+ */
636
+ onCancelled(callback) {
637
+ wasm.cancellationtoken_onCancelled(this.__wbg_ptr, callback);
638
+ }
639
+ constructor() {
640
+ const ret = wasm.cancellationtoken_new();
641
+ this.__wbg_ptr = ret >>> 0;
642
+ CancellationTokenFinalization.register(this, this.__wbg_ptr, this);
643
+ return this;
644
+ }
645
+ cancel() {
646
+ wasm.cancellationtoken_cancel(this.__wbg_ptr);
647
+ }
648
+ /**
649
+ * @returns {boolean}
650
+ */
651
+ aborted() {
652
+ const ret = wasm.cancellationtoken_aborted(this.__wbg_ptr);
653
+ return ret !== 0;
654
+ }
655
+ }
656
+
657
+ const ConnHandleFinalization = (typeof FinalizationRegistry === 'undefined')
658
+ ? { register: () => {}, unregister: () => {} }
659
+ : new FinalizationRegistry(ptr => wasm.__wbg_connhandle_free(ptr >>> 0, 1));
660
+
661
+ export class ConnHandle {
662
+
663
+ static __wrap(ptr) {
664
+ ptr = ptr >>> 0;
665
+ const obj = Object.create(ConnHandle.prototype);
666
+ obj.__wbg_ptr = ptr;
667
+ ConnHandleFinalization.register(obj, obj.__wbg_ptr, obj);
668
+ return obj;
669
+ }
670
+
671
+ __destroy_into_raw() {
672
+ const ptr = this.__wbg_ptr;
673
+ this.__wbg_ptr = 0;
674
+ ConnHandleFinalization.unregister(this);
675
+ return ptr;
676
+ }
677
+
678
+ free() {
679
+ const ptr = this.__destroy_into_raw();
680
+ wasm.__wbg_connhandle_free(ptr, 0);
681
+ }
682
+ /**
683
+ * @param {string | null} [reason]
684
+ * @returns {Promise<void>}
685
+ */
686
+ disconnect(reason) {
687
+ var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
688
+ var len0 = WASM_VECTOR_LEN;
689
+ const ret = wasm.connhandle_disconnect(this.__wbg_ptr, ptr0, len0);
690
+ return ret;
691
+ }
692
+ /**
693
+ * @returns {boolean}
694
+ */
695
+ isHibernatable() {
696
+ const ret = wasm.connhandle_isHibernatable(this.__wbg_ptr);
697
+ return ret !== 0;
698
+ }
699
+ /**
700
+ * @returns {string}
701
+ */
702
+ id() {
703
+ let deferred1_0;
704
+ let deferred1_1;
705
+ try {
706
+ const ret = wasm.connhandle_id(this.__wbg_ptr);
707
+ deferred1_0 = ret[0];
708
+ deferred1_1 = ret[1];
709
+ return getStringFromWasm0(ret[0], ret[1]);
710
+ } finally {
711
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
712
+ }
713
+ }
714
+ /**
715
+ * @param {string} name
716
+ * @param {Uint8Array} args
717
+ */
718
+ send(name, args) {
719
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
720
+ const len0 = WASM_VECTOR_LEN;
721
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
722
+ const len1 = WASM_VECTOR_LEN;
723
+ wasm.connhandle_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
724
+ }
725
+ /**
726
+ * @returns {Uint8Array}
727
+ */
728
+ state() {
729
+ const ret = wasm.connhandle_state(this.__wbg_ptr);
730
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
731
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
732
+ return v1;
733
+ }
734
+ /**
735
+ * @returns {Uint8Array}
736
+ */
737
+ params() {
738
+ const ret = wasm.connhandle_params(this.__wbg_ptr);
739
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
740
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
741
+ return v1;
742
+ }
743
+ /**
744
+ * @param {Uint8Array} state
745
+ */
746
+ setState(state) {
747
+ const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
748
+ const len0 = WASM_VECTOR_LEN;
749
+ wasm.connhandle_setState(this.__wbg_ptr, ptr0, len0);
750
+ }
751
+ }
752
+
753
+ const CoreRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
754
+ ? { register: () => {}, unregister: () => {} }
755
+ : new FinalizationRegistry(ptr => wasm.__wbg_coreregistry_free(ptr >>> 0, 1));
756
+
757
+ export class CoreRegistry {
758
+
759
+ __destroy_into_raw() {
760
+ const ptr = this.__wbg_ptr;
761
+ this.__wbg_ptr = 0;
762
+ CoreRegistryFinalization.unregister(this);
763
+ return ptr;
764
+ }
765
+
766
+ free() {
767
+ const ptr = this.__destroy_into_raw();
768
+ wasm.__wbg_coreregistry_free(ptr, 0);
769
+ }
770
+ /**
771
+ * @param {any} req
772
+ * @param {Function} on_stream_event
773
+ * @param {CancellationToken} cancel_token
774
+ * @param {any} config
775
+ * @returns {Promise<any>}
776
+ */
777
+ handleServerlessRequest(req, on_stream_event, cancel_token, config) {
778
+ _assertClass(cancel_token, CancellationToken);
779
+ const ret = wasm.coreregistry_handleServerlessRequest(this.__wbg_ptr, req, on_stream_event, cancel_token.__wbg_ptr, config);
780
+ return ret;
781
+ }
782
+ constructor() {
783
+ const ret = wasm.coreregistry_new();
784
+ this.__wbg_ptr = ret >>> 0;
785
+ CoreRegistryFinalization.register(this, this.__wbg_ptr, this);
786
+ return this;
787
+ }
788
+ /**
789
+ * @param {any} config
790
+ * @returns {Promise<void>}
791
+ */
792
+ serve(config) {
793
+ const ret = wasm.coreregistry_serve(this.__wbg_ptr, config);
794
+ return ret;
795
+ }
796
+ /**
797
+ * @param {string} name
798
+ * @param {ActorFactory} factory
799
+ */
800
+ register(name, factory) {
801
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
802
+ const len0 = WASM_VECTOR_LEN;
803
+ _assertClass(factory, ActorFactory);
804
+ const ret = wasm.coreregistry_register(this.__wbg_ptr, ptr0, len0, factory.__wbg_ptr);
805
+ if (ret[1]) {
806
+ throw takeFromExternrefTable0(ret[0]);
807
+ }
808
+ }
809
+ /**
810
+ * @returns {Promise<void>}
811
+ */
812
+ shutdown() {
813
+ const ret = wasm.coreregistry_shutdown(this.__wbg_ptr);
814
+ return ret;
815
+ }
816
+ }
817
+
818
+ const KvFinalization = (typeof FinalizationRegistry === 'undefined')
819
+ ? { register: () => {}, unregister: () => {} }
820
+ : new FinalizationRegistry(ptr => wasm.__wbg_kv_free(ptr >>> 0, 1));
821
+
822
+ export class Kv {
823
+
824
+ static __wrap(ptr) {
825
+ ptr = ptr >>> 0;
826
+ const obj = Object.create(Kv.prototype);
827
+ obj.__wbg_ptr = ptr;
828
+ KvFinalization.register(obj, obj.__wbg_ptr, obj);
829
+ return obj;
830
+ }
831
+
832
+ __destroy_into_raw() {
833
+ const ptr = this.__wbg_ptr;
834
+ this.__wbg_ptr = 0;
835
+ KvFinalization.unregister(this);
836
+ return ptr;
837
+ }
838
+
839
+ free() {
840
+ const ptr = this.__destroy_into_raw();
841
+ wasm.__wbg_kv_free(ptr, 0);
842
+ }
843
+ /**
844
+ * @param {Uint8Array} key
845
+ * @returns {Promise<void>}
846
+ */
847
+ delete(key) {
848
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
849
+ const len0 = WASM_VECTOR_LEN;
850
+ const ret = wasm.kv_delete(this.__wbg_ptr, ptr0, len0);
851
+ return ret;
852
+ }
853
+ /**
854
+ * @param {Uint8Array} start
855
+ * @param {Uint8Array} end
856
+ * @param {any} options
857
+ * @returns {Promise<any>}
858
+ */
859
+ listRange(start, end, options) {
860
+ const ptr0 = passArray8ToWasm0(start, wasm.__wbindgen_malloc);
861
+ const len0 = WASM_VECTOR_LEN;
862
+ const ptr1 = passArray8ToWasm0(end, wasm.__wbindgen_malloc);
863
+ const len1 = WASM_VECTOR_LEN;
864
+ const ret = wasm.kv_listRange(this.__wbg_ptr, ptr0, len0, ptr1, len1, options);
865
+ return ret;
866
+ }
867
+ /**
868
+ * @param {Uint8Array} prefix
869
+ * @param {any} options
870
+ * @returns {Promise<any>}
871
+ */
872
+ listPrefix(prefix, options) {
873
+ const ptr0 = passArray8ToWasm0(prefix, wasm.__wbindgen_malloc);
874
+ const len0 = WASM_VECTOR_LEN;
875
+ const ret = wasm.kv_listPrefix(this.__wbg_ptr, ptr0, len0, options);
876
+ return ret;
877
+ }
878
+ /**
879
+ * @param {Array<any>} keys
880
+ * @returns {Promise<void>}
881
+ */
882
+ batchDelete(keys) {
883
+ const ret = wasm.kv_batchDelete(this.__wbg_ptr, keys);
884
+ return ret;
885
+ }
886
+ /**
887
+ * @param {Uint8Array} start
888
+ * @param {Uint8Array} end
889
+ * @returns {Promise<void>}
890
+ */
891
+ deleteRange(start, end) {
892
+ const ptr0 = passArray8ToWasm0(start, wasm.__wbindgen_malloc);
893
+ const len0 = WASM_VECTOR_LEN;
894
+ const ptr1 = passArray8ToWasm0(end, wasm.__wbindgen_malloc);
895
+ const len1 = WASM_VECTOR_LEN;
896
+ const ret = wasm.kv_deleteRange(this.__wbg_ptr, ptr0, len0, ptr1, len1);
897
+ return ret;
898
+ }
899
+ /**
900
+ * @param {Uint8Array} key
901
+ * @returns {Promise<any>}
902
+ */
903
+ get(key) {
904
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
905
+ const len0 = WASM_VECTOR_LEN;
906
+ const ret = wasm.kv_get(this.__wbg_ptr, ptr0, len0);
907
+ return ret;
908
+ }
909
+ /**
910
+ * @param {Uint8Array} key
911
+ * @param {Uint8Array} value
912
+ * @returns {Promise<void>}
913
+ */
914
+ put(key, value) {
915
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
916
+ const len0 = WASM_VECTOR_LEN;
917
+ const ptr1 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
918
+ const len1 = WASM_VECTOR_LEN;
919
+ const ret = wasm.kv_put(this.__wbg_ptr, ptr0, len0, ptr1, len1);
920
+ return ret;
921
+ }
922
+ /**
923
+ * @param {Array<any>} keys
924
+ * @returns {Promise<any>}
925
+ */
926
+ batchGet(keys) {
927
+ const ret = wasm.kv_batchGet(this.__wbg_ptr, keys);
928
+ return ret;
929
+ }
930
+ /**
931
+ * @param {Array<any>} entries
932
+ * @returns {Promise<void>}
933
+ */
934
+ batchPut(entries) {
935
+ const ret = wasm.kv_batchPut(this.__wbg_ptr, entries);
936
+ return ret;
937
+ }
938
+ }
939
+
940
+ const QueueFinalization = (typeof FinalizationRegistry === 'undefined')
941
+ ? { register: () => {}, unregister: () => {} }
942
+ : new FinalizationRegistry(ptr => wasm.__wbg_queue_free(ptr >>> 0, 1));
943
+
944
+ export class Queue {
945
+
946
+ static __wrap(ptr) {
947
+ ptr = ptr >>> 0;
948
+ const obj = Object.create(Queue.prototype);
949
+ obj.__wbg_ptr = ptr;
950
+ QueueFinalization.register(obj, obj.__wbg_ptr, obj);
951
+ return obj;
952
+ }
953
+
954
+ __destroy_into_raw() {
955
+ const ptr = this.__wbg_ptr;
956
+ this.__wbg_ptr = 0;
957
+ QueueFinalization.unregister(this);
958
+ return ptr;
959
+ }
960
+
961
+ free() {
962
+ const ptr = this.__destroy_into_raw();
963
+ wasm.__wbg_queue_free(ptr, 0);
964
+ }
965
+ /**
966
+ * @param {any} options
967
+ * @param {CancellationToken | null} [signal]
968
+ * @returns {Promise<Array<any>>}
969
+ */
970
+ nextBatch(options, signal) {
971
+ let ptr0 = 0;
972
+ if (!isLikeNone(signal)) {
973
+ _assertClass(signal, CancellationToken);
974
+ ptr0 = signal.__destroy_into_raw();
975
+ }
976
+ const ret = wasm.queue_nextBatch(this.__wbg_ptr, options, ptr0);
977
+ return ret;
978
+ }
979
+ /**
980
+ * @param {any} options
981
+ * @returns {Array<any>}
982
+ */
983
+ tryNextBatch(options) {
984
+ const ret = wasm.queue_tryNextBatch(this.__wbg_ptr, options);
985
+ if (ret[2]) {
986
+ throw takeFromExternrefTable0(ret[1]);
987
+ }
988
+ return takeFromExternrefTable0(ret[0]);
989
+ }
990
+ /**
991
+ * @param {any} names
992
+ * @param {any} options
993
+ * @param {CancellationToken | null} [signal]
994
+ * @returns {Promise<QueueMessage>}
995
+ */
996
+ waitForNames(names, options, signal) {
997
+ let ptr0 = 0;
998
+ if (!isLikeNone(signal)) {
999
+ _assertClass(signal, CancellationToken);
1000
+ ptr0 = signal.__destroy_into_raw();
1001
+ }
1002
+ const ret = wasm.queue_waitForNames(this.__wbg_ptr, names, options, ptr0);
1003
+ return ret;
1004
+ }
1005
+ /**
1006
+ * @param {string} name
1007
+ * @param {Uint8Array} body
1008
+ * @param {any} options
1009
+ * @param {CancellationToken | null} [signal]
1010
+ * @returns {Promise<Uint8Array | undefined>}
1011
+ */
1012
+ enqueueAndWait(name, body, options, signal) {
1013
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1014
+ const len0 = WASM_VECTOR_LEN;
1015
+ const ptr1 = passArray8ToWasm0(body, wasm.__wbindgen_malloc);
1016
+ const len1 = WASM_VECTOR_LEN;
1017
+ let ptr2 = 0;
1018
+ if (!isLikeNone(signal)) {
1019
+ _assertClass(signal, CancellationToken);
1020
+ ptr2 = signal.__destroy_into_raw();
1021
+ }
1022
+ const ret = wasm.queue_enqueueAndWait(this.__wbg_ptr, ptr0, len0, ptr1, len1, options, ptr2);
1023
+ return ret;
1024
+ }
1025
+ /**
1026
+ * @returns {Promise<Array<any>>}
1027
+ */
1028
+ inspectMessages() {
1029
+ const ret = wasm.queue_inspectMessages(this.__wbg_ptr);
1030
+ return ret;
1031
+ }
1032
+ /**
1033
+ * @param {any} names
1034
+ * @param {any} options
1035
+ * @returns {Promise<void>}
1036
+ */
1037
+ waitForNamesAvailable(names, options) {
1038
+ const ret = wasm.queue_waitForNamesAvailable(this.__wbg_ptr, names, options);
1039
+ return ret;
1040
+ }
1041
+ /**
1042
+ * @param {string} name
1043
+ * @param {Uint8Array} body
1044
+ * @returns {Promise<QueueMessage>}
1045
+ */
1046
+ send(name, body) {
1047
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1048
+ const len0 = WASM_VECTOR_LEN;
1049
+ const ptr1 = passArray8ToWasm0(body, wasm.__wbindgen_malloc);
1050
+ const len1 = WASM_VECTOR_LEN;
1051
+ const ret = wasm.queue_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1052
+ return ret;
1053
+ }
1054
+ /**
1055
+ * @returns {number}
1056
+ */
1057
+ maxSize() {
1058
+ const ret = wasm.queue_maxSize(this.__wbg_ptr);
1059
+ return ret >>> 0;
1060
+ }
1061
+ }
1062
+
1063
+ const QueueMessageFinalization = (typeof FinalizationRegistry === 'undefined')
1064
+ ? { register: () => {}, unregister: () => {} }
1065
+ : new FinalizationRegistry(ptr => wasm.__wbg_queuemessage_free(ptr >>> 0, 1));
1066
+
1067
+ export class QueueMessage {
1068
+
1069
+ static __wrap(ptr) {
1070
+ ptr = ptr >>> 0;
1071
+ const obj = Object.create(QueueMessage.prototype);
1072
+ obj.__wbg_ptr = ptr;
1073
+ QueueMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1074
+ return obj;
1075
+ }
1076
+
1077
+ __destroy_into_raw() {
1078
+ const ptr = this.__wbg_ptr;
1079
+ this.__wbg_ptr = 0;
1080
+ QueueMessageFinalization.unregister(this);
1081
+ return ptr;
1082
+ }
1083
+
1084
+ free() {
1085
+ const ptr = this.__destroy_into_raw();
1086
+ wasm.__wbg_queuemessage_free(ptr, 0);
1087
+ }
1088
+ /**
1089
+ * @returns {number}
1090
+ */
1091
+ createdAt() {
1092
+ const ret = wasm.queuemessage_createdAt(this.__wbg_ptr);
1093
+ return ret;
1094
+ }
1095
+ /**
1096
+ * @returns {boolean}
1097
+ */
1098
+ isCompletable() {
1099
+ const ret = wasm.queuemessage_isCompletable(this.__wbg_ptr);
1100
+ return ret !== 0;
1101
+ }
1102
+ /**
1103
+ * @returns {bigint}
1104
+ */
1105
+ id() {
1106
+ const ret = wasm.queuemessage_id(this.__wbg_ptr);
1107
+ return BigInt.asUintN(64, ret);
1108
+ }
1109
+ /**
1110
+ * @returns {Uint8Array}
1111
+ */
1112
+ body() {
1113
+ const ret = wasm.queuemessage_body(this.__wbg_ptr);
1114
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1115
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1116
+ return v1;
1117
+ }
1118
+ /**
1119
+ * @returns {string}
1120
+ */
1121
+ name() {
1122
+ let deferred1_0;
1123
+ let deferred1_1;
1124
+ try {
1125
+ const ret = wasm.queuemessage_name(this.__wbg_ptr);
1126
+ deferred1_0 = ret[0];
1127
+ deferred1_1 = ret[1];
1128
+ return getStringFromWasm0(ret[0], ret[1]);
1129
+ } finally {
1130
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1131
+ }
1132
+ }
1133
+ /**
1134
+ * @param {any} response
1135
+ * @returns {Promise<void>}
1136
+ */
1137
+ complete(response) {
1138
+ const ret = wasm.queuemessage_complete(this.__wbg_ptr, response);
1139
+ return ret;
1140
+ }
1141
+ }
1142
+
1143
+ const ScheduleFinalization = (typeof FinalizationRegistry === 'undefined')
1144
+ ? { register: () => {}, unregister: () => {} }
1145
+ : new FinalizationRegistry(ptr => wasm.__wbg_schedule_free(ptr >>> 0, 1));
1146
+
1147
+ export class Schedule {
1148
+
1149
+ static __wrap(ptr) {
1150
+ ptr = ptr >>> 0;
1151
+ const obj = Object.create(Schedule.prototype);
1152
+ obj.__wbg_ptr = ptr;
1153
+ ScheduleFinalization.register(obj, obj.__wbg_ptr, obj);
1154
+ return obj;
1155
+ }
1156
+
1157
+ __destroy_into_raw() {
1158
+ const ptr = this.__wbg_ptr;
1159
+ this.__wbg_ptr = 0;
1160
+ ScheduleFinalization.unregister(this);
1161
+ return ptr;
1162
+ }
1163
+
1164
+ free() {
1165
+ const ptr = this.__destroy_into_raw();
1166
+ wasm.__wbg_schedule_free(ptr, 0);
1167
+ }
1168
+ /**
1169
+ * @param {number} timestamp_ms
1170
+ * @param {string} action_name
1171
+ * @param {Uint8Array} args
1172
+ */
1173
+ at(timestamp_ms, action_name, args) {
1174
+ const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1175
+ const len0 = WASM_VECTOR_LEN;
1176
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1177
+ const len1 = WASM_VECTOR_LEN;
1178
+ wasm.schedule_at(this.__wbg_ptr, timestamp_ms, ptr0, len0, ptr1, len1);
1179
+ }
1180
+ /**
1181
+ * @param {number} duration_ms
1182
+ * @param {string} action_name
1183
+ * @param {Uint8Array} args
1184
+ */
1185
+ after(duration_ms, action_name, args) {
1186
+ const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1187
+ const len0 = WASM_VECTOR_LEN;
1188
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1189
+ const len1 = WASM_VECTOR_LEN;
1190
+ wasm.schedule_after(this.__wbg_ptr, duration_ms, ptr0, len0, ptr1, len1);
1191
+ }
1192
+ }
1193
+
1194
+ const SqliteDbFinalization = (typeof FinalizationRegistry === 'undefined')
1195
+ ? { register: () => {}, unregister: () => {} }
1196
+ : new FinalizationRegistry(ptr => wasm.__wbg_sqlitedb_free(ptr >>> 0, 1));
1197
+
1198
+ export class SqliteDb {
1199
+
1200
+ static __wrap(ptr) {
1201
+ ptr = ptr >>> 0;
1202
+ const obj = Object.create(SqliteDb.prototype);
1203
+ obj.__wbg_ptr = ptr;
1204
+ SqliteDbFinalization.register(obj, obj.__wbg_ptr, obj);
1205
+ return obj;
1206
+ }
1207
+
1208
+ __destroy_into_raw() {
1209
+ const ptr = this.__wbg_ptr;
1210
+ this.__wbg_ptr = 0;
1211
+ SqliteDbFinalization.unregister(this);
1212
+ return ptr;
1213
+ }
1214
+
1215
+ free() {
1216
+ const ptr = this.__destroy_into_raw();
1217
+ wasm.__wbg_sqlitedb_free(ptr, 0);
1218
+ }
1219
+ /**
1220
+ * @param {string} sql
1221
+ * @param {any} params
1222
+ * @returns {Promise<any>}
1223
+ */
1224
+ run(sql, params) {
1225
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1226
+ const len0 = WASM_VECTOR_LEN;
1227
+ const ret = wasm.sqlitedb_run(this.__wbg_ptr, ptr0, len0, params);
1228
+ return ret;
1229
+ }
1230
+ /**
1231
+ * @param {string} sql
1232
+ * @returns {Promise<any>}
1233
+ */
1234
+ exec(sql) {
1235
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1236
+ const len0 = WASM_VECTOR_LEN;
1237
+ const ret = wasm.sqlitedb_exec(this.__wbg_ptr, ptr0, len0);
1238
+ return ret;
1239
+ }
1240
+ /**
1241
+ * @returns {Promise<void>}
1242
+ */
1243
+ close() {
1244
+ const ret = wasm.sqlitedb_close(this.__wbg_ptr);
1245
+ return ret;
1246
+ }
1247
+ /**
1248
+ * @param {string} sql
1249
+ * @param {any} params
1250
+ * @returns {Promise<any>}
1251
+ */
1252
+ query(sql, params) {
1253
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1254
+ const len0 = WASM_VECTOR_LEN;
1255
+ const ret = wasm.sqlitedb_query(this.__wbg_ptr, ptr0, len0, params);
1256
+ return ret;
1257
+ }
1258
+ /**
1259
+ * @param {string} sql
1260
+ * @param {any} params
1261
+ * @returns {Promise<any>}
1262
+ */
1263
+ execute(sql, params) {
1264
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1265
+ const len0 = WASM_VECTOR_LEN;
1266
+ const ret = wasm.sqlitedb_execute(this.__wbg_ptr, ptr0, len0, params);
1267
+ return ret;
1268
+ }
1269
+ }
1270
+
1271
+ const WebSocketHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1272
+ ? { register: () => {}, unregister: () => {} }
1273
+ : new FinalizationRegistry(ptr => wasm.__wbg_websockethandle_free(ptr >>> 0, 1));
1274
+
1275
+ export class WebSocketHandle {
1276
+
1277
+ static __wrap(ptr) {
1278
+ ptr = ptr >>> 0;
1279
+ const obj = Object.create(WebSocketHandle.prototype);
1280
+ obj.__wbg_ptr = ptr;
1281
+ WebSocketHandleFinalization.register(obj, obj.__wbg_ptr, obj);
1282
+ return obj;
1283
+ }
1284
+
1285
+ __destroy_into_raw() {
1286
+ const ptr = this.__wbg_ptr;
1287
+ this.__wbg_ptr = 0;
1288
+ WebSocketHandleFinalization.unregister(this);
1289
+ return ptr;
1290
+ }
1291
+
1292
+ free() {
1293
+ const ptr = this.__destroy_into_raw();
1294
+ wasm.__wbg_websockethandle_free(ptr, 0);
1295
+ }
1296
+ /**
1297
+ * @param {Function} callback
1298
+ */
1299
+ setEventCallback(callback) {
1300
+ wasm.websockethandle_setEventCallback(this.__wbg_ptr, callback);
1301
+ }
1302
+ /**
1303
+ * @param {Uint8Array} data
1304
+ * @param {boolean} binary
1305
+ */
1306
+ send(data, binary) {
1307
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1308
+ const len0 = WASM_VECTOR_LEN;
1309
+ const ret = wasm.websockethandle_send(this.__wbg_ptr, ptr0, len0, binary);
1310
+ if (ret[1]) {
1311
+ throw takeFromExternrefTable0(ret[0]);
1312
+ }
1313
+ }
1314
+ /**
1315
+ * @param {number | null} [code]
1316
+ * @param {string | null} [reason]
1317
+ * @returns {Promise<void>}
1318
+ */
1319
+ close(code, reason) {
1320
+ var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1321
+ var len0 = WASM_VECTOR_LEN;
1322
+ const ret = wasm.websockethandle_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
1323
+ return ret;
1324
+ }
1325
+ }
1326
+
1327
+ async function __wbg_load(module, imports) {
1328
+ if (typeof Response === 'function' && module instanceof Response) {
1329
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1330
+ try {
1331
+ return await WebAssembly.instantiateStreaming(module, imports);
1332
+
1333
+ } catch (e) {
1334
+ if (module.headers.get('Content-Type') != 'application/wasm') {
1335
+ 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);
1336
+
1337
+ } else {
1338
+ throw e;
1339
+ }
1340
+ }
1341
+ }
1342
+
1343
+ const bytes = await module.arrayBuffer();
1344
+ return await WebAssembly.instantiate(bytes, imports);
1345
+
1346
+ } else {
1347
+ const instance = await WebAssembly.instantiate(module, imports);
1348
+
1349
+ if (instance instanceof WebAssembly.Instance) {
1350
+ return { instance, module };
1351
+
1352
+ } else {
1353
+ return instance;
1354
+ }
1355
+ }
1356
+ }
1357
+
1358
+ function __wbg_get_imports() {
1359
+ const imports = {};
1360
+ imports.wbg = {};
1361
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1362
+ const ret = String(arg1);
1363
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1364
+ const len1 = WASM_VECTOR_LEN;
1365
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1366
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1367
+ };
1368
+ imports.wbg.__wbg_actorcontext_new = function(arg0) {
1369
+ const ret = ActorContext.__wrap(arg0);
1370
+ return ret;
1371
+ };
1372
+ imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
1373
+ const ret = arg0.buffer;
1374
+ return ret;
1375
+ };
1376
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
1377
+ const ret = arg0.buffer;
1378
+ return ret;
1379
+ };
1380
+ imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1381
+ const ret = arg0.call(arg1);
1382
+ return ret;
1383
+ }, arguments) };
1384
+ imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
1385
+ const ret = arg0.call(arg1, arg2);
1386
+ return ret;
1387
+ }, arguments) };
1388
+ imports.wbg.__wbg_call_833bed5770ea2041 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1389
+ const ret = arg0.call(arg1, arg2, arg3);
1390
+ return ret;
1391
+ }, arguments) };
1392
+ imports.wbg.__wbg_close_2893b7d056a0627d = function() { return handleError(function (arg0) {
1393
+ arg0.close();
1394
+ }, arguments) };
1395
+ imports.wbg.__wbg_close_e1253d480ed93ce3 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1396
+ arg0.close(arg1, getStringFromWasm0(arg2, arg3));
1397
+ }, arguments) };
1398
+ imports.wbg.__wbg_code_f4ec1e6e2e1b0417 = function(arg0) {
1399
+ const ret = arg0.code;
1400
+ return ret;
1401
+ };
1402
+ imports.wbg.__wbg_connhandle_new = function(arg0) {
1403
+ const ret = ConnHandle.__wrap(arg0);
1404
+ return ret;
1405
+ };
1406
+ imports.wbg.__wbg_construct_b91ff0e53b60c0c3 = function() { return handleError(function (arg0, arg1) {
1407
+ const ret = Reflect.construct(arg0, arg1);
1408
+ return ret;
1409
+ }, arguments) };
1410
+ imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
1411
+ const ret = arg0.crypto;
1412
+ return ret;
1413
+ };
1414
+ imports.wbg.__wbg_data_432d9c3df2630942 = function(arg0) {
1415
+ const ret = arg0.data;
1416
+ return ret;
1417
+ };
1418
+ imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
1419
+ const ret = arg0.done;
1420
+ return ret;
1421
+ };
1422
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1423
+ let deferred0_0;
1424
+ let deferred0_1;
1425
+ try {
1426
+ deferred0_0 = arg0;
1427
+ deferred0_1 = arg1;
1428
+ console.error(getStringFromWasm0(arg0, arg1));
1429
+ } finally {
1430
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1431
+ }
1432
+ };
1433
+ imports.wbg.__wbg_getRandomValues_38097e921c2494c3 = function() { return handleError(function (arg0, arg1) {
1434
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1435
+ }, arguments) };
1436
+ imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
1437
+ arg0.getRandomValues(arg1);
1438
+ }, arguments) };
1439
+ imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
1440
+ const ret = Reflect.get(arg0, arg1);
1441
+ return ret;
1442
+ }, arguments) };
1443
+ imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
1444
+ const ret = arg0[arg1 >>> 0];
1445
+ return ret;
1446
+ };
1447
+ imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1448
+ const ret = arg0[arg1];
1449
+ return ret;
1450
+ };
1451
+ imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
1452
+ let result;
1453
+ try {
1454
+ result = arg0 instanceof ArrayBuffer;
1455
+ } catch (_) {
1456
+ result = false;
1457
+ }
1458
+ const ret = result;
1459
+ return ret;
1460
+ };
1461
+ imports.wbg.__wbg_instanceof_Error_4d54113b22d20306 = function(arg0) {
1462
+ let result;
1463
+ try {
1464
+ result = arg0 instanceof Error;
1465
+ } catch (_) {
1466
+ result = false;
1467
+ }
1468
+ const ret = result;
1469
+ return ret;
1470
+ };
1471
+ imports.wbg.__wbg_instanceof_Object_7f2dcef8f78644a4 = function(arg0) {
1472
+ let result;
1473
+ try {
1474
+ result = arg0 instanceof Object;
1475
+ } catch (_) {
1476
+ result = false;
1477
+ }
1478
+ const ret = result;
1479
+ return ret;
1480
+ };
1481
+ imports.wbg.__wbg_instanceof_Promise_935168b8f4b49db3 = function(arg0) {
1482
+ let result;
1483
+ try {
1484
+ result = arg0 instanceof Promise;
1485
+ } catch (_) {
1486
+ result = false;
1487
+ }
1488
+ const ret = result;
1489
+ return ret;
1490
+ };
1491
+ imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
1492
+ let result;
1493
+ try {
1494
+ result = arg0 instanceof Uint8Array;
1495
+ } catch (_) {
1496
+ result = false;
1497
+ }
1498
+ const ret = result;
1499
+ return ret;
1500
+ };
1501
+ imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1502
+ const ret = Array.isArray(arg0);
1503
+ return ret;
1504
+ };
1505
+ imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
1506
+ const ret = Number.isSafeInteger(arg0);
1507
+ return ret;
1508
+ };
1509
+ imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
1510
+ const ret = Symbol.iterator;
1511
+ return ret;
1512
+ };
1513
+ imports.wbg.__wbg_keys_5c77a08ddc2fb8a6 = function(arg0) {
1514
+ const ret = Object.keys(arg0);
1515
+ return ret;
1516
+ };
1517
+ imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
1518
+ const ret = arg0.length;
1519
+ return ret;
1520
+ };
1521
+ imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1522
+ const ret = arg0.length;
1523
+ return ret;
1524
+ };
1525
+ imports.wbg.__wbg_message_97a2af9b89d693a3 = function(arg0) {
1526
+ const ret = arg0.message;
1527
+ return ret;
1528
+ };
1529
+ imports.wbg.__wbg_message_d1685a448ba00178 = function(arg0, arg1) {
1530
+ const ret = arg1.message;
1531
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1532
+ const len1 = WASM_VECTOR_LEN;
1533
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1534
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1535
+ };
1536
+ imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
1537
+ const ret = arg0.msCrypto;
1538
+ return ret;
1539
+ };
1540
+ imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
1541
+ try {
1542
+ var state0 = {a: arg0, b: arg1};
1543
+ var cb0 = (arg0, arg1) => {
1544
+ const a = state0.a;
1545
+ state0.a = 0;
1546
+ try {
1547
+ return __wbg_adapter_222(a, state0.b, arg0, arg1);
1548
+ } finally {
1549
+ state0.a = a;
1550
+ }
1551
+ };
1552
+ const ret = new Promise(cb0);
1553
+ return ret;
1554
+ } finally {
1555
+ state0.a = state0.b = 0;
1556
+ }
1557
+ };
1558
+ imports.wbg.__wbg_new_405e22f390576ce2 = function() {
1559
+ const ret = new Object();
1560
+ return ret;
1561
+ };
1562
+ imports.wbg.__wbg_new_78feb108b6472713 = function() {
1563
+ const ret = new Array();
1564
+ return ret;
1565
+ };
1566
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1567
+ const ret = new Error();
1568
+ return ret;
1569
+ };
1570
+ imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
1571
+ const ret = new Uint8Array(arg0);
1572
+ return ret;
1573
+ };
1574
+ imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
1575
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1576
+ return ret;
1577
+ };
1578
+ imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1579
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1580
+ return ret;
1581
+ };
1582
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1583
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1584
+ return ret;
1585
+ };
1586
+ imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
1587
+ const ret = new Uint8Array(arg0 >>> 0);
1588
+ return ret;
1589
+ };
1590
+ imports.wbg.__wbg_newwithstrsequence_6e9d6479e1cf978d = function() { return handleError(function (arg0, arg1, arg2) {
1591
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
1592
+ return ret;
1593
+ }, arguments) };
1594
+ imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
1595
+ const ret = arg0.next;
1596
+ return ret;
1597
+ };
1598
+ imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
1599
+ const ret = arg0.next();
1600
+ return ret;
1601
+ }, arguments) };
1602
+ imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
1603
+ const ret = arg0.node;
1604
+ return ret;
1605
+ };
1606
+ imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) {
1607
+ const ret = arg0.now();
1608
+ return ret;
1609
+ };
1610
+ imports.wbg.__wbg_now_807e54c39636c349 = function() {
1611
+ const ret = Date.now();
1612
+ return ret;
1613
+ };
1614
+ imports.wbg.__wbg_performance_7a3ffd0b17f663ad = function(arg0) {
1615
+ const ret = arg0.performance;
1616
+ return ret;
1617
+ };
1618
+ imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
1619
+ const ret = arg0.process;
1620
+ return ret;
1621
+ };
1622
+ imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
1623
+ const ret = arg0.push(arg1);
1624
+ return ret;
1625
+ };
1626
+ imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
1627
+ queueMicrotask(arg0);
1628
+ };
1629
+ imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
1630
+ const ret = arg0.queueMicrotask;
1631
+ return ret;
1632
+ };
1633
+ imports.wbg.__wbg_queuemessage_new = function(arg0) {
1634
+ const ret = QueueMessage.__wrap(arg0);
1635
+ return ret;
1636
+ };
1637
+ imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
1638
+ arg0.randomFillSync(arg1);
1639
+ }, arguments) };
1640
+ imports.wbg.__wbg_readyState_7ef6e63c349899ed = function(arg0) {
1641
+ const ret = arg0.readyState;
1642
+ return ret;
1643
+ };
1644
+ imports.wbg.__wbg_reason_49f1cede8bcf23dd = function(arg0, arg1) {
1645
+ const ret = arg1.reason;
1646
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1647
+ const len1 = WASM_VECTOR_LEN;
1648
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1649
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1650
+ };
1651
+ imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
1652
+ const ret = module.require;
1653
+ return ret;
1654
+ }, arguments) };
1655
+ imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
1656
+ const ret = Promise.resolve(arg0);
1657
+ return ret;
1658
+ };
1659
+ imports.wbg.__wbg_send_7c4769e24cf1d784 = function() { return handleError(function (arg0, arg1) {
1660
+ arg0.send(arg1);
1661
+ }, arguments) };
1662
+ imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
1663
+ arg0[arg1 >>> 0] = arg2;
1664
+ };
1665
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1666
+ arg0[arg1] = arg2;
1667
+ };
1668
+ imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1669
+ arg0.set(arg1, arg2 >>> 0);
1670
+ };
1671
+ imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
1672
+ const ret = Reflect.set(arg0, arg1, arg2);
1673
+ return ret;
1674
+ }, arguments) };
1675
+ imports.wbg.__wbg_setbinaryType_92fa1ffd873b327c = function(arg0, arg1) {
1676
+ arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1677
+ };
1678
+ imports.wbg.__wbg_setonclose_14fc475a49d488fc = function(arg0, arg1) {
1679
+ arg0.onclose = arg1;
1680
+ };
1681
+ imports.wbg.__wbg_setonerror_8639efe354b947cd = function(arg0, arg1) {
1682
+ arg0.onerror = arg1;
1683
+ };
1684
+ imports.wbg.__wbg_setonmessage_6eccab530a8fb4c7 = function(arg0, arg1) {
1685
+ arg0.onmessage = arg1;
1686
+ };
1687
+ imports.wbg.__wbg_setonopen_2da654e1f39745d5 = function(arg0, arg1) {
1688
+ arg0.onopen = arg1;
1689
+ };
1690
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1691
+ const ret = arg1.stack;
1692
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1693
+ const len1 = WASM_VECTOR_LEN;
1694
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1695
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1696
+ };
1697
+ imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
1698
+ const ret = typeof global === 'undefined' ? null : global;
1699
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1700
+ };
1701
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
1702
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1703
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1704
+ };
1705
+ imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
1706
+ const ret = typeof self === 'undefined' ? null : self;
1707
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1708
+ };
1709
+ imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
1710
+ const ret = typeof window === 'undefined' ? null : window;
1711
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1712
+ };
1713
+ imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
1714
+ const ret = JSON.stringify(arg0);
1715
+ return ret;
1716
+ }, arguments) };
1717
+ imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
1718
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1719
+ return ret;
1720
+ };
1721
+ imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
1722
+ const ret = arg0.then(arg1);
1723
+ return ret;
1724
+ };
1725
+ imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
1726
+ const ret = arg0.then(arg1, arg2);
1727
+ return ret;
1728
+ };
1729
+ imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1730
+ const ret = arg0.value;
1731
+ return ret;
1732
+ };
1733
+ imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
1734
+ const ret = arg0.versions;
1735
+ return ret;
1736
+ };
1737
+ imports.wbg.__wbg_websockethandle_new = function(arg0) {
1738
+ const ret = WebSocketHandle.__wrap(arg0);
1739
+ return ret;
1740
+ };
1741
+ imports.wbg.__wbindgen_as_number = function(arg0) {
1742
+ const ret = +arg0;
1743
+ return ret;
1744
+ };
1745
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
1746
+ const v = arg0;
1747
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1748
+ return ret;
1749
+ };
1750
+ imports.wbg.__wbindgen_cb_drop = function(arg0) {
1751
+ const obj = arg0.original;
1752
+ if (obj.cnt-- == 1) {
1753
+ obj.a = 0;
1754
+ return true;
1755
+ }
1756
+ const ret = false;
1757
+ return ret;
1758
+ };
1759
+ imports.wbg.__wbindgen_closure_wrapper3766 = function(arg0, arg1, arg2) {
1760
+ const ret = makeMutClosure(arg0, arg1, 1602, __wbg_adapter_46);
1761
+ return ret;
1762
+ };
1763
+ imports.wbg.__wbindgen_closure_wrapper3768 = function(arg0, arg1, arg2) {
1764
+ const ret = makeMutClosure(arg0, arg1, 1602, __wbg_adapter_46);
1765
+ return ret;
1766
+ };
1767
+ imports.wbg.__wbindgen_closure_wrapper3770 = function(arg0, arg1, arg2) {
1768
+ const ret = makeMutClosure(arg0, arg1, 1602, __wbg_adapter_46);
1769
+ return ret;
1770
+ };
1771
+ imports.wbg.__wbindgen_closure_wrapper3772 = function(arg0, arg1, arg2) {
1772
+ const ret = makeMutClosure(arg0, arg1, 1602, __wbg_adapter_46);
1773
+ return ret;
1774
+ };
1775
+ imports.wbg.__wbindgen_closure_wrapper4370 = function(arg0, arg1, arg2) {
1776
+ const ret = makeMutClosure(arg0, arg1, 1805, __wbg_adapter_55);
1777
+ return ret;
1778
+ };
1779
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
1780
+ const ret = debugString(arg1);
1781
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1782
+ const len1 = WASM_VECTOR_LEN;
1783
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1784
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1785
+ };
1786
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1787
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1788
+ return ret;
1789
+ };
1790
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
1791
+ const ret = arg0 in arg1;
1792
+ return ret;
1793
+ };
1794
+ imports.wbg.__wbindgen_init_externref_table = function() {
1795
+ const table = wasm.__wbindgen_export_4;
1796
+ const offset = table.grow(4);
1797
+ table.set(0, undefined);
1798
+ table.set(offset + 0, undefined);
1799
+ table.set(offset + 1, null);
1800
+ table.set(offset + 2, true);
1801
+ table.set(offset + 3, false);
1802
+ ;
1803
+ };
1804
+ imports.wbg.__wbindgen_is_function = function(arg0) {
1805
+ const ret = typeof(arg0) === 'function';
1806
+ return ret;
1807
+ };
1808
+ imports.wbg.__wbindgen_is_null = function(arg0) {
1809
+ const ret = arg0 === null;
1810
+ return ret;
1811
+ };
1812
+ imports.wbg.__wbindgen_is_object = function(arg0) {
1813
+ const val = arg0;
1814
+ const ret = typeof(val) === 'object' && val !== null;
1815
+ return ret;
1816
+ };
1817
+ imports.wbg.__wbindgen_is_string = function(arg0) {
1818
+ const ret = typeof(arg0) === 'string';
1819
+ return ret;
1820
+ };
1821
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
1822
+ const ret = arg0 === undefined;
1823
+ return ret;
1824
+ };
1825
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1826
+ const ret = arg0 == arg1;
1827
+ return ret;
1828
+ };
1829
+ imports.wbg.__wbindgen_memory = function() {
1830
+ const ret = wasm.memory;
1831
+ return ret;
1832
+ };
1833
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
1834
+ const obj = arg1;
1835
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1836
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1837
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1838
+ };
1839
+ imports.wbg.__wbindgen_number_new = function(arg0) {
1840
+ const ret = arg0;
1841
+ return ret;
1842
+ };
1843
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
1844
+ const obj = arg1;
1845
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1846
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1847
+ var len1 = WASM_VECTOR_LEN;
1848
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1849
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1850
+ };
1851
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1852
+ const ret = getStringFromWasm0(arg0, arg1);
1853
+ return ret;
1854
+ };
1855
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1856
+ throw new Error(getStringFromWasm0(arg0, arg1));
1857
+ };
1858
+ imports.wbg.__wbindgen_uint8_array_new = function(arg0, arg1) {
1859
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
1860
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
1861
+ const ret = v0;
1862
+ return ret;
1863
+ };
1864
+
1865
+ return imports;
1866
+ }
1867
+
1868
+ function __wbg_init_memory(imports, memory) {
1869
+
1870
+ }
1871
+
1872
+ function __wbg_finalize_init(instance, module) {
1873
+ wasm = instance.exports;
1874
+ __wbg_init.__wbindgen_wasm_module = module;
1875
+ cachedDataViewMemory0 = null;
1876
+ cachedUint8ArrayMemory0 = null;
1877
+
1878
+
1879
+ wasm.__wbindgen_start();
1880
+ return wasm;
1881
+ }
1882
+
1883
+ function initSync(module) {
1884
+ if (wasm !== undefined) return wasm;
1885
+
1886
+
1887
+ if (typeof module !== 'undefined') {
1888
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1889
+ ({module} = module)
1890
+ } else {
1891
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1892
+ }
1893
+ }
1894
+
1895
+ const imports = __wbg_get_imports();
1896
+
1897
+ __wbg_init_memory(imports);
1898
+
1899
+ if (!(module instanceof WebAssembly.Module)) {
1900
+ module = new WebAssembly.Module(module);
1901
+ }
1902
+
1903
+ const instance = new WebAssembly.Instance(module, imports);
1904
+
1905
+ return __wbg_finalize_init(instance, module);
1906
+ }
1907
+
1908
+ async function __wbg_init(module_or_path) {
1909
+ if (wasm !== undefined) return wasm;
1910
+
1911
+
1912
+ if (typeof module_or_path !== 'undefined') {
1913
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1914
+ ({module_or_path} = module_or_path)
1915
+ } else {
1916
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1917
+ }
1918
+ }
1919
+
1920
+ if (typeof module_or_path === 'undefined') {
1921
+ module_or_path = new URL('rivetkit_wasm_bg.wasm', import.meta.url);
1922
+ }
1923
+ const imports = __wbg_get_imports();
1924
+
1925
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1926
+ module_or_path = fetch(module_or_path);
1927
+ }
1928
+
1929
+ __wbg_init_memory(imports);
1930
+
1931
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1932
+
1933
+ return __wbg_finalize_init(instance, module);
1934
+ }
1935
+
1936
+ export { initSync };
1937
+ export default __wbg_init;