@spiffcommerce/core 19.1.1 → 19.2.1-alpha.0
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 +13 -0
- package/dist/index.js +358 -315
- package/dist/index.umd.cjs +33 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createHttpLink as Bt, InMemoryCache as dt, ApolloClient as wt, from as Et, gql as
|
|
1
|
+
import { createHttpLink as Bt, InMemoryCache as dt, ApolloClient as wt, from as Et, gql as F } from "@apollo/client/core";
|
|
2
2
|
import { fetch as ZA, getAttributesFromArrayBuffer as De, AssetType as ce, StepType as D, getFrameData as $A, frameDataCache as ht, GroupCommand as G, UpdateFramePattern as Fe, UpdateFrameThresholdSettingsCommand as Ct, calculateOffsets as _A, LayoutElementType as v, generate as J, CreateElementCommand as L, generateSVGWithUnknownColors as Me, svgObjectURL as pA, fetchAsString as q, DeleteElementCommand as Z, generateDefaultRectangleFrameSvg as ge, GetSVGDimensions as Qt, patternImageDataCache as le, fetchAsArrayBuffer as ut, findElement as fA, modifySVGWithElementProperties as mt, IllustrationColorCommand as OA, IllustrationCacheCommand as It, getFontMetrics as pt, getPatternImageData as zA, FontAlignmentCommand as ft, FontColorCommand as Dt, FontImageFillCommand as kA, applyTextTransformations as KA, determineCorrectFontSizeAndLines as uA, FontSourceCommand as Be, loadFont as Ae, TextChangeCommand as Ft, FontSizeCommand as Mt, createElementNS as yt, createElement as lA, _loadFontExternalDataURL as ee, UpdateWorkflowStateCommand as de, CommandContext as Yt, createCanvas as DA, getSvgElement as ye, LayoutRenderingPurpose as Ye, renderPapyrusComponentAsString as Se, loadImage as xe, getDomParser as Pe, toBase64 as we, getVariant as St, generateFrameSVG as xt, getDefaultVariant as NA, domParser as Ne, sanitizeSvgTree as He, traverse as Pt, xmlSerializer as Re, CreateLayoutCommand as Nt, AspectType as mA, rehydrateSerializedLayout as _ } from "@spiffcommerce/papyrus";
|
|
3
|
-
import { AssetType as
|
|
3
|
+
import { AssetType as Ji, BringForwardCommand as bi, BringToBackCommand as Li, BringToFrontCommand as Ti, CanvasCommand as Oi, CommandContext as zi, CreateElementCommand as Ki, CreateLayoutCommand as ji, DeleteElementCommand as Vi, FontAlignmentCommand as Wi, FontColorCommand as Xi, FontSizeCommand as qi, FontSourceCommand as Zi, GroupCommand as $i, LayoutElementFactory as _i, LayoutElementType as As, MoveCommand as es, ResizeCommand as ts, RotateCommand as ns, SendBackwardsCommand as as, StepAspectType as is, StepType as ss, TextChangeCommand as os, UnitOfMeasurement as rs, dataUrlFromExternalUrl as cs, determineCorrectFontSizeAndLines as gs, findElement as ls, frameDataCache as Bs, generate as ds, generateSVGWithUnknownColors as ws, getAttributesFromArrayBuffer as Es, getAxisAlignedBoundingBox as hs, getFrameData as Cs, getSvgElement as Qs, loadFont as us, patternImageDataCache as ms, registerFetchImplementation as Is, registerWindowImplementation as ps, rehydrateSerializedLayout as fs, setCanvasModule as Ds } from "@spiffcommerce/papyrus";
|
|
4
4
|
import { setContext as Ht } from "@apollo/client/link/context";
|
|
5
5
|
import { onError as Rt } from "@apollo/client/link/error";
|
|
6
6
|
import { Pith as Ue } from "pith";
|
|
@@ -169,32 +169,51 @@ const kt = (c) => {
|
|
|
169
169
|
};
|
|
170
170
|
class Lt {
|
|
171
171
|
constructor() {
|
|
172
|
-
this.shadowGraphqlClient = this.constructShadowGraphqlClient(), yA.addServerUrlCallback(() => {
|
|
172
|
+
this.authenticationMode = 0, this.shadowGraphqlClient = this.constructShadowGraphqlClient(), yA.addServerUrlCallback(() => {
|
|
173
173
|
this.shadowGraphqlClient = this.constructShadowGraphqlClient();
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
getShadowGraphqlClient() {
|
|
177
177
|
return this.shadowGraphqlClient;
|
|
178
178
|
}
|
|
179
|
+
setAuthenticationMode(A) {
|
|
180
|
+
this.authenticationMode = A;
|
|
181
|
+
}
|
|
179
182
|
constructShadowGraphqlClient() {
|
|
180
183
|
const A = Bt({
|
|
181
184
|
uri: `${yA.getServerUrl()}/graphql`,
|
|
182
185
|
fetch: ZA
|
|
183
186
|
}), e = Ht(async (i, s) => {
|
|
184
|
-
const { headers: o } = s, r = o || {}, g = await bt(), B =
|
|
187
|
+
const { headers: o } = s, r = o || {}, g = await bt(), B = () => {
|
|
188
|
+
switch (this.authenticationMode) {
|
|
189
|
+
case 2:
|
|
190
|
+
case 0:
|
|
191
|
+
return s.bearer ?? g.bearer;
|
|
192
|
+
default:
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
}, l = () => {
|
|
196
|
+
switch (this.authenticationMode) {
|
|
197
|
+
case 1:
|
|
198
|
+
case 0:
|
|
199
|
+
return s.applicationKey ?? g.applicationKey;
|
|
200
|
+
default:
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
}, d = B(), w = l(), h = s.partnerId ?? g.partnerId, E = s.activeIntegration ?? g.activeIntegration, Q = s.transactionOwnerId, C = s.customerToken ?? g.customerToken, f = s.bundleOwnerId;
|
|
185
204
|
try {
|
|
186
205
|
if (window && window.__SENTRY__) {
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
const
|
|
190
|
-
Object.entries(
|
|
191
|
-
r[
|
|
206
|
+
const u = window.__SENTRY__.hub;
|
|
207
|
+
if (u) {
|
|
208
|
+
const I = u.traceHeaders();
|
|
209
|
+
Object.entries(I).forEach(([m, p]) => {
|
|
210
|
+
r[m] = p;
|
|
192
211
|
});
|
|
193
212
|
}
|
|
194
213
|
}
|
|
195
214
|
} catch {
|
|
196
215
|
}
|
|
197
|
-
return
|
|
216
|
+
return d && (r.Authorization = `Bearer ${d}`), h && (r.partnerId = h), E && (r.activeIntegration = E), Q && (r.transactionOwnerId = Q), C && (r.customerToken = C), w && (r["X-Application-Key"] = w), f && (r.bundleOwnerId = f), {
|
|
198
217
|
headers: r
|
|
199
218
|
};
|
|
200
219
|
}), t = Rt(({ operation: i, graphQLErrors: s, networkError: o }) => {
|
|
@@ -251,14 +270,14 @@ class Lt {
|
|
|
251
270
|
});
|
|
252
271
|
}
|
|
253
272
|
}
|
|
254
|
-
const
|
|
273
|
+
const P = new Lt(), Tt = F`
|
|
255
274
|
fragment AssetMetadataFields on Asset {
|
|
256
275
|
metadata {
|
|
257
276
|
key
|
|
258
277
|
value
|
|
259
278
|
}
|
|
260
279
|
}
|
|
261
|
-
`, GA = (c) =>
|
|
280
|
+
`, GA = (c) => F`
|
|
262
281
|
${c && Tt || ""}
|
|
263
282
|
fragment AssetFields on Asset {
|
|
264
283
|
name
|
|
@@ -273,14 +292,14 @@ const N = new Lt(), Tt = M`
|
|
|
273
292
|
}
|
|
274
293
|
${c && "...AssetMetadataFields" || ""}
|
|
275
294
|
}
|
|
276
|
-
`, Ot =
|
|
295
|
+
`, Ot = F`
|
|
277
296
|
${GA(!1)}
|
|
278
297
|
query GetAssets($keys: [String]!) {
|
|
279
298
|
assets(keys: $keys) {
|
|
280
299
|
...AssetFields
|
|
281
300
|
}
|
|
282
301
|
}
|
|
283
|
-
`, ne =
|
|
302
|
+
`, ne = F`
|
|
284
303
|
fragment MaterialFields on Material {
|
|
285
304
|
id
|
|
286
305
|
name
|
|
@@ -327,14 +346,14 @@ const N = new Lt(), Tt = M`
|
|
|
327
346
|
fileLink
|
|
328
347
|
}
|
|
329
348
|
}
|
|
330
|
-
`, zt =
|
|
349
|
+
`, zt = F`
|
|
331
350
|
${ne}
|
|
332
351
|
query GetMaterials($ids: [String]) {
|
|
333
352
|
materials(id: $ids) {
|
|
334
353
|
...MaterialFields
|
|
335
354
|
}
|
|
336
355
|
}
|
|
337
|
-
`, Kt =
|
|
356
|
+
`, Kt = F`
|
|
338
357
|
mutation CreateAsset($name: String!, $type: String!, $mimeType: String!, $anonymous: Boolean, $temporary: Boolean) {
|
|
339
358
|
assetCreate(name: $name, type: $type, mimeType: $mimeType, anonymous: $anonymous, temporary: $temporary) {
|
|
340
359
|
uploadUrl
|
|
@@ -348,14 +367,14 @@ const N = new Lt(), Tt = M`
|
|
|
348
367
|
}
|
|
349
368
|
}
|
|
350
369
|
}
|
|
351
|
-
`, Te = async (c) => (await
|
|
370
|
+
`, Te = async (c) => (await P.getShadowGraphqlClient().query({
|
|
352
371
|
query: Ot,
|
|
353
372
|
errorPolicy: "all",
|
|
354
373
|
fetchPolicy: "no-cache",
|
|
355
374
|
variables: {
|
|
356
375
|
keys: c
|
|
357
376
|
}
|
|
358
|
-
})).data.assets, jt = async (c) => (await
|
|
377
|
+
})).data.assets, jt = async (c) => (await P.getShadowGraphqlClient().query({
|
|
359
378
|
query: zt,
|
|
360
379
|
errorPolicy: "all",
|
|
361
380
|
fetchPolicy: "no-cache",
|
|
@@ -364,7 +383,7 @@ const N = new Lt(), Tt = M`
|
|
|
364
383
|
}
|
|
365
384
|
})).data.materials, Vt = async (c, A, e, t, n) => {
|
|
366
385
|
var i;
|
|
367
|
-
return (i = (await
|
|
386
|
+
return (i = (await P.getShadowGraphqlClient().mutate({
|
|
368
387
|
mutation: Kt,
|
|
369
388
|
errorPolicy: "all",
|
|
370
389
|
fetchPolicy: "no-cache",
|
|
@@ -564,7 +583,7 @@ class Xt {
|
|
|
564
583
|
this.disabled = A;
|
|
565
584
|
}
|
|
566
585
|
}
|
|
567
|
-
const cA = new Xt(), Oe =
|
|
586
|
+
const cA = new Xt(), Oe = F`
|
|
568
587
|
fragment OptionFields on Option {
|
|
569
588
|
id
|
|
570
589
|
name
|
|
@@ -604,7 +623,7 @@ const cA = new Xt(), Oe = M`
|
|
|
604
623
|
...AssetFields
|
|
605
624
|
}
|
|
606
625
|
}
|
|
607
|
-
`, qt =
|
|
626
|
+
`, qt = F`
|
|
608
627
|
${GA(!1)}
|
|
609
628
|
${ne}
|
|
610
629
|
${Oe}
|
|
@@ -614,7 +633,7 @@ const cA = new Xt(), Oe = M`
|
|
|
614
633
|
}
|
|
615
634
|
}
|
|
616
635
|
`, Zt = async (c) => {
|
|
617
|
-
const A = await
|
|
636
|
+
const A = await P.getShadowGraphqlClient().query({
|
|
618
637
|
query: qt,
|
|
619
638
|
errorPolicy: "all",
|
|
620
639
|
fetchPolicy: "no-cache",
|
|
@@ -692,7 +711,7 @@ class An {
|
|
|
692
711
|
}
|
|
693
712
|
const j = new An();
|
|
694
713
|
var en = /* @__PURE__ */ ((c) => (c.Hub = "Hub", c.Shopify = "Shopify", c))(en || {}), tn = /* @__PURE__ */ ((c) => (c[c.Orbit = 0] = "Orbit", c[c.Pan = 1] = "Pan", c))(tn || {}), nn = /* @__PURE__ */ ((c) => (c.Manual = "Manual", c.OnStart = "OnStart", c.OnQuit = "OnQuit", c.OnEnd = "OnEnd", c))(nn || {}), an = /* @__PURE__ */ ((c) => (c.Email = "Email", c.FirstName = "FirstName", c.LastName = "LastName", c.Phone = "Phone", c))(an || {}), YA = /* @__PURE__ */ ((c) => (c.Owner = "Owner", c.Approver = "Approver", c.Editor = "Editor", c.Viewer = "Viewer", c))(YA || {});
|
|
695
|
-
const nA =
|
|
714
|
+
const nA = F`
|
|
696
715
|
fragment AdditionalIntegrationProductFields on IntegrationProduct {
|
|
697
716
|
id
|
|
698
717
|
product {
|
|
@@ -709,7 +728,7 @@ const nA = M`
|
|
|
709
728
|
preloadImageUrl
|
|
710
729
|
}
|
|
711
730
|
}
|
|
712
|
-
`, Qe =
|
|
731
|
+
`, Qe = F`
|
|
713
732
|
${nA}
|
|
714
733
|
mutation CreateTransaction(
|
|
715
734
|
$integrationProductId: String
|
|
@@ -793,7 +812,7 @@ const nA = M`
|
|
|
793
812
|
}
|
|
794
813
|
}
|
|
795
814
|
}
|
|
796
|
-
`, sn =
|
|
815
|
+
`, sn = F`
|
|
797
816
|
${nA}
|
|
798
817
|
mutation CreateTransactions($inputs: [TransactionCreateInput]!) {
|
|
799
818
|
transactionCreateMany(inputs: $inputs) {
|
|
@@ -865,7 +884,7 @@ const nA = M`
|
|
|
865
884
|
}
|
|
866
885
|
}
|
|
867
886
|
}
|
|
868
|
-
`, on =
|
|
887
|
+
`, on = F`
|
|
869
888
|
${nA}
|
|
870
889
|
mutation ClaimTransaction($id: String!) {
|
|
871
890
|
transactionClaim(id: $id) {
|
|
@@ -937,7 +956,7 @@ const nA = M`
|
|
|
937
956
|
}
|
|
938
957
|
}
|
|
939
958
|
}
|
|
940
|
-
`, BA =
|
|
959
|
+
`, BA = F`
|
|
941
960
|
${nA}
|
|
942
961
|
query ReadTransactions($ids: [String]!) {
|
|
943
962
|
transactions(ids: $ids) {
|
|
@@ -1030,20 +1049,20 @@ const nA = M`
|
|
|
1030
1049
|
}
|
|
1031
1050
|
}
|
|
1032
1051
|
}
|
|
1033
|
-
`, rn =
|
|
1052
|
+
`, rn = F`
|
|
1034
1053
|
mutation UpdateTransactionWorkflowState($id: String!, $workflowState: String!) {
|
|
1035
1054
|
transactionUpdate(id: $id, workflowState: $workflowState) {
|
|
1036
1055
|
id
|
|
1037
1056
|
}
|
|
1038
1057
|
}
|
|
1039
|
-
`, cn =
|
|
1058
|
+
`, cn = F`
|
|
1040
1059
|
mutation UpdateTransactionWorkflowId($id: String!, $workflowId: String!) {
|
|
1041
1060
|
transactionUpdate(id: $id, workflowId: $workflowId) {
|
|
1042
1061
|
id
|
|
1043
1062
|
}
|
|
1044
1063
|
}
|
|
1045
1064
|
`;
|
|
1046
|
-
|
|
1065
|
+
F`
|
|
1047
1066
|
query ReadTransactionForDesignCreation($id: String!) {
|
|
1048
1067
|
transactions(ids: [$id]) {
|
|
1049
1068
|
id
|
|
@@ -1083,14 +1102,14 @@ M`
|
|
|
1083
1102
|
}
|
|
1084
1103
|
}
|
|
1085
1104
|
`;
|
|
1086
|
-
const ze =
|
|
1105
|
+
const ze = F`
|
|
1087
1106
|
query ReadWorkflowStates($ids: [String]!) {
|
|
1088
1107
|
transactions(ids: $ids) {
|
|
1089
1108
|
id
|
|
1090
1109
|
workflowState
|
|
1091
1110
|
}
|
|
1092
1111
|
}
|
|
1093
|
-
`, Ke =
|
|
1112
|
+
`, Ke = F`
|
|
1094
1113
|
${nA}
|
|
1095
1114
|
fragment IntegrationProductFields on IntegrationProduct {
|
|
1096
1115
|
id
|
|
@@ -1132,14 +1151,14 @@ const ze = M`
|
|
|
1132
1151
|
}
|
|
1133
1152
|
}
|
|
1134
1153
|
}
|
|
1135
|
-
`, gn =
|
|
1154
|
+
`, gn = F`
|
|
1136
1155
|
${Ke}
|
|
1137
1156
|
query GetIntegrationProducts($ids: [String!]!) {
|
|
1138
1157
|
integrationProducts(ids: $ids) {
|
|
1139
1158
|
...IntegrationProductFields
|
|
1140
1159
|
}
|
|
1141
1160
|
}
|
|
1142
|
-
`, ln =
|
|
1161
|
+
`, ln = F`
|
|
1143
1162
|
${Ke}
|
|
1144
1163
|
query GetIntegrationProductFromExternalIds($externalIntegrationId: String!, $externalProductId: String!) {
|
|
1145
1164
|
integrationProductFromExternalIds(
|
|
@@ -1671,8 +1690,8 @@ class un {
|
|
|
1671
1690
|
async regenerateQRCode(A, e, t, n, a, i, s, o, r) {
|
|
1672
1691
|
if (!e && t !== "" && n === "") {
|
|
1673
1692
|
const g = async () => {
|
|
1674
|
-
var u,
|
|
1675
|
-
const C = (await Te([t]))[0], f = (
|
|
1693
|
+
var u, I;
|
|
1694
|
+
const C = (await Te([t]))[0], f = (I = (u = C == null ? void 0 : C.versions) == null ? void 0 : u.find((m) => m.name === "mpeg4")) == null ? void 0 : I.link;
|
|
1676
1695
|
return { asset: C, link: f };
|
|
1677
1696
|
}, B = await new Promise((C, f) => {
|
|
1678
1697
|
new We(
|
|
@@ -1936,11 +1955,11 @@ class In {
|
|
|
1936
1955
|
scaleX: (C == null ? void 0 : C.zoom) || 1,
|
|
1937
1956
|
scaleY: (C == null ? void 0 : C.zoom) || 1,
|
|
1938
1957
|
rotation: 0
|
|
1939
|
-
} : void 0, u = J(),
|
|
1940
|
-
if (!
|
|
1958
|
+
} : void 0, u = J(), m = n.getLayouts().find((p) => p.panelId === d.panelId);
|
|
1959
|
+
if (!m)
|
|
1941
1960
|
throw new z(d);
|
|
1942
1961
|
return {
|
|
1943
|
-
command: this.getCreateElementCommand(u, d,
|
|
1962
|
+
command: this.getCreateElementCommand(u, d, m, {
|
|
1944
1963
|
frameData: h,
|
|
1945
1964
|
pattern: f,
|
|
1946
1965
|
disablePlaceholder: A.data.disablePlaceholder,
|
|
@@ -2168,7 +2187,7 @@ class pn {
|
|
|
2168
2187
|
if (!o)
|
|
2169
2188
|
throw new rA(s);
|
|
2170
2189
|
const r = await Me(await this.getIllustrationBody(o)), g = await pA(r.svg), B = (C) => {
|
|
2171
|
-
const f = a.getLayouts().find((
|
|
2190
|
+
const f = a.getLayouts().find((I) => I.panelId === C.panelId);
|
|
2172
2191
|
if (!f)
|
|
2173
2192
|
throw new z(C);
|
|
2174
2193
|
const u = J();
|
|
@@ -2202,13 +2221,13 @@ class pn {
|
|
|
2202
2221
|
);
|
|
2203
2222
|
const C = await this.availableColors(A, a) || [], f = Object.keys(r.colors);
|
|
2204
2223
|
if (A.data.colorPickerEnabled && C.length === 1 && f.length === 1) {
|
|
2205
|
-
const u = C[0],
|
|
2224
|
+
const u = C[0], I = f[0];
|
|
2206
2225
|
await this.changeColors(
|
|
2207
2226
|
A,
|
|
2208
|
-
l.map((
|
|
2227
|
+
l.map((m) => m.regionElement),
|
|
2209
2228
|
a,
|
|
2210
2229
|
() => a.getCommandContext().getAllLayouts(),
|
|
2211
|
-
/* @__PURE__ */ new Map([[
|
|
2230
|
+
/* @__PURE__ */ new Map([[I, u.variant.color]])
|
|
2212
2231
|
);
|
|
2213
2232
|
}
|
|
2214
2233
|
}
|
|
@@ -3090,7 +3109,7 @@ class Hn {
|
|
|
3090
3109
|
h,
|
|
3091
3110
|
async () => {
|
|
3092
3111
|
e.updateMetadata(A.stepName, { color: E, text: Q }), e.updateStorage(A.stepName, { text: Q, inputText: Q });
|
|
3093
|
-
const f = s.map((
|
|
3112
|
+
const f = s.map((I) => new Be(I.id, w)), u = new G(f);
|
|
3094
3113
|
e.getCommandDispatcher()(u), e.setMandatoryFulfilled(A.stepName, !0);
|
|
3095
3114
|
}
|
|
3096
3115
|
);
|
|
@@ -3214,11 +3233,11 @@ class Hn {
|
|
|
3214
3233
|
const E = t.colorOption;
|
|
3215
3234
|
let Q;
|
|
3216
3235
|
if (E && E.variants) {
|
|
3217
|
-
const
|
|
3236
|
+
const N = E.variants.find((H) => {
|
|
3218
3237
|
var T;
|
|
3219
3238
|
return H.id === ((T = E.defaultVariant) == null ? void 0 : T.id);
|
|
3220
3239
|
}) || E.variants[0];
|
|
3221
|
-
Q = this.createTextFillSpotColor(E,
|
|
3240
|
+
Q = this.createTextFillSpotColor(E, N), i.updateStorage(A, {
|
|
3222
3241
|
colorProfileAssetKey: (h = E.colorProfile) == null ? void 0 : h.key
|
|
3223
3242
|
});
|
|
3224
3243
|
}
|
|
@@ -3246,10 +3265,10 @@ class Hn {
|
|
|
3246
3265
|
curved: t.curved,
|
|
3247
3266
|
paths: t.paths,
|
|
3248
3267
|
fillSpotColorDefinition: Q
|
|
3249
|
-
},
|
|
3268
|
+
}, I = [], m = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
3250
3269
|
if (!u.fontData)
|
|
3251
3270
|
throw new k("Failed to resolve font data for text.");
|
|
3252
|
-
const [
|
|
3271
|
+
const [M, y] = uA(
|
|
3253
3272
|
u.fontSize,
|
|
3254
3273
|
u.fontData,
|
|
3255
3274
|
{
|
|
@@ -3263,16 +3282,16 @@ class Hn {
|
|
|
3263
3282
|
[o],
|
|
3264
3283
|
{ size: t.size, minSize: t.minSize, maxSize: t.maxSize }
|
|
3265
3284
|
);
|
|
3266
|
-
|
|
3285
|
+
m.set(u.id, M), p.set(u.id, y);
|
|
3267
3286
|
const S = t.curved || t.vertical ? o : (y || []).join(`
|
|
3268
3287
|
`);
|
|
3269
|
-
|
|
3270
|
-
this.generateTextChangeCommandsForRegion(
|
|
3288
|
+
I.push(
|
|
3289
|
+
this.generateTextChangeCommandsForRegion(M, t, u.id, S)
|
|
3271
3290
|
);
|
|
3272
3291
|
const Y = new L(u, d);
|
|
3273
3292
|
return {
|
|
3274
3293
|
regionElement: { id: w, region: B },
|
|
3275
|
-
commands: [Y, ...
|
|
3294
|
+
commands: [Y, ...I],
|
|
3276
3295
|
newElement: u,
|
|
3277
3296
|
fontData: n
|
|
3278
3297
|
};
|
|
@@ -3310,23 +3329,23 @@ class Hn {
|
|
|
3310
3329
|
const B = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), l = this.getProcessedInput(B, A.data, s), d = i.getRegionElements(A.stepName), w = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
|
|
3311
3330
|
for (const u of d)
|
|
3312
3331
|
if (u.region) {
|
|
3313
|
-
const [
|
|
3332
|
+
const [I, m] = uA(
|
|
3314
3333
|
e,
|
|
3315
3334
|
t,
|
|
3316
3335
|
u.region,
|
|
3317
3336
|
[l],
|
|
3318
3337
|
{ size: A.data.size, minSize: A.data.minSize, maxSize: A.data.maxSize }
|
|
3319
3338
|
);
|
|
3320
|
-
w.set(u.id,
|
|
3339
|
+
w.set(u.id, I), h.set(u.id, m);
|
|
3321
3340
|
}
|
|
3322
3341
|
const Q = (() => {
|
|
3323
3342
|
if (A.data && A.data.maxLength && l.length > A.data.maxLength)
|
|
3324
3343
|
return g && g(!0), { info: "0" };
|
|
3325
|
-
const u = i.getProfanities(),
|
|
3326
|
-
for (const
|
|
3344
|
+
const u = i.getProfanities(), I = jA(l.toLowerCase());
|
|
3345
|
+
for (const m of I)
|
|
3327
3346
|
for (const p in u) {
|
|
3328
|
-
const
|
|
3329
|
-
if (
|
|
3347
|
+
const M = u[p].toLowerCase().replace(/\s/g, "");
|
|
3348
|
+
if (m === M)
|
|
3330
3349
|
return o(!0), { error: "Blocked profanity." };
|
|
3331
3350
|
}
|
|
3332
3351
|
return !A.data.vertical && !A.data.allowNewlines && (l.includes(`
|
|
@@ -3343,14 +3362,14 @@ class Hn {
|
|
|
3343
3362
|
}), a.defaultCleared && i.setMandatoryFulfilled(A.stepName, !0);
|
|
3344
3363
|
const C = [];
|
|
3345
3364
|
for (const u of d) {
|
|
3346
|
-
const
|
|
3365
|
+
const I = A.data.curved ? l : (h.get(u.id) || []).join(`
|
|
3347
3366
|
`);
|
|
3348
3367
|
C.push(
|
|
3349
3368
|
this.generateTextChangeCommandsForRegion(
|
|
3350
3369
|
w.get(u.id) || 1,
|
|
3351
3370
|
A.data,
|
|
3352
3371
|
u.id,
|
|
3353
|
-
|
|
3372
|
+
I
|
|
3354
3373
|
)
|
|
3355
3374
|
);
|
|
3356
3375
|
}
|
|
@@ -4798,16 +4817,16 @@ class bn extends ae {
|
|
|
4798
4817
|
}
|
|
4799
4818
|
brandSvg(A, e) {
|
|
4800
4819
|
const t = A.toSVG(2), n = A.getBoundingBox(), a = n.x2 - n.x1, i = A.toPathData(3), s = () => {
|
|
4801
|
-
const
|
|
4802
|
-
|
|
4820
|
+
const I = R("g"), m = R("defs");
|
|
4821
|
+
I.appendChild(m), m.appendChild(et(3, 7, 4, "shadow"));
|
|
4803
4822
|
const p = R("g");
|
|
4804
|
-
|
|
4805
|
-
const
|
|
4806
|
-
|
|
4823
|
+
I.appendChild(p), p.setAttribute("filter", "url(#shadow)"), p.innerHTML = t;
|
|
4824
|
+
const M = R("g");
|
|
4825
|
+
I.appendChild(M), M.setAttribute("fill", "red"), M.setAttribute("stroke", "red"), M.setAttribute("stroke-width", "9"), M.innerHTML = t;
|
|
4807
4826
|
const y = R("g");
|
|
4808
|
-
|
|
4827
|
+
I.appendChild(y), y.setAttribute("fill", "#9d2621"), y.setAttribute("transform", "translate(1,1)"), y.innerHTML = t;
|
|
4809
4828
|
const S = R("g");
|
|
4810
|
-
return
|
|
4829
|
+
return I.appendChild(S), S.setAttribute("fill", "yellow"), S.innerHTML = t, new oe(I).transform(([N, H]) => [N, H + (a / 2 - N) ** 2 / (a * 2.9)]), I;
|
|
4811
4830
|
}, [o, r, g] = _e(e);
|
|
4812
4831
|
if (!o)
|
|
4813
4832
|
return "";
|
|
@@ -4842,17 +4861,17 @@ class Tn extends ae {
|
|
|
4842
4861
|
}
|
|
4843
4862
|
brandSvg(A, e, t) {
|
|
4844
4863
|
const n = A.toSVG(2), a = A.getBoundingBox(), i = a.y2 - a.y1, s = a.x2 - a.x1, o = A.toPathData(3), r = () => {
|
|
4845
|
-
const p = R("g"),
|
|
4846
|
-
p.appendChild(
|
|
4864
|
+
const p = R("g"), M = R("g");
|
|
4865
|
+
p.appendChild(M), M.setAttribute("stroke", "#5C1A0D"), M.setAttribute("stroke-width", "4"), M.setAttribute("transform", "translate(1,1)"), M.innerHTML = n;
|
|
4847
4866
|
const y = R("g");
|
|
4848
4867
|
p.appendChild(y), y.setAttribute("fill", "#FFE386"), y.setAttribute("transform", "translate(1,1)"), y.innerHTML = n;
|
|
4849
4868
|
const S = R("g");
|
|
4850
4869
|
p.appendChild(S), S.setAttribute("fill", "white"), S.innerHTML = n;
|
|
4851
4870
|
const Y = new oe(p);
|
|
4852
|
-
return Y.transform(([
|
|
4853
|
-
|
|
4854
|
-
H + (s / 3 -
|
|
4855
|
-
]), Y.transform(([
|
|
4871
|
+
return Y.transform(([N, H]) => [N, H + ((s - N) * H) ** 2 / (s * 5e4)]), Y.transform(([N, H]) => [
|
|
4872
|
+
N,
|
|
4873
|
+
H + (s / 3 - N) ** 2 / s * this.indicator(N < s / 3)
|
|
4874
|
+
]), Y.transform(([N, H]) => [N - (i - H) * (s - N) / 800, H]), p;
|
|
4856
4875
|
}, [g, B, l] = _e(e);
|
|
4857
4876
|
if (!g)
|
|
4858
4877
|
return "";
|
|
@@ -4866,10 +4885,10 @@ class Tn extends ae {
|
|
|
4866
4885
|
f.setAttribute("opacity", "0"), C.appendChild(f);
|
|
4867
4886
|
const u = R("g");
|
|
4868
4887
|
C.appendChild(u);
|
|
4869
|
-
const
|
|
4870
|
-
u.appendChild(
|
|
4871
|
-
const
|
|
4872
|
-
return se(u,
|
|
4888
|
+
const I = r();
|
|
4889
|
+
u.appendChild(I);
|
|
4890
|
+
const m = te(o);
|
|
4891
|
+
return se(u, m, w, h), g.outerHTML;
|
|
4873
4892
|
}
|
|
4874
4893
|
// 1 if true, 0 if false.
|
|
4875
4894
|
}
|
|
@@ -4890,16 +4909,16 @@ class zn extends ae {
|
|
|
4890
4909
|
f.classList.add("module-text-group");
|
|
4891
4910
|
const u = R("defs");
|
|
4892
4911
|
f.appendChild(u), u.appendChild(et(0, 2, 2, "shadow"));
|
|
4893
|
-
const
|
|
4894
|
-
|
|
4895
|
-
const
|
|
4896
|
-
|
|
4912
|
+
const I = R("path");
|
|
4913
|
+
I.setAttribute("d", g), I.setAttribute("stroke", "black"), I.setAttribute("stroke-width", "3"), u.appendChild(I);
|
|
4914
|
+
const m = R("g");
|
|
4915
|
+
m.classList.add("module-layer0"), f.appendChild(m), m.setAttribute("filter", "url(#shadow)"), m.innerHTML = I.outerHTML;
|
|
4897
4916
|
const p = R("g");
|
|
4898
4917
|
p.classList.add("module-layer1"), f.appendChild(p), p.setAttribute("stroke-width", "3"), p.setAttribute("stroke", "rgb(45,41,38)"), p.setAttribute("fill", "rgb(45,41,38)"), p.setAttribute("transform", "translate(0.5,0)"), p.innerHTML = s;
|
|
4899
|
-
const
|
|
4900
|
-
|
|
4918
|
+
const M = R("g");
|
|
4919
|
+
M.classList.add("module-layer2"), f.appendChild(M), M.setAttribute("fill", "rgb(255,209,0)"), M.setAttribute("transform", "translate(1,-0.1)"), M.innerHTML = s;
|
|
4901
4920
|
const y = R("g");
|
|
4902
|
-
return y.classList.add("module-layer3"), f.appendChild(y), y.setAttribute("fill", "white"), y.innerHTML = s, new oe(f).transform(([Y,
|
|
4921
|
+
return y.classList.add("module-layer3"), f.appendChild(y), y.setAttribute("fill", "white"), y.innerHTML = s, new oe(f).transform(([Y, N]) => [Y, N + (r / 2 - Y) ** 2 / (r * 6)]), f;
|
|
4903
4922
|
}, l = R("g");
|
|
4904
4923
|
l.classList.add("module-root");
|
|
4905
4924
|
const d = R("defs");
|
|
@@ -5341,19 +5360,19 @@ class jn {
|
|
|
5341
5360
|
), this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, await this.ensureStepsAreLoaded();
|
|
5342
5361
|
}
|
|
5343
5362
|
async setSelectionsAndElements(A, e, t, n) {
|
|
5344
|
-
var
|
|
5363
|
+
var I;
|
|
5345
5364
|
const a = this.stepSelections;
|
|
5346
5365
|
this.stepSelections = {
|
|
5347
5366
|
...this.stepSelections,
|
|
5348
5367
|
[A]: { selectedVariants: e }
|
|
5349
|
-
}, this.selectionCost = Object.values(this.stepSelections).reduce((
|
|
5350
|
-
tA(
|
|
5368
|
+
}, this.selectionCost = Object.values(this.stepSelections).reduce((m, p) => m + p.selectedVariants.map((M) => M.priceModifier || 0).reduce((M, y) => M + y, 0), 0), this.workflow.steps.forEach((m) => {
|
|
5369
|
+
tA(m, this.stepSelections) || (this.stepInitialised[m.stepName] = !1, delete this.stepMetadata[m.stepName], delete this.stepSelections[m.stepName], delete this.storage[m.stepName]);
|
|
5351
5370
|
});
|
|
5352
|
-
const i = this.allScenes, s = eA(i, a), o = eA(i, this.stepSelections), r = s.map((
|
|
5353
|
-
(
|
|
5371
|
+
const i = this.allScenes, s = eA(i, a), o = eA(i, this.stepSelections), r = s.map((m) => m.silentSteps).flat(), B = o.map((m) => m.silentSteps).flat().filter(
|
|
5372
|
+
(m) => !r.some((p) => p.stepName === m.stepName)
|
|
5354
5373
|
);
|
|
5355
|
-
r.forEach((
|
|
5356
|
-
tA(
|
|
5374
|
+
r.forEach((m) => {
|
|
5375
|
+
tA(m, this.stepSelections) || (this.stepInitialised[m.stepName] = !1);
|
|
5357
5376
|
});
|
|
5358
5377
|
const l = this.getInvalidCanvasRegions(), { stepElements: d, commands: w } = await this.stepElementsForIntroducedSilentSteps(B, !1);
|
|
5359
5378
|
this.stepElements = {
|
|
@@ -5361,16 +5380,16 @@ class jn {
|
|
|
5361
5380
|
...d,
|
|
5362
5381
|
[A]: t
|
|
5363
5382
|
}, this.removeElements(l);
|
|
5364
|
-
const h = this.workflow.steps.find((
|
|
5383
|
+
const h = this.workflow.steps.find((m) => m.stepName === A);
|
|
5365
5384
|
if ((h == null ? void 0 : h.type) === D.Frame) {
|
|
5366
|
-
const
|
|
5367
|
-
(
|
|
5385
|
+
const m = this.getStepSpecificServices(A);
|
|
5386
|
+
(I = m == null ? void 0 : m.frameService) == null || I.setTargetElements(t.map((p) => p.id));
|
|
5368
5387
|
}
|
|
5369
|
-
const E = l.map((
|
|
5388
|
+
const E = l.map((m) => new Z(m.id)), Q = new de(this.constructSerializableWorkflow()), C = [...w, ...E, Q];
|
|
5370
5389
|
C.length > 0 && this.commandContext.apply(new G(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
5371
5390
|
const f = this.getInvalidModelVariants(), u = this.modelContainer;
|
|
5372
5391
|
if (u) {
|
|
5373
|
-
const
|
|
5392
|
+
const m = f.map(
|
|
5374
5393
|
(p) => u.applyModelVariant(
|
|
5375
5394
|
p,
|
|
5376
5395
|
{
|
|
@@ -5379,7 +5398,7 @@ class jn {
|
|
|
5379
5398
|
!1
|
|
5380
5399
|
)
|
|
5381
5400
|
);
|
|
5382
|
-
await Promise.all(
|
|
5401
|
+
await Promise.all(m);
|
|
5383
5402
|
}
|
|
5384
5403
|
await this.onSelectionChange(), n && await n();
|
|
5385
5404
|
}
|
|
@@ -6065,13 +6084,13 @@ class wA {
|
|
|
6065
6084
|
case D.Model:
|
|
6066
6085
|
return new Xn(A, e);
|
|
6067
6086
|
case D.Frame:
|
|
6068
|
-
return new
|
|
6087
|
+
return new Ii(A, e);
|
|
6069
6088
|
default:
|
|
6070
6089
|
throw new k(`Step type ${e.type} not yet supported in Core SDK`);
|
|
6071
6090
|
}
|
|
6072
6091
|
}
|
|
6073
6092
|
}
|
|
6074
|
-
const it =
|
|
6093
|
+
const it = F`
|
|
6075
6094
|
fragment CreateDesignTransaction on Transaction {
|
|
6076
6095
|
id
|
|
6077
6096
|
designName
|
|
@@ -6090,7 +6109,7 @@ const it = M`
|
|
|
6090
6109
|
additionalExternalVariantId
|
|
6091
6110
|
}
|
|
6092
6111
|
}
|
|
6093
|
-
`, ea =
|
|
6112
|
+
`, ea = F`
|
|
6094
6113
|
${it}
|
|
6095
6114
|
mutation CreateDesign(
|
|
6096
6115
|
$name: String!
|
|
@@ -6122,7 +6141,7 @@ const it = M`
|
|
|
6122
6141
|
}
|
|
6123
6142
|
}
|
|
6124
6143
|
}
|
|
6125
|
-
`, ta =
|
|
6144
|
+
`, ta = F`
|
|
6126
6145
|
${it}
|
|
6127
6146
|
mutation CreateDesigns($inputs: [DesignCreateInput]!) {
|
|
6128
6147
|
designCreateMany(inputs: $inputs) {
|
|
@@ -6138,7 +6157,7 @@ const it = M`
|
|
|
6138
6157
|
}
|
|
6139
6158
|
`, na = async (c) => {
|
|
6140
6159
|
var e;
|
|
6141
|
-
return (e = (await
|
|
6160
|
+
return (e = (await P.getShadowGraphqlClient().mutate({
|
|
6142
6161
|
mutation: ea,
|
|
6143
6162
|
errorPolicy: "all",
|
|
6144
6163
|
fetchPolicy: "no-cache",
|
|
@@ -6155,7 +6174,7 @@ const it = M`
|
|
|
6155
6174
|
})).data) == null ? void 0 : e.designCreate;
|
|
6156
6175
|
}, aa = async (c) => {
|
|
6157
6176
|
var e;
|
|
6158
|
-
return (e = (await
|
|
6177
|
+
return (e = (await P.getShadowGraphqlClient().mutate({
|
|
6159
6178
|
mutation: ta,
|
|
6160
6179
|
errorPolicy: "all",
|
|
6161
6180
|
fetchPolicy: "no-cache",
|
|
@@ -6264,13 +6283,13 @@ const it = M`
|
|
|
6264
6283
|
};
|
|
6265
6284
|
return a && (d.metadata = a), t && (d.selectedVariants = t), n && (d.sku = n), d;
|
|
6266
6285
|
}, ot = async (c, A, e, t, n, a, i, s, o, r) => {
|
|
6267
|
-
var
|
|
6286
|
+
var M;
|
|
6268
6287
|
await (async () => {
|
|
6269
6288
|
var T;
|
|
6270
6289
|
if (r !== void 0)
|
|
6271
6290
|
return r;
|
|
6272
6291
|
await c.outstandingRequestsPromise();
|
|
6273
|
-
const S = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id),
|
|
6292
|
+
const S = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), N = await P.getShadowGraphqlClient().query({
|
|
6274
6293
|
query: ze,
|
|
6275
6294
|
variables: { ids: [n.id] },
|
|
6276
6295
|
fetchPolicy: "no-cache",
|
|
@@ -6278,17 +6297,17 @@ const it = M`
|
|
|
6278
6297
|
context: {
|
|
6279
6298
|
transactionOwnerId: S
|
|
6280
6299
|
}
|
|
6281
|
-
}), H = (T =
|
|
6282
|
-
return
|
|
6283
|
-
|
|
6300
|
+
}), H = (T = N.data) == null ? void 0 : T.transactions[0].workflowState;
|
|
6301
|
+
return N.errors ? (N.errors.forEach((b) => {
|
|
6302
|
+
N.errors && console.log("Server Error:", b.message);
|
|
6284
6303
|
}), null) : H ?? null;
|
|
6285
6304
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(t())), await c.updateStateWithServerImmediate(t), console.log("Server state is undefined @ Workflow completion"));
|
|
6286
|
-
const l = c.getPreviewService(), d = (
|
|
6305
|
+
const l = c.getPreviewService(), d = (M = A == null ? void 0 : A.finalizeStepConfig) == null ? void 0 : M.lookAtAnimation, w = l && A.showModelOnFinishStep && !!d, h = o && XA(o, A, !0), E = o && XA(o, A, !1), Q = async (y) => {
|
|
6287
6306
|
const S = {};
|
|
6288
6307
|
let Y = 0;
|
|
6289
6308
|
if (Object.keys(a).length > 0)
|
|
6290
|
-
for (const
|
|
6291
|
-
const H = a[
|
|
6309
|
+
for (const N of Object.keys(a)) {
|
|
6310
|
+
const H = a[N], T = A.steps.find((b) => b.stepName === N);
|
|
6292
6311
|
for (let b = 0; b < H.selections.length; ++b) {
|
|
6293
6312
|
const V = H.selections[b];
|
|
6294
6313
|
if (T && (!y || T.option && (T.option.variants || []).length > 1 && !T.data.hideSelectionInCart && !T.data.hideSelectionsInCart)) {
|
|
@@ -6311,12 +6330,12 @@ const it = M`
|
|
|
6311
6330
|
return [S, Y];
|
|
6312
6331
|
}, [C] = await Q(!0), f = Object.fromEntries(
|
|
6313
6332
|
Object.keys(C).map((y) => [y, C[y].map((S) => S.id)])
|
|
6314
|
-
), [u] = await Q(!1),
|
|
6333
|
+
), [u] = await Q(!1), I = Object.fromEntries(
|
|
6315
6334
|
Object.keys(u).map((y) => [
|
|
6316
6335
|
y,
|
|
6317
6336
|
u[y].map((S) => S.id)
|
|
6318
6337
|
])
|
|
6319
|
-
),
|
|
6338
|
+
), m = await s(w, n.id);
|
|
6320
6339
|
return {
|
|
6321
6340
|
designDetails: (() => {
|
|
6322
6341
|
const y = {
|
|
@@ -6328,18 +6347,18 @@ const it = M`
|
|
|
6328
6347
|
workflowId: A.id,
|
|
6329
6348
|
transactionId: n.id,
|
|
6330
6349
|
useThreeDimPreview: !!w,
|
|
6331
|
-
previewImage:
|
|
6350
|
+
previewImage: m
|
|
6332
6351
|
};
|
|
6333
6352
|
if (E) {
|
|
6334
6353
|
const S = [];
|
|
6335
|
-
for (const [Y,
|
|
6336
|
-
S.push({ key: Y, value:
|
|
6354
|
+
for (const [Y, N] of Object.entries(E))
|
|
6355
|
+
S.push({ key: Y, value: N });
|
|
6337
6356
|
y.metadata = S;
|
|
6338
6357
|
}
|
|
6339
6358
|
if (f) {
|
|
6340
6359
|
const S = [];
|
|
6341
|
-
for (const [Y,
|
|
6342
|
-
S.push({ key: Y, ids:
|
|
6360
|
+
for (const [Y, N] of Object.entries(I))
|
|
6361
|
+
S.push({ key: Y, ids: N });
|
|
6343
6362
|
y.selectedVariants = S;
|
|
6344
6363
|
}
|
|
6345
6364
|
return y;
|
|
@@ -6385,7 +6404,7 @@ const it = M`
|
|
|
6385
6404
|
);
|
|
6386
6405
|
const n = await (async () => {
|
|
6387
6406
|
var r;
|
|
6388
|
-
const o = await
|
|
6407
|
+
const o = await P.getShadowGraphqlClient().query({
|
|
6389
6408
|
query: ze,
|
|
6390
6409
|
variables: { ids: c.map((g) => g.transaction.id) },
|
|
6391
6410
|
fetchPolicy: "no-cache",
|
|
@@ -6497,7 +6516,7 @@ class ra {
|
|
|
6497
6516
|
throw new k("Unexpected storage method requested");
|
|
6498
6517
|
}
|
|
6499
6518
|
}
|
|
6500
|
-
const LA = new ra(), ca =
|
|
6519
|
+
const LA = new ra(), ca = F`
|
|
6501
6520
|
mutation AddTransactionStakeholder($id: String!, $type: String!, $details: CustomerDetailsInput!) {
|
|
6502
6521
|
transactionAddStakeholder(id: $id, details: $details, type: $type) {
|
|
6503
6522
|
id
|
|
@@ -6592,8 +6611,8 @@ class EA {
|
|
|
6592
6611
|
let a = 2048;
|
|
6593
6612
|
e && e <= 2048 && (a = e);
|
|
6594
6613
|
const i = DA(a, a), s = this.commandContext.getAllLayouts(), o = t.defaultPreviewPanelIndex || 0, r = t.panels[o], g = s.find((u) => {
|
|
6595
|
-
var
|
|
6596
|
-
return ((
|
|
6614
|
+
var I;
|
|
6615
|
+
return ((I = u.layoutState) == null ? void 0 : I.layout.panelId) === (r == null ? void 0 : r.name);
|
|
6597
6616
|
}) || s[0], B = g.layoutState.layout.previewRegion ? {
|
|
6598
6617
|
x: g.layoutState.layout.previewRegion.left,
|
|
6599
6618
|
y: g.layoutState.layout.previewRegion.top,
|
|
@@ -6706,7 +6725,7 @@ class EA {
|
|
|
6706
6725
|
}
|
|
6707
6726
|
async assignCustomerDetails(A) {
|
|
6708
6727
|
var i, s, o;
|
|
6709
|
-
const t = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(this.getWorkflowManager().getTransaction().id), a = (o = (s = (i = (await
|
|
6728
|
+
const t = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(this.getWorkflowManager().getTransaction().id), a = (o = (s = (i = (await P.getShadowGraphqlClient().mutate({
|
|
6710
6729
|
mutation: ca,
|
|
6711
6730
|
variables: {
|
|
6712
6731
|
id: this.getWorkflowManager().getTransaction().id,
|
|
@@ -6760,7 +6779,7 @@ class EA {
|
|
|
6760
6779
|
const A = HA(this.getCommandContext().getState());
|
|
6761
6780
|
if (!A)
|
|
6762
6781
|
throw new k("Internal state is undefined! Cannot copy experience!");
|
|
6763
|
-
const e = JSON.stringify(A.transaction), t = this.getWorkflowManager().getWorkflow(), n = new
|
|
6782
|
+
const e = JSON.stringify(A.transaction), t = this.getWorkflowManager().getWorkflow(), n = new ui({}), a = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
|
|
6764
6783
|
if (!a)
|
|
6765
6784
|
throw new k("Integration product id is undefined!");
|
|
6766
6785
|
return await n.initFromIntegrationProduct(a), await n.getWorkflowExperience(t.id, e, void 0);
|
|
@@ -6900,17 +6919,17 @@ const ga = [
|
|
|
6900
6919
|
return console.error(s), [];
|
|
6901
6920
|
}
|
|
6902
6921
|
}, da = async (c, A, e, t) => {
|
|
6903
|
-
var
|
|
6922
|
+
var I, m;
|
|
6904
6923
|
const n = e.data, a = t.option;
|
|
6905
6924
|
if (!a)
|
|
6906
6925
|
return console.error(`No option for step ${t.stepName}.`), [];
|
|
6907
|
-
const i = ((
|
|
6926
|
+
const i = ((I = a.variants) == null ? void 0 : I.find((p) => p.id === n.illustrationVariantId)) || NA(a);
|
|
6908
6927
|
if (!i)
|
|
6909
6928
|
return console.error(`No variant with ID: ${n.illustrationVariantId}`), [];
|
|
6910
6929
|
if (!i.asset)
|
|
6911
6930
|
return console.error(`No asset for variant with ID: ${n.illustrationVariantId}`), [];
|
|
6912
6931
|
A[t.stepName] = { selectedVariants: [i] };
|
|
6913
|
-
const s = (
|
|
6932
|
+
const s = (m = i.asset) == null ? void 0 : m.fileLink;
|
|
6914
6933
|
if (!s)
|
|
6915
6934
|
return console.error(`No asset link for variant with ID: ${n.illustrationVariantId}`), [];
|
|
6916
6935
|
const o = await q(s, !0), r = /<svg.*?<\/svg>/s, g = o.match(r) || [], B = (g == null ? void 0 : g.length) > 0 ? g[0] : "", w = Ne().parseFromString(B, "image/svg+xml").firstElementChild;
|
|
@@ -6920,29 +6939,29 @@ const ga = [
|
|
|
6920
6939
|
const h = {};
|
|
6921
6940
|
Pt(w, (p) => {
|
|
6922
6941
|
ga.includes(p.tagName) && !p.attributes.getNamedItem("fill") && p.setAttribute("fill", "#000000");
|
|
6923
|
-
const
|
|
6924
|
-
if (
|
|
6925
|
-
const S =
|
|
6926
|
-
p.classList.add(
|
|
6942
|
+
const M = p.attributes.getNamedItem("fill");
|
|
6943
|
+
if (M && M.value !== "none") {
|
|
6944
|
+
const S = M.value, N = `spiff-fill-${S.replace(/\W/g, "")}`;
|
|
6945
|
+
p.classList.add(N), h[N] = { browserValue: S };
|
|
6927
6946
|
}
|
|
6928
6947
|
const y = p.attributes.getNamedItem("stroke");
|
|
6929
6948
|
if (y && y.value !== "none") {
|
|
6930
|
-
const S = y.value,
|
|
6931
|
-
p.classList.add(
|
|
6949
|
+
const S = y.value, N = `spiff-stroke-${S.replace(/\W/g, "")}`;
|
|
6950
|
+
p.classList.add(N), h[N] = { browserValue: S };
|
|
6932
6951
|
}
|
|
6933
6952
|
});
|
|
6934
6953
|
const Q = Re().serializeToString(w), C = n.colors;
|
|
6935
6954
|
if (C) {
|
|
6936
|
-
for (const [p,
|
|
6955
|
+
for (const [p, M] of Object.entries(h))
|
|
6937
6956
|
for (const y of Object.keys(C))
|
|
6938
|
-
if (
|
|
6957
|
+
if (M.browserValue === y) {
|
|
6939
6958
|
h[p] = { browserValue: C[y] };
|
|
6940
6959
|
break;
|
|
6941
6960
|
}
|
|
6942
6961
|
}
|
|
6943
6962
|
const f = (p) => {
|
|
6944
|
-
const
|
|
6945
|
-
if (!
|
|
6963
|
+
const M = c.find((S) => S.panelId === p.panelId);
|
|
6964
|
+
if (!M)
|
|
6946
6965
|
throw new z(p);
|
|
6947
6966
|
const y = J();
|
|
6948
6967
|
return new L(
|
|
@@ -6960,7 +6979,7 @@ const ga = [
|
|
|
6960
6979
|
layerIndex: p.layerIndex,
|
|
6961
6980
|
immutable: p.immutable
|
|
6962
6981
|
},
|
|
6963
|
-
|
|
6982
|
+
M
|
|
6964
6983
|
);
|
|
6965
6984
|
}, u = t.data.regions;
|
|
6966
6985
|
try {
|
|
@@ -7478,7 +7497,7 @@ class Da extends je {
|
|
|
7478
7497
|
B.resize(s, o), await B.render(), this.onRender();
|
|
7479
7498
|
}
|
|
7480
7499
|
}
|
|
7481
|
-
const
|
|
7500
|
+
const Ri = (c, A) => {
|
|
7482
7501
|
const e = [];
|
|
7483
7502
|
return c.forEach((t) => {
|
|
7484
7503
|
const n = A.steps.find((a) => a.stepName === t.stepName);
|
|
@@ -7489,7 +7508,7 @@ const Hi = (c, A) => {
|
|
|
7489
7508
|
}
|
|
7490
7509
|
});
|
|
7491
7510
|
}), e;
|
|
7492
|
-
},
|
|
7511
|
+
}, Ui = async (c, A, e, t) => {
|
|
7493
7512
|
let n = {
|
|
7494
7513
|
serializableWorkflow: { steps: [] },
|
|
7495
7514
|
layouts: {}
|
|
@@ -7497,7 +7516,7 @@ const Hi = (c, A) => {
|
|
|
7497
7516
|
n = new G(e.map((o) => new Nt(o))).apply(n);
|
|
7498
7517
|
const i = await ma(c, A, e, t);
|
|
7499
7518
|
return new G(i).apply(n);
|
|
7500
|
-
}, Fa =
|
|
7519
|
+
}, Fa = F`
|
|
7501
7520
|
${nA}
|
|
7502
7521
|
fragment ProductFields on Product {
|
|
7503
7522
|
id
|
|
@@ -7539,7 +7558,7 @@ const Hi = (c, A) => {
|
|
|
7539
7558
|
name
|
|
7540
7559
|
}
|
|
7541
7560
|
}
|
|
7542
|
-
`, Ma =
|
|
7561
|
+
`, Ma = F`
|
|
7543
7562
|
${Fa}
|
|
7544
7563
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
|
7545
7564
|
id
|
|
@@ -7549,7 +7568,7 @@ const Hi = (c, A) => {
|
|
|
7549
7568
|
...ProductFields
|
|
7550
7569
|
}
|
|
7551
7570
|
}
|
|
7552
|
-
`, rt =
|
|
7571
|
+
`, rt = F`
|
|
7553
7572
|
${Ma}
|
|
7554
7573
|
fragment ProductCollectionFields on ProductCollection {
|
|
7555
7574
|
id
|
|
@@ -7596,7 +7615,7 @@ const Hi = (c, A) => {
|
|
|
7596
7615
|
}
|
|
7597
7616
|
}
|
|
7598
7617
|
}
|
|
7599
|
-
`, ya =
|
|
7618
|
+
`, ya = F`
|
|
7600
7619
|
${rt}
|
|
7601
7620
|
query GetBundle($id: String!) {
|
|
7602
7621
|
bundles(ids: [$id]) {
|
|
@@ -7618,7 +7637,7 @@ const Hi = (c, A) => {
|
|
|
7618
7637
|
}
|
|
7619
7638
|
}
|
|
7620
7639
|
}
|
|
7621
|
-
`, Ya =
|
|
7640
|
+
`, Ya = F`
|
|
7622
7641
|
query GetBundleStakeholders($id: String!) {
|
|
7623
7642
|
bundles(ids: [$id]) {
|
|
7624
7643
|
id
|
|
@@ -7638,7 +7657,7 @@ const Hi = (c, A) => {
|
|
|
7638
7657
|
}
|
|
7639
7658
|
}
|
|
7640
7659
|
}
|
|
7641
|
-
`, Sa =
|
|
7660
|
+
`, Sa = F`
|
|
7642
7661
|
query GetBundlesForCustomer($id: String!) {
|
|
7643
7662
|
customers(ids: [$id]) {
|
|
7644
7663
|
bundleStakeholders {
|
|
@@ -7659,7 +7678,7 @@ const Hi = (c, A) => {
|
|
|
7659
7678
|
}
|
|
7660
7679
|
}
|
|
7661
7680
|
}
|
|
7662
|
-
`, xa =
|
|
7681
|
+
`, xa = F`
|
|
7663
7682
|
${rt}
|
|
7664
7683
|
mutation CreateBundle($collectionId: String, $initialMetadata: [MetadataInput!]) {
|
|
7665
7684
|
bundleCreate(collectionId: $collectionId, metadata: $initialMetadata) {
|
|
@@ -7678,25 +7697,25 @@ const Hi = (c, A) => {
|
|
|
7678
7697
|
}
|
|
7679
7698
|
}
|
|
7680
7699
|
}
|
|
7681
|
-
`, Pa =
|
|
7700
|
+
`, Pa = F`
|
|
7682
7701
|
mutation UpdateBundle($id: String!, $name: String, $metadata: [MetadataInput!], $bundleStateData: String) {
|
|
7683
7702
|
bundleUpdate(id: $id, name: $name, metadata: $metadata, bundleStateData: $bundleStateData) {
|
|
7684
7703
|
id
|
|
7685
7704
|
}
|
|
7686
7705
|
}
|
|
7687
|
-
`, Na =
|
|
7706
|
+
`, Na = F`
|
|
7688
7707
|
mutation BundleAddTransaction($id: String!, $transactionId: String!) {
|
|
7689
7708
|
bundleAddTransaction(id: $id, transactionId: $transactionId) {
|
|
7690
7709
|
id
|
|
7691
7710
|
}
|
|
7692
7711
|
}
|
|
7693
|
-
`, Ha =
|
|
7712
|
+
`, Ha = F`
|
|
7694
7713
|
mutation BundleAddTransactions($id: String!, $transactionIds: [String!]!, $transactionOwnerIds: [String!]) {
|
|
7695
7714
|
bundleAddTransactions(id: $id, transactionIds: $transactionIds, transactionOwnerIds: $transactionOwnerIds) {
|
|
7696
7715
|
id
|
|
7697
7716
|
}
|
|
7698
7717
|
}
|
|
7699
|
-
`, Ra =
|
|
7718
|
+
`, Ra = F`
|
|
7700
7719
|
mutation BundleRemoveTransaction(
|
|
7701
7720
|
$id: String!
|
|
7702
7721
|
$transactionId: String!
|
|
@@ -7711,7 +7730,7 @@ const Hi = (c, A) => {
|
|
|
7711
7730
|
id
|
|
7712
7731
|
}
|
|
7713
7732
|
}
|
|
7714
|
-
`, Ua =
|
|
7733
|
+
`, Ua = F`
|
|
7715
7734
|
mutation BundleRemoveTransactions(
|
|
7716
7735
|
$id: String!
|
|
7717
7736
|
$transactionIds: [String!]!
|
|
@@ -7726,7 +7745,7 @@ const Hi = (c, A) => {
|
|
|
7726
7745
|
id
|
|
7727
7746
|
}
|
|
7728
7747
|
}
|
|
7729
|
-
`, Ga =
|
|
7748
|
+
`, Ga = F`
|
|
7730
7749
|
mutation BundleAddStakeholder($id: String!, $details: CustomerDetailsInput!, $type: String!) {
|
|
7731
7750
|
bundleAddStakeholder(id: $id, details: $details, type: $type) {
|
|
7732
7751
|
id
|
|
@@ -7746,7 +7765,7 @@ const Hi = (c, A) => {
|
|
|
7746
7765
|
}
|
|
7747
7766
|
}
|
|
7748
7767
|
}
|
|
7749
|
-
`, va =
|
|
7768
|
+
`, va = F`
|
|
7750
7769
|
mutation BundleUpdateStakeholders($id: String!, $input: [BundleStakeholderInput!]!) {
|
|
7751
7770
|
bundleUpdateStakeholders(id: $id, input: $input) {
|
|
7752
7771
|
id
|
|
@@ -7766,7 +7785,7 @@ const Hi = (c, A) => {
|
|
|
7766
7785
|
}
|
|
7767
7786
|
}
|
|
7768
7787
|
}
|
|
7769
|
-
`, ka =
|
|
7788
|
+
`, ka = F`
|
|
7770
7789
|
mutation BundleUpdateTransactionOrder($id: String!, $transactionIds: [String!]!) {
|
|
7771
7790
|
bundleUpdateTransactionOrder(id: $id, transactionIds: $transactionIds) {
|
|
7772
7791
|
id
|
|
@@ -8018,7 +8037,7 @@ class Ta extends ct {
|
|
|
8018
8037
|
return this.getSharedSteps()[0].getCustomColor();
|
|
8019
8038
|
}
|
|
8020
8039
|
}
|
|
8021
|
-
const Oa =
|
|
8040
|
+
const Oa = F`
|
|
8022
8041
|
mutation CreateGlobalPropertyState($bundleId: String!) {
|
|
8023
8042
|
globalPropertyStateCreate(bundleId: $bundleId) {
|
|
8024
8043
|
id
|
|
@@ -8028,7 +8047,7 @@ const Oa = M`
|
|
|
8028
8047
|
}
|
|
8029
8048
|
}
|
|
8030
8049
|
}
|
|
8031
|
-
`, za =
|
|
8050
|
+
`, za = F`
|
|
8032
8051
|
mutation UpdateGlobalPropertyState($id: String!, $aspects: [GlobalPropertyStateAspectInput]!) {
|
|
8033
8052
|
globalPropertyStateUpdate(id: $id, aspects: $aspects) {
|
|
8034
8053
|
id
|
|
@@ -8038,7 +8057,7 @@ const Oa = M`
|
|
|
8038
8057
|
}
|
|
8039
8058
|
}
|
|
8040
8059
|
}
|
|
8041
|
-
`, Ka =
|
|
8060
|
+
`, Ka = F`
|
|
8042
8061
|
query GetGlobalPropertyState($bundleId: String!) {
|
|
8043
8062
|
globalPropertyState(bundleId: $bundleId) {
|
|
8044
8063
|
id
|
|
@@ -8078,7 +8097,7 @@ class ja {
|
|
|
8078
8097
|
var e;
|
|
8079
8098
|
if (!this.globalPropertyState)
|
|
8080
8099
|
throw new Error("Global property state not initialized");
|
|
8081
|
-
const A = await
|
|
8100
|
+
const A = await P.getShadowGraphqlClient().mutate({
|
|
8082
8101
|
mutation: za,
|
|
8083
8102
|
variables: {
|
|
8084
8103
|
id: this.globalPropertyState.id,
|
|
@@ -8095,7 +8114,7 @@ class ja {
|
|
|
8095
8114
|
}
|
|
8096
8115
|
async getOrCreateGlobalPropertyState() {
|
|
8097
8116
|
var t;
|
|
8098
|
-
const A = await
|
|
8117
|
+
const A = await P.getShadowGraphqlClient().query({
|
|
8099
8118
|
query: Ka,
|
|
8100
8119
|
errorPolicy: "all",
|
|
8101
8120
|
fetchPolicy: "no-cache",
|
|
@@ -8108,7 +8127,7 @@ class ja {
|
|
|
8108
8127
|
});
|
|
8109
8128
|
if (A.data.globalPropertyState && A.data.globalPropertyState.id)
|
|
8110
8129
|
return A.data.globalPropertyState;
|
|
8111
|
-
const e = await
|
|
8130
|
+
const e = await P.getShadowGraphqlClient().mutate({
|
|
8112
8131
|
mutation: Oa,
|
|
8113
8132
|
variables: {
|
|
8114
8133
|
bundleId: this.bundleId
|
|
@@ -8491,7 +8510,7 @@ class pe {
|
|
|
8491
8510
|
"Unable to add transaction to bundle - Already Exists: " + t.filter((i) => !!i).map((i) => i == null ? void 0 : i.getWorkflowManager().getTransaction().id).join(", ")
|
|
8492
8511
|
);
|
|
8493
8512
|
const n = x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), a = e.map((i) => n.get(i));
|
|
8494
|
-
await
|
|
8513
|
+
await P.getShadowGraphqlClient().mutate({
|
|
8495
8514
|
mutation: Ha,
|
|
8496
8515
|
variables: {
|
|
8497
8516
|
id: this.id,
|
|
@@ -8520,7 +8539,7 @@ class pe {
|
|
|
8520
8539
|
))
|
|
8521
8540
|
throw new Error("Unable to add transaction to bundle - Already Exists!");
|
|
8522
8541
|
const i = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(t);
|
|
8523
|
-
await
|
|
8542
|
+
await P.getShadowGraphqlClient().mutate({
|
|
8524
8543
|
mutation: Na,
|
|
8525
8544
|
variables: {
|
|
8526
8545
|
id: this.id,
|
|
@@ -8553,7 +8572,7 @@ class pe {
|
|
|
8553
8572
|
const n = this.workflowExperiences.find(
|
|
8554
8573
|
(a) => a.getWorkflowManager().getTransaction().id === e.id
|
|
8555
8574
|
);
|
|
8556
|
-
this.previewService && n.getWorkflowManager().ejectFromPreviewService(), this.bundleStateManager.removeStateForTransaction(e.id), await
|
|
8575
|
+
this.previewService && n.getWorkflowManager().ejectFromPreviewService(), this.bundleStateManager.removeStateForTransaction(e.id), await P.getShadowGraphqlClient().mutate({
|
|
8557
8576
|
mutation: Ra,
|
|
8558
8577
|
variables: {
|
|
8559
8578
|
id: this.id,
|
|
@@ -8583,7 +8602,7 @@ class pe {
|
|
|
8583
8602
|
1
|
|
8584
8603
|
)[0]
|
|
8585
8604
|
);
|
|
8586
|
-
this.previewService && t.forEach((n) => n.getWorkflowManager().ejectFromPreviewService()), A.forEach((n) => this.bundleStateManager.removeStateForTransaction(n.id)), await
|
|
8605
|
+
this.previewService && t.forEach((n) => n.getWorkflowManager().ejectFromPreviewService()), A.forEach((n) => this.bundleStateManager.removeStateForTransaction(n.id)), await P.getShadowGraphqlClient().mutate({
|
|
8587
8606
|
mutation: Ua,
|
|
8588
8607
|
variables: {
|
|
8589
8608
|
id: this.id,
|
|
@@ -8644,7 +8663,7 @@ class pe {
|
|
|
8644
8663
|
}
|
|
8645
8664
|
async addStakeholder(A, e) {
|
|
8646
8665
|
var a;
|
|
8647
|
-
const t = await
|
|
8666
|
+
const t = await P.getShadowGraphqlClient().mutate({
|
|
8648
8667
|
mutation: Ga,
|
|
8649
8668
|
variables: {
|
|
8650
8669
|
id: this.id,
|
|
@@ -8662,7 +8681,7 @@ class pe {
|
|
|
8662
8681
|
}
|
|
8663
8682
|
async updateStakeholders(A) {
|
|
8664
8683
|
var n;
|
|
8665
|
-
const e = await
|
|
8684
|
+
const e = await P.getShadowGraphqlClient().mutate({
|
|
8666
8685
|
mutation: va,
|
|
8667
8686
|
variables: {
|
|
8668
8687
|
id: this.id,
|
|
@@ -8678,7 +8697,7 @@ class pe {
|
|
|
8678
8697
|
this.storeStakeholderCustomers(t);
|
|
8679
8698
|
}
|
|
8680
8699
|
async getAllStakeholders() {
|
|
8681
|
-
const A = await
|
|
8700
|
+
const A = await P.getShadowGraphqlClient().query({
|
|
8682
8701
|
query: Ya,
|
|
8683
8702
|
errorPolicy: "all",
|
|
8684
8703
|
variables: {
|
|
@@ -8778,7 +8797,7 @@ class pe {
|
|
|
8778
8797
|
}
|
|
8779
8798
|
async updateBundle() {
|
|
8780
8799
|
var e;
|
|
8781
|
-
if (!((e = (await
|
|
8800
|
+
if (!((e = (await P.getShadowGraphqlClient().mutate({
|
|
8782
8801
|
mutation: Pa,
|
|
8783
8802
|
variables: {
|
|
8784
8803
|
id: this.id,
|
|
@@ -8793,7 +8812,7 @@ class pe {
|
|
|
8793
8812
|
throw new Error("Bundle not found!");
|
|
8794
8813
|
}
|
|
8795
8814
|
async updateTransactionOrder() {
|
|
8796
|
-
await
|
|
8815
|
+
await P.getShadowGraphqlClient().mutate({
|
|
8797
8816
|
mutation: ka,
|
|
8798
8817
|
variables: {
|
|
8799
8818
|
id: this.id,
|
|
@@ -8827,7 +8846,7 @@ class pe {
|
|
|
8827
8846
|
);
|
|
8828
8847
|
}
|
|
8829
8848
|
}
|
|
8830
|
-
const $a =
|
|
8849
|
+
const $a = F`
|
|
8831
8850
|
mutation processFlowCreate($processFlowId: String!, $inputs: [String]!) {
|
|
8832
8851
|
processExecutionCreate(processFlowId: $processFlowId, inputs: $inputs) {
|
|
8833
8852
|
id
|
|
@@ -8844,7 +8863,7 @@ class _a {
|
|
|
8844
8863
|
*/
|
|
8845
8864
|
async execute(A, e, t) {
|
|
8846
8865
|
var B, l, d;
|
|
8847
|
-
const a = (l = (B = (await
|
|
8866
|
+
const a = (l = (B = (await P.getShadowGraphqlClient().mutate({
|
|
8848
8867
|
mutation: $a,
|
|
8849
8868
|
variables: {
|
|
8850
8869
|
processFlowId: A,
|
|
@@ -8860,8 +8879,8 @@ class _a {
|
|
|
8860
8879
|
}
|
|
8861
8880
|
let s = !1, o = 0, r, g;
|
|
8862
8881
|
for (; !s; ) {
|
|
8863
|
-
r = await
|
|
8864
|
-
query:
|
|
8882
|
+
r = await P.getShadowGraphqlClient().query({
|
|
8883
|
+
query: F`
|
|
8865
8884
|
query getProcessFlowExecution($ids: [String]!) {
|
|
8866
8885
|
processExecutions(ids: $ids) {
|
|
8867
8886
|
id
|
|
@@ -9029,7 +9048,7 @@ class fe {
|
|
|
9029
9048
|
return new qA(A[0]);
|
|
9030
9049
|
}
|
|
9031
9050
|
}
|
|
9032
|
-
const ni =
|
|
9051
|
+
const ni = F`
|
|
9033
9052
|
fragment RegionFields on Region {
|
|
9034
9053
|
width
|
|
9035
9054
|
top
|
|
@@ -9047,7 +9066,7 @@ const ni = M`
|
|
|
9047
9066
|
height
|
|
9048
9067
|
}
|
|
9049
9068
|
}
|
|
9050
|
-
`, ai =
|
|
9069
|
+
`, ai = F`
|
|
9051
9070
|
fragment LookAtAnimationFields on LookAtAnimation {
|
|
9052
9071
|
latDeg
|
|
9053
9072
|
lonDeg
|
|
@@ -9058,7 +9077,7 @@ const ni = M`
|
|
|
9058
9077
|
z
|
|
9059
9078
|
}
|
|
9060
9079
|
}
|
|
9061
|
-
`, ii =
|
|
9080
|
+
`, ii = F`
|
|
9062
9081
|
fragment RenderingPipelineConfigurationFields on RenderingPipelineConfiguration {
|
|
9063
9082
|
antiAliasing {
|
|
9064
9083
|
samples
|
|
@@ -9142,14 +9161,14 @@ const ni = M`
|
|
|
9142
9161
|
weight
|
|
9143
9162
|
}
|
|
9144
9163
|
}
|
|
9145
|
-
`, si =
|
|
9164
|
+
`, si = F`
|
|
9146
9165
|
fragment ModelAnimationFields on ModelAnimation {
|
|
9147
9166
|
from
|
|
9148
9167
|
to
|
|
9149
9168
|
loop
|
|
9150
9169
|
name
|
|
9151
9170
|
}
|
|
9152
|
-
`, oi = (c) =>
|
|
9171
|
+
`, oi = (c) => F`
|
|
9153
9172
|
${GA(c)}
|
|
9154
9173
|
${ne}
|
|
9155
9174
|
${Oe}
|
|
@@ -9534,7 +9553,7 @@ const ni = M`
|
|
|
9534
9553
|
}
|
|
9535
9554
|
}
|
|
9536
9555
|
}
|
|
9537
|
-
`, ri =
|
|
9556
|
+
`, ri = F`
|
|
9538
9557
|
query GetTransactionForPartner($id: String!) {
|
|
9539
9558
|
transactions(ids: [$id]) {
|
|
9540
9559
|
id
|
|
@@ -9551,7 +9570,25 @@ const ni = M`
|
|
|
9551
9570
|
}
|
|
9552
9571
|
}
|
|
9553
9572
|
}
|
|
9554
|
-
`, ci =
|
|
9573
|
+
`, ci = F`
|
|
9574
|
+
query GetIntegrationWithPartnerAndLogo {
|
|
9575
|
+
currentIntegration {
|
|
9576
|
+
id
|
|
9577
|
+
logo
|
|
9578
|
+
theme {
|
|
9579
|
+
id
|
|
9580
|
+
configuration
|
|
9581
|
+
primaryColor
|
|
9582
|
+
secondaryColor
|
|
9583
|
+
textColor
|
|
9584
|
+
}
|
|
9585
|
+
partner {
|
|
9586
|
+
id
|
|
9587
|
+
name
|
|
9588
|
+
}
|
|
9589
|
+
}
|
|
9590
|
+
}
|
|
9591
|
+
`, gi = F`
|
|
9555
9592
|
${GA(!1)}
|
|
9556
9593
|
query GetWorkflowForTheme($id: String!) {
|
|
9557
9594
|
workflow(id: $id) {
|
|
@@ -9573,7 +9610,7 @@ const ni = M`
|
|
|
9573
9610
|
}
|
|
9574
9611
|
}
|
|
9575
9612
|
}
|
|
9576
|
-
`,
|
|
9613
|
+
`, li = F`
|
|
9577
9614
|
query GetCustomer($emailAddress: String!) {
|
|
9578
9615
|
customer(emailAddress: $emailAddress) {
|
|
9579
9616
|
id
|
|
@@ -9583,7 +9620,7 @@ const ni = M`
|
|
|
9583
9620
|
}
|
|
9584
9621
|
}
|
|
9585
9622
|
}
|
|
9586
|
-
`,
|
|
9623
|
+
`, Bi = F`
|
|
9587
9624
|
mutation CustomerCreate($details: CustomerDetailsInput!) {
|
|
9588
9625
|
customerCreate(details: $details) {
|
|
9589
9626
|
id
|
|
@@ -9593,7 +9630,7 @@ const ni = M`
|
|
|
9593
9630
|
}
|
|
9594
9631
|
}
|
|
9595
9632
|
}
|
|
9596
|
-
`,
|
|
9633
|
+
`, di = F`
|
|
9597
9634
|
mutation CustomerAuthenticate($loginToken: String!) {
|
|
9598
9635
|
customerAuthenticate(loginToken: $loginToken) {
|
|
9599
9636
|
id
|
|
@@ -9620,11 +9657,11 @@ const ni = M`
|
|
|
9620
9657
|
}
|
|
9621
9658
|
}
|
|
9622
9659
|
}
|
|
9623
|
-
`,
|
|
9660
|
+
`, wi = F`
|
|
9624
9661
|
mutation CustomerGenerateVerificationCode($emailAddress: String!) {
|
|
9625
9662
|
customerGenerateVerificationCode(emailAddress: $emailAddress)
|
|
9626
9663
|
}
|
|
9627
|
-
`,
|
|
9664
|
+
`, Ei = F`
|
|
9628
9665
|
mutation CustomerVerifyCode($emailAddress: String!, $verificationCode: String!) {
|
|
9629
9666
|
customerVerifyCode(emailAddress: $emailAddress, verificationCode: $verificationCode) {
|
|
9630
9667
|
id
|
|
@@ -9668,9 +9705,9 @@ const ni = M`
|
|
|
9668
9705
|
(A = i.fontData) != null && A.assetUrl && await Ae(i.fontData.assetUrl);
|
|
9669
9706
|
}
|
|
9670
9707
|
}
|
|
9671
|
-
},
|
|
9708
|
+
}, hi = async (c, A) => {
|
|
9672
9709
|
var n;
|
|
9673
|
-
const e = await
|
|
9710
|
+
const e = await P.getShadowGraphqlClient().query({
|
|
9674
9711
|
query: oi(((n = A == null ? void 0 : A.assets) == null ? void 0 : n.metadata) || !1),
|
|
9675
9712
|
errorPolicy: "all",
|
|
9676
9713
|
fetchPolicy: "no-cache",
|
|
@@ -9688,7 +9725,7 @@ const ni = M`
|
|
|
9688
9725
|
}), cA.set({ id: i.option.id }, Promise.resolve(i.option)));
|
|
9689
9726
|
});
|
|
9690
9727
|
}), t;
|
|
9691
|
-
},
|
|
9728
|
+
}, Ci = async (c, A) => {
|
|
9692
9729
|
const t = (await A).find((n) => n.id === c);
|
|
9693
9730
|
if (!t)
|
|
9694
9731
|
throw new Error(`Workflow not found: ${c}`);
|
|
@@ -9697,11 +9734,11 @@ const ni = M`
|
|
|
9697
9734
|
const e = c.map((s) => cA.get({ id: s, options: A })), t = c.filter((s, o) => e[o] === void 0);
|
|
9698
9735
|
if (t.length === 0)
|
|
9699
9736
|
return Promise.all(e);
|
|
9700
|
-
const n =
|
|
9701
|
-
(s) => cA.set({ id: s, options: A },
|
|
9737
|
+
const n = hi(t, A), a = t.map(
|
|
9738
|
+
(s) => cA.set({ id: s, options: A }, Ci(s, n))
|
|
9702
9739
|
), i = e.filter((s) => s !== void 0);
|
|
9703
9740
|
return await Promise.all(i.concat(a));
|
|
9704
|
-
}, QA = async (c, A) => (await lt([c], A))[0],
|
|
9741
|
+
}, QA = async (c, A) => (await lt([c], A))[0], Qi = (c) => c.sort((A, e) => A.index - e.index).map((A) => ({
|
|
9705
9742
|
id: J(),
|
|
9706
9743
|
panelId: A.name,
|
|
9707
9744
|
name: A.name,
|
|
@@ -9716,13 +9753,13 @@ const ni = M`
|
|
|
9716
9753
|
editableArea: A.editableArea
|
|
9717
9754
|
})), TA = (c, A) => {
|
|
9718
9755
|
const e = c.workflowState, t = e ? JSON.parse(e) : void 0;
|
|
9719
|
-
return t ? Object.values(t.layouts).map((n) => n.layout) :
|
|
9756
|
+
return t ? Object.values(t.layouts).map((n) => n.layout) : Qi(A.panels);
|
|
9720
9757
|
};
|
|
9721
|
-
class
|
|
9758
|
+
class ui {
|
|
9722
9759
|
constructor(A) {
|
|
9723
9760
|
this.updateTransactionState = async (e) => {
|
|
9724
9761
|
try {
|
|
9725
|
-
return
|
|
9762
|
+
return P.getShadowGraphqlClient().mutate({
|
|
9726
9763
|
...e,
|
|
9727
9764
|
mutation: rn
|
|
9728
9765
|
});
|
|
@@ -9748,6 +9785,12 @@ class Qi {
|
|
|
9748
9785
|
throw new Error("Application key required to use Flow Service.");
|
|
9749
9786
|
return new _a();
|
|
9750
9787
|
}
|
|
9788
|
+
async getIntegration() {
|
|
9789
|
+
return (await P.getShadowGraphqlClient().query({
|
|
9790
|
+
query: ci,
|
|
9791
|
+
errorPolicy: "all"
|
|
9792
|
+
})).data.currentIntegration;
|
|
9793
|
+
}
|
|
9751
9794
|
// TODO: Authentication functions should probably be moved to a separate class.
|
|
9752
9795
|
/**
|
|
9753
9796
|
* Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
|
|
@@ -9790,7 +9833,7 @@ class Qi {
|
|
|
9790
9833
|
*/
|
|
9791
9834
|
async authenticateTransactionFromLocalStorage(A) {
|
|
9792
9835
|
var g, B, l, d, w, h;
|
|
9793
|
-
const e =
|
|
9836
|
+
const e = P.getShadowGraphqlClient(), t = await e.query({
|
|
9794
9837
|
query: ri,
|
|
9795
9838
|
errorPolicy: "all",
|
|
9796
9839
|
fetchPolicy: "no-cache",
|
|
@@ -9814,8 +9857,8 @@ class Qi {
|
|
|
9814
9857
|
if (E && await this.authenticateCustomerId(E)) {
|
|
9815
9858
|
const C = ((d = (l = this.customer) == null ? void 0 : l.bundleStakeholders) == null ? void 0 : d.find(
|
|
9816
9859
|
(f) => {
|
|
9817
|
-
var u,
|
|
9818
|
-
return (
|
|
9860
|
+
var u, I;
|
|
9861
|
+
return (I = (u = f.bundle) == null ? void 0 : u.transactions) == null ? void 0 : I.some((m) => m.id === A);
|
|
9819
9862
|
}
|
|
9820
9863
|
)) || ((h = (w = this.customer) == null ? void 0 : w.stakeholders) == null ? void 0 : h.find(
|
|
9821
9864
|
(f) => {
|
|
@@ -9831,7 +9874,7 @@ class Qi {
|
|
|
9831
9874
|
}
|
|
9832
9875
|
}
|
|
9833
9876
|
const r = (await e.query({
|
|
9834
|
-
query:
|
|
9877
|
+
query: gi,
|
|
9835
9878
|
errorPolicy: "all",
|
|
9836
9879
|
variables: {
|
|
9837
9880
|
id: n.workflowId
|
|
@@ -9866,8 +9909,8 @@ class Qi {
|
|
|
9866
9909
|
async getOrCreateCustomer(A) {
|
|
9867
9910
|
var i;
|
|
9868
9911
|
this.customer = void 0;
|
|
9869
|
-
const e =
|
|
9870
|
-
query:
|
|
9912
|
+
const e = P.getShadowGraphqlClient(), n = (await e.query({
|
|
9913
|
+
query: li,
|
|
9871
9914
|
errorPolicy: "all",
|
|
9872
9915
|
fetchPolicy: "no-cache",
|
|
9873
9916
|
variables: {
|
|
@@ -9876,7 +9919,7 @@ class Qi {
|
|
|
9876
9919
|
})).data.customer;
|
|
9877
9920
|
if (!n.id) {
|
|
9878
9921
|
const o = (i = (await e.mutate({
|
|
9879
|
-
mutation:
|
|
9922
|
+
mutation: Bi,
|
|
9880
9923
|
errorPolicy: "all",
|
|
9881
9924
|
fetchPolicy: "no-cache",
|
|
9882
9925
|
variables: {
|
|
@@ -9901,14 +9944,14 @@ class Qi {
|
|
|
9901
9944
|
}
|
|
9902
9945
|
async authenticateCustomerId(A) {
|
|
9903
9946
|
var s;
|
|
9904
|
-
const e =
|
|
9947
|
+
const e = P.getShadowGraphqlClient(), t = x.getMap("customerTokens");
|
|
9905
9948
|
if (!(t != null && t.has(A)))
|
|
9906
9949
|
return !1;
|
|
9907
9950
|
const n = t.get(A);
|
|
9908
9951
|
if (!n)
|
|
9909
9952
|
return !1;
|
|
9910
9953
|
const i = (s = (await e.mutate({
|
|
9911
|
-
mutation:
|
|
9954
|
+
mutation: di,
|
|
9912
9955
|
errorPolicy: "all",
|
|
9913
9956
|
fetchPolicy: "no-cache",
|
|
9914
9957
|
variables: {
|
|
@@ -9922,8 +9965,8 @@ class Qi {
|
|
|
9922
9965
|
* @param emailAddress The email address to generate a verification code for. The user will be sent an email with the verification code.
|
|
9923
9966
|
*/
|
|
9924
9967
|
async generateVerificationCode(A) {
|
|
9925
|
-
await
|
|
9926
|
-
mutation:
|
|
9968
|
+
await P.getShadowGraphqlClient().mutate({
|
|
9969
|
+
mutation: wi,
|
|
9927
9970
|
variables: {
|
|
9928
9971
|
emailAddress: A
|
|
9929
9972
|
}
|
|
@@ -9937,8 +9980,8 @@ class Qi {
|
|
|
9937
9980
|
*/
|
|
9938
9981
|
async verifyCode(A, e) {
|
|
9939
9982
|
var a, i;
|
|
9940
|
-
const n = (a = (await
|
|
9941
|
-
mutation:
|
|
9983
|
+
const n = (a = (await P.getShadowGraphqlClient().mutate({
|
|
9984
|
+
mutation: Ei,
|
|
9942
9985
|
errorPolicy: "all",
|
|
9943
9986
|
fetchPolicy: "no-cache",
|
|
9944
9987
|
variables: {
|
|
@@ -9963,7 +10006,7 @@ class Qi {
|
|
|
9963
10006
|
*/
|
|
9964
10007
|
async getNewBundle(A, e) {
|
|
9965
10008
|
var s;
|
|
9966
|
-
const n = (s = (await
|
|
10009
|
+
const n = (s = (await P.getShadowGraphqlClient().mutate({
|
|
9967
10010
|
mutation: xa,
|
|
9968
10011
|
variables: {
|
|
9969
10012
|
collectionId: A,
|
|
@@ -9987,7 +10030,7 @@ class Qi {
|
|
|
9987
10030
|
*/
|
|
9988
10031
|
async getExistingBundle(A, e, t) {
|
|
9989
10032
|
var g, B, l, d;
|
|
9990
|
-
const n = x.getMap("bundleOwnerIds"), a = n == null ? void 0 : n.get(A), i = await
|
|
10033
|
+
const n = x.getMap("bundleOwnerIds"), a = n == null ? void 0 : n.get(A), i = await P.getShadowGraphqlClient().query({
|
|
9991
10034
|
query: ya,
|
|
9992
10035
|
variables: {
|
|
9993
10036
|
id: A
|
|
@@ -10012,7 +10055,7 @@ class Qi {
|
|
|
10012
10055
|
var a;
|
|
10013
10056
|
if (!this.customer)
|
|
10014
10057
|
throw new Error("Customer not authenticated.");
|
|
10015
|
-
const A = await
|
|
10058
|
+
const A = await P.getShadowGraphqlClient().query({
|
|
10016
10059
|
query: Sa,
|
|
10017
10060
|
variables: {
|
|
10018
10061
|
id: this.customer.id
|
|
@@ -10041,9 +10084,9 @@ class Qi {
|
|
|
10041
10084
|
return await this.getWorkflowExperienceDeprecated(A, e, t);
|
|
10042
10085
|
const a = async () => {
|
|
10043
10086
|
var Q, C;
|
|
10044
|
-
const E =
|
|
10087
|
+
const E = P.getShadowGraphqlClient();
|
|
10045
10088
|
if (n.type === "transaction") {
|
|
10046
|
-
const { transactionId: f, readOnly: u } = n,
|
|
10089
|
+
const { transactionId: f, readOnly: u } = n, I = await E.query({
|
|
10047
10090
|
query: BA,
|
|
10048
10091
|
variables: {
|
|
10049
10092
|
ids: [f]
|
|
@@ -10051,22 +10094,22 @@ class Qi {
|
|
|
10051
10094
|
errorPolicy: "all",
|
|
10052
10095
|
fetchPolicy: "no-cache"
|
|
10053
10096
|
});
|
|
10054
|
-
if (!((Q =
|
|
10097
|
+
if (!((Q = I.data) != null && Q.transactions) || I.data.transactions.length === 0)
|
|
10055
10098
|
throw new U("Existing transaction not found.");
|
|
10056
|
-
const
|
|
10057
|
-
if (!
|
|
10099
|
+
const m = (C = I.data) == null ? void 0 : C.transactions[0];
|
|
10100
|
+
if (!m.workflowId)
|
|
10058
10101
|
throw new U("Existing transaction has no workflow ID.");
|
|
10059
|
-
const p = await QA(
|
|
10060
|
-
if (!
|
|
10102
|
+
const p = await QA(m.workflowId);
|
|
10103
|
+
if (!m.product)
|
|
10061
10104
|
throw new U("Failed to load transaction, product not available.");
|
|
10062
|
-
return { transaction:
|
|
10105
|
+
return { transaction: m, workflow: p, readOnly: u };
|
|
10063
10106
|
}
|
|
10064
10107
|
if (n.type === "integration" || n.type === "external") {
|
|
10065
10108
|
const f = async () => {
|
|
10066
10109
|
const p = n.type === "integration" ? { integrationProductId: n.integrationProductId } : {
|
|
10067
10110
|
externalIntegrationId: n.externalIntegrationId,
|
|
10068
10111
|
externalProductId: n.externalProductId
|
|
10069
|
-
},
|
|
10112
|
+
}, M = await E.mutate({
|
|
10070
10113
|
mutation: Qe,
|
|
10071
10114
|
variables: {
|
|
10072
10115
|
...p,
|
|
@@ -10078,14 +10121,14 @@ class Qi {
|
|
|
10078
10121
|
// TODO: this should be changed to required once the API is updated. Should this also be moved to server.ts?
|
|
10079
10122
|
context: this.options.applicationKey ? { headers: { "X-Application-Key": this.options.applicationKey } } : void 0
|
|
10080
10123
|
});
|
|
10081
|
-
if (!
|
|
10124
|
+
if (!M.data || !M.data.transactionCreate)
|
|
10082
10125
|
throw new U("Failed to create transaction!");
|
|
10083
|
-
const y =
|
|
10126
|
+
const y = M.data.transactionCreate;
|
|
10084
10127
|
if (!y.product)
|
|
10085
10128
|
throw new U("Failed to create transaction, product not available.");
|
|
10086
10129
|
return y;
|
|
10087
|
-
}, u = QA(n.workflowId, n == null ? void 0 : n.graphql), [
|
|
10088
|
-
return { transaction:
|
|
10130
|
+
}, u = QA(n.workflowId, n == null ? void 0 : n.graphql), [I, m] = await Promise.all([f(), u]);
|
|
10131
|
+
return { transaction: I, workflow: m };
|
|
10089
10132
|
}
|
|
10090
10133
|
throw new U("No workflow ID provided.");
|
|
10091
10134
|
}, { transaction: i, workflow: s, readOnly: o } = await a();
|
|
@@ -10142,39 +10185,39 @@ class Qi {
|
|
|
10142
10185
|
async getWorkflowExperiences(A, e) {
|
|
10143
10186
|
if (A.length === 0)
|
|
10144
10187
|
throw new U("No options provided!");
|
|
10145
|
-
const t =
|
|
10188
|
+
const t = P.getShadowGraphqlClient(), n = async (I) => {
|
|
10146
10189
|
var y, S;
|
|
10147
|
-
if (
|
|
10190
|
+
if (I.length === 0)
|
|
10148
10191
|
return [];
|
|
10149
|
-
const
|
|
10192
|
+
const m = I.map((Y) => Y.option.transactionId), p = await t.query({
|
|
10150
10193
|
query: BA,
|
|
10151
10194
|
variables: {
|
|
10152
|
-
ids:
|
|
10195
|
+
ids: m
|
|
10153
10196
|
},
|
|
10154
10197
|
errorPolicy: "all",
|
|
10155
10198
|
fetchPolicy: "no-cache"
|
|
10156
|
-
}),
|
|
10157
|
-
if (
|
|
10199
|
+
}), M = p.data.transactions;
|
|
10200
|
+
if (M.length !== I.length) {
|
|
10158
10201
|
const Y = ((S = (y = p.errors) == null ? void 0 : y[0]) == null ? void 0 : S.message) || "Unknown error";
|
|
10159
10202
|
throw new U(`Not all transactions were found: ${Y}`);
|
|
10160
10203
|
}
|
|
10161
|
-
return
|
|
10204
|
+
return M.map((Y, N) => {
|
|
10162
10205
|
var H;
|
|
10163
10206
|
return {
|
|
10164
10207
|
transaction: Y,
|
|
10165
10208
|
workflowId: Y.workflowId,
|
|
10166
|
-
readOnly: ((H =
|
|
10167
|
-
index:
|
|
10209
|
+
readOnly: ((H = I.find((T) => T.option.transactionId === Y.id)) == null ? void 0 : H.option.readOnly) ?? !1,
|
|
10210
|
+
index: I[N].index
|
|
10168
10211
|
};
|
|
10169
10212
|
});
|
|
10170
|
-
}, a = async (
|
|
10171
|
-
var
|
|
10172
|
-
if (
|
|
10213
|
+
}, a = async (I) => {
|
|
10214
|
+
var M, y, S;
|
|
10215
|
+
if (I.length === 0)
|
|
10173
10216
|
return [];
|
|
10174
|
-
const
|
|
10217
|
+
const m = await t.mutate({
|
|
10175
10218
|
mutation: sn,
|
|
10176
10219
|
variables: {
|
|
10177
|
-
inputs:
|
|
10220
|
+
inputs: I.map((Y) => ({
|
|
10178
10221
|
integrationProductId: Y.option.type === "integration" ? Y.option.integrationProductId : void 0,
|
|
10179
10222
|
externalIntegrationId: Y.option.type === "external" ? Y.option.externalIntegrationId : void 0,
|
|
10180
10223
|
externalProductId: Y.option.type === "external" ? Y.option.externalProductId : void 0,
|
|
@@ -10184,42 +10227,42 @@ class Qi {
|
|
|
10184
10227
|
},
|
|
10185
10228
|
errorPolicy: "all",
|
|
10186
10229
|
fetchPolicy: "no-cache"
|
|
10187
|
-
}), p = (
|
|
10230
|
+
}), p = (M = m.data) == null ? void 0 : M.transactionCreateMany;
|
|
10188
10231
|
if (!p || p.length === 0) {
|
|
10189
|
-
const Y = ((S = (y =
|
|
10232
|
+
const Y = ((S = (y = m.errors) == null ? void 0 : y[0]) == null ? void 0 : S.message) || "Unknown error";
|
|
10190
10233
|
throw new U(`Failed to create transactions: ${Y}`);
|
|
10191
10234
|
}
|
|
10192
|
-
return p.map((Y,
|
|
10235
|
+
return p.map((Y, N) => ({
|
|
10193
10236
|
transaction: Y,
|
|
10194
10237
|
workflowId: Y.workflowId,
|
|
10195
10238
|
readOnly: !1,
|
|
10196
|
-
index:
|
|
10239
|
+
index: I[N].index
|
|
10197
10240
|
}));
|
|
10198
|
-
}, i = A.map((
|
|
10199
|
-
(
|
|
10241
|
+
}, i = A.map((I, m) => ({ option: I, index: m })), s = i.filter((I) => I.option.type === "transaction"), o = i.filter(
|
|
10242
|
+
(I) => I.option.type === "integration" || I.option.type === "external"
|
|
10200
10243
|
), r = Ee(s, 10), g = Ee(o, 10), B = (await Promise.all([
|
|
10201
10244
|
...r.map(n),
|
|
10202
10245
|
...g.map(a)
|
|
10203
|
-
])).flat(), l = [...new Set(B.map((
|
|
10246
|
+
])).flat(), l = [...new Set(B.map((I) => I.workflowId))], d = await lt(l, e), w = new Map(d.map((I) => [I.id, I])), h = x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), E = B.map(async (I) => {
|
|
10204
10247
|
var T;
|
|
10205
|
-
const { transaction:
|
|
10206
|
-
!h.get(
|
|
10207
|
-
const
|
|
10208
|
-
product:
|
|
10209
|
-
transaction:
|
|
10248
|
+
const { transaction: m, workflowId: p, readOnly: M, index: y } = I, S = w.get(p), Y = A[y];
|
|
10249
|
+
!h.get(m.id) && m.transactionOwnerId && h.set(m.id, m.transactionOwnerId);
|
|
10250
|
+
const N = h.get(m.id) || void 0, H = {
|
|
10251
|
+
product: m.product,
|
|
10252
|
+
transaction: m,
|
|
10210
10253
|
layouts: [],
|
|
10211
10254
|
singleVariantsRenderable: (T = Y == null ? void 0 : Y.workflowConfiguration) == null ? void 0 : T.singleVariantsRenderable,
|
|
10212
|
-
stateMutationFunc:
|
|
10255
|
+
stateMutationFunc: M ? async () => {
|
|
10213
10256
|
throw new k("State mutation is forbidden in read only mode!");
|
|
10214
|
-
} : async (b) => this.updateTransactionState({ ...b, context: { transactionOwnerId:
|
|
10215
|
-
readOnly:
|
|
10257
|
+
} : async (b) => this.updateTransactionState({ ...b, context: { transactionOwnerId: N } }),
|
|
10258
|
+
readOnly: M,
|
|
10216
10259
|
workflow: S,
|
|
10217
10260
|
isReloadedTransaction: Y.type === "transaction"
|
|
10218
10261
|
};
|
|
10219
|
-
if (Y.type === "transaction" &&
|
|
10220
|
-
const b = JSON.parse(
|
|
10262
|
+
if (Y.type === "transaction" && m.workflowState) {
|
|
10263
|
+
const b = JSON.parse(m.workflowState);
|
|
10221
10264
|
H.layouts = Object.values(b.layouts).map((V) => V.layout), await _(b), await AA(b), H.reloadedState = b;
|
|
10222
|
-
} else if (!
|
|
10265
|
+
} else if (!M && Y.workflowState) {
|
|
10223
10266
|
const b = JSON.parse(Y.workflowState);
|
|
10224
10267
|
H.layouts = Object.values(b.layouts).map((V) => V.layout), await _(b), await AA(b), H.reloadedState = b;
|
|
10225
10268
|
} else
|
|
@@ -10232,11 +10275,11 @@ class Qi {
|
|
|
10232
10275
|
), H.delayWorkflowStateSync = !0, this.initialized = !0, this.experienceOptions = H, { experienceOptions: H, index: y, options: Y };
|
|
10233
10276
|
});
|
|
10234
10277
|
x.setMap("transactionOwnerIds", h);
|
|
10235
|
-
const f = (await Promise.all(E)).sort((
|
|
10236
|
-
const { experienceOptions:
|
|
10237
|
-
return await
|
|
10278
|
+
const f = (await Promise.all(E)).sort((I, m) => I.index - m.index).map(async (I) => {
|
|
10279
|
+
const { experienceOptions: m, options: p } = I, M = new EA(this, m);
|
|
10280
|
+
return await M.getWorkflowManager().getInitializationPromise(), p.type !== "transaction" && this.customer && await M.attachCustomerDetails({ email: this.customer.emailAddress }), M;
|
|
10238
10281
|
}), u = await Promise.all(f);
|
|
10239
|
-
return u.forEach((
|
|
10282
|
+
return u.forEach((I) => I.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), u;
|
|
10240
10283
|
}
|
|
10241
10284
|
/**
|
|
10242
10285
|
* Initialize the client from an integration product.
|
|
@@ -10247,7 +10290,7 @@ class Qi {
|
|
|
10247
10290
|
var i;
|
|
10248
10291
|
if (A === "")
|
|
10249
10292
|
throw new U("No integration product ID provided.");
|
|
10250
|
-
const t = await
|
|
10293
|
+
const t = await P.getShadowGraphqlClient().mutate({
|
|
10251
10294
|
mutation: Qe,
|
|
10252
10295
|
variables: {
|
|
10253
10296
|
integrationProductId: A,
|
|
@@ -10285,7 +10328,7 @@ class Qi {
|
|
|
10285
10328
|
var s, o, r, g;
|
|
10286
10329
|
if (A === "")
|
|
10287
10330
|
throw new U("No transaction ID provided.");
|
|
10288
|
-
const t =
|
|
10331
|
+
const t = P.getShadowGraphqlClient(), n = async () => {
|
|
10289
10332
|
var d, w;
|
|
10290
10333
|
const l = (d = (await t.query({
|
|
10291
10334
|
query: BA,
|
|
@@ -10376,7 +10419,7 @@ class Qi {
|
|
|
10376
10419
|
return await r.getWorkflowManager().getInitializationPromise(), r;
|
|
10377
10420
|
}
|
|
10378
10421
|
if (A) {
|
|
10379
|
-
const r = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(this.experienceOptions.transaction.id), g =
|
|
10422
|
+
const r = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(this.experienceOptions.transaction.id), g = P.getShadowGraphqlClient().mutate({
|
|
10380
10423
|
mutation: cn,
|
|
10381
10424
|
variables: {
|
|
10382
10425
|
workflowId: A,
|
|
@@ -10435,7 +10478,7 @@ class Qi {
|
|
|
10435
10478
|
}
|
|
10436
10479
|
async getIntegrationProductById(A) {
|
|
10437
10480
|
var a, i;
|
|
10438
|
-
const n = (a = (await
|
|
10481
|
+
const n = (a = (await P.getShadowGraphqlClient().query({
|
|
10439
10482
|
query: gn,
|
|
10440
10483
|
variables: {
|
|
10441
10484
|
ids: [A]
|
|
@@ -10449,7 +10492,7 @@ class Qi {
|
|
|
10449
10492
|
}
|
|
10450
10493
|
async getIntegrationProductFromExternalIds(A, e) {
|
|
10451
10494
|
var i;
|
|
10452
|
-
const a = (i = (await
|
|
10495
|
+
const a = (i = (await P.getShadowGraphqlClient().query({
|
|
10453
10496
|
query: ln,
|
|
10454
10497
|
variables: {
|
|
10455
10498
|
externalProductId: e,
|
|
@@ -10463,7 +10506,7 @@ class Qi {
|
|
|
10463
10506
|
return new fe(a);
|
|
10464
10507
|
}
|
|
10465
10508
|
}
|
|
10466
|
-
class
|
|
10509
|
+
class Gi {
|
|
10467
10510
|
getInitializationPromise() {
|
|
10468
10511
|
return Promise.resolve();
|
|
10469
10512
|
}
|
|
@@ -10588,8 +10631,8 @@ class Ui {
|
|
|
10588
10631
|
setWorkflowStateSyncEnabled(A) {
|
|
10589
10632
|
}
|
|
10590
10633
|
}
|
|
10591
|
-
var
|
|
10592
|
-
class
|
|
10634
|
+
var mi = /* @__PURE__ */ ((c) => (c.SelectFrame = "SelectFrame", c.SelectImage = "SelectImage", c.Position = "Position", c))(mi || {});
|
|
10635
|
+
class Ii extends W {
|
|
10593
10636
|
constructor(A, e) {
|
|
10594
10637
|
var t;
|
|
10595
10638
|
super(A, e), this.frameService = (t = this.manager.getStepSpecificServices(this.getId())) == null ? void 0 : t.frameService;
|
|
@@ -10631,43 +10674,43 @@ class mi extends W {
|
|
|
10631
10674
|
}
|
|
10632
10675
|
export {
|
|
10633
10676
|
$ as AssetNotFoundError,
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10677
|
+
Ji as AssetType,
|
|
10678
|
+
bi as BringForwardCommand,
|
|
10679
|
+
Li as BringToBackCommand,
|
|
10680
|
+
Ti as BringToFrontCommand,
|
|
10681
|
+
Oi as CanvasCommand,
|
|
10639
10682
|
Xa as CollectionProduct,
|
|
10640
|
-
|
|
10683
|
+
zi as CommandContext,
|
|
10641
10684
|
an as ConversionDataType,
|
|
10642
10685
|
nn as ConversionLocation,
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10686
|
+
Ki as CreateElementCommand,
|
|
10687
|
+
ji as CreateLayoutCommand,
|
|
10688
|
+
Vi as DeleteElementCommand,
|
|
10646
10689
|
CA as FlowExecutionNodeResult,
|
|
10647
10690
|
Ai as FlowExecutionResult,
|
|
10648
10691
|
_a as FlowService,
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10692
|
+
Wi as FontAlignmentCommand,
|
|
10693
|
+
Xi as FontColorCommand,
|
|
10694
|
+
qi as FontSizeCommand,
|
|
10695
|
+
Zi as FontSourceCommand,
|
|
10653
10696
|
Cn as FrameService,
|
|
10654
|
-
|
|
10655
|
-
|
|
10697
|
+
mi as FrameStep,
|
|
10698
|
+
Ii as FrameStepHandle,
|
|
10656
10699
|
re as GlobalPropertyHandle,
|
|
10657
|
-
|
|
10700
|
+
$i as GroupCommand,
|
|
10658
10701
|
Vn as IllustrationStepHandle,
|
|
10659
10702
|
PA as InformationMessageType,
|
|
10660
10703
|
Aa as InformationStepHandle,
|
|
10661
10704
|
fe as IntegrationProduct,
|
|
10662
10705
|
en as IntegrationType,
|
|
10663
|
-
|
|
10664
|
-
|
|
10706
|
+
_i as LayoutElementFactory,
|
|
10707
|
+
As as LayoutElementType,
|
|
10665
10708
|
z as LayoutNotFoundError,
|
|
10666
10709
|
Wn as MaterialStepHandle,
|
|
10667
10710
|
MA as MisconfigurationError,
|
|
10668
|
-
|
|
10711
|
+
Gi as MockWorkflowManager,
|
|
10669
10712
|
Xn as ModelStepHandle,
|
|
10670
|
-
|
|
10713
|
+
es as MoveCommand,
|
|
10671
10714
|
gt as ObjectInput,
|
|
10672
10715
|
ti as ObjectInputType,
|
|
10673
10716
|
FA as OptionNotFoundError,
|
|
@@ -10680,63 +10723,63 @@ export {
|
|
|
10680
10723
|
Ve as PromiseQueue,
|
|
10681
10724
|
Zn as QuestionStepHandle,
|
|
10682
10725
|
je as QueueablePromise,
|
|
10683
|
-
|
|
10726
|
+
ts as ResizeCommand,
|
|
10684
10727
|
rA as ResourceNotFoundError,
|
|
10685
|
-
|
|
10686
|
-
|
|
10728
|
+
ns as RotateCommand,
|
|
10729
|
+
as as SendBackwardsCommand,
|
|
10687
10730
|
$n as ShapeStepHandle,
|
|
10688
|
-
|
|
10731
|
+
ui as SpiffCommerceClient,
|
|
10689
10732
|
YA as StakeholderType,
|
|
10690
|
-
|
|
10733
|
+
is as StepAspectType,
|
|
10691
10734
|
W as StepHandle,
|
|
10692
|
-
|
|
10693
|
-
|
|
10735
|
+
ss as StepType,
|
|
10736
|
+
os as TextChangeCommand,
|
|
10694
10737
|
_n as TextStepHandle,
|
|
10695
10738
|
Za as Transform,
|
|
10696
10739
|
qa as TransformCollection,
|
|
10697
10740
|
k as UnhandledBehaviorError,
|
|
10698
|
-
|
|
10741
|
+
rs as UnitOfMeasurement,
|
|
10699
10742
|
X as Variant,
|
|
10700
10743
|
EA as WorkflowExperienceImpl,
|
|
10701
10744
|
O as assetService,
|
|
10702
10745
|
sa as createDesign,
|
|
10703
|
-
|
|
10746
|
+
cs as dataUrlFromExternalUrl,
|
|
10704
10747
|
LA as designService,
|
|
10705
|
-
|
|
10748
|
+
gs as determineCorrectFontSizeAndLines,
|
|
10706
10749
|
mn as digitalContentStepService,
|
|
10707
|
-
|
|
10708
|
-
|
|
10750
|
+
ls as findElement,
|
|
10751
|
+
Bs as frameDataCache,
|
|
10709
10752
|
VA as frameStepService,
|
|
10710
|
-
|
|
10753
|
+
ds as generate,
|
|
10711
10754
|
ma as generateCommands,
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10755
|
+
ws as generateSVGWithUnknownColors,
|
|
10756
|
+
Ui as generateStateFromDesignInputSteps,
|
|
10757
|
+
Es as getAttributesFromArrayBuffer,
|
|
10758
|
+
hs as getAxisAlignedBoundingBox,
|
|
10716
10759
|
hn as getBoundedOffsets,
|
|
10717
|
-
|
|
10718
|
-
|
|
10760
|
+
Cs as getFrameData,
|
|
10761
|
+
Qs as getSvgElement,
|
|
10719
10762
|
QA as getWorkflow,
|
|
10720
10763
|
lt as getWorkflows,
|
|
10721
|
-
|
|
10764
|
+
P as graphQlManager,
|
|
10722
10765
|
IA as illustrationStepService,
|
|
10723
|
-
|
|
10766
|
+
us as loadFont,
|
|
10724
10767
|
Xe as materialStepService,
|
|
10725
10768
|
qe as modelStepService,
|
|
10726
10769
|
Mn as moduleStepService,
|
|
10727
10770
|
j as optionService,
|
|
10728
|
-
|
|
10771
|
+
ms as patternImageDataCache,
|
|
10729
10772
|
x as persistenceService,
|
|
10730
10773
|
Ze as pictureStepService,
|
|
10731
10774
|
$e as questionStepService,
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10775
|
+
Is as registerFetchImplementation,
|
|
10776
|
+
ps as registerWindowImplementation,
|
|
10777
|
+
fs as rehydrateSerializedLayout,
|
|
10778
|
+
Ds as setCanvasModule,
|
|
10736
10779
|
oA as shapeStepService,
|
|
10737
10780
|
Qn as shortenUrl,
|
|
10738
10781
|
yA as spiffCoreConfiguration,
|
|
10739
|
-
|
|
10782
|
+
Ri as stepAspectValuesToDesignInputSteps,
|
|
10740
10783
|
K as textStepService,
|
|
10741
10784
|
Pn as toast
|
|
10742
10785
|
};
|