@dreamlake/dreamdb 0.1.2 → 0.2.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.
- package/dreamdb.d.ts +111 -0
- package/dreamdb.js +9 -0
- package/dreamdb_bg.js +783 -0
- package/dreamdb_bg.wasm +0 -0
- package/index.d.ts +16 -0
- package/index.js +6 -0
- package/package.json +18 -28
- package/README.md +0 -62
- package/dist/index.cjs +0 -2290
- package/dist/index.d.cts +0 -502
- package/dist/index.d.ts +0 -502
- package/dist/index.js +0 -2233
package/dreamdb_bg.js
ADDED
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `fetch`-backed backend rooted at a base URL.
|
|
3
|
+
*/
|
|
4
|
+
export class S3Backend {
|
|
5
|
+
__destroy_into_raw() {
|
|
6
|
+
const ptr = this.__wbg_ptr;
|
|
7
|
+
this.__wbg_ptr = 0;
|
|
8
|
+
S3BackendFinalization.unregister(this);
|
|
9
|
+
return ptr;
|
|
10
|
+
}
|
|
11
|
+
free() {
|
|
12
|
+
const ptr = this.__destroy_into_raw();
|
|
13
|
+
wasm.__wbg_s3backend_free(ptr, 0);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Fetch `path` (relative to the base URL) and resolve to its bytes.
|
|
17
|
+
* `opts.noCache` is accepted for API compatibility (currently a no-op:
|
|
18
|
+
* content is hash-addressed; refs are read fresh each page load anyway).
|
|
19
|
+
* @param {string} path
|
|
20
|
+
* @param {any} _opts
|
|
21
|
+
* @returns {Promise<Uint8Array>}
|
|
22
|
+
*/
|
|
23
|
+
get(path, _opts) {
|
|
24
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
25
|
+
const len0 = WASM_VECTOR_LEN;
|
|
26
|
+
const ret = wasm.s3backend_get(this.__wbg_ptr, ptr0, len0, _opts);
|
|
27
|
+
return ret;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* List object paths under `prefix`. Stub (returns empty); the current
|
|
31
|
+
* consumer read paths don't require listing.
|
|
32
|
+
* @param {string} _prefix
|
|
33
|
+
* @returns {Promise<Array<any>>}
|
|
34
|
+
*/
|
|
35
|
+
list(_prefix) {
|
|
36
|
+
const ptr0 = passStringToWasm0(_prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
37
|
+
const len0 = WASM_VECTOR_LEN;
|
|
38
|
+
const ret = wasm.s3backend_list(this.__wbg_ptr, ptr0, len0);
|
|
39
|
+
return ret;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Construct rooted at `base_url` (trailing slash trimmed).
|
|
43
|
+
* @param {string} base_url
|
|
44
|
+
*/
|
|
45
|
+
constructor(base_url) {
|
|
46
|
+
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
47
|
+
const len0 = WASM_VECTOR_LEN;
|
|
48
|
+
const ret = wasm.s3backend_new(ptr0, len0);
|
|
49
|
+
this.__wbg_ptr = ret;
|
|
50
|
+
S3BackendFinalization.register(this, this.__wbg_ptr, this);
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (Symbol.dispose) S3Backend.prototype[Symbol.dispose] = S3Backend.prototype.free;
|
|
55
|
+
|
|
56
|
+
export class Space {
|
|
57
|
+
static __wrap(ptr) {
|
|
58
|
+
const obj = Object.create(Space.prototype);
|
|
59
|
+
obj.__wbg_ptr = ptr;
|
|
60
|
+
SpaceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
__destroy_into_raw() {
|
|
64
|
+
const ptr = this.__wbg_ptr;
|
|
65
|
+
this.__wbg_ptr = 0;
|
|
66
|
+
SpaceFinalization.unregister(this);
|
|
67
|
+
return ptr;
|
|
68
|
+
}
|
|
69
|
+
free() {
|
|
70
|
+
const ptr = this.__destroy_into_raw();
|
|
71
|
+
wasm.__wbg_space_free(ptr, 0);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The base URL objects are fetched relative to (consumers build their own
|
|
75
|
+
* object URLs from this — e.g. `dreamdb-demo`'s track readers).
|
|
76
|
+
* @returns {string}
|
|
77
|
+
*/
|
|
78
|
+
get connectorBase() {
|
|
79
|
+
let deferred1_0;
|
|
80
|
+
let deferred1_1;
|
|
81
|
+
try {
|
|
82
|
+
const ret = wasm.space_connectorBase(this.__wbg_ptr);
|
|
83
|
+
deferred1_0 = ret[0];
|
|
84
|
+
deferred1_1 = ret[1];
|
|
85
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
86
|
+
} finally {
|
|
87
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Open a Space from a `.../refs/<name>` or `.../manifests/<hash>` URI,
|
|
92
|
+
* resolving the ref (if any) and loading the manifest. If `backend` is
|
|
93
|
+
* provided it handles IO (relative paths); otherwise a direct-fetch
|
|
94
|
+
* connector rooted at the parsed base URL is used (the `dreamdb-demo`
|
|
95
|
+
* no-backend path).
|
|
96
|
+
* @param {string} uri
|
|
97
|
+
* @param {any} backend
|
|
98
|
+
* @returns {Promise<Space>}
|
|
99
|
+
*/
|
|
100
|
+
static fromUri(uri, backend) {
|
|
101
|
+
const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
102
|
+
const len0 = WASM_VECTOR_LEN;
|
|
103
|
+
const ret = wasm.space_fromUri(ptr0, len0, backend);
|
|
104
|
+
return ret;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Walk the manifest DAG from HEAD, up to `max_depth` entries. Each entry:
|
|
108
|
+
* `{ manifestHash, ts, writer, tracks: [{modality, address}] }`.
|
|
109
|
+
* @param {number | null} [max_depth]
|
|
110
|
+
* @returns {Promise<Array<any>>}
|
|
111
|
+
*/
|
|
112
|
+
history(max_depth) {
|
|
113
|
+
const ret = wasm.space_history(this.__wbg_ptr, isLikeNone(max_depth) ? Number.MAX_SAFE_INTEGER : (max_depth) >>> 0);
|
|
114
|
+
return ret;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The manifest's base32 multihash.
|
|
118
|
+
* @returns {string}
|
|
119
|
+
*/
|
|
120
|
+
get manifestHash() {
|
|
121
|
+
let deferred1_0;
|
|
122
|
+
let deferred1_1;
|
|
123
|
+
try {
|
|
124
|
+
const ret = wasm.space_manifestHash(this.__wbg_ptr);
|
|
125
|
+
deferred1_0 = ret[0];
|
|
126
|
+
deferred1_1 = ret[1];
|
|
127
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
128
|
+
} finally {
|
|
129
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Top-K cosine vector search over an embedding `field`. `opts` may be a
|
|
134
|
+
* number (topK) or `{ topK?, probeCount? }`. Returns `[{ anchor, score }]`
|
|
135
|
+
* sorted by score descending — the shape dreamdb-ts's `queryVector` yields.
|
|
136
|
+
*
|
|
137
|
+
* Delegates to the real (tested) `dreamdb-dataset` query path: ADC cull +
|
|
138
|
+
* two-pass rerank + HotShard merge + tombstone suppression.
|
|
139
|
+
* @param {string} field
|
|
140
|
+
* @param {Float32Array} query
|
|
141
|
+
* @param {any} opts
|
|
142
|
+
* @returns {Promise<Array<any>>}
|
|
143
|
+
*/
|
|
144
|
+
queryVector(field, query, opts) {
|
|
145
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
146
|
+
const len0 = WASM_VECTOR_LEN;
|
|
147
|
+
const ptr1 = passArrayF32ToWasm0(query, wasm.__wbindgen_malloc);
|
|
148
|
+
const len1 = WASM_VECTOR_LEN;
|
|
149
|
+
const ret = wasm.space_queryVector(this.__wbg_ptr, ptr0, len0, ptr1, len1, opts);
|
|
150
|
+
return ret;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Read a scalar track as a `Map<anchorString, value>`. Single-anchor
|
|
154
|
+
* entries resolve from the track index; multi-anchor entries fetch (and
|
|
155
|
+
* de-dupe) their bucket and roaring-decode the anchor set.
|
|
156
|
+
* @param {any} track
|
|
157
|
+
* @param {any} _opts
|
|
158
|
+
* @returns {Promise<Map<any, any>>}
|
|
159
|
+
*/
|
|
160
|
+
readScalarColumn(track, _opts) {
|
|
161
|
+
const ret = wasm.space_readScalarColumn(this.__wbg_ptr, track, _opts);
|
|
162
|
+
return ret;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Fetch a track object and return its `object_index` (array of CBOR
|
|
166
|
+
* entries). Inline indexes only — paged indexes are not resolved (matching
|
|
167
|
+
* dreamdb-ts, which also doesn't support them on this path).
|
|
168
|
+
* @param {any} track
|
|
169
|
+
* @returns {Promise<Array<any>>}
|
|
170
|
+
*/
|
|
171
|
+
resolveObjectIndex(track) {
|
|
172
|
+
const ret = wasm.space_resolveObjectIndex(this.__wbg_ptr, track);
|
|
173
|
+
return ret;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Base32 hash of the manifest's first timeline.
|
|
177
|
+
* @returns {string}
|
|
178
|
+
*/
|
|
179
|
+
timelineId() {
|
|
180
|
+
let deferred2_0;
|
|
181
|
+
let deferred2_1;
|
|
182
|
+
try {
|
|
183
|
+
const ret = wasm.space_timelineId(this.__wbg_ptr);
|
|
184
|
+
var ptr1 = ret[0];
|
|
185
|
+
var len1 = ret[1];
|
|
186
|
+
if (ret[3]) {
|
|
187
|
+
ptr1 = 0; len1 = 0;
|
|
188
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
189
|
+
}
|
|
190
|
+
deferred2_0 = ptr1;
|
|
191
|
+
deferred2_1 = len1;
|
|
192
|
+
return getStringFromWasm0(ptr1, len1);
|
|
193
|
+
} finally {
|
|
194
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Find a track by its resolved `key` or by `modality`.
|
|
199
|
+
* @param {string} key_or_modality
|
|
200
|
+
* @returns {any}
|
|
201
|
+
*/
|
|
202
|
+
trackFor(key_or_modality) {
|
|
203
|
+
const ptr0 = passStringToWasm0(key_or_modality, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
204
|
+
const len0 = WASM_VECTOR_LEN;
|
|
205
|
+
const ret = wasm.space_trackFor(this.__wbg_ptr, ptr0, len0);
|
|
206
|
+
return ret;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* List resolved tracks from this manifest.
|
|
210
|
+
* @returns {Array<any>}
|
|
211
|
+
*/
|
|
212
|
+
tracks() {
|
|
213
|
+
const ret = wasm.space_tracks(this.__wbg_ptr);
|
|
214
|
+
return ret;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (Symbol.dispose) Space.prototype[Symbol.dispose] = Space.prototype.free;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Encode arbitrary bytes as lowercase RFC-4648 base32 (no padding).
|
|
221
|
+
*
|
|
222
|
+
* Byte-identical to `dreamdb-ts`'s `bytesToBase32` (alphabet
|
|
223
|
+
* `abcdefghijklmnopqrstuvwxyz234567`) and to `dreamdb_core`'s multihash
|
|
224
|
+
* `to_base32`, which is how object addresses are spelled on disk.
|
|
225
|
+
* @param {Uint8Array} bytes
|
|
226
|
+
* @returns {string}
|
|
227
|
+
*/
|
|
228
|
+
export function bytesToBase32(bytes) {
|
|
229
|
+
let deferred2_0;
|
|
230
|
+
let deferred2_1;
|
|
231
|
+
try {
|
|
232
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
233
|
+
const len0 = WASM_VECTOR_LEN;
|
|
234
|
+
const ret = wasm.bytesToBase32(ptr0, len0);
|
|
235
|
+
deferred2_0 = ret[0];
|
|
236
|
+
deferred2_1 = ret[1];
|
|
237
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
238
|
+
} finally {
|
|
239
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Decode a single CBOR value from `bytes` into its JS representation.
|
|
245
|
+
* @param {Uint8Array} bytes
|
|
246
|
+
* @returns {any}
|
|
247
|
+
*/
|
|
248
|
+
export function decodeCbor(bytes) {
|
|
249
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
250
|
+
const len0 = WASM_VECTOR_LEN;
|
|
251
|
+
const ret = wasm.decodeCbor(ptr0, len0);
|
|
252
|
+
if (ret[2]) {
|
|
253
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
254
|
+
}
|
|
255
|
+
return takeFromExternrefTable0(ret[0]);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Package version — useful for consumers to confirm which build is loaded.
|
|
260
|
+
* @returns {string}
|
|
261
|
+
*/
|
|
262
|
+
export function version() {
|
|
263
|
+
let deferred1_0;
|
|
264
|
+
let deferred1_1;
|
|
265
|
+
try {
|
|
266
|
+
const ret = wasm.version();
|
|
267
|
+
deferred1_0 = ret[0];
|
|
268
|
+
deferred1_1 = ret[1];
|
|
269
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
270
|
+
} finally {
|
|
271
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The all-zero spatial-key path segment used for non-spatial (fragment) object
|
|
277
|
+
* addresses. Matches `dreamdb-ts`'s `ZERO_SPATIAL_KEY` constant exactly.
|
|
278
|
+
* @returns {string}
|
|
279
|
+
*/
|
|
280
|
+
export function zeroSpatialKey() {
|
|
281
|
+
let deferred1_0;
|
|
282
|
+
let deferred1_1;
|
|
283
|
+
try {
|
|
284
|
+
const ret = wasm.zeroSpatialKey();
|
|
285
|
+
deferred1_0 = ret[0];
|
|
286
|
+
deferred1_1 = ret[1];
|
|
287
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
288
|
+
} finally {
|
|
289
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
export function __wbg_Error_bce6d499ff0a4aff(arg0, arg1) {
|
|
293
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
294
|
+
return ret;
|
|
295
|
+
}
|
|
296
|
+
export function __wbg___wbindgen_debug_string_edece8177ad01481(arg0, arg1) {
|
|
297
|
+
const ret = debugString(arg1);
|
|
298
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
299
|
+
const len1 = WASM_VECTOR_LEN;
|
|
300
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
301
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
302
|
+
}
|
|
303
|
+
export function __wbg___wbindgen_is_function_5cd60d5cf78b4eef(arg0) {
|
|
304
|
+
const ret = typeof(arg0) === 'function';
|
|
305
|
+
return ret;
|
|
306
|
+
}
|
|
307
|
+
export function __wbg___wbindgen_is_null_2042690d351e14f0(arg0) {
|
|
308
|
+
const ret = arg0 === null;
|
|
309
|
+
return ret;
|
|
310
|
+
}
|
|
311
|
+
export function __wbg___wbindgen_is_undefined_35bb9f4c7fd651d5(arg0) {
|
|
312
|
+
const ret = arg0 === undefined;
|
|
313
|
+
return ret;
|
|
314
|
+
}
|
|
315
|
+
export function __wbg___wbindgen_number_get_f73a1244370fcc2c(arg0, arg1) {
|
|
316
|
+
const obj = arg1;
|
|
317
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
318
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
319
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
320
|
+
}
|
|
321
|
+
export function __wbg___wbindgen_string_get_d109740c0d18f4d7(arg0, arg1) {
|
|
322
|
+
const obj = arg1;
|
|
323
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
324
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
325
|
+
var len1 = WASM_VECTOR_LEN;
|
|
326
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
327
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
328
|
+
}
|
|
329
|
+
export function __wbg___wbindgen_throw_9c31b086c2b26051(arg0, arg1) {
|
|
330
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
331
|
+
}
|
|
332
|
+
export function __wbg__wbg_cb_unref_3fa391f3fcdb55f8(arg0) {
|
|
333
|
+
arg0._wbg_cb_unref();
|
|
334
|
+
}
|
|
335
|
+
export function __wbg_arrayBuffer_cb5d4748b5f3cad5() { return handleError(function (arg0) {
|
|
336
|
+
const ret = arg0.arrayBuffer();
|
|
337
|
+
return ret;
|
|
338
|
+
}, arguments); }
|
|
339
|
+
export function __wbg_call_dfde26266607c996() { return handleError(function (arg0, arg1, arg2) {
|
|
340
|
+
const ret = arg0.call(arg1, arg2);
|
|
341
|
+
return ret;
|
|
342
|
+
}, arguments); }
|
|
343
|
+
export function __wbg_get_dcf82ab8aad1a593() { return handleError(function (arg0, arg1) {
|
|
344
|
+
const ret = Reflect.get(arg0, arg1);
|
|
345
|
+
return ret;
|
|
346
|
+
}, arguments); }
|
|
347
|
+
export function __wbg_get_unchecked_1dfe6d05ad91d9b7(arg0, arg1) {
|
|
348
|
+
const ret = arg0[arg1 >>> 0];
|
|
349
|
+
return ret;
|
|
350
|
+
}
|
|
351
|
+
export function __wbg_instanceof_Promise_09012cfa9708520a(arg0) {
|
|
352
|
+
let result;
|
|
353
|
+
try {
|
|
354
|
+
result = arg0 instanceof Promise;
|
|
355
|
+
} catch (_) {
|
|
356
|
+
result = false;
|
|
357
|
+
}
|
|
358
|
+
const ret = result;
|
|
359
|
+
return ret;
|
|
360
|
+
}
|
|
361
|
+
export function __wbg_instanceof_Response_ecfc823e8fb354e2(arg0) {
|
|
362
|
+
let result;
|
|
363
|
+
try {
|
|
364
|
+
result = arg0 instanceof Response;
|
|
365
|
+
} catch (_) {
|
|
366
|
+
result = false;
|
|
367
|
+
}
|
|
368
|
+
const ret = result;
|
|
369
|
+
return ret;
|
|
370
|
+
}
|
|
371
|
+
export function __wbg_instanceof_Uint8Array_abd07d4bd221d50b(arg0) {
|
|
372
|
+
let result;
|
|
373
|
+
try {
|
|
374
|
+
result = arg0 instanceof Uint8Array;
|
|
375
|
+
} catch (_) {
|
|
376
|
+
result = false;
|
|
377
|
+
}
|
|
378
|
+
const ret = result;
|
|
379
|
+
return ret;
|
|
380
|
+
}
|
|
381
|
+
export function __wbg_isArray_94898ed3aad6947b(arg0) {
|
|
382
|
+
const ret = Array.isArray(arg0);
|
|
383
|
+
return ret;
|
|
384
|
+
}
|
|
385
|
+
export function __wbg_length_2591a0f4f659a55c(arg0) {
|
|
386
|
+
const ret = arg0.length;
|
|
387
|
+
return ret;
|
|
388
|
+
}
|
|
389
|
+
export function __wbg_length_56fcd3e2b7e0299d(arg0) {
|
|
390
|
+
const ret = arg0.length;
|
|
391
|
+
return ret;
|
|
392
|
+
}
|
|
393
|
+
export function __wbg_new_02d162bc6cf02f60() {
|
|
394
|
+
const ret = new Object();
|
|
395
|
+
return ret;
|
|
396
|
+
}
|
|
397
|
+
export function __wbg_new_070df68d66325372() {
|
|
398
|
+
const ret = new Map();
|
|
399
|
+
return ret;
|
|
400
|
+
}
|
|
401
|
+
export function __wbg_new_310879b66b6e95e1() {
|
|
402
|
+
const ret = new Array();
|
|
403
|
+
return ret;
|
|
404
|
+
}
|
|
405
|
+
export function __wbg_new_7ddec6de44ff8f5d(arg0) {
|
|
406
|
+
const ret = new Uint8Array(arg0);
|
|
407
|
+
return ret;
|
|
408
|
+
}
|
|
409
|
+
export function __wbg_new_from_slice_269e35316ed2d061(arg0, arg1) {
|
|
410
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
411
|
+
return ret;
|
|
412
|
+
}
|
|
413
|
+
export function __wbg_new_typed_c072c4ce9a2a0cdf(arg0, arg1) {
|
|
414
|
+
try {
|
|
415
|
+
var state0 = {a: arg0, b: arg1};
|
|
416
|
+
var cb0 = (arg0, arg1) => {
|
|
417
|
+
const a = state0.a;
|
|
418
|
+
state0.a = 0;
|
|
419
|
+
try {
|
|
420
|
+
return wasm_bindgen_f7c54996eb9137d9___convert__closures_____invoke___js_sys_ac40961855821e8e___Function_fn_wasm_bindgen_f7c54996eb9137d9___JsValue_____wasm_bindgen_f7c54996eb9137d9___sys__Undefined___js_sys_ac40961855821e8e___Function_fn_wasm_bindgen_f7c54996eb9137d9___JsValue_____wasm_bindgen_f7c54996eb9137d9___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
421
|
+
} finally {
|
|
422
|
+
state0.a = a;
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
const ret = new Promise(cb0);
|
|
426
|
+
return ret;
|
|
427
|
+
} finally {
|
|
428
|
+
state0.a = 0;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
export function __wbg_new_with_str_and_init_ffe9977c986ea039() { return handleError(function (arg0, arg1, arg2) {
|
|
432
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
433
|
+
return ret;
|
|
434
|
+
}, arguments); }
|
|
435
|
+
export function __wbg_ok_556a55299dd238ba(arg0) {
|
|
436
|
+
const ret = arg0.ok;
|
|
437
|
+
return ret;
|
|
438
|
+
}
|
|
439
|
+
export function __wbg_prototypesetcall_5f9bdc8d75e07276(arg0, arg1, arg2) {
|
|
440
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
441
|
+
}
|
|
442
|
+
export function __wbg_push_b77c476b01548d0a(arg0, arg1) {
|
|
443
|
+
const ret = arg0.push(arg1);
|
|
444
|
+
return ret;
|
|
445
|
+
}
|
|
446
|
+
export function __wbg_queueMicrotask_78d584b53af520f5(arg0) {
|
|
447
|
+
const ret = arg0.queueMicrotask;
|
|
448
|
+
return ret;
|
|
449
|
+
}
|
|
450
|
+
export function __wbg_queueMicrotask_b39ea83c7f01971a(arg0) {
|
|
451
|
+
queueMicrotask(arg0);
|
|
452
|
+
}
|
|
453
|
+
export function __wbg_resolve_d17db9352f5a220e(arg0) {
|
|
454
|
+
const ret = Promise.resolve(arg0);
|
|
455
|
+
return ret;
|
|
456
|
+
}
|
|
457
|
+
export function __wbg_set_a0e911be3da02782() { return handleError(function (arg0, arg1, arg2) {
|
|
458
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
459
|
+
return ret;
|
|
460
|
+
}, arguments); }
|
|
461
|
+
export function __wbg_set_facb7a5914e0fa39(arg0, arg1, arg2) {
|
|
462
|
+
const ret = arg0.set(arg1, arg2);
|
|
463
|
+
return ret;
|
|
464
|
+
}
|
|
465
|
+
export function __wbg_space_new(arg0) {
|
|
466
|
+
const ret = Space.__wrap(arg0);
|
|
467
|
+
return ret;
|
|
468
|
+
}
|
|
469
|
+
export function __wbg_static_accessor_GLOBAL_THIS_02344c9b09eb08a9() {
|
|
470
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
471
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
472
|
+
}
|
|
473
|
+
export function __wbg_static_accessor_GLOBAL_ac6d4ac874d5cd54() {
|
|
474
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
475
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
476
|
+
}
|
|
477
|
+
export function __wbg_static_accessor_SELF_9b2406c23aeb2023() {
|
|
478
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
479
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
480
|
+
}
|
|
481
|
+
export function __wbg_static_accessor_WINDOW_b34d2126934e16ba() {
|
|
482
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
483
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
484
|
+
}
|
|
485
|
+
export function __wbg_status_0853c9f5752c7ee2(arg0) {
|
|
486
|
+
const ret = arg0.status;
|
|
487
|
+
return ret;
|
|
488
|
+
}
|
|
489
|
+
export function __wbg_then_837494e384b37459(arg0, arg1) {
|
|
490
|
+
const ret = arg0.then(arg1);
|
|
491
|
+
return ret;
|
|
492
|
+
}
|
|
493
|
+
export function __wbg_then_bd927500e8905df2(arg0, arg1, arg2) {
|
|
494
|
+
const ret = arg0.then(arg1, arg2);
|
|
495
|
+
return ret;
|
|
496
|
+
}
|
|
497
|
+
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
498
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 275, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
499
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_f7c54996eb9137d9___convert__closures_____invoke___wasm_bindgen_f7c54996eb9137d9___JsValue__core_7d5f0a2ba6a62c33___result__Result_____wasm_bindgen_f7c54996eb9137d9___JsError___true_);
|
|
500
|
+
return ret;
|
|
501
|
+
}
|
|
502
|
+
export function __wbindgen_cast_0000000000000002(arg0) {
|
|
503
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
504
|
+
const ret = arg0;
|
|
505
|
+
return ret;
|
|
506
|
+
}
|
|
507
|
+
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
508
|
+
// Cast intrinsic for `I128 -> Externref`.
|
|
509
|
+
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
510
|
+
return ret;
|
|
511
|
+
}
|
|
512
|
+
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
513
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
514
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
515
|
+
return ret;
|
|
516
|
+
}
|
|
517
|
+
export function __wbindgen_init_externref_table() {
|
|
518
|
+
const table = wasm.__wbindgen_externrefs;
|
|
519
|
+
const offset = table.grow(4);
|
|
520
|
+
table.set(0, undefined);
|
|
521
|
+
table.set(offset + 0, undefined);
|
|
522
|
+
table.set(offset + 1, null);
|
|
523
|
+
table.set(offset + 2, true);
|
|
524
|
+
table.set(offset + 3, false);
|
|
525
|
+
}
|
|
526
|
+
function wasm_bindgen_f7c54996eb9137d9___convert__closures_____invoke___wasm_bindgen_f7c54996eb9137d9___JsValue__core_7d5f0a2ba6a62c33___result__Result_____wasm_bindgen_f7c54996eb9137d9___JsError___true_(arg0, arg1, arg2) {
|
|
527
|
+
const ret = wasm.wasm_bindgen_f7c54996eb9137d9___convert__closures_____invoke___wasm_bindgen_f7c54996eb9137d9___JsValue__core_7d5f0a2ba6a62c33___result__Result_____wasm_bindgen_f7c54996eb9137d9___JsError___true_(arg0, arg1, arg2);
|
|
528
|
+
if (ret[1]) {
|
|
529
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
function wasm_bindgen_f7c54996eb9137d9___convert__closures_____invoke___js_sys_ac40961855821e8e___Function_fn_wasm_bindgen_f7c54996eb9137d9___JsValue_____wasm_bindgen_f7c54996eb9137d9___sys__Undefined___js_sys_ac40961855821e8e___Function_fn_wasm_bindgen_f7c54996eb9137d9___JsValue_____wasm_bindgen_f7c54996eb9137d9___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
534
|
+
wasm.wasm_bindgen_f7c54996eb9137d9___convert__closures_____invoke___js_sys_ac40961855821e8e___Function_fn_wasm_bindgen_f7c54996eb9137d9___JsValue_____wasm_bindgen_f7c54996eb9137d9___sys__Undefined___js_sys_ac40961855821e8e___Function_fn_wasm_bindgen_f7c54996eb9137d9___JsValue_____wasm_bindgen_f7c54996eb9137d9___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
const S3BackendFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
538
|
+
? { register: () => {}, unregister: () => {} }
|
|
539
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_s3backend_free(ptr, 1));
|
|
540
|
+
const SpaceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
541
|
+
? { register: () => {}, unregister: () => {} }
|
|
542
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_space_free(ptr, 1));
|
|
543
|
+
|
|
544
|
+
function addToExternrefTable0(obj) {
|
|
545
|
+
const idx = wasm.__externref_table_alloc();
|
|
546
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
547
|
+
return idx;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
551
|
+
? { register: () => {}, unregister: () => {} }
|
|
552
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
553
|
+
|
|
554
|
+
function debugString(val) {
|
|
555
|
+
// primitive types
|
|
556
|
+
const type = typeof val;
|
|
557
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
558
|
+
return `${val}`;
|
|
559
|
+
}
|
|
560
|
+
if (type == 'string') {
|
|
561
|
+
return `"${val}"`;
|
|
562
|
+
}
|
|
563
|
+
if (type == 'symbol') {
|
|
564
|
+
const description = val.description;
|
|
565
|
+
if (description == null) {
|
|
566
|
+
return 'Symbol';
|
|
567
|
+
} else {
|
|
568
|
+
return `Symbol(${description})`;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
if (type == 'function') {
|
|
572
|
+
const name = val.name;
|
|
573
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
574
|
+
return `Function(${name})`;
|
|
575
|
+
} else {
|
|
576
|
+
return 'Function';
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
// objects
|
|
580
|
+
if (Array.isArray(val)) {
|
|
581
|
+
const length = val.length;
|
|
582
|
+
let debug = '[';
|
|
583
|
+
if (length > 0) {
|
|
584
|
+
debug += debugString(val[0]);
|
|
585
|
+
}
|
|
586
|
+
for(let i = 1; i < length; i++) {
|
|
587
|
+
debug += ', ' + debugString(val[i]);
|
|
588
|
+
}
|
|
589
|
+
debug += ']';
|
|
590
|
+
return debug;
|
|
591
|
+
}
|
|
592
|
+
// Test for built-in
|
|
593
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
594
|
+
let className;
|
|
595
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
596
|
+
className = builtInMatches[1];
|
|
597
|
+
} else {
|
|
598
|
+
// Failed to match the standard '[object ClassName]'
|
|
599
|
+
return toString.call(val);
|
|
600
|
+
}
|
|
601
|
+
if (className == 'Object') {
|
|
602
|
+
// we're a user defined class or Object
|
|
603
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
604
|
+
// easier than looping through ownProperties of `val`.
|
|
605
|
+
try {
|
|
606
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
607
|
+
} catch (_) {
|
|
608
|
+
return 'Object';
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
// errors
|
|
612
|
+
if (val instanceof Error) {
|
|
613
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
614
|
+
}
|
|
615
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
616
|
+
return className;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
620
|
+
ptr = ptr >>> 0;
|
|
621
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
let cachedDataViewMemory0 = null;
|
|
625
|
+
function getDataViewMemory0() {
|
|
626
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
627
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
628
|
+
}
|
|
629
|
+
return cachedDataViewMemory0;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
633
|
+
function getFloat32ArrayMemory0() {
|
|
634
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
635
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
636
|
+
}
|
|
637
|
+
return cachedFloat32ArrayMemory0;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function getStringFromWasm0(ptr, len) {
|
|
641
|
+
return decodeText(ptr >>> 0, len);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
let cachedUint8ArrayMemory0 = null;
|
|
645
|
+
function getUint8ArrayMemory0() {
|
|
646
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
647
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
648
|
+
}
|
|
649
|
+
return cachedUint8ArrayMemory0;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
function handleError(f, args) {
|
|
653
|
+
try {
|
|
654
|
+
return f.apply(this, args);
|
|
655
|
+
} catch (e) {
|
|
656
|
+
const idx = addToExternrefTable0(e);
|
|
657
|
+
wasm.__wbindgen_exn_store(idx);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
function isLikeNone(x) {
|
|
662
|
+
return x === undefined || x === null;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
666
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
667
|
+
const real = (...args) => {
|
|
668
|
+
|
|
669
|
+
// First up with a closure we increment the internal reference
|
|
670
|
+
// count. This ensures that the Rust closure environment won't
|
|
671
|
+
// be deallocated while we're invoking it.
|
|
672
|
+
state.cnt++;
|
|
673
|
+
const a = state.a;
|
|
674
|
+
state.a = 0;
|
|
675
|
+
try {
|
|
676
|
+
return f(a, state.b, ...args);
|
|
677
|
+
} finally {
|
|
678
|
+
state.a = a;
|
|
679
|
+
real._wbg_cb_unref();
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
real._wbg_cb_unref = () => {
|
|
683
|
+
if (--state.cnt === 0) {
|
|
684
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
685
|
+
state.a = 0;
|
|
686
|
+
CLOSURE_DTORS.unregister(state);
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
690
|
+
return real;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
694
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
695
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
696
|
+
WASM_VECTOR_LEN = arg.length;
|
|
697
|
+
return ptr;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
|
701
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
702
|
+
getFloat32ArrayMemory0().set(arg, ptr / 4);
|
|
703
|
+
WASM_VECTOR_LEN = arg.length;
|
|
704
|
+
return ptr;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
708
|
+
if (realloc === undefined) {
|
|
709
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
710
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
711
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
712
|
+
WASM_VECTOR_LEN = buf.length;
|
|
713
|
+
return ptr;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
let len = arg.length;
|
|
717
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
718
|
+
|
|
719
|
+
const mem = getUint8ArrayMemory0();
|
|
720
|
+
|
|
721
|
+
let offset = 0;
|
|
722
|
+
|
|
723
|
+
for (; offset < len; offset++) {
|
|
724
|
+
const code = arg.charCodeAt(offset);
|
|
725
|
+
if (code > 0x7F) break;
|
|
726
|
+
mem[ptr + offset] = code;
|
|
727
|
+
}
|
|
728
|
+
if (offset !== len) {
|
|
729
|
+
if (offset !== 0) {
|
|
730
|
+
arg = arg.slice(offset);
|
|
731
|
+
}
|
|
732
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
733
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
734
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
735
|
+
|
|
736
|
+
offset += ret.written;
|
|
737
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
WASM_VECTOR_LEN = offset;
|
|
741
|
+
return ptr;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
function takeFromExternrefTable0(idx) {
|
|
745
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
746
|
+
wasm.__externref_table_dealloc(idx);
|
|
747
|
+
return value;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
751
|
+
cachedTextDecoder.decode();
|
|
752
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
753
|
+
let numBytesDecoded = 0;
|
|
754
|
+
function decodeText(ptr, len) {
|
|
755
|
+
numBytesDecoded += len;
|
|
756
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
757
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
758
|
+
cachedTextDecoder.decode();
|
|
759
|
+
numBytesDecoded = len;
|
|
760
|
+
}
|
|
761
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
const cachedTextEncoder = new TextEncoder();
|
|
765
|
+
|
|
766
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
767
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
768
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
769
|
+
view.set(buf);
|
|
770
|
+
return {
|
|
771
|
+
read: arg.length,
|
|
772
|
+
written: buf.length
|
|
773
|
+
};
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
let WASM_VECTOR_LEN = 0;
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
let wasm;
|
|
781
|
+
export function __wbg_set_wasm(val) {
|
|
782
|
+
wasm = val;
|
|
783
|
+
}
|