@milaboratories/pl-model-common 1.13.0 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drivers/pframe/data_types.d.ts.map +1 -1
- package/dist/drivers/pframe/table_calculate.d.ts +25 -1
- package/dist/drivers/pframe/table_calculate.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +151 -141
- package/dist/index.mjs.map +1 -1
- package/dist/pool/spec.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/drivers/pframe/data_types.ts +4 -5
- package/src/drivers/pframe/table_calculate.ts +39 -0
- package/src/pool/spec.ts +3 -0
package/dist/index.mjs
CHANGED
|
@@ -2,8 +2,8 @@ var $ = Object.defineProperty;
|
|
|
2
2
|
var L = (n, t, e) => t in n ? $(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
3
|
var p = (n, t, e) => L(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import g from "canonicalize";
|
|
5
|
-
import { z as
|
|
6
|
-
function
|
|
5
|
+
import { z as m } from "zod";
|
|
6
|
+
function cn(n) {
|
|
7
7
|
return n !== void 0 && n.startsWith("log+live://log/");
|
|
8
8
|
}
|
|
9
9
|
function w(n) {
|
|
@@ -16,7 +16,7 @@ function V(n) {
|
|
|
16
16
|
function D(n) {
|
|
17
17
|
return n.startsWith(E);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function I(n) {
|
|
20
20
|
if (D(n)) {
|
|
21
21
|
const t = n.slice(E.length);
|
|
22
22
|
return JSON.parse(decodeURIComponent(t)).path;
|
|
@@ -26,13 +26,13 @@ function j(n) {
|
|
|
26
26
|
}
|
|
27
27
|
w(n);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function j(n) {
|
|
30
30
|
return n.replace(/^.*[\\/]/, "");
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function fn(n) {
|
|
33
|
+
return j(I(n));
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function dn(n) {
|
|
36
36
|
if (!n || typeof n != "object")
|
|
37
37
|
return !1;
|
|
38
38
|
const t = n;
|
|
@@ -49,7 +49,7 @@ function yn(n) {
|
|
|
49
49
|
return !1;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function pn(n, t) {
|
|
53
53
|
if (n !== void 0)
|
|
54
54
|
switch (n.type) {
|
|
55
55
|
case "Json":
|
|
@@ -77,7 +77,7 @@ function mn(n, t) {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function mn(n) {
|
|
81
81
|
if (!n || typeof n != "object")
|
|
82
82
|
return !1;
|
|
83
83
|
const t = n;
|
|
@@ -94,7 +94,7 @@ function ln(n) {
|
|
|
94
94
|
return !1;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function yn(n) {
|
|
98
98
|
switch (n.type) {
|
|
99
99
|
case "Json": {
|
|
100
100
|
const t = Object.entries(n.data).map(([e, r]) => ({ key: JSON.parse(e), value: r }));
|
|
@@ -122,7 +122,7 @@ function hn(n) {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function ln(n) {
|
|
126
126
|
switch (n.type) {
|
|
127
127
|
case "Json": {
|
|
128
128
|
const t = {};
|
|
@@ -156,7 +156,7 @@ function bn(n) {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function hn(n, t) {
|
|
160
160
|
if (n !== void 0)
|
|
161
161
|
switch (n.type) {
|
|
162
162
|
case "Json":
|
|
@@ -186,30 +186,30 @@ function gn(n, t) {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
const
|
|
189
|
+
const B = -2147483648, A = -9007199254740991n, bn = NaN, gn = NaN, F = null, U = null;
|
|
190
190
|
function h(n, t) {
|
|
191
191
|
switch (t) {
|
|
192
192
|
case "Int":
|
|
193
|
-
return n ===
|
|
193
|
+
return n === B;
|
|
194
194
|
case "Long":
|
|
195
195
|
return n === Number(A) || n === A;
|
|
196
196
|
case "Float":
|
|
197
|
-
return n
|
|
197
|
+
return Number.isNaN(n);
|
|
198
198
|
case "Double":
|
|
199
|
-
return n
|
|
199
|
+
return Number.isNaN(n);
|
|
200
200
|
case "String":
|
|
201
|
-
return n ===
|
|
201
|
+
return n === F;
|
|
202
202
|
case "Bytes":
|
|
203
|
-
return n ===
|
|
203
|
+
return n === U;
|
|
204
204
|
default:
|
|
205
205
|
throw Error(`unsupported data type: ${t}`);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
function wn(n) {
|
|
209
|
-
if (!
|
|
209
|
+
if (!K(n)) throw new Error(`Expected not-NA PValue, got ${n}`);
|
|
210
210
|
return n;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function K(n, t) {
|
|
213
213
|
if (!t)
|
|
214
214
|
return typeof n == "string" || typeof n == "number" && isFinite(n) || typeof n == "bigint";
|
|
215
215
|
if (h(n, t)) return !1;
|
|
@@ -230,7 +230,7 @@ function M(n, t) {
|
|
|
230
230
|
throw Error(`unsupported data type: ${t}`);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function R(n, t) {
|
|
234
234
|
if (!t)
|
|
235
235
|
return n === null || typeof n == "string" || typeof n == "number" || typeof n == "bigint";
|
|
236
236
|
if (h(n, t)) return !0;
|
|
@@ -256,9 +256,9 @@ function An(n) {
|
|
|
256
256
|
if (typeof n == "bigint") return { bigint: n.toString() };
|
|
257
257
|
throw new Error(`Type ${typeof n} (value ${n}) not yet supported.`);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function M(n, t) {
|
|
260
260
|
if (n === null || typeof n == "string" || typeof n == "number" || typeof n == "bigint") {
|
|
261
|
-
if (t && !h(n, t) && !
|
|
261
|
+
if (t && !h(n, t) && !R(n, t))
|
|
262
262
|
throw new Error(`Unexpected value type, got ${typeof n}, expected ${t}`);
|
|
263
263
|
return n;
|
|
264
264
|
}
|
|
@@ -270,11 +270,11 @@ function v(n, t) {
|
|
|
270
270
|
throw new Error(`Unsupported type ${typeof n} (value ${n}).`);
|
|
271
271
|
}
|
|
272
272
|
function Pn(n) {
|
|
273
|
-
if (n =
|
|
273
|
+
if (n = _(n), n === null) throw new Error("Value is null");
|
|
274
274
|
return n;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
if (n =
|
|
276
|
+
function _(n) {
|
|
277
|
+
if (n = M(n), n === null) return null;
|
|
278
278
|
if (typeof n == "string") return n;
|
|
279
279
|
if (typeof n == "number") {
|
|
280
280
|
if (!isFinite(n)) throw new Error(`Value is not finite (${n})`);
|
|
@@ -284,19 +284,19 @@ function H(n) {
|
|
|
284
284
|
return Number(n);
|
|
285
285
|
throw new Error(`Unexpected value type: ${typeof n}`);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function v(n, t) {
|
|
288
288
|
const e = Math.floor(t / 8), r = 1 << 7 - t % 8;
|
|
289
289
|
return (n[e] & r) > 0;
|
|
290
290
|
}
|
|
291
|
-
const
|
|
291
|
+
const H = { type: "absent" }, T = null;
|
|
292
292
|
function xn(n) {
|
|
293
293
|
return typeof n == "object" && n !== null && n.type === "absent";
|
|
294
294
|
}
|
|
295
295
|
function kn(n, t, e = {}) {
|
|
296
|
-
if (
|
|
297
|
-
return e.absent === void 0 ?
|
|
296
|
+
if (v(n.absent, t))
|
|
297
|
+
return e.absent === void 0 ? H : e.absent;
|
|
298
298
|
const r = n.data[t], o = n.type;
|
|
299
|
-
if (h(r, o)) return e.na === void 0 ?
|
|
299
|
+
if (h(r, o)) return e.na === void 0 ? T : e.na;
|
|
300
300
|
switch (o) {
|
|
301
301
|
case "Int":
|
|
302
302
|
return r;
|
|
@@ -314,25 +314,25 @@ function kn(n, t, e = {}) {
|
|
|
314
314
|
throw Error(`unsupported data type: ${o}`);
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function y(n) {
|
|
318
318
|
const { type: t, name: e, domain: r } = n;
|
|
319
319
|
return { type: t, name: e, ...r && { domain: r } };
|
|
320
320
|
}
|
|
321
321
|
function Nn(n) {
|
|
322
|
-
return n.map(
|
|
322
|
+
return n.map(y);
|
|
323
323
|
}
|
|
324
324
|
function Sn(n) {
|
|
325
|
-
return g(
|
|
325
|
+
return g(y(n));
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function W(n, t) {
|
|
328
328
|
if (n === void 0) return t === void 0;
|
|
329
329
|
if (t === void 0) return !0;
|
|
330
330
|
for (const e in t)
|
|
331
331
|
if (n[e] !== t[e]) return !1;
|
|
332
332
|
return !0;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
return n.name === t.name &&
|
|
334
|
+
function X(n, t) {
|
|
335
|
+
return n.name === t.name && W(n.domain, t.domain);
|
|
336
336
|
}
|
|
337
337
|
function En(n, t) {
|
|
338
338
|
return { ...n, src: l(n.src, t) };
|
|
@@ -344,6 +344,13 @@ function l(n, t) {
|
|
|
344
344
|
type: "column",
|
|
345
345
|
column: t(n.column)
|
|
346
346
|
};
|
|
347
|
+
case "slicedColumn":
|
|
348
|
+
return {
|
|
349
|
+
type: "slicedColumn",
|
|
350
|
+
column: t(n.column),
|
|
351
|
+
newId: n.newId,
|
|
352
|
+
axisFilters: n.axisFilters
|
|
353
|
+
};
|
|
347
354
|
case "inner":
|
|
348
355
|
case "full":
|
|
349
356
|
return {
|
|
@@ -360,14 +367,14 @@ function l(n, t) {
|
|
|
360
367
|
w(n);
|
|
361
368
|
}
|
|
362
369
|
}
|
|
363
|
-
function
|
|
370
|
+
function z(n) {
|
|
364
371
|
return g(n);
|
|
365
372
|
}
|
|
366
373
|
function Cn(n) {
|
|
367
374
|
return JSON.parse(n);
|
|
368
375
|
}
|
|
369
376
|
function P(n) {
|
|
370
|
-
return g(
|
|
377
|
+
return g(y(n));
|
|
371
378
|
}
|
|
372
379
|
function x(n, t) {
|
|
373
380
|
return JSON.stringify([n, t]);
|
|
@@ -394,15 +401,15 @@ class On {
|
|
|
394
401
|
e.sort((r, o) => r[0].localeCompare(o[0]));
|
|
395
402
|
for (const [r, o] of e) {
|
|
396
403
|
for (let i = 0; i < o.axesSpec.length; i++) {
|
|
397
|
-
const
|
|
398
|
-
this.axes.set(
|
|
404
|
+
const a = o.axesSpec[i], s = P(a);
|
|
405
|
+
this.axes.set(s, { anchor: r, idx: i });
|
|
399
406
|
}
|
|
400
407
|
if (o.domain !== void 0) {
|
|
401
408
|
const i = Object.entries(o.domain);
|
|
402
|
-
i.sort((
|
|
403
|
-
for (const [
|
|
404
|
-
const
|
|
405
|
-
this.domains.set(
|
|
409
|
+
i.sort((a, s) => a[0].localeCompare(s[0])), this.domainPackToAnchor.set(JSON.stringify(i), r), this.domainPacks.push(i.map(([a]) => a));
|
|
410
|
+
for (const [a, s] of i) {
|
|
411
|
+
const u = x(a, s);
|
|
412
|
+
this.domains.set(u, r);
|
|
406
413
|
}
|
|
407
414
|
}
|
|
408
415
|
}
|
|
@@ -418,47 +425,47 @@ class On {
|
|
|
418
425
|
let o;
|
|
419
426
|
if (t.domain !== void 0)
|
|
420
427
|
n:
|
|
421
|
-
for (const
|
|
422
|
-
const
|
|
423
|
-
for (const
|
|
424
|
-
const d = t.domain[
|
|
428
|
+
for (const a of this.domainPacks) {
|
|
429
|
+
const s = [];
|
|
430
|
+
for (const c of a) {
|
|
431
|
+
const d = t.domain[c];
|
|
425
432
|
if (d !== void 0)
|
|
426
|
-
|
|
433
|
+
s.push([c, d]);
|
|
427
434
|
else
|
|
428
435
|
break n;
|
|
429
436
|
}
|
|
430
|
-
const
|
|
431
|
-
if (
|
|
432
|
-
r.domainAnchor =
|
|
437
|
+
const u = this.domainPackToAnchor.get(JSON.stringify(s));
|
|
438
|
+
if (u !== void 0) {
|
|
439
|
+
r.domainAnchor = u, o = new Set(a);
|
|
433
440
|
break;
|
|
434
441
|
}
|
|
435
442
|
}
|
|
436
|
-
for (const [
|
|
437
|
-
if (o !== void 0 && o.has(
|
|
443
|
+
for (const [a, s] of Object.entries(t.domain ?? {})) {
|
|
444
|
+
if (o !== void 0 && o.has(a))
|
|
438
445
|
continue;
|
|
439
|
-
const
|
|
440
|
-
r.domain ?? (r.domain = {}), r.domain[
|
|
446
|
+
const u = x(a, s), c = this.domains.get(u);
|
|
447
|
+
r.domain ?? (r.domain = {}), r.domain[a] = c ? { anchor: c } : s;
|
|
441
448
|
}
|
|
442
|
-
if (r.axes = t.axesSpec.map((
|
|
443
|
-
const
|
|
444
|
-
return this.axes.get(
|
|
449
|
+
if (r.axes = t.axesSpec.map((a) => {
|
|
450
|
+
const s = P(a);
|
|
451
|
+
return this.axes.get(s) ?? a;
|
|
445
452
|
}), !e || e.length === 0)
|
|
446
453
|
return r;
|
|
447
454
|
const i = [];
|
|
448
|
-
for (const
|
|
449
|
-
const [
|
|
450
|
-
if (typeof
|
|
451
|
-
if (
|
|
452
|
-
throw new Error(`Axis index ${
|
|
453
|
-
i.push([
|
|
455
|
+
for (const a of e) {
|
|
456
|
+
const [s, u] = a;
|
|
457
|
+
if (typeof s == "number") {
|
|
458
|
+
if (s < 0 || s >= t.axesSpec.length)
|
|
459
|
+
throw new Error(`Axis index ${s} is out of bounds (0-${t.axesSpec.length - 1})`);
|
|
460
|
+
i.push([s, u]);
|
|
454
461
|
} else {
|
|
455
|
-
const
|
|
456
|
-
if (
|
|
457
|
-
throw new Error(`Axis with name "${
|
|
458
|
-
i.push([
|
|
462
|
+
const c = t.axesSpec.findIndex((d) => d.name === s);
|
|
463
|
+
if (c === -1)
|
|
464
|
+
throw new Error(`Axis with name "${s}" not found in the column specification`);
|
|
465
|
+
i.push([c, u]);
|
|
459
466
|
}
|
|
460
467
|
}
|
|
461
|
-
return i.sort((
|
|
468
|
+
return i.sort((a, s) => a[0] - s[0]), {
|
|
462
469
|
source: r,
|
|
463
470
|
axisFilters: i
|
|
464
471
|
};
|
|
@@ -470,7 +477,7 @@ class On {
|
|
|
470
477
|
* @returns A canonicalized string representation of the anchored column identifier
|
|
471
478
|
*/
|
|
472
479
|
deriveS(t, e) {
|
|
473
|
-
return
|
|
480
|
+
return z(this.derive(t, e));
|
|
474
481
|
}
|
|
475
482
|
}
|
|
476
483
|
function Jn(n, t) {
|
|
@@ -488,19 +495,19 @@ function Jn(n, t) {
|
|
|
488
495
|
if (typeof i == "string")
|
|
489
496
|
r[o] = i;
|
|
490
497
|
else {
|
|
491
|
-
const
|
|
492
|
-
if (!
|
|
498
|
+
const a = n[i.anchor];
|
|
499
|
+
if (!a)
|
|
493
500
|
throw new Error(`Anchor "${i.anchor}" not found for domain key "${o}"`);
|
|
494
|
-
if (!
|
|
501
|
+
if (!a.domain || a.domain[o] === void 0)
|
|
495
502
|
throw new Error(`Domain key "${o}" not found in anchor "${i.anchor}"`);
|
|
496
|
-
r[o] =
|
|
503
|
+
r[o] = a.domain[o];
|
|
497
504
|
}
|
|
498
505
|
e.domain = r;
|
|
499
506
|
}
|
|
500
|
-
return e.axes && (e.axes = e.axes.map((r) =>
|
|
507
|
+
return e.axes && (e.axes = e.axes.map((r) => G(n, r))), e;
|
|
501
508
|
}
|
|
502
|
-
function
|
|
503
|
-
if (!
|
|
509
|
+
function G(n, t) {
|
|
510
|
+
if (!Q(t))
|
|
504
511
|
return t;
|
|
505
512
|
const e = t.anchor, r = n[e];
|
|
506
513
|
if (!r)
|
|
@@ -517,7 +524,7 @@ function Y(n, t) {
|
|
|
517
524
|
throw new Error(`Axis with name "${t.name}" not found in anchor "${e}"`);
|
|
518
525
|
return o[0];
|
|
519
526
|
} else if ("id" in t) {
|
|
520
|
-
const o = r.axesSpec.filter((i) =>
|
|
527
|
+
const o = r.axesSpec.filter((i) => X(t.id, y(i)));
|
|
521
528
|
if (o.length > 1)
|
|
522
529
|
throw new Error(`Multiple matching axes found for matcher in anchor "${e}"`);
|
|
523
530
|
if (o.length === 0)
|
|
@@ -526,7 +533,7 @@ function Y(n, t) {
|
|
|
526
533
|
}
|
|
527
534
|
throw new Error("Unsupported axis reference type");
|
|
528
535
|
}
|
|
529
|
-
function
|
|
536
|
+
function Q(n) {
|
|
530
537
|
return typeof n == "object" && "anchor" in n;
|
|
531
538
|
}
|
|
532
539
|
function $n(n) {
|
|
@@ -535,7 +542,7 @@ function $n(n) {
|
|
|
535
542
|
function f(n) {
|
|
536
543
|
return n.kind === "PColumn";
|
|
537
544
|
}
|
|
538
|
-
function
|
|
545
|
+
function Y(n) {
|
|
539
546
|
return f(n.spec);
|
|
540
547
|
}
|
|
541
548
|
function Ln(n) {
|
|
@@ -545,21 +552,24 @@ function Vn(n) {
|
|
|
545
552
|
return f(n.obj.spec);
|
|
546
553
|
}
|
|
547
554
|
function Dn(n) {
|
|
548
|
-
if (!
|
|
555
|
+
if (!Y(n)) throw new Error(`not a PColumn (kind = ${n.spec.kind})`);
|
|
549
556
|
return n;
|
|
550
557
|
}
|
|
551
|
-
function
|
|
558
|
+
function In(n, t) {
|
|
552
559
|
return n === void 0 ? void 0 : {
|
|
553
560
|
...n,
|
|
554
561
|
data: t(n.data)
|
|
555
562
|
};
|
|
556
563
|
}
|
|
557
|
-
function
|
|
564
|
+
function jn(n) {
|
|
558
565
|
const t = /* @__PURE__ */ new Map(), e = (r) => {
|
|
559
566
|
switch (r.type) {
|
|
560
567
|
case "column":
|
|
561
568
|
t.set(r.column.id, r.column);
|
|
562
569
|
return;
|
|
570
|
+
case "slicedColumn":
|
|
571
|
+
t.set(r.column.id, r.column);
|
|
572
|
+
return;
|
|
563
573
|
case "full":
|
|
564
574
|
case "inner":
|
|
565
575
|
for (const o of r.entries) e(o);
|
|
@@ -574,7 +584,7 @@ function Bn(n) {
|
|
|
574
584
|
};
|
|
575
585
|
return e(n), [...t.values()];
|
|
576
586
|
}
|
|
577
|
-
function
|
|
587
|
+
function Z(n) {
|
|
578
588
|
throw new Error("Unexpected object: " + n);
|
|
579
589
|
}
|
|
580
590
|
function b(n, t) {
|
|
@@ -606,7 +616,7 @@ function b(n, t) {
|
|
|
606
616
|
)
|
|
607
617
|
);
|
|
608
618
|
default:
|
|
609
|
-
|
|
619
|
+
Z(n);
|
|
610
620
|
}
|
|
611
621
|
}
|
|
612
622
|
function k(n, t) {
|
|
@@ -644,7 +654,7 @@ function N(n, t) {
|
|
|
644
654
|
return !1;
|
|
645
655
|
}
|
|
646
656
|
if (t.axes !== void 0) {
|
|
647
|
-
const e = n.axesSpec.map(
|
|
657
|
+
const e = n.axesSpec.map(y);
|
|
648
658
|
if (t.partialAxesMatch) {
|
|
649
659
|
for (const r of t.axes)
|
|
650
660
|
if (!e.some((o) => k(r, o)))
|
|
@@ -673,13 +683,13 @@ function N(n, t) {
|
|
|
673
683
|
}
|
|
674
684
|
return !0;
|
|
675
685
|
}
|
|
676
|
-
function
|
|
686
|
+
function Bn(n) {
|
|
677
687
|
return Array.isArray(n) ? (t) => n.some((e) => f(t) && N(t, e)) : (t) => f(t) && N(t, n);
|
|
678
688
|
}
|
|
679
|
-
const Fn = { href: "/" }, Un =
|
|
680
|
-
__isRef:
|
|
681
|
-
blockId:
|
|
682
|
-
name:
|
|
689
|
+
const Fn = { href: "/" }, Un = m.object({
|
|
690
|
+
__isRef: m.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
691
|
+
blockId: m.string().describe("Upstream block id"),
|
|
692
|
+
name: m.string().describe("Name of the output provided to the upstream block's output context")
|
|
683
693
|
}).describe(
|
|
684
694
|
"Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
|
|
685
695
|
).strict().readonly();
|
|
@@ -692,7 +702,7 @@ function Rn(n, t) {
|
|
|
692
702
|
function Mn(n, t) {
|
|
693
703
|
return n.ok ? { ok: !0, value: t(n.value) } : n;
|
|
694
704
|
}
|
|
695
|
-
function
|
|
705
|
+
function q(n) {
|
|
696
706
|
if (n instanceof Int8Array || n instanceof Uint8Array || n instanceof Uint8ClampedArray)
|
|
697
707
|
return new DataView(n.buffer, n.byteOffset, n.byteLength);
|
|
698
708
|
if (n instanceof ArrayBuffer) return new DataView(n);
|
|
@@ -700,109 +710,109 @@ function tn(n) {
|
|
|
700
710
|
"Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray"
|
|
701
711
|
);
|
|
702
712
|
}
|
|
703
|
-
const
|
|
713
|
+
const nn = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", tn = "0123456789ABCDEFGHIJKLMNOPQRSTUV", en = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
704
714
|
function C(n, t, e) {
|
|
705
715
|
e = e || {};
|
|
706
716
|
let r, o;
|
|
707
717
|
switch (t) {
|
|
708
718
|
case "RFC3548":
|
|
709
719
|
case "RFC4648":
|
|
710
|
-
r =
|
|
720
|
+
r = nn, o = !0;
|
|
711
721
|
break;
|
|
712
722
|
case "RFC4648-HEX":
|
|
713
|
-
r =
|
|
723
|
+
r = tn, o = !0;
|
|
714
724
|
break;
|
|
715
725
|
case "Crockford":
|
|
716
|
-
r =
|
|
726
|
+
r = en, o = !1;
|
|
717
727
|
break;
|
|
718
728
|
default:
|
|
719
729
|
throw new Error("Unknown base32 variant: " + String(t));
|
|
720
730
|
}
|
|
721
|
-
const i = e.padding !== void 0 ? e.padding : o,
|
|
722
|
-
let
|
|
723
|
-
for (let d = 0; d <
|
|
724
|
-
for (
|
|
725
|
-
|
|
726
|
-
if (
|
|
727
|
-
for (;
|
|
728
|
-
|
|
729
|
-
return
|
|
730
|
-
}
|
|
731
|
-
const O = 15,
|
|
731
|
+
const i = e.padding !== void 0 ? e.padding : o, a = q(n);
|
|
732
|
+
let s = 0, u = 0, c = "";
|
|
733
|
+
for (let d = 0; d < a.byteLength; d++)
|
|
734
|
+
for (u = u << 8 | a.getUint8(d), s += 8; s >= 5; )
|
|
735
|
+
c += r[u >>> s - 5 & 31], s -= 5;
|
|
736
|
+
if (s > 0 && (c += r[u << 5 - s & 31]), i)
|
|
737
|
+
for (; c.length % 8 !== 0; )
|
|
738
|
+
c += "=";
|
|
739
|
+
return c;
|
|
740
|
+
}
|
|
741
|
+
const O = 15, rn = 24, J = m.string().length(rn).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
732
742
|
function _n() {
|
|
733
743
|
const n = new Uint8Array(O);
|
|
734
744
|
return crypto.getRandomValues(n), J.parse(C(n, "RFC4648"));
|
|
735
745
|
}
|
|
736
|
-
function
|
|
746
|
+
function on(n) {
|
|
737
747
|
if (n.length !== O) throw new Error(`Wrong number of bytes: ${n.length}`);
|
|
738
748
|
return J.parse(C(n, "RFC4648"));
|
|
739
749
|
}
|
|
740
750
|
async function vn(n) {
|
|
741
751
|
const t = new TextEncoder(), e = await crypto.subtle.digest("SHA-256", t.encode(n));
|
|
742
|
-
return
|
|
752
|
+
return on(new Uint8Array(e.slice(0, 15)));
|
|
743
753
|
}
|
|
744
754
|
export {
|
|
745
755
|
On as AnchoredIdDeriver,
|
|
746
756
|
Fn as DefaultNavigationState,
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
757
|
+
H as PTableAbsent,
|
|
758
|
+
T as PTableNA,
|
|
759
|
+
U as PValueBytesNA,
|
|
760
|
+
gn as PValueDoubleNA,
|
|
761
|
+
bn as PValueFloatNA,
|
|
762
|
+
B as PValueIntNA,
|
|
753
763
|
A as PValueLongNA,
|
|
754
|
-
|
|
764
|
+
F as PValueStringNA,
|
|
755
765
|
J as PlId,
|
|
756
766
|
O as PlIdBytes,
|
|
757
|
-
|
|
767
|
+
rn as PlIdLength,
|
|
758
768
|
Un as PlRef,
|
|
759
769
|
Sn as canonicalizeAxisId,
|
|
760
|
-
|
|
770
|
+
yn as dataInfoToEntries,
|
|
761
771
|
vn as digestPlId,
|
|
762
772
|
wn as ensureNotNAPValue,
|
|
763
773
|
Dn as ensurePColumn,
|
|
764
|
-
|
|
774
|
+
ln as entriesToDataInfo,
|
|
765
775
|
b as executePSpecPredicate,
|
|
766
|
-
|
|
776
|
+
jn as extractAllColumns,
|
|
767
777
|
Nn as getAxesId,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
778
|
+
y as getAxisId,
|
|
779
|
+
fn as getFileNameFromHandle,
|
|
780
|
+
I as getFilePathFromHandle,
|
|
781
|
+
dn as isDataInfo,
|
|
782
|
+
mn as isDataInfoEntries,
|
|
773
783
|
$n as isFilteredPColumn,
|
|
774
784
|
D as isImportFileHandleIndex,
|
|
775
785
|
V as isImportFileHandleUpload,
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
786
|
+
cn as isLiveLog,
|
|
787
|
+
K as isNotNAPValue,
|
|
788
|
+
Y as isPColumn,
|
|
779
789
|
Vn as isPColumnResult,
|
|
780
790
|
f as isPColumnSpec,
|
|
781
791
|
Ln as isPColumnSpecResult,
|
|
782
792
|
xn as isPTableAbsent,
|
|
783
|
-
|
|
793
|
+
R as isPValue,
|
|
784
794
|
Kn as isPlRef,
|
|
785
|
-
|
|
795
|
+
v as isValueAbsent,
|
|
786
796
|
h as isValueNA,
|
|
787
|
-
|
|
788
|
-
|
|
797
|
+
pn as mapDataInfo,
|
|
798
|
+
hn as mapDataInfoEntries,
|
|
789
799
|
l as mapJoinEntry,
|
|
790
|
-
|
|
800
|
+
In as mapPObjectData,
|
|
791
801
|
En as mapPTableDef,
|
|
792
802
|
Mn as mapValueInVOE,
|
|
793
803
|
k as matchAxis,
|
|
794
|
-
|
|
804
|
+
X as matchAxisId,
|
|
795
805
|
N as matchPColumn,
|
|
796
806
|
kn as pTableValue,
|
|
797
807
|
Pn as pValueToStringOrNumber,
|
|
798
|
-
|
|
808
|
+
_ as pValueToStringOrNumberOrNull,
|
|
799
809
|
Cn as parseColumnId,
|
|
800
|
-
|
|
810
|
+
on as plId,
|
|
801
811
|
Rn as plRefsEqual,
|
|
802
812
|
Jn as resolveAnchors,
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
813
|
+
M as safeConvertToPValue,
|
|
814
|
+
Bn as selectorsToPredicate,
|
|
815
|
+
z as stringifyColumnId,
|
|
806
816
|
An as toJsonSafePValue,
|
|
807
817
|
_n as uniquePlId
|
|
808
818
|
};
|