@spiffcommerce/core 32.2.2 → 32.2.3-beta.74fbcd09-3d5d-53d3-8369-97f904c95dbd

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
@@ -23,7 +23,7 @@ import { split as ea } from "unicode-default-word-boundary";
23
23
  import dn from "lodash.debounce";
24
24
  import "fs";
25
25
  import "path";
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 || {}), br = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(br || {}), 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 || {}), An = /* @__PURE__ */ ((r) => (r.Pending = "Pending", r.Failed = "Failed", r.Validated = "Validated", r.Overridden = "Overridden", r))(An || {}), Ir = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Ir || {}), Pr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Pr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Dr = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Dr || {}), 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 || {}), Fr = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Fr || {});
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 || {}), U = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(U || {}), 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 || {}), br = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(br || {}), 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 || {}), An = /* @__PURE__ */ ((r) => (r.Pending = "Pending", r.Failed = "Failed", r.Validated = "Validated", r.Overridden = "Overridden", r))(An || {}), Ir = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Ir || {}), Pr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Pr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Dr = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Dr || {}), 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 || {}), Fr = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Fr || {});
27
27
  class un extends Error {
28
28
  constructor(t) {
29
29
  super(t), this.name = this.constructor.name;
@@ -6534,15 +6534,15 @@ class td {
6534
6534
  };
6535
6535
  }
6536
6536
  }
6537
- class U extends Error {
6537
+ class L extends Error {
6538
6538
  constructor() {
6539
- super("Element not found!"), Object.setPrototypeOf(this, U.prototype);
6539
+ super("Element not found!"), Object.setPrototypeOf(this, L.prototype);
6540
6540
  }
6541
6541
  }
6542
6542
  const $ = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
6543
6543
  const e = Object.values(t).find((a) => a.elements.some((n) => n.id === r));
6544
6544
  if (!e)
6545
- throw new U();
6545
+ throw new L();
6546
6546
  return e;
6547
6547
  }, X = (r, t) => {
6548
6548
  const e = [...t.elements.filter((n) => n.id !== r.id), r], a = Sa(e);
@@ -6630,7 +6630,7 @@ class ed extends N {
6630
6630
  this.oldState = t;
6631
6631
  const e = $(this.id, Object.values(t.layouts));
6632
6632
  if (!e.id)
6633
- throw new U();
6633
+ throw new L();
6634
6634
  const a = {
6635
6635
  ...e,
6636
6636
  x: this.x,
@@ -6653,7 +6653,7 @@ class ad extends N {
6653
6653
  this.oldState = t;
6654
6654
  const e = $(this.id, Object.values(t.layouts));
6655
6655
  if (!e.id)
6656
- throw new U();
6656
+ throw new L();
6657
6657
  const a = {
6658
6658
  ...e,
6659
6659
  rotation: this.angle
@@ -6675,7 +6675,7 @@ class nd extends N {
6675
6675
  this.oldState = t;
6676
6676
  const e = $(this.id, Object.values(t.layouts));
6677
6677
  if (!e.id)
6678
- throw new U();
6678
+ throw new L();
6679
6679
  let a = {
6680
6680
  ...e,
6681
6681
  width: this.width,
@@ -6813,7 +6813,7 @@ class hs extends N {
6813
6813
  this.oldState = t;
6814
6814
  const e = $(this.id, Object.values(t.layouts));
6815
6815
  if (!e.id)
6816
- throw new U();
6816
+ throw new L();
6817
6817
  const a = {
6818
6818
  ...e,
6819
6819
  fill: this.color,
@@ -6837,7 +6837,7 @@ class je extends N {
6837
6837
  this.oldState = t;
6838
6838
  const e = $(this.id, Object.values(t.layouts));
6839
6839
  if (!e.id)
6840
- throw new U();
6840
+ throw new L();
6841
6841
  const a = {
6842
6842
  ...e,
6843
6843
  textFillImage: this.imageFill
@@ -6859,7 +6859,7 @@ class ms extends N {
6859
6859
  this.oldState = t;
6860
6860
  const e = $(this.id, Object.values(t.layouts));
6861
6861
  if (!e.id)
6862
- throw new U();
6862
+ throw new L();
6863
6863
  const a = {
6864
6864
  ...e,
6865
6865
  fontSize: this.size
@@ -6881,7 +6881,7 @@ class Wa extends N {
6881
6881
  this.oldState = t;
6882
6882
  const e = $(this.id, Object.values(t.layouts));
6883
6883
  if (!e.id)
6884
- throw new U();
6884
+ throw new L();
6885
6885
  const a = {
6886
6886
  ...e,
6887
6887
  fontData: this.fontData
@@ -6903,7 +6903,7 @@ class gs extends N {
6903
6903
  this.oldState = t;
6904
6904
  const e = $(this.id, Object.values(t.layouts));
6905
6905
  if (!e.id)
6906
- throw new U();
6906
+ throw new L();
6907
6907
  const a = {
6908
6908
  ...e,
6909
6909
  align: this.align
@@ -6961,7 +6961,7 @@ class fs extends N {
6961
6961
  this.oldState = t;
6962
6962
  const e = $(this.id, Object.values(t.layouts));
6963
6963
  if (!e.id)
6964
- throw new U();
6964
+ throw new L();
6965
6965
  const a = {
6966
6966
  ...e,
6967
6967
  useThreshold: this.useThreshold,
@@ -6986,7 +6986,7 @@ class rd extends N {
6986
6986
  this.oldState = t;
6987
6987
  const e = $(this.id, Object.values(t.layouts));
6988
6988
  if (!e.id)
6989
- throw new U();
6989
+ throw new L();
6990
6990
  const a = {
6991
6991
  ...e,
6992
6992
  src: this.src
@@ -7008,7 +7008,7 @@ class Cs extends N {
7008
7008
  this.oldState = t;
7009
7009
  const e = $(this.id, Object.values(t.layouts));
7010
7010
  if (!e.id)
7011
- throw new U();
7011
+ throw new L();
7012
7012
  const a = _(e.id, Object.values(t.layouts)), n = X(ae(e, this.text, e), a);
7013
7013
  return {
7014
7014
  ...t,
@@ -7027,7 +7027,7 @@ class He extends N {
7027
7027
  this.oldState = t;
7028
7028
  const e = $(this.id, Object.values(t.layouts));
7029
7029
  if (!e.id)
7030
- throw new U();
7030
+ throw new L();
7031
7031
  const a = {
7032
7032
  ...e,
7033
7033
  strokeColor: this.strokeColor,
@@ -7050,7 +7050,7 @@ class ca extends N {
7050
7050
  this.oldState = t;
7051
7051
  const e = $(this.id, Object.values(t.layouts));
7052
7052
  if (!e.id)
7053
- throw new U();
7053
+ throw new L();
7054
7054
  const a = e.colors || {}, n = a[this.className];
7055
7055
  typeof this.fill == "string" ? a[this.className] = {
7056
7056
  browserValue: this.fill,
@@ -7082,7 +7082,7 @@ class ws extends N {
7082
7082
  this.oldState = t;
7083
7083
  const e = $(this.id, Object.values(t.layouts));
7084
7084
  if (!e.id)
7085
- throw new U();
7085
+ throw new L();
7086
7086
  const a = {
7087
7087
  ...e,
7088
7088
  svg: this.svgBody,
@@ -7106,7 +7106,7 @@ class id extends N {
7106
7106
  }
7107
7107
  apply(t) {
7108
7108
  if (this.oldState = t, !$(this.id, Object.values(t.layouts)).id)
7109
- throw new U();
7109
+ throw new L();
7110
7110
  const a = Object.values(t.layouts).find((s) => s.elements.find((o) => o.id === this.id));
7111
7111
  if (!a)
7112
7112
  throw new Error("Layout missing from state!");
@@ -7137,7 +7137,7 @@ class sd extends N {
7137
7137
  this.oldState = t;
7138
7138
  const e = $(this.id, Object.values(t.layouts));
7139
7139
  if (!e.id)
7140
- throw new U();
7140
+ throw new L();
7141
7141
  const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
7142
7142
  if (!a)
7143
7143
  throw new Error("Layout missing from state!");
@@ -7166,7 +7166,7 @@ class od extends N {
7166
7166
  }
7167
7167
  apply(t) {
7168
7168
  if (this.oldState = t, !$(this.id, Object.values(t.layouts)).id)
7169
- throw new U();
7169
+ throw new L();
7170
7170
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7171
7171
  if (!a)
7172
7172
  throw new Error("Layout missing from state!");
@@ -7193,7 +7193,7 @@ class ld extends N {
7193
7193
  }
7194
7194
  apply(t) {
7195
7195
  if (this.oldState = t, !$(this.id, Object.values(t.layouts)).id)
7196
- throw new U();
7196
+ throw new L();
7197
7197
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7198
7198
  if (!a)
7199
7199
  throw new Error("Layout missing from state!");
@@ -8749,7 +8749,7 @@ class Ms {
8749
8749
  const u = e.getWorkflowExperience().getBundle();
8750
8750
  if (u && t.globalPropertyAspectConfigurations) {
8751
8751
  const g = u.getGlobalPropertyConfiguration()?.aspects?.find(
8752
- (p) => p.type === L.Text && t.globalPropertyAspectConfigurations?.map((f) => f.aspectName).includes(p.name)
8752
+ (p) => p.type === U.Text && t.globalPropertyAspectConfigurations?.map((f) => f.aspectName).includes(p.name)
8753
8753
  );
8754
8754
  if (g) {
8755
8755
  const f = u.getGlobalPropertyStateManager().getAspect(g.name);
@@ -8977,7 +8977,7 @@ class Ms {
8977
8977
  const g = e.getWorkflowExperience().getBundle();
8978
8978
  if (g && t.globalPropertyAspectConfigurations) {
8979
8979
  const f = g.getGlobalPropertyConfiguration()?.aspects?.find(
8980
- (S) => S.type === L.Text && t.globalPropertyAspectConfigurations?.map((b) => b.aspectName).includes(S.name)
8980
+ (S) => S.type === U.Text && t.globalPropertyAspectConfigurations?.map((b) => b.aspectName).includes(S.name)
8981
8981
  );
8982
8982
  if (f) {
8983
8983
  const b = g.getGlobalPropertyStateManager().getAspect(f.name);
@@ -9024,7 +9024,7 @@ class Ms {
9024
9024
  const c = e.getWorkflowExperience().getBundle();
9025
9025
  if (c && t.globalPropertyAspectConfigurations) {
9026
9026
  const A = c.getGlobalPropertyConfiguration()?.aspects?.find(
9027
- (u) => u.type === L.Text && t.globalPropertyAspectConfigurations?.map((h) => h.aspectName).includes(u.name)
9027
+ (u) => u.type === U.Text && t.globalPropertyAspectConfigurations?.map((h) => h.aspectName).includes(u.name)
9028
9028
  );
9029
9029
  if (A) {
9030
9030
  const h = c.getGlobalPropertyStateManager().getAspect(A.name);
@@ -13413,19 +13413,19 @@ class cl {
13413
13413
  }
13414
13414
  async createHandle(t) {
13415
13415
  switch (t.type) {
13416
- case L.FileUpload:
13416
+ case U.FileUpload:
13417
13417
  return new dl(this.bundle, t).initialize();
13418
- case L.ColorOption:
13418
+ case U.ColorOption:
13419
13419
  return new Ka(
13420
13420
  this.bundle,
13421
13421
  t,
13422
13422
  t.entityId ? await H.getOption(t.entityId) : void 0
13423
13423
  );
13424
- case L.Option: {
13424
+ case U.Option: {
13425
13425
  const e = t.entityId ? await H.getOption(t.entityId) : void 0;
13426
13426
  return e?.type === "Color" ? new Ka(this.bundle, t, e) : new er(this.bundle, t, e);
13427
13427
  }
13428
- case L.Text:
13428
+ case U.Text:
13429
13429
  return new Al(this.bundle, t);
13430
13430
  default:
13431
13431
  throw new Error("Unhandled Global Property Aspect Type");
@@ -14021,15 +14021,15 @@ class ml {
14021
14021
  let a = e.type && e.storage ? {} : void 0;
14022
14022
  if (a)
14023
14023
  switch (e.type) {
14024
- case L.FileUpload: {
14024
+ case U.FileUpload: {
14025
14025
  a.fileUpload = e.storage;
14026
14026
  break;
14027
14027
  }
14028
- case L.Option: {
14028
+ case U.Option: {
14029
14029
  a.option = e.storage;
14030
14030
  break;
14031
14031
  }
14032
- case L.ColorOption: {
14032
+ case U.ColorOption: {
14033
14033
  a = e.storage;
14034
14034
  break;
14035
14035
  }
@@ -14690,7 +14690,7 @@ const bl = w`
14690
14690
  `;
14691
14691
  class _e {
14692
14692
  constructor(t, e, a, n, i, s) {
14693
- this.workflowExperiences = [], this.eventEmitter = new El(), this.client = t, this.id = e.id, this.name = e.name || "", this.dispatchDate = e.dispatchDate, this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(e.metadata?.map((c) => [c.key, c.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new gl(e.bundleStateData);
14693
+ this.workflowExperiences = [], this.eventEmitter = new El(), this.updatesLocked = !1, this.client = t, this.id = e.id, this.name = e.name || "", this.dispatchDate = e.dispatchDate, this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(e.metadata?.map((c) => [c.key, c.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new gl(e.bundleStateData);
14694
14694
  const o = this.productCollection?.globalPropertyConfiguration;
14695
14695
  this.globalConfigurationPropertyId = o?.id, this.globalPropertyStateManager = new ml(
14696
14696
  this.id,
@@ -14708,7 +14708,7 @@ class _e {
14708
14708
  const A = this.globalPropertyStateManager.getGlobalPropertyState();
14709
14709
  A ? this.globalPropertyHandleService.getHandles().then((u) => {
14710
14710
  const h = u.map((m) => {
14711
- if (m.getType() === L.ColorOption || m.getType() === L.Option) {
14711
+ if (m.getType() === U.ColorOption || m.getType() === U.Option) {
14712
14712
  const g = m;
14713
14713
  if (!A.aspects.find((f) => f.name === g.getName()))
14714
14714
  return g.initDefaultVariant();
@@ -14834,57 +14834,57 @@ class _e {
14834
14834
  );
14835
14835
  }
14836
14836
  async applyGlobalPropertyState(t) {
14837
+ this.updatesLocked = !0;
14837
14838
  const e = await this.globalPropertyHandleService.getHandles();
14838
- for (const a of t.aspects) {
14839
- const n = a?.name;
14840
- this.getGlobalPropertyStateManager().setAspect(n, a.value);
14841
- }
14842
- for (const a of t.aspects) {
14843
- const n = a?.name, i = e.find((s) => s.getName() === n);
14844
- if (i)
14845
- switch (a.type) {
14846
- case L.FileUpload: {
14847
- const s = i, o = await be([a.value]);
14848
- o.length > 0 && await s.selectImage(o[0]);
14849
- const l = a.storage?.colors;
14850
- if (l) {
14851
- const c = Object.fromEntries(
14852
- l.map((d) => [
14853
- d.key,
14854
- { browserValue: d.browserValue, pmsValue: d.pmsValue }
14855
- ]) ?? []
14856
- );
14857
- await s.changeColors(c);
14839
+ try {
14840
+ for (const a of t.aspects) {
14841
+ const n = a?.name;
14842
+ this.getGlobalPropertyStateManager().setAspect(n, a.value);
14843
+ }
14844
+ for (const a of t.aspects) {
14845
+ const n = a?.name, i = e.find((s) => s.getName() === n);
14846
+ if (i)
14847
+ switch (a.type) {
14848
+ case U.FileUpload: {
14849
+ const s = i, o = await be([a.value]);
14850
+ o.length > 0 && await s.selectImage(o[0]);
14851
+ const l = a.storage?.colors;
14852
+ if (l) {
14853
+ const c = Object.fromEntries(
14854
+ l.map((d) => [
14855
+ d.key,
14856
+ { browserValue: d.browserValue, pmsValue: d.pmsValue }
14857
+ ]) ?? []
14858
+ );
14859
+ await s.changeColors(c);
14860
+ }
14861
+ break;
14858
14862
  }
14859
- break;
14860
- }
14861
- case L.ColorOption: {
14862
- const s = i;
14863
- if (a.type === L.ColorOption) {
14864
- const l = s.getAllVariants().find((c) => c.getId() === a.value);
14863
+ case U.ColorOption: {
14864
+ const s = i, l = s.getAllVariants().find((c) => c.getId() === a.value);
14865
+ l && await s.selectVariant(l), a.storage && a.storage.customColor && s.setCustomColor(a.value);
14866
+ break;
14867
+ }
14868
+ case U.Option: {
14869
+ const s = i, l = s.getAllVariants().find((c) => c.getId() === a.value);
14865
14870
  l && await s.selectVariant(l);
14866
- } else
14867
- s.setCustomColor(a.value);
14868
- break;
14869
- }
14870
- case L.Option: {
14871
- const s = i, l = s.getAllVariants().find((c) => c.getId() === a.value);
14872
- l && await s.selectVariant(l);
14873
- break;
14874
- }
14875
- case L.Text: {
14876
- await i.setText(a.value);
14877
- break;
14871
+ break;
14872
+ }
14873
+ case U.Text: {
14874
+ await i.setText(a.value);
14875
+ break;
14876
+ }
14878
14877
  }
14879
- }
14878
+ }
14879
+ } finally {
14880
+ this.updatesLocked = !1, this.onGlobalPropertiesChanged(void 0, this.globalPropertyStateManager.getGlobalPropertyState());
14880
14881
  }
14881
- this.checkMandatoryHandlesChanged(void 0, e);
14882
14882
  }
14883
14883
  getGlobalPropertyStateManager() {
14884
14884
  return this.globalPropertyStateManager;
14885
14885
  }
14886
14886
  async getGlobalPropertyTotalSubunits() {
14887
- return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === L.Option).map((a) => a.getCurrentVariant()?.getPrice() || 0).reduce((a, n) => a + n, 0);
14887
+ return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === U.Option).map((a) => a.getCurrentVariant()?.getPrice() || 0).reduce((a, n) => a + n, 0);
14888
14888
  }
14889
14889
  getTotalSubunits() {
14890
14890
  return this.workflowExperiences.map((t) => t.getTotalPriceSubunits()).reduce((t, e) => t + e, 0);
@@ -14899,7 +14899,7 @@ class _e {
14899
14899
  const i = this.getGlobalPropertyConfiguration()?.aspects.find(
14900
14900
  (s) => s.name === n
14901
14901
  );
14902
- if (i && i.type === L.ColorOption) {
14902
+ if (i && i.type === U.ColorOption) {
14903
14903
  const s = e.getCurrentVariant()?.getAssetResource(), o = s?.assetConfiguration?.channelNumbers || [], l = s?.assetConfiguration?.defaultColorVariants || [], c = hl(
14904
14904
  this.getWorkflowExperiences(),
14905
14905
  this.globalConfigurationPropertyId || "",
@@ -15346,8 +15346,18 @@ class _e {
15346
15346
  });
15347
15347
  }
15348
15348
  async onGlobalPropertiesChanged(t, e) {
15349
+ if (this.updatesLocked)
15350
+ return;
15349
15351
  const a = await this.globalPropertyHandleService.getHandles(), n = this.globalPropertyHandleService.applyConditionsFromState(a, t), i = this.globalPropertyHandleService.applyConditionsFromState(a, e);
15350
- this.checkConditionalHandlesChanged(n, i), this.checkMandatoryHandlesChanged(t, i), await Promise.all(i.map((s) => s.applyGlobalState()));
15352
+ this.checkConditionalHandlesChanged(n, i), this.checkMandatoryHandlesChanged(t, i);
15353
+ const s = a.map((o) => {
15354
+ if (o.getType() === U.ColorOption || o.getType() === U.Option) {
15355
+ const l = o;
15356
+ if (!e.aspects.find((d) => d.name === l.getName()))
15357
+ return l.initDefaultVariant();
15358
+ }
15359
+ });
15360
+ await Promise.all(s), await Promise.all(i.map((o) => o.applyGlobalState()));
15351
15361
  }
15352
15362
  checkConditionalHandlesChanged(t, e) {
15353
15363
  (() => {
@@ -15965,7 +15975,7 @@ class pd {
15965
15975
  } catch (a) {
15966
15976
  throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
15967
15977
  }
15968
- }, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15978
+ }, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.3-beta.b5a7d626-2f37-53ef-b01b-0ee2a6660230"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15969
15979
  }
15970
15980
  configure(t) {
15971
15981
  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 && Gr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -17655,7 +17665,7 @@ export {
17655
17665
  cc as AddressValidationResultConfirmationLevel,
17656
17666
  An as AddressValidationStatus,
17657
17667
  md as ArrayInput,
17658
- L as AspectType,
17668
+ U as AspectType,
17659
17669
  bt as AssetNotFoundError,
17660
17670
  ye as AssetType,
17661
17671
  od as BringForwardCommand,