@freqhole/midden 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -0
- package/midden.d.ts +388 -0
- package/midden.js +9 -0
- package/midden_bg.js +1830 -0
- package/midden_bg.wasm +0 -0
- package/package.json +21 -0
package/midden_bg.js
ADDED
|
@@ -0,0 +1,1830 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* a bidirectional QUIC stream for length-delimited message exchange.
|
|
3
|
+
*
|
|
4
|
+
* wraps an iroh (SendStream, RecvStream) pair. messages are framed with
|
|
5
|
+
* a 4-byte big-endian u32 length prefix, matching `LengthDelimitedCodec`
|
|
6
|
+
* from tokio-util.
|
|
7
|
+
*
|
|
8
|
+
* the send and recv halves use RefCell<Option<...>> so that async read
|
|
9
|
+
* and write operations can proceed concurrently (safe because WASM is
|
|
10
|
+
* single-threaded).
|
|
11
|
+
*/
|
|
12
|
+
export class BiStream {
|
|
13
|
+
static __wrap(ptr) {
|
|
14
|
+
ptr = ptr >>> 0;
|
|
15
|
+
const obj = Object.create(BiStream.prototype);
|
|
16
|
+
obj.__wbg_ptr = ptr;
|
|
17
|
+
BiStreamFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
18
|
+
return obj;
|
|
19
|
+
}
|
|
20
|
+
__destroy_into_raw() {
|
|
21
|
+
const ptr = this.__wbg_ptr;
|
|
22
|
+
this.__wbg_ptr = 0;
|
|
23
|
+
BiStreamFinalization.unregister(this);
|
|
24
|
+
return ptr;
|
|
25
|
+
}
|
|
26
|
+
free() {
|
|
27
|
+
const ptr = this.__destroy_into_raw();
|
|
28
|
+
wasm.__wbg_bistream_free(ptr, 0);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* the ALPN protocol this stream was established on.
|
|
32
|
+
* @returns {string}
|
|
33
|
+
*/
|
|
34
|
+
alpn() {
|
|
35
|
+
let deferred1_0;
|
|
36
|
+
let deferred1_1;
|
|
37
|
+
try {
|
|
38
|
+
const ret = wasm.bistream_alpn(this.__wbg_ptr);
|
|
39
|
+
deferred1_0 = ret[0];
|
|
40
|
+
deferred1_1 = ret[1];
|
|
41
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
42
|
+
} finally {
|
|
43
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* close the stream.
|
|
48
|
+
*
|
|
49
|
+
* finishes the send half and drops both halves.
|
|
50
|
+
*/
|
|
51
|
+
close() {
|
|
52
|
+
wasm.bistream_close(this.__wbg_ptr);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* the remote peer's node ID (iroh public key as hex string).
|
|
56
|
+
* @returns {string}
|
|
57
|
+
*/
|
|
58
|
+
peer_node_id() {
|
|
59
|
+
let deferred1_0;
|
|
60
|
+
let deferred1_1;
|
|
61
|
+
try {
|
|
62
|
+
const ret = wasm.bistream_peer_node_id(this.__wbg_ptr);
|
|
63
|
+
deferred1_0 = ret[0];
|
|
64
|
+
deferred1_1 = ret[1];
|
|
65
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
66
|
+
} finally {
|
|
67
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* read a newline-terminated utf-8 line.
|
|
72
|
+
*
|
|
73
|
+
* returns the line WITHOUT the trailing `\n`. returns null on clean
|
|
74
|
+
* stream close (EOF before any bytes). used for ndjson framing.
|
|
75
|
+
* @returns {Promise<any>}
|
|
76
|
+
*/
|
|
77
|
+
read_line() {
|
|
78
|
+
const ret = wasm.bistream_read_line(this.__wbg_ptr);
|
|
79
|
+
return ret;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* read a length-delimited message.
|
|
83
|
+
*
|
|
84
|
+
* reads a 4-byte big-endian u32 length prefix, then reads that many
|
|
85
|
+
* bytes of payload. returns the payload as a Uint8Array.
|
|
86
|
+
*
|
|
87
|
+
* returns null (JsValue::NULL) if the stream has been closed cleanly
|
|
88
|
+
* by the remote peer (EOF on the length prefix read).
|
|
89
|
+
* @returns {Promise<any>}
|
|
90
|
+
*/
|
|
91
|
+
read_message() {
|
|
92
|
+
const ret = wasm.bistream_read_message(this.__wbg_ptr);
|
|
93
|
+
return ret;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* read all remaining bytes from the recv stream (no length prefix).
|
|
97
|
+
*
|
|
98
|
+
* reads until the remote peer finishes the stream or `max_size` bytes
|
|
99
|
+
* are read. this matches grimoire's `read_to_end()` framing where
|
|
100
|
+
* the message is terminated by the sender calling `finish()`.
|
|
101
|
+
* @param {number} max_size
|
|
102
|
+
* @returns {Promise<any>}
|
|
103
|
+
*/
|
|
104
|
+
read_to_end(max_size) {
|
|
105
|
+
const ret = wasm.bistream_read_to_end(this.__wbg_ptr, max_size);
|
|
106
|
+
return ret;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* write a newline-delimited utf-8 line.
|
|
110
|
+
*
|
|
111
|
+
* appends `\n` if not already present, then writes. used for the ndjson
|
|
112
|
+
* framing the `freqhole-events/1` protocol speaks.
|
|
113
|
+
* @param {string} line
|
|
114
|
+
* @returns {Promise<void>}
|
|
115
|
+
*/
|
|
116
|
+
write_line(line) {
|
|
117
|
+
const ptr0 = passStringToWasm0(line, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
118
|
+
const len0 = WASM_VECTOR_LEN;
|
|
119
|
+
const ret = wasm.bistream_write_line(this.__wbg_ptr, ptr0, len0);
|
|
120
|
+
return ret;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* write a length-delimited message.
|
|
124
|
+
*
|
|
125
|
+
* writes a 4-byte big-endian u32 length prefix followed by the payload.
|
|
126
|
+
* this matches the `LengthDelimitedCodec` framing used by the
|
|
127
|
+
* iroh-automerge-repo example.
|
|
128
|
+
* @param {Uint8Array} data
|
|
129
|
+
* @returns {Promise<void>}
|
|
130
|
+
*/
|
|
131
|
+
write_message(data) {
|
|
132
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
133
|
+
const len0 = WASM_VECTOR_LEN;
|
|
134
|
+
const ret = wasm.bistream_write_message(this.__wbg_ptr, ptr0, len0);
|
|
135
|
+
return ret;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* write raw bytes without a length prefix, then finish the send stream.
|
|
139
|
+
*
|
|
140
|
+
* this matches grimoire's `send_response()` framing where the message
|
|
141
|
+
* is terminated by calling `finish()` on the send stream. the receiver
|
|
142
|
+
* uses `read_to_end()` to read all bytes.
|
|
143
|
+
*
|
|
144
|
+
* after `finish()` we await `stopped()` so the peer's ack is observed
|
|
145
|
+
* before this method returns. without this, JS callers that drop /
|
|
146
|
+
* `close()` the stream immediately after `write_raw_and_finish` can
|
|
147
|
+
* race the QUIC flush -- the peer's `read_to_end` then errors with
|
|
148
|
+
* "connection lost" mid-payload because the in-flight frames are
|
|
149
|
+
* torn down with the connection. matters most for large payloads
|
|
150
|
+
* (e.g. base64-encoded blob bodies in `proxy_response`).
|
|
151
|
+
* @param {Uint8Array} data
|
|
152
|
+
* @returns {Promise<void>}
|
|
153
|
+
*/
|
|
154
|
+
write_raw_and_finish(data) {
|
|
155
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
156
|
+
const len0 = WASM_VECTOR_LEN;
|
|
157
|
+
const ret = wasm.bistream_write_raw_and_finish(this.__wbg_ptr, ptr0, len0);
|
|
158
|
+
return ret;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (Symbol.dispose) BiStream.prototype[Symbol.dispose] = BiStream.prototype.free;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* result from fetching the server hello image from a peer
|
|
165
|
+
*/
|
|
166
|
+
export class HelloImageResult {
|
|
167
|
+
static __wrap(ptr) {
|
|
168
|
+
ptr = ptr >>> 0;
|
|
169
|
+
const obj = Object.create(HelloImageResult.prototype);
|
|
170
|
+
obj.__wbg_ptr = ptr;
|
|
171
|
+
HelloImageResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
172
|
+
return obj;
|
|
173
|
+
}
|
|
174
|
+
__destroy_into_raw() {
|
|
175
|
+
const ptr = this.__wbg_ptr;
|
|
176
|
+
this.__wbg_ptr = 0;
|
|
177
|
+
HelloImageResultFinalization.unregister(this);
|
|
178
|
+
return ptr;
|
|
179
|
+
}
|
|
180
|
+
free() {
|
|
181
|
+
const ptr = this.__destroy_into_raw();
|
|
182
|
+
wasm.__wbg_helloimageresult_free(ptr, 0);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* @returns {string | undefined}
|
|
186
|
+
*/
|
|
187
|
+
get content_type() {
|
|
188
|
+
const ret = wasm.helloimageresult_content_type(this.__wbg_ptr);
|
|
189
|
+
let v1;
|
|
190
|
+
if (ret[0] !== 0) {
|
|
191
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
192
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
193
|
+
}
|
|
194
|
+
return v1;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* @returns {Uint8Array}
|
|
198
|
+
*/
|
|
199
|
+
get data() {
|
|
200
|
+
const ret = wasm.helloimageresult_data(this.__wbg_ptr);
|
|
201
|
+
return ret;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (Symbol.dispose) HelloImageResult.prototype[Symbol.dispose] = HelloImageResult.prototype.free;
|
|
205
|
+
|
|
206
|
+
export class IntoUnderlyingByteSource {
|
|
207
|
+
__destroy_into_raw() {
|
|
208
|
+
const ptr = this.__wbg_ptr;
|
|
209
|
+
this.__wbg_ptr = 0;
|
|
210
|
+
IntoUnderlyingByteSourceFinalization.unregister(this);
|
|
211
|
+
return ptr;
|
|
212
|
+
}
|
|
213
|
+
free() {
|
|
214
|
+
const ptr = this.__destroy_into_raw();
|
|
215
|
+
wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* @returns {number}
|
|
219
|
+
*/
|
|
220
|
+
get autoAllocateChunkSize() {
|
|
221
|
+
const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
|
|
222
|
+
return ret >>> 0;
|
|
223
|
+
}
|
|
224
|
+
cancel() {
|
|
225
|
+
const ptr = this.__destroy_into_raw();
|
|
226
|
+
wasm.intounderlyingbytesource_cancel(ptr);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* @param {ReadableByteStreamController} controller
|
|
230
|
+
* @returns {Promise<any>}
|
|
231
|
+
*/
|
|
232
|
+
pull(controller) {
|
|
233
|
+
const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
|
|
234
|
+
return ret;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* @param {ReadableByteStreamController} controller
|
|
238
|
+
*/
|
|
239
|
+
start(controller) {
|
|
240
|
+
wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* @returns {ReadableStreamType}
|
|
244
|
+
*/
|
|
245
|
+
get type() {
|
|
246
|
+
const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
|
|
247
|
+
return __wbindgen_enum_ReadableStreamType[ret];
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
251
|
+
|
|
252
|
+
export class IntoUnderlyingSink {
|
|
253
|
+
__destroy_into_raw() {
|
|
254
|
+
const ptr = this.__wbg_ptr;
|
|
255
|
+
this.__wbg_ptr = 0;
|
|
256
|
+
IntoUnderlyingSinkFinalization.unregister(this);
|
|
257
|
+
return ptr;
|
|
258
|
+
}
|
|
259
|
+
free() {
|
|
260
|
+
const ptr = this.__destroy_into_raw();
|
|
261
|
+
wasm.__wbg_intounderlyingsink_free(ptr, 0);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* @param {any} reason
|
|
265
|
+
* @returns {Promise<any>}
|
|
266
|
+
*/
|
|
267
|
+
abort(reason) {
|
|
268
|
+
const ptr = this.__destroy_into_raw();
|
|
269
|
+
const ret = wasm.intounderlyingsink_abort(ptr, reason);
|
|
270
|
+
return ret;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* @returns {Promise<any>}
|
|
274
|
+
*/
|
|
275
|
+
close() {
|
|
276
|
+
const ptr = this.__destroy_into_raw();
|
|
277
|
+
const ret = wasm.intounderlyingsink_close(ptr);
|
|
278
|
+
return ret;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* @param {any} chunk
|
|
282
|
+
* @returns {Promise<any>}
|
|
283
|
+
*/
|
|
284
|
+
write(chunk) {
|
|
285
|
+
const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
|
|
286
|
+
return ret;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
290
|
+
|
|
291
|
+
export class IntoUnderlyingSource {
|
|
292
|
+
__destroy_into_raw() {
|
|
293
|
+
const ptr = this.__wbg_ptr;
|
|
294
|
+
this.__wbg_ptr = 0;
|
|
295
|
+
IntoUnderlyingSourceFinalization.unregister(this);
|
|
296
|
+
return ptr;
|
|
297
|
+
}
|
|
298
|
+
free() {
|
|
299
|
+
const ptr = this.__destroy_into_raw();
|
|
300
|
+
wasm.__wbg_intounderlyingsource_free(ptr, 0);
|
|
301
|
+
}
|
|
302
|
+
cancel() {
|
|
303
|
+
const ptr = this.__destroy_into_raw();
|
|
304
|
+
wasm.intounderlyingsource_cancel(ptr);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* @param {ReadableStreamDefaultController} controller
|
|
308
|
+
* @returns {Promise<any>}
|
|
309
|
+
*/
|
|
310
|
+
pull(controller) {
|
|
311
|
+
const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
|
|
312
|
+
return ret;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* browser P2P node for freqhole federation
|
|
319
|
+
*
|
|
320
|
+
* supports two protocols:
|
|
321
|
+
* - freqhole/1: API proxying and small blob streaming
|
|
322
|
+
* - iroh-blobs: verified streaming for audio files
|
|
323
|
+
*/
|
|
324
|
+
export class MiddenNode {
|
|
325
|
+
static __wrap(ptr) {
|
|
326
|
+
ptr = ptr >>> 0;
|
|
327
|
+
const obj = Object.create(MiddenNode.prototype);
|
|
328
|
+
obj.__wbg_ptr = ptr;
|
|
329
|
+
MiddenNodeFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
330
|
+
return obj;
|
|
331
|
+
}
|
|
332
|
+
__destroy_into_raw() {
|
|
333
|
+
const ptr = this.__wbg_ptr;
|
|
334
|
+
this.__wbg_ptr = 0;
|
|
335
|
+
MiddenNodeFinalization.unregister(this);
|
|
336
|
+
return ptr;
|
|
337
|
+
}
|
|
338
|
+
free() {
|
|
339
|
+
const ptr = this.__destroy_into_raw();
|
|
340
|
+
wasm.__wbg_middennode_free(ptr, 0);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* accept the next incoming connection and bidirectional stream.
|
|
344
|
+
*
|
|
345
|
+
* blocks until an incoming connection arrives on any registered ALPN.
|
|
346
|
+
* returns a BiStream with the peer's node ID and the negotiated ALPN.
|
|
347
|
+
*
|
|
348
|
+
* returns null (JsValue::NULL) if the endpoint has been closed.
|
|
349
|
+
*
|
|
350
|
+
* the caller should check `stream.alpn()` to route the connection
|
|
351
|
+
* to the appropriate handler.
|
|
352
|
+
* @returns {Promise<any>}
|
|
353
|
+
*/
|
|
354
|
+
accept() {
|
|
355
|
+
const ret = wasm.middennode_accept(this.__wbg_ptr);
|
|
356
|
+
return ret;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* return the number of blobs currently held in the store via active TempTags.
|
|
360
|
+
* @returns {number}
|
|
361
|
+
*/
|
|
362
|
+
active_blob_count() {
|
|
363
|
+
const ret = wasm.middennode_active_blob_count(this.__wbg_ptr);
|
|
364
|
+
return ret >>> 0;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* compute blake3 hash for a blob on demand
|
|
368
|
+
*
|
|
369
|
+
* use this when the client doesn't have the blake3 hash yet (not in API response).
|
|
370
|
+
* the server will compute the hash, save it to the database, and add the file
|
|
371
|
+
* to FsStore for verified streaming.
|
|
372
|
+
*
|
|
373
|
+
* returns the blake3 hash (64 hex chars) if successful, null if blob not found.
|
|
374
|
+
* @param {string} peer_addr
|
|
375
|
+
* @param {string} blob_id
|
|
376
|
+
* @returns {Promise<string | undefined>}
|
|
377
|
+
*/
|
|
378
|
+
compute_blake3(peer_addr, blob_id) {
|
|
379
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
380
|
+
const len0 = WASM_VECTOR_LEN;
|
|
381
|
+
const ptr1 = passStringToWasm0(blob_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
382
|
+
const len1 = WASM_VECTOR_LEN;
|
|
383
|
+
const ret = wasm.middennode_compute_blake3(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
384
|
+
return ret;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* create a new node with random identity
|
|
388
|
+
* waits for relay connection before returning
|
|
389
|
+
* @returns {Promise<MiddenNode>}
|
|
390
|
+
*/
|
|
391
|
+
static create() {
|
|
392
|
+
const ret = wasm.middennode_create();
|
|
393
|
+
return ret;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* create a node from existing secret key bytes (for persistence)
|
|
397
|
+
* key_bytes must be exactly 32 bytes
|
|
398
|
+
* @param {Uint8Array} key_bytes
|
|
399
|
+
* @returns {Promise<MiddenNode>}
|
|
400
|
+
*/
|
|
401
|
+
static create_from_key(key_bytes) {
|
|
402
|
+
const ptr0 = passArray8ToWasm0(key_bytes, wasm.__wbindgen_malloc);
|
|
403
|
+
const len0 = WASM_VECTOR_LEN;
|
|
404
|
+
const ret = wasm.middennode_create_from_key(ptr0, len0);
|
|
405
|
+
return ret;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* create a node from existing secret key with additional ALPN protocols.
|
|
409
|
+
*
|
|
410
|
+
* `extra_alpns` is a JS array of strings (e.g. ["iroh/automerge-repo/1"]).
|
|
411
|
+
* the node always registers "freqhole/1" plus whatever extra ALPNs are given.
|
|
412
|
+
* @param {Uint8Array} key_bytes
|
|
413
|
+
* @param {Array<any>} extra_alpns
|
|
414
|
+
* @returns {Promise<MiddenNode>}
|
|
415
|
+
*/
|
|
416
|
+
static create_with_alpns(key_bytes, extra_alpns) {
|
|
417
|
+
const ptr0 = passArray8ToWasm0(key_bytes, wasm.__wbindgen_malloc);
|
|
418
|
+
const len0 = WASM_VECTOR_LEN;
|
|
419
|
+
const ret = wasm.middennode_create_with_alpns(ptr0, len0, extra_alpns);
|
|
420
|
+
return ret;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* download a blob using iroh-blobs verified streaming
|
|
424
|
+
*
|
|
425
|
+
* this is the preferred method for audio files - provides:
|
|
426
|
+
* - verified streaming (each chunk is cryptographically verified)
|
|
427
|
+
* - resume support (can restart interrupted transfers)
|
|
428
|
+
* - efficient parallel chunk fetching
|
|
429
|
+
*
|
|
430
|
+
* peer_addr: plain node_id or full endpoint JSON
|
|
431
|
+
* blake3_hash: the blake3 hash of the blob (64 hex chars)
|
|
432
|
+
* @param {string} peer_addr
|
|
433
|
+
* @param {string} blake3_hash
|
|
434
|
+
* @returns {Promise<Uint8Array>}
|
|
435
|
+
*/
|
|
436
|
+
download_verified(peer_addr, blake3_hash) {
|
|
437
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
438
|
+
const len0 = WASM_VECTOR_LEN;
|
|
439
|
+
const ptr1 = passStringToWasm0(blake3_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
440
|
+
const len1 = WASM_VECTOR_LEN;
|
|
441
|
+
const ret = wasm.middennode_download_verified(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
442
|
+
return ret;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* download a blob by blob_id using verified streaming with on-demand blake3
|
|
446
|
+
*
|
|
447
|
+
* use this when the client doesn't have the blake3 hash yet (not in API response).
|
|
448
|
+
* computes blake3 on the server, then uses iroh-blobs verified streaming.
|
|
449
|
+
*
|
|
450
|
+
* returns (blob_data, blake3_hash) for caching the hash for future requests.
|
|
451
|
+
* @param {string} peer_addr
|
|
452
|
+
* @param {string} blob_id
|
|
453
|
+
* @returns {Promise<Array<any>>}
|
|
454
|
+
*/
|
|
455
|
+
download_verified_by_id(peer_addr, blob_id) {
|
|
456
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
457
|
+
const len0 = WASM_VECTOR_LEN;
|
|
458
|
+
const ptr1 = passStringToWasm0(blob_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
459
|
+
const len1 = WASM_VECTOR_LEN;
|
|
460
|
+
const ret = wasm.middennode_download_verified_by_id(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
461
|
+
return ret;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* download a verified blob and stream chunks to JS via callback
|
|
465
|
+
*
|
|
466
|
+
* this is the preferred path for large blobs (audio files). instead of
|
|
467
|
+
* materializing the full blob in wasm linear memory (which fails around
|
|
468
|
+
* 32MB+ due to allocator pressure on a single contiguous Bytes), this:
|
|
469
|
+
*
|
|
470
|
+
* 1. downloads the blob into MemStore using the verified iroh-blobs path
|
|
471
|
+
* 2. opens a streaming reader and pulls chunks
|
|
472
|
+
* 3. delivers each chunk to the JS callback as a Uint8Array
|
|
473
|
+
*
|
|
474
|
+
* JS side accumulates chunks (e.g. into a Blob via array of BlobParts) and
|
|
475
|
+
* can release each chunk as it goes. wasm peak memory stays bounded by
|
|
476
|
+
* chunk_size + the original MemStore copy.
|
|
477
|
+
*
|
|
478
|
+
* callback signature: `on_chunk(chunk: Uint8Array, offset: u64) -> void`
|
|
479
|
+
* progress callback: `on_progress(fraction: f64) -> void`
|
|
480
|
+
*
|
|
481
|
+
* returns total bytes streamed.
|
|
482
|
+
* @param {string} peer_addr
|
|
483
|
+
* @param {string} blake3_hash
|
|
484
|
+
* @param {number} total_size
|
|
485
|
+
* @param {Function} on_chunk
|
|
486
|
+
* @param {Function} on_progress
|
|
487
|
+
* @returns {Promise<number>}
|
|
488
|
+
*/
|
|
489
|
+
download_verified_streaming(peer_addr, blake3_hash, total_size, on_chunk, on_progress) {
|
|
490
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
491
|
+
const len0 = WASM_VECTOR_LEN;
|
|
492
|
+
const ptr1 = passStringToWasm0(blake3_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
493
|
+
const len1 = WASM_VECTOR_LEN;
|
|
494
|
+
const ret = wasm.middennode_download_verified_streaming(this.__wbg_ptr, ptr0, len0, ptr1, len1, total_size, on_chunk, on_progress);
|
|
495
|
+
return ret;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* streaming download with auto ensure+retry. first attempts the streaming
|
|
499
|
+
* download; if the verified download fails (blob not in peer's store), calls
|
|
500
|
+
* ensure_blob to load it, then retries.
|
|
501
|
+
* @param {string} peer_addr
|
|
502
|
+
* @param {string} blake3_hash
|
|
503
|
+
* @param {number} total_size
|
|
504
|
+
* @param {Function} on_chunk
|
|
505
|
+
* @param {Function} on_progress
|
|
506
|
+
* @returns {Promise<number>}
|
|
507
|
+
*/
|
|
508
|
+
download_verified_streaming_with_ensure(peer_addr, blake3_hash, total_size, on_chunk, on_progress) {
|
|
509
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
510
|
+
const len0 = WASM_VECTOR_LEN;
|
|
511
|
+
const ptr1 = passStringToWasm0(blake3_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
512
|
+
const len1 = WASM_VECTOR_LEN;
|
|
513
|
+
const ret = wasm.middennode_download_verified_streaming_with_ensure(this.__wbg_ptr, ptr0, len0, ptr1, len1, total_size, on_chunk, on_progress);
|
|
514
|
+
return ret;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* download a blob using iroh-blobs with automatic ensure + retry
|
|
518
|
+
*
|
|
519
|
+
* tries download_verified first. if blob not in peer's FsStore,
|
|
520
|
+
* calls ensure_blob to load it, then retries.
|
|
521
|
+
* @param {string} peer_addr
|
|
522
|
+
* @param {string} blake3_hash
|
|
523
|
+
* @returns {Promise<Uint8Array>}
|
|
524
|
+
*/
|
|
525
|
+
download_verified_with_ensure(peer_addr, blake3_hash) {
|
|
526
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
527
|
+
const len0 = WASM_VECTOR_LEN;
|
|
528
|
+
const ptr1 = passStringToWasm0(blake3_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
529
|
+
const len1 = WASM_VECTOR_LEN;
|
|
530
|
+
const ret = wasm.middennode_download_verified_with_ensure(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
531
|
+
return ret;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* ensure a blob is loaded into the peer's FsStore by blake3 hash
|
|
535
|
+
*
|
|
536
|
+
* call this before retrying download_verified if the first attempt fails.
|
|
537
|
+
* the server will look up the file by blake3 hash and add it to FsStore.
|
|
538
|
+
*
|
|
539
|
+
* returns true if blob is now available, false if not found.
|
|
540
|
+
* @param {string} peer_addr
|
|
541
|
+
* @param {string} blake3_hash
|
|
542
|
+
* @returns {Promise<boolean>}
|
|
543
|
+
*/
|
|
544
|
+
ensure_blob(peer_addr, blake3_hash) {
|
|
545
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
546
|
+
const len0 = WASM_VECTOR_LEN;
|
|
547
|
+
const ptr1 = passStringToWasm0(blake3_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
548
|
+
const len1 = WASM_VECTOR_LEN;
|
|
549
|
+
const ret = wasm.middennode_ensure_blob(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
550
|
+
return ret;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* fetch server image from a peer (public, no auth required)
|
|
554
|
+
* used during "add remote" flow before user is authenticated
|
|
555
|
+
* peer_addr can be plain node_id or full endpoint JSON with relay/IP hints
|
|
556
|
+
* @param {string} peer_addr
|
|
557
|
+
* @returns {Promise<HelloImageResult>}
|
|
558
|
+
*/
|
|
559
|
+
fetch_hello_image(peer_addr) {
|
|
560
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
561
|
+
const len0 = WASM_VECTOR_LEN;
|
|
562
|
+
const ret = wasm.middennode_fetch_hello_image(this.__wbg_ptr, ptr0, len0);
|
|
563
|
+
return ret;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* check whether a blob with the given blake3 hash is currently held in the MemStore
|
|
567
|
+
* via an active TempTag. avoids expensive OPFS read + bao recomputation when the
|
|
568
|
+
* blob is already loaded.
|
|
569
|
+
* @param {string} blake3_hash
|
|
570
|
+
* @returns {boolean}
|
|
571
|
+
*/
|
|
572
|
+
has_active_blob(blake3_hash) {
|
|
573
|
+
const ptr0 = passStringToWasm0(blake3_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
574
|
+
const len0 = WASM_VECTOR_LEN;
|
|
575
|
+
const ret = wasm.middennode_has_active_blob(this.__wbg_ptr, ptr0, len0);
|
|
576
|
+
return ret !== 0;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* import a blob from its pre-computed bao-encoded bytes, skipping the
|
|
580
|
+
* expensive bao tree computation. `blake3_hash` is the 64-char hex hash,
|
|
581
|
+
* `bao_data` is the bao-encoded bytes previously returned by
|
|
582
|
+
* `import_blob_and_export_bao`.
|
|
583
|
+
*
|
|
584
|
+
* uses `import_bao_bytes` (iroh-blobs internal API) to feed the pre-computed
|
|
585
|
+
* bao stream directly into the store, then creates a global TempTag via
|
|
586
|
+
* `Tags::temp_tag` to prevent GC.
|
|
587
|
+
* @param {string} blake3_hash
|
|
588
|
+
* @param {Uint8Array} bao_data
|
|
589
|
+
* @returns {Promise<string>}
|
|
590
|
+
*/
|
|
591
|
+
import_bao(blake3_hash, bao_data) {
|
|
592
|
+
const ptr0 = passStringToWasm0(blake3_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
593
|
+
const len0 = WASM_VECTOR_LEN;
|
|
594
|
+
const ptr1 = passArray8ToWasm0(bao_data, wasm.__wbindgen_malloc);
|
|
595
|
+
const len1 = WASM_VECTOR_LEN;
|
|
596
|
+
const ret = wasm.middennode_import_bao(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
597
|
+
return ret;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* import raw bytes into the iroh-blobs store, returning the blake3 hash.
|
|
601
|
+
* this makes the blob available for verified download by peers.
|
|
602
|
+
* the blob stays in the store as long as its TempTag is held in active_tags.
|
|
603
|
+
* call release_blob() to allow GC, or it will be evicted when the map exceeds 3 entries.
|
|
604
|
+
* @param {Uint8Array} data
|
|
605
|
+
* @returns {Promise<string>}
|
|
606
|
+
*/
|
|
607
|
+
import_blob(data) {
|
|
608
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
609
|
+
const len0 = WASM_VECTOR_LEN;
|
|
610
|
+
const ret = wasm.middennode_import_blob(this.__wbg_ptr, ptr0, len0);
|
|
611
|
+
return ret;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* import raw bytes into the iroh-blobs store, returning both the blake3 hash
|
|
615
|
+
* AND the bao-encoded bytes. the bao bytes can be cached in OPFS and later
|
|
616
|
+
* fed to `import_bao` to skip the expensive bao tree recomputation on re-import.
|
|
617
|
+
*
|
|
618
|
+
* returns a JS object: `{ hash: string, bao: Uint8Array }`
|
|
619
|
+
* @param {Uint8Array} data
|
|
620
|
+
* @returns {Promise<any>}
|
|
621
|
+
*/
|
|
622
|
+
import_blob_and_export_bao(data) {
|
|
623
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
624
|
+
const len0 = WASM_VECTOR_LEN;
|
|
625
|
+
const ret = wasm.middennode_import_blob_and_export_bao(this.__wbg_ptr, ptr0, len0);
|
|
626
|
+
return ret;
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* get our node_id (iroh public key)
|
|
630
|
+
* @returns {string}
|
|
631
|
+
*/
|
|
632
|
+
node_id() {
|
|
633
|
+
let deferred1_0;
|
|
634
|
+
let deferred1_1;
|
|
635
|
+
try {
|
|
636
|
+
const ret = wasm.middennode_node_id(this.__wbg_ptr);
|
|
637
|
+
deferred1_0 = ret[0];
|
|
638
|
+
deferred1_1 = ret[1];
|
|
639
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
640
|
+
} finally {
|
|
641
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* open a bidirectional stream to a peer on a specific ALPN.
|
|
646
|
+
*
|
|
647
|
+
* `peer_addr` can be a plain node_id hex string or a full endpoint
|
|
648
|
+
* address JSON (same format as proxy_request). `alpn` is the protocol
|
|
649
|
+
* to negotiate (e.g. "iroh/automerge-repo/1").
|
|
650
|
+
*
|
|
651
|
+
* returns a BiStream for length-delimited message exchange.
|
|
652
|
+
* @param {string} peer_addr
|
|
653
|
+
* @param {string} alpn
|
|
654
|
+
* @returns {Promise<BiStream>}
|
|
655
|
+
*/
|
|
656
|
+
open_bi(peer_addr, alpn) {
|
|
657
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
658
|
+
const len0 = WASM_VECTOR_LEN;
|
|
659
|
+
const ptr1 = passStringToWasm0(alpn, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
660
|
+
const len1 = WASM_VECTOR_LEN;
|
|
661
|
+
const ret = wasm.middennode_open_bi(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
662
|
+
return ret;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* dispatch a typed admin command to a peer over the freqhole-admin/1 ALPN.
|
|
666
|
+
*
|
|
667
|
+
* `args` is a JSON string (the literal `"null"` is accepted for no-payload
|
|
668
|
+
* commands). returns a JS object envelope `{ success, message, data, errors }`
|
|
669
|
+
* matching the wire format. validation of `data` against the per-command
|
|
670
|
+
* schema happens in the spume `AdminClient`.
|
|
671
|
+
* @param {string} peer_addr
|
|
672
|
+
* @param {string} command
|
|
673
|
+
* @param {string} args
|
|
674
|
+
* @returns {Promise<any>}
|
|
675
|
+
*/
|
|
676
|
+
proxy_admin(peer_addr, command, args) {
|
|
677
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
678
|
+
const len0 = WASM_VECTOR_LEN;
|
|
679
|
+
const ptr1 = passStringToWasm0(command, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
680
|
+
const len1 = WASM_VECTOR_LEN;
|
|
681
|
+
const ptr2 = passStringToWasm0(args, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
682
|
+
const len2 = WASM_VECTOR_LEN;
|
|
683
|
+
const ret = wasm.middennode_proxy_admin(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
684
|
+
return ret;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* send an API request to a peer
|
|
688
|
+
* peer_addr can be plain node_id or full endpoint JSON with relay/IP hints
|
|
689
|
+
* @param {string} peer_addr
|
|
690
|
+
* @param {string} method
|
|
691
|
+
* @param {string} path
|
|
692
|
+
* @param {string | null} [body]
|
|
693
|
+
* @returns {Promise<any>}
|
|
694
|
+
*/
|
|
695
|
+
proxy_request(peer_addr, method, path, body) {
|
|
696
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
697
|
+
const len0 = WASM_VECTOR_LEN;
|
|
698
|
+
const ptr1 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
699
|
+
const len1 = WASM_VECTOR_LEN;
|
|
700
|
+
const ptr2 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
701
|
+
const len2 = WASM_VECTOR_LEN;
|
|
702
|
+
var ptr3 = isLikeNone(body) ? 0 : passStringToWasm0(body, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
703
|
+
var len3 = WASM_VECTOR_LEN;
|
|
704
|
+
const ret = wasm.middennode_proxy_request(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
705
|
+
return ret;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* release a blob's TempTag, allowing the store to garbage-collect it.
|
|
709
|
+
* blake3_hash should be the 64-char hex string returned by import_blob.
|
|
710
|
+
* @param {string} blake3_hash
|
|
711
|
+
*/
|
|
712
|
+
release_blob(blake3_hash) {
|
|
713
|
+
const ptr0 = passStringToWasm0(blake3_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
714
|
+
const len0 = WASM_VECTOR_LEN;
|
|
715
|
+
const ret = wasm.middennode_release_blob(this.__wbg_ptr, ptr0, len0);
|
|
716
|
+
if (ret[1]) {
|
|
717
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* get the secret key bytes for persistence (32 bytes)
|
|
722
|
+
* store this in IndexedDB to maintain the same identity across sessions
|
|
723
|
+
* @returns {Uint8Array}
|
|
724
|
+
*/
|
|
725
|
+
secret_key() {
|
|
726
|
+
const ret = wasm.middennode_secret_key(this.__wbg_ptr);
|
|
727
|
+
return ret;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* start a background accept loop that handles incoming iroh-blobs connections.
|
|
731
|
+
*
|
|
732
|
+
* call this once after creating the node to allow remote peers to pull blobs
|
|
733
|
+
* from this node (e.g., for P2P music upload where the server pulls from browser).
|
|
734
|
+
*
|
|
735
|
+
* only handles iroh-blobs connections — other ALPNs are ignored (dropped).
|
|
736
|
+
* safe to call multiple times (subsequent calls are no-ops).
|
|
737
|
+
*
|
|
738
|
+
* WARNING: if you also call `accept()` from JS, both loops will compete for
|
|
739
|
+
* incoming connections and each will only see a subset. use one or the other,
|
|
740
|
+
* not both. freqhole uses `start_blob_server()`, skein uses `accept()`.
|
|
741
|
+
*
|
|
742
|
+
* NOTE: no application-level peer auth is applied here. iroh-blobs transfers
|
|
743
|
+
* are content-addressed (blake3 verified), so a peer can only download blobs
|
|
744
|
+
* they already know the hash of. peer filtering can be added later if needed.
|
|
745
|
+
*/
|
|
746
|
+
start_blob_server() {
|
|
747
|
+
wasm.middennode_start_blob_server(this.__wbg_ptr);
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* connect to a freqhole radio broadcaster.
|
|
751
|
+
*
|
|
752
|
+
* callbacks (all called from JS land):
|
|
753
|
+
* - `on_hello(json: string)` — fires once when the server's Hello
|
|
754
|
+
* message arrives. payload is the JSON-encoded `HelloMessage`.
|
|
755
|
+
* - `on_meta(json: string)` — fires on each track change with the
|
|
756
|
+
* JSON-encoded `MetaMessage`.
|
|
757
|
+
* - `on_chunk(seq: number, is_init: boolean, bytes: Uint8Array)` —
|
|
758
|
+
* fires per audio chunk. `is_init = true` marks the start of a new
|
|
759
|
+
* track; the JS side should append it to the same SourceBuffer.
|
|
760
|
+
*
|
|
761
|
+
* returns a [`RadioHandle`] — keep a reference to it; dropping it stops
|
|
762
|
+
* playback and closes the iroh connection.
|
|
763
|
+
* @param {string} peer_addr
|
|
764
|
+
* @param {string | null | undefined} station_id
|
|
765
|
+
* @param {Function} on_hello
|
|
766
|
+
* @param {Function} on_meta
|
|
767
|
+
* @param {Function} on_chunk
|
|
768
|
+
* @returns {Promise<RadioHandle>}
|
|
769
|
+
*/
|
|
770
|
+
tune_radio(peer_addr, station_id, on_hello, on_meta, on_chunk) {
|
|
771
|
+
const ptr0 = passStringToWasm0(peer_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
772
|
+
const len0 = WASM_VECTOR_LEN;
|
|
773
|
+
var ptr1 = isLikeNone(station_id) ? 0 : passStringToWasm0(station_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
774
|
+
var len1 = WASM_VECTOR_LEN;
|
|
775
|
+
const ret = wasm.middennode_tune_radio(this.__wbg_ptr, ptr0, len0, ptr1, len1, on_hello, on_meta, on_chunk);
|
|
776
|
+
return ret;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
if (Symbol.dispose) MiddenNode.prototype[Symbol.dispose] = MiddenNode.prototype.free;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* handle returned to JS for a tuned-in radio session. dropping the handle
|
|
783
|
+
* (or calling `leave()`) closes the iroh connection, which tears down both
|
|
784
|
+
* read loops.
|
|
785
|
+
*/
|
|
786
|
+
export class RadioHandle {
|
|
787
|
+
static __wrap(ptr) {
|
|
788
|
+
ptr = ptr >>> 0;
|
|
789
|
+
const obj = Object.create(RadioHandle.prototype);
|
|
790
|
+
obj.__wbg_ptr = ptr;
|
|
791
|
+
RadioHandleFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
792
|
+
return obj;
|
|
793
|
+
}
|
|
794
|
+
__destroy_into_raw() {
|
|
795
|
+
const ptr = this.__wbg_ptr;
|
|
796
|
+
this.__wbg_ptr = 0;
|
|
797
|
+
RadioHandleFinalization.unregister(this);
|
|
798
|
+
return ptr;
|
|
799
|
+
}
|
|
800
|
+
free() {
|
|
801
|
+
const ptr = this.__destroy_into_raw();
|
|
802
|
+
wasm.__wbg_radiohandle_free(ptr, 0);
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* stop receiving audio + meta and close the connection.
|
|
806
|
+
*/
|
|
807
|
+
leave() {
|
|
808
|
+
wasm.radiohandle_leave(this.__wbg_ptr);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
if (Symbol.dispose) RadioHandle.prototype[Symbol.dispose] = RadioHandle.prototype.free;
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* compute the blake3 hash of the given bytes and return as a hex string.
|
|
815
|
+
* this runs entirely in the browser — no network call needed.
|
|
816
|
+
* @param {Uint8Array} data
|
|
817
|
+
* @returns {string}
|
|
818
|
+
*/
|
|
819
|
+
export function hash_blake3(data) {
|
|
820
|
+
let deferred2_0;
|
|
821
|
+
let deferred2_1;
|
|
822
|
+
try {
|
|
823
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
824
|
+
const len0 = WASM_VECTOR_LEN;
|
|
825
|
+
const ret = wasm.hash_blake3(ptr0, len0);
|
|
826
|
+
deferred2_0 = ret[0];
|
|
827
|
+
deferred2_1 = ret[1];
|
|
828
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
829
|
+
} finally {
|
|
830
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
export function start() {
|
|
835
|
+
wasm.start();
|
|
836
|
+
}
|
|
837
|
+
export function __wbg_Error_83742b46f01ce22d(arg0, arg1) {
|
|
838
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
839
|
+
return ret;
|
|
840
|
+
}
|
|
841
|
+
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
842
|
+
const ret = String(arg1);
|
|
843
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
844
|
+
const len1 = WASM_VECTOR_LEN;
|
|
845
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
846
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
847
|
+
}
|
|
848
|
+
export function __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1(arg0) {
|
|
849
|
+
const v = arg0;
|
|
850
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
851
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
852
|
+
}
|
|
853
|
+
export function __wbg___wbindgen_debug_string_5398f5bb970e0daa(arg0, arg1) {
|
|
854
|
+
const ret = debugString(arg1);
|
|
855
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
856
|
+
const len1 = WASM_VECTOR_LEN;
|
|
857
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
858
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
859
|
+
}
|
|
860
|
+
export function __wbg___wbindgen_is_function_3c846841762788c1(arg0) {
|
|
861
|
+
const ret = typeof(arg0) === 'function';
|
|
862
|
+
return ret;
|
|
863
|
+
}
|
|
864
|
+
export function __wbg___wbindgen_is_object_781bc9f159099513(arg0) {
|
|
865
|
+
const val = arg0;
|
|
866
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
867
|
+
return ret;
|
|
868
|
+
}
|
|
869
|
+
export function __wbg___wbindgen_is_string_7ef6b97b02428fae(arg0) {
|
|
870
|
+
const ret = typeof(arg0) === 'string';
|
|
871
|
+
return ret;
|
|
872
|
+
}
|
|
873
|
+
export function __wbg___wbindgen_is_undefined_52709e72fb9f179c(arg0) {
|
|
874
|
+
const ret = arg0 === undefined;
|
|
875
|
+
return ret;
|
|
876
|
+
}
|
|
877
|
+
export function __wbg___wbindgen_string_get_395e606bd0ee4427(arg0, arg1) {
|
|
878
|
+
const obj = arg1;
|
|
879
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
880
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
881
|
+
var len1 = WASM_VECTOR_LEN;
|
|
882
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
883
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
884
|
+
}
|
|
885
|
+
export function __wbg___wbindgen_throw_6ddd609b62940d55(arg0, arg1) {
|
|
886
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
887
|
+
}
|
|
888
|
+
export function __wbg__wbg_cb_unref_6b5b6b8576d35cb1(arg0) {
|
|
889
|
+
arg0._wbg_cb_unref();
|
|
890
|
+
}
|
|
891
|
+
export function __wbg_abort_5ef96933660780b7(arg0) {
|
|
892
|
+
arg0.abort();
|
|
893
|
+
}
|
|
894
|
+
export function __wbg_abort_6479c2d794ebf2ee(arg0, arg1) {
|
|
895
|
+
arg0.abort(arg1);
|
|
896
|
+
}
|
|
897
|
+
export function __wbg_addEventListener_3f4b57aea6662d2e() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
898
|
+
arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3);
|
|
899
|
+
}, arguments); }
|
|
900
|
+
export function __wbg_append_608dfb635ee8998f() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
901
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
902
|
+
}, arguments); }
|
|
903
|
+
export function __wbg_arrayBuffer_eb8e9ca620af2a19() { return handleError(function (arg0) {
|
|
904
|
+
const ret = arg0.arrayBuffer();
|
|
905
|
+
return ret;
|
|
906
|
+
}, arguments); }
|
|
907
|
+
export function __wbg_bistream_new(arg0) {
|
|
908
|
+
const ret = BiStream.__wrap(arg0);
|
|
909
|
+
return ret;
|
|
910
|
+
}
|
|
911
|
+
export function __wbg_body_ac1dad652946e6da(arg0) {
|
|
912
|
+
const ret = arg0.body;
|
|
913
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
914
|
+
}
|
|
915
|
+
export function __wbg_buffer_60b8043cd926067d(arg0) {
|
|
916
|
+
const ret = arg0.buffer;
|
|
917
|
+
return ret;
|
|
918
|
+
}
|
|
919
|
+
export function __wbg_byobRequest_6342e5f2b232c0f9(arg0) {
|
|
920
|
+
const ret = arg0.byobRequest;
|
|
921
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
922
|
+
}
|
|
923
|
+
export function __wbg_byteLength_607b856aa6c5a508(arg0) {
|
|
924
|
+
const ret = arg0.byteLength;
|
|
925
|
+
return ret;
|
|
926
|
+
}
|
|
927
|
+
export function __wbg_byteOffset_b26b63681c83856c(arg0) {
|
|
928
|
+
const ret = arg0.byteOffset;
|
|
929
|
+
return ret;
|
|
930
|
+
}
|
|
931
|
+
export function __wbg_call_2d781c1f4d5c0ef8() { return handleError(function (arg0, arg1, arg2) {
|
|
932
|
+
const ret = arg0.call(arg1, arg2);
|
|
933
|
+
return ret;
|
|
934
|
+
}, arguments); }
|
|
935
|
+
export function __wbg_call_dcc2662fa17a72cf() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
936
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
937
|
+
return ret;
|
|
938
|
+
}, arguments); }
|
|
939
|
+
export function __wbg_call_f858478a02f9600f() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
940
|
+
const ret = arg0.call(arg1, arg2, arg3, arg4);
|
|
941
|
+
return ret;
|
|
942
|
+
}, arguments); }
|
|
943
|
+
export function __wbg_cancel_79b3bea07a1028e7(arg0) {
|
|
944
|
+
const ret = arg0.cancel();
|
|
945
|
+
return ret;
|
|
946
|
+
}
|
|
947
|
+
export function __wbg_catch_d7ed0375ab6532a5(arg0, arg1) {
|
|
948
|
+
const ret = arg0.catch(arg1);
|
|
949
|
+
return ret;
|
|
950
|
+
}
|
|
951
|
+
export function __wbg_clearTimeout_2256f1e7b94ef517(arg0) {
|
|
952
|
+
const ret = clearTimeout(arg0);
|
|
953
|
+
return ret;
|
|
954
|
+
}
|
|
955
|
+
export function __wbg_clearTimeout_47a40e3be01ed7a3() { return handleError(function (arg0, arg1) {
|
|
956
|
+
arg0.clearTimeout(arg1);
|
|
957
|
+
}, arguments); }
|
|
958
|
+
export function __wbg_close_690d36108c557337() { return handleError(function (arg0) {
|
|
959
|
+
arg0.close();
|
|
960
|
+
}, arguments); }
|
|
961
|
+
export function __wbg_close_737b4b1fbc658540() { return handleError(function (arg0) {
|
|
962
|
+
arg0.close();
|
|
963
|
+
}, arguments); }
|
|
964
|
+
export function __wbg_close_af26905c832a88cb() { return handleError(function (arg0) {
|
|
965
|
+
arg0.close();
|
|
966
|
+
}, arguments); }
|
|
967
|
+
export function __wbg_code_aea376e2d265a64f(arg0) {
|
|
968
|
+
const ret = arg0.code;
|
|
969
|
+
return ret;
|
|
970
|
+
}
|
|
971
|
+
export function __wbg_code_bc4dde4d67926010(arg0) {
|
|
972
|
+
const ret = arg0.code;
|
|
973
|
+
return ret;
|
|
974
|
+
}
|
|
975
|
+
export function __wbg_crypto_38df2bab126b63dc(arg0) {
|
|
976
|
+
const ret = arg0.crypto;
|
|
977
|
+
return ret;
|
|
978
|
+
}
|
|
979
|
+
export function __wbg_data_a3d9ff9cdd801002(arg0) {
|
|
980
|
+
const ret = arg0.data;
|
|
981
|
+
return ret;
|
|
982
|
+
}
|
|
983
|
+
export function __wbg_debug_eaef3b49d572d680(arg0, arg1) {
|
|
984
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
985
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
986
|
+
console.debug(...v0);
|
|
987
|
+
}
|
|
988
|
+
export function __wbg_done_08ce71ee07e3bd17(arg0) {
|
|
989
|
+
const ret = arg0.done;
|
|
990
|
+
return ret;
|
|
991
|
+
}
|
|
992
|
+
export function __wbg_enqueue_ec3552838b4b7fbf() { return handleError(function (arg0, arg1) {
|
|
993
|
+
arg0.enqueue(arg1);
|
|
994
|
+
}, arguments); }
|
|
995
|
+
export function __wbg_entries_5b8fe91cea59610e(arg0) {
|
|
996
|
+
const ret = arg0.entries();
|
|
997
|
+
return ret;
|
|
998
|
+
}
|
|
999
|
+
export function __wbg_error_71b0e71161a5f3a0(arg0, arg1) {
|
|
1000
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
1001
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
1002
|
+
console.error(...v0);
|
|
1003
|
+
}
|
|
1004
|
+
export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
|
|
1005
|
+
let deferred0_0;
|
|
1006
|
+
let deferred0_1;
|
|
1007
|
+
try {
|
|
1008
|
+
deferred0_0 = arg0;
|
|
1009
|
+
deferred0_1 = arg1;
|
|
1010
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
1011
|
+
} finally {
|
|
1012
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
export function __wbg_fetch_43b2f110608a59ff(arg0) {
|
|
1016
|
+
const ret = fetch(arg0);
|
|
1017
|
+
return ret;
|
|
1018
|
+
}
|
|
1019
|
+
export function __wbg_fetch_5550a88cf343aaa9(arg0, arg1) {
|
|
1020
|
+
const ret = arg0.fetch(arg1);
|
|
1021
|
+
return ret;
|
|
1022
|
+
}
|
|
1023
|
+
export function __wbg_getRandomValues_76dfc69825c9c552() { return handleError(function (arg0, arg1) {
|
|
1024
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
1025
|
+
}, arguments); }
|
|
1026
|
+
export function __wbg_getRandomValues_c44a50d8cfdaebeb() { return handleError(function (arg0, arg1) {
|
|
1027
|
+
arg0.getRandomValues(arg1);
|
|
1028
|
+
}, arguments); }
|
|
1029
|
+
export function __wbg_getReader_9facd4f899beac89() { return handleError(function (arg0) {
|
|
1030
|
+
const ret = arg0.getReader();
|
|
1031
|
+
return ret;
|
|
1032
|
+
}, arguments); }
|
|
1033
|
+
export function __wbg_get_3ef1eba1850ade27() { return handleError(function (arg0, arg1) {
|
|
1034
|
+
const ret = Reflect.get(arg0, arg1);
|
|
1035
|
+
return ret;
|
|
1036
|
+
}, arguments); }
|
|
1037
|
+
export function __wbg_get_a8ee5c45dabc1b3b(arg0, arg1) {
|
|
1038
|
+
const ret = arg0[arg1 >>> 0];
|
|
1039
|
+
return ret;
|
|
1040
|
+
}
|
|
1041
|
+
export function __wbg_get_done_d0ab690f8df5501f(arg0) {
|
|
1042
|
+
const ret = arg0.done;
|
|
1043
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1044
|
+
}
|
|
1045
|
+
export function __wbg_get_value_548ae6adf5a174e4(arg0) {
|
|
1046
|
+
const ret = arg0.value;
|
|
1047
|
+
return ret;
|
|
1048
|
+
}
|
|
1049
|
+
export function __wbg_has_926ef2ff40b308cf() { return handleError(function (arg0, arg1) {
|
|
1050
|
+
const ret = Reflect.has(arg0, arg1);
|
|
1051
|
+
return ret;
|
|
1052
|
+
}, arguments); }
|
|
1053
|
+
export function __wbg_headers_eb2234545f9ff993(arg0) {
|
|
1054
|
+
const ret = arg0.headers;
|
|
1055
|
+
return ret;
|
|
1056
|
+
}
|
|
1057
|
+
export function __wbg_helloimageresult_new(arg0) {
|
|
1058
|
+
const ret = HelloImageResult.__wrap(arg0);
|
|
1059
|
+
return ret;
|
|
1060
|
+
}
|
|
1061
|
+
export function __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6(arg0) {
|
|
1062
|
+
let result;
|
|
1063
|
+
try {
|
|
1064
|
+
result = arg0 instanceof ArrayBuffer;
|
|
1065
|
+
} catch (_) {
|
|
1066
|
+
result = false;
|
|
1067
|
+
}
|
|
1068
|
+
const ret = result;
|
|
1069
|
+
return ret;
|
|
1070
|
+
}
|
|
1071
|
+
export function __wbg_instanceof_Blob_c91af000f11c2d0b(arg0) {
|
|
1072
|
+
let result;
|
|
1073
|
+
try {
|
|
1074
|
+
result = arg0 instanceof Blob;
|
|
1075
|
+
} catch (_) {
|
|
1076
|
+
result = false;
|
|
1077
|
+
}
|
|
1078
|
+
const ret = result;
|
|
1079
|
+
return ret;
|
|
1080
|
+
}
|
|
1081
|
+
export function __wbg_instanceof_Response_9b4d9fd451e051b1(arg0) {
|
|
1082
|
+
let result;
|
|
1083
|
+
try {
|
|
1084
|
+
result = arg0 instanceof Response;
|
|
1085
|
+
} catch (_) {
|
|
1086
|
+
result = false;
|
|
1087
|
+
}
|
|
1088
|
+
const ret = result;
|
|
1089
|
+
return ret;
|
|
1090
|
+
}
|
|
1091
|
+
export function __wbg_isArray_33b91feb269ff46e(arg0) {
|
|
1092
|
+
const ret = Array.isArray(arg0);
|
|
1093
|
+
return ret;
|
|
1094
|
+
}
|
|
1095
|
+
export function __wbg_length_b3416cf66a5452c8(arg0) {
|
|
1096
|
+
const ret = arg0.length;
|
|
1097
|
+
return ret;
|
|
1098
|
+
}
|
|
1099
|
+
export function __wbg_length_ea16607d7b61445b(arg0) {
|
|
1100
|
+
const ret = arg0.length;
|
|
1101
|
+
return ret;
|
|
1102
|
+
}
|
|
1103
|
+
export function __wbg_log_7a0760e115750083(arg0, arg1) {
|
|
1104
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
1105
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
1106
|
+
console.log(...v0);
|
|
1107
|
+
}
|
|
1108
|
+
export function __wbg_message_e959edc81e4b6cb7(arg0, arg1) {
|
|
1109
|
+
const ret = arg1.message;
|
|
1110
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1111
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1112
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1113
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1114
|
+
}
|
|
1115
|
+
export function __wbg_middennode_new(arg0) {
|
|
1116
|
+
const ret = MiddenNode.__wrap(arg0);
|
|
1117
|
+
return ret;
|
|
1118
|
+
}
|
|
1119
|
+
export function __wbg_msCrypto_bd5a034af96bcba6(arg0) {
|
|
1120
|
+
const ret = arg0.msCrypto;
|
|
1121
|
+
return ret;
|
|
1122
|
+
}
|
|
1123
|
+
export function __wbg_new_0837727332ac86ba() { return handleError(function () {
|
|
1124
|
+
const ret = new Headers();
|
|
1125
|
+
return ret;
|
|
1126
|
+
}, arguments); }
|
|
1127
|
+
export function __wbg_new_227d7c05414eb861() {
|
|
1128
|
+
const ret = new Error();
|
|
1129
|
+
return ret;
|
|
1130
|
+
}
|
|
1131
|
+
export function __wbg_new_49d5571bd3f0c4d4() {
|
|
1132
|
+
const ret = new Map();
|
|
1133
|
+
return ret;
|
|
1134
|
+
}
|
|
1135
|
+
export function __wbg_new_5f486cdf45a04d78(arg0) {
|
|
1136
|
+
const ret = new Uint8Array(arg0);
|
|
1137
|
+
return ret;
|
|
1138
|
+
}
|
|
1139
|
+
export function __wbg_new_a70fbab9066b301f() {
|
|
1140
|
+
const ret = new Array();
|
|
1141
|
+
return ret;
|
|
1142
|
+
}
|
|
1143
|
+
export function __wbg_new_ab79df5bd7c26067() {
|
|
1144
|
+
const ret = new Object();
|
|
1145
|
+
return ret;
|
|
1146
|
+
}
|
|
1147
|
+
export function __wbg_new_c518c60af666645b() { return handleError(function () {
|
|
1148
|
+
const ret = new AbortController();
|
|
1149
|
+
return ret;
|
|
1150
|
+
}, arguments); }
|
|
1151
|
+
export function __wbg_new_d15cb560a6a0e5f0(arg0, arg1) {
|
|
1152
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1153
|
+
return ret;
|
|
1154
|
+
}
|
|
1155
|
+
export function __wbg_new_dd50bcc3f60ba434() { return handleError(function (arg0, arg1) {
|
|
1156
|
+
const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
|
|
1157
|
+
return ret;
|
|
1158
|
+
}, arguments); }
|
|
1159
|
+
export function __wbg_new_from_slice_22da9388ac046e50(arg0, arg1) {
|
|
1160
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1161
|
+
return ret;
|
|
1162
|
+
}
|
|
1163
|
+
export function __wbg_new_typed_aaaeaf29cf802876(arg0, arg1) {
|
|
1164
|
+
try {
|
|
1165
|
+
var state0 = {a: arg0, b: arg1};
|
|
1166
|
+
var cb0 = (arg0, arg1) => {
|
|
1167
|
+
const a = state0.a;
|
|
1168
|
+
state0.a = 0;
|
|
1169
|
+
try {
|
|
1170
|
+
return wasm_bindgen__convert__closures_____invoke__h5215e847daa20288(a, state0.b, arg0, arg1);
|
|
1171
|
+
} finally {
|
|
1172
|
+
state0.a = a;
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
const ret = new Promise(cb0);
|
|
1176
|
+
return ret;
|
|
1177
|
+
} finally {
|
|
1178
|
+
state0.a = state0.b = 0;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
export function __wbg_new_with_byte_offset_and_length_b2ec5bf7b2f35743(arg0, arg1, arg2) {
|
|
1182
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
1183
|
+
return ret;
|
|
1184
|
+
}
|
|
1185
|
+
export function __wbg_new_with_length_825018a1616e9e55(arg0) {
|
|
1186
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
1187
|
+
return ret;
|
|
1188
|
+
}
|
|
1189
|
+
export function __wbg_new_with_str_and_init_b4b54d1a819bc724() { return handleError(function (arg0, arg1, arg2) {
|
|
1190
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
1191
|
+
return ret;
|
|
1192
|
+
}, arguments); }
|
|
1193
|
+
export function __wbg_new_with_str_sequence_82c04ad794ead10e() { return handleError(function (arg0, arg1, arg2) {
|
|
1194
|
+
const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
|
|
1195
|
+
return ret;
|
|
1196
|
+
}, arguments); }
|
|
1197
|
+
export function __wbg_next_11b99ee6237339e3() { return handleError(function (arg0) {
|
|
1198
|
+
const ret = arg0.next();
|
|
1199
|
+
return ret;
|
|
1200
|
+
}, arguments); }
|
|
1201
|
+
export function __wbg_node_84ea875411254db1(arg0) {
|
|
1202
|
+
const ret = arg0.node;
|
|
1203
|
+
return ret;
|
|
1204
|
+
}
|
|
1205
|
+
export function __wbg_now_16f0c993d5dd6c27() {
|
|
1206
|
+
const ret = Date.now();
|
|
1207
|
+
return ret;
|
|
1208
|
+
}
|
|
1209
|
+
export function __wbg_now_e7c6795a7f81e10f(arg0) {
|
|
1210
|
+
const ret = arg0.now();
|
|
1211
|
+
return ret;
|
|
1212
|
+
}
|
|
1213
|
+
export function __wbg_performance_3fcf6e32a7e1ed0a(arg0) {
|
|
1214
|
+
const ret = arg0.performance;
|
|
1215
|
+
return ret;
|
|
1216
|
+
}
|
|
1217
|
+
export function __wbg_process_44c7a14e11e9f69e(arg0) {
|
|
1218
|
+
const ret = arg0.process;
|
|
1219
|
+
return ret;
|
|
1220
|
+
}
|
|
1221
|
+
export function __wbg_protocol_1ac9e6bde227a312(arg0, arg1) {
|
|
1222
|
+
const ret = arg1.protocol;
|
|
1223
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1224
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1225
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1226
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1227
|
+
}
|
|
1228
|
+
export function __wbg_prototypesetcall_d62e5099504357e6(arg0, arg1, arg2) {
|
|
1229
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1230
|
+
}
|
|
1231
|
+
export function __wbg_push_e87b0e732085a946(arg0, arg1) {
|
|
1232
|
+
const ret = arg0.push(arg1);
|
|
1233
|
+
return ret;
|
|
1234
|
+
}
|
|
1235
|
+
export function __wbg_queueMicrotask_0c399741342fb10f(arg0) {
|
|
1236
|
+
const ret = arg0.queueMicrotask;
|
|
1237
|
+
return ret;
|
|
1238
|
+
}
|
|
1239
|
+
export function __wbg_queueMicrotask_a082d78ce798393e(arg0) {
|
|
1240
|
+
queueMicrotask(arg0);
|
|
1241
|
+
}
|
|
1242
|
+
export function __wbg_radiohandle_new(arg0) {
|
|
1243
|
+
const ret = RadioHandle.__wrap(arg0);
|
|
1244
|
+
return ret;
|
|
1245
|
+
}
|
|
1246
|
+
export function __wbg_randomFillSync_6c25eac9869eb53c() { return handleError(function (arg0, arg1) {
|
|
1247
|
+
arg0.randomFillSync(arg1);
|
|
1248
|
+
}, arguments); }
|
|
1249
|
+
export function __wbg_read_7f593a961a7f80ed(arg0) {
|
|
1250
|
+
const ret = arg0.read();
|
|
1251
|
+
return ret;
|
|
1252
|
+
}
|
|
1253
|
+
export function __wbg_readyState_1f1e7f1bdf9f4d42(arg0) {
|
|
1254
|
+
const ret = arg0.readyState;
|
|
1255
|
+
return ret;
|
|
1256
|
+
}
|
|
1257
|
+
export function __wbg_reason_cbcb9911796c4714(arg0, arg1) {
|
|
1258
|
+
const ret = arg1.reason;
|
|
1259
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1260
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1261
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1262
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1263
|
+
}
|
|
1264
|
+
export function __wbg_releaseLock_ef7766a5da654ff8(arg0) {
|
|
1265
|
+
arg0.releaseLock();
|
|
1266
|
+
}
|
|
1267
|
+
export function __wbg_removeEventListener_c15bc311b6a5d11f() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1268
|
+
arg0.removeEventListener(getStringFromWasm0(arg1, arg2), arg3);
|
|
1269
|
+
}, arguments); }
|
|
1270
|
+
export function __wbg_require_b4edbdcf3e2a1ef0() { return handleError(function () {
|
|
1271
|
+
const ret = module.require;
|
|
1272
|
+
return ret;
|
|
1273
|
+
}, arguments); }
|
|
1274
|
+
export function __wbg_resolve_ae8d83246e5bcc12(arg0) {
|
|
1275
|
+
const ret = Promise.resolve(arg0);
|
|
1276
|
+
return ret;
|
|
1277
|
+
}
|
|
1278
|
+
export function __wbg_respond_e286ee502e7cf7e4() { return handleError(function (arg0, arg1) {
|
|
1279
|
+
arg0.respond(arg1 >>> 0);
|
|
1280
|
+
}, arguments); }
|
|
1281
|
+
export function __wbg_send_4a1dc66e8653e5ed() { return handleError(function (arg0, arg1, arg2) {
|
|
1282
|
+
arg0.send(getStringFromWasm0(arg1, arg2));
|
|
1283
|
+
}, arguments); }
|
|
1284
|
+
export function __wbg_send_d31a693c975dea74() { return handleError(function (arg0, arg1, arg2) {
|
|
1285
|
+
arg0.send(getArrayU8FromWasm0(arg1, arg2));
|
|
1286
|
+
}, arguments); }
|
|
1287
|
+
export function __wbg_setTimeout_6613a51400c1bf9f() { return handleError(function (arg0, arg1, arg2) {
|
|
1288
|
+
const ret = arg0.setTimeout(arg1, arg2);
|
|
1289
|
+
return ret;
|
|
1290
|
+
}, arguments); }
|
|
1291
|
+
export function __wbg_setTimeout_b188b3bcc8977c7d(arg0, arg1) {
|
|
1292
|
+
const ret = setTimeout(arg0, arg1);
|
|
1293
|
+
return ret;
|
|
1294
|
+
}
|
|
1295
|
+
export function __wbg_set_282384002438957f(arg0, arg1, arg2) {
|
|
1296
|
+
arg0[arg1 >>> 0] = arg2;
|
|
1297
|
+
}
|
|
1298
|
+
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
1299
|
+
arg0[arg1] = arg2;
|
|
1300
|
+
}
|
|
1301
|
+
export function __wbg_set_7eaa4f96924fd6b3() { return handleError(function (arg0, arg1, arg2) {
|
|
1302
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
1303
|
+
return ret;
|
|
1304
|
+
}, arguments); }
|
|
1305
|
+
export function __wbg_set_8c0b3ffcf05d61c2(arg0, arg1, arg2) {
|
|
1306
|
+
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
1307
|
+
}
|
|
1308
|
+
export function __wbg_set_bf7251625df30a02(arg0, arg1, arg2) {
|
|
1309
|
+
const ret = arg0.set(arg1, arg2);
|
|
1310
|
+
return ret;
|
|
1311
|
+
}
|
|
1312
|
+
export function __wbg_set_binaryType_3dcf8281ec100a8f(arg0, arg1) {
|
|
1313
|
+
arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
|
|
1314
|
+
}
|
|
1315
|
+
export function __wbg_set_body_a3d856b097dfda04(arg0, arg1) {
|
|
1316
|
+
arg0.body = arg1;
|
|
1317
|
+
}
|
|
1318
|
+
export function __wbg_set_cache_ec7e430c6056ebda(arg0, arg1) {
|
|
1319
|
+
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
1320
|
+
}
|
|
1321
|
+
export function __wbg_set_credentials_ed63183445882c65(arg0, arg1) {
|
|
1322
|
+
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
1323
|
+
}
|
|
1324
|
+
export function __wbg_set_handle_event_d54649fda219fb74(arg0, arg1) {
|
|
1325
|
+
arg0.handleEvent = arg1;
|
|
1326
|
+
}
|
|
1327
|
+
export function __wbg_set_headers_3c8fecc693b75327(arg0, arg1) {
|
|
1328
|
+
arg0.headers = arg1;
|
|
1329
|
+
}
|
|
1330
|
+
export function __wbg_set_method_8c015e8bcafd7be1(arg0, arg1, arg2) {
|
|
1331
|
+
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
1332
|
+
}
|
|
1333
|
+
export function __wbg_set_mode_5a87f2c809cf37c2(arg0, arg1) {
|
|
1334
|
+
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
1335
|
+
}
|
|
1336
|
+
export function __wbg_set_onclose_8da801226bdd7a7b(arg0, arg1) {
|
|
1337
|
+
arg0.onclose = arg1;
|
|
1338
|
+
}
|
|
1339
|
+
export function __wbg_set_onerror_901ca711f94a5bbb(arg0, arg1) {
|
|
1340
|
+
arg0.onerror = arg1;
|
|
1341
|
+
}
|
|
1342
|
+
export function __wbg_set_onmessage_6f80ab771bf151aa(arg0, arg1) {
|
|
1343
|
+
arg0.onmessage = arg1;
|
|
1344
|
+
}
|
|
1345
|
+
export function __wbg_set_onopen_34e3e24cf9337ddd(arg0, arg1) {
|
|
1346
|
+
arg0.onopen = arg1;
|
|
1347
|
+
}
|
|
1348
|
+
export function __wbg_set_signal_0cebecb698f25d21(arg0, arg1) {
|
|
1349
|
+
arg0.signal = arg1;
|
|
1350
|
+
}
|
|
1351
|
+
export function __wbg_signal_166e1da31adcac18(arg0) {
|
|
1352
|
+
const ret = arg0.signal;
|
|
1353
|
+
return ret;
|
|
1354
|
+
}
|
|
1355
|
+
export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
|
|
1356
|
+
const ret = arg1.stack;
|
|
1357
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1358
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1359
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1360
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1361
|
+
}
|
|
1362
|
+
export function __wbg_static_accessor_GLOBAL_8adb955bd33fac2f() {
|
|
1363
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1364
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1365
|
+
}
|
|
1366
|
+
export function __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913() {
|
|
1367
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1368
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1369
|
+
}
|
|
1370
|
+
export function __wbg_static_accessor_SELF_f207c857566db248() {
|
|
1371
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1372
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1373
|
+
}
|
|
1374
|
+
export function __wbg_static_accessor_WINDOW_bb9f1ba69d61b386() {
|
|
1375
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1376
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1377
|
+
}
|
|
1378
|
+
export function __wbg_status_318629ab93a22955(arg0) {
|
|
1379
|
+
const ret = arg0.status;
|
|
1380
|
+
return ret;
|
|
1381
|
+
}
|
|
1382
|
+
export function __wbg_subarray_a068d24e39478a8a(arg0, arg1, arg2) {
|
|
1383
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1384
|
+
return ret;
|
|
1385
|
+
}
|
|
1386
|
+
export function __wbg_then_098abe61755d12f6(arg0, arg1) {
|
|
1387
|
+
const ret = arg0.then(arg1);
|
|
1388
|
+
return ret;
|
|
1389
|
+
}
|
|
1390
|
+
export function __wbg_then_9e335f6dd892bc11(arg0, arg1, arg2) {
|
|
1391
|
+
const ret = arg0.then(arg1, arg2);
|
|
1392
|
+
return ret;
|
|
1393
|
+
}
|
|
1394
|
+
export function __wbg_url_778f9516ea867e17(arg0, arg1) {
|
|
1395
|
+
const ret = arg1.url;
|
|
1396
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1397
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1398
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1399
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1400
|
+
}
|
|
1401
|
+
export function __wbg_url_7fefc1820fba4e0c(arg0, arg1) {
|
|
1402
|
+
const ret = arg1.url;
|
|
1403
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1404
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1405
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1406
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1407
|
+
}
|
|
1408
|
+
export function __wbg_value_21fc78aab0322612(arg0) {
|
|
1409
|
+
const ret = arg0.value;
|
|
1410
|
+
return ret;
|
|
1411
|
+
}
|
|
1412
|
+
export function __wbg_versions_276b2795b1c6a219(arg0) {
|
|
1413
|
+
const ret = arg0.versions;
|
|
1414
|
+
return ret;
|
|
1415
|
+
}
|
|
1416
|
+
export function __wbg_view_f68a712e7315f8b2(arg0) {
|
|
1417
|
+
const ret = arg0.view;
|
|
1418
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1419
|
+
}
|
|
1420
|
+
export function __wbg_warn_3a37cdd7216f1479(arg0, arg1) {
|
|
1421
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
1422
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
1423
|
+
console.warn(...v0);
|
|
1424
|
+
}
|
|
1425
|
+
export function __wbg_wasClean_69f68dc4ed2d2cc7(arg0) {
|
|
1426
|
+
const ret = arg0.wasClean;
|
|
1427
|
+
return ret;
|
|
1428
|
+
}
|
|
1429
|
+
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
1430
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3029, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 3030, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1431
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h294ad2be3504387d, wasm_bindgen__convert__closures_____invoke__h3c1124d888de76f7);
|
|
1432
|
+
return ret;
|
|
1433
|
+
}
|
|
1434
|
+
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
1435
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3185, function: Function { arguments: [], shim_idx: 3186, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1436
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h48b9cf57b0605b6c, wasm_bindgen__convert__closures_____invoke__h19ff6c226dd24a12);
|
|
1437
|
+
return ret;
|
|
1438
|
+
}
|
|
1439
|
+
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
1440
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3234, function: Function { arguments: [Externref], shim_idx: 3235, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1441
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h7b9981a299ee41da, wasm_bindgen__convert__closures_____invoke__h5fadd8e123905fd5);
|
|
1442
|
+
return ret;
|
|
1443
|
+
}
|
|
1444
|
+
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
1445
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3304, function: Function { arguments: [], shim_idx: 3305, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
1446
|
+
const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h04404acb79c6be20, wasm_bindgen__convert__closures_____invoke__h4a79afe2a4c38dc1);
|
|
1447
|
+
return ret;
|
|
1448
|
+
}
|
|
1449
|
+
export function __wbindgen_cast_0000000000000005(arg0, arg1) {
|
|
1450
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3725, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 3726, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1451
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h55c70129bcbd15b5, wasm_bindgen__convert__closures_____invoke__h409293f5a38f3a44);
|
|
1452
|
+
return ret;
|
|
1453
|
+
}
|
|
1454
|
+
export function __wbindgen_cast_0000000000000006(arg0, arg1) {
|
|
1455
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 5058, function: Function { arguments: [], shim_idx: 5059, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1456
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hc43fb2de202384f2, wasm_bindgen__convert__closures_____invoke__h45183445e49f200c);
|
|
1457
|
+
return ret;
|
|
1458
|
+
}
|
|
1459
|
+
export function __wbindgen_cast_0000000000000007(arg0, arg1) {
|
|
1460
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 5067, function: Function { arguments: [Externref], shim_idx: 5068, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1461
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h8f8d4fe60e50c9c6, wasm_bindgen__convert__closures_____invoke__h6e9f0738c1296594);
|
|
1462
|
+
return ret;
|
|
1463
|
+
}
|
|
1464
|
+
export function __wbindgen_cast_0000000000000008(arg0) {
|
|
1465
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
1466
|
+
const ret = arg0;
|
|
1467
|
+
return ret;
|
|
1468
|
+
}
|
|
1469
|
+
export function __wbindgen_cast_0000000000000009(arg0) {
|
|
1470
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
1471
|
+
const ret = arg0;
|
|
1472
|
+
return ret;
|
|
1473
|
+
}
|
|
1474
|
+
export function __wbindgen_cast_000000000000000a(arg0, arg1) {
|
|
1475
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1476
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1477
|
+
return ret;
|
|
1478
|
+
}
|
|
1479
|
+
export function __wbindgen_cast_000000000000000b(arg0, arg1) {
|
|
1480
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1481
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1482
|
+
return ret;
|
|
1483
|
+
}
|
|
1484
|
+
export function __wbindgen_cast_000000000000000c(arg0) {
|
|
1485
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
1486
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1487
|
+
return ret;
|
|
1488
|
+
}
|
|
1489
|
+
export function __wbindgen_init_externref_table() {
|
|
1490
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1491
|
+
const offset = table.grow(4);
|
|
1492
|
+
table.set(0, undefined);
|
|
1493
|
+
table.set(offset + 0, undefined);
|
|
1494
|
+
table.set(offset + 1, null);
|
|
1495
|
+
table.set(offset + 2, true);
|
|
1496
|
+
table.set(offset + 3, false);
|
|
1497
|
+
}
|
|
1498
|
+
function wasm_bindgen__convert__closures_____invoke__h19ff6c226dd24a12(arg0, arg1) {
|
|
1499
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h19ff6c226dd24a12(arg0, arg1);
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
function wasm_bindgen__convert__closures_____invoke__h4a79afe2a4c38dc1(arg0, arg1) {
|
|
1503
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h4a79afe2a4c38dc1(arg0, arg1);
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
function wasm_bindgen__convert__closures_____invoke__h45183445e49f200c(arg0, arg1) {
|
|
1507
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h45183445e49f200c(arg0, arg1);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
function wasm_bindgen__convert__closures_____invoke__h3c1124d888de76f7(arg0, arg1, arg2) {
|
|
1511
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h3c1124d888de76f7(arg0, arg1, arg2);
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
function wasm_bindgen__convert__closures_____invoke__h5fadd8e123905fd5(arg0, arg1, arg2) {
|
|
1515
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h5fadd8e123905fd5(arg0, arg1, arg2);
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
function wasm_bindgen__convert__closures_____invoke__h409293f5a38f3a44(arg0, arg1, arg2) {
|
|
1519
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h409293f5a38f3a44(arg0, arg1, arg2);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
function wasm_bindgen__convert__closures_____invoke__h6e9f0738c1296594(arg0, arg1, arg2) {
|
|
1523
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6e9f0738c1296594(arg0, arg1, arg2);
|
|
1524
|
+
if (ret[1]) {
|
|
1525
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
function wasm_bindgen__convert__closures_____invoke__h5215e847daa20288(arg0, arg1, arg2, arg3) {
|
|
1530
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h5215e847daa20288(arg0, arg1, arg2, arg3);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
|
|
1534
|
+
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
1541
|
+
|
|
1542
|
+
|
|
1543
|
+
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
1544
|
+
|
|
1545
|
+
|
|
1546
|
+
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
1547
|
+
const BiStreamFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1548
|
+
? { register: () => {}, unregister: () => {} }
|
|
1549
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_bistream_free(ptr >>> 0, 1));
|
|
1550
|
+
const HelloImageResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1551
|
+
? { register: () => {}, unregister: () => {} }
|
|
1552
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_helloimageresult_free(ptr >>> 0, 1));
|
|
1553
|
+
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1554
|
+
? { register: () => {}, unregister: () => {} }
|
|
1555
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
|
|
1556
|
+
const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1557
|
+
? { register: () => {}, unregister: () => {} }
|
|
1558
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
|
|
1559
|
+
const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1560
|
+
? { register: () => {}, unregister: () => {} }
|
|
1561
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
|
|
1562
|
+
const MiddenNodeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1563
|
+
? { register: () => {}, unregister: () => {} }
|
|
1564
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_middennode_free(ptr >>> 0, 1));
|
|
1565
|
+
const RadioHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1566
|
+
? { register: () => {}, unregister: () => {} }
|
|
1567
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_radiohandle_free(ptr >>> 0, 1));
|
|
1568
|
+
|
|
1569
|
+
function addToExternrefTable0(obj) {
|
|
1570
|
+
const idx = wasm.__externref_table_alloc();
|
|
1571
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1572
|
+
return idx;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1576
|
+
? { register: () => {}, unregister: () => {} }
|
|
1577
|
+
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
1578
|
+
|
|
1579
|
+
function debugString(val) {
|
|
1580
|
+
// primitive types
|
|
1581
|
+
const type = typeof val;
|
|
1582
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1583
|
+
return `${val}`;
|
|
1584
|
+
}
|
|
1585
|
+
if (type == 'string') {
|
|
1586
|
+
return `"${val}"`;
|
|
1587
|
+
}
|
|
1588
|
+
if (type == 'symbol') {
|
|
1589
|
+
const description = val.description;
|
|
1590
|
+
if (description == null) {
|
|
1591
|
+
return 'Symbol';
|
|
1592
|
+
} else {
|
|
1593
|
+
return `Symbol(${description})`;
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
if (type == 'function') {
|
|
1597
|
+
const name = val.name;
|
|
1598
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1599
|
+
return `Function(${name})`;
|
|
1600
|
+
} else {
|
|
1601
|
+
return 'Function';
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
// objects
|
|
1605
|
+
if (Array.isArray(val)) {
|
|
1606
|
+
const length = val.length;
|
|
1607
|
+
let debug = '[';
|
|
1608
|
+
if (length > 0) {
|
|
1609
|
+
debug += debugString(val[0]);
|
|
1610
|
+
}
|
|
1611
|
+
for(let i = 1; i < length; i++) {
|
|
1612
|
+
debug += ', ' + debugString(val[i]);
|
|
1613
|
+
}
|
|
1614
|
+
debug += ']';
|
|
1615
|
+
return debug;
|
|
1616
|
+
}
|
|
1617
|
+
// Test for built-in
|
|
1618
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1619
|
+
let className;
|
|
1620
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1621
|
+
className = builtInMatches[1];
|
|
1622
|
+
} else {
|
|
1623
|
+
// Failed to match the standard '[object ClassName]'
|
|
1624
|
+
return toString.call(val);
|
|
1625
|
+
}
|
|
1626
|
+
if (className == 'Object') {
|
|
1627
|
+
// we're a user defined class or Object
|
|
1628
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1629
|
+
// easier than looping through ownProperties of `val`.
|
|
1630
|
+
try {
|
|
1631
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1632
|
+
} catch (_) {
|
|
1633
|
+
return 'Object';
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
// errors
|
|
1637
|
+
if (val instanceof Error) {
|
|
1638
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1639
|
+
}
|
|
1640
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1641
|
+
return className;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1645
|
+
ptr = ptr >>> 0;
|
|
1646
|
+
const mem = getDataViewMemory0();
|
|
1647
|
+
const result = [];
|
|
1648
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
1649
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
1650
|
+
}
|
|
1651
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
1652
|
+
return result;
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1656
|
+
ptr = ptr >>> 0;
|
|
1657
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
let cachedDataViewMemory0 = null;
|
|
1661
|
+
function getDataViewMemory0() {
|
|
1662
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1663
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1664
|
+
}
|
|
1665
|
+
return cachedDataViewMemory0;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
function getStringFromWasm0(ptr, len) {
|
|
1669
|
+
ptr = ptr >>> 0;
|
|
1670
|
+
return decodeText(ptr, len);
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1674
|
+
function getUint8ArrayMemory0() {
|
|
1675
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1676
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1677
|
+
}
|
|
1678
|
+
return cachedUint8ArrayMemory0;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
function handleError(f, args) {
|
|
1682
|
+
try {
|
|
1683
|
+
return f.apply(this, args);
|
|
1684
|
+
} catch (e) {
|
|
1685
|
+
const idx = addToExternrefTable0(e);
|
|
1686
|
+
wasm.__wbindgen_exn_store(idx);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
function isLikeNone(x) {
|
|
1691
|
+
return x === undefined || x === null;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
function makeClosure(arg0, arg1, dtor, f) {
|
|
1695
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
1696
|
+
const real = (...args) => {
|
|
1697
|
+
|
|
1698
|
+
// First up with a closure we increment the internal reference
|
|
1699
|
+
// count. This ensures that the Rust closure environment won't
|
|
1700
|
+
// be deallocated while we're invoking it.
|
|
1701
|
+
state.cnt++;
|
|
1702
|
+
try {
|
|
1703
|
+
return f(state.a, state.b, ...args);
|
|
1704
|
+
} finally {
|
|
1705
|
+
real._wbg_cb_unref();
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
real._wbg_cb_unref = () => {
|
|
1709
|
+
if (--state.cnt === 0) {
|
|
1710
|
+
state.dtor(state.a, state.b);
|
|
1711
|
+
state.a = 0;
|
|
1712
|
+
CLOSURE_DTORS.unregister(state);
|
|
1713
|
+
}
|
|
1714
|
+
};
|
|
1715
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
1716
|
+
return real;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
1720
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
1721
|
+
const real = (...args) => {
|
|
1722
|
+
|
|
1723
|
+
// First up with a closure we increment the internal reference
|
|
1724
|
+
// count. This ensures that the Rust closure environment won't
|
|
1725
|
+
// be deallocated while we're invoking it.
|
|
1726
|
+
state.cnt++;
|
|
1727
|
+
const a = state.a;
|
|
1728
|
+
state.a = 0;
|
|
1729
|
+
try {
|
|
1730
|
+
return f(a, state.b, ...args);
|
|
1731
|
+
} finally {
|
|
1732
|
+
state.a = a;
|
|
1733
|
+
real._wbg_cb_unref();
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
real._wbg_cb_unref = () => {
|
|
1737
|
+
if (--state.cnt === 0) {
|
|
1738
|
+
state.dtor(state.a, state.b);
|
|
1739
|
+
state.a = 0;
|
|
1740
|
+
CLOSURE_DTORS.unregister(state);
|
|
1741
|
+
}
|
|
1742
|
+
};
|
|
1743
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
1744
|
+
return real;
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1748
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1749
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1750
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1751
|
+
return ptr;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1755
|
+
if (realloc === undefined) {
|
|
1756
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1757
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1758
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1759
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1760
|
+
return ptr;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
let len = arg.length;
|
|
1764
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1765
|
+
|
|
1766
|
+
const mem = getUint8ArrayMemory0();
|
|
1767
|
+
|
|
1768
|
+
let offset = 0;
|
|
1769
|
+
|
|
1770
|
+
for (; offset < len; offset++) {
|
|
1771
|
+
const code = arg.charCodeAt(offset);
|
|
1772
|
+
if (code > 0x7F) break;
|
|
1773
|
+
mem[ptr + offset] = code;
|
|
1774
|
+
}
|
|
1775
|
+
if (offset !== len) {
|
|
1776
|
+
if (offset !== 0) {
|
|
1777
|
+
arg = arg.slice(offset);
|
|
1778
|
+
}
|
|
1779
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1780
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1781
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1782
|
+
|
|
1783
|
+
offset += ret.written;
|
|
1784
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
WASM_VECTOR_LEN = offset;
|
|
1788
|
+
return ptr;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
function takeFromExternrefTable0(idx) {
|
|
1792
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1793
|
+
wasm.__externref_table_dealloc(idx);
|
|
1794
|
+
return value;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1798
|
+
cachedTextDecoder.decode();
|
|
1799
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1800
|
+
let numBytesDecoded = 0;
|
|
1801
|
+
function decodeText(ptr, len) {
|
|
1802
|
+
numBytesDecoded += len;
|
|
1803
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1804
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1805
|
+
cachedTextDecoder.decode();
|
|
1806
|
+
numBytesDecoded = len;
|
|
1807
|
+
}
|
|
1808
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1812
|
+
|
|
1813
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1814
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1815
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1816
|
+
view.set(buf);
|
|
1817
|
+
return {
|
|
1818
|
+
read: arg.length,
|
|
1819
|
+
written: buf.length
|
|
1820
|
+
};
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
let WASM_VECTOR_LEN = 0;
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
let wasm;
|
|
1828
|
+
export function __wbg_set_wasm(val) {
|
|
1829
|
+
wasm = val;
|
|
1830
|
+
}
|