@genome-spy/core 0.69.1 → 0.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/bundle/{AbortablePromiseCache-CcuMrnn7.js → AbortablePromiseCache-Dj0vzLnp.js} +4 -4
  2. package/dist/bundle/{browser-BRemItdO.js → browser-0iNU5Wit.js} +33 -33
  3. package/dist/bundle/index-BYsZN7b0.js +1597 -0
  4. package/dist/bundle/{index-Cq3QFUxX.js → index-C3kClAEN.js} +583 -593
  5. package/dist/bundle/{index-D-w7Mmt9.js → index-C7wOh6y1.js} +138 -140
  6. package/dist/bundle/index-CRaQAuki.js +326 -0
  7. package/dist/bundle/{index-D74H8TTz.js → index-D9v1PCj9.js} +1 -2
  8. package/dist/bundle/{index-BatuyGAI.js → index-GDOuv_D5.js} +75 -80
  9. package/dist/bundle/{index-DbJ0oeYM.js → index-Gt44EOIH.js} +160 -163
  10. package/dist/bundle/index.es.js +8778 -9046
  11. package/dist/bundle/index.js +123 -165
  12. package/dist/bundle/{unzip-NywezaRR.js → unzip-Bac01w6X.js} +1 -1
  13. package/dist/src/gl/colorUtils.d.ts +2 -1
  14. package/dist/src/gl/colorUtils.d.ts.map +1 -1
  15. package/dist/src/gl/colorUtils.js +15 -3
  16. package/dist/src/gl/colorUtils.test.d.ts +2 -0
  17. package/dist/src/gl/colorUtils.test.d.ts.map +1 -0
  18. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  19. package/dist/src/gl/webGLHelper.js +2 -1
  20. package/dist/src/index.d.ts.map +1 -1
  21. package/dist/src/index.js +2 -5
  22. package/dist/src/marks/mark.d.ts +0 -2
  23. package/dist/src/marks/mark.d.ts.map +1 -1
  24. package/dist/src/marks/mark.js +0 -8
  25. package/dist/src/marks/rect.d.ts.map +1 -1
  26. package/dist/src/marks/rect.js +0 -8
  27. package/dist/src/utils/deepEqual.d.ts +14 -0
  28. package/dist/src/utils/deepEqual.d.ts.map +1 -0
  29. package/dist/src/utils/deepEqual.js +63 -0
  30. package/dist/src/utils/deepEqual.test.d.ts +2 -0
  31. package/dist/src/utils/deepEqual.test.d.ts.map +1 -0
  32. package/dist/src/utils/fetchUtils.d.ts +27 -0
  33. package/dist/src/utils/fetchUtils.d.ts.map +1 -0
  34. package/dist/src/utils/fetchUtils.js +47 -0
  35. package/dist/src/utils/fetchUtils.test.d.ts +2 -0
  36. package/dist/src/utils/fetchUtils.test.d.ts.map +1 -0
  37. package/dist/src/utils/url.d.ts +12 -0
  38. package/dist/src/utils/url.d.ts.map +1 -1
  39. package/dist/src/utils/url.js +45 -0
  40. package/dist/src/view/viewUtils.d.ts.map +1 -1
  41. package/dist/src/view/viewUtils.js +4 -5
  42. package/package.json +2 -2
  43. package/dist/bundle/index-ByuE8dvu.js +0 -332
  44. package/dist/bundle/index-D28m8tSW.js +0 -1607
@@ -1,68 +1,65 @@
1
- var Ne = Object.defineProperty;
2
- var Le = (t, r, e) => r in t ? Ne(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
- var E = (t, r, e) => Le(t, typeof r != "symbol" ? r + "" : r, e);
4
- import { RemoteFile as Me, LocalFile as He } from "./browser-BRemItdO.js";
5
- import { A as le } from "./AbortablePromiseCache-CcuMrnn7.js";
6
- import { i as $e } from "./inflate-GtwLkvSP.js";
7
- const he = BigInt(32);
8
- function je(t, r, e) {
1
+ import { RemoteFile as Re, LocalFile as De } from "./browser-0iNU5Wit.js";
2
+ import { A as ue } from "./AbortablePromiseCache-Dj0vzLnp.js";
3
+ import { i as Ne } from "./inflate-GtwLkvSP.js";
4
+ const fe = BigInt(32);
5
+ function Le(t, r, e) {
9
6
  const n = +!!e, i = +!e;
10
- return BigInt(t.getInt32(r, e) * i + t.getInt32(r + 4, e) * n) << he | BigInt(t.getUint32(r, e) * n + t.getUint32(r + 4, e) * i);
7
+ return BigInt(t.getInt32(r, e) * i + t.getInt32(r + 4, e) * n) << fe | BigInt(t.getUint32(r, e) * n + t.getUint32(r + 4, e) * i);
11
8
  }
12
- function Ge(t, r, e) {
9
+ function Me(t, r, e) {
13
10
  const n = t.getUint32(r, e), i = t.getUint32(r + 4, e), o = +!!e, s = +!e;
14
- return BigInt(n * s + i * o) << he | BigInt(n * o + i * s);
11
+ return BigInt(n * s + i * o) << fe | BigInt(n * o + i * s);
15
12
  }
16
13
  "getBigInt64" in DataView || (DataView.prototype.getBigInt64 = function(t, r) {
17
- return je(this, t, r);
14
+ return Le(this, t, r);
18
15
  });
19
16
  "getBigUint64" in DataView || (DataView.prototype.getBigUint64 = function(t, r) {
20
- return Ge(this, t, r);
17
+ return Me(this, t, r);
21
18
  });
22
- var K = function(t, r) {
23
- return K = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
19
+ var J = function(t, r) {
20
+ return J = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
24
21
  e.__proto__ = n;
25
22
  } || function(e, n) {
26
23
  for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
27
- }, K(t, r);
24
+ }, J(t, r);
28
25
  };
29
- function te(t, r) {
26
+ function X(t, r) {
30
27
  if (typeof r != "function" && r !== null)
31
28
  throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
32
- K(t, r);
29
+ J(t, r);
33
30
  function e() {
34
31
  this.constructor = t;
35
32
  }
36
33
  t.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e());
37
34
  }
38
- function We(t, r, e, n) {
35
+ function He(t, r, e, n) {
39
36
  function i(o) {
40
37
  return o instanceof e ? o : new e(function(s) {
41
38
  s(o);
42
39
  });
43
40
  }
44
41
  return new (e || (e = Promise))(function(o, s) {
45
- function u(d) {
42
+ function u(h) {
46
43
  try {
47
- c(n.next(d));
48
- } catch (y) {
49
- s(y);
44
+ c(n.next(h));
45
+ } catch (d) {
46
+ s(d);
50
47
  }
51
48
  }
52
- function a(d) {
49
+ function a(h) {
53
50
  try {
54
- c(n.throw(d));
55
- } catch (y) {
56
- s(y);
51
+ c(n.throw(h));
52
+ } catch (d) {
53
+ s(d);
57
54
  }
58
55
  }
59
- function c(d) {
60
- d.done ? o(d.value) : i(d.value).then(u, a);
56
+ function c(h) {
57
+ h.done ? o(h.value) : i(h.value).then(u, a);
61
58
  }
62
59
  c((n = n.apply(t, r || [])).next());
63
60
  });
64
61
  }
65
- function de(t, r) {
62
+ function le(t, r) {
66
63
  var e = { label: 0, sent: function() {
67
64
  if (o[0] & 1) throw o[1];
68
65
  return o[1];
@@ -71,8 +68,8 @@ function de(t, r) {
71
68
  return this;
72
69
  }), s;
73
70
  function u(c) {
74
- return function(d) {
75
- return a([c, d]);
71
+ return function(h) {
72
+ return a([c, h]);
76
73
  };
77
74
  }
78
75
  function a(c) {
@@ -113,8 +110,8 @@ function de(t, r) {
113
110
  continue;
114
111
  }
115
112
  c = r.call(t, e);
116
- } catch (d) {
117
- c = [6, d], i = 0;
113
+ } catch (h) {
114
+ c = [6, h], i = 0;
118
115
  } finally {
119
116
  n = o = 0;
120
117
  }
@@ -122,7 +119,7 @@ function de(t, r) {
122
119
  return { value: c[0] ? c[1] : void 0, done: !0 };
123
120
  }
124
121
  }
125
- function M(t) {
122
+ function N(t) {
126
123
  var r = typeof Symbol == "function" && Symbol.iterator, e = r && t[r], n = 0;
127
124
  if (e) return e.call(t);
128
125
  if (t && typeof t.length == "number") return {
@@ -132,7 +129,7 @@ function M(t) {
132
129
  };
133
130
  throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined.");
134
131
  }
135
- function X(t, r) {
132
+ function Z(t, r) {
136
133
  var e = typeof Symbol == "function" && t[Symbol.iterator];
137
134
  if (!e) return t;
138
135
  var n = e.call(t), i, o = [], s;
@@ -149,15 +146,15 @@ function X(t, r) {
149
146
  }
150
147
  return o;
151
148
  }
152
- function ee(t, r, e) {
149
+ function K(t, r, e) {
153
150
  if (e || arguments.length === 2) for (var n = 0, i = r.length, o; n < i; n++)
154
151
  (o || !(n in r)) && (o || (o = Array.prototype.slice.call(r, 0, n)), o[n] = r[n]);
155
152
  return t.concat(o || Array.prototype.slice.call(r));
156
153
  }
157
- function R(t) {
158
- return this instanceof R ? (this.v = t, this) : new R(t);
154
+ function z(t) {
155
+ return this instanceof z ? (this.v = t, this) : new z(t);
159
156
  }
160
- function qe(t, r, e) {
157
+ function $e(t, r, e) {
161
158
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
162
159
  var n = e.apply(t, r || []), i, o = [];
163
160
  return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), u("next"), u("throw"), u("return", s), i[Symbol.asyncIterator] = function() {
@@ -165,13 +162,13 @@ function qe(t, r, e) {
165
162
  }, i;
166
163
  function s(f) {
167
164
  return function(m) {
168
- return Promise.resolve(m).then(f, y);
165
+ return Promise.resolve(m).then(f, d);
169
166
  };
170
167
  }
171
168
  function u(f, m) {
172
169
  n[f] && (i[f] = function(l) {
173
- return new Promise(function(v, b) {
174
- o.push([f, l, v, b]) > 1 || a(f, l);
170
+ return new Promise(function(B, w) {
171
+ o.push([f, l, B, w]) > 1 || a(f, l);
175
172
  });
176
173
  }, m && (i[f] = m(i[f])));
177
174
  }
@@ -179,26 +176,26 @@ function qe(t, r, e) {
179
176
  try {
180
177
  c(n[f](m));
181
178
  } catch (l) {
182
- g(o[0][3], l);
179
+ b(o[0][3], l);
183
180
  }
184
181
  }
185
182
  function c(f) {
186
- f.value instanceof R ? Promise.resolve(f.value.v).then(d, y) : g(o[0][2], f);
183
+ f.value instanceof z ? Promise.resolve(f.value.v).then(h, d) : b(o[0][2], f);
187
184
  }
188
- function d(f) {
185
+ function h(f) {
189
186
  a("next", f);
190
187
  }
191
- function y(f) {
188
+ function d(f) {
192
189
  a("throw", f);
193
190
  }
194
- function g(f, m) {
191
+ function b(f, m) {
195
192
  f(m), o.shift(), o.length && a(o[0][0], o[0][1]);
196
193
  }
197
194
  }
198
- function Ye(t) {
195
+ function je(t) {
199
196
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
200
197
  var r = t[Symbol.asyncIterator], e;
201
- return r ? r.call(t) : (t = typeof M == "function" ? M(t) : t[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
198
+ return r ? r.call(t) : (t = typeof N == "function" ? N(t) : t[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
202
199
  return this;
203
200
  }, e);
204
201
  function n(o) {
@@ -217,13 +214,13 @@ function Ye(t) {
217
214
  function O(t) {
218
215
  return typeof t == "function";
219
216
  }
220
- function me(t) {
217
+ function he(t) {
221
218
  var r = function(n) {
222
219
  Error.call(n), n.stack = new Error().stack;
223
220
  }, e = t(r);
224
221
  return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
225
222
  }
226
- var Y = me(function(t) {
223
+ var q = he(function(t) {
227
224
  return function(e) {
228
225
  t(this), this.message = e ? e.length + ` errors occurred during unsubscription:
229
226
  ` + e.map(function(n, i) {
@@ -232,13 +229,13 @@ var Y = me(function(t) {
232
229
  `) : "", this.name = "UnsubscriptionError", this.errors = e;
233
230
  };
234
231
  });
235
- function oe(t, r) {
232
+ function ne(t, r) {
236
233
  if (t) {
237
234
  var e = t.indexOf(r);
238
235
  0 <= e && t.splice(e, 1);
239
236
  }
240
237
  }
241
- var re = (function() {
238
+ var ee = (function() {
242
239
  function t(r) {
243
240
  this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
244
241
  }
@@ -250,7 +247,7 @@ var re = (function() {
250
247
  if (s)
251
248
  if (this._parentage = null, Array.isArray(s))
252
249
  try {
253
- for (var u = M(s), a = u.next(); !a.done; a = u.next()) {
250
+ for (var u = N(s), a = u.next(); !a.done; a = u.next()) {
254
251
  var c = a.value;
255
252
  c.remove(this);
256
253
  }
@@ -265,43 +262,43 @@ var re = (function() {
265
262
  }
266
263
  else
267
264
  s.remove(this);
268
- var d = this.initialTeardown;
269
- if (O(d))
265
+ var h = this.initialTeardown;
266
+ if (O(h))
270
267
  try {
271
- d();
268
+ h();
272
269
  } catch (l) {
273
- o = l instanceof Y ? l.errors : [l];
270
+ o = l instanceof q ? l.errors : [l];
274
271
  }
275
- var y = this._finalizers;
276
- if (y) {
272
+ var d = this._finalizers;
273
+ if (d) {
277
274
  this._finalizers = null;
278
275
  try {
279
- for (var g = M(y), f = g.next(); !f.done; f = g.next()) {
276
+ for (var b = N(d), f = b.next(); !f.done; f = b.next()) {
280
277
  var m = f.value;
281
278
  try {
282
- se(m);
279
+ ie(m);
283
280
  } catch (l) {
284
- o = o ?? [], l instanceof Y ? o = ee(ee([], X(o)), X(l.errors)) : o.push(l);
281
+ o = o ?? [], l instanceof q ? o = K(K([], Z(o)), Z(l.errors)) : o.push(l);
285
282
  }
286
283
  }
287
284
  } catch (l) {
288
285
  n = { error: l };
289
286
  } finally {
290
287
  try {
291
- f && !f.done && (i = g.return) && i.call(g);
288
+ f && !f.done && (i = b.return) && i.call(b);
292
289
  } finally {
293
290
  if (n) throw n.error;
294
291
  }
295
292
  }
296
293
  }
297
294
  if (o)
298
- throw new Y(o);
295
+ throw new q(o);
299
296
  }
300
297
  }, t.prototype.add = function(r) {
301
298
  var e;
302
299
  if (r && r !== this)
303
300
  if (this.closed)
304
- se(r);
301
+ ie(r);
305
302
  else {
306
303
  if (r instanceof t) {
307
304
  if (r.closed || r._hasParent(this))
@@ -318,53 +315,53 @@ var re = (function() {
318
315
  this._parentage = Array.isArray(e) ? (e.push(r), e) : e ? [e, r] : r;
319
316
  }, t.prototype._removeParent = function(r) {
320
317
  var e = this._parentage;
321
- e === r ? this._parentage = null : Array.isArray(e) && oe(e, r);
318
+ e === r ? this._parentage = null : Array.isArray(e) && ne(e, r);
322
319
  }, t.prototype.remove = function(r) {
323
320
  var e = this._finalizers;
324
- e && oe(e, r), r instanceof t && r._removeParent(this);
321
+ e && ne(e, r), r instanceof t && r._removeParent(this);
325
322
  }, t.EMPTY = (function() {
326
323
  var r = new t();
327
324
  return r.closed = !0, r;
328
325
  })(), t;
329
326
  })();
330
- re.EMPTY;
331
- function ge(t) {
332
- return t instanceof re || t && "closed" in t && O(t.remove) && O(t.add) && O(t.unsubscribe);
327
+ ee.EMPTY;
328
+ function de(t) {
329
+ return t instanceof ee || t && "closed" in t && O(t.remove) && O(t.add) && O(t.unsubscribe);
333
330
  }
334
- function se(t) {
331
+ function ie(t) {
335
332
  O(t) ? t() : t.unsubscribe();
336
333
  }
337
- var Qe = {
334
+ var Ge = {
338
335
  Promise: void 0
339
- }, Je = {
336
+ }, We = {
340
337
  setTimeout: function(t, r) {
341
338
  for (var e = [], n = 2; n < arguments.length; n++)
342
339
  e[n - 2] = arguments[n];
343
- return setTimeout.apply(void 0, ee([t, r], X(e)));
340
+ return setTimeout.apply(void 0, K([t, r], Z(e)));
344
341
  },
345
342
  clearTimeout: function(t) {
346
343
  return clearTimeout(t);
347
344
  },
348
345
  delegate: void 0
349
346
  };
350
- function ye(t) {
351
- Je.setTimeout(function() {
347
+ function me(t) {
348
+ We.setTimeout(function() {
352
349
  throw t;
353
350
  });
354
351
  }
355
- function ce() {
352
+ function oe() {
356
353
  }
357
- function Ze(t) {
354
+ function qe(t) {
358
355
  t();
359
356
  }
360
- var ne = (function(t) {
361
- te(r, t);
357
+ var te = (function(t) {
358
+ X(r, t);
362
359
  function r(e) {
363
360
  var n = t.call(this) || this;
364
- return n.isStopped = !1, e ? (n.destination = e, ge(e) && e.add(n)) : n.destination = et, n;
361
+ return n.isStopped = !1, e ? (n.destination = e, de(e) && e.add(n)) : n.destination = Je, n;
365
362
  }
366
363
  return r.create = function(e, n, i) {
367
- return new G(e, n, i);
364
+ return new $(e, n, i);
368
365
  }, r.prototype.next = function(e) {
369
366
  this.isStopped || this._next(e);
370
367
  }, r.prototype.error = function(e) {
@@ -388,7 +385,7 @@ var ne = (function(t) {
388
385
  this.unsubscribe();
389
386
  }
390
387
  }, r;
391
- })(re), Ke = (function() {
388
+ })(ee), Ye = (function() {
392
389
  function t(r) {
393
390
  this.partialObserver = r;
394
391
  }
@@ -398,7 +395,7 @@ var ne = (function(t) {
398
395
  try {
399
396
  e.next(r);
400
397
  } catch (n) {
401
- $(n);
398
+ M(n);
402
399
  }
403
400
  }, t.prototype.error = function(r) {
404
401
  var e = this.partialObserver;
@@ -406,56 +403,56 @@ var ne = (function(t) {
406
403
  try {
407
404
  e.error(r);
408
405
  } catch (n) {
409
- $(n);
406
+ M(n);
410
407
  }
411
408
  else
412
- $(r);
409
+ M(r);
413
410
  }, t.prototype.complete = function() {
414
411
  var r = this.partialObserver;
415
412
  if (r.complete)
416
413
  try {
417
414
  r.complete();
418
415
  } catch (e) {
419
- $(e);
416
+ M(e);
420
417
  }
421
418
  }, t;
422
- })(), G = (function(t) {
423
- te(r, t);
419
+ })(), $ = (function(t) {
420
+ X(r, t);
424
421
  function r(e, n, i) {
425
422
  var o = t.call(this) || this, s;
426
423
  return O(e) || !e ? s = {
427
424
  next: e ?? void 0,
428
425
  error: n ?? void 0,
429
426
  complete: i ?? void 0
430
- } : s = e, o.destination = new Ke(s), o;
427
+ } : s = e, o.destination = new Ye(s), o;
431
428
  }
432
429
  return r;
433
- })(ne);
434
- function $(t) {
435
- ye(t);
430
+ })(te);
431
+ function M(t) {
432
+ me(t);
436
433
  }
437
- function Xe(t) {
434
+ function Qe(t) {
438
435
  throw t;
439
436
  }
440
- var et = {
437
+ var Je = {
441
438
  closed: !0,
442
- next: ce,
443
- error: Xe,
444
- complete: ce
445
- }, ie = (function() {
439
+ next: oe,
440
+ error: Qe,
441
+ complete: oe
442
+ }, re = (function() {
446
443
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
447
444
  })();
448
- function be(t) {
445
+ function ge(t) {
449
446
  return t;
450
447
  }
451
- function tt(t) {
452
- return t.length === 0 ? be : t.length === 1 ? t[0] : function(e) {
448
+ function Ze(t) {
449
+ return t.length === 0 ? ge : t.length === 1 ? t[0] : function(e) {
453
450
  return t.reduce(function(n, i) {
454
451
  return i(n);
455
452
  }, e);
456
453
  };
457
454
  }
458
- var P = (function() {
455
+ var _ = (function() {
459
456
  function t(r) {
460
457
  r && (this._subscribe = r);
461
458
  }
@@ -463,8 +460,8 @@ var P = (function() {
463
460
  var e = new t();
464
461
  return e.source = this, e.operator = r, e;
465
462
  }, t.prototype.subscribe = function(r, e, n) {
466
- var i = this, o = nt(r) ? r : new G(r, e, n);
467
- return Ze(function() {
463
+ var i = this, o = Xe(r) ? r : new $(r, e, n);
464
+ return qe(function() {
468
465
  var s = i, u = s.operator, a = s.source;
469
466
  o.add(u ? u.call(o, a) : a ? i._subscribe(o) : i._trySubscribe(o));
470
467
  }), o;
@@ -476,8 +473,8 @@ var P = (function() {
476
473
  }
477
474
  }, t.prototype.forEach = function(r, e) {
478
475
  var n = this;
479
- return e = ae(e), new e(function(i, o) {
480
- var s = new G({
476
+ return e = se(e), new e(function(i, o) {
477
+ var s = new $({
481
478
  next: function(u) {
482
479
  try {
483
480
  r(u);
@@ -493,15 +490,15 @@ var P = (function() {
493
490
  }, t.prototype._subscribe = function(r) {
494
491
  var e;
495
492
  return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(r);
496
- }, t.prototype[ie] = function() {
493
+ }, t.prototype[re] = function() {
497
494
  return this;
498
495
  }, t.prototype.pipe = function() {
499
496
  for (var r = [], e = 0; e < arguments.length; e++)
500
497
  r[e] = arguments[e];
501
- return tt(r)(this);
498
+ return Ze(r)(this);
502
499
  }, t.prototype.toPromise = function(r) {
503
500
  var e = this;
504
- return r = ae(r), new r(function(n, i) {
501
+ return r = se(r), new r(function(n, i) {
505
502
  var o;
506
503
  e.subscribe(function(s) {
507
504
  return o = s;
@@ -515,22 +512,22 @@ var P = (function() {
515
512
  return new t(r);
516
513
  }, t;
517
514
  })();
518
- function ae(t) {
515
+ function se(t) {
519
516
  var r;
520
- return (r = t ?? Qe.Promise) !== null && r !== void 0 ? r : Promise;
517
+ return (r = t ?? Ge.Promise) !== null && r !== void 0 ? r : Promise;
521
518
  }
522
- function rt(t) {
519
+ function Ke(t) {
523
520
  return t && O(t.next) && O(t.error) && O(t.complete);
524
521
  }
525
- function nt(t) {
526
- return t && t instanceof ne || rt(t) && ge(t);
522
+ function Xe(t) {
523
+ return t && t instanceof te || Ke(t) && de(t);
527
524
  }
528
- function it(t) {
529
- return O(t == null ? void 0 : t.lift);
525
+ function et(t) {
526
+ return O(t?.lift);
530
527
  }
531
- function N(t) {
528
+ function R(t) {
532
529
  return function(r) {
533
- if (it(r))
530
+ if (et(r))
534
531
  return r.lift(function(e) {
535
532
  try {
536
533
  return t(e, this);
@@ -541,24 +538,24 @@ function N(t) {
541
538
  throw new TypeError("Unable to lift unknown Observable type");
542
539
  };
543
540
  }
544
- function H(t, r, e, n, i) {
545
- return new ot(t, r, e, n, i);
541
+ function L(t, r, e, n, i) {
542
+ return new tt(t, r, e, n, i);
546
543
  }
547
- var ot = (function(t) {
548
- te(r, t);
544
+ var tt = (function(t) {
545
+ X(r, t);
549
546
  function r(e, n, i, o, s, u) {
550
547
  var a = t.call(this, e) || this;
551
548
  return a.onFinalize = s, a.shouldUnsubscribe = u, a._next = n ? function(c) {
552
549
  try {
553
550
  n(c);
554
- } catch (d) {
555
- e.error(d);
551
+ } catch (h) {
552
+ e.error(h);
556
553
  }
557
554
  } : t.prototype._next, a._error = o ? function(c) {
558
555
  try {
559
556
  o(c);
560
- } catch (d) {
561
- e.error(d);
557
+ } catch (h) {
558
+ e.error(h);
562
559
  } finally {
563
560
  this.unsubscribe();
564
561
  }
@@ -579,60 +576,60 @@ var ot = (function(t) {
579
576
  t.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
580
577
  }
581
578
  }, r;
582
- })(ne), st = new P(function(t) {
579
+ })(te), rt = new _(function(t) {
583
580
  return t.complete();
584
581
  });
585
- function ct(t) {
582
+ function nt(t) {
586
583
  return t && O(t.schedule);
587
584
  }
588
- function pe(t) {
585
+ function ye(t) {
589
586
  return t[t.length - 1];
590
587
  }
591
- function at(t) {
592
- return ct(pe(t)) ? t.pop() : void 0;
588
+ function it(t) {
589
+ return nt(ye(t)) ? t.pop() : void 0;
593
590
  }
594
- function ut(t, r) {
595
- return typeof pe(t) == "number" ? t.pop() : r;
591
+ function ot(t, r) {
592
+ return typeof ye(t) == "number" ? t.pop() : r;
596
593
  }
597
- var we = (function(t) {
594
+ var be = (function(t) {
598
595
  return t && typeof t.length == "number" && typeof t != "function";
599
596
  });
600
- function ve(t) {
601
- return O(t == null ? void 0 : t.then);
597
+ function pe(t) {
598
+ return O(t?.then);
602
599
  }
603
- function Se(t) {
604
- return O(t[ie]);
600
+ function we(t) {
601
+ return O(t[re]);
605
602
  }
606
- function xe(t) {
607
- return Symbol.asyncIterator && O(t == null ? void 0 : t[Symbol.asyncIterator]);
603
+ function ve(t) {
604
+ return Symbol.asyncIterator && O(t?.[Symbol.asyncIterator]);
608
605
  }
609
- function Ie(t) {
606
+ function Se(t) {
610
607
  return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
611
608
  }
612
- function ft() {
609
+ function st() {
613
610
  return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
614
611
  }
615
- var Be = ft();
616
- function Ue(t) {
617
- return O(t == null ? void 0 : t[Be]);
612
+ var xe = st();
613
+ function Ie(t) {
614
+ return O(t?.[xe]);
618
615
  }
619
- function Oe(t) {
620
- return qe(this, arguments, function() {
616
+ function Be(t) {
617
+ return $e(this, arguments, function() {
621
618
  var e, n, i, o;
622
- return de(this, function(s) {
619
+ return le(this, function(s) {
623
620
  switch (s.label) {
624
621
  case 0:
625
622
  e = t.getReader(), s.label = 1;
626
623
  case 1:
627
624
  s.trys.push([1, , 9, 10]), s.label = 2;
628
625
  case 2:
629
- return [4, R(e.read())];
626
+ return [4, z(e.read())];
630
627
  case 3:
631
- return n = s.sent(), i = n.value, o = n.done, o ? [4, R(void 0)] : [3, 5];
628
+ return n = s.sent(), i = n.value, o = n.done, o ? [4, z(void 0)] : [3, 5];
632
629
  case 4:
633
630
  return [2, s.sent()];
634
631
  case 5:
635
- return [4, R(i)];
632
+ return [4, z(i)];
636
633
  case 6:
637
634
  return [4, s.sent()];
638
635
  case 7:
@@ -647,57 +644,57 @@ function Oe(t) {
647
644
  });
648
645
  });
649
646
  }
650
- function ke(t) {
651
- return O(t == null ? void 0 : t.getReader);
647
+ function Ue(t) {
648
+ return O(t?.getReader);
652
649
  }
653
- function L(t) {
654
- if (t instanceof P)
650
+ function D(t) {
651
+ if (t instanceof _)
655
652
  return t;
656
653
  if (t != null) {
657
- if (Se(t))
658
- return lt(t);
659
654
  if (we(t))
660
- return ht(t);
655
+ return ct(t);
656
+ if (be(t))
657
+ return at(t);
658
+ if (pe(t))
659
+ return ut(t);
661
660
  if (ve(t))
662
- return dt(t);
663
- if (xe(t))
664
- return Ee(t);
661
+ return Oe(t);
662
+ if (Ie(t))
663
+ return ft(t);
665
664
  if (Ue(t))
666
- return mt(t);
667
- if (ke(t))
668
- return gt(t);
665
+ return lt(t);
669
666
  }
670
- throw Ie(t);
667
+ throw Se(t);
671
668
  }
672
- function lt(t) {
673
- return new P(function(r) {
674
- var e = t[ie]();
669
+ function ct(t) {
670
+ return new _(function(r) {
671
+ var e = t[re]();
675
672
  if (O(e.subscribe))
676
673
  return e.subscribe(r);
677
674
  throw new TypeError("Provided object does not correctly implement Symbol.observable");
678
675
  });
679
676
  }
680
- function ht(t) {
681
- return new P(function(r) {
677
+ function at(t) {
678
+ return new _(function(r) {
682
679
  for (var e = 0; e < t.length && !r.closed; e++)
683
680
  r.next(t[e]);
684
681
  r.complete();
685
682
  });
686
683
  }
687
- function dt(t) {
688
- return new P(function(r) {
684
+ function ut(t) {
685
+ return new _(function(r) {
689
686
  t.then(function(e) {
690
687
  r.closed || (r.next(e), r.complete());
691
688
  }, function(e) {
692
689
  return r.error(e);
693
- }).then(null, ye);
690
+ }).then(null, me);
694
691
  });
695
692
  }
696
- function mt(t) {
697
- return new P(function(r) {
693
+ function ft(t) {
694
+ return new _(function(r) {
698
695
  var e, n;
699
696
  try {
700
- for (var i = M(t), o = i.next(); !o.done; o = i.next()) {
697
+ for (var i = N(t), o = i.next(); !o.done; o = i.next()) {
701
698
  var s = o.value;
702
699
  if (r.next(s), r.closed)
703
700
  return;
@@ -714,24 +711,24 @@ function mt(t) {
714
711
  r.complete();
715
712
  });
716
713
  }
717
- function Ee(t) {
718
- return new P(function(r) {
719
- yt(t, r).catch(function(e) {
714
+ function Oe(t) {
715
+ return new _(function(r) {
716
+ ht(t, r).catch(function(e) {
720
717
  return r.error(e);
721
718
  });
722
719
  });
723
720
  }
724
- function gt(t) {
725
- return Ee(Oe(t));
721
+ function lt(t) {
722
+ return Oe(Be(t));
726
723
  }
727
- function yt(t, r) {
724
+ function ht(t, r) {
728
725
  var e, n, i, o;
729
- return We(this, void 0, void 0, function() {
726
+ return He(this, void 0, void 0, function() {
730
727
  var s, u;
731
- return de(this, function(a) {
728
+ return le(this, function(a) {
732
729
  switch (a.label) {
733
730
  case 0:
734
- a.trys.push([0, 5, 6, 11]), e = Ye(t), a.label = 1;
731
+ a.trys.push([0, 5, 6, 11]), e = je(t), a.label = 1;
735
732
  case 1:
736
733
  return [4, e.next()];
737
734
  case 2:
@@ -762,7 +759,7 @@ function yt(t, r) {
762
759
  });
763
760
  });
764
761
  }
765
- function z(t, r, e, n, i) {
762
+ function V(t, r, e, n, i) {
766
763
  n === void 0 && (n = 0), i === void 0 && (i = !1);
767
764
  var o = r.schedule(function() {
768
765
  e(), i ? t.add(this.schedule(null, n)) : this.unsubscribe();
@@ -770,49 +767,49 @@ function z(t, r, e, n, i) {
770
767
  if (t.add(o), !i)
771
768
  return o;
772
769
  }
773
- function Te(t, r) {
774
- return r === void 0 && (r = 0), N(function(e, n) {
775
- e.subscribe(H(n, function(i) {
776
- return z(n, t, function() {
770
+ function ke(t, r) {
771
+ return r === void 0 && (r = 0), R(function(e, n) {
772
+ e.subscribe(L(n, function(i) {
773
+ return V(n, t, function() {
777
774
  return n.next(i);
778
775
  }, r);
779
776
  }, function() {
780
- return z(n, t, function() {
777
+ return V(n, t, function() {
781
778
  return n.complete();
782
779
  }, r);
783
780
  }, function(i) {
784
- return z(n, t, function() {
781
+ return V(n, t, function() {
785
782
  return n.error(i);
786
783
  }, r);
787
784
  }));
788
785
  });
789
786
  }
790
- function _e(t, r) {
791
- return r === void 0 && (r = 0), N(function(e, n) {
787
+ function Ee(t, r) {
788
+ return r === void 0 && (r = 0), R(function(e, n) {
792
789
  n.add(t.schedule(function() {
793
790
  return e.subscribe(n);
794
791
  }, r));
795
792
  });
796
793
  }
797
- function bt(t, r) {
798
- return L(t).pipe(_e(r), Te(r));
794
+ function dt(t, r) {
795
+ return D(t).pipe(Ee(r), ke(r));
799
796
  }
800
- function pt(t, r) {
801
- return L(t).pipe(_e(r), Te(r));
797
+ function mt(t, r) {
798
+ return D(t).pipe(Ee(r), ke(r));
802
799
  }
803
- function wt(t, r) {
804
- return new P(function(e) {
800
+ function gt(t, r) {
801
+ return new _(function(e) {
805
802
  var n = 0;
806
803
  return r.schedule(function() {
807
804
  n === t.length ? e.complete() : (e.next(t[n++]), e.closed || this.schedule());
808
805
  });
809
806
  });
810
807
  }
811
- function vt(t, r) {
812
- return new P(function(e) {
808
+ function yt(t, r) {
809
+ return new _(function(e) {
813
810
  var n;
814
- return z(e, r, function() {
815
- n = t[Be](), z(e, r, function() {
811
+ return V(e, r, function() {
812
+ n = t[xe](), V(e, r, function() {
816
813
  var i, o, s;
817
814
  try {
818
815
  i = n.next(), o = i.value, s = i.done;
@@ -823,17 +820,17 @@ function vt(t, r) {
823
820
  s ? e.complete() : e.next(o);
824
821
  }, 0, !0);
825
822
  }), function() {
826
- return O(n == null ? void 0 : n.return) && n.return();
823
+ return O(n?.return) && n.return();
827
824
  };
828
825
  });
829
826
  }
830
- function Ce(t, r) {
827
+ function Te(t, r) {
831
828
  if (!t)
832
829
  throw new Error("Iterable cannot be null");
833
- return new P(function(e) {
834
- z(e, r, function() {
830
+ return new _(function(e) {
831
+ V(e, r, function() {
835
832
  var n = t[Symbol.asyncIterator]();
836
- z(e, r, function() {
833
+ V(e, r, function() {
837
834
  n.next().then(function(i) {
838
835
  i.done ? e.complete() : e.next(i.value);
839
836
  });
@@ -841,135 +838,135 @@ function Ce(t, r) {
841
838
  });
842
839
  });
843
840
  }
844
- function St(t, r) {
845
- return Ce(Oe(t), r);
841
+ function bt(t, r) {
842
+ return Te(Be(t), r);
846
843
  }
847
- function xt(t, r) {
844
+ function pt(t, r) {
848
845
  if (t != null) {
849
- if (Se(t))
850
- return bt(t, r);
851
846
  if (we(t))
852
- return wt(t, r);
847
+ return dt(t, r);
848
+ if (be(t))
849
+ return gt(t, r);
850
+ if (pe(t))
851
+ return mt(t, r);
853
852
  if (ve(t))
854
- return pt(t, r);
855
- if (xe(t))
856
- return Ce(t, r);
853
+ return Te(t, r);
854
+ if (Ie(t))
855
+ return yt(t, r);
857
856
  if (Ue(t))
858
- return vt(t, r);
859
- if (ke(t))
860
- return St(t, r);
857
+ return bt(t, r);
861
858
  }
862
- throw Ie(t);
859
+ throw Se(t);
863
860
  }
864
- function It(t, r) {
865
- return r ? xt(t, r) : L(t);
861
+ function wt(t, r) {
862
+ return r ? pt(t, r) : D(t);
866
863
  }
867
- var Bt = me(function(t) {
864
+ var vt = he(function(t) {
868
865
  return function() {
869
866
  t(this), this.name = "EmptyError", this.message = "no elements in sequence";
870
867
  };
871
868
  });
872
- function Pe(t, r) {
869
+ function _e(t, r) {
873
870
  return new Promise(function(e, n) {
874
- var i = new G({
871
+ var i = new $({
875
872
  next: function(o) {
876
873
  e(o), i.unsubscribe();
877
874
  },
878
875
  error: n,
879
876
  complete: function() {
880
- n(new Bt());
877
+ n(new vt());
881
878
  }
882
879
  });
883
880
  t.subscribe(i);
884
881
  });
885
882
  }
886
- function Ve(t, r) {
887
- return N(function(e, n) {
883
+ function Ce(t, r) {
884
+ return R(function(e, n) {
888
885
  var i = 0;
889
- e.subscribe(H(n, function(o) {
886
+ e.subscribe(L(n, function(o) {
890
887
  n.next(t.call(r, o, i++));
891
888
  }));
892
889
  });
893
890
  }
894
- function Ut(t, r, e, n, i, o, s, u) {
895
- var a = [], c = 0, d = 0, y = !1, g = function() {
896
- y && !a.length && !c && r.complete();
891
+ function St(t, r, e, n, i, o, s, u) {
892
+ var a = [], c = 0, h = 0, d = !1, b = function() {
893
+ d && !a.length && !c && r.complete();
897
894
  }, f = function(l) {
898
895
  return c < n ? m(l) : a.push(l);
899
896
  }, m = function(l) {
900
897
  c++;
901
- var v = !1;
902
- L(e(l, d++)).subscribe(H(r, function(b) {
903
- r.next(b);
898
+ var B = !1;
899
+ D(e(l, h++)).subscribe(L(r, function(w) {
900
+ r.next(w);
904
901
  }, function() {
905
- v = !0;
902
+ B = !0;
906
903
  }, void 0, function() {
907
- if (v)
904
+ if (B)
908
905
  try {
909
906
  c--;
910
- for (var b = function() {
907
+ for (var w = function() {
911
908
  var S = a.shift();
912
909
  s || m(S);
913
910
  }; a.length && c < n; )
914
- b();
915
- g();
911
+ w();
912
+ b();
916
913
  } catch (S) {
917
914
  r.error(S);
918
915
  }
919
916
  }));
920
917
  };
921
- return t.subscribe(H(r, f, function() {
922
- y = !0, g();
918
+ return t.subscribe(L(r, f, function() {
919
+ d = !0, b();
923
920
  })), function() {
924
921
  };
925
922
  }
926
- function Ae(t, r, e) {
927
- return e === void 0 && (e = 1 / 0), O(r) ? Ae(function(n, i) {
928
- return Ve(function(o, s) {
923
+ function Pe(t, r, e) {
924
+ return e === void 0 && (e = 1 / 0), O(r) ? Pe(function(n, i) {
925
+ return Ce(function(o, s) {
929
926
  return r(n, o, i, s);
930
- })(L(t(n, i)));
931
- }, e) : (typeof r == "number" && (e = r), N(function(n, i) {
932
- return Ut(n, i, t, e);
927
+ })(D(t(n, i)));
928
+ }, e) : (typeof r == "number" && (e = r), R(function(n, i) {
929
+ return St(n, i, t, e);
933
930
  }));
934
931
  }
935
- function Ot(t) {
936
- return t === void 0 && (t = 1 / 0), Ae(be, t);
932
+ function xt(t) {
933
+ return t === void 0 && (t = 1 / 0), Pe(ge, t);
937
934
  }
938
- function kt() {
935
+ function It() {
939
936
  for (var t = [], r = 0; r < arguments.length; r++)
940
937
  t[r] = arguments[r];
941
- var e = at(t), n = ut(t, 1 / 0), i = t;
942
- return i.length ? i.length === 1 ? L(i[0]) : Ot(n)(It(i, e)) : st;
938
+ var e = it(t), n = ot(t, 1 / 0), i = t;
939
+ return i.length ? i.length === 1 ? D(i[0]) : xt(n)(wt(i, e)) : rt;
943
940
  }
944
- function Et(t, r, e, n, i) {
941
+ function Bt(t, r, e, n, i) {
945
942
  return function(o, s) {
946
943
  var u = e, a = r, c = 0;
947
- o.subscribe(H(s, function(d) {
948
- var y = c++;
949
- a = u ? t(a, d, y) : (u = !0, d);
944
+ o.subscribe(L(s, function(h) {
945
+ var d = c++;
946
+ a = u ? t(a, h, d) : (u = !0, h);
950
947
  }, (function() {
951
948
  u && s.next(a), s.complete();
952
949
  })));
953
950
  };
954
951
  }
955
- function ze(t, r) {
956
- return N(Et(t, r, arguments.length >= 2, !1, !0));
952
+ function Ve(t, r) {
953
+ return R(Bt(t, r, arguments.length >= 2, !1, !0));
957
954
  }
958
- var Tt = function(t, r) {
955
+ var Ut = function(t, r) {
959
956
  return t.push(r), t;
960
957
  };
961
- function _t() {
962
- return N(function(t, r) {
963
- ze(Tt, [])(t).subscribe(r);
958
+ function Ot() {
959
+ return R(function(t, r) {
960
+ Ve(Ut, [])(t).subscribe(r);
964
961
  });
965
962
  }
966
- function Ct(t) {
963
+ function kt(t) {
967
964
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
968
965
  }
969
- var Q, ue;
970
- function Pt() {
971
- if (ue) return Q;
972
- ue = 1;
966
+ var Y, ce;
967
+ function Et() {
968
+ if (ce) return Y;
969
+ ce = 1;
973
970
  class t {
974
971
  constructor(e = {}) {
975
972
  if (!(e.maxSize && e.maxSize > 0))
@@ -1029,13 +1026,13 @@ function Pt() {
1029
1026
  return this._size + e;
1030
1027
  }
1031
1028
  }
1032
- return Q = t, Q;
1029
+ return Y = t, Y;
1033
1030
  }
1034
- var Vt = Pt();
1035
- const Fe = /* @__PURE__ */ Ct(Vt);
1036
- class D {
1031
+ var Tt = Et();
1032
+ const Ae = /* @__PURE__ */ kt(Tt);
1033
+ class F {
1034
+ ranges;
1037
1035
  constructor(r) {
1038
- E(this, "ranges");
1039
1036
  this.ranges = r;
1040
1037
  }
1041
1038
  get min() {
@@ -1054,7 +1051,7 @@ class D {
1054
1051
  return this.ranges.length > 1;
1055
1052
  }
1056
1053
  getRanges() {
1057
- return this.ranges.map((r) => new D([{ min: r.min, max: r.max }]));
1054
+ return this.ranges.map((r) => new F([{ min: r.min, max: r.max }]));
1058
1055
  }
1059
1056
  toString() {
1060
1057
  return this.ranges.map((r) => `[${r.min}-${r.max}]`).join(",");
@@ -1063,21 +1060,20 @@ class D {
1063
1060
  const e = [...this.getRanges(), ...r.getRanges()].sort((o, s) => o.min < s.min ? -1 : o.min > s.min ? 1 : o.max < s.max ? -1 : s.max > o.max ? 1 : 0), n = [];
1064
1061
  let i = e[0];
1065
1062
  for (const o of e)
1066
- o.min > i.max + 1 ? (n.push(i), i = o) : o.max > i.max && (i = new D([{ min: i.min, max: o.max }]));
1067
- return n.push(i), n.length === 1 ? n[0] : new D(n);
1063
+ o.min > i.max + 1 ? (n.push(i), i = o) : o.max > i.max && (i = new F([{ min: i.min, max: o.max }]));
1064
+ return n.push(i), n.length === 1 ? n[0] : new F(n);
1068
1065
  }
1069
1066
  }
1070
- function At(t) {
1071
- return $e(t.subarray(2), void 0);
1067
+ function _t(t) {
1068
+ return Ne(t.subarray(2), void 0);
1072
1069
  }
1073
- class zt extends Error {
1074
- constructor(e) {
1075
- super(e);
1076
- E(this, "code");
1077
- this.code = "ERR_ABORTED";
1070
+ class Ct extends Error {
1071
+ code;
1072
+ constructor(r) {
1073
+ super(r), this.code = "ERR_ABORTED";
1078
1074
  }
1079
1075
  }
1080
- function Ft(t) {
1076
+ function Pt(t) {
1081
1077
  t.sort((i, o) => i.offset - o.offset);
1082
1078
  const r = [];
1083
1079
  let e, n;
@@ -1089,30 +1085,30 @@ function Ft(t) {
1089
1085
  }), n = e.offset + e.length;
1090
1086
  return r;
1091
1087
  }
1092
- function j(t) {
1088
+ function H(t) {
1093
1089
  if (t && t.aborted)
1094
1090
  if (typeof DOMException > "u") {
1095
- const r = new zt("aborted");
1091
+ const r = new Ct("aborted");
1096
1092
  throw r.code = "ERR_ABORTED", r;
1097
1093
  } else
1098
1094
  throw new DOMException("aborted", "AbortError");
1099
1095
  }
1100
- const J = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
1101
- function Z(t, r, e, n) {
1096
+ const Vt = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
1097
+ function Q(t, r, e, n) {
1102
1098
  return t < n && r >= e;
1103
1099
  }
1104
- class Re {
1100
+ class ze {
1101
+ bbi;
1102
+ refsByName;
1103
+ cirTreeOffset;
1104
+ isCompressed;
1105
+ blockType;
1106
+ cirTreePromise;
1107
+ featureCache = new ue({
1108
+ cache: new Ae({ maxSize: 1e3 }),
1109
+ fill: async ({ length: r, offset: e }, n) => this.bbi.read(r, e, { signal: n })
1110
+ });
1105
1111
  constructor(r, e, n, i, o) {
1106
- E(this, "bbi");
1107
- E(this, "refsByName");
1108
- E(this, "cirTreeOffset");
1109
- E(this, "isCompressed");
1110
- E(this, "blockType");
1111
- E(this, "cirTreePromise");
1112
- E(this, "featureCache", new le({
1113
- cache: new Fe({ maxSize: 1e3 }),
1114
- fill: async ({ length: r, offset: e }, n) => this.bbi.read(r, e, { signal: n })
1115
- }));
1116
1112
  if (this.bbi = r, this.refsByName = e, this.cirTreeOffset = n, this.isCompressed = i, this.blockType = o, !(n >= 0))
1117
1113
  throw new Error("invalid cirTreeOffset!");
1118
1114
  }
@@ -1122,111 +1118,111 @@ class Re {
1122
1118
  s === void 0 && i.complete();
1123
1119
  const u = { chrId: s, start: e, end: n };
1124
1120
  this.cirTreePromise || (this.cirTreePromise = this.bbi.read(48, this.cirTreeOffset, o));
1125
- const a = await this.cirTreePromise, d = new DataView(a.buffer).getUint32(4, !0);
1126
- let y = [], g = 0;
1127
- const f = (b, S, B) => {
1121
+ const a = await this.cirTreePromise, h = new DataView(a.buffer).getUint32(4, !0);
1122
+ let d = [], b = 0;
1123
+ const f = (w, S, x) => {
1128
1124
  try {
1129
- const p = b.subarray(S), w = new DataView(p.buffer, p.byteOffset, p.length);
1130
- let h = 0;
1131
- const U = w.getUint8(h);
1132
- h += 2;
1133
- const T = w.getUint16(h, !0);
1134
- if (h += 2, U === 1) {
1135
- const _ = [];
1125
+ const p = w.subarray(S), g = new DataView(p.buffer, p.byteOffset, p.length);
1126
+ let y = 0;
1127
+ const U = g.getUint8(y);
1128
+ y += 2;
1129
+ const T = g.getUint16(y, !0);
1130
+ if (y += 2, U === 1) {
1131
+ const k = [];
1136
1132
  for (let I = 0; I < T; I++) {
1137
- const k = w.getUint32(h, !0);
1138
- h += 4;
1139
- const C = w.getUint32(h, !0);
1140
- h += 4;
1141
- const V = w.getUint32(h, !0);
1142
- h += 4;
1143
- const A = w.getUint32(h, !0);
1144
- h += 4;
1145
- const W = Number(w.getBigUint64(h, !0));
1146
- h += 8;
1147
- const q = Number(w.getBigUint64(h, !0));
1148
- h += 8, _.push({
1149
- startChrom: k,
1133
+ const E = g.getUint32(y, !0);
1134
+ y += 4;
1135
+ const C = g.getUint32(y, !0);
1136
+ y += 4;
1137
+ const P = g.getUint32(y, !0);
1138
+ y += 4;
1139
+ const j = g.getUint32(y, !0);
1140
+ y += 4;
1141
+ const G = Number(g.getBigUint64(y, !0));
1142
+ y += 8;
1143
+ const W = Number(g.getBigUint64(y, !0));
1144
+ y += 8, k.push({
1145
+ startChrom: E,
1150
1146
  startBase: C,
1151
- endBase: A,
1152
- endChrom: V,
1153
- blockOffset: W,
1154
- blockSize: q,
1155
- offset: h
1147
+ endBase: j,
1148
+ endChrom: P,
1149
+ blockOffset: G,
1150
+ blockSize: W,
1151
+ offset: y
1156
1152
  });
1157
1153
  }
1158
- y = y.concat(_.filter((I) => m(I)).map((I) => ({
1154
+ d = d.concat(k.filter((I) => m(I)).map((I) => ({
1159
1155
  offset: I.blockOffset,
1160
1156
  length: I.blockSize
1161
1157
  })));
1162
1158
  } else if (U === 0) {
1163
- const _ = [];
1164
- for (let k = 0; k < T; k++) {
1165
- const C = w.getUint32(h, !0);
1166
- h += 4;
1167
- const V = w.getUint32(h, !0);
1168
- h += 4;
1169
- const A = w.getUint32(h, !0);
1170
- h += 4;
1171
- const W = w.getUint32(h, !0);
1172
- h += 4;
1173
- const q = Number(w.getBigUint64(h, !0));
1174
- h += 8, _.push({
1159
+ const k = [];
1160
+ for (let E = 0; E < T; E++) {
1161
+ const C = g.getUint32(y, !0);
1162
+ y += 4;
1163
+ const P = g.getUint32(y, !0);
1164
+ y += 4;
1165
+ const j = g.getUint32(y, !0);
1166
+ y += 4;
1167
+ const G = g.getUint32(y, !0);
1168
+ y += 4;
1169
+ const W = Number(g.getBigUint64(y, !0));
1170
+ y += 8, k.push({
1175
1171
  startChrom: C,
1176
- startBase: V,
1177
- endChrom: A,
1178
- endBase: W,
1179
- blockOffset: q,
1180
- offset: h
1172
+ startBase: P,
1173
+ endChrom: j,
1174
+ endBase: G,
1175
+ blockOffset: W,
1176
+ offset: y
1181
1177
  });
1182
1178
  }
1183
- const I = _.filter((k) => m(k)).map((k) => k.blockOffset);
1184
- I.length > 0 && v(I, B + 1);
1179
+ const I = k.filter((E) => m(E)).map((E) => E.blockOffset);
1180
+ I.length > 0 && B(I, x + 1);
1185
1181
  }
1186
- } catch (x) {
1187
- i.error(x);
1182
+ } catch (v) {
1183
+ i.error(v);
1188
1184
  }
1189
- }, m = (b) => {
1190
- const { startChrom: S, startBase: B, endChrom: x, endBase: p } = b;
1191
- return (S < s || S === s && B <= n) && (x > s || x === s && p >= e);
1192
- }, l = async (b, S, B) => {
1185
+ }, m = (w) => {
1186
+ const { startChrom: S, startBase: x, endChrom: v, endBase: p } = w;
1187
+ return (S < s || S === s && x <= n) && (v > s || v === s && p >= e);
1188
+ }, l = async (w, S, x) => {
1193
1189
  try {
1194
- const x = S.max - S.min, p = S.min, w = await this.featureCache.get(`${x}_${p}`, { length: x, offset: p }, o == null ? void 0 : o.signal);
1195
- for (const h of b)
1196
- S.contains(h) && (f(w, h - p, B), g -= 1, g === 0 && this.readFeatures(i, y, {
1190
+ const v = S.max - S.min, p = S.min, g = await this.featureCache.get(`${v}_${p}`, { length: v, offset: p }, o?.signal);
1191
+ for (const y of w)
1192
+ S.contains(y) && (f(g, y - p, x), b -= 1, b === 0 && this.readFeatures(i, d, {
1197
1193
  ...o,
1198
1194
  request: u
1199
1195
  }).catch((U) => {
1200
1196
  i.error(U);
1201
1197
  }));
1202
- } catch (x) {
1203
- i.error(x);
1198
+ } catch (v) {
1199
+ i.error(v);
1204
1200
  }
1205
- }, v = (b, S) => {
1201
+ }, B = (w, S) => {
1206
1202
  try {
1207
- g += b.length;
1208
- const B = 4 + d * 32;
1209
- let x = new D([
1203
+ b += w.length;
1204
+ const x = 4 + h * 32;
1205
+ let v = new F([
1210
1206
  {
1211
- min: b[0],
1212
- max: b[0] + B
1207
+ min: w[0],
1208
+ max: w[0] + x
1213
1209
  }
1214
1210
  ]);
1215
- for (let p = 1; p < b.length; p += 1) {
1216
- const w = new D([
1211
+ for (let p = 1; p < w.length; p += 1) {
1212
+ const g = new F([
1217
1213
  {
1218
- min: b[p],
1219
- max: b[p] + B
1214
+ min: w[p],
1215
+ max: w[p] + x
1220
1216
  }
1221
1217
  ]);
1222
- x = x.union(w);
1218
+ v = v.union(g);
1223
1219
  }
1224
- x.getRanges().map((p) => l(b, p, S));
1225
- } catch (B) {
1226
- i.error(B);
1220
+ v.getRanges().map((p) => l(w, p, S));
1221
+ } catch (x) {
1222
+ i.error(x);
1227
1223
  }
1228
1224
  };
1229
- v([this.cirTreeOffset + 48], 1);
1225
+ B([this.cirTreeOffset + 48], 1);
1230
1226
  return;
1231
1227
  } catch (s) {
1232
1228
  i.error(s);
@@ -1243,20 +1239,20 @@ class Re {
1243
1239
  o += 4;
1244
1240
  const c = s.getUint32(o, !0);
1245
1241
  o += 4;
1246
- const d = s.getUint32(o, !0);
1242
+ const h = s.getUint32(o, !0);
1247
1243
  o += 4;
1248
- const y = s.getFloat32(o, !0);
1244
+ const d = s.getFloat32(o, !0);
1249
1245
  o += 4;
1250
- const g = s.getFloat32(o, !0);
1246
+ const b = s.getFloat32(o, !0);
1251
1247
  o += 4;
1252
1248
  const f = s.getFloat32(o, !0);
1253
- o += 4, o += 4, (!n || u === n.chrId && Z(a, c, n.start, n.end)) && i.push({
1249
+ o += 4, o += 4, (!n || u === n.chrId && Q(a, c, n.start, n.end)) && i.push({
1254
1250
  start: a,
1255
1251
  end: c,
1256
- maxScore: g,
1257
- minScore: y,
1252
+ maxScore: b,
1253
+ minScore: d,
1258
1254
  summary: !0,
1259
- score: f / (d || 1)
1255
+ score: f / (h || 1)
1260
1256
  });
1261
1257
  }
1262
1258
  return i;
@@ -1266,25 +1262,25 @@ class Re {
1266
1262
  let s = e;
1267
1263
  const u = r, a = new DataView(u.buffer, u.byteOffset, u.length);
1268
1264
  for (; s < r.byteLength; ) {
1269
- const c = s, d = a.getUint32(s, !0);
1265
+ const c = s, h = a.getUint32(s, !0);
1270
1266
  s += 4;
1271
- const y = a.getInt32(s, !0);
1267
+ const d = a.getInt32(s, !0);
1272
1268
  s += 4;
1273
- const g = a.getInt32(s, !0);
1269
+ const b = a.getInt32(s, !0);
1274
1270
  s += 4;
1275
1271
  let f = s;
1276
1272
  for (; f < r.length && r[f] !== 0; f++)
1277
1273
  ;
1278
- const m = r.subarray(s, f), l = (J == null ? void 0 : J.decode(m)) ?? m.toString();
1274
+ const m = r.subarray(s, f), l = Vt?.decode(m) ?? m.toString();
1279
1275
  s = f + 1, o.push({
1280
- chromId: d,
1281
- start: y,
1282
- end: g,
1276
+ chromId: h,
1277
+ start: d,
1278
+ end: b,
1283
1279
  rest: l,
1284
1280
  uniqueId: `bb-${n + c}`
1285
1281
  });
1286
1282
  }
1287
- return i ? o.filter((c) => Z(c.start, c.end, i.start, i.end)) : o;
1283
+ return i ? o.filter((c) => Q(c.start, c.end, i.start, i.end)) : o;
1288
1284
  }
1289
1285
  parseBigWigBlock(r, e, n) {
1290
1286
  const i = r.subarray(e), o = new DataView(i.buffer, i.byteOffset, i.length);
@@ -1296,33 +1292,33 @@ class Re {
1296
1292
  s += 4;
1297
1293
  const c = o.getUint32(s, !0);
1298
1294
  s += 4;
1299
- const d = o.getUint8(s);
1295
+ const h = o.getUint8(s);
1300
1296
  s += 2;
1301
- const y = o.getUint16(s, !0);
1297
+ const d = o.getUint16(s, !0);
1302
1298
  s += 2;
1303
- const g = new Array(y);
1304
- switch (d) {
1299
+ const b = new Array(d);
1300
+ switch (h) {
1305
1301
  case 1: {
1306
- for (let f = 0; f < y; f++) {
1302
+ for (let f = 0; f < d; f++) {
1307
1303
  const m = o.getInt32(s, !0);
1308
1304
  s += 4;
1309
1305
  const l = o.getInt32(s, !0);
1310
1306
  s += 4;
1311
- const v = o.getFloat32(s, !0);
1312
- s += 4, g[f] = {
1307
+ const B = o.getFloat32(s, !0);
1308
+ s += 4, b[f] = {
1313
1309
  start: m,
1314
1310
  end: l,
1315
- score: v
1311
+ score: B
1316
1312
  };
1317
1313
  }
1318
1314
  break;
1319
1315
  }
1320
1316
  case 2: {
1321
- for (let f = 0; f < y; f++) {
1317
+ for (let f = 0; f < d; f++) {
1322
1318
  const m = o.getInt32(s, !0);
1323
1319
  s += 4;
1324
1320
  const l = o.getFloat32(s, !0);
1325
- s += 4, g[f] = {
1321
+ s += 4, b[f] = {
1326
1322
  score: l,
1327
1323
  start: m,
1328
1324
  end: m + c
@@ -1331,11 +1327,11 @@ class Re {
1331
1327
  break;
1332
1328
  }
1333
1329
  case 3: {
1334
- for (let f = 0; f < y; f++) {
1330
+ for (let f = 0; f < d; f++) {
1335
1331
  const m = o.getFloat32(s, !0);
1336
1332
  s += 4;
1337
1333
  const l = u + f * a;
1338
- g[f] = {
1334
+ b[f] = {
1339
1335
  score: m,
1340
1336
  start: l,
1341
1337
  end: l + c
@@ -1344,18 +1340,18 @@ class Re {
1344
1340
  break;
1345
1341
  }
1346
1342
  }
1347
- return n ? g.filter((f) => Z(f.start, f.end, n.start, n.end)) : g;
1343
+ return n ? b.filter((f) => Q(f.start, f.end, n.start, n.end)) : b;
1348
1344
  }
1349
1345
  async readFeatures(r, e, n = {}) {
1350
1346
  try {
1351
- const { blockType: i, isCompressed: o } = this, { signal: s, request: u } = n, a = Ft(e);
1352
- j(s), await Promise.all(a.map(async (c) => {
1353
- j(s);
1354
- const { length: d, offset: y } = c, g = await this.featureCache.get(`${d}_${y}`, c, s);
1347
+ const { blockType: i, isCompressed: o } = this, { signal: s, request: u } = n, a = Pt(e);
1348
+ H(s), await Promise.all(a.map(async (c) => {
1349
+ H(s);
1350
+ const { length: h, offset: d } = c, b = await this.featureCache.get(`${h}_${d}`, c, s);
1355
1351
  for (const f of c.blocks) {
1356
- j(s);
1357
- let m = g.subarray(f.offset - c.offset);
1358
- switch (o && (m = At(m)), j(s), i) {
1352
+ H(s);
1353
+ let m = b.subarray(f.offset - c.offset);
1354
+ switch (o && (m = _t(m)), H(s), i) {
1359
1355
  case "summary": {
1360
1356
  r.next(this.parseSummaryBlock(m, 0, u));
1361
1357
  break;
@@ -1378,11 +1374,19 @@ class Re {
1378
1374
  }
1379
1375
  }
1380
1376
  }
1381
- const Rt = -2003829722, fe = -2021002517;
1382
- function F(t) {
1377
+ const At = -2003829722, ae = -2021002517;
1378
+ function A(t) {
1383
1379
  return new DataView(t.buffer, t.byteOffset, t.length);
1384
1380
  }
1385
- class De {
1381
+ class Fe {
1382
+ bbi;
1383
+ headerP;
1384
+ renameRefSeqs;
1385
+ getHeader(r) {
1386
+ return this.headerP || (this.headerP = this._getHeader(r).catch((e) => {
1387
+ throw this.headerP = void 0, e;
1388
+ })), this.headerP;
1389
+ }
1386
1390
  /*
1387
1391
  * @param filehandle - a filehandle from generic-filehandle2
1388
1392
  *
@@ -1394,24 +1398,16 @@ class De {
1394
1398
  * sequences using a mapping function
1395
1399
  */
1396
1400
  constructor(r) {
1397
- E(this, "bbi");
1398
- E(this, "headerP");
1399
- E(this, "renameRefSeqs");
1400
1401
  const { filehandle: e, renameRefSeqs: n = (s) => s, path: i, url: o } = r;
1401
1402
  if (this.renameRefSeqs = n, e)
1402
1403
  this.bbi = e;
1403
1404
  else if (o)
1404
- this.bbi = new Me(o);
1405
+ this.bbi = new Re(o);
1405
1406
  else if (i)
1406
- this.bbi = new He(i);
1407
+ this.bbi = new De(i);
1407
1408
  else
1408
1409
  throw new Error("no file given");
1409
1410
  }
1410
- getHeader(r) {
1411
- return this.headerP || (this.headerP = this._getHeader(r).catch((e) => {
1412
- throw this.headerP = void 0, e;
1413
- })), this.headerP;
1414
- }
1415
1411
  async _getHeader(r) {
1416
1412
  const e = await this._getMainHeader(r), n = await this._readChromTree(e, r);
1417
1413
  return {
@@ -1420,8 +1416,8 @@ class De {
1420
1416
  };
1421
1417
  }
1422
1418
  async _getMainHeader(r, e = 2e3) {
1423
- const n = await this.bbi.read(e, 0, r), i = F(n), o = i.getInt32(0, !0);
1424
- if (o !== Rt && o !== fe)
1419
+ const n = await this.bbi.read(e, 0, r), i = A(n), o = i.getInt32(0, !0);
1420
+ if (o !== At && o !== ae)
1425
1421
  throw new Error("not a BigWig/BigBed file");
1426
1422
  let s = 0;
1427
1423
  const u = i.getInt32(s, !0);
@@ -1430,11 +1426,11 @@ class De {
1430
1426
  s += 2;
1431
1427
  const c = i.getUint16(s, !0);
1432
1428
  s += 2;
1433
- const d = Number(i.getBigUint64(s, !0));
1429
+ const h = Number(i.getBigUint64(s, !0));
1434
1430
  s += 8;
1435
- const y = Number(i.getBigUint64(s, !0));
1431
+ const d = Number(i.getBigUint64(s, !0));
1436
1432
  s += 8;
1437
- const g = Number(i.getBigUint64(s, !0));
1433
+ const b = Number(i.getBigUint64(s, !0));
1438
1434
  s += 8;
1439
1435
  const f = i.getUint16(s, !0);
1440
1436
  s += 2;
@@ -1442,114 +1438,114 @@ class De {
1442
1438
  s += 2;
1443
1439
  const l = Number(i.getBigUint64(s, !0));
1444
1440
  s += 8;
1445
- const v = Number(i.getBigUint64(s, !0));
1441
+ const B = Number(i.getBigUint64(s, !0));
1446
1442
  s += 8;
1447
- const b = i.getUint32(s, !0);
1443
+ const w = i.getUint32(s, !0);
1448
1444
  s += 4;
1449
1445
  const S = Number(i.getBigUint64(s, !0));
1450
1446
  s += 8;
1451
- const B = [];
1452
- for (let h = 0; h < c; h++) {
1447
+ const x = [];
1448
+ for (let y = 0; y < c; y++) {
1453
1449
  const U = i.getUint32(s, !0);
1454
1450
  s += 4;
1455
1451
  const T = i.getUint32(s, !0);
1456
1452
  s += 4;
1457
- const _ = Number(i.getBigUint64(s, !0));
1453
+ const k = Number(i.getBigUint64(s, !0));
1458
1454
  s += 8;
1459
1455
  const I = Number(i.getBigUint64(s, !0));
1460
- s += 8, B.push({
1456
+ s += 8, x.push({
1461
1457
  reductionLevel: U,
1462
1458
  reserved: T,
1463
- dataOffset: _,
1459
+ dataOffset: k,
1464
1460
  indexOffset: I
1465
1461
  });
1466
1462
  }
1467
- const x = u === fe ? "bigbed" : "bigwig";
1468
- if (l > e || v > e - 40)
1463
+ const v = u === ae ? "bigbed" : "bigwig";
1464
+ if (l > e || B > e - 40)
1469
1465
  return this._getMainHeader(r, e * 2);
1470
1466
  let p;
1471
- if (v) {
1472
- const h = n.subarray(v);
1467
+ if (B) {
1468
+ const y = n.subarray(B);
1473
1469
  let U = 0;
1474
- const T = F(h), _ = Number(T.getBigUint64(U, !0));
1470
+ const T = A(y), k = Number(T.getBigUint64(U, !0));
1475
1471
  U += 8;
1476
1472
  const I = T.getFloat64(U, !0);
1477
1473
  U += 8;
1478
- const k = T.getFloat64(U, !0);
1474
+ const E = T.getFloat64(U, !0);
1479
1475
  U += 8;
1480
1476
  const C = T.getFloat64(U, !0);
1481
1477
  U += 8;
1482
- const V = T.getFloat64(U, !0);
1478
+ const P = T.getFloat64(U, !0);
1483
1479
  U += 8, p = {
1484
1480
  scoreMin: I,
1485
- scoreMax: k,
1481
+ scoreMax: E,
1486
1482
  scoreSum: C,
1487
- scoreSumSquares: V,
1488
- basesCovered: _
1483
+ scoreSumSquares: P,
1484
+ basesCovered: k
1489
1485
  };
1490
1486
  } else
1491
1487
  throw new Error("no stats");
1492
- const w = new TextDecoder("utf8");
1488
+ const g = new TextDecoder("utf8");
1493
1489
  return {
1494
- zoomLevels: B,
1490
+ zoomLevels: x,
1495
1491
  magic: u,
1496
1492
  extHeaderOffset: S,
1497
1493
  numZoomLevels: c,
1498
1494
  fieldCount: f,
1499
1495
  totalSummary: p,
1500
1496
  definedFieldCount: m,
1501
- uncompressBufSize: b,
1497
+ uncompressBufSize: w,
1502
1498
  asOffset: l,
1503
- chromTreeOffset: d,
1504
- totalSummaryOffset: v,
1505
- unzoomedDataOffset: y,
1506
- unzoomedIndexOffset: g,
1507
- fileType: x,
1499
+ chromTreeOffset: h,
1500
+ totalSummaryOffset: B,
1501
+ unzoomedDataOffset: d,
1502
+ unzoomedIndexOffset: b,
1503
+ fileType: v,
1508
1504
  version: a,
1509
- autoSql: l ? w.decode(n.subarray(l, n.indexOf(0, l))) : ""
1505
+ autoSql: l ? g.decode(n.subarray(l, n.indexOf(0, l))) : ""
1510
1506
  };
1511
1507
  }
1512
1508
  async _readChromTree(r, e) {
1513
- const n = [], i = {}, o = r.chromTreeOffset, s = F(await this.bbi.read(32, o, e));
1509
+ const n = [], i = {}, o = r.chromTreeOffset, s = A(await this.bbi.read(32, o, e));
1514
1510
  let u = 0;
1515
1511
  u += 4, u += 4;
1516
1512
  const a = s.getUint32(u, !0);
1517
1513
  u += 4;
1518
1514
  const c = s.getUint32(u, !0);
1519
1515
  u += 4, u += 8;
1520
- const d = new TextDecoder("utf8"), y = async (g) => {
1521
- const f = await this.bbi.read(4, g), m = F(f);
1516
+ const h = new TextDecoder("utf8"), d = async (b) => {
1517
+ const f = await this.bbi.read(4, b), m = A(f);
1522
1518
  let l = 0;
1523
- const v = m.getUint8(l);
1519
+ const B = m.getUint8(l);
1524
1520
  l += 1, l += 1;
1525
- const b = m.getUint16(l, !0);
1526
- if (l += 2, v) {
1527
- const S = await this.bbi.read(b * (a + c), g + l), B = F(S);
1521
+ const w = m.getUint16(l, !0);
1522
+ if (l += 2, B) {
1523
+ const S = await this.bbi.read(w * (a + c), b + l), x = A(S);
1528
1524
  l = 0;
1529
- for (let x = 0; x < b; x++) {
1530
- const p = d.decode(S.subarray(l, l + a)).replaceAll("\0", "");
1525
+ for (let v = 0; v < w; v++) {
1526
+ const p = h.decode(S.subarray(l, l + a)).replaceAll("\0", "");
1531
1527
  l += a;
1532
- const w = B.getUint32(l, !0);
1528
+ const g = x.getUint32(l, !0);
1533
1529
  l += 4;
1534
- const h = B.getUint32(l, !0);
1535
- l += 4, i[this.renameRefSeqs(p)] = w, n[w] = {
1530
+ const y = x.getUint32(l, !0);
1531
+ l += 4, i[this.renameRefSeqs(p)] = g, n[g] = {
1536
1532
  name: p,
1537
- id: w,
1538
- length: h
1533
+ id: g,
1534
+ length: y
1539
1535
  };
1540
1536
  }
1541
1537
  } else {
1542
- const S = [], B = F(await this.bbi.read(b * (a + 8), g + l));
1538
+ const S = [], x = A(await this.bbi.read(w * (a + 8), b + l));
1543
1539
  l = 0;
1544
- for (let x = 0; x < b; x++) {
1540
+ for (let v = 0; v < w; v++) {
1545
1541
  l += a;
1546
- const p = Number(B.getBigUint64(l, !0));
1547
- l += 8, S.push(y(p));
1542
+ const p = Number(x.getBigUint64(l, !0));
1543
+ l += 8, S.push(d(p));
1548
1544
  }
1549
1545
  await Promise.all(S);
1550
1546
  }
1551
1547
  };
1552
- return await y(o + 32), {
1548
+ return await d(o + 32), {
1553
1549
  refsByName: i,
1554
1550
  refsByNumber: n
1555
1551
  };
@@ -1560,7 +1556,7 @@ class De {
1560
1556
  */
1561
1557
  async getUnzoomedView(r) {
1562
1558
  const { unzoomedIndexOffset: e, refsByName: n, uncompressBufSize: i, fileType: o } = await this.getHeader(r);
1563
- return new Re(this.bbi, n, e, i > 0, o);
1559
+ return new ze(this.bbi, n, e, i > 0, o);
1564
1560
  }
1565
1561
  /**
1566
1562
  * Gets features from a BigWig file
@@ -1579,18 +1575,18 @@ class De {
1579
1575
  const o = this.renameRefSeqs(r);
1580
1576
  let s;
1581
1577
  const { basesPerSpan: u, scale: a } = i || {};
1582
- return u ? s = await this.getView(1 / u, i) : a ? s = await this.getView(a, i) : s = await this.getView(1, i), new P((c) => {
1583
- s.readWigData(o, e, n, c, i).catch((d) => {
1584
- c.error(d);
1578
+ return u ? s = await this.getView(1 / u, i) : a ? s = await this.getView(a, i) : s = await this.getView(1, i), new _((c) => {
1579
+ s.readWigData(o, e, n, c, i).catch((h) => {
1580
+ c.error(h);
1585
1581
  });
1586
1582
  });
1587
1583
  }
1588
1584
  async getFeatures(r, e, n, i) {
1589
1585
  const o = await this.getFeatureStream(r, e, n, i);
1590
- return (await Pe(o.pipe(_t()))).flat();
1586
+ return (await _e(o.pipe(Ot()))).flat();
1591
1587
  }
1592
1588
  }
1593
- class $t extends De {
1589
+ class Nt extends Fe {
1594
1590
  /**
1595
1591
  * Retrieves a BlockView of a specific zoomLevel
1596
1592
  *
@@ -1604,31 +1600,28 @@ class $t extends De {
1604
1600
  for (let a = u; a >= 0; a -= 1) {
1605
1601
  const c = n[a];
1606
1602
  if (c && c.reductionLevel <= 2 * s)
1607
- return new Re(this.bbi, i, c.indexOffset, o > 0, "summary");
1603
+ return new ze(this.bbi, i, c.indexOffset, o > 0, "summary");
1608
1604
  }
1609
1605
  return this.getUnzoomedView(e);
1610
1606
  }
1611
1607
  }
1612
- function Dt(t) {
1608
+ function zt(t) {
1613
1609
  return t.filter((r) => !!r);
1614
1610
  }
1615
- class jt extends De {
1616
- constructor() {
1617
- super(...arguments);
1618
- E(this, "readIndicesCache", new le({
1619
- cache: new Fe({ maxSize: 1 }),
1620
- fill: (e, n) => this._readIndices({ ...e, signal: n })
1621
- }));
1622
- }
1623
- readIndices(e = {}) {
1624
- const { signal: n, ...i } = e;
1625
- return this.readIndicesCache.get(JSON.stringify(i), e, n);
1611
+ class Lt extends Fe {
1612
+ readIndicesCache = new ue({
1613
+ cache: new Ae({ maxSize: 1 }),
1614
+ fill: (r, e) => this._readIndices({ ...r, signal: e })
1615
+ });
1616
+ readIndices(r = {}) {
1617
+ const { signal: e, ...n } = r;
1618
+ return this.readIndicesCache.get(JSON.stringify(n), r, e);
1626
1619
  }
1627
1620
  /*
1628
1621
  * retrieve unzoomed view for any scale
1629
1622
  */
1630
- async getView(e, n) {
1631
- return this.getUnzoomedView(n);
1623
+ async getView(r, e) {
1624
+ return this.getUnzoomedView(e);
1632
1625
  }
1633
1626
  /*
1634
1627
  * parse the bigbed extraIndex fields
@@ -1637,34 +1630,34 @@ class jt extends De {
1637
1630
  * @return a Promise for an array of Index data structure since there can be
1638
1631
  * multiple extraIndexes in a bigbed, see bedToBigBed documentation
1639
1632
  */
1640
- async _readIndices(e) {
1641
- const { extHeaderOffset: n } = await this.getHeader(e), i = await this.bbi.read(64, n), o = new DataView(i.buffer, i.byteOffset, i.length);
1642
- let s = 0;
1643
- s += 2;
1644
- const u = o.getUint16(s, !0);
1645
- s += 2;
1646
- const a = Number(o.getBigUint64(s, !0));
1647
- if (s += 8, u === 0)
1633
+ async _readIndices(r) {
1634
+ const { extHeaderOffset: e } = await this.getHeader(r), n = await this.bbi.read(64, e), i = new DataView(n.buffer, n.byteOffset, n.length);
1635
+ let o = 0;
1636
+ o += 2;
1637
+ const s = i.getUint16(o, !0);
1638
+ o += 2;
1639
+ const u = Number(i.getBigUint64(o, !0));
1640
+ if (o += 8, s === 0)
1648
1641
  return [];
1649
- const c = 20, d = c * u, y = await this.bbi.read(d, a), g = [];
1650
- for (let f = 0; f < u; f += 1) {
1651
- const m = y.subarray(f * c), l = new DataView(m.buffer, m.byteOffset, m.length);
1652
- let v = 0;
1653
- const b = l.getInt16(v, !0);
1654
- v += 2;
1655
- const S = l.getInt16(v, !0);
1656
- v += 2;
1657
- const B = Number(l.getBigUint64(v, !0));
1658
- v += 12;
1659
- const x = l.getInt16(v, !0);
1660
- g.push({
1661
- type: b,
1662
- fieldcount: S,
1663
- offset: B,
1642
+ const a = 20, c = a * s, h = await this.bbi.read(c, u), d = [];
1643
+ for (let b = 0; b < s; b += 1) {
1644
+ const f = h.subarray(b * a), m = new DataView(f.buffer, f.byteOffset, f.length);
1645
+ let l = 0;
1646
+ const B = m.getInt16(l, !0);
1647
+ l += 2;
1648
+ const w = m.getInt16(l, !0);
1649
+ l += 2;
1650
+ const S = Number(m.getBigUint64(l, !0));
1651
+ l += 12;
1652
+ const x = m.getInt16(l, !0);
1653
+ d.push({
1654
+ type: B,
1655
+ fieldcount: w,
1656
+ offset: S,
1664
1657
  field: x
1665
1658
  });
1666
1659
  }
1667
- return g;
1660
+ return d;
1668
1661
  }
1669
1662
  /*
1670
1663
  * perform a search in the bigbed extraIndex to find which blocks in the
@@ -1676,74 +1669,74 @@ class jt extends De {
1676
1669
  *
1677
1670
  * @return a Promise for an array of bigbed block Loc entries
1678
1671
  */
1679
- async searchExtraIndexBlocks(e, n = {}) {
1680
- const i = await this.readIndices(n);
1681
- if (i.length === 0)
1672
+ async searchExtraIndexBlocks(r, e = {}) {
1673
+ const n = await this.readIndices(e);
1674
+ if (n.length === 0)
1682
1675
  return [];
1683
- const o = new TextDecoder("utf8"), s = i.map(async (u) => {
1684
- const { offset: a, field: c } = u, d = await this.bbi.read(32, a, n), y = new DataView(d.buffer, d.byteOffset, d.length);
1685
- let g = 0;
1686
- g += 4;
1687
- const f = y.getInt32(g, !0);
1688
- g += 4;
1689
- const m = y.getInt32(g, !0);
1690
- g += 4;
1691
- const l = y.getInt32(g, !0);
1692
- g += 4, g += 8;
1693
- const v = async (b) => {
1694
- const S = b, B = 4 + f * (m + l), p = await this.bbi.read(B, S, n), w = new DataView(p.buffer, p.byteOffset, p.length);
1695
- let h = 0;
1696
- const U = w.getInt8(h);
1697
- h += 2;
1698
- const T = w.getInt16(h, !0);
1699
- h += 2;
1700
- const _ = [];
1701
- if (U === 0) {
1702
- const I = [];
1703
- for (let C = 0; C < T; C++) {
1704
- const V = o.decode(p.subarray(h, h + m)).replaceAll("\0", "");
1705
- h += m;
1706
- const A = Number(w.getBigUint64(h, !0));
1707
- h += 8, I.push({
1708
- key: V,
1709
- offset: A
1676
+ const i = new TextDecoder("utf8"), o = n.map(async (s) => {
1677
+ const { offset: u, field: a } = s, c = await this.bbi.read(32, u, e), h = new DataView(c.buffer, c.byteOffset, c.length);
1678
+ let d = 0;
1679
+ d += 4;
1680
+ const b = h.getInt32(d, !0);
1681
+ d += 4;
1682
+ const f = h.getInt32(d, !0);
1683
+ d += 4;
1684
+ const m = h.getInt32(d, !0);
1685
+ d += 4, d += 8;
1686
+ const l = async (B) => {
1687
+ const w = B, S = 4 + b * (f + m), v = await this.bbi.read(S, w, e), p = new DataView(v.buffer, v.byteOffset, v.length);
1688
+ let g = 0;
1689
+ const y = p.getInt8(g);
1690
+ g += 2;
1691
+ const U = p.getInt16(g, !0);
1692
+ g += 2;
1693
+ const T = [];
1694
+ if (y === 0) {
1695
+ const k = [];
1696
+ for (let E = 0; E < U; E++) {
1697
+ const C = i.decode(v.subarray(g, g + f)).replaceAll("\0", "");
1698
+ g += f;
1699
+ const P = Number(p.getBigUint64(g, !0));
1700
+ g += 8, k.push({
1701
+ key: C,
1702
+ offset: P
1710
1703
  });
1711
1704
  }
1712
- let k = 0;
1713
- for (const { key: C, offset: V } of I) {
1714
- if (e.localeCompare(C) < 0 && k)
1715
- return v(k);
1716
- k = V;
1705
+ let I = 0;
1706
+ for (const { key: E, offset: C } of k) {
1707
+ if (r.localeCompare(E) < 0 && I)
1708
+ return l(I);
1709
+ I = C;
1717
1710
  }
1718
- return v(k);
1719
- } else if (U === 1) {
1720
- for (let I = 0; I < T; I++) {
1721
- const k = o.decode(p.subarray(h, h + m)).replaceAll("\0", "");
1722
- h += m;
1723
- const C = Number(w.getBigUint64(h, !0));
1724
- h += 8;
1725
- const V = w.getUint32(h, !0);
1726
- h += 4;
1727
- const A = w.getUint32(h, !0);
1728
- h += 4, _.push({
1729
- key: k,
1730
- offset: C,
1731
- length: V,
1732
- reserved: A
1711
+ return l(I);
1712
+ } else if (y === 1) {
1713
+ for (let k = 0; k < U; k++) {
1714
+ const I = i.decode(v.subarray(g, g + f)).replaceAll("\0", "");
1715
+ g += f;
1716
+ const E = Number(p.getBigUint64(g, !0));
1717
+ g += 8;
1718
+ const C = p.getUint32(g, !0);
1719
+ g += 4;
1720
+ const P = p.getUint32(g, !0);
1721
+ g += 4, T.push({
1722
+ key: I,
1723
+ offset: E,
1724
+ length: C,
1725
+ reserved: P
1733
1726
  });
1734
1727
  }
1735
- for (const I of _)
1736
- if (I.key === e)
1728
+ for (const k of T)
1729
+ if (k.key === r)
1737
1730
  return {
1738
- ...I,
1739
- field: c
1731
+ ...k,
1732
+ field: a
1740
1733
  };
1741
1734
  return;
1742
1735
  }
1743
1736
  };
1744
- return v(a + 32);
1737
+ return l(u + 32);
1745
1738
  });
1746
- return Dt(await Promise.all(s));
1739
+ return zt(await Promise.all(o));
1747
1740
  }
1748
1741
  /*
1749
1742
  * retrieve the features from the bigbed data that were found through the
@@ -1756,26 +1749,23 @@ class jt extends De {
1756
1749
  *
1757
1750
  * @return array of Feature
1758
1751
  */
1759
- async searchExtraIndex(e, n = {}) {
1760
- const i = await this.searchExtraIndexBlocks(e, n);
1761
- if (i.length === 0)
1752
+ async searchExtraIndex(r, e = {}) {
1753
+ const n = await this.searchExtraIndexBlocks(r, e);
1754
+ if (n.length === 0)
1762
1755
  return [];
1763
- const o = await this.getUnzoomedView(n), s = i.map((a) => new P((c) => {
1764
- o.readFeatures(c, [a], n).catch((d) => {
1765
- c.error(d);
1756
+ const i = await this.getUnzoomedView(e), o = n.map((u) => new _((a) => {
1757
+ i.readFeatures(a, [u], e).catch((c) => {
1758
+ a.error(c);
1766
1759
  });
1767
- }).pipe(ze((c, d) => c.concat(d)), Ve((c) => {
1768
- for (const d of c)
1769
- d.field = a.field;
1770
- return c;
1760
+ }).pipe(Ve((a, c) => a.concat(c)), Ce((a) => {
1761
+ for (const c of a)
1762
+ c.field = u.field;
1763
+ return a;
1771
1764
  })));
1772
- return (await Pe(kt(...s))).filter((a) => {
1773
- var c;
1774
- return ((c = a.rest) == null ? void 0 : c.split(" ")[(a.field || 0) - 3]) === e;
1775
- });
1765
+ return (await _e(It(...o))).filter((u) => u.rest?.split(" ")[(u.field || 0) - 3] === r);
1776
1766
  }
1777
1767
  }
1778
1768
  export {
1779
- jt as BigBed,
1780
- $t as BigWig
1769
+ Lt as BigBed,
1770
+ Nt as BigWig
1781
1771
  };