@spiffcommerce/core 31.2.3-beta.a0b3db5e-f507-543a-83fc-22e82e769276 → 31.2.4-beta.deb69c8f-1db2-5c9d-aec1-f3e61315a90a

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/index.mjs CHANGED
@@ -336,12 +336,12 @@ class jr {
336
336
  d = await this.spiffClient.loggedInBearerToken();
337
337
  } catch {
338
338
  }
339
- const A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId, m = s.customerToken ?? c.customerToken, p = s.applicationKey ?? c.applicationKey, g = s.bundleOwnerId;
339
+ const A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId, m = s.customerToken ?? c.customerToken, g = s.applicationKey ?? c.applicationKey, p = s.bundleOwnerId;
340
340
  try {
341
341
  if (window && window.__SENTRY__) {
342
- const C = window.__SENTRY__.hub;
343
- if (C) {
344
- const S = C.traceHeaders();
342
+ const f = window.__SENTRY__.hub;
343
+ if (f) {
344
+ const S = f.traceHeaders();
345
345
  Object.entries(S).forEach(([b, I]) => {
346
346
  l[b] = I;
347
347
  });
@@ -349,7 +349,7 @@ class jr {
349
349
  }
350
350
  } catch {
351
351
  }
352
- return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h), m && (l.customerToken = m), p && (l["X-Application-Key"] = p), g && (l.bundleOwnerId = g), l["Allow-Moonlight-Redirect"] = "true", {
352
+ return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h), m && (l.customerToken = m), g && (l["X-Application-Key"] = g), p && (l.bundleOwnerId = p), l["Allow-Moonlight-Redirect"] = "true", {
353
353
  headers: l
354
354
  };
355
355
  }), a = ur(({ operation: i, graphQLErrors: s, networkError: o }) => {
@@ -5339,14 +5339,14 @@ const M = () => {
5339
5339
  viewBox: A,
5340
5340
  width: u
5341
5341
  }) => {
5342
- const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: i }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, C = M(), S = a.purpose === Ht.FreeDesign && /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ D("rect", { width: p.width, height: p.height, rx: h }) }) }), b = a.colorProfiles?.map((E, P) => (
5342
+ const h = e || 0, m = 2 * (l?.scale || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = M(), S = a.purpose === Ht.FreeDesign && /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ D("rect", { width: g.width, height: g.height, rx: h }) }) }), b = a.colorProfiles?.map((E, P) => (
5343
5343
  /* @ts-ignore */
5344
5344
  /* @__PURE__ */ D("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, P)
5345
5345
  )), I = n.map((E) => ({
5346
5346
  ...E,
5347
5347
  _renderingConfiguration: a,
5348
- mask: l ? `url(#viewmask-${C})` : void 0
5349
- })), f = Sa(I);
5348
+ mask: l ? `url(#viewmask-${f})` : void 0
5349
+ })), C = Sa(I);
5350
5350
  return /* @__PURE__ */ ct(
5351
5351
  "svg",
5352
5352
  {
@@ -5364,7 +5364,7 @@ const M = () => {
5364
5364
  maxHeight: s,
5365
5365
  position: c
5366
5366
  },
5367
- viewBox: g,
5367
+ viewBox: p,
5368
5368
  children: [
5369
5369
  b,
5370
5370
  S,
@@ -5372,8 +5372,8 @@ const M = () => {
5372
5372
  "rect",
5373
5373
  {
5374
5374
  id: "layout-background",
5375
- width: p.width,
5376
- height: p.height,
5375
+ width: g.width,
5376
+ height: g.height,
5377
5377
  fill: r,
5378
5378
  rx: h
5379
5379
  }
@@ -5383,7 +5383,7 @@ const M = () => {
5383
5383
  {
5384
5384
  id: "element-group",
5385
5385
  clipPath: a.purpose === Ht.FreeDesign ? "url(#viewboxClip)" : void 0,
5386
- children: f.map((E) => $n(E)).filter((E) => !!E)
5386
+ children: C.map((E) => $n(E)).filter((E) => !!E)
5387
5387
  }
5388
5388
  ),
5389
5389
  l && /* @__PURE__ */ D(
@@ -5399,14 +5399,14 @@ const M = () => {
5399
5399
  strokeDasharray: `${m * 2} ${m}`
5400
5400
  }
5401
5401
  ),
5402
- l && /* @__PURE__ */ ct("mask", { id: `viewmask-${C}`, children: [
5402
+ l && /* @__PURE__ */ ct("mask", { id: `viewmask-${f}`, children: [
5403
5403
  /* @__PURE__ */ D(
5404
5404
  "rect",
5405
5405
  {
5406
- x: p.x,
5407
- y: p.y,
5408
- width: p.width,
5409
- height: p.height,
5406
+ x: g.x,
5407
+ y: g.y,
5408
+ width: g.width,
5409
+ height: g.height,
5410
5410
  fill: "black"
5411
5411
  }
5412
5412
  ),
@@ -5425,12 +5425,12 @@ const M = () => {
5425
5425
  }
5426
5426
  );
5427
5427
  }, Uc = (r, t, e, a, n) => {
5428
- const i = ft(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, m = -o, p = o, g = u * A - m * d, C = h * A - p * d, S = u * d + m * A, b = h * d + p * A, I = Math.max(Math.abs(g), Math.abs(C)), f = Math.max(Math.abs(S), Math.abs(b));
5428
+ const i = ft(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, m = -o, g = o, p = u * A - m * d, f = h * A - g * d, S = u * d + m * A, b = h * d + g * A, I = Math.max(Math.abs(p), Math.abs(f)), C = Math.max(Math.abs(S), Math.abs(b));
5429
5429
  return {
5430
5430
  minX: l - I,
5431
5431
  maxX: l + I,
5432
- minY: c - f,
5433
- maxY: c + f
5432
+ minY: c - C,
5433
+ maxY: c + C
5434
5434
  };
5435
5435
  }, Lc = (r, t, e) => {
5436
5436
  const a = Math.sqrt(Math.pow(t.x - r.x, 2) + Math.pow(t.y - r.y, 2)), n = Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2)), i = Math.sqrt(Math.pow(e.x - r.x, 2) + Math.pow(e.y - r.y, 2));
@@ -5587,15 +5587,15 @@ const M = () => {
5587
5587
  /* @__PURE__ */ D("feFuncB", { type: "discrete", tableValues: n() })
5588
5588
  ] })
5589
5589
  ] }) }) }), s = r.rotation || 0, o = ft(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
5590
- const A = r.pattern?.x || 0, u = r.pattern?.y || 0, h = r.pattern?.width || 0, m = r.pattern?.height || 0, p = r.pattern?.scaleX || 1, g = r.pattern?.scaleY || 1, C = r.pattern?.rotation || 0;
5590
+ const A = r.pattern?.x || 0, u = r.pattern?.y || 0, h = r.pattern?.width || 0, m = r.pattern?.height || 0, g = r.pattern?.scaleX || 1, p = r.pattern?.scaleY || 1, f = r.pattern?.rotation || 0;
5591
5591
  return [r.pattern?.svg ? {
5592
5592
  id: `${t}-contents`,
5593
5593
  type: x.Illustration,
5594
5594
  x: A,
5595
5595
  y: u,
5596
- rotation: C,
5597
- width: h * p,
5598
- height: m * g,
5596
+ rotation: f,
5597
+ width: h * g,
5598
+ height: m * p,
5599
5599
  src: a(),
5600
5600
  svg: r.pattern?.svg,
5601
5601
  colors: r.pattern?.colors
@@ -5604,9 +5604,9 @@ const M = () => {
5604
5604
  type: x.Image,
5605
5605
  x: A,
5606
5606
  y: u,
5607
- rotation: C,
5608
- width: h * p,
5609
- height: m * g,
5607
+ rotation: f,
5608
+ width: h * g,
5609
+ height: m * p,
5610
5610
  src: a()
5611
5611
  }];
5612
5612
  };
@@ -5730,37 +5730,36 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5730
5730
  on(d.innerHTML).stylesheet?.rules.forEach((u) => {
5731
5731
  if (u.type === "font-face" && u.declarations) {
5732
5732
  const h = u.declarations.find(
5733
- (g) => g.property === "font-family"
5734
- )?.value, p = u.declarations.find((g) => g.property === "src")?.value?.match(/'(https.*?)'/)?.[1];
5735
- h && p && n.set(h, p);
5733
+ (p) => p.property === "font-family"
5734
+ )?.value, g = u.declarations.find((p) => p.property === "src")?.value?.match(/'(https.*?)'/)?.[1];
5735
+ h && g && n.set(h, g);
5736
5736
  }
5737
5737
  });
5738
5738
  });
5739
5739
  const s = e.querySelectorAll("tspan");
5740
5740
  for (let d = 0; d < s.length; d++) {
5741
- const A = s.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), p = await Nt(n.get(m)), g = u.getAttribute("fill"), C = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"), b = p.getPath(
5741
+ const A = s.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), g = await Nt(n.get(m)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"), b = g.getPath(
5742
5742
  A.innerHTML,
5743
5743
  0,
5744
5744
  0,
5745
5745
  parseInt(u.getAttribute("font-size") ?? "72")
5746
5746
  ), I = b.getBoundingBox().x2 - b.getBoundingBox().x1;
5747
- let f = 0;
5747
+ let C = 0;
5748
5748
  const E = A.getAttribute("text-anchor");
5749
- E === "middle" ? f = I / 2 : E === "end" && (f = I);
5750
- const P = p.getPath(
5749
+ E === "middle" ? C = I / 2 : E === "end" && (C = I);
5750
+ const P = g.getPath(
5751
5751
  A.innerHTML,
5752
- parseFloat(A.getAttribute("x") ?? "0") - f,
5752
+ parseFloat(A.getAttribute("x") ?? "0") - C,
5753
5753
  parseFloat(A.getAttribute("y") ?? "0"),
5754
5754
  parseInt(u.getAttribute("font-size") ?? "72")
5755
5755
  );
5756
- P.fill = g, P.stroke = C, P.strokeWidth = parseFloat(S ?? "0");
5756
+ P.fill = p, P.stroke = f, P.strokeWidth = parseFloat(S ?? "0");
5757
5757
  const B = P.toSVG(2), Q = t.parseFromString(B, "image/svg+xml").firstElementChild;
5758
5758
  h.appendChild(Q);
5759
5759
  }
5760
5760
  return e.querySelectorAll("text").forEach((d) => d.remove()), Bt().serializeToString(a);
5761
5761
  }, Be = (r, t, e, a) => Math.max(ns(r.join(`
5762
5762
  `), e, a), t), Ua = (r, t, e, a, n, i) => {
5763
- console.log("LOG: getLines");
5764
5763
  const s = (i || Rn) * n.getApproximateHeight(), o = t.split(`
5765
5764
  `);
5766
5765
  try {
@@ -5781,7 +5780,6 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5781
5780
  };
5782
5781
  }
5783
5782
  }, ge = (r, t, e, a) => {
5784
- console.log("LOG: splitLineUntilFit");
5785
5783
  const n = mt(r, e, a);
5786
5784
  if (n <= t)
5787
5785
  return { lines: [r], width: n };
@@ -5803,8 +5801,8 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5803
5801
  l = Math.max(l, mt(d, e, a));
5804
5802
  let u = c + 1, h = !0;
5805
5803
  for (; u < s.length && h; ) {
5806
- const m = s[u], p = mt(`${A.join(" ")} ${m}`, e, a);
5807
- p <= t ? (A.push(m), l = Math.max(l, p), u++) : h = !1;
5804
+ const m = s[u], g = mt(`${A.join(" ")} ${m}`, e, a);
5805
+ g <= t ? (A.push(m), l = Math.max(l, g), u++) : h = !1;
5808
5806
  }
5809
5807
  o.push(A.join(" ")), c = u;
5810
5808
  }
@@ -5813,11 +5811,9 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5813
5811
  throw new Error(`No max width calculated for text: ${o}.`);
5814
5812
  return { lines: o, width: l };
5815
5813
  }, ts = (r, t, e, a, n, i) => {
5816
- console.log("LOG: calcFontSize");
5817
5814
  const s = (i ?? Rn) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Nn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
5818
5815
  return Math.min(A, d);
5819
5816
  }, es = (r, t, e, a) => {
5820
- console.log("LOG: refit");
5821
5817
  const n = Ct(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5822
5818
  if (!e)
5823
5819
  return Ua(t, r, t.fontSize, s, n, a);
@@ -5839,7 +5835,6 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5839
5835
  fontSize: ts(o, n, i, t.width, t.height, a)
5840
5836
  } : Ua(t, r, t.fontSize, s, n, a);
5841
5837
  }, as = (r, t, e, a, n) => {
5842
- console.log("LOG: recalc");
5843
5838
  const s = Ct(t.assetUrl).getFont();
5844
5839
  let o = { ...r };
5845
5840
  const l = { ...r }, c = Nn(a, e / s.unitsPerEm, Ct(t.assetUrl));
@@ -5966,12 +5961,12 @@ const ss = (r) => {
5966
5961
  },
5967
5962
  stroke: A,
5968
5963
  strokeWidth: u,
5969
- children: r.curved ? /* @__PURE__ */ D(ls, { text: c, curvedPathId: i, align: r.align }) : d.map((m, p) => /* @__PURE__ */ D(
5964
+ children: r.curved ? /* @__PURE__ */ D(ls, { text: c, curvedPathId: i, align: r.align }) : d.map((m, g) => /* @__PURE__ */ D(
5970
5965
  os,
5971
5966
  {
5972
5967
  align: r.vertical ? "center" : r.align,
5973
5968
  fontSize: r.fontSize,
5974
- thisLineIdx: p,
5969
+ thisLineIdx: g,
5975
5970
  amountLines: d.length,
5976
5971
  text: m,
5977
5972
  textboxHeight: r.height,
@@ -5981,7 +5976,7 @@ const ss = (r) => {
5981
5976
  verticalAlign: r.verticalAlign,
5982
5977
  fontData: r.fontData
5983
5978
  },
5984
- p
5979
+ g
5985
5980
  ))
5986
5981
  }
5987
5982
  ) }) })
@@ -5993,9 +5988,7 @@ const ss = (r) => {
5993
5988
  const n = Ct(r.fontData.assetUrl), i = n.getFont(), s = r.fontSize / i.unitsPerEm;
5994
5989
  return n.getApproximateHeight() * s;
5995
5990
  }, e = () => r.align === "left" ? -r.textboxWidth / 2 : r.align === "right" ? r.textboxWidth / 2 : 0, a = () => {
5996
- const n = t();
5997
- console.log(`LOG: text span. line height: ${n}`);
5998
- const i = r.textboxHeight / 2;
5991
+ const n = t(), i = r.textboxHeight / 2;
5999
5992
  if (r.verticalAlign === "top")
6000
5993
  return -i + r.fontSize * 3 / 4 + r.thisLineIdx * n;
6001
5994
  if (r.verticalAlign === "bottom") {
@@ -6346,8 +6339,8 @@ const ne = (r) => {
6346
6339
  fetch: rt
6347
6340
  }), u = s.getAttribute("width"), h = s.getAttribute("height"), m = 2048;
6348
6341
  if (h && u) {
6349
- const p = parseFloat(h), C = parseFloat(u) / p;
6350
- C > 1 ? A.resize(m, m / C) : A.resize(m * C, m);
6342
+ const g = parseFloat(h), f = parseFloat(u) / g;
6343
+ f > 1 ? A.resize(m, m / f) : A.resize(m * f, m);
6351
6344
  } else
6352
6345
  A.resize(m, m);
6353
6346
  return await A.render(), await t(c);
@@ -6370,8 +6363,8 @@ const ne = (r) => {
6370
6363
  if (e && t === x.Illustration) {
6371
6364
  const l = await ot(await Vn(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
6372
6365
  if (!u) throw new Error("SVG missing viewBox.");
6373
- const h = o.height, m = u.split(" "), p = parseFloat(m[2]) || 1, g = parseFloat(m[3]) || 1, C = p / g;
6374
- o.height = o.width / C, o.top += (h - o.height) / 2;
6366
+ const h = o.height, m = u.split(" "), g = parseFloat(m[2]) || 1, p = parseFloat(m[3]) || 1, f = g / p;
6367
+ o.height = o.width / f, o.top += (h - o.height) / 2;
6375
6368
  }
6376
6369
  if (e && t === x.Image) {
6377
6370
  const l = o.height, c = await Me(e), d = await Ne(c), A = d.width / d.height;
@@ -7370,18 +7363,18 @@ class ys {
7370
7363
  }
7371
7364
  async regenerateQRCode(t, e, a, n) {
7372
7365
  const i = async () => {
7373
- const h = (await be([e]))[0], m = h?.versions?.find((p) => p.name === "mpeg4")?.link;
7366
+ const h = (await be([e]))[0], m = h?.versions?.find((g) => g.name === "mpeg4")?.link;
7374
7367
  return { asset: h, link: m };
7375
7368
  }, s = await new Promise((h, m) => {
7376
7369
  new Gn(
7377
7370
  async () => !!(await i()).link,
7378
7371
  async () => {
7379
- const p = await i();
7380
- if (!p.link || !p.link)
7381
- throw new Yt(p.asset);
7372
+ const g = await i();
7373
+ if (!g.link || !g.link)
7374
+ throw new Yt(g.asset);
7382
7375
  h({
7383
7376
  rel: "mpeg4",
7384
- href: p.link
7377
+ href: g.link
7385
7378
  });
7386
7379
  },
7387
7380
  () => {
@@ -7716,18 +7709,18 @@ class Pe {
7716
7709
  i && i(!0);
7717
7710
  const c = t.data.initialZoomLevel, d = await Promise.all(
7718
7711
  t.data.regions.map(async (h, m) => {
7719
- const p = await Oe(l[m]), g = o.getImageData(), C = a.map((P) => new bt(P.id)), S = g ? va(
7720
- g,
7712
+ const g = await Oe(l[m]), p = o.getImageData(), f = a.map((P) => new bt(P.id)), S = p ? va(
7721
7713
  p,
7714
+ g,
7722
7715
  c && !t.data.forceImageCover ? { scale: c } : void 0,
7723
7716
  t.data.forceImageCover
7724
- ) : void 0, b = g ? {
7717
+ ) : void 0, b = p ? {
7725
7718
  id: M(),
7726
- src: g.src,
7719
+ src: p.src,
7727
7720
  x: S?.x || 0,
7728
7721
  y: S?.y || 0,
7729
- width: g.width,
7730
- height: g.height,
7722
+ width: p.width,
7723
+ height: p.height,
7731
7724
  scaleX: S?.zoom || 1,
7732
7725
  scaleY: S?.zoom || 1,
7733
7726
  rotation: 0
@@ -7736,7 +7729,7 @@ class Pe {
7736
7729
  throw new Y(h);
7737
7730
  return {
7738
7731
  command: this.getCreateElementCommand(I, h, E, {
7739
- frameData: p,
7732
+ frameData: g,
7740
7733
  pattern: b,
7741
7734
  disablePlaceholder: t.data.disablePlaceholder,
7742
7735
  stepName: t.stepName
@@ -7745,7 +7738,7 @@ class Pe {
7745
7738
  id: I,
7746
7739
  region: h
7747
7740
  },
7748
- removeExistingCommands: C
7741
+ removeExistingCommands: f
7749
7742
  };
7750
7743
  })
7751
7744
  ), A = d.map((h) => h.command), u = d.map((h) => h.removeExistingCommands).flat();
@@ -7928,12 +7921,12 @@ class Ss {
7928
7921
  n().map((h) => h.layoutState)
7929
7922
  ), o = { ...s.colors }, l = {};
7930
7923
  Object.entries(o).forEach(([h, m]) => {
7931
- const p = { browserValue: m.browserValue, pmsValue: m.pmsValue }, g = m.spotColor;
7932
- g && (p.spotColor = { profileName: g.profileName, namedColor: g.namedColor }), l[h] = p;
7924
+ const g = { browserValue: m.browserValue, pmsValue: m.pmsValue }, p = m.spotColor;
7925
+ p && (g.spotColor = { profileName: p.profileName, namedColor: p.namedColor }), l[h] = g;
7933
7926
  });
7934
7927
  for (const [h, m] of i.entries()) {
7935
- const p = typeof m == "string" ? m : m.browserValue, g = typeof m == "string" ? void 0 : m.pmsValue;
7936
- o[h] = { browserValue: p, spotColor: o[h]?.spotColor, pmsValue: g }, l[h] = { browserValue: p };
7928
+ const g = typeof m == "string" ? m : m.browserValue, p = typeof m == "string" ? void 0 : m.pmsValue;
7929
+ o[h] = { browserValue: g, spotColor: o[h]?.spotColor, pmsValue: p }, l[h] = { browserValue: g };
7937
7930
  }
7938
7931
  let c = Array.from(Object.values(o)).map((h) => h.browserValue);
7939
7932
  const d = t.data.colorOption;
@@ -7964,7 +7957,7 @@ class Ss {
7964
7957
  if (!t.data || !t.data.regions)
7965
7958
  throw new Ee(t, "Missing regions.");
7966
7959
  n(!0);
7967
- const s = a.map((C) => new bt(C.id));
7960
+ const s = a.map((f) => new bt(f.id));
7968
7961
  t.mandatory && i.setMandatoryFulfilled(t.stepName, !1);
7969
7962
  const o = e.asset;
7970
7963
  if (!o)
@@ -7972,26 +7965,26 @@ class Ss {
7972
7965
  const l = o.fileLink;
7973
7966
  if (!l)
7974
7967
  throw new Yt(o);
7975
- const c = await ot(await this.getIllustrationBody(l)), d = await _t(c.svg), A = (C) => {
7976
- const S = i.getLayouts().find((I) => I.panelId === C.panelId);
7968
+ const c = await ot(await this.getIllustrationBody(l)), d = await _t(c.svg), A = (f) => {
7969
+ const S = i.getLayouts().find((I) => I.panelId === f.panelId);
7977
7970
  if (!S)
7978
- throw new Y(C);
7971
+ throw new Y(f);
7979
7972
  const b = M();
7980
7973
  return {
7981
- regionElement: { id: b, region: C },
7982
- command: this.getCreateElementCommand(b, C, S, {
7974
+ regionElement: { id: b, region: f },
7975
+ command: this.getCreateElementCommand(b, f, S, {
7983
7976
  stepName: t.stepName,
7984
7977
  src: l,
7985
7978
  objectURL: d,
7986
7979
  svg: c
7987
7980
  })
7988
7981
  };
7989
- }, u = t.data.regions.map(A), m = [...u.map((C) => C.command), ...s];
7990
- let p = Array.from(Object.values(c.colors)).map((C) => C.browserValue);
7991
- const g = t.data.colorOption;
7992
- return g && g.variants?.forEach((C) => {
7993
- p = p.map((S) => S.toLowerCase() === C.color?.toLowerCase() ? C.name : S);
7994
- }), i.updateMetadata(t.stepName, { colors: p }), {
7982
+ }, u = t.data.regions.map(A), m = [...u.map((f) => f.command), ...s];
7983
+ let g = Array.from(Object.values(c.colors)).map((f) => f.browserValue);
7984
+ const p = t.data.colorOption;
7985
+ return p && p.variants?.forEach((f) => {
7986
+ g = g.map((S) => S.toLowerCase() === f.color?.toLowerCase() ? f.name : S);
7987
+ }), i.updateMetadata(t.stepName, { colors: g }), {
7995
7988
  command: new R(m),
7996
7989
  followup: async () => {
7997
7990
  await i.setSelectionsAndElements(
@@ -8002,12 +7995,12 @@ class Ss {
8002
7995
  i.setMandatoryFulfilled(t.stepName, !0), n(!1);
8003
7996
  }
8004
7997
  );
8005
- const C = o.assetConfiguration?.defaultColorVariants || [];
8006
- if (C.length !== 0) {
7998
+ const f = o.assetConfiguration?.defaultColorVariants || [];
7999
+ if (f.length !== 0) {
8007
8000
  const S = {};
8008
8001
  (o.assetConfiguration?.channelNumbers || []).forEach((I) => {
8009
- const f = C.find((E) => E.channelNumber === I.number);
8010
- f && (S[`${I.id.replace(/\W/g, "")}`] = { browserValue: f?.variant?.color || "" });
8002
+ const C = f.find((E) => E.channelNumber === I.number);
8003
+ C && (S[`${I.id.replace(/\W/g, "")}`] = { browserValue: C?.variant?.color || "" });
8011
8004
  }), await this.changeColors(
8012
8005
  t,
8013
8006
  u.map((I) => I.regionElement),
@@ -8019,18 +8012,18 @@ class Ss {
8019
8012
  if (t.data.colorPickerEnabled) {
8020
8013
  const S = await this.availableColors(t, i) || [], b = Object.keys(c.colors), I = S.length === 1 && b.length === 1;
8021
8014
  if (I) {
8022
- const f = S[0], E = b[0];
8015
+ const C = S[0], E = b[0];
8023
8016
  await this.changeColors(
8024
8017
  t,
8025
8018
  u.map((P) => P.regionElement),
8026
8019
  i,
8027
8020
  () => i.getCommandContext().getAllLayouts(),
8028
- /* @__PURE__ */ new Map([[E, f.variant.color]])
8021
+ /* @__PURE__ */ new Map([[E, C.variant.color]])
8029
8022
  );
8030
8023
  }
8031
- !I && C.length === 0 && await this.changeColors(
8024
+ !I && f.length === 0 && await this.changeColors(
8032
8025
  t,
8033
- u.map((f) => f.regionElement),
8026
+ u.map((C) => C.regionElement),
8034
8027
  i,
8035
8028
  () => i.getCommandContext().getAllLayouts(),
8036
8029
  /* @__PURE__ */ new Map()
@@ -8075,8 +8068,8 @@ class vs {
8075
8068
  async () => {
8076
8069
  const h = e.getModelContainer();
8077
8070
  if (h) {
8078
- const m = t.data.targetMaterials.map((p) => h.applyMaterialVariant(
8079
- p,
8071
+ const m = t.data.targetMaterials.map((g) => h.applyMaterialVariant(
8072
+ g,
8080
8073
  l.id || "",
8081
8074
  A || {}
8082
8075
  ));
@@ -8231,11 +8224,11 @@ class bs {
8231
8224
  return console.error("Missing configuration."), null;
8232
8225
  a.updateStorage(t.stepName, { text: e }), a.updateMetadata(t.stepName, { text: e });
8233
8226
  const c = (d, A, u) => {
8234
- const h = u || M(), p = a.getLayouts().find((C) => C.panelId === A.panelId);
8235
- if (!p)
8227
+ const h = u || M(), g = a.getLayouts().find((f) => f.panelId === A.panelId);
8228
+ if (!g)
8236
8229
  return console.error(`Can not find layout for region: ${A.panelId}`), null;
8237
- const g = [];
8238
- return u && g.push(new bt(h)), g.push(
8230
+ const p = [];
8231
+ return u && p.push(new bt(h)), p.push(
8239
8232
  new z(
8240
8233
  {
8241
8234
  stepRegion: A,
@@ -8253,12 +8246,12 @@ class bs {
8253
8246
  layerIndex: A.layerIndex,
8254
8247
  immutable: A.immutable
8255
8248
  },
8256
- p
8249
+ g
8257
8250
  )
8258
8251
  ), {
8259
8252
  id: h,
8260
8253
  region: A,
8261
- command: new R(g)
8254
+ command: new R(p)
8262
8255
  };
8263
8256
  };
8264
8257
  if (i.length > 0) {
@@ -8357,7 +8350,7 @@ class Bs {
8357
8350
  return console.error("No URL for picture!"), null;
8358
8351
  n(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
8359
8352
  const l = a.getRegionElements(t.stepName).map((A) => new bt(A.id)), c = (A) => {
8360
- const h = a.getLayouts().find((p) => p.panelId === A.panelId);
8353
+ const h = a.getLayouts().find((g) => g.panelId === A.panelId);
8361
8354
  if (!h)
8362
8355
  throw new Y(A);
8363
8356
  const m = M();
@@ -8555,7 +8548,7 @@ class Ps {
8555
8548
  const h = i.find((S) => S.panelId === u.panelId);
8556
8549
  if (!h)
8557
8550
  throw new Y(u);
8558
- const m = o(), p = `
8551
+ const m = o(), g = `
8559
8552
  <svg
8560
8553
  xmlns="http://www.w3.org/2000/svg"
8561
8554
  xmlnsXlink="http://www.w3.org/1999/xlink"
@@ -8575,19 +8568,19 @@ class Ps {
8575
8568
  fill="${m}"
8576
8569
  />
8577
8570
  </svg>
8578
- `, g = {};
8579
- g[this.shapeFillId] = { browserValue: m };
8580
- const C = M();
8571
+ `, p = {};
8572
+ p[this.shapeFillId] = { browserValue: m };
8573
+ const f = M();
8581
8574
  return {
8582
- id: C,
8575
+ id: f,
8583
8576
  region: u,
8584
8577
  command: new z(
8585
8578
  {
8586
8579
  stepRegion: u,
8587
8580
  stepName: t.stepName,
8588
- colors: g,
8589
- id: C,
8590
- svg: p,
8581
+ colors: p,
8582
+ id: f,
8583
+ svg: g,
8591
8584
  type: x.Illustration,
8592
8585
  y: u.top,
8593
8586
  x: u.left,
@@ -8651,23 +8644,21 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
8651
8644
  let i = t.map((d) => d.split(`
8652
8645
  `)).flat(), s = i.length, o = i.map((d) => mt(d, a, n));
8653
8646
  const l = n.getApproximateHeight() * a;
8654
- console.log(`LOG: lines that fit. calced line height: ${l}`);
8655
8647
  let c = !0;
8656
8648
  for (; c; ) {
8657
- const d = l + (s - 1) * e;
8658
- if (console.log(`LOG: textbox height for size ${e}: ${d}`), d > r.height)
8649
+ if (l + (s - 1) * e > r.height)
8659
8650
  return [null, null];
8660
8651
  const A = Math.max(...o);
8661
8652
  if (A <= r.width)
8662
8653
  return [i, A];
8663
- const u = o.reduce((g, C, S, b) => C > b[g] ? S : g, 0), h = i[u];
8664
- let m = !1, p = h.length;
8665
- for (; !m && p > -1; ) {
8666
- p = h.lastIndexOf(" ", p - 1);
8667
- const g = [h.slice(0, p), h.slice(p + 1)], C = g.map((b) => mt(b, a, n));
8668
- C[0] <= r.width && (i = [...i.slice(0, u), ...g, ...i.slice(u + 1)], o = [
8654
+ const u = o.reduce((p, f, S, b) => f > b[p] ? S : p, 0), h = i[u];
8655
+ let m = !1, g = h.length;
8656
+ for (; !m && g > -1; ) {
8657
+ g = h.lastIndexOf(" ", g - 1);
8658
+ const p = [h.slice(0, g), h.slice(g + 1)], f = p.map((b) => mt(b, a, n));
8659
+ f[0] <= r.width && (i = [...i.slice(0, u), ...p, ...i.slice(u + 1)], o = [
8669
8660
  ...o.slice(0, u),
8670
- ...C,
8661
+ ...f,
8671
8662
  ...o.slice(u + 1)
8672
8663
  ], s += 1, m = !0);
8673
8664
  }
@@ -8675,23 +8666,22 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
8675
8666
  }
8676
8667
  return [null, null];
8677
8668
  }, fe = (r, t, e, a, n) => {
8678
- console.log(`LOG: determineCorrectFontSize, region height ${e.height}`);
8679
8669
  let i, s;
8680
8670
  const o = Ct(t.assetUrl), l = o.getFont();
8681
8671
  if (n.size) {
8682
8672
  const u = r / l.unitsPerEm;
8683
- return [i, s] = Ye(e, a, r, u, o), console.log(`LOG: fixed mode returning ${n.size, s}`), [n.size, i, s];
8673
+ return [i, s] = Ye(e, a, r, u, o), [n.size, i, s];
8684
8674
  }
8685
8675
  const c = 6;
8686
8676
  let d = c - Ge;
8687
8677
  if (a.length > 0) {
8688
8678
  let u = a, h = 0;
8689
8679
  for (; (!n.maxSize || d <= n.maxSize) && u; )
8690
- d += Ge, h = d / l.unitsPerEm, [u, s] = Ye(e, a, d, h, o), console.log(`LOG: intermediate result ${[u, s]}`);
8680
+ d += Ge, h = d / l.unitsPerEm, [u, s] = Ye(e, a, d, h, o);
8691
8681
  }
8692
8682
  d > c && (d -= Ge), n.minSize && d < n.minSize && (d = n.minSize);
8693
8683
  const A = d / l.unitsPerEm;
8694
- return [i, s] = Ye(e, a, d, A, o), console.log(`LOG: var mode returning ${[d, i, s]}`), [d, i, s];
8684
+ return [i, s] = Ye(e, a, d, A, o), [d, i, s];
8695
8685
  }, Je = 30;
8696
8686
  class De extends Error {
8697
8687
  constructor(t) {
@@ -8756,12 +8746,12 @@ class ks {
8756
8746
  let A = t.data.defaultText || "";
8757
8747
  const u = e.getWorkflowExperience().getBundle();
8758
8748
  if (u && t.globalPropertyAspectConfigurations) {
8759
- const p = u.getGlobalPropertyConfiguration()?.aspects?.find(
8760
- (g) => g.type === L.Text && t.globalPropertyAspectConfigurations?.map((C) => C.aspectName).includes(g.name)
8749
+ const g = u.getGlobalPropertyConfiguration()?.aspects?.find(
8750
+ (p) => p.type === L.Text && t.globalPropertyAspectConfigurations?.map((f) => f.aspectName).includes(p.name)
8761
8751
  );
8762
- if (p) {
8763
- const C = u.getGlobalPropertyStateManager().getAspect(p.name);
8764
- C && (A = C);
8752
+ if (g) {
8753
+ const f = u.getGlobalPropertyStateManager().getAspect(g.name);
8754
+ f && (A = f);
8765
8755
  }
8766
8756
  }
8767
8757
  e.updateStorage(t.stepName, {
@@ -8939,9 +8929,9 @@ class ks {
8939
8929
  { size: a.data.size, minSize: a.data.minSize, maxSize: a.data.maxSize }
8940
8930
  );
8941
8931
  d.set(u.id, h), A.set(u.id, m);
8942
- const p = a.data.curved ? s : (m || []).join(`
8932
+ const g = a.data.curved ? s : (m || []).join(`
8943
8933
  `);
8944
- c.push(this.generateTextChangeCommandsForRegion(h, a.data, u.id, p));
8934
+ c.push(this.generateTextChangeCommandsForRegion(h, a.data, u.id, g));
8945
8935
  }
8946
8936
  return !a.data.curved && e.length > 0 && !Array.from(A.values()).every((h) => h) ? (l.errorData || (l.errorData = {}), l.errorData.doesNotFit = !0, l) : (n.updateStorage(a.stepName, { text: t }), n.updateMetadata(a.stepName, {
8947
8937
  text: s
@@ -8980,15 +8970,15 @@ class ks {
8980
8970
  if (l && c) {
8981
8971
  const d = l.variants?.find((A) => A.id === c);
8982
8972
  if (d) {
8983
- const A = await this.fontDataFromVariant(d), u = o.map((g) => ({ id: g.id, region: g.stepRegion })), h = n.storage?.color;
8973
+ const A = await this.fontDataFromVariant(d), u = o.map((p) => ({ id: p.id, region: p.stepRegion })), h = n.storage?.color;
8984
8974
  let m = n.storage?.text;
8985
- const p = e.getWorkflowExperience().getBundle();
8986
- if (p && t.globalPropertyAspectConfigurations) {
8987
- const C = p.getGlobalPropertyConfiguration()?.aspects?.find(
8975
+ const g = e.getWorkflowExperience().getBundle();
8976
+ if (g && t.globalPropertyAspectConfigurations) {
8977
+ const f = g.getGlobalPropertyConfiguration()?.aspects?.find(
8988
8978
  (S) => S.type === L.Text && t.globalPropertyAspectConfigurations?.map((b) => b.aspectName).includes(S.name)
8989
8979
  );
8990
- if (C) {
8991
- const b = p.getGlobalPropertyStateManager().getAspect(C.name);
8980
+ if (f) {
8981
+ const b = g.getGlobalPropertyStateManager().getAspect(f.name);
8992
8982
  b && (m = b);
8993
8983
  }
8994
8984
  }
@@ -8998,15 +8988,15 @@ class ks {
8998
8988
  u,
8999
8989
  async () => {
9000
8990
  e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
9001
- const g = o.map((S) => new Wa(S.id, A)), C = new R(g);
9002
- e.getCommandDispatcher()(C);
8991
+ const p = o.map((S) => new Wa(S.id, A)), f = new R(p);
8992
+ e.getCommandDispatcher()(f);
9003
8993
  }
9004
8994
  ), o.length === 0 && l) {
9005
- const g = H.getDefaultVariant(l);
9006
- if (g) {
9007
- const C = await this.selectVariantCommand(
8995
+ const p = H.getDefaultVariant(l);
8996
+ if (p) {
8997
+ const f = await this.selectVariantCommand(
9008
8998
  t,
9009
- g,
8999
+ p,
9010
9000
  { text: m },
9011
9001
  [],
9012
9002
  e,
@@ -9015,16 +9005,16 @@ class ks {
9015
9005
  () => {
9016
9006
  }
9017
9007
  );
9018
- e.getCommandDispatcher()(C.command);
9008
+ e.getCommandDispatcher()(f.command);
9019
9009
  }
9020
9010
  } else {
9021
- const { command: g } = G.updateInputText(
9011
+ const { command: p } = G.updateInputText(
9022
9012
  m || "",
9023
9013
  o,
9024
9014
  t,
9025
9015
  e
9026
9016
  );
9027
- g && e.getCommandDispatcher()(g);
9017
+ p && e.getCommandDispatcher()(p);
9028
9018
  }
9029
9019
  }
9030
9020
  }
@@ -9040,7 +9030,7 @@ class ks {
9040
9030
  if (o.length === 0 && l) {
9041
9031
  const m = H.getDefaultVariant(l);
9042
9032
  if (m) {
9043
- const p = await this.selectVariantCommand(
9033
+ const g = await this.selectVariantCommand(
9044
9034
  t,
9045
9035
  m,
9046
9036
  { text: h },
@@ -9051,7 +9041,7 @@ class ks {
9051
9041
  () => {
9052
9042
  }
9053
9043
  );
9054
- e.getCommandDispatcher()(p.command);
9044
+ e.getCommandDispatcher()(g.command);
9055
9045
  }
9056
9046
  } else {
9057
9047
  const { command: m } = G.updateInputText(
@@ -9101,16 +9091,16 @@ class ks {
9101
9091
  async selectVariantCommand(t, e, a, n, i, s, o, l, c) {
9102
9092
  const d = i.markUpdatePending(), A = await this.fontDataFromVariant(e);
9103
9093
  if (n.length > 0) {
9104
- const u = n.map((p) => new Wa(p.id, A));
9094
+ const u = n.map((g) => new Wa(g.id, A));
9105
9095
  if (l) {
9106
- const p = n.map((g) => new je(g.id, l));
9107
- u.push(...p);
9096
+ const g = n.map((p) => new je(p.id, l));
9097
+ u.push(...g);
9108
9098
  }
9109
9099
  if (c) {
9110
- const p = n.map(
9111
- (g) => new He(g.id, c, t.data.strokeThickness)
9100
+ const g = n.map(
9101
+ (p) => new He(p.id, c, t.data.strokeThickness)
9112
9102
  );
9113
- u.push(...p);
9103
+ u.push(...g);
9114
9104
  }
9115
9105
  const h = await this.changeInputTextWithRegion(
9116
9106
  t,
@@ -9147,18 +9137,18 @@ class ks {
9147
9137
  a?.customiseAllText ?? !1,
9148
9138
  s,
9149
9139
  o
9150
- ), m = u.flatMap((g) => g.commands);
9140
+ ), m = u.flatMap((p) => p.commands);
9151
9141
  if (l) {
9152
- const g = u.map(
9153
- (C) => new je(C.regionElement.id, l)
9142
+ const p = u.map(
9143
+ (f) => new je(f.regionElement.id, l)
9154
9144
  );
9155
- m.push(...g);
9145
+ m.push(...p);
9156
9146
  }
9157
9147
  if (c) {
9158
- const g = n.map(
9159
- (C) => new He(C.id, c, t.data.strokeThickness)
9148
+ const p = n.map(
9149
+ (f) => new He(f.id, c, t.data.strokeThickness)
9160
9150
  );
9161
- m.push(...g);
9151
+ m.push(...p);
9162
9152
  }
9163
9153
  return h && m.push(h), {
9164
9154
  command: new R(m),
@@ -9180,16 +9170,16 @@ class ks {
9180
9170
  if (!a || !a.regions)
9181
9171
  throw new Error("Step data not supplied");
9182
9172
  const o = i.text || a.defaultText || "", l = this.getProcessedInput(o, a, !1), c = Ft(l, s), d = async (u) => {
9183
- const m = s.getLayouts().find((g) => g.panelId === u.panelId), p = M();
9173
+ const m = s.getLayouts().find((p) => p.panelId === u.panelId), g = M();
9184
9174
  try {
9185
9175
  if (!m)
9186
9176
  throw new Fe("Failed to find layout for region: " + u.panelId);
9187
- const g = a.colorOption;
9188
- let C;
9189
- if (g && g.variants) {
9190
- const tt = g.variants.find((et) => et.id === g.defaultVariant?.id) || g.variants[0];
9191
- C = this.createTextFillSpotColor(g, tt), s.updateStorage(t, {
9192
- colorProfileAssetKey: g.colorProfile?.key
9177
+ const p = a.colorOption;
9178
+ let f;
9179
+ if (p && p.variants) {
9180
+ const tt = p.variants.find((et) => et.id === p.defaultVariant?.id) || p.variants[0];
9181
+ f = this.createTextFillSpotColor(p, tt), s.updateStorage(t, {
9182
+ colorProfileAssetKey: p.colorProfile?.key
9193
9183
  });
9194
9184
  }
9195
9185
  const S = await this.getDefaultColor(a), b = S || "#000000", I = {
@@ -9199,7 +9189,7 @@ class ks {
9199
9189
  fill: i.color ? i.color : b,
9200
9190
  fontSize: a.size || Je,
9201
9191
  fontData: n,
9202
- id: p,
9192
+ id: g,
9203
9193
  layer: u.layer,
9204
9194
  layerIndex: u.layerIndex,
9205
9195
  rotation: u.rotation,
@@ -9215,8 +9205,8 @@ class ks {
9215
9205
  verticalAlign: a.verticalAlign || "middle",
9216
9206
  curved: a.curved,
9217
9207
  paths: a.paths,
9218
- fillSpotColorDefinition: C
9219
- }, f = [], E = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
9208
+ fillSpotColorDefinition: f
9209
+ }, C = [], E = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
9220
9210
  if (!I.fontData) throw new V("Failed to resolve font data for text.");
9221
9211
  const [B, F] = fe(
9222
9212
  I.fontSize,
@@ -9235,18 +9225,18 @@ class ks {
9235
9225
  E.set(I.id, B), P.set(I.id, F);
9236
9226
  const Q = a.curved || a.vertical ? l : (F || []).join(`
9237
9227
  `);
9238
- f.push(
9228
+ C.push(
9239
9229
  this.generateTextChangeCommandsForRegion(B, a, I.id, Q)
9240
9230
  );
9241
9231
  const T = new z(I, m);
9242
9232
  return {
9243
- regionElement: { id: p, region: u },
9244
- commands: [T, ...f],
9233
+ regionElement: { id: g, region: u },
9234
+ commands: [T, ...C],
9245
9235
  newElement: I,
9246
9236
  fontData: n
9247
9237
  };
9248
- } catch (g) {
9249
- throw console.log(g), new De("Error adding font to region");
9238
+ } catch (p) {
9239
+ throw console.log(p), new De("Error adding font to region");
9250
9240
  }
9251
9241
  }, A = await Promise.all(a.regions.map(d)).catch((u) => {
9252
9242
  throw u instanceof De ? (Fs.setLatestToast("Failed to load font.", $e.Error), u) : u instanceof Fe ? u : new Error(u);
@@ -9276,30 +9266,30 @@ class ks {
9276
9266
  * @deprecated
9277
9267
  */
9278
9268
  async changeInputTextWithRegion(t, e, a, n, i, s, o, l, c, d) {
9279
- const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = Ft(u, s), m = s.getRegionElements(t.stepName), p = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
9280
- for (const f of m)
9281
- if (f.region) {
9269
+ const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = Ft(u, s), m = s.getRegionElements(t.stepName), g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
9270
+ for (const C of m)
9271
+ if (C.region) {
9282
9272
  const [E, P] = fe(
9283
9273
  e,
9284
9274
  a,
9285
- f.region,
9275
+ C.region,
9286
9276
  [h],
9287
9277
  { size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
9288
9278
  );
9289
- p.set(f.id, E), g.set(f.id, P);
9279
+ g.set(C.id, E), p.set(C.id, P);
9290
9280
  }
9291
9281
  const S = (() => {
9292
9282
  if (t.data && t.data.maxLength && h.length > t.data.maxLength)
9293
9283
  return d && d(!0), { info: "0" };
9294
- const f = s.getProfanities(), E = ea(u.toLowerCase());
9284
+ const C = s.getProfanities(), E = ea(u.toLowerCase());
9295
9285
  for (const P of E)
9296
- for (const B in f) {
9297
- const F = f[B].toLowerCase().replace(/\s/g, "");
9286
+ for (const B in C) {
9287
+ const F = C[B].toLowerCase().replace(/\s/g, "");
9298
9288
  if (P === F)
9299
9289
  return l(!0), { error: "Blocked profanity." };
9300
9290
  }
9301
9291
  return !t.data.vertical && !t.data.allowNewlines && (u.includes(`
9302
- `) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(g.values()).every((B) => B) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - h.length).toString() });
9292
+ `) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(p.values()).every((B) => B) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - h.length).toString() });
9303
9293
  })();
9304
9294
  if (S.error) {
9305
9295
  c(S.error);
@@ -9311,14 +9301,14 @@ class ks {
9311
9301
  text: this.injectReplaceableText(A, t.data)
9312
9302
  }), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && s.setMandatoryFulfilled(t.stepName, !0);
9313
9303
  const b = [];
9314
- for (const f of m) {
9315
- const E = t.data.curved ? u : (g.get(f.id) || []).join(`
9304
+ for (const C of m) {
9305
+ const E = t.data.curved ? u : (p.get(C.id) || []).join(`
9316
9306
  `);
9317
9307
  b.push(
9318
9308
  this.generateTextChangeCommandsForRegion(
9319
- p.get(f.id) || 1,
9309
+ g.get(C.id) || 1,
9320
9310
  t.data,
9321
- f.id,
9311
+ C.id,
9322
9312
  E
9323
9313
  )
9324
9314
  );
@@ -9487,10 +9477,10 @@ class Ls extends Ms {
9487
9477
  b.classList.add("module-text-group");
9488
9478
  const I = at("defs");
9489
9479
  b.appendChild(I), I.appendChild(Qs(0, 2, 2, "shadow"));
9490
- const f = at("path");
9491
- f.setAttribute("d", d), f.setAttribute("stroke", "black"), f.setAttribute("stroke-width", "3"), I.appendChild(f);
9480
+ const C = at("path");
9481
+ C.setAttribute("d", d), C.setAttribute("stroke", "black"), C.setAttribute("stroke-width", "3"), I.appendChild(C);
9492
9482
  const E = at("g");
9493
- E.classList.add("module-layer0"), b.appendChild(E), E.setAttribute("filter", "url(#shadow)"), E.innerHTML = f.outerHTML;
9483
+ E.classList.add("module-layer0"), b.appendChild(E), E.setAttribute("filter", "url(#shadow)"), E.innerHTML = C.outerHTML;
9494
9484
  const P = at("g");
9495
9485
  P.classList.add("module-layer1"), b.appendChild(P), P.setAttribute("stroke-width", "3"), P.setAttribute("stroke", "rgb(45,41,38)"), P.setAttribute("fill", "rgb(45,41,38)"), P.setAttribute("transform", "translate(0.5,0)"), P.innerHTML = o;
9496
9486
  const B = at("g");
@@ -9503,14 +9493,14 @@ class Ls extends Ms {
9503
9493
  u.appendChild(h);
9504
9494
  const m = at("g");
9505
9495
  m.classList.add("module-bounds"), u.appendChild(m);
9506
- const p = Ns(e.height, e.width);
9507
- p.setAttribute("opacity", "0"), m.appendChild(p);
9508
- const g = at("g");
9509
- g.classList.add("module-text-enclosure"), u.appendChild(g);
9510
- const C = A();
9511
- g.appendChild(C);
9496
+ const g = Ns(e.height, e.width);
9497
+ g.setAttribute("opacity", "0"), m.appendChild(g);
9498
+ const p = at("g");
9499
+ p.classList.add("module-text-enclosure"), u.appendChild(p);
9500
+ const f = A();
9501
+ p.appendChild(f);
9512
9502
  const S = fr(d);
9513
- return Os(g, S, e.height, e.width, 0.35, 0.65), Rs(u.outerHTML);
9503
+ return Os(p, S, e.height, e.width, 0.35, 0.65), Rs(u.outerHTML);
9514
9504
  }
9515
9505
  }
9516
9506
  async function Kn(r) {
@@ -9577,7 +9567,7 @@ const re = w`
9577
9567
  variables: {
9578
9568
  bundleId: r
9579
9569
  }
9580
- })).data.globalPropertyState, Ws = w`
9570
+ })).data.globalPropertyState, Ws = (r) => w`
9581
9571
  ${Qe}
9582
9572
  fragment ProductFields on Product {
9583
9573
  id
@@ -9609,7 +9599,7 @@ const re = w`
9609
9599
  preloadImageUrl
9610
9600
  sku
9611
9601
  skuCode
9612
- workflows {
9602
+ workflows${r ? "(filters: $productWorkflowFilters)" : ""} {
9613
9603
  id
9614
9604
  index
9615
9605
  friendlyName
@@ -9622,8 +9612,8 @@ const re = w`
9622
9612
  name
9623
9613
  }
9624
9614
  }
9625
- `, ba = w`
9626
- ${Ws}
9615
+ `, ba = (r) => w`
9616
+ ${Ws(r)}
9627
9617
  fragment ProductCollectionProductFields on ProductCollectionProduct {
9628
9618
  id
9629
9619
  productId
@@ -9632,8 +9622,8 @@ const re = w`
9632
9622
  ...ProductFields
9633
9623
  }
9634
9624
  }
9635
- `, ie = (r) => w`
9636
- ${r ? ba : ""}
9625
+ `, ie = (r, t = !1) => w`
9626
+ ${r ? ba(t) : ""}
9637
9627
  fragment ProductCollectionFields on ProductCollection {
9638
9628
  id
9639
9629
  name
@@ -9821,7 +9811,7 @@ const re = w`
9821
9811
  }
9822
9812
  }
9823
9813
  `, Hs = w`
9824
- ${ba}
9814
+ ${ba(!1)}
9825
9815
  query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
9826
9816
  productCollections(ids: [$id], productIds: $productIds) {
9827
9817
  id
@@ -9854,12 +9844,13 @@ const re = w`
9854
9844
  }
9855
9845
  }
9856
9846
  `, Js = w`
9857
- ${ba}
9847
+ ${ba(!0)}
9858
9848
  query GetProductCollectionForProductsFeed(
9859
9849
  $id: String!
9860
9850
  $limit: Int
9861
9851
  $offset: Int
9862
- $filters: ProductCollectionProductFilterInput
9852
+ $productFilters: ProductCollectionProductFilterInput
9853
+ $productWorkflowFilters: MetafieldFilterListInput
9863
9854
  $tags: ProductCollectionProductTagFilterInput
9864
9855
  $sortKey: ProductCollectionProductSortKey
9865
9856
  $sortDescending: Boolean
@@ -9868,7 +9859,8 @@ const re = w`
9868
9859
  productCollections(ids: [$id]) {
9869
9860
  id
9870
9861
  productCollectionProductsFeed(
9871
- filters: $filters
9862
+ filters: $productFilters
9863
+ workflowFilters: $productWorkflowFilters
9872
9864
  tags: $tags
9873
9865
  limit: $limit
9874
9866
  offset: $offset
@@ -10248,14 +10240,14 @@ class Ya extends Fn {
10248
10240
  }
10249
10241
  }
10250
10242
  class yo {
10251
- constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, p, g = !1, C = !1, S = !1) {
10243
+ constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, g, p = !1, f = !1, S = !1) {
10252
10244
  this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10253
10245
  if (!this.previewService) return;
10254
10246
  const b = this.getCommandContext().getAllLayouts(), I = this.getLayoutPreviewService()?.getAll();
10255
10247
  if (I)
10256
- for (const [, f] of I)
10257
- f.render(b);
10258
- }, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = m, this.singleVariantsRenderable = C, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = a, this.stepSpecificServices = {}, this.profanityFilter = n, this.pollers = [], this.allScenes = [], this.layouts = i, this.product = d, this.previewService = A, this.modelContainer = p, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = u, this.renderableContextService?.setWorkflowManager(this), this.isReloadedTransaction = g, this.workflow.steps.forEach((b) => {
10248
+ for (const [, C] of I)
10249
+ C.render(b);
10250
+ }, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = m, this.singleVariantsRenderable = f, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = a, this.stepSpecificServices = {}, this.profanityFilter = n, this.pollers = [], this.allScenes = [], this.layouts = i, this.product = d, this.previewService = A, this.modelContainer = g, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = u, this.renderableContextService?.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((b) => {
10259
10251
  this.stepTags[b.stepName] = b.tags ?? [];
10260
10252
  }), S && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
10261
10253
  this.initialized = !0;
@@ -10274,7 +10266,7 @@ class yo {
10274
10266
  a.type === Ce.FirstName ? e[n] = t?.firstName : a.type === Ce.LastName ? e[n] = t?.lastName : a.type === Ce.Custom && (a.customFieldIndex === 1 ? e[n] = t?.customField1 : a.customFieldIndex === 2 ? e[n] = t?.customField2 : a.customFieldIndex === 3 ? e[n] = t?.customField3 : a.customFieldIndex === 4 ? e[n] = t?.customField4 : a.customFieldIndex === 5 && (e[n] = t?.customField5));
10275
10267
  }), e;
10276
10268
  }
10277
- async updateRecipient(t, e, a, n, i, s, o, l, c, d, A, u, h, m, p, g, C) {
10269
+ async updateRecipient(t, e, a, n, i, s, o, l, c, d, A, u, h, m, g, p, f) {
10278
10270
  if (this.transaction.recipient?.id)
10279
10271
  this.transaction.recipient = {
10280
10272
  id: this.transaction.recipient.id,
@@ -10292,9 +10284,9 @@ class yo {
10292
10284
  customField1: u || this.transaction.recipient.customField1,
10293
10285
  customField2: h || this.transaction.recipient.customField2,
10294
10286
  customField3: m || this.transaction.recipient.customField3,
10295
- customField4: p || this.transaction.recipient.customField4,
10296
- customField5: g || this.transaction.recipient.customField5,
10297
- conversionConfigurationId: C || this.transaction.recipient.conversionConfigurationId
10287
+ customField4: g || this.transaction.recipient.customField4,
10288
+ customField5: p || this.transaction.recipient.customField5,
10289
+ conversionConfigurationId: f || this.transaction.recipient.conversionConfigurationId
10298
10290
  }, await this.graphQlClient().mutate({
10299
10291
  mutation: fo,
10300
10292
  errorPolicy: "all",
@@ -10315,9 +10307,9 @@ class yo {
10315
10307
  customField1: u || this.transaction.recipient.customField1,
10316
10308
  customField2: h || this.transaction.recipient.customField2,
10317
10309
  customField3: m || this.transaction.recipient.customField3,
10318
- customField4: p || this.transaction.recipient.customField4,
10319
- customField5: g || this.transaction.recipient.customField5,
10320
- conversionConfigurationId: C || this.transaction.recipient.conversionConfigurationId
10310
+ customField4: g || this.transaction.recipient.customField4,
10311
+ customField5: p || this.transaction.recipient.customField5,
10312
+ conversionConfigurationId: f || this.transaction.recipient.conversionConfigurationId
10321
10313
  }
10322
10314
  });
10323
10315
  else {
@@ -10340,9 +10332,9 @@ class yo {
10340
10332
  customField1: u,
10341
10333
  customField2: h,
10342
10334
  customField3: m,
10343
- customField4: p,
10344
- customField5: g,
10345
- conversionConfigurationId: C
10335
+ customField4: g,
10336
+ customField5: p,
10337
+ conversionConfigurationId: f
10346
10338
  }
10347
10339
  });
10348
10340
  this.transaction.recipient = {
@@ -10361,9 +10353,9 @@ class yo {
10361
10353
  customField1: u,
10362
10354
  customField2: h,
10363
10355
  customField3: m,
10364
- customField4: p,
10365
- customField5: g,
10366
- conversionConfigurationId: C
10356
+ customField4: g,
10357
+ customField5: p,
10358
+ conversionConfigurationId: f
10367
10359
  }, await this.graphQlClient().mutate({
10368
10360
  mutation: Co,
10369
10361
  errorPolicy: "all",
@@ -10855,14 +10847,14 @@ class yo {
10855
10847
  this.stepSelections = {
10856
10848
  ...this.stepSelections,
10857
10849
  [t]: { selectedVariants: e }
10858
- }, this.selectionCost = Object.values(this.stepSelections).reduce((f, E) => f + E.selectedVariants.map((P) => P.priceModifier || 0).reduce((P, B) => P + B, 0), 0), this.workflow.steps.forEach((f) => {
10859
- St(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1, delete this.stepMetadata[f.stepName], delete this.stepSelections[f.stepName], delete this.storage[f.stepName]);
10850
+ }, this.selectionCost = Object.values(this.stepSelections).reduce((C, E) => C + E.selectedVariants.map((P) => P.priceModifier || 0).reduce((P, B) => P + B, 0), 0), this.workflow.steps.forEach((C) => {
10851
+ St(C, this.stepSelections) || (this.stepInitialised[C.stepName] = !1, delete this.stepMetadata[C.stepName], delete this.stepSelections[C.stepName], delete this.storage[C.stepName]);
10860
10852
  });
10861
- const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((f) => f.silentSteps).flat(), A = l.map((f) => f.silentSteps).flat().filter(
10862
- (f) => !c.some((E) => E.stepName === f.stepName)
10853
+ const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((C) => C.silentSteps).flat(), A = l.map((C) => C.silentSteps).flat().filter(
10854
+ (C) => !c.some((E) => E.stepName === C.stepName)
10863
10855
  );
10864
- c.forEach((f) => {
10865
- St(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1);
10856
+ c.forEach((C) => {
10857
+ St(C, this.stepSelections) || (this.stepInitialised[C.stepName] = !1);
10866
10858
  });
10867
10859
  const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
10868
10860
  this.stepElements = {
@@ -10870,13 +10862,13 @@ class yo {
10870
10862
  ...h,
10871
10863
  [t]: a
10872
10864
  }, this.removeElements(u);
10873
- const p = this.workflow.steps.find((f) => f.stepName === t);
10874
- p?.type === v.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((E) => E.id));
10875
- const g = u.map((f) => new bt(f.id)), C = new Ga(this.constructSerializableWorkflow()), S = [...m, ...g, C];
10865
+ const g = this.workflow.steps.find((C) => C.stepName === t);
10866
+ g?.type === v.Frame && this.getWorkflowExperience().getStepById(g.stepName)?.frameService?.setTargetElements(a.map((E) => E.id));
10867
+ const p = u.map((C) => new bt(C.id)), f = new Ga(this.constructSerializableWorkflow()), S = [...m, ...p, f];
10876
10868
  S.length > 0 && this.commandContext.apply(new R(S), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10877
10869
  const b = this.getInvalidModelVariants(), I = this.modelContainer;
10878
10870
  if (I) {
10879
- const f = b.map(
10871
+ const C = b.map(
10880
10872
  (E) => I.applyModelVariant(
10881
10873
  E,
10882
10874
  {
@@ -10885,7 +10877,7 @@ class yo {
10885
10877
  !1
10886
10878
  )
10887
10879
  );
10888
- await Promise.all(f);
10880
+ await Promise.all(C);
10889
10881
  }
10890
10882
  await this.onSelectionChange(), n && await n();
10891
10883
  }
@@ -11931,7 +11923,7 @@ const To = async (r, t) => {
11931
11923
  T.errors && console.log("Server Error:", et.message);
11932
11924
  }), null) : tt ?? null;
11933
11925
  })() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
11934
- const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && Ja(l, t, !0), g = l && Ja(l, t, !1), C = async (B) => {
11926
+ const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && Ja(l, t, !0), p = l && Ja(l, t, !1), f = async (B) => {
11935
11927
  const F = {};
11936
11928
  let Q = 0;
11937
11929
  if (Object.keys(i).length > 0)
@@ -11957,9 +11949,9 @@ const To = async (r, t) => {
11957
11949
  }
11958
11950
  }
11959
11951
  return [F, Q];
11960
- }, [S] = await C(!0), b = Object.fromEntries(
11952
+ }, [S] = await f(!0), b = Object.fromEntries(
11961
11953
  Object.keys(S).map((B) => [B, S[B].map((F) => F.id)])
11962
- ), [I] = await C(!1), f = Object.fromEntries(
11954
+ ), [I] = await f(!1), C = Object.fromEntries(
11963
11955
  Object.keys(I).map((B) => [
11964
11956
  B,
11965
11957
  I[B].map((F) => F.id)
@@ -11988,22 +11980,22 @@ const To = async (r, t) => {
11988
11980
  useThreeDimPreview: !!m,
11989
11981
  previewImage: E
11990
11982
  };
11991
- if (g) {
11983
+ if (p) {
11992
11984
  const F = [];
11993
- for (const [Q, T] of Object.entries(g))
11985
+ for (const [Q, T] of Object.entries(p))
11994
11986
  F.push({ key: Q, value: T });
11995
11987
  B.metadata = F;
11996
11988
  }
11997
11989
  if (b) {
11998
11990
  const F = [];
11999
- for (const [Q, T] of Object.entries(f))
11991
+ for (const [Q, T] of Object.entries(C))
12000
11992
  F.push({ key: Q, ids: T });
12001
11993
  B.selectedVariants = F;
12002
11994
  }
12003
11995
  return B;
12004
11996
  })(),
12005
11997
  cartSelectionsWithPrices: S,
12006
- cartMetadata: p
11998
+ cartMetadata: g
12007
11999
  };
12008
12000
  }, Ro = async (r, t, e, a, n, i, s, o, l, c, d) => {
12009
12001
  l("workflow.steps.finish.finalize.buildingLayouts");
@@ -12019,19 +12011,19 @@ const To = async (r, t) => {
12019
12011
  d
12020
12012
  );
12021
12013
  l("workflow.steps.finish.finalize.creatingDesign");
12022
- const m = await To(A), p = m?.transaction?.previewImageLink;
12014
+ const m = await To(A), g = m?.transaction?.previewImageLink;
12023
12015
  if (!m?.transaction)
12024
12016
  throw new Error("Failed to create design");
12025
12017
  l("workflow.steps.finish.finalize.updatingTransaction");
12026
- const g = m.transaction;
12018
+ const p = m.transaction;
12027
12019
  return Xn(
12028
- g,
12020
+ p,
12029
12021
  n,
12030
12022
  t,
12031
12023
  u,
12032
12024
  m?.sku,
12033
12025
  h,
12034
- p,
12026
+ g,
12035
12027
  m?.processExecution?.id
12036
12028
  );
12037
12029
  }, Oo = async (r, t, e) => {
@@ -12316,14 +12308,14 @@ class Go {
12316
12308
  }, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
12317
12309
  if (!h)
12318
12310
  throw new ke("Failed to obtain 2D context for preview image creation");
12319
- const m = this.workflowManager.getTemplatingContext(), p = ya(u.layoutState.layout, u.layoutState.elements, {
12311
+ const m = this.workflowManager.getTemplatingContext(), g = ya(u.layoutState.layout, u.layoutState.elements, {
12320
12312
  renderingConfiguration: {
12321
12313
  purpose: Ht.Print,
12322
12314
  region: { left: A.x, top: A.y, width: A.width, height: A.height },
12323
12315
  templatingContext: m
12324
12316
  }
12325
- }), g = mn(p);
12326
- await (await Aa.from(h, g, {
12317
+ }), p = mn(g);
12318
+ await (await Aa.from(h, p, {
12327
12319
  anonymousCrossOrigin: !0,
12328
12320
  ignoreDimensions: !1,
12329
12321
  createCanvas: pt,
@@ -12425,14 +12417,14 @@ class Go {
12425
12417
  A !== void 0 && (A.forEach((u) => d.add(JSON.stringify(u))), o.forEach((u) => {
12426
12418
  const h = u.getRaw().globalPropertyAspectConfigurations;
12427
12419
  h !== void 0 && h.forEach((m) => {
12428
- const p = l(m), g = d.has(JSON.stringify(m));
12429
- if (g && p?.getType() === "Option") {
12430
- const C = u.getCurrentVariant();
12431
- if (!C) return;
12432
- c.selectVariant(C), d.delete(JSON.stringify(m));
12433
- } else if (g && p?.getType() === "Text") {
12434
- const C = u.getText();
12435
- c.setText(C), d.delete(JSON.stringify(m));
12420
+ const g = l(m), p = d.has(JSON.stringify(m));
12421
+ if (p && g?.getType() === "Option") {
12422
+ const f = u.getCurrentVariant();
12423
+ if (!f) return;
12424
+ c.selectVariant(f), d.delete(JSON.stringify(m));
12425
+ } else if (p && g?.getType() === "Text") {
12426
+ const f = u.getText();
12427
+ c.setText(f), d.delete(JSON.stringify(m));
12436
12428
  }
12437
12429
  });
12438
12430
  }));
@@ -12689,13 +12681,13 @@ const Wo = (r) => {
12689
12681
  const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
12690
12682
  o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12691
12683
  const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await ln(l, { type: "svg" }))}`, A = (h) => {
12692
- const m = r.find((g) => g.panelId === h.panelId);
12684
+ const m = r.find((p) => p.panelId === h.panelId);
12693
12685
  if (!m)
12694
12686
  throw new Y(h);
12695
- const p = M();
12687
+ const g = M();
12696
12688
  return new z(
12697
12689
  {
12698
- id: p,
12690
+ id: g,
12699
12691
  src: d,
12700
12692
  type: x.Image,
12701
12693
  y: h.top,
@@ -12718,7 +12710,7 @@ const Wo = (r) => {
12718
12710
  const o = As(n, a.option);
12719
12711
  o && (t[a.stepName] = { selectedVariants: [o] });
12720
12712
  const l = async (c) => {
12721
- const d = await Un(c, o?.asset?.fileLink), A = await Oe(d), u = M(), h = r.find((p) => p.panelId === c.panelId);
12713
+ const d = await Un(c, o?.asset?.fileLink), A = await Oe(d), u = M(), h = r.find((g) => g.panelId === c.panelId);
12722
12714
  if (!h)
12723
12715
  throw new Y(c);
12724
12716
  const m = va(
@@ -12773,7 +12765,7 @@ const Wo = (r) => {
12773
12765
  const n = e.data, i = a.option;
12774
12766
  if (!i)
12775
12767
  return console.error(`No option for step ${a.stepName}.`), [];
12776
- const s = i.variants?.find((f) => f.id === n.illustrationVariantId) || ne(i);
12768
+ const s = i.variants?.find((C) => C.id === n.illustrationVariantId) || ne(i);
12777
12769
  if (!s)
12778
12770
  return console.error(`No variant with ID: ${n.illustrationVariantId}`), [];
12779
12771
  if (!s.asset)
@@ -12786,56 +12778,56 @@ const Wo = (r) => {
12786
12778
  if (!m)
12787
12779
  return console.error("Failed to read SVG."), [];
12788
12780
  pa(m);
12789
- const p = {};
12790
- kt(m, (f) => {
12791
- jo.includes(f.tagName) && !f.attributes.getNamedItem("fill") && f.setAttribute("fill", "#000000");
12792
- const E = f.attributes.getNamedItem("fill");
12781
+ const g = {};
12782
+ kt(m, (C) => {
12783
+ jo.includes(C.tagName) && !C.attributes.getNamedItem("fill") && C.setAttribute("fill", "#000000");
12784
+ const E = C.attributes.getNamedItem("fill");
12793
12785
  if (E && E.value !== "none") {
12794
12786
  const B = E.value, Q = `spiff-fill-${B.replace(/\W/g, "")}`;
12795
- f.classList.add(Q), p[Q] = { browserValue: B };
12787
+ C.classList.add(Q), g[Q] = { browserValue: B };
12796
12788
  }
12797
- const P = f.attributes.getNamedItem("stroke");
12789
+ const P = C.attributes.getNamedItem("stroke");
12798
12790
  if (P && P.value !== "none") {
12799
12791
  const B = P.value, Q = `spiff-stroke-${B.replace(/\W/g, "")}`;
12800
- f.classList.add(Q), p[Q] = { browserValue: B };
12792
+ C.classList.add(Q), g[Q] = { browserValue: B };
12801
12793
  }
12802
12794
  });
12803
- const C = Bt().serializeToString(m), S = n.colors;
12795
+ const f = Bt().serializeToString(m), S = n.colors;
12804
12796
  if (S) {
12805
- for (const [f, E] of Object.entries(p))
12797
+ for (const [C, E] of Object.entries(g))
12806
12798
  for (const P of Object.keys(S))
12807
12799
  if (E.browserValue === P) {
12808
- p[f] = { browserValue: S[P] };
12800
+ g[C] = { browserValue: S[P] };
12809
12801
  break;
12810
12802
  }
12811
12803
  }
12812
- const b = (f) => {
12813
- const E = r.find((B) => B.panelId === f.panelId);
12804
+ const b = (C) => {
12805
+ const E = r.find((B) => B.panelId === C.panelId);
12814
12806
  if (!E)
12815
- throw new Y(f);
12807
+ throw new Y(C);
12816
12808
  const P = M();
12817
12809
  return new z(
12818
12810
  {
12819
- colors: p,
12811
+ colors: g,
12820
12812
  id: P,
12821
- svg: C,
12813
+ svg: f,
12822
12814
  type: x.Illustration,
12823
- y: f.top,
12824
- x: f.left,
12825
- rotation: f.rotation,
12826
- width: f.width,
12827
- height: f.height,
12828
- layer: f.layer,
12829
- layerIndex: f.layerIndex,
12830
- immutable: f.immutable
12815
+ y: C.top,
12816
+ x: C.left,
12817
+ rotation: C.rotation,
12818
+ width: C.width,
12819
+ height: C.height,
12820
+ layer: C.layer,
12821
+ layerIndex: C.layerIndex,
12822
+ immutable: C.immutable
12831
12823
  },
12832
12824
  E
12833
12825
  );
12834
12826
  }, I = a.data.regions;
12835
12827
  try {
12836
12828
  return I.map(b);
12837
- } catch (f) {
12838
- return console.error(f), [];
12829
+ } catch (C) {
12830
+ return console.error(C), [];
12839
12831
  }
12840
12832
  }, Ko = async (r, t, e) => {
12841
12833
  const a = await Kn(e.data.module), n = t.data, i = (o, l) => {
@@ -12917,7 +12909,7 @@ const Wo = (r) => {
12917
12909
  return console.error(`No variant with ID: ${n.colorVariantId}`), [];
12918
12910
  t[a.stepName] = { selectedVariants: [s] };
12919
12911
  const o = (c) => {
12920
- const d = r.find((p) => p.panelId === c.panelId);
12912
+ const d = r.find((g) => g.panelId === c.panelId);
12921
12913
  if (!d)
12922
12914
  throw new Y(c);
12923
12915
  const A = `
@@ -12996,10 +12988,10 @@ const Wo = (r) => {
12996
12988
  }
12997
12989
  else {
12998
12990
  const c = await nt(i, !0), d = (A) => {
12999
- const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", C = dt().parseFromString(m, "image/svg+xml").firstElementChild;
13000
- if (!C)
12991
+ const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", f = dt().parseFromString(m, "image/svg+xml").firstElementChild;
12992
+ if (!f)
13001
12993
  throw new Dt("Failed to read SVG.");
13002
- return pa(C), Bt().serializeToString(C);
12994
+ return pa(f), Bt().serializeToString(f);
13003
12995
  };
13004
12996
  l.forEach((A) => {
13005
12997
  const u = r.find((m) => m.panelId === A.panelId);
@@ -13029,36 +13021,36 @@ const Wo = (r) => {
13029
13021
  }
13030
13022
  return a;
13031
13023
  }, tl = async (r, t, e, a) => {
13032
- const n = [], i = e.data, s = 30, o = (g) => g.vertical ? "center" : g.textAlign || "center", l = () => {
13033
- const g = a.option;
13034
- if (!g)
13024
+ const n = [], i = e.data, s = 30, o = (p) => p.vertical ? "center" : p.textAlign || "center", l = () => {
13025
+ const p = a.option;
13026
+ if (!p)
13035
13027
  return;
13036
- const C = g.variants?.find((b) => b.id === i.fontVariantId) || ne(g);
13037
- if (!C || !C.asset)
13028
+ const f = p.variants?.find((b) => b.id === i.fontVariantId) || ne(p);
13029
+ if (!f || !f.asset)
13038
13030
  return;
13039
- t[a.stepName] = { selectedVariants: [C] };
13040
- const S = C.asset.fileLink;
13031
+ t[a.stepName] = { selectedVariants: [f] };
13032
+ const S = f.asset.fileLink;
13041
13033
  if (S)
13042
13034
  return S;
13043
13035
  }, d = await (async () => {
13044
- const g = l();
13045
- if (!g)
13036
+ const p = l();
13037
+ if (!p)
13046
13038
  return;
13047
- const C = await Nt(g);
13039
+ const f = await Nt(p);
13048
13040
  return {
13049
- assetUrl: g,
13050
- name: C.names.fullName.en
13041
+ assetUrl: p,
13042
+ name: f.names.fullName.en
13051
13043
  };
13052
13044
  })(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", i.text) : i.text) || "", u = Ie(A, {
13053
13045
  vertical: a.data.vertical,
13054
13046
  uppercase: a.data.uppercase
13055
- }), h = async (g) => {
13056
- const C = g.colorOption;
13057
- return C ? H.getDefaultVariant(C)?.color : void 0;
13058
- }, m = i.color || await h(a.data), p = a.data.regions;
13059
- for (const g of p) {
13060
- const C = r.find((b) => b.panelId === g.panelId);
13061
- if (!C)
13047
+ }), h = async (p) => {
13048
+ const f = p.colorOption;
13049
+ return f ? H.getDefaultVariant(f)?.color : void 0;
13050
+ }, m = i.color || await h(a.data), g = a.data.regions;
13051
+ for (const p of g) {
13052
+ const f = r.find((b) => b.panelId === p.panelId);
13053
+ if (!f)
13062
13054
  continue;
13063
13055
  const S = {
13064
13056
  stepName: e.name,
@@ -13068,24 +13060,24 @@ const Wo = (r) => {
13068
13060
  fill: i.color || m || "#000000",
13069
13061
  fontData: d,
13070
13062
  fontSize: a.data.size || s,
13071
- height: g.height,
13072
- layer: g.layer,
13073
- layerIndex: g.layerIndex,
13063
+ height: p.height,
13064
+ layer: p.layer,
13065
+ layerIndex: p.layerIndex,
13074
13066
  paths: a.data.paths,
13075
- rotation: g.rotation,
13067
+ rotation: p.rotation,
13076
13068
  text: u,
13077
13069
  type: x.Textbox,
13078
13070
  vertical: a.data.vertical,
13079
13071
  verticalAlign: a.data.verticalAlign || "middle",
13080
- width: g.width,
13081
- x: g.left,
13082
- y: g.top
13072
+ width: p.width,
13073
+ x: p.left,
13074
+ y: p.top
13083
13075
  };
13084
13076
  if (d) {
13085
13077
  const [b, I] = fe(
13086
13078
  a.data.size || s,
13087
13079
  d,
13088
- g,
13080
+ p,
13089
13081
  [
13090
13082
  Ie(u, {
13091
13083
  vertical: a.data.vertical,
@@ -13106,11 +13098,11 @@ const Wo = (r) => {
13106
13098
  text: S.curved ? S.text : (I || []).join(`
13107
13099
  `)
13108
13100
  },
13109
- C
13101
+ f
13110
13102
  )
13111
13103
  );
13112
13104
  } else
13113
- n.push(new z(S, C));
13105
+ n.push(new z(S, f));
13114
13106
  }
13115
13107
  return n;
13116
13108
  }, el = (r, t) => r.conditions ? r.conditions.every((e) => {
@@ -13331,8 +13323,8 @@ class ol extends Fn {
13331
13323
  if (this.nonPOTSupport) {
13332
13324
  const m = s / o;
13333
13325
  a / n < m ? (l = s, c = n * (s / a)) : (l = a * (o / n), c = o);
13334
- const g = this.resizeFit({ width: l, height: c });
13335
- l = g.width, c = g.height;
13326
+ const p = this.resizeFit({ width: l, height: c });
13327
+ l = p.width, c = p.height;
13336
13328
  } else
13337
13329
  l = i.width, c = i.height;
13338
13330
  const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = ya(t.layoutState.layout, e, {
@@ -14342,31 +14334,36 @@ class ar {
14342
14334
  * Fetches a paginated feed of products.
14343
14335
  * @param offset The zero-based start index.
14344
14336
  * @param limit The maximum number of products to return.
14345
- * @param filters Optional metafield filters to apply to the query.
14337
+ * @param productFilters Optional product metafields to filter the products by.
14346
14338
  * @param tags Optional object of tag filters to apply.
14347
14339
  * @param sortKey Optional field of the products to sort by.
14348
14340
  * @param sortDescending Optional boolean to indicate if the sort should be in descending order.
14349
14341
  * @param quickSearch Optional string to filter products by name.
14342
+ * @param workflowFilters Optional workflow metafields to filter the products and their workflows by.
14350
14343
  * @returns
14351
14344
  */
14352
- async fetchProductsFeed(t, e, a, n, i, s, o) {
14345
+ async fetchProductsFeed(t, e, a, n, i, s, o, l) {
14353
14346
  if (this.fullFetched) {
14354
- const A = await (a ? this.filterProducts(a) : this.fetchProducts());
14347
+ const u = await (a ? this.filterProducts(a) : this.fetchProducts());
14355
14348
  return {
14356
- total: A.length,
14357
- items: A.slice(t, t + e)
14349
+ total: u.length,
14350
+ items: u.slice(t, t + e)
14358
14351
  };
14359
14352
  }
14360
- const l = new AbortController(), { signal: c } = l, d = y.getShadowGraphqlClient().watchQuery({
14353
+ const c = new AbortController(), { signal: d } = c, A = y.getShadowGraphqlClient().watchQuery({
14361
14354
  query: Js,
14362
14355
  variables: {
14363
14356
  id: this.getId(),
14364
14357
  limit: e,
14365
14358
  offset: t,
14366
- filters: a ? {
14359
+ productFilters: a ? {
14367
14360
  link: "And",
14368
14361
  metafields: a
14369
14362
  } : void 0,
14363
+ workflowFilters: l ? {
14364
+ link: "And",
14365
+ metafields: l
14366
+ } : void 0,
14370
14367
  tags: n ? {
14371
14368
  include: n.include ?? [],
14372
14369
  exclude: n.exclude ?? []
@@ -14380,26 +14377,26 @@ class ar {
14380
14377
  returnPartialData: !0,
14381
14378
  context: {
14382
14379
  fetchOptions: {
14383
- signal: c
14380
+ signal: d
14384
14381
  }
14385
14382
  }
14386
14383
  });
14387
- return new Promise((A) => {
14388
- let u = !1;
14389
- const h = d.subscribe({
14390
- next(m) {
14391
- if (u || m.partial && (!m.data.productCollections || m.data.productCollections.length === 0 || !m.data.productCollections[0].productCollectionProductsFeed?.items || m.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
14384
+ return new Promise((u) => {
14385
+ let h = !1;
14386
+ const m = A.subscribe({
14387
+ next(g) {
14388
+ if (h || g.partial && (!g.data.productCollections || g.data.productCollections.length === 0 || !g.data.productCollections[0].productCollectionProductsFeed?.items || g.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
14392
14389
  return;
14393
- l.abort(), u = !0, h.unsubscribe();
14394
- const p = m.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((g) => !!g.product).map((g) => new Ae(vt(g))) || [];
14395
- A({
14390
+ c.abort(), h = !0, m.unsubscribe();
14391
+ const p = g.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new Ae(vt(f))) || [];
14392
+ u({
14396
14393
  items: p,
14397
14394
  // Clone items because it could be cached data (immutable)
14398
- total: m.data.productCollections?.[0].productCollectionProductsFeed?.total ?? 0
14395
+ total: g.data.productCollections?.[0].productCollectionProductsFeed?.total ?? 0
14399
14396
  });
14400
14397
  },
14401
14398
  error() {
14402
- u || (u = !0, h.unsubscribe(), A({ items: [], total: 0 }));
14399
+ h || (h = !0, m.unsubscribe(), u({ items: [], total: 0 }));
14403
14400
  }
14404
14401
  });
14405
14402
  });
@@ -14707,9 +14704,9 @@ class _e {
14707
14704
  A ? this.globalPropertyHandleService.getHandles().then((u) => {
14708
14705
  const h = u.map((m) => {
14709
14706
  if (m.getType() === L.ColorOption || m.getType() === L.Option) {
14710
- const p = m;
14711
- if (!A.aspects.find((C) => C.name === p.getName()))
14712
- return p.initDefaultVariant();
14707
+ const g = m;
14708
+ if (!A.aspects.find((f) => f.name === g.getName()))
14709
+ return g.initDefaultVariant();
14713
14710
  }
14714
14711
  });
14715
14712
  Promise.all(h).then(c).catch(d);
@@ -14905,7 +14902,7 @@ class _e {
14905
14902
  ), d = [...new Set(o.map((u) => u.number))];
14906
14903
  if (d.length > c)
14907
14904
  for (const u of d) {
14908
- const h = this.getGlobalPropertyStateManager(), m = l.find((p) => p.channelNumber === u);
14905
+ const h = this.getGlobalPropertyStateManager(), m = l.find((g) => g.channelNumber === u);
14909
14906
  m && await h.setAspect(n, m.variant.id || "", void 0, m.channelNumber);
14910
14907
  }
14911
14908
  }
@@ -15965,7 +15962,7 @@ class md {
15965
15962
  } catch (a) {
15966
15963
  throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
15967
15964
  }
15968
- }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.3-beta.026ad90d-92e9-500b-a212-bd6dfa71283c"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15965
+ }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15969
15966
  }
15970
15967
  configure(t) {
15971
15968
  gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && zr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16284,8 +16281,8 @@ class md {
16284
16281
  const h = await this.loggedInBearerToken();
16285
16282
  o.Authorization = `Bearer ${h}`;
16286
16283
  } catch {
16287
- const p = Object.entries(localStorage).find(([C, S]) => C.startsWith("CognitoIdentityServiceProvider") && C.endsWith("idToken"))?.[0] || "", g = localStorage.getItem(p);
16288
- g && !Wt(g) && (o.Authorization = `Bearer ${g}`);
16284
+ const g = Object.entries(localStorage).find(([f, S]) => f.startsWith("CognitoIdentityServiceProvider") && f.endsWith("idToken"))?.[0] || "", p = localStorage.getItem(g);
16285
+ p && !Wt(p) && (o.Authorization = `Bearer ${p}`);
16289
16286
  }
16290
16287
  const l = {
16291
16288
  bundleOwnerId: s,
@@ -16325,8 +16322,8 @@ class md {
16325
16322
  const u = await this.loggedInBearerToken();
16326
16323
  s.Authorization = `Bearer ${u}`;
16327
16324
  } catch {
16328
- const m = Object.entries(localStorage).find(([g, C]) => g.startsWith("CognitoIdentityServiceProvider") && g.endsWith("idToken"))?.[0] || "", p = localStorage.getItem(m);
16329
- p && !Wt(p) && (s.Authorization = `Bearer ${p}`);
16325
+ const m = Object.entries(localStorage).find(([p, f]) => p.startsWith("CognitoIdentityServiceProvider") && p.endsWith("idToken"))?.[0] || "", g = localStorage.getItem(m);
16326
+ g && !Wt(g) && (s.Authorization = `Bearer ${g}`);
16330
16327
  }
16331
16328
  const o = {
16332
16329
  bundleOwnerId: i,
@@ -16424,10 +16421,10 @@ class md {
16424
16421
  async getWorkflowExperiences(t, e) {
16425
16422
  if (t.length === 0)
16426
16423
  throw new ht("No options provided!");
16427
- const a = y.getShadowGraphqlClient(), n = async (f) => {
16428
- if (f.length === 0)
16424
+ const a = y.getShadowGraphqlClient(), n = async (C) => {
16425
+ if (C.length === 0)
16429
16426
  return [];
16430
- const E = f.map((F) => F.option.transactionId), P = await a.query({
16427
+ const E = C.map((F) => F.option.transactionId), P = await a.query({
16431
16428
  query: vi,
16432
16429
  variables: {
16433
16430
  ids: E
@@ -16435,23 +16432,23 @@ class md {
16435
16432
  errorPolicy: "all",
16436
16433
  fetchPolicy: "no-cache"
16437
16434
  }), B = P.data.transactions;
16438
- if (B.length !== f.length) {
16435
+ if (B.length !== C.length) {
16439
16436
  const F = P.errors?.[0]?.message || "Unknown error";
16440
16437
  throw new ht(`Not all transactions were found: ${F}`);
16441
16438
  }
16442
16439
  return !this.activeIntegration && B[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(B[0].integrationProduct.integration)), B.map((F, Q) => ({
16443
16440
  transaction: F,
16444
16441
  workflowId: F.workflowId,
16445
- readOnly: f.find((T) => T.option.transactionId === F.id)?.option.readOnly ?? !1,
16446
- index: f[Q].index
16442
+ readOnly: C.find((T) => T.option.transactionId === F.id)?.option.readOnly ?? !1,
16443
+ index: C[Q].index
16447
16444
  }));
16448
- }, i = async (f) => {
16449
- if (f.length === 0)
16445
+ }, i = async (C) => {
16446
+ if (C.length === 0)
16450
16447
  return [];
16451
16448
  const E = await a.mutate({
16452
16449
  mutation: Si,
16453
16450
  variables: {
16454
- inputs: f.map((B) => ({
16451
+ inputs: C.map((B) => ({
16455
16452
  integrationProductId: B.option.type === "integration" ? B.option.integrationProductId : void 0,
16456
16453
  externalIntegrationId: B.option.type === "external" ? B.option.externalIntegrationId : void 0,
16457
16454
  externalProductId: B.option.type === "external" ? B.option.externalProductId : void 0,
@@ -16473,17 +16470,17 @@ class md {
16473
16470
  transaction: B,
16474
16471
  workflowId: B.workflowId,
16475
16472
  readOnly: !1,
16476
- index: f[F].index
16473
+ index: C[F].index
16477
16474
  }));
16478
- }, s = t.map((f, E) => ({ option: f, index: E })), o = s.filter((f) => f.option.type === "transaction"), l = s.filter(
16479
- (f) => f.option.type === "integration" || f.option.type === "external"
16475
+ }, s = t.map((C, E) => ({ option: C, index: E })), o = s.filter((C) => C.option.type === "transaction"), l = s.filter(
16476
+ (C) => C.option.type === "integration" || C.option.type === "external"
16480
16477
  ), c = Fa(o, 10), d = Fa(l, 10), A = (await Promise.all([
16481
16478
  ...c.map(n),
16482
16479
  ...d.map(i)
16483
- ])).flat(), u = [...new Set(A.map((f) => f.workflowId))], h = await rr(u, e), m = new Map(h.map((f) => [f.id, f])), p = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), g = A.map(async (f) => {
16484
- const { transaction: E, workflowId: P, readOnly: B, index: F } = f, Q = m.get(P), T = t[F];
16485
- !p.get(E.id) && E.transactionOwnerId && p.set(E.id, E.transactionOwnerId);
16486
- const tt = p.get(E.id) || void 0, et = new Tl({
16480
+ ])).flat(), u = [...new Set(A.map((C) => C.workflowId))], h = await rr(u, e), m = new Map(h.map((C) => [C.id, C])), g = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (C) => {
16481
+ const { transaction: E, workflowId: P, readOnly: B, index: F } = C, Q = m.get(P), T = t[F];
16482
+ !g.get(E.id) && E.transactionOwnerId && g.set(E.id, E.transactionOwnerId);
16483
+ const tt = g.get(E.id) || void 0, et = new Tl({
16487
16484
  onMutate: () => ({ context: { transactionOwnerId: tt, bundleOwnerId: e?.bundleOwnerId } }),
16488
16485
  onQuery: () => ({ context: { transactionOwnerId: tt, bundleOwnerId: e?.bundleOwnerId } })
16489
16486
  }), W = {
@@ -16516,13 +16513,13 @@ class md {
16516
16513
  return W.renderableContextService = new nl(
16517
16514
  W.layouts
16518
16515
  ), W.delayWorkflowStateSync = !0, { experienceOptions: W, index: F, options: T };
16519
- }), C = await Promise.all(g);
16520
- k.setMap("transactionOwnerIds", p);
16521
- const b = C.sort((f, E) => f.index - E.index).map(async (f) => {
16522
- const { experienceOptions: E, options: P } = f, B = new Go(this, E);
16516
+ }), f = await Promise.all(p);
16517
+ k.setMap("transactionOwnerIds", g);
16518
+ const b = f.sort((C, E) => C.index - E.index).map(async (C) => {
16519
+ const { experienceOptions: E, options: P } = C, B = new Go(this, E);
16523
16520
  return await B.getWorkflowManager().getInitializationPromise(), P.type !== "transaction" && this.customer && await B.attachCustomerDetails({ email: this.customer.emailAddress }), B;
16524
16521
  }), I = await Promise.all(b);
16525
- return I.forEach((f) => f.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), I;
16522
+ return I.forEach((C) => C.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), I;
16526
16523
  }
16527
16524
  storeCustomer(t) {
16528
16525
  const e = k.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map();
@@ -16870,7 +16867,7 @@ class Gl {
16870
16867
  }
16871
16868
  }
16872
16869
  class wd {
16873
- updateRecipient(t, e, a, n, i, s, o, l, c, d, A, u, h, m, p, g, C) {
16870
+ updateRecipient(t, e, a, n, i, s, o, l, c, d, A, u, h, m, g, p, f) {
16874
16871
  throw new Error("Method not implemented.");
16875
16872
  }
16876
16873
  approveTransaction(t) {