@platforma-sdk/model 1.25.0 → 1.27.6
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/components/PlDataTable.d.ts +4 -4
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +868 -591
- package/dist/index.mjs.map +1 -1
- package/dist/render/api.d.ts +54 -21
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/internal.d.ts +4 -3
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/render/util/axis_filtering.d.ts +14 -0
- package/dist/render/util/axis_filtering.d.ts.map +1 -0
- package/dist/render/util/index.d.ts +1 -0
- package/dist/render/util/index.d.ts.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +11 -1
- package/dist/render/util/pcolumn_data.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/PlDataTable.ts +6 -5
- package/src/render/api.ts +349 -160
- package/src/render/internal.ts +4 -2
- package/src/render/util/axis_filtering.ts +120 -0
- package/src/render/util/index.ts +1 -0
- package/src/render/util/pcolumn_data.ts +191 -12
package/dist/index.mjs
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ie = (t, e, n) => e in t ?
|
|
3
|
-
var
|
|
4
|
-
import { isPColumn as
|
|
1
|
+
var _e = Object.defineProperty;
|
|
2
|
+
var Ie = (t, e, n) => e in t ? _e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var T = (t, e, n) => Ie(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { isPColumn as M, mapPObjectData as ue, selectorsToPredicate as ce, AnchoredIdDeriver as te, isPlRef as Ce, resolveAnchors as Le, isPColumnSpec as J, getAxisId as L, entriesToDataInfo as Te, mapValueInVOE as Fe, ensurePColumn as Re, isDataInfo as me, extractAllColumns as ke, mapPTableDef as De, mapDataInfo as Ee, canonicalizeAxisId as Oe, matchAxisId as G } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
6
|
import { z as E } from "zod";
|
|
7
|
-
class
|
|
7
|
+
class je extends Error {
|
|
8
8
|
constructor(e, n) {
|
|
9
9
|
super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0]), this.errors = e, this.moreErrors = n;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (!t.ok) throw new
|
|
12
|
+
function Ve(t) {
|
|
13
|
+
if (!t.ok) throw new je(t.errors, t.moreErrors);
|
|
14
14
|
return t.value;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function ft(t) {
|
|
17
17
|
return new Proxy(t, {
|
|
18
18
|
get(e, n) {
|
|
19
|
-
return
|
|
19
|
+
return Ve(e[n]);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
function b(t) {
|
|
24
|
-
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ?
|
|
24
|
+
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? Y(t) : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function W(t) {
|
|
27
27
|
return { type: "GetFromCtx", variable: t };
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function ht(t) {
|
|
30
30
|
return {
|
|
31
31
|
type: "Isolate",
|
|
32
32
|
cfg: t
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
35
|
+
const gt = W("$args"), mt = W("$it"), yt = W("$prod"), bt = W("$staging"), vt = W("$ui");
|
|
36
|
+
function Y(t) {
|
|
37
37
|
return { type: "Immediate", value: t };
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ye(t) {
|
|
40
40
|
const e = {};
|
|
41
|
-
for (const [n,
|
|
41
|
+
for (const [n, r] of Object.entries(t)) e[n] = b(r);
|
|
42
42
|
return {
|
|
43
43
|
type: "MakeObject",
|
|
44
44
|
template: e
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function wt(...t) {
|
|
48
48
|
const e = [];
|
|
49
49
|
for (const n of t) e.push(b(n));
|
|
50
50
|
return {
|
|
@@ -52,14 +52,14 @@ function dt(...t) {
|
|
|
52
52
|
template: e
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function X(t, e) {
|
|
56
56
|
return {
|
|
57
57
|
type: "GetJsonField",
|
|
58
58
|
source: b(t),
|
|
59
59
|
field: b(e)
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function xt(t, e, n = "$it") {
|
|
63
63
|
return {
|
|
64
64
|
type: "MapRecordValues",
|
|
65
65
|
source: t,
|
|
@@ -67,7 +67,7 @@ function ft(t, e, n = "$it") {
|
|
|
67
67
|
itVar: n
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function At(t, e, n = "$it") {
|
|
71
71
|
return {
|
|
72
72
|
type: "MapArrayValues",
|
|
73
73
|
source: t,
|
|
@@ -75,46 +75,46 @@ function ht(t, e, n = "$it") {
|
|
|
75
75
|
itVar: n
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function St(t) {
|
|
79
79
|
return {
|
|
80
80
|
type: "Flatten",
|
|
81
81
|
source: t
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Pt(t) {
|
|
85
85
|
return {
|
|
86
86
|
type: "IsEmpty",
|
|
87
87
|
arg: t
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function _t(t) {
|
|
91
91
|
return {
|
|
92
92
|
type: "Not",
|
|
93
93
|
operand: t
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function It(t, e) {
|
|
97
97
|
return {
|
|
98
98
|
type: "And",
|
|
99
99
|
operand1: t,
|
|
100
100
|
operand2: e
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Ct(t, e) {
|
|
104
104
|
return {
|
|
105
105
|
type: "Or",
|
|
106
106
|
operand1: t,
|
|
107
107
|
operand2: e
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Lt(t, e) {
|
|
111
111
|
return {
|
|
112
112
|
type: "GetResourceField",
|
|
113
113
|
source: b(t),
|
|
114
114
|
field: b(e)
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Tt() {
|
|
118
118
|
return function(t) {
|
|
119
119
|
return {
|
|
120
120
|
type: "GetResourceValueAsJson",
|
|
@@ -122,7 +122,7 @@ function At() {
|
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Ft(t, e, n = "$it") {
|
|
126
126
|
return {
|
|
127
127
|
type: "MapResourceFields",
|
|
128
128
|
source: t,
|
|
@@ -130,19 +130,19 @@ function St(t, e, n = "$it") {
|
|
|
130
130
|
itVar: n
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Rt(t) {
|
|
134
134
|
return {
|
|
135
135
|
type: "GetBlobContent",
|
|
136
136
|
source: b(t)
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function kt(t) {
|
|
140
140
|
return {
|
|
141
141
|
type: "GetBlobContentAsString",
|
|
142
142
|
source: b(t)
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Dt() {
|
|
146
146
|
return function(t) {
|
|
147
147
|
return {
|
|
148
148
|
type: "GetBlobContentAsJson",
|
|
@@ -150,93 +150,93 @@ function Pt() {
|
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Et(t) {
|
|
154
154
|
return {
|
|
155
155
|
type: "GetDownloadedBlobContent",
|
|
156
156
|
source: b(t)
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Ot(t) {
|
|
160
160
|
return {
|
|
161
161
|
type: "GetOnDemandBlobContent",
|
|
162
162
|
source: b(t)
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function jt(t, e) {
|
|
166
166
|
return {
|
|
167
167
|
type: "ExtractArchiveAndGetURL",
|
|
168
168
|
format: e,
|
|
169
169
|
source: b(t)
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Vt(t) {
|
|
173
173
|
return {
|
|
174
174
|
type: "GetImportProgress",
|
|
175
175
|
source: b(t)
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function Kt(t, e) {
|
|
179
179
|
return {
|
|
180
180
|
type: "GetLastLogs",
|
|
181
181
|
source: b(t),
|
|
182
182
|
lines: e
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function $t(t, e) {
|
|
186
186
|
return {
|
|
187
187
|
type: "GetProgressLog",
|
|
188
188
|
source: b(t),
|
|
189
189
|
patternToSearch: e
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function Jt(t, e) {
|
|
193
193
|
return {
|
|
194
194
|
type: "GetProgressLogWithInfo",
|
|
195
195
|
source: b(t),
|
|
196
196
|
patternToSearch: e
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Nt(t) {
|
|
200
200
|
return {
|
|
201
201
|
type: "GetLogHandle",
|
|
202
202
|
source: b(t)
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function Ke() {
|
|
206
206
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function be(t) {
|
|
209
209
|
if (t && typeof globalThis.getPlatforma == "function")
|
|
210
210
|
return globalThis.getPlatforma(t);
|
|
211
211
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
212
212
|
throw new Error("Can't get platforma instance.");
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function $e() {
|
|
215
215
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function h() {
|
|
218
218
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
219
219
|
throw new Error("Not in config rendering context");
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
const n =
|
|
221
|
+
function q(t, e) {
|
|
222
|
+
const n = $e();
|
|
223
223
|
if (n === void 0) return !1;
|
|
224
224
|
if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
225
225
|
return n.callbackRegistry[t] = e, !0;
|
|
226
226
|
}
|
|
227
|
-
const
|
|
228
|
-
function
|
|
229
|
-
t in
|
|
230
|
-
for (const
|
|
231
|
-
|
|
232
|
-
},
|
|
227
|
+
const ne = /* @__PURE__ */ new Map();
|
|
228
|
+
function Je(t, e) {
|
|
229
|
+
t in h().callbackRegistry || (h().callbackRegistry[t] = (n) => {
|
|
230
|
+
for (const r of ne.get(t))
|
|
231
|
+
r(n);
|
|
232
|
+
}, ne.set(t, [])), ne.get(t).push(e);
|
|
233
233
|
}
|
|
234
234
|
class S {
|
|
235
|
-
constructor(e, n = (
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
this.handle = e, this.postProcess = n,
|
|
239
|
-
this.resolvedValue = n(
|
|
235
|
+
constructor(e, n = (r) => r) {
|
|
236
|
+
T(this, "isResolved", !1);
|
|
237
|
+
T(this, "resolvedValue");
|
|
238
|
+
this.handle = e, this.postProcess = n, Je(e, (r) => {
|
|
239
|
+
this.resolvedValue = n(r), this.isResolved = !0;
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
map(e) {
|
|
@@ -244,15 +244,15 @@ class S {
|
|
|
244
244
|
}
|
|
245
245
|
mapDefined(e) {
|
|
246
246
|
return new S(this.handle, (n) => {
|
|
247
|
-
const
|
|
248
|
-
return
|
|
247
|
+
const r = this.postProcess(n);
|
|
248
|
+
return r ? e(r) : void 0;
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
251
|
toJSON() {
|
|
252
252
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function ie(t, e) {
|
|
256
256
|
return t === void 0 ? void 0 : e(t);
|
|
257
257
|
}
|
|
258
258
|
class I {
|
|
@@ -261,27 +261,27 @@ class I {
|
|
|
261
261
|
}
|
|
262
262
|
resolve(...e) {
|
|
263
263
|
const n = e.map(
|
|
264
|
-
(
|
|
264
|
+
(r) => ({
|
|
265
265
|
assertFieldType: "Input",
|
|
266
|
-
...typeof
|
|
266
|
+
...typeof r == "string" ? { field: r } : r
|
|
267
267
|
})
|
|
268
268
|
);
|
|
269
269
|
return this.resolveWithCommon({}, ...n);
|
|
270
270
|
}
|
|
271
271
|
resolveOutput(...e) {
|
|
272
272
|
const n = e.map(
|
|
273
|
-
(
|
|
273
|
+
(r) => ({
|
|
274
274
|
assertFieldType: "Output",
|
|
275
|
-
...typeof
|
|
275
|
+
...typeof r == "string" ? { field: r } : r
|
|
276
276
|
})
|
|
277
277
|
);
|
|
278
278
|
return this.resolveWithCommon({}, ...n);
|
|
279
279
|
}
|
|
280
280
|
resolveInput(...e) {
|
|
281
281
|
const n = e.map(
|
|
282
|
-
(
|
|
282
|
+
(r) => ({
|
|
283
283
|
assertFieldType: "Input",
|
|
284
|
-
...typeof
|
|
284
|
+
...typeof r == "string" ? { field: r } : r
|
|
285
285
|
})
|
|
286
286
|
);
|
|
287
287
|
return this.resolveWithCommon({}, ...n);
|
|
@@ -290,51 +290,51 @@ class I {
|
|
|
290
290
|
return this.resolveWithCommon({}, ...e);
|
|
291
291
|
}
|
|
292
292
|
resolveWithCommon(e, ...n) {
|
|
293
|
-
const
|
|
293
|
+
const r = [
|
|
294
294
|
...this.resolvePath,
|
|
295
295
|
...n.map((i) => typeof i == "string" ? i : i.field)
|
|
296
296
|
];
|
|
297
|
-
return
|
|
298
|
-
|
|
299
|
-
(i) => new I(i,
|
|
297
|
+
return ie(
|
|
298
|
+
h().resolveWithCommon(this.handle, e, ...n),
|
|
299
|
+
(i) => new I(i, r)
|
|
300
300
|
);
|
|
301
301
|
}
|
|
302
302
|
get resourceType() {
|
|
303
|
-
return
|
|
303
|
+
return h().getResourceType(this.handle);
|
|
304
304
|
}
|
|
305
305
|
getInputsLocked() {
|
|
306
|
-
return
|
|
306
|
+
return h().getInputsLocked(this.handle);
|
|
307
307
|
}
|
|
308
308
|
getOutputsLocked() {
|
|
309
|
-
return
|
|
309
|
+
return h().getOutputsLocked(this.handle);
|
|
310
310
|
}
|
|
311
311
|
getIsReadyOrError() {
|
|
312
|
-
return
|
|
312
|
+
return h().getIsReadyOrError(this.handle);
|
|
313
313
|
}
|
|
314
314
|
getIsFinal() {
|
|
315
|
-
return
|
|
315
|
+
return h().getIsFinal(this.handle);
|
|
316
316
|
}
|
|
317
317
|
getError() {
|
|
318
318
|
const e = [...this.resolvePath, "error"];
|
|
319
|
-
return
|
|
320
|
-
|
|
319
|
+
return ie(
|
|
320
|
+
h().getError(this.handle),
|
|
321
321
|
(n) => new I(n, e)
|
|
322
322
|
);
|
|
323
323
|
}
|
|
324
324
|
listInputFields() {
|
|
325
|
-
return
|
|
325
|
+
return h().listInputFields(this.handle);
|
|
326
326
|
}
|
|
327
327
|
listOutputFields() {
|
|
328
|
-
return
|
|
328
|
+
return h().listOutputFields(this.handle);
|
|
329
329
|
}
|
|
330
330
|
listDynamicFields() {
|
|
331
|
-
return
|
|
331
|
+
return h().listDynamicFields(this.handle);
|
|
332
332
|
}
|
|
333
333
|
getKeyValueBase64(e) {
|
|
334
|
-
return
|
|
334
|
+
return h().getKeyValueBase64(this.handle, e);
|
|
335
335
|
}
|
|
336
336
|
getKeyValueAsString(e) {
|
|
337
|
-
return
|
|
337
|
+
return h().getKeyValueAsString(this.handle, e);
|
|
338
338
|
}
|
|
339
339
|
getKeyValueAsJson(e) {
|
|
340
340
|
const n = this.getKeyValueAsString(e);
|
|
@@ -342,10 +342,10 @@ class I {
|
|
|
342
342
|
return JSON.parse(n);
|
|
343
343
|
}
|
|
344
344
|
getDataBase64() {
|
|
345
|
-
return
|
|
345
|
+
return h().getDataBase64(this.handle);
|
|
346
346
|
}
|
|
347
347
|
getDataAsString() {
|
|
348
|
-
return
|
|
348
|
+
return h().getDataAsString(this.handle);
|
|
349
349
|
}
|
|
350
350
|
getDataAsJson() {
|
|
351
351
|
const e = this.getDataAsString();
|
|
@@ -356,39 +356,39 @@ class I {
|
|
|
356
356
|
*
|
|
357
357
|
*/
|
|
358
358
|
getPColumns(e = !1, n = "") {
|
|
359
|
-
const
|
|
360
|
-
return
|
|
361
|
-
if (!
|
|
362
|
-
return
|
|
359
|
+
const r = this.parsePObjectCollection(e, n);
|
|
360
|
+
return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
|
|
361
|
+
if (!M(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
|
|
362
|
+
return s;
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
/**
|
|
366
366
|
*
|
|
367
367
|
*/
|
|
368
368
|
parsePObjectCollection(e = !1, n = "") {
|
|
369
|
-
const
|
|
369
|
+
const r = h().parsePObjectCollection(
|
|
370
370
|
this.handle,
|
|
371
371
|
e,
|
|
372
372
|
n,
|
|
373
373
|
...this.resolvePath
|
|
374
374
|
);
|
|
375
|
-
if (
|
|
375
|
+
if (r === void 0) return;
|
|
376
376
|
const i = {};
|
|
377
|
-
for (const [
|
|
378
|
-
const
|
|
379
|
-
i[
|
|
377
|
+
for (const [s, o] of Object.entries(r)) {
|
|
378
|
+
const a = [...this.resolvePath, s];
|
|
379
|
+
i[s] = ue(o, (c) => new I(c, a));
|
|
380
380
|
}
|
|
381
381
|
return i;
|
|
382
382
|
}
|
|
383
383
|
getFileContentAsBase64() {
|
|
384
|
-
return new S(
|
|
384
|
+
return new S(h().getBlobContentAsBase64(this.handle));
|
|
385
385
|
}
|
|
386
386
|
getFileContentAsString() {
|
|
387
|
-
return new S(
|
|
387
|
+
return new S(h().getBlobContentAsString(this.handle));
|
|
388
388
|
}
|
|
389
389
|
getFileContentAsJson() {
|
|
390
390
|
return new S(
|
|
391
|
-
|
|
391
|
+
h().getBlobContentAsString(this.handle)
|
|
392
392
|
).mapDefined((e) => JSON.parse(e));
|
|
393
393
|
}
|
|
394
394
|
/**
|
|
@@ -407,7 +407,7 @@ class I {
|
|
|
407
407
|
* @returns downloaded file handle
|
|
408
408
|
*/
|
|
409
409
|
getFileHandle() {
|
|
410
|
-
return new S(
|
|
410
|
+
return new S(h().getDownloadedBlobContentHandle(this.handle));
|
|
411
411
|
}
|
|
412
412
|
/**
|
|
413
413
|
* @deprecated use getFileHandle
|
|
@@ -419,7 +419,7 @@ class I {
|
|
|
419
419
|
* @returns downloaded file handle
|
|
420
420
|
*/
|
|
421
421
|
getRemoteFileHandle() {
|
|
422
|
-
return new S(
|
|
422
|
+
return new S(h().getOnDemandBlobContentHandle(this.handle));
|
|
423
423
|
}
|
|
424
424
|
/**
|
|
425
425
|
* @deprecated use getRemoteFileHandle
|
|
@@ -431,22 +431,22 @@ class I {
|
|
|
431
431
|
* @returns the url to the extracted folder
|
|
432
432
|
*/
|
|
433
433
|
extractArchiveAndGetURL(e) {
|
|
434
|
-
return new S(
|
|
434
|
+
return new S(h().extractArchiveAndGetURL(this.handle, e));
|
|
435
435
|
}
|
|
436
436
|
getImportProgress() {
|
|
437
|
-
return new S(
|
|
437
|
+
return new S(h().getImportProgress(this.handle));
|
|
438
438
|
}
|
|
439
439
|
getLastLogs(e) {
|
|
440
|
-
return new S(
|
|
440
|
+
return new S(h().getLastLogs(this.handle, e));
|
|
441
441
|
}
|
|
442
442
|
getProgressLog(e) {
|
|
443
|
-
return new S(
|
|
443
|
+
return new S(h().getProgressLog(this.handle, e));
|
|
444
444
|
}
|
|
445
445
|
getProgressLogWithInfo(e) {
|
|
446
|
-
return new S(
|
|
446
|
+
return new S(h().getProgressLogWithInfo(this.handle, e));
|
|
447
447
|
}
|
|
448
448
|
getLogHandle() {
|
|
449
|
-
return new S(
|
|
449
|
+
return new S(h().getLogHandle(this.handle));
|
|
450
450
|
}
|
|
451
451
|
allFieldsResolved(e = "Input") {
|
|
452
452
|
switch (e) {
|
|
@@ -461,243 +461,405 @@ class I {
|
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
mapFields(e, n) {
|
|
464
|
-
const { fieldType:
|
|
464
|
+
const { fieldType: r, requireLocked: i, skipUnresolved: s } = {
|
|
465
465
|
fieldType: "Input",
|
|
466
466
|
requireLocked: !0,
|
|
467
467
|
skipUnresolved: !1,
|
|
468
468
|
...n
|
|
469
469
|
}, o = e;
|
|
470
|
-
if (i && (
|
|
470
|
+
if (i && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
|
|
471
471
|
return;
|
|
472
|
-
let c = (
|
|
473
|
-
(
|
|
472
|
+
let c = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
473
|
+
(l) => [l, this.resolve({ field: l, assertFieldType: r })]
|
|
474
474
|
);
|
|
475
|
-
return
|
|
475
|
+
return s && (c = c.filter((l) => l[1] !== void 0)), c.map(([l, m]) => o(l, m));
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
const
|
|
478
|
+
const ve = "staging", we = "main", Ne = {
|
|
479
|
+
explicitColumnsSupport: !0,
|
|
479
480
|
inlineColumnsSupport: !0,
|
|
480
481
|
activeArgs: !0
|
|
481
482
|
};
|
|
482
|
-
function
|
|
483
|
+
function xe(t) {
|
|
483
484
|
return typeof t == "object" && t !== null && "__awaited_futures__" in t;
|
|
484
485
|
}
|
|
485
|
-
function
|
|
486
|
+
function oe(t, e, n) {
|
|
486
487
|
if (e.has(n)) return;
|
|
487
488
|
if (e.add(n), typeof n === "object")
|
|
488
|
-
if (
|
|
489
|
+
if (xe(n)) n.__awaited_futures__.forEach((i) => t.add(i));
|
|
489
490
|
else if (Array.isArray(n))
|
|
490
|
-
for (const i of n)
|
|
491
|
+
for (const i of n) oe(t, e, i);
|
|
491
492
|
else
|
|
492
493
|
for (const [, i] of Object.entries(n))
|
|
493
|
-
i !== n &&
|
|
494
|
+
i !== n && oe(t, e, i);
|
|
494
495
|
}
|
|
495
|
-
function
|
|
496
|
+
function Be(t) {
|
|
496
497
|
const e = /* @__PURE__ */ new Set();
|
|
497
|
-
return
|
|
498
|
+
return oe(e, /* @__PURE__ */ new Set(), t), e;
|
|
498
499
|
}
|
|
499
|
-
const
|
|
500
|
+
const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
500
501
|
__proto__: null,
|
|
501
|
-
GlobalCfgRenderCtxFeatureFlags:
|
|
502
|
-
MainAccessorName:
|
|
503
|
-
StagingAccessorName:
|
|
504
|
-
getAllFutureAwaits:
|
|
505
|
-
isFutureAwait:
|
|
506
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
502
|
+
GlobalCfgRenderCtxFeatureFlags: Ne,
|
|
503
|
+
MainAccessorName: we,
|
|
504
|
+
StagingAccessorName: ve,
|
|
505
|
+
getAllFutureAwaits: Be,
|
|
506
|
+
isFutureAwait: xe
|
|
507
|
+
}, Symbol.toStringTag, { value: "Module" })), Ue = "pl7.app/label", Me = "pl7.app/trace", Ge = E.object({
|
|
507
508
|
type: E.string(),
|
|
508
509
|
importance: E.number().optional(),
|
|
509
510
|
id: E.string().optional(),
|
|
510
511
|
label: E.string()
|
|
511
|
-
}),
|
|
512
|
-
function
|
|
513
|
-
const
|
|
514
|
-
var
|
|
515
|
-
const
|
|
516
|
-
let d, y,
|
|
517
|
-
"spec" in
|
|
518
|
-
const
|
|
512
|
+
}), We = E.array(Ge), He = 1e-3, qe = "__LABEL__", pe = "__LABEL__@1";
|
|
513
|
+
function de(t, e, n = {}) {
|
|
514
|
+
const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((f) => {
|
|
515
|
+
var R, k;
|
|
516
|
+
const p = e(f);
|
|
517
|
+
let d, y, g;
|
|
518
|
+
"spec" in p && typeof p.spec == "object" ? (d = p.spec, y = p.prefixTrace, g = p.suffixTrace) : d = p;
|
|
519
|
+
const v = (R = d.annotations) == null ? void 0 : R[Ue], w = (k = d.annotations) == null ? void 0 : k[Me], x = (w ? We.safeParse(JSON.parse(w)).data : void 0) ?? [], C = [
|
|
519
520
|
...y ?? [],
|
|
520
|
-
...
|
|
521
|
-
...
|
|
521
|
+
...x,
|
|
522
|
+
...g ?? []
|
|
522
523
|
];
|
|
523
|
-
if (
|
|
524
|
-
const
|
|
525
|
-
n.addLabelAsSuffix ?
|
|
524
|
+
if (v) {
|
|
525
|
+
const A = { label: v, type: qe, importance: -2 };
|
|
526
|
+
n.addLabelAsSuffix ? C.push(A) : C.splice(0, 0, A);
|
|
526
527
|
}
|
|
527
|
-
const
|
|
528
|
-
for (let
|
|
529
|
-
const { type:
|
|
530
|
-
|
|
531
|
-
const
|
|
532
|
-
i.set(
|
|
533
|
-
|
|
528
|
+
const P = [], F = /* @__PURE__ */ new Map();
|
|
529
|
+
for (let A = C.length - 1; A >= 0; --A) {
|
|
530
|
+
const { type: j } = C[A], V = C[A].importance ?? 0, K = (F.get(j) ?? 0) + 1;
|
|
531
|
+
F.set(j, K);
|
|
532
|
+
const $ = `${j}@${K}`;
|
|
533
|
+
i.set($, (i.get($) ?? 0) + 1), r.set(
|
|
534
|
+
$,
|
|
534
535
|
Math.max(
|
|
535
|
-
|
|
536
|
-
|
|
536
|
+
r.get($) ?? Number.NEGATIVE_INFINITY,
|
|
537
|
+
V - (C.length - A) * He
|
|
537
538
|
)
|
|
538
|
-
),
|
|
539
|
+
), P.push({ ...C[A], fullType: $, occurenceIndex: K });
|
|
539
540
|
}
|
|
540
|
-
return
|
|
541
|
-
value:
|
|
541
|
+
return P.reverse(), {
|
|
542
|
+
value: f,
|
|
542
543
|
spec: d,
|
|
543
|
-
label:
|
|
544
|
-
fullTrace:
|
|
544
|
+
label: v,
|
|
545
|
+
fullTrace: P
|
|
545
546
|
};
|
|
546
|
-
}), o = [],
|
|
547
|
-
c.sort(([,
|
|
548
|
-
for (const [
|
|
549
|
-
|
|
550
|
-
const
|
|
551
|
-
const d =
|
|
547
|
+
}), o = [], a = [], c = [...r];
|
|
548
|
+
c.sort(([, f], [, p]) => p - f);
|
|
549
|
+
for (const [f] of c)
|
|
550
|
+
f.endsWith("@1") || i.get(f) === t.length ? o.push(f) : a.push(f);
|
|
551
|
+
const l = (f) => s.map((p) => {
|
|
552
|
+
const d = p.fullTrace.filter((g) => f.has(g.fullType)).map((g) => g.label), y = n.separator ?? " / ";
|
|
552
553
|
return {
|
|
553
554
|
label: d.join(y),
|
|
554
|
-
value:
|
|
555
|
+
value: p.value
|
|
555
556
|
};
|
|
556
557
|
});
|
|
557
558
|
if (o.length === 0) {
|
|
558
|
-
if (
|
|
559
|
-
return
|
|
560
|
-
}
|
|
561
|
-
let
|
|
562
|
-
for (;
|
|
563
|
-
const
|
|
564
|
-
n.includeNativeLabel &&
|
|
565
|
-
for (let d = 0; d <
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
if (new Set(
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
return
|
|
572
|
-
}
|
|
573
|
-
const
|
|
574
|
-
function
|
|
559
|
+
if (a.length !== 0) throw new Error("Assertion error.");
|
|
560
|
+
return l(new Set(pe));
|
|
561
|
+
}
|
|
562
|
+
let m = 0, u = 0;
|
|
563
|
+
for (; m < o.length; ) {
|
|
564
|
+
const f = /* @__PURE__ */ new Set();
|
|
565
|
+
n.includeNativeLabel && f.add(pe);
|
|
566
|
+
for (let d = 0; d < m; ++d) f.add(o[d]);
|
|
567
|
+
f.add(o[u]);
|
|
568
|
+
const p = l(f);
|
|
569
|
+
if (new Set(p.map((d) => d.label)).size === t.length) return p;
|
|
570
|
+
u++, u == o.length && (m++, u = m);
|
|
571
|
+
}
|
|
572
|
+
return l(/* @__PURE__ */ new Set([...o, ...a]));
|
|
573
|
+
}
|
|
574
|
+
const H = "PColumnData/", Q = H + "ResourceMap", Z = H + "Partitioned/ResourceMap", N = H + "JsonPartitioned", O = H + "BinaryPartitioned", Ae = H + "Partitioned/", ee = Ae + "JsonPartitioned", B = Ae + "BinaryPartitioned";
|
|
575
|
+
function Se(t, e, n, r = [], i) {
|
|
575
576
|
if (t === void 0) return !1;
|
|
576
577
|
switch (t.resourceType.name) {
|
|
577
|
-
case
|
|
578
|
-
let
|
|
578
|
+
case Q: {
|
|
579
|
+
let s = t.getInputsLocked();
|
|
579
580
|
for (const o of t.listInputFields()) {
|
|
580
|
-
const
|
|
581
|
-
|
|
581
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" }), c = [...r, ...JSON.parse(o)], l = a === void 0 ? void 0 : e(a);
|
|
582
|
+
l === void 0 && (s = !1), (l !== void 0 || i) && n.push({ key: c, value: l });
|
|
582
583
|
}
|
|
583
|
-
return
|
|
584
|
+
return s;
|
|
584
585
|
}
|
|
585
|
-
case
|
|
586
|
-
let
|
|
586
|
+
case Z: {
|
|
587
|
+
let s = t.getInputsLocked();
|
|
587
588
|
for (const o of t.listInputFields()) {
|
|
588
|
-
const
|
|
589
|
-
if (
|
|
589
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
590
|
+
if (a === void 0) s = !1;
|
|
590
591
|
else {
|
|
591
|
-
const c = [...
|
|
592
|
-
|
|
592
|
+
const c = [...r, ...JSON.parse(o)], l = Se(
|
|
593
|
+
a,
|
|
593
594
|
e,
|
|
594
595
|
n,
|
|
595
596
|
c,
|
|
596
597
|
i
|
|
597
598
|
);
|
|
598
|
-
|
|
599
|
+
s = s && l;
|
|
599
600
|
}
|
|
600
601
|
}
|
|
601
|
-
return
|
|
602
|
+
return s;
|
|
602
603
|
}
|
|
603
604
|
default:
|
|
604
605
|
throw new Error(`Unknown resource type: ${t.resourceType.name}`);
|
|
605
606
|
}
|
|
606
607
|
}
|
|
607
|
-
function
|
|
608
|
-
const
|
|
609
|
-
return { isComplete:
|
|
608
|
+
function Ut(t, e, n = !1) {
|
|
609
|
+
const r = [];
|
|
610
|
+
return { isComplete: Se(t, e, r, [], n), data: r };
|
|
610
611
|
}
|
|
611
|
-
const
|
|
612
|
-
if (
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
}
|
|
612
|
+
const ae = (t) => {
|
|
613
|
+
if (t.endsWith(".index"))
|
|
614
|
+
return { baseKey: t.substring(0, t.length - 6), type: "index" };
|
|
615
|
+
if (t.endsWith(".values"))
|
|
616
|
+
return { baseKey: t.substring(0, t.length - 7), type: "values" };
|
|
617
|
+
throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
617
618
|
};
|
|
618
|
-
function
|
|
619
|
+
function ze(t) {
|
|
619
620
|
if (!t) return;
|
|
620
|
-
const e = t.resourceType.name, n = t.getDataAsJson(),
|
|
621
|
+
const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
|
|
621
622
|
let i = 0;
|
|
622
623
|
switch (e) {
|
|
623
|
-
case
|
|
624
|
+
case Q:
|
|
624
625
|
i = n.keyLength;
|
|
625
626
|
break;
|
|
626
|
-
case
|
|
627
|
+
case Z:
|
|
627
628
|
i = n.partitionKeyLength + n.keyLength;
|
|
628
629
|
break;
|
|
629
|
-
case
|
|
630
|
-
case
|
|
630
|
+
case N:
|
|
631
|
+
case O:
|
|
631
632
|
i = n.partitionKeyLength;
|
|
632
633
|
break;
|
|
634
|
+
case B:
|
|
633
635
|
case ee:
|
|
634
|
-
case pe:
|
|
635
636
|
i = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
636
637
|
break;
|
|
637
638
|
}
|
|
638
639
|
switch (e) {
|
|
639
|
-
case
|
|
640
|
-
case
|
|
641
|
-
case
|
|
642
|
-
for (let
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
else continue;
|
|
647
|
-
}
|
|
648
|
-
const o = [...JSON.parse(r)];
|
|
649
|
-
s.push(o);
|
|
640
|
+
case Q:
|
|
641
|
+
case N:
|
|
642
|
+
case O:
|
|
643
|
+
for (let s of t.listInputFields()) {
|
|
644
|
+
e === O && (s = ae(s).baseKey);
|
|
645
|
+
const o = [...JSON.parse(s)];
|
|
646
|
+
r.push(o);
|
|
650
647
|
}
|
|
651
648
|
break;
|
|
652
|
-
case
|
|
649
|
+
case Z:
|
|
650
|
+
case B:
|
|
653
651
|
case ee:
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
if (h) c = h;
|
|
662
|
-
else continue;
|
|
663
|
-
}
|
|
664
|
-
const a = [...o, ...JSON.parse(c)];
|
|
665
|
-
s.push(a);
|
|
652
|
+
for (const s of t.listInputFields()) {
|
|
653
|
+
const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
|
|
654
|
+
if (a !== void 0)
|
|
655
|
+
for (let c of a.listInputFields()) {
|
|
656
|
+
e === B && (c = ae(c).baseKey);
|
|
657
|
+
const l = [...o, ...JSON.parse(c)];
|
|
658
|
+
r.push(l);
|
|
666
659
|
}
|
|
667
660
|
}
|
|
668
661
|
break;
|
|
669
662
|
}
|
|
670
|
-
return { data:
|
|
663
|
+
return { data: r, keyLength: i };
|
|
671
664
|
}
|
|
672
|
-
function
|
|
673
|
-
const e =
|
|
665
|
+
function Ye(t) {
|
|
666
|
+
const e = ze(t);
|
|
674
667
|
if (!e) return;
|
|
675
|
-
const { data: n, keyLength:
|
|
676
|
-
for (let
|
|
668
|
+
const { data: n, keyLength: r } = e, i = [];
|
|
669
|
+
for (let s = 0; s < r; ++s)
|
|
677
670
|
i.push(/* @__PURE__ */ new Set());
|
|
678
|
-
for (const
|
|
679
|
-
if (
|
|
671
|
+
for (const s of n) {
|
|
672
|
+
if (s.length !== r)
|
|
680
673
|
throw new Error("key length does not match partition length");
|
|
681
|
-
for (let o = 0; o <
|
|
682
|
-
i[o].add(
|
|
674
|
+
for (let o = 0; o < r; ++o)
|
|
675
|
+
i[o].add(s[o]);
|
|
676
|
+
}
|
|
677
|
+
return i.map((s) => Array.from(s.values()));
|
|
678
|
+
}
|
|
679
|
+
function le(t, e = []) {
|
|
680
|
+
if (t === void 0) return;
|
|
681
|
+
const n = t.resourceType.name, r = t.getDataAsJson();
|
|
682
|
+
if (e.length > 0 && (n === ee || n === B))
|
|
683
|
+
throw new Error(`Unexpected nested super-partitioned resource: ${n}`);
|
|
684
|
+
switch (n) {
|
|
685
|
+
case Q:
|
|
686
|
+
case Z:
|
|
687
|
+
throw new Error(`Only data columns are supported, got: ${n}`);
|
|
688
|
+
case N: {
|
|
689
|
+
if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
690
|
+
throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
|
|
691
|
+
const i = [];
|
|
692
|
+
for (const s of t.listInputFields()) {
|
|
693
|
+
const o = t.resolve({ field: s, assertFieldType: "Input" });
|
|
694
|
+
if (o === void 0) return;
|
|
695
|
+
const a = [...e, ...JSON.parse(s)];
|
|
696
|
+
i.push({ key: a, value: o });
|
|
697
|
+
}
|
|
698
|
+
return {
|
|
699
|
+
type: "JsonPartitioned",
|
|
700
|
+
partitionKeyLength: r.partitionKeyLength,
|
|
701
|
+
parts: i
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
case O: {
|
|
705
|
+
if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
706
|
+
throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
|
|
707
|
+
const i = [], s = /* @__PURE__ */ new Map();
|
|
708
|
+
for (const o of t.listInputFields()) {
|
|
709
|
+
const a = ae(o), c = t.resolve({ field: o, assertFieldType: "Input" });
|
|
710
|
+
if (c === void 0) return;
|
|
711
|
+
let l = s.get(a.baseKey);
|
|
712
|
+
l || (l = {}, s.set(a.baseKey, l)), a.type === "index" ? l.index = c : l.values = c;
|
|
713
|
+
}
|
|
714
|
+
for (const [o, a] of s.entries()) {
|
|
715
|
+
if (!a.index || !a.values) return;
|
|
716
|
+
const c = [...e, ...JSON.parse(o)];
|
|
717
|
+
i.push({
|
|
718
|
+
key: c,
|
|
719
|
+
value: {
|
|
720
|
+
index: a.index,
|
|
721
|
+
values: a.values
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
return {
|
|
726
|
+
type: "BinaryPartitioned",
|
|
727
|
+
partitionKeyLength: r.partitionKeyLength,
|
|
728
|
+
parts: i
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
case ee: {
|
|
732
|
+
if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
733
|
+
throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
|
|
734
|
+
const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
|
|
735
|
+
for (const o of t.listInputFields()) {
|
|
736
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
737
|
+
if (a === void 0) return;
|
|
738
|
+
if (a.resourceType.name !== N)
|
|
739
|
+
throw new Error(`Expected ${N} inside ${n}, but got ${a.resourceType.name}`);
|
|
740
|
+
const c = le(a, JSON.parse(o));
|
|
741
|
+
if (c === void 0) return;
|
|
742
|
+
if (c.type !== "JsonPartitioned")
|
|
743
|
+
throw new Error(`Unexpected inner result type for ${n}: ${c.type}`);
|
|
744
|
+
s.push(...c.parts);
|
|
745
|
+
}
|
|
746
|
+
return {
|
|
747
|
+
type: "JsonPartitioned",
|
|
748
|
+
partitionKeyLength: i,
|
|
749
|
+
parts: s
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
case B: {
|
|
753
|
+
if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
754
|
+
throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
|
|
755
|
+
const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
|
|
756
|
+
for (const o of t.listInputFields()) {
|
|
757
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
758
|
+
if (a === void 0) return;
|
|
759
|
+
if (a.resourceType.name !== O)
|
|
760
|
+
throw new Error(`Expected ${O} inside ${n}, but got ${a.resourceType.name}`);
|
|
761
|
+
const c = le(a, JSON.parse(o));
|
|
762
|
+
if (c === void 0) return;
|
|
763
|
+
if (c.type !== "BinaryPartitioned")
|
|
764
|
+
throw new Error(`Unexpected inner result type for ${n}: ${c.type}`);
|
|
765
|
+
s.push(...c.parts);
|
|
766
|
+
}
|
|
767
|
+
return {
|
|
768
|
+
type: "BinaryPartitioned",
|
|
769
|
+
partitionKeyLength: i,
|
|
770
|
+
parts: s
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
default:
|
|
774
|
+
throw new Error(`Unknown resource type: ${n}`);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
function Xe(t, e) {
|
|
778
|
+
const n = [...e].sort((s, o) => o[0] - s[0]);
|
|
779
|
+
if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
|
|
780
|
+
const { partitionKeyLength: s } = t;
|
|
781
|
+
for (const [o] of e)
|
|
782
|
+
if (o >= s)
|
|
783
|
+
throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${s}`);
|
|
784
|
+
} else if (t.type === "Json") {
|
|
785
|
+
const { keyLength: s } = t;
|
|
786
|
+
for (const [o] of e)
|
|
787
|
+
if (o >= s)
|
|
788
|
+
throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${s}`);
|
|
789
|
+
}
|
|
790
|
+
const r = (s) => {
|
|
791
|
+
for (const [o, a] of n)
|
|
792
|
+
if (s[o] !== a)
|
|
793
|
+
return !1;
|
|
794
|
+
return !0;
|
|
795
|
+
}, i = (s) => {
|
|
796
|
+
const o = [...s];
|
|
797
|
+
for (const [a] of n)
|
|
798
|
+
o.splice(a, 1);
|
|
799
|
+
return o;
|
|
800
|
+
};
|
|
801
|
+
switch (t.type) {
|
|
802
|
+
case "Json": {
|
|
803
|
+
const s = t.data.filter((o) => r(o.key)).map((o) => ({
|
|
804
|
+
key: i(o.key),
|
|
805
|
+
value: o.value
|
|
806
|
+
}));
|
|
807
|
+
return {
|
|
808
|
+
type: "Json",
|
|
809
|
+
keyLength: t.keyLength - e.length,
|
|
810
|
+
data: s
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
case "JsonPartitioned": {
|
|
814
|
+
const s = t.parts.filter((o) => r(o.key)).map((o) => ({
|
|
815
|
+
key: i(o.key),
|
|
816
|
+
value: o.value
|
|
817
|
+
}));
|
|
818
|
+
return {
|
|
819
|
+
type: "JsonPartitioned",
|
|
820
|
+
partitionKeyLength: t.partitionKeyLength - e.length,
|
|
821
|
+
parts: s
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
case "BinaryPartitioned": {
|
|
825
|
+
const s = t.parts.filter((o) => r(o.key)).map((o) => ({
|
|
826
|
+
key: i(o.key),
|
|
827
|
+
value: o.value
|
|
828
|
+
}));
|
|
829
|
+
return {
|
|
830
|
+
type: "BinaryPartitioned",
|
|
831
|
+
partitionKeyLength: t.partitionKeyLength - e.length,
|
|
832
|
+
parts: s
|
|
833
|
+
};
|
|
834
|
+
}
|
|
683
835
|
}
|
|
684
|
-
return i.map((r) => Array.from(r.values()));
|
|
685
836
|
}
|
|
686
|
-
function
|
|
837
|
+
function re(t, e) {
|
|
687
838
|
if (t === void 0) return e === void 0;
|
|
688
839
|
if (e === void 0) return !0;
|
|
689
840
|
for (const n in e)
|
|
690
841
|
if (t[n] !== e[n]) return !1;
|
|
691
842
|
return !0;
|
|
692
843
|
}
|
|
693
|
-
|
|
844
|
+
function fe(t) {
|
|
845
|
+
return ue(t, (e) => e instanceof I ? e.handle : me(e) ? Ee(e, (n) => n.handle) : e);
|
|
846
|
+
}
|
|
847
|
+
function Qe(t) {
|
|
848
|
+
if (t)
|
|
849
|
+
return t.map((e) => ({
|
|
850
|
+
type: `split:${Oe(e.axisId)}`,
|
|
851
|
+
label: e.label,
|
|
852
|
+
importance: 1e6
|
|
853
|
+
// High importance for split filters in labels
|
|
854
|
+
}));
|
|
855
|
+
}
|
|
856
|
+
function Ze(t) {
|
|
857
|
+
if (t)
|
|
858
|
+
return t.map((e) => [e.axisIdx, e.value]);
|
|
859
|
+
}
|
|
860
|
+
class et {
|
|
694
861
|
constructor() {
|
|
695
|
-
|
|
696
|
-
// @TODO: unused, what is this for?
|
|
697
|
-
x(this, "defaultLabelFn", (e, n) => {
|
|
698
|
-
var s;
|
|
699
|
-
return ((s = e.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
|
|
700
|
-
});
|
|
862
|
+
T(this, "ctx", h());
|
|
701
863
|
}
|
|
702
864
|
/**
|
|
703
865
|
* @deprecated use getOptions()
|
|
@@ -706,87 +868,199 @@ class Ke {
|
|
|
706
868
|
return this.ctx.calculateOptions(e);
|
|
707
869
|
}
|
|
708
870
|
getOptions(e, n) {
|
|
709
|
-
const
|
|
710
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
711
|
-
ref:
|
|
871
|
+
const r = typeof e == "function" ? e : ce(e), i = this.getSpecs().entries.filter((s) => r(s.obj));
|
|
872
|
+
return typeof n == "object" || typeof n > "u" ? de(i, (s) => s.obj, n ?? {}).map(({ value: { ref: s }, label: o }) => ({
|
|
873
|
+
ref: s,
|
|
712
874
|
label: o
|
|
713
|
-
})) : i.map((
|
|
714
|
-
ref:
|
|
715
|
-
label: n(
|
|
875
|
+
})) : i.map((s) => ({
|
|
876
|
+
ref: s.ref,
|
|
877
|
+
label: n(s.obj, s.ref)
|
|
716
878
|
}));
|
|
717
879
|
}
|
|
718
|
-
|
|
719
|
-
|
|
880
|
+
/**
|
|
881
|
+
* Internal implementation that generates UniversalPColumnEntry objects from the provided
|
|
882
|
+
* anchors and selectors.
|
|
883
|
+
*/
|
|
884
|
+
getUniversalPColumnEntries(e, n, r) {
|
|
720
885
|
const i = {};
|
|
721
|
-
if (!(e instanceof
|
|
722
|
-
for (const [
|
|
723
|
-
if (
|
|
724
|
-
const
|
|
725
|
-
if (!
|
|
886
|
+
if (!(e instanceof te))
|
|
887
|
+
for (const [l, m] of Object.entries(e))
|
|
888
|
+
if (Ce(m)) {
|
|
889
|
+
const u = this.getPColumnSpecByRef(m);
|
|
890
|
+
if (!u)
|
|
726
891
|
return;
|
|
727
|
-
i[
|
|
892
|
+
i[l] = u;
|
|
728
893
|
} else
|
|
729
|
-
i[
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
if (!y) continue;
|
|
744
|
-
if (h >= y.length)
|
|
745
|
-
throw new Error(`Not enough partition keys for the requested split axes in column ${f.name}`);
|
|
746
|
-
const _ = c.map((m) => this.findLabels(T(f.axesSpec[m]))), A = [], v = (m, w) => {
|
|
747
|
-
if (w >= c.length) {
|
|
748
|
-
A.push([...m]);
|
|
894
|
+
i[l] = m;
|
|
895
|
+
const s = typeof n == "function" ? [n] : Array.isArray(n) ? n : [n], o = e instanceof te ? e : new te(i), a = [];
|
|
896
|
+
for (const l of s) {
|
|
897
|
+
const m = typeof l == "function" ? l : ce(Le(i, l)), u = this.getSpecs().entries.filter(({ obj: p }) => J(p) ? m(p) : !1);
|
|
898
|
+
if (u.length === 0)
|
|
899
|
+
continue;
|
|
900
|
+
const f = typeof l == "object" && "axes" in l && l.axes !== void 0 && l.partialAxesMatch === void 0 ? l.axes.map((p, d) => "split" in p && p.split === !0 ? d : -1).filter((p) => p !== -1) : [];
|
|
901
|
+
if (f.sort((p, d) => p - d), f.length > 0) {
|
|
902
|
+
const p = f[f.length - 1];
|
|
903
|
+
for (const { ref: d, obj: y } of u) {
|
|
904
|
+
if (!J(y)) throw new Error(`Assertion failed: expected PColumnSpec, got ${y.kind}`);
|
|
905
|
+
const g = this.getDataByRef(d);
|
|
906
|
+
if (!g) {
|
|
907
|
+
if (r != null && r.dontWaitAllData) continue;
|
|
749
908
|
return;
|
|
750
909
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
910
|
+
if (!M(g)) throw new Error(`Assertion failed: expected PColumn, got ${g.spec.kind}`);
|
|
911
|
+
const v = Ye(g.data);
|
|
912
|
+
if (!v) {
|
|
913
|
+
if (r != null && r.dontWaitAllData) continue;
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
if (p >= v.length)
|
|
917
|
+
throw new Error(`Not enough partition keys for the requested split axes in column ${y.name}`);
|
|
918
|
+
const w = f.map((P) => this.findLabels(L(y.axesSpec[P]))), x = [], C = (P, F) => {
|
|
919
|
+
if (F >= f.length) {
|
|
920
|
+
x.push([...P]);
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
const R = f[F], k = v[R];
|
|
924
|
+
for (const A of k)
|
|
925
|
+
P.push(A), C(P, F + 1), P.pop();
|
|
926
|
+
};
|
|
927
|
+
C([], 0);
|
|
928
|
+
for (const P of x) {
|
|
929
|
+
const F = P.map((R, k) => {
|
|
930
|
+
const A = f[k], j = L(y.axesSpec[A]), V = w[k], K = (V == null ? void 0 : V[R]) ?? String(R);
|
|
931
|
+
return { axisIdx: A, axisId: j, value: R, label: K };
|
|
932
|
+
});
|
|
933
|
+
a.push({
|
|
934
|
+
obj: y,
|
|
935
|
+
ref: d,
|
|
936
|
+
axisFilters: F
|
|
937
|
+
});
|
|
938
|
+
}
|
|
771
939
|
}
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
s ?? {}
|
|
780
|
-
).map((l) => ({
|
|
781
|
-
value: u.deriveS(l.value.obj, l.value.filters),
|
|
782
|
-
label: l.label
|
|
783
|
-
}));
|
|
940
|
+
} else
|
|
941
|
+
for (const { ref: p, obj: d } of u)
|
|
942
|
+
J(d) && a.push({
|
|
943
|
+
obj: d,
|
|
944
|
+
ref: p
|
|
945
|
+
// No splitFilters needed here
|
|
946
|
+
});
|
|
784
947
|
}
|
|
785
|
-
return
|
|
786
|
-
|
|
787
|
-
|
|
948
|
+
return a.length === 0 ? [] : de(
|
|
949
|
+
a,
|
|
950
|
+
(l) => ({
|
|
951
|
+
spec: l.obj,
|
|
952
|
+
suffixTrace: Qe(l.axisFilters)
|
|
953
|
+
// Use helper function
|
|
954
|
+
}),
|
|
955
|
+
(r == null ? void 0 : r.labelOps) ?? {}
|
|
956
|
+
).map((l) => ({
|
|
957
|
+
id: o.deriveS(
|
|
958
|
+
l.value.obj,
|
|
959
|
+
Ze(l.value.axisFilters)
|
|
960
|
+
// Use helper function
|
|
961
|
+
),
|
|
962
|
+
obj: l.value.obj,
|
|
963
|
+
ref: l.value.ref,
|
|
964
|
+
axisFilters: l.value.axisFilters,
|
|
965
|
+
label: l.label
|
|
788
966
|
}));
|
|
789
967
|
}
|
|
968
|
+
/**
|
|
969
|
+
* Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
|
|
970
|
+
*
|
|
971
|
+
* @param anchorsOrCtx - Anchor context for column selection (same as in getCanonicalOptions)
|
|
972
|
+
* @param predicateOrSelectors - Predicate or selectors for filtering columns (same as in getCanonicalOptions)
|
|
973
|
+
* @param opts - Optional configuration for label generation and data waiting
|
|
974
|
+
* @returns A PFrameHandle for the created PFrame, or undefined if any required data is missing
|
|
975
|
+
*/
|
|
976
|
+
getAnchoredPColumns(e, n, r) {
|
|
977
|
+
const i = {
|
|
978
|
+
...r,
|
|
979
|
+
labelOps: {
|
|
980
|
+
includeNativeLabel: !0,
|
|
981
|
+
...(r == null ? void 0 : r.labelOps) || {}
|
|
982
|
+
}
|
|
983
|
+
}, s = this.getUniversalPColumnEntries(
|
|
984
|
+
e,
|
|
985
|
+
n,
|
|
986
|
+
i
|
|
987
|
+
);
|
|
988
|
+
if (!s || s.length === 0) return;
|
|
989
|
+
const o = [];
|
|
990
|
+
for (const a of s) {
|
|
991
|
+
const c = this.getPColumnByRef(a.ref);
|
|
992
|
+
if (!c) return;
|
|
993
|
+
const l = le(c.data);
|
|
994
|
+
if (!l) return;
|
|
995
|
+
let m = l, u = { ...c.spec };
|
|
996
|
+
if (a.axisFilters && a.axisFilters.length > 0) {
|
|
997
|
+
const p = a.axisFilters.map((g) => [
|
|
998
|
+
g.axisIdx,
|
|
999
|
+
g.value
|
|
1000
|
+
]);
|
|
1001
|
+
m = Xe(l, p);
|
|
1002
|
+
const d = [...a.axisFilters].map((g) => g.axisIdx).sort((g, v) => v - g), y = [...u.axesSpec];
|
|
1003
|
+
for (const g of d)
|
|
1004
|
+
y.splice(g, 1);
|
|
1005
|
+
u = { ...u, axesSpec: y };
|
|
1006
|
+
}
|
|
1007
|
+
const f = Te(m);
|
|
1008
|
+
u.annotations ? u = {
|
|
1009
|
+
...u,
|
|
1010
|
+
annotations: {
|
|
1011
|
+
...u.annotations,
|
|
1012
|
+
"pl7.app/label": a.label
|
|
1013
|
+
}
|
|
1014
|
+
} : u = {
|
|
1015
|
+
...u,
|
|
1016
|
+
annotations: {
|
|
1017
|
+
"pl7.app/label": a.label
|
|
1018
|
+
}
|
|
1019
|
+
}, o.push({
|
|
1020
|
+
id: a.id,
|
|
1021
|
+
spec: u,
|
|
1022
|
+
data: f
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
return o;
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* Calculates anchored identifier options for columns matching a given predicate and returns their
|
|
1029
|
+
* canonicalized representations.
|
|
1030
|
+
*
|
|
1031
|
+
* This function filters column specifications from the result pool that match the provided predicate,
|
|
1032
|
+
* creates a standardized AnchorCtx from the provided anchors, and generates a list of label-value
|
|
1033
|
+
* pairs for UI components (like dropdowns).
|
|
1034
|
+
*
|
|
1035
|
+
* @param anchorsOrCtx - Either:
|
|
1036
|
+
* - An existing AnchorCtx instance
|
|
1037
|
+
* - A record mapping anchor IDs to PColumnSpec objects
|
|
1038
|
+
* - A record mapping anchor IDs to PlRef objects (which will be resolved to PColumnSpec)
|
|
1039
|
+
* @param predicateOrSelectors - Either:
|
|
1040
|
+
* - A predicate function that takes a PColumnSpec and returns a boolean.
|
|
1041
|
+
* Only specs that return true will be included.
|
|
1042
|
+
* - An APColumnSelector object for declarative filtering, which will be
|
|
1043
|
+
* resolved against the provided anchors and matched using matchPColumn.
|
|
1044
|
+
* - An array of APColumnSelector objects - columns matching ANY selector
|
|
1045
|
+
* in the array will be included (OR operation).
|
|
1046
|
+
* @param opts - Optional configuration for label generation:
|
|
1047
|
+
* - labelOps: Optional configuration for label generation:
|
|
1048
|
+
* - includeNativeLabel: Whether to include native column labels
|
|
1049
|
+
* - separator: String to use between label parts (defaults to " / ")
|
|
1050
|
+
* - addLabelAsSuffix: Whether to add labels as suffix instead of prefix
|
|
1051
|
+
* - dontWaitAllData: Whether to skip columns that don't have all data (if not set, will return undefined,
|
|
1052
|
+
* if at least one column that requires splitting is missing data)
|
|
1053
|
+
* @returns An array of objects with `label` (display text) and `value` (anchored ID string) properties,
|
|
1054
|
+
* or undefined if any PlRef resolution fails.
|
|
1055
|
+
*/
|
|
1056
|
+
getCanonicalOptions(e, n, r) {
|
|
1057
|
+
const i = this.getUniversalPColumnEntries(e, n, r);
|
|
1058
|
+
if (i)
|
|
1059
|
+
return i.map((s) => ({
|
|
1060
|
+
value: s.id,
|
|
1061
|
+
label: s.label
|
|
1062
|
+
}));
|
|
1063
|
+
}
|
|
790
1064
|
/**
|
|
791
1065
|
* @deprecated use getData()
|
|
792
1066
|
*/
|
|
@@ -820,9 +1094,9 @@ class Ke {
|
|
|
820
1094
|
ref: n.ref,
|
|
821
1095
|
obj: {
|
|
822
1096
|
...n.obj,
|
|
823
|
-
data:
|
|
1097
|
+
data: Fe(
|
|
824
1098
|
n.obj.data,
|
|
825
|
-
(
|
|
1099
|
+
(r) => new I(r, [n.ref.blockId, n.ref.name])
|
|
826
1100
|
)
|
|
827
1101
|
}
|
|
828
1102
|
}))
|
|
@@ -842,13 +1116,17 @@ class Ke {
|
|
|
842
1116
|
* @returns data associated with the ref
|
|
843
1117
|
*/
|
|
844
1118
|
getDataByRef(e) {
|
|
845
|
-
var
|
|
846
|
-
|
|
847
|
-
(
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
)
|
|
1119
|
+
var r;
|
|
1120
|
+
if (typeof this.ctx.getDataFromResultPoolByRef > "u")
|
|
1121
|
+
return (r = this.getData().entries.find(
|
|
1122
|
+
(i) => i.ref.blockId === e.blockId && i.ref.name === e.name
|
|
1123
|
+
)) == null ? void 0 : r.obj;
|
|
1124
|
+
const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
|
|
1125
|
+
if (n)
|
|
1126
|
+
return ue(
|
|
1127
|
+
n,
|
|
1128
|
+
(i) => new I(i, [e.blockId, e.name])
|
|
1129
|
+
);
|
|
852
1130
|
}
|
|
853
1131
|
/**
|
|
854
1132
|
* Returns data associated with the ref ensuring that it is a p-column.
|
|
@@ -858,7 +1136,7 @@ class Ke {
|
|
|
858
1136
|
getPColumnByRef(e) {
|
|
859
1137
|
const n = this.getDataByRef(e);
|
|
860
1138
|
if (n)
|
|
861
|
-
return
|
|
1139
|
+
return Re(n);
|
|
862
1140
|
}
|
|
863
1141
|
/**
|
|
864
1142
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
@@ -886,17 +1164,17 @@ class Ke {
|
|
|
886
1164
|
*/
|
|
887
1165
|
findDataWithCompatibleSpec(e) {
|
|
888
1166
|
const n = [];
|
|
889
|
-
e: for (const
|
|
890
|
-
if (!J(
|
|
1167
|
+
e: for (const r of this.getData().entries) {
|
|
1168
|
+
if (!J(r.obj.spec))
|
|
891
1169
|
continue;
|
|
892
|
-
const i =
|
|
893
|
-
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length &&
|
|
894
|
-
for (let
|
|
895
|
-
const o = e.axesSpec[
|
|
896
|
-
if (o.name !==
|
|
1170
|
+
const i = r.obj.spec;
|
|
1171
|
+
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && re(e.domain, i.domain)) {
|
|
1172
|
+
for (let s = 0; s < e.axesSpec.length; ++s) {
|
|
1173
|
+
const o = e.axesSpec[s], a = i.axesSpec[s];
|
|
1174
|
+
if (o.name !== a.name || o.type !== a.type || !re(o.domain, a.domain))
|
|
897
1175
|
continue e;
|
|
898
1176
|
}
|
|
899
|
-
n.push(
|
|
1177
|
+
n.push(r.obj);
|
|
900
1178
|
}
|
|
901
1179
|
}
|
|
902
1180
|
return n;
|
|
@@ -907,30 +1185,30 @@ class Ke {
|
|
|
907
1185
|
*/
|
|
908
1186
|
findLabels(e) {
|
|
909
1187
|
const n = this.getData();
|
|
910
|
-
for (const
|
|
911
|
-
if (!
|
|
912
|
-
const i =
|
|
913
|
-
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type &&
|
|
914
|
-
if (
|
|
915
|
-
throw Error(`Expected JSON column for labels, got: ${
|
|
1188
|
+
for (const r of n.entries) {
|
|
1189
|
+
if (!M(r.obj)) continue;
|
|
1190
|
+
const i = r.obj.spec;
|
|
1191
|
+
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && re(e.domain, i.axesSpec[0].domain)) {
|
|
1192
|
+
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
1193
|
+
throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
|
|
916
1194
|
return Object.fromEntries(
|
|
917
1195
|
Object.entries(
|
|
918
|
-
|
|
1196
|
+
r.obj.data.getDataAsJson().data
|
|
919
1197
|
).map((o) => [JSON.parse(o[0])[0], o[1]])
|
|
920
1198
|
);
|
|
921
1199
|
}
|
|
922
1200
|
}
|
|
923
1201
|
}
|
|
924
1202
|
}
|
|
925
|
-
class
|
|
1203
|
+
class z {
|
|
926
1204
|
constructor() {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1205
|
+
T(this, "ctx");
|
|
1206
|
+
T(this, "args");
|
|
1207
|
+
T(this, "uiState");
|
|
930
1208
|
// lazy rendering because this feature is rarely used
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
this.ctx =
|
|
1209
|
+
T(this, "_activeArgsCache");
|
|
1210
|
+
T(this, "resultPool", new et());
|
|
1211
|
+
this.ctx = h(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
|
|
934
1212
|
}
|
|
935
1213
|
/**
|
|
936
1214
|
* Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
|
|
@@ -946,16 +1224,16 @@ class G {
|
|
|
946
1224
|
// return this.ctx.featureFlags;
|
|
947
1225
|
// }
|
|
948
1226
|
getNamedAccessor(e) {
|
|
949
|
-
return
|
|
1227
|
+
return ie(
|
|
950
1228
|
this.ctx.getAccessorHandleByName(e),
|
|
951
1229
|
(n) => new I(n, [e])
|
|
952
1230
|
);
|
|
953
1231
|
}
|
|
954
1232
|
get prerun() {
|
|
955
|
-
return this.getNamedAccessor(
|
|
1233
|
+
return this.getNamedAccessor(ve);
|
|
956
1234
|
}
|
|
957
1235
|
get outputs() {
|
|
958
|
-
return this.getNamedAccessor(
|
|
1236
|
+
return this.getNamedAccessor(we);
|
|
959
1237
|
}
|
|
960
1238
|
/**
|
|
961
1239
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
@@ -965,14 +1243,14 @@ class G {
|
|
|
965
1243
|
findLabels(e) {
|
|
966
1244
|
return this.resultPool.findLabels(e);
|
|
967
1245
|
}
|
|
968
|
-
|
|
1246
|
+
verifyInlineAndExplicitColumnsSupport(e) {
|
|
969
1247
|
var i;
|
|
970
|
-
const n = e.some((
|
|
971
|
-
if (n && !
|
|
1248
|
+
const n = e.some((s) => !(s.data instanceof I) || me(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
|
|
1249
|
+
if (n && !r) throw Error("Inline or explicit columns not supported");
|
|
972
1250
|
}
|
|
973
1251
|
createPFrame(e) {
|
|
974
|
-
return this.
|
|
975
|
-
e.map((n) =>
|
|
1252
|
+
return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
|
|
1253
|
+
e.map((n) => fe(n))
|
|
976
1254
|
);
|
|
977
1255
|
}
|
|
978
1256
|
createPTable(e) {
|
|
@@ -980,15 +1258,12 @@ class G {
|
|
|
980
1258
|
return "columns" in e ? n = {
|
|
981
1259
|
src: {
|
|
982
1260
|
type: "full",
|
|
983
|
-
entries: e.columns.map((
|
|
1261
|
+
entries: e.columns.map((r) => ({ type: "column", column: r }))
|
|
984
1262
|
},
|
|
985
1263
|
filters: e.filters ?? [],
|
|
986
1264
|
sorting: e.sorting ?? []
|
|
987
|
-
} : n = e, this.
|
|
988
|
-
|
|
989
|
-
n,
|
|
990
|
-
(s) => K(s, (i) => i instanceof I ? i.handle : i)
|
|
991
|
-
)
|
|
1265
|
+
} : n = e, this.verifyInlineAndExplicitColumnsSupport(ke(n.src)), this.ctx.createPTable(
|
|
1266
|
+
De(n, (r) => fe(r))
|
|
992
1267
|
);
|
|
993
1268
|
}
|
|
994
1269
|
/** @deprecated scheduled for removal from SDK */
|
|
@@ -1000,44 +1275,44 @@ class G {
|
|
|
1000
1275
|
return this.ctx.getCurrentUnstableMarker();
|
|
1001
1276
|
}
|
|
1002
1277
|
}
|
|
1003
|
-
const
|
|
1004
|
-
function
|
|
1278
|
+
const U = "1.27.6";
|
|
1279
|
+
function tt(t) {
|
|
1005
1280
|
return t.__renderLambda === !0;
|
|
1006
1281
|
}
|
|
1007
|
-
function
|
|
1282
|
+
function se(t) {
|
|
1008
1283
|
if (t !== void 0)
|
|
1009
|
-
return
|
|
1284
|
+
return tt(t) ? t.handle : t;
|
|
1010
1285
|
}
|
|
1011
|
-
function
|
|
1286
|
+
function D(t) {
|
|
1012
1287
|
if (t !== void 0)
|
|
1013
1288
|
return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
|
|
1014
1289
|
}
|
|
1015
|
-
function
|
|
1290
|
+
function Mt(t) {
|
|
1016
1291
|
if (t.v3 !== void 0) {
|
|
1017
1292
|
const {
|
|
1018
1293
|
initialArgs: e,
|
|
1019
1294
|
initialUiState: n,
|
|
1020
|
-
inputsValid:
|
|
1295
|
+
inputsValid: r,
|
|
1021
1296
|
outputs: i,
|
|
1022
|
-
renderingMode:
|
|
1297
|
+
renderingMode: s,
|
|
1023
1298
|
sdkVersion: o,
|
|
1024
|
-
sections:
|
|
1299
|
+
sections: a,
|
|
1025
1300
|
title: c
|
|
1026
|
-
} = t.v3, { code:
|
|
1301
|
+
} = t.v3, { code: l } = t;
|
|
1027
1302
|
return {
|
|
1028
1303
|
initialArgs: e,
|
|
1029
1304
|
initialUiState: n,
|
|
1030
|
-
inputsValid:
|
|
1305
|
+
inputsValid: r,
|
|
1031
1306
|
outputs: i,
|
|
1032
|
-
renderingMode:
|
|
1307
|
+
renderingMode: s,
|
|
1033
1308
|
sdkVersion: o,
|
|
1034
|
-
sections:
|
|
1309
|
+
sections: a,
|
|
1035
1310
|
title: c,
|
|
1036
|
-
code:
|
|
1311
|
+
code: l
|
|
1037
1312
|
};
|
|
1038
1313
|
} else if (t.inputsValid !== void 0) {
|
|
1039
|
-
const { sdkVersion: e, renderingMode: n, outputs:
|
|
1040
|
-
if (e === void 0 || n === void 0 ||
|
|
1314
|
+
const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: i, sections: s, initialArgs: o, code: a } = t, c = Object.keys(t);
|
|
1315
|
+
if (e === void 0 || n === void 0 || r === void 0 || i === void 0 || s === void 0 || o === void 0)
|
|
1041
1316
|
throw new Error(
|
|
1042
1317
|
`Malformed config v2. SDK version ${e}; Fields = ${c.join(", ")}`
|
|
1043
1318
|
);
|
|
@@ -1046,30 +1321,30 @@ function jt(t) {
|
|
|
1046
1321
|
renderingMode: n,
|
|
1047
1322
|
initialArgs: o,
|
|
1048
1323
|
outputs: Object.fromEntries(
|
|
1049
|
-
Object.entries(
|
|
1324
|
+
Object.entries(r).map(([l, m]) => [l, D(m)])
|
|
1050
1325
|
),
|
|
1051
|
-
inputsValid:
|
|
1052
|
-
sections:
|
|
1326
|
+
inputsValid: D(i),
|
|
1327
|
+
sections: D(s),
|
|
1053
1328
|
initialUiState: void 0,
|
|
1054
|
-
code:
|
|
1329
|
+
code: a
|
|
1055
1330
|
};
|
|
1056
1331
|
} else if (t.renderingMode !== void 0) {
|
|
1057
|
-
const { sdkVersion: e, canRun: n, renderingMode:
|
|
1058
|
-
if (
|
|
1332
|
+
const { sdkVersion: e, canRun: n, renderingMode: r, outputs: i, sections: s, initialArgs: o, code: a } = t, c = Object.keys(t);
|
|
1333
|
+
if (r === void 0 || i === void 0 || n === void 0 || s === void 0 || o === void 0)
|
|
1059
1334
|
throw new Error(
|
|
1060
1335
|
`Malformed config v1. SDK version ${e}; Fields = ${c.join(", ")}`
|
|
1061
1336
|
);
|
|
1062
1337
|
return {
|
|
1063
1338
|
sdkVersion: e ?? "unknown",
|
|
1064
|
-
renderingMode:
|
|
1339
|
+
renderingMode: r,
|
|
1065
1340
|
initialArgs: o,
|
|
1066
1341
|
outputs: Object.fromEntries(
|
|
1067
|
-
Object.entries(i).map(([
|
|
1342
|
+
Object.entries(i).map(([l, m]) => [l, D(m)])
|
|
1068
1343
|
),
|
|
1069
|
-
inputsValid:
|
|
1070
|
-
sections:
|
|
1344
|
+
inputsValid: D(n),
|
|
1345
|
+
sections: D(s),
|
|
1071
1346
|
initialUiState: void 0,
|
|
1072
|
-
code:
|
|
1347
|
+
code: a
|
|
1073
1348
|
};
|
|
1074
1349
|
} else {
|
|
1075
1350
|
const { sdkVersion: e } = t, n = Object.keys(t);
|
|
@@ -1078,25 +1353,25 @@ function jt(t) {
|
|
|
1078
1353
|
);
|
|
1079
1354
|
}
|
|
1080
1355
|
}
|
|
1081
|
-
class
|
|
1082
|
-
constructor(e, n,
|
|
1083
|
-
this._renderingMode = e, this._initialArgs = n, this._initialUiState =
|
|
1356
|
+
class _ {
|
|
1357
|
+
constructor(e, n, r, i, s, o, a) {
|
|
1358
|
+
this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = a;
|
|
1084
1359
|
}
|
|
1085
1360
|
static create(e = "Heavy") {
|
|
1086
|
-
return new
|
|
1361
|
+
return new _(
|
|
1087
1362
|
e,
|
|
1088
1363
|
void 0,
|
|
1089
1364
|
{},
|
|
1090
1365
|
{},
|
|
1091
|
-
|
|
1092
|
-
|
|
1366
|
+
Y(!0),
|
|
1367
|
+
Y([]),
|
|
1093
1368
|
void 0
|
|
1094
1369
|
);
|
|
1095
1370
|
}
|
|
1096
|
-
output(e, n,
|
|
1371
|
+
output(e, n, r = {}) {
|
|
1097
1372
|
if (typeof n == "function") {
|
|
1098
1373
|
const i = `output#${e}`;
|
|
1099
|
-
return
|
|
1374
|
+
return q(i, () => n(new z())), new _(
|
|
1100
1375
|
this._renderingMode,
|
|
1101
1376
|
this._initialArgs,
|
|
1102
1377
|
this._initialUiState,
|
|
@@ -1105,7 +1380,7 @@ class P {
|
|
|
1105
1380
|
[e]: {
|
|
1106
1381
|
__renderLambda: !0,
|
|
1107
1382
|
handle: i,
|
|
1108
|
-
...
|
|
1383
|
+
...r
|
|
1109
1384
|
}
|
|
1110
1385
|
},
|
|
1111
1386
|
this._inputsValid,
|
|
@@ -1113,7 +1388,7 @@ class P {
|
|
|
1113
1388
|
this._title
|
|
1114
1389
|
);
|
|
1115
1390
|
} else
|
|
1116
|
-
return new
|
|
1391
|
+
return new _(
|
|
1117
1392
|
this._renderingMode,
|
|
1118
1393
|
this._initialArgs,
|
|
1119
1394
|
this._initialUiState,
|
|
@@ -1131,7 +1406,7 @@ class P {
|
|
|
1131
1406
|
return this.output(e, n, { retentive: !0 });
|
|
1132
1407
|
}
|
|
1133
1408
|
argsValid(e) {
|
|
1134
|
-
return typeof e == "function" ? (
|
|
1409
|
+
return typeof e == "function" ? (q("inputsValid", () => e(new z())), new _(
|
|
1135
1410
|
this._renderingMode,
|
|
1136
1411
|
this._initialArgs,
|
|
1137
1412
|
this._initialUiState,
|
|
@@ -1142,7 +1417,7 @@ class P {
|
|
|
1142
1417
|
},
|
|
1143
1418
|
this._sections,
|
|
1144
1419
|
this._title
|
|
1145
|
-
)) : new
|
|
1420
|
+
)) : new _(
|
|
1146
1421
|
this._renderingMode,
|
|
1147
1422
|
this._initialArgs,
|
|
1148
1423
|
this._initialUiState,
|
|
@@ -1153,7 +1428,7 @@ class P {
|
|
|
1153
1428
|
);
|
|
1154
1429
|
}
|
|
1155
1430
|
sections(e) {
|
|
1156
|
-
return Array.isArray(e) ? this.sections(
|
|
1431
|
+
return Array.isArray(e) ? this.sections(Y(e)) : typeof e == "function" ? (q("sections", () => e(new z())), new _(
|
|
1157
1432
|
this._renderingMode,
|
|
1158
1433
|
this._initialArgs,
|
|
1159
1434
|
this._initialUiState,
|
|
@@ -1161,7 +1436,7 @@ class P {
|
|
|
1161
1436
|
this._inputsValid,
|
|
1162
1437
|
{ __renderLambda: !0, handle: "sections" },
|
|
1163
1438
|
this._title
|
|
1164
|
-
)) : new
|
|
1439
|
+
)) : new _(
|
|
1165
1440
|
this._renderingMode,
|
|
1166
1441
|
this._initialArgs,
|
|
1167
1442
|
this._initialUiState,
|
|
@@ -1173,7 +1448,7 @@ class P {
|
|
|
1173
1448
|
}
|
|
1174
1449
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
1175
1450
|
title(e) {
|
|
1176
|
-
return
|
|
1451
|
+
return q("title", () => e(new z())), new _(
|
|
1177
1452
|
this._renderingMode,
|
|
1178
1453
|
this._initialArgs,
|
|
1179
1454
|
this._initialUiState,
|
|
@@ -1188,7 +1463,7 @@ class P {
|
|
|
1188
1463
|
* @deprecated use {@link withArgs}
|
|
1189
1464
|
* */
|
|
1190
1465
|
initialArgs(e) {
|
|
1191
|
-
return new
|
|
1466
|
+
return new _(
|
|
1192
1467
|
this._renderingMode,
|
|
1193
1468
|
e,
|
|
1194
1469
|
this._initialUiState,
|
|
@@ -1200,7 +1475,7 @@ class P {
|
|
|
1200
1475
|
}
|
|
1201
1476
|
/** Sets initial args for the block, this value must be specified. */
|
|
1202
1477
|
withArgs(e) {
|
|
1203
|
-
return new
|
|
1478
|
+
return new _(
|
|
1204
1479
|
this._renderingMode,
|
|
1205
1480
|
e,
|
|
1206
1481
|
this._initialUiState,
|
|
@@ -1212,7 +1487,7 @@ class P {
|
|
|
1212
1487
|
}
|
|
1213
1488
|
/** Defines type and sets initial value for block UiState. */
|
|
1214
1489
|
withUiState(e) {
|
|
1215
|
-
return new
|
|
1490
|
+
return new _(
|
|
1216
1491
|
this._renderingMode,
|
|
1217
1492
|
this._initialArgs,
|
|
1218
1493
|
e,
|
|
@@ -1229,7 +1504,7 @@ class P {
|
|
|
1229
1504
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
1230
1505
|
const e = {
|
|
1231
1506
|
v3: {
|
|
1232
|
-
sdkVersion:
|
|
1507
|
+
sdkVersion: U,
|
|
1233
1508
|
renderingMode: this._renderingMode,
|
|
1234
1509
|
initialArgs: this._initialArgs,
|
|
1235
1510
|
initialUiState: this._initialUiState,
|
|
@@ -1239,185 +1514,185 @@ class P {
|
|
|
1239
1514
|
outputs: this._outputs
|
|
1240
1515
|
},
|
|
1241
1516
|
// fields below are added to allow previous desktop versions read generated configs
|
|
1242
|
-
sdkVersion:
|
|
1517
|
+
sdkVersion: U,
|
|
1243
1518
|
renderingMode: this._renderingMode,
|
|
1244
1519
|
initialArgs: this._initialArgs,
|
|
1245
|
-
inputsValid:
|
|
1246
|
-
sections:
|
|
1520
|
+
inputsValid: se(this._inputsValid),
|
|
1521
|
+
sections: se(this._sections),
|
|
1247
1522
|
outputs: Object.fromEntries(
|
|
1248
|
-
Object.entries(this._outputs).map(([n,
|
|
1523
|
+
Object.entries(this._outputs).map(([n, r]) => [n, se(r)])
|
|
1249
1524
|
)
|
|
1250
1525
|
};
|
|
1251
|
-
return
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
function
|
|
1255
|
-
var
|
|
1256
|
-
Array.isArray(
|
|
1257
|
-
const i = t.resultPool.getData().entries.map((
|
|
1258
|
-
let
|
|
1259
|
-
if (
|
|
1260
|
-
for (const d in
|
|
1261
|
-
|
|
1262
|
-
return
|
|
1526
|
+
return Ke() ? be({ sdkVersion: U }) : { config: e };
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
function Gt(t, e, n, r) {
|
|
1530
|
+
var l, m;
|
|
1531
|
+
Array.isArray(r) && (r = { filters: r });
|
|
1532
|
+
const i = t.resultPool.getData().entries.map((u) => u.obj).filter(M).filter((u) => u.spec.name === "pl7.app/label" && u.spec.axesSpec.length === 1), s = (u, f) => {
|
|
1533
|
+
let p = u.toString();
|
|
1534
|
+
if (f)
|
|
1535
|
+
for (const d in f)
|
|
1536
|
+
p += d, p += f[d];
|
|
1537
|
+
return p;
|
|
1263
1538
|
}, o = /* @__PURE__ */ new Map();
|
|
1264
|
-
for (const
|
|
1265
|
-
for (const
|
|
1266
|
-
const
|
|
1539
|
+
for (const u of e)
|
|
1540
|
+
for (const f of u.spec.axesSpec) {
|
|
1541
|
+
const p = L(f);
|
|
1267
1542
|
for (const d of i) {
|
|
1268
|
-
const y = d.spec.axesSpec[0],
|
|
1269
|
-
if (
|
|
1270
|
-
const
|
|
1271
|
-
if (
|
|
1272
|
-
const
|
|
1273
|
-
o.set(
|
|
1274
|
-
id:
|
|
1543
|
+
const y = d.spec.axesSpec[0], g = L(d.spec.axesSpec[0]);
|
|
1544
|
+
if (G(p, g)) {
|
|
1545
|
+
const v = Object.keys(p.domain ?? {}).length, w = Object.keys(g.domain ?? {}).length;
|
|
1546
|
+
if (v > w) {
|
|
1547
|
+
const x = s(d.id, p.domain);
|
|
1548
|
+
o.set(x, {
|
|
1549
|
+
id: x,
|
|
1275
1550
|
spec: {
|
|
1276
1551
|
...d.spec,
|
|
1277
|
-
axesSpec: [{ ...
|
|
1552
|
+
axesSpec: [{ ...p, annotations: y.annotations }]
|
|
1278
1553
|
},
|
|
1279
1554
|
data: d.data
|
|
1280
1555
|
});
|
|
1281
1556
|
} else
|
|
1282
|
-
o.set(
|
|
1557
|
+
o.set(s(d.id), d);
|
|
1283
1558
|
}
|
|
1284
1559
|
}
|
|
1285
1560
|
}
|
|
1286
1561
|
if ([...e, ...o.values()].some(
|
|
1287
|
-
(
|
|
1562
|
+
(u) => u.data instanceof I && !u.data.getIsReadyOrError()
|
|
1288
1563
|
))
|
|
1289
1564
|
return;
|
|
1290
|
-
let
|
|
1565
|
+
let a = e;
|
|
1291
1566
|
const c = [];
|
|
1292
|
-
if (
|
|
1293
|
-
|
|
1294
|
-
for (const
|
|
1295
|
-
|
|
1567
|
+
if (r != null && r.coreColumnPredicate) {
|
|
1568
|
+
a = [];
|
|
1569
|
+
for (const u of e)
|
|
1570
|
+
r.coreColumnPredicate(u.spec) ? a.push(u) : c.push(u);
|
|
1296
1571
|
}
|
|
1297
1572
|
return c.push(...o.values()), t.createPTable({
|
|
1298
1573
|
src: {
|
|
1299
1574
|
type: "outer",
|
|
1300
1575
|
primary: {
|
|
1301
|
-
type: (
|
|
1302
|
-
entries:
|
|
1576
|
+
type: (r == null ? void 0 : r.coreJoinType) ?? "full",
|
|
1577
|
+
entries: a.map((u) => ({ type: "column", column: u }))
|
|
1303
1578
|
},
|
|
1304
|
-
secondary: c.map((
|
|
1579
|
+
secondary: c.map((u) => ({ type: "column", column: u }))
|
|
1305
1580
|
},
|
|
1306
|
-
filters: [...(
|
|
1307
|
-
sorting: ((
|
|
1581
|
+
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((l = n == null ? void 0 : n.pTableParams) == null ? void 0 : l.filters) ?? []],
|
|
1582
|
+
sorting: ((m = n == null ? void 0 : n.pTableParams) == null ? void 0 : m.sorting) ?? []
|
|
1308
1583
|
});
|
|
1309
1584
|
}
|
|
1310
|
-
function
|
|
1311
|
-
const
|
|
1585
|
+
function Wt(t, e, n) {
|
|
1586
|
+
const r = t.resultPool.findLabels(e);
|
|
1312
1587
|
return {
|
|
1313
1588
|
axis: e,
|
|
1314
1589
|
options: n.map((i) => ({
|
|
1315
1590
|
value: i,
|
|
1316
|
-
label: (
|
|
1591
|
+
label: (r == null ? void 0 : r[i]) ?? i.toString()
|
|
1317
1592
|
})),
|
|
1318
1593
|
defaultValue: n[0]
|
|
1319
1594
|
};
|
|
1320
1595
|
}
|
|
1321
|
-
const
|
|
1596
|
+
const nt = (t, e) => {
|
|
1322
1597
|
let n = t.toString();
|
|
1323
|
-
return e == null || e.forEach((
|
|
1324
|
-
if (
|
|
1325
|
-
for (const [i,
|
|
1326
|
-
n += i, n +=
|
|
1598
|
+
return e == null || e.forEach((r) => {
|
|
1599
|
+
if (r)
|
|
1600
|
+
for (const [i, s] of Object.entries(r))
|
|
1601
|
+
n += i, n += s;
|
|
1327
1602
|
}), n;
|
|
1328
1603
|
};
|
|
1329
|
-
function
|
|
1604
|
+
function rt(t) {
|
|
1330
1605
|
if (!t.length)
|
|
1331
1606
|
return [];
|
|
1332
1607
|
let e = [[]];
|
|
1333
1608
|
return t.forEach((n) => {
|
|
1334
|
-
const
|
|
1609
|
+
const r = [];
|
|
1335
1610
|
n.forEach((i) => {
|
|
1336
|
-
|
|
1337
|
-
}), e =
|
|
1611
|
+
r.push(...e.map((s) => [...s, i]));
|
|
1612
|
+
}), e = r;
|
|
1338
1613
|
}), e;
|
|
1339
1614
|
}
|
|
1340
|
-
function
|
|
1341
|
-
const n = t.spec.axesSpec.map(
|
|
1342
|
-
return e.spec.axesSpec.map(
|
|
1615
|
+
function st(t, e) {
|
|
1616
|
+
const n = t.spec.axesSpec.map(L);
|
|
1617
|
+
return e.spec.axesSpec.map(L).every((i) => n.some((s) => G(s, i) && G(i, s)));
|
|
1343
1618
|
}
|
|
1344
|
-
function
|
|
1345
|
-
const n = t.spec.axesSpec.map(
|
|
1346
|
-
return e.spec.axesSpec.map(
|
|
1619
|
+
function Pe(t, e) {
|
|
1620
|
+
const n = t.spec.axesSpec.map(L);
|
|
1621
|
+
return e.spec.axesSpec.map(L).every((i) => n.some((s) => G(s, i)));
|
|
1347
1622
|
}
|
|
1348
|
-
const
|
|
1349
|
-
function
|
|
1350
|
-
const n = t.spec.axesSpec.map(
|
|
1351
|
-
if (
|
|
1623
|
+
const it = "pl7.app/graph/isVirtual", he = "pl7.app/label";
|
|
1624
|
+
function ge(t, e) {
|
|
1625
|
+
const n = t.spec.axesSpec.map(L), r = e.spec.axesSpec.map(L);
|
|
1626
|
+
if (st(t, e))
|
|
1352
1627
|
return [];
|
|
1353
|
-
if (!
|
|
1628
|
+
if (!Pe(t, e))
|
|
1354
1629
|
return [];
|
|
1355
|
-
const o =
|
|
1356
|
-
const
|
|
1357
|
-
return
|
|
1358
|
-
const y = e.spec.axesSpec[d].domain,
|
|
1359
|
-
return Object.entries(
|
|
1360
|
-
if ((y == null ? void 0 : y[
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1630
|
+
const o = r.map((u) => n.filter((f) => G(f, u))), a = rt(o), c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), m = a.map((u) => {
|
|
1631
|
+
const f = /* @__PURE__ */ new Set();
|
|
1632
|
+
return u.map((p, d) => {
|
|
1633
|
+
const y = e.spec.axesSpec[d].domain, g = p.domain;
|
|
1634
|
+
return Object.entries(g ?? {}).forEach(([v, w]) => {
|
|
1635
|
+
if ((y == null ? void 0 : y[v]) === void 0) {
|
|
1636
|
+
const x = JSON.stringify([v, w]);
|
|
1637
|
+
f.add(x), c.add(x);
|
|
1363
1638
|
}
|
|
1364
1639
|
}), {
|
|
1365
|
-
...
|
|
1640
|
+
...p,
|
|
1366
1641
|
annotations: e.spec.axesSpec[d].annotations
|
|
1367
1642
|
};
|
|
1368
|
-
}),
|
|
1643
|
+
}), f;
|
|
1369
1644
|
});
|
|
1370
|
-
return [...c].forEach((
|
|
1371
|
-
|
|
1372
|
-
}),
|
|
1373
|
-
var
|
|
1374
|
-
const
|
|
1375
|
-
var
|
|
1376
|
-
return (
|
|
1377
|
-
}).join(" / "),
|
|
1645
|
+
return [...c].forEach((u) => {
|
|
1646
|
+
m.some((f) => !f.has(u)) && l.add(u);
|
|
1647
|
+
}), a.map((u, f) => {
|
|
1648
|
+
var v;
|
|
1649
|
+
const p = nt(e.id, u.map((w) => w.domain)), d = ((v = e.spec.annotations) == null ? void 0 : v[he]) ?? "", y = [...m[f]].filter((w) => l.has(w)).sort().map((w) => {
|
|
1650
|
+
var x;
|
|
1651
|
+
return (x = JSON.parse(w)) == null ? void 0 : x[1];
|
|
1652
|
+
}).join(" / "), g = {
|
|
1378
1653
|
...e.spec.annotations,
|
|
1379
|
-
[
|
|
1654
|
+
[it]: "true"
|
|
1380
1655
|
};
|
|
1381
|
-
return (d || y) && (
|
|
1382
|
-
id:
|
|
1656
|
+
return (d || y) && (g[he] = d && y ? d + " / " + y : d + y), {
|
|
1657
|
+
id: p,
|
|
1383
1658
|
spec: {
|
|
1384
1659
|
...e.spec,
|
|
1385
|
-
axesSpec:
|
|
1386
|
-
...
|
|
1387
|
-
annotations: e.spec.axesSpec[
|
|
1660
|
+
axesSpec: u.map((w, x) => ({
|
|
1661
|
+
...w,
|
|
1662
|
+
annotations: e.spec.axesSpec[x].annotations
|
|
1388
1663
|
})),
|
|
1389
|
-
annotations:
|
|
1664
|
+
annotations: g
|
|
1390
1665
|
},
|
|
1391
1666
|
data: e.data
|
|
1392
1667
|
};
|
|
1393
1668
|
});
|
|
1394
1669
|
}
|
|
1395
|
-
function
|
|
1670
|
+
function ot(t) {
|
|
1396
1671
|
const e = [];
|
|
1397
1672
|
for (let n = 0; n < t.length; n++)
|
|
1398
|
-
for (let
|
|
1399
|
-
const i = t[n],
|
|
1673
|
+
for (let r = n + 1; r < t.length; r++) {
|
|
1674
|
+
const i = t[n], s = t[r];
|
|
1400
1675
|
e.push(
|
|
1401
|
-
...
|
|
1402
|
-
...
|
|
1676
|
+
...ge(i, s),
|
|
1677
|
+
...ge(s, i)
|
|
1403
1678
|
);
|
|
1404
1679
|
}
|
|
1405
1680
|
return e;
|
|
1406
1681
|
}
|
|
1407
|
-
function
|
|
1682
|
+
function at(t, e) {
|
|
1408
1683
|
const n = [...t];
|
|
1409
|
-
for (const
|
|
1684
|
+
for (const r of e)
|
|
1410
1685
|
for (const i of t) {
|
|
1411
|
-
if (i.id ===
|
|
1686
|
+
if (i.id === r.id)
|
|
1412
1687
|
break;
|
|
1413
|
-
if (
|
|
1414
|
-
n.push(
|
|
1688
|
+
if (Pe(i, r)) {
|
|
1689
|
+
n.push(r);
|
|
1415
1690
|
break;
|
|
1416
1691
|
}
|
|
1417
1692
|
}
|
|
1418
1693
|
return n;
|
|
1419
1694
|
}
|
|
1420
|
-
const
|
|
1695
|
+
const lt = [
|
|
1421
1696
|
"Int",
|
|
1422
1697
|
"Long",
|
|
1423
1698
|
"Float",
|
|
@@ -1425,15 +1700,15 @@ const et = [
|
|
|
1425
1700
|
"String",
|
|
1426
1701
|
"Bytes"
|
|
1427
1702
|
];
|
|
1428
|
-
function
|
|
1703
|
+
function Ht(t, e) {
|
|
1429
1704
|
if (e === void 0) return;
|
|
1430
|
-
const n = t.resultPool.getData().entries.map((
|
|
1705
|
+
const n = t.resultPool.getData().entries.map((s) => s.obj).filter(M).filter((s) => lt.includes(s.spec.valueType)), r = at(e, n), i = [...r, ...ot(r)];
|
|
1431
1706
|
if (!i.some(
|
|
1432
|
-
(
|
|
1707
|
+
(s) => s.data instanceof I && !s.data.getIsReadyOrError()
|
|
1433
1708
|
))
|
|
1434
1709
|
return t.createPFrame(i);
|
|
1435
1710
|
}
|
|
1436
|
-
class
|
|
1711
|
+
class qt {
|
|
1437
1712
|
constructor(e) {
|
|
1438
1713
|
this.handle = e;
|
|
1439
1714
|
}
|
|
@@ -1453,101 +1728,103 @@ class Bt {
|
|
|
1453
1728
|
return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
|
|
1454
1729
|
}
|
|
1455
1730
|
}
|
|
1456
|
-
function
|
|
1457
|
-
return
|
|
1731
|
+
function ut(t) {
|
|
1732
|
+
return ye({
|
|
1458
1733
|
__isRef: !0,
|
|
1459
|
-
blockId:
|
|
1460
|
-
name:
|
|
1734
|
+
blockId: X(t, "blockId"),
|
|
1735
|
+
name: X(t, "name")
|
|
1461
1736
|
});
|
|
1462
1737
|
}
|
|
1463
|
-
function
|
|
1464
|
-
return
|
|
1465
|
-
ref:
|
|
1466
|
-
label:
|
|
1738
|
+
function zt(t) {
|
|
1739
|
+
return ye({
|
|
1740
|
+
ref: ut(X(t, "ref")),
|
|
1741
|
+
label: X(t, "label")
|
|
1467
1742
|
});
|
|
1468
1743
|
}
|
|
1469
|
-
const
|
|
1470
|
-
sdkVersion:
|
|
1744
|
+
const Yt = {
|
|
1745
|
+
sdkVersion: U
|
|
1471
1746
|
};
|
|
1472
|
-
function
|
|
1473
|
-
return
|
|
1747
|
+
function Xt() {
|
|
1748
|
+
return be({ sdkVersion: U });
|
|
1474
1749
|
}
|
|
1475
|
-
function
|
|
1750
|
+
function Qt(t) {
|
|
1476
1751
|
if (typeof globalThis.getEnvironmentValue == "function")
|
|
1477
1752
|
return globalThis.getEnvironmentValue(t);
|
|
1478
1753
|
}
|
|
1479
1754
|
export {
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1755
|
+
gt as Args,
|
|
1756
|
+
_ as BlockModel,
|
|
1757
|
+
Yt as CurrentSdkInfo,
|
|
1483
1758
|
S as FutureRef,
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1759
|
+
it as IS_VIRTUAL_COLUMN,
|
|
1760
|
+
mt as It,
|
|
1761
|
+
Bt as JsRenderInternal,
|
|
1762
|
+
he as LABEL_ANNOTATION,
|
|
1763
|
+
yt as MainOutputs,
|
|
1764
|
+
je as OutputError,
|
|
1765
|
+
Ue as PAnnotationLabel,
|
|
1766
|
+
Me as PAnnotationTrace,
|
|
1767
|
+
qt as PFrameImpl,
|
|
1768
|
+
O as RT_BINARY_PARTITIONED,
|
|
1769
|
+
B as RT_BINARY_SUPER_PARTITIONED,
|
|
1770
|
+
N as RT_JSON_PARTITIONED,
|
|
1771
|
+
ee as RT_JSON_SUPER_PARTITIONED,
|
|
1772
|
+
Q as RT_RESOURCE_MAP,
|
|
1773
|
+
Z as RT_RESOURCE_MAP_PARTITIONED,
|
|
1774
|
+
z as RenderCtx,
|
|
1775
|
+
et as ResultPool,
|
|
1776
|
+
bt as StagingOutputs,
|
|
1777
|
+
We as Trace,
|
|
1778
|
+
Ge as TraceEntry,
|
|
1504
1779
|
I as TreeNodeAccessor,
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
W as
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1780
|
+
vt as UiState,
|
|
1781
|
+
It as and,
|
|
1782
|
+
Ht as createPFrameForGraphs,
|
|
1783
|
+
Gt as createPlDataTable,
|
|
1784
|
+
Wt as createPlDataTableSheet,
|
|
1785
|
+
de as deriveLabels,
|
|
1786
|
+
se as downgradeCfgOrLambda,
|
|
1787
|
+
at as enrichColumnsWithCompatible,
|
|
1788
|
+
jt as extractArchiveAndGetURL,
|
|
1789
|
+
Mt as extractConfig,
|
|
1790
|
+
Xe as filterDataInfoEntries,
|
|
1791
|
+
St as flatten,
|
|
1792
|
+
zt as fromPlOption,
|
|
1793
|
+
ut as fromPlRef,
|
|
1794
|
+
ot as getAdditionalColumns,
|
|
1795
|
+
Rt as getBlobContent,
|
|
1796
|
+
Dt as getBlobContentAsJson,
|
|
1797
|
+
kt as getBlobContentAsString,
|
|
1798
|
+
Et as getDownloadedBlobContent,
|
|
1799
|
+
Qt as getEnvironmentValue,
|
|
1800
|
+
W as getFromCfg,
|
|
1801
|
+
Y as getImmediate,
|
|
1802
|
+
Vt as getImportProgress,
|
|
1803
|
+
X as getJsonField,
|
|
1804
|
+
Kt as getLastLogs,
|
|
1805
|
+
Nt as getLogHandle,
|
|
1806
|
+
Ot as getOnDemandBlobContent,
|
|
1807
|
+
ze as getPartitionKeysList,
|
|
1808
|
+
$t as getProgressLog,
|
|
1809
|
+
Jt as getProgressLogWithInfo,
|
|
1810
|
+
Xt as getRawPlatformaInstance,
|
|
1811
|
+
Lt as getResourceField,
|
|
1812
|
+
Tt as getResourceValueAsJson,
|
|
1813
|
+
Ye as getUniquePartitionKeys,
|
|
1814
|
+
ie as ifDef,
|
|
1815
|
+
tt as isConfigLambda,
|
|
1816
|
+
Pt as isEmpty,
|
|
1817
|
+
ht as isolate,
|
|
1818
|
+
wt as makeArray,
|
|
1819
|
+
ye as makeObject,
|
|
1820
|
+
At as mapArrayValues,
|
|
1821
|
+
xt as mapRecordValues,
|
|
1822
|
+
Ft as mapResourceFields,
|
|
1823
|
+
_t as not,
|
|
1824
|
+
Ct as or,
|
|
1825
|
+
le as parsePColumnData,
|
|
1826
|
+
Ut as parseResourceMap,
|
|
1827
|
+
Ve as readOutput,
|
|
1828
|
+
ft as wrapOutputs
|
|
1552
1829
|
};
|
|
1553
1830
|
//# sourceMappingURL=index.mjs.map
|