@platforma-sdk/model 1.20.11 → 1.20.27

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