@octoseq/visualiser 0.1.0-main.4f31910 → 0.1.0-main.5fdb072

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2203 @@
1
+ let wasm;
2
+
3
+ function addHeapObject(obj) {
4
+ if (heap_next === heap.length) heap.push(heap.length + 1);
5
+ const idx = heap_next;
6
+ heap_next = heap[idx];
7
+
8
+ heap[idx] = obj;
9
+ return idx;
10
+ }
11
+
12
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
13
+ ? { register: () => {}, unregister: () => {} }
14
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
15
+
16
+ function debugString(val) {
17
+ // primitive types
18
+ const type = typeof val;
19
+ if (type == 'number' || type == 'boolean' || val == null) {
20
+ return `${val}`;
21
+ }
22
+ if (type == 'string') {
23
+ return `"${val}"`;
24
+ }
25
+ if (type == 'symbol') {
26
+ const description = val.description;
27
+ if (description == null) {
28
+ return 'Symbol';
29
+ } else {
30
+ return `Symbol(${description})`;
31
+ }
32
+ }
33
+ if (type == 'function') {
34
+ const name = val.name;
35
+ if (typeof name == 'string' && name.length > 0) {
36
+ return `Function(${name})`;
37
+ } else {
38
+ return 'Function';
39
+ }
40
+ }
41
+ // objects
42
+ if (Array.isArray(val)) {
43
+ const length = val.length;
44
+ let debug = '[';
45
+ if (length > 0) {
46
+ debug += debugString(val[0]);
47
+ }
48
+ for(let i = 1; i < length; i++) {
49
+ debug += ', ' + debugString(val[i]);
50
+ }
51
+ debug += ']';
52
+ return debug;
53
+ }
54
+ // Test for built-in
55
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
56
+ let className;
57
+ if (builtInMatches && builtInMatches.length > 1) {
58
+ className = builtInMatches[1];
59
+ } else {
60
+ // Failed to match the standard '[object ClassName]'
61
+ return toString.call(val);
62
+ }
63
+ if (className == 'Object') {
64
+ // we're a user defined class or Object
65
+ // JSON.stringify avoids problems with cycles, and is generally much
66
+ // easier than looping through ownProperties of `val`.
67
+ try {
68
+ return 'Object(' + JSON.stringify(val) + ')';
69
+ } catch (_) {
70
+ return 'Object';
71
+ }
72
+ }
73
+ // errors
74
+ if (val instanceof Error) {
75
+ return `${val.name}: ${val.message}\n${val.stack}`;
76
+ }
77
+ // TODO we could test for more things here, like `Set`s and `Map`s.
78
+ return className;
79
+ }
80
+
81
+ function dropObject(idx) {
82
+ if (idx < 132) return;
83
+ heap[idx] = heap_next;
84
+ heap_next = idx;
85
+ }
86
+
87
+ function getArrayF32FromWasm0(ptr, len) {
88
+ ptr = ptr >>> 0;
89
+ return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
90
+ }
91
+
92
+ function getArrayU32FromWasm0(ptr, len) {
93
+ ptr = ptr >>> 0;
94
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
95
+ }
96
+
97
+ function getArrayU8FromWasm0(ptr, len) {
98
+ ptr = ptr >>> 0;
99
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
100
+ }
101
+
102
+ let cachedDataViewMemory0 = null;
103
+ function getDataViewMemory0() {
104
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
105
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
106
+ }
107
+ return cachedDataViewMemory0;
108
+ }
109
+
110
+ let cachedFloat32ArrayMemory0 = null;
111
+ function getFloat32ArrayMemory0() {
112
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
113
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
114
+ }
115
+ return cachedFloat32ArrayMemory0;
116
+ }
117
+
118
+ function getStringFromWasm0(ptr, len) {
119
+ ptr = ptr >>> 0;
120
+ return decodeText(ptr, len);
121
+ }
122
+
123
+ let cachedUint32ArrayMemory0 = null;
124
+ function getUint32ArrayMemory0() {
125
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
126
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
127
+ }
128
+ return cachedUint32ArrayMemory0;
129
+ }
130
+
131
+ let cachedUint8ArrayMemory0 = null;
132
+ function getUint8ArrayMemory0() {
133
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
134
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
135
+ }
136
+ return cachedUint8ArrayMemory0;
137
+ }
138
+
139
+ function getObject(idx) { return heap[idx]; }
140
+
141
+ function handleError(f, args) {
142
+ try {
143
+ return f.apply(this, args);
144
+ } catch (e) {
145
+ wasm.__wbindgen_export3(addHeapObject(e));
146
+ }
147
+ }
148
+
149
+ let heap = new Array(128).fill(undefined);
150
+ heap.push(undefined, null, true, false);
151
+
152
+ let heap_next = heap.length;
153
+
154
+ function isLikeNone(x) {
155
+ return x === undefined || x === null;
156
+ }
157
+
158
+ function makeMutClosure(arg0, arg1, dtor, f) {
159
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
160
+ const real = (...args) => {
161
+
162
+ // First up with a closure we increment the internal reference
163
+ // count. This ensures that the Rust closure environment won't
164
+ // be deallocated while we're invoking it.
165
+ state.cnt++;
166
+ const a = state.a;
167
+ state.a = 0;
168
+ try {
169
+ return f(a, state.b, ...args);
170
+ } finally {
171
+ state.a = a;
172
+ real._wbg_cb_unref();
173
+ }
174
+ };
175
+ real._wbg_cb_unref = () => {
176
+ if (--state.cnt === 0) {
177
+ state.dtor(state.a, state.b);
178
+ state.a = 0;
179
+ CLOSURE_DTORS.unregister(state);
180
+ }
181
+ };
182
+ CLOSURE_DTORS.register(real, state, state);
183
+ return real;
184
+ }
185
+
186
+ function passArrayF32ToWasm0(arg, malloc) {
187
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
188
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
189
+ WASM_VECTOR_LEN = arg.length;
190
+ return ptr;
191
+ }
192
+
193
+ function passStringToWasm0(arg, malloc, realloc) {
194
+ if (realloc === undefined) {
195
+ const buf = cachedTextEncoder.encode(arg);
196
+ const ptr = malloc(buf.length, 1) >>> 0;
197
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
198
+ WASM_VECTOR_LEN = buf.length;
199
+ return ptr;
200
+ }
201
+
202
+ let len = arg.length;
203
+ let ptr = malloc(len, 1) >>> 0;
204
+
205
+ const mem = getUint8ArrayMemory0();
206
+
207
+ let offset = 0;
208
+
209
+ for (; offset < len; offset++) {
210
+ const code = arg.charCodeAt(offset);
211
+ if (code > 0x7F) break;
212
+ mem[ptr + offset] = code;
213
+ }
214
+ if (offset !== len) {
215
+ if (offset !== 0) {
216
+ arg = arg.slice(offset);
217
+ }
218
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
219
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
220
+ const ret = cachedTextEncoder.encodeInto(arg, view);
221
+
222
+ offset += ret.written;
223
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
224
+ }
225
+
226
+ WASM_VECTOR_LEN = offset;
227
+ return ptr;
228
+ }
229
+
230
+ function takeObject(idx) {
231
+ const ret = getObject(idx);
232
+ dropObject(idx);
233
+ return ret;
234
+ }
235
+
236
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
237
+ cachedTextDecoder.decode();
238
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
239
+ let numBytesDecoded = 0;
240
+ function decodeText(ptr, len) {
241
+ numBytesDecoded += len;
242
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
243
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
244
+ cachedTextDecoder.decode();
245
+ numBytesDecoded = len;
246
+ }
247
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
248
+ }
249
+
250
+ const cachedTextEncoder = new TextEncoder();
251
+
252
+ if (!('encodeInto' in cachedTextEncoder)) {
253
+ cachedTextEncoder.encodeInto = function (arg, view) {
254
+ const buf = cachedTextEncoder.encode(arg);
255
+ view.set(buf);
256
+ return {
257
+ read: arg.length,
258
+ written: buf.length
259
+ };
260
+ }
261
+ }
262
+
263
+ let WASM_VECTOR_LEN = 0;
264
+
265
+ function __wasm_bindgen_func_elem_10256(arg0, arg1, arg2) {
266
+ wasm.__wasm_bindgen_func_elem_10256(arg0, arg1, addHeapObject(arg2));
267
+ }
268
+
269
+ function __wasm_bindgen_func_elem_11338(arg0, arg1, arg2) {
270
+ wasm.__wasm_bindgen_func_elem_11338(arg0, arg1, addHeapObject(arg2));
271
+ }
272
+
273
+ function __wasm_bindgen_func_elem_11945(arg0, arg1, arg2, arg3) {
274
+ wasm.__wasm_bindgen_func_elem_11945(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
275
+ }
276
+
277
+ const __wbindgen_enum_GpuCompilationMessageType = ["error", "warning", "info"];
278
+
279
+ const __wbindgen_enum_GpuDeviceLostReason = ["unknown", "destroyed"];
280
+
281
+ const __wbindgen_enum_GpuErrorFilter = ["validation", "out-of-memory", "internal"];
282
+
283
+ const __wbindgen_enum_GpuIndexFormat = ["uint16", "uint32"];
284
+
285
+ const __wbindgen_enum_GpuTextureFormat = ["r8unorm", "r8snorm", "r8uint", "r8sint", "r16uint", "r16sint", "r16float", "rg8unorm", "rg8snorm", "rg8uint", "rg8sint", "r32uint", "r32sint", "r32float", "rg16uint", "rg16sint", "rg16float", "rgba8unorm", "rgba8unorm-srgb", "rgba8snorm", "rgba8uint", "rgba8sint", "bgra8unorm", "bgra8unorm-srgb", "rgb9e5ufloat", "rgb10a2uint", "rgb10a2unorm", "rg11b10ufloat", "rg32uint", "rg32sint", "rg32float", "rgba16uint", "rgba16sint", "rgba16float", "rgba32uint", "rgba32sint", "rgba32float", "stencil8", "depth16unorm", "depth24plus", "depth24plus-stencil8", "depth32float", "depth32float-stencil8", "bc1-rgba-unorm", "bc1-rgba-unorm-srgb", "bc2-rgba-unorm", "bc2-rgba-unorm-srgb", "bc3-rgba-unorm", "bc3-rgba-unorm-srgb", "bc4-r-unorm", "bc4-r-snorm", "bc5-rg-unorm", "bc5-rg-snorm", "bc6h-rgb-ufloat", "bc6h-rgb-float", "bc7-rgba-unorm", "bc7-rgba-unorm-srgb", "etc2-rgb8unorm", "etc2-rgb8unorm-srgb", "etc2-rgb8a1unorm", "etc2-rgb8a1unorm-srgb", "etc2-rgba8unorm", "etc2-rgba8unorm-srgb", "eac-r11unorm", "eac-r11snorm", "eac-rg11unorm", "eac-rg11snorm", "astc-4x4-unorm", "astc-4x4-unorm-srgb", "astc-5x4-unorm", "astc-5x4-unorm-srgb", "astc-5x5-unorm", "astc-5x5-unorm-srgb", "astc-6x5-unorm", "astc-6x5-unorm-srgb", "astc-6x6-unorm", "astc-6x6-unorm-srgb", "astc-8x5-unorm", "astc-8x5-unorm-srgb", "astc-8x6-unorm", "astc-8x6-unorm-srgb", "astc-8x8-unorm", "astc-8x8-unorm-srgb", "astc-10x5-unorm", "astc-10x5-unorm-srgb", "astc-10x6-unorm", "astc-10x6-unorm-srgb", "astc-10x8-unorm", "astc-10x8-unorm-srgb", "astc-10x10-unorm", "astc-10x10-unorm-srgb", "astc-12x10-unorm", "astc-12x10-unorm-srgb", "astc-12x12-unorm", "astc-12x12-unorm-srgb"];
286
+
287
+ const WasmVisualiserFinalization = (typeof FinalizationRegistry === 'undefined')
288
+ ? { register: () => {}, unregister: () => {} }
289
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmvisualiser_free(ptr >>> 0, 1));
290
+
291
+ export class WasmVisualiser {
292
+ static __wrap(ptr) {
293
+ ptr = ptr >>> 0;
294
+ const obj = Object.create(WasmVisualiser.prototype);
295
+ obj.__wbg_ptr = ptr;
296
+ WasmVisualiserFinalization.register(obj, obj.__wbg_ptr, obj);
297
+ return obj;
298
+ }
299
+ __destroy_into_raw() {
300
+ const ptr = this.__wbg_ptr;
301
+ this.__wbg_ptr = 0;
302
+ WasmVisualiserFinalization.unregister(this);
303
+ return ptr;
304
+ }
305
+ free() {
306
+ const ptr = this.__destroy_into_raw();
307
+ wasm.__wbg_wasmvisualiser_free(ptr, 0);
308
+ }
309
+ /**
310
+ * Check if a script is currently loaded.
311
+ * @returns {boolean}
312
+ */
313
+ has_script() {
314
+ const ret = wasm.wasmvisualiser_has_script(this.__wbg_ptr);
315
+ return ret !== 0;
316
+ }
317
+ /**
318
+ * Check if a signal variable exists in the current script.
319
+ * @param {string} name
320
+ * @returns {boolean}
321
+ */
322
+ has_signal(name) {
323
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
324
+ const len0 = WASM_VECTOR_LEN;
325
+ const ret = wasm.wasmvisualiser_has_signal(this.__wbg_ptr, ptr0, len0);
326
+ return ret !== 0;
327
+ }
328
+ /**
329
+ * Load a Rhai script for controlling the visualiser.
330
+ * Returns true if the script was loaded successfully.
331
+ * @param {string} script
332
+ * @returns {boolean}
333
+ */
334
+ load_script(script) {
335
+ const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
336
+ const len0 = WASM_VECTOR_LEN;
337
+ const ret = wasm.wasmvisualiser_load_script(this.__wbg_ptr, ptr0, len0);
338
+ return ret !== 0;
339
+ }
340
+ /**
341
+ * Push a named signal for use in scripts.
342
+ * The signal will be available as `inputs.<name>` in Rhai scripts.
343
+ * @param {string} name
344
+ * @param {Float32Array} samples
345
+ * @param {number} sample_rate
346
+ */
347
+ push_signal(name, samples, sample_rate) {
348
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
349
+ const len0 = WASM_VECTOR_LEN;
350
+ const ptr1 = passArrayF32ToWasm0(samples, wasm.__wbindgen_export);
351
+ const len1 = WASM_VECTOR_LEN;
352
+ wasm.wasmvisualiser_push_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, sample_rate);
353
+ }
354
+ /**
355
+ * Run script in analysis mode to collect debug.emit() signals.
356
+ *
357
+ * This runs the script headlessly across the full track duration,
358
+ * collecting all debug.emit() calls without rendering.
359
+ *
360
+ * Returns a JSON-serialized AnalysisResultJson.
361
+ * @param {string} script
362
+ * @param {number} duration
363
+ * @param {number} time_step
364
+ * @returns {string}
365
+ */
366
+ run_analysis(script, duration, time_step) {
367
+ let deferred2_0;
368
+ let deferred2_1;
369
+ try {
370
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
371
+ const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
372
+ const len0 = WASM_VECTOR_LEN;
373
+ wasm.wasmvisualiser_run_analysis(retptr, this.__wbg_ptr, ptr0, len0, duration, time_step);
374
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
375
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
376
+ deferred2_0 = r0;
377
+ deferred2_1 = r1;
378
+ return getStringFromWasm0(r0, r1);
379
+ } finally {
380
+ wasm.__wbindgen_add_to_stack_pointer(16);
381
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
382
+ }
383
+ }
384
+ /**
385
+ * Clear all named signals.
386
+ */
387
+ clear_signals() {
388
+ wasm.wasmvisualiser_clear_signals(this.__wbg_ptr);
389
+ }
390
+ /**
391
+ * @param {number} k
392
+ */
393
+ set_sigmoid_k(k) {
394
+ wasm.wasmvisualiser_set_sigmoid_k(this.__wbg_ptr, k);
395
+ }
396
+ /**
397
+ * Isolate a single entity for rendering (useful for debugging).
398
+ * Only this entity will be rendered.
399
+ * @param {bigint} entity_id
400
+ */
401
+ isolate_entity(entity_id) {
402
+ wasm.wasmvisualiser_isolate_entity(this.__wbg_ptr, entity_id);
403
+ }
404
+ /**
405
+ * @param {Float32Array} samples
406
+ * @param {number} sample_rate
407
+ */
408
+ push_zoom_data(samples, sample_rate) {
409
+ const ptr0 = passArrayF32ToWasm0(samples, wasm.__wbindgen_export);
410
+ const len0 = WASM_VECTOR_LEN;
411
+ wasm.wasmvisualiser_push_zoom_data(this.__wbg_ptr, ptr0, len0, sample_rate);
412
+ }
413
+ /**
414
+ * Clear entity isolation, resume normal rendering.
415
+ */
416
+ clear_isolation() {
417
+ wasm.wasmvisualiser_clear_isolation(this.__wbg_ptr);
418
+ }
419
+ /**
420
+ * Get current state values for debugging.
421
+ * Returns [time, scene_entity_count, mesh_count, line_count]
422
+ * @returns {Float32Array}
423
+ */
424
+ get_current_vals() {
425
+ try {
426
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
427
+ wasm.wasmvisualiser_get_current_vals(retptr, this.__wbg_ptr);
428
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
429
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
430
+ var v1 = getArrayF32FromWasm0(r0, r1).slice();
431
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
432
+ return v1;
433
+ } finally {
434
+ wasm.__wbindgen_add_to_stack_pointer(16);
435
+ }
436
+ }
437
+ /**
438
+ * Get the last script error message, if any.
439
+ * @returns {string | undefined}
440
+ */
441
+ get_script_error() {
442
+ try {
443
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
444
+ wasm.wasmvisualiser_get_script_error(retptr, this.__wbg_ptr);
445
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
446
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
447
+ let v1;
448
+ if (r0 !== 0) {
449
+ v1 = getStringFromWasm0(r0, r1).slice();
450
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
451
+ }
452
+ return v1;
453
+ } finally {
454
+ wasm.__wbindgen_add_to_stack_pointer(16);
455
+ }
456
+ }
457
+ /**
458
+ * Get the list of available signal names.
459
+ * Returns a JSON array of signal names.
460
+ * @returns {string}
461
+ */
462
+ get_signal_names() {
463
+ let deferred1_0;
464
+ let deferred1_1;
465
+ try {
466
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
467
+ wasm.wasmvisualiser_get_signal_names(retptr, this.__wbg_ptr);
468
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
469
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
470
+ deferred1_0 = r0;
471
+ deferred1_1 = r1;
472
+ return getStringFromWasm0(r0, r1);
473
+ } finally {
474
+ wasm.__wbindgen_add_to_stack_pointer(16);
475
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
476
+ }
477
+ }
478
+ /**
479
+ * Get a list of all registered mesh asset IDs.
480
+ * Returns a JSON array of asset IDs.
481
+ * @returns {string}
482
+ */
483
+ list_mesh_assets() {
484
+ let deferred1_0;
485
+ let deferred1_1;
486
+ try {
487
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
488
+ wasm.wasmvisualiser_list_mesh_assets(retptr, this.__wbg_ptr);
489
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
490
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
491
+ deferred1_0 = r0;
492
+ deferred1_1 = r1;
493
+ return getStringFromWasm0(r0, r1);
494
+ } finally {
495
+ wasm.__wbindgen_add_to_stack_pointer(16);
496
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
497
+ }
498
+ }
499
+ /**
500
+ * Push pre-extracted events for a band.
501
+ *
502
+ * Events are extracted by the TypeScript layer using the existing peak picker,
503
+ * then pushed here for script access via `inputs.bands[id].events`.
504
+ *
505
+ * The JSON format should be an array of event objects with:
506
+ * - time: f32
507
+ * - weight: f32
508
+ * - beat_position: Option<f32>
509
+ * - beat_phase: Option<f32>
510
+ * - cluster_id: Option<u32>
511
+ *
512
+ * Returns true if successful, false if parsing failed.
513
+ * @param {string} band_id
514
+ * @param {string} events_json
515
+ * @returns {boolean}
516
+ */
517
+ push_band_events(band_id, events_json) {
518
+ const ptr0 = passStringToWasm0(band_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
519
+ const len0 = WASM_VECTOR_LEN;
520
+ const ptr1 = passStringToWasm0(events_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
521
+ const len1 = WASM_VECTOR_LEN;
522
+ const ret = wasm.wasmvisualiser_push_band_events(this.__wbg_ptr, ptr0, len0, ptr1, len1);
523
+ return ret !== 0;
524
+ }
525
+ /**
526
+ * Push a band-scoped signal for use in scripts.
527
+ * The signal will be available as `inputs.bands[band_id].{feature}` in Rhai scripts.
528
+ * Stores under both band_id and band_label for dual-access support.
529
+ *
530
+ * - `band_id`: The unique ID of the frequency band.
531
+ * - `band_label`: The user-visible label of the band.
532
+ * - `feature`: Signal type ("energy", "onset", "flux").
533
+ * - `samples`: Signal data.
534
+ * - `sample_rate`: Sample rate of the signal.
535
+ * @param {string} band_id
536
+ * @param {string} band_label
537
+ * @param {string} feature
538
+ * @param {Float32Array} samples
539
+ * @param {number} sample_rate
540
+ */
541
+ push_band_signal(band_id, band_label, feature, samples, sample_rate) {
542
+ const ptr0 = passStringToWasm0(band_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
543
+ const len0 = WASM_VECTOR_LEN;
544
+ const ptr1 = passStringToWasm0(band_label, wasm.__wbindgen_export, wasm.__wbindgen_export2);
545
+ const len1 = WASM_VECTOR_LEN;
546
+ const ptr2 = passStringToWasm0(feature, wasm.__wbindgen_export, wasm.__wbindgen_export2);
547
+ const len2 = WASM_VECTOR_LEN;
548
+ const ptr3 = passArrayF32ToWasm0(samples, wasm.__wbindgen_export);
549
+ const len3 = WASM_VECTOR_LEN;
550
+ wasm.wasmvisualiser_push_band_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, sample_rate);
551
+ }
552
+ /**
553
+ * Push a stem-scoped signal for use in scripts.
554
+ * The signal will be available as `inputs.stems[stem_id].{feature}` in Rhai scripts.
555
+ * Stores under both stem_id and stem_label for dual-access support.
556
+ *
557
+ * - `stem_id`: The unique ID of the stem.
558
+ * - `stem_label`: The user-visible label of the stem.
559
+ * - `feature`: Signal type ("energy", "onset", "flux").
560
+ * - `samples`: Signal data.
561
+ * - `sample_rate`: Sample rate of the signal.
562
+ * @param {string} stem_id
563
+ * @param {string} stem_label
564
+ * @param {string} feature
565
+ * @param {Float32Array} samples
566
+ * @param {number} sample_rate
567
+ */
568
+ push_stem_signal(stem_id, stem_label, feature, samples, sample_rate) {
569
+ const ptr0 = passStringToWasm0(stem_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
570
+ const len0 = WASM_VECTOR_LEN;
571
+ const ptr1 = passStringToWasm0(stem_label, wasm.__wbindgen_export, wasm.__wbindgen_export2);
572
+ const len1 = WASM_VECTOR_LEN;
573
+ const ptr2 = passStringToWasm0(feature, wasm.__wbindgen_export, wasm.__wbindgen_export2);
574
+ const len2 = WASM_VECTOR_LEN;
575
+ const ptr3 = passArrayF32ToWasm0(samples, wasm.__wbindgen_export);
576
+ const len3 = WASM_VECTOR_LEN;
577
+ wasm.wasmvisualiser_push_stem_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, sample_rate);
578
+ }
579
+ /**
580
+ * Set the musical time structure for beat-aware signal processing.
581
+ * The JSON format matches the TypeScript MusicalTimeStructure type.
582
+ * Returns true if successful, false if parsing failed.
583
+ * @param {string} json
584
+ * @returns {boolean}
585
+ */
586
+ set_musical_time(json) {
587
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
588
+ const len0 = WASM_VECTOR_LEN;
589
+ const ret = wasm.wasmvisualiser_set_musical_time(this.__wbg_ptr, ptr0, len0);
590
+ return ret !== 0;
591
+ }
592
+ /**
593
+ * Clear all band event streams.
594
+ */
595
+ clear_band_events() {
596
+ wasm.wasmvisualiser_clear_band_events(this.__wbg_ptr);
597
+ }
598
+ /**
599
+ * Push a named event stream (e.g., "beatCandidates") for script access.
600
+ *
601
+ * The event stream will be available as `inputs.<name>` in Rhai scripts.
602
+ * This is used for MIR-derived events like beat candidates, onset peaks, etc.
603
+ *
604
+ * The JSON format should be an array of event objects with:
605
+ * - time: f32
606
+ * - weight: f32
607
+ * - beat_position: Option<f32>
608
+ * - beat_phase: Option<f32>
609
+ * - cluster_id: Option<u32>
610
+ *
611
+ * Returns true if successful, false if parsing failed.
612
+ * @param {string} name
613
+ * @param {string} events_json
614
+ * @returns {boolean}
615
+ */
616
+ push_event_stream(name, events_json) {
617
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
618
+ const len0 = WASM_VECTOR_LEN;
619
+ const ptr1 = passStringToWasm0(events_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
620
+ const len1 = WASM_VECTOR_LEN;
621
+ const ret = wasm.wasmvisualiser_push_event_stream(this.__wbg_ptr, ptr0, len0, ptr1, len1);
622
+ return ret !== 0;
623
+ }
624
+ /**
625
+ * Set debug visualization options.
626
+ * @param {boolean} wireframe
627
+ * @param {boolean} bounding_boxes
628
+ */
629
+ set_debug_options(wireframe, bounding_boxes) {
630
+ wasm.wasmvisualiser_set_debug_options(this.__wbg_ptr, wireframe, bounding_boxes);
631
+ }
632
+ /**
633
+ * Clear all band signals.
634
+ */
635
+ clear_band_signals() {
636
+ wasm.wasmvisualiser_clear_band_signals(this.__wbg_ptr);
637
+ }
638
+ /**
639
+ * Clear the musical time structure.
640
+ * Beat-aware operations will fall back to 120 BPM default.
641
+ */
642
+ clear_musical_time() {
643
+ wasm.wasmvisualiser_clear_musical_time(this.__wbg_ptr);
644
+ }
645
+ /**
646
+ * Clear all stem signals.
647
+ */
648
+ clear_stem_signals() {
649
+ wasm.wasmvisualiser_clear_stem_signals(this.__wbg_ptr);
650
+ }
651
+ /**
652
+ * Get frequency bounds for all active bands at a given time.
653
+ * Returns a JSON array of { bandId, label, lowHz, highHz, enabled } objects.
654
+ * @param {number} time
655
+ * @returns {string}
656
+ */
657
+ get_band_bounds_at(time) {
658
+ let deferred1_0;
659
+ let deferred1_1;
660
+ try {
661
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
662
+ wasm.wasmvisualiser_get_band_bounds_at(retptr, this.__wbg_ptr, time);
663
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
664
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
665
+ deferred1_0 = r0;
666
+ deferred1_1 = r1;
667
+ return getStringFromWasm0(r0, r1);
668
+ } finally {
669
+ wasm.__wbindgen_add_to_stack_pointer(16);
670
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
671
+ }
672
+ }
673
+ /**
674
+ * Get all Signal variables from the current script.
675
+ * Returns a JSON array of ScriptSignalInfo objects.
676
+ * @returns {string}
677
+ */
678
+ get_script_signals() {
679
+ let deferred1_0;
680
+ let deferred1_1;
681
+ try {
682
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
683
+ wasm.wasmvisualiser_get_script_signals(retptr, this.__wbg_ptr);
684
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
685
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
686
+ deferred1_0 = r0;
687
+ deferred1_1 = r1;
688
+ return getStringFromWasm0(r0, r1);
689
+ } finally {
690
+ wasm.__wbindgen_add_to_stack_pointer(16);
691
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
692
+ }
693
+ }
694
+ /**
695
+ * Push a custom signal for use in scripts.
696
+ * The signal will be available as `inputs.customSignals["signal_id"]` in Rhai scripts.
697
+ *
698
+ * - `signal_id`: The unique ID of the custom signal.
699
+ * - `label`: The user-visible label of the signal.
700
+ * - `samples`: Signal data.
701
+ * - `sample_rate`: Sample rate of the signal.
702
+ * @param {string} signal_id
703
+ * @param {string} label
704
+ * @param {Float32Array} samples
705
+ * @param {number} sample_rate
706
+ */
707
+ push_custom_signal(signal_id, label, samples, sample_rate) {
708
+ const ptr0 = passStringToWasm0(signal_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
709
+ const len0 = WASM_VECTOR_LEN;
710
+ const ptr1 = passStringToWasm0(label, wasm.__wbindgen_export, wasm.__wbindgen_export2);
711
+ const len1 = WASM_VECTOR_LEN;
712
+ const ptr2 = passArrayF32ToWasm0(samples, wasm.__wbindgen_export);
713
+ const len2 = WASM_VECTOR_LEN;
714
+ wasm.wasmvisualiser_push_custom_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, sample_rate);
715
+ }
716
+ /**
717
+ * @param {Float32Array} samples
718
+ * @param {number} sample_rate
719
+ */
720
+ push_rotation_data(samples, sample_rate) {
721
+ const ptr0 = passArrayF32ToWasm0(samples, wasm.__wbindgen_export);
722
+ const len0 = WASM_VECTOR_LEN;
723
+ wasm.wasmvisualiser_push_rotation_data(this.__wbg_ptr, ptr0, len0, sample_rate);
724
+ }
725
+ /**
726
+ * Render with a frame budget timeout.
727
+ *
728
+ * If the frame takes longer than `budget_ms` to process, it will be dropped
729
+ * and a warning logged. This prevents expensive scripts from freezing the browser.
730
+ *
731
+ * Returns true if the frame completed, false if it was dropped due to budget.
732
+ * @param {number} dt
733
+ * @param {number} budget_ms
734
+ * @returns {boolean}
735
+ */
736
+ render_with_budget(dt, budget_ms) {
737
+ const ret = wasm.wasmvisualiser_render_with_budget(this.__wbg_ptr, dt, budget_ms);
738
+ return ret !== 0;
739
+ }
740
+ /**
741
+ * Clear all named event streams.
742
+ */
743
+ clear_event_streams() {
744
+ wasm.wasmvisualiser_clear_event_streams(this.__wbg_ptr);
745
+ }
746
+ /**
747
+ * Check if frequency bands are currently set.
748
+ * @returns {boolean}
749
+ */
750
+ has_frequency_bands() {
751
+ const ret = wasm.wasmvisualiser_has_frequency_bands(this.__wbg_ptr);
752
+ return ret !== 0;
753
+ }
754
+ /**
755
+ * Register a mesh asset from OBJ content.
756
+ * The asset will be available as `mesh.load(asset_id)` in scripts.
757
+ * Returns true if successful, false if parsing failed.
758
+ * @param {string} asset_id
759
+ * @param {string} obj_content
760
+ * @returns {boolean}
761
+ */
762
+ register_mesh_asset(asset_id, obj_content) {
763
+ const ptr0 = passStringToWasm0(asset_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
764
+ const len0 = WASM_VECTOR_LEN;
765
+ const ptr1 = passStringToWasm0(obj_content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
766
+ const len1 = WASM_VECTOR_LEN;
767
+ const ret = wasm.wasmvisualiser_register_mesh_asset(this.__wbg_ptr, ptr0, len0, ptr1, len1);
768
+ return ret !== 0;
769
+ }
770
+ /**
771
+ * Set available stems for script namespace generation.
772
+ * This registers stem IDs and labels so the script engine can generate
773
+ * `inputs.stems["stem_id"]` and `inputs.stems["label"]` accessors.
774
+ *
775
+ * The JSON format should be an array of [id, label] pairs:
776
+ * `[["stem-abc123", "Drums"], ["stem-def456", "Bass"]]`
777
+ *
778
+ * Returns true if successful, false if parsing failed.
779
+ * @param {string} json
780
+ * @returns {boolean}
781
+ */
782
+ set_available_stems(json) {
783
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
784
+ const len0 = WASM_VECTOR_LEN;
785
+ const ret = wasm.wasmvisualiser_set_available_stems(this.__wbg_ptr, ptr0, len0);
786
+ return ret !== 0;
787
+ }
788
+ /**
789
+ * Set the frequency band structure for band-aware processing.
790
+ * The JSON format matches the TypeScript FrequencyBandStructure type.
791
+ * Returns true if successful, false if parsing failed.
792
+ * @param {string} json
793
+ * @returns {boolean}
794
+ */
795
+ set_frequency_bands(json) {
796
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
797
+ const len0 = WASM_VECTOR_LEN;
798
+ const ret = wasm.wasmvisualiser_set_frequency_bands(this.__wbg_ptr, ptr0, len0);
799
+ return ret !== 0;
800
+ }
801
+ /**
802
+ * Analyze a signal chain with localized sampling.
803
+ *
804
+ * Returns JSON with either:
805
+ * - SignalChainAnalysis on success
806
+ * - { "error": "message" } on failure
807
+ *
808
+ * Parameters:
809
+ * - signal_name: Name of the signal variable in the script
810
+ * - center_time: Time to center analysis around (seconds)
811
+ * - window_beats: Number of beats before/after center to sample
812
+ * - sample_count: Number of samples to take
813
+ * @param {string} signal_name
814
+ * @param {number} center_time
815
+ * @param {number} window_beats
816
+ * @param {number} sample_count
817
+ * @returns {string}
818
+ */
819
+ analyze_signal_chain(signal_name, center_time, window_beats, sample_count) {
820
+ let deferred2_0;
821
+ let deferred2_1;
822
+ try {
823
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
824
+ const ptr0 = passStringToWasm0(signal_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
825
+ const len0 = WASM_VECTOR_LEN;
826
+ wasm.wasmvisualiser_analyze_signal_chain(retptr, this.__wbg_ptr, ptr0, len0, center_time, window_beats, sample_count);
827
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
828
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
829
+ deferred2_0 = r0;
830
+ deferred2_1 = r1;
831
+ return getStringFromWasm0(r0, r1);
832
+ } finally {
833
+ wasm.__wbindgen_add_to_stack_pointer(16);
834
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
835
+ }
836
+ }
837
+ /**
838
+ * Clear all custom signals.
839
+ */
840
+ clear_custom_signals() {
841
+ wasm.wasmvisualiser_clear_custom_signals(this.__wbg_ptr);
842
+ }
843
+ /**
844
+ * Get the number of events for a specific band.
845
+ * Returns 0 if no events are stored for this band.
846
+ * @param {string} band_id
847
+ * @returns {number}
848
+ */
849
+ get_band_event_count(band_id) {
850
+ const ptr0 = passStringToWasm0(band_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
851
+ const len0 = WASM_VECTOR_LEN;
852
+ const ret = wasm.wasmvisualiser_get_band_event_count(this.__wbg_ptr, ptr0, len0);
853
+ return ret >>> 0;
854
+ }
855
+ /**
856
+ * Get list of band keys (IDs and labels) that have signals.
857
+ * Returns a JSON array of strings.
858
+ * @returns {string}
859
+ */
860
+ get_band_signal_keys() {
861
+ let deferred1_0;
862
+ let deferred1_1;
863
+ try {
864
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
865
+ wasm.wasmvisualiser_get_band_signal_keys(retptr, this.__wbg_ptr);
866
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
867
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
868
+ deferred1_0 = r0;
869
+ deferred1_1 = r1;
870
+ return getStringFromWasm0(r0, r1);
871
+ } finally {
872
+ wasm.__wbindgen_add_to_stack_pointer(16);
873
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
874
+ }
875
+ }
876
+ /**
877
+ * Get list of stem keys (IDs and labels) that have signals.
878
+ * Returns a JSON array of strings.
879
+ * @returns {string}
880
+ */
881
+ get_stem_signal_keys() {
882
+ let deferred1_0;
883
+ let deferred1_1;
884
+ try {
885
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
886
+ wasm.wasmvisualiser_get_stem_signal_keys(retptr, this.__wbg_ptr);
887
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
888
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
889
+ deferred1_0 = r0;
890
+ deferred1_1 = r1;
891
+ return getStringFromWasm0(r0, r1);
892
+ } finally {
893
+ wasm.__wbindgen_add_to_stack_pointer(16);
894
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
895
+ }
896
+ }
897
+ /**
898
+ * Check if performance profiling is currently enabled.
899
+ * @returns {boolean}
900
+ */
901
+ is_profiling_enabled() {
902
+ const ret = wasm.wasmvisualiser_is_profiling_enabled(this.__wbg_ptr);
903
+ return ret !== 0;
904
+ }
905
+ /**
906
+ * Push a composed signal for use in scripts.
907
+ * The signal will be available as `inputs.composedSignals["name"]` in Rhai scripts.
908
+ *
909
+ * - `name`: The composed signal name (composed signals are keyed by name only).
910
+ * - `samples`: Signal data.
911
+ * - `sample_rate`: Sample rate of the signal.
912
+ * @param {string} name
913
+ * @param {Float32Array} samples
914
+ * @param {number} sample_rate
915
+ */
916
+ push_composed_signal(name, samples, sample_rate) {
917
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
918
+ const len0 = WASM_VECTOR_LEN;
919
+ const ptr1 = passArrayF32ToWasm0(samples, wasm.__wbindgen_export);
920
+ const len1 = WASM_VECTOR_LEN;
921
+ wasm.wasmvisualiser_push_composed_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, sample_rate);
922
+ }
923
+ /**
924
+ * Clear the frequency band structure.
925
+ */
926
+ clear_frequency_bands() {
927
+ wasm.wasmvisualiser_clear_frequency_bands(this.__wbg_ptr);
928
+ }
929
+ /**
930
+ * Get camera state as JSON for inspector.
931
+ * Returns current position, rotation, target, fov, near, far, mode, and signal flags.
932
+ * @returns {string}
933
+ */
934
+ get_camera_state_json() {
935
+ let deferred1_0;
936
+ let deferred1_1;
937
+ try {
938
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
939
+ wasm.wasmvisualiser_get_camera_state_json(retptr, this.__wbg_ptr);
940
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
941
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
942
+ deferred1_0 = r0;
943
+ deferred1_1 = r1;
944
+ return getStringFromWasm0(r0, r1);
945
+ } finally {
946
+ wasm.__wbindgen_add_to_stack_pointer(16);
947
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
948
+ }
949
+ }
950
+ /**
951
+ * Enable or disable performance profiling.
952
+ * When enabled, console timing and collection size logging will be active.
953
+ * @param {boolean} enabled
954
+ */
955
+ set_profiling_enabled(enabled) {
956
+ wasm.wasmvisualiser_set_profiling_enabled(this.__wbg_ptr, enabled);
957
+ }
958
+ /**
959
+ * Unregister a mesh asset.
960
+ * Returns true if the asset was unregistered, false if it didn't exist.
961
+ * @param {string} asset_id
962
+ * @returns {boolean}
963
+ */
964
+ unregister_mesh_asset(asset_id) {
965
+ const ptr0 = passStringToWasm0(asset_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
966
+ const len0 = WASM_VECTOR_LEN;
967
+ const ret = wasm.wasmvisualiser_unregister_mesh_asset(this.__wbg_ptr, ptr0, len0);
968
+ return ret !== 0;
969
+ }
970
+ /**
971
+ * Clear all composed signals.
972
+ */
973
+ clear_composed_signals() {
974
+ wasm.wasmvisualiser_clear_composed_signals(this.__wbg_ptr);
975
+ }
976
+ /**
977
+ * Get list of custom signal keys (IDs and labels).
978
+ * Returns a JSON array of strings.
979
+ * @returns {string}
980
+ */
981
+ get_custom_signal_keys() {
982
+ let deferred1_0;
983
+ let deferred1_1;
984
+ try {
985
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
986
+ wasm.wasmvisualiser_get_custom_signal_keys(retptr, this.__wbg_ptr);
987
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
988
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
989
+ deferred1_0 = r0;
990
+ deferred1_1 = r1;
991
+ return getStringFromWasm0(r0, r1);
992
+ } finally {
993
+ wasm.__wbindgen_add_to_stack_pointer(16);
994
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
995
+ }
996
+ }
997
+ /**
998
+ * Get the number of events in a named event stream.
999
+ * Returns 0 if no events are stored for this name.
1000
+ * @param {string} name
1001
+ * @returns {number}
1002
+ */
1003
+ get_event_stream_count(name) {
1004
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1005
+ const len0 = WASM_VECTOR_LEN;
1006
+ const ret = wasm.wasmvisualiser_get_event_stream_count(this.__wbg_ptr, ptr0, len0);
1007
+ return ret >>> 0;
1008
+ }
1009
+ /**
1010
+ * Get the number of frequency bands.
1011
+ * @returns {number}
1012
+ */
1013
+ get_frequency_band_count() {
1014
+ const ret = wasm.wasmvisualiser_get_frequency_band_count(this.__wbg_ptr);
1015
+ return ret >>> 0;
1016
+ }
1017
+ /**
1018
+ * Run script in analysis mode with event extraction support.
1019
+ *
1020
+ * This runs the script headlessly across the full track duration,
1021
+ * collecting all debug.emit() calls AND extracting events from
1022
+ * any signal.pick.events() calls.
1023
+ *
1024
+ * Returns a JSON-serialized ExtendedAnalysisResultJson.
1025
+ * @param {string} script
1026
+ * @param {number} duration
1027
+ * @param {number} time_step
1028
+ * @returns {string}
1029
+ */
1030
+ run_analysis_with_events(script, duration, time_step) {
1031
+ let deferred2_0;
1032
+ let deferred2_1;
1033
+ try {
1034
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1035
+ const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1036
+ const len0 = WASM_VECTOR_LEN;
1037
+ wasm.wasmvisualiser_run_analysis_with_events(retptr, this.__wbg_ptr, ptr0, len0, duration, time_step);
1038
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1039
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1040
+ deferred2_0 = r0;
1041
+ deferred2_1 = r1;
1042
+ return getStringFromWasm0(r0, r1);
1043
+ } finally {
1044
+ wasm.__wbindgen_add_to_stack_pointer(16);
1045
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
1046
+ }
1047
+ }
1048
+ /**
1049
+ * Get entity positions as JSON for debugging.
1050
+ * Returns a JSON array of objects with id, type, and position fields.
1051
+ * @returns {string}
1052
+ */
1053
+ get_entity_positions_json() {
1054
+ let deferred1_0;
1055
+ let deferred1_1;
1056
+ try {
1057
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1058
+ wasm.wasmvisualiser_get_entity_positions_json(retptr, this.__wbg_ptr);
1059
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1060
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1061
+ deferred1_0 = r0;
1062
+ deferred1_1 = r1;
1063
+ return getStringFromWasm0(r0, r1);
1064
+ } finally {
1065
+ wasm.__wbindgen_add_to_stack_pointer(16);
1066
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1067
+ }
1068
+ }
1069
+ /**
1070
+ * Push an authored event stream for script access.
1071
+ *
1072
+ * The event stream will be available as `inputs.authored["name"]` in Rhai scripts.
1073
+ * This is used for user-authored events (promoted or manually created).
1074
+ *
1075
+ * The JSON format should be an array of event objects with:
1076
+ * - time: f32
1077
+ * - weight: f32
1078
+ * - beat_position: Option<f32>
1079
+ * - beat_phase: Option<f32>
1080
+ * - cluster_id: Option<u32>
1081
+ *
1082
+ * Returns true if successful, false if parsing failed.
1083
+ * @param {string} name
1084
+ * @param {string} events_json
1085
+ * @returns {boolean}
1086
+ */
1087
+ push_authored_event_stream(name, events_json) {
1088
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1089
+ const len0 = WASM_VECTOR_LEN;
1090
+ const ptr1 = passStringToWasm0(events_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1091
+ const len1 = WASM_VECTOR_LEN;
1092
+ const ret = wasm.wasmvisualiser_push_authored_event_stream(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1093
+ return ret !== 0;
1094
+ }
1095
+ /**
1096
+ * Clear all authored event streams.
1097
+ */
1098
+ clear_authored_event_streams() {
1099
+ wasm.wasmvisualiser_clear_authored_event_streams(this.__wbg_ptr);
1100
+ }
1101
+ /**
1102
+ * Set available custom signals for script namespace generation.
1103
+ * This registers custom signal IDs and labels so the script engine can generate
1104
+ * `inputs.customSignals["signal_id"]` accessors.
1105
+ *
1106
+ * The JSON format should be an array of [id, label] pairs:
1107
+ * `[["signal-abc123", "My Signal"], ["signal-def456", "Another Signal"]]`
1108
+ *
1109
+ * Returns true if successful, false if parsing failed.
1110
+ * @param {string} json
1111
+ * @returns {boolean}
1112
+ */
1113
+ set_available_custom_signals(json) {
1114
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1115
+ const len0 = WASM_VECTOR_LEN;
1116
+ const ret = wasm.wasmvisualiser_set_available_custom_signals(this.__wbg_ptr, ptr0, len0);
1117
+ return ret !== 0;
1118
+ }
1119
+ /**
1120
+ * Drain and return any pending structured script diagnostics as JSON.
1121
+ *
1122
+ * Intended for UI consumption. Calling this clears the pending diagnostics
1123
+ * queue so repeated polling does not duplicate messages.
1124
+ * @returns {string}
1125
+ */
1126
+ take_script_diagnostics_json() {
1127
+ let deferred1_0;
1128
+ let deferred1_1;
1129
+ try {
1130
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1131
+ wasm.wasmvisualiser_take_script_diagnostics_json(retptr, this.__wbg_ptr);
1132
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1133
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1134
+ deferred1_0 = r0;
1135
+ deferred1_1 = r1;
1136
+ return getStringFromWasm0(r0, r1);
1137
+ } finally {
1138
+ wasm.__wbindgen_add_to_stack_pointer(16);
1139
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1140
+ }
1141
+ }
1142
+ /**
1143
+ * Set available composed signals for script namespace generation.
1144
+ * This registers composed signal IDs and labels so the script engine can generate
1145
+ * `inputs.composedSignals["name"]` accessors.
1146
+ *
1147
+ * The JSON format should be an array of [id, label] pairs:
1148
+ * `[["intensity", "intensity"], ["buildup", "buildup"]]`
1149
+ *
1150
+ * Returns true if successful, false if parsing failed.
1151
+ * @param {string} json
1152
+ * @returns {boolean}
1153
+ */
1154
+ set_available_composed_signals(json) {
1155
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1156
+ const len0 = WASM_VECTOR_LEN;
1157
+ const ret = wasm.wasmvisualiser_set_available_composed_signals(this.__wbg_ptr, ptr0, len0);
1158
+ return ret !== 0;
1159
+ }
1160
+ /**
1161
+ * Get the number of events in an authored event stream.
1162
+ * Returns 0 if no events are stored for this name.
1163
+ * @param {string} name
1164
+ * @returns {number}
1165
+ */
1166
+ get_authored_event_stream_count(name) {
1167
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1168
+ const len0 = WASM_VECTOR_LEN;
1169
+ const ret = wasm.wasmvisualiser_get_authored_event_stream_count(this.__wbg_ptr, ptr0, len0);
1170
+ return ret >>> 0;
1171
+ }
1172
+ constructor() {
1173
+ const ret = wasm.wasmvisualiser_new();
1174
+ this.__wbg_ptr = ret >>> 0;
1175
+ WasmVisualiserFinalization.register(this, this.__wbg_ptr, this);
1176
+ return this;
1177
+ }
1178
+ /**
1179
+ * @param {number} dt
1180
+ */
1181
+ render(dt) {
1182
+ wasm.wasmvisualiser_render(this.__wbg_ptr, dt);
1183
+ }
1184
+ /**
1185
+ * @param {number} width
1186
+ * @param {number} height
1187
+ */
1188
+ resize(width, height) {
1189
+ wasm.wasmvisualiser_resize(this.__wbg_ptr, width, height);
1190
+ }
1191
+ /**
1192
+ * @param {number} time
1193
+ */
1194
+ set_time(time) {
1195
+ wasm.wasmvisualiser_set_time(this.__wbg_ptr, time);
1196
+ }
1197
+ /**
1198
+ * @param {Float32Array} samples
1199
+ * @param {number} sample_rate
1200
+ */
1201
+ push_data(samples, sample_rate) {
1202
+ const ptr0 = passArrayF32ToWasm0(samples, wasm.__wbindgen_export);
1203
+ const len0 = WASM_VECTOR_LEN;
1204
+ wasm.wasmvisualiser_push_data(this.__wbg_ptr, ptr0, len0, sample_rate);
1205
+ }
1206
+ }
1207
+ if (Symbol.dispose) WasmVisualiser.prototype[Symbol.dispose] = WasmVisualiser.prototype.free;
1208
+
1209
+ /**
1210
+ * @param {HTMLCanvasElement} canvas
1211
+ * @returns {Promise<WasmVisualiser>}
1212
+ */
1213
+ export function create_visualiser(canvas) {
1214
+ const ret = wasm.create_visualiser(addHeapObject(canvas));
1215
+ return takeObject(ret);
1216
+ }
1217
+
1218
+ /**
1219
+ * Get the host-defined Script API metadata as a JSON string.
1220
+ *
1221
+ * This is a stable, versioned description of the scripting API surface and is
1222
+ * intended to drive editor UX (autocomplete/hover/docs) and future language
1223
+ * bindings.
1224
+ * @returns {string}
1225
+ */
1226
+ export function get_script_api_metadata_json() {
1227
+ let deferred1_0;
1228
+ let deferred1_1;
1229
+ try {
1230
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1231
+ wasm.get_script_api_metadata_json(retptr);
1232
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1233
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1234
+ deferred1_0 = r0;
1235
+ deferred1_1 = r1;
1236
+ return getStringFromWasm0(r0, r1);
1237
+ } finally {
1238
+ wasm.__wbindgen_add_to_stack_pointer(16);
1239
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1240
+ }
1241
+ }
1242
+
1243
+ export function init_panic_hook() {
1244
+ wasm.init_panic_hook();
1245
+ }
1246
+
1247
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
1248
+
1249
+ async function __wbg_load(module, imports) {
1250
+ if (typeof Response === 'function' && module instanceof Response) {
1251
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1252
+ try {
1253
+ return await WebAssembly.instantiateStreaming(module, imports);
1254
+ } catch (e) {
1255
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
1256
+
1257
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1258
+ 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);
1259
+
1260
+ } else {
1261
+ throw e;
1262
+ }
1263
+ }
1264
+ }
1265
+
1266
+ const bytes = await module.arrayBuffer();
1267
+ return await WebAssembly.instantiate(bytes, imports);
1268
+ } else {
1269
+ const instance = await WebAssembly.instantiate(module, imports);
1270
+
1271
+ if (instance instanceof WebAssembly.Instance) {
1272
+ return { instance, module };
1273
+ } else {
1274
+ return instance;
1275
+ }
1276
+ }
1277
+ }
1278
+
1279
+ function __wbg_get_imports() {
1280
+ const imports = {};
1281
+ imports.wbg = {};
1282
+ imports.wbg.__wbg_Window_cf5b693340a7c469 = function(arg0) {
1283
+ const ret = getObject(arg0).Window;
1284
+ return addHeapObject(ret);
1285
+ };
1286
+ imports.wbg.__wbg_WorkerGlobalScope_354364d1b0bd06e5 = function(arg0) {
1287
+ const ret = getObject(arg0).WorkerGlobalScope;
1288
+ return addHeapObject(ret);
1289
+ };
1290
+ imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
1291
+ const ret = debugString(getObject(arg1));
1292
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1293
+ const len1 = WASM_VECTOR_LEN;
1294
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1295
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1296
+ };
1297
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
1298
+ const ret = typeof(getObject(arg0)) === 'function';
1299
+ return ret;
1300
+ };
1301
+ imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
1302
+ const ret = getObject(arg0) === null;
1303
+ return ret;
1304
+ };
1305
+ imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
1306
+ const val = getObject(arg0);
1307
+ const ret = typeof(val) === 'object' && val !== null;
1308
+ return ret;
1309
+ };
1310
+ imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
1311
+ const ret = getObject(arg0) === undefined;
1312
+ return ret;
1313
+ };
1314
+ imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
1315
+ const obj = getObject(arg1);
1316
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1317
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1318
+ var len1 = WASM_VECTOR_LEN;
1319
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1320
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1321
+ };
1322
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
1323
+ throw new Error(getStringFromWasm0(arg0, arg1));
1324
+ };
1325
+ imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
1326
+ getObject(arg0)._wbg_cb_unref();
1327
+ };
1328
+ imports.wbg.__wbg_beginComputePass_90d5303e604970cb = function(arg0, arg1) {
1329
+ const ret = getObject(arg0).beginComputePass(getObject(arg1));
1330
+ return addHeapObject(ret);
1331
+ };
1332
+ imports.wbg.__wbg_beginRenderPass_9739520c601001c3 = function(arg0, arg1) {
1333
+ const ret = getObject(arg0).beginRenderPass(getObject(arg1));
1334
+ return addHeapObject(ret);
1335
+ };
1336
+ imports.wbg.__wbg_buffer_6cb2fecb1f253d71 = function(arg0) {
1337
+ const ret = getObject(arg0).buffer;
1338
+ return addHeapObject(ret);
1339
+ };
1340
+ imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
1341
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1342
+ return addHeapObject(ret);
1343
+ }, arguments) };
1344
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
1345
+ const ret = getObject(arg0).call(getObject(arg1));
1346
+ return addHeapObject(ret);
1347
+ }, arguments) };
1348
+ imports.wbg.__wbg_clearBuffer_6164fc25d22b25cc = function(arg0, arg1, arg2, arg3) {
1349
+ getObject(arg0).clearBuffer(getObject(arg1), arg2, arg3);
1350
+ };
1351
+ imports.wbg.__wbg_clearBuffer_cfcaaf1fb2baa885 = function(arg0, arg1, arg2) {
1352
+ getObject(arg0).clearBuffer(getObject(arg1), arg2);
1353
+ };
1354
+ imports.wbg.__wbg_configure_2414aed971d368cd = function(arg0, arg1) {
1355
+ getObject(arg0).configure(getObject(arg1));
1356
+ };
1357
+ imports.wbg.__wbg_copyBufferToBuffer_1ba67191114656a1 = function(arg0, arg1, arg2, arg3, arg4, arg5) {
1358
+ getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
1359
+ };
1360
+ imports.wbg.__wbg_copyBufferToTexture_878d31d479e48f28 = function(arg0, arg1, arg2, arg3) {
1361
+ getObject(arg0).copyBufferToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
1362
+ };
1363
+ imports.wbg.__wbg_copyExternalImageToTexture_7878d196c0b60d39 = function(arg0, arg1, arg2, arg3) {
1364
+ getObject(arg0).copyExternalImageToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
1365
+ };
1366
+ imports.wbg.__wbg_copyTextureToBuffer_6a8fe0e90f0a663d = function(arg0, arg1, arg2, arg3) {
1367
+ getObject(arg0).copyTextureToBuffer(getObject(arg1), getObject(arg2), getObject(arg3));
1368
+ };
1369
+ imports.wbg.__wbg_copyTextureToTexture_0a06a393d6726b4a = function(arg0, arg1, arg2, arg3) {
1370
+ getObject(arg0).copyTextureToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
1371
+ };
1372
+ imports.wbg.__wbg_createBindGroupLayout_1d93b6d41c87ba9d = function(arg0, arg1) {
1373
+ const ret = getObject(arg0).createBindGroupLayout(getObject(arg1));
1374
+ return addHeapObject(ret);
1375
+ };
1376
+ imports.wbg.__wbg_createBindGroup_61cd07ec9d423432 = function(arg0, arg1) {
1377
+ const ret = getObject(arg0).createBindGroup(getObject(arg1));
1378
+ return addHeapObject(ret);
1379
+ };
1380
+ imports.wbg.__wbg_createBuffer_963aa00d5fe859e4 = function(arg0, arg1) {
1381
+ const ret = getObject(arg0).createBuffer(getObject(arg1));
1382
+ return addHeapObject(ret);
1383
+ };
1384
+ imports.wbg.__wbg_createCommandEncoder_f0e1613e9a2dc1eb = function(arg0, arg1) {
1385
+ const ret = getObject(arg0).createCommandEncoder(getObject(arg1));
1386
+ return addHeapObject(ret);
1387
+ };
1388
+ imports.wbg.__wbg_createComputePipeline_b9616b9fe2f4eb2f = function(arg0, arg1) {
1389
+ const ret = getObject(arg0).createComputePipeline(getObject(arg1));
1390
+ return addHeapObject(ret);
1391
+ };
1392
+ imports.wbg.__wbg_createPipelineLayout_56c6cf983f892d2b = function(arg0, arg1) {
1393
+ const ret = getObject(arg0).createPipelineLayout(getObject(arg1));
1394
+ return addHeapObject(ret);
1395
+ };
1396
+ imports.wbg.__wbg_createQuerySet_c14be802adf7c207 = function(arg0, arg1) {
1397
+ const ret = getObject(arg0).createQuerySet(getObject(arg1));
1398
+ return addHeapObject(ret);
1399
+ };
1400
+ imports.wbg.__wbg_createRenderBundleEncoder_8e4bdffea72f8c1f = function(arg0, arg1) {
1401
+ const ret = getObject(arg0).createRenderBundleEncoder(getObject(arg1));
1402
+ return addHeapObject(ret);
1403
+ };
1404
+ imports.wbg.__wbg_createRenderPipeline_079a88a0601fcce1 = function(arg0, arg1) {
1405
+ const ret = getObject(arg0).createRenderPipeline(getObject(arg1));
1406
+ return addHeapObject(ret);
1407
+ };
1408
+ imports.wbg.__wbg_createSampler_ef5578990df3baf7 = function(arg0, arg1) {
1409
+ const ret = getObject(arg0).createSampler(getObject(arg1));
1410
+ return addHeapObject(ret);
1411
+ };
1412
+ imports.wbg.__wbg_createShaderModule_17f451ea25cae47c = function(arg0, arg1) {
1413
+ const ret = getObject(arg0).createShaderModule(getObject(arg1));
1414
+ return addHeapObject(ret);
1415
+ };
1416
+ imports.wbg.__wbg_createTexture_01cc1cd2fea732d9 = function(arg0, arg1) {
1417
+ const ret = getObject(arg0).createTexture(getObject(arg1));
1418
+ return addHeapObject(ret);
1419
+ };
1420
+ imports.wbg.__wbg_createView_04701884291e1ccc = function(arg0, arg1) {
1421
+ const ret = getObject(arg0).createView(getObject(arg1));
1422
+ return addHeapObject(ret);
1423
+ };
1424
+ imports.wbg.__wbg_debug_9d0c87ddda3dc485 = function(arg0) {
1425
+ console.debug(getObject(arg0));
1426
+ };
1427
+ imports.wbg.__wbg_destroy_35f94012e5bb9c17 = function(arg0) {
1428
+ getObject(arg0).destroy();
1429
+ };
1430
+ imports.wbg.__wbg_destroy_767d9dde1008e293 = function(arg0) {
1431
+ getObject(arg0).destroy();
1432
+ };
1433
+ imports.wbg.__wbg_destroy_c6af4226dda95dbd = function(arg0) {
1434
+ getObject(arg0).destroy();
1435
+ };
1436
+ imports.wbg.__wbg_dispatchWorkgroupsIndirect_8b25efab93a7a433 = function(arg0, arg1, arg2) {
1437
+ getObject(arg0).dispatchWorkgroupsIndirect(getObject(arg1), arg2);
1438
+ };
1439
+ imports.wbg.__wbg_dispatchWorkgroups_c102fa81b955935d = function(arg0, arg1, arg2, arg3) {
1440
+ getObject(arg0).dispatchWorkgroups(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0);
1441
+ };
1442
+ imports.wbg.__wbg_document_5b745e82ba551ca5 = function(arg0) {
1443
+ const ret = getObject(arg0).document;
1444
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1445
+ };
1446
+ imports.wbg.__wbg_drawIndexedIndirect_34484fc6227c7bc8 = function(arg0, arg1, arg2) {
1447
+ getObject(arg0).drawIndexedIndirect(getObject(arg1), arg2);
1448
+ };
1449
+ imports.wbg.__wbg_drawIndexedIndirect_5a7c30bb5f1d5b67 = function(arg0, arg1, arg2) {
1450
+ getObject(arg0).drawIndexedIndirect(getObject(arg1), arg2);
1451
+ };
1452
+ imports.wbg.__wbg_drawIndexed_115af1449b52a948 = function(arg0, arg1, arg2, arg3, arg4, arg5) {
1453
+ getObject(arg0).drawIndexed(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4, arg5 >>> 0);
1454
+ };
1455
+ imports.wbg.__wbg_drawIndexed_a587cce4c317791f = function(arg0, arg1, arg2, arg3, arg4, arg5) {
1456
+ getObject(arg0).drawIndexed(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4, arg5 >>> 0);
1457
+ };
1458
+ imports.wbg.__wbg_drawIndirect_036d71498a21f1a3 = function(arg0, arg1, arg2) {
1459
+ getObject(arg0).drawIndirect(getObject(arg1), arg2);
1460
+ };
1461
+ imports.wbg.__wbg_drawIndirect_a1d7c5e893aa5756 = function(arg0, arg1, arg2) {
1462
+ getObject(arg0).drawIndirect(getObject(arg1), arg2);
1463
+ };
1464
+ imports.wbg.__wbg_draw_5351b12033166aca = function(arg0, arg1, arg2, arg3, arg4) {
1465
+ getObject(arg0).draw(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0);
1466
+ };
1467
+ imports.wbg.__wbg_draw_e2a7c5d66fb2d244 = function(arg0, arg1, arg2, arg3, arg4) {
1468
+ getObject(arg0).draw(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0);
1469
+ };
1470
+ imports.wbg.__wbg_end_0ac71677a5c1717a = function(arg0) {
1471
+ getObject(arg0).end();
1472
+ };
1473
+ imports.wbg.__wbg_end_6f776519f1faa582 = function(arg0) {
1474
+ getObject(arg0).end();
1475
+ };
1476
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1477
+ let deferred0_0;
1478
+ let deferred0_1;
1479
+ try {
1480
+ deferred0_0 = arg0;
1481
+ deferred0_1 = arg1;
1482
+ console.error(getStringFromWasm0(arg0, arg1));
1483
+ } finally {
1484
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1485
+ }
1486
+ };
1487
+ imports.wbg.__wbg_error_7bc7d576a6aaf855 = function(arg0) {
1488
+ console.error(getObject(arg0));
1489
+ };
1490
+ imports.wbg.__wbg_error_e98e6aadd08e0b94 = function(arg0) {
1491
+ const ret = getObject(arg0).error;
1492
+ return addHeapObject(ret);
1493
+ };
1494
+ imports.wbg.__wbg_executeBundles_8e6c0614da2805d4 = function(arg0, arg1) {
1495
+ getObject(arg0).executeBundles(getObject(arg1));
1496
+ };
1497
+ imports.wbg.__wbg_features_1b464383ea8a7691 = function(arg0) {
1498
+ const ret = getObject(arg0).features;
1499
+ return addHeapObject(ret);
1500
+ };
1501
+ imports.wbg.__wbg_features_e5fbbc2760867852 = function(arg0) {
1502
+ const ret = getObject(arg0).features;
1503
+ return addHeapObject(ret);
1504
+ };
1505
+ imports.wbg.__wbg_finish_20711371c58df61c = function(arg0) {
1506
+ const ret = getObject(arg0).finish();
1507
+ return addHeapObject(ret);
1508
+ };
1509
+ imports.wbg.__wbg_finish_34b2c54329c8719f = function(arg0, arg1) {
1510
+ const ret = getObject(arg0).finish(getObject(arg1));
1511
+ return addHeapObject(ret);
1512
+ };
1513
+ imports.wbg.__wbg_finish_a9ab917e756ea00c = function(arg0, arg1) {
1514
+ const ret = getObject(arg0).finish(getObject(arg1));
1515
+ return addHeapObject(ret);
1516
+ };
1517
+ imports.wbg.__wbg_finish_e0a6c97c0622f843 = function(arg0) {
1518
+ const ret = getObject(arg0).finish();
1519
+ return addHeapObject(ret);
1520
+ };
1521
+ imports.wbg.__wbg_getBindGroupLayout_4a94df6108ac6667 = function(arg0, arg1) {
1522
+ const ret = getObject(arg0).getBindGroupLayout(arg1 >>> 0);
1523
+ return addHeapObject(ret);
1524
+ };
1525
+ imports.wbg.__wbg_getBindGroupLayout_80e803d942962f6a = function(arg0, arg1) {
1526
+ const ret = getObject(arg0).getBindGroupLayout(arg1 >>> 0);
1527
+ return addHeapObject(ret);
1528
+ };
1529
+ imports.wbg.__wbg_getCompilationInfo_2af3ecdfeda551a3 = function(arg0) {
1530
+ const ret = getObject(arg0).getCompilationInfo();
1531
+ return addHeapObject(ret);
1532
+ };
1533
+ imports.wbg.__wbg_getContext_01f42b234e833f0a = function() { return handleError(function (arg0, arg1, arg2) {
1534
+ const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
1535
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1536
+ }, arguments) };
1537
+ imports.wbg.__wbg_getContext_2f210d0a58d43d95 = function() { return handleError(function (arg0, arg1, arg2) {
1538
+ const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
1539
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1540
+ }, arguments) };
1541
+ imports.wbg.__wbg_getCurrentTexture_5a79cda2ff36e1ee = function(arg0) {
1542
+ const ret = getObject(arg0).getCurrentTexture();
1543
+ return addHeapObject(ret);
1544
+ };
1545
+ imports.wbg.__wbg_getMappedRange_932dd043ae22ee0a = function(arg0, arg1, arg2) {
1546
+ const ret = getObject(arg0).getMappedRange(arg1, arg2);
1547
+ return addHeapObject(ret);
1548
+ };
1549
+ imports.wbg.__wbg_getPreferredCanvasFormat_de73c02773a5209e = function(arg0) {
1550
+ const ret = getObject(arg0).getPreferredCanvasFormat();
1551
+ return (__wbindgen_enum_GpuTextureFormat.indexOf(ret) + 1 || 96) - 1;
1552
+ };
1553
+ imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
1554
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1555
+ }, arguments) };
1556
+ imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
1557
+ const ret = getObject(arg0)[arg1 >>> 0];
1558
+ return addHeapObject(ret);
1559
+ };
1560
+ imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
1561
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1562
+ return addHeapObject(ret);
1563
+ }, arguments) };
1564
+ imports.wbg.__wbg_get_c53d381635aa3929 = function(arg0, arg1) {
1565
+ const ret = getObject(arg0)[arg1 >>> 0];
1566
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1567
+ };
1568
+ imports.wbg.__wbg_gpu_87871e8f7ace8fee = function(arg0) {
1569
+ const ret = getObject(arg0).gpu;
1570
+ return addHeapObject(ret);
1571
+ };
1572
+ imports.wbg.__wbg_has_624cbf0451d880e8 = function(arg0, arg1, arg2) {
1573
+ const ret = getObject(arg0).has(getStringFromWasm0(arg1, arg2));
1574
+ return ret;
1575
+ };
1576
+ imports.wbg.__wbg_height_a07787f693c253d2 = function(arg0) {
1577
+ const ret = getObject(arg0).height;
1578
+ return ret;
1579
+ };
1580
+ imports.wbg.__wbg_info_ce6bcc489c22f6f0 = function(arg0) {
1581
+ console.info(getObject(arg0));
1582
+ };
1583
+ imports.wbg.__wbg_instanceof_GpuAdapter_0731153d2b08720b = function(arg0) {
1584
+ let result;
1585
+ try {
1586
+ result = getObject(arg0) instanceof GPUAdapter;
1587
+ } catch (_) {
1588
+ result = false;
1589
+ }
1590
+ const ret = result;
1591
+ return ret;
1592
+ };
1593
+ imports.wbg.__wbg_instanceof_GpuCanvasContext_d14121c7bd72fcef = function(arg0) {
1594
+ let result;
1595
+ try {
1596
+ result = getObject(arg0) instanceof GPUCanvasContext;
1597
+ } catch (_) {
1598
+ result = false;
1599
+ }
1600
+ const ret = result;
1601
+ return ret;
1602
+ };
1603
+ imports.wbg.__wbg_instanceof_GpuDeviceLostInfo_a3677ebb8241d800 = function(arg0) {
1604
+ let result;
1605
+ try {
1606
+ result = getObject(arg0) instanceof GPUDeviceLostInfo;
1607
+ } catch (_) {
1608
+ result = false;
1609
+ }
1610
+ const ret = result;
1611
+ return ret;
1612
+ };
1613
+ imports.wbg.__wbg_instanceof_GpuOutOfMemoryError_391d9a08edbfa04b = function(arg0) {
1614
+ let result;
1615
+ try {
1616
+ result = getObject(arg0) instanceof GPUOutOfMemoryError;
1617
+ } catch (_) {
1618
+ result = false;
1619
+ }
1620
+ const ret = result;
1621
+ return ret;
1622
+ };
1623
+ imports.wbg.__wbg_instanceof_GpuValidationError_f4d803c383da3c92 = function(arg0) {
1624
+ let result;
1625
+ try {
1626
+ result = getObject(arg0) instanceof GPUValidationError;
1627
+ } catch (_) {
1628
+ result = false;
1629
+ }
1630
+ const ret = result;
1631
+ return ret;
1632
+ };
1633
+ imports.wbg.__wbg_instanceof_Object_577e21051f7bcb79 = function(arg0) {
1634
+ let result;
1635
+ try {
1636
+ result = getObject(arg0) instanceof Object;
1637
+ } catch (_) {
1638
+ result = false;
1639
+ }
1640
+ const ret = result;
1641
+ return ret;
1642
+ };
1643
+ imports.wbg.__wbg_instanceof_Window_b5cf7783caa68180 = function(arg0) {
1644
+ let result;
1645
+ try {
1646
+ result = getObject(arg0) instanceof Window;
1647
+ } catch (_) {
1648
+ result = false;
1649
+ }
1650
+ const ret = result;
1651
+ return ret;
1652
+ };
1653
+ imports.wbg.__wbg_label_2082ab37d2ad170d = function(arg0, arg1) {
1654
+ const ret = getObject(arg1).label;
1655
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1656
+ const len1 = WASM_VECTOR_LEN;
1657
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1658
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1659
+ };
1660
+ imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
1661
+ const ret = getObject(arg0).length;
1662
+ return ret;
1663
+ };
1664
+ imports.wbg.__wbg_length_9df32f7add647235 = function(arg0) {
1665
+ const ret = getObject(arg0).length;
1666
+ return ret;
1667
+ };
1668
+ imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
1669
+ const ret = getObject(arg0).length;
1670
+ return ret;
1671
+ };
1672
+ imports.wbg.__wbg_limits_2dd632c891786ddf = function(arg0) {
1673
+ const ret = getObject(arg0).limits;
1674
+ return addHeapObject(ret);
1675
+ };
1676
+ imports.wbg.__wbg_limits_f6411f884b0b2d62 = function(arg0) {
1677
+ const ret = getObject(arg0).limits;
1678
+ return addHeapObject(ret);
1679
+ };
1680
+ imports.wbg.__wbg_lineNum_0246de1e072ffe19 = function(arg0) {
1681
+ const ret = getObject(arg0).lineNum;
1682
+ return ret;
1683
+ };
1684
+ imports.wbg.__wbg_log_1d990106d99dacb7 = function(arg0) {
1685
+ console.log(getObject(arg0));
1686
+ };
1687
+ imports.wbg.__wbg_lost_6e4d29847ce2a34a = function(arg0) {
1688
+ const ret = getObject(arg0).lost;
1689
+ return addHeapObject(ret);
1690
+ };
1691
+ imports.wbg.__wbg_mapAsync_37f5e03edf2e1352 = function(arg0, arg1, arg2, arg3) {
1692
+ const ret = getObject(arg0).mapAsync(arg1 >>> 0, arg2, arg3);
1693
+ return addHeapObject(ret);
1694
+ };
1695
+ imports.wbg.__wbg_maxBindGroups_768ca5e8623bf450 = function(arg0) {
1696
+ const ret = getObject(arg0).maxBindGroups;
1697
+ return ret;
1698
+ };
1699
+ imports.wbg.__wbg_maxBindingsPerBindGroup_057972d600d69719 = function(arg0) {
1700
+ const ret = getObject(arg0).maxBindingsPerBindGroup;
1701
+ return ret;
1702
+ };
1703
+ imports.wbg.__wbg_maxBufferSize_e237b44f19a5a62b = function(arg0) {
1704
+ const ret = getObject(arg0).maxBufferSize;
1705
+ return ret;
1706
+ };
1707
+ imports.wbg.__wbg_maxColorAttachmentBytesPerSample_d6c7b4051d22c6d6 = function(arg0) {
1708
+ const ret = getObject(arg0).maxColorAttachmentBytesPerSample;
1709
+ return ret;
1710
+ };
1711
+ imports.wbg.__wbg_maxColorAttachments_7a18ba24c05edcfd = function(arg0) {
1712
+ const ret = getObject(arg0).maxColorAttachments;
1713
+ return ret;
1714
+ };
1715
+ imports.wbg.__wbg_maxComputeInvocationsPerWorkgroup_b99c2f3611633992 = function(arg0) {
1716
+ const ret = getObject(arg0).maxComputeInvocationsPerWorkgroup;
1717
+ return ret;
1718
+ };
1719
+ imports.wbg.__wbg_maxComputeWorkgroupSizeX_adb26da9ed7f77f7 = function(arg0) {
1720
+ const ret = getObject(arg0).maxComputeWorkgroupSizeX;
1721
+ return ret;
1722
+ };
1723
+ imports.wbg.__wbg_maxComputeWorkgroupSizeY_cc217559c98be33b = function(arg0) {
1724
+ const ret = getObject(arg0).maxComputeWorkgroupSizeY;
1725
+ return ret;
1726
+ };
1727
+ imports.wbg.__wbg_maxComputeWorkgroupSizeZ_66606a80e2cf2309 = function(arg0) {
1728
+ const ret = getObject(arg0).maxComputeWorkgroupSizeZ;
1729
+ return ret;
1730
+ };
1731
+ imports.wbg.__wbg_maxComputeWorkgroupStorageSize_cb6235497b8c4997 = function(arg0) {
1732
+ const ret = getObject(arg0).maxComputeWorkgroupStorageSize;
1733
+ return ret;
1734
+ };
1735
+ imports.wbg.__wbg_maxComputeWorkgroupsPerDimension_6bf550b5f21d57cf = function(arg0) {
1736
+ const ret = getObject(arg0).maxComputeWorkgroupsPerDimension;
1737
+ return ret;
1738
+ };
1739
+ imports.wbg.__wbg_maxDynamicStorageBuffersPerPipelineLayout_c6ac20334e328b47 = function(arg0) {
1740
+ const ret = getObject(arg0).maxDynamicStorageBuffersPerPipelineLayout;
1741
+ return ret;
1742
+ };
1743
+ imports.wbg.__wbg_maxDynamicUniformBuffersPerPipelineLayout_aa8f14a74b440f01 = function(arg0) {
1744
+ const ret = getObject(arg0).maxDynamicUniformBuffersPerPipelineLayout;
1745
+ return ret;
1746
+ };
1747
+ imports.wbg.__wbg_maxSampledTexturesPerShaderStage_db7c4922cc60144a = function(arg0) {
1748
+ const ret = getObject(arg0).maxSampledTexturesPerShaderStage;
1749
+ return ret;
1750
+ };
1751
+ imports.wbg.__wbg_maxSamplersPerShaderStage_538705fe2263e710 = function(arg0) {
1752
+ const ret = getObject(arg0).maxSamplersPerShaderStage;
1753
+ return ret;
1754
+ };
1755
+ imports.wbg.__wbg_maxStorageBufferBindingSize_32178c0f5f7f85cb = function(arg0) {
1756
+ const ret = getObject(arg0).maxStorageBufferBindingSize;
1757
+ return ret;
1758
+ };
1759
+ imports.wbg.__wbg_maxStorageBuffersPerShaderStage_9f67e9eae0089f77 = function(arg0) {
1760
+ const ret = getObject(arg0).maxStorageBuffersPerShaderStage;
1761
+ return ret;
1762
+ };
1763
+ imports.wbg.__wbg_maxStorageTexturesPerShaderStage_57239664936031cf = function(arg0) {
1764
+ const ret = getObject(arg0).maxStorageTexturesPerShaderStage;
1765
+ return ret;
1766
+ };
1767
+ imports.wbg.__wbg_maxTextureArrayLayers_db5d4e486c78ae04 = function(arg0) {
1768
+ const ret = getObject(arg0).maxTextureArrayLayers;
1769
+ return ret;
1770
+ };
1771
+ imports.wbg.__wbg_maxTextureDimension1D_3475085ffacabbdc = function(arg0) {
1772
+ const ret = getObject(arg0).maxTextureDimension1D;
1773
+ return ret;
1774
+ };
1775
+ imports.wbg.__wbg_maxTextureDimension2D_7c8d5ecf09eb8519 = function(arg0) {
1776
+ const ret = getObject(arg0).maxTextureDimension2D;
1777
+ return ret;
1778
+ };
1779
+ imports.wbg.__wbg_maxTextureDimension3D_8bd976677a0f91d4 = function(arg0) {
1780
+ const ret = getObject(arg0).maxTextureDimension3D;
1781
+ return ret;
1782
+ };
1783
+ imports.wbg.__wbg_maxUniformBufferBindingSize_95b1a54e7e4a0f0f = function(arg0) {
1784
+ const ret = getObject(arg0).maxUniformBufferBindingSize;
1785
+ return ret;
1786
+ };
1787
+ imports.wbg.__wbg_maxUniformBuffersPerShaderStage_5f475d9a453af14d = function(arg0) {
1788
+ const ret = getObject(arg0).maxUniformBuffersPerShaderStage;
1789
+ return ret;
1790
+ };
1791
+ imports.wbg.__wbg_maxVertexAttributes_4c48ca2f5d32f860 = function(arg0) {
1792
+ const ret = getObject(arg0).maxVertexAttributes;
1793
+ return ret;
1794
+ };
1795
+ imports.wbg.__wbg_maxVertexBufferArrayStride_2233f6933ecc5a16 = function(arg0) {
1796
+ const ret = getObject(arg0).maxVertexBufferArrayStride;
1797
+ return ret;
1798
+ };
1799
+ imports.wbg.__wbg_maxVertexBuffers_c47e508cd7348554 = function(arg0) {
1800
+ const ret = getObject(arg0).maxVertexBuffers;
1801
+ return ret;
1802
+ };
1803
+ imports.wbg.__wbg_message_0762358e59db7ed6 = function(arg0, arg1) {
1804
+ const ret = getObject(arg1).message;
1805
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1806
+ const len1 = WASM_VECTOR_LEN;
1807
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1808
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1809
+ };
1810
+ imports.wbg.__wbg_message_7957ab09f64c6822 = function(arg0, arg1) {
1811
+ const ret = getObject(arg1).message;
1812
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1813
+ const len1 = WASM_VECTOR_LEN;
1814
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1815
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1816
+ };
1817
+ imports.wbg.__wbg_message_b163994503433c9e = function(arg0, arg1) {
1818
+ const ret = getObject(arg1).message;
1819
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1820
+ const len1 = WASM_VECTOR_LEN;
1821
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1822
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1823
+ };
1824
+ imports.wbg.__wbg_messages_da071582f72bc978 = function(arg0) {
1825
+ const ret = getObject(arg0).messages;
1826
+ return addHeapObject(ret);
1827
+ };
1828
+ imports.wbg.__wbg_minStorageBufferOffsetAlignment_51b4801fac3a58de = function(arg0) {
1829
+ const ret = getObject(arg0).minStorageBufferOffsetAlignment;
1830
+ return ret;
1831
+ };
1832
+ imports.wbg.__wbg_minUniformBufferOffsetAlignment_5d62a77924b2335f = function(arg0) {
1833
+ const ret = getObject(arg0).minUniformBufferOffsetAlignment;
1834
+ return ret;
1835
+ };
1836
+ imports.wbg.__wbg_navigator_11b7299bb7886507 = function(arg0) {
1837
+ const ret = getObject(arg0).navigator;
1838
+ return addHeapObject(ret);
1839
+ };
1840
+ imports.wbg.__wbg_navigator_b49edef831236138 = function(arg0) {
1841
+ const ret = getObject(arg0).navigator;
1842
+ return addHeapObject(ret);
1843
+ };
1844
+ imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
1845
+ const ret = new Object();
1846
+ return addHeapObject(ret);
1847
+ };
1848
+ imports.wbg.__wbg_new_25f239778d6112b9 = function() {
1849
+ const ret = new Array();
1850
+ return addHeapObject(ret);
1851
+ };
1852
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1853
+ const ret = new Error();
1854
+ return addHeapObject(ret);
1855
+ };
1856
+ imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
1857
+ try {
1858
+ var state0 = {a: arg0, b: arg1};
1859
+ var cb0 = (arg0, arg1) => {
1860
+ const a = state0.a;
1861
+ state0.a = 0;
1862
+ try {
1863
+ return __wasm_bindgen_func_elem_11945(a, state0.b, arg0, arg1);
1864
+ } finally {
1865
+ state0.a = a;
1866
+ }
1867
+ };
1868
+ const ret = new Promise(cb0);
1869
+ return addHeapObject(ret);
1870
+ } finally {
1871
+ state0.a = state0.b = 0;
1872
+ }
1873
+ };
1874
+ imports.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
1875
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1876
+ return addHeapObject(ret);
1877
+ };
1878
+ imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
1879
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1880
+ return addHeapObject(ret);
1881
+ };
1882
+ imports.wbg.__wbg_new_with_byte_offset_and_length_d85c3da1fd8df149 = function(arg0, arg1, arg2) {
1883
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1884
+ return addHeapObject(ret);
1885
+ };
1886
+ imports.wbg.__wbg_now_8cf15d6e317793e1 = function(arg0) {
1887
+ const ret = getObject(arg0).now();
1888
+ return ret;
1889
+ };
1890
+ imports.wbg.__wbg_offset_336f14c993863b76 = function(arg0) {
1891
+ const ret = getObject(arg0).offset;
1892
+ return ret;
1893
+ };
1894
+ imports.wbg.__wbg_performance_c77a440eff2efd9b = function(arg0) {
1895
+ const ret = getObject(arg0).performance;
1896
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1897
+ };
1898
+ imports.wbg.__wbg_popErrorScope_af0b22f136a861d6 = function(arg0) {
1899
+ const ret = getObject(arg0).popErrorScope();
1900
+ return addHeapObject(ret);
1901
+ };
1902
+ imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
1903
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1904
+ };
1905
+ imports.wbg.__wbg_pushErrorScope_b52914ff10ba6ce3 = function(arg0, arg1) {
1906
+ getObject(arg0).pushErrorScope(__wbindgen_enum_GpuErrorFilter[arg1]);
1907
+ };
1908
+ imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
1909
+ const ret = getObject(arg0).push(getObject(arg1));
1910
+ return ret;
1911
+ };
1912
+ imports.wbg.__wbg_querySelectorAll_aa1048eae18f6f1a = function() { return handleError(function (arg0, arg1, arg2) {
1913
+ const ret = getObject(arg0).querySelectorAll(getStringFromWasm0(arg1, arg2));
1914
+ return addHeapObject(ret);
1915
+ }, arguments) };
1916
+ imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
1917
+ const ret = getObject(arg0).queueMicrotask;
1918
+ return addHeapObject(ret);
1919
+ };
1920
+ imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
1921
+ queueMicrotask(getObject(arg0));
1922
+ };
1923
+ imports.wbg.__wbg_queue_bea4017efaaf9904 = function(arg0) {
1924
+ const ret = getObject(arg0).queue;
1925
+ return addHeapObject(ret);
1926
+ };
1927
+ imports.wbg.__wbg_reason_43acd39cce242b50 = function(arg0) {
1928
+ const ret = getObject(arg0).reason;
1929
+ return (__wbindgen_enum_GpuDeviceLostReason.indexOf(ret) + 1 || 3) - 1;
1930
+ };
1931
+ imports.wbg.__wbg_requestAdapter_e6dcfac497cafa7a = function(arg0, arg1) {
1932
+ const ret = getObject(arg0).requestAdapter(getObject(arg1));
1933
+ return addHeapObject(ret);
1934
+ };
1935
+ imports.wbg.__wbg_requestDevice_03b802707d5a382c = function(arg0, arg1) {
1936
+ const ret = getObject(arg0).requestDevice(getObject(arg1));
1937
+ return addHeapObject(ret);
1938
+ };
1939
+ imports.wbg.__wbg_resolveQuerySet_811661fb23f3b699 = function(arg0, arg1, arg2, arg3, arg4, arg5) {
1940
+ getObject(arg0).resolveQuerySet(getObject(arg1), arg2 >>> 0, arg3 >>> 0, getObject(arg4), arg5 >>> 0);
1941
+ };
1942
+ imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
1943
+ const ret = Promise.resolve(getObject(arg0));
1944
+ return addHeapObject(ret);
1945
+ };
1946
+ imports.wbg.__wbg_setBindGroup_62a3045b0921e429 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1947
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
1948
+ };
1949
+ imports.wbg.__wbg_setBindGroup_6c0fd18e9a53a945 = function(arg0, arg1, arg2) {
1950
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
1951
+ };
1952
+ imports.wbg.__wbg_setBindGroup_7f3b61f1f482133b = function(arg0, arg1, arg2) {
1953
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
1954
+ };
1955
+ imports.wbg.__wbg_setBindGroup_bf767a5aa46a33ce = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1956
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
1957
+ };
1958
+ imports.wbg.__wbg_setBindGroup_c4aaff14063226b4 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1959
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
1960
+ };
1961
+ imports.wbg.__wbg_setBindGroup_f82e771dc1b69093 = function(arg0, arg1, arg2) {
1962
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
1963
+ };
1964
+ imports.wbg.__wbg_setBlendConstant_016723821cfb3aa4 = function(arg0, arg1) {
1965
+ getObject(arg0).setBlendConstant(getObject(arg1));
1966
+ };
1967
+ imports.wbg.__wbg_setIndexBuffer_286a40afdff411b7 = function(arg0, arg1, arg2, arg3) {
1968
+ getObject(arg0).setIndexBuffer(getObject(arg1), __wbindgen_enum_GpuIndexFormat[arg2], arg3);
1969
+ };
1970
+ imports.wbg.__wbg_setIndexBuffer_7efd0b7a40c65fb9 = function(arg0, arg1, arg2, arg3, arg4) {
1971
+ getObject(arg0).setIndexBuffer(getObject(arg1), __wbindgen_enum_GpuIndexFormat[arg2], arg3, arg4);
1972
+ };
1973
+ imports.wbg.__wbg_setIndexBuffer_e091a9673bb575e2 = function(arg0, arg1, arg2, arg3) {
1974
+ getObject(arg0).setIndexBuffer(getObject(arg1), __wbindgen_enum_GpuIndexFormat[arg2], arg3);
1975
+ };
1976
+ imports.wbg.__wbg_setIndexBuffer_f0759f00036f615f = function(arg0, arg1, arg2, arg3, arg4) {
1977
+ getObject(arg0).setIndexBuffer(getObject(arg1), __wbindgen_enum_GpuIndexFormat[arg2], arg3, arg4);
1978
+ };
1979
+ imports.wbg.__wbg_setPipeline_ba92070b8ee81cf9 = function(arg0, arg1) {
1980
+ getObject(arg0).setPipeline(getObject(arg1));
1981
+ };
1982
+ imports.wbg.__wbg_setPipeline_c344f76bae58c4d6 = function(arg0, arg1) {
1983
+ getObject(arg0).setPipeline(getObject(arg1));
1984
+ };
1985
+ imports.wbg.__wbg_setPipeline_d76451c50a121598 = function(arg0, arg1) {
1986
+ getObject(arg0).setPipeline(getObject(arg1));
1987
+ };
1988
+ imports.wbg.__wbg_setScissorRect_0b6ee0852ef0b6b9 = function(arg0, arg1, arg2, arg3, arg4) {
1989
+ getObject(arg0).setScissorRect(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0);
1990
+ };
1991
+ imports.wbg.__wbg_setStencilReference_34fd3d59673a5a9d = function(arg0, arg1) {
1992
+ getObject(arg0).setStencilReference(arg1 >>> 0);
1993
+ };
1994
+ imports.wbg.__wbg_setVertexBuffer_06a90dc78e1ad9c4 = function(arg0, arg1, arg2, arg3, arg4) {
1995
+ getObject(arg0).setVertexBuffer(arg1 >>> 0, getObject(arg2), arg3, arg4);
1996
+ };
1997
+ imports.wbg.__wbg_setVertexBuffer_1540e9118b6c451d = function(arg0, arg1, arg2, arg3) {
1998
+ getObject(arg0).setVertexBuffer(arg1 >>> 0, getObject(arg2), arg3);
1999
+ };
2000
+ imports.wbg.__wbg_setVertexBuffer_5166eedc06450701 = function(arg0, arg1, arg2, arg3, arg4) {
2001
+ getObject(arg0).setVertexBuffer(arg1 >>> 0, getObject(arg2), arg3, arg4);
2002
+ };
2003
+ imports.wbg.__wbg_setVertexBuffer_8621784e5014065b = function(arg0, arg1, arg2, arg3) {
2004
+ getObject(arg0).setVertexBuffer(arg1 >>> 0, getObject(arg2), arg3);
2005
+ };
2006
+ imports.wbg.__wbg_setViewport_731ad30abb13f744 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
2007
+ getObject(arg0).setViewport(arg1, arg2, arg3, arg4, arg5, arg6);
2008
+ };
2009
+ imports.wbg.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) {
2010
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2011
+ return ret;
2012
+ }, arguments) };
2013
+ imports.wbg.__wbg_set_bc3a432bdcd60886 = function(arg0, arg1, arg2) {
2014
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
2015
+ };
2016
+ imports.wbg.__wbg_set_height_6f8f8ef4cb40e496 = function(arg0, arg1) {
2017
+ getObject(arg0).height = arg1 >>> 0;
2018
+ };
2019
+ imports.wbg.__wbg_set_height_afe09c24165867f7 = function(arg0, arg1) {
2020
+ getObject(arg0).height = arg1 >>> 0;
2021
+ };
2022
+ imports.wbg.__wbg_set_onuncapturederror_19541466822d790b = function(arg0, arg1) {
2023
+ getObject(arg0).onuncapturederror = getObject(arg1);
2024
+ };
2025
+ imports.wbg.__wbg_set_width_0a22c810f06a5152 = function(arg0, arg1) {
2026
+ getObject(arg0).width = arg1 >>> 0;
2027
+ };
2028
+ imports.wbg.__wbg_set_width_7ff7a22c6e9f423e = function(arg0, arg1) {
2029
+ getObject(arg0).width = arg1 >>> 0;
2030
+ };
2031
+ imports.wbg.__wbg_size_661bddb3f9898121 = function(arg0) {
2032
+ const ret = getObject(arg0).size;
2033
+ return ret;
2034
+ };
2035
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
2036
+ const ret = getObject(arg1).stack;
2037
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2038
+ const len1 = WASM_VECTOR_LEN;
2039
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2040
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2041
+ };
2042
+ imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
2043
+ const ret = typeof global === 'undefined' ? null : global;
2044
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2045
+ };
2046
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
2047
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
2048
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2049
+ };
2050
+ imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
2051
+ const ret = typeof self === 'undefined' ? null : self;
2052
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2053
+ };
2054
+ imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
2055
+ const ret = typeof window === 'undefined' ? null : window;
2056
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2057
+ };
2058
+ imports.wbg.__wbg_submit_f635072bb3d05faa = function(arg0, arg1) {
2059
+ getObject(arg0).submit(getObject(arg1));
2060
+ };
2061
+ imports.wbg.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) {
2062
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2063
+ return addHeapObject(ret);
2064
+ };
2065
+ imports.wbg.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
2066
+ const ret = getObject(arg0).then(getObject(arg1));
2067
+ return addHeapObject(ret);
2068
+ };
2069
+ imports.wbg.__wbg_timeEnd_46ed224117e5f2d2 = function(arg0, arg1) {
2070
+ console.timeEnd(getStringFromWasm0(arg0, arg1));
2071
+ };
2072
+ imports.wbg.__wbg_time_c49415b636fbbf3f = function(arg0, arg1) {
2073
+ console.time(getStringFromWasm0(arg0, arg1));
2074
+ };
2075
+ imports.wbg.__wbg_type_c0d5d83032e9858a = function(arg0) {
2076
+ const ret = getObject(arg0).type;
2077
+ return (__wbindgen_enum_GpuCompilationMessageType.indexOf(ret) + 1 || 4) - 1;
2078
+ };
2079
+ imports.wbg.__wbg_unmap_8c2e8131b2aaa844 = function(arg0) {
2080
+ getObject(arg0).unmap();
2081
+ };
2082
+ imports.wbg.__wbg_usage_13caa02888040e9f = function(arg0) {
2083
+ const ret = getObject(arg0).usage;
2084
+ return ret;
2085
+ };
2086
+ imports.wbg.__wbg_valueOf_663ea9f1ad0d6eda = function(arg0) {
2087
+ const ret = getObject(arg0).valueOf();
2088
+ return addHeapObject(ret);
2089
+ };
2090
+ imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
2091
+ console.warn(getObject(arg0));
2092
+ };
2093
+ imports.wbg.__wbg_wasmvisualiser_new = function(arg0) {
2094
+ const ret = WasmVisualiser.__wrap(arg0);
2095
+ return addHeapObject(ret);
2096
+ };
2097
+ imports.wbg.__wbg_width_dd0cfe94d42f5143 = function(arg0) {
2098
+ const ret = getObject(arg0).width;
2099
+ return ret;
2100
+ };
2101
+ imports.wbg.__wbg_writeBuffer_5ca4981365eb5ac0 = function(arg0, arg1, arg2, arg3, arg4, arg5) {
2102
+ getObject(arg0).writeBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
2103
+ };
2104
+ imports.wbg.__wbg_writeTexture_246118eb2f5a1592 = function(arg0, arg1, arg2, arg3, arg4) {
2105
+ getObject(arg0).writeTexture(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
2106
+ };
2107
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
2108
+ // Cast intrinsic for `Ref(String) -> Externref`.
2109
+ const ret = getStringFromWasm0(arg0, arg1);
2110
+ return addHeapObject(ret);
2111
+ };
2112
+ imports.wbg.__wbindgen_cast_4131bd36079921a0 = function(arg0, arg1) {
2113
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2988, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 2989, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2114
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_10192, __wasm_bindgen_func_elem_10256);
2115
+ return addHeapObject(ret);
2116
+ };
2117
+ imports.wbg.__wbindgen_cast_4ebfb3f8f53af193 = function(arg0, arg1) {
2118
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 3193, function: Function { arguments: [Externref], shim_idx: 3194, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2119
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_11323, __wasm_bindgen_func_elem_11338);
2120
+ return addHeapObject(ret);
2121
+ };
2122
+ imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
2123
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
2124
+ const ret = getArrayU8FromWasm0(arg0, arg1);
2125
+ return addHeapObject(ret);
2126
+ };
2127
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
2128
+ // Cast intrinsic for `F64 -> Externref`.
2129
+ const ret = arg0;
2130
+ return addHeapObject(ret);
2131
+ };
2132
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2133
+ const ret = getObject(arg0);
2134
+ return addHeapObject(ret);
2135
+ };
2136
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2137
+ takeObject(arg0);
2138
+ };
2139
+
2140
+ return imports;
2141
+ }
2142
+
2143
+ function __wbg_finalize_init(instance, module) {
2144
+ wasm = instance.exports;
2145
+ __wbg_init.__wbindgen_wasm_module = module;
2146
+ cachedDataViewMemory0 = null;
2147
+ cachedFloat32ArrayMemory0 = null;
2148
+ cachedUint32ArrayMemory0 = null;
2149
+ cachedUint8ArrayMemory0 = null;
2150
+
2151
+
2152
+
2153
+ return wasm;
2154
+ }
2155
+
2156
+ function initSync(module) {
2157
+ if (wasm !== undefined) return wasm;
2158
+
2159
+
2160
+ if (typeof module !== 'undefined') {
2161
+ if (Object.getPrototypeOf(module) === Object.prototype) {
2162
+ ({module} = module)
2163
+ } else {
2164
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
2165
+ }
2166
+ }
2167
+
2168
+ const imports = __wbg_get_imports();
2169
+ if (!(module instanceof WebAssembly.Module)) {
2170
+ module = new WebAssembly.Module(module);
2171
+ }
2172
+ const instance = new WebAssembly.Instance(module, imports);
2173
+ return __wbg_finalize_init(instance, module);
2174
+ }
2175
+
2176
+ async function __wbg_init(module_or_path) {
2177
+ if (wasm !== undefined) return wasm;
2178
+
2179
+
2180
+ if (typeof module_or_path !== 'undefined') {
2181
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2182
+ ({module_or_path} = module_or_path)
2183
+ } else {
2184
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
2185
+ }
2186
+ }
2187
+
2188
+ if (typeof module_or_path === 'undefined') {
2189
+ module_or_path = new URL('visualiser_bg.wasm', import.meta.url);
2190
+ }
2191
+ const imports = __wbg_get_imports();
2192
+
2193
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
2194
+ module_or_path = fetch(module_or_path);
2195
+ }
2196
+
2197
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
2198
+
2199
+ return __wbg_finalize_init(instance, module);
2200
+ }
2201
+
2202
+ export { initSync };
2203
+ export default __wbg_init;