create-sia-app 0.1.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.
Files changed (112) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +179 -0
  3. package/package.json +29 -0
  4. package/template/CLAUDE.md +160 -0
  5. package/template/README.md +102 -0
  6. package/template/_gitignore +5 -0
  7. package/template/biome.json +40 -0
  8. package/template/index.html +13 -0
  9. package/template/package.json +30 -0
  10. package/template/rust/README.md +16 -0
  11. package/template/rust/sia-sdk-rs/.changeset/added_cancel_function_to_cancel_inflight_packed_uploads.md +6 -0
  12. package/template/rust/sia-sdk-rs/.changeset/check_if_we_have_enough_hosts_prior_to_encoding_in_upload_slabs.md +16 -0
  13. package/template/rust/sia-sdk-rs/.changeset/fix_slab_length_in_packed_object.md +5 -0
  14. package/template/rust/sia-sdk-rs/.changeset/fix_upload_racing_race_conditon.md +13 -0
  15. package/template/rust/sia-sdk-rs/.changeset/improved_parallelism_of_packed_uploads.md +5 -0
  16. package/template/rust/sia-sdk-rs/.changeset/progress_callback_will_now_be_called_as_expected_for_packed_uploads.md +5 -0
  17. package/template/rust/sia-sdk-rs/.github/dependabot.yml +10 -0
  18. package/template/rust/sia-sdk-rs/.github/workflows/main.yml +36 -0
  19. package/template/rust/sia-sdk-rs/.github/workflows/prepare-release.yml +34 -0
  20. package/template/rust/sia-sdk-rs/.github/workflows/release.yml +30 -0
  21. package/template/rust/sia-sdk-rs/.rustfmt.toml +4 -0
  22. package/template/rust/sia-sdk-rs/Cargo.lock +4127 -0
  23. package/template/rust/sia-sdk-rs/Cargo.toml +3 -0
  24. package/template/rust/sia-sdk-rs/LICENSE +21 -0
  25. package/template/rust/sia-sdk-rs/README.md +30 -0
  26. package/template/rust/sia-sdk-rs/indexd/CHANGELOG.md +79 -0
  27. package/template/rust/sia-sdk-rs/indexd/Cargo.toml +79 -0
  28. package/template/rust/sia-sdk-rs/indexd/benches/upload.rs +258 -0
  29. package/template/rust/sia-sdk-rs/indexd/src/app_client.rs +1710 -0
  30. package/template/rust/sia-sdk-rs/indexd/src/builder.rs +354 -0
  31. package/template/rust/sia-sdk-rs/indexd/src/download.rs +379 -0
  32. package/template/rust/sia-sdk-rs/indexd/src/hosts.rs +659 -0
  33. package/template/rust/sia-sdk-rs/indexd/src/lib.rs +827 -0
  34. package/template/rust/sia-sdk-rs/indexd/src/mock.rs +162 -0
  35. package/template/rust/sia-sdk-rs/indexd/src/object_encryption.rs +125 -0
  36. package/template/rust/sia-sdk-rs/indexd/src/quic.rs +575 -0
  37. package/template/rust/sia-sdk-rs/indexd/src/rhp4.rs +52 -0
  38. package/template/rust/sia-sdk-rs/indexd/src/slabs.rs +497 -0
  39. package/template/rust/sia-sdk-rs/indexd/src/upload.rs +629 -0
  40. package/template/rust/sia-sdk-rs/indexd/src/wasm_time.rs +41 -0
  41. package/template/rust/sia-sdk-rs/indexd/src/web_transport.rs +398 -0
  42. package/template/rust/sia-sdk-rs/indexd_ffi/CHANGELOG.md +76 -0
  43. package/template/rust/sia-sdk-rs/indexd_ffi/Cargo.toml +47 -0
  44. package/template/rust/sia-sdk-rs/indexd_ffi/examples/python/README.md +10 -0
  45. package/template/rust/sia-sdk-rs/indexd_ffi/examples/python/example.py +130 -0
  46. package/template/rust/sia-sdk-rs/indexd_ffi/src/bin/uniffi-bindgen.rs +3 -0
  47. package/template/rust/sia-sdk-rs/indexd_ffi/src/builder.rs +377 -0
  48. package/template/rust/sia-sdk-rs/indexd_ffi/src/io.rs +155 -0
  49. package/template/rust/sia-sdk-rs/indexd_ffi/src/lib.rs +1039 -0
  50. package/template/rust/sia-sdk-rs/indexd_ffi/src/logging.rs +58 -0
  51. package/template/rust/sia-sdk-rs/indexd_ffi/src/tls.rs +23 -0
  52. package/template/rust/sia-sdk-rs/indexd_wasm/Cargo.toml +33 -0
  53. package/template/rust/sia-sdk-rs/indexd_wasm/src/lib.rs +818 -0
  54. package/template/rust/sia-sdk-rs/knope.toml +54 -0
  55. package/template/rust/sia-sdk-rs/sia_derive/CHANGELOG.md +38 -0
  56. package/template/rust/sia-sdk-rs/sia_derive/Cargo.toml +19 -0
  57. package/template/rust/sia-sdk-rs/sia_derive/src/lib.rs +278 -0
  58. package/template/rust/sia-sdk-rs/sia_sdk/CHANGELOG.md +91 -0
  59. package/template/rust/sia-sdk-rs/sia_sdk/Cargo.toml +59 -0
  60. package/template/rust/sia-sdk-rs/sia_sdk/benches/merkle_root.rs +12 -0
  61. package/template/rust/sia-sdk-rs/sia_sdk/src/blake2.rs +22 -0
  62. package/template/rust/sia-sdk-rs/sia_sdk/src/consensus.rs +767 -0
  63. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding/v1.rs +257 -0
  64. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding/v2.rs +291 -0
  65. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding.rs +26 -0
  66. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding_async/v2.rs +367 -0
  67. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding_async.rs +6 -0
  68. package/template/rust/sia-sdk-rs/sia_sdk/src/encryption.rs +303 -0
  69. package/template/rust/sia-sdk-rs/sia_sdk/src/erasure_coding.rs +347 -0
  70. package/template/rust/sia-sdk-rs/sia_sdk/src/lib.rs +15 -0
  71. package/template/rust/sia-sdk-rs/sia_sdk/src/macros.rs +435 -0
  72. package/template/rust/sia-sdk-rs/sia_sdk/src/merkle.rs +112 -0
  73. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp/merkle.rs +357 -0
  74. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp/rpc.rs +1507 -0
  75. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp/types.rs +146 -0
  76. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp.rs +7 -0
  77. package/template/rust/sia-sdk-rs/sia_sdk/src/seed.rs +278 -0
  78. package/template/rust/sia-sdk-rs/sia_sdk/src/signing.rs +236 -0
  79. package/template/rust/sia-sdk-rs/sia_sdk/src/types/common.rs +677 -0
  80. package/template/rust/sia-sdk-rs/sia_sdk/src/types/currency.rs +450 -0
  81. package/template/rust/sia-sdk-rs/sia_sdk/src/types/specifier.rs +110 -0
  82. package/template/rust/sia-sdk-rs/sia_sdk/src/types/spendpolicy.rs +778 -0
  83. package/template/rust/sia-sdk-rs/sia_sdk/src/types/utils.rs +117 -0
  84. package/template/rust/sia-sdk-rs/sia_sdk/src/types/v1.rs +1737 -0
  85. package/template/rust/sia-sdk-rs/sia_sdk/src/types/v2.rs +1726 -0
  86. package/template/rust/sia-sdk-rs/sia_sdk/src/types/work.rs +59 -0
  87. package/template/rust/sia-sdk-rs/sia_sdk/src/types.rs +16 -0
  88. package/template/scripts/setup-rust.js +29 -0
  89. package/template/src/App.tsx +13 -0
  90. package/template/src/components/DevNote.tsx +21 -0
  91. package/template/src/components/auth/ApproveScreen.tsx +84 -0
  92. package/template/src/components/auth/AuthFlow.tsx +77 -0
  93. package/template/src/components/auth/ConnectScreen.tsx +214 -0
  94. package/template/src/components/auth/LoadingScreen.tsx +8 -0
  95. package/template/src/components/auth/RecoveryScreen.tsx +182 -0
  96. package/template/src/components/upload/UploadZone.tsx +314 -0
  97. package/template/src/index.css +9 -0
  98. package/template/src/lib/constants.ts +8 -0
  99. package/template/src/lib/format.ts +35 -0
  100. package/template/src/lib/hex.ts +13 -0
  101. package/template/src/lib/sdk.ts +25 -0
  102. package/template/src/lib/wasm-env.ts +5 -0
  103. package/template/src/main.tsx +12 -0
  104. package/template/src/stores/auth.ts +86 -0
  105. package/template/tsconfig.app.json +31 -0
  106. package/template/tsconfig.json +7 -0
  107. package/template/tsconfig.node.json +26 -0
  108. package/template/vite.config.ts +18 -0
  109. package/template/wasm/indexd_wasm/indexd_wasm.d.ts +309 -0
  110. package/template/wasm/indexd_wasm/indexd_wasm.js +1507 -0
  111. package/template/wasm/indexd_wasm/indexd_wasm_bg.wasm +0 -0
  112. package/template/wasm/indexd_wasm/package.json +31 -0
@@ -0,0 +1,1507 @@
1
+ import * as __wbg_star0 from 'env';
2
+
3
+ let wasm;
4
+
5
+ let cachedUint8ArrayMemory0 = null;
6
+
7
+ function getUint8ArrayMemory0() {
8
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
9
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
10
+ }
11
+ return cachedUint8ArrayMemory0;
12
+ }
13
+
14
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
15
+
16
+ cachedTextDecoder.decode();
17
+
18
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
19
+ let numBytesDecoded = 0;
20
+ function decodeText(ptr, len) {
21
+ numBytesDecoded += len;
22
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
23
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
24
+ cachedTextDecoder.decode();
25
+ numBytesDecoded = len;
26
+ }
27
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
28
+ }
29
+
30
+ function getStringFromWasm0(ptr, len) {
31
+ ptr = ptr >>> 0;
32
+ return decodeText(ptr, len);
33
+ }
34
+
35
+ let WASM_VECTOR_LEN = 0;
36
+
37
+ const cachedTextEncoder = new TextEncoder();
38
+
39
+ if (!('encodeInto' in cachedTextEncoder)) {
40
+ cachedTextEncoder.encodeInto = function (arg, view) {
41
+ const buf = cachedTextEncoder.encode(arg);
42
+ view.set(buf);
43
+ return {
44
+ read: arg.length,
45
+ written: buf.length
46
+ };
47
+ }
48
+ }
49
+
50
+ function passStringToWasm0(arg, malloc, realloc) {
51
+
52
+ if (realloc === undefined) {
53
+ const buf = cachedTextEncoder.encode(arg);
54
+ const ptr = malloc(buf.length, 1) >>> 0;
55
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
56
+ WASM_VECTOR_LEN = buf.length;
57
+ return ptr;
58
+ }
59
+
60
+ let len = arg.length;
61
+ let ptr = malloc(len, 1) >>> 0;
62
+
63
+ const mem = getUint8ArrayMemory0();
64
+
65
+ let offset = 0;
66
+
67
+ for (; offset < len; offset++) {
68
+ const code = arg.charCodeAt(offset);
69
+ if (code > 0x7F) break;
70
+ mem[ptr + offset] = code;
71
+ }
72
+
73
+ if (offset !== len) {
74
+ if (offset !== 0) {
75
+ arg = arg.slice(offset);
76
+ }
77
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
78
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
79
+ const ret = cachedTextEncoder.encodeInto(arg, view);
80
+
81
+ offset += ret.written;
82
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
83
+ }
84
+
85
+ WASM_VECTOR_LEN = offset;
86
+ return ptr;
87
+ }
88
+
89
+ let cachedDataViewMemory0 = null;
90
+
91
+ function getDataViewMemory0() {
92
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
93
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
94
+ }
95
+ return cachedDataViewMemory0;
96
+ }
97
+
98
+ function isLikeNone(x) {
99
+ return x === undefined || x === null;
100
+ }
101
+
102
+ function debugString(val) {
103
+ // primitive types
104
+ const type = typeof val;
105
+ if (type == 'number' || type == 'boolean' || val == null) {
106
+ return `${val}`;
107
+ }
108
+ if (type == 'string') {
109
+ return `"${val}"`;
110
+ }
111
+ if (type == 'symbol') {
112
+ const description = val.description;
113
+ if (description == null) {
114
+ return 'Symbol';
115
+ } else {
116
+ return `Symbol(${description})`;
117
+ }
118
+ }
119
+ if (type == 'function') {
120
+ const name = val.name;
121
+ if (typeof name == 'string' && name.length > 0) {
122
+ return `Function(${name})`;
123
+ } else {
124
+ return 'Function';
125
+ }
126
+ }
127
+ // objects
128
+ if (Array.isArray(val)) {
129
+ const length = val.length;
130
+ let debug = '[';
131
+ if (length > 0) {
132
+ debug += debugString(val[0]);
133
+ }
134
+ for(let i = 1; i < length; i++) {
135
+ debug += ', ' + debugString(val[i]);
136
+ }
137
+ debug += ']';
138
+ return debug;
139
+ }
140
+ // Test for built-in
141
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
142
+ let className;
143
+ if (builtInMatches && builtInMatches.length > 1) {
144
+ className = builtInMatches[1];
145
+ } else {
146
+ // Failed to match the standard '[object ClassName]'
147
+ return toString.call(val);
148
+ }
149
+ if (className == 'Object') {
150
+ // we're a user defined class or Object
151
+ // JSON.stringify avoids problems with cycles, and is generally much
152
+ // easier than looping through ownProperties of `val`.
153
+ try {
154
+ return 'Object(' + JSON.stringify(val) + ')';
155
+ } catch (_) {
156
+ return 'Object';
157
+ }
158
+ }
159
+ // errors
160
+ if (val instanceof Error) {
161
+ return `${val.name}: ${val.message}\n${val.stack}`;
162
+ }
163
+ // TODO we could test for more things here, like `Set`s and `Map`s.
164
+ return className;
165
+ }
166
+
167
+ function addToExternrefTable0(obj) {
168
+ const idx = wasm.__externref_table_alloc();
169
+ wasm.__wbindgen_externrefs.set(idx, obj);
170
+ return idx;
171
+ }
172
+
173
+ function handleError(f, args) {
174
+ try {
175
+ return f.apply(this, args);
176
+ } catch (e) {
177
+ const idx = addToExternrefTable0(e);
178
+ wasm.__wbindgen_exn_store(idx);
179
+ }
180
+ }
181
+
182
+ function getArrayU8FromWasm0(ptr, len) {
183
+ ptr = ptr >>> 0;
184
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
185
+ }
186
+
187
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
188
+ ? { register: () => {}, unregister: () => {} }
189
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
190
+
191
+ function makeMutClosure(arg0, arg1, dtor, f) {
192
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
193
+ const real = (...args) => {
194
+
195
+ // First up with a closure we increment the internal reference
196
+ // count. This ensures that the Rust closure environment won't
197
+ // be deallocated while we're invoking it.
198
+ state.cnt++;
199
+ const a = state.a;
200
+ state.a = 0;
201
+ try {
202
+ return f(a, state.b, ...args);
203
+ } finally {
204
+ state.a = a;
205
+ real._wbg_cb_unref();
206
+ }
207
+ };
208
+ real._wbg_cb_unref = () => {
209
+ if (--state.cnt === 0) {
210
+ state.dtor(state.a, state.b);
211
+ state.a = 0;
212
+ CLOSURE_DTORS.unregister(state);
213
+ }
214
+ };
215
+ CLOSURE_DTORS.register(real, state, state);
216
+ return real;
217
+ }
218
+
219
+ function passArray8ToWasm0(arg, malloc) {
220
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
221
+ getUint8ArrayMemory0().set(arg, ptr / 1);
222
+ WASM_VECTOR_LEN = arg.length;
223
+ return ptr;
224
+ }
225
+
226
+ function takeFromExternrefTable0(idx) {
227
+ const value = wasm.__wbindgen_externrefs.get(idx);
228
+ wasm.__externref_table_dealloc(idx);
229
+ return value;
230
+ }
231
+
232
+ function _assertClass(instance, klass) {
233
+ if (!(instance instanceof klass)) {
234
+ throw new Error(`expected instance of ${klass.name}`);
235
+ }
236
+ }
237
+ /**
238
+ * Install a panic hook and logging bridge so that Rust panics show a proper
239
+ * stack trace and `log::debug!()` / `log::info!()` etc. appear in the browser
240
+ * console.
241
+ */
242
+ export function init_panic_hook() {
243
+ wasm.init_panic_hook();
244
+ }
245
+
246
+ /**
247
+ * Connects to a host via WebTransport and fetches its settings/prices.
248
+ *
249
+ * `address` should be a host address like `host.example.com:9883`.
250
+ * Returns the host settings as a JS object.
251
+ * @param {string} address
252
+ * @returns {Promise<any>}
253
+ */
254
+ export function fetchHostSettings(address) {
255
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
256
+ const len0 = WASM_VECTOR_LEN;
257
+ const ret = wasm.fetchHostSettings(ptr0, len0);
258
+ return ret;
259
+ }
260
+
261
+ /**
262
+ * Validates a BIP-32 recovery phrase.
263
+ * @param {string} phrase
264
+ */
265
+ export function validateRecoveryPhrase(phrase) {
266
+ const ptr0 = passStringToWasm0(phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
267
+ const len0 = WASM_VECTOR_LEN;
268
+ const ret = wasm.validateRecoveryPhrase(ptr0, len0);
269
+ if (ret[1]) {
270
+ throw takeFromExternrefTable0(ret[0]);
271
+ }
272
+ }
273
+
274
+ /**
275
+ * Generates a new 12-word BIP-32 recovery phrase.
276
+ * @returns {string}
277
+ */
278
+ export function generateRecoveryPhrase() {
279
+ let deferred1_0;
280
+ let deferred1_1;
281
+ try {
282
+ const ret = wasm.generateRecoveryPhrase();
283
+ deferred1_0 = ret[0];
284
+ deferred1_1 = ret[1];
285
+ return getStringFromWasm0(ret[0], ret[1]);
286
+ } finally {
287
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
288
+ }
289
+ }
290
+
291
+ function wasm_bindgen__convert__closures_____invoke__h660d0571ab542b96(arg0, arg1) {
292
+ wasm.wasm_bindgen__convert__closures_____invoke__h660d0571ab542b96(arg0, arg1);
293
+ }
294
+
295
+ function wasm_bindgen__convert__closures_____invoke__h6280da76965e1dcd(arg0, arg1, arg2) {
296
+ wasm.wasm_bindgen__convert__closures_____invoke__h6280da76965e1dcd(arg0, arg1, arg2);
297
+ }
298
+
299
+ function wasm_bindgen__convert__closures_____invoke__hf411941149947cdb(arg0, arg1, arg2, arg3) {
300
+ wasm.wasm_bindgen__convert__closures_____invoke__hf411941149947cdb(arg0, arg1, arg2, arg3);
301
+ }
302
+
303
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
304
+
305
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
306
+
307
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
308
+
309
+ const AppKeyFinalization = (typeof FinalizationRegistry === 'undefined')
310
+ ? { register: () => {}, unregister: () => {} }
311
+ : new FinalizationRegistry(ptr => wasm.__wbg_appkey_free(ptr >>> 0, 1));
312
+
313
+ export class AppKey {
314
+
315
+ static __wrap(ptr) {
316
+ ptr = ptr >>> 0;
317
+ const obj = Object.create(AppKey.prototype);
318
+ obj.__wbg_ptr = ptr;
319
+ AppKeyFinalization.register(obj, obj.__wbg_ptr, obj);
320
+ return obj;
321
+ }
322
+
323
+ __destroy_into_raw() {
324
+ const ptr = this.__wbg_ptr;
325
+ this.__wbg_ptr = 0;
326
+ AppKeyFinalization.unregister(this);
327
+ return ptr;
328
+ }
329
+
330
+ free() {
331
+ const ptr = this.__destroy_into_raw();
332
+ wasm.__wbg_appkey_free(ptr, 0);
333
+ }
334
+ /**
335
+ * Returns the hex-encoded public key.
336
+ * @returns {string}
337
+ */
338
+ publicKey() {
339
+ let deferred1_0;
340
+ let deferred1_1;
341
+ try {
342
+ const ret = wasm.appkey_publicKey(this.__wbg_ptr);
343
+ deferred1_0 = ret[0];
344
+ deferred1_1 = ret[1];
345
+ return getStringFromWasm0(ret[0], ret[1]);
346
+ } finally {
347
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
348
+ }
349
+ }
350
+ /**
351
+ * Verifies a signature against a message.
352
+ * @param {Uint8Array} message
353
+ * @param {Uint8Array} signature
354
+ * @returns {boolean}
355
+ */
356
+ verifySignature(message, signature) {
357
+ const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
358
+ const len0 = WASM_VECTOR_LEN;
359
+ const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
360
+ const len1 = WASM_VECTOR_LEN;
361
+ const ret = wasm.appkey_verifySignature(this.__wbg_ptr, ptr0, len0, ptr1, len1);
362
+ if (ret[2]) {
363
+ throw takeFromExternrefTable0(ret[1]);
364
+ }
365
+ return ret[0] !== 0;
366
+ }
367
+ /**
368
+ * Imports an AppKey from a 64-byte ed25519 keypair or a 32-byte seed.
369
+ * @param {Uint8Array} key
370
+ */
371
+ constructor(key) {
372
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
373
+ const len0 = WASM_VECTOR_LEN;
374
+ const ret = wasm.appkey_new(ptr0, len0);
375
+ if (ret[2]) {
376
+ throw takeFromExternrefTable0(ret[1]);
377
+ }
378
+ this.__wbg_ptr = ret[0] >>> 0;
379
+ AppKeyFinalization.register(this, this.__wbg_ptr, this);
380
+ return this;
381
+ }
382
+ /**
383
+ * Signs a message, returning the 64-byte signature.
384
+ * @param {Uint8Array} message
385
+ * @returns {Uint8Array}
386
+ */
387
+ sign(message) {
388
+ const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
389
+ const len0 = WASM_VECTOR_LEN;
390
+ const ret = wasm.appkey_sign(this.__wbg_ptr, ptr0, len0);
391
+ return ret;
392
+ }
393
+ /**
394
+ * Exports the full 64-byte ed25519 keypair.
395
+ * @returns {Uint8Array}
396
+ */
397
+ export() {
398
+ const ret = wasm.appkey_export(this.__wbg_ptr);
399
+ return ret;
400
+ }
401
+ }
402
+ if (Symbol.dispose) AppKey.prototype[Symbol.dispose] = AppKey.prototype.free;
403
+
404
+ const BuilderFinalization = (typeof FinalizationRegistry === 'undefined')
405
+ ? { register: () => {}, unregister: () => {} }
406
+ : new FinalizationRegistry(ptr => wasm.__wbg_builder_free(ptr >>> 0, 1));
407
+
408
+ export class Builder {
409
+
410
+ __destroy_into_raw() {
411
+ const ptr = this.__wbg_ptr;
412
+ this.__wbg_ptr = 0;
413
+ BuilderFinalization.unregister(this);
414
+ return ptr;
415
+ }
416
+
417
+ free() {
418
+ const ptr = this.__destroy_into_raw();
419
+ wasm.__wbg_builder_free(ptr, 0);
420
+ }
421
+ /**
422
+ * Returns the response URL the user must visit to authorize the connection.
423
+ * @returns {string}
424
+ */
425
+ responseUrl() {
426
+ let deferred2_0;
427
+ let deferred2_1;
428
+ try {
429
+ const ret = wasm.builder_responseUrl(this.__wbg_ptr);
430
+ var ptr1 = ret[0];
431
+ var len1 = ret[1];
432
+ if (ret[3]) {
433
+ ptr1 = 0; len1 = 0;
434
+ throw takeFromExternrefTable0(ret[2]);
435
+ }
436
+ deferred2_0 = ptr1;
437
+ deferred2_1 = len1;
438
+ return getStringFromWasm0(ptr1, len1);
439
+ } finally {
440
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
441
+ }
442
+ }
443
+ /**
444
+ * Sets the maximum number of concurrent uploads (default: 3).
445
+ * Lower values = more stable, higher values = faster but may crash browser.
446
+ * @param {number} max
447
+ */
448
+ withMaxUploads(max) {
449
+ const ret = wasm.builder_withMaxUploads(this.__wbg_ptr, max);
450
+ if (ret[1]) {
451
+ throw takeFromExternrefTable0(ret[0]);
452
+ }
453
+ }
454
+ /**
455
+ * Polls for approval. Resolves when the user approves.
456
+ * @returns {Promise<void>}
457
+ */
458
+ waitForApproval() {
459
+ const ret = wasm.builder_waitForApproval(this.__wbg_ptr);
460
+ return ret;
461
+ }
462
+ /**
463
+ * Requests a new app connection. Pass app metadata as a JSON object:
464
+ * ```json
465
+ * {
466
+ * "app_id": [32 bytes as hex],
467
+ * "name": "My App",
468
+ * "description": "...",
469
+ * "service_url": "https://...",
470
+ * "logo_url": "https://..." (optional),
471
+ * "callback_url": "https://..." (optional)
472
+ * }
473
+ * ```
474
+ * @param {string} app_meta_json
475
+ * @returns {Promise<void>}
476
+ */
477
+ requestConnection(app_meta_json) {
478
+ const ptr0 = passStringToWasm0(app_meta_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
479
+ const len0 = WASM_VECTOR_LEN;
480
+ const ret = wasm.builder_requestConnection(this.__wbg_ptr, ptr0, len0);
481
+ return ret;
482
+ }
483
+ /**
484
+ * Sets the maximum number of concurrent downloads (default: 2).
485
+ * Lower values = more stable, higher values = faster but may crash browser.
486
+ * @param {number} max
487
+ */
488
+ withMaxDownloads(max) {
489
+ const ret = wasm.builder_withMaxDownloads(this.__wbg_ptr, max);
490
+ if (ret[1]) {
491
+ throw takeFromExternrefTable0(ret[0]);
492
+ }
493
+ }
494
+ /**
495
+ * Sets the maximum number of concurrent price fetches (default: 1).
496
+ * Lower values = more stable, higher values = faster but may crash browser.
497
+ * @param {number} max
498
+ */
499
+ withMaxPriceFetches(max) {
500
+ const ret = wasm.builder_withMaxPriceFetches(this.__wbg_ptr, max);
501
+ if (ret[1]) {
502
+ throw takeFromExternrefTable0(ret[0]);
503
+ }
504
+ }
505
+ /**
506
+ * Transitions the builder using a pre-fetched connection response.
507
+ * Use this when the `POST /auth/connect` call was made out-of-band
508
+ * (e.g. via curl) to work around CORS restrictions.
509
+ *
510
+ * `app_id_hex` is the hex-encoded app ID used in the request.
511
+ * `response_json` is the JSON response from `POST /auth/connect`.
512
+ * @param {string} app_id_hex
513
+ * @param {string} response_json
514
+ */
515
+ setConnectionResponse(app_id_hex, response_json) {
516
+ const ptr0 = passStringToWasm0(app_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
517
+ const len0 = WASM_VECTOR_LEN;
518
+ const ptr1 = passStringToWasm0(response_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
519
+ const len1 = WASM_VECTOR_LEN;
520
+ const ret = wasm.builder_setConnectionResponse(this.__wbg_ptr, ptr0, len0, ptr1, len1);
521
+ if (ret[1]) {
522
+ throw takeFromExternrefTable0(ret[0]);
523
+ }
524
+ }
525
+ /**
526
+ * Creates a new SDK builder for the given indexer URL.
527
+ * @param {string} indexer_url
528
+ */
529
+ constructor(indexer_url) {
530
+ const ptr0 = passStringToWasm0(indexer_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
531
+ const len0 = WASM_VECTOR_LEN;
532
+ const ret = wasm.builder_new(ptr0, len0);
533
+ if (ret[2]) {
534
+ throw takeFromExternrefTable0(ret[1]);
535
+ }
536
+ this.__wbg_ptr = ret[0] >>> 0;
537
+ BuilderFinalization.register(this, this.__wbg_ptr, this);
538
+ return this;
539
+ }
540
+ /**
541
+ * Registers the app using the user's recovery phrase and returns the SDK.
542
+ * @param {string} mnemonic
543
+ * @returns {Promise<SDK>}
544
+ */
545
+ register(mnemonic) {
546
+ const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
547
+ const len0 = WASM_VECTOR_LEN;
548
+ const ret = wasm.builder_register(this.__wbg_ptr, ptr0, len0);
549
+ return ret;
550
+ }
551
+ /**
552
+ * Attempts to connect using an existing app key.
553
+ *
554
+ * Returns the SDK if authenticated, or null if the key is not recognized.
555
+ * Call `requestConnection` if null is returned.
556
+ * @param {AppKey} app_key
557
+ * @returns {Promise<any>}
558
+ */
559
+ connected(app_key) {
560
+ _assertClass(app_key, AppKey);
561
+ const ret = wasm.builder_connected(this.__wbg_ptr, app_key.__wbg_ptr);
562
+ return ret;
563
+ }
564
+ }
565
+ if (Symbol.dispose) Builder.prototype[Symbol.dispose] = Builder.prototype.free;
566
+
567
+ const PinnedObjectFinalization = (typeof FinalizationRegistry === 'undefined')
568
+ ? { register: () => {}, unregister: () => {} }
569
+ : new FinalizationRegistry(ptr => wasm.__wbg_pinnedobject_free(ptr >>> 0, 1));
570
+
571
+ export class PinnedObject {
572
+
573
+ static __wrap(ptr) {
574
+ ptr = ptr >>> 0;
575
+ const obj = Object.create(PinnedObject.prototype);
576
+ obj.__wbg_ptr = ptr;
577
+ PinnedObjectFinalization.register(obj, obj.__wbg_ptr, obj);
578
+ return obj;
579
+ }
580
+
581
+ __destroy_into_raw() {
582
+ const ptr = this.__wbg_ptr;
583
+ this.__wbg_ptr = 0;
584
+ PinnedObjectFinalization.unregister(this);
585
+ return ptr;
586
+ }
587
+
588
+ free() {
589
+ const ptr = this.__destroy_into_raw();
590
+ wasm.__wbg_pinnedobject_free(ptr, 0);
591
+ }
592
+ /**
593
+ * Updates the metadata.
594
+ * @param {Uint8Array} metadata
595
+ */
596
+ updateMetadata(metadata) {
597
+ const ptr0 = passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
598
+ const len0 = WASM_VECTOR_LEN;
599
+ const ret = wasm.pinnedobject_updateMetadata(this.__wbg_ptr, ptr0, len0);
600
+ if (ret[1]) {
601
+ throw takeFromExternrefTable0(ret[0]);
602
+ }
603
+ }
604
+ /**
605
+ * Returns the object's ID as a hex string.
606
+ * @returns {string}
607
+ */
608
+ id() {
609
+ let deferred2_0;
610
+ let deferred2_1;
611
+ try {
612
+ const ret = wasm.pinnedobject_id(this.__wbg_ptr);
613
+ var ptr1 = ret[0];
614
+ var len1 = ret[1];
615
+ if (ret[3]) {
616
+ ptr1 = 0; len1 = 0;
617
+ throw takeFromExternrefTable0(ret[2]);
618
+ }
619
+ deferred2_0 = ptr1;
620
+ deferred2_1 = len1;
621
+ return getStringFromWasm0(ptr1, len1);
622
+ } finally {
623
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
624
+ }
625
+ }
626
+ /**
627
+ * Opens a sealed object (JSON) using the provided app key.
628
+ * @param {AppKey} app_key
629
+ * @param {string} sealed_json
630
+ * @returns {PinnedObject}
631
+ */
632
+ static open(app_key, sealed_json) {
633
+ _assertClass(app_key, AppKey);
634
+ const ptr0 = passStringToWasm0(sealed_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
635
+ const len0 = WASM_VECTOR_LEN;
636
+ const ret = wasm.pinnedobject_open(app_key.__wbg_ptr, ptr0, len0);
637
+ if (ret[2]) {
638
+ throw takeFromExternrefTable0(ret[1]);
639
+ }
640
+ return PinnedObject.__wrap(ret[0]);
641
+ }
642
+ /**
643
+ * Seals the object for offline storage, returning JSON.
644
+ * @param {AppKey} app_key
645
+ * @returns {string}
646
+ */
647
+ seal(app_key) {
648
+ let deferred2_0;
649
+ let deferred2_1;
650
+ try {
651
+ _assertClass(app_key, AppKey);
652
+ const ret = wasm.pinnedobject_seal(this.__wbg_ptr, app_key.__wbg_ptr);
653
+ var ptr1 = ret[0];
654
+ var len1 = ret[1];
655
+ if (ret[3]) {
656
+ ptr1 = 0; len1 = 0;
657
+ throw takeFromExternrefTable0(ret[2]);
658
+ }
659
+ deferred2_0 = ptr1;
660
+ deferred2_1 = len1;
661
+ return getStringFromWasm0(ptr1, len1);
662
+ } finally {
663
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
664
+ }
665
+ }
666
+ /**
667
+ * Returns the total size of the object in bytes.
668
+ * @returns {number}
669
+ */
670
+ size() {
671
+ const ret = wasm.pinnedobject_size(this.__wbg_ptr);
672
+ if (ret[2]) {
673
+ throw takeFromExternrefTable0(ret[1]);
674
+ }
675
+ return ret[0];
676
+ }
677
+ /**
678
+ * Returns the metadata as a Uint8Array.
679
+ * @returns {Uint8Array}
680
+ */
681
+ metadata() {
682
+ const ret = wasm.pinnedobject_metadata(this.__wbg_ptr);
683
+ if (ret[2]) {
684
+ throw takeFromExternrefTable0(ret[1]);
685
+ }
686
+ return takeFromExternrefTable0(ret[0]);
687
+ }
688
+ }
689
+ if (Symbol.dispose) PinnedObject.prototype[Symbol.dispose] = PinnedObject.prototype.free;
690
+
691
+ const SDKFinalization = (typeof FinalizationRegistry === 'undefined')
692
+ ? { register: () => {}, unregister: () => {} }
693
+ : new FinalizationRegistry(ptr => wasm.__wbg_sdk_free(ptr >>> 0, 1));
694
+
695
+ export class SDK {
696
+
697
+ static __wrap(ptr) {
698
+ ptr = ptr >>> 0;
699
+ const obj = Object.create(SDK.prototype);
700
+ obj.__wbg_ptr = ptr;
701
+ SDKFinalization.register(obj, obj.__wbg_ptr, obj);
702
+ return obj;
703
+ }
704
+
705
+ __destroy_into_raw() {
706
+ const ptr = this.__wbg_ptr;
707
+ this.__wbg_ptr = 0;
708
+ SDKFinalization.unregister(this);
709
+ return ptr;
710
+ }
711
+
712
+ free() {
713
+ const ptr = this.__destroy_into_raw();
714
+ wasm.__wbg_sdk_free(ptr, 0);
715
+ }
716
+ /**
717
+ * Pins an object to the indexer.
718
+ * @param {PinnedObject} object
719
+ * @returns {Promise<void>}
720
+ */
721
+ pinObject(object) {
722
+ _assertClass(object, PinnedObject);
723
+ const ret = wasm.sdk_pinObject(this.__wbg_ptr, object.__wbg_ptr);
724
+ return ret;
725
+ }
726
+ /**
727
+ * Prunes unused slabs from the indexer.
728
+ * @returns {Promise<void>}
729
+ */
730
+ pruneSlabs() {
731
+ const ret = wasm.sdk_pruneSlabs(this.__wbg_ptr);
732
+ return ret;
733
+ }
734
+ /**
735
+ * Creates a share URL for an object, valid until the given timestamp (ms since epoch).
736
+ * @param {PinnedObject} object
737
+ * @param {number} valid_until_ms
738
+ * @returns {string}
739
+ */
740
+ shareObject(object, valid_until_ms) {
741
+ let deferred2_0;
742
+ let deferred2_1;
743
+ try {
744
+ _assertClass(object, PinnedObject);
745
+ const ret = wasm.sdk_shareObject(this.__wbg_ptr, object.__wbg_ptr, valid_until_ms);
746
+ var ptr1 = ret[0];
747
+ var len1 = ret[1];
748
+ if (ret[3]) {
749
+ ptr1 = 0; len1 = 0;
750
+ throw takeFromExternrefTable0(ret[2]);
751
+ }
752
+ deferred2_0 = ptr1;
753
+ deferred2_1 = len1;
754
+ return getStringFromWasm0(ptr1, len1);
755
+ } finally {
756
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
757
+ }
758
+ }
759
+ /**
760
+ * Deletes an object from the indexer by its hex-encoded key.
761
+ * @param {string} key
762
+ * @returns {Promise<void>}
763
+ */
764
+ deleteObject(key) {
765
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
766
+ const len0 = WASM_VECTOR_LEN;
767
+ const ret = wasm.sdk_deleteObject(this.__wbg_ptr, ptr0, len0);
768
+ return ret;
769
+ }
770
+ /**
771
+ * Returns object events for syncing. Supports cursor-based pagination.
772
+ *
773
+ * `cursor_json` is an optional JSON string: `{"id": "hex...", "after": <epoch_ms>}`
774
+ * `limit` is the maximum number of events to return.
775
+ *
776
+ * Returns a JS array of objects:
777
+ * `[{ id: string, deleted: bool, updatedAt: number, object: PinnedObject | null }]`
778
+ * @param {string | null | undefined} cursor_json
779
+ * @param {number} limit
780
+ * @returns {Promise<any>}
781
+ */
782
+ objectEvents(cursor_json, limit) {
783
+ var ptr0 = isLikeNone(cursor_json) ? 0 : passStringToWasm0(cursor_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
784
+ var len0 = WASM_VECTOR_LEN;
785
+ const ret = wasm.sdk_objectEvents(this.__wbg_ptr, ptr0, len0, limit);
786
+ return ret;
787
+ }
788
+ /**
789
+ * Retrieves a shared object from a signed share URL.
790
+ * Accepts both `https://` and `sia://` schemes.
791
+ * @param {string} share_url
792
+ * @returns {Promise<PinnedObject>}
793
+ */
794
+ sharedObject(share_url) {
795
+ const ptr0 = passStringToWasm0(share_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
796
+ const len0 = WASM_VECTOR_LEN;
797
+ const ret = wasm.sdk_sharedObject(this.__wbg_ptr, ptr0, len0);
798
+ return ret;
799
+ }
800
+ /**
801
+ * Downloads an object with streaming chunks.
802
+ * Fires `on_chunk(bytes)` after each slab is decoded and `on_progress(current, total)` for progress.
803
+ * @param {PinnedObject} object
804
+ * @param {Function} on_chunk
805
+ * @param {Function} on_progress
806
+ * @returns {Promise<void>}
807
+ */
808
+ downloadStreaming(object, on_chunk, on_progress) {
809
+ _assertClass(object, PinnedObject);
810
+ const ret = wasm.sdk_downloadStreaming(this.__wbg_ptr, object.__wbg_ptr, on_chunk, on_progress);
811
+ return ret;
812
+ }
813
+ /**
814
+ * Uploads a Uint8Array with per-shard progress reporting.
815
+ *
816
+ * The `on_progress` callback receives `(current_shards, total_shards)`.
817
+ * @param {Uint8Array} data
818
+ * @param {Function} on_progress
819
+ * @returns {Promise<PinnedObject>}
820
+ */
821
+ uploadWithProgress(data, on_progress) {
822
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
823
+ const len0 = WASM_VECTOR_LEN;
824
+ const ret = wasm.sdk_uploadWithProgress(this.__wbg_ptr, ptr0, len0, on_progress);
825
+ return ret;
826
+ }
827
+ /**
828
+ * Downloads an object's data with per-slab progress reporting.
829
+ *
830
+ * The `on_progress` callback receives `(current_slabs, total_slabs)`.
831
+ * @param {PinnedObject} object
832
+ * @param {Function} on_progress
833
+ * @returns {Promise<Uint8Array>}
834
+ */
835
+ downloadWithProgress(object, on_progress) {
836
+ _assertClass(object, PinnedObject);
837
+ const ret = wasm.sdk_downloadWithProgress(this.__wbg_ptr, object.__wbg_ptr, on_progress);
838
+ return ret;
839
+ }
840
+ /**
841
+ * Updates the metadata of an object already stored in the indexer.
842
+ * @param {PinnedObject} object
843
+ * @returns {Promise<void>}
844
+ */
845
+ updateObjectMetadata(object) {
846
+ _assertClass(object, PinnedObject);
847
+ const ret = wasm.sdk_updateObjectMetadata(this.__wbg_ptr, object.__wbg_ptr);
848
+ return ret;
849
+ }
850
+ /**
851
+ * Returns hosts as a JSON array.
852
+ * @returns {Promise<any>}
853
+ */
854
+ hosts() {
855
+ const ret = wasm.sdk_hosts(this.__wbg_ptr);
856
+ return ret;
857
+ }
858
+ /**
859
+ * Retrieves a pinned object by its hex-encoded key.
860
+ * @param {string} key
861
+ * @returns {Promise<PinnedObject>}
862
+ */
863
+ object(key) {
864
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
865
+ const len0 = WASM_VECTOR_LEN;
866
+ const ret = wasm.sdk_object(this.__wbg_ptr, ptr0, len0);
867
+ return ret;
868
+ }
869
+ /**
870
+ * Uploads a Uint8Array to the Sia network.
871
+ *
872
+ * Returns a PinnedObject containing the metadata needed to download the data.
873
+ * @param {Uint8Array} data
874
+ * @returns {Promise<PinnedObject>}
875
+ */
876
+ upload(data) {
877
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
878
+ const len0 = WASM_VECTOR_LEN;
879
+ const ret = wasm.sdk_upload(this.__wbg_ptr, ptr0, len0);
880
+ return ret;
881
+ }
882
+ /**
883
+ * Returns account information as a JS object.
884
+ * @returns {Promise<any>}
885
+ */
886
+ account() {
887
+ const ret = wasm.sdk_account(this.__wbg_ptr);
888
+ return ret;
889
+ }
890
+ /**
891
+ * Returns the app key used by this SDK instance.
892
+ * @returns {AppKey}
893
+ */
894
+ appKey() {
895
+ const ret = wasm.sdk_appKey(this.__wbg_ptr);
896
+ return AppKey.__wrap(ret);
897
+ }
898
+ /**
899
+ * Downloads an object's data, returning a Uint8Array.
900
+ * @param {PinnedObject} object
901
+ * @returns {Promise<Uint8Array>}
902
+ */
903
+ download(object) {
904
+ _assertClass(object, PinnedObject);
905
+ const ret = wasm.sdk_download(this.__wbg_ptr, object.__wbg_ptr);
906
+ return ret;
907
+ }
908
+ }
909
+ if (Symbol.dispose) SDK.prototype[Symbol.dispose] = SDK.prototype.free;
910
+
911
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
912
+
913
+ async function __wbg_load(module, imports) {
914
+ if (typeof Response === 'function' && module instanceof Response) {
915
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
916
+ try {
917
+ return await WebAssembly.instantiateStreaming(module, imports);
918
+
919
+ } catch (e) {
920
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
921
+
922
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
923
+ 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);
924
+
925
+ } else {
926
+ throw e;
927
+ }
928
+ }
929
+ }
930
+
931
+ const bytes = await module.arrayBuffer();
932
+ return await WebAssembly.instantiate(bytes, imports);
933
+
934
+ } else {
935
+ const instance = await WebAssembly.instantiate(module, imports);
936
+
937
+ if (instance instanceof WebAssembly.Instance) {
938
+ return { instance, module };
939
+
940
+ } else {
941
+ return instance;
942
+ }
943
+ }
944
+ }
945
+
946
+ function __wbg_get_imports() {
947
+ const imports = {};
948
+ imports.wbg = {};
949
+ imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
950
+ const ret = Error(getStringFromWasm0(arg0, arg1));
951
+ return ret;
952
+ };
953
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
954
+ const ret = String(arg1);
955
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
956
+ const len1 = WASM_VECTOR_LEN;
957
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
958
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
959
+ };
960
+ imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
961
+ const v = arg0;
962
+ const ret = typeof(v) === 'boolean' ? v : undefined;
963
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
964
+ };
965
+ imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
966
+ const ret = debugString(arg1);
967
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
968
+ const len1 = WASM_VECTOR_LEN;
969
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
970
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
971
+ };
972
+ imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
973
+ const ret = typeof(arg0) === 'function';
974
+ return ret;
975
+ };
976
+ imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
977
+ const val = arg0;
978
+ const ret = typeof(val) === 'object' && val !== null;
979
+ return ret;
980
+ };
981
+ imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
982
+ const ret = typeof(arg0) === 'string';
983
+ return ret;
984
+ };
985
+ imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
986
+ const ret = arg0 === undefined;
987
+ return ret;
988
+ };
989
+ imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
990
+ const obj = arg1;
991
+ const ret = typeof(obj) === 'string' ? obj : undefined;
992
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
993
+ var len1 = WASM_VECTOR_LEN;
994
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
995
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
996
+ };
997
+ imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
998
+ throw new Error(getStringFromWasm0(arg0, arg1));
999
+ };
1000
+ imports.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9 = function(arg0) {
1001
+ arg0._wbg_cb_unref();
1002
+ };
1003
+ imports.wbg.__wbg_abort_28ad55c5825b004d = function(arg0, arg1) {
1004
+ arg0.abort(arg1);
1005
+ };
1006
+ imports.wbg.__wbg_abort_e7eb059f72f9ed0c = function(arg0) {
1007
+ arg0.abort();
1008
+ };
1009
+ imports.wbg.__wbg_append_b577eb3a177bc0fa = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1010
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1011
+ }, arguments) };
1012
+ imports.wbg.__wbg_arrayBuffer_b375eccb84b4ddf3 = function() { return handleError(function (arg0) {
1013
+ const ret = arg0.arrayBuffer();
1014
+ return ret;
1015
+ }, arguments) };
1016
+ imports.wbg.__wbg_call_525440f72fbfc0ea = function() { return handleError(function (arg0, arg1, arg2) {
1017
+ const ret = arg0.call(arg1, arg2);
1018
+ return ret;
1019
+ }, arguments) };
1020
+ imports.wbg.__wbg_call_e45d2cf9fc925fcf = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1021
+ const ret = arg0.call(arg1, arg2, arg3);
1022
+ return ret;
1023
+ }, arguments) };
1024
+ imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
1025
+ const ret = arg0.call(arg1);
1026
+ return ret;
1027
+ }, arguments) };
1028
+ imports.wbg.__wbg_catch_943836faa5d29bfb = function(arg0, arg1) {
1029
+ const ret = arg0.catch(arg1);
1030
+ return ret;
1031
+ };
1032
+ imports.wbg.__wbg_clearTimeout_42d9ccd50822fd3a = function(arg0) {
1033
+ const ret = clearTimeout(arg0);
1034
+ return ret;
1035
+ };
1036
+ imports.wbg.__wbg_closed_6f894f2f23536b65 = function(arg0) {
1037
+ const ret = arg0.closed;
1038
+ return ret;
1039
+ };
1040
+ imports.wbg.__wbg_createBidirectionalStream_b78a5e42d918e4d2 = function(arg0) {
1041
+ const ret = arg0.createBidirectionalStream();
1042
+ return ret;
1043
+ };
1044
+ imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
1045
+ const ret = arg0.crypto;
1046
+ return ret;
1047
+ };
1048
+ imports.wbg.__wbg_debug_f4b0c59db649db48 = function(arg0) {
1049
+ console.debug(arg0);
1050
+ };
1051
+ imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
1052
+ const ret = arg0.done;
1053
+ return ret;
1054
+ };
1055
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1056
+ let deferred0_0;
1057
+ let deferred0_1;
1058
+ try {
1059
+ deferred0_0 = arg0;
1060
+ deferred0_1 = arg1;
1061
+ console.error(getStringFromWasm0(arg0, arg1));
1062
+ } finally {
1063
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1064
+ }
1065
+ };
1066
+ imports.wbg.__wbg_error_a7f8fbb0523dae15 = function(arg0) {
1067
+ console.error(arg0);
1068
+ };
1069
+ imports.wbg.__wbg_fetch_6bbc32f991730587 = function(arg0) {
1070
+ const ret = fetch(arg0);
1071
+ return ret;
1072
+ };
1073
+ imports.wbg.__wbg_fetch_f8ba0e29a9d6de0d = function(arg0, arg1) {
1074
+ const ret = arg0.fetch(arg1);
1075
+ return ret;
1076
+ };
1077
+ imports.wbg.__wbg_getRandomValues_2a91986308c74a93 = function() { return handleError(function (arg0, arg1) {
1078
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1079
+ }, arguments) };
1080
+ imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
1081
+ arg0.getRandomValues(arg1);
1082
+ }, arguments) };
1083
+ imports.wbg.__wbg_getReader_15e2d3098e32c359 = function(arg0) {
1084
+ const ret = arg0.getReader();
1085
+ return ret;
1086
+ };
1087
+ imports.wbg.__wbg_getTime_14776bfb48a1bff9 = function(arg0) {
1088
+ const ret = arg0.getTime();
1089
+ return ret;
1090
+ };
1091
+ imports.wbg.__wbg_getWriter_c891ce50cc187493 = function() { return handleError(function (arg0) {
1092
+ const ret = arg0.getWriter();
1093
+ return ret;
1094
+ }, arguments) };
1095
+ imports.wbg.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {
1096
+ const ret = Reflect.get(arg0, arg1);
1097
+ return ret;
1098
+ }, arguments) };
1099
+ imports.wbg.__wbg_has_787fafc980c3ccdb = function() { return handleError(function (arg0, arg1) {
1100
+ const ret = Reflect.has(arg0, arg1);
1101
+ return ret;
1102
+ }, arguments) };
1103
+ imports.wbg.__wbg_headers_b87d7eaba61c3278 = function(arg0) {
1104
+ const ret = arg0.headers;
1105
+ return ret;
1106
+ };
1107
+ imports.wbg.__wbg_info_e674a11f4f50cc0c = function(arg0) {
1108
+ console.info(arg0);
1109
+ };
1110
+ imports.wbg.__wbg_instanceof_ReadableStreamDefaultReader_33a4601dd218c69d = function(arg0) {
1111
+ let result;
1112
+ try {
1113
+ result = arg0 instanceof ReadableStreamDefaultReader;
1114
+ } catch (_) {
1115
+ result = false;
1116
+ }
1117
+ const ret = result;
1118
+ return ret;
1119
+ };
1120
+ imports.wbg.__wbg_instanceof_Response_f4f3e87e07f3135c = function(arg0) {
1121
+ let result;
1122
+ try {
1123
+ result = arg0 instanceof Response;
1124
+ } catch (_) {
1125
+ result = false;
1126
+ }
1127
+ const ret = result;
1128
+ return ret;
1129
+ };
1130
+ imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
1131
+ const ret = Symbol.iterator;
1132
+ return ret;
1133
+ };
1134
+ imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
1135
+ const ret = arg0.length;
1136
+ return ret;
1137
+ };
1138
+ imports.wbg.__wbg_log_8cec76766b8c0e33 = function(arg0) {
1139
+ console.log(arg0);
1140
+ };
1141
+ imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
1142
+ const ret = arg0.msCrypto;
1143
+ return ret;
1144
+ };
1145
+ imports.wbg.__wbg_new_0_f9740686d739025c = function() {
1146
+ const ret = new Date();
1147
+ return ret;
1148
+ };
1149
+ imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
1150
+ const ret = new Object();
1151
+ return ret;
1152
+ };
1153
+ imports.wbg.__wbg_new_2531773dac38ebb3 = function() { return handleError(function () {
1154
+ const ret = new AbortController();
1155
+ return ret;
1156
+ }, arguments) };
1157
+ imports.wbg.__wbg_new_3c3d849046688a66 = function(arg0, arg1) {
1158
+ try {
1159
+ var state0 = {a: arg0, b: arg1};
1160
+ var cb0 = (arg0, arg1) => {
1161
+ const a = state0.a;
1162
+ state0.a = 0;
1163
+ try {
1164
+ return wasm_bindgen__convert__closures_____invoke__hf411941149947cdb(a, state0.b, arg0, arg1);
1165
+ } finally {
1166
+ state0.a = a;
1167
+ }
1168
+ };
1169
+ const ret = new Promise(cb0);
1170
+ return ret;
1171
+ } finally {
1172
+ state0.a = state0.b = 0;
1173
+ }
1174
+ };
1175
+ imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
1176
+ const ret = new Uint8Array(arg0);
1177
+ return ret;
1178
+ };
1179
+ imports.wbg.__wbg_new_68651c719dcda04e = function() {
1180
+ const ret = new Map();
1181
+ return ret;
1182
+ };
1183
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1184
+ const ret = new Error();
1185
+ return ret;
1186
+ };
1187
+ imports.wbg.__wbg_new_9edf9838a2def39c = function() { return handleError(function () {
1188
+ const ret = new Headers();
1189
+ return ret;
1190
+ }, arguments) };
1191
+ imports.wbg.__wbg_new_e17d9f43105b08be = function() {
1192
+ const ret = new Array();
1193
+ return ret;
1194
+ };
1195
+ imports.wbg.__wbg_new_from_slice_92f4d78ca282a2d2 = function(arg0, arg1) {
1196
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1197
+ return ret;
1198
+ };
1199
+ imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {
1200
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1201
+ return ret;
1202
+ };
1203
+ imports.wbg.__wbg_new_with_length_01aa0dc35aa13543 = function(arg0) {
1204
+ const ret = new Uint8Array(arg0 >>> 0);
1205
+ return ret;
1206
+ };
1207
+ imports.wbg.__wbg_new_with_options_9965f8e85fa9c22f = function() { return handleError(function (arg0, arg1, arg2) {
1208
+ const ret = new WebTransport(getStringFromWasm0(arg0, arg1), arg2);
1209
+ return ret;
1210
+ }, arguments) };
1211
+ imports.wbg.__wbg_new_with_str_and_init_0ae7728b6ec367b1 = function() { return handleError(function (arg0, arg1, arg2) {
1212
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1213
+ return ret;
1214
+ }, arguments) };
1215
+ imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() { return handleError(function (arg0) {
1216
+ const ret = arg0.next();
1217
+ return ret;
1218
+ }, arguments) };
1219
+ imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
1220
+ const ret = arg0.next;
1221
+ return ret;
1222
+ };
1223
+ imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
1224
+ const ret = arg0.node;
1225
+ return ret;
1226
+ };
1227
+ imports.wbg.__wbg_now_793306c526e2e3b6 = function() {
1228
+ const ret = Date.now();
1229
+ return ret;
1230
+ };
1231
+ imports.wbg.__wbg_pinnedobject_new = function(arg0) {
1232
+ const ret = PinnedObject.__wrap(arg0);
1233
+ return ret;
1234
+ };
1235
+ imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
1236
+ const ret = arg0.process;
1237
+ return ret;
1238
+ };
1239
+ imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
1240
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1241
+ };
1242
+ imports.wbg.__wbg_push_df81a39d04db858c = function(arg0, arg1) {
1243
+ const ret = arg0.push(arg1);
1244
+ return ret;
1245
+ };
1246
+ imports.wbg.__wbg_queueMicrotask_34d692c25c47d05b = function(arg0) {
1247
+ const ret = arg0.queueMicrotask;
1248
+ return ret;
1249
+ };
1250
+ imports.wbg.__wbg_queueMicrotask_9d76cacb20c84d58 = function(arg0) {
1251
+ queueMicrotask(arg0);
1252
+ };
1253
+ imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
1254
+ arg0.randomFillSync(arg1);
1255
+ }, arguments) };
1256
+ imports.wbg.__wbg_read_48f1593df542f968 = function(arg0) {
1257
+ const ret = arg0.read();
1258
+ return ret;
1259
+ };
1260
+ imports.wbg.__wbg_readable_2e1f7c2e233ad58e = function(arg0) {
1261
+ const ret = arg0.readable;
1262
+ return ret;
1263
+ };
1264
+ imports.wbg.__wbg_ready_310519d62d77aaae = function(arg0) {
1265
+ const ret = arg0.ready;
1266
+ return ret;
1267
+ };
1268
+ imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
1269
+ const ret = module.require;
1270
+ return ret;
1271
+ }, arguments) };
1272
+ imports.wbg.__wbg_resolve_caf97c30b83f7053 = function(arg0) {
1273
+ const ret = Promise.resolve(arg0);
1274
+ return ret;
1275
+ };
1276
+ imports.wbg.__wbg_sdk_new = function(arg0) {
1277
+ const ret = SDK.__wrap(arg0);
1278
+ return ret;
1279
+ };
1280
+ imports.wbg.__wbg_setTimeout_4ec014681668a581 = function(arg0, arg1) {
1281
+ const ret = setTimeout(arg0, arg1);
1282
+ return ret;
1283
+ };
1284
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1285
+ arg0[arg1] = arg2;
1286
+ };
1287
+ imports.wbg.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
1288
+ const ret = arg0.set(arg1, arg2);
1289
+ return ret;
1290
+ };
1291
+ imports.wbg.__wbg_set_body_3c365989753d61f4 = function(arg0, arg1) {
1292
+ arg0.body = arg1;
1293
+ };
1294
+ imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
1295
+ arg0[arg1 >>> 0] = arg2;
1296
+ };
1297
+ imports.wbg.__wbg_set_c2abbebe8b9ebee1 = function() { return handleError(function (arg0, arg1, arg2) {
1298
+ const ret = Reflect.set(arg0, arg1, arg2);
1299
+ return ret;
1300
+ }, arguments) };
1301
+ imports.wbg.__wbg_set_cache_2f9deb19b92b81e3 = function(arg0, arg1) {
1302
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
1303
+ };
1304
+ imports.wbg.__wbg_set_credentials_f621cd2d85c0c228 = function(arg0, arg1) {
1305
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1306
+ };
1307
+ imports.wbg.__wbg_set_headers_6926da238cd32ee4 = function(arg0, arg1) {
1308
+ arg0.headers = arg1;
1309
+ };
1310
+ imports.wbg.__wbg_set_method_c02d8cbbe204ac2d = function(arg0, arg1, arg2) {
1311
+ arg0.method = getStringFromWasm0(arg1, arg2);
1312
+ };
1313
+ imports.wbg.__wbg_set_mode_52ef73cfa79639cb = function(arg0, arg1) {
1314
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1315
+ };
1316
+ imports.wbg.__wbg_set_signal_dda2cf7ccb6bee0f = function(arg0, arg1) {
1317
+ arg0.signal = arg1;
1318
+ };
1319
+ imports.wbg.__wbg_signal_4db5aa055bf9eb9a = function(arg0) {
1320
+ const ret = arg0.signal;
1321
+ return ret;
1322
+ };
1323
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1324
+ const ret = arg1.stack;
1325
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1326
+ const len1 = WASM_VECTOR_LEN;
1327
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1328
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1329
+ };
1330
+ imports.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {
1331
+ const ret = typeof global === 'undefined' ? null : global;
1332
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1333
+ };
1334
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {
1335
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1336
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1337
+ };
1338
+ imports.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {
1339
+ const ret = typeof self === 'undefined' ? null : self;
1340
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1341
+ };
1342
+ imports.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {
1343
+ const ret = typeof window === 'undefined' ? null : window;
1344
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1345
+ };
1346
+ imports.wbg.__wbg_status_de7eed5a7a5bfd5d = function(arg0) {
1347
+ const ret = arg0.status;
1348
+ return ret;
1349
+ };
1350
+ imports.wbg.__wbg_stringify_b5fb28f6465d9c3e = function() { return handleError(function (arg0) {
1351
+ const ret = JSON.stringify(arg0);
1352
+ return ret;
1353
+ }, arguments) };
1354
+ imports.wbg.__wbg_subarray_480600f3d6a9f26c = function(arg0, arg1, arg2) {
1355
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1356
+ return ret;
1357
+ };
1358
+ imports.wbg.__wbg_text_dc33c15c17bdfb52 = function() { return handleError(function (arg0) {
1359
+ const ret = arg0.text();
1360
+ return ret;
1361
+ }, arguments) };
1362
+ imports.wbg.__wbg_then_4f46f6544e6b4a28 = function(arg0, arg1) {
1363
+ const ret = arg0.then(arg1);
1364
+ return ret;
1365
+ };
1366
+ imports.wbg.__wbg_then_70d05cf780a18d77 = function(arg0, arg1, arg2) {
1367
+ const ret = arg0.then(arg1, arg2);
1368
+ return ret;
1369
+ };
1370
+ imports.wbg.__wbg_url_b36d2a5008eb056f = function(arg0, arg1) {
1371
+ const ret = arg1.url;
1372
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1373
+ const len1 = WASM_VECTOR_LEN;
1374
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1375
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1376
+ };
1377
+ imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
1378
+ const ret = arg0.value;
1379
+ return ret;
1380
+ };
1381
+ imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
1382
+ const ret = arg0.versions;
1383
+ return ret;
1384
+ };
1385
+ imports.wbg.__wbg_warn_1d74dddbe2fd1dbb = function(arg0) {
1386
+ console.warn(arg0);
1387
+ };
1388
+ imports.wbg.__wbg_writable_668b29eaca211d21 = function(arg0) {
1389
+ const ret = arg0.writable;
1390
+ return ret;
1391
+ };
1392
+ imports.wbg.__wbg_write_5f693b62e780062e = function(arg0, arg1) {
1393
+ const ret = arg0.write(arg1);
1394
+ return ret;
1395
+ };
1396
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1397
+ // Cast intrinsic for `Ref(String) -> Externref`.
1398
+ const ret = getStringFromWasm0(arg0, arg1);
1399
+ return ret;
1400
+ };
1401
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1402
+ // Cast intrinsic for `U64 -> Externref`.
1403
+ const ret = BigInt.asUintN(64, arg0);
1404
+ return ret;
1405
+ };
1406
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
1407
+ // Cast intrinsic for `I64 -> Externref`.
1408
+ const ret = arg0;
1409
+ return ret;
1410
+ };
1411
+ imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
1412
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1413
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1414
+ return ret;
1415
+ };
1416
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1417
+ // Cast intrinsic for `F64 -> Externref`.
1418
+ const ret = arg0;
1419
+ return ret;
1420
+ };
1421
+ imports.wbg.__wbindgen_cast_ee78966ed3f1c999 = function(arg0, arg1) {
1422
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 579, function: Function { arguments: [Externref], shim_idx: 580, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1423
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0c75a1a3e92aa554, wasm_bindgen__convert__closures_____invoke__h6280da76965e1dcd);
1424
+ return ret;
1425
+ };
1426
+ imports.wbg.__wbindgen_cast_f12d750ab47090bd = function(arg0, arg1) {
1427
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 556, function: Function { arguments: [], shim_idx: 557, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1428
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he5035197fb444b8b, wasm_bindgen__convert__closures_____invoke__h660d0571ab542b96);
1429
+ return ret;
1430
+ };
1431
+ imports.wbg.__wbindgen_init_externref_table = function() {
1432
+ const table = wasm.__wbindgen_externrefs;
1433
+ const offset = table.grow(4);
1434
+ table.set(0, undefined);
1435
+ table.set(offset + 0, undefined);
1436
+ table.set(offset + 1, null);
1437
+ table.set(offset + 2, true);
1438
+ table.set(offset + 3, false);
1439
+ ;
1440
+ };
1441
+ imports['env'] = __wbg_star0;
1442
+
1443
+ return imports;
1444
+ }
1445
+
1446
+ function __wbg_finalize_init(instance, module) {
1447
+ wasm = instance.exports;
1448
+ __wbg_init.__wbindgen_wasm_module = module;
1449
+ cachedDataViewMemory0 = null;
1450
+ cachedUint8ArrayMemory0 = null;
1451
+
1452
+
1453
+ wasm.__wbindgen_start();
1454
+ return wasm;
1455
+ }
1456
+
1457
+ function initSync(module) {
1458
+ if (wasm !== undefined) return wasm;
1459
+
1460
+
1461
+ if (typeof module !== 'undefined') {
1462
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1463
+ ({module} = module)
1464
+ } else {
1465
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1466
+ }
1467
+ }
1468
+
1469
+ const imports = __wbg_get_imports();
1470
+
1471
+ if (!(module instanceof WebAssembly.Module)) {
1472
+ module = new WebAssembly.Module(module);
1473
+ }
1474
+
1475
+ const instance = new WebAssembly.Instance(module, imports);
1476
+
1477
+ return __wbg_finalize_init(instance, module);
1478
+ }
1479
+
1480
+ async function __wbg_init(module_or_path) {
1481
+ if (wasm !== undefined) return wasm;
1482
+
1483
+
1484
+ if (typeof module_or_path !== 'undefined') {
1485
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1486
+ ({module_or_path} = module_or_path)
1487
+ } else {
1488
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1489
+ }
1490
+ }
1491
+
1492
+ if (typeof module_or_path === 'undefined') {
1493
+ module_or_path = new URL('indexd_wasm_bg.wasm', import.meta.url);
1494
+ }
1495
+ const imports = __wbg_get_imports();
1496
+
1497
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1498
+ module_or_path = fetch(module_or_path);
1499
+ }
1500
+
1501
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1502
+
1503
+ return __wbg_finalize_init(instance, module);
1504
+ }
1505
+
1506
+ export { initSync };
1507
+ export default __wbg_init;