@rivm-loculus-tools/sequence-editor 0.1.5 → 0.1.7

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 (61) hide show
  1. package/dist/_chunks/EditorWorkerService.js +12 -11
  2. package/dist/_chunks/EditorWorkerService.js.map +1 -1
  3. package/dist/_chunks/SequenceEditor.js +362 -489
  4. package/dist/_chunks/SequenceEditor.js.map +1 -1
  5. package/dist/_chunks/SequenceEditorPageDrawer.js +160 -49577
  6. package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
  7. package/dist/_chunks/comlink.js +228 -0
  8. package/dist/_chunks/comlink.js.map +1 -0
  9. package/dist/_chunks/react.js +11 -0
  10. package/dist/_chunks/react.js.map +1 -0
  11. package/dist/_chunks/sequenceEditorStore.js +40 -273
  12. package/dist/_chunks/sequenceEditorStore.js.map +1 -1
  13. package/dist/assets/index-Dn92arD_.js +8 -0
  14. package/dist/assets/index-Dn92arD_.js.map +1 -0
  15. package/dist/classes/services/SequenceEditorEventBusService/index.js +16 -2
  16. package/dist/classes/services/SequenceEditorEventBusService/index.js.map +1 -0
  17. package/dist/classes/workers/EngineWorker/index.js +3 -2
  18. package/dist/classes/workers/EngineWorker/index.js.map +1 -1
  19. package/dist/components/app/App/index.js +15 -951
  20. package/dist/components/app/App/index.js.map +1 -1
  21. package/dist/components/pages/SequenceEditorErrorPage/index.js +6 -6
  22. package/dist/components/pages/SequenceEditorErrorPage/index.js.map +1 -1
  23. package/dist/components/pages/SequenceEditorMainPage/index.js +61 -2
  24. package/dist/components/pages/SequenceEditorMainPage/index.js.map +1 -0
  25. package/dist/components/ui/SequenceEditorPage/index.js +8 -8
  26. package/dist/components/ui/SequenceEditorPage/index.js.map +1 -1
  27. package/dist/components/ui/SequenceEditorPageHeader/index.js +60 -2
  28. package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -0
  29. package/dist/components/ui/SequenceEditorSearchBar/index.js +27 -2
  30. package/dist/components/ui/SequenceEditorSearchBar/index.js.map +1 -0
  31. package/dist/constants/keyboard.js +1 -1
  32. package/dist/utils/EditorUtil/index.js +158 -150
  33. package/dist/utils/EditorUtil/index.js.map +1 -1
  34. package/package.json +44 -21
  35. package/dist/_chunks/Box.js +0 -6737
  36. package/dist/_chunks/Box.js.map +0 -1
  37. package/dist/_chunks/Close.js +0 -7
  38. package/dist/_chunks/Close.js.map +0 -1
  39. package/dist/_chunks/KeyboardArrowDown.js +0 -1023
  40. package/dist/_chunks/KeyboardArrowDown.js.map +0 -1
  41. package/dist/_chunks/Redo.js +0 -2559
  42. package/dist/_chunks/Redo.js.map +0 -1
  43. package/dist/_chunks/SequenceEditorEventBusService.js +0 -102
  44. package/dist/_chunks/SequenceEditorEventBusService.js.map +0 -1
  45. package/dist/_chunks/SequenceEditorMainPage.js +0 -552
  46. package/dist/_chunks/SequenceEditorMainPage.js.map +0 -1
  47. package/dist/_chunks/SequenceEditorPageHeader.js +0 -236
  48. package/dist/_chunks/SequenceEditorPageHeader.js.map +0 -1
  49. package/dist/_chunks/SequenceEditorSearchBar.js +0 -143
  50. package/dist/_chunks/SequenceEditorSearchBar.js.map +0 -1
  51. package/dist/_chunks/TestIdUtil.js +0 -4695
  52. package/dist/_chunks/TestIdUtil.js.map +0 -1
  53. package/dist/_chunks/TextField.js +0 -3083
  54. package/dist/_chunks/TextField.js.map +0 -1
  55. package/dist/_chunks/rolldown-runtime.js +0 -13
  56. package/dist/_chunks/sequence_editor.js +0 -517
  57. package/dist/_chunks/sequence_editor.js.map +0 -1
  58. package/dist/_chunks/withDialog.js +0 -289
  59. package/dist/_chunks/withDialog.js.map +0 -1
  60. package/dist/assets/index-C5rc-pJV.js +0 -8
  61. package/dist/assets/index-C5rc-pJV.js.map +0 -1
@@ -1,11 +1,19 @@
1
- import { n as e, t } from "../../_chunks/rolldown-runtime.js";
2
- import { PaletteUtil as n } from "../PaletteUtil/index.js";
3
- import { EDITOR_DIRECTION as r } from "../../models/editor.js";
4
- import { EDITOR_PATH_PROPERTIES_TYPE as i, MATRIX_TYPE as a } from "../../models/model.js";
5
- import { DEFAULT_GRID_GEOMETRY as o } from "../../constants/editor.js";
1
+ import { PaletteUtil as e } from "../PaletteUtil/index.js";
2
+ import { EDITOR_DIRECTION as t } from "../../models/editor.js";
3
+ import { EDITOR_PATH_PROPERTIES_TYPE as n, MATRIX_TYPE as r } from "../../models/model.js";
4
+ import { DEFAULT_GRID_GEOMETRY as i } from "../../constants/editor.js";
6
5
  import "../../constants/index.js";
7
- //#region ../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseRepeat.js
8
- var s = /* @__PURE__ */ t(((e, t) => {
6
+ //#region \0rolldown/runtime.js
7
+ 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), e = null), t.exports), f = (e, t, n, r) => {
8
+ 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, {
9
+ get: ((e) => t[e]).bind(null, d),
10
+ enumerable: !(r = s(t, d)) || r.enumerable
11
+ });
12
+ return e;
13
+ }, p = (e, t, n) => (n = e == null ? {} : a(l(e)), f(t || !e || !e.__esModule || !u.call(e, "default") ? o(n, "default", {
14
+ value: e,
15
+ enumerable: !0
16
+ }) : n, e)), m = /* @__PURE__ */ d(((e, t) => {
9
17
  var n = Math.floor;
10
18
  function r(e, t) {
11
19
  var r = "";
@@ -16,23 +24,23 @@ var s = /* @__PURE__ */ t(((e, t) => {
16
24
  return r;
17
25
  }
18
26
  t.exports = r;
19
- })), c = /* @__PURE__ */ t(((e, t) => {
27
+ })), h = /* @__PURE__ */ d(((e, t) => {
20
28
  t.exports = typeof global == "object" && global && global.Object === Object && global;
21
- })), l = /* @__PURE__ */ t(((e, t) => {
22
- var n = c(), r = typeof self == "object" && self && self.Object === Object && self;
29
+ })), g = /* @__PURE__ */ d(((e, t) => {
30
+ var n = h(), r = typeof self == "object" && self && self.Object === Object && self;
23
31
  t.exports = n || r || Function("return this")();
24
- })), u = /* @__PURE__ */ t(((e, t) => {
25
- t.exports = l().Symbol;
26
- })), d = /* @__PURE__ */ t(((e, t) => {
32
+ })), _ = /* @__PURE__ */ d(((e, t) => {
33
+ t.exports = g().Symbol;
34
+ })), v = /* @__PURE__ */ d(((e, t) => {
27
35
  function n(e, t) {
28
36
  for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
29
37
  return i;
30
38
  }
31
39
  t.exports = n;
32
- })), f = /* @__PURE__ */ t(((e, t) => {
40
+ })), y = /* @__PURE__ */ d(((e, t) => {
33
41
  t.exports = Array.isArray;
34
- })), p = /* @__PURE__ */ t(((e, t) => {
35
- var n = u(), r = Object.prototype, i = r.hasOwnProperty, a = r.toString, o = n ? n.toStringTag : void 0;
42
+ })), b = /* @__PURE__ */ d(((e, t) => {
43
+ var n = _(), r = Object.prototype, i = r.hasOwnProperty, a = r.toString, o = n ? n.toStringTag : void 0;
36
44
  function s(e) {
37
45
  var t = i.call(e, o), n = e[o];
38
46
  try {
@@ -43,31 +51,31 @@ var s = /* @__PURE__ */ t(((e, t) => {
43
51
  return r && (t ? e[o] = n : delete e[o]), s;
44
52
  }
45
53
  t.exports = s;
46
- })), m = /* @__PURE__ */ t(((e, t) => {
54
+ })), x = /* @__PURE__ */ d(((e, t) => {
47
55
  var n = Object.prototype.toString;
48
56
  function r(e) {
49
57
  return n.call(e);
50
58
  }
51
59
  t.exports = r;
52
- })), h = /* @__PURE__ */ t(((e, t) => {
53
- var n = u(), r = p(), i = m(), a = "[object Null]", o = "[object Undefined]", s = n ? n.toStringTag : void 0;
60
+ })), S = /* @__PURE__ */ d(((e, t) => {
61
+ var n = _(), r = b(), i = x(), a = "[object Null]", o = "[object Undefined]", s = n ? n.toStringTag : void 0;
54
62
  function c(e) {
55
63
  return e == null ? e === void 0 ? o : a : s && s in Object(e) ? r(e) : i(e);
56
64
  }
57
65
  t.exports = c;
58
- })), g = /* @__PURE__ */ t(((e, t) => {
66
+ })), C = /* @__PURE__ */ d(((e, t) => {
59
67
  function n(e) {
60
68
  return typeof e == "object" && !!e;
61
69
  }
62
70
  t.exports = n;
63
- })), _ = /* @__PURE__ */ t(((e, t) => {
64
- var n = h(), r = g(), i = "[object Symbol]";
71
+ })), w = /* @__PURE__ */ d(((e, t) => {
72
+ var n = S(), r = C(), i = "[object Symbol]";
65
73
  function a(e) {
66
74
  return typeof e == "symbol" || r(e) && n(e) == i;
67
75
  }
68
76
  t.exports = a;
69
- })), v = /* @__PURE__ */ t(((e, t) => {
70
- var n = u(), r = d(), i = f(), a = _(), o = 1 / 0, s = n ? n.prototype : void 0, c = s ? s.toString : void 0;
77
+ })), T = /* @__PURE__ */ d(((e, t) => {
78
+ var n = _(), r = v(), i = y(), a = w(), o = 1 / 0, s = n ? n.prototype : void 0, c = s ? s.toString : void 0;
71
79
  function l(e) {
72
80
  if (typeof e == "string") return e;
73
81
  if (i(e)) return r(e, l) + "";
@@ -76,7 +84,7 @@ var s = /* @__PURE__ */ t(((e, t) => {
76
84
  return t == "0" && 1 / e == -o ? "-0" : t;
77
85
  }
78
86
  t.exports = l;
79
- })), y = /* @__PURE__ */ t(((e, t) => {
87
+ })), E = /* @__PURE__ */ d(((e, t) => {
80
88
  function n(e, t, n) {
81
89
  var r = -1, i = e.length;
82
90
  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;
@@ -84,29 +92,29 @@ var s = /* @__PURE__ */ t(((e, t) => {
84
92
  return a;
85
93
  }
86
94
  t.exports = n;
87
- })), b = /* @__PURE__ */ t(((e, t) => {
88
- var n = y();
95
+ })), D = /* @__PURE__ */ d(((e, t) => {
96
+ var n = E();
89
97
  function r(e, t, r) {
90
98
  var i = e.length;
91
99
  return r = r === void 0 ? i : r, !t && r >= i ? e : n(e, t, r);
92
100
  }
93
101
  t.exports = r;
94
- })), x = /* @__PURE__ */ t(((e, t) => {
102
+ })), O = /* @__PURE__ */ d(((e, t) => {
95
103
  var n = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");
96
104
  function r(e) {
97
105
  return n.test(e);
98
106
  }
99
107
  t.exports = r;
100
- })), S = /* @__PURE__ */ t(((e, t) => {
108
+ })), k = /* @__PURE__ */ d(((e, t) => {
101
109
  function n(e) {
102
110
  return function(t) {
103
111
  return t?.[e];
104
112
  };
105
113
  }
106
114
  t.exports = n;
107
- })), C = /* @__PURE__ */ t(((e, t) => {
108
- t.exports = S()("length");
109
- })), w = /* @__PURE__ */ t(((e, t) => {
115
+ })), A = /* @__PURE__ */ d(((e, t) => {
116
+ t.exports = k()("length");
117
+ })), j = /* @__PURE__ */ d(((e, t) => {
110
118
  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 + "(?:" + [
111
119
  l,
112
120
  u,
@@ -123,18 +131,18 @@ var s = /* @__PURE__ */ t(((e, t) => {
123
131
  return t;
124
132
  }
125
133
  t.exports = y;
126
- })), T = /* @__PURE__ */ t(((e, t) => {
127
- var n = C(), r = x(), i = w();
134
+ })), M = /* @__PURE__ */ d(((e, t) => {
135
+ var n = A(), r = O(), i = j();
128
136
  function a(e) {
129
137
  return r(e) ? i(e) : n(e);
130
138
  }
131
139
  t.exports = a;
132
- })), E = /* @__PURE__ */ t(((e, t) => {
140
+ })), N = /* @__PURE__ */ d(((e, t) => {
133
141
  function n(e) {
134
142
  return e.split("");
135
143
  }
136
144
  t.exports = n;
137
- })), D = /* @__PURE__ */ t(((e, t) => {
145
+ })), P = /* @__PURE__ */ d(((e, t) => {
138
146
  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 + "(?:" + [
139
147
  l,
140
148
  u,
@@ -150,43 +158,43 @@ var s = /* @__PURE__ */ t(((e, t) => {
150
158
  return e.match(v) || [];
151
159
  }
152
160
  t.exports = y;
153
- })), O = /* @__PURE__ */ t(((e, t) => {
154
- var n = E(), r = x(), i = D();
161
+ })), F = /* @__PURE__ */ d(((e, t) => {
162
+ var n = N(), r = O(), i = P();
155
163
  function a(e) {
156
164
  return r(e) ? i(e) : n(e);
157
165
  }
158
166
  t.exports = a;
159
- })), k = /* @__PURE__ */ t(((e, t) => {
160
- var n = s(), r = v(), i = b(), a = x(), o = T(), c = O(), l = Math.ceil;
161
- function u(e, t) {
167
+ })), I = /* @__PURE__ */ d(((e, t) => {
168
+ var n = m(), r = T(), i = D(), a = O(), o = M(), s = F(), c = Math.ceil;
169
+ function l(e, t) {
162
170
  t = t === void 0 ? " " : r(t);
163
- var s = t.length;
164
- if (s < 2) return s ? n(t, e) : t;
165
- var u = n(t, l(e / o(t)));
166
- return a(t) ? i(c(u), 0, e).join("") : u.slice(0, e);
171
+ var l = t.length;
172
+ if (l < 2) return l ? n(t, e) : t;
173
+ var u = n(t, c(e / o(t)));
174
+ return a(t) ? i(s(u), 0, e).join("") : u.slice(0, e);
167
175
  }
168
- t.exports = u;
169
- })), A = /* @__PURE__ */ t(((e, t) => {
176
+ t.exports = l;
177
+ })), L = /* @__PURE__ */ d(((e, t) => {
170
178
  var n = /\s/;
171
179
  function r(e) {
172
180
  for (var t = e.length; t-- && n.test(e.charAt(t)););
173
181
  return t;
174
182
  }
175
183
  t.exports = r;
176
- })), j = /* @__PURE__ */ t(((e, t) => {
177
- var n = A(), r = /^\s+/;
184
+ })), R = /* @__PURE__ */ d(((e, t) => {
185
+ var n = L(), r = /^\s+/;
178
186
  function i(e) {
179
187
  return e && e.slice(0, n(e) + 1).replace(r, "");
180
188
  }
181
189
  t.exports = i;
182
- })), M = /* @__PURE__ */ t(((e, t) => {
190
+ })), z = /* @__PURE__ */ d(((e, t) => {
183
191
  function n(e) {
184
192
  var t = typeof e;
185
193
  return e != null && (t == "object" || t == "function");
186
194
  }
187
195
  t.exports = n;
188
- })), N = /* @__PURE__ */ t(((e, t) => {
189
- var n = j(), r = M(), i = _(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
196
+ })), B = /* @__PURE__ */ d(((e, t) => {
197
+ 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;
190
198
  function u(e) {
191
199
  if (typeof e == "number") return e;
192
200
  if (i(e)) return a;
@@ -200,35 +208,35 @@ var s = /* @__PURE__ */ t(((e, t) => {
200
208
  return u || c.test(e) ? l(e.slice(2), u ? 2 : 8) : o.test(e) ? a : +e;
201
209
  }
202
210
  t.exports = u;
203
- })), P = /* @__PURE__ */ t(((e, t) => {
204
- var n = N(), r = 1 / 0, i = 17976931348623157e292;
211
+ })), V = /* @__PURE__ */ d(((e, t) => {
212
+ var n = B(), r = 1 / 0, i = 17976931348623157e292;
205
213
  function a(e) {
206
214
  return e ? (e = n(e), e === r || e === -r ? (e < 0 ? -1 : 1) * i : e === e ? e : 0) : e === 0 ? e : 0;
207
215
  }
208
216
  t.exports = a;
209
- })), F = /* @__PURE__ */ t(((e, t) => {
210
- var n = P();
217
+ })), H = /* @__PURE__ */ d(((e, t) => {
218
+ var n = V();
211
219
  function r(e) {
212
220
  var t = n(e), r = t % 1;
213
221
  return t === t ? r ? t - r : t : 0;
214
222
  }
215
223
  t.exports = r;
216
- })), I = /* @__PURE__ */ t(((e, t) => {
217
- var n = v();
224
+ })), U = /* @__PURE__ */ d(((e, t) => {
225
+ var n = T();
218
226
  function r(e) {
219
227
  return e == null ? "" : n(e);
220
228
  }
221
229
  t.exports = r;
222
- })), L = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
223
- var n = k(), r = T(), i = F(), a = I();
230
+ })), W = /* @__PURE__ */ p((/* @__PURE__ */ d(((e, t) => {
231
+ var n = I(), r = M(), i = H(), a = U();
224
232
  function o(e, t, o) {
225
233
  e = a(e), t = i(t);
226
234
  var s = t ? r(e) : 0;
227
235
  return t && s < t ? n(t - s, o) + e : e;
228
236
  }
229
237
  t.exports = o;
230
- })))(), 1), R = class e {
231
- static drawCanvas({ canvasElement: t, devicePixelRatio: r, geometry: a, meta: o, palette: s, rowNames: c, rowNamesStartRow: l, scrollLeft: u, scrollTop: d, searchResult: f, searchResultHighlightedIndex: p, selection: m, viewport: h, viewportHeight: g, viewportWidth: _ }) {
238
+ })))(), 1), G = class a {
239
+ static drawCanvas({ canvasElement: t, devicePixelRatio: r, geometry: i, meta: o, palette: s, rowNames: c, rowNamesStartRow: l, scrollLeft: u, scrollTop: d, searchResult: f, searchResultHighlightedIndex: p, selection: m, viewport: h, viewportHeight: g, viewportWidth: _ }) {
232
240
  let v = {
233
241
  cells: { pathPropertiesMap: /* @__PURE__ */ new Map() },
234
242
  divider: { pathPropertiesMap: /* @__PURE__ */ new Map() },
@@ -238,102 +246,102 @@ var s = /* @__PURE__ */ t(((e, t) => {
238
246
  if (!t) return v;
239
247
  let y = t.getContext("2d");
240
248
  if (!y) return v;
241
- let b = o.sequenceCount.toString().length, x = (e) => m?.rows?.includes(e) ?? !1, S = (e, t) => !!(m?.cells && t >= m.cells.startCol && t <= m.cells.endCol && e >= m.cells.startRow && e <= m.cells.endRow) || !!m?.cols?.includes(t) || !!x(e), C = f && p !== null ? e.searchHitAt(f, p) : null;
242
- return e.draw(t, r, () => {
249
+ let b = o.sequenceCount.toString().length, x = (e) => m?.rows?.includes(e) ?? !1, S = (e, t) => !!(m?.cells && t >= m.cells.startCol && t <= m.cells.endCol && e >= m.cells.startRow && e <= m.cells.endRow) || !!m?.cols?.includes(t) || !!x(e), C = f && p !== null ? a.searchHitAt(f, p) : null;
250
+ return a.draw(t, r, () => {
243
251
  y.clearRect(0, 0, t.width, t.height);
244
- let { cellHeight: r, cellWidth: o, dividerWidth: p, labelWidth: w, rulerHeight: T } = a, E = w + p, { bytes: D, cols: O, rows: k, startCol: A, startRow: j } = h, M = (f?.positions.length ?? 0) > 0, N = M ? new Uint8Array(k * O) : null, P = C ? new Uint8Array(k * O) : null, F = M ? new Path2D() : null, I = C ? new Path2D() : null, R = !1, z = !1, B = (t, n) => {
252
+ let { cellHeight: r, cellWidth: o, dividerWidth: p, labelWidth: w, rulerHeight: T } = i, E = w + p, { bytes: D, cols: O, rows: k, startCol: A, startRow: j } = h, M = (f?.positions.length ?? 0) > 0, N = M ? new Uint8Array(k * O) : null, P = C ? new Uint8Array(k * O) : null, F = M ? new Path2D() : null, I = C ? new Path2D() : null, L = !1, R = !1, z = (e, t) => {
245
253
  if (!f) return;
246
- let r = Math.max(1, f.query.length), i = Math.max(A, t.col), a = Math.min(A + O, t.col + r), o = t.row - j;
247
- if (o < 0 || o >= k || i >= a || !e.searchHitContainsCell(t, f.query, t.row, i)) return;
248
- let s = o * O + i - A;
249
- n.fill(1, s, s + a - i);
254
+ let n = Math.max(1, f.query.length), r = Math.max(A, e.col), i = Math.min(A + O, e.col + n), o = e.row - j;
255
+ if (o < 0 || o >= k || r >= i || !a.searchHitContainsCell(e, f.query, e.row, r)) return;
256
+ let s = o * O + r - A;
257
+ t.fill(1, s, s + i - r);
250
258
  };
251
- f && N && (f.positions.forEach((e) => B(e, N)), C && P && B(C, P)), y.font = "12px monospace", y.textAlign = "center", y.textBaseline = "middle";
252
- for (let e = 0; e < k; e++) {
253
- let t = (j + e) * r + T - d;
254
- if (!(t + r < T || t > g)) for (let a = 0; a < O; a++) {
259
+ f && N && (f.positions.forEach((e) => z(e, N)), C && P && z(C, P)), y.font = "12px monospace", y.textAlign = "center", y.textBaseline = "middle";
260
+ for (let t = 0; t < k; t++) {
261
+ let i = (j + t) * r + T - d;
262
+ if (!(i + r < T || i > g)) for (let a = 0; a < O; a++) {
255
263
  let c = (A + a) * o + E - u;
256
264
  if (c + o < E || c > _) continue;
257
- let l = D[e * O + a], d = A + a, f = j + e, p = l ?? "", m = String.fromCharCode(p), h = n.paletteEntryFor(s, m), g = h.background;
265
+ let l = D[t * O + a], d = A + a, f = j + t, p = l ?? "", m = String.fromCharCode(p), h = e.paletteEntryFor(s, m), g = h.background;
258
266
  l === null ? g = "#e9eef2" : m === " " && (g = "#f7f8f9");
259
267
  let b = h.foreground;
260
268
  S(f, d) && (g = h.backgroundSelected, b = h.foregroundSelected);
261
- let x = e * O + a, C = N?.[x] === 1, w = P?.[x] === 1, T = new Path2D();
262
- T.rect(c, t, o, r), T.closePath(), v.cells.pathPropertiesMap.set(T, {
269
+ let x = t * O + a, C = N?.[x] === 1, w = P?.[x] === 1, T = new Path2D();
270
+ T.rect(c, i, o, r), T.closePath(), v.cells.pathPropertiesMap.set(T, {
263
271
  col: d,
264
272
  row: f,
265
- type: i.CELL
266
- }), y.fillStyle = g, y.fill(T), w && (y.fillStyle = "rgba(255, 193, 7, 0.35)", y.fillRect(c + 2, t + 2, Math.max(0, o - 4), Math.max(0, r - 4))), y.fillStyle = b, y.fillText(m, c + o / 2, t + r / 2), C && F && (R = !0, F.rect(c + .5, t + .5, o - 1, r - 1), w && I && (z = !0, I.rect(c + 1, t + 1, o - 2, r - 2)));
273
+ type: n.CELL
274
+ }), y.fillStyle = g, y.fill(T), w && (y.fillStyle = "rgba(255, 193, 7, 0.35)", y.fillRect(c + 2, i + 2, Math.max(0, o - 4), Math.max(0, r - 4))), y.fillStyle = b, y.fillText(m, c + o / 2, i + r / 2), C && F && (L = !0, F.rect(c + .5, i + .5, o - 1, r - 1), w && I && (R = !0, I.rect(c + 1, i + 1, o - 2, r - 2)));
267
275
  }
268
276
  }
269
- R && F && (y.strokeStyle = "#000000", y.lineWidth = 1, y.stroke(F)), z && I && (y.lineWidth = 2, y.stroke(I)), y.fillStyle = "#edf2f6", y.fillRect(0, 0, _, T), y.font = "12px monospace", y.textBaseline = "middle";
270
- let V = [];
277
+ L && F && (y.strokeStyle = "#000000", y.lineWidth = 1, y.stroke(F)), R && I && (y.lineWidth = 2, y.stroke(I)), y.fillStyle = "#edf2f6", y.fillRect(0, 0, _, T), y.font = "12px monospace", y.textBaseline = "middle";
278
+ let B = [];
271
279
  y.strokeStyle = "#9fb3c8", y.lineWidth = 1, y.beginPath();
272
280
  for (let e = 0; e < O; e++) {
273
281
  let t = (A + e + 1) % 10 == 0;
274
- t && V.push(e);
275
- let n = (A + e) * o + E - u, r = new Path2D();
276
- r.rect(n, 0, o, T), r.closePath(), v.ruler.pathPropertiesMap.set(r, {
282
+ t && B.push(e);
283
+ let r = (A + e) * o + E - u, i = new Path2D();
284
+ i.rect(r, 0, o, T), i.closePath(), v.ruler.pathPropertiesMap.set(i, {
277
285
  col: A + e,
278
- type: i.RULER
286
+ type: n.RULER
279
287
  });
280
- let a = n + .5, s = t ? 8 : 4;
288
+ let a = r + .5, s = t ? 8 : 4;
281
289
  y.moveTo(a, T), y.lineTo(a, T - s);
282
290
  }
283
- y.stroke(), y.fillStyle = "#486581", y.textAlign = "center", V.forEach((e) => {
291
+ y.stroke(), y.fillStyle = "#486581", y.textAlign = "center", B.forEach((e) => {
284
292
  let t = (A + e) * o + E - u, n = String(A + e + 1), r = y.measureText(n).width;
285
293
  t - r / 2 < E || t + r / 2 > _ || y.fillText(n, t, T / 2);
286
294
  }), y.textAlign = "start", y.strokeStyle = "#bcccdc", y.lineWidth = 1, y.beginPath(), y.moveTo(E + .5, 0), y.lineTo(E + .5, g), y.moveTo(0, T + .5), y.lineTo(_, T + .5), y.stroke(), y.fillStyle = "#edf2f6", y.fillRect(0, 0, E, T), y.fillStyle = "#d9e2ec", y.fillRect(w, 0, p, g);
287
- let H = new Path2D();
288
- H.rect(w, 0, p, g), H.closePath(), v.divider.pathPropertiesMap.set(H, { type: i.DIVIDER }), y.fillStyle = "#f8fafb", y.fillRect(0, T, w, g - T), y.font = "12px monospace", y.textBaseline = "middle", y.save(), y.beginPath(), y.rect(0, T, w, g - T), y.clip();
295
+ let V = new Path2D();
296
+ V.rect(w, 0, p, g), V.closePath(), v.divider.pathPropertiesMap.set(V, { type: n.DIVIDER }), y.fillStyle = "#f8fafb", y.fillRect(0, T, w, g - T), y.font = "12px monospace", y.textBaseline = "middle", y.save(), y.beginPath(), y.rect(0, T, w, g - T), y.clip();
289
297
  for (let e = 0; e < k; e++) {
290
298
  let t = (j + e) * r + T - d;
291
299
  if (t + r < T || t > g) continue;
292
- let n = new Path2D();
293
- n.rect(0, t, w, r), n.closePath(), v.labels.pathPropertiesMap.set(n, {
300
+ let i = new Path2D();
301
+ i.rect(0, t, w, r), i.closePath(), v.labels.pathPropertiesMap.set(i, {
294
302
  row: j + e,
295
- type: i.LABEL
303
+ type: n.LABEL
296
304
  });
297
305
  let a = j + e - l, o = j + e, s = !!m?.cols || !!(m?.cells && o >= m.cells.startRow && o <= m.cells.endRow) || x(o);
298
- y.fillStyle = s ? "#1565c0" : "#f8fafb", y.fillRect(0, t, w, r), y.fillStyle = s ? "#ffffff" : "#334e68", y.fillText(`${(0, L.default)(String(j + e + 1), b, "0")}: ${c[a] ?? ""}`, 8, t + r / 2);
306
+ y.fillStyle = s ? "#1565c0" : "#f8fafb", y.fillRect(0, t, w, r), y.fillStyle = s ? "#ffffff" : "#334e68", y.fillText(`${(0, W.default)(String(j + e + 1), b, "0")}: ${c[a] ?? ""}`, 8, t + r / 2);
299
307
  }
300
308
  y.restore();
301
309
  }), v;
302
310
  }
303
- static getExpandedSelection(e, t, n, i) {
311
+ static getExpandedSelection(e, n, r, i) {
304
312
  let a = e.cells;
305
313
  if (a) {
306
- if (n === r.LEFT) {
307
- let e = t.cells;
314
+ if (r === t.LEFT) {
315
+ let e = n.cells;
308
316
  if (!e) return null;
309
- let n = a.startCol < e.startCol || a.endCol <= e.startCol, r = n ? a.startCol - 1 : a.startCol, i = n ? a.endCol : a.endCol - 1;
317
+ let t = a.startCol < e.startCol || a.endCol <= e.startCol, r = t ? a.startCol - 1 : a.startCol, i = t ? a.endCol : a.endCol - 1;
310
318
  return r < 0 ? null : { cells: {
311
319
  ...a,
312
320
  endCol: i,
313
321
  startCol: r
314
322
  } };
315
323
  }
316
- if (n === r.RIGHT) {
317
- let e = t.cells;
324
+ if (r === t.RIGHT) {
325
+ let e = n.cells;
318
326
  if (!e) return null;
319
- let n = a.startCol < e.startCol ? a.startCol + 1 : a.startCol, r = a.startCol < e.startCol ? a.endCol : a.endCol + 1;
327
+ let t = a.startCol < e.startCol ? a.startCol + 1 : a.startCol, r = a.startCol < e.startCol ? a.endCol : a.endCol + 1;
320
328
  return r >= i.alignmentWidth ? null : { cells: {
321
329
  ...a,
322
330
  endCol: r,
323
- startCol: n
331
+ startCol: t
324
332
  } };
325
333
  }
326
- if (n === r.UP) {
327
- let e = t.cells;
334
+ if (r === t.UP) {
335
+ let e = n.cells;
328
336
  if (!e) return null;
329
- let n = a.startRow < e.startRow || a.endRow <= e.startRow, r = n ? a.startRow - 1 : a.startRow, i = n ? a.endRow : a.endRow - 1;
337
+ let t = a.startRow < e.startRow || a.endRow <= e.startRow, r = t ? a.startRow - 1 : a.startRow, i = t ? a.endRow : a.endRow - 1;
330
338
  return r < 0 ? null : { cells: {
331
339
  ...a,
332
340
  endRow: i,
333
341
  startRow: r
334
342
  } };
335
343
  }
336
- let e = t.cells;
344
+ let e = n.cells;
337
345
  if (!e) return null;
338
346
  let o = a.startRow < e.startRow ? a.startRow + 1 : a.startRow, s = a.startRow < e.startRow ? a.endRow : a.endRow + 1;
339
347
  return s >= i.sequenceCount ? null : { cells: {
@@ -344,32 +352,32 @@ var s = /* @__PURE__ */ t(((e, t) => {
344
352
  }
345
353
  let o = e.cols;
346
354
  if (o) {
347
- if (o.length === 0 || n !== r.LEFT && n !== r.RIGHT) return null;
348
- let e = Math.min(...o), a = Math.max(...o), s = t.cols;
355
+ if (o.length === 0 || r !== t.LEFT && r !== t.RIGHT) return null;
356
+ let e = Math.min(...o), a = Math.max(...o), s = n.cols;
349
357
  if (!s || s.length === 0) return null;
350
358
  let c = Math.min(...s);
351
- return n === r.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;
359
+ 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;
352
360
  }
353
361
  return e.rows ? e : null;
354
362
  }
355
- static getMovedSelection(e, t, n) {
363
+ static getMovedSelection(e, n, r) {
356
364
  if (!e) return null;
357
- let i = t === r.LEFT || t === r.UP ? -1 : 1, a = (e, t, n) => i < 0 ? e > 0 : t < n - 1, o = e.cells;
358
- if (o) return t === r.LEFT || t === r.RIGHT ? a(o.startCol, o.endCol, n.alignmentWidth) ? { cells: {
365
+ let i = n === t.LEFT || n === t.UP ? -1 : 1, a = (e, t, n) => i < 0 ? e > 0 : t < n - 1, o = e.cells;
366
+ if (o) return n === t.LEFT || n === t.RIGHT ? a(o.startCol, o.endCol, r.alignmentWidth) ? { cells: {
359
367
  endCol: o.endCol + i,
360
368
  endRow: o.endRow,
361
369
  startCol: o.startCol + i,
362
370
  startRow: o.startRow
363
- } } : null : a(o.startRow, o.endRow, n.sequenceCount) ? { cells: {
371
+ } } : null : a(o.startRow, o.endRow, r.sequenceCount) ? { cells: {
364
372
  endCol: o.endCol,
365
373
  endRow: o.endRow + i,
366
374
  startCol: o.startCol,
367
375
  startRow: o.startRow + i
368
376
  } } : null;
369
377
  let s = e.cols;
370
- if (s) return t !== r.LEFT && t !== r.RIGHT || s.length === 0 || !a(Math.min(...s), Math.max(...s), n.alignmentWidth) ? null : { cols: s.map((e) => e + i) };
378
+ if (s) return n !== t.LEFT && n !== t.RIGHT || s.length === 0 || !a(Math.min(...s), Math.max(...s), r.alignmentWidth) ? null : { cols: s.map((e) => e + i) };
371
379
  let c = e.rows;
372
- return c ? t !== r.UP && t !== r.DOWN || c.length === 0 || !a(Math.min(...c), Math.max(...c), n.sequenceCount) ? null : { rows: c.map((e) => e + i) } : null;
380
+ return c ? n !== t.UP && n !== t.DOWN || c.length === 0 || !a(Math.min(...c), Math.max(...c), r.sequenceCount) ? null : { rows: c.map((e) => e + i) } : null;
373
381
  }
374
382
  static getMutateArguments(e, t, n = 0) {
375
383
  let r = e?.cells;
@@ -391,48 +399,48 @@ var s = /* @__PURE__ */ t(((e, t) => {
391
399
  startCol: 0 + n
392
400
  };
393
401
  }
394
- static getPathPropertiesFromCanvas(t) {
395
- let { canvas: n, devicePixelRatio: r, editorAssembly: i, event: a } = t, o = e.getCanvasContext(n), s = n.getBoundingClientRect(), c = n.width / s.width, l = n.height / s.height, u = (a.clientX - s.left) * c / r, d = (a.clientY - s.top) * l / r;
396
- for (let [e, t] of i.cells.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
397
- for (let [e, t] of i.ruler.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
398
- for (let [e, t] of i.labels.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
399
- for (let [e, t] of i.divider.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
402
+ static getPathPropertiesFromCanvas(e) {
403
+ 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;
404
+ for (let [e, t] of r.cells.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
405
+ for (let [e, t] of r.ruler.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
406
+ for (let [e, t] of r.labels.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
407
+ for (let [e, t] of r.divider.pathPropertiesMap) if (o.isPointInPath(e, u, d)) return t;
400
408
  }
401
- static getPostUpsertSelection(e, t) {
409
+ static getPostUpsertSelection(e, n) {
402
410
  if (!e) return null;
403
- let n = t === r.LEFT ? -1 : 1, i = e.cells;
411
+ let r = n === t.LEFT ? -1 : 1, i = e.cells;
404
412
  if (i) return { cells: {
405
- endCol: i.endCol + n,
413
+ endCol: i.endCol + r,
406
414
  endRow: i.endRow,
407
- startCol: i.startCol + n,
415
+ startCol: i.startCol + r,
408
416
  startRow: i.startRow
409
417
  } };
410
418
  let a = e.cols;
411
- if (a) return { cols: a.map((e) => e + n) };
419
+ if (a) return { cols: a.map((e) => e + r) };
412
420
  let o = e.rows;
413
421
  return o ? { rows: o } : null;
414
422
  }
415
- static getRowsToMove(e, t, n) {
423
+ static getRowsToMove(e, n, r) {
416
424
  let i = e?.cells, a = e?.rows ?? (i ? Array.from({ length: i.endRow - i.startRow + 1 }, (e, t) => i.startRow + t) : void 0);
417
425
  if (!a || a.length === 0) return;
418
426
  let o = Math.min(...a), s = Math.max(...a);
419
- if ((t !== r.UP || o !== 0) && (t !== r.DOWN || s !== n.sequenceCount - 1)) return a;
427
+ if ((n !== t.UP || o !== 0) && (n !== t.DOWN || s !== r.sequenceCount - 1)) return a;
420
428
  }
421
429
  static getSelectionFromPathProperties(e) {
422
- let { endPath: t, startPath: n } = e;
423
- if (n.type === i.RULER && (t.type === i.RULER || t.type === i.CELL)) {
424
- let e = Math.min(n.col, t.col), r = Math.max(n.col, t.col);
425
- return { cols: Array.from({ length: r - e + 1 }, (t, n) => e + n) };
430
+ let { endPath: t, startPath: r } = e;
431
+ if (r.type === n.RULER && (t.type === n.RULER || t.type === n.CELL)) {
432
+ let e = Math.min(r.col, t.col), n = Math.max(r.col, t.col);
433
+ return { cols: Array.from({ length: n - e + 1 }, (t, n) => e + n) };
426
434
  }
427
- if (n.type === i.CELL && t.type === i.CELL) return { cells: {
428
- endCol: Math.max(n.col, t.col),
429
- endRow: Math.max(n.row, t.row),
430
- startCol: Math.min(n.col, t.col),
431
- startRow: Math.min(n.row, t.row)
435
+ if (r.type === n.CELL && t.type === n.CELL) return { cells: {
436
+ endCol: Math.max(r.col, t.col),
437
+ endRow: Math.max(r.row, t.row),
438
+ startCol: Math.min(r.col, t.col),
439
+ startRow: Math.min(r.row, t.row)
432
440
  } };
433
- if (n.type === i.LABEL && t.type === i.LABEL) {
434
- let e = Math.min(n.row, t.row), r = Math.max(n.row, t.row);
435
- return { rows: Array.from({ length: r - e + 1 }, (t, n) => e + n) };
441
+ if (r.type === n.LABEL && t.type === n.LABEL) {
442
+ let e = Math.min(r.row, t.row), n = Math.max(r.row, t.row);
443
+ return { rows: Array.from({ length: n - e + 1 }, (t, n) => e + n) };
436
444
  }
437
445
  }
438
446
  static getStatusBarSelectionStats(e, t = null) {
@@ -486,7 +494,7 @@ var s = /* @__PURE__ */ t(((e, t) => {
486
494
  };
487
495
  }
488
496
  static getVisibleGridRange(e) {
489
- let { geometry: t = o, numCols: n, numRows: r, scrollLeft: i, scrollTop: a, viewportHeight: s, viewportWidth: c } = e, l = t.labelWidth + t.dividerWidth, u = Math.max(0, Math.floor(i / t.cellWidth)), d = Math.min(n, u + Math.max(1, Math.ceil((c - l) / t.cellWidth) + 1)), f = Math.max(0, Math.floor(Math.max(0, a - t.rulerHeight) / t.cellHeight)), p = Math.min(r, f + Math.max(1, Math.ceil((s - t.rulerHeight) / t.cellHeight) + 1));
497
+ let { geometry: t = i, numCols: n, numRows: r, scrollLeft: a, scrollTop: o, viewportHeight: s, viewportWidth: c } = e, l = t.labelWidth + t.dividerWidth, u = Math.max(0, Math.floor(a / t.cellWidth)), d = Math.min(n, u + Math.max(1, Math.ceil((c - l) / t.cellWidth) + 1)), f = Math.max(0, Math.floor(Math.max(0, o - t.rulerHeight) / t.cellHeight)), p = Math.min(r, f + Math.max(1, Math.ceil((s - t.rulerHeight) / t.cellHeight) + 1));
490
498
  return {
491
499
  cache: {
492
500
  endCol: Math.min(n, d + t.numOverscanCols),
@@ -513,18 +521,18 @@ var s = /* @__PURE__ */ t(((e, t) => {
513
521
  top: i === null ? n.scrollTop : Math.max(0, i - 1) * t.cellHeight
514
522
  });
515
523
  }
516
- static scrollToSearchResult(t) {
517
- let { geometry: n, scrollContainer: r, searchResult: i, searchResultHighlightedIndex: a } = t, o = i && a !== null ? e.searchHitAt(i, a) : null;
518
- o && e.scrollToPosition({
519
- geometry: n,
520
- scrollContainer: r,
524
+ static scrollToSearchResult(e) {
525
+ let { geometry: t, scrollContainer: n, searchResult: r, searchResultHighlightedIndex: i } = e, o = r && i !== null ? a.searchHitAt(r, i) : null;
526
+ o && a.scrollToPosition({
527
+ geometry: t,
528
+ scrollContainer: n,
521
529
  x: o.col + 1,
522
530
  y: o.row + 1
523
531
  });
524
532
  }
525
- static draw(t, n, r) {
526
- let i = e.getCanvasContext(t);
527
- i.setTransform(n, 0, 0, n, 0, 0), r(i), i.setTransform(1, 0, 0, 1, 0, 0);
533
+ static draw(e, t, n) {
534
+ let r = a.getCanvasContext(e);
535
+ r.setTransform(t, 0, 0, t, 0, 0), n(r), r.setTransform(1, 0, 0, 1, 0, 0);
528
536
  }
529
537
  static getCanvasContext(e) {
530
538
  let t = e.getContext("2d");
@@ -534,11 +542,11 @@ var s = /* @__PURE__ */ t(((e, t) => {
534
542
  static searchHitAt(e, t) {
535
543
  return e?.positions[t] ?? null;
536
544
  }
537
- static searchHitContainsCell(e, t, n, r) {
538
- return e.matrix_type === a.NUCLEOTIDE && e.row === n && r >= e.col && r < e.col + Math.max(1, t.length);
545
+ static searchHitContainsCell(e, t, n, i) {
546
+ return e.matrix_type === r.NUCLEOTIDE && e.row === n && i >= e.col && i < e.col + Math.max(1, t.length);
539
547
  }
540
548
  };
541
549
  //#endregion
542
- export { R as EditorUtil };
550
+ export { G as EditorUtil };
543
551
 
544
552
  //# sourceMappingURL=index.js.map