@spiffcommerce/core 27.2.1-beta.53daa97c-6932-5a12-a2b0-5f55ecb6f4c7 → 27.2.1-beta.7511abac-e002-517f-be28-38477f8184a4

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
@@ -21,7 +21,7 @@ import { split as Ze } from "unicode-default-word-boundary";
21
21
  import ln from "lodash.debounce";
22
22
  import "fs";
23
23
  import "path";
24
- var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), G = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(G || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), q = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(q || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
24
+ var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), G = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(G || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), qt = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(qt || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), H = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(H || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
25
25
  class cn extends Error {
26
26
  constructor(t) {
27
27
  super(t), this.name = this.constructor.name;
@@ -47,7 +47,7 @@ class vt extends _t {
47
47
  super(`Asset not found for variant: ${t.name}`), this.variant = t;
48
48
  }
49
49
  }
50
- class qt extends _t {
50
+ class Ht extends _t {
51
51
  constructor(t) {
52
52
  super(`Resource not found for asset: ${t.name}`), this.asset = t;
53
53
  }
@@ -296,18 +296,18 @@ const Rr = (r) => {
296
296
  let mn;
297
297
  const $r = (r) => {
298
298
  mn = r;
299
- }, Ur = () => new Promise((r) => {
299
+ }, Lr = () => new Promise((r) => {
300
300
  const t = mt.getHubUrl(), e = (a) => {
301
301
  a.origin === t && (window.removeEventListener("message", e), r(a.data));
302
302
  };
303
303
  window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
304
- }), Lr = async () => {
304
+ }), Ur = async () => {
305
305
  const r = {
306
306
  applicationKey: ma,
307
307
  customerToken: Qr,
308
308
  bearer: mn
309
309
  };
310
- return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Ur(), ...r } : r;
310
+ return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Lr(), ...r } : r;
311
311
  };
312
312
  async function Vr(r, t) {
313
313
  const e = mt.getServerUrl(), a = e.includes(".aumelbdev.spiffcommerce.com") ? "https://moonlight.aumelbdev.spiffcommerce.com" : e.includes(".us.spiffcommerce.com") ? "https://moonlight.us.spiffcommerce.com" : "https://moonlight.au.spiffcommerce.com";
@@ -331,7 +331,7 @@ class Gr {
331
331
  uri: `${mt.getServerUrl()}/graphql`,
332
332
  fetch: Vr
333
333
  }), e = lr(async (i, s) => {
334
- const { headers: o } = s, l = o || {}, c = await Lr();
334
+ const { headers: o } = s, l = o || {}, c = await Ur();
335
335
  let d = s.bearer ?? c.bearer;
336
336
  if (this.spiffClient)
337
337
  try {
@@ -427,7 +427,7 @@ const zr = (r) => new Promise((t) => {
427
427
  }, jr = (r) => {
428
428
  const e = r.naturalWidth / r.naturalHeight;
429
429
  return r.naturalHeight <= 8192 && r.naturalWidth <= 8192 ? [r.naturalWidth, r.naturalHeight] : r.naturalHeight > r.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
430
- }, Hr = async (r) => {
430
+ }, qr = async (r) => {
431
431
  var A;
432
432
  const t = await Tr(r), e = await Zt(t), [a, n] = jr(e);
433
433
  if (!await Wr()) {
@@ -460,7 +460,7 @@ const zr = (r) => new Promise((t) => {
460
460
  }
461
461
  return d.drawImage(e, 0, 0, o, l), c;
462
462
  }, Me = async (r) => {
463
- const t = await Hr(r);
463
+ const t = await qr(r);
464
464
  return ke(r) === "image/jpeg" ? {
465
465
  dataUrl: t.toDataURL("image/jpeg", 1),
466
466
  height: t.height,
@@ -3154,7 +3154,7 @@ const zr = (r) => new Promise((t) => {
3154
3154
  "3E2B2E",
3155
3155
  "101820",
3156
3156
  "3D3935"
3157
- ], Ue = Ft.map((r) => [
3157
+ ], Le = Ft.map((r) => [
3158
3158
  parseInt(r.substring(0, 2), 16),
3159
3159
  parseInt(r.substring(2, 4), 16),
3160
3160
  parseInt(r.substring(4, 6), 16)
@@ -3163,12 +3163,12 @@ function Ic(r) {
3163
3163
  const t = Yt.indexOf(r);
3164
3164
  return t >= 0 ? Ft[t] : "";
3165
3165
  }
3166
- function qr(r) {
3166
+ function Hr(r) {
3167
3167
  const t = Ft.indexOf(r);
3168
3168
  return t >= 0 ? Yt[t] : "";
3169
3169
  }
3170
3170
  function Pc(r, t = 64) {
3171
- const e = [], a = [], n = qr(r);
3171
+ const e = [], a = [], n = Hr(r);
3172
3172
  n && e.push({
3173
3173
  pms: n,
3174
3174
  hex: r,
@@ -3177,7 +3177,7 @@ function Pc(r, t = 64) {
3177
3177
  const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
3178
3178
  let l, c, d;
3179
3179
  for (let A = 0; A < Ft.length; A++) {
3180
- l = Ue[A][0], c = Ue[A][1], d = Ue[A][2];
3180
+ l = Le[A][0], c = Le[A][1], d = Le[A][2];
3181
3181
  const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
3182
3182
  a.push(u);
3183
3183
  }
@@ -3799,7 +3799,7 @@ class K {
3799
3799
  N.setMap($a, t);
3800
3800
  }
3801
3801
  }
3802
- const U = new di();
3802
+ const L = new di();
3803
3803
  class Ai {
3804
3804
  constructor() {
3805
3805
  this.cache = {}, this.disabled = !1;
@@ -3887,8 +3887,8 @@ const Jt = new Ai(), vn = v`
3887
3887
  });
3888
3888
  return t.data.options.forEach((e) => {
3889
3889
  var a, n;
3890
- (a = e.defaultVariant) != null && a.asset && U.cacheAsset(e.defaultVariant.asset), e.colorProfile && U.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3891
- i.asset && U.cacheAsset(i.asset), i.thumbnail && U.cacheAsset(i.thumbnail), i.material && U.cacheMaterial(i.material);
3890
+ (a = e.defaultVariant) != null && a.asset && L.cacheAsset(e.defaultVariant.asset), e.colorProfile && L.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3891
+ i.asset && L.cacheAsset(i.asset), i.thumbnail && L.cacheAsset(i.thumbnail), i.material && L.cacheMaterial(i.material);
3892
3892
  });
3893
3893
  }), t.data.options;
3894
3894
  }, mi = async (r, t) => (await t).find((a) => a.id === r), gi = async (r) => {
@@ -5134,7 +5134,7 @@ const Y = new pi(), En = v`
5134
5134
  internalId
5135
5135
  }
5136
5136
  }
5137
- `, Ot = [P.SilentIllustration, P.ProductOverlay], Ui = async (r) => {
5137
+ `, Ot = [P.SilentIllustration, P.ProductOverlay], Li = async (r) => {
5138
5138
  const t = [];
5139
5139
  r.introduction && t.push({
5140
5140
  name: "Introduction",
@@ -5152,7 +5152,7 @@ const Y = new pi(), En = v`
5152
5152
  silentSteps: []
5153
5153
  });
5154
5154
  for (const a of r.steps) {
5155
- const n = Li(a.stepName, r.stepGroups);
5155
+ const n = Ui(a.stepName, r.stepGroups);
5156
5156
  if (!n)
5157
5157
  t.push({
5158
5158
  name: a.stepName,
@@ -5189,7 +5189,7 @@ const Y = new pi(), En = v`
5189
5189
  ],
5190
5190
  silentSteps: []
5191
5191
  }), t;
5192
- }, Li = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
5192
+ }, Ui = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
5193
5193
  const a = t[e.targetStepName];
5194
5194
  if (a && a.selectedVariants) {
5195
5195
  const n = a.selectedVariants;
@@ -5317,7 +5317,7 @@ const Q = () => {
5317
5317
  width: u
5318
5318
  }) => {
5319
5319
  var E;
5320
- const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === Ht.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((B, I) => (
5320
+ const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === qt.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((B, I) => (
5321
5321
  /* @ts-ignore */
5322
5322
  /* @__PURE__ */ F("color-profile", { name: B.name, xlinkHref: B.key, children: " " }, I)
5323
5323
  )), S = n.map((B) => ({
@@ -5360,7 +5360,7 @@ const Q = () => {
5360
5360
  "g",
5361
5361
  {
5362
5362
  id: "element-group",
5363
- clipPath: a.purpose === Ht.FreeDesign ? "url(#viewboxClip)" : void 0,
5363
+ clipPath: a.purpose === qt.FreeDesign ? "url(#viewboxClip)" : void 0,
5364
5364
  children: y.map((B) => Qn(B)).filter((B) => !!B)
5365
5365
  }
5366
5366
  ),
@@ -5433,22 +5433,22 @@ const Q = () => {
5433
5433
  y: r.y + ((t == null ? void 0 : t.y) + (t == null ? void 0 : t.height)) * a
5434
5434
  }), Pt = (r) => {
5435
5435
  switch (r) {
5436
- case q.North:
5437
- return q.East;
5438
- case q.East:
5439
- return q.South;
5440
- case q.South:
5441
- return q.West;
5442
- case q.West:
5443
- return q.North;
5444
- case q.Northwest:
5445
- return q.Northeast;
5446
- case q.Northeast:
5447
- return q.Southeast;
5448
- case q.Southeast:
5449
- return q.Southwest;
5450
- case q.Southwest:
5451
- return q.Northwest;
5436
+ case H.North:
5437
+ return H.East;
5438
+ case H.East:
5439
+ return H.South;
5440
+ case H.South:
5441
+ return H.West;
5442
+ case H.West:
5443
+ return H.North;
5444
+ case H.Northwest:
5445
+ return H.Northeast;
5446
+ case H.Northeast:
5447
+ return H.Southeast;
5448
+ case H.Southeast:
5449
+ return H.Southwest;
5450
+ case H.Southwest:
5451
+ return H.Northwest;
5452
5452
  }
5453
5453
  }, Oc = (r, t) => t > 45 && t <= 135 ? Pt(r) : t > 135 && t <= 225 ? Pt(Pt(r)) : t > 225 && t <= 315 ? Pt(Pt(Pt(r))) : r, $c = (r, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
5454
5454
  const a = pt(r.rotation), n = {
@@ -5480,7 +5480,7 @@ const Q = () => {
5480
5480
  x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
5481
5481
  y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
5482
5482
  };
5483
- }, Uc = 0.352778, Lc = 0.035277, Fn = (r) => {
5483
+ }, Lc = 0.352778, Uc = 0.035277, Fn = (r) => {
5484
5484
  const t = r.rotation || 0, e = pt(t), a = Math.cos(e), n = -Math.sin(e);
5485
5485
  return /* @__PURE__ */ F("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ F(
5486
5486
  "g",
@@ -5677,14 +5677,14 @@ class ji {
5677
5677
  }), a - n;
5678
5678
  }
5679
5679
  }
5680
- const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @__PURE__ */ new Map(), Nt = async (r) => {
5681
- if (Le.has(r))
5682
- return Le.get(r);
5680
+ const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @__PURE__ */ new Map(), Nt = async (r) => {
5681
+ if (Ue.has(r))
5682
+ return Ue.get(r);
5683
5683
  const e = (async () => {
5684
5684
  try {
5685
5685
  return Et(r).getFont();
5686
5686
  } catch {
5687
- if (Hi(r)) {
5687
+ if (qi(r)) {
5688
5688
  const a = hn(r), n = Xe(a);
5689
5689
  return ra(r, n), n;
5690
5690
  } else {
@@ -5693,8 +5693,8 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5693
5693
  }
5694
5694
  }
5695
5695
  })();
5696
- return Le.set(r, e), e;
5697
- }, qi = (r) => {
5696
+ return Ue.set(r, e), e;
5697
+ }, Hi = (r) => {
5698
5698
  const t = hn(r), e = Xe(t);
5699
5699
  return ra(r, e), e;
5700
5700
  }, Et = (r) => {
@@ -5742,7 +5742,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5742
5742
  }
5743
5743
  return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
5744
5744
  }, Ee = (r, t, e, a) => Math.max(_i(r.join(`
5745
- `), e, a), t), Ua = (r, t, e, a, n, i) => {
5745
+ `), e, a), t), La = (r, t, e, a, n, i) => {
5746
5746
  const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
5747
5747
  `);
5748
5748
  try {
@@ -5800,7 +5800,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5800
5800
  var c;
5801
5801
  const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5802
5802
  if (!e)
5803
- return Ua(t, r, t.fontSize, s, n, a);
5803
+ return La(t, r, t.fontSize, s, n, a);
5804
5804
  let o;
5805
5805
  if (t.text ? o = t.text.split(`
5806
5806
  `) : o = ((c = t.input) == null ? void 0 : c.split(`
@@ -5817,7 +5817,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5817
5817
  requiredHeight: t.height,
5818
5818
  requiredWidth: Ee(o, t.width, s, n),
5819
5819
  fontSize: Yi(o, n, i, t.width, t.height, a)
5820
- } : Ua(t, r, t.fontSize, s, n, a);
5820
+ } : La(t, r, t.fontSize, s, n, a);
5821
5821
  }, Ki = (r, t, e, a, n) => {
5822
5822
  const s = Et(t.assetUrl).getFont();
5823
5823
  let o = { ...r };
@@ -5846,12 +5846,12 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5846
5846
  return r.forEach((n) => {
5847
5847
  a = Math.max(a, ht(n, t, e));
5848
5848
  }), a;
5849
- }, La = {
5849
+ }, Ua = {
5850
5850
  stripControlCharacters: !0,
5851
5851
  vertical: !1,
5852
5852
  uppercase: !1
5853
- }, Be = (r, t = La) => {
5854
- const e = { ...La, ...t };
5853
+ }, Be = (r, t = Ua) => {
5854
+ const e = { ...Ua, ...t };
5855
5855
  let a = r || "";
5856
5856
  return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
5857
5857
  `)), a;
@@ -6046,7 +6046,7 @@ class rs {
6046
6046
  return this.state;
6047
6047
  }
6048
6048
  runStateCallbacks() {
6049
- console.log("LOG: running callbacks"), this.stateCallbacks.forEach((t) => t());
6049
+ this.stateCallbacks.forEach((t) => t());
6050
6050
  }
6051
6051
  apply(t, e) {
6052
6052
  if (!this.state)
@@ -6114,7 +6114,7 @@ class rs {
6114
6114
  layouts: {}
6115
6115
  };
6116
6116
  t.forEach((n) => {
6117
- a = new Un(n).apply(a);
6117
+ a = new Ln(n).apply(a);
6118
6118
  }), this.runStateCallbacks(), this.state = {
6119
6119
  transaction: a
6120
6120
  };
@@ -6332,7 +6332,7 @@ const ae = (r) => {
6332
6332
  return await A.render(), await t(c);
6333
6333
  })();
6334
6334
  return ze.set(r, a), a;
6335
- }, Ut = async (r, t, e, a) => {
6335
+ }, Lt = async (r, t, e, a) => {
6336
6336
  const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
6337
6337
  width: r.layoutState.layout.width,
6338
6338
  height: r.layoutState.layout.height,
@@ -6366,7 +6366,7 @@ const ae = (r) => {
6366
6366
  };
6367
6367
  class Gc {
6368
6368
  static async getFrame(t, e) {
6369
- const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Ut(t, M.Frame);
6369
+ const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Lt(t, M.Frame);
6370
6370
  return {
6371
6371
  id: Q(),
6372
6372
  x: i.left,
@@ -6392,7 +6392,7 @@ class Gc {
6392
6392
  };
6393
6393
  }
6394
6394
  static async getImage(t, e) {
6395
- const a = e.region || await Ut(t, M.Image, e.src);
6395
+ const a = e.region || await Lt(t, M.Image, e.src);
6396
6396
  return {
6397
6397
  id: Q(),
6398
6398
  src: e.src,
@@ -6416,7 +6416,7 @@ class Gc {
6416
6416
  }, l = (i == null ? void 0 : i.text) || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Be(c, {
6417
6417
  vertical: a.vertical,
6418
6418
  uppercase: a.uppercase
6419
- }), A = e.region || await Ut(t, M.Textbox, n, {
6419
+ }), A = e.region || await Lt(t, M.Textbox, n, {
6420
6420
  text: d,
6421
6421
  fontScale: a.size ? a.size / s.unitsPerEm : void 0
6422
6422
  }), u = ee(
@@ -6482,7 +6482,7 @@ class Gc {
6482
6482
  </svg>
6483
6483
  `, n = {};
6484
6484
  n["spiff-fill-shape"] = { browserValue: e.color };
6485
- const i = e.region || await Ut(t, M.Illustration), s = Q();
6485
+ const i = e.region || await Lt(t, M.Illustration), s = Q();
6486
6486
  return {
6487
6487
  stepRegion: e.region,
6488
6488
  colors: n,
@@ -6500,7 +6500,7 @@ class Gc {
6500
6500
  };
6501
6501
  }
6502
6502
  static async getIllustration(t, e) {
6503
- const a = e.region || await Ut(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
6503
+ const a = e.region || await Lt(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
6504
6504
  return {
6505
6505
  cachedObjectURL: i,
6506
6506
  stepRegion: e.region,
@@ -6525,7 +6525,7 @@ class V extends Error {
6525
6525
  super("Element not found!"), Object.setPrototypeOf(this, V.prototype);
6526
6526
  }
6527
6527
  }
6528
- const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6528
+ const U = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6529
6529
  const e = Object.values(t).find((a) => a.elements.some((n) => n.id === r));
6530
6530
  if (!e)
6531
6531
  throw new V();
@@ -6616,7 +6616,7 @@ class zc extends O {
6616
6616
  }
6617
6617
  apply(t) {
6618
6618
  this.oldState = t;
6619
- const e = L(this.id, Object.values(t.layouts));
6619
+ const e = U(this.id, Object.values(t.layouts));
6620
6620
  if (!e.id)
6621
6621
  throw new V();
6622
6622
  const a = {
@@ -6639,7 +6639,7 @@ class Wc extends O {
6639
6639
  }
6640
6640
  apply(t) {
6641
6641
  this.oldState = t;
6642
- const e = L(this.id, Object.values(t.layouts));
6642
+ const e = U(this.id, Object.values(t.layouts));
6643
6643
  if (!e.id)
6644
6644
  throw new V();
6645
6645
  const a = {
@@ -6661,7 +6661,7 @@ class jc extends O {
6661
6661
  }
6662
6662
  apply(t) {
6663
6663
  this.oldState = t;
6664
- const e = L(this.id, Object.values(t.layouts));
6664
+ const e = U(this.id, Object.values(t.layouts));
6665
6665
  if (!e.id)
6666
6666
  throw new V();
6667
6667
  let a = {
@@ -6694,7 +6694,7 @@ class $ extends O {
6694
6694
  return this.oldState = t, this.commands.reduce((e, a) => a.apply(e), t);
6695
6695
  }
6696
6696
  }
6697
- class Un extends O {
6697
+ class Ln extends O {
6698
6698
  constructor(t) {
6699
6699
  super(), this.layout = t;
6700
6700
  }
@@ -6800,7 +6800,7 @@ class ss extends O {
6800
6800
  }
6801
6801
  apply(t) {
6802
6802
  this.oldState = t;
6803
- const e = L(this.id, Object.values(t.layouts));
6803
+ const e = U(this.id, Object.values(t.layouts));
6804
6804
  if (!e.id)
6805
6805
  throw new V();
6806
6806
  const a = {
@@ -6824,7 +6824,7 @@ class We extends O {
6824
6824
  }
6825
6825
  apply(t) {
6826
6826
  this.oldState = t;
6827
- const e = L(this.id, Object.values(t.layouts));
6827
+ const e = U(this.id, Object.values(t.layouts));
6828
6828
  if (!e.id)
6829
6829
  throw new V();
6830
6830
  const a = {
@@ -6846,7 +6846,7 @@ class os extends O {
6846
6846
  }
6847
6847
  apply(t) {
6848
6848
  this.oldState = t;
6849
- const e = L(this.id, Object.values(t.layouts));
6849
+ const e = U(this.id, Object.values(t.layouts));
6850
6850
  if (!e.id)
6851
6851
  throw new V();
6852
6852
  const a = {
@@ -6868,7 +6868,7 @@ class Wa extends O {
6868
6868
  }
6869
6869
  apply(t) {
6870
6870
  this.oldState = t;
6871
- const e = L(this.id, Object.values(t.layouts));
6871
+ const e = U(this.id, Object.values(t.layouts));
6872
6872
  if (!e.id)
6873
6873
  throw new V();
6874
6874
  const a = {
@@ -6890,7 +6890,7 @@ class ls extends O {
6890
6890
  }
6891
6891
  apply(t) {
6892
6892
  this.oldState = t;
6893
- const e = L(this.id, Object.values(t.layouts));
6893
+ const e = U(this.id, Object.values(t.layouts));
6894
6894
  if (!e.id)
6895
6895
  throw new V();
6896
6896
  const a = {
@@ -6948,7 +6948,7 @@ class ds extends O {
6948
6948
  }
6949
6949
  apply(t) {
6950
6950
  this.oldState = t;
6951
- const e = L(this.id, Object.values(t.layouts));
6951
+ const e = U(this.id, Object.values(t.layouts));
6952
6952
  if (!e.id)
6953
6953
  throw new V();
6954
6954
  const a = {
@@ -6967,13 +6967,13 @@ class ds extends O {
6967
6967
  };
6968
6968
  }
6969
6969
  }
6970
- class Hc extends O {
6970
+ class qc extends O {
6971
6971
  constructor(t, e) {
6972
6972
  super(), this.id = t, this.src = e;
6973
6973
  }
6974
6974
  apply(t) {
6975
6975
  this.oldState = t;
6976
- const e = L(this.id, Object.values(t.layouts));
6976
+ const e = U(this.id, Object.values(t.layouts));
6977
6977
  if (!e.id)
6978
6978
  throw new V();
6979
6979
  const a = {
@@ -6995,7 +6995,7 @@ class As extends O {
6995
6995
  }
6996
6996
  apply(t) {
6997
6997
  this.oldState = t;
6998
- const e = L(this.id, Object.values(t.layouts));
6998
+ const e = U(this.id, Object.values(t.layouts));
6999
6999
  if (!e.id)
7000
7000
  throw new V();
7001
7001
  const a = X(e.id, Object.values(t.layouts)), n = Z(ee(e, this.text, e), a);
@@ -7014,7 +7014,7 @@ class je extends O {
7014
7014
  }
7015
7015
  apply(t) {
7016
7016
  this.oldState = t;
7017
- const e = L(this.id, Object.values(t.layouts));
7017
+ const e = U(this.id, Object.values(t.layouts));
7018
7018
  if (!e.id)
7019
7019
  throw new V();
7020
7020
  const a = {
@@ -7037,7 +7037,7 @@ class oa extends O {
7037
7037
  }
7038
7038
  apply(t) {
7039
7039
  this.oldState = t;
7040
- const e = L(this.id, Object.values(t.layouts));
7040
+ const e = U(this.id, Object.values(t.layouts));
7041
7041
  if (!e.id)
7042
7042
  throw new V();
7043
7043
  const a = e.colors || {}, n = a[this.className];
@@ -7069,7 +7069,7 @@ class us extends O {
7069
7069
  }
7070
7070
  apply(t) {
7071
7071
  this.oldState = t;
7072
- const e = L(this.id, Object.values(t.layouts));
7072
+ const e = U(this.id, Object.values(t.layouts));
7073
7073
  if (!e.id)
7074
7074
  throw new V();
7075
7075
  const a = {
@@ -7086,7 +7086,7 @@ class us extends O {
7086
7086
  };
7087
7087
  }
7088
7088
  }
7089
- class qc extends O {
7089
+ class Hc extends O {
7090
7090
  /**
7091
7091
  * @param id The targeted element to bring to the front.
7092
7092
  */
@@ -7094,7 +7094,7 @@ class qc extends O {
7094
7094
  super(), this.id = t;
7095
7095
  }
7096
7096
  apply(t) {
7097
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7097
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7098
7098
  throw new V();
7099
7099
  const a = Object.values(t.layouts).find((s) => s.elements.find((o) => o.id === this.id));
7100
7100
  if (!a)
@@ -7124,7 +7124,7 @@ class Yc extends O {
7124
7124
  }
7125
7125
  apply(t) {
7126
7126
  this.oldState = t;
7127
- const e = L(this.id, Object.values(t.layouts));
7127
+ const e = U(this.id, Object.values(t.layouts));
7128
7128
  if (!e.id)
7129
7129
  throw new V();
7130
7130
  const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
@@ -7154,7 +7154,7 @@ class Jc extends O {
7154
7154
  super(), this.id = t;
7155
7155
  }
7156
7156
  apply(t) {
7157
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7157
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7158
7158
  throw new V();
7159
7159
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7160
7160
  if (!a)
@@ -7181,7 +7181,7 @@ class Kc extends O {
7181
7181
  super(), this.id = t;
7182
7182
  }
7183
7183
  apply(t) {
7184
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7184
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7185
7185
  throw new V();
7186
7186
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7187
7187
  if (!a)
@@ -7315,7 +7315,7 @@ const hs = async (r) => {
7315
7315
  throw console.error(e), new xe("Failed to shorten URL, see console.");
7316
7316
  }
7317
7317
  };
7318
- class Ln {
7318
+ class Un {
7319
7319
  async poll() {
7320
7320
  try {
7321
7321
  if (await this.predicate()) {
@@ -7362,12 +7362,12 @@ class ms {
7362
7362
  const h = (await ve([e]))[0], m = (p = (g = h == null ? void 0 : h.versions) == null ? void 0 : g.find((f) => f.name === "mpeg4")) == null ? void 0 : p.link;
7363
7363
  return { asset: h, link: m };
7364
7364
  }, s = await new Promise((h, m) => {
7365
- new Ln(
7365
+ new Un(
7366
7366
  async () => !!(await i()).link,
7367
7367
  async () => {
7368
7368
  const g = await i();
7369
7369
  if (!g.link || !g.link)
7370
- throw new qt(g.asset);
7370
+ throw new Ht(g.asset);
7371
7371
  h({
7372
7372
  rel: "mpeg4",
7373
7373
  href: g.link
@@ -7442,7 +7442,7 @@ class be {
7442
7442
  const n = a.fileLink;
7443
7443
  if (n)
7444
7444
  return at(n, !0);
7445
- throw new qt(a);
7445
+ throw new Ht(a);
7446
7446
  };
7447
7447
  }
7448
7448
  async init(t, e, a) {
@@ -7456,7 +7456,7 @@ class be {
7456
7456
  const s = e.getWorkflowExperience().getBundle();
7457
7457
  if (s && t.globalPropertyAspectConfigurations) {
7458
7458
  const o = s.getGlobalPropertyStateManager(), l = t.globalPropertyAspectConfigurations[0], c = o.getAspectStorage(l.aspectName);
7459
- c && c.originalAssetKey && (i = (await U.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7459
+ c && c.originalAssetKey && (i = (await L.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7460
7460
  }
7461
7461
  if (t.option && t.option.variants && t.option.variants.length > 0) {
7462
7462
  const o = t.option, l = Y.getDefaultVariant(o);
@@ -7552,14 +7552,14 @@ class be {
7552
7552
  const o = e.fileLink || "";
7553
7553
  return o.endsWith(".pdf") || o.endsWith(".eps") || o.endsWith(".ai") ? new Promise((c) => {
7554
7554
  a.addPoller(
7555
- new Ln(
7555
+ new Un(
7556
7556
  async () => {
7557
7557
  var h;
7558
- const A = (h = (await U.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
7558
+ const A = (h = (await L.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
7559
7559
  return A ? (await rt(A.link)).status === 200 : !1;
7560
7560
  },
7561
7561
  () => {
7562
- U.getLocalOrFromServer(e.key || "").then((d) => {
7562
+ L.getLocalOrFromServer(e.key || "").then((d) => {
7563
7563
  this.loadPatternFromAsset(d, t, a, n).then(
7564
7564
  c
7565
7565
  );
@@ -7786,7 +7786,7 @@ class be {
7786
7786
  const a = t.fileLink;
7787
7787
  if (a)
7788
7788
  return a;
7789
- throw new qt(t);
7789
+ throw new Ht(t);
7790
7790
  }
7791
7791
  async loadPatternFromAsset(t, e, a, n) {
7792
7792
  var c, d;
@@ -7854,7 +7854,7 @@ class gs {
7854
7854
  if (a.length === 0)
7855
7855
  return [];
7856
7856
  try {
7857
- return L(
7857
+ return U(
7858
7858
  a[0].id,
7859
7859
  e.getAllLayoutData()
7860
7860
  ).colors;
@@ -7939,7 +7939,7 @@ class gs {
7939
7939
  var h, m;
7940
7940
  if (e.length === 0)
7941
7941
  return;
7942
- const s = L(
7942
+ const s = U(
7943
7943
  e[0].id,
7944
7944
  n().map((g) => g.layoutState)
7945
7945
  ), o = { ...s.colors }, l = {};
@@ -7991,7 +7991,7 @@ class gs {
7991
7991
  throw new vt(e);
7992
7992
  const l = o.fileLink;
7993
7993
  if (!l)
7994
- throw new qt(o);
7994
+ throw new Ht(o);
7995
7995
  const c = await lt(await this.getIllustrationBody(l)), d = await Kt(c.svg), A = (C) => {
7996
7996
  const w = i.getLayouts().find((y) => y.panelId === C.panelId);
7997
7997
  if (!w)
@@ -8472,31 +8472,31 @@ class ys {
8472
8472
  }
8473
8473
  }
8474
8474
  async selectVariant(t, e, a) {
8475
- await a.getInitializationPromise();
8475
+ console.log("LOG: q select variant"), await a.getInitializationPromise();
8476
8476
  const n = await this.selectVariantLambda(t, e, a);
8477
- n && (n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
8477
+ n && (console.log("LOG: q select variant result"), n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
8478
8478
  }
8479
8479
  async selectVariantLambda(t, e, a) {
8480
8480
  const n = t.option;
8481
8481
  if (!n)
8482
- return null;
8482
+ return console.log("LOG: q select variant no option"), null;
8483
8483
  const i = n.variants;
8484
8484
  if (!i)
8485
- return null;
8485
+ return console.log("LOG: q select variant no variants"), null;
8486
8486
  const s = i.length > 1 ? i.find((o) => o.id === e) : i[0];
8487
8487
  if (!s)
8488
- throw new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
8488
+ throw console.log("LOG: q select variant no variant"), new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
8489
8489
  return {
8490
8490
  command: void 0,
8491
8491
  followup: async () => {
8492
- await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
8492
+ console.log("LOG: q select variant follow up"), await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
8493
8493
  a.setMandatoryFulfilled(t.stepName, !0);
8494
8494
  });
8495
8495
  }
8496
8496
  };
8497
8497
  }
8498
8498
  }
8499
- const Hn = new ys();
8499
+ const qn = new ys();
8500
8500
  class Ss {
8501
8501
  constructor() {
8502
8502
  this.shapeFillId = "spiff-fill-shape";
@@ -8695,7 +8695,7 @@ class vs {
8695
8695
  );
8696
8696
  }
8697
8697
  }
8698
- const Es = new vs(), He = (r, t, e, a, n) => {
8698
+ const Es = new vs(), qe = (r, t, e, a, n) => {
8699
8699
  if (t.some((d) => d == null))
8700
8700
  throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
8701
8701
  let i = t.map((d) => d.split(`
@@ -8727,19 +8727,19 @@ const Es = new vs(), He = (r, t, e, a, n) => {
8727
8727
  const o = Et(t.assetUrl), l = o.getFont();
8728
8728
  if (n.size) {
8729
8729
  const u = r / l.unitsPerEm;
8730
- return [i, s] = He(e, a, r, u, o), [n.size, i, s];
8730
+ return [i, s] = qe(e, a, r, u, o), [n.size, i, s];
8731
8731
  }
8732
8732
  const c = 6;
8733
8733
  let d = c - Ve;
8734
8734
  if (a.length > 0) {
8735
8735
  let u = a, h = 0;
8736
8736
  for (; (!n.maxSize || d <= n.maxSize) && u; )
8737
- d += Ve, h = d / l.unitsPerEm, [u, s] = He(e, a, d, h, o);
8737
+ d += Ve, h = d / l.unitsPerEm, [u, s] = qe(e, a, d, h, o);
8738
8738
  }
8739
8739
  d > c && (d -= Ve), n.minSize && d < n.minSize && (d = n.minSize);
8740
8740
  const A = d / l.unitsPerEm;
8741
- return [i, s] = He(e, a, d, A, o), [d, i, s];
8742
- }, qe = 30;
8741
+ return [i, s] = qe(e, a, d, A, o), [d, i, s];
8742
+ }, He = 30;
8743
8743
  class Ie extends Error {
8744
8744
  constructor(t) {
8745
8745
  super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Ie.name;
@@ -8786,12 +8786,14 @@ class bs {
8786
8786
  }
8787
8787
  async init(t, e, a) {
8788
8788
  var i, s, o, l;
8789
+ console.log(`LOG: t (${t.stepName}) init`);
8789
8790
  const n = t.option;
8790
8791
  if (!n)
8791
- return null;
8792
+ return console.log(`LOG: t (${t.stepName}) no option`), null;
8792
8793
  if (a)
8793
- await this.reload(t, e, a);
8794
+ console.log(`LOG: t (${t.stepName}) reload`), await this.reload(t, e, a);
8794
8795
  else {
8796
+ console.log(`LOG: t (${t.stepName}) no reload`);
8795
8797
  const c = this.getDefaultImageFillVariant(t.data), d = (i = c == null ? void 0 : c.asset) == null ? void 0 : i.fileLink, A = d ? await sa(d) : void 0, u = A ? {
8796
8798
  src: A.src,
8797
8799
  height: A.height,
@@ -8827,7 +8829,7 @@ class bs {
8827
8829
  });
8828
8830
  const f = Y.getDefaultVariant(n);
8829
8831
  if (f)
8830
- return this.selectVariantCommand(
8832
+ return console.log(`LOG: t (${t.stepName}) variant`), this.selectVariantCommand(
8831
8833
  t,
8832
8834
  f,
8833
8835
  { text: g },
@@ -8841,10 +8843,10 @@ class bs {
8841
8843
  m
8842
8844
  );
8843
8845
  }
8844
- return null;
8846
+ return console.log(`LOG: t (${t.stepName}) end`), null;
8845
8847
  }
8846
8848
  findLayoutElements(t, e) {
8847
- return t.getRegionElements(e.stepName).map((i) => L(i.id, t.getAllLayoutData()));
8849
+ return t.getRegionElements(e.stepName).map((i) => U(i.id, t.getAllLayoutData()));
8848
8850
  }
8849
8851
  /**
8850
8852
  * Get the colors that can be used for a given text step.
@@ -9040,10 +9042,12 @@ class bs {
9040
9042
  a.serializableWorkflow.steps
9041
9043
  ), o = Object.values(a.layouts).map((m) => m.elements).flat().filter((m) => m.stepName === t.stepName), l = t.option;
9042
9044
  if (n != null && n.selectedVariants) {
9045
+ console.log(`LOG: text (${t.stepName}) reload selections`);
9043
9046
  const m = n.selectedVariants[0].id;
9044
9047
  if (l && m) {
9045
9048
  const g = (c = l.variants) == null ? void 0 : c.find((p) => p.id === m);
9046
9049
  if (g) {
9050
+ console.log(`LOG: text (${t.stepName}) reload selections variant`);
9047
9051
  const p = await this.fontDataFromVariant(g), f = o.map((y) => ({ id: y.id, region: y.stepRegion })), C = (d = n.storage) == null ? void 0 : d.color;
9048
9052
  let w = (A = n.storage) == null ? void 0 : A.text;
9049
9053
  const S = e.getWorkflowExperience().getBundle();
@@ -9067,8 +9071,10 @@ class bs {
9067
9071
  e.getCommandDispatcher()(E);
9068
9072
  }
9069
9073
  ), o.length === 0 && l) {
9074
+ console.log(`LOG: text (${t.stepName}) reload cond`);
9070
9075
  const y = Y.getDefaultVariant(l);
9071
9076
  if (y) {
9077
+ console.log(`LOG: text (${t.stepName}) reload cond default`);
9072
9078
  const E = await this.selectVariantCommand(
9073
9079
  t,
9074
9080
  y,
@@ -9083,6 +9089,7 @@ class bs {
9083
9089
  e.getCommandDispatcher()(E.command);
9084
9090
  }
9085
9091
  } else {
9092
+ console.log(`LOG: text (${t.stepName}) reload noncond`);
9086
9093
  const { command: y } = j.updateInputText(
9087
9094
  w || "",
9088
9095
  o,
@@ -9094,6 +9101,7 @@ class bs {
9094
9101
  }
9095
9102
  }
9096
9103
  } else {
9104
+ console.log(`LOG: text (${t.stepName}) reload else`);
9097
9105
  const m = e.getWorkflowExperience().getBundle();
9098
9106
  if (m && t.globalPropertyAspectConfigurations) {
9099
9107
  const g = (h = m.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = g == null ? void 0 : g.find((f) => {
@@ -9101,9 +9109,11 @@ class bs {
9101
9109
  return f.type === G.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9102
9110
  });
9103
9111
  if (p) {
9112
+ console.log(`LOG: text (${t.stepName}) reload else aspect`);
9104
9113
  const C = m.getGlobalPropertyStateManager().getAspect(p.name);
9105
9114
  if (C)
9106
9115
  if (o.length === 0 && l) {
9116
+ console.log(`LOG: text (${t.stepName}) reload else aspect text a`);
9107
9117
  const w = Y.getDefaultVariant(l);
9108
9118
  if (w) {
9109
9119
  const S = await this.selectVariantCommand(
@@ -9120,6 +9130,7 @@ class bs {
9120
9130
  e.getCommandDispatcher()(S.command);
9121
9131
  }
9122
9132
  } else {
9133
+ console.log(`LOG: text (${t.stepName}) reload else aspect text b`);
9123
9134
  const { command: w } = j.updateInputText(
9124
9135
  C,
9125
9136
  o,
@@ -9160,7 +9171,7 @@ class bs {
9160
9171
  throw new vt(t);
9161
9172
  const a = e.fileLink;
9162
9173
  if (!a)
9163
- throw new qt(e);
9174
+ throw new Ht(e);
9164
9175
  const n = await Nt(a);
9165
9176
  return {
9166
9177
  assetUrl: a,
@@ -9184,7 +9195,7 @@ class bs {
9184
9195
  }
9185
9196
  const m = await this.changeInputTextWithRegion(
9186
9197
  t,
9187
- t.data.size || qe,
9198
+ t.data.size || He,
9188
9199
  A,
9189
9200
  a.text || "",
9190
9201
  a,
@@ -9209,7 +9220,7 @@ class bs {
9209
9220
  i
9210
9221
  ), m = await this.changeInputTextWithRegion(
9211
9222
  t,
9212
- t.data.size || qe,
9223
+ t.data.size || He,
9213
9224
  A,
9214
9225
  ((u = h[0]) == null ? void 0 : u.newElement.input) || a.text || t.data.defaultText || "",
9215
9226
  a,
@@ -9271,7 +9282,7 @@ class bs {
9271
9282
  stepName: t,
9272
9283
  align: this.textAlign(a),
9273
9284
  fill: i.color ? i.color : w,
9274
- fontSize: a.size || qe,
9285
+ fontSize: a.size || He,
9275
9286
  fontData: n,
9276
9287
  id: m,
9277
9288
  layer: A.layer,
@@ -9326,7 +9337,7 @@ class bs {
9326
9337
  }, d = await Promise.all(a.regions.map(c)).catch((A) => {
9327
9338
  throw A instanceof Ie ? (Es.setLatestToast("Failed to load font.", Re.Error), A) : A instanceof Pe ? A : new Error(A);
9328
9339
  });
9329
- return await s.setSelectionsAndElements(
9340
+ return console.log(`LOG: step (${t}) created ${d.length} new text elements for ${a.regions.length} regions`), await s.setSelectionsAndElements(
9330
9341
  t,
9331
9342
  [e],
9332
9343
  d.map((A) => A.regionElement),
@@ -9436,7 +9447,7 @@ function Ms(r, t, e, a) {
9436
9447
  const n = e / r, i = a / t;
9437
9448
  return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
9438
9449
  }
9439
- const Ha = {
9450
+ const qa = {
9440
9451
  m: ["x", "y"],
9441
9452
  z: [],
9442
9453
  l: ["x", "y"],
@@ -9466,7 +9477,7 @@ class Ts {
9466
9477
  const n = (i) => {
9467
9478
  const s = [], o = i.relative ? i.type : i.type.toUpperCase();
9468
9479
  let l = e !== o;
9469
- const c = Ha[i.type];
9480
+ const c = qa[i.type];
9470
9481
  l && (s.push(o), e = o);
9471
9482
  for (const d of c) {
9472
9483
  const A = i[d];
@@ -9491,7 +9502,7 @@ class Ts {
9491
9502
  const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
9492
9503
  let i;
9493
9504
  for (e.lastIndex = 0; i = e.exec(t); ) {
9494
- const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = Ha[s];
9505
+ const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = qa[s];
9495
9506
  if (o.length < c.length)
9496
9507
  throw new xt(
9497
9508
  `Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
@@ -9557,7 +9568,7 @@ class Ns extends Is {
9557
9568
  return this.svgElement(t, e);
9558
9569
  }
9559
9570
  svgElement(t, e) {
9560
- const a = qi(Ps), i = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, d = s.toPathData(3), A = () => {
9571
+ const a = Hi(Ps), i = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, d = s.toPathData(3), A = () => {
9561
9572
  const w = et("g");
9562
9573
  w.classList.add("module-text-group");
9563
9574
  const S = et("defs");
@@ -9588,7 +9599,7 @@ class Ns extends Is {
9588
9599
  return ks(p, C, e.height, e.width, 0.35, 0.65), Fs(u.outerHTML);
9589
9600
  }
9590
9601
  }
9591
- async function qn(r) {
9602
+ async function Hn(r) {
9592
9603
  if (r === "Vegemite")
9593
9604
  return new Ns();
9594
9605
  throw new z(`Failed to resolve Module, Module ${r} not found`);
@@ -9765,7 +9776,7 @@ const ne = v`
9765
9776
  }
9766
9777
  }
9767
9778
  }
9768
- `, Us = (r) => v`
9779
+ `, Ls = (r) => v`
9769
9780
  ${ne}
9770
9781
  ${re(r)}
9771
9782
  query GetBundle($id: String!) {
@@ -9809,7 +9820,7 @@ const ne = v`
9809
9820
  quoteId
9810
9821
  }
9811
9822
  }
9812
- `, qa = v`
9823
+ `, Ha = v`
9813
9824
  query GetBundleStakeholders($id: String!) {
9814
9825
  bundles(ids: [$id]) {
9815
9826
  id
@@ -9854,7 +9865,7 @@ const ne = v`
9854
9865
  }
9855
9866
  }
9856
9867
  }
9857
- `, Ls = v`
9868
+ `, Us = v`
9858
9869
  query GetBundlesForCustomer($id: String!) {
9859
9870
  customers(ids: [$id]) {
9860
9871
  bundleStakeholders {
@@ -10015,7 +10026,7 @@ const ne = v`
10015
10026
  }
10016
10027
  }
10017
10028
  }
10018
- `, Hs = v`
10029
+ `, qs = v`
10019
10030
  mutation UpdateBundle(
10020
10031
  $id: String!
10021
10032
  $name: String
@@ -10035,7 +10046,7 @@ const ne = v`
10035
10046
  id
10036
10047
  }
10037
10048
  }
10038
- `, qs = v`
10049
+ `, Hs = v`
10039
10050
  mutation BundleAddTransaction($id: String!, $transactionId: String!) {
10040
10051
  bundleAddTransaction(id: $id, transactionId: $transactionId) {
10041
10052
  id
@@ -10283,11 +10294,10 @@ class mo {
10283
10294
  var w;
10284
10295
  this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10285
10296
  var E;
10286
- if (console.log("LOG: render layouts"), !this.previewService)
10297
+ if (!this.previewService)
10287
10298
  return;
10288
- console.log("LOG: render layouts: service exists");
10289
10299
  const S = this.getCommandContext().getAllLayouts(), y = (E = this.getLayoutPreviewService()) == null ? void 0 : E.getAll();
10290
- if (console.log(`LOG: render layouts: ${y == null ? void 0 : y.size} handles`), !!y)
10300
+ if (y)
10291
10301
  for (const [, B] of y)
10292
10302
  B.render(S);
10293
10303
  }, 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, (w = this.renderableContextService) == null || w.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((S) => {
@@ -10394,7 +10404,7 @@ class mo {
10394
10404
  };
10395
10405
  this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
10396
10406
  this.storage[o.stepName] = o.storage || {};
10397
- }), this.allScenes = await Ui(t);
10407
+ }), this.allScenes = await Li(t);
10398
10408
  const n = Dt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
10399
10409
  this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
10400
10410
  }
@@ -10850,6 +10860,9 @@ class mo {
10850
10860
  })
10851
10861
  ), this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, await this.ensureStepsAreLoaded();
10852
10862
  }
10863
+ unsetInitialized() {
10864
+ this.stepInitialised = {};
10865
+ }
10853
10866
  async setSelectionsAndElements(t, e, a, n) {
10854
10867
  var y;
10855
10868
  const i = this.stepSelections;
@@ -10895,8 +10908,9 @@ class mo {
10895
10908
  }
10896
10909
  async ensureStepsAreLoaded() {
10897
10910
  const e = Dt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
10911
+ console.log(`LOG: ensure ${n.length} steps loaded`);
10898
10912
  for (const l of n)
10899
- if (!this.stepInitialised[l.stepName])
10913
+ if (l.stepTitle === "Top Card Message" && console.log(`LOG: is ${l.stepTitle} (${l.stepName}) inited? ${this.stepInitialised[l.stepName]}`), !this.stepInitialised[l.stepName])
10900
10914
  switch (this.stepInitialised[l.stepName] = !0, l.type) {
10901
10915
  case P.DigitalContent:
10902
10916
  a.push(
@@ -10925,7 +10939,7 @@ class mo {
10925
10939
  break;
10926
10940
  case P.Module:
10927
10941
  this.stepSpecificServices[l.stepName] = {
10928
- module: await qn(l.data.module)
10942
+ module: await Hn(l.data.module)
10929
10943
  }, a.push(
10930
10944
  Wn.init(l, this, this.reloadedState)
10931
10945
  );
@@ -10937,14 +10951,14 @@ class mo {
10937
10951
  break;
10938
10952
  case P.Question:
10939
10953
  a.push(
10940
- Hn.init(l, this, this.reloadedState)
10954
+ qn.init(l, this, this.reloadedState)
10941
10955
  );
10942
10956
  break;
10943
10957
  case P.Shape:
10944
10958
  a.push(Gt.init(l, this, this.reloadedState));
10945
10959
  break;
10946
10960
  case P.Text:
10947
- a.push(j.init(l, this, this.reloadedState));
10961
+ console.log("LOG: ensure text loaded"), a.push(j.init(l, this, this.reloadedState));
10948
10962
  break;
10949
10963
  }
10950
10964
  const i = (await Promise.allSettled(a)).map((l) => {
@@ -11251,7 +11265,7 @@ class go extends it {
11251
11265
  const t = this.manager.getRegionElements(this.step.stepName) || [];
11252
11266
  if (t.length === 0)
11253
11267
  return;
11254
- const a = L(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
11268
+ const a = U(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
11255
11269
  if (s.length !== 0) {
11256
11270
  const l = {};
11257
11271
  return s.forEach((c) => {
@@ -11352,7 +11366,7 @@ class wo extends it {
11352
11366
  async selectVariant(t) {
11353
11367
  if (!t.getId())
11354
11368
  throw new Error("Unable to select variant with a null ID");
11355
- await Hn.selectVariant(this.step, t.getId(), this.manager);
11369
+ await qn.selectVariant(this.step, t.getId(), this.manager);
11356
11370
  }
11357
11371
  /**
11358
11372
  * The way that this step expects to be rendered.
@@ -11985,22 +11999,22 @@ const Po = async (r, t) => {
11985
11999
  for (const T of Object.keys(i)) {
11986
12000
  const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
11987
12001
  for (let tt = 0; tt < nt.selections.length; ++tt) {
11988
- const H = nt.selections[tt];
12002
+ const q = nt.selections[tt];
11989
12003
  if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
11990
12004
  const ft = R.stepTitle;
11991
12005
  x[ft] ? x[ft].push({
11992
- id: H.id || "",
11993
- name: H.name,
11994
- priceModifier: H.priceModifier
12006
+ id: q.id || "",
12007
+ name: q.name,
12008
+ priceModifier: q.priceModifier
11995
12009
  }) : x[ft] = [
11996
12010
  {
11997
- id: H.id || "",
11998
- name: H.name,
11999
- priceModifier: H.priceModifier
12011
+ id: q.id || "",
12012
+ name: q.name,
12013
+ priceModifier: q.priceModifier
12000
12014
  }
12001
12015
  ];
12002
12016
  }
12003
- k += H.priceModifier;
12017
+ k += q.priceModifier;
12004
12018
  }
12005
12019
  }
12006
12020
  return [x, k];
@@ -12015,7 +12029,7 @@ const Po = async (r, t) => {
12015
12029
  let E = await o(m, n.id);
12016
12030
  if (E) {
12017
12031
  const D = await (await rt(E)).blob();
12018
- E = (await U.uploadAsset(
12032
+ E = (await L.uploadAsset(
12019
12033
  { name: `${n.id}-preview-image.png`, blob: D },
12020
12034
  Ce.Image,
12021
12035
  !0,
@@ -12373,7 +12387,7 @@ class Oo {
12373
12387
  throw new xe("Failed to obtain 2D context for preview image creation");
12374
12388
  const m = Sa(u.layoutState.layout, u.layoutState.elements, {
12375
12389
  renderingConfiguration: {
12376
- purpose: Ht.Print,
12390
+ purpose: qt.Print,
12377
12391
  region: { left: A.x, top: A.y, width: A.width, height: A.height },
12378
12392
  templatingContext: this.workflowManager.getTemplatingContext()
12379
12393
  }
@@ -12683,7 +12697,7 @@ const $o = [
12683
12697
  "textPath",
12684
12698
  "tref",
12685
12699
  "tspan"
12686
- ], Uo = async (r, t, e) => {
12700
+ ], Lo = async (r, t, e) => {
12687
12701
  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);
12688
12702
  o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12689
12703
  const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await sn(l, { type: "svg" }))}`, A = (h) => {
@@ -12710,7 +12724,7 @@ const $o = [
12710
12724
  } catch (h) {
12711
12725
  return console.error(h), [];
12712
12726
  }
12713
- }, Lo = async (r, t, e, a) => {
12727
+ }, Uo = async (r, t, e, a) => {
12714
12728
  const n = e.data, i = n.assetUrl, s = await sa(i);
12715
12729
  try {
12716
12730
  const o = is(n, a.option);
@@ -12838,7 +12852,7 @@ const $o = [
12838
12852
  return console.error(B), [];
12839
12853
  }
12840
12854
  }, Go = async (r, t, e) => {
12841
- const a = await qn(e.data.module), n = t.data, i = (o, l) => {
12855
+ const a = await Hn(e.data.module), n = t.data, i = (o, l) => {
12842
12856
  const c = r.find((A) => A.panelId === l.panelId);
12843
12857
  if (!c)
12844
12858
  throw new J(l);
@@ -13033,7 +13047,7 @@ const $o = [
13033
13047
  });
13034
13048
  }
13035
13049
  return a;
13036
- }, Ho = async (r, t, e, a) => {
13050
+ }, qo = async (r, t, e, a) => {
13037
13051
  const n = [], i = e.data, s = 30, o = (p) => p.vertical ? "center" : p.textAlign || "center", l = () => {
13038
13052
  var w;
13039
13053
  const p = a.option;
@@ -13122,7 +13136,7 @@ const $o = [
13122
13136
  n.push(new W(C, f));
13123
13137
  }
13124
13138
  return n;
13125
- }, qo = (r, t) => r.conditions ? r.conditions.every((e) => {
13139
+ }, Ho = (r, t) => r.conditions ? r.conditions.every((e) => {
13126
13140
  const a = t[e.targetStepName];
13127
13141
  if (a && a.selectedVariants) {
13128
13142
  const n = a.selectedVariants;
@@ -13139,13 +13153,13 @@ const $o = [
13139
13153
  switch (o.type) {
13140
13154
  case P.DigitalContent:
13141
13155
  n.push(
13142
- ...await Uo(e, s, o)
13156
+ ...await Lo(e, s, o)
13143
13157
  );
13144
13158
  break;
13145
13159
  case P.Frame:
13146
13160
  case P.Photo:
13147
13161
  n.push(
13148
- ...await Lo(e, i, s, o)
13162
+ ...await Uo(e, i, s, o)
13149
13163
  );
13150
13164
  break;
13151
13165
  case P.Illustration:
@@ -13173,13 +13187,13 @@ const $o = [
13173
13187
  break;
13174
13188
  case P.Text:
13175
13189
  n.push(
13176
- ...await Ho(e, i, s, o)
13190
+ ...await qo(e, i, s, o)
13177
13191
  );
13178
13192
  break;
13179
13193
  }
13180
13194
  }
13181
13195
  for (const s of t.steps)
13182
- s.type !== P.SilentIllustration && s.type !== P.ProductOverlay || qo(s, i) && n.push(
13196
+ s.type !== P.SilentIllustration && s.type !== P.ProductOverlay || Ho(s, i) && n.push(
13183
13197
  ...await jo(e, s, a)
13184
13198
  );
13185
13199
  return n;
@@ -13347,7 +13361,7 @@ class Zo extends Dn {
13347
13361
  l = i.width, c = i.height;
13348
13362
  const d = Sa(t.layoutState.layout, e, {
13349
13363
  renderingConfiguration: {
13350
- purpose: Ht.ThreeD,
13364
+ purpose: qt.ThreeD,
13351
13365
  templatingContext: (m = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : m.getTemplatingContext()
13352
13366
  }
13353
13367
  }), A = un(d), u = await Aa.from(this.ctx, A, {
@@ -13381,7 +13395,7 @@ const Xc = (r, t) => {
13381
13395
  serializableWorkflow: { steps: [] },
13382
13396
  layouts: {}
13383
13397
  };
13384
- n = new $(e.map((l) => new Un(l))).apply(n);
13398
+ n = new $(e.map((l) => new Ln(l))).apply(n);
13385
13399
  const s = await Yo(r, t, e, a);
13386
13400
  return new $(s).apply(n);
13387
13401
  };
@@ -13486,18 +13500,16 @@ class Ia {
13486
13500
  * Returns all steps that share this property.
13487
13501
  * @param targetExperiences Optionally filter the steps to only those in the given experiences.
13488
13502
  */
13489
- getSharedSteps(t) {
13490
- return (t ?? this.bundle.getWorkflowExperiences()).flatMap(
13491
- (n) => n.getStepsConditionallyActive().filter((i) => {
13492
- var s;
13493
- return i.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (s = i.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : s.some(
13494
- (o) => {
13495
- var l, c;
13496
- return o.globalPropertyConfigurationId === ((c = (l = this.bundle.getProductCollection()) == null ? void 0 : l.getResource().globalPropertyConfiguration) == null ? void 0 : c.id) && o.aspectName === this.property.name;
13497
- }
13498
- );
13499
- })
13500
- );
13503
+ getSharedSteps(t, e) {
13504
+ return (t ?? this.bundle.getWorkflowExperiences()).flatMap((i) => (e ? i.getSteps() : i.getStepsConditionallyActive()).filter((o) => {
13505
+ var l;
13506
+ return o.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (l = o.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : l.some(
13507
+ (c) => {
13508
+ var d, A;
13509
+ return c.globalPropertyConfigurationId === ((A = (d = this.bundle.getProductCollection()) == null ? void 0 : d.getResource().globalPropertyConfiguration) == null ? void 0 : A.id) && c.aspectName === this.property.name;
13510
+ }
13511
+ );
13512
+ }));
13501
13513
  }
13502
13514
  getStateValue() {
13503
13515
  return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
@@ -13569,7 +13581,7 @@ class el extends Ia {
13569
13581
  const e = await this.getOriginalImage();
13570
13582
  if (!e)
13571
13583
  throw new Error("You must supply an image selection before attempting to remove the background.");
13572
- const a = this.bundle.getGlobalPropertyStateManager(), n = await U.removeBackgroundFromAsset(e), s = {
13584
+ const a = this.bundle.getGlobalPropertyStateManager(), n = await L.removeBackgroundFromAsset(e), s = {
13573
13585
  ...a.getAspectStorage(this.property.name),
13574
13586
  backgroundRemovedAssetKey: n.key,
13575
13587
  useOriginalAsset: !t
@@ -13589,7 +13601,7 @@ class el extends Ia {
13589
13601
  async getImage() {
13590
13602
  const t = this.getStateValue();
13591
13603
  if (t)
13592
- return U.getLocalOrFromServer(t);
13604
+ return L.getLocalOrFromServer(t);
13593
13605
  }
13594
13606
  async getImageWithColors() {
13595
13607
  var t, e;
@@ -13602,7 +13614,7 @@ class el extends Ia {
13602
13614
  async getOriginalImage() {
13603
13615
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13604
13616
  if (t != null && t.originalAssetKey)
13605
- return U.getLocalOrFromServer(t.originalAssetKey);
13617
+ return L.getLocalOrFromServer(t.originalAssetKey);
13606
13618
  }
13607
13619
  /**
13608
13620
  * Retrieves the version of the image selection that has the background removed, if one exists.
@@ -13611,7 +13623,7 @@ class el extends Ia {
13611
13623
  async getBackgroundRemovedImage() {
13612
13624
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13613
13625
  if (t != null && t.backgroundRemovedAssetKey)
13614
- return U.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13626
+ return L.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13615
13627
  }
13616
13628
  getUseOriginalImage() {
13617
13629
  var t;
@@ -13643,26 +13655,26 @@ class el extends Ia {
13643
13655
  }
13644
13656
  o.push(this.loadImageData()), await Promise.all(o), this.updateSharedStepStorage(i);
13645
13657
  }
13646
- async applyGlobalState(t) {
13647
- const e = this.getStateValue();
13648
- if (!e)
13649
- return;
13650
- const a = await U.getLocalOrFromServer(e);
13658
+ async applyGlobalState(t, e) {
13659
+ const a = this.getStateValue();
13651
13660
  if (!a)
13652
13661
  return;
13653
- await this.applyImageSelection(a, t, !1, !0);
13654
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13655
- if (n) {
13656
- if (this.updateSharedStepStorage({ ...n }), n.colors) {
13657
- const i = new Map(
13658
- n.colors.map((s) => [s.key, { browserValue: s.browserValue, pmsValue: s.pmsValue }]) ?? []
13662
+ const n = await L.getLocalOrFromServer(a);
13663
+ if (!n)
13664
+ return;
13665
+ await this.applyImageSelection(n, t, !1, !0);
13666
+ const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13667
+ if (i) {
13668
+ if (this.updateSharedStepStorage({ ...i }), i.colors) {
13669
+ const s = new Map(
13670
+ i.colors.map((o) => [o.key, { browserValue: o.browserValue, pmsValue: o.pmsValue }]) ?? []
13659
13671
  );
13660
- this.getSharedSteps(t).forEach((s) => {
13661
- s.changeColors(i);
13672
+ this.getSharedSteps(t, e).forEach((o) => {
13673
+ o.changeColors(s);
13662
13674
  });
13663
13675
  }
13664
13676
  } else
13665
- this.updateSharedStepStorage({ originalAssetKey: e }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: e });
13677
+ this.updateSharedStepStorage({ originalAssetKey: a }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: a });
13666
13678
  }
13667
13679
  getAvailableColors() {
13668
13680
  var t, e, a, n;
@@ -13689,22 +13701,22 @@ class el extends Ia {
13689
13701
  var e;
13690
13702
  return (e = this.imageData) != null && e.svg ? (await lt(this.imageData.svg)).colors : void 0;
13691
13703
  }
13692
- async changeColors(t) {
13693
- var i;
13694
- if (!((i = this.imageData) != null && i.svg))
13704
+ async changeColors(t, e) {
13705
+ var s;
13706
+ if (!((s = this.imageData) != null && s.svg))
13695
13707
  return;
13696
- const e = this.getSharedSteps(), a = new Map(Object.entries(t));
13697
- e.forEach((s) => {
13698
- s.changeColors(a);
13708
+ const a = this.getSharedSteps(void 0, e), n = new Map(Object.entries(t));
13709
+ a.forEach((o) => {
13710
+ o.changeColors(n);
13699
13711
  });
13700
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13712
+ const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13701
13713
  await Promise.all([
13702
13714
  this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, {
13703
- ...n,
13704
- colors: Object.entries(t).map(([s, o]) => ({
13705
- key: s,
13706
- browserValue: o.browserValue,
13707
- pmsValue: o.pmsValue
13715
+ ...i,
13716
+ colors: Object.entries(t).map(([o, l]) => ({
13717
+ key: o,
13718
+ browserValue: l.browserValue,
13719
+ pmsValue: l.pmsValue
13708
13720
  }))
13709
13721
  }),
13710
13722
  await this.loadImageData()
@@ -13754,10 +13766,10 @@ class al extends Ia {
13754
13766
  /**
13755
13767
  * Set the text.
13756
13768
  */
13757
- async setText(t) {
13769
+ async setText(t, e) {
13758
13770
  await Promise.all([
13759
13771
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
13760
- this.applyTextSelection(t)
13772
+ this.applyTextSelection(t, void 0, e)
13761
13773
  ]);
13762
13774
  }
13763
13775
  async applyGlobalState(t) {
@@ -13766,13 +13778,11 @@ class al extends Ia {
13766
13778
  return Promise.resolve();
13767
13779
  await this.applyTextSelection(e, t);
13768
13780
  }
13769
- async applyTextSelection(t, e) {
13770
- const a = this.getSharedSteps(e);
13771
- console.log(`LOG: ${a.length} shared steps`);
13772
- const n = a.map((i) => {
13773
- i.setText(t);
13781
+ async applyTextSelection(t, e, a) {
13782
+ const i = this.getSharedSteps(e, a).map((s) => {
13783
+ s.setText(t);
13774
13784
  });
13775
- await Promise.all(n);
13785
+ await Promise.all(i);
13776
13786
  }
13777
13787
  }
13778
13788
  class Xn extends Ia {
@@ -13831,10 +13841,10 @@ class Xn extends Ia {
13831
13841
  * Select a given variant on the option for all shared steps.
13832
13842
  * @param variant The variant to select.
13833
13843
  */
13834
- async selectVariant(t, e) {
13844
+ async selectVariant(t, e, a) {
13835
13845
  await Promise.all([
13836
13846
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
13837
- this.applyVariantSelection(t)
13847
+ this.applyVariantSelection(t, void 0, a)
13838
13848
  ]);
13839
13849
  }
13840
13850
  async applyGlobalState(t) {
@@ -13845,9 +13855,9 @@ class Xn extends Ia {
13845
13855
  const a = (i = (n = this.optionResource) == null ? void 0 : n.variants) == null ? void 0 : i.find((s) => s.id === e);
13846
13856
  return a ? this.applyVariantSelection(new st(a), t) : Promise.resolve();
13847
13857
  }
13848
- async applyVariantSelection(t, e) {
13849
- const n = this.getSharedSteps(e).map((i) => i.selectVariant(t));
13850
- await Promise.all(n);
13858
+ async applyVariantSelection(t, e, a) {
13859
+ const i = this.getSharedSteps(e, a).map((s) => s.selectVariant(t));
13860
+ await Promise.all(i);
13851
13861
  }
13852
13862
  }
13853
13863
  class Ja extends Xn {
@@ -13896,8 +13906,8 @@ class Ja extends Xn {
13896
13906
  /**
13897
13907
  * Sets a custom color on the global state.
13898
13908
  */
13899
- setCustomColor(t) {
13900
- this.getSharedSteps().forEach((a) => a.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
13909
+ setCustomColor(t, e) {
13910
+ this.getSharedSteps(void 0, e).forEach((n) => n.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
13901
13911
  }
13902
13912
  /**
13903
13913
  * Gets the custom color used by the global state.
@@ -14859,10 +14869,11 @@ class Je {
14859
14869
  async applyGlobalPropertyState(t) {
14860
14870
  var a;
14861
14871
  const e = await this.globalPropertyHandleService.getHandles();
14862
- console.log(`LOG: ${e.length} handles`);
14863
14872
  for (const n of t.aspects) {
14873
+ for (const o of this.workflowExperiences)
14874
+ o.getWorkflowManager().unsetInitialized();
14864
14875
  const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
14865
- if (console.log(`LOG: handle for ${i}? ${s}`), s)
14876
+ if (s)
14866
14877
  switch (n.type) {
14867
14878
  case G.FileUpload: {
14868
14879
  const o = s, l = await ve([n.value]);
@@ -14872,7 +14883,7 @@ class Je {
14872
14883
  const d = Object.fromEntries(
14873
14884
  c.map((A) => [A.key, { browserValue: A.browserValue, pmsValue: A.pmsValue }]) ?? []
14874
14885
  );
14875
- await o.changeColors(d);
14886
+ await o.changeColors(d, !0);
14876
14887
  }
14877
14888
  break;
14878
14889
  }
@@ -14882,16 +14893,16 @@ class Je {
14882
14893
  const c = o.getAllVariants().find((d) => d.getId() === n.value);
14883
14894
  c && await o.selectVariant(c);
14884
14895
  } else
14885
- o.setCustomColor(n.value);
14896
+ o.setCustomColor(n.value, !0);
14886
14897
  break;
14887
14898
  }
14888
14899
  case G.Option: {
14889
14900
  const o = s, c = o.getAllVariants().find((d) => d.getId() === n.value);
14890
- console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c);
14901
+ console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c, void 0, !0);
14891
14902
  break;
14892
14903
  }
14893
14904
  case G.Text: {
14894
- console.log(`LOG: text ${n.value}`), await s.setText(n.value);
14905
+ console.log(`LOG: text ${n.value}`), await s.setText(n.value, !0);
14895
14906
  break;
14896
14907
  }
14897
14908
  }
@@ -14988,7 +14999,7 @@ class Je {
14988
14999
  throw new Error("Unable to add transaction to bundle - Already Exists!");
14989
15000
  const s = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(a);
14990
15001
  await b.getShadowGraphqlClient().mutate({
14991
- mutation: qs,
15002
+ mutation: Hs,
14992
15003
  variables: {
14993
15004
  id: this.id,
14994
15005
  transactionId: a
@@ -15171,7 +15182,7 @@ class Je {
15171
15182
  }
15172
15183
  async getAllStakeholders() {
15173
15184
  const t = await b.getShadowGraphqlClient().query({
15174
- query: qa,
15185
+ query: Ha,
15175
15186
  errorPolicy: "all",
15176
15187
  fetchPolicy: "no-cache",
15177
15188
  variables: {
@@ -15188,7 +15199,7 @@ class Je {
15188
15199
  }
15189
15200
  async getCurrentStakeholder() {
15190
15201
  const t = await b.getShadowGraphqlClient().query({
15191
- query: qa,
15202
+ query: Ha,
15192
15203
  errorPolicy: "all",
15193
15204
  fetchPolicy: "no-cache",
15194
15205
  variables: {
@@ -15343,7 +15354,7 @@ class Je {
15343
15354
  async updateBundle() {
15344
15355
  var e;
15345
15356
  if (!((e = (await b.getShadowGraphqlClient().mutate({
15346
- mutation: Hs,
15357
+ mutation: qs,
15347
15358
  variables: {
15348
15359
  id: this.id,
15349
15360
  name: this.name,
@@ -15843,7 +15854,7 @@ class Il {
15843
15854
  ));
15844
15855
  }
15845
15856
  }
15846
- const Lt = new Il(), Pl = async (r, t) => {
15857
+ const Ut = new Il(), Pl = async (r, t) => {
15847
15858
  var n;
15848
15859
  const e = await b.getShadowGraphqlClient().query({
15849
15860
  query: ki(((n = t == null ? void 0 : t.assets) == null ? void 0 : n.metadata) || !1),
@@ -15862,8 +15873,8 @@ const Lt = new Il(), Pl = async (r, t) => {
15862
15873
  return a.forEach((i) => {
15863
15874
  i.steps.forEach((s) => {
15864
15875
  var o, l, c;
15865
- delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && U.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && U.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
15866
- d.asset && U.cacheAsset(d.asset), d.thumbnail && U.cacheAsset(d.thumbnail), d.material && U.cacheMaterial(d.material);
15876
+ delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && L.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && L.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
15877
+ d.asset && L.cacheAsset(d.asset), d.thumbnail && L.cacheAsset(d.thumbnail), d.material && L.cacheMaterial(d.material);
15867
15878
  }), Jt.set({ id: s.option.id }, Promise.resolve(s.option)));
15868
15879
  }), i.finalizeStepConfig || (i.finalizeStepConfig = {}), i.finalizeStepConfig.termsMarkdown = i.finalizeStepConfig.termsMarkdown || i.partner.termsMarkdown;
15869
15880
  }), a;
@@ -15909,17 +15920,17 @@ class rd {
15909
15920
  } catch (a) {
15910
15921
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15911
15922
  }
15912
- }, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.dabb7794-c627-5751-8578-07b1311c272c"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15923
+ }, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.0994c120-6a24-5eff-b92b-5baef3c4caf9"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15913
15924
  }
15914
15925
  configure(t) {
15915
- mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.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 && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15926
+ mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.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 && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15916
15927
  }
15917
15928
  /**
15918
15929
  * @returns The asset manager allows for common operations related to assets
15919
15930
  * and the Spiff Commerce platform.
15920
15931
  */
15921
15932
  getAssetManager() {
15922
- return U;
15933
+ return L;
15923
15934
  }
15924
15935
  getCurrencyCode() {
15925
15936
  if (this.currencyCode === void 0)
@@ -16119,7 +16130,7 @@ class rd {
16119
16130
  return !1;
16120
16131
  const n = JSON.parse(e), i = (/* @__PURE__ */ new Date()).getTime() / 1e3;
16121
16132
  if (!n.ExpiresIn || n.ExpiresIn < i - parseInt(t)) {
16122
- const l = await Lt.refreshTokens();
16133
+ const l = await Ut.refreshTokens();
16123
16134
  if (l != null && l.AuthenticationResult)
16124
16135
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), n.AccessToken = l.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(n));
16125
16136
  else
@@ -16144,14 +16155,14 @@ class rd {
16144
16155
  variables: {
16145
16156
  emailAddress: t
16146
16157
  }
16147
- }), await Lt.generateCode(t);
16158
+ }), await Ut.generateCode(t);
16148
16159
  }
16149
16160
  /**
16150
16161
  * Verify an email code to log in as a Spiff user.
16151
16162
  * Always returns true if it doesn't throw.
16152
16163
  */
16153
16164
  async verifyCode(t, e) {
16154
- const a = (await this.getIntegration()).partner.id || "", n = await Lt.verifyCode(t, e, a);
16165
+ const a = (await this.getIntegration()).partner.id || "", n = await Ut.verifyCode(t, e, a);
16155
16166
  if (n != null && n.AuthenticationResult) {
16156
16167
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(n.AuthenticationResult)), localStorage.setItem("cognito-email", t);
16157
16168
  const s = (await b.getShadowGraphqlClient().query({
@@ -16181,7 +16192,7 @@ class rd {
16181
16192
  throw new Error("No token data in storage.");
16182
16193
  const a = JSON.parse(e), n = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !(a != null && a.AccessToken) || Wt(a.AccessToken);
16183
16194
  if (!a.ExpiresIn || a.ExpiresIn < n - parseInt(t) || i) {
16184
- const s = await Lt.refreshTokens();
16195
+ const s = await Ut.refreshTokens();
16185
16196
  if (s != null && s.AuthenticationResult)
16186
16197
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), a.AccessToken = s.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(a));
16187
16198
  else
@@ -16252,7 +16263,7 @@ class rd {
16252
16263
  ...o,
16253
16264
  ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16254
16265
  }, c = await b.getShadowGraphqlClient().query({
16255
- query: Us(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16266
+ query: Ls(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16256
16267
  variables: {
16257
16268
  id: t
16258
16269
  },
@@ -16351,7 +16362,7 @@ class rd {
16351
16362
  if (!this.customer)
16352
16363
  throw new Error("Customer not authenticated.");
16353
16364
  const t = await b.getShadowGraphqlClient().query({
16354
- query: Ls,
16365
+ query: Us,
16355
16366
  variables: {
16356
16367
  id: this.customer.id
16357
16368
  },
@@ -16462,8 +16473,8 @@ class rd {
16462
16473
  singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
16463
16474
  stateMutationFunc: I ? async () => {
16464
16475
  throw new z("State mutation is forbidden in read only mode!");
16465
- } : async (H) => this.updateTransactionState({
16466
- ...H,
16476
+ } : async (q) => this.updateTransactionState({
16477
+ ...q,
16467
16478
  context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
16468
16479
  }),
16469
16480
  graphQlClient: () => nt,
@@ -16472,11 +16483,11 @@ class rd {
16472
16483
  isReloadedTransaction: k.type === "transaction"
16473
16484
  };
16474
16485
  if (k.type === "transaction" && E.workflowState) {
16475
- const H = JSON.parse(E.workflowState);
16476
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await Ga(H), R.reloadedState = H;
16486
+ const q = JSON.parse(E.workflowState);
16487
+ R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
16477
16488
  } else if (!I && k.workflowState) {
16478
- const H = JSON.parse(k.workflowState);
16479
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await Ga(H), R.reloadedState = H;
16489
+ const q = JSON.parse(k.workflowState);
16490
+ R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
16480
16491
  } else
16481
16492
  R.layouts = Fl(
16482
16493
  R.transaction,
@@ -17081,7 +17092,7 @@ class Ql extends it {
17081
17092
  const e = await this.getOriginalImageSelection();
17082
17093
  if (!e)
17083
17094
  throw new Error("You must supply an image selection before attempting to remove the background.");
17084
- const a = await U.removeBackgroundFromAsset(e);
17095
+ const a = await L.removeBackgroundFromAsset(e);
17085
17096
  t && await wt.selectImage(this.step, a, this.manager, !1);
17086
17097
  const n = ((i = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : i.framePatternData) || {};
17087
17098
  return this.manager.updateStorage(this.step.stepName, {
@@ -17140,13 +17151,13 @@ class Ql extends it {
17140
17151
  var e, a;
17141
17152
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.originalAssetKey;
17142
17153
  if (t)
17143
- return U.getLocalOrFromServer(t);
17154
+ return L.getLocalOrFromServer(t);
17144
17155
  }
17145
17156
  async getBackgroundRemovedImageSelection() {
17146
17157
  var e, a;
17147
17158
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.backgroundRemovedAssetKey;
17148
17159
  if (t)
17149
- return U.getLocalOrFromServer(t);
17160
+ return L.getLocalOrFromServer(t);
17150
17161
  }
17151
17162
  hasOriginalImageSelection() {
17152
17163
  var t, e;
@@ -17243,7 +17254,7 @@ const Rl = v`
17243
17254
  workflowViewerLink
17244
17255
  }
17245
17256
  }
17246
- `, Ul = v`
17257
+ `, Ll = v`
17247
17258
  query GetCustomerBundles($id: String!, $limit: Int!, $offset: Int!) {
17248
17259
  customerBundlesFeed(id: $id, limit: $limit, offset: $offset) {
17249
17260
  items {
@@ -17258,7 +17269,7 @@ const Rl = v`
17258
17269
  total
17259
17270
  }
17260
17271
  }
17261
- `, Ll = v`
17272
+ `, Ul = v`
17262
17273
  query GetTransactionsForBundle($id: String!) {
17263
17274
  bundles(ids: [$id]) {
17264
17275
  id
@@ -17342,7 +17353,7 @@ const Rl = v`
17342
17353
  email: r
17343
17354
  }
17344
17355
  })).data.customer, gd = async (r, t, e) => await b.getShadowGraphqlClient().query({
17345
- query: Ul,
17356
+ query: Ll,
17346
17357
  errorPolicy: "all",
17347
17358
  fetchPolicy: "no-cache",
17348
17359
  variables: {
@@ -17351,7 +17362,7 @@ const Rl = v`
17351
17362
  limit: t
17352
17363
  }
17353
17364
  }), pd = async (r, t) => await b.getShadowGraphqlClient().query({
17354
- query: Ll,
17365
+ query: Ul,
17355
17366
  errorPolicy: "all",
17356
17367
  fetchPolicy: "no-cache",
17357
17368
  variables: {
@@ -17463,7 +17474,7 @@ _ = { __e: function(r, t, e, a) {
17463
17474
  throw r;
17464
17475
  } }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
17465
17476
  var ot, Ke, _a, ar = [], _e = [], Xa = _.__b, Za = _.__r, tn = _.diffed, en = _.__c, an = _.unmount;
17466
- function Hl() {
17477
+ function ql() {
17467
17478
  for (var r; r = ar.shift(); )
17468
17479
  if (r.__P && r.__H)
17469
17480
  try {
@@ -17483,7 +17494,7 @@ _.__b = function(r) {
17483
17494
  }, _.diffed = function(r) {
17484
17495
  tn && tn(r);
17485
17496
  var t = r.__c;
17486
- t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) || ql)(Hl)), t.__H.__.forEach(function(e) {
17497
+ t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) || Hl)(ql)), t.__H.__.forEach(function(e) {
17487
17498
  e.i && (e.__H = e.i), e.__V !== _e && (e.__ = e.__V), e.i = void 0, e.__V = _e;
17488
17499
  })), Ke = ot = null;
17489
17500
  }, _.__c = function(r, t) {
@@ -17510,7 +17521,7 @@ _.__b = function(r) {
17510
17521
  }), e.__H = void 0, t && _.__e(t, e.__v));
17511
17522
  };
17512
17523
  var nn = typeof requestAnimationFrame == "function";
17513
- function ql(r) {
17524
+ function Hl(r) {
17514
17525
  var t, e = function() {
17515
17526
  clearTimeout(a), nn && cancelAnimationFrame(t), setTimeout(r);
17516
17527
  }, a = setTimeout(e, 100);
@@ -17658,7 +17669,7 @@ export {
17658
17669
  Ce as AssetType,
17659
17670
  Jc as BringForwardCommand,
17660
17671
  Yc as BringToBackCommand,
17661
- qc as BringToFrontCommand,
17672
+ Hc as BringToFrontCommand,
17662
17673
  yr as BundleDesignCreationCartAddMode,
17663
17674
  O as CanvasCommand,
17664
17675
  de as CollectionProduct,
@@ -17667,7 +17678,7 @@ export {
17667
17678
  jl as ConversionDataType,
17668
17679
  Wl as ConversionLocation,
17669
17680
  W as CreateElementCommand,
17670
- Un as CreateLayoutCommand,
17681
+ Ln as CreateLayoutCommand,
17671
17682
  Bt as DeleteElementCommand,
17672
17683
  Eo as DigitalContentStepHandle,
17673
17684
  el as FileUploadGlobalPropertyHandle,
@@ -17691,7 +17702,7 @@ export {
17691
17702
  Gc as LayoutElementFactory,
17692
17703
  M as LayoutElementType,
17693
17704
  J as LayoutNotFoundError,
17694
- Ht as LayoutRenderingPurpose,
17705
+ qt as LayoutRenderingPurpose,
17695
17706
  po as MaterialStepHandle,
17696
17707
  Se as MisconfigurationError,
17697
17708
  cd as MockWorkflowManager,
@@ -17713,9 +17724,9 @@ export {
17713
17724
  wo as QuestionStepHandle,
17714
17725
  Dn as QueueablePromise,
17715
17726
  jc as ResizeCommand,
17716
- qt as ResourceNotFoundError,
17727
+ Ht as ResourceNotFoundError,
17717
17728
  Wc as RotateCommand,
17718
- q as ScaleAxis,
17729
+ H as ScaleAxis,
17719
17730
  Kc as SendBackwardsCommand,
17720
17731
  yo as ShapeStepHandle,
17721
17732
  Sr as ShareActionType,
@@ -17733,13 +17744,13 @@ export {
17733
17744
  Al as TransformCollection,
17734
17745
  z as UnhandledBehaviorError,
17735
17746
  Br as UnitOfMeasurement,
17736
- Hc as UpdateImageSourceCommand,
17747
+ qc as UpdateImageSourceCommand,
17737
17748
  st as Variant,
17738
17749
  Ro as WorkflowExperienceEventType,
17739
17750
  Oo as WorkflowExperienceImpl,
17740
- U as assetService,
17751
+ L as assetService,
17741
17752
  Kr as browserColorToHex,
17742
- Lc as cmPerPixel,
17753
+ Uc as cmPerPixel,
17743
17754
  Fo as createDesign,
17744
17755
  Oc as currentDirection,
17745
17756
  bc as dataUrlFromExternalUrl,
@@ -17751,7 +17762,7 @@ export {
17751
17762
  hd as duplicateTransaction,
17752
17763
  at as fetchAsString,
17753
17764
  Fc as findAngle,
17754
- L as findElement,
17765
+ U as findElement,
17755
17766
  Dc as findPmsColors,
17756
17767
  Vt as frameDataCache,
17757
17768
  wt as frameStepService,
@@ -17795,7 +17806,7 @@ export {
17795
17806
  Pc as matchHexToPms,
17796
17807
  Gn as materialStepService,
17797
17808
  cl as metafieldManager,
17798
- Uc as mmPerPixel,
17809
+ Lc as mmPerPixel,
17799
17810
  zn as modelStepService,
17800
17811
  Ca as modifySVGColors,
17801
17812
  Wn as moduleStepService,
@@ -17807,11 +17818,11 @@ export {
17807
17818
  N as persistenceService,
17808
17819
  jn as pictureStepService,
17809
17820
  Ic as pmsToRgb,
17810
- Hn as questionStepService,
17821
+ qn as questionStepService,
17811
17822
  Bc as registerFetchImplementation,
17812
17823
  Ec as registerWindowImplementation,
17813
17824
  Ga as rehydrateSerializedLayout,
17814
- qr as rgbToPms,
17825
+ Hr as rgbToPms,
17815
17826
  le as rotateAroundPoint,
17816
17827
  pa as sanitizeSvgTree,
17817
17828
  $r as setBearerAuthenticationToken,