@platforma-sdk/model 1.37.18 → 1.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,24 +1,24 @@
1
- var Ye = Object.defineProperty;
2
- var Xe = (t, e, n) => e in t ? Ye(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var D = (t, e, n) => Xe(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as De, mapPObjectData as xe, isDataInfoEntries as Oe, isDataInfo as Ce, dataInfoToEntries as Qe, selectorsToPredicate as X, resolveAnchors as Pe, deriveNativeId as Ze, isPColumnSpec as ne, isPartitionedDataInfoEntries as et, getAxisId as O, entriesToDataInfo as tt, canonicalizeAxisId as nt, withEnrichments as Se, AnchoredIdDeriver as _e, isPlRef as rt, mapValueInVOE as it, ensurePColumn as st, extractAllColumns as ot, mapPTableDef as at, mapDataInfo as lt, matchAxisId as V, getColumnIdAndSpec as he, canonicalizeJson as R, parseJson as Ie, isPTableAbsent as ut, uniquePlId as ct, PTableNA as dt } from "@milaboratories/pl-model-common";
1
+ var qe = Object.defineProperty;
2
+ var ze = (t, e, n) => e in t ? qe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var F = (t, e, n) => ze(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as De, mapPObjectData as ve, isDataInfoEntries as Fe, isDataInfo as we, dataInfoToEntries as Ye, selectorsToPredicate as X, resolveAnchors as Se, deriveNativeId as Xe, isPColumnSpec as ne, isPartitionedDataInfoEntries as Qe, getAxisId as O, entriesToDataInfo as Ze, canonicalizeAxisId as et, withEnrichments as Ce, AnchoredIdDeriver as Ae, isPlRef as tt, mapValueInVOE as nt, ensurePColumn as rt, extractAllColumns as it, mapPTableDef as st, mapDataInfo as ot, matchAxisId as K, getColumnIdAndSpec as Pe, canonicalizeJson as R, parseJson as xe, isPTableAbsent as at, uniquePlId as lt, PTableNA as ut } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import Re from "canonicalize";
6
+ import Oe from "canonicalize";
7
7
  import { z as U } from "zod";
8
8
  export * from "@milaboratories/pl-error-like";
9
- class pt extends Error {
9
+ class ct extends Error {
10
10
  constructor(e, n) {
11
11
  super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0].message), this.errors = e, this.moreErrors = n;
12
12
  }
13
13
  }
14
- function ft(t) {
15
- if (!t.ok) throw new pt(t.errors, t.moreErrors);
14
+ function dt(t) {
15
+ if (!t.ok) throw new ct(t.errors, t.moreErrors);
16
16
  return t.value;
17
17
  }
18
- function nn(t) {
18
+ function rn(t) {
19
19
  return new Proxy(t, {
20
20
  get(e, n) {
21
- return ft(e[n]);
21
+ return dt(e[n]);
22
22
  }
23
23
  });
24
24
  }
@@ -28,17 +28,17 @@ function P(t) {
28
28
  function Q(t) {
29
29
  return { type: "GetFromCtx", variable: t };
30
30
  }
31
- function rn(t) {
31
+ function sn(t) {
32
32
  return {
33
33
  type: "Isolate",
34
34
  cfg: t
35
35
  };
36
36
  }
37
- const sn = Q("$args"), on = Q("$it"), an = Q("$prod"), ln = Q("$staging"), un = Q("$ui");
37
+ const on = Q("$args"), an = Q("$it"), ln = Q("$prod"), un = Q("$staging"), cn = Q("$ui");
38
38
  function re(t) {
39
39
  return { type: "Immediate", value: t };
40
40
  }
41
- function Fe(t) {
41
+ function Re(t) {
42
42
  const e = {};
43
43
  for (const [n, r] of Object.entries(t)) e[n] = P(r);
44
44
  return {
@@ -46,7 +46,7 @@ function Fe(t) {
46
46
  template: e
47
47
  };
48
48
  }
49
- function cn(...t) {
49
+ function dn(...t) {
50
50
  const e = [];
51
51
  for (const n of t) e.push(P(n));
52
52
  return {
@@ -61,7 +61,7 @@ function ie(t, e) {
61
61
  field: P(e)
62
62
  };
63
63
  }
64
- function dn(t, e, n = "$it") {
64
+ function pn(t, e, n = "$it") {
65
65
  return {
66
66
  type: "MapRecordValues",
67
67
  source: t,
@@ -69,7 +69,7 @@ function dn(t, e, n = "$it") {
69
69
  itVar: n
70
70
  };
71
71
  }
72
- function pn(t, e, n = "$it") {
72
+ function fn(t, e, n = "$it") {
73
73
  return {
74
74
  type: "MapArrayValues",
75
75
  source: t,
@@ -77,32 +77,32 @@ function pn(t, e, n = "$it") {
77
77
  itVar: n
78
78
  };
79
79
  }
80
- function fn(t) {
80
+ function hn(t) {
81
81
  return {
82
82
  type: "Flatten",
83
83
  source: t
84
84
  };
85
85
  }
86
- function hn(t) {
86
+ function gn(t) {
87
87
  return {
88
88
  type: "IsEmpty",
89
89
  arg: t
90
90
  };
91
91
  }
92
- function gn(t) {
92
+ function mn(t) {
93
93
  return {
94
94
  type: "Not",
95
95
  operand: t
96
96
  };
97
97
  }
98
- function mn(t, e) {
98
+ function yn(t, e) {
99
99
  return {
100
100
  type: "And",
101
101
  operand1: t,
102
102
  operand2: e
103
103
  };
104
104
  }
105
- function yn(t, e) {
105
+ function bn(t, e) {
106
106
  return {
107
107
  type: "Or",
108
108
  operand1: t,
@@ -116,7 +116,7 @@ function vn(t, e) {
116
116
  field: P(e)
117
117
  };
118
118
  }
119
- function bn() {
119
+ function wn() {
120
120
  return function(t) {
121
121
  return {
122
122
  type: "GetResourceValueAsJson",
@@ -124,7 +124,7 @@ function bn() {
124
124
  };
125
125
  };
126
126
  }
127
- function wn(t, e, n = "$it") {
127
+ function Sn(t, e, n = "$it") {
128
128
  return {
129
129
  type: "MapResourceFields",
130
130
  source: t,
@@ -132,21 +132,21 @@ function wn(t, e, n = "$it") {
132
132
  itVar: n
133
133
  };
134
134
  }
135
- function An(t, e) {
135
+ function Cn(t, e) {
136
136
  return {
137
137
  type: "GetBlobContent",
138
138
  range: e,
139
139
  source: P(t)
140
140
  };
141
141
  }
142
- function xn(t, e) {
142
+ function An(t, e) {
143
143
  return {
144
144
  type: "GetBlobContentAsString",
145
145
  range: e,
146
146
  source: P(t)
147
147
  };
148
148
  }
149
- function Cn() {
149
+ function Pn() {
150
150
  return function(t, e) {
151
151
  return {
152
152
  type: "GetBlobContentAsJson",
@@ -155,13 +155,13 @@ function Cn() {
155
155
  };
156
156
  };
157
157
  }
158
- function Pn(t) {
158
+ function xn(t) {
159
159
  return {
160
160
  type: "GetDownloadedBlobContent",
161
161
  source: P(t)
162
162
  };
163
163
  }
164
- function Sn(t) {
164
+ function In(t) {
165
165
  return {
166
166
  type: "GetOnDemandBlobContent",
167
167
  source: P(t)
@@ -174,81 +174,81 @@ function _n(t, e) {
174
174
  source: P(t)
175
175
  };
176
176
  }
177
- function In(t) {
177
+ function Tn(t) {
178
178
  return {
179
179
  type: "GetImportProgress",
180
180
  source: P(t)
181
181
  };
182
182
  }
183
- function Tn(t, e) {
183
+ function Ln(t, e) {
184
184
  return {
185
185
  type: "GetLastLogs",
186
186
  source: P(t),
187
187
  lines: e
188
188
  };
189
189
  }
190
- function Ln(t, e) {
190
+ function En(t, e) {
191
191
  return {
192
192
  type: "GetProgressLog",
193
193
  source: P(t),
194
194
  patternToSearch: e
195
195
  };
196
196
  }
197
- function En(t, e) {
197
+ function kn(t, e) {
198
198
  return {
199
199
  type: "GetProgressLogWithInfo",
200
200
  source: P(t),
201
201
  patternToSearch: e
202
202
  };
203
203
  }
204
- function kn(t) {
204
+ function Dn(t) {
205
205
  return {
206
206
  type: "GetLogHandle",
207
207
  source: P(t)
208
208
  };
209
209
  }
210
- function ht() {
210
+ function pt() {
211
211
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
212
212
  }
213
- function Ke(t) {
213
+ function Ve(t) {
214
214
  if (t && typeof globalThis.getPlatforma == "function")
215
215
  return globalThis.getPlatforma(t);
216
216
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
217
217
  throw new Error("Can't get platforma instance.");
218
218
  }
219
- function gt() {
219
+ function ft() {
220
220
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
221
221
  }
222
- function y() {
222
+ function v() {
223
223
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
224
224
  throw new Error("Not in config rendering context");
225
225
  }
226
226
  function H(t, e) {
227
- const n = gt();
227
+ const n = ft();
228
228
  if (n === void 0) return !1;
229
229
  if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
230
230
  return n.callbackRegistry[t] = e, !0;
231
231
  }
232
- const de = /* @__PURE__ */ new Map();
233
- function mt(t, e) {
234
- t in y().callbackRegistry || (y().callbackRegistry[t] = (n) => {
235
- for (const r of de.get(t))
232
+ const ce = /* @__PURE__ */ new Map();
233
+ function ht(t, e) {
234
+ t in v().callbackRegistry || (v().callbackRegistry[t] = (n) => {
235
+ for (const r of ce.get(t))
236
236
  r(n);
237
- }, de.set(t, [])), de.get(t).push(e);
237
+ }, ce.set(t, [])), ce.get(t).push(e);
238
238
  }
239
- class I {
239
+ class L {
240
240
  constructor(e, n = (r) => r) {
241
- D(this, "isResolved", !1);
242
- D(this, "resolvedValue");
243
- this.handle = e, this.postProcess = n, mt(e, (r) => {
241
+ F(this, "isResolved", !1);
242
+ F(this, "resolvedValue");
243
+ this.handle = e, this.postProcess = n, ht(e, (r) => {
244
244
  this.resolvedValue = n(r), this.isResolved = !0;
245
245
  });
246
246
  }
247
247
  map(e) {
248
- return new I(this.handle, (n) => e(this.postProcess(n)));
248
+ return new L(this.handle, (n) => e(this.postProcess(n)));
249
249
  }
250
250
  mapDefined(e) {
251
- return new I(this.handle, (n) => {
251
+ return new L(this.handle, (n) => {
252
252
  const r = this.postProcess(n);
253
253
  return r ? e(r) : void 0;
254
254
  });
@@ -257,10 +257,10 @@ class I {
257
257
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
258
258
  }
259
259
  }
260
- function ge(t, e) {
260
+ function he(t, e) {
261
261
  return t === void 0 ? void 0 : e(t);
262
262
  }
263
- class E {
263
+ class D {
264
264
  constructor(e, n) {
265
265
  this.handle = e, this.resolvePath = n;
266
266
  }
@@ -299,47 +299,47 @@ class E {
299
299
  ...this.resolvePath,
300
300
  ...n.map((i) => typeof i == "string" ? i : i.field)
301
301
  ];
302
- return ge(
303
- y().resolveWithCommon(this.handle, e, ...n),
304
- (i) => new E(i, r)
302
+ return he(
303
+ v().resolveWithCommon(this.handle, e, ...n),
304
+ (i) => new D(i, r)
305
305
  );
306
306
  }
307
307
  get resourceType() {
308
- return y().getResourceType(this.handle);
308
+ return v().getResourceType(this.handle);
309
309
  }
310
310
  getInputsLocked() {
311
- return y().getInputsLocked(this.handle);
311
+ return v().getInputsLocked(this.handle);
312
312
  }
313
313
  getOutputsLocked() {
314
- return y().getOutputsLocked(this.handle);
314
+ return v().getOutputsLocked(this.handle);
315
315
  }
316
316
  getIsReadyOrError() {
317
- return y().getIsReadyOrError(this.handle);
317
+ return v().getIsReadyOrError(this.handle);
318
318
  }
319
319
  getIsFinal() {
320
- return y().getIsFinal(this.handle);
320
+ return v().getIsFinal(this.handle);
321
321
  }
322
322
  getError() {
323
323
  const e = [...this.resolvePath, "error"];
324
- return ge(
325
- y().getError(this.handle),
326
- (n) => new E(n, e)
324
+ return he(
325
+ v().getError(this.handle),
326
+ (n) => new D(n, e)
327
327
  );
328
328
  }
329
329
  listInputFields() {
330
- return y().listInputFields(this.handle);
330
+ return v().listInputFields(this.handle);
331
331
  }
332
332
  listOutputFields() {
333
- return y().listOutputFields(this.handle);
333
+ return v().listOutputFields(this.handle);
334
334
  }
335
335
  listDynamicFields() {
336
- return y().listDynamicFields(this.handle);
336
+ return v().listDynamicFields(this.handle);
337
337
  }
338
338
  getKeyValueBase64(e) {
339
- return y().getKeyValueBase64(this.handle, e);
339
+ return v().getKeyValueBase64(this.handle, e);
340
340
  }
341
341
  getKeyValueAsString(e) {
342
- return y().getKeyValueAsString(this.handle, e);
342
+ return v().getKeyValueAsString(this.handle, e);
343
343
  }
344
344
  getKeyValueAsJson(e) {
345
345
  const n = this.getKeyValueAsString(e);
@@ -347,10 +347,10 @@ class E {
347
347
  return JSON.parse(n);
348
348
  }
349
349
  getDataBase64() {
350
- return y().getDataBase64(this.handle);
350
+ return v().getDataBase64(this.handle);
351
351
  }
352
352
  getDataAsString() {
353
- return y().getDataAsString(this.handle);
353
+ return v().getDataAsString(this.handle);
354
354
  }
355
355
  getDataAsJson() {
356
356
  const e = this.getDataAsString();
@@ -371,7 +371,7 @@ class E {
371
371
  *
372
372
  */
373
373
  parsePObjectCollection(e = !1, n = "") {
374
- const r = y().parsePObjectCollection(
374
+ const r = v().parsePObjectCollection(
375
375
  this.handle,
376
376
  e,
377
377
  n,
@@ -381,19 +381,19 @@ class E {
381
381
  const i = {};
382
382
  for (const [s, o] of Object.entries(r)) {
383
383
  const a = [...this.resolvePath, s];
384
- i[s] = xe(o, (l) => new E(l, a));
384
+ i[s] = ve(o, (l) => new D(l, a));
385
385
  }
386
386
  return i;
387
387
  }
388
388
  getFileContentAsBase64(e) {
389
- return new I(y().getBlobContentAsBase64(this.handle, e));
389
+ return new L(v().getBlobContentAsBase64(this.handle, e));
390
390
  }
391
391
  getFileContentAsString(e) {
392
- return new I(y().getBlobContentAsString(this.handle, e));
392
+ return new L(v().getBlobContentAsString(this.handle, e));
393
393
  }
394
394
  getFileContentAsJson(e) {
395
- return new I(
396
- y().getBlobContentAsString(this.handle, e)
395
+ return new L(
396
+ v().getBlobContentAsString(this.handle, e)
397
397
  ).mapDefined((n) => JSON.parse(n));
398
398
  }
399
399
  /**
@@ -412,7 +412,7 @@ class E {
412
412
  * @returns downloaded file handle
413
413
  */
414
414
  getFileHandle() {
415
- return new I(y().getDownloadedBlobContentHandle(this.handle));
415
+ return new L(v().getDownloadedBlobContentHandle(this.handle));
416
416
  }
417
417
  /**
418
418
  * @deprecated use getFileHandle
@@ -424,7 +424,7 @@ class E {
424
424
  * @returns downloaded file handle
425
425
  */
426
426
  getRemoteFileHandle() {
427
- return new I(y().getOnDemandBlobContentHandle(this.handle));
427
+ return new L(v().getOnDemandBlobContentHandle(this.handle));
428
428
  }
429
429
  /**
430
430
  * @deprecated use getRemoteFileHandle
@@ -436,22 +436,22 @@ class E {
436
436
  * @returns the url to the extracted folder
437
437
  */
438
438
  extractArchiveAndGetURL(e) {
439
- return new I(y().extractArchiveAndGetURL(this.handle, e));
439
+ return new L(v().extractArchiveAndGetURL(this.handle, e));
440
440
  }
441
441
  getImportProgress() {
442
- return new I(y().getImportProgress(this.handle));
442
+ return new L(v().getImportProgress(this.handle));
443
443
  }
444
444
  getLastLogs(e) {
445
- return new I(y().getLastLogs(this.handle, e));
445
+ return new L(v().getLastLogs(this.handle, e));
446
446
  }
447
447
  getProgressLog(e) {
448
- return new I(y().getProgressLog(this.handle, e));
448
+ return new L(v().getProgressLog(this.handle, e));
449
449
  }
450
450
  getProgressLogWithInfo(e) {
451
- return new I(y().getProgressLogWithInfo(this.handle, e));
451
+ return new L(v().getProgressLogWithInfo(this.handle, e));
452
452
  }
453
453
  getLogHandle() {
454
- return new I(y().getLogHandle(this.handle));
454
+ return new L(v().getLogHandle(this.handle));
455
455
  }
456
456
  allFieldsResolved(e = "Input") {
457
457
  switch (e) {
@@ -477,116 +477,117 @@ class E {
477
477
  let l = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
478
478
  (u) => [u, this.resolve({ field: u, assertFieldType: r })]
479
479
  );
480
- return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, c]) => o(u, c));
480
+ return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, d]) => o(u, d));
481
481
  }
482
482
  }
483
- const Ve = "staging", je = "main", yt = {
483
+ const Ke = "staging", je = "main", gt = {
484
484
  explicitColumnsSupport: !0,
485
485
  inlineColumnsSupport: !0,
486
- activeArgs: !0
486
+ activeArgs: !0,
487
+ pTablePartitionFiltersSupport: !0
487
488
  };
488
489
  function Ne(t) {
489
490
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
490
491
  }
491
- function me(t, e, n) {
492
+ function ge(t, e, n) {
492
493
  if (e.has(n)) return;
493
494
  if (e.add(n), typeof n === "object")
494
495
  if (Ne(n)) n.__awaited_futures__.forEach((i) => t.add(i));
495
496
  else if (Array.isArray(n))
496
- for (const i of n) me(t, e, i);
497
+ for (const i of n) ge(t, e, i);
497
498
  else
498
499
  for (const [, i] of Object.entries(n))
499
- i !== n && me(t, e, i);
500
+ i !== n && ge(t, e, i);
500
501
  }
501
- function vt(t) {
502
+ function mt(t) {
502
503
  const e = /* @__PURE__ */ new Set();
503
- return me(e, /* @__PURE__ */ new Set(), t), e;
504
+ return ge(e, /* @__PURE__ */ new Set(), t), e;
504
505
  }
505
- const Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
506
+ const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
506
507
  __proto__: null,
507
- GlobalCfgRenderCtxFeatureFlags: yt,
508
+ GlobalCfgRenderCtxFeatureFlags: gt,
508
509
  MainAccessorName: je,
509
- StagingAccessorName: Ve,
510
- getAllFutureAwaits: vt,
510
+ StagingAccessorName: Ke,
511
+ getAllFutureAwaits: mt,
511
512
  isFutureAwait: Ne
512
- }, Symbol.toStringTag, { value: "Module" })), bt = "pl7.app/label", wt = "pl7.app/trace", At = U.object({
513
+ }, Symbol.toStringTag, { value: "Module" })), yt = "pl7.app/label", bt = "pl7.app/trace", vt = U.object({
513
514
  type: U.string(),
514
515
  importance: U.number().optional(),
515
516
  id: U.string().optional(),
516
517
  label: U.string()
517
- }), xt = U.array(At), Ct = 1e-3, Pt = "__LABEL__", Te = "__LABEL__@1";
518
+ }), wt = U.array(vt), St = 1e-3, Ct = "__LABEL__", Ie = "__LABEL__@1";
518
519
  function $e(t, e, n = {}) {
519
520
  const r = /* @__PURE__ */ new Map(), i = n.forceTraceElements !== void 0 && n.forceTraceElements.length > 0 ? new Set(n.forceTraceElements) : void 0, s = /* @__PURE__ */ new Map(), o = t.map((p) => {
520
- var S, F;
521
- const m = e(p);
522
- let f, v, b;
523
- "spec" in m && typeof m.spec == "object" ? (f = m.spec, v = m.prefixTrace, b = m.suffixTrace) : f = m;
524
- const h = (S = f.annotations) == null ? void 0 : S[bt], w = (F = f.annotations) == null ? void 0 : F[wt], x = (w ? xt.safeParse(JSON.parse(w)).data : void 0) ?? [], C = [
525
- ...v ?? [],
526
- ...x,
527
- ...b ?? []
521
+ var c, m;
522
+ const b = e(p);
523
+ let f, y, w;
524
+ "spec" in b && typeof b.spec == "object" ? (f = b.spec, y = b.prefixTrace, w = b.suffixTrace) : f = b;
525
+ const E = (c = f.annotations) == null ? void 0 : c[yt], x = (m = f.annotations) == null ? void 0 : m[bt], C = (x ? wt.safeParse(JSON.parse(x)).data : void 0) ?? [], A = [
526
+ ...y ?? [],
527
+ ...C,
528
+ ...w ?? []
528
529
  ];
529
- if (h !== void 0) {
530
- const k = { label: h, type: Pt, importance: -2 };
531
- n.addLabelAsSuffix ? C.push(k) : C.splice(0, 0, k);
530
+ if (E !== void 0) {
531
+ const _ = { label: E, type: Ct, importance: -2 };
532
+ n.addLabelAsSuffix ? A.push(_) : A.splice(0, 0, _);
532
533
  }
533
- const A = [], T = /* @__PURE__ */ new Map();
534
- for (let k = C.length - 1; k >= 0; --k) {
535
- const { type: W } = C[k], j = C[k].importance ?? 0, $ = (T.get(W) ?? 0) + 1;
536
- T.set(W, $);
537
- const K = `${W}@${$}`;
538
- s.set(K, (s.get(K) ?? 0) + 1), r.set(
539
- K,
534
+ const S = [], I = /* @__PURE__ */ new Map();
535
+ for (let _ = A.length - 1; _ >= 0; --_) {
536
+ const { type: W } = A[_], j = A[_].importance ?? 0, $ = (I.get(W) ?? 0) + 1;
537
+ I.set(W, $);
538
+ const V = `${W}@${$}`;
539
+ s.set(V, (s.get(V) ?? 0) + 1), r.set(
540
+ V,
540
541
  Math.max(
541
- r.get(K) ?? Number.NEGATIVE_INFINITY,
542
- j - (C.length - k) * Ct
542
+ r.get(V) ?? Number.NEGATIVE_INFINITY,
543
+ j - (A.length - _) * St
543
544
  )
544
- ), A.push({ ...C[k], fullType: K, occurrenceIndex: $ });
545
+ ), S.push({ ...A[_], fullType: V, occurrenceIndex: $ });
545
546
  }
546
- return A.reverse(), {
547
+ return S.reverse(), {
547
548
  value: p,
548
549
  spec: f,
549
- label: h,
550
- fullTrace: A
550
+ label: E,
551
+ fullTrace: S
551
552
  };
552
553
  }), a = [], l = [], u = [...r];
553
- u.sort(([, p], [, m]) => m - p);
554
+ u.sort(([, p], [, b]) => b - p);
554
555
  for (const [p] of u)
555
556
  p.endsWith("@1") || s.get(p) === t.length ? a.push(p) : l.push(p);
556
- const c = (p, m = !1) => {
557
+ const d = (p, b = !1) => {
557
558
  const f = [];
558
- for (let v = 0; v < o.length; v++) {
559
- const b = o[v], h = b.fullTrace.filter((C) => p.has(C.fullType) || i && i.has(C.type));
560
- if (h.length === 0)
561
- if (m)
559
+ for (let y = 0; y < o.length; y++) {
560
+ const w = o[y], E = w.fullTrace.filter((A) => p.has(A.fullType) || i && i.has(A.type));
561
+ if (E.length === 0)
562
+ if (b)
562
563
  f.push({
563
564
  label: "Unlabeled",
564
- value: b.value
565
+ value: w.value
565
566
  });
566
567
  else return;
567
- const w = h.map((C) => C.label), x = n.separator ?? " / ";
568
+ const x = E.map((A) => A.label), C = n.separator ?? " / ";
568
569
  f.push({
569
- label: w.join(x),
570
- value: b.value
570
+ label: x.join(C),
571
+ value: w.value
571
572
  });
572
573
  }
573
574
  return f;
574
575
  };
575
576
  if (a.length === 0) {
576
577
  if (l.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
577
- return c(new Set(Te), !0);
578
+ return d(new Set(Ie), !0);
578
579
  }
579
- let d = 0, g = -1;
580
- for (; d < a.length; ) {
580
+ let h = 0, g = -1;
581
+ for (; h < a.length; ) {
581
582
  const p = /* @__PURE__ */ new Set();
582
- n.includeNativeLabel && p.add(Te);
583
- for (let f = 0; f < d; ++f) p.add(a[f]);
583
+ n.includeNativeLabel && p.add(Ie);
584
+ for (let f = 0; f < h; ++f) p.add(a[f]);
584
585
  g >= 0 && p.add(a[g]);
585
- const m = c(p);
586
- if (m !== void 0 && new Set(m.map((f) => f.label)).size === t.length) return m;
587
- g++, g >= a.length && (d++, g = d);
586
+ const b = d(p);
587
+ if (b !== void 0 && new Set(b.map((f) => f.label)).size === t.length) return b;
588
+ g++, g >= a.length && (h++, g = h);
588
589
  }
589
- return c(/* @__PURE__ */ new Set([...a, ...l]), !0);
590
+ return d(/* @__PURE__ */ new Set([...a, ...l]), !0);
590
591
  }
591
592
  const Z = "PColumnData/", se = Z + "ResourceMap", oe = Z + "Partitioned/ResourceMap", q = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", Je = Z + "Partitioned/", ae = Je + "JsonPartitioned", z = Je + "BinaryPartitioned";
592
593
  function Me(t, e, n, r = [], i) {
@@ -626,14 +627,14 @@ function On(t, e, n = !1) {
626
627
  const r = [];
627
628
  return { isComplete: Me(t, e, r, [], n), data: r };
628
629
  }
629
- const ye = (t) => {
630
+ const me = (t) => {
630
631
  if (t.endsWith(".index"))
631
632
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
632
633
  if (t.endsWith(".values"))
633
634
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
634
635
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
635
636
  };
636
- function St(t) {
637
+ function At(t) {
637
638
  if (!t) return;
638
639
  const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
639
640
  let i = 0;
@@ -658,7 +659,7 @@ function St(t) {
658
659
  case q:
659
660
  case B:
660
661
  for (let s of t.listInputFields()) {
661
- e === B && (s = ye(s).baseKey);
662
+ e === B && (s = me(s).baseKey);
662
663
  const o = [...JSON.parse(s)];
663
664
  r.push(o);
664
665
  }
@@ -670,7 +671,7 @@ function St(t) {
670
671
  const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
671
672
  if (a !== void 0)
672
673
  for (let l of a.listInputFields()) {
673
- e === z && (l = ye(l).baseKey);
674
+ e === z && (l = me(l).baseKey);
674
675
  const u = [...o, ...JSON.parse(l)];
675
676
  r.push(u);
676
677
  }
@@ -679,7 +680,7 @@ function St(t) {
679
680
  }
680
681
  return { data: r, keyLength: i };
681
682
  }
682
- function _t(t) {
683
+ function Pt(t) {
683
684
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
684
685
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
685
686
  const { parts: e, partitionKeyLength: n } = t, r = [];
@@ -698,11 +699,11 @@ function _t(t) {
698
699
  }
699
700
  return r.map((i) => Array.from(i.values()));
700
701
  }
701
- function It(t) {
702
+ function xt(t) {
702
703
  if (t === void 0) return;
703
- if (Oe(t))
704
- return _t(t);
705
- const e = St(t);
704
+ if (Fe(t))
705
+ return Pt(t);
706
+ const e = At(t);
706
707
  if (!e) return;
707
708
  const { data: n, keyLength: r } = e, i = [];
708
709
  for (let s = 0; s < r; ++s)
@@ -715,7 +716,7 @@ function It(t) {
715
716
  }
716
717
  return i.map((s) => Array.from(s.values()));
717
718
  }
718
- function ve(t, e = []) {
719
+ function ye(t, e = []) {
719
720
  if (t === void 0 || !t.getIsReadyOrError()) return;
720
721
  const n = t.resourceType.name, r = t.getDataAsJson();
721
722
  if (e.length > 0 && (n === ae || n === z))
@@ -745,7 +746,7 @@ function ve(t, e = []) {
745
746
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
746
747
  const i = [], s = /* @__PURE__ */ new Map();
747
748
  for (const o of t.listInputFields()) {
748
- const a = ye(o), l = t.resolve({ field: o, assertFieldType: "Input" });
749
+ const a = me(o), l = t.resolve({ field: o, assertFieldType: "Input" });
749
750
  if (l === void 0) return;
750
751
  let u = s.get(a.baseKey);
751
752
  u || (u = {}, s.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
@@ -776,7 +777,7 @@ function ve(t, e = []) {
776
777
  if (a === void 0) return;
777
778
  if (a.resourceType.name !== q)
778
779
  throw new Error(`Expected ${q} inside ${n}, but got ${a.resourceType.name}`);
779
- const l = ve(a, JSON.parse(o));
780
+ const l = ye(a, JSON.parse(o));
780
781
  if (l === void 0) return;
781
782
  if (l.type !== "JsonPartitioned")
782
783
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -797,7 +798,7 @@ function ve(t, e = []) {
797
798
  if (a === void 0) return;
798
799
  if (a.resourceType.name !== B)
799
800
  throw new Error(`Expected ${B} inside ${n}, but got ${a.resourceType.name}`);
800
- const l = ve(a, JSON.parse(o));
801
+ const l = ye(a, JSON.parse(o));
801
802
  if (l === void 0) return;
802
803
  if (l.type !== "BinaryPartitioned")
803
804
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -813,15 +814,15 @@ function ve(t, e = []) {
813
814
  throw new Error(`Unknown resource type: ${n}`);
814
815
  }
815
816
  }
816
- function Tt(t) {
817
+ function It(t) {
817
818
  if (t !== void 0) {
818
- if (Oe(t)) return t;
819
- if (Ce(t)) return Qe(t);
820
- if (t instanceof E) return ve(t);
819
+ if (Fe(t)) return t;
820
+ if (we(t)) return Ye(t);
821
+ if (t instanceof D) return ye(t);
821
822
  throw new Error(`Unexpected input type: ${typeof t}`);
822
823
  }
823
824
  }
824
- function Lt(t, e) {
825
+ function _t(t, e) {
825
826
  const n = [...e].sort((s, o) => o[0] - s[0]);
826
827
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
827
828
  const { partitionKeyLength: s } = t;
@@ -881,13 +882,13 @@ function Lt(t, e) {
881
882
  }
882
883
  }
883
884
  }
884
- function Et(t) {
885
+ function Tt(t) {
885
886
  if (!Array.isArray(t)) return !1;
886
887
  if (t.length === 0) return !0;
887
888
  const e = t[0];
888
889
  return typeof e == "object" && e !== null && "key" in e && "val" in e;
889
890
  }
890
- class kt {
891
+ class Lt {
891
892
  constructor(e) {
892
893
  this.columns = e;
893
894
  }
@@ -896,25 +897,25 @@ class kt {
896
897
  return this.columns.filter((r) => n(r.spec));
897
898
  }
898
899
  }
899
- function Dt(t) {
900
+ function Et(t) {
900
901
  if (t)
901
902
  return t.map((e) => ({
902
- type: `split:${nt(e.axisId)}`,
903
+ type: `split:${et(e.axisId)}`,
903
904
  label: e.label,
904
905
  importance: 1e6
905
906
  // High importance for split filters in labels
906
907
  }));
907
908
  }
908
- function Ot(t) {
909
+ function kt(t) {
909
910
  if (t)
910
911
  return t.map((e) => [e.axisIdx, e.value]);
911
912
  }
912
- function Rt(t, e) {
913
+ function Dt(t, e) {
913
914
  if (!e || e.length === 0) return t;
914
915
  const n = [...e].sort((r, i) => r[0] - i[0]);
915
- return Re({ id: t, axisFilters: n });
916
+ return Oe({ id: t, axisFilters: n });
916
917
  }
917
- function Le(t) {
918
+ function _e(t) {
918
919
  if (!t || typeof t != "object") return !1;
919
920
  const e = t, n = e.domain && typeof e.domain == "object" && Object.values(e.domain).some((i) => typeof i == "object" && i !== null && "anchor" in i), r = e.axes && Array.isArray(e.axes) && e.axes.some((i) => typeof i == "object" && i !== null && "anchor" in i);
920
921
  return !!e.domainAnchor || n || r;
@@ -929,9 +930,9 @@ function Ft(t) {
929
930
  }
930
931
  class le {
931
932
  constructor() {
932
- D(this, "defaultProviderStore", []);
933
- D(this, "providers", [new kt(this.defaultProviderStore)]);
934
- D(this, "axisLabelProviders", []);
933
+ F(this, "defaultProviderStore", []);
934
+ F(this, "providers", [new Lt(this.defaultProviderStore)]);
935
+ F(this, "axisLabelProviders", []);
935
936
  }
936
937
  addColumnProvider(e) {
937
938
  return this.providers.push(e), this;
@@ -959,129 +960,129 @@ class le {
959
960
  };
960
961
  let u = () => !1;
961
962
  if (a) {
962
- const f = (Array.isArray(a) ? a : [a]).map((v) => {
963
- if (Le(v)) {
963
+ const f = (Array.isArray(a) ? a : [a]).map((y) => {
964
+ if (_e(y)) {
964
965
  if (!r)
965
966
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
966
- return X(Pe(r.anchors, v, n));
967
+ return X(Se(r.anchors, y, n));
967
968
  } else
968
- return X(v);
969
+ return X(y);
969
970
  });
970
- u = (v) => f.some((b) => b(v));
971
+ u = (y) => f.some((w) => w(y));
971
972
  }
972
- const c = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], d = [], g = /* @__PURE__ */ new Set();
973
- for (const f of c) {
974
- const v = Le(f);
975
- let b;
976
- if (v) {
973
+ const d = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], h = [], g = /* @__PURE__ */ new Set();
974
+ for (const f of d) {
975
+ const y = _e(f);
976
+ let w;
977
+ if (y) {
977
978
  if (!r)
978
979
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
979
- b = Pe(r.anchors, f, n);
980
+ w = Se(r.anchors, f, n);
980
981
  } else
981
- b = f;
982
- const h = /* @__PURE__ */ new Set(), w = [];
983
- for (const A of this.providers) {
984
- const T = A.selectColumns(b);
985
- for (const S of T) {
986
- if (u(S.spec)) continue;
987
- if (h.has(S.id))
988
- throw new Error(`Duplicate column id ${S.id} in provider ${A.constructor.name}`);
989
- const F = Ze(S.spec);
990
- g.has(F) || (h.add(S.id), g.add(F), w.push(S));
982
+ w = f;
983
+ const E = /* @__PURE__ */ new Set(), x = [];
984
+ for (const S of this.providers) {
985
+ const I = S.selectColumns(w);
986
+ for (const c of I) {
987
+ if (u(c.spec)) continue;
988
+ if (E.has(c.id))
989
+ throw new Error(`Duplicate column id ${c.id} in provider ${S.constructor.name}`);
990
+ const m = Xe(c.spec);
991
+ g.has(m) || (E.add(c.id), g.add(m), x.push(c));
991
992
  }
992
993
  }
993
- if (w.length === 0) continue;
994
- const x = Ft(f), C = x.length > 0;
995
- for (const A of w) {
996
- if (!ne(A.spec)) continue;
997
- const T = A.spec;
998
- if (C) {
999
- if (Et(A.data))
1000
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${A.id}`);
1001
- const S = Tt(A.data);
1002
- if (!S) {
994
+ if (x.length === 0) continue;
995
+ const C = Ft(f), A = C.length > 0;
996
+ for (const S of x) {
997
+ if (!ne(S.spec)) continue;
998
+ const I = S.spec;
999
+ if (A) {
1000
+ if (Tt(S.data))
1001
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${S.id}`);
1002
+ const c = It(S.data);
1003
+ if (!c) {
1003
1004
  if (s) continue;
1004
1005
  return;
1005
1006
  }
1006
- if (!et(S))
1007
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${S.type} for column ${A.id}`);
1008
- const F = It(S), k = x[x.length - 1];
1009
- if (k >= S.partitionKeyLength)
1010
- throw new Error(`Not enough partition keys (${S.partitionKeyLength}) for requested split axes (max index ${k}) in column ${T.name}`);
1011
- const W = x.map((_) => this.findLabels(O(T.axesSpec[_]))), j = [], $ = (_, G) => {
1012
- if (G >= x.length) {
1013
- if (j.push([..._]), j.length > 1e4)
1007
+ if (!Qe(c))
1008
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${S.id}`);
1009
+ const m = xt(c), _ = C[C.length - 1];
1010
+ if (_ >= c.partitionKeyLength)
1011
+ throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${_}) in column ${I.name}`);
1012
+ const W = C.map((T) => this.findLabels(O(I.axesSpec[T]))), j = [], $ = (T, G) => {
1013
+ if (G >= C.length) {
1014
+ if (j.push([...T]), j.length > 1e4)
1014
1015
  throw new Error("Too many key combinations, aborting.");
1015
1016
  return;
1016
1017
  }
1017
- const N = x[G];
1018
- if (N >= F.length)
1019
- throw new Error(`Axis index ${N} out of bounds for unique keys array (length ${F.length}) during split key generation for column ${A.id}`);
1020
- const J = F[N];
1018
+ const N = C[G];
1019
+ if (N >= m.length)
1020
+ throw new Error(`Axis index ${N} out of bounds for unique keys array (length ${m.length}) during split key generation for column ${S.id}`);
1021
+ const J = m[N];
1021
1022
  if (!J || J.length === 0) {
1022
1023
  j.length = 0;
1023
1024
  return;
1024
1025
  }
1025
1026
  for (const ee of J)
1026
- _.push(ee), $(_, G + 1), _.pop();
1027
+ T.push(ee), $(T, G + 1), T.pop();
1027
1028
  };
1028
1029
  if ($([], 0), j.length === 0)
1029
1030
  continue;
1030
- const K = [...T.axesSpec], Ge = x.map((_) => _);
1031
- for (let _ = x.length - 1; _ >= 0; _--)
1032
- K.splice(x[_], 1);
1033
- const He = { ...T, axesSpec: K };
1034
- for (const _ of j) {
1035
- const G = _.map((N, J) => {
1036
- const ee = Ge[J], qe = O(T.axesSpec[ee]), ce = W[J], ze = (ce == null ? void 0 : ce[N]) ?? String(N);
1037
- return { axisIdx: ee, axisId: qe, value: N, label: ze };
1031
+ const V = [...I.axesSpec], Be = C.map((T) => T);
1032
+ for (let T = C.length - 1; T >= 0; T--)
1033
+ V.splice(C[T], 1);
1034
+ const We = { ...I, axesSpec: V };
1035
+ for (const T of j) {
1036
+ const G = T.map((N, J) => {
1037
+ const ee = Be[J], Ge = O(I.axesSpec[ee]), ue = W[J], He = (ue == null ? void 0 : ue[N]) ?? String(N);
1038
+ return { axisIdx: ee, axisId: Ge, value: N, label: He };
1038
1039
  });
1039
- d.push({
1040
+ h.push({
1040
1041
  type: "split",
1041
- originalColumn: A,
1042
- spec: T,
1043
- adjustedSpec: He,
1044
- dataEntries: S,
1042
+ originalColumn: S,
1043
+ spec: I,
1044
+ adjustedSpec: We,
1045
+ dataEntries: c,
1045
1046
  axisFilters: G
1046
1047
  });
1047
1048
  }
1048
1049
  } else
1049
- d.push({
1050
+ h.push({
1050
1051
  type: "direct",
1051
- originalColumn: A,
1052
- spec: T,
1053
- adjustedSpec: T
1052
+ originalColumn: S,
1053
+ spec: I,
1054
+ adjustedSpec: I
1054
1055
  });
1055
1056
  }
1056
1057
  }
1057
- if (d.length === 0) return [];
1058
+ if (h.length === 0) return [];
1058
1059
  const p = $e(
1059
- d,
1060
+ h,
1060
1061
  (f) => ({
1061
1062
  spec: f.spec,
1062
- suffixTrace: f.type === "split" ? Dt(f.axisFilters) : void 0
1063
+ suffixTrace: f.type === "split" ? Et(f.axisFilters) : void 0
1063
1064
  }),
1064
1065
  l
1065
- ), m = [];
1066
- for (const { value: f, label: v } of p) {
1067
- const { originalColumn: b, spec: h } = f, w = f.type === "split" ? f.axisFilters : void 0, x = Ot(w);
1068
- let C;
1069
- r ? C = r.deriveS(h, x) : C = Rt(b.id, x);
1070
- let A = { ...f.adjustedSpec };
1071
- o && (A = {
1072
- ...A,
1066
+ ), b = [];
1067
+ for (const { value: f, label: y } of p) {
1068
+ const { originalColumn: w, spec: E } = f, x = f.type === "split" ? f.axisFilters : void 0, C = kt(x);
1069
+ let A;
1070
+ r ? A = r.deriveS(E, C) : A = Dt(w.id, C);
1071
+ let S = { ...f.adjustedSpec };
1072
+ o && (S = {
1073
+ ...S,
1073
1074
  annotations: {
1074
- ...A.annotations ?? {},
1075
- "pl7.app/label": v
1075
+ ...S.annotations ?? {},
1076
+ "pl7.app/label": y
1076
1077
  }
1077
- }), m.push({
1078
- id: C,
1079
- spec: A,
1080
- data: () => f.type === "split" ? tt(Lt(f.dataEntries, x)) : f.originalColumn.data,
1081
- label: v
1078
+ }), b.push({
1079
+ id: A,
1080
+ spec: S,
1081
+ data: () => f.type === "split" ? Ze(_t(f.dataEntries, C)) : f.originalColumn.data,
1082
+ label: y
1082
1083
  });
1083
1084
  }
1084
- return m;
1085
+ return b;
1085
1086
  }
1086
1087
  getColumns(e, n) {
1087
1088
  const r = this.getUniversalEntries(e, {
@@ -1106,19 +1107,19 @@ class le {
1106
1107
  return i;
1107
1108
  }
1108
1109
  }
1109
- function pe(t, e) {
1110
+ function de(t, e) {
1110
1111
  if (t === void 0) return e === void 0;
1111
1112
  if (e === void 0) return !0;
1112
1113
  for (const n in e)
1113
1114
  if (t[n] !== e[n]) return !1;
1114
1115
  return !0;
1115
1116
  }
1116
- function Ee(t) {
1117
- return xe(t, (e) => e instanceof E ? e.handle : Ce(e) ? lt(e, (n) => n.handle) : e);
1117
+ function Te(t) {
1118
+ return ve(t, (e) => e instanceof D ? e.handle : we(e) ? ot(e, (n) => n.handle) : e);
1118
1119
  }
1119
- class Kt {
1120
+ class Ot {
1120
1121
  constructor() {
1121
- D(this, "ctx", y());
1122
+ F(this, "ctx", v());
1122
1123
  }
1123
1124
  /**
1124
1125
  * @deprecated use getOptions()
@@ -1130,25 +1131,25 @@ class Kt {
1130
1131
  const r = typeof e == "function" ? e : X(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
1131
1132
  let s = {}, o = !1;
1132
1133
  return typeof n < "u" && (typeof n == "function" ? s = n : typeof n == "object" && ("includeNativeLabel" in n || "separator" in n || "addLabelAsSuffix" in n ? s = n : (n = n, s = n.label ?? {}, o = n.refsWithEnrichments ?? !1))), typeof s == "object" ? $e(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
1133
- ref: Se(a, o),
1134
+ ref: Ce(a, o),
1134
1135
  label: l
1135
1136
  })) : i.map(({ ref: a, obj: l }) => ({
1136
- ref: Se(a, o),
1137
+ ref: Ce(a, o),
1137
1138
  label: s(l, a)
1138
1139
  }));
1139
1140
  }
1140
1141
  resolveAnchorCtx(e) {
1141
- if (e instanceof _e) return e;
1142
+ if (e instanceof Ae) return e;
1142
1143
  const n = {};
1143
1144
  for (const [r, i] of Object.entries(e))
1144
- if (rt(i)) {
1145
+ if (tt(i)) {
1145
1146
  const s = this.getPColumnSpecByRef(i);
1146
1147
  if (!s)
1147
1148
  return;
1148
1149
  n[r] = s;
1149
1150
  } else
1150
1151
  n[r] = i;
1151
- return new _e(n);
1152
+ return new Ae(n);
1152
1153
  }
1153
1154
  /**
1154
1155
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -1222,7 +1223,7 @@ class Kt {
1222
1223
  ref: n.ref,
1223
1224
  obj: {
1224
1225
  ...n.obj,
1225
- data: new E(n.obj.data, [n.ref.blockId, n.ref.name])
1226
+ data: new D(n.obj.data, [n.ref.blockId, n.ref.name])
1226
1227
  }
1227
1228
  }))
1228
1229
  };
@@ -1241,9 +1242,9 @@ class Kt {
1241
1242
  ref: n.ref,
1242
1243
  obj: {
1243
1244
  ...n.obj,
1244
- data: it(
1245
+ data: nt(
1245
1246
  n.obj.data,
1246
- (r) => new E(r, [n.ref.blockId, n.ref.name])
1247
+ (r) => new D(r, [n.ref.blockId, n.ref.name])
1247
1248
  )
1248
1249
  }
1249
1250
  }))
@@ -1270,9 +1271,9 @@ class Kt {
1270
1271
  )) == null ? void 0 : r.obj;
1271
1272
  const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
1272
1273
  if (n)
1273
- return xe(
1274
+ return ve(
1274
1275
  n,
1275
- (i) => new E(i, [e.blockId, e.name])
1276
+ (i) => new D(i, [e.blockId, e.name])
1276
1277
  );
1277
1278
  }
1278
1279
  /**
@@ -1283,7 +1284,7 @@ class Kt {
1283
1284
  getPColumnByRef(e) {
1284
1285
  const n = this.getDataByRef(e);
1285
1286
  if (n)
1286
- return st(n);
1287
+ return rt(n);
1287
1288
  }
1288
1289
  /**
1289
1290
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -1315,10 +1316,10 @@ class Kt {
1315
1316
  if (!ne(r.obj.spec))
1316
1317
  continue;
1317
1318
  const i = r.obj.spec;
1318
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && pe(e.domain, i.domain)) {
1319
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && de(e.domain, i.domain)) {
1319
1320
  for (let s = 0; s < e.axesSpec.length; ++s) {
1320
1321
  const o = e.axesSpec[s], a = i.axesSpec[s];
1321
- if (o.name !== a.name || o.type !== a.type || !pe(o.domain, a.domain))
1322
+ if (o.name !== a.name || o.type !== a.type || !de(o.domain, a.domain))
1322
1323
  continue e;
1323
1324
  }
1324
1325
  n.push(r.obj);
@@ -1335,7 +1336,7 @@ class Kt {
1335
1336
  for (const r of n.entries) {
1336
1337
  if (!De(r.obj)) continue;
1337
1338
  const i = r.obj.spec;
1338
- if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && pe(e.domain, i.axesSpec[0].domain)) {
1339
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && de(e.domain, i.axesSpec[0].domain)) {
1339
1340
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
1340
1341
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
1341
1342
  return Object.fromEntries(
@@ -1360,7 +1361,7 @@ class Kt {
1360
1361
  let a = null;
1361
1362
  const l = this;
1362
1363
  return {
1363
- id: Re(i),
1364
+ id: Oe(i),
1364
1365
  spec: o,
1365
1366
  get data() {
1366
1367
  var u;
@@ -1387,13 +1388,13 @@ class Kt {
1387
1388
  }
1388
1389
  class te {
1389
1390
  constructor() {
1390
- D(this, "ctx");
1391
- D(this, "args");
1392
- D(this, "uiState");
1391
+ F(this, "ctx");
1392
+ F(this, "args");
1393
+ F(this, "uiState");
1393
1394
  // lazy rendering because this feature is rarely used
1394
- D(this, "_activeArgsCache");
1395
- D(this, "resultPool", new Kt());
1396
- this.ctx = y(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
1395
+ F(this, "_activeArgsCache");
1396
+ F(this, "resultPool", new Ot());
1397
+ this.ctx = v(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
1397
1398
  }
1398
1399
  /**
1399
1400
  * Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
@@ -1409,13 +1410,13 @@ class te {
1409
1410
  // return this.ctx.featureFlags;
1410
1411
  // }
1411
1412
  getNamedAccessor(e) {
1412
- return ge(
1413
+ return he(
1413
1414
  this.ctx.getAccessorHandleByName(e),
1414
- (n) => new E(n, [e])
1415
+ (n) => new D(n, [e])
1415
1416
  );
1416
1417
  }
1417
1418
  get prerun() {
1418
- return this.getNamedAccessor(Ve);
1419
+ return this.getNamedAccessor(Ke);
1419
1420
  }
1420
1421
  get outputs() {
1421
1422
  return this.getNamedAccessor(je);
@@ -1430,26 +1431,35 @@ class te {
1430
1431
  }
1431
1432
  verifyInlineAndExplicitColumnsSupport(e) {
1432
1433
  var i;
1433
- const n = e.some((s) => !(s.data instanceof E) || Ce(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1434
+ const n = e.some((s) => !(s.data instanceof D) || we(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1434
1435
  if (n && !r) throw Error("Inline or explicit columns not supported");
1435
1436
  }
1437
+ patchPTableDef(e) {
1438
+ var n;
1439
+ return (n = this.ctx.featureFlags) != null && n.pTablePartitionFiltersSupport ? e : {
1440
+ ...e,
1441
+ partitionFilters: [],
1442
+ filters: [...e.partitionFilters, ...e.filters]
1443
+ };
1444
+ }
1436
1445
  // TODO remove all non-PColumn fields
1437
1446
  createPFrame(e) {
1438
1447
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
1439
- e.map((n) => Ee(n))
1448
+ e.map((n) => Te(n))
1440
1449
  );
1441
1450
  }
1442
1451
  createPTable(e) {
1443
1452
  let n;
1444
- return "columns" in e ? n = {
1453
+ return "columns" in e ? n = this.patchPTableDef({
1445
1454
  src: {
1446
1455
  type: "full",
1447
1456
  entries: e.columns.map((r) => ({ type: "column", column: r }))
1448
1457
  },
1449
- filters: e.filters ?? [],
1458
+ partitionFilters: e.filters ?? [],
1459
+ filters: [],
1450
1460
  sorting: e.sorting ?? []
1451
- } : n = e, this.verifyInlineAndExplicitColumnsSupport(ot(n.src)), this.ctx.createPTable(
1452
- at(n, (r) => Ee(r))
1461
+ }) : n = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(it(n.src)), this.ctx.createPTable(
1462
+ st(n, (r) => Te(r))
1453
1463
  );
1454
1464
  }
1455
1465
  /** @deprecated scheduled for removal from SDK */
@@ -1469,13 +1479,13 @@ class te {
1469
1479
  this.ctx.logError(e);
1470
1480
  }
1471
1481
  }
1472
- const Y = "1.37.18";
1473
- function Vt(t) {
1482
+ const Y = "1.38.0";
1483
+ function Rt(t) {
1474
1484
  return t.__renderLambda === !0;
1475
1485
  }
1476
- function fe(t) {
1486
+ function pe(t) {
1477
1487
  if (t !== void 0)
1478
- return Vt(t) ? t.handle : t;
1488
+ return Rt(t) ? t.handle : t;
1479
1489
  }
1480
1490
  function M(t) {
1481
1491
  if (t !== void 0)
@@ -1493,7 +1503,7 @@ function Rn(t) {
1493
1503
  sections: a,
1494
1504
  title: l,
1495
1505
  enrichmentTargets: u
1496
- } = t.v3, { code: c } = t;
1506
+ } = t.v3, { code: d } = t;
1497
1507
  return {
1498
1508
  initialArgs: e,
1499
1509
  initialUiState: n,
@@ -1503,7 +1513,7 @@ function Rn(t) {
1503
1513
  sdkVersion: o,
1504
1514
  sections: a,
1505
1515
  title: l,
1506
- code: c,
1516
+ code: d,
1507
1517
  enrichmentTargets: u
1508
1518
  };
1509
1519
  } else if (t.inputsValid !== void 0) {
@@ -1517,7 +1527,7 @@ function Rn(t) {
1517
1527
  renderingMode: n,
1518
1528
  initialArgs: o,
1519
1529
  outputs: Object.fromEntries(
1520
- Object.entries(r).map(([u, c]) => [u, M(c)])
1530
+ Object.entries(r).map(([u, d]) => [u, M(d)])
1521
1531
  ),
1522
1532
  inputsValid: M(i),
1523
1533
  sections: M(s),
@@ -1535,7 +1545,7 @@ function Rn(t) {
1535
1545
  renderingMode: r,
1536
1546
  initialArgs: o,
1537
1547
  outputs: Object.fromEntries(
1538
- Object.entries(i).map(([u, c]) => [u, M(c)])
1548
+ Object.entries(i).map(([u, d]) => [u, M(d)])
1539
1549
  ),
1540
1550
  inputsValid: M(n),
1541
1551
  sections: M(s),
@@ -1549,12 +1559,12 @@ function Rn(t) {
1549
1559
  );
1550
1560
  }
1551
1561
  }
1552
- class L {
1562
+ class k {
1553
1563
  constructor(e, n, r, i, s, o, a, l) {
1554
1564
  this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = a, this._enrichmentTargets = l;
1555
1565
  }
1556
1566
  static create(e = "Heavy") {
1557
- return new L(
1567
+ return new k(
1558
1568
  e,
1559
1569
  void 0,
1560
1570
  {},
@@ -1568,7 +1578,7 @@ class L {
1568
1578
  output(e, n, r = {}) {
1569
1579
  if (typeof n == "function") {
1570
1580
  const i = `output#${e}`;
1571
- return H(i, () => n(new te())), new L(
1581
+ return H(i, () => n(new te())), new k(
1572
1582
  this._renderingMode,
1573
1583
  this._initialArgs,
1574
1584
  this._initialUiState,
@@ -1586,7 +1596,7 @@ class L {
1586
1596
  this._enrichmentTargets
1587
1597
  );
1588
1598
  } else
1589
- return new L(
1599
+ return new k(
1590
1600
  this._renderingMode,
1591
1601
  this._initialArgs,
1592
1602
  this._initialUiState,
@@ -1605,7 +1615,7 @@ class L {
1605
1615
  return this.output(e, n, { retentive: !0 });
1606
1616
  }
1607
1617
  argsValid(e) {
1608
- return typeof e == "function" ? (H("inputsValid", () => e(new te())), new L(
1618
+ return typeof e == "function" ? (H("inputsValid", () => e(new te())), new k(
1609
1619
  this._renderingMode,
1610
1620
  this._initialArgs,
1611
1621
  this._initialUiState,
@@ -1617,7 +1627,7 @@ class L {
1617
1627
  this._sections,
1618
1628
  this._title,
1619
1629
  this._enrichmentTargets
1620
- )) : new L(
1630
+ )) : new k(
1621
1631
  this._renderingMode,
1622
1632
  this._initialArgs,
1623
1633
  this._initialUiState,
@@ -1629,7 +1639,7 @@ class L {
1629
1639
  );
1630
1640
  }
1631
1641
  sections(e) {
1632
- return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new L(
1642
+ return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new k(
1633
1643
  this._renderingMode,
1634
1644
  this._initialArgs,
1635
1645
  this._initialUiState,
@@ -1638,7 +1648,7 @@ class L {
1638
1648
  { __renderLambda: !0, handle: "sections" },
1639
1649
  this._title,
1640
1650
  this._enrichmentTargets
1641
- )) : new L(
1651
+ )) : new k(
1642
1652
  this._renderingMode,
1643
1653
  this._initialArgs,
1644
1654
  this._initialUiState,
@@ -1651,7 +1661,7 @@ class L {
1651
1661
  }
1652
1662
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
1653
1663
  title(e) {
1654
- return H("title", () => e(new te())), new L(
1664
+ return H("title", () => e(new te())), new k(
1655
1665
  this._renderingMode,
1656
1666
  this._initialArgs,
1657
1667
  this._initialUiState,
@@ -1667,7 +1677,7 @@ class L {
1667
1677
  * @deprecated use {@link withArgs}
1668
1678
  * */
1669
1679
  initialArgs(e) {
1670
- return new L(
1680
+ return new k(
1671
1681
  this._renderingMode,
1672
1682
  e,
1673
1683
  this._initialUiState,
@@ -1680,7 +1690,7 @@ class L {
1680
1690
  }
1681
1691
  /** Sets initial args for the block, this value must be specified. */
1682
1692
  withArgs(e) {
1683
- return new L(
1693
+ return new k(
1684
1694
  this._renderingMode,
1685
1695
  e,
1686
1696
  this._initialUiState,
@@ -1693,7 +1703,7 @@ class L {
1693
1703
  }
1694
1704
  /** Defines type and sets initial value for block UiState. */
1695
1705
  withUiState(e) {
1696
- return new L(
1706
+ return new k(
1697
1707
  this._renderingMode,
1698
1708
  this._initialArgs,
1699
1709
  e,
@@ -1709,7 +1719,7 @@ class L {
1709
1719
  * Influences dependency graph construction.
1710
1720
  */
1711
1721
  enriches(e) {
1712
- return H("enrichmentTargets", e), new L(
1722
+ return H("enrichmentTargets", e), new k(
1713
1723
  this._renderingMode,
1714
1724
  this._initialArgs,
1715
1725
  this._initialUiState,
@@ -1741,40 +1751,52 @@ class L {
1741
1751
  sdkVersion: Y,
1742
1752
  renderingMode: this._renderingMode,
1743
1753
  initialArgs: this._initialArgs,
1744
- inputsValid: fe(this._inputsValid),
1745
- sections: fe(this._sections),
1754
+ inputsValid: pe(this._inputsValid),
1755
+ sections: pe(this._sections),
1746
1756
  outputs: Object.fromEntries(
1747
- Object.entries(this._outputs).map(([n, r]) => [n, fe(r)])
1757
+ Object.entries(this._outputs).map(([n, r]) => [n, pe(r)])
1748
1758
  )
1749
1759
  };
1750
- return ht() ? Ke({ sdkVersion: Y }) : { config: e };
1760
+ return pt() ? Ve({ sdkVersion: Y }) : { config: e };
1751
1761
  }
1752
1762
  }
1753
1763
  function Ue() {
1754
1764
  return {
1755
- version: 2,
1765
+ sourceId: null,
1766
+ hiddenColIds: null,
1767
+ partitionFilters: [],
1768
+ filters: [],
1769
+ sorting: []
1770
+ };
1771
+ }
1772
+ function Vt() {
1773
+ return {
1774
+ version: 3,
1756
1775
  stateCache: [],
1757
- pTableParams: {
1758
- sorting: [],
1759
- filters: [],
1760
- hiddenColIds: null
1761
- }
1776
+ pTableParams: Ue()
1762
1777
  };
1763
1778
  }
1764
- function jt(t) {
1765
- return "version" in t ? t : Ue();
1779
+ function Kt(t) {
1780
+ return "version" in t ? (t.version === 2 && (t = {
1781
+ version: 3,
1782
+ stateCache: t.stateCache.map((e) => ({
1783
+ ...e,
1784
+ filtersState: []
1785
+ })),
1786
+ pTableParams: Ue()
1787
+ }), t) : Vt();
1766
1788
  }
1767
1789
  function be(t) {
1768
1790
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
1769
1791
  }
1770
- function Be(t) {
1792
+ function jt(t) {
1771
1793
  return new le().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1772
1794
  name: "pl7.app/label",
1773
1795
  axes: [{}]
1774
1796
  // exactly one axis
1775
1797
  }, { dontWaitAllData: !0 });
1776
1798
  }
1777
- function we(t, e) {
1799
+ function Le(t, e) {
1778
1800
  const n = [], r = [];
1779
1801
  for (const a of t)
1780
1802
  be(a.spec) ? n.push(a) : r.push(a);
@@ -1782,37 +1804,37 @@ function we(t, e) {
1782
1804
  for (const a of r)
1783
1805
  for (const l of a.spec.axesSpec) {
1784
1806
  const u = O(l);
1785
- i.some((c) => V(c, u)) || i.push(u);
1807
+ i.some((d) => K(d, u)) || i.push(u);
1786
1808
  }
1787
1809
  for (const a of n) {
1788
- const l = O(a.spec.axesSpec[0]), u = i.findIndex((c) => V(c, l));
1810
+ const l = O(a.spec.axesSpec[0]), u = i.findIndex((d) => K(d, l));
1789
1811
  u !== -1 && i.splice(u, 1);
1790
1812
  }
1791
1813
  const s = (a, l) => {
1792
1814
  let u = a.toString();
1793
1815
  if (l)
1794
- for (const c in l)
1795
- u += c, u += l[c];
1816
+ for (const d in l)
1817
+ u += d, u += l[d];
1796
1818
  return u;
1797
1819
  }, o = [];
1798
1820
  for (const a of e) {
1799
- const l = a.spec.axesSpec[0], u = O(l), c = i.findIndex((d) => V(d, u));
1800
- if (c !== -1) {
1801
- const d = i[c], g = Object.keys(d.domain ?? {}).length, p = Object.keys(l.domain ?? {}).length;
1821
+ const l = a.spec.axesSpec[0], u = O(l), d = i.findIndex((h) => K(h, u));
1822
+ if (d !== -1) {
1823
+ const h = i[d], g = Object.keys(h.domain ?? {}).length, p = Object.keys(l.domain ?? {}).length;
1802
1824
  g > p ? o.push({
1803
- id: s(a.id, d.domain),
1825
+ id: s(a.id, h.domain),
1804
1826
  spec: {
1805
1827
  ...a.spec,
1806
- axesSpec: [{ ...d, annotations: l.annotations }]
1828
+ axesSpec: [{ ...h, annotations: l.annotations }]
1807
1829
  },
1808
1830
  data: a.data
1809
- }) : o.push(a), i.splice(c, 1);
1831
+ }) : o.push(a), i.splice(d, 1);
1810
1832
  }
1811
1833
  }
1812
1834
  return o;
1813
1835
  }
1814
- function We(t) {
1815
- const e = (i) => Array.isArray(i), n = (i) => i instanceof E, r = (i) => typeof i == "object" && "type" in i;
1836
+ function Nt(t) {
1837
+ const e = (i) => Array.isArray(i), n = (i) => i instanceof D, r = (i) => typeof i == "object" && "type" in i;
1816
1838
  return t.map((i) => i.data).every((i) => {
1817
1839
  if (e(i))
1818
1840
  return !0;
@@ -1831,86 +1853,102 @@ function We(t) {
1831
1853
  throw Error(`unsupported column data type: ${i}`);
1832
1854
  });
1833
1855
  }
1834
- function Ae(t, e, n, r, i, s) {
1835
- let o = t;
1836
- const a = [];
1837
- if (s) {
1838
- o = [];
1839
- for (const l of t)
1840
- s(l.spec) ? o.push(l) : a.push(l);
1856
+ function Ee(t) {
1857
+ let e = t.columns;
1858
+ const n = [];
1859
+ if (t.coreColumnPredicate) {
1860
+ e = [];
1861
+ for (const r of t.columns)
1862
+ t.coreColumnPredicate(r.spec) ? e.push(r) : n.push(r);
1841
1863
  }
1842
- return a.push(...e), {
1864
+ return n.push(...t.labelColumns), {
1843
1865
  src: {
1844
1866
  type: "outer",
1845
1867
  primary: {
1846
- type: n,
1847
- entries: o.map((l) => ({ type: "column", column: l }))
1868
+ type: t.coreJoinType,
1869
+ entries: e.map((r) => ({ type: "column", column: r }))
1848
1870
  },
1849
- secondary: a.map((l) => ({ type: "column", column: l }))
1871
+ secondary: n.map((r) => ({ type: "column", column: r }))
1850
1872
  },
1851
- filters: r,
1852
- sorting: i
1873
+ partitionFilters: t.partitionFilters,
1874
+ filters: t.filters,
1875
+ sorting: t.sorting
1853
1876
  };
1854
1877
  }
1855
- function Fn(t, e, n, r) {
1856
- var u, c;
1857
- Array.isArray(r) && (r = { filters: r });
1858
- const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s = ue(
1859
- [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
1860
- (d) => R(d.column)
1861
- ), o = ue(
1862
- [...(r == null ? void 0 : r.sorting) ?? [], ...((c = n == null ? void 0 : n.pTableParams) == null ? void 0 : c.sorting) ?? []],
1863
- (d) => R(d.column)
1864
- ), a = Be(t.resultPool);
1865
- if (!a) return;
1866
- const l = we(e.map(he), a);
1867
- if (We([...e, ...l]))
1868
- return t.createPTable(
1869
- Ae(e, l, i, s, o, r == null ? void 0 : r.coreColumnPredicate)
1870
- );
1871
- }
1872
- function Nt(t) {
1878
+ function $t(t) {
1873
1879
  var e;
1874
1880
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
1875
1881
  }
1876
- function $t(t) {
1882
+ function Jt(t) {
1877
1883
  var e;
1878
1884
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
1879
1885
  }
1880
- function ue(t, e) {
1886
+ function fe(t, e) {
1881
1887
  return [...new Map(t.map((n) => [e(n), n])).values()];
1882
1888
  }
1883
- function Kn(t, e, n, r) {
1889
+ function Vn(t, e, n, r) {
1884
1890
  if (e.length === 0) return;
1885
- const i = jt(n ?? Ue()), s = (r == null ? void 0 : r.coreJoinType) ?? "full", o = ue(
1886
- [...(r == null ? void 0 : r.filters) ?? [], ...i.pTableParams.filters],
1887
- (h) => R(h.column)
1888
- ), a = ue(
1889
- [...(r == null ? void 0 : r.sorting) ?? [], ...i.pTableParams.sorting],
1890
- (h) => R(h.column)
1891
- ), l = e.filter((h) => !Nt(h.spec)), u = Be(t.resultPool);
1892
- if (!u) return;
1893
- const c = we(l.map(he), u), d = Ae(l, c, s, o, a, r == null ? void 0 : r.coreColumnPredicate), g = t.createPTable(d), p = new Set((() => {
1894
- if (s === "inner") return [];
1895
- const h = i.pTableParams.hiddenColIds;
1896
- return h || l.filter((w) => $t(w.spec)).map((w) => w.id);
1891
+ const i = e.filter((c) => !$t(c.spec)), s = Kt(n), o = jt(t.resultPool);
1892
+ if (!o) return;
1893
+ const a = Le(i.map(Pe), o), l = [...i, ...a], d = [
1894
+ ...fe(
1895
+ [...l.flatMap((c) => c.spec.axesSpec.map((m) => O(m)))],
1896
+ (c) => R(c)
1897
+ ).map((c) => ({ type: "axis", id: c })),
1898
+ ...l.map((c) => ({ type: "column", id: c.id }))
1899
+ ], h = new Set(d.map((c) => R(c))), g = (c) => h.has(R(c)), p = (r == null ? void 0 : r.coreJoinType) ?? "full", b = s.pTableParams.partitionFilters.filter((c) => {
1900
+ const m = g(c.column);
1901
+ return m || t.logWarn(`Partition filter ${JSON.stringify(c)} does not match provided columns, skipping`), m;
1902
+ }), f = fe(
1903
+ [...(r == null ? void 0 : r.filters) ?? [], ...s.pTableParams.filters],
1904
+ (c) => R(c.column)
1905
+ ).filter((c) => {
1906
+ const m = g(c.column);
1907
+ return m || t.logWarn(`Filter ${JSON.stringify(c)} does not match provided columns, skipping`), m;
1908
+ }), y = fe(
1909
+ [...(r == null ? void 0 : r.sorting) ?? [], ...s.pTableParams.sorting],
1910
+ (c) => R(c.column)
1911
+ ).filter((c) => {
1912
+ const m = g(c.column);
1913
+ return m || t.logWarn(`Sorting ${JSON.stringify(c)} does not match provided columns, skipping`), m;
1914
+ }), w = Ee({
1915
+ columns: i,
1916
+ labelColumns: a,
1917
+ coreJoinType: p,
1918
+ partitionFilters: b,
1919
+ filters: f,
1920
+ sorting: y,
1921
+ coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1922
+ }), E = t.createPTable(w), x = new Set((() => {
1923
+ if (p === "inner") return [];
1924
+ const c = s.pTableParams.hiddenColIds;
1925
+ return c || i.filter((m) => Jt(m.spec)).map((m) => m.id);
1897
1926
  })());
1898
- l.filter((h) => {
1899
- var w;
1900
- return ((w = h.spec.annotations) == null ? void 0 : w["pl7.app/isLinkerColumn"]) === "true";
1901
- }).forEach((h) => p.delete(h.id)), r != null && r.coreColumnPredicate && l.flatMap((w) => {
1902
- var x;
1903
- return (x = r == null ? void 0 : r.coreColumnPredicate) != null && x.call(r, w.spec) ? [w.id] : [];
1904
- }).forEach((w) => p.delete(w)), [...o.map((h) => h.column), ...a.map((h) => h.column)].filter((h) => h.type === "column").forEach((h) => p.delete(h.id));
1905
- const m = l.filter((h) => !p.has(h.id)), f = we(m.map(he), u);
1906
- if (!We([...m, ...f])) return;
1907
- const v = Ae(m, f, s, o, a, r == null ? void 0 : r.coreColumnPredicate), b = t.createPTable(v);
1927
+ i.filter((c) => {
1928
+ var m;
1929
+ return ((m = c.spec.annotations) == null ? void 0 : m["pl7.app/isLinkerColumn"]) === "true";
1930
+ }).forEach((c) => x.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((m) => {
1931
+ var _;
1932
+ return (_ = r == null ? void 0 : r.coreColumnPredicate) != null && _.call(r, m.spec) ? [m.id] : [];
1933
+ }).forEach((m) => x.delete(m)), [...b.map((c) => c.column), ...f.map((c) => c.column), ...y.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => x.delete(c.id));
1934
+ const C = i.filter((c) => !x.has(c.id)), A = Le(C.map(Pe), o);
1935
+ if (!Nt([...C, ...A])) return;
1936
+ const S = Ee({
1937
+ columns: C,
1938
+ labelColumns: A,
1939
+ coreJoinType: p,
1940
+ partitionFilters: b,
1941
+ filters: f,
1942
+ sorting: y,
1943
+ coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1944
+ }), I = t.createPTable(S);
1908
1945
  return {
1909
- fullTableHandle: g,
1910
- visibleTableHandle: b
1946
+ sourceId: s.pTableParams.sourceId,
1947
+ fullTableHandle: E,
1948
+ visibleTableHandle: I
1911
1949
  };
1912
1950
  }
1913
- function Vn(t, e, n) {
1951
+ function Kn(t, e, n) {
1914
1952
  const r = t.resultPool.findLabels(e);
1915
1953
  return {
1916
1954
  axis: e,
@@ -1921,7 +1959,7 @@ function Vn(t, e, n) {
1921
1959
  defaultValue: n[0]
1922
1960
  };
1923
1961
  }
1924
- const Jt = (t, e) => {
1962
+ const Mt = (t, e) => {
1925
1963
  let n = t.toString();
1926
1964
  return e == null || e.forEach((r) => {
1927
1965
  if (r)
@@ -1929,7 +1967,7 @@ const Jt = (t, e) => {
1929
1967
  n += i, n += s;
1930
1968
  }), n;
1931
1969
  };
1932
- function Mt(t) {
1970
+ function Ut(t) {
1933
1971
  if (!t.length)
1934
1972
  return [];
1935
1973
  let e = [[]];
@@ -1940,12 +1978,12 @@ function Mt(t) {
1940
1978
  }), e = r;
1941
1979
  }), e;
1942
1980
  }
1943
- function Ut(t) {
1981
+ function Bt(t) {
1944
1982
  var e;
1945
- return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Wt]) === "true";
1983
+ return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Gt]) === "true";
1946
1984
  }
1947
- const Bt = "pl7.app/graph/isVirtual", ke = "pl7.app/label", Wt = "pl7.app/isLinkerColumn";
1948
- function Gt(t) {
1985
+ const Wt = "pl7.app/graph/isVirtual", ke = "pl7.app/label", Gt = "pl7.app/isLinkerColumn";
1986
+ function Ht(t) {
1949
1987
  var n, r;
1950
1988
  const e = /* @__PURE__ */ new Map();
1951
1989
  for (const { spec: i } of t) {
@@ -1961,10 +1999,10 @@ function Gt(t) {
1961
1999
  }
1962
2000
  return e;
1963
2001
  }
1964
- function Ht(t, e) {
1965
- const n = Gt(t), r = [...n.keys()].map(Ie), i = [];
2002
+ function qt(t, e) {
2003
+ const n = Ht(t), r = [...n.keys()].map(xe), i = [];
1966
2004
  for (const l of e.values()) {
1967
- const u = r.find((c) => V(l, c));
2005
+ const u = r.find((d) => K(l, d));
1968
2006
  u && i.push(R(u));
1969
2007
  }
1970
2008
  const s = new Set(i), o = /* @__PURE__ */ new Map();
@@ -1972,63 +2010,63 @@ function Ht(t, e) {
1972
2010
  for (; a.length; ) {
1973
2011
  const l = [];
1974
2012
  for (const u of a)
1975
- for (const c of n.get(u) ?? [])
1976
- s.has(c) || (l.push(c), s.add(c), o.set(c, Ie(c)));
2013
+ for (const d of n.get(u) ?? [])
2014
+ s.has(d) || (l.push(d), s.add(d), o.set(d, xe(d)));
1977
2015
  a = l;
1978
2016
  }
1979
2017
  return o;
1980
2018
  }
1981
- function qt(t, e) {
2019
+ function zt(t, e) {
1982
2020
  const n = [];
1983
2021
  return e.forEach((r) => {
1984
- n.push(...zt(t, r));
2022
+ n.push(...Yt(t, r));
1985
2023
  }), n;
1986
2024
  }
1987
- function zt(t, e) {
2025
+ function Yt(t, e) {
1988
2026
  const n = e.spec.axesSpec.map(O);
1989
2027
  if (n.every((u) => t.has(R(u))))
1990
2028
  return [e];
1991
2029
  const r = n.map((u) => {
1992
- const c = [];
1993
- for (const [d, g] of t)
1994
- V(g, u) && !V(u, g) && c.push(g);
1995
- return c;
1996
- }), i = Mt(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
1997
- const c = /* @__PURE__ */ new Set();
1998
- return u.map((d, g) => {
1999
- const p = e.spec.axesSpec[g].domain, m = d.domain;
2000
- return Object.entries(m ?? {}).forEach(([f, v]) => {
2030
+ const d = [];
2031
+ for (const [h, g] of t)
2032
+ K(g, u) && !K(u, g) && d.push(g);
2033
+ return d;
2034
+ }), i = Ut(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
2035
+ const d = /* @__PURE__ */ new Set();
2036
+ return u.map((h, g) => {
2037
+ const p = e.spec.axesSpec[g].domain, b = h.domain;
2038
+ return Object.entries(b ?? {}).forEach(([f, y]) => {
2001
2039
  if ((p == null ? void 0 : p[f]) === void 0) {
2002
- const b = JSON.stringify([f, v]);
2003
- c.add(b), s.add(b);
2040
+ const w = JSON.stringify([f, y]);
2041
+ d.add(w), s.add(w);
2004
2042
  }
2005
2043
  }), {
2006
- ...d,
2044
+ ...h,
2007
2045
  annotations: e.spec.axesSpec[g].annotations
2008
2046
  };
2009
- }), c;
2047
+ }), d;
2010
2048
  });
2011
2049
  [...s].forEach((u) => {
2012
- a.some((c) => !c.has(u)) && o.add(u);
2050
+ a.some((d) => !d.has(u)) && o.add(u);
2013
2051
  });
2014
- const l = i.map((u, c) => {
2052
+ const l = i.map((u, d) => {
2015
2053
  var f;
2016
- const d = Jt(e.id, u.map((v) => v.domain)), g = ((f = e.spec.annotations) == null ? void 0 : f[ke]) ?? "", p = [...a[c]].filter((v) => o.has(v)).sort().map((v) => {
2017
- var b;
2018
- return (b = JSON.parse(v)) == null ? void 0 : b[1];
2019
- }).join(" / "), m = {
2054
+ const h = Mt(e.id, u.map((y) => y.domain)), g = ((f = e.spec.annotations) == null ? void 0 : f[ke]) ?? "", p = [...a[d]].filter((y) => o.has(y)).sort().map((y) => {
2055
+ var w;
2056
+ return (w = JSON.parse(y)) == null ? void 0 : w[1];
2057
+ }).join(" / "), b = {
2020
2058
  ...e.spec.annotations,
2021
- [Bt]: "true"
2059
+ [Wt]: "true"
2022
2060
  };
2023
- return (g || p) && (m[ke] = g && p ? g + " / " + p : g + p), {
2024
- id: d,
2061
+ return (g || p) && (b[ke] = g && p ? g + " / " + p : g + p), {
2062
+ id: h,
2025
2063
  spec: {
2026
2064
  ...e.spec,
2027
- axesSpec: u.map((v, b) => ({
2028
- ...v,
2029
- annotations: e.spec.axesSpec[b].annotations
2065
+ axesSpec: u.map((y, w) => ({
2066
+ ...y,
2067
+ annotations: e.spec.axesSpec[w].annotations
2030
2068
  })),
2031
- annotations: m
2069
+ annotations: b
2032
2070
  },
2033
2071
  data: e.data
2034
2072
  };
@@ -2040,47 +2078,47 @@ function jn(t, e) {
2040
2078
  const n = new le();
2041
2079
  n.addColumnProvider(t.resultPool), n.addColumns(e);
2042
2080
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
2043
- for (const d of e)
2044
- for (const g of d.spec.axesSpec) {
2081
+ for (const h of e)
2082
+ for (const g of h.spec.axesSpec) {
2045
2083
  const p = O(g);
2046
2084
  r.set(R(p), p), i.set(R(p), p);
2047
2085
  }
2048
- const s = n.getColumns((d) => Ut(d)) ?? [], o = Ht(s, r);
2049
- for (const d of o)
2050
- r.set(...d), i.set(...d);
2051
- const a = (n.getColumns((d) => d.axesSpec.some((g) => {
2086
+ const s = n.getColumns((h) => Bt(h)) ?? [], o = qt(s, r);
2087
+ for (const h of o)
2088
+ r.set(...h), i.set(...h);
2089
+ const a = (n.getColumns((h) => h.axesSpec.some((g) => {
2052
2090
  const p = O(g);
2053
- for (const m of r.values())
2054
- if (V(m, p))
2091
+ for (const b of r.values())
2092
+ if (K(b, p))
2055
2093
  return !0;
2056
2094
  return !1;
2057
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((d) => !be(d.spec));
2058
- for (const d of a)
2059
- for (const g of d.spec.axesSpec) {
2095
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((h) => !be(h.spec));
2096
+ for (const h of a)
2097
+ for (const g of h.spec.axesSpec) {
2060
2098
  const p = O(g);
2061
2099
  i.set(R(p), p);
2062
2100
  }
2063
- const l = (n.getColumns((d) => d.axesSpec.some((g) => {
2101
+ const l = (n.getColumns((h) => h.axesSpec.some((g) => {
2064
2102
  const p = O(g);
2065
- for (const m of i.values())
2066
- if (V(m, p))
2103
+ for (const b of i.values())
2104
+ if (K(b, p))
2067
2105
  return !0;
2068
2106
  return !1;
2069
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((d) => be(d.spec)), u = [...a, ...l], c = qt(r, u);
2070
- if (!c.some(
2071
- (d) => d.data instanceof E && !d.data.getIsReadyOrError()
2107
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((h) => be(h.spec)), u = [...a, ...l], d = zt(r, u);
2108
+ if (!d.some(
2109
+ (h) => h.data instanceof D && !h.data.getIsReadyOrError()
2072
2110
  ))
2073
- return t.createPFrame(c);
2111
+ return t.createPFrame(d);
2074
2112
  }
2075
2113
  function Nn({
2076
2114
  selection: t,
2077
- columnId: e = ct(),
2115
+ columnId: e = lt(),
2078
2116
  label: n = "Selection marker",
2079
2117
  domain: r
2080
2118
  }) {
2081
2119
  if (!(t != null && t.axesSpec.length))
2082
2120
  return;
2083
- const i = t.selectedKeys.filter((s) => s.every((o) => !ut(o))).map((s) => ({ key: s, val: 1 }));
2121
+ const i = t.selectedKeys.filter((s) => s.every((o) => !at(o))).map((s) => ({ key: s, val: 1 }));
2084
2122
  if (i.length)
2085
2123
  return {
2086
2124
  id: e,
@@ -2099,7 +2137,7 @@ function Nn({
2099
2137
  };
2100
2138
  }
2101
2139
  function $n(t) {
2102
- return t === dt ? (console.error("Axis value can never be N/A"), "") : t;
2140
+ return t === ut ? (console.error("Axis value can never be N/A"), "") : t;
2103
2141
  }
2104
2142
  class Jn {
2105
2143
  constructor(e) {
@@ -2121,28 +2159,28 @@ class Jn {
2121
2159
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
2122
2160
  }
2123
2161
  }
2124
- function Yt(t) {
2125
- return Fe({
2162
+ function Xt(t) {
2163
+ return Re({
2126
2164
  __isRef: !0,
2127
2165
  blockId: ie(t, "blockId"),
2128
2166
  name: ie(t, "name")
2129
2167
  });
2130
2168
  }
2131
2169
  function Mn(t) {
2132
- return Fe({
2133
- ref: Yt(ie(t, "ref")),
2170
+ return Re({
2171
+ ref: Xt(ie(t, "ref")),
2134
2172
  label: ie(t, "label")
2135
2173
  });
2136
2174
  }
2137
2175
  const Un = {
2138
2176
  sdkVersion: Y
2139
2177
  };
2140
- function Xt() {
2141
- return Ke({ sdkVersion: Y });
2178
+ function Qt() {
2179
+ return Ve({ sdkVersion: Y });
2142
2180
  }
2143
2181
  function Bn(t) {
2144
2182
  try {
2145
- return Xt();
2183
+ return Qt();
2146
2184
  } catch {
2147
2185
  return t;
2148
2186
  }
@@ -2152,19 +2190,19 @@ function Wn(t) {
2152
2190
  return globalThis.getEnvironmentValue(t);
2153
2191
  }
2154
2192
  export {
2155
- sn as Args,
2156
- L as BlockModel,
2193
+ on as Args,
2194
+ k as BlockModel,
2157
2195
  Un as CurrentSdkInfo,
2158
- I as FutureRef,
2159
- Bt as IS_VIRTUAL_COLUMN,
2160
- on as It,
2161
- Dn as JsRenderInternal,
2196
+ L as FutureRef,
2197
+ Wt as IS_VIRTUAL_COLUMN,
2198
+ an as It,
2199
+ Fn as JsRenderInternal,
2162
2200
  ke as LABEL_ANNOTATION,
2163
- Wt as LINKER_COLUMN_ANNOTATION,
2164
- an as MainOutputs,
2165
- pt as OutputError,
2166
- bt as PAnnotationLabel,
2167
- wt as PAnnotationTrace,
2201
+ Gt as LINKER_COLUMN_ANNOTATION,
2202
+ ln as MainOutputs,
2203
+ ct as OutputError,
2204
+ yt as PAnnotationLabel,
2205
+ bt as PAnnotationTrace,
2168
2206
  le as PColumnCollection,
2169
2207
  Jn as PFrameImpl,
2170
2208
  B as RT_BINARY_PARTITIONED,
@@ -2174,75 +2212,75 @@ export {
2174
2212
  se as RT_RESOURCE_MAP,
2175
2213
  oe as RT_RESOURCE_MAP_PARTITIONED,
2176
2214
  te as RenderCtx,
2177
- Kt as ResultPool,
2178
- ln as StagingOutputs,
2179
- xt as Trace,
2180
- At as TraceEntry,
2181
- E as TreeNodeAccessor,
2182
- un as UiState,
2183
- We as allColumnsComputed,
2184
- mn as and,
2185
- Tt as convertOrParsePColumnData,
2215
+ Ot as ResultPool,
2216
+ un as StagingOutputs,
2217
+ wt as Trace,
2218
+ vt as TraceEntry,
2219
+ D as TreeNodeAccessor,
2220
+ cn as UiState,
2221
+ Nt as allColumnsComputed,
2222
+ yn as and,
2223
+ It as convertOrParsePColumnData,
2186
2224
  jn as createPFrameForGraphs,
2187
- Fn as createPlDataTable,
2188
- Vn as createPlDataTableSheet,
2189
- Ue as createPlDataTableStateV2,
2190
- Kn as createPlDataTableV2,
2225
+ Kn as createPlDataTableSheet,
2226
+ Vt as createPlDataTableStateV2,
2227
+ Vn as createPlDataTableV2,
2191
2228
  Nn as createRowSelectionColumn,
2192
2229
  $e as deriveLabels,
2193
- fe as downgradeCfgOrLambda,
2194
- qt as enrichCompatible,
2230
+ pe as downgradeCfgOrLambda,
2231
+ zt as enrichCompatible,
2195
2232
  _n as extractArchiveAndGetURL,
2196
2233
  Rn as extractConfig,
2197
- Lt as filterDataInfoEntries,
2198
- fn as flatten,
2234
+ _t as filterDataInfoEntries,
2235
+ hn as flatten,
2199
2236
  Mn as fromPlOption,
2200
- Yt as fromPlRef,
2201
- Be as getAllLabelColumns,
2202
- Ht as getAvailableWithLinkersAxes,
2203
- An as getBlobContent,
2204
- Cn as getBlobContentAsJson,
2205
- xn as getBlobContentAsString,
2206
- Pn as getDownloadedBlobContent,
2237
+ Xt as fromPlRef,
2238
+ jt as getAllLabelColumns,
2239
+ qt as getAvailableWithLinkersAxes,
2240
+ Cn as getBlobContent,
2241
+ Pn as getBlobContentAsJson,
2242
+ An as getBlobContentAsString,
2243
+ xn as getDownloadedBlobContent,
2207
2244
  Wn as getEnvironmentValue,
2208
2245
  Q as getFromCfg,
2209
2246
  re as getImmediate,
2210
- In as getImportProgress,
2247
+ Tn as getImportProgress,
2211
2248
  ie as getJsonField,
2212
- Tn as getLastLogs,
2213
- Gt as getLinkerColumnsMap,
2214
- kn as getLogHandle,
2215
- we as getMatchingLabelColumns,
2216
- Sn as getOnDemandBlobContent,
2217
- St as getPartitionKeysList,
2249
+ Ln as getLastLogs,
2250
+ Ht as getLinkerColumnsMap,
2251
+ Dn as getLogHandle,
2252
+ Le as getMatchingLabelColumns,
2253
+ In as getOnDemandBlobContent,
2254
+ At as getPartitionKeysList,
2218
2255
  Bn as getPlatformaOrDefault,
2219
- Ln as getProgressLog,
2220
- En as getProgressLogWithInfo,
2221
- Xt as getRawPlatformaInstance,
2256
+ En as getProgressLog,
2257
+ kn as getProgressLogWithInfo,
2258
+ Qt as getRawPlatformaInstance,
2222
2259
  vn as getResourceField,
2223
- bn as getResourceValueAsJson,
2224
- It as getUniquePartitionKeys,
2225
- ge as ifDef,
2226
- Nt as isColumnHidden,
2227
- $t as isColumnOptional,
2228
- Vt as isConfigLambda,
2229
- hn as isEmpty,
2260
+ wn as getResourceValueAsJson,
2261
+ xt as getUniquePartitionKeys,
2262
+ he as ifDef,
2263
+ $t as isColumnHidden,
2264
+ Jt as isColumnOptional,
2265
+ Rt as isConfigLambda,
2266
+ gn as isEmpty,
2230
2267
  be as isLabelColumn,
2231
- Ut as isLinkerColumn,
2232
- rn as isolate,
2233
- cn as makeArray,
2234
- Fe as makeObject,
2235
- pn as mapArrayValues,
2268
+ Bt as isLinkerColumn,
2269
+ sn as isolate,
2270
+ dn as makeArray,
2271
+ Ue as makeDefaultPTableParams,
2272
+ Re as makeObject,
2273
+ fn as mapArrayValues,
2236
2274
  $n as mapPTableValueToAxisKey,
2237
- dn as mapRecordValues,
2238
- wn as mapResourceFields,
2239
- gn as not,
2240
- yn as or,
2241
- ve as parsePColumnData,
2275
+ pn as mapRecordValues,
2276
+ Sn as mapResourceFields,
2277
+ mn as not,
2278
+ bn as or,
2279
+ ye as parsePColumnData,
2242
2280
  On as parseResourceMap,
2243
- ft as readOutput,
2244
- ue as uniqueBy,
2245
- jt as upgradePlDataTableStateV2,
2246
- nn as wrapOutputs
2281
+ dt as readOutput,
2282
+ fe as uniqueBy,
2283
+ Kt as upgradePlDataTableStateV2,
2284
+ rn as wrapOutputs
2247
2285
  };
2248
2286
  //# sourceMappingURL=index.mjs.map