@platforma-sdk/model 1.22.59 → 1.23.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,50 +1,50 @@
1
- var fe = Object.defineProperty;
2
- var he = (t, e, n) => e in t ? fe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var S = (t, e, n) => he(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as X, mapPObjectData as j, mapValueInVOE as ge, ensurePColumn as me, isPColumnSpec as Z, extractAllColumns as ye, mapPTableDef as be, getAxisId as U, matchAxisId as x } from "@milaboratories/pl-model-common";
1
+ var be = Object.defineProperty;
2
+ var ve = (t, e, n) => e in t ? be(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var A = (t, e, n) => ve(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as N, mapPObjectData as U, selectorsToPredicate as te, AnchorIdDeriver as $, isPlRef as _e, resolveAnchors as ne, isPColumnSpec as G, mapValueInVOE as Ae, ensurePColumn as Se, extractAllColumns as we, mapPTableDef as Ie, getAxisId as w, matchAxisId as L } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import { z as P } from "zod";
7
- class ve extends Error {
6
+ import { z as C } from "zod";
7
+ class Pe 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 _e(t) {
13
- if (!t.ok) throw new ve(t.errors, t.moreErrors);
12
+ function Ce(t) {
13
+ if (!t.ok) throw new Pe(t.errors, t.moreErrors);
14
14
  return t.value;
15
15
  }
16
- function $e(t) {
16
+ function Qe(t) {
17
17
  return new Proxy(t, {
18
18
  get(e, n) {
19
- return _e(e[n]);
19
+ return Ce(e[n]);
20
20
  }
21
21
  });
22
22
  }
23
23
  function m(t) {
24
- return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? V(t) : t;
24
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? j(t) : t;
25
25
  }
26
- function O(t) {
26
+ function k(t) {
27
27
  return { type: "GetFromCtx", variable: t };
28
28
  }
29
- function Ge(t) {
29
+ function Ze(t) {
30
30
  return {
31
31
  type: "Isolate",
32
32
  cfg: t
33
33
  };
34
34
  }
35
- const Ke = O("$args"), We = O("$it"), He = O("$prod"), qe = O("$staging"), ze = O("$ui");
36
- function V(t) {
35
+ const et = k("$args"), tt = k("$it"), nt = k("$prod"), st = k("$staging"), rt = k("$ui");
36
+ function j(t) {
37
37
  return { type: "Immediate", value: t };
38
38
  }
39
- function ie(t) {
39
+ function ue(t) {
40
40
  const e = {};
41
- for (const [n, r] of Object.entries(t)) e[n] = m(r);
41
+ for (const [n, s] of Object.entries(t)) e[n] = m(s);
42
42
  return {
43
43
  type: "MakeObject",
44
44
  template: e
45
45
  };
46
46
  }
47
- function Ye(...t) {
47
+ function it(...t) {
48
48
  const e = [];
49
49
  for (const n of t) e.push(m(n));
50
50
  return {
@@ -59,7 +59,7 @@ function B(t, e) {
59
59
  field: m(e)
60
60
  };
61
61
  }
62
- function Xe(t, e, n = "$it") {
62
+ function ot(t, e, n = "$it") {
63
63
  return {
64
64
  type: "MapRecordValues",
65
65
  source: t,
@@ -67,7 +67,7 @@ function Xe(t, e, n = "$it") {
67
67
  itVar: n
68
68
  };
69
69
  }
70
- function Qe(t, e, n = "$it") {
70
+ function at(t, e, n = "$it") {
71
71
  return {
72
72
  type: "MapArrayValues",
73
73
  source: t,
@@ -75,46 +75,46 @@ function Qe(t, e, n = "$it") {
75
75
  itVar: n
76
76
  };
77
77
  }
78
- function Ze(t) {
78
+ function lt(t) {
79
79
  return {
80
80
  type: "Flatten",
81
81
  source: t
82
82
  };
83
83
  }
84
- function et(t) {
84
+ function ut(t) {
85
85
  return {
86
86
  type: "IsEmpty",
87
87
  arg: t
88
88
  };
89
89
  }
90
- function tt(t) {
90
+ function ct(t) {
91
91
  return {
92
92
  type: "Not",
93
93
  operand: t
94
94
  };
95
95
  }
96
- function nt(t, e) {
96
+ function dt(t, e) {
97
97
  return {
98
98
  type: "And",
99
99
  operand1: t,
100
100
  operand2: e
101
101
  };
102
102
  }
103
- function rt(t, e) {
103
+ function pt(t, e) {
104
104
  return {
105
105
  type: "Or",
106
106
  operand1: t,
107
107
  operand2: e
108
108
  };
109
109
  }
110
- function st(t, e) {
110
+ function ft(t, e) {
111
111
  return {
112
112
  type: "GetResourceField",
113
113
  source: m(t),
114
114
  field: m(e)
115
115
  };
116
116
  }
117
- function it() {
117
+ function ht() {
118
118
  return function(t) {
119
119
  return {
120
120
  type: "GetResourceValueAsJson",
@@ -122,7 +122,7 @@ function it() {
122
122
  };
123
123
  };
124
124
  }
125
- function ot(t, e, n = "$it") {
125
+ function gt(t, e, n = "$it") {
126
126
  return {
127
127
  type: "MapResourceFields",
128
128
  source: t,
@@ -130,19 +130,19 @@ function ot(t, e, n = "$it") {
130
130
  itVar: n
131
131
  };
132
132
  }
133
- function at(t) {
133
+ function mt(t) {
134
134
  return {
135
135
  type: "GetBlobContent",
136
136
  source: m(t)
137
137
  };
138
138
  }
139
- function lt(t) {
139
+ function yt(t) {
140
140
  return {
141
141
  type: "GetBlobContentAsString",
142
142
  source: m(t)
143
143
  };
144
144
  }
145
- function ut() {
145
+ function bt() {
146
146
  return function(t) {
147
147
  return {
148
148
  type: "GetBlobContentAsJson",
@@ -150,93 +150,93 @@ function ut() {
150
150
  };
151
151
  };
152
152
  }
153
- function ct(t) {
153
+ function vt(t) {
154
154
  return {
155
155
  type: "GetDownloadedBlobContent",
156
156
  source: m(t)
157
157
  };
158
158
  }
159
- function dt(t) {
159
+ function _t(t) {
160
160
  return {
161
161
  type: "GetOnDemandBlobContent",
162
162
  source: m(t)
163
163
  };
164
164
  }
165
- function pt(t, e) {
165
+ function At(t, e) {
166
166
  return {
167
167
  type: "ExtractArchiveAndGetURL",
168
168
  format: e,
169
169
  source: m(t)
170
170
  };
171
171
  }
172
- function ft(t) {
172
+ function St(t) {
173
173
  return {
174
174
  type: "GetImportProgress",
175
175
  source: m(t)
176
176
  };
177
177
  }
178
- function ht(t, e) {
178
+ function wt(t, e) {
179
179
  return {
180
180
  type: "GetLastLogs",
181
181
  source: m(t),
182
182
  lines: e
183
183
  };
184
184
  }
185
- function gt(t, e) {
185
+ function It(t, e) {
186
186
  return {
187
187
  type: "GetProgressLog",
188
188
  source: m(t),
189
189
  patternToSearch: e
190
190
  };
191
191
  }
192
- function mt(t, e) {
192
+ function Pt(t, e) {
193
193
  return {
194
194
  type: "GetProgressLogWithInfo",
195
195
  source: m(t),
196
196
  patternToSearch: e
197
197
  };
198
198
  }
199
- function yt(t) {
199
+ function Ct(t) {
200
200
  return {
201
201
  type: "GetLogHandle",
202
202
  source: m(t)
203
203
  };
204
204
  }
205
- function Se() {
205
+ function Re() {
206
206
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
207
207
  }
208
- function oe(t) {
208
+ function ce(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 we() {
214
+ function Fe() {
215
215
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
216
216
  }
217
217
  function c() {
218
218
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
219
219
  throw new Error("Not in config rendering context");
220
220
  }
221
- function D(t, e) {
222
- const n = we();
221
+ function E(t, e) {
222
+ const n = Fe();
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 J = /* @__PURE__ */ new Map();
228
- function Ae(t, e) {
227
+ const W = /* @__PURE__ */ new Map();
228
+ function xe(t, e) {
229
229
  t in c().callbackRegistry || (c().callbackRegistry[t] = (n) => {
230
- for (const r of J.get(t))
231
- r(n);
232
- }, J.set(t, [])), J.get(t).push(e);
230
+ for (const s of W.get(t))
231
+ s(n);
232
+ }, W.set(t, [])), W.get(t).push(e);
233
233
  }
234
234
  class b {
235
- constructor(e, n = (r) => r) {
236
- S(this, "isResolved", !1);
237
- S(this, "resolvedValue");
238
- this.handle = e, this.postProcess = n, Ae(e, (r) => {
239
- this.resolvedValue = n(r), this.isResolved = !0;
235
+ constructor(e, n = (s) => s) {
236
+ A(this, "isResolved", !1);
237
+ A(this, "resolvedValue");
238
+ this.handle = e, this.postProcess = n, xe(e, (s) => {
239
+ this.resolvedValue = n(s), this.isResolved = !0;
240
240
  });
241
241
  }
242
242
  map(e) {
@@ -244,15 +244,15 @@ class b {
244
244
  }
245
245
  mapDefined(e) {
246
246
  return new b(this.handle, (n) => {
247
- const r = this.postProcess(n);
248
- return r ? e(r) : void 0;
247
+ const s = this.postProcess(n);
248
+ return s ? e(s) : 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 W(t, e) {
255
+ function z(t, e) {
256
256
  return t === void 0 ? void 0 : e(t);
257
257
  }
258
258
  class v {
@@ -261,27 +261,27 @@ class v {
261
261
  }
262
262
  resolve(...e) {
263
263
  const n = e.map(
264
- (r) => ({
264
+ (s) => ({
265
265
  assertFieldType: "Input",
266
- ...typeof r == "string" ? { field: r } : r
266
+ ...typeof s == "string" ? { field: s } : s
267
267
  })
268
268
  );
269
269
  return this.resolveWithCommon({}, ...n);
270
270
  }
271
271
  resolveOutput(...e) {
272
272
  const n = e.map(
273
- (r) => ({
273
+ (s) => ({
274
274
  assertFieldType: "Output",
275
- ...typeof r == "string" ? { field: r } : r
275
+ ...typeof s == "string" ? { field: s } : s
276
276
  })
277
277
  );
278
278
  return this.resolveWithCommon({}, ...n);
279
279
  }
280
280
  resolveInput(...e) {
281
281
  const n = e.map(
282
- (r) => ({
282
+ (s) => ({
283
283
  assertFieldType: "Input",
284
- ...typeof r == "string" ? { field: r } : r
284
+ ...typeof s == "string" ? { field: s } : s
285
285
  })
286
286
  );
287
287
  return this.resolveWithCommon({}, ...n);
@@ -290,13 +290,13 @@ class v {
290
290
  return this.resolveWithCommon({}, ...e);
291
291
  }
292
292
  resolveWithCommon(e, ...n) {
293
- const r = [
293
+ const s = [
294
294
  ...this.resolvePath,
295
- ...n.map((s) => typeof s == "string" ? s : s.field)
295
+ ...n.map((r) => typeof r == "string" ? r : r.field)
296
296
  ];
297
- return W(
297
+ return z(
298
298
  c().resolveWithCommon(this.handle, e, ...n),
299
- (s) => new v(s, r)
299
+ (r) => new v(r, s)
300
300
  );
301
301
  }
302
302
  get resourceType() {
@@ -316,7 +316,7 @@ class v {
316
316
  }
317
317
  getError() {
318
318
  const e = [...this.resolvePath, "error"];
319
- return W(
319
+ return z(
320
320
  c().getError(this.handle),
321
321
  (n) => new v(n, e)
322
322
  );
@@ -356,9 +356,9 @@ class v {
356
356
  *
357
357
  */
358
358
  getPColumns(e = !1, n = "") {
359
- const r = this.parsePObjectCollection(e, n);
360
- return r === void 0 ? void 0 : Object.entries(r).map(([, i]) => {
361
- if (!X(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
359
+ const s = this.parsePObjectCollection(e, n);
360
+ return s === void 0 ? void 0 : Object.entries(s).map(([, i]) => {
361
+ if (!N(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
362
362
  return i;
363
363
  });
364
364
  }
@@ -366,19 +366,19 @@ class v {
366
366
  *
367
367
  */
368
368
  parsePObjectCollection(e = !1, n = "") {
369
- const r = c().parsePObjectCollection(
369
+ const s = c().parsePObjectCollection(
370
370
  this.handle,
371
371
  e,
372
372
  n,
373
373
  ...this.resolvePath
374
374
  );
375
- if (r === void 0) return;
376
- const s = {};
377
- for (const [i, o] of Object.entries(r)) {
375
+ if (s === void 0) return;
376
+ const r = {};
377
+ for (const [i, o] of Object.entries(s)) {
378
378
  const l = [...this.resolvePath, i];
379
- s[i] = j(o, (a) => new v(a, l));
379
+ r[i] = U(o, (a) => new v(a, l));
380
380
  }
381
- return s;
381
+ return r;
382
382
  }
383
383
  getFileContentAsBase64() {
384
384
  return new b(c().getBlobContentAsBase64(this.handle));
@@ -461,114 +461,114 @@ class v {
461
461
  }
462
462
  }
463
463
  mapFields(e, n) {
464
- const { fieldType: r, requireLocked: s, skipUnresolved: i } = {
464
+ const { fieldType: s, requireLocked: r, skipUnresolved: i } = {
465
465
  fieldType: "Input",
466
466
  requireLocked: !0,
467
467
  skipUnresolved: !1,
468
468
  ...n
469
469
  }, o = e;
470
- if (s && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
470
+ if (r && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
471
471
  return;
472
- let a = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
473
- (u) => [u, this.resolve({ field: u, assertFieldType: r })]
472
+ let a = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
473
+ (u) => [u, this.resolve({ field: u, assertFieldType: s })]
474
474
  );
475
- return i && (a = a.filter((u) => u[1] !== void 0)), a.map(([u, h]) => o(u, h));
475
+ return i && (a = a.filter((u) => u[1] !== void 0)), a.map(([u, p]) => o(u, p));
476
476
  }
477
477
  }
478
- const ae = "staging", le = "main", Ce = {
478
+ const de = "staging", pe = "main", Te = {
479
479
  inlineColumnsSupport: !0,
480
480
  activeArgs: !0
481
481
  };
482
- function ue(t) {
482
+ function fe(t) {
483
483
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
484
484
  }
485
- function H(t, e, n) {
485
+ function Y(t, e, n) {
486
486
  if (e.has(n)) return;
487
487
  if (e.add(n), typeof n === "object")
488
- if (ue(n)) n.__awaited_futures__.forEach((s) => t.add(s));
488
+ if (fe(n)) n.__awaited_futures__.forEach((r) => t.add(r));
489
489
  else if (Array.isArray(n))
490
- for (const s of n) H(t, e, s);
490
+ for (const r of n) Y(t, e, r);
491
491
  else
492
- for (const [, s] of Object.entries(n))
493
- s !== n && H(t, e, s);
492
+ for (const [, r] of Object.entries(n))
493
+ r !== n && Y(t, e, r);
494
494
  }
495
- function Pe(t) {
495
+ function Le(t) {
496
496
  const e = /* @__PURE__ */ new Set();
497
- return H(e, /* @__PURE__ */ new Set(), t), e;
497
+ return Y(e, /* @__PURE__ */ new Set(), t), e;
498
498
  }
499
- const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
499
+ const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
500
500
  __proto__: null,
501
- GlobalCfgRenderCtxFeatureFlags: Ce,
502
- MainAccessorName: le,
503
- StagingAccessorName: ae,
504
- getAllFutureAwaits: Pe,
505
- isFutureAwait: ue
506
- }, Symbol.toStringTag, { value: "Module" })), Ie = "pl7.app/label", Re = "pl7.app/trace", Fe = P.object({
507
- type: P.string(),
508
- importance: P.number().optional(),
509
- id: P.string().optional(),
510
- label: P.string()
511
- }), xe = P.array(Fe), Te = 1e-3, Oe = "__LABEL__", ee = "__LABEL__@1";
512
- function ke(t, e, n = {}) {
513
- const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = t.map((p) => {
514
- var R, Q;
515
- const g = e(p), f = (R = g.annotations) == null ? void 0 : R[Ie], A = (Q = g.annotations) == null ? void 0 : Q[Re], y = (A ? xe.safeParse(JSON.parse(A)).data : void 0) ?? [];
516
- if (f) {
517
- const w = { label: f, type: Oe, importance: -2 };
518
- n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
501
+ GlobalCfgRenderCtxFeatureFlags: Te,
502
+ MainAccessorName: pe,
503
+ StagingAccessorName: de,
504
+ getAllFutureAwaits: Le,
505
+ isFutureAwait: fe
506
+ }, Symbol.toStringTag, { value: "Module" })), ke = "pl7.app/label", De = "pl7.app/trace", Oe = C.object({
507
+ type: C.string(),
508
+ importance: C.number().optional(),
509
+ id: C.string().optional(),
510
+ label: C.string()
511
+ }), Ee = C.array(Oe), Ve = 1e-3, je = "__LABEL__", se = "__LABEL__@1";
512
+ function re(t, e, n = {}) {
513
+ const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = t.map((f) => {
514
+ var F, ee;
515
+ const g = e(f), h = (F = g.annotations) == null ? void 0 : F[ke], I = (ee = g.annotations) == null ? void 0 : ee[De], y = (I ? Ee.safeParse(JSON.parse(I)).data : void 0) ?? [];
516
+ if (h) {
517
+ const S = { label: h, type: je, importance: -2 };
518
+ n.addLabelAsSuffix ? y.push(S) : y.splice(0, 0, S);
519
519
  }
520
- const I = [], L = /* @__PURE__ */ new Map();
521
- for (let w = y.length - 1; w >= 0; --w) {
522
- const { type: N } = y[w], pe = y[w].importance ?? 0, M = (L.get(N) ?? 0) + 1;
523
- L.set(N, M);
524
- const F = `${N}@${M}`;
525
- s.set(F, (s.get(F) ?? 0) + 1), r.set(
526
- F,
520
+ const R = [], O = /* @__PURE__ */ new Map();
521
+ for (let S = y.length - 1; S >= 0; --S) {
522
+ const { type: M } = y[S], ye = y[S].importance ?? 0, J = (O.get(M) ?? 0) + 1;
523
+ O.set(M, J);
524
+ const x = `${M}@${J}`;
525
+ r.set(x, (r.get(x) ?? 0) + 1), s.set(
526
+ x,
527
527
  Math.max(
528
- r.get(F) ?? Number.NEGATIVE_INFINITY,
529
- pe - (y.length - w) * Te
528
+ s.get(x) ?? Number.NEGATIVE_INFINITY,
529
+ ye - (y.length - S) * Ve
530
530
  )
531
- ), I.push({ ...y[w], fullType: F, occurenceIndex: M });
531
+ ), R.push({ ...y[S], fullType: x, occurenceIndex: J });
532
532
  }
533
- return I.reverse(), {
534
- value: p,
533
+ return R.reverse(), {
534
+ value: f,
535
535
  spec: g,
536
- label: f,
537
- fullTrace: I
536
+ label: h,
537
+ fullTrace: R
538
538
  };
539
- }), o = [], l = [], a = [...r];
540
- a.sort(([, p], [, g]) => g - p);
541
- for (const [p] of a)
542
- p.endsWith("@1") || s.get(p) === t.length ? o.push(p) : l.push(p);
543
- const u = (p) => i.map((g) => {
544
- const f = g.fullTrace.filter((y) => p.has(y.fullType)).map((y) => y.label), A = n.separator ?? " / ";
539
+ }), o = [], l = [], a = [...s];
540
+ a.sort(([, f], [, g]) => g - f);
541
+ for (const [f] of a)
542
+ f.endsWith("@1") || r.get(f) === t.length ? o.push(f) : l.push(f);
543
+ const u = (f) => i.map((g) => {
544
+ const h = g.fullTrace.filter((y) => f.has(y.fullType)).map((y) => y.label), I = n.separator ?? " / ";
545
545
  return {
546
- label: f.join(A),
546
+ label: h.join(I),
547
547
  value: g.value
548
548
  };
549
549
  });
550
550
  if (o.length === 0) {
551
551
  if (l.length !== 0) throw new Error("Assertion error.");
552
- return u(new Set(ee));
553
- }
554
- let h = 0, d = 0;
555
- for (; h < o.length; ) {
556
- const p = /* @__PURE__ */ new Set();
557
- n.includeNativeLabel && p.add(ee);
558
- for (let f = 0; f < h; ++f) p.add(o[f]);
559
- p.add(o[d]);
560
- const g = u(p);
561
- if (new Set(g.map((f) => f.label)).size === t.length) return g;
562
- d++, d == o.length && (h++, d = h);
552
+ return u(new Set(se));
553
+ }
554
+ let p = 0, d = 0;
555
+ for (; p < o.length; ) {
556
+ const f = /* @__PURE__ */ new Set();
557
+ n.includeNativeLabel && f.add(se);
558
+ for (let h = 0; h < p; ++h) f.add(o[h]);
559
+ f.add(o[d]);
560
+ const g = u(f);
561
+ if (new Set(g.map((h) => h.label)).size === t.length) return g;
562
+ d++, d == o.length && (p++, d = p);
563
563
  }
564
564
  return u(/* @__PURE__ */ new Set([...o, ...l]));
565
565
  }
566
- class Le {
566
+ class Ue {
567
567
  constructor() {
568
- S(this, "ctx", c());
569
- S(this, "defaultLabelFn", (e, n) => {
570
- var r;
571
- return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
568
+ A(this, "ctx", c());
569
+ A(this, "defaultLabelFn", (e, n) => {
570
+ var s;
571
+ return ((s = e.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
572
572
  });
573
573
  }
574
574
  /**
@@ -578,13 +578,33 @@ class Le {
578
578
  return this.ctx.calculateOptions(e);
579
579
  }
580
580
  getOptions(e, n) {
581
- const r = this.getSpecs().entries.filter((s) => e(s.obj));
582
- return typeof n == "object" || typeof n > "u" ? ke(r, (s) => s.obj, n ?? {}).map(({ value: { ref: s }, label: i }) => ({
583
- ref: s,
584
- label: i
585
- })) : r.map((s) => ({
586
- ref: s.ref,
587
- label: n(s.obj, s.ref)
581
+ const s = typeof e == "function" ? e : te(e), r = this.getSpecs().entries.filter((i) => s(i.obj));
582
+ return typeof n == "object" || typeof n > "u" ? re(r, (i) => i.obj, n ?? {}).map(({ value: { ref: i }, label: o }) => ({
583
+ ref: i,
584
+ label: o
585
+ })) : r.map((i) => ({
586
+ ref: i.ref,
587
+ label: n(i.obj, i.ref)
588
+ }));
589
+ }
590
+ // Implementation
591
+ getAnchoredOptions(e, n, s) {
592
+ const r = {};
593
+ if (!(e instanceof $))
594
+ for (const [a, u] of Object.entries(e))
595
+ if (_e(u)) {
596
+ const p = this.getPColumnSpecByRef(u);
597
+ if (!p)
598
+ return;
599
+ r[a] = p;
600
+ } else
601
+ r[a] = u;
602
+ const i = typeof n == "function" ? n : te(
603
+ Array.isArray(n) ? n.map((a) => ne(r, a)) : ne(r, n)
604
+ ), o = this.getSpecs().entries.filter(({ obj: a }) => G(a) ? i(a) : !1), l = e instanceof $ ? e : new $(r);
605
+ return re(o, (a) => a.obj, s ?? {}).map(({ value: { obj: a }, label: u }) => ({
606
+ value: l.deriveString(a),
607
+ label: u
588
608
  }));
589
609
  }
590
610
  /**
@@ -620,9 +640,9 @@ class Le {
620
640
  ref: n.ref,
621
641
  obj: {
622
642
  ...n.obj,
623
- data: ge(
643
+ data: Ae(
624
644
  n.obj.data,
625
- (r) => new v(r, [n.ref.blockId, n.ref.name])
645
+ (s) => new v(s, [n.ref.blockId, n.ref.name])
626
646
  )
627
647
  }
628
648
  }))
@@ -644,10 +664,10 @@ class Le {
644
664
  getDataByRef(e) {
645
665
  var n;
646
666
  return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
647
- (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
648
- )) == null ? void 0 : n.obj : j(
667
+ (s) => s.ref.blockId === e.blockId && s.ref.name === e.name
668
+ )) == null ? void 0 : n.obj : U(
649
669
  this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
650
- (r) => new v(r, [e.blockId, e.name])
670
+ (s) => new v(s, [e.blockId, e.name])
651
671
  );
652
672
  }
653
673
  /**
@@ -658,7 +678,7 @@ class Le {
658
678
  getPColumnByRef(e) {
659
679
  const n = this.getDataByRef(e);
660
680
  if (n)
661
- return me(n);
681
+ return Se(n);
662
682
  }
663
683
  /**
664
684
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -668,7 +688,7 @@ class Le {
668
688
  getPColumnSpecByRef(e) {
669
689
  const n = this.getSpecByRef(e);
670
690
  if (n) {
671
- if (!Z(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
691
+ if (!G(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
672
692
  return n;
673
693
  }
674
694
  }
@@ -677,10 +697,7 @@ class Le {
677
697
  * @returns object spec associated with the ref
678
698
  */
679
699
  getSpecByRef(e) {
680
- var n;
681
- return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
682
- (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
683
- )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
700
+ return this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
684
701
  }
685
702
  /**
686
703
  * @param spec object specification
@@ -689,37 +706,37 @@ class Le {
689
706
  */
690
707
  findDataWithCompatibleSpec(e) {
691
708
  const n = [];
692
- e: for (const r of this.getData().entries) {
693
- if (!Z(r.obj.spec))
709
+ e: for (const s of this.getData().entries) {
710
+ if (!G(s.obj.spec))
694
711
  continue;
695
- const s = r.obj.spec;
696
- if (e.name === s.name && e.valueType === s.valueType && e.axesSpec.length === s.axesSpec.length && q(e.domain, s.domain)) {
712
+ const r = s.obj.spec;
713
+ if (e.name === r.name && e.valueType === r.valueType && e.axesSpec.length === r.axesSpec.length && X(e.domain, r.domain)) {
697
714
  for (let i = 0; i < e.axesSpec.length; ++i) {
698
- const o = e.axesSpec[i], l = s.axesSpec[i];
699
- if (o.name !== l.name || o.type !== l.type || !q(o.domain, l.domain))
715
+ const o = e.axesSpec[i], l = r.axesSpec[i];
716
+ if (o.name !== l.name || o.type !== l.type || !X(o.domain, l.domain))
700
717
  continue e;
701
718
  }
702
- n.push(r.obj);
719
+ n.push(s.obj);
703
720
  }
704
721
  }
705
722
  return n;
706
723
  }
707
724
  }
708
- function q(t, e) {
725
+ function X(t, e) {
709
726
  if (t === void 0) return e === void 0;
710
727
  if (e === void 0) return !0;
711
728
  for (const n in e)
712
729
  if (t[n] !== e[n]) return !1;
713
730
  return !0;
714
731
  }
715
- class E {
732
+ class V {
716
733
  constructor() {
717
- S(this, "ctx");
718
- S(this, "args");
719
- S(this, "uiState");
734
+ A(this, "ctx");
735
+ A(this, "args");
736
+ A(this, "uiState");
720
737
  // lazy rendering because this feature is rarely used
721
- S(this, "_activeArgsCache");
722
- S(this, "resultPool", new Le());
738
+ A(this, "_activeArgsCache");
739
+ A(this, "resultPool", new Ue());
723
740
  this.ctx = c(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
724
741
  }
725
742
  /**
@@ -736,16 +753,16 @@ class E {
736
753
  // return this.ctx.featureFlags;
737
754
  // }
738
755
  getNamedAccessor(e) {
739
- return W(
756
+ return z(
740
757
  this.ctx.getAccessorHandleByName(e),
741
758
  (n) => new v(n, [e])
742
759
  );
743
760
  }
744
761
  get prerun() {
745
- return this.getNamedAccessor(ae);
762
+ return this.getNamedAccessor(de);
746
763
  }
747
764
  get outputs() {
748
- return this.getNamedAccessor(le);
765
+ return this.getNamedAccessor(pe);
749
766
  }
750
767
  /**
751
768
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -753,43 +770,43 @@ class E {
753
770
  */
754
771
  findLabels(e) {
755
772
  const n = this.resultPool.getData();
756
- for (const r of n.entries) {
757
- if (!X(r.obj)) continue;
758
- const s = r.obj.spec;
759
- if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === e.name && s.axesSpec[0].type === e.type && q(e.domain, s.axesSpec[0].domain)) {
760
- if (r.obj.data.resourceType.name !== "PColumnData/Json")
761
- throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
773
+ for (const s of n.entries) {
774
+ if (!N(s.obj)) continue;
775
+ const r = s.obj.spec;
776
+ 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)) {
777
+ if (s.obj.data.resourceType.name !== "PColumnData/Json")
778
+ throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
762
779
  return Object.fromEntries(
763
780
  Object.entries(
764
- r.obj.data.getDataAsJson().data
781
+ s.obj.data.getDataAsJson().data
765
782
  ).map((o) => [JSON.parse(o[0])[0], o[1]])
766
783
  );
767
784
  }
768
785
  }
769
786
  }
770
787
  verifyInlineColumnsSupport(e) {
771
- var s;
772
- const n = e.some((i) => !(i.data instanceof v)), r = ((s = this.ctx.featureFlags) == null ? void 0 : s.inlineColumnsSupport) === !0;
773
- if (n && !r) throw Error("inline columns not supported");
788
+ var r;
789
+ const n = e.some((i) => !(i.data instanceof v)), s = ((r = this.ctx.featureFlags) == null ? void 0 : r.inlineColumnsSupport) === !0;
790
+ if (n && !s) throw Error("inline columns not supported");
774
791
  }
775
792
  createPFrame(e) {
776
793
  return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(
777
- e.map((n) => j(n, (r) => r instanceof v ? r.handle : r))
794
+ e.map((n) => U(n, (s) => s instanceof v ? s.handle : s))
778
795
  );
779
796
  }
780
797
  createPTable(e) {
781
- var n;
798
+ let n;
782
799
  return "columns" in e ? n = {
783
800
  src: {
784
801
  type: "full",
785
- entries: e.columns.map((r) => ({ type: "column", column: r }))
802
+ entries: e.columns.map((s) => ({ type: "column", column: s }))
786
803
  },
787
804
  filters: e.filters ?? [],
788
805
  sorting: e.sorting ?? []
789
- } : n = e, this.verifyInlineColumnsSupport(ye(n.src)), this.ctx.createPTable(
790
- be(
806
+ } : n = e, this.verifyInlineColumnsSupport(we(n.src)), this.ctx.createPTable(
807
+ Ie(
791
808
  n,
792
- (r) => j(r, (s) => s instanceof v ? s.handle : s)
809
+ (s) => U(s, (r) => r instanceof v ? r.handle : r)
793
810
  )
794
811
  );
795
812
  }
@@ -802,30 +819,30 @@ class E {
802
819
  return this.ctx.getCurrentUnstableMarker();
803
820
  }
804
821
  }
805
- const k = "PColumnData/", z = k + "ResourceMap", Y = k + "Partitioned/ResourceMap", te = k + "JsonPartitioned", $ = k + "BinaryPartitioned", ce = k + "Partitioned/", ne = ce + "JsonPartitioned", G = ce + "BinaryPartitioned";
806
- function de(t, e, n, r = [], s) {
822
+ const D = "PColumnData/", Q = D + "ResourceMap", Z = D + "Partitioned/ResourceMap", ie = D + "JsonPartitioned", K = D + "BinaryPartitioned", he = D + "Partitioned/", oe = he + "JsonPartitioned", H = he + "BinaryPartitioned";
823
+ function ge(t, e, n, s = [], r) {
807
824
  if (t === void 0) return !1;
808
825
  switch (t.resourceType.name) {
809
- case z: {
826
+ case Q: {
810
827
  let i = t.getInputsLocked();
811
828
  for (const o of t.listInputFields()) {
812
- const l = t.resolve({ field: o, assertFieldType: "Input" }), a = [...r, ...JSON.parse(o)], u = l === void 0 ? void 0 : e(l);
813
- u === void 0 && (i = !1), (u !== void 0 || s) && n.push({ key: a, value: u });
829
+ const l = t.resolve({ field: o, assertFieldType: "Input" }), a = [...s, ...JSON.parse(o)], u = l === void 0 ? void 0 : e(l);
830
+ u === void 0 && (i = !1), (u !== void 0 || r) && n.push({ key: a, value: u });
814
831
  }
815
832
  return i;
816
833
  }
817
- case Y: {
834
+ case Z: {
818
835
  let i = t.getInputsLocked();
819
836
  for (const o of t.listInputFields()) {
820
837
  const l = t.resolve({ field: o, assertFieldType: "Input" });
821
838
  if (l === void 0) i = !1;
822
839
  else {
823
- const a = [...r, ...JSON.parse(o)], u = de(
840
+ const a = [...s, ...JSON.parse(o)], u = ge(
824
841
  l,
825
842
  e,
826
843
  n,
827
844
  a,
828
- s
845
+ r
829
846
  );
830
847
  i = i && u;
831
848
  }
@@ -836,104 +853,104 @@ function de(t, e, n, r = [], s) {
836
853
  throw new Error(`Unknown resource type: ${t.resourceType.name}`);
837
854
  }
838
855
  }
839
- function vt(t, e, n = !1) {
840
- const r = [];
841
- return { isComplete: de(t, e, r, [], n), data: r };
856
+ function Ft(t, e, n = !1) {
857
+ const s = [];
858
+ return { isComplete: ge(t, e, s, [], n), data: s };
842
859
  }
843
- const re = (t) => {
860
+ const ae = (t) => {
844
861
  if (!t.endsWith(".index")) {
845
862
  if (t.endsWith(".values"))
846
863
  return t.substring(0, t.length - 7);
847
864
  throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
848
865
  }
849
866
  };
850
- function De(t) {
867
+ function Be(t) {
851
868
  if (!t) return;
852
- const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
853
- let s = 0;
869
+ const e = t.resourceType.name, n = t.getDataAsJson(), s = [];
870
+ let r = 0;
854
871
  switch (e) {
855
- case z:
856
- s = n.keyLength;
872
+ case Q:
873
+ r = n.keyLength;
857
874
  break;
858
- case Y:
859
- s = n.partitionKeyLength + n.keyLength;
875
+ case Z:
876
+ r = n.partitionKeyLength + n.keyLength;
860
877
  break;
861
- case te:
862
- case $:
863
- s = n.partitionKeyLength;
878
+ case ie:
879
+ case K:
880
+ r = n.partitionKeyLength;
864
881
  break;
865
- case G:
866
- case ne:
867
- s = n.superPartitionKeyLength + n.partitionKeyLength;
882
+ case H:
883
+ case oe:
884
+ r = n.superPartitionKeyLength + n.partitionKeyLength;
868
885
  break;
869
886
  }
870
887
  switch (e) {
871
- case z:
872
- case te:
873
- case $:
888
+ case Q:
889
+ case ie:
890
+ case K:
874
891
  for (let i of t.listInputFields()) {
875
- if (e === $) {
876
- const l = re(i);
892
+ if (e === K) {
893
+ const l = ae(i);
877
894
  if (l) i = l;
878
895
  else continue;
879
896
  }
880
897
  const o = [...JSON.parse(i)];
881
- r.push(o);
898
+ s.push(o);
882
899
  }
883
900
  break;
884
- case Y:
885
- case G:
886
- case ne:
901
+ case Z:
902
+ case H:
903
+ case oe:
887
904
  for (const i of t.listInputFields()) {
888
905
  const o = [...JSON.parse(i)], l = t.resolve({ field: i, assertFieldType: "Input" });
889
906
  if (l !== void 0)
890
907
  for (let a of l.listInputFields()) {
891
- if (e === G) {
892
- const h = re(a);
893
- if (h) a = h;
908
+ if (e === H) {
909
+ const p = ae(a);
910
+ if (p) a = p;
894
911
  else continue;
895
912
  }
896
913
  const u = [...o, ...JSON.parse(a)];
897
- r.push(u);
914
+ s.push(u);
898
915
  }
899
916
  }
900
917
  break;
901
918
  }
902
- return { data: r, keyLength: s };
919
+ return { data: s, keyLength: r };
903
920
  }
904
- function _t(t) {
905
- const e = De(t);
921
+ function xt(t) {
922
+ const e = Be(t);
906
923
  if (!e) return;
907
- const { data: n, keyLength: r } = e, s = [];
908
- for (let i = 0; i < r; ++i)
909
- s.push(/* @__PURE__ */ new Set());
924
+ const { data: n, keyLength: s } = e, r = [];
925
+ for (let i = 0; i < s; ++i)
926
+ r.push(/* @__PURE__ */ new Set());
910
927
  for (const i of n) {
911
- if (i.length !== r)
928
+ if (i.length !== s)
912
929
  throw new Error("key length does not match partition length");
913
- for (let o = 0; o < r; ++o)
914
- s[o].add(i[o]);
930
+ for (let o = 0; o < s; ++o)
931
+ r[o].add(i[o]);
915
932
  }
916
- return s.map((i) => Array.from(i.values()));
933
+ return r.map((i) => Array.from(i.values()));
917
934
  }
918
- const T = "1.22.59";
919
- function Ee(t) {
935
+ const T = "1.23.0";
936
+ function Ne(t) {
920
937
  return t.__renderLambda === !0;
921
938
  }
922
- function K(t) {
939
+ function q(t) {
923
940
  if (t !== void 0)
924
- return Ee(t) ? t.handle : t;
941
+ return Ne(t) ? t.handle : t;
925
942
  }
926
- function C(t) {
943
+ function P(t) {
927
944
  if (t !== void 0)
928
945
  return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
929
946
  }
930
- function St(t) {
947
+ function Tt(t) {
931
948
  if (t.v3 !== void 0) {
932
949
  const {
933
950
  initialArgs: e,
934
951
  initialUiState: n,
935
- inputsValid: r,
936
- outputs: s,
952
+ inputsValid: s,
953
+ outputs: r,
937
954
  renderingMode: i,
938
955
  sdkVersion: o,
939
956
  sections: l,
@@ -942,8 +959,8 @@ function St(t) {
942
959
  return {
943
960
  initialArgs: e,
944
961
  initialUiState: n,
945
- inputsValid: r,
946
- outputs: s,
962
+ inputsValid: s,
963
+ outputs: r,
947
964
  renderingMode: i,
948
965
  sdkVersion: o,
949
966
  sections: l,
@@ -951,8 +968,8 @@ function St(t) {
951
968
  code: u
952
969
  };
953
970
  } else if (t.inputsValid !== void 0) {
954
- const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: s, sections: i, initialArgs: o, code: l } = t, a = Object.keys(t);
955
- if (e === void 0 || n === void 0 || r === void 0 || s === void 0 || i === void 0 || o === void 0)
971
+ const { sdkVersion: e, renderingMode: n, outputs: s, inputsValid: r, sections: i, initialArgs: o, code: l } = t, a = Object.keys(t);
972
+ if (e === void 0 || n === void 0 || s === void 0 || r === void 0 || i === void 0 || o === void 0)
956
973
  throw new Error(
957
974
  `Malformed config v2. SDK version ${e}; Fields = ${a.join(", ")}`
958
975
  );
@@ -961,28 +978,28 @@ function St(t) {
961
978
  renderingMode: n,
962
979
  initialArgs: o,
963
980
  outputs: Object.fromEntries(
964
- Object.entries(r).map(([u, h]) => [u, C(h)])
981
+ Object.entries(s).map(([u, p]) => [u, P(p)])
965
982
  ),
966
- inputsValid: C(s),
967
- sections: C(i),
983
+ inputsValid: P(r),
984
+ sections: P(i),
968
985
  initialUiState: void 0,
969
986
  code: l
970
987
  };
971
988
  } else if (t.renderingMode !== void 0) {
972
- const { sdkVersion: e, canRun: n, renderingMode: r, outputs: s, sections: i, initialArgs: o, code: l } = t, a = Object.keys(t);
973
- if (r === void 0 || s === void 0 || n === void 0 || i === void 0 || o === void 0)
989
+ const { sdkVersion: e, canRun: n, renderingMode: s, outputs: r, sections: i, initialArgs: o, code: l } = t, a = Object.keys(t);
990
+ if (s === void 0 || r === void 0 || n === void 0 || i === void 0 || o === void 0)
974
991
  throw new Error(
975
992
  `Malformed config v1. SDK version ${e}; Fields = ${a.join(", ")}`
976
993
  );
977
994
  return {
978
995
  sdkVersion: e ?? "unknown",
979
- renderingMode: r,
996
+ renderingMode: s,
980
997
  initialArgs: o,
981
998
  outputs: Object.fromEntries(
982
- Object.entries(s).map(([u, h]) => [u, C(h)])
999
+ Object.entries(r).map(([u, p]) => [u, P(p)])
983
1000
  ),
984
- inputsValid: C(n),
985
- sections: C(i),
1001
+ inputsValid: P(n),
1002
+ sections: P(i),
986
1003
  initialUiState: void 0,
987
1004
  code: l
988
1005
  };
@@ -994,8 +1011,8 @@ function St(t) {
994
1011
  }
995
1012
  }
996
1013
  class _ {
997
- constructor(e, n, r, s, i, o, l) {
998
- this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = s, this._inputsValid = i, this._sections = o, this._title = l;
1014
+ constructor(e, n, s, r, i, o, l) {
1015
+ this._renderingMode = e, this._initialArgs = n, this._initialUiState = s, this._outputs = r, this._inputsValid = i, this._sections = o, this._title = l;
999
1016
  }
1000
1017
  static create(e = "Heavy") {
1001
1018
  return new _(
@@ -1003,15 +1020,15 @@ class _ {
1003
1020
  void 0,
1004
1021
  {},
1005
1022
  {},
1006
- V(!0),
1007
- V([]),
1023
+ j(!0),
1024
+ j([]),
1008
1025
  void 0
1009
1026
  );
1010
1027
  }
1011
- output(e, n, r = {}) {
1028
+ output(e, n, s = {}) {
1012
1029
  if (typeof n == "function") {
1013
- const s = `output#${e}`;
1014
- return D(s, () => n(new E())), new _(
1030
+ const r = `output#${e}`;
1031
+ return E(r, () => n(new V())), new _(
1015
1032
  this._renderingMode,
1016
1033
  this._initialArgs,
1017
1034
  this._initialUiState,
@@ -1019,8 +1036,8 @@ class _ {
1019
1036
  ...this._outputs,
1020
1037
  [e]: {
1021
1038
  __renderLambda: !0,
1022
- handle: s,
1023
- ...r
1039
+ handle: r,
1040
+ ...s
1024
1041
  }
1025
1042
  },
1026
1043
  this._inputsValid,
@@ -1046,7 +1063,7 @@ class _ {
1046
1063
  return this.output(e, n, { retentive: !0 });
1047
1064
  }
1048
1065
  argsValid(e) {
1049
- return typeof e == "function" ? (D("inputsValid", () => e(new E())), new _(
1066
+ return typeof e == "function" ? (E("inputsValid", () => e(new V())), new _(
1050
1067
  this._renderingMode,
1051
1068
  this._initialArgs,
1052
1069
  this._initialUiState,
@@ -1068,7 +1085,7 @@ class _ {
1068
1085
  );
1069
1086
  }
1070
1087
  sections(e) {
1071
- return Array.isArray(e) ? this.sections(V(e)) : typeof e == "function" ? (D("sections", () => e(new E())), new _(
1088
+ return Array.isArray(e) ? this.sections(j(e)) : typeof e == "function" ? (E("sections", () => e(new V())), new _(
1072
1089
  this._renderingMode,
1073
1090
  this._initialArgs,
1074
1091
  this._initialUiState,
@@ -1088,7 +1105,7 @@ class _ {
1088
1105
  }
1089
1106
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
1090
1107
  title(e) {
1091
- return D("title", () => e(new E())), new _(
1108
+ return E("title", () => e(new V())), new _(
1092
1109
  this._renderingMode,
1093
1110
  this._initialArgs,
1094
1111
  this._initialUiState,
@@ -1157,44 +1174,44 @@ class _ {
1157
1174
  sdkVersion: T,
1158
1175
  renderingMode: this._renderingMode,
1159
1176
  initialArgs: this._initialArgs,
1160
- inputsValid: K(this._inputsValid),
1161
- sections: K(this._sections),
1177
+ inputsValid: q(this._inputsValid),
1178
+ sections: q(this._sections),
1162
1179
  outputs: Object.fromEntries(
1163
- Object.entries(this._outputs).map(([n, r]) => [n, K(r)])
1180
+ Object.entries(this._outputs).map(([n, s]) => [n, q(s)])
1164
1181
  )
1165
1182
  };
1166
- return Se() ? oe({ sdkVersion: T }) : { config: e };
1183
+ return Re() ? ce({ sdkVersion: T }) : { config: e };
1167
1184
  }
1168
1185
  }
1169
- function wt(t, e, n, r) {
1170
- var u, h;
1171
- Array.isArray(r) && (r = { filters: r });
1172
- const s = t.resultPool.getData().entries.map((d) => d.obj).filter(X).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), i = (d, p) => {
1186
+ function Lt(t, e, n, s) {
1187
+ var u, p;
1188
+ Array.isArray(s) && (s = { filters: s });
1189
+ const r = t.resultPool.getData().entries.map((d) => d.obj).filter(N).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), i = (d, f) => {
1173
1190
  let g = d.toString();
1174
- if (p)
1175
- for (const f in p)
1176
- g += f, g += p[f];
1191
+ if (f)
1192
+ for (const h in f)
1193
+ g += h, g += f[h];
1177
1194
  return g;
1178
1195
  }, o = /* @__PURE__ */ new Map();
1179
1196
  for (const d of e)
1180
- for (const p of d.spec.axesSpec) {
1181
- const g = U(p);
1182
- for (const f of s) {
1183
- const A = f.spec.axesSpec[0], y = U(f.spec.axesSpec[0]);
1184
- if (x(g, y)) {
1185
- const I = Object.keys(g.domain ?? {}).length, L = Object.keys(y.domain ?? {}).length;
1186
- if (I > L) {
1187
- const R = i(f.id, g.domain);
1188
- o.set(R, {
1189
- id: R,
1197
+ for (const f of d.spec.axesSpec) {
1198
+ const g = w(f);
1199
+ for (const h of r) {
1200
+ const I = h.spec.axesSpec[0], y = w(h.spec.axesSpec[0]);
1201
+ if (L(g, y)) {
1202
+ const R = Object.keys(g.domain ?? {}).length, O = Object.keys(y.domain ?? {}).length;
1203
+ if (R > O) {
1204
+ const F = i(h.id, g.domain);
1205
+ o.set(F, {
1206
+ id: F,
1190
1207
  spec: {
1191
- ...f.spec,
1192
- axesSpec: [{ ...g, annotations: A.annotations }]
1208
+ ...h.spec,
1209
+ axesSpec: [{ ...g, annotations: I.annotations }]
1193
1210
  },
1194
- data: f.data
1211
+ data: h.data
1195
1212
  });
1196
1213
  } else
1197
- o.set(i(f.id), f);
1214
+ o.set(i(h.id), h);
1198
1215
  }
1199
1216
  }
1200
1217
  }
@@ -1204,93 +1221,128 @@ function wt(t, e, n, r) {
1204
1221
  return;
1205
1222
  let l = e;
1206
1223
  const a = [];
1207
- if (r != null && r.coreColumnPredicate) {
1224
+ if (s != null && s.coreColumnPredicate) {
1208
1225
  l = [];
1209
1226
  for (const d of e)
1210
- r.coreColumnPredicate(d.spec) ? l.push(d) : a.push(d);
1227
+ s.coreColumnPredicate(d.spec) ? l.push(d) : a.push(d);
1211
1228
  }
1212
1229
  return a.push(...o.values()), t.createPTable({
1213
1230
  src: {
1214
1231
  type: "outer",
1215
1232
  primary: {
1216
- type: (r == null ? void 0 : r.coreJoinType) ?? "full",
1233
+ type: (s == null ? void 0 : s.coreJoinType) ?? "full",
1217
1234
  entries: l.map((d) => ({ type: "column", column: d }))
1218
1235
  },
1219
1236
  secondary: a.map((d) => ({ type: "column", column: d }))
1220
1237
  },
1221
- filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
1222
- sorting: ((h = n == null ? void 0 : n.pTableParams) == null ? void 0 : h.sorting) ?? []
1238
+ filters: [...(s == null ? void 0 : s.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
1239
+ sorting: ((p = n == null ? void 0 : n.pTableParams) == null ? void 0 : p.sorting) ?? []
1223
1240
  });
1224
1241
  }
1225
- function At(t, e, n) {
1226
- const r = t.findLabels(e);
1242
+ function kt(t, e, n) {
1243
+ const s = t.findLabels(e);
1227
1244
  return {
1228
1245
  axis: e,
1229
- options: n.map((s) => ({
1230
- value: s,
1231
- label: (r == null ? void 0 : r[s]) ?? s.toString()
1246
+ options: n.map((r) => ({
1247
+ value: r,
1248
+ label: (s == null ? void 0 : s[r]) ?? r.toString()
1232
1249
  })),
1233
1250
  defaultValue: n[0]
1234
1251
  };
1235
1252
  }
1236
- const Ve = (t, e) => {
1253
+ const Me = (t, e) => {
1237
1254
  let n = t.toString();
1238
- return e == null || e.forEach((r) => {
1239
- if (r)
1240
- for (const [s, i] of Object.entries(r))
1241
- n += s, n += i;
1255
+ return e == null || e.forEach((s) => {
1256
+ if (s)
1257
+ for (const [r, i] of Object.entries(s))
1258
+ n += r, n += i;
1242
1259
  }), n;
1243
1260
  };
1244
- function je(t) {
1261
+ function Je(t) {
1245
1262
  if (!t.length)
1246
1263
  return [];
1247
1264
  let e = [[]];
1248
1265
  return t.forEach((n) => {
1249
- const r = [];
1250
- n.forEach((s) => {
1251
- r.push(...e.map((i) => [...i, s]));
1252
- }), e = r;
1266
+ const s = [];
1267
+ n.forEach((r) => {
1268
+ s.push(...e.map((i) => [...i, r]));
1269
+ }), e = s;
1253
1270
  }), e;
1254
1271
  }
1255
- function se(t, e) {
1256
- const n = t.spec.axesSpec.map(U), r = e.spec.axesSpec.map(U);
1257
- if (r.every((a) => n.some((u) => x(u, a) && x(a, u))))
1272
+ function $e(t, e) {
1273
+ const n = t.spec.axesSpec.map(w);
1274
+ return e.spec.axesSpec.map(w).every((r) => n.some((i) => L(i, r) && L(r, i)));
1275
+ }
1276
+ function me(t, e) {
1277
+ const n = t.spec.axesSpec.map(w);
1278
+ return e.spec.axesSpec.map(w).every((r) => n.some((i) => L(i, r)));
1279
+ }
1280
+ const Ge = "pl7.app/graph/isVirtual";
1281
+ function le(t, e) {
1282
+ const n = t.spec.axesSpec.map(w), s = e.spec.axesSpec.map(w);
1283
+ if ($e(t, e))
1258
1284
  return [];
1259
- if (!r.every((a) => n.some((u) => x(u, a))))
1285
+ if (!me(t, e))
1260
1286
  return [];
1261
- const o = r.map((a) => n.filter((u) => x(u, a)));
1262
- return je(o).map((a) => ({
1263
- id: Ve(e.id, a.map((h) => h.domain)),
1287
+ const o = s.map((a) => n.filter((u) => L(u, a)));
1288
+ return Je(o).map((a) => ({
1289
+ id: Me(e.id, a.map((p) => p.domain)),
1264
1290
  spec: {
1265
1291
  ...e.spec,
1266
- axesSpec: a.map((h, d) => ({
1267
- ...h,
1292
+ axesSpec: a.map((p, d) => ({
1293
+ ...p,
1268
1294
  annotations: e.spec.axesSpec[d].annotations
1269
- }))
1295
+ })),
1296
+ annotations: {
1297
+ ...e.spec.annotations,
1298
+ [Ge]: "true"
1299
+ }
1270
1300
  },
1271
1301
  data: e.data
1272
1302
  }));
1273
1303
  }
1274
- function Ue(t) {
1304
+ function We(t) {
1275
1305
  const e = [];
1276
1306
  for (let n = 0; n < t.length; n++)
1277
- for (let r = n + 1; r < t.length; r++) {
1278
- const s = t[n], i = t[r];
1307
+ for (let s = n + 1; s < t.length; s++) {
1308
+ const r = t[n], i = t[s];
1279
1309
  e.push(
1280
- ...se(s, i),
1281
- ...se(i, s)
1310
+ ...le(r, i),
1311
+ ...le(i, r)
1282
1312
  );
1283
1313
  }
1284
1314
  return e;
1285
1315
  }
1286
- function Ct(t, e) {
1287
- const n = [...e, ...Ue(e)];
1288
- if (!n.some(
1289
- (r) => r.data instanceof v && !r.data.getIsReadyOrError()
1316
+ function Ke(t, e) {
1317
+ const n = [...t];
1318
+ for (const s of e)
1319
+ for (const r of t) {
1320
+ if (r.id === s.id)
1321
+ break;
1322
+ if (me(r, s)) {
1323
+ n.push(s);
1324
+ break;
1325
+ }
1326
+ }
1327
+ return n;
1328
+ }
1329
+ const He = [
1330
+ "Int",
1331
+ "Long",
1332
+ "Float",
1333
+ "Double",
1334
+ "String",
1335
+ "Bytes"
1336
+ ];
1337
+ function Dt(t, e) {
1338
+ if (e === void 0) return;
1339
+ const n = t.resultPool.getData().entries.map((i) => i.obj).filter(N).filter((i) => He.includes(i.spec.valueType)), s = Ke(e, n), r = [...s, ...We(s)];
1340
+ if (!r.some(
1341
+ (i) => i.data instanceof v && !i.data.getIsReadyOrError()
1290
1342
  ))
1291
- return t.createPFrame(n);
1343
+ return t.createPFrame(r);
1292
1344
  }
1293
- class Pt {
1345
+ class Ot {
1294
1346
  constructor(e) {
1295
1347
  this.handle = e;
1296
1348
  }
@@ -1310,98 +1362,100 @@ class Pt {
1310
1362
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
1311
1363
  }
1312
1364
  }
1313
- function Be(t) {
1314
- return ie({
1365
+ function qe(t) {
1366
+ return ue({
1315
1367
  __isRef: !0,
1316
1368
  blockId: B(t, "blockId"),
1317
1369
  name: B(t, "name")
1318
1370
  });
1319
1371
  }
1320
- function It(t) {
1321
- return ie({
1322
- ref: Be(B(t, "ref")),
1372
+ function Et(t) {
1373
+ return ue({
1374
+ ref: qe(B(t, "ref")),
1323
1375
  label: B(t, "label")
1324
1376
  });
1325
1377
  }
1326
- const Rt = {
1378
+ const Vt = {
1327
1379
  sdkVersion: T
1328
1380
  };
1329
- function Ft() {
1330
- return oe({ sdkVersion: T });
1381
+ function jt() {
1382
+ return ce({ sdkVersion: T });
1331
1383
  }
1332
- function xt(t) {
1384
+ function Ut(t) {
1333
1385
  if (typeof globalThis.getEnvironmentValue == "function")
1334
1386
  return globalThis.getEnvironmentValue(t);
1335
1387
  }
1336
1388
  export {
1337
- Ke as Args,
1389
+ et as Args,
1338
1390
  _ as BlockModel,
1339
- Rt as CurrentSdkInfo,
1391
+ Vt as CurrentSdkInfo,
1340
1392
  b as FutureRef,
1341
- We as It,
1342
- bt as JsRenderInternal,
1343
- He as MainOutputs,
1344
- ve as OutputError,
1345
- Ie as PAnnotationLabel,
1346
- Re as PAnnotationTrace,
1347
- Pt as PFrameImpl,
1348
- $ as RT_BINARY_PARTITIONED,
1349
- G as RT_BINARY_SUPER_PARTITIONED,
1350
- te as RT_JSON_PARTITIONED,
1351
- ne as RT_JSON_SUPER_PARTITIONED,
1352
- z as RT_RESOURCE_MAP,
1353
- Y as RT_RESOURCE_MAP_PARTITIONED,
1354
- E as RenderCtx,
1355
- Le as ResultPool,
1356
- qe as StagingOutputs,
1357
- xe as Trace,
1358
- Fe as TraceEntry,
1393
+ Ge as IS_VIRTUAL_COLUMN,
1394
+ tt as It,
1395
+ Rt as JsRenderInternal,
1396
+ nt as MainOutputs,
1397
+ Pe as OutputError,
1398
+ ke as PAnnotationLabel,
1399
+ De as PAnnotationTrace,
1400
+ Ot as PFrameImpl,
1401
+ K as RT_BINARY_PARTITIONED,
1402
+ H as RT_BINARY_SUPER_PARTITIONED,
1403
+ ie as RT_JSON_PARTITIONED,
1404
+ oe as RT_JSON_SUPER_PARTITIONED,
1405
+ Q as RT_RESOURCE_MAP,
1406
+ Z as RT_RESOURCE_MAP_PARTITIONED,
1407
+ V as RenderCtx,
1408
+ Ue as ResultPool,
1409
+ st as StagingOutputs,
1410
+ Ee as Trace,
1411
+ Oe as TraceEntry,
1359
1412
  v as TreeNodeAccessor,
1360
- ze as UiState,
1361
- nt as and,
1362
- Ct as createPFrameForGraphs,
1363
- wt as createPlDataTable,
1364
- At as createPlDataTableSheet,
1365
- ke as deriveLabels,
1366
- K as downgradeCfgOrLambda,
1367
- pt as extractArchiveAndGetURL,
1368
- St as extractConfig,
1369
- Ze as flatten,
1370
- It as fromPlOption,
1371
- Be as fromPlRef,
1372
- Ue as getAdditionalColumns,
1373
- at as getBlobContent,
1374
- ut as getBlobContentAsJson,
1375
- lt as getBlobContentAsString,
1376
- ct as getDownloadedBlobContent,
1377
- xt as getEnvironmentValue,
1378
- O as getFromCfg,
1379
- V as getImmediate,
1380
- ft as getImportProgress,
1413
+ rt as UiState,
1414
+ dt as and,
1415
+ Dt as createPFrameForGraphs,
1416
+ Lt as createPlDataTable,
1417
+ kt as createPlDataTableSheet,
1418
+ re as deriveLabels,
1419
+ q as downgradeCfgOrLambda,
1420
+ Ke as enrichColumnsWithCompatible,
1421
+ At as extractArchiveAndGetURL,
1422
+ Tt as extractConfig,
1423
+ lt as flatten,
1424
+ Et as fromPlOption,
1425
+ qe as fromPlRef,
1426
+ We as getAdditionalColumns,
1427
+ mt as getBlobContent,
1428
+ bt as getBlobContentAsJson,
1429
+ yt as getBlobContentAsString,
1430
+ vt as getDownloadedBlobContent,
1431
+ Ut as getEnvironmentValue,
1432
+ k as getFromCfg,
1433
+ j as getImmediate,
1434
+ St as getImportProgress,
1381
1435
  B as getJsonField,
1382
- ht as getLastLogs,
1383
- yt as getLogHandle,
1384
- dt as getOnDemandBlobContent,
1385
- De as getPartitionKeysList,
1386
- gt as getProgressLog,
1387
- mt as getProgressLogWithInfo,
1388
- Ft as getRawPlatformaInstance,
1389
- st as getResourceField,
1390
- it as getResourceValueAsJson,
1391
- _t as getUniquePartitionKeys,
1392
- W as ifDef,
1393
- Ee as isConfigLambda,
1394
- et as isEmpty,
1395
- Ge as isolate,
1396
- Ye as makeArray,
1397
- ie as makeObject,
1398
- Qe as mapArrayValues,
1399
- Xe as mapRecordValues,
1400
- ot as mapResourceFields,
1401
- tt as not,
1402
- rt as or,
1403
- vt as parseResourceMap,
1404
- _e as readOutput,
1405
- $e as wrapOutputs
1436
+ wt as getLastLogs,
1437
+ Ct as getLogHandle,
1438
+ _t as getOnDemandBlobContent,
1439
+ Be as getPartitionKeysList,
1440
+ It as getProgressLog,
1441
+ Pt as getProgressLogWithInfo,
1442
+ jt as getRawPlatformaInstance,
1443
+ ft as getResourceField,
1444
+ ht as getResourceValueAsJson,
1445
+ xt as getUniquePartitionKeys,
1446
+ z as ifDef,
1447
+ Ne as isConfigLambda,
1448
+ ut as isEmpty,
1449
+ Ze as isolate,
1450
+ it as makeArray,
1451
+ ue as makeObject,
1452
+ at as mapArrayValues,
1453
+ ot as mapRecordValues,
1454
+ gt as mapResourceFields,
1455
+ ct as not,
1456
+ pt as or,
1457
+ Ft as parseResourceMap,
1458
+ Ce as readOutput,
1459
+ Qe as wrapOutputs
1406
1460
  };
1407
1461
  //# sourceMappingURL=index.mjs.map