@genome-spy/app 0.75.0 → 0.77.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 (71) hide show
  1. package/dist/AbortablePromiseCache-beUIcZcW.js +96 -0
  2. package/dist/agentApi-ClsLtELB.js +26994 -0
  3. package/dist/agentApi.es.js +11145 -0
  4. package/dist/agentShared.es.js +4742 -0
  5. package/dist/{blosc-oa0DlI6G.js → blosc-BX4BJ8sR.js} +1 -1
  6. package/dist/blosc-DL1kZHdE.js +692 -0
  7. package/dist/chunk-INHXZS53-Dx2aFznx.js +13 -0
  8. package/dist/componentStyles-CIXoKEp0.js +2182 -0
  9. package/dist/dialog.es.js +377 -0
  10. package/dist/esm-CHVYSGF2.js +1084 -0
  11. package/dist/esm-CZvS2Ldm.js +155 -0
  12. package/dist/esm-C_XrKaCY.js +137 -0
  13. package/dist/{esm-DCCYNvaz.js → esm-CqrZuhTF.js} +50 -50
  14. package/dist/{esm-D-WfYOx7.js → esm-Cz4iCfzF.js} +25 -25
  15. package/dist/esm-D-y0Ce1M.js +573 -0
  16. package/dist/esm-D2-C5ZzN.js +1084 -0
  17. package/dist/esm-DPS6pYKF.js +1248 -0
  18. package/dist/esm-Dfo2M18m.js +461 -0
  19. package/dist/esm-DjF6pKy5.js +369 -0
  20. package/dist/{esm-n0auOe11.js → esm-Q6nrd9vJ.js} +1 -1
  21. package/dist/esm-aOLxLL7A.js +121 -0
  22. package/dist/esm-id9DWBZW.js +137 -0
  23. package/dist/esm-kXhrPIYy.js +1426 -0
  24. package/dist/esm-s_SlArJ8.js +298 -0
  25. package/dist/index.es.js +15272 -37563
  26. package/dist/index.js +1202 -741
  27. package/dist/lit-ymUSmGBw.js +510 -0
  28. package/dist/{lz4-jZ0zyLBa.js → lz4-BSYl80V8.js} +1 -1
  29. package/dist/lz4-Csz5aoFA.js +626 -0
  30. package/dist/parquetRead-m8-8_SpH.js +1609 -0
  31. package/dist/schema.json +489 -85
  32. package/dist/style.css +1 -1
  33. package/dist/viewUtils-3_xHIxmy.js +14292 -0
  34. package/dist/{zstd-C6ksIG9r.js → zstd-BAfRM3IH.js} +1 -1
  35. package/dist/zstd-dJuUp1fl.js +583 -0
  36. package/package.json +30 -5
  37. package/src/agentApi/index.d.ts +147 -0
  38. package/src/agentShared/index.d.ts +97 -0
  39. package/src/agentShared/types.d.ts +8 -0
  40. package/src/appTypes.d.ts +75 -0
  41. package/src/bookmark/databaseSchema.d.ts +33 -0
  42. package/src/charts/boxplotTypes.d.ts +15 -0
  43. package/src/charts/sampleAttributePlotTypes.d.ts +149 -0
  44. package/src/coreSpecAugmentation.d.ts +29 -0
  45. package/src/dialog/index.d.ts +5 -0
  46. package/src/embedTypes.d.ts +9 -0
  47. package/src/index.d.ts +16 -0
  48. package/src/sampleView/sampleViewTypes.d.ts +176 -0
  49. package/src/sampleView/state/payloadTypes.d.ts +484 -0
  50. package/src/sampleView/state/sampleState.d.ts +76 -0
  51. package/src/sampleView/types.d.ts +128 -0
  52. package/src/spec/appSpec.d.ts +54 -0
  53. package/src/spec/sampleView.d.ts +545 -0
  54. package/src/spec/view.d.ts +124 -0
  55. package/src/state/paramProvenanceTypes.d.ts +215 -0
  56. package/src/state/selectionExpansionTypes.d.ts +77 -0
  57. package/src/state.d.ts +97 -0
  58. package/src/types/lz-string.d.ts +24 -0
  59. package/src/types/vega-loader.d.ts +1 -0
  60. package/src/utils/colorScaleSummary.d.ts +15 -0
  61. package/src/utils/statistics/fieldSummary.d.ts +49 -0
  62. package/src/vite-env.d.ts +6 -0
  63. package/dist/browser-Dvlo92rx.js +0 -126
  64. package/dist/esm-Cmo4qEPr.js +0 -1015
  65. /package/dist/{AbortablePromiseCache-3gHJdF3E.js → AbortablePromiseCache-BDH1cqFl.js} +0 -0
  66. /package/dist/{chunk-INHXZS53-fPMmEwMt.js → chunk-INHXZS53-DwEV9sMh.js} +0 -0
  67. /package/dist/{esm-BygJiwh0.js → esm-BL9SNSnj.js} +0 -0
  68. /package/dist/{esm-B8-vSu-c.js → esm-BwW--bVV.js} +0 -0
  69. /package/dist/{esm-CGX-qz1d.js → esm-Bz_92nH0.js} +0 -0
  70. /package/dist/{esm-CuMSzCHy.js → esm-D2_c7lXY.js} +0 -0
  71. /package/dist/{parquetRead-CJe1UPsz.js → parquetRead-C33mgLEo.js} +0 -0
@@ -0,0 +1,155 @@
1
+ //#region ../../node_modules/@jbrowse/quick-lru/esm/index.js
2
+ var e = function(e, t, n, r, i) {
3
+ if (r === "m") throw TypeError("Private method is not writable");
4
+ if (r === "a" && !i) throw TypeError("Private accessor was defined without a setter");
5
+ if (typeof t == "function" ? e !== t || !i : !t.has(e)) throw TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return r === "a" ? i.call(e, n) : i ? i.value = n : t.set(e, n), n;
7
+ }, t = function(e, t, n, r) {
8
+ if (n === "a" && !r) throw TypeError("Private accessor was defined without a getter");
9
+ if (typeof t == "function" ? e !== t || !r : !t.has(e)) throw TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
11
+ }, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _ = class extends Map {
12
+ constructor(t = {}) {
13
+ if (super(), n.add(this), r.set(this, 0), i.set(this, /* @__PURE__ */ new Map()), a.set(this, /* @__PURE__ */ new Map()), o.set(this, void 0), s.set(this, void 0), c.set(this, void 0), !(t.maxSize && t.maxSize > 0)) throw TypeError("`maxSize` must be a number greater than 0");
14
+ if (typeof t.maxAge == "number" && t.maxAge === 0) throw TypeError("`maxAge` must be a number greater than 0");
15
+ e(this, o, t.maxSize, "f"), e(this, s, t.maxAge || Infinity, "f"), e(this, c, t.onEviction, "f");
16
+ }
17
+ get __oldCache() {
18
+ return t(this, a, "f");
19
+ }
20
+ get(e) {
21
+ if (t(this, i, "f").has(e)) {
22
+ let r = t(this, i, "f").get(e);
23
+ return t(this, n, "m", f).call(this, e, r);
24
+ }
25
+ if (t(this, a, "f").has(e)) {
26
+ let r = t(this, a, "f").get(e);
27
+ if (!t(this, n, "m", u).call(this, e, r)) return t(this, n, "m", h).call(this, e, r), r.value;
28
+ }
29
+ }
30
+ set(e, r, { maxAge: a = t(this, s, "f") } = {}) {
31
+ let o = typeof a == "number" && a !== Infinity ? Date.now() + a : void 0;
32
+ return t(this, i, "f").has(e) ? t(this, i, "f").set(e, {
33
+ value: r,
34
+ expiry: o
35
+ }) : t(this, n, "m", m).call(this, e, {
36
+ value: r,
37
+ expiry: o
38
+ }), this;
39
+ }
40
+ has(e) {
41
+ return t(this, i, "f").has(e) ? !t(this, n, "m", u).call(this, e, t(this, i, "f").get(e)) : t(this, a, "f").has(e) ? !t(this, n, "m", u).call(this, e, t(this, a, "f").get(e)) : !1;
42
+ }
43
+ peek(e) {
44
+ if (t(this, i, "f").has(e)) return t(this, n, "m", p).call(this, e, t(this, i, "f"));
45
+ if (t(this, a, "f").has(e)) return t(this, n, "m", p).call(this, e, t(this, a, "f"));
46
+ }
47
+ expiresIn(e) {
48
+ let n = t(this, i, "f").get(e) ?? t(this, a, "f").get(e);
49
+ if (n) return n.expiry ? n.expiry - Date.now() : Infinity;
50
+ }
51
+ delete(n) {
52
+ var o;
53
+ let s = t(this, i, "f").delete(n);
54
+ return s && e(this, r, (o = t(this, r, "f"), o--, o), "f"), t(this, a, "f").delete(n) || s;
55
+ }
56
+ clear() {
57
+ t(this, i, "f").clear(), t(this, a, "f").clear(), e(this, r, 0, "f");
58
+ }
59
+ resize(s) {
60
+ if (!(s && s > 0)) throw TypeError("`maxSize` must be a number greater than 0");
61
+ let c = [...t(this, n, "m", g).call(this)], u = c.length - s;
62
+ u < 0 ? (e(this, i, new Map(c), "f"), e(this, a, /* @__PURE__ */ new Map(), "f"), e(this, r, c.length, "f")) : (u > 0 && t(this, n, "m", l).call(this, c.slice(0, u)), e(this, a, new Map(c.slice(u)), "f"), e(this, i, /* @__PURE__ */ new Map(), "f"), e(this, r, 0, "f")), e(this, o, s, "f");
63
+ }
64
+ evict(o = 1) {
65
+ let s = o;
66
+ if (!s || s <= 0) return;
67
+ let c = [...t(this, n, "m", g).call(this)], u = Math.trunc(Math.min(s, Math.max(c.length - 1, 0)));
68
+ u <= 0 || (t(this, n, "m", l).call(this, c.slice(0, u)), e(this, a, new Map(c.slice(u)), "f"), e(this, i, /* @__PURE__ */ new Map(), "f"), e(this, r, 0, "f"));
69
+ }
70
+ *keys() {
71
+ for (let [e] of this) yield e;
72
+ }
73
+ *values() {
74
+ for (let [, e] of this) yield e;
75
+ }
76
+ *[(r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakSet(), l = function(e) {
77
+ if (typeof t(this, c, "f") == "function") for (let [n, r] of e) t(this, c, "f").call(this, n, r.value);
78
+ }, u = function(e, n) {
79
+ return typeof n.expiry == "number" && n.expiry <= Date.now() ? (typeof t(this, c, "f") == "function" && t(this, c, "f").call(this, e, n.value), this.delete(e)) : !1;
80
+ }, d = function(e, r) {
81
+ if (!t(this, n, "m", u).call(this, e, r)) return r.value;
82
+ }, f = function(e, r) {
83
+ return r.expiry ? t(this, n, "m", d).call(this, e, r) : r.value;
84
+ }, p = function(e, r) {
85
+ let i = r.get(e);
86
+ return t(this, n, "m", f).call(this, e, i);
87
+ }, m = function(s, c) {
88
+ var u;
89
+ t(this, i, "f").set(s, c), e(this, r, (u = t(this, r, "f"), u++, u), "f"), t(this, r, "f") >= t(this, o, "f") && (e(this, r, 0, "f"), t(this, n, "m", l).call(this, t(this, a, "f")), e(this, a, t(this, i, "f"), "f"), e(this, i, /* @__PURE__ */ new Map(), "f"));
90
+ }, h = function(e, r) {
91
+ t(this, a, "f").delete(e), t(this, n, "m", m).call(this, e, r);
92
+ }, g = function* () {
93
+ for (let e of t(this, a, "f")) {
94
+ let [r, a] = e;
95
+ t(this, i, "f").has(r) || t(this, n, "m", u).call(this, r, a) || (yield e);
96
+ }
97
+ for (let e of t(this, i, "f")) {
98
+ let [r, i] = e;
99
+ t(this, n, "m", u).call(this, r, i) || (yield e);
100
+ }
101
+ }, Symbol.iterator)]() {
102
+ for (let e of t(this, i, "f")) {
103
+ let [r, i] = e;
104
+ t(this, n, "m", u).call(this, r, i) || (yield [r, i.value]);
105
+ }
106
+ for (let e of t(this, a, "f")) {
107
+ let [r, a] = e;
108
+ t(this, i, "f").has(r) || t(this, n, "m", u).call(this, r, a) || (yield [r, a.value]);
109
+ }
110
+ }
111
+ *entriesDescending() {
112
+ let e = [...t(this, i, "f")];
113
+ for (let r = e.length - 1; r >= 0; --r) {
114
+ let [i, a] = e[r];
115
+ t(this, n, "m", u).call(this, i, a) || (yield [i, a.value]);
116
+ }
117
+ e = [...t(this, a, "f")];
118
+ for (let r = e.length - 1; r >= 0; --r) {
119
+ let [a, o] = e[r];
120
+ t(this, i, "f").has(a) || t(this, n, "m", u).call(this, a, o) || (yield [a, o.value]);
121
+ }
122
+ }
123
+ *entriesAscending() {
124
+ for (let [e, r] of t(this, n, "m", g).call(this)) yield [e, r.value];
125
+ }
126
+ get size() {
127
+ if (!t(this, r, "f")) return t(this, a, "f").size;
128
+ let e = 0;
129
+ for (let n of t(this, a, "f").keys()) t(this, i, "f").has(n) || e++;
130
+ return Math.min(t(this, r, "f") + e, t(this, o, "f"));
131
+ }
132
+ get maxSize() {
133
+ return t(this, o, "f");
134
+ }
135
+ get maxAge() {
136
+ return t(this, s, "f");
137
+ }
138
+ entries() {
139
+ return this.entriesAscending();
140
+ }
141
+ forEach(e, t = this) {
142
+ for (let [n, r] of this.entriesAscending()) e.call(t, r, n, this);
143
+ }
144
+ get [Symbol.toStringTag]() {
145
+ return "QuickLRU";
146
+ }
147
+ toString() {
148
+ return `QuickLRU(${this.size}/${this.maxSize})`;
149
+ }
150
+ [Symbol.for("nodejs.util.inspect.custom")]() {
151
+ return this.toString();
152
+ }
153
+ };
154
+ //#endregion
155
+ export { _ as t };
@@ -0,0 +1,137 @@
1
+ import { n as e, t } from "./chunk-CPXzm0be.js";
2
+ //#region ../../node_modules/generic-filehandle2/esm/util.js
3
+ async function n(e) {
4
+ return e.bytes ? e.bytes() : new Uint8Array(await e.arrayBuffer());
5
+ }
6
+ //#endregion
7
+ //#region ../../node_modules/generic-filehandle2/esm/blobFile.js
8
+ var r = class {
9
+ blob;
10
+ constructor(e) {
11
+ this.blob = e;
12
+ }
13
+ async read(e, t = 0) {
14
+ return e === 0 ? new Uint8Array() : n(this.blob.slice(t, t + e));
15
+ }
16
+ async readFile(e) {
17
+ let t = typeof e == "string" ? e : e?.encoding;
18
+ if (t === "utf8") return this.blob.text();
19
+ if (t) throw Error(`unsupported encoding: ${t}`);
20
+ return n(this.blob);
21
+ }
22
+ stat() {
23
+ return Promise.resolve({ size: this.blob.size });
24
+ }
25
+ close() {
26
+ return Promise.resolve();
27
+ }
28
+ };
29
+ //#endregion
30
+ //#region ../../node_modules/generic-filehandle2/esm/remoteFile.js
31
+ function i(e) {
32
+ return (typeof e == "object" && e && "message" in e && typeof e.message == "string" ? e.message : `${e}`).replace(/\.$/, "");
33
+ }
34
+ var a = class {
35
+ url;
36
+ _stat;
37
+ fetchImplementation;
38
+ baseHeaders;
39
+ baseOverrides;
40
+ constructor(e, t = {}) {
41
+ this.url = e, this.baseHeaders = t.headers ?? {}, this.baseOverrides = t.overrides ?? {}, this.fetchImplementation = t.fetch ?? globalThis.fetch.bind(globalThis);
42
+ }
43
+ buildRequest(e, t) {
44
+ return {
45
+ ...this.baseOverrides,
46
+ ...e.overrides,
47
+ headers: {
48
+ ...this.baseHeaders,
49
+ ...e.headers,
50
+ ...t
51
+ },
52
+ method: "GET",
53
+ redirect: "follow",
54
+ mode: "cors",
55
+ signal: e.signal
56
+ };
57
+ }
58
+ async fetch(e, t) {
59
+ let n = (t) => Error(`${i(t)} fetching ${e}`, { cause: t }), r;
60
+ try {
61
+ r = await this.fetchImplementation(e, t);
62
+ } catch (i) {
63
+ if (`${i}`.includes("Failed to fetch")) {
64
+ console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);
65
+ try {
66
+ r = await this.fetchImplementation(e, {
67
+ ...t,
68
+ cache: "reload"
69
+ });
70
+ } catch (e) {
71
+ throw n(e);
72
+ }
73
+ } else throw n(i);
74
+ }
75
+ return r;
76
+ }
77
+ async read(e, t, r = {}) {
78
+ if (e === 0) return new Uint8Array();
79
+ if (Number.isNaN(e) || Number.isNaN(t)) throw TypeError(`read() called with NaN length or position (length=${e}, position=${t}). The index file may be corrupt.`);
80
+ let i = await this.fetch(this.url, this.buildRequest(r, { range: `bytes=${t}-${t + e - 1}` }));
81
+ if (i.status === 416) return new Uint8Array();
82
+ if (!i.ok) throw Error(`HTTP ${i.status} fetching ${this.url}`);
83
+ if (i.status === 200 && t === 0 || i.status === 206) {
84
+ let t = i.headers.get("content-range"), r = /\/(\d+)$/.exec(t ?? "");
85
+ r?.[1] && (this._stat = { size: parseInt(r[1], 10) });
86
+ let a = await n(i);
87
+ return !this._stat && i.status === 200 && (this._stat = { size: a.byteLength }), a.byteLength <= e ? a : a.subarray(0, e);
88
+ }
89
+ throw Error(i.status === 200 ? `${this.url} fetch returned status 200, expected 206` : `HTTP ${i.status} fetching ${this.url}`);
90
+ }
91
+ async readFile(e = {}) {
92
+ let t = typeof e == "string" ? e : e.encoding, r = typeof e == "string" ? {} : e, i = await this.fetch(this.url, this.buildRequest(r));
93
+ if (!i.ok) throw Error(`HTTP ${i.status} fetching ${this.url}`);
94
+ if (t === "utf8") return i.text();
95
+ if (t) throw Error(`unsupported encoding: ${t}`);
96
+ return n(i);
97
+ }
98
+ async stat() {
99
+ return this._stat || await this.read(10, 0), this._stat ?? { size: 0 };
100
+ }
101
+ close() {
102
+ return Promise.resolve();
103
+ }
104
+ }, o = (/* @__PURE__ */ t(((e, t) => {
105
+ t.exports = {};
106
+ })))(), s = class {
107
+ filename;
108
+ constructor(e) {
109
+ this.filename = e;
110
+ }
111
+ async read(e, t = 0) {
112
+ if (e === 0) return new Uint8Array();
113
+ let n = new Uint8Array(e), r;
114
+ try {
115
+ r = await (0, o.open)(this.filename, "r");
116
+ let i = await r.read(n, 0, e, t);
117
+ return i.buffer.subarray(0, i.bytesRead);
118
+ } finally {
119
+ if (r) try {
120
+ await r.close();
121
+ } catch {}
122
+ }
123
+ }
124
+ async readFile(e) {
125
+ return (0, o.readFile)(this.filename, e);
126
+ }
127
+ async stat() {
128
+ return (0, o.stat)(this.filename);
129
+ }
130
+ async close() {}
131
+ }, c = /* @__PURE__ */ e({
132
+ BlobFile: () => r,
133
+ LocalFile: () => s,
134
+ RemoteFile: () => a
135
+ });
136
+ //#endregion
137
+ export { s as n, a as r, c as t };
@@ -1,6 +1,6 @@
1
- import { t as e } from "./esm-CGX-qz1d.js";
2
- import { n as t, r as n } from "./esm-BDFRLEuD.js";
3
- import { r, t as i } from "./browser-Dvlo92rx.js";
1
+ import { n as e, r as t } from "./esm-BDFRLEuD.js";
2
+ import { t as n } from "./esm-CZvS2Ldm.js";
3
+ import { n as r, r as i } from "./esm-id9DWBZW.js";
4
4
  //#region ../../node_modules/@gmod/bam/esm/chunk.js
5
5
  var a = class {
6
6
  constructor(e, t, n, r) {
@@ -145,8 +145,8 @@ var T = class extends v {
145
145
  async lineCount(e, t) {
146
146
  return (await this.parse(t)).indices(e)?.stats?.lineCount || 0;
147
147
  }
148
- async _parse(t) {
149
- let n = await this.filehandle.readFile(), r = new DataView(n.buffer);
148
+ async _parse(e) {
149
+ let t = await this.filehandle.readFile(), r = new DataView(t.buffer);
150
150
  if (r.getUint32(0, !0) !== x) throw Error("Not a BAI file");
151
151
  let i = r.getInt32(4, !0), o = ((1 << 18) - 1) / 7, s = 8, c, l = [];
152
152
  for (let e = 0; e < i; e++) {
@@ -163,44 +163,44 @@ var T = class extends v {
163
163
  for (let t = 0; t < e; t++) s += 8, s += 8;
164
164
  }
165
165
  }
166
- let t = r.getInt32(s, !0);
166
+ let n = r.getInt32(s, !0);
167
167
  s += 4;
168
- let i = Array(t);
169
- for (let e = 0; e < t; e++) {
170
- let t = b(n, s);
171
- s += 8, c = f(c, t), i[e] = t;
168
+ let i = Array(n);
169
+ for (let e = 0; e < n; e++) {
170
+ let n = b(t, s);
171
+ s += 8, c = f(c, n), i[e] = n;
172
172
  }
173
173
  }
174
- let u = new e({ maxSize: 5 });
174
+ let u = new n({ maxSize: 5 });
175
175
  function p(e) {
176
- let t = l[e];
177
- if (t === void 0) return;
178
- let i = r.getInt32(t, !0), s;
179
- t += 4;
176
+ let n = l[e];
177
+ if (n === void 0) return;
178
+ let i = r.getInt32(n, !0), s;
179
+ n += 4;
180
180
  let u = {};
181
181
  for (let e = 0; e < i; e += 1) {
182
- let e = r.getUint32(t, !0);
183
- if (t += 4, e === o + 1) t += 4, s = d(n, t + 16), t += 32;
182
+ let e = r.getUint32(n, !0);
183
+ if (n += 4, e === o + 1) n += 4, s = d(t, n + 16), n += 32;
184
184
  else if (e > o + 1) throw Error("bai index contains too many bins, please use CSI");
185
185
  else {
186
- let i = r.getInt32(t, !0);
187
- t += 4;
186
+ let i = r.getInt32(n, !0);
187
+ n += 4;
188
188
  let o = Array(i);
189
189
  for (let r = 0; r < i; r++) {
190
- let i = b(n, t);
191
- t += 8;
192
- let s = b(n, t);
193
- t += 8, c = f(c, i), o[r] = new a(i, s, e);
190
+ let i = b(t, n);
191
+ n += 8;
192
+ let s = b(t, n);
193
+ n += 8, c = f(c, i), o[r] = new a(i, s, e);
194
194
  }
195
195
  u[e] = o;
196
196
  }
197
197
  }
198
- let p = r.getInt32(t, !0);
199
- t += 4;
198
+ let p = r.getInt32(n, !0);
199
+ n += 4;
200
200
  let m = Array(p);
201
201
  for (let e = 0; e < p; e++) {
202
- let r = b(n, t);
203
- t += 8, c = f(c, r), m[e] = r;
202
+ let r = b(t, n);
203
+ n += 8, c = f(c, r), m[e] = r;
204
204
  }
205
205
  return {
206
206
  binIndex: u,
@@ -565,8 +565,8 @@ var M = class extends v {
565
565
  ...p(e.subarray(t + 28, t + 28 + u), this.renameRefSeq)
566
566
  };
567
567
  }
568
- async _parse(n) {
569
- let r = await t(await this.filehandle.readFile(n)), i = new DataView(r.buffer), o, s = i.getUint32(0, !0);
568
+ async _parse(t) {
569
+ let r = await e(await this.filehandle.readFile(t)), i = new DataView(r.buffer), o, s = i.getUint32(0, !0);
570
570
  if (s === O) o = 1;
571
571
  else if (s === k) o = 2;
572
572
  else throw Error(`Not a CSI file ${s}`);
@@ -590,7 +590,7 @@ var M = class extends v {
590
590
  }
591
591
  }
592
592
  }
593
- let _ = new e({ maxSize: 5 });
593
+ let _ = new n({ maxSize: 5 });
594
594
  function v(e) {
595
595
  let t = g[e];
596
596
  if (t === void 0) return;
@@ -1126,38 +1126,38 @@ function B(e) {
1126
1126
  return n;
1127
1127
  }
1128
1128
  var V = 65536, H = class {
1129
- constructor({ bamFilehandle: t, bamPath: n, bamUrl: a, baiPath: o, baiFilehandle: s, baiUrl: c, csiPath: l, csiFilehandle: u, csiUrl: d, htsget: f, renameRefSeqs: p = (e) => e, recordClass: m }) {
1130
- if (this.htsget = !1, this.chunkFeatureCache = new e({ maxSize: 100 }), this.renameRefSeq = p, this.RecordClass = m ?? z, t) this.bam = t;
1131
- else if (n) this.bam = new i(n);
1132
- else if (a) this.bam = new r(a);
1129
+ constructor({ bamFilehandle: e, bamPath: t, bamUrl: a, baiPath: o, baiFilehandle: s, baiUrl: c, csiPath: l, csiFilehandle: u, csiUrl: d, htsget: f, renameRefSeqs: p = (e) => e, recordClass: m }) {
1130
+ if (this.htsget = !1, this.chunkFeatureCache = new n({ maxSize: 100 }), this.renameRefSeq = p, this.RecordClass = m ?? z, e) this.bam = e;
1131
+ else if (t) this.bam = new r(t);
1132
+ else if (a) this.bam = new i(a);
1133
1133
  else if (f) this.htsget = !0, this.bam = new N();
1134
1134
  else throw Error("unable to initialize bam");
1135
1135
  if (u) this.index = new M({ filehandle: u });
1136
- else if (l) this.index = new M({ filehandle: new i(l) });
1137
- else if (d) this.index = new M({ filehandle: new r(d) });
1136
+ else if (l) this.index = new M({ filehandle: new r(l) });
1137
+ else if (d) this.index = new M({ filehandle: new i(d) });
1138
1138
  else if (s) this.index = new T({ filehandle: s });
1139
- else if (o) this.index = new T({ filehandle: new i(o) });
1140
- else if (c) this.index = new T({ filehandle: new r(c) });
1141
- else if (n) this.index = new T({ filehandle: new i(`${n}.bai`) });
1142
- else if (a) this.index = new T({ filehandle: new r(`${a}.bai`) });
1139
+ else if (o) this.index = new T({ filehandle: new r(o) });
1140
+ else if (c) this.index = new T({ filehandle: new i(c) });
1141
+ else if (t) this.index = new T({ filehandle: new r(`${t}.bai`) });
1142
+ else if (a) this.index = new T({ filehandle: new i(`${a}.bai`) });
1143
1143
  else if (f) this.htsget = !0;
1144
1144
  else throw Error("unable to infer index format");
1145
1145
  }
1146
- async getHeaderPre(e) {
1147
- let n = l(e);
1146
+ async getHeaderPre(t) {
1147
+ let n = l(t);
1148
1148
  if (!this.index) return;
1149
- let r = await this.index.parse(n), i = r.firstDataLine === void 0 ? void 0 : r.firstDataLine.blockPosition + V, a = await t(i === void 0 ? await this.bam.readFile() : await this.bam.read(i, 0)), o = new DataView(a.buffer);
1149
+ let r = await this.index.parse(n), i = r.firstDataLine === void 0 ? void 0 : r.firstDataLine.blockPosition + V, a = await e(i === void 0 ? await this.bam.readFile() : await this.bam.read(i, 0)), o = new DataView(a.buffer);
1150
1150
  if (o.getInt32(0, !0) !== 21840194) throw Error("Not a BAM file");
1151
1151
  let s = o.getInt32(4, !0);
1152
1152
  this.header = new TextDecoder("utf8").decode(a.subarray(8, 8 + s));
1153
1153
  let c = s + 8;
1154
- for (let e = 0; e < 5; e++) {
1154
+ for (let t = 0; t < 5; t++) {
1155
1155
  if (this._hasEnoughRefSeqData(a, c)) {
1156
1156
  let { chrToIndex: e, indexToChr: t } = this._parseRefSeqs(a, c);
1157
1157
  return this.chrToIndex = e, this.indexToChr = t, B(this.header);
1158
1158
  }
1159
1159
  if (i === void 0) throw Error(`Insufficient data for reference sequences in ${a.length} bytes`);
1160
- i *= 2, a = await t(await this.bam.read(i, 0));
1160
+ i *= 2, a = await e(await this.bam.read(i, 0));
1161
1161
  }
1162
1162
  throw Error("Insufficient data for reference sequences after 5 retries");
1163
1163
  }
@@ -1281,8 +1281,8 @@ var V = 65536, H = class {
1281
1281
  return c;
1282
1282
  }))).flat();
1283
1283
  }
1284
- async _readChunk({ chunk: e, opts: t }) {
1285
- let { buffer: r, cpositions: i, dpositions: a } = await n(await this.bam.read(e.fetchedSize(), e.minv.blockPosition, t), e);
1284
+ async _readChunk({ chunk: e, opts: n }) {
1285
+ let { buffer: r, cpositions: i, dpositions: a } = await t(await this.bam.read(e.fetchedSize(), e.minv.blockPosition, n), e);
1286
1286
  return {
1287
1287
  data: r,
1288
1288
  cpositions: i,
@@ -1352,8 +1352,8 @@ var V = 65536, H = class {
1352
1352
  };
1353
1353
  //#endregion
1354
1354
  //#region ../../node_modules/@gmod/bam/esm/htsget.js
1355
- async function U(e, n) {
1356
- let r = await Promise.all(e.map(async (e) => {
1355
+ async function U(t, n) {
1356
+ let r = await Promise.all(t.map(async (e) => {
1357
1357
  let { url: t, headers: r } = e;
1358
1358
  if (t.startsWith("data:")) {
1359
1359
  let e = await fetch(t);
@@ -1372,7 +1372,7 @@ async function U(e, n) {
1372
1372
  return new Uint8Array(await a.arrayBuffer());
1373
1373
  }
1374
1374
  }));
1375
- return m(await Promise.all(r.map((e) => t(e))));
1375
+ return m(await Promise.all(r.map((t) => e(t))));
1376
1376
  }
1377
1377
  var W = class extends H {
1378
1378
  constructor(e) {
@@ -1,7 +1,7 @@
1
- import { t as e } from "./esm-CGX-qz1d.js";
2
- import { n as t, r as n } from "./esm-BDFRLEuD.js";
3
- import { r, t as i } from "./browser-Dvlo92rx.js";
4
- import { t as a } from "./AbortablePromiseCache-3gHJdF3E.js";
1
+ import { n as e, r as t } from "./esm-BDFRLEuD.js";
2
+ import { t as n } from "./esm-CZvS2Ldm.js";
3
+ import { n as r, r as i } from "./esm-id9DWBZW.js";
4
+ import { t as a } from "./AbortablePromiseCache-beUIcZcW.js";
5
5
  //#region ../../node_modules/@gmod/tabix/esm/chunk.js
6
6
  var o = class {
7
7
  constructor(e, t, n, r) {
@@ -132,8 +132,8 @@ var b = class extends s {
132
132
  coordinateType: i
133
133
  };
134
134
  }
135
- async _parse(e = {}) {
136
- let n = await t(await this.filehandle.readFile(e)), r = new DataView(n.buffer), i;
135
+ async _parse(t = {}) {
136
+ let n = await e(await this.filehandle.readFile(t)), r = new DataView(n.buffer), i;
137
137
  if (r.getUint32(0, !0) === h) i = 1;
138
138
  else if (r.getUint32(0, !0) === g) i = 2;
139
139
  else throw Error("Not a CSI file");
@@ -226,8 +226,8 @@ var w = class extends s {
226
226
  let n = await this.parse(t), r = n.refNameToId[e];
227
227
  return r === void 0 || !n.indices[r] ? -1 : n.indices[r].stats?.lineCount ?? -1;
228
228
  }
229
- async _parse(e = {}) {
230
- let n = await t(await this.filehandle.readFile(e)), r = new DataView(n.buffer);
229
+ async _parse(t = {}) {
230
+ let n = await e(await this.filehandle.readFile(t)), r = new DataView(n.buffer);
231
231
  if (r.getUint32(0, !0) !== x) throw Error("Not a TBI file");
232
232
  let i = r.getUint32(4, !0), a = r.getUint32(8, !0), s = a & 65536 ? "zero-based-half-open" : "1-based-closed", c = {
233
233
  0: "generic",
@@ -305,12 +305,12 @@ var w = class extends s {
305
305
  return f(l, d);
306
306
  }
307
307
  }, T = class {
308
- constructor({ path: t, filehandle: n, url: o, tbiPath: s, tbiUrl: c, tbiFilehandle: l, csiPath: u, csiUrl: d, csiFilehandle: f, renameRefSeqs: p, chunkCacheSize: m = 5 * 2 ** 20 }) {
309
- this.cache = new e({ maxSize: 1e3 });
308
+ constructor({ path: e, filehandle: t, url: o, tbiPath: s, tbiUrl: c, tbiFilehandle: l, csiPath: u, csiUrl: d, csiFilehandle: f, renameRefSeqs: p, chunkCacheSize: m = 5 * 2 ** 20 }) {
309
+ this.cache = new n({ maxSize: 1e3 });
310
310
  let h = p ?? ((e) => e);
311
- if (n) this.filehandle = n;
312
- else if (t) this.filehandle = new i(t);
313
- else if (o) this.filehandle = new r(o);
311
+ if (t) this.filehandle = t;
312
+ else if (e) this.filehandle = new r(e);
313
+ else if (o) this.filehandle = new i(o);
314
314
  else throw TypeError("must provide either filehandle or path");
315
315
  if (l) this.index = new w({
316
316
  filehandle: l,
@@ -321,23 +321,23 @@ var w = class extends s {
321
321
  renameRefSeqs: h
322
322
  });
323
323
  else if (s) this.index = new w({
324
- filehandle: new i(s),
324
+ filehandle: new r(s),
325
325
  renameRefSeqs: h
326
326
  });
327
327
  else if (u) this.index = new b({
328
- filehandle: new i(u),
328
+ filehandle: new r(u),
329
329
  renameRefSeqs: h
330
330
  });
331
- else if (t) this.index = new w({
332
- filehandle: new i(`${t}.tbi`),
331
+ else if (e) this.index = new w({
332
+ filehandle: new r(`${e}.tbi`),
333
333
  renameRefSeqs: h
334
334
  });
335
- else if (d) this.index = new b({ filehandle: new r(d) });
336
- else if (c) this.index = new w({ filehandle: new r(c) });
337
- else if (o) this.index = new w({ filehandle: new r(`${o}.tbi`) });
335
+ else if (d) this.index = new b({ filehandle: new i(d) });
336
+ else if (c) this.index = new w({ filehandle: new i(c) });
337
+ else if (o) this.index = new w({ filehandle: new i(`${o}.tbi`) });
338
338
  else throw TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, csiPath, tbiUrl, csiUrl");
339
339
  this.renameRefSeq = h, this.hasCustomRenameRefSeq = p !== void 0, this.chunkCache = new a({
340
- cache: new e({ maxSize: Math.floor(m / 65536) }),
340
+ cache: new n({ maxSize: Math.floor(m / 65536) }),
341
341
  fill: (e, t) => this.readChunk(e, { signal: t })
342
342
  });
343
343
  }
@@ -386,8 +386,8 @@ var w = class extends s {
386
386
  async getMetadata(e = {}) {
387
387
  return this.index.getMetadata(e);
388
388
  }
389
- async getHeaderBuffer(e = {}) {
390
- let { firstDataLine: n, metaChar: r, maxBlockSize: i } = await this.getMetadata(e), a = (n?.blockPosition || 0) + i, o = await t(await this.filehandle.read(a, 0, e));
389
+ async getHeaderBuffer(t = {}) {
390
+ let { firstDataLine: n, metaChar: r, maxBlockSize: i } = await this.getMetadata(t), a = (n?.blockPosition || 0) + i, o = await e(await this.filehandle.read(a, 0, t));
391
391
  if (r) {
392
392
  let e = -1, t = r.charCodeAt(0);
393
393
  for (let n = 0, r = o.length; n < r; n++) {
@@ -453,8 +453,8 @@ var w = class extends s {
453
453
  async lineCount(e, t = {}) {
454
454
  return this.index.lineCount(e, t);
455
455
  }
456
- async readChunk(e, t = {}) {
457
- return n(await this.filehandle.read(e.fetchedSize(), e.minv.blockPosition, t), e, this.cache);
456
+ async readChunk(e, n = {}) {
457
+ return t(await this.filehandle.read(e.fetchedSize(), e.minv.blockPosition, n), e, this.cache);
458
458
  }
459
459
  };
460
460
  //#endregion