@milaboratories/milaboratories.ui-examples.model 1.0.32 → 1.0.33

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
@@ -20,10 +20,10 @@
20
20
  return obj;
21
21
  };
22
22
  util2.getValidEnumValues = (obj) => {
23
- const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
23
+ const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
24
24
  const filtered = {};
25
- for (const k of validKeys) {
26
- filtered[k] = obj[k];
25
+ for (const k2 of validKeys) {
26
+ filtered[k2] = obj[k2];
27
27
  }
28
28
  return util2.objectValues(filtered);
29
29
  };
@@ -368,7 +368,7 @@
368
368
  };
369
369
  }
370
370
  let errorMessage = "";
371
- const maps = errorMaps.filter((m) => !!m).slice().reverse();
371
+ const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
372
372
  for (const map of maps) {
373
373
  errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
374
374
  }
@@ -458,12 +458,12 @@
458
458
  const isDirty = (x2) => x2.status === "dirty";
459
459
  const isValid = (x2) => x2.status === "valid";
460
460
  const isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
461
- function __classPrivateFieldGet(receiver, state, kind, f2) {
462
- if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
461
+ function __classPrivateFieldGet(receiver, state, kind, f) {
462
+ if (typeof state === "function" ? receiver !== state || !f : !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) {
466
- if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
465
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
466
+ if (typeof state === "function" ? receiver !== state || !f : !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
  }
469
469
  typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
@@ -2659,17 +2659,17 @@
2659
2659
  });
2660
2660
  }
2661
2661
  }
2662
- function mergeValues(a, b2) {
2662
+ function mergeValues(a, b) {
2663
2663
  const aType = getParsedType(a);
2664
- const bType = getParsedType(b2);
2665
- if (a === b2) {
2664
+ const bType = getParsedType(b);
2665
+ if (a === b) {
2666
2666
  return { valid: true, data: a };
2667
2667
  } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
2668
- const bKeys = util.objectKeys(b2);
2668
+ const bKeys = util.objectKeys(b);
2669
2669
  const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
2670
- const newObj = { ...a, ...b2 };
2670
+ const newObj = { ...a, ...b };
2671
2671
  for (const key of sharedKeys) {
2672
- const sharedValue = mergeValues(a[key], b2[key]);
2672
+ const sharedValue = mergeValues(a[key], b[key]);
2673
2673
  if (!sharedValue.valid) {
2674
2674
  return { valid: false };
2675
2675
  }
@@ -2677,13 +2677,13 @@
2677
2677
  }
2678
2678
  return { valid: true, data: newObj };
2679
2679
  } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
2680
- if (a.length !== b2.length) {
2680
+ if (a.length !== b.length) {
2681
2681
  return { valid: false };
2682
2682
  }
2683
2683
  const newArray = [];
2684
2684
  for (let index = 0; index < a.length; index++) {
2685
2685
  const itemA = a[index];
2686
- const itemB = b2[index];
2686
+ const itemB = b[index];
2687
2687
  const sharedValue = mergeValues(itemA, itemB);
2688
2688
  if (!sharedValue.valid) {
2689
2689
  return { valid: false };
@@ -2691,7 +2691,7 @@
2691
2691
  newArray.push(sharedValue.data);
2692
2692
  }
2693
2693
  return { valid: true, data: newArray };
2694
- } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b2) {
2694
+ } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
2695
2695
  return { valid: true, data: a };
2696
2696
  } else {
2697
2697
  return { valid: false };
@@ -3662,10 +3662,10 @@
3662
3662
  }
3663
3663
  }
3664
3664
  }
3665
- static create(a, b2) {
3665
+ static create(a, b) {
3666
3666
  return new ZodPipeline({
3667
3667
  in: a,
3668
- out: b2,
3668
+ out: b,
3669
3669
  typeName: ZodFirstPartyTypeKind.ZodPipeline
3670
3670
  });
3671
3671
  }
@@ -3697,10 +3697,10 @@
3697
3697
  return ZodAny.create().superRefine((data, ctx) => {
3698
3698
  var _a, _b;
3699
3699
  if (!check(data)) {
3700
- const p2 = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3701
- const _fatal = (_b = (_a = p2.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3702
- const p22 = typeof p2 === "string" ? { message: p2 } : p2;
3703
- ctx.addIssue({ code: "custom", ...p22, fatal: _fatal });
3700
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3701
+ const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3702
+ const p2 = typeof p === "string" ? { message: p } : p;
3703
+ ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
3704
3704
  }
3705
3705
  });
3706
3706
  return ZodAny.create();
@@ -3798,7 +3798,7 @@
3798
3798
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3799
3799
  };
3800
3800
  const NEVER = INVALID;
3801
- var z = /* @__PURE__ */ Object.freeze({
3801
+ var z$1 = /* @__PURE__ */ Object.freeze({
3802
3802
  __proto__: null,
3803
3803
  defaultErrorMap: errorMap,
3804
3804
  setErrorMap,
@@ -3914,10 +3914,10 @@
3914
3914
  quotelessJson,
3915
3915
  ZodError
3916
3916
  });
3917
- function c$1(n) {
3917
+ function c(n) {
3918
3918
  throw new Error("Unexpected object: " + n);
3919
3919
  }
3920
- function D$1(n, t) {
3920
+ function D(n, t) {
3921
3921
  return { ...n, src: i(n.src, t) };
3922
3922
  }
3923
3923
  function i(n, t) {
@@ -3940,13 +3940,13 @@
3940
3940
  secondary: n.secondary.map((e) => i(e, t))
3941
3941
  };
3942
3942
  default:
3943
- c$1(n);
3943
+ c(n);
3944
3944
  }
3945
3945
  }
3946
- z.object({
3947
- __isRef: z.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
3948
- blockId: z.string().describe("Upstream block id"),
3949
- name: z.string().describe(
3946
+ z$1.object({
3947
+ __isRef: z$1.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
3948
+ blockId: z$1.string().describe("Upstream block id"),
3949
+ name: z$1.string().describe(
3950
3950
  "Name of the output provided to the upstream block's output context"
3951
3951
  )
3952
3952
  }).describe(
@@ -3958,75 +3958,75 @@
3958
3958
  function x$1(n) {
3959
3959
  return r(n.spec);
3960
3960
  }
3961
- function B(n, t) {
3962
- return {
3961
+ function L$1(n, t) {
3962
+ return n === void 0 ? void 0 : {
3963
3963
  ...n,
3964
3964
  data: t(n.data)
3965
3965
  };
3966
3966
  }
3967
- function L(n, t) {
3967
+ function O$1(n, t) {
3968
3968
  return n.ok ? { ok: true, value: t(n.value) } : n;
3969
3969
  }
3970
3970
  var E = Object.defineProperty;
3971
- var j = (e, t, n) => t in e ? E(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
3972
- var c = (e, t, n) => j(e, typeof t != "symbol" ? t + "" : t, n);
3973
- function f(e) {
3971
+ var B = (e, t, n) => t in e ? E(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
3972
+ var g = (e, t, n) => B(e, typeof t != "symbol" ? t + "" : t, n);
3973
+ function A(e) {
3974
3974
  return { type: "Immediate", value: e };
3975
3975
  }
3976
- function $() {
3976
+ function N() {
3977
3977
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
3978
3978
  }
3979
- function x(e) {
3979
+ function k(e) {
3980
3980
  if (e && typeof globalThis.getPlatforma == "function")
3981
3981
  return globalThis.getPlatforma(e);
3982
3982
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
3983
3983
  throw new Error("Can't get platforma instance.");
3984
3984
  }
3985
- function M() {
3985
+ function K() {
3986
3986
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
3987
3987
  }
3988
3988
  function s() {
3989
3989
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
3990
3990
  throw new Error("Not in config rendering context");
3991
3991
  }
3992
- function y(e, t) {
3993
- const n = M();
3992
+ function v(e, t) {
3993
+ const n = K();
3994
3994
  if (n === void 0) return false;
3995
3995
  if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
3996
3996
  return n.callbackRegistry[e] = t, true;
3997
3997
  }
3998
- const b = /* @__PURE__ */ new Map();
3999
- function K(e, t) {
3998
+ const F = /* @__PURE__ */ new Map();
3999
+ function W(e, t) {
4000
4000
  e in s().callbackRegistry || (s().callbackRegistry[e] = (n) => {
4001
- for (const r2 of b.get(e))
4002
- r2(n);
4003
- }, b.set(e, [])), b.get(e).push(t);
4001
+ for (const i2 of F.get(e))
4002
+ i2(n);
4003
+ }, F.set(e, [])), F.get(e).push(t);
4004
4004
  }
4005
- class l {
4006
- constructor(t, n = (r2) => r2) {
4007
- c(this, "isResolved", false);
4008
- c(this, "resolvedValue");
4009
- this.handle = t, this.postProcess = n, K(t, (r2) => {
4010
- this.resolvedValue = n(r2), this.isResolved = true;
4005
+ class h {
4006
+ constructor(t, n = (i2) => i2) {
4007
+ g(this, "isResolved", false);
4008
+ g(this, "resolvedValue");
4009
+ this.handle = t, this.postProcess = n, W(t, (i2) => {
4010
+ this.resolvedValue = n(i2), this.isResolved = true;
4011
4011
  });
4012
4012
  }
4013
4013
  map(t) {
4014
- return new l(this.handle, (n) => t(this.postProcess(n)));
4014
+ return new h(this.handle, (n) => t(this.postProcess(n)));
4015
4015
  }
4016
4016
  mapDefined(t) {
4017
- return new l(this.handle, (n) => {
4018
- const r2 = this.postProcess(n);
4019
- return r2 ? t(r2) : void 0;
4017
+ return new h(this.handle, (n) => {
4018
+ const i2 = this.postProcess(n);
4019
+ return i2 ? t(i2) : void 0;
4020
4020
  });
4021
4021
  }
4022
4022
  toJSON() {
4023
4023
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4024
4024
  }
4025
4025
  }
4026
- function F(e) {
4027
- return e === void 0 ? void 0 : new p(e);
4026
+ function O(e) {
4027
+ return e === void 0 ? void 0 : new m(e);
4028
4028
  }
4029
- class p {
4029
+ class m {
4030
4030
  constructor(t) {
4031
4031
  this.handle = t;
4032
4032
  }
@@ -4034,7 +4034,7 @@
4034
4034
  return this.resolveWithCommon({}, ...t);
4035
4035
  }
4036
4036
  resolveWithCommon(t, ...n) {
4037
- return F(s().resolveWithCommon(this.handle, t, ...n));
4037
+ return O(s().resolveWithCommon(this.handle, t, ...n));
4038
4038
  }
4039
4039
  get resourceType() {
4040
4040
  return s().getResourceType(this.handle);
@@ -4052,7 +4052,7 @@
4052
4052
  return s().getIsFinal(this.handle);
4053
4053
  }
4054
4054
  getError() {
4055
- return F(s().getError(this.handle));
4055
+ return O(s().getError(this.handle));
4056
4056
  }
4057
4057
  listInputFields() {
4058
4058
  return s().listInputFields(this.handle);
@@ -4089,35 +4089,35 @@
4089
4089
  *
4090
4090
  */
4091
4091
  getPColumns(t = false, n = "") {
4092
- const r2 = this.parsePObjectCollection(t, n);
4093
- return r2 === void 0 ? void 0 : Object.entries(r2).map(([, a]) => {
4094
- if (!x$1(a)) throw new Error(`not a PColumn (kind = ${a.spec.kind})`);
4095
- return a;
4092
+ const i2 = this.parsePObjectCollection(t, n);
4093
+ return i2 === void 0 ? void 0 : Object.entries(i2).map(([, o]) => {
4094
+ if (!x$1(o)) throw new Error(`not a PColumn (kind = ${o.spec.kind})`);
4095
+ return o;
4096
4096
  });
4097
4097
  }
4098
4098
  /**
4099
4099
  *
4100
4100
  */
4101
4101
  parsePObjectCollection(t = false, n = "") {
4102
- const r2 = s().parsePObjectCollection(
4102
+ const i2 = s().parsePObjectCollection(
4103
4103
  this.handle,
4104
4104
  t,
4105
4105
  n
4106
4106
  );
4107
- if (r2 === void 0) return;
4108
- const i2 = {};
4109
- for (const [a, d] of Object.entries(r2))
4110
- i2[a] = B(d, (u) => new p(u));
4111
- return i2;
4107
+ if (i2 === void 0) return;
4108
+ const r2 = {};
4109
+ for (const [o, u] of Object.entries(i2))
4110
+ r2[o] = L$1(u, (a) => new m(a));
4111
+ return r2;
4112
4112
  }
4113
4113
  getFileContentAsBase64() {
4114
- return new l(s().getBlobContentAsBase64(this.handle));
4114
+ return new h(s().getBlobContentAsBase64(this.handle));
4115
4115
  }
4116
4116
  getFileContentAsString() {
4117
- return new l(s().getBlobContentAsString(this.handle));
4117
+ return new h(s().getBlobContentAsString(this.handle));
4118
4118
  }
4119
4119
  getFileContentAsJson() {
4120
- return new l(
4120
+ return new h(
4121
4121
  s().getBlobContentAsString(this.handle)
4122
4122
  ).mapDefined((t) => JSON.parse(t));
4123
4123
  }
@@ -4137,7 +4137,7 @@
4137
4137
  * @returns downloaded file handle
4138
4138
  */
4139
4139
  getFileHandle() {
4140
- return new l(s().getDownloadedBlobContentHandle(this.handle));
4140
+ return new h(s().getDownloadedBlobContentHandle(this.handle));
4141
4141
  }
4142
4142
  /**
4143
4143
  * @deprecated use getFileHandle
@@ -4149,7 +4149,7 @@
4149
4149
  * @returns downloaded file handle
4150
4150
  */
4151
4151
  getRemoteFileHandle() {
4152
- return new l(s().getOnDemandBlobContentHandle(this.handle));
4152
+ return new h(s().getOnDemandBlobContentHandle(this.handle));
4153
4153
  }
4154
4154
  /**
4155
4155
  * @deprecated use getRemoteFileHandle
@@ -4158,25 +4158,51 @@
4158
4158
  return this.getRemoteFileHandle();
4159
4159
  }
4160
4160
  getImportProgress() {
4161
- return new l(s().getImportProgress(this.handle));
4161
+ return new h(s().getImportProgress(this.handle));
4162
4162
  }
4163
4163
  getLastLogs(t) {
4164
- return new l(s().getLastLogs(this.handle, t));
4164
+ return new h(s().getLastLogs(this.handle, t));
4165
4165
  }
4166
4166
  getProgressLog(t) {
4167
- return new l(s().getProgressLog(this.handle, t));
4167
+ return new h(s().getProgressLog(this.handle, t));
4168
4168
  }
4169
4169
  getLogHandle() {
4170
- return new l(s().getLogHandle(this.handle));
4170
+ return new h(s().getLogHandle(this.handle));
4171
+ }
4172
+ allFieldsResolved(t = "Input") {
4173
+ switch (t) {
4174
+ case "Input":
4175
+ return this.getInputsLocked() && this.listInputFields().every(
4176
+ (n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
4177
+ );
4178
+ case "Output":
4179
+ return this.getOutputsLocked() && this.listOutputFields().every(
4180
+ (n) => this.resolve({ field: n, assertFieldType: "Output" }) !== void 0
4181
+ );
4182
+ }
4183
+ }
4184
+ mapFields(t, n) {
4185
+ const { fieldType: i2, requireLocked: r2, skipUnresolved: o } = {
4186
+ fieldType: "Input",
4187
+ requireLocked: true,
4188
+ skipUnresolved: false,
4189
+ ...n
4190
+ }, u = t;
4191
+ if (r2 && (i2 === "Input" && !this.getInputsLocked() || i2 === "Output" && !this.getOutputsLocked()))
4192
+ return;
4193
+ let p = (i2 === "Input" ? this.listInputFields() : i2 === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4194
+ (c2) => [c2, this.resolve({ field: c2, assertFieldType: i2 })]
4195
+ );
4196
+ return o && (p = p.filter((c2) => c2[1] !== void 0)), p.map(([c2, f]) => u(c2, f));
4171
4197
  }
4172
4198
  }
4173
- const R = "staging", V = "main";
4174
- class U {
4199
+ const L = "staging", j = "main";
4200
+ class z {
4175
4201
  constructor() {
4176
- c(this, "ctx", s());
4177
- c(this, "defaultLabelFn", (t, n) => {
4178
- var r2;
4179
- return ((r2 = t.annotations) == null ? void 0 : r2["pl7.app/label"]) ?? "Unlabelled";
4202
+ g(this, "ctx", s());
4203
+ g(this, "defaultLabelFn", (t, n) => {
4204
+ var i2;
4205
+ return ((i2 = t.annotations) == null ? void 0 : i2["pl7.app/label"]) ?? "Unlabelled";
4180
4206
  });
4181
4207
  }
4182
4208
  /**
@@ -4186,9 +4212,9 @@
4186
4212
  return this.ctx.calculateOptions(t);
4187
4213
  }
4188
4214
  getOptions(t, n = this.defaultLabelFn) {
4189
- return this.getSpecs().entries.filter((r2) => t(r2.obj)).map((r2) => ({
4190
- ref: r2.ref,
4191
- label: n(r2.obj, r2.ref)
4215
+ return this.getSpecs().entries.filter((i2) => t(i2.obj)).map((i2) => ({
4216
+ ref: i2.ref,
4217
+ label: n(i2.obj, i2.ref)
4192
4218
  }));
4193
4219
  }
4194
4220
  /**
@@ -4205,7 +4231,7 @@
4205
4231
  ref: n.ref,
4206
4232
  obj: {
4207
4233
  ...n.obj,
4208
- data: new p(n.obj.data)
4234
+ data: new m(n.obj.data)
4209
4235
  }
4210
4236
  }))
4211
4237
  };
@@ -4224,7 +4250,7 @@
4224
4250
  ref: n.ref,
4225
4251
  obj: {
4226
4252
  ...n.obj,
4227
- data: L(n.obj.data, (r2) => new p(r2))
4253
+ data: O$1(n.obj.data, (i2) => new m(i2))
4228
4254
  }
4229
4255
  }))
4230
4256
  };
@@ -4244,9 +4270,12 @@
4244
4270
  */
4245
4271
  getDataByRef(t) {
4246
4272
  var n;
4247
- return (n = this.getData().entries.find(
4248
- (r2) => r2.ref.blockId === t.blockId && r2.ref.name === t.name
4249
- )) == null ? void 0 : n.obj;
4273
+ return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
4274
+ (i2) => i2.ref.blockId === t.blockId && i2.ref.name === t.name
4275
+ )) == null ? void 0 : n.obj : L$1(
4276
+ this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
4277
+ (i2) => new m(i2)
4278
+ );
4250
4279
  }
4251
4280
  /**
4252
4281
  * @param ref a Ref
@@ -4254,9 +4283,9 @@
4254
4283
  */
4255
4284
  getSpecByRef(t) {
4256
4285
  var n;
4257
- return (n = this.getSpecs().entries.find(
4258
- (r2) => r2.ref.blockId === t.blockId && r2.ref.name === t.name
4259
- )) == null ? void 0 : n.obj;
4286
+ return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
4287
+ (i2) => i2.ref.blockId === t.blockId && i2.ref.name === t.name
4288
+ )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
4260
4289
  }
4261
4290
  /**
4262
4291
  * @param spec object specification
@@ -4264,23 +4293,23 @@
4264
4293
  */
4265
4294
  findDataWithCompatibleSpec(t) {
4266
4295
  const n = [];
4267
- t: for (const r$1 of this.getData().entries) {
4268
- if (!r(r$1.obj.spec))
4296
+ t: for (const i2 of this.getData().entries) {
4297
+ if (!r(i2.obj.spec))
4269
4298
  continue;
4270
- const i2 = r$1.obj.spec;
4271
- if (t.name === i2.name && t.valueType === i2.valueType && t.axesSpec.length === i2.axesSpec.length && D(t.domain, i2.domain)) {
4272
- for (let a = 0; a < t.axesSpec.length; ++a) {
4273
- const d = t.axesSpec[a], u = i2.axesSpec[a];
4274
- if (d.name !== u.name || d.type !== u.type || !D(d.domain, u.domain))
4299
+ const r$1 = i2.obj.spec;
4300
+ if (t.name === r$1.name && t.valueType === r$1.valueType && t.axesSpec.length === r$1.axesSpec.length && x(t.domain, r$1.domain)) {
4301
+ for (let o = 0; o < t.axesSpec.length; ++o) {
4302
+ const u = t.axesSpec[o], a = r$1.axesSpec[o];
4303
+ if (u.name !== a.name || u.type !== a.type || !x(u.domain, a.domain))
4275
4304
  continue t;
4276
4305
  }
4277
- n.push(r$1.obj);
4306
+ n.push(i2.obj);
4278
4307
  }
4279
4308
  }
4280
4309
  return n;
4281
4310
  }
4282
4311
  }
4283
- function D(e, t) {
4312
+ function x(e, t) {
4284
4313
  if (e === void 0) return t === void 0;
4285
4314
  if (t === void 0) return true;
4286
4315
  for (const n in t)
@@ -4289,18 +4318,18 @@
4289
4318
  }
4290
4319
  class w {
4291
4320
  constructor() {
4292
- c(this, "ctx");
4293
- c(this, "args");
4294
- c(this, "uiState");
4295
- c(this, "resultPool", new U());
4321
+ g(this, "ctx");
4322
+ g(this, "args");
4323
+ g(this, "uiState");
4324
+ g(this, "resultPool", new z());
4296
4325
  this.ctx = s(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
4297
4326
  }
4298
4327
  getNamedAccessor(t) {
4299
4328
  const n = this.ctx.getAccessorHandleByName(t);
4300
- return n ? new p(n) : void 0;
4329
+ return n ? new m(n) : void 0;
4301
4330
  }
4302
4331
  get prerun() {
4303
- return this.getNamedAccessor(R);
4332
+ return this.getNamedAccessor(L);
4304
4333
  }
4305
4334
  /**
4306
4335
  * @deprecated use prerun
@@ -4315,7 +4344,7 @@
4315
4344
  return this.precalc;
4316
4345
  }
4317
4346
  get outputs() {
4318
- return this.getNamedAccessor(V);
4347
+ return this.getNamedAccessor(j);
4319
4348
  }
4320
4349
  /**
4321
4350
  * @deprecated use outputs
@@ -4324,108 +4353,184 @@
4324
4353
  return this.outputs;
4325
4354
  }
4326
4355
  createPFrame(t) {
4327
- return this.ctx.createPFrame(t.map((n) => B(n, (r2) => r2.handle)));
4356
+ return this.ctx.createPFrame(t.map((n) => L$1(n, (i2) => i2.handle)));
4328
4357
  }
4329
4358
  createPTable(t) {
4330
4359
  var n;
4331
4360
  return "columns" in t ? n = {
4332
4361
  src: {
4333
4362
  type: "inner",
4334
- entries: t.columns.map((r2) => ({ type: "column", column: r2 }))
4363
+ entries: t.columns.map((i2) => ({ type: "column", column: i2 }))
4335
4364
  },
4336
4365
  filters: t.filters ?? [],
4337
4366
  sorting: t.sorting ?? []
4338
- } : n = t, this.ctx.createPTable(D$1(n, (r2) => B(r2, (i2) => i2.handle)));
4367
+ } : n = t, this.ctx.createPTable(D(n, (i2) => L$1(i2, (r2) => r2.handle)));
4339
4368
  }
4369
+ /** @deprecated scheduled for removal from SDK */
4340
4370
  getBlockLabel(t) {
4341
4371
  return this.ctx.getBlockLabel(t);
4342
4372
  }
4373
+ getCurrentUnstableMarker() {
4374
+ if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
4375
+ return this.ctx.getCurrentUnstableMarker();
4376
+ }
4377
+ }
4378
+ const y = "1.9.0";
4379
+ function Q(e) {
4380
+ return e.__renderLambda === true;
4381
+ }
4382
+ function V(e) {
4383
+ if (e !== void 0)
4384
+ return Q(e) ? e.handle : e;
4343
4385
  }
4344
- const O = "1.8.19";
4345
- class g {
4346
- constructor(t, n, r2, i2, a) {
4347
- this._renderingMode = t, this._initialArgs = n, this._outputs = r2, this._inputsValid = i2, this._sections = a;
4386
+ class d {
4387
+ constructor(t, n, i2, r2, o, u, a) {
4388
+ this._renderingMode = t, this._initialArgs = n, this._initialUiState = i2, this._outputs = r2, this._inputsValid = o, this._sections = u, this._title = a;
4348
4389
  }
4349
- /** Initiates configuration builder */
4350
4390
  static create(t = "Heavy") {
4351
- return new g(
4391
+ return new d(
4352
4392
  t,
4353
4393
  void 0,
4354
4394
  {},
4355
- f(true),
4356
- f([])
4395
+ {},
4396
+ A(true),
4397
+ A([]),
4398
+ void 0
4357
4399
  );
4358
4400
  }
4359
- output(t, n) {
4401
+ output(t, n, i2 = {}) {
4360
4402
  if (typeof n == "function") {
4361
4403
  const r2 = `output#${t}`;
4362
- return y(r2, () => n(new w())), new g(
4404
+ return v(r2, () => n(new w())), new d(
4363
4405
  this._renderingMode,
4364
4406
  this._initialArgs,
4407
+ this._initialUiState,
4365
4408
  {
4366
4409
  ...this._outputs,
4367
- [t]: r2
4410
+ [t]: {
4411
+ __renderLambda: true,
4412
+ handle: r2,
4413
+ ...i2
4414
+ }
4368
4415
  },
4369
4416
  this._inputsValid,
4370
- this._sections
4417
+ this._sections,
4418
+ this._title
4371
4419
  );
4372
4420
  } else
4373
- return new g(
4421
+ return new d(
4374
4422
  this._renderingMode,
4375
4423
  this._initialArgs,
4424
+ this._initialUiState,
4376
4425
  {
4377
4426
  ...this._outputs,
4378
4427
  [t]: n
4379
4428
  },
4380
4429
  this._inputsValid,
4381
- this._sections
4430
+ this._sections,
4431
+ this._title
4382
4432
  );
4383
4433
  }
4434
+ /** Shortcut for {@link output} with retentive flag set to true. */
4435
+ retentiveOutput(t, n) {
4436
+ return this.output(t, n, { retentive: true });
4437
+ }
4384
4438
  /** @deprecated */
4385
4439
  canRun(t) {
4386
4440
  return this.inputsValid(t);
4387
4441
  }
4388
4442
  argsValid(t) {
4389
- return typeof t == "function" ? (y("inputsValid", () => t(new w())), new g(
4443
+ return typeof t == "function" ? (v("inputsValid", () => t(new w())), new d(
4390
4444
  this._renderingMode,
4391
4445
  this._initialArgs,
4446
+ this._initialUiState,
4392
4447
  this._outputs,
4393
- "inputsValid",
4394
- this._sections
4395
- )) : new g(
4448
+ {
4449
+ __renderLambda: true,
4450
+ handle: "inputsValid"
4451
+ },
4452
+ this._sections,
4453
+ this._title
4454
+ )) : new d(
4396
4455
  this._renderingMode,
4397
4456
  this._initialArgs,
4457
+ this._initialUiState,
4398
4458
  this._outputs,
4399
4459
  t,
4400
- this._sections
4460
+ this._sections,
4461
+ this._title
4401
4462
  );
4402
4463
  }
4403
4464
  inputsValid(t) {
4404
4465
  return this.argsValid(t);
4405
4466
  }
4406
4467
  sections(t) {
4407
- return Array.isArray(t) ? this.sections(f(t)) : typeof t == "function" ? (y("sections", () => t(new w())), new g(
4468
+ return Array.isArray(t) ? this.sections(A(t)) : typeof t == "function" ? (v("sections", () => t(new w())), new d(
4408
4469
  this._renderingMode,
4409
4470
  this._initialArgs,
4471
+ this._initialUiState,
4410
4472
  this._outputs,
4411
4473
  this._inputsValid,
4412
- "sections"
4413
- )) : new g(
4474
+ { __renderLambda: true, handle: "sections" },
4475
+ this._title
4476
+ )) : new d(
4414
4477
  this._renderingMode,
4415
4478
  this._initialArgs,
4479
+ this._initialUiState,
4416
4480
  this._outputs,
4417
4481
  this._inputsValid,
4418
- t
4482
+ t,
4483
+ this._title
4419
4484
  );
4420
4485
  }
4421
- /** Sets initial args for the block, this value must be specified. */
4486
+ title(t) {
4487
+ return v("title", () => t(new w())), new d(
4488
+ this._renderingMode,
4489
+ this._initialArgs,
4490
+ this._initialUiState,
4491
+ this._outputs,
4492
+ this._inputsValid,
4493
+ this._sections,
4494
+ { __renderLambda: true, handle: "title" }
4495
+ );
4496
+ }
4497
+ /**
4498
+ * Sets initial args for the block, this value must be specified.
4499
+ * @deprecated use {@link withArgs}
4500
+ * */
4422
4501
  initialArgs(t) {
4423
- return new g(
4502
+ return new d(
4503
+ this._renderingMode,
4504
+ t,
4505
+ this._initialUiState,
4506
+ this._outputs,
4507
+ this._inputsValid,
4508
+ this._sections,
4509
+ this._title
4510
+ );
4511
+ }
4512
+ /** Sets initial args for the block, this value must be specified. */
4513
+ withArgs(t) {
4514
+ return new d(
4424
4515
  this._renderingMode,
4425
4516
  t,
4517
+ this._initialUiState,
4426
4518
  this._outputs,
4427
4519
  this._inputsValid,
4428
- this._sections
4520
+ this._sections,
4521
+ this._title
4522
+ );
4523
+ }
4524
+ /** Defines type and sets initial value for block UiState. */
4525
+ withUiState(t) {
4526
+ return new d(
4527
+ this._renderingMode,
4528
+ this._initialArgs,
4529
+ t,
4530
+ this._outputs,
4531
+ this._inputsValid,
4532
+ this._sections,
4533
+ this._title
4429
4534
  );
4430
4535
  }
4431
4536
  /** Renders all provided block settings into a pre-configured platforma API
@@ -4434,26 +4539,36 @@
4434
4539
  done() {
4435
4540
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
4436
4541
  const t = {
4437
- sdkVersion: O,
4542
+ v3: {
4543
+ sdkVersion: y,
4544
+ renderingMode: this._renderingMode,
4545
+ initialArgs: this._initialArgs,
4546
+ initialUiState: this._initialUiState,
4547
+ inputsValid: this._inputsValid,
4548
+ sections: this._sections,
4549
+ title: this._title,
4550
+ outputs: this._outputs
4551
+ },
4552
+ // fields below are added to allow previous desktop versions read generated configs
4553
+ sdkVersion: y,
4438
4554
  renderingMode: this._renderingMode,
4439
4555
  initialArgs: this._initialArgs,
4440
- inputsValid: this._inputsValid,
4441
- sections: this._sections,
4442
- outputs: this._outputs
4556
+ inputsValid: V(this._inputsValid),
4557
+ sections: V(this._sections),
4558
+ outputs: Object.fromEntries(
4559
+ Object.entries(this._outputs).map(([n, i2]) => [n, V(i2)])
4560
+ )
4443
4561
  };
4444
- return $() ? x(t) : { config: t };
4562
+ return N() ? k({ sdkVersion: y }) : { config: t };
4445
4563
  }
4446
4564
  }
4447
- const $BlockArgs = z.object({
4448
- numbers: z.array(z.coerce.number())
4565
+ const $BlockArgs = z$1.object({
4566
+ numbers: z$1.array(z$1.coerce.number())
4449
4567
  });
4450
- const platforma = g.create("Heavy").initialArgs({ numbers: [] }).output(
4451
- "numbers",
4452
- (ctx) => {
4453
- var _a, _b;
4454
- return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
4455
- }
4456
- ).output("pFrame", (ctx) => {
4568
+ const platforma = d.create("Heavy").withArgs({ numbers: [] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => {
4569
+ var _a, _b;
4570
+ return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
4571
+ }).output("pFrame", (ctx) => {
4457
4572
  const collection = ctx.resultPool.getData();
4458
4573
  if (collection === void 0 || !collection.isComplete) return void 0;
4459
4574
  const valueTypes = ["Int", "Long", "Float", "Double", "String", "Bytes"];