@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.mjs CHANGED
@@ -1,65 +1,65 @@
1
- var ve = Object.defineProperty;
2
- var _e = (t, e, n) => e in t ? ve(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var P = (t, e, n) => _e(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as B, mapPObjectData as N, selectorsToPredicate as te, AnchorIdDeriver as $, isPlRef as Ae, resolveAnchors as ne, isPColumnSpec as G, mapValueInVOE as Se, ensurePColumn as we, extractAllColumns as Ie, mapPTableDef as Pe, getAxisId as R, matchAxisId as D } from "@milaboratories/pl-model-common";
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 T } from "zod";
7
- class Ce extends Error {
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 Re(t) {
13
- if (!t.ok) throw new Ce(t.errors, t.moreErrors);
12
+ function De(t) {
13
+ if (!t.ok) throw new Le(t.errors, t.moreErrors);
14
14
  return t.value;
15
15
  }
16
- function Ze(t) {
16
+ function rt(t) {
17
17
  return new Proxy(t, {
18
18
  get(e, n) {
19
- return Re(e[n]);
19
+ return De(e[n]);
20
20
  }
21
21
  });
22
22
  }
23
- function y(t) {
24
- return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? j(t) : t;
23
+ function b(t) {
24
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? W(t) : t;
25
25
  }
26
- function O(t) {
26
+ function U(t) {
27
27
  return { type: "GetFromCtx", variable: t };
28
28
  }
29
- function et(t) {
29
+ function ot(t) {
30
30
  return {
31
31
  type: "Isolate",
32
32
  cfg: t
33
33
  };
34
34
  }
35
- const tt = O("$args"), nt = O("$it"), st = O("$prod"), rt = O("$staging"), it = O("$ui");
36
- function j(t) {
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 ce(t) {
39
+ function ge(t) {
40
40
  const e = {};
41
- for (const [n, s] of Object.entries(t)) e[n] = y(s);
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 ot(...t) {
47
+ function dt(...t) {
48
48
  const e = [];
49
- for (const n of t) e.push(y(n));
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 U(t, e) {
55
+ function H(t, e) {
56
56
  return {
57
57
  type: "GetJsonField",
58
- source: y(t),
59
- field: y(e)
58
+ source: b(t),
59
+ field: b(e)
60
60
  };
61
61
  }
62
- function at(t, e, n = "$it") {
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 lt(t, e, n = "$it") {
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 ut(t) {
78
+ function gt(t) {
79
79
  return {
80
80
  type: "Flatten",
81
81
  source: t
82
82
  };
83
83
  }
84
- function ct(t) {
84
+ function mt(t) {
85
85
  return {
86
86
  type: "IsEmpty",
87
87
  arg: t
88
88
  };
89
89
  }
90
- function dt(t) {
90
+ function yt(t) {
91
91
  return {
92
92
  type: "Not",
93
93
  operand: t
94
94
  };
95
95
  }
96
- function pt(t, e) {
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 ft(t, e) {
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 ht(t, e) {
110
+ function _t(t, e) {
111
111
  return {
112
112
  type: "GetResourceField",
113
- source: y(t),
114
- field: y(e)
113
+ source: b(t),
114
+ field: b(e)
115
115
  };
116
116
  }
117
- function gt() {
117
+ function At() {
118
118
  return function(t) {
119
119
  return {
120
120
  type: "GetResourceValueAsJson",
121
- source: y(t)
121
+ source: b(t)
122
122
  };
123
123
  };
124
124
  }
125
- function mt(t, e, n = "$it") {
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 yt(t) {
133
+ function wt(t) {
134
134
  return {
135
135
  type: "GetBlobContent",
136
- source: y(t)
136
+ source: b(t)
137
137
  };
138
138
  }
139
- function bt(t) {
139
+ function It(t) {
140
140
  return {
141
141
  type: "GetBlobContentAsString",
142
- source: y(t)
142
+ source: b(t)
143
143
  };
144
144
  }
145
- function vt() {
145
+ function Pt() {
146
146
  return function(t) {
147
147
  return {
148
148
  type: "GetBlobContentAsJson",
149
- source: y(t)
149
+ source: b(t)
150
150
  };
151
151
  };
152
152
  }
153
- function _t(t) {
153
+ function Ct(t) {
154
154
  return {
155
155
  type: "GetDownloadedBlobContent",
156
- source: y(t)
156
+ source: b(t)
157
157
  };
158
158
  }
159
- function At(t) {
159
+ function xt(t) {
160
160
  return {
161
161
  type: "GetOnDemandBlobContent",
162
- source: y(t)
162
+ source: b(t)
163
163
  };
164
164
  }
165
- function St(t, e) {
165
+ function Tt(t, e) {
166
166
  return {
167
167
  type: "ExtractArchiveAndGetURL",
168
168
  format: e,
169
- source: y(t)
169
+ source: b(t)
170
170
  };
171
171
  }
172
- function wt(t) {
172
+ function Rt(t) {
173
173
  return {
174
174
  type: "GetImportProgress",
175
- source: y(t)
175
+ source: b(t)
176
176
  };
177
177
  }
178
- function It(t, e) {
178
+ function Ft(t, e) {
179
179
  return {
180
180
  type: "GetLastLogs",
181
- source: y(t),
181
+ source: b(t),
182
182
  lines: e
183
183
  };
184
184
  }
185
- function Pt(t, e) {
185
+ function Lt(t, e) {
186
186
  return {
187
187
  type: "GetProgressLog",
188
- source: y(t),
188
+ source: b(t),
189
189
  patternToSearch: e
190
190
  };
191
191
  }
192
- function Ct(t, e) {
192
+ function Dt(t, e) {
193
193
  return {
194
194
  type: "GetProgressLogWithInfo",
195
- source: y(t),
195
+ source: b(t),
196
196
  patternToSearch: e
197
197
  };
198
198
  }
199
- function Rt(t) {
199
+ function kt(t) {
200
200
  return {
201
201
  type: "GetLogHandle",
202
- source: y(t)
202
+ source: b(t)
203
203
  };
204
204
  }
205
- function Fe() {
205
+ function ke() {
206
206
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
207
207
  }
208
- function de(t) {
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 Te() {
214
+ function Ee() {
215
215
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
216
216
  }
217
- function f() {
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 E(t, e) {
222
- const n = Te();
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 W = /* @__PURE__ */ new Map();
228
- function xe(t, e) {
229
- t in f().callbackRegistry || (f().callbackRegistry[t] = (n) => {
230
- for (const s of W.get(t))
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
- }, W.set(t, [])), W.get(t).push(e);
232
+ }, X.set(t, [])), X.get(t).push(e);
233
233
  }
234
- class _ {
234
+ class S {
235
235
  constructor(e, n = (s) => s) {
236
- P(this, "isResolved", !1);
237
- P(this, "resolvedValue");
238
- this.handle = e, this.postProcess = n, xe(e, (s) => {
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 _(this.handle, (n) => e(this.postProcess(n)));
243
+ return new S(this.handle, (n) => e(this.postProcess(n)));
244
244
  }
245
245
  mapDefined(e) {
246
- return new _(this.handle, (n) => {
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 z(t, e) {
255
+ function se(t, e) {
256
256
  return t === void 0 ? void 0 : e(t);
257
257
  }
258
- class S {
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((r) => typeof r == "string" ? r : r.field)
295
+ ...n.map((i) => typeof i == "string" ? i : i.field)
296
296
  ];
297
- return z(
298
- f().resolveWithCommon(this.handle, e, ...n),
299
- (r) => new S(r, s)
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 f().getResourceType(this.handle);
303
+ return g().getResourceType(this.handle);
304
304
  }
305
305
  getInputsLocked() {
306
- return f().getInputsLocked(this.handle);
306
+ return g().getInputsLocked(this.handle);
307
307
  }
308
308
  getOutputsLocked() {
309
- return f().getOutputsLocked(this.handle);
309
+ return g().getOutputsLocked(this.handle);
310
310
  }
311
311
  getIsReadyOrError() {
312
- return f().getIsReadyOrError(this.handle);
312
+ return g().getIsReadyOrError(this.handle);
313
313
  }
314
314
  getIsFinal() {
315
- return f().getIsFinal(this.handle);
315
+ return g().getIsFinal(this.handle);
316
316
  }
317
317
  getError() {
318
318
  const e = [...this.resolvePath, "error"];
319
- return z(
320
- f().getError(this.handle),
321
- (n) => new S(n, e)
319
+ return se(
320
+ g().getError(this.handle),
321
+ (n) => new I(n, e)
322
322
  );
323
323
  }
324
324
  listInputFields() {
325
- return f().listInputFields(this.handle);
325
+ return g().listInputFields(this.handle);
326
326
  }
327
327
  listOutputFields() {
328
- return f().listOutputFields(this.handle);
328
+ return g().listOutputFields(this.handle);
329
329
  }
330
330
  listDynamicFields() {
331
- return f().listDynamicFields(this.handle);
331
+ return g().listDynamicFields(this.handle);
332
332
  }
333
333
  getKeyValueBase64(e) {
334
- return f().getKeyValueBase64(this.handle, e);
334
+ return g().getKeyValueBase64(this.handle, e);
335
335
  }
336
336
  getKeyValueAsString(e) {
337
- return f().getKeyValueAsString(this.handle, e);
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 f().getDataBase64(this.handle);
345
+ return g().getDataBase64(this.handle);
346
346
  }
347
347
  getDataAsString() {
348
- return f().getDataAsString(this.handle);
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(([, i]) => {
361
- if (!B(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
362
- return i;
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 = f().parsePObjectCollection(
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 r = {};
377
- for (const [i, o] of Object.entries(s)) {
378
- const l = [...this.resolvePath, i];
379
- r[i] = N(o, (a) => new S(a, l));
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 r;
381
+ return i;
382
382
  }
383
383
  getFileContentAsBase64() {
384
- return new _(f().getBlobContentAsBase64(this.handle));
384
+ return new S(g().getBlobContentAsBase64(this.handle));
385
385
  }
386
386
  getFileContentAsString() {
387
- return new _(f().getBlobContentAsString(this.handle));
387
+ return new S(g().getBlobContentAsString(this.handle));
388
388
  }
389
389
  getFileContentAsJson() {
390
- return new _(
391
- f().getBlobContentAsString(this.handle)
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 _(f().getDownloadedBlobContentHandle(this.handle));
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 _(f().getOnDemandBlobContentHandle(this.handle));
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 _(f().extractArchiveAndGetURL(this.handle, e));
434
+ return new S(g().extractArchiveAndGetURL(this.handle, e));
435
435
  }
436
436
  getImportProgress() {
437
- return new _(f().getImportProgress(this.handle));
437
+ return new S(g().getImportProgress(this.handle));
438
438
  }
439
439
  getLastLogs(e) {
440
- return new _(f().getLastLogs(this.handle, e));
440
+ return new S(g().getLastLogs(this.handle, e));
441
441
  }
442
442
  getProgressLog(e) {
443
- return new _(f().getProgressLog(this.handle, e));
443
+ return new S(g().getProgressLog(this.handle, e));
444
444
  }
445
445
  getProgressLogWithInfo(e) {
446
- return new _(f().getProgressLogWithInfo(this.handle, e));
446
+ return new S(g().getProgressLogWithInfo(this.handle, e));
447
447
  }
448
448
  getLogHandle() {
449
- return new _(f().getLogHandle(this.handle));
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: r, skipUnresolved: i } = {
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 (r && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
470
+ if (i && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
471
471
  return;
472
- let a = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
473
- (u) => [u, this.resolve({ field: u, assertFieldType: s })]
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 i && (a = a.filter((u) => u[1] !== void 0)), a.map(([u, g]) => o(u, g));
475
+ return r && (c = c.filter((a) => a[1] !== void 0)), c.map(([a, h]) => o(a, h));
476
476
  }
477
477
  }
478
- const pe = "staging", fe = "main", Le = {
478
+ const ye = "staging", be = "main", je = {
479
479
  inlineColumnsSupport: !0,
480
480
  activeArgs: !0
481
481
  };
482
- function he(t) {
482
+ function ve(t) {
483
483
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
484
484
  }
485
- function Y(t, e, n) {
485
+ function ie(t, e, n) {
486
486
  if (e.has(n)) return;
487
487
  if (e.add(n), typeof n === "object")
488
- if (he(n)) n.__awaited_futures__.forEach((r) => t.add(r));
488
+ if (ve(n)) n.__awaited_futures__.forEach((i) => t.add(i));
489
489
  else if (Array.isArray(n))
490
- for (const r of n) Y(t, e, r);
490
+ for (const i of n) ie(t, e, i);
491
491
  else
492
- for (const [, r] of Object.entries(n))
493
- r !== n && Y(t, e, r);
492
+ for (const [, i] of Object.entries(n))
493
+ i !== n && ie(t, e, i);
494
494
  }
495
- function De(t) {
495
+ function Ve(t) {
496
496
  const e = /* @__PURE__ */ new Set();
497
- return Y(e, /* @__PURE__ */ new Set(), t), e;
497
+ return ie(e, /* @__PURE__ */ new Set(), t), e;
498
498
  }
499
- const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
499
+ const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
500
500
  __proto__: null,
501
- GlobalCfgRenderCtxFeatureFlags: Le,
502
- MainAccessorName: fe,
503
- StagingAccessorName: pe,
504
- getAllFutureAwaits: De,
505
- isFutureAwait: he
506
- }, Symbol.toStringTag, { value: "Module" })), Oe = "pl7.app/label", ke = "pl7.app/trace", Ee = T.object({
507
- type: T.string(),
508
- importance: T.number().optional(),
509
- id: T.string().optional(),
510
- label: T.string()
511
- }), Ve = T.array(Ee), je = 1e-3, Ne = "__LABEL__", se = "__LABEL__@1";
512
- function re(t, e, n = {}) {
513
- const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = t.map((d) => {
514
- var A, ee;
515
- const h = e(d), p = (A = h.annotations) == null ? void 0 : A[Oe], b = (ee = h.annotations) == null ? void 0 : ee[ke], m = (b ? Ve.safeParse(JSON.parse(b)).data : void 0) ?? [];
516
- if (p) {
517
- const C = { label: p, type: Ne, importance: -2 };
518
- n.addLabelAsSuffix ? m.push(C) : m.splice(0, 0, C);
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 I = [], v = /* @__PURE__ */ new Map();
521
- for (let C = m.length - 1; C >= 0; --C) {
522
- const { type: J } = m[C], be = m[C].importance ?? 0, M = (v.get(J) ?? 0) + 1;
523
- v.set(J, M);
524
- const x = `${J}@${M}`;
525
- r.set(x, (r.get(x) ?? 0) + 1), s.set(
526
- x,
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(x) ?? Number.NEGATIVE_INFINITY,
529
- be - (m.length - C) * je
535
+ s.get(O) ?? Number.NEGATIVE_INFINITY,
536
+ q - (w.length - C) * Je
530
537
  )
531
- ), I.push({ ...m[C], fullType: x, occurenceIndex: M });
538
+ ), L.push({ ...w[C], fullType: O, occurenceIndex: z });
532
539
  }
533
- return I.reverse(), {
534
- value: d,
535
- spec: h,
536
- label: p,
537
- fullTrace: I
540
+ return L.reverse(), {
541
+ value: l,
542
+ spec: d,
543
+ label: A,
544
+ fullTrace: L
538
545
  };
539
- }), o = [], l = [], a = [...s];
540
- a.sort(([, d], [, h]) => h - d);
541
- for (const [d] of a)
542
- d.endsWith("@1") || r.get(d) === t.length ? o.push(d) : l.push(d);
543
- const u = (d) => i.map((h) => {
544
- const p = h.fullTrace.filter((m) => d.has(m.fullType)).map((m) => m.label), b = n.separator ?? " / ";
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: p.join(b),
547
- value: h.value
553
+ label: d.join(y),
554
+ value: f.value
548
555
  };
549
556
  });
550
557
  if (o.length === 0) {
551
- if (l.length !== 0) throw new Error("Assertion error.");
552
- return u(new Set(se));
553
- }
554
- let g = 0, c = 0;
555
- for (; g < o.length; ) {
556
- const d = /* @__PURE__ */ new Set();
557
- n.includeNativeLabel && d.add(se);
558
- for (let p = 0; p < g; ++p) d.add(o[p]);
559
- d.add(o[c]);
560
- const h = u(d);
561
- if (new Set(h.map((p) => p.label)).size === t.length) return h;
562
- c++, c == o.length && (g++, c = g);
563
- }
564
- return u(/* @__PURE__ */ new Set([...o, ...l]));
565
- }
566
- class Ue {
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
- P(this, "ctx", f());
695
+ x(this, "ctx", g());
569
696
  // @TODO: unused, what is this for?
570
- P(this, "defaultLabelFn", (e, n) => {
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 : te(e), r = this.getSpecs().entries.filter((i) => s(i.obj));
583
- return typeof n == "object" || typeof n > "u" ? re(r, (i) => i.obj, n ?? {}).map(({ value: { ref: i }, label: o }) => ({
584
- ref: i,
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
- })) : r.map((i) => ({
587
- ref: i.ref,
588
- label: n(i.obj, i.ref)
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 r = {};
594
- if (!(e instanceof $))
595
- for (const [a, u] of Object.entries(e))
596
- if (Ae(u)) {
597
- const g = this.getPColumnSpecByRef(u);
598
- if (!g)
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
- r[a] = g;
727
+ i[a] = p;
601
728
  } else
602
- r[a] = u;
603
- const i = typeof n == "function" ? n : te(
604
- Array.isArray(n) ? n.map((a) => ne(r, a)) : ne(r, n)
605
- ), o = this.getSpecs().entries.filter(({ obj: a }) => G(a) ? i(a) : !1), l = e instanceof $ ? e : new $(r);
606
- return re(o, (a) => a.obj, s ?? {}).map(({ value: { obj: a }, label: u }) => ({
607
- value: l.deriveCanonical(a),
608
- label: u
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 S(n.obj.data, [n.ref.blockId, n.ref.name])
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: Se(
823
+ data: xe(
645
824
  n.obj.data,
646
- (s) => new S(s, [n.ref.blockId, n.ref.name])
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 : N(
848
+ )) == null ? void 0 : n.obj : K(
670
849
  this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
671
- (s) => new S(s, [e.blockId, e.name])
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 we(n);
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 (!G(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
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 (!G(s.obj.spec))
890
+ if (!J(s.obj.spec))
712
891
  continue;
713
- const r = s.obj.spec;
714
- if (e.name === r.name && e.valueType === r.valueType && e.axesSpec.length === r.axesSpec.length && X(e.domain, r.domain)) {
715
- for (let i = 0; i < e.axesSpec.length; ++i) {
716
- const o = e.axesSpec[i], l = r.axesSpec[i];
717
- if (o.name !== l.name || o.type !== l.type || !X(o.domain, l.domain))
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
- function X(t, e) {
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
- P(this, "ctx");
736
- P(this, "args");
737
- P(this, "uiState");
927
+ x(this, "ctx");
928
+ x(this, "args");
929
+ x(this, "uiState");
738
930
  // lazy rendering because this feature is rarely used
739
- P(this, "_activeArgsCache");
740
- P(this, "resultPool", new Ue());
741
- this.ctx = f(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
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 z(
949
+ return se(
758
950
  this.ctx.getAccessorHandleByName(e),
759
- (n) => new S(n, [e])
951
+ (n) => new I(n, [e])
760
952
  );
761
953
  }
762
954
  get prerun() {
763
- return this.getNamedAccessor(pe);
955
+ return this.getNamedAccessor(ye);
764
956
  }
765
957
  get outputs() {
766
- return this.getNamedAccessor(fe);
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
- const n = this.resultPool.getData();
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 r;
790
- const n = e.some((i) => !(i.data instanceof S)), s = ((r = this.ctx.featureFlags) == null ? void 0 : r.inlineColumnsSupport) === !0;
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) => N(n, (s) => s instanceof S ? s.handle : s))
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(Ie(n.src)), this.ctx.createPTable(
808
- Pe(
987
+ } : n = e, this.verifyInlineColumnsSupport(Re(n.src)), this.ctx.createPTable(
988
+ Fe(
809
989
  n,
810
- (s) => N(s, (r) => r instanceof S ? r.handle : r)
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 k = "PColumnData/", Q = k + "ResourceMap", Z = k + "Partitioned/ResourceMap", ie = k + "JsonPartitioned", K = k + "BinaryPartitioned", ge = k + "Partitioned/", oe = ge + "JsonPartitioned", H = ge + "BinaryPartitioned";
824
- function me(t, e, n, s = [], r) {
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 q(t) {
1007
+ function ne(t) {
941
1008
  if (t !== void 0)
942
- return Je(t) ? t.handle : t;
1009
+ return He(t) ? t.handle : t;
943
1010
  }
944
- function F(t) {
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 Lt(t) {
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: r,
955
- renderingMode: i,
1021
+ outputs: i,
1022
+ renderingMode: r,
956
1023
  sdkVersion: o,
957
- sections: l,
958
- title: a
959
- } = t.v3, { code: u } = t;
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: r,
965
- renderingMode: i,
1031
+ outputs: i,
1032
+ renderingMode: r,
966
1033
  sdkVersion: o,
967
- sections: l,
968
- title: a,
969
- code: u
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: r, sections: i, initialArgs: o, code: l } = t, a = Object.keys(t);
973
- if (e === void 0 || n === void 0 || s === void 0 || r === void 0 || i === void 0 || o === 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 = ${a.join(", ")}`
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(([u, g]) => [u, F(g)])
1049
+ Object.entries(s).map(([a, h]) => [a, k(h)])
983
1050
  ),
984
- inputsValid: F(r),
985
- sections: F(i),
1051
+ inputsValid: k(i),
1052
+ sections: k(r),
986
1053
  initialUiState: void 0,
987
- code: l
1054
+ code: u
988
1055
  };
989
1056
  } else if (t.renderingMode !== void 0) {
990
- const { sdkVersion: e, canRun: n, renderingMode: s, outputs: r, sections: i, initialArgs: o, code: l } = t, a = Object.keys(t);
991
- if (s === void 0 || r === void 0 || n === void 0 || i === void 0 || o === 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 = ${a.join(", ")}`
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(r).map(([u, g]) => [u, F(g)])
1067
+ Object.entries(i).map(([a, h]) => [a, k(h)])
1001
1068
  ),
1002
- inputsValid: F(n),
1003
- sections: F(i),
1069
+ inputsValid: k(n),
1070
+ sections: k(r),
1004
1071
  initialUiState: void 0,
1005
- code: l
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 w {
1015
- constructor(e, n, s, r, i, o, l) {
1016
- this._renderingMode = e, this._initialArgs = n, this._initialUiState = s, this._outputs = r, this._inputsValid = i, this._sections = o, this._title = l;
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 w(
1086
+ return new P(
1020
1087
  e,
1021
1088
  void 0,
1022
1089
  {},
1023
1090
  {},
1024
- j(!0),
1025
- j([]),
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 r = `output#${e}`;
1032
- return E(r, () => n(new V())), new w(
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: r,
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 w(
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" ? (E("inputsValid", () => e(new V())), new w(
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 w(
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(j(e)) : typeof e == "function" ? (E("sections", () => e(new V())), new w(
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 w(
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 E("title", () => e(new V())), new w(
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 w(
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 w(
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 w(
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: L,
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: L,
1242
+ sdkVersion: j,
1176
1243
  renderingMode: this._renderingMode,
1177
1244
  initialArgs: this._initialArgs,
1178
- inputsValid: q(this._inputsValid),
1179
- sections: q(this._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, q(s)])
1248
+ Object.entries(this._outputs).map(([n, s]) => [n, ne(s)])
1182
1249
  )
1183
1250
  };
1184
- return Fe() ? de({ sdkVersion: L }) : { config: e };
1251
+ return ke() ? me({ sdkVersion: j }) : { config: e };
1185
1252
  }
1186
1253
  }
1187
- function Dt(t, e, n, s) {
1188
- var u, g;
1254
+ function Vt(t, e, n, s) {
1255
+ var a, h;
1189
1256
  Array.isArray(s) && (s = { filters: s });
1190
- const r = t.resultPool.getData().entries.map((c) => c.obj).filter(B).filter((c) => c.spec.name === "pl7.app/label" && c.spec.axesSpec.length === 1), i = (c, d) => {
1191
- let h = c.toString();
1192
- if (d)
1193
- for (const p in d)
1194
- h += p, h += d[p];
1195
- return h;
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 c of e)
1198
- for (const d of c.spec.axesSpec) {
1199
- const h = R(d);
1200
- for (const p of r) {
1201
- const b = p.spec.axesSpec[0], m = R(p.spec.axesSpec[0]);
1202
- if (D(h, m)) {
1203
- const I = Object.keys(h.domain ?? {}).length, v = Object.keys(m.domain ?? {}).length;
1204
- if (I > v) {
1205
- const A = i(p.id, h.domain);
1206
- o.set(A, {
1207
- id: A,
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
- ...p.spec,
1210
- axesSpec: [{ ...h, annotations: b.annotations }]
1276
+ ...d.spec,
1277
+ axesSpec: [{ ...f, annotations: y.annotations }]
1211
1278
  },
1212
- data: p.data
1279
+ data: d.data
1213
1280
  });
1214
1281
  } else
1215
- o.set(i(p.id), p);
1282
+ o.set(r(d.id), d);
1216
1283
  }
1217
1284
  }
1218
1285
  }
1219
1286
  if ([...e, ...o.values()].some(
1220
- (c) => c.data instanceof S && !c.data.getIsReadyOrError()
1287
+ (p) => p.data instanceof I && !p.data.getIsReadyOrError()
1221
1288
  ))
1222
1289
  return;
1223
- let l = e;
1224
- const a = [];
1290
+ let u = e;
1291
+ const c = [];
1225
1292
  if (s != null && s.coreColumnPredicate) {
1226
- l = [];
1227
- for (const c of e)
1228
- s.coreColumnPredicate(c.spec) ? l.push(c) : a.push(c);
1293
+ u = [];
1294
+ for (const p of e)
1295
+ s.coreColumnPredicate(p.spec) ? u.push(p) : c.push(p);
1229
1296
  }
1230
- return a.push(...o.values()), t.createPTable({
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: l.map((c) => ({ type: "column", column: c }))
1302
+ entries: u.map((p) => ({ type: "column", column: p }))
1236
1303
  },
1237
- secondary: a.map((c) => ({ type: "column", column: c }))
1304
+ secondary: c.map((p) => ({ type: "column", column: p }))
1238
1305
  },
1239
- filters: [...(s == null ? void 0 : s.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
1240
- sorting: ((g = n == null ? void 0 : n.pTableParams) == null ? void 0 : g.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 Ot(t, e, n) {
1310
+ function Nt(t, e, n) {
1244
1311
  const s = t.findLabels(e);
1245
1312
  return {
1246
1313
  axis: e,
1247
- options: n.map((r) => ({
1248
- value: r,
1249
- label: (s == null ? void 0 : s[r]) ?? r.toString()
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 Me = (t, e) => {
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 [r, i] of Object.entries(s))
1259
- n += r, n += i;
1325
+ for (const [i, r] of Object.entries(s))
1326
+ n += i, n += r;
1260
1327
  }), n;
1261
1328
  };
1262
- function $e(t) {
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((r) => {
1269
- s.push(...e.map((i) => [...i, r]));
1335
+ n.forEach((i) => {
1336
+ s.push(...e.map((r) => [...r, i]));
1270
1337
  }), e = s;
1271
1338
  }), e;
1272
1339
  }
1273
- function Ge(t, e) {
1274
- const n = t.spec.axesSpec.map(R);
1275
- return e.spec.axesSpec.map(R).every((r) => n.some((i) => D(i, r) && D(r, i)));
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 ye(t, e) {
1278
- const n = t.spec.axesSpec.map(R);
1279
- return e.spec.axesSpec.map(R).every((r) => n.some((i) => D(i, r)));
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 We = "pl7.app/graph/isVirtual", le = "pl7.app/label";
1282
- function ue(t, e) {
1283
- const n = t.spec.axesSpec.map(R), s = e.spec.axesSpec.map(R);
1284
- if (Ge(t, e))
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 (!ye(t, e))
1353
+ if (!Se(t, e))
1287
1354
  return [];
1288
- const o = s.map((c) => n.filter((d) => D(d, c))), l = $e(o), a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), g = l.map((c) => {
1289
- const d = /* @__PURE__ */ new Set();
1290
- return c.map((h, p) => {
1291
- const b = e.spec.axesSpec[p].domain, m = h.domain;
1292
- return Object.entries(m ?? {}).forEach(([I, v]) => {
1293
- if ((b == null ? void 0 : b[I]) === void 0) {
1294
- const A = JSON.stringify([I, v]);
1295
- d.add(A), a.add(A);
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
- ...h,
1299
- annotations: e.spec.axesSpec[p].annotations
1365
+ ...f,
1366
+ annotations: e.spec.axesSpec[d].annotations
1300
1367
  };
1301
- }), d;
1368
+ }), l;
1302
1369
  });
1303
- return [...a].forEach((c) => {
1304
- g.some((d) => !d.has(c)) && u.add(c);
1305
- }), l.map((c, d) => {
1306
- var I;
1307
- const h = Me(e.id, c.map((v) => v.domain)), p = ((I = e.spec.annotations) == null ? void 0 : I[le]) ?? "", b = [...g[d]].filter((v) => u.has(v)).sort().map((v) => {
1308
- var A;
1309
- return (A = JSON.parse(v)) == null ? void 0 : A[1];
1310
- }).join(" / "), m = {
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
- [We]: "true"
1379
+ [Xe]: "true"
1313
1380
  };
1314
- return (p || b) && (m[le] = p && b ? p + " / " + b : p + b), {
1315
- id: h,
1381
+ return (d || y) && (_[fe] = d && y ? d + " / " + y : d + y), {
1382
+ id: f,
1316
1383
  spec: {
1317
1384
  ...e.spec,
1318
- axesSpec: c.map((v, A) => ({
1385
+ axesSpec: p.map((v, m) => ({
1319
1386
  ...v,
1320
- annotations: e.spec.axesSpec[A].annotations
1387
+ annotations: e.spec.axesSpec[m].annotations
1321
1388
  })),
1322
- annotations: m
1389
+ annotations: _
1323
1390
  },
1324
1391
  data: e.data
1325
1392
  };
1326
1393
  });
1327
1394
  }
1328
- function Ke(t) {
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 r = t[n], i = t[s];
1399
+ const i = t[n], r = t[s];
1333
1400
  e.push(
1334
- ...ue(r, i),
1335
- ...ue(i, r)
1401
+ ...he(i, r),
1402
+ ...he(r, i)
1336
1403
  );
1337
1404
  }
1338
1405
  return e;
1339
1406
  }
1340
- function He(t, e) {
1407
+ function Ze(t, e) {
1341
1408
  const n = [...t];
1342
1409
  for (const s of e)
1343
- for (const r of t) {
1344
- if (r.id === s.id)
1410
+ for (const i of t) {
1411
+ if (i.id === s.id)
1345
1412
  break;
1346
- if (ye(r, s)) {
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 qe = [
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 kt(t, e) {
1428
+ function Ut(t, e) {
1362
1429
  if (e === void 0) return;
1363
- const n = t.resultPool.getData().entries.map((i) => i.obj).filter(B).filter((i) => qe.includes(i.spec.valueType)), s = He(e, n), r = [...s, ...Ke(s)];
1364
- if (!r.some(
1365
- (i) => i.data instanceof S && !i.data.getIsReadyOrError()
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(r);
1434
+ return t.createPFrame(i);
1368
1435
  }
1369
- class Et {
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 ze(t) {
1390
- return ce({
1456
+ function tt(t) {
1457
+ return ge({
1391
1458
  __isRef: !0,
1392
- blockId: U(t, "blockId"),
1393
- name: U(t, "name")
1459
+ blockId: H(t, "blockId"),
1460
+ name: H(t, "name")
1394
1461
  });
1395
1462
  }
1396
- function Vt(t) {
1397
- return ce({
1398
- ref: ze(U(t, "ref")),
1399
- label: U(t, "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 jt = {
1403
- sdkVersion: L
1469
+ const Jt = {
1470
+ sdkVersion: j
1404
1471
  };
1405
- function Nt() {
1406
- return de({ sdkVersion: L });
1472
+ function $t() {
1473
+ return me({ sdkVersion: j });
1407
1474
  }
1408
- function Ut(t) {
1475
+ function Gt(t) {
1409
1476
  if (typeof globalThis.getEnvironmentValue == "function")
1410
1477
  return globalThis.getEnvironmentValue(t);
1411
1478
  }
1412
1479
  export {
1413
- tt as Args,
1414
- w as BlockModel,
1415
- jt as CurrentSdkInfo,
1416
- _ as FutureRef,
1417
- We as IS_VIRTUAL_COLUMN,
1418
- nt as It,
1419
- Ft as JsRenderInternal,
1420
- le as LABEL_ANNOTATION,
1421
- st as MainOutputs,
1422
- Ce as OutputError,
1423
- Oe as PAnnotationLabel,
1424
- ke as PAnnotationTrace,
1425
- Et as PFrameImpl,
1426
- K as RT_BINARY_PARTITIONED,
1427
- H as RT_BINARY_SUPER_PARTITIONED,
1428
- ie as RT_JSON_PARTITIONED,
1429
- oe as RT_JSON_SUPER_PARTITIONED,
1430
- Q as RT_RESOURCE_MAP,
1431
- Z as RT_RESOURCE_MAP_PARTITIONED,
1432
- V as RenderCtx,
1433
- Ue as ResultPool,
1434
- rt as StagingOutputs,
1435
- Ve as Trace,
1436
- Ee as TraceEntry,
1437
- S as TreeNodeAccessor,
1438
- it as UiState,
1439
- pt as and,
1440
- kt as createPFrameForGraphs,
1441
- Dt as createPlDataTable,
1442
- Ot as createPlDataTableSheet,
1443
- re as deriveLabels,
1444
- q as downgradeCfgOrLambda,
1445
- He as enrichColumnsWithCompatible,
1446
- St as extractArchiveAndGetURL,
1447
- Lt as extractConfig,
1448
- ut as flatten,
1449
- Vt as fromPlOption,
1450
- ze as fromPlRef,
1451
- Ke as getAdditionalColumns,
1452
- yt as getBlobContent,
1453
- vt as getBlobContentAsJson,
1454
- bt as getBlobContentAsString,
1455
- _t as getDownloadedBlobContent,
1456
- Ut as getEnvironmentValue,
1457
- O as getFromCfg,
1458
- j as getImmediate,
1459
- wt as getImportProgress,
1460
- U as getJsonField,
1461
- It as getLastLogs,
1462
- Rt as getLogHandle,
1463
- At as getOnDemandBlobContent,
1464
- Be as getPartitionKeysList,
1465
- Pt as getProgressLog,
1466
- Ct as getProgressLogWithInfo,
1467
- Nt as getRawPlatformaInstance,
1468
- ht as getResourceField,
1469
- gt as getResourceValueAsJson,
1470
- xt as getUniquePartitionKeys,
1471
- z as ifDef,
1472
- Je as isConfigLambda,
1473
- ct as isEmpty,
1474
- et as isolate,
1475
- ot as makeArray,
1476
- ce as makeObject,
1477
- lt as mapArrayValues,
1478
- at as mapRecordValues,
1479
- mt as mapResourceFields,
1480
- dt as not,
1481
- ft as or,
1482
- Tt as parseResourceMap,
1483
- Re as readOutput,
1484
- Ze as wrapOutputs
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