@rivm-loculus-tools/sequence-editor 1.7.1 → 1.9.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 (58) hide show
  1. package/dist/_chunks/EngineWorker.js +1 -1
  2. package/dist/_chunks/EngineWorker.js.map +1 -1
  3. package/dist/_chunks/SequenceEditor.js +250 -145
  4. package/dist/_chunks/SequenceEditor.js.map +1 -1
  5. package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
  6. package/dist/_chunks/SequenceEditorPageDrawer.js +132 -127
  7. package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
  8. package/dist/_chunks/SequenceEditorPageHeader.js +123 -0
  9. package/dist/_chunks/SequenceEditorPageHeader.js.map +1 -0
  10. package/dist/_chunks/sequenceEditorStore.js +2 -2
  11. package/dist/_chunks/sequenceEditorStore.js.map +1 -1
  12. package/dist/_chunks/sequence_editor.js +8 -1
  13. package/dist/_chunks/sequence_editor.js.map +1 -1
  14. package/dist/assets/AlignerWorker-cbSDVRKB.js +8 -0
  15. package/dist/assets/AlignerWorker-cbSDVRKB.js.map +1 -0
  16. package/dist/assets/index--BqOy4u7.js +8 -0
  17. package/dist/assets/index--BqOy4u7.js.map +1 -0
  18. package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +29 -23
  19. package/dist/classes/services/EditorWorkerService/index.js +80 -69
  20. package/dist/classes/services/EditorWorkerService/index.js.map +1 -1
  21. package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +4 -0
  22. package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +2 -0
  23. package/dist/classes/workers/EngineWorker/index.js +6 -0
  24. package/dist/classes/workers/EngineWorker/index.js.map +1 -1
  25. package/dist/components/app/SequenceEditorApp/index.js +4 -1
  26. package/dist/components/app/SequenceEditorApp/index.js.map +1 -1
  27. package/dist/components/ui/SequenceEditorPageHeader/SequenceEditorUndoRedoButtons.d.ts +1 -0
  28. package/dist/components/ui/SequenceEditorPageHeader/index.js +1 -109
  29. package/dist/components/ui/SequenceEditorRealignModal/index.js +2 -2
  30. package/dist/components/ui/SequenceEditorRealignModal/index.js.map +1 -1
  31. package/dist/constants/index.js +5 -4
  32. package/dist/constants/keyboard.d.ts +2 -0
  33. package/dist/constants/keyboard.js +44 -7
  34. package/dist/constants/keyboard.js.map +1 -1
  35. package/dist/constants/palette.d.ts +1 -2
  36. package/dist/constants/palette.js +162 -204
  37. package/dist/constants/palette.js.map +1 -1
  38. package/dist/constants/paletteSchemaData.d.ts +4 -0
  39. package/dist/constants/paletteSchemaData.js +48 -0
  40. package/dist/constants/paletteSchemaData.js.map +1 -0
  41. package/dist/models/editor.models.d.ts +2 -0
  42. package/dist/models/editor.models.js.map +1 -1
  43. package/dist/pages/SequenceEditorMainPage/index.js +1 -0
  44. package/dist/pages/SequenceEditorMainPage/index.js.map +1 -1
  45. package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +2 -2
  46. package/dist/utils/EditorUtil/EditorUtil.d.ts +3 -0
  47. package/dist/utils/EditorUtil/index.js +206 -169
  48. package/dist/utils/EditorUtil/index.js.map +1 -1
  49. package/dist/utils/SequenceEditorStandardConfigUtil/index.js +1 -1
  50. package/dist/vite/paletteSchemaPlugin/index.d.ts +1 -1
  51. package/dist/vite/paletteSchemaPlugin/index.js +1 -1
  52. package/dist/vite/paletteSchemaPlugin/index.js.map +1 -1
  53. package/package.json +7 -3
  54. package/dist/assets/AlignerWorker-Cf4trdzm.js +0 -8
  55. package/dist/assets/AlignerWorker-Cf4trdzm.js.map +0 -1
  56. package/dist/assets/index-YCKQaSTQ.js +0 -8
  57. package/dist/assets/index-YCKQaSTQ.js.map +0 -1
  58. package/dist/components/ui/SequenceEditorPageHeader/index.js.map +0 -1
@@ -1,18 +1,20 @@
1
- import { PaletteUtil as e } from "../PaletteUtil/index.js";
2
- import { DEFAULT_GRID_GEOMETRY as t } from "../../constants/editor.js";
3
- import { EDITOR_DIRECTION as n, EDITOR_PATH_PROPERTIES_TYPE as r, MATRIX_TYPE as i } from "../../models/editor.models.js";
1
+ import { DEFAULT_GRID_GEOMETRY as e } from "../../constants/editor.js";
2
+ import { EDITOR_DIRECTION as t, EDITOR_PATH_PROPERTIES_TYPE as n, MATRIX_TYPE as r } from "../../models/editor.models.js";
3
+ import { PaletteUtil as i } from "../PaletteUtil/index.js";
4
4
  import "../../constants/index.js";
5
+ import { StringUtil as a } from "@gen-epix/ui-core/utils/StringUtil";
6
+ import { FastaUtil as o } from "@rivm-loculus-tools/common-frontend/utils/FastaUtil";
5
7
  // \0rolldown/runtime.js
6
- var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescriptor, c = Object.getOwnPropertyNames, l = Object.getPrototypeOf, u = Object.prototype.hasOwnProperty, d = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), f = (e, t, n, r) => {
7
- if (t && typeof t == "object" || typeof t == "function") for (var i = c(t), a = 0, l = i.length, d; a < l; a++) d = i[a], !u.call(e, d) && d !== n && o(e, d, {
8
- get: ((e) => t[e]).bind(null, d),
9
- enumerable: !(r = s(t, d)) || r.enumerable
8
+ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescriptor, u = Object.getOwnPropertyNames, d = Object.getPrototypeOf, f = Object.prototype.hasOwnProperty, p = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), m = (e, t, n, r) => {
9
+ if (t && typeof t == "object" || typeof t == "function") for (var i = u(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !f.call(e, s) && s !== n && c(e, s, {
10
+ get: ((e) => t[e]).bind(null, s),
11
+ enumerable: !(r = l(t, s)) || r.enumerable
10
12
  });
11
13
  return e;
12
- }, p = (e, t, n) => (n = e == null ? {} : a(l(e)), f(t || !e || !e.__esModule || !u.call(e, "default") ? o(n, "default", {
14
+ }, h = (e, t, n) => (n = e == null ? {} : s(d(e)), m(t || !e || !e.__esModule || !f.call(e, "default") ? c(n, "default", {
13
15
  value: e,
14
16
  enumerable: !0
15
- }) : n, e)), m = /* @__PURE__ */ d(((e, t) => {
17
+ }) : n, e)), g = /* @__PURE__ */ p(((e, t) => {
16
18
  var n = Math.floor;
17
19
  function r(e, t) {
18
20
  var r = "";
@@ -23,23 +25,23 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
23
25
  return r;
24
26
  }
25
27
  t.exports = r;
26
- })), h = /* @__PURE__ */ d(((e, t) => {
28
+ })), _ = /* @__PURE__ */ p(((e, t) => {
27
29
  t.exports = typeof global == "object" && global && global.Object === Object && global;
28
- })), g = /* @__PURE__ */ d(((e, t) => {
29
- var n = h(), r = typeof self == "object" && self && self.Object === Object && self;
30
+ })), v = /* @__PURE__ */ p(((e, t) => {
31
+ var n = _(), r = typeof self == "object" && self && self.Object === Object && self;
30
32
  t.exports = n || r || Function("return this")();
31
- })), _ = /* @__PURE__ */ d(((e, t) => {
32
- t.exports = g().Symbol;
33
- })), v = /* @__PURE__ */ d(((e, t) => {
33
+ })), y = /* @__PURE__ */ p(((e, t) => {
34
+ t.exports = v().Symbol;
35
+ })), b = /* @__PURE__ */ p(((e, t) => {
34
36
  function n(e, t) {
35
37
  for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
36
38
  return i;
37
39
  }
38
40
  t.exports = n;
39
- })), y = /* @__PURE__ */ d(((e, t) => {
41
+ })), x = /* @__PURE__ */ p(((e, t) => {
40
42
  t.exports = Array.isArray;
41
- })), b = /* @__PURE__ */ d(((e, t) => {
42
- var n = _(), r = Object.prototype, i = r.hasOwnProperty, a = r.toString, o = n ? n.toStringTag : void 0;
43
+ })), S = /* @__PURE__ */ p(((e, t) => {
44
+ var n = y(), r = Object.prototype, i = r.hasOwnProperty, a = r.toString, o = n ? n.toStringTag : void 0;
43
45
  function s(e) {
44
46
  var t = i.call(e, o), n = e[o];
45
47
  try {
@@ -50,31 +52,31 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
50
52
  return r && (t ? e[o] = n : delete e[o]), s;
51
53
  }
52
54
  t.exports = s;
53
- })), x = /* @__PURE__ */ d(((e, t) => {
55
+ })), C = /* @__PURE__ */ p(((e, t) => {
54
56
  var n = Object.prototype.toString;
55
57
  function r(e) {
56
58
  return n.call(e);
57
59
  }
58
60
  t.exports = r;
59
- })), S = /* @__PURE__ */ d(((e, t) => {
60
- var n = _(), r = b(), i = x(), a = "[object Null]", o = "[object Undefined]", s = n ? n.toStringTag : void 0;
61
+ })), w = /* @__PURE__ */ p(((e, t) => {
62
+ var n = y(), r = S(), i = C(), a = "[object Null]", o = "[object Undefined]", s = n ? n.toStringTag : void 0;
61
63
  function c(e) {
62
64
  return e == null ? e === void 0 ? o : a : s && s in Object(e) ? r(e) : i(e);
63
65
  }
64
66
  t.exports = c;
65
- })), C = /* @__PURE__ */ d(((e, t) => {
67
+ })), T = /* @__PURE__ */ p(((e, t) => {
66
68
  function n(e) {
67
69
  return typeof e == "object" && !!e;
68
70
  }
69
71
  t.exports = n;
70
- })), w = /* @__PURE__ */ d(((e, t) => {
71
- var n = S(), r = C(), i = "[object Symbol]";
72
+ })), E = /* @__PURE__ */ p(((e, t) => {
73
+ var n = w(), r = T(), i = "[object Symbol]";
72
74
  function a(e) {
73
75
  return typeof e == "symbol" || r(e) && n(e) == i;
74
76
  }
75
77
  t.exports = a;
76
- })), T = /* @__PURE__ */ d(((e, t) => {
77
- var n = _(), r = v(), i = y(), a = w(), o = 1 / 0, s = n ? n.prototype : void 0, c = s ? s.toString : void 0;
78
+ })), D = /* @__PURE__ */ p(((e, t) => {
79
+ var n = y(), r = b(), i = x(), a = E(), o = 1 / 0, s = n ? n.prototype : void 0, c = s ? s.toString : void 0;
78
80
  function l(e) {
79
81
  if (typeof e == "string") return e;
80
82
  if (i(e)) return r(e, l) + "";
@@ -83,7 +85,7 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
83
85
  return t == "0" && 1 / e == -o ? "-0" : t;
84
86
  }
85
87
  t.exports = l;
86
- })), E = /* @__PURE__ */ d(((e, t) => {
88
+ })), O = /* @__PURE__ */ p(((e, t) => {
87
89
  function n(e, t, n) {
88
90
  var r = -1, i = e.length;
89
91
  t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
@@ -91,29 +93,29 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
91
93
  return a;
92
94
  }
93
95
  t.exports = n;
94
- })), D = /* @__PURE__ */ d(((e, t) => {
95
- var n = E();
96
+ })), k = /* @__PURE__ */ p(((e, t) => {
97
+ var n = O();
96
98
  function r(e, t, r) {
97
99
  var i = e.length;
98
100
  return r = r === void 0 ? i : r, !t && r >= i ? e : n(e, t, r);
99
101
  }
100
102
  t.exports = r;
101
- })), O = /* @__PURE__ */ d(((e, t) => {
103
+ })), A = /* @__PURE__ */ p(((e, t) => {
102
104
  var n = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");
103
105
  function r(e) {
104
106
  return n.test(e);
105
107
  }
106
108
  t.exports = r;
107
- })), k = /* @__PURE__ */ d(((e, t) => {
109
+ })), j = /* @__PURE__ */ p(((e, t) => {
108
110
  function n(e) {
109
111
  return function(t) {
110
112
  return t?.[e];
111
113
  };
112
114
  }
113
115
  t.exports = n;
114
- })), A = /* @__PURE__ */ d(((e, t) => {
115
- t.exports = k()("length");
116
- })), j = /* @__PURE__ */ d(((e, t) => {
116
+ })), M = /* @__PURE__ */ p(((e, t) => {
117
+ t.exports = j()("length");
118
+ })), N = /* @__PURE__ */ p(((e, t) => {
117
119
  var n = "\\ud800-\\udfff", r = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", i = "\\ufe0e\\ufe0f", a = "[" + n + "]", o = "[" + r + "]", s = "\\ud83c[\\udffb-\\udfff]", c = "(?:" + o + "|" + s + ")", l = "[^" + n + "]", u = "(?:\\ud83c[\\udde6-\\uddff]){2}", d = "[\\ud800-\\udbff][\\udc00-\\udfff]", f = "\\u200d", p = c + "?", m = "[" + i + "]?", h = "(?:" + f + "(?:" + [
118
120
  l,
119
121
  u,
@@ -130,18 +132,18 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
130
132
  return t;
131
133
  }
132
134
  t.exports = y;
133
- })), M = /* @__PURE__ */ d(((e, t) => {
134
- var n = A(), r = O(), i = j();
135
+ })), P = /* @__PURE__ */ p(((e, t) => {
136
+ var n = M(), r = A(), i = N();
135
137
  function a(e) {
136
138
  return r(e) ? i(e) : n(e);
137
139
  }
138
140
  t.exports = a;
139
- })), N = /* @__PURE__ */ d(((e, t) => {
141
+ })), F = /* @__PURE__ */ p(((e, t) => {
140
142
  function n(e) {
141
143
  return e.split("");
142
144
  }
143
145
  t.exports = n;
144
- })), P = /* @__PURE__ */ d(((e, t) => {
146
+ })), I = /* @__PURE__ */ p(((e, t) => {
145
147
  var n = "\\ud800-\\udfff", r = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", i = "\\ufe0e\\ufe0f", a = "[" + n + "]", o = "[" + r + "]", s = "\\ud83c[\\udffb-\\udfff]", c = "(?:" + o + "|" + s + ")", l = "[^" + n + "]", u = "(?:\\ud83c[\\udde6-\\uddff]){2}", d = "[\\ud800-\\udbff][\\udc00-\\udfff]", f = "\\u200d", p = c + "?", m = "[" + i + "]?", h = "(?:" + f + "(?:" + [
146
148
  l,
147
149
  u,
@@ -157,14 +159,14 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
157
159
  return e.match(v) || [];
158
160
  }
159
161
  t.exports = y;
160
- })), F = /* @__PURE__ */ d(((e, t) => {
161
- var n = N(), r = O(), i = P();
162
+ })), L = /* @__PURE__ */ p(((e, t) => {
163
+ var n = F(), r = A(), i = I();
162
164
  function a(e) {
163
165
  return r(e) ? i(e) : n(e);
164
166
  }
165
167
  t.exports = a;
166
- })), I = /* @__PURE__ */ d(((e, t) => {
167
- var n = m(), r = T(), i = D(), a = O(), o = M(), s = F(), c = Math.ceil;
168
+ })), R = /* @__PURE__ */ p(((e, t) => {
169
+ var n = g(), r = D(), i = k(), a = A(), o = P(), s = L(), c = Math.ceil;
168
170
  function l(e, t) {
169
171
  t = t === void 0 ? " " : r(t);
170
172
  var l = t.length;
@@ -173,27 +175,27 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
173
175
  return a(t) ? i(s(u), 0, e).join("") : u.slice(0, e);
174
176
  }
175
177
  t.exports = l;
176
- })), L = /* @__PURE__ */ d(((e, t) => {
178
+ })), z = /* @__PURE__ */ p(((e, t) => {
177
179
  var n = /\s/;
178
180
  function r(e) {
179
181
  for (var t = e.length; t-- && n.test(e.charAt(t)););
180
182
  return t;
181
183
  }
182
184
  t.exports = r;
183
- })), R = /* @__PURE__ */ d(((e, t) => {
184
- var n = L(), r = /^\s+/;
185
+ })), B = /* @__PURE__ */ p(((e, t) => {
186
+ var n = z(), r = /^\s+/;
185
187
  function i(e) {
186
188
  return e && e.slice(0, n(e) + 1).replace(r, "");
187
189
  }
188
190
  t.exports = i;
189
- })), z = /* @__PURE__ */ d(((e, t) => {
191
+ })), V = /* @__PURE__ */ p(((e, t) => {
190
192
  function n(e) {
191
193
  var t = typeof e;
192
194
  return e != null && (t == "object" || t == "function");
193
195
  }
194
196
  t.exports = n;
195
- })), B = /* @__PURE__ */ d(((e, t) => {
196
- var n = R(), r = z(), i = w(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
197
+ })), H = /* @__PURE__ */ p(((e, t) => {
198
+ var n = B(), r = V(), i = E(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
197
199
  function u(e) {
198
200
  if (typeof e == "number") return e;
199
201
  if (i(e)) return a;
@@ -207,150 +209,150 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
207
209
  return u || c.test(e) ? l(e.slice(2), u ? 2 : 8) : o.test(e) ? a : +e;
208
210
  }
209
211
  t.exports = u;
210
- })), V = /* @__PURE__ */ d(((e, t) => {
211
- var n = B(), r = 1 / 0, i = 17976931348623157e292;
212
+ })), U = /* @__PURE__ */ p(((e, t) => {
213
+ var n = H(), r = 1 / 0, i = 17976931348623157e292;
212
214
  function a(e) {
213
215
  return e ? (e = n(e), e === r || e === -r ? (e < 0 ? -1 : 1) * i : e === e ? e : 0) : e === 0 ? e : 0;
214
216
  }
215
217
  t.exports = a;
216
- })), H = /* @__PURE__ */ d(((e, t) => {
217
- var n = V();
218
+ })), W = /* @__PURE__ */ p(((e, t) => {
219
+ var n = U();
218
220
  function r(e) {
219
221
  var t = n(e), r = t % 1;
220
222
  return t === t ? r ? t - r : t : 0;
221
223
  }
222
224
  t.exports = r;
223
- })), U = /* @__PURE__ */ d(((e, t) => {
224
- var n = T();
225
+ })), G = /* @__PURE__ */ p(((e, t) => {
226
+ var n = D();
225
227
  function r(e) {
226
228
  return e == null ? "" : n(e);
227
229
  }
228
230
  t.exports = r;
229
- })), W = /* @__PURE__ */ p((/* @__PURE__ */ d(((e, t) => {
230
- var n = I(), r = M(), i = H(), a = U();
231
+ })), K = /* @__PURE__ */ h((/* @__PURE__ */ p(((e, t) => {
232
+ var n = R(), r = P(), i = W(), a = G();
231
233
  function o(e, t, o) {
232
234
  e = a(e), t = i(t);
233
235
  var s = t ? r(e) : 0;
234
236
  return t && s < t ? n(t - s, o) + e : e;
235
237
  }
236
238
  t.exports = o;
237
- })))(), 1), G = class a {
238
- static drawCanvas({ canvasElement: t, devicePixelRatio: n, geometry: o, meta: s, palette: c, rowNames: l, rowNamesStartRow: u, scrollLeft: d, scrollTop: f, searchResult: p, searchResultHighlightedIndex: m, selection: h, viewport: g, viewportHeight: _, viewportWidth: v }) {
239
+ })))(), 1), q = class s {
240
+ static drawCanvas({ canvasElement: e, devicePixelRatio: t, geometry: a, meta: o, palette: c, rowNames: l, rowNamesStartRow: u, scrollLeft: d, scrollTop: f, searchResult: p, searchResultHighlightedIndex: m, selection: h, viewport: g, viewportHeight: _, viewportWidth: v }) {
239
241
  let y = {
240
242
  cells: { pathPropertiesMap: /* @__PURE__ */ new Map() },
241
243
  divider: { pathPropertiesMap: /* @__PURE__ */ new Map() },
242
244
  labels: { pathPropertiesMap: /* @__PURE__ */ new Map() },
243
245
  ruler: { pathPropertiesMap: /* @__PURE__ */ new Map() }
244
246
  };
245
- if (!t) return y;
246
- let b = t.getContext("2d");
247
+ if (!e) return y;
248
+ let b = e.getContext("2d");
247
249
  if (!b) return y;
248
- let x = s.sequenceCount.toString().length, S = (e) => h?.rows?.includes(e) ?? !1, C = (e, t) => !!(h?.cells && t >= h.cells.startCol && t <= h.cells.endCol && e >= h.cells.startRow && e <= h.cells.endRow) || !!h?.cols?.includes(t) || !!S(e), w = p && m !== null ? a.searchHitAt(p, m) : null;
249
- return a.draw(t, n, () => {
250
- b.clearRect(0, 0, t.width, t.height);
251
- let { cellHeight: n, cellWidth: s, dividerWidth: m, labelWidth: T, rulerHeight: E } = o, D = T + m, { bytes: O, cols: k, rows: A, startCol: j, startRow: M } = g, N = (p?.positions.length ?? 0) > 0, P = N ? new Uint8Array(A * k) : null, F = w ? new Uint8Array(A * k) : null, I = N ? new Uint8Array(A) : null, L = w ? new Uint8Array(A) : null, R = N ? new Path2D() : null, z = w ? new Path2D() : null, B = !1, V = !1, H = (e, t) => {
250
+ let x = o.sequenceCount.toString().length, S = (e) => h?.rows?.includes(e) ?? !1, C = (e, t) => !!(h?.cells && t >= h.cells.startCol && t <= h.cells.endCol && e >= h.cells.startRow && e <= h.cells.endRow) || !!h?.cols?.includes(t) || !!S(e), w = p && m !== null ? s.searchHitAt(p, m) : null;
251
+ return s.draw(e, t, () => {
252
+ b.clearRect(0, 0, e.width, e.height);
253
+ let { cellHeight: t, cellWidth: o, dividerWidth: m, labelWidth: T, rulerHeight: E } = a, D = T + m, { bytes: O, cols: k, rows: A, startCol: j, startRow: M } = g, N = (p?.positions.length ?? 0) > 0, P = N ? new Uint8Array(A * k) : null, F = w ? new Uint8Array(A * k) : null, I = N ? new Uint8Array(A) : null, L = w ? new Uint8Array(A) : null, R = N ? new Path2D() : null, z = w ? new Path2D() : null, B = !1, V = !1, H = (e, t) => {
252
254
  if (!p) return;
253
- let n = Math.max(1, p.query.length), r = e.row - M;
254
- if (r < 0 || r >= A) return;
255
- if (e.matrix_type === i.RECORD_NAME) {
256
- t.fill(1, r * k, (r + 1) * k);
255
+ let n = Math.max(1, p.query.length), i = e.row - M;
256
+ if (i < 0 || i >= A) return;
257
+ if (e.matrix_type === r.RECORD_NAME) {
258
+ t.fill(1, i * k, (i + 1) * k);
257
259
  return;
258
260
  }
259
- let o = Math.max(j, e.col), s = Math.min(j + k, e.col + n);
260
- if (o >= s || !a.searchHitContainsCell(e, p.query, e.row, o)) return;
261
- let c = r * k + o - j;
262
- t.fill(1, c, c + s - o);
261
+ let a = Math.max(j, e.col), o = Math.min(j + k, e.col + n);
262
+ if (a >= o || !s.searchHitContainsCell(e, p.query, e.row, a)) return;
263
+ let c = i * k + a - j;
264
+ t.fill(1, c, c + o - a);
263
265
  }, U = (e, t) => {
264
- e.matrix_type === i.RECORD_NAME && e.row >= M && e.row < M + A && (t[e.row - M] = 1);
266
+ e.matrix_type === r.RECORD_NAME && e.row >= M && e.row < M + A && (t[e.row - M] = 1);
265
267
  };
266
268
  p && P && (p.positions.forEach((e) => H(e, P)), p.positions.forEach((e) => {
267
269
  I && U(e, I);
268
270
  }), w && F && (H(w, F), L && U(w, L))), b.font = "12px monospace", b.textAlign = "center", b.textBaseline = "middle";
269
- for (let t = 0; t < A; t++) {
270
- let i = (M + t) * n + E - f;
271
- if (!(i + n < E || i > _)) for (let a = 0; a < k; a++) {
272
- let o = (j + a) * s + D - d;
273
- if (o + s < D || o > v) continue;
274
- let l = O[t * k + a], u = j + a, f = M + t, p = l ?? "", m = String.fromCharCode(p), h = e.paletteEntryFor(c, m), g = h.background;
271
+ for (let e = 0; e < A; e++) {
272
+ let r = (M + e) * t + E - f;
273
+ if (!(r + t < E || r > _)) for (let a = 0; a < k; a++) {
274
+ let s = (j + a) * o + D - d;
275
+ if (s + o < D || s > v) continue;
276
+ let l = O[e * k + a], u = j + a, f = M + e, p = l ?? "", m = String.fromCharCode(p), h = i.paletteEntryFor(c, m), g = h.background;
275
277
  l === null ? g = "#e9eef2" : m === " " && (g = "#f7f8f9");
276
278
  let _ = h.foreground;
277
279
  C(f, u) && (g = h.backgroundSelected, _ = h.foregroundSelected);
278
- let x = t * k + a, S = P?.[x] === 1, w = F?.[x] === 1, T = new Path2D();
279
- T.rect(o, i, s, n), T.closePath(), y.cells.pathPropertiesMap.set(T, {
280
+ let x = e * k + a, S = P?.[x] === 1, w = F?.[x] === 1, T = new Path2D();
281
+ T.rect(s, r, o, t), T.closePath(), y.cells.pathPropertiesMap.set(T, {
280
282
  col: u,
281
283
  row: f,
282
- type: r.CELL
283
- }), b.fillStyle = g, b.fill(T), (w || L?.[t] === 1) && (b.fillStyle = "rgba(255, 193, 7, 0.35)", b.fillRect(o + 2, i + 2, Math.max(0, s - 4), Math.max(0, n - 4))), b.fillStyle = _, b.fillText(m, o + s / 2, i + n / 2), (S || I?.[t] === 1) && R && (B = !0, R.rect(o + .5, i + .5, s - 1, n - 1), (w || L?.[t] === 1) && z && (V = !0, z.rect(o + 1, i + 1, s - 2, n - 2)));
284
+ type: n.CELL
285
+ }), b.fillStyle = g, b.fill(T), (w || L?.[e] === 1) && (b.fillStyle = "rgba(255, 193, 7, 0.35)", b.fillRect(s + 2, r + 2, Math.max(0, o - 4), Math.max(0, t - 4))), b.fillStyle = _, b.fillText(m, s + o / 2, r + t / 2), (S || I?.[e] === 1) && R && (B = !0, R.rect(s + .5, r + .5, o - 1, t - 1), (w || L?.[e] === 1) && z && (V = !0, z.rect(s + 1, r + 1, o - 2, t - 2)));
284
286
  }
285
287
  }
286
288
  B && R && (b.strokeStyle = "#000000", b.lineWidth = 1, b.stroke(R)), V && z && (b.lineWidth = 2, b.stroke(z)), b.fillStyle = "#edf2f6", b.fillRect(0, 0, v, E), b.font = "12px monospace", b.textBaseline = "middle";
287
- let G = [];
289
+ let W = [];
288
290
  b.strokeStyle = "#9fb3c8", b.lineWidth = 1, b.beginPath();
289
291
  for (let e = 0; e < k; e++) {
290
292
  let t = (j + e + 1) % 10 == 0;
291
- t && G.push(e);
292
- let n = (j + e) * s + D - d, i = new Path2D();
293
- i.rect(n, 0, s, E), i.closePath(), y.ruler.pathPropertiesMap.set(i, {
293
+ t && W.push(e);
294
+ let r = (j + e) * o + D - d, i = new Path2D();
295
+ i.rect(r, 0, o, E), i.closePath(), y.ruler.pathPropertiesMap.set(i, {
294
296
  col: j + e,
295
- type: r.RULER
297
+ type: n.RULER
296
298
  });
297
- let a = n + .5, o = t ? 8 : 4;
298
- b.moveTo(a, E), b.lineTo(a, E - o);
299
+ let a = r + .5, s = t ? 8 : 4;
300
+ b.moveTo(a, E), b.lineTo(a, E - s);
299
301
  }
300
- b.stroke(), b.fillStyle = "#486581", b.textAlign = "center", G.forEach((e) => {
301
- let t = (j + e) * s + D - d, n = String(j + e + 1), r = b.measureText(n).width;
302
+ b.stroke(), b.fillStyle = "#486581", b.textAlign = "center", W.forEach((e) => {
303
+ let t = (j + e) * o + D - d, n = String(j + e + 1), r = b.measureText(n).width;
302
304
  t - r / 2 < D || t + r / 2 > v || b.fillText(n, t, E / 2);
303
305
  }), b.textAlign = "start", b.strokeStyle = "#bcccdc", b.lineWidth = 1, b.beginPath(), b.moveTo(D + .5, 0), b.lineTo(D + .5, _), b.moveTo(0, E + .5), b.lineTo(v, E + .5), b.stroke(), b.fillStyle = "#edf2f6", b.fillRect(0, 0, D, E), b.fillStyle = "#d9e2ec", b.fillRect(T, 0, m, _);
304
- let K = new Path2D();
305
- K.rect(T, 0, m, _), K.closePath(), y.divider.pathPropertiesMap.set(K, { type: r.DIVIDER }), b.fillStyle = "#f8fafb", b.fillRect(0, E, T, _ - E), b.font = "12px monospace", b.textBaseline = "middle", b.save(), b.beginPath(), b.rect(0, E, T, _ - E), b.clip();
306
+ let G = new Path2D();
307
+ G.rect(T, 0, m, _), G.closePath(), y.divider.pathPropertiesMap.set(G, { type: n.DIVIDER }), b.fillStyle = "#f8fafb", b.fillRect(0, E, T, _ - E), b.font = "12px monospace", b.textBaseline = "middle", b.save(), b.beginPath(), b.rect(0, E, T, _ - E), b.clip();
306
308
  for (let e = 0; e < A; e++) {
307
- let t = (M + e) * n + E - f;
308
- if (t + n < E || t > _) continue;
309
+ let r = (M + e) * t + E - f;
310
+ if (r + t < E || r > _) continue;
309
311
  let i = new Path2D();
310
- i.rect(0, t, T, n), i.closePath(), y.labels.pathPropertiesMap.set(i, {
312
+ i.rect(0, r, T, t), i.closePath(), y.labels.pathPropertiesMap.set(i, {
311
313
  row: M + e,
312
- type: r.LABEL
314
+ type: n.LABEL
313
315
  });
314
316
  let a = M + e - u, o = M + e, s = I?.[e] === 1, c = L?.[e] === 1, d = !!h?.cols || !!(h?.cells && o >= h.cells.startRow && o <= h.cells.endRow) || S(o);
315
- b.fillStyle = d ? "#1565c0" : "#f8fafb", b.fillRect(0, t, T, n), s && (b.fillStyle = "#ffecb3", b.fillRect(0, t, T, n)), c && (b.fillStyle = "rgba(255, 193, 7, 0.35)", b.fillRect(2, t + 2, Math.max(0, T - 4), Math.max(0, n - 4))), b.fillStyle = d ? "#ffffff" : "#334e68", b.fillText(`${(0, W.default)(String(M + e + 1), x, "0")}: ${l[a] ?? ""}`, 8, t + n / 2);
317
+ b.fillStyle = d ? "#1565c0" : "#f8fafb", b.fillRect(0, r, T, t), s && (b.fillStyle = "#ffecb3", b.fillRect(0, r, T, t)), c && (b.fillStyle = "rgba(255, 193, 7, 0.35)", b.fillRect(2, r + 2, Math.max(0, T - 4), Math.max(0, t - 4))), b.fillStyle = d ? "#ffffff" : "#334e68", b.fillText(`${(0, K.default)(String(M + e + 1), x, "0")}: ${l[a] ?? ""}`, 8, r + t / 2);
316
318
  }
317
319
  b.restore();
318
320
  }), y;
319
321
  }
320
- static getExpandedSelection(e, t, r, i) {
322
+ static getExpandedSelection(e, n, r, i) {
321
323
  let a = e.cells;
322
324
  if (a) {
323
- if (r === n.LEFT) {
324
- let e = t.cells;
325
+ if (r === t.LEFT) {
326
+ let e = n.cells;
325
327
  if (!e) return null;
326
- let n = a.startCol < e.startCol || a.endCol <= e.startCol, r = n ? a.startCol - 1 : a.startCol, i = n ? a.endCol : a.endCol - 1;
328
+ let t = a.startCol < e.startCol || a.endCol <= e.startCol, r = t ? a.startCol - 1 : a.startCol, i = t ? a.endCol : a.endCol - 1;
327
329
  return r < 0 ? null : { cells: {
328
330
  ...a,
329
331
  endCol: i,
330
332
  startCol: r
331
333
  } };
332
334
  }
333
- if (r === n.RIGHT) {
334
- let e = t.cells;
335
+ if (r === t.RIGHT) {
336
+ let e = n.cells;
335
337
  if (!e) return null;
336
- let n = a.startCol < e.startCol ? a.startCol + 1 : a.startCol, r = a.startCol < e.startCol ? a.endCol : a.endCol + 1;
338
+ let t = a.startCol < e.startCol ? a.startCol + 1 : a.startCol, r = a.startCol < e.startCol ? a.endCol : a.endCol + 1;
337
339
  return r >= i.alignmentWidth ? null : { cells: {
338
340
  ...a,
339
341
  endCol: r,
340
- startCol: n
342
+ startCol: t
341
343
  } };
342
344
  }
343
- if (r === n.UP) {
344
- let e = t.cells;
345
+ if (r === t.UP) {
346
+ let e = n.cells;
345
347
  if (!e) return null;
346
- let n = a.startRow < e.startRow || a.endRow <= e.startRow, r = n ? a.startRow - 1 : a.startRow, i = n ? a.endRow : a.endRow - 1;
348
+ let t = a.startRow < e.startRow || a.endRow <= e.startRow, r = t ? a.startRow - 1 : a.startRow, i = t ? a.endRow : a.endRow - 1;
347
349
  return r < 0 ? null : { cells: {
348
350
  ...a,
349
351
  endRow: i,
350
352
  startRow: r
351
353
  } };
352
354
  }
353
- let e = t.cells;
355
+ let e = n.cells;
354
356
  if (!e) return null;
355
357
  let o = a.startRow < e.startRow ? a.startRow + 1 : a.startRow, s = a.startRow < e.startRow ? a.endRow : a.endRow + 1;
356
358
  return s >= i.sequenceCount ? null : { cells: {
@@ -361,18 +363,18 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
361
363
  }
362
364
  let o = e.cols;
363
365
  if (o) {
364
- if (o.length === 0 || r !== n.LEFT && r !== n.RIGHT) return null;
365
- let e = Math.min(...o), a = Math.max(...o), s = t.cols;
366
+ if (o.length === 0 || r !== t.LEFT && r !== t.RIGHT) return null;
367
+ let e = Math.min(...o), a = Math.max(...o), s = n.cols;
366
368
  if (!s || s.length === 0) return null;
367
369
  let c = Math.min(...s);
368
- return r === n.LEFT ? a > c ? { cols: o.slice(0, -1) } : e > 0 ? { cols: [e - 1, ...o] } : null : e < c ? { cols: o.slice(1) } : a < i.alignmentWidth - 1 ? { cols: [...o, a + 1] } : null;
370
+ return r === t.LEFT ? a > c ? { cols: o.slice(0, -1) } : e > 0 ? { cols: [e - 1, ...o] } : null : e < c ? { cols: o.slice(1) } : a < i.alignmentWidth - 1 ? { cols: [...o, a + 1] } : null;
369
371
  }
370
372
  return e.rows ? e : null;
371
373
  }
372
- static getMovedRowsEndSelection(e, t, r) {
374
+ static getMovedRowsEndSelection(e, n, r) {
373
375
  if (!e || !r) return null;
374
- let i = t === n.UP ? 0 : r.sequenceCount;
375
- return a.getMovedRowsGroupedSelection(e, i, r);
376
+ let i = n === t.UP ? 0 : r.sequenceCount;
377
+ return s.getMovedRowsGroupedSelection(e, i, r);
376
378
  }
377
379
  static getMovedRowsGroupedSelection(e, t, n) {
378
380
  if (!e || !n) return null;
@@ -392,13 +394,13 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
392
394
  }
393
395
  return null;
394
396
  }
395
- static getMovedRowsRelativeSelection(e, t, r) {
397
+ static getMovedRowsRelativeSelection(e, n, r) {
396
398
  if (!e || !r) return null;
397
399
  let i = e.cells;
398
400
  if (i) {
399
- let a = t === n.UP && i.startRow > 0, o = t === n.DOWN && i.endRow < r.sequenceCount - 1;
401
+ let a = n === t.UP && i.startRow > 0, o = n === t.DOWN && i.endRow < r.sequenceCount - 1;
400
402
  if (!a && !o) return e;
401
- let s = t === n.UP ? -1 : 1;
403
+ let s = n === t.UP ? -1 : 1;
402
404
  return { cells: {
403
405
  ...i,
404
406
  endRow: i.endRow + s,
@@ -408,8 +410,8 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
408
410
  let a = e.rows;
409
411
  if (a && a.length > 0) {
410
412
  let e = [...new Set(a)].sort((e, t) => e - t), i = e.length;
411
- if (t === n.UP) return { rows: e.map((e, t) => Math.max(t, e - 1)) };
412
- if (t === n.DOWN) {
413
+ if (n === t.UP) return { rows: e.map((e, t) => Math.max(t, e - 1)) };
414
+ if (n === t.DOWN) {
413
415
  let t = r.sequenceCount - i;
414
416
  return { rows: e.map((e, n) => Math.min(t + n, e + 1)) };
415
417
  }
@@ -417,24 +419,24 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
417
419
  }
418
420
  return null;
419
421
  }
420
- static getMovedSelection(e, t, r) {
422
+ static getMovedSelection(e, n, r) {
421
423
  if (!e || !r) return null;
422
- let i = t === n.LEFT || t === n.UP ? -1 : 1, o = (e, t, n) => i < 0 ? e > 0 : t < n - 1, s = e.cells;
423
- if (s) return t === n.LEFT || t === n.RIGHT ? o(s.startCol, s.endCol, r.alignmentWidth) ? { cells: {
424
- endCol: s.endCol + i,
425
- endRow: s.endRow,
426
- startCol: s.startCol + i,
427
- startRow: s.startRow
428
- } } : null : o(s.startRow, s.endRow, r.sequenceCount) ? { cells: {
429
- endCol: s.endCol,
430
- endRow: s.endRow + i,
431
- startCol: s.startCol,
432
- startRow: s.startRow + i
424
+ let i = n === t.LEFT || n === t.UP ? -1 : 1, a = (e, t, n) => i < 0 ? e > 0 : t < n - 1, o = e.cells;
425
+ if (o) return n === t.LEFT || n === t.RIGHT ? a(o.startCol, o.endCol, r.alignmentWidth) ? { cells: {
426
+ endCol: o.endCol + i,
427
+ endRow: o.endRow,
428
+ startCol: o.startCol + i,
429
+ startRow: o.startRow
430
+ } } : null : a(o.startRow, o.endRow, r.sequenceCount) ? { cells: {
431
+ endCol: o.endCol,
432
+ endRow: o.endRow + i,
433
+ startCol: o.startCol,
434
+ startRow: o.startRow + i
433
435
  } } : null;
434
436
  let c = e.cols;
435
- if (c) return t !== n.LEFT && t !== n.RIGHT || c.length === 0 || !o(Math.min(...c), Math.max(...c), r.alignmentWidth) ? null : { cols: c.map((e) => e + i) };
437
+ if (c) return n !== t.LEFT && n !== t.RIGHT || c.length === 0 || !a(Math.min(...c), Math.max(...c), r.alignmentWidth) ? null : { cols: c.map((e) => e + i) };
436
438
  let l = e.rows;
437
- return l ? t !== n.UP && t !== n.DOWN || l.length === 0 ? null : a.getMovedRowsRelativeSelection(e, t, r) : null;
439
+ return l ? n !== t.UP && n !== t.DOWN || l.length === 0 ? null : s.getMovedRowsRelativeSelection(e, n, r) : null;
438
440
  }
439
441
  static getMutateArguments(e, t, n = 0) {
440
442
  let r = e?.cells;
@@ -457,16 +459,36 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
457
459
  };
458
460
  }
459
461
  static getPathPropertiesFromCanvas(e) {
460
- let { canvas: t, devicePixelRatio: n, editorAssembly: r, event: i } = e, o = a.getCanvasContext(t), s = t.getBoundingClientRect(), c = t.width / s.width, l = t.height / s.height, u = (i.clientX - s.left) * c / n, d = (i.clientY - s.top) * l / n;
461
- for (let [e, t] of r.cells.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
462
- for (let [e, t] of r.ruler.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
463
- for (let [e, t] of r.labels.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
464
- for (let [e, t] of r.divider.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
462
+ let { canvas: t, devicePixelRatio: n, editorAssembly: r, event: i } = e, a = s.getCanvasContext(t), o = t.getBoundingClientRect(), c = t.width / o.width, l = t.height / o.height, u = (i.clientX - o.left) * c / n, d = (i.clientY - o.top) * l / n;
463
+ for (let [e, t] of r.ruler.pathPropertiesMap) if (a.isPointInPath(e, u, d)) return t;
464
+ for (let [e, t] of r.labels.pathPropertiesMap) if (a.isPointInPath(e, u, d)) return t;
465
+ for (let [e, t] of r.divider.pathPropertiesMap) if (a.isPointInPath(e, u, d)) return t;
466
+ for (let [e, t] of r.cells.pathPropertiesMap) if (a.isPointInPath(e, u, d)) return t;
467
+ }
468
+ static getPostDeleteRowsSelection(e, t) {
469
+ let n = e?.rows;
470
+ if (!n?.length) return null;
471
+ let r = Array.from(new Set(n.filter((e) => Number.isInteger(e) && e >= 0 && e < t))).sort((e, t) => e - t);
472
+ if (r.length === 0) return null;
473
+ let i = t - r.length;
474
+ if (i === 0) return null;
475
+ let a = Math.min(r[0], i - 1), o = Math.min(r.length, i - a);
476
+ return { rows: Array.from({ length: o }, (e, t) => a + t) };
477
+ }
478
+ static getPostPasteSequencesSelection(e, t) {
479
+ if (!e) return null;
480
+ let n = t.trim().split("\n").filter((e) => e.startsWith(">")).map((e, t) => t);
481
+ return e.cols ? { cols: e.cols } : e.rows ? { rows: e.rows.map((e) => e + n.length) } : e.cells ? { cells: {
482
+ endCol: e.cells.endCol,
483
+ endRow: e.cells.endRow + n.length,
484
+ startCol: e.cells.startCol,
485
+ startRow: e.cells.startRow + n.length
486
+ } } : null;
465
487
  }
466
- static getPostUpsertSelection(e, t) {
488
+ static getPostUpsertSelection(e, n) {
467
489
  if (!e) return null;
468
- if (t !== n.LEFT && t !== n.RIGHT) return e;
469
- let r = t === n.LEFT ? -1 : 1, i = e.cells;
490
+ if (n !== t.LEFT && n !== t.RIGHT) return e;
491
+ let r = n === t.LEFT ? -1 : 1, i = e.cells;
470
492
  if (i) {
471
493
  let t = i.startCol + r, n = i.endCol + r;
472
494
  return t < 0 ? e : { cells: {
@@ -484,32 +506,47 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
484
506
  let o = e.rows;
485
507
  return o ? { rows: o } : null;
486
508
  }
487
- static getRowsToMove(e, t, r) {
509
+ static getRowsToMove(e, n, r) {
488
510
  let i = e?.cells, a = e?.rows ?? (i ? Array.from({ length: i.endRow - i.startRow + 1 }, (e, t) => i.startRow + t) : void 0);
489
511
  if (!a || a.length === 0) return;
490
512
  let o = [...new Set(a)].sort((e, t) => e - t), s = o.length;
491
513
  if (s !== 0 && s !== r.sequenceCount) {
492
- if (t === n.UP) {
514
+ if (n === t.UP) {
493
515
  if (o.every((e, t) => e === t)) return;
494
- } else if (t === n.DOWN && o.every((e, t) => e === r.sequenceCount - s + t)) return;
516
+ } else if (n === t.DOWN && o.every((e, t) => e === r.sequenceCount - s + t)) return;
495
517
  return a;
496
518
  }
497
519
  }
520
+ static getSelectedFasta(e, t) {
521
+ if (!t) return "";
522
+ let n = o.parseFasta(e);
523
+ if (n.error) throw Error(n.error);
524
+ let r = (e) => [...new Set(e)].filter((e) => Number.isInteger(e) && e >= 0 && e < n.sequences.length).sort((e, t) => e - t).map((e) => n.sequences[e].sequence), i;
525
+ if (t.cells) {
526
+ let { endCol: e, endRow: n, startCol: a, startRow: o } = t.cells, s = Math.min(o, n), c = Math.max(o, n), l = Math.min(a, e), u = Math.max(a, e);
527
+ i = r(Array.from({ length: c - s + 1 }, (e, t) => s + t)).map((e) => e.slice(l, u + 1));
528
+ } else if (t.cols) {
529
+ let e = [...new Set(t.cols)].filter((e) => Number.isInteger(e) && e >= 0).sort((e, t) => e - t);
530
+ if (e.length === 0) return "";
531
+ i = r(Array.from({ length: n.sequences.length }, (e, t) => t)).map((t) => e.map((e) => t[e] ?? "").join(""));
532
+ } else i = r(t.rows ?? []);
533
+ return i.map((e) => `>${a.createUuid()}\n${e}\n`).join("");
534
+ }
498
535
  static getSelectionFromPathProperties(e) {
499
- let { endPath: t, startPath: n } = e;
500
- if (n.type === r.RULER && (t.type === r.RULER || t.type === r.CELL)) {
501
- let e = Math.min(n.col, t.col), r = Math.max(n.col, t.col);
502
- return { cols: Array.from({ length: r - e + 1 }, (t, n) => e + n) };
536
+ let { endPath: t, startPath: r } = e;
537
+ if (r.type === n.RULER && (t.type === n.RULER || t.type === n.CELL)) {
538
+ let e = Math.min(r.col, t.col), n = Math.max(r.col, t.col);
539
+ return { cols: Array.from({ length: n - e + 1 }, (t, n) => e + n) };
503
540
  }
504
- if (n.type === r.CELL && t.type === r.CELL) return { cells: {
505
- endCol: Math.max(n.col, t.col),
506
- endRow: Math.max(n.row, t.row),
507
- startCol: Math.min(n.col, t.col),
508
- startRow: Math.min(n.row, t.row)
541
+ if (r.type === n.CELL && t.type === n.CELL) return { cells: {
542
+ endCol: Math.max(r.col, t.col),
543
+ endRow: Math.max(r.row, t.row),
544
+ startCol: Math.min(r.col, t.col),
545
+ startRow: Math.min(r.row, t.row)
509
546
  } };
510
- if (n.type === r.LABEL && t.type === r.LABEL) {
511
- let e = Math.min(n.row, t.row), r = Math.max(n.row, t.row);
512
- return { rows: Array.from({ length: r - e + 1 }, (t, n) => e + n) };
547
+ if (r.type === n.LABEL && t.type === n.LABEL) {
548
+ let e = Math.min(r.row, t.row), n = Math.max(r.row, t.row);
549
+ return { rows: Array.from({ length: n - e + 1 }, (t, n) => e + n) };
513
550
  }
514
551
  }
515
552
  static getStatusBarSelectionStats(e, t = null) {
@@ -562,8 +599,8 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
562
599
  rows: a
563
600
  };
564
601
  }
565
- static getVisibleGridRange(e) {
566
- let { geometry: n = t, numCols: r, numRows: i, scrollLeft: a, scrollTop: o, viewportHeight: s, viewportWidth: c } = e, l = n.labelWidth + n.dividerWidth, u = Math.max(0, Math.floor(a / n.cellWidth)), d = Math.min(r, u + Math.max(1, Math.ceil((c - l) / n.cellWidth) + 1)), f = Math.max(0, Math.floor(Math.max(0, o - n.rulerHeight) / n.cellHeight)), p = Math.min(i, f + Math.max(1, Math.ceil((s - n.rulerHeight) / n.cellHeight) + 1));
602
+ static getVisibleGridRange(t) {
603
+ let { geometry: n = e, numCols: r, numRows: i, scrollLeft: a, scrollTop: o, viewportHeight: s, viewportWidth: c } = t, l = n.labelWidth + n.dividerWidth, u = Math.max(0, Math.floor(a / n.cellWidth)), d = Math.min(r, u + Math.max(1, Math.ceil((c - l) / n.cellWidth) + 1)), f = Math.max(0, Math.floor(Math.max(0, o - n.rulerHeight) / n.cellHeight)), p = Math.min(i, f + Math.max(1, Math.ceil((s - n.rulerHeight) / n.cellHeight) + 1));
567
604
  return {
568
605
  cache: {
569
606
  endCol: Math.min(r, d + n.numOverscanCols),
@@ -591,16 +628,16 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
591
628
  });
592
629
  }
593
630
  static scrollToSearchResult(e) {
594
- let { geometry: t, scrollContainer: n, searchResult: r, searchResultHighlightedIndex: i } = e, o = r && i !== null ? a.searchHitAt(r, i) : null;
595
- o && a.scrollToPosition({
631
+ let { geometry: t, scrollContainer: n, searchResult: r, searchResultHighlightedIndex: i } = e, a = r && i !== null ? s.searchHitAt(r, i) : null;
632
+ a && s.scrollToPosition({
596
633
  geometry: t,
597
634
  scrollContainer: n,
598
- x: o.col + 1,
599
- y: o.row + 1
635
+ x: a.col + 1,
636
+ y: a.row + 1
600
637
  });
601
638
  }
602
639
  static draw(e, t, n) {
603
- let r = a.getCanvasContext(e);
640
+ let r = s.getCanvasContext(e);
604
641
  r.setTransform(t, 0, 0, t, 0, 0), n(r), r.setTransform(1, 0, 0, 1, 0, 0);
605
642
  }
606
643
  static getCanvasContext(e) {
@@ -611,10 +648,10 @@ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescr
611
648
  static searchHitAt(e, t) {
612
649
  return e?.positions[t] ?? null;
613
650
  }
614
- static searchHitContainsCell(e, t, n, r) {
615
- return e.matrix_type === i.NUCLEOTIDE && e.row === n && r >= e.col && r < e.col + Math.max(1, t.length);
651
+ static searchHitContainsCell(e, t, n, i) {
652
+ return e.matrix_type === r.NUCLEOTIDE && e.row === n && i >= e.col && i < e.col + Math.max(1, t.length);
616
653
  }
617
654
  };
618
- export { G as EditorUtil };
655
+ export { q as EditorUtil };
619
656
 
620
657
  //# sourceMappingURL=index.js.map