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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -3071,29 +3071,29 @@
3071
3071
  const params = { errorMap: ctx.common.contextualErrorMap };
3072
3072
  const fn2 = 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(fn2, 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(fn2, 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
  }
@@ -3955,7 +3955,7 @@
3955
3955
  return canonicalize;
3956
3956
  }
3957
3957
  var canonicalizeExports = requireCanonicalize();
3958
- const Re = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
3958
+ const Oe = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
3959
3959
  var B$1 = Object.defineProperty;
3960
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
3961
  var l$1 = (n2, e, t) => j(n2, typeof e != "symbol" ? e + "" : e, t);
@@ -4095,7 +4095,7 @@
4095
4095
  }
4096
4096
  }
4097
4097
  }
4098
- function Fn$1(n2) {
4098
+ function Fn(n2) {
4099
4099
  return {
4100
4100
  columnId: n2.id,
4101
4101
  spec: n2.spec
@@ -4109,7 +4109,7 @@
4109
4109
  return n2.map(p$1);
4110
4110
  }
4111
4111
  function Rn(n2) {
4112
- return Re(p$1(n2));
4112
+ return Oe(p$1(n2));
4113
4113
  }
4114
4114
  function Y$1(n2, e) {
4115
4115
  if (n2 === void 0) return e === void 0;
@@ -4157,15 +4157,15 @@
4157
4157
  }
4158
4158
  }
4159
4159
  function nn(n2) {
4160
- return Re(n2);
4160
+ return Oe(n2);
4161
4161
  }
4162
4162
  function P(n2) {
4163
- return Re(p$1(n2));
4163
+ return Oe(p$1(n2));
4164
4164
  }
4165
- function k(n2, e) {
4165
+ function k$1(n2, e) {
4166
4166
  return JSON.stringify([n2, e]);
4167
4167
  }
4168
- class _n {
4168
+ class Mn {
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
@@ -4187,7 +4187,7 @@
4187
4187
  const s2 = Object.entries(o.domain);
4188
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
4189
  for (const [a, i] of s2) {
4190
- const u2 = k(a, i);
4190
+ const u2 = k$1(a, i);
4191
4191
  this.domains.set(u2, r);
4192
4192
  }
4193
4193
  }
@@ -4222,7 +4222,7 @@
4222
4222
  for (const [a, i] of Object.entries(e.domain ?? {})) {
4223
4223
  if (o !== void 0 && o.has(a))
4224
4224
  continue;
4225
- const u2 = k(a, i), c2 = this.domains.get(u2);
4225
+ const u2 = k$1(a, i), c2 = this.domains.get(u2);
4226
4226
  r.domain ?? (r.domain = {}), r.domain[a] = c2 ? { anchor: c2 } : i;
4227
4227
  }
4228
4228
  if (r.axes = e.axesSpec.map((a) => {
@@ -4259,7 +4259,7 @@
4259
4259
  return nn(this.derive(e, t));
4260
4260
  }
4261
4261
  }
4262
- function Mn(n2, e, t) {
4262
+ function Tn(n2, e, t) {
4263
4263
  const r = { ...e }, o = (t == null ? void 0 : t.ignoreMissingDomains) ?? false;
4264
4264
  if (r.domainAnchor !== void 0) {
4265
4265
  const s2 = n2[r.domainAnchor];
@@ -4324,17 +4324,17 @@
4324
4324
  function rn(n2) {
4325
4325
  return f(n2.spec);
4326
4326
  }
4327
- function qn(n2) {
4327
+ function Wn(n2) {
4328
4328
  if (!rn(n2)) throw new Error(`not a PColumn (kind = ${n2.spec.kind})`);
4329
4329
  return n2;
4330
4330
  }
4331
- function Wn(n2, e) {
4331
+ function Xn(n2, e) {
4332
4332
  return n2 === void 0 ? void 0 : {
4333
4333
  ...n2,
4334
4334
  data: e(n2.data)
4335
4335
  };
4336
4336
  }
4337
- function Xn(n2) {
4337
+ function Gn(n2) {
4338
4338
  const e = /* @__PURE__ */ new Map(), t = (r) => {
4339
4339
  switch (r.type) {
4340
4340
  case "column":
@@ -4359,7 +4359,7 @@
4359
4359
  };
4360
4360
  return t(n2), [...e.values()];
4361
4361
  }
4362
- function E$1(n2, e) {
4362
+ function E(n2, e) {
4363
4363
  if (n2.name !== void 0 && n2.name !== e.name)
4364
4364
  return false;
4365
4365
  if (n2.type !== void 0) {
@@ -4397,13 +4397,13 @@
4397
4397
  const t = n2.axesSpec.map(p$1);
4398
4398
  if (e.partialAxesMatch) {
4399
4399
  for (const r of e.axes)
4400
- if (!t.some((o) => E$1(r, o)))
4400
+ if (!t.some((o) => E(r, o)))
4401
4401
  return false;
4402
4402
  } else {
4403
4403
  if (t.length !== e.axes.length)
4404
4404
  return false;
4405
4405
  for (let r = 0; r < e.axes.length; r++)
4406
- if (!E$1(e.axes[r], t[r]))
4406
+ if (!E(e.axes[r], t[r]))
4407
4407
  return false;
4408
4408
  }
4409
4409
  }
@@ -4423,15 +4423,15 @@
4423
4423
  }
4424
4424
  return true;
4425
4425
  }
4426
- function Gn(n2) {
4426
+ function Qn(n2) {
4427
4427
  return Array.isArray(n2) ? (e) => n2.some((t) => f(e) && N(e, t)) : (e) => f(e) && N(e, n2);
4428
4428
  }
4429
- function Qn(n2) {
4429
+ function Yn(n2) {
4430
4430
  const e = {
4431
4431
  kind: n2.kind,
4432
4432
  name: n2.name
4433
4433
  };
4434
- return n2.domain !== void 0 && (e.domain = n2.domain), f(n2) && (e.axesSpec = J(n2.axesSpec)), Re(e);
4434
+ return n2.domain !== void 0 && (e.domain = n2.domain), f(n2) && (e.axesSpec = J(n2.axesSpec)), Oe(e);
4435
4435
  }
4436
4436
  z$1.object({
4437
4437
  __isRef: z$1.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
@@ -4441,10 +4441,10 @@
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 ne(n2) {
4444
+ function ee(n2) {
4445
4445
  return typeof n2 == "object" && n2 !== null && "__isRef" in n2 && n2.__isRef === true && "blockId" in n2 && "name" in n2;
4446
4446
  }
4447
- function te$1(n2, e = true) {
4447
+ function re$1(n2, e = true) {
4448
4448
  if (e)
4449
4449
  return {
4450
4450
  ...n2,
@@ -4455,13 +4455,13 @@
4455
4455
  return r;
4456
4456
  }
4457
4457
  }
4458
- function oe$1(n2, e) {
4458
+ function ie(n2, e) {
4459
4459
  return n2.ok ? { ok: true, value: e(n2.value) } : n2;
4460
4460
  }
4461
4461
  const fn = 24;
4462
4462
  z$1.string().length(fn).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4463
- function ue$1(n2) {
4464
- return Re(n2);
4463
+ function ce$1(n2) {
4464
+ return Oe(n2);
4465
4465
  }
4466
4466
  var stringify = { exports: {} };
4467
4467
  var hasRequiredStringify;
@@ -4522,54 +4522,54 @@
4522
4522
  cause: z$1.lazy(() => n).optional(),
4523
4523
  errors: z$1.lazy(() => n.array()).optional()
4524
4524
  });
4525
- var Ye = Object.defineProperty;
4526
- var Xe = (t, e, n2) => e in t ? Ye(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4527
- var D = (t, e, n2) => Xe(t, typeof e != "symbol" ? e + "" : e, n2);
4525
+ var qe = Object.defineProperty;
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
4528
  function re(t) {
4529
4529
  return { type: "Immediate", value: t };
4530
4530
  }
4531
- function ht() {
4531
+ function pt() {
4532
4532
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
4533
4533
  }
4534
- function Ke(t) {
4534
+ function Ve(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 gt() {
4540
+ function ft() {
4541
4541
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4542
4542
  }
4543
- function y() {
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
4547
  function H(t, e) {
4548
- const n2 = gt();
4548
+ const n2 = ft();
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 de = /* @__PURE__ */ new Map();
4554
- function mt(t, e) {
4555
- t in y().callbackRegistry || (y().callbackRegistry[t] = (n2) => {
4556
- for (const r of de.get(t))
4553
+ const ce = /* @__PURE__ */ new Map();
4554
+ function ht(t, e) {
4555
+ t in v().callbackRegistry || (v().callbackRegistry[t] = (n2) => {
4556
+ for (const r of ce.get(t))
4557
4557
  r(n2);
4558
- }, de.set(t, [])), de.get(t).push(e);
4558
+ }, ce.set(t, [])), ce.get(t).push(e);
4559
4559
  }
4560
- class I {
4560
+ class L {
4561
4561
  constructor(e, n2 = (r) => r) {
4562
- D(this, "isResolved", false);
4563
- D(this, "resolvedValue");
4564
- this.handle = e, this.postProcess = n2, mt(e, (r) => {
4562
+ F(this, "isResolved", false);
4563
+ F(this, "resolvedValue");
4564
+ this.handle = e, this.postProcess = n2, ht(e, (r) => {
4565
4565
  this.resolvedValue = n2(r), this.isResolved = true;
4566
4566
  });
4567
4567
  }
4568
4568
  map(e) {
4569
- return new I(this.handle, (n2) => e(this.postProcess(n2)));
4569
+ return new L(this.handle, (n2) => e(this.postProcess(n2)));
4570
4570
  }
4571
4571
  mapDefined(e) {
4572
- return new I(this.handle, (n2) => {
4572
+ return new L(this.handle, (n2) => {
4573
4573
  const r = this.postProcess(n2);
4574
4574
  return r ? e(r) : void 0;
4575
4575
  });
@@ -4578,10 +4578,10 @@
4578
4578
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4579
4579
  }
4580
4580
  }
4581
- function ge(t, e) {
4581
+ function he(t, e) {
4582
4582
  return t === void 0 ? void 0 : e(t);
4583
4583
  }
4584
- class E {
4584
+ class D {
4585
4585
  constructor(e, n2) {
4586
4586
  this.handle = e, this.resolvePath = n2;
4587
4587
  }
@@ -4620,47 +4620,47 @@
4620
4620
  ...this.resolvePath,
4621
4621
  ...n2.map((i) => typeof i == "string" ? i : i.field)
4622
4622
  ];
4623
- return ge(
4624
- y().resolveWithCommon(this.handle, e, ...n2),
4625
- (i) => new E(i, r)
4623
+ return he(
4624
+ v().resolveWithCommon(this.handle, e, ...n2),
4625
+ (i) => new D(i, r)
4626
4626
  );
4627
4627
  }
4628
4628
  get resourceType() {
4629
- return y().getResourceType(this.handle);
4629
+ return v().getResourceType(this.handle);
4630
4630
  }
4631
4631
  getInputsLocked() {
4632
- return y().getInputsLocked(this.handle);
4632
+ return v().getInputsLocked(this.handle);
4633
4633
  }
4634
4634
  getOutputsLocked() {
4635
- return y().getOutputsLocked(this.handle);
4635
+ return v().getOutputsLocked(this.handle);
4636
4636
  }
4637
4637
  getIsReadyOrError() {
4638
- return y().getIsReadyOrError(this.handle);
4638
+ return v().getIsReadyOrError(this.handle);
4639
4639
  }
4640
4640
  getIsFinal() {
4641
- return y().getIsFinal(this.handle);
4641
+ return v().getIsFinal(this.handle);
4642
4642
  }
4643
4643
  getError() {
4644
4644
  const e = [...this.resolvePath, "error"];
4645
- return ge(
4646
- y().getError(this.handle),
4647
- (n2) => new E(n2, e)
4645
+ return he(
4646
+ v().getError(this.handle),
4647
+ (n2) => new D(n2, e)
4648
4648
  );
4649
4649
  }
4650
4650
  listInputFields() {
4651
- return y().listInputFields(this.handle);
4651
+ return v().listInputFields(this.handle);
4652
4652
  }
4653
4653
  listOutputFields() {
4654
- return y().listOutputFields(this.handle);
4654
+ return v().listOutputFields(this.handle);
4655
4655
  }
4656
4656
  listDynamicFields() {
4657
- return y().listDynamicFields(this.handle);
4657
+ return v().listDynamicFields(this.handle);
4658
4658
  }
4659
4659
  getKeyValueBase64(e) {
4660
- return y().getKeyValueBase64(this.handle, e);
4660
+ return v().getKeyValueBase64(this.handle, e);
4661
4661
  }
4662
4662
  getKeyValueAsString(e) {
4663
- return y().getKeyValueAsString(this.handle, e);
4663
+ return v().getKeyValueAsString(this.handle, e);
4664
4664
  }
4665
4665
  getKeyValueAsJson(e) {
4666
4666
  const n2 = this.getKeyValueAsString(e);
@@ -4668,10 +4668,10 @@
4668
4668
  return JSON.parse(n2);
4669
4669
  }
4670
4670
  getDataBase64() {
4671
- return y().getDataBase64(this.handle);
4671
+ return v().getDataBase64(this.handle);
4672
4672
  }
4673
4673
  getDataAsString() {
4674
- return y().getDataAsString(this.handle);
4674
+ return v().getDataAsString(this.handle);
4675
4675
  }
4676
4676
  getDataAsJson() {
4677
4677
  const e = this.getDataAsString();
@@ -4692,7 +4692,7 @@
4692
4692
  *
4693
4693
  */
4694
4694
  parsePObjectCollection(e = false, n2 = "") {
4695
- const r = y().parsePObjectCollection(
4695
+ const r = v().parsePObjectCollection(
4696
4696
  this.handle,
4697
4697
  e,
4698
4698
  n2,
@@ -4702,19 +4702,19 @@
4702
4702
  const i = {};
4703
4703
  for (const [s2, o] of Object.entries(r)) {
4704
4704
  const a = [...this.resolvePath, s2];
4705
- i[s2] = Wn(o, (l2) => new E(l2, a));
4705
+ i[s2] = Xn(o, (l2) => new D(l2, a));
4706
4706
  }
4707
4707
  return i;
4708
4708
  }
4709
4709
  getFileContentAsBase64(e) {
4710
- return new I(y().getBlobContentAsBase64(this.handle, e));
4710
+ return new L(v().getBlobContentAsBase64(this.handle, e));
4711
4711
  }
4712
4712
  getFileContentAsString(e) {
4713
- return new I(y().getBlobContentAsString(this.handle, e));
4713
+ return new L(v().getBlobContentAsString(this.handle, e));
4714
4714
  }
4715
4715
  getFileContentAsJson(e) {
4716
- return new I(
4717
- y().getBlobContentAsString(this.handle, e)
4716
+ return new L(
4717
+ v().getBlobContentAsString(this.handle, e)
4718
4718
  ).mapDefined((n2) => JSON.parse(n2));
4719
4719
  }
4720
4720
  /**
@@ -4733,7 +4733,7 @@
4733
4733
  * @returns downloaded file handle
4734
4734
  */
4735
4735
  getFileHandle() {
4736
- return new I(y().getDownloadedBlobContentHandle(this.handle));
4736
+ return new L(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 I(y().getOnDemandBlobContentHandle(this.handle));
4748
+ return new L(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 I(y().extractArchiveAndGetURL(this.handle, e));
4760
+ return new L(v().extractArchiveAndGetURL(this.handle, e));
4761
4761
  }
4762
4762
  getImportProgress() {
4763
- return new I(y().getImportProgress(this.handle));
4763
+ return new L(v().getImportProgress(this.handle));
4764
4764
  }
4765
4765
  getLastLogs(e) {
4766
- return new I(y().getLastLogs(this.handle, e));
4766
+ return new L(v().getLastLogs(this.handle, e));
4767
4767
  }
4768
4768
  getProgressLog(e) {
4769
- return new I(y().getProgressLog(this.handle, e));
4769
+ return new L(v().getProgressLog(this.handle, e));
4770
4770
  }
4771
4771
  getProgressLogWithInfo(e) {
4772
- return new I(y().getProgressLogWithInfo(this.handle, e));
4772
+ return new L(v().getProgressLogWithInfo(this.handle, e));
4773
4773
  }
4774
4774
  getLogHandle() {
4775
- return new I(y().getLogHandle(this.handle));
4775
+ return new L(v().getLogHandle(this.handle));
4776
4776
  }
4777
4777
  allFieldsResolved(e = "Input") {
4778
4778
  switch (e) {
@@ -4798,98 +4798,98 @@
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, c2]) => o(u2, c2));
4801
+ return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, d]) => o(u2, d));
4802
4802
  }
4803
4803
  }
4804
- const Ve = "staging", je = "main";
4805
- const bt = "pl7.app/label", wt = "pl7.app/trace", At = z$1.object({
4804
+ const Ke = "staging", je = "main";
4805
+ const yt = "pl7.app/label", bt = "pl7.app/trace", vt = 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
- }), xt = z$1.array(At), Ct = 1e-3, Pt = "__LABEL__", Te = "__LABEL__@1";
4810
+ }), wt = z$1.array(vt), St = 1e-3, Ct = "__LABEL__", Ie = "__LABEL__@1";
4811
4811
  function $e(t, e, n2 = {}) {
4812
4812
  const r = /* @__PURE__ */ new Map(), i = n2.forceTraceElements !== void 0 && n2.forceTraceElements.length > 0 ? new Set(n2.forceTraceElements) : void 0, s2 = /* @__PURE__ */ new Map(), o = t.map((p2) => {
4813
- var S, F;
4814
- const m2 = e(p2);
4815
- let f2, v, b;
4816
- "spec" in m2 && typeof m2.spec == "object" ? (f2 = m2.spec, v = m2.prefixTrace, b = m2.suffixTrace) : f2 = m2;
4817
- const h2 = (S = f2.annotations) == null ? void 0 : S[bt], w2 = (F = f2.annotations) == null ? void 0 : F[wt], x = (w2 ? xt.safeParse(JSON.parse(w2)).data : void 0) ?? [], C = [
4818
- ...v ?? [],
4819
- ...x,
4820
- ...b ?? []
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 ?? []
4821
4821
  ];
4822
- if (h2 !== void 0) {
4823
- const k2 = { label: h2, type: Pt, importance: -2 };
4824
- n2.addLabelAsSuffix ? C.push(k2) : C.splice(0, 0, k2);
4825
- }
4826
- const A = [], T = /* @__PURE__ */ new Map();
4827
- for (let k2 = C.length - 1; k2 >= 0; --k2) {
4828
- const { type: W } = C[k2], j2 = C[k2].importance ?? 0, $ = (T.get(W) ?? 0) + 1;
4829
- T.set(W, $);
4830
- const K2 = `${W}@${$}`;
4831
- s2.set(K2, (s2.get(K2) ?? 0) + 1), r.set(
4832
- K2,
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,
4833
4833
  Math.max(
4834
- r.get(K2) ?? Number.NEGATIVE_INFINITY,
4835
- j2 - (C.length - k2) * Ct
4834
+ r.get(V) ?? Number.NEGATIVE_INFINITY,
4835
+ j2 - (A.length - _) * St
4836
4836
  )
4837
- ), A.push({ ...C[k2], fullType: K2, occurrenceIndex: $ });
4837
+ ), S.push({ ...A[_], fullType: V, occurrenceIndex: $ });
4838
4838
  }
4839
- return A.reverse(), {
4839
+ return S.reverse(), {
4840
4840
  value: p2,
4841
4841
  spec: f2,
4842
- label: h2,
4843
- fullTrace: A
4842
+ label: E2,
4843
+ fullTrace: S
4844
4844
  };
4845
4845
  }), a = [], l2 = [], u2 = [...r];
4846
- u2.sort(([, p2], [, m2]) => m2 - p2);
4846
+ u2.sort(([, p2], [, b]) => b - p2);
4847
4847
  for (const [p2] of u2)
4848
4848
  p2.endsWith("@1") || s2.get(p2) === t.length ? a.push(p2) : l2.push(p2);
4849
- const c2 = (p2, m2 = false) => {
4849
+ const d = (p2, b = false) => {
4850
4850
  const f2 = [];
4851
- for (let v = 0; v < o.length; v++) {
4852
- const b = o[v], h2 = b.fullTrace.filter((C) => p2.has(C.fullType) || i && i.has(C.type));
4853
- if (h2.length === 0)
4854
- if (m2)
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));
4853
+ if (E2.length === 0)
4854
+ if (b)
4855
4855
  f2.push({
4856
4856
  label: "Unlabeled",
4857
- value: b.value
4857
+ value: w2.value
4858
4858
  });
4859
4859
  else return;
4860
- const w2 = h2.map((C) => C.label), x = n2.separator ?? " / ";
4860
+ const x = E2.map((A) => A.label), C = n2.separator ?? " / ";
4861
4861
  f2.push({
4862
- label: w2.join(x),
4863
- value: b.value
4862
+ label: x.join(C),
4863
+ value: w2.value
4864
4864
  });
4865
4865
  }
4866
4866
  return f2;
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 c2(new Set(Te), true);
4870
+ return d(new Set(Ie), true);
4871
4871
  }
4872
- let d = 0, g = -1;
4873
- for (; d < a.length; ) {
4872
+ let h2 = 0, g = -1;
4873
+ for (; h2 < a.length; ) {
4874
4874
  const p2 = /* @__PURE__ */ new Set();
4875
- n2.includeNativeLabel && p2.add(Te);
4876
- for (let f2 = 0; f2 < d; ++f2) p2.add(a[f2]);
4875
+ n2.includeNativeLabel && p2.add(Ie);
4876
+ for (let f2 = 0; f2 < h2; ++f2) p2.add(a[f2]);
4877
4877
  g >= 0 && p2.add(a[g]);
4878
- const m2 = c2(p2);
4879
- if (m2 !== void 0 && new Set(m2.map((f2) => f2.label)).size === t.length) return m2;
4880
- g++, g >= a.length && (d++, g = d);
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
4881
  }
4882
- return c2(/* @__PURE__ */ new Set([...a, ...l2]), true);
4882
+ return d(/* @__PURE__ */ new Set([...a, ...l2]), true);
4883
4883
  }
4884
4884
  const Z = "PColumnData/", se = Z + "ResourceMap", oe = Z + "Partitioned/ResourceMap", q = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", Je = Z + "Partitioned/", ae = Je + "JsonPartitioned", z = Je + "BinaryPartitioned";
4885
- const ye = (t) => {
4885
+ const me = (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 St(t) {
4892
+ function At(t) {
4893
4893
  if (!t) return;
4894
4894
  const e = t.resourceType.name, n2 = t.getDataAsJson(), r = [];
4895
4895
  let i = 0;
@@ -4914,7 +4914,7 @@
4914
4914
  case q:
4915
4915
  case B:
4916
4916
  for (let s2 of t.listInputFields()) {
4917
- e === B && (s2 = ye(s2).baseKey);
4917
+ e === B && (s2 = me(s2).baseKey);
4918
4918
  const o = [...JSON.parse(s2)];
4919
4919
  r.push(o);
4920
4920
  }
@@ -4926,7 +4926,7 @@
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 = ye(l2).baseKey);
4929
+ e === z && (l2 = me(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 _t(t) {
4938
+ function Pt(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 It(t) {
4957
+ function xt(t) {
4958
4958
  if (t === void 0) return;
4959
4959
  if (K(t))
4960
- return _t(t);
4961
- const e = St(t);
4960
+ return Pt(t);
4961
+ const e = At(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,7 +4971,7 @@
4971
4971
  }
4972
4972
  return i.map((s2) => Array.from(s2.values()));
4973
4973
  }
4974
- function ve(t, e = []) {
4974
+ function ye(t, e = []) {
4975
4975
  if (t === void 0 || !t.getIsReadyOrError()) return;
4976
4976
  const n2 = t.resourceType.name, r = t.getDataAsJson();
4977
4977
  if (e.length > 0 && (n2 === ae || n2 === z))
@@ -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 = ye(o), l2 = t.resolve({ field: o, assertFieldType: "Input" });
5004
+ const a = me(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;
@@ -5032,7 +5032,7 @@
5032
5032
  if (a === void 0) return;
5033
5033
  if (a.resourceType.name !== q)
5034
5034
  throw new Error(`Expected ${q} inside ${n2}, but got ${a.resourceType.name}`);
5035
- const l2 = ve(a, JSON.parse(o));
5035
+ const l2 = ye(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}`);
@@ -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 = ve(a, JSON.parse(o));
5056
+ const l2 = ye(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}`);
@@ -5069,15 +5069,15 @@
5069
5069
  throw new Error(`Unknown resource type: ${n2}`);
5070
5070
  }
5071
5071
  }
5072
- function Tt(t) {
5072
+ function It(t) {
5073
5073
  if (t !== void 0) {
5074
5074
  if (K(t)) return t;
5075
5075
  if (En(t)) return Cn(t);
5076
- if (t instanceof E) return ve(t);
5076
+ if (t instanceof D) return ye(t);
5077
5077
  throw new Error(`Unexpected input type: ${typeof t}`);
5078
5078
  }
5079
5079
  }
5080
- function Lt(t, e) {
5080
+ function _t(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,22 +5137,22 @@
5137
5137
  }
5138
5138
  }
5139
5139
  }
5140
- function Et(t) {
5140
+ function Tt(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 kt {
5146
+ class Lt {
5147
5147
  constructor(e) {
5148
5148
  this.columns = e;
5149
5149
  }
5150
5150
  selectColumns(e) {
5151
- const n2 = typeof e == "function" ? e : Gn(e);
5151
+ const n2 = typeof e == "function" ? e : Qn(e);
5152
5152
  return this.columns.filter((r) => n2(r.spec));
5153
5153
  }
5154
5154
  }
5155
- function Dt(t) {
5155
+ function Et(t) {
5156
5156
  if (t)
5157
5157
  return t.map((e) => ({
5158
5158
  type: `split:${Rn(e.axisId)}`,
@@ -5161,16 +5161,16 @@
5161
5161
  // High importance for split filters in labels
5162
5162
  }));
5163
5163
  }
5164
- function Ot(t) {
5164
+ function kt(t) {
5165
5165
  if (t)
5166
5166
  return t.map((e) => [e.axisIdx, e.value]);
5167
5167
  }
5168
- function Rt(t, e) {
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 Re({ id: t, axisFilters: n2 });
5171
+ return Oe({ id: t, axisFilters: n2 });
5172
5172
  }
5173
- function Le(t) {
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;
@@ -5185,9 +5185,9 @@
5185
5185
  }
5186
5186
  class le {
5187
5187
  constructor() {
5188
- D(this, "defaultProviderStore", []);
5189
- D(this, "providers", [new kt(this.defaultProviderStore)]);
5190
- D(this, "axisLabelProviders", []);
5188
+ F(this, "defaultProviderStore", []);
5189
+ F(this, "providers", [new Lt(this.defaultProviderStore)]);
5190
+ F(this, "axisLabelProviders", []);
5191
5191
  }
5192
5192
  addColumnProvider(e) {
5193
5193
  return this.providers.push(e), this;
@@ -5215,129 +5215,129 @@
5215
5215
  };
5216
5216
  let u2 = () => false;
5217
5217
  if (a) {
5218
- const f2 = (Array.isArray(a) ? a : [a]).map((v) => {
5219
- if (Le(v)) {
5218
+ const f2 = (Array.isArray(a) ? a : [a]).map((y) => {
5219
+ if (_e(y)) {
5220
5220
  if (!r)
5221
5221
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
5222
- return Gn(Mn(r.anchors, v, n2));
5222
+ return Qn(Tn(r.anchors, y, n2));
5223
5223
  } else
5224
- return Gn(v);
5224
+ return Qn(y);
5225
5225
  });
5226
- u2 = (v) => f2.some((b) => b(v));
5226
+ u2 = (y) => f2.some((w2) => w2(y));
5227
5227
  }
5228
- const c2 = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], d = [], g = /* @__PURE__ */ new Set();
5229
- for (const f$1 of c2) {
5230
- const v = Le(f$1);
5231
- let b;
5232
- if (v) {
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) {
5233
5233
  if (!r)
5234
5234
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
5235
- b = Mn(r.anchors, f$1, n2);
5235
+ w2 = Tn(r.anchors, f$1, n2);
5236
5236
  } else
5237
- b = f$1;
5238
- const h2 = /* @__PURE__ */ new Set(), w2 = [];
5239
- for (const A of this.providers) {
5240
- const T = A.selectColumns(b);
5241
- for (const S of T) {
5242
- if (u2(S.spec)) continue;
5243
- if (h2.has(S.id))
5244
- throw new Error(`Duplicate column id ${S.id} in provider ${A.constructor.name}`);
5245
- const F = Qn(S.spec);
5246
- g.has(F) || (h2.add(S.id), g.add(F), w2.push(S));
5237
+ w2 = f$1;
5238
+ const E2 = /* @__PURE__ */ new Set(), x = [];
5239
+ for (const S of this.providers) {
5240
+ const I = S.selectColumns(w2);
5241
+ for (const c2 of I) {
5242
+ if (u2(c2.spec)) continue;
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));
5247
5247
  }
5248
5248
  }
5249
- if (w2.length === 0) continue;
5250
- const x = Ft(f$1), C = x.length > 0;
5251
- for (const A of w2) {
5252
- if (!f(A.spec)) continue;
5253
- const T = A.spec;
5254
- if (C) {
5255
- if (Et(A.data))
5256
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${A.id}`);
5257
- const S = Tt(A.data);
5258
- if (!S) {
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);
5258
+ if (!c2) {
5259
5259
  if (s2) continue;
5260
5260
  return;
5261
5261
  }
5262
- if (!Sn(S))
5263
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${S.type} for column ${A.id}`);
5264
- const F = It(S), k2 = x[x.length - 1];
5265
- if (k2 >= S.partitionKeyLength)
5266
- throw new Error(`Not enough partition keys (${S.partitionKeyLength}) for requested split axes (max index ${k2}) in column ${T.name}`);
5267
- const W = x.map((_) => this.findLabels(p$1(T.axesSpec[_]))), j2 = [], $ = (_, G) => {
5268
- if (G >= x.length) {
5269
- if (j2.push([..._]), j2.length > 1e4)
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)
5270
5270
  throw new Error("Too many key combinations, aborting.");
5271
5271
  return;
5272
5272
  }
5273
- const N2 = x[G];
5274
- if (N2 >= F.length)
5275
- throw new Error(`Axis index ${N2} out of bounds for unique keys array (length ${F.length}) during split key generation for column ${A.id}`);
5276
- const J2 = F[N2];
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
5277
  if (!J2 || J2.length === 0) {
5278
5278
  j2.length = 0;
5279
5279
  return;
5280
5280
  }
5281
- for (const ee of J2)
5282
- _.push(ee), $(_, G + 1), _.pop();
5281
+ for (const ee2 of J2)
5282
+ T.push(ee2), $(T, G + 1), T.pop();
5283
5283
  };
5284
5284
  if ($([], 0), j2.length === 0)
5285
5285
  continue;
5286
- const K2 = [...T.axesSpec], Ge = x.map((_) => _);
5287
- for (let _ = x.length - 1; _ >= 0; _--)
5288
- K2.splice(x[_], 1);
5289
- const He = { ...T, axesSpec: K2 };
5290
- for (const _ of j2) {
5291
- const G = _.map((N2, J2) => {
5292
- const ee = Ge[J2], qe = p$1(T.axesSpec[ee]), ce = W[J2], ze = (ce == null ? void 0 : ce[N2]) ?? String(N2);
5293
- return { axisIdx: ee, axisId: qe, value: N2, label: ze };
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 };
5294
5294
  });
5295
- d.push({
5295
+ h2.push({
5296
5296
  type: "split",
5297
- originalColumn: A,
5298
- spec: T,
5299
- adjustedSpec: He,
5300
- dataEntries: S,
5297
+ originalColumn: S,
5298
+ spec: I,
5299
+ adjustedSpec: We,
5300
+ dataEntries: c2,
5301
5301
  axisFilters: G
5302
5302
  });
5303
5303
  }
5304
5304
  } else
5305
- d.push({
5305
+ h2.push({
5306
5306
  type: "direct",
5307
- originalColumn: A,
5308
- spec: T,
5309
- adjustedSpec: T
5307
+ originalColumn: S,
5308
+ spec: I,
5309
+ adjustedSpec: I
5310
5310
  });
5311
5311
  }
5312
5312
  }
5313
- if (d.length === 0) return [];
5313
+ if (h2.length === 0) return [];
5314
5314
  const p2 = $e(
5315
- d,
5315
+ h2,
5316
5316
  (f2) => ({
5317
5317
  spec: f2.spec,
5318
- suffixTrace: f2.type === "split" ? Dt(f2.axisFilters) : void 0
5318
+ suffixTrace: f2.type === "split" ? Et(f2.axisFilters) : void 0
5319
5319
  }),
5320
5320
  l2
5321
- ), m2 = [];
5322
- for (const { value: f2, label: v } of p2) {
5323
- const { originalColumn: b, spec: h2 } = f2, w2 = f2.type === "split" ? f2.axisFilters : void 0, x = Ot(w2);
5324
- let C;
5325
- r ? C = r.deriveS(h2, x) : C = Rt(b.id, x);
5326
- let A = { ...f2.adjustedSpec };
5327
- o && (A = {
5328
- ...A,
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,
5329
5329
  annotations: {
5330
- ...A.annotations ?? {},
5331
- "pl7.app/label": v
5330
+ ...S.annotations ?? {},
5331
+ "pl7.app/label": y
5332
5332
  }
5333
- }), m2.push({
5334
- id: C,
5335
- spec: A,
5336
- data: () => f2.type === "split" ? Jn(Lt(f2.dataEntries, x)) : f2.originalColumn.data,
5337
- label: v
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
5338
5338
  });
5339
5339
  }
5340
- return m2;
5340
+ return b;
5341
5341
  }
5342
5342
  getColumns(e, n2) {
5343
5343
  const r = this.getUniversalEntries(e, {
@@ -5362,19 +5362,19 @@
5362
5362
  return i;
5363
5363
  }
5364
5364
  }
5365
- function pe(t, e) {
5365
+ function de(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 Ee(t) {
5373
- return Wn(t, (e) => e instanceof E ? e.handle : En(e) ? Nn(e, (n2) => n2.handle) : e);
5372
+ function Te(t) {
5373
+ return Xn(t, (e) => e instanceof D ? e.handle : En(e) ? Nn(e, (n2) => n2.handle) : e);
5374
5374
  }
5375
- class Kt {
5375
+ class Ot {
5376
5376
  constructor() {
5377
- D(this, "ctx", y());
5377
+ F(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 : Gn(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
5386
+ const r = typeof e == "function" ? e : Qn(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
5387
5387
  let s2 = {}, o = false;
5388
5388
  return typeof n2 < "u" && (typeof n2 == "function" ? s2 = n2 : typeof n2 == "object" && ("includeNativeLabel" in n2 || "separator" in n2 || "addLabelAsSuffix" in n2 ? s2 = n2 : (n2 = n2, s2 = n2.label ?? {}, o = n2.refsWithEnrichments ?? false))), typeof s2 == "object" ? $e(i, (a) => a.obj, s2 ?? {}).map(({ value: { ref: a }, label: l2 }) => ({
5389
- ref: te$1(a, o),
5389
+ ref: re$1(a, o),
5390
5390
  label: l2
5391
5391
  })) : i.map(({ ref: a, obj: l2 }) => ({
5392
- ref: te$1(a, o),
5392
+ ref: re$1(a, o),
5393
5393
  label: s2(l2, a)
5394
5394
  }));
5395
5395
  }
5396
5396
  resolveAnchorCtx(e) {
5397
- if (e instanceof _n) return e;
5397
+ if (e instanceof Mn) return e;
5398
5398
  const n2 = {};
5399
5399
  for (const [r, i] of Object.entries(e))
5400
- if (ne(i)) {
5400
+ if (ee(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 _n(n2);
5407
+ return new Mn(n2);
5408
5408
  }
5409
5409
  /**
5410
5410
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -5478,7 +5478,7 @@
5478
5478
  ref: n2.ref,
5479
5479
  obj: {
5480
5480
  ...n2.obj,
5481
- data: new E(n2.obj.data, [n2.ref.blockId, n2.ref.name])
5481
+ data: new D(n2.obj.data, [n2.ref.blockId, n2.ref.name])
5482
5482
  }
5483
5483
  }))
5484
5484
  };
@@ -5497,9 +5497,9 @@
5497
5497
  ref: n2.ref,
5498
5498
  obj: {
5499
5499
  ...n2.obj,
5500
- data: oe$1(
5500
+ data: ie(
5501
5501
  n2.obj.data,
5502
- (r) => new E(r, [n2.ref.blockId, n2.ref.name])
5502
+ (r) => new D(r, [n2.ref.blockId, n2.ref.name])
5503
5503
  )
5504
5504
  }
5505
5505
  }))
@@ -5526,9 +5526,9 @@
5526
5526
  )) == null ? void 0 : r.obj;
5527
5527
  const n2 = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
5528
5528
  if (n2)
5529
- return Wn(
5529
+ return Xn(
5530
5530
  n2,
5531
- (i) => new E(i, [e.blockId, e.name])
5531
+ (i) => new D(i, [e.blockId, e.name])
5532
5532
  );
5533
5533
  }
5534
5534
  /**
@@ -5539,7 +5539,7 @@
5539
5539
  getPColumnByRef(e) {
5540
5540
  const n2 = this.getDataByRef(e);
5541
5541
  if (n2)
5542
- return qn(n2);
5542
+ return Wn(n2);
5543
5543
  }
5544
5544
  /**
5545
5545
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -5571,10 +5571,10 @@
5571
5571
  if (!f(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 && pe(e.domain, i.domain)) {
5574
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && de(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 || !pe(o.domain, a.domain))
5577
+ if (o.name !== a.name || o.type !== a.type || !de(o.domain, a.domain))
5578
5578
  continue e;
5579
5579
  }
5580
5580
  n2.push(r.obj);
@@ -5591,7 +5591,7 @@
5591
5591
  for (const r of n2.entries) {
5592
5592
  if (!rn(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 && pe(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 && de(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 : Gn(e);
5613
+ const n2 = typeof e == "function" ? e : Qn(e);
5614
5614
  return this.getSpecs().entries.filter(({ obj: i }) => f(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: Re(i),
5619
+ id: Oe(i),
5620
5620
  spec: o,
5621
5621
  get data() {
5622
5622
  var u2;
@@ -5643,12 +5643,12 @@
5643
5643
  }
5644
5644
  class te {
5645
5645
  constructor() {
5646
- D(this, "ctx");
5647
- D(this, "args");
5648
- D(this, "uiState");
5649
- D(this, "_activeArgsCache");
5650
- D(this, "resultPool", new Kt());
5651
- this.ctx = y(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
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) : {};
5652
5652
  }
5653
5653
  /**
5654
5654
  * Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
@@ -5664,13 +5664,13 @@
5664
5664
  // return this.ctx.featureFlags;
5665
5665
  // }
5666
5666
  getNamedAccessor(e) {
5667
- return ge(
5667
+ return he(
5668
5668
  this.ctx.getAccessorHandleByName(e),
5669
- (n2) => new E(n2, [e])
5669
+ (n2) => new D(n2, [e])
5670
5670
  );
5671
5671
  }
5672
5672
  get prerun() {
5673
- return this.getNamedAccessor(Ve);
5673
+ return this.getNamedAccessor(Ke);
5674
5674
  }
5675
5675
  get outputs() {
5676
5676
  return this.getNamedAccessor(je);
@@ -5685,26 +5685,35 @@
5685
5685
  }
5686
5686
  verifyInlineAndExplicitColumnsSupport(e) {
5687
5687
  var i;
5688
- const n2 = e.some((s2) => !(s2.data instanceof E) || En(s2.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
5688
+ const n2 = e.some((s2) => !(s2.data instanceof D) || En(s2.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
5689
5689
  if (n2 && !r) throw Error("Inline or explicit columns not supported");
5690
5690
  }
5691
+ patchPTableDef(e) {
5692
+ var n2;
5693
+ return (n2 = this.ctx.featureFlags) != null && n2.pTablePartitionFiltersSupport ? e : {
5694
+ ...e,
5695
+ partitionFilters: [],
5696
+ filters: [...e.partitionFilters, ...e.filters]
5697
+ };
5698
+ }
5691
5699
  // TODO remove all non-PColumn fields
5692
5700
  createPFrame(e) {
5693
5701
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
5694
- e.map((n2) => Ee(n2))
5702
+ e.map((n2) => Te(n2))
5695
5703
  );
5696
5704
  }
5697
5705
  createPTable(e) {
5698
5706
  let n2;
5699
- return "columns" in e ? n2 = {
5707
+ return "columns" in e ? n2 = this.patchPTableDef({
5700
5708
  src: {
5701
5709
  type: "full",
5702
5710
  entries: e.columns.map((r) => ({ type: "column", column: r }))
5703
5711
  },
5704
- filters: e.filters ?? [],
5712
+ partitionFilters: e.filters ?? [],
5713
+ filters: [],
5705
5714
  sorting: e.sorting ?? []
5706
- } : n2 = e, this.verifyInlineAndExplicitColumnsSupport(Xn(n2.src)), this.ctx.createPTable(
5707
- Un(n2, (r) => Ee(r))
5715
+ }) : n2 = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(Gn(n2.src)), this.ctx.createPTable(
5716
+ Un(n2, (r) => Te(r))
5708
5717
  );
5709
5718
  }
5710
5719
  /** @deprecated scheduled for removal from SDK */
@@ -5724,20 +5733,20 @@
5724
5733
  this.ctx.logError(e);
5725
5734
  }
5726
5735
  }
5727
- const Y = "1.37.14";
5728
- function Vt(t) {
5736
+ const Y = "1.38.0";
5737
+ function Rt(t) {
5729
5738
  return t.__renderLambda === true;
5730
5739
  }
5731
- function fe(t) {
5740
+ function pe(t) {
5732
5741
  if (t !== void 0)
5733
- return Vt(t) ? t.handle : t;
5742
+ return Rt(t) ? t.handle : t;
5734
5743
  }
5735
- class L {
5744
+ class k {
5736
5745
  constructor(e, n2, r, i, s2, o, a, l2) {
5737
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;
5738
5747
  }
5739
5748
  static create(e = "Heavy") {
5740
- return new L(
5749
+ return new k(
5741
5750
  e,
5742
5751
  void 0,
5743
5752
  {},
@@ -5751,7 +5760,7 @@
5751
5760
  output(e, n2, r = {}) {
5752
5761
  if (typeof n2 == "function") {
5753
5762
  const i = `output#${e}`;
5754
- return H(i, () => n2(new te())), new L(
5763
+ return H(i, () => n2(new te())), new k(
5755
5764
  this._renderingMode,
5756
5765
  this._initialArgs,
5757
5766
  this._initialUiState,
@@ -5769,7 +5778,7 @@
5769
5778
  this._enrichmentTargets
5770
5779
  );
5771
5780
  } else
5772
- return new L(
5781
+ return new k(
5773
5782
  this._renderingMode,
5774
5783
  this._initialArgs,
5775
5784
  this._initialUiState,
@@ -5788,7 +5797,7 @@
5788
5797
  return this.output(e, n2, { retentive: true });
5789
5798
  }
5790
5799
  argsValid(e) {
5791
- return typeof e == "function" ? (H("inputsValid", () => e(new te())), new L(
5800
+ return typeof e == "function" ? (H("inputsValid", () => e(new te())), new k(
5792
5801
  this._renderingMode,
5793
5802
  this._initialArgs,
5794
5803
  this._initialUiState,
@@ -5800,7 +5809,7 @@
5800
5809
  this._sections,
5801
5810
  this._title,
5802
5811
  this._enrichmentTargets
5803
- )) : new L(
5812
+ )) : new k(
5804
5813
  this._renderingMode,
5805
5814
  this._initialArgs,
5806
5815
  this._initialUiState,
@@ -5812,7 +5821,7 @@
5812
5821
  );
5813
5822
  }
5814
5823
  sections(e) {
5815
- return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new L(
5824
+ return Array.isArray(e) ? this.sections(re(e)) : typeof e == "function" ? (H("sections", () => e(new te())), new k(
5816
5825
  this._renderingMode,
5817
5826
  this._initialArgs,
5818
5827
  this._initialUiState,
@@ -5821,7 +5830,7 @@
5821
5830
  { __renderLambda: true, handle: "sections" },
5822
5831
  this._title,
5823
5832
  this._enrichmentTargets
5824
- )) : new L(
5833
+ )) : new k(
5825
5834
  this._renderingMode,
5826
5835
  this._initialArgs,
5827
5836
  this._initialUiState,
@@ -5834,7 +5843,7 @@
5834
5843
  }
5835
5844
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
5836
5845
  title(e) {
5837
- return H("title", () => e(new te())), new L(
5846
+ return H("title", () => e(new te())), new k(
5838
5847
  this._renderingMode,
5839
5848
  this._initialArgs,
5840
5849
  this._initialUiState,
@@ -5850,7 +5859,7 @@
5850
5859
  * @deprecated use {@link withArgs}
5851
5860
  * */
5852
5861
  initialArgs(e) {
5853
- return new L(
5862
+ return new k(
5854
5863
  this._renderingMode,
5855
5864
  e,
5856
5865
  this._initialUiState,
@@ -5863,7 +5872,7 @@
5863
5872
  }
5864
5873
  /** Sets initial args for the block, this value must be specified. */
5865
5874
  withArgs(e) {
5866
- return new L(
5875
+ return new k(
5867
5876
  this._renderingMode,
5868
5877
  e,
5869
5878
  this._initialUiState,
@@ -5876,7 +5885,7 @@
5876
5885
  }
5877
5886
  /** Defines type and sets initial value for block UiState. */
5878
5887
  withUiState(e) {
5879
- return new L(
5888
+ return new k(
5880
5889
  this._renderingMode,
5881
5890
  this._initialArgs,
5882
5891
  e,
@@ -5892,7 +5901,7 @@
5892
5901
  * Influences dependency graph construction.
5893
5902
  */
5894
5903
  enriches(e) {
5895
- return H("enrichmentTargets", e), new L(
5904
+ return H("enrichmentTargets", e), new k(
5896
5905
  this._renderingMode,
5897
5906
  this._initialArgs,
5898
5907
  this._initialUiState,
@@ -5924,40 +5933,52 @@
5924
5933
  sdkVersion: Y,
5925
5934
  renderingMode: this._renderingMode,
5926
5935
  initialArgs: this._initialArgs,
5927
- inputsValid: fe(this._inputsValid),
5928
- sections: fe(this._sections),
5936
+ inputsValid: pe(this._inputsValid),
5937
+ sections: pe(this._sections),
5929
5938
  outputs: Object.fromEntries(
5930
- Object.entries(this._outputs).map(([n2, r]) => [n2, fe(r)])
5939
+ Object.entries(this._outputs).map(([n2, r]) => [n2, pe(r)])
5931
5940
  )
5932
5941
  };
5933
- return ht() ? Ke({ sdkVersion: Y }) : { config: e };
5942
+ return pt() ? Ve({ sdkVersion: Y }) : { config: e };
5934
5943
  }
5935
5944
  }
5936
5945
  function Ue() {
5937
5946
  return {
5938
- version: 2,
5947
+ sourceId: null,
5948
+ hiddenColIds: null,
5949
+ partitionFilters: [],
5950
+ filters: [],
5951
+ sorting: []
5952
+ };
5953
+ }
5954
+ function Vt() {
5955
+ return {
5956
+ version: 3,
5939
5957
  stateCache: [],
5940
- pTableParams: {
5941
- sorting: [],
5942
- filters: [],
5943
- hiddenColIds: null
5944
- }
5958
+ pTableParams: Ue()
5945
5959
  };
5946
5960
  }
5947
- function jt(t) {
5948
- return "version" in t ? t : Ue();
5961
+ function Kt(t) {
5962
+ return "version" in t ? (t.version === 2 && (t = {
5963
+ version: 3,
5964
+ stateCache: t.stateCache.map((e) => ({
5965
+ ...e,
5966
+ filtersState: []
5967
+ })),
5968
+ pTableParams: Ue()
5969
+ }), t) : Vt();
5949
5970
  }
5950
5971
  function be(t) {
5951
5972
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
5952
5973
  }
5953
- function Be(t) {
5974
+ function jt(t) {
5954
5975
  return new le().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
5955
5976
  name: "pl7.app/label",
5956
5977
  axes: [{}]
5957
5978
  // exactly one axis
5958
5979
  }, { dontWaitAllData: true });
5959
5980
  }
5960
- function we(t, e) {
5981
+ function Le(t, e) {
5961
5982
  const n2 = [], r = [];
5962
5983
  for (const a of t)
5963
5984
  be(a.spec) ? n2.push(a) : r.push(a);
@@ -5965,37 +5986,37 @@
5965
5986
  for (const a of r)
5966
5987
  for (const l2 of a.spec.axesSpec) {
5967
5988
  const u2 = p$1(l2);
5968
- i.some((c2) => Z$1(c2, u2)) || i.push(u2);
5989
+ i.some((d) => Z$1(d, u2)) || i.push(u2);
5969
5990
  }
5970
5991
  for (const a of n2) {
5971
- const l2 = p$1(a.spec.axesSpec[0]), u2 = i.findIndex((c2) => Z$1(c2, l2));
5992
+ const l2 = p$1(a.spec.axesSpec[0]), u2 = i.findIndex((d) => Z$1(d, l2));
5972
5993
  u2 !== -1 && i.splice(u2, 1);
5973
5994
  }
5974
5995
  const s2 = (a, l2) => {
5975
5996
  let u2 = a.toString();
5976
5997
  if (l2)
5977
- for (const c2 in l2)
5978
- u2 += c2, u2 += l2[c2];
5998
+ for (const d in l2)
5999
+ u2 += d, u2 += l2[d];
5979
6000
  return u2;
5980
6001
  }, o = [];
5981
6002
  for (const a of e) {
5982
- const l2 = a.spec.axesSpec[0], u2 = p$1(l2), c2 = i.findIndex((d) => Z$1(d, u2));
5983
- if (c2 !== -1) {
5984
- const d = i[c2], g = Object.keys(d.domain ?? {}).length, p2 = Object.keys(l2.domain ?? {}).length;
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;
5985
6006
  g > p2 ? o.push({
5986
- id: s2(a.id, d.domain),
6007
+ id: s2(a.id, h2.domain),
5987
6008
  spec: {
5988
6009
  ...a.spec,
5989
- axesSpec: [{ ...d, annotations: l2.annotations }]
6010
+ axesSpec: [{ ...h2, annotations: l2.annotations }]
5990
6011
  },
5991
6012
  data: a.data
5992
- }) : o.push(a), i.splice(c2, 1);
6013
+ }) : o.push(a), i.splice(d, 1);
5993
6014
  }
5994
6015
  }
5995
6016
  return o;
5996
6017
  }
5997
- function We(t) {
5998
- const e = (i) => Array.isArray(i), n2 = (i) => i instanceof E, r = (i) => typeof i == "object" && "type" in i;
6018
+ function Nt(t) {
6019
+ const e = (i) => Array.isArray(i), n2 = (i) => i instanceof D, r = (i) => typeof i == "object" && "type" in i;
5999
6020
  return t.map((i) => i.data).every((i) => {
6000
6021
  if (e(i))
6001
6022
  return true;
@@ -6014,83 +6035,95 @@
6014
6035
  throw Error(`unsupported column data type: ${i}`);
6015
6036
  });
6016
6037
  }
6017
- function Ae(t, e, n2, r, i, s2) {
6018
- let o = t;
6019
- const a = [];
6020
- if (s2) {
6021
- o = [];
6022
- for (const l2 of t)
6023
- s2(l2.spec) ? o.push(l2) : a.push(l2);
6024
- }
6025
- return a.push(...e), {
6038
+ function Ee(t) {
6039
+ let e = t.columns;
6040
+ const n2 = [];
6041
+ if (t.coreColumnPredicate) {
6042
+ e = [];
6043
+ for (const r of t.columns)
6044
+ t.coreColumnPredicate(r.spec) ? e.push(r) : n2.push(r);
6045
+ }
6046
+ return n2.push(...t.labelColumns), {
6026
6047
  src: {
6027
6048
  type: "outer",
6028
6049
  primary: {
6029
- type: n2,
6030
- entries: o.map((l2) => ({ type: "column", column: l2 }))
6050
+ type: t.coreJoinType,
6051
+ entries: e.map((r) => ({ type: "column", column: r }))
6031
6052
  },
6032
- secondary: a.map((l2) => ({ type: "column", column: l2 }))
6053
+ secondary: n2.map((r) => ({ type: "column", column: r }))
6033
6054
  },
6034
- filters: r,
6035
- sorting: i
6055
+ partitionFilters: t.partitionFilters,
6056
+ filters: t.filters,
6057
+ sorting: t.sorting
6036
6058
  };
6037
6059
  }
6038
- function Fn(t, e, n2, r) {
6039
- var u2, c2;
6040
- Array.isArray(r) && (r = { filters: r });
6041
- const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s2 = ue(
6042
- [...(r == null ? void 0 : r.filters) ?? [], ...((u2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : u2.filters) ?? []],
6043
- (d) => ue$1(d.column)
6044
- ), o = ue(
6045
- [...(r == null ? void 0 : r.sorting) ?? [], ...((c2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : c2.sorting) ?? []],
6046
- (d) => ue$1(d.column)
6047
- ), a = Be(t.resultPool);
6048
- if (!a) return;
6049
- const l2 = we(e.map(Fn$1), a);
6050
- if (We([...e, ...l2]))
6051
- return t.createPTable(
6052
- Ae(e, l2, i, s2, o, r == null ? void 0 : r.coreColumnPredicate)
6053
- );
6054
- }
6055
- function Nt(t) {
6060
+ function $t(t) {
6056
6061
  var e;
6057
6062
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
6058
6063
  }
6059
- function $t(t) {
6064
+ function Jt(t) {
6060
6065
  var e;
6061
6066
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
6062
6067
  }
6063
- function ue(t, e) {
6068
+ function fe(t, e) {
6064
6069
  return [...new Map(t.map((n2) => [e(n2), n2])).values()];
6065
6070
  }
6066
- function Kn(t, e, n2, r) {
6071
+ function Vn(t, e, n2, r) {
6067
6072
  if (e.length === 0) return;
6068
- const i = jt(n2 ?? Ue()), s2 = (r == null ? void 0 : r.coreJoinType) ?? "full", o = ue(
6069
- [...(r == null ? void 0 : r.filters) ?? [], ...i.pTableParams.filters],
6070
- (h2) => ue$1(h2.column)
6071
- ), a = ue(
6072
- [...(r == null ? void 0 : r.sorting) ?? [], ...i.pTableParams.sorting],
6073
- (h2) => ue$1(h2.column)
6074
- ), l2 = e.filter((h2) => !Nt(h2.spec)), u2 = Be(t.resultPool);
6075
- if (!u2) return;
6076
- const c2 = we(l2.map(Fn$1), u2), d = Ae(l2, c2, s2, o, a, r == null ? void 0 : r.coreColumnPredicate), g = t.createPTable(d), p2 = new Set((() => {
6077
- if (s2 === "inner") return [];
6078
- const h2 = i.pTableParams.hiddenColIds;
6079
- return h2 || l2.filter((w2) => $t(w2.spec)).map((w2) => w2.id);
6073
+ const i = e.filter((c2) => !$t(c2.spec)), s2 = Kt(n2), o = jt(t.resultPool);
6074
+ 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)
6079
+ ).map((c2) => ({ type: "axis", id: c2 })),
6080
+ ...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);
6083
+ return m2 || t.logWarn(`Partition filter ${JSON.stringify(c2)} does not match provided columns, skipping`), m2;
6084
+ }), f2 = fe(
6085
+ [...[], ...s2.pTableParams.filters],
6086
+ (c2) => ce$1(c2.column)
6087
+ ).filter((c2) => {
6088
+ const m2 = g(c2.column);
6089
+ return m2 || t.logWarn(`Filter ${JSON.stringify(c2)} does not match provided columns, skipping`), m2;
6090
+ }), y = fe(
6091
+ [...[], ...s2.pTableParams.sorting],
6092
+ (c2) => ce$1(c2.column)
6093
+ ).filter((c2) => {
6094
+ const m2 = g(c2.column);
6095
+ return m2 || t.logWarn(`Sorting ${JSON.stringify(c2)} does not match provided columns, skipping`), m2;
6096
+ }), w2 = Ee({
6097
+ columns: i,
6098
+ labelColumns: a,
6099
+ coreJoinType: p2,
6100
+ partitionFilters: b,
6101
+ filters: f2,
6102
+ sorting: y,
6103
+ coreColumnPredicate: void 0
6104
+ }), E2 = t.createPTable(w2), x = new Set((() => {
6105
+ const c2 = s2.pTableParams.hiddenColIds;
6106
+ return c2 || i.filter((m2) => Jt(m2.spec)).map((m2) => m2.id);
6080
6107
  })());
6081
- l2.filter((h2) => {
6082
- var w2;
6083
- return ((w2 = h2.spec.annotations) == null ? void 0 : w2["pl7.app/isLinkerColumn"]) === "true";
6084
- }).forEach((h2) => p2.delete(h2.id)), r != null && r.coreColumnPredicate && l2.flatMap((w2) => {
6085
- var x;
6086
- return (x = r == null ? void 0 : r.coreColumnPredicate) != null && x.call(r, w2.spec) ? [w2.id] : [];
6087
- }).forEach((w2) => p2.delete(w2)), [...o.map((h2) => h2.column), ...a.map((h2) => h2.column)].filter((h2) => h2.type === "column").forEach((h2) => p2.delete(h2.id));
6088
- const m2 = l2.filter((h2) => !p2.has(h2.id)), f2 = we(m2.map(Fn$1), u2);
6089
- if (!We([...m2, ...f2])) return;
6090
- const v = Ae(m2, f2, s2, o, a, r == null ? void 0 : r.coreColumnPredicate), b = t.createPTable(v);
6108
+ i.filter((c2) => {
6109
+ var m2;
6110
+ 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,
6118
+ partitionFilters: b,
6119
+ filters: f2,
6120
+ sorting: y,
6121
+ coreColumnPredicate: void 0
6122
+ }), I = t.createPTable(S);
6091
6123
  return {
6092
- fullTableHandle: g,
6093
- visibleTableHandle: b
6124
+ sourceId: s2.pTableParams.sourceId,
6125
+ fullTableHandle: E2,
6126
+ visibleTableHandle: I
6094
6127
  };
6095
6128
  }
6096
6129
  const ImportFileHandleSchema = z$1.string().optional().refine(
@@ -6116,12 +6149,8 @@
6116
6149
  numbers: z$1.array(z$1.coerce.number()),
6117
6150
  handles: z$1.array(ImportFileHandleSchema)
6118
6151
  });
6119
- const platforma = L.create("Heavy").withArgs({ numbers: [1, 2, 3, 4], tableNumRows: 100, handles: [] }).withUiState({
6120
- dataTableState: void 0,
6121
- dataTableStateV2: {
6122
- tableState: Ue(),
6123
- filterModel: {}
6124
- },
6152
+ const platforma = k.create("Heavy").withArgs({ numbers: [1, 2, 3, 4], tableNumRows: 100, handles: [] }).withUiState({
6153
+ dataTableStateV2: Vt(),
6125
6154
  dynamicSections: []
6126
6155
  }).argsValid((ctx) => {
6127
6156
  if (ctx.args.numbers.length === 5) {
@@ -6136,59 +6165,6 @@
6136
6165
  const m2 = (_a = ctx.outputs) == null ? void 0 : _a.resolve("progresses");
6137
6166
  const progresses = m2 == null ? void 0 : m2.mapFields((name, val) => [name, val == null ? void 0 : val.getImportProgress()]);
6138
6167
  return Object.fromEntries(progresses ?? []);
6139
- }).output("pt", (ctx) => {
6140
- var _a, _b, _c, _d, _e;
6141
- 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;
6142
- const data = times(ctx.args.tableNumRows ?? 0, (i) => {
6143
- const v = i + 1;
6144
- return {
6145
- key: [v, v + 0.1],
6146
- val: v.toString()
6147
- };
6148
- });
6149
- return Fn(
6150
- ctx,
6151
- [
6152
- {
6153
- id: "example",
6154
- spec: {
6155
- kind: "PColumn",
6156
- valueType: "String",
6157
- name: "example",
6158
- annotations: {
6159
- "pl7.app/label": "String column",
6160
- "pl7.app/discreteValues": '["up","down"]'
6161
- },
6162
- axesSpec: [
6163
- {
6164
- type: "Int",
6165
- name: "index",
6166
- annotations: {
6167
- "pl7.app/label": "Int axis",
6168
- "pl7.app/discreteValues": "[1,2]"
6169
- }
6170
- },
6171
- {
6172
- type: "Float",
6173
- name: "value",
6174
- annotations: {
6175
- "pl7.app/label": "Float axis",
6176
- "pl7.app/table/visibility": "optional"
6177
- }
6178
- }
6179
- ]
6180
- },
6181
- data
6182
- }
6183
- ],
6184
- ctx.uiState.dataTableState.tableState,
6185
- {
6186
- filters: [
6187
- ...((_d = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _d.filters) ?? [],
6188
- ...((_e = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e.filters) ?? []
6189
- ]
6190
- }
6191
- );
6192
6168
  }).output("ptV2Sheets", (ctx) => {
6193
6169
  const rowCount = ctx.args.tableNumRows ?? 0;
6194
6170
  const sheets = [
@@ -6209,7 +6185,6 @@
6209
6185
  ];
6210
6186
  return rowCount > 0 ? sheets : [];
6211
6187
  }).output("ptV2", (ctx) => {
6212
- var _a;
6213
6188
  const rowCount = ctx.args.tableNumRows ?? 0;
6214
6189
  const makePartitionId = (rowCount2, i) => Math.floor(2 * i / (rowCount2 + 1));
6215
6190
  const columns = [
@@ -6242,10 +6217,10 @@
6242
6217
  ]
6243
6218
  },
6244
6219
  data: times(rowCount, (i) => {
6245
- const v = i + 1;
6220
+ const v2 = i + 1;
6246
6221
  return {
6247
- key: [makePartitionId(rowCount, v), v],
6248
- val: v.toString()
6222
+ key: [makePartitionId(rowCount, v2), v2],
6223
+ val: v2.toString()
6249
6224
  };
6250
6225
  })
6251
6226
  },
@@ -6278,19 +6253,48 @@
6278
6253
  ]
6279
6254
  },
6280
6255
  data: times(rowCount, (i) => {
6281
- const v = i + 1;
6256
+ const v2 = i + 1;
6282
6257
  return {
6283
- key: [makePartitionId(rowCount, v), v],
6284
- val: v + 0.1
6258
+ key: [makePartitionId(rowCount, v2), v2],
6259
+ val: v2 + 0.1
6285
6260
  };
6286
6261
  })
6287
6262
  }
6288
6263
  ];
6289
- return Kn(
6264
+ for (let j2 = 3; j2 < 10; ++j2) {
6265
+ columns.push({
6266
+ id: `column${j2}`,
6267
+ spec: {
6268
+ kind: "PColumn",
6269
+ valueType: "String",
6270
+ name: "value",
6271
+ annotations: {
6272
+ "pl7.app/label": `Alphabetical column ${j2 - 2}`,
6273
+ "pl7.app/table/visibility": "optional"
6274
+ },
6275
+ axesSpec: [
6276
+ {
6277
+ type: "Int",
6278
+ name: "index",
6279
+ annotations: {
6280
+ "pl7.app/label": "Int axis"
6281
+ }
6282
+ }
6283
+ ]
6284
+ },
6285
+ data: times(rowCount, (i) => {
6286
+ const v2 = i + 1;
6287
+ return {
6288
+ key: [v2],
6289
+ val: v2.toString().repeat(j2)
6290
+ };
6291
+ })
6292
+ });
6293
+ }
6294
+ return Vn(
6290
6295
  ctx,
6291
6296
  columns,
6292
- ctx.uiState.dataTableStateV2.tableState,
6293
- { filters: ((_a = ctx.uiState.dataTableStateV2.filterModel) == null ? void 0 : _a.filters) ?? [] }
6297
+ ctx.uiState.dataTableStateV2
6294
6298
  );
6295
6299
  }).title((ctx) => {
6296
6300
  if (ctx.args.numbers.length === 5) {
@@ -6319,7 +6323,6 @@
6319
6323
  { type: "link", href: "/typography", label: "Typography" },
6320
6324
  { type: "link", href: "/ag-grid-vue", label: "AgGridVue" },
6321
6325
  { type: "link", href: "/ag-grid-vue-with-builder", label: "AgGridVue with builder" },
6322
- { type: "link", href: "/pl-ag-data-table", label: "PlAgDataTable" },
6323
6326
  { type: "link", href: "/pl-ag-data-table-v2", label: "PlAgDataTableV2" },
6324
6327
  { type: "link", href: "/pl-splash-page", label: "PlSplashPage" },
6325
6328
  { type: "link", href: "/pl-file-input-page", label: "PlFileInputPage" },