@platforma-sdk/model 1.24.10 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +676 -609
- package/dist/index.mjs.map +1 -1
- package/dist/render/api.d.ts +18 -7
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/split_selectors.d.ts +14 -0
- package/dist/render/split_selectors.d.ts.map +1 -0
- package/dist/render/util/index.d.ts +1 -1
- package/dist/render/util/label.d.ts +7 -1
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/render/util/{resource_map.d.ts → pcolumn_data.d.ts} +1 -1
- package/dist/render/util/{resource_map.d.ts.map → pcolumn_data.d.ts.map} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/render/api.ts +163 -53
- package/src/render/split_selectors.ts +15 -0
- package/src/render/util/index.ts +1 -1
- package/src/render/util/label.ts +31 -3
- /package/src/render/util/{resource_map.ts → pcolumn_data.ts} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { isPColumn as
|
|
1
|
+
var we = Object.defineProperty;
|
|
2
|
+
var Ie = (t, e, n) => e in t ? we(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var x = (t, e, n) => Ie(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { isPColumn as V, mapPObjectData as K, selectorsToPredicate as ae, AnchoredIdDeriver as Y, isPlRef as Pe, resolveAnchors as le, isPColumnSpec as J, getAxisId as T, canonicalizeAxisId as Ce, mapValueInVOE as xe, ensurePColumn as Te, extractAllColumns as Re, mapPTableDef as Fe, matchAxisId as N } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
|
-
import { z as
|
|
7
|
-
class
|
|
6
|
+
import { z as E } from "zod";
|
|
7
|
+
class Le 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 De(t) {
|
|
13
|
+
if (!t.ok) throw new Le(t.errors, t.moreErrors);
|
|
14
14
|
return t.value;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function rt(t) {
|
|
17
17
|
return new Proxy(t, {
|
|
18
18
|
get(e, n) {
|
|
19
|
-
return
|
|
19
|
+
return De(e[n]);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ?
|
|
23
|
+
function b(t) {
|
|
24
|
+
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? W(t) : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function U(t) {
|
|
27
27
|
return { type: "GetFromCtx", variable: t };
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function ot(t) {
|
|
30
30
|
return {
|
|
31
31
|
type: "Isolate",
|
|
32
32
|
cfg: t
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
35
|
+
const at = U("$args"), lt = U("$it"), ut = U("$prod"), ct = U("$staging"), pt = U("$ui");
|
|
36
|
+
function W(t) {
|
|
37
37
|
return { type: "Immediate", value: t };
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ge(t) {
|
|
40
40
|
const e = {};
|
|
41
|
-
for (const [n, s] of Object.entries(t)) e[n] =
|
|
41
|
+
for (const [n, s] of Object.entries(t)) e[n] = b(s);
|
|
42
42
|
return {
|
|
43
43
|
type: "MakeObject",
|
|
44
44
|
template: e
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function dt(...t) {
|
|
48
48
|
const e = [];
|
|
49
|
-
for (const n of t) e.push(
|
|
49
|
+
for (const n of t) e.push(b(n));
|
|
50
50
|
return {
|
|
51
51
|
type: "MakeArray",
|
|
52
52
|
template: e
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function H(t, e) {
|
|
56
56
|
return {
|
|
57
57
|
type: "GetJsonField",
|
|
58
|
-
source:
|
|
59
|
-
field:
|
|
58
|
+
source: b(t),
|
|
59
|
+
field: b(e)
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function ft(t, e, n = "$it") {
|
|
63
63
|
return {
|
|
64
64
|
type: "MapRecordValues",
|
|
65
65
|
source: t,
|
|
@@ -67,7 +67,7 @@ function at(t, e, n = "$it") {
|
|
|
67
67
|
itVar: n
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ht(t, e, n = "$it") {
|
|
71
71
|
return {
|
|
72
72
|
type: "MapArrayValues",
|
|
73
73
|
source: t,
|
|
@@ -75,54 +75,54 @@ function lt(t, e, n = "$it") {
|
|
|
75
75
|
itVar: n
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function gt(t) {
|
|
79
79
|
return {
|
|
80
80
|
type: "Flatten",
|
|
81
81
|
source: t
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function mt(t) {
|
|
85
85
|
return {
|
|
86
86
|
type: "IsEmpty",
|
|
87
87
|
arg: t
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function yt(t) {
|
|
91
91
|
return {
|
|
92
92
|
type: "Not",
|
|
93
93
|
operand: t
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function bt(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 vt(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 _t(t, e) {
|
|
111
111
|
return {
|
|
112
112
|
type: "GetResourceField",
|
|
113
|
-
source:
|
|
114
|
-
field:
|
|
113
|
+
source: b(t),
|
|
114
|
+
field: b(e)
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function At() {
|
|
118
118
|
return function(t) {
|
|
119
119
|
return {
|
|
120
120
|
type: "GetResourceValueAsJson",
|
|
121
|
-
source:
|
|
121
|
+
source: b(t)
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function St(t, e, n = "$it") {
|
|
126
126
|
return {
|
|
127
127
|
type: "MapResourceFields",
|
|
128
128
|
source: t,
|
|
@@ -130,120 +130,120 @@ function mt(t, e, n = "$it") {
|
|
|
130
130
|
itVar: n
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function wt(t) {
|
|
134
134
|
return {
|
|
135
135
|
type: "GetBlobContent",
|
|
136
|
-
source:
|
|
136
|
+
source: b(t)
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function It(t) {
|
|
140
140
|
return {
|
|
141
141
|
type: "GetBlobContentAsString",
|
|
142
|
-
source:
|
|
142
|
+
source: b(t)
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Pt() {
|
|
146
146
|
return function(t) {
|
|
147
147
|
return {
|
|
148
148
|
type: "GetBlobContentAsJson",
|
|
149
|
-
source:
|
|
149
|
+
source: b(t)
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Ct(t) {
|
|
154
154
|
return {
|
|
155
155
|
type: "GetDownloadedBlobContent",
|
|
156
|
-
source:
|
|
156
|
+
source: b(t)
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function xt(t) {
|
|
160
160
|
return {
|
|
161
161
|
type: "GetOnDemandBlobContent",
|
|
162
|
-
source:
|
|
162
|
+
source: b(t)
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function Tt(t, e) {
|
|
166
166
|
return {
|
|
167
167
|
type: "ExtractArchiveAndGetURL",
|
|
168
168
|
format: e,
|
|
169
|
-
source:
|
|
169
|
+
source: b(t)
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Rt(t) {
|
|
173
173
|
return {
|
|
174
174
|
type: "GetImportProgress",
|
|
175
|
-
source:
|
|
175
|
+
source: b(t)
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function Ft(t, e) {
|
|
179
179
|
return {
|
|
180
180
|
type: "GetLastLogs",
|
|
181
|
-
source:
|
|
181
|
+
source: b(t),
|
|
182
182
|
lines: e
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Lt(t, e) {
|
|
186
186
|
return {
|
|
187
187
|
type: "GetProgressLog",
|
|
188
|
-
source:
|
|
188
|
+
source: b(t),
|
|
189
189
|
patternToSearch: e
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function Dt(t, e) {
|
|
193
193
|
return {
|
|
194
194
|
type: "GetProgressLogWithInfo",
|
|
195
|
-
source:
|
|
195
|
+
source: b(t),
|
|
196
196
|
patternToSearch: e
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function kt(t) {
|
|
200
200
|
return {
|
|
201
201
|
type: "GetLogHandle",
|
|
202
|
-
source:
|
|
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 me(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 Ee() {
|
|
215
215
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function g() {
|
|
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 $(t, e) {
|
|
222
|
+
const n = Ee();
|
|
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 s of
|
|
227
|
+
const X = /* @__PURE__ */ new Map();
|
|
228
|
+
function Oe(t, e) {
|
|
229
|
+
t in g().callbackRegistry || (g().callbackRegistry[t] = (n) => {
|
|
230
|
+
for (const s of X.get(t))
|
|
231
231
|
s(n);
|
|
232
|
-
},
|
|
232
|
+
}, X.set(t, [])), X.get(t).push(e);
|
|
233
233
|
}
|
|
234
|
-
class
|
|
234
|
+
class S {
|
|
235
235
|
constructor(e, n = (s) => s) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
this.handle = e, this.postProcess = n,
|
|
236
|
+
x(this, "isResolved", !1);
|
|
237
|
+
x(this, "resolvedValue");
|
|
238
|
+
this.handle = e, this.postProcess = n, Oe(e, (s) => {
|
|
239
239
|
this.resolvedValue = n(s), this.isResolved = !0;
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
map(e) {
|
|
243
|
-
return new
|
|
243
|
+
return new S(this.handle, (n) => e(this.postProcess(n)));
|
|
244
244
|
}
|
|
245
245
|
mapDefined(e) {
|
|
246
|
-
return new
|
|
246
|
+
return new S(this.handle, (n) => {
|
|
247
247
|
const s = this.postProcess(n);
|
|
248
248
|
return s ? e(s) : void 0;
|
|
249
249
|
});
|
|
@@ -252,10 +252,10 @@ class _ {
|
|
|
252
252
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function se(t, e) {
|
|
256
256
|
return t === void 0 ? void 0 : e(t);
|
|
257
257
|
}
|
|
258
|
-
class
|
|
258
|
+
class I {
|
|
259
259
|
constructor(e, n) {
|
|
260
260
|
this.handle = e, this.resolvePath = n;
|
|
261
261
|
}
|
|
@@ -292,49 +292,49 @@ class S {
|
|
|
292
292
|
resolveWithCommon(e, ...n) {
|
|
293
293
|
const s = [
|
|
294
294
|
...this.resolvePath,
|
|
295
|
-
...n.map((
|
|
295
|
+
...n.map((i) => typeof i == "string" ? i : i.field)
|
|
296
296
|
];
|
|
297
|
-
return
|
|
298
|
-
|
|
299
|
-
(
|
|
297
|
+
return se(
|
|
298
|
+
g().resolveWithCommon(this.handle, e, ...n),
|
|
299
|
+
(i) => new I(i, s)
|
|
300
300
|
);
|
|
301
301
|
}
|
|
302
302
|
get resourceType() {
|
|
303
|
-
return
|
|
303
|
+
return g().getResourceType(this.handle);
|
|
304
304
|
}
|
|
305
305
|
getInputsLocked() {
|
|
306
|
-
return
|
|
306
|
+
return g().getInputsLocked(this.handle);
|
|
307
307
|
}
|
|
308
308
|
getOutputsLocked() {
|
|
309
|
-
return
|
|
309
|
+
return g().getOutputsLocked(this.handle);
|
|
310
310
|
}
|
|
311
311
|
getIsReadyOrError() {
|
|
312
|
-
return
|
|
312
|
+
return g().getIsReadyOrError(this.handle);
|
|
313
313
|
}
|
|
314
314
|
getIsFinal() {
|
|
315
|
-
return
|
|
315
|
+
return g().getIsFinal(this.handle);
|
|
316
316
|
}
|
|
317
317
|
getError() {
|
|
318
318
|
const e = [...this.resolvePath, "error"];
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
(n) => new
|
|
319
|
+
return se(
|
|
320
|
+
g().getError(this.handle),
|
|
321
|
+
(n) => new I(n, e)
|
|
322
322
|
);
|
|
323
323
|
}
|
|
324
324
|
listInputFields() {
|
|
325
|
-
return
|
|
325
|
+
return g().listInputFields(this.handle);
|
|
326
326
|
}
|
|
327
327
|
listOutputFields() {
|
|
328
|
-
return
|
|
328
|
+
return g().listOutputFields(this.handle);
|
|
329
329
|
}
|
|
330
330
|
listDynamicFields() {
|
|
331
|
-
return
|
|
331
|
+
return g().listDynamicFields(this.handle);
|
|
332
332
|
}
|
|
333
333
|
getKeyValueBase64(e) {
|
|
334
|
-
return
|
|
334
|
+
return g().getKeyValueBase64(this.handle, e);
|
|
335
335
|
}
|
|
336
336
|
getKeyValueAsString(e) {
|
|
337
|
-
return
|
|
337
|
+
return g().getKeyValueAsString(this.handle, e);
|
|
338
338
|
}
|
|
339
339
|
getKeyValueAsJson(e) {
|
|
340
340
|
const n = this.getKeyValueAsString(e);
|
|
@@ -342,10 +342,10 @@ class S {
|
|
|
342
342
|
return JSON.parse(n);
|
|
343
343
|
}
|
|
344
344
|
getDataBase64() {
|
|
345
|
-
return
|
|
345
|
+
return g().getDataBase64(this.handle);
|
|
346
346
|
}
|
|
347
347
|
getDataAsString() {
|
|
348
|
-
return
|
|
348
|
+
return g().getDataAsString(this.handle);
|
|
349
349
|
}
|
|
350
350
|
getDataAsJson() {
|
|
351
351
|
const e = this.getDataAsString();
|
|
@@ -357,38 +357,38 @@ class S {
|
|
|
357
357
|
*/
|
|
358
358
|
getPColumns(e = !1, n = "") {
|
|
359
359
|
const s = this.parsePObjectCollection(e, n);
|
|
360
|
-
return s === void 0 ? void 0 : Object.entries(s).map(([,
|
|
361
|
-
if (!
|
|
362
|
-
return
|
|
360
|
+
return s === void 0 ? void 0 : Object.entries(s).map(([, r]) => {
|
|
361
|
+
if (!V(r)) throw new Error(`not a PColumn (kind = ${r.spec.kind})`);
|
|
362
|
+
return r;
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
/**
|
|
366
366
|
*
|
|
367
367
|
*/
|
|
368
368
|
parsePObjectCollection(e = !1, n = "") {
|
|
369
|
-
const s =
|
|
369
|
+
const s = g().parsePObjectCollection(
|
|
370
370
|
this.handle,
|
|
371
371
|
e,
|
|
372
372
|
n,
|
|
373
373
|
...this.resolvePath
|
|
374
374
|
);
|
|
375
375
|
if (s === void 0) return;
|
|
376
|
-
const
|
|
377
|
-
for (const [
|
|
378
|
-
const
|
|
379
|
-
r
|
|
376
|
+
const i = {};
|
|
377
|
+
for (const [r, o] of Object.entries(s)) {
|
|
378
|
+
const u = [...this.resolvePath, r];
|
|
379
|
+
i[r] = K(o, (c) => new I(c, u));
|
|
380
380
|
}
|
|
381
|
-
return
|
|
381
|
+
return i;
|
|
382
382
|
}
|
|
383
383
|
getFileContentAsBase64() {
|
|
384
|
-
return new
|
|
384
|
+
return new S(g().getBlobContentAsBase64(this.handle));
|
|
385
385
|
}
|
|
386
386
|
getFileContentAsString() {
|
|
387
|
-
return new
|
|
387
|
+
return new S(g().getBlobContentAsString(this.handle));
|
|
388
388
|
}
|
|
389
389
|
getFileContentAsJson() {
|
|
390
|
-
return new
|
|
391
|
-
|
|
390
|
+
return new S(
|
|
391
|
+
g().getBlobContentAsString(this.handle)
|
|
392
392
|
).mapDefined((e) => JSON.parse(e));
|
|
393
393
|
}
|
|
394
394
|
/**
|
|
@@ -407,7 +407,7 @@ class S {
|
|
|
407
407
|
* @returns downloaded file handle
|
|
408
408
|
*/
|
|
409
409
|
getFileHandle() {
|
|
410
|
-
return new
|
|
410
|
+
return new S(g().getDownloadedBlobContentHandle(this.handle));
|
|
411
411
|
}
|
|
412
412
|
/**
|
|
413
413
|
* @deprecated use getFileHandle
|
|
@@ -419,7 +419,7 @@ class S {
|
|
|
419
419
|
* @returns downloaded file handle
|
|
420
420
|
*/
|
|
421
421
|
getRemoteFileHandle() {
|
|
422
|
-
return new
|
|
422
|
+
return new S(g().getOnDemandBlobContentHandle(this.handle));
|
|
423
423
|
}
|
|
424
424
|
/**
|
|
425
425
|
* @deprecated use getRemoteFileHandle
|
|
@@ -431,22 +431,22 @@ class S {
|
|
|
431
431
|
* @returns the url to the extracted folder
|
|
432
432
|
*/
|
|
433
433
|
extractArchiveAndGetURL(e) {
|
|
434
|
-
return new
|
|
434
|
+
return new S(g().extractArchiveAndGetURL(this.handle, e));
|
|
435
435
|
}
|
|
436
436
|
getImportProgress() {
|
|
437
|
-
return new
|
|
437
|
+
return new S(g().getImportProgress(this.handle));
|
|
438
438
|
}
|
|
439
439
|
getLastLogs(e) {
|
|
440
|
-
return new
|
|
440
|
+
return new S(g().getLastLogs(this.handle, e));
|
|
441
441
|
}
|
|
442
442
|
getProgressLog(e) {
|
|
443
|
-
return new
|
|
443
|
+
return new S(g().getProgressLog(this.handle, e));
|
|
444
444
|
}
|
|
445
445
|
getProgressLogWithInfo(e) {
|
|
446
|
-
return new
|
|
446
|
+
return new S(g().getProgressLogWithInfo(this.handle, e));
|
|
447
447
|
}
|
|
448
448
|
getLogHandle() {
|
|
449
|
-
return new
|
|
449
|
+
return new S(g().getLogHandle(this.handle));
|
|
450
450
|
}
|
|
451
451
|
allFieldsResolved(e = "Input") {
|
|
452
452
|
switch (e) {
|
|
@@ -461,113 +461,240 @@ class S {
|
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
mapFields(e, n) {
|
|
464
|
-
const { fieldType: s, requireLocked:
|
|
464
|
+
const { fieldType: s, requireLocked: i, skipUnresolved: r } = {
|
|
465
465
|
fieldType: "Input",
|
|
466
466
|
requireLocked: !0,
|
|
467
467
|
skipUnresolved: !1,
|
|
468
468
|
...n
|
|
469
469
|
}, o = e;
|
|
470
|
-
if (
|
|
470
|
+
if (i && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
|
|
471
471
|
return;
|
|
472
|
-
let
|
|
473
|
-
(
|
|
472
|
+
let c = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
473
|
+
(a) => [a, this.resolve({ field: a, assertFieldType: s })]
|
|
474
474
|
);
|
|
475
|
-
return
|
|
475
|
+
return r && (c = c.filter((a) => a[1] !== void 0)), c.map(([a, h]) => o(a, h));
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
const
|
|
478
|
+
const ye = "staging", be = "main", je = {
|
|
479
479
|
inlineColumnsSupport: !0,
|
|
480
480
|
activeArgs: !0
|
|
481
481
|
};
|
|
482
|
-
function
|
|
482
|
+
function ve(t) {
|
|
483
483
|
return typeof t == "object" && t !== null && "__awaited_futures__" in t;
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function ie(t, e, n) {
|
|
486
486
|
if (e.has(n)) return;
|
|
487
487
|
if (e.add(n), typeof n === "object")
|
|
488
|
-
if (
|
|
488
|
+
if (ve(n)) n.__awaited_futures__.forEach((i) => t.add(i));
|
|
489
489
|
else if (Array.isArray(n))
|
|
490
|
-
for (const
|
|
490
|
+
for (const i of n) ie(t, e, i);
|
|
491
491
|
else
|
|
492
|
-
for (const [,
|
|
493
|
-
|
|
492
|
+
for (const [, i] of Object.entries(n))
|
|
493
|
+
i !== n && ie(t, e, i);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ve(t) {
|
|
496
496
|
const e = /* @__PURE__ */ new Set();
|
|
497
|
-
return
|
|
497
|
+
return ie(e, /* @__PURE__ */ new Set(), t), e;
|
|
498
498
|
}
|
|
499
|
-
const
|
|
499
|
+
const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
500
500
|
__proto__: null,
|
|
501
|
-
GlobalCfgRenderCtxFeatureFlags:
|
|
502
|
-
MainAccessorName:
|
|
503
|
-
StagingAccessorName:
|
|
504
|
-
getAllFutureAwaits:
|
|
505
|
-
isFutureAwait:
|
|
506
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
507
|
-
type:
|
|
508
|
-
importance:
|
|
509
|
-
id:
|
|
510
|
-
label:
|
|
511
|
-
}),
|
|
512
|
-
function
|
|
513
|
-
const s = /* @__PURE__ */ new Map(),
|
|
514
|
-
var
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
501
|
+
GlobalCfgRenderCtxFeatureFlags: je,
|
|
502
|
+
MainAccessorName: be,
|
|
503
|
+
StagingAccessorName: ye,
|
|
504
|
+
getAllFutureAwaits: Ve,
|
|
505
|
+
isFutureAwait: ve
|
|
506
|
+
}, Symbol.toStringTag, { value: "Module" })), Ne = "pl7.app/label", Ue = "pl7.app/trace", Be = E.object({
|
|
507
|
+
type: E.string(),
|
|
508
|
+
importance: E.number().optional(),
|
|
509
|
+
id: E.string().optional(),
|
|
510
|
+
label: E.string()
|
|
511
|
+
}), Me = E.array(Be), Je = 1e-3, $e = "__LABEL__", ue = "__LABEL__@1";
|
|
512
|
+
function Q(t, e, n = {}) {
|
|
513
|
+
const s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), r = t.map((l) => {
|
|
514
|
+
var F, M;
|
|
515
|
+
const f = e(l);
|
|
516
|
+
let d, y, _;
|
|
517
|
+
"spec" in f && typeof f.spec == "object" ? (d = f.spec, y = f.prefixTrace, _ = f.suffixTrace) : d = f;
|
|
518
|
+
const A = (F = d.annotations) == null ? void 0 : F[Ne], v = (M = d.annotations) == null ? void 0 : M[Ue], m = (v ? Me.safeParse(JSON.parse(v)).data : void 0) ?? [], w = [
|
|
519
|
+
...y ?? [],
|
|
520
|
+
...m,
|
|
521
|
+
..._ ?? []
|
|
522
|
+
];
|
|
523
|
+
if (A) {
|
|
524
|
+
const C = { label: A, type: $e, importance: -2 };
|
|
525
|
+
n.addLabelAsSuffix ? w.push(C) : w.splice(0, 0, C);
|
|
519
526
|
}
|
|
520
|
-
const
|
|
521
|
-
for (let C =
|
|
522
|
-
const { type:
|
|
523
|
-
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
|
|
527
|
+
const L = [], R = /* @__PURE__ */ new Map();
|
|
528
|
+
for (let C = w.length - 1; C >= 0; --C) {
|
|
529
|
+
const { type: D } = w[C], q = w[C].importance ?? 0, z = (R.get(D) ?? 0) + 1;
|
|
530
|
+
R.set(D, z);
|
|
531
|
+
const O = `${D}@${z}`;
|
|
532
|
+
i.set(O, (i.get(O) ?? 0) + 1), s.set(
|
|
533
|
+
O,
|
|
527
534
|
Math.max(
|
|
528
|
-
s.get(
|
|
529
|
-
|
|
535
|
+
s.get(O) ?? Number.NEGATIVE_INFINITY,
|
|
536
|
+
q - (w.length - C) * Je
|
|
530
537
|
)
|
|
531
|
-
),
|
|
538
|
+
), L.push({ ...w[C], fullType: O, occurenceIndex: z });
|
|
532
539
|
}
|
|
533
|
-
return
|
|
534
|
-
value:
|
|
535
|
-
spec:
|
|
536
|
-
label:
|
|
537
|
-
fullTrace:
|
|
540
|
+
return L.reverse(), {
|
|
541
|
+
value: l,
|
|
542
|
+
spec: d,
|
|
543
|
+
label: A,
|
|
544
|
+
fullTrace: L
|
|
538
545
|
};
|
|
539
|
-
}), o = [],
|
|
540
|
-
|
|
541
|
-
for (const [
|
|
542
|
-
|
|
543
|
-
const
|
|
544
|
-
const
|
|
546
|
+
}), o = [], u = [], c = [...s];
|
|
547
|
+
c.sort(([, l], [, f]) => f - l);
|
|
548
|
+
for (const [l] of c)
|
|
549
|
+
l.endsWith("@1") || i.get(l) === t.length ? o.push(l) : u.push(l);
|
|
550
|
+
const a = (l) => r.map((f) => {
|
|
551
|
+
const d = f.fullTrace.filter((_) => l.has(_.fullType)).map((_) => _.label), y = n.separator ?? " / ";
|
|
545
552
|
return {
|
|
546
|
-
label:
|
|
547
|
-
value:
|
|
553
|
+
label: d.join(y),
|
|
554
|
+
value: f.value
|
|
548
555
|
};
|
|
549
556
|
});
|
|
550
557
|
if (o.length === 0) {
|
|
551
|
-
if (
|
|
552
|
-
return
|
|
553
|
-
}
|
|
554
|
-
let
|
|
555
|
-
for (;
|
|
556
|
-
const
|
|
557
|
-
n.includeNativeLabel &&
|
|
558
|
-
for (let
|
|
559
|
-
|
|
560
|
-
const
|
|
561
|
-
if (new Set(
|
|
562
|
-
|
|
563
|
-
}
|
|
564
|
-
return
|
|
565
|
-
}
|
|
566
|
-
|
|
558
|
+
if (u.length !== 0) throw new Error("Assertion error.");
|
|
559
|
+
return a(new Set(ue));
|
|
560
|
+
}
|
|
561
|
+
let h = 0, p = 0;
|
|
562
|
+
for (; h < o.length; ) {
|
|
563
|
+
const l = /* @__PURE__ */ new Set();
|
|
564
|
+
n.includeNativeLabel && l.add(ue);
|
|
565
|
+
for (let d = 0; d < h; ++d) l.add(o[d]);
|
|
566
|
+
l.add(o[p]);
|
|
567
|
+
const f = a(l);
|
|
568
|
+
if (new Set(f.map((d) => d.label)).size === t.length) return f;
|
|
569
|
+
p++, p == o.length && (h++, p = h);
|
|
570
|
+
}
|
|
571
|
+
return a(/* @__PURE__ */ new Set([...o, ...u]));
|
|
572
|
+
}
|
|
573
|
+
const B = "PColumnData/", re = B + "ResourceMap", oe = B + "Partitioned/ResourceMap", ce = B + "JsonPartitioned", Z = B + "BinaryPartitioned", _e = B + "Partitioned/", pe = _e + "JsonPartitioned", ee = _e + "BinaryPartitioned";
|
|
574
|
+
function Ae(t, e, n, s = [], i) {
|
|
575
|
+
if (t === void 0) return !1;
|
|
576
|
+
switch (t.resourceType.name) {
|
|
577
|
+
case re: {
|
|
578
|
+
let r = t.getInputsLocked();
|
|
579
|
+
for (const o of t.listInputFields()) {
|
|
580
|
+
const u = t.resolve({ field: o, assertFieldType: "Input" }), c = [...s, ...JSON.parse(o)], a = u === void 0 ? void 0 : e(u);
|
|
581
|
+
a === void 0 && (r = !1), (a !== void 0 || i) && n.push({ key: c, value: a });
|
|
582
|
+
}
|
|
583
|
+
return r;
|
|
584
|
+
}
|
|
585
|
+
case oe: {
|
|
586
|
+
let r = t.getInputsLocked();
|
|
587
|
+
for (const o of t.listInputFields()) {
|
|
588
|
+
const u = t.resolve({ field: o, assertFieldType: "Input" });
|
|
589
|
+
if (u === void 0) r = !1;
|
|
590
|
+
else {
|
|
591
|
+
const c = [...s, ...JSON.parse(o)], a = Ae(
|
|
592
|
+
u,
|
|
593
|
+
e,
|
|
594
|
+
n,
|
|
595
|
+
c,
|
|
596
|
+
i
|
|
597
|
+
);
|
|
598
|
+
r = r && a;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
return r;
|
|
602
|
+
}
|
|
603
|
+
default:
|
|
604
|
+
throw new Error(`Unknown resource type: ${t.resourceType.name}`);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
function Ot(t, e, n = !1) {
|
|
608
|
+
const s = [];
|
|
609
|
+
return { isComplete: Ae(t, e, s, [], n), data: s };
|
|
610
|
+
}
|
|
611
|
+
const de = (t) => {
|
|
612
|
+
if (!t.endsWith(".index")) {
|
|
613
|
+
if (t.endsWith(".values"))
|
|
614
|
+
return t.substring(0, t.length - 7);
|
|
615
|
+
throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
function Ge(t) {
|
|
619
|
+
if (!t) return;
|
|
620
|
+
const e = t.resourceType.name, n = t.getDataAsJson(), s = [];
|
|
621
|
+
let i = 0;
|
|
622
|
+
switch (e) {
|
|
623
|
+
case re:
|
|
624
|
+
i = n.keyLength;
|
|
625
|
+
break;
|
|
626
|
+
case oe:
|
|
627
|
+
i = n.partitionKeyLength + n.keyLength;
|
|
628
|
+
break;
|
|
629
|
+
case ce:
|
|
630
|
+
case Z:
|
|
631
|
+
i = n.partitionKeyLength;
|
|
632
|
+
break;
|
|
633
|
+
case ee:
|
|
634
|
+
case pe:
|
|
635
|
+
i = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
switch (e) {
|
|
639
|
+
case re:
|
|
640
|
+
case ce:
|
|
641
|
+
case Z:
|
|
642
|
+
for (let r of t.listInputFields()) {
|
|
643
|
+
if (e === Z) {
|
|
644
|
+
const u = de(r);
|
|
645
|
+
if (u) r = u;
|
|
646
|
+
else continue;
|
|
647
|
+
}
|
|
648
|
+
const o = [...JSON.parse(r)];
|
|
649
|
+
s.push(o);
|
|
650
|
+
}
|
|
651
|
+
break;
|
|
652
|
+
case oe:
|
|
653
|
+
case ee:
|
|
654
|
+
case pe:
|
|
655
|
+
for (const r of t.listInputFields()) {
|
|
656
|
+
const o = [...JSON.parse(r)], u = t.resolve({ field: r, assertFieldType: "Input" });
|
|
657
|
+
if (u !== void 0)
|
|
658
|
+
for (let c of u.listInputFields()) {
|
|
659
|
+
if (e === ee) {
|
|
660
|
+
const h = de(c);
|
|
661
|
+
if (h) c = h;
|
|
662
|
+
else continue;
|
|
663
|
+
}
|
|
664
|
+
const a = [...o, ...JSON.parse(c)];
|
|
665
|
+
s.push(a);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
return { data: s, keyLength: i };
|
|
671
|
+
}
|
|
672
|
+
function We(t) {
|
|
673
|
+
const e = Ge(t);
|
|
674
|
+
if (!e) return;
|
|
675
|
+
const { data: n, keyLength: s } = e, i = [];
|
|
676
|
+
for (let r = 0; r < s; ++r)
|
|
677
|
+
i.push(/* @__PURE__ */ new Set());
|
|
678
|
+
for (const r of n) {
|
|
679
|
+
if (r.length !== s)
|
|
680
|
+
throw new Error("key length does not match partition length");
|
|
681
|
+
for (let o = 0; o < s; ++o)
|
|
682
|
+
i[o].add(r[o]);
|
|
683
|
+
}
|
|
684
|
+
return i.map((r) => Array.from(r.values()));
|
|
685
|
+
}
|
|
686
|
+
function te(t, e) {
|
|
687
|
+
if (t === void 0) return e === void 0;
|
|
688
|
+
if (e === void 0) return !0;
|
|
689
|
+
for (const n in e)
|
|
690
|
+
if (t[n] !== e[n]) return !1;
|
|
691
|
+
return !0;
|
|
692
|
+
}
|
|
693
|
+
class Ke {
|
|
567
694
|
constructor() {
|
|
568
|
-
|
|
695
|
+
x(this, "ctx", g());
|
|
569
696
|
// @TODO: unused, what is this for?
|
|
570
|
-
|
|
697
|
+
x(this, "defaultLabelFn", (e, n) => {
|
|
571
698
|
var s;
|
|
572
699
|
return ((s = e.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
|
|
573
700
|
});
|
|
@@ -579,33 +706,85 @@ class Ue {
|
|
|
579
706
|
return this.ctx.calculateOptions(e);
|
|
580
707
|
}
|
|
581
708
|
getOptions(e, n) {
|
|
582
|
-
const s = typeof e == "function" ? e :
|
|
583
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
584
|
-
ref:
|
|
709
|
+
const s = typeof e == "function" ? e : ae(e), i = this.getSpecs().entries.filter((r) => s(r.obj));
|
|
710
|
+
return typeof n == "object" || typeof n > "u" ? Q(i, (r) => r.obj, n ?? {}).map(({ value: { ref: r }, label: o }) => ({
|
|
711
|
+
ref: r,
|
|
585
712
|
label: o
|
|
586
|
-
})) :
|
|
587
|
-
ref:
|
|
588
|
-
label: n(
|
|
713
|
+
})) : i.map((r) => ({
|
|
714
|
+
ref: r.ref,
|
|
715
|
+
label: n(r.obj, r.ref)
|
|
589
716
|
}));
|
|
590
717
|
}
|
|
591
718
|
// Implementation
|
|
592
719
|
getCanonicalOptions(e, n, s) {
|
|
593
|
-
const
|
|
594
|
-
if (!(e instanceof
|
|
595
|
-
for (const [a,
|
|
596
|
-
if (
|
|
597
|
-
const
|
|
598
|
-
if (!
|
|
720
|
+
const i = {};
|
|
721
|
+
if (!(e instanceof Y))
|
|
722
|
+
for (const [a, h] of Object.entries(e))
|
|
723
|
+
if (Pe(h)) {
|
|
724
|
+
const p = this.getPColumnSpecByRef(h);
|
|
725
|
+
if (!p)
|
|
599
726
|
return;
|
|
600
|
-
|
|
727
|
+
i[a] = p;
|
|
601
728
|
} else
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
Array.isArray(n) ? n.map((a) =>
|
|
605
|
-
), o = this.getSpecs().entries.filter(({ obj: a }) =>
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
729
|
+
i[a] = h;
|
|
730
|
+
const r = typeof n == "function" ? n : ae(
|
|
731
|
+
Array.isArray(n) ? n.map((a) => le(i, a)) : le(i, n)
|
|
732
|
+
), o = this.getSpecs().entries.filter(({ obj: a }) => J(a) ? r(a) : !1);
|
|
733
|
+
if (o.length === 0)
|
|
734
|
+
return [];
|
|
735
|
+
const u = e instanceof Y ? e : new Y(i), c = typeof n == "object" && !Array.isArray(n) && "axes" in n && n.axes !== void 0 && n.partialAxesMatch === void 0 ? n.axes.map((a, h) => "split" in a && a.split === !0 ? h : -1).filter((a) => a !== -1) : [];
|
|
736
|
+
if (c.sort((a, h) => a - h), c.length > 0) {
|
|
737
|
+
const a = [], h = c[c.length - 1];
|
|
738
|
+
for (const { ref: l, obj: f } of o) {
|
|
739
|
+
if (!J(f)) continue;
|
|
740
|
+
const d = this.getDataByRef(l);
|
|
741
|
+
if (!d || !V(d)) continue;
|
|
742
|
+
const y = We(d.data);
|
|
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]);
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
const L = c[w], R = y[L];
|
|
752
|
+
for (const F of R)
|
|
753
|
+
m.push(F), v(m, w + 1), m.pop();
|
|
754
|
+
};
|
|
755
|
+
v([], 0);
|
|
756
|
+
for (const m of A) {
|
|
757
|
+
const w = m.map((R, F) => {
|
|
758
|
+
const M = c[F], C = Ce(T(f.axesSpec[M])), D = _[F], q = (D == null ? void 0 : D[R]) ?? String(R);
|
|
759
|
+
return {
|
|
760
|
+
type: `split:${C}`,
|
|
761
|
+
label: q,
|
|
762
|
+
importance: 1e6
|
|
763
|
+
};
|
|
764
|
+
}), L = c.map((R, F) => [R, m[F]]);
|
|
765
|
+
a.push({
|
|
766
|
+
obj: f,
|
|
767
|
+
ref: l,
|
|
768
|
+
filteringTrace: w,
|
|
769
|
+
filters: L
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return Q(
|
|
774
|
+
a,
|
|
775
|
+
(l) => ({
|
|
776
|
+
spec: l.obj,
|
|
777
|
+
suffixTrace: l.filteringTrace
|
|
778
|
+
}),
|
|
779
|
+
s ?? {}
|
|
780
|
+
).map((l) => ({
|
|
781
|
+
value: u.deriveS(l.value.obj, l.value.filters),
|
|
782
|
+
label: l.label
|
|
783
|
+
}));
|
|
784
|
+
}
|
|
785
|
+
return Q(o, (a) => a.obj, s ?? {}).map(({ value: { obj: a }, label: h }) => ({
|
|
786
|
+
value: u.deriveS(a),
|
|
787
|
+
label: h
|
|
609
788
|
}));
|
|
610
789
|
}
|
|
611
790
|
/**
|
|
@@ -622,7 +801,7 @@ class Ue {
|
|
|
622
801
|
ref: n.ref,
|
|
623
802
|
obj: {
|
|
624
803
|
...n.obj,
|
|
625
|
-
data: new
|
|
804
|
+
data: new I(n.obj.data, [n.ref.blockId, n.ref.name])
|
|
626
805
|
}
|
|
627
806
|
}))
|
|
628
807
|
};
|
|
@@ -641,9 +820,9 @@ class Ue {
|
|
|
641
820
|
ref: n.ref,
|
|
642
821
|
obj: {
|
|
643
822
|
...n.obj,
|
|
644
|
-
data:
|
|
823
|
+
data: xe(
|
|
645
824
|
n.obj.data,
|
|
646
|
-
(s) => new
|
|
825
|
+
(s) => new I(s, [n.ref.blockId, n.ref.name])
|
|
647
826
|
)
|
|
648
827
|
}
|
|
649
828
|
}))
|
|
@@ -666,9 +845,9 @@ class Ue {
|
|
|
666
845
|
var n;
|
|
667
846
|
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
668
847
|
(s) => s.ref.blockId === e.blockId && s.ref.name === e.name
|
|
669
|
-
)) == null ? void 0 : n.obj :
|
|
848
|
+
)) == null ? void 0 : n.obj : K(
|
|
670
849
|
this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
|
|
671
|
-
(s) => new
|
|
850
|
+
(s) => new I(s, [e.blockId, e.name])
|
|
672
851
|
);
|
|
673
852
|
}
|
|
674
853
|
/**
|
|
@@ -679,7 +858,7 @@ class Ue {
|
|
|
679
858
|
getPColumnByRef(e) {
|
|
680
859
|
const n = this.getDataByRef(e);
|
|
681
860
|
if (n)
|
|
682
|
-
return
|
|
861
|
+
return Te(n);
|
|
683
862
|
}
|
|
684
863
|
/**
|
|
685
864
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
@@ -689,7 +868,7 @@ class Ue {
|
|
|
689
868
|
getPColumnSpecByRef(e) {
|
|
690
869
|
const n = this.getSpecByRef(e);
|
|
691
870
|
if (n) {
|
|
692
|
-
if (!
|
|
871
|
+
if (!J(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
|
|
693
872
|
return n;
|
|
694
873
|
}
|
|
695
874
|
}
|
|
@@ -708,13 +887,13 @@ class Ue {
|
|
|
708
887
|
findDataWithCompatibleSpec(e) {
|
|
709
888
|
const n = [];
|
|
710
889
|
e: for (const s of this.getData().entries) {
|
|
711
|
-
if (!
|
|
890
|
+
if (!J(s.obj.spec))
|
|
712
891
|
continue;
|
|
713
|
-
const
|
|
714
|
-
if (e.name ===
|
|
715
|
-
for (let
|
|
716
|
-
const o = e.axesSpec[
|
|
717
|
-
if (o.name !==
|
|
892
|
+
const i = s.obj.spec;
|
|
893
|
+
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && te(e.domain, i.domain)) {
|
|
894
|
+
for (let r = 0; r < e.axesSpec.length; ++r) {
|
|
895
|
+
const o = e.axesSpec[r], u = i.axesSpec[r];
|
|
896
|
+
if (o.name !== u.name || o.type !== u.type || !te(o.domain, u.domain))
|
|
718
897
|
continue e;
|
|
719
898
|
}
|
|
720
899
|
n.push(s.obj);
|
|
@@ -722,23 +901,36 @@ class Ue {
|
|
|
722
901
|
}
|
|
723
902
|
return n;
|
|
724
903
|
}
|
|
904
|
+
/**
|
|
905
|
+
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
906
|
+
* @returns a map of axis value => label
|
|
907
|
+
*/
|
|
908
|
+
findLabels(e) {
|
|
909
|
+
const n = this.getData();
|
|
910
|
+
for (const s of n.entries) {
|
|
911
|
+
if (!V(s.obj)) continue;
|
|
912
|
+
const i = s.obj.spec;
|
|
913
|
+
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && te(e.domain, i.axesSpec[0].domain)) {
|
|
914
|
+
if (s.obj.data.resourceType.name !== "PColumnData/Json")
|
|
915
|
+
throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
|
|
916
|
+
return Object.fromEntries(
|
|
917
|
+
Object.entries(
|
|
918
|
+
s.obj.data.getDataAsJson().data
|
|
919
|
+
).map((o) => [JSON.parse(o[0])[0], o[1]])
|
|
920
|
+
);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
725
924
|
}
|
|
726
|
-
|
|
727
|
-
if (t === void 0) return e === void 0;
|
|
728
|
-
if (e === void 0) return !0;
|
|
729
|
-
for (const n in e)
|
|
730
|
-
if (t[n] !== e[n]) return !1;
|
|
731
|
-
return !0;
|
|
732
|
-
}
|
|
733
|
-
class V {
|
|
925
|
+
class G {
|
|
734
926
|
constructor() {
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
927
|
+
x(this, "ctx");
|
|
928
|
+
x(this, "args");
|
|
929
|
+
x(this, "uiState");
|
|
738
930
|
// lazy rendering because this feature is rarely used
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
this.ctx =
|
|
931
|
+
x(this, "_activeArgsCache");
|
|
932
|
+
x(this, "resultPool", new Ke());
|
|
933
|
+
this.ctx = g(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
|
|
742
934
|
}
|
|
743
935
|
/**
|
|
744
936
|
* Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
|
|
@@ -754,45 +946,33 @@ class V {
|
|
|
754
946
|
// return this.ctx.featureFlags;
|
|
755
947
|
// }
|
|
756
948
|
getNamedAccessor(e) {
|
|
757
|
-
return
|
|
949
|
+
return se(
|
|
758
950
|
this.ctx.getAccessorHandleByName(e),
|
|
759
|
-
(n) => new
|
|
951
|
+
(n) => new I(n, [e])
|
|
760
952
|
);
|
|
761
953
|
}
|
|
762
954
|
get prerun() {
|
|
763
|
-
return this.getNamedAccessor(
|
|
955
|
+
return this.getNamedAccessor(ye);
|
|
764
956
|
}
|
|
765
957
|
get outputs() {
|
|
766
|
-
return this.getNamedAccessor(
|
|
958
|
+
return this.getNamedAccessor(be);
|
|
767
959
|
}
|
|
768
960
|
/**
|
|
769
961
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
770
962
|
* @returns a map of axis value => label
|
|
963
|
+
* @deprecated Use resultPool.findLabels instead
|
|
771
964
|
*/
|
|
772
965
|
findLabels(e) {
|
|
773
|
-
|
|
774
|
-
for (const s of n.entries) {
|
|
775
|
-
if (!B(s.obj)) continue;
|
|
776
|
-
const r = s.obj.spec;
|
|
777
|
-
if (r.name === "pl7.app/label" && r.axesSpec.length === 1 && r.axesSpec[0].name === e.name && r.axesSpec[0].type === e.type && X(e.domain, r.axesSpec[0].domain)) {
|
|
778
|
-
if (s.obj.data.resourceType.name !== "PColumnData/Json")
|
|
779
|
-
throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
|
|
780
|
-
return Object.fromEntries(
|
|
781
|
-
Object.entries(
|
|
782
|
-
s.obj.data.getDataAsJson().data
|
|
783
|
-
).map((o) => [JSON.parse(o[0])[0], o[1]])
|
|
784
|
-
);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
966
|
+
return this.resultPool.findLabels(e);
|
|
787
967
|
}
|
|
788
968
|
verifyInlineColumnsSupport(e) {
|
|
789
|
-
var
|
|
790
|
-
const n = e.some((
|
|
969
|
+
var i;
|
|
970
|
+
const n = e.some((r) => !(r.data instanceof I)), s = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
|
|
791
971
|
if (n && !s) throw Error("inline columns not supported");
|
|
792
972
|
}
|
|
793
973
|
createPFrame(e) {
|
|
794
974
|
return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(
|
|
795
|
-
e.map((n) =>
|
|
975
|
+
e.map((n) => K(n, (s) => s instanceof I ? s.handle : s))
|
|
796
976
|
);
|
|
797
977
|
}
|
|
798
978
|
createPTable(e) {
|
|
@@ -804,10 +984,10 @@ class V {
|
|
|
804
984
|
},
|
|
805
985
|
filters: e.filters ?? [],
|
|
806
986
|
sorting: e.sorting ?? []
|
|
807
|
-
} : n = e, this.verifyInlineColumnsSupport(
|
|
808
|
-
|
|
987
|
+
} : n = e, this.verifyInlineColumnsSupport(Re(n.src)), this.ctx.createPTable(
|
|
988
|
+
Fe(
|
|
809
989
|
n,
|
|
810
|
-
(s) =>
|
|
990
|
+
(s) => K(s, (i) => i instanceof I ? i.handle : i)
|
|
811
991
|
)
|
|
812
992
|
);
|
|
813
993
|
}
|
|
@@ -820,189 +1000,76 @@ class V {
|
|
|
820
1000
|
return this.ctx.getCurrentUnstableMarker();
|
|
821
1001
|
}
|
|
822
1002
|
}
|
|
823
|
-
const
|
|
824
|
-
function
|
|
825
|
-
if (t === void 0) return !1;
|
|
826
|
-
switch (t.resourceType.name) {
|
|
827
|
-
case Q: {
|
|
828
|
-
let i = t.getInputsLocked();
|
|
829
|
-
for (const o of t.listInputFields()) {
|
|
830
|
-
const l = t.resolve({ field: o, assertFieldType: "Input" }), a = [...s, ...JSON.parse(o)], u = l === void 0 ? void 0 : e(l);
|
|
831
|
-
u === void 0 && (i = !1), (u !== void 0 || r) && n.push({ key: a, value: u });
|
|
832
|
-
}
|
|
833
|
-
return i;
|
|
834
|
-
}
|
|
835
|
-
case Z: {
|
|
836
|
-
let i = t.getInputsLocked();
|
|
837
|
-
for (const o of t.listInputFields()) {
|
|
838
|
-
const l = t.resolve({ field: o, assertFieldType: "Input" });
|
|
839
|
-
if (l === void 0) i = !1;
|
|
840
|
-
else {
|
|
841
|
-
const a = [...s, ...JSON.parse(o)], u = me(
|
|
842
|
-
l,
|
|
843
|
-
e,
|
|
844
|
-
n,
|
|
845
|
-
a,
|
|
846
|
-
r
|
|
847
|
-
);
|
|
848
|
-
i = i && u;
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
return i;
|
|
852
|
-
}
|
|
853
|
-
default:
|
|
854
|
-
throw new Error(`Unknown resource type: ${t.resourceType.name}`);
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
function Tt(t, e, n = !1) {
|
|
858
|
-
const s = [];
|
|
859
|
-
return { isComplete: me(t, e, s, [], n), data: s };
|
|
860
|
-
}
|
|
861
|
-
const ae = (t) => {
|
|
862
|
-
if (!t.endsWith(".index")) {
|
|
863
|
-
if (t.endsWith(".values"))
|
|
864
|
-
return t.substring(0, t.length - 7);
|
|
865
|
-
throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
866
|
-
}
|
|
867
|
-
};
|
|
868
|
-
function Be(t) {
|
|
869
|
-
if (!t) return;
|
|
870
|
-
const e = t.resourceType.name, n = t.getDataAsJson(), s = [];
|
|
871
|
-
let r = 0;
|
|
872
|
-
switch (e) {
|
|
873
|
-
case Q:
|
|
874
|
-
r = n.keyLength;
|
|
875
|
-
break;
|
|
876
|
-
case Z:
|
|
877
|
-
r = n.partitionKeyLength + n.keyLength;
|
|
878
|
-
break;
|
|
879
|
-
case ie:
|
|
880
|
-
case K:
|
|
881
|
-
r = n.partitionKeyLength;
|
|
882
|
-
break;
|
|
883
|
-
case H:
|
|
884
|
-
case oe:
|
|
885
|
-
r = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
886
|
-
break;
|
|
887
|
-
}
|
|
888
|
-
switch (e) {
|
|
889
|
-
case Q:
|
|
890
|
-
case ie:
|
|
891
|
-
case K:
|
|
892
|
-
for (let i of t.listInputFields()) {
|
|
893
|
-
if (e === K) {
|
|
894
|
-
const l = ae(i);
|
|
895
|
-
if (l) i = l;
|
|
896
|
-
else continue;
|
|
897
|
-
}
|
|
898
|
-
const o = [...JSON.parse(i)];
|
|
899
|
-
s.push(o);
|
|
900
|
-
}
|
|
901
|
-
break;
|
|
902
|
-
case Z:
|
|
903
|
-
case H:
|
|
904
|
-
case oe:
|
|
905
|
-
for (const i of t.listInputFields()) {
|
|
906
|
-
const o = [...JSON.parse(i)], l = t.resolve({ field: i, assertFieldType: "Input" });
|
|
907
|
-
if (l !== void 0)
|
|
908
|
-
for (let a of l.listInputFields()) {
|
|
909
|
-
if (e === H) {
|
|
910
|
-
const g = ae(a);
|
|
911
|
-
if (g) a = g;
|
|
912
|
-
else continue;
|
|
913
|
-
}
|
|
914
|
-
const u = [...o, ...JSON.parse(a)];
|
|
915
|
-
s.push(u);
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
break;
|
|
919
|
-
}
|
|
920
|
-
return { data: s, keyLength: r };
|
|
921
|
-
}
|
|
922
|
-
function xt(t) {
|
|
923
|
-
const e = Be(t);
|
|
924
|
-
if (!e) return;
|
|
925
|
-
const { data: n, keyLength: s } = e, r = [];
|
|
926
|
-
for (let i = 0; i < s; ++i)
|
|
927
|
-
r.push(/* @__PURE__ */ new Set());
|
|
928
|
-
for (const i of n) {
|
|
929
|
-
if (i.length !== s)
|
|
930
|
-
throw new Error("key length does not match partition length");
|
|
931
|
-
for (let o = 0; o < s; ++o)
|
|
932
|
-
r[o].add(i[o]);
|
|
933
|
-
}
|
|
934
|
-
return r.map((i) => Array.from(i.values()));
|
|
935
|
-
}
|
|
936
|
-
const L = "1.24.10";
|
|
937
|
-
function Je(t) {
|
|
1003
|
+
const j = "1.25.0";
|
|
1004
|
+
function He(t) {
|
|
938
1005
|
return t.__renderLambda === !0;
|
|
939
1006
|
}
|
|
940
|
-
function
|
|
1007
|
+
function ne(t) {
|
|
941
1008
|
if (t !== void 0)
|
|
942
|
-
return
|
|
1009
|
+
return He(t) ? t.handle : t;
|
|
943
1010
|
}
|
|
944
|
-
function
|
|
1011
|
+
function k(t) {
|
|
945
1012
|
if (t !== void 0)
|
|
946
1013
|
return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
|
|
947
1014
|
}
|
|
948
|
-
function
|
|
1015
|
+
function jt(t) {
|
|
949
1016
|
if (t.v3 !== void 0) {
|
|
950
1017
|
const {
|
|
951
1018
|
initialArgs: e,
|
|
952
1019
|
initialUiState: n,
|
|
953
1020
|
inputsValid: s,
|
|
954
|
-
outputs:
|
|
955
|
-
renderingMode:
|
|
1021
|
+
outputs: i,
|
|
1022
|
+
renderingMode: r,
|
|
956
1023
|
sdkVersion: o,
|
|
957
|
-
sections:
|
|
958
|
-
title:
|
|
959
|
-
} = t.v3, { code:
|
|
1024
|
+
sections: u,
|
|
1025
|
+
title: c
|
|
1026
|
+
} = t.v3, { code: a } = t;
|
|
960
1027
|
return {
|
|
961
1028
|
initialArgs: e,
|
|
962
1029
|
initialUiState: n,
|
|
963
1030
|
inputsValid: s,
|
|
964
|
-
outputs:
|
|
965
|
-
renderingMode:
|
|
1031
|
+
outputs: i,
|
|
1032
|
+
renderingMode: r,
|
|
966
1033
|
sdkVersion: o,
|
|
967
|
-
sections:
|
|
968
|
-
title:
|
|
969
|
-
code:
|
|
1034
|
+
sections: u,
|
|
1035
|
+
title: c,
|
|
1036
|
+
code: a
|
|
970
1037
|
};
|
|
971
1038
|
} else if (t.inputsValid !== void 0) {
|
|
972
|
-
const { sdkVersion: e, renderingMode: n, outputs: s, inputsValid:
|
|
973
|
-
if (e === void 0 || n === void 0 || s === void 0 ||
|
|
1039
|
+
const { sdkVersion: e, renderingMode: n, outputs: s, inputsValid: i, sections: r, initialArgs: o, code: u } = t, c = Object.keys(t);
|
|
1040
|
+
if (e === void 0 || n === void 0 || s === void 0 || i === void 0 || r === void 0 || o === void 0)
|
|
974
1041
|
throw new Error(
|
|
975
|
-
`Malformed config v2. SDK version ${e}; Fields = ${
|
|
1042
|
+
`Malformed config v2. SDK version ${e}; Fields = ${c.join(", ")}`
|
|
976
1043
|
);
|
|
977
1044
|
return {
|
|
978
1045
|
sdkVersion: e,
|
|
979
1046
|
renderingMode: n,
|
|
980
1047
|
initialArgs: o,
|
|
981
1048
|
outputs: Object.fromEntries(
|
|
982
|
-
Object.entries(s).map(([
|
|
1049
|
+
Object.entries(s).map(([a, h]) => [a, k(h)])
|
|
983
1050
|
),
|
|
984
|
-
inputsValid:
|
|
985
|
-
sections:
|
|
1051
|
+
inputsValid: k(i),
|
|
1052
|
+
sections: k(r),
|
|
986
1053
|
initialUiState: void 0,
|
|
987
|
-
code:
|
|
1054
|
+
code: u
|
|
988
1055
|
};
|
|
989
1056
|
} else if (t.renderingMode !== void 0) {
|
|
990
|
-
const { sdkVersion: e, canRun: n, renderingMode: s, outputs:
|
|
991
|
-
if (s === void 0 ||
|
|
1057
|
+
const { sdkVersion: e, canRun: n, renderingMode: s, outputs: i, sections: r, initialArgs: o, code: u } = t, c = Object.keys(t);
|
|
1058
|
+
if (s === void 0 || i === void 0 || n === void 0 || r === void 0 || o === void 0)
|
|
992
1059
|
throw new Error(
|
|
993
|
-
`Malformed config v1. SDK version ${e}; Fields = ${
|
|
1060
|
+
`Malformed config v1. SDK version ${e}; Fields = ${c.join(", ")}`
|
|
994
1061
|
);
|
|
995
1062
|
return {
|
|
996
1063
|
sdkVersion: e ?? "unknown",
|
|
997
1064
|
renderingMode: s,
|
|
998
1065
|
initialArgs: o,
|
|
999
1066
|
outputs: Object.fromEntries(
|
|
1000
|
-
Object.entries(
|
|
1067
|
+
Object.entries(i).map(([a, h]) => [a, k(h)])
|
|
1001
1068
|
),
|
|
1002
|
-
inputsValid:
|
|
1003
|
-
sections:
|
|
1069
|
+
inputsValid: k(n),
|
|
1070
|
+
sections: k(r),
|
|
1004
1071
|
initialUiState: void 0,
|
|
1005
|
-
code:
|
|
1072
|
+
code: u
|
|
1006
1073
|
};
|
|
1007
1074
|
} else {
|
|
1008
1075
|
const { sdkVersion: e } = t, n = Object.keys(t);
|
|
@@ -1011,25 +1078,25 @@ function Lt(t) {
|
|
|
1011
1078
|
);
|
|
1012
1079
|
}
|
|
1013
1080
|
}
|
|
1014
|
-
class
|
|
1015
|
-
constructor(e, n, s,
|
|
1016
|
-
this._renderingMode = e, this._initialArgs = n, this._initialUiState = s, this._outputs =
|
|
1081
|
+
class P {
|
|
1082
|
+
constructor(e, n, s, i, r, o, u) {
|
|
1083
|
+
this._renderingMode = e, this._initialArgs = n, this._initialUiState = s, this._outputs = i, this._inputsValid = r, this._sections = o, this._title = u;
|
|
1017
1084
|
}
|
|
1018
1085
|
static create(e = "Heavy") {
|
|
1019
|
-
return new
|
|
1086
|
+
return new P(
|
|
1020
1087
|
e,
|
|
1021
1088
|
void 0,
|
|
1022
1089
|
{},
|
|
1023
1090
|
{},
|
|
1024
|
-
|
|
1025
|
-
|
|
1091
|
+
W(!0),
|
|
1092
|
+
W([]),
|
|
1026
1093
|
void 0
|
|
1027
1094
|
);
|
|
1028
1095
|
}
|
|
1029
1096
|
output(e, n, s = {}) {
|
|
1030
1097
|
if (typeof n == "function") {
|
|
1031
|
-
const
|
|
1032
|
-
return
|
|
1098
|
+
const i = `output#${e}`;
|
|
1099
|
+
return $(i, () => n(new G())), new P(
|
|
1033
1100
|
this._renderingMode,
|
|
1034
1101
|
this._initialArgs,
|
|
1035
1102
|
this._initialUiState,
|
|
@@ -1037,7 +1104,7 @@ class w {
|
|
|
1037
1104
|
...this._outputs,
|
|
1038
1105
|
[e]: {
|
|
1039
1106
|
__renderLambda: !0,
|
|
1040
|
-
handle:
|
|
1107
|
+
handle: i,
|
|
1041
1108
|
...s
|
|
1042
1109
|
}
|
|
1043
1110
|
},
|
|
@@ -1046,7 +1113,7 @@ class w {
|
|
|
1046
1113
|
this._title
|
|
1047
1114
|
);
|
|
1048
1115
|
} else
|
|
1049
|
-
return new
|
|
1116
|
+
return new P(
|
|
1050
1117
|
this._renderingMode,
|
|
1051
1118
|
this._initialArgs,
|
|
1052
1119
|
this._initialUiState,
|
|
@@ -1064,7 +1131,7 @@ class w {
|
|
|
1064
1131
|
return this.output(e, n, { retentive: !0 });
|
|
1065
1132
|
}
|
|
1066
1133
|
argsValid(e) {
|
|
1067
|
-
return typeof e == "function" ? (
|
|
1134
|
+
return typeof e == "function" ? ($("inputsValid", () => e(new G())), new P(
|
|
1068
1135
|
this._renderingMode,
|
|
1069
1136
|
this._initialArgs,
|
|
1070
1137
|
this._initialUiState,
|
|
@@ -1075,7 +1142,7 @@ class w {
|
|
|
1075
1142
|
},
|
|
1076
1143
|
this._sections,
|
|
1077
1144
|
this._title
|
|
1078
|
-
)) : new
|
|
1145
|
+
)) : new P(
|
|
1079
1146
|
this._renderingMode,
|
|
1080
1147
|
this._initialArgs,
|
|
1081
1148
|
this._initialUiState,
|
|
@@ -1086,7 +1153,7 @@ class w {
|
|
|
1086
1153
|
);
|
|
1087
1154
|
}
|
|
1088
1155
|
sections(e) {
|
|
1089
|
-
return Array.isArray(e) ? this.sections(
|
|
1156
|
+
return Array.isArray(e) ? this.sections(W(e)) : typeof e == "function" ? ($("sections", () => e(new G())), new P(
|
|
1090
1157
|
this._renderingMode,
|
|
1091
1158
|
this._initialArgs,
|
|
1092
1159
|
this._initialUiState,
|
|
@@ -1094,7 +1161,7 @@ class w {
|
|
|
1094
1161
|
this._inputsValid,
|
|
1095
1162
|
{ __renderLambda: !0, handle: "sections" },
|
|
1096
1163
|
this._title
|
|
1097
|
-
)) : new
|
|
1164
|
+
)) : new P(
|
|
1098
1165
|
this._renderingMode,
|
|
1099
1166
|
this._initialArgs,
|
|
1100
1167
|
this._initialUiState,
|
|
@@ -1106,7 +1173,7 @@ class w {
|
|
|
1106
1173
|
}
|
|
1107
1174
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
1108
1175
|
title(e) {
|
|
1109
|
-
return
|
|
1176
|
+
return $("title", () => e(new G())), new P(
|
|
1110
1177
|
this._renderingMode,
|
|
1111
1178
|
this._initialArgs,
|
|
1112
1179
|
this._initialUiState,
|
|
@@ -1121,7 +1188,7 @@ class w {
|
|
|
1121
1188
|
* @deprecated use {@link withArgs}
|
|
1122
1189
|
* */
|
|
1123
1190
|
initialArgs(e) {
|
|
1124
|
-
return new
|
|
1191
|
+
return new P(
|
|
1125
1192
|
this._renderingMode,
|
|
1126
1193
|
e,
|
|
1127
1194
|
this._initialUiState,
|
|
@@ -1133,7 +1200,7 @@ class w {
|
|
|
1133
1200
|
}
|
|
1134
1201
|
/** Sets initial args for the block, this value must be specified. */
|
|
1135
1202
|
withArgs(e) {
|
|
1136
|
-
return new
|
|
1203
|
+
return new P(
|
|
1137
1204
|
this._renderingMode,
|
|
1138
1205
|
e,
|
|
1139
1206
|
this._initialUiState,
|
|
@@ -1145,7 +1212,7 @@ class w {
|
|
|
1145
1212
|
}
|
|
1146
1213
|
/** Defines type and sets initial value for block UiState. */
|
|
1147
1214
|
withUiState(e) {
|
|
1148
|
-
return new
|
|
1215
|
+
return new P(
|
|
1149
1216
|
this._renderingMode,
|
|
1150
1217
|
this._initialArgs,
|
|
1151
1218
|
e,
|
|
@@ -1162,7 +1229,7 @@ class w {
|
|
|
1162
1229
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
1163
1230
|
const e = {
|
|
1164
1231
|
v3: {
|
|
1165
|
-
sdkVersion:
|
|
1232
|
+
sdkVersion: j,
|
|
1166
1233
|
renderingMode: this._renderingMode,
|
|
1167
1234
|
initialArgs: this._initialArgs,
|
|
1168
1235
|
initialUiState: this._initialUiState,
|
|
@@ -1172,185 +1239,185 @@ class w {
|
|
|
1172
1239
|
outputs: this._outputs
|
|
1173
1240
|
},
|
|
1174
1241
|
// fields below are added to allow previous desktop versions read generated configs
|
|
1175
|
-
sdkVersion:
|
|
1242
|
+
sdkVersion: j,
|
|
1176
1243
|
renderingMode: this._renderingMode,
|
|
1177
1244
|
initialArgs: this._initialArgs,
|
|
1178
|
-
inputsValid:
|
|
1179
|
-
sections:
|
|
1245
|
+
inputsValid: ne(this._inputsValid),
|
|
1246
|
+
sections: ne(this._sections),
|
|
1180
1247
|
outputs: Object.fromEntries(
|
|
1181
|
-
Object.entries(this._outputs).map(([n, s]) => [n,
|
|
1248
|
+
Object.entries(this._outputs).map(([n, s]) => [n, ne(s)])
|
|
1182
1249
|
)
|
|
1183
1250
|
};
|
|
1184
|
-
return
|
|
1251
|
+
return ke() ? me({ sdkVersion: j }) : { config: e };
|
|
1185
1252
|
}
|
|
1186
1253
|
}
|
|
1187
|
-
function
|
|
1188
|
-
var
|
|
1254
|
+
function Vt(t, e, n, s) {
|
|
1255
|
+
var a, h;
|
|
1189
1256
|
Array.isArray(s) && (s = { filters: s });
|
|
1190
|
-
const
|
|
1191
|
-
let
|
|
1192
|
-
if (
|
|
1193
|
-
for (const
|
|
1194
|
-
|
|
1195
|
-
return
|
|
1257
|
+
const i = t.resultPool.getData().entries.map((p) => p.obj).filter(V).filter((p) => p.spec.name === "pl7.app/label" && p.spec.axesSpec.length === 1), r = (p, l) => {
|
|
1258
|
+
let f = p.toString();
|
|
1259
|
+
if (l)
|
|
1260
|
+
for (const d in l)
|
|
1261
|
+
f += d, f += l[d];
|
|
1262
|
+
return f;
|
|
1196
1263
|
}, o = /* @__PURE__ */ new Map();
|
|
1197
|
-
for (const
|
|
1198
|
-
for (const
|
|
1199
|
-
const
|
|
1200
|
-
for (const
|
|
1201
|
-
const
|
|
1202
|
-
if (
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1205
|
-
const
|
|
1206
|
-
o.set(
|
|
1207
|
-
id:
|
|
1264
|
+
for (const p of e)
|
|
1265
|
+
for (const l of p.spec.axesSpec) {
|
|
1266
|
+
const f = T(l);
|
|
1267
|
+
for (const d of i) {
|
|
1268
|
+
const y = d.spec.axesSpec[0], _ = T(d.spec.axesSpec[0]);
|
|
1269
|
+
if (N(f, _)) {
|
|
1270
|
+
const A = Object.keys(f.domain ?? {}).length, v = Object.keys(_.domain ?? {}).length;
|
|
1271
|
+
if (A > v) {
|
|
1272
|
+
const m = r(d.id, f.domain);
|
|
1273
|
+
o.set(m, {
|
|
1274
|
+
id: m,
|
|
1208
1275
|
spec: {
|
|
1209
|
-
...
|
|
1210
|
-
axesSpec: [{ ...
|
|
1276
|
+
...d.spec,
|
|
1277
|
+
axesSpec: [{ ...f, annotations: y.annotations }]
|
|
1211
1278
|
},
|
|
1212
|
-
data:
|
|
1279
|
+
data: d.data
|
|
1213
1280
|
});
|
|
1214
1281
|
} else
|
|
1215
|
-
o.set(
|
|
1282
|
+
o.set(r(d.id), d);
|
|
1216
1283
|
}
|
|
1217
1284
|
}
|
|
1218
1285
|
}
|
|
1219
1286
|
if ([...e, ...o.values()].some(
|
|
1220
|
-
(
|
|
1287
|
+
(p) => p.data instanceof I && !p.data.getIsReadyOrError()
|
|
1221
1288
|
))
|
|
1222
1289
|
return;
|
|
1223
|
-
let
|
|
1224
|
-
const
|
|
1290
|
+
let u = e;
|
|
1291
|
+
const c = [];
|
|
1225
1292
|
if (s != null && s.coreColumnPredicate) {
|
|
1226
|
-
|
|
1227
|
-
for (const
|
|
1228
|
-
s.coreColumnPredicate(
|
|
1293
|
+
u = [];
|
|
1294
|
+
for (const p of e)
|
|
1295
|
+
s.coreColumnPredicate(p.spec) ? u.push(p) : c.push(p);
|
|
1229
1296
|
}
|
|
1230
|
-
return
|
|
1297
|
+
return c.push(...o.values()), t.createPTable({
|
|
1231
1298
|
src: {
|
|
1232
1299
|
type: "outer",
|
|
1233
1300
|
primary: {
|
|
1234
1301
|
type: (s == null ? void 0 : s.coreJoinType) ?? "full",
|
|
1235
|
-
entries:
|
|
1302
|
+
entries: u.map((p) => ({ type: "column", column: p }))
|
|
1236
1303
|
},
|
|
1237
|
-
secondary:
|
|
1304
|
+
secondary: c.map((p) => ({ type: "column", column: p }))
|
|
1238
1305
|
},
|
|
1239
|
-
filters: [...(s == null ? void 0 : s.filters) ?? [], ...((
|
|
1240
|
-
sorting: ((
|
|
1306
|
+
filters: [...(s == null ? void 0 : s.filters) ?? [], ...((a = n == null ? void 0 : n.pTableParams) == null ? void 0 : a.filters) ?? []],
|
|
1307
|
+
sorting: ((h = n == null ? void 0 : n.pTableParams) == null ? void 0 : h.sorting) ?? []
|
|
1241
1308
|
});
|
|
1242
1309
|
}
|
|
1243
|
-
function
|
|
1310
|
+
function Nt(t, e, n) {
|
|
1244
1311
|
const s = t.findLabels(e);
|
|
1245
1312
|
return {
|
|
1246
1313
|
axis: e,
|
|
1247
|
-
options: n.map((
|
|
1248
|
-
value:
|
|
1249
|
-
label: (s == null ? void 0 : s[
|
|
1314
|
+
options: n.map((i) => ({
|
|
1315
|
+
value: i,
|
|
1316
|
+
label: (s == null ? void 0 : s[i]) ?? i.toString()
|
|
1250
1317
|
})),
|
|
1251
1318
|
defaultValue: n[0]
|
|
1252
1319
|
};
|
|
1253
1320
|
}
|
|
1254
|
-
const
|
|
1321
|
+
const qe = (t, e) => {
|
|
1255
1322
|
let n = t.toString();
|
|
1256
1323
|
return e == null || e.forEach((s) => {
|
|
1257
1324
|
if (s)
|
|
1258
|
-
for (const [
|
|
1259
|
-
n +=
|
|
1325
|
+
for (const [i, r] of Object.entries(s))
|
|
1326
|
+
n += i, n += r;
|
|
1260
1327
|
}), n;
|
|
1261
1328
|
};
|
|
1262
|
-
function
|
|
1329
|
+
function ze(t) {
|
|
1263
1330
|
if (!t.length)
|
|
1264
1331
|
return [];
|
|
1265
1332
|
let e = [[]];
|
|
1266
1333
|
return t.forEach((n) => {
|
|
1267
1334
|
const s = [];
|
|
1268
|
-
n.forEach((
|
|
1269
|
-
s.push(...e.map((
|
|
1335
|
+
n.forEach((i) => {
|
|
1336
|
+
s.push(...e.map((r) => [...r, i]));
|
|
1270
1337
|
}), e = s;
|
|
1271
1338
|
}), e;
|
|
1272
1339
|
}
|
|
1273
|
-
function
|
|
1274
|
-
const n = t.spec.axesSpec.map(
|
|
1275
|
-
return e.spec.axesSpec.map(
|
|
1340
|
+
function Ye(t, e) {
|
|
1341
|
+
const n = t.spec.axesSpec.map(T);
|
|
1342
|
+
return e.spec.axesSpec.map(T).every((i) => n.some((r) => N(r, i) && N(i, r)));
|
|
1276
1343
|
}
|
|
1277
|
-
function
|
|
1278
|
-
const n = t.spec.axesSpec.map(
|
|
1279
|
-
return e.spec.axesSpec.map(
|
|
1344
|
+
function Se(t, e) {
|
|
1345
|
+
const n = t.spec.axesSpec.map(T);
|
|
1346
|
+
return e.spec.axesSpec.map(T).every((i) => n.some((r) => N(r, i)));
|
|
1280
1347
|
}
|
|
1281
|
-
const
|
|
1282
|
-
function
|
|
1283
|
-
const n = t.spec.axesSpec.map(
|
|
1284
|
-
if (
|
|
1348
|
+
const Xe = "pl7.app/graph/isVirtual", fe = "pl7.app/label";
|
|
1349
|
+
function he(t, e) {
|
|
1350
|
+
const n = t.spec.axesSpec.map(T), s = e.spec.axesSpec.map(T);
|
|
1351
|
+
if (Ye(t, e))
|
|
1285
1352
|
return [];
|
|
1286
|
-
if (!
|
|
1353
|
+
if (!Se(t, e))
|
|
1287
1354
|
return [];
|
|
1288
|
-
const o = s.map((
|
|
1289
|
-
const
|
|
1290
|
-
return
|
|
1291
|
-
const
|
|
1292
|
-
return Object.entries(
|
|
1293
|
-
if ((
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1355
|
+
const o = s.map((p) => n.filter((l) => N(l, p))), u = ze(o), c = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), h = u.map((p) => {
|
|
1356
|
+
const l = /* @__PURE__ */ new Set();
|
|
1357
|
+
return p.map((f, d) => {
|
|
1358
|
+
const y = e.spec.axesSpec[d].domain, _ = f.domain;
|
|
1359
|
+
return Object.entries(_ ?? {}).forEach(([A, v]) => {
|
|
1360
|
+
if ((y == null ? void 0 : y[A]) === void 0) {
|
|
1361
|
+
const m = JSON.stringify([A, v]);
|
|
1362
|
+
l.add(m), c.add(m);
|
|
1296
1363
|
}
|
|
1297
1364
|
}), {
|
|
1298
|
-
...
|
|
1299
|
-
annotations: e.spec.axesSpec[
|
|
1365
|
+
...f,
|
|
1366
|
+
annotations: e.spec.axesSpec[d].annotations
|
|
1300
1367
|
};
|
|
1301
|
-
}),
|
|
1368
|
+
}), l;
|
|
1302
1369
|
});
|
|
1303
|
-
return [...
|
|
1304
|
-
|
|
1305
|
-
}),
|
|
1306
|
-
var
|
|
1307
|
-
const
|
|
1308
|
-
var
|
|
1309
|
-
return (
|
|
1310
|
-
}).join(" / "),
|
|
1370
|
+
return [...c].forEach((p) => {
|
|
1371
|
+
h.some((l) => !l.has(p)) && a.add(p);
|
|
1372
|
+
}), u.map((p, l) => {
|
|
1373
|
+
var A;
|
|
1374
|
+
const f = qe(e.id, p.map((v) => v.domain)), d = ((A = e.spec.annotations) == null ? void 0 : A[fe]) ?? "", y = [...h[l]].filter((v) => a.has(v)).sort().map((v) => {
|
|
1375
|
+
var m;
|
|
1376
|
+
return (m = JSON.parse(v)) == null ? void 0 : m[1];
|
|
1377
|
+
}).join(" / "), _ = {
|
|
1311
1378
|
...e.spec.annotations,
|
|
1312
|
-
[
|
|
1379
|
+
[Xe]: "true"
|
|
1313
1380
|
};
|
|
1314
|
-
return (
|
|
1315
|
-
id:
|
|
1381
|
+
return (d || y) && (_[fe] = d && y ? d + " / " + y : d + y), {
|
|
1382
|
+
id: f,
|
|
1316
1383
|
spec: {
|
|
1317
1384
|
...e.spec,
|
|
1318
|
-
axesSpec:
|
|
1385
|
+
axesSpec: p.map((v, m) => ({
|
|
1319
1386
|
...v,
|
|
1320
|
-
annotations: e.spec.axesSpec[
|
|
1387
|
+
annotations: e.spec.axesSpec[m].annotations
|
|
1321
1388
|
})),
|
|
1322
|
-
annotations:
|
|
1389
|
+
annotations: _
|
|
1323
1390
|
},
|
|
1324
1391
|
data: e.data
|
|
1325
1392
|
};
|
|
1326
1393
|
});
|
|
1327
1394
|
}
|
|
1328
|
-
function
|
|
1395
|
+
function Qe(t) {
|
|
1329
1396
|
const e = [];
|
|
1330
1397
|
for (let n = 0; n < t.length; n++)
|
|
1331
1398
|
for (let s = n + 1; s < t.length; s++) {
|
|
1332
|
-
const
|
|
1399
|
+
const i = t[n], r = t[s];
|
|
1333
1400
|
e.push(
|
|
1334
|
-
...
|
|
1335
|
-
...
|
|
1401
|
+
...he(i, r),
|
|
1402
|
+
...he(r, i)
|
|
1336
1403
|
);
|
|
1337
1404
|
}
|
|
1338
1405
|
return e;
|
|
1339
1406
|
}
|
|
1340
|
-
function
|
|
1407
|
+
function Ze(t, e) {
|
|
1341
1408
|
const n = [...t];
|
|
1342
1409
|
for (const s of e)
|
|
1343
|
-
for (const
|
|
1344
|
-
if (
|
|
1410
|
+
for (const i of t) {
|
|
1411
|
+
if (i.id === s.id)
|
|
1345
1412
|
break;
|
|
1346
|
-
if (
|
|
1413
|
+
if (Se(i, s)) {
|
|
1347
1414
|
n.push(s);
|
|
1348
1415
|
break;
|
|
1349
1416
|
}
|
|
1350
1417
|
}
|
|
1351
1418
|
return n;
|
|
1352
1419
|
}
|
|
1353
|
-
const
|
|
1420
|
+
const et = [
|
|
1354
1421
|
"Int",
|
|
1355
1422
|
"Long",
|
|
1356
1423
|
"Float",
|
|
@@ -1358,15 +1425,15 @@ const qe = [
|
|
|
1358
1425
|
"String",
|
|
1359
1426
|
"Bytes"
|
|
1360
1427
|
];
|
|
1361
|
-
function
|
|
1428
|
+
function Ut(t, e) {
|
|
1362
1429
|
if (e === void 0) return;
|
|
1363
|
-
const n = t.resultPool.getData().entries.map((
|
|
1364
|
-
if (!
|
|
1365
|
-
(
|
|
1430
|
+
const n = t.resultPool.getData().entries.map((r) => r.obj).filter(V).filter((r) => et.includes(r.spec.valueType)), s = Ze(e, n), i = [...s, ...Qe(s)];
|
|
1431
|
+
if (!i.some(
|
|
1432
|
+
(r) => r.data instanceof I && !r.data.getIsReadyOrError()
|
|
1366
1433
|
))
|
|
1367
|
-
return t.createPFrame(
|
|
1434
|
+
return t.createPFrame(i);
|
|
1368
1435
|
}
|
|
1369
|
-
class
|
|
1436
|
+
class Bt {
|
|
1370
1437
|
constructor(e) {
|
|
1371
1438
|
this.handle = e;
|
|
1372
1439
|
}
|
|
@@ -1386,101 +1453,101 @@ class Et {
|
|
|
1386
1453
|
return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
|
|
1387
1454
|
}
|
|
1388
1455
|
}
|
|
1389
|
-
function
|
|
1390
|
-
return
|
|
1456
|
+
function tt(t) {
|
|
1457
|
+
return ge({
|
|
1391
1458
|
__isRef: !0,
|
|
1392
|
-
blockId:
|
|
1393
|
-
name:
|
|
1459
|
+
blockId: H(t, "blockId"),
|
|
1460
|
+
name: H(t, "name")
|
|
1394
1461
|
});
|
|
1395
1462
|
}
|
|
1396
|
-
function
|
|
1397
|
-
return
|
|
1398
|
-
ref:
|
|
1399
|
-
label:
|
|
1463
|
+
function Mt(t) {
|
|
1464
|
+
return ge({
|
|
1465
|
+
ref: tt(H(t, "ref")),
|
|
1466
|
+
label: H(t, "label")
|
|
1400
1467
|
});
|
|
1401
1468
|
}
|
|
1402
|
-
const
|
|
1403
|
-
sdkVersion:
|
|
1469
|
+
const Jt = {
|
|
1470
|
+
sdkVersion: j
|
|
1404
1471
|
};
|
|
1405
|
-
function
|
|
1406
|
-
return
|
|
1472
|
+
function $t() {
|
|
1473
|
+
return me({ sdkVersion: j });
|
|
1407
1474
|
}
|
|
1408
|
-
function
|
|
1475
|
+
function Gt(t) {
|
|
1409
1476
|
if (typeof globalThis.getEnvironmentValue == "function")
|
|
1410
1477
|
return globalThis.getEnvironmentValue(t);
|
|
1411
1478
|
}
|
|
1412
1479
|
export {
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1480
|
+
at as Args,
|
|
1481
|
+
P as BlockModel,
|
|
1482
|
+
Jt as CurrentSdkInfo,
|
|
1483
|
+
S as FutureRef,
|
|
1484
|
+
Xe as IS_VIRTUAL_COLUMN,
|
|
1485
|
+
lt as It,
|
|
1486
|
+
Et as JsRenderInternal,
|
|
1487
|
+
fe as LABEL_ANNOTATION,
|
|
1488
|
+
ut as MainOutputs,
|
|
1489
|
+
Le as OutputError,
|
|
1490
|
+
Ne as PAnnotationLabel,
|
|
1491
|
+
Ue as PAnnotationTrace,
|
|
1492
|
+
Bt as PFrameImpl,
|
|
1493
|
+
Z as RT_BINARY_PARTITIONED,
|
|
1494
|
+
ee as RT_BINARY_SUPER_PARTITIONED,
|
|
1495
|
+
ce as RT_JSON_PARTITIONED,
|
|
1496
|
+
pe as RT_JSON_SUPER_PARTITIONED,
|
|
1497
|
+
re as RT_RESOURCE_MAP,
|
|
1498
|
+
oe as RT_RESOURCE_MAP_PARTITIONED,
|
|
1499
|
+
G as RenderCtx,
|
|
1500
|
+
Ke as ResultPool,
|
|
1501
|
+
ct as StagingOutputs,
|
|
1502
|
+
Me as Trace,
|
|
1503
|
+
Be as TraceEntry,
|
|
1504
|
+
I as TreeNodeAccessor,
|
|
1505
|
+
pt as UiState,
|
|
1506
|
+
bt as and,
|
|
1507
|
+
Ut as createPFrameForGraphs,
|
|
1508
|
+
Vt as createPlDataTable,
|
|
1509
|
+
Nt as createPlDataTableSheet,
|
|
1510
|
+
Q as deriveLabels,
|
|
1511
|
+
ne as downgradeCfgOrLambda,
|
|
1512
|
+
Ze as enrichColumnsWithCompatible,
|
|
1513
|
+
Tt as extractArchiveAndGetURL,
|
|
1514
|
+
jt as extractConfig,
|
|
1515
|
+
gt as flatten,
|
|
1516
|
+
Mt as fromPlOption,
|
|
1517
|
+
tt as fromPlRef,
|
|
1518
|
+
Qe as getAdditionalColumns,
|
|
1519
|
+
wt as getBlobContent,
|
|
1520
|
+
Pt as getBlobContentAsJson,
|
|
1521
|
+
It as getBlobContentAsString,
|
|
1522
|
+
Ct as getDownloadedBlobContent,
|
|
1523
|
+
Gt as getEnvironmentValue,
|
|
1524
|
+
U as getFromCfg,
|
|
1525
|
+
W as getImmediate,
|
|
1526
|
+
Rt as getImportProgress,
|
|
1527
|
+
H as getJsonField,
|
|
1528
|
+
Ft as getLastLogs,
|
|
1529
|
+
kt as getLogHandle,
|
|
1530
|
+
xt as getOnDemandBlobContent,
|
|
1531
|
+
Ge as getPartitionKeysList,
|
|
1532
|
+
Lt as getProgressLog,
|
|
1533
|
+
Dt as getProgressLogWithInfo,
|
|
1534
|
+
$t as getRawPlatformaInstance,
|
|
1535
|
+
_t as getResourceField,
|
|
1536
|
+
At as getResourceValueAsJson,
|
|
1537
|
+
We as getUniquePartitionKeys,
|
|
1538
|
+
se as ifDef,
|
|
1539
|
+
He as isConfigLambda,
|
|
1540
|
+
mt as isEmpty,
|
|
1541
|
+
ot as isolate,
|
|
1542
|
+
dt as makeArray,
|
|
1543
|
+
ge as makeObject,
|
|
1544
|
+
ht as mapArrayValues,
|
|
1545
|
+
ft as mapRecordValues,
|
|
1546
|
+
St as mapResourceFields,
|
|
1547
|
+
yt as not,
|
|
1548
|
+
vt as or,
|
|
1549
|
+
Ot as parseResourceMap,
|
|
1550
|
+
De as readOutput,
|
|
1551
|
+
rt as wrapOutputs
|
|
1485
1552
|
};
|
|
1486
1553
|
//# sourceMappingURL=index.mjs.map
|