@platforma-sdk/model 1.40.1 → 1.40.5

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,67 +1,67 @@
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 k = (t, e, n) => Ze(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as Ke, mapPObjectData as Se, isDataInfoEntries as Ne, isDataInfo as ue, dataInfoToEntries as et, selectorsToPredicate as Y, resolveAnchors as we, deriveNativeId as tt, isPColumnSpec as re, isPartitionedDataInfoEntries as nt, getAxisId as D, entriesToDataInfo as rt, canonicalizeAxisId as it, withEnrichments as Ae, AnchoredIdDeriver as Pe, isPlRef as st, mapValueInVOE as ot, ensurePColumn as at, extractAllColumns as lt, mapPTableDef as ut, mapDataInfo as ct, extractConfigGeneric as pt, matchAxisId as N, getColumnIdAndSpec as xe, canonicalizeJson as O, parseJson as _e, visitDataInfo as dt, isPTableAbsent as ft, uniquePlId as ht, PTableNA as gt } from "@milaboratories/pl-model-common";
1
+ var rt = Object.defineProperty;
2
+ var it = (t, e, n) => e in t ? rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var k = (t, e, n) => it(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as Me, mapPObjectData as Pe, isDataInfoEntries as je, isDataInfo as pe, dataInfoToEntries as ot, selectorsToPredicate as Y, resolveAnchors as we, deriveNativeId as st, isPColumnSpec as oe, isPartitionedDataInfoEntries as at, getAxisId as V, entriesToDataInfo as lt, canonicalizeAxisId as ut, withEnrichments as xe, AnchoredIdDeriver as Fe, isPlRef as ct, mapValueInVOE as pt, ensurePColumn as dt, extractAllColumns as ft, mapPTableDef as ht, mapDataInfo as mt, extractConfigGeneric as yt, matchAxisId as U, getColumnIdAndSpec as Ie, canonicalizeJson as D, parseJson as _e, visitDataInfo as gt, isPTableAbsent as bt, uniquePlId as vt, PTableNA as Ct } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import Ve from "canonicalize";
7
- import { z as $ } from "zod";
6
+ import qe from "canonicalize";
7
+ import { z as B } from "zod";
8
8
  export * from "@milaboratories/pl-error-like";
9
- class mt extends Error {
9
+ class Tt 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 yt(t) {
15
- if (!t.ok) throw new mt(t.errors, t.moreErrors);
14
+ function St(t) {
15
+ if (!t.ok) throw new Tt(t.errors, t.moreErrors);
16
16
  return t.value;
17
17
  }
18
- function un(t) {
18
+ function mn(t) {
19
19
  return new Proxy(t, {
20
20
  get(e, n) {
21
- return yt(e[n]);
21
+ return St(e[n]);
22
22
  }
23
23
  });
24
24
  }
25
- function P(t) {
26
- return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? ie(t) : t;
25
+ function A(t) {
26
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? se(t) : t;
27
27
  }
28
- function Q(t) {
28
+ function Z(t) {
29
29
  return { type: "GetFromCtx", variable: t };
30
30
  }
31
- function cn(t) {
31
+ function yn(t) {
32
32
  return {
33
33
  type: "Isolate",
34
34
  cfg: t
35
35
  };
36
36
  }
37
- const pn = Q("$args"), dn = Q("$it"), fn = Q("$prod"), hn = Q("$staging"), gn = Q("$ui");
38
- function ie(t) {
37
+ const gn = Z("$args"), bn = Z("$it"), vn = Z("$prod"), Cn = Z("$staging"), Tn = Z("$ui");
38
+ function se(t) {
39
39
  return { type: "Immediate", value: t };
40
40
  }
41
- function Me(t) {
41
+ function Be(t) {
42
42
  const e = {};
43
- for (const [n, r] of Object.entries(t)) e[n] = P(r);
43
+ for (const [n, r] of Object.entries(t)) e[n] = A(r);
44
44
  return {
45
45
  type: "MakeObject",
46
46
  template: e
47
47
  };
48
48
  }
49
- function mn(...t) {
49
+ function Sn(...t) {
50
50
  const e = [];
51
- for (const n of t) e.push(P(n));
51
+ for (const n of t) e.push(A(n));
52
52
  return {
53
53
  type: "MakeArray",
54
54
  template: e
55
55
  };
56
56
  }
57
- function se(t, e) {
57
+ function ae(t, e) {
58
58
  return {
59
59
  type: "GetJsonField",
60
- source: P(t),
61
- field: P(e)
60
+ source: A(t),
61
+ field: A(e)
62
62
  };
63
63
  }
64
- function yn(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 yn(t, e, n = "$it") {
69
69
  itVar: n
70
70
  };
71
71
  }
72
- function bn(t, e, n = "$it") {
72
+ function An(t, e, n = "$it") {
73
73
  return {
74
74
  type: "MapArrayValues",
75
75
  source: t,
@@ -77,54 +77,54 @@ function bn(t, e, n = "$it") {
77
77
  itVar: n
78
78
  };
79
79
  }
80
- function vn(t) {
80
+ function wn(t) {
81
81
  return {
82
82
  type: "Flatten",
83
83
  source: t
84
84
  };
85
85
  }
86
- function Cn(t) {
86
+ function xn(t) {
87
87
  return {
88
88
  type: "IsEmpty",
89
89
  arg: t
90
90
  };
91
91
  }
92
- function Sn(t) {
92
+ function Fn(t) {
93
93
  return {
94
94
  type: "Not",
95
95
  operand: t
96
96
  };
97
97
  }
98
- function wn(t, e) {
98
+ function In(t, e) {
99
99
  return {
100
100
  type: "And",
101
101
  operand1: t,
102
102
  operand2: e
103
103
  };
104
104
  }
105
- function An(t, e) {
105
+ function _n(t, e) {
106
106
  return {
107
107
  type: "Or",
108
108
  operand1: t,
109
109
  operand2: e
110
110
  };
111
111
  }
112
- function Pn(t, e) {
112
+ function Ln(t, e) {
113
113
  return {
114
114
  type: "GetResourceField",
115
- source: P(t),
116
- field: P(e)
115
+ source: A(t),
116
+ field: A(e)
117
117
  };
118
118
  }
119
- function xn() {
119
+ function En() {
120
120
  return function(t) {
121
121
  return {
122
122
  type: "GetResourceValueAsJson",
123
- source: P(t)
123
+ source: A(t)
124
124
  };
125
125
  };
126
126
  }
127
- function _n(t, e, n = "$it") {
127
+ function kn(t, e, n = "$it") {
128
128
  return {
129
129
  type: "MapResourceFields",
130
130
  source: t,
@@ -132,91 +132,91 @@ function _n(t, e, n = "$it") {
132
132
  itVar: n
133
133
  };
134
134
  }
135
- function In(t, e) {
135
+ function Vn(t, e) {
136
136
  return {
137
137
  type: "GetBlobContent",
138
138
  range: e,
139
- source: P(t)
139
+ source: A(t)
140
140
  };
141
141
  }
142
- function Tn(t, e) {
142
+ function On(t, e) {
143
143
  return {
144
144
  type: "GetBlobContentAsString",
145
145
  range: e,
146
- source: P(t)
146
+ source: A(t)
147
147
  };
148
148
  }
149
- function Ln() {
149
+ function Dn() {
150
150
  return function(t, e) {
151
151
  return {
152
152
  type: "GetBlobContentAsJson",
153
153
  range: e,
154
- source: P(t)
154
+ source: A(t)
155
155
  };
156
156
  };
157
157
  }
158
- function Fn(t) {
158
+ function Rn(t) {
159
159
  return {
160
160
  type: "GetDownloadedBlobContent",
161
- source: P(t)
161
+ source: A(t)
162
162
  };
163
163
  }
164
- function En(t) {
164
+ function Nn(t) {
165
165
  return {
166
166
  type: "GetOnDemandBlobContent",
167
- source: P(t)
167
+ source: A(t)
168
168
  };
169
169
  }
170
- function kn(t, e) {
170
+ function Un(t, e) {
171
171
  return {
172
172
  type: "ExtractArchiveAndGetURL",
173
173
  format: e,
174
- source: P(t)
174
+ source: A(t)
175
175
  };
176
176
  }
177
- function Dn(t) {
177
+ function Kn(t) {
178
178
  return {
179
179
  type: "GetImportProgress",
180
- source: P(t)
180
+ source: A(t)
181
181
  };
182
182
  }
183
- function Rn(t, e) {
183
+ function Mn(t, e) {
184
184
  return {
185
185
  type: "GetLastLogs",
186
- source: P(t),
186
+ source: A(t),
187
187
  lines: e
188
188
  };
189
189
  }
190
- function On(t, e) {
190
+ function jn(t, e) {
191
191
  return {
192
192
  type: "GetProgressLog",
193
- source: P(t),
193
+ source: A(t),
194
194
  patternToSearch: e
195
195
  };
196
196
  }
197
- function Kn(t, e) {
197
+ function qn(t, e) {
198
198
  return {
199
199
  type: "GetProgressLogWithInfo",
200
- source: P(t),
200
+ source: A(t),
201
201
  patternToSearch: e
202
202
  };
203
203
  }
204
- function Nn(t) {
204
+ function Bn(t) {
205
205
  return {
206
206
  type: "GetLogHandle",
207
- source: P(t)
207
+ source: A(t)
208
208
  };
209
209
  }
210
- function bt() {
210
+ function Pt() {
211
211
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
212
212
  }
213
- function je(t) {
213
+ function Je(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 vt() {
219
+ function At() {
220
220
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
221
221
  }
222
222
  function v() {
@@ -224,31 +224,31 @@ function v() {
224
224
  throw new Error("Not in config rendering context");
225
225
  }
226
226
  function G(t, e) {
227
- const n = vt();
227
+ const n = At();
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 pe = /* @__PURE__ */ new Map();
233
- function Ct(t, e) {
232
+ const fe = /* @__PURE__ */ new Map();
233
+ function wt(t, e) {
234
234
  t in v().callbackRegistry || (v().callbackRegistry[t] = (n) => {
235
- for (const r of pe.get(t))
235
+ for (const r of fe.get(t))
236
236
  r(n);
237
- }, pe.set(t, [])), pe.get(t).push(e);
237
+ }, fe.set(t, [])), fe.get(t).push(e);
238
238
  }
239
- class F {
239
+ class L {
240
240
  constructor(e, n = (r) => r) {
241
241
  k(this, "isResolved", !1);
242
242
  k(this, "resolvedValue");
243
- this.handle = e, this.postProcess = n, Ct(e, (r) => {
243
+ this.handle = e, this.postProcess = n, wt(e, (r) => {
244
244
  this.resolvedValue = n(r), this.isResolved = !0;
245
245
  });
246
246
  }
247
247
  map(e) {
248
- return new F(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 F(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
  });
@@ -260,7 +260,7 @@ class F {
260
260
  function ge(t, e) {
261
261
  return t === void 0 ? void 0 : e(t);
262
262
  }
263
- class R {
263
+ class O {
264
264
  constructor(e, n) {
265
265
  this.handle = e, this.resolvePath = n;
266
266
  }
@@ -301,7 +301,7 @@ class R {
301
301
  ];
302
302
  return ge(
303
303
  v().resolveWithCommon(this.handle, e, ...n),
304
- (i) => new R(i, r)
304
+ (i) => new O(i, r)
305
305
  );
306
306
  }
307
307
  get resourceType() {
@@ -323,7 +323,7 @@ class R {
323
323
  const e = [...this.resolvePath, "error"];
324
324
  return ge(
325
325
  v().getError(this.handle),
326
- (n) => new R(n, e)
326
+ (n) => new O(n, e)
327
327
  );
328
328
  }
329
329
  listInputFields() {
@@ -362,9 +362,9 @@ class R {
362
362
  */
363
363
  getPColumns(e = !1, n = "") {
364
364
  const r = this.parsePObjectCollection(e, n);
365
- return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
366
- if (!Ke(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
367
- return s;
365
+ return r === void 0 ? void 0 : Object.entries(r).map(([, o]) => {
366
+ if (!Me(o)) throw new Error(`not a PColumn (kind = ${o.spec.kind})`);
367
+ return o;
368
368
  });
369
369
  }
370
370
  /**
@@ -379,20 +379,20 @@ class R {
379
379
  );
380
380
  if (r === void 0) return;
381
381
  const i = {};
382
- for (const [s, o] of Object.entries(r)) {
383
- const a = [...this.resolvePath, s];
384
- i[s] = Se(o, (l) => new R(l, a));
382
+ for (const [o, s] of Object.entries(r)) {
383
+ const a = [...this.resolvePath, o];
384
+ i[o] = Pe(s, (l) => new O(l, a));
385
385
  }
386
386
  return i;
387
387
  }
388
388
  getFileContentAsBase64(e) {
389
- return new F(v().getBlobContentAsBase64(this.handle, e));
389
+ return new L(v().getBlobContentAsBase64(this.handle, e));
390
390
  }
391
391
  getFileContentAsString(e) {
392
- return new F(v().getBlobContentAsString(this.handle, e));
392
+ return new L(v().getBlobContentAsString(this.handle, e));
393
393
  }
394
394
  getFileContentAsJson(e) {
395
- return new F(
395
+ return new L(
396
396
  v().getBlobContentAsString(this.handle, e)
397
397
  ).mapDefined((n) => JSON.parse(n));
398
398
  }
@@ -412,7 +412,7 @@ class R {
412
412
  * @returns downloaded file handle
413
413
  */
414
414
  getFileHandle() {
415
- return new F(v().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 R {
424
424
  * @returns downloaded file handle
425
425
  */
426
426
  getRemoteFileHandle() {
427
- return new F(v().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 R {
436
436
  * @returns the url to the extracted folder
437
437
  */
438
438
  extractArchiveAndGetURL(e) {
439
- return new F(v().extractArchiveAndGetURL(this.handle, e));
439
+ return new L(v().extractArchiveAndGetURL(this.handle, e));
440
440
  }
441
441
  getImportProgress() {
442
- return new F(v().getImportProgress(this.handle));
442
+ return new L(v().getImportProgress(this.handle));
443
443
  }
444
444
  getLastLogs(e) {
445
- return new F(v().getLastLogs(this.handle, e));
445
+ return new L(v().getLastLogs(this.handle, e));
446
446
  }
447
447
  getProgressLog(e) {
448
- return new F(v().getProgressLog(this.handle, e));
448
+ return new L(v().getProgressLog(this.handle, e));
449
449
  }
450
450
  getProgressLogWithInfo(e) {
451
- return new F(v().getProgressLogWithInfo(this.handle, e));
451
+ return new L(v().getProgressLogWithInfo(this.handle, e));
452
452
  }
453
453
  getLogHandle() {
454
- return new F(v().getLogHandle(this.handle));
454
+ return new L(v().getLogHandle(this.handle));
455
455
  }
456
456
  allFieldsResolved(e = "Input") {
457
457
  switch (e) {
@@ -466,109 +466,109 @@ class R {
466
466
  }
467
467
  }
468
468
  mapFields(e, n) {
469
- const { fieldType: r, requireLocked: i, skipUnresolved: s } = {
469
+ const { fieldType: r, requireLocked: i, skipUnresolved: o } = {
470
470
  fieldType: "Input",
471
471
  requireLocked: !0,
472
472
  skipUnresolved: !1,
473
473
  ...n
474
- }, o = e;
474
+ }, s = e;
475
475
  if (i && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
476
476
  return;
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, h]) => o(u, h));
480
+ return o && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, h]) => s(u, h));
481
481
  }
482
482
  }
483
- const Je = "staging", $e = "main", St = {
483
+ const $e = "staging", We = "main", xt = {
484
484
  explicitColumnsSupport: !0,
485
485
  inlineColumnsSupport: !0,
486
486
  activeArgs: !0,
487
487
  pTablePartitionFiltersSupport: !0,
488
488
  pFrameInSetFilterSupport: !0
489
489
  };
490
- function Be(t) {
490
+ function Ge(t) {
491
491
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
492
492
  }
493
- function me(t, e, n) {
493
+ function be(t, e, n) {
494
494
  if (e.has(n)) return;
495
495
  if (e.add(n), typeof n === "object")
496
- if (Be(n)) n.__awaited_futures__.forEach((i) => t.add(i));
496
+ if (Ge(n)) n.__awaited_futures__.forEach((i) => t.add(i));
497
497
  else if (Array.isArray(n))
498
- for (const i of n) me(t, e, i);
498
+ for (const i of n) be(t, e, i);
499
499
  else
500
500
  for (const [, i] of Object.entries(n))
501
- i !== n && me(t, e, i);
501
+ i !== n && be(t, e, i);
502
502
  }
503
- function wt(t) {
503
+ function Ft(t) {
504
504
  const e = /* @__PURE__ */ new Set();
505
- return me(e, /* @__PURE__ */ new Set(), t), e;
505
+ return be(e, /* @__PURE__ */ new Set(), t), e;
506
506
  }
507
- const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
507
+ const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
508
508
  __proto__: null,
509
- GlobalCfgRenderCtxFeatureFlags: St,
510
- MainAccessorName: $e,
511
- StagingAccessorName: Je,
512
- getAllFutureAwaits: wt,
513
- isFutureAwait: Be
514
- }, Symbol.toStringTag, { value: "Module" })), At = "pl7.app/label", Pt = "pl7.app/trace", xt = $.object({
515
- type: $.string(),
516
- importance: $.number().optional(),
517
- id: $.string().optional(),
518
- label: $.string()
519
- }), _t = $.array(xt), It = 1e-3, Tt = "__LABEL__", Ie = "__LABEL__@1";
520
- function Ue(t, e, n = {}) {
521
- 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((d) => {
509
+ GlobalCfgRenderCtxFeatureFlags: xt,
510
+ MainAccessorName: We,
511
+ StagingAccessorName: $e,
512
+ getAllFutureAwaits: Ft,
513
+ isFutureAwait: Ge
514
+ }, Symbol.toStringTag, { value: "Module" })), It = "pl7.app/label", _t = "pl7.app/trace", Lt = B.object({
515
+ type: B.string(),
516
+ importance: B.number().optional(),
517
+ id: B.string().optional(),
518
+ label: B.string()
519
+ }), Et = B.array(Lt), kt = 1e-3, Vt = "__LABEL__", Le = "__LABEL__@1";
520
+ function He(t, e, n = {}) {
521
+ const r = /* @__PURE__ */ new Map(), i = n.forceTraceElements !== void 0 && n.forceTraceElements.length > 0 ? new Set(n.forceTraceElements) : void 0, o = /* @__PURE__ */ new Map(), s = t.map((d) => {
522
522
  var c, b;
523
- const y = e(d);
524
- let p, m, C;
525
- "spec" in y && typeof y.spec == "object" ? (p = y.spec, m = y.prefixTrace, C = y.suffixTrace) : p = y;
526
- const E = (c = p.annotations) == null ? void 0 : c[At], _ = (b = p.annotations) == null ? void 0 : b[Pt], w = (_ ? _t.safeParse(JSON.parse(_)).data : void 0) ?? [], A = [
527
- ...m ?? [],
528
- ...w,
523
+ const g = e(d);
524
+ let p, y, C;
525
+ "spec" in g && typeof g.spec == "object" ? (p = g.spec, y = g.prefixTrace, C = g.suffixTrace) : p = g;
526
+ const E = (c = p.annotations) == null ? void 0 : c[It], x = (b = p.annotations) == null ? void 0 : b[_t], S = (x ? Et.safeParse(JSON.parse(x)).data : void 0) ?? [], P = [
527
+ ...y ?? [],
528
+ ...S,
529
529
  ...C ?? []
530
530
  ];
531
531
  if (E !== void 0) {
532
- const T = { label: E, type: Tt, importance: -2 };
533
- n.addLabelAsSuffix ? A.push(T) : A.splice(0, 0, T);
532
+ const I = { label: E, type: Vt, importance: -2 };
533
+ n.addLabelAsSuffix ? P.push(I) : P.splice(0, 0, I);
534
534
  }
535
- const S = [], I = /* @__PURE__ */ new Map();
536
- for (let T = A.length - 1; T >= 0; --T) {
537
- const { type: U } = A[T], V = A[T].importance ?? 0, j = (I.get(U) ?? 0) + 1;
538
- I.set(U, j);
539
- const K = `${U}@${j}`;
540
- s.set(K, (s.get(K) ?? 0) + 1), r.set(
541
- K,
535
+ const T = [], F = /* @__PURE__ */ new Map();
536
+ for (let I = P.length - 1; I >= 0; --I) {
537
+ const { type: $ } = P[I], K = P[I].importance ?? 0, j = (F.get($) ?? 0) + 1;
538
+ F.set($, j);
539
+ const N = `${$}@${j}`;
540
+ o.set(N, (o.get(N) ?? 0) + 1), r.set(
541
+ N,
542
542
  Math.max(
543
- r.get(K) ?? Number.NEGATIVE_INFINITY,
544
- V - (A.length - T) * It
543
+ r.get(N) ?? Number.NEGATIVE_INFINITY,
544
+ K - (P.length - I) * kt
545
545
  )
546
- ), S.push({ ...A[T], fullType: K, occurrenceIndex: j });
546
+ ), T.push({ ...P[I], fullType: N, occurrenceIndex: j });
547
547
  }
548
- return S.reverse(), {
548
+ return T.reverse(), {
549
549
  value: d,
550
550
  spec: p,
551
551
  label: E,
552
- fullTrace: S
552
+ fullTrace: T
553
553
  };
554
554
  }), a = [], l = [], u = [...r];
555
- u.sort(([, d], [, y]) => y - d);
555
+ u.sort(([, d], [, g]) => g - d);
556
556
  for (const [d] of u)
557
- d.endsWith("@1") || s.get(d) === t.length ? a.push(d) : l.push(d);
558
- const h = (d, y = !1) => {
557
+ d.endsWith("@1") || o.get(d) === t.length ? a.push(d) : l.push(d);
558
+ const h = (d, g = !1) => {
559
559
  const p = [];
560
- for (let m = 0; m < o.length; m++) {
561
- const C = o[m], E = C.fullTrace.filter((A) => d.has(A.fullType) || i && i.has(A.type));
560
+ for (let y = 0; y < s.length; y++) {
561
+ const C = s[y], E = C.fullTrace.filter((P) => d.has(P.fullType) || i && i.has(P.type));
562
562
  if (E.length === 0)
563
- if (y)
563
+ if (g)
564
564
  p.push({
565
565
  label: "Unlabeled",
566
566
  value: C.value
567
567
  });
568
568
  else return;
569
- const _ = E.map((A) => A.label), w = n.separator ?? " / ";
569
+ const x = E.map((P) => P.label), S = n.separator ?? " / ";
570
570
  p.push({
571
- label: _.join(w),
571
+ label: x.join(S),
572
572
  value: C.value
573
573
  });
574
574
  }
@@ -576,104 +576,104 @@ function Ue(t, e, n = {}) {
576
576
  };
577
577
  if (a.length === 0) {
578
578
  if (l.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
579
- return h(new Set(Ie), !0);
579
+ return h(new Set(Le), !0);
580
580
  }
581
- let f = 0, g = -1;
581
+ let f = 0, m = -1;
582
582
  for (; f < a.length; ) {
583
583
  const d = /* @__PURE__ */ new Set();
584
- n.includeNativeLabel && d.add(Ie);
584
+ n.includeNativeLabel && d.add(Le);
585
585
  for (let p = 0; p < f; ++p) d.add(a[p]);
586
- g >= 0 && d.add(a[g]);
587
- const y = h(d);
588
- if (y !== void 0 && new Set(y.map((p) => p.label)).size === t.length) return y;
589
- g++, g >= a.length && (f++, g = f);
586
+ m >= 0 && d.add(a[m]);
587
+ const g = h(d);
588
+ if (g !== void 0 && new Set(g.map((p) => p.label)).size === t.length) return g;
589
+ m++, m >= a.length && (f++, m = f);
590
590
  }
591
591
  return h(/* @__PURE__ */ new Set([...a, ...l]), !0);
592
592
  }
593
- const Z = "PColumnData/", oe = Z + "ResourceMap", ae = Z + "Partitioned/ResourceMap", H = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", We = Z + "Partitioned/", le = We + "JsonPartitioned", q = We + "BinaryPartitioned";
594
- function Ge(t, e, n, r = [], i) {
593
+ const ee = "PColumnData/", le = ee + "ResourceMap", ue = ee + "Partitioned/ResourceMap", H = ee + "JsonPartitioned", J = ee + "BinaryPartitioned", ze = ee + "Partitioned/", ce = ze + "JsonPartitioned", z = ze + "BinaryPartitioned";
594
+ function Xe(t, e, n, r = [], i) {
595
595
  if (t === void 0) return !1;
596
596
  switch (t.resourceType.name) {
597
- case oe: {
598
- let s = t.getInputsLocked();
599
- for (const o of t.listInputFields()) {
600
- const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], u = a === void 0 ? void 0 : e(a);
601
- u === void 0 && (s = !1), (u !== void 0 || i) && n.push({ key: l, value: u });
597
+ case le: {
598
+ let o = t.getInputsLocked();
599
+ for (const s of t.listInputFields()) {
600
+ const a = t.resolve({ field: s, assertFieldType: "Input" }), l = [...r, ...JSON.parse(s)], u = a === void 0 ? void 0 : e(a);
601
+ u === void 0 && (o = !1), (u !== void 0 || i) && n.push({ key: l, value: u });
602
602
  }
603
- return s;
603
+ return o;
604
604
  }
605
- case ae: {
606
- let s = t.getInputsLocked();
607
- for (const o of t.listInputFields()) {
608
- const a = t.resolve({ field: o, assertFieldType: "Input" });
609
- if (a === void 0) s = !1;
605
+ case ue: {
606
+ let o = t.getInputsLocked();
607
+ for (const s of t.listInputFields()) {
608
+ const a = t.resolve({ field: s, assertFieldType: "Input" });
609
+ if (a === void 0) o = !1;
610
610
  else {
611
- const l = [...r, ...JSON.parse(o)], u = Ge(
611
+ const l = [...r, ...JSON.parse(s)], u = Xe(
612
612
  a,
613
613
  e,
614
614
  n,
615
615
  l,
616
616
  i
617
617
  );
618
- s = s && u;
618
+ o = o && u;
619
619
  }
620
620
  }
621
- return s;
621
+ return o;
622
622
  }
623
623
  default:
624
624
  throw new Error(`Unknown resource type: ${t.resourceType.name}`);
625
625
  }
626
626
  }
627
- function Mn(t, e, n = !1) {
627
+ function $n(t, e, n = !1) {
628
628
  const r = [];
629
- return { isComplete: Ge(t, e, r, [], n), data: r };
629
+ return { isComplete: Xe(t, e, r, [], n), data: r };
630
630
  }
631
- const ye = (t) => {
631
+ const ve = (t) => {
632
632
  if (t.endsWith(".index"))
633
633
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
634
634
  if (t.endsWith(".values"))
635
635
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
636
636
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
637
637
  };
638
- function Lt(t) {
638
+ function Ot(t) {
639
639
  if (!t) return;
640
640
  const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
641
641
  let i = 0;
642
642
  switch (e) {
643
- case oe:
643
+ case le:
644
644
  i = n.keyLength;
645
645
  break;
646
- case ae:
646
+ case ue:
647
647
  i = n.partitionKeyLength + n.keyLength;
648
648
  break;
649
649
  case H:
650
- case B:
650
+ case J:
651
651
  i = n.partitionKeyLength;
652
652
  break;
653
- case q:
654
- case le:
653
+ case z:
654
+ case ce:
655
655
  i = n.superPartitionKeyLength + n.partitionKeyLength;
656
656
  break;
657
657
  }
658
658
  switch (e) {
659
- case oe:
659
+ case le:
660
660
  case H:
661
- case B:
662
- for (let s of t.listInputFields()) {
663
- e === B && (s = ye(s).baseKey);
664
- const o = [...JSON.parse(s)];
665
- r.push(o);
661
+ case J:
662
+ for (let o of t.listInputFields()) {
663
+ e === J && (o = ve(o).baseKey);
664
+ const s = [...JSON.parse(o)];
665
+ r.push(s);
666
666
  }
667
667
  break;
668
- case ae:
669
- case q:
670
- case le:
671
- for (const s of t.listInputFields()) {
672
- const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
668
+ case ue:
669
+ case z:
670
+ case ce:
671
+ for (const o of t.listInputFields()) {
672
+ const s = [...JSON.parse(o)], a = t.resolve({ field: o, assertFieldType: "Input" });
673
673
  if (a !== void 0)
674
674
  for (let l of a.listInputFields()) {
675
- e === q && (l = ye(l).baseKey);
676
- const u = [...o, ...JSON.parse(l)];
675
+ e === z && (l = ve(l).baseKey);
676
+ const u = [...s, ...JSON.parse(l)];
677
677
  r.push(u);
678
678
  }
679
679
  }
@@ -681,60 +681,60 @@ function Lt(t) {
681
681
  }
682
682
  return { data: r, keyLength: i };
683
683
  }
684
- function Ft(t) {
684
+ function Dt(t) {
685
685
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
686
686
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
687
687
  const { parts: e, partitionKeyLength: n } = t, r = [];
688
688
  for (let i = 0; i < n; ++i)
689
689
  r.push(/* @__PURE__ */ new Set());
690
690
  for (const i of e) {
691
- const s = i.key;
692
- if (s.length !== n)
691
+ const o = i.key;
692
+ if (o.length !== n)
693
693
  throw new Error(
694
- `Key length (${s.length}) does not match partition length (${n}) for key: ${JSON.stringify(
695
- s
694
+ `Key length (${o.length}) does not match partition length (${n}) for key: ${JSON.stringify(
695
+ o
696
696
  )}`
697
697
  );
698
- for (let o = 0; o < n; ++o)
699
- r[o].add(s[o]);
698
+ for (let s = 0; s < n; ++s)
699
+ r[s].add(o[s]);
700
700
  }
701
701
  return r.map((i) => Array.from(i.values()));
702
702
  }
703
- function Et(t) {
703
+ function Rt(t) {
704
704
  if (t === void 0) return;
705
- if (Ne(t))
706
- return Ft(t);
707
- const e = Lt(t);
705
+ if (je(t))
706
+ return Dt(t);
707
+ const e = Ot(t);
708
708
  if (!e) return;
709
709
  const { data: n, keyLength: r } = e, i = [];
710
- for (let s = 0; s < r; ++s)
710
+ for (let o = 0; o < r; ++o)
711
711
  i.push(/* @__PURE__ */ new Set());
712
- for (const s of n) {
713
- if (s.length !== r)
712
+ for (const o of n) {
713
+ if (o.length !== r)
714
714
  throw new Error("key length does not match partition length");
715
- for (let o = 0; o < r; ++o)
716
- i[o].add(s[o]);
715
+ for (let s = 0; s < r; ++s)
716
+ i[s].add(o[s]);
717
717
  }
718
- return i.map((s) => Array.from(s.values()));
718
+ return i.map((o) => Array.from(o.values()));
719
719
  }
720
- function be(t, e = []) {
720
+ function Ce(t, e = []) {
721
721
  if (t === void 0 || !t.getIsReadyOrError()) return;
722
722
  const n = t.resourceType.name, r = t.getDataAsJson();
723
- if (e.length > 0 && (n === le || n === q))
723
+ if (e.length > 0 && (n === ce || n === z))
724
724
  throw new Error(`Unexpected nested super-partitioned resource: ${n}`);
725
725
  switch (n) {
726
- case oe:
727
- case ae:
726
+ case le:
727
+ case ue:
728
728
  throw new Error(`Only data columns are supported, got: ${n}`);
729
729
  case H: {
730
730
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
731
731
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
732
732
  const i = [];
733
- for (const s of t.listInputFields()) {
734
- const o = t.resolve({ field: s, assertFieldType: "Input" });
735
- if (o === void 0) return;
736
- const a = [...e, ...JSON.parse(s)];
737
- i.push({ key: a, value: o });
733
+ for (const o of t.listInputFields()) {
734
+ const s = t.resolve({ field: o, assertFieldType: "Input" });
735
+ if (s === void 0) return;
736
+ const a = [...e, ...JSON.parse(o)];
737
+ i.push({ key: a, value: s });
738
738
  }
739
739
  return {
740
740
  type: "JsonPartitioned",
@@ -742,19 +742,19 @@ function be(t, e = []) {
742
742
  parts: i
743
743
  };
744
744
  }
745
- case B: {
745
+ case J: {
746
746
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
747
747
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
748
- const i = [], s = /* @__PURE__ */ new Map();
749
- for (const o of t.listInputFields()) {
750
- const a = ye(o), l = t.resolve({ field: o, assertFieldType: "Input" });
748
+ const i = [], o = /* @__PURE__ */ new Map();
749
+ for (const s of t.listInputFields()) {
750
+ const a = ve(s), l = t.resolve({ field: s, assertFieldType: "Input" });
751
751
  if (l === void 0) return;
752
- let u = s.get(a.baseKey);
753
- u || (u = {}, s.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
752
+ let u = o.get(a.baseKey);
753
+ u || (u = {}, o.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
754
754
  }
755
- for (const [o, a] of s.entries()) {
755
+ for (const [s, a] of o.entries()) {
756
756
  if (!a.index || !a.values) return;
757
- const l = [...e, ...JSON.parse(o)];
757
+ const l = [...e, ...JSON.parse(s)];
758
758
  i.push({
759
759
  key: l,
760
760
  value: {
@@ -769,127 +769,127 @@ function be(t, e = []) {
769
769
  parts: i
770
770
  };
771
771
  }
772
- case le: {
772
+ case ce: {
773
773
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
774
774
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
775
- const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
776
- for (const o of t.listInputFields()) {
777
- const a = t.resolve({ field: o, assertFieldType: "Input" });
775
+ const i = r.superPartitionKeyLength + r.partitionKeyLength, o = [];
776
+ for (const s of t.listInputFields()) {
777
+ const a = t.resolve({ field: s, assertFieldType: "Input" });
778
778
  if (a === void 0) return;
779
779
  if (a.resourceType.name !== H)
780
780
  throw new Error(`Expected ${H} inside ${n}, but got ${a.resourceType.name}`);
781
- const l = be(a, JSON.parse(o));
781
+ const l = Ce(a, JSON.parse(s));
782
782
  if (l === void 0) return;
783
783
  if (l.type !== "JsonPartitioned")
784
784
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
785
- s.push(...l.parts);
785
+ o.push(...l.parts);
786
786
  }
787
787
  return {
788
788
  type: "JsonPartitioned",
789
789
  partitionKeyLength: i,
790
- parts: s
790
+ parts: o
791
791
  };
792
792
  }
793
- case q: {
793
+ case z: {
794
794
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
795
795
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
796
- const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
797
- for (const o of t.listInputFields()) {
798
- const a = t.resolve({ field: o, assertFieldType: "Input" });
796
+ const i = r.superPartitionKeyLength + r.partitionKeyLength, o = [];
797
+ for (const s of t.listInputFields()) {
798
+ const a = t.resolve({ field: s, assertFieldType: "Input" });
799
799
  if (a === void 0) return;
800
- if (a.resourceType.name !== B)
801
- throw new Error(`Expected ${B} inside ${n}, but got ${a.resourceType.name}`);
802
- const l = be(a, JSON.parse(o));
800
+ if (a.resourceType.name !== J)
801
+ throw new Error(`Expected ${J} inside ${n}, but got ${a.resourceType.name}`);
802
+ const l = Ce(a, JSON.parse(s));
803
803
  if (l === void 0) return;
804
804
  if (l.type !== "BinaryPartitioned")
805
805
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
806
- s.push(...l.parts);
806
+ o.push(...l.parts);
807
807
  }
808
808
  return {
809
809
  type: "BinaryPartitioned",
810
810
  partitionKeyLength: i,
811
- parts: s
811
+ parts: o
812
812
  };
813
813
  }
814
814
  default:
815
815
  throw new Error(`Unknown resource type: ${n}`);
816
816
  }
817
817
  }
818
- function kt(t) {
818
+ function Nt(t) {
819
819
  if (t !== void 0) {
820
- if (Ne(t)) return t;
821
- if (ue(t)) return et(t);
822
- if (t instanceof R) return be(t);
820
+ if (je(t)) return t;
821
+ if (pe(t)) return ot(t);
822
+ if (t instanceof O) return Ce(t);
823
823
  throw new Error(`Unexpected input type: ${typeof t}`);
824
824
  }
825
825
  }
826
- function Dt(t, e) {
827
- const n = [...e].sort((s, o) => o[0] - s[0]);
826
+ function Ut(t, e) {
827
+ const n = [...e].sort((o, s) => s[0] - o[0]);
828
828
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
829
- const { partitionKeyLength: s } = t;
830
- for (const [o] of e)
831
- if (o >= s)
832
- throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${s}`);
829
+ const { partitionKeyLength: o } = t;
830
+ for (const [s] of e)
831
+ if (s >= o)
832
+ throw new Error(`Can't filter on non-partitioned axis ${s}. Must be >= ${o}`);
833
833
  } else if (t.type === "Json") {
834
- const { keyLength: s } = t;
835
- for (const [o] of e)
836
- if (o >= s)
837
- throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${s}`);
838
- }
839
- const r = (s) => {
840
- for (const [o, a] of n)
841
- if (s[o] !== a)
834
+ const { keyLength: o } = t;
835
+ for (const [s] of e)
836
+ if (s >= o)
837
+ throw new Error(`Can't filter on non-data axis ${s}. Must be >= ${o}`);
838
+ }
839
+ const r = (o) => {
840
+ for (const [s, a] of n)
841
+ if (o[s] !== a)
842
842
  return !1;
843
843
  return !0;
844
- }, i = (s) => {
845
- const o = [...s];
844
+ }, i = (o) => {
845
+ const s = [...o];
846
846
  for (const [a] of n)
847
- o.splice(a, 1);
848
- return o;
847
+ s.splice(a, 1);
848
+ return s;
849
849
  };
850
850
  switch (t.type) {
851
851
  case "Json": {
852
- const s = t.data.filter((o) => r(o.key)).map((o) => ({
853
- key: i(o.key),
854
- value: o.value
852
+ const o = t.data.filter((s) => r(s.key)).map((s) => ({
853
+ key: i(s.key),
854
+ value: s.value
855
855
  }));
856
856
  return {
857
857
  type: "Json",
858
858
  keyLength: t.keyLength - e.length,
859
- data: s
859
+ data: o
860
860
  };
861
861
  }
862
862
  case "JsonPartitioned": {
863
- const s = t.parts.filter((o) => r(o.key)).map((o) => ({
864
- key: i(o.key),
865
- value: o.value
863
+ const o = t.parts.filter((s) => r(s.key)).map((s) => ({
864
+ key: i(s.key),
865
+ value: s.value
866
866
  }));
867
867
  return {
868
868
  type: "JsonPartitioned",
869
869
  partitionKeyLength: t.partitionKeyLength - e.length,
870
- parts: s
870
+ parts: o
871
871
  };
872
872
  }
873
873
  case "BinaryPartitioned": {
874
- const s = t.parts.filter((o) => r(o.key)).map((o) => ({
875
- key: i(o.key),
876
- value: o.value
874
+ const o = t.parts.filter((s) => r(s.key)).map((s) => ({
875
+ key: i(s.key),
876
+ value: s.value
877
877
  }));
878
878
  return {
879
879
  type: "BinaryPartitioned",
880
880
  partitionKeyLength: t.partitionKeyLength - e.length,
881
- parts: s
881
+ parts: o
882
882
  };
883
883
  }
884
884
  }
885
885
  }
886
- function Rt(t) {
886
+ function Kt(t) {
887
887
  if (!Array.isArray(t)) return !1;
888
888
  if (t.length === 0) return !0;
889
889
  const e = t[0];
890
890
  return typeof e == "object" && e !== null && "key" in e && "val" in e;
891
891
  }
892
- class Ot {
892
+ class Mt {
893
893
  constructor(e) {
894
894
  this.columns = e;
895
895
  }
@@ -898,30 +898,30 @@ class Ot {
898
898
  return this.columns.filter((r) => n(r.spec));
899
899
  }
900
900
  }
901
- function Kt(t) {
901
+ function jt(t) {
902
902
  if (t)
903
903
  return t.map((e) => ({
904
- type: `split:${it(e.axisId)}`,
904
+ type: `split:${ut(e.axisId)}`,
905
905
  label: e.label,
906
906
  importance: 1e6
907
907
  // High importance for split filters in labels
908
908
  }));
909
909
  }
910
- function Nt(t) {
910
+ function qt(t) {
911
911
  if (t)
912
912
  return t.map((e) => [e.axisIdx, e.value]);
913
913
  }
914
- function Vt(t, e) {
914
+ function Bt(t, e) {
915
915
  if (!e || e.length === 0) return t;
916
916
  const n = [...e].sort((r, i) => r[0] - i[0]);
917
- return Ve({ id: t, axisFilters: n });
917
+ return qe({ id: t, axisFilters: n });
918
918
  }
919
- function Te(t) {
919
+ function Ee(t) {
920
920
  if (!t || typeof t != "object") return !1;
921
921
  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);
922
922
  return !!e.domainAnchor || n || r;
923
923
  }
924
- function Mt(t) {
924
+ function Jt(t) {
925
925
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
926
926
  return [];
927
927
  const e = t.axes.map((n, r) => typeof n == "object" && "split" in n && n.split === !0 ? r : -1).filter((n) => n !== -1);
@@ -929,10 +929,10 @@ function Mt(t) {
929
929
  throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
930
930
  return e.sort((n, r) => n - r), e;
931
931
  }
932
- class X {
932
+ class Q {
933
933
  constructor() {
934
934
  k(this, "defaultProviderStore", []);
935
- k(this, "providers", [new Ot(this.defaultProviderStore)]);
935
+ k(this, "providers", [new Mt(this.defaultProviderStore)]);
936
936
  k(this, "axisLabelProviders", []);
937
937
  }
938
938
  addColumnProvider(e) {
@@ -955,94 +955,94 @@ class X {
955
955
  }
956
956
  }
957
957
  getUniversalEntries(e, n) {
958
- const { anchorCtx: r, labelOps: i, dontWaitAllData: s = !1, overrideLabelAnnotation: o = !1, exclude: a } = n ?? {}, l = {
959
- ...o && (i == null ? void 0 : i.includeNativeLabel) !== !1 ? { includeNativeLabel: !0 } : {},
958
+ const { anchorCtx: r, labelOps: i, dontWaitAllData: o = !1, overrideLabelAnnotation: s = !1, exclude: a } = n ?? {}, l = {
959
+ ...s && (i == null ? void 0 : i.includeNativeLabel) !== !1 ? { includeNativeLabel: !0 } : {},
960
960
  ...i ?? {}
961
961
  };
962
962
  let u = () => !1;
963
963
  if (a) {
964
- const p = (Array.isArray(a) ? a : [a]).map((m) => {
965
- if (Te(m)) {
964
+ const p = (Array.isArray(a) ? a : [a]).map((y) => {
965
+ if (Ee(y)) {
966
966
  if (!r)
967
967
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
968
- return Y(we(r.anchors, m, n));
968
+ return Y(we(r.anchors, y, n));
969
969
  } else
970
- return Y(m);
970
+ return Y(y);
971
971
  });
972
- u = (m) => p.some((C) => C(m));
972
+ u = (y) => p.some((C) => C(y));
973
973
  }
974
- const h = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], f = [], g = /* @__PURE__ */ new Set();
974
+ const h = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], f = [], m = /* @__PURE__ */ new Set();
975
975
  for (const p of h) {
976
- const m = Te(p);
976
+ const y = Ee(p);
977
977
  let C;
978
- if (m) {
978
+ if (y) {
979
979
  if (!r)
980
980
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
981
981
  C = we(r.anchors, p, n);
982
982
  } else
983
983
  C = p;
984
- const E = /* @__PURE__ */ new Set(), _ = [];
985
- for (const S of this.providers) {
986
- const I = S.selectColumns(C);
987
- for (const c of I) {
984
+ const E = /* @__PURE__ */ new Set(), x = [];
985
+ for (const T of this.providers) {
986
+ const F = T.selectColumns(C);
987
+ for (const c of F) {
988
988
  if (u(c.spec)) continue;
989
989
  if (E.has(c.id))
990
- throw new Error(`Duplicate column id ${c.id} in provider ${S.constructor.name}`);
991
- const b = tt(c.spec);
992
- g.has(b) || (E.add(c.id), g.add(b), _.push(c));
990
+ throw new Error(`Duplicate column id ${c.id} in provider ${T.constructor.name}`);
991
+ const b = st(c.spec);
992
+ m.has(b) || (E.add(c.id), m.add(b), x.push(c));
993
993
  }
994
994
  }
995
- if (_.length === 0) continue;
996
- const w = Mt(p), A = w.length > 0;
997
- for (const S of _) {
998
- if (!re(S.spec)) continue;
999
- const I = S.spec;
1000
- if (A) {
1001
- if (Rt(S.data))
1002
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${S.id}`);
1003
- const c = kt(S.data);
995
+ if (x.length === 0) continue;
996
+ const S = Jt(p), P = S.length > 0;
997
+ for (const T of x) {
998
+ if (!oe(T.spec)) continue;
999
+ const F = T.spec;
1000
+ if (P) {
1001
+ if (Kt(T.data))
1002
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${T.id}`);
1003
+ const c = Nt(T.data);
1004
1004
  if (!c) {
1005
- if (s) continue;
1005
+ if (o) continue;
1006
1006
  return;
1007
1007
  }
1008
- if (!nt(c))
1009
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${S.id}`);
1010
- const b = Et(c), T = w[w.length - 1];
1011
- if (T >= c.partitionKeyLength)
1012
- throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${T}) in column ${I.name}`);
1013
- const U = w.map((L) => this.findLabels(D(I.axesSpec[L]))), V = [], j = (L, W) => {
1014
- if (W >= w.length) {
1015
- if (V.push([...L]), V.length > 1e4)
1008
+ if (!at(c))
1009
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${T.id}`);
1010
+ const b = Rt(c), I = S[S.length - 1];
1011
+ if (I >= c.partitionKeyLength)
1012
+ throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${I}) in column ${F.name}`);
1013
+ const $ = S.map((_) => this.findLabels(V(F.axesSpec[_]))), K = [], j = (_, W) => {
1014
+ if (W >= S.length) {
1015
+ if (K.push([..._]), K.length > 1e4)
1016
1016
  throw new Error("Too many key combinations, aborting.");
1017
1017
  return;
1018
1018
  }
1019
- const M = w[W];
1019
+ const M = S[W];
1020
1020
  if (M >= b.length)
1021
- throw new Error(`Axis index ${M} out of bounds for unique keys array (length ${b.length}) during split key generation for column ${S.id}`);
1022
- const J = b[M];
1023
- if (!J || J.length === 0) {
1024
- V.length = 0;
1021
+ throw new Error(`Axis index ${M} out of bounds for unique keys array (length ${b.length}) during split key generation for column ${T.id}`);
1022
+ const q = b[M];
1023
+ if (!q || q.length === 0) {
1024
+ K.length = 0;
1025
1025
  return;
1026
1026
  }
1027
- for (const ee of J)
1028
- L.push(ee), j(L, W + 1), L.pop();
1027
+ for (const te of q)
1028
+ _.push(te), j(_, W + 1), _.pop();
1029
1029
  };
1030
- if (j([], 0), V.length === 0)
1030
+ if (j([], 0), K.length === 0)
1031
1031
  continue;
1032
- const K = [...I.axesSpec], qe = w.map((L) => L);
1033
- for (let L = w.length - 1; L >= 0; L--)
1034
- K.splice(w[L], 1);
1035
- const ze = { ...I, axesSpec: K };
1036
- for (const L of V) {
1037
- const W = L.map((M, J) => {
1038
- const ee = qe[J], Ye = D(I.axesSpec[ee]), ce = U[J], Xe = (ce == null ? void 0 : ce[M]) ?? String(M);
1039
- return { axisIdx: ee, axisId: Ye, value: M, label: Xe };
1032
+ const N = [...F.axesSpec], Ze = S.map((_) => _);
1033
+ for (let _ = S.length - 1; _ >= 0; _--)
1034
+ N.splice(S[_], 1);
1035
+ const et = { ...F, axesSpec: N };
1036
+ for (const _ of K) {
1037
+ const W = _.map((M, q) => {
1038
+ const te = Ze[q], tt = V(F.axesSpec[te]), de = $[q], nt = (de == null ? void 0 : de[M]) ?? String(M);
1039
+ return { axisIdx: te, axisId: tt, value: M, label: nt };
1040
1040
  });
1041
1041
  f.push({
1042
1042
  type: "split",
1043
- originalColumn: S,
1044
- spec: I,
1045
- adjustedSpec: ze,
1043
+ originalColumn: T,
1044
+ spec: F,
1045
+ adjustedSpec: et,
1046
1046
  dataEntries: c,
1047
1047
  axisFilters: W
1048
1048
  });
@@ -1050,40 +1050,40 @@ class X {
1050
1050
  } else
1051
1051
  f.push({
1052
1052
  type: "direct",
1053
- originalColumn: S,
1054
- spec: I,
1055
- adjustedSpec: I
1053
+ originalColumn: T,
1054
+ spec: F,
1055
+ adjustedSpec: F
1056
1056
  });
1057
1057
  }
1058
1058
  }
1059
1059
  if (f.length === 0) return [];
1060
- const d = Ue(
1060
+ const d = He(
1061
1061
  f,
1062
1062
  (p) => ({
1063
1063
  spec: p.spec,
1064
- suffixTrace: p.type === "split" ? Kt(p.axisFilters) : void 0
1064
+ suffixTrace: p.type === "split" ? jt(p.axisFilters) : void 0
1065
1065
  }),
1066
1066
  l
1067
- ), y = [];
1068
- for (const { value: p, label: m } of d) {
1069
- const { originalColumn: C, spec: E } = p, _ = p.type === "split" ? p.axisFilters : void 0, w = Nt(_);
1070
- let A;
1071
- r ? A = r.deriveS(E, w) : A = Vt(C.id, w);
1072
- let S = { ...p.adjustedSpec };
1073
- o && (S = {
1074
- ...S,
1067
+ ), g = [];
1068
+ for (const { value: p, label: y } of d) {
1069
+ const { originalColumn: C, spec: E } = p, x = p.type === "split" ? p.axisFilters : void 0, S = qt(x);
1070
+ let P;
1071
+ r ? P = r.deriveS(E, S) : P = Bt(C.id, S);
1072
+ let T = { ...p.adjustedSpec };
1073
+ s && (T = {
1074
+ ...T,
1075
1075
  annotations: {
1076
- ...S.annotations ?? {},
1077
- "pl7.app/label": m
1076
+ ...T.annotations ?? {},
1077
+ "pl7.app/label": y
1078
1078
  }
1079
- }), y.push({
1080
- id: A,
1081
- spec: S,
1082
- data: () => p.type === "split" ? rt(Dt(p.dataEntries, w)) : p.originalColumn.data,
1083
- label: m
1079
+ }), g.push({
1080
+ id: P,
1081
+ spec: T,
1082
+ data: () => p.type === "split" ? lt(Ut(p.dataEntries, S)) : p.originalColumn.data,
1083
+ label: y
1084
1084
  });
1085
1085
  }
1086
- return y;
1086
+ return g;
1087
1087
  }
1088
1088
  getColumns(e, n) {
1089
1089
  const r = this.getUniversalEntries(e, {
@@ -1093,65 +1093,65 @@ class X {
1093
1093
  });
1094
1094
  if (!r) return;
1095
1095
  const i = [];
1096
- for (const s of r) {
1097
- const o = s.data();
1098
- if (!o) {
1096
+ for (const o of r) {
1097
+ const s = o.data();
1098
+ if (!s) {
1099
1099
  if (n != null && n.dontWaitAllData) continue;
1100
1100
  return;
1101
1101
  }
1102
1102
  i.push({
1103
- id: s.id,
1104
- spec: s.spec,
1105
- data: o
1103
+ id: o.id,
1104
+ spec: o.spec,
1105
+ data: s
1106
1106
  });
1107
1107
  }
1108
1108
  return i;
1109
1109
  }
1110
1110
  }
1111
- function ve(t) {
1111
+ function Te(t) {
1112
1112
  const e = (i) => i.operator !== "InSet" ? i : {
1113
1113
  operator: "Or",
1114
- operands: i.references.map((s) => ({
1114
+ operands: i.references.map((o) => ({
1115
1115
  operator: "Equal",
1116
- reference: s
1116
+ reference: o
1117
1117
  }))
1118
- }, n = (i, s) => {
1118
+ }, n = (i, o) => {
1119
1119
  switch (i.operator) {
1120
1120
  case "And":
1121
1121
  return {
1122
1122
  ...i,
1123
- operands: i.operands.map((a) => n(a, s))
1123
+ operands: i.operands.map((a) => n(a, o))
1124
1124
  };
1125
1125
  case "Or":
1126
1126
  return {
1127
1127
  ...i,
1128
- operands: i.operands.map((a) => n(a, s))
1128
+ operands: i.operands.map((a) => n(a, o))
1129
1129
  };
1130
1130
  case "Not":
1131
1131
  return {
1132
1132
  ...i,
1133
- operand: n(i.operand, s)
1133
+ operand: n(i.operand, o)
1134
1134
  };
1135
1135
  default:
1136
- return s(i);
1136
+ return o(i);
1137
1137
  }
1138
- }, r = (i, s) => ({
1138
+ }, r = (i, o) => ({
1139
1139
  ...i,
1140
- predicate: n(i.predicate, s)
1140
+ predicate: n(i.predicate, o)
1141
1141
  });
1142
1142
  return t.map((i) => r(i, e));
1143
1143
  }
1144
- function de(t, e) {
1144
+ function he(t, e) {
1145
1145
  if (t === void 0) return e === void 0;
1146
1146
  if (e === void 0) return !0;
1147
1147
  for (const n in e)
1148
1148
  if (t[n] !== e[n]) return !1;
1149
1149
  return !0;
1150
1150
  }
1151
- function Le(t) {
1152
- return Se(t, (e) => e instanceof R ? e.handle : ue(e) ? ct(e, (n) => n.handle) : e);
1151
+ function ke(t) {
1152
+ return Pe(t, (e) => e instanceof O ? e.handle : pe(e) ? mt(e, (n) => n.handle) : e);
1153
1153
  }
1154
- class jt {
1154
+ class $t {
1155
1155
  constructor() {
1156
1156
  k(this, "ctx", v());
1157
1157
  }
@@ -1163,27 +1163,27 @@ class jt {
1163
1163
  }
1164
1164
  getOptions(e, n) {
1165
1165
  const r = typeof e == "function" ? e : Y(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
1166
- let s = {}, o = !1;
1167
- 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" ? Ue(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
1168
- ref: Ae(a, o),
1166
+ let o = {}, s = !1;
1167
+ return typeof n < "u" && (typeof n == "function" ? o = n : typeof n == "object" && ("includeNativeLabel" in n || "separator" in n || "addLabelAsSuffix" in n ? o = n : (n = n, o = n.label ?? {}, s = n.refsWithEnrichments ?? !1))), typeof o == "object" ? He(i, (a) => a.obj, o ?? {}).map(({ value: { ref: a }, label: l }) => ({
1168
+ ref: xe(a, s),
1169
1169
  label: l
1170
1170
  })) : i.map(({ ref: a, obj: l }) => ({
1171
- ref: Ae(a, o),
1172
- label: s(l, a)
1171
+ ref: xe(a, s),
1172
+ label: o(l, a)
1173
1173
  }));
1174
1174
  }
1175
1175
  resolveAnchorCtx(e) {
1176
- if (e instanceof Pe) return e;
1176
+ if (e instanceof Fe) return e;
1177
1177
  const n = {};
1178
1178
  for (const [r, i] of Object.entries(e))
1179
- if (st(i)) {
1180
- const s = this.getPColumnSpecByRef(i);
1181
- if (!s)
1179
+ if (ct(i)) {
1180
+ const o = this.getPColumnSpecByRef(i);
1181
+ if (!o)
1182
1182
  return;
1183
- n[r] = s;
1183
+ n[r] = o;
1184
1184
  } else
1185
1185
  n[r] = i;
1186
- return new Pe(n);
1186
+ return new Fe(n);
1187
1187
  }
1188
1188
  /**
1189
1189
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -1196,7 +1196,7 @@ class jt {
1196
1196
  getAnchoredPColumns(e, n, r) {
1197
1197
  const i = this.resolveAnchorCtx(e);
1198
1198
  if (i)
1199
- return new X().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1199
+ return new Q().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1200
1200
  ...r,
1201
1201
  anchorCtx: i
1202
1202
  });
@@ -1233,14 +1233,14 @@ class jt {
1233
1233
  getCanonicalOptions(e, n, r) {
1234
1234
  const i = this.resolveAnchorCtx(e);
1235
1235
  if (!i) return;
1236
- const s = new X().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1236
+ const o = new Q().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1237
1237
  ...r,
1238
1238
  anchorCtx: i
1239
1239
  });
1240
- if (s)
1241
- return s.map((o) => ({
1242
- value: o.id,
1243
- label: o.label
1240
+ if (o)
1241
+ return o.map((s) => ({
1242
+ value: s.id,
1243
+ label: s.label
1244
1244
  }));
1245
1245
  }
1246
1246
  /**
@@ -1257,7 +1257,7 @@ class jt {
1257
1257
  ref: n.ref,
1258
1258
  obj: {
1259
1259
  ...n.obj,
1260
- data: new R(n.obj.data, [n.ref.blockId, n.ref.name])
1260
+ data: new O(n.obj.data, [n.ref.blockId, n.ref.name])
1261
1261
  }
1262
1262
  }))
1263
1263
  };
@@ -1276,9 +1276,9 @@ class jt {
1276
1276
  ref: n.ref,
1277
1277
  obj: {
1278
1278
  ...n.obj,
1279
- data: ot(
1279
+ data: pt(
1280
1280
  n.obj.data,
1281
- (r) => new R(r, [n.ref.blockId, n.ref.name])
1281
+ (r) => new O(r, [n.ref.blockId, n.ref.name])
1282
1282
  )
1283
1283
  }
1284
1284
  }))
@@ -1305,9 +1305,9 @@ class jt {
1305
1305
  )) == null ? void 0 : r.obj;
1306
1306
  const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
1307
1307
  if (n)
1308
- return Se(
1308
+ return Pe(
1309
1309
  n,
1310
- (i) => new R(i, [e.blockId, e.name])
1310
+ (i) => new O(i, [e.blockId, e.name])
1311
1311
  );
1312
1312
  }
1313
1313
  /**
@@ -1318,7 +1318,7 @@ class jt {
1318
1318
  getPColumnByRef(e) {
1319
1319
  const n = this.getDataByRef(e);
1320
1320
  if (n)
1321
- return at(n);
1321
+ return dt(n);
1322
1322
  }
1323
1323
  /**
1324
1324
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -1328,7 +1328,7 @@ class jt {
1328
1328
  getPColumnSpecByRef(e) {
1329
1329
  const n = this.getSpecByRef(e);
1330
1330
  if (n) {
1331
- if (!re(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
1331
+ if (!oe(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
1332
1332
  return n;
1333
1333
  }
1334
1334
  }
@@ -1347,13 +1347,13 @@ class jt {
1347
1347
  findDataWithCompatibleSpec(e) {
1348
1348
  const n = [];
1349
1349
  e: for (const r of this.getData().entries) {
1350
- if (!re(r.obj.spec))
1350
+ if (!oe(r.obj.spec))
1351
1351
  continue;
1352
1352
  const i = r.obj.spec;
1353
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && de(e.domain, i.domain)) {
1354
- for (let s = 0; s < e.axesSpec.length; ++s) {
1355
- const o = e.axesSpec[s], a = i.axesSpec[s];
1356
- if (o.name !== a.name || o.type !== a.type || !de(o.domain, a.domain))
1353
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && he(e.domain, i.domain)) {
1354
+ for (let o = 0; o < e.axesSpec.length; ++o) {
1355
+ const s = e.axesSpec[o], a = i.axesSpec[o];
1356
+ if (s.name !== a.name || s.type !== a.type || !he(s.domain, a.domain))
1357
1357
  continue e;
1358
1358
  }
1359
1359
  n.push(r.obj);
@@ -1368,15 +1368,15 @@ class jt {
1368
1368
  findLabels(e) {
1369
1369
  const n = this.getData();
1370
1370
  for (const r of n.entries) {
1371
- if (!Ke(r.obj)) continue;
1371
+ if (!Me(r.obj)) continue;
1372
1372
  const i = r.obj.spec;
1373
- 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)) {
1373
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && he(e.domain, i.axesSpec[0].domain)) {
1374
1374
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
1375
1375
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
1376
1376
  return Object.fromEntries(
1377
1377
  Object.entries(
1378
1378
  r.obj.data.getDataAsJson().data
1379
- ).map((o) => [JSON.parse(o[0])[0], o[1]])
1379
+ ).map((s) => [JSON.parse(s[0])[0], s[1]])
1380
1380
  );
1381
1381
  }
1382
1382
  }
@@ -1390,13 +1390,13 @@ class jt {
1390
1390
  */
1391
1391
  selectColumns(e) {
1392
1392
  const n = typeof e == "function" ? e : Y(e);
1393
- return this.getSpecs().entries.filter(({ obj: i }) => re(i) ? n(i) : !1).map(({ ref: i, obj: s }) => {
1394
- const o = s;
1393
+ return this.getSpecs().entries.filter(({ obj: i }) => oe(i) ? n(i) : !1).map(({ ref: i, obj: o }) => {
1394
+ const s = o;
1395
1395
  let a = null;
1396
1396
  const l = this;
1397
1397
  return {
1398
- id: Ve(i),
1399
- spec: o,
1398
+ id: qe(i),
1399
+ spec: s,
1400
1400
  get data() {
1401
1401
  var u;
1402
1402
  return a !== null || (a = (u = l.getPColumnByRef(i)) == null ? void 0 : u.data), a;
@@ -1409,25 +1409,25 @@ class jt {
1409
1409
  * @returns a map of axis value => label
1410
1410
  */
1411
1411
  findLabelsForColumnAxis(e, n) {
1412
- var s;
1412
+ var o;
1413
1413
  const r = this.findLabels(e.axesSpec[n]);
1414
1414
  if (!r) return;
1415
- const i = (s = e.annotations) == null ? void 0 : s["pl7.app/axisKeys/" + n];
1415
+ const i = (o = e.annotations) == null ? void 0 : o["pl7.app/axisKeys/" + n];
1416
1416
  if (i !== void 0) {
1417
- const o = JSON.parse(i);
1418
- return Object.fromEntries(o.map((a) => [a, r[a] ?? "Unlabelled"]));
1417
+ const s = JSON.parse(i);
1418
+ return Object.fromEntries(s.map((a) => [a, r[a] ?? "Unlabelled"]));
1419
1419
  } else
1420
1420
  return r;
1421
1421
  }
1422
1422
  }
1423
- class te {
1423
+ class ne {
1424
1424
  constructor() {
1425
1425
  k(this, "ctx");
1426
1426
  k(this, "_argsCache");
1427
1427
  k(this, "_uiStateCache");
1428
1428
  // lazy rendering because this feature is rarely used
1429
1429
  k(this, "_activeArgsCache");
1430
- k(this, "resultPool", new jt());
1430
+ k(this, "resultPool", new $t());
1431
1431
  this.ctx = v();
1432
1432
  }
1433
1433
  get args() {
@@ -1464,14 +1464,14 @@ class te {
1464
1464
  getNamedAccessor(e) {
1465
1465
  return ge(
1466
1466
  this.ctx.getAccessorHandleByName(e),
1467
- (n) => new R(n, [e])
1467
+ (n) => new O(n, [e])
1468
1468
  );
1469
1469
  }
1470
1470
  get prerun() {
1471
- return this.getNamedAccessor(Je);
1471
+ return this.getNamedAccessor($e);
1472
1472
  }
1473
1473
  get outputs() {
1474
- return this.getNamedAccessor($e);
1474
+ return this.getNamedAccessor(We);
1475
1475
  }
1476
1476
  /**
1477
1477
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -1483,7 +1483,7 @@ class te {
1483
1483
  }
1484
1484
  verifyInlineAndExplicitColumnsSupport(e) {
1485
1485
  var i;
1486
- const n = e.some((s) => !(s.data instanceof R) || ue(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1486
+ const n = e.some((o) => !(o.data instanceof O) || pe(o.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1487
1487
  if (n && !r) throw Error("Inline or explicit columns not supported");
1488
1488
  }
1489
1489
  patchPTableDef(e) {
@@ -1494,14 +1494,14 @@ class te {
1494
1494
  filters: [...e.partitionFilters, ...e.filters]
1495
1495
  }), (r = this.ctx.featureFlags) != null && r.pFrameInSetFilterSupport || (e = {
1496
1496
  ...e,
1497
- partitionFilters: ve(e.partitionFilters),
1498
- filters: ve(e.filters)
1497
+ partitionFilters: Te(e.partitionFilters),
1498
+ filters: Te(e.filters)
1499
1499
  }), e;
1500
1500
  }
1501
1501
  // TODO remove all non-PColumn fields
1502
1502
  createPFrame(e) {
1503
1503
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
1504
- e.map((n) => Le(n))
1504
+ e.map((n) => ke(n))
1505
1505
  );
1506
1506
  }
1507
1507
  createPTable(e) {
@@ -1514,8 +1514,8 @@ class te {
1514
1514
  partitionFilters: e.filters ?? [],
1515
1515
  filters: [],
1516
1516
  sorting: e.sorting ?? []
1517
- }) : n = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(lt(n.src)), this.ctx.createPTable(
1518
- ut(n, (r) => Le(r))
1517
+ }) : n = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(ft(n.src)), this.ctx.createPTable(
1518
+ ht(n, (r) => ke(r))
1519
1519
  );
1520
1520
  }
1521
1521
  /** @deprecated scheduled for removal from SDK */
@@ -1535,38 +1535,38 @@ class te {
1535
1535
  this.ctx.logError(e);
1536
1536
  }
1537
1537
  }
1538
- const z = "1.40.1";
1539
- function Jt(t) {
1538
+ const X = "1.40.5";
1539
+ function Wt(t) {
1540
1540
  return t.__renderLambda === !0;
1541
1541
  }
1542
- function fe(t) {
1542
+ function me(t) {
1543
1543
  if (t !== void 0)
1544
- return Jt(t) ? t.handle : t;
1544
+ return Wt(t) ? t.handle : t;
1545
1545
  }
1546
- function jn(t) {
1547
- return pt(t);
1546
+ function Wn(t) {
1547
+ return yt(t);
1548
1548
  }
1549
- const x = class x {
1550
- constructor(e, n, r, i, s, o, a, l, u) {
1551
- this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = a, this._enrichmentTargets = l, this._featureFlags = u;
1549
+ const w = class w {
1550
+ constructor(e, n, r, i, o, s, a, l, u) {
1551
+ this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = o, this._sections = s, this._title = a, this._enrichmentTargets = l, this._featureFlags = u;
1552
1552
  }
1553
1553
  static create(e = "Heavy") {
1554
- return new x(
1554
+ return new w(
1555
1555
  e,
1556
1556
  void 0,
1557
1557
  {},
1558
1558
  {},
1559
- ie(!0),
1560
- ie([]),
1559
+ se(!0),
1560
+ se([]),
1561
1561
  void 0,
1562
1562
  void 0,
1563
- { ...x.INITIAL_BLOCK_FEATURE_FLAGS }
1563
+ { ...w.INITIAL_BLOCK_FEATURE_FLAGS }
1564
1564
  );
1565
1565
  }
1566
1566
  output(e, n, r = {}) {
1567
1567
  if (typeof n == "function") {
1568
1568
  const i = `output#${e}`;
1569
- return G(i, () => n(new te())), new x(
1569
+ return G(i, () => n(new ne())), new w(
1570
1570
  this._renderingMode,
1571
1571
  this._initialArgs,
1572
1572
  this._initialUiState,
@@ -1585,7 +1585,7 @@ const x = class x {
1585
1585
  this._featureFlags
1586
1586
  );
1587
1587
  } else
1588
- return new x(
1588
+ return new w(
1589
1589
  this._renderingMode,
1590
1590
  this._initialArgs,
1591
1591
  this._initialUiState,
@@ -1605,7 +1605,7 @@ const x = class x {
1605
1605
  return this.output(e, n, { retentive: !0 });
1606
1606
  }
1607
1607
  argsValid(e) {
1608
- return typeof e == "function" ? (G("inputsValid", () => e(new te())), new x(
1608
+ return typeof e == "function" ? (G("inputsValid", () => e(new ne())), new w(
1609
1609
  this._renderingMode,
1610
1610
  this._initialArgs,
1611
1611
  this._initialUiState,
@@ -1618,7 +1618,7 @@ const x = class x {
1618
1618
  this._title,
1619
1619
  this._enrichmentTargets,
1620
1620
  this._featureFlags
1621
- )) : new x(
1621
+ )) : new w(
1622
1622
  this._renderingMode,
1623
1623
  this._initialArgs,
1624
1624
  this._initialUiState,
@@ -1631,7 +1631,7 @@ const x = class x {
1631
1631
  );
1632
1632
  }
1633
1633
  sections(e) {
1634
- return Array.isArray(e) ? this.sections(ie(e)) : typeof e == "function" ? (G("sections", () => e(new te())), new x(
1634
+ return Array.isArray(e) ? this.sections(se(e)) : typeof e == "function" ? (G("sections", () => e(new ne())), new w(
1635
1635
  this._renderingMode,
1636
1636
  this._initialArgs,
1637
1637
  this._initialUiState,
@@ -1641,7 +1641,7 @@ const x = class x {
1641
1641
  this._title,
1642
1642
  this._enrichmentTargets,
1643
1643
  this._featureFlags
1644
- )) : new x(
1644
+ )) : new w(
1645
1645
  this._renderingMode,
1646
1646
  this._initialArgs,
1647
1647
  this._initialUiState,
@@ -1655,7 +1655,7 @@ const x = class x {
1655
1655
  }
1656
1656
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
1657
1657
  title(e) {
1658
- return G("title", () => e(new te())), new x(
1658
+ return G("title", () => e(new ne())), new w(
1659
1659
  this._renderingMode,
1660
1660
  this._initialArgs,
1661
1661
  this._initialUiState,
@@ -1672,7 +1672,7 @@ const x = class x {
1672
1672
  * @deprecated use {@link withArgs}
1673
1673
  * */
1674
1674
  initialArgs(e) {
1675
- return new x(
1675
+ return new w(
1676
1676
  this._renderingMode,
1677
1677
  e,
1678
1678
  this._initialUiState,
@@ -1686,7 +1686,7 @@ const x = class x {
1686
1686
  }
1687
1687
  /** Sets initial args for the block, this value must be specified. */
1688
1688
  withArgs(e) {
1689
- return new x(
1689
+ return new w(
1690
1690
  this._renderingMode,
1691
1691
  e,
1692
1692
  this._initialUiState,
@@ -1700,7 +1700,7 @@ const x = class x {
1700
1700
  }
1701
1701
  /** Defines type and sets initial value for block UiState. */
1702
1702
  withUiState(e) {
1703
- return new x(
1703
+ return new w(
1704
1704
  this._renderingMode,
1705
1705
  this._initialArgs,
1706
1706
  e,
@@ -1717,7 +1717,7 @@ const x = class x {
1717
1717
  * Influences dependency graph construction.
1718
1718
  */
1719
1719
  enriches(e) {
1720
- return G("enrichmentTargets", e), new x(
1720
+ return G("enrichmentTargets", e), new w(
1721
1721
  this._renderingMode,
1722
1722
  this._initialArgs,
1723
1723
  this._initialUiState,
@@ -1736,7 +1736,7 @@ const x = class x {
1736
1736
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
1737
1737
  const e = {
1738
1738
  v3: {
1739
- sdkVersion: z,
1739
+ sdkVersion: X,
1740
1740
  renderingMode: this._renderingMode,
1741
1741
  initialArgs: this._initialArgs,
1742
1742
  initialUiState: this._initialUiState,
@@ -1748,25 +1748,25 @@ const x = class x {
1748
1748
  featureFlags: this._featureFlags
1749
1749
  },
1750
1750
  // fields below are added to allow previous desktop versions read generated configs
1751
- sdkVersion: z,
1751
+ sdkVersion: X,
1752
1752
  renderingMode: this._renderingMode,
1753
1753
  initialArgs: this._initialArgs,
1754
- inputsValid: fe(this._inputsValid),
1755
- sections: fe(this._sections),
1754
+ inputsValid: me(this._inputsValid),
1755
+ sections: me(this._sections),
1756
1756
  outputs: Object.fromEntries(
1757
- Object.entries(this._outputs).map(([n, r]) => [n, fe(r)])
1757
+ Object.entries(this._outputs).map(([n, r]) => [n, me(r)])
1758
1758
  )
1759
1759
  };
1760
- return bt() ? je({ sdkVersion: z }) : { config: e };
1760
+ return Pt() ? Je({ sdkVersion: X }) : { config: e };
1761
1761
  }
1762
1762
  };
1763
- k(x, "INITIAL_BLOCK_FEATURE_FLAGS", {
1763
+ k(w, "INITIAL_BLOCK_FEATURE_FLAGS", {
1764
1764
  supportsLazyState: !0,
1765
1765
  requiresUIAPIVersion: 1,
1766
1766
  requiresModelAPIVersion: 1
1767
1767
  });
1768
- let Fe = x;
1769
- function He() {
1768
+ let Ve = w;
1769
+ function Ye() {
1770
1770
  return {
1771
1771
  sourceId: null,
1772
1772
  hiddenColIds: null,
@@ -1775,72 +1775,72 @@ function He() {
1775
1775
  sorting: []
1776
1776
  };
1777
1777
  }
1778
- function Ee() {
1778
+ function Oe() {
1779
1779
  return {
1780
1780
  version: 4,
1781
1781
  stateCache: [],
1782
- pTableParams: He()
1782
+ pTableParams: Ye()
1783
1783
  };
1784
1784
  }
1785
- function $t(t) {
1786
- return "version" in t || (t = Ee()), t.version === 2 && (t = {
1785
+ function Gt(t) {
1786
+ return "version" in t || (t = Oe()), t.version === 2 && (t = {
1787
1787
  version: 3,
1788
1788
  stateCache: t.stateCache.map((e) => ({
1789
1789
  ...e,
1790
1790
  filtersState: []
1791
1791
  })),
1792
- pTableParams: He()
1793
- }), t.version === 3 && (t = Ee()), t;
1792
+ pTableParams: Ye()
1793
+ }), t.version === 3 && (t = Oe()), t;
1794
1794
  }
1795
- function Ce(t) {
1795
+ function Se(t) {
1796
1796
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
1797
1797
  }
1798
- function Bt(t) {
1799
- return new X().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1798
+ function Ht(t) {
1799
+ return new Q().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1800
1800
  name: "pl7.app/label",
1801
1801
  axes: [{}]
1802
1802
  // exactly one axis
1803
1803
  }, { dontWaitAllData: !0 });
1804
1804
  }
1805
- function ke(t, e) {
1805
+ function De(t, e) {
1806
1806
  const n = [], r = [];
1807
1807
  for (const a of t)
1808
- Ce(a.spec) ? n.push(a) : r.push(a);
1808
+ Se(a.spec) ? n.push(a) : r.push(a);
1809
1809
  const i = [];
1810
1810
  for (const a of r)
1811
1811
  for (const l of a.spec.axesSpec) {
1812
- const u = D(l);
1813
- i.some((h) => N(h, u)) || i.push(u);
1812
+ const u = V(l);
1813
+ i.some((h) => U(h, u)) || i.push(u);
1814
1814
  }
1815
1815
  for (const a of n) {
1816
- const l = D(a.spec.axesSpec[0]), u = i.findIndex((h) => N(h, l));
1816
+ const l = V(a.spec.axesSpec[0]), u = i.findIndex((h) => U(h, l));
1817
1817
  u !== -1 && i.splice(u, 1);
1818
1818
  }
1819
- const s = (a, l) => {
1819
+ const o = (a, l) => {
1820
1820
  let u = a.toString();
1821
1821
  if (l)
1822
1822
  for (const h in l)
1823
1823
  u += h, u += l[h];
1824
1824
  return u;
1825
- }, o = [];
1825
+ }, s = [];
1826
1826
  for (const a of e) {
1827
- const l = a.spec.axesSpec[0], u = D(l), h = i.findIndex((f) => N(f, u));
1827
+ const l = a.spec.axesSpec[0], u = V(l), h = i.findIndex((f) => U(f, u));
1828
1828
  if (h !== -1) {
1829
- const f = i[h], g = Object.keys(f.domain ?? {}).length, d = Object.keys(l.domain ?? {}).length;
1830
- g > d ? o.push({
1831
- id: s(a.id, f.domain),
1829
+ const f = i[h], m = Object.keys(f.domain ?? {}).length, d = Object.keys(l.domain ?? {}).length;
1830
+ m > d ? s.push({
1831
+ id: o(a.id, f.domain),
1832
1832
  spec: {
1833
1833
  ...a.spec,
1834
1834
  axesSpec: [{ ...f, annotations: l.annotations }]
1835
1835
  },
1836
1836
  data: a.data
1837
- }) : o.push(a), i.splice(h, 1);
1837
+ }) : s.push(a), i.splice(h, 1);
1838
1838
  }
1839
1839
  }
1840
- return o;
1840
+ return s;
1841
1841
  }
1842
- function Ut(t) {
1843
- const e = (i) => Array.isArray(i), n = (i) => i instanceof R, r = (i) => typeof i == "object" && "type" in i;
1842
+ function zt(t) {
1843
+ const e = (i) => Array.isArray(i), n = (i) => i instanceof O, r = (i) => typeof i == "object" && "type" in i;
1844
1844
  return t.map((i) => i.data).every((i) => {
1845
1845
  if (e(i))
1846
1846
  return !0;
@@ -1851,15 +1851,15 @@ function Ut(t) {
1851
1851
  case "Json":
1852
1852
  return !0;
1853
1853
  case "JsonPartitioned":
1854
- return Object.values(i.parts).every((o) => o.getIsReadyOrError());
1854
+ return Object.values(i.parts).every((s) => s.getIsReadyOrError());
1855
1855
  case "BinaryPartitioned":
1856
- return Object.values(i.parts).every((o) => o.index.getIsReadyOrError() && o.values.getIsReadyOrError());
1856
+ return Object.values(i.parts).every((s) => s.index.getIsReadyOrError() && s.values.getIsReadyOrError());
1857
1857
  }
1858
1858
  else
1859
1859
  throw Error(`unsupported column data type: ${i}`);
1860
1860
  });
1861
1861
  }
1862
- function De(t) {
1862
+ function Re(t) {
1863
1863
  let e = t.columns;
1864
1864
  const n = [];
1865
1865
  if (t.coreColumnPredicate) {
@@ -1881,80 +1881,80 @@ function De(t) {
1881
1881
  sorting: t.sorting
1882
1882
  };
1883
1883
  }
1884
- function Wt(t) {
1884
+ function Xt(t) {
1885
1885
  var e;
1886
1886
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
1887
1887
  }
1888
- function Gt(t) {
1888
+ function Yt(t) {
1889
1889
  var e;
1890
1890
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
1891
1891
  }
1892
- function he(t, e) {
1892
+ function ye(t, e) {
1893
1893
  return [...new Map(t.map((n) => [e(n), n])).values()];
1894
1894
  }
1895
- function Jn(t, e, n, r) {
1895
+ function Gn(t, e, n, r) {
1896
1896
  if (e.length === 0) return;
1897
- const i = e.filter((c) => !Wt(c.spec)), s = $t(n), o = Bt(t.resultPool);
1898
- if (!o) return;
1899
- const a = ke(i.map(xe), o), l = [...i, ...a], h = [
1900
- ...he(
1901
- [...l.flatMap((c) => c.spec.axesSpec.map((b) => D(b)))],
1902
- (c) => O(c)
1897
+ const i = e.filter((c) => !Xt(c.spec)), o = Gt(n), s = Ht(t.resultPool);
1898
+ if (!s) return;
1899
+ const a = De(i.map(Ie), s), l = [...i, ...a], h = [
1900
+ ...ye(
1901
+ [...l.flatMap((c) => c.spec.axesSpec.map((b) => V(b)))],
1902
+ (c) => D(c)
1903
1903
  ).map((c) => ({ type: "axis", id: c })),
1904
1904
  ...l.map((c) => ({ type: "column", id: c.id }))
1905
- ], f = new Set(h.map((c) => O(c))), g = (c) => f.has(O(c)), d = (r == null ? void 0 : r.coreJoinType) ?? "full", y = s.pTableParams.partitionFilters.filter((c) => {
1906
- const b = g(c.column);
1905
+ ], f = new Set(h.map((c) => D(c))), m = (c) => f.has(D(c)), d = (r == null ? void 0 : r.coreJoinType) ?? "full", g = o.pTableParams.partitionFilters.filter((c) => {
1906
+ const b = m(c.column);
1907
1907
  return b || t.logWarn(`Partition filter ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1908
- }), p = he(
1909
- [...(r == null ? void 0 : r.filters) ?? [], ...s.pTableParams.filters],
1910
- (c) => O(c.column)
1908
+ }), p = ye(
1909
+ [...(r == null ? void 0 : r.filters) ?? [], ...o.pTableParams.filters],
1910
+ (c) => D(c.column)
1911
1911
  ).filter((c) => {
1912
- const b = g(c.column);
1912
+ const b = m(c.column);
1913
1913
  return b || t.logWarn(`Filter ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1914
- }), m = he(
1915
- [...(r == null ? void 0 : r.sorting) ?? [], ...s.pTableParams.sorting],
1916
- (c) => O(c.column)
1914
+ }), y = ye(
1915
+ [...(r == null ? void 0 : r.sorting) ?? [], ...o.pTableParams.sorting],
1916
+ (c) => D(c.column)
1917
1917
  ).filter((c) => {
1918
- const b = g(c.column);
1918
+ const b = m(c.column);
1919
1919
  return b || t.logWarn(`Sorting ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1920
- }), C = De({
1920
+ }), C = Re({
1921
1921
  columns: i,
1922
1922
  labelColumns: a,
1923
1923
  coreJoinType: d,
1924
- partitionFilters: y,
1924
+ partitionFilters: g,
1925
1925
  filters: p,
1926
- sorting: m,
1926
+ sorting: y,
1927
1927
  coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1928
- }), E = t.createPTable(C), _ = new Set((() => {
1928
+ }), E = t.createPTable(C), x = new Set((() => {
1929
1929
  if (d === "inner") return [];
1930
- const c = s.pTableParams.hiddenColIds;
1931
- return c || i.filter((b) => Gt(b.spec)).map((b) => b.id);
1930
+ const c = o.pTableParams.hiddenColIds;
1931
+ return c || i.filter((b) => Yt(b.spec)).map((b) => b.id);
1932
1932
  })());
1933
1933
  i.filter((c) => {
1934
1934
  var b;
1935
1935
  return ((b = c.spec.annotations) == null ? void 0 : b["pl7.app/isLinkerColumn"]) === "true";
1936
- }).forEach((c) => _.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((b) => {
1937
- var T;
1938
- return (T = r == null ? void 0 : r.coreColumnPredicate) != null && T.call(r, b.spec) ? [b.id] : [];
1939
- }).forEach((b) => _.delete(b)), [...y.map((c) => c.column), ...p.map((c) => c.column), ...m.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => _.delete(c.id));
1940
- const w = i.filter((c) => !_.has(c.id)), A = ke(w.map(xe), o);
1941
- if (!Ut([...w, ...A])) return;
1942
- const S = De({
1943
- columns: w,
1944
- labelColumns: A,
1936
+ }).forEach((c) => x.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((b) => {
1937
+ var I;
1938
+ return (I = r == null ? void 0 : r.coreColumnPredicate) != null && I.call(r, b.spec) ? [b.id] : [];
1939
+ }).forEach((b) => x.delete(b)), [...g.map((c) => c.column), ...p.map((c) => c.column), ...y.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => x.delete(c.id));
1940
+ const S = i.filter((c) => !x.has(c.id)), P = De(S.map(Ie), s);
1941
+ if (!zt([...S, ...P])) return;
1942
+ const T = Re({
1943
+ columns: S,
1944
+ labelColumns: P,
1945
1945
  coreJoinType: d,
1946
- partitionFilters: y,
1946
+ partitionFilters: g,
1947
1947
  filters: p,
1948
- sorting: m,
1948
+ sorting: y,
1949
1949
  coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1950
- }), I = t.createPTable(S);
1950
+ }), F = t.createPTable(T);
1951
1951
  return {
1952
- sourceId: s.pTableParams.sourceId,
1952
+ sourceId: o.pTableParams.sourceId,
1953
1953
  fullTableHandle: E,
1954
- visibleTableHandle: I
1954
+ visibleTableHandle: F
1955
1955
  };
1956
1956
  }
1957
- function $n(t, e, n) {
1957
+ function Hn(t, e, n) {
1958
1958
  const r = t.resultPool.findLabels(e);
1959
1959
  return {
1960
1960
  axis: e,
@@ -1965,190 +1965,190 @@ function $n(t, e, n) {
1965
1965
  defaultValue: n[0]
1966
1966
  };
1967
1967
  }
1968
- const Ht = (t, e) => {
1968
+ const Qt = (t, e) => {
1969
1969
  let n = t.toString();
1970
1970
  return e == null || e.forEach((r) => {
1971
1971
  if (r)
1972
- for (const [i, s] of Object.entries(r))
1973
- n += i, n += s;
1972
+ for (const [i, o] of Object.entries(r))
1973
+ n += i, n += o;
1974
1974
  }), n;
1975
1975
  };
1976
- function qt(t) {
1976
+ function Zt(t) {
1977
1977
  if (!t.length)
1978
1978
  return [];
1979
1979
  let e = [[]];
1980
1980
  return t.forEach((n) => {
1981
1981
  const r = [];
1982
1982
  n.forEach((i) => {
1983
- r.push(...e.map((s) => [...s, i]));
1983
+ r.push(...e.map((o) => [...o, i]));
1984
1984
  }), e = r;
1985
1985
  }), e;
1986
1986
  }
1987
- function zt(t) {
1987
+ function en(t) {
1988
1988
  var e;
1989
- return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Xt]) === "true";
1989
+ return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[nn]) === "true";
1990
1990
  }
1991
- const Yt = "pl7.app/graph/isVirtual", Re = "pl7.app/label", Xt = "pl7.app/isLinkerColumn";
1992
- function Qt(t) {
1991
+ const tn = "pl7.app/graph/isVirtual", Ne = "pl7.app/label", nn = "pl7.app/isLinkerColumn";
1992
+ function rn(t) {
1993
1993
  var n, r;
1994
1994
  const e = /* @__PURE__ */ new Map();
1995
1995
  for (const { spec: i } of t) {
1996
- const s = i.axesSpec.map(D).map(O);
1997
- s.forEach((o) => {
1998
- e.has(o) || e.set(o, /* @__PURE__ */ new Set());
1996
+ const o = i.axesSpec.map(V).map(D);
1997
+ o.forEach((s) => {
1998
+ e.has(s) || e.set(s, /* @__PURE__ */ new Set());
1999
1999
  });
2000
- for (let o = 0; o < s.length - 1; o++)
2001
- for (let a = o + 1; a < s.length; a++) {
2002
- const l = s[o], u = s[a];
2000
+ for (let s = 0; s < o.length - 1; s++)
2001
+ for (let a = s + 1; a < o.length; a++) {
2002
+ const l = o[s], u = o[a];
2003
2003
  (n = e.get(l)) == null || n.add(u), (r = e.get(u)) == null || r.add(l);
2004
2004
  }
2005
2005
  }
2006
2006
  return e;
2007
2007
  }
2008
- function Zt(t, e) {
2009
- const n = Qt(t), r = [...n.keys()].map(_e), i = [];
2008
+ function on(t, e) {
2009
+ const n = rn(t), r = [...n.keys()].map(_e), i = [];
2010
2010
  for (const l of e.values()) {
2011
- const u = r.find((h) => N(l, h));
2012
- u && i.push(O(u));
2011
+ const u = r.find((h) => U(l, h));
2012
+ u && i.push(D(u));
2013
2013
  }
2014
- const s = new Set(i), o = /* @__PURE__ */ new Map();
2014
+ const o = new Set(i), s = /* @__PURE__ */ new Map();
2015
2015
  let a = [...i];
2016
2016
  for (; a.length; ) {
2017
2017
  const l = [];
2018
2018
  for (const u of a)
2019
2019
  for (const h of n.get(u) ?? [])
2020
- s.has(h) || (l.push(h), s.add(h), o.set(h, _e(h)));
2020
+ o.has(h) || (l.push(h), o.add(h), s.set(h, _e(h)));
2021
2021
  a = l;
2022
2022
  }
2023
- return o;
2023
+ return s;
2024
2024
  }
2025
- function Oe(t, e) {
2025
+ function Ue(t, e) {
2026
2026
  const n = [];
2027
2027
  return e.forEach((r) => {
2028
- n.push(...en(t, r));
2028
+ n.push(...sn(t, r));
2029
2029
  }), n;
2030
2030
  }
2031
- function en(t, e) {
2032
- const n = e.spec.axesSpec.map(D);
2033
- if (n.every((u) => t.has(O(u))))
2031
+ function sn(t, e) {
2032
+ const n = e.spec.axesSpec.map(V);
2033
+ if (n.every((u) => t.has(D(u))))
2034
2034
  return [e];
2035
2035
  const r = n.map((u) => {
2036
2036
  const h = [];
2037
- for (const [f, g] of t)
2038
- N(g, u) && !N(u, g) && h.push(g);
2037
+ for (const [f, m] of t)
2038
+ U(m, u) && !U(u, m) && h.push(m);
2039
2039
  return h;
2040
- }), i = qt(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
2040
+ }), i = Zt(r), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), a = i.map((u) => {
2041
2041
  const h = /* @__PURE__ */ new Set();
2042
- return u.map((f, g) => {
2043
- const d = e.spec.axesSpec[g].domain, y = f.domain;
2044
- return Object.entries(y ?? {}).forEach(([p, m]) => {
2042
+ return u.map((f, m) => {
2043
+ const d = e.spec.axesSpec[m].domain, g = f.domain;
2044
+ return Object.entries(g ?? {}).forEach(([p, y]) => {
2045
2045
  if ((d == null ? void 0 : d[p]) === void 0) {
2046
- const C = JSON.stringify([p, m]);
2047
- h.add(C), s.add(C);
2046
+ const C = JSON.stringify([p, y]);
2047
+ h.add(C), o.add(C);
2048
2048
  }
2049
2049
  }), {
2050
2050
  ...f,
2051
- annotations: e.spec.axesSpec[g].annotations
2051
+ annotations: e.spec.axesSpec[m].annotations
2052
2052
  };
2053
2053
  }), h;
2054
2054
  });
2055
- [...s].forEach((u) => {
2056
- a.some((h) => !h.has(u)) && o.add(u);
2055
+ [...o].forEach((u) => {
2056
+ a.some((h) => !h.has(u)) && s.add(u);
2057
2057
  });
2058
2058
  const l = i.map((u, h) => {
2059
2059
  var p;
2060
- const f = Ht(e.id, u.map((m) => m.domain)), g = ((p = e.spec.annotations) == null ? void 0 : p[Re]) ?? "", d = [...a[h]].filter((m) => o.has(m)).sort().map((m) => {
2060
+ const f = Qt(e.id, u.map((y) => y.domain)), m = ((p = e.spec.annotations) == null ? void 0 : p[Ne]) ?? "", d = [...a[h]].filter((y) => s.has(y)).sort().map((y) => {
2061
2061
  var C;
2062
- return (C = JSON.parse(m)) == null ? void 0 : C[1];
2063
- }).join(" / "), y = {
2062
+ return (C = JSON.parse(y)) == null ? void 0 : C[1];
2063
+ }).join(" / "), g = {
2064
2064
  ...e.spec.annotations,
2065
- [Yt]: "true"
2065
+ [tn]: "true"
2066
2066
  };
2067
- return (g || d) && (y[Re] = g && d ? g + " / " + d : g + d), {
2067
+ return (m || d) && (g[Ne] = m && d ? m + " / " + d : m + d), {
2068
2068
  id: f,
2069
2069
  spec: {
2070
2070
  ...e.spec,
2071
- axesSpec: u.map((m, C) => ({
2072
- ...m,
2071
+ axesSpec: u.map((y, C) => ({
2072
+ ...y,
2073
2073
  annotations: e.spec.axesSpec[C].annotations
2074
2074
  })),
2075
- annotations: y
2075
+ annotations: g
2076
2076
  },
2077
2077
  data: e.data
2078
2078
  };
2079
2079
  });
2080
2080
  return [e, ...l];
2081
2081
  }
2082
- function tn(t) {
2082
+ function an(t) {
2083
2083
  let e = !0;
2084
- return t.data instanceof R ? e = e && t.data.getIsReadyOrError() : ue(t.data) && dt(t.data, (n) => {
2084
+ return t.data instanceof O ? e = e && t.data.getIsReadyOrError() : pe(t.data) && gt(t.data, (n) => {
2085
2085
  e = e && n.getIsReadyOrError();
2086
2086
  }), e;
2087
2087
  }
2088
- function ne(t) {
2089
- return t.every(tn);
2088
+ function re(t) {
2089
+ return t.every(an);
2090
2090
  }
2091
- function Bn(t, e) {
2091
+ function zn(t, e) {
2092
2092
  if (!e) {
2093
- const f = new X();
2093
+ const f = new Q();
2094
2094
  f.addColumnProvider(t.resultPool);
2095
- const g = f.getColumns(() => !0, { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? [];
2096
- if (!ne(g))
2095
+ const m = f.getColumns(() => !0, { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? [];
2096
+ if (!re(m))
2097
2097
  return;
2098
- const d = new Map(g.flatMap((p) => p.spec.axesSpec).map((p) => {
2099
- const m = D(p);
2100
- return [O(m), m];
2101
- })), y = Oe(d, g);
2102
- return t.createPFrame(y);
2098
+ const d = new Map(m.flatMap((p) => p.spec.axesSpec).map((p) => {
2099
+ const y = V(p);
2100
+ return [D(y), y];
2101
+ })), g = Ue(d, m);
2102
+ return t.createPFrame(g);
2103
2103
  }
2104
- if (!ne(e))
2104
+ if (!re(e))
2105
2105
  return;
2106
- const n = new X();
2106
+ const n = new Q();
2107
2107
  n.addColumnProvider(t.resultPool), n.addColumns(e);
2108
2108
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
2109
2109
  for (const f of e)
2110
- for (const g of f.spec.axesSpec) {
2111
- const d = D(g);
2112
- r.set(O(d), d), i.set(O(d), d);
2110
+ for (const m of f.spec.axesSpec) {
2111
+ const d = V(m);
2112
+ r.set(D(d), d), i.set(D(d), d);
2113
2113
  }
2114
- const s = n.getColumns((f) => zt(f)) ?? [], o = Zt(s, r);
2115
- for (const f of o)
2114
+ const o = n.getColumns((f) => en(f)) ?? [], s = on(o, r);
2115
+ for (const f of s)
2116
2116
  r.set(...f), i.set(...f);
2117
- const a = (n.getColumns((f) => f.axesSpec.some((g) => {
2118
- const d = D(g);
2119
- for (const y of r.values())
2120
- if (N(y, d))
2117
+ const a = (n.getColumns((f) => f.axesSpec.some((m) => {
2118
+ const d = V(m);
2119
+ for (const g of r.values())
2120
+ if (U(g, d))
2121
2121
  return !0;
2122
2122
  return !1;
2123
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => !Ce(f.spec));
2124
- if (!ne(a))
2123
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => !Se(f.spec));
2124
+ if (!re(a))
2125
2125
  return;
2126
2126
  for (const f of a)
2127
- for (const g of f.spec.axesSpec) {
2128
- const d = D(g);
2129
- i.set(O(d), d);
2127
+ for (const m of f.spec.axesSpec) {
2128
+ const d = V(m);
2129
+ i.set(D(d), d);
2130
2130
  }
2131
- const l = (n.getColumns((f) => f.axesSpec.some((g) => {
2132
- const d = D(g);
2133
- for (const y of i.values())
2134
- if (N(y, d))
2131
+ const l = (n.getColumns((f) => f.axesSpec.some((m) => {
2132
+ const d = V(m);
2133
+ for (const g of i.values())
2134
+ if (U(g, d))
2135
2135
  return !0;
2136
2136
  return !1;
2137
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => Ce(f.spec));
2138
- if (!ne(l))
2137
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => Se(f.spec));
2138
+ if (!re(l))
2139
2139
  return;
2140
- const u = [...a, ...l], h = Oe(r, u);
2140
+ const u = [...a, ...l], h = Ue(r, u);
2141
2141
  return t.createPFrame(h);
2142
2142
  }
2143
- function Un({
2143
+ function Xn({
2144
2144
  selection: t,
2145
- columnId: e = ht(),
2145
+ columnId: e = vt(),
2146
2146
  label: n = "Selection marker",
2147
2147
  domain: r
2148
2148
  }) {
2149
2149
  if (!(t != null && t.axesSpec.length))
2150
2150
  return;
2151
- const i = t.selectedKeys.filter((s) => s.every((o) => !ft(o))).map((s) => ({ key: s, val: 1 }));
2151
+ const i = t.selectedKeys.filter((o) => o.every((s) => !bt(s))).map((o) => ({ key: o, val: 1 }));
2152
2152
  if (i.length)
2153
2153
  return {
2154
2154
  id: e,
@@ -2166,10 +2166,525 @@ function Un({
2166
2166
  data: i
2167
2167
  };
2168
2168
  }
2169
- function Wn(t) {
2170
- return t === gt ? (console.error("Axis value can never be N/A"), "") : t;
2169
+ function Yn(t) {
2170
+ return t === Ct ? (console.error("Axis value can never be N/A"), "") : t;
2171
+ }
2172
+ function ln(t) {
2173
+ throw new Error("Unexpected object: " + t);
2171
2174
  }
2172
- class Gn {
2175
+ function R(t) {
2176
+ return t.valueType === "Int" || t.valueType === "Long" || t.valueType === "Float" || t.valueType === "Double";
2177
+ }
2178
+ function ie(t) {
2179
+ return t.valueType === "String";
2180
+ }
2181
+ const Qe = {
2182
+ lessThan: {
2183
+ label: "Col < X (Less Than)",
2184
+ form: {
2185
+ column: {
2186
+ label: "Column",
2187
+ fieldType: "SUniversalPColumnId",
2188
+ defaultValue: () => {
2189
+ }
2190
+ },
2191
+ type: {
2192
+ label: "Predicate",
2193
+ fieldType: "FilterUiType",
2194
+ defaultValue: () => "lessThan"
2195
+ },
2196
+ x: {
2197
+ label: "X",
2198
+ fieldType: "number",
2199
+ defaultValue: () => 0
2200
+ }
2201
+ },
2202
+ supportedFor: R
2203
+ },
2204
+ greaterThan: {
2205
+ label: "Col > X (Greater Than)",
2206
+ form: {
2207
+ column: {
2208
+ label: "Column",
2209
+ fieldType: "SUniversalPColumnId",
2210
+ defaultValue: () => {
2211
+ }
2212
+ },
2213
+ type: {
2214
+ label: "Predicate",
2215
+ fieldType: "FilterUiType",
2216
+ defaultValue: () => "greaterThan"
2217
+ },
2218
+ x: {
2219
+ label: "X",
2220
+ fieldType: "number",
2221
+ defaultValue: () => 0
2222
+ }
2223
+ },
2224
+ supportedFor: R
2225
+ },
2226
+ lessThanOrEqual: {
2227
+ label: "Col ≤ X (Less Than or Equal)",
2228
+ form: {
2229
+ column: {
2230
+ label: "Column",
2231
+ fieldType: "SUniversalPColumnId",
2232
+ defaultValue: () => {
2233
+ }
2234
+ },
2235
+ type: {
2236
+ label: "Predicate",
2237
+ fieldType: "FilterUiType",
2238
+ defaultValue: () => "lessThanOrEqual"
2239
+ },
2240
+ x: {
2241
+ label: "X",
2242
+ fieldType: "number",
2243
+ defaultValue: () => 0
2244
+ }
2245
+ },
2246
+ supportedFor: R
2247
+ },
2248
+ greaterThanOrEqual: {
2249
+ label: "Col ≥ X (Greater Than or Equal)",
2250
+ form: {
2251
+ column: {
2252
+ label: "Column",
2253
+ fieldType: "SUniversalPColumnId",
2254
+ defaultValue: () => {
2255
+ }
2256
+ },
2257
+ type: {
2258
+ label: "Predicate",
2259
+ fieldType: "FilterUiType",
2260
+ defaultValue: () => "greaterThanOrEqual"
2261
+ },
2262
+ x: {
2263
+ label: "X",
2264
+ fieldType: "number",
2265
+ defaultValue: () => 0
2266
+ }
2267
+ },
2268
+ supportedFor: R
2269
+ },
2270
+ lessThanColumn: {
2271
+ label: "Col₁ < Col₂ (Compare Columns)",
2272
+ form: {
2273
+ column: {
2274
+ label: "Col₁",
2275
+ fieldType: "SUniversalPColumnId",
2276
+ defaultValue: () => {
2277
+ }
2278
+ },
2279
+ type: {
2280
+ label: "Predicate",
2281
+ fieldType: "FilterUiType",
2282
+ defaultValue: () => "lessThanColumn"
2283
+ },
2284
+ rhs: {
2285
+ label: "Col₂",
2286
+ fieldType: "SUniversalPColumnId",
2287
+ defaultValue: () => {
2288
+ }
2289
+ },
2290
+ minDiff: {
2291
+ label: "Margin (positive)",
2292
+ fieldType: "number?",
2293
+ defaultValue: () => {
2294
+ }
2295
+ }
2296
+ },
2297
+ supportedFor: (t, e) => R(t) && (e === void 0 || R(e))
2298
+ },
2299
+ lessThanColumnOrEqual: {
2300
+ label: "Col₁ ≤ Col₂ (Compare Columns)",
2301
+ form: {
2302
+ column: {
2303
+ label: "Col₁",
2304
+ fieldType: "SUniversalPColumnId",
2305
+ defaultValue: () => {
2306
+ }
2307
+ },
2308
+ type: {
2309
+ label: "Predicate",
2310
+ fieldType: "FilterUiType",
2311
+ defaultValue: () => "lessThanColumnOrEqual"
2312
+ },
2313
+ rhs: {
2314
+ label: "Col₂",
2315
+ fieldType: "SUniversalPColumnId",
2316
+ defaultValue: () => {
2317
+ }
2318
+ },
2319
+ minDiff: {
2320
+ label: "Margin (positive)",
2321
+ fieldType: "number?",
2322
+ defaultValue: () => {
2323
+ }
2324
+ }
2325
+ },
2326
+ supportedFor: (t, e) => R(t) && (e === void 0 || R(e))
2327
+ },
2328
+ topN: {
2329
+ label: "Top N",
2330
+ form: {
2331
+ column: {
2332
+ label: "Rank By Column",
2333
+ fieldType: "SUniversalPColumnId",
2334
+ defaultValue: () => {
2335
+ }
2336
+ },
2337
+ type: {
2338
+ label: "Predicate",
2339
+ fieldType: "FilterUiType",
2340
+ defaultValue: () => "topN"
2341
+ },
2342
+ n: {
2343
+ label: "N",
2344
+ fieldType: "number",
2345
+ defaultValue: () => 10
2346
+ }
2347
+ },
2348
+ supportedFor: R
2349
+ },
2350
+ bottomN: {
2351
+ label: "Bottom N",
2352
+ form: {
2353
+ column: {
2354
+ label: "Rank By Column",
2355
+ fieldType: "SUniversalPColumnId",
2356
+ defaultValue: () => {
2357
+ }
2358
+ },
2359
+ type: {
2360
+ label: "Predicate",
2361
+ fieldType: "FilterUiType",
2362
+ defaultValue: () => "bottomN"
2363
+ },
2364
+ n: {
2365
+ label: "N",
2366
+ fieldType: "number",
2367
+ defaultValue: () => 10
2368
+ }
2369
+ },
2370
+ supportedFor: R
2371
+ },
2372
+ patternContainSubsequence: {
2373
+ label: "Col ~ Seq (Contain Subsequence)",
2374
+ form: {
2375
+ column: {
2376
+ label: "Column",
2377
+ fieldType: "SUniversalPColumnId",
2378
+ defaultValue: () => {
2379
+ }
2380
+ },
2381
+ type: {
2382
+ label: "Predicate",
2383
+ fieldType: "FilterUiType",
2384
+ defaultValue: () => "patternContainSubsequence"
2385
+ },
2386
+ value: {
2387
+ label: "Seq",
2388
+ fieldType: "string",
2389
+ defaultValue: () => ""
2390
+ }
2391
+ },
2392
+ supportedFor: ie
2393
+ },
2394
+ patternNotContainSubsequence: {
2395
+ label: "Col ≁ Seq (Not Contain Subsequence)",
2396
+ form: {
2397
+ column: {
2398
+ label: "Column",
2399
+ fieldType: "SUniversalPColumnId",
2400
+ defaultValue: () => {
2401
+ }
2402
+ },
2403
+ type: {
2404
+ label: "Predicate",
2405
+ fieldType: "FilterUiType",
2406
+ defaultValue: () => "patternNotContainSubsequence"
2407
+ },
2408
+ value: {
2409
+ label: "Seq",
2410
+ fieldType: "string",
2411
+ defaultValue: () => ""
2412
+ }
2413
+ },
2414
+ supportedFor: ie
2415
+ },
2416
+ patternEquals: {
2417
+ label: "Col = Seq (Equals)",
2418
+ form: {
2419
+ column: {
2420
+ label: "Column",
2421
+ fieldType: "SUniversalPColumnId",
2422
+ defaultValue: () => {
2423
+ }
2424
+ },
2425
+ type: {
2426
+ label: "Predicate",
2427
+ fieldType: "FilterUiType",
2428
+ defaultValue: () => "patternEquals"
2429
+ },
2430
+ value: {
2431
+ label: "Seq",
2432
+ fieldType: "string",
2433
+ defaultValue: () => ""
2434
+ }
2435
+ },
2436
+ supportedFor: ie
2437
+ },
2438
+ patternNotEquals: {
2439
+ label: "Col ≠ Seq (Not Equal)",
2440
+ form: {
2441
+ column: {
2442
+ label: "Column",
2443
+ fieldType: "SUniversalPColumnId",
2444
+ defaultValue: () => {
2445
+ }
2446
+ },
2447
+ type: {
2448
+ label: "Predicate",
2449
+ fieldType: "FilterUiType",
2450
+ defaultValue: () => "patternNotEquals"
2451
+ },
2452
+ value: {
2453
+ label: "Seq",
2454
+ fieldType: "string",
2455
+ defaultValue: () => ""
2456
+ }
2457
+ },
2458
+ supportedFor: ie
2459
+ },
2460
+ isNA: {
2461
+ label: "Is NA",
2462
+ form: {
2463
+ column: {
2464
+ label: "Column",
2465
+ fieldType: "SUniversalPColumnId",
2466
+ defaultValue: () => {
2467
+ }
2468
+ },
2469
+ type: {
2470
+ label: "Predicate",
2471
+ fieldType: "FilterUiType",
2472
+ defaultValue: () => "isNA"
2473
+ }
2474
+ },
2475
+ supportedFor: () => !0
2476
+ },
2477
+ isNotNA: {
2478
+ label: "Is Not NA",
2479
+ form: {
2480
+ column: {
2481
+ label: "Column",
2482
+ fieldType: "SUniversalPColumnId",
2483
+ defaultValue: () => {
2484
+ }
2485
+ },
2486
+ type: {
2487
+ label: "Predicate",
2488
+ fieldType: "FilterUiType",
2489
+ defaultValue: () => "isNotNA"
2490
+ }
2491
+ },
2492
+ supportedFor: () => !0
2493
+ },
2494
+ or: {
2495
+ label: "Or",
2496
+ form: {
2497
+ type: {
2498
+ fieldType: "FilterUiType",
2499
+ label: "Predicate",
2500
+ defaultValue: () => "or"
2501
+ },
2502
+ filters: {
2503
+ fieldType: "unknown[]",
2504
+ label: "Filters",
2505
+ defaultValue: () => []
2506
+ }
2507
+ },
2508
+ supportedFor: () => !1
2509
+ },
2510
+ and: {
2511
+ label: "And",
2512
+ form: {
2513
+ type: {
2514
+ fieldType: "FilterUiType",
2515
+ label: "Predicate",
2516
+ defaultValue: () => "and"
2517
+ },
2518
+ filters: {
2519
+ fieldType: "unknown[]",
2520
+ label: "Filters",
2521
+ defaultValue: () => []
2522
+ }
2523
+ },
2524
+ supportedFor: () => !1
2525
+ },
2526
+ not: {
2527
+ label: "Not",
2528
+ form: {
2529
+ type: {
2530
+ fieldType: "FilterUiType",
2531
+ label: "Predicate",
2532
+ defaultValue: () => "not"
2533
+ },
2534
+ filter: {
2535
+ fieldType: "form",
2536
+ label: "Filter",
2537
+ defaultValue: () => {
2538
+ }
2539
+ // TODO:
2540
+ }
2541
+ },
2542
+ supportedFor: () => !1
2543
+ }
2544
+ };
2545
+ function Qn(t) {
2546
+ return t ? Object.entries(Qe).filter(([e, n]) => n.supportedFor(t)).map(([e, n]) => ({
2547
+ label: n.label,
2548
+ value: e
2549
+ })) : [];
2550
+ }
2551
+ function Zn(t) {
2552
+ return Qe[t];
2553
+ }
2554
+ function Ae(t) {
2555
+ if (t.type === "or")
2556
+ return {
2557
+ type: "or",
2558
+ filters: Ke(t.filters)
2559
+ };
2560
+ if (t.type === "and")
2561
+ return {
2562
+ type: "and",
2563
+ filters: Ke(t.filters)
2564
+ };
2565
+ if (t.type === "not")
2566
+ return {
2567
+ type: "not",
2568
+ filter: Ae(t.filter)
2569
+ };
2570
+ if (t.type === "isNA")
2571
+ return {
2572
+ type: "isNA",
2573
+ column: t.column
2574
+ };
2575
+ if (t.type === "isNotNA")
2576
+ return { type: "not", filter: { type: "isNA", column: t.column } };
2577
+ if (t.type === "patternEquals")
2578
+ return {
2579
+ type: "pattern",
2580
+ column: t.column,
2581
+ predicate: {
2582
+ type: "equals",
2583
+ value: t.value
2584
+ }
2585
+ };
2586
+ if (t.type === "patternNotEquals")
2587
+ return { type: "not", filter: {
2588
+ type: "pattern",
2589
+ column: t.column,
2590
+ predicate: { type: "equals", value: t.value }
2591
+ } };
2592
+ if (t.type === "patternContainSubsequence")
2593
+ return {
2594
+ type: "pattern",
2595
+ column: t.column,
2596
+ predicate: {
2597
+ type: "containSubsequence",
2598
+ value: t.value
2599
+ }
2600
+ };
2601
+ if (t.type === "patternNotContainSubsequence")
2602
+ return { type: "not", filter: {
2603
+ type: "pattern",
2604
+ column: t.column,
2605
+ predicate: { type: "containSubsequence", value: t.value }
2606
+ } };
2607
+ if (t.type === "topN")
2608
+ return {
2609
+ type: "numericalComparison",
2610
+ lhs: {
2611
+ transformer: "rank",
2612
+ column: t.column,
2613
+ descending: !0
2614
+ },
2615
+ rhs: t.n,
2616
+ allowEqual: !0
2617
+ };
2618
+ if (t.type === "bottomN")
2619
+ return {
2620
+ type: "numericalComparison",
2621
+ lhs: {
2622
+ transformer: "rank",
2623
+ column: t.column
2624
+ },
2625
+ rhs: t.n,
2626
+ allowEqual: !0
2627
+ };
2628
+ if (t.type === "lessThan")
2629
+ return {
2630
+ type: "numericalComparison",
2631
+ lhs: t.column,
2632
+ rhs: t.x
2633
+ };
2634
+ if (t.type === "greaterThan")
2635
+ return {
2636
+ type: "numericalComparison",
2637
+ rhs: t.column,
2638
+ lhs: t.x
2639
+ };
2640
+ if (t.type === "greaterThanOrEqual")
2641
+ return {
2642
+ type: "numericalComparison",
2643
+ rhs: t.column,
2644
+ lhs: t.x,
2645
+ allowEqual: !0
2646
+ };
2647
+ if (t.type === "lessThanOrEqual")
2648
+ return {
2649
+ type: "numericalComparison",
2650
+ lhs: t.column,
2651
+ rhs: t.x,
2652
+ allowEqual: !0
2653
+ };
2654
+ if (t.type === "lessThanColumn")
2655
+ return {
2656
+ type: "numericalComparison",
2657
+ lhs: t.column,
2658
+ rhs: t.rhs,
2659
+ minDiff: t.minDiff,
2660
+ allowEqual: void 0
2661
+ };
2662
+ if (t.type === "lessThanColumnOrEqual")
2663
+ return {
2664
+ type: "numericalComparison",
2665
+ lhs: t.column,
2666
+ rhs: t.rhs,
2667
+ minDiff: t.minDiff,
2668
+ allowEqual: !0
2669
+ };
2670
+ if (t.type === void 0)
2671
+ throw new Error("Filter type is undefined, this should not happen");
2672
+ ln(t);
2673
+ }
2674
+ function Ke(t) {
2675
+ return t.filter((e) => e.type !== void 0).map(Ae);
2676
+ }
2677
+ function er(t) {
2678
+ return {
2679
+ title: t.title,
2680
+ mode: t.mode,
2681
+ steps: t.steps.filter((e) => e.filter.type == null ? !1 : e.filter.type === "or" || e.filter.type === "and" ? e.filter.filters.length > 0 : !1).map((e) => ({
2682
+ label: e.label.trim(),
2683
+ filter: Ae(e.filter)
2684
+ }))
2685
+ };
2686
+ }
2687
+ class tr {
2173
2688
  constructor(e) {
2174
2689
  this.handle = e;
2175
2690
  }
@@ -2186,137 +2701,144 @@ class Gn {
2186
2701
  var r;
2187
2702
  return (r = cfgRenderCtx.featureFlags) != null && r.pFrameInSetFilterSupport || (e = {
2188
2703
  ...e,
2189
- filters: ve(e.filters)
2704
+ filters: Te(e.filters)
2190
2705
  }), await platforma.pFrameDriver.calculateTableData(this.handle, e, n);
2191
2706
  }
2192
2707
  async getUniqueValues(e) {
2193
2708
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
2194
2709
  }
2195
2710
  }
2196
- function nn(t) {
2197
- return Me({
2711
+ function un(t) {
2712
+ return Be({
2198
2713
  __isRef: !0,
2199
- blockId: se(t, "blockId"),
2200
- name: se(t, "name")
2714
+ blockId: ae(t, "blockId"),
2715
+ name: ae(t, "name")
2201
2716
  });
2202
2717
  }
2203
- function Hn(t) {
2204
- return Me({
2205
- ref: nn(se(t, "ref")),
2206
- label: se(t, "label")
2718
+ function nr(t) {
2719
+ return Be({
2720
+ ref: un(ae(t, "ref")),
2721
+ label: ae(t, "label")
2207
2722
  });
2208
2723
  }
2209
- const qn = {
2210
- sdkVersion: z
2724
+ const rr = {
2725
+ sdkVersion: X
2211
2726
  };
2212
- function rn() {
2213
- return je({ sdkVersion: z });
2727
+ function cn() {
2728
+ return Je({ sdkVersion: X });
2214
2729
  }
2215
- function zn(t) {
2730
+ function ir(t) {
2216
2731
  try {
2217
- return rn();
2732
+ return cn();
2218
2733
  } catch {
2219
2734
  return t;
2220
2735
  }
2221
2736
  }
2222
- function Yn(t) {
2737
+ function or(t) {
2223
2738
  if (typeof globalThis.getEnvironmentValue == "function")
2224
2739
  return globalThis.getEnvironmentValue(t);
2225
2740
  }
2226
2741
  export {
2227
- pn as Args,
2228
- Fe as BlockModel,
2229
- qn as CurrentSdkInfo,
2230
- F as FutureRef,
2231
- Yt as IS_VIRTUAL_COLUMN,
2232
- dn as It,
2233
- Vn as JsRenderInternal,
2234
- Re as LABEL_ANNOTATION,
2235
- Xt as LINKER_COLUMN_ANNOTATION,
2236
- fn as MainOutputs,
2237
- mt as OutputError,
2238
- At as PAnnotationLabel,
2239
- Pt as PAnnotationTrace,
2240
- X as PColumnCollection,
2241
- Gn as PFrameImpl,
2242
- B as RT_BINARY_PARTITIONED,
2243
- q as RT_BINARY_SUPER_PARTITIONED,
2742
+ gn as Args,
2743
+ Ve as BlockModel,
2744
+ rr as CurrentSdkInfo,
2745
+ L as FutureRef,
2746
+ tn as IS_VIRTUAL_COLUMN,
2747
+ bn as It,
2748
+ Jn as JsRenderInternal,
2749
+ Ne as LABEL_ANNOTATION,
2750
+ nn as LINKER_COLUMN_ANNOTATION,
2751
+ vn as MainOutputs,
2752
+ Tt as OutputError,
2753
+ It as PAnnotationLabel,
2754
+ _t as PAnnotationTrace,
2755
+ Q as PColumnCollection,
2756
+ tr as PFrameImpl,
2757
+ J as RT_BINARY_PARTITIONED,
2758
+ z as RT_BINARY_SUPER_PARTITIONED,
2244
2759
  H as RT_JSON_PARTITIONED,
2245
- le as RT_JSON_SUPER_PARTITIONED,
2246
- oe as RT_RESOURCE_MAP,
2247
- ae as RT_RESOURCE_MAP_PARTITIONED,
2248
- te as RenderCtx,
2249
- jt as ResultPool,
2250
- hn as StagingOutputs,
2251
- _t as Trace,
2252
- xt as TraceEntry,
2253
- R as TreeNodeAccessor,
2254
- gn as UiState,
2255
- Ut as allColumnsComputed,
2256
- ne as allColumnsReady,
2257
- wn as and,
2258
- kt as convertOrParsePColumnData,
2259
- Bn as createPFrameForGraphs,
2260
- $n as createPlDataTableSheet,
2261
- Ee as createPlDataTableStateV2,
2262
- Jn as createPlDataTableV2,
2263
- Un as createRowSelectionColumn,
2264
- Ue as deriveLabels,
2265
- fe as downgradeCfgOrLambda,
2266
- Oe as enrichCompatible,
2267
- kn as extractArchiveAndGetURL,
2268
- jn as extractConfig,
2269
- Dt as filterDataInfoEntries,
2270
- vn as flatten,
2271
- Hn as fromPlOption,
2272
- nn as fromPlRef,
2273
- Bt as getAllLabelColumns,
2274
- Zt as getAvailableWithLinkersAxes,
2275
- In as getBlobContent,
2276
- Ln as getBlobContentAsJson,
2277
- Tn as getBlobContentAsString,
2278
- Fn as getDownloadedBlobContent,
2279
- Yn as getEnvironmentValue,
2280
- Q as getFromCfg,
2281
- ie as getImmediate,
2282
- Dn as getImportProgress,
2283
- se as getJsonField,
2284
- Rn as getLastLogs,
2285
- Qt as getLinkerColumnsMap,
2286
- Nn as getLogHandle,
2287
- ke as getMatchingLabelColumns,
2288
- En as getOnDemandBlobContent,
2289
- Lt as getPartitionKeysList,
2290
- zn as getPlatformaOrDefault,
2291
- On as getProgressLog,
2292
- Kn as getProgressLogWithInfo,
2293
- rn as getRawPlatformaInstance,
2294
- Pn as getResourceField,
2295
- xn as getResourceValueAsJson,
2296
- Et as getUniquePartitionKeys,
2760
+ ce as RT_JSON_SUPER_PARTITIONED,
2761
+ le as RT_RESOURCE_MAP,
2762
+ ue as RT_RESOURCE_MAP_PARTITIONED,
2763
+ ne as RenderCtx,
2764
+ $t as ResultPool,
2765
+ Cn as StagingOutputs,
2766
+ Et as Trace,
2767
+ Lt as TraceEntry,
2768
+ O as TreeNodeAccessor,
2769
+ Tn as UiState,
2770
+ zt as allColumnsComputed,
2771
+ re as allColumnsReady,
2772
+ In as and,
2773
+ er as compileAnnotationScript,
2774
+ Ae as compileFilter,
2775
+ Ke as compileFilters,
2776
+ Nt as convertOrParsePColumnData,
2777
+ zn as createPFrameForGraphs,
2778
+ Hn as createPlDataTableSheet,
2779
+ Oe as createPlDataTableStateV2,
2780
+ Gn as createPlDataTableV2,
2781
+ Xn as createRowSelectionColumn,
2782
+ He as deriveLabels,
2783
+ me as downgradeCfgOrLambda,
2784
+ Ue as enrichCompatible,
2785
+ Un as extractArchiveAndGetURL,
2786
+ Wn as extractConfig,
2787
+ Ut as filterDataInfoEntries,
2788
+ Qe as filterUiMetadata,
2789
+ wn as flatten,
2790
+ nr as fromPlOption,
2791
+ un as fromPlRef,
2792
+ Ht as getAllLabelColumns,
2793
+ on as getAvailableWithLinkersAxes,
2794
+ Vn as getBlobContent,
2795
+ Dn as getBlobContentAsJson,
2796
+ On as getBlobContentAsString,
2797
+ Rn as getDownloadedBlobContent,
2798
+ or as getEnvironmentValue,
2799
+ Zn as getFilterUiMetadata,
2800
+ Qn as getFilterUiTypeOptions,
2801
+ Z as getFromCfg,
2802
+ se as getImmediate,
2803
+ Kn as getImportProgress,
2804
+ ae as getJsonField,
2805
+ Mn as getLastLogs,
2806
+ rn as getLinkerColumnsMap,
2807
+ Bn as getLogHandle,
2808
+ De as getMatchingLabelColumns,
2809
+ Nn as getOnDemandBlobContent,
2810
+ Ot as getPartitionKeysList,
2811
+ ir as getPlatformaOrDefault,
2812
+ jn as getProgressLog,
2813
+ qn as getProgressLogWithInfo,
2814
+ cn as getRawPlatformaInstance,
2815
+ Ln as getResourceField,
2816
+ En as getResourceValueAsJson,
2817
+ Rt as getUniquePartitionKeys,
2297
2818
  ge as ifDef,
2298
- Wt as isColumnHidden,
2299
- Gt as isColumnOptional,
2300
- tn as isColumnReady,
2301
- Jt as isConfigLambda,
2302
- Cn as isEmpty,
2303
- Ce as isLabelColumn,
2304
- zt as isLinkerColumn,
2305
- cn as isolate,
2306
- mn as makeArray,
2307
- He as makeDefaultPTableParams,
2308
- Me as makeObject,
2309
- bn as mapArrayValues,
2310
- Wn as mapPTableValueToAxisKey,
2311
- yn as mapRecordValues,
2312
- _n as mapResourceFields,
2313
- Sn as not,
2314
- An as or,
2315
- be as parsePColumnData,
2316
- Mn as parseResourceMap,
2317
- yt as readOutput,
2318
- he as uniqueBy,
2319
- $t as upgradePlDataTableStateV2,
2320
- un as wrapOutputs
2819
+ Xt as isColumnHidden,
2820
+ Yt as isColumnOptional,
2821
+ an as isColumnReady,
2822
+ Wt as isConfigLambda,
2823
+ xn as isEmpty,
2824
+ Se as isLabelColumn,
2825
+ en as isLinkerColumn,
2826
+ yn as isolate,
2827
+ Sn as makeArray,
2828
+ Ye as makeDefaultPTableParams,
2829
+ Be as makeObject,
2830
+ An as mapArrayValues,
2831
+ Yn as mapPTableValueToAxisKey,
2832
+ Pn as mapRecordValues,
2833
+ kn as mapResourceFields,
2834
+ Fn as not,
2835
+ _n as or,
2836
+ Ce as parsePColumnData,
2837
+ $n as parseResourceMap,
2838
+ St as readOutput,
2839
+ ye as uniqueBy,
2840
+ ln as unreachable,
2841
+ Gt as upgradePlDataTableStateV2,
2842
+ mn as wrapOutputs
2321
2843
  };
2322
2844
  //# sourceMappingURL=index.mjs.map