@query-farm/vgi-rpc-iroh-browser 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1324 @@
1
+ /* @ts-self-types="./vgi_rpc_iroh_browser.d.ts" */
2
+
3
+ /**
4
+ * Streaming HTTP response preserving ordered duplicate headers.
5
+ */
6
+ export class BrowserHttpResponse {
7
+ static __wrap(ptr) {
8
+ const obj = Object.create(BrowserHttpResponse.prototype);
9
+ obj.__wbg_ptr = ptr;
10
+ BrowserHttpResponseFinalization.register(obj, obj.__wbg_ptr, obj);
11
+ return obj;
12
+ }
13
+ __destroy_into_raw() {
14
+ const ptr = this.__wbg_ptr;
15
+ this.__wbg_ptr = 0;
16
+ BrowserHttpResponseFinalization.unregister(this);
17
+ return ptr;
18
+ }
19
+ free() {
20
+ const ptr = this.__destroy_into_raw();
21
+ wasm.__wbg_browserhttpresponse_free(ptr, 0);
22
+ }
23
+ cancel() {
24
+ wasm.browserhttpresponse_cancel(this.__wbg_ptr);
25
+ }
26
+ /**
27
+ * @returns {Array<any>}
28
+ */
29
+ get headers() {
30
+ const ret = wasm.browserhttpresponse_headers(this.__wbg_ptr);
31
+ return ret;
32
+ }
33
+ /**
34
+ * Read the next raw HTTP body data frame; trailers are currently skipped.
35
+ * No browser content decoding is performed.
36
+ * @returns {Promise<Uint8Array | undefined>}
37
+ */
38
+ read() {
39
+ const ret = wasm.browserhttpresponse_read(this.__wbg_ptr);
40
+ return ret;
41
+ }
42
+ /**
43
+ * @returns {number}
44
+ */
45
+ get status() {
46
+ const ret = wasm.browserhttpresponse_status(this.__wbg_ptr);
47
+ return ret;
48
+ }
49
+ }
50
+ if (Symbol.dispose) BrowserHttpResponse.prototype[Symbol.dispose] = BrowserHttpResponse.prototype.free;
51
+
52
+ /**
53
+ * One browser Iroh identity and its protocol-specific connection pools.
54
+ *
55
+ * Construct this with [`create_iroh_node`]. One instance should be shared by
56
+ * an entire DuckDB engine so HTTP and raw VGI calls present the same endpoint
57
+ * identity to workers.
58
+ */
59
+ export class BrowserIrohNode {
60
+ static __wrap(ptr) {
61
+ const obj = Object.create(BrowserIrohNode.prototype);
62
+ obj.__wbg_ptr = ptr;
63
+ BrowserIrohNodeFinalization.register(obj, obj.__wbg_ptr, obj);
64
+ return obj;
65
+ }
66
+ __destroy_into_raw() {
67
+ const ptr = this.__wbg_ptr;
68
+ this.__wbg_ptr = 0;
69
+ BrowserIrohNodeFinalization.unregister(this);
70
+ return ptr;
71
+ }
72
+ free() {
73
+ const ptr = this.__destroy_into_raw();
74
+ wasm.__wbg_browserirohnode_free(ptr, 0);
75
+ }
76
+ /**
77
+ * Close all pooled connections and release the browser endpoint.
78
+ * @returns {Promise<void>}
79
+ */
80
+ close() {
81
+ const ret = wasm.browserirohnode_close(this.__wbg_ptr);
82
+ return ret;
83
+ }
84
+ /**
85
+ * Lowercase 64-hex public endpoint key used by VGI's identity contract.
86
+ * @returns {string}
87
+ */
88
+ get endpointId() {
89
+ let deferred1_0;
90
+ let deferred1_1;
91
+ try {
92
+ const ret = wasm.browserirohnode_endpointId(this.__wbg_ptr);
93
+ deferred1_0 = ret[0];
94
+ deferred1_1 = ret[1];
95
+ return getStringFromWasm0(ret[0], ret[1]);
96
+ } finally {
97
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
98
+ }
99
+ }
100
+ /**
101
+ * Send one HTTP/1.1 request over a pooled `iroh-http/2` connection.
102
+ *
103
+ * `headers` is an array of `[name, value]` pairs so ordering and duplicate
104
+ * fields are preserved. The response body remains streaming through
105
+ * [`BrowserHttpResponse::read`].
106
+ * @param {string} remote
107
+ * @param {string} method
108
+ * @param {string} path
109
+ * @param {Array<any>} headers
110
+ * @param {Uint8Array} body
111
+ * @returns {Promise<BrowserHttpResponse>}
112
+ */
113
+ fetchHttpi(remote, method, path, headers, body) {
114
+ const ptr0 = passStringToWasm0(remote, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
115
+ const len0 = WASM_VECTOR_LEN;
116
+ const ptr1 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
117
+ const len1 = WASM_VECTOR_LEN;
118
+ const ptr2 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
119
+ const len2 = WASM_VECTOR_LEN;
120
+ const ret = wasm.browserirohnode_fetchHttpi(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, headers, body);
121
+ return ret;
122
+ }
123
+ /**
124
+ * Open one independent VGI byte stream on the pooled mux connection.
125
+ * @param {string} remote
126
+ * @returns {Promise<BrowserVgiStream>}
127
+ */
128
+ openVgiStream(remote) {
129
+ const ptr0 = passStringToWasm0(remote, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
130
+ const len0 = WASM_VECTOR_LEN;
131
+ const ret = wasm.browserirohnode_openVgiStream(this.__wbg_ptr, ptr0, len0);
132
+ return ret;
133
+ }
134
+ }
135
+ if (Symbol.dispose) BrowserIrohNode.prototype[Symbol.dispose] = BrowserIrohNode.prototype.free;
136
+
137
+ /**
138
+ * Raw bidirectional VGI stream. The accompanying TypeScript wrapper exposes
139
+ * these methods as WHATWG `ReadableStream` and `WritableStream` objects.
140
+ */
141
+ export class BrowserVgiStream {
142
+ static __wrap(ptr) {
143
+ const obj = Object.create(BrowserVgiStream.prototype);
144
+ obj.__wbg_ptr = ptr;
145
+ BrowserVgiStreamFinalization.register(obj, obj.__wbg_ptr, obj);
146
+ return obj;
147
+ }
148
+ __destroy_into_raw() {
149
+ const ptr = this.__wbg_ptr;
150
+ this.__wbg_ptr = 0;
151
+ BrowserVgiStreamFinalization.unregister(this);
152
+ return ptr;
153
+ }
154
+ free() {
155
+ const ptr = this.__destroy_into_raw();
156
+ wasm.__wbg_browservgistream_free(ptr, 0);
157
+ }
158
+ /**
159
+ * Reset both stream directions. This never closes sibling mux streams.
160
+ */
161
+ abort() {
162
+ wasm.browservgistream_abort(this.__wbg_ptr);
163
+ }
164
+ /**
165
+ * Finish the request direction while retaining the response direction.
166
+ * @returns {Promise<void>}
167
+ */
168
+ closeWrite() {
169
+ const ret = wasm.browservgistream_closeWrite(this.__wbg_ptr);
170
+ return ret;
171
+ }
172
+ /**
173
+ * Read up to `max_bytes`; returns `undefined` after a clean peer FIN.
174
+ * @param {number} max_bytes
175
+ * @returns {Promise<Uint8Array | undefined>}
176
+ */
177
+ read(max_bytes) {
178
+ const ret = wasm.browservgistream_read(this.__wbg_ptr, max_bytes);
179
+ return ret;
180
+ }
181
+ /**
182
+ * Write the complete chunk, respecting QUIC backpressure.
183
+ * @param {Uint8Array} chunk
184
+ * @returns {Promise<void>}
185
+ */
186
+ write(chunk) {
187
+ const ret = wasm.browservgistream_write(this.__wbg_ptr, chunk);
188
+ return ret;
189
+ }
190
+ }
191
+ if (Symbol.dispose) BrowserVgiStream.prototype[Symbol.dispose] = BrowserVgiStream.prototype.free;
192
+
193
+ export class IntoUnderlyingByteSource {
194
+ __destroy_into_raw() {
195
+ const ptr = this.__wbg_ptr;
196
+ this.__wbg_ptr = 0;
197
+ IntoUnderlyingByteSourceFinalization.unregister(this);
198
+ return ptr;
199
+ }
200
+ free() {
201
+ const ptr = this.__destroy_into_raw();
202
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
203
+ }
204
+ /**
205
+ * @returns {number}
206
+ */
207
+ get autoAllocateChunkSize() {
208
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
209
+ return ret >>> 0;
210
+ }
211
+ cancel() {
212
+ const ptr = this.__destroy_into_raw();
213
+ wasm.intounderlyingbytesource_cancel(ptr);
214
+ }
215
+ /**
216
+ * @param {ReadableByteStreamController} controller
217
+ * @returns {Promise<any>}
218
+ */
219
+ pull(controller) {
220
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
221
+ return ret;
222
+ }
223
+ /**
224
+ * @param {ReadableByteStreamController} controller
225
+ */
226
+ start(controller) {
227
+ wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
228
+ }
229
+ /**
230
+ * @returns {ReadableStreamType}
231
+ */
232
+ get type() {
233
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
234
+ return __wbindgen_enum_ReadableStreamType[ret];
235
+ }
236
+ }
237
+ if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
238
+
239
+ export class IntoUnderlyingSink {
240
+ __destroy_into_raw() {
241
+ const ptr = this.__wbg_ptr;
242
+ this.__wbg_ptr = 0;
243
+ IntoUnderlyingSinkFinalization.unregister(this);
244
+ return ptr;
245
+ }
246
+ free() {
247
+ const ptr = this.__destroy_into_raw();
248
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
249
+ }
250
+ /**
251
+ * @param {any} reason
252
+ * @returns {Promise<any>}
253
+ */
254
+ abort(reason) {
255
+ const ptr = this.__destroy_into_raw();
256
+ const ret = wasm.intounderlyingsink_abort(ptr, reason);
257
+ return ret;
258
+ }
259
+ /**
260
+ * @returns {Promise<any>}
261
+ */
262
+ close() {
263
+ const ptr = this.__destroy_into_raw();
264
+ const ret = wasm.intounderlyingsink_close(ptr);
265
+ return ret;
266
+ }
267
+ /**
268
+ * @param {any} chunk
269
+ * @returns {Promise<any>}
270
+ */
271
+ write(chunk) {
272
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
273
+ return ret;
274
+ }
275
+ }
276
+ if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
277
+
278
+ export class IntoUnderlyingSource {
279
+ __destroy_into_raw() {
280
+ const ptr = this.__wbg_ptr;
281
+ this.__wbg_ptr = 0;
282
+ IntoUnderlyingSourceFinalization.unregister(this);
283
+ return ptr;
284
+ }
285
+ free() {
286
+ const ptr = this.__destroy_into_raw();
287
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
288
+ }
289
+ cancel() {
290
+ const ptr = this.__destroy_into_raw();
291
+ wasm.intounderlyingsource_cancel(ptr);
292
+ }
293
+ /**
294
+ * @param {ReadableStreamDefaultController} controller
295
+ * @returns {Promise<any>}
296
+ */
297
+ pull(controller) {
298
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
299
+ return ret;
300
+ }
301
+ }
302
+ if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
303
+
304
+ /**
305
+ * Create a relay-capable browser endpoint.
306
+ *
307
+ * `options.secretKey` accepts Iroh's 64-hex or z-base-32 secret-key encoding.
308
+ * When omitted, a fresh ephemeral identity is generated. Persist the secret
309
+ * only when stable browser identity is an explicit application requirement.
310
+ * `options.relayUrls`, when supplied, replaces the n0 relay set.
311
+ * `options.noRelay=true` disables relays entirely. It is mutually exclusive
312
+ * with `relayUrls` and is mainly useful for controlled direct-address tests.
313
+ * @param {any | null} [options]
314
+ * @returns {Promise<BrowserIrohNode>}
315
+ */
316
+ export function createIrohNode(options) {
317
+ const ret = wasm.createIrohNode(isLikeNone(options) ? 0 : addToExternrefTable0(options));
318
+ return ret;
319
+ }
320
+ function __wbg_get_imports() {
321
+ const import0 = {
322
+ __proto__: null,
323
+ __wbg___wbindgen_boolean_get_2304fb8c853028c8: function(arg0) {
324
+ const v = arg0;
325
+ const ret = typeof(v) === 'boolean' ? v : undefined;
326
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
327
+ },
328
+ __wbg___wbindgen_debug_string_edece8177ad01481: function(arg0, arg1) {
329
+ const ret = debugString(arg1);
330
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
331
+ const len1 = WASM_VECTOR_LEN;
332
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
333
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
334
+ },
335
+ __wbg___wbindgen_is_function_5cd60d5cf78b4eef: function(arg0) {
336
+ const ret = typeof(arg0) === 'function';
337
+ return ret;
338
+ },
339
+ __wbg___wbindgen_is_null_2042690d351e14f0: function(arg0) {
340
+ const ret = arg0 === null;
341
+ return ret;
342
+ },
343
+ __wbg___wbindgen_is_object_b4593df85baada48: function(arg0) {
344
+ const val = arg0;
345
+ const ret = typeof(val) === 'object' && val !== null;
346
+ return ret;
347
+ },
348
+ __wbg___wbindgen_is_string_dde0fd9020db4434: function(arg0) {
349
+ const ret = typeof(arg0) === 'string';
350
+ return ret;
351
+ },
352
+ __wbg___wbindgen_is_undefined_35bb9f4c7fd651d5: function(arg0) {
353
+ const ret = arg0 === undefined;
354
+ return ret;
355
+ },
356
+ __wbg___wbindgen_string_get_d109740c0d18f4d7: function(arg0, arg1) {
357
+ const obj = arg1;
358
+ const ret = typeof(obj) === 'string' ? obj : undefined;
359
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
360
+ var len1 = WASM_VECTOR_LEN;
361
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
362
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
363
+ },
364
+ __wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
365
+ throw new Error(getStringFromWasm0(arg0, arg1));
366
+ },
367
+ __wbg__wbg_cb_unref_3fa391f3fcdb55f8: function(arg0) {
368
+ arg0._wbg_cb_unref();
369
+ },
370
+ __wbg_abort_89f7368e16055f5f: function(arg0, arg1) {
371
+ arg0.abort(arg1);
372
+ },
373
+ __wbg_abort_b363e6285472a358: function(arg0) {
374
+ arg0.abort();
375
+ },
376
+ __wbg_addEventListener_6f3a037944400810: function() { return handleError(function (arg0, arg1, arg2, arg3) {
377
+ arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3);
378
+ }, arguments); },
379
+ __wbg_append_263958599fd198c1: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
380
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
381
+ }, arguments); },
382
+ __wbg_arrayBuffer_cb5d4748b5f3cad5: function() { return handleError(function (arg0) {
383
+ const ret = arg0.arrayBuffer();
384
+ return ret;
385
+ }, arguments); },
386
+ __wbg_body_acbb5ec9cd18657f: function(arg0) {
387
+ const ret = arg0.body;
388
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
389
+ },
390
+ __wbg_browserhttpresponse_new: function(arg0) {
391
+ const ret = BrowserHttpResponse.__wrap(arg0);
392
+ return ret;
393
+ },
394
+ __wbg_browserirohnode_new: function(arg0) {
395
+ const ret = BrowserIrohNode.__wrap(arg0);
396
+ return ret;
397
+ },
398
+ __wbg_browservgistream_new: function(arg0) {
399
+ const ret = BrowserVgiStream.__wrap(arg0);
400
+ return ret;
401
+ },
402
+ __wbg_buffer_8d6798e32d1afd34: function(arg0) {
403
+ const ret = arg0.buffer;
404
+ return ret;
405
+ },
406
+ __wbg_byobRequest_9d8c3b7b2f692560: function(arg0) {
407
+ const ret = arg0.byobRequest;
408
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
409
+ },
410
+ __wbg_byteLength_c0cecdd68fab1693: function(arg0) {
411
+ const ret = arg0.byteLength;
412
+ return ret;
413
+ },
414
+ __wbg_byteOffset_3791b0030cc3b490: function(arg0) {
415
+ const ret = arg0.byteOffset;
416
+ return ret;
417
+ },
418
+ __wbg_call_dfde26266607c996: function() { return handleError(function (arg0, arg1, arg2) {
419
+ const ret = arg0.call(arg1, arg2);
420
+ return ret;
421
+ }, arguments); },
422
+ __wbg_cancel_bee68d5707c614fb: function(arg0) {
423
+ const ret = arg0.cancel();
424
+ return ret;
425
+ },
426
+ __wbg_catch_ec5061a695c26496: function(arg0, arg1) {
427
+ const ret = arg0.catch(arg1);
428
+ return ret;
429
+ },
430
+ __wbg_clearTimeout_333bba87532ab9d3: function(arg0) {
431
+ const ret = clearTimeout(arg0);
432
+ return ret;
433
+ },
434
+ __wbg_clearTimeout_47a40e3be01ed7a3: function() { return handleError(function (arg0, arg1) {
435
+ arg0.clearTimeout(arg1);
436
+ }, arguments); },
437
+ __wbg_close_53179a3d37ed525d: function() { return handleError(function (arg0) {
438
+ arg0.close();
439
+ }, arguments); },
440
+ __wbg_close_807d553ef8405788: function() { return handleError(function (arg0) {
441
+ arg0.close();
442
+ }, arguments); },
443
+ __wbg_close_e323e9eee669c291: function() { return handleError(function (arg0) {
444
+ arg0.close();
445
+ }, arguments); },
446
+ __wbg_code_98ceeaa5ff83fb0b: function(arg0) {
447
+ const ret = arg0.code;
448
+ return ret;
449
+ },
450
+ __wbg_code_b725fad05a5aceb3: function(arg0) {
451
+ const ret = arg0.code;
452
+ return ret;
453
+ },
454
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
455
+ const ret = arg0.crypto;
456
+ return ret;
457
+ },
458
+ __wbg_data_5fc79a19e47d1531: function(arg0) {
459
+ const ret = arg0.data;
460
+ return ret;
461
+ },
462
+ __wbg_done_54b8da57023b7ed2: function(arg0) {
463
+ const ret = arg0.done;
464
+ return ret;
465
+ },
466
+ __wbg_enqueue_c3ce0a986a355a8c: function() { return handleError(function (arg0, arg1) {
467
+ arg0.enqueue(arg1);
468
+ }, arguments); },
469
+ __wbg_entries_8c373da97ea5ada5: function(arg0) {
470
+ const ret = arg0.entries();
471
+ return ret;
472
+ },
473
+ __wbg_fetch_074561c3e313c86f: function(arg0) {
474
+ const ret = fetch(arg0);
475
+ return ret;
476
+ },
477
+ __wbg_fetch_2998af8c54e0997c: function(arg0, arg1) {
478
+ const ret = arg0.fetch(arg1);
479
+ return ret;
480
+ },
481
+ __wbg_from_fa561fa561dc8031: function(arg0) {
482
+ const ret = Array.from(arg0);
483
+ return ret;
484
+ },
485
+ __wbg_getRandomValues_76dfc69825c9c552: function() { return handleError(function (arg0, arg1) {
486
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
487
+ }, arguments); },
488
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
489
+ arg0.getRandomValues(arg1);
490
+ }, arguments); },
491
+ __wbg_getReader_9facd4f899beac89: function() { return handleError(function (arg0) {
492
+ const ret = arg0.getReader();
493
+ return ret;
494
+ }, arguments); },
495
+ __wbg_get_98fdf51d029a75eb: function(arg0, arg1) {
496
+ const ret = arg0[arg1 >>> 0];
497
+ return ret;
498
+ },
499
+ __wbg_get_dcf82ab8aad1a593: function() { return handleError(function (arg0, arg1) {
500
+ const ret = Reflect.get(arg0, arg1);
501
+ return ret;
502
+ }, arguments); },
503
+ __wbg_get_done_06210bfbda89c407: function(arg0) {
504
+ const ret = arg0.done;
505
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
506
+ },
507
+ __wbg_get_unchecked_1dfe6d05ad91d9b7: function(arg0, arg1) {
508
+ const ret = arg0[arg1 >>> 0];
509
+ return ret;
510
+ },
511
+ __wbg_get_value_31eb9abef97d98cb: function(arg0) {
512
+ const ret = arg0.value;
513
+ return ret;
514
+ },
515
+ __wbg_has_ef192b1f278770eb: function() { return handleError(function (arg0, arg1) {
516
+ const ret = Reflect.has(arg0, arg1);
517
+ return ret;
518
+ }, arguments); },
519
+ __wbg_headers_18f39f24d3837dc1: function(arg0) {
520
+ const ret = arg0.headers;
521
+ return ret;
522
+ },
523
+ __wbg_instanceof_ArrayBuffer_53db37b06f6b9afe: function(arg0) {
524
+ let result;
525
+ try {
526
+ result = arg0 instanceof ArrayBuffer;
527
+ } catch (_) {
528
+ result = false;
529
+ }
530
+ const ret = result;
531
+ return ret;
532
+ },
533
+ __wbg_instanceof_Blob_ef93d187bbde5360: function(arg0) {
534
+ let result;
535
+ try {
536
+ result = arg0 instanceof Blob;
537
+ } catch (_) {
538
+ result = false;
539
+ }
540
+ const ret = result;
541
+ return ret;
542
+ },
543
+ __wbg_instanceof_Response_ecfc823e8fb354e2: function(arg0) {
544
+ let result;
545
+ try {
546
+ result = arg0 instanceof Response;
547
+ } catch (_) {
548
+ result = false;
549
+ }
550
+ const ret = result;
551
+ return ret;
552
+ },
553
+ __wbg_isArray_94898ed3aad6947b: function(arg0) {
554
+ const ret = Array.isArray(arg0);
555
+ return ret;
556
+ },
557
+ __wbg_length_2591a0f4f659a55c: function(arg0) {
558
+ const ret = arg0.length;
559
+ return ret;
560
+ },
561
+ __wbg_length_56fcd3e2b7e0299d: function(arg0) {
562
+ const ret = arg0.length;
563
+ return ret;
564
+ },
565
+ __wbg_message_e88a8d3ba2b91c2a: function(arg0, arg1) {
566
+ const ret = arg1.message;
567
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
568
+ const len1 = WASM_VECTOR_LEN;
569
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
570
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
571
+ },
572
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
573
+ const ret = arg0.msCrypto;
574
+ return ret;
575
+ },
576
+ __wbg_new_02d162bc6cf02f60: function() {
577
+ const ret = new Object();
578
+ return ret;
579
+ },
580
+ __wbg_new_1f236d63ba0c4784: function(arg0, arg1) {
581
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
582
+ return ret;
583
+ },
584
+ __wbg_new_310879b66b6e95e1: function() {
585
+ const ret = new Array();
586
+ return ret;
587
+ },
588
+ __wbg_new_7ddec6de44ff8f5d: function(arg0) {
589
+ const ret = new Uint8Array(arg0);
590
+ return ret;
591
+ },
592
+ __wbg_new_a4f7d7433843fa16: function(arg0, arg1) {
593
+ const ret = new RangeError(getStringFromWasm0(arg0, arg1));
594
+ return ret;
595
+ },
596
+ __wbg_new_af86d8f14640f1f3: function() { return handleError(function () {
597
+ const ret = new AbortController();
598
+ return ret;
599
+ }, arguments); },
600
+ __wbg_new_b1280f836646084c: function() { return handleError(function (arg0, arg1) {
601
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
602
+ return ret;
603
+ }, arguments); },
604
+ __wbg_new_c75e85159e69cd5e: function(arg0, arg1) {
605
+ const ret = new TypeError(getStringFromWasm0(arg0, arg1));
606
+ return ret;
607
+ },
608
+ __wbg_new_ee0be486d8f01282: function() { return handleError(function () {
609
+ const ret = new Headers();
610
+ return ret;
611
+ }, arguments); },
612
+ __wbg_new_from_slice_269e35316ed2d061: function(arg0, arg1) {
613
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
614
+ return ret;
615
+ },
616
+ __wbg_new_typed_c072c4ce9a2a0cdf: function(arg0, arg1) {
617
+ try {
618
+ var state0 = {a: arg0, b: arg1};
619
+ var cb0 = (arg0, arg1) => {
620
+ const a = state0.a;
621
+ state0.a = 0;
622
+ try {
623
+ return wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___js_sys_a199f889b0d5f53b___Function_fn_wasm_bindgen_91244e9a1334c25a___JsValue_____wasm_bindgen_91244e9a1334c25a___sys__Undefined___js_sys_a199f889b0d5f53b___Function_fn_wasm_bindgen_91244e9a1334c25a___JsValue_____wasm_bindgen_91244e9a1334c25a___sys__Undefined_______true_(a, state0.b, arg0, arg1);
624
+ } finally {
625
+ state0.a = a;
626
+ }
627
+ };
628
+ const ret = new Promise(cb0);
629
+ return ret;
630
+ } finally {
631
+ state0.a = 0;
632
+ }
633
+ },
634
+ __wbg_new_with_byte_offset_and_length_a87e79143162d67f: function(arg0, arg1, arg2) {
635
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
636
+ return ret;
637
+ },
638
+ __wbg_new_with_length_99887c91eae4abab: function(arg0) {
639
+ const ret = new Uint8Array(arg0 >>> 0);
640
+ return ret;
641
+ },
642
+ __wbg_new_with_str_and_init_ffe9977c986ea039: function() { return handleError(function (arg0, arg1, arg2) {
643
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
644
+ return ret;
645
+ }, arguments); },
646
+ __wbg_new_with_str_sequence_dfd6f579eac5ed31: function() { return handleError(function (arg0, arg1, arg2) {
647
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
648
+ return ret;
649
+ }, arguments); },
650
+ __wbg_next_6429a146bf756f93: function() { return handleError(function (arg0) {
651
+ const ret = arg0.next();
652
+ return ret;
653
+ }, arguments); },
654
+ __wbg_node_84ea875411254db1: function(arg0) {
655
+ const ret = arg0.node;
656
+ return ret;
657
+ },
658
+ __wbg_now_81363d44c96dd239: function() {
659
+ const ret = Date.now();
660
+ return ret;
661
+ },
662
+ __wbg_now_e7c6795a7f81e10f: function(arg0) {
663
+ const ret = arg0.now();
664
+ return ret;
665
+ },
666
+ __wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
667
+ const ret = arg0.performance;
668
+ return ret;
669
+ },
670
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
671
+ const ret = arg0.process;
672
+ return ret;
673
+ },
674
+ __wbg_protocol_069bb430882c6686: function(arg0, arg1) {
675
+ const ret = arg1.protocol;
676
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
677
+ const len1 = WASM_VECTOR_LEN;
678
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
679
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
680
+ },
681
+ __wbg_prototypesetcall_5f9bdc8d75e07276: function(arg0, arg1, arg2) {
682
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
683
+ },
684
+ __wbg_push_b77c476b01548d0a: function(arg0, arg1) {
685
+ const ret = arg0.push(arg1);
686
+ return ret;
687
+ },
688
+ __wbg_queueMicrotask_78d584b53af520f5: function(arg0) {
689
+ const ret = arg0.queueMicrotask;
690
+ return ret;
691
+ },
692
+ __wbg_queueMicrotask_b39ea83c7f01971a: function(arg0) {
693
+ queueMicrotask(arg0);
694
+ },
695
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
696
+ arg0.randomFillSync(arg1);
697
+ }, arguments); },
698
+ __wbg_read_254bf22401498310: function(arg0) {
699
+ const ret = arg0.read();
700
+ return ret;
701
+ },
702
+ __wbg_readyState_a1a00cc8898812ac: function(arg0) {
703
+ const ret = arg0.readyState;
704
+ return ret;
705
+ },
706
+ __wbg_reason_48e6f2ed86d09534: function(arg0, arg1) {
707
+ const ret = arg1.reason;
708
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
709
+ const len1 = WASM_VECTOR_LEN;
710
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
711
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
712
+ },
713
+ __wbg_releaseLock_65f356509fef84ac: function(arg0) {
714
+ arg0.releaseLock();
715
+ },
716
+ __wbg_removeEventListener_74e3ac8e219bcdc7: function() { return handleError(function (arg0, arg1, arg2, arg3) {
717
+ arg0.removeEventListener(getStringFromWasm0(arg1, arg2), arg3);
718
+ }, arguments); },
719
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
720
+ const ret = module.require;
721
+ return ret;
722
+ }, arguments); },
723
+ __wbg_resolve_d17db9352f5a220e: function(arg0) {
724
+ const ret = Promise.resolve(arg0);
725
+ return ret;
726
+ },
727
+ __wbg_respond_0196e052b003e1db: function() { return handleError(function (arg0, arg1) {
728
+ arg0.respond(arg1 >>> 0);
729
+ }, arguments); },
730
+ __wbg_send_b9d998a91cbc8429: function() { return handleError(function (arg0, arg1, arg2) {
731
+ arg0.send(getArrayU8FromWasm0(arg1, arg2));
732
+ }, arguments); },
733
+ __wbg_send_e1d2f71ce4473d1e: function() { return handleError(function (arg0, arg1, arg2) {
734
+ arg0.send(getStringFromWasm0(arg1, arg2));
735
+ }, arguments); },
736
+ __wbg_setTimeout_3a808dd861dd3c12: function(arg0, arg1) {
737
+ const ret = setTimeout(arg0, arg1);
738
+ return ret;
739
+ },
740
+ __wbg_setTimeout_6613a51400c1bf9f: function() { return handleError(function (arg0, arg1, arg2) {
741
+ const ret = arg0.setTimeout(arg1, arg2);
742
+ return ret;
743
+ }, arguments); },
744
+ __wbg_set_24d0fa9e104112f9: function(arg0, arg1, arg2) {
745
+ arg0.set(getArrayU8FromWasm0(arg1, arg2));
746
+ },
747
+ __wbg_set_a0e911be3da02782: function() { return handleError(function (arg0, arg1, arg2) {
748
+ const ret = Reflect.set(arg0, arg1, arg2);
749
+ return ret;
750
+ }, arguments); },
751
+ __wbg_set_binaryType_5c0002dfcf194934: function(arg0, arg1) {
752
+ arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
753
+ },
754
+ __wbg_set_body_7f56457720e81672: function(arg0, arg1) {
755
+ arg0.body = arg1;
756
+ },
757
+ __wbg_set_cache_9ed01a3813d96de2: function(arg0, arg1) {
758
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
759
+ },
760
+ __wbg_set_credentials_55b92faec8dcc6a4: function(arg0, arg1) {
761
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
762
+ },
763
+ __wbg_set_handle_event_6471b5e5fe16e12f: function(arg0, arg1) {
764
+ arg0.handleEvent = arg1;
765
+ },
766
+ __wbg_set_headers_97ed66619adb1e3e: function(arg0, arg1) {
767
+ arg0.headers = arg1;
768
+ },
769
+ __wbg_set_method_4d69a1a7e34c0aca: function(arg0, arg1, arg2) {
770
+ arg0.method = getStringFromWasm0(arg1, arg2);
771
+ },
772
+ __wbg_set_mode_dfc59bbbe25b1d14: function(arg0, arg1) {
773
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
774
+ },
775
+ __wbg_set_onclose_3121e15055418a37: function(arg0, arg1) {
776
+ arg0.onclose = arg1;
777
+ },
778
+ __wbg_set_onerror_1dd52df6279c8dd2: function(arg0, arg1) {
779
+ arg0.onerror = arg1;
780
+ },
781
+ __wbg_set_onmessage_9eb2cf76e70783ad: function(arg0, arg1) {
782
+ arg0.onmessage = arg1;
783
+ },
784
+ __wbg_set_onopen_6f3fc5e2ad3144f1: function(arg0, arg1) {
785
+ arg0.onopen = arg1;
786
+ },
787
+ __wbg_set_signal_2a5bd3615938edbc: function(arg0, arg1) {
788
+ arg0.signal = arg1;
789
+ },
790
+ __wbg_signal_304beac95c8c5ea0: function(arg0) {
791
+ const ret = arg0.signal;
792
+ return ret;
793
+ },
794
+ __wbg_static_accessor_GLOBAL_THIS_02344c9b09eb08a9: function() {
795
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
796
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
797
+ },
798
+ __wbg_static_accessor_GLOBAL_ac6d4ac874d5cd54: function() {
799
+ const ret = typeof global === 'undefined' ? null : global;
800
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
801
+ },
802
+ __wbg_static_accessor_SELF_9b2406c23aeb2023: function() {
803
+ const ret = typeof self === 'undefined' ? null : self;
804
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
805
+ },
806
+ __wbg_static_accessor_WINDOW_b34d2126934e16ba: function() {
807
+ const ret = typeof window === 'undefined' ? null : window;
808
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
809
+ },
810
+ __wbg_status_0853c9f5752c7ee2: function(arg0) {
811
+ const ret = arg0.status;
812
+ return ret;
813
+ },
814
+ __wbg_subarray_7c6a0da8f3b4a1ba: function(arg0, arg1, arg2) {
815
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
816
+ return ret;
817
+ },
818
+ __wbg_then_837494e384b37459: function(arg0, arg1) {
819
+ const ret = arg0.then(arg1);
820
+ return ret;
821
+ },
822
+ __wbg_then_bd927500e8905df2: function(arg0, arg1, arg2) {
823
+ const ret = arg0.then(arg1, arg2);
824
+ return ret;
825
+ },
826
+ __wbg_url_0556640de0fe231b: function(arg0, arg1) {
827
+ const ret = arg1.url;
828
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
829
+ const len1 = WASM_VECTOR_LEN;
830
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
831
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
832
+ },
833
+ __wbg_url_1a5ea6a8a7f22ff8: function(arg0, arg1) {
834
+ const ret = arg1.url;
835
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
836
+ const len1 = WASM_VECTOR_LEN;
837
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
838
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
839
+ },
840
+ __wbg_value_9cc0518af87a489c: function(arg0) {
841
+ const ret = arg0.value;
842
+ return ret;
843
+ },
844
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
845
+ const ret = arg0.versions;
846
+ return ret;
847
+ },
848
+ __wbg_view_1b637c097280508c: function(arg0) {
849
+ const ret = arg0.view;
850
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
851
+ },
852
+ __wbg_wasClean_aa6a78fa841a6301: function(arg0) {
853
+ const ret = arg0.wasClean;
854
+ return ret;
855
+ },
856
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
857
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2232, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
858
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___wasm_bindgen_91244e9a1334c25a___JsValue______true_);
859
+ return ret;
860
+ },
861
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
862
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 4065, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
863
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___wasm_bindgen_91244e9a1334c25a___JsValue__core_7d5f0a2ba6a62c33___result__Result_____wasm_bindgen_91244e9a1334c25a___JsError___true_);
864
+ return ret;
865
+ },
866
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
867
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1359, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
868
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___web_sys_65b30f6c5de6bd9e___features__gen_CloseEvent__CloseEvent______true_);
869
+ return ret;
870
+ },
871
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
872
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 2873, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
873
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___web_sys_65b30f6c5de6bd9e___features__gen_MessageEvent__MessageEvent______true_);
874
+ return ret;
875
+ },
876
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
877
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2153, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
878
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true_);
879
+ return ret;
880
+ },
881
+ __wbindgen_cast_0000000000000006: function(arg0, arg1) {
882
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
883
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true__1_);
884
+ return ret;
885
+ },
886
+ __wbindgen_cast_0000000000000007: function(arg0, arg1) {
887
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2430, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
888
+ const ret = makeClosure(arg0, arg1, wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true__2_);
889
+ return ret;
890
+ },
891
+ __wbindgen_cast_0000000000000008: function(arg0, arg1) {
892
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 4031, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
893
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true__3_);
894
+ return ret;
895
+ },
896
+ __wbindgen_cast_0000000000000009: function(arg0, arg1) {
897
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
898
+ const ret = getArrayU8FromWasm0(arg0, arg1);
899
+ return ret;
900
+ },
901
+ __wbindgen_cast_000000000000000a: function(arg0, arg1) {
902
+ // Cast intrinsic for `Ref(String) -> Externref`.
903
+ const ret = getStringFromWasm0(arg0, arg1);
904
+ return ret;
905
+ },
906
+ __wbindgen_init_externref_table: function() {
907
+ const table = wasm.__wbindgen_externrefs;
908
+ const offset = table.grow(4);
909
+ table.set(0, undefined);
910
+ table.set(offset + 0, undefined);
911
+ table.set(offset + 1, null);
912
+ table.set(offset + 2, true);
913
+ table.set(offset + 3, false);
914
+ },
915
+ };
916
+ return {
917
+ __proto__: null,
918
+ "./vgi_rpc_iroh_browser_bg.js": import0,
919
+ };
920
+ }
921
+
922
+ function wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true_(arg0, arg1) {
923
+ wasm.wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true_(arg0, arg1);
924
+ }
925
+
926
+ function wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true__1_(arg0, arg1) {
927
+ wasm.wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true__1_(arg0, arg1);
928
+ }
929
+
930
+ function wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true__2_(arg0, arg1) {
931
+ wasm.wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true__2_(arg0, arg1);
932
+ }
933
+
934
+ function wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true__3_(arg0, arg1) {
935
+ wasm.wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke_______true__3_(arg0, arg1);
936
+ }
937
+
938
+ function wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___wasm_bindgen_91244e9a1334c25a___JsValue______true_(arg0, arg1, arg2) {
939
+ wasm.wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___wasm_bindgen_91244e9a1334c25a___JsValue______true_(arg0, arg1, arg2);
940
+ }
941
+
942
+ function wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___web_sys_65b30f6c5de6bd9e___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2) {
943
+ wasm.wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___web_sys_65b30f6c5de6bd9e___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2);
944
+ }
945
+
946
+ function wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___web_sys_65b30f6c5de6bd9e___features__gen_MessageEvent__MessageEvent______true_(arg0, arg1, arg2) {
947
+ wasm.wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___web_sys_65b30f6c5de6bd9e___features__gen_MessageEvent__MessageEvent______true_(arg0, arg1, arg2);
948
+ }
949
+
950
+ function wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___wasm_bindgen_91244e9a1334c25a___JsValue__core_7d5f0a2ba6a62c33___result__Result_____wasm_bindgen_91244e9a1334c25a___JsError___true_(arg0, arg1, arg2) {
951
+ const ret = wasm.wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___wasm_bindgen_91244e9a1334c25a___JsValue__core_7d5f0a2ba6a62c33___result__Result_____wasm_bindgen_91244e9a1334c25a___JsError___true_(arg0, arg1, arg2);
952
+ if (ret[1]) {
953
+ throw takeFromExternrefTable0(ret[0]);
954
+ }
955
+ }
956
+
957
+ function wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___js_sys_a199f889b0d5f53b___Function_fn_wasm_bindgen_91244e9a1334c25a___JsValue_____wasm_bindgen_91244e9a1334c25a___sys__Undefined___js_sys_a199f889b0d5f53b___Function_fn_wasm_bindgen_91244e9a1334c25a___JsValue_____wasm_bindgen_91244e9a1334c25a___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
958
+ wasm.wasm_bindgen_91244e9a1334c25a___convert__closures_____invoke___js_sys_a199f889b0d5f53b___Function_fn_wasm_bindgen_91244e9a1334c25a___JsValue_____wasm_bindgen_91244e9a1334c25a___sys__Undefined___js_sys_a199f889b0d5f53b___Function_fn_wasm_bindgen_91244e9a1334c25a___JsValue_____wasm_bindgen_91244e9a1334c25a___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
959
+ }
960
+
961
+
962
+ const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
963
+
964
+
965
+ const __wbindgen_enum_ReadableStreamType = ["bytes"];
966
+
967
+
968
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
969
+
970
+
971
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
972
+
973
+
974
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
975
+ const BrowserHttpResponseFinalization = (typeof FinalizationRegistry === 'undefined')
976
+ ? { register: () => {}, unregister: () => {} }
977
+ : new FinalizationRegistry(ptr => wasm.__wbg_browserhttpresponse_free(ptr, 1));
978
+ const BrowserIrohNodeFinalization = (typeof FinalizationRegistry === 'undefined')
979
+ ? { register: () => {}, unregister: () => {} }
980
+ : new FinalizationRegistry(ptr => wasm.__wbg_browserirohnode_free(ptr, 1));
981
+ const BrowserVgiStreamFinalization = (typeof FinalizationRegistry === 'undefined')
982
+ ? { register: () => {}, unregister: () => {} }
983
+ : new FinalizationRegistry(ptr => wasm.__wbg_browservgistream_free(ptr, 1));
984
+ const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
985
+ ? { register: () => {}, unregister: () => {} }
986
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr, 1));
987
+ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
988
+ ? { register: () => {}, unregister: () => {} }
989
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr, 1));
990
+ const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
991
+ ? { register: () => {}, unregister: () => {} }
992
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr, 1));
993
+
994
+ function addToExternrefTable0(obj) {
995
+ const idx = wasm.__externref_table_alloc();
996
+ wasm.__wbindgen_externrefs.set(idx, obj);
997
+ return idx;
998
+ }
999
+
1000
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1001
+ ? { register: () => {}, unregister: () => {} }
1002
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
1003
+
1004
+ function debugString(val) {
1005
+ // primitive types
1006
+ const type = typeof val;
1007
+ if (type == 'number' || type == 'boolean' || val == null) {
1008
+ return `${val}`;
1009
+ }
1010
+ if (type == 'string') {
1011
+ return `"${val}"`;
1012
+ }
1013
+ if (type == 'symbol') {
1014
+ const description = val.description;
1015
+ if (description == null) {
1016
+ return 'Symbol';
1017
+ } else {
1018
+ return `Symbol(${description})`;
1019
+ }
1020
+ }
1021
+ if (type == 'function') {
1022
+ const name = val.name;
1023
+ if (typeof name == 'string' && name.length > 0) {
1024
+ return `Function(${name})`;
1025
+ } else {
1026
+ return 'Function';
1027
+ }
1028
+ }
1029
+ // objects
1030
+ if (Array.isArray(val)) {
1031
+ const length = val.length;
1032
+ let debug = '[';
1033
+ if (length > 0) {
1034
+ debug += debugString(val[0]);
1035
+ }
1036
+ for(let i = 1; i < length; i++) {
1037
+ debug += ', ' + debugString(val[i]);
1038
+ }
1039
+ debug += ']';
1040
+ return debug;
1041
+ }
1042
+ // Test for built-in
1043
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1044
+ let className;
1045
+ if (builtInMatches && builtInMatches.length > 1) {
1046
+ className = builtInMatches[1];
1047
+ } else {
1048
+ // Failed to match the standard '[object ClassName]'
1049
+ return toString.call(val);
1050
+ }
1051
+ if (className == 'Object') {
1052
+ // we're a user defined class or Object
1053
+ // JSON.stringify avoids problems with cycles, and is generally much
1054
+ // easier than looping through ownProperties of `val`.
1055
+ try {
1056
+ return 'Object(' + JSON.stringify(val) + ')';
1057
+ } catch (_) {
1058
+ return 'Object';
1059
+ }
1060
+ }
1061
+ // errors
1062
+ if (val instanceof Error) {
1063
+ return `${val.name}: ${val.message}\n${val.stack}`;
1064
+ }
1065
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1066
+ return className;
1067
+ }
1068
+
1069
+ function getArrayU8FromWasm0(ptr, len) {
1070
+ ptr = ptr >>> 0;
1071
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1072
+ }
1073
+
1074
+ let cachedDataViewMemory0 = null;
1075
+ function getDataViewMemory0() {
1076
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1077
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1078
+ }
1079
+ return cachedDataViewMemory0;
1080
+ }
1081
+
1082
+ function getStringFromWasm0(ptr, len) {
1083
+ return decodeText(ptr >>> 0, len);
1084
+ }
1085
+
1086
+ let cachedUint8ArrayMemory0 = null;
1087
+ function getUint8ArrayMemory0() {
1088
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1089
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1090
+ }
1091
+ return cachedUint8ArrayMemory0;
1092
+ }
1093
+
1094
+ function handleError(f, args) {
1095
+ try {
1096
+ return f.apply(this, args);
1097
+ } catch (e) {
1098
+ const idx = addToExternrefTable0(e);
1099
+ wasm.__wbindgen_exn_store(idx);
1100
+ }
1101
+ }
1102
+
1103
+ function isLikeNone(x) {
1104
+ return x === undefined || x === null;
1105
+ }
1106
+
1107
+ function makeClosure(arg0, arg1, f) {
1108
+ const state = { a: arg0, b: arg1, cnt: 1 };
1109
+ const real = (...args) => {
1110
+
1111
+ // First up with a closure we increment the internal reference
1112
+ // count. This ensures that the Rust closure environment won't
1113
+ // be deallocated while we're invoking it.
1114
+ state.cnt++;
1115
+ try {
1116
+ return f(state.a, state.b, ...args);
1117
+ } finally {
1118
+ real._wbg_cb_unref();
1119
+ }
1120
+ };
1121
+ real._wbg_cb_unref = () => {
1122
+ if (--state.cnt === 0) {
1123
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
1124
+ state.a = 0;
1125
+ CLOSURE_DTORS.unregister(state);
1126
+ }
1127
+ };
1128
+ CLOSURE_DTORS.register(real, state, state);
1129
+ return real;
1130
+ }
1131
+
1132
+ function makeMutClosure(arg0, arg1, f) {
1133
+ const state = { a: arg0, b: arg1, cnt: 1 };
1134
+ const real = (...args) => {
1135
+
1136
+ // First up with a closure we increment the internal reference
1137
+ // count. This ensures that the Rust closure environment won't
1138
+ // be deallocated while we're invoking it.
1139
+ state.cnt++;
1140
+ const a = state.a;
1141
+ state.a = 0;
1142
+ try {
1143
+ return f(a, state.b, ...args);
1144
+ } finally {
1145
+ state.a = a;
1146
+ real._wbg_cb_unref();
1147
+ }
1148
+ };
1149
+ real._wbg_cb_unref = () => {
1150
+ if (--state.cnt === 0) {
1151
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
1152
+ state.a = 0;
1153
+ CLOSURE_DTORS.unregister(state);
1154
+ }
1155
+ };
1156
+ CLOSURE_DTORS.register(real, state, state);
1157
+ return real;
1158
+ }
1159
+
1160
+ function passStringToWasm0(arg, malloc, realloc) {
1161
+ if (realloc === undefined) {
1162
+ const buf = cachedTextEncoder.encode(arg);
1163
+ const ptr = malloc(buf.length, 1) >>> 0;
1164
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1165
+ WASM_VECTOR_LEN = buf.length;
1166
+ return ptr;
1167
+ }
1168
+
1169
+ let len = arg.length;
1170
+ let ptr = malloc(len, 1) >>> 0;
1171
+
1172
+ const mem = getUint8ArrayMemory0();
1173
+
1174
+ let offset = 0;
1175
+
1176
+ for (; offset < len; offset++) {
1177
+ const code = arg.charCodeAt(offset);
1178
+ if (code > 0x7F) break;
1179
+ mem[ptr + offset] = code;
1180
+ }
1181
+ if (offset !== len) {
1182
+ if (offset !== 0) {
1183
+ arg = arg.slice(offset);
1184
+ }
1185
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1186
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1187
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1188
+
1189
+ offset += ret.written;
1190
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1191
+ }
1192
+
1193
+ WASM_VECTOR_LEN = offset;
1194
+ return ptr;
1195
+ }
1196
+
1197
+ function takeFromExternrefTable0(idx) {
1198
+ const value = wasm.__wbindgen_externrefs.get(idx);
1199
+ wasm.__externref_table_dealloc(idx);
1200
+ return value;
1201
+ }
1202
+
1203
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1204
+ cachedTextDecoder.decode();
1205
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1206
+ let numBytesDecoded = 0;
1207
+ function decodeText(ptr, len) {
1208
+ numBytesDecoded += len;
1209
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1210
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1211
+ cachedTextDecoder.decode();
1212
+ numBytesDecoded = len;
1213
+ }
1214
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1215
+ }
1216
+
1217
+ const cachedTextEncoder = new TextEncoder();
1218
+
1219
+ if (!('encodeInto' in cachedTextEncoder)) {
1220
+ cachedTextEncoder.encodeInto = function (arg, view) {
1221
+ const buf = cachedTextEncoder.encode(arg);
1222
+ view.set(buf);
1223
+ return {
1224
+ read: arg.length,
1225
+ written: buf.length
1226
+ };
1227
+ };
1228
+ }
1229
+
1230
+ let WASM_VECTOR_LEN = 0;
1231
+
1232
+ let wasmModule, wasmInstance, wasm;
1233
+ function __wbg_finalize_init(instance, module) {
1234
+ wasmInstance = instance;
1235
+ wasm = instance.exports;
1236
+ wasmModule = module;
1237
+ cachedDataViewMemory0 = null;
1238
+ cachedUint8ArrayMemory0 = null;
1239
+ wasm.__wbindgen_start();
1240
+ return wasm;
1241
+ }
1242
+
1243
+ async function __wbg_load(module, imports) {
1244
+ if (typeof Response === 'function' && module instanceof Response) {
1245
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1246
+ try {
1247
+ return await WebAssembly.instantiateStreaming(module, imports);
1248
+ } catch (e) {
1249
+ const validResponse = module.ok && expectedResponseType(module.type);
1250
+
1251
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1252
+ 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);
1253
+
1254
+ } else { throw e; }
1255
+ }
1256
+ }
1257
+
1258
+ const bytes = await module.arrayBuffer();
1259
+ return await WebAssembly.instantiate(bytes, imports);
1260
+ } else {
1261
+ const instance = await WebAssembly.instantiate(module, imports);
1262
+
1263
+ if (instance instanceof WebAssembly.Instance) {
1264
+ return { instance, module };
1265
+ } else {
1266
+ return instance;
1267
+ }
1268
+ }
1269
+
1270
+ function expectedResponseType(type) {
1271
+ switch (type) {
1272
+ case 'basic': case 'cors': case 'default': return true;
1273
+ }
1274
+ return false;
1275
+ }
1276
+ }
1277
+
1278
+ function initSync(module) {
1279
+ if (wasm !== undefined) return wasm;
1280
+
1281
+
1282
+ if (module !== undefined) {
1283
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1284
+ ({module} = module)
1285
+ } else {
1286
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1287
+ }
1288
+ }
1289
+
1290
+ const imports = __wbg_get_imports();
1291
+ if (!(module instanceof WebAssembly.Module)) {
1292
+ module = new WebAssembly.Module(module);
1293
+ }
1294
+ const instance = new WebAssembly.Instance(module, imports);
1295
+ return __wbg_finalize_init(instance, module);
1296
+ }
1297
+
1298
+ async function __wbg_init(module_or_path) {
1299
+ if (wasm !== undefined) return wasm;
1300
+
1301
+
1302
+ if (module_or_path !== undefined) {
1303
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1304
+ ({module_or_path} = module_or_path)
1305
+ } else {
1306
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1307
+ }
1308
+ }
1309
+
1310
+ if (module_or_path === undefined) {
1311
+ module_or_path = new URL('vgi_rpc_iroh_browser_bg.wasm', import.meta.url);
1312
+ }
1313
+ const imports = __wbg_get_imports();
1314
+
1315
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1316
+ module_or_path = fetch(module_or_path);
1317
+ }
1318
+
1319
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1320
+
1321
+ return __wbg_finalize_init(instance, module);
1322
+ }
1323
+
1324
+ export { initSync, __wbg_init as default };