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