@milaboratories/milaboratories.ui-examples.model 1.2.0 → 1.2.1

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
@@ -53,7 +53,7 @@
53
53
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
54
54
  }
55
55
  util2.joinValues = joinValues;
56
- util2.jsonStringifyReplacer = (_, value) => {
56
+ util2.jsonStringifyReplacer = (_2, value) => {
57
57
  if (typeof value === "bigint") {
58
58
  return value.toString();
59
59
  }
@@ -391,7 +391,7 @@
391
391
  overrideMap,
392
392
  overrideMap === errorMap ? void 0 : errorMap
393
393
  // then global default map
394
- ].filter((x) => !!x)
394
+ ].filter((x2) => !!x2)
395
395
  });
396
396
  ctx.common.issues.push(issue);
397
397
  }
@@ -454,15 +454,15 @@
454
454
  });
455
455
  const DIRTY = (value) => ({ status: "dirty", value });
456
456
  const OK = (value) => ({ status: "valid", value });
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;
461
- function __classPrivateFieldGet(receiver, state, kind, f2) {
457
+ const isAborted = (x2) => x2.status === "aborted";
458
+ const isDirty = (x2) => x2.status === "dirty";
459
+ const isValid = (x2) => x2.status === "valid";
460
+ const isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
461
+ function __classPrivateFieldGet(receiver, state, kind, f) {
462
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");
463
463
  return state.get(receiver);
464
464
  }
465
- function __classPrivateFieldSet(receiver, state, value, kind, f2) {
465
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
466
466
  if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
467
467
  return state.set(receiver, value), value;
468
468
  }
@@ -2787,7 +2787,7 @@
2787
2787
  if (!schema)
2788
2788
  return null;
2789
2789
  return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
2790
- }).filter((x) => !!x);
2790
+ }).filter((x2) => !!x2);
2791
2791
  if (ctx.common.async) {
2792
2792
  return Promise.all(items).then((results) => {
2793
2793
  return ParseStatus.mergeArray(status, results);
@@ -3045,7 +3045,7 @@
3045
3045
  ctx.schemaErrorMap,
3046
3046
  getErrorMap(),
3047
3047
  errorMap
3048
- ].filter((x) => !!x),
3048
+ ].filter((x2) => !!x2),
3049
3049
  issueData: {
3050
3050
  code: ZodIssueCode.invalid_arguments,
3051
3051
  argumentsError: error
@@ -3061,7 +3061,7 @@
3061
3061
  ctx.schemaErrorMap,
3062
3062
  getErrorMap(),
3063
3063
  errorMap
3064
- ].filter((x) => !!x),
3064
+ ].filter((x2) => !!x2),
3065
3065
  issueData: {
3066
3066
  code: ZodIssueCode.invalid_return_type,
3067
3067
  returnTypeError: error
@@ -3914,8 +3914,8 @@
3914
3914
  quotelessJson,
3915
3915
  ZodError
3916
3916
  });
3917
- function getDefaultExportFromCjs(x) {
3918
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
3917
+ function getDefaultExportFromCjs(x2) {
3918
+ return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
3919
3919
  }
3920
3920
  var canonicalize;
3921
3921
  var hasRequiredCanonicalize;
@@ -3955,239 +3955,239 @@
3955
3955
  return canonicalize;
3956
3956
  }
3957
3957
  var canonicalizeExports = requireCanonicalize();
3958
- const Oe = /* @__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);
3958
+ const Re = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
3959
+ var D$1 = Object.defineProperty;
3960
+ var L = (e, n2, t) => n2 in e ? D$1(e, n2, { enumerable: true, configurable: true, writable: true, value: t }) : e[n2] = t;
3961
+ var l$1 = (e, n2, t) => L(e, typeof n2 != "symbol" ? n2 + "" : n2, t);
3962
3962
  z$1.object({
3963
3963
  /** Included left border. */
3964
3964
  from: z$1.number(),
3965
3965
  /** Excluded right border. */
3966
3966
  to: z$1.number()
3967
3967
  });
3968
- function w(n2) {
3969
- throw new Error("Unexpected object: " + n2);
3968
+ function A(e) {
3969
+ throw new Error("Unexpected object: " + e);
3970
3970
  }
3971
- function En(n2) {
3972
- if (!n2 || typeof n2 != "object")
3971
+ function Oe(e) {
3972
+ if (!e || typeof e != "object")
3973
3973
  return false;
3974
- const e = n2;
3975
- if (!("type" in e))
3974
+ const n2 = e;
3975
+ if (!("type" in n2))
3976
3976
  return false;
3977
- switch (e.type) {
3977
+ switch (n2.type) {
3978
3978
  case "Json":
3979
- return typeof e.keyLength == "number" && e.data !== void 0 && typeof e.data == "object";
3979
+ return typeof n2.keyLength == "number" && n2.data !== void 0 && typeof n2.data == "object";
3980
3980
  case "JsonPartitioned":
3981
- return typeof e.partitionKeyLength == "number" && e.parts !== void 0 && typeof e.parts == "object";
3981
+ return typeof n2.partitionKeyLength == "number" && n2.parts !== void 0 && typeof n2.parts == "object";
3982
3982
  case "BinaryPartitioned":
3983
- return typeof e.partitionKeyLength == "number" && e.parts !== void 0 && typeof e.parts == "object";
3983
+ return typeof n2.partitionKeyLength == "number" && n2.parts !== void 0 && typeof n2.parts == "object";
3984
3984
  default:
3985
3985
  return false;
3986
3986
  }
3987
3987
  }
3988
- function Nn(n2, e) {
3989
- if (n2 !== void 0)
3990
- switch (n2.type) {
3988
+ function Ce(e, n2) {
3989
+ if (e !== void 0)
3990
+ switch (e.type) {
3991
3991
  case "Json":
3992
- return n2;
3992
+ return e;
3993
3993
  case "JsonPartitioned": {
3994
3994
  const t = {};
3995
- for (const [r, o] of Object.entries(n2.parts))
3996
- t[r] = e(o);
3995
+ for (const [r, o] of Object.entries(e.parts))
3996
+ t[r] = n2(o);
3997
3997
  return {
3998
- ...n2,
3998
+ ...e,
3999
3999
  parts: t
4000
4000
  };
4001
4001
  }
4002
4002
  case "BinaryPartitioned": {
4003
4003
  const t = {};
4004
- for (const [r, o] of Object.entries(n2.parts))
4004
+ for (const [r, o] of Object.entries(e.parts))
4005
4005
  t[r] = {
4006
- index: e(o.index),
4007
- values: e(o.values)
4006
+ index: n2(o.index),
4007
+ values: n2(o.values)
4008
4008
  };
4009
4009
  return {
4010
- ...n2,
4010
+ ...e,
4011
4011
  parts: t
4012
4012
  };
4013
4013
  }
4014
4014
  }
4015
4015
  }
4016
- function K(n2) {
4017
- if (!n2 || typeof n2 != "object")
4016
+ function _(e) {
4017
+ if (!e || typeof e != "object")
4018
4018
  return false;
4019
- const e = n2;
4020
- if (!("type" in e))
4019
+ const n2 = e;
4020
+ if (!("type" in n2))
4021
4021
  return false;
4022
- switch (e.type) {
4022
+ switch (n2.type) {
4023
4023
  case "Json":
4024
- return typeof e.keyLength == "number" && Array.isArray(e.data);
4024
+ return typeof n2.keyLength == "number" && Array.isArray(n2.data);
4025
4025
  case "JsonPartitioned":
4026
- return typeof e.partitionKeyLength == "number" && Array.isArray(e.parts);
4026
+ return typeof n2.partitionKeyLength == "number" && Array.isArray(n2.parts);
4027
4027
  case "BinaryPartitioned":
4028
- return typeof e.partitionKeyLength == "number" && Array.isArray(e.parts);
4028
+ return typeof n2.partitionKeyLength == "number" && Array.isArray(n2.parts);
4029
4029
  default:
4030
4030
  return false;
4031
4031
  }
4032
4032
  }
4033
- function Sn(n2) {
4034
- return K(n2) ? n2.type === "JsonPartitioned" || n2.type === "BinaryPartitioned" : false;
4033
+ function $e(e) {
4034
+ return _(e) ? e.type === "JsonPartitioned" || e.type === "BinaryPartitioned" : false;
4035
4035
  }
4036
- function Cn(n2) {
4037
- switch (n2.type) {
4036
+ function Ve$1(e) {
4037
+ switch (e.type) {
4038
4038
  case "Json": {
4039
- const e = Object.entries(n2.data).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
4039
+ const n2 = Object.entries(e.data).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
4040
4040
  return {
4041
4041
  type: "Json",
4042
- keyLength: n2.keyLength,
4043
- data: e
4042
+ keyLength: e.keyLength,
4043
+ data: n2
4044
4044
  };
4045
4045
  }
4046
4046
  case "JsonPartitioned": {
4047
- const e = Object.entries(n2.parts).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
4047
+ const n2 = Object.entries(e.parts).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
4048
4048
  return {
4049
4049
  type: "JsonPartitioned",
4050
- partitionKeyLength: n2.partitionKeyLength,
4051
- parts: e
4050
+ partitionKeyLength: e.partitionKeyLength,
4051
+ parts: n2
4052
4052
  };
4053
4053
  }
4054
4054
  case "BinaryPartitioned": {
4055
- const e = Object.entries(n2.parts).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
4055
+ const n2 = Object.entries(e.parts).map(([t, r]) => ({ key: JSON.parse(t), value: r }));
4056
4056
  return {
4057
4057
  type: "BinaryPartitioned",
4058
- partitionKeyLength: n2.partitionKeyLength,
4059
- parts: e
4058
+ partitionKeyLength: e.partitionKeyLength,
4059
+ parts: n2
4060
4060
  };
4061
4061
  }
4062
4062
  }
4063
4063
  }
4064
- function Jn(n2) {
4065
- switch (n2.type) {
4064
+ function Ie$1(e) {
4065
+ switch (e.type) {
4066
4066
  case "Json": {
4067
- const e = {};
4068
- for (const t of n2.data)
4069
- e[JSON.stringify(t.key)] = t.value;
4067
+ const n2 = {};
4068
+ for (const t of e.data)
4069
+ n2[JSON.stringify(t.key)] = t.value;
4070
4070
  return {
4071
4071
  type: "Json",
4072
- keyLength: n2.keyLength,
4073
- data: e
4072
+ keyLength: e.keyLength,
4073
+ data: n2
4074
4074
  };
4075
4075
  }
4076
4076
  case "JsonPartitioned": {
4077
- const e = {};
4078
- for (const t of n2.parts)
4079
- e[JSON.stringify(t.key)] = t.value;
4077
+ const n2 = {};
4078
+ for (const t of e.parts)
4079
+ n2[JSON.stringify(t.key)] = t.value;
4080
4080
  return {
4081
4081
  type: "JsonPartitioned",
4082
- partitionKeyLength: n2.partitionKeyLength,
4083
- parts: e
4082
+ partitionKeyLength: e.partitionKeyLength,
4083
+ parts: n2
4084
4084
  };
4085
4085
  }
4086
4086
  case "BinaryPartitioned": {
4087
- const e = {};
4088
- for (const t of n2.parts)
4089
- e[JSON.stringify(t.key)] = t.value;
4087
+ const n2 = {};
4088
+ for (const t of e.parts)
4089
+ n2[JSON.stringify(t.key)] = t.value;
4090
4090
  return {
4091
4091
  type: "BinaryPartitioned",
4092
- partitionKeyLength: n2.partitionKeyLength,
4093
- parts: e
4092
+ partitionKeyLength: e.partitionKeyLength,
4093
+ parts: n2
4094
4094
  };
4095
4095
  }
4096
4096
  }
4097
4097
  }
4098
- function Fn(n2) {
4098
+ function Me$1(e) {
4099
4099
  return {
4100
- columnId: n2.id,
4101
- spec: n2.spec
4100
+ columnId: e.id,
4101
+ spec: e.spec
4102
4102
  };
4103
4103
  }
4104
- function p$1(n2) {
4105
- const { type: e, name: t, domain: r } = n2, o = { type: e, name: t };
4104
+ function y(e) {
4105
+ const { type: n2, name: t, domain: r } = e, o = { type: n2, name: t };
4106
4106
  return r && Object.entries(r).length > 0 && Object.assign(o, { domain: r }), o;
4107
4107
  }
4108
- function J(n2) {
4109
- return n2.map(p$1);
4108
+ function C(e) {
4109
+ return e.map(y);
4110
4110
  }
4111
- function Rn(n2) {
4112
- return Oe(p$1(n2));
4111
+ function _e$1(e) {
4112
+ return Re(y(e));
4113
4113
  }
4114
- function Y$1(n2, e) {
4115
- if (n2 === void 0) return e === void 0;
4116
- if (e === void 0) return true;
4117
- for (const t in e)
4118
- if (n2[t] !== e[t]) return false;
4114
+ function ee$1(e, n2) {
4115
+ if (e === void 0) return n2 === void 0;
4116
+ if (n2 === void 0) return true;
4117
+ for (const t in n2)
4118
+ if (e[t] !== n2[t]) return false;
4119
4119
  return true;
4120
4120
  }
4121
- function Z$1(n2, e) {
4122
- return n2.name === e.name && Y$1(n2.domain, e.domain);
4121
+ function ne$1(e, n2) {
4122
+ return e.name === n2.name && ee$1(e.domain, n2.domain);
4123
4123
  }
4124
- function Un(n2, e) {
4125
- return { ...n2, src: h(n2.src, e) };
4124
+ function qe$1(e, n2) {
4125
+ return { ...e, src: g(e.src, n2) };
4126
4126
  }
4127
- function h(n2, e) {
4128
- switch (n2.type) {
4127
+ function g(e, n2) {
4128
+ switch (e.type) {
4129
4129
  case "column":
4130
4130
  return {
4131
4131
  type: "column",
4132
- column: e(n2.column)
4132
+ column: n2(e.column)
4133
4133
  };
4134
4134
  case "slicedColumn":
4135
4135
  return {
4136
4136
  type: "slicedColumn",
4137
- column: e(n2.column),
4138
- newId: n2.newId,
4139
- axisFilters: n2.axisFilters
4137
+ column: n2(e.column),
4138
+ newId: e.newId,
4139
+ axisFilters: e.axisFilters
4140
4140
  };
4141
4141
  case "inlineColumn":
4142
- return n2;
4142
+ return e;
4143
4143
  case "inner":
4144
4144
  case "full":
4145
4145
  return {
4146
- type: n2.type,
4147
- entries: n2.entries.map((t) => h(t, e))
4146
+ type: e.type,
4147
+ entries: e.entries.map((t) => g(t, n2))
4148
4148
  };
4149
4149
  case "outer":
4150
4150
  return {
4151
4151
  type: "outer",
4152
- primary: h(n2.primary, e),
4153
- secondary: n2.secondary.map((t) => h(t, e))
4152
+ primary: g(e.primary, n2),
4153
+ secondary: e.secondary.map((t) => g(t, n2))
4154
4154
  };
4155
4155
  default:
4156
- w(n2);
4156
+ A(e);
4157
4157
  }
4158
4158
  }
4159
- function nn(n2) {
4160
- return Oe(n2);
4159
+ function te(e) {
4160
+ return Re(e);
4161
4161
  }
4162
- function P(n2) {
4163
- return Oe(p$1(n2));
4162
+ function P(e) {
4163
+ return Re(y(e));
4164
4164
  }
4165
- function k$1(n2, e) {
4166
- return JSON.stringify([n2, e]);
4165
+ function E(e, n2) {
4166
+ return JSON.stringify([e, n2]);
4167
4167
  }
4168
- class Mn {
4168
+ class He {
4169
4169
  /**
4170
4170
  * Creates a new anchor context from a set of anchor column specifications
4171
4171
  * @param anchors Record of anchor column specifications indexed by anchor ID
4172
4172
  */
4173
- constructor(e) {
4173
+ constructor(n2) {
4174
4174
  l$1(this, "domains", /* @__PURE__ */ new Map());
4175
4175
  l$1(this, "axes", /* @__PURE__ */ new Map());
4176
4176
  l$1(this, "domainPacks", []);
4177
4177
  l$1(this, "domainPackToAnchor", /* @__PURE__ */ new Map());
4178
- this.anchors = e;
4179
- const t = Object.entries(e);
4178
+ this.anchors = n2;
4179
+ const t = Object.entries(n2);
4180
4180
  t.sort((r, o) => r[0].localeCompare(o[0]));
4181
4181
  for (const [r, o] of t) {
4182
- for (let s2 = 0; s2 < o.axesSpec.length; s2++) {
4183
- const a = o.axesSpec[s2], i = P(a);
4184
- this.axes.set(i, { anchor: r, idx: s2 });
4182
+ for (let i = 0; i < o.axesSpec.length; i++) {
4183
+ const a = o.axesSpec[i], s2 = P(a);
4184
+ this.axes.set(s2, { anchor: r, idx: i });
4185
4185
  }
4186
4186
  if (o.domain !== void 0) {
4187
- const s2 = Object.entries(o.domain);
4188
- s2.sort((a, i) => a[0].localeCompare(i[0])), this.domainPackToAnchor.set(JSON.stringify(s2), r), this.domainPacks.push(s2.map(([a]) => a));
4189
- for (const [a, i] of s2) {
4190
- const u2 = k$1(a, i);
4187
+ const i = Object.entries(o.domain);
4188
+ i.sort((a, s2) => a[0].localeCompare(s2[0])), this.domainPackToAnchor.set(JSON.stringify(i), r), this.domainPacks.push(i.map(([a]) => a));
4189
+ for (const [a, s2] of i) {
4190
+ const u2 = E(a, s2);
4191
4191
  this.domains.set(u2, r);
4192
4192
  }
4193
4193
  }
@@ -4196,57 +4196,57 @@
4196
4196
  /**
4197
4197
  * Implementation of derive method
4198
4198
  */
4199
- derive(e, t) {
4199
+ derive(n2, t) {
4200
4200
  const r = {
4201
- name: e.name,
4201
+ name: n2.name,
4202
4202
  axes: []
4203
4203
  };
4204
4204
  let o;
4205
- if (e.domain !== void 0)
4206
- n:
4205
+ if (n2.domain !== void 0)
4206
+ e:
4207
4207
  for (const a of this.domainPacks) {
4208
- const i = [];
4208
+ const s2 = [];
4209
4209
  for (const c2 of a) {
4210
- const m2 = e.domain[c2];
4211
- if (m2 !== void 0)
4212
- i.push([c2, m2]);
4210
+ const f = n2.domain[c2];
4211
+ if (f !== void 0)
4212
+ s2.push([c2, f]);
4213
4213
  else
4214
- break n;
4214
+ break e;
4215
4215
  }
4216
- const u2 = this.domainPackToAnchor.get(JSON.stringify(i));
4216
+ const u2 = this.domainPackToAnchor.get(JSON.stringify(s2));
4217
4217
  if (u2 !== void 0) {
4218
4218
  r.domainAnchor = u2, o = new Set(a);
4219
4219
  break;
4220
4220
  }
4221
4221
  }
4222
- for (const [a, i] of Object.entries(e.domain ?? {})) {
4222
+ for (const [a, s2] of Object.entries(n2.domain ?? {})) {
4223
4223
  if (o !== void 0 && o.has(a))
4224
4224
  continue;
4225
- const u2 = k$1(a, i), c2 = this.domains.get(u2);
4226
- r.domain ?? (r.domain = {}), r.domain[a] = c2 ? { anchor: c2 } : i;
4225
+ const u2 = E(a, s2), c2 = this.domains.get(u2);
4226
+ r.domain ?? (r.domain = {}), r.domain[a] = c2 ? { anchor: c2 } : s2;
4227
4227
  }
4228
- if (r.axes = e.axesSpec.map((a) => {
4229
- const i = P(a), u2 = this.axes.get(i);
4230
- return u2 === void 0 ? p$1(a) : u2;
4228
+ if (r.axes = n2.axesSpec.map((a) => {
4229
+ const s2 = P(a), u2 = this.axes.get(s2);
4230
+ return u2 === void 0 ? y(a) : u2;
4231
4231
  }), !t || t.length === 0)
4232
4232
  return r;
4233
- const s2 = [];
4233
+ const i = [];
4234
4234
  for (const a of t) {
4235
- const [i, u2] = a;
4236
- if (typeof i == "number") {
4237
- if (i < 0 || i >= e.axesSpec.length)
4238
- throw new Error(`Axis index ${i} is out of bounds (0-${e.axesSpec.length - 1})`);
4239
- s2.push([i, u2]);
4235
+ const [s2, u2] = a;
4236
+ if (typeof s2 == "number") {
4237
+ if (s2 < 0 || s2 >= n2.axesSpec.length)
4238
+ throw new Error(`Axis index ${s2} is out of bounds (0-${n2.axesSpec.length - 1})`);
4239
+ i.push([s2, u2]);
4240
4240
  } else {
4241
- const c2 = e.axesSpec.findIndex((m2) => m2.name === i);
4241
+ const c2 = n2.axesSpec.findIndex((f) => f.name === s2);
4242
4242
  if (c2 === -1)
4243
- throw new Error(`Axis with name "${i}" not found in the column specification`);
4244
- s2.push([c2, u2]);
4243
+ throw new Error(`Axis with name "${s2}" not found in the column specification`);
4244
+ i.push([c2, u2]);
4245
4245
  }
4246
4246
  }
4247
- return s2.sort((a, i) => a[0] - i[0]), {
4247
+ return i.sort((a, s2) => a[0] - s2[0]), {
4248
4248
  source: r,
4249
- axisFilters: s2
4249
+ axisFilters: i
4250
4250
  };
4251
4251
  }
4252
4252
  /**
@@ -4255,58 +4255,58 @@
4255
4255
  * @param axisFilters Optional axis filters to apply to the column
4256
4256
  * @returns A canonicalized string representation of the anchored column identifier
4257
4257
  */
4258
- deriveS(e, t) {
4259
- return nn(this.derive(e, t));
4258
+ deriveS(n2, t) {
4259
+ return te(this.derive(n2, t));
4260
4260
  }
4261
4261
  }
4262
- function Tn(n2, e, t) {
4263
- const r = { ...e }, o = (t == null ? void 0 : t.ignoreMissingDomains) ?? false;
4262
+ function We(e, n2, t) {
4263
+ const r = { ...n2 }, o = (t == null ? void 0 : t.ignoreMissingDomains) ?? false;
4264
4264
  if (r.domainAnchor !== void 0) {
4265
- const s2 = n2[r.domainAnchor];
4266
- if (!s2)
4265
+ const i = e[r.domainAnchor];
4266
+ if (!i)
4267
4267
  throw new Error(`Anchor "${r.domainAnchor}" not found`);
4268
- const a = s2.domain || {};
4268
+ const a = i.domain || {};
4269
4269
  r.domain = { ...a, ...r.domain }, delete r.domainAnchor;
4270
4270
  }
4271
4271
  if (r.domain) {
4272
- const s2 = {};
4273
- for (const [a, i] of Object.entries(r.domain))
4274
- if (typeof i == "string")
4275
- s2[a] = i;
4272
+ const i = {};
4273
+ for (const [a, s2] of Object.entries(r.domain))
4274
+ if (typeof s2 == "string")
4275
+ i[a] = s2;
4276
4276
  else {
4277
- const u2 = n2[i.anchor];
4277
+ const u2 = e[s2.anchor];
4278
4278
  if (!u2)
4279
- throw new Error(`Anchor "${i.anchor}" not found for domain key "${a}"`);
4279
+ throw new Error(`Anchor "${s2.anchor}" not found for domain key "${a}"`);
4280
4280
  if (!u2.domain || u2.domain[a] === void 0) {
4281
4281
  if (!o)
4282
- throw new Error(`Domain key "${a}" not found in anchor "${i.anchor}"`);
4282
+ throw new Error(`Domain key "${a}" not found in anchor "${s2.anchor}"`);
4283
4283
  continue;
4284
4284
  }
4285
- s2[a] = u2.domain[a];
4285
+ i[a] = u2.domain[a];
4286
4286
  }
4287
- r.domain = s2;
4287
+ r.domain = i;
4288
4288
  }
4289
- return r.axes && (r.axes = r.axes.map((s2) => en(n2, s2))), r;
4289
+ return r.axes && (r.axes = r.axes.map((i) => re(e, i))), r;
4290
4290
  }
4291
- function en(n2, e) {
4292
- if (!tn(e))
4293
- return e;
4294
- const t = e.anchor, r = n2[t];
4291
+ function re(e, n2) {
4292
+ if (!oe$1(n2))
4293
+ return n2;
4294
+ const t = n2.anchor, r = e[t];
4295
4295
  if (!r)
4296
4296
  throw new Error(`Anchor "${t}" not found for axis reference`);
4297
- if ("idx" in e) {
4298
- if (e.idx < 0 || e.idx >= r.axesSpec.length)
4299
- throw new Error(`Axis index ${e.idx} out of bounds for anchor "${t}"`);
4300
- return r.axesSpec[e.idx];
4301
- } else if ("name" in e) {
4302
- const o = r.axesSpec.filter((s2) => s2.name === e.name);
4297
+ if ("idx" in n2) {
4298
+ if (n2.idx < 0 || n2.idx >= r.axesSpec.length)
4299
+ throw new Error(`Axis index ${n2.idx} out of bounds for anchor "${t}"`);
4300
+ return r.axesSpec[n2.idx];
4301
+ } else if ("name" in n2) {
4302
+ const o = r.axesSpec.filter((i) => i.name === n2.name);
4303
4303
  if (o.length > 1)
4304
- throw new Error(`Multiple axes with name "${e.name}" found in anchor "${t}"`);
4304
+ throw new Error(`Multiple axes with name "${n2.name}" found in anchor "${t}"`);
4305
4305
  if (o.length === 0)
4306
- throw new Error(`Axis with name "${e.name}" not found in anchor "${t}"`);
4306
+ throw new Error(`Axis with name "${n2.name}" not found in anchor "${t}"`);
4307
4307
  return o[0];
4308
- } else if ("id" in e) {
4309
- const o = r.axesSpec.filter((s2) => Z$1(e.id, p$1(s2)));
4308
+ } else if ("id" in n2) {
4309
+ const o = r.axesSpec.filter((i) => ne$1(n2.id, y(i)));
4310
4310
  if (o.length > 1)
4311
4311
  throw new Error(`Multiple matching axes found for matcher in anchor "${t}"`);
4312
4312
  if (o.length === 0)
@@ -4315,33 +4315,33 @@
4315
4315
  }
4316
4316
  throw new Error("Unsupported axis reference type");
4317
4317
  }
4318
- function tn(n2) {
4319
- return typeof n2 == "object" && "anchor" in n2;
4318
+ function oe$1(e) {
4319
+ return typeof e == "object" && "anchor" in e;
4320
4320
  }
4321
- function f(n2) {
4322
- return n2.kind === "PColumn";
4321
+ function d(e) {
4322
+ return e.kind === "PColumn";
4323
4323
  }
4324
- function rn(n2) {
4325
- return f(n2.spec);
4324
+ function ie$1(e) {
4325
+ return d(e.spec);
4326
4326
  }
4327
- function Wn(n2) {
4328
- if (!rn(n2)) throw new Error(`not a PColumn (kind = ${n2.spec.kind})`);
4329
- return n2;
4327
+ function Ye(e) {
4328
+ if (!ie$1(e)) throw new Error(`not a PColumn (kind = ${e.spec.kind})`);
4329
+ return e;
4330
4330
  }
4331
- function Xn(n2, e) {
4332
- return n2 === void 0 ? void 0 : {
4333
- ...n2,
4334
- data: e(n2.data)
4331
+ function Ze(e, n2) {
4332
+ return e === void 0 ? void 0 : {
4333
+ ...e,
4334
+ data: n2(e.data)
4335
4335
  };
4336
4336
  }
4337
- function Gn(n2) {
4338
- const e = /* @__PURE__ */ new Map(), t = (r) => {
4337
+ function en(e) {
4338
+ const n2 = /* @__PURE__ */ new Map(), t = (r) => {
4339
4339
  switch (r.type) {
4340
4340
  case "column":
4341
- e.set(r.column.id, r.column);
4341
+ n2.set(r.column.id, r.column);
4342
4342
  return;
4343
4343
  case "slicedColumn":
4344
- e.set(r.column.id, r.column);
4344
+ n2.set(r.column.id, r.column);
4345
4345
  return;
4346
4346
  case "inlineColumn":
4347
4347
  return;
@@ -4354,84 +4354,84 @@
4354
4354
  for (const o of r.secondary) t(o);
4355
4355
  return;
4356
4356
  default:
4357
- w(r);
4357
+ A(r);
4358
4358
  }
4359
4359
  };
4360
- return t(n2), [...e.values()];
4360
+ return t(e), [...n2.values()];
4361
4361
  }
4362
- function E(n2, e) {
4363
- if (n2.name !== void 0 && n2.name !== e.name)
4362
+ function S(e, n2) {
4363
+ if (e.name !== void 0 && e.name !== n2.name)
4364
4364
  return false;
4365
- if (n2.type !== void 0) {
4366
- if (Array.isArray(n2.type)) {
4367
- if (!n2.type.includes(e.type))
4365
+ if (e.type !== void 0) {
4366
+ if (Array.isArray(e.type)) {
4367
+ if (!e.type.includes(n2.type))
4368
4368
  return false;
4369
- } else if (n2.type !== e.type)
4369
+ } else if (e.type !== n2.type)
4370
4370
  return false;
4371
4371
  }
4372
- if (n2.domain !== void 0) {
4373
- const t = e.domain || {};
4374
- for (const [r, o] of Object.entries(n2.domain))
4372
+ if (e.domain !== void 0) {
4373
+ const t = n2.domain || {};
4374
+ for (const [r, o] of Object.entries(e.domain))
4375
4375
  if (t[r] !== o)
4376
4376
  return false;
4377
4377
  }
4378
4378
  return true;
4379
4379
  }
4380
- function N(n2, e) {
4381
- if (e.name !== void 0 && n2.name !== e.name || e.namePattern !== void 0 && !new RegExp(e.namePattern).test(n2.name))
4380
+ function v$1(e, n2) {
4381
+ if (n2.name !== void 0 && e.name !== n2.name || n2.namePattern !== void 0 && !new RegExp(n2.namePattern).test(e.name))
4382
4382
  return false;
4383
- if (e.type !== void 0) {
4384
- if (Array.isArray(e.type)) {
4385
- if (!e.type.includes(n2.valueType))
4383
+ if (n2.type !== void 0) {
4384
+ if (Array.isArray(n2.type)) {
4385
+ if (!n2.type.includes(e.valueType))
4386
4386
  return false;
4387
- } else if (e.type !== n2.valueType)
4387
+ } else if (n2.type !== e.valueType)
4388
4388
  return false;
4389
4389
  }
4390
- if (e.domain !== void 0) {
4391
- const t = n2.domain || {};
4392
- for (const [r, o] of Object.entries(e.domain))
4390
+ if (n2.domain !== void 0) {
4391
+ const t = e.domain || {};
4392
+ for (const [r, o] of Object.entries(n2.domain))
4393
4393
  if (t[r] !== o)
4394
4394
  return false;
4395
4395
  }
4396
- if (e.axes !== void 0) {
4397
- const t = n2.axesSpec.map(p$1);
4398
- if (e.partialAxesMatch) {
4399
- for (const r of e.axes)
4400
- if (!t.some((o) => E(r, o)))
4396
+ if (n2.axes !== void 0) {
4397
+ const t = e.axesSpec.map(y);
4398
+ if (n2.partialAxesMatch) {
4399
+ for (const r of n2.axes)
4400
+ if (!t.some((o) => S(r, o)))
4401
4401
  return false;
4402
4402
  } else {
4403
- if (t.length !== e.axes.length)
4403
+ if (t.length !== n2.axes.length)
4404
4404
  return false;
4405
- for (let r = 0; r < e.axes.length; r++)
4406
- if (!E(e.axes[r], t[r]))
4405
+ for (let r = 0; r < n2.axes.length; r++)
4406
+ if (!S(n2.axes[r], t[r]))
4407
4407
  return false;
4408
4408
  }
4409
4409
  }
4410
- if (e.annotations !== void 0) {
4411
- const t = n2.annotations || {};
4412
- for (const [r, o] of Object.entries(e.annotations))
4410
+ if (n2.annotations !== void 0) {
4411
+ const t = e.annotations || {};
4412
+ for (const [r, o] of Object.entries(n2.annotations))
4413
4413
  if (t[r] !== o)
4414
4414
  return false;
4415
4415
  }
4416
- if (e.annotationPatterns !== void 0) {
4417
- const t = n2.annotations || {};
4418
- for (const [r, o] of Object.entries(e.annotationPatterns)) {
4419
- const s2 = t[r];
4420
- if (s2 === void 0 || !new RegExp(o).test(s2))
4416
+ if (n2.annotationPatterns !== void 0) {
4417
+ const t = e.annotations || {};
4418
+ for (const [r, o] of Object.entries(n2.annotationPatterns)) {
4419
+ const i = t[r];
4420
+ if (i === void 0 || !new RegExp(o).test(i))
4421
4421
  return false;
4422
4422
  }
4423
4423
  }
4424
4424
  return true;
4425
4425
  }
4426
- function Qn(n2) {
4427
- return Array.isArray(n2) ? (e) => n2.some((t) => f(e) && N(e, t)) : (e) => f(e) && N(e, n2);
4426
+ function nn(e) {
4427
+ return Array.isArray(e) ? (n2) => e.some((t) => d(n2) && v$1(n2, t)) : (n2) => d(n2) && v$1(n2, e);
4428
4428
  }
4429
- function Yn(n2) {
4430
- const e = {
4431
- kind: n2.kind,
4432
- name: n2.name
4429
+ function tn(e) {
4430
+ const n2 = {
4431
+ kind: e.kind,
4432
+ name: e.name
4433
4433
  };
4434
- return n2.domain !== void 0 && (e.domain = n2.domain), f(n2) && (e.axesSpec = J(n2.axesSpec)), Oe(e);
4434
+ return e.domain !== void 0 && (n2.domain = e.domain), d(e) && (n2.axesSpec = C(e.axesSpec)), Re(n2);
4435
4435
  }
4436
4436
  z$1.object({
4437
4437
  __isRef: z$1.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
@@ -4441,27 +4441,27 @@
4441
4441
  }).describe(
4442
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."
4443
4443
  ).readonly();
4444
- function ee(n2) {
4445
- return typeof n2 == "object" && n2 !== null && "__isRef" in n2 && n2.__isRef === true && "blockId" in n2 && "name" in n2;
4444
+ function sn(e) {
4445
+ return typeof e == "object" && e !== null && "__isRef" in e && e.__isRef === true && "blockId" in e && "name" in e;
4446
4446
  }
4447
- function re$1(n2, e = true) {
4448
- if (e)
4447
+ function un(e, n2 = true) {
4448
+ if (n2)
4449
4449
  return {
4450
- ...n2,
4450
+ ...e,
4451
4451
  requireEnrichments: true
4452
4452
  };
4453
4453
  {
4454
- const { requireEnrichments: t, ...r } = n2;
4454
+ const { requireEnrichments: t, ...r } = e;
4455
4455
  return r;
4456
4456
  }
4457
4457
  }
4458
- function ie(n2, e) {
4459
- return n2.ok ? { ok: true, value: e(n2.value) } : n2;
4458
+ function fn(e, n2) {
4459
+ return e.ok ? { ok: true, value: n2(e.value) } : e;
4460
4460
  }
4461
- const fn = 24;
4462
- z$1.string().length(fn).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4463
- function ce$1(n2) {
4464
- return Oe(n2);
4461
+ const de$1 = 24;
4462
+ z$1.string().length(de$1).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4463
+ function mn(e) {
4464
+ return Re(e);
4465
4465
  }
4466
4466
  var stringify = { exports: {} };
4467
4467
  var hasRequiredStringify;
@@ -4524,52 +4524,52 @@
4524
4524
  });
4525
4525
  var qe = Object.defineProperty;
4526
4526
  var ze = (t, e, n2) => e in t ? qe(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4527
- var F = (t, e, n2) => ze(t, typeof e != "symbol" ? e + "" : e, n2);
4528
- function re(t) {
4527
+ var k = (t, e, n2) => ze(t, typeof e != "symbol" ? e + "" : e, n2);
4528
+ function ne(t) {
4529
4529
  return { type: "Immediate", value: t };
4530
4530
  }
4531
- function pt() {
4531
+ function ft() {
4532
4532
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
4533
4533
  }
4534
- function Ve(t) {
4534
+ function Ke(t) {
4535
4535
  if (t && typeof globalThis.getPlatforma == "function")
4536
4536
  return globalThis.getPlatforma(t);
4537
4537
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
4538
4538
  throw new Error("Can't get platforma instance.");
4539
4539
  }
4540
- function ft() {
4540
+ function ht() {
4541
4541
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4542
4542
  }
4543
4543
  function v() {
4544
4544
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4545
4545
  throw new Error("Not in config rendering context");
4546
4546
  }
4547
- function H(t, e) {
4548
- const n2 = ft();
4547
+ function G(t, e) {
4548
+ const n2 = ht();
4549
4549
  if (n2 === void 0) return false;
4550
4550
  if (t in n2.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
4551
4551
  return n2.callbackRegistry[t] = e, true;
4552
4552
  }
4553
- const ce = /* @__PURE__ */ new Map();
4554
- function ht(t, e) {
4553
+ const ue = /* @__PURE__ */ new Map();
4554
+ function gt(t, e) {
4555
4555
  t in v().callbackRegistry || (v().callbackRegistry[t] = (n2) => {
4556
- for (const r of ce.get(t))
4556
+ for (const r of ue.get(t))
4557
4557
  r(n2);
4558
- }, ce.set(t, [])), ce.get(t).push(e);
4558
+ }, ue.set(t, [])), ue.get(t).push(e);
4559
4559
  }
4560
- class L {
4560
+ class F {
4561
4561
  constructor(e, n2 = (r) => r) {
4562
- F(this, "isResolved", false);
4563
- F(this, "resolvedValue");
4564
- this.handle = e, this.postProcess = n2, ht(e, (r) => {
4562
+ k(this, "isResolved", false);
4563
+ k(this, "resolvedValue");
4564
+ this.handle = e, this.postProcess = n2, gt(e, (r) => {
4565
4565
  this.resolvedValue = n2(r), this.isResolved = true;
4566
4566
  });
4567
4567
  }
4568
4568
  map(e) {
4569
- return new L(this.handle, (n2) => e(this.postProcess(n2)));
4569
+ return new F(this.handle, (n2) => e(this.postProcess(n2)));
4570
4570
  }
4571
4571
  mapDefined(e) {
4572
- return new L(this.handle, (n2) => {
4572
+ return new F(this.handle, (n2) => {
4573
4573
  const r = this.postProcess(n2);
4574
4574
  return r ? e(r) : void 0;
4575
4575
  });
@@ -4578,7 +4578,7 @@
4578
4578
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4579
4579
  }
4580
4580
  }
4581
- function he(t, e) {
4581
+ function fe(t, e) {
4582
4582
  return t === void 0 ? void 0 : e(t);
4583
4583
  }
4584
4584
  class D {
@@ -4620,7 +4620,7 @@
4620
4620
  ...this.resolvePath,
4621
4621
  ...n2.map((i) => typeof i == "string" ? i : i.field)
4622
4622
  ];
4623
- return he(
4623
+ return fe(
4624
4624
  v().resolveWithCommon(this.handle, e, ...n2),
4625
4625
  (i) => new D(i, r)
4626
4626
  );
@@ -4642,7 +4642,7 @@
4642
4642
  }
4643
4643
  getError() {
4644
4644
  const e = [...this.resolvePath, "error"];
4645
- return he(
4645
+ return fe(
4646
4646
  v().getError(this.handle),
4647
4647
  (n2) => new D(n2, e)
4648
4648
  );
@@ -4684,7 +4684,7 @@
4684
4684
  getPColumns(e = false, n2 = "") {
4685
4685
  const r = this.parsePObjectCollection(e, n2);
4686
4686
  return r === void 0 ? void 0 : Object.entries(r).map(([, s2]) => {
4687
- if (!rn(s2)) throw new Error(`not a PColumn (kind = ${s2.spec.kind})`);
4687
+ if (!ie$1(s2)) throw new Error(`not a PColumn (kind = ${s2.spec.kind})`);
4688
4688
  return s2;
4689
4689
  });
4690
4690
  }
@@ -4702,18 +4702,18 @@
4702
4702
  const i = {};
4703
4703
  for (const [s2, o] of Object.entries(r)) {
4704
4704
  const a = [...this.resolvePath, s2];
4705
- i[s2] = Xn(o, (l2) => new D(l2, a));
4705
+ i[s2] = Ze(o, (l2) => new D(l2, a));
4706
4706
  }
4707
4707
  return i;
4708
4708
  }
4709
4709
  getFileContentAsBase64(e) {
4710
- return new L(v().getBlobContentAsBase64(this.handle, e));
4710
+ return new F(v().getBlobContentAsBase64(this.handle, e));
4711
4711
  }
4712
4712
  getFileContentAsString(e) {
4713
- return new L(v().getBlobContentAsString(this.handle, e));
4713
+ return new F(v().getBlobContentAsString(this.handle, e));
4714
4714
  }
4715
4715
  getFileContentAsJson(e) {
4716
- return new L(
4716
+ return new F(
4717
4717
  v().getBlobContentAsString(this.handle, e)
4718
4718
  ).mapDefined((n2) => JSON.parse(n2));
4719
4719
  }
@@ -4733,7 +4733,7 @@
4733
4733
  * @returns downloaded file handle
4734
4734
  */
4735
4735
  getFileHandle() {
4736
- return new L(v().getDownloadedBlobContentHandle(this.handle));
4736
+ return new F(v().getDownloadedBlobContentHandle(this.handle));
4737
4737
  }
4738
4738
  /**
4739
4739
  * @deprecated use getFileHandle
@@ -4745,7 +4745,7 @@
4745
4745
  * @returns downloaded file handle
4746
4746
  */
4747
4747
  getRemoteFileHandle() {
4748
- return new L(v().getOnDemandBlobContentHandle(this.handle));
4748
+ return new F(v().getOnDemandBlobContentHandle(this.handle));
4749
4749
  }
4750
4750
  /**
4751
4751
  * @deprecated use getRemoteFileHandle
@@ -4757,22 +4757,22 @@
4757
4757
  * @returns the url to the extracted folder
4758
4758
  */
4759
4759
  extractArchiveAndGetURL(e) {
4760
- return new L(v().extractArchiveAndGetURL(this.handle, e));
4760
+ return new F(v().extractArchiveAndGetURL(this.handle, e));
4761
4761
  }
4762
4762
  getImportProgress() {
4763
- return new L(v().getImportProgress(this.handle));
4763
+ return new F(v().getImportProgress(this.handle));
4764
4764
  }
4765
4765
  getLastLogs(e) {
4766
- return new L(v().getLastLogs(this.handle, e));
4766
+ return new F(v().getLastLogs(this.handle, e));
4767
4767
  }
4768
4768
  getProgressLog(e) {
4769
- return new L(v().getProgressLog(this.handle, e));
4769
+ return new F(v().getProgressLog(this.handle, e));
4770
4770
  }
4771
4771
  getProgressLogWithInfo(e) {
4772
- return new L(v().getProgressLogWithInfo(this.handle, e));
4772
+ return new F(v().getProgressLogWithInfo(this.handle, e));
4773
4773
  }
4774
4774
  getLogHandle() {
4775
- return new L(v().getLogHandle(this.handle));
4775
+ return new F(v().getLogHandle(this.handle));
4776
4776
  }
4777
4777
  allFieldsResolved(e = "Input") {
4778
4778
  switch (e) {
@@ -4798,135 +4798,135 @@
4798
4798
  let l2 = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4799
4799
  (u2) => [u2, this.resolve({ field: u2, assertFieldType: r })]
4800
4800
  );
4801
- return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, d]) => o(u2, d));
4801
+ return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, h]) => o(u2, h));
4802
4802
  }
4803
4803
  }
4804
- const Ke = "staging", je = "main";
4805
- const yt = "pl7.app/label", bt = "pl7.app/trace", vt = z$1.object({
4804
+ const Ne = "staging", Ve = "main";
4805
+ const bt = "pl7.app/label", vt = "pl7.app/trace", Ct = z$1.object({
4806
4806
  type: z$1.string(),
4807
4807
  importance: z$1.number().optional(),
4808
4808
  id: z$1.string().optional(),
4809
4809
  label: z$1.string()
4810
- }), wt = z$1.array(vt), St = 1e-3, Ct = "__LABEL__", Ie = "__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) => {
4810
+ }), St = z$1.array(Ct), wt = 1e-3, At = "__LABEL__", xe = "__LABEL__@1";
4811
+ function Je(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((d2) => {
4813
4813
  var c2, m2;
4814
- const b = e(p2);
4815
- let f2, y, w2;
4816
- "spec" in b && typeof b.spec == "object" ? (f2 = b.spec, y = b.prefixTrace, w2 = b.suffixTrace) : f2 = b;
4817
- const E2 = (c2 = f2.annotations) == null ? void 0 : c2[yt], x = (m2 = f2.annotations) == null ? void 0 : m2[bt], C = (x ? wt.safeParse(JSON.parse(x)).data : void 0) ?? [], A = [
4818
- ...y ?? [],
4819
- ...C,
4820
- ...w2 ?? []
4814
+ const b = e(d2);
4815
+ let p2, y2, C2;
4816
+ "spec" in b && typeof b.spec == "object" ? (p2 = b.spec, y2 = b.prefixTrace, C2 = b.suffixTrace) : p2 = b;
4817
+ const E2 = (c2 = p2.annotations) == null ? void 0 : c2[bt], _2 = (m2 = p2.annotations) == null ? void 0 : m2[vt], w = (_2 ? St.safeParse(JSON.parse(_2)).data : void 0) ?? [], A2 = [
4818
+ ...y2 ?? [],
4819
+ ...w,
4820
+ ...C2 ?? []
4821
4821
  ];
4822
4822
  if (E2 !== void 0) {
4823
- const _ = { label: E2, type: Ct, importance: -2 };
4824
- n2.addLabelAsSuffix ? A.push(_) : A.splice(0, 0, _);
4825
- }
4826
- const S = [], I = /* @__PURE__ */ new Map();
4827
- for (let _ = A.length - 1; _ >= 0; --_) {
4828
- const { type: W } = A[_], j2 = A[_].importance ?? 0, $ = (I.get(W) ?? 0) + 1;
4829
- I.set(W, $);
4830
- const V = `${W}@${$}`;
4831
- s2.set(V, (s2.get(V) ?? 0) + 1), r.set(
4832
- V,
4823
+ const T = { label: E2, type: At, importance: -2 };
4824
+ n2.addLabelAsSuffix ? A2.push(T) : A2.splice(0, 0, T);
4825
+ }
4826
+ const S2 = [], I = /* @__PURE__ */ new Map();
4827
+ for (let T = A2.length - 1; T >= 0; --T) {
4828
+ const { type: U } = A2[T], V = A2[T].importance ?? 0, J = (I.get(U) ?? 0) + 1;
4829
+ I.set(U, J);
4830
+ const K = `${U}@${J}`;
4831
+ s2.set(K, (s2.get(K) ?? 0) + 1), r.set(
4832
+ K,
4833
4833
  Math.max(
4834
- r.get(V) ?? Number.NEGATIVE_INFINITY,
4835
- j2 - (A.length - _) * St
4834
+ r.get(K) ?? Number.NEGATIVE_INFINITY,
4835
+ V - (A2.length - T) * wt
4836
4836
  )
4837
- ), S.push({ ...A[_], fullType: V, occurrenceIndex: $ });
4837
+ ), S2.push({ ...A2[T], fullType: K, occurrenceIndex: J });
4838
4838
  }
4839
- return S.reverse(), {
4840
- value: p2,
4841
- spec: f2,
4839
+ return S2.reverse(), {
4840
+ value: d2,
4841
+ spec: p2,
4842
4842
  label: E2,
4843
- fullTrace: S
4843
+ fullTrace: S2
4844
4844
  };
4845
4845
  }), a = [], l2 = [], u2 = [...r];
4846
- u2.sort(([, p2], [, b]) => b - p2);
4847
- for (const [p2] of u2)
4848
- p2.endsWith("@1") || s2.get(p2) === t.length ? a.push(p2) : l2.push(p2);
4849
- const d = (p2, b = false) => {
4850
- const f2 = [];
4851
- for (let y = 0; y < o.length; y++) {
4852
- const w2 = o[y], E2 = w2.fullTrace.filter((A) => p2.has(A.fullType) || i && i.has(A.type));
4846
+ u2.sort(([, d2], [, b]) => b - d2);
4847
+ for (const [d2] of u2)
4848
+ d2.endsWith("@1") || s2.get(d2) === t.length ? a.push(d2) : l2.push(d2);
4849
+ const h = (d2, b = false) => {
4850
+ const p2 = [];
4851
+ for (let y2 = 0; y2 < o.length; y2++) {
4852
+ const C2 = o[y2], E2 = C2.fullTrace.filter((A2) => d2.has(A2.fullType) || i && i.has(A2.type));
4853
4853
  if (E2.length === 0)
4854
4854
  if (b)
4855
- f2.push({
4855
+ p2.push({
4856
4856
  label: "Unlabeled",
4857
- value: w2.value
4857
+ value: C2.value
4858
4858
  });
4859
4859
  else return;
4860
- const x = E2.map((A) => A.label), C = n2.separator ?? " / ";
4861
- f2.push({
4862
- label: x.join(C),
4863
- value: w2.value
4860
+ const _2 = E2.map((A2) => A2.label), w = n2.separator ?? " / ";
4861
+ p2.push({
4862
+ label: _2.join(w),
4863
+ value: C2.value
4864
4864
  });
4865
4865
  }
4866
- return f2;
4866
+ return p2;
4867
4867
  };
4868
4868
  if (a.length === 0) {
4869
4869
  if (l2.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
4870
- return d(new Set(Ie), true);
4871
- }
4872
- let h2 = 0, g = -1;
4873
- for (; h2 < a.length; ) {
4874
- const p2 = /* @__PURE__ */ new Set();
4875
- n2.includeNativeLabel && p2.add(Ie);
4876
- for (let f2 = 0; f2 < h2; ++f2) p2.add(a[f2]);
4877
- g >= 0 && p2.add(a[g]);
4878
- const b = d(p2);
4879
- if (b !== void 0 && new Set(b.map((f2) => f2.label)).size === t.length) return b;
4880
- g++, g >= a.length && (h2++, g = h2);
4881
- }
4882
- return d(/* @__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 me = (t) => {
4870
+ return h(new Set(xe), true);
4871
+ }
4872
+ let f = 0, g2 = -1;
4873
+ for (; f < a.length; ) {
4874
+ const d2 = /* @__PURE__ */ new Set();
4875
+ n2.includeNativeLabel && d2.add(xe);
4876
+ for (let p2 = 0; p2 < f; ++p2) d2.add(a[p2]);
4877
+ g2 >= 0 && d2.add(a[g2]);
4878
+ const b = h(d2);
4879
+ if (b !== void 0 && new Set(b.map((p2) => p2.label)).size === t.length) return b;
4880
+ g2++, g2 >= a.length && (f++, g2 = f);
4881
+ }
4882
+ return h(/* @__PURE__ */ new Set([...a, ...l2]), true);
4883
+ }
4884
+ const Q = "PColumnData/", ie = Q + "ResourceMap", se = Q + "Partitioned/ResourceMap", H = Q + "JsonPartitioned", B = Q + "BinaryPartitioned", Me = Q + "Partitioned/", oe = Me + "JsonPartitioned", q = Me + "BinaryPartitioned";
4885
+ const ge = (t) => {
4886
4886
  if (t.endsWith(".index"))
4887
4887
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
4888
4888
  if (t.endsWith(".values"))
4889
4889
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
4890
4890
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
4891
4891
  };
4892
- function At(t) {
4892
+ function Pt(t) {
4893
4893
  if (!t) return;
4894
4894
  const e = t.resourceType.name, n2 = t.getDataAsJson(), r = [];
4895
4895
  let i = 0;
4896
4896
  switch (e) {
4897
- case se:
4897
+ case ie:
4898
4898
  i = n2.keyLength;
4899
4899
  break;
4900
- case oe:
4900
+ case se:
4901
4901
  i = n2.partitionKeyLength + n2.keyLength;
4902
4902
  break;
4903
- case q:
4903
+ case H:
4904
4904
  case B:
4905
4905
  i = n2.partitionKeyLength;
4906
4906
  break;
4907
- case z:
4908
- case ae:
4907
+ case q:
4908
+ case oe:
4909
4909
  i = n2.superPartitionKeyLength + n2.partitionKeyLength;
4910
4910
  break;
4911
4911
  }
4912
4912
  switch (e) {
4913
- case se:
4914
- case q:
4913
+ case ie:
4914
+ case H:
4915
4915
  case B:
4916
4916
  for (let s2 of t.listInputFields()) {
4917
- e === B && (s2 = me(s2).baseKey);
4917
+ e === B && (s2 = ge(s2).baseKey);
4918
4918
  const o = [...JSON.parse(s2)];
4919
4919
  r.push(o);
4920
4920
  }
4921
4921
  break;
4922
+ case se:
4923
+ case q:
4922
4924
  case oe:
4923
- case z:
4924
- case ae:
4925
4925
  for (const s2 of t.listInputFields()) {
4926
4926
  const o = [...JSON.parse(s2)], a = t.resolve({ field: s2, assertFieldType: "Input" });
4927
4927
  if (a !== void 0)
4928
4928
  for (let l2 of a.listInputFields()) {
4929
- e === z && (l2 = me(l2).baseKey);
4929
+ e === q && (l2 = ge(l2).baseKey);
4930
4930
  const u2 = [...o, ...JSON.parse(l2)];
4931
4931
  r.push(u2);
4932
4932
  }
@@ -4935,7 +4935,7 @@
4935
4935
  }
4936
4936
  return { data: r, keyLength: i };
4937
4937
  }
4938
- function Pt(t) {
4938
+ function xt(t) {
4939
4939
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
4940
4940
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
4941
4941
  const { parts: e, partitionKeyLength: n2 } = t, r = [];
@@ -4954,11 +4954,11 @@
4954
4954
  }
4955
4955
  return r.map((i) => Array.from(i.values()));
4956
4956
  }
4957
- function xt(t) {
4957
+ function _t(t) {
4958
4958
  if (t === void 0) return;
4959
- if (K(t))
4960
- return Pt(t);
4961
- const e = At(t);
4959
+ if (_(t))
4960
+ return xt(t);
4961
+ const e = Pt(t);
4962
4962
  if (!e) return;
4963
4963
  const { data: n2, keyLength: r } = e, i = [];
4964
4964
  for (let s2 = 0; s2 < r; ++s2)
@@ -4971,16 +4971,16 @@
4971
4971
  }
4972
4972
  return i.map((s2) => Array.from(s2.values()));
4973
4973
  }
4974
- function ye(t, e = []) {
4974
+ function me(t, e = []) {
4975
4975
  if (t === void 0 || !t.getIsReadyOrError()) return;
4976
4976
  const n2 = t.resourceType.name, r = t.getDataAsJson();
4977
- if (e.length > 0 && (n2 === ae || n2 === z))
4977
+ if (e.length > 0 && (n2 === oe || n2 === q))
4978
4978
  throw new Error(`Unexpected nested super-partitioned resource: ${n2}`);
4979
4979
  switch (n2) {
4980
+ case ie:
4980
4981
  case se:
4981
- case oe:
4982
4982
  throw new Error(`Only data columns are supported, got: ${n2}`);
4983
- case q: {
4983
+ case H: {
4984
4984
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
4985
4985
  throw new Error(`Missing partitionKeyLength in metadata for ${n2}`);
4986
4986
  const i = [];
@@ -5001,7 +5001,7 @@
5001
5001
  throw new Error(`Missing partitionKeyLength in metadata for ${n2}`);
5002
5002
  const i = [], s2 = /* @__PURE__ */ new Map();
5003
5003
  for (const o of t.listInputFields()) {
5004
- const a = me(o), l2 = t.resolve({ field: o, assertFieldType: "Input" });
5004
+ const a = ge(o), l2 = t.resolve({ field: o, assertFieldType: "Input" });
5005
5005
  if (l2 === void 0) return;
5006
5006
  let u2 = s2.get(a.baseKey);
5007
5007
  u2 || (u2 = {}, s2.set(a.baseKey, u2)), a.type === "index" ? u2.index = l2 : u2.values = l2;
@@ -5023,16 +5023,16 @@
5023
5023
  parts: i
5024
5024
  };
5025
5025
  }
5026
- case ae: {
5026
+ case oe: {
5027
5027
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
5028
5028
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n2}`);
5029
5029
  const i = r.superPartitionKeyLength + r.partitionKeyLength, s2 = [];
5030
5030
  for (const o of t.listInputFields()) {
5031
5031
  const a = t.resolve({ field: o, assertFieldType: "Input" });
5032
5032
  if (a === void 0) return;
5033
- if (a.resourceType.name !== q)
5034
- throw new Error(`Expected ${q} inside ${n2}, but got ${a.resourceType.name}`);
5035
- const l2 = ye(a, JSON.parse(o));
5033
+ if (a.resourceType.name !== H)
5034
+ throw new Error(`Expected ${H} inside ${n2}, but got ${a.resourceType.name}`);
5035
+ const l2 = me(a, JSON.parse(o));
5036
5036
  if (l2 === void 0) return;
5037
5037
  if (l2.type !== "JsonPartitioned")
5038
5038
  throw new Error(`Unexpected inner result type for ${n2}: ${l2.type}`);
@@ -5044,7 +5044,7 @@
5044
5044
  parts: s2
5045
5045
  };
5046
5046
  }
5047
- case z: {
5047
+ case q: {
5048
5048
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
5049
5049
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n2}`);
5050
5050
  const i = r.superPartitionKeyLength + r.partitionKeyLength, s2 = [];
@@ -5053,7 +5053,7 @@
5053
5053
  if (a === void 0) return;
5054
5054
  if (a.resourceType.name !== B)
5055
5055
  throw new Error(`Expected ${B} inside ${n2}, but got ${a.resourceType.name}`);
5056
- const l2 = ye(a, JSON.parse(o));
5056
+ const l2 = me(a, JSON.parse(o));
5057
5057
  if (l2 === void 0) return;
5058
5058
  if (l2.type !== "BinaryPartitioned")
5059
5059
  throw new Error(`Unexpected inner result type for ${n2}: ${l2.type}`);
@@ -5071,13 +5071,13 @@
5071
5071
  }
5072
5072
  function It(t) {
5073
5073
  if (t !== void 0) {
5074
- if (K(t)) return t;
5075
- if (En(t)) return Cn(t);
5076
- if (t instanceof D) return ye(t);
5074
+ if (_(t)) return t;
5075
+ if (Oe(t)) return Ve$1(t);
5076
+ if (t instanceof D) return me(t);
5077
5077
  throw new Error(`Unexpected input type: ${typeof t}`);
5078
5078
  }
5079
5079
  }
5080
- function _t(t, e) {
5080
+ function Tt(t, e) {
5081
5081
  const n2 = [...e].sort((s2, o) => o[0] - s2[0]);
5082
5082
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
5083
5083
  const { partitionKeyLength: s2 } = t;
@@ -5137,25 +5137,25 @@
5137
5137
  }
5138
5138
  }
5139
5139
  }
5140
- function Tt(t) {
5140
+ function Lt(t) {
5141
5141
  if (!Array.isArray(t)) return false;
5142
5142
  if (t.length === 0) return true;
5143
5143
  const e = t[0];
5144
5144
  return typeof e == "object" && e !== null && "key" in e && "val" in e;
5145
5145
  }
5146
- class Lt {
5146
+ class Ft {
5147
5147
  constructor(e) {
5148
5148
  this.columns = e;
5149
5149
  }
5150
5150
  selectColumns(e) {
5151
- const n2 = typeof e == "function" ? e : Qn(e);
5151
+ const n2 = typeof e == "function" ? e : nn(e);
5152
5152
  return this.columns.filter((r) => n2(r.spec));
5153
5153
  }
5154
5154
  }
5155
5155
  function Et(t) {
5156
5156
  if (t)
5157
5157
  return t.map((e) => ({
5158
- type: `split:${Rn(e.axisId)}`,
5158
+ type: `split:${_e$1(e.axisId)}`,
5159
5159
  label: e.label,
5160
5160
  importance: 1e6
5161
5161
  // High importance for split filters in labels
@@ -5168,14 +5168,14 @@
5168
5168
  function Dt(t, e) {
5169
5169
  if (!e || e.length === 0) return t;
5170
5170
  const n2 = [...e].sort((r, i) => r[0] - i[0]);
5171
- return Oe({ id: t, axisFilters: n2 });
5171
+ return Re({ id: t, axisFilters: n2 });
5172
5172
  }
5173
5173
  function _e(t) {
5174
5174
  if (!t || typeof t != "object") return false;
5175
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);
5176
5176
  return !!e.domainAnchor || n2 || r;
5177
5177
  }
5178
- function Ft(t) {
5178
+ function Rt(t) {
5179
5179
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
5180
5180
  return [];
5181
5181
  const e = t.axes.map((n2, r) => typeof n2 == "object" && "split" in n2 && n2.split === true ? r : -1).filter((n2) => n2 !== -1);
@@ -5183,11 +5183,11 @@
5183
5183
  throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
5184
5184
  return e.sort((n2, r) => n2 - r), e;
5185
5185
  }
5186
- class le {
5186
+ class ae {
5187
5187
  constructor() {
5188
- F(this, "defaultProviderStore", []);
5189
- F(this, "providers", [new Lt(this.defaultProviderStore)]);
5190
- F(this, "axisLabelProviders", []);
5188
+ k(this, "defaultProviderStore", []);
5189
+ k(this, "providers", [new Ft(this.defaultProviderStore)]);
5190
+ k(this, "axisLabelProviders", []);
5191
5191
  }
5192
5192
  addColumnProvider(e) {
5193
5193
  return this.providers.push(e), this;
@@ -5215,126 +5215,126 @@
5215
5215
  };
5216
5216
  let u2 = () => false;
5217
5217
  if (a) {
5218
- const f2 = (Array.isArray(a) ? a : [a]).map((y) => {
5219
- if (_e(y)) {
5218
+ const p2 = (Array.isArray(a) ? a : [a]).map((y2) => {
5219
+ if (_e(y2)) {
5220
5220
  if (!r)
5221
5221
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
5222
- return Qn(Tn(r.anchors, y, n2));
5222
+ return nn(We(r.anchors, y2, n2));
5223
5223
  } else
5224
- return Qn(y);
5224
+ return nn(y2);
5225
5225
  });
5226
- u2 = (y) => f2.some((w2) => w2(y));
5226
+ u2 = (y2) => p2.some((C2) => C2(y2));
5227
5227
  }
5228
- const d = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], h2 = [], g = /* @__PURE__ */ new Set();
5229
- for (const f$1 of d) {
5230
- const y = _e(f$1);
5231
- let w2;
5232
- if (y) {
5228
+ const h = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], f = [], g2 = /* @__PURE__ */ new Set();
5229
+ for (const p2 of h) {
5230
+ const y$1 = _e(p2);
5231
+ let C2;
5232
+ if (y$1) {
5233
5233
  if (!r)
5234
5234
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
5235
- w2 = Tn(r.anchors, f$1, n2);
5235
+ C2 = We(r.anchors, p2, n2);
5236
5236
  } else
5237
- w2 = f$1;
5238
- const E2 = /* @__PURE__ */ new Set(), x = [];
5239
- for (const S of this.providers) {
5240
- const I = S.selectColumns(w2);
5237
+ C2 = p2;
5238
+ const E2 = /* @__PURE__ */ new Set(), _2 = [];
5239
+ for (const S2 of this.providers) {
5240
+ const I = S2.selectColumns(C2);
5241
5241
  for (const c2 of I) {
5242
5242
  if (u2(c2.spec)) continue;
5243
5243
  if (E2.has(c2.id))
5244
- throw new Error(`Duplicate column id ${c2.id} in provider ${S.constructor.name}`);
5245
- const m2 = Yn(c2.spec);
5246
- g.has(m2) || (E2.add(c2.id), g.add(m2), x.push(c2));
5244
+ throw new Error(`Duplicate column id ${c2.id} in provider ${S2.constructor.name}`);
5245
+ const m2 = tn(c2.spec);
5246
+ g2.has(m2) || (E2.add(c2.id), g2.add(m2), _2.push(c2));
5247
5247
  }
5248
5248
  }
5249
- if (x.length === 0) continue;
5250
- const C = Ft(f$1), A = C.length > 0;
5251
- for (const S of x) {
5252
- if (!f(S.spec)) continue;
5253
- const I = S.spec;
5254
- if (A) {
5255
- if (Tt(S.data))
5256
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${S.id}`);
5257
- const c2 = It(S.data);
5249
+ if (_2.length === 0) continue;
5250
+ const w = Rt(p2), A2 = w.length > 0;
5251
+ for (const S2 of _2) {
5252
+ if (!d(S2.spec)) continue;
5253
+ const I = S2.spec;
5254
+ if (A2) {
5255
+ if (Lt(S2.data))
5256
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${S2.id}`);
5257
+ const c2 = It(S2.data);
5258
5258
  if (!c2) {
5259
5259
  if (s2) continue;
5260
5260
  return;
5261
5261
  }
5262
- if (!Sn(c2))
5263
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c2.type} for column ${S.id}`);
5264
- const m2 = xt(c2), _ = C[C.length - 1];
5265
- if (_ >= c2.partitionKeyLength)
5266
- throw new Error(`Not enough partition keys (${c2.partitionKeyLength}) for requested split axes (max index ${_}) in column ${I.name}`);
5267
- const W = C.map((T) => this.findLabels(p$1(I.axesSpec[T]))), j2 = [], $ = (T, G) => {
5268
- if (G >= C.length) {
5269
- if (j2.push([...T]), j2.length > 1e4)
5262
+ if (!$e(c2))
5263
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c2.type} for column ${S2.id}`);
5264
+ const m2 = _t(c2), T = w[w.length - 1];
5265
+ if (T >= c2.partitionKeyLength)
5266
+ throw new Error(`Not enough partition keys (${c2.partitionKeyLength}) for requested split axes (max index ${T}) in column ${I.name}`);
5267
+ const U = w.map((L2) => this.findLabels(y(I.axesSpec[L2]))), V = [], J = (L2, W) => {
5268
+ if (W >= w.length) {
5269
+ if (V.push([...L2]), V.length > 1e4)
5270
5270
  throw new Error("Too many key combinations, aborting.");
5271
5271
  return;
5272
5272
  }
5273
- const N2 = C[G];
5274
- if (N2 >= m2.length)
5275
- throw new Error(`Axis index ${N2} out of bounds for unique keys array (length ${m2.length}) during split key generation for column ${S.id}`);
5276
- const J2 = m2[N2];
5277
- if (!J2 || J2.length === 0) {
5278
- j2.length = 0;
5273
+ const j = w[W];
5274
+ if (j >= m2.length)
5275
+ throw new Error(`Axis index ${j} out of bounds for unique keys array (length ${m2.length}) during split key generation for column ${S2.id}`);
5276
+ const M = m2[j];
5277
+ if (!M || M.length === 0) {
5278
+ V.length = 0;
5279
5279
  return;
5280
5280
  }
5281
- for (const ee2 of J2)
5282
- T.push(ee2), $(T, G + 1), T.pop();
5281
+ for (const Z of M)
5282
+ L2.push(Z), J(L2, W + 1), L2.pop();
5283
5283
  };
5284
- if ($([], 0), j2.length === 0)
5284
+ if (J([], 0), V.length === 0)
5285
5285
  continue;
5286
- const V = [...I.axesSpec], Be = C.map((T) => T);
5287
- for (let T = C.length - 1; T >= 0; T--)
5288
- V.splice(C[T], 1);
5289
- const We = { ...I, axesSpec: V };
5290
- for (const T of j2) {
5291
- const G = T.map((N2, J2) => {
5292
- const ee2 = Be[J2], Ge = p$1(I.axesSpec[ee2]), ue = W[J2], He = (ue == null ? void 0 : ue[N2]) ?? String(N2);
5293
- return { axisIdx: ee2, axisId: Ge, value: N2, label: He };
5286
+ const K = [...I.axesSpec], Ue = w.map((L2) => L2);
5287
+ for (let L2 = w.length - 1; L2 >= 0; L2--)
5288
+ K.splice(w[L2], 1);
5289
+ const We2 = { ...I, axesSpec: K };
5290
+ for (const L2 of V) {
5291
+ const W = L2.map((j, M) => {
5292
+ const Z = Ue[M], Ge = y(I.axesSpec[Z]), le = U[M], He2 = (le == null ? void 0 : le[j]) ?? String(j);
5293
+ return { axisIdx: Z, axisId: Ge, value: j, label: He2 };
5294
5294
  });
5295
- h2.push({
5295
+ f.push({
5296
5296
  type: "split",
5297
- originalColumn: S,
5297
+ originalColumn: S2,
5298
5298
  spec: I,
5299
- adjustedSpec: We,
5299
+ adjustedSpec: We2,
5300
5300
  dataEntries: c2,
5301
- axisFilters: G
5301
+ axisFilters: W
5302
5302
  });
5303
5303
  }
5304
5304
  } else
5305
- h2.push({
5305
+ f.push({
5306
5306
  type: "direct",
5307
- originalColumn: S,
5307
+ originalColumn: S2,
5308
5308
  spec: I,
5309
5309
  adjustedSpec: I
5310
5310
  });
5311
5311
  }
5312
5312
  }
5313
- if (h2.length === 0) return [];
5314
- const p2 = $e(
5315
- h2,
5316
- (f2) => ({
5317
- spec: f2.spec,
5318
- suffixTrace: f2.type === "split" ? Et(f2.axisFilters) : void 0
5313
+ if (f.length === 0) return [];
5314
+ const d$1 = Je(
5315
+ f,
5316
+ (p2) => ({
5317
+ spec: p2.spec,
5318
+ suffixTrace: p2.type === "split" ? Et(p2.axisFilters) : void 0
5319
5319
  }),
5320
5320
  l2
5321
5321
  ), b = [];
5322
- for (const { value: f2, label: y } of p2) {
5323
- const { originalColumn: w2, spec: E2 } = f2, x = f2.type === "split" ? f2.axisFilters : void 0, C = kt(x);
5324
- let A;
5325
- r ? A = r.deriveS(E2, C) : A = Dt(w2.id, C);
5326
- let S = { ...f2.adjustedSpec };
5327
- o && (S = {
5328
- ...S,
5322
+ for (const { value: p2, label: y2 } of d$1) {
5323
+ const { originalColumn: C2, spec: E2 } = p2, _2 = p2.type === "split" ? p2.axisFilters : void 0, w = kt(_2);
5324
+ let A2;
5325
+ r ? A2 = r.deriveS(E2, w) : A2 = Dt(C2.id, w);
5326
+ let S2 = { ...p2.adjustedSpec };
5327
+ o && (S2 = {
5328
+ ...S2,
5329
5329
  annotations: {
5330
- ...S.annotations ?? {},
5331
- "pl7.app/label": y
5330
+ ...S2.annotations ?? {},
5331
+ "pl7.app/label": y2
5332
5332
  }
5333
5333
  }), b.push({
5334
- id: A,
5335
- spec: S,
5336
- data: () => f2.type === "split" ? Jn(_t(f2.dataEntries, C)) : f2.originalColumn.data,
5337
- label: y
5334
+ id: A2,
5335
+ spec: S2,
5336
+ data: () => p2.type === "split" ? Ie$1(Tt(p2.dataEntries, w)) : p2.originalColumn.data,
5337
+ label: y2
5338
5338
  });
5339
5339
  }
5340
5340
  return b;
@@ -5362,19 +5362,19 @@
5362
5362
  return i;
5363
5363
  }
5364
5364
  }
5365
- function de(t, e) {
5365
+ function ce(t, e) {
5366
5366
  if (t === void 0) return e === void 0;
5367
5367
  if (e === void 0) return true;
5368
5368
  for (const n2 in e)
5369
5369
  if (t[n2] !== e[n2]) return false;
5370
5370
  return true;
5371
5371
  }
5372
- function Te(t) {
5373
- return Xn(t, (e) => e instanceof D ? e.handle : En(e) ? Nn(e, (n2) => n2.handle) : e);
5372
+ function Ie(t) {
5373
+ return Ze(t, (e) => e instanceof D ? e.handle : Oe(e) ? Ce(e, (n2) => n2.handle) : e);
5374
5374
  }
5375
5375
  class Ot {
5376
5376
  constructor() {
5377
- F(this, "ctx", v());
5377
+ k(this, "ctx", v());
5378
5378
  }
5379
5379
  /**
5380
5380
  * @deprecated use getOptions()
@@ -5383,28 +5383,28 @@
5383
5383
  return this.ctx.calculateOptions(e);
5384
5384
  }
5385
5385
  getOptions(e, n2) {
5386
- const r = typeof e == "function" ? e : Qn(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
5386
+ const r = typeof e == "function" ? e : nn(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
5387
5387
  let s2 = {}, o = false;
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: re$1(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" ? Je(i, (a) => a.obj, s2 ?? {}).map(({ value: { ref: a }, label: l2 }) => ({
5389
+ ref: un(a, o),
5390
5390
  label: l2
5391
5391
  })) : i.map(({ ref: a, obj: l2 }) => ({
5392
- ref: re$1(a, o),
5392
+ ref: un(a, o),
5393
5393
  label: s2(l2, a)
5394
5394
  }));
5395
5395
  }
5396
5396
  resolveAnchorCtx(e) {
5397
- if (e instanceof Mn) return e;
5397
+ if (e instanceof He) return e;
5398
5398
  const n2 = {};
5399
5399
  for (const [r, i] of Object.entries(e))
5400
- if (ee(i)) {
5400
+ if (sn(i)) {
5401
5401
  const s2 = this.getPColumnSpecByRef(i);
5402
5402
  if (!s2)
5403
5403
  return;
5404
5404
  n2[r] = s2;
5405
5405
  } else
5406
5406
  n2[r] = i;
5407
- return new Mn(n2);
5407
+ return new He(n2);
5408
5408
  }
5409
5409
  /**
5410
5410
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -5417,7 +5417,7 @@
5417
5417
  getAnchoredPColumns(e, n2, r) {
5418
5418
  const i = this.resolveAnchorCtx(e);
5419
5419
  if (i)
5420
- return new le().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n2, {
5420
+ return new ae().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n2, {
5421
5421
  ...r,
5422
5422
  anchorCtx: i
5423
5423
  });
@@ -5454,7 +5454,7 @@
5454
5454
  getCanonicalOptions(e, n2, r) {
5455
5455
  const i = this.resolveAnchorCtx(e);
5456
5456
  if (!i) return;
5457
- const s2 = new le().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n2, {
5457
+ const s2 = new ae().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n2, {
5458
5458
  ...r,
5459
5459
  anchorCtx: i
5460
5460
  });
@@ -5497,7 +5497,7 @@
5497
5497
  ref: n2.ref,
5498
5498
  obj: {
5499
5499
  ...n2.obj,
5500
- data: ie(
5500
+ data: fn(
5501
5501
  n2.obj.data,
5502
5502
  (r) => new D(r, [n2.ref.blockId, n2.ref.name])
5503
5503
  )
@@ -5526,7 +5526,7 @@
5526
5526
  )) == null ? void 0 : r.obj;
5527
5527
  const n2 = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
5528
5528
  if (n2)
5529
- return Xn(
5529
+ return Ze(
5530
5530
  n2,
5531
5531
  (i) => new D(i, [e.blockId, e.name])
5532
5532
  );
@@ -5539,7 +5539,7 @@
5539
5539
  getPColumnByRef(e) {
5540
5540
  const n2 = this.getDataByRef(e);
5541
5541
  if (n2)
5542
- return Wn(n2);
5542
+ return Ye(n2);
5543
5543
  }
5544
5544
  /**
5545
5545
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -5549,7 +5549,7 @@
5549
5549
  getPColumnSpecByRef(e) {
5550
5550
  const n2 = this.getSpecByRef(e);
5551
5551
  if (n2) {
5552
- if (!f(n2)) throw new Error(`not a PColumn spec (kind = ${n2.kind})`);
5552
+ if (!d(n2)) throw new Error(`not a PColumn spec (kind = ${n2.kind})`);
5553
5553
  return n2;
5554
5554
  }
5555
5555
  }
@@ -5568,13 +5568,13 @@
5568
5568
  findDataWithCompatibleSpec(e) {
5569
5569
  const n2 = [];
5570
5570
  e: for (const r of this.getData().entries) {
5571
- if (!f(r.obj.spec))
5571
+ if (!d(r.obj.spec))
5572
5572
  continue;
5573
5573
  const i = r.obj.spec;
5574
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && de(e.domain, i.domain)) {
5574
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && ce(e.domain, i.domain)) {
5575
5575
  for (let s2 = 0; s2 < e.axesSpec.length; ++s2) {
5576
5576
  const o = e.axesSpec[s2], a = i.axesSpec[s2];
5577
- if (o.name !== a.name || o.type !== a.type || !de(o.domain, a.domain))
5577
+ if (o.name !== a.name || o.type !== a.type || !ce(o.domain, a.domain))
5578
5578
  continue e;
5579
5579
  }
5580
5580
  n2.push(r.obj);
@@ -5589,9 +5589,9 @@
5589
5589
  findLabels(e) {
5590
5590
  const n2 = this.getData();
5591
5591
  for (const r of n2.entries) {
5592
- if (!rn(r.obj)) continue;
5592
+ if (!ie$1(r.obj)) continue;
5593
5593
  const i = r.obj.spec;
5594
- 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)) {
5594
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && ce(e.domain, i.axesSpec[0].domain)) {
5595
5595
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
5596
5596
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
5597
5597
  return Object.fromEntries(
@@ -5610,13 +5610,13 @@
5610
5610
  * @returns An array of PColumn objects matching the selectors. Data is loaded on first access.
5611
5611
  */
5612
5612
  selectColumns(e) {
5613
- const n2 = typeof e == "function" ? e : Qn(e);
5614
- return this.getSpecs().entries.filter(({ obj: i }) => f(i) ? n2(i) : false).map(({ ref: i, obj: s2 }) => {
5613
+ const n2 = typeof e == "function" ? e : nn(e);
5614
+ return this.getSpecs().entries.filter(({ obj: i }) => d(i) ? n2(i) : false).map(({ ref: i, obj: s2 }) => {
5615
5615
  const o = s2;
5616
5616
  let a = null;
5617
5617
  const l2 = this;
5618
5618
  return {
5619
- id: Oe(i),
5619
+ id: Re(i),
5620
5620
  spec: o,
5621
5621
  get data() {
5622
5622
  var u2;
@@ -5641,39 +5641,57 @@
5641
5641
  return r;
5642
5642
  }
5643
5643
  }
5644
- class te {
5644
+ class ee {
5645
5645
  constructor() {
5646
- F(this, "ctx");
5647
- F(this, "args");
5648
- F(this, "uiState");
5649
- F(this, "_activeArgsCache");
5650
- F(this, "resultPool", new Ot());
5651
- this.ctx = v(), 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, "_argsCache");
5648
+ k(this, "_uiStateCache");
5649
+ k(this, "_activeArgsCache");
5650
+ k(this, "resultPool", new Ot());
5651
+ this.ctx = v();
5652
+ }
5653
+ get args() {
5654
+ if (this._argsCache === void 0) {
5655
+ const e = this.ctx.args, n2 = typeof e == "function" ? e() : e;
5656
+ this._argsCache = { v: JSON.parse(n2) };
5657
+ }
5658
+ return this._argsCache.v;
5659
+ }
5660
+ get uiState() {
5661
+ if (this._uiStateCache === void 0) {
5662
+ const e = this.ctx.uiState, n2 = typeof e == "function" ? e() : e;
5663
+ this._uiStateCache = { v: n2 ? JSON.parse(n2) : {} };
5664
+ }
5665
+ return this._uiStateCache.v;
5652
5666
  }
5653
5667
  /**
5654
5668
  * Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
5655
5669
  * Returns undefined, if block was never executed or stopped mid-way execution, so that the result was cleared.
5656
5670
  * */
5657
5671
  get activeArgs() {
5658
- return this._activeArgsCache === void 0 && (this._activeArgsCache = {
5659
- v: this.ctx.activeArgs ? JSON.parse(this.ctx.activeArgs) : void 0
5660
- }), this._activeArgsCache.v;
5672
+ if (this._activeArgsCache === void 0) {
5673
+ const e = this.ctx.activeArgs, n2 = typeof e == "function" ? e() : e;
5674
+ this._activeArgsCache = {
5675
+ v: n2 ? JSON.parse(n2) : void 0
5676
+ };
5677
+ }
5678
+ return this._activeArgsCache.v;
5661
5679
  }
5662
5680
  // /** Can be used to determine features provided by the desktop instance. */
5663
5681
  // public get featureFlags() {
5664
5682
  // return this.ctx.featureFlags;
5665
5683
  // }
5666
5684
  getNamedAccessor(e) {
5667
- return he(
5685
+ return fe(
5668
5686
  this.ctx.getAccessorHandleByName(e),
5669
5687
  (n2) => new D(n2, [e])
5670
5688
  );
5671
5689
  }
5672
5690
  get prerun() {
5673
- return this.getNamedAccessor(Ke);
5691
+ return this.getNamedAccessor(Ne);
5674
5692
  }
5675
5693
  get outputs() {
5676
- return this.getNamedAccessor(je);
5694
+ return this.getNamedAccessor(Ve);
5677
5695
  }
5678
5696
  /**
5679
5697
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -5685,7 +5703,7 @@
5685
5703
  }
5686
5704
  verifyInlineAndExplicitColumnsSupport(e) {
5687
5705
  var i;
5688
- const n2 = e.some((s2) => !(s2.data instanceof D) || En(s2.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
5706
+ const n2 = e.some((s2) => !(s2.data instanceof D) || Oe(s2.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
5689
5707
  if (n2 && !r) throw Error("Inline or explicit columns not supported");
5690
5708
  }
5691
5709
  patchPTableDef(e) {
@@ -5699,7 +5717,7 @@
5699
5717
  // TODO remove all non-PColumn fields
5700
5718
  createPFrame(e) {
5701
5719
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
5702
- e.map((n2) => Te(n2))
5720
+ e.map((n2) => Ie(n2))
5703
5721
  );
5704
5722
  }
5705
5723
  createPTable(e) {
@@ -5712,8 +5730,8 @@
5712
5730
  partitionFilters: e.filters ?? [],
5713
5731
  filters: [],
5714
5732
  sorting: e.sorting ?? []
5715
- }) : n2 = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(Gn(n2.src)), this.ctx.createPTable(
5716
- Un(n2, (r) => Te(r))
5733
+ }) : n2 = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(en(n2.src)), this.ctx.createPTable(
5734
+ qe$1(n2, (r) => Ie(r))
5717
5735
  );
5718
5736
  }
5719
5737
  /** @deprecated scheduled for removal from SDK */
@@ -5733,34 +5751,35 @@
5733
5751
  this.ctx.logError(e);
5734
5752
  }
5735
5753
  }
5736
- const Y = "1.38.0";
5737
- function Rt(t) {
5754
+ const z = "1.39.0";
5755
+ function Kt(t) {
5738
5756
  return t.__renderLambda === true;
5739
5757
  }
5740
- function pe(t) {
5758
+ function de(t) {
5741
5759
  if (t !== void 0)
5742
- return Rt(t) ? t.handle : t;
5760
+ return Kt(t) ? t.handle : t;
5743
5761
  }
5744
- class k {
5745
- constructor(e, n2, r, i, s2, o, a, l2) {
5746
- this._renderingMode = e, this._initialArgs = n2, this._initialUiState = r, this._outputs = i, this._inputsValid = s2, this._sections = o, this._title = a, this._enrichmentTargets = l2;
5762
+ const x = class x2 {
5763
+ constructor(e, n2, r, i, s2, o, a, l2, u2) {
5764
+ this._renderingMode = e, this._initialArgs = n2, this._initialUiState = r, this._outputs = i, this._inputsValid = s2, this._sections = o, this._title = a, this._enrichmentTargets = l2, this._featureFlags = u2;
5747
5765
  }
5748
5766
  static create(e = "Heavy") {
5749
- return new k(
5767
+ return new x2(
5750
5768
  e,
5751
5769
  void 0,
5752
5770
  {},
5753
5771
  {},
5754
- re(true),
5755
- re([]),
5772
+ ne(true),
5773
+ ne([]),
5774
+ void 0,
5756
5775
  void 0,
5757
- void 0
5776
+ { ...x2.INITIAL_BLOCK_FEATURE_FLAGS }
5758
5777
  );
5759
5778
  }
5760
5779
  output(e, n2, r = {}) {
5761
5780
  if (typeof n2 == "function") {
5762
5781
  const i = `output#${e}`;
5763
- return H(i, () => n2(new te())), new k(
5782
+ return G(i, () => n2(new ee())), new x2(
5764
5783
  this._renderingMode,
5765
5784
  this._initialArgs,
5766
5785
  this._initialUiState,
@@ -5775,10 +5794,11 @@
5775
5794
  this._inputsValid,
5776
5795
  this._sections,
5777
5796
  this._title,
5778
- this._enrichmentTargets
5797
+ this._enrichmentTargets,
5798
+ this._featureFlags
5779
5799
  );
5780
5800
  } else
5781
- return new k(
5801
+ return new x2(
5782
5802
  this._renderingMode,
5783
5803
  this._initialArgs,
5784
5804
  this._initialUiState,
@@ -5789,7 +5809,8 @@
5789
5809
  this._inputsValid,
5790
5810
  this._sections,
5791
5811
  this._title,
5792
- this._enrichmentTargets
5812
+ this._enrichmentTargets,
5813
+ this._featureFlags
5793
5814
  );
5794
5815
  }
5795
5816
  /** Shortcut for {@link output} with retentive flag set to true. */
@@ -5797,7 +5818,7 @@
5797
5818
  return this.output(e, n2, { retentive: true });
5798
5819
  }
5799
5820
  argsValid(e) {
5800
- return typeof e == "function" ? (H("inputsValid", () => e(new te())), new k(
5821
+ return typeof e == "function" ? (G("inputsValid", () => e(new ee())), new x2(
5801
5822
  this._renderingMode,
5802
5823
  this._initialArgs,
5803
5824
  this._initialUiState,
@@ -5808,8 +5829,9 @@
5808
5829
  },
5809
5830
  this._sections,
5810
5831
  this._title,
5811
- this._enrichmentTargets
5812
- )) : new k(
5832
+ this._enrichmentTargets,
5833
+ this._featureFlags
5834
+ )) : new x2(
5813
5835
  this._renderingMode,
5814
5836
  this._initialArgs,
5815
5837
  this._initialUiState,
@@ -5817,11 +5839,12 @@
5817
5839
  e,
5818
5840
  this._sections,
5819
5841
  this._title,
5820
- this._enrichmentTargets
5842
+ this._enrichmentTargets,
5843
+ this._featureFlags
5821
5844
  );
5822
5845
  }
5823
5846
  sections(e) {
5824
- return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new k(
5847
+ return Array.isArray(e) ? this.sections(ne(e)) : typeof e == "function" ? (G("sections", () => e(new ee())), new x2(
5825
5848
  this._renderingMode,
5826
5849
  this._initialArgs,
5827
5850
  this._initialUiState,
@@ -5829,8 +5852,9 @@
5829
5852
  this._inputsValid,
5830
5853
  { __renderLambda: true, handle: "sections" },
5831
5854
  this._title,
5832
- this._enrichmentTargets
5833
- )) : new k(
5855
+ this._enrichmentTargets,
5856
+ this._featureFlags
5857
+ )) : new x2(
5834
5858
  this._renderingMode,
5835
5859
  this._initialArgs,
5836
5860
  this._initialUiState,
@@ -5838,12 +5862,13 @@
5838
5862
  this._inputsValid,
5839
5863
  e,
5840
5864
  this._title,
5841
- this._enrichmentTargets
5865
+ this._enrichmentTargets,
5866
+ this._featureFlags
5842
5867
  );
5843
5868
  }
5844
5869
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
5845
5870
  title(e) {
5846
- return H("title", () => e(new te())), new k(
5871
+ return G("title", () => e(new ee())), new x2(
5847
5872
  this._renderingMode,
5848
5873
  this._initialArgs,
5849
5874
  this._initialUiState,
@@ -5851,7 +5876,8 @@
5851
5876
  this._inputsValid,
5852
5877
  this._sections,
5853
5878
  { __renderLambda: true, handle: "title" },
5854
- this._enrichmentTargets
5879
+ this._enrichmentTargets,
5880
+ this._featureFlags
5855
5881
  );
5856
5882
  }
5857
5883
  /**
@@ -5859,7 +5885,7 @@
5859
5885
  * @deprecated use {@link withArgs}
5860
5886
  * */
5861
5887
  initialArgs(e) {
5862
- return new k(
5888
+ return new x2(
5863
5889
  this._renderingMode,
5864
5890
  e,
5865
5891
  this._initialUiState,
@@ -5867,12 +5893,13 @@
5867
5893
  this._inputsValid,
5868
5894
  this._sections,
5869
5895
  this._title,
5870
- this._enrichmentTargets
5896
+ this._enrichmentTargets,
5897
+ this._featureFlags
5871
5898
  );
5872
5899
  }
5873
5900
  /** Sets initial args for the block, this value must be specified. */
5874
5901
  withArgs(e) {
5875
- return new k(
5902
+ return new x2(
5876
5903
  this._renderingMode,
5877
5904
  e,
5878
5905
  this._initialUiState,
@@ -5880,12 +5907,13 @@
5880
5907
  this._inputsValid,
5881
5908
  this._sections,
5882
5909
  this._title,
5883
- this._enrichmentTargets
5910
+ this._enrichmentTargets,
5911
+ this._featureFlags
5884
5912
  );
5885
5913
  }
5886
5914
  /** Defines type and sets initial value for block UiState. */
5887
5915
  withUiState(e) {
5888
- return new k(
5916
+ return new x2(
5889
5917
  this._renderingMode,
5890
5918
  this._initialArgs,
5891
5919
  e,
@@ -5893,7 +5921,8 @@
5893
5921
  this._inputsValid,
5894
5922
  this._sections,
5895
5923
  this._title,
5896
- this._enrichmentTargets
5924
+ this._enrichmentTargets,
5925
+ this._featureFlags
5897
5926
  );
5898
5927
  }
5899
5928
  /**
@@ -5901,7 +5930,7 @@
5901
5930
  * Influences dependency graph construction.
5902
5931
  */
5903
5932
  enriches(e) {
5904
- return H("enrichmentTargets", e), new k(
5933
+ return G("enrichmentTargets", e), new x2(
5905
5934
  this._renderingMode,
5906
5935
  this._initialArgs,
5907
5936
  this._initialUiState,
@@ -5909,7 +5938,8 @@
5909
5938
  this._inputsValid,
5910
5939
  this._sections,
5911
5940
  this._title,
5912
- { __renderLambda: true, handle: "enrichmentTargets" }
5941
+ { __renderLambda: true, handle: "enrichmentTargets" },
5942
+ this._featureFlags
5913
5943
  );
5914
5944
  }
5915
5945
  /** Renders all provided block settings into a pre-configured platforma API
@@ -5919,7 +5949,7 @@
5919
5949
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
5920
5950
  const e = {
5921
5951
  v3: {
5922
- sdkVersion: Y,
5952
+ sdkVersion: z,
5923
5953
  renderingMode: this._renderingMode,
5924
5954
  initialArgs: this._initialArgs,
5925
5955
  initialUiState: this._initialUiState,
@@ -5927,22 +5957,29 @@
5927
5957
  sections: this._sections,
5928
5958
  title: this._title,
5929
5959
  outputs: this._outputs,
5930
- enrichmentTargets: this._enrichmentTargets
5960
+ enrichmentTargets: this._enrichmentTargets,
5961
+ featureFlags: this._featureFlags
5931
5962
  },
5932
5963
  // fields below are added to allow previous desktop versions read generated configs
5933
- sdkVersion: Y,
5964
+ sdkVersion: z,
5934
5965
  renderingMode: this._renderingMode,
5935
5966
  initialArgs: this._initialArgs,
5936
- inputsValid: pe(this._inputsValid),
5937
- sections: pe(this._sections),
5967
+ inputsValid: de(this._inputsValid),
5968
+ sections: de(this._sections),
5938
5969
  outputs: Object.fromEntries(
5939
- Object.entries(this._outputs).map(([n2, r]) => [n2, pe(r)])
5970
+ Object.entries(this._outputs).map(([n2, r]) => [n2, de(r)])
5940
5971
  )
5941
5972
  };
5942
- return pt() ? Ve({ sdkVersion: Y }) : { config: e };
5973
+ return ft() ? Ke({ sdkVersion: z }) : { config: e };
5943
5974
  }
5944
- }
5945
- function Ue() {
5975
+ };
5976
+ k(x, "INITIAL_BLOCK_FEATURE_FLAGS", {
5977
+ supportsLazyState: true,
5978
+ requiresUIAPIVersion: 1,
5979
+ requiresModelAPIVersion: 1
5980
+ });
5981
+ let Te = x;
5982
+ function Be() {
5946
5983
  return {
5947
5984
  sourceId: null,
5948
5985
  hiddenColIds: null,
@@ -5951,28 +5988,28 @@
5951
5988
  sorting: []
5952
5989
  };
5953
5990
  }
5954
- function Vt() {
5991
+ function Nt() {
5955
5992
  return {
5956
5993
  version: 3,
5957
5994
  stateCache: [],
5958
- pTableParams: Ue()
5995
+ pTableParams: Be()
5959
5996
  };
5960
5997
  }
5961
- function Kt(t) {
5998
+ function Vt(t) {
5962
5999
  return "version" in t ? (t.version === 2 && (t = {
5963
6000
  version: 3,
5964
6001
  stateCache: t.stateCache.map((e) => ({
5965
6002
  ...e,
5966
6003
  filtersState: []
5967
6004
  })),
5968
- pTableParams: Ue()
5969
- }), t) : Vt();
6005
+ pTableParams: Be()
6006
+ }), t) : Nt();
5970
6007
  }
5971
- function be(t) {
6008
+ function ye(t) {
5972
6009
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
5973
6010
  }
5974
6011
  function jt(t) {
5975
- return new le().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
6012
+ return new ae().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
5976
6013
  name: "pl7.app/label",
5977
6014
  axes: [{}]
5978
6015
  // exactly one axis
@@ -5981,41 +6018,41 @@
5981
6018
  function Le(t, e) {
5982
6019
  const n2 = [], r = [];
5983
6020
  for (const a of t)
5984
- be(a.spec) ? n2.push(a) : r.push(a);
6021
+ ye(a.spec) ? n2.push(a) : r.push(a);
5985
6022
  const i = [];
5986
6023
  for (const a of r)
5987
6024
  for (const l2 of a.spec.axesSpec) {
5988
- const u2 = p$1(l2);
5989
- i.some((d) => Z$1(d, u2)) || i.push(u2);
6025
+ const u2 = y(l2);
6026
+ i.some((h) => ne$1(h, u2)) || i.push(u2);
5990
6027
  }
5991
6028
  for (const a of n2) {
5992
- const l2 = p$1(a.spec.axesSpec[0]), u2 = i.findIndex((d) => Z$1(d, l2));
6029
+ const l2 = y(a.spec.axesSpec[0]), u2 = i.findIndex((h) => ne$1(h, l2));
5993
6030
  u2 !== -1 && i.splice(u2, 1);
5994
6031
  }
5995
6032
  const s2 = (a, l2) => {
5996
6033
  let u2 = a.toString();
5997
6034
  if (l2)
5998
- for (const d in l2)
5999
- u2 += d, u2 += l2[d];
6035
+ for (const h in l2)
6036
+ u2 += h, u2 += l2[h];
6000
6037
  return u2;
6001
6038
  }, o = [];
6002
6039
  for (const a of e) {
6003
- const l2 = a.spec.axesSpec[0], u2 = p$1(l2), d = i.findIndex((h2) => Z$1(h2, u2));
6004
- if (d !== -1) {
6005
- const h2 = i[d], g = Object.keys(h2.domain ?? {}).length, p2 = Object.keys(l2.domain ?? {}).length;
6006
- g > p2 ? o.push({
6007
- id: s2(a.id, h2.domain),
6040
+ const l2 = a.spec.axesSpec[0], u2 = y(l2), h = i.findIndex((f) => ne$1(f, u2));
6041
+ if (h !== -1) {
6042
+ const f = i[h], g2 = Object.keys(f.domain ?? {}).length, d2 = Object.keys(l2.domain ?? {}).length;
6043
+ g2 > d2 ? o.push({
6044
+ id: s2(a.id, f.domain),
6008
6045
  spec: {
6009
6046
  ...a.spec,
6010
- axesSpec: [{ ...h2, annotations: l2.annotations }]
6047
+ axesSpec: [{ ...f, annotations: l2.annotations }]
6011
6048
  },
6012
6049
  data: a.data
6013
- }) : o.push(a), i.splice(d, 1);
6050
+ }) : o.push(a), i.splice(h, 1);
6014
6051
  }
6015
6052
  }
6016
6053
  return o;
6017
6054
  }
6018
- function Nt(t) {
6055
+ function Jt(t) {
6019
6056
  const e = (i) => Array.isArray(i), n2 = (i) => i instanceof D, r = (i) => typeof i == "object" && "type" in i;
6020
6057
  return t.map((i) => i.data).every((i) => {
6021
6058
  if (e(i))
@@ -6035,7 +6072,7 @@
6035
6072
  throw Error(`unsupported column data type: ${i}`);
6036
6073
  });
6037
6074
  }
6038
- function Ee(t) {
6075
+ function Fe(t) {
6039
6076
  let e = t.columns;
6040
6077
  const n2 = [];
6041
6078
  if (t.coreColumnPredicate) {
@@ -6057,69 +6094,69 @@
6057
6094
  sorting: t.sorting
6058
6095
  };
6059
6096
  }
6060
- function $t(t) {
6097
+ function Mt(t) {
6061
6098
  var e;
6062
6099
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
6063
6100
  }
6064
- function Jt(t) {
6101
+ function $t(t) {
6065
6102
  var e;
6066
6103
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
6067
6104
  }
6068
- function fe(t, e) {
6105
+ function pe(t, e) {
6069
6106
  return [...new Map(t.map((n2) => [e(n2), n2])).values()];
6070
6107
  }
6071
- function Vn(t, e, n2, r) {
6108
+ function Nn(t, e, n2, r) {
6072
6109
  if (e.length === 0) return;
6073
- const i = e.filter((c2) => !$t(c2.spec)), s2 = Kt(n2), o = jt(t.resultPool);
6110
+ const i = e.filter((c2) => !Mt(c2.spec)), s2 = Vt(n2), o = jt(t.resultPool);
6074
6111
  if (!o) return;
6075
- const a = Le(i.map(Fn), o), l2 = [...i, ...a], d = [
6076
- ...fe(
6077
- [...l2.flatMap((c2) => c2.spec.axesSpec.map((m2) => p$1(m2)))],
6078
- (c2) => ce$1(c2)
6112
+ const a = Le(i.map(Me$1), o), l2 = [...i, ...a], h = [
6113
+ ...pe(
6114
+ [...l2.flatMap((c2) => c2.spec.axesSpec.map((m2) => y(m2)))],
6115
+ (c2) => mn(c2)
6079
6116
  ).map((c2) => ({ type: "axis", id: c2 })),
6080
6117
  ...l2.map((c2) => ({ type: "column", id: c2.id }))
6081
- ], h2 = new Set(d.map((c2) => ce$1(c2))), g = (c2) => h2.has(ce$1(c2)), p2 = "full", b = s2.pTableParams.partitionFilters.filter((c2) => {
6082
- const m2 = g(c2.column);
6118
+ ], f = new Set(h.map((c2) => mn(c2))), g2 = (c2) => f.has(mn(c2)), d2 = "full", b = s2.pTableParams.partitionFilters.filter((c2) => {
6119
+ const m2 = g2(c2.column);
6083
6120
  return m2 || t.logWarn(`Partition filter ${JSON.stringify(c2)} does not match provided columns, skipping`), m2;
6084
- }), f2 = fe(
6121
+ }), p2 = pe(
6085
6122
  [...[], ...s2.pTableParams.filters],
6086
- (c2) => ce$1(c2.column)
6123
+ (c2) => mn(c2.column)
6087
6124
  ).filter((c2) => {
6088
- const m2 = g(c2.column);
6125
+ const m2 = g2(c2.column);
6089
6126
  return m2 || t.logWarn(`Filter ${JSON.stringify(c2)} does not match provided columns, skipping`), m2;
6090
- }), y = fe(
6127
+ }), y$1 = pe(
6091
6128
  [...[], ...s2.pTableParams.sorting],
6092
- (c2) => ce$1(c2.column)
6129
+ (c2) => mn(c2.column)
6093
6130
  ).filter((c2) => {
6094
- const m2 = g(c2.column);
6131
+ const m2 = g2(c2.column);
6095
6132
  return m2 || t.logWarn(`Sorting ${JSON.stringify(c2)} does not match provided columns, skipping`), m2;
6096
- }), w2 = Ee({
6133
+ }), C2 = Fe({
6097
6134
  columns: i,
6098
6135
  labelColumns: a,
6099
- coreJoinType: p2,
6136
+ coreJoinType: d2,
6100
6137
  partitionFilters: b,
6101
- filters: f2,
6102
- sorting: y,
6138
+ filters: p2,
6139
+ sorting: y$1,
6103
6140
  coreColumnPredicate: void 0
6104
- }), E2 = t.createPTable(w2), x = new Set((() => {
6141
+ }), E2 = t.createPTable(C2), _2 = new Set((() => {
6105
6142
  const c2 = s2.pTableParams.hiddenColIds;
6106
- return c2 || i.filter((m2) => Jt(m2.spec)).map((m2) => m2.id);
6143
+ return c2 || i.filter((m2) => $t(m2.spec)).map((m2) => m2.id);
6107
6144
  })());
6108
6145
  i.filter((c2) => {
6109
6146
  var m2;
6110
6147
  return ((m2 = c2.spec.annotations) == null ? void 0 : m2["pl7.app/isLinkerColumn"]) === "true";
6111
- }).forEach((c2) => x.delete(c2.id)), [...b.map((c2) => c2.column), ...f2.map((c2) => c2.column), ...y.map((c2) => c2.column)].filter((c2) => c2.type === "column").forEach((c2) => x.delete(c2.id));
6112
- const C = i.filter((c2) => !x.has(c2.id)), A = Le(C.map(Fn), o);
6113
- if (!Nt([...C, ...A])) return;
6114
- const S = Ee({
6115
- columns: C,
6116
- labelColumns: A,
6117
- coreJoinType: p2,
6148
+ }).forEach((c2) => _2.delete(c2.id)), [...b.map((c2) => c2.column), ...p2.map((c2) => c2.column), ...y$1.map((c2) => c2.column)].filter((c2) => c2.type === "column").forEach((c2) => _2.delete(c2.id));
6149
+ const w = i.filter((c2) => !_2.has(c2.id)), A2 = Le(w.map(Me$1), o);
6150
+ if (!Jt([...w, ...A2])) return;
6151
+ const S2 = Fe({
6152
+ columns: w,
6153
+ labelColumns: A2,
6154
+ coreJoinType: d2,
6118
6155
  partitionFilters: b,
6119
- filters: f2,
6120
- sorting: y,
6156
+ filters: p2,
6157
+ sorting: y$1,
6121
6158
  coreColumnPredicate: void 0
6122
- }), I = t.createPTable(S);
6159
+ }), I = t.createPTable(S2);
6123
6160
  return {
6124
6161
  sourceId: s2.pTableParams.sourceId,
6125
6162
  fullTableHandle: E2,
@@ -6149,8 +6186,8 @@
6149
6186
  numbers: z$1.array(z$1.coerce.number()),
6150
6187
  handles: z$1.array(ImportFileHandleSchema)
6151
6188
  });
6152
- const platforma = k.create("Heavy").withArgs({ numbers: [1, 2, 3, 4], tableNumRows: 100, handles: [] }).withUiState({
6153
- dataTableStateV2: Vt(),
6189
+ const platforma = Te.create("Heavy").withArgs({ numbers: [1, 2, 3, 4], tableNumRows: 100, handles: [] }).withUiState({
6190
+ dataTableStateV2: Nt(),
6154
6191
  dynamicSections: []
6155
6192
  }).argsValid((ctx) => {
6156
6193
  if (ctx.args.numbers.length === 5) {
@@ -6261,15 +6298,15 @@
6261
6298
  })
6262
6299
  }
6263
6300
  ];
6264
- for (let j2 = 3; j2 < 10; ++j2) {
6301
+ for (let j = 3; j < 10; ++j) {
6265
6302
  columns.push({
6266
- id: `column${j2}`,
6303
+ id: `column${j}`,
6267
6304
  spec: {
6268
6305
  kind: "PColumn",
6269
6306
  valueType: "String",
6270
6307
  name: "value",
6271
6308
  annotations: {
6272
- "pl7.app/label": `Alphabetical column ${j2 - 2}`,
6309
+ "pl7.app/label": `Alphabetical column ${j - 2}`,
6273
6310
  "pl7.app/table/visibility": "optional"
6274
6311
  },
6275
6312
  axesSpec: [
@@ -6286,12 +6323,12 @@
6286
6323
  const v2 = i + 1;
6287
6324
  return {
6288
6325
  key: [v2],
6289
- val: v2.toString().repeat(j2)
6326
+ val: v2.toString().repeat(j)
6290
6327
  };
6291
6328
  })
6292
6329
  });
6293
6330
  }
6294
- return Vn(
6331
+ return Nn(
6295
6332
  ctx,
6296
6333
  columns,
6297
6334
  ctx.uiState.dataTableStateV2