@platforma-open/milaboratories.immune-assay-data.model 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -2,48 +2,6 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.model = {}));
3
3
  })(this, function(exports2) {
4
4
  "use strict";
5
- function getDefaultExportFromCjs(x2) {
6
- return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
7
- }
8
- var canonicalize;
9
- var hasRequiredCanonicalize;
10
- function requireCanonicalize() {
11
- if (hasRequiredCanonicalize) return canonicalize;
12
- hasRequiredCanonicalize = 1;
13
- canonicalize = function serialize(object) {
14
- if (typeof object === "number" && isNaN(object)) {
15
- throw new Error("NaN is not allowed");
16
- }
17
- if (typeof object === "number" && !isFinite(object)) {
18
- throw new Error("Infinity is not allowed");
19
- }
20
- if (object === null || typeof object !== "object") {
21
- return JSON.stringify(object);
22
- }
23
- if (object.toJSON instanceof Function) {
24
- return serialize(object.toJSON());
25
- }
26
- if (Array.isArray(object)) {
27
- const values2 = object.reduce((t, cv, ci) => {
28
- const comma = ci === 0 ? "" : ",";
29
- const value = cv === void 0 || typeof cv === "symbol" ? null : cv;
30
- return `${t}${comma}${serialize(value)}`;
31
- }, "");
32
- return `[${values2}]`;
33
- }
34
- const values = Object.keys(object).sort().reduce((t, cv) => {
35
- if (object[cv] === void 0 || typeof object[cv] === "symbol") {
36
- return t;
37
- }
38
- const comma = t.length === 0 ? "" : ",";
39
- return `${t}${comma}${serialize(cv)}:${serialize(object[cv])}`;
40
- }, "");
41
- return `{${values}}`;
42
- };
43
- return canonicalize;
44
- }
45
- var canonicalizeExports = requireCanonicalize();
46
- const ke = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
47
5
  var util;
48
6
  (function(util2) {
49
7
  util2.assertEqual = (val) => val;
@@ -433,7 +391,7 @@
433
391
  overrideMap,
434
392
  overrideMap === errorMap ? void 0 : errorMap
435
393
  // then global default map
436
- ].filter((x2) => !!x2)
394
+ ].filter((x) => !!x)
437
395
  });
438
396
  ctx.common.issues.push(issue);
439
397
  }
@@ -496,10 +454,10 @@
496
454
  });
497
455
  const DIRTY = (value) => ({ status: "dirty", value });
498
456
  const OK = (value) => ({ status: "valid", value });
499
- const isAborted = (x2) => x2.status === "aborted";
500
- const isDirty = (x2) => x2.status === "dirty";
501
- const isValid = (x2) => x2.status === "valid";
502
- const isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
457
+ const isAborted = (x) => x.status === "aborted";
458
+ const isDirty = (x) => x.status === "dirty";
459
+ const isValid = (x) => x.status === "valid";
460
+ const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
503
461
  function __classPrivateFieldGet(receiver, state, kind, f2) {
504
462
  if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
505
463
  return state.get(receiver);
@@ -2829,7 +2787,7 @@
2829
2787
  if (!schema)
2830
2788
  return null;
2831
2789
  return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
2832
- }).filter((x2) => !!x2);
2790
+ }).filter((x) => !!x);
2833
2791
  if (ctx.common.async) {
2834
2792
  return Promise.all(items).then((results) => {
2835
2793
  return ParseStatus.mergeArray(status, results);
@@ -3087,7 +3045,7 @@
3087
3045
  ctx.schemaErrorMap,
3088
3046
  getErrorMap(),
3089
3047
  errorMap
3090
- ].filter((x2) => !!x2),
3048
+ ].filter((x) => !!x),
3091
3049
  issueData: {
3092
3050
  code: ZodIssueCode.invalid_arguments,
3093
3051
  argumentsError: error
@@ -3103,7 +3061,7 @@
3103
3061
  ctx.schemaErrorMap,
3104
3062
  getErrorMap(),
3105
3063
  errorMap
3106
- ].filter((x2) => !!x2),
3064
+ ].filter((x) => !!x),
3107
3065
  issueData: {
3108
3066
  code: ZodIssueCode.invalid_return_type,
3109
3067
  returnTypeError: error
@@ -3111,31 +3069,31 @@
3111
3069
  });
3112
3070
  }
3113
3071
  const params = { errorMap: ctx.common.contextualErrorMap };
3114
- const fn = ctx.data;
3072
+ const fn2 = ctx.data;
3115
3073
  if (this._def.returns instanceof ZodPromise) {
3116
- const me2 = this;
3074
+ const me = this;
3117
3075
  return OK(async function(...args) {
3118
3076
  const error = new ZodError([]);
3119
- const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e) => {
3077
+ const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
3120
3078
  error.addIssue(makeArgsIssue(args, e));
3121
3079
  throw error;
3122
3080
  });
3123
- const result = await Reflect.apply(fn, this, parsedArgs);
3124
- const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e) => {
3081
+ const result = await Reflect.apply(fn2, this, parsedArgs);
3082
+ const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
3125
3083
  error.addIssue(makeReturnsIssue(result, e));
3126
3084
  throw error;
3127
3085
  });
3128
3086
  return parsedReturns;
3129
3087
  });
3130
3088
  } else {
3131
- const me2 = this;
3089
+ const me = this;
3132
3090
  return OK(function(...args) {
3133
- const parsedArgs = me2._def.args.safeParse(args, params);
3091
+ const parsedArgs = me._def.args.safeParse(args, params);
3134
3092
  if (!parsedArgs.success) {
3135
3093
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3136
3094
  }
3137
- const result = Reflect.apply(fn, this, parsedArgs.data);
3138
- const parsedReturns = me2._def.returns.safeParse(result, params);
3095
+ const result = Reflect.apply(fn2, this, parsedArgs.data);
3096
+ const parsedReturns = me._def.returns.safeParse(result, params);
3139
3097
  if (!parsedReturns.success) {
3140
3098
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3141
3099
  }
@@ -3840,7 +3798,7 @@
3840
3798
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3841
3799
  };
3842
3800
  const NEVER = INVALID;
3843
- var z$2 = /* @__PURE__ */ Object.freeze({
3801
+ var z$1 = /* @__PURE__ */ Object.freeze({
3844
3802
  __proto__: null,
3845
3803
  defaultErrorMap: errorMap,
3846
3804
  setErrorMap,
@@ -3956,13 +3914,61 @@
3956
3914
  quotelessJson,
3957
3915
  ZodError
3958
3916
  });
3959
- var I$1 = Object.defineProperty;
3960
- var D = (n2, e, t) => e in n2 ? I$1(n2, e, { enumerable: true, configurable: true, writable: true, value: t }) : n2[e] = t;
3961
- var l$1 = (n2, e, t) => D(n2, typeof e != "symbol" ? e + "" : e, t);
3917
+ function getDefaultExportFromCjs(x) {
3918
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
3919
+ }
3920
+ var canonicalize;
3921
+ var hasRequiredCanonicalize;
3922
+ function requireCanonicalize() {
3923
+ if (hasRequiredCanonicalize) return canonicalize;
3924
+ hasRequiredCanonicalize = 1;
3925
+ canonicalize = function serialize(object) {
3926
+ if (typeof object === "number" && isNaN(object)) {
3927
+ throw new Error("NaN is not allowed");
3928
+ }
3929
+ if (typeof object === "number" && !isFinite(object)) {
3930
+ throw new Error("Infinity is not allowed");
3931
+ }
3932
+ if (object === null || typeof object !== "object") {
3933
+ return JSON.stringify(object);
3934
+ }
3935
+ if (object.toJSON instanceof Function) {
3936
+ return serialize(object.toJSON());
3937
+ }
3938
+ if (Array.isArray(object)) {
3939
+ const values2 = object.reduce((t, cv, ci) => {
3940
+ const comma = ci === 0 ? "" : ",";
3941
+ const value = cv === void 0 || typeof cv === "symbol" ? null : cv;
3942
+ return `${t}${comma}${serialize(value)}`;
3943
+ }, "");
3944
+ return `[${values2}]`;
3945
+ }
3946
+ const values = Object.keys(object).sort().reduce((t, cv) => {
3947
+ if (object[cv] === void 0 || typeof object[cv] === "symbol") {
3948
+ return t;
3949
+ }
3950
+ const comma = t.length === 0 ? "" : ",";
3951
+ return `${t}${comma}${serialize(cv)}:${serialize(object[cv])}`;
3952
+ }, "");
3953
+ return `{${values}}`;
3954
+ };
3955
+ return canonicalize;
3956
+ }
3957
+ var canonicalizeExports = requireCanonicalize();
3958
+ const Re = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
3959
+ var B$1 = Object.defineProperty;
3960
+ var j = (n2, e, t) => e in n2 ? B$1(n2, e, { enumerable: true, configurable: true, writable: true, value: t }) : n2[e] = t;
3961
+ var l$1 = (n2, e, t) => j(n2, typeof e != "symbol" ? e + "" : e, t);
3962
+ z$1.object({
3963
+ /** Included left border. */
3964
+ from: z$1.number(),
3965
+ /** Excluded right border. */
3966
+ to: z$1.number()
3967
+ });
3962
3968
  function w(n2) {
3963
3969
  throw new Error("Unexpected object: " + n2);
3964
3970
  }
3965
- function yn(n2) {
3971
+ function En(n2) {
3966
3972
  if (!n2 || typeof n2 != "object")
3967
3973
  return false;
3968
3974
  const e = n2;
@@ -3979,7 +3985,7 @@
3979
3985
  return false;
3980
3986
  }
3981
3987
  }
3982
- function hn(n2, e) {
3988
+ function Nn(n2, e) {
3983
3989
  if (n2 !== void 0)
3984
3990
  switch (n2.type) {
3985
3991
  case "Json":
@@ -4007,7 +4013,7 @@
4007
4013
  }
4008
4014
  }
4009
4015
  }
4010
- function F(n2) {
4016
+ function K(n2) {
4011
4017
  if (!n2 || typeof n2 != "object")
4012
4018
  return false;
4013
4019
  const e = n2;
@@ -4024,10 +4030,10 @@
4024
4030
  return false;
4025
4031
  }
4026
4032
  }
4027
- function gn(n2) {
4028
- return F(n2) ? n2.type === "JsonPartitioned" || n2.type === "BinaryPartitioned" : false;
4033
+ function Sn(n2) {
4034
+ return K(n2) ? n2.type === "JsonPartitioned" || n2.type === "BinaryPartitioned" : false;
4029
4035
  }
4030
- function bn(n2) {
4036
+ function Cn(n2) {
4031
4037
  switch (n2.type) {
4032
4038
  case "Json": {
4033
4039
  const e = Object.entries(n2.data).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
@@ -4055,7 +4061,7 @@
4055
4061
  }
4056
4062
  }
4057
4063
  }
4058
- function wn(n2) {
4064
+ function Jn(n2) {
4059
4065
  switch (n2.type) {
4060
4066
  case "Json": {
4061
4067
  const e = {};
@@ -4089,36 +4095,36 @@
4089
4095
  }
4090
4096
  }
4091
4097
  }
4092
- function On(n2) {
4098
+ function Fn(n2) {
4093
4099
  return {
4094
4100
  columnId: n2.id,
4095
4101
  spec: n2.spec
4096
4102
  };
4097
4103
  }
4098
4104
  function p$1(n2) {
4099
- const { type: e, name: t, domain: r } = n2;
4100
- return { type: e, name: t, ...r && { domain: r } };
4105
+ const { type: e, name: t, domain: r } = n2, o = { type: e, name: t };
4106
+ return r && Object.entries(r).length > 0 && Object.assign(o, { domain: r }), o;
4101
4107
  }
4102
- function C(n2) {
4108
+ function J(n2) {
4103
4109
  return n2.map(p$1);
4104
4110
  }
4105
- function $n(n2) {
4106
- return ke(p$1(n2));
4111
+ function Rn(n2) {
4112
+ return Re(p$1(n2));
4107
4113
  }
4108
- function z$1(n2, e) {
4114
+ function Y$1(n2, e) {
4109
4115
  if (n2 === void 0) return e === void 0;
4110
4116
  if (e === void 0) return true;
4111
4117
  for (const t in e)
4112
4118
  if (n2[t] !== e[t]) return false;
4113
4119
  return true;
4114
4120
  }
4115
- function X(n2, e) {
4116
- return n2.name === e.name && z$1(n2.domain, e.domain);
4121
+ function Z$1(n2, e) {
4122
+ return n2.name === e.name && Y$1(n2.domain, e.domain);
4117
4123
  }
4118
- function In(n2, e) {
4119
- return { ...n2, src: h$1(n2.src, e) };
4124
+ function Un(n2, e) {
4125
+ return { ...n2, src: h(n2.src, e) };
4120
4126
  }
4121
- function h$1(n2, e) {
4127
+ function h(n2, e) {
4122
4128
  switch (n2.type) {
4123
4129
  case "column":
4124
4130
  return {
@@ -4138,28 +4144,28 @@
4138
4144
  case "full":
4139
4145
  return {
4140
4146
  type: n2.type,
4141
- entries: n2.entries.map((t) => h$1(t, e))
4147
+ entries: n2.entries.map((t) => h(t, e))
4142
4148
  };
4143
4149
  case "outer":
4144
4150
  return {
4145
4151
  type: "outer",
4146
- primary: h$1(n2.primary, e),
4147
- secondary: n2.secondary.map((t) => h$1(t, e))
4152
+ primary: h(n2.primary, e),
4153
+ secondary: n2.secondary.map((t) => h(t, e))
4148
4154
  };
4149
4155
  default:
4150
4156
  w(n2);
4151
4157
  }
4152
4158
  }
4153
- function G(n2) {
4154
- return ke(n2);
4159
+ function nn(n2) {
4160
+ return Re(n2);
4155
4161
  }
4156
- function x(n2) {
4157
- return ke(p$1(n2));
4162
+ function P(n2) {
4163
+ return Re(p$1(n2));
4158
4164
  }
4159
- function A(n2, e) {
4165
+ function k$1(n2, e) {
4160
4166
  return JSON.stringify([n2, e]);
4161
4167
  }
4162
- class Ln {
4168
+ class _n {
4163
4169
  /**
4164
4170
  * Creates a new anchor context from a set of anchor column specifications
4165
4171
  * @param anchors Record of anchor column specifications indexed by anchor ID
@@ -4174,14 +4180,14 @@
4174
4180
  t.sort((r, o) => r[0].localeCompare(o[0]));
4175
4181
  for (const [r, o] of t) {
4176
4182
  for (let s2 = 0; s2 < o.axesSpec.length; s2++) {
4177
- const a = o.axesSpec[s2], i = x(a);
4183
+ const a = o.axesSpec[s2], i = P(a);
4178
4184
  this.axes.set(i, { anchor: r, idx: s2 });
4179
4185
  }
4180
4186
  if (o.domain !== void 0) {
4181
4187
  const s2 = Object.entries(o.domain);
4182
4188
  s2.sort((a, i) => a[0].localeCompare(i[0])), this.domainPackToAnchor.set(JSON.stringify(s2), r), this.domainPacks.push(s2.map(([a]) => a));
4183
4189
  for (const [a, i] of s2) {
4184
- const u2 = A(a, i);
4190
+ const u2 = k$1(a, i);
4185
4191
  this.domains.set(u2, r);
4186
4192
  }
4187
4193
  }
@@ -4201,9 +4207,9 @@
4201
4207
  for (const a of this.domainPacks) {
4202
4208
  const i = [];
4203
4209
  for (const c2 of a) {
4204
- const d = e.domain[c2];
4205
- if (d !== void 0)
4206
- i.push([c2, d]);
4210
+ const m2 = e.domain[c2];
4211
+ if (m2 !== void 0)
4212
+ i.push([c2, m2]);
4207
4213
  else
4208
4214
  break n;
4209
4215
  }
@@ -4216,11 +4222,11 @@
4216
4222
  for (const [a, i] of Object.entries(e.domain ?? {})) {
4217
4223
  if (o !== void 0 && o.has(a))
4218
4224
  continue;
4219
- const u2 = A(a, i), c2 = this.domains.get(u2);
4225
+ const u2 = k$1(a, i), c2 = this.domains.get(u2);
4220
4226
  r.domain ?? (r.domain = {}), r.domain[a] = c2 ? { anchor: c2 } : i;
4221
4227
  }
4222
4228
  if (r.axes = e.axesSpec.map((a) => {
4223
- const i = x(a), u2 = this.axes.get(i);
4229
+ const i = P(a), u2 = this.axes.get(i);
4224
4230
  return u2 === void 0 ? p$1(a) : u2;
4225
4231
  }), !t || t.length === 0)
4226
4232
  return r;
@@ -4232,7 +4238,7 @@
4232
4238
  throw new Error(`Axis index ${i} is out of bounds (0-${e.axesSpec.length - 1})`);
4233
4239
  s2.push([i, u2]);
4234
4240
  } else {
4235
- const c2 = e.axesSpec.findIndex((d) => d.name === i);
4241
+ const c2 = e.axesSpec.findIndex((m2) => m2.name === i);
4236
4242
  if (c2 === -1)
4237
4243
  throw new Error(`Axis with name "${i}" not found in the column specification`);
4238
4244
  s2.push([c2, u2]);
@@ -4250,10 +4256,10 @@
4250
4256
  * @returns A canonicalized string representation of the anchored column identifier
4251
4257
  */
4252
4258
  deriveS(e, t) {
4253
- return G(this.derive(e, t));
4259
+ return nn(this.derive(e, t));
4254
4260
  }
4255
4261
  }
4256
- function Vn(n2, e, t) {
4262
+ function Mn(n2, e, t) {
4257
4263
  const r = { ...e }, o = (t == null ? void 0 : t.ignoreMissingDomains) ?? false;
4258
4264
  if (r.domainAnchor !== void 0) {
4259
4265
  const s2 = n2[r.domainAnchor];
@@ -4280,10 +4286,10 @@
4280
4286
  }
4281
4287
  r.domain = s2;
4282
4288
  }
4283
- return r.axes && (r.axes = r.axes.map((s2) => Q(n2, s2))), r;
4289
+ return r.axes && (r.axes = r.axes.map((s2) => en(n2, s2))), r;
4284
4290
  }
4285
- function Q(n2, e) {
4286
- if (!Y$1(e))
4291
+ function en(n2, e) {
4292
+ if (!tn(e))
4287
4293
  return e;
4288
4294
  const t = e.anchor, r = n2[t];
4289
4295
  if (!r)
@@ -4300,7 +4306,7 @@
4300
4306
  throw new Error(`Axis with name "${e.name}" not found in anchor "${t}"`);
4301
4307
  return o[0];
4302
4308
  } else if ("id" in e) {
4303
- const o = r.axesSpec.filter((s2) => X(e.id, p$1(s2)));
4309
+ const o = r.axesSpec.filter((s2) => Z$1(e.id, p$1(s2)));
4304
4310
  if (o.length > 1)
4305
4311
  throw new Error(`Multiple matching axes found for matcher in anchor "${t}"`);
4306
4312
  if (o.length === 0)
@@ -4309,26 +4315,26 @@
4309
4315
  }
4310
4316
  throw new Error("Unsupported axis reference type");
4311
4317
  }
4312
- function Y$1(n2) {
4318
+ function tn(n2) {
4313
4319
  return typeof n2 == "object" && "anchor" in n2;
4314
4320
  }
4315
4321
  function f(n2) {
4316
4322
  return n2.kind === "PColumn";
4317
4323
  }
4318
- function Z$1(n2) {
4324
+ function rn(n2) {
4319
4325
  return f(n2.spec);
4320
4326
  }
4321
- function Un(n2) {
4322
- if (!Z$1(n2)) throw new Error(`not a PColumn (kind = ${n2.spec.kind})`);
4327
+ function qn(n2) {
4328
+ if (!rn(n2)) throw new Error(`not a PColumn (kind = ${n2.spec.kind})`);
4323
4329
  return n2;
4324
4330
  }
4325
- function Kn(n2, e) {
4331
+ function Wn(n2, e) {
4326
4332
  return n2 === void 0 ? void 0 : {
4327
4333
  ...n2,
4328
4334
  data: e(n2.data)
4329
4335
  };
4330
4336
  }
4331
- function Rn(n2) {
4337
+ function Xn(n2) {
4332
4338
  const e = /* @__PURE__ */ new Map(), t = (r) => {
4333
4339
  switch (r.type) {
4334
4340
  case "column":
@@ -4353,7 +4359,7 @@
4353
4359
  };
4354
4360
  return t(n2), [...e.values()];
4355
4361
  }
4356
- function k(n2, e) {
4362
+ function E$1(n2, e) {
4357
4363
  if (n2.name !== void 0 && n2.name !== e.name)
4358
4364
  return false;
4359
4365
  if (n2.type !== void 0) {
@@ -4391,13 +4397,13 @@
4391
4397
  const t = n2.axesSpec.map(p$1);
4392
4398
  if (e.partialAxesMatch) {
4393
4399
  for (const r of e.axes)
4394
- if (!t.some((o) => k(r, o)))
4400
+ if (!t.some((o) => E$1(r, o)))
4395
4401
  return false;
4396
4402
  } else {
4397
4403
  if (t.length !== e.axes.length)
4398
4404
  return false;
4399
4405
  for (let r = 0; r < e.axes.length; r++)
4400
- if (!k(e.axes[r], t[r]))
4406
+ if (!E$1(e.axes[r], t[r]))
4401
4407
  return false;
4402
4408
  }
4403
4409
  }
@@ -4417,28 +4423,28 @@
4417
4423
  }
4418
4424
  return true;
4419
4425
  }
4420
- function vn(n2) {
4426
+ function Gn(n2) {
4421
4427
  return Array.isArray(n2) ? (e) => n2.some((t) => f(e) && N(e, t)) : (e) => f(e) && N(e, n2);
4422
4428
  }
4423
- function _n(n2) {
4429
+ function Qn(n2) {
4424
4430
  const e = {
4425
4431
  kind: n2.kind,
4426
4432
  name: n2.name
4427
4433
  };
4428
- return n2.domain !== void 0 && (e.domain = n2.domain), f(n2) && (e.axesSpec = C(n2.axesSpec)), ke(e);
4434
+ return n2.domain !== void 0 && (e.domain = n2.domain), f(n2) && (e.axesSpec = J(n2.axesSpec)), Re(e);
4429
4435
  }
4430
- z$2.object({
4431
- __isRef: z$2.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
4432
- blockId: z$2.string().describe("Upstream block id"),
4433
- name: z$2.string().describe("Name of the output provided to the upstream block's output context"),
4434
- requireEnrichments: z$2.literal(true).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")
4436
+ z$1.object({
4437
+ __isRef: z$1.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
4438
+ blockId: z$1.string().describe("Upstream block id"),
4439
+ name: z$1.string().describe("Name of the output provided to the upstream block's output context"),
4440
+ requireEnrichments: z$1.literal(true).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")
4435
4441
  }).describe(
4436
4442
  "Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
4437
4443
  ).readonly();
4438
- function Hn(n2) {
4444
+ function ne(n2) {
4439
4445
  return typeof n2 == "object" && n2 !== null && "__isRef" in n2 && n2.__isRef === true && "blockId" in n2 && "name" in n2;
4440
4446
  }
4441
- function Wn(n2, e = true) {
4447
+ function te$1(n2, e = true) {
4442
4448
  if (e)
4443
4449
  return {
4444
4450
  ...n2,
@@ -4449,13 +4455,13 @@
4449
4455
  return r;
4450
4456
  }
4451
4457
  }
4452
- function Xn(n2, e) {
4458
+ function oe$1(n2, e) {
4453
4459
  return n2.ok ? { ok: true, value: e(n2.value) } : n2;
4454
4460
  }
4455
- const sn = 24;
4456
- z$2.string().length(sn).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4457
- function ne(n2) {
4458
- return JSON.parse(n2);
4461
+ const fn = 24;
4462
+ z$1.string().length(fn).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4463
+ function ue$1(n2) {
4464
+ return Re(n2);
4459
4465
  }
4460
4466
  var stringify = { exports: {} };
4461
4467
  var hasRequiredStringify;
@@ -4488,44 +4494,44 @@
4488
4494
  return stringify.exports;
4489
4495
  }
4490
4496
  requireStringify();
4491
- const l = z$2.object({
4492
- type: z$2.literal("PlError"),
4493
- name: z$2.string(),
4494
- message: z$2.string(),
4497
+ const l = z$1.object({
4498
+ type: z$1.literal("PlError"),
4499
+ name: z$1.string(),
4500
+ message: z$1.string(),
4495
4501
  /** The message with all details needed for SDK developers. */
4496
- fullMessage: z$2.string().optional(),
4497
- stack: z$2.string().optional()
4502
+ fullMessage: z$1.string().optional(),
4503
+ stack: z$1.string().optional()
4498
4504
  }), c = l.extend({
4499
- cause: z$2.lazy(() => s).optional(),
4500
- errors: z$2.lazy(() => s.array()).optional()
4501
- }), m = z$2.object({
4502
- type: z$2.literal("StandardError"),
4503
- name: z$2.string(),
4504
- message: z$2.string(),
4505
- stack: z$2.string().optional()
4505
+ cause: z$1.lazy(() => s).optional(),
4506
+ errors: z$1.lazy(() => s.array()).optional()
4507
+ }), m = z$1.object({
4508
+ type: z$1.literal("StandardError"),
4509
+ name: z$1.string(),
4510
+ message: z$1.string(),
4511
+ stack: z$1.string().optional()
4506
4512
  }), p = m.extend({
4507
- cause: z$2.lazy(() => s).optional(),
4508
- errors: z$2.lazy(() => s.array()).optional()
4509
- }), s = z$2.union([p, c]);
4510
- const u = z$2.object({
4511
- name: z$2.string(),
4512
- message: z$2.string(),
4513
- fullMessage: z$2.string().optional(),
4514
- stack: z$2.string().optional()
4513
+ cause: z$1.lazy(() => s).optional(),
4514
+ errors: z$1.lazy(() => s.array()).optional()
4515
+ }), s = z$1.union([p, c]);
4516
+ const u = z$1.object({
4517
+ name: z$1.string(),
4518
+ message: z$1.string(),
4519
+ fullMessage: z$1.string().optional(),
4520
+ stack: z$1.string().optional()
4515
4521
  }), n = u.extend({
4516
- cause: z$2.lazy(() => n).optional(),
4517
- errors: z$2.lazy(() => n.array()).optional()
4522
+ cause: z$1.lazy(() => n).optional(),
4523
+ errors: z$1.lazy(() => n.array()).optional()
4518
4524
  });
4519
- var Xe = Object.defineProperty;
4520
- var Qe = (t, e, n2) => e in t ? Xe(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4521
- var R = (t, e, n2) => Qe(t, typeof e != "symbol" ? e + "" : e, n2);
4525
+ var Ye = Object.defineProperty;
4526
+ var Xe = (t, e, n2) => e in t ? Ye(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4527
+ var k = (t, e, n2) => Xe(t, typeof e != "symbol" ? e + "" : e, n2);
4522
4528
  function re(t) {
4523
4529
  return { type: "Immediate", value: t };
4524
4530
  }
4525
4531
  function ht() {
4526
4532
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
4527
4533
  }
4528
- function De(t) {
4534
+ function Ke(t) {
4529
4535
  if (t && typeof globalThis.getPlatforma == "function")
4530
4536
  return globalThis.getPlatforma(t);
4531
4537
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
@@ -4534,7 +4540,7 @@
4534
4540
  function gt() {
4535
4541
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4536
4542
  }
4537
- function h() {
4543
+ function y() {
4538
4544
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4539
4545
  throw new Error("Not in config rendering context");
4540
4546
  }
@@ -4544,17 +4550,17 @@
4544
4550
  if (t in n2.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
4545
4551
  return n2.callbackRegistry[t] = e, true;
4546
4552
  }
4547
- const ce = /* @__PURE__ */ new Map();
4553
+ const de = /* @__PURE__ */ new Map();
4548
4554
  function mt(t, e) {
4549
- t in h().callbackRegistry || (h().callbackRegistry[t] = (n2) => {
4550
- for (const r of ce.get(t))
4555
+ t in y().callbackRegistry || (y().callbackRegistry[t] = (n2) => {
4556
+ for (const r of de.get(t))
4551
4557
  r(n2);
4552
- }, ce.set(t, [])), ce.get(t).push(e);
4558
+ }, de.set(t, [])), de.get(t).push(e);
4553
4559
  }
4554
4560
  class I {
4555
4561
  constructor(e, n2 = (r) => r) {
4556
- R(this, "isResolved", false);
4557
- R(this, "resolvedValue");
4562
+ k(this, "isResolved", false);
4563
+ k(this, "resolvedValue");
4558
4564
  this.handle = e, this.postProcess = n2, mt(e, (r) => {
4559
4565
  this.resolvedValue = n2(r), this.isResolved = true;
4560
4566
  });
@@ -4572,10 +4578,10 @@
4572
4578
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4573
4579
  }
4574
4580
  }
4575
- function he(t, e) {
4581
+ function ge(t, e) {
4576
4582
  return t === void 0 ? void 0 : e(t);
4577
4583
  }
4578
- class O {
4584
+ class E {
4579
4585
  constructor(e, n2) {
4580
4586
  this.handle = e, this.resolvePath = n2;
4581
4587
  }
@@ -4614,47 +4620,47 @@
4614
4620
  ...this.resolvePath,
4615
4621
  ...n2.map((i) => typeof i == "string" ? i : i.field)
4616
4622
  ];
4617
- return he(
4618
- h().resolveWithCommon(this.handle, e, ...n2),
4619
- (i) => new O(i, r)
4623
+ return ge(
4624
+ y().resolveWithCommon(this.handle, e, ...n2),
4625
+ (i) => new E(i, r)
4620
4626
  );
4621
4627
  }
4622
4628
  get resourceType() {
4623
- return h().getResourceType(this.handle);
4629
+ return y().getResourceType(this.handle);
4624
4630
  }
4625
4631
  getInputsLocked() {
4626
- return h().getInputsLocked(this.handle);
4632
+ return y().getInputsLocked(this.handle);
4627
4633
  }
4628
4634
  getOutputsLocked() {
4629
- return h().getOutputsLocked(this.handle);
4635
+ return y().getOutputsLocked(this.handle);
4630
4636
  }
4631
4637
  getIsReadyOrError() {
4632
- return h().getIsReadyOrError(this.handle);
4638
+ return y().getIsReadyOrError(this.handle);
4633
4639
  }
4634
4640
  getIsFinal() {
4635
- return h().getIsFinal(this.handle);
4641
+ return y().getIsFinal(this.handle);
4636
4642
  }
4637
4643
  getError() {
4638
4644
  const e = [...this.resolvePath, "error"];
4639
- return he(
4640
- h().getError(this.handle),
4641
- (n2) => new O(n2, e)
4645
+ return ge(
4646
+ y().getError(this.handle),
4647
+ (n2) => new E(n2, e)
4642
4648
  );
4643
4649
  }
4644
4650
  listInputFields() {
4645
- return h().listInputFields(this.handle);
4651
+ return y().listInputFields(this.handle);
4646
4652
  }
4647
4653
  listOutputFields() {
4648
- return h().listOutputFields(this.handle);
4654
+ return y().listOutputFields(this.handle);
4649
4655
  }
4650
4656
  listDynamicFields() {
4651
- return h().listDynamicFields(this.handle);
4657
+ return y().listDynamicFields(this.handle);
4652
4658
  }
4653
4659
  getKeyValueBase64(e) {
4654
- return h().getKeyValueBase64(this.handle, e);
4660
+ return y().getKeyValueBase64(this.handle, e);
4655
4661
  }
4656
4662
  getKeyValueAsString(e) {
4657
- return h().getKeyValueAsString(this.handle, e);
4663
+ return y().getKeyValueAsString(this.handle, e);
4658
4664
  }
4659
4665
  getKeyValueAsJson(e) {
4660
4666
  const n2 = this.getKeyValueAsString(e);
@@ -4662,10 +4668,10 @@
4662
4668
  return JSON.parse(n2);
4663
4669
  }
4664
4670
  getDataBase64() {
4665
- return h().getDataBase64(this.handle);
4671
+ return y().getDataBase64(this.handle);
4666
4672
  }
4667
4673
  getDataAsString() {
4668
- return h().getDataAsString(this.handle);
4674
+ return y().getDataAsString(this.handle);
4669
4675
  }
4670
4676
  getDataAsJson() {
4671
4677
  const e = this.getDataAsString();
@@ -4678,7 +4684,7 @@
4678
4684
  getPColumns(e = false, n2 = "") {
4679
4685
  const r = this.parsePObjectCollection(e, n2);
4680
4686
  return r === void 0 ? void 0 : Object.entries(r).map(([, s2]) => {
4681
- if (!Z$1(s2)) throw new Error(`not a PColumn (kind = ${s2.spec.kind})`);
4687
+ if (!rn(s2)) throw new Error(`not a PColumn (kind = ${s2.spec.kind})`);
4682
4688
  return s2;
4683
4689
  });
4684
4690
  }
@@ -4686,7 +4692,7 @@
4686
4692
  *
4687
4693
  */
4688
4694
  parsePObjectCollection(e = false, n2 = "") {
4689
- const r = h().parsePObjectCollection(
4695
+ const r = y().parsePObjectCollection(
4690
4696
  this.handle,
4691
4697
  e,
4692
4698
  n2,
@@ -4696,19 +4702,19 @@
4696
4702
  const i = {};
4697
4703
  for (const [s2, o] of Object.entries(r)) {
4698
4704
  const a = [...this.resolvePath, s2];
4699
- i[s2] = Kn(o, (l2) => new O(l2, a));
4705
+ i[s2] = Wn(o, (l2) => new E(l2, a));
4700
4706
  }
4701
4707
  return i;
4702
4708
  }
4703
4709
  getFileContentAsBase64(e) {
4704
- return new I(h().getBlobContentAsBase64(this.handle, e));
4710
+ return new I(y().getBlobContentAsBase64(this.handle, e));
4705
4711
  }
4706
4712
  getFileContentAsString(e) {
4707
- return new I(h().getBlobContentAsString(this.handle, e));
4713
+ return new I(y().getBlobContentAsString(this.handle, e));
4708
4714
  }
4709
4715
  getFileContentAsJson(e) {
4710
4716
  return new I(
4711
- h().getBlobContentAsString(this.handle, e)
4717
+ y().getBlobContentAsString(this.handle, e)
4712
4718
  ).mapDefined((n2) => JSON.parse(n2));
4713
4719
  }
4714
4720
  /**
@@ -4727,7 +4733,7 @@
4727
4733
  * @returns downloaded file handle
4728
4734
  */
4729
4735
  getFileHandle() {
4730
- return new I(h().getDownloadedBlobContentHandle(this.handle));
4736
+ return new I(y().getDownloadedBlobContentHandle(this.handle));
4731
4737
  }
4732
4738
  /**
4733
4739
  * @deprecated use getFileHandle
@@ -4739,7 +4745,7 @@
4739
4745
  * @returns downloaded file handle
4740
4746
  */
4741
4747
  getRemoteFileHandle() {
4742
- return new I(h().getOnDemandBlobContentHandle(this.handle));
4748
+ return new I(y().getOnDemandBlobContentHandle(this.handle));
4743
4749
  }
4744
4750
  /**
4745
4751
  * @deprecated use getRemoteFileHandle
@@ -4751,22 +4757,22 @@
4751
4757
  * @returns the url to the extracted folder
4752
4758
  */
4753
4759
  extractArchiveAndGetURL(e) {
4754
- return new I(h().extractArchiveAndGetURL(this.handle, e));
4760
+ return new I(y().extractArchiveAndGetURL(this.handle, e));
4755
4761
  }
4756
4762
  getImportProgress() {
4757
- return new I(h().getImportProgress(this.handle));
4763
+ return new I(y().getImportProgress(this.handle));
4758
4764
  }
4759
4765
  getLastLogs(e) {
4760
- return new I(h().getLastLogs(this.handle, e));
4766
+ return new I(y().getLastLogs(this.handle, e));
4761
4767
  }
4762
4768
  getProgressLog(e) {
4763
- return new I(h().getProgressLog(this.handle, e));
4769
+ return new I(y().getProgressLog(this.handle, e));
4764
4770
  }
4765
4771
  getProgressLogWithInfo(e) {
4766
- return new I(h().getProgressLogWithInfo(this.handle, e));
4772
+ return new I(y().getProgressLogWithInfo(this.handle, e));
4767
4773
  }
4768
4774
  getLogHandle() {
4769
- return new I(h().getLogHandle(this.handle));
4775
+ return new I(y().getLogHandle(this.handle));
4770
4776
  }
4771
4777
  allFieldsResolved(e = "Input") {
4772
4778
  switch (e) {
@@ -4792,91 +4798,91 @@
4792
4798
  let l2 = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4793
4799
  (u2) => [u2, this.resolve({ field: u2, assertFieldType: r })]
4794
4800
  );
4795
- return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, d]) => o(u2, d));
4796
- }
4797
- }
4798
- const Fe = "staging", Ke = "main";
4799
- const bt = "pl7.app/label", wt = "pl7.app/trace", At = z$2.object({
4800
- type: z$2.string(),
4801
- importance: z$2.number().optional(),
4802
- id: z$2.string().optional(),
4803
- label: z$2.string()
4804
- }), xt = z$2.array(At), Ct = 1e-3, Pt = "__LABEL__", Se = "__LABEL__@1";
4805
- function Ve(t, e, n2 = {}) {
4806
- const r = /* @__PURE__ */ new Map(), i = n2.forceTraceElements !== void 0 && n2.forceTraceElements.length > 0 ? new Set(n2.forceTraceElements) : void 0, s2 = /* @__PURE__ */ new Map(), o = t.map((f2) => {
4807
- var S, D2;
4808
- const w2 = e(f2);
4809
- let c2, g, x2;
4810
- "spec" in w2 && typeof w2.spec == "object" ? (c2 = w2.spec, g = w2.prefixTrace, x2 = w2.suffixTrace) : c2 = w2;
4811
- const p2 = (S = c2.annotations) == null ? void 0 : S[bt], A2 = (D2 = c2.annotations) == null ? void 0 : D2[wt], m2 = (A2 ? xt.safeParse(JSON.parse(A2)).data : void 0) ?? [], v = [
4812
- ...g ?? [],
4813
- ...m2,
4814
- ...x2 ?? []
4801
+ return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, c2]) => o(u2, c2));
4802
+ }
4803
+ }
4804
+ const Ve = "staging", je = "main";
4805
+ const bt = "pl7.app/label", wt = "pl7.app/trace", At = z$1.object({
4806
+ type: z$1.string(),
4807
+ importance: z$1.number().optional(),
4808
+ id: z$1.string().optional(),
4809
+ label: z$1.string()
4810
+ }), xt = z$1.array(At), Ct = 1e-3, Pt = "__LABEL__", Te = "__LABEL__@1";
4811
+ function $e(t, e, n2 = {}) {
4812
+ const r = /* @__PURE__ */ new Map(), i = n2.forceTraceElements !== void 0 && n2.forceTraceElements.length > 0 ? new Set(n2.forceTraceElements) : void 0, s2 = /* @__PURE__ */ new Map(), o = t.map((p2) => {
4813
+ var S, F;
4814
+ const m2 = e(p2);
4815
+ let f2, v, b;
4816
+ "spec" in m2 && typeof m2.spec == "object" ? (f2 = m2.spec, v = m2.prefixTrace, b = m2.suffixTrace) : f2 = m2;
4817
+ const g = (S = f2.annotations) == null ? void 0 : S[bt], x = (F = f2.annotations) == null ? void 0 : F[wt], A = (x ? xt.safeParse(JSON.parse(x)).data : void 0) ?? [], C = [
4818
+ ...v ?? [],
4819
+ ...A,
4820
+ ...b ?? []
4815
4821
  ];
4816
- if (p2 !== void 0) {
4817
- const k2 = { label: p2, type: Pt, importance: -2 };
4818
- n2.addLabelAsSuffix ? v.push(k2) : v.splice(0, 0, k2);
4819
- }
4820
- const C2 = [], L = /* @__PURE__ */ new Map();
4821
- for (let k2 = v.length - 1; k2 >= 0; --k2) {
4822
- const { type: W } = v[k2], V = v[k2].importance ?? 0, N2 = (L.get(W) ?? 0) + 1;
4823
- L.set(W, N2);
4824
- const j = `${W}@${N2}`;
4825
- s2.set(j, (s2.get(j) ?? 0) + 1), r.set(
4826
- j,
4822
+ if (g !== void 0) {
4823
+ const D = { label: g, type: Pt, importance: -2 };
4824
+ n2.addLabelAsSuffix ? C.push(D) : C.splice(0, 0, D);
4825
+ }
4826
+ const w2 = [], T = /* @__PURE__ */ new Map();
4827
+ for (let D = C.length - 1; D >= 0; --D) {
4828
+ const { type: W } = C[D], j2 = C[D].importance ?? 0, $ = (T.get(W) ?? 0) + 1;
4829
+ T.set(W, $);
4830
+ const K2 = `${W}@${$}`;
4831
+ s2.set(K2, (s2.get(K2) ?? 0) + 1), r.set(
4832
+ K2,
4827
4833
  Math.max(
4828
- r.get(j) ?? Number.NEGATIVE_INFINITY,
4829
- V - (v.length - k2) * Ct
4834
+ r.get(K2) ?? Number.NEGATIVE_INFINITY,
4835
+ j2 - (C.length - D) * Ct
4830
4836
  )
4831
- ), C2.push({ ...v[k2], fullType: j, occurrenceIndex: N2 });
4837
+ ), w2.push({ ...C[D], fullType: K2, occurrenceIndex: $ });
4832
4838
  }
4833
- return C2.reverse(), {
4834
- value: f2,
4835
- spec: c2,
4836
- label: p2,
4837
- fullTrace: C2
4839
+ return w2.reverse(), {
4840
+ value: p2,
4841
+ spec: f2,
4842
+ label: g,
4843
+ fullTrace: w2
4838
4844
  };
4839
4845
  }), a = [], l2 = [], u2 = [...r];
4840
- u2.sort(([, f2], [, w2]) => w2 - f2);
4841
- for (const [f2] of u2)
4842
- f2.endsWith("@1") || s2.get(f2) === t.length ? a.push(f2) : l2.push(f2);
4843
- const d = (f2, w2 = false) => {
4844
- const c2 = [];
4845
- for (let g = 0; g < o.length; g++) {
4846
- const x2 = o[g], p2 = x2.fullTrace.filter((v) => f2.has(v.fullType) || i && i.has(v.type));
4847
- if (p2.length === 0)
4848
- if (w2)
4849
- c2.push({
4846
+ u2.sort(([, p2], [, m2]) => m2 - p2);
4847
+ for (const [p2] of u2)
4848
+ p2.endsWith("@1") || s2.get(p2) === t.length ? a.push(p2) : l2.push(p2);
4849
+ const c2 = (p2, m2 = false) => {
4850
+ const f2 = [];
4851
+ for (let v = 0; v < o.length; v++) {
4852
+ const b = o[v], g = b.fullTrace.filter((C) => p2.has(C.fullType) || i && i.has(C.type));
4853
+ if (g.length === 0)
4854
+ if (m2)
4855
+ f2.push({
4850
4856
  label: "Unlabeled",
4851
- value: x2.value
4857
+ value: b.value
4852
4858
  });
4853
4859
  else return;
4854
- const A2 = p2.map((v) => v.label), m2 = n2.separator ?? " / ";
4855
- c2.push({
4856
- label: A2.join(m2),
4857
- value: x2.value
4860
+ const x = g.map((C) => C.label), A = n2.separator ?? " / ";
4861
+ f2.push({
4862
+ label: x.join(A),
4863
+ value: b.value
4858
4864
  });
4859
4865
  }
4860
- return c2;
4866
+ return f2;
4861
4867
  };
4862
4868
  if (a.length === 0) {
4863
4869
  if (l2.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
4864
- return d(new Set(Se), true);
4865
- }
4866
- let y = 0, b = -1;
4867
- for (; y < a.length; ) {
4868
- const f2 = /* @__PURE__ */ new Set();
4869
- n2.includeNativeLabel && f2.add(Se);
4870
- for (let c2 = 0; c2 < y; ++c2) f2.add(a[c2]);
4871
- b >= 0 && f2.add(a[b]);
4872
- const w2 = d(f2);
4873
- if (w2 !== void 0 && new Set(w2.map((c2) => c2.label)).size === t.length) return w2;
4874
- b++, b >= a.length && (y++, b = y);
4875
- }
4876
- return d(/* @__PURE__ */ new Set([...a, ...l2]), true);
4877
- }
4878
- const Z = "PColumnData/", se = Z + "ResourceMap", oe = Z + "Partitioned/ResourceMap", q = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", $e = Z + "Partitioned/", ae = $e + "JsonPartitioned", z = $e + "BinaryPartitioned";
4879
- const me = (t) => {
4870
+ return c2(new Set(Te), true);
4871
+ }
4872
+ let d = 0, h2 = -1;
4873
+ for (; d < a.length; ) {
4874
+ const p2 = /* @__PURE__ */ new Set();
4875
+ n2.includeNativeLabel && p2.add(Te);
4876
+ for (let f2 = 0; f2 < d; ++f2) p2.add(a[f2]);
4877
+ h2 >= 0 && p2.add(a[h2]);
4878
+ const m2 = c2(p2);
4879
+ if (m2 !== void 0 && new Set(m2.map((f2) => f2.label)).size === t.length) return m2;
4880
+ h2++, h2 >= a.length && (d++, h2 = d);
4881
+ }
4882
+ return c2(/* @__PURE__ */ new Set([...a, ...l2]), true);
4883
+ }
4884
+ const Z = "PColumnData/", se = Z + "ResourceMap", oe = Z + "Partitioned/ResourceMap", q = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", Je = Z + "Partitioned/", ae = Je + "JsonPartitioned", z = Je + "BinaryPartitioned";
4885
+ const ye = (t) => {
4880
4886
  if (t.endsWith(".index"))
4881
4887
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
4882
4888
  if (t.endsWith(".values"))
@@ -4908,7 +4914,7 @@
4908
4914
  case q:
4909
4915
  case B:
4910
4916
  for (let s2 of t.listInputFields()) {
4911
- e === B && (s2 = me(s2).baseKey);
4917
+ e === B && (s2 = ye(s2).baseKey);
4912
4918
  const o = [...JSON.parse(s2)];
4913
4919
  r.push(o);
4914
4920
  }
@@ -4920,7 +4926,7 @@
4920
4926
  const o = [...JSON.parse(s2)], a = t.resolve({ field: s2, assertFieldType: "Input" });
4921
4927
  if (a !== void 0)
4922
4928
  for (let l2 of a.listInputFields()) {
4923
- e === z && (l2 = me(l2).baseKey);
4929
+ e === z && (l2 = ye(l2).baseKey);
4924
4930
  const u2 = [...o, ...JSON.parse(l2)];
4925
4931
  r.push(u2);
4926
4932
  }
@@ -4950,7 +4956,7 @@
4950
4956
  }
4951
4957
  function It(t) {
4952
4958
  if (t === void 0) return;
4953
- if (F(t))
4959
+ if (K(t))
4954
4960
  return _t(t);
4955
4961
  const e = St(t);
4956
4962
  if (!e) return;
@@ -4965,7 +4971,7 @@
4965
4971
  }
4966
4972
  return i.map((s2) => Array.from(s2.values()));
4967
4973
  }
4968
- function ye(t, e = []) {
4974
+ function ve(t, e = []) {
4969
4975
  if (t === void 0 || !t.getIsReadyOrError()) return;
4970
4976
  const n2 = t.resourceType.name, r = t.getDataAsJson();
4971
4977
  if (e.length > 0 && (n2 === ae || n2 === z))
@@ -4995,7 +5001,7 @@
4995
5001
  throw new Error(`Missing partitionKeyLength in metadata for ${n2}`);
4996
5002
  const i = [], s2 = /* @__PURE__ */ new Map();
4997
5003
  for (const o of t.listInputFields()) {
4998
- const a = me(o), l2 = t.resolve({ field: o, assertFieldType: "Input" });
5004
+ const a = ye(o), l2 = t.resolve({ field: o, assertFieldType: "Input" });
4999
5005
  if (l2 === void 0) return;
5000
5006
  let u2 = s2.get(a.baseKey);
5001
5007
  u2 || (u2 = {}, s2.set(a.baseKey, u2)), a.type === "index" ? u2.index = l2 : u2.values = l2;
@@ -5026,7 +5032,7 @@
5026
5032
  if (a === void 0) return;
5027
5033
  if (a.resourceType.name !== q)
5028
5034
  throw new Error(`Expected ${q} inside ${n2}, but got ${a.resourceType.name}`);
5029
- const l2 = ye(a, JSON.parse(o));
5035
+ const l2 = ve(a, JSON.parse(o));
5030
5036
  if (l2 === void 0) return;
5031
5037
  if (l2.type !== "JsonPartitioned")
5032
5038
  throw new Error(`Unexpected inner result type for ${n2}: ${l2.type}`);
@@ -5047,7 +5053,7 @@
5047
5053
  if (a === void 0) return;
5048
5054
  if (a.resourceType.name !== B)
5049
5055
  throw new Error(`Expected ${B} inside ${n2}, but got ${a.resourceType.name}`);
5050
- const l2 = ye(a, JSON.parse(o));
5056
+ const l2 = ve(a, JSON.parse(o));
5051
5057
  if (l2 === void 0) return;
5052
5058
  if (l2.type !== "BinaryPartitioned")
5053
5059
  throw new Error(`Unexpected inner result type for ${n2}: ${l2.type}`);
@@ -5065,9 +5071,9 @@
5065
5071
  }
5066
5072
  function Tt(t) {
5067
5073
  if (t !== void 0) {
5068
- if (F(t)) return t;
5069
- if (yn(t)) return bn(t);
5070
- if (t instanceof O) return ye(t);
5074
+ if (K(t)) return t;
5075
+ if (En(t)) return Cn(t);
5076
+ if (t instanceof E) return ve(t);
5071
5077
  throw new Error(`Unexpected input type: ${typeof t}`);
5072
5078
  }
5073
5079
  }
@@ -5131,39 +5137,45 @@
5131
5137
  }
5132
5138
  }
5133
5139
  }
5134
- class Et {
5140
+ function Et(t) {
5141
+ if (!Array.isArray(t)) return false;
5142
+ if (t.length === 0) return true;
5143
+ const e = t[0];
5144
+ return typeof e == "object" && e !== null && "key" in e && "val" in e;
5145
+ }
5146
+ class Dt {
5135
5147
  constructor(e) {
5136
5148
  this.columns = e;
5137
5149
  }
5138
5150
  selectColumns(e) {
5139
- const n2 = typeof e == "function" ? e : vn(e);
5151
+ const n2 = typeof e == "function" ? e : Gn(e);
5140
5152
  return this.columns.filter((r) => n2(r.spec));
5141
5153
  }
5142
5154
  }
5143
- function Ot(t) {
5155
+ function kt(t) {
5144
5156
  if (t)
5145
5157
  return t.map((e) => ({
5146
- type: `split:${$n(e.axisId)}`,
5158
+ type: `split:${Rn(e.axisId)}`,
5147
5159
  label: e.label,
5148
5160
  importance: 1e6
5149
5161
  // High importance for split filters in labels
5150
5162
  }));
5151
5163
  }
5152
- function kt(t) {
5164
+ function Ot(t) {
5153
5165
  if (t)
5154
5166
  return t.map((e) => [e.axisIdx, e.value]);
5155
5167
  }
5156
5168
  function Rt(t, e) {
5157
5169
  if (!e || e.length === 0) return t;
5158
5170
  const n2 = [...e].sort((r, i) => r[0] - i[0]);
5159
- return ke({ id: t, axisFilters: n2 });
5171
+ return Re({ id: t, axisFilters: n2 });
5160
5172
  }
5161
- function _e(t) {
5173
+ function Le(t) {
5162
5174
  if (!t || typeof t != "object") return false;
5163
5175
  const e = t, n2 = 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);
5164
5176
  return !!e.domainAnchor || n2 || r;
5165
5177
  }
5166
- function Dt(t) {
5178
+ function Ft(t) {
5167
5179
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
5168
5180
  return [];
5169
5181
  const e = t.axes.map((n2, r) => typeof n2 == "object" && "split" in n2 && n2.split === true ? r : -1).filter((n2) => n2 !== -1);
@@ -5171,11 +5183,11 @@
5171
5183
  throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
5172
5184
  return e.sort((n2, r) => n2 - r), e;
5173
5185
  }
5174
- class ve {
5186
+ class le {
5175
5187
  constructor() {
5176
- R(this, "defaultProviderStore", []);
5177
- R(this, "providers", [new Et(this.defaultProviderStore)]);
5178
- R(this, "axisLabelProviders", []);
5188
+ k(this, "defaultProviderStore", []);
5189
+ k(this, "providers", [new Dt(this.defaultProviderStore)]);
5190
+ k(this, "axisLabelProviders", []);
5179
5191
  }
5180
5192
  addColumnProvider(e) {
5181
5193
  return this.providers.push(e), this;
@@ -5203,127 +5215,129 @@
5203
5215
  };
5204
5216
  let u2 = () => false;
5205
5217
  if (a) {
5206
- const c2 = (Array.isArray(a) ? a : [a]).map((g) => {
5207
- if (_e(g)) {
5218
+ const f2 = (Array.isArray(a) ? a : [a]).map((v) => {
5219
+ if (Le(v)) {
5208
5220
  if (!r)
5209
5221
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
5210
- return vn(Vn(r.anchors, g, n2));
5222
+ return Gn(Mn(r.anchors, v, n2));
5211
5223
  } else
5212
- return vn(g);
5224
+ return Gn(v);
5213
5225
  });
5214
- u2 = (g) => c2.some((x2) => x2(g));
5226
+ u2 = (v) => f2.some((b) => b(v));
5215
5227
  }
5216
- const d = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], y = [], b = /* @__PURE__ */ new Set();
5217
- for (const c2 of d) {
5218
- const g = _e(c2);
5219
- let x2;
5220
- if (g) {
5228
+ const c2 = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], d = [], h2 = /* @__PURE__ */ new Set();
5229
+ for (const f$1 of c2) {
5230
+ const v = Le(f$1);
5231
+ let b;
5232
+ if (v) {
5221
5233
  if (!r)
5222
5234
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
5223
- x2 = Vn(r.anchors, c2, n2);
5235
+ b = Mn(r.anchors, f$1, n2);
5224
5236
  } else
5225
- x2 = c2;
5226
- const p2 = /* @__PURE__ */ new Set(), A2 = [];
5227
- for (const C2 of this.providers) {
5228
- const L = C2.selectColumns(x2);
5229
- for (const S of L) {
5237
+ b = f$1;
5238
+ const g = /* @__PURE__ */ new Set(), x = [];
5239
+ for (const w2 of this.providers) {
5240
+ const T = w2.selectColumns(b);
5241
+ for (const S of T) {
5230
5242
  if (u2(S.spec)) continue;
5231
- if (p2.has(S.id))
5232
- throw new Error(`Duplicate column id ${S.id} in provider ${C2.constructor.name}`);
5233
- const D2 = _n(S.spec);
5234
- b.has(D2) || (p2.add(S.id), b.add(D2), A2.push(S));
5243
+ if (g.has(S.id))
5244
+ throw new Error(`Duplicate column id ${S.id} in provider ${w2.constructor.name}`);
5245
+ const F = Qn(S.spec);
5246
+ h2.has(F) || (g.add(S.id), h2.add(F), x.push(S));
5235
5247
  }
5236
5248
  }
5237
- if (A2.length === 0) continue;
5238
- const m2 = Dt(c2), v = m2.length > 0;
5239
- for (const C2 of A2) {
5240
- if (!f(C2.spec)) continue;
5241
- const L = C2.spec;
5242
- if (v) {
5243
- const S = Tt(C2.data);
5249
+ if (x.length === 0) continue;
5250
+ const A = Ft(f$1), C = A.length > 0;
5251
+ for (const w2 of x) {
5252
+ if (!f(w2.spec)) continue;
5253
+ const T = w2.spec;
5254
+ if (C) {
5255
+ if (Et(w2.data))
5256
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${w2.id}`);
5257
+ const S = Tt(w2.data);
5244
5258
  if (!S) {
5245
5259
  if (s2) continue;
5246
5260
  return;
5247
5261
  }
5248
- if (!gn(S))
5249
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${S.type} for column ${C2.id}`);
5250
- const D2 = It(S), k2 = m2[m2.length - 1];
5251
- if (k2 >= S.partitionKeyLength)
5252
- throw new Error(`Not enough partition keys (${S.partitionKeyLength}) for requested split axes (max index ${k2}) in column ${L.name}`);
5253
- const W = m2.map((_) => this.findLabels(p$1(L.axesSpec[_]))), V = [], N2 = (_, G2) => {
5254
- if (G2 >= m2.length) {
5255
- if (V.push([..._]), V.length > 1e4)
5262
+ if (!Sn(S))
5263
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${S.type} for column ${w2.id}`);
5264
+ const F = It(S), D = A[A.length - 1];
5265
+ if (D >= S.partitionKeyLength)
5266
+ throw new Error(`Not enough partition keys (${S.partitionKeyLength}) for requested split axes (max index ${D}) in column ${T.name}`);
5267
+ const W = A.map((_) => this.findLabels(p$1(T.axesSpec[_]))), j2 = [], $ = (_, G) => {
5268
+ if (G >= A.length) {
5269
+ if (j2.push([..._]), j2.length > 1e4)
5256
5270
  throw new Error("Too many key combinations, aborting.");
5257
5271
  return;
5258
5272
  }
5259
- const $ = m2[G2];
5260
- if ($ >= D2.length)
5261
- throw new Error(`Axis index ${$} out of bounds for unique keys array (length ${D2.length}) during split key generation for column ${C2.id}`);
5262
- const J = D2[$];
5263
- if (!J || J.length === 0) {
5264
- V.length = 0;
5273
+ const N2 = A[G];
5274
+ if (N2 >= F.length)
5275
+ throw new Error(`Axis index ${N2} out of bounds for unique keys array (length ${F.length}) during split key generation for column ${w2.id}`);
5276
+ const J2 = F[N2];
5277
+ if (!J2 || J2.length === 0) {
5278
+ j2.length = 0;
5265
5279
  return;
5266
5280
  }
5267
- for (const ee of J)
5268
- _.push(ee), N2(_, G2 + 1), _.pop();
5281
+ for (const ee of J2)
5282
+ _.push(ee), $(_, G + 1), _.pop();
5269
5283
  };
5270
- if (N2([], 0), V.length === 0)
5284
+ if ($([], 0), j2.length === 0)
5271
5285
  continue;
5272
- const j = [...L.axesSpec], He = m2.map((_) => _);
5273
- for (let _ = m2.length - 1; _ >= 0; _--)
5274
- j.splice(m2[_], 1);
5275
- const qe = { ...L, axesSpec: j };
5276
- for (const _ of V) {
5277
- const G2 = _.map(($, J) => {
5278
- const ee = He[J], ze = p$1(L.axesSpec[ee]), le = W[J], Ye = (le == null ? void 0 : le[$]) ?? String($);
5279
- return { axisIdx: ee, axisId: ze, value: $, label: Ye };
5286
+ const K2 = [...T.axesSpec], Ge = A.map((_) => _);
5287
+ for (let _ = A.length - 1; _ >= 0; _--)
5288
+ K2.splice(A[_], 1);
5289
+ const He = { ...T, axesSpec: K2 };
5290
+ for (const _ of j2) {
5291
+ const G = _.map((N2, J2) => {
5292
+ const ee = Ge[J2], qe = p$1(T.axesSpec[ee]), ce = W[J2], ze = (ce == null ? void 0 : ce[N2]) ?? String(N2);
5293
+ return { axisIdx: ee, axisId: qe, value: N2, label: ze };
5280
5294
  });
5281
- y.push({
5295
+ d.push({
5282
5296
  type: "split",
5283
- originalColumn: C2,
5284
- spec: L,
5285
- adjustedSpec: qe,
5297
+ originalColumn: w2,
5298
+ spec: T,
5299
+ adjustedSpec: He,
5286
5300
  dataEntries: S,
5287
- axisFilters: G2
5301
+ axisFilters: G
5288
5302
  });
5289
5303
  }
5290
5304
  } else
5291
- y.push({
5305
+ d.push({
5292
5306
  type: "direct",
5293
- originalColumn: C2,
5294
- spec: L,
5295
- adjustedSpec: L
5307
+ originalColumn: w2,
5308
+ spec: T,
5309
+ adjustedSpec: T
5296
5310
  });
5297
5311
  }
5298
5312
  }
5299
- if (y.length === 0) return [];
5300
- const f$1 = Ve(
5301
- y,
5302
- (c2) => ({
5303
- spec: c2.spec,
5304
- suffixTrace: c2.type === "split" ? Ot(c2.axisFilters) : void 0
5313
+ if (d.length === 0) return [];
5314
+ const p2 = $e(
5315
+ d,
5316
+ (f2) => ({
5317
+ spec: f2.spec,
5318
+ suffixTrace: f2.type === "split" ? kt(f2.axisFilters) : void 0
5305
5319
  }),
5306
5320
  l2
5307
- ), w2 = [];
5308
- for (const { value: c2, label: g } of f$1) {
5309
- const { originalColumn: x2, spec: p2 } = c2, A2 = c2.type === "split" ? c2.axisFilters : void 0, m2 = kt(A2);
5310
- let v;
5311
- r ? v = r.deriveS(p2, m2) : v = Rt(x2.id, m2);
5312
- let C2 = { ...c2.adjustedSpec };
5313
- o && (C2 = {
5314
- ...C2,
5321
+ ), m2 = [];
5322
+ for (const { value: f2, label: v } of p2) {
5323
+ const { originalColumn: b, spec: g } = f2, x = f2.type === "split" ? f2.axisFilters : void 0, A = Ot(x);
5324
+ let C;
5325
+ r ? C = r.deriveS(g, A) : C = Rt(b.id, A);
5326
+ let w2 = { ...f2.adjustedSpec };
5327
+ o && (w2 = {
5328
+ ...w2,
5315
5329
  annotations: {
5316
- ...C2.annotations ?? {},
5317
- "pl7.app/label": g
5330
+ ...w2.annotations ?? {},
5331
+ "pl7.app/label": v
5318
5332
  }
5319
- }), w2.push({
5320
- id: v,
5321
- spec: C2,
5322
- data: () => c2.type === "split" ? wn(Lt(c2.dataEntries, m2)) : c2.originalColumn.data,
5323
- label: g
5333
+ }), m2.push({
5334
+ id: C,
5335
+ spec: w2,
5336
+ data: () => f2.type === "split" ? Jn(Lt(f2.dataEntries, A)) : f2.originalColumn.data,
5337
+ label: v
5324
5338
  });
5325
5339
  }
5326
- return w2;
5340
+ return m2;
5327
5341
  }
5328
5342
  getColumns(e, n2) {
5329
5343
  const r = this.getUniversalEntries(e, {
@@ -5355,12 +5369,12 @@
5355
5369
  if (t[n2] !== e[n2]) return false;
5356
5370
  return true;
5357
5371
  }
5358
- function Ie(t) {
5359
- return Kn(t, (e) => e instanceof O ? e.handle : yn(e) ? hn(e, (n2) => n2.handle) : e);
5372
+ function Ee(t) {
5373
+ return Wn(t, (e) => e instanceof E ? e.handle : En(e) ? Nn(e, (n2) => n2.handle) : e);
5360
5374
  }
5361
- class Ft {
5375
+ class Kt {
5362
5376
  constructor() {
5363
- R(this, "ctx", h());
5377
+ k(this, "ctx", y());
5364
5378
  }
5365
5379
  /**
5366
5380
  * @deprecated use getOptions()
@@ -5369,28 +5383,28 @@
5369
5383
  return this.ctx.calculateOptions(e);
5370
5384
  }
5371
5385
  getOptions(e, n2) {
5372
- const r = typeof e == "function" ? e : vn(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
5386
+ const r = typeof e == "function" ? e : Gn(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
5373
5387
  let s2 = {}, o = false;
5374
- return typeof n2 < "u" && (typeof n2 == "function" ? s2 = n2 : typeof n2 == "object" && ("includeNativeLabel" in n2 || "separator" in n2 || "addLabelAsSuffix" in n2 ? s2 = n2 : (n2 = n2, s2 = n2.label ?? {}, o = n2.refsWithEnrichments ?? false))), typeof s2 == "object" ? Ve(i, (a) => a.obj, s2 ?? {}).map(({ value: { ref: a }, label: l2 }) => ({
5375
- ref: Wn(a, o),
5388
+ return typeof n2 < "u" && (typeof n2 == "function" ? s2 = n2 : typeof n2 == "object" && ("includeNativeLabel" in n2 || "separator" in n2 || "addLabelAsSuffix" in n2 ? s2 = n2 : (n2 = n2, s2 = n2.label ?? {}, o = n2.refsWithEnrichments ?? false))), typeof s2 == "object" ? $e(i, (a) => a.obj, s2 ?? {}).map(({ value: { ref: a }, label: l2 }) => ({
5389
+ ref: te$1(a, o),
5376
5390
  label: l2
5377
5391
  })) : i.map(({ ref: a, obj: l2 }) => ({
5378
- ref: Wn(a, o),
5392
+ ref: te$1(a, o),
5379
5393
  label: s2(l2, a)
5380
5394
  }));
5381
5395
  }
5382
5396
  resolveAnchorCtx(e) {
5383
- if (e instanceof Ln) return e;
5397
+ if (e instanceof _n) return e;
5384
5398
  const n2 = {};
5385
5399
  for (const [r, i] of Object.entries(e))
5386
- if (Hn(i)) {
5400
+ if (ne(i)) {
5387
5401
  const s2 = this.getPColumnSpecByRef(i);
5388
5402
  if (!s2)
5389
5403
  return;
5390
5404
  n2[r] = s2;
5391
5405
  } else
5392
5406
  n2[r] = i;
5393
- return new Ln(n2);
5407
+ return new _n(n2);
5394
5408
  }
5395
5409
  /**
5396
5410
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -5403,7 +5417,7 @@
5403
5417
  getAnchoredPColumns(e, n2, r) {
5404
5418
  const i = this.resolveAnchorCtx(e);
5405
5419
  if (i)
5406
- return new ve().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n2, {
5420
+ return new le().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n2, {
5407
5421
  ...r,
5408
5422
  anchorCtx: i
5409
5423
  });
@@ -5440,7 +5454,7 @@
5440
5454
  getCanonicalOptions(e, n2, r) {
5441
5455
  const i = this.resolveAnchorCtx(e);
5442
5456
  if (!i) return;
5443
- const s2 = new ve().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n2, {
5457
+ const s2 = new le().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n2, {
5444
5458
  ...r,
5445
5459
  anchorCtx: i
5446
5460
  });
@@ -5464,7 +5478,7 @@
5464
5478
  ref: n2.ref,
5465
5479
  obj: {
5466
5480
  ...n2.obj,
5467
- data: new O(n2.obj.data, [n2.ref.blockId, n2.ref.name])
5481
+ data: new E(n2.obj.data, [n2.ref.blockId, n2.ref.name])
5468
5482
  }
5469
5483
  }))
5470
5484
  };
@@ -5483,9 +5497,9 @@
5483
5497
  ref: n2.ref,
5484
5498
  obj: {
5485
5499
  ...n2.obj,
5486
- data: Xn(
5500
+ data: oe$1(
5487
5501
  n2.obj.data,
5488
- (r) => new O(r, [n2.ref.blockId, n2.ref.name])
5502
+ (r) => new E(r, [n2.ref.blockId, n2.ref.name])
5489
5503
  )
5490
5504
  }
5491
5505
  }))
@@ -5512,9 +5526,9 @@
5512
5526
  )) == null ? void 0 : r.obj;
5513
5527
  const n2 = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
5514
5528
  if (n2)
5515
- return Kn(
5529
+ return Wn(
5516
5530
  n2,
5517
- (i) => new O(i, [e.blockId, e.name])
5531
+ (i) => new E(i, [e.blockId, e.name])
5518
5532
  );
5519
5533
  }
5520
5534
  /**
@@ -5525,7 +5539,7 @@
5525
5539
  getPColumnByRef(e) {
5526
5540
  const n2 = this.getDataByRef(e);
5527
5541
  if (n2)
5528
- return Un(n2);
5542
+ return qn(n2);
5529
5543
  }
5530
5544
  /**
5531
5545
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -5575,7 +5589,7 @@
5575
5589
  findLabels(e) {
5576
5590
  const n2 = this.getData();
5577
5591
  for (const r of n2.entries) {
5578
- if (!Z$1(r.obj)) continue;
5592
+ if (!rn(r.obj)) continue;
5579
5593
  const i = r.obj.spec;
5580
5594
  if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && pe(e.domain, i.axesSpec[0].domain)) {
5581
5595
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
@@ -5596,13 +5610,13 @@
5596
5610
  * @returns An array of PColumn objects matching the selectors. Data is loaded on first access.
5597
5611
  */
5598
5612
  selectColumns(e) {
5599
- const n2 = typeof e == "function" ? e : vn(e);
5613
+ const n2 = typeof e == "function" ? e : Gn(e);
5600
5614
  return this.getSpecs().entries.filter(({ obj: i }) => f(i) ? n2(i) : false).map(({ ref: i, obj: s2 }) => {
5601
5615
  const o = s2;
5602
5616
  let a = null;
5603
5617
  const l2 = this;
5604
5618
  return {
5605
- id: ke(i),
5619
+ id: Re(i),
5606
5620
  spec: o,
5607
5621
  get data() {
5608
5622
  var u2;
@@ -5629,12 +5643,12 @@
5629
5643
  }
5630
5644
  class te {
5631
5645
  constructor() {
5632
- R(this, "ctx");
5633
- R(this, "args");
5634
- R(this, "uiState");
5635
- R(this, "_activeArgsCache");
5636
- R(this, "resultPool", new Ft());
5637
- this.ctx = h(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
5646
+ k(this, "ctx");
5647
+ k(this, "args");
5648
+ k(this, "uiState");
5649
+ k(this, "_activeArgsCache");
5650
+ k(this, "resultPool", new Kt());
5651
+ this.ctx = y(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
5638
5652
  }
5639
5653
  /**
5640
5654
  * Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
@@ -5650,16 +5664,16 @@
5650
5664
  // return this.ctx.featureFlags;
5651
5665
  // }
5652
5666
  getNamedAccessor(e) {
5653
- return he(
5667
+ return ge(
5654
5668
  this.ctx.getAccessorHandleByName(e),
5655
- (n2) => new O(n2, [e])
5669
+ (n2) => new E(n2, [e])
5656
5670
  );
5657
5671
  }
5658
5672
  get prerun() {
5659
- return this.getNamedAccessor(Fe);
5673
+ return this.getNamedAccessor(Ve);
5660
5674
  }
5661
5675
  get outputs() {
5662
- return this.getNamedAccessor(Ke);
5676
+ return this.getNamedAccessor(je);
5663
5677
  }
5664
5678
  /**
5665
5679
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -5671,13 +5685,13 @@
5671
5685
  }
5672
5686
  verifyInlineAndExplicitColumnsSupport(e) {
5673
5687
  var i;
5674
- const n2 = e.some((s2) => !(s2.data instanceof O) || yn(s2.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
5688
+ const n2 = e.some((s2) => !(s2.data instanceof E) || En(s2.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
5675
5689
  if (n2 && !r) throw Error("Inline or explicit columns not supported");
5676
5690
  }
5677
5691
  // TODO remove all non-PColumn fields
5678
5692
  createPFrame(e) {
5679
5693
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
5680
- e.map((n2) => Ie(n2))
5694
+ e.map((n2) => Ee(n2))
5681
5695
  );
5682
5696
  }
5683
5697
  createPTable(e) {
@@ -5689,8 +5703,8 @@
5689
5703
  },
5690
5704
  filters: e.filters ?? [],
5691
5705
  sorting: e.sorting ?? []
5692
- } : n2 = e, this.verifyInlineAndExplicitColumnsSupport(Rn(n2.src)), this.ctx.createPTable(
5693
- In(n2, (r) => Ie(r))
5706
+ } : n2 = e, this.verifyInlineAndExplicitColumnsSupport(Xn(n2.src)), this.ctx.createPTable(
5707
+ Un(n2, (r) => Ee(r))
5694
5708
  );
5695
5709
  }
5696
5710
  /** @deprecated scheduled for removal from SDK */
@@ -5710,20 +5724,20 @@
5710
5724
  this.ctx.logError(e);
5711
5725
  }
5712
5726
  }
5713
- const Y = "1.32.1";
5714
- function Kt(t) {
5727
+ const Y = "1.37.2";
5728
+ function Vt(t) {
5715
5729
  return t.__renderLambda === true;
5716
5730
  }
5717
- function de(t) {
5731
+ function fe(t) {
5718
5732
  if (t !== void 0)
5719
- return Kt(t) ? t.handle : t;
5733
+ return Vt(t) ? t.handle : t;
5720
5734
  }
5721
- class E {
5735
+ class L {
5722
5736
  constructor(e, n2, r, i, s2, o, a, l2) {
5723
5737
  this._renderingMode = e, this._initialArgs = n2, this._initialUiState = r, this._outputs = i, this._inputsValid = s2, this._sections = o, this._title = a, this._enrichmentTargets = l2;
5724
5738
  }
5725
5739
  static create(e = "Heavy") {
5726
- return new E(
5740
+ return new L(
5727
5741
  e,
5728
5742
  void 0,
5729
5743
  {},
@@ -5737,7 +5751,7 @@
5737
5751
  output(e, n2, r = {}) {
5738
5752
  if (typeof n2 == "function") {
5739
5753
  const i = `output#${e}`;
5740
- return H(i, () => n2(new te())), new E(
5754
+ return H(i, () => n2(new te())), new L(
5741
5755
  this._renderingMode,
5742
5756
  this._initialArgs,
5743
5757
  this._initialUiState,
@@ -5755,7 +5769,7 @@
5755
5769
  this._enrichmentTargets
5756
5770
  );
5757
5771
  } else
5758
- return new E(
5772
+ return new L(
5759
5773
  this._renderingMode,
5760
5774
  this._initialArgs,
5761
5775
  this._initialUiState,
@@ -5774,7 +5788,7 @@
5774
5788
  return this.output(e, n2, { retentive: true });
5775
5789
  }
5776
5790
  argsValid(e) {
5777
- return typeof e == "function" ? (H("inputsValid", () => e(new te())), new E(
5791
+ return typeof e == "function" ? (H("inputsValid", () => e(new te())), new L(
5778
5792
  this._renderingMode,
5779
5793
  this._initialArgs,
5780
5794
  this._initialUiState,
@@ -5786,7 +5800,7 @@
5786
5800
  this._sections,
5787
5801
  this._title,
5788
5802
  this._enrichmentTargets
5789
- )) : new E(
5803
+ )) : new L(
5790
5804
  this._renderingMode,
5791
5805
  this._initialArgs,
5792
5806
  this._initialUiState,
@@ -5798,7 +5812,7 @@
5798
5812
  );
5799
5813
  }
5800
5814
  sections(e) {
5801
- return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new E(
5815
+ return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new L(
5802
5816
  this._renderingMode,
5803
5817
  this._initialArgs,
5804
5818
  this._initialUiState,
@@ -5807,7 +5821,7 @@
5807
5821
  { __renderLambda: true, handle: "sections" },
5808
5822
  this._title,
5809
5823
  this._enrichmentTargets
5810
- )) : new E(
5824
+ )) : new L(
5811
5825
  this._renderingMode,
5812
5826
  this._initialArgs,
5813
5827
  this._initialUiState,
@@ -5820,7 +5834,7 @@
5820
5834
  }
5821
5835
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
5822
5836
  title(e) {
5823
- return H("title", () => e(new te())), new E(
5837
+ return H("title", () => e(new te())), new L(
5824
5838
  this._renderingMode,
5825
5839
  this._initialArgs,
5826
5840
  this._initialUiState,
@@ -5836,7 +5850,7 @@
5836
5850
  * @deprecated use {@link withArgs}
5837
5851
  * */
5838
5852
  initialArgs(e) {
5839
- return new E(
5853
+ return new L(
5840
5854
  this._renderingMode,
5841
5855
  e,
5842
5856
  this._initialUiState,
@@ -5849,7 +5863,7 @@
5849
5863
  }
5850
5864
  /** Sets initial args for the block, this value must be specified. */
5851
5865
  withArgs(e) {
5852
- return new E(
5866
+ return new L(
5853
5867
  this._renderingMode,
5854
5868
  e,
5855
5869
  this._initialUiState,
@@ -5862,7 +5876,7 @@
5862
5876
  }
5863
5877
  /** Defines type and sets initial value for block UiState. */
5864
5878
  withUiState(e) {
5865
- return new E(
5879
+ return new L(
5866
5880
  this._renderingMode,
5867
5881
  this._initialArgs,
5868
5882
  e,
@@ -5878,7 +5892,7 @@
5878
5892
  * Influences dependency graph construction.
5879
5893
  */
5880
5894
  enriches(e) {
5881
- return H("enrichmentTargets", e), new E(
5895
+ return H("enrichmentTargets", e), new L(
5882
5896
  this._renderingMode,
5883
5897
  this._initialArgs,
5884
5898
  this._initialUiState,
@@ -5910,64 +5924,78 @@
5910
5924
  sdkVersion: Y,
5911
5925
  renderingMode: this._renderingMode,
5912
5926
  initialArgs: this._initialArgs,
5913
- inputsValid: de(this._inputsValid),
5914
- sections: de(this._sections),
5927
+ inputsValid: fe(this._inputsValid),
5928
+ sections: fe(this._sections),
5915
5929
  outputs: Object.fromEntries(
5916
- Object.entries(this._outputs).map(([n2, r]) => [n2, de(r)])
5930
+ Object.entries(this._outputs).map(([n2, r]) => [n2, fe(r)])
5917
5931
  )
5918
5932
  };
5919
- return ht() ? De({ sdkVersion: Y }) : { config: e };
5933
+ return ht() ? Ke({ sdkVersion: Y }) : { config: e };
5920
5934
  }
5921
5935
  }
5922
- function Gt(t) {
5936
+ function Ue() {
5937
+ return {
5938
+ version: 2,
5939
+ stateCache: [],
5940
+ pTableParams: {
5941
+ sorting: [],
5942
+ filters: [],
5943
+ hiddenColIds: null
5944
+ }
5945
+ };
5946
+ }
5947
+ function jt(t) {
5948
+ return "version" in t ? t : Ue();
5949
+ }
5950
+ function be(t) {
5923
5951
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
5924
5952
  }
5925
- function Ue(t) {
5926
- return new ve().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
5953
+ function Be(t) {
5954
+ return new le().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
5927
5955
  name: "pl7.app/label",
5928
5956
  axes: [{}]
5929
5957
  // exactly one axis
5930
5958
  }, { dontWaitAllData: true });
5931
5959
  }
5932
- function Be(t, e) {
5960
+ function we(t, e) {
5933
5961
  const n2 = [], r = [];
5934
5962
  for (const a of t)
5935
- Gt(a.spec) ? n2.push(a) : r.push(a);
5963
+ be(a.spec) ? n2.push(a) : r.push(a);
5936
5964
  const i = [];
5937
5965
  for (const a of r)
5938
5966
  for (const l2 of a.spec.axesSpec) {
5939
5967
  const u2 = p$1(l2);
5940
- i.some((d) => X(d, u2)) || i.push(u2);
5968
+ i.some((c2) => Z$1(c2, u2)) || i.push(u2);
5941
5969
  }
5942
5970
  for (const a of n2) {
5943
- const l2 = p$1(a.spec.axesSpec[0]), u2 = i.findIndex((d) => X(d, l2));
5971
+ const l2 = p$1(a.spec.axesSpec[0]), u2 = i.findIndex((c2) => Z$1(c2, l2));
5944
5972
  u2 !== -1 && i.splice(u2, 1);
5945
5973
  }
5946
5974
  const s2 = (a, l2) => {
5947
5975
  let u2 = a.toString();
5948
5976
  if (l2)
5949
- for (const d in l2)
5950
- u2 += d, u2 += l2[d];
5977
+ for (const c2 in l2)
5978
+ u2 += c2, u2 += l2[c2];
5951
5979
  return u2;
5952
5980
  }, o = [];
5953
5981
  for (const a of e) {
5954
- const l2 = a.spec.axesSpec[0], u2 = p$1(l2), d = i.findIndex((y) => X(y, u2));
5955
- if (d !== -1) {
5956
- const y = i[d], b = Object.keys(y.domain ?? {}).length, f2 = Object.keys(l2.domain ?? {}).length;
5957
- b > f2 ? o.push({
5958
- id: s2(a.id, y.domain),
5982
+ const l2 = a.spec.axesSpec[0], u2 = p$1(l2), c2 = i.findIndex((d) => Z$1(d, u2));
5983
+ if (c2 !== -1) {
5984
+ const d = i[c2], h2 = Object.keys(d.domain ?? {}).length, p2 = Object.keys(l2.domain ?? {}).length;
5985
+ h2 > p2 ? o.push({
5986
+ id: s2(a.id, d.domain),
5959
5987
  spec: {
5960
5988
  ...a.spec,
5961
- axesSpec: [{ ...y, annotations: l2.annotations }]
5989
+ axesSpec: [{ ...d, annotations: l2.annotations }]
5962
5990
  },
5963
5991
  data: a.data
5964
- }) : o.push(a), i.splice(d, 1);
5992
+ }) : o.push(a), i.splice(c2, 1);
5965
5993
  }
5966
5994
  }
5967
5995
  return o;
5968
5996
  }
5969
5997
  function We(t) {
5970
- const e = (i) => Array.isArray(i), n2 = (i) => i instanceof O, r = (i) => typeof i == "object" && "type" in i;
5998
+ const e = (i) => Array.isArray(i), n2 = (i) => i instanceof E, r = (i) => typeof i == "object" && "type" in i;
5971
5999
  return t.map((i) => i.data).every((i) => {
5972
6000
  if (e(i))
5973
6001
  return true;
@@ -5986,7 +6014,7 @@
5986
6014
  throw Error(`unsupported column data type: ${i}`);
5987
6015
  });
5988
6016
  }
5989
- function Ge(t, e, n2, r, i, s2) {
6017
+ function Ae(t, e, n2, r, i, s2) {
5990
6018
  let o = t;
5991
6019
  const a = [];
5992
6020
  return a.push(...e), {
@@ -6002,48 +6030,40 @@
6002
6030
  sorting: i
6003
6031
  };
6004
6032
  }
6005
- function Ht(t) {
6033
+ function Nt(t) {
6006
6034
  var e;
6007
6035
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
6008
6036
  }
6009
- function qt(t) {
6037
+ function $t(t) {
6010
6038
  var e;
6011
6039
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
6012
6040
  }
6013
- function jn(t, e, n2, r, i) {
6014
- var g, x2;
6015
- const s2 = "full", o = [...[], ...((g = r == null ? void 0 : r.pTableParams) == null ? void 0 : g.filters) ?? []], a = ((x2 = r == null ? void 0 : r.pTableParams) == null ? void 0 : x2.sorting) ?? [], l2 = e.filter((p2) => !Ht(p2.spec)), u2 = l2.find((p2) => n2(p2.spec));
6041
+ function ue(t, e) {
6042
+ return [...new Map(t.map((n2) => [e(n2), n2])).values()];
6043
+ }
6044
+ function Kn(t, e, n2, r) {
6045
+ const i = jt(n2 ?? Ue()), s2 = "full", o = ue(
6046
+ [...[], ...i.pTableParams.filters],
6047
+ (g) => ue$1(g.column)
6048
+ ), a = ue(
6049
+ [...[], ...i.pTableParams.sorting],
6050
+ (g) => ue$1(g.column)
6051
+ ), l2 = e.filter((g) => !Nt(g.spec)), u2 = Be(t.resultPool);
6016
6052
  if (!u2) return;
6017
- const d = Ue(t.resultPool);
6018
- if (!d) return;
6019
- const y = new Set((() => {
6020
- var A2, m2;
6021
- const p2 = (m2 = (A2 = r == null ? void 0 : r.gridState.columnVisibility) == null ? void 0 : A2.hiddenColIds) == null ? void 0 : m2.map(ne).filter((v) => v.type === "column").map((v) => v.id);
6022
- return p2 || l2.filter((v) => qt(v.spec)).map((v) => v.id);
6053
+ const c2 = we(l2.map(Fn), u2), d = Ae(l2, c2, s2, o, a), h2 = t.createPTable(d), p2 = new Set((() => {
6054
+ const g = i.pTableParams.hiddenColIds;
6055
+ return g || l2.filter((x) => $t(x.spec)).map((x) => x.id);
6023
6056
  })());
6024
- y.delete(u2.id), [...o.map((p2) => p2.column), ...a.map((p2) => p2.column)].filter((p2) => p2.type === "column").map((p2) => y.delete(p2.id));
6025
- const b = l2.filter((p2) => !y.has(p2.id)), f2 = Be(b.map(On), d), w2 = [
6026
- ...u2.spec.axesSpec.map((p2) => ({
6027
- type: "axis",
6028
- id: p$1(p2),
6029
- spec: p2
6030
- })),
6031
- ...[...l2, ...f2].map((p2) => ({
6032
- type: "column",
6033
- id: p2.id,
6034
- spec: p2.spec
6035
- }))
6036
- ];
6037
- if (!We([...b, ...f2])) return;
6038
- const c2 = t.createPTable(
6039
- Ge(l2, f2, s2, o, a)
6040
- );
6057
+ [...o.map((g) => g.column), ...a.map((g) => g.column)].filter((g) => g.type === "column").map((g) => p2.delete(g.id));
6058
+ const m2 = l2.filter((g) => !p2.has(g.id)), f2 = we(m2.map(Fn), u2);
6059
+ if (!We([...m2, ...f2])) return;
6060
+ const v = Ae(m2, f2, s2, o, a), b = t.createPTable(v);
6041
6061
  return {
6042
- tableSpec: w2,
6043
- tableHandle: c2
6062
+ fullTableHandle: h2,
6063
+ visibleTableHandle: b
6044
6064
  };
6045
6065
  }
6046
- const model = E.create().withArgs({
6066
+ const model = L.create().withArgs({
6047
6067
  settings: {
6048
6068
  coverageThreshold: 0.95,
6049
6069
  // default value matching MMseqs2 default
@@ -6053,9 +6073,7 @@
6053
6073
  selectedColumns: []
6054
6074
  }).withUiState({
6055
6075
  title: "Immune Assay Data",
6056
- tableState: {
6057
- gridState: {}
6058
- }
6076
+ tableState: Ue()
6059
6077
  }).argsValid(
6060
6078
  (ctx) => ctx.args.datasetRef !== void 0 && ctx.args.fileHandle !== void 0 && ctx.args.importColumns !== void 0 && ctx.args.sequenceColumnHeader !== void 0 && ctx.args.targetRef !== void 0 && ctx.uiState.fileImportError === void 0
6061
6079
  ).output(
@@ -6134,10 +6152,9 @@
6134
6152
  const cols = (_d = (_c = ctx.outputs) == null ? void 0 : _c.resolve("table")) == null ? void 0 : _d.getPColumns();
6135
6153
  if (cols === void 0)
6136
6154
  return void 0;
6137
- return jn(
6155
+ return Kn(
6138
6156
  ctx,
6139
6157
  cols,
6140
- (_) => true,
6141
6158
  ctx.uiState.tableState
6142
6159
  );
6143
6160
  }).output("isRunning", (ctx) => {