@uwrl/qc-utils 0.0.22 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- var W = /* @__PURE__ */ ((e) => (e.SECOND = "s", e.MINUTE = "m", e.HOUR = "h", e.DAY = "D", e.WEEK = "W", e.MONTH = "M", e.YEAR = "Y", e))(W || {}), v = /* @__PURE__ */ ((e) => (e.ADD_POINTS = "ADD_POINTS", e.CHANGE_VALUES = "CHANGE_VALUES", e.ASSIGN_VALUES_BULK = "ASSIGN_VALUES_BULK", e.DELETE_POINTS = "DELETE_POINTS", e.DRIFT_CORRECTION = "DRIFT_CORRECTION", e.INTERPOLATE = "INTERPOLATE", e.SHIFT_DATETIMES = "SHIFT_DATETIMES", e.ASSIGN_DATETIMES_BULK = "ASSIGN_DATETIMES_BULK", e.FILL_GAPS = "FILL_GAPS", e))(v || {}), T = /* @__PURE__ */ ((e) => (e.FIND_GAPS = "FIND_GAPS", e.PERSISTENCE = "PERSISTENCE", e.CHANGE = "CHANGE", e.RATE_OF_CHANGE = "RATE_OF_CHANGE", e.VALUE_THRESHOLD = "VALUE_THRESHOLD", e.DATETIME_RANGE = "DATETIME_RANGE", e.SELECTION = "SELECTION", e))(T || {}), K = /* @__PURE__ */ ((e) => (e.LT = "Less than", e.LTE = "Less than or equal to", e.GT = "Greater than", e.GTE = "Greater than or equal to", e.E = "Equal", e))(K || {}), Gt = /* @__PURE__ */ ((e) => (e.ADD = "ADD", e.SUB = "SUB", e.MULT = "MULT", e.DIV = "DIV", e.ASSIGN = "ASSIGN", e))(Gt || {}), Ht = /* @__PURE__ */ ((e) => (e.LT = "Less than", e.LTE = "Less than or equal to", e.GT = "Greater than", e.GTE = "Greater than or equal to", e.E = "Equal", e))(Ht || {});
2
- class zt {
1
+ var N = /* @__PURE__ */ ((r) => (r.SECOND = "s", r.MINUTE = "m", r.HOUR = "h", r.DAY = "D", r.WEEK = "W", r.MONTH = "M", r.YEAR = "Y", r))(N || {}), S = /* @__PURE__ */ ((r) => (r.ADD_POINTS = "ADD_POINTS", r.CHANGE_VALUES = "CHANGE_VALUES", r.ASSIGN_VALUES_BULK = "ASSIGN_VALUES_BULK", r.DELETE_POINTS = "DELETE_POINTS", r.DRIFT_CORRECTION = "DRIFT_CORRECTION", r.INTERPOLATE = "INTERPOLATE", r.SHIFT_DATETIMES = "SHIFT_DATETIMES", r.ASSIGN_DATETIMES_BULK = "ASSIGN_DATETIMES_BULK", r.FILL_GAPS = "FILL_GAPS", r))(S || {}), L = /* @__PURE__ */ ((r) => (r.FIND_GAPS = "FIND_GAPS", r.PERSISTENCE = "PERSISTENCE", r.CHANGE = "CHANGE", r.RATE_OF_CHANGE = "RATE_OF_CHANGE", r.VALUE_THRESHOLD = "VALUE_THRESHOLD", r.DATETIME_RANGE = "DATETIME_RANGE", r.SELECTION = "SELECTION", r))(L || {}), B = /* @__PURE__ */ ((r) => (r.LT = "Less than", r.LTE = "Less than or equal to", r.GT = "Greater than", r.GTE = "Greater than or equal to", r.E = "Equal", r))(B || {}), mt = /* @__PURE__ */ ((r) => (r.ADD = "ADD", r.SUB = "SUB", r.MULT = "MULT", r.DIV = "DIV", r.ASSIGN = "ASSIGN", r))(mt || {}), wt = /* @__PURE__ */ ((r) => (r.LT = "Less than", r.LTE = "Less than or equal to", r.GT = "Greater than", r.GTE = "Greater than or equal to", r.E = "Equal", r))(wt || {});
2
+ class gt {
3
3
  id;
4
4
  thingId;
5
5
  link;
@@ -11,7 +11,7 @@ class zt {
11
11
  this.id = "", this.thingId = "", this.link = "", this.frequency = null, this.path = "HydroShare", this.datastreamIds = [], this.publicResource = !1;
12
12
  }
13
13
  }
14
- class ts extends zt {
14
+ class mr extends gt {
15
15
  resourceTitle;
16
16
  resourceAbstract;
17
17
  resourceKeywords;
@@ -19,7 +19,7 @@ class ts extends zt {
19
19
  super(), this.resourceTitle = void 0, this.resourceAbstract = void 0, this.resourceKeywords = void 0;
20
20
  }
21
21
  }
22
- class Xt {
22
+ class yt {
23
23
  latitude;
24
24
  longitude;
25
25
  elevation_m;
@@ -31,11 +31,11 @@ class Xt {
31
31
  this.elevationDatum = "WGS84", this.state = "", this.county = "", this.country = "";
32
32
  }
33
33
  }
34
- class rs {
34
+ class wr {
35
35
  id;
36
36
  workspaceId;
37
37
  name;
38
- location = new Xt();
38
+ location = new yt();
39
39
  tags;
40
40
  hydroShareArchive;
41
41
  siteType;
@@ -48,7 +48,7 @@ class rs {
48
48
  this.id = "", this.workspaceId = "", this.name = "", this.tags = [], this.siteType = "", this.samplingFeatureCode = "", this.isPrivate = !1, this.description = "", this.samplingFeatureType = "Site", this.dataDisclaimer = "";
49
49
  }
50
50
  }
51
- class ss {
51
+ class gr {
52
52
  id;
53
53
  workspaceId;
54
54
  name;
@@ -74,11 +74,11 @@ class ss {
74
74
  timeAggregationIntervalUnit;
75
75
  dataSourceId;
76
76
  valueCount;
77
- constructor(t) {
78
- this.id = "", this.workspaceId = "", this.name = "", this.description = "", this.thingId = t || "", this.observationType = "OM_Measurement", this.resultType = "Time Series Coverage", this.sampledMedium = "", this.noDataValue = -9999, this.aggregationStatistic = "", this.unitId = "", this.observedPropertyId = "", this.sensorId = "", this.processingLevelId = "", this.timeAggregationInterval = null, this.timeAggregationIntervalUnit = "seconds", this.isPrivate = !0, this.isVisible = !0, this.valueCount = 0;
77
+ constructor(e) {
78
+ this.id = "", this.workspaceId = "", this.name = "", this.description = "", this.thingId = e || "", this.observationType = "OM_Measurement", this.resultType = "Time Series Coverage", this.sampledMedium = "", this.noDataValue = -9999, this.aggregationStatistic = "", this.unitId = "", this.observedPropertyId = "", this.sensorId = "", this.processingLevelId = "", this.timeAggregationInterval = null, this.timeAggregationIntervalUnit = "seconds", this.isPrivate = !0, this.isVisible = !0, this.valueCount = 0;
79
79
  }
80
80
  }
81
- class ns {
81
+ class yr {
82
82
  id;
83
83
  workspaceId;
84
84
  name;
@@ -89,7 +89,7 @@ class ns {
89
89
  this.id = "", this.workspaceId = "", this.name = "", this.symbol = "", this.definition = "", this.type = "";
90
90
  }
91
91
  }
92
- class os {
92
+ class br {
93
93
  id;
94
94
  workspaceId;
95
95
  name;
@@ -105,7 +105,7 @@ class os {
105
105
  this.id = "", this.workspaceId = "", this.name = "", this.description = "", this.manufacturer = "", this.model = "", this.methodType = "Instrument Deployment", this.methodCode = "", this.methodLink = "", this.encodingType = "application/json", this.modelLink = "";
106
106
  }
107
107
  }
108
- class as {
108
+ class Er {
109
109
  id;
110
110
  workspaceId;
111
111
  name;
@@ -117,7 +117,7 @@ class as {
117
117
  this.id = "", this.workspaceId = "", this.name = "", this.definition = "", this.description = "", this.type = "Hydrology", this.code = "";
118
118
  }
119
119
  }
120
- class is {
120
+ class Sr {
121
121
  id;
122
122
  workspaceId;
123
123
  code;
@@ -127,7 +127,7 @@ class is {
127
127
  this.id = "", this.workspaceId = "", this.code = "", this.definition = "", this.explanation = "";
128
128
  }
129
129
  }
130
- class cs {
130
+ class vr {
131
131
  id;
132
132
  workspaceId;
133
133
  code;
@@ -136,7 +136,7 @@ class cs {
136
136
  this.id = "", this.workspaceId = "", this.code = "", this.description = "";
137
137
  }
138
138
  }
139
- class ls {
139
+ class kr {
140
140
  name;
141
141
  code;
142
142
  type;
@@ -145,7 +145,7 @@ class ls {
145
145
  constructor() {
146
146
  }
147
147
  }
148
- class us {
148
+ class Lr {
149
149
  id;
150
150
  email;
151
151
  password;
@@ -163,7 +163,7 @@ class us {
163
163
  this.id = "", this.email = "", this.password = "", this.firstName = "", this.middleName = "", this.lastName = "", this.phone = "", this.address = "", this.type = "", this.link = "", this.accountType = "standard", this.hydroShareConnected = !1;
164
164
  }
165
165
  }
166
- class hs {
166
+ class Ar {
167
167
  id;
168
168
  name;
169
169
  iconLink;
@@ -173,8 +173,8 @@ class hs {
173
173
  this.id = "", this.name = "", this.iconLink = "", this.signupEnabled = !0, this.connectEnabled = !0;
174
174
  }
175
175
  }
176
- var Vt = /* @__PURE__ */ ((e) => (e.Global = "*", e.View = "view", e.Create = "create", e.Edit = "edit", e.Delete = "delete", e))(Vt || {}), qt = /* @__PURE__ */ ((e) => (e.Global = "*", e.Workspace = "Workspace", e.Collaborator = "Collaborator", e.Thing = "Thing", e.Datastream = "Datastream", e.Sensor = "Sensor", e.Unit = "Unit", e.ObservedProperty = "ObservedProperty", e.ProcessingLevel = "ProcessingLevel", e.Observation = "Observation", e))(qt || {});
177
- class fs {
176
+ var bt = /* @__PURE__ */ ((r) => (r.Global = "*", r.View = "view", r.Create = "create", r.Edit = "edit", r.Delete = "delete", r))(bt || {}), Et = /* @__PURE__ */ ((r) => (r.Global = "*", r.Workspace = "Workspace", r.Collaborator = "Collaborator", r.Thing = "Thing", r.Datastream = "Datastream", r.Sensor = "Sensor", r.Unit = "Unit", r.ObservedProperty = "ObservedProperty", r.ProcessingLevel = "ProcessingLevel", r.Observation = "Observation", r))(Et || {});
177
+ class _r {
178
178
  id = "";
179
179
  key = "";
180
180
  name = "";
@@ -185,11 +185,11 @@ class fs {
185
185
  lastUsed = "";
186
186
  workspaceId = "";
187
187
  role = null;
188
- constructor(t) {
189
- Object.assign(this, t);
188
+ constructor(e) {
189
+ Object.assign(this, e);
190
190
  }
191
191
  }
192
- class ds {
192
+ class Tr {
193
193
  id;
194
194
  name;
195
195
  isPrivate;
@@ -200,7 +200,7 @@ class ds {
200
200
  this.id = "", this.name = "", this.isPrivate = !1, this.owner = null, this.collaboratorRole = null, this.pendingTransferTo = null;
201
201
  }
202
202
  }
203
- class ps {
203
+ class Rr {
204
204
  user;
205
205
  role;
206
206
  constructor() {
@@ -223,1533 +223,1094 @@ class ps {
223
223
  };
224
224
  }
225
225
  }
226
- function yt() {
227
- const e = "csrftoken=", r = decodeURIComponent(document.cookie).split(";");
228
- for (const s of r) {
229
- const n = s.trim();
230
- if (n.startsWith(e))
231
- return n.substring(e.length);
226
+ const ve = {
227
+ HTTP: {
228
+ type: "HTTP",
229
+ sourceUri: "",
230
+ placeholderVariables: []
231
+ },
232
+ local: {
233
+ type: "local",
234
+ sourceUri: "",
235
+ placeholderVariables: []
232
236
  }
233
- return null;
234
- }
235
- function gt(e) {
236
- let t = e.headers ? { ...e.headers } : {}, r;
237
- return e.body !== void 0 && (r = typeof e.body == "string" || e.body instanceof FormData ? e.body : JSON.stringify(e.body)), t["X-CSRFToken"] = yt() || "", {
238
- ...e,
239
- headers: t,
240
- body: r,
241
- credentials: "omit"
237
+ }, ke = {
238
+ JSON: {
239
+ type: "JSON",
240
+ timestamp: {
241
+ key: "",
242
+ format: "ISO8601",
243
+ timezoneMode: "embeddedOffset"
244
+ },
245
+ JMESPath: ""
246
+ },
247
+ CSV: {
248
+ type: "CSV",
249
+ timestamp: {
250
+ key: "",
251
+ format: "ISO8601",
252
+ timezoneMode: "embeddedOffset"
253
+ },
254
+ headerRow: 1,
255
+ dataStartRow: 2,
256
+ delimiter: ",",
257
+ identifierType: "name"
258
+ /* Name */
259
+ }
260
+ }, Le = {
261
+ HydroServer: {
262
+ type: "HydroServer"
263
+ }
264
+ };
265
+ class Ir {
266
+ name = "";
267
+ settings = {
268
+ type: "SDL",
269
+ extractor: JSON.parse(JSON.stringify(ve.local)),
270
+ transformer: JSON.parse(JSON.stringify(ke.CSV)),
271
+ loader: JSON.parse(JSON.stringify(Le.HydroServer)),
272
+ payloads: []
242
273
  };
243
- }
244
- function Jt(e) {
245
- if (Array.isArray(e?.errors) && e.errors.length && (e = e.errors[0]), typeof e != "object" || e === null)
246
- return "An unknown error occurred.";
247
- const t = ["message", "detail", "error"];
248
- for (const r of t)
249
- if (e[r]) return e[r];
250
- return "An unknown error occurred.";
251
- }
252
- async function mt(e) {
253
- if (e.headers.get("Content-Length") === "0" || e.statusText === "No Content")
254
- return null;
255
- const t = e.headers.get("content-type") || "";
256
- let r = null;
257
- if (t.includes("application/json"))
258
- try {
259
- r = await e.json();
260
- } catch (n) {
261
- console.error("Failed to parse error JSON:", n);
262
- }
263
- else if (t.includes("text/csv"))
264
- try {
265
- r = await e.blob();
266
- } catch (n) {
267
- console.error("Failed to parse error JSON:", n);
268
- }
269
- if (e.ok || e.status === 401) return r;
270
- const s = {
271
- status: e.status,
272
- message: Jt(r)
274
+ id = "";
275
+ workspaceId = "";
276
+ orchestrationSystem = {
277
+ id: "",
278
+ name: "",
279
+ workspaceId: "",
280
+ type: ""
281
+ };
282
+ schedule = {
283
+ interval: 15,
284
+ intervalUnits: "minutes"
273
285
  };
274
- throw console.error("API response not OK:", s.message), s;
275
- }
276
- var Te = function(e, t) {
277
- return Te = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, s) {
278
- r.__proto__ = s;
279
- } || function(r, s) {
280
- for (var n in s) Object.prototype.hasOwnProperty.call(s, n) && (r[n] = s[n]);
281
- }, Te(e, t);
286
+ status = { paused: !0 };
287
+ datastreams = [];
288
+ constructor(e) {
289
+ Object.assign(this, e);
290
+ }
291
+ switchExtractor(e) {
292
+ this.settings.extractor = JSON.parse(
293
+ JSON.stringify(ve[e])
294
+ );
295
+ }
296
+ switchTransformer(e) {
297
+ this.settings.transformer = JSON.parse(
298
+ JSON.stringify(ke[e])
299
+ );
300
+ }
301
+ switchLoader(e) {
302
+ this.settings.loader = JSON.parse(JSON.stringify(Le[e]));
303
+ }
304
+ }
305
+ class Mr {
306
+ name = "";
307
+ mappings = [];
308
+ extractorVariables = {};
309
+ constructor(e) {
310
+ Object.assign(this, e);
311
+ }
312
+ }
313
+ const Xe = 1, q = Xe * 60, me = q * 60, we = me * 24, St = we * 7, vt = me * 30, kt = we * 365, G = {
314
+ [N.SECOND]: Xe,
315
+ [N.MINUTE]: q,
316
+ [N.HOUR]: me,
317
+ [N.DAY]: we,
318
+ [N.WEEK]: St,
319
+ [N.MONTH]: vt,
320
+ [N.YEAR]: kt
321
+ }, Ur = (r) => r.toLocaleString(void 0, {
322
+ year: "numeric",
323
+ month: "short",
324
+ day: "2-digit",
325
+ hour: "2-digit",
326
+ hour12: !1,
327
+ minute: "2-digit",
328
+ second: "2-digit"
329
+ }), Or = (r) => {
330
+ let e, t;
331
+ r >= q * 1e3 ? (e = r / (q * 1e3), t = "m") : r >= 1e3 ? (e = r / 1e3, t = "s") : (e = r, t = "ms");
332
+ let n;
333
+ return t === "ms" ? n = Math.round(e).toString() : n = e.toFixed(2), `${n} ${t}`;
334
+ }, re = async (r, e) => {
335
+ e && console.info(e);
336
+ const t = performance.now(), n = await r(), i = +(performance.now() - t);
337
+ return { response: n, duration: i };
282
338
  };
283
- function de(e, t) {
284
- if (typeof t != "function" && t !== null)
285
- throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
286
- Te(e, t);
287
- function r() {
288
- this.constructor = e;
289
- }
290
- e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
291
- }
292
- function Le(e) {
293
- var t = typeof Symbol == "function" && Symbol.iterator, r = t && e[t], s = 0;
294
- if (r) return r.call(e);
295
- if (e && typeof e.length == "number") return {
339
+ var ie = function(r, e) {
340
+ return ie = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) {
341
+ t.__proto__ = n;
342
+ } || function(t, n) {
343
+ for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
344
+ }, ie(r, e);
345
+ };
346
+ function K(r, e) {
347
+ if (typeof e != "function" && e !== null)
348
+ throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
349
+ ie(r, e);
350
+ function t() {
351
+ this.constructor = r;
352
+ }
353
+ r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
354
+ }
355
+ function ae(r) {
356
+ var e = typeof Symbol == "function" && Symbol.iterator, t = e && r[e], n = 0;
357
+ if (t) return t.call(r);
358
+ if (r && typeof r.length == "number") return {
296
359
  next: function() {
297
- return e && s >= e.length && (e = void 0), { value: e && e[s++], done: !e };
360
+ return r && n >= r.length && (r = void 0), { value: r && r[n++], done: !r };
298
361
  }
299
362
  };
300
- throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
363
+ throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
301
364
  }
302
- function $e(e, t) {
303
- var r = typeof Symbol == "function" && e[Symbol.iterator];
304
- if (!r) return e;
305
- var s = r.call(e), n, a = [], o;
365
+ function ce(r, e) {
366
+ var t = typeof Symbol == "function" && r[Symbol.iterator];
367
+ if (!t) return r;
368
+ var n = t.call(r), o, i = [], s;
306
369
  try {
307
- for (; (t === void 0 || t-- > 0) && !(n = s.next()).done; ) a.push(n.value);
308
- } catch (i) {
309
- o = { error: i };
370
+ for (; (e === void 0 || e-- > 0) && !(o = n.next()).done; ) i.push(o.value);
371
+ } catch (a) {
372
+ s = { error: a };
310
373
  } finally {
311
374
  try {
312
- n && !n.done && (r = s.return) && r.call(s);
375
+ o && !o.done && (t = n.return) && t.call(n);
313
376
  } finally {
314
- if (o) throw o.error;
377
+ if (s) throw s.error;
315
378
  }
316
379
  }
317
- return a;
380
+ return i;
318
381
  }
319
- function Re(e, t, r) {
320
- if (r || arguments.length === 2) for (var s = 0, n = t.length, a; s < n; s++)
321
- (a || !(s in t)) && (a || (a = Array.prototype.slice.call(t, 0, s)), a[s] = t[s]);
322
- return e.concat(a || Array.prototype.slice.call(t));
382
+ function le(r, e, t) {
383
+ if (t || arguments.length === 2) for (var n = 0, o = e.length, i; n < o; n++)
384
+ (i || !(n in e)) && (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
385
+ return r.concat(i || Array.prototype.slice.call(e));
323
386
  }
324
- function G(e) {
325
- return typeof e == "function";
387
+ function F(r) {
388
+ return typeof r == "function";
326
389
  }
327
- function wt(e) {
328
- var t = function(s) {
329
- Error.call(s), s.stack = new Error().stack;
330
- }, r = e(t);
331
- return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r;
390
+ function He(r) {
391
+ var e = function(n) {
392
+ Error.call(n), n.stack = new Error().stack;
393
+ }, t = r(e);
394
+ return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
332
395
  }
333
- var we = wt(function(e) {
334
- return function(r) {
335
- e(this), this.message = r ? r.length + ` errors occurred during unsubscription:
336
- ` + r.map(function(s, n) {
337
- return n + 1 + ") " + s.toString();
396
+ var ne = He(function(r) {
397
+ return function(t) {
398
+ r(this), this.message = t ? t.length + ` errors occurred during unsubscription:
399
+ ` + t.map(function(n, o) {
400
+ return o + 1 + ") " + n.toString();
338
401
  }).join(`
339
- `) : "", this.name = "UnsubscriptionError", this.errors = r;
402
+ `) : "", this.name = "UnsubscriptionError", this.errors = t;
340
403
  };
341
404
  });
342
- function Ie(e, t) {
343
- if (e) {
344
- var r = e.indexOf(t);
345
- 0 <= r && e.splice(r, 1);
405
+ function ue(r, e) {
406
+ if (r) {
407
+ var t = r.indexOf(e);
408
+ 0 <= t && r.splice(t, 1);
346
409
  }
347
410
  }
348
- var pe = (function() {
349
- function e(t) {
350
- this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
411
+ var Q = (function() {
412
+ function r(e) {
413
+ this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
351
414
  }
352
- return e.prototype.unsubscribe = function() {
353
- var t, r, s, n, a;
415
+ return r.prototype.unsubscribe = function() {
416
+ var e, t, n, o, i;
354
417
  if (!this.closed) {
355
418
  this.closed = !0;
356
- var o = this._parentage;
357
- if (o)
358
- if (this._parentage = null, Array.isArray(o))
419
+ var s = this._parentage;
420
+ if (s)
421
+ if (this._parentage = null, Array.isArray(s))
359
422
  try {
360
- for (var i = Le(o), l = i.next(); !l.done; l = i.next()) {
361
- var d = l.value;
362
- d.remove(this);
423
+ for (var a = ae(s), c = a.next(); !c.done; c = a.next()) {
424
+ var p = c.value;
425
+ p.remove(this);
363
426
  }
364
- } catch (h) {
365
- t = { error: h };
427
+ } catch (l) {
428
+ e = { error: l };
366
429
  } finally {
367
430
  try {
368
- l && !l.done && (r = i.return) && r.call(i);
431
+ c && !c.done && (t = a.return) && t.call(a);
369
432
  } finally {
370
- if (t) throw t.error;
433
+ if (e) throw e.error;
371
434
  }
372
435
  }
373
436
  else
374
- o.remove(this);
375
- var u = this.initialTeardown;
376
- if (G(u))
437
+ s.remove(this);
438
+ var f = this.initialTeardown;
439
+ if (F(f))
377
440
  try {
378
- u();
379
- } catch (h) {
380
- a = h instanceof we ? h.errors : [h];
441
+ f();
442
+ } catch (l) {
443
+ i = l instanceof ne ? l.errors : [l];
381
444
  }
382
- var y = this._finalizers;
383
- if (y) {
445
+ var w = this._finalizers;
446
+ if (w) {
384
447
  this._finalizers = null;
385
448
  try {
386
- for (var g = Le(y), m = g.next(); !m.done; m = g.next()) {
387
- var b = m.value;
449
+ for (var m = ae(w), d = m.next(); !d.done; d = m.next()) {
450
+ var y = d.value;
388
451
  try {
389
- Ye(b);
390
- } catch (h) {
391
- a = a ?? [], h instanceof we ? a = Re(Re([], $e(a)), $e(h.errors)) : a.push(h);
452
+ Ae(y);
453
+ } catch (l) {
454
+ i = i ?? [], l instanceof ne ? i = le(le([], ce(i)), ce(l.errors)) : i.push(l);
392
455
  }
393
456
  }
394
- } catch (h) {
395
- s = { error: h };
457
+ } catch (l) {
458
+ n = { error: l };
396
459
  } finally {
397
460
  try {
398
- m && !m.done && (n = g.return) && n.call(g);
461
+ d && !d.done && (o = m.return) && o.call(m);
399
462
  } finally {
400
- if (s) throw s.error;
463
+ if (n) throw n.error;
401
464
  }
402
465
  }
403
466
  }
404
- if (a)
405
- throw new we(a);
467
+ if (i)
468
+ throw new ne(i);
406
469
  }
407
- }, e.prototype.add = function(t) {
408
- var r;
409
- if (t && t !== this)
470
+ }, r.prototype.add = function(e) {
471
+ var t;
472
+ if (e && e !== this)
410
473
  if (this.closed)
411
- Ye(t);
474
+ Ae(e);
412
475
  else {
413
- if (t instanceof e) {
414
- if (t.closed || t._hasParent(this))
476
+ if (e instanceof r) {
477
+ if (e.closed || e._hasParent(this))
415
478
  return;
416
- t._addParent(this);
479
+ e._addParent(this);
417
480
  }
418
- (this._finalizers = (r = this._finalizers) !== null && r !== void 0 ? r : []).push(t);
481
+ (this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(e);
419
482
  }
420
- }, e.prototype._hasParent = function(t) {
421
- var r = this._parentage;
422
- return r === t || Array.isArray(r) && r.includes(t);
423
- }, e.prototype._addParent = function(t) {
424
- var r = this._parentage;
425
- this._parentage = Array.isArray(r) ? (r.push(t), r) : r ? [r, t] : t;
426
- }, e.prototype._removeParent = function(t) {
427
- var r = this._parentage;
428
- r === t ? this._parentage = null : Array.isArray(r) && Ie(r, t);
429
- }, e.prototype.remove = function(t) {
430
- var r = this._finalizers;
431
- r && Ie(r, t), t instanceof e && t._removeParent(this);
432
- }, e.EMPTY = (function() {
433
- var t = new e();
434
- return t.closed = !0, t;
435
- })(), e;
436
- })(), bt = pe.EMPTY;
437
- function St(e) {
438
- return e instanceof pe || e && "closed" in e && G(e.remove) && G(e.add) && G(e.unsubscribe);
439
- }
440
- function Ye(e) {
441
- G(e) ? e() : e.unsubscribe();
442
- }
443
- var Qt = {
483
+ }, r.prototype._hasParent = function(e) {
484
+ var t = this._parentage;
485
+ return t === e || Array.isArray(t) && t.includes(e);
486
+ }, r.prototype._addParent = function(e) {
487
+ var t = this._parentage;
488
+ this._parentage = Array.isArray(t) ? (t.push(e), t) : t ? [t, e] : e;
489
+ }, r.prototype._removeParent = function(e) {
490
+ var t = this._parentage;
491
+ t === e ? this._parentage = null : Array.isArray(t) && ue(t, e);
492
+ }, r.prototype.remove = function(e) {
493
+ var t = this._finalizers;
494
+ t && ue(t, e), e instanceof r && e._removeParent(this);
495
+ }, r.EMPTY = (function() {
496
+ var e = new r();
497
+ return e.closed = !0, e;
498
+ })(), r;
499
+ })(), ze = Q.EMPTY;
500
+ function $e(r) {
501
+ return r instanceof Q || r && "closed" in r && F(r.remove) && F(r.add) && F(r.unsubscribe);
502
+ }
503
+ function Ae(r) {
504
+ F(r) ? r() : r.unsubscribe();
505
+ }
506
+ var Lt = {
444
507
  Promise: void 0
445
- }, Kt = {
446
- setTimeout: function(e, t) {
447
- for (var r = [], s = 2; s < arguments.length; s++)
448
- r[s - 2] = arguments[s];
449
- return setTimeout.apply(void 0, Re([e, t], $e(r)));
508
+ }, At = {
509
+ setTimeout: function(r, e) {
510
+ for (var t = [], n = 2; n < arguments.length; n++)
511
+ t[n - 2] = arguments[n];
512
+ return setTimeout.apply(void 0, le([r, e], ce(t)));
450
513
  },
451
- clearTimeout: function(e) {
452
- return clearTimeout(e);
514
+ clearTimeout: function(r) {
515
+ return clearTimeout(r);
453
516
  },
454
517
  delegate: void 0
455
518
  };
456
- function Zt(e) {
457
- Kt.setTimeout(function() {
458
- throw e;
519
+ function _t(r) {
520
+ At.setTimeout(function() {
521
+ throw r;
459
522
  });
460
523
  }
461
- function Ge() {
524
+ function _e() {
462
525
  }
463
- function ce(e) {
464
- e();
526
+ function $(r) {
527
+ r();
465
528
  }
466
- var Et = (function(e) {
467
- de(t, e);
468
- function t(r) {
469
- var s = e.call(this) || this;
470
- return s.isStopped = !1, r ? (s.destination = r, St(r) && r.add(s)) : s.destination = rr, s;
529
+ var Ve = (function(r) {
530
+ K(e, r);
531
+ function e(t) {
532
+ var n = r.call(this) || this;
533
+ return n.isStopped = !1, t ? (n.destination = t, $e(t) && t.add(n)) : n.destination = It, n;
471
534
  }
472
- return t.create = function(r, s, n) {
473
- return new Oe(r, s, n);
474
- }, t.prototype.next = function(r) {
475
- this.isStopped || this._next(r);
476
- }, t.prototype.error = function(r) {
477
- this.isStopped || (this.isStopped = !0, this._error(r));
478
- }, t.prototype.complete = function() {
535
+ return e.create = function(t, n, o) {
536
+ return new fe(t, n, o);
537
+ }, e.prototype.next = function(t) {
538
+ this.isStopped || this._next(t);
539
+ }, e.prototype.error = function(t) {
540
+ this.isStopped || (this.isStopped = !0, this._error(t));
541
+ }, e.prototype.complete = function() {
479
542
  this.isStopped || (this.isStopped = !0, this._complete());
480
- }, t.prototype.unsubscribe = function() {
481
- this.closed || (this.isStopped = !0, e.prototype.unsubscribe.call(this), this.destination = null);
482
- }, t.prototype._next = function(r) {
483
- this.destination.next(r);
484
- }, t.prototype._error = function(r) {
543
+ }, e.prototype.unsubscribe = function() {
544
+ this.closed || (this.isStopped = !0, r.prototype.unsubscribe.call(this), this.destination = null);
545
+ }, e.prototype._next = function(t) {
546
+ this.destination.next(t);
547
+ }, e.prototype._error = function(t) {
485
548
  try {
486
- this.destination.error(r);
549
+ this.destination.error(t);
487
550
  } finally {
488
551
  this.unsubscribe();
489
552
  }
490
- }, t.prototype._complete = function() {
553
+ }, e.prototype._complete = function() {
491
554
  try {
492
555
  this.destination.complete();
493
556
  } finally {
494
557
  this.unsubscribe();
495
558
  }
496
- }, t;
497
- })(pe), er = (function() {
498
- function e(t) {
499
- this.partialObserver = t;
559
+ }, e;
560
+ })(Q), Tt = (function() {
561
+ function r(e) {
562
+ this.partialObserver = e;
500
563
  }
501
- return e.prototype.next = function(t) {
502
- var r = this.partialObserver;
503
- if (r.next)
564
+ return r.prototype.next = function(e) {
565
+ var t = this.partialObserver;
566
+ if (t.next)
504
567
  try {
505
- r.next(t);
506
- } catch (s) {
507
- ne(s);
568
+ t.next(e);
569
+ } catch (n) {
570
+ X(n);
508
571
  }
509
- }, e.prototype.error = function(t) {
510
- var r = this.partialObserver;
511
- if (r.error)
572
+ }, r.prototype.error = function(e) {
573
+ var t = this.partialObserver;
574
+ if (t.error)
512
575
  try {
513
- r.error(t);
514
- } catch (s) {
515
- ne(s);
576
+ t.error(e);
577
+ } catch (n) {
578
+ X(n);
516
579
  }
517
580
  else
518
- ne(t);
519
- }, e.prototype.complete = function() {
520
- var t = this.partialObserver;
521
- if (t.complete)
581
+ X(e);
582
+ }, r.prototype.complete = function() {
583
+ var e = this.partialObserver;
584
+ if (e.complete)
522
585
  try {
523
- t.complete();
524
- } catch (r) {
525
- ne(r);
586
+ e.complete();
587
+ } catch (t) {
588
+ X(t);
526
589
  }
527
- }, e;
528
- })(), Oe = (function(e) {
529
- de(t, e);
530
- function t(r, s, n) {
531
- var a = e.call(this) || this, o;
532
- return G(r) || !r ? o = {
533
- next: r ?? void 0,
534
- error: s ?? void 0,
535
- complete: n ?? void 0
536
- } : o = r, a.destination = new er(o), a;
590
+ }, r;
591
+ })(), fe = (function(r) {
592
+ K(e, r);
593
+ function e(t, n, o) {
594
+ var i = r.call(this) || this, s;
595
+ return F(t) || !t ? s = {
596
+ next: t ?? void 0,
597
+ error: n ?? void 0,
598
+ complete: o ?? void 0
599
+ } : s = t, i.destination = new Tt(s), i;
537
600
  }
538
- return t;
539
- })(Et);
540
- function ne(e) {
541
- Zt(e);
601
+ return e;
602
+ })(Ve);
603
+ function X(r) {
604
+ _t(r);
542
605
  }
543
- function tr(e) {
544
- throw e;
606
+ function Rt(r) {
607
+ throw r;
545
608
  }
546
- var rr = {
609
+ var It = {
547
610
  closed: !0,
548
- next: Ge,
549
- error: tr,
550
- complete: Ge
551
- }, sr = (function() {
611
+ next: _e,
612
+ error: Rt,
613
+ complete: _e
614
+ }, Mt = (function() {
552
615
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
553
616
  })();
554
- function nr(e) {
555
- return e;
617
+ function Ut(r) {
618
+ return r;
556
619
  }
557
- function or(e) {
558
- return e.length === 0 ? nr : e.length === 1 ? e[0] : function(r) {
559
- return e.reduce(function(s, n) {
560
- return n(s);
561
- }, r);
620
+ function Ot(r) {
621
+ return r.length === 0 ? Ut : r.length === 1 ? r[0] : function(t) {
622
+ return r.reduce(function(n, o) {
623
+ return o(n);
624
+ }, t);
562
625
  };
563
626
  }
564
- var He = (function() {
565
- function e(t) {
566
- t && (this._subscribe = t);
567
- }
568
- return e.prototype.lift = function(t) {
569
- var r = new e();
570
- return r.source = this, r.operator = t, r;
571
- }, e.prototype.subscribe = function(t, r, s) {
572
- var n = this, a = ir(t) ? t : new Oe(t, r, s);
573
- return ce(function() {
574
- var o = n, i = o.operator, l = o.source;
575
- a.add(i ? i.call(a, l) : l ? n._subscribe(a) : n._trySubscribe(a));
576
- }), a;
577
- }, e.prototype._trySubscribe = function(t) {
627
+ var Te = (function() {
628
+ function r(e) {
629
+ e && (this._subscribe = e);
630
+ }
631
+ return r.prototype.lift = function(e) {
632
+ var t = new r();
633
+ return t.source = this, t.operator = e, t;
634
+ }, r.prototype.subscribe = function(e, t, n) {
635
+ var o = this, i = xt(e) ? e : new fe(e, t, n);
636
+ return $(function() {
637
+ var s = o, a = s.operator, c = s.source;
638
+ i.add(a ? a.call(i, c) : c ? o._subscribe(i) : o._trySubscribe(i));
639
+ }), i;
640
+ }, r.prototype._trySubscribe = function(e) {
578
641
  try {
579
- return this._subscribe(t);
580
- } catch (r) {
581
- t.error(r);
582
- }
583
- }, e.prototype.forEach = function(t, r) {
584
- var s = this;
585
- return r = ze(r), new r(function(n, a) {
586
- var o = new Oe({
587
- next: function(i) {
642
+ return this._subscribe(e);
643
+ } catch (t) {
644
+ e.error(t);
645
+ }
646
+ }, r.prototype.forEach = function(e, t) {
647
+ var n = this;
648
+ return t = Re(t), new t(function(o, i) {
649
+ var s = new fe({
650
+ next: function(a) {
588
651
  try {
589
- t(i);
590
- } catch (l) {
591
- a(l), o.unsubscribe();
652
+ e(a);
653
+ } catch (c) {
654
+ i(c), s.unsubscribe();
592
655
  }
593
656
  },
594
- error: a,
595
- complete: n
657
+ error: i,
658
+ complete: o
596
659
  });
597
- s.subscribe(o);
660
+ n.subscribe(s);
598
661
  });
599
- }, e.prototype._subscribe = function(t) {
600
- var r;
601
- return (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(t);
602
- }, e.prototype[sr] = function() {
662
+ }, r.prototype._subscribe = function(e) {
663
+ var t;
664
+ return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
665
+ }, r.prototype[Mt] = function() {
603
666
  return this;
604
- }, e.prototype.pipe = function() {
605
- for (var t = [], r = 0; r < arguments.length; r++)
606
- t[r] = arguments[r];
607
- return or(t)(this);
608
- }, e.prototype.toPromise = function(t) {
609
- var r = this;
610
- return t = ze(t), new t(function(s, n) {
611
- var a;
612
- r.subscribe(function(o) {
613
- return a = o;
614
- }, function(o) {
615
- return n(o);
667
+ }, r.prototype.pipe = function() {
668
+ for (var e = [], t = 0; t < arguments.length; t++)
669
+ e[t] = arguments[t];
670
+ return Ot(e)(this);
671
+ }, r.prototype.toPromise = function(e) {
672
+ var t = this;
673
+ return e = Re(e), new e(function(n, o) {
674
+ var i;
675
+ t.subscribe(function(s) {
676
+ return i = s;
677
+ }, function(s) {
678
+ return o(s);
616
679
  }, function() {
617
- return s(a);
680
+ return n(i);
618
681
  });
619
682
  });
620
- }, e.create = function(t) {
621
- return new e(t);
622
- }, e;
683
+ }, r.create = function(e) {
684
+ return new r(e);
685
+ }, r;
623
686
  })();
624
- function ze(e) {
625
- var t;
626
- return (t = e ?? Qt.Promise) !== null && t !== void 0 ? t : Promise;
687
+ function Re(r) {
688
+ var e;
689
+ return (e = r ?? Lt.Promise) !== null && e !== void 0 ? e : Promise;
627
690
  }
628
- function ar(e) {
629
- return e && G(e.next) && G(e.error) && G(e.complete);
691
+ function Dt(r) {
692
+ return r && F(r.next) && F(r.error) && F(r.complete);
630
693
  }
631
- function ir(e) {
632
- return e && e instanceof Et || ar(e) && St(e);
694
+ function xt(r) {
695
+ return r && r instanceof Ve || Dt(r) && $e(r);
633
696
  }
634
- var cr = wt(function(e) {
697
+ var Ct = He(function(r) {
635
698
  return function() {
636
- e(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
699
+ r(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
637
700
  };
638
- }), vt = (function(e) {
639
- de(t, e);
640
- function t() {
641
- var r = e.call(this) || this;
642
- return r.closed = !1, r.currentObservers = null, r.observers = [], r.isStopped = !1, r.hasError = !1, r.thrownError = null, r;
701
+ }), qe = (function(r) {
702
+ K(e, r);
703
+ function e() {
704
+ var t = r.call(this) || this;
705
+ return t.closed = !1, t.currentObservers = null, t.observers = [], t.isStopped = !1, t.hasError = !1, t.thrownError = null, t;
643
706
  }
644
- return t.prototype.lift = function(r) {
645
- var s = new Xe(this, this);
646
- return s.operator = r, s;
647
- }, t.prototype._throwIfClosed = function() {
707
+ return e.prototype.lift = function(t) {
708
+ var n = new Ie(this, this);
709
+ return n.operator = t, n;
710
+ }, e.prototype._throwIfClosed = function() {
648
711
  if (this.closed)
649
- throw new cr();
650
- }, t.prototype.next = function(r) {
651
- var s = this;
652
- ce(function() {
653
- var n, a;
654
- if (s._throwIfClosed(), !s.isStopped) {
655
- s.currentObservers || (s.currentObservers = Array.from(s.observers));
712
+ throw new Ct();
713
+ }, e.prototype.next = function(t) {
714
+ var n = this;
715
+ $(function() {
716
+ var o, i;
717
+ if (n._throwIfClosed(), !n.isStopped) {
718
+ n.currentObservers || (n.currentObservers = Array.from(n.observers));
656
719
  try {
657
- for (var o = Le(s.currentObservers), i = o.next(); !i.done; i = o.next()) {
658
- var l = i.value;
659
- l.next(r);
720
+ for (var s = ae(n.currentObservers), a = s.next(); !a.done; a = s.next()) {
721
+ var c = a.value;
722
+ c.next(t);
660
723
  }
661
- } catch (d) {
662
- n = { error: d };
724
+ } catch (p) {
725
+ o = { error: p };
663
726
  } finally {
664
727
  try {
665
- i && !i.done && (a = o.return) && a.call(o);
728
+ a && !a.done && (i = s.return) && i.call(s);
666
729
  } finally {
667
- if (n) throw n.error;
730
+ if (o) throw o.error;
668
731
  }
669
732
  }
670
733
  }
671
734
  });
672
- }, t.prototype.error = function(r) {
673
- var s = this;
674
- ce(function() {
675
- if (s._throwIfClosed(), !s.isStopped) {
676
- s.hasError = s.isStopped = !0, s.thrownError = r;
677
- for (var n = s.observers; n.length; )
678
- n.shift().error(r);
735
+ }, e.prototype.error = function(t) {
736
+ var n = this;
737
+ $(function() {
738
+ if (n._throwIfClosed(), !n.isStopped) {
739
+ n.hasError = n.isStopped = !0, n.thrownError = t;
740
+ for (var o = n.observers; o.length; )
741
+ o.shift().error(t);
679
742
  }
680
743
  });
681
- }, t.prototype.complete = function() {
682
- var r = this;
683
- ce(function() {
684
- if (r._throwIfClosed(), !r.isStopped) {
685
- r.isStopped = !0;
686
- for (var s = r.observers; s.length; )
687
- s.shift().complete();
744
+ }, e.prototype.complete = function() {
745
+ var t = this;
746
+ $(function() {
747
+ if (t._throwIfClosed(), !t.isStopped) {
748
+ t.isStopped = !0;
749
+ for (var n = t.observers; n.length; )
750
+ n.shift().complete();
688
751
  }
689
752
  });
690
- }, t.prototype.unsubscribe = function() {
753
+ }, e.prototype.unsubscribe = function() {
691
754
  this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
692
- }, Object.defineProperty(t.prototype, "observed", {
755
+ }, Object.defineProperty(e.prototype, "observed", {
693
756
  get: function() {
694
- var r;
695
- return ((r = this.observers) === null || r === void 0 ? void 0 : r.length) > 0;
757
+ var t;
758
+ return ((t = this.observers) === null || t === void 0 ? void 0 : t.length) > 0;
696
759
  },
697
760
  enumerable: !1,
698
761
  configurable: !0
699
- }), t.prototype._trySubscribe = function(r) {
700
- return this._throwIfClosed(), e.prototype._trySubscribe.call(this, r);
701
- }, t.prototype._subscribe = function(r) {
702
- return this._throwIfClosed(), this._checkFinalizedStatuses(r), this._innerSubscribe(r);
703
- }, t.prototype._innerSubscribe = function(r) {
704
- var s = this, n = this, a = n.hasError, o = n.isStopped, i = n.observers;
705
- return a || o ? bt : (this.currentObservers = null, i.push(r), new pe(function() {
706
- s.currentObservers = null, Ie(i, r);
762
+ }), e.prototype._trySubscribe = function(t) {
763
+ return this._throwIfClosed(), r.prototype._trySubscribe.call(this, t);
764
+ }, e.prototype._subscribe = function(t) {
765
+ return this._throwIfClosed(), this._checkFinalizedStatuses(t), this._innerSubscribe(t);
766
+ }, e.prototype._innerSubscribe = function(t) {
767
+ var n = this, o = this, i = o.hasError, s = o.isStopped, a = o.observers;
768
+ return i || s ? ze : (this.currentObservers = null, a.push(t), new Q(function() {
769
+ n.currentObservers = null, ue(a, t);
707
770
  }));
708
- }, t.prototype._checkFinalizedStatuses = function(r) {
709
- var s = this, n = s.hasError, a = s.thrownError, o = s.isStopped;
710
- n ? r.error(a) : o && r.complete();
711
- }, t.prototype.asObservable = function() {
712
- var r = new He();
713
- return r.source = this, r;
714
- }, t.create = function(r, s) {
715
- return new Xe(r, s);
716
- }, t;
717
- })(He), Xe = (function(e) {
718
- de(t, e);
719
- function t(r, s) {
720
- var n = e.call(this) || this;
721
- return n.destination = r, n.source = s, n;
722
- }
723
- return t.prototype.next = function(r) {
724
- var s, n;
725
- (n = (s = this.destination) === null || s === void 0 ? void 0 : s.next) === null || n === void 0 || n.call(s, r);
726
- }, t.prototype.error = function(r) {
727
- var s, n;
728
- (n = (s = this.destination) === null || s === void 0 ? void 0 : s.error) === null || n === void 0 || n.call(s, r);
729
- }, t.prototype.complete = function() {
730
- var r, s;
731
- (s = (r = this.destination) === null || r === void 0 ? void 0 : r.complete) === null || s === void 0 || s.call(r);
732
- }, t.prototype._subscribe = function(r) {
733
- var s, n;
734
- return (n = (s = this.source) === null || s === void 0 ? void 0 : s.subscribe(r)) !== null && n !== void 0 ? n : bt;
735
- }, t;
736
- })(vt);
737
- const kt = 3e3;
738
- var _t = /* @__PURE__ */ ((e) => (e.Warning = "warning", e.Success = "success", e.Error = "error", e.Info = "info", e))(_t || {}), At = /* @__PURE__ */ ((e) => (e.Success = "mdi-checkbox-marked-circle", e.Warning = "mdi-alert", e.Error = "mdi-alert-circle", e.Info = "mdi-information", e.None = "none", e))(At || {}), Tt = /* @__PURE__ */ ((e) => (e.Warning = "Warning", e.Success = "Success", e.Error = "Error", e.Info = "Info", e))(Tt || {}), lr = /* @__PURE__ */ ((e) => (e.Center = "center", e.Left = "left", e.Right = "right", e.Bottom = "bottom", e.Top = "top", e))(lr || {});
739
- class ur {
740
- constructor(t = "", r = "info", s = "none", n = "Info", a = kt, o = "center", i = !1) {
741
- this.message = t, this.color = r, this.icon = s, this.title = n, this.timeout = a, this.position = o, this.visible = i;
742
- }
743
- }
744
- class hr {
745
- static subject = new vt();
771
+ }, e.prototype._checkFinalizedStatuses = function(t) {
772
+ var n = this, o = n.hasError, i = n.thrownError, s = n.isStopped;
773
+ o ? t.error(i) : s && t.complete();
774
+ }, e.prototype.asObservable = function() {
775
+ var t = new Te();
776
+ return t.source = this, t;
777
+ }, e.create = function(t, n) {
778
+ return new Ie(t, n);
779
+ }, e;
780
+ })(Te), Ie = (function(r) {
781
+ K(e, r);
782
+ function e(t, n) {
783
+ var o = r.call(this) || this;
784
+ return o.destination = t, o.source = n, o;
785
+ }
786
+ return e.prototype.next = function(t) {
787
+ var n, o;
788
+ (o = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || o === void 0 || o.call(n, t);
789
+ }, e.prototype.error = function(t) {
790
+ var n, o;
791
+ (o = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || o === void 0 || o.call(n, t);
792
+ }, e.prototype.complete = function() {
793
+ var t, n;
794
+ (n = (t = this.destination) === null || t === void 0 ? void 0 : t.complete) === null || n === void 0 || n.call(t);
795
+ }, e.prototype._subscribe = function(t) {
796
+ var n, o;
797
+ return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(t)) !== null && o !== void 0 ? o : ze;
798
+ }, e;
799
+ })(qe);
800
+ const Je = 3e3;
801
+ var Ke = /* @__PURE__ */ ((r) => (r.Warning = "warning", r.Success = "success", r.Error = "error", r.Info = "info", r))(Ke || {}), Qe = /* @__PURE__ */ ((r) => (r.Success = "mdi-checkbox-marked-circle", r.Warning = "mdi-alert", r.Error = "mdi-alert-circle", r.Info = "mdi-information", r.None = "none", r))(Qe || {}), Ze = /* @__PURE__ */ ((r) => (r.Warning = "Warning", r.Success = "Success", r.Error = "Error", r.Info = "Info", r))(Ze || {}), Nt = /* @__PURE__ */ ((r) => (r.Center = "center", r.Left = "left", r.Right = "right", r.Bottom = "bottom", r.Top = "top", r))(Nt || {});
802
+ class Ft {
803
+ constructor(e = "", t = "info", n = "none", o = "Info", i = Je, s = "center", a = !1) {
804
+ this.message = e, this.color = t, this.icon = n, this.title = o, this.timeout = i, this.position = s, this.visible = a;
805
+ }
806
+ }
807
+ class Dr {
808
+ static subject = new qe();
746
809
  static get snack$() {
747
810
  return this.subject.asObservable();
748
811
  }
749
- static createSnackbar(t, r) {
812
+ static createSnackbar(e, t) {
750
813
  this.subject.next(
751
- new ur(
752
- t,
753
- _t[r],
754
- At[r],
755
- Tt[r],
756
- kt,
814
+ new Ft(
815
+ e,
816
+ Ke[t],
817
+ Qe[t],
818
+ Ze[t],
819
+ Je,
757
820
  "bottom",
758
821
  !0
759
822
  )
760
823
  );
761
824
  }
762
- static success(t) {
825
+ static success(e) {
763
826
  this.createSnackbar(
764
- t,
827
+ e,
765
828
  "Success"
766
829
  /* Success */
767
830
  );
768
831
  }
769
- static warn(t) {
832
+ static warn(e) {
770
833
  this.createSnackbar(
771
- t,
834
+ e,
772
835
  "Warning"
773
836
  /* Warning */
774
837
  );
775
838
  }
776
- static error(t) {
839
+ static error(e) {
777
840
  this.createSnackbar(
778
- t,
841
+ e,
779
842
  "Error"
780
843
  /* Error */
781
844
  );
782
845
  }
783
- static info(t) {
846
+ static info(e) {
784
847
  this.createSnackbar(
785
- t,
848
+ e,
786
849
  "Info"
787
850
  /* Info */
788
851
  );
789
852
  }
790
853
  }
791
- function Lt(e, t) {
792
- const r = {};
793
- for (let s in t)
794
- if (Array.isArray(t[s]))
795
- JSON.stringify(e[s]) !== JSON.stringify(t[s]) && (r[s] = t[s]);
796
- else if (e[s] && typeof e[s] == "object" && t[s] && typeof t[s] == "object") {
797
- const n = Lt(e[s], t[s]);
798
- Object.keys(n).length > 0 && (r[s] = n);
799
- } else JSON.stringify(e[s]) !== JSON.stringify(t[s]) && (r[s] = t[s]);
800
- return r;
801
- }
802
- function fr(e) {
803
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
804
- }
805
- var be, Ve;
806
- function dr() {
807
- if (Ve) return be;
808
- Ve = 1;
809
- class e {
810
- /// value;
811
- /// next;
812
- constructor(s) {
813
- this.value = s, this.next = void 0;
814
- }
815
- }
816
- class t {
817
- // TODO: Use private class fields when targeting Node.js 12.
818
- // #_head;
819
- // #_tail;
820
- // #_size;
821
- constructor() {
822
- this.clear();
823
- }
824
- enqueue(s) {
825
- const n = new e(s);
826
- this._head ? (this._tail.next = n, this._tail = n) : (this._head = n, this._tail = n), this._size++;
827
- }
828
- dequeue() {
829
- const s = this._head;
830
- if (s)
831
- return this._head = this._head.next, this._size--, s.value;
832
- }
833
- clear() {
834
- this._head = void 0, this._tail = void 0, this._size = 0;
835
- }
836
- get size() {
837
- return this._size;
838
- }
839
- *[Symbol.iterator]() {
840
- let s = this._head;
841
- for (; s; )
842
- yield s.value, s = s.next;
843
- }
844
- }
845
- return be = t, be;
846
- }
847
- var Se, qe;
848
- function pr() {
849
- if (qe) return Se;
850
- qe = 1;
851
- const e = dr();
852
- return Se = (r) => {
853
- if (!((Number.isInteger(r) || r === 1 / 0) && r > 0))
854
- throw new TypeError("Expected `concurrency` to be a number from 1 and up");
855
- const s = new e();
856
- let n = 0;
857
- const a = () => {
858
- n--, s.size > 0 && s.dequeue()();
859
- }, o = async (d, u, ...y) => {
860
- n++;
861
- const g = (async () => d(...y))();
862
- u(g);
863
- try {
864
- await g;
865
- } catch {
866
- }
867
- a();
868
- }, i = (d, u, ...y) => {
869
- s.enqueue(o.bind(null, d, u, ...y)), (async () => (await Promise.resolve(), n < r && s.size > 0 && s.dequeue()()))();
870
- }, l = (d, ...u) => new Promise((y) => {
871
- i(d, y, ...u);
872
- });
873
- return Object.defineProperties(l, {
874
- activeCount: {
875
- get: () => n
876
- },
877
- pendingCount: {
878
- get: () => s.size
879
- },
880
- clearQueue: {
881
- value: () => {
882
- s.clear();
883
- }
884
- }
885
- }), l;
886
- }, Se;
887
- }
888
- var yr = pr();
889
- const gr = /* @__PURE__ */ fr(yr), z = gr(10), mr = 1e3;
890
- async function q(e, t) {
891
- const r = gt(t);
892
- try {
893
- const s = await fetch(e, r);
894
- return await mt(s);
895
- } catch (s) {
896
- throw s instanceof TypeError && hr.error("Network error. Please check your connection."), s;
897
- }
898
- }
899
- const c = {
900
- async fetch(e, t = {}) {
901
- return t.method = "GET", await z(() => q(e, t));
902
- },
903
- async patch(e, t, r = null, s = {}) {
904
- if (s.method = "PATCH", s.body = r ? Lt(r, t) : t, Object.keys(s.body).length !== 0)
905
- return await z(() => q(e, s));
906
- },
907
- async post(e, t = void 0, r = {}) {
908
- return r.method = "POST", r.body = t, await z(() => q(e, r));
909
- },
910
- async put(e, t = void 0, r = {}) {
911
- return r.method = "PUT", r.body = t, await z(() => q(e, r));
912
- },
913
- async delete(e, t = void 0, r = {}) {
914
- return r.method = "DELETE", r.body = t, await z(() => q(e, r));
915
- },
916
- async paginatedFetch(e, t) {
917
- const r = t ?? mr, s = e.includes("?") ? "&" : "?", n = `${e}${s}page_size=${r}&page=1`, a = gt({ method: "GET" }), o = await z(() => fetch(n, a)), i = Number(o.headers.get("x-total-pages")) || 1, d = [...await mt(o)];
918
- for (let u = 2; u <= i; u++) {
919
- const y = `${e}${s}page_size=${r}&page=${u}`, g = await z(() => q(y, { method: "GET" }));
920
- d.push(...g);
921
- }
922
- return d;
923
- }
924
- }, Je = {
925
- HTTP: {
926
- type: "HTTP",
927
- sourceUri: "",
928
- placeholderVariables: []
929
- },
930
- local: {
931
- type: "local",
932
- sourceUri: "",
933
- placeholderVariables: []
934
- }
935
- }, Qe = {
936
- JSON: {
937
- type: "JSON",
938
- timestamp: {
939
- key: "",
940
- format: "ISO8601",
941
- timezoneMode: "embeddedOffset"
942
- },
943
- JMESPath: ""
944
- },
945
- CSV: {
946
- type: "CSV",
947
- timestamp: {
948
- key: "",
949
- format: "ISO8601",
950
- timezoneMode: "embeddedOffset"
951
- },
952
- headerRow: 1,
953
- dataStartRow: 2,
954
- delimiter: ",",
955
- identifierType: "name"
956
- /* Name */
957
- }
958
- }, Ke = {
959
- HydroServer: {
960
- type: "HydroServer"
961
- }
962
- };
963
- class ys {
964
- name = "";
965
- settings = {
966
- type: "SDL",
967
- extractor: JSON.parse(JSON.stringify(Je.local)),
968
- transformer: JSON.parse(JSON.stringify(Qe.CSV)),
969
- loader: JSON.parse(JSON.stringify(Ke.HydroServer)),
970
- payloads: []
971
- };
972
- id = "";
973
- workspaceId = "";
974
- orchestrationSystem = {
975
- id: "",
976
- name: "",
977
- workspaceId: "",
978
- type: ""
979
- };
980
- schedule = {
981
- interval: 15,
982
- intervalUnits: "minutes"
983
- };
984
- status = { paused: !0 };
985
- datastreams = [];
986
- constructor(t) {
987
- Object.assign(this, t);
988
- }
989
- switchExtractor(t) {
990
- this.settings.extractor = JSON.parse(
991
- JSON.stringify(Je[t])
992
- );
993
- }
994
- switchTransformer(t) {
995
- this.settings.transformer = JSON.parse(
996
- JSON.stringify(Qe[t])
997
- );
998
- }
999
- switchLoader(t) {
1000
- this.settings.loader = JSON.parse(JSON.stringify(Ke[t]));
1001
- }
1002
- }
1003
- function Ze(e) {
1004
- return {
1005
- name: e.name,
1006
- settings: e.settings,
1007
- workspaceId: e.workspaceId,
1008
- orchestrationSystemId: e.orchestrationSystem.id,
1009
- schedule: e.schedule,
1010
- status: e.status
1011
- };
854
+ function xr(r, e) {
855
+ const t = new Date(r);
856
+ return t.setHours(t.getHours() - e), t.toISOString();
1012
857
  }
1013
- const C = "https://lro.hydroserver.org/api", De = `${C}/auth`, N = `${De}/browser/account`, Ee = `${De}/browser/session`, le = `${De}/browser/provider`, R = `${C}/data/workspaces`, ve = `${C}/data/roles`, O = `${C}/data/datastreams`, H = `${C}/data/sensors`, A = `${C}/data/things`, et = `${A}/tags`, J = `${C}/data/orchestration-systems`, Y = `${C}/data/data-sources`, X = `${C}/data/observed-properties`, Q = `${C}/data/processing-levels`, ee = `${C}/data/result-qualifiers`, V = `${C}/data/units`, gs = (e, t, r, s, n) => {
1014
- let a = `${O}/${e}/observations?format=column`;
1015
- return a += `&order_by=phenomenonTime&page_size=${t}`, a += `&phenomenon_time_min=${encodeURIComponent(r)}`, s && (a += `&phenomenon_time_max=${encodeURIComponent(s)}`), n && (a += `&page=${n}`), a;
1016
- }, wr = (e, t, r) => {
1017
- const s = {
1018
- provider: e,
1019
- callback_url: t,
1020
- process: r
1021
- }, n = yt(), a = document.createElement("form");
1022
- if (a.method = "POST", a.action = `${le}/redirect`, n) {
1023
- const o = document.createElement("input");
1024
- o.type = "hidden", o.name = "csrfmiddlewaretoken", o.value = n, a.appendChild(o);
1025
- }
1026
- for (const o in s) {
1027
- const i = document.createElement("input");
1028
- i.type = "hidden", i.name = o, i.value = s[o] || "", a.appendChild(i);
1029
- }
1030
- document.body.appendChild(a), a.submit();
1031
- }, ms = {
1032
- fetchSession: async () => c.fetch(`${Ee}`),
1033
- login: async (e, t) => c.post(`${Ee}`, { email: e, password: t }),
1034
- logout: async () => c.delete(`${Ee}`),
1035
- fetchUser: async () => c.fetch(`${N}`),
1036
- signup: async (e) => c.post(`${N}`, e),
1037
- updateUser: async (e, t) => c.patch(`${N}`, e, t),
1038
- deleteUser: async () => c.delete(`${N}`),
1039
- sendVerificationEmail: async (e) => c.put(`${N}/email/verify`, {
1040
- email: e
1041
- }),
1042
- verifyEmailWithCode: async (e) => c.post(`${N}/email/verify`, { key: e }),
1043
- requestPasswordReset: async (e) => c.post(`${N}/password/request`, {
1044
- email: e
1045
- }),
1046
- resetPassword: async (e, t) => c.post(`${N}/password/reset`, {
1047
- key: e,
1048
- password: t
1049
- }),
1050
- fetchWorkspaces: async () => c.paginatedFetch(`${R}`),
1051
- fetchAssociatedWorkspaces: async () => c.paginatedFetch(`${R}?is_associated=true`),
1052
- fetchWorkspace: async (e) => c.fetch(`${R}/${e}`),
1053
- createWorkspace: async (e) => c.post(R, e),
1054
- updateWorkspace: async (e, t = null) => c.patch(
1055
- `${R}/${e.id}`,
1056
- e,
1057
- t
1058
- ),
1059
- deleteWorkspace: async (e) => c.delete(`${R}/${e}`),
1060
- transferWorkspace: async (e, t) => c.post(`${R}/${e}/transfer`, { newOwner: t }),
1061
- acceptWorkspaceTransfer: async (e) => c.put(`${R}/${e}/transfer`),
1062
- rejectWorkspaceTransfer: async (e) => c.delete(`${R}/${e}/transfer`),
1063
- getCollaboratorRoles: async (e) => c.paginatedFetch(`${ve}?is_user_role=true`),
1064
- getAPIKeyRoles: async (e) => c.paginatedFetch(`${ve}?is_apikey_role=true`),
1065
- getRole: async (e) => c.fetch(`${ve}/${e}`),
1066
- getCollaborators: async (e) => c.paginatedFetch(`${R}/${e}/collaborators`),
1067
- addCollaborator: async (e, t, r) => c.post(`${R}/${e}/collaborators`, {
1068
- email: t,
1069
- roleId: r
1070
- }),
1071
- updateCollaboratorRole: async (e, t, r) => c.put(`${R}/${e}/collaborators`, {
1072
- email: t,
1073
- roleId: r
1074
- }),
1075
- removeCollaborator: async (e, t) => c.delete(`${R}/${e}/collaborators`, { email: t }),
1076
- fetchApiKeys: async (e) => c.paginatedFetch(
1077
- `${R}/${e}/api-keys?expand_related=true`
1078
- ),
1079
- fetchApiKey: async (e, t) => c.fetch(
1080
- `${R}/${e}/api-keys/${t}?expand_related=true`
1081
- ),
1082
- createApiKey: async (e) => c.post(
1083
- `${R}/${e.workspaceId}/api-keys?expand_related=true`,
1084
- {
1085
- name: e.name,
1086
- description: e.description,
1087
- isActive: !0,
1088
- roleId: e.role.id
1089
- }
1090
- ),
1091
- updateApiKey: async (e, t) => c.patch(
1092
- `${R}/${e.workspaceId}/api-keys/${e.id}?expand_related=true`,
1093
- {
1094
- name: e.name,
1095
- description: e.description,
1096
- isActive: !0,
1097
- roleId: e.role.id
1098
- },
1099
- t && {
1100
- name: t.name,
1101
- description: t.description,
1102
- isActive: !0,
1103
- roleId: t.role.id
1104
- }
1105
- ),
1106
- regenerateApiKey: async (e, t) => c.put(
1107
- `${R}/${e}/api-keys/${t}/regenerate?expand_related=true`
1108
- ),
1109
- deleteApiKey: async (e, t) => c.delete(`${R}/${e}/api-keys/${t}`),
1110
- fetchConnectedProviders: async () => c.fetch(`${le}/connections`),
1111
- providerRedirect: wr,
1112
- providerSignup: async (e) => c.post(`${le}/signup`, e),
1113
- deleteProvider: async (e, t) => c.delete(`${le}/connections`, {
1114
- provider: e,
1115
- account: t
1116
- }),
1117
- createUnit: async (e) => c.post(V, e),
1118
- fetchUnits: async () => c.paginatedFetch(`${V}`),
1119
- fetchWorkspaceUnits: async (e) => c.paginatedFetch(`${V}?workspace_id=${e}`),
1120
- updateUnit: async (e, t = null) => c.patch(`${V}/${e.id}`, e, t),
1121
- deleteUnit: async (e) => c.delete(`${V}/${e}`),
1122
- getUnit: async (e) => c.fetch(`${V}/${e}`),
1123
- removeThingOwner: async (e, t) => c.patch(`${A}/${e}/ownership`, {
1124
- email: t,
1125
- removeOwner: !0
1126
- }),
1127
- addSecondaryOwner: async (e, t) => c.patch(`${A}/${e}/ownership`, {
1128
- email: t,
1129
- makeOwner: !0
1130
- }),
1131
- transferPrimaryOwnership: async (e, t) => c.patch(`${A}/${e}/ownership`, {
1132
- email: t,
1133
- transferPrimary: !0
1134
- }),
1135
- createThing: async (e) => c.post(A, e),
1136
- fetchThings: async () => c.paginatedFetch(`${A}`),
1137
- fetchThingsForWorkspace: async (e) => c.paginatedFetch(`${A}?workspace_id=${e}`),
1138
- fetchOwnedThings: async () => c.paginatedFetch(`${A}?owned_only=true`),
1139
- fetchThing: async (e) => c.fetch(`${A}/${e}`),
1140
- updateThing: async (e) => c.patch(`${A}/${e.id}`, e),
1141
- updateThingPrivacy: async (e, t) => c.patch(`${A}/${e}`, { isPrivate: t }),
1142
- deleteThing: async (e) => c.delete(`${A}/${e}`),
1143
- fetchMetadataForThingOwner: async (e) => c.paginatedFetch(
1144
- `${A}/${e}/metadata?include_assignable_metadata=true`
1145
- ),
1146
- fetchMetadataForThing: async (e) => c.fetch(`${A}/${e}/metadata`),
1147
- uploadSitePhotos: async (e, t) => c.post(`${A}/${e}/photos`, t),
1148
- fetchSitePhotos: async (e) => c.paginatedFetch(`${A}/${e}/photos`),
1149
- deleteSitePhoto: async (e, t) => c.delete(`${A}/${e}/photos`, { name: t }),
1150
- createSiteTag: async (e, t) => c.post(`${A}/${e}/tags`, t),
1151
- editSiteTag: async (e, t) => c.put(`${A}/${e}/tags`, t),
1152
- fetchSiteTags: async (e) => c.fetch(`${A}/${e}/tags`),
1153
- fetchUsersSiteTags: async () => c.fetch(`${et}`),
1154
- deleteSiteTag: async (e, t) => c.delete(`${A}/${e}/tags`, t),
1155
- fetchWorkspaceTags: async (e) => c.fetch(`${et}/keys?workspace_id=${e}`),
1156
- createHydroShareArchive: async (e) => c.post(`${A}/${e.thingId}/archive`, e),
1157
- updateHydroShareArchive: async (e, t) => c.patch(
1158
- `${A}/${e.thingId}/archive`,
1159
- e,
1160
- t
1161
- ),
1162
- fetchHydroShareArchive: async (e) => c.fetch(`${A}/${e}/archive`),
1163
- deleteHydroShareArchive: async (e) => c.delete(`${A}/${e}/archive`),
1164
- archiveToHydroShare: async (e) => c.post(`${A}/${e}/archive/trigger`),
1165
- createDatastream: async (e) => c.post(O, e),
1166
- fetchDatastreams: async (e) => {
1167
- const t = [];
1168
- if (e)
1169
- for (const [s, n] of Object.entries(e))
1170
- t.push(`${encodeURIComponent(s)}=${encodeURIComponent(n)}`);
1171
- const r = t.length ? `?${t.join("&")}` : "";
1172
- return c.paginatedFetch(`${O}${r}`);
1173
- },
1174
- fetchDatastreamsForThing: async (e) => c.paginatedFetch(`${O}?thing_id=${e}`),
1175
- fetchExpandedDatastreamsForThing: async (e) => c.paginatedFetch(
1176
- `${O}?thing_id=${e}&expand_related=true`
1177
- ),
1178
- fetchDatastreamsForDataSource: async (e) => c.paginatedFetch(`${O}?data_source_id=${e}`),
1179
- fetchDatastream: async (e) => c.fetch(`${O}/${e}`),
1180
- fetchDatastreamExpanded: async (e) => c.fetch(`${O}/${e}?expand_related=true`),
1181
- fetchUsersDatastreams: async () => c.paginatedFetch(`${O}?exclude_unowned=true`),
1182
- updateDatastream: async (e, t = null) => c.patch(`${O}/${e.id}`, e, t),
1183
- deleteDatastream: async (e) => c.delete(`${O}/${e}`),
1184
- downloadDatastreamCSV: async (e) => c.fetch(`${O}/${e}/csv`),
1185
- createObservedProperty: async (e) => c.post(X, e),
1186
- fetchObservedProperty: async (e) => c.fetch(`${X}/${e}`),
1187
- fetchObservedProperties: async () => c.paginatedFetch(`${X}`),
1188
- fetchWorkspaceObservedProperties: async (e) => c.paginatedFetch(`${X}?workspace_id=${e}`),
1189
- updateObservedProperty: async (e, t = null) => c.patch(`${X}/${e.id}`, e, t),
1190
- deleteObservedProperty: async (e) => c.delete(`${X}/${e}`),
1191
- createProcessingLevel: async (e) => c.post(Q, e),
1192
- fetchProcessingLevels: async () => c.paginatedFetch(`${Q}`),
1193
- fetchProcessingLevel: async (e) => c.fetch(`${Q}/${e}`),
1194
- fetchWorkspaceProcessingLevels: async (e) => c.paginatedFetch(`${Q}?workspace_id=${e}`),
1195
- updateProcessingLevel: async (e, t = null) => c.patch(`${Q}/${e.id}`, e, t),
1196
- deleteProcessingLevel: async (e) => c.delete(`${Q}/${e}`),
1197
- createSensor: async (e) => c.post(H, e),
1198
- fetchSensors: async () => c.paginatedFetch(`${H}`),
1199
- fetchSensor: async (e) => c.fetch(`${H}/${e}`),
1200
- fetchWorkspaceSensors: async (e) => c.paginatedFetch(`${H}?workspace_id=${e}`),
1201
- updateSensor: async (e, t = null) => c.patch(`${H}/${e.id}`, e, t),
1202
- deleteSensor: async (e) => c.delete(`${H}/${e}`),
1203
- createResultQualifier: async (e) => c.post(ee, e),
1204
- fetchResultQualifiers: async () => c.paginatedFetch(`${ee}`),
1205
- fetchWorkspaceResultQualifiers: async (e) => c.paginatedFetch(`${ee}?workspace_id=${e}`),
1206
- updateResultQualifier: async (e, t = null) => c.patch(
1207
- `${ee}/${e.id}`,
1208
- e,
1209
- t
1210
- ),
1211
- deleteResultQualifier: async (e) => c.delete(`${ee}/${e}`),
1212
- createOrchestrationSystem: async (e) => c.post(J, e),
1213
- fetchOrchestrationSystems: async () => c.paginatedFetch(J),
1214
- fetchWorkspaceOrchestrationSystems: async (e) => c.paginatedFetch(`${J}?workspace_id=${e}`),
1215
- fetchOrchestrationSystem: async (e) => c.fetch(`${J}/${e}`),
1216
- updateOrchestrationSystem: async (e, t) => c.patch(`${J}/${e}`, t),
1217
- deleteOrchestrationSystem: async (e) => c.delete(`${J}/${e}`),
1218
- createDataSource: async (e) => c.post(
1219
- `${Y}?expand_related=true`,
1220
- Ze(e)
1221
- ),
1222
- fetchDataSources: async () => c.paginatedFetch(`${Y}?expand_related=true`),
1223
- fetchWorkspaceDataSources: async (e) => c.paginatedFetch(
1224
- `${Y}?workspace_id=${e}&expand_related=true`
1225
- ),
1226
- fetchDataSource: async (e) => c.fetch(`${Y}/${e}?expand_related=true`),
1227
- updateDataSource: async (e) => c.patch(
1228
- `${Y}/${e.id}?expand_related=true`,
1229
- Ze(e)
1230
- ),
1231
- updateDataSourcePartial: async (e) => c.patch(
1232
- `${Y}/${e.id}?expand_related=true`,
1233
- e
1234
- ),
1235
- deleteDataSource: async (e) => c.delete(`${Y}/${e}`),
1236
- linkDatastreamToDataSource: async (e, t) => c.post(
1237
- `${Y}/${e}/datastreams/${t}`
1238
- ),
1239
- unlinkDatastreamFromDataSource: async (e, t) => c.delete(
1240
- `${Y}/${e}/datastreams/${t}`
1241
- ),
1242
- fetchObservations: async (e) => c.fetch(e),
1243
- deleteObservationsForDatastream: async (e) => c.post(`${O}/${e}/observations/bulk-delete`, {
1244
- phenomenonTimeStart: null,
1245
- phenomenonTimeEnd: null
1246
- }),
1247
- fetchUserTypes: async () => c.fetch(`${N}/user-types`),
1248
- fetchOrganizationTypes: async () => c.fetch(`${N}/organization-types`),
1249
- fetchSiteTypes: async () => c.fetch(`${A}/site-types`),
1250
- fetchSamplingFeatureTypes: async () => c.paginatedFetch(`${A}/sampling-feature-types`),
1251
- fetchSensorEncodingTypes: async () => c.paginatedFetch(`${H}/encoding-types`),
1252
- fetchMethodTypes: async () => c.paginatedFetch(`${H}/method-types`),
1253
- fetchVariableTypes: async () => c.paginatedFetch(`${X}/variable-types`),
1254
- fetchUnitTypes: async () => c.paginatedFetch(`${V}/types`),
1255
- fetchDatastreamStatuses: async () => c.paginatedFetch(`${O}/statuses`),
1256
- fetchDatastreamAggregations: async () => c.paginatedFetch(`${O}/aggregation-statistics`),
1257
- fetchSampledMediums: async () => c.paginatedFetch(`${O}/sampled-mediums`)
1258
- };
1259
- class ws {
1260
- name = "";
1261
- mappings = [];
1262
- extractorVariables = {};
1263
- constructor(t) {
1264
- Object.assign(this, t);
1265
- }
1266
- }
1267
- const $t = 1, he = $t * 60, Ce = he * 60, xe = Ce * 24, br = xe * 7, Sr = Ce * 30, Er = xe * 365, oe = {
1268
- [W.SECOND]: $t,
1269
- [W.MINUTE]: he,
1270
- [W.HOUR]: Ce,
1271
- [W.DAY]: xe,
1272
- [W.WEEK]: br,
1273
- [W.MONTH]: Sr,
1274
- [W.YEAR]: Er
1275
- }, bs = (e) => e.toLocaleString(void 0, {
1276
- year: "numeric",
1277
- month: "short",
1278
- day: "2-digit",
1279
- hour: "2-digit",
1280
- hour12: !1,
1281
- minute: "2-digit",
1282
- second: "2-digit"
1283
- }), Ss = (e) => {
1284
- let t, r;
1285
- e >= he * 1e3 ? (t = e / (he * 1e3), r = "m") : e >= 1e3 ? (t = e / 1e3, r = "s") : (t = e, r = "ms");
1286
- let s;
1287
- return r === "ms" ? s = Math.round(t).toString() : s = t.toFixed(2), `${s} ${r}`;
1288
- }, ke = async (e, t) => {
1289
- t && console.info(t);
1290
- const r = performance.now(), s = await e(), a = +(performance.now() - r);
1291
- return { response: s, duration: a };
1292
- };
1293
- function Es(e, t) {
1294
- const r = new Date(e);
1295
- return r.setHours(r.getHours() - t), r.toISOString();
1296
- }
1297
- const B = (e, t) => {
1298
- let r = 0, s = e.length;
1299
- for (; r < s; ) {
1300
- const n = r + s >> 1;
1301
- e[n] < t ? r = n + 1 : s = n;
858
+ const x = (r, e) => {
859
+ let t = 0, n = r.length;
860
+ for (; t < n; ) {
861
+ const o = t + n >> 1;
862
+ r[o] < e ? t = o + 1 : n = o;
1302
863
  }
1303
- return r;
1304
- }, j = (e, t) => {
1305
- let r = 0, s = e.length;
1306
- for (; r < s; ) {
1307
- const n = r + s >> 1;
1308
- e[n] > t ? s = n : r = n + 1;
1309
- }
1310
- return r - 1;
1311
- }, Rt = `(function(){"use strict";function c(n,s,a,u,f,l,y,o){let r=0,e=o;for(let t=l;t<=y;t++)r<a.length&&t===a[r]?r++:(u[e]=n[t],f[e]=s[t],e++);return e-o}self.onmessage=n=>{const{bufferX:s,bufferY:a,outputBufferX:u,outputBufferY:f,start:l,end:y,deleteSegment:o,startTarget:r}=n.data,e=new Float64Array(s),t=new Float32Array(a),A=new Float64Array(u),g=new Float32Array(f);c(e,t,o,A,g,l,y,r),self.postMessage("Done")}})();
1312
- `, tt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Rt], { type: "text/javascript;charset=utf-8" });
1313
- function vr(e) {
1314
- let t;
864
+ return t;
865
+ }, C = (r, e) => {
866
+ let t = 0, n = r.length;
867
+ for (; t < n; ) {
868
+ const o = t + n >> 1;
869
+ r[o] > e ? n = o : t = o + 1;
870
+ }
871
+ return t - 1;
872
+ }, et = `(function(){"use strict";function c(n,s,a,u,f,l,y,o){let r=0,e=o;for(let t=l;t<=y;t++)r<a.length&&t===a[r]?r++:(u[e]=n[t],f[e]=s[t],e++);return e-o}self.onmessage=n=>{const{bufferX:s,bufferY:a,outputBufferX:u,outputBufferY:f,start:l,end:y,deleteSegment:o,startTarget:r}=n.data,e=new Float64Array(s),t=new Float32Array(a),A=new Float64Array(u),g=new Float32Array(f);c(e,t,o,A,g,l,y,r),self.postMessage("Done")}})();
873
+ `, Me = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", et], { type: "text/javascript;charset=utf-8" });
874
+ function Bt(r) {
875
+ let e;
1315
876
  try {
1316
- if (t = tt && (self.URL || self.webkitURL).createObjectURL(tt), !t) throw "";
1317
- const r = new Worker(t, {
1318
- name: e?.name
877
+ if (e = Me && (self.URL || self.webkitURL).createObjectURL(Me), !e) throw "";
878
+ const t = new Worker(e, {
879
+ name: r?.name
1319
880
  });
1320
- return r.addEventListener("error", () => {
1321
- (self.URL || self.webkitURL).revokeObjectURL(t);
1322
- }), r;
881
+ return t.addEventListener("error", () => {
882
+ (self.URL || self.webkitURL).revokeObjectURL(e);
883
+ }), t;
1323
884
  } catch {
1324
885
  return new Worker(
1325
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Rt),
886
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(et),
1326
887
  {
1327
- name: e?.name
888
+ name: r?.name
1328
889
  }
1329
890
  );
1330
891
  }
1331
892
  }
1332
- const It = `(function(){"use strict";function F(n,l,a,o,s,y,g,f,i,w,A){let e=0,t=f;for(let r=y;r<=g;r++)if(o[t]=n[r],s[t]=l[r],t++,e<a.length&&r===a[e][0]){const u=a[e][0],c=a[e][1],d=n[u],h=n[c],m=l[u],D=l[c],x=h-d,P=D-m;let p=d+i;for(;p<h;)o[t]=p,s[t]=w?m+(p-d)*P/x:A,t++,p+=i;e++}return t-f}self.onmessage=n=>{const{bufferX:l,bufferY:a,outputBufferX:o,outputBufferY:s,start:y,end:g,gapsSegment:f,startTarget:i,fillDelta:w,interpolate:A,fillValue:e}=n.data,t=new Float64Array(l),r=new Float32Array(a),u=new Float64Array(o),c=new Float32Array(s);F(t,r,f,u,c,y,g,i,w,A,e),self.postMessage("Done")}})();
1333
- `, rt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", It], { type: "text/javascript;charset=utf-8" });
1334
- function kr(e) {
1335
- let t;
893
+ const tt = `(function(){"use strict";function F(n,l,a,o,s,y,g,f,i,w,A){let e=0,t=f;for(let r=y;r<=g;r++)if(o[t]=n[r],s[t]=l[r],t++,e<a.length&&r===a[e][0]){const u=a[e][0],c=a[e][1],d=n[u],h=n[c],m=l[u],D=l[c],x=h-d,P=D-m;let p=d+i;for(;p<h;)o[t]=p,s[t]=w?m+(p-d)*P/x:A,t++,p+=i;e++}return t-f}self.onmessage=n=>{const{bufferX:l,bufferY:a,outputBufferX:o,outputBufferY:s,start:y,end:g,gapsSegment:f,startTarget:i,fillDelta:w,interpolate:A,fillValue:e}=n.data,t=new Float64Array(l),r=new Float32Array(a),u=new Float64Array(o),c=new Float32Array(s);F(t,r,f,u,c,y,g,i,w,A,e),self.postMessage("Done")}})();
894
+ `, Ue = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", tt], { type: "text/javascript;charset=utf-8" });
895
+ function Pt(r) {
896
+ let e;
1336
897
  try {
1337
- if (t = rt && (self.URL || self.webkitURL).createObjectURL(rt), !t) throw "";
1338
- const r = new Worker(t, {
1339
- name: e?.name
898
+ if (e = Ue && (self.URL || self.webkitURL).createObjectURL(Ue), !e) throw "";
899
+ const t = new Worker(e, {
900
+ name: r?.name
1340
901
  });
1341
- return r.addEventListener("error", () => {
1342
- (self.URL || self.webkitURL).revokeObjectURL(t);
1343
- }), r;
902
+ return t.addEventListener("error", () => {
903
+ (self.URL || self.webkitURL).revokeObjectURL(e);
904
+ }), t;
1344
905
  } catch {
1345
906
  return new Worker(
1346
- "data:text/javascript;charset=utf-8," + encodeURIComponent(It),
907
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(tt),
1347
908
  {
1348
- name: e?.name
909
+ name: r?.name
1349
910
  }
1350
911
  );
1351
912
  }
1352
913
  }
1353
- const Ot = `(function(){"use strict";function g(o,n,c){for(let s=0;s<c.length;s++){const{indexes:t,lowerIdx:l,upperIdx:r}=c[s],i=o[l],f=n[l],a=o[r],d=n[r],p=a-i,w=d-f;if(p===0){for(let e=0;e<t.length;e++)n[t[e]]=f;continue}for(let e=0;e<t.length;e++){const u=t[e];n[u]=f+(o[u]-i)*w/p}}}self.onmessage=o=>{const{bufferX:n,bufferY:c,groups:s}=o.data,t=new Float64Array(n),l=new Float32Array(c);g(t,l,s),self.postMessage("Done")}})();
1354
- `, st = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ot], { type: "text/javascript;charset=utf-8" });
1355
- function _r(e) {
1356
- let t;
914
+ const rt = `(function(){"use strict";function g(o,n,c){for(let s=0;s<c.length;s++){const{indexes:t,lowerIdx:l,upperIdx:r}=c[s],i=o[l],f=n[l],a=o[r],d=n[r],p=a-i,w=d-f;if(p===0){for(let e=0;e<t.length;e++)n[t[e]]=f;continue}for(let e=0;e<t.length;e++){const u=t[e];n[u]=f+(o[u]-i)*w/p}}}self.onmessage=o=>{const{bufferX:n,bufferY:c,groups:s}=o.data,t=new Float64Array(n),l=new Float32Array(c);g(t,l,s),self.postMessage("Done")}})();
915
+ `, Oe = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", rt], { type: "text/javascript;charset=utf-8" });
916
+ function jt(r) {
917
+ let e;
1357
918
  try {
1358
- if (t = st && (self.URL || self.webkitURL).createObjectURL(st), !t) throw "";
1359
- const r = new Worker(t, {
1360
- name: e?.name
919
+ if (e = Oe && (self.URL || self.webkitURL).createObjectURL(Oe), !e) throw "";
920
+ const t = new Worker(e, {
921
+ name: r?.name
1361
922
  });
1362
- return r.addEventListener("error", () => {
1363
- (self.URL || self.webkitURL).revokeObjectURL(t);
1364
- }), r;
923
+ return t.addEventListener("error", () => {
924
+ (self.URL || self.webkitURL).revokeObjectURL(e);
925
+ }), t;
1365
926
  } catch {
1366
927
  return new Worker(
1367
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Ot),
928
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(rt),
1368
929
  {
1369
- name: e?.name
930
+ name: r?.name
1370
931
  }
1371
932
  );
1372
933
  }
1373
934
  }
1374
- const Mt = `(function(){"use strict";self.onmessage=r=>{const{bufferX:s,bufferY:o,jobs:a}=r.data,f=new Float64Array(s),n=new Float32Array(o);for(let e=0;e<a.length;e++){const{chunkStart:c,chunkEnd:l,startDatetime:u,value:i,extent:y}=a[e];for(let t=c;t<l;t++)n[t]=n[t]+i*((f[t]-u)/y)}self.postMessage("Done")}})();
1375
- `, nt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Mt], { type: "text/javascript;charset=utf-8" });
1376
- function Ar(e) {
1377
- let t;
935
+ const nt = `(function(){"use strict";self.onmessage=r=>{const{bufferX:s,bufferY:o,jobs:a}=r.data,f=new Float64Array(s),n=new Float32Array(o);for(let e=0;e<a.length;e++){const{chunkStart:c,chunkEnd:l,startDatetime:u,value:i,extent:y}=a[e];for(let t=c;t<l;t++)n[t]=n[t]+i*((f[t]-u)/y)}self.postMessage("Done")}})();
936
+ `, De = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", nt], { type: "text/javascript;charset=utf-8" });
937
+ function Wt(r) {
938
+ let e;
1378
939
  try {
1379
- if (t = nt && (self.URL || self.webkitURL).createObjectURL(nt), !t) throw "";
1380
- const r = new Worker(t, {
1381
- name: e?.name
940
+ if (e = De && (self.URL || self.webkitURL).createObjectURL(De), !e) throw "";
941
+ const t = new Worker(e, {
942
+ name: r?.name
1382
943
  });
1383
- return r.addEventListener("error", () => {
1384
- (self.URL || self.webkitURL).revokeObjectURL(t);
1385
- }), r;
944
+ return t.addEventListener("error", () => {
945
+ (self.URL || self.webkitURL).revokeObjectURL(e);
946
+ }), t;
1386
947
  } catch {
1387
948
  return new Worker(
1388
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Mt),
949
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(nt),
1389
950
  {
1390
- name: e?.name
951
+ name: r?.name
1391
952
  }
1392
953
  );
1393
954
  }
1394
955
  }
1395
- const Ut = `(function(){"use strict";function u(f,o,a,n,l,c,s,i){let r=c,e=0,t=i;const w=a.length;for(;r<s&&e<w;){const y=a[e][0];f[r]<=y?(n[t]=f[r],l[t]=o[r],r++):(n[t]=y,l[t]=a[e][1],e++),t++}for(;r<s;)n[t]=f[r],l[t]=o[r],r++,t++;for(;e<w;)n[t]=a[e][0],l[t]=a[e][1],e++,t++;return t-i}self.onmessage=f=>{const{bufferX:o,bufferY:a,outputBufferX:n,outputBufferY:l,origStart:c,origEnd:s,insertions:i,outStart:r}=f.data,e=new Float64Array(o),t=new Float32Array(a),w=new Float64Array(n),y=new Float32Array(l);u(e,t,i,w,y,c,s,r),self.postMessage("Done")}})();
1396
- `, ot = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ut], { type: "text/javascript;charset=utf-8" });
1397
- function Tr(e) {
1398
- let t;
956
+ const st = `(function(){"use strict";function u(f,o,a,n,l,c,s,i){let r=c,e=0,t=i;const w=a.length;for(;r<s&&e<w;){const y=a[e][0];f[r]<=y?(n[t]=f[r],l[t]=o[r],r++):(n[t]=y,l[t]=a[e][1],e++),t++}for(;r<s;)n[t]=f[r],l[t]=o[r],r++,t++;for(;e<w;)n[t]=a[e][0],l[t]=a[e][1],e++,t++;return t-i}self.onmessage=f=>{const{bufferX:o,bufferY:a,outputBufferX:n,outputBufferY:l,origStart:c,origEnd:s,insertions:i,outStart:r}=f.data,e=new Float64Array(o),t=new Float32Array(a),w=new Float64Array(n),y=new Float32Array(l);u(e,t,i,w,y,c,s,r),self.postMessage("Done")}})();
957
+ `, xe = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", st], { type: "text/javascript;charset=utf-8" });
958
+ function Yt(r) {
959
+ let e;
1399
960
  try {
1400
- if (t = ot && (self.URL || self.webkitURL).createObjectURL(ot), !t) throw "";
1401
- const r = new Worker(t, {
1402
- name: e?.name
961
+ if (e = xe && (self.URL || self.webkitURL).createObjectURL(xe), !e) throw "";
962
+ const t = new Worker(e, {
963
+ name: r?.name
1403
964
  });
1404
- return r.addEventListener("error", () => {
1405
- (self.URL || self.webkitURL).revokeObjectURL(t);
1406
- }), r;
965
+ return t.addEventListener("error", () => {
966
+ (self.URL || self.webkitURL).revokeObjectURL(e);
967
+ }), t;
1407
968
  } catch {
1408
969
  return new Worker(
1409
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Ut),
970
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(st),
1410
971
  {
1411
- name: e?.name
972
+ name: r?.name
1412
973
  }
1413
974
  );
1414
975
  }
1415
976
  }
1416
- const Ft = `(function(){"use strict";self.onmessage=i=>{const{bufferX:c,bufferY:g,outputBufferX:d,outputBufferY:y,indexes:n,outStart:r,amount:f,isMonth:Y,isYear:h,deltaMs:w}=i.data,s=new Float64Array(c),a=new Float32Array(g),l=new Float64Array(d),u=new Float32Array(y);if(Y)for(let t=0;t<n.length;t++){const e=n[t],o=new Date(s[e]);o.setMonth(o.getMonth()+f),l[r+t]=o.getTime(),u[r+t]=a[e]}else if(h)for(let t=0;t<n.length;t++){const e=n[t],o=new Date(s[e]);o.setFullYear(o.getFullYear()+f),l[r+t]=o.getTime(),u[r+t]=a[e]}else for(let t=0;t<n.length;t++){const e=n[t];l[r+t]=s[e]+w,u[r+t]=a[e]}self.postMessage("Done")}})();
1417
- `, at = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ft], { type: "text/javascript;charset=utf-8" });
1418
- function Lr(e) {
1419
- let t;
977
+ const ot = `(function(){"use strict";self.onmessage=i=>{const{bufferX:c,bufferY:g,outputBufferX:d,outputBufferY:y,indexes:n,outStart:r,amount:f,isMonth:Y,isYear:h,deltaMs:w}=i.data,s=new Float64Array(c),a=new Float32Array(g),l=new Float64Array(d),u=new Float32Array(y);if(Y)for(let t=0;t<n.length;t++){const e=n[t],o=new Date(s[e]);o.setMonth(o.getMonth()+f),l[r+t]=o.getTime(),u[r+t]=a[e]}else if(h)for(let t=0;t<n.length;t++){const e=n[t],o=new Date(s[e]);o.setFullYear(o.getFullYear()+f),l[r+t]=o.getTime(),u[r+t]=a[e]}else for(let t=0;t<n.length;t++){const e=n[t];l[r+t]=s[e]+w,u[r+t]=a[e]}self.postMessage("Done")}})();
978
+ `, Ce = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ot], { type: "text/javascript;charset=utf-8" });
979
+ function Gt(r) {
980
+ let e;
1420
981
  try {
1421
- if (t = at && (self.URL || self.webkitURL).createObjectURL(at), !t) throw "";
1422
- const r = new Worker(t, {
1423
- name: e?.name
982
+ if (e = Ce && (self.URL || self.webkitURL).createObjectURL(Ce), !e) throw "";
983
+ const t = new Worker(e, {
984
+ name: r?.name
1424
985
  });
1425
- return r.addEventListener("error", () => {
1426
- (self.URL || self.webkitURL).revokeObjectURL(t);
1427
- }), r;
986
+ return t.addEventListener("error", () => {
987
+ (self.URL || self.webkitURL).revokeObjectURL(e);
988
+ }), t;
1428
989
  } catch {
1429
990
  return new Worker(
1430
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Ft),
991
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(ot),
1431
992
  {
1432
- name: e?.name
993
+ name: r?.name
1433
994
  }
1434
995
  );
1435
996
  }
1436
997
  }
1437
- const Dt = `(function(){"use strict";function a(e,t,o,c){const n=[];let r=e[t];for(let s=t+1;s<=o;s++){const f=e[s];f-r>c&&n.push(s-1,s),r=f}return n}self.onmessage=e=>{const{bufferX:t,start:o,endInclusive:c,threshold:n}=e.data,r=new Float64Array(t);self.postMessage(a(r,o,c,n))}})();
1438
- `, it = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Dt], { type: "text/javascript;charset=utf-8" });
1439
- function $r(e) {
1440
- let t;
998
+ const it = `(function(){"use strict";function a(e,t,o,c){const n=[];let r=e[t];for(let s=t+1;s<=o;s++){const f=e[s];f-r>c&&n.push(s-1,s),r=f}return n}self.onmessage=e=>{const{bufferX:t,start:o,endInclusive:c,threshold:n}=e.data,r=new Float64Array(t);self.postMessage(a(r,o,c,n))}})();
999
+ `, Ne = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", it], { type: "text/javascript;charset=utf-8" });
1000
+ function Xt(r) {
1001
+ let e;
1441
1002
  try {
1442
- if (t = it && (self.URL || self.webkitURL).createObjectURL(it), !t) throw "";
1443
- const r = new Worker(t, {
1444
- name: e?.name
1003
+ if (e = Ne && (self.URL || self.webkitURL).createObjectURL(Ne), !e) throw "";
1004
+ const t = new Worker(e, {
1005
+ name: r?.name
1445
1006
  });
1446
- return r.addEventListener("error", () => {
1447
- (self.URL || self.webkitURL).revokeObjectURL(t);
1448
- }), r;
1007
+ return t.addEventListener("error", () => {
1008
+ (self.URL || self.webkitURL).revokeObjectURL(e);
1009
+ }), t;
1449
1010
  } catch {
1450
1011
  return new Worker(
1451
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Dt),
1012
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(it),
1452
1013
  {
1453
- name: e?.name
1014
+ name: r?.name
1454
1015
  }
1455
1016
  );
1456
1017
  }
1457
1018
  }
1458
- const Ct = `(function(){"use strict";function c(u,s,t){const n=[];if(s>=t)return n;let e=s,o=u[s];for(let r=s+1;r<t;r++){const f=u[r];f!==o&&(n.push(e,r-e,o),e=r,o=f)}return n.push(e,t-e,o),n}self.onmessage=u=>{const{bufferY:s,start:t,end:n}=u.data,e=new Float32Array(s);self.postMessage(c(e,t,n))}})();
1459
- `, ct = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ct], { type: "text/javascript;charset=utf-8" });
1460
- function Rr(e) {
1461
- let t;
1019
+ const at = `(function(){"use strict";function c(u,s,t){const n=[];if(s>=t)return n;let e=s,o=u[s];for(let r=s+1;r<t;r++){const f=u[r];f!==o&&(n.push(e,r-e,o),e=r,o=f)}return n.push(e,t-e,o),n}self.onmessage=u=>{const{bufferY:s,start:t,end:n}=u.data,e=new Float32Array(s);self.postMessage(c(e,t,n))}})();
1020
+ `, Fe = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", at], { type: "text/javascript;charset=utf-8" });
1021
+ function Ht(r) {
1022
+ let e;
1462
1023
  try {
1463
- if (t = ct && (self.URL || self.webkitURL).createObjectURL(ct), !t) throw "";
1464
- const r = new Worker(t, {
1465
- name: e?.name
1024
+ if (e = Fe && (self.URL || self.webkitURL).createObjectURL(Fe), !e) throw "";
1025
+ const t = new Worker(e, {
1026
+ name: r?.name
1466
1027
  });
1467
- return r.addEventListener("error", () => {
1468
- (self.URL || self.webkitURL).revokeObjectURL(t);
1469
- }), r;
1028
+ return t.addEventListener("error", () => {
1029
+ (self.URL || self.webkitURL).revokeObjectURL(e);
1030
+ }), t;
1470
1031
  } catch {
1471
1032
  return new Worker(
1472
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Ct),
1033
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(at),
1473
1034
  {
1474
- name: e?.name
1035
+ name: r?.name
1475
1036
  }
1476
1037
  );
1477
1038
  }
1478
1039
  }
1479
- const xt = `(function(){"use strict";function o(s,i,t,n,l){const f=[];if(n==="Less than")for(let e=i;e<t;e++)s[e]-s[e-1]<l&&f.push(e);else if(n==="Less than or equal to")for(let e=i;e<t;e++)s[e]-s[e-1]<=l&&f.push(e);else if(n==="Greater than")for(let e=i;e<t;e++)s[e]-s[e-1]>l&&f.push(e);else if(n==="Greater than or equal to")for(let e=i;e<t;e++)s[e]-s[e-1]>=l&&f.push(e);else if(n==="Equal")for(let e=i;e<t;e++)s[e]-s[e-1]==l&&f.push(e);return f}self.onmessage=s=>{const{bufferY:i,start:t,end:n,comparator:l,value:f}=s.data,e=new Float32Array(i);self.postMessage(o(e,t,n,l,f))}})();
1480
- `, lt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", xt], { type: "text/javascript;charset=utf-8" });
1481
- function Ir(e) {
1482
- let t;
1040
+ const ct = `(function(){"use strict";function o(s,i,t,n,l){const f=[];if(n==="Less than")for(let e=i;e<t;e++)s[e]-s[e-1]<l&&f.push(e);else if(n==="Less than or equal to")for(let e=i;e<t;e++)s[e]-s[e-1]<=l&&f.push(e);else if(n==="Greater than")for(let e=i;e<t;e++)s[e]-s[e-1]>l&&f.push(e);else if(n==="Greater than or equal to")for(let e=i;e<t;e++)s[e]-s[e-1]>=l&&f.push(e);else if(n==="Equal")for(let e=i;e<t;e++)s[e]-s[e-1]==l&&f.push(e);return f}self.onmessage=s=>{const{bufferY:i,start:t,end:n,comparator:l,value:f}=s.data,e=new Float32Array(i);self.postMessage(o(e,t,n,l,f))}})();
1041
+ `, Be = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ct], { type: "text/javascript;charset=utf-8" });
1042
+ function zt(r) {
1043
+ let e;
1483
1044
  try {
1484
- if (t = lt && (self.URL || self.webkitURL).createObjectURL(lt), !t) throw "";
1485
- const r = new Worker(t, {
1486
- name: e?.name
1045
+ if (e = Be && (self.URL || self.webkitURL).createObjectURL(Be), !e) throw "";
1046
+ const t = new Worker(e, {
1047
+ name: r?.name
1487
1048
  });
1488
- return r.addEventListener("error", () => {
1489
- (self.URL || self.webkitURL).revokeObjectURL(t);
1490
- }), r;
1049
+ return t.addEventListener("error", () => {
1050
+ (self.URL || self.webkitURL).revokeObjectURL(e);
1051
+ }), t;
1491
1052
  } catch {
1492
1053
  return new Worker(
1493
- "data:text/javascript;charset=utf-8," + encodeURIComponent(xt),
1054
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(ct),
1494
1055
  {
1495
- name: e?.name
1056
+ name: r?.name
1496
1057
  }
1497
1058
  );
1498
1059
  }
1499
1060
  }
1500
- const Pt = `(function(){"use strict";function l(t,i,n,o,h){const f=[];if(o==="Less than")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)<h&&f.push(e)}else if(o==="Less than or equal to")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)<=h&&f.push(e)}else if(o==="Greater than")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)>h&&f.push(e)}else if(o==="Greater than or equal to")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)>=h&&f.push(e)}else if(o==="Equal")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)==h&&f.push(e)}return f}self.onmessage=t=>{const{bufferY:i,start:n,end:o,comparator:h,value:f}=t.data,e=new Float32Array(i);self.postMessage(l(e,n,o,h,f))}})();
1501
- `, ut = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Pt], { type: "text/javascript;charset=utf-8" });
1502
- function Or(e) {
1503
- let t;
1061
+ const lt = `(function(){"use strict";function l(t,i,n,o,h){const f=[];if(o==="Less than")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)<h&&f.push(e)}else if(o==="Less than or equal to")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)<=h&&f.push(e)}else if(o==="Greater than")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)>h&&f.push(e)}else if(o==="Greater than or equal to")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)>=h&&f.push(e)}else if(o==="Equal")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)==h&&f.push(e)}return f}self.onmessage=t=>{const{bufferY:i,start:n,end:o,comparator:h,value:f}=t.data,e=new Float32Array(i);self.postMessage(l(e,n,o,h,f))}})();
1062
+ `, Pe = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", lt], { type: "text/javascript;charset=utf-8" });
1063
+ function $t(r) {
1064
+ let e;
1504
1065
  try {
1505
- if (t = ut && (self.URL || self.webkitURL).createObjectURL(ut), !t) throw "";
1506
- const r = new Worker(t, {
1507
- name: e?.name
1066
+ if (e = Pe && (self.URL || self.webkitURL).createObjectURL(Pe), !e) throw "";
1067
+ const t = new Worker(e, {
1068
+ name: r?.name
1508
1069
  });
1509
- return r.addEventListener("error", () => {
1510
- (self.URL || self.webkitURL).revokeObjectURL(t);
1511
- }), r;
1070
+ return t.addEventListener("error", () => {
1071
+ (self.URL || self.webkitURL).revokeObjectURL(e);
1072
+ }), t;
1512
1073
  } catch {
1513
1074
  return new Worker(
1514
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Pt),
1075
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(lt),
1515
1076
  {
1516
- name: e?.name
1077
+ name: r?.name
1517
1078
  }
1518
1079
  );
1519
1080
  }
1520
1081
  }
1521
- const Nt = `(function(){"use strict";function k(i,l,u,r,c){const f=[],b=r.length;for(let a=l;a<u;a++){const t=i[a];let e=!1;for(let n=0;n<b;n++){const o=r[n],s=c[n];if(o===0){if(t<s){e=!0;break}}else if(o===1){if(t<=s){e=!0;break}}else if(o===2){if(t>s){e=!0;break}}else if(o===3){if(t>=s){e=!0;break}}else if(t==s){e=!0;break}}e&&f.push(a)}return f}self.onmessage=i=>{const{bufferY:l,start:u,end:r,ops:c,values:f}=i.data,b=new Float32Array(l);self.postMessage(k(b,u,r,c,f))}})();
1522
- `, ht = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Nt], { type: "text/javascript;charset=utf-8" });
1523
- function Me(e) {
1524
- let t;
1082
+ const ut = `(function(){"use strict";function k(i,l,u,r,c){const f=[],b=r.length;for(let a=l;a<u;a++){const t=i[a];let e=!1;for(let n=0;n<b;n++){const o=r[n],s=c[n];if(o===0){if(t<s){e=!0;break}}else if(o===1){if(t<=s){e=!0;break}}else if(o===2){if(t>s){e=!0;break}}else if(o===3){if(t>=s){e=!0;break}}else if(t==s){e=!0;break}}e&&f.push(a)}return f}self.onmessage=i=>{const{bufferY:l,start:u,end:r,ops:c,values:f}=i.data,b=new Float32Array(l);self.postMessage(k(b,u,r,c,f))}})();
1083
+ `, je = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ut], { type: "text/javascript;charset=utf-8" });
1084
+ function he(r) {
1085
+ let e;
1525
1086
  try {
1526
- if (t = ht && (self.URL || self.webkitURL).createObjectURL(ht), !t) throw "";
1527
- const r = new Worker(t, {
1528
- name: e?.name
1087
+ if (e = je && (self.URL || self.webkitURL).createObjectURL(je), !e) throw "";
1088
+ const t = new Worker(e, {
1089
+ name: r?.name
1529
1090
  });
1530
- return r.addEventListener("error", () => {
1531
- (self.URL || self.webkitURL).revokeObjectURL(t);
1532
- }), r;
1091
+ return t.addEventListener("error", () => {
1092
+ (self.URL || self.webkitURL).revokeObjectURL(e);
1093
+ }), t;
1533
1094
  } catch {
1534
1095
  return new Worker(
1535
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Nt),
1096
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(ut),
1536
1097
  {
1537
- name: e?.name
1098
+ name: r?.name
1538
1099
  }
1539
1100
  );
1540
1101
  }
1541
1102
  }
1542
- const Bt = `(function(){"use strict";function e(l,t,o,s){const c=t.length;if(o==="ADD")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]+s;else if(o==="SUB")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]-s;else if(o==="MULT")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]*s;else if(o==="DIV")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]/s;else if(o==="ASSIGN")for(let f=0;f<c;f++)l[t[f]]=s}self.onmessage=l=>{const{bufferY:t,indexes:o,operator:s,value:c}=l.data,f=new Float32Array(t);e(f,o,s,c),self.postMessage("Done")}})();
1543
- `, ft = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Bt], { type: "text/javascript;charset=utf-8" });
1544
- function Mr(e) {
1545
- let t;
1103
+ const ft = `(function(){"use strict";function e(l,t,o,s){const c=t.length;if(o==="ADD")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]+s;else if(o==="SUB")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]-s;else if(o==="MULT")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]*s;else if(o==="DIV")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]/s;else if(o==="ASSIGN")for(let f=0;f<c;f++)l[t[f]]=s}self.onmessage=l=>{const{bufferY:t,indexes:o,operator:s,value:c}=l.data,f=new Float32Array(t);e(f,o,s,c),self.postMessage("Done")}})();
1104
+ `, We = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ft], { type: "text/javascript;charset=utf-8" });
1105
+ function Vt(r) {
1106
+ let e;
1546
1107
  try {
1547
- if (t = ft && (self.URL || self.webkitURL).createObjectURL(ft), !t) throw "";
1548
- const r = new Worker(t, {
1549
- name: e?.name
1108
+ if (e = We && (self.URL || self.webkitURL).createObjectURL(We), !e) throw "";
1109
+ const t = new Worker(e, {
1110
+ name: r?.name
1550
1111
  });
1551
- return r.addEventListener("error", () => {
1552
- (self.URL || self.webkitURL).revokeObjectURL(t);
1553
- }), r;
1112
+ return t.addEventListener("error", () => {
1113
+ (self.URL || self.webkitURL).revokeObjectURL(e);
1114
+ }), t;
1554
1115
  } catch {
1555
1116
  return new Worker(
1556
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Bt),
1117
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(ft),
1557
1118
  {
1558
- name: e?.name
1119
+ name: r?.name
1559
1120
  }
1560
1121
  );
1561
1122
  }
1562
1123
  }
1563
- function jt(e, t, r, s, n) {
1564
- const a = [], o = s.length;
1565
- for (let i = t; i < r; i++) {
1566
- const l = e[i];
1567
- let d = !1;
1568
- for (let u = 0; u < o; u++) {
1569
- const y = s[u], g = n[u];
1570
- if (y === 0) {
1571
- if (l < g) {
1572
- d = !0;
1124
+ function ht(r, e, t, n, o) {
1125
+ const i = [], s = n.length;
1126
+ for (let a = e; a < t; a++) {
1127
+ const c = r[a];
1128
+ let p = !1;
1129
+ for (let f = 0; f < s; f++) {
1130
+ const w = n[f], m = o[f];
1131
+ if (w === 0) {
1132
+ if (c < m) {
1133
+ p = !0;
1573
1134
  break;
1574
1135
  }
1575
- } else if (y === 1) {
1576
- if (l <= g) {
1577
- d = !0;
1136
+ } else if (w === 1) {
1137
+ if (c <= m) {
1138
+ p = !0;
1578
1139
  break;
1579
1140
  }
1580
- } else if (y === 2) {
1581
- if (l > g) {
1582
- d = !0;
1141
+ } else if (w === 2) {
1142
+ if (c > m) {
1143
+ p = !0;
1583
1144
  break;
1584
1145
  }
1585
- } else if (y === 3) {
1586
- if (l >= g) {
1587
- d = !0;
1146
+ } else if (w === 3) {
1147
+ if (c >= m) {
1148
+ p = !0;
1588
1149
  break;
1589
1150
  }
1590
- } else if (l == g) {
1591
- d = !0;
1151
+ } else if (c == m) {
1152
+ p = !0;
1592
1153
  break;
1593
1154
  }
1594
1155
  }
1595
- d && a.push(i);
1596
- }
1597
- return a;
1598
- }
1599
- function Ur(e, t, r, s, n) {
1600
- const a = [];
1601
- if (s === "Less than")
1602
- for (let o = t; o < r; o++)
1603
- e[o] - e[o - 1] < n && a.push(o);
1604
- else if (s === "Less than or equal to")
1605
- for (let o = t; o < r; o++)
1606
- e[o] - e[o - 1] <= n && a.push(o);
1607
- else if (s === "Greater than")
1608
- for (let o = t; o < r; o++)
1609
- e[o] - e[o - 1] > n && a.push(o);
1610
- else if (s === "Greater than or equal to")
1611
- for (let o = t; o < r; o++)
1612
- e[o] - e[o - 1] >= n && a.push(o);
1613
- else if (s === "Equal")
1614
- for (let o = t; o < r; o++)
1615
- e[o] - e[o - 1] == n && a.push(o);
1616
- return a;
1617
- }
1618
- function Fr(e, t, r, s, n) {
1619
- const a = [];
1620
- if (s === "Less than")
1621
- for (let o = t; o < r; o++) {
1622
- const i = e[o - 1];
1623
- (e[o] - i) / Math.abs(i) < n && a.push(o);
1624
- }
1625
- else if (s === "Less than or equal to")
1626
- for (let o = t; o < r; o++) {
1627
- const i = e[o - 1];
1628
- (e[o] - i) / Math.abs(i) <= n && a.push(o);
1629
- }
1630
- else if (s === "Greater than")
1631
- for (let o = t; o < r; o++) {
1632
- const i = e[o - 1];
1633
- (e[o] - i) / Math.abs(i) > n && a.push(o);
1634
- }
1635
- else if (s === "Greater than or equal to")
1636
- for (let o = t; o < r; o++) {
1637
- const i = e[o - 1];
1638
- (e[o] - i) / Math.abs(i) >= n && a.push(o);
1639
- }
1640
- else if (s === "Equal")
1641
- for (let o = t; o < r; o++) {
1642
- const i = e[o - 1];
1643
- (e[o] - i) / Math.abs(i) == n && a.push(o);
1644
- }
1645
- return a;
1646
- }
1647
- function Dr(e, t, r, s) {
1156
+ p && i.push(a);
1157
+ }
1158
+ return i;
1159
+ }
1160
+ function qt(r, e, t, n, o) {
1161
+ const i = [];
1162
+ if (n === "Less than")
1163
+ for (let s = e; s < t; s++)
1164
+ r[s] - r[s - 1] < o && i.push(s);
1165
+ else if (n === "Less than or equal to")
1166
+ for (let s = e; s < t; s++)
1167
+ r[s] - r[s - 1] <= o && i.push(s);
1168
+ else if (n === "Greater than")
1169
+ for (let s = e; s < t; s++)
1170
+ r[s] - r[s - 1] > o && i.push(s);
1171
+ else if (n === "Greater than or equal to")
1172
+ for (let s = e; s < t; s++)
1173
+ r[s] - r[s - 1] >= o && i.push(s);
1174
+ else if (n === "Equal")
1175
+ for (let s = e; s < t; s++)
1176
+ r[s] - r[s - 1] == o && i.push(s);
1177
+ return i;
1178
+ }
1179
+ function Jt(r, e, t, n, o) {
1180
+ const i = [];
1181
+ if (n === "Less than")
1182
+ for (let s = e; s < t; s++) {
1183
+ const a = r[s - 1];
1184
+ (r[s] - a) / Math.abs(a) < o && i.push(s);
1185
+ }
1186
+ else if (n === "Less than or equal to")
1187
+ for (let s = e; s < t; s++) {
1188
+ const a = r[s - 1];
1189
+ (r[s] - a) / Math.abs(a) <= o && i.push(s);
1190
+ }
1191
+ else if (n === "Greater than")
1192
+ for (let s = e; s < t; s++) {
1193
+ const a = r[s - 1];
1194
+ (r[s] - a) / Math.abs(a) > o && i.push(s);
1195
+ }
1196
+ else if (n === "Greater than or equal to")
1197
+ for (let s = e; s < t; s++) {
1198
+ const a = r[s - 1];
1199
+ (r[s] - a) / Math.abs(a) >= o && i.push(s);
1200
+ }
1201
+ else if (n === "Equal")
1202
+ for (let s = e; s < t; s++) {
1203
+ const a = r[s - 1];
1204
+ (r[s] - a) / Math.abs(a) == o && i.push(s);
1205
+ }
1206
+ return i;
1207
+ }
1208
+ function Kt(r, e, t, n) {
1209
+ const o = [];
1210
+ let i = r[e];
1211
+ for (let s = e + 1; s <= t; s++) {
1212
+ const a = r[s];
1213
+ a - i > n && o.push(s - 1, s), i = a;
1214
+ }
1215
+ return o;
1216
+ }
1217
+ function Qt(r, e, t) {
1648
1218
  const n = [];
1649
- let a = e[t];
1650
- for (let o = t + 1; o <= r; o++) {
1651
- const i = e[o];
1652
- i - a > s && n.push(o - 1, o), a = i;
1653
- }
1654
- return n;
1655
- }
1656
- function Cr(e, t, r) {
1657
- const s = [];
1658
- if (t >= r) return s;
1659
- let n = t, a = e[t];
1660
- for (let o = t + 1; o < r; o++) {
1661
- const i = e[o];
1662
- i !== a && (s.push(n, o - n, a), n = o, a = i);
1663
- }
1664
- return s.push(n, r - n, a), s;
1665
- }
1666
- function xr(e, t, r, s, n, a, o, i, l, d, u) {
1667
- let y = 0, g = i;
1668
- for (let m = a; m <= o; m++)
1669
- if (s[g] = e[m], n[g] = t[m], g++, y < r.length && m === r[y][0]) {
1670
- const b = r[y][0], h = r[y][1], f = e[b], w = e[h], p = t[b], S = t[h], E = w - f, _ = S - p;
1671
- let L = f + l;
1672
- for (; L < w; )
1673
- s[g] = L, n[g] = d ? p + (L - f) * _ / E : u, g++, L += l;
1674
- y++;
1675
- }
1676
- return g - i;
1677
- }
1678
- function Pr(e, t, r, s, n, a, o, i) {
1679
- let l = a, d = 0, u = i;
1680
- const y = r.length;
1681
- for (; l < o && d < y; ) {
1682
- const g = r[d][0];
1683
- e[l] <= g ? (s[u] = e[l], n[u] = t[l], l++) : (s[u] = g, n[u] = r[d][1], d++), u++;
1684
- }
1685
- for (; l < o; )
1686
- s[u] = e[l], n[u] = t[l], l++, u++;
1687
- for (; d < y; )
1688
- s[u] = r[d][0], n[u] = r[d][1], d++, u++;
1689
- return u - i;
1690
- }
1691
- function Nr(e, t, r, s, n, a, o, i) {
1692
- let l = 0, d = i;
1693
- for (let u = a; u <= o; u++)
1694
- l < r.length && u === r[l] ? l++ : (s[d] = e[u], n[d] = t[u], d++);
1695
- return d - i;
1696
- }
1697
- function Br(e, t, r, s) {
1698
- const n = r.length, a = new Array(n);
1699
- if (s.isMonth)
1700
- for (let o = 0; o < n; o++) {
1701
- const i = r[o], l = new Date(e[i]);
1702
- l.setMonth(l.getMonth() + s.amount), a[o] = [l.getTime(), t[i]];
1703
- }
1704
- else if (s.isYear)
1705
- for (let o = 0; o < n; o++) {
1706
- const i = r[o], l = new Date(e[i]);
1707
- l.setFullYear(l.getFullYear() + s.amount), a[o] = [l.getTime(), t[i]];
1219
+ if (e >= t) return n;
1220
+ let o = e, i = r[e];
1221
+ for (let s = e + 1; s < t; s++) {
1222
+ const a = r[s];
1223
+ a !== i && (n.push(o, s - o, i), o = s, i = a);
1224
+ }
1225
+ return n.push(o, t - o, i), n;
1226
+ }
1227
+ function Zt(r, e, t, n, o, i, s, a, c, p, f) {
1228
+ let w = 0, m = a;
1229
+ for (let d = i; d <= s; d++)
1230
+ if (n[m] = r[d], o[m] = e[d], m++, w < t.length && d === t[w][0]) {
1231
+ const y = t[w][0], l = t[w][1], u = r[y], g = r[l], h = e[y], b = e[l], E = g - u, k = b - h;
1232
+ let A = u + c;
1233
+ for (; A < g; )
1234
+ n[m] = A, o[m] = p ? h + (A - u) * k / E : f, m++, A += c;
1235
+ w++;
1236
+ }
1237
+ return m - a;
1238
+ }
1239
+ function er(r, e, t, n, o, i, s, a) {
1240
+ let c = i, p = 0, f = a;
1241
+ const w = t.length;
1242
+ for (; c < s && p < w; ) {
1243
+ const m = t[p][0];
1244
+ r[c] <= m ? (n[f] = r[c], o[f] = e[c], c++) : (n[f] = m, o[f] = t[p][1], p++), f++;
1245
+ }
1246
+ for (; c < s; )
1247
+ n[f] = r[c], o[f] = e[c], c++, f++;
1248
+ for (; p < w; )
1249
+ n[f] = t[p][0], o[f] = t[p][1], p++, f++;
1250
+ return f - a;
1251
+ }
1252
+ function tr(r, e, t, n, o, i, s, a) {
1253
+ let c = 0, p = a;
1254
+ for (let f = i; f <= s; f++)
1255
+ c < t.length && f === t[c] ? c++ : (n[p] = r[f], o[p] = e[f], p++);
1256
+ return p - a;
1257
+ }
1258
+ function rr(r, e, t, n) {
1259
+ const o = t.length, i = new Array(o);
1260
+ if (n.isMonth)
1261
+ for (let s = 0; s < o; s++) {
1262
+ const a = t[s], c = new Date(r[a]);
1263
+ c.setMonth(c.getMonth() + n.amount), i[s] = [c.getTime(), e[a]];
1264
+ }
1265
+ else if (n.isYear)
1266
+ for (let s = 0; s < o; s++) {
1267
+ const a = t[s], c = new Date(r[a]);
1268
+ c.setFullYear(c.getFullYear() + n.amount), i[s] = [c.getTime(), e[a]];
1708
1269
  }
1709
1270
  else
1710
- for (let o = 0; o < n; o++) {
1711
- const i = r[o];
1712
- a[o] = [e[i] + s.deltaMs, t[i]];
1271
+ for (let s = 0; s < o; s++) {
1272
+ const a = t[s];
1273
+ i[s] = [r[a] + n.deltaMs, e[a]];
1713
1274
  }
1714
- return a;
1275
+ return i;
1715
1276
  }
1716
- function jr(e, t, r) {
1717
- for (let s = 0; s < r.length; s++) {
1718
- const { indexes: n, lowerIdx: a, upperIdx: o } = r[s], i = e[a], l = t[a], d = e[o], u = t[o], y = d - i, g = u - l;
1719
- if (y === 0) {
1720
- for (let m = 0; m < n.length; m++) t[n[m]] = l;
1277
+ function nr(r, e, t) {
1278
+ for (let n = 0; n < t.length; n++) {
1279
+ const { indexes: o, lowerIdx: i, upperIdx: s } = t[n], a = r[i], c = e[i], p = r[s], f = e[s], w = p - a, m = f - c;
1280
+ if (w === 0) {
1281
+ for (let d = 0; d < o.length; d++) e[o[d]] = c;
1721
1282
  continue;
1722
1283
  }
1723
- for (let m = 0; m < n.length; m++) {
1724
- const b = n[m];
1725
- t[b] = l + (e[b] - i) * g / y;
1284
+ for (let d = 0; d < o.length; d++) {
1285
+ const y = o[d];
1286
+ e[y] = c + (r[y] - a) * m / w;
1726
1287
  }
1727
1288
  }
1728
1289
  }
1729
- function Wr(e, t, r) {
1730
- for (let s = 0; s < r.length; s++) {
1731
- const n = r[s][0], a = r[s][1], o = r[s][2];
1732
- if (a <= n) continue;
1733
- const i = e[n], l = e[a] - i;
1734
- if (l !== 0)
1735
- for (let d = n; d < a; d++)
1736
- t[d] = t[d] + o * ((e[d] - i) / l);
1290
+ function sr(r, e, t) {
1291
+ for (let n = 0; n < t.length; n++) {
1292
+ const o = t[n][0], i = t[n][1], s = t[n][2];
1293
+ if (i <= o) continue;
1294
+ const a = r[o], c = r[i] - a;
1295
+ if (c !== 0)
1296
+ for (let p = o; p < i; p++)
1297
+ e[p] = e[p] + s * ((r[p] - a) / c);
1737
1298
  }
1738
1299
  }
1739
- function dt(e, t, r, s) {
1740
- const n = t.length;
1741
- if (r === "ADD")
1742
- for (let a = 0; a < n; a++) e[t[a]] = e[t[a]] + s;
1743
- else if (r === "SUB")
1744
- for (let a = 0; a < n; a++) e[t[a]] = e[t[a]] - s;
1745
- else if (r === "MULT")
1746
- for (let a = 0; a < n; a++) e[t[a]] = e[t[a]] * s;
1747
- else if (r === "DIV")
1748
- for (let a = 0; a < n; a++) e[t[a]] = e[t[a]] / s;
1749
- else if (r === "ASSIGN")
1750
- for (let a = 0; a < n; a++) e[t[a]] = s;
1300
+ function Ye(r, e, t, n) {
1301
+ const o = e.length;
1302
+ if (t === "ADD")
1303
+ for (let i = 0; i < o; i++) r[e[i]] = r[e[i]] + n;
1304
+ else if (t === "SUB")
1305
+ for (let i = 0; i < o; i++) r[e[i]] = r[e[i]] - n;
1306
+ else if (t === "MULT")
1307
+ for (let i = 0; i < o; i++) r[e[i]] = r[e[i]] * n;
1308
+ else if (t === "DIV")
1309
+ for (let i = 0; i < o; i++) r[e[i]] = r[e[i]] / n;
1310
+ else if (t === "ASSIGN")
1311
+ for (let i = 0; i < o; i++) r[e[i]] = n;
1751
1312
  }
1752
- const Yr = 1, Pe = `qc-utils:calibration:v${Yr}`, Gr = 720 * 60 * 60 * 1e3, ae = 5e4, ie = 2e5, fe = {
1313
+ const or = 1, ge = `qc-utils:calibration:v${or}`, ir = 720 * 60 * 60 * 1e3, H = 5e4, z = 2e5, J = {
1753
1314
  spawnOverheadMs: 50,
1754
1315
  // worst-case Windows
1755
1316
  inlineThroughput: 5e4,
@@ -1760,106 +1321,106 @@ const Yr = 1, Pe = `qc-utils:calibration:v${Yr}`, Gr = 720 * 60 * 60 * 1e3, ae =
1760
1321
  measuredAt: 0,
1761
1322
  userAgent: "default"
1762
1323
  };
1763
- let M = Xr() ?? fe, Ne = null, te = null;
1764
- const Ue = /* @__PURE__ */ new Set(), Fe = {
1324
+ let R = lr() ?? J, ye = null, j = null;
1325
+ const de = /* @__PURE__ */ new Set(), pe = {
1765
1326
  // Filter ops — read-only scans, cheap kernels
1766
- [T.VALUE_THRESHOLD]: {
1327
+ [L.VALUE_THRESHOLD]: {
1767
1328
  mode: "calibrated",
1768
1329
  weight: 1,
1769
1330
  rationale: "O(n) single-pass scan; baseline reference"
1770
1331
  },
1771
- [T.CHANGE]: {
1332
+ [L.CHANGE]: {
1772
1333
  mode: "calibrated",
1773
1334
  weight: 1.1,
1774
1335
  rationale: "O(n) with one subtraction per step"
1775
1336
  },
1776
- [T.RATE_OF_CHANGE]: {
1337
+ [L.RATE_OF_CHANGE]: {
1777
1338
  mode: "calibrated",
1778
1339
  weight: 1.4,
1779
1340
  rationale: "O(n) with division + abs per step"
1780
1341
  },
1781
- [T.FIND_GAPS]: {
1342
+ [L.FIND_GAPS]: {
1782
1343
  mode: "calibrated",
1783
1344
  weight: 0.9,
1784
1345
  rationale: "O(n) on X only, mostly empty output"
1785
1346
  },
1786
- [T.PERSISTENCE]: {
1347
+ [L.PERSISTENCE]: {
1787
1348
  mode: "calibrated",
1788
1349
  weight: 1.3,
1789
1350
  rationale: "O(n) + chunk-boundary stitch"
1790
1351
  },
1791
- [T.DATETIME_RANGE]: {
1352
+ [L.DATETIME_RANGE]: {
1792
1353
  mode: "always-inline",
1793
1354
  weight: 0,
1794
1355
  rationale: "O(log n) binary search; never worth the worker hop"
1795
1356
  },
1796
- [T.SELECTION]: {
1357
+ [L.SELECTION]: {
1797
1358
  mode: "always-inline",
1798
1359
  weight: 0,
1799
1360
  rationale: "Pure history bookkeeping"
1800
1361
  },
1801
1362
  // Edit ops — mutate Y in place or rebuild arrays
1802
- [v.CHANGE_VALUES]: {
1363
+ [S.CHANGE_VALUES]: {
1803
1364
  mode: "calibrated",
1804
1365
  weight: 0.7,
1805
1366
  rationale: "O(k) in-place arithmetic on selection"
1806
1367
  },
1807
- [v.ASSIGN_VALUES_BULK]: {
1368
+ [S.ASSIGN_VALUES_BULK]: {
1808
1369
  mode: "always-inline",
1809
1370
  weight: 0,
1810
1371
  rationale: "Single tight loop, already inline"
1811
1372
  },
1812
- [v.ASSIGN_DATETIMES_BULK]: {
1373
+ [S.ASSIGN_DATETIMES_BULK]: {
1813
1374
  mode: "always-inline",
1814
1375
  weight: 0,
1815
1376
  rationale: "Composes delete+add which handle their own dispatch"
1816
1377
  },
1817
- [v.INTERPOLATE]: {
1378
+ [S.INTERPOLATE]: {
1818
1379
  mode: "calibrated",
1819
1380
  weight: 1.5,
1820
1381
  rationale: "Linear interp per consecutive group; in-place writes"
1821
1382
  },
1822
- [v.DRIFT_CORRECTION]: {
1383
+ [S.DRIFT_CORRECTION]: {
1823
1384
  mode: "calibrated",
1824
1385
  weight: 1.2,
1825
1386
  rationale: "O(range total) in-place math; one pass per range"
1826
1387
  },
1827
- [v.SHIFT_DATETIMES]: {
1388
+ [S.SHIFT_DATETIMES]: {
1828
1389
  mode: "calibrated",
1829
1390
  weight: 1.1,
1830
1391
  rationale: "O(k) per-point shift math; inline skips SAB allocation"
1831
1392
  },
1832
- [v.ADD_POINTS]: {
1393
+ [S.ADD_POINTS]: {
1833
1394
  mode: "calibrated",
1834
1395
  weight: 1.8,
1835
1396
  rationale: "Single merge pass over Y/X + insertions; fresh SAB per call"
1836
1397
  },
1837
- [v.DELETE_POINTS]: {
1398
+ [S.DELETE_POINTS]: {
1838
1399
  mode: "calibrated",
1839
1400
  weight: 1.4,
1840
1401
  rationale: "Single skip-on-delete pass over Y/X; fresh SAB per call"
1841
1402
  },
1842
- [v.FILL_GAPS]: {
1403
+ [S.FILL_GAPS]: {
1843
1404
  mode: "calibrated",
1844
1405
  weight: 1.3,
1845
1406
  rationale: "Single copy-with-fills pass; fresh SAB sized to newLength"
1846
1407
  }
1847
1408
  };
1848
- function D(e, t) {
1849
- const r = Fe[e];
1850
- if (!r)
1409
+ function U(r, e) {
1410
+ const t = pe[r];
1411
+ if (!t)
1851
1412
  return {
1852
1413
  useWorker: !0,
1853
1414
  predictedInlineMs: 1 / 0,
1854
1415
  predictedWorkerMs: 0,
1855
1416
  reason: "unknown op; keeping default worker path"
1856
1417
  };
1857
- if (r.mode === "always-inline")
1418
+ if (t.mode === "always-inline")
1858
1419
  return {
1859
1420
  useWorker: !1,
1860
1421
  predictedInlineMs: 0,
1861
1422
  predictedWorkerMs: 0,
1862
- reason: r.rationale
1423
+ reason: t.rationale
1863
1424
  };
1864
1425
  if (typeof SharedArrayBuffer > "u")
1865
1426
  return {
@@ -1868,222 +1429,221 @@ function D(e, t) {
1868
1429
  predictedWorkerMs: 1 / 0,
1869
1430
  reason: "SharedArrayBuffer unavailable; forced inline"
1870
1431
  };
1871
- if (r.mode === "always-worker")
1432
+ if (t.mode === "always-worker")
1872
1433
  return {
1873
1434
  useWorker: !0,
1874
1435
  predictedInlineMs: 1 / 0,
1875
1436
  predictedWorkerMs: 0,
1876
- reason: r.rationale
1437
+ reason: t.rationale
1877
1438
  };
1878
- const s = Hr(e, t);
1879
- if (s <= 0)
1439
+ const n = ar(r, e);
1440
+ if (n <= 0)
1880
1441
  return {
1881
1442
  useWorker: !1,
1882
1443
  predictedInlineMs: 0,
1883
- predictedWorkerMs: M.spawnOverheadMs,
1444
+ predictedWorkerMs: R.spawnOverheadMs,
1884
1445
  reason: "zero work units"
1885
1446
  };
1886
- const n = Math.max(
1447
+ const o = Math.max(
1887
1448
  1,
1888
1449
  Math.min(
1889
- t.parallelism ?? M.hwConcurrency,
1890
- M.hwConcurrency
1450
+ e.parallelism ?? R.hwConcurrency,
1451
+ R.hwConcurrency
1891
1452
  )
1892
- ), a = r.weight * s / M.inlineThroughput, o = M.spawnOverheadMs + r.weight * s / (M.workerThroughput * n), i = a > o;
1453
+ ), i = t.weight * n / R.inlineThroughput, s = R.spawnOverheadMs + t.weight * n / (R.workerThroughput * o), a = i > s;
1893
1454
  return {
1894
- useWorker: i,
1895
- predictedInlineMs: a,
1896
- predictedWorkerMs: o,
1897
- reason: i ? `worker faster (${o.toFixed(1)} vs ${a.toFixed(1)} ms)` : `inline faster (${a.toFixed(1)} vs ${o.toFixed(1)} ms)`
1455
+ useWorker: a,
1456
+ predictedInlineMs: i,
1457
+ predictedWorkerMs: s,
1458
+ reason: a ? `worker faster (${s.toFixed(1)} vs ${i.toFixed(1)} ms)` : `inline faster (${i.toFixed(1)} vs ${s.toFixed(1)} ms)`
1898
1459
  };
1899
1460
  }
1900
- function Hr(e, t) {
1901
- switch (e) {
1902
- case v.CHANGE_VALUES:
1903
- case v.INTERPOLATE:
1904
- case v.SHIFT_DATETIMES:
1905
- case v.DRIFT_CORRECTION:
1906
- return t.selectionSize ?? 0;
1907
- case v.DELETE_POINTS:
1908
- return (t.selectionSize ?? 0) + t.datasetSize * 0.25;
1909
- case v.ADD_POINTS: {
1910
- const r = Math.max(1, Math.log2(Math.max(t.datasetSize, 2)));
1911
- return t.datasetSize + (t.selectionSize ?? 0) * r;
1461
+ function ar(r, e) {
1462
+ switch (r) {
1463
+ case S.CHANGE_VALUES:
1464
+ case S.INTERPOLATE:
1465
+ case S.SHIFT_DATETIMES:
1466
+ case S.DRIFT_CORRECTION:
1467
+ return e.selectionSize ?? 0;
1468
+ case S.DELETE_POINTS:
1469
+ return (e.selectionSize ?? 0) + e.datasetSize * 0.25;
1470
+ case S.ADD_POINTS: {
1471
+ const t = Math.max(1, Math.log2(Math.max(e.datasetSize, 2)));
1472
+ return e.datasetSize + (e.selectionSize ?? 0) * t;
1912
1473
  }
1913
1474
  default:
1914
- return t.datasetSize;
1475
+ return e.datasetSize;
1915
1476
  }
1916
1477
  }
1917
- function vs(e) {
1918
- return Ue.add(e), () => Ue.delete(e);
1478
+ function Cr(r) {
1479
+ return de.add(r), () => de.delete(r);
1919
1480
  }
1920
- function ks() {
1921
- return M;
1481
+ function Nr() {
1482
+ return R;
1922
1483
  }
1923
- function _s() {
1924
- return Ne;
1484
+ function Fr() {
1485
+ return ye;
1925
1486
  }
1926
- function As() {
1927
- return Object.keys(Fe).map((e) => ({ op: e, ...Fe[e] }));
1487
+ function Br() {
1488
+ return Object.keys(pe).map((r) => ({ op: r, ...pe[r] }));
1928
1489
  }
1929
- function Ts() {
1930
- M = fe, Ne = null;
1490
+ function Pr() {
1491
+ R = J, ye = null;
1931
1492
  try {
1932
- localStorage.removeItem(Pe);
1493
+ localStorage.removeItem(ge);
1933
1494
  } catch {
1934
1495
  }
1935
1496
  }
1936
- async function Ls(e = {}) {
1937
- if (typeof window > "u" || !(e.force || M.measuredAt === 0 || Date.now() - M.measuredAt > Gr)) return M;
1938
- if (te) await te;
1497
+ async function jr(r = {}) {
1498
+ if (typeof window > "u" || !(r.force || R.measuredAt === 0 || Date.now() - R.measuredAt > ir)) return R;
1499
+ if (j) await j;
1939
1500
  else {
1940
- te = zr().finally(() => {
1941
- te = null;
1501
+ j = cr().finally(() => {
1502
+ j = null;
1942
1503
  });
1943
- const r = await te;
1944
- M = r, Vr(r), Ne = r;
1945
- for (const s of Ue) s(M);
1504
+ const t = await j;
1505
+ R = t, ur(t), ye = t;
1506
+ for (const n of de) n(R);
1946
1507
  }
1947
- return M;
1508
+ return R;
1948
1509
  }
1949
- async function zr() {
1510
+ async function cr() {
1950
1511
  if (!(typeof SharedArrayBuffer < "u"))
1951
1512
  return {
1952
- ...fe,
1513
+ ...J,
1953
1514
  measuredAt: Date.now(),
1954
1515
  userAgent: navigator.userAgent,
1955
- hwConcurrency: navigator.hardwareConcurrency || fe.hwConcurrency,
1516
+ hwConcurrency: navigator.hardwareConcurrency || J.hwConcurrency,
1956
1517
  sharedArrayBufferAvailable: !1,
1957
1518
  samples: { spawnRoundtripMs: [], inlineScanMs: [], workerScanMs: [] }
1958
1519
  };
1959
- const t = navigator.hardwareConcurrency || 4, r = new Float32Array(ae);
1960
- for (let h = 0; h < ae; h++) r[h] = Math.sin(h);
1961
- const s = await _e(3, () => {
1962
- const h = performance.now();
1963
- return jt(r, 0, ae, [2], [0.5]), performance.now() - h;
1964
- }), n = Ae(s), a = ae / Math.max(n, 1e-3), o = new SharedArrayBuffer(256 * Float32Array.BYTES_PER_ELEMENT), i = await _e(3, async () => {
1965
- const h = performance.now();
1966
- return await new Promise((f) => {
1967
- const w = new Me();
1968
- w.onmessage = () => {
1969
- w.terminate(), f();
1970
- }, w.postMessage({
1971
- bufferY: o,
1520
+ const e = navigator.hardwareConcurrency || 4, t = new Float32Array(H);
1521
+ for (let l = 0; l < H; l++) t[l] = Math.sin(l);
1522
+ const n = await se(3, () => {
1523
+ const l = performance.now();
1524
+ return ht(t, 0, H, [2], [0.5]), performance.now() - l;
1525
+ }), o = oe(n), i = H / Math.max(o, 1e-3), s = new SharedArrayBuffer(256 * Float32Array.BYTES_PER_ELEMENT), a = await se(3, async () => {
1526
+ const l = performance.now();
1527
+ return await new Promise((u) => {
1528
+ const g = new he();
1529
+ g.onmessage = () => {
1530
+ g.terminate(), u();
1531
+ }, g.postMessage({
1532
+ bufferY: s,
1972
1533
  start: 0,
1973
1534
  end: 256,
1974
1535
  ops: [2],
1975
1536
  values: [0.5]
1976
1537
  });
1977
- }), performance.now() - h;
1978
- }), l = Ae(i), d = new SharedArrayBuffer(
1979
- ie * Float32Array.BYTES_PER_ELEMENT
1980
- ), u = new Float32Array(d);
1981
- for (let h = 0; h < ie; h++) u[h] = Math.sin(h);
1982
- const y = await _e(3, async () => {
1983
- const h = performance.now();
1984
- return await new Promise((f) => {
1985
- const w = new Me();
1986
- w.onmessage = () => {
1987
- w.terminate(), f();
1988
- }, w.postMessage({
1989
- bufferY: d,
1538
+ }), performance.now() - l;
1539
+ }), c = oe(a), p = new SharedArrayBuffer(
1540
+ z * Float32Array.BYTES_PER_ELEMENT
1541
+ ), f = new Float32Array(p);
1542
+ for (let l = 0; l < z; l++) f[l] = Math.sin(l);
1543
+ const w = await se(3, async () => {
1544
+ const l = performance.now();
1545
+ return await new Promise((u) => {
1546
+ const g = new he();
1547
+ g.onmessage = () => {
1548
+ g.terminate(), u();
1549
+ }, g.postMessage({
1550
+ bufferY: p,
1990
1551
  start: 0,
1991
- end: ie,
1552
+ end: z,
1992
1553
  ops: [2],
1993
1554
  values: [0.5]
1994
1555
  });
1995
- }), performance.now() - h;
1996
- }), g = Math.max(Ae(y) - l, 0.1), m = ie / g;
1556
+ }), performance.now() - l;
1557
+ }), m = Math.max(oe(w) - c, 0.1), d = z / m;
1997
1558
  return {
1998
- spawnOverheadMs: l,
1999
- inlineThroughput: a,
2000
- workerThroughput: m,
2001
- hwConcurrency: t,
1559
+ spawnOverheadMs: c,
1560
+ inlineThroughput: i,
1561
+ workerThroughput: d,
1562
+ hwConcurrency: e,
2002
1563
  measuredAt: Date.now(),
2003
1564
  userAgent: navigator.userAgent,
2004
1565
  sharedArrayBufferAvailable: !0,
2005
1566
  samples: {
2006
- spawnRoundtripMs: i,
2007
- inlineScanMs: s,
2008
- workerScanMs: y
1567
+ spawnRoundtripMs: a,
1568
+ inlineScanMs: n,
1569
+ workerScanMs: w
2009
1570
  }
2010
1571
  };
2011
1572
  }
2012
- async function _e(e, t) {
2013
- const r = [];
2014
- for (let s = 0; s < e; s++)
2015
- await new Promise((n) => setTimeout(n, 0)), r.push(await t());
2016
- return r;
1573
+ async function se(r, e) {
1574
+ const t = [];
1575
+ for (let n = 0; n < r; n++)
1576
+ await new Promise((o) => setTimeout(o, 0)), t.push(await e());
1577
+ return t;
2017
1578
  }
2018
- function Ae(e) {
2019
- if (!e.length) return 0;
2020
- const t = [...e].sort((s, n) => s - n), r = Math.floor(t.length / 2);
2021
- return t.length % 2 ? t[r] : (t[r - 1] + t[r]) / 2;
1579
+ function oe(r) {
1580
+ if (!r.length) return 0;
1581
+ const e = [...r].sort((n, o) => n - o), t = Math.floor(e.length / 2);
1582
+ return e.length % 2 ? e[t] : (e[t - 1] + e[t]) / 2;
2022
1583
  }
2023
- function Xr() {
1584
+ function lr() {
2024
1585
  if (typeof localStorage > "u") return null;
2025
1586
  try {
2026
- const e = localStorage.getItem(Pe);
2027
- if (!e) return null;
2028
- const t = JSON.parse(e);
2029
- return !t || typeof t.spawnOverheadMs != "number" ? null : t;
1587
+ const r = localStorage.getItem(ge);
1588
+ if (!r) return null;
1589
+ const e = JSON.parse(r);
1590
+ return !e || typeof e.spawnOverheadMs != "number" ? null : e;
2030
1591
  } catch {
2031
1592
  return null;
2032
1593
  }
2033
1594
  }
2034
- function Vr(e) {
1595
+ function ur(r) {
2035
1596
  if (!(typeof localStorage > "u"))
2036
1597
  try {
2037
- const t = {
2038
- spawnOverheadMs: e.spawnOverheadMs,
2039
- inlineThroughput: e.inlineThroughput,
2040
- workerThroughput: e.workerThroughput,
2041
- hwConcurrency: e.hwConcurrency,
2042
- measuredAt: e.measuredAt,
2043
- userAgent: e.userAgent
1598
+ const e = {
1599
+ spawnOverheadMs: r.spawnOverheadMs,
1600
+ inlineThroughput: r.inlineThroughput,
1601
+ workerThroughput: r.workerThroughput,
1602
+ hwConcurrency: r.hwConcurrency,
1603
+ measuredAt: r.measuredAt,
1604
+ userAgent: r.userAgent
2044
1605
  };
2045
- localStorage.setItem(Pe, JSON.stringify(t));
1606
+ localStorage.setItem(ge, JSON.stringify(e));
2046
1607
  } catch {
2047
1608
  }
2048
1609
  }
2049
- const re = 20 * 1e3, qr = 1024, Jr = ["date", "value", "qualifier"], Qr = typeof SharedArrayBuffer < "u";
2050
- function U(e, t) {
2051
- return Qr ? t !== void 0 ? new SharedArrayBuffer(e, { maxByteLength: t }) : new SharedArrayBuffer(e) : t !== void 0 ? new ArrayBuffer(e, { maxByteLength: t }) : new ArrayBuffer(e);
1610
+ const W = 20 * 1e3, fr = typeof SharedArrayBuffer < "u";
1611
+ function I(r, e) {
1612
+ return fr ? e !== void 0 ? new SharedArrayBuffer(r, { maxByteLength: e }) : new SharedArrayBuffer(r) : e !== void 0 ? new ArrayBuffer(r, { maxByteLength: e }) : new ArrayBuffer(r);
2052
1613
  }
2053
- function pt(e, t) {
2054
- const r = e;
2055
- typeof r.grow == "function" ? r.grow(t) : typeof r.resize == "function" && r.resize(t);
1614
+ function Ge(r, e) {
1615
+ const t = r;
1616
+ typeof t.grow == "function" ? t.grow(e) : typeof t.resize == "function" && t.resize(e);
2056
1617
  }
2057
- function Kr(e, t) {
2058
- if (e.length !== t.length) return !1;
2059
- for (let r = 0; r < e.length; r++)
2060
- if (e[r] !== t[r]) return !1;
1618
+ function hr(r, e) {
1619
+ if (r.length !== e.length) return !1;
1620
+ for (let t = 0; t < r.length; t++)
1621
+ if (r[t] !== e[t]) return !1;
2061
1622
  return !0;
2062
1623
  }
2063
- function Zr(e, t) {
2064
- switch (e) {
2065
- case v.ADD_POINTS:
2066
- case v.FILL_GAPS:
1624
+ function dr(r, e) {
1625
+ switch (r) {
1626
+ case S.ADD_POINTS:
1627
+ case S.FILL_GAPS:
2067
1628
  return !1;
2068
1629
  default:
2069
1630
  return !0;
2070
1631
  }
2071
1632
  }
2072
- class $s {
1633
+ class Wr {
2073
1634
  /** The generated dataset to be used for plotting */
2074
1635
  dataset = {
2075
- dimensions: Jr,
2076
1636
  source: {
2077
1637
  x: new Float64Array(
2078
- U(
2079
- re * Float64Array.BYTES_PER_ELEMENT,
2080
- re * Float64Array.BYTES_PER_ELEMENT
1638
+ I(
1639
+ W * Float64Array.BYTES_PER_ELEMENT,
1640
+ W * Float64Array.BYTES_PER_ELEMENT
2081
1641
  )
2082
1642
  ),
2083
1643
  y: new Float32Array(
2084
- U(
2085
- re * Float32Array.BYTES_PER_ELEMENT,
2086
- re * Float32Array.BYTES_PER_ELEMENT
1644
+ I(
1645
+ W * Float32Array.BYTES_PER_ELEMENT,
1646
+ W * Float32Array.BYTES_PER_ELEMENT
2087
1647
  )
2088
1648
  )
2089
1649
  }
@@ -2116,17 +1676,17 @@ class $s {
2116
1676
  loadingTime = null;
2117
1677
  isLoading = !0;
2118
1678
  rawData;
2119
- constructor(t) {
2120
- this.history = [], this.rawData = t, this.loadData(this.rawData);
1679
+ constructor(e) {
1680
+ this.history = [], this.rawData = e, this.loadData(this.rawData);
2121
1681
  }
2122
- async loadData(t) {
2123
- if (!t)
1682
+ async loadData(e) {
1683
+ if (!e)
2124
1684
  return;
2125
1685
  this.isLoading = !0;
2126
- const r = await ke(() => {
2127
- this._growBuffer(t.datetimes.length), this._resizeTo(t.datetimes.length), this.dataX.set(t.datetimes), this.dataY.set(t.dataValues);
1686
+ const t = await re(() => {
1687
+ this._growBuffer(e.datetimes.length), this._resizeTo(e.datetimes.length), this.dataX.set(e.datetimes), this.dataY.set(e.dataValues);
2128
1688
  });
2129
- this.loadingTime = r.duration, this.history.length = 0, this.isLoading = !1;
1689
+ this.loadingTime = t.duration, this.history.length = 0, this.isLoading = !1;
2130
1690
  }
2131
1691
  get dataX() {
2132
1692
  return this.dataset.source.x;
@@ -2138,34 +1698,34 @@ class $s {
2138
1698
  * Resizes the typed array
2139
1699
  * @param length The total number of elements that the view will contain
2140
1700
  */
2141
- _resizeTo(t) {
1701
+ _resizeTo(e) {
2142
1702
  this.dataset.source.x = new Float64Array(
2143
1703
  this.dataset.source.x.buffer
2144
- ).subarray(0, t), this.dataset.source.y = new Float32Array(
1704
+ ).subarray(0, e), this.dataset.source.y = new Float32Array(
2145
1705
  this.dataset.source.y.buffer
2146
- ).subarray(0, t);
1706
+ ).subarray(0, e);
2147
1707
  }
2148
1708
  /**
2149
1709
  * Buffer size is always in increments of `INCREASE_AMOUNT`.
2150
1710
  * Grows the buffer by `INCREASE_AMOUNT` in bytes if the current data doesn't fit
2151
1711
  * @param newLength The total number of elements that the view will contain
2152
1712
  */
2153
- _growBuffer(t) {
2154
- const r = t * Float64Array.BYTES_PER_ELEMENT;
2155
- let s = this.dataX.buffer.byteLength;
2156
- for (; r > s; )
2157
- s += re * Float64Array.BYTES_PER_ELEMENT;
2158
- if (s * Float64Array.BYTES_PER_ELEMENT > this.dataX.buffer.maxByteLength) {
2159
- const n = U(
1713
+ _growBuffer(e) {
1714
+ const t = e * Float64Array.BYTES_PER_ELEMENT;
1715
+ let n = this.dataX.buffer.byteLength;
1716
+ for (; t > n; )
1717
+ n += W * Float64Array.BYTES_PER_ELEMENT;
1718
+ if (n * Float64Array.BYTES_PER_ELEMENT > this.dataX.buffer.maxByteLength) {
1719
+ const o = I(
2160
1720
  this.dataX.buffer.byteLength,
2161
- s * Float64Array.BYTES_PER_ELEMENT
2162
- ), a = U(
1721
+ n * Float64Array.BYTES_PER_ELEMENT
1722
+ ), i = I(
2163
1723
  this.dataY.buffer.byteLength,
2164
- s * Float32Array.BYTES_PER_ELEMENT
2165
- ), o = new Float64Array(n), i = new Float32Array(a);
2166
- o.set(this.dataX), i.set(this.dataY), this.dataset.source.x = o, this.dataset.source.y = i;
1724
+ n * Float32Array.BYTES_PER_ELEMENT
1725
+ ), s = new Float64Array(o), a = new Float32Array(i);
1726
+ s.set(this.dataX), a.set(this.dataY), this.dataset.source.x = s, this.dataset.source.y = a;
2167
1727
  }
2168
- this.dataX.buffer.byteLength < t * Float64Array.BYTES_PER_ELEMENT && (pt(this.dataX.buffer, t * Float64Array.BYTES_PER_ELEMENT), pt(this.dataY.buffer, t * Float32Array.BYTES_PER_ELEMENT));
1728
+ this.dataX.buffer.byteLength < e * Float64Array.BYTES_PER_ELEMENT && (Ge(this.dataX.buffer, e * Float64Array.BYTES_PER_ELEMENT), Ge(this.dataY.buffer, e * Float32Array.BYTES_PER_ELEMENT));
2169
1729
  }
2170
1730
  /**
2171
1731
  * Reloads the dataset with the raw data
@@ -2174,20 +1734,19 @@ class $s {
2174
1734
  this.loadingTime = null, this.isLoading = !0, this.history.length = 0, await this.loadData(this.rawData);
2175
1735
  }
2176
1736
  /**
2177
- * @param index
2178
- * @returns
1737
+ * Truncate history at `index` (inclusive), reload from raw, and
1738
+ * replay the surviving entries. Used by the "Reload from this step"
1739
+ * button in EditHistory.
2179
1740
  */
2180
- async reloadHistory(t) {
2181
- const r = this.history.slice(0, t + 1);
2182
- return this.redoStack.length = 0, await this.reload(), await this.dispatch(r.map((s) => [s.method, ...s.args || []]));
1741
+ async reloadHistory(e) {
1742
+ const t = this.history.slice(0, e + 1);
1743
+ return this.redoStack.length = 0, await this.reload(), await this.dispatch(t.map((n) => [n.method, ...n.args || []]));
2183
1744
  }
2184
- /**
2185
- * Remove a history item
2186
- * @param index
2187
- */
2188
- async removeHistoryItem(t) {
2189
- const r = [...this.history];
2190
- return r.splice(t, 1), this.redoStack.length = 0, await this.reload(), await this.dispatch(r.map((s) => [s.method, ...s.args || []]));
1745
+ /** Splice the history entry at `index`, reload from raw, and replay
1746
+ * the survivors. */
1747
+ async removeHistoryItem(e) {
1748
+ const t = [...this.history];
1749
+ return t.splice(e, 1), this.redoStack.length = 0, await this.reload(), await this.dispatch(t.map((n) => [n.method, ...n.args || []]));
2191
1750
  }
2192
1751
  /**
2193
1752
  * Undo the most recent history entry. Pushes it onto `redoStack` so a
@@ -2196,10 +1755,10 @@ class $s {
2196
1755
  */
2197
1756
  async undo() {
2198
1757
  if (!this.history.length) return [];
2199
- const t = this.history[this.history.length - 1], r = this.history.slice(0, -1);
2200
- await this.reload(), this.redoStack.push(t), this._isReplaying = !0;
1758
+ const e = this.history[this.history.length - 1], t = this.history.slice(0, -1);
1759
+ await this.reload(), this.redoStack.push(e), this._isReplaying = !0;
2201
1760
  try {
2202
- return await this.dispatch(r.map((s) => [s.method, ...s.args || []]));
1761
+ return await this.dispatch(t.map((n) => [n.method, ...n.args || []]));
2203
1762
  } finally {
2204
1763
  this._isReplaying = !1;
2205
1764
  }
@@ -2212,10 +1771,10 @@ class $s {
2212
1771
  */
2213
1772
  async redo() {
2214
1773
  if (!this.redoStack.length) return [];
2215
- const t = this.redoStack.pop();
1774
+ const e = this.redoStack.pop();
2216
1775
  this._isReplaying = !0;
2217
1776
  try {
2218
- return await this.dispatch([[t.method, ...t.args || []]]);
1777
+ return await this.dispatch([[e.method, ...e.args || []]]);
2219
1778
  } finally {
2220
1779
  this._isReplaying = !1;
2221
1780
  }
@@ -2239,128 +1798,124 @@ class $s {
2239
1798
  * `_assignDatetimesBulk` → `_deleteDataPoints` + `_addDataPoints`)
2240
1799
  * can pass locally-computed indices without going through history.
2241
1800
  */
2242
- async dispatchAction(t, ...r) {
2243
- const s = {
2244
- [v.ADD_POINTS]: this._addDataPoints,
2245
- [v.CHANGE_VALUES]: this._changeValues,
2246
- [v.ASSIGN_VALUES_BULK]: this._assignValuesBulk,
2247
- [v.DELETE_POINTS]: this._deleteDataPointsFromSelection,
2248
- [v.DRIFT_CORRECTION]: this._driftCorrectionFromSelection,
2249
- [v.INTERPOLATE]: this._interpolateFromSelection,
2250
- [v.SHIFT_DATETIMES]: this._shiftFromSelection,
2251
- [v.ASSIGN_DATETIMES_BULK]: this._assignDatetimesBulk,
2252
- [v.FILL_GAPS]: this._fillGaps
1801
+ async dispatchAction(e, ...t) {
1802
+ const n = {
1803
+ [S.ADD_POINTS]: this._addDataPoints,
1804
+ [S.CHANGE_VALUES]: this._changeValues,
1805
+ [S.ASSIGN_VALUES_BULK]: this._assignValuesBulk,
1806
+ [S.DELETE_POINTS]: this._deleteDataPointsFromSelection,
1807
+ [S.DRIFT_CORRECTION]: this._driftCorrectionFromSelection,
1808
+ [S.INTERPOLATE]: this._interpolateFromSelection,
1809
+ [S.SHIFT_DATETIMES]: this._shiftFromSelection,
1810
+ [S.ASSIGN_DATETIMES_BULK]: this._assignDatetimesBulk,
1811
+ [S.FILL_GAPS]: this._fillGaps
2253
1812
  };
2254
- let n = [], a = null;
1813
+ let o = [], i = null;
2255
1814
  try {
2256
- this._isReplaying || (this.redoStack.length = 0), a = {
2257
- method: t,
2258
- args: r,
2259
- isLoading: !0
2260
- }, this.history.push(a), Zr(t, r) || this.history[this.history.length - 2]?.method === T.SELECTION && this.history.splice(this.history.length - 2, 1), this._pendingExecutionMode = "inline";
2261
- const o = await ke(async () => await s[t].apply(this, r));
2262
- n = o.response;
2263
- const i = this.history.indexOf(a), l = i >= 0 ? this.history[i] : void 0;
2264
- l && (l.duration = o.duration, l.executionMode = this._pendingExecutionMode, l.status = "success", l.isLoading = !1);
1815
+ this._isReplaying || (this.redoStack.length = 0), i = {
1816
+ method: e,
1817
+ args: t,
1818
+ isLoading: !0,
1819
+ timestamp: Date.now()
1820
+ }, this.history.push(i), dr(e, t) || this.history[this.history.length - 2]?.method === L.SELECTION && this.history.splice(this.history.length - 2, 1), this._pendingExecutionMode = "inline";
1821
+ const s = await re(async () => await n[e].apply(this, t));
1822
+ o = s.response;
1823
+ const a = this.history.indexOf(i), c = a >= 0 ? this.history[a] : void 0;
1824
+ c && (c.duration = s.duration, c.executionMode = this._pendingExecutionMode, c.status = "success", c.isLoading = !1);
2265
1825
  } catch {
2266
- if (a) {
2267
- const i = this.history.indexOf(a), l = i >= 0 ? this.history[i] : void 0;
2268
- l && (l.status = "failed", l.isLoading = !1);
1826
+ if (i) {
1827
+ const a = this.history.indexOf(i), c = a >= 0 ? this.history[a] : void 0;
1828
+ c && (c.status = "failed", c.isLoading = !1);
2269
1829
  }
2270
1830
  }
2271
- return n;
1831
+ return o;
2272
1832
  }
2273
- async dispatch(t, ...r) {
2274
- const s = async (n, a) => T[n] ? await this.dispatchFilter(n, ...a) : await this.dispatchAction(n, ...a);
2275
- if (Array.isArray(t)) {
2276
- let n = [];
2277
- for (let a = 0; a < t.length; a++) {
2278
- const o = t[a][0], i = t[a].slice(1, t[a].length);
2279
- n = await s(o, i);
1833
+ async dispatch(e, ...t) {
1834
+ const n = async (o, i) => L[o] ? await this.dispatchFilter(o, ...i) : await this.dispatchAction(o, ...i);
1835
+ if (Array.isArray(e)) {
1836
+ let o = [];
1837
+ for (let i = 0; i < e.length; i++) {
1838
+ const s = e[i][0], a = e[i].slice(1, e[i].length);
1839
+ o = await n(s, a);
2280
1840
  }
2281
- return n;
1841
+ return o;
2282
1842
  } else
2283
- return await s(t, r);
1843
+ return await n(e, t);
2284
1844
  }
2285
1845
  /** Filter operations do not transform the data and return a selection */
2286
- async dispatchFilter(t, ...r) {
2287
- const s = {
2288
- [T.FIND_GAPS]: this._findGaps,
2289
- [T.VALUE_THRESHOLD]: this._valueThreshold,
2290
- [T.DATETIME_RANGE]: this._datetimeRange,
2291
- [T.PERSISTENCE]: this._persistence,
2292
- [T.CHANGE]: this._change,
2293
- [T.RATE_OF_CHANGE]: this._rateOfChange,
2294
- [T.SELECTION]: this._selection
1846
+ async dispatchFilter(e, ...t) {
1847
+ const n = {
1848
+ [L.FIND_GAPS]: this._findGaps,
1849
+ [L.VALUE_THRESHOLD]: this._valueThreshold,
1850
+ [L.DATETIME_RANGE]: this._datetimeRange,
1851
+ [L.PERSISTENCE]: this._persistence,
1852
+ [L.CHANGE]: this._change,
1853
+ [L.RATE_OF_CHANGE]: this._rateOfChange,
1854
+ [L.SELECTION]: this._selection
2295
1855
  };
2296
- let n = [], a = null;
1856
+ let o = [], i = null;
2297
1857
  try {
2298
- const o = t === T.SELECTION, i = o && (!r[0] || Array.isArray(r[0]) && r[0].length === 0);
2299
- !this._isReplaying && !i && (this.redoStack.length = 0), a = {
2300
- method: t,
2301
- args: r,
2302
- isLoading: !0
1858
+ const s = e === L.SELECTION, a = s && (!t[0] || Array.isArray(t[0]) && t[0].length === 0);
1859
+ !this._isReplaying && !a && (this.redoStack.length = 0), i = {
1860
+ method: e,
1861
+ args: t,
1862
+ isLoading: !0,
1863
+ timestamp: Date.now()
2303
1864
  };
2304
- const l = this.history[this.history.length - 1], d = !!T[l?.method], u = l?.method === t || d && !o;
2305
- let y;
2306
- u ? (y = this.history.length - 1, this.history[y] = a) : (this.history.push(a), y = this.history.length - 1), this._pendingExecutionMode = "inline";
2307
- const g = await ke(async () => await s[t].apply(this, r));
2308
- n = g.response;
2309
- const m = this.history.indexOf(a), b = m >= 0 ? this.history[m] : void 0;
2310
- b && (b.duration = g.duration, b.executionMode = this._pendingExecutionMode, b.selected = g.response, b.status = "success", b.isLoading = !1);
2311
- } catch (o) {
1865
+ const c = this.history[this.history.length - 1], p = !!L[c?.method], f = c?.method === e || p && !s;
1866
+ let w;
1867
+ f ? (w = this.history.length - 1, this.history[w] = i) : (this.history.push(i), w = this.history.length - 1), this._pendingExecutionMode = "inline";
1868
+ const m = await re(async () => await n[e].apply(this, t));
1869
+ o = m.response;
1870
+ const d = this.history.indexOf(i), y = d >= 0 ? this.history[d] : void 0;
1871
+ y && (y.duration = m.duration, y.executionMode = this._pendingExecutionMode, y.selected = m.response, y.status = "success", y.isLoading = !1);
1872
+ } catch (s) {
2312
1873
  if (console.log(
2313
- `Failed to execute filter operation: ${t} with arguments: `,
2314
- r
2315
- ), console.log(o), a) {
2316
- const i = this.history.indexOf(a), l = i >= 0 ? this.history[i] : void 0;
2317
- l && (l.status = "failed", l.isLoading = !1);
1874
+ `Failed to execute filter operation: ${e} with arguments: `,
1875
+ t
1876
+ ), console.log(s), i) {
1877
+ const a = this.history.indexOf(i), c = a >= 0 ? this.history[a] : void 0;
1878
+ c && (c.status = "failed", c.isLoading = !1);
2318
1879
  }
2319
1880
  }
2320
- return n;
1881
+ return o;
2321
1882
  }
2322
- /**
2323
- * @param index An array containing the list of index of values to perform the operations on.
2324
- * @param operator The operator that will be applied
2325
- * @param value The value to use in the operation
2326
- * @returns an array of index values to keep selected in the plot
2327
- */
2328
1883
  /**
2329
1884
  * Multi-threaded apply of an arithmetic operator to Y at the previously-filtered selection.
2330
1885
  * 1. Selection is read from the previous history entry (the last entry is this operation itself).
2331
1886
  * 2. Selection indexes are sharded into disjoint chunks; workers write in place to shared Y.
2332
1887
  * 3. Writes are conflict-free because the selection carries distinct indexes.
2333
1888
  */
2334
- async _changeValues(t, r) {
2335
- const s = this.history[this.history.length - 2]?.selected;
2336
- if (!s || s.length === 0) return [];
2337
- const n = s.length;
2338
- if (!D(v.CHANGE_VALUES, {
1889
+ async _changeValues(e, t) {
1890
+ const n = this.history[this.history.length - 2]?.selected;
1891
+ if (!n || n.length === 0) return [];
1892
+ const o = n.length;
1893
+ if (!U(S.CHANGE_VALUES, {
2339
1894
  datasetSize: this.dataset.source.y.length,
2340
- selectionSize: n
2341
- }).useWorker || n < qr)
2342
- return dt(this.dataY, s, t, r), [];
1895
+ selectionSize: o
1896
+ }).useWorker)
1897
+ return Ye(this.dataY, n, e, t), [];
2343
1898
  this._pendingExecutionMode = "worker";
2344
- const o = Math.min(navigator.hardwareConcurrency || 1, n), i = Math.ceil(n / o), l = [], d = [];
2345
- for (let u = 0; u < o; u++) {
2346
- const y = u * i, g = Math.min((u + 1) * i, n);
2347
- if (y >= g) break;
2348
- const m = s.slice(y, g);
2349
- d.push(
2350
- new Promise((b) => {
2351
- const h = new Mr();
2352
- l.push(h), h.postMessage({
1899
+ const s = Math.min(navigator.hardwareConcurrency || 1, o), a = Math.ceil(o / s), c = [], p = [];
1900
+ for (let f = 0; f < s; f++) {
1901
+ const w = f * a, m = Math.min((f + 1) * a, o);
1902
+ if (w >= m) break;
1903
+ const d = n.slice(w, m);
1904
+ p.push(
1905
+ new Promise((y) => {
1906
+ const l = new Vt();
1907
+ c.push(l), l.postMessage({
2353
1908
  bufferY: this.dataY.buffer,
2354
- indexes: m,
2355
- operator: t,
2356
- value: r
2357
- }), h.onmessage = (f) => {
2358
- b(f.data);
1909
+ indexes: d,
1910
+ operator: e,
1911
+ value: t
1912
+ }), l.onmessage = (u) => {
1913
+ y(u.data);
2359
1914
  };
2360
1915
  })
2361
1916
  );
2362
1917
  }
2363
- return await Promise.all(d), l.forEach((u) => u.terminate()), [];
1918
+ return await Promise.all(p), c.forEach((f) => f.terminate()), [];
2364
1919
  }
2365
1920
  /**
2366
1921
  * Apply an arithmetic operator to Y in-place on the main thread. Thin
@@ -2368,8 +1923,8 @@ class $s {
2368
1923
  * and callers outside this module can use the same routine the
2369
1924
  * CHANGE_VALUES fast path does.
2370
1925
  */
2371
- _applyOperatorInPlace(t, r, s) {
2372
- dt(this.dataY, t, r, s);
1926
+ _applyOperatorInPlace(e, t, n) {
1927
+ Ye(this.dataY, e, t, n);
2373
1928
  }
2374
1929
  /**
2375
1930
  * One-shot assignment of distinct Y-values at the indices logged by the
@@ -2383,11 +1938,11 @@ class $s {
2383
1938
  * The SELECTION entry carries the indices for history, so this op does
2384
1939
  * not log them again.
2385
1940
  */
2386
- async _assignValuesBulk(t) {
2387
- const r = this.history[this.history.length - 2]?.selected;
2388
- if (!r || !r.length || !t?.length) return [];
2389
- const s = Math.min(r.length, t.length), n = this.dataY;
2390
- for (let a = 0; a < s; a++) n[r[a]] = t[a];
1941
+ async _assignValuesBulk(e) {
1942
+ const t = this.history[this.history.length - 2]?.selected;
1943
+ if (!t || !t.length || !e?.length) return [];
1944
+ const n = Math.min(t.length, e.length), o = this.dataY;
1945
+ for (let i = 0; i < n; i++) o[t[i]] = e[i];
2391
1946
  return [];
2392
1947
  }
2393
1948
  /**
@@ -2399,13 +1954,13 @@ class $s {
2399
1954
  * Expected dispatch order (matches SHIFT_DATETIMES pattern):
2400
1955
  * [[SELECTION, indices], [ASSIGN_DATETIMES_BULK, datetimes]]
2401
1956
  */
2402
- async _assignDatetimesBulk(t) {
2403
- const r = this.history[this.history.length - 2]?.selected;
2404
- if (!r || !r.length || !t?.length) return [];
2405
- const s = Math.min(r.length, t.length), n = new Array(s), a = new Array(s);
2406
- for (let o = 0; o < s; o++)
2407
- n[o] = [t[o], this.dataY[r[o]]], a[o] = r[o];
2408
- return a.sort((o, i) => o - i), await this._deleteDataPoints(a), await this._addDataPoints(n), [];
1957
+ async _assignDatetimesBulk(e) {
1958
+ const t = this.history[this.history.length - 2]?.selected;
1959
+ if (!t || !t.length || !e?.length) return [];
1960
+ const n = Math.min(t.length, e.length), o = new Array(n), i = new Array(n);
1961
+ for (let s = 0; s < n; s++)
1962
+ o[s] = [e[s], this.dataY[t[s]]], i[s] = t[s];
1963
+ return i.sort((s, a) => s - a), await this._deleteDataPoints(i), await this._addDataPoints(o), [];
2409
1964
  }
2410
1965
  /**
2411
1966
  * Dispatch wrapper around `_interpolate` — reads target indices
@@ -2415,9 +1970,9 @@ class $s {
2415
1970
  * directly with explicit indices.
2416
1971
  */
2417
1972
  async _interpolateFromSelection() {
2418
- const t = this.history[this.history.length - 2]?.selected;
2419
- if (!(!t || t.length === 0))
2420
- return this._interpolate(t);
1973
+ const e = this.history[this.history.length - 2]?.selected;
1974
+ if (!(!e || e.length === 0))
1975
+ return this._interpolate(e);
2421
1976
  }
2422
1977
  /**
2423
1978
  * Multi-threaded linear interpolation over the selected indexes.
@@ -2425,55 +1980,55 @@ class $s {
2425
1980
  * 2. Groups are sharded across workers (disjoint by construction, so in-place writes are safe).
2426
1981
  * 3. Each worker writes interpolated Y values directly into the shared Y buffer — no output copy needed since only a subset of Y changes.
2427
1982
  */
2428
- async _interpolate(t) {
2429
- const r = this._getConsecutiveGroups(t);
2430
- if (r.length === 0 || r[0].length === 0) return;
2431
- const s = this.dataset.source.y.length, n = r.map((u) => ({
2432
- indexes: u,
2433
- lowerIdx: Math.max(0, u[0] - 1),
2434
- upperIdx: Math.min(s - 1, u[u.length - 1] + 1)
1983
+ async _interpolate(e) {
1984
+ const t = this._getConsecutiveGroups(e);
1985
+ if (t.length === 0 || t[0].length === 0) return;
1986
+ const n = this.dataset.source.y.length, o = t.map((f) => ({
1987
+ indexes: f,
1988
+ lowerIdx: Math.max(0, f[0] - 1),
1989
+ upperIdx: Math.min(n - 1, f[f.length - 1] + 1)
2435
1990
  }));
2436
- if (!D(v.INTERPOLATE, {
2437
- datasetSize: s,
2438
- selectionSize: t.length
1991
+ if (!U(S.INTERPOLATE, {
1992
+ datasetSize: n,
1993
+ selectionSize: e.length
2439
1994
  }).useWorker) {
2440
- jr(this.dataX, this.dataY, n);
1995
+ nr(this.dataX, this.dataY, o);
2441
1996
  return;
2442
1997
  }
2443
1998
  this._pendingExecutionMode = "worker";
2444
- const o = Math.min(
1999
+ const s = Math.min(
2445
2000
  navigator.hardwareConcurrency || 1,
2446
- n.length
2447
- ), i = Math.ceil(n.length / o), l = [], d = [];
2448
- for (let u = 0; u < o; u++) {
2449
- const y = n.slice(
2450
- u * i,
2451
- (u + 1) * i
2001
+ o.length
2002
+ ), a = Math.ceil(o.length / s), c = [], p = [];
2003
+ for (let f = 0; f < s; f++) {
2004
+ const w = o.slice(
2005
+ f * a,
2006
+ (f + 1) * a
2452
2007
  );
2453
- if (y.length === 0) break;
2454
- d.push(
2455
- new Promise((g) => {
2456
- const m = new _r();
2457
- l.push(m), m.postMessage({
2008
+ if (w.length === 0) break;
2009
+ p.push(
2010
+ new Promise((m) => {
2011
+ const d = new jt();
2012
+ c.push(d), d.postMessage({
2458
2013
  bufferX: this.dataX.buffer,
2459
2014
  bufferY: this.dataY.buffer,
2460
- groups: y
2461
- }), m.onmessage = (b) => {
2462
- g(b.data);
2015
+ groups: w
2016
+ }), d.onmessage = (y) => {
2017
+ m(y.data);
2463
2018
  };
2464
2019
  })
2465
2020
  );
2466
2021
  }
2467
- await Promise.all(d), l.forEach((u) => u.terminate());
2022
+ await Promise.all(p), c.forEach((f) => f.terminate());
2468
2023
  }
2469
2024
  /**
2470
2025
  * Dispatch wrapper around `_shift` — reads target indices from
2471
2026
  * `history[length - 2].selected`. The `amount` and `unit` args
2472
2027
  * stay parametric on the public dispatch signature.
2473
2028
  */
2474
- async _shiftFromSelection(t, r) {
2475
- const s = this.history[this.history.length - 2]?.selected;
2476
- return !s || s.length === 0 ? [] : await this._shift(s, t, r) ?? [];
2029
+ async _shiftFromSelection(e, t) {
2030
+ const n = this.history[this.history.length - 2]?.selected;
2031
+ return !n || n.length === 0 ? [] : await this._shift(n, e, t) ?? [];
2477
2032
  }
2478
2033
  /**
2479
2034
  * Shifts the selected indexes by specified amount of units. Elements are reinserted according to their datetime.
@@ -2482,152 +2037,154 @@ class $s {
2482
2037
  * @param unit {@link TimeUnit}
2483
2038
  * @returns
2484
2039
  */
2485
- async _shift(t, r, s) {
2486
- if (t.length === 0) return [];
2487
- const n = s === W.MONTH, a = s === W.YEAR, o = !n && !a ? r * oe[s] * 1e3 : 0, i = t.length;
2488
- if (!D(v.SHIFT_DATETIMES, {
2040
+ async _shift(e, t, n) {
2041
+ if (e.length === 0) return [];
2042
+ const o = n === N.MONTH, i = n === N.YEAR, s = !o && !i ? t * G[n] * 1e3 : 0, a = e.length;
2043
+ if (!U(S.SHIFT_DATETIMES, {
2489
2044
  datasetSize: this.dataset.source.x.length,
2490
- selectionSize: i
2045
+ selectionSize: a
2491
2046
  }).useWorker) {
2492
- const p = Br(
2047
+ const h = rr(
2493
2048
  this.dataX,
2494
2049
  this.dataY,
2495
- t,
2496
- { amount: r, isMonth: n, isYear: a, deltaMs: o }
2050
+ e,
2051
+ { amount: t, isMonth: o, isYear: i, deltaMs: s }
2497
2052
  );
2498
- return await this._deleteDataPoints(t), await this._addDataPoints(p) ?? [];
2053
+ return await this._deleteDataPoints(e), await this._addDataPoints(h) ?? [];
2499
2054
  }
2500
2055
  this._pendingExecutionMode = "worker";
2501
- const d = U(i * Float64Array.BYTES_PER_ELEMENT), u = U(i * Float32Array.BYTES_PER_ELEMENT), y = Math.min(navigator.hardwareConcurrency || 1, i), g = Math.ceil(i / y), m = [], b = [];
2502
- for (let p = 0; p < y; p++) {
2503
- const S = p * g, E = Math.min((p + 1) * g, i);
2504
- if (S >= E) break;
2505
- const _ = t.slice(S, E);
2506
- b.push(
2507
- new Promise((L) => {
2508
- const $ = new Lr();
2509
- m.push($), $.postMessage({
2056
+ const p = I(a * Float64Array.BYTES_PER_ELEMENT), f = I(a * Float32Array.BYTES_PER_ELEMENT), w = Math.min(navigator.hardwareConcurrency || 1, a), m = Math.ceil(a / w), d = [], y = [];
2057
+ for (let h = 0; h < w; h++) {
2058
+ const b = h * m, E = Math.min((h + 1) * m, a);
2059
+ if (b >= E) break;
2060
+ const k = e.slice(b, E);
2061
+ y.push(
2062
+ new Promise((A) => {
2063
+ const _ = new Gt();
2064
+ d.push(_), _.postMessage({
2510
2065
  bufferX: this.dataX.buffer,
2511
2066
  bufferY: this.dataY.buffer,
2512
- outputBufferX: d,
2513
- outputBufferY: u,
2514
- indexes: _,
2515
- outStart: S,
2516
- amount: r,
2517
- isMonth: n,
2518
- isYear: a,
2519
- deltaMs: o
2520
- }), $.onmessage = (I) => {
2521
- L(I.data);
2067
+ outputBufferX: p,
2068
+ outputBufferY: f,
2069
+ indexes: k,
2070
+ outStart: b,
2071
+ amount: t,
2072
+ isMonth: o,
2073
+ isYear: i,
2074
+ deltaMs: s
2075
+ }), _.onmessage = (T) => {
2076
+ A(T.data);
2522
2077
  };
2523
2078
  })
2524
2079
  );
2525
2080
  }
2526
- await Promise.all(b), m.forEach((p) => p.terminate());
2527
- const h = new Float64Array(d), f = new Float32Array(u), w = new Array(i);
2528
- for (let p = 0; p < i; p++)
2529
- w[p] = [h[p], f[p]];
2530
- return await this._deleteDataPoints(t), await this._addDataPoints(w) ?? [];
2081
+ await Promise.all(y), d.forEach((h) => h.terminate());
2082
+ const l = new Float64Array(p), u = new Float32Array(f), g = new Array(a);
2083
+ for (let h = 0; h < a; h++)
2084
+ g[h] = [l[h], u[h]];
2085
+ return await this._deleteDataPoints(e), await this._addDataPoints(g) ?? [];
2531
2086
  }
2532
2087
  /**
2533
- * Multi-threaded version of {@link _fillGaps}.
2088
+ * Detect gaps in the configured window and insert fill points using
2089
+ * either linear interpolation or a sentinel `fillValue`. Inline path:
2090
+ * single copy-with-fills sweep into freshly-allocated x/y buffers.
2091
+ * Worker path:
2534
2092
  * 1. The main thread scans once for gaps and computes the number of fill points per gap.
2535
2093
  * 2. The original array is split into equal segments; each gap is assigned to the segment containing its left index.
2536
2094
  * 3. Cumulative fill counts before each segment give each worker's output startTarget, ensuring no overlap.
2537
2095
  * 4. Each worker copies its segment to the output buffer and inserts its gap fills inline.
2538
- */
2539
- /**
2096
+ *
2540
2097
  * @param range Optional `[startTs, endTs]` window in epoch
2541
2098
  * milliseconds. Both bounds inclusive; snapped to the nearest
2542
2099
  * enclosed point via binary search. Datetime-addressed (not
2543
2100
  * index-addressed) so the same call survives data growth and is
2544
2101
  * portable across datasets for QC script replay.
2545
2102
  */
2546
- async _fillGaps(t, r, s, n, a) {
2547
- const o = this.dataX.length;
2548
- if (o === 0) return [];
2549
- const i = t[0] * oe[t[1]] * 1e3, l = r[0] * oe[r[1]] * 1e3, d = this.dataX, u = a?.[0] != null && Number.isFinite(a[0]) ? B(d, a[0]) : 0, y = a?.[1] != null && Number.isFinite(a[1]) ? j(d, a[1]) : o - 1, g = [], m = [];
2550
- let b = 0;
2551
- for (let k = u + 1; k <= y; k++)
2552
- if (d[k] - d[k - 1] > i) {
2553
- let F = 0, x = d[k - 1] + l;
2554
- for (; x < d[k]; )
2555
- F++, x += l;
2556
- F > 0 && (g.push([k - 1, k]), m.push(F), b += F);
2103
+ async _fillGaps(e, t, n, o, i) {
2104
+ const s = this.dataX.length;
2105
+ if (s === 0) return [];
2106
+ const a = e[0] * G[e[1]] * 1e3, c = t[0] * G[t[1]] * 1e3, p = this.dataX, f = i?.[0] != null && Number.isFinite(i[0]) ? x(p, i[0]) : 0, w = i?.[1] != null && Number.isFinite(i[1]) ? C(p, i[1]) : s - 1, m = [], d = [];
2107
+ let y = 0;
2108
+ for (let v = f + 1; v <= w; v++)
2109
+ if (p[v] - p[v - 1] > a) {
2110
+ let M = 0, O = p[v - 1] + c;
2111
+ for (; O < p[v]; )
2112
+ M++, O += c;
2113
+ M > 0 && (m.push([v - 1, v]), d.push(M), y += M);
2557
2114
  }
2558
- if (b === 0) return [];
2559
- const h = new Array(b);
2560
- let f = 0, w = 0;
2561
- for (let k = 0; k < g.length; k++) {
2562
- const P = g[k][0], F = m[k];
2563
- for (let x = 1; x <= F; x++)
2564
- h[w++] = P + f + x;
2565
- f += F;
2566
- }
2567
- const p = o + b, S = p * Float64Array.BYTES_PER_ELEMENT, E = p * Float32Array.BYTES_PER_ELEMENT, _ = U(
2568
- S,
2569
- Math.max(this.dataX.buffer.maxByteLength, S)
2570
- ), L = U(
2115
+ if (y === 0) return [];
2116
+ const l = new Array(y);
2117
+ let u = 0, g = 0;
2118
+ for (let v = 0; v < m.length; v++) {
2119
+ const D = m[v][0], M = d[v];
2120
+ for (let O = 1; O <= M; O++)
2121
+ l[g++] = D + u + O;
2122
+ u += M;
2123
+ }
2124
+ const h = s + y, b = h * Float64Array.BYTES_PER_ELEMENT, E = h * Float32Array.BYTES_PER_ELEMENT, k = I(
2125
+ b,
2126
+ Math.max(this.dataX.buffer.maxByteLength, b)
2127
+ ), A = I(
2571
2128
  E,
2572
2129
  Math.max(this.dataY.buffer.maxByteLength, E)
2573
2130
  );
2574
- if (!D(v.FILL_GAPS, {
2575
- datasetSize: o,
2576
- selectionSize: b
2131
+ if (!U(S.FILL_GAPS, {
2132
+ datasetSize: s,
2133
+ selectionSize: y
2577
2134
  }).useWorker) {
2578
- const k = new Float64Array(_), P = new Float32Array(L);
2579
- return xr(
2135
+ const v = new Float64Array(k), D = new Float32Array(A);
2136
+ return Zt(
2580
2137
  this.dataX,
2581
2138
  this.dataY,
2582
- g,
2583
- k,
2584
- P,
2139
+ m,
2140
+ v,
2141
+ D,
2585
2142
  0,
2586
- o - 1,
2143
+ s - 1,
2587
2144
  0,
2588
- l,
2589
- s,
2590
- n
2591
- ), this.dataset.source.x = k, this.dataset.source.y = P, this._resizeTo(p), h;
2145
+ c,
2146
+ n,
2147
+ o
2148
+ ), this.dataset.source.x = v, this.dataset.source.y = D, this._resizeTo(h), l;
2592
2149
  }
2593
2150
  this._pendingExecutionMode = "worker";
2594
- const I = navigator.hardwareConcurrency || 1, Be = Math.ceil(o / I), ye = [];
2595
- let Z = 0;
2596
- for (let k = 0; k < I; k++) {
2597
- const P = k * Be, F = Math.min((k + 1) * Be - 1, o - 1), x = [];
2598
- let se = 0;
2599
- for (; Z < g.length && g[Z][0] <= F; )
2600
- x.push(g[Z]), se += m[Z], Z++;
2601
- ye.push({ start: P, end: F, gapsSegment: x, fillsInSegment: se });
2602
- }
2603
- const ge = new Array(I).fill(0);
2604
- for (let k = 1; k < I; k++)
2605
- ge[k] = ge[k - 1] + ye[k - 1].fillsInSegment;
2606
- const je = [], We = [];
2607
- for (let k = 0; k < I; k++) {
2608
- const { start: P, end: F, gapsSegment: x } = ye[k], se = P + ge[k];
2609
- We.push(
2610
- new Promise((Wt) => {
2611
- const me = new kr();
2612
- je.push(me), me.postMessage({
2151
+ const T = navigator.hardwareConcurrency || 1, be = Math.ceil(s / T), Z = [];
2152
+ let P = 0;
2153
+ for (let v = 0; v < T; v++) {
2154
+ const D = v * be, M = Math.min((v + 1) * be - 1, s - 1), O = [];
2155
+ let Y = 0;
2156
+ for (; P < m.length && m[P][0] <= M; )
2157
+ O.push(m[P]), Y += d[P], P++;
2158
+ Z.push({ start: D, end: M, gapsSegment: O, fillsInSegment: Y });
2159
+ }
2160
+ const ee = new Array(T).fill(0);
2161
+ for (let v = 1; v < T; v++)
2162
+ ee[v] = ee[v - 1] + Z[v - 1].fillsInSegment;
2163
+ const Ee = [], Se = [];
2164
+ for (let v = 0; v < T; v++) {
2165
+ const { start: D, end: M, gapsSegment: O } = Z[v], Y = D + ee[v];
2166
+ Se.push(
2167
+ new Promise((dt) => {
2168
+ const te = new Pt();
2169
+ Ee.push(te), te.postMessage({
2613
2170
  bufferX: this.dataX.buffer,
2614
2171
  bufferY: this.dataY.buffer,
2615
- outputBufferX: _,
2616
- outputBufferY: L,
2617
- start: P,
2618
- end: F,
2619
- gapsSegment: x,
2620
- startTarget: se,
2621
- fillDelta: l,
2622
- interpolate: s,
2623
- fillValue: n
2624
- }), me.onmessage = (Yt) => {
2625
- Wt(Yt.data);
2172
+ outputBufferX: k,
2173
+ outputBufferY: A,
2174
+ start: D,
2175
+ end: M,
2176
+ gapsSegment: O,
2177
+ startTarget: Y,
2178
+ fillDelta: c,
2179
+ interpolate: n,
2180
+ fillValue: o
2181
+ }), te.onmessage = (pt) => {
2182
+ dt(pt.data);
2626
2183
  };
2627
2184
  })
2628
2185
  );
2629
2186
  }
2630
- return await Promise.all(We), je.forEach((k) => k.terminate()), this.dataset.source.x = new Float64Array(_), this.dataset.source.y = new Float32Array(L), this._resizeTo(p), h;
2187
+ return await Promise.all(Se), Ee.forEach((v) => v.terminate()), this.dataset.source.x = new Float64Array(k), this.dataset.source.y = new Float32Array(A), this._resizeTo(h), l;
2631
2188
  }
2632
2189
  /**
2633
2190
  * Dispatch wrapper around `_deleteDataPoints` — reads target
@@ -2637,80 +2194,80 @@ class $s {
2637
2194
  * indices; only the external dispatch path goes through here.
2638
2195
  */
2639
2196
  async _deleteDataPointsFromSelection() {
2640
- const t = this.history[this.history.length - 2]?.selected;
2641
- if (!(!t || t.length === 0))
2642
- return this._deleteDataPoints(t);
2197
+ const e = this.history[this.history.length - 2]?.selected;
2198
+ if (!(!e || e.length === 0))
2199
+ return this._deleteDataPoints(e);
2643
2200
  }
2644
2201
  /**
2645
- Deletes data points from a large array using worker threads.
2646
- 1. The main thread divides the original array into equal parts to distribute work among workers.
2647
- 2. For each segment, binary search locates the indexes to delete (deleteSegment), ensuring efficient lookups.
2648
- 3. The cumulative deletions before each segment help compute the starting index (startTarget) for each worker's output, ensuring no overlap.
2649
- 4. Each worker processes its segment linearly, skipping deletions and copying kept elements to their computed positions.
2650
- * @param deleteIndices
2202
+ * Delete points by ascending `deleteIndices` from x/y. Inline path
2203
+ * runs a single skip-on-delete copy on the main thread; worker path:
2204
+ * 1. Main thread splits the original array into equal segments.
2205
+ * 2. Per-segment binary search locates the indexes to delete (deleteSegment) for efficient lookups.
2206
+ * 3. Cumulative deletions before each segment give each worker's output startTarget so segments don't overlap.
2207
+ * 4. Each worker walks its segment linearly, skipping deletions and copying kept elements into place.
2651
2208
  */
2652
- async _deleteDataPoints(t) {
2653
- const r = this.dataX.length, s = r - t.length;
2654
- if (!D(v.DELETE_POINTS, {
2655
- datasetSize: r,
2656
- selectionSize: t.length
2209
+ async _deleteDataPoints(e) {
2210
+ const t = this.dataX.length, n = t - e.length;
2211
+ if (!U(S.DELETE_POINTS, {
2212
+ datasetSize: t,
2213
+ selectionSize: e.length
2657
2214
  }).useWorker) {
2658
- const m = U(
2215
+ const d = I(
2659
2216
  this.dataX.buffer.byteLength,
2660
2217
  this.dataX.buffer.maxByteLength
2661
- ), b = U(
2218
+ ), y = I(
2662
2219
  this.dataY.buffer.byteLength,
2663
2220
  this.dataY.buffer.maxByteLength
2664
- ), h = new Float64Array(m), f = new Float32Array(b);
2665
- Nr(
2221
+ ), l = new Float64Array(d), u = new Float32Array(y);
2222
+ tr(
2666
2223
  this.dataX,
2667
2224
  this.dataY,
2668
- t,
2669
- h,
2670
- f,
2225
+ e,
2226
+ l,
2227
+ u,
2671
2228
  0,
2672
- r - 1,
2229
+ t - 1,
2673
2230
  0
2674
- ), this.dataset.source.x = h, this.dataset.source.y = f, this._resizeTo(s);
2231
+ ), this.dataset.source.x = l, this.dataset.source.y = u, this._resizeTo(n);
2675
2232
  return;
2676
2233
  }
2677
2234
  this._pendingExecutionMode = "worker";
2678
- const a = navigator.hardwareConcurrency || 1, o = Math.ceil(this.dataX.length / a), i = [], l = [];
2679
- for (let m = 0; m < a; m++) {
2680
- const b = m * o, h = Math.min((m + 1) * o - 1, this.dataX.length - 1), f = B(t, b), w = j(t, h), p = t.slice(f, w + 1);
2681
- l.push({ start: b, end: h, deleteSegment: p });
2682
- }
2683
- const d = new Array(a).fill(0);
2684
- for (let m = 1; m < a; m++)
2685
- d[m] = d[m - 1] + l[m - 1].deleteSegment.length;
2686
- const u = [], y = U(
2235
+ const i = navigator.hardwareConcurrency || 1, s = Math.ceil(this.dataX.length / i), a = [], c = [];
2236
+ for (let d = 0; d < i; d++) {
2237
+ const y = d * s, l = Math.min((d + 1) * s - 1, this.dataX.length - 1), u = x(e, y), g = C(e, l), h = e.slice(u, g + 1);
2238
+ c.push({ start: y, end: l, deleteSegment: h });
2239
+ }
2240
+ const p = new Array(i).fill(0);
2241
+ for (let d = 1; d < i; d++)
2242
+ p[d] = p[d - 1] + c[d - 1].deleteSegment.length;
2243
+ const f = [], w = I(
2687
2244
  this.dataX.buffer.byteLength,
2688
2245
  this.dataX.buffer.maxByteLength
2689
- ), g = U(
2246
+ ), m = I(
2690
2247
  this.dataY.buffer.byteLength,
2691
2248
  this.dataY.buffer.maxByteLength
2692
2249
  );
2693
- for (let m = 0; m < a; m++) {
2694
- const { start: b, end: h, deleteSegment: f } = l[m], w = b - d[m];
2695
- u.push(
2696
- new Promise((p) => {
2697
- const S = new vr();
2698
- i.push(S), S.postMessage({
2250
+ for (let d = 0; d < i; d++) {
2251
+ const { start: y, end: l, deleteSegment: u } = c[d], g = y - p[d];
2252
+ f.push(
2253
+ new Promise((h) => {
2254
+ const b = new Bt();
2255
+ a.push(b), b.postMessage({
2699
2256
  bufferX: this.dataX.buffer,
2700
2257
  bufferY: this.dataY.buffer,
2701
- outputBufferX: y,
2702
- outputBufferY: g,
2703
- start: b,
2704
- end: h,
2705
- deleteSegment: f,
2706
- startTarget: w
2707
- }), S.onmessage = (E) => {
2708
- p(E.data);
2258
+ outputBufferX: w,
2259
+ outputBufferY: m,
2260
+ start: y,
2261
+ end: l,
2262
+ deleteSegment: u,
2263
+ startTarget: g
2264
+ }), b.onmessage = (E) => {
2265
+ h(E.data);
2709
2266
  };
2710
2267
  })
2711
2268
  );
2712
2269
  }
2713
- await Promise.all(u), i.forEach((m) => m.terminate()), this.dataset.source.x = new Float64Array(y), this.dataset.source.y = new Float32Array(g), this._resizeTo(s);
2270
+ await Promise.all(f), a.forEach((d) => d.terminate()), this.dataset.source.x = new Float64Array(w), this.dataset.source.y = new Float32Array(m), this._resizeTo(n);
2714
2271
  }
2715
2272
  /**
2716
2273
  * Dispatch wrapper around `_driftCorrection` — reads target
@@ -2721,21 +2278,15 @@ class $s {
2721
2278
  * signature so future callers that need distinct per-range values
2722
2279
  * can still use it directly.
2723
2280
  */
2724
- async _driftCorrectionFromSelection(t) {
2725
- const r = this.history[this.history.length - 2]?.selected;
2726
- if (!r || r.length === 0) return;
2727
- const s = this._getConsecutiveGroups(r), n = [];
2728
- for (const a of s)
2729
- a.length !== 0 && n.push([a[0], a[a.length - 1], t]);
2730
- if (n.length !== 0)
2731
- return this._driftCorrection(n);
2281
+ async _driftCorrectionFromSelection(e) {
2282
+ const t = this.history[this.history.length - 2]?.selected;
2283
+ if (!t || t.length === 0) return;
2284
+ const n = this._getConsecutiveGroups(t), o = [];
2285
+ for (const i of n)
2286
+ i.length !== 0 && o.push([i[0], i[i.length - 1], e]);
2287
+ if (o.length !== 0)
2288
+ return this._driftCorrection(o);
2732
2289
  }
2733
- /**
2734
- *
2735
- * @param start The start index
2736
- * @param end The end index
2737
- * @param value The drift amount
2738
- */
2739
2290
  /**
2740
2291
  * Multi-threaded drift correction over one or more [start, end, value] ranges.
2741
2292
  * 1. Main thread reads each range's anchors (startDatetime, extent) once and chunks the range.
@@ -2743,68 +2294,68 @@ class $s {
2743
2294
  * 3. Each worker applies y_n = y_0 + value * ((x_i - startDatetime) / extent) in place on its jobs.
2744
2295
  * 4. Batching all ranges into a single call yields a single history entry.
2745
2296
  */
2746
- async _driftCorrection(t) {
2747
- if (!t || t.length === 0) return;
2748
- const r = this.dataset.source.x, s = navigator.hardwareConcurrency || 1;
2749
- let n = 0;
2750
- for (const [y, g] of t)
2751
- g > y && (n += g - y);
2752
- if (!D(v.DRIFT_CORRECTION, {
2753
- datasetSize: r.length,
2754
- selectionSize: n
2297
+ async _driftCorrection(e) {
2298
+ if (!e || e.length === 0) return;
2299
+ const t = this.dataset.source.x, n = navigator.hardwareConcurrency || 1;
2300
+ let o = 0;
2301
+ for (const [w, m] of e)
2302
+ m > w && (o += m - w);
2303
+ if (!U(S.DRIFT_CORRECTION, {
2304
+ datasetSize: t.length,
2305
+ selectionSize: o
2755
2306
  }).useWorker) {
2756
- Wr(r, this.dataY, t);
2307
+ sr(t, this.dataY, e);
2757
2308
  return;
2758
2309
  }
2759
2310
  this._pendingExecutionMode = "worker";
2760
- const o = [];
2761
- for (const [y, g, m] of t) {
2762
- if (g <= y) continue;
2763
- const b = r[y], h = r[g] - b;
2764
- if (h === 0) continue;
2765
- const f = g - y, w = Math.max(1, Math.ceil(f / s));
2766
- for (let p = y; p < g; p += w)
2767
- o.push({
2768
- chunkStart: p,
2769
- chunkEnd: Math.min(p + w, g),
2770
- startDatetime: b,
2771
- value: m,
2772
- extent: h
2311
+ const s = [];
2312
+ for (const [w, m, d] of e) {
2313
+ if (m <= w) continue;
2314
+ const y = t[w], l = t[m] - y;
2315
+ if (l === 0) continue;
2316
+ const u = m - w, g = Math.max(1, Math.ceil(u / n));
2317
+ for (let h = w; h < m; h += g)
2318
+ s.push({
2319
+ chunkStart: h,
2320
+ chunkEnd: Math.min(h + g, m),
2321
+ startDatetime: y,
2322
+ value: d,
2323
+ extent: l
2773
2324
  });
2774
2325
  }
2775
- if (o.length === 0) return;
2776
- const i = Math.min(s, o.length), l = Array.from(
2777
- { length: i },
2326
+ if (s.length === 0) return;
2327
+ const a = Math.min(n, s.length), c = Array.from(
2328
+ { length: a },
2778
2329
  () => []
2779
2330
  );
2780
- o.forEach((y, g) => l[g % i].push(y));
2781
- const d = [], u = [];
2782
- for (const y of l)
2783
- y.length !== 0 && u.push(
2784
- new Promise((g) => {
2785
- const m = new Ar();
2786
- d.push(m), m.postMessage({
2331
+ s.forEach((w, m) => c[m % a].push(w));
2332
+ const p = [], f = [];
2333
+ for (const w of c)
2334
+ w.length !== 0 && f.push(
2335
+ new Promise((m) => {
2336
+ const d = new Wt();
2337
+ p.push(d), d.postMessage({
2787
2338
  bufferX: this.dataX.buffer,
2788
2339
  bufferY: this.dataY.buffer,
2789
- jobs: y
2790
- }), m.onmessage = (b) => {
2791
- g(b.data);
2340
+ jobs: w
2341
+ }), d.onmessage = (y) => {
2342
+ m(y.data);
2792
2343
  };
2793
2344
  })
2794
2345
  );
2795
- await Promise.all(u), d.forEach((y) => y.terminate());
2346
+ await Promise.all(f), p.forEach((w) => w.terminate());
2796
2347
  }
2797
2348
  /** Traverses the index array and returns groups of consecutive values.
2798
2349
  * i.e.: `[0, 1, 3, 4, 6] => [[0, 1], [3, 4], [6]]`
2799
2350
  * Assumes the input array is sorted.
2800
2351
  * @param index: the index array (sorted)
2801
2352
  */
2802
- _getConsecutiveGroups(t) {
2803
- const r = [[]];
2804
- return t.reduce((s, n) => {
2805
- const a = s[s.length - 1];
2806
- return !a.length || n == a[a.length - 1] + 1 ? a.push(n) : s.push([n]), s;
2807
- }, r), r;
2353
+ _getConsecutiveGroups(e) {
2354
+ const t = [[]];
2355
+ return e.reduce((n, o) => {
2356
+ const i = n[n.length - 1];
2357
+ return !i.length || o == i[i.length - 1] + 1 ? i.push(o) : n.push([o]), n;
2358
+ }, t), t;
2808
2359
  }
2809
2360
  /**
2810
2361
  * Adds data points using worker threads.
@@ -2813,75 +2364,70 @@ class $s {
2813
2364
  * 3. `firstIns` per chunk doubles as the prefix sum of insertions placed before the chunk, giving each worker its outStart in the output buffer without overlap.
2814
2365
  * 4. Each worker linearly merges its original slice with its insertion slice (both already sorted by datetime) into the output buffer. Originals win on datetime ties, matching the original `findLastLessOrEqual` semantics.
2815
2366
  */
2816
- async _addDataPoints(t) {
2817
- if (t.length === 0) return [];
2818
- const r = this.dataX.length, s = r + t.length;
2819
- t.sort((h, f) => h[0] - f[0]);
2820
- const n = new Array(t.length);
2821
- for (let h = 0; h < t.length; h++) {
2822
- const f = t[h][0], w = j(this.dataX, f) + 1;
2823
- n[h] = w + h;
2824
- }
2825
- const a = s * Float64Array.BYTES_PER_ELEMENT, o = s * Float32Array.BYTES_PER_ELEMENT, i = U(
2826
- a,
2827
- Math.max(this.dataX.buffer.maxByteLength, a)
2828
- ), l = U(
2829
- o,
2830
- Math.max(this.dataY.buffer.maxByteLength, o)
2367
+ async _addDataPoints(e) {
2368
+ if (e.length === 0) return [];
2369
+ const t = this.dataX.length, n = t + e.length;
2370
+ e.sort((l, u) => l[0] - u[0]);
2371
+ const o = new Array(e.length);
2372
+ for (let l = 0; l < e.length; l++) {
2373
+ const u = e[l][0], g = C(this.dataX, u) + 1;
2374
+ o[l] = g + l;
2375
+ }
2376
+ const i = n * Float64Array.BYTES_PER_ELEMENT, s = n * Float32Array.BYTES_PER_ELEMENT, a = I(
2377
+ i,
2378
+ Math.max(this.dataX.buffer.maxByteLength, i)
2379
+ ), c = I(
2380
+ s,
2381
+ Math.max(this.dataY.buffer.maxByteLength, s)
2831
2382
  );
2832
- if (!D(v.ADD_POINTS, {
2833
- datasetSize: r,
2834
- selectionSize: t.length
2383
+ if (!U(S.ADD_POINTS, {
2384
+ datasetSize: t,
2385
+ selectionSize: e.length
2835
2386
  }).useWorker) {
2836
- const h = new Float64Array(i), f = new Float32Array(l);
2837
- return Pr(
2387
+ const l = new Float64Array(a), u = new Float32Array(c);
2388
+ return er(
2838
2389
  this.dataX,
2839
2390
  this.dataY,
2840
- t,
2841
- h,
2842
- f,
2391
+ e,
2392
+ l,
2393
+ u,
2843
2394
  0,
2844
- r,
2395
+ t,
2845
2396
  0
2846
- ), this.dataset.source.x = h, this.dataset.source.y = f, this._resizeTo(s), n;
2397
+ ), this.dataset.source.x = l, this.dataset.source.y = u, this._resizeTo(n), o;
2847
2398
  }
2848
2399
  this._pendingExecutionMode = "worker";
2849
- const u = t.map(
2850
- (h) => j(this.dataX, h[0]) + 1
2851
- ), y = Math.max(
2400
+ const f = e.map(
2401
+ (l) => C(this.dataX, l[0]) + 1
2402
+ ), w = Math.max(
2852
2403
  1,
2853
- Math.min(navigator.hardwareConcurrency || 1, Math.max(r, 1))
2854
- ), g = Math.ceil(Math.max(r, 1) / y), m = [], b = [];
2855
- for (let h = 0; h < y; h++) {
2856
- const f = h * g, w = Math.min((h + 1) * g, r), p = B(u, f), S = h === y - 1 ? t.length : B(u, w), E = t.slice(p, S), _ = f + p;
2857
- f >= w && E.length === 0 || b.push(
2858
- new Promise((L) => {
2859
- const $ = new Tr();
2860
- m.push($), $.postMessage({
2404
+ Math.min(navigator.hardwareConcurrency || 1, Math.max(t, 1))
2405
+ ), m = Math.ceil(Math.max(t, 1) / w), d = [], y = [];
2406
+ for (let l = 0; l < w; l++) {
2407
+ const u = l * m, g = Math.min((l + 1) * m, t), h = x(f, u), b = l === w - 1 ? e.length : x(f, g), E = e.slice(h, b), k = u + h;
2408
+ u >= g && E.length === 0 || y.push(
2409
+ new Promise((A) => {
2410
+ const _ = new Yt();
2411
+ d.push(_), _.postMessage({
2861
2412
  bufferX: this.dataX.buffer,
2862
2413
  bufferY: this.dataY.buffer,
2863
- outputBufferX: i,
2864
- outputBufferY: l,
2865
- origStart: f,
2866
- origEnd: w,
2414
+ outputBufferX: a,
2415
+ outputBufferY: c,
2416
+ origStart: u,
2417
+ origEnd: g,
2867
2418
  insertions: E,
2868
- outStart: _
2869
- }), $.onmessage = (I) => {
2870
- L(I.data);
2419
+ outStart: k
2420
+ }), _.onmessage = (T) => {
2421
+ A(T.data);
2871
2422
  };
2872
2423
  })
2873
2424
  );
2874
2425
  }
2875
- return await Promise.all(b), m.forEach((h) => h.terminate()), this.dataset.source.x = new Float64Array(i), this.dataset.source.y = new Float32Array(l), this._resizeTo(s), n;
2426
+ return await Promise.all(y), d.forEach((l) => l.terminate()), this.dataset.source.x = new Float64Array(a), this.dataset.source.y = new Float32Array(c), this._resizeTo(n), o;
2876
2427
  }
2877
2428
  // =======================
2878
2429
  // FILTER OPERATIONS
2879
2430
  // =======================
2880
- /**
2881
- * Filter by applying a set of logical operations
2882
- * @param appliedFilters
2883
- * @returns an array of index values to select in the plot
2884
- */
2885
2431
  /**
2886
2432
  * Filter by applying a set of logical operations, using worker threads.
2887
2433
  * 1. Main thread encodes filters as numeric opcodes + thresholds (cheaper than string compares in the hot loop).
@@ -2890,111 +2436,105 @@ class $s {
2890
2436
  *
2891
2437
  * Opcodes: 0=LT, 1=LTE, 2=GT, 3=GTE, 4=E.
2892
2438
  */
2893
- async _valueThreshold(t, r) {
2894
- const s = Object.keys(t);
2895
- if (s.length === 0) return [];
2896
- const n = {
2897
- [K.LT]: 0,
2898
- [K.LTE]: 1,
2899
- [K.GT]: 2,
2900
- [K.GTE]: 3,
2901
- [K.E]: 4
2902
- }, a = s.map((S) => n[S] ?? 4), o = s.map((S) => t[S]), i = this.dataset.source.y, l = this.dataset.source.x;
2903
- let d = 0, u = i.length;
2904
- if (u === 0) return [];
2905
- if (r != null) {
2906
- const [S, E] = r;
2907
- S != null && Number.isFinite(S) && (d = B(l, S)), E != null && Number.isFinite(E) && (u = j(l, E) + 1);
2908
- }
2909
- if (u <= d) return [];
2910
- const y = u - d;
2911
- if (!D(T.VALUE_THRESHOLD, {
2912
- datasetSize: y
2439
+ async _valueThreshold(e, t) {
2440
+ const n = Object.keys(e);
2441
+ if (n.length === 0) return [];
2442
+ const o = {
2443
+ [B.LT]: 0,
2444
+ [B.LTE]: 1,
2445
+ [B.GT]: 2,
2446
+ [B.GTE]: 3,
2447
+ [B.E]: 4
2448
+ }, i = n.map((b) => o[b] ?? 4), s = n.map((b) => e[b]), a = this.dataset.source.y, c = this.dataset.source.x;
2449
+ let p = 0, f = a.length;
2450
+ if (f === 0) return [];
2451
+ if (t != null) {
2452
+ const [b, E] = t;
2453
+ b != null && Number.isFinite(b) && (p = x(c, b)), E != null && Number.isFinite(E) && (f = C(c, E) + 1);
2454
+ }
2455
+ if (f <= p) return [];
2456
+ const w = f - p;
2457
+ if (!U(L.VALUE_THRESHOLD, {
2458
+ datasetSize: w
2913
2459
  }).useWorker)
2914
- return jt(i, d, u, a, o);
2460
+ return ht(a, p, f, i, s);
2915
2461
  this._pendingExecutionMode = "worker";
2916
- const m = Math.min(navigator.hardwareConcurrency || 1, y), b = Math.ceil(y / m), h = [], f = [];
2917
- for (let S = 0; S < m; S++) {
2918
- const E = d + S * b, _ = Math.min(d + (S + 1) * b, u);
2919
- if (E >= _) break;
2920
- f.push(
2921
- new Promise((L) => {
2922
- const $ = new Me();
2923
- h.push($), $.postMessage({
2462
+ const d = Math.min(navigator.hardwareConcurrency || 1, w), y = Math.ceil(w / d), l = [], u = [];
2463
+ for (let b = 0; b < d; b++) {
2464
+ const E = p + b * y, k = Math.min(p + (b + 1) * y, f);
2465
+ if (E >= k) break;
2466
+ u.push(
2467
+ new Promise((A) => {
2468
+ const _ = new he();
2469
+ l.push(_), _.postMessage({
2924
2470
  bufferY: this.dataY.buffer,
2925
2471
  start: E,
2926
- end: _,
2927
- ops: a,
2928
- values: o
2929
- }), $.onmessage = (I) => {
2930
- L(I.data);
2472
+ end: k,
2473
+ ops: i,
2474
+ values: s
2475
+ }), _.onmessage = (T) => {
2476
+ A(T.data);
2931
2477
  };
2932
2478
  })
2933
2479
  );
2934
2480
  }
2935
- const w = await Promise.all(f);
2936
- h.forEach((S) => S.terminate());
2937
- const p = [];
2938
- for (let S = 0; S < w.length; S++) {
2939
- const E = w[S];
2940
- for (let _ = 0; _ < E.length; _++) p.push(E[_]);
2481
+ const g = await Promise.all(u);
2482
+ l.forEach((b) => b.terminate());
2483
+ const h = [];
2484
+ for (let b = 0; b < g.length; b++) {
2485
+ const E = g[b];
2486
+ for (let k = 0; k < E.length; k++) h.push(E[k]);
2941
2487
  }
2942
- return p;
2488
+ return h;
2943
2489
  }
2944
- /**
2945
- *
2946
- * @param comparator
2947
- * @param value
2948
- * @returns
2949
- */
2950
2490
  /**
2951
2491
  * Find points where the relative rate `(curr - prev) / |prev|` satisfies the comparator, using worker threads.
2952
2492
  * 1. Main thread partitions scan range [1, dataY.length) into chunks; `Y[i-1]` is safely read from the shared buffer across chunk boundaries.
2953
2493
  * 2. Each worker runs a hoisted branch matching the comparator and returns matching indexes in ascending order.
2954
2494
  * 3. Main thread concatenates results in chunk order, preserving ascending order.
2955
2495
  */
2956
- async _rateOfChange(t, r, s) {
2957
- const n = this.dataset.source.y, a = this.dataset.source.x;
2958
- if (n.length < 2) return [];
2959
- let o = 1, i = n.length;
2960
- if (s != null) {
2961
- const [f, w] = s;
2962
- f != null && Number.isFinite(f) && (o = Math.max(1, B(a, f))), w != null && Number.isFinite(w) && (i = j(a, w) + 1);
2963
- }
2964
- if (i <= o) return [];
2965
- const l = i - o;
2966
- if (!D(T.RATE_OF_CHANGE, {
2967
- datasetSize: n.length
2496
+ async _rateOfChange(e, t, n) {
2497
+ const o = this.dataset.source.y, i = this.dataset.source.x;
2498
+ if (o.length < 2) return [];
2499
+ let s = 1, a = o.length;
2500
+ if (n != null) {
2501
+ const [u, g] = n;
2502
+ u != null && Number.isFinite(u) && (s = Math.max(1, x(i, u))), g != null && Number.isFinite(g) && (a = C(i, g) + 1);
2503
+ }
2504
+ if (a <= s) return [];
2505
+ const c = a - s;
2506
+ if (!U(L.RATE_OF_CHANGE, {
2507
+ datasetSize: o.length
2968
2508
  }).useWorker)
2969
- return Fr(n, o, i, t, r);
2509
+ return Jt(o, s, a, e, t);
2970
2510
  this._pendingExecutionMode = "worker";
2971
- const u = Math.min(navigator.hardwareConcurrency || 1, l), y = Math.ceil(l / u), g = [], m = [];
2972
- for (let f = 0; f < u; f++) {
2973
- const w = o + f * y, p = Math.min(o + (f + 1) * y, i);
2974
- if (w >= p) break;
2975
- m.push(
2976
- new Promise((S) => {
2977
- const E = new Or();
2978
- g.push(E), E.postMessage({
2511
+ const f = Math.min(navigator.hardwareConcurrency || 1, c), w = Math.ceil(c / f), m = [], d = [];
2512
+ for (let u = 0; u < f; u++) {
2513
+ const g = s + u * w, h = Math.min(s + (u + 1) * w, a);
2514
+ if (g >= h) break;
2515
+ d.push(
2516
+ new Promise((b) => {
2517
+ const E = new $t();
2518
+ m.push(E), E.postMessage({
2979
2519
  bufferY: this.dataY.buffer,
2980
- start: w,
2981
- end: p,
2982
- comparator: t,
2983
- value: r
2984
- }), E.onmessage = (_) => {
2985
- S(_.data);
2520
+ start: g,
2521
+ end: h,
2522
+ comparator: e,
2523
+ value: t
2524
+ }), E.onmessage = (k) => {
2525
+ b(k.data);
2986
2526
  };
2987
2527
  })
2988
2528
  );
2989
2529
  }
2990
- const b = await Promise.all(m);
2991
- g.forEach((f) => f.terminate());
2992
- const h = [];
2993
- for (let f = 0; f < b.length; f++) {
2994
- const w = b[f];
2995
- for (let p = 0; p < w.length; p++) h.push(w[p]);
2530
+ const y = await Promise.all(d);
2531
+ m.forEach((u) => u.terminate());
2532
+ const l = [];
2533
+ for (let u = 0; u < y.length; u++) {
2534
+ const g = y[u];
2535
+ for (let h = 0; h < g.length; h++) l.push(g[h]);
2996
2536
  }
2997
- return h;
2537
+ return l;
2998
2538
  }
2999
2539
  /**
3000
2540
  * Select all points whose datetime falls inside `[from, to]` (inclusive).
@@ -3002,14 +2542,14 @@ class $s {
3002
2542
  * O(log n) — no workers required. Pass `undefined` for either bound to
3003
2543
  * leave that side unconstrained; omitting both selects the full series.
3004
2544
  */
3005
- async _datetimeRange(t, r) {
3006
- const s = this.dataset.source.x, n = s.length;
3007
- if (n === 0) return [];
3008
- const a = t == null ? 0 : B(s, t), o = r == null ? n - 1 : j(s, r);
3009
- if (a > o) return [];
3010
- const i = new Array(o - a + 1);
3011
- for (let l = a; l <= o; l++) i[l - a] = l;
3012
- return i;
2545
+ async _datetimeRange(e, t) {
2546
+ const n = this.dataset.source.x, o = n.length;
2547
+ if (o === 0) return [];
2548
+ const i = e == null ? 0 : x(n, e), s = t == null ? o - 1 : C(n, t);
2549
+ if (i > s) return [];
2550
+ const a = new Array(s - i + 1);
2551
+ for (let c = i; c <= s; c++) a[c - i] = c;
2552
+ return a;
3013
2553
  }
3014
2554
  /**
3015
2555
  * SELECTION filter handler — also acts as the cleanup site for the
@@ -3036,64 +2576,58 @@ class $s {
3036
2576
  * fires a SELECTION carrying the same indices. Without this dedup
3037
2577
  * the script would grow a phantom SELECTION after every real filter.
3038
2578
  */
3039
- async _selection(t) {
3040
- const r = this.history[this.history.length - 2], s = !!r && r.method !== T.SELECTION && !!T[r.method], n = s && Array.isArray(r.selected) ? r.selected : void 0;
3041
- return !t || !t.length ? (this.history.pop(), n && n.length > 0 && this.history.pop(), t) : (n && Kr(n, t) ? this.history.pop() : s && this.history.splice(this.history.length - 2, 1), t);
2579
+ async _selection(e) {
2580
+ const t = this.history[this.history.length - 2], n = !!t && t.method !== L.SELECTION && !!L[t.method], o = n && Array.isArray(t.selected) ? t.selected : void 0;
2581
+ return !e || !e.length ? (this.history.pop(), o && o.length > 0 && this.history.pop(), e) : (o && hr(o, e) ? this.history.pop() : n && this.history.splice(this.history.length - 2, 1), e);
3042
2582
  }
3043
- /**
3044
- *
3045
- * @param comparator
3046
- * @param value
3047
- * @returns
3048
- */
3049
2583
  /**
3050
2584
  * Find points where the change from the previous value satisfies the comparator, using worker threads.
3051
2585
  * 1. Main thread partitions scan range [1, dataY.length) into chunks (each chunk's first index safely reads Y[i-1] from the shared buffer).
3052
2586
  * 2. Each worker runs a hoisted branch matching the comparator and returns matching indexes in ascending order.
3053
2587
  * 3. Main thread concatenates results in chunk order, preserving ascending order.
3054
2588
  */
3055
- async _change(t, r, s) {
3056
- const n = this.dataset.source.y, a = this.dataset.source.x;
3057
- if (n.length < 2) return [];
3058
- let o = 1, i = n.length;
3059
- if (s != null) {
3060
- const [f, w] = s;
3061
- f != null && Number.isFinite(f) && (o = Math.max(1, B(a, f))), w != null && Number.isFinite(w) && (i = j(a, w) + 1);
3062
- }
3063
- if (i <= o) return [];
3064
- const l = i - o;
3065
- if (!D(T.CHANGE, {
3066
- datasetSize: n.length
2589
+ async _change(e, t, n) {
2590
+ const o = this.dataset.source.y, i = this.dataset.source.x;
2591
+ if (o.length < 2) return [];
2592
+ let s = 1, a = o.length;
2593
+ if (n != null) {
2594
+ const [u, g] = n;
2595
+ u != null && Number.isFinite(u) && (s = Math.max(1, x(i, u))), g != null && Number.isFinite(g) && (a = C(i, g) + 1);
2596
+ }
2597
+ if (a <= s) return [];
2598
+ const c = a - s;
2599
+ if (!U(L.CHANGE, {
2600
+ datasetSize: o.length
3067
2601
  }).useWorker)
3068
- return Ur(n, o, i, t, r);
2602
+ return qt(o, s, a, e, t);
3069
2603
  this._pendingExecutionMode = "worker";
3070
- const u = Math.min(navigator.hardwareConcurrency || 1, l), y = Math.ceil(l / u), g = [], m = [];
3071
- for (let f = 0; f < u; f++) {
3072
- const w = o + f * y, p = Math.min(o + (f + 1) * y, i);
3073
- if (w >= p) break;
3074
- m.push(
3075
- new Promise((S) => {
3076
- const E = new Ir();
3077
- g.push(E), E.postMessage({
2604
+ const f = Math.min(navigator.hardwareConcurrency || 1, c), w = Math.ceil(c / f), m = [], d = [];
2605
+ for (let u = 0; u < f; u++) {
2606
+ const g = s + u * w, h = Math.min(s + (u + 1) * w, a);
2607
+ if (g >= h) break;
2608
+ d.push(
2609
+ new Promise((b) => {
2610
+ const E = new zt();
2611
+ m.push(E), E.postMessage({
3078
2612
  bufferY: this.dataY.buffer,
3079
- start: w,
3080
- end: p,
3081
- comparator: t,
3082
- value: r
3083
- }), E.onmessage = (_) => {
3084
- S(_.data);
2613
+ start: g,
2614
+ end: h,
2615
+ comparator: e,
2616
+ value: t
2617
+ }), E.onmessage = (k) => {
2618
+ b(k.data);
3085
2619
  };
3086
2620
  })
3087
2621
  );
3088
2622
  }
3089
- const b = await Promise.all(m);
3090
- g.forEach((f) => f.terminate());
3091
- const h = [];
3092
- for (let f = 0; f < b.length; f++) {
3093
- const w = b[f];
3094
- for (let p = 0; p < w.length; p++) h.push(w[p]);
2623
+ const y = await Promise.all(d);
2624
+ m.forEach((u) => u.terminate());
2625
+ const l = [];
2626
+ for (let u = 0; u < y.length; u++) {
2627
+ const g = y[u];
2628
+ for (let h = 0; h < g.length; h++) l.push(g[h]);
3095
2629
  }
3096
- return h;
2630
+ return l;
3097
2631
  }
3098
2632
  /**
3099
2633
  * Find gaps in the data using worker threads.
@@ -3109,49 +2643,49 @@ class $s {
3109
2643
  * same call survives data growth and is portable across datasets
3110
2644
  * for QC script replay.
3111
2645
  */
3112
- async _findGaps(t, r, s) {
3113
- const n = this.dataset.source.x;
3114
- let a = 0, o = n.length;
3115
- if (s != null) {
3116
- const [f, w] = s;
3117
- f != null && Number.isFinite(f) && (a = B(n, f)), w != null && Number.isFinite(w) && (o = j(n, w) + 1);
3118
- }
3119
- if (o <= a) return [];
3120
- const i = t * oe[r] * 1e3;
3121
- if (!D(T.FIND_GAPS, {
3122
- datasetSize: o - a
2646
+ async _findGaps(e, t, n) {
2647
+ const o = this.dataset.source.x;
2648
+ let i = 0, s = o.length;
2649
+ if (n != null) {
2650
+ const [u, g] = n;
2651
+ u != null && Number.isFinite(u) && (i = x(o, u)), g != null && Number.isFinite(g) && (s = C(o, g) + 1);
2652
+ }
2653
+ if (s <= i) return [];
2654
+ const a = e * G[t] * 1e3;
2655
+ if (!U(L.FIND_GAPS, {
2656
+ datasetSize: s - i
3123
2657
  }).useWorker) {
3124
- const f = Dr(n, a, o - 1, i), w = /* @__PURE__ */ new Set();
3125
- for (let p = 0; p < f.length; p++) w.add(f[p]);
3126
- return [...w];
2658
+ const u = Kt(o, i, s - 1, a), g = /* @__PURE__ */ new Set();
2659
+ for (let h = 0; h < u.length; h++) g.add(u[h]);
2660
+ return [...g];
3127
2661
  }
3128
2662
  this._pendingExecutionMode = "worker";
3129
- const d = o - a, u = Math.min(navigator.hardwareConcurrency || 1, d), y = Math.ceil(d / u), g = [], m = [];
3130
- for (let f = 0; f < u; f++) {
3131
- const w = a + f * y, p = Math.min(a + (f + 1) * y, o);
3132
- if (w >= p) break;
3133
- m.push(
3134
- new Promise((S) => {
3135
- const E = new $r();
3136
- g.push(E), E.postMessage({
2663
+ const p = s - i, f = Math.min(navigator.hardwareConcurrency || 1, p), w = Math.ceil(p / f), m = [], d = [];
2664
+ for (let u = 0; u < f; u++) {
2665
+ const g = i + u * w, h = Math.min(i + (u + 1) * w, s);
2666
+ if (g >= h) break;
2667
+ d.push(
2668
+ new Promise((b) => {
2669
+ const E = new Xt();
2670
+ m.push(E), E.postMessage({
3137
2671
  bufferX: this.dataX.buffer,
3138
- start: w,
3139
- endInclusive: p,
3140
- threshold: i
3141
- }), E.onmessage = (_) => {
3142
- S(_.data);
2672
+ start: g,
2673
+ endInclusive: h,
2674
+ threshold: a
2675
+ }), E.onmessage = (k) => {
2676
+ b(k.data);
3143
2677
  };
3144
2678
  })
3145
2679
  );
3146
2680
  }
3147
- const b = await Promise.all(m);
3148
- g.forEach((f) => f.terminate());
3149
- const h = /* @__PURE__ */ new Set();
3150
- for (let f = 0; f < b.length; f++) {
3151
- const w = b[f];
3152
- for (let p = 0; p < w.length; p++) h.add(w[p]);
2681
+ const y = await Promise.all(d);
2682
+ m.forEach((u) => u.terminate());
2683
+ const l = /* @__PURE__ */ new Set();
2684
+ for (let u = 0; u < y.length; u++) {
2685
+ const g = y[u];
2686
+ for (let h = 0; h < g.length; h++) l.add(g[h]);
3153
2687
  }
3154
- return [...h];
2688
+ return [...l];
3155
2689
  }
3156
2690
  /**
3157
2691
  * Find points where the values are the same at least `times` in a row, using worker threads.
@@ -3168,219 +2702,211 @@ class $s {
3168
2702
  * addressed) so the same call survives data growth and is
3169
2703
  * portable across datasets for QC script replay.
3170
2704
  */
3171
- async _persistence(t, r) {
3172
- const s = this.dataset.source.x, n = this.dataset.source.y;
3173
- let a = 0, o = n.length;
3174
- if (r != null) {
3175
- const [p, S] = r;
3176
- p != null && Number.isFinite(p) && (a = B(s, p)), S != null && Number.isFinite(S) && (o = j(s, S) + 1);
3177
- }
3178
- if (o <= a) return [];
3179
- const i = o - a;
3180
- if (!D(T.PERSISTENCE, {
3181
- datasetSize: i
2705
+ async _persistence(e, t) {
2706
+ const n = this.dataset.source.x, o = this.dataset.source.y;
2707
+ let i = 0, s = o.length;
2708
+ if (t != null) {
2709
+ const [h, b] = t;
2710
+ h != null && Number.isFinite(h) && (i = x(n, h)), b != null && Number.isFinite(b) && (s = C(n, b) + 1);
2711
+ }
2712
+ if (s <= i) return [];
2713
+ const a = s - i;
2714
+ if (!U(L.PERSISTENCE, {
2715
+ datasetSize: a
3182
2716
  }).useWorker) {
3183
- const p = Cr(n, a, o), S = [];
3184
- for (let E = 0; E < p.length; E += 3) {
3185
- const _ = p[E], L = p[E + 1];
3186
- if (L >= t)
3187
- for (let $ = 0; $ < L; $++) S.push(_ + $);
2717
+ const h = Qt(o, i, s), b = [];
2718
+ for (let E = 0; E < h.length; E += 3) {
2719
+ const k = h[E], A = h[E + 1];
2720
+ if (A >= e)
2721
+ for (let _ = 0; _ < A; _++) b.push(k + _);
3188
2722
  }
3189
- return S;
2723
+ return b;
3190
2724
  }
3191
2725
  this._pendingExecutionMode = "worker";
3192
- const d = Math.min(navigator.hardwareConcurrency || 1, i), u = Math.ceil(i / d), y = [], g = [];
3193
- for (let p = 0; p < d; p++) {
3194
- const S = a + p * u, E = Math.min(a + (p + 1) * u, o);
3195
- if (S >= E) break;
3196
- g.push(
3197
- new Promise((_) => {
3198
- const L = new Rr();
3199
- y.push(L), L.postMessage({
2726
+ const p = Math.min(navigator.hardwareConcurrency || 1, a), f = Math.ceil(a / p), w = [], m = [];
2727
+ for (let h = 0; h < p; h++) {
2728
+ const b = i + h * f, E = Math.min(i + (h + 1) * f, s);
2729
+ if (b >= E) break;
2730
+ m.push(
2731
+ new Promise((k) => {
2732
+ const A = new Ht();
2733
+ w.push(A), A.postMessage({
3200
2734
  bufferY: this.dataY.buffer,
3201
- start: S,
2735
+ start: b,
3202
2736
  end: E
3203
- }), L.onmessage = ($) => {
3204
- _($.data);
2737
+ }), A.onmessage = (_) => {
2738
+ k(_.data);
3205
2739
  };
3206
2740
  })
3207
2741
  );
3208
2742
  }
3209
- const m = await Promise.all(g);
3210
- y.forEach((p) => p.terminate());
3211
- const b = [], h = [], f = [];
3212
- for (let p = 0; p < m.length; p++) {
3213
- const S = m[p];
3214
- for (let E = 0; E < S.length; E += 3) {
3215
- const _ = S[E], L = S[E + 1], $ = S[E + 2], I = b.length - 1;
3216
- I >= 0 && f[I] === $ && b[I] + h[I] === _ ? h[I] += L : (b.push(_), h.push(L), f.push($));
2743
+ const d = await Promise.all(m);
2744
+ w.forEach((h) => h.terminate());
2745
+ const y = [], l = [], u = [];
2746
+ for (let h = 0; h < d.length; h++) {
2747
+ const b = d[h];
2748
+ for (let E = 0; E < b.length; E += 3) {
2749
+ const k = b[E], A = b[E + 1], _ = b[E + 2], T = y.length - 1;
2750
+ T >= 0 && u[T] === _ && y[T] + l[T] === k ? l[T] += A : (y.push(k), l.push(A), u.push(_));
3217
2751
  }
3218
2752
  }
3219
- const w = [];
3220
- for (let p = 0; p < b.length; p++) {
3221
- const S = h[p];
3222
- if (S >= t) {
3223
- const E = b[p];
3224
- for (let _ = 0; _ < S; _++) w.push(E + _);
2753
+ const g = [];
2754
+ for (let h = 0; h < y.length; h++) {
2755
+ const b = l[h];
2756
+ if (b >= e) {
2757
+ const E = y[h];
2758
+ for (let k = 0; k < b; k++) g.push(E + k);
3225
2759
  }
3226
2760
  }
3227
- return w;
2761
+ return g;
3228
2762
  }
3229
2763
  }
3230
- const ue = "1", es = /* @__PURE__ */ new Set([
3231
- ...Object.values(v),
3232
- ...Object.values(T)
2764
+ const V = "1", pr = /* @__PURE__ */ new Set([
2765
+ ...Object.values(S),
2766
+ ...Object.values(L)
3233
2767
  ]);
3234
- function Rs(e, t) {
3235
- const r = e.history.map((s) => {
3236
- const n = {
3237
- method: s.method,
3238
- args: s.args ? [...s.args] : []
2768
+ function Yr(r, e) {
2769
+ const t = r.history.map((n) => {
2770
+ const o = {
2771
+ method: n.method,
2772
+ args: n.args ? [...n.args] : []
3239
2773
  };
3240
- return s.status === "failed" && (n.status = "failed"), n;
2774
+ return n.status === "failed" && (o.status = "failed"), typeof n.timestamp == "number" && Number.isFinite(n.timestamp) && (o.timestamp = n.timestamp), o;
3241
2775
  });
3242
2776
  return {
3243
- version: ue,
2777
+ version: V,
3244
2778
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3245
2779
  window: {
3246
- startDate: t.startDate,
3247
- endDate: t.endDate
2780
+ startDate: e.startDate,
2781
+ endDate: e.endDate
3248
2782
  },
3249
- operations: r
2783
+ operations: t
3250
2784
  };
3251
2785
  }
3252
- function Is(e) {
3253
- if (!e || typeof e != "object")
2786
+ function Gr(r) {
2787
+ if (!r || typeof r != "object")
3254
2788
  throw new Error("QC script must be a JSON object.");
3255
- const t = e;
3256
- if (t.version !== ue)
2789
+ const e = r;
2790
+ if (e.version !== V)
3257
2791
  throw new Error(
3258
- `Unsupported QC script version: ${String(t.version)}. This loader understands version "${ue}".`
2792
+ `Unsupported QC script version: ${String(e.version)}. This loader understands version "${V}".`
3259
2793
  );
3260
- if (typeof t.createdAt != "string")
2794
+ if (typeof e.createdAt != "string")
3261
2795
  throw new Error("QC script is missing `createdAt` (ISO-8601 string).");
3262
- const r = t.window;
3263
- if (!r || typeof r != "object")
2796
+ const t = e.window;
2797
+ if (!t || typeof t != "object")
3264
2798
  throw new Error("QC script is missing `window`.");
3265
- if (typeof r.startDate != "string" || typeof r.endDate != "string")
2799
+ if (typeof t.startDate != "string" || typeof t.endDate != "string")
3266
2800
  throw new Error("`window.startDate` and `window.endDate` must be ISO-8601 strings.");
3267
- if (!Array.isArray(t.operations))
2801
+ if (!Array.isArray(e.operations))
3268
2802
  throw new Error("QC script `operations` must be an array.");
3269
- const s = t.operations.map((n, a) => {
3270
- if (!n || typeof n != "object")
3271
- throw new Error(`Operation ${a} must be an object.`);
3272
- const o = n;
3273
- if (typeof o.method != "string")
3274
- throw new Error(`Operation ${a} missing string \`method\`.`);
3275
- if (!es.has(o.method))
3276
- throw new Error(`Operation ${a} has unknown method: "${o.method}".`);
3277
- if (!Array.isArray(o.args))
3278
- throw new Error(`Operation ${a} \`args\` must be an array.`);
3279
- const i = {
3280
- method: o.method,
3281
- args: [...o.args]
2803
+ const n = e.operations.map((o, i) => {
2804
+ if (!o || typeof o != "object")
2805
+ throw new Error(`Operation ${i} must be an object.`);
2806
+ const s = o;
2807
+ if (typeof s.method != "string")
2808
+ throw new Error(`Operation ${i} missing string \`method\`.`);
2809
+ if (!pr.has(s.method))
2810
+ throw new Error(`Operation ${i} has unknown method: "${s.method}".`);
2811
+ if (!Array.isArray(s.args))
2812
+ throw new Error(`Operation ${i} \`args\` must be an array.`);
2813
+ const a = {
2814
+ method: s.method,
2815
+ args: [...s.args]
3282
2816
  };
3283
- return o.status === "failed" && (i.status = "failed"), i;
2817
+ if (s.status === "failed" && (a.status = "failed"), s.timestamp !== void 0) {
2818
+ if (typeof s.timestamp != "number" || !Number.isFinite(s.timestamp))
2819
+ throw new Error(
2820
+ `Operation ${i} \`timestamp\` must be a finite epoch-ms number when present.`
2821
+ );
2822
+ a.timestamp = s.timestamp;
2823
+ }
2824
+ return a;
3284
2825
  });
3285
2826
  return {
3286
- version: ue,
3287
- createdAt: t.createdAt,
2827
+ version: V,
2828
+ createdAt: e.createdAt,
3288
2829
  window: {
3289
- startDate: r.startDate,
3290
- endDate: r.endDate
2830
+ startDate: t.startDate,
2831
+ endDate: t.endDate
3291
2832
  },
3292
- operations: s
2833
+ operations: n
3293
2834
  };
3294
2835
  }
3295
- async function Os(e, t) {
3296
- e.history.length = 0, e.redoStack.length = 0, await e.reload();
3297
- const r = { applied: 0, failed: [] };
3298
- for (let s = 0; s < t.operations.length; s++) {
3299
- const n = t.operations[s];
2836
+ async function Xr(r, e) {
2837
+ r.history.length = 0, r.redoStack.length = 0, await r.reload();
2838
+ const t = { applied: 0, failed: [] };
2839
+ for (let n = 0; n < e.operations.length; n++) {
2840
+ const o = e.operations[n];
3300
2841
  try {
3301
- await e.dispatch(n.method, ...n.args), e.history[e.history.length - 1]?.status === "failed" ? r.failed.push({
3302
- index: s,
3303
- method: n.method,
2842
+ await r.dispatch(o.method, ...o.args), r.history[r.history.length - 1]?.status === "failed" ? t.failed.push({
2843
+ index: n,
2844
+ method: o.method,
3304
2845
  error: "Operation handler reported failure (see console)."
3305
- }) : r.applied++;
3306
- } catch (a) {
3307
- r.failed.push({
3308
- index: s,
3309
- method: n.method,
3310
- error: a instanceof Error ? a.message : String(a)
2846
+ }) : t.applied++;
2847
+ } catch (i) {
2848
+ t.failed.push({
2849
+ index: n,
2850
+ method: o.method,
2851
+ error: i instanceof Error ? i.message : String(i)
3311
2852
  });
3312
2853
  }
3313
2854
  }
3314
- return r;
2855
+ return t;
3315
2856
  }
3316
2857
  export {
3317
- N as ACCOUNT_BASE,
3318
- De as AUTH_BASE,
3319
- fs as ApiKey,
3320
- C as BASE_URL,
3321
- ps as Collaborator,
3322
- kt as DEFAULT_SNACK_DURATION,
3323
- ys as DataSource,
3324
- ss as Datastream,
3325
- v as EnumEditOperations,
3326
- T as EnumFilterOperations,
3327
- K as FilterOperation,
3328
- zt as HydroShareArchive,
3329
- re as INCREASE_AMOUNT,
3330
- Xt as Location,
3331
- Ht as LogicalOperation,
3332
- hs as OAuthProvider,
3333
- $s as ObservationRecord,
3334
- as as ObservedProperty,
3335
- Gt as Operator,
3336
- ls as Organization,
3337
- le as PROVIDER_BASE,
3338
- ws as Payload,
3339
- Vt as PermissionAction,
3340
- qt as PermissionResource,
3341
- lr as Position,
3342
- ts as PostHydroShareArchive,
3343
- is as ProcessingLevel,
3344
- ue as QC_SCRIPT_VERSION,
3345
- cs as ResultQualifier,
3346
- Ee as SESSION_BASE,
3347
- os as Sensor,
3348
- ur as Snack,
3349
- _t as SnackColor,
3350
- At as SnackIcon,
3351
- Tt as SnackTitle,
3352
- hr as Snackbar,
3353
- et as TAG_BASE,
3354
- A as THINGS_BASE,
3355
- rs as Thing,
3356
- W as TimeUnit,
3357
- ns as Unit,
3358
- us as User,
3359
- ds as Workspace,
3360
- ms as api,
3361
- c as apiMethods,
3362
- Os as applyScript,
3363
- Ts as clearCalibration,
3364
- Lt as createPatchObject,
3365
- Ls as ensureCalibration,
3366
- Jt as extractErrorMessage,
3367
- B as findFirstGreaterOrEqual,
3368
- j as findLastLessOrEqual,
3369
- bs as formatDate,
3370
- Ss as formatDuration,
3371
- yt as getCSRFToken,
3372
- ks as getCalibration,
3373
- _s as getLastBenchmarkDetail,
3374
- gs as getObservationsEndpoint,
3375
- As as getOperationTable,
3376
- ke as measureEllapsedTime,
3377
- vs as onCalibrationChange,
3378
- Is as parseScript,
3379
- gt as requestInterceptor,
3380
- mt as responseInterceptor,
3381
- zr as runBenchmarks,
3382
- Rs as serializeHistory,
3383
- D as shouldUseWorker,
3384
- Es as subtractHours,
3385
- oe as timeUnitMultipliers
2858
+ _r as ApiKey,
2859
+ Rr as Collaborator,
2860
+ Je as DEFAULT_SNACK_DURATION,
2861
+ Ir as DataSource,
2862
+ gr as Datastream,
2863
+ S as EnumEditOperations,
2864
+ L as EnumFilterOperations,
2865
+ B as FilterOperation,
2866
+ gt as HydroShareArchive,
2867
+ W as INCREASE_AMOUNT,
2868
+ yt as Location,
2869
+ wt as LogicalOperation,
2870
+ Ar as OAuthProvider,
2871
+ Wr as ObservationRecord,
2872
+ Er as ObservedProperty,
2873
+ mt as Operator,
2874
+ kr as Organization,
2875
+ Mr as Payload,
2876
+ bt as PermissionAction,
2877
+ Et as PermissionResource,
2878
+ Nt as Position,
2879
+ mr as PostHydroShareArchive,
2880
+ Sr as ProcessingLevel,
2881
+ V as QC_SCRIPT_VERSION,
2882
+ vr as ResultQualifier,
2883
+ br as Sensor,
2884
+ Ft as Snack,
2885
+ Ke as SnackColor,
2886
+ Qe as SnackIcon,
2887
+ Ze as SnackTitle,
2888
+ Dr as Snackbar,
2889
+ wr as Thing,
2890
+ N as TimeUnit,
2891
+ yr as Unit,
2892
+ Lr as User,
2893
+ Tr as Workspace,
2894
+ Xr as applyScript,
2895
+ Pr as clearCalibration,
2896
+ jr as ensureCalibration,
2897
+ x as findFirstGreaterOrEqual,
2898
+ C as findLastLessOrEqual,
2899
+ Ur as formatDate,
2900
+ Or as formatDuration,
2901
+ Nr as getCalibration,
2902
+ Fr as getLastBenchmarkDetail,
2903
+ Br as getOperationTable,
2904
+ re as measureEllapsedTime,
2905
+ Cr as onCalibrationChange,
2906
+ Gr as parseScript,
2907
+ cr as runBenchmarks,
2908
+ Yr as serializeHistory,
2909
+ U as shouldUseWorker,
2910
+ xr as subtractHours,
2911
+ G as timeUnitMultipliers
3386
2912
  };