@perspective-dev/client 4.0.0 → 4.1.0

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 (45) hide show
  1. package/dist/cdn/perspective-server.worker.js +1 -1
  2. package/dist/cdn/perspective-server.worker.js.map +3 -3
  3. package/dist/cdn/perspective.js +2 -2
  4. package/dist/cdn/perspective.js.map +4 -4
  5. package/dist/esm/perspective.browser.d.ts +5 -1
  6. package/dist/esm/perspective.inline.js +2 -2
  7. package/dist/esm/perspective.inline.js.map +4 -4
  8. package/dist/esm/perspective.js +2 -2
  9. package/dist/esm/perspective.js.map +4 -4
  10. package/dist/esm/perspective.node.d.ts +6 -1
  11. package/dist/esm/perspective.node.js +722 -353
  12. package/dist/esm/perspective.node.js.map +4 -4
  13. package/dist/esm/ts-rs/ColumnType.d.ts +4 -0
  14. package/dist/esm/ts-rs/ViewConfig.d.ts +18 -0
  15. package/dist/esm/ts-rs/ViewWindow.d.ts +9 -9
  16. package/dist/esm/virtual_server.d.ts +47 -0
  17. package/dist/esm/virtual_servers/duckdb.d.ts +39 -0
  18. package/dist/esm/virtual_servers/duckdb.js +12 -0
  19. package/dist/esm/virtual_servers/duckdb.js.map +7 -0
  20. package/dist/esm/wasm/browser.d.ts +1 -1
  21. package/dist/wasm/perspective-js.d.ts +52 -13
  22. package/dist/wasm/perspective-js.js +680 -399
  23. package/dist/wasm/perspective-js.wasm +0 -0
  24. package/dist/wasm/perspective-js.wasm.d.ts +20 -8
  25. package/package.json +4 -1
  26. package/src/rust/client.rs +14 -5
  27. package/src/rust/lib.rs +11 -1
  28. package/src/rust/table.rs +3 -2
  29. package/src/rust/table_data.rs +19 -14
  30. package/src/rust/utils/browser.rs +0 -4
  31. package/src/rust/utils/console_logger.rs +3 -2
  32. package/src/rust/utils/errors.rs +10 -28
  33. package/src/rust/utils/futures.rs +3 -3
  34. package/src/rust/utils/json.rs +4 -4
  35. package/src/rust/virtual_server.rs +746 -0
  36. package/src/ts/perspective-server.worker.ts +33 -23
  37. package/src/ts/perspective.browser.ts +17 -2
  38. package/src/ts/perspective.node.ts +46 -11
  39. package/src/ts/ts-rs/ColumnType.ts +6 -0
  40. package/src/ts/ts-rs/ViewConfig.ts +8 -0
  41. package/src/ts/ts-rs/ViewWindow.ts +3 -3
  42. package/src/ts/virtual_server.ts +126 -0
  43. package/src/ts/virtual_servers/duckdb.ts +511 -0
  44. package/src/ts/wasm/browser.ts +17 -9
  45. package/tsconfig.json +1 -0
@@ -1,3 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
1
7
  // src/ts/perspective.node.ts
2
8
  import WebSocket, { WebSocketServer as HttpWebSocketServer } from "ws";
3
9
  import stoppable from "stoppable";
@@ -9,13 +15,24 @@ import * as url from "node:url";
9
15
  import { createRequire } from "node:module";
10
16
 
11
17
  // dist/wasm/perspective-js.js
18
+ var perspective_js_exports = {};
19
+ __export(perspective_js_exports, {
20
+ Client: () => Client,
21
+ JsVirtualDataSlice: () => JsVirtualDataSlice,
22
+ JsVirtualServer: () => JsVirtualServer,
23
+ ProxySession: () => ProxySession,
24
+ Table: () => Table,
25
+ View: () => View,
26
+ default: () => perspective_js_default,
27
+ init: () => init,
28
+ initSync: () => initSync
29
+ });
12
30
  var wasm;
13
31
  var heap = new Array(128).fill(void 0);
14
32
  heap.push(void 0, null, true, false);
15
33
  function getObject(idx) {
16
34
  return heap[idx];
17
35
  }
18
- var WASM_VECTOR_LEN = 0;
19
36
  var cachedUint8ArrayMemory0 = null;
20
37
  function getUint8ArrayMemory0() {
21
38
  if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
@@ -23,12 +40,40 @@ function getUint8ArrayMemory0() {
23
40
  }
24
41
  return cachedUint8ArrayMemory0;
25
42
  }
26
- var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
27
- throw Error("TextEncoder not available");
28
- } };
29
- var encodeString = function(arg, view) {
30
- return cachedTextEncoder.encodeInto(arg, view);
31
- };
43
+ var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
44
+ cachedTextDecoder.decode();
45
+ var MAX_SAFARI_DECODE_BYTES = 2146435072;
46
+ var numBytesDecoded = 0;
47
+ function decodeText(ptr, len) {
48
+ numBytesDecoded += len;
49
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
50
+ cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
51
+ cachedTextDecoder.decode();
52
+ numBytesDecoded = len;
53
+ }
54
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
55
+ }
56
+ function getStringFromWasm0(ptr, len) {
57
+ ptr = ptr >>> 0;
58
+ return decodeText(ptr, len);
59
+ }
60
+ function getCachedStringFromWasm0(ptr, len) {
61
+ if (ptr === 0) {
62
+ return getObject(len);
63
+ } else {
64
+ return getStringFromWasm0(ptr, len);
65
+ }
66
+ }
67
+ var heap_next = heap.length;
68
+ function addHeapObject(obj) {
69
+ if (heap_next === heap.length) heap.push(heap.length + 1);
70
+ const idx = heap_next;
71
+ heap_next = heap[idx];
72
+ heap[idx] = obj;
73
+ return idx;
74
+ }
75
+ var WASM_VECTOR_LEN = 0;
76
+ var cachedTextEncoder = new TextEncoder();
32
77
  function passStringToWasm0(arg, malloc, realloc) {
33
78
  if (realloc === void 0) {
34
79
  const buf = cachedTextEncoder.encode(arg);
@@ -52,7 +97,7 @@ function passStringToWasm0(arg, malloc, realloc) {
52
97
  }
53
98
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
54
99
  const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
55
- const ret = encodeString(arg, view);
100
+ const ret = cachedTextEncoder.encodeInto(arg, view);
56
101
  offset += ret.written;
57
102
  ptr = realloc(ptr, len, offset, 1) >>> 0;
58
103
  }
@@ -66,92 +111,9 @@ function getDataViewMemory0() {
66
111
  }
67
112
  return cachedDataViewMemory0;
68
113
  }
69
- var heap_next = heap.length;
70
- function addHeapObject(obj) {
71
- if (heap_next === heap.length) heap.push(heap.length + 1);
72
- const idx = heap_next;
73
- heap_next = heap[idx];
74
- heap[idx] = obj;
75
- return idx;
76
- }
77
- function handleError(f, args) {
78
- try {
79
- return f.apply(this, args);
80
- } catch (e) {
81
- wasm.__wbindgen_export_2(addHeapObject(e));
82
- }
83
- }
84
- var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
85
- throw Error("TextDecoder not available");
86
- } };
87
- if (typeof TextDecoder !== "undefined") {
88
- cachedTextDecoder.decode();
89
- }
90
- function getStringFromWasm0(ptr, len) {
91
- ptr = ptr >>> 0;
92
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
93
- }
94
- function getArrayU8FromWasm0(ptr, len) {
95
- ptr = ptr >>> 0;
96
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
97
- }
98
114
  function isLikeNone(x) {
99
115
  return x === void 0 || x === null;
100
116
  }
101
- function dropObject(idx) {
102
- if (idx < 132) return;
103
- heap[idx] = heap_next;
104
- heap_next = idx;
105
- }
106
- function takeObject(idx) {
107
- const ret = getObject(idx);
108
- dropObject(idx);
109
- return ret;
110
- }
111
- var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
112
- }, unregister: () => {
113
- } } : new FinalizationRegistry((state) => {
114
- wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b);
115
- });
116
- function makeMutClosure(arg0, arg1, dtor, f) {
117
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
118
- const real = (...args) => {
119
- state.cnt++;
120
- const a = state.a;
121
- state.a = 0;
122
- try {
123
- return f(a, state.b, ...args);
124
- } finally {
125
- if (--state.cnt === 0) {
126
- wasm.__wbindgen_export_4.get(state.dtor)(a, state.b);
127
- CLOSURE_DTORS.unregister(state);
128
- } else {
129
- state.a = a;
130
- }
131
- }
132
- };
133
- real.original = state;
134
- CLOSURE_DTORS.register(real, state, state);
135
- return real;
136
- }
137
- function makeClosure(arg0, arg1, dtor, f) {
138
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
139
- const real = (...args) => {
140
- state.cnt++;
141
- try {
142
- return f(state.a, state.b, ...args);
143
- } finally {
144
- if (--state.cnt === 0) {
145
- wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b);
146
- state.a = 0;
147
- CLOSURE_DTORS.unregister(state);
148
- }
149
- }
150
- };
151
- real.original = state;
152
- CLOSURE_DTORS.register(real, state, state);
153
- return real;
154
- }
155
117
  function debugString(val) {
156
118
  const type = typeof val;
157
119
  if (type == "number" || type == "boolean" || val == null) {
@@ -208,6 +170,82 @@ ${val.stack}`;
208
170
  }
209
171
  return className;
210
172
  }
173
+ function handleError(f, args) {
174
+ try {
175
+ return f.apply(this, args);
176
+ } catch (e) {
177
+ wasm.__wbindgen_export3(addHeapObject(e));
178
+ }
179
+ }
180
+ function getArrayU8FromWasm0(ptr, len) {
181
+ ptr = ptr >>> 0;
182
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
183
+ }
184
+ function dropObject(idx) {
185
+ if (idx < 132) return;
186
+ heap[idx] = heap_next;
187
+ heap_next = idx;
188
+ }
189
+ function takeObject(idx) {
190
+ const ret = getObject(idx);
191
+ dropObject(idx);
192
+ return ret;
193
+ }
194
+ function getArrayJsValueFromWasm0(ptr, len) {
195
+ ptr = ptr >>> 0;
196
+ const mem = getDataViewMemory0();
197
+ const result = [];
198
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
199
+ result.push(takeObject(mem.getUint32(i, true)));
200
+ }
201
+ return result;
202
+ }
203
+ var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
204
+ }, unregister: () => {
205
+ } } : new FinalizationRegistry((state) => state.dtor(state.a, state.b));
206
+ function makeMutClosure(arg0, arg1, dtor, f) {
207
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
208
+ const real = (...args) => {
209
+ state.cnt++;
210
+ const a = state.a;
211
+ state.a = 0;
212
+ try {
213
+ return f(a, state.b, ...args);
214
+ } finally {
215
+ state.a = a;
216
+ real._wbg_cb_unref();
217
+ }
218
+ };
219
+ real._wbg_cb_unref = () => {
220
+ if (--state.cnt === 0) {
221
+ state.dtor(state.a, state.b);
222
+ state.a = 0;
223
+ CLOSURE_DTORS.unregister(state);
224
+ }
225
+ };
226
+ CLOSURE_DTORS.register(real, state, state);
227
+ return real;
228
+ }
229
+ function makeClosure(arg0, arg1, dtor, f) {
230
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
231
+ const real = (...args) => {
232
+ state.cnt++;
233
+ try {
234
+ return f(state.a, state.b, ...args);
235
+ } finally {
236
+ real._wbg_cb_unref();
237
+ }
238
+ };
239
+ real._wbg_cb_unref = () => {
240
+ if (--state.cnt === 0) {
241
+ state.dtor(state.a, state.b);
242
+ state.a = 0;
243
+ CLOSURE_DTORS.unregister(state);
244
+ }
245
+ };
246
+ CLOSURE_DTORS.register(real, state, state);
247
+ return real;
248
+ }
211
249
  function _assertClass(instance, klass) {
212
250
  if (!(instance instanceof klass)) {
213
251
  throw new Error(`expected instance of ${klass.name}`);
@@ -219,15 +257,24 @@ function addBorrowedObject(obj) {
219
257
  heap[--stack_pointer] = obj;
220
258
  return stack_pointer;
221
259
  }
222
- function __wbg_adapter_50(arg0, arg1) {
223
- const ret = wasm.__wbindgen_export_5(arg0, arg1);
224
- return takeObject(ret);
260
+ function passArray8ToWasm0(arg, malloc) {
261
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
262
+ getUint8ArrayMemory0().set(arg, ptr / 1);
263
+ WASM_VECTOR_LEN = arg.length;
264
+ return ptr;
265
+ }
266
+ function init() {
267
+ wasm.init();
225
268
  }
226
- function __wbg_adapter_53(arg0, arg1, arg2) {
227
- wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
269
+ function __wasm_bindgen_func_elem_3509(arg0, arg1, arg2) {
270
+ wasm.__wasm_bindgen_func_elem_3509(arg0, arg1, addHeapObject(arg2));
228
271
  }
229
- function __wbg_adapter_251(arg0, arg1, arg2, arg3) {
230
- wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
272
+ function __wasm_bindgen_func_elem_553(arg0, arg1) {
273
+ const ret = wasm.__wasm_bindgen_func_elem_553(arg0, arg1);
274
+ return takeObject(ret);
275
+ }
276
+ function __wasm_bindgen_func_elem_5064(arg0, arg1, arg2, arg3) {
277
+ wasm.__wasm_bindgen_func_elem_5064(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
231
278
  }
232
279
  var ClientFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
233
280
  }, unregister: () => {
@@ -254,19 +301,18 @@ var Client = class _Client {
254
301
  * @returns {string}
255
302
  */
256
303
  __getClassname() {
257
- let deferred1_0;
258
- let deferred1_1;
259
304
  try {
260
305
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
261
306
  wasm.client___getClassname(retptr, this.__wbg_ptr);
262
307
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
263
308
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
264
- deferred1_0 = r0;
265
- deferred1_1 = r1;
266
- return getStringFromWasm0(r0, r1);
309
+ var v1 = getCachedStringFromWasm0(r0, r1);
310
+ if (r0 !== 0) {
311
+ wasm.__wbindgen_export4(r0, r1, 1);
312
+ }
313
+ return v1;
267
314
  } finally {
268
315
  wasm.__wbindgen_add_to_stack_pointer(16);
269
- wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
270
316
  }
271
317
  }
272
318
  /**
@@ -316,7 +362,7 @@ var Client = class _Client {
316
362
  * @returns {Promise<void>}
317
363
  */
318
364
  handle_error(error, reconnect) {
319
- const ptr0 = passStringToWasm0(error, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
365
+ const ptr0 = passStringToWasm0(error, wasm.__wbindgen_export, wasm.__wbindgen_export2);
320
366
  const len0 = WASM_VECTOR_LEN;
321
367
  const ret = wasm.client_handle_error(this.__wbg_ptr, ptr0, len0, isLikeNone(reconnect) ? 0 : addHeapObject(reconnect));
322
368
  return takeObject(ret);
@@ -403,7 +449,7 @@ var Client = class _Client {
403
449
  * ```javascript
404
450
  * const table = await client.table(data, { index: "Row ID" });
405
451
  * ```
406
- * @param {string | ArrayBuffer | Record<string, unknown[]> | Record<string, unknown>[]} value
452
+ * @param {string | ArrayBuffer | Record<string, unknown[]> | Record<string, unknown>[] | Record<string, ColumnType>} value
407
453
  * @param {TableInitOptions | null} [options]
408
454
  * @returns {Promise<Table>}
409
455
  */
@@ -450,7 +496,7 @@ var Client = class _Client {
450
496
  * @returns {Promise<Table>}
451
497
  */
452
498
  open_table(entity_id) {
453
- const ptr0 = passStringToWasm0(entity_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
499
+ const ptr0 = passStringToWasm0(entity_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
454
500
  const len0 = WASM_VECTOR_LEN;
455
501
  const ret = wasm.client_open_table(this.__wbg_ptr, ptr0, len0);
456
502
  return takeObject(ret);
@@ -468,7 +514,7 @@ var Client = class _Client {
468
514
  * ```javascript
469
515
  * const tables = await client.get_hosted_table_names();
470
516
  * ```
471
- * @returns {Promise<any>}
517
+ * @returns {Promise<string[]>}
472
518
  */
473
519
  get_hosted_table_names() {
474
520
  const ret = wasm.client_get_hosted_table_names(this.__wbg_ptr);
@@ -514,6 +560,211 @@ var Client = class _Client {
514
560
  return takeObject(ret);
515
561
  }
516
562
  };
563
+ if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
564
+ var JsVirtualDataSliceFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
565
+ }, unregister: () => {
566
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_jsvirtualdataslice_free(ptr >>> 0, 1));
567
+ var JsVirtualDataSlice = class _JsVirtualDataSlice {
568
+ static __wrap(ptr) {
569
+ ptr = ptr >>> 0;
570
+ const obj = Object.create(_JsVirtualDataSlice.prototype);
571
+ obj.__wbg_ptr = ptr;
572
+ JsVirtualDataSliceFinalization.register(obj, obj.__wbg_ptr, obj);
573
+ return obj;
574
+ }
575
+ __destroy_into_raw() {
576
+ const ptr = this.__wbg_ptr;
577
+ this.__wbg_ptr = 0;
578
+ JsVirtualDataSliceFinalization.unregister(this);
579
+ return ptr;
580
+ }
581
+ free() {
582
+ const ptr = this.__destroy_into_raw();
583
+ wasm.__wbg_jsvirtualdataslice_free(ptr, 0);
584
+ }
585
+ constructor() {
586
+ const ret = wasm.jsvirtualdataslice_new();
587
+ this.__wbg_ptr = ret >>> 0;
588
+ JsVirtualDataSliceFinalization.register(this, this.__wbg_ptr, this);
589
+ return this;
590
+ }
591
+ /**
592
+ * @param {string} dtype
593
+ * @param {string} name
594
+ * @param {number} index
595
+ * @param {any} val
596
+ * @param {number | null} [group_by_index]
597
+ */
598
+ setCol(dtype, name, index, val, group_by_index) {
599
+ try {
600
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
601
+ const ptr0 = passStringToWasm0(dtype, wasm.__wbindgen_export, wasm.__wbindgen_export2);
602
+ const len0 = WASM_VECTOR_LEN;
603
+ const ptr1 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
604
+ const len1 = WASM_VECTOR_LEN;
605
+ wasm.jsvirtualdataslice_setCol(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, index, addHeapObject(val), isLikeNone(group_by_index) ? 4294967297 : group_by_index >>> 0);
606
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
607
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
608
+ if (r1) {
609
+ throw takeObject(r0);
610
+ }
611
+ } finally {
612
+ wasm.__wbindgen_add_to_stack_pointer(16);
613
+ }
614
+ }
615
+ /**
616
+ * @param {string} name
617
+ * @param {number} index
618
+ * @param {any} val
619
+ * @param {number | null} [group_by_index]
620
+ */
621
+ setStringCol(name, index, val, group_by_index) {
622
+ try {
623
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
624
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
625
+ const len0 = WASM_VECTOR_LEN;
626
+ wasm.jsvirtualdataslice_setStringCol(retptr, this.__wbg_ptr, ptr0, len0, index, addHeapObject(val), isLikeNone(group_by_index) ? 4294967297 : group_by_index >>> 0);
627
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
628
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
629
+ if (r1) {
630
+ throw takeObject(r0);
631
+ }
632
+ } finally {
633
+ wasm.__wbindgen_add_to_stack_pointer(16);
634
+ }
635
+ }
636
+ /**
637
+ * @param {string} name
638
+ * @param {number} index
639
+ * @param {any} val
640
+ * @param {number | null} [group_by_index]
641
+ */
642
+ setIntegerCol(name, index, val, group_by_index) {
643
+ try {
644
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
645
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
646
+ const len0 = WASM_VECTOR_LEN;
647
+ wasm.jsvirtualdataslice_setIntegerCol(retptr, this.__wbg_ptr, ptr0, len0, index, addHeapObject(val), isLikeNone(group_by_index) ? 4294967297 : group_by_index >>> 0);
648
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
649
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
650
+ if (r1) {
651
+ throw takeObject(r0);
652
+ }
653
+ } finally {
654
+ wasm.__wbindgen_add_to_stack_pointer(16);
655
+ }
656
+ }
657
+ /**
658
+ * @param {string} name
659
+ * @param {number} index
660
+ * @param {any} val
661
+ * @param {number | null} [group_by_index]
662
+ */
663
+ setFloatCol(name, index, val, group_by_index) {
664
+ try {
665
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
666
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
667
+ const len0 = WASM_VECTOR_LEN;
668
+ wasm.jsvirtualdataslice_setFloatCol(retptr, this.__wbg_ptr, ptr0, len0, index, addHeapObject(val), isLikeNone(group_by_index) ? 4294967297 : group_by_index >>> 0);
669
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
670
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
671
+ if (r1) {
672
+ throw takeObject(r0);
673
+ }
674
+ } finally {
675
+ wasm.__wbindgen_add_to_stack_pointer(16);
676
+ }
677
+ }
678
+ /**
679
+ * @param {string} name
680
+ * @param {number} index
681
+ * @param {any} val
682
+ * @param {number | null} [group_by_index]
683
+ */
684
+ setBooleanCol(name, index, val, group_by_index) {
685
+ try {
686
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
687
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
688
+ const len0 = WASM_VECTOR_LEN;
689
+ wasm.jsvirtualdataslice_setBooleanCol(retptr, this.__wbg_ptr, ptr0, len0, index, addHeapObject(val), isLikeNone(group_by_index) ? 4294967297 : group_by_index >>> 0);
690
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
691
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
692
+ if (r1) {
693
+ throw takeObject(r0);
694
+ }
695
+ } finally {
696
+ wasm.__wbindgen_add_to_stack_pointer(16);
697
+ }
698
+ }
699
+ /**
700
+ * @param {string} name
701
+ * @param {number} index
702
+ * @param {any} val
703
+ * @param {number | null} [group_by_index]
704
+ */
705
+ setDatetimeCol(name, index, val, group_by_index) {
706
+ try {
707
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
708
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
709
+ const len0 = WASM_VECTOR_LEN;
710
+ wasm.jsvirtualdataslice_setDatetimeCol(retptr, this.__wbg_ptr, ptr0, len0, index, addHeapObject(val), isLikeNone(group_by_index) ? 4294967297 : group_by_index >>> 0);
711
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
712
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
713
+ if (r1) {
714
+ throw takeObject(r0);
715
+ }
716
+ } finally {
717
+ wasm.__wbindgen_add_to_stack_pointer(16);
718
+ }
719
+ }
720
+ };
721
+ if (Symbol.dispose) JsVirtualDataSlice.prototype[Symbol.dispose] = JsVirtualDataSlice.prototype.free;
722
+ var JsVirtualServerFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
723
+ }, unregister: () => {
724
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_jsvirtualserver_free(ptr >>> 0, 1));
725
+ var JsVirtualServer = class {
726
+ __destroy_into_raw() {
727
+ const ptr = this.__wbg_ptr;
728
+ this.__wbg_ptr = 0;
729
+ JsVirtualServerFinalization.unregister(this);
730
+ return ptr;
731
+ }
732
+ free() {
733
+ const ptr = this.__destroy_into_raw();
734
+ wasm.__wbg_jsvirtualserver_free(ptr, 0);
735
+ }
736
+ /**
737
+ * @param {object} handler
738
+ */
739
+ constructor(handler) {
740
+ try {
741
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
742
+ wasm.jsvirtualserver_new(retptr, addHeapObject(handler));
743
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
744
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
745
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
746
+ if (r2) {
747
+ throw takeObject(r1);
748
+ }
749
+ this.__wbg_ptr = r0 >>> 0;
750
+ JsVirtualServerFinalization.register(this, this.__wbg_ptr, this);
751
+ return this;
752
+ } finally {
753
+ wasm.__wbindgen_add_to_stack_pointer(16);
754
+ }
755
+ }
756
+ /**
757
+ * @param {Uint8Array} bytes
758
+ * @returns {Promise<any>}
759
+ */
760
+ handleRequest(bytes) {
761
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
762
+ const len0 = WASM_VECTOR_LEN;
763
+ const ret = wasm.jsvirtualserver_handleRequest(this.__wbg_ptr, ptr0, len0);
764
+ return takeObject(ret);
765
+ }
766
+ };
767
+ if (Symbol.dispose) JsVirtualServer.prototype[Symbol.dispose] = JsVirtualServer.prototype.free;
517
768
  var ProxySessionFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
518
769
  }, unregister: () => {
519
770
  } } : new FinalizationRegistry((ptr) => wasm.__wbg_proxysession_free(ptr >>> 0, 1));
@@ -567,6 +818,7 @@ var ProxySession = class _ProxySession {
567
818
  return takeObject(ret);
568
819
  }
569
820
  };
821
+ if (Symbol.dispose) ProxySession.prototype[Symbol.dispose] = ProxySession.prototype.free;
570
822
  var TableFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
571
823
  }, unregister: () => {
572
824
  } } : new FinalizationRegistry((ptr) => wasm.__wbg_table_free(ptr >>> 0, 1));
@@ -592,19 +844,18 @@ var Table = class _Table {
592
844
  * @returns {string}
593
845
  */
594
846
  __getClassname() {
595
- let deferred1_0;
596
- let deferred1_1;
597
847
  try {
598
848
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
599
849
  wasm.table___getClassname(retptr, this.__wbg_ptr);
600
850
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
601
851
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
602
- deferred1_0 = r0;
603
- deferred1_1 = r1;
604
- return getStringFromWasm0(r0, r1);
852
+ var v1 = getCachedStringFromWasm0(r0, r1);
853
+ if (r0 !== 0) {
854
+ wasm.__wbindgen_export4(r0, r1, 1);
855
+ }
856
+ return v1;
605
857
  } finally {
606
858
  wasm.__wbindgen_add_to_stack_pointer(16);
607
- wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
608
859
  }
609
860
  }
610
861
  /**
@@ -616,7 +867,7 @@ var Table = class _Table {
616
867
  * const table = await client.table("x,y\n1,2\n3,4", { index: "x" });
617
868
  * const index = table.get_index(); // "x"
618
869
  * ```
619
- * @returns {Promise<string | undefined>}
870
+ * @returns {Promise<string>}
620
871
  */
621
872
  get_index() {
622
873
  const ret = wasm.table_get_index(this.__wbg_ptr);
@@ -722,7 +973,7 @@ var Table = class _Table {
722
973
  *
723
974
  * Note that all [`Table`] columns are _nullable_, regardless of the data
724
975
  * type.
725
- * @returns {Promise<any>}
976
+ * @returns {Record<string, ColumnType>}
726
977
  */
727
978
  schema() {
728
979
  const ret = wasm.table_schema(this.__wbg_ptr);
@@ -845,7 +1096,7 @@ var Table = class _Table {
845
1096
  * ```javascript
846
1097
  * await table.update("x,y\n1,2");
847
1098
  * ```
848
- * @param {string | ArrayBuffer | Record<string, unknown[]> | Record<string, unknown>[]} input
1099
+ * @param {string | ArrayBuffer | Record<string, unknown[]> | Record<string, unknown>[] | Record<string, ColumnType>} input
849
1100
  * @param {UpdateOptions | null} [options]
850
1101
  * @returns {Promise<any>}
851
1102
  */
@@ -886,6 +1137,7 @@ var Table = class _Table {
886
1137
  return takeObject(ret);
887
1138
  }
888
1139
  };
1140
+ if (Symbol.dispose) Table.prototype[Symbol.dispose] = Table.prototype.free;
889
1141
  var ViewFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
890
1142
  }, unregister: () => {
891
1143
  } } : new FinalizationRegistry((ptr) => wasm.__wbg_view_free(ptr >>> 0, 1));
@@ -996,7 +1248,7 @@ var View = class _View {
996
1248
  * @returns {Promise<Array<any>>}
997
1249
  */
998
1250
  get_min_max(name) {
999
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1251
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1000
1252
  const len0 = WASM_VECTOR_LEN;
1001
1253
  const ret = wasm.view_get_min_max(this.__wbg_ptr, ptr0, len0);
1002
1254
  return takeObject(ret);
@@ -1207,13 +1459,16 @@ var View = class _View {
1207
1459
  return takeObject(ret);
1208
1460
  }
1209
1461
  };
1462
+ if (Symbol.dispose) View.prototype[Symbol.dispose] = View.prototype.free;
1463
+ var EXPECTED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["basic", "cors", "default"]);
1210
1464
  async function __wbg_load(module, imports) {
1211
1465
  if (typeof Response === "function" && module instanceof Response) {
1212
1466
  if (typeof WebAssembly.instantiateStreaming === "function") {
1213
1467
  try {
1214
1468
  return await WebAssembly.instantiateStreaming(module, imports);
1215
1469
  } catch (e) {
1216
- if (module.headers.get("Content-Type") != "application/wasm") {
1470
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
1471
+ if (validResponse && module.headers.get("Content-Type") !== "application/wasm") {
1217
1472
  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);
1218
1473
  } else {
1219
1474
  throw e;
@@ -1234,125 +1489,208 @@ async function __wbg_load(module, imports) {
1234
1489
  function __wbg_get_imports() {
1235
1490
  const imports = {};
1236
1491
  imports.wbg = {};
1492
+ imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
1493
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1494
+ const ret = Error(v0);
1495
+ return addHeapObject(ret);
1496
+ };
1497
+ imports.wbg.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
1498
+ const ret = Number(getObject(arg0));
1499
+ return ret;
1500
+ };
1237
1501
  imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1238
1502
  const ret = String(getObject(arg1));
1239
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1503
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1240
1504
  const len1 = WASM_VECTOR_LEN;
1241
1505
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1242
1506
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1243
1507
  };
1244
- imports.wbg.__wbg_at_7d852dd9f194d43e = function(arg0, arg1) {
1245
- const ret = getObject(arg0).at(arg1);
1246
- return addHeapObject(ret);
1508
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
1509
+ const v = getObject(arg1);
1510
+ const ret = typeof v === "bigint" ? v : void 0;
1511
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1512
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1247
1513
  };
1248
- imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
1249
- const ret = getObject(arg0).buffer;
1250
- return addHeapObject(ret);
1514
+ imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
1515
+ const v = getObject(arg0);
1516
+ const ret = typeof v === "boolean" ? v : void 0;
1517
+ return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
1251
1518
  };
1252
- imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
1253
- const ret = getObject(arg0).buffer;
1254
- return addHeapObject(ret);
1519
+ imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
1520
+ const ret = debugString(getObject(arg1));
1521
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1522
+ const len1 = WASM_VECTOR_LEN;
1523
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1524
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1255
1525
  };
1256
- imports.wbg.__wbg_call_672a4d21634d4a24 = function() {
1257
- return handleError(function(arg0, arg1) {
1258
- const ret = getObject(arg0).call(getObject(arg1));
1526
+ imports.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
1527
+ const ret = getObject(arg0) in getObject(arg1);
1528
+ return ret;
1529
+ };
1530
+ imports.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
1531
+ const ret = typeof getObject(arg0) === "bigint";
1532
+ return ret;
1533
+ };
1534
+ imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
1535
+ const ret = typeof getObject(arg0) === "function";
1536
+ return ret;
1537
+ };
1538
+ imports.wbg.__wbg___wbindgen_is_null_5e69f72e906cc57c = function(arg0) {
1539
+ const ret = getObject(arg0) === null;
1540
+ return ret;
1541
+ };
1542
+ imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
1543
+ const val = getObject(arg0);
1544
+ const ret = typeof val === "object" && val !== null;
1545
+ return ret;
1546
+ };
1547
+ imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
1548
+ const ret = typeof getObject(arg0) === "string";
1549
+ return ret;
1550
+ };
1551
+ imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
1552
+ const ret = getObject(arg0) === void 0;
1553
+ return ret;
1554
+ };
1555
+ imports.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
1556
+ const ret = getObject(arg0) === getObject(arg1);
1557
+ return ret;
1558
+ };
1559
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
1560
+ const ret = getObject(arg0) == getObject(arg1);
1561
+ return ret;
1562
+ };
1563
+ imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
1564
+ const obj = getObject(arg1);
1565
+ const ret = typeof obj === "number" ? obj : void 0;
1566
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1567
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1568
+ };
1569
+ imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
1570
+ const obj = getObject(arg1);
1571
+ const ret = typeof obj === "string" ? obj : void 0;
1572
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1573
+ var len1 = WASM_VECTOR_LEN;
1574
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1575
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1576
+ };
1577
+ imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
1578
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1579
+ throw new Error(v0);
1580
+ };
1581
+ imports.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9 = function(arg0) {
1582
+ getObject(arg0)._wbg_cb_unref();
1583
+ };
1584
+ imports.wbg.__wbg_apply_04097a755e1e4a1e = function() {
1585
+ return handleError(function(arg0, arg1, arg2) {
1586
+ const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
1259
1587
  return addHeapObject(ret);
1260
1588
  }, arguments);
1261
1589
  };
1262
- imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() {
1590
+ imports.wbg.__wbg_at_a848c0ce365c6832 = function(arg0, arg1) {
1591
+ const ret = getObject(arg0).at(arg1);
1592
+ return addHeapObject(ret);
1593
+ };
1594
+ imports.wbg.__wbg_buffer_ccc4520b36d3ccf4 = function(arg0) {
1595
+ const ret = getObject(arg0).buffer;
1596
+ return addHeapObject(ret);
1597
+ };
1598
+ imports.wbg.__wbg_call_525440f72fbfc0ea = function() {
1263
1599
  return handleError(function(arg0, arg1, arg2) {
1264
1600
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1265
1601
  return addHeapObject(ret);
1266
1602
  }, arguments);
1267
1603
  };
1268
- imports.wbg.__wbg_call_833bed5770ea2041 = function() {
1604
+ imports.wbg.__wbg_call_e45d2cf9fc925fcf = function() {
1269
1605
  return handleError(function(arg0, arg1, arg2, arg3) {
1270
1606
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1271
1607
  return addHeapObject(ret);
1272
1608
  }, arguments);
1273
1609
  };
1610
+ imports.wbg.__wbg_call_e762c39fa8ea36bf = function() {
1611
+ return handleError(function(arg0, arg1) {
1612
+ const ret = getObject(arg0).call(getObject(arg1));
1613
+ return addHeapObject(ret);
1614
+ }, arguments);
1615
+ };
1274
1616
  imports.wbg.__wbg_client_new = function(arg0) {
1275
1617
  const ret = Client.__wrap(arg0);
1276
1618
  return addHeapObject(ret);
1277
1619
  };
1278
- imports.wbg.__wbg_debug_3cb59063b29f58c1 = function(arg0) {
1279
- console.debug(getObject(arg0));
1280
- };
1281
- imports.wbg.__wbg_debug_e17b51583ca6a632 = function(arg0, arg1, arg2, arg3) {
1620
+ imports.wbg.__wbg_debug_e55e1461940eb14d = function(arg0, arg1, arg2, arg3) {
1282
1621
  console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1283
1622
  };
1284
- imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
1623
+ imports.wbg.__wbg_debug_f4b0c59db649db48 = function(arg0) {
1624
+ console.debug(getObject(arg0));
1625
+ };
1626
+ imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
1285
1627
  const ret = getObject(arg0).done;
1286
1628
  return ret;
1287
1629
  };
1288
- imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
1630
+ imports.wbg.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
1289
1631
  const ret = Object.entries(getObject(arg0));
1290
1632
  return addHeapObject(ret);
1291
1633
  };
1292
- imports.wbg.__wbg_error_1004b8c64097413f = function(arg0, arg1) {
1634
+ imports.wbg.__wbg_error_6f1d0762f6c8ae2f = function(arg0, arg1) {
1293
1635
  console.error(getObject(arg0), getObject(arg1));
1294
1636
  };
1295
- imports.wbg.__wbg_error_524f506f44df1645 = function(arg0) {
1637
+ imports.wbg.__wbg_error_a7f8fbb0523dae15 = function(arg0) {
1296
1638
  console.error(getObject(arg0));
1297
1639
  };
1298
- imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1299
- let deferred0_0;
1300
- let deferred0_1;
1301
- try {
1302
- deferred0_0 = arg0;
1303
- deferred0_1 = arg1;
1304
- console.error(getStringFromWasm0(arg0, arg1));
1305
- } finally {
1306
- wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1);
1307
- }
1308
- };
1309
- imports.wbg.__wbg_error_80de38b3f7cc3c3c = function(arg0, arg1, arg2, arg3) {
1640
+ imports.wbg.__wbg_error_d8b22cf4e59a6791 = function(arg0, arg1, arg2, arg3) {
1310
1641
  console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1311
1642
  };
1312
- imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
1643
+ imports.wbg.__wbg_from_a4ad7cbddd0d7135 = function(arg0) {
1313
1644
  const ret = Array.from(getObject(arg0));
1314
1645
  return addHeapObject(ret);
1315
1646
  };
1316
- imports.wbg.__wbg_getEntriesByName_2a5a14d4b09f36a4 = function(arg0, arg1, arg2, arg3, arg4) {
1317
- const ret = getObject(arg0).getEntriesByName(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1647
+ imports.wbg.__wbg_getEntriesByName_b49d266abfb2e9af = function(arg0, arg1, arg2, arg3, arg4) {
1648
+ var v0 = getCachedStringFromWasm0(arg1, arg2);
1649
+ var v1 = getCachedStringFromWasm0(arg3, arg4);
1650
+ const ret = getObject(arg0).getEntriesByName(v0, v1);
1318
1651
  return addHeapObject(ret);
1319
1652
  };
1320
- imports.wbg.__wbg_getRandomValues_21a0191e74d0e1d3 = function() {
1653
+ imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() {
1321
1654
  return handleError(function(arg0, arg1) {
1322
1655
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1323
1656
  }, arguments);
1324
1657
  };
1325
- imports.wbg.__wbg_get_67b2ba62fc30de12 = function() {
1658
+ imports.wbg.__wbg_getTime_14776bfb48a1bff9 = function(arg0) {
1659
+ const ret = getObject(arg0).getTime();
1660
+ return ret;
1661
+ };
1662
+ imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
1663
+ const ret = getObject(arg0)[arg1 >>> 0];
1664
+ return addHeapObject(ret);
1665
+ };
1666
+ imports.wbg.__wbg_get_a499fc4db8c05b3b = function(arg0, arg1, arg2) {
1667
+ var v0 = getCachedStringFromWasm0(arg1, arg2);
1668
+ const ret = getObject(arg0)[v0];
1669
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1670
+ };
1671
+ imports.wbg.__wbg_get_efcb449f58ec27c2 = function() {
1326
1672
  return handleError(function(arg0, arg1) {
1327
1673
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
1328
1674
  return addHeapObject(ret);
1329
1675
  }, arguments);
1330
1676
  };
1331
- imports.wbg.__wbg_get_74b8744f6a23f4fa = function(arg0, arg1, arg2) {
1332
- const ret = getObject(arg0)[getStringFromWasm0(arg1, arg2)];
1333
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1334
- };
1335
- imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
1336
- const ret = getObject(arg0)[arg1 >>> 0];
1337
- return addHeapObject(ret);
1338
- };
1339
- imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1677
+ imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
1340
1678
  const ret = getObject(arg0)[getObject(arg1)];
1341
1679
  return addHeapObject(ret);
1342
1680
  };
1343
- imports.wbg.__wbg_has_a5ea9117f258a0ec = function() {
1681
+ imports.wbg.__wbg_has_787fafc980c3ccdb = function() {
1344
1682
  return handleError(function(arg0, arg1) {
1345
1683
  const ret = Reflect.has(getObject(arg0), getObject(arg1));
1346
1684
  return ret;
1347
1685
  }, arguments);
1348
1686
  };
1349
- imports.wbg.__wbg_info_033d8b8a0838f1d3 = function(arg0, arg1, arg2, arg3) {
1687
+ imports.wbg.__wbg_info_68cd5b51ef7e5137 = function(arg0, arg1, arg2, arg3) {
1350
1688
  console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1351
1689
  };
1352
- imports.wbg.__wbg_info_3daf2e093e091b66 = function(arg0) {
1690
+ imports.wbg.__wbg_info_e674a11f4f50cc0c = function(arg0) {
1353
1691
  console.info(getObject(arg0));
1354
1692
  };
1355
- imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
1693
+ imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
1356
1694
  let result;
1357
1695
  try {
1358
1696
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -1362,7 +1700,7 @@ function __wbg_get_imports() {
1362
1700
  const ret = result;
1363
1701
  return ret;
1364
1702
  };
1365
- imports.wbg.__wbg_instanceof_Array_6ac07133d621675a = function(arg0) {
1703
+ imports.wbg.__wbg_instanceof_Array_fca44e0f4a7f6240 = function(arg0) {
1366
1704
  let result;
1367
1705
  try {
1368
1706
  result = getObject(arg0) instanceof Array;
@@ -1372,7 +1710,17 @@ function __wbg_get_imports() {
1372
1710
  const ret = result;
1373
1711
  return ret;
1374
1712
  };
1375
- imports.wbg.__wbg_instanceof_Error_4d54113b22d20306 = function(arg0) {
1713
+ imports.wbg.__wbg_instanceof_Date_79a0f671f36947f2 = function(arg0) {
1714
+ let result;
1715
+ try {
1716
+ result = getObject(arg0) instanceof Date;
1717
+ } catch (_) {
1718
+ result = false;
1719
+ }
1720
+ const ret = result;
1721
+ return ret;
1722
+ };
1723
+ imports.wbg.__wbg_instanceof_Error_a944ec10920129e2 = function(arg0) {
1376
1724
  let result;
1377
1725
  try {
1378
1726
  result = getObject(arg0) instanceof Error;
@@ -1382,7 +1730,7 @@ function __wbg_get_imports() {
1382
1730
  const ret = result;
1383
1731
  return ret;
1384
1732
  };
1385
- imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
1733
+ imports.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
1386
1734
  let result;
1387
1735
  try {
1388
1736
  result = getObject(arg0) instanceof Map;
@@ -1392,7 +1740,7 @@ function __wbg_get_imports() {
1392
1740
  const ret = result;
1393
1741
  return ret;
1394
1742
  };
1395
- imports.wbg.__wbg_instanceof_Object_7f2dcef8f78644a4 = function(arg0) {
1743
+ imports.wbg.__wbg_instanceof_Object_10bb762262230c68 = function(arg0) {
1396
1744
  let result;
1397
1745
  try {
1398
1746
  result = getObject(arg0) instanceof Object;
@@ -1402,7 +1750,17 @@ function __wbg_get_imports() {
1402
1750
  const ret = result;
1403
1751
  return ret;
1404
1752
  };
1405
- imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
1753
+ imports.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef = function(arg0) {
1754
+ let result;
1755
+ try {
1756
+ result = getObject(arg0) instanceof Promise;
1757
+ } catch (_) {
1758
+ result = false;
1759
+ }
1760
+ const ret = result;
1761
+ return ret;
1762
+ };
1763
+ imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
1406
1764
  let result;
1407
1765
  try {
1408
1766
  result = getObject(arg0) instanceof Uint8Array;
@@ -1412,7 +1770,7 @@ function __wbg_get_imports() {
1412
1770
  const ret = result;
1413
1771
  return ret;
1414
1772
  };
1415
- imports.wbg.__wbg_instanceof_Window_def73ea0955fc569 = function(arg0) {
1773
+ imports.wbg.__wbg_instanceof_Window_4846dbb3de56c84c = function(arg0) {
1416
1774
  let result;
1417
1775
  try {
1418
1776
  result = getObject(arg0) instanceof Window;
@@ -1422,52 +1780,63 @@ function __wbg_get_imports() {
1422
1780
  const ret = result;
1423
1781
  return ret;
1424
1782
  };
1425
- imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1783
+ imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
1426
1784
  const ret = Array.isArray(getObject(arg0));
1427
1785
  return ret;
1428
1786
  };
1429
- imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
1787
+ imports.wbg.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
1430
1788
  const ret = Number.isSafeInteger(getObject(arg0));
1431
1789
  return ret;
1432
1790
  };
1433
- imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
1791
+ imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
1434
1792
  const ret = Symbol.iterator;
1435
1793
  return addHeapObject(ret);
1436
1794
  };
1437
- imports.wbg.__wbg_keys_5c77a08ddc2fb8a6 = function(arg0) {
1795
+ imports.wbg.__wbg_jsvirtualdataslice_new = function(arg0) {
1796
+ const ret = JsVirtualDataSlice.__wrap(arg0);
1797
+ return addHeapObject(ret);
1798
+ };
1799
+ imports.wbg.__wbg_keys_b4d27b02ad14f4be = function(arg0) {
1438
1800
  const ret = Object.keys(getObject(arg0));
1439
1801
  return addHeapObject(ret);
1440
1802
  };
1441
- imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
1803
+ imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
1442
1804
  const ret = getObject(arg0).length;
1443
1805
  return ret;
1444
1806
  };
1445
- imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1807
+ imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
1446
1808
  const ret = getObject(arg0).length;
1447
1809
  return ret;
1448
1810
  };
1449
- imports.wbg.__wbg_mark_001da84b098c950f = function() {
1811
+ imports.wbg.__wbg_mark_4411b340bdf62a5f = function() {
1450
1812
  return handleError(function(arg0, arg1, arg2) {
1451
- getObject(arg0).mark(getStringFromWasm0(arg1, arg2));
1813
+ var v0 = getCachedStringFromWasm0(arg1, arg2);
1814
+ getObject(arg0).mark(v0);
1452
1815
  }, arguments);
1453
1816
  };
1454
- imports.wbg.__wbg_measure_65e49f8bc0e203a8 = function() {
1817
+ imports.wbg.__wbg_measure_ef89c90a92de6f43 = function() {
1455
1818
  return handleError(function(arg0, arg1, arg2, arg3, arg4) {
1456
- getObject(arg0).measure(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1819
+ var v0 = getCachedStringFromWasm0(arg1, arg2);
1820
+ var v1 = getCachedStringFromWasm0(arg3, arg4);
1821
+ getObject(arg0).measure(v0, v1);
1457
1822
  }, arguments);
1458
1823
  };
1459
- imports.wbg.__wbg_message_97a2af9b89d693a3 = function(arg0) {
1824
+ imports.wbg.__wbg_message_1ee258909d7264fd = function(arg0) {
1460
1825
  const ret = getObject(arg0).message;
1461
1826
  return addHeapObject(ret);
1462
1827
  };
1463
- imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
1828
+ imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
1829
+ const ret = new Object();
1830
+ return addHeapObject(ret);
1831
+ };
1832
+ imports.wbg.__wbg_new_3c3d849046688a66 = function(arg0, arg1) {
1464
1833
  try {
1465
1834
  var state0 = { a: arg0, b: arg1 };
1466
1835
  var cb0 = (arg02, arg12) => {
1467
1836
  const a = state0.a;
1468
1837
  state0.a = 0;
1469
1838
  try {
1470
- return __wbg_adapter_251(a, state0.b, arg02, arg12);
1839
+ return __wasm_bindgen_func_elem_5064(a, state0.b, arg02, arg12);
1471
1840
  } finally {
1472
1841
  state0.a = a;
1473
1842
  }
@@ -1478,122 +1847,110 @@ function __wbg_get_imports() {
1478
1847
  state0.a = state0.b = 0;
1479
1848
  }
1480
1849
  };
1481
- imports.wbg.__wbg_new_405e22f390576ce2 = function() {
1482
- const ret = new Object();
1850
+ imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
1851
+ const ret = new Uint8Array(getObject(arg0));
1483
1852
  return addHeapObject(ret);
1484
1853
  };
1485
- imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
1854
+ imports.wbg.__wbg_new_68651c719dcda04e = function() {
1486
1855
  const ret = /* @__PURE__ */ new Map();
1487
1856
  return addHeapObject(ret);
1488
1857
  };
1489
- imports.wbg.__wbg_new_78feb108b6472713 = function() {
1490
- const ret = new Array();
1491
- return addHeapObject(ret);
1492
- };
1493
- imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1494
- const ret = new Error();
1858
+ imports.wbg.__wbg_new_a7442b4b19c1a356 = function(arg0, arg1) {
1859
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1860
+ const ret = new Error(v0);
1495
1861
  return addHeapObject(ret);
1496
1862
  };
1497
- imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
1498
- const ret = new Uint8Array(getObject(arg0));
1499
- return addHeapObject(ret);
1500
- };
1501
- imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
1502
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1503
- return addHeapObject(ret);
1504
- };
1505
- imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1506
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1863
+ imports.wbg.__wbg_new_e17d9f43105b08be = function() {
1864
+ const ret = new Array();
1507
1865
  return addHeapObject(ret);
1508
1866
  };
1509
- imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1510
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1867
+ imports.wbg.__wbg_new_from_slice_92f4d78ca282a2d2 = function(arg0, arg1) {
1868
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1511
1869
  return addHeapObject(ret);
1512
1870
  };
1513
- imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
1514
- const ret = getObject(arg0).next;
1871
+ imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {
1872
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1873
+ const ret = new Function(v0);
1515
1874
  return addHeapObject(ret);
1516
1875
  };
1517
- imports.wbg.__wbg_next_6574e1a8a62d1055 = function() {
1876
+ imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() {
1518
1877
  return handleError(function(arg0) {
1519
1878
  const ret = getObject(arg0).next();
1520
1879
  return addHeapObject(ret);
1521
1880
  }, arguments);
1522
1881
  };
1523
- imports.wbg.__wbg_now_d18023d54d4e5500 = function(arg0) {
1882
+ imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
1883
+ const ret = getObject(arg0).next;
1884
+ return addHeapObject(ret);
1885
+ };
1886
+ imports.wbg.__wbg_now_f5ba683d8ce2c571 = function(arg0) {
1524
1887
  const ret = getObject(arg0).now();
1525
1888
  return ret;
1526
1889
  };
1527
- imports.wbg.__wbg_parse_def2e24ef1252aff = function() {
1890
+ imports.wbg.__wbg_parse_2a704d6b78abb2b8 = function() {
1528
1891
  return handleError(function(arg0, arg1) {
1529
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
1892
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1893
+ const ret = JSON.parse(v0);
1530
1894
  return addHeapObject(ret);
1531
1895
  }, arguments);
1532
1896
  };
1533
- imports.wbg.__wbg_performance_c185c0cdc2766575 = function(arg0) {
1897
+ imports.wbg.__wbg_performance_e8315b5ae987e93f = function(arg0) {
1534
1898
  const ret = getObject(arg0).performance;
1535
1899
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1536
1900
  };
1537
- imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
1901
+ imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
1902
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1903
+ };
1904
+ imports.wbg.__wbg_push_df81a39d04db858c = function(arg0, arg1) {
1538
1905
  const ret = getObject(arg0).push(getObject(arg1));
1539
1906
  return ret;
1540
1907
  };
1541
- imports.wbg.__wbg_queueMicrotask_6808622725a52272 = function(arg0) {
1908
+ imports.wbg.__wbg_queueMicrotask_34d692c25c47d05b = function(arg0) {
1542
1909
  const ret = getObject(arg0).queueMicrotask;
1543
1910
  return addHeapObject(ret);
1544
1911
  };
1545
- imports.wbg.__wbg_queueMicrotask_ef0e86b0263a71ee = function(arg0) {
1912
+ imports.wbg.__wbg_queueMicrotask_9d76cacb20c84d58 = function(arg0) {
1546
1913
  queueMicrotask(getObject(arg0));
1547
1914
  };
1548
- imports.wbg.__wbg_reject_b3fcf99063186ff7 = function(arg0) {
1915
+ imports.wbg.__wbg_reject_9d4761245c015a33 = function(arg0) {
1549
1916
  const ret = Promise.reject(getObject(arg0));
1550
1917
  return addHeapObject(ret);
1551
1918
  };
1552
- imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
1919
+ imports.wbg.__wbg_resolve_caf97c30b83f7053 = function(arg0) {
1553
1920
  const ret = Promise.resolve(getObject(arg0));
1554
1921
  return addHeapObject(ret);
1555
1922
  };
1556
- imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
1557
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1558
- };
1559
1923
  imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1560
1924
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1561
1925
  };
1562
- imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1563
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1564
- };
1565
- imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
1926
+ imports.wbg.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
1566
1927
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1567
1928
  return addHeapObject(ret);
1568
1929
  };
1569
- imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1570
- const ret = getObject(arg1).stack;
1571
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1572
- const len1 = WASM_VECTOR_LEN;
1573
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1574
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1930
+ imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
1931
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1575
1932
  };
1576
- imports.wbg.__wbg_startTime_c051731d0a31602f = function(arg0) {
1933
+ imports.wbg.__wbg_startTime_539df5e9647037f7 = function(arg0) {
1577
1934
  const ret = getObject(arg0).startTime;
1578
1935
  return ret;
1579
1936
  };
1580
- imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
1937
+ imports.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {
1581
1938
  const ret = typeof global === "undefined" ? null : global;
1582
1939
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1583
1940
  };
1584
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
1941
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {
1585
1942
  const ret = typeof globalThis === "undefined" ? null : globalThis;
1586
1943
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1587
1944
  };
1588
- imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
1945
+ imports.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {
1589
1946
  const ret = typeof self === "undefined" ? null : self;
1590
1947
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1591
1948
  };
1592
- imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
1949
+ imports.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {
1593
1950
  const ret = typeof window === "undefined" ? null : window;
1594
1951
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1595
1952
  };
1596
- imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() {
1953
+ imports.wbg.__wbg_stringify_b5fb28f6465d9c3e = function() {
1597
1954
  return handleError(function(arg0) {
1598
1955
  const ret = JSON.stringify(getObject(arg0));
1599
1956
  return addHeapObject(ret);
@@ -1603,29 +1960,29 @@ function __wbg_get_imports() {
1603
1960
  const ret = Table.__wrap(arg0);
1604
1961
  return addHeapObject(ret);
1605
1962
  };
1606
- imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
1963
+ imports.wbg.__wbg_then_4f46f6544e6b4a28 = function(arg0, arg1) {
1607
1964
  const ret = getObject(arg0).then(getObject(arg1));
1608
1965
  return addHeapObject(ret);
1609
1966
  };
1610
- imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
1967
+ imports.wbg.__wbg_then_70d05cf780a18d77 = function(arg0, arg1, arg2) {
1611
1968
  const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1612
1969
  return addHeapObject(ret);
1613
1970
  };
1614
- imports.wbg.__wbg_toString_5285597960676b7b = function(arg0) {
1971
+ imports.wbg.__wbg_toString_7da7c8dbec78fcb8 = function(arg0) {
1615
1972
  const ret = getObject(arg0).toString();
1616
1973
  return addHeapObject(ret);
1617
1974
  };
1618
- imports.wbg.__wbg_trace_d12a9ac890a2cbb8 = function(arg0, arg1, arg2, arg3) {
1619
- console.trace(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1620
- };
1621
- imports.wbg.__wbg_trace_e758b839df8d34f1 = function(arg0) {
1975
+ imports.wbg.__wbg_trace_8e50cd754f118df3 = function(arg0) {
1622
1976
  console.trace(getObject(arg0));
1623
1977
  };
1624
- imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1978
+ imports.wbg.__wbg_trace_cf9f10b8c61bd472 = function(arg0, arg1, arg2, arg3) {
1979
+ console.trace(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1980
+ };
1981
+ imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
1625
1982
  const ret = getObject(arg0).value;
1626
1983
  return addHeapObject(ret);
1627
1984
  };
1628
- imports.wbg.__wbg_values_fcb8ba8c0aad8b58 = function(arg0) {
1985
+ imports.wbg.__wbg_values_6f4c6a6a11564d83 = function(arg0) {
1629
1986
  const ret = Object.values(getObject(arg0));
1630
1987
  return addHeapObject(ret);
1631
1988
  };
@@ -1637,107 +1994,50 @@ function __wbg_get_imports() {
1637
1994
  const ret = View.__unwrap(takeObject(arg0));
1638
1995
  return ret;
1639
1996
  };
1640
- imports.wbg.__wbg_warn_4ca3906c248c47c4 = function(arg0) {
1997
+ imports.wbg.__wbg_warn_1d74dddbe2fd1dbb = function(arg0) {
1641
1998
  console.warn(getObject(arg0));
1642
1999
  };
1643
- imports.wbg.__wbg_warn_aaf1f4664a035bd6 = function(arg0, arg1, arg2, arg3) {
2000
+ imports.wbg.__wbg_warn_8f5b5437666d0885 = function(arg0, arg1, arg2, arg3) {
1644
2001
  console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1645
2002
  };
1646
- imports.wbg.__wbindgen_as_number = function(arg0) {
1647
- const ret = +getObject(arg0);
1648
- return ret;
1649
- };
1650
- imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
1651
- const ret = arg0;
2003
+ imports.wbg.__wbindgen_cast_25a0a844437d0e92 = function(arg0, arg1) {
2004
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
2005
+ wasm.__wbindgen_export4(arg0, arg1 * 4, 4);
2006
+ const ret = v0;
1652
2007
  return addHeapObject(ret);
1653
2008
  };
1654
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2009
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1655
2010
  const ret = BigInt.asUintN(64, arg0);
1656
2011
  return addHeapObject(ret);
1657
2012
  };
1658
- imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
1659
- const v = getObject(arg1);
1660
- const ret = typeof v === "bigint" ? v : void 0;
1661
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1662
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1663
- };
1664
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
1665
- const v = getObject(arg0);
1666
- const ret = typeof v === "boolean" ? v ? 1 : 0 : 2;
1667
- return ret;
1668
- };
1669
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
1670
- const obj = takeObject(arg0).original;
1671
- if (obj.cnt-- == 1) {
1672
- obj.a = 0;
1673
- return true;
1674
- }
1675
- const ret = false;
1676
- return ret;
1677
- };
1678
- imports.wbg.__wbindgen_closure_wrapper3224 = function(arg0, arg1, arg2) {
1679
- const ret = makeMutClosure(arg0, arg1, 468, __wbg_adapter_53);
2013
+ imports.wbg.__wbindgen_cast_58f1ec65de0445ab = function(arg0, arg1) {
2014
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3494, __wasm_bindgen_func_elem_3509);
1680
2015
  return addHeapObject(ret);
1681
2016
  };
1682
- imports.wbg.__wbindgen_closure_wrapper367 = function(arg0, arg1, arg2) {
1683
- const ret = makeClosure(arg0, arg1, 7, __wbg_adapter_50);
2017
+ imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
2018
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
2019
+ wasm.__wbindgen_export4(arg0, arg1 * 1, 1);
2020
+ const ret = v0;
1684
2021
  return addHeapObject(ret);
1685
2022
  };
1686
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
1687
- const ret = debugString(getObject(arg1));
1688
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1689
- const len1 = WASM_VECTOR_LEN;
1690
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1691
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1692
- };
1693
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1694
- const ret = new Error(getStringFromWasm0(arg0, arg1));
2023
+ imports.wbg.__wbindgen_cast_7e9c58eeb11b0a6f = function(arg0, arg1) {
2024
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
2025
+ const ret = v0;
1695
2026
  return addHeapObject(ret);
1696
2027
  };
1697
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
1698
- const ret = getObject(arg0) in getObject(arg1);
1699
- return ret;
1700
- };
1701
- imports.wbg.__wbindgen_is_bigint = function(arg0) {
1702
- const ret = typeof getObject(arg0) === "bigint";
1703
- return ret;
1704
- };
1705
- imports.wbg.__wbindgen_is_function = function(arg0) {
1706
- const ret = typeof getObject(arg0) === "function";
1707
- return ret;
1708
- };
1709
- imports.wbg.__wbindgen_is_object = function(arg0) {
1710
- const val = getObject(arg0);
1711
- const ret = typeof val === "object" && val !== null;
1712
- return ret;
1713
- };
1714
- imports.wbg.__wbindgen_is_string = function(arg0) {
1715
- const ret = typeof getObject(arg0) === "string";
1716
- return ret;
1717
- };
1718
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
1719
- const ret = getObject(arg0) === void 0;
1720
- return ret;
1721
- };
1722
- imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
1723
- const ret = getObject(arg0) === getObject(arg1);
1724
- return ret;
1725
- };
1726
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1727
- const ret = getObject(arg0) == getObject(arg1);
1728
- return ret;
2028
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
2029
+ const ret = arg0;
2030
+ return addHeapObject(ret);
1729
2031
  };
1730
- imports.wbg.__wbindgen_memory = function() {
1731
- const ret = wasm.memory;
2032
+ imports.wbg.__wbindgen_cast_b4f8efd6e03d7eb3 = function(arg0, arg1) {
2033
+ const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_123, __wasm_bindgen_func_elem_553);
1732
2034
  return addHeapObject(ret);
1733
2035
  };
1734
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
1735
- const obj = getObject(arg1);
1736
- const ret = typeof obj === "number" ? obj : void 0;
1737
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1738
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2036
+ imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
2037
+ const ret = getArrayU8FromWasm0(arg0, arg1);
2038
+ return addHeapObject(ret);
1739
2039
  };
1740
- imports.wbg.__wbindgen_number_new = function(arg0) {
2040
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1741
2041
  const ret = arg0;
1742
2042
  return addHeapObject(ret);
1743
2043
  };
@@ -1748,25 +2048,8 @@ function __wbg_get_imports() {
1748
2048
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
1749
2049
  takeObject(arg0);
1750
2050
  };
1751
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
1752
- const obj = getObject(arg1);
1753
- const ret = typeof obj === "string" ? obj : void 0;
1754
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1755
- var len1 = WASM_VECTOR_LEN;
1756
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1757
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1758
- };
1759
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1760
- const ret = getStringFromWasm0(arg0, arg1);
1761
- return addHeapObject(ret);
1762
- };
1763
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1764
- throw new Error(getStringFromWasm0(arg0, arg1));
1765
- };
1766
2051
  return imports;
1767
2052
  }
1768
- function __wbg_init_memory(imports, memory) {
1769
- }
1770
2053
  function __wbg_finalize_init(instance, module) {
1771
2054
  wasm = instance.exports;
1772
2055
  __wbg_init.__wbindgen_wasm_module = module;
@@ -1774,6 +2057,22 @@ function __wbg_finalize_init(instance, module) {
1774
2057
  cachedUint8ArrayMemory0 = null;
1775
2058
  return wasm;
1776
2059
  }
2060
+ function initSync(module) {
2061
+ if (wasm !== void 0) return wasm;
2062
+ if (typeof module !== "undefined") {
2063
+ if (Object.getPrototypeOf(module) === Object.prototype) {
2064
+ ({ module } = module);
2065
+ } else {
2066
+ console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
2067
+ }
2068
+ }
2069
+ const imports = __wbg_get_imports();
2070
+ if (!(module instanceof WebAssembly.Module)) {
2071
+ module = new WebAssembly.Module(module);
2072
+ }
2073
+ const instance = new WebAssembly.Instance(module, imports);
2074
+ return __wbg_finalize_init(instance, module);
2075
+ }
1777
2076
  async function __wbg_init(module_or_path) {
1778
2077
  if (wasm !== void 0) return wasm;
1779
2078
  if (typeof module_or_path !== "undefined") {
@@ -1787,7 +2086,6 @@ async function __wbg_init(module_or_path) {
1787
2086
  if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
1788
2087
  module_or_path = fetch(module_or_path);
1789
2088
  }
1790
- __wbg_init_memory(imports);
1791
2089
  const { instance, module } = await __wbg_load(await module_or_path, imports);
1792
2090
  return __wbg_finalize_init(instance, module);
1793
2091
  }
@@ -2234,6 +2532,41 @@ async function websocket(WebSocket2, Client2, url2, options) {
2234
2532
  return client;
2235
2533
  }
2236
2534
 
2535
+ // src/ts/virtual_server.ts
2536
+ function createMessageHandler(mod, handler) {
2537
+ let virtualServer;
2538
+ async function postMessage(port, msg) {
2539
+ if (msg.data.cmd === "init") {
2540
+ try {
2541
+ virtualServer = new mod.JsVirtualServer(handler);
2542
+ if (msg.data.id !== void 0) {
2543
+ port.postMessage({ id: msg.data.id });
2544
+ } else {
2545
+ port.postMessage(null);
2546
+ }
2547
+ } catch (error) {
2548
+ console.error("Error initializing worker:", error);
2549
+ throw error;
2550
+ }
2551
+ } else {
2552
+ try {
2553
+ const requestBytes = new Uint8Array(msg.data);
2554
+ const responseBytes = await virtualServer.handleRequest(requestBytes);
2555
+ const buffer = responseBytes.slice().buffer;
2556
+ port.postMessage(buffer, { transfer: [buffer] });
2557
+ } catch (error) {
2558
+ console.error("Error handling request in worker:", error);
2559
+ throw error;
2560
+ }
2561
+ }
2562
+ }
2563
+ const channel = new MessageChannel();
2564
+ channel.port1.onmessage = (message) => {
2565
+ postMessage(channel.port1, message);
2566
+ };
2567
+ return channel.port2;
2568
+ }
2569
+
2237
2570
  // src/ts/perspective.node.ts
2238
2571
  var __dirname = path.dirname(url.fileURLToPath(import.meta.url));
2239
2572
  var { resolve } = createRequire(import.meta.url);
@@ -2403,9 +2736,43 @@ async function websocket2(url2) {
2403
2736
  url2
2404
2737
  );
2405
2738
  }
2739
+ async function worker(worker2) {
2740
+ const port = await worker2;
2741
+ const client = new Client(
2742
+ async (proto) => {
2743
+ const f = proto.slice().buffer;
2744
+ port.postMessage(f, { transfer: [f] });
2745
+ },
2746
+ async () => {
2747
+ console.debug("Closing WebWorker");
2748
+ port.close();
2749
+ }
2750
+ );
2751
+ const { promise, resolve: resolve2, reject } = Promise.withResolvers();
2752
+ port.onmessage = function listener(resp) {
2753
+ port.onmessage = null;
2754
+ resolve2(null);
2755
+ };
2756
+ port.onmessageerror = function(...args) {
2757
+ port.onmessage = null;
2758
+ console.error(...args);
2759
+ reject(args);
2760
+ };
2761
+ port.postMessage({ cmd: "init", args: [] });
2762
+ await promise;
2763
+ port.addEventListener("message", (json) => {
2764
+ client.handle_response(json.data);
2765
+ });
2766
+ console.log(client);
2767
+ return client;
2768
+ }
2769
+ function createMessageHandler2(handler) {
2770
+ return createMessageHandler(perspective_js_exports, handler);
2771
+ }
2406
2772
  var perspective_node_default = {
2407
2773
  table,
2408
2774
  websocket: websocket2,
2775
+ worker,
2409
2776
  get_hosted_table_names,
2410
2777
  on_hosted_tables_update,
2411
2778
  remove_hosted_tables_update,
@@ -2416,6 +2783,7 @@ var perspective_node_default = {
2416
2783
  export {
2417
2784
  PerspectiveServer2 as PerspectiveServer,
2418
2785
  WebSocketServer,
2786
+ createMessageHandler2 as createMessageHandler,
2419
2787
  cwd_static_file_handler,
2420
2788
  perspective_node_default as default,
2421
2789
  get_hosted_table_names,
@@ -2426,6 +2794,7 @@ export {
2426
2794
  remove_hosted_tables_update,
2427
2795
  system_info,
2428
2796
  table,
2429
- websocket2 as websocket
2797
+ websocket2 as websocket,
2798
+ worker
2430
2799
  };
2431
2800
  //# sourceMappingURL=perspective.node.js.map