@spiffcommerce/core 27.2.1-beta.5756496b-3a49-5000-b986-4209fb32572c → 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
@@ -11,7 +11,7 @@ import St from "lodash.clonedeep";
11
11
  import { toString as sn } from "qrcode";
12
12
  import mr from "svg-path-bbox";
13
13
  import { parse as Xe } from "opentype.js";
14
- import { jsx as F, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
14
+ import { jsx as F, jsxs as ct, Fragment as zt } from "preact/jsx-runtime";
15
15
  import gr from "handlebars";
16
16
  import { dataUriToBuffer as pr } from "data-uri-to-buffer";
17
17
  import Fa from "lodash.chunk";
@@ -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 || {}), z = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(z || {}), 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
  }
@@ -62,7 +62,7 @@ class De extends cn {
62
62
  super(`ImplementationError - ${t}`);
63
63
  }
64
64
  }
65
- class G extends De {
65
+ class z extends De {
66
66
  constructor(t) {
67
67
  super(`Unhandled Behavior Encountered: ${t}`);
68
68
  }
@@ -296,25 +296,25 @@ 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";
314
314
  let n = await rt(r, { ...t, redirect: "manual" });
315
315
  return n.type === "opaqueredirect" && (typeof r != "string" && "url" in r ? n = await rt({ ...r, url: `${a}/graphql` }, t) : n = await rt(`${a}/graphql`, t)), n;
316
316
  }
317
- class zr {
317
+ class Gr {
318
318
  constructor() {
319
319
  this.shadowGraphqlClient = this.constructShadowGraphqlClient(), mt.addServerUrlCallback(() => {
320
320
  this.shadowGraphqlClient = this.constructShadowGraphqlClient();
@@ -331,7 +331,7 @@ class zr {
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 {
@@ -366,7 +366,7 @@ class zr {
366
366
  });
367
367
  }
368
368
  }
369
- const b = new zr();
369
+ const b = new Gr();
370
370
  let aa, na;
371
371
  const gt = (r, t, e) => {
372
372
  if (aa !== void 0)
@@ -415,7 +415,7 @@ function ga() {
415
415
  return $e === void 0 && ($e = Fr()), $e;
416
416
  }
417
417
  let se = null;
418
- const Gr = (r) => new Promise((t) => {
418
+ const zr = (r) => new Promise((t) => {
419
419
  if (ke(r) !== "image/jpeg")
420
420
  return t(1);
421
421
  ur(r).then((a) => t(a || 1)).catch(() => t(1));
@@ -427,14 +427,14 @@ const Gr = (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()) {
434
434
  const u = gt(a, n);
435
435
  return (A = u.getContext("2d")) == null || A.drawImage(e, 0, 0, a, n), u;
436
436
  }
437
- const s = await Gr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
437
+ const s = await zr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
438
438
  switch (s) {
439
439
  case 2:
440
440
  d.translate(o, 0), d.scale(-1, 1);
@@ -460,7 +460,7 @@ const Gr = (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 Gr = (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
  }
@@ -3556,7 +3556,7 @@ class di {
3556
3556
  if (this.cache.has(t)) {
3557
3557
  const n = this.cache.get(t);
3558
3558
  if (!n)
3559
- throw new G("Failed to get asset from cache!");
3559
+ throw new z("Failed to get asset from cache!");
3560
3560
  return n;
3561
3561
  }
3562
3562
  const a = (async () => (await ve([t]))[0])();
@@ -3583,7 +3583,7 @@ class di {
3583
3583
  */
3584
3584
  cacheAsset(t) {
3585
3585
  if (!t.key)
3586
- throw new G("Asset has no key!");
3586
+ throw new z("Asset has no key!");
3587
3587
  this.cache.has(t.key) || this.cache.set(t.key, Promise.resolve(t));
3588
3588
  }
3589
3589
  /**
@@ -3591,7 +3591,7 @@ class di {
3591
3591
  */
3592
3592
  cacheMaterial(t) {
3593
3593
  if (!t.id)
3594
- throw new G("Material has no id!");
3594
+ throw new z("Material has no id!");
3595
3595
  this.materialCache.has(t.id) || this.materialCache.set(t.id, Promise.resolve(t));
3596
3596
  }
3597
3597
  /**
@@ -3709,7 +3709,7 @@ class di {
3709
3709
  case "mkv":
3710
3710
  return "video/x-matroska";
3711
3711
  default:
3712
- throw new G("Unexpected mimetype: " + e);
3712
+ throw new z("Unexpected mimetype: " + e);
3713
3713
  }
3714
3714
  }
3715
3715
  }
@@ -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;
@@ -5206,7 +5206,7 @@ const Y = new pi(), En = v`
5206
5206
  silentSteps: r.silentSteps.filter((a) => yt(a, t))
5207
5207
  };
5208
5208
  return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
5209
- }, Dt = (r, t) => r.map((e) => Vi(e, t)).filter((e) => e !== null), zi = async (r, t, e = !1) => {
5209
+ }, Dt = (r, t) => r.map((e) => Vi(e, t)).filter((e) => e !== null), Gi = async (r, t, e = !1) => {
5210
5210
  var s;
5211
5211
  const a = Dt(r, t), n = [];
5212
5212
  for (const o of a)
@@ -5301,7 +5301,7 @@ class xn {
5301
5301
  const Q = () => {
5302
5302
  const r = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
5303
5303
  return r() + r() + "-" + r() + "-" + r() + "-" + r() + "-" + r() + r() + r();
5304
- }, Gi = ({
5304
+ }, zi = ({
5305
5305
  backgroundColor: r,
5306
5306
  outlineColor: t,
5307
5307
  borderRadius: e,
@@ -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",
@@ -5505,7 +5505,7 @@ const Q = () => {
5505
5505
  }, kn = (r) => {
5506
5506
  var l;
5507
5507
  const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = pt(e), n = Math.cos(a), i = -Math.sin(a), s = va(r.children);
5508
- return /* @__PURE__ */ ct(Gt, { children: [
5508
+ return /* @__PURE__ */ ct(zt, { children: [
5509
5509
  /* @__PURE__ */ F("defs", { children: (() => /* @__PURE__ */ F("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ F("path", { d: r.clipPath }) : /* @__PURE__ */ F("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
5510
5510
  /* @__PURE__ */ ct(
5511
5511
  "g",
@@ -5545,8 +5545,8 @@ const Q = () => {
5545
5545
  return r.pattern.src;
5546
5546
  };
5547
5547
  if (!a())
5548
- return /* @__PURE__ */ F(Gt, {});
5549
- const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ F(Gt, { children: r.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5548
+ return /* @__PURE__ */ F(zt, {});
5549
+ const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ F(zt, { children: r.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5550
5550
  /* @__PURE__ */ F(
5551
5551
  "feColorMatrix",
5552
5552
  {
@@ -5590,7 +5590,7 @@ const Q = () => {
5590
5590
  src: a()
5591
5591
  }];
5592
5592
  };
5593
- return /* @__PURE__ */ ct(Gt, { children: [
5593
+ return /* @__PURE__ */ ct(zt, { children: [
5594
5594
  i(),
5595
5595
  /* @__PURE__ */ F(
5596
5596
  "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;
@@ -5890,7 +5890,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5890
5890
  var w;
5891
5891
  return r.textFillImage ? `url("#${s}")` : (w = r._renderingConfiguration) != null && w.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${fn(r.fillSpotColorDefinition)}` : r.fill;
5892
5892
  };
5893
- return /* @__PURE__ */ ct(Gt, { children: [
5893
+ return /* @__PURE__ */ ct(zt, { children: [
5894
5894
  /* @__PURE__ */ ct("defs", { children: [
5895
5895
  r.textFillImage && /* @__PURE__ */ F(
5896
5896
  "pattern",
@@ -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
  };
@@ -6127,7 +6127,7 @@ class rs {
6127
6127
  const Qn = (r) => r.type === M.Image ? /* @__PURE__ */ F(Fn, { ...r }, r.id) : r.type === M.Frame ? /* @__PURE__ */ F(Wi, { ...r }, r.id) : r.type === M.Illustration ? /* @__PURE__ */ F(ns, { ...r }, r.id) : r.type === M.Textbox ? /* @__PURE__ */ F(ts, { ...r }, r.id) : r.type === M.Group ? /* @__PURE__ */ F(kn, { ...r }, r.id) : null, Sa = (r, t, e) => {
6128
6128
  const a = e.renderingConfiguration, n = a != null && a.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
6129
6129
  return /* @__PURE__ */ F(
6130
- Gi,
6130
+ zi,
6131
6131
  {
6132
6132
  preserveAspectRatio: void 0,
6133
6133
  elements: n,
@@ -6174,7 +6174,7 @@ const ae = (r) => {
6174
6174
  if (r.defaultVariant !== void 0)
6175
6175
  return t.find((e) => e.id === r.defaultVariant);
6176
6176
  }
6177
- }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map(), Rn = async (r, t) => {
6177
+ }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), Rn = async (r, t) => {
6178
6178
  if (!t) {
6179
6179
  if (!r)
6180
6180
  throw new Error("No region or src supplied. Cannot construct frame!");
@@ -6198,8 +6198,8 @@ const ae = (r) => {
6198
6198
  throw new Error(`No asset for variant with ID: ${r.frameVariantId}`);
6199
6199
  return e;
6200
6200
  }, Qe = async (r) => {
6201
- if (ze.has(r))
6202
- return ze.get(r);
6201
+ if (Ge.has(r))
6202
+ return Ge.get(r);
6203
6203
  const e = (async () => {
6204
6204
  if (Vt.has(r))
6205
6205
  return Vt.get(r);
@@ -6235,7 +6235,7 @@ const ae = (r) => {
6235
6235
  }
6236
6236
  throw new Error("Malformed frame SVG");
6237
6237
  })();
6238
- return ze.set(r, e), e;
6238
+ return Ge.set(r, e), e;
6239
6239
  }, Ea = (r, t, e, a) => {
6240
6240
  const n = t.width / t.height, i = r.width / r.height;
6241
6241
  let s;
@@ -6297,9 +6297,9 @@ const ae = (r) => {
6297
6297
  at(r).then((e) => {
6298
6298
  t(e);
6299
6299
  }).catch((e) => console.error(e));
6300
- }), Ge = /* @__PURE__ */ new Map(), Kt = async (r) => {
6301
- if (Ge.has(r))
6302
- return Ge.get(r);
6300
+ }), ze = /* @__PURE__ */ new Map(), Kt = async (r) => {
6301
+ if (ze.has(r))
6302
+ return ze.get(r);
6303
6303
  const t = async (n) => new Promise((i, s) => {
6304
6304
  try {
6305
6305
  if (!(!!URL && !!URL.createObjectURL))
@@ -6331,8 +6331,8 @@ const ae = (r) => {
6331
6331
  A.resize(m, m);
6332
6332
  return await A.render(), await t(c);
6333
6333
  })();
6334
- return Ge.set(r, a), a;
6335
- }, Ut = async (r, t, e, a) => {
6334
+ return ze.set(r, a), 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,
@@ -6364,9 +6364,9 @@ const ae = (r) => {
6364
6364
  }
6365
6365
  return o;
6366
6366
  };
6367
- class zc {
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 zc {
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 zc {
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 zc {
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 zc {
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();
@@ -6537,7 +6537,7 @@ const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6537
6537
  elements: a,
6538
6538
  modificationID: Q()
6539
6539
  };
6540
- }, za = async (r) => {
6540
+ }, Ga = async (r) => {
6541
6541
  var a;
6542
6542
  const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
6543
6543
  for (let n = 0; n < e.length; n++) {
@@ -6599,7 +6599,7 @@ class O {
6599
6599
  this.oldState = t;
6600
6600
  }
6601
6601
  }
6602
- class Ga extends O {
6602
+ class za extends O {
6603
6603
  constructor(t) {
6604
6604
  super(), this.serializableWorkflow = t;
6605
6605
  }
@@ -6610,13 +6610,13 @@ class Ga extends O {
6610
6610
  };
6611
6611
  }
6612
6612
  }
6613
- class Gc extends O {
6613
+ class zc extends O {
6614
6614
  constructor(t, e, a) {
6615
6615
  super(), this.id = t, this.x = e, this.y = a;
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)
@@ -8143,7 +8143,7 @@ class ps {
8143
8143
  };
8144
8144
  }
8145
8145
  }
8146
- const zn = new ps();
8146
+ const Gn = new ps();
8147
8147
  class fs {
8148
8148
  async init(t, e, a) {
8149
8149
  const n = t.option;
@@ -8229,7 +8229,7 @@ class fs {
8229
8229
  };
8230
8230
  }
8231
8231
  }
8232
- const Gn = new fs();
8232
+ const zn = new fs();
8233
8233
  class Cs {
8234
8234
  async init(t, e, a) {
8235
8235
  if (a)
@@ -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";
@@ -8669,7 +8669,7 @@ class Ss {
8669
8669
  }
8670
8670
  }
8671
8671
  }
8672
- const zt = new Ss();
8672
+ const Gt = new Ss();
8673
8673
  class vs {
8674
8674
  constructor() {
8675
8675
  this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
@@ -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,
@@ -8806,7 +8808,7 @@ class bs {
8806
8808
  if (p && t.globalPropertyAspectConfigurations) {
8807
8809
  const C = (s = p.getGlobalPropertyConfiguration()) == null ? void 0 : s.aspects, w = C == null ? void 0 : C.find((S) => {
8808
8810
  var y;
8809
- return S.type === z.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((E) => E.aspectName).includes(S.name));
8811
+ return S.type === G.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((E) => E.aspectName).includes(S.name));
8810
8812
  });
8811
8813
  if (w) {
8812
8814
  const y = p.getGlobalPropertyStateManager().getAspect(w.name);
@@ -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.
@@ -8992,7 +8994,7 @@ class bs {
8992
8994
  const l = [], c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
8993
8995
  for (const A of e) {
8994
8996
  if (!A.fontData)
8995
- throw new G("Failed to resolve font data for text.");
8997
+ throw new z("Failed to resolve font data for text.");
8996
8998
  const [u, h] = pe(
8997
8999
  A.fontSize,
8998
9000
  A.fontData,
@@ -9040,17 +9042,19 @@ 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();
9050
9054
  if (S && t.globalPropertyAspectConfigurations) {
9051
9055
  const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects, E = y == null ? void 0 : y.find((B) => {
9052
9056
  var I;
9053
- return B.type === z.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(B.name));
9057
+ return B.type === G.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(B.name));
9054
9058
  });
9055
9059
  if (E) {
9056
9060
  const I = S.getGlobalPropertyStateManager().getAspect(E.name);
@@ -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,16 +9101,19 @@ 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) => {
9100
9108
  var C;
9101
- return f.type === z.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
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,
@@ -9292,7 +9303,7 @@ class bs {
9292
9303
  fillSpotColorDefinition: f
9293
9304
  }, y = [], E = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
9294
9305
  if (!S.fontData)
9295
- throw new G("Failed to resolve font data for text.");
9306
+ throw new z("Failed to resolve font data for text.");
9296
9307
  const [I, D] = pe(
9297
9308
  S.fontSize,
9298
9309
  S.fontData,
@@ -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,10 +9599,10 @@ 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
- throw new G(`Failed to resolve Module, Module ${r} not found`);
9605
+ throw new z(`Failed to resolve Module, Module ${r} not found`);
9595
9606
  }
9596
9607
  const ne = v`
9597
9608
  fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
@@ -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 {
@@ -9893,7 +9904,7 @@ const ne = v`
9893
9904
  }
9894
9905
  }
9895
9906
  }
9896
- `, zs = v`
9907
+ `, Gs = v`
9897
9908
  query GetProductCollectionForFilteredProducts(
9898
9909
  $id: String!
9899
9910
  $filters: ProductCollectionProductFilterInput
@@ -9916,7 +9927,7 @@ const ne = v`
9916
9927
  }
9917
9928
  }
9918
9929
  }
9919
- `, Gs = v`
9930
+ `, zs = v`
9920
9931
  ${ba}
9921
9932
  query GetProductCollectionForProductsFeed(
9922
9933
  $id: String!
@@ -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
  }
@@ -10613,7 +10623,7 @@ class mo {
10613
10623
  const l = o[0];
10614
10624
  if (s.type === P.Model) {
10615
10625
  if (!this.modelContainer)
10616
- throw new G(
10626
+ throw new z(
10617
10627
  "We should always have a model container when injecting a preview!"
10618
10628
  );
10619
10629
  const u = (A = l.asset) == null ? void 0 : A.fileLink;
@@ -10638,7 +10648,7 @@ class mo {
10638
10648
  }
10639
10649
  s.data.targetMaterials.forEach((m) => {
10640
10650
  if (!this.modelContainer)
10641
- throw new G(
10651
+ throw new z(
10642
10652
  "We should always have a model container when injecting a preview!"
10643
10653
  );
10644
10654
  this.modelContainer.applyMaterialVariant(m, s.option.id, u);
@@ -10661,7 +10671,7 @@ class mo {
10661
10671
  };
10662
10672
  if (!on(a, this.storage)) {
10663
10673
  this.storage = a;
10664
- const n = new Ga(this.constructSerializableWorkflow());
10674
+ const n = new za(this.constructSerializableWorkflow());
10665
10675
  this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
10666
10676
  }
10667
10677
  }
@@ -10712,7 +10722,7 @@ class mo {
10712
10722
  serialize() {
10713
10723
  const t = this.getCommandContext().getState();
10714
10724
  if (!t)
10715
- throw new G("Attempted to serialize state before it was initialized.");
10725
+ throw new z("Attempted to serialize state before it was initialized.");
10716
10726
  const e = St(t.transaction), a = this.dehydrateState(e);
10717
10727
  return JSON.stringify(a);
10718
10728
  }
@@ -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;
@@ -10876,7 +10889,7 @@ class mo {
10876
10889
  const E = (y = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : y.frameService;
10877
10890
  E == null || E.setTargetElements(a.map((B) => B.id));
10878
10891
  }
10879
- const p = u.map((E) => new Bt(E.id)), f = new Ga(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10892
+ const p = u.map((E) => new Bt(E.id)), f = new za(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10880
10893
  C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10881
10894
  const w = this.getInvalidModelVariants(), S = this.modelContainer;
10882
10895
  if (S) {
@@ -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(
@@ -10917,15 +10931,15 @@ class mo {
10917
10931
  break;
10918
10932
  case P.Material:
10919
10933
  a.push(
10920
- zn.init(l, this, this.reloadedState)
10934
+ Gn.init(l, this, this.reloadedState)
10921
10935
  );
10922
10936
  break;
10923
10937
  case P.Model:
10924
- a.push(Gn.init(l, this, this.reloadedState));
10938
+ a.push(zn.init(l, this, this.reloadedState));
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
- a.push(zt.init(l, this, this.reloadedState));
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) => {
@@ -11004,7 +11018,7 @@ class mo {
11004
11018
  this.validationCallbacks.forEach((t) => t(this.validationErrors));
11005
11019
  }
11006
11020
  traversableScenes() {
11007
- return zi(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
11021
+ return Gi(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
11008
11022
  }
11009
11023
  }
11010
11024
  class st {
@@ -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) => {
@@ -11306,7 +11320,7 @@ class po extends it {
11306
11320
  super(t, e, a);
11307
11321
  }
11308
11322
  selectVariant(t) {
11309
- return zn.selectVariant(
11323
+ return Gn.selectVariant(
11310
11324
  this.step,
11311
11325
  t.getResource(),
11312
11326
  this.manager,
@@ -11319,7 +11333,7 @@ class fo extends it {
11319
11333
  super(t, e, a);
11320
11334
  }
11321
11335
  selectVariant(t) {
11322
- return Gn.selectVariant(
11336
+ return zn.selectVariant(
11323
11337
  this.step,
11324
11338
  t.getResource(),
11325
11339
  this.manager,
@@ -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.
@@ -11368,7 +11382,7 @@ class yo extends it {
11368
11382
  }
11369
11383
  selectVariant(t) {
11370
11384
  const e = t.getResource();
11371
- return zt.selectVariant(
11385
+ return Gt.selectVariant(
11372
11386
  this.step,
11373
11387
  {
11374
11388
  fill: e.color,
@@ -11386,7 +11400,7 @@ class yo extends it {
11386
11400
  * @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
11387
11401
  */
11388
11402
  setColor(t) {
11389
- return zt.selectVariant(
11403
+ return Gt.selectVariant(
11390
11404
  this.step,
11391
11405
  t,
11392
11406
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -11398,7 +11412,7 @@ class yo extends it {
11398
11412
  * @returns A list of color definitions that are currently applied to the illustration.
11399
11413
  */
11400
11414
  getColors() {
11401
- return zt.availableColours(this.step);
11415
+ return Gt.availableColours(this.step);
11402
11416
  }
11403
11417
  /**
11404
11418
  * Allows for setting a custom color when the custom variant is selected. Will
@@ -11406,7 +11420,7 @@ class yo extends it {
11406
11420
  */
11407
11421
  setCustomColor(t) {
11408
11422
  var e, a;
11409
- return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`), zt.setCustomColor(t, this.step, this.manager);
11423
+ return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`), Gt.setCustomColor(t, this.step, this.manager);
11410
11424
  }
11411
11425
  getCustomColor() {
11412
11426
  var e, a, n;
@@ -11514,7 +11528,9 @@ class So extends it {
11514
11528
  helperData: {}
11515
11529
  }, a = j.findLayoutElements(this.manager, this.step), n = j.filterUnsupportedCharacters(t, (d = a[0]) == null ? void 0 : d.fontData), i = !!this.step.data && !!this.step.data.maxLength && n.length > this.step.data.maxLength;
11516
11530
  i || (e.input = n);
11517
- const s = a.length <= 0, o = s ? { inputText: n, text: n } : { inputText: n };
11531
+ const s = a.length <= 0;
11532
+ console.log(`LOG: setting text ${t} to ${a.length} regions`);
11533
+ const o = s ? { inputText: n, text: n } : { inputText: n };
11518
11534
  this.manager.updateStorage(this.step.stepName, o);
11519
11535
  const l = this.manager.getStepStorage(this.step.stepName), c = j.getProcessedInput(
11520
11536
  n,
@@ -11732,7 +11748,7 @@ class ce {
11732
11748
  case P.Module:
11733
11749
  return new Bo(t, e, t.getStepTags(e.stepName));
11734
11750
  default:
11735
- throw new G(`Step type ${e.type} not yet supported in Core SDK`);
11751
+ throw new z(`Step type ${e.type} not yet supported in Core SDK`);
11736
11752
  }
11737
11753
  }
11738
11754
  }
@@ -11983,22 +11999,22 @@ const Po = async (r, t) => {
11983
11999
  for (const T of Object.keys(i)) {
11984
12000
  const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
11985
12001
  for (let tt = 0; tt < nt.selections.length; ++tt) {
11986
- const H = nt.selections[tt];
12002
+ const q = nt.selections[tt];
11987
12003
  if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
11988
12004
  const ft = R.stepTitle;
11989
12005
  x[ft] ? x[ft].push({
11990
- id: H.id || "",
11991
- name: H.name,
11992
- priceModifier: H.priceModifier
12006
+ id: q.id || "",
12007
+ name: q.name,
12008
+ priceModifier: q.priceModifier
11993
12009
  }) : x[ft] = [
11994
12010
  {
11995
- id: H.id || "",
11996
- name: H.name,
11997
- priceModifier: H.priceModifier
12011
+ id: q.id || "",
12012
+ name: q.name,
12013
+ priceModifier: q.priceModifier
11998
12014
  }
11999
12015
  ];
12000
12016
  }
12001
- k += H.priceModifier;
12017
+ k += q.priceModifier;
12002
12018
  }
12003
12019
  }
12004
12020
  return [x, k];
@@ -12013,7 +12029,7 @@ const Po = async (r, t) => {
12013
12029
  let E = await o(m, n.id);
12014
12030
  if (E) {
12015
12031
  const D = await (await rt(E)).blob();
12016
- E = (await U.uploadAsset(
12032
+ E = (await L.uploadAsset(
12017
12033
  { name: `${n.id}-preview-image.png`, blob: D },
12018
12034
  Ce.Image,
12019
12035
  !0,
@@ -12154,7 +12170,7 @@ class Mo {
12154
12170
  const t = N.get(this.localPersistenceKey);
12155
12171
  return t ? JSON.parse(t) : [];
12156
12172
  }
12157
- throw new G("Unexpected storage method requested");
12173
+ throw new z("Unexpected storage method requested");
12158
12174
  }
12159
12175
  /**
12160
12176
  * Search for a transaction that has been saved.
@@ -12194,7 +12210,7 @@ class Mo {
12194
12210
  N.set(this.localPersistenceKey, JSON.stringify(t));
12195
12211
  return;
12196
12212
  }
12197
- throw new G("Unexpected storage method requested");
12213
+ throw new z("Unexpected storage method requested");
12198
12214
  }
12199
12215
  }
12200
12216
  const Ye = new Mo(), To = v`
@@ -12371,7 +12387,7 @@ class Oo {
12371
12387
  throw new xe("Failed to obtain 2D context for preview image creation");
12372
12388
  const m = Sa(u.layoutState.layout, u.layoutState.elements, {
12373
12389
  renderingConfiguration: {
12374
- purpose: Ht.Print,
12390
+ purpose: qt.Print,
12375
12391
  region: { left: A.x, top: A.y, width: A.width, height: A.height },
12376
12392
  templatingContext: this.workflowManager.getTemplatingContext()
12377
12393
  }
@@ -12544,7 +12560,7 @@ class Oo {
12544
12560
  }
12545
12561
  async save(t) {
12546
12562
  if (!this.getCommandContext().getState())
12547
- throw new G("State undefined!");
12563
+ throw new z("State undefined!");
12548
12564
  const n = {
12549
12565
  title: await (async () => {
12550
12566
  var l;
@@ -12567,10 +12583,10 @@ class Oo {
12567
12583
  var s;
12568
12584
  const t = St(this.getCommandContext().getState());
12569
12585
  if (!t)
12570
- throw new G("Internal state is undefined! Cannot copy experience!");
12586
+ throw new z("Internal state is undefined! Cannot copy experience!");
12571
12587
  const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
12572
12588
  if (!n)
12573
- throw new G("Integration product id is undefined!");
12589
+ throw new z("Integration product id is undefined!");
12574
12590
  return await this.getClient().getWorkflowExperience({
12575
12591
  type: "integration",
12576
12592
  integrationProductId: n,
@@ -12681,7 +12697,7 @@ const $o = [
12681
12697
  "textPath",
12682
12698
  "tref",
12683
12699
  "tspan"
12684
- ], Uo = async (r, t, e) => {
12700
+ ], Lo = async (r, t, e) => {
12685
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);
12686
12702
  o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12687
12703
  const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await sn(l, { type: "svg" }))}`, A = (h) => {
@@ -12708,7 +12724,7 @@ const $o = [
12708
12724
  } catch (h) {
12709
12725
  return console.error(h), [];
12710
12726
  }
12711
- }, Lo = async (r, t, e, a) => {
12727
+ }, Uo = async (r, t, e, a) => {
12712
12728
  const n = e.data, i = n.assetUrl, s = await sa(i);
12713
12729
  try {
12714
12730
  const o = is(n, a.option);
@@ -12835,8 +12851,8 @@ const $o = [
12835
12851
  } catch (B) {
12836
12852
  return console.error(B), [];
12837
12853
  }
12838
- }, zo = async (r, t, e) => {
12839
- const a = await qn(e.data.module), n = t.data, i = (o, l) => {
12854
+ }, Go = async (r, t, e) => {
12855
+ const a = await Hn(e.data.module), n = t.data, i = (o, l) => {
12840
12856
  const c = r.find((A) => A.panelId === l.panelId);
12841
12857
  if (!c)
12842
12858
  throw new J(l);
@@ -12865,7 +12881,7 @@ const $o = [
12865
12881
  } catch (o) {
12866
12882
  return console.error(o), [];
12867
12883
  }
12868
- }, Go = async (r, t, e, a) => {
12884
+ }, zo = async (r, t, e, a) => {
12869
12885
  var d, A;
12870
12886
  const n = e.data, i = a.option;
12871
12887
  if (!i)
@@ -13031,7 +13047,7 @@ const $o = [
13031
13047
  });
13032
13048
  }
13033
13049
  return a;
13034
- }, Ho = async (r, t, e, a) => {
13050
+ }, qo = async (r, t, e, a) => {
13035
13051
  const n = [], i = e.data, s = 30, o = (p) => p.vertical ? "center" : p.textAlign || "center", l = () => {
13036
13052
  var w;
13037
13053
  const p = a.option;
@@ -13120,7 +13136,7 @@ const $o = [
13120
13136
  n.push(new W(C, f));
13121
13137
  }
13122
13138
  return n;
13123
- }, qo = (r, t) => r.conditions ? r.conditions.every((e) => {
13139
+ }, Ho = (r, t) => r.conditions ? r.conditions.every((e) => {
13124
13140
  const a = t[e.targetStepName];
13125
13141
  if (a && a.selectedVariants) {
13126
13142
  const n = a.selectedVariants;
@@ -13137,13 +13153,13 @@ const $o = [
13137
13153
  switch (o.type) {
13138
13154
  case P.DigitalContent:
13139
13155
  n.push(
13140
- ...await Uo(e, s, o)
13156
+ ...await Lo(e, s, o)
13141
13157
  );
13142
13158
  break;
13143
13159
  case P.Frame:
13144
13160
  case P.Photo:
13145
13161
  n.push(
13146
- ...await Lo(e, i, s, o)
13162
+ ...await Uo(e, i, s, o)
13147
13163
  );
13148
13164
  break;
13149
13165
  case P.Illustration:
@@ -13157,11 +13173,11 @@ const $o = [
13157
13173
  );
13158
13174
  break;
13159
13175
  case P.Module:
13160
- n.push(...await zo(e, s, o));
13176
+ n.push(...await Go(e, s, o));
13161
13177
  break;
13162
13178
  case P.Picture:
13163
13179
  n.push(
13164
- ...await Go(e, i, s, o)
13180
+ ...await zo(e, i, s, o)
13165
13181
  );
13166
13182
  break;
13167
13183
  case P.Shape:
@@ -13171,13 +13187,13 @@ const $o = [
13171
13187
  break;
13172
13188
  case P.Text:
13173
13189
  n.push(
13174
- ...await Ho(e, i, s, o)
13190
+ ...await qo(e, i, s, o)
13175
13191
  );
13176
13192
  break;
13177
13193
  }
13178
13194
  }
13179
13195
  for (const s of t.steps)
13180
- 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(
13181
13197
  ...await jo(e, s, a)
13182
13198
  );
13183
13199
  return n;
@@ -13345,7 +13361,7 @@ class Zo extends Dn {
13345
13361
  l = i.width, c = i.height;
13346
13362
  const d = Sa(t.layoutState.layout, e, {
13347
13363
  renderingConfiguration: {
13348
- purpose: Ht.ThreeD,
13364
+ purpose: qt.ThreeD,
13349
13365
  templatingContext: (m = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : m.getTemplatingContext()
13350
13366
  }
13351
13367
  }), A = un(d), u = await Aa.from(this.ctx, A, {
@@ -13379,7 +13395,7 @@ const Xc = (r, t) => {
13379
13395
  serializableWorkflow: { steps: [] },
13380
13396
  layouts: {}
13381
13397
  };
13382
- n = new $(e.map((l) => new Un(l))).apply(n);
13398
+ n = new $(e.map((l) => new Ln(l))).apply(n);
13383
13399
  const s = await Yo(r, t, e, a);
13384
13400
  return new $(s).apply(n);
13385
13401
  };
@@ -13427,19 +13443,19 @@ class tl {
13427
13443
  }
13428
13444
  async createHandle(t) {
13429
13445
  switch (t.type) {
13430
- case z.FileUpload:
13446
+ case G.FileUpload:
13431
13447
  return new el(this.bundle, t).initialize();
13432
- case z.ColorOption:
13448
+ case G.ColorOption:
13433
13449
  return new Ja(
13434
13450
  this.bundle,
13435
13451
  t,
13436
13452
  t.entityId ? await Y.getOption(t.entityId) : void 0
13437
13453
  );
13438
- case z.Option: {
13454
+ case G.Option: {
13439
13455
  const e = t.entityId ? await Y.getOption(t.entityId) : void 0;
13440
13456
  return (e == null ? void 0 : e.type) === "Color" ? new Ja(this.bundle, t, e) : new Xn(this.bundle, t, e);
13441
13457
  }
13442
- case z.Text:
13458
+ case G.Text:
13443
13459
  return new al(this.bundle, t);
13444
13460
  default:
13445
13461
  throw new Error("Unhandled Global Property Aspect Type");
@@ -13484,18 +13500,16 @@ class Ia {
13484
13500
  * Returns all steps that share this property.
13485
13501
  * @param targetExperiences Optionally filter the steps to only those in the given experiences.
13486
13502
  */
13487
- getSharedSteps(t) {
13488
- return (t ?? this.bundle.getWorkflowExperiences()).flatMap(
13489
- (n) => n.getStepsConditionallyActive().filter((i) => {
13490
- var s;
13491
- return i.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (s = i.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : s.some(
13492
- (o) => {
13493
- var l, c;
13494
- return o.globalPropertyConfigurationId === ((c = (l = this.bundle.getProductCollection()) == null ? void 0 : l.getResource().globalPropertyConfiguration) == null ? void 0 : c.id) && o.aspectName === this.property.name;
13495
- }
13496
- );
13497
- })
13498
- );
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
+ }));
13499
13513
  }
13500
13514
  getStateValue() {
13501
13515
  return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
@@ -13567,7 +13581,7 @@ class el extends Ia {
13567
13581
  const e = await this.getOriginalImage();
13568
13582
  if (!e)
13569
13583
  throw new Error("You must supply an image selection before attempting to remove the background.");
13570
- const a = this.bundle.getGlobalPropertyStateManager(), n = await U.removeBackgroundFromAsset(e), s = {
13584
+ const a = this.bundle.getGlobalPropertyStateManager(), n = await L.removeBackgroundFromAsset(e), s = {
13571
13585
  ...a.getAspectStorage(this.property.name),
13572
13586
  backgroundRemovedAssetKey: n.key,
13573
13587
  useOriginalAsset: !t
@@ -13587,7 +13601,7 @@ class el extends Ia {
13587
13601
  async getImage() {
13588
13602
  const t = this.getStateValue();
13589
13603
  if (t)
13590
- return U.getLocalOrFromServer(t);
13604
+ return L.getLocalOrFromServer(t);
13591
13605
  }
13592
13606
  async getImageWithColors() {
13593
13607
  var t, e;
@@ -13600,7 +13614,7 @@ class el extends Ia {
13600
13614
  async getOriginalImage() {
13601
13615
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13602
13616
  if (t != null && t.originalAssetKey)
13603
- return U.getLocalOrFromServer(t.originalAssetKey);
13617
+ return L.getLocalOrFromServer(t.originalAssetKey);
13604
13618
  }
13605
13619
  /**
13606
13620
  * Retrieves the version of the image selection that has the background removed, if one exists.
@@ -13609,7 +13623,7 @@ class el extends Ia {
13609
13623
  async getBackgroundRemovedImage() {
13610
13624
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13611
13625
  if (t != null && t.backgroundRemovedAssetKey)
13612
- return U.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13626
+ return L.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13613
13627
  }
13614
13628
  getUseOriginalImage() {
13615
13629
  var t;
@@ -13641,26 +13655,26 @@ class el extends Ia {
13641
13655
  }
13642
13656
  o.push(this.loadImageData()), await Promise.all(o), this.updateSharedStepStorage(i);
13643
13657
  }
13644
- async applyGlobalState(t) {
13645
- const e = this.getStateValue();
13646
- if (!e)
13647
- return;
13648
- const a = await U.getLocalOrFromServer(e);
13658
+ async applyGlobalState(t, e) {
13659
+ const a = this.getStateValue();
13649
13660
  if (!a)
13650
13661
  return;
13651
- await this.applyImageSelection(a, t, !1, !0);
13652
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13653
- if (n) {
13654
- if (this.updateSharedStepStorage({ ...n }), n.colors) {
13655
- const i = new Map(
13656
- 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 }]) ?? []
13657
13671
  );
13658
- this.getSharedSteps(t).forEach((s) => {
13659
- s.changeColors(i);
13672
+ this.getSharedSteps(t, e).forEach((o) => {
13673
+ o.changeColors(s);
13660
13674
  });
13661
13675
  }
13662
13676
  } else
13663
- 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 });
13664
13678
  }
13665
13679
  getAvailableColors() {
13666
13680
  var t, e, a, n;
@@ -13687,22 +13701,22 @@ class el extends Ia {
13687
13701
  var e;
13688
13702
  return (e = this.imageData) != null && e.svg ? (await lt(this.imageData.svg)).colors : void 0;
13689
13703
  }
13690
- async changeColors(t) {
13691
- var i;
13692
- if (!((i = this.imageData) != null && i.svg))
13704
+ async changeColors(t, e) {
13705
+ var s;
13706
+ if (!((s = this.imageData) != null && s.svg))
13693
13707
  return;
13694
- const e = this.getSharedSteps(), a = new Map(Object.entries(t));
13695
- e.forEach((s) => {
13696
- 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);
13697
13711
  });
13698
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13712
+ const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13699
13713
  await Promise.all([
13700
13714
  this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, {
13701
- ...n,
13702
- colors: Object.entries(t).map(([s, o]) => ({
13703
- key: s,
13704
- browserValue: o.browserValue,
13705
- pmsValue: o.pmsValue
13715
+ ...i,
13716
+ colors: Object.entries(t).map(([o, l]) => ({
13717
+ key: o,
13718
+ browserValue: l.browserValue,
13719
+ pmsValue: l.pmsValue
13706
13720
  }))
13707
13721
  }),
13708
13722
  await this.loadImageData()
@@ -13752,10 +13766,10 @@ class al extends Ia {
13752
13766
  /**
13753
13767
  * Set the text.
13754
13768
  */
13755
- async setText(t) {
13769
+ async setText(t, e) {
13756
13770
  await Promise.all([
13757
13771
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
13758
- this.applyTextSelection(t)
13772
+ this.applyTextSelection(t, void 0, e)
13759
13773
  ]);
13760
13774
  }
13761
13775
  async applyGlobalState(t) {
@@ -13764,11 +13778,11 @@ class al extends Ia {
13764
13778
  return Promise.resolve();
13765
13779
  await this.applyTextSelection(e, t);
13766
13780
  }
13767
- async applyTextSelection(t, e) {
13768
- const n = this.getSharedSteps(e).map((i) => {
13769
- i.setText(t);
13781
+ async applyTextSelection(t, e, a) {
13782
+ const i = this.getSharedSteps(e, a).map((s) => {
13783
+ s.setText(t);
13770
13784
  });
13771
- await Promise.all(n);
13785
+ await Promise.all(i);
13772
13786
  }
13773
13787
  }
13774
13788
  class Xn extends Ia {
@@ -13827,10 +13841,10 @@ class Xn extends Ia {
13827
13841
  * Select a given variant on the option for all shared steps.
13828
13842
  * @param variant The variant to select.
13829
13843
  */
13830
- async selectVariant(t, e) {
13844
+ async selectVariant(t, e, a) {
13831
13845
  await Promise.all([
13832
13846
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
13833
- this.applyVariantSelection(t)
13847
+ this.applyVariantSelection(t, void 0, a)
13834
13848
  ]);
13835
13849
  }
13836
13850
  async applyGlobalState(t) {
@@ -13841,9 +13855,9 @@ class Xn extends Ia {
13841
13855
  const a = (i = (n = this.optionResource) == null ? void 0 : n.variants) == null ? void 0 : i.find((s) => s.id === e);
13842
13856
  return a ? this.applyVariantSelection(new st(a), t) : Promise.resolve();
13843
13857
  }
13844
- async applyVariantSelection(t, e) {
13845
- const n = this.getSharedSteps(e).map((i) => i.selectVariant(t));
13846
- 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);
13847
13861
  }
13848
13862
  }
13849
13863
  class Ja extends Xn {
@@ -13892,8 +13906,8 @@ class Ja extends Xn {
13892
13906
  /**
13893
13907
  * Sets a custom color on the global state.
13894
13908
  */
13895
- setCustomColor(t) {
13896
- 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 });
13897
13911
  }
13898
13912
  /**
13899
13913
  * Gets the custom color used by the global state.
@@ -14039,15 +14053,15 @@ class il {
14039
14053
  let i = n.type && n.storage ? {} : void 0;
14040
14054
  if (i)
14041
14055
  switch (n.type) {
14042
- case z.FileUpload: {
14056
+ case G.FileUpload: {
14043
14057
  i.fileUpload = n.storage;
14044
14058
  break;
14045
14059
  }
14046
- case z.Option: {
14060
+ case G.Option: {
14047
14061
  i.option = n.storage;
14048
14062
  break;
14049
14063
  }
14050
- case z.ColorOption: {
14064
+ case G.ColorOption: {
14051
14065
  i = n.storage;
14052
14066
  break;
14053
14067
  }
@@ -14319,7 +14333,7 @@ class Zn {
14319
14333
  async filterProducts(t, e, a, n) {
14320
14334
  var l, c;
14321
14335
  const i = await b.getShadowGraphqlClient().query({
14322
- query: zs,
14336
+ query: Gs,
14323
14337
  errorPolicy: "all",
14324
14338
  variables: {
14325
14339
  id: this.getId(),
@@ -14359,7 +14373,7 @@ class Zn {
14359
14373
  };
14360
14374
  }
14361
14375
  const o = new AbortController(), { signal: l } = o, c = b.getShadowGraphqlClient().watchQuery({
14362
- query: Gs,
14376
+ query: zs,
14363
14377
  variables: {
14364
14378
  id: this.getId(),
14365
14379
  limit: e,
@@ -14725,7 +14739,7 @@ class Je {
14725
14739
  }
14726
14740
  console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((m) => {
14727
14741
  const g = m.map((p) => {
14728
- if (p.getType() === z.ColorOption || p.getType() === z.Option) {
14742
+ if (p.getType() === G.ColorOption || p.getType() === G.Option) {
14729
14743
  const f = p;
14730
14744
  if (this.globalPropertyStateManager.getGlobalPropertyState())
14731
14745
  return f.initDefaultVariant();
@@ -14855,12 +14869,13 @@ class Je {
14855
14869
  async applyGlobalPropertyState(t) {
14856
14870
  var a;
14857
14871
  const e = await this.globalPropertyHandleService.getHandles();
14858
- console.log(`LOG: ${e.length} handles`);
14859
14872
  for (const n of t.aspects) {
14873
+ for (const o of this.workflowExperiences)
14874
+ o.getWorkflowManager().unsetInitialized();
14860
14875
  const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
14861
- if (console.log(`LOG: handle for ${i}? ${s}`), s)
14876
+ if (s)
14862
14877
  switch (n.type) {
14863
- case z.FileUpload: {
14878
+ case G.FileUpload: {
14864
14879
  const o = s, l = await ve([n.value]);
14865
14880
  l.length > 0 && await o.selectImage(l[0]);
14866
14881
  const c = (a = n.storage) == null ? void 0 : a.colors;
@@ -14868,26 +14883,26 @@ class Je {
14868
14883
  const d = Object.fromEntries(
14869
14884
  c.map((A) => [A.key, { browserValue: A.browserValue, pmsValue: A.pmsValue }]) ?? []
14870
14885
  );
14871
- await o.changeColors(d);
14886
+ await o.changeColors(d, !0);
14872
14887
  }
14873
14888
  break;
14874
14889
  }
14875
- case z.ColorOption: {
14890
+ case G.ColorOption: {
14876
14891
  const o = s;
14877
- if (n.type === z.ColorOption) {
14892
+ if (n.type === G.ColorOption) {
14878
14893
  const c = o.getAllVariants().find((d) => d.getId() === n.value);
14879
14894
  c && await o.selectVariant(c);
14880
14895
  } else
14881
- o.setCustomColor(n.value);
14896
+ o.setCustomColor(n.value, !0);
14882
14897
  break;
14883
14898
  }
14884
- case z.Option: {
14899
+ case G.Option: {
14885
14900
  const o = s, c = o.getAllVariants().find((d) => d.getId() === n.value);
14886
- 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);
14887
14902
  break;
14888
14903
  }
14889
- case z.Text: {
14890
- await s.setText(n.value);
14904
+ case G.Text: {
14905
+ console.log(`LOG: text ${n.value}`), await s.setText(n.value, !0);
14891
14906
  break;
14892
14907
  }
14893
14908
  }
@@ -14897,7 +14912,7 @@ class Je {
14897
14912
  return this.globalPropertyStateManager;
14898
14913
  }
14899
14914
  async getGlobalPropertyTotalSubunits() {
14900
- return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === z.Option).map((a) => {
14915
+ return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === G.Option).map((a) => {
14901
14916
  var n;
14902
14917
  return ((n = a.getCurrentVariant()) == null ? void 0 : n.getPrice()) || 0;
14903
14918
  }).reduce((a, n) => a + n, 0);
@@ -14916,7 +14931,7 @@ class Je {
14916
14931
  const c = (e = this.getGlobalPropertyConfiguration()) == null ? void 0 : e.aspects.find(
14917
14932
  (d) => d.name === l
14918
14933
  );
14919
- if (c && c.type === z.ColorOption) {
14934
+ if (c && c.type === G.ColorOption) {
14920
14935
  const d = (a = s.getCurrentVariant()) == null ? void 0 : a.getAssetResource(), A = ((n = d == null ? void 0 : d.assetConfiguration) == null ? void 0 : n.channelNumbers) || [], u = ((i = d == null ? void 0 : d.assetConfiguration) == null ? void 0 : i.defaultColorVariants) || [], h = rl(
14921
14936
  this.getWorkflowExperiences(),
14922
14937
  this.globalConfigurationPropertyId || "",
@@ -14984,7 +14999,7 @@ class Je {
14984
14999
  throw new Error("Unable to add transaction to bundle - Already Exists!");
14985
15000
  const s = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(a);
14986
15001
  await b.getShadowGraphqlClient().mutate({
14987
- mutation: qs,
15002
+ mutation: Hs,
14988
15003
  variables: {
14989
15004
  id: this.id,
14990
15005
  transactionId: a
@@ -15167,7 +15182,7 @@ class Je {
15167
15182
  }
15168
15183
  async getAllStakeholders() {
15169
15184
  const t = await b.getShadowGraphqlClient().query({
15170
- query: qa,
15185
+ query: Ha,
15171
15186
  errorPolicy: "all",
15172
15187
  fetchPolicy: "no-cache",
15173
15188
  variables: {
@@ -15184,7 +15199,7 @@ class Je {
15184
15199
  }
15185
15200
  async getCurrentStakeholder() {
15186
15201
  const t = await b.getShadowGraphqlClient().query({
15187
- query: qa,
15202
+ query: Ha,
15188
15203
  errorPolicy: "all",
15189
15204
  fetchPolicy: "no-cache",
15190
15205
  variables: {
@@ -15339,7 +15354,7 @@ class Je {
15339
15354
  async updateBundle() {
15340
15355
  var e;
15341
15356
  if (!((e = (await b.getShadowGraphqlClient().mutate({
15342
- mutation: Hs,
15357
+ mutation: qs,
15343
15358
  variables: {
15344
15359
  id: this.id,
15345
15360
  name: this.name,
@@ -15839,7 +15854,7 @@ class Il {
15839
15854
  ));
15840
15855
  }
15841
15856
  }
15842
- const Lt = new Il(), Pl = async (r, t) => {
15857
+ const Ut = new Il(), Pl = async (r, t) => {
15843
15858
  var n;
15844
15859
  const e = await b.getShadowGraphqlClient().query({
15845
15860
  query: ki(((n = t == null ? void 0 : t.assets) == null ? void 0 : n.metadata) || !1),
@@ -15858,8 +15873,8 @@ const Lt = new Il(), Pl = async (r, t) => {
15858
15873
  return a.forEach((i) => {
15859
15874
  i.steps.forEach((s) => {
15860
15875
  var o, l, c;
15861
- 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) => {
15862
- 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);
15863
15878
  }), Jt.set({ id: s.option.id }, Promise.resolve(s.option)));
15864
15879
  }), i.finalizeStepConfig || (i.finalizeStepConfig = {}), i.finalizeStepConfig.termsMarkdown = i.finalizeStepConfig.termsMarkdown || i.partner.termsMarkdown;
15865
15880
  }), a;
@@ -15905,17 +15920,17 @@ class rd {
15905
15920
  } catch (a) {
15906
15921
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15907
15922
  }
15908
- }, 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.0e36ff9d-5cc0-5085-abc6-bbccac541a12"), 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("------------------------");
15909
15924
  }
15910
15925
  configure(t) {
15911
- 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);
15912
15927
  }
15913
15928
  /**
15914
15929
  * @returns The asset manager allows for common operations related to assets
15915
15930
  * and the Spiff Commerce platform.
15916
15931
  */
15917
15932
  getAssetManager() {
15918
- return U;
15933
+ return L;
15919
15934
  }
15920
15935
  getCurrencyCode() {
15921
15936
  if (this.currencyCode === void 0)
@@ -16115,7 +16130,7 @@ class rd {
16115
16130
  return !1;
16116
16131
  const n = JSON.parse(e), i = (/* @__PURE__ */ new Date()).getTime() / 1e3;
16117
16132
  if (!n.ExpiresIn || n.ExpiresIn < i - parseInt(t)) {
16118
- const l = await Lt.refreshTokens();
16133
+ const l = await Ut.refreshTokens();
16119
16134
  if (l != null && l.AuthenticationResult)
16120
16135
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), n.AccessToken = l.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(n));
16121
16136
  else
@@ -16140,14 +16155,14 @@ class rd {
16140
16155
  variables: {
16141
16156
  emailAddress: t
16142
16157
  }
16143
- }), await Lt.generateCode(t);
16158
+ }), await Ut.generateCode(t);
16144
16159
  }
16145
16160
  /**
16146
16161
  * Verify an email code to log in as a Spiff user.
16147
16162
  * Always returns true if it doesn't throw.
16148
16163
  */
16149
16164
  async verifyCode(t, e) {
16150
- 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);
16151
16166
  if (n != null && n.AuthenticationResult) {
16152
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);
16153
16168
  const s = (await b.getShadowGraphqlClient().query({
@@ -16177,7 +16192,7 @@ class rd {
16177
16192
  throw new Error("No token data in storage.");
16178
16193
  const a = JSON.parse(e), n = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !(a != null && a.AccessToken) || Wt(a.AccessToken);
16179
16194
  if (!a.ExpiresIn || a.ExpiresIn < n - parseInt(t) || i) {
16180
- const s = await Lt.refreshTokens();
16195
+ const s = await Ut.refreshTokens();
16181
16196
  if (s != null && s.AuthenticationResult)
16182
16197
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), a.AccessToken = s.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(a));
16183
16198
  else
@@ -16248,7 +16263,7 @@ class rd {
16248
16263
  ...o,
16249
16264
  ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16250
16265
  }, c = await b.getShadowGraphqlClient().query({
16251
- 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),
16252
16267
  variables: {
16253
16268
  id: t
16254
16269
  },
@@ -16347,7 +16362,7 @@ class rd {
16347
16362
  if (!this.customer)
16348
16363
  throw new Error("Customer not authenticated.");
16349
16364
  const t = await b.getShadowGraphqlClient().query({
16350
- query: Ls,
16365
+ query: Us,
16351
16366
  variables: {
16352
16367
  id: this.customer.id
16353
16368
  },
@@ -16457,9 +16472,9 @@ class rd {
16457
16472
  layouts: [],
16458
16473
  singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
16459
16474
  stateMutationFunc: I ? async () => {
16460
- throw new G("State mutation is forbidden in read only mode!");
16461
- } : async (H) => this.updateTransactionState({
16462
- ...H,
16475
+ throw new z("State mutation is forbidden in read only mode!");
16476
+ } : async (q) => this.updateTransactionState({
16477
+ ...q,
16463
16478
  context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
16464
16479
  }),
16465
16480
  graphQlClient: () => nt,
@@ -16468,11 +16483,11 @@ class rd {
16468
16483
  isReloadedTransaction: k.type === "transaction"
16469
16484
  };
16470
16485
  if (k.type === "transaction" && E.workflowState) {
16471
- const H = JSON.parse(E.workflowState);
16472
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await za(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;
16473
16488
  } else if (!I && k.workflowState) {
16474
- const H = JSON.parse(k.workflowState);
16475
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await za(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;
16476
16491
  } else
16477
16492
  R.layouts = Fl(
16478
16493
  R.transaction,
@@ -16759,7 +16774,7 @@ class Tl {
16759
16774
  if (!n || !this.frameData)
16760
16775
  return;
16761
16776
  if (this.frameData.length !== t.length)
16762
- throw new G(
16777
+ throw new z(
16763
16778
  "Frame data and offsets are not the same length. This is a bug. Please report it."
16764
16779
  );
16765
16780
  if (!this.offsets.some((s, o) => !(t[o].x === s.x && t[o].y === s.y && t[o].zoom === s.zoom)) && !a) {
@@ -16803,9 +16818,9 @@ class Tl {
16803
16818
  */
16804
16819
  updateFrameOffsets(t, e, a, n, i) {
16805
16820
  if (!a || a.length === 0 || a.some((o) => !o))
16806
- throw new G("Frame data not set. This is a bug");
16821
+ throw new z("Frame data not set. This is a bug");
16807
16822
  if (!this.workflowManager)
16808
- throw new G("No workflow manager set, cannot update offsets.");
16823
+ throw new z("No workflow manager set, cannot update offsets.");
16809
16824
  const s = this.workflowManager.getCommandDispatcher();
16810
16825
  this.targetElements.forEach((o, l) => {
16811
16826
  s(
@@ -17077,7 +17092,7 @@ class Ql extends it {
17077
17092
  const e = await this.getOriginalImageSelection();
17078
17093
  if (!e)
17079
17094
  throw new Error("You must supply an image selection before attempting to remove the background.");
17080
- const a = await U.removeBackgroundFromAsset(e);
17095
+ const a = await L.removeBackgroundFromAsset(e);
17081
17096
  t && await wt.selectImage(this.step, a, this.manager, !1);
17082
17097
  const n = ((i = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : i.framePatternData) || {};
17083
17098
  return this.manager.updateStorage(this.step.stepName, {
@@ -17136,13 +17151,13 @@ class Ql extends it {
17136
17151
  var e, a;
17137
17152
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.originalAssetKey;
17138
17153
  if (t)
17139
- return U.getLocalOrFromServer(t);
17154
+ return L.getLocalOrFromServer(t);
17140
17155
  }
17141
17156
  async getBackgroundRemovedImageSelection() {
17142
17157
  var e, a;
17143
17158
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.backgroundRemovedAssetKey;
17144
17159
  if (t)
17145
- return U.getLocalOrFromServer(t);
17160
+ return L.getLocalOrFromServer(t);
17146
17161
  }
17147
17162
  hasOriginalImageSelection() {
17148
17163
  var t, e;
@@ -17239,7 +17254,7 @@ const Rl = v`
17239
17254
  workflowViewerLink
17240
17255
  }
17241
17256
  }
17242
- `, Ul = v`
17257
+ `, Ll = v`
17243
17258
  query GetCustomerBundles($id: String!, $limit: Int!, $offset: Int!) {
17244
17259
  customerBundlesFeed(id: $id, limit: $limit, offset: $offset) {
17245
17260
  items {
@@ -17254,7 +17269,7 @@ const Rl = v`
17254
17269
  total
17255
17270
  }
17256
17271
  }
17257
- `, Ll = v`
17272
+ `, Ul = v`
17258
17273
  query GetTransactionsForBundle($id: String!) {
17259
17274
  bundles(ids: [$id]) {
17260
17275
  id
@@ -17282,14 +17297,14 @@ const Rl = v`
17282
17297
  name
17283
17298
  }
17284
17299
  }
17285
- `, zl = v`
17300
+ `, Gl = v`
17286
17301
  mutation DuplicateBundle($id: String!, $template: Boolean!) {
17287
17302
  bundleDuplicate(id: $id, template: $template) {
17288
17303
  id
17289
17304
  workflowViewerLink
17290
17305
  }
17291
17306
  }
17292
- `, Gl = v`
17307
+ `, zl = v`
17293
17308
  query GetBundleTemplates($id: String!, $limit: Int!, $offset: Int!) {
17294
17309
  customerBundlesFeed(id: $id, limit: $limit, offset: $offset, template: true) {
17295
17310
  items {
@@ -17318,7 +17333,7 @@ const Rl = v`
17318
17333
  name: t
17319
17334
  }
17320
17335
  }), ud = async (r, t) => await b.getShadowGraphqlClient().mutate({
17321
- mutation: zl,
17336
+ mutation: Gl,
17322
17337
  errorPolicy: "all",
17323
17338
  variables: {
17324
17339
  id: r,
@@ -17338,7 +17353,7 @@ const Rl = v`
17338
17353
  email: r
17339
17354
  }
17340
17355
  })).data.customer, gd = async (r, t, e) => await b.getShadowGraphqlClient().query({
17341
- query: Ul,
17356
+ query: Ll,
17342
17357
  errorPolicy: "all",
17343
17358
  fetchPolicy: "no-cache",
17344
17359
  variables: {
@@ -17347,7 +17362,7 @@ const Rl = v`
17347
17362
  limit: t
17348
17363
  }
17349
17364
  }), pd = async (r, t) => await b.getShadowGraphqlClient().query({
17350
- query: Ll,
17365
+ query: Ul,
17351
17366
  errorPolicy: "all",
17352
17367
  fetchPolicy: "no-cache",
17353
17368
  variables: {
@@ -17425,7 +17440,7 @@ const Rl = v`
17425
17440
  }, yd = async (r, t, e) => {
17426
17441
  var n;
17427
17442
  const a = await b.getShadowGraphqlClient().query({
17428
- query: Gl,
17443
+ query: zl,
17429
17444
  errorPolicy: "all",
17430
17445
  fetchPolicy: "no-cache",
17431
17446
  variables: {
@@ -17459,7 +17474,7 @@ _ = { __e: function(r, t, e, a) {
17459
17474
  throw r;
17460
17475
  } }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
17461
17476
  var ot, Ke, _a, ar = [], _e = [], Xa = _.__b, Za = _.__r, tn = _.diffed, en = _.__c, an = _.unmount;
17462
- function Hl() {
17477
+ function ql() {
17463
17478
  for (var r; r = ar.shift(); )
17464
17479
  if (r.__P && r.__H)
17465
17480
  try {
@@ -17479,7 +17494,7 @@ _.__b = function(r) {
17479
17494
  }, _.diffed = function(r) {
17480
17495
  tn && tn(r);
17481
17496
  var t = r.__c;
17482
- 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) {
17483
17498
  e.i && (e.__H = e.i), e.__V !== _e && (e.__ = e.__V), e.i = void 0, e.__V = _e;
17484
17499
  })), Ke = ot = null;
17485
17500
  }, _.__c = function(r, t) {
@@ -17506,7 +17521,7 @@ _.__b = function(r) {
17506
17521
  }), e.__H = void 0, t && _.__e(t, e.__v));
17507
17522
  };
17508
17523
  var nn = typeof requestAnimationFrame == "function";
17509
- function ql(r) {
17524
+ function Hl(r) {
17510
17525
  var t, e = function() {
17511
17526
  clearTimeout(a), nn && cancelAnimationFrame(t), setTimeout(r);
17512
17527
  }, a = setTimeout(e, 100);
@@ -17649,12 +17664,12 @@ export {
17649
17664
  Zl as AddressValidationJobStatus,
17650
17665
  Xl as AddressValidationResultConfirmationLevel,
17651
17666
  ad as ArrayInput,
17652
- z as AspectType,
17667
+ G as AspectType,
17653
17668
  vt as AssetNotFoundError,
17654
17669
  Ce as AssetType,
17655
17670
  Jc as BringForwardCommand,
17656
17671
  Yc as BringToBackCommand,
17657
- qc as BringToFrontCommand,
17672
+ Hc as BringToFrontCommand,
17658
17673
  yr as BundleDesignCreationCartAddMode,
17659
17674
  O as CanvasCommand,
17660
17675
  de as CollectionProduct,
@@ -17663,7 +17678,7 @@ export {
17663
17678
  jl as ConversionDataType,
17664
17679
  Wl as ConversionLocation,
17665
17680
  W as CreateElementCommand,
17666
- Un as CreateLayoutCommand,
17681
+ Ln as CreateLayoutCommand,
17667
17682
  Bt as DeleteElementCommand,
17668
17683
  Eo as DigitalContentStepHandle,
17669
17684
  el as FileUploadGlobalPropertyHandle,
@@ -17684,16 +17699,16 @@ export {
17684
17699
  vo as InformationStepHandle,
17685
17700
  Ka as IntegrationProduct,
17686
17701
  vr as IntegrationType,
17687
- zc as LayoutElementFactory,
17702
+ Gc as LayoutElementFactory,
17688
17703
  M as LayoutElementType,
17689
17704
  J as LayoutNotFoundError,
17690
- Ht as LayoutRenderingPurpose,
17705
+ qt as LayoutRenderingPurpose,
17691
17706
  po as MaterialStepHandle,
17692
17707
  Se as MisconfigurationError,
17693
17708
  cd as MockWorkflowManager,
17694
17709
  fo as ModelStepHandle,
17695
17710
  Bo as ModuleStepHandle,
17696
- Gc as MoveCommand,
17711
+ zc as MoveCommand,
17697
17712
  tr as ObjectInput,
17698
17713
  Sl as ObjectInputType,
17699
17714
  Xn as OptionGlobalPropertyHandle,
@@ -17709,9 +17724,9 @@ export {
17709
17724
  wo as QuestionStepHandle,
17710
17725
  Dn as QueueablePromise,
17711
17726
  jc as ResizeCommand,
17712
- qt as ResourceNotFoundError,
17727
+ Ht as ResourceNotFoundError,
17713
17728
  Wc as RotateCommand,
17714
- q as ScaleAxis,
17729
+ H as ScaleAxis,
17715
17730
  Kc as SendBackwardsCommand,
17716
17731
  yo as ShapeStepHandle,
17717
17732
  Sr as ShareActionType,
@@ -17727,15 +17742,15 @@ export {
17727
17742
  So as TextStepHandle,
17728
17743
  ul as Transform,
17729
17744
  Al as TransformCollection,
17730
- G as UnhandledBehaviorError,
17745
+ z as UnhandledBehaviorError,
17731
17746
  Br as UnitOfMeasurement,
17732
- Hc as UpdateImageSourceCommand,
17747
+ qc as UpdateImageSourceCommand,
17733
17748
  st as Variant,
17734
17749
  Ro as WorkflowExperienceEventType,
17735
17750
  Oo as WorkflowExperienceImpl,
17736
- U as assetService,
17751
+ L as assetService,
17737
17752
  Kr as browserColorToHex,
17738
- Lc as cmPerPixel,
17753
+ Uc as cmPerPixel,
17739
17754
  Fo as createDesign,
17740
17755
  Oc as currentDirection,
17741
17756
  bc as dataUrlFromExternalUrl,
@@ -17747,7 +17762,7 @@ export {
17747
17762
  hd as duplicateTransaction,
17748
17763
  at as fetchAsString,
17749
17764
  Fc as findAngle,
17750
- L as findElement,
17765
+ U as findElement,
17751
17766
  Dc as findPmsColors,
17752
17767
  Vt as frameDataCache,
17753
17768
  wt as frameStepService,
@@ -17789,10 +17804,10 @@ export {
17789
17804
  kc as isCloseToValue,
17790
17805
  Nt as loadFont,
17791
17806
  Pc as matchHexToPms,
17792
- zn as materialStepService,
17807
+ Gn as materialStepService,
17793
17808
  cl as metafieldManager,
17794
- Uc as mmPerPixel,
17795
- Gn as modelStepService,
17809
+ Lc as mmPerPixel,
17810
+ zn as modelStepService,
17796
17811
  Ca as modifySVGColors,
17797
17812
  Wn as moduleStepService,
17798
17813
  dd as nameBundle,
@@ -17803,16 +17818,16 @@ export {
17803
17818
  N as persistenceService,
17804
17819
  jn as pictureStepService,
17805
17820
  Ic as pmsToRgb,
17806
- Hn as questionStepService,
17821
+ qn as questionStepService,
17807
17822
  Bc as registerFetchImplementation,
17808
17823
  Ec as registerWindowImplementation,
17809
- za as rehydrateSerializedLayout,
17810
- qr as rgbToPms,
17824
+ Ga as rehydrateSerializedLayout,
17825
+ Hr as rgbToPms,
17811
17826
  le as rotateAroundPoint,
17812
17827
  pa as sanitizeSvgTree,
17813
17828
  $r as setBearerAuthenticationToken,
17814
17829
  gn as setCanvasModule,
17815
- zt as shapeStepService,
17830
+ Gt as shapeStepService,
17816
17831
  hs as shortenUrl,
17817
17832
  mt as spiffCoreConfiguration,
17818
17833
  Xc as stepAspectValuesToDesignInputSteps,