@spiffcommerce/core 32.3.0-beta.a8b59284-7aaa-5e14-aa76-b295d653dfec → 32.3.0-beta.e9f6a9e0-1fee-54ca-a731-939a38d038b8

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
@@ -342,8 +342,8 @@ class _r {
342
342
  if (window && window.__SENTRY__) {
343
343
  const f = window.__SENTRY__.hub;
344
344
  if (f) {
345
- const v = f.traceHeaders();
346
- Object.entries(v).forEach(([b, P]) => {
345
+ const S = f.traceHeaders();
346
+ Object.entries(S).forEach(([b, P]) => {
347
347
  l[b] = P;
348
348
  });
349
349
  }
@@ -5342,11 +5342,11 @@ const M = () => {
5342
5342
  viewBox: A,
5343
5343
  width: u
5344
5344
  }) => {
5345
- 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}`, f = M(), v = a.purpose === jt.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: p.width, height: p.height, rx: h }) }) }), b = a.colorProfiles?.map((S, I) => (
5345
+ 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}`, f = M(), S = a.purpose === jt.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: p.width, height: p.height, rx: h }) }) }), b = a.colorProfiles?.map((v, I) => (
5346
5346
  /* @ts-ignore */
5347
- /* @__PURE__ */ F("color-profile", { name: S.name, xlinkHref: S.key, children: " " }, I)
5348
- )), P = r.map((S) => ({
5349
- ...S,
5347
+ /* @__PURE__ */ F("color-profile", { name: v.name, xlinkHref: v.key, children: " " }, I)
5348
+ )), P = r.map((v) => ({
5349
+ ...v,
5350
5350
  _renderingConfiguration: a,
5351
5351
  mask: l ? `url(#viewmask-${f})` : void 0
5352
5352
  })), w = Ba(P);
@@ -5370,7 +5370,7 @@ const M = () => {
5370
5370
  viewBox: g,
5371
5371
  children: [
5372
5372
  b,
5373
- v,
5373
+ S,
5374
5374
  !!n && /* @__PURE__ */ F(
5375
5375
  "rect",
5376
5376
  {
@@ -5386,7 +5386,7 @@ const M = () => {
5386
5386
  {
5387
5387
  id: "element-group",
5388
5388
  clipPath: a.purpose === jt.FreeDesign ? "url(#viewboxClip)" : void 0,
5389
- children: w.map((S) => zn(S)).filter((S) => !!S)
5389
+ children: w.map((v) => zn(v)).filter((v) => !!v)
5390
5390
  }
5391
5391
  ),
5392
5392
  l && /* @__PURE__ */ F(
@@ -5428,7 +5428,7 @@ const M = () => {
5428
5428
  }
5429
5429
  );
5430
5430
  }, Jc = (n, t, e, a, r) => {
5431
- const i = ft(r), o = e / 2, s = a / 2, l = n + o, c = t + s, d = Math.sin(i), A = Math.cos(i), u = o, h = o, m = -s, p = s, g = u * A - m * d, f = h * A - p * d, v = u * d + m * A, b = h * d + p * A, P = Math.max(Math.abs(g), Math.abs(f)), w = Math.max(Math.abs(v), Math.abs(b));
5431
+ const i = ft(r), o = e / 2, s = a / 2, l = n + o, c = t + s, d = Math.sin(i), A = Math.cos(i), u = o, h = o, m = -s, p = s, g = u * A - m * d, f = h * A - p * d, S = u * d + m * A, b = h * d + p * A, P = Math.max(Math.abs(g), Math.abs(f)), w = Math.max(Math.abs(S), Math.abs(b));
5432
5432
  return {
5433
5433
  minX: l - P,
5434
5434
  maxX: l + P,
@@ -5741,22 +5741,22 @@ const no = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", qe = /* @_
5741
5741
  });
5742
5742
  const o = e.querySelectorAll("tspan");
5743
5743
  for (let d = 0; d < o.length; d++) {
5744
- const A = o.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), p = await Nt(r.get(m)), g = u.getAttribute("fill"), f = u.getAttribute("stroke"), v = u.getAttribute("stroke-width"), b = p.getPath(
5744
+ const A = o.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), p = await Nt(r.get(m)), g = u.getAttribute("fill"), f = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"), b = p.getPath(
5745
5745
  A.innerHTML,
5746
5746
  0,
5747
5747
  0,
5748
5748
  parseInt(u.getAttribute("font-size") ?? "72")
5749
5749
  ), P = b.getBoundingBox().x2 - b.getBoundingBox().x1;
5750
5750
  let w = 0;
5751
- const S = A.getAttribute("text-anchor");
5752
- S === "middle" ? w = P / 2 : S === "end" && (w = P);
5751
+ const v = A.getAttribute("text-anchor");
5752
+ v === "middle" ? w = P / 2 : v === "end" && (w = P);
5753
5753
  const I = p.getPath(
5754
5754
  A.innerHTML,
5755
5755
  parseFloat(A.getAttribute("x") ?? "0") - w,
5756
5756
  parseFloat(A.getAttribute("y") ?? "0"),
5757
5757
  parseInt(u.getAttribute("font-size") ?? "72")
5758
5758
  );
5759
- I.fill = g, I.stroke = f, I.strokeWidth = parseFloat(v ?? "0");
5759
+ I.fill = g, I.stroke = f, I.strokeWidth = parseFloat(S ?? "0");
5760
5760
  const D = I.toSVG(2), T = t.parseFromString(D, "image/svg+xml").firstElementChild;
5761
5761
  h.appendChild(T);
5762
5762
  }
@@ -7712,7 +7712,7 @@ class Fe {
7712
7712
  i && i(!0);
7713
7713
  const c = t.data.initialZoomLevel, d = await Promise.all(
7714
7714
  t.data.regions.map(async (h, m) => {
7715
- const p = await Ue(l[m]), g = s.getImageData(), f = a.map((I) => new Bt(I.id)), v = g ? Ia(
7715
+ const p = await Ue(l[m]), g = s.getImageData(), f = a.map((I) => new Bt(I.id)), S = g ? Ia(
7716
7716
  g,
7717
7717
  p,
7718
7718
  c && !t.data.forceImageCover ? { scale: c } : void 0,
@@ -7720,18 +7720,18 @@ class Fe {
7720
7720
  ) : void 0, b = g ? {
7721
7721
  id: M(),
7722
7722
  src: g.src,
7723
- x: v?.x || 0,
7724
- y: v?.y || 0,
7723
+ x: S?.x || 0,
7724
+ y: S?.y || 0,
7725
7725
  width: g.width,
7726
7726
  height: g.height,
7727
- scaleX: v?.zoom || 1,
7728
- scaleY: v?.zoom || 1,
7727
+ scaleX: S?.zoom || 1,
7728
+ scaleY: S?.zoom || 1,
7729
7729
  rotation: 0
7730
- } : void 0, P = M(), S = r.getLayouts().find((I) => I.panelId === h.panelId);
7731
- if (!S)
7730
+ } : void 0, P = M(), v = r.getLayouts().find((I) => I.panelId === h.panelId);
7731
+ if (!v)
7732
7732
  throw new Y(h);
7733
7733
  return {
7734
- command: this.getCreateElementCommand(P, h, S, {
7734
+ command: this.getCreateElementCommand(P, h, v, {
7735
7735
  frameData: p,
7736
7736
  pattern: b,
7737
7737
  disablePlaceholder: t.data.disablePlaceholder,
@@ -7969,13 +7969,13 @@ class Po {
7969
7969
  if (!l)
7970
7970
  throw new Yt(s);
7971
7971
  const c = await st(await this.getIllustrationBody(l)), d = await _t(c.svg), A = (f) => {
7972
- const v = i.getLayouts().find((P) => P.panelId === f.panelId);
7973
- if (!v)
7972
+ const S = i.getLayouts().find((P) => P.panelId === f.panelId);
7973
+ if (!S)
7974
7974
  throw new Y(f);
7975
7975
  const b = M();
7976
7976
  return {
7977
7977
  regionElement: { id: b, region: f },
7978
- command: this.getCreateElementCommand(b, f, v, {
7978
+ command: this.getCreateElementCommand(b, f, S, {
7979
7979
  stepName: t.stepName,
7980
7980
  src: l,
7981
7981
  objectURL: d,
@@ -7986,42 +7986,42 @@ class Po {
7986
7986
  let p = Array.from(Object.values(c.colors)).map((f) => f.browserValue);
7987
7987
  const g = t.data.colorOption;
7988
7988
  return g && g.variants?.forEach((f) => {
7989
- p = p.map((v) => v.toLowerCase() === f.color?.toLowerCase() ? f.name : v);
7989
+ p = p.map((S) => S.toLowerCase() === f.color?.toLowerCase() ? f.name : S);
7990
7990
  }), i.updateMetadata(t.stepName, { colors: p }), {
7991
7991
  command: new Q(m),
7992
7992
  followup: async () => {
7993
7993
  await i.setSelectionsAndElements(
7994
7994
  t.stepName,
7995
7995
  [e],
7996
- u.map((v) => v.regionElement),
7996
+ u.map((S) => S.regionElement),
7997
7997
  async () => {
7998
7998
  i.setMandatoryFulfilled(t.stepName, !0), r(!1);
7999
7999
  }
8000
8000
  );
8001
8001
  const f = s.assetConfiguration?.defaultColorVariants || [];
8002
8002
  if (f.length !== 0) {
8003
- const v = {};
8003
+ const S = {};
8004
8004
  (s.assetConfiguration?.channelNumbers || []).forEach((P) => {
8005
- const w = f.find((S) => S.channelNumber === P.number);
8006
- w && (v[`${P.id.replace(/\W/g, "")}`] = { browserValue: w?.variant?.color || "" });
8005
+ const w = f.find((v) => v.channelNumber === P.number);
8006
+ w && (S[`${P.id.replace(/\W/g, "")}`] = { browserValue: w?.variant?.color || "" });
8007
8007
  }), await this.changeColors(
8008
8008
  t,
8009
8009
  u.map((P) => P.regionElement),
8010
8010
  i,
8011
8011
  () => i.getCommandContext().getAllLayouts(),
8012
- new Map(Object.entries(v))
8012
+ new Map(Object.entries(S))
8013
8013
  );
8014
8014
  }
8015
8015
  if (t.data.colorPickerEnabled) {
8016
- const v = await this.availableColors(t, i) || [], b = Object.keys(c.colors), P = v.length === 1 && b.length === 1;
8016
+ const S = await this.availableColors(t, i) || [], b = Object.keys(c.colors), P = S.length === 1 && b.length === 1;
8017
8017
  if (P) {
8018
- const w = v[0], S = b[0];
8018
+ const w = S[0], v = b[0];
8019
8019
  await this.changeColors(
8020
8020
  t,
8021
8021
  u.map((I) => I.regionElement),
8022
8022
  i,
8023
8023
  () => i.getCommandContext().getAllLayouts(),
8024
- /* @__PURE__ */ new Map([[S, w.variant.color]])
8024
+ /* @__PURE__ */ new Map([[v, w.variant.color]])
8025
8025
  );
8026
8026
  }
8027
8027
  !P && f.length === 0 && await this.changeColors(
@@ -8548,7 +8548,7 @@ class To {
8548
8548
  };
8549
8549
  } else {
8550
8550
  const l = (u) => {
8551
- const h = i.find((v) => v.panelId === u.panelId);
8551
+ const h = i.find((S) => S.panelId === u.panelId);
8552
8552
  if (!h)
8553
8553
  throw new Y(u);
8554
8554
  const m = s(), p = `
@@ -8654,7 +8654,7 @@ const Qo = new No(), _e = (n, t, e, a, r) => {
8654
8654
  const A = Math.max(...s);
8655
8655
  if (A <= n.width)
8656
8656
  return [i, A];
8657
- const u = s.reduce((g, f, v, b) => f > b[g] ? v : g, 0), h = i[u];
8657
+ const u = s.reduce((g, f, S, b) => f > b[g] ? S : g, 0), h = i[u];
8658
8658
  let m = !1, p = h.length;
8659
8659
  for (; !m && p > -1; ) {
8660
8660
  p = h.lastIndexOf(" ", p - 1);
@@ -8978,7 +8978,7 @@ class Oo {
8978
8978
  const p = e.getWorkflowExperience().getBundle();
8979
8979
  if (p && t.globalPropertyAspectConfigurations) {
8980
8980
  const f = p.getGlobalPropertyConfiguration()?.aspects?.find(
8981
- (v) => v.type === $.Text && t.globalPropertyAspectConfigurations?.map((b) => b.aspectName).includes(v.name)
8981
+ (S) => S.type === $.Text && t.globalPropertyAspectConfigurations?.map((b) => b.aspectName).includes(S.name)
8982
8982
  );
8983
8983
  if (f) {
8984
8984
  const b = p.getGlobalPropertyStateManager().getAspect(f.name);
@@ -8991,7 +8991,7 @@ class Oo {
8991
8991
  u,
8992
8992
  async () => {
8993
8993
  e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
8994
- const g = s.map((v) => new Ya(v.id, A)), f = new Q(g);
8994
+ const g = s.map((S) => new Ya(S.id, A)), f = new Q(g);
8995
8995
  e.getCommandDispatcher()(f);
8996
8996
  }
8997
8997
  ), s.length === 0 && l) {
@@ -9185,7 +9185,7 @@ class Oo {
9185
9185
  colorProfileAssetKey: g.colorProfile?.key
9186
9186
  });
9187
9187
  }
9188
- const v = await this.getDefaultColor(a), b = v || "#000000", P = {
9188
+ const S = await this.getDefaultColor(a), b = S || "#000000", P = {
9189
9189
  stepRegion: u,
9190
9190
  stepName: t,
9191
9191
  align: this.textAlign(a),
@@ -9209,7 +9209,7 @@ class Oo {
9209
9209
  curved: a.curved,
9210
9210
  paths: a.paths,
9211
9211
  fillSpotColorDefinition: f
9212
- }, w = [], S = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map();
9212
+ }, w = [], v = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map();
9213
9213
  if (!P.fontData) throw new V("Failed to resolve font data for text.");
9214
9214
  const [D, B] = Ce(
9215
9215
  P.fontSize,
@@ -9225,7 +9225,7 @@ class Oo {
9225
9225
  [c],
9226
9226
  { size: a.size, minSize: a.minSize, maxSize: a.maxSize }
9227
9227
  );
9228
- S.set(P.id, D), I.set(P.id, B);
9228
+ v.set(P.id, D), I.set(P.id, B);
9229
9229
  const T = a.curved || a.vertical ? c : (B || []).join(`
9230
9230
  `);
9231
9231
  w.push(
@@ -9272,20 +9272,20 @@ class Oo {
9272
9272
  const A = (r || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = Ft(A, o), h = this.getProcessedInput(u, t.data, s), m = o.getRegionElements(t.stepName), p = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
9273
9273
  for (const w of m)
9274
9274
  if (w.region) {
9275
- const [S, I] = Ce(
9275
+ const [v, I] = Ce(
9276
9276
  e,
9277
9277
  a,
9278
9278
  w.region,
9279
9279
  [h],
9280
9280
  { size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
9281
9281
  );
9282
- p.set(w.id, S), g.set(w.id, I);
9282
+ p.set(w.id, v), g.set(w.id, I);
9283
9283
  }
9284
- const v = (() => {
9284
+ const S = (() => {
9285
9285
  if (t.data && t.data.maxLength && h.length > t.data.maxLength)
9286
9286
  return d && d(!0), { info: "0" };
9287
- const w = o.getProfanities(), S = ra(h.toLowerCase());
9288
- for (const I of S)
9287
+ const w = o.getProfanities(), v = ra(h.toLowerCase());
9288
+ for (const I of v)
9289
9289
  for (const D in w) {
9290
9290
  const B = w[D].toLowerCase().replace(/\s/g, "");
9291
9291
  if (I === B)
@@ -9294,25 +9294,25 @@ class Oo {
9294
9294
  return !t.data.vertical && !t.data.allowNewlines && (h.includes(`
9295
9295
  `) || h.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(g.values()).every((D) => D) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - h.length).toString() });
9296
9296
  })();
9297
- if (v.error) {
9298
- c(v.error);
9297
+ if (S.error) {
9298
+ c(S.error);
9299
9299
  return;
9300
9300
  }
9301
- if (c(`${v.info} characters remaining` || ""), d)
9301
+ if (c(`${S.info} characters remaining` || ""), d)
9302
9302
  return;
9303
9303
  o.updateStorage(t.stepName, { text: A }), o.updateMetadata(t.stepName, {
9304
9304
  text: this.injectReplaceableText(A, t.data)
9305
9305
  }), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && o.setMandatoryFulfilled(t.stepName, !0);
9306
9306
  const b = [];
9307
9307
  for (const w of m) {
9308
- const S = t.data.curved ? h : (g.get(w.id) || []).join(`
9308
+ const v = t.data.curved ? h : (g.get(w.id) || []).join(`
9309
9309
  `);
9310
9310
  b.push(
9311
9311
  this.generateTextChangeCommandsForRegion(
9312
9312
  p.get(w.id) || 1,
9313
9313
  t.data,
9314
9314
  w.id,
9315
- S
9315
+ v
9316
9316
  )
9317
9317
  );
9318
9318
  }
@@ -9482,8 +9482,8 @@ class Ho extends $o {
9482
9482
  b.appendChild(P), P.appendChild(Vo(0, 2, 2, "shadow"));
9483
9483
  const w = at("path");
9484
9484
  w.setAttribute("d", d), w.setAttribute("stroke", "black"), w.setAttribute("stroke-width", "3"), P.appendChild(w);
9485
- const S = at("g");
9486
- S.classList.add("module-layer0"), b.appendChild(S), S.setAttribute("filter", "url(#shadow)"), S.innerHTML = w.outerHTML;
9485
+ const v = at("g");
9486
+ v.classList.add("module-layer0"), b.appendChild(v), v.setAttribute("filter", "url(#shadow)"), v.innerHTML = w.outerHTML;
9487
9487
  const I = at("g");
9488
9488
  I.classList.add("module-layer1"), b.appendChild(I), I.setAttribute("stroke-width", "3"), I.setAttribute("stroke", "rgb(45,41,38)"), I.setAttribute("fill", "rgb(45,41,38)"), I.setAttribute("transform", "translate(0.5,0)"), I.innerHTML = s;
9489
9489
  const D = at("g");
@@ -9502,8 +9502,8 @@ class Ho extends $o {
9502
9502
  g.classList.add("module-text-enclosure"), u.appendChild(g);
9503
9503
  const f = A();
9504
9504
  g.appendChild(f);
9505
- const v = Sr(d);
9506
- return Go(g, v, e.height, e.width, 0.35, 0.65), zo(u.outerHTML);
9505
+ const S = Sr(d);
9506
+ return Go(g, S, e.height, e.width, 0.35, 0.65), zo(u.outerHTML);
9507
9507
  }
9508
9508
  }
9509
9509
  async function tr(n) {
@@ -10247,7 +10247,7 @@ class Xa extends Tn {
10247
10247
  }
10248
10248
  }
10249
10249
  class Is {
10250
- constructor(t, e, a, r, i, o, s, l, c, d, A, u, h, m = !1, p, g = !1, f = !1, v = !1) {
10250
+ constructor(t, e, a, r, i, o, s, l, c, d, A, u, h, m = !1, p, g = !1, f = !1, S = !1) {
10251
10251
  this.workflowStatePromiseQueue = new Nn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10252
10252
  if (!this.previewService) return;
10253
10253
  const b = this.getCommandContext().getAllLayouts(), P = this.getLayoutPreviewService()?.getAll();
@@ -10256,7 +10256,7 @@ class Is {
10256
10256
  w.render(b);
10257
10257
  }, this.experience = t, this.client = e, this.updateTransaction = s, this.graphQlClient = l, this.commandContext = o, 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 = r, 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) => {
10258
10258
  this.stepTags[b.stepName] = b.tags ?? [];
10259
- }), v && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
10259
+ }), S && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
10260
10260
  this.initialized = !0;
10261
10261
  }), this.initializationPromise.catch((b) => {
10262
10262
  throw console.error(b), this.initialized = !1, new Error("Workflow initialization failed due to an error. See console.");
@@ -10320,7 +10320,7 @@ class Is {
10320
10320
  }
10321
10321
  });
10322
10322
  else {
10323
- const v = await this.graphQlClient().mutate({
10323
+ const S = await this.graphQlClient().mutate({
10324
10324
  mutation: Ss,
10325
10325
  errorPolicy: "all",
10326
10326
  fetchPolicy: "no-cache",
@@ -10345,7 +10345,7 @@ class Is {
10345
10345
  }
10346
10346
  });
10347
10347
  this.transaction.recipient = {
10348
- id: v?.data?.recipientCreate?.id,
10348
+ id: S?.data?.recipientCreate?.id,
10349
10349
  firstName: t,
10350
10350
  lastName: e,
10351
10351
  address: a,
@@ -10369,14 +10369,14 @@ class Is {
10369
10369
  fetchPolicy: "no-cache",
10370
10370
  variables: {
10371
10371
  id: this.transaction.id,
10372
- recipientId: v.data?.recipientCreate?.id
10372
+ recipientId: S.data?.recipientCreate?.id
10373
10373
  },
10374
10374
  context: {
10375
10375
  transactionOwnerId: this.transaction.transactionOwnerId
10376
10376
  }
10377
10377
  });
10378
10378
  }
10379
- await this.fetchConversionConfiguration(), this.recipientCallbacks.forEach((v) => v(this.transaction.recipient));
10379
+ await this.fetchConversionConfiguration(), this.recipientCallbacks.forEach((S) => S(this.transaction.recipient));
10380
10380
  }
10381
10381
  async fetchConversionConfiguration() {
10382
10382
  const t = this.transaction.recipient;
@@ -10857,11 +10857,11 @@ class Is {
10857
10857
  this.stepSelections = {
10858
10858
  ...this.stepSelections,
10859
10859
  [t]: { selectedVariants: e }
10860
- }, this.selectionCost = Object.values(this.stepSelections).reduce((w, S) => w + S.selectedVariants.map((I) => I.priceModifier || 0).reduce((I, D) => I + D, 0), 0), this.workflow.steps.forEach((w) => {
10860
+ }, this.selectionCost = Object.values(this.stepSelections).reduce((w, v) => w + v.selectedVariants.map((I) => I.priceModifier || 0).reduce((I, D) => I + D, 0), 0), this.workflow.steps.forEach((w) => {
10861
10861
  vt(w, this.stepSelections) || (this.stepInitialised[w.stepName] = !1, delete this.stepMetadata[w.stepName], delete this.stepSelections[w.stepName], delete this.storage[w.stepName]);
10862
10862
  });
10863
10863
  const o = this.allScenes, s = yt(o, i), l = yt(o, this.stepSelections), c = s.map((w) => w.silentSteps).flat(), A = l.map((w) => w.silentSteps).flat().filter(
10864
- (w) => !c.some((S) => S.stepName === w.stepName)
10864
+ (w) => !c.some((v) => v.stepName === w.stepName)
10865
10865
  );
10866
10866
  c.forEach((w) => {
10867
10867
  vt(w, this.stepSelections) || (this.stepInitialised[w.stepName] = !1);
@@ -10873,14 +10873,14 @@ class Is {
10873
10873
  [t]: a
10874
10874
  }, this.removeElements(u);
10875
10875
  const p = this.workflow.steps.find((w) => w.stepName === t);
10876
- p?.type === E.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((S) => S.id));
10877
- const g = u.map((w) => new Bt(w.id)), f = new ja(this.constructSerializableWorkflow()), v = [...m, ...g, f];
10878
- v.length > 0 && this.commandContext.apply(new Q(v), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10876
+ p?.type === E.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((v) => v.id));
10877
+ const g = u.map((w) => new Bt(w.id)), f = new ja(this.constructSerializableWorkflow()), S = [...m, ...g, f];
10878
+ S.length > 0 && this.commandContext.apply(new Q(S), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10879
10879
  const b = this.getInvalidModelVariants(), P = this.modelContainer;
10880
10880
  if (P) {
10881
10881
  const w = b.map(
10882
- (S) => P.applyModelVariant(
10883
- S,
10882
+ (v) => P.applyModelVariant(
10883
+ v,
10884
10884
  {
10885
10885
  contextService: this.getLayoutPreviewService()
10886
10886
  },
@@ -11966,18 +11966,18 @@ const Us = async (n, t) => {
11966
11966
  }
11967
11967
  }
11968
11968
  return [B, T];
11969
- }, [v] = await f(!0), b = Object.fromEntries(
11970
- Object.keys(v).map((D) => [D, v[D].map((B) => B.id)])
11969
+ }, [S] = await f(!0), b = Object.fromEntries(
11970
+ Object.keys(S).map((D) => [D, S[D].map((B) => B.id)])
11971
11971
  ), [P] = await f(!1), w = Object.fromEntries(
11972
11972
  Object.keys(P).map((D) => [
11973
11973
  D,
11974
11974
  P[D].map((B) => B.id)
11975
11975
  ])
11976
11976
  );
11977
- let S = await s(m, r.id);
11978
- if (S) {
11979
- const D = await (await rt(S)).blob();
11980
- S = (await R.uploadAsset(
11977
+ let v = await s(m, r.id);
11978
+ if (v) {
11979
+ const D = await (await rt(v)).blob();
11980
+ v = (await R.uploadAsset(
11981
11981
  { name: `${r.id}-preview-image.png`, blob: D },
11982
11982
  ve.Image,
11983
11983
  !0,
@@ -11995,7 +11995,7 @@ const Us = async (n, t) => {
11995
11995
  workflowId: t.id,
11996
11996
  transactionId: r.id,
11997
11997
  useThreeDimPreview: !!m,
11998
- previewImage: S
11998
+ previewImage: v
11999
11999
  };
12000
12000
  if (g) {
12001
12001
  const B = [];
@@ -12011,7 +12011,7 @@ const Us = async (n, t) => {
12011
12011
  }
12012
12012
  return D;
12013
12013
  })(),
12014
- cartSelectionsWithPrices: v,
12014
+ cartSelectionsWithPrices: S,
12015
12015
  cartMetadata: p
12016
12016
  };
12017
12017
  }, zs = async (n, t, e, a, r, i, o, s, l, c, d) => {
@@ -12340,8 +12340,8 @@ class Js {
12340
12340
  DOMParser: wa(),
12341
12341
  fetch
12342
12342
  })).render();
12343
- const v = await this.getCanvasObjectURLAsync(o);
12344
- return o.toDataURL(v);
12343
+ const S = await this.getCanvasObjectURLAsync(o);
12344
+ return o.toDataURL(S);
12345
12345
  }
12346
12346
  getStepById(t) {
12347
12347
  const e = this.getWorkflowManager().getWorkflow().steps.find((i) => i.stepName === t);
@@ -12798,9 +12798,9 @@ const Ks = (n) => {
12798
12798
  const p = {};
12799
12799
  kt(m, (w) => {
12800
12800
  Xs.includes(w.tagName) && !w.attributes.getNamedItem("fill") && w.setAttribute("fill", "#000000");
12801
- const S = w.attributes.getNamedItem("fill");
12802
- if (S && S.value !== "none") {
12803
- const D = S.value, T = `spiff-fill-${D.replace(/\W/g, "")}`;
12801
+ const v = w.attributes.getNamedItem("fill");
12802
+ if (v && v.value !== "none") {
12803
+ const D = v.value, T = `spiff-fill-${D.replace(/\W/g, "")}`;
12804
12804
  w.classList.add(T), p[T] = { browserValue: D };
12805
12805
  }
12806
12806
  const I = w.attributes.getNamedItem("stroke");
@@ -12809,18 +12809,18 @@ const Ks = (n) => {
12809
12809
  w.classList.add(T), p[T] = { browserValue: D };
12810
12810
  }
12811
12811
  });
12812
- const f = It().serializeToString(m), v = r.colors;
12813
- if (v) {
12814
- for (const [w, S] of Object.entries(p))
12815
- for (const I of Object.keys(v))
12816
- if (S.browserValue === I) {
12817
- p[w] = { browserValue: v[I] };
12812
+ const f = It().serializeToString(m), S = r.colors;
12813
+ if (S) {
12814
+ for (const [w, v] of Object.entries(p))
12815
+ for (const I of Object.keys(S))
12816
+ if (v.browserValue === I) {
12817
+ p[w] = { browserValue: S[I] };
12818
12818
  break;
12819
12819
  }
12820
12820
  }
12821
12821
  const b = (w) => {
12822
- const S = n.find((D) => D.panelId === w.panelId);
12823
- if (!S)
12822
+ const v = n.find((D) => D.panelId === w.panelId);
12823
+ if (!v)
12824
12824
  throw new Y(w);
12825
12825
  const I = M();
12826
12826
  return new G(
@@ -12838,7 +12838,7 @@ const Ks = (n) => {
12838
12838
  layerIndex: w.layerIndex,
12839
12839
  immutable: w.immutable
12840
12840
  },
12841
- S
12841
+ v
12842
12842
  );
12843
12843
  }, P = a.data.regions;
12844
12844
  try {
@@ -13046,9 +13046,9 @@ const Ks = (n) => {
13046
13046
  if (!f || !f.asset)
13047
13047
  return;
13048
13048
  t[a.stepName] = { selectedVariants: [f] };
13049
- const v = f.asset.fileLink;
13050
- if (v)
13051
- return v;
13049
+ const S = f.asset.fileLink;
13050
+ if (S)
13051
+ return S;
13052
13052
  }, d = await (async () => {
13053
13053
  const g = l();
13054
13054
  if (!g)
@@ -13069,7 +13069,7 @@ const Ks = (n) => {
13069
13069
  const f = n.find((b) => b.panelId === g.panelId);
13070
13070
  if (!f)
13071
13071
  continue;
13072
- const v = {
13072
+ const S = {
13073
13073
  stepName: e.name,
13074
13074
  id: M(),
13075
13075
  align: s(a.data),
@@ -13110,16 +13110,16 @@ const Ks = (n) => {
13110
13110
  r.push(
13111
13111
  new G(
13112
13112
  {
13113
- ...v,
13113
+ ...S,
13114
13114
  fontSize: b,
13115
- text: v.curved ? v.text : (P || []).join(`
13115
+ text: S.curved ? S.text : (P || []).join(`
13116
13116
  `)
13117
13117
  },
13118
13118
  f
13119
13119
  )
13120
13120
  );
13121
13121
  } else
13122
- r.push(new G(v, f));
13122
+ r.push(new G(S, f));
13123
13123
  }
13124
13124
  return r;
13125
13125
  }, sl = (n, t) => n.conditions ? n.conditions.every((e) => {
@@ -15996,7 +15996,7 @@ class bd {
15996
15996
  } catch (a) {
15997
15997
  throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
15998
15998
  }
15999
- }, this.options = t, this.options.applicationKey && qr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.3.0-beta.0216b2a2-df3f-5d89-bac8-e2dc336adf63"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15999
+ }, this.options = t, this.options.applicationKey && qr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.3.0-beta.a8b59284-7aaa-5e14-aa76-b295d653dfec"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16000
16000
  }
16001
16001
  configure(t) {
16002
16002
  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 && jr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16315,7 +16315,7 @@ class bd {
16315
16315
  const h = await this.loggedInBearerToken();
16316
16316
  s.Authorization = `Bearer ${h}`;
16317
16317
  } catch {
16318
- const p = Object.entries(localStorage).find(([f, v]) => f.startsWith("CognitoIdentityServiceProvider") && f.endsWith("idToken"))?.[0] || "", g = localStorage.getItem(p);
16318
+ const p = Object.entries(localStorage).find(([f, S]) => f.startsWith("CognitoIdentityServiceProvider") && f.endsWith("idToken"))?.[0] || "", g = localStorage.getItem(p);
16319
16319
  g && !Wt(g) && (s.Authorization = `Bearer ${g}`);
16320
16320
  }
16321
16321
  const l = {
@@ -16455,10 +16455,10 @@ class bd {
16455
16455
  async getWorkflowExperiences(t, e) {
16456
16456
  if (t.length === 0)
16457
16457
  throw new ht("No options provided!");
16458
- const a = y.getShadowGraphqlClient(), r = async (S) => {
16459
- if (S.length === 0)
16458
+ const a = y.getShadowGraphqlClient(), r = async (v) => {
16459
+ if (v.length === 0)
16460
16460
  return [];
16461
- const I = S.map((T) => T.option.transactionId), D = await a.query({
16461
+ const I = v.map((T) => T.option.transactionId), D = await a.query({
16462
16462
  query: Pi,
16463
16463
  variables: {
16464
16464
  ids: I
@@ -16466,23 +16466,23 @@ class bd {
16466
16466
  errorPolicy: "all",
16467
16467
  fetchPolicy: "no-cache"
16468
16468
  }), B = D.data.transactions;
16469
- if (B.length !== S.length) {
16469
+ if (B.length !== v.length) {
16470
16470
  const T = D.errors?.[0]?.message || "Unknown error";
16471
16471
  throw new ht(`Not all transactions were found: ${T}`);
16472
16472
  }
16473
16473
  return !this.activeIntegration && B[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(B[0].integrationProduct.integration)), B.map((T, L) => ({
16474
16474
  transaction: T,
16475
16475
  workflowId: T.workflowId,
16476
- readOnly: S.find((q) => q.option.transactionId === T.id)?.option.readOnly ?? !1,
16477
- index: S[L].index
16476
+ readOnly: v.find((q) => q.option.transactionId === T.id)?.option.readOnly ?? !1,
16477
+ index: v[L].index
16478
16478
  }));
16479
- }, i = async (S) => {
16480
- if (S.length === 0)
16479
+ }, i = async (v) => {
16480
+ if (v.length === 0)
16481
16481
  return [];
16482
16482
  const I = await a.mutate({
16483
16483
  mutation: Ii,
16484
16484
  variables: {
16485
- inputs: S.map((B) => ({
16485
+ inputs: v.map((B) => ({
16486
16486
  integrationProductId: B.option.type === "integration" ? B.option.integrationProductId : void 0,
16487
16487
  externalIntegrationId: B.option.type === "external" ? B.option.externalIntegrationId : void 0,
16488
16488
  externalProductId: B.option.type === "external" ? B.option.externalProductId : void 0,
@@ -16506,15 +16506,15 @@ class bd {
16506
16506
  transaction: B,
16507
16507
  workflowId: B.workflowId,
16508
16508
  readOnly: !1,
16509
- index: S[T].index
16509
+ index: v[T].index
16510
16510
  }));
16511
- }, o = t.map((S, I) => ({ option: S, index: I })), s = o.filter((S) => S.option.type === "transaction"), l = o.filter(
16512
- (S) => S.option.type === "integration" || S.option.type === "external"
16511
+ }, o = t.map((v, I) => ({ option: v, index: I })), s = o.filter((v) => v.option.type === "transaction"), l = o.filter(
16512
+ (v) => v.option.type === "integration" || v.option.type === "external"
16513
16513
  ), c = 50, d = Ta(s, c), A = Ta(l, c), u = (await Promise.all([
16514
16514
  ...d.map(r),
16515
16515
  ...A.map(i)
16516
- ])).flat(), h = [...new Set(u.map((S) => S.workflowId))], m = await lr(h, e), p = new Map(m.map((S) => [S.id, S])), g = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), f = u.map(async (S) => {
16517
- const { transaction: I, workflowId: D, readOnly: B, index: T } = S, L = p.get(D), q = t[T];
16516
+ ])).flat(), h = [...new Set(u.map((v) => v.workflowId))], m = await lr(h, e), p = new Map(m.map((v) => [v.id, v])), g = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), f = u.map(async (v) => {
16517
+ const { transaction: I, workflowId: D, readOnly: B, index: T } = v, L = p.get(D), q = t[T];
16518
16518
  !g.get(I.id) && I.transactionOwnerId && g.set(I.id, I.transactionOwnerId);
16519
16519
  const X = g.get(I.id) || void 0, wt = new Vl({
16520
16520
  onMutate: () => ({ context: { transactionOwnerId: X, bundleOwnerId: e?.bundleOwnerId } }),
@@ -16549,15 +16549,15 @@ class bd {
16549
16549
  return z.renderableContextService = new cl(
16550
16550
  z.layouts
16551
16551
  ), z.delayWorkflowStateSync = !0, { experienceOptions: z, index: T, options: q };
16552
- }), v = 100, b = await Promise.all(f);
16552
+ }), S = 100, b = await Promise.all(f);
16553
16553
  k.setMap("transactionOwnerIds", g);
16554
- const P = b.sort((S, I) => S.index - I.index);
16554
+ const P = b.sort((v, I) => v.index - I.index);
16555
16555
  let w = [];
16556
- for (const S of P) {
16557
- const { experienceOptions: I, options: D } = S, B = new Js(this, I);
16558
- await B.getWorkflowManager().getInitializationPromise(), D.type !== "transaction" && this.customer && await B.attachCustomerDetails({ email: this.customer.emailAddress }), w = [...w, B], await new Promise((T) => setTimeout(T, v));
16556
+ for (const v of P) {
16557
+ const { experienceOptions: I, options: D } = v, B = new Js(this, I);
16558
+ await B.getWorkflowManager().getInitializationPromise(), D.type !== "transaction" && this.customer && await B.attachCustomerDetails({ email: this.customer.emailAddress }), w = [...w, B], B.getWorkflowManager().setWorkflowStateSyncEnabled(!0), await new Promise((T) => setTimeout(T, S));
16559
16559
  }
16560
- return w.forEach((S) => S.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), w;
16560
+ return w;
16561
16561
  }
16562
16562
  storeCustomer(t) {
16563
16563
  const e = k.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map();