@milaboratories/milaboratories.ui-examples.model 1.1.5 → 1.1.7

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
@@ -3071,29 +3071,29 @@
3071
3071
  const params = { errorMap: ctx.common.contextualErrorMap };
3072
3072
  const fn = ctx.data;
3073
3073
  if (this._def.returns instanceof ZodPromise) {
3074
- const me = this;
3074
+ const me2 = this;
3075
3075
  return OK(async function(...args) {
3076
3076
  const error = new ZodError([]);
3077
- const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
3077
+ const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e) => {
3078
3078
  error.addIssue(makeArgsIssue(args, e));
3079
3079
  throw error;
3080
3080
  });
3081
3081
  const result = await Reflect.apply(fn, this, parsedArgs);
3082
- const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
3082
+ const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e) => {
3083
3083
  error.addIssue(makeReturnsIssue(result, e));
3084
3084
  throw error;
3085
3085
  });
3086
3086
  return parsedReturns;
3087
3087
  });
3088
3088
  } else {
3089
- const me = this;
3089
+ const me2 = this;
3090
3090
  return OK(function(...args) {
3091
- const parsedArgs = me._def.args.safeParse(args, params);
3091
+ const parsedArgs = me2._def.args.safeParse(args, params);
3092
3092
  if (!parsedArgs.success) {
3093
3093
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3094
3094
  }
3095
3095
  const result = Reflect.apply(fn, this, parsedArgs.data);
3096
- const parsedReturns = me._def.returns.safeParse(result, params);
3096
+ const parsedReturns = me2._def.returns.safeParse(result, params);
3097
3097
  if (!parsedReturns.success) {
3098
3098
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3099
3099
  }
@@ -3914,27 +3914,27 @@
3914
3914
  quotelessJson,
3915
3915
  ZodError
3916
3916
  });
3917
- function f(t) {
3917
+ function b$1(t) {
3918
3918
  throw new Error("Unexpected object: " + t);
3919
3919
  }
3920
- function S$1(t) {
3920
+ function J$1(t) {
3921
3921
  const { type: n, name: e, domain: r } = t;
3922
3922
  return { type: n, name: e, ...r && { domain: r } };
3923
3923
  }
3924
- function B(t, n) {
3924
+ function _$1(t, n) {
3925
3925
  if (t === void 0) return n === void 0;
3926
3926
  if (n === void 0) return true;
3927
3927
  for (const e in n)
3928
3928
  if (t[e] !== n[e]) return false;
3929
3929
  return true;
3930
3930
  }
3931
- function M(t, n) {
3932
- return t.name === n.name && B(t.domain, n.domain);
3931
+ function ot$1(t, n) {
3932
+ return t.name === n.name && _$1(t.domain, n.domain);
3933
3933
  }
3934
- function q(t, n) {
3935
- return { ...t, src: u$1(t.src, n) };
3934
+ function it$1(t, n) {
3935
+ return { ...t, src: f(t.src, n) };
3936
3936
  }
3937
- function u$1(t, n) {
3937
+ function f(t, n) {
3938
3938
  switch (t.type) {
3939
3939
  case "column":
3940
3940
  return {
@@ -3945,16 +3945,16 @@
3945
3945
  case "full":
3946
3946
  return {
3947
3947
  type: t.type,
3948
- entries: t.entries.map((e) => u$1(e, n))
3948
+ entries: t.entries.map((e) => f(e, n))
3949
3949
  };
3950
3950
  case "outer":
3951
3951
  return {
3952
3952
  type: "outer",
3953
- primary: u$1(t.primary, n),
3954
- secondary: t.secondary.map((e) => u$1(e, n))
3953
+ primary: f(t.primary, n),
3954
+ secondary: t.secondary.map((e) => f(e, n))
3955
3955
  };
3956
3956
  default:
3957
- f(t);
3957
+ b$1(t);
3958
3958
  }
3959
3959
  }
3960
3960
  z.object({
@@ -3967,20 +3967,20 @@
3967
3967
  function i(t) {
3968
3968
  return t.kind === "PColumn";
3969
3969
  }
3970
- function U$1(t) {
3970
+ function W(t) {
3971
3971
  return i(t.spec);
3972
3972
  }
3973
- function Z$1(t) {
3974
- if (!U$1(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
3973
+ function dt$1(t) {
3974
+ if (!W(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
3975
3975
  return t;
3976
3976
  }
3977
- function T(t, n) {
3977
+ function lt(t, n) {
3978
3978
  return t === void 0 ? void 0 : {
3979
3979
  ...t,
3980
3980
  data: n(t.data)
3981
3981
  };
3982
3982
  }
3983
- function v$1(t) {
3983
+ function pt$1(t) {
3984
3984
  const n = /* @__PURE__ */ new Map(), e = (r) => {
3985
3985
  switch (r.type) {
3986
3986
  case "column":
@@ -3995,79 +3995,81 @@
3995
3995
  for (const o of r.secondary) e(o);
3996
3996
  return;
3997
3997
  default:
3998
- f(r);
3998
+ b$1(r);
3999
3999
  }
4000
4000
  };
4001
4001
  return e(t), [...n.values()];
4002
4002
  }
4003
- function tt(t, n) {
4003
+ function mt(t, n) {
4004
4004
  return t.ok ? { ok: true, value: n(t.value) } : t;
4005
4005
  }
4006
- var de = Object.defineProperty;
4007
- var pe = (t, e, n) => e in t ? de(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
4008
- var S = (t, e, n) => pe(t, typeof e != "symbol" ? e + "" : e, n);
4009
- function L(t) {
4010
- return { type: "Immediate", value: t };
4006
+ const Q = 24;
4007
+ z.string().length(Q).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4008
+ var dt = Object.defineProperty;
4009
+ var pt = (e, t, n) => t in e ? dt(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
4010
+ var S = (e, t, n) => pt(e, typeof t != "symbol" ? t + "" : t, n);
4011
+ function L(e) {
4012
+ return { type: "Immediate", value: e };
4011
4013
  }
4012
- function ve() {
4014
+ function _t() {
4013
4015
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
4014
4016
  }
4015
- function ie(t) {
4016
- if (t && typeof globalThis.getPlatforma == "function")
4017
- return globalThis.getPlatforma(t);
4017
+ function it(e) {
4018
+ if (e && typeof globalThis.getPlatforma == "function")
4019
+ return globalThis.getPlatforma(e);
4018
4020
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
4019
4021
  throw new Error("Can't get platforma instance.");
4020
4022
  }
4021
- function we() {
4023
+ function wt() {
4022
4024
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4023
4025
  }
4024
4026
  function u() {
4025
4027
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4026
4028
  throw new Error("Not in config rendering context");
4027
4029
  }
4028
- function k(t, e) {
4029
- const n = we();
4030
+ function k(e, t) {
4031
+ const n = wt();
4030
4032
  if (n === void 0) return false;
4031
- if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
4032
- return n.callbackRegistry[t] = e, true;
4033
+ if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
4034
+ return n.callbackRegistry[e] = t, true;
4033
4035
  }
4034
- const N = /* @__PURE__ */ new Map();
4035
- function Se(t, e) {
4036
- t in u().callbackRegistry || (u().callbackRegistry[t] = (n) => {
4037
- for (const s of N.get(t))
4036
+ const B = /* @__PURE__ */ new Map();
4037
+ function St(e, t) {
4038
+ e in u().callbackRegistry || (u().callbackRegistry[e] = (n) => {
4039
+ for (const s of B.get(e))
4038
4040
  s(n);
4039
- }, N.set(t, [])), N.get(t).push(e);
4041
+ }, B.set(e, [])), B.get(e).push(t);
4040
4042
  }
4041
- class _ {
4042
- constructor(e, n = (s) => s) {
4043
+ class v {
4044
+ constructor(t, n = (s) => s) {
4043
4045
  S(this, "isResolved", false);
4044
4046
  S(this, "resolvedValue");
4045
- this.handle = e, this.postProcess = n, Se(e, (s) => {
4047
+ this.handle = t, this.postProcess = n, St(t, (s) => {
4046
4048
  this.resolvedValue = n(s), this.isResolved = true;
4047
4049
  });
4048
4050
  }
4049
- map(e) {
4050
- return new _(this.handle, (n) => e(this.postProcess(n)));
4051
+ map(t) {
4052
+ return new v(this.handle, (n) => t(this.postProcess(n)));
4051
4053
  }
4052
- mapDefined(e) {
4053
- return new _(this.handle, (n) => {
4054
+ mapDefined(t) {
4055
+ return new v(this.handle, (n) => {
4054
4056
  const s = this.postProcess(n);
4055
- return s ? e(s) : void 0;
4057
+ return s ? t(s) : void 0;
4056
4058
  });
4057
4059
  }
4058
4060
  toJSON() {
4059
4061
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4060
4062
  }
4061
4063
  }
4062
- function Q(t) {
4063
- return t === void 0 ? void 0 : new v(t);
4064
+ function J(e, t) {
4065
+ return e === void 0 ? void 0 : t(e);
4064
4066
  }
4065
- class v {
4066
- constructor(e) {
4067
- this.handle = e;
4067
+ class _ {
4068
+ constructor(t, n) {
4069
+ this.handle = t, this.resolvePath = n;
4068
4070
  }
4069
- resolve(...e) {
4070
- const n = e.map(
4071
+ resolve(...t) {
4072
+ const n = t.map(
4071
4073
  (s) => ({
4072
4074
  assertFieldType: "Input",
4073
4075
  ...typeof s == "string" ? { field: s } : s
@@ -4075,8 +4077,8 @@
4075
4077
  );
4076
4078
  return this.resolveWithCommon({}, ...n);
4077
4079
  }
4078
- resolveOutput(...e) {
4079
- const n = e.map(
4080
+ resolveOutput(...t) {
4081
+ const n = t.map(
4080
4082
  (s) => ({
4081
4083
  assertFieldType: "Output",
4082
4084
  ...typeof s == "string" ? { field: s } : s
@@ -4084,8 +4086,8 @@
4084
4086
  );
4085
4087
  return this.resolveWithCommon({}, ...n);
4086
4088
  }
4087
- resolveInput(...e) {
4088
- const n = e.map(
4089
+ resolveInput(...t) {
4090
+ const n = t.map(
4089
4091
  (s) => ({
4090
4092
  assertFieldType: "Input",
4091
4093
  ...typeof s == "string" ? { field: s } : s
@@ -4093,11 +4095,18 @@
4093
4095
  );
4094
4096
  return this.resolveWithCommon({}, ...n);
4095
4097
  }
4096
- resolveAny(...e) {
4097
- return this.resolveWithCommon({}, ...e);
4098
- }
4099
- resolveWithCommon(e, ...n) {
4100
- return Q(u().resolveWithCommon(this.handle, e, ...n));
4098
+ resolveAny(...t) {
4099
+ return this.resolveWithCommon({}, ...t);
4100
+ }
4101
+ resolveWithCommon(t, ...n) {
4102
+ const s = [
4103
+ ...this.resolvePath,
4104
+ ...n.map((i2) => typeof i2 == "string" ? i2 : i2.field)
4105
+ ];
4106
+ return J(
4107
+ u().resolveWithCommon(this.handle, t, ...n),
4108
+ (i2) => new _(i2, s)
4109
+ );
4101
4110
  }
4102
4111
  get resourceType() {
4103
4112
  return u().getResourceType(this.handle);
@@ -4115,7 +4124,11 @@
4115
4124
  return u().getIsFinal(this.handle);
4116
4125
  }
4117
4126
  getError() {
4118
- return Q(u().getError(this.handle));
4127
+ const t = [...this.resolvePath, "error"];
4128
+ return J(
4129
+ u().getError(this.handle),
4130
+ (n) => new _(n, t)
4131
+ );
4119
4132
  }
4120
4133
  listInputFields() {
4121
4134
  return u().listInputFields(this.handle);
@@ -4126,14 +4139,14 @@
4126
4139
  listDynamicFields() {
4127
4140
  return u().listDynamicFields(this.handle);
4128
4141
  }
4129
- getKeyValueBase64(e) {
4130
- return u().getKeyValueBase64(this.handle, e);
4142
+ getKeyValueBase64(t) {
4143
+ return u().getKeyValueBase64(this.handle, t);
4131
4144
  }
4132
- getKeyValueAsString(e) {
4133
- return u().getKeyValueAsString(this.handle, e);
4145
+ getKeyValueAsString(t) {
4146
+ return u().getKeyValueAsString(this.handle, t);
4134
4147
  }
4135
- getKeyValueAsJson(e) {
4136
- const n = this.getKeyValueAsString(e);
4148
+ getKeyValueAsJson(t) {
4149
+ const n = this.getKeyValueAsString(t);
4137
4150
  if (n == null) throw new Error("Resource has no content.");
4138
4151
  return JSON.parse(n);
4139
4152
  }
@@ -4144,45 +4157,48 @@
4144
4157
  return u().getDataAsString(this.handle);
4145
4158
  }
4146
4159
  getDataAsJson() {
4147
- const e = this.getDataAsString();
4148
- if (e == null) throw new Error("Resource has no content.");
4149
- return JSON.parse(e);
4160
+ const t = this.getDataAsString();
4161
+ if (t == null) throw new Error("Resource has no content.");
4162
+ return JSON.parse(t);
4150
4163
  }
4151
4164
  /**
4152
4165
  *
4153
4166
  */
4154
- getPColumns(e = false, n = "") {
4155
- const s = this.parsePObjectCollection(e, n);
4167
+ getPColumns(t = false, n = "") {
4168
+ const s = this.parsePObjectCollection(t, n);
4156
4169
  return s === void 0 ? void 0 : Object.entries(s).map(([, r]) => {
4157
- if (!U$1(r)) throw new Error(`not a PColumn (kind = ${r.spec.kind})`);
4170
+ if (!W(r)) throw new Error(`not a PColumn (kind = ${r.spec.kind})`);
4158
4171
  return r;
4159
4172
  });
4160
4173
  }
4161
4174
  /**
4162
4175
  *
4163
4176
  */
4164
- parsePObjectCollection(e = false, n = "") {
4177
+ parsePObjectCollection(t = false, n = "") {
4165
4178
  const s = u().parsePObjectCollection(
4166
4179
  this.handle,
4167
- e,
4168
- n
4180
+ t,
4181
+ n,
4182
+ ...this.resolvePath
4169
4183
  );
4170
4184
  if (s === void 0) return;
4171
4185
  const i2 = {};
4172
- for (const [r, o] of Object.entries(s))
4173
- i2[r] = T(o, (l) => new v(l));
4186
+ for (const [r, o] of Object.entries(s)) {
4187
+ const l = [...this.resolvePath, r];
4188
+ i2[r] = lt(o, (d) => new _(d, l));
4189
+ }
4174
4190
  return i2;
4175
4191
  }
4176
4192
  getFileContentAsBase64() {
4177
- return new _(u().getBlobContentAsBase64(this.handle));
4193
+ return new v(u().getBlobContentAsBase64(this.handle));
4178
4194
  }
4179
4195
  getFileContentAsString() {
4180
- return new _(u().getBlobContentAsString(this.handle));
4196
+ return new v(u().getBlobContentAsString(this.handle));
4181
4197
  }
4182
4198
  getFileContentAsJson() {
4183
- return new _(
4199
+ return new v(
4184
4200
  u().getBlobContentAsString(this.handle)
4185
- ).mapDefined((e) => JSON.parse(e));
4201
+ ).mapDefined((t) => JSON.parse(t));
4186
4202
  }
4187
4203
  /**
4188
4204
  * @deprecated use getFileContentAsBase64
@@ -4200,7 +4216,7 @@
4200
4216
  * @returns downloaded file handle
4201
4217
  */
4202
4218
  getFileHandle() {
4203
- return new _(u().getDownloadedBlobContentHandle(this.handle));
4219
+ return new v(u().getDownloadedBlobContentHandle(this.handle));
4204
4220
  }
4205
4221
  /**
4206
4222
  * @deprecated use getFileHandle
@@ -4212,7 +4228,7 @@
4212
4228
  * @returns downloaded file handle
4213
4229
  */
4214
4230
  getRemoteFileHandle() {
4215
- return new _(u().getOnDemandBlobContentHandle(this.handle));
4231
+ return new v(u().getOnDemandBlobContentHandle(this.handle));
4216
4232
  }
4217
4233
  /**
4218
4234
  * @deprecated use getRemoteFileHandle
@@ -4221,19 +4237,19 @@
4221
4237
  return this.getRemoteFileHandle();
4222
4238
  }
4223
4239
  getImportProgress() {
4224
- return new _(u().getImportProgress(this.handle));
4240
+ return new v(u().getImportProgress(this.handle));
4225
4241
  }
4226
- getLastLogs(e) {
4227
- return new _(u().getLastLogs(this.handle, e));
4242
+ getLastLogs(t) {
4243
+ return new v(u().getLastLogs(this.handle, t));
4228
4244
  }
4229
- getProgressLog(e) {
4230
- return new _(u().getProgressLog(this.handle, e));
4245
+ getProgressLog(t) {
4246
+ return new v(u().getProgressLog(this.handle, t));
4231
4247
  }
4232
4248
  getLogHandle() {
4233
- return new _(u().getLogHandle(this.handle));
4249
+ return new v(u().getLogHandle(this.handle));
4234
4250
  }
4235
- allFieldsResolved(e = "Input") {
4236
- switch (e) {
4251
+ allFieldsResolved(t = "Input") {
4252
+ switch (t) {
4237
4253
  case "Input":
4238
4254
  return this.getInputsLocked() && this.listInputFields().every(
4239
4255
  (n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
@@ -4244,13 +4260,13 @@
4244
4260
  );
4245
4261
  }
4246
4262
  }
4247
- mapFields(e, n) {
4263
+ mapFields(t, n) {
4248
4264
  const { fieldType: s, requireLocked: i2, skipUnresolved: r } = {
4249
4265
  fieldType: "Input",
4250
4266
  requireLocked: true,
4251
4267
  skipUnresolved: false,
4252
4268
  ...n
4253
- }, o = e;
4269
+ }, o = t;
4254
4270
  if (i2 && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
4255
4271
  return;
4256
4272
  let d = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
@@ -4259,31 +4275,31 @@
4259
4275
  return r && (d = d.filter((a) => a[1] !== void 0)), d.map(([a, p]) => o(a, p));
4260
4276
  }
4261
4277
  }
4262
- const re = "staging", oe = "main";
4263
- const Ie = "pl7.app/label", Pe = "pl7.app/trace", Re = z.object({
4278
+ const rt = "staging", ot = "main";
4279
+ const At = "pl7.app/label", It = "pl7.app/trace", Rt = z.object({
4264
4280
  type: z.string(),
4265
4281
  importance: z.number().optional(),
4266
4282
  id: z.string().optional(),
4267
4283
  label: z.string()
4268
- }), Fe = z.array(Re), Te = 1e-3, Oe = "__LABEL__", Z = "__LABEL__@1";
4269
- function ke(t, e, n = {}) {
4270
- const s = /* @__PURE__ */ new Map(), i2 = /* @__PURE__ */ new Map(), r = t.map((c) => {
4271
- var q2, z2;
4272
- const m = e(c), h = (q2 = m.annotations) == null ? void 0 : q2[Ie], A = (z2 = m.annotations) == null ? void 0 : z2[Pe], y = (A ? Fe.safeParse(JSON.parse(A)).data : void 0) ?? [];
4284
+ }), Ft = z.array(Rt), Tt = 1e-3, Ot = "__LABEL__", Z = "__LABEL__@1";
4285
+ function kt(e, t, n = {}) {
4286
+ const s = /* @__PURE__ */ new Map(), i2 = /* @__PURE__ */ new Map(), r = e.map((c) => {
4287
+ var z2, Y;
4288
+ const m = t(c), h = (z2 = m.annotations) == null ? void 0 : z2[At], P = (Y = m.annotations) == null ? void 0 : Y[It], y = (P ? Ft.safeParse(JSON.parse(P)).data : void 0) ?? [];
4273
4289
  if (h) {
4274
- const w = { label: h, type: Oe, importance: -2 };
4290
+ const w = { label: h, type: Ot, importance: -2 };
4275
4291
  n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
4276
4292
  }
4277
- const C = [], W = /* @__PURE__ */ new Map();
4293
+ const C = [], q = /* @__PURE__ */ new Map();
4278
4294
  for (let w = y.length - 1; w >= 0; --w) {
4279
- const { type: V } = y[w], ce = y[w].importance ?? 0, j = (W.get(V) ?? 0) + 1;
4280
- W.set(V, j);
4295
+ const { type: V } = y[w], ct = y[w].importance ?? 0, j = (q.get(V) ?? 0) + 1;
4296
+ q.set(V, j);
4281
4297
  const R = `${V}@${j}`;
4282
4298
  i2.set(R, (i2.get(R) ?? 0) + 1), s.set(
4283
4299
  R,
4284
4300
  Math.max(
4285
4301
  s.get(R) ?? Number.NEGATIVE_INFINITY,
4286
- ce - (y.length - w) * Te
4302
+ ct - (y.length - w) * Tt
4287
4303
  )
4288
4304
  ), C.push({ ...y[w], fullType: R, occurenceIndex: j });
4289
4305
  }
@@ -4296,11 +4312,11 @@
4296
4312
  }), o = [], l = [], d = [...s];
4297
4313
  d.sort(([, c], [, m]) => m - c);
4298
4314
  for (const [c] of d)
4299
- c.endsWith("@1") || i2.get(c) === t.length ? o.push(c) : l.push(c);
4315
+ c.endsWith("@1") || i2.get(c) === e.length ? o.push(c) : l.push(c);
4300
4316
  const a = (c) => r.map((m) => {
4301
- const h = m.fullTrace.filter((y) => c.has(y.fullType)).map((y) => y.label), A = n.separator ?? " / ";
4317
+ const h = m.fullTrace.filter((y) => c.has(y.fullType)).map((y) => y.label), P = n.separator ?? " / ";
4302
4318
  return {
4303
- label: h.join(A),
4319
+ label: h.join(P),
4304
4320
  value: m.value
4305
4321
  };
4306
4322
  });
@@ -4315,28 +4331,28 @@
4315
4331
  for (let h = 0; h < p; ++h) c.add(o[h]);
4316
4332
  c.add(o[g]);
4317
4333
  const m = a(c);
4318
- if (new Set(m.map((h) => h.label)).size === t.length) return m;
4334
+ if (new Set(m.map((h) => h.label)).size === e.length) return m;
4319
4335
  g++, g == o.length && (p++, g = p);
4320
4336
  }
4321
4337
  return a(/* @__PURE__ */ new Set([...o, ...l]));
4322
4338
  }
4323
- class De {
4339
+ class Dt {
4324
4340
  constructor() {
4325
4341
  S(this, "ctx", u());
4326
- S(this, "defaultLabelFn", (e, n) => {
4342
+ S(this, "defaultLabelFn", (t, n) => {
4327
4343
  var s;
4328
- return ((s = e.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
4344
+ return ((s = t.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
4329
4345
  });
4330
4346
  }
4331
4347
  /**
4332
4348
  * @deprecated use getOptions()
4333
4349
  */
4334
- calculateOptions(e) {
4335
- return this.ctx.calculateOptions(e);
4350
+ calculateOptions(t) {
4351
+ return this.ctx.calculateOptions(t);
4336
4352
  }
4337
- getOptions(e, n) {
4338
- const s = this.getSpecs().entries.filter((i2) => e(i2.obj));
4339
- return typeof n == "object" || typeof n > "u" ? ke(s, (i2) => i2.obj, n ?? {}).map(({ value: { ref: i2 }, label: r }) => ({
4353
+ getOptions(t, n) {
4354
+ const s = this.getSpecs().entries.filter((i2) => t(i2.obj));
4355
+ return typeof n == "object" || typeof n > "u" ? kt(s, (i2) => i2.obj, n ?? {}).map(({ value: { ref: i2 }, label: r }) => ({
4340
4356
  ref: i2,
4341
4357
  label: r
4342
4358
  })) : s.map((i2) => ({
@@ -4351,14 +4367,14 @@
4351
4367
  return this.getData();
4352
4368
  }
4353
4369
  getData() {
4354
- const e = this.ctx.getDataFromResultPool();
4370
+ const t = this.ctx.getDataFromResultPool();
4355
4371
  return {
4356
- isComplete: e.isComplete,
4357
- entries: e.entries.map((n) => ({
4372
+ isComplete: t.isComplete,
4373
+ entries: t.entries.map((n) => ({
4358
4374
  ref: n.ref,
4359
4375
  obj: {
4360
4376
  ...n.obj,
4361
- data: new v(n.obj.data)
4377
+ data: new _(n.obj.data, [n.ref.blockId, n.ref.name])
4362
4378
  }
4363
4379
  }))
4364
4380
  };
@@ -4370,14 +4386,17 @@
4370
4386
  return this.getDataWithErrors();
4371
4387
  }
4372
4388
  getDataWithErrors() {
4373
- const e = this.ctx.getDataWithErrorsFromResultPool();
4389
+ const t = this.ctx.getDataWithErrorsFromResultPool();
4374
4390
  return {
4375
- isComplete: e.isComplete,
4376
- entries: e.entries.map((n) => ({
4391
+ isComplete: t.isComplete,
4392
+ entries: t.entries.map((n) => ({
4377
4393
  ref: n.ref,
4378
4394
  obj: {
4379
4395
  ...n.obj,
4380
- data: tt(n.obj.data, (s) => new v(s))
4396
+ data: mt(
4397
+ n.obj.data,
4398
+ (s) => new _(s, [n.ref.blockId, n.ref.name])
4399
+ )
4381
4400
  }
4382
4401
  }))
4383
4402
  };
@@ -4395,13 +4414,13 @@
4395
4414
  * @param ref a Ref
4396
4415
  * @returns data associated with the ref
4397
4416
  */
4398
- getDataByRef(e) {
4417
+ getDataByRef(t) {
4399
4418
  var n;
4400
4419
  return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
4401
- (s) => s.ref.blockId === e.blockId && s.ref.name === e.name
4402
- )) == null ? void 0 : n.obj : T(
4403
- this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
4404
- (s) => new v(s)
4420
+ (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
4421
+ )) == null ? void 0 : n.obj : lt(
4422
+ this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
4423
+ (s) => new _(s, [t.blockId, t.name])
4405
4424
  );
4406
4425
  }
4407
4426
  /**
@@ -4409,18 +4428,18 @@
4409
4428
  * @param ref a Ref
4410
4429
  * @returns p-column associated with the ref
4411
4430
  */
4412
- getPColumnByRef(e) {
4413
- const n = this.getDataByRef(e);
4431
+ getPColumnByRef(t) {
4432
+ const n = this.getDataByRef(t);
4414
4433
  if (n)
4415
- return Z$1(n);
4434
+ return dt$1(n);
4416
4435
  }
4417
4436
  /**
4418
4437
  * Returns spec associated with the ref ensuring that it is a p-column spec.
4419
4438
  * @param ref a Ref
4420
4439
  * @returns p-column spec associated with the ref
4421
4440
  */
4422
- getPColumnSpecByRef(e) {
4423
- const n = this.getSpecByRef(e);
4441
+ getPColumnSpecByRef(t) {
4442
+ const n = this.getSpecByRef(t);
4424
4443
  if (n) {
4425
4444
  if (!i(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
4426
4445
  return n;
@@ -4430,28 +4449,28 @@
4430
4449
  * @param ref a Ref
4431
4450
  * @returns object spec associated with the ref
4432
4451
  */
4433
- getSpecByRef(e) {
4452
+ getSpecByRef(t) {
4434
4453
  var n;
4435
4454
  return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
4436
- (s) => s.ref.blockId === e.blockId && s.ref.name === e.name
4437
- )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
4455
+ (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
4456
+ )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
4438
4457
  }
4439
4458
  /**
4440
4459
  * @param spec object specification
4441
4460
  * @returns array of data objects with compatible specs
4442
4461
  * @deprecated delete this method after Jan 1, 2025
4443
4462
  */
4444
- findDataWithCompatibleSpec(e) {
4463
+ findDataWithCompatibleSpec(t) {
4445
4464
  const n = [];
4446
- e: for (const s of this.getData().entries) {
4465
+ t: for (const s of this.getData().entries) {
4447
4466
  if (!i(s.obj.spec))
4448
4467
  continue;
4449
4468
  const i$1 = s.obj.spec;
4450
- if (e.name === i$1.name && e.valueType === i$1.valueType && e.axesSpec.length === i$1.axesSpec.length && $(e.domain, i$1.domain)) {
4451
- for (let r = 0; r < e.axesSpec.length; ++r) {
4452
- const o = e.axesSpec[r], l = i$1.axesSpec[r];
4453
- if (o.name !== l.name || o.type !== l.type || !$(o.domain, l.domain))
4454
- continue e;
4469
+ if (t.name === i$1.name && t.valueType === i$1.valueType && t.axesSpec.length === i$1.axesSpec.length && K(t.domain, i$1.domain)) {
4470
+ for (let r = 0; r < t.axesSpec.length; ++r) {
4471
+ const o = t.axesSpec[r], l = i$1.axesSpec[r];
4472
+ if (o.name !== l.name || o.type !== l.type || !K(o.domain, l.domain))
4473
+ continue t;
4455
4474
  }
4456
4475
  n.push(s.obj);
4457
4476
  }
@@ -4459,11 +4478,11 @@
4459
4478
  return n;
4460
4479
  }
4461
4480
  }
4462
- function $(t, e) {
4463
- if (t === void 0) return e === void 0;
4464
- if (e === void 0) return true;
4465
- for (const n in e)
4466
- if (t[n] !== e[n]) return false;
4481
+ function K(e, t) {
4482
+ if (e === void 0) return t === void 0;
4483
+ if (t === void 0) return true;
4484
+ for (const n in t)
4485
+ if (e[n] !== t[n]) return false;
4467
4486
  return true;
4468
4487
  }
4469
4488
  class D {
@@ -4471,15 +4490,17 @@
4471
4490
  S(this, "ctx");
4472
4491
  S(this, "args");
4473
4492
  S(this, "uiState");
4474
- S(this, "resultPool", new De());
4475
- this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
4493
+ S(this, "resultPool", new Dt());
4494
+ this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
4476
4495
  }
4477
- getNamedAccessor(e) {
4478
- const n = this.ctx.getAccessorHandleByName(e);
4479
- return n ? new v(n) : void 0;
4496
+ getNamedAccessor(t) {
4497
+ return J(
4498
+ this.ctx.getAccessorHandleByName(t),
4499
+ (n) => new _(n, [t])
4500
+ );
4480
4501
  }
4481
4502
  get prerun() {
4482
- return this.getNamedAccessor(re);
4503
+ return this.getNamedAccessor(rt);
4483
4504
  }
4484
4505
  /**
4485
4506
  * @deprecated use prerun
@@ -4494,7 +4515,7 @@
4494
4515
  return this.precalc;
4495
4516
  }
4496
4517
  get outputs() {
4497
- return this.getNamedAccessor(oe);
4518
+ return this.getNamedAccessor(ot);
4498
4519
  }
4499
4520
  /**
4500
4521
  * @deprecated use outputs
@@ -4506,12 +4527,12 @@
4506
4527
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
4507
4528
  * @returns a map of axis value => label
4508
4529
  */
4509
- findLabels(e) {
4530
+ findLabels(t) {
4510
4531
  const n = this.resultPool.getData();
4511
4532
  for (const s of n.entries) {
4512
- if (!U$1(s.obj)) continue;
4533
+ if (!W(s.obj)) continue;
4513
4534
  const i2 = s.obj.spec;
4514
- if (i2.name === "pl7.app/label" && i2.axesSpec.length === 1 && i2.axesSpec[0].name === e.name && i2.axesSpec[0].type === e.type && $(e.domain, i2.axesSpec[0].domain)) {
4535
+ if (i2.name === "pl7.app/label" && i2.axesSpec.length === 1 && i2.axesSpec[0].name === t.name && i2.axesSpec[0].type === t.type && K(t.domain, i2.axesSpec[0].domain)) {
4515
4536
  if (s.obj.data.resourceType.name !== "PColumnData/Json")
4516
4537
  throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
4517
4538
  return Object.fromEntries(
@@ -4522,55 +4543,56 @@
4522
4543
  }
4523
4544
  }
4524
4545
  }
4525
- verifyInlineColumnsSupport(e) {
4546
+ verifyInlineColumnsSupport(t) {
4526
4547
  var i2;
4527
- const n = e.some((r) => !(r.data instanceof v)), s = ((i2 = this.ctx.featureFlags) == null ? void 0 : i2.inlineColumnsSupport) === true;
4548
+ const n = t.some((r) => !(r.data instanceof _)), s = ((i2 = this.ctx.featureFlags) == null ? void 0 : i2.inlineColumnsSupport) === true;
4528
4549
  if (n && !s) throw Error("inline columns not supported");
4529
4550
  }
4530
- createPFrame(e) {
4531
- return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(e.map((n) => T(
4532
- n,
4533
- (s) => s instanceof v ? s.handle : s
4534
- )));
4551
+ createPFrame(t) {
4552
+ return this.verifyInlineColumnsSupport(t), this.ctx.createPFrame(
4553
+ t.map((n) => lt(n, (s) => s instanceof _ ? s.handle : s))
4554
+ );
4535
4555
  }
4536
- createPTable(e) {
4556
+ createPTable(t) {
4537
4557
  var n;
4538
- return "columns" in e ? n = {
4558
+ return "columns" in t ? n = {
4539
4559
  src: {
4540
4560
  type: "full",
4541
- entries: e.columns.map((s) => ({ type: "column", column: s }))
4561
+ entries: t.columns.map((s) => ({ type: "column", column: s }))
4542
4562
  },
4543
- filters: e.filters ?? [],
4544
- sorting: e.sorting ?? []
4545
- } : n = e, this.verifyInlineColumnsSupport(v$1(n.src)), this.ctx.createPTable(q(n, (s) => T(
4546
- s,
4547
- (i2) => i2 instanceof v ? i2.handle : i2
4548
- )));
4563
+ filters: t.filters ?? [],
4564
+ sorting: t.sorting ?? []
4565
+ } : n = t, this.verifyInlineColumnsSupport(pt$1(n.src)), this.ctx.createPTable(
4566
+ it$1(
4567
+ n,
4568
+ (s) => lt(s, (i2) => i2 instanceof _ ? i2.handle : i2)
4569
+ )
4570
+ );
4549
4571
  }
4550
4572
  /** @deprecated scheduled for removal from SDK */
4551
- getBlockLabel(e) {
4552
- return this.ctx.getBlockLabel(e);
4573
+ getBlockLabel(t) {
4574
+ return this.ctx.getBlockLabel(t);
4553
4575
  }
4554
4576
  getCurrentUnstableMarker() {
4555
4577
  if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
4556
4578
  return this.ctx.getCurrentUnstableMarker();
4557
4579
  }
4558
4580
  }
4559
- const F = "1.20.11";
4560
- function xe(t) {
4561
- return t.__renderLambda === true;
4581
+ const F = "1.20.27";
4582
+ function xt(e) {
4583
+ return e.__renderLambda === true;
4562
4584
  }
4563
- function U(t) {
4564
- if (t !== void 0)
4565
- return xe(t) ? t.handle : t;
4585
+ function U(e) {
4586
+ if (e !== void 0)
4587
+ return xt(e) ? e.handle : e;
4566
4588
  }
4567
4589
  class b {
4568
- constructor(e, n, s, i2, r, o, l) {
4569
- this._renderingMode = e, this._initialArgs = n, this._initialUiState = s, this._outputs = i2, this._inputsValid = r, this._sections = o, this._title = l;
4590
+ constructor(t, n, s, i2, r, o, l) {
4591
+ this._renderingMode = t, this._initialArgs = n, this._initialUiState = s, this._outputs = i2, this._inputsValid = r, this._sections = o, this._title = l;
4570
4592
  }
4571
- static create(e = "Heavy") {
4593
+ static create(t = "Heavy") {
4572
4594
  return new b(
4573
- e,
4595
+ t,
4574
4596
  void 0,
4575
4597
  {},
4576
4598
  {},
@@ -4579,16 +4601,16 @@
4579
4601
  void 0
4580
4602
  );
4581
4603
  }
4582
- output(e, n, s = {}) {
4604
+ output(t, n, s = {}) {
4583
4605
  if (typeof n == "function") {
4584
- const i2 = `output#${e}`;
4606
+ const i2 = `output#${t}`;
4585
4607
  return k(i2, () => n(new D())), new b(
4586
4608
  this._renderingMode,
4587
4609
  this._initialArgs,
4588
4610
  this._initialUiState,
4589
4611
  {
4590
4612
  ...this._outputs,
4591
- [e]: {
4613
+ [t]: {
4592
4614
  __renderLambda: true,
4593
4615
  handle: i2,
4594
4616
  ...s
@@ -4605,7 +4627,7 @@
4605
4627
  this._initialUiState,
4606
4628
  {
4607
4629
  ...this._outputs,
4608
- [e]: n
4630
+ [t]: n
4609
4631
  },
4610
4632
  this._inputsValid,
4611
4633
  this._sections,
@@ -4613,15 +4635,15 @@
4613
4635
  );
4614
4636
  }
4615
4637
  /** Shortcut for {@link output} with retentive flag set to true. */
4616
- retentiveOutput(e, n) {
4617
- return this.output(e, n, { retentive: true });
4638
+ retentiveOutput(t, n) {
4639
+ return this.output(t, n, { retentive: true });
4618
4640
  }
4619
4641
  /** @deprecated */
4620
- canRun(e) {
4621
- return this.inputsValid(e);
4642
+ canRun(t) {
4643
+ return this.inputsValid(t);
4622
4644
  }
4623
- argsValid(e) {
4624
- return typeof e == "function" ? (k("inputsValid", () => e(new D())), new b(
4645
+ argsValid(t) {
4646
+ return typeof t == "function" ? (k("inputsValid", () => t(new D())), new b(
4625
4647
  this._renderingMode,
4626
4648
  this._initialArgs,
4627
4649
  this._initialUiState,
@@ -4637,16 +4659,16 @@
4637
4659
  this._initialArgs,
4638
4660
  this._initialUiState,
4639
4661
  this._outputs,
4640
- e,
4662
+ t,
4641
4663
  this._sections,
4642
4664
  this._title
4643
4665
  );
4644
4666
  }
4645
- inputsValid(e) {
4646
- return this.argsValid(e);
4667
+ inputsValid(t) {
4668
+ return this.argsValid(t);
4647
4669
  }
4648
- sections(e) {
4649
- return Array.isArray(e) ? this.sections(L(e)) : typeof e == "function" ? (k("sections", () => e(new D())), new b(
4670
+ sections(t) {
4671
+ return Array.isArray(t) ? this.sections(L(t)) : typeof t == "function" ? (k("sections", () => t(new D())), new b(
4650
4672
  this._renderingMode,
4651
4673
  this._initialArgs,
4652
4674
  this._initialUiState,
@@ -4660,12 +4682,12 @@
4660
4682
  this._initialUiState,
4661
4683
  this._outputs,
4662
4684
  this._inputsValid,
4663
- e,
4685
+ t,
4664
4686
  this._title
4665
4687
  );
4666
4688
  }
4667
- title(e) {
4668
- return k("title", () => e(new D())), new b(
4689
+ title(t) {
4690
+ return k("title", () => t(new D())), new b(
4669
4691
  this._renderingMode,
4670
4692
  this._initialArgs,
4671
4693
  this._initialUiState,
@@ -4679,10 +4701,10 @@
4679
4701
  * Sets initial args for the block, this value must be specified.
4680
4702
  * @deprecated use {@link withArgs}
4681
4703
  * */
4682
- initialArgs(e) {
4704
+ initialArgs(t) {
4683
4705
  return new b(
4684
4706
  this._renderingMode,
4685
- e,
4707
+ t,
4686
4708
  this._initialUiState,
4687
4709
  this._outputs,
4688
4710
  this._inputsValid,
@@ -4691,10 +4713,10 @@
4691
4713
  );
4692
4714
  }
4693
4715
  /** Sets initial args for the block, this value must be specified. */
4694
- withArgs(e) {
4716
+ withArgs(t) {
4695
4717
  return new b(
4696
4718
  this._renderingMode,
4697
- e,
4719
+ t,
4698
4720
  this._initialUiState,
4699
4721
  this._outputs,
4700
4722
  this._inputsValid,
@@ -4703,11 +4725,11 @@
4703
4725
  );
4704
4726
  }
4705
4727
  /** Defines type and sets initial value for block UiState. */
4706
- withUiState(e) {
4728
+ withUiState(t) {
4707
4729
  return new b(
4708
4730
  this._renderingMode,
4709
4731
  this._initialArgs,
4710
- e,
4732
+ t,
4711
4733
  this._outputs,
4712
4734
  this._inputsValid,
4713
4735
  this._sections,
@@ -4719,7 +4741,7 @@
4719
4741
  * other features provided by the platforma to the block. */
4720
4742
  done() {
4721
4743
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
4722
- const e = {
4744
+ const t = {
4723
4745
  v3: {
4724
4746
  sdkVersion: F,
4725
4747
  renderingMode: this._renderingMode,
@@ -4740,26 +4762,26 @@
4740
4762
  Object.entries(this._outputs).map(([n, s]) => [n, U(s)])
4741
4763
  )
4742
4764
  };
4743
- return ve() ? ie({ sdkVersion: F }) : { config: e };
4765
+ return _t() ? it({ sdkVersion: F }) : { config: t };
4744
4766
  }
4745
4767
  }
4746
- function mt(t, e, n, s) {
4768
+ function me(e, t, n, s) {
4747
4769
  var l, d;
4748
- const i2 = t.resultPool.getData().entries.map((a) => a.obj).filter(U$1).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), r = (a, p) => {
4770
+ const i2 = e.resultPool.getData().entries.map((a) => a.obj).filter(W).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), r = (a, p) => {
4749
4771
  let g = a.toString();
4750
4772
  if (p)
4751
4773
  for (const c in p)
4752
4774
  g += c, g += p[c];
4753
4775
  return g;
4754
4776
  }, o = /* @__PURE__ */ new Map();
4755
- for (const a of e)
4777
+ for (const a of t)
4756
4778
  for (const p of a.spec.axesSpec) {
4757
- const g = S$1(p);
4779
+ const g = J$1(p);
4758
4780
  for (const c of i2) {
4759
- const m = c.spec.axesSpec[0], h = S$1(c.spec.axesSpec[0]);
4760
- if (M(g, h)) {
4761
- const A = Object.keys(g.domain ?? {}).length, y = Object.keys(h.domain ?? {}).length;
4762
- if (A > y) {
4781
+ const m = c.spec.axesSpec[0], h = J$1(c.spec.axesSpec[0]);
4782
+ if (ot$1(g, h)) {
4783
+ const P = Object.keys(g.domain ?? {}).length, y = Object.keys(h.domain ?? {}).length;
4784
+ if (P > y) {
4763
4785
  const C = r(c.id, g.domain);
4764
4786
  o.set(C, {
4765
4787
  id: C,
@@ -4774,15 +4796,15 @@
4774
4796
  }
4775
4797
  }
4776
4798
  }
4777
- if (![...e, ...o.values()].some(
4778
- (a) => a.data instanceof v && !a.data.getIsReadyOrError()
4799
+ if (![...t, ...o.values()].some(
4800
+ (a) => a.data instanceof _ && !a.data.getIsReadyOrError()
4779
4801
  ))
4780
- return t.createPTable({
4802
+ return e.createPTable({
4781
4803
  src: {
4782
4804
  type: "outer",
4783
4805
  primary: {
4784
4806
  type: "full",
4785
- entries: e.map((a) => ({ type: "column", column: a }))
4807
+ entries: t.map((a) => ({ type: "column", column: a }))
4786
4808
  },
4787
4809
  secondary: [...o.values()].map((a) => ({ type: "column", column: a }))
4788
4810
  },
@@ -4799,7 +4821,7 @@
4799
4821
  }).output("pt", (ctx) => {
4800
4822
  var _a, _b, _c, _d, _e;
4801
4823
  if (!((_c = (_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.tableState.pTableParams) == null ? void 0 : _c.filters)) return void 0;
4802
- return mt(ctx, [
4824
+ return me(ctx, [
4803
4825
  {
4804
4826
  id: "example",
4805
4827
  spec: {