@spiffcommerce/core 34.4.10 → 35.0.1
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.d.ts +1 -1
- package/dist/index.js +33 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +350 -332
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -135,7 +135,7 @@ const Yr = () => {
|
|
|
135
135
|
} catch {
|
|
136
136
|
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new za();
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, M = Yr();
|
|
139
139
|
class Jr {
|
|
140
140
|
constructor() {
|
|
141
141
|
this.defaultServerUrl = "https://api.au.spiffcommerce.com", this.defaultServicesApiUrl = "https://services.au.spiffcommerce.com", this.defaultHubUrl = "https://hub.au.spiffcommerce.com", this.serverUrl = this.defaultServerUrl, this.servicesApiUrl = this.defaultServicesApiUrl, this.hubUrl = this.defaultHubUrl, this.serverUrlCallbacks = [];
|
|
@@ -346,9 +346,9 @@ class di {
|
|
|
346
346
|
const u = o.partnerId ?? c.partnerId, h = o.activeIntegration ?? c.activeIntegration, g = o.transactionOwnerId, m = o.customerToken ?? c.customerToken, p = o.applicationKey ?? c.applicationKey, f = o.bundleOwnerId;
|
|
347
347
|
try {
|
|
348
348
|
if (window && window.__SENTRY__) {
|
|
349
|
-
const
|
|
350
|
-
if (
|
|
351
|
-
const w =
|
|
349
|
+
const y = window.__SENTRY__.hub;
|
|
350
|
+
if (y) {
|
|
351
|
+
const w = y.traceHeaders();
|
|
352
352
|
Object.entries(w).forEach(([x, v]) => {
|
|
353
353
|
l[x] = v;
|
|
354
354
|
});
|
|
@@ -370,7 +370,7 @@ class di {
|
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
const
|
|
373
|
+
const S = new di();
|
|
374
374
|
let ua, ha;
|
|
375
375
|
const ft = (n, t, e) => {
|
|
376
376
|
if (ua !== void 0)
|
|
@@ -3527,20 +3527,20 @@ const le = (n) => {
|
|
|
3527
3527
|
...AssetFields
|
|
3528
3528
|
}
|
|
3529
3529
|
}
|
|
3530
|
-
`, Ie = async (n) => (await
|
|
3530
|
+
`, Ie = async (n) => (await S.getShadowGraphqlClient().query({
|
|
3531
3531
|
query: Bi,
|
|
3532
3532
|
errorPolicy: "all",
|
|
3533
3533
|
fetchPolicy: "no-cache",
|
|
3534
3534
|
variables: {
|
|
3535
3535
|
keys: n
|
|
3536
3536
|
}
|
|
3537
|
-
})).data.assets, Fi = async (n) => (await
|
|
3537
|
+
})).data.assets, Fi = async (n) => (await S.getShadowGraphqlClient().query({
|
|
3538
3538
|
query: Pi,
|
|
3539
3539
|
errorPolicy: "all",
|
|
3540
3540
|
variables: {
|
|
3541
3541
|
ids: n
|
|
3542
3542
|
}
|
|
3543
|
-
})).data.materials, ki = async (n, t, e, a, r) => (await
|
|
3543
|
+
})).data.materials, ki = async (n, t, e, a, r) => (await S.getShadowGraphqlClient().mutate({
|
|
3544
3544
|
mutation: xi,
|
|
3545
3545
|
errorPolicy: "all",
|
|
3546
3546
|
fetchPolicy: "no-cache",
|
|
@@ -3654,7 +3654,7 @@ class Mi {
|
|
|
3654
3654
|
return this.bgrmProcessCache.set(e, i), i;
|
|
3655
3655
|
}
|
|
3656
3656
|
const r = (async () => {
|
|
3657
|
-
const i = await
|
|
3657
|
+
const i = await S.getShadowGraphqlClient().mutate({
|
|
3658
3658
|
mutation: Di,
|
|
3659
3659
|
fetchPolicy: "no-cache",
|
|
3660
3660
|
errorPolicy: "all",
|
|
@@ -3738,26 +3738,26 @@ const Rt = "persistentAssets", lt = class lt {
|
|
|
3738
3738
|
}
|
|
3739
3739
|
const e = /* @__PURE__ */ new Map();
|
|
3740
3740
|
e.set(t.key || "", t.fileLink);
|
|
3741
|
-
const a =
|
|
3741
|
+
const a = M.getMap(Rt);
|
|
3742
3742
|
a && a.forEach((r, i) => {
|
|
3743
3743
|
e.set(i, r);
|
|
3744
|
-
}),
|
|
3744
|
+
}), M.setMap(Rt, e), lt.executeCallbacks();
|
|
3745
3745
|
}
|
|
3746
3746
|
/**
|
|
3747
3747
|
* Remove an existing asset from persistence. Noop if the asset doesn't exist.
|
|
3748
3748
|
* @param assetKey The key to remove.
|
|
3749
3749
|
*/
|
|
3750
3750
|
static remove(t) {
|
|
3751
|
-
const e =
|
|
3751
|
+
const e = M.getMap(Rt);
|
|
3752
3752
|
if (!e) return;
|
|
3753
3753
|
const a = Array.from(e.entries()).find((r) => r[0] === t);
|
|
3754
|
-
a && (e.delete(a[0]),
|
|
3754
|
+
a && (e.delete(a[0]), M.setMap(Rt, e), lt.executeCallbacks());
|
|
3755
3755
|
}
|
|
3756
3756
|
/**
|
|
3757
3757
|
* Get a list of all persisted assets.
|
|
3758
3758
|
*/
|
|
3759
3759
|
static list() {
|
|
3760
|
-
const t =
|
|
3760
|
+
const t = M.getMap(Rt);
|
|
3761
3761
|
return t ? Array.from(t.entries()).map((e) => ({ assetKey: e[0], src: e[1] })) : [];
|
|
3762
3762
|
}
|
|
3763
3763
|
/**
|
|
@@ -3805,10 +3805,10 @@ class K {
|
|
|
3805
3805
|
a && (e.delete(a), K.setMap(e));
|
|
3806
3806
|
}
|
|
3807
3807
|
static getMap() {
|
|
3808
|
-
return
|
|
3808
|
+
return M.getMap(Ya) || /* @__PURE__ */ new Map();
|
|
3809
3809
|
}
|
|
3810
3810
|
static setMap(t) {
|
|
3811
|
-
|
|
3811
|
+
M.setMap(Ya, t);
|
|
3812
3812
|
}
|
|
3813
3813
|
}
|
|
3814
3814
|
const j = new Mi();
|
|
@@ -3888,7 +3888,7 @@ const Be = new Ti(), On = C`
|
|
|
3888
3888
|
}
|
|
3889
3889
|
}
|
|
3890
3890
|
`, Qi = async (n) => {
|
|
3891
|
-
const t = await
|
|
3891
|
+
const t = await S.getShadowGraphqlClient().query({
|
|
3892
3892
|
query: Ni,
|
|
3893
3893
|
errorPolicy: "all",
|
|
3894
3894
|
variables: {
|
|
@@ -5298,7 +5298,7 @@ class Wn {
|
|
|
5298
5298
|
}
|
|
5299
5299
|
}
|
|
5300
5300
|
}
|
|
5301
|
-
const
|
|
5301
|
+
const N = () => {
|
|
5302
5302
|
const n = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
|
|
5303
5303
|
return n() + n() + "-" + n() + "-" + n() + "-" + n() + "-" + n() + n() + n();
|
|
5304
5304
|
}, fo = ({
|
|
@@ -5316,7 +5316,7 @@ const T = () => {
|
|
|
5316
5316
|
viewBox: A,
|
|
5317
5317
|
width: u
|
|
5318
5318
|
}) => {
|
|
5319
|
-
const h = e || 0, g = 2 * (l?.scale || 1), m = A || { x: 0, y: 0, width: u, height: i }, p = `${m.x} ${m.y} ${m.width} ${m.height}`, f =
|
|
5319
|
+
const h = e || 0, g = 2 * (l?.scale || 1), m = A || { x: 0, y: 0, width: u, height: i }, p = `${m.x} ${m.y} ${m.width} ${m.height}`, f = N(), y = a.purpose === Yt.FreeDesign && /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ P("rect", { width: m.width, height: m.height, rx: h }) }) }), w = a.colorProfiles?.map((E, I) => (
|
|
5320
5320
|
/* @ts-ignore */
|
|
5321
5321
|
/* @__PURE__ */ P("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, I)
|
|
5322
5322
|
)), x = r.map((E) => ({
|
|
@@ -5344,7 +5344,7 @@ const T = () => {
|
|
|
5344
5344
|
viewBox: p,
|
|
5345
5345
|
children: [
|
|
5346
5346
|
w,
|
|
5347
|
-
|
|
5347
|
+
y,
|
|
5348
5348
|
!!n && /* @__PURE__ */ P(
|
|
5349
5349
|
"rect",
|
|
5350
5350
|
{
|
|
@@ -5402,7 +5402,7 @@ const T = () => {
|
|
|
5402
5402
|
}
|
|
5403
5403
|
);
|
|
5404
5404
|
}, hd = (n, t, e, a, r) => {
|
|
5405
|
-
const i = Ct(r), o = e / 2, s = a / 2, l = n + o, c = t + s, d = Math.sin(i), A = Math.cos(i), u = o, h = o, g = -s, m = s, p = u * A - g * d, f = h * A - m * d,
|
|
5405
|
+
const i = Ct(r), o = e / 2, s = a / 2, l = n + o, c = t + s, d = Math.sin(i), A = Math.cos(i), u = o, h = o, g = -s, m = s, p = u * A - g * d, f = h * A - m * d, y = u * d + g * A, w = h * d + m * A, x = Math.max(Math.abs(p), Math.abs(f)), v = Math.max(Math.abs(y), Math.abs(w));
|
|
5406
5406
|
return {
|
|
5407
5407
|
minX: l - x,
|
|
5408
5408
|
maxX: l + x,
|
|
@@ -5715,7 +5715,7 @@ const yo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Je = /* @_
|
|
|
5715
5715
|
});
|
|
5716
5716
|
const o = e.querySelectorAll("tspan");
|
|
5717
5717
|
for (let d = 0; d < o.length; d++) {
|
|
5718
|
-
const A = o.item(d), u = A.closest("text"), h = A.closest("g"), g = u.getAttribute("font-family"), m = await Tt(r.get(g)), p = Tr(A.innerHTML), f = u.getAttribute("fill"),
|
|
5718
|
+
const A = o.item(d), u = A.closest("text"), h = A.closest("g"), g = u.getAttribute("font-family"), m = await Tt(r.get(g)), p = Tr(A.innerHTML), f = u.getAttribute("fill"), y = u.getAttribute("stroke"), w = u.getAttribute("stroke-width"), x = m.getPath(
|
|
5719
5719
|
p,
|
|
5720
5720
|
0,
|
|
5721
5721
|
0,
|
|
@@ -5724,15 +5724,15 @@ const yo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Je = /* @_
|
|
|
5724
5724
|
let E = 0;
|
|
5725
5725
|
const I = A.getAttribute("text-anchor");
|
|
5726
5726
|
I === "middle" ? E = v / 2 : I === "end" && (E = v);
|
|
5727
|
-
const
|
|
5727
|
+
const T = m.getPath(
|
|
5728
5728
|
p,
|
|
5729
5729
|
parseFloat(A.getAttribute("x") ?? "0") - E,
|
|
5730
5730
|
parseFloat(A.getAttribute("y") ?? "0"),
|
|
5731
5731
|
parseInt(u.getAttribute("font-size") ?? "72")
|
|
5732
5732
|
);
|
|
5733
|
-
|
|
5734
|
-
const R =
|
|
5735
|
-
h.appendChild(
|
|
5733
|
+
T.fill = f, T.stroke = y, T.strokeWidth = parseFloat(w ?? "0");
|
|
5734
|
+
const R = T.toSVG(2), F = t.parseFromString(R, "image/svg+xml").firstElementChild;
|
|
5735
|
+
h.appendChild(F);
|
|
5736
5736
|
}
|
|
5737
5737
|
return e.querySelectorAll("text").forEach((d) => d.remove()), It().serializeToString(a);
|
|
5738
5738
|
}, Pe = (n, t, e, a) => Math.max(Io(n.join(`
|
|
@@ -6033,7 +6033,7 @@ const xo = (n) => {
|
|
|
6033
6033
|
};
|
|
6034
6034
|
class Mo {
|
|
6035
6035
|
constructor() {
|
|
6036
|
-
this.id =
|
|
6036
|
+
this.id = N(), this.stateCallbacks = [], this.prevCommands = [], this.nextCommands = [];
|
|
6037
6037
|
}
|
|
6038
6038
|
registerStateCallback(t) {
|
|
6039
6039
|
this.stateCallbacks.push(t);
|
|
@@ -6350,7 +6350,7 @@ class Bd {
|
|
|
6350
6350
|
static async getFrame(t, e) {
|
|
6351
6351
|
const a = await Zn(e.region, e.src), r = await Le(a), i = e.region || await Ut(t, D.Frame);
|
|
6352
6352
|
return {
|
|
6353
|
-
id:
|
|
6353
|
+
id: N(),
|
|
6354
6354
|
x: i.left,
|
|
6355
6355
|
y: i.top,
|
|
6356
6356
|
width: i.width,
|
|
@@ -6376,7 +6376,7 @@ class Bd {
|
|
|
6376
6376
|
static async getImage(t, e) {
|
|
6377
6377
|
const a = e.region || await Ut(t, D.Image, e.src);
|
|
6378
6378
|
return {
|
|
6379
|
-
id:
|
|
6379
|
+
id: N(),
|
|
6380
6380
|
src: e.src,
|
|
6381
6381
|
type: D.Image,
|
|
6382
6382
|
y: a.top,
|
|
@@ -6402,7 +6402,7 @@ class Bd {
|
|
|
6402
6402
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
|
6403
6403
|
}), u = ne(
|
|
6404
6404
|
{
|
|
6405
|
-
id:
|
|
6405
|
+
id: N(),
|
|
6406
6406
|
type: D.Textbox,
|
|
6407
6407
|
x: A.left,
|
|
6408
6408
|
y: A.top,
|
|
@@ -6463,7 +6463,7 @@ class Bd {
|
|
|
6463
6463
|
</svg>
|
|
6464
6464
|
`, r = {};
|
|
6465
6465
|
r["spiff-fill-shape"] = { browserValue: e.color };
|
|
6466
|
-
const i = e.region?.item || await Ut(t, D.Illustration), o =
|
|
6466
|
+
const i = e.region?.item || await Ut(t, D.Illustration), o = N();
|
|
6467
6467
|
return {
|
|
6468
6468
|
stepRegion: e.region?.item,
|
|
6469
6469
|
stepRegionIndex: e.region?.index,
|
|
@@ -6482,7 +6482,7 @@ class Bd {
|
|
|
6482
6482
|
};
|
|
6483
6483
|
}
|
|
6484
6484
|
static async getIllustration(t, e) {
|
|
6485
|
-
const a = e.region?.item || await Ut(t, D.Illustration, e.src), r = await st(await er(e.src)), i = await _t(r.svg), o =
|
|
6485
|
+
const a = e.region?.item || await Ut(t, D.Illustration, e.src), r = await st(await er(e.src)), i = await _t(r.svg), o = N();
|
|
6486
6486
|
return {
|
|
6487
6487
|
cachedObjectURL: i,
|
|
6488
6488
|
stepRegion: e.region?.item,
|
|
@@ -6518,7 +6518,7 @@ const V = (n, t) => X(n, t).elements.find((r) => r.id === n), X = (n, t) => {
|
|
|
6518
6518
|
return {
|
|
6519
6519
|
layout: t.layout,
|
|
6520
6520
|
elements: a,
|
|
6521
|
-
modificationID:
|
|
6521
|
+
modificationID: N()
|
|
6522
6522
|
};
|
|
6523
6523
|
}, Xa = async (n) => {
|
|
6524
6524
|
const t = [...Object.keys(n.layouts)], e = [...new Set(t)];
|
|
@@ -6687,7 +6687,7 @@ class ar extends $ {
|
|
|
6687
6687
|
[this.layout.id]: {
|
|
6688
6688
|
elements: [],
|
|
6689
6689
|
layout: { ...this.layout },
|
|
6690
|
-
modificationID:
|
|
6690
|
+
modificationID: N()
|
|
6691
6691
|
}
|
|
6692
6692
|
}
|
|
6693
6693
|
};
|
|
@@ -6718,7 +6718,7 @@ class W extends $ {
|
|
|
6718
6718
|
[this.layout.id]: {
|
|
6719
6719
|
...t.layouts[this.layout.id],
|
|
6720
6720
|
elements: s,
|
|
6721
|
-
modificationID:
|
|
6721
|
+
modificationID: N()
|
|
6722
6722
|
}
|
|
6723
6723
|
}
|
|
6724
6724
|
};
|
|
@@ -6739,7 +6739,7 @@ class W extends $ {
|
|
|
6739
6739
|
[this.layout.id]: {
|
|
6740
6740
|
...t.layouts[this.layout.id],
|
|
6741
6741
|
elements: o,
|
|
6742
|
-
modificationID:
|
|
6742
|
+
modificationID: N()
|
|
6743
6743
|
}
|
|
6744
6744
|
}
|
|
6745
6745
|
};
|
|
@@ -6762,7 +6762,7 @@ class Nt extends $ {
|
|
|
6762
6762
|
const a = Object.values(t.layouts).map((i) => (i.elements.filter((s) => s.id !== this.id).length !== i.elements.length && (e = !0), {
|
|
6763
6763
|
...i,
|
|
6764
6764
|
elements: i.elements.filter((s) => s.id !== this.id),
|
|
6765
|
-
modificationID:
|
|
6765
|
+
modificationID: N()
|
|
6766
6766
|
}));
|
|
6767
6767
|
e || console.log(`Failed to delete element ${this.id}`);
|
|
6768
6768
|
const r = {};
|
|
@@ -6911,7 +6911,7 @@ class Oo extends $ {
|
|
|
6911
6911
|
const o = {
|
|
6912
6912
|
...e,
|
|
6913
6913
|
elements: i,
|
|
6914
|
-
modificationID:
|
|
6914
|
+
modificationID: N()
|
|
6915
6915
|
};
|
|
6916
6916
|
return {
|
|
6917
6917
|
...t,
|
|
@@ -7089,7 +7089,7 @@ class kd extends $ {
|
|
|
7089
7089
|
[a.layout.id]: {
|
|
7090
7090
|
...t.layouts[a.layout.id],
|
|
7091
7091
|
elements: i,
|
|
7092
|
-
modificationID:
|
|
7092
|
+
modificationID: N()
|
|
7093
7093
|
}
|
|
7094
7094
|
}
|
|
7095
7095
|
};
|
|
@@ -7120,7 +7120,7 @@ class Md extends $ {
|
|
|
7120
7120
|
[a.layout.id]: {
|
|
7121
7121
|
...t.layouts[a.layout.id],
|
|
7122
7122
|
elements: i,
|
|
7123
|
-
modificationID:
|
|
7123
|
+
modificationID: N()
|
|
7124
7124
|
}
|
|
7125
7125
|
}
|
|
7126
7126
|
};
|
|
@@ -7147,7 +7147,7 @@ class Td extends $ {
|
|
|
7147
7147
|
[a.layout.id]: {
|
|
7148
7148
|
...t.layouts[a.layout.id],
|
|
7149
7149
|
elements: o,
|
|
7150
|
-
modificationID:
|
|
7150
|
+
modificationID: N()
|
|
7151
7151
|
}
|
|
7152
7152
|
}
|
|
7153
7153
|
};
|
|
@@ -7174,7 +7174,7 @@ class Nd extends $ {
|
|
|
7174
7174
|
[a.layout.id]: {
|
|
7175
7175
|
...t.layouts[a.layout.id],
|
|
7176
7176
|
elements: o,
|
|
7177
|
-
modificationID:
|
|
7177
|
+
modificationID: N()
|
|
7178
7178
|
}
|
|
7179
7179
|
}
|
|
7180
7180
|
};
|
|
@@ -7199,7 +7199,7 @@ class en {
|
|
|
7199
7199
|
throw new Error("Undefined raster silent step source");
|
|
7200
7200
|
const c = {
|
|
7201
7201
|
stepName: this.configuration.stepName,
|
|
7202
|
-
id:
|
|
7202
|
+
id: N(),
|
|
7203
7203
|
src: l,
|
|
7204
7204
|
type: s,
|
|
7205
7205
|
y: r.top,
|
|
@@ -7232,7 +7232,7 @@ class en {
|
|
|
7232
7232
|
}).catch((g) => console.error(g));
|
|
7233
7233
|
}))()), A = {
|
|
7234
7234
|
stepName: this.configuration.stepName,
|
|
7235
|
-
id:
|
|
7235
|
+
id: N(),
|
|
7236
7236
|
cachedObjectURL: await _t(d.svg),
|
|
7237
7237
|
src: l,
|
|
7238
7238
|
svg: d.svg,
|
|
@@ -7377,7 +7377,7 @@ class zo {
|
|
|
7377
7377
|
}), d;
|
|
7378
7378
|
}
|
|
7379
7379
|
async regionElements(t) {
|
|
7380
|
-
const e = (a, r) => ({ id:
|
|
7380
|
+
const e = (a, r) => ({ id: N(), region: a, regionIndex: r });
|
|
7381
7381
|
return t.data.regions.map(e);
|
|
7382
7382
|
}
|
|
7383
7383
|
async command(t, e, a, r) {
|
|
@@ -7690,22 +7690,22 @@ class De {
|
|
|
7690
7690
|
i && i(!0);
|
|
7691
7691
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
|
7692
7692
|
t.data.regions.map(async (h, g) => {
|
|
7693
|
-
const m = await Le(l[g]), p = s.getImageData(), f = a.map((I) => new Nt(I.id)),
|
|
7693
|
+
const m = await Le(l[g]), p = s.getImageData(), f = a.map((I) => new Nt(I.id)), y = p ? Ta(
|
|
7694
7694
|
p,
|
|
7695
7695
|
m,
|
|
7696
7696
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
|
7697
7697
|
t.data.forceImageCover
|
|
7698
7698
|
) : void 0, w = p ? {
|
|
7699
|
-
id:
|
|
7699
|
+
id: N(),
|
|
7700
7700
|
src: p.src,
|
|
7701
|
-
x:
|
|
7702
|
-
y:
|
|
7701
|
+
x: y?.x || 0,
|
|
7702
|
+
y: y?.y || 0,
|
|
7703
7703
|
width: p.width,
|
|
7704
7704
|
height: p.height,
|
|
7705
|
-
scaleX:
|
|
7706
|
-
scaleY:
|
|
7705
|
+
scaleX: y?.zoom || 1,
|
|
7706
|
+
scaleY: y?.zoom || 1,
|
|
7707
7707
|
rotation: 0
|
|
7708
|
-
} : void 0, x =
|
|
7708
|
+
} : void 0, x = N(), E = r.getLayouts().find((I) => I.panelId === h.panelId);
|
|
7709
7709
|
if (!E)
|
|
7710
7710
|
throw new Y(h);
|
|
7711
7711
|
return {
|
|
@@ -7954,14 +7954,14 @@ class Go {
|
|
|
7954
7954
|
const l = s.fileLink;
|
|
7955
7955
|
if (!l)
|
|
7956
7956
|
throw new Jt(s);
|
|
7957
|
-
const c = await st(await this.getIllustrationBody(l)), d = await _t(c.svg), A = (f,
|
|
7957
|
+
const c = await st(await this.getIllustrationBody(l)), d = await _t(c.svg), A = (f, y) => {
|
|
7958
7958
|
const w = i.getLayouts().find((v) => v.panelId === f.panelId);
|
|
7959
7959
|
if (!w)
|
|
7960
7960
|
throw new Y(f);
|
|
7961
|
-
const x =
|
|
7961
|
+
const x = N();
|
|
7962
7962
|
return {
|
|
7963
|
-
regionElement: { id: x, region: f, regionIndex:
|
|
7964
|
-
command: this.getCreateElementCommand(x, f,
|
|
7963
|
+
regionElement: { id: x, region: f, regionIndex: y },
|
|
7964
|
+
command: this.getCreateElementCommand(x, f, y, w, {
|
|
7965
7965
|
stepName: t.stepName,
|
|
7966
7966
|
src: l,
|
|
7967
7967
|
objectURL: d,
|
|
@@ -7972,36 +7972,36 @@ class Go {
|
|
|
7972
7972
|
let m = Array.from(Object.values(c.colors)).map((f) => f.browserValue);
|
|
7973
7973
|
const p = t.data.colorOption;
|
|
7974
7974
|
return p && p.variants?.forEach((f) => {
|
|
7975
|
-
m = m.map((
|
|
7975
|
+
m = m.map((y) => y.toLowerCase() === f.color?.toLowerCase() ? f.name : y);
|
|
7976
7976
|
}), i.updateMetadata(t.stepName, { colors: m }), {
|
|
7977
7977
|
command: new U(g),
|
|
7978
7978
|
followup: async () => {
|
|
7979
7979
|
await i.setSelectionsAndElements(
|
|
7980
7980
|
t.stepName,
|
|
7981
7981
|
[e],
|
|
7982
|
-
u.map((
|
|
7982
|
+
u.map((y) => y.regionElement),
|
|
7983
7983
|
async () => {
|
|
7984
7984
|
r(!1);
|
|
7985
7985
|
}
|
|
7986
7986
|
);
|
|
7987
7987
|
const f = s.assetConfiguration?.defaultColorVariants || [];
|
|
7988
7988
|
if (f.length !== 0) {
|
|
7989
|
-
const
|
|
7989
|
+
const y = {};
|
|
7990
7990
|
(s.assetConfiguration?.channelNumbers || []).forEach((x) => {
|
|
7991
7991
|
const v = f.find((E) => E.channelNumber === x.number);
|
|
7992
|
-
v && (
|
|
7992
|
+
v && (y[`${x.id.replace(/\W/g, "")}`] = { browserValue: v?.variant?.color || "" });
|
|
7993
7993
|
}), await this.changeColors(
|
|
7994
7994
|
t,
|
|
7995
7995
|
u.map((x) => x.regionElement),
|
|
7996
7996
|
i,
|
|
7997
7997
|
() => i.getCommandContext().getAllLayouts(),
|
|
7998
|
-
new Map(Object.entries(
|
|
7998
|
+
new Map(Object.entries(y))
|
|
7999
7999
|
);
|
|
8000
8000
|
}
|
|
8001
8001
|
if (t.data.colorPickerEnabled) {
|
|
8002
|
-
const
|
|
8002
|
+
const y = await this.availableColors(t, i) || [], w = Object.keys(c.colors), x = y.length === 1 && w.length === 1;
|
|
8003
8003
|
if (x) {
|
|
8004
|
-
const v =
|
|
8004
|
+
const v = y[0], E = w[0];
|
|
8005
8005
|
await this.changeColors(
|
|
8006
8006
|
t,
|
|
8007
8007
|
u.map((I) => I.regionElement),
|
|
@@ -8223,7 +8223,7 @@ class Ho {
|
|
|
8223
8223
|
return console.error("Missing configuration."), null;
|
|
8224
8224
|
a.updateStorage(t.stepName, { text: e }), a.updateMetadata(t.stepName, { text: e });
|
|
8225
8225
|
const c = (d, A, u, h) => {
|
|
8226
|
-
const g = h ||
|
|
8226
|
+
const g = h || N(), p = a.getLayouts().find((y) => y.panelId === A.panelId);
|
|
8227
8227
|
if (!p)
|
|
8228
8228
|
return console.error(`Can not find layout for region: ${A.panelId}`), null;
|
|
8229
8229
|
const f = [];
|
|
@@ -8358,7 +8358,7 @@ class jo {
|
|
|
8358
8358
|
const g = a.getLayouts().find((p) => p.panelId === A.panelId);
|
|
8359
8359
|
if (!g)
|
|
8360
8360
|
throw new Y(A);
|
|
8361
|
-
const m =
|
|
8361
|
+
const m = N();
|
|
8362
8362
|
return {
|
|
8363
8363
|
regionElement: { id: m, region: A, regionIndex: u },
|
|
8364
8364
|
command: new W(
|
|
@@ -8578,9 +8578,9 @@ class Jo {
|
|
|
8578
8578
|
</svg>
|
|
8579
8579
|
`, f = {};
|
|
8580
8580
|
f[this.shapeFillId] = { browserValue: m };
|
|
8581
|
-
const
|
|
8581
|
+
const y = N();
|
|
8582
8582
|
return {
|
|
8583
|
-
id:
|
|
8583
|
+
id: y,
|
|
8584
8584
|
region: u,
|
|
8585
8585
|
command: new W(
|
|
8586
8586
|
{
|
|
@@ -8588,7 +8588,7 @@ class Jo {
|
|
|
8588
8588
|
stepRegionIndex: h,
|
|
8589
8589
|
stepName: t.stepName,
|
|
8590
8590
|
colors: f,
|
|
8591
|
-
id:
|
|
8591
|
+
id: y,
|
|
8592
8592
|
svg: p,
|
|
8593
8593
|
type: D.Illustration,
|
|
8594
8594
|
y: u.top,
|
|
@@ -8660,7 +8660,7 @@ const _o = new Ko(), ea = (n, t, e, a, r) => {
|
|
|
8660
8660
|
const A = Math.max(...s);
|
|
8661
8661
|
if (A <= n.width)
|
|
8662
8662
|
return [i, A];
|
|
8663
|
-
const u = s.reduce((p, f,
|
|
8663
|
+
const u = s.reduce((p, f, y, w) => f > w[p] ? y : p, 0), h = i[u];
|
|
8664
8664
|
let g = !1, m = h.length;
|
|
8665
8665
|
for (; !g && m > -1; ) {
|
|
8666
8666
|
m = h.lastIndexOf(" ", m - 1);
|
|
@@ -8988,7 +8988,7 @@ class Zo {
|
|
|
8988
8988
|
const m = e.getWorkflowExperience().getBundle();
|
|
8989
8989
|
if (m && t.globalPropertyAspectConfigurations) {
|
|
8990
8990
|
const f = m.getGlobalPropertyConfiguration()?.aspects?.find(
|
|
8991
|
-
(
|
|
8991
|
+
(y) => y.type === z.Text && t.globalPropertyAspectConfigurations?.map((w) => w.aspectName).includes(y.name)
|
|
8992
8992
|
);
|
|
8993
8993
|
if (f) {
|
|
8994
8994
|
const w = m.getGlobalPropertyStateManager().getAspect(f.name);
|
|
@@ -9001,7 +9001,7 @@ class Zo {
|
|
|
9001
9001
|
u,
|
|
9002
9002
|
async () => {
|
|
9003
9003
|
e.updateMetadata(t.stepName, { color: h, text: g }), e.updateStorage(t.stepName, { text: g, inputText: g });
|
|
9004
|
-
const p = s.map((
|
|
9004
|
+
const p = s.map((y) => new tn(y.id, A)), f = new U(p);
|
|
9005
9005
|
e.getCommandDispatcher()(f);
|
|
9006
9006
|
}
|
|
9007
9007
|
), s.length === 0 && l) {
|
|
@@ -9109,17 +9109,21 @@ class Zo {
|
|
|
9109
9109
|
}
|
|
9110
9110
|
async selectVariantCommand(t, e, a, r, i, o, s, l, c) {
|
|
9111
9111
|
const d = i.markUpdatePending(), A = await this.fontDataFromVariant(e);
|
|
9112
|
+
let u = !0;
|
|
9113
|
+
const h = (g) => {
|
|
9114
|
+
o(g), g && (u = !1);
|
|
9115
|
+
};
|
|
9112
9116
|
if (r.length > 0) {
|
|
9113
|
-
const
|
|
9117
|
+
const g = r.map((f) => new tn(f.id, A));
|
|
9114
9118
|
if (l) {
|
|
9115
|
-
const
|
|
9116
|
-
|
|
9119
|
+
const f = r.map((y) => new Ze(y.id, l));
|
|
9120
|
+
g.push(...f);
|
|
9117
9121
|
}
|
|
9118
9122
|
if (c) {
|
|
9119
|
-
const
|
|
9120
|
-
|
|
9123
|
+
const f = r.map((y) => new ta(y.id, c, t.data.strokeThickness));
|
|
9124
|
+
g.push(...f);
|
|
9121
9125
|
}
|
|
9122
|
-
const
|
|
9126
|
+
const m = await this.changeInputTextWithRegion(
|
|
9123
9127
|
t,
|
|
9124
9128
|
t.data.size || aa,
|
|
9125
9129
|
A,
|
|
@@ -9127,52 +9131,56 @@ class Zo {
|
|
|
9127
9131
|
a,
|
|
9128
9132
|
i,
|
|
9129
9133
|
a?.customiseAllText ?? !1,
|
|
9130
|
-
|
|
9134
|
+
h,
|
|
9131
9135
|
s
|
|
9132
9136
|
);
|
|
9133
|
-
|
|
9134
|
-
|
|
9137
|
+
m && g.push(m);
|
|
9138
|
+
const p = new U(g);
|
|
9139
|
+
return u ? {
|
|
9140
|
+
command: p,
|
|
9135
9141
|
followup: async () => {
|
|
9136
9142
|
i.markUpdateCompleted(d), await i.setSelectionsAndElements(t.stepName, [e], r);
|
|
9137
9143
|
}
|
|
9138
|
-
};
|
|
9144
|
+
} : null;
|
|
9139
9145
|
} else {
|
|
9140
|
-
const
|
|
9146
|
+
const g = await this.createTextboxRegions(
|
|
9141
9147
|
t.stepName,
|
|
9142
9148
|
e,
|
|
9143
9149
|
t.data,
|
|
9144
9150
|
A,
|
|
9145
9151
|
a,
|
|
9146
9152
|
i
|
|
9147
|
-
),
|
|
9153
|
+
), m = await this.changeInputTextWithRegion(
|
|
9148
9154
|
t,
|
|
9149
9155
|
t.data.size || aa,
|
|
9150
9156
|
A,
|
|
9151
|
-
|
|
9157
|
+
g[0]?.newElement.input || a.text || t.data.defaultText || "",
|
|
9152
9158
|
a,
|
|
9153
9159
|
i,
|
|
9154
9160
|
a?.customiseAllText ?? !1,
|
|
9155
|
-
|
|
9161
|
+
h,
|
|
9156
9162
|
s
|
|
9157
|
-
),
|
|
9163
|
+
), p = g.flatMap((y) => y.commands);
|
|
9158
9164
|
if (l) {
|
|
9159
|
-
const
|
|
9160
|
-
(
|
|
9165
|
+
const y = g.map(
|
|
9166
|
+
(w) => new Ze(w.regionElement.id, l)
|
|
9161
9167
|
);
|
|
9162
|
-
|
|
9168
|
+
p.push(...y);
|
|
9163
9169
|
}
|
|
9164
9170
|
if (c) {
|
|
9165
|
-
const
|
|
9166
|
-
(
|
|
9171
|
+
const y = g.map(
|
|
9172
|
+
(w) => new ta(w.newElement.id, c, t.data.strokeThickness)
|
|
9167
9173
|
);
|
|
9168
|
-
|
|
9174
|
+
p.push(...y);
|
|
9169
9175
|
}
|
|
9170
|
-
|
|
9171
|
-
|
|
9176
|
+
m && p.push(m);
|
|
9177
|
+
const f = new U(p);
|
|
9178
|
+
return u ? {
|
|
9179
|
+
command: f,
|
|
9172
9180
|
followup: async () => {
|
|
9173
9181
|
i.markUpdateCompleted(d);
|
|
9174
9182
|
}
|
|
9175
|
-
};
|
|
9183
|
+
} : null;
|
|
9176
9184
|
}
|
|
9177
9185
|
}
|
|
9178
9186
|
/**
|
|
@@ -9187,15 +9195,15 @@ class Zo {
|
|
|
9187
9195
|
if (!a || !a.regions)
|
|
9188
9196
|
throw new Error("Step data not supplied");
|
|
9189
9197
|
const s = i.text || a.defaultText || "", l = xt(s, o), c = this.getProcessedInput(l, a, !1), d = async (u, h) => {
|
|
9190
|
-
const m = o.getLayouts().find((f) => f.panelId === u.panelId), p =
|
|
9198
|
+
const m = o.getLayouts().find((f) => f.panelId === u.panelId), p = N();
|
|
9191
9199
|
try {
|
|
9192
9200
|
if (!m)
|
|
9193
9201
|
throw new ke("Failed to find layout for region: " + u.panelId);
|
|
9194
9202
|
const f = a.colorOption;
|
|
9195
|
-
let
|
|
9203
|
+
let y;
|
|
9196
9204
|
if (f && f.variants) {
|
|
9197
|
-
const
|
|
9198
|
-
|
|
9205
|
+
const k = O.getDefaultVariant(f);
|
|
9206
|
+
k && (y = this.createTextFillSpotColor(f, k), o.updateStorage(t, {
|
|
9199
9207
|
colorProfileAssetKey: f.colorProfile?.key
|
|
9200
9208
|
}));
|
|
9201
9209
|
}
|
|
@@ -9223,8 +9231,8 @@ class Zo {
|
|
|
9223
9231
|
verticalAlign: a.verticalAlign || "middle",
|
|
9224
9232
|
curved: a.curved,
|
|
9225
9233
|
paths: a.paths,
|
|
9226
|
-
fillSpotColorDefinition:
|
|
9227
|
-
}, E = [], I = /* @__PURE__ */ new Map(),
|
|
9234
|
+
fillSpotColorDefinition: y
|
|
9235
|
+
}, E = [], I = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map();
|
|
9228
9236
|
if (!v.fontData) throw new Q("Failed to resolve font data for text.");
|
|
9229
9237
|
const [R, B] = Ce(
|
|
9230
9238
|
v.fontSize,
|
|
@@ -9240,11 +9248,11 @@ class Zo {
|
|
|
9240
9248
|
[c],
|
|
9241
9249
|
{ size: a.size, minSize: a.minSize, maxSize: a.maxSize }
|
|
9242
9250
|
);
|
|
9243
|
-
I.set(v.id, R),
|
|
9244
|
-
const
|
|
9251
|
+
I.set(v.id, R), T.set(v.id, B);
|
|
9252
|
+
const F = a.curved || a.vertical ? c : (B || []).join(`
|
|
9245
9253
|
`);
|
|
9246
9254
|
E.push(
|
|
9247
|
-
this.generateTextChangeCommandsForRegion(R, a, v.id,
|
|
9255
|
+
this.generateTextChangeCommandsForRegion(R, a, v.id, F)
|
|
9248
9256
|
);
|
|
9249
9257
|
const L = new W(v, m);
|
|
9250
9258
|
return {
|
|
@@ -9296,24 +9304,34 @@ class Zo {
|
|
|
9296
9304
|
);
|
|
9297
9305
|
m.set(v.id, E), p.set(v.id, I);
|
|
9298
9306
|
}
|
|
9299
|
-
const
|
|
9307
|
+
const y = (() => {
|
|
9300
9308
|
if (t.data && t.data.maxLength && h.length > t.data.maxLength)
|
|
9301
9309
|
return d && d(!0), { info: "0" };
|
|
9302
9310
|
const v = o.getWorkflowExperience().getProfanityList(), E = la(h.toLowerCase());
|
|
9303
9311
|
for (const I of E)
|
|
9304
|
-
for (const
|
|
9305
|
-
const R = v[
|
|
9306
|
-
if (I === R)
|
|
9307
|
-
|
|
9312
|
+
for (const T in v) {
|
|
9313
|
+
const R = v[T].toLowerCase().replace(/\s/g, "");
|
|
9314
|
+
if (I === R) {
|
|
9315
|
+
const F = "Blocked profanity.";
|
|
9316
|
+
return l(F), { error: F };
|
|
9317
|
+
}
|
|
9308
9318
|
}
|
|
9309
|
-
|
|
9310
|
-
`) || h.includes("\r"))
|
|
9319
|
+
if (!t.data.vertical && !t.data.allowNewlines && (h.includes(`
|
|
9320
|
+
`) || h.includes("\r"))) {
|
|
9321
|
+
const I = "Text may not span multiple lines.";
|
|
9322
|
+
return l(I), { error: I };
|
|
9323
|
+
}
|
|
9324
|
+
if (!t.data.curved && !Array.from(p.values()).every((T) => T)) {
|
|
9325
|
+
const T = "Text does not fit.";
|
|
9326
|
+
return l(T), { error: T };
|
|
9327
|
+
}
|
|
9328
|
+
return l(void 0), { info: (t.data.maxLength - h.length).toString() };
|
|
9311
9329
|
})();
|
|
9312
|
-
if (
|
|
9313
|
-
c(
|
|
9330
|
+
if (y.error) {
|
|
9331
|
+
c(y.error);
|
|
9314
9332
|
return;
|
|
9315
9333
|
}
|
|
9316
|
-
if (c(`${
|
|
9334
|
+
if (c(`${y.info} characters remaining` || ""), d)
|
|
9317
9335
|
return;
|
|
9318
9336
|
o.updateStorage(t.stepName, { text: A }), o.updateMetadata(t.stepName, {
|
|
9319
9337
|
text: this.injectReplaceableText(A, t.data)
|
|
@@ -9501,10 +9519,10 @@ class ls extends ts {
|
|
|
9501
9519
|
E.classList.add("module-layer0"), w.appendChild(E), E.setAttribute("filter", "url(#shadow)"), E.innerHTML = v.outerHTML;
|
|
9502
9520
|
const I = et("g");
|
|
9503
9521
|
I.classList.add("module-layer1"), w.appendChild(I), I.setAttribute("stroke-width", "3"), I.setAttribute("stroke", "rgb(45,41,38)"), I.setAttribute("fill", "rgb(45,41,38)"), I.setAttribute("transform", "translate(0.5,0)"), I.innerHTML = s;
|
|
9504
|
-
const
|
|
9505
|
-
|
|
9522
|
+
const T = et("g");
|
|
9523
|
+
T.classList.add("module-layer2"), w.appendChild(T), T.setAttribute("fill", "rgb(255,209,0)"), T.setAttribute("transform", "translate(1,-0.1)"), T.innerHTML = s;
|
|
9506
9524
|
const R = et("g");
|
|
9507
|
-
return R.classList.add("module-layer3"), w.appendChild(R), R.setAttribute("fill", "white"), R.innerHTML = s, new ss(w).transform(([
|
|
9525
|
+
return R.classList.add("module-layer3"), w.appendChild(R), R.setAttribute("fill", "white"), R.innerHTML = s, new ss(w).transform(([F, L]) => [F, L + (c / 2 - F) ** 2 / (c * 6)]), w;
|
|
9508
9526
|
}, u = et("g");
|
|
9509
9527
|
u.classList.add("module-root");
|
|
9510
9528
|
const h = et("defs");
|
|
@@ -9517,8 +9535,8 @@ class ls extends ts {
|
|
|
9517
9535
|
p.classList.add("module-text-enclosure"), u.appendChild(p);
|
|
9518
9536
|
const f = A();
|
|
9519
9537
|
p.appendChild(f);
|
|
9520
|
-
const
|
|
9521
|
-
return is(p,
|
|
9538
|
+
const y = Rr(d);
|
|
9539
|
+
return is(p, y, e.height, e.width, 0.35, 0.65), rs(u.outerHTML);
|
|
9522
9540
|
}
|
|
9523
9541
|
}
|
|
9524
9542
|
async function dr(n) {
|
|
@@ -9545,7 +9563,7 @@ const cs = [
|
|
|
9545
9563
|
const g = n.find((p) => p.panelId === h.panelId);
|
|
9546
9564
|
if (!g)
|
|
9547
9565
|
throw new Y(h);
|
|
9548
|
-
const m =
|
|
9566
|
+
const m = N();
|
|
9549
9567
|
return new W(
|
|
9550
9568
|
{
|
|
9551
9569
|
id: m,
|
|
@@ -9571,7 +9589,7 @@ const cs = [
|
|
|
9571
9589
|
const s = To(r, a.option);
|
|
9572
9590
|
s && (t[a.stepName] = { selectedVariants: [s] });
|
|
9573
9591
|
const l = async (c) => {
|
|
9574
|
-
const d = await Zn(c, s?.asset?.fileLink), A = await Le(d), u =
|
|
9592
|
+
const d = await Zn(c, s?.asset?.fileLink), A = await Le(d), u = N(), h = n.find((m) => m.panelId === c.panelId);
|
|
9575
9593
|
if (!h)
|
|
9576
9594
|
throw new Y(c);
|
|
9577
9595
|
const g = Ta(
|
|
@@ -9644,29 +9662,29 @@ const cs = [
|
|
|
9644
9662
|
cs.includes(v.tagName) && !v.attributes.getNamedItem("fill") && v.setAttribute("fill", "#000000");
|
|
9645
9663
|
const E = v.attributes.getNamedItem("fill");
|
|
9646
9664
|
if (E && E.value !== "none") {
|
|
9647
|
-
const
|
|
9648
|
-
v.classList.add(B), m[B] = { browserValue:
|
|
9665
|
+
const T = E.value, B = `spiff-fill-${T.replace(/\W/g, "")}`;
|
|
9666
|
+
v.classList.add(B), m[B] = { browserValue: T };
|
|
9649
9667
|
}
|
|
9650
9668
|
const I = v.attributes.getNamedItem("stroke");
|
|
9651
9669
|
if (I && I.value !== "none") {
|
|
9652
|
-
const
|
|
9653
|
-
v.classList.add(B), m[B] = { browserValue:
|
|
9670
|
+
const T = I.value, B = `spiff-stroke-${T.replace(/\W/g, "")}`;
|
|
9671
|
+
v.classList.add(B), m[B] = { browserValue: T };
|
|
9654
9672
|
}
|
|
9655
9673
|
});
|
|
9656
|
-
const f = It().serializeToString(g),
|
|
9657
|
-
if (
|
|
9674
|
+
const f = It().serializeToString(g), y = r.colors;
|
|
9675
|
+
if (y) {
|
|
9658
9676
|
for (const [v, E] of Object.entries(m))
|
|
9659
|
-
for (const I of Object.keys(
|
|
9677
|
+
for (const I of Object.keys(y))
|
|
9660
9678
|
if (E.browserValue === I) {
|
|
9661
|
-
m[v] = { browserValue:
|
|
9679
|
+
m[v] = { browserValue: y[I] };
|
|
9662
9680
|
break;
|
|
9663
9681
|
}
|
|
9664
9682
|
}
|
|
9665
9683
|
const w = (v) => {
|
|
9666
|
-
const E = n.find((
|
|
9684
|
+
const E = n.find((T) => T.panelId === v.panelId);
|
|
9667
9685
|
if (!E)
|
|
9668
9686
|
throw new Y(v);
|
|
9669
|
-
const I =
|
|
9687
|
+
const I = N();
|
|
9670
9688
|
return new W(
|
|
9671
9689
|
{
|
|
9672
9690
|
colors: m,
|
|
@@ -9695,7 +9713,7 @@ const cs = [
|
|
|
9695
9713
|
const c = n.find((A) => A.panelId === l.panelId);
|
|
9696
9714
|
if (!c)
|
|
9697
9715
|
throw new Y(l);
|
|
9698
|
-
const d =
|
|
9716
|
+
const d = N();
|
|
9699
9717
|
return new W(
|
|
9700
9718
|
{
|
|
9701
9719
|
colors: {},
|
|
@@ -9737,7 +9755,7 @@ const cs = [
|
|
|
9737
9755
|
const A = n.find((h) => h.panelId === d.panelId);
|
|
9738
9756
|
if (!A)
|
|
9739
9757
|
throw new Y(d);
|
|
9740
|
-
const u =
|
|
9758
|
+
const u = N();
|
|
9741
9759
|
return new W(
|
|
9742
9760
|
{
|
|
9743
9761
|
id: u,
|
|
@@ -9793,7 +9811,7 @@ const cs = [
|
|
|
9793
9811
|
fill="${o?.color}"
|
|
9794
9812
|
/>
|
|
9795
9813
|
</svg>
|
|
9796
|
-
`, h = { "spiff-fill-shape": { browserValue: o.color || "#000000" } }, g =
|
|
9814
|
+
`, h = { "spiff-fill-shape": { browserValue: o.color || "#000000" } }, g = N();
|
|
9797
9815
|
return new W(
|
|
9798
9816
|
{
|
|
9799
9817
|
colors: h,
|
|
@@ -9826,7 +9844,7 @@ const cs = [
|
|
|
9826
9844
|
if (!d)
|
|
9827
9845
|
throw new Y(c);
|
|
9828
9846
|
const A = {
|
|
9829
|
-
id:
|
|
9847
|
+
id: N(),
|
|
9830
9848
|
src: i,
|
|
9831
9849
|
type: s,
|
|
9832
9850
|
y: c.top,
|
|
@@ -9859,7 +9877,7 @@ const cs = [
|
|
|
9859
9877
|
if (!u)
|
|
9860
9878
|
throw new Y(A);
|
|
9861
9879
|
const h = {
|
|
9862
|
-
id:
|
|
9880
|
+
id: N(),
|
|
9863
9881
|
src: i,
|
|
9864
9882
|
asset_key: i,
|
|
9865
9883
|
svg: d(c),
|
|
@@ -9890,9 +9908,9 @@ const cs = [
|
|
|
9890
9908
|
if (!f || !f.asset)
|
|
9891
9909
|
return;
|
|
9892
9910
|
t[a.stepName] = { selectedVariants: [f] };
|
|
9893
|
-
const
|
|
9894
|
-
if (
|
|
9895
|
-
return
|
|
9911
|
+
const y = f.asset.fileLink;
|
|
9912
|
+
if (y)
|
|
9913
|
+
return y;
|
|
9896
9914
|
}, d = await (async () => {
|
|
9897
9915
|
const p = l();
|
|
9898
9916
|
if (!p)
|
|
@@ -9913,9 +9931,9 @@ const cs = [
|
|
|
9913
9931
|
const f = n.find((w) => w.panelId === p.panelId);
|
|
9914
9932
|
if (!f)
|
|
9915
9933
|
continue;
|
|
9916
|
-
const
|
|
9934
|
+
const y = {
|
|
9917
9935
|
stepName: e.name,
|
|
9918
|
-
id:
|
|
9936
|
+
id: N(),
|
|
9919
9937
|
align: s(a.data),
|
|
9920
9938
|
curved: a.data.curved,
|
|
9921
9939
|
fill: i.color || g || "#000000",
|
|
@@ -9954,16 +9972,16 @@ const cs = [
|
|
|
9954
9972
|
r.push(
|
|
9955
9973
|
new W(
|
|
9956
9974
|
{
|
|
9957
|
-
...
|
|
9975
|
+
...y,
|
|
9958
9976
|
fontSize: w,
|
|
9959
|
-
text:
|
|
9977
|
+
text: y.curved ? y.text : (x || []).join(`
|
|
9960
9978
|
`)
|
|
9961
9979
|
},
|
|
9962
9980
|
f
|
|
9963
9981
|
)
|
|
9964
9982
|
);
|
|
9965
9983
|
} else
|
|
9966
|
-
r.push(new W(
|
|
9984
|
+
r.push(new W(y, f));
|
|
9967
9985
|
}
|
|
9968
9986
|
return r;
|
|
9969
9987
|
}, Cs = (n, t) => n.conditions ? n.conditions.every((e) => {
|
|
@@ -10279,7 +10297,7 @@ const Qd = (n, t) => {
|
|
|
10279
10297
|
}
|
|
10280
10298
|
}
|
|
10281
10299
|
}
|
|
10282
|
-
`, Od = async (n) => (await
|
|
10300
|
+
`, Od = async (n) => (await S.getShadowGraphqlClient().query({
|
|
10283
10301
|
query: Ps,
|
|
10284
10302
|
fetchPolicy: "cache-first",
|
|
10285
10303
|
errorPolicy: "all",
|
|
@@ -10957,7 +10975,7 @@ class rn extends Gn {
|
|
|
10957
10975
|
}
|
|
10958
10976
|
}
|
|
10959
10977
|
const rl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
10960
|
-
id:
|
|
10978
|
+
id: N(),
|
|
10961
10979
|
panelId: t.name,
|
|
10962
10980
|
name: t.name,
|
|
10963
10981
|
title: t.title,
|
|
@@ -11006,7 +11024,7 @@ const rl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11006
11024
|
a.type === we.FirstName ? e[r] = t?.firstName : a.type === we.LastName ? e[r] = t?.lastName : a.type === we.Custom && (a.customFieldIndex === 1 ? e[r] = t?.customField1 : a.customFieldIndex === 2 ? e[r] = t?.customField2 : a.customFieldIndex === 3 ? e[r] = t?.customField3 : a.customFieldIndex === 4 ? e[r] = t?.customField4 : a.customFieldIndex === 5 && (e[r] = t?.customField5), a.option && (e[r] = a.option.variants?.find((i) => i.id === e[r])?.name));
|
|
11007
11025
|
}), e;
|
|
11008
11026
|
}
|
|
11009
|
-
async updateRecipient(t, e, a, r, i, o, s, l, c, d, A, u, h, g, m, p, f,
|
|
11027
|
+
async updateRecipient(t, e, a, r, i, o, s, l, c, d, A, u, h, g, m, p, f, y) {
|
|
11010
11028
|
const w = this.experience.getTransaction();
|
|
11011
11029
|
if (w.recipient?.id)
|
|
11012
11030
|
this.experience.getTransaction().recipient = {
|
|
@@ -11051,7 +11069,7 @@ const rl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11051
11069
|
customField4: m || w.recipient.customField4,
|
|
11052
11070
|
customField5: p || w.recipient.customField5,
|
|
11053
11071
|
conversionConfigurationId: f || w.recipient.conversionConfigurationId,
|
|
11054
|
-
prevalidated:
|
|
11072
|
+
prevalidated: y
|
|
11055
11073
|
}
|
|
11056
11074
|
});
|
|
11057
11075
|
else {
|
|
@@ -11281,7 +11299,7 @@ const rl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11281
11299
|
this.pendingUpdates = this.pendingUpdates.filter((e) => e !== t);
|
|
11282
11300
|
}
|
|
11283
11301
|
markUpdatePending() {
|
|
11284
|
-
const t =
|
|
11302
|
+
const t = N();
|
|
11285
11303
|
return this.pendingUpdates = [...this.pendingUpdates, t], t;
|
|
11286
11304
|
}
|
|
11287
11305
|
setEditedStatus(t, e) {
|
|
@@ -11549,7 +11567,7 @@ const rl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11549
11567
|
this.experience.getTransaction().transactionShareActions = t;
|
|
11550
11568
|
}
|
|
11551
11569
|
async updateTransactionStakeholders() {
|
|
11552
|
-
const t = await
|
|
11570
|
+
const t = await S.getShadowGraphqlClient().query({
|
|
11553
11571
|
query: _i,
|
|
11554
11572
|
errorPolicy: "all",
|
|
11555
11573
|
fetchPolicy: "no-cache",
|
|
@@ -11560,7 +11578,7 @@ const rl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11560
11578
|
!t?.data?.transactions || t.data.transactions.length !== 1 ? (this.experience.getTransaction().currentStakeholder = void 0, this.experience.getTransaction().stakeholders = void 0) : (this.experience.getTransaction().stakeholders = t.data.transactions[0].stakeholders, this.experience.getTransaction().currentStakeholder = t.data.transactions[0].currentStakeholder);
|
|
11561
11579
|
}
|
|
11562
11580
|
async approveTransaction(t) {
|
|
11563
|
-
await
|
|
11581
|
+
await S.getShadowGraphqlClient().mutate({
|
|
11564
11582
|
mutation: Ks,
|
|
11565
11583
|
errorPolicy: "all",
|
|
11566
11584
|
fetchPolicy: "no-cache",
|
|
@@ -11571,7 +11589,7 @@ const rl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11571
11589
|
});
|
|
11572
11590
|
}
|
|
11573
11591
|
async rejectTransaction(t) {
|
|
11574
|
-
await
|
|
11592
|
+
await S.getShadowGraphqlClient().mutate({
|
|
11575
11593
|
mutation: _s,
|
|
11576
11594
|
errorPolicy: "all",
|
|
11577
11595
|
fetchPolicy: "no-cache",
|
|
@@ -11591,7 +11609,7 @@ const rl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11591
11609
|
this.stepSelections = {
|
|
11592
11610
|
...this.stepSelections,
|
|
11593
11611
|
[t]: { selectedVariants: e }
|
|
11594
|
-
}, this.selectionCost = Object.values(this.stepSelections).reduce((E, I) => E + I.selectedVariants.map((
|
|
11612
|
+
}, this.selectionCost = Object.values(this.stepSelections).reduce((E, I) => E + I.selectedVariants.map((T) => T.priceModifier || 0).reduce((T, R) => T + R, 0), 0), i.steps.forEach((E) => {
|
|
11595
11613
|
vt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1, delete this.stepMetadata[E.stepName], delete this.stepSelections[E.stepName], delete this.storage[E.stepName]);
|
|
11596
11614
|
});
|
|
11597
11615
|
const s = this.allScenes, l = yt(s, o), c = yt(s, this.stepSelections), d = l.map((E) => E.silentSteps).flat(), u = c.map((E) => E.silentSteps).flat().filter(
|
|
@@ -11608,7 +11626,7 @@ const rl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11608
11626
|
}, this.removeElements(h);
|
|
11609
11627
|
const p = i.steps.find((E) => E.stepName === t);
|
|
11610
11628
|
p?.type === b.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((I) => I.id));
|
|
11611
|
-
const f = h.map((E) => new Nt(E.id)),
|
|
11629
|
+
const f = h.map((E) => new Nt(E.id)), y = new Za(this.constructSerializableWorkflow()), w = [...m, ...f, y];
|
|
11612
11630
|
w.length > 0 && this.commandContext.apply(new U(w), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
11613
11631
|
const x = this.getInvalidModelVariants(), v = this.modelContainer;
|
|
11614
11632
|
if (v) {
|
|
@@ -12177,7 +12195,7 @@ class ul extends tt {
|
|
|
12177
12195
|
this.manager.setInformationResults([
|
|
12178
12196
|
...this.manager.getInformationResults(),
|
|
12179
12197
|
{
|
|
12180
|
-
message:
|
|
12198
|
+
message: e,
|
|
12181
12199
|
messageType: Ge.Error,
|
|
12182
12200
|
stepID: this.step.stepName
|
|
12183
12201
|
}
|
|
@@ -12524,7 +12542,7 @@ const Cl = async (n, t) => {
|
|
|
12524
12542
|
const s = Object.entries(localStorage).find(([c, d]) => c.startsWith("CognitoIdentityServiceProvider") && c.endsWith("idToken"))?.[0] || "", l = localStorage.getItem(s);
|
|
12525
12543
|
l && !Me(l) && (e.Authorization = `Bearer ${l}`);
|
|
12526
12544
|
}
|
|
12527
|
-
return (await t.getIntegration()).partner.beta && (e["X-Spiff-Beta"] = "true"), (await
|
|
12545
|
+
return (await t.getIntegration()).partner.beta && (e["X-Spiff-Beta"] = "true"), (await S.getShadowGraphqlClient().mutate({
|
|
12528
12546
|
mutation: fl,
|
|
12529
12547
|
errorPolicy: "all",
|
|
12530
12548
|
fetchPolicy: "no-cache",
|
|
@@ -12601,7 +12619,7 @@ const Cl = async (n, t) => {
|
|
|
12601
12619
|
}
|
|
12602
12620
|
return r;
|
|
12603
12621
|
}, yl = (n, t, e, a, r, i, o, s) => {
|
|
12604
|
-
const l = t.basePrice || 0, c = n.priceModifierTotal || 0, d = wl(a, e, void 0, i), u = (
|
|
12622
|
+
const l = t.basePrice || 0, c = n.priceModifierTotal || 0, d = wl(a, e, void 0, i), u = (M.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), h = {
|
|
12605
12623
|
additionalExternalProductId: n.integrationProduct?.additionalExternalProductId,
|
|
12606
12624
|
additionalExternalVariantId: n.integrationProduct?.additionalExternalVariantId,
|
|
12607
12625
|
baseCost: l,
|
|
@@ -12627,36 +12645,36 @@ const Cl = async (n, t) => {
|
|
|
12627
12645
|
c && (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await n.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
|
|
12628
12646
|
const d = n.getPreviewService(), A = t?.finalizeStepConfig?.lookAtAnimation, u = d && t.showModelOnFinishStep && !!A, h = l && on(l, t, !0), g = l && on(l, t, !1), m = async (E) => {
|
|
12629
12647
|
const I = {};
|
|
12630
|
-
let
|
|
12648
|
+
let T = 0;
|
|
12631
12649
|
if (Object.keys(i).length > 0)
|
|
12632
12650
|
for (const R of Object.keys(i)) {
|
|
12633
|
-
const B = i[R],
|
|
12651
|
+
const B = i[R], F = t.steps.find((L) => L.stepName === R);
|
|
12634
12652
|
for (let L = 0; L < B.selections.length; ++L) {
|
|
12635
|
-
const
|
|
12636
|
-
if (
|
|
12637
|
-
const J =
|
|
12653
|
+
const k = B.selections[L];
|
|
12654
|
+
if (F && (!E || F.option && (F.option.variants || []).length > 1 && !F.data.hideSelectionInCart && !F.data.hideSelectionsInCart)) {
|
|
12655
|
+
const J = F.stepTitle;
|
|
12638
12656
|
I[J] ? I[J].push({
|
|
12639
|
-
id:
|
|
12640
|
-
name:
|
|
12641
|
-
priceModifier:
|
|
12657
|
+
id: k.id || "",
|
|
12658
|
+
name: k.name,
|
|
12659
|
+
priceModifier: k.priceModifier
|
|
12642
12660
|
}) : I[J] = [
|
|
12643
12661
|
{
|
|
12644
|
-
id:
|
|
12645
|
-
name:
|
|
12646
|
-
priceModifier:
|
|
12662
|
+
id: k.id || "",
|
|
12663
|
+
name: k.name,
|
|
12664
|
+
priceModifier: k.priceModifier
|
|
12647
12665
|
}
|
|
12648
12666
|
];
|
|
12649
12667
|
}
|
|
12650
|
-
|
|
12668
|
+
T += k.priceModifier;
|
|
12651
12669
|
}
|
|
12652
12670
|
}
|
|
12653
|
-
return [I,
|
|
12671
|
+
return [I, T];
|
|
12654
12672
|
}, [p] = await m(!0), f = Object.fromEntries(
|
|
12655
12673
|
Object.keys(p).map((E) => [E, p[E].map((I) => I.id)])
|
|
12656
|
-
), [
|
|
12657
|
-
Object.keys(
|
|
12674
|
+
), [y] = await m(!1), w = Object.fromEntries(
|
|
12675
|
+
Object.keys(y).map((E) => [
|
|
12658
12676
|
E,
|
|
12659
|
-
|
|
12677
|
+
y[E].map((I) => I.id)
|
|
12660
12678
|
])
|
|
12661
12679
|
);
|
|
12662
12680
|
let x = await s(u, r.id);
|
|
@@ -12684,14 +12702,14 @@ const Cl = async (n, t) => {
|
|
|
12684
12702
|
};
|
|
12685
12703
|
if (g) {
|
|
12686
12704
|
const I = [];
|
|
12687
|
-
for (const [
|
|
12688
|
-
I.push({ key:
|
|
12705
|
+
for (const [T, R] of Object.entries(g))
|
|
12706
|
+
I.push({ key: T, value: R });
|
|
12689
12707
|
E.metadata = I;
|
|
12690
12708
|
}
|
|
12691
12709
|
if (f) {
|
|
12692
12710
|
const I = [];
|
|
12693
|
-
for (const [
|
|
12694
|
-
I.push({ key:
|
|
12711
|
+
for (const [T, R] of Object.entries(w))
|
|
12712
|
+
I.push({ key: T, ids: R });
|
|
12695
12713
|
E.selectedVariants = I;
|
|
12696
12714
|
}
|
|
12697
12715
|
return E;
|
|
@@ -12706,7 +12724,7 @@ const Cl = async (n, t) => {
|
|
|
12706
12724
|
})
|
|
12707
12725
|
);
|
|
12708
12726
|
const a = await (async () => {
|
|
12709
|
-
const s =
|
|
12727
|
+
const s = S.getShadowGraphqlClient(), l = await Promise.all(
|
|
12710
12728
|
n.map(async (u) => ({
|
|
12711
12729
|
id: u.transaction.id,
|
|
12712
12730
|
hash: await u.workflowManager.getStateHash()
|
|
@@ -12780,7 +12798,7 @@ class vl {
|
|
|
12780
12798
|
*/
|
|
12781
12799
|
async getSavedDesigns() {
|
|
12782
12800
|
if (this.storageMethod === "Local") {
|
|
12783
|
-
const t =
|
|
12801
|
+
const t = M.get(this.localPersistenceKey);
|
|
12784
12802
|
return t ? JSON.parse(t) : [];
|
|
12785
12803
|
}
|
|
12786
12804
|
throw new Q("Unexpected storage method requested");
|
|
@@ -12820,7 +12838,7 @@ class vl {
|
|
|
12820
12838
|
}
|
|
12821
12839
|
async setDesigns(t) {
|
|
12822
12840
|
if (this.storageMethod === "Local") {
|
|
12823
|
-
|
|
12841
|
+
M.set(this.localPersistenceKey, JSON.stringify(t));
|
|
12824
12842
|
return;
|
|
12825
12843
|
}
|
|
12826
12844
|
throw new Q("Unexpected storage method requested");
|
|
@@ -13157,8 +13175,8 @@ class Bl {
|
|
|
13157
13175
|
DOMParser: Ba(),
|
|
13158
13176
|
fetch
|
|
13159
13177
|
})).render();
|
|
13160
|
-
const
|
|
13161
|
-
return o.toDataURL(
|
|
13178
|
+
const y = await this.getCanvasObjectURLAsync(o);
|
|
13179
|
+
return o.toDataURL(y);
|
|
13162
13180
|
}
|
|
13163
13181
|
getStepById(t) {
|
|
13164
13182
|
const e = this.getWorkflow()?.steps.find((i) => i.stepName === t);
|
|
@@ -13291,8 +13309,8 @@ class Bl {
|
|
|
13291
13309
|
);
|
|
13292
13310
|
if (a?.customer) {
|
|
13293
13311
|
this.getWorkflowManager().setTransactionCustomer(a.customer);
|
|
13294
|
-
const r =
|
|
13295
|
-
r.set(this.getTransaction().id, a.customer.id),
|
|
13312
|
+
const r = M.getMap("transactionCustomerIds") || /* @__PURE__ */ new Map();
|
|
13313
|
+
r.set(this.getTransaction().id, a.customer.id), M.setMap("transactionCustomerIds", r);
|
|
13296
13314
|
}
|
|
13297
13315
|
}
|
|
13298
13316
|
attachRenderableSceneListener(t) {
|
|
@@ -14174,7 +14192,7 @@ class Rl {
|
|
|
14174
14192
|
async updateGlobalPropertyState() {
|
|
14175
14193
|
if (!this.globalPropertyState)
|
|
14176
14194
|
throw new Error("Global property state not initialized");
|
|
14177
|
-
const t = await
|
|
14195
|
+
const t = await S.getShadowGraphqlClient().mutate({
|
|
14178
14196
|
mutation: Bs,
|
|
14179
14197
|
variables: {
|
|
14180
14198
|
id: this.globalPropertyState.id,
|
|
@@ -14217,7 +14235,7 @@ class Rl {
|
|
|
14217
14235
|
throw new Error("Unable to update global property state");
|
|
14218
14236
|
}
|
|
14219
14237
|
async createGlobalPropertyState() {
|
|
14220
|
-
const t = await
|
|
14238
|
+
const t = await S.getShadowGraphqlClient().mutate({
|
|
14221
14239
|
mutation: Is,
|
|
14222
14240
|
variables: {
|
|
14223
14241
|
bundleId: this.bundleId
|
|
@@ -14355,7 +14373,7 @@ class Ul {
|
|
|
14355
14373
|
}
|
|
14356
14374
|
async ensureIdsArePresent(t) {
|
|
14357
14375
|
if (t.every((a) => this.internalMap.has(a))) return;
|
|
14358
|
-
const e = await
|
|
14376
|
+
const e = await S.getShadowGraphqlClient().query({
|
|
14359
14377
|
query: $l,
|
|
14360
14378
|
errorPolicy: "all",
|
|
14361
14379
|
variables: {
|
|
@@ -14459,7 +14477,7 @@ class mr {
|
|
|
14459
14477
|
async fetchProducts(t) {
|
|
14460
14478
|
if (this.fullFetched)
|
|
14461
14479
|
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new ue(a));
|
|
14462
|
-
const e = await
|
|
14480
|
+
const e = await S.getShadowGraphqlClient().query({
|
|
14463
14481
|
query: ks,
|
|
14464
14482
|
variables: {
|
|
14465
14483
|
id: this.getId(),
|
|
@@ -14475,7 +14493,7 @@ class mr {
|
|
|
14475
14493
|
* @param tags An object of tag filters to apply.
|
|
14476
14494
|
*/
|
|
14477
14495
|
async filterProducts(t, e, a, r) {
|
|
14478
|
-
const i = await
|
|
14496
|
+
const i = await S.getShadowGraphqlClient().query({
|
|
14479
14497
|
query: Ms,
|
|
14480
14498
|
errorPolicy: "all",
|
|
14481
14499
|
variables: {
|
|
@@ -14519,7 +14537,7 @@ class mr {
|
|
|
14519
14537
|
items: u.slice(t, t + e)
|
|
14520
14538
|
};
|
|
14521
14539
|
}
|
|
14522
|
-
const c = new AbortController(), { signal: d } = c, A =
|
|
14540
|
+
const c = new AbortController(), { signal: d } = c, A = S.getShadowGraphqlClient().watchQuery({
|
|
14523
14541
|
query: Ts,
|
|
14524
14542
|
variables: {
|
|
14525
14543
|
id: this.getId(),
|
|
@@ -14780,7 +14798,7 @@ const Wl = C`
|
|
|
14780
14798
|
...ProductCollectionFields
|
|
14781
14799
|
}
|
|
14782
14800
|
}
|
|
14783
|
-
`, $d = async (n) => (await
|
|
14801
|
+
`, $d = async (n) => (await S.getShadowGraphqlClient().query({
|
|
14784
14802
|
query: Wl,
|
|
14785
14803
|
errorPolicy: "all",
|
|
14786
14804
|
variables: {
|
|
@@ -14872,7 +14890,7 @@ class cn {
|
|
|
14872
14890
|
const g = h.map((m) => {
|
|
14873
14891
|
if (m.getType() === z.ColorOption || m.getType() === z.Option) {
|
|
14874
14892
|
const p = m;
|
|
14875
|
-
if (!u.aspects.find((
|
|
14893
|
+
if (!u.aspects.find((y) => y.name === p.getName()))
|
|
14876
14894
|
return p.initDefaultVariant();
|
|
14877
14895
|
}
|
|
14878
14896
|
});
|
|
@@ -14913,7 +14931,7 @@ class cn {
|
|
|
14913
14931
|
const a = JSON.stringify(e);
|
|
14914
14932
|
this.bundleStateManager.setState(a), this.fireEvent("bundle-integration-products-added", {
|
|
14915
14933
|
integrationProductIds: e.integrationProductIds
|
|
14916
|
-
}), await
|
|
14934
|
+
}), await S.getShadowGraphqlClient().mutate({
|
|
14917
14935
|
mutation: na,
|
|
14918
14936
|
variables: {
|
|
14919
14937
|
id: this.id,
|
|
@@ -14935,7 +14953,7 @@ class cn {
|
|
|
14935
14953
|
const r = JSON.stringify(e);
|
|
14936
14954
|
this.bundleStateManager.setState(r), this.fireEvent("bundle-integration-products-removed", {
|
|
14937
14955
|
integrationProductIds: a
|
|
14938
|
-
}), await
|
|
14956
|
+
}), await S.getShadowGraphqlClient().mutate({
|
|
14939
14957
|
mutation: na,
|
|
14940
14958
|
variables: {
|
|
14941
14959
|
id: this.id,
|
|
@@ -14951,7 +14969,7 @@ class cn {
|
|
|
14951
14969
|
return this.template;
|
|
14952
14970
|
}
|
|
14953
14971
|
async generateQuoteId() {
|
|
14954
|
-
const e = (await
|
|
14972
|
+
const e = (await S.getShadowGraphqlClient().mutate({
|
|
14955
14973
|
mutation: Yl,
|
|
14956
14974
|
variables: {
|
|
14957
14975
|
id: this.id
|
|
@@ -14963,7 +14981,7 @@ class cn {
|
|
|
14963
14981
|
return this.quoteId = e, e || "";
|
|
14964
14982
|
}
|
|
14965
14983
|
async attachAddress(t, e, a, r, i, o) {
|
|
14966
|
-
await
|
|
14984
|
+
await S.getShadowGraphqlClient().mutate({
|
|
14967
14985
|
mutation: Hl,
|
|
14968
14986
|
variables: {
|
|
14969
14987
|
bundleId: this.id,
|
|
@@ -14980,7 +14998,7 @@ class cn {
|
|
|
14980
14998
|
});
|
|
14981
14999
|
}
|
|
14982
15000
|
async attachOrganization(t) {
|
|
14983
|
-
await
|
|
15001
|
+
await S.getShadowGraphqlClient().mutate({
|
|
14984
15002
|
mutation: jl,
|
|
14985
15003
|
variables: {
|
|
14986
15004
|
bundleId: this.id,
|
|
@@ -15151,8 +15169,8 @@ class cn {
|
|
|
15151
15169
|
throw new Error(
|
|
15152
15170
|
"Unable to add transaction to bundle - Already Exists: " + a.filter((s) => !!s).map((s) => s?.getTransaction().id).join(", ")
|
|
15153
15171
|
);
|
|
15154
|
-
const r =
|
|
15155
|
-
await
|
|
15172
|
+
const r = M.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), i = e.map((s) => r.get(s));
|
|
15173
|
+
await S.getShadowGraphqlClient().mutate({
|
|
15156
15174
|
mutation: Os,
|
|
15157
15175
|
variables: {
|
|
15158
15176
|
id: this.id,
|
|
@@ -15180,8 +15198,8 @@ class cn {
|
|
|
15180
15198
|
async appendWorkflowExperience(t, e = !0) {
|
|
15181
15199
|
const a = t.getTransaction().id;
|
|
15182
15200
|
if (this.workflowExperiences.find((s) => s.getTransaction().id === a)) throw new Error("Unable to add transaction to bundle - Already Exists!");
|
|
15183
|
-
const o = (
|
|
15184
|
-
await
|
|
15201
|
+
const o = (M.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(a);
|
|
15202
|
+
await S.getShadowGraphqlClient().mutate({
|
|
15185
15203
|
mutation: Rs,
|
|
15186
15204
|
variables: {
|
|
15187
15205
|
id: this.id,
|
|
@@ -15212,7 +15230,7 @@ class cn {
|
|
|
15212
15230
|
async removeTransaction(t, e, a = !0) {
|
|
15213
15231
|
if (t > -1) {
|
|
15214
15232
|
const r = this.workflowExperiences.find((i) => i.getTransaction().id === e.id);
|
|
15215
|
-
if (r.setBundle(void 0), this.previewService && r.getWorkflowManager().ejectFromPreviewService(), this.bundleStateManager.removeStateForTransaction(e.id), await
|
|
15233
|
+
if (r.setBundle(void 0), this.previewService && r.getWorkflowManager().ejectFromPreviewService(), this.bundleStateManager.removeStateForTransaction(e.id), await S.getShadowGraphqlClient().mutate({
|
|
15216
15234
|
mutation: $s,
|
|
15217
15235
|
variables: {
|
|
15218
15236
|
id: this.id,
|
|
@@ -15249,7 +15267,7 @@ class cn {
|
|
|
15249
15267
|
);
|
|
15250
15268
|
a.forEach((r) => r.setBundle(void 0)), [...this.workflowExperiences, ...a].forEach(
|
|
15251
15269
|
(r) => r.checkForPriceBreakChanges()
|
|
15252
|
-
), this.previewService && a.forEach((r) => r.getWorkflowManager().ejectFromPreviewService()), t.forEach((r) => this.bundleStateManager.removeStateForTransaction(r.id)), await
|
|
15270
|
+
), this.previewService && a.forEach((r) => r.getWorkflowManager().ejectFromPreviewService()), t.forEach((r) => this.bundleStateManager.removeStateForTransaction(r.id)), await S.getShadowGraphqlClient().mutate({
|
|
15253
15271
|
mutation: Us,
|
|
15254
15272
|
variables: {
|
|
15255
15273
|
id: this.id,
|
|
@@ -15310,7 +15328,7 @@ class cn {
|
|
|
15310
15328
|
return this.workflowExperiences.length;
|
|
15311
15329
|
}
|
|
15312
15330
|
async addStakeholder(t, e) {
|
|
15313
|
-
const a = await
|
|
15331
|
+
const a = await S.getShadowGraphqlClient().mutate({
|
|
15314
15332
|
mutation: Ls,
|
|
15315
15333
|
variables: {
|
|
15316
15334
|
id: this.id,
|
|
@@ -15326,7 +15344,7 @@ class cn {
|
|
|
15326
15344
|
this.storeStakeholderCustomers(r);
|
|
15327
15345
|
}
|
|
15328
15346
|
async removeStakeholder(t) {
|
|
15329
|
-
if (!(await
|
|
15347
|
+
if (!(await S.getShadowGraphqlClient().mutate({
|
|
15330
15348
|
mutation: Vs,
|
|
15331
15349
|
variables: {
|
|
15332
15350
|
id: this.id,
|
|
@@ -15338,7 +15356,7 @@ class cn {
|
|
|
15338
15356
|
})).data?.bundleRemoveStakeholder) throw new Error("Bundle not found!");
|
|
15339
15357
|
}
|
|
15340
15358
|
async updateStakeholders(t) {
|
|
15341
|
-
const e = await
|
|
15359
|
+
const e = await S.getShadowGraphqlClient().mutate({
|
|
15342
15360
|
mutation: zs,
|
|
15343
15361
|
variables: {
|
|
15344
15362
|
id: this.id,
|
|
@@ -15353,7 +15371,7 @@ class cn {
|
|
|
15353
15371
|
this.storeStakeholderCustomers(a);
|
|
15354
15372
|
}
|
|
15355
15373
|
async getAllStakeholders() {
|
|
15356
|
-
const t = await
|
|
15374
|
+
const t = await S.getShadowGraphqlClient().query({
|
|
15357
15375
|
query: nn,
|
|
15358
15376
|
errorPolicy: "all",
|
|
15359
15377
|
fetchPolicy: "no-cache",
|
|
@@ -15369,7 +15387,7 @@ class cn {
|
|
|
15369
15387
|
return this.storeStakeholderCustomers(e), e;
|
|
15370
15388
|
}
|
|
15371
15389
|
async getCurrentStakeholder() {
|
|
15372
|
-
const t = await
|
|
15390
|
+
const t = await S.getShadowGraphqlClient().query({
|
|
15373
15391
|
query: nn,
|
|
15374
15392
|
errorPolicy: "all",
|
|
15375
15393
|
fetchPolicy: "no-cache",
|
|
@@ -15389,7 +15407,7 @@ class cn {
|
|
|
15389
15407
|
});
|
|
15390
15408
|
}
|
|
15391
15409
|
async finish(t, e) {
|
|
15392
|
-
this.completed && await
|
|
15410
|
+
this.completed && await S.getShadowGraphqlClient().mutate({
|
|
15393
15411
|
mutation: js,
|
|
15394
15412
|
variables: {
|
|
15395
15413
|
bundleId: this.id
|
|
@@ -15456,7 +15474,7 @@ class cn {
|
|
|
15456
15474
|
return this.bundleStateManager.activateWorkflowExperienceTransform(t, e), this.updateBundle();
|
|
15457
15475
|
}
|
|
15458
15476
|
async assignGlobalPropertyConfiguration(t) {
|
|
15459
|
-
await
|
|
15477
|
+
await S.getShadowGraphqlClient().mutate({
|
|
15460
15478
|
mutation: qs,
|
|
15461
15479
|
variables: {
|
|
15462
15480
|
bundleId: this.id,
|
|
@@ -15468,7 +15486,7 @@ class cn {
|
|
|
15468
15486
|
}), this.globalConfigurationPropertyId = t;
|
|
15469
15487
|
}
|
|
15470
15488
|
async assignProductCollection(t) {
|
|
15471
|
-
const e = await
|
|
15489
|
+
const e = await S.getShadowGraphqlClient().mutate({
|
|
15472
15490
|
mutation: Ws(
|
|
15473
15491
|
this.globalPropertyStateManager.getBundleOptions()?.eagerFetchProducts ?? !1
|
|
15474
15492
|
),
|
|
@@ -15535,7 +15553,7 @@ class cn {
|
|
|
15535
15553
|
}
|
|
15536
15554
|
}
|
|
15537
15555
|
async updateBundle() {
|
|
15538
|
-
if (!(await
|
|
15556
|
+
if (!(await S.getShadowGraphqlClient().mutate({
|
|
15539
15557
|
mutation: na,
|
|
15540
15558
|
variables: {
|
|
15541
15559
|
id: this.id,
|
|
@@ -15551,7 +15569,7 @@ class cn {
|
|
|
15551
15569
|
})).data?.bundleUpdate) throw new Error("Bundle not found!");
|
|
15552
15570
|
}
|
|
15553
15571
|
async updateTransactionOrder() {
|
|
15554
|
-
await
|
|
15572
|
+
await S.getShadowGraphqlClient().mutate({
|
|
15555
15573
|
mutation: Gs,
|
|
15556
15574
|
variables: {
|
|
15557
15575
|
id: this.id,
|
|
@@ -15621,7 +15639,7 @@ class cn {
|
|
|
15621
15639
|
return this.workflowViewerAmendLink;
|
|
15622
15640
|
}
|
|
15623
15641
|
async approve(t, e) {
|
|
15624
|
-
await
|
|
15642
|
+
await S.getShadowGraphqlClient().mutate({
|
|
15625
15643
|
mutation: Ys,
|
|
15626
15644
|
errorPolicy: "all",
|
|
15627
15645
|
fetchPolicy: "no-cache",
|
|
@@ -15633,7 +15651,7 @@ class cn {
|
|
|
15633
15651
|
});
|
|
15634
15652
|
}
|
|
15635
15653
|
async reject(t, e) {
|
|
15636
|
-
await
|
|
15654
|
+
await S.getShadowGraphqlClient().mutate({
|
|
15637
15655
|
mutation: Js,
|
|
15638
15656
|
errorPolicy: "all",
|
|
15639
15657
|
fetchPolicy: "no-cache",
|
|
@@ -15668,7 +15686,7 @@ class Kl {
|
|
|
15668
15686
|
* @returns
|
|
15669
15687
|
*/
|
|
15670
15688
|
async execute(t, e, a) {
|
|
15671
|
-
const i = (await
|
|
15689
|
+
const i = (await S.getShadowGraphqlClient().mutate({
|
|
15672
15690
|
mutation: Jl,
|
|
15673
15691
|
variables: {
|
|
15674
15692
|
processFlowId: t,
|
|
@@ -15683,7 +15701,7 @@ class Kl {
|
|
|
15683
15701
|
}
|
|
15684
15702
|
let s = !1, l = 0, c, d;
|
|
15685
15703
|
for (; !s; ) {
|
|
15686
|
-
c = await
|
|
15704
|
+
c = await S.getShadowGraphqlClient().query({
|
|
15687
15705
|
query: C`
|
|
15688
15706
|
query getProcessFlowExecution($ids: [String]!) {
|
|
15689
15707
|
processExecutions(ids: $ids) {
|
|
@@ -15983,7 +16001,7 @@ const ec = C`
|
|
|
15983
16001
|
}
|
|
15984
16002
|
`;
|
|
15985
16003
|
class ac {
|
|
15986
|
-
constructor(t, e =
|
|
16004
|
+
constructor(t, e = S.getShadowGraphqlClient.bind(S)) {
|
|
15987
16005
|
this.options = t, this.client = e;
|
|
15988
16006
|
}
|
|
15989
16007
|
query(t) {
|
|
@@ -16136,7 +16154,7 @@ class ic {
|
|
|
16136
16154
|
}
|
|
16137
16155
|
}
|
|
16138
16156
|
const oc = async (n, t) => {
|
|
16139
|
-
const e = await
|
|
16157
|
+
const e = await S.getShadowGraphqlClient().query({
|
|
16140
16158
|
query: no(t?.assets?.metadata || !1),
|
|
16141
16159
|
errorPolicy: "all",
|
|
16142
16160
|
variables: {
|
|
@@ -16167,7 +16185,7 @@ const oc = async (n, t) => {
|
|
|
16167
16185
|
), o = e.filter((s) => s !== void 0);
|
|
16168
16186
|
return await Promise.all(o.concat(i));
|
|
16169
16187
|
}, lc = async (n, t) => (await fr([n], t))[0], cc = async (n) => {
|
|
16170
|
-
const t = await
|
|
16188
|
+
const t = await S.getShadowGraphqlClient().query({
|
|
16171
16189
|
query: Li,
|
|
16172
16190
|
variables: {
|
|
16173
16191
|
ids: n
|
|
@@ -16181,14 +16199,14 @@ class Vd {
|
|
|
16181
16199
|
constructor(t) {
|
|
16182
16200
|
this.activeIntegration = void 0, this.updateTransactionState = async (e) => {
|
|
16183
16201
|
try {
|
|
16184
|
-
return
|
|
16202
|
+
return S.getShadowGraphqlClient().mutate({
|
|
16185
16203
|
...e,
|
|
16186
16204
|
mutation: zi
|
|
16187
16205
|
});
|
|
16188
16206
|
} catch (a) {
|
|
16189
16207
|
throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
|
|
16190
16208
|
}
|
|
16191
|
-
}, this.options = t, this.options.applicationKey && ri(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version:
|
|
16209
|
+
}, this.options = t, this.options.applicationKey && ri(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 35.0.1"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16192
16210
|
}
|
|
16193
16211
|
configure(t) {
|
|
16194
16212
|
pt.setHubUrl(t.hubUrl), pt.setServerUrl(t.serverUrl), pt.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 && oi(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16205,7 +16223,7 @@ class Vd {
|
|
|
16205
16223
|
return new Kl();
|
|
16206
16224
|
}
|
|
16207
16225
|
async getCurrencyContext(t) {
|
|
16208
|
-
const a = (await this.getIntegration()).partner.currencyCode, i = await
|
|
16226
|
+
const a = (await this.getIntegration()).partner.currencyCode, i = await S.getShadowGraphqlClient().query({
|
|
16209
16227
|
query: uo,
|
|
16210
16228
|
errorPolicy: "all",
|
|
16211
16229
|
fetchPolicy: "cache-first",
|
|
@@ -16237,12 +16255,12 @@ class Vd {
|
|
|
16237
16255
|
* @returns An object containing the success status of the authentication attempt, and the type of stakeholder when successful.
|
|
16238
16256
|
*/
|
|
16239
16257
|
async authenticateBundleFromLocalStorage(t) {
|
|
16240
|
-
if (
|
|
16258
|
+
if (M.getMap("bundleOwnerIds")?.has(t))
|
|
16241
16259
|
return Promise.resolve({ success: !0, stakeholderType: ve.Owner });
|
|
16242
|
-
const a =
|
|
16260
|
+
const a = M.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16243
16261
|
if (a.has(t)) {
|
|
16244
16262
|
const r = a.get(t);
|
|
16245
|
-
if ((
|
|
16263
|
+
if ((M.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map()).get(r) && await this.reloadLoggedInCustomer()) {
|
|
16246
16264
|
const l = this.customer?.bundleStakeholders?.find(
|
|
16247
16265
|
(c) => c.bundle?.id === t
|
|
16248
16266
|
);
|
|
@@ -16266,7 +16284,7 @@ class Vd {
|
|
|
16266
16284
|
* @throws An error if the transaction is not found.
|
|
16267
16285
|
*/
|
|
16268
16286
|
async authenticateTransactionFromLocalStorage(t) {
|
|
16269
|
-
const e =
|
|
16287
|
+
const e = S.getShadowGraphqlClient(), a = await e.query({
|
|
16270
16288
|
query: ro,
|
|
16271
16289
|
errorPolicy: "all",
|
|
16272
16290
|
fetchPolicy: "no-cache",
|
|
@@ -16281,9 +16299,9 @@ class Vd {
|
|
|
16281
16299
|
throw new Error(`Unable to read transaction: ${t}`);
|
|
16282
16300
|
if (r.isOrdered)
|
|
16283
16301
|
return Promise.resolve({ success: !1, transactionReadOnly: !0 });
|
|
16284
|
-
if (
|
|
16302
|
+
if (M.getMap("transactionOwnerIds")?.has(t))
|
|
16285
16303
|
return Promise.resolve({ success: !0, stakeholderType: ve.Owner });
|
|
16286
|
-
const s =
|
|
16304
|
+
const s = M.getMap("transactionCustomerIds");
|
|
16287
16305
|
if (s?.has(t) && s.get(t) && await this.reloadLoggedInCustomer()) {
|
|
16288
16306
|
const u = this.customer?.bundleStakeholders?.find(
|
|
16289
16307
|
(h) => h.bundle?.transactions?.some((g) => g.id === t)
|
|
@@ -16315,11 +16333,11 @@ class Vd {
|
|
|
16315
16333
|
this.customer = void 0;
|
|
16316
16334
|
}
|
|
16317
16335
|
clearCustomerForTransaction(t) {
|
|
16318
|
-
const e =
|
|
16319
|
-
e?.has(t) && (e.delete(t),
|
|
16336
|
+
const e = M.getMap("transactionCustomerIds");
|
|
16337
|
+
e?.has(t) && (e.delete(t), M.setMap("transactionCustomerIds", e));
|
|
16320
16338
|
}
|
|
16321
16339
|
async customerHasBundleTemplates(t) {
|
|
16322
|
-
const r = (await
|
|
16340
|
+
const r = (await S.getShadowGraphqlClient().query({
|
|
16323
16341
|
query: ge,
|
|
16324
16342
|
errorPolicy: "all",
|
|
16325
16343
|
fetchPolicy: "no-cache",
|
|
@@ -16338,7 +16356,7 @@ class Vd {
|
|
|
16338
16356
|
}
|
|
16339
16357
|
async getOrCreateCustomer(t) {
|
|
16340
16358
|
this.customer = void 0;
|
|
16341
|
-
const e =
|
|
16359
|
+
const e = S.getShadowGraphqlClient(), r = (await e.query({
|
|
16342
16360
|
query: ge,
|
|
16343
16361
|
errorPolicy: "all",
|
|
16344
16362
|
fetchPolicy: "no-cache",
|
|
@@ -16391,7 +16409,7 @@ class Vd {
|
|
|
16391
16409
|
else
|
|
16392
16410
|
return this.logOut(), console.error("Failed to refresh tokens."), !1;
|
|
16393
16411
|
}
|
|
16394
|
-
const s = (await
|
|
16412
|
+
const s = (await S.getShadowGraphqlClient().query({
|
|
16395
16413
|
query: ge,
|
|
16396
16414
|
errorPolicy: "all",
|
|
16397
16415
|
fetchPolicy: "no-cache",
|
|
@@ -16405,7 +16423,7 @@ class Vd {
|
|
|
16405
16423
|
* Generate an email code to allow logging in as a Spiff user.
|
|
16406
16424
|
*/
|
|
16407
16425
|
async generateVerificationCode(t) {
|
|
16408
|
-
await
|
|
16426
|
+
await S.getShadowGraphqlClient().mutate({
|
|
16409
16427
|
mutation: tc,
|
|
16410
16428
|
variables: {
|
|
16411
16429
|
emailAddress: t
|
|
@@ -16420,7 +16438,7 @@ class Vd {
|
|
|
16420
16438
|
const a = (await this.getIntegration()).partner.id || "", r = await Lt.verifyCode(t, e, a);
|
|
16421
16439
|
if (r?.AuthenticationResult) {
|
|
16422
16440
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(r.AuthenticationResult)), localStorage.setItem("cognito-email", t);
|
|
16423
|
-
const o = (await
|
|
16441
|
+
const o = (await S.getShadowGraphqlClient().query({
|
|
16424
16442
|
query: ge,
|
|
16425
16443
|
errorPolicy: "all",
|
|
16426
16444
|
fetchPolicy: "no-cache",
|
|
@@ -16460,7 +16478,7 @@ class Vd {
|
|
|
16460
16478
|
async getCustomerMetafields() {
|
|
16461
16479
|
if (!this.customer?.id)
|
|
16462
16480
|
throw new Error("Customer must be logged in before calling this function.");
|
|
16463
|
-
return (await
|
|
16481
|
+
return (await S.getShadowGraphqlClient().query({
|
|
16464
16482
|
query: ec,
|
|
16465
16483
|
variables: {
|
|
16466
16484
|
id: this.customer.id
|
|
@@ -16472,7 +16490,7 @@ class Vd {
|
|
|
16472
16490
|
* @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
|
|
16473
16491
|
*/
|
|
16474
16492
|
async getNewBundle(t, e, a) {
|
|
16475
|
-
const i = (await
|
|
16493
|
+
const i = (await S.getShadowGraphqlClient().mutate({
|
|
16476
16494
|
mutation: Ns(a?.graphql?.productCollection?.eagerFetchProducts || !1),
|
|
16477
16495
|
variables: {
|
|
16478
16496
|
collectionId: t,
|
|
@@ -16484,10 +16502,10 @@ class Vd {
|
|
|
16484
16502
|
})).data?.bundleCreate;
|
|
16485
16503
|
if (!i?.id)
|
|
16486
16504
|
throw new Error("Unable to create bundle");
|
|
16487
|
-
const o =
|
|
16488
|
-
o.set(i.id, i.partner.id),
|
|
16489
|
-
const s =
|
|
16490
|
-
s.set(i.id, i.bundleOwnerId),
|
|
16505
|
+
const o = M.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16506
|
+
o.set(i.id, i.partner.id), M.setMap("bundlePartnerIds", o);
|
|
16507
|
+
const s = M.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
|
16508
|
+
s.set(i.id, i.bundleOwnerId), M.setMap("bundleOwnerIds", s);
|
|
16491
16509
|
const l = new cn(this, i, void 0, void 0, i.bundleOwnerId, {
|
|
16492
16510
|
eagerFetchProducts: a?.graphql?.productCollection?.eagerFetchProducts
|
|
16493
16511
|
});
|
|
@@ -16502,19 +16520,19 @@ class Vd {
|
|
|
16502
16520
|
* @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
|
|
16503
16521
|
*/
|
|
16504
16522
|
async getExistingBundle(t, e, a, r, i) {
|
|
16505
|
-
const s =
|
|
16523
|
+
const s = M.getMap("bundleOwnerIds")?.get(t), l = {};
|
|
16506
16524
|
try {
|
|
16507
16525
|
const g = await this.loggedInBearerToken();
|
|
16508
16526
|
l.Authorization = `Bearer ${g}`;
|
|
16509
16527
|
} catch {
|
|
16510
|
-
const p = Object.entries(localStorage).find(([
|
|
16528
|
+
const p = Object.entries(localStorage).find(([y, w]) => y.startsWith("CognitoIdentityServiceProvider") && y.endsWith("idToken"))?.[0] || "", f = localStorage.getItem(p);
|
|
16511
16529
|
f && !Me(f) && (l.Authorization = `Bearer ${f}`);
|
|
16512
16530
|
}
|
|
16513
16531
|
const c = {
|
|
16514
16532
|
bundleOwnerId: s,
|
|
16515
16533
|
...l,
|
|
16516
16534
|
...r?.graphql?.additionalHeaders
|
|
16517
|
-
}, d = await
|
|
16535
|
+
}, d = await S.getShadowGraphqlClient().query({
|
|
16518
16536
|
query: Ds(r?.graphql?.productCollection?.eagerFetchProducts || !1),
|
|
16519
16537
|
variables: {
|
|
16520
16538
|
id: t
|
|
@@ -16526,8 +16544,8 @@ class Vd {
|
|
|
16526
16544
|
});
|
|
16527
16545
|
if (!d.data?.bundles || d.data?.bundles.length === 0 || !d.data?.bundles[0])
|
|
16528
16546
|
throw new Error(`Unable to find bundle: ${t}`);
|
|
16529
|
-
const A = d.data?.bundles[0], u =
|
|
16530
|
-
u.set(A.id, A.partner.id),
|
|
16547
|
+
const A = d.data?.bundles[0], u = M.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16548
|
+
u.set(A.id, A.partner.id), M.setMap("bundlePartnerIds", u);
|
|
16531
16549
|
const h = new cn(
|
|
16532
16550
|
this,
|
|
16533
16551
|
A,
|
|
@@ -16554,7 +16572,7 @@ class Vd {
|
|
|
16554
16572
|
const o = {
|
|
16555
16573
|
...await wr(t),
|
|
16556
16574
|
...r?.graphql?.additionalHeaders
|
|
16557
|
-
}, l = (await
|
|
16575
|
+
}, l = (await S.getShadowGraphqlClient().mutate({
|
|
16558
16576
|
mutation: Qs(),
|
|
16559
16577
|
variables: {
|
|
16560
16578
|
id: t,
|
|
@@ -16570,10 +16588,10 @@ class Vd {
|
|
|
16570
16588
|
})).data?.bundleDuplicate;
|
|
16571
16589
|
if (!l?.id)
|
|
16572
16590
|
throw new Error("Unable to duplicate bundle");
|
|
16573
|
-
const c =
|
|
16574
|
-
c.set(l.id, l.partner.id),
|
|
16575
|
-
const d =
|
|
16576
|
-
return d.set(l.id, l.bundleOwnerId),
|
|
16591
|
+
const c = M.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16592
|
+
c.set(l.id, l.partner.id), M.setMap("bundlePartnerIds", c);
|
|
16593
|
+
const d = M.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
|
16594
|
+
return d.set(l.id, l.bundleOwnerId), M.setMap("bundleOwnerIds", d), async () => await this.getExistingBundle(l.id, void 0, void 0, {
|
|
16577
16595
|
graphql: {
|
|
16578
16596
|
productCollection: {
|
|
16579
16597
|
eagerFetchProducts: r?.graphql?.productCollection?.eagerFetchProducts || !1
|
|
@@ -16594,7 +16612,7 @@ class Vd {
|
|
|
16594
16612
|
if (!this.customer?.id)
|
|
16595
16613
|
throw new Error("Customer not authenticated.");
|
|
16596
16614
|
const { includeMetadata: e, ...a } = t;
|
|
16597
|
-
return (await
|
|
16615
|
+
return (await S.getShadowGraphqlClient().query({
|
|
16598
16616
|
query: Hs(e ?? !1),
|
|
16599
16617
|
variables: {
|
|
16600
16618
|
...a,
|
|
@@ -16610,7 +16628,7 @@ class Vd {
|
|
|
16610
16628
|
async getBundleStakeholders() {
|
|
16611
16629
|
if (!this.customer)
|
|
16612
16630
|
throw new Error("Customer not authenticated.");
|
|
16613
|
-
const t = await
|
|
16631
|
+
const t = await S.getShadowGraphqlClient().query({
|
|
16614
16632
|
query: Fs,
|
|
16615
16633
|
variables: {
|
|
16616
16634
|
id: this.customer.id
|
|
@@ -16619,10 +16637,10 @@ class Vd {
|
|
|
16619
16637
|
});
|
|
16620
16638
|
if (!t.data?.customers || t.data.customers.length === 0)
|
|
16621
16639
|
throw new Error("Unable to find customer.");
|
|
16622
|
-
const a = t.data.customers[0].bundleStakeholders || [], r =
|
|
16640
|
+
const a = t.data.customers[0].bundleStakeholders || [], r = M.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16623
16641
|
return a.forEach((i) => {
|
|
16624
16642
|
i.bundle?.id && i.bundle.partner?.id && r.set(i.bundle.id, i.bundle.partner.id);
|
|
16625
|
-
}),
|
|
16643
|
+
}), M.setMap("bundlePartnerIds", r), a;
|
|
16626
16644
|
}
|
|
16627
16645
|
/**
|
|
16628
16646
|
* Creates a new instance of WorkflowExperience. A high level wrapper for workflows.
|
|
@@ -16646,26 +16664,26 @@ class Vd {
|
|
|
16646
16664
|
async getWorkflowExperiences(t, e, a, r) {
|
|
16647
16665
|
if (t.length === 0)
|
|
16648
16666
|
throw new gt("No options provided!");
|
|
16649
|
-
const i = t.map((B,
|
|
16667
|
+
const i = t.map((B, F) => ({ option: B, index: F })), o = i.filter((B) => B.option.type === "transaction"), s = i.filter(
|
|
16650
16668
|
(B) => B.option.type === "integration" || B.option.type === "external" || B.option.type === "blank"
|
|
16651
16669
|
), l = 50, c = ca(o, l), d = ca(s, l);
|
|
16652
16670
|
let A = 0;
|
|
16653
|
-
const u =
|
|
16671
|
+
const u = S.getShadowGraphqlClient(), h = async (B) => {
|
|
16654
16672
|
if (B.length === 0)
|
|
16655
16673
|
return [];
|
|
16656
|
-
const
|
|
16674
|
+
const F = B.map((J) => J.option.transactionId), L = await u.query({
|
|
16657
16675
|
query: Vi,
|
|
16658
16676
|
variables: {
|
|
16659
|
-
ids:
|
|
16677
|
+
ids: F
|
|
16660
16678
|
},
|
|
16661
16679
|
errorPolicy: "all",
|
|
16662
16680
|
fetchPolicy: "no-cache"
|
|
16663
|
-
}),
|
|
16664
|
-
if (A = A +
|
|
16681
|
+
}), k = L.data.transactions;
|
|
16682
|
+
if (A = A + k.length, r && r(A, o.length), k.length !== B.length) {
|
|
16665
16683
|
const J = L.errors?.[0]?.message || "Unknown error";
|
|
16666
16684
|
throw new gt(`Not all transactions were found: ${J}`);
|
|
16667
16685
|
}
|
|
16668
|
-
return !this.activeIntegration &&
|
|
16686
|
+
return !this.activeIntegration && k[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(k[0].integrationProduct.integration)), k.map((J, We) => ({
|
|
16669
16687
|
transaction: J,
|
|
16670
16688
|
workflowId: J.workflowId,
|
|
16671
16689
|
readOnly: B.find((At) => At.option.transactionId === J.id)?.option.readOnly ?? !1,
|
|
@@ -16674,32 +16692,32 @@ class Vd {
|
|
|
16674
16692
|
}, g = async (B) => {
|
|
16675
16693
|
if (B.length === 0)
|
|
16676
16694
|
return [];
|
|
16677
|
-
const
|
|
16695
|
+
const F = await u.mutate({
|
|
16678
16696
|
mutation: Ui,
|
|
16679
16697
|
variables: {
|
|
16680
|
-
inputs: B.map((
|
|
16681
|
-
integrationProductId:
|
|
16682
|
-
externalIntegrationId:
|
|
16683
|
-
externalProductId:
|
|
16684
|
-
workflowId:
|
|
16685
|
-
designName:
|
|
16698
|
+
inputs: B.map((k) => ({
|
|
16699
|
+
integrationProductId: k.option.type === "integration" ? k.option.integrationProductId : void 0,
|
|
16700
|
+
externalIntegrationId: k.option.type === "external" ? k.option.externalIntegrationId : void 0,
|
|
16701
|
+
externalProductId: k.option.type === "external" ? k.option.externalProductId : void 0,
|
|
16702
|
+
workflowId: k.option.workflowId,
|
|
16703
|
+
designName: k.option.designName,
|
|
16686
16704
|
claim: !0,
|
|
16687
|
-
quantity:
|
|
16688
|
-
recipient:
|
|
16705
|
+
quantity: k.option.quantity,
|
|
16706
|
+
recipient: k.option.recipient
|
|
16689
16707
|
})),
|
|
16690
16708
|
marketplaceThemeInstallId: this.marketplaceThemeInstallId,
|
|
16691
16709
|
marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
|
|
16692
16710
|
},
|
|
16693
16711
|
errorPolicy: "all",
|
|
16694
16712
|
fetchPolicy: "no-cache"
|
|
16695
|
-
}), L =
|
|
16713
|
+
}), L = F.data?.transactionCreateMany;
|
|
16696
16714
|
if (!L || L.length === 0) {
|
|
16697
|
-
const
|
|
16698
|
-
throw new gt(`Failed to create transactions: ${
|
|
16715
|
+
const k = F.errors?.[0]?.message || "Unknown error";
|
|
16716
|
+
throw new gt(`Failed to create transactions: ${k}`);
|
|
16699
16717
|
}
|
|
16700
|
-
return A = A + L.length, r && r(A, o.length), L.map((
|
|
16701
|
-
transaction:
|
|
16702
|
-
workflowId:
|
|
16718
|
+
return A = A + L.length, r && r(A, o.length), L.map((k, J) => ({
|
|
16719
|
+
transaction: k,
|
|
16720
|
+
workflowId: k.workflowId,
|
|
16703
16721
|
readOnly: !1,
|
|
16704
16722
|
index: B[J].index
|
|
16705
16723
|
}));
|
|
@@ -16710,56 +16728,56 @@ class Vd {
|
|
|
16710
16728
|
...new Set(m.map((B) => B.transaction.integrationProductId))
|
|
16711
16729
|
].filter((B) => B !== void 0), f = [...new Set(m.map((B) => B.workflowId))].filter(
|
|
16712
16730
|
(B) => B !== void 0
|
|
16713
|
-
), [
|
|
16731
|
+
), [y, w] = await Promise.all([
|
|
16714
16732
|
(async () => p.length > 0 ? await cc(p) : [])(),
|
|
16715
16733
|
(async () => f.length > 0 ? await fr(f, e) : [])()
|
|
16716
|
-
]), x = new Map(
|
|
16717
|
-
const { transaction:
|
|
16718
|
-
if (
|
|
16719
|
-
const rt = x.get(
|
|
16720
|
-
|
|
16734
|
+
]), x = new Map(y.map((B) => [B.id, B])), v = new Map(w.map((B) => [B.id, B])), E = m.map(async (B) => {
|
|
16735
|
+
const { transaction: F, workflowId: L, readOnly: k, index: J } = B, We = L ? v.get(L) : void 0, At = t[J];
|
|
16736
|
+
if (F.integrationProductId) {
|
|
16737
|
+
const rt = x.get(F.integrationProductId);
|
|
16738
|
+
F.integrationProduct = rt, F.product = rt?.product, F.integrationProduct || console.error("failed to find transaction's product");
|
|
16721
16739
|
}
|
|
16722
|
-
const re =
|
|
16723
|
-
!re.get(
|
|
16724
|
-
const qe = re.get(
|
|
16740
|
+
const re = M.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map();
|
|
16741
|
+
!re.get(F.id) && F.transactionOwnerId && (re.set(F.id, F.transactionOwnerId), M.setMap("transactionOwnerIds", re));
|
|
16742
|
+
const qe = re.get(F.id) || void 0, vr = new ac({
|
|
16725
16743
|
onMutate: () => ({ context: { transactionOwnerId: qe, bundleOwnerId: e?.bundleOwnerId } }),
|
|
16726
16744
|
onQuery: () => ({ context: { transactionOwnerId: qe, bundleOwnerId: e?.bundleOwnerId } })
|
|
16727
16745
|
}), ie = {
|
|
16728
16746
|
workflow: We,
|
|
16729
|
-
transaction:
|
|
16747
|
+
transaction: F,
|
|
16730
16748
|
singleVariantsRenderable: At?.workflowConfiguration?.singleVariantsRenderable,
|
|
16731
|
-
stateMutationFunc:
|
|
16749
|
+
stateMutationFunc: k ? async () => {
|
|
16732
16750
|
throw new Q("State mutation is forbidden in read only mode!");
|
|
16733
16751
|
} : async (rt) => this.updateTransactionState({
|
|
16734
16752
|
...rt,
|
|
16735
16753
|
context: { transactionOwnerId: qe, bundleOwnerId: e?.bundleOwnerId }
|
|
16736
16754
|
}),
|
|
16737
16755
|
graphQlClient: () => vr,
|
|
16738
|
-
readOnly:
|
|
16756
|
+
readOnly: k,
|
|
16739
16757
|
isReloadedTransaction: At.type === "transaction"
|
|
16740
16758
|
};
|
|
16741
|
-
if (At.type === "transaction" &&
|
|
16742
|
-
const rt = JSON.parse(
|
|
16759
|
+
if (At.type === "transaction" && F.workflowState) {
|
|
16760
|
+
const rt = JSON.parse(F.workflowState);
|
|
16743
16761
|
await Xa(rt), ie.reloadedState = rt;
|
|
16744
|
-
} else if (!
|
|
16762
|
+
} else if (!k && At.workflowState) {
|
|
16745
16763
|
const rt = JSON.parse(At.workflowState);
|
|
16746
16764
|
await Xa(rt), ie.reloadedState = rt;
|
|
16747
16765
|
}
|
|
16748
16766
|
return ie.delayWorkflowStateSync = !0, { experienceOptions: ie, index: J, options: At };
|
|
16749
|
-
}),
|
|
16767
|
+
}), T = (await Promise.all(E)).sort((B, F) => B.index - F.index);
|
|
16750
16768
|
let R = [];
|
|
16751
|
-
for (const B of
|
|
16752
|
-
const { experienceOptions:
|
|
16753
|
-
await
|
|
16769
|
+
for (const B of T) {
|
|
16770
|
+
const { experienceOptions: F, options: L } = B, k = new Bl(this, F);
|
|
16771
|
+
await k.getWorkflowManager().getInitializationPromise(), a && a(), L.type !== "transaction" && this.customer && await k.attachCustomerDetails({ email: this.customer.emailAddress }), R = [...R, k], k.getWorkflowManager().setWorkflowStateSyncEnabled(!0);
|
|
16754
16772
|
}
|
|
16755
16773
|
return R;
|
|
16756
16774
|
}
|
|
16757
16775
|
storeCustomer(t) {
|
|
16758
|
-
const e =
|
|
16759
|
-
e.set(t.partner.id, t.id),
|
|
16776
|
+
const e = M.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map();
|
|
16777
|
+
e.set(t.partner.id, t.id), M.setMap("partnerCustomerIds", e);
|
|
16760
16778
|
}
|
|
16761
16779
|
async getIntegrationProductById(t, e) {
|
|
16762
|
-
const i = (await
|
|
16780
|
+
const i = (await S.getShadowGraphqlClient().query({
|
|
16763
16781
|
query: Ji(e),
|
|
16764
16782
|
variables: {
|
|
16765
16783
|
ids: [t]
|
|
@@ -16772,7 +16790,7 @@ class Vd {
|
|
|
16772
16790
|
return new dn(i[0]);
|
|
16773
16791
|
}
|
|
16774
16792
|
async getIntegrationProductFromExternalIds(t, e, a) {
|
|
16775
|
-
const o = (await
|
|
16793
|
+
const o = (await S.getShadowGraphqlClient().query({
|
|
16776
16794
|
query: Ki(a),
|
|
16777
16795
|
variables: {
|
|
16778
16796
|
externalProductId: e,
|
|
@@ -16789,7 +16807,7 @@ class Vd {
|
|
|
16789
16807
|
return t.type === "integration" ? this.getIntegrationProductById(t.integrationProductId) : this.getIntegrationProductFromExternalIds(t.externalIntegrationId, t.externalProductId);
|
|
16790
16808
|
}
|
|
16791
16809
|
async getShareActionsForTransaction(t) {
|
|
16792
|
-
const a = (
|
|
16810
|
+
const a = (M.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(t) || void 0, r = await S.getShadowGraphqlClient().query({
|
|
16793
16811
|
query: ji,
|
|
16794
16812
|
errorPolicy: "all",
|
|
16795
16813
|
fetchPolicy: "no-cache",
|
|
@@ -16805,7 +16823,7 @@ class Vd {
|
|
|
16805
16823
|
return r.data.transactions[0].transactionShareActions;
|
|
16806
16824
|
}
|
|
16807
16825
|
async placeOrder(t) {
|
|
16808
|
-
const e = await
|
|
16826
|
+
const e = await S.getShadowGraphqlClient().mutate({
|
|
16809
16827
|
mutation: Ao,
|
|
16810
16828
|
variables: {
|
|
16811
16829
|
orderItems: t
|
|
@@ -16821,7 +16839,7 @@ class Vd {
|
|
|
16821
16839
|
};
|
|
16822
16840
|
}
|
|
16823
16841
|
}
|
|
16824
|
-
const dc = async (n, t) => (await
|
|
16842
|
+
const dc = async (n, t) => (await S.getShadowGraphqlClient().query({
|
|
16825
16843
|
query: so,
|
|
16826
16844
|
errorPolicy: "all",
|
|
16827
16845
|
fetchPolicy: "no-cache",
|
|
@@ -16835,7 +16853,7 @@ const dc = async (n, t) => (await y.getShadowGraphqlClient().query({
|
|
|
16835
16853
|
themeConfigurationId: t
|
|
16836
16854
|
}
|
|
16837
16855
|
})).data.currentIntegration, zd = async (n) => {
|
|
16838
|
-
const e = await
|
|
16856
|
+
const e = await S.getShadowGraphqlClient().query({
|
|
16839
16857
|
query: Hi,
|
|
16840
16858
|
errorPolicy: "all",
|
|
16841
16859
|
fetchPolicy: "network-only",
|
|
@@ -16845,20 +16863,20 @@ const dc = async (n, t) => (await y.getShadowGraphqlClient().query({
|
|
|
16845
16863
|
});
|
|
16846
16864
|
if (e.data.transactions.length !== 0)
|
|
16847
16865
|
return e.data.transactions[0];
|
|
16848
|
-
}, Gd = async (n, t) => (await
|
|
16866
|
+
}, Gd = async (n, t) => (await S.getShadowGraphqlClient().query({
|
|
16849
16867
|
query: oo,
|
|
16850
16868
|
errorPolicy: "all",
|
|
16851
16869
|
variables: {
|
|
16852
16870
|
themeConfigurationId: n,
|
|
16853
16871
|
themeInstallId: t
|
|
16854
16872
|
}
|
|
16855
|
-
})).data?.marketplaceThemeInstallConfiguration, Wd = async (n) => (await
|
|
16873
|
+
})).data?.marketplaceThemeInstallConfiguration, Wd = async (n) => (await S.getShadowGraphqlClient().query({
|
|
16856
16874
|
query: co,
|
|
16857
16875
|
errorPolicy: "all",
|
|
16858
16876
|
variables: {
|
|
16859
16877
|
id: n
|
|
16860
16878
|
}
|
|
16861
|
-
})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration, qd = async (n) => (await
|
|
16879
|
+
})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration, qd = async (n) => (await S.getShadowGraphqlClient().query({
|
|
16862
16880
|
query: lo,
|
|
16863
16881
|
errorPolicy: "all",
|
|
16864
16882
|
variables: {
|
|
@@ -16877,21 +16895,21 @@ async function Cr() {
|
|
|
16877
16895
|
return n;
|
|
16878
16896
|
}
|
|
16879
16897
|
async function wr(n) {
|
|
16880
|
-
const e =
|
|
16898
|
+
const e = M.getMap("bundleOwnerIds")?.get(n), a = await Cr();
|
|
16881
16899
|
return {
|
|
16882
16900
|
bundleOwnerId: e,
|
|
16883
16901
|
...a
|
|
16884
16902
|
};
|
|
16885
16903
|
}
|
|
16886
16904
|
async function Ac(n) {
|
|
16887
|
-
const e =
|
|
16905
|
+
const e = M.getMap("transactionOwnerIds")?.get(n), a = await Cr();
|
|
16888
16906
|
return {
|
|
16889
16907
|
transactionOwnerId: e,
|
|
16890
16908
|
...a
|
|
16891
16909
|
};
|
|
16892
16910
|
}
|
|
16893
16911
|
const Hd = async (n) => {
|
|
16894
|
-
const t = await wr(n), e = await
|
|
16912
|
+
const t = await wr(n), e = await S.getShadowGraphqlClient().mutate({
|
|
16895
16913
|
mutation: el,
|
|
16896
16914
|
errorPolicy: "all",
|
|
16897
16915
|
fetchPolicy: "no-cache",
|
|
@@ -16905,7 +16923,7 @@ const Hd = async (n) => {
|
|
|
16905
16923
|
if (e.data?.bundleDelete !== n)
|
|
16906
16924
|
throw new Error(`Failed to delete bundle: ${e.errors}`);
|
|
16907
16925
|
}, jd = async (n) => {
|
|
16908
|
-
const t = await Ac(n), e = await
|
|
16926
|
+
const t = await Ac(n), e = await S.getShadowGraphqlClient().mutate({
|
|
16909
16927
|
mutation: al,
|
|
16910
16928
|
errorPolicy: "all",
|
|
16911
16929
|
fetchPolicy: "no-cache",
|
|
@@ -17603,7 +17621,7 @@ const pc = C`
|
|
|
17603
17621
|
total
|
|
17604
17622
|
}
|
|
17605
17623
|
}
|
|
17606
|
-
`, Jd = async (n, t, e) => await
|
|
17624
|
+
`, Jd = async (n, t, e) => await S.getShadowGraphqlClient().mutate({
|
|
17607
17625
|
mutation: Sc,
|
|
17608
17626
|
errorPolicy: "all",
|
|
17609
17627
|
variables: {
|
|
@@ -17611,34 +17629,34 @@ const pc = C`
|
|
|
17611
17629
|
name: t
|
|
17612
17630
|
},
|
|
17613
17631
|
context: e
|
|
17614
|
-
}), Kd = async (n, t) => await
|
|
17632
|
+
}), Kd = async (n, t) => await S.getShadowGraphqlClient().mutate({
|
|
17615
17633
|
mutation: fc,
|
|
17616
17634
|
errorPolicy: "all",
|
|
17617
17635
|
variables: {
|
|
17618
17636
|
id: n,
|
|
17619
17637
|
name: t
|
|
17620
17638
|
}
|
|
17621
|
-
}), _d = async (n, t) => await
|
|
17639
|
+
}), _d = async (n, t) => await S.getShadowGraphqlClient().mutate({
|
|
17622
17640
|
mutation: vc,
|
|
17623
17641
|
errorPolicy: "all",
|
|
17624
17642
|
variables: {
|
|
17625
17643
|
id: n,
|
|
17626
17644
|
template: t
|
|
17627
17645
|
}
|
|
17628
|
-
}), Xd = async (n, t) => await
|
|
17646
|
+
}), Xd = async (n, t) => await S.getShadowGraphqlClient().mutate({
|
|
17629
17647
|
mutation: Cc,
|
|
17630
17648
|
errorPolicy: "all",
|
|
17631
17649
|
variables: {
|
|
17632
17650
|
id: n,
|
|
17633
17651
|
template: t
|
|
17634
17652
|
}
|
|
17635
|
-
}), Zd = async (n) => (await
|
|
17653
|
+
}), Zd = async (n) => (await S.getShadowGraphqlClient().query({
|
|
17636
17654
|
query: pc,
|
|
17637
17655
|
errorPolicy: "all",
|
|
17638
17656
|
variables: {
|
|
17639
17657
|
email: n
|
|
17640
17658
|
}
|
|
17641
|
-
})).data.customer, tA = async (n, t, e) => await
|
|
17659
|
+
})).data.customer, tA = async (n, t, e) => await S.getShadowGraphqlClient().query({
|
|
17642
17660
|
query: wc,
|
|
17643
17661
|
errorPolicy: "all",
|
|
17644
17662
|
fetchPolicy: "no-cache",
|
|
@@ -17647,7 +17665,7 @@ const pc = C`
|
|
|
17647
17665
|
offset: e,
|
|
17648
17666
|
limit: t
|
|
17649
17667
|
}
|
|
17650
|
-
}), eA = async (n, t) => await
|
|
17668
|
+
}), eA = async (n, t) => await S.getShadowGraphqlClient().query({
|
|
17651
17669
|
query: yc,
|
|
17652
17670
|
errorPolicy: "all",
|
|
17653
17671
|
fetchPolicy: "no-cache",
|
|
@@ -17655,7 +17673,7 @@ const pc = C`
|
|
|
17655
17673
|
id: n
|
|
17656
17674
|
},
|
|
17657
17675
|
context: t
|
|
17658
|
-
}), aA = async (n, t, e) => (await
|
|
17676
|
+
}), aA = async (n, t, e) => (await S.getShadowGraphqlClient().query({
|
|
17659
17677
|
query: $a,
|
|
17660
17678
|
errorPolicy: "all",
|
|
17661
17679
|
fetchPolicy: "no-cache",
|
|
@@ -17675,7 +17693,7 @@ const pc = C`
|
|
|
17675
17693
|
offset: e,
|
|
17676
17694
|
limit: t
|
|
17677
17695
|
}
|
|
17678
|
-
}))?.data.customerTransactionsFeed?.items || [], nA = async (n, t, e) => (await
|
|
17696
|
+
}))?.data.customerTransactionsFeed?.items || [], nA = async (n, t, e) => (await S.getShadowGraphqlClient().query({
|
|
17679
17697
|
query: $a,
|
|
17680
17698
|
errorPolicy: "all",
|
|
17681
17699
|
fetchPolicy: "no-cache",
|
|
@@ -17695,7 +17713,7 @@ const pc = C`
|
|
|
17695
17713
|
offset: e,
|
|
17696
17714
|
limit: t
|
|
17697
17715
|
}
|
|
17698
|
-
}))?.data.customerTransactionsFeed?.items || [], rA = async (n, t, e) => (await
|
|
17716
|
+
}))?.data.customerTransactionsFeed?.items || [], rA = async (n, t, e) => (await S.getShadowGraphqlClient().query({
|
|
17699
17717
|
query: $a,
|
|
17700
17718
|
errorPolicy: "all",
|
|
17701
17719
|
fetchPolicy: "no-cache",
|
|
@@ -17711,7 +17729,7 @@ const pc = C`
|
|
|
17711
17729
|
offset: e,
|
|
17712
17730
|
limit: t
|
|
17713
17731
|
}
|
|
17714
|
-
}))?.data.customerTransactionsFeed?.items || [], iA = async (n, t, e) => (await
|
|
17732
|
+
}))?.data.customerTransactionsFeed?.items || [], iA = async (n, t, e) => (await S.getShadowGraphqlClient().query({
|
|
17715
17733
|
query: Ec,
|
|
17716
17734
|
errorPolicy: "all",
|
|
17717
17735
|
fetchPolicy: "no-cache",
|
|
@@ -17879,7 +17897,7 @@ const Sr = C`
|
|
|
17879
17897
|
`;
|
|
17880
17898
|
var Mc = /* @__PURE__ */ ((n) => (n.Confirmed = "Confirmed", n.Plausible = "Plausible", n.Unlikely = "Unlikely", n))(Mc || {}), Tc = /* @__PURE__ */ ((n) => (n.Created = "Created", n.Processing = "Processing", n.Completed = "Completed", n.Failed = "Failed", n.Cancelled = "Cancelled", n))(Tc || {});
|
|
17881
17899
|
const oA = async (n) => {
|
|
17882
|
-
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await
|
|
17900
|
+
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await S.getShadowGraphqlClient().query({
|
|
17883
17901
|
query: xc,
|
|
17884
17902
|
errorPolicy: "all",
|
|
17885
17903
|
fetchPolicy: "network-only",
|
|
@@ -17892,14 +17910,14 @@ const oA = async (n) => {
|
|
|
17892
17910
|
if (r)
|
|
17893
17911
|
return e.data?.recipients?.find((i) => i.id === r)?.addressValidationJob;
|
|
17894
17912
|
});
|
|
17895
|
-
}, sA = async (n) => (await
|
|
17913
|
+
}, sA = async (n) => (await S.getShadowGraphqlClient().query({
|
|
17896
17914
|
query: Pc,
|
|
17897
17915
|
errorPolicy: "all",
|
|
17898
17916
|
fetchPolicy: "network-only",
|
|
17899
17917
|
variables: {
|
|
17900
17918
|
ids: n
|
|
17901
17919
|
}
|
|
17902
|
-
})).data?.addressValidationJobs, lA = async (n) => n.getTransaction().recipient?.id ? (await
|
|
17920
|
+
})).data?.addressValidationJobs, lA = async (n) => n.getTransaction().recipient?.id ? (await S.getShadowGraphqlClient().mutate({
|
|
17903
17921
|
mutation: Dc,
|
|
17904
17922
|
errorPolicy: "all",
|
|
17905
17923
|
fetchPolicy: "network-only",
|
|
@@ -17907,7 +17925,7 @@ const oA = async (n) => {
|
|
|
17907
17925
|
id: n.getTransaction().recipient.id
|
|
17908
17926
|
}
|
|
17909
17927
|
})).data?.recipientValidate : void 0, cA = async (n) => {
|
|
17910
|
-
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await
|
|
17928
|
+
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await S.getShadowGraphqlClient().mutate({
|
|
17911
17929
|
mutation: Fc,
|
|
17912
17930
|
errorPolicy: "all",
|
|
17913
17931
|
fetchPolicy: "network-only",
|
|
@@ -17924,7 +17942,7 @@ const oA = async (n) => {
|
|
|
17924
17942
|
const t = n.getTransaction().recipient?.id;
|
|
17925
17943
|
if (!t)
|
|
17926
17944
|
return;
|
|
17927
|
-
(await
|
|
17945
|
+
(await S.getShadowGraphqlClient().mutate({
|
|
17928
17946
|
mutation: kc,
|
|
17929
17947
|
errorPolicy: "all",
|
|
17930
17948
|
fetchPolicy: "network-only",
|
|
@@ -17942,7 +17960,7 @@ const oA = async (n) => {
|
|
|
17942
17960
|
}
|
|
17943
17961
|
}
|
|
17944
17962
|
}
|
|
17945
|
-
`, AA = async (n) => (await
|
|
17963
|
+
`, AA = async (n) => (await S.getShadowGraphqlClient().query({
|
|
17946
17964
|
query: Nc,
|
|
17947
17965
|
variables: {
|
|
17948
17966
|
ids: n
|
|
@@ -18058,7 +18076,7 @@ export {
|
|
|
18058
18076
|
ud as findPmsColors,
|
|
18059
18077
|
Vt as frameDataCache,
|
|
18060
18078
|
St as frameStepService,
|
|
18061
|
-
|
|
18079
|
+
N as generate,
|
|
18062
18080
|
ws as generateCommands,
|
|
18063
18081
|
st as generateSVGWithUnknownColors,
|
|
18064
18082
|
Rd as generateStateFromDesignInputSteps,
|
|
@@ -18093,7 +18111,7 @@ export {
|
|
|
18093
18111
|
oA as getValidationJobsForWorkflowExperiences,
|
|
18094
18112
|
lc as getWorkflow,
|
|
18095
18113
|
fr as getWorkflows,
|
|
18096
|
-
|
|
18114
|
+
S as graphQlManager,
|
|
18097
18115
|
fe as illustrationStepService,
|
|
18098
18116
|
md as isCloseToValue,
|
|
18099
18117
|
Tt as loadFont,
|
|
@@ -18110,7 +18128,7 @@ export {
|
|
|
18110
18128
|
Id as outlineFontsInSvg,
|
|
18111
18129
|
dA as overrideWorkflowExperienceRecipientAddress,
|
|
18112
18130
|
ht as patternImageDataCache,
|
|
18113
|
-
|
|
18131
|
+
M as persistenceService,
|
|
18114
18132
|
lr as pictureStepService,
|
|
18115
18133
|
dd as pmsToRgb,
|
|
18116
18134
|
cr as questionStepService,
|