@synnaxlabs/x 0.24.1 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +43 -42
- package/dist/binary.cjs +1 -3
- package/dist/binary.js +2 -98
- package/dist/bounds-CpboA0q6.js +127 -0
- package/dist/bounds-ZZc1c-_Z.cjs +1 -0
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/{box-C92jYSNY.js → box-B5SaODGu.js} +5 -8
- package/dist/{box-m3dlc1kR.cjs → box-C6r0YnKB.cjs} +1 -1
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/caseconv.cjs +1 -1
- package/dist/caseconv.js +1 -1
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +35 -51
- package/dist/{dimensions-BAuHfd-b.js → dimensions-D-1PnJVI.js} +1 -2
- package/dist/dimensions.js +1 -1
- package/dist/{external-DI9122wF.js → external-CO221aaF.js} +4 -8
- package/dist/index-BGz7XJIe.cjs +1 -0
- package/dist/index-C9i674Sf.js +41 -0
- package/dist/{index-BhEWuRmo.cjs → index-CvHP07Bs.cjs} +1 -1
- package/dist/index-CzjnpuXF.js +101 -0
- package/dist/{index-IGDDLWef.js → index-DCwgKLH_.js} +7 -13
- package/dist/index-tYmAULd8.cjs +3 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +135 -120
- package/dist/{location-c3g6WKs-.cjs → location-55G2uRZN.cjs} +1 -1
- package/dist/{location-CfP9TAnW.js → location-C6sCnzhU.js} +1 -1
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/observe.cjs +1 -1
- package/dist/observe.js +2 -3
- package/dist/path-Coj1BKMh.cjs +1 -0
- package/dist/path-DH9iaDDf.js +58 -0
- package/dist/{position-B_aphAR0.js → position-BY9oBMZB.js} +4 -6
- package/dist/{position-BBnkwGX1.cjs → position-BwmbckCe.cjs} +1 -1
- package/dist/position.cjs +1 -1
- package/dist/position.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/{scale-CgtgqlYU.js → scale-BgCpxgAk.js} +42 -40
- package/dist/scale-COuYv97b.cjs +1 -0
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/search.js +1 -2
- package/dist/series-CNcMldp_.cjs +11 -0
- package/dist/{series-w7kOJP17.js → series-CaeAWaDJ.js} +247 -269
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +7 -7
- package/dist/src/binary/encoder.d.ts +11 -11
- package/dist/src/binary/encoder.d.ts.map +1 -1
- package/dist/src/caseconv/caseconv.d.ts +41 -4
- package/dist/src/caseconv/caseconv.d.ts.map +1 -1
- package/dist/src/caseconv/caseconv.spec.d.ts +2 -0
- package/dist/src/caseconv/caseconv.spec.d.ts.map +1 -0
- package/dist/src/change/change.d.ts.map +1 -1
- package/dist/src/clamp/clamp.d.ts +3 -1
- package/dist/src/clamp/clamp.d.ts.map +1 -1
- package/dist/src/compare/compare.d.ts +1 -1
- package/dist/src/compare/compare.d.ts.map +1 -1
- package/dist/src/control/control.d.ts.map +1 -1
- package/dist/src/debounce/debounce.d.ts.map +1 -1
- package/dist/src/deep/copy.d.ts.map +1 -1
- package/dist/src/deep/delete.d.ts.map +1 -1
- package/dist/src/deep/difference.d.ts.map +1 -1
- package/dist/src/deep/equal.d.ts +8 -2
- package/dist/src/deep/equal.d.ts.map +1 -1
- package/dist/src/deep/merge.d.ts +1 -1
- package/dist/src/deep/merge.d.ts.map +1 -1
- package/dist/src/deep/path.d.ts +1 -3
- package/dist/src/deep/path.d.ts.map +1 -1
- package/dist/src/errors/errors.d.ts +12 -0
- package/dist/src/errors/errors.d.ts.map +1 -0
- package/dist/src/errors/index.d.ts +2 -0
- package/dist/src/errors/index.d.ts.map +1 -0
- package/dist/src/id/id.d.ts +4 -0
- package/dist/src/id/id.d.ts.map +1 -0
- package/dist/src/id/index.d.ts +2 -0
- package/dist/src/id/index.d.ts.map +1 -0
- package/dist/src/identity.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/math/math.d.ts.map +1 -1
- package/dist/src/migrate/migrate.d.ts +3 -3
- package/dist/src/migrate/migrate.d.ts.map +1 -1
- package/dist/src/mock/MockGLBufferController.d.ts +1 -1
- package/dist/src/numeric/index.d.ts +2 -0
- package/dist/src/numeric/index.d.ts.map +1 -0
- package/dist/src/numeric/numeric.d.ts +3 -0
- package/dist/src/numeric/numeric.d.ts.map +1 -0
- package/dist/src/record.d.ts +1 -1
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/runtime/os.d.ts.map +1 -1
- package/dist/src/search.d.ts +1 -1
- package/dist/src/search.d.ts.map +1 -1
- package/dist/src/shallowCopy.d.ts.map +1 -1
- package/dist/src/spatial/bounds/bounds.d.ts +19 -17
- package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
- package/dist/src/spatial/box/box.d.ts +1 -14
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts +1 -1
- package/dist/src/spatial/direction/direction.d.ts +1 -1
- package/dist/src/spatial/direction/direction.d.ts.map +1 -1
- package/dist/src/spatial/location/location.d.ts +3 -3
- package/dist/src/spatial/location/location.d.ts.map +1 -1
- package/dist/src/spatial/position/position.d.ts +2 -2
- package/dist/src/spatial/position/position.d.ts.map +1 -1
- package/dist/src/spatial/scale/scale.d.ts +27 -23
- package/dist/src/spatial/scale/scale.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +1 -1
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +3 -3
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +2 -2
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/toArray.d.ts.map +1 -1
- package/dist/src/unique.d.ts.map +1 -1
- package/dist/src/url/url.d.ts.map +1 -1
- package/dist/src/zodutil/zodutil.d.ts +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/url.cjs +1 -1
- package/dist/url.js +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +1 -1
- package/dist/{xy-D1ZbIqpT.js → xy-CrgPnICw.js} +1 -2
- package/dist/xy.js +1 -1
- package/dist/zodutil.cjs +1 -1
- package/dist/zodutil.js +2 -3
- package/package.json +8 -8
- package/src/binary/encoder.spec.ts +13 -13
- package/src/binary/encoder.ts +15 -13
- package/src/caseconv/caseconv.spec.ts +121 -0
- package/src/caseconv/caseconv.ts +117 -14
- package/src/clamp/clamp.ts +5 -3
- package/src/compare/compare.ts +2 -2
- package/src/deep/delete.spec.ts +38 -1
- package/src/deep/delete.ts +1 -2
- package/src/deep/path.ts +0 -7
- package/src/errors/errors.ts +17 -0
- package/src/errors/index.ts +1 -0
- package/src/id/id.ts +14 -0
- package/src/id/index.ts +10 -0
- package/src/index.ts +2 -0
- package/src/numeric/index.ts +1 -0
- package/src/numeric/numeric.ts +6 -0
- package/src/record.ts +1 -1
- package/src/spatial/bounds/bounds.spec.ts +47 -0
- package/src/spatial/bounds/bounds.ts +36 -20
- package/src/spatial/scale/scale.spec.ts +5 -5
- package/src/spatial/scale/scale.ts +75 -59
- package/src/telem/series.spec.ts +17 -3
- package/src/telem/series.ts +12 -8
- package/src/telem/telem.spec.ts +25 -2
- package/src/telem/telem.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/bounds-Bh_QBZZK.cjs +0 -1
- package/dist/bounds-Dmn-hd_-.js +0 -129
- package/dist/index-BpCPHf78.cjs +0 -1
- package/dist/index-BwkQTA-j.js +0 -360
- package/dist/path-BO4pyGZf.cjs +0 -1
- package/dist/path-nTHmt_4i.js +0 -65
- package/dist/scale-C8axypQ2.cjs +0 -1
- package/dist/series-Cgjkfl5S.cjs +0 -11
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
1
|
+
var W = Object.defineProperty;
|
|
2
|
+
var K = (f, t, e) => t in f ? W(f, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[t] = e;
|
|
3
|
+
var s = (f, t, e) => K(f, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { J as L } from "./index-CzjnpuXF.js";
|
|
5
|
+
import { s as j } from "./index-C9i674Sf.js";
|
|
6
|
+
import { n as H } from "./index-DCwgKLH_.js";
|
|
7
|
+
import { c as D } from "./bounds-CpboA0q6.js";
|
|
8
|
+
import "./box-B5SaODGu.js";
|
|
9
|
+
import "./dimensions-D-1PnJVI.js";
|
|
9
10
|
import "./base-DnZzEvvz.js";
|
|
10
|
-
import "./location-
|
|
11
|
-
import "./scale-
|
|
12
|
-
import "./xy-
|
|
11
|
+
import "./location-C6sCnzhU.js";
|
|
12
|
+
import "./scale-BgCpxgAk.js";
|
|
13
|
+
import "./xy-CrgPnICw.js";
|
|
13
14
|
import { z as c } from "zod";
|
|
14
|
-
let
|
|
15
|
-
let
|
|
16
|
-
for (;
|
|
17
|
-
|
|
18
|
-
return
|
|
15
|
+
let X = (f, t = 21) => (e = t) => {
|
|
16
|
+
let r = "", u = e;
|
|
17
|
+
for (; u--; )
|
|
18
|
+
r += f[Math.random() * f.length | 0];
|
|
19
|
+
return r;
|
|
19
20
|
};
|
|
20
|
-
const
|
|
21
|
+
const z = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Z = X(z, 11), mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
22
|
+
__proto__: null,
|
|
23
|
+
id: Z
|
|
24
|
+
}, Symbol.toStringTag, { value: "Module" })), k = (f, t) => {
|
|
21
25
|
const e = new m(t);
|
|
22
26
|
if (![
|
|
23
27
|
w.DAY,
|
|
@@ -35,16 +39,14 @@ const $ = (f, t) => {
|
|
|
35
39
|
return f instanceof m ? new m(r) : new w(r);
|
|
36
40
|
}, i = class i {
|
|
37
41
|
constructor(t, e = "UTC") {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (t == null)
|
|
41
|
-
this.value = i.now().valueOf();
|
|
42
|
+
s(this, "value");
|
|
43
|
+
s(this, "encodeValue", !0);
|
|
44
|
+
if (t == null) this.value = i.now().valueOf();
|
|
42
45
|
else if (t instanceof Date)
|
|
43
46
|
this.value = BigInt(t.getTime()) * i.MILLISECOND.valueOf();
|
|
44
47
|
else if (typeof t == "string")
|
|
45
48
|
this.value = i.parseDateTimeString(t, e).valueOf();
|
|
46
|
-
else if (Array.isArray(t))
|
|
47
|
-
this.value = i.parseDate(t);
|
|
49
|
+
else if (Array.isArray(t)) this.value = i.parseDate(t);
|
|
48
50
|
else {
|
|
49
51
|
let r = BigInt(0);
|
|
50
52
|
t instanceof Number && (t = t.valueOf()), e === "local" && (r = i.utcOffset.valueOf()), typeof t == "number" && (isFinite(t) ? t = Math.trunc(t) : (isNaN(t) && (t = 0), t === 1 / 0 ? t = i.MAX : t = i.MIN)), this.value = BigInt(t.valueOf()) + r;
|
|
@@ -253,7 +255,7 @@ const $ = (f, t) => {
|
|
|
253
255
|
* @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
|
|
254
256
|
*/
|
|
255
257
|
remainder(t) {
|
|
256
|
-
return
|
|
258
|
+
return k(this, t);
|
|
257
259
|
}
|
|
258
260
|
/** @returns true if the day portion TimeStamp is today, false otherwise. */
|
|
259
261
|
get isToday() {
|
|
@@ -316,17 +318,17 @@ const $ = (f, t) => {
|
|
|
316
318
|
}
|
|
317
319
|
};
|
|
318
320
|
/* One nanosecond after the unix epoch */
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
321
|
+
s(i, "NANOSECOND", i.nanoseconds(1)), /** One microsecond after the unix epoch */
|
|
322
|
+
s(i, "MICROSECOND", i.microseconds(1)), /** One millisecond after the unix epoch */
|
|
323
|
+
s(i, "MILLISECOND", i.milliseconds(1)), /** One second after the unix epoch */
|
|
324
|
+
s(i, "SECOND", i.seconds(1)), /** One minute after the unix epoch */
|
|
325
|
+
s(i, "MINUTE", i.minutes(1)), /** One hour after the unix epoch */
|
|
326
|
+
s(i, "HOUR", i.hours(1)), /** One day after the unix epoch */
|
|
327
|
+
s(i, "DAY", i.days(1)), /** The maximum possible value for a timestamp */
|
|
328
|
+
s(i, "MAX", new i((1n << 63n) - 1n)), /** The minimum possible value for a timestamp */
|
|
329
|
+
s(i, "MIN", new i(0)), /** The unix epoch */
|
|
330
|
+
s(i, "ZERO", new i(0)), /** A zod schema for validating timestamps */
|
|
331
|
+
s(i, "z", c.union([
|
|
330
332
|
c.object({ value: c.bigint() }).transform((t) => new i(t.value)),
|
|
331
333
|
c.string().transform((t) => new i(BigInt(t))),
|
|
332
334
|
c.instanceof(Number).transform((t) => new i(t)),
|
|
@@ -336,8 +338,8 @@ n(i, "z", c.union([
|
|
|
336
338
|
let m = i;
|
|
337
339
|
const a = class a {
|
|
338
340
|
constructor(t) {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
+
s(this, "value");
|
|
342
|
+
s(this, "encodeValue", !0);
|
|
341
343
|
typeof t == "number" && (t = Math.trunc(t.valueOf())), this.value = BigInt(t.valueOf());
|
|
342
344
|
}
|
|
343
345
|
encode() {
|
|
@@ -359,7 +361,7 @@ const a = class a {
|
|
|
359
361
|
return this.valueOf() >= new a(t).valueOf();
|
|
360
362
|
}
|
|
361
363
|
remainder(t) {
|
|
362
|
-
return
|
|
364
|
+
return k(this, t);
|
|
363
365
|
}
|
|
364
366
|
truncate(t) {
|
|
365
367
|
return new a(
|
|
@@ -494,17 +496,17 @@ const a = class a {
|
|
|
494
496
|
}
|
|
495
497
|
};
|
|
496
498
|
/** A nanosecond. */
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
499
|
+
s(a, "NANOSECOND", a.nanoseconds(1)), /** A microsecond. */
|
|
500
|
+
s(a, "MICROSECOND", a.microseconds(1)), /** A millisecond. */
|
|
501
|
+
s(a, "MILLISECOND", a.milliseconds(1)), /** A second. */
|
|
502
|
+
s(a, "SECOND", a.seconds(1)), /** A minute. */
|
|
503
|
+
s(a, "MINUTE", a.minutes(1)), /** Represents an hour. */
|
|
504
|
+
s(a, "HOUR", a.hours(1)), /** Represents a day. */
|
|
505
|
+
s(a, "DAY", a.days(1)), /** The maximum possible value for a TimeSpan. */
|
|
506
|
+
s(a, "MAX", new a((1n << 63n) - 1n)), /** The minimum possible value for a TimeSpan. */
|
|
507
|
+
s(a, "MIN", new a(0)), /** The zero value for a TimeSpan. */
|
|
508
|
+
s(a, "ZERO", new a(0)), /** A zod schema for validating and transforming timespans */
|
|
509
|
+
s(a, "z", c.union([
|
|
508
510
|
c.object({ value: c.bigint() }).transform((t) => new a(t.value)),
|
|
509
511
|
c.string().transform((t) => new a(BigInt(t))),
|
|
510
512
|
c.instanceof(Number).transform((t) => new a(t)),
|
|
@@ -590,12 +592,12 @@ const v = class v extends Number {
|
|
|
590
592
|
}
|
|
591
593
|
};
|
|
592
594
|
/** A zod schema for validating and transforming rates */
|
|
593
|
-
|
|
595
|
+
s(v, "z", c.union([
|
|
594
596
|
c.number().transform((t) => new v(t)),
|
|
595
597
|
c.instanceof(Number).transform((t) => new v(t)),
|
|
596
598
|
c.instanceof(v)
|
|
597
599
|
]));
|
|
598
|
-
let
|
|
600
|
+
let $ = v;
|
|
599
601
|
const y = class y extends Number {
|
|
600
602
|
/**
|
|
601
603
|
* Creates a Density representing the given number of bytes per value.
|
|
@@ -615,13 +617,13 @@ const y = class y extends Number {
|
|
|
615
617
|
}
|
|
616
618
|
};
|
|
617
619
|
/** Unknown/Invalid Density. */
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
620
|
+
s(y, "UNKNOWN", new y(0)), /** 128 bits per value. */
|
|
621
|
+
s(y, "BIT128", new y(16)), /** 64 bits per value. */
|
|
622
|
+
s(y, "BIT64", new y(8)), /** 32 bits per value. */
|
|
623
|
+
s(y, "BIT32", new y(4)), /** 16 bits per value. */
|
|
624
|
+
s(y, "BIT16", new y(2)), /** 8 bits per value. */
|
|
625
|
+
s(y, "BIT8", new y(1)), /** A zod schema for validating and transforming densities */
|
|
626
|
+
s(y, "z", c.union([
|
|
625
627
|
c.number().transform((t) => new y(t)),
|
|
626
628
|
c.instanceof(Number).transform((t) => new y(t)),
|
|
627
629
|
c.instanceof(y)
|
|
@@ -643,7 +645,7 @@ const b = class b {
|
|
|
643
645
|
*
|
|
644
646
|
* In most cases, operations should treat start as inclusive.
|
|
645
647
|
*/
|
|
646
|
-
|
|
648
|
+
s(this, "start");
|
|
647
649
|
/**
|
|
648
650
|
* The starting TimeStamp of the TimeRange.
|
|
649
651
|
*
|
|
@@ -652,7 +654,7 @@ const b = class b {
|
|
|
652
654
|
*
|
|
653
655
|
* In most cases, operations should treat end as exclusive.
|
|
654
656
|
*/
|
|
655
|
-
|
|
657
|
+
s(this, "end");
|
|
656
658
|
typeof t == "object" && "start" in t ? (this.start = new m(t.start), this.end = new m(t.end)) : (this.start = new m(t), this.end = new m(e));
|
|
657
659
|
}
|
|
658
660
|
/** @returns The TimeSpan occupied by the TimeRange. */
|
|
@@ -717,10 +719,8 @@ const b = class b {
|
|
|
717
719
|
overlapsWith(t, e = w.ZERO) {
|
|
718
720
|
t = t.makeValid();
|
|
719
721
|
const r = this.makeValid();
|
|
720
|
-
if (this.equals(t))
|
|
721
|
-
|
|
722
|
-
if (t.end.equals(r.start) || r.end.equals(t.start))
|
|
723
|
-
return !1;
|
|
722
|
+
if (this.equals(t)) return !0;
|
|
723
|
+
if (t.end.equals(r.start) || r.end.equals(t.start)) return !1;
|
|
724
724
|
const u = m.max(r.start, t.start), h = m.min(r.end, t.end);
|
|
725
725
|
return h.before(u) ? !1 : new w(h.sub(u)).greaterThanOrEqual(e);
|
|
726
726
|
}
|
|
@@ -737,33 +737,33 @@ const b = class b {
|
|
|
737
737
|
}
|
|
738
738
|
};
|
|
739
739
|
/** The maximum possible time range. */
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
740
|
+
s(b, "MAX", new b(m.MIN, m.MAX)), /** The minimum possible time range. */
|
|
741
|
+
s(b, "MIN", new b(m.MAX, m.MIN)), /** A zero time range. */
|
|
742
|
+
s(b, "ZERO", new b(m.ZERO, m.ZERO)), /** A zod schema for validating and transforming time ranges */
|
|
743
|
+
s(b, "z", c.union([
|
|
744
744
|
c.object({ start: m.z, end: m.z }).transform((t) => new b(t.start, t.end)),
|
|
745
745
|
c.instanceof(b)
|
|
746
746
|
]));
|
|
747
747
|
let U = b;
|
|
748
|
-
const
|
|
748
|
+
const n = class n extends String {
|
|
749
749
|
constructor(t) {
|
|
750
|
-
if (t instanceof
|
|
750
|
+
if (t instanceof n || typeof t == "string" || typeof t.valueOf() == "string") {
|
|
751
751
|
super(t.valueOf());
|
|
752
752
|
return;
|
|
753
753
|
} else {
|
|
754
|
-
const e =
|
|
754
|
+
const e = n.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);
|
|
755
755
|
if (e != null) {
|
|
756
756
|
super(e.valueOf());
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
|
-
throw super(
|
|
760
|
+
throw super(n.UNKNOWN.valueOf()), new Error(`unable to find data type for ${t.toString()}`);
|
|
761
761
|
}
|
|
762
762
|
/**
|
|
763
763
|
* @returns the TypedArray constructor for the DataType.
|
|
764
764
|
*/
|
|
765
765
|
get Array() {
|
|
766
|
-
const t =
|
|
766
|
+
const t = n.ARRAY_CONSTRUCTORS.get(this.toString());
|
|
767
767
|
if (t == null)
|
|
768
768
|
throw new Error(`unable to find array constructor for ${this.valueOf()}`);
|
|
769
769
|
return t;
|
|
@@ -776,10 +776,10 @@ const s = class s extends String {
|
|
|
776
776
|
return this.valueOf();
|
|
777
777
|
}
|
|
778
778
|
get isVariable() {
|
|
779
|
-
return this.equals(
|
|
779
|
+
return this.equals(n.JSON) || this.equals(n.STRING);
|
|
780
780
|
}
|
|
781
781
|
get isNumeric() {
|
|
782
|
-
return !this.isVariable && !this.equals(
|
|
782
|
+
return !this.isVariable && !this.equals(n.UUID);
|
|
783
783
|
}
|
|
784
784
|
get isInteger() {
|
|
785
785
|
return this.toString().startsWith("int");
|
|
@@ -788,9 +788,8 @@ const s = class s extends String {
|
|
|
788
788
|
return this.toString().startsWith("float");
|
|
789
789
|
}
|
|
790
790
|
get density() {
|
|
791
|
-
const t =
|
|
792
|
-
if (t == null)
|
|
793
|
-
throw new Error(`unable to find density for ${this.valueOf()}`);
|
|
791
|
+
const t = n.DENSITIES.get(this.toString());
|
|
792
|
+
if (t == null) throw new Error(`unable to find density for ${this.valueOf()}`);
|
|
794
793
|
return t;
|
|
795
794
|
}
|
|
796
795
|
/** @returns true if the data type can be cast to the other data type without loss of precision. */
|
|
@@ -814,91 +813,91 @@ const s = class s extends String {
|
|
|
814
813
|
return this.toString();
|
|
815
814
|
}
|
|
816
815
|
get usesBigInt() {
|
|
817
|
-
return
|
|
816
|
+
return n.BIG_INT_TYPES.some((t) => t.equals(this));
|
|
818
817
|
}
|
|
819
818
|
};
|
|
820
819
|
/** Represents an Unknown/Invalid DataType. */
|
|
821
|
-
n
|
|
822
|
-
n
|
|
823
|
-
n
|
|
824
|
-
n
|
|
825
|
-
n
|
|
826
|
-
n
|
|
827
|
-
n
|
|
828
|
-
n
|
|
829
|
-
n
|
|
830
|
-
n
|
|
831
|
-
n
|
|
832
|
-
n
|
|
833
|
-
n
|
|
834
|
-
n
|
|
820
|
+
s(n, "UNKNOWN", new n("unknown")), /** Represents a 64-bit floating point value. */
|
|
821
|
+
s(n, "FLOAT64", new n("float64")), /** Represents a 32-bit floating point value. */
|
|
822
|
+
s(n, "FLOAT32", new n("float32")), /** Represents a 64-bit signed integer value. */
|
|
823
|
+
s(n, "INT64", new n("int64")), /** Represents a 32-bit signed integer value. */
|
|
824
|
+
s(n, "INT32", new n("int32")), /** Represents a 16-bit signed integer value. */
|
|
825
|
+
s(n, "INT16", new n("int16")), /** Represents a 8-bit signed integer value. */
|
|
826
|
+
s(n, "INT8", new n("int8")), /** Represents a 64-bit unsigned integer value. */
|
|
827
|
+
s(n, "UINT64", new n("uint64")), /** Represents a 32-bit unsigned integer value. */
|
|
828
|
+
s(n, "UINT32", new n("uint32")), /** Represents a 16-bit unsigned integer value. */
|
|
829
|
+
s(n, "UINT16", new n("uint16")), /** Represents a 8-bit unsigned integer value. */
|
|
830
|
+
s(n, "UINT8", new n("uint8")), /** Represents a boolean value. Alias for UINT8. */
|
|
831
|
+
s(n, "BOOLEAN", n.UINT8), /** Represents a 64-bit unix epoch. */
|
|
832
|
+
s(n, "TIMESTAMP", new n("timestamp")), /** Represents a UUID data type */
|
|
833
|
+
s(n, "UUID", new n("uuid")), /** Represents a string data type. Strings have an unknown density, and are separate
|
|
835
834
|
* by a newline character. */
|
|
836
|
-
n
|
|
835
|
+
s(n, "STRING", new n("string")), /** Represents a JSON data type. JSON has an unknown density, and is separated by a
|
|
837
836
|
* newline character. */
|
|
838
|
-
n
|
|
839
|
-
[
|
|
840
|
-
[
|
|
841
|
-
[
|
|
842
|
-
[
|
|
843
|
-
[
|
|
844
|
-
[
|
|
845
|
-
[
|
|
846
|
-
[
|
|
847
|
-
[
|
|
848
|
-
[
|
|
849
|
-
[
|
|
850
|
-
[
|
|
851
|
-
[
|
|
852
|
-
[
|
|
853
|
-
])), n
|
|
854
|
-
[Uint8Array.name,
|
|
855
|
-
[Uint16Array.name,
|
|
856
|
-
[Uint32Array.name,
|
|
857
|
-
[BigUint64Array.name,
|
|
858
|
-
[Float32Array.name,
|
|
859
|
-
[Float64Array.name,
|
|
860
|
-
[Int8Array.name,
|
|
861
|
-
[Int16Array.name,
|
|
862
|
-
[Int32Array.name,
|
|
863
|
-
[BigInt64Array.name,
|
|
864
|
-
])), n
|
|
865
|
-
[
|
|
866
|
-
[
|
|
867
|
-
[
|
|
868
|
-
[
|
|
869
|
-
[
|
|
870
|
-
[
|
|
871
|
-
[
|
|
872
|
-
[
|
|
873
|
-
[
|
|
874
|
-
[
|
|
875
|
-
[
|
|
876
|
-
[
|
|
877
|
-
[
|
|
878
|
-
[
|
|
837
|
+
s(n, "JSON", new n("json")), s(n, "ARRAY_CONSTRUCTORS", /* @__PURE__ */ new Map([
|
|
838
|
+
[n.UINT8.toString(), Uint8Array],
|
|
839
|
+
[n.UINT16.toString(), Uint16Array],
|
|
840
|
+
[n.UINT32.toString(), Uint32Array],
|
|
841
|
+
[n.UINT64.toString(), BigUint64Array],
|
|
842
|
+
[n.FLOAT32.toString(), Float32Array],
|
|
843
|
+
[n.FLOAT64.toString(), Float64Array],
|
|
844
|
+
[n.INT8.toString(), Int8Array],
|
|
845
|
+
[n.INT16.toString(), Int16Array],
|
|
846
|
+
[n.INT32.toString(), Int32Array],
|
|
847
|
+
[n.INT64.toString(), BigInt64Array],
|
|
848
|
+
[n.TIMESTAMP.toString(), BigInt64Array],
|
|
849
|
+
[n.STRING.toString(), Uint8Array],
|
|
850
|
+
[n.JSON.toString(), Uint8Array],
|
|
851
|
+
[n.UUID.toString(), Uint8Array]
|
|
852
|
+
])), s(n, "ARRAY_CONSTRUCTOR_DATA_TYPES", /* @__PURE__ */ new Map([
|
|
853
|
+
[Uint8Array.name, n.UINT8],
|
|
854
|
+
[Uint16Array.name, n.UINT16],
|
|
855
|
+
[Uint32Array.name, n.UINT32],
|
|
856
|
+
[BigUint64Array.name, n.UINT64],
|
|
857
|
+
[Float32Array.name, n.FLOAT32],
|
|
858
|
+
[Float64Array.name, n.FLOAT64],
|
|
859
|
+
[Int8Array.name, n.INT8],
|
|
860
|
+
[Int16Array.name, n.INT16],
|
|
861
|
+
[Int32Array.name, n.INT32],
|
|
862
|
+
[BigInt64Array.name, n.INT64]
|
|
863
|
+
])), s(n, "DENSITIES", /* @__PURE__ */ new Map([
|
|
864
|
+
[n.UINT8.toString(), I.BIT8],
|
|
865
|
+
[n.UINT16.toString(), I.BIT16],
|
|
866
|
+
[n.UINT32.toString(), I.BIT32],
|
|
867
|
+
[n.UINT64.toString(), I.BIT64],
|
|
868
|
+
[n.FLOAT32.toString(), I.BIT32],
|
|
869
|
+
[n.FLOAT64.toString(), I.BIT64],
|
|
870
|
+
[n.INT8.toString(), I.BIT8],
|
|
871
|
+
[n.INT16.toString(), I.BIT16],
|
|
872
|
+
[n.INT32.toString(), I.BIT32],
|
|
873
|
+
[n.INT64.toString(), I.BIT64],
|
|
874
|
+
[n.TIMESTAMP.toString(), I.BIT64],
|
|
875
|
+
[n.STRING.toString(), I.UNKNOWN],
|
|
876
|
+
[n.JSON.toString(), I.UNKNOWN],
|
|
877
|
+
[n.UUID.toString(), I.BIT128]
|
|
879
878
|
])), /** All the data types. */
|
|
880
|
-
n
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
]), n
|
|
897
|
-
n
|
|
898
|
-
c.string().transform((t) => new
|
|
899
|
-
c.instanceof(
|
|
879
|
+
s(n, "ALL", [
|
|
880
|
+
n.UNKNOWN,
|
|
881
|
+
n.FLOAT64,
|
|
882
|
+
n.FLOAT32,
|
|
883
|
+
n.INT64,
|
|
884
|
+
n.INT32,
|
|
885
|
+
n.INT16,
|
|
886
|
+
n.INT8,
|
|
887
|
+
n.UINT64,
|
|
888
|
+
n.UINT32,
|
|
889
|
+
n.UINT16,
|
|
890
|
+
n.UINT8,
|
|
891
|
+
n.TIMESTAMP,
|
|
892
|
+
n.UUID,
|
|
893
|
+
n.STRING,
|
|
894
|
+
n.JSON
|
|
895
|
+
]), s(n, "BIG_INT_TYPES", [n.INT64, n.UINT64, n.TIMESTAMP]), /** A zod schema for a DataType. */
|
|
896
|
+
s(n, "z", c.union([
|
|
897
|
+
c.string().transform((t) => new n(t)),
|
|
898
|
+
c.instanceof(n)
|
|
900
899
|
]));
|
|
901
|
-
let g =
|
|
900
|
+
let g = n;
|
|
902
901
|
const l = class l extends Number {
|
|
903
902
|
constructor(t) {
|
|
904
903
|
super(t.valueOf());
|
|
@@ -990,18 +989,18 @@ const l = class l extends Number {
|
|
|
990
989
|
}
|
|
991
990
|
};
|
|
992
991
|
/** A single byte */
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
992
|
+
s(l, "BYTE", new l(1)), /** A kilobyte */
|
|
993
|
+
s(l, "KILOBYTE", l.kilobytes(1)), /** A megabyte */
|
|
994
|
+
s(l, "MEGABYTE", l.megabytes(1)), /** A gigabyte */
|
|
995
|
+
s(l, "GIGABYTE", l.gigabytes(1)), /** A terabyte. */
|
|
996
|
+
s(l, "TERABYTE", l.terabytes(1)), /** The zero value for Size */
|
|
997
|
+
s(l, "ZERO", new l(0)), /** A zod schema for a Size. */
|
|
998
|
+
s(l, "z", c.union([
|
|
1000
999
|
c.number().transform((t) => new l(t)),
|
|
1001
1000
|
c.instanceof(l)
|
|
1002
1001
|
]));
|
|
1003
1002
|
let C = l;
|
|
1004
|
-
const
|
|
1003
|
+
const wt = c.union([
|
|
1005
1004
|
c.instanceof(Uint8Array),
|
|
1006
1005
|
c.instanceof(Uint16Array),
|
|
1007
1006
|
c.instanceof(Uint32Array),
|
|
@@ -1012,40 +1011,40 @@ const ft = c.union([
|
|
|
1012
1011
|
c.instanceof(Int16Array),
|
|
1013
1012
|
c.instanceof(Int32Array),
|
|
1014
1013
|
c.instanceof(BigInt64Array)
|
|
1015
|
-
]),
|
|
1014
|
+
]), J = (f) => {
|
|
1016
1015
|
const t = typeof f;
|
|
1017
1016
|
return t === "string" || t === "number" || t === "boolean" || t === "bigint" || f instanceof m || f instanceof w || f instanceof Date;
|
|
1018
|
-
},
|
|
1017
|
+
}, Q = (f, t, e, r = 0) => f.usesBigInt && !t.usesBigInt ? Number(e) - Number(r) : !f.usesBigInt && t.usesBigInt ? BigInt(e) - BigInt(r) : R(e, -r), _ = (f) => f == null ? !1 : Array.isArray(f) || f instanceof ArrayBuffer || ArrayBuffer.isView(f) && !(f instanceof DataView) || f instanceof N ? !0 : J(f), E = -1;
|
|
1019
1018
|
class N {
|
|
1020
1019
|
constructor(t) {
|
|
1021
|
-
|
|
1022
|
-
|
|
1020
|
+
s(this, "key", "");
|
|
1021
|
+
s(this, "isSynnaxSeries", !0);
|
|
1023
1022
|
/** The data type of the array */
|
|
1024
|
-
|
|
1023
|
+
s(this, "dataType");
|
|
1025
1024
|
/**
|
|
1026
1025
|
* A sample offset that can be used to shift the values of all samples upwards or
|
|
1027
1026
|
* downwards. Typically used to convert arrays to lower precision while preserving
|
|
1028
1027
|
* the relative range of actual values.
|
|
1029
1028
|
*/
|
|
1030
|
-
|
|
1029
|
+
s(this, "sampleOffset");
|
|
1031
1030
|
/**
|
|
1032
1031
|
* Stores information about the buffer state of this array into a WebGL buffer.
|
|
1033
1032
|
*/
|
|
1034
|
-
|
|
1033
|
+
s(this, "gl");
|
|
1035
1034
|
/** The underlying data. */
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1035
|
+
s(this, "_data");
|
|
1036
|
+
s(this, "_timeRange");
|
|
1037
|
+
s(this, "alignment", 0n);
|
|
1039
1038
|
/** A cached minimum value. */
|
|
1040
|
-
|
|
1039
|
+
s(this, "_cachedMin");
|
|
1041
1040
|
/** A cached maximum value. */
|
|
1042
|
-
|
|
1041
|
+
s(this, "_cachedMax");
|
|
1043
1042
|
/** The write position of the buffer. */
|
|
1044
|
-
|
|
1043
|
+
s(this, "writePos", E);
|
|
1045
1044
|
/** Tracks the number of entities currently using this array. */
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1045
|
+
s(this, "_refCount", 0);
|
|
1046
|
+
s(this, "_cachedLength");
|
|
1047
|
+
_(t) && (t = { data: t });
|
|
1049
1048
|
const {
|
|
1050
1049
|
dataType: e,
|
|
1051
1050
|
timeRange: r,
|
|
@@ -1059,9 +1058,8 @@ class N {
|
|
|
1059
1058
|
this.key = o.key, this.dataType = o.dataType, this.sampleOffset = o.sampleOffset, this.gl = o.gl, this._data = o._data, this._timeRange = o._timeRange, this.alignment = o.alignment, this._cachedMin = o._cachedMin, this._cachedMax = o._cachedMax, this.writePos = o.writePos, this._refCount = o._refCount, this._cachedLength = o._cachedLength;
|
|
1060
1059
|
return;
|
|
1061
1060
|
}
|
|
1062
|
-
const T =
|
|
1063
|
-
if (e != null)
|
|
1064
|
-
this.dataType = new g(e);
|
|
1061
|
+
const T = J(O), p = Array.isArray(O);
|
|
1062
|
+
if (e != null) this.dataType = new g(e);
|
|
1065
1063
|
else {
|
|
1066
1064
|
if (O instanceof ArrayBuffer)
|
|
1067
1065
|
throw new Error(
|
|
@@ -1076,34 +1074,27 @@ class N {
|
|
|
1076
1074
|
);
|
|
1077
1075
|
o = O[0];
|
|
1078
1076
|
}
|
|
1079
|
-
if (typeof o == "string")
|
|
1080
|
-
|
|
1081
|
-
else if (typeof o == "
|
|
1082
|
-
|
|
1083
|
-
else if (typeof o == "bigint")
|
|
1084
|
-
this.dataType = g.INT64;
|
|
1085
|
-
else if (typeof o == "boolean")
|
|
1086
|
-
this.dataType = g.BOOLEAN;
|
|
1077
|
+
if (typeof o == "string") this.dataType = g.STRING;
|
|
1078
|
+
else if (typeof o == "number") this.dataType = g.FLOAT64;
|
|
1079
|
+
else if (typeof o == "bigint") this.dataType = g.INT64;
|
|
1080
|
+
else if (typeof o == "boolean") this.dataType = g.BOOLEAN;
|
|
1087
1081
|
else if (o instanceof m || o instanceof Date || o instanceof m)
|
|
1088
1082
|
this.dataType = g.TIMESTAMP;
|
|
1089
|
-
else if (typeof o == "object")
|
|
1090
|
-
this.dataType = g.JSON;
|
|
1083
|
+
else if (typeof o == "object") this.dataType = g.JSON;
|
|
1091
1084
|
else
|
|
1092
1085
|
throw new Error(
|
|
1093
1086
|
`cannot infer data type of ${typeof o} when constructing a Series from a JS array`
|
|
1094
1087
|
);
|
|
1095
|
-
} else
|
|
1096
|
-
this.dataType = new g(O);
|
|
1088
|
+
} else this.dataType = new g(O);
|
|
1097
1089
|
}
|
|
1098
|
-
if (!p && !T)
|
|
1099
|
-
this._data = O;
|
|
1090
|
+
if (!p && !T) this._data = O;
|
|
1100
1091
|
else {
|
|
1101
1092
|
let o = T ? [O] : O;
|
|
1102
1093
|
const M = o[0];
|
|
1103
1094
|
(M instanceof m || M instanceof Date || M instanceof w) && (o = o.map((B) => new m(B).valueOf())), this.dataType.equals(g.STRING) ? (this._cachedLength = o.length, this._data = new TextEncoder().encode(o.join(`
|
|
1104
1095
|
`) + `
|
|
1105
1096
|
`)) : this.dataType.equals(g.JSON) ? (this._cachedLength = o.length, this._data = new TextEncoder().encode(
|
|
1106
|
-
o.map((B) =>
|
|
1097
|
+
o.map((B) => L.encodeString(B)).join(`
|
|
1107
1098
|
`) + `
|
|
1108
1099
|
`
|
|
1109
1100
|
)) : this._data = new this.dataType.Array(o).buffer;
|
|
@@ -1142,7 +1133,7 @@ class N {
|
|
|
1142
1133
|
}
|
|
1143
1134
|
static fromJSON(t, e) {
|
|
1144
1135
|
const r = new TextEncoder().encode(
|
|
1145
|
-
t.map((u) =>
|
|
1136
|
+
t.map((u) => L.encodeString(u)).join(`
|
|
1146
1137
|
`) + `
|
|
1147
1138
|
`
|
|
1148
1139
|
);
|
|
@@ -1168,8 +1159,7 @@ class N {
|
|
|
1168
1159
|
write(t) {
|
|
1169
1160
|
if (!t.dataType.equals(this.dataType))
|
|
1170
1161
|
throw new Error("buffer must be of the same type as this array");
|
|
1171
|
-
if (this.writePos === E)
|
|
1172
|
-
return 0;
|
|
1162
|
+
if (this.writePos === E) return 0;
|
|
1173
1163
|
const e = this.capacity - this.writePos, r = e < t.length ? t.slice(0, e) : t;
|
|
1174
1164
|
return this.underlyingData.set(
|
|
1175
1165
|
r.data,
|
|
@@ -1207,12 +1197,11 @@ class N {
|
|
|
1207
1197
|
if (!this.dataType.equals(g.JSON))
|
|
1208
1198
|
throw new Error("cannot convert non-string series to strings");
|
|
1209
1199
|
return new TextDecoder().decode(this.buffer).split(`
|
|
1210
|
-
`).slice(0, -1).map((e) => t.parse(L
|
|
1200
|
+
`).slice(0, -1).map((e) => t.parse(L.decodeString(e)));
|
|
1211
1201
|
}
|
|
1212
1202
|
/** @returns the time range of this array. */
|
|
1213
1203
|
get timeRange() {
|
|
1214
|
-
if (this._timeRange == null)
|
|
1215
|
-
throw new Error("time range not set on series");
|
|
1204
|
+
if (this._timeRange == null) throw new Error("time range not set on series");
|
|
1216
1205
|
return this._timeRange;
|
|
1217
1206
|
}
|
|
1218
1207
|
/** @returns the capacity of the series in bytes. */
|
|
@@ -1249,11 +1238,10 @@ class N {
|
|
|
1249
1238
|
* also may be untimely precision issues when converting between data types.
|
|
1250
1239
|
*/
|
|
1251
1240
|
convert(t, e = 0) {
|
|
1252
|
-
if (this.dataType.equals(t))
|
|
1253
|
-
return this;
|
|
1241
|
+
if (this.dataType.equals(t)) return this;
|
|
1254
1242
|
const r = new t.Array(this.length);
|
|
1255
1243
|
for (let u = 0; u < this.length; u++)
|
|
1256
|
-
r[u] =
|
|
1244
|
+
r[u] = Q(this.dataType, t, this.data[u], e);
|
|
1257
1245
|
return new N({
|
|
1258
1246
|
data: r.buffer,
|
|
1259
1247
|
dataType: t,
|
|
@@ -1264,8 +1252,7 @@ class N {
|
|
|
1264
1252
|
});
|
|
1265
1253
|
}
|
|
1266
1254
|
calcRawMax() {
|
|
1267
|
-
if (this.length === 0)
|
|
1268
|
-
return -1 / 0;
|
|
1255
|
+
if (this.length === 0) return -1 / 0;
|
|
1269
1256
|
if (this.dataType.equals(g.TIMESTAMP))
|
|
1270
1257
|
this._cachedMax = this.data[this.data.length - 1];
|
|
1271
1258
|
else if (this.dataType.usesBigInt) {
|
|
@@ -1284,8 +1271,7 @@ class N {
|
|
|
1284
1271
|
return this.writePos === 0 ? -1 / 0 : (this._cachedMax == null && (this._cachedMax = this.calcRawMax()), R(this._cachedMax, this.sampleOffset));
|
|
1285
1272
|
}
|
|
1286
1273
|
calcRawMin() {
|
|
1287
|
-
if (this.length === 0)
|
|
1288
|
-
return 1 / 0;
|
|
1274
|
+
if (this.length === 0) return 1 / 0;
|
|
1289
1275
|
if (this.dataType.equals(g.TIMESTAMP))
|
|
1290
1276
|
this._cachedMin = this.data[0];
|
|
1291
1277
|
else if (this.dataType.usesBigInt) {
|
|
@@ -1324,13 +1310,11 @@ class N {
|
|
|
1324
1310
|
return R(this.max, -this.min);
|
|
1325
1311
|
}
|
|
1326
1312
|
at(t, e) {
|
|
1327
|
-
if (this.dataType.isVariable)
|
|
1328
|
-
return this.atVariable(t, e ?? !1);
|
|
1313
|
+
if (this.dataType.isVariable) return this.atVariable(t, e ?? !1);
|
|
1329
1314
|
t < 0 && (t = this.length + t);
|
|
1330
1315
|
const r = this.data[t];
|
|
1331
1316
|
if (r == null) {
|
|
1332
|
-
if (e === !0)
|
|
1333
|
-
throw new Error(`[series] - no value at index ${t}`);
|
|
1317
|
+
if (e === !0) throw new Error(`[series] - no value at index ${t}`);
|
|
1334
1318
|
return;
|
|
1335
1319
|
}
|
|
1336
1320
|
return R(r, this.sampleOffset);
|
|
@@ -1347,12 +1331,11 @@ class N {
|
|
|
1347
1331
|
r = d + 1, t--;
|
|
1348
1332
|
}
|
|
1349
1333
|
if (u === 0 && (u = this.data.length), r >= u || t > 0) {
|
|
1350
|
-
if (e)
|
|
1351
|
-
throw new Error(`[series] - no value at index ${t}`);
|
|
1334
|
+
if (e) throw new Error(`[series] - no value at index ${t}`);
|
|
1352
1335
|
return;
|
|
1353
1336
|
}
|
|
1354
1337
|
const h = this.data.slice(r, u);
|
|
1355
|
-
return this.dataType.equals(g.STRING) ? new TextDecoder().decode(h) :
|
|
1338
|
+
return this.dataType.equals(g.STRING) ? new TextDecoder().decode(h) : j(
|
|
1356
1339
|
JSON.parse(new TextDecoder().decode(h))
|
|
1357
1340
|
);
|
|
1358
1341
|
}
|
|
@@ -1363,11 +1346,10 @@ class N {
|
|
|
1363
1346
|
*/
|
|
1364
1347
|
binarySearch(t) {
|
|
1365
1348
|
let e = 0, r = this.length - 1;
|
|
1366
|
-
const u =
|
|
1349
|
+
const u = H(t);
|
|
1367
1350
|
for (; e <= r; ) {
|
|
1368
1351
|
const h = Math.floor((e + r) / 2), d = u(this.at(h, !0), t);
|
|
1369
|
-
if (d === 0)
|
|
1370
|
-
return h;
|
|
1352
|
+
if (d === 0) return h;
|
|
1371
1353
|
d < 0 ? e = h + 1 : r = h - 1;
|
|
1372
1354
|
}
|
|
1373
1355
|
return e;
|
|
@@ -1439,20 +1421,18 @@ class N {
|
|
|
1439
1421
|
this.gl.buffer != null && (t.deleteBuffer(this.gl.buffer), this.gl.buffer = null, this.gl.prevBuffer = 0, this.gl.control = null);
|
|
1440
1422
|
}
|
|
1441
1423
|
get glBuffer() {
|
|
1442
|
-
if (this.gl.buffer == null)
|
|
1443
|
-
throw new Error("gl buffer not initialized");
|
|
1424
|
+
if (this.gl.buffer == null) throw new Error("gl buffer not initialized");
|
|
1444
1425
|
return this.gl.prevBuffer !== this.writePos && console.warn("buffer not updated"), this.gl.buffer;
|
|
1445
1426
|
}
|
|
1446
1427
|
[Symbol.iterator]() {
|
|
1447
1428
|
if (this.dataType.isVariable) {
|
|
1448
|
-
const t = new
|
|
1449
|
-
return this.dataType.equals(g.JSON) ? new
|
|
1429
|
+
const t = new tt(this);
|
|
1430
|
+
return this.dataType.equals(g.JSON) ? new et(t) : t;
|
|
1450
1431
|
}
|
|
1451
|
-
return new
|
|
1432
|
+
return new rt(this);
|
|
1452
1433
|
}
|
|
1453
1434
|
slice(t, e) {
|
|
1454
|
-
if (t <= 0 && (e == null || e >= this.length))
|
|
1455
|
-
return this;
|
|
1435
|
+
if (t <= 0 && (e == null || e >= this.length)) return this;
|
|
1456
1436
|
const r = this.data.slice(t, e);
|
|
1457
1437
|
return new N({
|
|
1458
1438
|
data: r,
|
|
@@ -1474,11 +1454,11 @@ class N {
|
|
|
1474
1454
|
});
|
|
1475
1455
|
}
|
|
1476
1456
|
}
|
|
1477
|
-
class
|
|
1457
|
+
class tt {
|
|
1478
1458
|
constructor(t) {
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1459
|
+
s(this, "series");
|
|
1460
|
+
s(this, "index");
|
|
1461
|
+
s(this, "decoder");
|
|
1482
1462
|
if (!t.dataType.isVariable)
|
|
1483
1463
|
throw new Error(
|
|
1484
1464
|
"cannot create a variable series iterator for a non-variable series"
|
|
@@ -1487,8 +1467,7 @@ class W {
|
|
|
1487
1467
|
}
|
|
1488
1468
|
next() {
|
|
1489
1469
|
const t = this.index, e = this.series.data;
|
|
1490
|
-
for (; this.index < e.length && e[this.index] !== 10; )
|
|
1491
|
-
this.index++;
|
|
1470
|
+
for (; this.index < e.length && e[this.index] !== 10; ) this.index++;
|
|
1492
1471
|
const r = this.index;
|
|
1493
1472
|
return t === r ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(t, r)) });
|
|
1494
1473
|
}
|
|
@@ -1496,28 +1475,30 @@ class W {
|
|
|
1496
1475
|
return this;
|
|
1497
1476
|
}
|
|
1498
1477
|
}
|
|
1499
|
-
var
|
|
1500
|
-
class
|
|
1478
|
+
var q, F;
|
|
1479
|
+
class et {
|
|
1501
1480
|
constructor(t) {
|
|
1502
|
-
|
|
1503
|
-
|
|
1481
|
+
s(this, "wrapped");
|
|
1482
|
+
s(this, q, "JSONSeriesIterator");
|
|
1504
1483
|
this.wrapped = t;
|
|
1505
1484
|
}
|
|
1506
1485
|
next() {
|
|
1507
1486
|
const t = this.wrapped.next();
|
|
1508
|
-
return t.done === !0 ? { done: !0, value: void 0 } : {
|
|
1487
|
+
return t.done === !0 ? { done: !0, value: void 0 } : {
|
|
1488
|
+
done: !1,
|
|
1489
|
+
value: L.decodeString(t.value)
|
|
1490
|
+
};
|
|
1509
1491
|
}
|
|
1510
|
-
[Symbol.iterator]() {
|
|
1492
|
+
[(F = Symbol.iterator, q = Symbol.toStringTag, F)]() {
|
|
1511
1493
|
return this;
|
|
1512
1494
|
}
|
|
1513
1495
|
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
class j {
|
|
1496
|
+
var P, Y;
|
|
1497
|
+
class rt {
|
|
1517
1498
|
constructor(t) {
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1499
|
+
s(this, "series");
|
|
1500
|
+
s(this, "index");
|
|
1501
|
+
s(this, P, "SeriesIterator");
|
|
1521
1502
|
this.series = t, this.index = 0;
|
|
1522
1503
|
}
|
|
1523
1504
|
next() {
|
|
@@ -1526,15 +1507,14 @@ class j {
|
|
|
1526
1507
|
value: this.series.at(this.index++, !0)
|
|
1527
1508
|
};
|
|
1528
1509
|
}
|
|
1529
|
-
[Symbol.iterator]() {
|
|
1510
|
+
[(Y = Symbol.iterator, P = Symbol.toStringTag, Y)]() {
|
|
1530
1511
|
return this;
|
|
1531
1512
|
}
|
|
1532
1513
|
}
|
|
1533
|
-
z = Symbol.toStringTag;
|
|
1534
1514
|
const R = (f, t) => typeof f == "bigint" && typeof t == "bigint" || typeof f == "number" && typeof t == "number" ? f + t : t === 0 ? f : f === 0 ? t : Number(f) + Number(t);
|
|
1535
|
-
class
|
|
1515
|
+
class yt {
|
|
1536
1516
|
constructor(t) {
|
|
1537
|
-
|
|
1517
|
+
s(this, "series");
|
|
1538
1518
|
if (t.length !== 0) {
|
|
1539
1519
|
const e = t[0].dataType;
|
|
1540
1520
|
for (let r = 1; r < t.length; r++)
|
|
@@ -1568,12 +1548,10 @@ class lt {
|
|
|
1568
1548
|
at(t, e = !1) {
|
|
1569
1549
|
t < 0 && (t = this.length + t);
|
|
1570
1550
|
for (const r of this.series) {
|
|
1571
|
-
if (t < r.length)
|
|
1572
|
-
return r.at(t, e);
|
|
1551
|
+
if (t < r.length) return r.at(t, e);
|
|
1573
1552
|
t -= r.length;
|
|
1574
1553
|
}
|
|
1575
|
-
if (e)
|
|
1576
|
-
throw new Error(`[series] - no value at index ${t}`);
|
|
1554
|
+
if (e) throw new Error(`[series] - no value at index ${t}`);
|
|
1577
1555
|
}
|
|
1578
1556
|
get byteLength() {
|
|
1579
1557
|
return new C(this.series.reduce((t, e) => t + e.byteLength.valueOf(), 0));
|
|
@@ -1590,31 +1568,30 @@ class lt {
|
|
|
1590
1568
|
next() {
|
|
1591
1569
|
return { done: !0, value: void 0 };
|
|
1592
1570
|
}
|
|
1593
|
-
} : new
|
|
1571
|
+
} : new nt(this.series);
|
|
1594
1572
|
}
|
|
1595
1573
|
}
|
|
1596
|
-
var
|
|
1597
|
-
class
|
|
1574
|
+
var G, V;
|
|
1575
|
+
class nt {
|
|
1598
1576
|
constructor(t) {
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1577
|
+
s(this, "series");
|
|
1578
|
+
s(this, "seriesIndex");
|
|
1579
|
+
s(this, "internal");
|
|
1580
|
+
s(this, G, "MultiSeriesIterator");
|
|
1603
1581
|
this.series = t, this.seriesIndex = 0, this.internal = t[0][Symbol.iterator]();
|
|
1604
1582
|
}
|
|
1605
1583
|
next() {
|
|
1606
1584
|
const t = this.internal.next();
|
|
1607
1585
|
return t.done === !1 ? t : this.seriesIndex === this.series.length - 1 ? { done: !0, value: void 0 } : (this.internal = this.series[++this.seriesIndex][Symbol.iterator](), this.next());
|
|
1608
1586
|
}
|
|
1609
|
-
[Symbol.iterator]() {
|
|
1587
|
+
[(V = Symbol.iterator, G = Symbol.toStringTag, V)]() {
|
|
1610
1588
|
return this;
|
|
1611
1589
|
}
|
|
1612
1590
|
}
|
|
1613
|
-
Q = Symbol.toStringTag;
|
|
1614
1591
|
export {
|
|
1615
1592
|
I as D,
|
|
1616
|
-
|
|
1617
|
-
|
|
1593
|
+
yt as M,
|
|
1594
|
+
$ as R,
|
|
1618
1595
|
N as S,
|
|
1619
1596
|
m as T,
|
|
1620
1597
|
R as a,
|
|
@@ -1622,8 +1599,9 @@ export {
|
|
|
1622
1599
|
U as c,
|
|
1623
1600
|
g as d,
|
|
1624
1601
|
C as e,
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1602
|
+
J as f,
|
|
1603
|
+
Q as g,
|
|
1604
|
+
mt as h,
|
|
1605
|
+
_ as i,
|
|
1606
|
+
wt as t
|
|
1629
1607
|
};
|