@biomejs/wasm-web 0.1.0-nightly.7b90623

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rome_wasm.js ADDED
@@ -0,0 +1,982 @@
1
+ let wasm;
2
+
3
+ const heap = new Array(128).fill(undefined);
4
+
5
+ heap.push(undefined, null, true, false);
6
+
7
+ function getObject(idx) { return heap[idx]; }
8
+
9
+ let heap_next = heap.length;
10
+
11
+ function dropObject(idx) {
12
+ if (idx < 132) return;
13
+ heap[idx] = heap_next;
14
+ heap_next = idx;
15
+ }
16
+
17
+ function takeObject(idx) {
18
+ const ret = getObject(idx);
19
+ dropObject(idx);
20
+ return ret;
21
+ }
22
+
23
+ function addHeapObject(obj) {
24
+ if (heap_next === heap.length) heap.push(heap.length + 1);
25
+ const idx = heap_next;
26
+ heap_next = heap[idx];
27
+
28
+ heap[idx] = obj;
29
+ return idx;
30
+ }
31
+
32
+ function isLikeNone(x) {
33
+ return x === undefined || x === null;
34
+ }
35
+
36
+ let cachedFloat64Memory0 = null;
37
+
38
+ function getFloat64Memory0() {
39
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
40
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
41
+ }
42
+ return cachedFloat64Memory0;
43
+ }
44
+
45
+ let cachedInt32Memory0 = null;
46
+
47
+ function getInt32Memory0() {
48
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
49
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
50
+ }
51
+ return cachedInt32Memory0;
52
+ }
53
+
54
+ let WASM_VECTOR_LEN = 0;
55
+
56
+ let cachedUint8Memory0 = null;
57
+
58
+ function getUint8Memory0() {
59
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
60
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
61
+ }
62
+ return cachedUint8Memory0;
63
+ }
64
+
65
+ const cachedTextEncoder = new TextEncoder('utf-8');
66
+
67
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
68
+ ? function (arg, view) {
69
+ return cachedTextEncoder.encodeInto(arg, view);
70
+ }
71
+ : function (arg, view) {
72
+ const buf = cachedTextEncoder.encode(arg);
73
+ view.set(buf);
74
+ return {
75
+ read: arg.length,
76
+ written: buf.length
77
+ };
78
+ });
79
+
80
+ function passStringToWasm0(arg, malloc, realloc) {
81
+
82
+ if (realloc === undefined) {
83
+ const buf = cachedTextEncoder.encode(arg);
84
+ const ptr = malloc(buf.length);
85
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
86
+ WASM_VECTOR_LEN = buf.length;
87
+ return ptr;
88
+ }
89
+
90
+ let len = arg.length;
91
+ let ptr = malloc(len);
92
+
93
+ const mem = getUint8Memory0();
94
+
95
+ let offset = 0;
96
+
97
+ for (; offset < len; offset++) {
98
+ const code = arg.charCodeAt(offset);
99
+ if (code > 0x7F) break;
100
+ mem[ptr + offset] = code;
101
+ }
102
+
103
+ if (offset !== len) {
104
+ if (offset !== 0) {
105
+ arg = arg.slice(offset);
106
+ }
107
+ ptr = realloc(ptr, len, len = offset + arg.length * 3);
108
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
109
+ const ret = encodeString(arg, view);
110
+
111
+ offset += ret.written;
112
+ }
113
+
114
+ WASM_VECTOR_LEN = offset;
115
+ return ptr;
116
+ }
117
+
118
+ const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
119
+
120
+ cachedTextDecoder.decode();
121
+
122
+ function getStringFromWasm0(ptr, len) {
123
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
124
+ }
125
+
126
+ let cachedBigInt64Memory0 = null;
127
+
128
+ function getBigInt64Memory0() {
129
+ if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
130
+ cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
131
+ }
132
+ return cachedBigInt64Memory0;
133
+ }
134
+
135
+ function debugString(val) {
136
+ // primitive types
137
+ const type = typeof val;
138
+ if (type == 'number' || type == 'boolean' || val == null) {
139
+ return `${val}`;
140
+ }
141
+ if (type == 'string') {
142
+ return `"${val}"`;
143
+ }
144
+ if (type == 'symbol') {
145
+ const description = val.description;
146
+ if (description == null) {
147
+ return 'Symbol';
148
+ } else {
149
+ return `Symbol(${description})`;
150
+ }
151
+ }
152
+ if (type == 'function') {
153
+ const name = val.name;
154
+ if (typeof name == 'string' && name.length > 0) {
155
+ return `Function(${name})`;
156
+ } else {
157
+ return 'Function';
158
+ }
159
+ }
160
+ // objects
161
+ if (Array.isArray(val)) {
162
+ const length = val.length;
163
+ let debug = '[';
164
+ if (length > 0) {
165
+ debug += debugString(val[0]);
166
+ }
167
+ for(let i = 1; i < length; i++) {
168
+ debug += ', ' + debugString(val[i]);
169
+ }
170
+ debug += ']';
171
+ return debug;
172
+ }
173
+ // Test for built-in
174
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
175
+ let className;
176
+ if (builtInMatches.length > 1) {
177
+ className = builtInMatches[1];
178
+ } else {
179
+ // Failed to match the standard '[object ClassName]'
180
+ return toString.call(val);
181
+ }
182
+ if (className == 'Object') {
183
+ // we're a user defined class or Object
184
+ // JSON.stringify avoids problems with cycles, and is generally much
185
+ // easier than looping through ownProperties of `val`.
186
+ try {
187
+ return 'Object(' + JSON.stringify(val) + ')';
188
+ } catch (_) {
189
+ return 'Object';
190
+ }
191
+ }
192
+ // errors
193
+ if (val instanceof Error) {
194
+ return `${val.name}: ${val.message}\n${val.stack}`;
195
+ }
196
+ // TODO we could test for more things here, like `Set`s and `Map`s.
197
+ return className;
198
+ }
199
+ /**
200
+ */
201
+ export function main() {
202
+ wasm.main();
203
+ }
204
+
205
+ function handleError(f, args) {
206
+ try {
207
+ return f.apply(this, args);
208
+ } catch (e) {
209
+ wasm.__wbindgen_exn_store(addHeapObject(e));
210
+ }
211
+ }
212
+ /**
213
+ */
214
+ export class DiagnosticPrinter {
215
+
216
+ static __wrap(ptr) {
217
+ const obj = Object.create(DiagnosticPrinter.prototype);
218
+ obj.ptr = ptr;
219
+
220
+ return obj;
221
+ }
222
+
223
+ __destroy_into_raw() {
224
+ const ptr = this.ptr;
225
+ this.ptr = 0;
226
+
227
+ return ptr;
228
+ }
229
+
230
+ free() {
231
+ const ptr = this.__destroy_into_raw();
232
+ wasm.__wbg_diagnosticprinter_free(ptr);
233
+ }
234
+ /**
235
+ * @param {string} file_name
236
+ * @param {string} file_source
237
+ */
238
+ constructor(file_name, file_source) {
239
+ const ptr0 = passStringToWasm0(file_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
240
+ const len0 = WASM_VECTOR_LEN;
241
+ const ptr1 = passStringToWasm0(file_source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
242
+ const len1 = WASM_VECTOR_LEN;
243
+ const ret = wasm.diagnosticprinter_new(ptr0, len0, ptr1, len1);
244
+ return DiagnosticPrinter.__wrap(ret);
245
+ }
246
+ /**
247
+ * @param {Diagnostic} diagnostic
248
+ */
249
+ print_simple(diagnostic) {
250
+ try {
251
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
252
+ wasm.diagnosticprinter_print_simple(retptr, this.ptr, addHeapObject(diagnostic));
253
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
254
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
255
+ if (r1) {
256
+ throw takeObject(r0);
257
+ }
258
+ } finally {
259
+ wasm.__wbindgen_add_to_stack_pointer(16);
260
+ }
261
+ }
262
+ /**
263
+ * @param {Diagnostic} diagnostic
264
+ */
265
+ print_verbose(diagnostic) {
266
+ try {
267
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
268
+ wasm.diagnosticprinter_print_verbose(retptr, this.ptr, addHeapObject(diagnostic));
269
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
270
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
271
+ if (r1) {
272
+ throw takeObject(r0);
273
+ }
274
+ } finally {
275
+ wasm.__wbindgen_add_to_stack_pointer(16);
276
+ }
277
+ }
278
+ /**
279
+ * @returns {string}
280
+ */
281
+ finish() {
282
+ try {
283
+ const ptr = this.__destroy_into_raw();
284
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
285
+ wasm.diagnosticprinter_finish(retptr, ptr);
286
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
287
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
288
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
289
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
290
+ var ptr0 = r0;
291
+ var len0 = r1;
292
+ if (r3) {
293
+ ptr0 = 0; len0 = 0;
294
+ throw takeObject(r2);
295
+ }
296
+ return getStringFromWasm0(ptr0, len0);
297
+ } finally {
298
+ wasm.__wbindgen_add_to_stack_pointer(16);
299
+ wasm.__wbindgen_free(ptr0, len0);
300
+ }
301
+ }
302
+ }
303
+ /**
304
+ */
305
+ export class Workspace {
306
+
307
+ static __wrap(ptr) {
308
+ const obj = Object.create(Workspace.prototype);
309
+ obj.ptr = ptr;
310
+
311
+ return obj;
312
+ }
313
+
314
+ __destroy_into_raw() {
315
+ const ptr = this.ptr;
316
+ this.ptr = 0;
317
+
318
+ return ptr;
319
+ }
320
+
321
+ free() {
322
+ const ptr = this.__destroy_into_raw();
323
+ wasm.__wbg_workspace_free(ptr);
324
+ }
325
+ /**
326
+ */
327
+ constructor() {
328
+ const ret = wasm.workspace_new();
329
+ return Workspace.__wrap(ret);
330
+ }
331
+ /**
332
+ * @param {SupportsFeatureParams} params
333
+ * @returns {SupportsFeatureResult}
334
+ */
335
+ fileFeatures(params) {
336
+ try {
337
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
338
+ wasm.workspace_fileFeatures(retptr, this.ptr, addHeapObject(params));
339
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
340
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
341
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
342
+ if (r2) {
343
+ throw takeObject(r1);
344
+ }
345
+ return takeObject(r0);
346
+ } finally {
347
+ wasm.__wbindgen_add_to_stack_pointer(16);
348
+ }
349
+ }
350
+ /**
351
+ * @param {UpdateSettingsParams} params
352
+ */
353
+ updateSettings(params) {
354
+ try {
355
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
356
+ wasm.workspace_updateSettings(retptr, this.ptr, addHeapObject(params));
357
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
358
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
359
+ if (r1) {
360
+ throw takeObject(r0);
361
+ }
362
+ } finally {
363
+ wasm.__wbindgen_add_to_stack_pointer(16);
364
+ }
365
+ }
366
+ /**
367
+ * @param {OpenFileParams} params
368
+ */
369
+ openFile(params) {
370
+ try {
371
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
372
+ wasm.workspace_openFile(retptr, this.ptr, addHeapObject(params));
373
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
374
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
375
+ if (r1) {
376
+ throw takeObject(r0);
377
+ }
378
+ } finally {
379
+ wasm.__wbindgen_add_to_stack_pointer(16);
380
+ }
381
+ }
382
+ /**
383
+ * @param {GetFileContentParams} params
384
+ * @returns {string}
385
+ */
386
+ getFileContent(params) {
387
+ try {
388
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
389
+ wasm.workspace_getFileContent(retptr, this.ptr, addHeapObject(params));
390
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
391
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
392
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
393
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
394
+ var ptr0 = r0;
395
+ var len0 = r1;
396
+ if (r3) {
397
+ ptr0 = 0; len0 = 0;
398
+ throw takeObject(r2);
399
+ }
400
+ return getStringFromWasm0(ptr0, len0);
401
+ } finally {
402
+ wasm.__wbindgen_add_to_stack_pointer(16);
403
+ wasm.__wbindgen_free(ptr0, len0);
404
+ }
405
+ }
406
+ /**
407
+ * @param {GetSyntaxTreeParams} params
408
+ * @returns {GetSyntaxTreeResult}
409
+ */
410
+ getSyntaxTree(params) {
411
+ try {
412
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
413
+ wasm.workspace_getSyntaxTree(retptr, this.ptr, addHeapObject(params));
414
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
415
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
416
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
417
+ if (r2) {
418
+ throw takeObject(r1);
419
+ }
420
+ return takeObject(r0);
421
+ } finally {
422
+ wasm.__wbindgen_add_to_stack_pointer(16);
423
+ }
424
+ }
425
+ /**
426
+ * @param {GetControlFlowGraphParams} params
427
+ * @returns {string}
428
+ */
429
+ getControlFlowGraph(params) {
430
+ try {
431
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
432
+ wasm.workspace_getControlFlowGraph(retptr, this.ptr, addHeapObject(params));
433
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
434
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
435
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
436
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
437
+ var ptr0 = r0;
438
+ var len0 = r1;
439
+ if (r3) {
440
+ ptr0 = 0; len0 = 0;
441
+ throw takeObject(r2);
442
+ }
443
+ return getStringFromWasm0(ptr0, len0);
444
+ } finally {
445
+ wasm.__wbindgen_add_to_stack_pointer(16);
446
+ wasm.__wbindgen_free(ptr0, len0);
447
+ }
448
+ }
449
+ /**
450
+ * @param {GetFormatterIRParams} params
451
+ * @returns {string}
452
+ */
453
+ getFormatterIr(params) {
454
+ try {
455
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
456
+ wasm.workspace_getFormatterIr(retptr, this.ptr, addHeapObject(params));
457
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
458
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
459
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
460
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
461
+ var ptr0 = r0;
462
+ var len0 = r1;
463
+ if (r3) {
464
+ ptr0 = 0; len0 = 0;
465
+ throw takeObject(r2);
466
+ }
467
+ return getStringFromWasm0(ptr0, len0);
468
+ } finally {
469
+ wasm.__wbindgen_add_to_stack_pointer(16);
470
+ wasm.__wbindgen_free(ptr0, len0);
471
+ }
472
+ }
473
+ /**
474
+ * @param {ChangeFileParams} params
475
+ */
476
+ changeFile(params) {
477
+ try {
478
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
479
+ wasm.workspace_changeFile(retptr, this.ptr, addHeapObject(params));
480
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
481
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
482
+ if (r1) {
483
+ throw takeObject(r0);
484
+ }
485
+ } finally {
486
+ wasm.__wbindgen_add_to_stack_pointer(16);
487
+ }
488
+ }
489
+ /**
490
+ * @param {CloseFileParams} params
491
+ */
492
+ closeFile(params) {
493
+ try {
494
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
495
+ wasm.workspace_closeFile(retptr, this.ptr, addHeapObject(params));
496
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
497
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
498
+ if (r1) {
499
+ throw takeObject(r0);
500
+ }
501
+ } finally {
502
+ wasm.__wbindgen_add_to_stack_pointer(16);
503
+ }
504
+ }
505
+ /**
506
+ * @param {PullDiagnosticsParams} params
507
+ * @returns {PullDiagnosticsResult}
508
+ */
509
+ pullDiagnostics(params) {
510
+ try {
511
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
512
+ wasm.workspace_pullDiagnostics(retptr, this.ptr, addHeapObject(params));
513
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
514
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
515
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
516
+ if (r2) {
517
+ throw takeObject(r1);
518
+ }
519
+ return takeObject(r0);
520
+ } finally {
521
+ wasm.__wbindgen_add_to_stack_pointer(16);
522
+ }
523
+ }
524
+ /**
525
+ * @param {PullActionsParams} params
526
+ * @returns {PullActionsResult}
527
+ */
528
+ pullActions(params) {
529
+ try {
530
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
531
+ wasm.workspace_pullActions(retptr, this.ptr, addHeapObject(params));
532
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
533
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
534
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
535
+ if (r2) {
536
+ throw takeObject(r1);
537
+ }
538
+ return takeObject(r0);
539
+ } finally {
540
+ wasm.__wbindgen_add_to_stack_pointer(16);
541
+ }
542
+ }
543
+ /**
544
+ * @param {FormatFileParams} params
545
+ * @returns {any}
546
+ */
547
+ formatFile(params) {
548
+ try {
549
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
550
+ wasm.workspace_formatFile(retptr, this.ptr, addHeapObject(params));
551
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
552
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
553
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
554
+ if (r2) {
555
+ throw takeObject(r1);
556
+ }
557
+ return takeObject(r0);
558
+ } finally {
559
+ wasm.__wbindgen_add_to_stack_pointer(16);
560
+ }
561
+ }
562
+ /**
563
+ * @param {FormatRangeParams} params
564
+ * @returns {any}
565
+ */
566
+ formatRange(params) {
567
+ try {
568
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
569
+ wasm.workspace_formatRange(retptr, this.ptr, addHeapObject(params));
570
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
571
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
572
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
573
+ if (r2) {
574
+ throw takeObject(r1);
575
+ }
576
+ return takeObject(r0);
577
+ } finally {
578
+ wasm.__wbindgen_add_to_stack_pointer(16);
579
+ }
580
+ }
581
+ /**
582
+ * @param {FormatOnTypeParams} params
583
+ * @returns {any}
584
+ */
585
+ formatOnType(params) {
586
+ try {
587
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
588
+ wasm.workspace_formatOnType(retptr, this.ptr, addHeapObject(params));
589
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
590
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
591
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
592
+ if (r2) {
593
+ throw takeObject(r1);
594
+ }
595
+ return takeObject(r0);
596
+ } finally {
597
+ wasm.__wbindgen_add_to_stack_pointer(16);
598
+ }
599
+ }
600
+ /**
601
+ * @param {FixFileParams} params
602
+ * @returns {FixFileResult}
603
+ */
604
+ fixFile(params) {
605
+ try {
606
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
607
+ wasm.workspace_fixFile(retptr, this.ptr, addHeapObject(params));
608
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
609
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
610
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
611
+ if (r2) {
612
+ throw takeObject(r1);
613
+ }
614
+ return takeObject(r0);
615
+ } finally {
616
+ wasm.__wbindgen_add_to_stack_pointer(16);
617
+ }
618
+ }
619
+ /**
620
+ * @param {OrganizeImportsParams} params
621
+ * @returns {OrganizeImportsResult}
622
+ */
623
+ organizeImports(params) {
624
+ try {
625
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
626
+ wasm.workspace_organizeImports(retptr, this.ptr, addHeapObject(params));
627
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
628
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
629
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
630
+ if (r2) {
631
+ throw takeObject(r1);
632
+ }
633
+ return takeObject(r0);
634
+ } finally {
635
+ wasm.__wbindgen_add_to_stack_pointer(16);
636
+ }
637
+ }
638
+ /**
639
+ * @param {RenameParams} params
640
+ * @returns {RenameResult}
641
+ */
642
+ rename(params) {
643
+ try {
644
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
645
+ wasm.workspace_rename(retptr, this.ptr, addHeapObject(params));
646
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
647
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
648
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
649
+ if (r2) {
650
+ throw takeObject(r1);
651
+ }
652
+ return takeObject(r0);
653
+ } finally {
654
+ wasm.__wbindgen_add_to_stack_pointer(16);
655
+ }
656
+ }
657
+ }
658
+
659
+ async function load(module, imports) {
660
+ if (typeof Response === 'function' && module instanceof Response) {
661
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
662
+ try {
663
+ return await WebAssembly.instantiateStreaming(module, imports);
664
+
665
+ } catch (e) {
666
+ if (module.headers.get('Content-Type') != 'application/wasm') {
667
+ 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);
668
+
669
+ } else {
670
+ throw e;
671
+ }
672
+ }
673
+ }
674
+
675
+ const bytes = await module.arrayBuffer();
676
+ return await WebAssembly.instantiate(bytes, imports);
677
+
678
+ } else {
679
+ const instance = await WebAssembly.instantiate(module, imports);
680
+
681
+ if (instance instanceof WebAssembly.Instance) {
682
+ return { instance, module };
683
+
684
+ } else {
685
+ return instance;
686
+ }
687
+ }
688
+ }
689
+
690
+ function getImports() {
691
+ const imports = {};
692
+ imports.wbg = {};
693
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
694
+ const ret = getObject(arg0) === undefined;
695
+ return ret;
696
+ };
697
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
698
+ const ret = getObject(arg0) in getObject(arg1);
699
+ return ret;
700
+ };
701
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
702
+ takeObject(arg0);
703
+ };
704
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
705
+ const v = getObject(arg0);
706
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
707
+ return ret;
708
+ };
709
+ imports.wbg.__wbindgen_is_bigint = function(arg0) {
710
+ const ret = typeof(getObject(arg0)) === 'bigint';
711
+ return ret;
712
+ };
713
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
714
+ const ret = arg0;
715
+ return addHeapObject(ret);
716
+ };
717
+ imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
718
+ const ret = getObject(arg0) === getObject(arg1);
719
+ return ret;
720
+ };
721
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
722
+ const obj = getObject(arg1);
723
+ const ret = typeof(obj) === 'number' ? obj : undefined;
724
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
725
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
726
+ };
727
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
728
+ const obj = getObject(arg1);
729
+ const ret = typeof(obj) === 'string' ? obj : undefined;
730
+ var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
731
+ var len0 = WASM_VECTOR_LEN;
732
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
733
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
734
+ };
735
+ imports.wbg.__wbindgen_is_object = function(arg0) {
736
+ const val = getObject(arg0);
737
+ const ret = typeof(val) === 'object' && val !== null;
738
+ return ret;
739
+ };
740
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
741
+ const ret = BigInt.asUintN(64, arg0);
742
+ return addHeapObject(ret);
743
+ };
744
+ imports.wbg.__wbindgen_is_string = function(arg0) {
745
+ const ret = typeof(getObject(arg0)) === 'string';
746
+ return ret;
747
+ };
748
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
749
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
750
+ return addHeapObject(ret);
751
+ };
752
+ imports.wbg.__wbindgen_number_new = function(arg0) {
753
+ const ret = arg0;
754
+ return addHeapObject(ret);
755
+ };
756
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
757
+ const ret = getObject(arg0);
758
+ return addHeapObject(ret);
759
+ };
760
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
761
+ const ret = getStringFromWasm0(arg0, arg1);
762
+ return addHeapObject(ret);
763
+ };
764
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
765
+ const ret = getObject(arg0) == getObject(arg1);
766
+ return ret;
767
+ };
768
+ imports.wbg.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) {
769
+ const ret = String(getObject(arg1));
770
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
771
+ const len0 = WASM_VECTOR_LEN;
772
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
773
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
774
+ };
775
+ imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
776
+ const ret = getObject(arg0)[getObject(arg1)];
777
+ return addHeapObject(ret);
778
+ };
779
+ imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
780
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
781
+ };
782
+ imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
783
+ const ret = new Error();
784
+ return addHeapObject(ret);
785
+ };
786
+ imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
787
+ const ret = getObject(arg1).stack;
788
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
789
+ const len0 = WASM_VECTOR_LEN;
790
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
791
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
792
+ };
793
+ imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
794
+ try {
795
+ console.error(getStringFromWasm0(arg0, arg1));
796
+ } finally {
797
+ wasm.__wbindgen_free(arg0, arg1);
798
+ }
799
+ };
800
+ imports.wbg.__wbg_get_27fe3dac1c4d0224 = function(arg0, arg1) {
801
+ const ret = getObject(arg0)[arg1 >>> 0];
802
+ return addHeapObject(ret);
803
+ };
804
+ imports.wbg.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
805
+ const ret = getObject(arg0).length;
806
+ return ret;
807
+ };
808
+ imports.wbg.__wbg_new_b525de17f44a8943 = function() {
809
+ const ret = new Array();
810
+ return addHeapObject(ret);
811
+ };
812
+ imports.wbg.__wbindgen_is_function = function(arg0) {
813
+ const ret = typeof(getObject(arg0)) === 'function';
814
+ return ret;
815
+ };
816
+ imports.wbg.__wbg_new_f841cc6f2098f4b5 = function() {
817
+ const ret = new Map();
818
+ return addHeapObject(ret);
819
+ };
820
+ imports.wbg.__wbg_next_b7d530c04fd8b217 = function(arg0) {
821
+ const ret = getObject(arg0).next;
822
+ return addHeapObject(ret);
823
+ };
824
+ imports.wbg.__wbg_next_88560ec06a094dea = function() { return handleError(function (arg0) {
825
+ const ret = getObject(arg0).next();
826
+ return addHeapObject(ret);
827
+ }, arguments) };
828
+ imports.wbg.__wbg_done_1ebec03bbd919843 = function(arg0) {
829
+ const ret = getObject(arg0).done;
830
+ return ret;
831
+ };
832
+ imports.wbg.__wbg_value_6ac8da5cc5b3efda = function(arg0) {
833
+ const ret = getObject(arg0).value;
834
+ return addHeapObject(ret);
835
+ };
836
+ imports.wbg.__wbg_iterator_55f114446221aa5a = function() {
837
+ const ret = Symbol.iterator;
838
+ return addHeapObject(ret);
839
+ };
840
+ imports.wbg.__wbg_get_baf4855f9a986186 = function() { return handleError(function (arg0, arg1) {
841
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
842
+ return addHeapObject(ret);
843
+ }, arguments) };
844
+ imports.wbg.__wbg_call_95d1ea488d03e4e8 = function() { return handleError(function (arg0, arg1) {
845
+ const ret = getObject(arg0).call(getObject(arg1));
846
+ return addHeapObject(ret);
847
+ }, arguments) };
848
+ imports.wbg.__wbg_new_f9876326328f45ed = function() {
849
+ const ret = new Object();
850
+ return addHeapObject(ret);
851
+ };
852
+ imports.wbg.__wbg_set_17224bc548dd1d7b = function(arg0, arg1, arg2) {
853
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
854
+ };
855
+ imports.wbg.__wbg_isArray_39d28997bf6b96b4 = function(arg0) {
856
+ const ret = Array.isArray(getObject(arg0));
857
+ return ret;
858
+ };
859
+ imports.wbg.__wbg_instanceof_ArrayBuffer_a69f02ee4c4f5065 = function(arg0) {
860
+ let result;
861
+ try {
862
+ result = getObject(arg0) instanceof ArrayBuffer;
863
+ } catch {
864
+ result = false;
865
+ }
866
+ const ret = result;
867
+ return ret;
868
+ };
869
+ imports.wbg.__wbg_new_15d3966e9981a196 = function(arg0, arg1) {
870
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
871
+ return addHeapObject(ret);
872
+ };
873
+ imports.wbg.__wbg_set_388c4c6422704173 = function(arg0, arg1, arg2) {
874
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
875
+ return addHeapObject(ret);
876
+ };
877
+ imports.wbg.__wbg_isSafeInteger_8c4789029e885159 = function(arg0) {
878
+ const ret = Number.isSafeInteger(getObject(arg0));
879
+ return ret;
880
+ };
881
+ imports.wbg.__wbg_entries_4e1315b774245952 = function(arg0) {
882
+ const ret = Object.entries(getObject(arg0));
883
+ return addHeapObject(ret);
884
+ };
885
+ imports.wbg.__wbg_buffer_cf65c07de34b9a08 = function(arg0) {
886
+ const ret = getObject(arg0).buffer;
887
+ return addHeapObject(ret);
888
+ };
889
+ imports.wbg.__wbg_new_537b7341ce90bb31 = function(arg0) {
890
+ const ret = new Uint8Array(getObject(arg0));
891
+ return addHeapObject(ret);
892
+ };
893
+ imports.wbg.__wbg_set_17499e8aa4003ebd = function(arg0, arg1, arg2) {
894
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
895
+ };
896
+ imports.wbg.__wbg_length_27a2afe8ab42b09f = function(arg0) {
897
+ const ret = getObject(arg0).length;
898
+ return ret;
899
+ };
900
+ imports.wbg.__wbg_instanceof_Uint8Array_01cebe79ca606cca = function(arg0) {
901
+ let result;
902
+ try {
903
+ result = getObject(arg0) instanceof Uint8Array;
904
+ } catch {
905
+ result = false;
906
+ }
907
+ const ret = result;
908
+ return ret;
909
+ };
910
+ imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
911
+ const v = getObject(arg1);
912
+ const ret = typeof(v) === 'bigint' ? v : undefined;
913
+ getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
914
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
915
+ };
916
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
917
+ const ret = debugString(getObject(arg1));
918
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
919
+ const len0 = WASM_VECTOR_LEN;
920
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
921
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
922
+ };
923
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
924
+ throw new Error(getStringFromWasm0(arg0, arg1));
925
+ };
926
+ imports.wbg.__wbindgen_memory = function() {
927
+ const ret = wasm.memory;
928
+ return addHeapObject(ret);
929
+ };
930
+
931
+ return imports;
932
+ }
933
+
934
+ function initMemory(imports, maybe_memory) {
935
+
936
+ }
937
+
938
+ function finalizeInit(instance, module) {
939
+ wasm = instance.exports;
940
+ init.__wbindgen_wasm_module = module;
941
+ cachedBigInt64Memory0 = null;
942
+ cachedFloat64Memory0 = null;
943
+ cachedInt32Memory0 = null;
944
+ cachedUint8Memory0 = null;
945
+
946
+ wasm.__wbindgen_start();
947
+ return wasm;
948
+ }
949
+
950
+ function initSync(module) {
951
+ const imports = getImports();
952
+
953
+ initMemory(imports);
954
+
955
+ if (!(module instanceof WebAssembly.Module)) {
956
+ module = new WebAssembly.Module(module);
957
+ }
958
+
959
+ const instance = new WebAssembly.Instance(module, imports);
960
+
961
+ return finalizeInit(instance, module);
962
+ }
963
+
964
+ async function init(input) {
965
+ if (typeof input === 'undefined') {
966
+ input = new URL('rome_wasm_bg.wasm', import.meta.url);
967
+ }
968
+ const imports = getImports();
969
+
970
+ if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
971
+ input = fetch(input);
972
+ }
973
+
974
+ initMemory(imports);
975
+
976
+ const { instance, module } = await load(await input, imports);
977
+
978
+ return finalizeInit(instance, module);
979
+ }
980
+
981
+ export { initSync }
982
+ export default init;