@platforma-sdk/model 1.24.11 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1004 -660
- package/dist/index.mjs.map +1 -1
- package/dist/render/api.d.ts +65 -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/split_selectors.d.ts +14 -0
- package/dist/render/split_selectors.d.ts.map +1 -0
- 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 +2 -1
- package/dist/render/util/index.d.ts.map +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} +12 -2
- package/dist/render/util/pcolumn_data.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/PlDataTable.ts +6 -5
- package/src/render/api.ts +425 -126
- package/src/render/internal.ts +4 -2
- package/src/render/split_selectors.ts +15 -0
- package/src/render/util/axis_filtering.ts +120 -0
- package/src/render/util/index.ts +2 -1
- package/src/render/util/label.ts +31 -3
- package/src/render/util/pcolumn_data.ts +387 -0
- package/dist/render/util/resource_map.d.ts.map +0 -1
- package/src/render/util/resource_map.ts +0 -208
package/dist/index.mjs
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
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
|
-
import { z as
|
|
7
|
-
class
|
|
6
|
+
import { z as E } from "zod";
|
|
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
|
-
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 ? 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
|
-
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 X(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 xt(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 At(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 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
|
-
source:
|
|
114
|
-
field:
|
|
113
|
+
source: b(t),
|
|
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",
|
|
121
|
-
source:
|
|
121
|
+
source: b(t)
|
|
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,158 +130,158 @@ function mt(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
|
-
source:
|
|
136
|
+
source: b(t)
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function kt(t) {
|
|
140
140
|
return {
|
|
141
141
|
type: "GetBlobContentAsString",
|
|
142
|
-
source:
|
|
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",
|
|
149
|
-
source:
|
|
149
|
+
source: b(t)
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Et(t) {
|
|
154
154
|
return {
|
|
155
155
|
type: "GetDownloadedBlobContent",
|
|
156
|
-
source:
|
|
156
|
+
source: b(t)
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Ot(t) {
|
|
160
160
|
return {
|
|
161
161
|
type: "GetOnDemandBlobContent",
|
|
162
|
-
source:
|
|
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
|
-
source:
|
|
169
|
+
source: b(t)
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Vt(t) {
|
|
173
173
|
return {
|
|
174
174
|
type: "GetImportProgress",
|
|
175
|
-
source:
|
|
175
|
+
source: b(t)
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function Kt(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 $t(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 Jt(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 Nt(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 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
|
-
class
|
|
235
|
-
constructor(e, n = (
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
this.handle = e, this.postProcess = n,
|
|
239
|
-
this.resolvedValue = n(
|
|
234
|
+
class S {
|
|
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) {
|
|
243
|
-
return new
|
|
243
|
+
return new S(this.handle, (n) => e(this.postProcess(n)));
|
|
244
244
|
}
|
|
245
245
|
mapDefined(e) {
|
|
246
|
-
return new
|
|
247
|
-
const
|
|
248
|
-
return
|
|
246
|
+
return new S(this.handle, (n) => {
|
|
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
|
-
class
|
|
258
|
+
class I {
|
|
259
259
|
constructor(e, n) {
|
|
260
260
|
this.handle = e, this.resolvePath = n;
|
|
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 S {
|
|
|
290
290
|
return this.resolveWithCommon({}, ...e);
|
|
291
291
|
}
|
|
292
292
|
resolveWithCommon(e, ...n) {
|
|
293
|
-
const
|
|
293
|
+
const r = [
|
|
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 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
|
-
|
|
321
|
-
(n) => new
|
|
319
|
+
return ie(
|
|
320
|
+
h().getError(this.handle),
|
|
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 S {
|
|
|
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 S {
|
|
|
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 (
|
|
376
|
-
const
|
|
377
|
-
for (const [
|
|
378
|
-
const
|
|
379
|
-
|
|
375
|
+
if (r === void 0) return;
|
|
376
|
+
const 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
|
-
return
|
|
381
|
+
return i;
|
|
382
382
|
}
|
|
383
383
|
getFileContentAsBase64() {
|
|
384
|
-
return new
|
|
384
|
+
return new S(h().getBlobContentAsBase64(this.handle));
|
|
385
385
|
}
|
|
386
386
|
getFileContentAsString() {
|
|
387
|
-
return new
|
|
387
|
+
return new S(h().getBlobContentAsString(this.handle));
|
|
388
388
|
}
|
|
389
389
|
getFileContentAsJson() {
|
|
390
|
-
return new
|
|
391
|
-
|
|
390
|
+
return new S(
|
|
391
|
+
h().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(h().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(h().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(h().extractArchiveAndGetURL(this.handle, e));
|
|
435
435
|
}
|
|
436
436
|
getImportProgress() {
|
|
437
|
-
return new
|
|
437
|
+
return new S(h().getImportProgress(this.handle));
|
|
438
438
|
}
|
|
439
439
|
getLastLogs(e) {
|
|
440
|
-
return new
|
|
440
|
+
return new S(h().getLastLogs(this.handle, e));
|
|
441
441
|
}
|
|
442
442
|
getProgressLog(e) {
|
|
443
|
-
return new
|
|
443
|
+
return new S(h().getProgressLog(this.handle, e));
|
|
444
444
|
}
|
|
445
445
|
getProgressLogWithInfo(e) {
|
|
446
|
-
return new
|
|
446
|
+
return new S(h().getProgressLogWithInfo(this.handle, e));
|
|
447
447
|
}
|
|
448
448
|
getLogHandle() {
|
|
449
|
-
return new
|
|
449
|
+
return new S(h().getLogHandle(this.handle));
|
|
450
450
|
}
|
|
451
451
|
allFieldsResolved(e = "Input") {
|
|
452
452
|
switch (e) {
|
|
@@ -461,116 +461,405 @@ class S {
|
|
|
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 (
|
|
470
|
+
if (i && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
|
|
471
471
|
return;
|
|
472
|
-
let
|
|
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
|
|
491
|
+
for (const i of n) oe(t, e, i);
|
|
491
492
|
else
|
|
492
|
-
for (const [,
|
|
493
|
-
|
|
493
|
+
for (const [, i] of Object.entries(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" })),
|
|
507
|
-
type:
|
|
508
|
-
importance:
|
|
509
|
-
id:
|
|
510
|
-
label:
|
|
511
|
-
}),
|
|
512
|
-
function
|
|
513
|
-
const
|
|
514
|
-
var
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
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({
|
|
508
|
+
type: E.string(),
|
|
509
|
+
importance: E.number().optional(),
|
|
510
|
+
id: E.string().optional(),
|
|
511
|
+
label: E.string()
|
|
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 = [
|
|
520
|
+
...y ?? [],
|
|
521
|
+
...x,
|
|
522
|
+
...g ?? []
|
|
523
|
+
];
|
|
524
|
+
if (v) {
|
|
525
|
+
const A = { label: v, type: qe, importance: -2 };
|
|
526
|
+
n.addLabelAsSuffix ? C.push(A) : C.splice(0, 0, A);
|
|
519
527
|
}
|
|
520
|
-
const
|
|
521
|
-
for (let
|
|
522
|
-
const { type:
|
|
523
|
-
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
|
|
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
|
+
$,
|
|
527
535
|
Math.max(
|
|
528
|
-
|
|
529
|
-
|
|
536
|
+
r.get($) ?? Number.NEGATIVE_INFINITY,
|
|
537
|
+
V - (C.length - A) * He
|
|
530
538
|
)
|
|
531
|
-
),
|
|
539
|
+
), P.push({ ...C[A], fullType: $, occurenceIndex: K });
|
|
532
540
|
}
|
|
533
|
-
return
|
|
534
|
-
value:
|
|
535
|
-
spec:
|
|
536
|
-
label:
|
|
537
|
-
fullTrace:
|
|
541
|
+
return P.reverse(), {
|
|
542
|
+
value: f,
|
|
543
|
+
spec: d,
|
|
544
|
+
label: v,
|
|
545
|
+
fullTrace: P
|
|
538
546
|
};
|
|
539
|
-
}), o = [],
|
|
540
|
-
|
|
541
|
-
for (const [
|
|
542
|
-
|
|
543
|
-
const
|
|
544
|
-
const
|
|
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 ?? " / ";
|
|
545
553
|
return {
|
|
546
|
-
label:
|
|
547
|
-
value:
|
|
554
|
+
label: d.join(y),
|
|
555
|
+
value: p.value
|
|
548
556
|
};
|
|
549
557
|
});
|
|
550
558
|
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
|
-
|
|
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) {
|
|
576
|
+
if (t === void 0) return !1;
|
|
577
|
+
switch (t.resourceType.name) {
|
|
578
|
+
case Q: {
|
|
579
|
+
let s = t.getInputsLocked();
|
|
580
|
+
for (const o of t.listInputFields()) {
|
|
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 });
|
|
583
|
+
}
|
|
584
|
+
return s;
|
|
585
|
+
}
|
|
586
|
+
case Z: {
|
|
587
|
+
let s = t.getInputsLocked();
|
|
588
|
+
for (const o of t.listInputFields()) {
|
|
589
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
590
|
+
if (a === void 0) s = !1;
|
|
591
|
+
else {
|
|
592
|
+
const c = [...r, ...JSON.parse(o)], l = Se(
|
|
593
|
+
a,
|
|
594
|
+
e,
|
|
595
|
+
n,
|
|
596
|
+
c,
|
|
597
|
+
i
|
|
598
|
+
);
|
|
599
|
+
s = s && l;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
return s;
|
|
603
|
+
}
|
|
604
|
+
default:
|
|
605
|
+
throw new Error(`Unknown resource type: ${t.resourceType.name}`);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function Ut(t, e, n = !1) {
|
|
609
|
+
const r = [];
|
|
610
|
+
return { isComplete: Se(t, e, r, [], n), data: r };
|
|
611
|
+
}
|
|
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}`);
|
|
618
|
+
};
|
|
619
|
+
function ze(t) {
|
|
620
|
+
if (!t) return;
|
|
621
|
+
const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
|
|
622
|
+
let i = 0;
|
|
623
|
+
switch (e) {
|
|
624
|
+
case Q:
|
|
625
|
+
i = n.keyLength;
|
|
626
|
+
break;
|
|
627
|
+
case Z:
|
|
628
|
+
i = n.partitionKeyLength + n.keyLength;
|
|
629
|
+
break;
|
|
630
|
+
case N:
|
|
631
|
+
case O:
|
|
632
|
+
i = n.partitionKeyLength;
|
|
633
|
+
break;
|
|
634
|
+
case B:
|
|
635
|
+
case ee:
|
|
636
|
+
i = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
switch (e) {
|
|
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);
|
|
647
|
+
}
|
|
648
|
+
break;
|
|
649
|
+
case Z:
|
|
650
|
+
case B:
|
|
651
|
+
case ee:
|
|
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);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
return { data: r, keyLength: i };
|
|
664
|
+
}
|
|
665
|
+
function Ye(t) {
|
|
666
|
+
const e = ze(t);
|
|
667
|
+
if (!e) return;
|
|
668
|
+
const { data: n, keyLength: r } = e, i = [];
|
|
669
|
+
for (let s = 0; s < r; ++s)
|
|
670
|
+
i.push(/* @__PURE__ */ new Set());
|
|
671
|
+
for (const s of n) {
|
|
672
|
+
if (s.length !== r)
|
|
673
|
+
throw new Error("key length does not match partition length");
|
|
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
|
+
}
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
function re(t, e) {
|
|
838
|
+
if (t === void 0) return e === void 0;
|
|
839
|
+
if (e === void 0) return !0;
|
|
840
|
+
for (const n in e)
|
|
841
|
+
if (t[n] !== e[n]) return !1;
|
|
842
|
+
return !0;
|
|
843
|
+
}
|
|
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 {
|
|
567
861
|
constructor() {
|
|
568
|
-
|
|
569
|
-
// @TODO: unused, what is this for?
|
|
570
|
-
P(this, "defaultLabelFn", (e, n) => {
|
|
571
|
-
var s;
|
|
572
|
-
return ((s = e.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
|
|
573
|
-
});
|
|
862
|
+
T(this, "ctx", h());
|
|
574
863
|
}
|
|
575
864
|
/**
|
|
576
865
|
* @deprecated use getOptions()
|
|
@@ -579,35 +868,199 @@ class Ue {
|
|
|
579
868
|
return this.ctx.calculateOptions(e);
|
|
580
869
|
}
|
|
581
870
|
getOptions(e, n) {
|
|
582
|
-
const
|
|
583
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
584
|
-
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,
|
|
585
874
|
label: o
|
|
586
|
-
})) :
|
|
587
|
-
ref:
|
|
588
|
-
label: n(
|
|
875
|
+
})) : i.map((s) => ({
|
|
876
|
+
ref: s.ref,
|
|
877
|
+
label: n(s.obj, s.ref)
|
|
589
878
|
}));
|
|
590
879
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
880
|
+
/**
|
|
881
|
+
* Internal implementation that generates UniversalPColumnEntry objects from the provided
|
|
882
|
+
* anchors and selectors.
|
|
883
|
+
*/
|
|
884
|
+
getUniversalPColumnEntries(e, n, r) {
|
|
885
|
+
const i = {};
|
|
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)
|
|
599
891
|
return;
|
|
600
|
-
|
|
892
|
+
i[l] = u;
|
|
601
893
|
} else
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
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;
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
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
|
+
}
|
|
939
|
+
}
|
|
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
|
+
});
|
|
947
|
+
}
|
|
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
|
|
609
966
|
}));
|
|
610
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
|
+
}
|
|
611
1064
|
/**
|
|
612
1065
|
* @deprecated use getData()
|
|
613
1066
|
*/
|
|
@@ -622,7 +1075,7 @@ class Ue {
|
|
|
622
1075
|
ref: n.ref,
|
|
623
1076
|
obj: {
|
|
624
1077
|
...n.obj,
|
|
625
|
-
data: new
|
|
1078
|
+
data: new I(n.obj.data, [n.ref.blockId, n.ref.name])
|
|
626
1079
|
}
|
|
627
1080
|
}))
|
|
628
1081
|
};
|
|
@@ -641,9 +1094,9 @@ class Ue {
|
|
|
641
1094
|
ref: n.ref,
|
|
642
1095
|
obj: {
|
|
643
1096
|
...n.obj,
|
|
644
|
-
data:
|
|
1097
|
+
data: Fe(
|
|
645
1098
|
n.obj.data,
|
|
646
|
-
(
|
|
1099
|
+
(r) => new I(r, [n.ref.blockId, n.ref.name])
|
|
647
1100
|
)
|
|
648
1101
|
}
|
|
649
1102
|
}))
|
|
@@ -663,13 +1116,17 @@ class Ue {
|
|
|
663
1116
|
* @returns data associated with the ref
|
|
664
1117
|
*/
|
|
665
1118
|
getDataByRef(e) {
|
|
666
|
-
var
|
|
667
|
-
|
|
668
|
-
(
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
)
|
|
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
|
+
);
|
|
673
1130
|
}
|
|
674
1131
|
/**
|
|
675
1132
|
* Returns data associated with the ref ensuring that it is a p-column.
|
|
@@ -679,7 +1136,7 @@ class Ue {
|
|
|
679
1136
|
getPColumnByRef(e) {
|
|
680
1137
|
const n = this.getDataByRef(e);
|
|
681
1138
|
if (n)
|
|
682
|
-
return
|
|
1139
|
+
return Re(n);
|
|
683
1140
|
}
|
|
684
1141
|
/**
|
|
685
1142
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
@@ -689,7 +1146,7 @@ class Ue {
|
|
|
689
1146
|
getPColumnSpecByRef(e) {
|
|
690
1147
|
const n = this.getSpecByRef(e);
|
|
691
1148
|
if (n) {
|
|
692
|
-
if (!
|
|
1149
|
+
if (!J(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
|
|
693
1150
|
return n;
|
|
694
1151
|
}
|
|
695
1152
|
}
|
|
@@ -707,38 +1164,51 @@ class Ue {
|
|
|
707
1164
|
*/
|
|
708
1165
|
findDataWithCompatibleSpec(e) {
|
|
709
1166
|
const n = [];
|
|
710
|
-
e: for (const
|
|
711
|
-
if (!
|
|
1167
|
+
e: for (const r of this.getData().entries) {
|
|
1168
|
+
if (!J(r.obj.spec))
|
|
712
1169
|
continue;
|
|
713
|
-
const
|
|
714
|
-
if (e.name ===
|
|
715
|
-
for (let
|
|
716
|
-
const o = e.axesSpec[
|
|
717
|
-
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))
|
|
718
1175
|
continue e;
|
|
719
1176
|
}
|
|
720
|
-
n.push(
|
|
1177
|
+
n.push(r.obj);
|
|
721
1178
|
}
|
|
722
1179
|
}
|
|
723
1180
|
return n;
|
|
724
1181
|
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
1184
|
+
* @returns a map of axis value => label
|
|
1185
|
+
*/
|
|
1186
|
+
findLabels(e) {
|
|
1187
|
+
const n = this.getData();
|
|
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}`);
|
|
1194
|
+
return Object.fromEntries(
|
|
1195
|
+
Object.entries(
|
|
1196
|
+
r.obj.data.getDataAsJson().data
|
|
1197
|
+
).map((o) => [JSON.parse(o[0])[0], o[1]])
|
|
1198
|
+
);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
725
1202
|
}
|
|
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 {
|
|
1203
|
+
class z {
|
|
734
1204
|
constructor() {
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
1205
|
+
T(this, "ctx");
|
|
1206
|
+
T(this, "args");
|
|
1207
|
+
T(this, "uiState");
|
|
738
1208
|
// lazy rendering because this feature is rarely used
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
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) : {};
|
|
742
1212
|
}
|
|
743
1213
|
/**
|
|
744
1214
|
* Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
|
|
@@ -754,45 +1224,33 @@ class V {
|
|
|
754
1224
|
// return this.ctx.featureFlags;
|
|
755
1225
|
// }
|
|
756
1226
|
getNamedAccessor(e) {
|
|
757
|
-
return
|
|
1227
|
+
return ie(
|
|
758
1228
|
this.ctx.getAccessorHandleByName(e),
|
|
759
|
-
(n) => new
|
|
1229
|
+
(n) => new I(n, [e])
|
|
760
1230
|
);
|
|
761
1231
|
}
|
|
762
1232
|
get prerun() {
|
|
763
|
-
return this.getNamedAccessor(
|
|
1233
|
+
return this.getNamedAccessor(ve);
|
|
764
1234
|
}
|
|
765
1235
|
get outputs() {
|
|
766
|
-
return this.getNamedAccessor(
|
|
1236
|
+
return this.getNamedAccessor(we);
|
|
767
1237
|
}
|
|
768
1238
|
/**
|
|
769
1239
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
770
1240
|
* @returns a map of axis value => label
|
|
1241
|
+
* @deprecated Use resultPool.findLabels instead
|
|
771
1242
|
*/
|
|
772
1243
|
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
|
-
}
|
|
1244
|
+
return this.resultPool.findLabels(e);
|
|
787
1245
|
}
|
|
788
|
-
|
|
789
|
-
var
|
|
790
|
-
const n = e.some((
|
|
791
|
-
if (n && !
|
|
1246
|
+
verifyInlineAndExplicitColumnsSupport(e) {
|
|
1247
|
+
var i;
|
|
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");
|
|
792
1250
|
}
|
|
793
1251
|
createPFrame(e) {
|
|
794
|
-
return this.
|
|
795
|
-
e.map((n) =>
|
|
1252
|
+
return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
|
|
1253
|
+
e.map((n) => fe(n))
|
|
796
1254
|
);
|
|
797
1255
|
}
|
|
798
1256
|
createPTable(e) {
|
|
@@ -800,15 +1258,12 @@ class V {
|
|
|
800
1258
|
return "columns" in e ? n = {
|
|
801
1259
|
src: {
|
|
802
1260
|
type: "full",
|
|
803
|
-
entries: e.columns.map((
|
|
1261
|
+
entries: e.columns.map((r) => ({ type: "column", column: r }))
|
|
804
1262
|
},
|
|
805
1263
|
filters: e.filters ?? [],
|
|
806
1264
|
sorting: e.sorting ?? []
|
|
807
|
-
} : n = e, this.
|
|
808
|
-
|
|
809
|
-
n,
|
|
810
|
-
(s) => N(s, (r) => r instanceof S ? r.handle : r)
|
|
811
|
-
)
|
|
1265
|
+
} : n = e, this.verifyInlineAndExplicitColumnsSupport(ke(n.src)), this.ctx.createPTable(
|
|
1266
|
+
De(n, (r) => fe(r))
|
|
812
1267
|
);
|
|
813
1268
|
}
|
|
814
1269
|
/** @deprecated scheduled for removal from SDK */
|
|
@@ -820,189 +1275,76 @@ class V {
|
|
|
820
1275
|
return this.ctx.getCurrentUnstableMarker();
|
|
821
1276
|
}
|
|
822
1277
|
}
|
|
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.11";
|
|
937
|
-
function Je(t) {
|
|
1278
|
+
const U = "1.26.0";
|
|
1279
|
+
function tt(t) {
|
|
938
1280
|
return t.__renderLambda === !0;
|
|
939
1281
|
}
|
|
940
|
-
function
|
|
1282
|
+
function se(t) {
|
|
941
1283
|
if (t !== void 0)
|
|
942
|
-
return
|
|
1284
|
+
return tt(t) ? t.handle : t;
|
|
943
1285
|
}
|
|
944
|
-
function
|
|
1286
|
+
function D(t) {
|
|
945
1287
|
if (t !== void 0)
|
|
946
1288
|
return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
|
|
947
1289
|
}
|
|
948
|
-
function
|
|
1290
|
+
function Mt(t) {
|
|
949
1291
|
if (t.v3 !== void 0) {
|
|
950
1292
|
const {
|
|
951
1293
|
initialArgs: e,
|
|
952
1294
|
initialUiState: n,
|
|
953
|
-
inputsValid:
|
|
954
|
-
outputs:
|
|
955
|
-
renderingMode:
|
|
1295
|
+
inputsValid: r,
|
|
1296
|
+
outputs: i,
|
|
1297
|
+
renderingMode: s,
|
|
956
1298
|
sdkVersion: o,
|
|
957
|
-
sections:
|
|
958
|
-
title:
|
|
959
|
-
} = t.v3, { code:
|
|
1299
|
+
sections: a,
|
|
1300
|
+
title: c
|
|
1301
|
+
} = t.v3, { code: l } = t;
|
|
960
1302
|
return {
|
|
961
1303
|
initialArgs: e,
|
|
962
1304
|
initialUiState: n,
|
|
963
|
-
inputsValid:
|
|
964
|
-
outputs:
|
|
965
|
-
renderingMode:
|
|
1305
|
+
inputsValid: r,
|
|
1306
|
+
outputs: i,
|
|
1307
|
+
renderingMode: s,
|
|
966
1308
|
sdkVersion: o,
|
|
967
|
-
sections:
|
|
968
|
-
title:
|
|
969
|
-
code:
|
|
1309
|
+
sections: a,
|
|
1310
|
+
title: c,
|
|
1311
|
+
code: l
|
|
970
1312
|
};
|
|
971
1313
|
} else if (t.inputsValid !== void 0) {
|
|
972
|
-
const { sdkVersion: e, renderingMode: n, outputs:
|
|
973
|
-
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)
|
|
974
1316
|
throw new Error(
|
|
975
|
-
`Malformed config v2. SDK version ${e}; Fields = ${
|
|
1317
|
+
`Malformed config v2. SDK version ${e}; Fields = ${c.join(", ")}`
|
|
976
1318
|
);
|
|
977
1319
|
return {
|
|
978
1320
|
sdkVersion: e,
|
|
979
1321
|
renderingMode: n,
|
|
980
1322
|
initialArgs: o,
|
|
981
1323
|
outputs: Object.fromEntries(
|
|
982
|
-
Object.entries(
|
|
1324
|
+
Object.entries(r).map(([l, m]) => [l, D(m)])
|
|
983
1325
|
),
|
|
984
|
-
inputsValid:
|
|
985
|
-
sections:
|
|
1326
|
+
inputsValid: D(i),
|
|
1327
|
+
sections: D(s),
|
|
986
1328
|
initialUiState: void 0,
|
|
987
|
-
code:
|
|
1329
|
+
code: a
|
|
988
1330
|
};
|
|
989
1331
|
} else if (t.renderingMode !== void 0) {
|
|
990
|
-
const { sdkVersion: e, canRun: n, renderingMode:
|
|
991
|
-
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)
|
|
992
1334
|
throw new Error(
|
|
993
|
-
`Malformed config v1. SDK version ${e}; Fields = ${
|
|
1335
|
+
`Malformed config v1. SDK version ${e}; Fields = ${c.join(", ")}`
|
|
994
1336
|
);
|
|
995
1337
|
return {
|
|
996
1338
|
sdkVersion: e ?? "unknown",
|
|
997
|
-
renderingMode:
|
|
1339
|
+
renderingMode: r,
|
|
998
1340
|
initialArgs: o,
|
|
999
1341
|
outputs: Object.fromEntries(
|
|
1000
|
-
Object.entries(
|
|
1342
|
+
Object.entries(i).map(([l, m]) => [l, D(m)])
|
|
1001
1343
|
),
|
|
1002
|
-
inputsValid:
|
|
1003
|
-
sections:
|
|
1344
|
+
inputsValid: D(n),
|
|
1345
|
+
sections: D(s),
|
|
1004
1346
|
initialUiState: void 0,
|
|
1005
|
-
code:
|
|
1347
|
+
code: a
|
|
1006
1348
|
};
|
|
1007
1349
|
} else {
|
|
1008
1350
|
const { sdkVersion: e } = t, n = Object.keys(t);
|
|
@@ -1011,25 +1353,25 @@ function Lt(t) {
|
|
|
1011
1353
|
);
|
|
1012
1354
|
}
|
|
1013
1355
|
}
|
|
1014
|
-
class
|
|
1015
|
-
constructor(e, n,
|
|
1016
|
-
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;
|
|
1017
1359
|
}
|
|
1018
1360
|
static create(e = "Heavy") {
|
|
1019
|
-
return new
|
|
1361
|
+
return new _(
|
|
1020
1362
|
e,
|
|
1021
1363
|
void 0,
|
|
1022
1364
|
{},
|
|
1023
1365
|
{},
|
|
1024
|
-
|
|
1025
|
-
|
|
1366
|
+
Y(!0),
|
|
1367
|
+
Y([]),
|
|
1026
1368
|
void 0
|
|
1027
1369
|
);
|
|
1028
1370
|
}
|
|
1029
|
-
output(e, n,
|
|
1371
|
+
output(e, n, r = {}) {
|
|
1030
1372
|
if (typeof n == "function") {
|
|
1031
|
-
const
|
|
1032
|
-
return
|
|
1373
|
+
const i = `output#${e}`;
|
|
1374
|
+
return q(i, () => n(new z())), new _(
|
|
1033
1375
|
this._renderingMode,
|
|
1034
1376
|
this._initialArgs,
|
|
1035
1377
|
this._initialUiState,
|
|
@@ -1037,8 +1379,8 @@ class w {
|
|
|
1037
1379
|
...this._outputs,
|
|
1038
1380
|
[e]: {
|
|
1039
1381
|
__renderLambda: !0,
|
|
1040
|
-
handle:
|
|
1041
|
-
...
|
|
1382
|
+
handle: i,
|
|
1383
|
+
...r
|
|
1042
1384
|
}
|
|
1043
1385
|
},
|
|
1044
1386
|
this._inputsValid,
|
|
@@ -1046,7 +1388,7 @@ class w {
|
|
|
1046
1388
|
this._title
|
|
1047
1389
|
);
|
|
1048
1390
|
} else
|
|
1049
|
-
return new
|
|
1391
|
+
return new _(
|
|
1050
1392
|
this._renderingMode,
|
|
1051
1393
|
this._initialArgs,
|
|
1052
1394
|
this._initialUiState,
|
|
@@ -1064,7 +1406,7 @@ class w {
|
|
|
1064
1406
|
return this.output(e, n, { retentive: !0 });
|
|
1065
1407
|
}
|
|
1066
1408
|
argsValid(e) {
|
|
1067
|
-
return typeof e == "function" ? (
|
|
1409
|
+
return typeof e == "function" ? (q("inputsValid", () => e(new z())), new _(
|
|
1068
1410
|
this._renderingMode,
|
|
1069
1411
|
this._initialArgs,
|
|
1070
1412
|
this._initialUiState,
|
|
@@ -1075,7 +1417,7 @@ class w {
|
|
|
1075
1417
|
},
|
|
1076
1418
|
this._sections,
|
|
1077
1419
|
this._title
|
|
1078
|
-
)) : new
|
|
1420
|
+
)) : new _(
|
|
1079
1421
|
this._renderingMode,
|
|
1080
1422
|
this._initialArgs,
|
|
1081
1423
|
this._initialUiState,
|
|
@@ -1086,7 +1428,7 @@ class w {
|
|
|
1086
1428
|
);
|
|
1087
1429
|
}
|
|
1088
1430
|
sections(e) {
|
|
1089
|
-
return Array.isArray(e) ? this.sections(
|
|
1431
|
+
return Array.isArray(e) ? this.sections(Y(e)) : typeof e == "function" ? (q("sections", () => e(new z())), new _(
|
|
1090
1432
|
this._renderingMode,
|
|
1091
1433
|
this._initialArgs,
|
|
1092
1434
|
this._initialUiState,
|
|
@@ -1094,7 +1436,7 @@ class w {
|
|
|
1094
1436
|
this._inputsValid,
|
|
1095
1437
|
{ __renderLambda: !0, handle: "sections" },
|
|
1096
1438
|
this._title
|
|
1097
|
-
)) : new
|
|
1439
|
+
)) : new _(
|
|
1098
1440
|
this._renderingMode,
|
|
1099
1441
|
this._initialArgs,
|
|
1100
1442
|
this._initialUiState,
|
|
@@ -1106,7 +1448,7 @@ class w {
|
|
|
1106
1448
|
}
|
|
1107
1449
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
1108
1450
|
title(e) {
|
|
1109
|
-
return
|
|
1451
|
+
return q("title", () => e(new z())), new _(
|
|
1110
1452
|
this._renderingMode,
|
|
1111
1453
|
this._initialArgs,
|
|
1112
1454
|
this._initialUiState,
|
|
@@ -1121,7 +1463,7 @@ class w {
|
|
|
1121
1463
|
* @deprecated use {@link withArgs}
|
|
1122
1464
|
* */
|
|
1123
1465
|
initialArgs(e) {
|
|
1124
|
-
return new
|
|
1466
|
+
return new _(
|
|
1125
1467
|
this._renderingMode,
|
|
1126
1468
|
e,
|
|
1127
1469
|
this._initialUiState,
|
|
@@ -1133,7 +1475,7 @@ class w {
|
|
|
1133
1475
|
}
|
|
1134
1476
|
/** Sets initial args for the block, this value must be specified. */
|
|
1135
1477
|
withArgs(e) {
|
|
1136
|
-
return new
|
|
1478
|
+
return new _(
|
|
1137
1479
|
this._renderingMode,
|
|
1138
1480
|
e,
|
|
1139
1481
|
this._initialUiState,
|
|
@@ -1145,7 +1487,7 @@ class w {
|
|
|
1145
1487
|
}
|
|
1146
1488
|
/** Defines type and sets initial value for block UiState. */
|
|
1147
1489
|
withUiState(e) {
|
|
1148
|
-
return new
|
|
1490
|
+
return new _(
|
|
1149
1491
|
this._renderingMode,
|
|
1150
1492
|
this._initialArgs,
|
|
1151
1493
|
e,
|
|
@@ -1162,7 +1504,7 @@ class w {
|
|
|
1162
1504
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
1163
1505
|
const e = {
|
|
1164
1506
|
v3: {
|
|
1165
|
-
sdkVersion:
|
|
1507
|
+
sdkVersion: U,
|
|
1166
1508
|
renderingMode: this._renderingMode,
|
|
1167
1509
|
initialArgs: this._initialArgs,
|
|
1168
1510
|
initialUiState: this._initialUiState,
|
|
@@ -1172,185 +1514,185 @@ class w {
|
|
|
1172
1514
|
outputs: this._outputs
|
|
1173
1515
|
},
|
|
1174
1516
|
// fields below are added to allow previous desktop versions read generated configs
|
|
1175
|
-
sdkVersion:
|
|
1517
|
+
sdkVersion: U,
|
|
1176
1518
|
renderingMode: this._renderingMode,
|
|
1177
1519
|
initialArgs: this._initialArgs,
|
|
1178
|
-
inputsValid:
|
|
1179
|
-
sections:
|
|
1520
|
+
inputsValid: se(this._inputsValid),
|
|
1521
|
+
sections: se(this._sections),
|
|
1180
1522
|
outputs: Object.fromEntries(
|
|
1181
|
-
Object.entries(this._outputs).map(([n,
|
|
1523
|
+
Object.entries(this._outputs).map(([n, r]) => [n, se(r)])
|
|
1182
1524
|
)
|
|
1183
1525
|
};
|
|
1184
|
-
return
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
function
|
|
1188
|
-
var
|
|
1189
|
-
Array.isArray(
|
|
1190
|
-
const
|
|
1191
|
-
let
|
|
1192
|
-
if (
|
|
1193
|
-
for (const
|
|
1194
|
-
|
|
1195
|
-
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;
|
|
1196
1538
|
}, 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:
|
|
1539
|
+
for (const u of e)
|
|
1540
|
+
for (const f of u.spec.axesSpec) {
|
|
1541
|
+
const p = L(f);
|
|
1542
|
+
for (const d of i) {
|
|
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,
|
|
1208
1550
|
spec: {
|
|
1209
|
-
...
|
|
1210
|
-
axesSpec: [{ ...
|
|
1551
|
+
...d.spec,
|
|
1552
|
+
axesSpec: [{ ...p, annotations: y.annotations }]
|
|
1211
1553
|
},
|
|
1212
|
-
data:
|
|
1554
|
+
data: d.data
|
|
1213
1555
|
});
|
|
1214
1556
|
} else
|
|
1215
|
-
o.set(
|
|
1557
|
+
o.set(s(d.id), d);
|
|
1216
1558
|
}
|
|
1217
1559
|
}
|
|
1218
1560
|
}
|
|
1219
1561
|
if ([...e, ...o.values()].some(
|
|
1220
|
-
(
|
|
1562
|
+
(u) => u.data instanceof I && !u.data.getIsReadyOrError()
|
|
1221
1563
|
))
|
|
1222
1564
|
return;
|
|
1223
|
-
let
|
|
1224
|
-
const
|
|
1225
|
-
if (
|
|
1226
|
-
|
|
1227
|
-
for (const
|
|
1228
|
-
|
|
1229
|
-
}
|
|
1230
|
-
return
|
|
1565
|
+
let a = e;
|
|
1566
|
+
const c = [];
|
|
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);
|
|
1571
|
+
}
|
|
1572
|
+
return c.push(...o.values()), t.createPTable({
|
|
1231
1573
|
src: {
|
|
1232
1574
|
type: "outer",
|
|
1233
1575
|
primary: {
|
|
1234
|
-
type: (
|
|
1235
|
-
entries:
|
|
1576
|
+
type: (r == null ? void 0 : r.coreJoinType) ?? "full",
|
|
1577
|
+
entries: a.map((u) => ({ type: "column", column: u }))
|
|
1236
1578
|
},
|
|
1237
|
-
secondary:
|
|
1579
|
+
secondary: c.map((u) => ({ type: "column", column: u }))
|
|
1238
1580
|
},
|
|
1239
|
-
filters: [...(
|
|
1240
|
-
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) ?? []
|
|
1241
1583
|
});
|
|
1242
1584
|
}
|
|
1243
|
-
function
|
|
1244
|
-
const
|
|
1585
|
+
function Wt(t, e, n) {
|
|
1586
|
+
const r = t.resultPool.findLabels(e);
|
|
1245
1587
|
return {
|
|
1246
1588
|
axis: e,
|
|
1247
|
-
options: n.map((
|
|
1248
|
-
value:
|
|
1249
|
-
label: (
|
|
1589
|
+
options: n.map((i) => ({
|
|
1590
|
+
value: i,
|
|
1591
|
+
label: (r == null ? void 0 : r[i]) ?? i.toString()
|
|
1250
1592
|
})),
|
|
1251
1593
|
defaultValue: n[0]
|
|
1252
1594
|
};
|
|
1253
1595
|
}
|
|
1254
|
-
const
|
|
1596
|
+
const nt = (t, e) => {
|
|
1255
1597
|
let n = t.toString();
|
|
1256
|
-
return e == null || e.forEach((
|
|
1257
|
-
if (
|
|
1258
|
-
for (const [
|
|
1259
|
-
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;
|
|
1260
1602
|
}), n;
|
|
1261
1603
|
};
|
|
1262
|
-
function
|
|
1604
|
+
function rt(t) {
|
|
1263
1605
|
if (!t.length)
|
|
1264
1606
|
return [];
|
|
1265
1607
|
let e = [[]];
|
|
1266
1608
|
return t.forEach((n) => {
|
|
1267
|
-
const
|
|
1268
|
-
n.forEach((
|
|
1269
|
-
|
|
1270
|
-
}), e =
|
|
1609
|
+
const r = [];
|
|
1610
|
+
n.forEach((i) => {
|
|
1611
|
+
r.push(...e.map((s) => [...s, i]));
|
|
1612
|
+
}), e = r;
|
|
1271
1613
|
}), e;
|
|
1272
1614
|
}
|
|
1273
|
-
function
|
|
1274
|
-
const n = t.spec.axesSpec.map(
|
|
1275
|
-
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)));
|
|
1276
1618
|
}
|
|
1277
|
-
function
|
|
1278
|
-
const n = t.spec.axesSpec.map(
|
|
1279
|
-
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)));
|
|
1280
1622
|
}
|
|
1281
|
-
const
|
|
1282
|
-
function
|
|
1283
|
-
const n = t.spec.axesSpec.map(
|
|
1284
|
-
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))
|
|
1285
1627
|
return [];
|
|
1286
|
-
if (!
|
|
1628
|
+
if (!Pe(t, e))
|
|
1287
1629
|
return [];
|
|
1288
|
-
const o =
|
|
1289
|
-
const
|
|
1290
|
-
return
|
|
1291
|
-
const
|
|
1292
|
-
return Object.entries(
|
|
1293
|
-
if ((
|
|
1294
|
-
const
|
|
1295
|
-
|
|
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);
|
|
1296
1638
|
}
|
|
1297
1639
|
}), {
|
|
1298
|
-
...
|
|
1299
|
-
annotations: e.spec.axesSpec[
|
|
1640
|
+
...p,
|
|
1641
|
+
annotations: e.spec.axesSpec[d].annotations
|
|
1300
1642
|
};
|
|
1301
|
-
}),
|
|
1643
|
+
}), f;
|
|
1302
1644
|
});
|
|
1303
|
-
return [...
|
|
1304
|
-
|
|
1305
|
-
}),
|
|
1306
|
-
var
|
|
1307
|
-
const
|
|
1308
|
-
var
|
|
1309
|
-
return (
|
|
1310
|
-
}).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 = {
|
|
1311
1653
|
...e.spec.annotations,
|
|
1312
|
-
[
|
|
1654
|
+
[it]: "true"
|
|
1313
1655
|
};
|
|
1314
|
-
return (
|
|
1315
|
-
id:
|
|
1656
|
+
return (d || y) && (g[he] = d && y ? d + " / " + y : d + y), {
|
|
1657
|
+
id: p,
|
|
1316
1658
|
spec: {
|
|
1317
1659
|
...e.spec,
|
|
1318
|
-
axesSpec:
|
|
1319
|
-
...
|
|
1320
|
-
annotations: e.spec.axesSpec[
|
|
1660
|
+
axesSpec: u.map((w, x) => ({
|
|
1661
|
+
...w,
|
|
1662
|
+
annotations: e.spec.axesSpec[x].annotations
|
|
1321
1663
|
})),
|
|
1322
|
-
annotations:
|
|
1664
|
+
annotations: g
|
|
1323
1665
|
},
|
|
1324
1666
|
data: e.data
|
|
1325
1667
|
};
|
|
1326
1668
|
});
|
|
1327
1669
|
}
|
|
1328
|
-
function
|
|
1670
|
+
function ot(t) {
|
|
1329
1671
|
const e = [];
|
|
1330
1672
|
for (let n = 0; n < t.length; n++)
|
|
1331
|
-
for (let
|
|
1332
|
-
const
|
|
1673
|
+
for (let r = n + 1; r < t.length; r++) {
|
|
1674
|
+
const i = t[n], s = t[r];
|
|
1333
1675
|
e.push(
|
|
1334
|
-
...
|
|
1335
|
-
...
|
|
1676
|
+
...ge(i, s),
|
|
1677
|
+
...ge(s, i)
|
|
1336
1678
|
);
|
|
1337
1679
|
}
|
|
1338
1680
|
return e;
|
|
1339
1681
|
}
|
|
1340
|
-
function
|
|
1682
|
+
function at(t, e) {
|
|
1341
1683
|
const n = [...t];
|
|
1342
|
-
for (const
|
|
1343
|
-
for (const
|
|
1344
|
-
if (
|
|
1684
|
+
for (const r of e)
|
|
1685
|
+
for (const i of t) {
|
|
1686
|
+
if (i.id === r.id)
|
|
1345
1687
|
break;
|
|
1346
|
-
if (
|
|
1347
|
-
n.push(
|
|
1688
|
+
if (Pe(i, r)) {
|
|
1689
|
+
n.push(r);
|
|
1348
1690
|
break;
|
|
1349
1691
|
}
|
|
1350
1692
|
}
|
|
1351
1693
|
return n;
|
|
1352
1694
|
}
|
|
1353
|
-
const
|
|
1695
|
+
const lt = [
|
|
1354
1696
|
"Int",
|
|
1355
1697
|
"Long",
|
|
1356
1698
|
"Float",
|
|
@@ -1358,15 +1700,15 @@ const qe = [
|
|
|
1358
1700
|
"String",
|
|
1359
1701
|
"Bytes"
|
|
1360
1702
|
];
|
|
1361
|
-
function
|
|
1703
|
+
function Ht(t, e) {
|
|
1362
1704
|
if (e === void 0) return;
|
|
1363
|
-
const n = t.resultPool.getData().entries.map((
|
|
1364
|
-
if (!
|
|
1365
|
-
(
|
|
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)];
|
|
1706
|
+
if (!i.some(
|
|
1707
|
+
(s) => s.data instanceof I && !s.data.getIsReadyOrError()
|
|
1366
1708
|
))
|
|
1367
|
-
return t.createPFrame(
|
|
1709
|
+
return t.createPFrame(i);
|
|
1368
1710
|
}
|
|
1369
|
-
class
|
|
1711
|
+
class qt {
|
|
1370
1712
|
constructor(e) {
|
|
1371
1713
|
this.handle = e;
|
|
1372
1714
|
}
|
|
@@ -1386,101 +1728,103 @@ class Et {
|
|
|
1386
1728
|
return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
|
|
1387
1729
|
}
|
|
1388
1730
|
}
|
|
1389
|
-
function
|
|
1390
|
-
return
|
|
1731
|
+
function ut(t) {
|
|
1732
|
+
return ye({
|
|
1391
1733
|
__isRef: !0,
|
|
1392
|
-
blockId:
|
|
1393
|
-
name:
|
|
1734
|
+
blockId: X(t, "blockId"),
|
|
1735
|
+
name: X(t, "name")
|
|
1394
1736
|
});
|
|
1395
1737
|
}
|
|
1396
|
-
function
|
|
1397
|
-
return
|
|
1398
|
-
ref:
|
|
1399
|
-
label:
|
|
1738
|
+
function zt(t) {
|
|
1739
|
+
return ye({
|
|
1740
|
+
ref: ut(X(t, "ref")),
|
|
1741
|
+
label: X(t, "label")
|
|
1400
1742
|
});
|
|
1401
1743
|
}
|
|
1402
|
-
const
|
|
1403
|
-
sdkVersion:
|
|
1744
|
+
const Yt = {
|
|
1745
|
+
sdkVersion: U
|
|
1404
1746
|
};
|
|
1405
|
-
function
|
|
1406
|
-
return
|
|
1747
|
+
function Xt() {
|
|
1748
|
+
return be({ sdkVersion: U });
|
|
1407
1749
|
}
|
|
1408
|
-
function
|
|
1750
|
+
function Qt(t) {
|
|
1409
1751
|
if (typeof globalThis.getEnvironmentValue == "function")
|
|
1410
1752
|
return globalThis.getEnvironmentValue(t);
|
|
1411
1753
|
}
|
|
1412
1754
|
export {
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1755
|
+
gt as Args,
|
|
1756
|
+
_ as BlockModel,
|
|
1757
|
+
Yt as CurrentSdkInfo,
|
|
1758
|
+
S as FutureRef,
|
|
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,
|
|
1430
1772
|
Q as RT_RESOURCE_MAP,
|
|
1431
1773
|
Z as RT_RESOURCE_MAP_PARTITIONED,
|
|
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
|
-
|
|
1774
|
+
z as RenderCtx,
|
|
1775
|
+
et as ResultPool,
|
|
1776
|
+
bt as StagingOutputs,
|
|
1777
|
+
We as Trace,
|
|
1778
|
+
Ge as TraceEntry,
|
|
1779
|
+
I as TreeNodeAccessor,
|
|
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
|
|
1485
1829
|
};
|
|
1486
1830
|
//# sourceMappingURL=index.mjs.map
|