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