@spiffcommerce/core 31.2.2 → 31.2.3-beta.026ad90d-92e9-500b-a212-bd6dfa71283c

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
@@ -4,32 +4,32 @@ import { onError as ur } from "@apollo/client/link/error";
4
4
  import { renderToStaticMarkup as hr } from "preact-render-to-string";
5
5
  import { removeTypenameFromVariables as mr } from "@apollo/client/link/remove-typename";
6
6
  import { orientation as gr } from "exifr/dist/mini.umd.cjs";
7
- import { parse as ln } from "css";
7
+ import { parse as on } from "css";
8
8
  import pr from "fuse.js";
9
9
  import { Pith as Aa } from "pith";
10
- import St from "lodash.clonedeep";
11
- import { toString as cn } from "qrcode";
10
+ import vt from "lodash.clonedeep";
11
+ import { toString as ln } from "qrcode";
12
12
  import fr from "svg-path-bbox";
13
13
  import { parse as ta } from "opentype.js";
14
14
  import { jsx as D, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
15
15
  import Cr from "handlebars";
16
16
  import { dataUriToBuffer as wr } from "data-uri-to-buffer";
17
- import xa from "lodash.chunk";
18
- import { CognitoIdentityProviderClient as yr, InitiateAuthCommand as ka, RespondToAuthChallengeCommand as Sr } from "@aws-sdk/client-cognito-identity-provider";
17
+ import Fa from "lodash.chunk";
18
+ import { CognitoIdentityProviderClient as yr, InitiateAuthCommand as xa, RespondToAuthChallengeCommand as Sr } from "@aws-sdk/client-cognito-identity-provider";
19
19
  import vr from "dinero.js";
20
- import * as Ma from "currency-codes";
21
- import dn from "lodash.isequal";
20
+ import * as ka from "currency-codes";
21
+ import cn from "lodash.isequal";
22
22
  import { split as ea } from "unicode-default-word-boundary";
23
- import An from "lodash.debounce";
23
+ import dn from "lodash.debounce";
24
24
  import "fs";
25
25
  import "path";
26
26
  var ye = /* @__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))(ye || {}), L = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(L || {}), v = /* @__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))(v || {}), Er = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Er || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), x = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(x || {}), br = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(br || {}), Br = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Br || {}), Ir = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Ir || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Pr = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Pr || {}), Se = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(Se || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), j = /* @__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))(j || {}), Dr = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Dr || {});
27
- class un extends Error {
27
+ class An extends Error {
28
28
  constructor(t) {
29
29
  super(t), this.name = this.constructor.name;
30
30
  }
31
31
  }
32
- class Xt extends un {
32
+ class Xt extends An {
33
33
  constructor(t) {
34
34
  super(`ConfigurationError - ${t}`);
35
35
  }
@@ -44,7 +44,7 @@ class Y extends Xt {
44
44
  super(`Panel not Found: ${t.panelId}`), this.panelId = t?.panelId || "N/A";
45
45
  }
46
46
  }
47
- class vt extends Xt {
47
+ class Et extends Xt {
48
48
  constructor(t) {
49
49
  super(`Asset not found for variant: ${t.name}`), this.variant = t;
50
50
  }
@@ -59,7 +59,7 @@ class Ee extends Xt {
59
59
  super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
60
60
  }
61
61
  }
62
- class xe extends un {
62
+ class xe extends An {
63
63
  constructor(t) {
64
64
  super(`ImplementationError - ${t}`);
65
65
  }
@@ -104,7 +104,7 @@ class Fr {
104
104
  this.set(t, a);
105
105
  }
106
106
  }
107
- class Ta {
107
+ class Ma {
108
108
  constructor() {
109
109
  this.storage = /* @__PURE__ */ new Map();
110
110
  }
@@ -129,9 +129,9 @@ class Ta {
129
129
  }
130
130
  const xr = () => {
131
131
  try {
132
- return localStorage ? new Fr() : new Ta();
132
+ return localStorage ? new Fr() : new Ma();
133
133
  } catch {
134
- return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Ta();
134
+ return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Ma();
135
135
  }
136
136
  }, k = xr();
137
137
  class kr {
@@ -183,19 +183,19 @@ function rt(r, t) {
183
183
  }
184
184
  return na(r, t);
185
185
  }
186
- const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @__PURE__ */ new Map(), mn = async (r) => {
187
- const t = Na.get(r);
186
+ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), hn = async (r) => {
187
+ const t = Ta.get(r);
188
188
  if (t) return t;
189
189
  const a = (async () => {
190
190
  const n = await rt(r);
191
- return hn.set(r, n.headers?.get("content-type") || ""), await n.arrayBuffer();
191
+ return un.set(r, n.headers?.get("content-type") || ""), await n.arrayBuffer();
192
192
  })();
193
- return Na.set(r, a), a;
193
+ return Ta.set(r, a), a;
194
194
  }, Mr = async (r) => {
195
- const t = Qa.get(r);
195
+ const t = Na.get(r);
196
196
  if (t) return t;
197
197
  const a = (async () => await (await rt(r)).text())();
198
- return Qa.set(r, a), a;
198
+ return Na.set(r, a), a;
199
199
  }, Tt = (r) => r.every((t) => t !== "undefined"), se = (r) => Tt([typeof document]) ? document.createElement(r) : Zt().document.createElement(r), Tr = (r, t) => {
200
200
  if (Tt([typeof document]))
201
201
  return document.createElementNS(r, t);
@@ -207,7 +207,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
207
207
  const r = Zt();
208
208
  return new r.DOMParser();
209
209
  }, Nr = () => Tt([typeof DOMParser]) ? DOMParser : Zt().DOMParser, Me = (r, t) => new Promise((e, a) => {
210
- t ? mn(r).then(e).catch(a) : rt(r).then((n) => {
210
+ t ? hn(r).then(e).catch(a) : rt(r).then((n) => {
211
211
  n.arrayBuffer().then(e).catch(a);
212
212
  }).catch((n) => {
213
213
  a(n);
@@ -216,7 +216,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
216
216
  t ? Mr(r).then(e).catch(a) : rt(r).then((n) => {
217
217
  n.text().then(e).catch(a);
218
218
  }).catch(a);
219
- }), gn = (r) => hr(r), Ue = /* @__PURE__ */ new Map(), Qr = async (r, t) => {
219
+ }), mn = (r) => hr(r), Ue = /* @__PURE__ */ new Map(), Qr = async (r, t) => {
220
220
  if (Tt([typeof FontFace])) {
221
221
  if (Ue.has(t))
222
222
  return Ue.get(t);
@@ -230,7 +230,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
230
230
  return new XMLSerializer();
231
231
  const r = Zt();
232
232
  return new r.XMLSerializer();
233
- }, Ra = (r) => btoa(r), Te = (r) => {
233
+ }, Qa = (r) => btoa(r), Te = (r) => {
234
234
  function t() {
235
235
  const a = new Uint8Array(r), n = 4;
236
236
  if (a.length >= n) {
@@ -257,7 +257,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
257
257
  const e = t();
258
258
  return e || "image/svg+xml";
259
259
  }, Qc = async (r) => {
260
- const t = await mn(r), e = hn.get(r) || Te(t);
260
+ const t = await hn(r), e = un.get(r) || Te(t);
261
261
  return await $r(new Blob([t], { type: e }));
262
262
  }, Rr = (r) => {
263
263
  let t = "";
@@ -268,7 +268,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
268
268
  }, Or = async (r) => {
269
269
  const t = Te(r), e = new Uint8Array(r), a = Rr(e), n = btoa(a);
270
270
  return `data:${t};base64,${n}`;
271
- }, ha = (r) => `data:image/svg+xml;base64,${btoa(r)}`, pn = (r) => {
271
+ }, ha = (r) => `data:image/svg+xml;base64,${btoa(r)}`, gn = (r) => {
272
272
  const t = r.replace(/\r?\n/g, ""), e = t.indexOf(",");
273
273
  if (e === -1 || e <= 4)
274
274
  throw new TypeError("malformed data: URI");
@@ -291,9 +291,9 @@ let Ur, ma;
291
291
  const Lr = (r) => {
292
292
  ma = r;
293
293
  }, Vr = () => ma;
294
- let fn;
294
+ let pn;
295
295
  const zr = (r) => {
296
- fn = r;
296
+ pn = r;
297
297
  }, Gr = () => new Promise((r) => {
298
298
  const t = gt.getHubUrl(), e = (a) => {
299
299
  a.origin === t && (window.removeEventListener("message", e), r(a.data));
@@ -303,7 +303,7 @@ const zr = (r) => {
303
303
  const r = {
304
304
  applicationKey: ma,
305
305
  customerToken: Ur,
306
- bearer: fn
306
+ bearer: pn
307
307
  };
308
308
  return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Gr(), ...r } : r;
309
309
  };
@@ -369,8 +369,8 @@ const pt = (r, t, e) => {
369
369
  if (ra !== void 0)
370
370
  return ra(r, t, e);
371
371
  try {
372
- const a = wn(!0);
373
- return Cn(a), a.createCanvas(r, t, e);
372
+ const a = Cn(!0);
373
+ return fn(a), a.createCanvas(r, t, e);
374
374
  } catch {
375
375
  throw new Error("Canvas module not set");
376
376
  }
@@ -378,16 +378,16 @@ const pt = (r, t, e) => {
378
378
  if (ia !== void 0)
379
379
  return ia(r, t);
380
380
  try {
381
- const e = wn(!0);
382
- return Cn(e), e.loadImage(r, t);
381
+ const e = Cn(!0);
382
+ return fn(e), e.loadImage(r, t);
383
383
  } catch {
384
384
  throw new Error("Canvas module not set");
385
385
  }
386
386
  };
387
- function Cn(r) {
387
+ function fn(r) {
388
388
  ra = r?.createCanvas, ia = r?.loadImage;
389
389
  }
390
- function wn(r) {
390
+ function Cn(r) {
391
391
  try {
392
392
  if (document.createElement("canvas").getContext("2d"))
393
393
  return {
@@ -3187,23 +3187,23 @@ function $c(r, t) {
3187
3187
  let Qt = null;
3188
3188
  function ti(r) {
3189
3189
  if (r.startsWith("#"))
3190
- return Oa(r);
3190
+ return Ra(r);
3191
3191
  if (!document)
3192
3192
  throw new Error("browserColorToHex is only supported on browsers");
3193
3193
  if (Qt || (Qt = document.createElement("canvas").getContext("2d")), !Qt)
3194
3194
  throw new Error("Failed to create canvas context required to convert colors");
3195
3195
  Qt.fillStyle = r;
3196
- const t = Oa(Qt.fillStyle);
3196
+ const t = Ra(Qt.fillStyle);
3197
3197
  return t || console.error(`Unknown browser color ${r}`), t;
3198
3198
  }
3199
- function Oa(r) {
3199
+ function Ra(r) {
3200
3200
  const t = r.substring(1).toUpperCase();
3201
3201
  return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
3202
3202
  }
3203
3203
  const le = (r) => {
3204
- const t = yn(r.spotColor);
3204
+ const t = wn(r.spotColor);
3205
3205
  return t ? `${r.browserValue} ${t}` : r.browserValue;
3206
- }, yn = (r) => {
3206
+ }, wn = (r) => {
3207
3207
  if (!r)
3208
3208
  return "";
3209
3209
  if (r.profileName.includes("/") && r.profileName.includes(".icc")) {
@@ -3211,7 +3211,7 @@ const le = (r) => {
3211
3211
  return `icc-named-color(${t.slice(e + 1).slice(0, -4)}, ${r.namedColor})`;
3212
3212
  }
3213
3213
  return `icc-named-color(${r.profileName}, ${r.namedColor})`;
3214
- }, $a = (r) => {
3214
+ }, Oa = (r) => {
3215
3215
  const t = r.split(/[ ](?=[^)]*?(?:\(|$))/);
3216
3216
  if (t.length === 0)
3217
3217
  return { browserValue: "#000000" };
@@ -3255,7 +3255,7 @@ const le = (r) => {
3255
3255
  }
3256
3256
  if (a.tagName === "style") {
3257
3257
  try {
3258
- ln(a.innerHTML).stylesheet?.rules.forEach((s) => {
3258
+ on(a.innerHTML).stylesheet?.rules.forEach((s) => {
3259
3259
  e.push(s);
3260
3260
  }), a.remove();
3261
3261
  } catch (i) {
@@ -3287,9 +3287,9 @@ const le = (r) => {
3287
3287
  const t = /pt|pc|mm|cm|in/gm, e = r.getAttribute("viewBox"), a = r.getAttribute("width"), n = r.getAttribute("height");
3288
3288
  if (!e) throw new Error("viewBox not specified on SVG!");
3289
3289
  a && r.setAttribute("width", a.replace(t, "")), n && r.setAttribute("height", n.replace(t, ""));
3290
- }, Sn = (r) => dt().parseFromString(r, "image/svg+xml").firstElementChild, ii = (r, t, e) => {
3290
+ }, yn = (r) => dt().parseFromString(r, "image/svg+xml").firstElementChild, ii = (r, t, e) => {
3291
3291
  r.setAttribute("height", `${e}px`), r.setAttribute("width", `${t}px`);
3292
- }, vn = (r, t, e) => {
3292
+ }, Sn = (r, t, e) => {
3293
3293
  kt(r, (a) => {
3294
3294
  const n = a.attributes.getNamedItem("fill");
3295
3295
  n && n.value !== "none" && a.classList.forEach((s) => {
@@ -3328,16 +3328,16 @@ const le = (r) => {
3328
3328
  }
3329
3329
  });
3330
3330
  });
3331
- }, En = (r) => Bt().serializeToString(r), fa = (r, t, e, a, n) => {
3332
- const i = Sn(r);
3331
+ }, vn = (r) => Bt().serializeToString(r), fa = (r, t, e, a, n) => {
3332
+ const i = yn(r);
3333
3333
  if (!i)
3334
3334
  throw new Error("Failed to read SVG.");
3335
- return ii(i, t, e), vn(i, a, n), En(i);
3335
+ return ii(i, t, e), Sn(i, a, n), vn(i);
3336
3336
  }, Ca = (r, t, e) => {
3337
- const a = Sn(r);
3337
+ const a = yn(r);
3338
3338
  if (!a)
3339
3339
  throw new Error("Failed to read SVG.");
3340
- return vn(a, t, e), En(a);
3340
+ return Sn(a, t, e), vn(a);
3341
3341
  }, si = (r) => {
3342
3342
  const t = /<svg.*<\/svg>/s, e = r.match(t) || [], a = e?.length > 0 ? e[0] : "";
3343
3343
  return dt().parseFromString(a, "image/svg+xml");
@@ -3351,12 +3351,12 @@ const le = (r) => {
3351
3351
  ei.includes(s.tagName) && !s.attributes.getNamedItem("fill") && s.setAttribute("fill", "black");
3352
3352
  const o = s.attributes.getNamedItem("fill");
3353
3353
  if (o && o.value !== "none" && !o.value.startsWith("url(")) {
3354
- const c = $a(o.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
3354
+ const c = Oa(o.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
3355
3355
  s.setAttribute("fill", c.browserValue), s.classList.add(A), a[d] = c;
3356
3356
  }
3357
3357
  const l = s.attributes.getNamedItem("stroke");
3358
3358
  if (l && l.value !== "none" && !l.value.startsWith("url(")) {
3359
- const c = $a(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
3359
+ const c = Oa(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
3360
3360
  s.classList.add(A), s.setAttribute("stroke", c.browserValue), a[d] = c;
3361
3361
  }
3362
3362
  });
@@ -3748,7 +3748,7 @@ const Rt = "persistentAssets", lt = class lt {
3748
3748
  };
3749
3749
  lt.callbacks = [];
3750
3750
  let At = lt;
3751
- const Ua = "bgrmPersistentAssets";
3751
+ const $a = "bgrmPersistentAssets";
3752
3752
  class J {
3753
3753
  static has(t) {
3754
3754
  return J.getMap().has(t);
@@ -3775,10 +3775,10 @@ class J {
3775
3775
  a && (e.delete(a), J.setMap(e));
3776
3776
  }
3777
3777
  static getMap() {
3778
- return k.getMap(Ua) || /* @__PURE__ */ new Map();
3778
+ return k.getMap($a) || /* @__PURE__ */ new Map();
3779
3779
  }
3780
3780
  static setMap(t) {
3781
- k.setMap(Ua, t);
3781
+ k.setMap($a, t);
3782
3782
  }
3783
3783
  }
3784
3784
  const O = new mi();
@@ -3811,7 +3811,7 @@ class gi {
3811
3811
  this.disabled = t;
3812
3812
  }
3813
3813
  }
3814
- const Kt = new gi(), bn = w`
3814
+ const Kt = new gi(), En = w`
3815
3815
  fragment OptionFields on Option {
3816
3816
  id
3817
3817
  name
@@ -3851,7 +3851,7 @@ const Kt = new gi(), bn = w`
3851
3851
  `, pi = w`
3852
3852
  ${ee(!1)}
3853
3853
  ${wa}
3854
- ${bn}
3854
+ ${En}
3855
3855
  query GetOptions($ids: [String]!) {
3856
3856
  options(ids: $ids) {
3857
3857
  ...OptionFields
@@ -3920,7 +3920,7 @@ class yi {
3920
3920
  }
3921
3921
  }
3922
3922
  }
3923
- const H = new yi(), Bn = w`
3923
+ const H = new yi(), bn = w`
3924
3924
  fragment ActiveIntegrationFields on Integration {
3925
3925
  id
3926
3926
  logo
@@ -4048,7 +4048,7 @@ const H = new yi(), Bn = w`
4048
4048
  }
4049
4049
  }
4050
4050
  }
4051
- `, In = w`
4051
+ `, Bn = w`
4052
4052
  fragment StakeholderFields on Stakeholder {
4053
4053
  id
4054
4054
  type
@@ -4056,7 +4056,7 @@ const H = new yi(), Bn = w`
4056
4056
  authorizationNote
4057
4057
  authorizationStatus
4058
4058
  }
4059
- `, Pn = w`
4059
+ `, In = w`
4060
4060
  fragment TransactionShareActionFields on TransactionShareAction {
4061
4061
  id
4062
4062
  title
@@ -4067,9 +4067,9 @@ const H = new yi(), Bn = w`
4067
4067
  }
4068
4068
  `, vi = w`
4069
4069
  ${Qe}
4070
- ${In}
4071
- ${Pn}
4072
4070
  ${Bn}
4071
+ ${In}
4072
+ ${bn}
4073
4073
  query ReadTransactions($ids: [String]!) {
4074
4074
  transactions(ids: $ids) {
4075
4075
  customLogoLink
@@ -4332,7 +4332,7 @@ const H = new yi(), Bn = w`
4332
4332
  }
4333
4333
  }
4334
4334
  `, Pi = w`
4335
- ${Pn}
4335
+ ${In}
4336
4336
  query ReadTransactionForShareActions($id: String!) {
4337
4337
  transactions(ids: [$id]) {
4338
4338
  id
@@ -4342,14 +4342,14 @@ const H = new yi(), Bn = w`
4342
4342
  }
4343
4343
  }
4344
4344
  }
4345
- `, Dn = w`
4345
+ `, Pn = w`
4346
4346
  query ReadWorkflowStates($ids: [String]!) {
4347
4347
  transactions(ids: $ids) {
4348
4348
  id
4349
4349
  workflowState
4350
4350
  }
4351
4351
  }
4352
- `, Fn = (r) => w`
4352
+ `, Dn = (r) => w`
4353
4353
  ${Qe}
4354
4354
  fragment IntegrationProductFields on IntegrationProduct {
4355
4355
  id
@@ -4433,14 +4433,14 @@ const H = new yi(), Bn = w`
4433
4433
  }
4434
4434
  }
4435
4435
  `, Di = (r) => w`
4436
- ${Fn(r)}
4436
+ ${Dn(r)}
4437
4437
  query GetIntegrationProducts($ids: [String!]!) {
4438
4438
  integrationProducts(ids: $ids) {
4439
4439
  ...IntegrationProductFields
4440
4440
  }
4441
4441
  }
4442
4442
  `, Fi = (r) => w`
4443
- ${Fn(r)}
4443
+ ${Dn(r)}
4444
4444
  query GetIntegrationProductFromExternalIds($externalIntegrationId: String!, $externalProductId: String!) {
4445
4445
  integrationProductFromExternalIds(
4446
4446
  externalIntegrationId: $externalIntegrationId
@@ -4450,7 +4450,7 @@ const H = new yi(), Bn = w`
4450
4450
  }
4451
4451
  }
4452
4452
  `, xi = w`
4453
- ${In}
4453
+ ${Bn}
4454
4454
  query ReadTransactionForStakeholders($id: String!) {
4455
4455
  transactions(ids: [$id]) {
4456
4456
  stakeholders {
@@ -4588,7 +4588,7 @@ const H = new yi(), Bn = w`
4588
4588
  `, Ri = (r) => w`
4589
4589
  ${ee(r)}
4590
4590
  ${wa}
4591
- ${bn}
4591
+ ${En}
4592
4592
  ${Mi}
4593
4593
  ${Ti}
4594
4594
  ${Ni}
@@ -5113,7 +5113,7 @@ const H = new yi(), Bn = w`
5113
5113
  }
5114
5114
  }
5115
5115
  `, Li = w`
5116
- ${Bn}
5116
+ ${bn}
5117
5117
  ${Re}
5118
5118
  query GetCurrentIntegration($themeConfigurationId: String) {
5119
5119
  currentIntegration {
@@ -5213,7 +5213,7 @@ const H = new yi(), Bn = w`
5213
5213
  ],
5214
5214
  silentSteps: []
5215
5215
  }), t;
5216
- }, ji = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
5216
+ }, ji = (r, t) => t.find((e) => e.stepNames.includes(r)), St = (r, t) => (r.conditions || []).every((e) => {
5217
5217
  const a = t[e.targetStepName];
5218
5218
  if (a && a.selectedVariants) {
5219
5219
  const n = a.selectedVariants;
@@ -5226,8 +5226,8 @@ const H = new yi(), Bn = w`
5226
5226
  const e = {
5227
5227
  name: r.name,
5228
5228
  title: r.title,
5229
- renderableSteps: r.renderableSteps.filter((a) => yt(a, t)),
5230
- silentSteps: r.silentSteps.filter((a) => yt(a, t))
5229
+ renderableSteps: r.renderableSteps.filter((a) => St(a, t)),
5230
+ silentSteps: r.silentSteps.filter((a) => St(a, t))
5231
5231
  };
5232
5232
  return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
5233
5233
  }, Pt = (r, t) => r.map((e) => Hi(e, t)).filter((e) => e !== null), Yi = async (r, t, e = !1) => {
@@ -5246,12 +5246,12 @@ const H = new yi(), Bn = w`
5246
5246
  );
5247
5247
  return i;
5248
5248
  };
5249
- class xn {
5249
+ class Fn {
5250
5250
  constructor() {
5251
5251
  this.timestamp = Date.now();
5252
5252
  }
5253
5253
  }
5254
- class kn {
5254
+ class xn {
5255
5255
  /**
5256
5256
  * Constructs a new promise queue.
5257
5257
  * @param queueMaxSize An optional maximum size, when the max size is hit.
@@ -5346,7 +5346,7 @@ const M = () => {
5346
5346
  ...E,
5347
5347
  _renderingConfiguration: a,
5348
5348
  mask: l ? `url(#viewmask-${C})` : void 0
5349
- })), f = va(I);
5349
+ })), f = Sa(I);
5350
5350
  return /* @__PURE__ */ ct(
5351
5351
  "svg",
5352
5352
  {
@@ -5502,7 +5502,7 @@ const M = () => {
5502
5502
  x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
5503
5503
  y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
5504
5504
  };
5505
- }, Jc = 0.352778, Kc = 0.035277, Mn = (r) => {
5505
+ }, Jc = 0.352778, Kc = 0.035277, kn = (r) => {
5506
5506
  const t = r.rotation || 0, e = ft(t), a = Math.cos(e), n = -Math.sin(e);
5507
5507
  return /* @__PURE__ */ D("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ D(
5508
5508
  "g",
@@ -5524,8 +5524,8 @@ const M = () => {
5524
5524
  )
5525
5525
  }
5526
5526
  ) });
5527
- }, Tn = (r) => {
5528
- const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s = va(r.children);
5527
+ }, Mn = (r) => {
5528
+ const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s = Sa(r.children);
5529
5529
  return /* @__PURE__ */ ct(Gt, { children: [
5530
5530
  /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ D("path", { d: r.clipPath }) : /* @__PURE__ */ D("rect", { x: 0, y: 0, width: r.width, height: r.height }) }) }),
5531
5531
  /* @__PURE__ */ ct(
@@ -5629,7 +5629,7 @@ const M = () => {
5629
5629
  matrix(${r.scaleX}, 0, 0, ${r.scaleY}, 0, 0)
5630
5630
  `,
5631
5631
  children: /* @__PURE__ */ D(
5632
- Tn,
5632
+ Mn,
5633
5633
  {
5634
5634
  id: t,
5635
5635
  x: 0,
@@ -5646,7 +5646,7 @@ const M = () => {
5646
5646
  }
5647
5647
  )
5648
5648
  ] });
5649
- }, Nn = /* @__PURE__ */ new Map();
5649
+ }, Tn = /* @__PURE__ */ new Map();
5650
5650
  class _i {
5651
5651
  constructor(t) {
5652
5652
  this.font = t, this.glyphsFromText = /* @__PURE__ */ new Map(), this.kerningValues = /* @__PURE__ */ new Map(), this.height = this.calculateApproximateHeight();
@@ -5701,10 +5701,10 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5701
5701
  return ze.get(r);
5702
5702
  const e = (async () => {
5703
5703
  try {
5704
- return Et(r).getFont();
5704
+ return Ct(r).getFont();
5705
5705
  } catch {
5706
5706
  if (Xi(r)) {
5707
- const a = pn(r), n = ta(a);
5707
+ const a = gn(r), n = ta(a);
5708
5708
  return sa(r, n), n;
5709
5709
  } else {
5710
5710
  const a = await Me(r, !0), n = ta(a);
@@ -5714,20 +5714,20 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5714
5714
  })();
5715
5715
  return ze.set(r, e), e;
5716
5716
  }, Zi = (r) => {
5717
- const t = pn(r), e = ta(t);
5717
+ const t = gn(r), e = ta(t);
5718
5718
  return sa(r, e), e;
5719
- }, Et = (r) => {
5720
- const t = Nn.get(r);
5719
+ }, Ct = (r) => {
5720
+ const t = Tn.get(r);
5721
5721
  if (t)
5722
5722
  return t;
5723
5723
  throw new Error("Font metrics unavailable for font");
5724
5724
  }, sa = (r, t) => {
5725
5725
  const e = new _i(t);
5726
- return Nn.set(r, e), e;
5726
+ return Tn.set(r, e), e;
5727
5727
  }, _c = async (r) => {
5728
5728
  const t = dt(), e = t.parseFromString(r, "image/svg+xml"), a = e.firstElementChild, n = /* @__PURE__ */ new Map();
5729
5729
  a.querySelectorAll("style").forEach((d) => {
5730
- ln(d.innerHTML).stylesheet?.rules.forEach((u) => {
5730
+ on(d.innerHTML).stylesheet?.rules.forEach((u) => {
5731
5731
  if (u.type === "font-face" && u.declarations) {
5732
5732
  const h = u.declarations.find(
5733
5733
  (g) => g.property === "font-family"
@@ -5759,8 +5759,9 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5759
5759
  }
5760
5760
  return e.querySelectorAll("text").forEach((d) => d.remove()), Bt().serializeToString(a);
5761
5761
  }, Be = (r, t, e, a) => Math.max(ns(r.join(`
5762
- `), e, a), t), La = (r, t, e, a, n, i) => {
5763
- const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
5762
+ `), e, a), t), Ua = (r, t, e, a, n, i) => {
5763
+ console.log("LOG: getLines");
5764
+ const s = (i || Rn) * n.getApproximateHeight(), o = t.split(`
5764
5765
  `);
5765
5766
  try {
5766
5767
  const l = o.flatMap((d) => ge(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
@@ -5780,6 +5781,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5780
5781
  };
5781
5782
  }
5782
5783
  }, ge = (r, t, e, a) => {
5784
+ console.log("LOG: splitLineUntilFit");
5783
5785
  const n = mt(r, e, a);
5784
5786
  if (n <= t)
5785
5787
  return { lines: [r], width: n };
@@ -5811,12 +5813,14 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5811
5813
  throw new Error(`No max width calculated for text: ${o}.`);
5812
5814
  return { lines: o, width: l };
5813
5815
  }, ts = (r, t, e, a, n, i) => {
5814
- const s = (i ?? ya) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Qn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
5816
+ console.log("LOG: calcFontSize");
5817
+ const s = (i ?? Rn) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Nn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
5815
5818
  return Math.min(A, d);
5816
5819
  }, es = (r, t, e, a) => {
5817
- const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5820
+ console.log("LOG: refit");
5821
+ const n = Ct(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5818
5822
  if (!e)
5819
- return La(t, r, t.fontSize, s, n, a);
5823
+ return Ua(t, r, t.fontSize, s, n, a);
5820
5824
  let o;
5821
5825
  if (t.text ? o = t.text.split(`
5822
5826
  `) : o = t.input?.split(`
@@ -5833,11 +5837,12 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5833
5837
  requiredHeight: t.height,
5834
5838
  requiredWidth: Be(o, t.width, s, n),
5835
5839
  fontSize: ts(o, n, i, t.width, t.height, a)
5836
- } : La(t, r, t.fontSize, s, n, a);
5840
+ } : Ua(t, r, t.fontSize, s, n, a);
5837
5841
  }, as = (r, t, e, a, n) => {
5838
- const s = Et(t.assetUrl).getFont();
5842
+ console.log("LOG: recalc");
5843
+ const s = Ct(t.assetUrl).getFont();
5839
5844
  let o = { ...r };
5840
- const l = { ...r }, c = Qn(a, e / s.unitsPerEm, Et(t.assetUrl));
5845
+ const l = { ...r }, c = Nn(a, e / s.unitsPerEm, Ct(t.assetUrl));
5841
5846
  return c && c < o.width && (l.width = c, n === "left" ? (l.left += Math.sin(o.rotation * Math.PI / 360) * (o.width - c), l.top += Math.sin(o.rotation * Math.PI / 180) * (c - o.width) / 2) : n === "right" ? l.left += o.width - c : l.left += (o.width - c) / 2, a && rs(a, a).every(([d, A]) => d === A) && (o = l)), o;
5842
5847
  }, Ge = 1, mt = (r, t, e) => {
5843
5848
  let a = 0;
@@ -5857,21 +5862,21 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5857
5862
  a = Math.max(a, o || 0);
5858
5863
  }
5859
5864
  }), a *= t, a;
5860
- }, Qn = (r, t, e) => {
5865
+ }, Nn = (r, t, e) => {
5861
5866
  let a = 0;
5862
5867
  return r.forEach((n) => {
5863
5868
  a = Math.max(a, mt(n, t, e));
5864
5869
  }), a;
5865
- }, Va = {
5870
+ }, La = {
5866
5871
  stripControlCharacters: !0,
5867
5872
  vertical: !1,
5868
5873
  uppercase: !1
5869
- }, Ie = (r, t = Va) => {
5870
- const e = { ...Va, ...t };
5874
+ }, Ie = (r, t = La) => {
5875
+ const e = { ...La, ...t };
5871
5876
  let a = r || "";
5872
5877
  return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
5873
5878
  `)), a;
5874
- }, rs = (r, t) => r.map((e, a) => [e, t[a]]), is = (r = "center", t = !1) => t ? "center" : r, Rn = (r) => r === "left" ? "start" : r === "right" ? "end" : "middle", ae = (r, t, e) => r.fontData ? {
5879
+ }, rs = (r, t) => r.map((e, a) => [e, t[a]]), is = (r = "center", t = !1) => t ? "center" : r, Qn = (r) => r === "left" ? "start" : r === "right" ? "end" : "middle", ae = (r, t, e) => r.fontData ? {
5875
5880
  ...r,
5876
5881
  ...(() => {
5877
5882
  if (r.algorithm === Mt.Traditional) {
@@ -5889,7 +5894,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
5889
5894
  text: t
5890
5895
  };
5891
5896
  })()
5892
- } : r, ya = 1.1;
5897
+ } : r, Rn = 1.1;
5893
5898
  function Ft(r, t) {
5894
5899
  return On(r, t.getTemplatingContext());
5895
5900
  }
@@ -5906,7 +5911,7 @@ const ss = (r) => {
5906
5911
  `), A = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeColor?.browserValue : void 0, u = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
5907
5912
  if (r.curved && !r.paths || !r.fontData)
5908
5913
  return null;
5909
- const h = () => r.textFillImage ? `url("#${s}")` : r._renderingConfiguration?.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${yn(r.fillSpotColorDefinition)}` : r.fill;
5914
+ const h = () => r.textFillImage ? `url("#${s}")` : r._renderingConfiguration?.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${wn(r.fillSpotColorDefinition)}` : r.fill;
5910
5915
  return /* @__PURE__ */ ct(Gt, { children: [
5911
5916
  /* @__PURE__ */ ct("defs", { children: [
5912
5917
  r.textFillImage && /* @__PURE__ */ D(
@@ -5973,7 +5978,8 @@ const ss = (r) => {
5973
5978
  textboxWidth: r.width,
5974
5979
  lineHeight: r.lineHeight,
5975
5980
  vertical: r.vertical,
5976
- verticalAlign: r.verticalAlign
5981
+ verticalAlign: r.verticalAlign,
5982
+ fontData: r.fontData
5977
5983
  },
5978
5984
  p
5979
5985
  ))
@@ -5981,8 +5987,15 @@ const ss = (r) => {
5981
5987
  ) }) })
5982
5988
  ] });
5983
5989
  }, os = (r) => {
5984
- const t = () => r.lineHeight !== void 0 ? r.lineHeight : ya, e = () => r.align === "left" ? -r.textboxWidth / 2 : r.align === "right" ? r.textboxWidth / 2 : 0, a = () => {
5985
- const n = r.fontSize * t(), i = r.textboxHeight / 2;
5990
+ const t = () => {
5991
+ if (r.lineHeight !== void 0)
5992
+ return r.lineHeight;
5993
+ const n = Ct(r.fontData.assetUrl), i = n.getFont(), s = r.fontSize / i.unitsPerEm;
5994
+ return n.getApproximateHeight() * s;
5995
+ }, e = () => r.align === "left" ? -r.textboxWidth / 2 : r.align === "right" ? r.textboxWidth / 2 : 0, a = () => {
5996
+ const n = r.fontSize * t();
5997
+ console.log(`LOG: text span. line height: ${n}`);
5998
+ const i = r.textboxHeight / 2;
5986
5999
  if (r.verticalAlign === "top")
5987
6000
  return -i + r.fontSize * 3 / 4 + r.thisLineIdx * n;
5988
6001
  if (r.verticalAlign === "bottom") {
@@ -5992,14 +6005,14 @@ const ss = (r) => {
5992
6005
  const s = (r.amountLines - 1) / 2;
5993
6006
  return (r.thisLineIdx - s) * n + r.fontSize / 4;
5994
6007
  };
5995
- return /* @__PURE__ */ D("tspan", { textAnchor: Rn(r.align), x: e(), y: `${a()}px`, children: r.text });
6008
+ return /* @__PURE__ */ D("tspan", { textAnchor: Qn(r.align), x: e(), y: `${a()}px`, children: r.text });
5996
6009
  }, ls = (r) => {
5997
6010
  const t = `#${r.curvedPathId}`;
5998
6011
  return /* @__PURE__ */ D(
5999
6012
  "textPath",
6000
6013
  {
6001
6014
  startOffset: r.align === "left" ? "0%" : r.align === "right" ? "100%" : "50%",
6002
- textAnchor: Rn(r.align),
6015
+ textAnchor: Qn(r.align),
6003
6016
  href: t,
6004
6017
  xlinkHref: t,
6005
6018
  children: r.text
@@ -6008,7 +6021,7 @@ const ss = (r) => {
6008
6021
  }, cs = (r) => {
6009
6022
  if (r.cachedObjectURL && !r._renderingConfiguration?.omitCachedFields)
6010
6023
  return /* @__PURE__ */ D(
6011
- Mn,
6024
+ kn,
6012
6025
  {
6013
6026
  id: r.id,
6014
6027
  src: r.cachedObjectURL,
@@ -6113,7 +6126,7 @@ class ds {
6113
6126
  layout: t,
6114
6127
  elements: e
6115
6128
  },
6116
- getComponentWithProps: (a) => Sa(t, e, a)
6129
+ getComponentWithProps: (a) => ya(t, e, a)
6117
6130
  };
6118
6131
  }
6119
6132
  initialize(t, e) {
@@ -6138,7 +6151,7 @@ class ds {
6138
6151
  return { ...t, transaction: e.apply(a) };
6139
6152
  }
6140
6153
  }
6141
- const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : r.type === x.Frame ? /* @__PURE__ */ D(Ki, { ...r }, r.id) : r.type === x.Illustration ? /* @__PURE__ */ D(cs, { ...r }, r.id) : r.type === x.Textbox ? /* @__PURE__ */ D(ss, { ...r }, r.id) : r.type === x.Group ? /* @__PURE__ */ D(Tn, { ...r }, r.id) : null, Sa = (r, t, e) => {
6154
+ const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(kn, { ...r }, r.id) : r.type === x.Frame ? /* @__PURE__ */ D(Ki, { ...r }, r.id) : r.type === x.Illustration ? /* @__PURE__ */ D(cs, { ...r }, r.id) : r.type === x.Textbox ? /* @__PURE__ */ D(ss, { ...r }, r.id) : r.type === x.Group ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : null, ya = (r, t, e) => {
6142
6155
  const a = e.renderingConfiguration, n = a?.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
6143
6156
  return /* @__PURE__ */ D(
6144
6157
  Ji,
@@ -6169,7 +6182,7 @@ const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : r
6169
6182
  }
6170
6183
  );
6171
6184
  };
6172
- function va(r) {
6185
+ function Sa(r) {
6173
6186
  return r.sort((t, e) => {
6174
6187
  const a = t.layer || 0, n = e.layer || 0;
6175
6188
  if (a < n) return -1;
@@ -6246,7 +6259,7 @@ const ne = (r) => {
6246
6259
  throw new Error("Malformed frame SVG");
6247
6260
  })();
6248
6261
  return We.set(r, e), e;
6249
- }, Ea = (r, t, e, a) => {
6262
+ }, va = (r, t, e, a) => {
6250
6263
  const n = t.width / t.height, i = r.width / r.height;
6251
6264
  let s;
6252
6265
  a ? i > n ? s = t.height / r.height : s = t.width / r.width : i > n ? s = t.width / r.width : s = t.height / r.height, e?.scale !== void 0 && (s *= e?.scale);
@@ -6269,7 +6282,7 @@ const ne = (r) => {
6269
6282
  return ut.set(r, i), i;
6270
6283
  }
6271
6284
  if ((r.split(".").pop()?.toLowerCase() ?? "") === "svg") {
6272
- const e = await ba(r), a = e.width, n = e.height, i = {
6285
+ const e = await Ea(r), a = e.width, n = e.height, i = {
6273
6286
  src: r,
6274
6287
  width: a,
6275
6288
  height: n,
@@ -6285,14 +6298,14 @@ const ne = (r) => {
6285
6298
  };
6286
6299
  return ut.set(r, n), n;
6287
6300
  }
6288
- }, ba = async (r) => {
6301
+ }, Ea = async (r) => {
6289
6302
  const t = await nt(r);
6290
6303
  return Ln(t);
6291
- }, za = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), Ln = (r) => {
6304
+ }, Va = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), Ln = (r) => {
6292
6305
  const a = dt().parseFromString(r, "image/svg+xml").querySelector("svg");
6293
6306
  if (!a)
6294
6307
  throw new Error("No svg tag found, this svg must be malformed!");
6295
- const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, za(i), za(s)] : n?.split(" ").map((l) => Number(l));
6308
+ const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, Va(i), Va(s)] : n?.split(" ").map((l) => Number(l));
6296
6309
  if (!o)
6297
6310
  throw new Error("No viewbox or width/height values detected on SVG file!");
6298
6311
  return {
@@ -6366,7 +6379,7 @@ const ne = (r) => {
6366
6379
  }
6367
6380
  if (e && t === x.Textbox && a?.text && a?.fontScale) {
6368
6381
  await Nt(e);
6369
- const l = Et(e), c = mt(a.text, a?.fontScale, l);
6382
+ const l = Ct(e), c = mt(a.text, a?.fontScale, l);
6370
6383
  o.width = Math.min(c, n.width * 0.85), o.left = n.x + n.width / 2 - o.width / 2;
6371
6384
  }
6372
6385
  return o;
@@ -6537,13 +6550,13 @@ const $ = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
6537
6550
  throw new U();
6538
6551
  return e;
6539
6552
  }, X = (r, t) => {
6540
- const e = [...t.elements.filter((n) => n.id !== r.id), r], a = va(e);
6553
+ const e = [...t.elements.filter((n) => n.id !== r.id), r], a = Sa(e);
6541
6554
  return {
6542
6555
  layout: t.layout,
6543
6556
  elements: a,
6544
6557
  modificationID: M()
6545
6558
  };
6546
- }, Ga = async (r) => {
6559
+ }, za = async (r) => {
6547
6560
  const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
6548
6561
  for (let a = 0; a < e.length; a++) {
6549
6562
  const n = e[a], i = r.layouts[n];
@@ -6603,7 +6616,7 @@ class N {
6603
6616
  this.oldState = t;
6604
6617
  }
6605
6618
  }
6606
- class Wa extends N {
6619
+ class Ga extends N {
6607
6620
  constructor(t) {
6608
6621
  super(), this.serializableWorkflow = t;
6609
6622
  }
@@ -6865,7 +6878,7 @@ class hs extends N {
6865
6878
  };
6866
6879
  }
6867
6880
  }
6868
- class qa extends N {
6881
+ class Wa extends N {
6869
6882
  constructor(t, e) {
6870
6883
  super(), this.id = t, this.fontData = e;
6871
6884
  }
@@ -7203,7 +7216,7 @@ class sd extends N {
7203
7216
  };
7204
7217
  }
7205
7218
  }
7206
- class ja {
7219
+ class qa {
7207
7220
  constructor(t, e, a) {
7208
7221
  this.processRegion = async (n) => {
7209
7222
  const i = this.layouts.find((l) => l.panelId === n.panelId);
@@ -7400,7 +7413,7 @@ class ys {
7400
7413
  return t.data.regions.map(e);
7401
7414
  }
7402
7415
  async command(t, e, a, n) {
7403
- const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await cn(t, { type: "svg" }))}`, l = e.map((c) => {
7416
+ const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await ln(t, { type: "svg" }))}`, l = e.map((c) => {
7404
7417
  const d = c.region, A = i.find((u) => u.panelId === d?.panelId);
7405
7418
  if (!A && d)
7406
7419
  throw new Y(d);
@@ -7436,7 +7449,7 @@ class Pe {
7436
7449
  return oa(e);
7437
7450
  const a = t.asset;
7438
7451
  if (!a)
7439
- throw new vt(t);
7452
+ throw new Et(t);
7440
7453
  const n = a.fileLink;
7441
7454
  if (n)
7442
7455
  return nt(n, !0);
@@ -7600,7 +7613,7 @@ class Pe {
7600
7613
  }
7601
7614
  async loadPatternFromString(t, e, a = !0, n = void 0, i) {
7602
7615
  if (t.endsWith("svg")) {
7603
- const s = await ba(t), o = s.width, l = s.height, c = await nt(t);
7616
+ const s = await Ea(t), o = s.width, l = s.height, c = await nt(t);
7604
7617
  if (i) {
7605
7618
  const u = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
7606
7619
  if (u && u.length > 0)
@@ -7703,7 +7716,7 @@ class Pe {
7703
7716
  i && i(!0);
7704
7717
  const c = t.data.initialZoomLevel, d = await Promise.all(
7705
7718
  t.data.regions.map(async (h, m) => {
7706
- const p = await Oe(l[m]), g = o.getImageData(), C = a.map((P) => new bt(P.id)), S = g ? Ea(
7719
+ const p = await Oe(l[m]), g = o.getImageData(), C = a.map((P) => new bt(P.id)), S = g ? va(
7707
7720
  g,
7708
7721
  p,
7709
7722
  c && !t.data.forceImageCover ? { scale: c } : void 0,
@@ -7794,7 +7807,7 @@ class Pe {
7794
7807
  ), this.validateColorCount(e, a);
7795
7808
  }
7796
7809
  }
7797
- const wt = new Pe();
7810
+ const yt = new Pe();
7798
7811
  class Ss {
7799
7812
  async getIllustrationBody(t) {
7800
7813
  return new Promise((e) => {
@@ -7955,7 +7968,7 @@ class Ss {
7955
7968
  t.mandatory && i.setMandatoryFulfilled(t.stepName, !1);
7956
7969
  const o = e.asset;
7957
7970
  if (!o)
7958
- throw new vt(e);
7971
+ throw new Et(e);
7959
7972
  const l = o.fileLink;
7960
7973
  if (!l)
7961
7974
  throw new Yt(o);
@@ -8086,7 +8099,7 @@ class vs {
8086
8099
  n(!0);
8087
8100
  const s = e.material;
8088
8101
  if (!s)
8089
- throw n(!1), new vt(e);
8102
+ throw n(!1), new Et(e);
8090
8103
  return {
8091
8104
  command: void 0,
8092
8105
  followup: async () => {
@@ -8137,7 +8150,7 @@ class Es {
8137
8150
  const u = e.getModelContainer();
8138
8151
  if (u && t.option) {
8139
8152
  const h = d.asset?.fileLink;
8140
- if (!h) throw new vt(d);
8153
+ if (!h) throw new Et(d);
8141
8154
  await u.applyModelVariant(
8142
8155
  t.stepName || "",
8143
8156
  {
@@ -8161,7 +8174,7 @@ class Es {
8161
8174
  n(!0);
8162
8175
  const i = e.asset?.fileLink;
8163
8176
  if (!i)
8164
- throw new vt(e);
8177
+ throw new Et(e);
8165
8178
  return {
8166
8179
  command: void 0,
8167
8180
  followup: async () => {
@@ -8338,7 +8351,7 @@ class Bs {
8338
8351
  async selectVariantCommand(t, e, a, n) {
8339
8352
  const i = e.asset;
8340
8353
  if (!i)
8341
- throw new vt(e);
8354
+ throw new Et(e);
8342
8355
  const s = i?.fileLink;
8343
8356
  if (!s)
8344
8357
  return console.error("No URL for picture!"), null;
@@ -8638,9 +8651,11 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
8638
8651
  let i = t.map((d) => d.split(`
8639
8652
  `)).flat(), s = i.length, o = i.map((d) => mt(d, a, n));
8640
8653
  const l = n.getApproximateHeight() * a;
8654
+ console.log(`LOG: lines that fit. calced line height: ${l}`);
8641
8655
  let c = !0;
8642
8656
  for (; c; ) {
8643
- if (l + (s - 1) * e > r.height)
8657
+ const d = l + (s - 1) * e;
8658
+ if (console.log(`LOG: textbox height for size ${e}: ${d}`), d > r.height)
8644
8659
  return [null, null];
8645
8660
  const A = Math.max(...o);
8646
8661
  if (A <= r.width)
@@ -8660,22 +8675,23 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
8660
8675
  }
8661
8676
  return [null, null];
8662
8677
  }, fe = (r, t, e, a, n) => {
8678
+ console.log(`LOG: determineCorrectFontSize, region height ${e.height}`);
8663
8679
  let i, s;
8664
- const o = Et(t.assetUrl), l = o.getFont();
8680
+ const o = Ct(t.assetUrl), l = o.getFont();
8665
8681
  if (n.size) {
8666
8682
  const u = r / l.unitsPerEm;
8667
- return [i, s] = Ye(e, a, r, u, o), [n.size, i, s];
8683
+ return [i, s] = Ye(e, a, r, u, o), console.log(`LOG: fixed mode returning ${n.size, s}`), [n.size, i, s];
8668
8684
  }
8669
8685
  const c = 6;
8670
8686
  let d = c - Ge;
8671
8687
  if (a.length > 0) {
8672
8688
  let u = a, h = 0;
8673
8689
  for (; (!n.maxSize || d <= n.maxSize) && u; )
8674
- d += Ge, h = d / l.unitsPerEm, [u, s] = Ye(e, a, d, h, o);
8690
+ d += Ge, h = d / l.unitsPerEm, [u, s] = Ye(e, a, d, h, o), console.log(`LOG: intermediate result ${[u, s]}`);
8675
8691
  }
8676
8692
  d > c && (d -= Ge), n.minSize && d < n.minSize && (d = n.minSize);
8677
8693
  const A = d / l.unitsPerEm;
8678
- return [i, s] = Ye(e, a, d, A, o), [d, i, s];
8694
+ return [i, s] = Ye(e, a, d, A, o), console.log(`LOG: var mode returning ${[d, i, s]}`), [d, i, s];
8679
8695
  }, Je = 30;
8680
8696
  class De extends Error {
8681
8697
  constructor(t) {
@@ -8696,7 +8712,7 @@ class ks {
8696
8712
  /(\r\n|\r|(\u2665|\u00a9|\u00ae|[\u2000-\u2017]|[\u201E-\u3300]]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]))/gm,
8697
8713
  ""
8698
8714
  );
8699
- const n = [], i = e ? Et(e.assetUrl) : void 0;
8715
+ const n = [], i = e ? Ct(e.assetUrl) : void 0;
8700
8716
  if (i) {
8701
8717
  const s = a.split("").filter((l) => !xs.includes(l)).join(""), o = s.split("").map((l) => i.getFont().charToGlyph(l));
8702
8718
  for (let l = 0; l < o.length; l++)
@@ -8982,7 +8998,7 @@ class ks {
8982
8998
  u,
8983
8999
  async () => {
8984
9000
  e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
8985
- const g = o.map((S) => new qa(S.id, A)), C = new R(g);
9001
+ const g = o.map((S) => new Wa(S.id, A)), C = new R(g);
8986
9002
  e.getCommandDispatcher()(C);
8987
9003
  }
8988
9004
  ), o.length === 0 && l) {
@@ -9072,7 +9088,7 @@ class ks {
9072
9088
  async fontDataFromVariant(t) {
9073
9089
  const e = t.asset;
9074
9090
  if (!e)
9075
- throw new vt(t);
9091
+ throw new Et(t);
9076
9092
  const a = e.fileLink;
9077
9093
  if (!a)
9078
9094
  throw new Yt(e);
@@ -9085,7 +9101,7 @@ class ks {
9085
9101
  async selectVariantCommand(t, e, a, n, i, s, o, l, c) {
9086
9102
  const d = i.markUpdatePending(), A = await this.fontDataFromVariant(e);
9087
9103
  if (n.length > 0) {
9088
- const u = n.map((p) => new qa(p.id, A));
9104
+ const u = n.map((p) => new Wa(p.id, A));
9089
9105
  if (l) {
9090
9106
  const p = n.map((g) => new je(g.id, l));
9091
9107
  u.push(...p);
@@ -9345,7 +9361,7 @@ function $s(r, t, e, a) {
9345
9361
  const n = e / r, i = a / t;
9346
9362
  return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
9347
9363
  }
9348
- const Ha = {
9364
+ const ja = {
9349
9365
  m: ["x", "y"],
9350
9366
  z: [],
9351
9367
  l: ["x", "y"],
@@ -9375,7 +9391,7 @@ class Us {
9375
9391
  const n = (i) => {
9376
9392
  const s = [], o = i.relative ? i.type : i.type.toUpperCase();
9377
9393
  let l = e !== o;
9378
- const c = Ha[i.type];
9394
+ const c = ja[i.type];
9379
9395
  l && (s.push(o), e = o);
9380
9396
  for (const d of c) {
9381
9397
  const A = i[d];
@@ -9400,7 +9416,7 @@ class Us {
9400
9416
  const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
9401
9417
  let i;
9402
9418
  for (e.lastIndex = 0; i = e.exec(t); ) {
9403
- const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = Ha[s];
9419
+ const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = ja[s];
9404
9420
  if (o.length < c.length)
9405
9421
  throw new Dt(
9406
9422
  `Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
@@ -9606,7 +9622,7 @@ const re = w`
9606
9622
  name
9607
9623
  }
9608
9624
  }
9609
- `, Ba = w`
9625
+ `, ba = w`
9610
9626
  ${Ws}
9611
9627
  fragment ProductCollectionProductFields on ProductCollectionProduct {
9612
9628
  id
@@ -9617,7 +9633,7 @@ const re = w`
9617
9633
  }
9618
9634
  }
9619
9635
  `, ie = (r) => w`
9620
- ${r ? Ba : ""}
9636
+ ${r ? ba : ""}
9621
9637
  fragment ProductCollectionFields on ProductCollection {
9622
9638
  id
9623
9639
  name
@@ -9730,7 +9746,7 @@ const re = w`
9730
9746
  quoteId
9731
9747
  }
9732
9748
  }
9733
- `, Ya = w`
9749
+ `, Ha = w`
9734
9750
  query GetBundleStakeholders($id: String!) {
9735
9751
  bundles(ids: [$id]) {
9736
9752
  id
@@ -9805,7 +9821,7 @@ const re = w`
9805
9821
  }
9806
9822
  }
9807
9823
  `, Hs = w`
9808
- ${Ba}
9824
+ ${ba}
9809
9825
  query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
9810
9826
  productCollections(ids: [$id], productIds: $productIds) {
9811
9827
  id
@@ -9838,7 +9854,7 @@ const re = w`
9838
9854
  }
9839
9855
  }
9840
9856
  `, Js = w`
9841
- ${Ba}
9857
+ ${ba}
9842
9858
  query GetProductCollectionForProductsFeed(
9843
9859
  $id: String!
9844
9860
  $limit: Int
@@ -10219,7 +10235,7 @@ const re = w`
10219
10235
  `;
10220
10236
  var $e = /* @__PURE__ */ ((r) => (r.Error = "Error", r.Warning = "Warning", r.Info = "Info", r))($e || {});
10221
10237
  const wo = 1e3;
10222
- class Ja extends xn {
10238
+ class Ya extends Fn {
10223
10239
  constructor(t) {
10224
10240
  super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
10225
10241
  }
@@ -10233,7 +10249,7 @@ class Ja extends xn {
10233
10249
  }
10234
10250
  class yo {
10235
10251
  constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, p, g = !1, C = !1, S = !1) {
10236
- this.workflowStatePromiseQueue = new kn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10252
+ this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10237
10253
  if (!this.previewService) return;
10238
10254
  const b = this.getCommandContext().getAllLayouts(), I = this.getLayoutPreviewService()?.getAll();
10239
10255
  if (I)
@@ -10648,9 +10664,9 @@ class yo {
10648
10664
  ...this.storage,
10649
10665
  [t]: { ...this.storage[t], ...e }
10650
10666
  };
10651
- if (!dn(a, this.storage)) {
10667
+ if (!cn(a, this.storage)) {
10652
10668
  this.storage = a;
10653
- const n = new Wa(this.constructSerializableWorkflow());
10669
+ const n = new Ga(this.constructSerializableWorkflow());
10654
10670
  this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
10655
10671
  }
10656
10672
  }
@@ -10669,7 +10685,7 @@ class yo {
10669
10685
  if (this.readOnly) return;
10670
10686
  const t = this.serialize();
10671
10687
  this.workflowStatePromiseQueue.enqueue(
10672
- new Ja(async () => {
10688
+ new Ya(async () => {
10673
10689
  await new Promise((e) => {
10674
10690
  setTimeout(() => {
10675
10691
  e();
@@ -10686,7 +10702,7 @@ class yo {
10686
10702
  async updateStateWithServerImmediate() {
10687
10703
  if (this.readOnly) return;
10688
10704
  const t = this.serialize();
10689
- return new Ja(async () => {
10705
+ return new Ya(async () => {
10690
10706
  await this.updateTransaction({
10691
10707
  variables: {
10692
10708
  id: this.transaction.id,
@@ -10699,7 +10715,7 @@ class yo {
10699
10715
  const t = this.getCommandContext().getState();
10700
10716
  if (!t)
10701
10717
  throw new V("Attempted to serialize state before it was initialized.");
10702
- const e = St(t.transaction), a = this.dehydrateState(e);
10718
+ const e = vt(t.transaction), a = this.dehydrateState(e);
10703
10719
  return JSON.stringify(a);
10704
10720
  }
10705
10721
  /**
@@ -10735,12 +10751,12 @@ class yo {
10735
10751
  this.stepElements = e(this.stepElements, t);
10736
10752
  }
10737
10753
  getInvalidCanvasRegions() {
10738
- return this.workflow.steps.reduce((t, e) => (yt(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
10754
+ return this.workflow.steps.reduce((t, e) => (St(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
10739
10755
  (a) => t.push(a)
10740
10756
  ), t), []);
10741
10757
  }
10742
10758
  getInvalidModelVariants() {
10743
- return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !yt(e, this.stepSelections) && t.push(e.stepName), t), []);
10759
+ return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !St(e, this.stepSelections) && t.push(e.stepName), t), []);
10744
10760
  }
10745
10761
  async stepElementsForIntroducedSilentSteps(t, e) {
10746
10762
  const a = this.product;
@@ -10748,10 +10764,10 @@ class yo {
10748
10764
  return Promise.resolve({ stepElements: {}, commands: [] });
10749
10765
  const n = async (c, d, A) => {
10750
10766
  if (c.type === v.SilentIllustration) {
10751
- const u = await new ja(c, d).trigger();
10767
+ const u = await new qa(c, d).trigger();
10752
10768
  return { step: c, results: u };
10753
10769
  } else if (c.type === v.ProductOverlay) {
10754
- const u = await new ja(
10770
+ const u = await new qa(
10755
10771
  c,
10756
10772
  d,
10757
10773
  A
@@ -10840,13 +10856,13 @@ class yo {
10840
10856
  ...this.stepSelections,
10841
10857
  [t]: { selectedVariants: e }
10842
10858
  }, this.selectionCost = Object.values(this.stepSelections).reduce((f, E) => f + E.selectedVariants.map((P) => P.priceModifier || 0).reduce((P, B) => P + B, 0), 0), this.workflow.steps.forEach((f) => {
10843
- yt(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1, delete this.stepMetadata[f.stepName], delete this.stepSelections[f.stepName], delete this.storage[f.stepName]);
10859
+ St(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1, delete this.stepMetadata[f.stepName], delete this.stepSelections[f.stepName], delete this.storage[f.stepName]);
10844
10860
  });
10845
10861
  const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((f) => f.silentSteps).flat(), A = l.map((f) => f.silentSteps).flat().filter(
10846
10862
  (f) => !c.some((E) => E.stepName === f.stepName)
10847
10863
  );
10848
10864
  c.forEach((f) => {
10849
- yt(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1);
10865
+ St(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1);
10850
10866
  });
10851
10867
  const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
10852
10868
  this.stepElements = {
@@ -10856,7 +10872,7 @@ class yo {
10856
10872
  }, this.removeElements(u);
10857
10873
  const p = this.workflow.steps.find((f) => f.stepName === t);
10858
10874
  p?.type === v.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((E) => E.id));
10859
- const g = u.map((f) => new bt(f.id)), C = new Wa(this.constructSerializableWorkflow()), S = [...m, ...g, C];
10875
+ const g = u.map((f) => new bt(f.id)), C = new Ga(this.constructSerializableWorkflow()), S = [...m, ...g, C];
10860
10876
  S.length > 0 && this.commandContext.apply(new R(S), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10861
10877
  const b = this.getInvalidModelVariants(), I = this.modelContainer;
10862
10878
  if (I) {
@@ -10888,7 +10904,7 @@ class yo {
10888
10904
  );
10889
10905
  break;
10890
10906
  case v.Frame:
10891
- a.push(wt.init(l, this, this.reloadedState));
10907
+ a.push(yt.init(l, this, this.reloadedState));
10892
10908
  break;
10893
10909
  case v.Illustration:
10894
10910
  a.push(
@@ -11819,7 +11835,7 @@ const To = async (r, t) => {
11819
11835
  headers: e
11820
11836
  }
11821
11837
  })).data?.designCreateMany;
11822
- }, Ka = (r, t, e) => {
11838
+ }, Ja = (r, t, e) => {
11823
11839
  const a = (i) => {
11824
11840
  const s = {};
11825
11841
  if (i.type === "Frame") {
@@ -11903,7 +11919,7 @@ const To = async (r, t) => {
11903
11919
  if (c !== void 0) return c;
11904
11920
  await r.outstandingRequestsPromise();
11905
11921
  const F = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), T = await y.getShadowGraphqlClient().query({
11906
- query: Dn,
11922
+ query: Pn,
11907
11923
  variables: { ids: [n.id] },
11908
11924
  fetchPolicy: "no-cache",
11909
11925
  errorPolicy: "all",
@@ -11915,7 +11931,7 @@ const To = async (r, t) => {
11915
11931
  T.errors && console.log("Server Error:", et.message);
11916
11932
  }), null) : tt ?? null;
11917
11933
  })() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
11918
- const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && Ka(l, t, !0), g = l && Ka(l, t, !1), C = async (B) => {
11934
+ const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && Ja(l, t, !0), g = l && Ja(l, t, !1), C = async (B) => {
11919
11935
  const F = {};
11920
11936
  let Q = 0;
11921
11937
  if (Object.keys(i).length > 0)
@@ -11924,12 +11940,12 @@ const To = async (r, t) => {
11924
11940
  for (let W = 0; W < tt.selections.length; ++W) {
11925
11941
  const q = tt.selections[W];
11926
11942
  if (et && (!B || et.option && (et.option.variants || []).length > 1 && !et.data.hideSelectionInCart && !et.data.hideSelectionsInCart)) {
11927
- const Ct = et.stepTitle;
11928
- F[Ct] ? F[Ct].push({
11943
+ const wt = et.stepTitle;
11944
+ F[wt] ? F[wt].push({
11929
11945
  id: q.id || "",
11930
11946
  name: q.name,
11931
11947
  priceModifier: q.priceModifier
11932
- }) : F[Ct] = [
11948
+ }) : F[wt] = [
11933
11949
  {
11934
11950
  id: q.id || "",
11935
11951
  name: q.name,
@@ -12026,7 +12042,7 @@ const To = async (r, t) => {
12026
12042
  );
12027
12043
  const n = await (async () => {
12028
12044
  const l = await y.getShadowGraphqlClient().query({
12029
- query: Dn,
12045
+ query: Pn,
12030
12046
  variables: { ids: r.map((c) => c.transaction.id) },
12031
12047
  fetchPolicy: "no-cache",
12032
12048
  errorPolicy: "all"
@@ -12179,7 +12195,7 @@ const Ke = new $o(), Uo = w`
12179
12195
  var zo = /* @__PURE__ */ ((r) => (r.QuantityChanged = "QuantityChanged", r.PriceBreakChanged = "PriceBreakChanged", r))(zo || {});
12180
12196
  class Go {
12181
12197
  constructor(t, e) {
12182
- if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = An(async () => {
12198
+ if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = dn(async () => {
12183
12199
  await Ke.getSavedDesignByTransaction(
12184
12200
  this.getWorkflowManager().getTransaction().id
12185
12201
  ) && this.save();
@@ -12300,13 +12316,13 @@ class Go {
12300
12316
  }, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
12301
12317
  if (!h)
12302
12318
  throw new ke("Failed to obtain 2D context for preview image creation");
12303
- const m = this.workflowManager.getTemplatingContext(), p = Sa(u.layoutState.layout, u.layoutState.elements, {
12319
+ const m = this.workflowManager.getTemplatingContext(), p = ya(u.layoutState.layout, u.layoutState.elements, {
12304
12320
  renderingConfiguration: {
12305
12321
  purpose: Ht.Print,
12306
12322
  region: { left: A.x, top: A.y, width: A.width, height: A.height },
12307
12323
  templatingContext: m
12308
12324
  }
12309
- }), g = gn(p);
12325
+ }), g = mn(p);
12310
12326
  await (await Aa.from(h, g, {
12311
12327
  anonymousCrossOrigin: !0,
12312
12328
  ignoreDimensions: !1,
@@ -12333,7 +12349,7 @@ class Go {
12333
12349
  getStepsConditionallyActive() {
12334
12350
  return this.getScenes().flatMap(
12335
12351
  (t) => this.getStepsByScene(t).filter(
12336
- (e) => yt(e.getRaw(), this.getWorkflowManager().getStepSelections())
12352
+ (e) => St(e.getRaw(), this.getWorkflowManager().getStepSelections())
12337
12353
  )
12338
12354
  );
12339
12355
  }
@@ -12484,7 +12500,7 @@ class Go {
12484
12500
  return await Ke.addDesign(n), n;
12485
12501
  }
12486
12502
  async copy() {
12487
- const t = St(this.getCommandContext().getState());
12503
+ const t = vt(this.getCommandContext().getState());
12488
12504
  if (!t) throw new V("Internal state is undefined! Cannot copy experience!");
12489
12505
  const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = this.getWorkflowManager().getTransaction().integrationProduct?.id;
12490
12506
  if (!n) throw new V("Integration product id is undefined!");
@@ -12671,8 +12687,8 @@ const Wo = (r) => {
12671
12687
  "tspan"
12672
12688
  ], Ho = async (r, t, e) => {
12673
12689
  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);
12674
- o.searchParams.append("video", Ra(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12675
- const l = o.toString(), d = `data:image/svg+xml;base64,${Ra(await cn(l, { type: "svg" }))}`, A = (h) => {
12690
+ o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12691
+ const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await ln(l, { type: "svg" }))}`, A = (h) => {
12676
12692
  const m = r.find((g) => g.panelId === h.panelId);
12677
12693
  if (!m)
12678
12694
  throw new Y(h);
@@ -12705,7 +12721,7 @@ const Wo = (r) => {
12705
12721
  const d = await Un(c, o?.asset?.fileLink), A = await Oe(d), u = M(), h = r.find((p) => p.panelId === c.panelId);
12706
12722
  if (!h)
12707
12723
  throw new Y(c);
12708
- const m = Ea(
12724
+ const m = va(
12709
12725
  s,
12710
12726
  A,
12711
12727
  {
@@ -13202,7 +13218,7 @@ const rl = () => new Promise((r, t) => {
13202
13218
  }), il = rl();
13203
13219
  class sl {
13204
13220
  constructor(t, e, a, n, i) {
13205
- this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.renderQueue = new kn(2), this.id = t, this.name = e, this.service = a, this.panelSize = n, this.getWorkflowManager = i;
13221
+ this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.renderQueue = new xn(2), this.id = t, this.name = e, this.service = a, this.panelSize = n, this.getWorkflowManager = i;
13206
13222
  }
13207
13223
  getID() {
13208
13224
  return this.id;
@@ -13248,7 +13264,7 @@ class sl {
13248
13264
  * Actions to perform when a static render event is fired for this canvas.
13249
13265
  */
13250
13266
  async render(t) {
13251
- const e = St(t);
13267
+ const e = vt(t);
13252
13268
  this.lastRequestedRenderArguments = e;
13253
13269
  const a = this.getStaticContext();
13254
13270
  if (!a) {
@@ -13269,7 +13285,7 @@ class sl {
13269
13285
  );
13270
13286
  }
13271
13287
  }
13272
- class ol extends xn {
13288
+ class ol extends Fn {
13273
13289
  constructor(t, e, a, n, i, s) {
13274
13290
  super(), this.layoutId = t, this.ctx = e, this.nonPOTSupport = a, this.onRender = n, this.layouts = i, this.getWorkflowManager = s;
13275
13291
  }
@@ -13319,12 +13335,12 @@ class ol extends xn {
13319
13335
  l = g.width, c = g.height;
13320
13336
  } else
13321
13337
  l = i.width, c = i.height;
13322
- const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = Sa(t.layoutState.layout, e, {
13338
+ const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = ya(t.layoutState.layout, e, {
13323
13339
  renderingConfiguration: {
13324
13340
  purpose: Ht.ThreeD,
13325
13341
  templatingContext: d
13326
13342
  }
13327
- }), u = gn(A), h = await Aa.from(this.ctx, u, {
13343
+ }), u = mn(A), h = await Aa.from(this.ctx, u, {
13328
13344
  anonymousCrossOrigin: !0,
13329
13345
  ignoreDimensions: !this.nonPOTSupport,
13330
13346
  ignoreAnimation: !0,
@@ -13403,14 +13419,14 @@ class ll {
13403
13419
  case L.FileUpload:
13404
13420
  return new cl(this.bundle, t).initialize();
13405
13421
  case L.ColorOption:
13406
- return new _a(
13422
+ return new Ka(
13407
13423
  this.bundle,
13408
13424
  t,
13409
13425
  t.entityId ? await H.getOption(t.entityId) : void 0
13410
13426
  );
13411
13427
  case L.Option: {
13412
13428
  const e = t.entityId ? await H.getOption(t.entityId) : void 0;
13413
- return e?.type === "Color" ? new _a(this.bundle, t, e) : new tr(this.bundle, t, e);
13429
+ return e?.type === "Color" ? new Ka(this.bundle, t, e) : new tr(this.bundle, t, e);
13414
13430
  }
13415
13431
  case L.Text:
13416
13432
  return new dl(this.bundle, t);
@@ -13419,7 +13435,7 @@ class ll {
13419
13435
  }
13420
13436
  }
13421
13437
  }
13422
- class Ia {
13438
+ class Ba {
13423
13439
  constructor(t, e) {
13424
13440
  this.bundle = t, this.property = e;
13425
13441
  }
@@ -13480,7 +13496,7 @@ class Ia {
13480
13496
  return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
13481
13497
  }
13482
13498
  }
13483
- class cl extends Ia {
13499
+ class cl extends Ba {
13484
13500
  constructor(t, e) {
13485
13501
  super(t, e);
13486
13502
  }
@@ -13491,7 +13507,7 @@ class cl extends Ia {
13491
13507
  const t = await this.getImage();
13492
13508
  if (t?.fileLink)
13493
13509
  if (t?.fileLink.endsWith(".svg")) {
13494
- const e = await nt(t?.fileLink), a = await ba(t?.fileLink), n = a.width, i = a.height, s = await ot(e);
13510
+ const e = await nt(t?.fileLink), a = await Ea(t?.fileLink), n = a.width, i = a.height, s = await ot(e);
13495
13511
  this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach((c) => {
13496
13512
  s.colors[c.key] = {
13497
13513
  browserValue: c.browserValue,
@@ -13706,7 +13722,7 @@ class cl extends Ia {
13706
13722
  );
13707
13723
  }
13708
13724
  }
13709
- class dl extends Ia {
13725
+ class dl extends Ba {
13710
13726
  constructor(t, e) {
13711
13727
  super(t, e);
13712
13728
  }
@@ -13745,7 +13761,7 @@ class dl extends Ia {
13745
13761
  await Promise.all(n);
13746
13762
  }
13747
13763
  }
13748
- class tr extends Ia {
13764
+ class tr extends Ba {
13749
13765
  constructor(t, e, a) {
13750
13766
  super(t, e), this.optionResource = a;
13751
13767
  }
@@ -13807,7 +13823,7 @@ class tr extends Ia {
13807
13823
  await Promise.all(n);
13808
13824
  }
13809
13825
  }
13810
- class _a extends tr {
13826
+ class Ka extends tr {
13811
13827
  constructor(t, e, a) {
13812
13828
  super(t, e, a);
13813
13829
  }
@@ -13908,7 +13924,7 @@ class hl {
13908
13924
  }
13909
13925
  async setGlobalPropertyState(t) {
13910
13926
  this.globalPropertyState || await this.initPromise;
13911
- const e = St(this.globalPropertyState);
13927
+ const e = vt(this.globalPropertyState);
13912
13928
  this.globalPropertyState = { ...t, id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
13913
13929
  }
13914
13930
  getAspectMandatoryFulfilled(t) {
@@ -13935,7 +13951,7 @@ class hl {
13935
13951
  if (!i)
13936
13952
  throw new Error(`Failed to find configuration aspect with name: ${t}`);
13937
13953
  this.mandatoryFulfilledAspects.set(t, e !== "");
13938
- const s = St(this.globalPropertyState), o = this.globalPropertyState.aspects.filter((l) => l.name === t);
13954
+ const s = vt(this.globalPropertyState), o = this.globalPropertyState.aspects.filter((l) => l.name === t);
13939
13955
  if (o.length > 0)
13940
13956
  if (n) {
13941
13957
  const l = o.find((c) => c.channel === n);
@@ -13978,7 +13994,7 @@ class hl {
13978
13994
  const n = this.configuration.aspects.find((o) => o.name === t);
13979
13995
  if (!n)
13980
13996
  throw new Error(`Failed to find configuration aspect with name: ${t}`);
13981
- const i = St(this.globalPropertyState), s = this.globalPropertyState.aspects.filter((o) => o.name === t);
13997
+ const i = vt(this.globalPropertyState), s = this.globalPropertyState.aspects.filter((o) => o.name === t);
13982
13998
  if (s.length > 0)
13983
13999
  if (a) {
13984
14000
  const o = s.find((l) => l.channel === a);
@@ -14375,7 +14391,7 @@ class ar {
14375
14391
  if (u || m.partial && (!m.data.productCollections || m.data.productCollections.length === 0 || !m.data.productCollections[0].productCollectionProductsFeed?.items || m.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
14376
14392
  return;
14377
14393
  l.abort(), u = !0, h.unsubscribe();
14378
- const p = m.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((g) => !!g.product).map((g) => new Ae(St(g))) || [];
14394
+ const p = m.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((g) => !!g.product).map((g) => new Ae(vt(g))) || [];
14379
14395
  A({
14380
14396
  items: p,
14381
14397
  // Clone items because it could be cached data (immutable)
@@ -15124,7 +15140,7 @@ class _e {
15124
15140
  }
15125
15141
  async getAllStakeholders() {
15126
15142
  const t = await y.getShadowGraphqlClient().query({
15127
- query: Ya,
15143
+ query: Ha,
15128
15144
  errorPolicy: "all",
15129
15145
  fetchPolicy: "no-cache",
15130
15146
  variables: {
@@ -15140,7 +15156,7 @@ class _e {
15140
15156
  }
15141
15157
  async getCurrentStakeholder() {
15142
15158
  const t = await y.getShadowGraphqlClient().query({
15143
- query: Ya,
15159
+ query: Ha,
15144
15160
  errorPolicy: "all",
15145
15161
  fetchPolicy: "no-cache",
15146
15162
  variables: {
@@ -15170,6 +15186,7 @@ class _e {
15170
15186
  name: this.getName(),
15171
15187
  dispatchDate: this.getDispatchDate() || "",
15172
15188
  purchaseOrder: this.getPurchaseOrder() || "",
15189
+ collectionId: this.getProductCollection()?.getId() || "",
15173
15190
  collectionName: this.getProductCollection()?.getName() || "",
15174
15191
  items: [],
15175
15192
  bundleOwnerId: this.ownerId
@@ -15202,6 +15219,7 @@ class _e {
15202
15219
  name: this.getName(),
15203
15220
  dispatchDate: this.getDispatchDate() || "",
15204
15221
  purchaseOrder: this.getPurchaseOrder() || "",
15222
+ collectionId: this.getProductCollection()?.getId() || "",
15205
15223
  collectionName: this.getProductCollection()?.getName() || "",
15206
15224
  items: a,
15207
15225
  bundleOwnerId: this.ownerId
@@ -15542,7 +15560,7 @@ class ue {
15542
15560
  return this.getArtifacts().get(t);
15543
15561
  }
15544
15562
  }
15545
- class Pa {
15563
+ class Ia {
15546
15564
  constructor(t) {
15547
15565
  this.value = t;
15548
15566
  }
@@ -15555,12 +15573,12 @@ class Pa {
15555
15573
  }
15556
15574
  }
15557
15575
  var Fl = /* @__PURE__ */ ((r) => (r.Transaction = "Transaction", r.Bundle = "Bundle", r.Product = "Product", r.Variant = "Variant", r.Option = "Option", r.LineItem = "LineItem", r.Asset = "Asset", r))(Fl || {});
15558
- class Ad extends Pa {
15576
+ class Ad extends Ia {
15559
15577
  constructor(t) {
15560
15578
  super(`"${t}"`);
15561
15579
  }
15562
15580
  }
15563
- class nr extends Pa {
15581
+ class nr extends Ia {
15564
15582
  constructor(t, e) {
15565
15583
  if (e !== "Asset" && !nr.validUUID(t))
15566
15584
  throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");
@@ -15570,12 +15588,12 @@ class nr extends Pa {
15570
15588
  return t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
15571
15589
  }
15572
15590
  }
15573
- class ud extends Pa {
15591
+ class ud extends Ia {
15574
15592
  constructor(t) {
15575
15593
  super(`[${t.map((e) => e.getRaw()).join(",")}]`);
15576
15594
  }
15577
15595
  }
15578
- class Xa {
15596
+ class _a {
15579
15597
  constructor(t) {
15580
15598
  this.integrationProduct = t;
15581
15599
  }
@@ -15763,7 +15781,7 @@ class Nl {
15763
15781
  }
15764
15782
  async generateCode(t) {
15765
15783
  const e = await this.cognitoClient?.send(
15766
- new ka({
15784
+ new xa({
15767
15785
  AuthFlow: "CUSTOM_AUTH",
15768
15786
  ClientId: this.userPoolClientId,
15769
15787
  AuthParameters: {
@@ -15797,7 +15815,7 @@ class Nl {
15797
15815
  throw new Error("Failed to find existing tokens.");
15798
15816
  const e = JSON.parse(t);
15799
15817
  return await this.cognitoClient?.send(
15800
- new ka({
15818
+ new xa({
15801
15819
  AuthFlow: "REFRESH_TOKEN_AUTH",
15802
15820
  ClientId: this.userPoolClientId,
15803
15821
  AuthParameters: {
@@ -15827,7 +15845,7 @@ class Ql {
15827
15845
  * @param currency The currency to determine precision for.
15828
15846
  */
15829
15847
  getPrecisionForCurrency(t) {
15830
- const e = t, a = Ma.code(e);
15848
+ const e = t, a = ka.code(e);
15831
15849
  return a ? a.digits : 2;
15832
15850
  }
15833
15851
  /**
@@ -15838,11 +15856,11 @@ class Ql {
15838
15856
  */
15839
15857
  getSpecialFormat(t) {
15840
15858
  const e = t;
15841
- if (Ma.code(e)?.code === "CLP")
15859
+ if (ka.code(e)?.code === "CLP")
15842
15860
  return "USD0,0";
15843
15861
  }
15844
15862
  }
15845
- const Za = new Ql();
15863
+ const Xa = new Ql();
15846
15864
  class Rl {
15847
15865
  constructor(t, e, a, n) {
15848
15866
  this.presentmentCurrency = void 0, this.presentmentCurrency = n, this.partnerCurrency = a, this.rateFrom = t, this.rateTo = e;
@@ -15874,13 +15892,13 @@ class Rl {
15874
15892
  * Converts a monetary value from the database to the units of its currency.
15875
15893
  */
15876
15894
  units(t, e) {
15877
- return t / Math.pow(10, Za.getPrecisionForCurrency(e));
15895
+ return t / Math.pow(10, Xa.getPrecisionForCurrency(e));
15878
15896
  }
15879
15897
  /**
15880
15898
  * Converts a monetary value in units to the subunits of its currency.
15881
15899
  */
15882
15900
  subunits(t, e) {
15883
- return t * Math.pow(10, Za.getPrecisionForCurrency(e));
15901
+ return t * Math.pow(10, Xa.getPrecisionForCurrency(e));
15884
15902
  }
15885
15903
  }
15886
15904
  const Ol = async (r, t) => {
@@ -15947,7 +15965,7 @@ class md {
15947
15965
  } catch (a) {
15948
15966
  throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
15949
15967
  }
15950
- }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15968
+ }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.3-beta.3eaa5ef7-903f-53ab-8b16-a79ca8ddc239"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15951
15969
  }
15952
15970
  configure(t) {
15953
15971
  gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && zr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16459,7 +16477,7 @@ class md {
16459
16477
  }));
16460
16478
  }, s = t.map((f, E) => ({ option: f, index: E })), o = s.filter((f) => f.option.type === "transaction"), l = s.filter(
16461
16479
  (f) => f.option.type === "integration" || f.option.type === "external"
16462
- ), c = xa(o, 10), d = xa(l, 10), A = (await Promise.all([
16480
+ ), c = Fa(o, 10), d = Fa(l, 10), A = (await Promise.all([
16463
16481
  ...c.map(n),
16464
16482
  ...d.map(i)
16465
16483
  ])).flat(), u = [...new Set(A.map((f) => f.workflowId))], h = await rr(u, e), m = new Map(h.map((f) => [f.id, f])), p = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), g = A.map(async (f) => {
@@ -16486,10 +16504,10 @@ class md {
16486
16504
  };
16487
16505
  if (T.type === "transaction" && E.workflowState) {
16488
16506
  const q = JSON.parse(E.workflowState);
16489
- W.layouts = Object.values(q.layouts || {}).map((Ct) => Ct.layout), await Ga(q), W.reloadedState = q;
16507
+ W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await za(q), W.reloadedState = q;
16490
16508
  } else if (!B && T.workflowState) {
16491
16509
  const q = JSON.parse(T.workflowState);
16492
- W.layouts = Object.values(q.layouts || {}).map((Ct) => Ct.layout), await Ga(q), W.reloadedState = q;
16510
+ W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await za(q), W.reloadedState = q;
16493
16511
  } else
16494
16512
  W.layouts = Ll(
16495
16513
  W.transaction,
@@ -16521,7 +16539,7 @@ class md {
16521
16539
  })).data?.integrationProducts;
16522
16540
  if (!i || i.length === 0 || !i[0]?.id)
16523
16541
  throw new Error("Integration product not found.");
16524
- return new Xa(i[0]);
16542
+ return new _a(i[0]);
16525
16543
  }
16526
16544
  async getIntegrationProductFromExternalIds(t, e, a) {
16527
16545
  const s = (await y.getShadowGraphqlClient().query({
@@ -16535,7 +16553,7 @@ class md {
16535
16553
  })).data?.integrationProductFromExternalIds;
16536
16554
  if (!s?.id)
16537
16555
  throw new Error("Integration product not found.");
16538
- return new Xa(s);
16556
+ return new _a(s);
16539
16557
  }
16540
16558
  async getIntegrationProduct(t) {
16541
16559
  return t.type === "integration" ? this.getIntegrationProductById(t.integrationProductId) : this.getIntegrationProductFromExternalIds(t.externalIntegrationId, t.externalProductId);
@@ -16632,7 +16650,7 @@ function me(r, t, e) {
16632
16650
  }
16633
16651
  class Gl {
16634
16652
  constructor(t, e) {
16635
- this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets = An(this.updateFrameOffsets, 200), this.targetElements = [], this.onFrameDataChangeListeners = [], this.onZoomChangeListeners = [], this.forceImageCover = t, this.initialZoom = e, this.thresholdSettings = {
16653
+ this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets = dn(this.updateFrameOffsets, 200), this.targetElements = [], this.onFrameDataChangeListeners = [], this.onZoomChangeListeners = [], this.forceImageCover = t, this.initialZoom = e, this.thresholdSettings = {
16636
16654
  useThreshold: !1,
16637
16655
  invertThreshold: !1,
16638
16656
  threshold: 128,
@@ -16653,7 +16671,7 @@ class Gl {
16653
16671
  let i = !1;
16654
16672
  for (let s = 0; s < n.currentFrameSources.length; s++) {
16655
16673
  const o = n.currentFrameSources[s], l = await Oe(o), c = this.frameData ? this.frameData[s] : void 0;
16656
- dn(l, c) || (this.frameData || (this.frameData = new Array(n.currentFrameSources.length)), this.frameData[s] = l, i = !0);
16674
+ cn(l, c) || (this.frameData || (this.frameData = new Array(n.currentFrameSources.length)), this.frameData[s] = l, i = !0);
16657
16675
  }
16658
16676
  i && (this.onFrameDataChangeListeners.forEach(
16659
16677
  (s) => s(this.frameData)
@@ -16842,7 +16860,7 @@ class Gl {
16842
16860
  }
16843
16861
  recalculateOffsets(t) {
16844
16862
  this.frameData && ((!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length)), this.frameData.forEach((e, a) => {
16845
- this.offsets[a] = Ea(
16863
+ this.offsets[a] = va(
16846
16864
  t,
16847
16865
  e,
16848
16866
  this.initialZoom && !this.forceImageCover ? { scale: this.initialZoom } : void 0,
@@ -17022,7 +17040,7 @@ class ql extends Z {
17022
17040
  }
17023
17041
  selectVariant(t) {
17024
17042
  const e = this.manager.getRegionElements(this.step.stepName);
17025
- return wt.selectVariant(
17043
+ return yt.selectVariant(
17026
17044
  this.step,
17027
17045
  t.getResource(),
17028
17046
  e,
@@ -17042,7 +17060,7 @@ class ql extends Z {
17042
17060
  * @param [recalculateOffsets=true] Optional: Recalculates the offsets of the image inside the frame. Default: `true`.
17043
17061
  */
17044
17062
  async selectImage(t, e = !0, a = !0) {
17045
- if (await wt.selectImage(this.step, t, this.manager, a), e) {
17063
+ if (await yt.selectImage(this.step, t, this.manager, a), e) {
17046
17064
  const n = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
17047
17065
  this.manager.updateStorage(this.step.stepName, {
17048
17066
  framePatternData: {
@@ -17080,7 +17098,7 @@ class ql extends Z {
17080
17098
  if (!e)
17081
17099
  throw new Error("You must supply an image selection before attempting to remove the background.");
17082
17100
  const a = await O.removeBackgroundFromAsset(e);
17083
- t && await wt.selectImage(this.step, a, this.manager, !1);
17101
+ t && await yt.selectImage(this.step, a, this.manager, !1);
17084
17102
  const n = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
17085
17103
  return this.manager.updateStorage(this.step.stepName, {
17086
17104
  framePatternData: {
@@ -17091,7 +17109,7 @@ class ql extends Z {
17091
17109
  }), a;
17092
17110
  }
17093
17111
  changeColors(t) {
17094
- wt.changeColors(this.step, this.manager, t);
17112
+ yt.changeColors(this.step, this.manager, t);
17095
17113
  }
17096
17114
  getImageData() {
17097
17115
  if (this.frameService)
@@ -17101,7 +17119,7 @@ class ql extends Z {
17101
17119
  return this.step.data.colorOption;
17102
17120
  }
17103
17121
  getAvailableColors() {
17104
- return this.step.data.colorPickerEnabled ? wt.availableColors(this.step, this.manager) : Promise.resolve([]);
17122
+ return this.step.data.colorPickerEnabled ? yt.availableColors(this.step, this.manager) : Promise.resolve([]);
17105
17123
  }
17106
17124
  isColorPickerEnabled() {
17107
17125
  return this.step.data.colorPickerEnabled ?? !1;
@@ -17114,7 +17132,7 @@ class ql extends Z {
17114
17132
  return this.step.data.maxColors;
17115
17133
  }
17116
17134
  getUniqueColorCount() {
17117
- return wt.getUniqueColorCount(this.step, this.manager);
17135
+ return yt.getUniqueColorCount(this.step, this.manager);
17118
17136
  }
17119
17137
  getCurrentFrameStep(t, e, a, n) {
17120
17138
  return n && n.length > 1 && t === void 0 ? "SelectFrame" : e || a || this.getImageData() ? "Position" : "SelectImage";
@@ -17184,7 +17202,7 @@ const jl = w`
17184
17202
  id
17185
17203
  }
17186
17204
  }
17187
- `, Da = w`
17205
+ `, Pa = w`
17188
17206
  query GetCustomerTransactions(
17189
17207
  $id: String!
17190
17208
  $limit: Int!
@@ -17351,7 +17369,7 @@ const jl = w`
17351
17369
  },
17352
17370
  context: t
17353
17371
  }), Pd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
17354
- query: Da,
17372
+ query: Pa,
17355
17373
  errorPolicy: "all",
17356
17374
  fetchPolicy: "no-cache",
17357
17375
  variables: {
@@ -17371,7 +17389,7 @@ const jl = w`
17371
17389
  limit: t
17372
17390
  }
17373
17391
  }))?.data.customerTransactionsFeed?.items || [], Dd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
17374
- query: Da,
17392
+ query: Pa,
17375
17393
  errorPolicy: "all",
17376
17394
  fetchPolicy: "no-cache",
17377
17395
  variables: {
@@ -17391,7 +17409,7 @@ const jl = w`
17391
17409
  limit: t
17392
17410
  }
17393
17411
  }))?.data.customerTransactionsFeed?.items || [], Fd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
17394
- query: Da,
17412
+ query: Pa,
17395
17413
  errorPolicy: "all",
17396
17414
  fetchPolicy: "no-cache",
17397
17415
  variables: {
@@ -17438,7 +17456,7 @@ K = { __e: function(r, t, e, a) {
17438
17456
  }
17439
17457
  throw r;
17440
17458
  } }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
17441
- var st, Xe, tn, ir = [], Ze = [], en = K.__b, an = K.__r, nn = K.diffed, rn = K.__c, sn = K.unmount;
17459
+ var st, Xe, Za, ir = [], Ze = [], tn = K.__b, en = K.__r, an = K.diffed, nn = K.__c, rn = K.unmount;
17442
17460
  function ec() {
17443
17461
  for (var r; r = ir.shift(); )
17444
17462
  if (r.__P && r.__H)
@@ -17449,17 +17467,17 @@ function ec() {
17449
17467
  }
17450
17468
  }
17451
17469
  K.__b = function(r) {
17452
- st = null, en && en(r);
17470
+ st = null, tn && tn(r);
17453
17471
  }, K.__r = function(r) {
17454
- an && an(r);
17472
+ en && en(r);
17455
17473
  var t = (st = r.__c).__H;
17456
17474
  t && (Xe === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
17457
17475
  e.__N && (e.__ = e.__N), e.__V = Ze, e.__N = e.i = void 0;
17458
17476
  })) : (t.__h.forEach(we), t.__h.forEach(da), t.__h = [])), Xe = st;
17459
17477
  }, K.diffed = function(r) {
17460
- nn && nn(r);
17478
+ an && an(r);
17461
17479
  var t = r.__c;
17462
- t && t.__H && (t.__H.__h.length && (ir.push(t) !== 1 && tn === K.requestAnimationFrame || ((tn = K.requestAnimationFrame) || ac)(ec)), t.__H.__.forEach(function(e) {
17480
+ t && t.__H && (t.__H.__h.length && (ir.push(t) !== 1 && Za === K.requestAnimationFrame || ((Za = K.requestAnimationFrame) || ac)(ec)), t.__H.__.forEach(function(e) {
17463
17481
  e.i && (e.__H = e.i), e.__V !== Ze && (e.__ = e.__V), e.i = void 0, e.__V = Ze;
17464
17482
  })), Xe = st = null;
17465
17483
  }, K.__c = function(r, t) {
@@ -17473,9 +17491,9 @@ K.__b = function(r) {
17473
17491
  n.__h && (n.__h = []);
17474
17492
  }), t = [], K.__e(a, e.__v);
17475
17493
  }
17476
- }), rn && rn(r, t);
17494
+ }), nn && nn(r, t);
17477
17495
  }, K.unmount = function(r) {
17478
- sn && sn(r);
17496
+ rn && rn(r);
17479
17497
  var t, e = r.__c;
17480
17498
  e && e.__H && (e.__H.__.forEach(function(a) {
17481
17499
  try {
@@ -17485,12 +17503,12 @@ K.__b = function(r) {
17485
17503
  }
17486
17504
  }), e.__H = void 0, t && K.__e(t, e.__v));
17487
17505
  };
17488
- var on = typeof requestAnimationFrame == "function";
17506
+ var sn = typeof requestAnimationFrame == "function";
17489
17507
  function ac(r) {
17490
17508
  var t, e = function() {
17491
- clearTimeout(a), on && cancelAnimationFrame(t), setTimeout(r);
17509
+ clearTimeout(a), sn && cancelAnimationFrame(t), setTimeout(r);
17492
17510
  }, a = setTimeout(e, 100);
17493
- on && (t = requestAnimationFrame(e));
17511
+ sn && (t = requestAnimationFrame(e));
17494
17512
  }
17495
17513
  function we(r) {
17496
17514
  var t = st, e = r.__c;
@@ -17522,7 +17540,7 @@ const sr = w`
17522
17540
  }
17523
17541
  missingComponentTypes
17524
17542
  }
17525
- `, Fa = w`
17543
+ `, Da = w`
17526
17544
  ${sr}
17527
17545
  fragment AddressValidationJobFields on AddressValidationJob {
17528
17546
  id
@@ -17535,14 +17553,14 @@ const sr = w`
17535
17553
  }
17536
17554
  }
17537
17555
  `, nc = w`
17538
- ${Fa}
17556
+ ${Da}
17539
17557
  query GetAddressValidationJobs($ids: [String!]!) {
17540
17558
  addressValidationJobs(ids: $ids) {
17541
17559
  ...AddressValidationJobFields
17542
17560
  }
17543
17561
  }
17544
17562
  `, rc = w`
17545
- ${Fa}
17563
+ ${Da}
17546
17564
  query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
17547
17565
  recipients(ids: $ids) {
17548
17566
  id
@@ -17559,7 +17577,7 @@ const sr = w`
17559
17577
  }
17560
17578
  }
17561
17579
  `, sc = w`
17562
- ${Fa}
17580
+ ${Da}
17563
17581
  mutation BatchValidateRecipientAddress($ids: [String!]!) {
17564
17582
  recipientValidateBatch(ids: $ids) {
17565
17583
  ...AddressValidationJobFields
@@ -17616,7 +17634,7 @@ export {
17616
17634
  oc as AddressValidationResultConfirmationLevel,
17617
17635
  ud as ArrayInput,
17618
17636
  L as AspectType,
17619
- vt as AssetNotFoundError,
17637
+ Et as AssetNotFoundError,
17620
17638
  ye as AssetType,
17621
17639
  id as BringForwardCommand,
17622
17640
  rd as BringToBackCommand,
@@ -17624,7 +17642,7 @@ export {
17624
17642
  br as BundleDesignCreationCartAddMode,
17625
17643
  N as CanvasCommand,
17626
17644
  Ae as CollectionProduct,
17627
- _a as ColorOptionGlobalPropertyHandle,
17645
+ Ka as ColorOptionGlobalPropertyHandle,
17628
17646
  ds as CommandContext,
17629
17647
  Ce as ConversionDataType,
17630
17648
  tc as ConversionLocation,
@@ -17641,16 +17659,16 @@ export {
17641
17659
  ms as FontAlignmentCommand,
17642
17660
  us as FontColorCommand,
17643
17661
  hs as FontSizeCommand,
17644
- qa as FontSourceCommand,
17662
+ Wa as FontSourceCommand,
17645
17663
  Gl as FrameService,
17646
17664
  Wl as FrameStep,
17647
17665
  ql as FrameStepHandle,
17648
- Ia as GlobalPropertyHandle,
17666
+ Ba as GlobalPropertyHandle,
17649
17667
  R as GroupCommand,
17650
17668
  So as IllustrationStepHandle,
17651
17669
  $e as InformationMessageType,
17652
17670
  Do as InformationStepHandle,
17653
- Xa as IntegrationProduct,
17671
+ _a as IntegrationProduct,
17654
17672
  Ir as IntegrationType,
17655
17673
  Xc as LayoutElementFactory,
17656
17674
  x as LayoutElementType,
@@ -17673,9 +17691,9 @@ export {
17673
17691
  Cl as ProductCollectionProductSortKey,
17674
17692
  qt as ProductWorkflow,
17675
17693
  Kt as PromiseCache,
17676
- kn as PromiseQueue,
17694
+ xn as PromiseQueue,
17677
17695
  Bo as QuestionStepHandle,
17678
- xn as QueueablePromise,
17696
+ Fn as QueueablePromise,
17679
17697
  ed as ResizeCommand,
17680
17698
  Yt as ResourceNotFoundError,
17681
17699
  td as RotateCommand,
@@ -17718,7 +17736,7 @@ export {
17718
17736
  $ as findElement,
17719
17737
  $c as findPmsColors,
17720
17738
  Vt as frameDataCache,
17721
- wt as frameStepService,
17739
+ yt as frameStepService,
17722
17740
  M as generate,
17723
17741
  al as generateCommands,
17724
17742
  ot as generateSVGWithUnknownColors,
@@ -17741,7 +17759,7 @@ export {
17741
17759
  Gc as getPointOfRotation,
17742
17760
  dd as getProductCollections,
17743
17761
  jc as getSEPoint,
17744
- Sa as getSvgElement,
17762
+ ya as getSvgElement,
17745
17763
  xd as getTemplateBundles,
17746
17764
  Fd as getTemplateTransactions,
17747
17765
  gd as getTransaction,
@@ -17774,17 +17792,17 @@ export {
17774
17792
  Jn as questionStepService,
17775
17793
  Nc as registerFetchImplementation,
17776
17794
  Tc as registerWindowImplementation,
17777
- Ga as rehydrateSerializedLayout,
17795
+ za as rehydrateSerializedLayout,
17778
17796
  _r as rgbToPms,
17779
17797
  ce as rotateAroundPoint,
17780
17798
  pa as sanitizeSvgTree,
17781
17799
  zr as setBearerAuthenticationToken,
17782
- Cn as setCanvasModule,
17800
+ fn as setCanvasModule,
17783
17801
  zt as shapeStepService,
17784
17802
  ws as shortenUrl,
17785
17803
  gt as spiffCoreConfiguration,
17786
17804
  ld as stepAspectValuesToDesignInputSteps,
17787
- $a as svgColorValueToDefinition,
17805
+ Oa as svgColorValueToDefinition,
17788
17806
  Ln as svgStringDimensions,
17789
17807
  ha as svgToDataUrl,
17790
17808
  G as textStepService,