@databio/gtars 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gtars_js.js CHANGED
@@ -1,214 +1,77 @@
1
- let wasm;
1
+ /* @ts-self-types="./gtars_js.d.ts" */
2
2
 
3
- let cachedUint8ArrayMemory0 = null;
4
-
5
- function getUint8ArrayMemory0() {
6
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
7
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
8
- }
9
- return cachedUint8ArrayMemory0;
10
- }
11
-
12
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
13
-
14
- cachedTextDecoder.decode();
15
-
16
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
17
- let numBytesDecoded = 0;
18
- function decodeText(ptr, len) {
19
- numBytesDecoded += len;
20
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
21
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
22
- cachedTextDecoder.decode();
23
- numBytesDecoded = len;
24
- }
25
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
26
- }
27
-
28
- function getStringFromWasm0(ptr, len) {
29
- ptr = ptr >>> 0;
30
- return decodeText(ptr, len);
31
- }
32
-
33
- let WASM_VECTOR_LEN = 0;
34
-
35
- const cachedTextEncoder = new TextEncoder();
36
-
37
- if (!('encodeInto' in cachedTextEncoder)) {
38
- cachedTextEncoder.encodeInto = function (arg, view) {
39
- const buf = cachedTextEncoder.encode(arg);
40
- view.set(buf);
41
- return {
42
- read: arg.length,
43
- written: buf.length
44
- };
3
+ export class BedClassificationOutput {
4
+ static __wrap(ptr) {
5
+ ptr = ptr >>> 0;
6
+ const obj = Object.create(BedClassificationOutput.prototype);
7
+ obj.__wbg_ptr = ptr;
8
+ BedClassificationOutputFinalization.register(obj, obj.__wbg_ptr, obj);
9
+ return obj;
45
10
  }
46
- }
47
-
48
- function passStringToWasm0(arg, malloc, realloc) {
49
-
50
- if (realloc === undefined) {
51
- const buf = cachedTextEncoder.encode(arg);
52
- const ptr = malloc(buf.length, 1) >>> 0;
53
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
54
- WASM_VECTOR_LEN = buf.length;
11
+ __destroy_into_raw() {
12
+ const ptr = this.__wbg_ptr;
13
+ this.__wbg_ptr = 0;
14
+ BedClassificationOutputFinalization.unregister(this);
55
15
  return ptr;
56
16
  }
57
-
58
- let len = arg.length;
59
- let ptr = malloc(len, 1) >>> 0;
60
-
61
- const mem = getUint8ArrayMemory0();
62
-
63
- let offset = 0;
64
-
65
- for (; offset < len; offset++) {
66
- const code = arg.charCodeAt(offset);
67
- if (code > 0x7F) break;
68
- mem[ptr + offset] = code;
69
- }
70
-
71
- if (offset !== len) {
72
- if (offset !== 0) {
73
- arg = arg.slice(offset);
74
- }
75
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
76
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
77
- const ret = cachedTextEncoder.encodeInto(arg, view);
78
-
79
- offset += ret.written;
80
- ptr = realloc(ptr, len, offset, 1) >>> 0;
81
- }
82
-
83
- WASM_VECTOR_LEN = offset;
84
- return ptr;
85
- }
86
-
87
- let cachedDataViewMemory0 = null;
88
-
89
- function getDataViewMemory0() {
90
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
91
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
92
- }
93
- return cachedDataViewMemory0;
94
- }
95
-
96
- function isLikeNone(x) {
97
- return x === undefined || x === null;
98
- }
99
-
100
- function debugString(val) {
101
- // primitive types
102
- const type = typeof val;
103
- if (type == 'number' || type == 'boolean' || val == null) {
104
- return `${val}`;
105
- }
106
- if (type == 'string') {
107
- return `"${val}"`;
108
- }
109
- if (type == 'symbol') {
110
- const description = val.description;
111
- if (description == null) {
112
- return 'Symbol';
113
- } else {
114
- return `Symbol(${description})`;
115
- }
116
- }
117
- if (type == 'function') {
118
- const name = val.name;
119
- if (typeof name == 'string' && name.length > 0) {
120
- return `Function(${name})`;
121
- } else {
122
- return 'Function';
123
- }
17
+ free() {
18
+ const ptr = this.__destroy_into_raw();
19
+ wasm.__wbg_bedclassificationoutput_free(ptr, 0);
124
20
  }
125
- // objects
126
- if (Array.isArray(val)) {
127
- const length = val.length;
128
- let debug = '[';
129
- if (length > 0) {
130
- debug += debugString(val[0]);
131
- }
132
- for(let i = 1; i < length; i++) {
133
- debug += ', ' + debugString(val[i]);
21
+ /**
22
+ * @returns {string}
23
+ */
24
+ get bed_compliance() {
25
+ let deferred1_0;
26
+ let deferred1_1;
27
+ try {
28
+ const ret = wasm.bedclassificationoutput_bed_compliance(this.__wbg_ptr);
29
+ deferred1_0 = ret[0];
30
+ deferred1_1 = ret[1];
31
+ return getStringFromWasm0(ret[0], ret[1]);
32
+ } finally {
33
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
134
34
  }
135
- debug += ']';
136
- return debug;
137
35
  }
138
- // Test for built-in
139
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
140
- let className;
141
- if (builtInMatches && builtInMatches.length > 1) {
142
- className = builtInMatches[1];
143
- } else {
144
- // Failed to match the standard '[object ClassName]'
145
- return toString.call(val);
36
+ /**
37
+ * @returns {number}
38
+ */
39
+ get compliant_columns() {
40
+ const ret = wasm.bedclassificationoutput_compliant_columns(this.__wbg_ptr);
41
+ return ret >>> 0;
146
42
  }
147
- if (className == 'Object') {
148
- // we're a user defined class or Object
149
- // JSON.stringify avoids problems with cycles, and is generally much
150
- // easier than looping through ownProperties of `val`.
43
+ /**
44
+ * @returns {string}
45
+ */
46
+ get data_format() {
47
+ let deferred1_0;
48
+ let deferred1_1;
151
49
  try {
152
- return 'Object(' + JSON.stringify(val) + ')';
153
- } catch (_) {
154
- return 'Object';
50
+ const ret = wasm.bedclassificationoutput_data_format(this.__wbg_ptr);
51
+ deferred1_0 = ret[0];
52
+ deferred1_1 = ret[1];
53
+ return getStringFromWasm0(ret[0], ret[1]);
54
+ } finally {
55
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
155
56
  }
156
57
  }
157
- // errors
158
- if (val instanceof Error) {
159
- return `${val.name}: ${val.message}\n${val.stack}`;
160
- }
161
- // TODO we could test for more things here, like `Set`s and `Map`s.
162
- return className;
163
- }
164
-
165
- function addToExternrefTable0(obj) {
166
- const idx = wasm.__externref_table_alloc();
167
- wasm.__wbindgen_externrefs.set(idx, obj);
168
- return idx;
169
- }
170
-
171
- function handleError(f, args) {
172
- try {
173
- return f.apply(this, args);
174
- } catch (e) {
175
- const idx = addToExternrefTable0(e);
176
- wasm.__wbindgen_exn_store(idx);
58
+ /**
59
+ * @returns {number}
60
+ */
61
+ get non_compliant_columns() {
62
+ const ret = wasm.bedclassificationoutput_non_compliant_columns(this.__wbg_ptr);
63
+ return ret >>> 0;
177
64
  }
178
65
  }
179
-
180
- function getArrayU8FromWasm0(ptr, len) {
181
- ptr = ptr >>> 0;
182
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
183
- }
184
-
185
- function takeFromExternrefTable0(idx) {
186
- const value = wasm.__wbindgen_externrefs.get(idx);
187
- wasm.__externref_table_dealloc(idx);
188
- return value;
189
- }
190
- /**
191
- * @param {string} name
192
- */
193
- export function greet(name) {
194
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
195
- const len0 = WASM_VECTOR_LEN;
196
- wasm.greet(ptr0, len0);
197
- }
198
-
199
- const ChromosomeStatisticsFinalization = (typeof FinalizationRegistry === 'undefined')
200
- ? { register: () => {}, unregister: () => {} }
201
- : new FinalizationRegistry(ptr => wasm.__wbg_chromosomestatistics_free(ptr >>> 0, 1));
66
+ if (Symbol.dispose) BedClassificationOutput.prototype[Symbol.dispose] = BedClassificationOutput.prototype.free;
202
67
 
203
68
  export class ChromosomeStatistics {
204
-
205
69
  __destroy_into_raw() {
206
70
  const ptr = this.__wbg_ptr;
207
71
  this.__wbg_ptr = 0;
208
72
  ChromosomeStatisticsFinalization.unregister(this);
209
73
  return ptr;
210
74
  }
211
-
212
75
  free() {
213
76
  const ptr = this.__destroy_into_raw();
214
77
  wasm.__wbg_chromosomestatistics_free(ptr, 0);
@@ -231,86 +94,76 @@ export class ChromosomeStatistics {
231
94
  /**
232
95
  * @returns {number}
233
96
  */
234
- get start_nucleotide_position() {
235
- const ret = wasm.chromosomestatistics_start_nucleotide_position(this.__wbg_ptr);
97
+ get end_nucleotide_position() {
98
+ const ret = wasm.chromosomestatistics_end_nucleotide_position(this.__wbg_ptr);
236
99
  return ret >>> 0;
237
100
  }
238
101
  /**
239
102
  * @returns {number}
240
103
  */
241
- get end_nucleotide_position() {
242
- const ret = wasm.chromosomestatistics_end_nucleotide_position(this.__wbg_ptr);
104
+ get maximum_region_length() {
105
+ const ret = wasm.chromosomestatistics_maximum_region_length(this.__wbg_ptr);
243
106
  return ret >>> 0;
244
107
  }
245
108
  /**
246
109
  * @returns {number}
247
110
  */
248
- get number_of_regions() {
249
- const ret = wasm.chromosomestatistics_number_of_regions(this.__wbg_ptr);
250
- return ret >>> 0;
111
+ get mean_region_length() {
112
+ const ret = wasm.chromosomestatistics_mean_region_length(this.__wbg_ptr);
113
+ return ret;
251
114
  }
252
115
  /**
253
116
  * @returns {number}
254
117
  */
255
- get minimum_region_length() {
256
- const ret = wasm.chromosomestatistics_minimum_region_length(this.__wbg_ptr);
257
- return ret >>> 0;
118
+ get median_region_length() {
119
+ const ret = wasm.chromosomestatistics_median_region_length(this.__wbg_ptr);
120
+ return ret;
258
121
  }
259
122
  /**
260
123
  * @returns {number}
261
124
  */
262
- get maximum_region_length() {
263
- const ret = wasm.chromosomestatistics_maximum_region_length(this.__wbg_ptr);
125
+ get minimum_region_length() {
126
+ const ret = wasm.bedclassificationoutput_compliant_columns(this.__wbg_ptr);
264
127
  return ret >>> 0;
265
128
  }
266
129
  /**
267
130
  * @returns {number}
268
131
  */
269
- get mean_region_length() {
270
- const ret = wasm.chromosomestatistics_mean_region_length(this.__wbg_ptr);
271
- return ret;
132
+ get number_of_regions() {
133
+ const ret = wasm.chromosomestatistics_number_of_regions(this.__wbg_ptr);
134
+ return ret >>> 0;
272
135
  }
273
136
  /**
274
137
  * @returns {number}
275
138
  */
276
- get median_region_length() {
277
- const ret = wasm.chromosomestatistics_median_region_length(this.__wbg_ptr);
278
- return ret;
279
- }
280
- }
139
+ get start_nucleotide_position() {
140
+ const ret = wasm.chromosomestatistics_start_nucleotide_position(this.__wbg_ptr);
141
+ return ret >>> 0;
142
+ }
143
+ }
281
144
  if (Symbol.dispose) ChromosomeStatistics.prototype[Symbol.dispose] = ChromosomeStatistics.prototype.free;
282
145
 
283
- const OverlapperFinalization = (typeof FinalizationRegistry === 'undefined')
284
- ? { register: () => {}, unregister: () => {} }
285
- : new FinalizationRegistry(ptr => wasm.__wbg_overlapper_free(ptr >>> 0, 1));
286
-
287
146
  export class Overlapper {
288
-
289
147
  __destroy_into_raw() {
290
148
  const ptr = this.__wbg_ptr;
291
149
  this.__wbg_ptr = 0;
292
150
  OverlapperFinalization.unregister(this);
293
151
  return ptr;
294
152
  }
295
-
296
153
  free() {
297
154
  const ptr = this.__destroy_into_raw();
298
155
  wasm.__wbg_overlapper_free(ptr, 0);
299
156
  }
300
157
  /**
301
- * @param {any} universe
302
- * @param {string} backend
158
+ * @param {any} regions
159
+ * @returns {any}
303
160
  */
304
- constructor(universe, backend) {
305
- const ptr0 = passStringToWasm0(backend, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
306
- const len0 = WASM_VECTOR_LEN;
307
- const ret = wasm.overlapper_new(universe, ptr0, len0);
161
+ find(regions) {
162
+ const ret = wasm.overlapper_find(this.__wbg_ptr, regions);
308
163
  if (ret[2]) {
309
164
  throw takeFromExternrefTable0(ret[1]);
310
165
  }
311
- this.__wbg_ptr = ret[0] >>> 0;
312
- OverlapperFinalization.register(this, this.__wbg_ptr, this);
313
- return this;
166
+ return takeFromExternrefTable0(ret[0]);
314
167
  }
315
168
  /**
316
169
  * @returns {string}
@@ -328,32 +181,30 @@ export class Overlapper {
328
181
  }
329
182
  }
330
183
  /**
331
- * @param {any} regions
332
- * @returns {any}
184
+ * @param {any} universe
185
+ * @param {string} backend
333
186
  */
334
- find(regions) {
335
- const ret = wasm.overlapper_find(this.__wbg_ptr, regions);
187
+ constructor(universe, backend) {
188
+ const ptr0 = passStringToWasm0(backend, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
189
+ const len0 = WASM_VECTOR_LEN;
190
+ const ret = wasm.overlapper_new(universe, ptr0, len0);
336
191
  if (ret[2]) {
337
192
  throw takeFromExternrefTable0(ret[1]);
338
193
  }
339
- return takeFromExternrefTable0(ret[0]);
194
+ this.__wbg_ptr = ret[0] >>> 0;
195
+ OverlapperFinalization.register(this, this.__wbg_ptr, this);
196
+ return this;
340
197
  }
341
198
  }
342
199
  if (Symbol.dispose) Overlapper.prototype[Symbol.dispose] = Overlapper.prototype.free;
343
200
 
344
- const RegionDistributionFinalization = (typeof FinalizationRegistry === 'undefined')
345
- ? { register: () => {}, unregister: () => {} }
346
- : new FinalizationRegistry(ptr => wasm.__wbg_regiondistribution_free(ptr >>> 0, 1));
347
-
348
201
  export class RegionDistribution {
349
-
350
202
  __destroy_into_raw() {
351
203
  const ptr = this.__wbg_ptr;
352
204
  this.__wbg_ptr = 0;
353
205
  RegionDistributionFinalization.unregister(this);
354
206
  return ptr;
355
207
  }
356
-
357
208
  free() {
358
209
  const ptr = this.__destroy_into_raw();
359
210
  wasm.__wbg_regiondistribution_free(ptr, 0);
@@ -361,55 +212,48 @@ export class RegionDistribution {
361
212
  }
362
213
  if (Symbol.dispose) RegionDistribution.prototype[Symbol.dispose] = RegionDistribution.prototype.free;
363
214
 
364
- const RegionSetFinalization = (typeof FinalizationRegistry === 'undefined')
365
- ? { register: () => {}, unregister: () => {} }
366
- : new FinalizationRegistry(ptr => wasm.__wbg_regionset_free(ptr >>> 0, 1));
367
-
368
215
  export class RegionSet {
369
-
370
216
  __destroy_into_raw() {
371
217
  const ptr = this.__wbg_ptr;
372
218
  this.__wbg_ptr = 0;
373
219
  RegionSetFinalization.unregister(this);
374
220
  return ptr;
375
221
  }
376
-
377
222
  free() {
378
223
  const ptr = this.__destroy_into_raw();
379
224
  wasm.__wbg_regionset_free(ptr, 0);
380
225
  }
381
226
  /**
382
- * @param {any} regions
227
+ * @returns {any}
383
228
  */
384
- constructor(regions) {
385
- const ret = wasm.regionset_new(regions);
229
+ chromosomeStatistics() {
230
+ const ret = wasm.regionset_chromosomeStatistics(this.__wbg_ptr);
386
231
  if (ret[2]) {
387
232
  throw takeFromExternrefTable0(ret[1]);
388
233
  }
389
- this.__wbg_ptr = ret[0] >>> 0;
390
- RegionSetFinalization.register(this, this.__wbg_ptr, this);
391
- return this;
392
- }
393
- /**
394
- * @returns {number}
395
- */
396
- get numberOfRegions() {
397
- const ret = wasm.regionset_numberOfRegions(this.__wbg_ptr);
398
- return ret;
234
+ return takeFromExternrefTable0(ret[0]);
399
235
  }
400
236
  /**
401
- * @returns {number}
237
+ * @returns {BedClassificationOutput}
402
238
  */
403
- get meanRegionWidth() {
404
- const ret = wasm.regionset_meanRegionWidth(this.__wbg_ptr);
405
- return ret;
239
+ get classify() {
240
+ const ret = wasm.regionset_classify(this.__wbg_ptr);
241
+ return BedClassificationOutput.__wrap(ret);
406
242
  }
407
243
  /**
408
- * @returns {number}
244
+ * @returns {string}
409
245
  */
410
- get nucleotidesLength() {
411
- const ret = wasm.regionset_nucleotidesLength(this.__wbg_ptr);
412
- return ret;
246
+ get firstRegion() {
247
+ let deferred1_0;
248
+ let deferred1_1;
249
+ try {
250
+ const ret = wasm.regionset_firstRegion(this.__wbg_ptr);
251
+ deferred1_0 = ret[0];
252
+ deferred1_1 = ret[1];
253
+ return getStringFromWasm0(ret[0], ret[1]);
254
+ } finally {
255
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
256
+ }
413
257
  }
414
258
  /**
415
259
  * @returns {string}
@@ -427,14 +271,37 @@ export class RegionSet {
427
271
  }
428
272
  }
429
273
  /**
430
- * @returns {any}
274
+ * @returns {number}
431
275
  */
432
- chromosomeStatistics() {
433
- const ret = wasm.regionset_chromosomeStatistics(this.__wbg_ptr);
276
+ get meanRegionWidth() {
277
+ const ret = wasm.regionset_meanRegionWidth(this.__wbg_ptr);
278
+ return ret;
279
+ }
280
+ /**
281
+ * @param {any} regions
282
+ */
283
+ constructor(regions) {
284
+ const ret = wasm.regionset_new(regions);
434
285
  if (ret[2]) {
435
286
  throw takeFromExternrefTable0(ret[1]);
436
287
  }
437
- return takeFromExternrefTable0(ret[0]);
288
+ this.__wbg_ptr = ret[0] >>> 0;
289
+ RegionSetFinalization.register(this, this.__wbg_ptr, this);
290
+ return this;
291
+ }
292
+ /**
293
+ * @returns {number}
294
+ */
295
+ get nucleotidesLength() {
296
+ const ret = wasm.regionset_nucleotidesLength(this.__wbg_ptr);
297
+ return ret;
298
+ }
299
+ /**
300
+ * @returns {number}
301
+ */
302
+ get numberOfRegions() {
303
+ const ret = wasm.regionset_numberOfRegions(this.__wbg_ptr);
304
+ return ret;
438
305
  }
439
306
  /**
440
307
  * @param {number} n_bins
@@ -450,44 +317,67 @@ export class RegionSet {
450
317
  }
451
318
  if (Symbol.dispose) RegionSet.prototype[Symbol.dispose] = RegionSet.prototype.free;
452
319
 
453
- const TokenizerFinalization = (typeof FinalizationRegistry === 'undefined')
454
- ? { register: () => {}, unregister: () => {} }
455
- : new FinalizationRegistry(ptr => wasm.__wbg_tokenizer_free(ptr >>> 0, 1));
456
-
457
320
  export class Tokenizer {
458
-
459
321
  __destroy_into_raw() {
460
322
  const ptr = this.__wbg_ptr;
461
323
  this.__wbg_ptr = 0;
462
324
  TokenizerFinalization.unregister(this);
463
325
  return ptr;
464
326
  }
465
-
466
327
  free() {
467
328
  const ptr = this.__destroy_into_raw();
468
329
  wasm.__wbg_tokenizer_free(ptr, 0);
469
330
  }
470
331
  /**
471
- * @param {any} universe
472
- * @param {string} backend
332
+ * @returns {string}
473
333
  */
474
- constructor(universe, backend) {
475
- const ptr0 = passStringToWasm0(backend, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
476
- const len0 = WASM_VECTOR_LEN;
477
- const ret = wasm.tokenizer_new(universe, ptr0, len0);
478
- if (ret[2]) {
479
- throw takeFromExternrefTable0(ret[1]);
334
+ get bosToken() {
335
+ let deferred1_0;
336
+ let deferred1_1;
337
+ try {
338
+ const ret = wasm.tokenizer_bosToken(this.__wbg_ptr);
339
+ deferred1_0 = ret[0];
340
+ deferred1_1 = ret[1];
341
+ return getStringFromWasm0(ret[0], ret[1]);
342
+ } finally {
343
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
480
344
  }
481
- this.__wbg_ptr = ret[0] >>> 0;
482
- TokenizerFinalization.register(this, this.__wbg_ptr, this);
483
- return this;
484
345
  }
485
346
  /**
486
- * @param {any} regions
347
+ * @returns {number}
348
+ */
349
+ get bosTokenId() {
350
+ const ret = wasm.tokenizer_bosTokenId(this.__wbg_ptr);
351
+ return ret >>> 0;
352
+ }
353
+ /**
354
+ * @returns {string}
355
+ */
356
+ get clsToken() {
357
+ let deferred1_0;
358
+ let deferred1_1;
359
+ try {
360
+ const ret = wasm.tokenizer_clsToken(this.__wbg_ptr);
361
+ deferred1_0 = ret[0];
362
+ deferred1_1 = ret[1];
363
+ return getStringFromWasm0(ret[0], ret[1]);
364
+ } finally {
365
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
366
+ }
367
+ }
368
+ /**
369
+ * @returns {number}
370
+ */
371
+ get clsTokenId() {
372
+ const ret = wasm.tokenizer_clsTokenId(this.__wbg_ptr);
373
+ return ret >>> 0;
374
+ }
375
+ /**
376
+ * @param {any} ids
487
377
  * @returns {any}
488
378
  */
489
- tokenize(regions) {
490
- const ret = wasm.tokenizer_tokenize(this.__wbg_ptr, regions);
379
+ decode(ids) {
380
+ const ret = wasm.tokenizer_decode(this.__wbg_ptr, ids);
491
381
  if (ret[2]) {
492
382
  throw takeFromExternrefTable0(ret[1]);
493
383
  }
@@ -505,24 +395,52 @@ export class Tokenizer {
505
395
  return takeFromExternrefTable0(ret[0]);
506
396
  }
507
397
  /**
508
- * @param {any} ids
398
+ * @returns {string}
399
+ */
400
+ get eosToken() {
401
+ let deferred1_0;
402
+ let deferred1_1;
403
+ try {
404
+ const ret = wasm.tokenizer_eosToken(this.__wbg_ptr);
405
+ deferred1_0 = ret[0];
406
+ deferred1_1 = ret[1];
407
+ return getStringFromWasm0(ret[0], ret[1]);
408
+ } finally {
409
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
410
+ }
411
+ }
412
+ /**
413
+ * @returns {number}
414
+ */
415
+ get eosTokenId() {
416
+ const ret = wasm.tokenizer_eosTokenId(this.__wbg_ptr);
417
+ return ret >>> 0;
418
+ }
419
+ /**
509
420
  * @returns {any}
510
421
  */
511
- decode(ids) {
512
- const ret = wasm.tokenizer_decode(this.__wbg_ptr, ids);
422
+ getVocab() {
423
+ const ret = wasm.tokenizer_getVocab(this.__wbg_ptr);
513
424
  if (ret[2]) {
514
425
  throw takeFromExternrefTable0(ret[1]);
515
426
  }
516
427
  return takeFromExternrefTable0(ret[0]);
517
428
  }
429
+ /**
430
+ * @returns {number}
431
+ */
432
+ get length() {
433
+ const ret = wasm.tokenizer_length(this.__wbg_ptr);
434
+ return ret >>> 0;
435
+ }
518
436
  /**
519
437
  * @returns {string}
520
438
  */
521
- get unkToken() {
439
+ get maskToken() {
522
440
  let deferred1_0;
523
441
  let deferred1_1;
524
442
  try {
525
- const ret = wasm.tokenizer_unkToken(this.__wbg_ptr);
443
+ const ret = wasm.tokenizer_maskToken(this.__wbg_ptr);
526
444
  deferred1_0 = ret[0];
527
445
  deferred1_1 = ret[1];
528
446
  return getStringFromWasm0(ret[0], ret[1]);
@@ -530,6 +448,28 @@ export class Tokenizer {
530
448
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
531
449
  }
532
450
  }
451
+ /**
452
+ * @returns {number}
453
+ */
454
+ get maskTokenId() {
455
+ const ret = wasm.tokenizer_maskTokenId(this.__wbg_ptr);
456
+ return ret >>> 0;
457
+ }
458
+ /**
459
+ * @param {any} universe
460
+ * @param {string} backend
461
+ */
462
+ constructor(universe, backend) {
463
+ const ptr0 = passStringToWasm0(backend, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
464
+ const len0 = WASM_VECTOR_LEN;
465
+ const ret = wasm.tokenizer_new(universe, ptr0, len0);
466
+ if (ret[2]) {
467
+ throw takeFromExternrefTable0(ret[1]);
468
+ }
469
+ this.__wbg_ptr = ret[0] >>> 0;
470
+ TokenizerFinalization.register(this, this.__wbg_ptr, this);
471
+ return this;
472
+ }
533
473
  /**
534
474
  * @returns {string}
535
475
  */
@@ -545,14 +485,21 @@ export class Tokenizer {
545
485
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
546
486
  }
547
487
  }
488
+ /**
489
+ * @returns {number}
490
+ */
491
+ get padTokenId() {
492
+ const ret = wasm.tokenizer_padTokenId(this.__wbg_ptr);
493
+ return ret >>> 0;
494
+ }
548
495
  /**
549
496
  * @returns {string}
550
497
  */
551
- get maskToken() {
498
+ get sepToken() {
552
499
  let deferred1_0;
553
500
  let deferred1_1;
554
501
  try {
555
- const ret = wasm.tokenizer_maskToken(this.__wbg_ptr);
502
+ const ret = wasm.tokenizer_sepToken(this.__wbg_ptr);
556
503
  deferred1_0 = ret[0];
557
504
  deferred1_1 = ret[1];
558
505
  return getStringFromWasm0(ret[0], ret[1]);
@@ -561,58 +508,41 @@ export class Tokenizer {
561
508
  }
562
509
  }
563
510
  /**
564
- * @returns {string}
511
+ * @returns {number}
565
512
  */
566
- get clsToken() {
567
- let deferred1_0;
568
- let deferred1_1;
569
- try {
570
- const ret = wasm.tokenizer_clsToken(this.__wbg_ptr);
571
- deferred1_0 = ret[0];
572
- deferred1_1 = ret[1];
573
- return getStringFromWasm0(ret[0], ret[1]);
574
- } finally {
575
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
576
- }
513
+ get sepTokenId() {
514
+ const ret = wasm.tokenizer_sepTokenId(this.__wbg_ptr);
515
+ return ret >>> 0;
577
516
  }
578
517
  /**
579
- * @returns {string}
518
+ * @returns {any}
580
519
  */
581
- get bosToken() {
582
- let deferred1_0;
583
- let deferred1_1;
584
- try {
585
- const ret = wasm.tokenizer_bosToken(this.__wbg_ptr);
586
- deferred1_0 = ret[0];
587
- deferred1_1 = ret[1];
588
- return getStringFromWasm0(ret[0], ret[1]);
589
- } finally {
590
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
520
+ specialTokensMap() {
521
+ const ret = wasm.tokenizer_specialTokensMap(this.__wbg_ptr);
522
+ if (ret[2]) {
523
+ throw takeFromExternrefTable0(ret[1]);
591
524
  }
525
+ return takeFromExternrefTable0(ret[0]);
592
526
  }
593
527
  /**
594
- * @returns {string}
528
+ * @param {any} regions
529
+ * @returns {any}
595
530
  */
596
- get eosToken() {
597
- let deferred1_0;
598
- let deferred1_1;
599
- try {
600
- const ret = wasm.tokenizer_eosToken(this.__wbg_ptr);
601
- deferred1_0 = ret[0];
602
- deferred1_1 = ret[1];
603
- return getStringFromWasm0(ret[0], ret[1]);
604
- } finally {
605
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
531
+ tokenize(regions) {
532
+ const ret = wasm.tokenizer_tokenize(this.__wbg_ptr, regions);
533
+ if (ret[2]) {
534
+ throw takeFromExternrefTable0(ret[1]);
606
535
  }
536
+ return takeFromExternrefTable0(ret[0]);
607
537
  }
608
538
  /**
609
539
  * @returns {string}
610
540
  */
611
- get sepToken() {
541
+ get unkToken() {
612
542
  let deferred1_0;
613
543
  let deferred1_1;
614
544
  try {
615
- const ret = wasm.tokenizer_sepToken(this.__wbg_ptr);
545
+ const ret = wasm.tokenizer_unkToken(this.__wbg_ptr);
616
546
  deferred1_0 = ret[0];
617
547
  deferred1_1 = ret[1];
618
548
  return getStringFromWasm0(ret[0], ret[1]);
@@ -623,324 +553,797 @@ export class Tokenizer {
623
553
  /**
624
554
  * @returns {number}
625
555
  */
626
- get padTokenId() {
627
- const ret = wasm.tokenizer_padTokenId(this.__wbg_ptr);
556
+ get unkTokenId() {
557
+ const ret = wasm.tokenizer_unkTokenId(this.__wbg_ptr);
628
558
  return ret >>> 0;
629
559
  }
630
560
  /**
631
561
  * @returns {number}
632
562
  */
633
- get maskTokenId() {
634
- const ret = wasm.tokenizer_maskTokenId(this.__wbg_ptr);
563
+ get vocabSize() {
564
+ const ret = wasm.tokenizer_length(this.__wbg_ptr);
635
565
  return ret >>> 0;
636
566
  }
637
- /**
638
- * @returns {number}
639
- */
640
- get clsTokenId() {
641
- const ret = wasm.tokenizer_clsTokenId(this.__wbg_ptr);
642
- return ret >>> 0;
567
+ }
568
+ if (Symbol.dispose) Tokenizer.prototype[Symbol.dispose] = Tokenizer.prototype.free;
569
+
570
+ /**
571
+ * Canonicalize a JSON string according to RFC-8785.
572
+ *
573
+ * This is useful for computing digests of JSON objects in a deterministic way.
574
+ *
575
+ * # Arguments
576
+ * * `json_str` - A JSON string
577
+ *
578
+ * # Returns
579
+ * The canonicalized JSON string
580
+ * @param {string} json_str
581
+ * @returns {string}
582
+ */
583
+ export function canonicalizeJsonString(json_str) {
584
+ let deferred3_0;
585
+ let deferred3_1;
586
+ try {
587
+ const ptr0 = passStringToWasm0(json_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
588
+ const len0 = WASM_VECTOR_LEN;
589
+ const ret = wasm.canonicalizeJsonString(ptr0, len0);
590
+ var ptr2 = ret[0];
591
+ var len2 = ret[1];
592
+ if (ret[3]) {
593
+ ptr2 = 0; len2 = 0;
594
+ throw takeFromExternrefTable0(ret[2]);
595
+ }
596
+ deferred3_0 = ptr2;
597
+ deferred3_1 = len2;
598
+ return getStringFromWasm0(ptr2, len2);
599
+ } finally {
600
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
643
601
  }
644
- /**
645
- * @returns {number}
646
- */
647
- get bosTokenId() {
648
- const ret = wasm.tokenizer_bosTokenId(this.__wbg_ptr);
649
- return ret >>> 0;
602
+ }
603
+
604
+ /**
605
+ * Compute the MD5 digest of a string.
606
+ *
607
+ * Low-level function that does NOT uppercase the input.
608
+ *
609
+ * # Arguments
610
+ * * `input` - The input string
611
+ *
612
+ * # Returns
613
+ * The MD5 digest as a hex string
614
+ * @param {string} input
615
+ * @returns {string}
616
+ */
617
+ export function computeMd5(input) {
618
+ let deferred2_0;
619
+ let deferred2_1;
620
+ try {
621
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
622
+ const len0 = WASM_VECTOR_LEN;
623
+ const ret = wasm.computeMd5(ptr0, len0);
624
+ deferred2_0 = ret[0];
625
+ deferred2_1 = ret[1];
626
+ return getStringFromWasm0(ret[0], ret[1]);
627
+ } finally {
628
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
650
629
  }
651
- /**
652
- * @returns {number}
653
- */
654
- get eosTokenId() {
655
- const ret = wasm.tokenizer_eosTokenId(this.__wbg_ptr);
656
- return ret >>> 0;
630
+ }
631
+
632
+ /**
633
+ * Compute the sha512t24u digest of a string.
634
+ *
635
+ * This is a low-level function that computes the GA4GH standard digest
636
+ * of arbitrary input. Unlike `sequence_digest`, this does NOT uppercase
637
+ * the input.
638
+ *
639
+ * # Arguments
640
+ * * `input` - The input string
641
+ *
642
+ * # Returns
643
+ * The sha512t24u digest string (base64url encoded)
644
+ * @param {string} input
645
+ * @returns {string}
646
+ */
647
+ export function computeSha512t24u(input) {
648
+ let deferred2_0;
649
+ let deferred2_1;
650
+ try {
651
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
652
+ const len0 = WASM_VECTOR_LEN;
653
+ const ret = wasm.computeSha512t24u(ptr0, len0);
654
+ deferred2_0 = ret[0];
655
+ deferred2_1 = ret[1];
656
+ return getStringFromWasm0(ret[0], ret[1]);
657
+ } finally {
658
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
657
659
  }
658
- /**
659
- * @returns {number}
660
- */
661
- get sepTokenId() {
662
- const ret = wasm.tokenizer_sepTokenId(this.__wbg_ptr);
663
- return ret >>> 0;
660
+ }
661
+
662
+ /**
663
+ * Compute a seqcol (sequence collection) digest from FASTA content.
664
+ *
665
+ * This function takes FASTA file content as bytes and returns a JSON object
666
+ * containing the sequence collection digest and metadata. Automatically handles
667
+ * gzip-compressed FASTA files.
668
+ *
669
+ * # Arguments
670
+ * * `fasta_content` - The FASTA file content as a Uint8Array (supports gzip)
671
+ *
672
+ * # Returns
673
+ * A JavaScript object containing:
674
+ * - `digest`: The top-level seqcol digest
675
+ * - `names_digest`: Level 1 digest of sequence names
676
+ * - `sequences_digest`: Level 1 digest of sequence digests
677
+ * - `lengths_digest`: Level 1 digest of sequence lengths
678
+ * - `n_sequences`: Number of sequences
679
+ * - `sequences`: Array of sequence metadata objects
680
+ *
681
+ * # Example (JavaScript)
682
+ * ```javascript
683
+ * const fastaContent = new TextEncoder().encode(">chr1\nACGT\n");
684
+ * const result = digestSeqcol(fastaContent);
685
+ * console.log(result.digest); // Top-level seqcol digest
686
+ * ```
687
+ * @param {Uint8Array} fasta_content
688
+ * @returns {any}
689
+ */
690
+ export function digestSeqcol(fasta_content) {
691
+ const ptr0 = passArray8ToWasm0(fasta_content, wasm.__wbindgen_malloc);
692
+ const len0 = WASM_VECTOR_LEN;
693
+ const ret = wasm.digestSeqcol(ptr0, len0);
694
+ if (ret[2]) {
695
+ throw takeFromExternrefTable0(ret[1]);
664
696
  }
665
- /**
666
- * @returns {number}
667
- */
668
- get unkTokenId() {
669
- const ret = wasm.tokenizer_unkTokenId(this.__wbg_ptr);
670
- return ret >>> 0;
697
+ return takeFromExternrefTable0(ret[0]);
698
+ }
699
+
700
+ /**
701
+ * Finalize the hasher and return the results.
702
+ *
703
+ * This consumes the hasher and frees its resources.
704
+ * After calling this, the handle is no longer valid.
705
+ *
706
+ * # Arguments
707
+ * * `handle` - The hasher handle from `fastaHasherNew()`
708
+ *
709
+ * # Returns
710
+ * A JavaScript object with the sequence collection result,
711
+ * or an error if the handle is invalid.
712
+ *
713
+ * # Example (JavaScript)
714
+ * ```javascript
715
+ * const handle = fastaHasherNew();
716
+ * fastaHasherUpdate(handle, fastaData);
717
+ * const result = fastaHasherFinish(handle);
718
+ * console.log(result.digest);
719
+ * ```
720
+ * @param {number} handle
721
+ * @returns {any}
722
+ */
723
+ export function fastaHasherFinish(handle) {
724
+ const ret = wasm.fastaHasherFinish(handle);
725
+ if (ret[2]) {
726
+ throw takeFromExternrefTable0(ret[1]);
671
727
  }
672
- /**
673
- * @returns {number}
674
- */
675
- get vocabSize() {
676
- const ret = wasm.tokenizer_length(this.__wbg_ptr);
677
- return ret >>> 0;
728
+ return takeFromExternrefTable0(ret[0]);
729
+ }
730
+
731
+ /**
732
+ * Free a hasher without getting results.
733
+ *
734
+ * Use this if you need to cancel processing early.
735
+ * After calling this, the handle is no longer valid.
736
+ *
737
+ * # Arguments
738
+ * * `handle` - The hasher handle from `fastaHasherNew()`
739
+ *
740
+ * # Returns
741
+ * `true` if the handle was valid and freed, `false` otherwise.
742
+ * @param {number} handle
743
+ * @returns {boolean}
744
+ */
745
+ export function fastaHasherFree(handle) {
746
+ const ret = wasm.fastaHasherFree(handle);
747
+ return ret !== 0;
748
+ }
749
+
750
+ /**
751
+ * Create a new streaming FASTA hasher.
752
+ *
753
+ * Returns a handle (u32) that must be used in subsequent calls.
754
+ * The handle must be freed with `fastaHasherFinish()` or `fastaHasherFree()`.
755
+ *
756
+ * # Returns
757
+ * A handle ID (always > 0).
758
+ *
759
+ * # Example (JavaScript)
760
+ * ```javascript
761
+ * const handle = fastaHasherNew();
762
+ * // ... use handle with fastaHasherUpdate ...
763
+ * const result = fastaHasherFinish(handle);
764
+ * ```
765
+ * @returns {number}
766
+ */
767
+ export function fastaHasherNew() {
768
+ const ret = wasm.fastaHasherNew();
769
+ return ret >>> 0;
770
+ }
771
+
772
+ /**
773
+ * Get the current progress of a streaming hasher.
774
+ *
775
+ * # Arguments
776
+ * * `handle` - The hasher handle from `fastaHasherNew()`
777
+ *
778
+ * # Returns
779
+ * A JavaScript object with progress information, or null if handle is invalid.
780
+ * The object contains:
781
+ * - `completed_sequences`: Number of fully processed sequences
782
+ * - `current_sequence_name`: Name of sequence being processed (if any)
783
+ * - `current_sequence_length`: Length of sequence being processed
784
+ * @param {number} handle
785
+ * @returns {any}
786
+ */
787
+ export function fastaHasherProgress(handle) {
788
+ const ret = wasm.fastaHasherProgress(handle);
789
+ if (ret[2]) {
790
+ throw takeFromExternrefTable0(ret[1]);
678
791
  }
679
- /**
680
- * @returns {any}
681
- */
682
- specialTokensMap() {
683
- const ret = wasm.tokenizer_specialTokensMap(this.__wbg_ptr);
684
- if (ret[2]) {
685
- throw takeFromExternrefTable0(ret[1]);
792
+ return takeFromExternrefTable0(ret[0]);
793
+ }
794
+
795
+ /**
796
+ * Process a chunk of FASTA data.
797
+ *
798
+ * This can be called multiple times with successive chunks.
799
+ * Handles both plain text and gzip-compressed FASTA.
800
+ *
801
+ * # Arguments
802
+ * * `handle` - The hasher handle from `fastaHasherNew()`
803
+ * * `chunk` - A chunk of FASTA data as Uint8Array
804
+ *
805
+ * # Returns
806
+ * Ok on success, or an error with details about what went wrong.
807
+ *
808
+ * # Example (JavaScript)
809
+ * ```javascript
810
+ * const handle = fastaHasherNew();
811
+ * fastaHasherUpdate(handle, new TextEncoder().encode(">chr1\nACGT"));
812
+ * fastaHasherUpdate(handle, new TextEncoder().encode("\n>chr2\nTGCA\n"));
813
+ * ```
814
+ * @param {number} handle
815
+ * @param {Uint8Array} chunk
816
+ */
817
+ export function fastaHasherUpdate(handle, chunk) {
818
+ const ptr0 = passArray8ToWasm0(chunk, wasm.__wbindgen_malloc);
819
+ const len0 = WASM_VECTOR_LEN;
820
+ const ret = wasm.fastaHasherUpdate(handle, ptr0, len0);
821
+ if (ret[1]) {
822
+ throw takeFromExternrefTable0(ret[0]);
823
+ }
824
+ }
825
+
826
+ /**
827
+ * @param {string} name
828
+ */
829
+ export function greet(name) {
830
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
831
+ const len0 = WASM_VECTOR_LEN;
832
+ wasm.greet(ptr0, len0);
833
+ }
834
+
835
+ /**
836
+ * Compute a sequence digest (sha512t24u) from raw sequence data.
837
+ *
838
+ * This is the GA4GH standard digest for sequences. The sequence is uppercased
839
+ * before computing the digest.
840
+ *
841
+ * # Arguments
842
+ * * `sequence` - The sequence string (A, C, G, T, etc.)
843
+ *
844
+ * # Returns
845
+ * The sha512t24u digest string (base64url encoded)
846
+ *
847
+ * # Example (JavaScript)
848
+ * ```javascript
849
+ * const digest = sequenceDigest("ACGT");
850
+ * console.log(digest); // "aKF498dAxcJAqme6QYQ7EZ07-fiw8Kw2"
851
+ * ```
852
+ * @param {string} sequence
853
+ * @returns {string}
854
+ */
855
+ export function sequenceDigest(sequence) {
856
+ let deferred2_0;
857
+ let deferred2_1;
858
+ try {
859
+ const ptr0 = passStringToWasm0(sequence, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
860
+ const len0 = WASM_VECTOR_LEN;
861
+ const ret = wasm.sequenceDigest(ptr0, len0);
862
+ deferred2_0 = ret[0];
863
+ deferred2_1 = ret[1];
864
+ return getStringFromWasm0(ret[0], ret[1]);
865
+ } finally {
866
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
867
+ }
868
+ }
869
+
870
+ /**
871
+ * Compute an MD5 digest from raw sequence data.
872
+ *
873
+ * The sequence is uppercased before computing the digest.
874
+ *
875
+ * # Arguments
876
+ * * `sequence` - The sequence string
877
+ *
878
+ * # Returns
879
+ * The MD5 digest as a hex string
880
+ * @param {string} sequence
881
+ * @returns {string}
882
+ */
883
+ export function sequenceMd5(sequence) {
884
+ let deferred2_0;
885
+ let deferred2_1;
886
+ try {
887
+ const ptr0 = passStringToWasm0(sequence, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
888
+ const len0 = WASM_VECTOR_LEN;
889
+ const ret = wasm.sequenceMd5(ptr0, len0);
890
+ deferred2_0 = ret[0];
891
+ deferred2_1 = ret[1];
892
+ return getStringFromWasm0(ret[0], ret[1]);
893
+ } finally {
894
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
895
+ }
896
+ }
897
+
898
+ function __wbg_get_imports() {
899
+ const import0 = {
900
+ __proto__: null,
901
+ __wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
902
+ const ret = Error(getStringFromWasm0(arg0, arg1));
903
+ return ret;
904
+ },
905
+ __wbg_String_fed4d24b68977888: function(arg0, arg1) {
906
+ const ret = String(arg1);
907
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
908
+ const len1 = WASM_VECTOR_LEN;
909
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
910
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
911
+ },
912
+ __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
913
+ const v = arg0;
914
+ const ret = typeof(v) === 'boolean' ? v : undefined;
915
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
916
+ },
917
+ __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
918
+ const ret = debugString(arg1);
919
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
920
+ const len1 = WASM_VECTOR_LEN;
921
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
922
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
923
+ },
924
+ __wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
925
+ const ret = typeof(arg0) === 'function';
926
+ return ret;
927
+ },
928
+ __wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
929
+ const val = arg0;
930
+ const ret = typeof(val) === 'object' && val !== null;
931
+ return ret;
932
+ },
933
+ __wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
934
+ const ret = typeof(arg0) === 'string';
935
+ return ret;
936
+ },
937
+ __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
938
+ const ret = arg0 == arg1;
939
+ return ret;
940
+ },
941
+ __wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
942
+ const obj = arg1;
943
+ const ret = typeof(obj) === 'number' ? obj : undefined;
944
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
945
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
946
+ },
947
+ __wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
948
+ const obj = arg1;
949
+ const ret = typeof(obj) === 'string' ? obj : undefined;
950
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
951
+ var len1 = WASM_VECTOR_LEN;
952
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
953
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
954
+ },
955
+ __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
956
+ throw new Error(getStringFromWasm0(arg0, arg1));
957
+ },
958
+ __wbg_alert_b04a0b1c35e31e39: function(arg0, arg1) {
959
+ alert(getStringFromWasm0(arg0, arg1));
960
+ },
961
+ __wbg_call_389efe28435a9388: function() { return handleError(function (arg0, arg1) {
962
+ const ret = arg0.call(arg1);
963
+ return ret;
964
+ }, arguments); },
965
+ __wbg_done_57b39ecd9addfe81: function(arg0) {
966
+ const ret = arg0.done;
967
+ return ret;
968
+ },
969
+ __wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
970
+ const ret = arg0[arg1 >>> 0];
971
+ return ret;
972
+ },
973
+ __wbg_get_b3ed3ad4be2bc8ac: function() { return handleError(function (arg0, arg1) {
974
+ const ret = Reflect.get(arg0, arg1);
975
+ return ret;
976
+ }, arguments); },
977
+ __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
978
+ let result;
979
+ try {
980
+ result = arg0 instanceof ArrayBuffer;
981
+ } catch (_) {
982
+ result = false;
983
+ }
984
+ const ret = result;
985
+ return ret;
986
+ },
987
+ __wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
988
+ let result;
989
+ try {
990
+ result = arg0 instanceof Uint8Array;
991
+ } catch (_) {
992
+ result = false;
993
+ }
994
+ const ret = result;
995
+ return ret;
996
+ },
997
+ __wbg_isArray_d314bb98fcf08331: function(arg0) {
998
+ const ret = Array.isArray(arg0);
999
+ return ret;
1000
+ },
1001
+ __wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
1002
+ const ret = Number.isSafeInteger(arg0);
1003
+ return ret;
1004
+ },
1005
+ __wbg_iterator_6ff6560ca1568e55: function() {
1006
+ const ret = Symbol.iterator;
1007
+ return ret;
1008
+ },
1009
+ __wbg_length_32ed9a279acd054c: function(arg0) {
1010
+ const ret = arg0.length;
1011
+ return ret;
1012
+ },
1013
+ __wbg_length_35a7bace40f36eac: function(arg0) {
1014
+ const ret = arg0.length;
1015
+ return ret;
1016
+ },
1017
+ __wbg_new_361308b2356cecd0: function() {
1018
+ const ret = new Object();
1019
+ return ret;
1020
+ },
1021
+ __wbg_new_3eb36ae241fe6f44: function() {
1022
+ const ret = new Array();
1023
+ return ret;
1024
+ },
1025
+ __wbg_new_dca287b076112a51: function() {
1026
+ const ret = new Map();
1027
+ return ret;
1028
+ },
1029
+ __wbg_new_dd2b680c8bf6ae29: function(arg0) {
1030
+ const ret = new Uint8Array(arg0);
1031
+ return ret;
1032
+ },
1033
+ __wbg_next_3482f54c49e8af19: function() { return handleError(function (arg0) {
1034
+ const ret = arg0.next();
1035
+ return ret;
1036
+ }, arguments); },
1037
+ __wbg_next_418f80d8f5303233: function(arg0) {
1038
+ const ret = arg0.next;
1039
+ return ret;
1040
+ },
1041
+ __wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
1042
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1043
+ },
1044
+ __wbg_set_1eb0999cf5d27fc8: function(arg0, arg1, arg2) {
1045
+ const ret = arg0.set(arg1, arg2);
1046
+ return ret;
1047
+ },
1048
+ __wbg_set_3fda3bac07393de4: function(arg0, arg1, arg2) {
1049
+ arg0[arg1] = arg2;
1050
+ },
1051
+ __wbg_set_f43e577aea94465b: function(arg0, arg1, arg2) {
1052
+ arg0[arg1 >>> 0] = arg2;
1053
+ },
1054
+ __wbg_value_0546255b415e96c1: function(arg0) {
1055
+ const ret = arg0.value;
1056
+ return ret;
1057
+ },
1058
+ __wbindgen_cast_0000000000000001: function(arg0) {
1059
+ // Cast intrinsic for `F64 -> Externref`.
1060
+ const ret = arg0;
1061
+ return ret;
1062
+ },
1063
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1064
+ // Cast intrinsic for `Ref(String) -> Externref`.
1065
+ const ret = getStringFromWasm0(arg0, arg1);
1066
+ return ret;
1067
+ },
1068
+ __wbindgen_cast_0000000000000003: function(arg0) {
1069
+ // Cast intrinsic for `U64 -> Externref`.
1070
+ const ret = BigInt.asUintN(64, arg0);
1071
+ return ret;
1072
+ },
1073
+ __wbindgen_init_externref_table: function() {
1074
+ const table = wasm.__wbindgen_externrefs;
1075
+ const offset = table.grow(4);
1076
+ table.set(0, undefined);
1077
+ table.set(offset + 0, undefined);
1078
+ table.set(offset + 1, null);
1079
+ table.set(offset + 2, true);
1080
+ table.set(offset + 3, false);
1081
+ },
1082
+ };
1083
+ return {
1084
+ __proto__: null,
1085
+ "./gtars_js_bg.js": import0,
1086
+ };
1087
+ }
1088
+
1089
+ const BedClassificationOutputFinalization = (typeof FinalizationRegistry === 'undefined')
1090
+ ? { register: () => {}, unregister: () => {} }
1091
+ : new FinalizationRegistry(ptr => wasm.__wbg_bedclassificationoutput_free(ptr >>> 0, 1));
1092
+ const ChromosomeStatisticsFinalization = (typeof FinalizationRegistry === 'undefined')
1093
+ ? { register: () => {}, unregister: () => {} }
1094
+ : new FinalizationRegistry(ptr => wasm.__wbg_chromosomestatistics_free(ptr >>> 0, 1));
1095
+ const OverlapperFinalization = (typeof FinalizationRegistry === 'undefined')
1096
+ ? { register: () => {}, unregister: () => {} }
1097
+ : new FinalizationRegistry(ptr => wasm.__wbg_overlapper_free(ptr >>> 0, 1));
1098
+ const RegionDistributionFinalization = (typeof FinalizationRegistry === 'undefined')
1099
+ ? { register: () => {}, unregister: () => {} }
1100
+ : new FinalizationRegistry(ptr => wasm.__wbg_regiondistribution_free(ptr >>> 0, 1));
1101
+ const RegionSetFinalization = (typeof FinalizationRegistry === 'undefined')
1102
+ ? { register: () => {}, unregister: () => {} }
1103
+ : new FinalizationRegistry(ptr => wasm.__wbg_regionset_free(ptr >>> 0, 1));
1104
+ const TokenizerFinalization = (typeof FinalizationRegistry === 'undefined')
1105
+ ? { register: () => {}, unregister: () => {} }
1106
+ : new FinalizationRegistry(ptr => wasm.__wbg_tokenizer_free(ptr >>> 0, 1));
1107
+
1108
+ function addToExternrefTable0(obj) {
1109
+ const idx = wasm.__externref_table_alloc();
1110
+ wasm.__wbindgen_externrefs.set(idx, obj);
1111
+ return idx;
1112
+ }
1113
+
1114
+ function debugString(val) {
1115
+ // primitive types
1116
+ const type = typeof val;
1117
+ if (type == 'number' || type == 'boolean' || val == null) {
1118
+ return `${val}`;
1119
+ }
1120
+ if (type == 'string') {
1121
+ return `"${val}"`;
1122
+ }
1123
+ if (type == 'symbol') {
1124
+ const description = val.description;
1125
+ if (description == null) {
1126
+ return 'Symbol';
1127
+ } else {
1128
+ return `Symbol(${description})`;
686
1129
  }
687
- return takeFromExternrefTable0(ret[0]);
688
1130
  }
689
- /**
690
- * @returns {any}
691
- */
692
- getVocab() {
693
- const ret = wasm.tokenizer_getVocab(this.__wbg_ptr);
694
- if (ret[2]) {
695
- throw takeFromExternrefTable0(ret[1]);
1131
+ if (type == 'function') {
1132
+ const name = val.name;
1133
+ if (typeof name == 'string' && name.length > 0) {
1134
+ return `Function(${name})`;
1135
+ } else {
1136
+ return 'Function';
696
1137
  }
697
- return takeFromExternrefTable0(ret[0]);
698
1138
  }
699
- /**
700
- * @returns {number}
701
- */
702
- get length() {
703
- const ret = wasm.tokenizer_length(this.__wbg_ptr);
704
- return ret >>> 0;
1139
+ // objects
1140
+ if (Array.isArray(val)) {
1141
+ const length = val.length;
1142
+ let debug = '[';
1143
+ if (length > 0) {
1144
+ debug += debugString(val[0]);
1145
+ }
1146
+ for(let i = 1; i < length; i++) {
1147
+ debug += ', ' + debugString(val[i]);
1148
+ }
1149
+ debug += ']';
1150
+ return debug;
705
1151
  }
1152
+ // Test for built-in
1153
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1154
+ let className;
1155
+ if (builtInMatches && builtInMatches.length > 1) {
1156
+ className = builtInMatches[1];
1157
+ } else {
1158
+ // Failed to match the standard '[object ClassName]'
1159
+ return toString.call(val);
1160
+ }
1161
+ if (className == 'Object') {
1162
+ // we're a user defined class or Object
1163
+ // JSON.stringify avoids problems with cycles, and is generally much
1164
+ // easier than looping through ownProperties of `val`.
1165
+ try {
1166
+ return 'Object(' + JSON.stringify(val) + ')';
1167
+ } catch (_) {
1168
+ return 'Object';
1169
+ }
1170
+ }
1171
+ // errors
1172
+ if (val instanceof Error) {
1173
+ return `${val.name}: ${val.message}\n${val.stack}`;
1174
+ }
1175
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1176
+ return className;
1177
+ }
1178
+
1179
+ function getArrayU8FromWasm0(ptr, len) {
1180
+ ptr = ptr >>> 0;
1181
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1182
+ }
1183
+
1184
+ let cachedDataViewMemory0 = null;
1185
+ function getDataViewMemory0() {
1186
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1187
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1188
+ }
1189
+ return cachedDataViewMemory0;
1190
+ }
1191
+
1192
+ function getStringFromWasm0(ptr, len) {
1193
+ ptr = ptr >>> 0;
1194
+ return decodeText(ptr, len);
1195
+ }
1196
+
1197
+ let cachedUint8ArrayMemory0 = null;
1198
+ function getUint8ArrayMemory0() {
1199
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1200
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1201
+ }
1202
+ return cachedUint8ArrayMemory0;
1203
+ }
1204
+
1205
+ function handleError(f, args) {
1206
+ try {
1207
+ return f.apply(this, args);
1208
+ } catch (e) {
1209
+ const idx = addToExternrefTable0(e);
1210
+ wasm.__wbindgen_exn_store(idx);
1211
+ }
1212
+ }
1213
+
1214
+ function isLikeNone(x) {
1215
+ return x === undefined || x === null;
1216
+ }
1217
+
1218
+ function passArray8ToWasm0(arg, malloc) {
1219
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1220
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1221
+ WASM_VECTOR_LEN = arg.length;
1222
+ return ptr;
1223
+ }
1224
+
1225
+ function passStringToWasm0(arg, malloc, realloc) {
1226
+ if (realloc === undefined) {
1227
+ const buf = cachedTextEncoder.encode(arg);
1228
+ const ptr = malloc(buf.length, 1) >>> 0;
1229
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1230
+ WASM_VECTOR_LEN = buf.length;
1231
+ return ptr;
1232
+ }
1233
+
1234
+ let len = arg.length;
1235
+ let ptr = malloc(len, 1) >>> 0;
1236
+
1237
+ const mem = getUint8ArrayMemory0();
1238
+
1239
+ let offset = 0;
1240
+
1241
+ for (; offset < len; offset++) {
1242
+ const code = arg.charCodeAt(offset);
1243
+ if (code > 0x7F) break;
1244
+ mem[ptr + offset] = code;
1245
+ }
1246
+ if (offset !== len) {
1247
+ if (offset !== 0) {
1248
+ arg = arg.slice(offset);
1249
+ }
1250
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1251
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1252
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1253
+
1254
+ offset += ret.written;
1255
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1256
+ }
1257
+
1258
+ WASM_VECTOR_LEN = offset;
1259
+ return ptr;
1260
+ }
1261
+
1262
+ function takeFromExternrefTable0(idx) {
1263
+ const value = wasm.__wbindgen_externrefs.get(idx);
1264
+ wasm.__externref_table_dealloc(idx);
1265
+ return value;
706
1266
  }
707
- if (Symbol.dispose) Tokenizer.prototype[Symbol.dispose] = Tokenizer.prototype.free;
708
1267
 
709
- const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
1268
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1269
+ cachedTextDecoder.decode();
1270
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1271
+ let numBytesDecoded = 0;
1272
+ function decodeText(ptr, len) {
1273
+ numBytesDecoded += len;
1274
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1275
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1276
+ cachedTextDecoder.decode();
1277
+ numBytesDecoded = len;
1278
+ }
1279
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1280
+ }
1281
+
1282
+ const cachedTextEncoder = new TextEncoder();
1283
+
1284
+ if (!('encodeInto' in cachedTextEncoder)) {
1285
+ cachedTextEncoder.encodeInto = function (arg, view) {
1286
+ const buf = cachedTextEncoder.encode(arg);
1287
+ view.set(buf);
1288
+ return {
1289
+ read: arg.length,
1290
+ written: buf.length
1291
+ };
1292
+ };
1293
+ }
1294
+
1295
+ let WASM_VECTOR_LEN = 0;
1296
+
1297
+ let wasmModule, wasm;
1298
+ function __wbg_finalize_init(instance, module) {
1299
+ wasm = instance.exports;
1300
+ wasmModule = module;
1301
+ cachedDataViewMemory0 = null;
1302
+ cachedUint8ArrayMemory0 = null;
1303
+ wasm.__wbindgen_start();
1304
+ return wasm;
1305
+ }
710
1306
 
711
1307
  async function __wbg_load(module, imports) {
712
1308
  if (typeof Response === 'function' && module instanceof Response) {
713
1309
  if (typeof WebAssembly.instantiateStreaming === 'function') {
714
1310
  try {
715
1311
  return await WebAssembly.instantiateStreaming(module, imports);
716
-
717
1312
  } catch (e) {
718
- const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
1313
+ const validResponse = module.ok && expectedResponseType(module.type);
719
1314
 
720
1315
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
721
1316
  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);
722
1317
 
723
- } else {
724
- throw e;
725
- }
1318
+ } else { throw e; }
726
1319
  }
727
1320
  }
728
1321
 
729
1322
  const bytes = await module.arrayBuffer();
730
1323
  return await WebAssembly.instantiate(bytes, imports);
731
-
732
1324
  } else {
733
1325
  const instance = await WebAssembly.instantiate(module, imports);
734
1326
 
735
1327
  if (instance instanceof WebAssembly.Instance) {
736
1328
  return { instance, module };
737
-
738
1329
  } else {
739
1330
  return instance;
740
1331
  }
741
1332
  }
742
- }
743
1333
 
744
- function __wbg_get_imports() {
745
- const imports = {};
746
- imports.wbg = {};
747
- imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
748
- const ret = Error(getStringFromWasm0(arg0, arg1));
749
- return ret;
750
- };
751
- imports.wbg.__wbg_String_fed4d24b68977888 = function(arg0, arg1) {
752
- const ret = String(arg1);
753
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
754
- const len1 = WASM_VECTOR_LEN;
755
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
756
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
757
- };
758
- imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
759
- const v = arg0;
760
- const ret = typeof(v) === 'boolean' ? v : undefined;
761
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
762
- };
763
- imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
764
- const ret = debugString(arg1);
765
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
766
- const len1 = WASM_VECTOR_LEN;
767
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
768
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
769
- };
770
- imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
771
- const ret = typeof(arg0) === 'function';
772
- return ret;
773
- };
774
- imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
775
- const val = arg0;
776
- const ret = typeof(val) === 'object' && val !== null;
777
- return ret;
778
- };
779
- imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
780
- const ret = typeof(arg0) === 'string';
781
- return ret;
782
- };
783
- imports.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
784
- const ret = arg0 == arg1;
785
- return ret;
786
- };
787
- imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
788
- const obj = arg1;
789
- const ret = typeof(obj) === 'number' ? obj : undefined;
790
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
791
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
792
- };
793
- imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
794
- const obj = arg1;
795
- const ret = typeof(obj) === 'string' ? obj : undefined;
796
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
797
- var len1 = WASM_VECTOR_LEN;
798
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
799
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
800
- };
801
- imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
802
- throw new Error(getStringFromWasm0(arg0, arg1));
803
- };
804
- imports.wbg.__wbg_alert_bc6302c5a36a6d7f = function(arg0, arg1) {
805
- alert(getStringFromWasm0(arg0, arg1));
806
- };
807
- imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
808
- const ret = arg0.call(arg1);
809
- return ret;
810
- }, arguments) };
811
- imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
812
- const ret = arg0.done;
813
- return ret;
814
- };
815
- imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
816
- const ret = arg0[arg1 >>> 0];
817
- return ret;
818
- };
819
- imports.wbg.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {
820
- const ret = Reflect.get(arg0, arg1);
821
- return ret;
822
- }, arguments) };
823
- imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
824
- let result;
825
- try {
826
- result = arg0 instanceof ArrayBuffer;
827
- } catch (_) {
828
- result = false;
1334
+ function expectedResponseType(type) {
1335
+ switch (type) {
1336
+ case 'basic': case 'cors': case 'default': return true;
829
1337
  }
830
- const ret = result;
831
- return ret;
832
- };
833
- imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
834
- let result;
835
- try {
836
- result = arg0 instanceof Uint8Array;
837
- } catch (_) {
838
- result = false;
839
- }
840
- const ret = result;
841
- return ret;
842
- };
843
- imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
844
- const ret = Array.isArray(arg0);
845
- return ret;
846
- };
847
- imports.wbg.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
848
- const ret = Number.isSafeInteger(arg0);
849
- return ret;
850
- };
851
- imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
852
- const ret = Symbol.iterator;
853
- return ret;
854
- };
855
- imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
856
- const ret = arg0.length;
857
- return ret;
858
- };
859
- imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
860
- const ret = arg0.length;
861
- return ret;
862
- };
863
- imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
864
- const ret = new Object();
865
- return ret;
866
- };
867
- imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
868
- const ret = new Uint8Array(arg0);
869
- return ret;
870
- };
871
- imports.wbg.__wbg_new_68651c719dcda04e = function() {
872
- const ret = new Map();
873
- return ret;
874
- };
875
- imports.wbg.__wbg_new_e17d9f43105b08be = function() {
876
- const ret = new Array();
877
- return ret;
878
- };
879
- imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() { return handleError(function (arg0) {
880
- const ret = arg0.next();
881
- return ret;
882
- }, arguments) };
883
- imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
884
- const ret = arg0.next;
885
- return ret;
886
- };
887
- imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
888
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
889
- };
890
- imports.wbg.__wbg_set_3fda3bac07393de4 = function(arg0, arg1, arg2) {
891
- arg0[arg1] = arg2;
892
- };
893
- imports.wbg.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
894
- const ret = arg0.set(arg1, arg2);
895
- return ret;
896
- };
897
- imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
898
- arg0[arg1 >>> 0] = arg2;
899
- };
900
- imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
901
- const ret = arg0.value;
902
- return ret;
903
- };
904
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
905
- // Cast intrinsic for `Ref(String) -> Externref`.
906
- const ret = getStringFromWasm0(arg0, arg1);
907
- return ret;
908
- };
909
- imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
910
- // Cast intrinsic for `F64 -> Externref`.
911
- const ret = arg0;
912
- return ret;
913
- };
914
- imports.wbg.__wbindgen_init_externref_table = function() {
915
- const table = wasm.__wbindgen_externrefs;
916
- const offset = table.grow(4);
917
- table.set(0, undefined);
918
- table.set(offset + 0, undefined);
919
- table.set(offset + 1, null);
920
- table.set(offset + 2, true);
921
- table.set(offset + 3, false);
922
- ;
923
- };
924
-
925
- return imports;
926
- }
927
-
928
- function __wbg_finalize_init(instance, module) {
929
- wasm = instance.exports;
930
- __wbg_init.__wbindgen_wasm_module = module;
931
- cachedDataViewMemory0 = null;
932
- cachedUint8ArrayMemory0 = null;
933
-
934
-
935
- wasm.__wbindgen_start();
936
- return wasm;
1338
+ return false;
1339
+ }
937
1340
  }
938
1341
 
939
1342
  function initSync(module) {
940
1343
  if (wasm !== undefined) return wasm;
941
1344
 
942
1345
 
943
- if (typeof module !== 'undefined') {
1346
+ if (module !== undefined) {
944
1347
  if (Object.getPrototypeOf(module) === Object.prototype) {
945
1348
  ({module} = module)
946
1349
  } else {
@@ -949,13 +1352,10 @@ function initSync(module) {
949
1352
  }
950
1353
 
951
1354
  const imports = __wbg_get_imports();
952
-
953
1355
  if (!(module instanceof WebAssembly.Module)) {
954
1356
  module = new WebAssembly.Module(module);
955
1357
  }
956
-
957
1358
  const instance = new WebAssembly.Instance(module, imports);
958
-
959
1359
  return __wbg_finalize_init(instance, module);
960
1360
  }
961
1361
 
@@ -963,7 +1363,7 @@ async function __wbg_init(module_or_path) {
963
1363
  if (wasm !== undefined) return wasm;
964
1364
 
965
1365
 
966
- if (typeof module_or_path !== 'undefined') {
1366
+ if (module_or_path !== undefined) {
967
1367
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
968
1368
  ({module_or_path} = module_or_path)
969
1369
  } else {
@@ -971,7 +1371,7 @@ async function __wbg_init(module_or_path) {
971
1371
  }
972
1372
  }
973
1373
 
974
- if (typeof module_or_path === 'undefined') {
1374
+ if (module_or_path === undefined) {
975
1375
  module_or_path = new URL('gtars_js_bg.wasm', import.meta.url);
976
1376
  }
977
1377
  const imports = __wbg_get_imports();
@@ -985,5 +1385,4 @@ async function __wbg_init(module_or_path) {
985
1385
  return __wbg_finalize_init(instance, module);
986
1386
  }
987
1387
 
988
- export { initSync };
989
- export default __wbg_init;
1388
+ export { initSync, __wbg_init as default };