@platforma-sdk/model 1.22.0 → 1.22.2

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,199 +1,206 @@
1
1
  var fe = Object.defineProperty;
2
- var he = (n, e, t) => e in n ? fe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var S = (n, e, t) => he(n, typeof e != "symbol" ? e + "" : e, t);
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 B, matchAxisId as T } from "@milaboratories/pl-model-common";
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";
5
5
  export * from "@milaboratories/pl-model-common";
6
6
  import { z as P } from "zod";
7
7
  class ve extends Error {
8
- constructor(e, t) {
9
- super(`${e.length}${t ? "+" : ""} errors, first error: ` + e[0]), this.errors = e, this.moreErrors = t;
8
+ constructor(e, n) {
9
+ super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0]), this.errors = e, this.moreErrors = n;
10
10
  }
11
11
  }
12
- function _e(n) {
13
- if (!n.ok) throw new ve(n.errors, n.moreErrors);
14
- return n.value;
12
+ function _e(t) {
13
+ if (!t.ok) throw new ve(t.errors, t.moreErrors);
14
+ return t.value;
15
15
  }
16
- function $e(n) {
17
- return new Proxy(n, {
18
- get(e, t) {
19
- return _e(e[t]);
16
+ function $e(t) {
17
+ return new Proxy(t, {
18
+ get(e, n) {
19
+ return _e(e[n]);
20
20
  }
21
21
  });
22
22
  }
23
- function m(n) {
24
- return typeof n == "string" || typeof n == "number" || typeof n == "boolean" || n === null ? V(n) : n;
23
+ function m(t) {
24
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? V(t) : t;
25
25
  }
26
- function x(n) {
27
- return { type: "GetFromCtx", variable: n };
26
+ function O(t) {
27
+ return { type: "GetFromCtx", variable: t };
28
28
  }
29
- function Ke(n) {
29
+ function Ge(t) {
30
30
  return {
31
31
  type: "Isolate",
32
- cfg: n
32
+ cfg: t
33
33
  };
34
34
  }
35
- const Ge = x("$args"), He = x("$it"), We = x("$prod"), qe = x("$staging"), ze = x("$ui");
36
- function V(n) {
37
- return { type: "Immediate", value: n };
35
+ const Ke = O("$args"), He = O("$it"), We = O("$prod"), qe = O("$staging"), ze = O("$ui");
36
+ function V(t) {
37
+ return { type: "Immediate", value: t };
38
38
  }
39
- function ie(n) {
39
+ function se(t) {
40
40
  const e = {};
41
- for (const [t, r] of Object.entries(n)) e[t] = m(r);
41
+ for (const [n, r] of Object.entries(t)) e[n] = m(r);
42
42
  return {
43
43
  type: "MakeObject",
44
44
  template: e
45
45
  };
46
46
  }
47
- function Ye(...n) {
47
+ function Ye(...t) {
48
48
  const e = [];
49
- for (const t of n) e.push(m(t));
49
+ for (const n of t) e.push(m(n));
50
50
  return {
51
51
  type: "MakeArray",
52
52
  template: e
53
53
  };
54
54
  }
55
- function N(n, e) {
55
+ function B(t, e) {
56
56
  return {
57
57
  type: "GetJsonField",
58
- source: m(n),
58
+ source: m(t),
59
59
  field: m(e)
60
60
  };
61
61
  }
62
- function Xe(n, e, t = "$it") {
62
+ function Xe(t, e, n = "$it") {
63
63
  return {
64
64
  type: "MapRecordValues",
65
- source: n,
65
+ source: t,
66
66
  mapping: e,
67
- itVar: t
67
+ itVar: n
68
68
  };
69
69
  }
70
- function Qe(n, e, t = "$it") {
70
+ function Qe(t, e, n = "$it") {
71
71
  return {
72
72
  type: "MapArrayValues",
73
- source: n,
73
+ source: t,
74
74
  mapping: e,
75
- itVar: t
75
+ itVar: n
76
76
  };
77
77
  }
78
- function Ze(n) {
78
+ function Ze(t) {
79
79
  return {
80
80
  type: "Flatten",
81
- source: n
81
+ source: t
82
82
  };
83
83
  }
84
- function et(n) {
84
+ function et(t) {
85
85
  return {
86
86
  type: "IsEmpty",
87
- arg: n
87
+ arg: t
88
88
  };
89
89
  }
90
- function tt(n) {
90
+ function tt(t) {
91
91
  return {
92
92
  type: "Not",
93
- operand: n
93
+ operand: t
94
94
  };
95
95
  }
96
- function nt(n, e) {
96
+ function nt(t, e) {
97
97
  return {
98
98
  type: "And",
99
- operand1: n,
99
+ operand1: t,
100
100
  operand2: e
101
101
  };
102
102
  }
103
- function rt(n, e) {
103
+ function rt(t, e) {
104
104
  return {
105
105
  type: "Or",
106
- operand1: n,
106
+ operand1: t,
107
107
  operand2: e
108
108
  };
109
109
  }
110
- function st(n, e) {
110
+ function it(t, e) {
111
111
  return {
112
112
  type: "GetResourceField",
113
- source: m(n),
113
+ source: m(t),
114
114
  field: m(e)
115
115
  };
116
116
  }
117
- function it() {
118
- return function(n) {
117
+ function st() {
118
+ return function(t) {
119
119
  return {
120
120
  type: "GetResourceValueAsJson",
121
- source: m(n)
121
+ source: m(t)
122
122
  };
123
123
  };
124
124
  }
125
- function ot(n, e, t = "$it") {
125
+ function ot(t, e, n = "$it") {
126
126
  return {
127
127
  type: "MapResourceFields",
128
- source: n,
128
+ source: t,
129
129
  mapping: e,
130
- itVar: t
130
+ itVar: n
131
131
  };
132
132
  }
133
- function at(n) {
133
+ function at(t) {
134
134
  return {
135
135
  type: "GetBlobContent",
136
- source: m(n)
136
+ source: m(t)
137
137
  };
138
138
  }
139
- function lt(n) {
139
+ function lt(t) {
140
140
  return {
141
141
  type: "GetBlobContentAsString",
142
- source: m(n)
142
+ source: m(t)
143
143
  };
144
144
  }
145
145
  function ut() {
146
- return function(n) {
146
+ return function(t) {
147
147
  return {
148
148
  type: "GetBlobContentAsJson",
149
- source: m(n)
149
+ source: m(t)
150
150
  };
151
151
  };
152
152
  }
153
- function ct(n) {
153
+ function ct(t) {
154
154
  return {
155
155
  type: "GetDownloadedBlobContent",
156
- source: m(n)
156
+ source: m(t)
157
157
  };
158
158
  }
159
- function dt(n) {
159
+ function dt(t) {
160
160
  return {
161
161
  type: "GetOnDemandBlobContent",
162
- source: m(n)
162
+ source: m(t)
163
163
  };
164
164
  }
165
- function pt(n) {
165
+ function pt(t, e) {
166
+ return {
167
+ type: "ExtractArchiveAndGetURL",
168
+ format: e,
169
+ source: m(t)
170
+ };
171
+ }
172
+ function ft(t) {
166
173
  return {
167
174
  type: "GetImportProgress",
168
- source: m(n)
175
+ source: m(t)
169
176
  };
170
177
  }
171
- function ft(n, e) {
178
+ function ht(t, e) {
172
179
  return {
173
180
  type: "GetLastLogs",
174
- source: m(n),
181
+ source: m(t),
175
182
  lines: e
176
183
  };
177
184
  }
178
- function ht(n, e) {
185
+ function gt(t, e) {
179
186
  return {
180
187
  type: "GetProgressLog",
181
- source: m(n),
188
+ source: m(t),
182
189
  patternToSearch: e
183
190
  };
184
191
  }
185
- function gt(n) {
192
+ function mt(t) {
186
193
  return {
187
194
  type: "GetLogHandle",
188
- source: m(n)
195
+ source: m(t)
189
196
  };
190
197
  }
191
198
  function Se() {
192
199
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
193
200
  }
194
- function oe(n) {
195
- if (n && typeof globalThis.getPlatforma == "function")
196
- return globalThis.getPlatforma(n);
201
+ function oe(t) {
202
+ if (t && typeof globalThis.getPlatforma == "function")
203
+ return globalThis.getPlatforma(t);
197
204
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
198
205
  throw new Error("Can't get platforma instance.");
199
206
  }
@@ -204,33 +211,33 @@ function c() {
204
211
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
205
212
  throw new Error("Not in config rendering context");
206
213
  }
207
- function E(n, e) {
208
- const t = we();
209
- if (t === void 0) return !1;
210
- if (n in t.callbackRegistry) throw new Error(`Callback with key ${n} already registered.`);
211
- return t.callbackRegistry[n] = e, !0;
214
+ function L(t, e) {
215
+ const n = we();
216
+ if (n === void 0) return !1;
217
+ if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
218
+ return n.callbackRegistry[t] = e, !0;
212
219
  }
213
- const U = /* @__PURE__ */ new Map();
214
- function Ce(n, e) {
215
- n in c().callbackRegistry || (c().callbackRegistry[n] = (t) => {
216
- for (const r of U.get(n))
217
- r(t);
218
- }, U.set(n, [])), U.get(n).push(e);
220
+ const J = /* @__PURE__ */ new Map();
221
+ function Ae(t, e) {
222
+ t in c().callbackRegistry || (c().callbackRegistry[t] = (n) => {
223
+ for (const r of J.get(t))
224
+ r(n);
225
+ }, J.set(t, [])), J.get(t).push(e);
219
226
  }
220
- class _ {
221
- constructor(e, t = (r) => r) {
227
+ class b {
228
+ constructor(e, n = (r) => r) {
222
229
  S(this, "isResolved", !1);
223
230
  S(this, "resolvedValue");
224
- this.handle = e, this.postProcess = t, Ce(e, (r) => {
225
- this.resolvedValue = t(r), this.isResolved = !0;
231
+ this.handle = e, this.postProcess = n, Ae(e, (r) => {
232
+ this.resolvedValue = n(r), this.isResolved = !0;
226
233
  });
227
234
  }
228
235
  map(e) {
229
- return new _(this.handle, (t) => e(this.postProcess(t)));
236
+ return new b(this.handle, (n) => e(this.postProcess(n)));
230
237
  }
231
238
  mapDefined(e) {
232
- return new _(this.handle, (t) => {
233
- const r = this.postProcess(t);
239
+ return new b(this.handle, (n) => {
240
+ const r = this.postProcess(n);
234
241
  return r ? e(r) : void 0;
235
242
  });
236
243
  }
@@ -238,51 +245,51 @@ class _ {
238
245
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
239
246
  }
240
247
  }
241
- function H(n, e) {
242
- return n === void 0 ? void 0 : e(n);
248
+ function H(t, e) {
249
+ return t === void 0 ? void 0 : e(t);
243
250
  }
244
- class b {
245
- constructor(e, t) {
246
- this.handle = e, this.resolvePath = t;
251
+ class v {
252
+ constructor(e, n) {
253
+ this.handle = e, this.resolvePath = n;
247
254
  }
248
255
  resolve(...e) {
249
- const t = e.map(
256
+ const n = e.map(
250
257
  (r) => ({
251
258
  assertFieldType: "Input",
252
259
  ...typeof r == "string" ? { field: r } : r
253
260
  })
254
261
  );
255
- return this.resolveWithCommon({}, ...t);
262
+ return this.resolveWithCommon({}, ...n);
256
263
  }
257
264
  resolveOutput(...e) {
258
- const t = e.map(
265
+ const n = e.map(
259
266
  (r) => ({
260
267
  assertFieldType: "Output",
261
268
  ...typeof r == "string" ? { field: r } : r
262
269
  })
263
270
  );
264
- return this.resolveWithCommon({}, ...t);
271
+ return this.resolveWithCommon({}, ...n);
265
272
  }
266
273
  resolveInput(...e) {
267
- const t = e.map(
274
+ const n = e.map(
268
275
  (r) => ({
269
276
  assertFieldType: "Input",
270
277
  ...typeof r == "string" ? { field: r } : r
271
278
  })
272
279
  );
273
- return this.resolveWithCommon({}, ...t);
280
+ return this.resolveWithCommon({}, ...n);
274
281
  }
275
282
  resolveAny(...e) {
276
283
  return this.resolveWithCommon({}, ...e);
277
284
  }
278
- resolveWithCommon(e, ...t) {
285
+ resolveWithCommon(e, ...n) {
279
286
  const r = [
280
287
  ...this.resolvePath,
281
- ...t.map((s) => typeof s == "string" ? s : s.field)
288
+ ...n.map((i) => typeof i == "string" ? i : i.field)
282
289
  ];
283
290
  return H(
284
- c().resolveWithCommon(this.handle, e, ...t),
285
- (s) => new b(s, r)
291
+ c().resolveWithCommon(this.handle, e, ...n),
292
+ (i) => new v(i, r)
286
293
  );
287
294
  }
288
295
  get resourceType() {
@@ -304,7 +311,7 @@ class b {
304
311
  const e = [...this.resolvePath, "error"];
305
312
  return H(
306
313
  c().getError(this.handle),
307
- (t) => new b(t, e)
314
+ (n) => new v(n, e)
308
315
  );
309
316
  }
310
317
  listInputFields() {
@@ -323,9 +330,9 @@ class b {
323
330
  return c().getKeyValueAsString(this.handle, e);
324
331
  }
325
332
  getKeyValueAsJson(e) {
326
- const t = this.getKeyValueAsString(e);
327
- if (t == null) throw new Error("Resource has no content.");
328
- return JSON.parse(t);
333
+ const n = this.getKeyValueAsString(e);
334
+ if (n == null) throw new Error("Resource has no content.");
335
+ return JSON.parse(n);
329
336
  }
330
337
  getDataBase64() {
331
338
  return c().getDataBase64(this.handle);
@@ -341,39 +348,39 @@ class b {
341
348
  /**
342
349
  *
343
350
  */
344
- getPColumns(e = !1, t = "") {
345
- const r = this.parsePObjectCollection(e, t);
346
- return r === void 0 ? void 0 : Object.entries(r).map(([, i]) => {
347
- if (!X(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
348
- return i;
351
+ getPColumns(e = !1, n = "") {
352
+ const r = this.parsePObjectCollection(e, n);
353
+ return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
354
+ if (!X(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
355
+ return s;
349
356
  });
350
357
  }
351
358
  /**
352
359
  *
353
360
  */
354
- parsePObjectCollection(e = !1, t = "") {
361
+ parsePObjectCollection(e = !1, n = "") {
355
362
  const r = c().parsePObjectCollection(
356
363
  this.handle,
357
364
  e,
358
- t,
365
+ n,
359
366
  ...this.resolvePath
360
367
  );
361
368
  if (r === void 0) return;
362
- const s = {};
363
- for (const [i, o] of Object.entries(r)) {
364
- const l = [...this.resolvePath, i];
365
- s[i] = j(o, (a) => new b(a, l));
369
+ const i = {};
370
+ for (const [s, o] of Object.entries(r)) {
371
+ const l = [...this.resolvePath, s];
372
+ i[s] = j(o, (a) => new v(a, l));
366
373
  }
367
- return s;
374
+ return i;
368
375
  }
369
376
  getFileContentAsBase64() {
370
- return new _(c().getBlobContentAsBase64(this.handle));
377
+ return new b(c().getBlobContentAsBase64(this.handle));
371
378
  }
372
379
  getFileContentAsString() {
373
- return new _(c().getBlobContentAsString(this.handle));
380
+ return new b(c().getBlobContentAsString(this.handle));
374
381
  }
375
382
  getFileContentAsJson() {
376
- return new _(
383
+ return new b(
377
384
  c().getBlobContentAsString(this.handle)
378
385
  ).mapDefined((e) => JSON.parse(e));
379
386
  }
@@ -393,7 +400,7 @@ class b {
393
400
  * @returns downloaded file handle
394
401
  */
395
402
  getFileHandle() {
396
- return new _(c().getDownloadedBlobContentHandle(this.handle));
403
+ return new b(c().getDownloadedBlobContentHandle(this.handle));
397
404
  }
398
405
  /**
399
406
  * @deprecated use getFileHandle
@@ -405,7 +412,7 @@ class b {
405
412
  * @returns downloaded file handle
406
413
  */
407
414
  getRemoteFileHandle() {
408
- return new _(c().getOnDemandBlobContentHandle(this.handle));
415
+ return new b(c().getOnDemandBlobContentHandle(this.handle));
409
416
  }
410
417
  /**
411
418
  * @deprecated use getRemoteFileHandle
@@ -413,99 +420,105 @@ class b {
413
420
  getOnDemandBlobHandle() {
414
421
  return this.getRemoteFileHandle();
415
422
  }
423
+ /**
424
+ * @returns the url to the extracted folder
425
+ */
426
+ extractArchiveAndGetURL(e) {
427
+ return new b(c().extractArchiveAndGetURL(this.handle, e));
428
+ }
416
429
  getImportProgress() {
417
- return new _(c().getImportProgress(this.handle));
430
+ return new b(c().getImportProgress(this.handle));
418
431
  }
419
432
  getLastLogs(e) {
420
- return new _(c().getLastLogs(this.handle, e));
433
+ return new b(c().getLastLogs(this.handle, e));
421
434
  }
422
435
  getProgressLog(e) {
423
- return new _(c().getProgressLog(this.handle, e));
436
+ return new b(c().getProgressLog(this.handle, e));
424
437
  }
425
438
  getLogHandle() {
426
- return new _(c().getLogHandle(this.handle));
439
+ return new b(c().getLogHandle(this.handle));
427
440
  }
428
441
  allFieldsResolved(e = "Input") {
429
442
  switch (e) {
430
443
  case "Input":
431
444
  return this.getInputsLocked() && this.listInputFields().every(
432
- (t) => this.resolve({ field: t, assertFieldType: "Input" }) !== void 0
445
+ (n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
433
446
  );
434
447
  case "Output":
435
448
  return this.getOutputsLocked() && this.listOutputFields().every(
436
- (t) => this.resolve({ field: t, assertFieldType: "Output" }) !== void 0
449
+ (n) => this.resolve({ field: n, assertFieldType: "Output" }) !== void 0
437
450
  );
438
451
  }
439
452
  }
440
- mapFields(e, t) {
441
- const { fieldType: r, requireLocked: s, skipUnresolved: i } = {
453
+ mapFields(e, n) {
454
+ const { fieldType: r, requireLocked: i, skipUnresolved: s } = {
442
455
  fieldType: "Input",
443
456
  requireLocked: !0,
444
457
  skipUnresolved: !1,
445
- ...t
458
+ ...n
446
459
  }, o = e;
447
- if (s && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
460
+ if (i && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
448
461
  return;
449
462
  let a = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
450
463
  (u) => [u, this.resolve({ field: u, assertFieldType: r })]
451
464
  );
452
- return i && (a = a.filter((u) => u[1] !== void 0)), a.map(([u, h]) => o(u, h));
465
+ return s && (a = a.filter((u) => u[1] !== void 0)), a.map(([u, h]) => o(u, h));
453
466
  }
454
467
  }
455
- const ae = "staging", le = "main", Ae = {
468
+ const ae = "staging", le = "main", Ce = {
456
469
  inlineColumnsSupport: !0,
457
470
  activeArgs: !0
458
471
  };
459
- function ue(n) {
460
- return typeof n == "object" && n !== null && "__awaited_futures__" in n;
461
- }
462
- function W(n, e, t) {
463
- if (e.has(t)) return;
464
- if (e.add(t), typeof t === "object")
465
- if (ue(t)) t.__awaited_futures__.forEach((s) => n.add(s));
466
- else if (Array.isArray(t))
467
- for (const s of t) W(n, e, s);
472
+ function ue(t) {
473
+ return typeof t == "object" && t !== null && "__awaited_futures__" in t;
474
+ }
475
+ function W(t, e, n) {
476
+ if (e.has(n)) return;
477
+ if (e.add(n), typeof n === "object")
478
+ if (ue(n)) n.__awaited_futures__.forEach((i) => t.add(i));
479
+ else if (Array.isArray(n))
480
+ for (const i of n) W(t, e, i);
468
481
  else
469
- for (const [, s] of Object.entries(t))
470
- s !== t && W(n, e, s);
482
+ for (const [, i] of Object.entries(n))
483
+ i !== n && W(t, e, i);
471
484
  }
472
- function Pe(n) {
485
+ function Pe(t) {
473
486
  const e = /* @__PURE__ */ new Set();
474
- return W(e, /* @__PURE__ */ new Set(), n), e;
487
+ return W(e, /* @__PURE__ */ new Set(), t), e;
475
488
  }
476
- const mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
489
+ const yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
477
490
  __proto__: null,
478
- GlobalCfgRenderCtxFeatureFlags: Ae,
491
+ GlobalCfgRenderCtxFeatureFlags: Ce,
479
492
  MainAccessorName: le,
480
493
  StagingAccessorName: ae,
481
494
  getAllFutureAwaits: Pe,
482
495
  isFutureAwait: ue
483
- }, Symbol.toStringTag, { value: "Module" })), Ie = "pl7.app/label", Fe = "pl7.app/trace", Re = P.object({
496
+ }, Symbol.toStringTag, { value: "Module" })), Ie = "pl7.app/label", Re = "pl7.app/trace", Fe = P.object({
484
497
  type: P.string(),
485
498
  importance: P.number().optional(),
486
499
  id: P.string().optional(),
487
500
  label: P.string()
488
- }), Te = P.array(Re), Oe = 1e-3, xe = "__LABEL__", ee = "__LABEL__@1";
489
- function ke(n, e, t = {}) {
490
- const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = n.map((p) => {
491
- var F, Q;
492
- const g = e(p), f = (F = g.annotations) == null ? void 0 : F[Ie], C = (Q = g.annotations) == null ? void 0 : Q[Fe], y = (C ? Te.safeParse(JSON.parse(C)).data : void 0) ?? [];
501
+ }), xe = P.array(Fe), Te = 1e-3, Oe = "__LABEL__", ee = "__LABEL__@1";
502
+ function ke(t, e, n = {}) {
503
+ const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((p) => {
504
+ var R, Q;
505
+ 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) ?? [];
493
506
  if (f) {
494
- const w = { label: f, type: xe, importance: -2 };
495
- t.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
507
+ const w = { label: f, type: Oe, importance: -2 };
508
+ n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
496
509
  }
497
510
  const I = [], D = /* @__PURE__ */ new Map();
498
511
  for (let w = y.length - 1; w >= 0; --w) {
499
- const { type: M } = y[w], pe = y[w].importance ?? 0, J = (D.get(M) ?? 0) + 1;
500
- D.set(M, J);
501
- const R = `${M}@${J}`;
502
- s.set(R, (s.get(R) ?? 0) + 1), r.set(
503
- R,
512
+ const { type: N } = y[w], pe = y[w].importance ?? 0, M = (D.get(N) ?? 0) + 1;
513
+ D.set(N, M);
514
+ const F = `${N}@${M}`;
515
+ i.set(F, (i.get(F) ?? 0) + 1), r.set(
516
+ F,
504
517
  Math.max(
505
- r.get(R) ?? Number.NEGATIVE_INFINITY,
506
- pe - (y.length - w) * Oe
518
+ r.get(F) ?? Number.NEGATIVE_INFINITY,
519
+ pe - (y.length - w) * Te
507
520
  )
508
- ), I.push({ ...y[w], fullType: R, occurenceIndex: J });
521
+ ), I.push({ ...y[w], fullType: F, occurenceIndex: M });
509
522
  }
510
523
  return I.reverse(), {
511
524
  value: p,
@@ -516,11 +529,11 @@ function ke(n, e, t = {}) {
516
529
  }), o = [], l = [], a = [...r];
517
530
  a.sort(([, p], [, g]) => g - p);
518
531
  for (const [p] of a)
519
- p.endsWith("@1") || s.get(p) === n.length ? o.push(p) : l.push(p);
520
- const u = (p) => i.map((g) => {
521
- const f = g.fullTrace.filter((y) => p.has(y.fullType)).map((y) => y.label), C = t.separator ?? " / ";
532
+ p.endsWith("@1") || i.get(p) === t.length ? o.push(p) : l.push(p);
533
+ const u = (p) => s.map((g) => {
534
+ const f = g.fullTrace.filter((y) => p.has(y.fullType)).map((y) => y.label), A = n.separator ?? " / ";
522
535
  return {
523
- label: f.join(C),
536
+ label: f.join(A),
524
537
  value: g.value
525
538
  };
526
539
  });
@@ -531,11 +544,11 @@ function ke(n, e, t = {}) {
531
544
  let h = 0, d = 0;
532
545
  for (; h < o.length; ) {
533
546
  const p = /* @__PURE__ */ new Set();
534
- t.includeNativeLabel && p.add(ee);
547
+ n.includeNativeLabel && p.add(ee);
535
548
  for (let f = 0; f < h; ++f) p.add(o[f]);
536
549
  p.add(o[d]);
537
550
  const g = u(p);
538
- if (new Set(g.map((f) => f.label)).size === n.length) return g;
551
+ if (new Set(g.map((f) => f.label)).size === t.length) return g;
539
552
  d++, d == o.length && (h++, d = h);
540
553
  }
541
554
  return u(/* @__PURE__ */ new Set([...o, ...l]));
@@ -543,7 +556,7 @@ function ke(n, e, t = {}) {
543
556
  class De {
544
557
  constructor() {
545
558
  S(this, "ctx", c());
546
- S(this, "defaultLabelFn", (e, t) => {
559
+ S(this, "defaultLabelFn", (e, n) => {
547
560
  var r;
548
561
  return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
549
562
  });
@@ -554,14 +567,14 @@ class De {
554
567
  calculateOptions(e) {
555
568
  return this.ctx.calculateOptions(e);
556
569
  }
557
- getOptions(e, t) {
558
- const r = this.getSpecs().entries.filter((s) => e(s.obj));
559
- return typeof t == "object" || typeof t > "u" ? ke(r, (s) => s.obj, t ?? {}).map(({ value: { ref: s }, label: i }) => ({
560
- ref: s,
561
- label: i
562
- })) : r.map((s) => ({
563
- ref: s.ref,
564
- label: t(s.obj, s.ref)
570
+ getOptions(e, n) {
571
+ const r = this.getSpecs().entries.filter((i) => e(i.obj));
572
+ return typeof n == "object" || typeof n > "u" ? ke(r, (i) => i.obj, n ?? {}).map(({ value: { ref: i }, label: s }) => ({
573
+ ref: i,
574
+ label: s
575
+ })) : r.map((i) => ({
576
+ ref: i.ref,
577
+ label: n(i.obj, i.ref)
565
578
  }));
566
579
  }
567
580
  /**
@@ -574,11 +587,11 @@ class De {
574
587
  const e = this.ctx.getDataFromResultPool();
575
588
  return {
576
589
  isComplete: e.isComplete,
577
- entries: e.entries.map((t) => ({
578
- ref: t.ref,
590
+ entries: e.entries.map((n) => ({
591
+ ref: n.ref,
579
592
  obj: {
580
- ...t.obj,
581
- data: new b(t.obj.data, [t.ref.blockId, t.ref.name])
593
+ ...n.obj,
594
+ data: new v(n.obj.data, [n.ref.blockId, n.ref.name])
582
595
  }
583
596
  }))
584
597
  };
@@ -593,13 +606,13 @@ class De {
593
606
  const e = this.ctx.getDataWithErrorsFromResultPool();
594
607
  return {
595
608
  isComplete: e.isComplete,
596
- entries: e.entries.map((t) => ({
597
- ref: t.ref,
609
+ entries: e.entries.map((n) => ({
610
+ ref: n.ref,
598
611
  obj: {
599
- ...t.obj,
612
+ ...n.obj,
600
613
  data: ge(
601
- t.obj.data,
602
- (r) => new b(r, [t.ref.blockId, t.ref.name])
614
+ n.obj.data,
615
+ (r) => new v(r, [n.ref.blockId, n.ref.name])
603
616
  )
604
617
  }
605
618
  }))
@@ -619,12 +632,12 @@ class De {
619
632
  * @returns data associated with the ref
620
633
  */
621
634
  getDataByRef(e) {
622
- var t;
623
- return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (t = this.getData().entries.find(
635
+ var n;
636
+ return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
624
637
  (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
625
- )) == null ? void 0 : t.obj : j(
638
+ )) == null ? void 0 : n.obj : j(
626
639
  this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
627
- (r) => new b(r, [e.blockId, e.name])
640
+ (r) => new v(r, [e.blockId, e.name])
628
641
  );
629
642
  }
630
643
  /**
@@ -633,9 +646,9 @@ class De {
633
646
  * @returns p-column associated with the ref
634
647
  */
635
648
  getPColumnByRef(e) {
636
- const t = this.getDataByRef(e);
637
- if (t)
638
- return me(t);
649
+ const n = this.getDataByRef(e);
650
+ if (n)
651
+ return me(n);
639
652
  }
640
653
  /**
641
654
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -643,10 +656,10 @@ class De {
643
656
  * @returns p-column spec associated with the ref
644
657
  */
645
658
  getPColumnSpecByRef(e) {
646
- const t = this.getSpecByRef(e);
647
- if (t) {
648
- if (!Z(t)) throw new Error(`not a PColumn spec (kind = ${t.kind})`);
649
- return t;
659
+ const n = this.getSpecByRef(e);
660
+ if (n) {
661
+ if (!Z(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
662
+ return n;
650
663
  }
651
664
  }
652
665
  /**
@@ -654,10 +667,10 @@ class De {
654
667
  * @returns object spec associated with the ref
655
668
  */
656
669
  getSpecByRef(e) {
657
- var t;
658
- return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (t = this.getSpecs().entries.find(
670
+ var n;
671
+ return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
659
672
  (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
660
- )) == null ? void 0 : t.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
673
+ )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
661
674
  }
662
675
  /**
663
676
  * @param spec object specification
@@ -665,31 +678,31 @@ class De {
665
678
  * @deprecated delete this method after Jan 1, 2025
666
679
  */
667
680
  findDataWithCompatibleSpec(e) {
668
- const t = [];
681
+ const n = [];
669
682
  e: for (const r of this.getData().entries) {
670
683
  if (!Z(r.obj.spec))
671
684
  continue;
672
- const s = r.obj.spec;
673
- if (e.name === s.name && e.valueType === s.valueType && e.axesSpec.length === s.axesSpec.length && q(e.domain, s.domain)) {
674
- for (let i = 0; i < e.axesSpec.length; ++i) {
675
- const o = e.axesSpec[i], l = s.axesSpec[i];
685
+ const i = r.obj.spec;
686
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && q(e.domain, i.domain)) {
687
+ for (let s = 0; s < e.axesSpec.length; ++s) {
688
+ const o = e.axesSpec[s], l = i.axesSpec[s];
676
689
  if (o.name !== l.name || o.type !== l.type || !q(o.domain, l.domain))
677
690
  continue e;
678
691
  }
679
- t.push(r.obj);
692
+ n.push(r.obj);
680
693
  }
681
694
  }
682
- return t;
695
+ return n;
683
696
  }
684
697
  }
685
- function q(n, e) {
686
- if (n === void 0) return e === void 0;
698
+ function q(t, e) {
699
+ if (t === void 0) return e === void 0;
687
700
  if (e === void 0) return !0;
688
- for (const t in e)
689
- if (n[t] !== e[t]) return !1;
701
+ for (const n in e)
702
+ if (t[n] !== e[n]) return !1;
690
703
  return !0;
691
704
  }
692
- class L {
705
+ class E {
693
706
  constructor() {
694
707
  S(this, "ctx");
695
708
  S(this, "args");
@@ -715,7 +728,7 @@ class L {
715
728
  getNamedAccessor(e) {
716
729
  return H(
717
730
  this.ctx.getAccessorHandleByName(e),
718
- (t) => new b(t, [e])
731
+ (n) => new v(n, [e])
719
732
  );
720
733
  }
721
734
  get prerun() {
@@ -729,11 +742,11 @@ class L {
729
742
  * @returns a map of axis value => label
730
743
  */
731
744
  findLabels(e) {
732
- const t = this.resultPool.getData();
733
- for (const r of t.entries) {
745
+ const n = this.resultPool.getData();
746
+ for (const r of n.entries) {
734
747
  if (!X(r.obj)) continue;
735
- const s = r.obj.spec;
736
- 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)) {
748
+ const i = r.obj.spec;
749
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && q(e.domain, i.axesSpec[0].domain)) {
737
750
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
738
751
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
739
752
  return Object.fromEntries(
@@ -745,28 +758,28 @@ class L {
745
758
  }
746
759
  }
747
760
  verifyInlineColumnsSupport(e) {
748
- var s;
749
- const t = e.some((i) => !(i.data instanceof b)), r = ((s = this.ctx.featureFlags) == null ? void 0 : s.inlineColumnsSupport) === !0;
750
- if (t && !r) throw Error("inline columns not supported");
761
+ var i;
762
+ const n = e.some((s) => !(s.data instanceof v)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
763
+ if (n && !r) throw Error("inline columns not supported");
751
764
  }
752
765
  createPFrame(e) {
753
766
  return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(
754
- e.map((t) => j(t, (r) => r instanceof b ? r.handle : r))
767
+ e.map((n) => j(n, (r) => r instanceof v ? r.handle : r))
755
768
  );
756
769
  }
757
770
  createPTable(e) {
758
- var t;
759
- return "columns" in e ? t = {
771
+ var n;
772
+ return "columns" in e ? n = {
760
773
  src: {
761
774
  type: "full",
762
775
  entries: e.columns.map((r) => ({ type: "column", column: r }))
763
776
  },
764
777
  filters: e.filters ?? [],
765
778
  sorting: e.sorting ?? []
766
- } : t = e, this.verifyInlineColumnsSupport(ye(t.src)), this.ctx.createPTable(
779
+ } : n = e, this.verifyInlineColumnsSupport(ye(n.src)), this.ctx.createPTable(
767
780
  be(
768
- t,
769
- (r) => j(r, (s) => s instanceof b ? s.handle : s)
781
+ n,
782
+ (r) => j(r, (i) => i instanceof v ? i.handle : i)
770
783
  )
771
784
  );
772
785
  }
@@ -779,93 +792,93 @@ class L {
779
792
  return this.ctx.getCurrentUnstableMarker();
780
793
  }
781
794
  }
782
- const k = "PColumnData/", z = k + "ResourceMap", Y = k + "Partitioned/ResourceMap", te = k + "JsonPartitioned", $ = k + "BinaryPartitioned", ce = k + "Partitioned/", ne = ce + "JsonPartitioned", K = ce + "BinaryPartitioned";
783
- function de(n, e, t, r = [], s) {
784
- if (n === void 0) return !1;
785
- switch (n.resourceType.name) {
795
+ const k = "PColumnData/", z = k + "ResourceMap", Y = k + "Partitioned/ResourceMap", te = k + "JsonPartitioned", $ = k + "BinaryPartitioned", ce = k + "Partitioned/", ne = ce + "JsonPartitioned", G = ce + "BinaryPartitioned";
796
+ function de(t, e, n, r = [], i) {
797
+ if (t === void 0) return !1;
798
+ switch (t.resourceType.name) {
786
799
  case z: {
787
- let i = n.getInputsLocked();
788
- for (const o of n.listInputFields()) {
789
- const l = n.resolve({ field: o, assertFieldType: "Input" }), a = [...r, ...JSON.parse(o)], u = l === void 0 ? void 0 : e(l);
790
- u === void 0 && (i = !1), (u !== void 0 || s) && t.push({ key: a, value: u });
800
+ let s = t.getInputsLocked();
801
+ for (const o of t.listInputFields()) {
802
+ const l = t.resolve({ field: o, assertFieldType: "Input" }), a = [...r, ...JSON.parse(o)], u = l === void 0 ? void 0 : e(l);
803
+ u === void 0 && (s = !1), (u !== void 0 || i) && n.push({ key: a, value: u });
791
804
  }
792
- return i;
805
+ return s;
793
806
  }
794
807
  case Y: {
795
- let i = n.getInputsLocked();
796
- for (const o of n.listInputFields()) {
797
- const l = n.resolve({ field: o, assertFieldType: "Input" });
798
- if (l === void 0) i = !1;
808
+ let s = t.getInputsLocked();
809
+ for (const o of t.listInputFields()) {
810
+ const l = t.resolve({ field: o, assertFieldType: "Input" });
811
+ if (l === void 0) s = !1;
799
812
  else {
800
813
  const a = [...r, ...JSON.parse(o)], u = de(
801
814
  l,
802
815
  e,
803
- t,
816
+ n,
804
817
  a,
805
- s
818
+ i
806
819
  );
807
- i = i && u;
820
+ s = s && u;
808
821
  }
809
822
  }
810
- return i;
823
+ return s;
811
824
  }
812
825
  default:
813
- throw new Error(`Unknown resource type: ${n.resourceType.name}`);
826
+ throw new Error(`Unknown resource type: ${t.resourceType.name}`);
814
827
  }
815
828
  }
816
- function yt(n, e, t = !1) {
829
+ function bt(t, e, n = !1) {
817
830
  const r = [];
818
- return { isComplete: de(n, e, r, [], t), data: r };
831
+ return { isComplete: de(t, e, r, [], n), data: r };
819
832
  }
820
- const re = (n) => {
821
- if (!n.endsWith(".index")) {
822
- if (n.endsWith(".values"))
823
- return n.substring(0, n.length - 7);
824
- throw Error(`key must ends on .index/.values for binary p-column, got: ${n}`);
833
+ const re = (t) => {
834
+ if (!t.endsWith(".index")) {
835
+ if (t.endsWith(".values"))
836
+ return t.substring(0, t.length - 7);
837
+ throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
825
838
  }
826
839
  };
827
- function Ee(n) {
828
- if (!n) return;
829
- const e = n.resourceType.name, t = n.getDataAsJson(), r = [];
830
- let s = 0;
840
+ function Le(t) {
841
+ if (!t) return;
842
+ const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
843
+ let i = 0;
831
844
  switch (e) {
832
845
  case z:
833
- s = t.keyLength;
846
+ i = n.keyLength;
834
847
  break;
835
848
  case Y:
836
- s = t.partitionKeyLength + t.keyLength;
849
+ i = n.partitionKeyLength + n.keyLength;
837
850
  break;
838
851
  case te:
839
852
  case $:
840
- s = t.partitionKeyLength;
853
+ i = n.partitionKeyLength;
841
854
  break;
842
- case K:
855
+ case G:
843
856
  case ne:
844
- s = t.superPartitionKeyLength + t.partitionKeyLength;
857
+ i = n.superPartitionKeyLength + n.partitionKeyLength;
845
858
  break;
846
859
  }
847
860
  switch (e) {
848
861
  case z:
849
862
  case te:
850
863
  case $:
851
- for (let i of n.listInputFields()) {
864
+ for (let s of t.listInputFields()) {
852
865
  if (e === $) {
853
- const l = re(i);
854
- if (l) i = l;
866
+ const l = re(s);
867
+ if (l) s = l;
855
868
  else continue;
856
869
  }
857
- const o = [...JSON.parse(i)];
870
+ const o = [...JSON.parse(s)];
858
871
  r.push(o);
859
872
  }
860
873
  break;
861
874
  case Y:
862
- case K:
875
+ case G:
863
876
  case ne:
864
- for (const i of n.listInputFields()) {
865
- const o = [...JSON.parse(i)], l = n.resolve({ field: i, assertFieldType: "Input" });
877
+ for (const s of t.listInputFields()) {
878
+ const o = [...JSON.parse(s)], l = t.resolve({ field: s, assertFieldType: "Input" });
866
879
  if (l !== void 0)
867
880
  for (let a of l.listInputFields()) {
868
- if (e === K) {
881
+ if (e === G) {
869
882
  const h = re(a);
870
883
  if (h) a = h;
871
884
  else continue;
@@ -876,78 +889,78 @@ function Ee(n) {
876
889
  }
877
890
  break;
878
891
  }
879
- return { data: r, keyLength: s };
892
+ return { data: r, keyLength: i };
880
893
  }
881
- function bt(n) {
882
- const e = Ee(n);
894
+ function vt(t) {
895
+ const e = Le(t);
883
896
  if (!e) return;
884
- const { data: t, keyLength: r } = e, s = [];
885
- for (let i = 0; i < r; ++i)
886
- s.push(/* @__PURE__ */ new Set());
887
- for (const i of t) {
888
- if (i.length !== r)
897
+ const { data: n, keyLength: r } = e, i = [];
898
+ for (let s = 0; s < r; ++s)
899
+ i.push(/* @__PURE__ */ new Set());
900
+ for (const s of n) {
901
+ if (s.length !== r)
889
902
  throw new Error("key length does not match partition length");
890
903
  for (let o = 0; o < r; ++o)
891
- s[o].add(i[o]);
904
+ i[o].add(s[o]);
892
905
  }
893
- return s.map((i) => Array.from(i.values()));
906
+ return i.map((s) => Array.from(s.values()));
894
907
  }
895
- const O = "1.22.0";
896
- function Le(n) {
897
- return n.__renderLambda === !0;
908
+ const T = "1.22.2";
909
+ function Ee(t) {
910
+ return t.__renderLambda === !0;
898
911
  }
899
- function G(n) {
900
- if (n !== void 0)
901
- return Le(n) ? n.handle : n;
912
+ function K(t) {
913
+ if (t !== void 0)
914
+ return Ee(t) ? t.handle : t;
902
915
  }
903
- function A(n) {
904
- if (n !== void 0)
905
- return typeof n == "string" ? { __renderLambda: !0, handle: n, retentive: !1 } : n;
916
+ function C(t) {
917
+ if (t !== void 0)
918
+ return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
906
919
  }
907
- function vt(n) {
908
- if (n.v3 !== void 0) {
920
+ function _t(t) {
921
+ if (t.v3 !== void 0) {
909
922
  const {
910
923
  initialArgs: e,
911
- initialUiState: t,
924
+ initialUiState: n,
912
925
  inputsValid: r,
913
- outputs: s,
914
- renderingMode: i,
926
+ outputs: i,
927
+ renderingMode: s,
915
928
  sdkVersion: o,
916
929
  sections: l,
917
930
  title: a
918
- } = n.v3, { code: u } = n;
931
+ } = t.v3, { code: u } = t;
919
932
  return {
920
933
  initialArgs: e,
921
- initialUiState: t,
934
+ initialUiState: n,
922
935
  inputsValid: r,
923
- outputs: s,
924
- renderingMode: i,
936
+ outputs: i,
937
+ renderingMode: s,
925
938
  sdkVersion: o,
926
939
  sections: l,
927
940
  title: a,
928
941
  code: u
929
942
  };
930
- } else if (n.inputsValid !== void 0) {
931
- const { sdkVersion: e, renderingMode: t, outputs: r, inputsValid: s, sections: i, initialArgs: o, code: l } = n, a = Object.keys(n);
932
- if (e === void 0 || t === void 0 || r === void 0 || s === void 0 || i === void 0 || o === void 0)
943
+ } else if (t.inputsValid !== void 0) {
944
+ const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: i, sections: s, initialArgs: o, code: l } = t, a = Object.keys(t);
945
+ if (e === void 0 || n === void 0 || r === void 0 || i === void 0 || s === void 0 || o === void 0)
933
946
  throw new Error(
934
947
  `Malformed config v2. SDK version ${e}; Fields = ${a.join(", ")}`
935
948
  );
936
949
  return {
937
950
  sdkVersion: e,
938
- renderingMode: t,
951
+ renderingMode: n,
939
952
  initialArgs: o,
940
953
  outputs: Object.fromEntries(
941
- Object.entries(r).map(([u, h]) => [u, A(h)])
954
+ Object.entries(r).map(([u, h]) => [u, C(h)])
942
955
  ),
943
- inputsValid: A(s),
944
- sections: A(i),
956
+ inputsValid: C(i),
957
+ sections: C(s),
945
958
  initialUiState: void 0,
946
959
  code: l
947
960
  };
948
- } else if (n.renderingMode !== void 0) {
949
- const { sdkVersion: e, canRun: t, renderingMode: r, outputs: s, sections: i, initialArgs: o, code: l } = n, a = Object.keys(n);
950
- if (r === void 0 || s === void 0 || t === void 0 || i === void 0 || o === void 0)
961
+ } else if (t.renderingMode !== void 0) {
962
+ const { sdkVersion: e, canRun: n, renderingMode: r, outputs: i, sections: s, initialArgs: o, code: l } = t, a = Object.keys(t);
963
+ if (r === void 0 || i === void 0 || n === void 0 || s === void 0 || o === void 0)
951
964
  throw new Error(
952
965
  `Malformed config v1. SDK version ${e}; Fields = ${a.join(", ")}`
953
966
  );
@@ -956,26 +969,26 @@ function vt(n) {
956
969
  renderingMode: r,
957
970
  initialArgs: o,
958
971
  outputs: Object.fromEntries(
959
- Object.entries(s).map(([u, h]) => [u, A(h)])
972
+ Object.entries(i).map(([u, h]) => [u, C(h)])
960
973
  ),
961
- inputsValid: A(t),
962
- sections: A(i),
974
+ inputsValid: C(n),
975
+ sections: C(s),
963
976
  initialUiState: void 0,
964
977
  code: l
965
978
  };
966
979
  } else {
967
- const { sdkVersion: e } = n, t = Object.keys(n);
980
+ const { sdkVersion: e } = t, n = Object.keys(t);
968
981
  throw new Error(
969
- `Config format not supported: SDK = ${e}; Fields = ${t.join(", ")}`
982
+ `Config format not supported: SDK = ${e}; Fields = ${n.join(", ")}`
970
983
  );
971
984
  }
972
985
  }
973
- class v {
974
- constructor(e, t, r, s, i, o, l) {
975
- this._renderingMode = e, this._initialArgs = t, this._initialUiState = r, this._outputs = s, this._inputsValid = i, this._sections = o, this._title = l;
986
+ class _ {
987
+ constructor(e, n, r, i, s, o, l) {
988
+ this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = l;
976
989
  }
977
990
  static create(e = "Heavy") {
978
- return new v(
991
+ return new _(
979
992
  e,
980
993
  void 0,
981
994
  {},
@@ -985,10 +998,10 @@ class v {
985
998
  void 0
986
999
  );
987
1000
  }
988
- output(e, t, r = {}) {
989
- if (typeof t == "function") {
990
- const s = `output#${e}`;
991
- return E(s, () => t(new L())), new v(
1001
+ output(e, n, r = {}) {
1002
+ if (typeof n == "function") {
1003
+ const i = `output#${e}`;
1004
+ return L(i, () => n(new E())), new _(
992
1005
  this._renderingMode,
993
1006
  this._initialArgs,
994
1007
  this._initialUiState,
@@ -996,7 +1009,7 @@ class v {
996
1009
  ...this._outputs,
997
1010
  [e]: {
998
1011
  __renderLambda: !0,
999
- handle: s,
1012
+ handle: i,
1000
1013
  ...r
1001
1014
  }
1002
1015
  },
@@ -1005,13 +1018,13 @@ class v {
1005
1018
  this._title
1006
1019
  );
1007
1020
  } else
1008
- return new v(
1021
+ return new _(
1009
1022
  this._renderingMode,
1010
1023
  this._initialArgs,
1011
1024
  this._initialUiState,
1012
1025
  {
1013
1026
  ...this._outputs,
1014
- [e]: t
1027
+ [e]: n
1015
1028
  },
1016
1029
  this._inputsValid,
1017
1030
  this._sections,
@@ -1019,11 +1032,11 @@ class v {
1019
1032
  );
1020
1033
  }
1021
1034
  /** Shortcut for {@link output} with retentive flag set to true. */
1022
- retentiveOutput(e, t) {
1023
- return this.output(e, t, { retentive: !0 });
1035
+ retentiveOutput(e, n) {
1036
+ return this.output(e, n, { retentive: !0 });
1024
1037
  }
1025
1038
  argsValid(e) {
1026
- return typeof e == "function" ? (E("inputsValid", () => e(new L())), new v(
1039
+ return typeof e == "function" ? (L("inputsValid", () => e(new E())), new _(
1027
1040
  this._renderingMode,
1028
1041
  this._initialArgs,
1029
1042
  this._initialUiState,
@@ -1034,7 +1047,7 @@ class v {
1034
1047
  },
1035
1048
  this._sections,
1036
1049
  this._title
1037
- )) : new v(
1050
+ )) : new _(
1038
1051
  this._renderingMode,
1039
1052
  this._initialArgs,
1040
1053
  this._initialUiState,
@@ -1045,7 +1058,7 @@ class v {
1045
1058
  );
1046
1059
  }
1047
1060
  sections(e) {
1048
- return Array.isArray(e) ? this.sections(V(e)) : typeof e == "function" ? (E("sections", () => e(new L())), new v(
1061
+ return Array.isArray(e) ? this.sections(V(e)) : typeof e == "function" ? (L("sections", () => e(new E())), new _(
1049
1062
  this._renderingMode,
1050
1063
  this._initialArgs,
1051
1064
  this._initialUiState,
@@ -1053,7 +1066,7 @@ class v {
1053
1066
  this._inputsValid,
1054
1067
  { __renderLambda: !0, handle: "sections" },
1055
1068
  this._title
1056
- )) : new v(
1069
+ )) : new _(
1057
1070
  this._renderingMode,
1058
1071
  this._initialArgs,
1059
1072
  this._initialUiState,
@@ -1065,7 +1078,7 @@ class v {
1065
1078
  }
1066
1079
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
1067
1080
  title(e) {
1068
- return E("title", () => e(new L())), new v(
1081
+ return L("title", () => e(new E())), new _(
1069
1082
  this._renderingMode,
1070
1083
  this._initialArgs,
1071
1084
  this._initialUiState,
@@ -1080,7 +1093,7 @@ class v {
1080
1093
  * @deprecated use {@link withArgs}
1081
1094
  * */
1082
1095
  initialArgs(e) {
1083
- return new v(
1096
+ return new _(
1084
1097
  this._renderingMode,
1085
1098
  e,
1086
1099
  this._initialUiState,
@@ -1092,7 +1105,7 @@ class v {
1092
1105
  }
1093
1106
  /** Sets initial args for the block, this value must be specified. */
1094
1107
  withArgs(e) {
1095
- return new v(
1108
+ return new _(
1096
1109
  this._renderingMode,
1097
1110
  e,
1098
1111
  this._initialUiState,
@@ -1104,7 +1117,7 @@ class v {
1104
1117
  }
1105
1118
  /** Defines type and sets initial value for block UiState. */
1106
1119
  withUiState(e) {
1107
- return new v(
1120
+ return new _(
1108
1121
  this._renderingMode,
1109
1122
  this._initialArgs,
1110
1123
  e,
@@ -1121,7 +1134,7 @@ class v {
1121
1134
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
1122
1135
  const e = {
1123
1136
  v3: {
1124
- sdkVersion: O,
1137
+ sdkVersion: T,
1125
1138
  renderingMode: this._renderingMode,
1126
1139
  initialArgs: this._initialArgs,
1127
1140
  initialUiState: this._initialUiState,
@@ -1131,22 +1144,22 @@ class v {
1131
1144
  outputs: this._outputs
1132
1145
  },
1133
1146
  // fields below are added to allow previous desktop versions read generated configs
1134
- sdkVersion: O,
1147
+ sdkVersion: T,
1135
1148
  renderingMode: this._renderingMode,
1136
1149
  initialArgs: this._initialArgs,
1137
- inputsValid: G(this._inputsValid),
1138
- sections: G(this._sections),
1150
+ inputsValid: K(this._inputsValid),
1151
+ sections: K(this._sections),
1139
1152
  outputs: Object.fromEntries(
1140
- Object.entries(this._outputs).map(([t, r]) => [t, G(r)])
1153
+ Object.entries(this._outputs).map(([n, r]) => [n, K(r)])
1141
1154
  )
1142
1155
  };
1143
- return Se() ? oe({ sdkVersion: O }) : { config: e };
1156
+ return Se() ? oe({ sdkVersion: T }) : { config: e };
1144
1157
  }
1145
1158
  }
1146
- function _t(n, e, t, r) {
1159
+ function St(t, e, n, r) {
1147
1160
  var u, h;
1148
1161
  Array.isArray(r) && (r = { filters: r });
1149
- const s = n.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) => {
1162
+ const i = t.resultPool.getData().entries.map((d) => d.obj).filter(X).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), s = (d, p) => {
1150
1163
  let g = d.toString();
1151
1164
  if (p)
1152
1165
  for (const f in p)
@@ -1155,28 +1168,28 @@ function _t(n, e, t, r) {
1155
1168
  }, o = /* @__PURE__ */ new Map();
1156
1169
  for (const d of e)
1157
1170
  for (const p of d.spec.axesSpec) {
1158
- const g = B(p);
1159
- for (const f of s) {
1160
- const C = f.spec.axesSpec[0], y = B(f.spec.axesSpec[0]);
1161
- if (T(g, y)) {
1171
+ const g = U(p);
1172
+ for (const f of i) {
1173
+ const A = f.spec.axesSpec[0], y = U(f.spec.axesSpec[0]);
1174
+ if (x(g, y)) {
1162
1175
  const I = Object.keys(g.domain ?? {}).length, D = Object.keys(y.domain ?? {}).length;
1163
1176
  if (I > D) {
1164
- const F = i(f.id, g.domain);
1165
- o.set(F, {
1166
- id: F,
1177
+ const R = s(f.id, g.domain);
1178
+ o.set(R, {
1179
+ id: R,
1167
1180
  spec: {
1168
1181
  ...f.spec,
1169
- axesSpec: [{ ...g, annotations: C.annotations }]
1182
+ axesSpec: [{ ...g, annotations: A.annotations }]
1170
1183
  },
1171
1184
  data: f.data
1172
1185
  });
1173
1186
  } else
1174
- o.set(i(f.id), f);
1187
+ o.set(s(f.id), f);
1175
1188
  }
1176
1189
  }
1177
1190
  }
1178
1191
  if ([...e, ...o.values()].some(
1179
- (d) => d.data instanceof b && !d.data.getIsReadyOrError()
1192
+ (d) => d.data instanceof v && !d.data.getIsReadyOrError()
1180
1193
  ))
1181
1194
  return;
1182
1195
  let l = e;
@@ -1186,7 +1199,7 @@ function _t(n, e, t, r) {
1186
1199
  for (const d of e)
1187
1200
  r.coreColumnPredicate(d.spec) ? l.push(d) : a.push(d);
1188
1201
  }
1189
- return a.push(...o.values()), n.createPTable({
1202
+ return a.push(...o.values()), t.createPTable({
1190
1203
  src: {
1191
1204
  type: "outer",
1192
1205
  primary: {
@@ -1195,47 +1208,47 @@ function _t(n, e, t, r) {
1195
1208
  },
1196
1209
  secondary: a.map((d) => ({ type: "column", column: d }))
1197
1210
  },
1198
- filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = t == null ? void 0 : t.pTableParams) == null ? void 0 : u.filters) ?? []],
1199
- sorting: ((h = t == null ? void 0 : t.pTableParams) == null ? void 0 : h.sorting) ?? []
1211
+ filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
1212
+ sorting: ((h = n == null ? void 0 : n.pTableParams) == null ? void 0 : h.sorting) ?? []
1200
1213
  });
1201
1214
  }
1202
- function St(n, e, t) {
1203
- const r = n.findLabels(e);
1215
+ function wt(t, e, n) {
1216
+ const r = t.findLabels(e);
1204
1217
  return {
1205
1218
  axis: e,
1206
- options: t.map((s) => ({
1207
- value: s,
1208
- label: (r == null ? void 0 : r[s]) ?? s.toString()
1219
+ options: n.map((i) => ({
1220
+ value: i,
1221
+ label: (r == null ? void 0 : r[i]) ?? i.toString()
1209
1222
  })),
1210
- defaultValue: t[0]
1223
+ defaultValue: n[0]
1211
1224
  };
1212
1225
  }
1213
- const Ve = (n, e) => {
1214
- let t = n.toString();
1226
+ const Ve = (t, e) => {
1227
+ let n = t.toString();
1215
1228
  return e == null || e.forEach((r) => {
1216
1229
  if (r)
1217
- for (const [s, i] of Object.entries(r))
1218
- t += s, t += i;
1219
- }), t;
1230
+ for (const [i, s] of Object.entries(r))
1231
+ n += i, n += s;
1232
+ }), n;
1220
1233
  };
1221
- function je(n) {
1222
- if (!n.length)
1234
+ function je(t) {
1235
+ if (!t.length)
1223
1236
  return [];
1224
1237
  let e = [[]];
1225
- return n.forEach((t) => {
1238
+ return t.forEach((n) => {
1226
1239
  const r = [];
1227
- t.forEach((s) => {
1228
- r.push(...e.map((i) => [...i, s]));
1240
+ n.forEach((i) => {
1241
+ r.push(...e.map((s) => [...s, i]));
1229
1242
  }), e = r;
1230
1243
  }), e;
1231
1244
  }
1232
- function se(n, e) {
1233
- const t = n.spec.axesSpec.map(B), r = e.spec.axesSpec.map(B);
1234
- if (r.every((a) => t.some((u) => T(u, a) && T(a, u))))
1245
+ function ie(t, e) {
1246
+ const n = t.spec.axesSpec.map(U), r = e.spec.axesSpec.map(U);
1247
+ if (r.every((a) => n.some((u) => x(u, a) && x(a, u))))
1235
1248
  return [];
1236
- if (!r.every((a) => t.some((u) => T(u, a))))
1249
+ if (!r.every((a) => n.some((u) => x(u, a))))
1237
1250
  return [];
1238
- const o = r.map((a) => t.filter((u) => T(u, a)));
1251
+ const o = r.map((a) => n.filter((u) => x(u, a)));
1239
1252
  return je(o).map((a) => ({
1240
1253
  id: Ve(e.id, a.map((h) => h.domain)),
1241
1254
  spec: {
@@ -1248,24 +1261,24 @@ function se(n, e) {
1248
1261
  data: e.data
1249
1262
  }));
1250
1263
  }
1251
- function Be(n) {
1264
+ function Ue(t) {
1252
1265
  const e = [];
1253
- for (let t = 0; t < n.length; t++)
1254
- for (let r = t + 1; r < n.length; r++) {
1255
- const s = n[t], i = n[r];
1266
+ for (let n = 0; n < t.length; n++)
1267
+ for (let r = n + 1; r < t.length; r++) {
1268
+ const i = t[n], s = t[r];
1256
1269
  e.push(
1257
- ...se(s, i),
1258
- ...se(i, s)
1270
+ ...ie(i, s),
1271
+ ...ie(s, i)
1259
1272
  );
1260
1273
  }
1261
1274
  return e;
1262
1275
  }
1263
- function wt(n, e) {
1264
- const t = [...e, ...Be(e)];
1265
- if (!t.some(
1266
- (r) => r.data instanceof b && !r.data.getIsReadyOrError()
1276
+ function At(t, e) {
1277
+ const n = [...e, ...Ue(e)];
1278
+ if (!n.some(
1279
+ (r) => r.data instanceof v && !r.data.getIsReadyOrError()
1267
1280
  ))
1268
- return n.createPFrame(t);
1281
+ return t.createPFrame(n);
1269
1282
  }
1270
1283
  class Ct {
1271
1284
  constructor(e) {
@@ -1287,95 +1300,96 @@ class Ct {
1287
1300
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
1288
1301
  }
1289
1302
  }
1290
- function Ne(n) {
1291
- return ie({
1303
+ function Be(t) {
1304
+ return se({
1292
1305
  __isRef: !0,
1293
- blockId: N(n, "blockId"),
1294
- name: N(n, "name")
1306
+ blockId: B(t, "blockId"),
1307
+ name: B(t, "name")
1295
1308
  });
1296
1309
  }
1297
- function At(n) {
1298
- return ie({
1299
- ref: Ne(N(n, "ref")),
1300
- label: N(n, "label")
1310
+ function Pt(t) {
1311
+ return se({
1312
+ ref: Be(B(t, "ref")),
1313
+ label: B(t, "label")
1301
1314
  });
1302
1315
  }
1303
- const Pt = {
1304
- sdkVersion: O
1316
+ const It = {
1317
+ sdkVersion: T
1305
1318
  };
1306
- function It() {
1307
- return oe({ sdkVersion: O });
1319
+ function Rt() {
1320
+ return oe({ sdkVersion: T });
1308
1321
  }
1309
- function Ft(n) {
1322
+ function Ft(t) {
1310
1323
  if (typeof globalThis.getEnvironmentValue == "function")
1311
- return globalThis.getEnvironmentValue(n);
1324
+ return globalThis.getEnvironmentValue(t);
1312
1325
  }
1313
1326
  export {
1314
- Ge as Args,
1315
- v as BlockModel,
1316
- Pt as CurrentSdkInfo,
1317
- _ as FutureRef,
1327
+ Ke as Args,
1328
+ _ as BlockModel,
1329
+ It as CurrentSdkInfo,
1330
+ b as FutureRef,
1318
1331
  He as It,
1319
- mt as JsRenderInternal,
1332
+ yt as JsRenderInternal,
1320
1333
  We as MainOutputs,
1321
1334
  ve as OutputError,
1322
1335
  Ie as PAnnotationLabel,
1323
- Fe as PAnnotationTrace,
1336
+ Re as PAnnotationTrace,
1324
1337
  Ct as PFrameImpl,
1325
1338
  $ as RT_BINARY_PARTITIONED,
1326
- K as RT_BINARY_SUPER_PARTITIONED,
1339
+ G as RT_BINARY_SUPER_PARTITIONED,
1327
1340
  te as RT_JSON_PARTITIONED,
1328
1341
  ne as RT_JSON_SUPER_PARTITIONED,
1329
1342
  z as RT_RESOURCE_MAP,
1330
1343
  Y as RT_RESOURCE_MAP_PARTITIONED,
1331
- L as RenderCtx,
1344
+ E as RenderCtx,
1332
1345
  De as ResultPool,
1333
1346
  qe as StagingOutputs,
1334
- Te as Trace,
1335
- Re as TraceEntry,
1336
- b as TreeNodeAccessor,
1347
+ xe as Trace,
1348
+ Fe as TraceEntry,
1349
+ v as TreeNodeAccessor,
1337
1350
  ze as UiState,
1338
1351
  nt as and,
1339
- wt as createPFrameForGraphs,
1340
- _t as createPlDataTable,
1341
- St as createPlDataTableSheet,
1352
+ At as createPFrameForGraphs,
1353
+ St as createPlDataTable,
1354
+ wt as createPlDataTableSheet,
1342
1355
  ke as deriveLabels,
1343
- G as downgradeCfgOrLambda,
1344
- vt as extractConfig,
1356
+ K as downgradeCfgOrLambda,
1357
+ pt as extractArchiveAndGetURL,
1358
+ _t as extractConfig,
1345
1359
  Ze as flatten,
1346
- At as fromPlOption,
1347
- Ne as fromPlRef,
1348
- Be as getAdditionalColumns,
1360
+ Pt as fromPlOption,
1361
+ Be as fromPlRef,
1362
+ Ue as getAdditionalColumns,
1349
1363
  at as getBlobContent,
1350
1364
  ut as getBlobContentAsJson,
1351
1365
  lt as getBlobContentAsString,
1352
1366
  ct as getDownloadedBlobContent,
1353
1367
  Ft as getEnvironmentValue,
1354
- x as getFromCfg,
1368
+ O as getFromCfg,
1355
1369
  V as getImmediate,
1356
- pt as getImportProgress,
1357
- N as getJsonField,
1358
- ft as getLastLogs,
1359
- gt as getLogHandle,
1370
+ ft as getImportProgress,
1371
+ B as getJsonField,
1372
+ ht as getLastLogs,
1373
+ mt as getLogHandle,
1360
1374
  dt as getOnDemandBlobContent,
1361
- Ee as getPartitionKeysList,
1362
- ht as getProgressLog,
1363
- It as getRawPlatformaInstance,
1364
- st as getResourceField,
1365
- it as getResourceValueAsJson,
1366
- bt as getUniquePartitionKeys,
1375
+ Le as getPartitionKeysList,
1376
+ gt as getProgressLog,
1377
+ Rt as getRawPlatformaInstance,
1378
+ it as getResourceField,
1379
+ st as getResourceValueAsJson,
1380
+ vt as getUniquePartitionKeys,
1367
1381
  H as ifDef,
1368
- Le as isConfigLambda,
1382
+ Ee as isConfigLambda,
1369
1383
  et as isEmpty,
1370
- Ke as isolate,
1384
+ Ge as isolate,
1371
1385
  Ye as makeArray,
1372
- ie as makeObject,
1386
+ se as makeObject,
1373
1387
  Qe as mapArrayValues,
1374
1388
  Xe as mapRecordValues,
1375
1389
  ot as mapResourceFields,
1376
1390
  tt as not,
1377
1391
  rt as or,
1378
- yt as parseResourceMap,
1392
+ bt as parseResourceMap,
1379
1393
  _e as readOutput,
1380
1394
  $e as wrapOutputs
1381
1395
  };