@spiffcommerce/core 33.13.2 → 33.13.3
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/CHANGELOG.md +7 -1
- package/dist/index.d.ts +16 -4
- package/dist/index.js +135 -135
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +950 -898
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createHttpLink as Ii, ApolloClient as Bi, InMemoryCache as Pi, from as
|
|
2
|
-
import { setContext as
|
|
3
|
-
import { onError as
|
|
1
|
+
import { createHttpLink as Ii, ApolloClient as Bi, InMemoryCache as Pi, from as xi, gql as C } from "@apollo/client/core";
|
|
2
|
+
import { setContext as Di } from "@apollo/client/link/context";
|
|
3
|
+
import { onError as Fi } from "@apollo/client/link/error";
|
|
4
4
|
import { renderToStaticMarkup as ki } from "preact-render-to-string";
|
|
5
5
|
import { removeTypenameFromVariables as Mi } from "@apollo/client/link/remove-typename";
|
|
6
6
|
import { orientation as Ti } from "exifr/dist/mini.umd.cjs";
|
|
@@ -9,7 +9,7 @@ import Ni from "fuse.js";
|
|
|
9
9
|
import { Pith as va } from "pith";
|
|
10
10
|
import It from "lodash.clonedeep";
|
|
11
11
|
import Jt from "lodash.isequal";
|
|
12
|
-
import { jsx as
|
|
12
|
+
import { jsx as B, jsxs as dt, Fragment as qt } from "preact/jsx-runtime";
|
|
13
13
|
import { parse as la } from "opentype.js";
|
|
14
14
|
import Qi from "handlebars";
|
|
15
15
|
import { dataUriToBuffer as Ri } from "data-uri-to-buffer";
|
|
@@ -24,7 +24,7 @@ import vn from "lodash.debounce";
|
|
|
24
24
|
import "fs";
|
|
25
25
|
import "path";
|
|
26
26
|
import Vi from "lodash.omit";
|
|
27
|
-
var Ie = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Ie || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), G = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(G || {}),
|
|
27
|
+
var Ie = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Ie || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), G = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(G || {}), E = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(E || {}), zi = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(zi || {}), Kt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Kt || {}), D = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(D || {}), Gi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Gi || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), Wi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(Wi || {}), qi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(qi || {}), Ea = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(Ea || {}), Hi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Hi || {}), Be = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(Be || {}), Tt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(Tt || {}), Y = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(Y || {}), ji = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(ji || {});
|
|
28
28
|
class In extends Error {
|
|
29
29
|
constructor(t) {
|
|
30
30
|
super(t), this.name = this.constructor.name;
|
|
@@ -55,7 +55,7 @@ class _t extends ae {
|
|
|
55
55
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
class
|
|
58
|
+
class xe extends ae {
|
|
59
59
|
constructor(t, e) {
|
|
60
60
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
|
61
61
|
}
|
|
@@ -70,12 +70,12 @@ class R extends Qe {
|
|
|
70
70
|
super(`Unhandled Behavior Encountered: ${t}`);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
class
|
|
73
|
+
class Dt extends Qe {
|
|
74
74
|
constructor(t) {
|
|
75
75
|
super(`Parsing Error: ${t}`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
class
|
|
78
|
+
class mt extends Qe {
|
|
79
79
|
constructor(t) {
|
|
80
80
|
super(`Client Error: ${t}`);
|
|
81
81
|
}
|
|
@@ -217,7 +217,7 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
|
|
|
217
217
|
t ? _i(n).then(e).catch(a) : it(n).then((i) => {
|
|
218
218
|
i.text().then(e).catch(a);
|
|
219
219
|
}).catch(a);
|
|
220
|
-
}),
|
|
220
|
+
}), xn = (n) => ki(n), je = /* @__PURE__ */ new Map(), tr = async (n, t) => {
|
|
221
221
|
if (Nt([typeof FontFace])) {
|
|
222
222
|
if (je.has(t))
|
|
223
223
|
return je.get(t);
|
|
@@ -269,7 +269,7 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
|
|
|
269
269
|
}, ar = async (n) => {
|
|
270
270
|
const t = $e(n), e = new Uint8Array(n), a = er(e), i = btoa(a);
|
|
271
271
|
return `data:${t};base64,${i}`;
|
|
272
|
-
}, ba = (n) => `data:image/svg+xml;base64,${btoa(n)}`,
|
|
272
|
+
}, ba = (n) => `data:image/svg+xml;base64,${btoa(n)}`, Dn = (n) => {
|
|
273
273
|
const t = n.replace(/\r?\n/g, ""), e = t.indexOf(",");
|
|
274
274
|
if (e === -1 || e <= 4)
|
|
275
275
|
throw new TypeError("malformed data: URI");
|
|
@@ -292,9 +292,9 @@ let ir, Ia;
|
|
|
292
292
|
const rr = (n) => {
|
|
293
293
|
Ia = n;
|
|
294
294
|
}, or = () => Ia;
|
|
295
|
-
let
|
|
295
|
+
let Fn;
|
|
296
296
|
const sr = (n) => {
|
|
297
|
-
|
|
297
|
+
Fn = n;
|
|
298
298
|
}, lr = () => new Promise((n) => {
|
|
299
299
|
const t = ft.getHubUrl(), e = (a) => {
|
|
300
300
|
a.origin === t && (window.removeEventListener("message", e), n(a.data));
|
|
@@ -304,7 +304,7 @@ const sr = (n) => {
|
|
|
304
304
|
const n = {
|
|
305
305
|
applicationKey: Ia,
|
|
306
306
|
customerToken: ir,
|
|
307
|
-
bearer:
|
|
307
|
+
bearer: Fn
|
|
308
308
|
};
|
|
309
309
|
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await lr(), ...n } : n;
|
|
310
310
|
};
|
|
@@ -329,7 +329,7 @@ class Ar {
|
|
|
329
329
|
const t = Ii({
|
|
330
330
|
uri: `${ft.getServerUrl()}/graphql`,
|
|
331
331
|
fetch: dr
|
|
332
|
-
}), e =
|
|
332
|
+
}), e = Di(async (r, o) => {
|
|
333
333
|
const { headers: s } = o, l = s || {}, c = await cr();
|
|
334
334
|
let d = o.bearer ?? c.bearer;
|
|
335
335
|
if (this.spiffClient)
|
|
@@ -337,28 +337,28 @@ class Ar {
|
|
|
337
337
|
d = await this.spiffClient.loggedInBearerToken();
|
|
338
338
|
} catch {
|
|
339
339
|
}
|
|
340
|
-
const A = o.partnerId ?? c.partnerId, u = o.activeIntegration ?? c.activeIntegration, h = o.transactionOwnerId,
|
|
340
|
+
const A = o.partnerId ?? c.partnerId, u = o.activeIntegration ?? c.activeIntegration, h = o.transactionOwnerId, g = o.customerToken ?? c.customerToken, m = o.applicationKey ?? c.applicationKey, p = o.bundleOwnerId;
|
|
341
341
|
try {
|
|
342
342
|
if (window && window.__SENTRY__) {
|
|
343
343
|
const f = window.__SENTRY__.hub;
|
|
344
344
|
if (f) {
|
|
345
345
|
const S = f.traceHeaders();
|
|
346
|
-
Object.entries(S).forEach(([w,
|
|
347
|
-
l[w] =
|
|
346
|
+
Object.entries(S).forEach(([w, x]) => {
|
|
347
|
+
l[w] = x;
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
} catch {
|
|
352
352
|
}
|
|
353
|
-
return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h),
|
|
353
|
+
return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h), g && (l.customerToken = g), m && (l["X-Application-Key"] = m), p && (l.bundleOwnerId = p), l["Allow-Moonlight-Redirect"] = "true", {
|
|
354
354
|
headers: l
|
|
355
355
|
};
|
|
356
|
-
}), a =
|
|
356
|
+
}), a = Fi(({ operation: r, graphQLErrors: o, networkError: s }) => {
|
|
357
357
|
const l = o || [], c = r.getContext();
|
|
358
358
|
s && !c?.fetchOptions?.signal?.aborted && console.log("GraphQL Network error"), l.forEach(() => console.log("GraphQL Error: " + r.operationName));
|
|
359
359
|
}), i = Mi();
|
|
360
360
|
return new Bi({
|
|
361
|
-
link:
|
|
361
|
+
link: xi([i, a, e, t]),
|
|
362
362
|
cache: new Pi(),
|
|
363
363
|
name: "Core"
|
|
364
364
|
});
|
|
@@ -421,11 +421,11 @@ const ur = (n) => new Promise((t) => {
|
|
|
421
421
|
return !Ae;
|
|
422
422
|
const t = await ie("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH/9k=");
|
|
423
423
|
return Ae = t.width === 2 && t.height === 3, !Ae;
|
|
424
|
-
},
|
|
424
|
+
}, gr = (n) => {
|
|
425
425
|
const e = n.naturalWidth / n.naturalHeight;
|
|
426
426
|
return n.naturalHeight <= 8192 && n.naturalWidth <= 8192 ? [n.naturalWidth, n.naturalHeight] : n.naturalHeight > n.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
|
|
427
|
-
},
|
|
428
|
-
const t = await ar(n), e = await ie(t), [a, i] =
|
|
427
|
+
}, mr = async (n) => {
|
|
428
|
+
const t = await ar(n), e = await ie(t), [a, i] = gr(e);
|
|
429
429
|
if (!await hr()) {
|
|
430
430
|
const A = Ct(a, i);
|
|
431
431
|
return A.getContext("2d")?.drawImage(e, 0, 0, a, i), A;
|
|
@@ -456,7 +456,7 @@ const ur = (n) => new Promise((t) => {
|
|
|
456
456
|
}
|
|
457
457
|
return d.drawImage(e, 0, 0, s, l), c;
|
|
458
458
|
}, Ue = async (n) => {
|
|
459
|
-
const t = await
|
|
459
|
+
const t = await mr(n);
|
|
460
460
|
return $e(n) === "image/jpeg" ? {
|
|
461
461
|
dataUrl: t.toDataURL("image/jpeg", 1),
|
|
462
462
|
height: t.height,
|
|
@@ -3317,12 +3317,12 @@ const ue = (n) => {
|
|
|
3317
3317
|
}
|
|
3318
3318
|
});
|
|
3319
3319
|
});
|
|
3320
|
-
}, Rn = (n) => Pt().serializeToString(n),
|
|
3320
|
+
}, Rn = (n) => Pt().serializeToString(n), xa = (n, t, e, a, i) => {
|
|
3321
3321
|
const r = Nn(n);
|
|
3322
3322
|
if (!r)
|
|
3323
3323
|
throw new Error("Failed to read SVG.");
|
|
3324
3324
|
return Er(r, t, e), Qn(r, a, i), Rn(r);
|
|
3325
|
-
},
|
|
3325
|
+
}, Da = (n, t, e) => {
|
|
3326
3326
|
const a = Nn(n);
|
|
3327
3327
|
if (!a)
|
|
3328
3328
|
throw new Error("Failed to read SVG.");
|
|
@@ -3410,7 +3410,7 @@ const ue = (n) => {
|
|
|
3410
3410
|
...AssetFields
|
|
3411
3411
|
}
|
|
3412
3412
|
}
|
|
3413
|
-
`,
|
|
3413
|
+
`, Fa = C`
|
|
3414
3414
|
fragment MaterialFields on Material {
|
|
3415
3415
|
id
|
|
3416
3416
|
name
|
|
@@ -3458,13 +3458,13 @@ const ue = (n) => {
|
|
|
3458
3458
|
}
|
|
3459
3459
|
}
|
|
3460
3460
|
`, Pr = C`
|
|
3461
|
-
${
|
|
3461
|
+
${Fa}
|
|
3462
3462
|
query GetMaterials($ids: [String]) {
|
|
3463
3463
|
materials(id: $ids) {
|
|
3464
3464
|
...MaterialFields
|
|
3465
3465
|
}
|
|
3466
3466
|
}
|
|
3467
|
-
`,
|
|
3467
|
+
`, xr = C`
|
|
3468
3468
|
mutation CreateAsset($name: String!, $type: String!, $mimeType: String!, $anonymous: Boolean, $temporary: Boolean) {
|
|
3469
3469
|
assetCreate(name: $name, type: $type, mimeType: $mimeType, anonymous: $anonymous, temporary: $temporary) {
|
|
3470
3470
|
uploadUrl
|
|
@@ -3478,28 +3478,28 @@ const ue = (n) => {
|
|
|
3478
3478
|
}
|
|
3479
3479
|
}
|
|
3480
3480
|
}
|
|
3481
|
-
`,
|
|
3481
|
+
`, Dr = C`
|
|
3482
3482
|
${re(!1)}
|
|
3483
3483
|
mutation RemoveBackgroundFromAsset($key: String!) {
|
|
3484
3484
|
assetRemoveBackground(key: $key) {
|
|
3485
3485
|
...AssetFields
|
|
3486
3486
|
}
|
|
3487
3487
|
}
|
|
3488
|
-
`,
|
|
3488
|
+
`, De = async (n) => (await y.getShadowGraphqlClient().query({
|
|
3489
3489
|
query: Br,
|
|
3490
3490
|
errorPolicy: "all",
|
|
3491
3491
|
fetchPolicy: "no-cache",
|
|
3492
3492
|
variables: {
|
|
3493
3493
|
keys: n
|
|
3494
3494
|
}
|
|
3495
|
-
})).data.assets,
|
|
3495
|
+
})).data.assets, Fr = async (n) => (await y.getShadowGraphqlClient().query({
|
|
3496
3496
|
query: Pr,
|
|
3497
3497
|
errorPolicy: "all",
|
|
3498
3498
|
variables: {
|
|
3499
3499
|
ids: n
|
|
3500
3500
|
}
|
|
3501
3501
|
})).data.materials, kr = async (n, t, e, a, i) => (await y.getShadowGraphqlClient().mutate({
|
|
3502
|
-
mutation:
|
|
3502
|
+
mutation: xr,
|
|
3503
3503
|
errorPolicy: "all",
|
|
3504
3504
|
fetchPolicy: "no-cache",
|
|
3505
3505
|
variables: {
|
|
@@ -3534,14 +3534,14 @@ class Mr {
|
|
|
3534
3534
|
if (!i) throw new R("Failed to get asset from cache!");
|
|
3535
3535
|
return i;
|
|
3536
3536
|
}
|
|
3537
|
-
const a = (async () => (await
|
|
3537
|
+
const a = (async () => (await De([t]))[0])();
|
|
3538
3538
|
return this.cache.set(t, a), a;
|
|
3539
3539
|
}
|
|
3540
3540
|
/**
|
|
3541
3541
|
* Retrieves the asset from the server, bypassing cache (but still writing the result to cache)
|
|
3542
3542
|
*/
|
|
3543
3543
|
async getFromServer(t) {
|
|
3544
|
-
const a = (async () => (await
|
|
3544
|
+
const a = (async () => (await De([t]))[0])();
|
|
3545
3545
|
return this.cache.set(t, a), a;
|
|
3546
3546
|
}
|
|
3547
3547
|
keyFromURL(t) {
|
|
@@ -3574,7 +3574,7 @@ class Mr {
|
|
|
3574
3574
|
async getMaterialLocalOrFromServer(t) {
|
|
3575
3575
|
if (this.materialCache.has(t))
|
|
3576
3576
|
return this.materialCache.get(t);
|
|
3577
|
-
const a = (async () => (await
|
|
3577
|
+
const a = (async () => (await Fr([t]))[0])();
|
|
3578
3578
|
return this.materialCache.set(t, a), a;
|
|
3579
3579
|
}
|
|
3580
3580
|
/**
|
|
@@ -3613,7 +3613,7 @@ class Mr {
|
|
|
3613
3613
|
}
|
|
3614
3614
|
const i = (async () => {
|
|
3615
3615
|
const r = await y.getShadowGraphqlClient().mutate({
|
|
3616
|
-
mutation:
|
|
3616
|
+
mutation: Dr,
|
|
3617
3617
|
fetchPolicy: "no-cache",
|
|
3618
3618
|
errorPolicy: "all",
|
|
3619
3619
|
variables: {
|
|
@@ -3647,7 +3647,7 @@ class Mr {
|
|
|
3647
3647
|
async postProcessFileUpload(t, e) {
|
|
3648
3648
|
if (e === "image/svg+xml") {
|
|
3649
3649
|
const a = await t.blob.text(), o = new window.DOMParser().parseFromString(a, "image/svg+xml").documentElement;
|
|
3650
|
-
if (!o) throw new
|
|
3650
|
+
if (!o) throw new Dt("Failed to read SVG.");
|
|
3651
3651
|
vr(o);
|
|
3652
3652
|
const l = Pt().serializeToString(o);
|
|
3653
3653
|
return {
|
|
@@ -3842,7 +3842,7 @@ const Zt = new Tr(), On = C`
|
|
|
3842
3842
|
}
|
|
3843
3843
|
`, Nr = C`
|
|
3844
3844
|
${re(!1)}
|
|
3845
|
-
${
|
|
3845
|
+
${Fa}
|
|
3846
3846
|
${On}
|
|
3847
3847
|
query GetOptions($ids: [String]!) {
|
|
3848
3848
|
options(ids: $ids) {
|
|
@@ -4529,7 +4529,7 @@ const J = new $r(), $n = C`
|
|
|
4529
4529
|
}
|
|
4530
4530
|
`, ao = (n) => C`
|
|
4531
4531
|
${re(n)}
|
|
4532
|
-
${
|
|
4532
|
+
${Fa}
|
|
4533
4533
|
${On}
|
|
4534
4534
|
${Xr}
|
|
4535
4535
|
${Zr}
|
|
@@ -5094,14 +5094,14 @@ const J = new $r(), $n = C`
|
|
|
5094
5094
|
timestamp
|
|
5095
5095
|
}
|
|
5096
5096
|
}
|
|
5097
|
-
`, Ut = [
|
|
5097
|
+
`, Ut = [E.SilentIllustration, E.ProductOverlay], uo = async (n) => {
|
|
5098
5098
|
const t = [];
|
|
5099
5099
|
n.introduction && t.push({
|
|
5100
5100
|
name: "Introduction",
|
|
5101
5101
|
title: n.name,
|
|
5102
5102
|
renderableSteps: [
|
|
5103
5103
|
{
|
|
5104
|
-
type:
|
|
5104
|
+
type: E.Introduction,
|
|
5105
5105
|
stepName: "Introduction",
|
|
5106
5106
|
stepTitle: n.name,
|
|
5107
5107
|
helpText: n.introduction,
|
|
@@ -5136,7 +5136,7 @@ const J = new $r(), $n = C`
|
|
|
5136
5136
|
title: e,
|
|
5137
5137
|
renderableSteps: [
|
|
5138
5138
|
{
|
|
5139
|
-
type:
|
|
5139
|
+
type: E.Finish,
|
|
5140
5140
|
stepName: "Finish",
|
|
5141
5141
|
stepTitle: e,
|
|
5142
5142
|
helpText: "",
|
|
@@ -5158,7 +5158,7 @@ const J = new $r(), $n = C`
|
|
|
5158
5158
|
);
|
|
5159
5159
|
}
|
|
5160
5160
|
return !1;
|
|
5161
|
-
}),
|
|
5161
|
+
}), go = (n, t) => {
|
|
5162
5162
|
const e = {
|
|
5163
5163
|
name: n.name,
|
|
5164
5164
|
title: n.title,
|
|
@@ -5166,12 +5166,12 @@ const J = new $r(), $n = C`
|
|
|
5166
5166
|
silentSteps: n.silentSteps.filter((a) => bt(a, t))
|
|
5167
5167
|
};
|
|
5168
5168
|
return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
|
|
5169
|
-
}, vt = (n, t) => n.map((e) =>
|
|
5169
|
+
}, vt = (n, t) => n.map((e) => go(e, t)).filter((e) => e !== null), mo = async (n, t, e = !1) => {
|
|
5170
5170
|
const a = vt(n, t), i = [];
|
|
5171
5171
|
for (const o of a)
|
|
5172
5172
|
for (const s of o.renderableSteps) {
|
|
5173
5173
|
const l = (s.option?.variants || []).length;
|
|
5174
|
-
s.silent || (s.type ===
|
|
5174
|
+
s.silent || (s.type === E.Model || s.type === E.Material || s.type === E.Picture || s.type === E.Shape ? (l > 1 || e) && i.push(s.stepName) : i.push(s.stepName));
|
|
5175
5175
|
}
|
|
5176
5176
|
const r = a.filter((o) => o.renderableSteps.filter(
|
|
5177
5177
|
(l) => i.includes(l.stepName)
|
|
@@ -5257,7 +5257,7 @@ class qn {
|
|
|
5257
5257
|
}
|
|
5258
5258
|
}
|
|
5259
5259
|
}
|
|
5260
|
-
const
|
|
5260
|
+
const T = () => {
|
|
5261
5261
|
const n = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
|
|
5262
5262
|
return n() + n() + "-" + n() + "-" + n() + "-" + n() + "-" + n() + n() + n();
|
|
5263
5263
|
}, po = ({
|
|
@@ -5275,14 +5275,14 @@ const M = () => {
|
|
|
5275
5275
|
viewBox: A,
|
|
5276
5276
|
width: u
|
|
5277
5277
|
}) => {
|
|
5278
|
-
const h = e || 0,
|
|
5278
|
+
const h = e || 0, g = 2 * (l?.scale || 1), m = A || { x: 0, y: 0, width: u, height: r }, p = `${m.x} ${m.y} ${m.width} ${m.height}`, f = T(), S = a.purpose === Kt.FreeDesign && /* @__PURE__ */ B("defs", { children: /* @__PURE__ */ B("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ B("rect", { width: m.width, height: m.height, rx: h }) }) }), w = a.colorProfiles?.map((b, P) => (
|
|
5279
5279
|
/* @ts-ignore */
|
|
5280
|
-
/* @__PURE__ */
|
|
5281
|
-
)),
|
|
5282
|
-
...
|
|
5280
|
+
/* @__PURE__ */ B("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, P)
|
|
5281
|
+
)), x = i.map((b) => ({
|
|
5282
|
+
...b,
|
|
5283
5283
|
_renderingConfiguration: a,
|
|
5284
5284
|
mask: l ? `url(#viewmask-${f})` : void 0
|
|
5285
|
-
})),
|
|
5285
|
+
})), v = Ma(x);
|
|
5286
5286
|
return /* @__PURE__ */ dt(
|
|
5287
5287
|
"svg",
|
|
5288
5288
|
{
|
|
@@ -5300,29 +5300,29 @@ const M = () => {
|
|
|
5300
5300
|
maxHeight: o,
|
|
5301
5301
|
position: c
|
|
5302
5302
|
},
|
|
5303
|
-
viewBox:
|
|
5303
|
+
viewBox: p,
|
|
5304
5304
|
children: [
|
|
5305
5305
|
w,
|
|
5306
5306
|
S,
|
|
5307
|
-
!!n && /* @__PURE__ */
|
|
5307
|
+
!!n && /* @__PURE__ */ B(
|
|
5308
5308
|
"rect",
|
|
5309
5309
|
{
|
|
5310
5310
|
id: "layout-background",
|
|
5311
|
-
width:
|
|
5312
|
-
height:
|
|
5311
|
+
width: m.width,
|
|
5312
|
+
height: m.height,
|
|
5313
5313
|
fill: n,
|
|
5314
5314
|
rx: h
|
|
5315
5315
|
}
|
|
5316
5316
|
),
|
|
5317
|
-
/* @__PURE__ */
|
|
5317
|
+
/* @__PURE__ */ B(
|
|
5318
5318
|
"g",
|
|
5319
5319
|
{
|
|
5320
5320
|
id: "element-group",
|
|
5321
5321
|
clipPath: a.purpose === Kt.FreeDesign ? "url(#viewboxClip)" : void 0,
|
|
5322
|
-
children:
|
|
5322
|
+
children: v.map((b) => Zn(b)).filter((b) => !!b)
|
|
5323
5323
|
}
|
|
5324
5324
|
),
|
|
5325
|
-
l && /* @__PURE__ */
|
|
5325
|
+
l && /* @__PURE__ */ B(
|
|
5326
5326
|
"rect",
|
|
5327
5327
|
{
|
|
5328
5328
|
x: l.x,
|
|
@@ -5331,22 +5331,22 @@ const M = () => {
|
|
|
5331
5331
|
height: l.height,
|
|
5332
5332
|
fill: "none",
|
|
5333
5333
|
stroke: l.hidden ? "none" : t || "#aaaaaa",
|
|
5334
|
-
strokeWidth:
|
|
5335
|
-
strokeDasharray: `${
|
|
5334
|
+
strokeWidth: g / 2,
|
|
5335
|
+
strokeDasharray: `${g * 2} ${g}`
|
|
5336
5336
|
}
|
|
5337
5337
|
),
|
|
5338
5338
|
l && /* @__PURE__ */ dt("mask", { id: `viewmask-${f}`, children: [
|
|
5339
|
-
/* @__PURE__ */
|
|
5339
|
+
/* @__PURE__ */ B(
|
|
5340
5340
|
"rect",
|
|
5341
5341
|
{
|
|
5342
|
-
x:
|
|
5343
|
-
y:
|
|
5344
|
-
width:
|
|
5345
|
-
height:
|
|
5342
|
+
x: m.x,
|
|
5343
|
+
y: m.y,
|
|
5344
|
+
width: m.width,
|
|
5345
|
+
height: m.height,
|
|
5346
5346
|
fill: "black"
|
|
5347
5347
|
}
|
|
5348
5348
|
),
|
|
5349
|
-
/* @__PURE__ */
|
|
5349
|
+
/* @__PURE__ */ B(
|
|
5350
5350
|
"rect",
|
|
5351
5351
|
{
|
|
5352
5352
|
x: l.x,
|
|
@@ -5361,12 +5361,12 @@ const M = () => {
|
|
|
5361
5361
|
}
|
|
5362
5362
|
);
|
|
5363
5363
|
}, dd = (n, t, e, a, i) => {
|
|
5364
|
-
const r = wt(i), o = e / 2, s = a / 2, l = n + o, c = t + s, d = Math.sin(r), A = Math.cos(r), u = o, h = o,
|
|
5364
|
+
const r = wt(i), o = e / 2, s = a / 2, l = n + o, c = t + s, d = Math.sin(r), A = Math.cos(r), u = o, h = o, g = -s, m = s, p = u * A - g * d, f = h * A - m * d, S = u * d + g * A, w = h * d + m * A, x = Math.max(Math.abs(p), Math.abs(f)), v = Math.max(Math.abs(S), Math.abs(w));
|
|
5365
5365
|
return {
|
|
5366
|
-
minX: l -
|
|
5367
|
-
maxX: l +
|
|
5368
|
-
minY: c -
|
|
5369
|
-
maxY: c +
|
|
5366
|
+
minX: l - x,
|
|
5367
|
+
maxX: l + x,
|
|
5368
|
+
minY: c - v,
|
|
5369
|
+
maxY: c + v
|
|
5370
5370
|
};
|
|
5371
5371
|
}, Ad = (n, t, e) => {
|
|
5372
5372
|
const a = Math.sqrt(Math.pow(t.x - n.x, 2) + Math.pow(t.y - n.y, 2)), i = Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2)), r = Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2));
|
|
@@ -5377,10 +5377,10 @@ const M = () => {
|
|
|
5377
5377
|
x: (n.x - t.x) * i - (n.y - t.y) * a + t.x,
|
|
5378
5378
|
y: (n.x - t.x) * a + (n.y - t.y) * i + t.y
|
|
5379
5379
|
};
|
|
5380
|
-
},
|
|
5380
|
+
}, gd = (n, t) => ({
|
|
5381
5381
|
x: (n.x + t.x) / 2,
|
|
5382
5382
|
y: (n.y + t.y) / 2
|
|
5383
|
-
}),
|
|
5383
|
+
}), md = (n, t, e, a) => ({
|
|
5384
5384
|
x: n.x + t?.x * e,
|
|
5385
5385
|
y: n.y + t?.y * a
|
|
5386
5386
|
}), pd = (n, t, e, a) => ({
|
|
@@ -5389,7 +5389,7 @@ const M = () => {
|
|
|
5389
5389
|
}), fd = (n, t, e, a) => ({
|
|
5390
5390
|
x: n.x + (t?.x + t?.width) * e,
|
|
5391
5391
|
y: n.y + (t?.y + t?.height) * a
|
|
5392
|
-
}),
|
|
5392
|
+
}), xt = (n) => {
|
|
5393
5393
|
switch (n) {
|
|
5394
5394
|
case Y.North:
|
|
5395
5395
|
return Y.East;
|
|
@@ -5408,7 +5408,7 @@ const M = () => {
|
|
|
5408
5408
|
case Y.Southwest:
|
|
5409
5409
|
return Y.Northwest;
|
|
5410
5410
|
}
|
|
5411
|
-
}, Cd = (n, t) => t > 45 && t <= 135 ?
|
|
5411
|
+
}, Cd = (n, t) => t > 45 && t <= 135 ? xt(n) : t > 135 && t <= 225 ? xt(xt(n)) : t > 225 && t <= 315 ? xt(xt(xt(n))) : n, wd = (n, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
|
5412
5412
|
const a = wt(n.rotation), i = {
|
|
5413
5413
|
x: t.x + n.x * e.x,
|
|
5414
5414
|
y: t.x + n.y * e.y
|
|
@@ -5440,7 +5440,7 @@ const M = () => {
|
|
|
5440
5440
|
};
|
|
5441
5441
|
}, yd = 0.352778, Sd = 0.035277, Hn = (n) => {
|
|
5442
5442
|
const t = n.rotation || 0, e = wt(t), a = Math.cos(e), i = -Math.sin(e);
|
|
5443
|
-
return /* @__PURE__ */
|
|
5443
|
+
return /* @__PURE__ */ B("g", { mask: n.stepName || n.productOverlay ? void 0 : n.mask, children: /* @__PURE__ */ B(
|
|
5444
5444
|
"g",
|
|
5445
5445
|
{
|
|
5446
5446
|
transform: `
|
|
@@ -5449,7 +5449,7 @@ const M = () => {
|
|
|
5449
5449
|
matrix(${a}, ${-i}, ${i}, ${a}, 0, 0)
|
|
5450
5450
|
matrix(1, 0, 0, 1, ${-n.width / 2}, ${-n.height / 2})
|
|
5451
5451
|
`,
|
|
5452
|
-
children: /* @__PURE__ */
|
|
5452
|
+
children: /* @__PURE__ */ B(
|
|
5453
5453
|
"image",
|
|
5454
5454
|
{
|
|
5455
5455
|
xlinkHref: n.src,
|
|
@@ -5463,7 +5463,7 @@ const M = () => {
|
|
|
5463
5463
|
}, jn = (n) => {
|
|
5464
5464
|
const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a = wt(e), i = Math.cos(a), r = -Math.sin(a), o = Ma(n.children);
|
|
5465
5465
|
return /* @__PURE__ */ dt(qt, { children: [
|
|
5466
|
-
/* @__PURE__ */
|
|
5466
|
+
/* @__PURE__ */ B("defs", { children: /* @__PURE__ */ B("clipPath", { id: t, preserveAspectRatio: "none", children: n.clipPath ? /* @__PURE__ */ B("path", { d: n.clipPath }) : /* @__PURE__ */ B("rect", { x: 0, y: 0, width: n.width, height: n.height }) }) }),
|
|
5467
5467
|
/* @__PURE__ */ dt(
|
|
5468
5468
|
"g",
|
|
5469
5469
|
{
|
|
@@ -5474,7 +5474,7 @@ const M = () => {
|
|
|
5474
5474
|
matrix(1, 0, 0, 1, ${-n.width / 2}, ${-n.height / 2})
|
|
5475
5475
|
`,
|
|
5476
5476
|
children: [
|
|
5477
|
-
n._renderingConfiguration?.debug ? /* @__PURE__ */
|
|
5477
|
+
n._renderingConfiguration?.debug ? /* @__PURE__ */ B(
|
|
5478
5478
|
"rect",
|
|
5479
5479
|
{
|
|
5480
5480
|
stroke: "red",
|
|
@@ -5486,7 +5486,7 @@ const M = () => {
|
|
|
5486
5486
|
height: n.height
|
|
5487
5487
|
}
|
|
5488
5488
|
) : void 0,
|
|
5489
|
-
o.map((l) => Zn(l)).filter((l) => !!l).map((l) => /* @__PURE__ */
|
|
5489
|
+
o.map((l) => Zn(l)).filter((l) => !!l).map((l) => /* @__PURE__ */ B("g", { clipPath: `url(#${t})`, children: l }))
|
|
5490
5490
|
]
|
|
5491
5491
|
}
|
|
5492
5492
|
)
|
|
@@ -5496,15 +5496,15 @@ const M = () => {
|
|
|
5496
5496
|
if (!n.pattern)
|
|
5497
5497
|
return "";
|
|
5498
5498
|
if (n.pattern.svg) {
|
|
5499
|
-
const A =
|
|
5499
|
+
const A = Da(n.pattern.svg, n.pattern.colors || {}, !1);
|
|
5500
5500
|
return ba(A);
|
|
5501
5501
|
}
|
|
5502
5502
|
return n.pattern.src;
|
|
5503
5503
|
};
|
|
5504
5504
|
if (!a())
|
|
5505
|
-
return /* @__PURE__ */
|
|
5506
|
-
const i = () => n.threshold ? n.invertThreshold ? "1 ".repeat(n.threshold) + "0 ".repeat(256 - n.threshold) : "0 ".repeat(n.threshold) + "1 ".repeat(256 - n.threshold) : "", r = () => /* @__PURE__ */
|
|
5507
|
-
/* @__PURE__ */
|
|
5505
|
+
return /* @__PURE__ */ B(qt, {});
|
|
5506
|
+
const i = () => n.threshold ? n.invertThreshold ? "1 ".repeat(n.threshold) + "0 ".repeat(256 - n.threshold) : "0 ".repeat(n.threshold) + "1 ".repeat(256 - n.threshold) : "", r = () => /* @__PURE__ */ B(qt, { children: n.useThreshold && /* @__PURE__ */ B("defs", { children: /* @__PURE__ */ dt("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
|
|
5507
|
+
/* @__PURE__ */ B(
|
|
5508
5508
|
"feColorMatrix",
|
|
5509
5509
|
{
|
|
5510
5510
|
type: "matrix",
|
|
@@ -5518,43 +5518,43 @@ const M = () => {
|
|
|
5518
5518
|
}
|
|
5519
5519
|
),
|
|
5520
5520
|
/* @__PURE__ */ dt("feComponentTransfer", { in: "greyscale", children: [
|
|
5521
|
-
/* @__PURE__ */
|
|
5522
|
-
/* @__PURE__ */
|
|
5523
|
-
/* @__PURE__ */
|
|
5521
|
+
/* @__PURE__ */ B("feFuncR", { type: "discrete", tableValues: i() }),
|
|
5522
|
+
/* @__PURE__ */ B("feFuncG", { type: "discrete", tableValues: i() }),
|
|
5523
|
+
/* @__PURE__ */ B("feFuncB", { type: "discrete", tableValues: i() })
|
|
5524
5524
|
] })
|
|
5525
5525
|
] }) }) }), o = n.rotation || 0, s = wt(o), l = Math.cos(s), c = -Math.sin(s), d = () => {
|
|
5526
|
-
const A = n.pattern?.x || 0, u = n.pattern?.y || 0, h = n.pattern?.width || 0,
|
|
5526
|
+
const A = n.pattern?.x || 0, u = n.pattern?.y || 0, h = n.pattern?.width || 0, g = n.pattern?.height || 0, m = n.pattern?.scaleX || 1, p = n.pattern?.scaleY || 1, f = n.pattern?.rotation || 0;
|
|
5527
5527
|
return [n.pattern?.svg ? {
|
|
5528
5528
|
id: `${t}-contents`,
|
|
5529
|
-
type:
|
|
5529
|
+
type: D.Illustration,
|
|
5530
5530
|
x: A,
|
|
5531
5531
|
y: u,
|
|
5532
5532
|
rotation: f,
|
|
5533
|
-
width: h *
|
|
5534
|
-
height:
|
|
5533
|
+
width: h * m,
|
|
5534
|
+
height: g * p,
|
|
5535
5535
|
src: a(),
|
|
5536
5536
|
svg: n.pattern?.svg,
|
|
5537
5537
|
colors: n.pattern?.colors
|
|
5538
5538
|
} : {
|
|
5539
5539
|
id: `${t}-contents`,
|
|
5540
|
-
type:
|
|
5540
|
+
type: D.Image,
|
|
5541
5541
|
x: A,
|
|
5542
5542
|
y: u,
|
|
5543
5543
|
rotation: f,
|
|
5544
|
-
width: h *
|
|
5545
|
-
height:
|
|
5544
|
+
width: h * m,
|
|
5545
|
+
height: g * p,
|
|
5546
5546
|
src: a()
|
|
5547
5547
|
}];
|
|
5548
5548
|
};
|
|
5549
5549
|
return /* @__PURE__ */ dt(qt, { children: [
|
|
5550
5550
|
r(),
|
|
5551
|
-
/* @__PURE__ */
|
|
5551
|
+
/* @__PURE__ */ B(
|
|
5552
5552
|
"g",
|
|
5553
5553
|
{
|
|
5554
5554
|
opacity: n.opacity,
|
|
5555
5555
|
mask: n.stepName ? void 0 : n.mask,
|
|
5556
5556
|
filter: n.useThreshold ? `url(#${e})` : void 0,
|
|
5557
|
-
children: /* @__PURE__ */
|
|
5557
|
+
children: /* @__PURE__ */ B(
|
|
5558
5558
|
"g",
|
|
5559
5559
|
{
|
|
5560
5560
|
transform: `
|
|
@@ -5564,7 +5564,7 @@ const M = () => {
|
|
|
5564
5564
|
matrix(1, 0, 0, 1, ${-n.width / 2}, ${-n.height / 2})
|
|
5565
5565
|
matrix(${n.scaleX}, 0, 0, ${n.scaleY}, 0, 0)
|
|
5566
5566
|
`,
|
|
5567
|
-
children: /* @__PURE__ */
|
|
5567
|
+
children: /* @__PURE__ */ B(
|
|
5568
5568
|
jn,
|
|
5569
5569
|
{
|
|
5570
5570
|
id: t,
|
|
@@ -5640,24 +5640,24 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5640
5640
|
return yt(n).getFont();
|
|
5641
5641
|
} catch {
|
|
5642
5642
|
if (wo(n)) {
|
|
5643
|
-
const a =
|
|
5644
|
-
return
|
|
5643
|
+
const a = Dn(n), i = la(a);
|
|
5644
|
+
return ga(n, i), i;
|
|
5645
5645
|
} else {
|
|
5646
5646
|
const a = await Oe(n, !0), i = la(a);
|
|
5647
|
-
return
|
|
5647
|
+
return ga(n, i), await tr(i, n), i;
|
|
5648
5648
|
}
|
|
5649
5649
|
}
|
|
5650
5650
|
})();
|
|
5651
5651
|
return Ke.set(n, e), e;
|
|
5652
5652
|
}, yo = (n) => {
|
|
5653
|
-
const t =
|
|
5654
|
-
return
|
|
5653
|
+
const t = Dn(n), e = la(t);
|
|
5654
|
+
return ga(n, e), e;
|
|
5655
5655
|
}, yt = (n) => {
|
|
5656
5656
|
const t = Yn.get(n);
|
|
5657
5657
|
if (t)
|
|
5658
5658
|
return t;
|
|
5659
5659
|
throw new Error("Font metrics unavailable for font");
|
|
5660
|
-
},
|
|
5660
|
+
}, ga = (n, t) => {
|
|
5661
5661
|
const e = new Co(t);
|
|
5662
5662
|
return Yn.set(n, e), e;
|
|
5663
5663
|
}, vd = async (n) => {
|
|
@@ -5666,35 +5666,35 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5666
5666
|
yn(d.innerHTML).stylesheet?.rules.forEach((u) => {
|
|
5667
5667
|
if (u.type === "font-face" && u.declarations) {
|
|
5668
5668
|
const h = u.declarations.find(
|
|
5669
|
-
(
|
|
5670
|
-
)?.value,
|
|
5671
|
-
h &&
|
|
5669
|
+
(p) => p.property === "font-family"
|
|
5670
|
+
)?.value, m = u.declarations.find((p) => p.property === "src")?.value?.match(/'(https.*?)'/)?.[1];
|
|
5671
|
+
h && m && i.set(h, m);
|
|
5672
5672
|
}
|
|
5673
5673
|
});
|
|
5674
5674
|
});
|
|
5675
5675
|
const o = e.querySelectorAll("tspan");
|
|
5676
5676
|
for (let d = 0; d < o.length; d++) {
|
|
5677
|
-
const A = o.item(d), u = A.closest("text"), h = A.closest("g"),
|
|
5677
|
+
const A = o.item(d), u = A.closest("text"), h = A.closest("g"), g = u.getAttribute("font-family"), m = await Qt(i.get(g)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"), w = m.getPath(
|
|
5678
5678
|
A.innerHTML,
|
|
5679
5679
|
0,
|
|
5680
5680
|
0,
|
|
5681
5681
|
parseInt(u.getAttribute("font-size") ?? "72")
|
|
5682
|
-
),
|
|
5683
|
-
let
|
|
5684
|
-
const
|
|
5685
|
-
|
|
5686
|
-
const
|
|
5682
|
+
), x = w.getBoundingBox().x2 - w.getBoundingBox().x1;
|
|
5683
|
+
let v = 0;
|
|
5684
|
+
const b = A.getAttribute("text-anchor");
|
|
5685
|
+
b === "middle" ? v = x / 2 : b === "end" && (v = x);
|
|
5686
|
+
const P = m.getPath(
|
|
5687
5687
|
A.innerHTML,
|
|
5688
|
-
parseFloat(A.getAttribute("x") ?? "0") -
|
|
5688
|
+
parseFloat(A.getAttribute("x") ?? "0") - v,
|
|
5689
5689
|
parseFloat(A.getAttribute("y") ?? "0"),
|
|
5690
5690
|
parseInt(u.getAttribute("font-size") ?? "72")
|
|
5691
5691
|
);
|
|
5692
|
-
|
|
5693
|
-
const
|
|
5694
|
-
h.appendChild(
|
|
5692
|
+
P.fill = p, P.stroke = f, P.strokeWidth = parseFloat(S ?? "0");
|
|
5693
|
+
const F = P.toSVG(2), O = t.parseFromString(F, "image/svg+xml").firstElementChild;
|
|
5694
|
+
h.appendChild(O);
|
|
5695
5695
|
}
|
|
5696
5696
|
return e.querySelectorAll("text").forEach((d) => d.remove()), Pt().serializeToString(a);
|
|
5697
|
-
},
|
|
5697
|
+
}, Fe = (n, t, e, a) => Math.max(bo(n.join(`
|
|
5698
5698
|
`), e, a), t), Ka = (n, t, e, a, i, r) => {
|
|
5699
5699
|
const o = (r || _n) * i.getApproximateHeight(), s = t.split(`
|
|
5700
5700
|
`);
|
|
@@ -5704,7 +5704,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5704
5704
|
lines: c,
|
|
5705
5705
|
requiredHeight: l.flatMap((d) => d.lines).length * (a * o),
|
|
5706
5706
|
fontSize: e,
|
|
5707
|
-
requiredWidth:
|
|
5707
|
+
requiredWidth: Fe(c, n.width, a, i)
|
|
5708
5708
|
};
|
|
5709
5709
|
} catch {
|
|
5710
5710
|
const c = t.split("");
|
|
@@ -5712,7 +5712,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5712
5712
|
lines: c,
|
|
5713
5713
|
requiredHeight: c.length * (a * o),
|
|
5714
5714
|
fontSize: e,
|
|
5715
|
-
requiredWidth:
|
|
5715
|
+
requiredWidth: Fe(c, n.width, a, i)
|
|
5716
5716
|
};
|
|
5717
5717
|
}
|
|
5718
5718
|
}, ye = (n, t, e, a) => {
|
|
@@ -5737,8 +5737,8 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5737
5737
|
l = Math.max(l, pt(d, e, a));
|
|
5738
5738
|
let u = c + 1, h = !0;
|
|
5739
5739
|
for (; u < o.length && h; ) {
|
|
5740
|
-
const
|
|
5741
|
-
|
|
5740
|
+
const g = o[u], m = pt(`${A.join(" ")} ${g}`, e, a);
|
|
5741
|
+
m <= t ? (A.push(g), l = Math.max(l, m), u++) : h = !1;
|
|
5742
5742
|
}
|
|
5743
5743
|
s.push(A.join(" ")), c = u;
|
|
5744
5744
|
}
|
|
@@ -5760,14 +5760,14 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5760
5760
|
return {
|
|
5761
5761
|
lines: s,
|
|
5762
5762
|
requiredHeight: t.height,
|
|
5763
|
-
requiredWidth:
|
|
5763
|
+
requiredWidth: Fe(s, t.width, o, i),
|
|
5764
5764
|
fontSize: t.fontSize
|
|
5765
5765
|
};
|
|
5766
5766
|
const l = t.width !== e.width != (t.height !== e.height);
|
|
5767
5767
|
return t.lineHeight === e.lineHeight && !l && e.input === n ? {
|
|
5768
5768
|
lines: s,
|
|
5769
5769
|
requiredHeight: t.height,
|
|
5770
|
-
requiredWidth:
|
|
5770
|
+
requiredWidth: Fe(s, t.width, o, i),
|
|
5771
5771
|
fontSize: So(s, i, r, t.width, t.height, a)
|
|
5772
5772
|
} : Ka(t, n, t.fontSize, o, i, a);
|
|
5773
5773
|
}, Eo = (n, t, e, a, i) => {
|
|
@@ -5826,7 +5826,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5826
5826
|
};
|
|
5827
5827
|
})()
|
|
5828
5828
|
} : n, _n = 1.1;
|
|
5829
|
-
function
|
|
5829
|
+
function Ft(n, t) {
|
|
5830
5830
|
return Xn(n, t.getTemplatingContext());
|
|
5831
5831
|
}
|
|
5832
5832
|
function Xn(n, t) {
|
|
@@ -5845,7 +5845,7 @@ const Po = (n) => {
|
|
|
5845
5845
|
const h = () => n.textFillImage ? `url("#${o}")` : n._renderingConfiguration?.spotColors && n.fillSpotColorDefinition ? `${n.fill} ${Tn(n.fillSpotColorDefinition)}` : n.fill;
|
|
5846
5846
|
return /* @__PURE__ */ dt(qt, { children: [
|
|
5847
5847
|
/* @__PURE__ */ dt("defs", { children: [
|
|
5848
|
-
n.textFillImage && /* @__PURE__ */
|
|
5848
|
+
n.textFillImage && /* @__PURE__ */ B(
|
|
5849
5849
|
"pattern",
|
|
5850
5850
|
{
|
|
5851
5851
|
id: o,
|
|
@@ -5854,7 +5854,7 @@ const Po = (n) => {
|
|
|
5854
5854
|
height: n.textFillImage.scale * n.textFillImage.height,
|
|
5855
5855
|
x: 0,
|
|
5856
5856
|
y: 0,
|
|
5857
|
-
children: /* @__PURE__ */
|
|
5857
|
+
children: /* @__PURE__ */ B(
|
|
5858
5858
|
"image",
|
|
5859
5859
|
{
|
|
5860
5860
|
href: n.textFillImage.src,
|
|
@@ -5865,7 +5865,7 @@ const Po = (n) => {
|
|
|
5865
5865
|
)
|
|
5866
5866
|
}
|
|
5867
5867
|
),
|
|
5868
|
-
/* @__PURE__ */
|
|
5868
|
+
/* @__PURE__ */ B(
|
|
5869
5869
|
"style",
|
|
5870
5870
|
{
|
|
5871
5871
|
type: "text/css",
|
|
@@ -5879,10 +5879,10 @@ const Po = (n) => {
|
|
|
5879
5879
|
}
|
|
5880
5880
|
}
|
|
5881
5881
|
),
|
|
5882
|
-
n.curved && n.paths ? /* @__PURE__ */
|
|
5882
|
+
n.curved && n.paths ? /* @__PURE__ */ B("path", { id: r, d: n.paths[0] }) : void 0
|
|
5883
5883
|
] }),
|
|
5884
|
-
n._renderingConfiguration?.debug ? /* @__PURE__ */
|
|
5885
|
-
/* @__PURE__ */
|
|
5884
|
+
n._renderingConfiguration?.debug ? /* @__PURE__ */ B("rect", { stroke: "blue", fill: "none", x: n.x, y: n.y, width: n.width, height: n.height }) : void 0,
|
|
5885
|
+
/* @__PURE__ */ B("g", { mask: n.stepName ? void 0 : n.mask, children: /* @__PURE__ */ B("g", { transform: `matrix(${a}, ${-i}, ${i}, ${a}, ${s}, ${l})`, children: /* @__PURE__ */ B(
|
|
5886
5886
|
"text",
|
|
5887
5887
|
{
|
|
5888
5888
|
xmlSpace: "preserve",
|
|
@@ -5897,14 +5897,14 @@ const Po = (n) => {
|
|
|
5897
5897
|
},
|
|
5898
5898
|
stroke: A,
|
|
5899
5899
|
strokeWidth: u,
|
|
5900
|
-
children: n.curved ? /* @__PURE__ */
|
|
5901
|
-
|
|
5900
|
+
children: n.curved ? /* @__PURE__ */ B(Do, { text: c, curvedPathId: r, align: n.align }) : d.map((g, m) => /* @__PURE__ */ B(
|
|
5901
|
+
xo,
|
|
5902
5902
|
{
|
|
5903
5903
|
align: n.vertical ? "center" : n.align,
|
|
5904
5904
|
fontSize: n.fontSize,
|
|
5905
|
-
thisLineIdx:
|
|
5905
|
+
thisLineIdx: m,
|
|
5906
5906
|
amountLines: d.length,
|
|
5907
|
-
text:
|
|
5907
|
+
text: g,
|
|
5908
5908
|
textboxHeight: n.height,
|
|
5909
5909
|
textboxWidth: n.width,
|
|
5910
5910
|
lineHeight: n.lineHeight,
|
|
@@ -5912,12 +5912,12 @@ const Po = (n) => {
|
|
|
5912
5912
|
verticalAlign: n.verticalAlign,
|
|
5913
5913
|
fontData: n.fontData
|
|
5914
5914
|
},
|
|
5915
|
-
|
|
5915
|
+
m
|
|
5916
5916
|
))
|
|
5917
5917
|
}
|
|
5918
5918
|
) }) })
|
|
5919
5919
|
] });
|
|
5920
|
-
},
|
|
5920
|
+
}, xo = (n) => {
|
|
5921
5921
|
const t = () => {
|
|
5922
5922
|
if (n.lineHeight !== void 0)
|
|
5923
5923
|
return n.lineHeight * n.fontSize;
|
|
@@ -5934,10 +5934,10 @@ const Po = (n) => {
|
|
|
5934
5934
|
const o = (n.amountLines - 1) / 2;
|
|
5935
5935
|
return (n.thisLineIdx - o) * i + n.fontSize / 4;
|
|
5936
5936
|
};
|
|
5937
|
-
return /* @__PURE__ */
|
|
5938
|
-
},
|
|
5937
|
+
return /* @__PURE__ */ B("tspan", { textAnchor: Kn(n.align), x: e(), y: `${a()}px`, children: n.text });
|
|
5938
|
+
}, Do = (n) => {
|
|
5939
5939
|
const t = `#${n.curvedPathId}`;
|
|
5940
|
-
return /* @__PURE__ */
|
|
5940
|
+
return /* @__PURE__ */ B(
|
|
5941
5941
|
"textPath",
|
|
5942
5942
|
{
|
|
5943
5943
|
startOffset: n.align === "left" ? "0%" : n.align === "right" ? "100%" : "50%",
|
|
@@ -5947,9 +5947,9 @@ const Po = (n) => {
|
|
|
5947
5947
|
children: n.text
|
|
5948
5948
|
}
|
|
5949
5949
|
);
|
|
5950
|
-
},
|
|
5950
|
+
}, Fo = (n) => {
|
|
5951
5951
|
if (n.cachedObjectURL && !n._renderingConfiguration?.omitCachedFields)
|
|
5952
|
-
return /* @__PURE__ */
|
|
5952
|
+
return /* @__PURE__ */ B(
|
|
5953
5953
|
Hn,
|
|
5954
5954
|
{
|
|
5955
5955
|
id: n.id,
|
|
@@ -5974,12 +5974,12 @@ const Po = (n) => {
|
|
|
5974
5974
|
throw new Error(
|
|
5975
5975
|
`Illustration element ${n.id} (stepName ${n.stepName}) lacked svg from src ${n.src} at render time.`
|
|
5976
5976
|
);
|
|
5977
|
-
return /* @__PURE__ */
|
|
5977
|
+
return /* @__PURE__ */ B("g", { mask: n.stepName ? void 0 : n.mask, children: /* @__PURE__ */ B(
|
|
5978
5978
|
"g",
|
|
5979
5979
|
{
|
|
5980
5980
|
transform: r,
|
|
5981
5981
|
dangerouslySetInnerHTML: {
|
|
5982
|
-
__html:
|
|
5982
|
+
__html: xa(
|
|
5983
5983
|
n.svg,
|
|
5984
5984
|
n.width,
|
|
5985
5985
|
n.height,
|
|
@@ -5992,7 +5992,7 @@ const Po = (n) => {
|
|
|
5992
5992
|
};
|
|
5993
5993
|
class ko {
|
|
5994
5994
|
constructor() {
|
|
5995
|
-
this.id =
|
|
5995
|
+
this.id = T(), this.stateCallbacks = [], this.prevCommands = [], this.nextCommands = [];
|
|
5996
5996
|
}
|
|
5997
5997
|
registerStateCallback(t) {
|
|
5998
5998
|
this.stateCallbacks.push(t);
|
|
@@ -6080,9 +6080,9 @@ class ko {
|
|
|
6080
6080
|
return { ...t, transaction: e.apply(a) };
|
|
6081
6081
|
}
|
|
6082
6082
|
}
|
|
6083
|
-
const Zn = (n) => n.type ===
|
|
6083
|
+
const Zn = (n) => n.type === D.Image ? /* @__PURE__ */ B(Hn, { ...n }, n.id) : n.type === D.Frame ? /* @__PURE__ */ B(fo, { ...n }, n.id) : n.type === D.Illustration ? /* @__PURE__ */ B(Fo, { ...n }, n.id) : n.type === D.Textbox ? /* @__PURE__ */ B(Po, { ...n }, n.id) : n.type === D.Group ? /* @__PURE__ */ B(jn, { ...n }, n.id) : null, ka = (n, t, e) => {
|
|
6084
6084
|
const a = e.renderingConfiguration, i = a?.removeExcludedElements ? t.filter((r) => !r.excludeFromExport) : t;
|
|
6085
|
-
return /* @__PURE__ */
|
|
6085
|
+
return /* @__PURE__ */ B(
|
|
6086
6086
|
po,
|
|
6087
6087
|
{
|
|
6088
6088
|
preserveAspectRatio: void 0,
|
|
@@ -6128,13 +6128,13 @@ const le = (n) => {
|
|
|
6128
6128
|
if (n.defaultVariant !== void 0)
|
|
6129
6129
|
return t.find((e) => e.id === n.defaultVariant);
|
|
6130
6130
|
}
|
|
6131
|
-
},
|
|
6131
|
+
}, gt = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map(), ti = async (n, t) => {
|
|
6132
6132
|
if (!t) {
|
|
6133
6133
|
if (!n) throw new Error("No region or src supplied. Cannot construct frame!");
|
|
6134
|
-
return
|
|
6134
|
+
return ma(n);
|
|
6135
6135
|
}
|
|
6136
6136
|
return nt(t);
|
|
6137
|
-
},
|
|
6137
|
+
}, ma = (n) => {
|
|
6138
6138
|
const t = n.width, e = n.height;
|
|
6139
6139
|
return `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${t} ${e}'>
|
|
6140
6140
|
<path id="target-path" d='M0 0 h ${t} v ${e} h ${-t} Z' />
|
|
@@ -6199,8 +6199,8 @@ const le = (n) => {
|
|
|
6199
6199
|
zoom: o
|
|
6200
6200
|
};
|
|
6201
6201
|
}, pa = async (n) => {
|
|
6202
|
-
if (
|
|
6203
|
-
return
|
|
6202
|
+
if (gt.has(n))
|
|
6203
|
+
return gt.get(n);
|
|
6204
6204
|
if (n.startsWith("data:image/svg+xml")) {
|
|
6205
6205
|
const e = Ri(n), a = new TextDecoder().decode(e.buffer), i = ei(a), r = {
|
|
6206
6206
|
src: n,
|
|
@@ -6208,7 +6208,7 @@ const le = (n) => {
|
|
|
6208
6208
|
height: i.height,
|
|
6209
6209
|
aspect: i.width / i.height
|
|
6210
6210
|
};
|
|
6211
|
-
return
|
|
6211
|
+
return gt.set(n, r), r;
|
|
6212
6212
|
}
|
|
6213
6213
|
if ((n.split(".").pop()?.toLowerCase() ?? "") === "svg") {
|
|
6214
6214
|
const e = await Na(n), a = e.width, i = e.height, r = {
|
|
@@ -6217,7 +6217,7 @@ const le = (n) => {
|
|
|
6217
6217
|
height: i,
|
|
6218
6218
|
aspect: a / i
|
|
6219
6219
|
};
|
|
6220
|
-
return
|
|
6220
|
+
return gt.set(n, r), r;
|
|
6221
6221
|
} else {
|
|
6222
6222
|
const e = await Oe(n, !0), a = await Ue(e), i = {
|
|
6223
6223
|
src: n,
|
|
@@ -6225,7 +6225,7 @@ const le = (n) => {
|
|
|
6225
6225
|
height: a.height,
|
|
6226
6226
|
aspect: a.width / a.height
|
|
6227
6227
|
};
|
|
6228
|
-
return
|
|
6228
|
+
return gt.set(n, i), i;
|
|
6229
6229
|
}
|
|
6230
6230
|
}, Na = async (n) => {
|
|
6231
6231
|
const t = await nt(n);
|
|
@@ -6273,12 +6273,12 @@ const le = (n) => {
|
|
|
6273
6273
|
createImage: ie,
|
|
6274
6274
|
DOMParser: Ba(),
|
|
6275
6275
|
fetch: it
|
|
6276
|
-
}), u = o.getAttribute("width"), h = o.getAttribute("height"),
|
|
6276
|
+
}), u = o.getAttribute("width"), h = o.getAttribute("height"), g = 2048;
|
|
6277
6277
|
if (h && u) {
|
|
6278
|
-
const
|
|
6279
|
-
f > 1 ? A.resize(
|
|
6278
|
+
const m = parseFloat(h), f = parseFloat(u) / m;
|
|
6279
|
+
f > 1 ? A.resize(g, g / f) : A.resize(g * f, g);
|
|
6280
6280
|
} else
|
|
6281
|
-
A.resize(
|
|
6281
|
+
A.resize(g, g);
|
|
6282
6282
|
return await A.render(), await t(c);
|
|
6283
6283
|
})();
|
|
6284
6284
|
return Ze.set(n, a), a;
|
|
@@ -6296,17 +6296,17 @@ const le = (n) => {
|
|
|
6296
6296
|
rotation: 0,
|
|
6297
6297
|
panelId: n.layoutState.layout.panelId
|
|
6298
6298
|
};
|
|
6299
|
-
if (e && t ===
|
|
6299
|
+
if (e && t === D.Illustration) {
|
|
6300
6300
|
const l = await lt(await ai(e)), u = At().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
|
|
6301
6301
|
if (!u) throw new Error("SVG missing viewBox.");
|
|
6302
|
-
const h = s.height,
|
|
6302
|
+
const h = s.height, g = u.split(" "), m = parseFloat(g[2]) || 1, p = parseFloat(g[3]) || 1, f = m / p;
|
|
6303
6303
|
s.height = s.width / f, s.top += (h - s.height) / 2;
|
|
6304
6304
|
}
|
|
6305
|
-
if (e && t ===
|
|
6305
|
+
if (e && t === D.Image) {
|
|
6306
6306
|
const l = s.height, c = await Oe(e), d = await Ue(c), A = d.width / d.height;
|
|
6307
6307
|
s.height = s.width / A, s.top += (l - s.height) / 2;
|
|
6308
6308
|
}
|
|
6309
|
-
if (e && t ===
|
|
6309
|
+
if (e && t === D.Textbox && a?.text && a?.fontScale) {
|
|
6310
6310
|
await Qt(e);
|
|
6311
6311
|
const l = yt(e), c = pt(a.text, a?.fontScale, l);
|
|
6312
6312
|
s.width = Math.min(c, i.width * 0.85), s.left = i.x + i.width / 2 - s.width / 2;
|
|
@@ -6315,9 +6315,9 @@ const le = (n) => {
|
|
|
6315
6315
|
};
|
|
6316
6316
|
class Ed {
|
|
6317
6317
|
static async getFrame(t, e) {
|
|
6318
|
-
const a = await ti(e.region, e.src), i = await ze(a), r = e.region || await Vt(t,
|
|
6318
|
+
const a = await ti(e.region, e.src), i = await ze(a), r = e.region || await Vt(t, D.Frame);
|
|
6319
6319
|
return {
|
|
6320
|
-
id:
|
|
6320
|
+
id: T(),
|
|
6321
6321
|
x: r.left,
|
|
6322
6322
|
y: r.top,
|
|
6323
6323
|
width: r.width,
|
|
@@ -6330,7 +6330,7 @@ class Ed {
|
|
|
6330
6330
|
path: i.path,
|
|
6331
6331
|
dataWidth: i.width,
|
|
6332
6332
|
dataHeight: i.height,
|
|
6333
|
-
type:
|
|
6333
|
+
type: D.Frame,
|
|
6334
6334
|
disablePlaceholder: e.configuration.disablePlaceholder,
|
|
6335
6335
|
focalBlur: e.configuration.focalBlur,
|
|
6336
6336
|
focalBlurStrength: e.configuration.focalBlurStrength,
|
|
@@ -6341,11 +6341,11 @@ class Ed {
|
|
|
6341
6341
|
};
|
|
6342
6342
|
}
|
|
6343
6343
|
static async getImage(t, e) {
|
|
6344
|
-
const a = e.region || await Vt(t,
|
|
6344
|
+
const a = e.region || await Vt(t, D.Image, e.src);
|
|
6345
6345
|
return {
|
|
6346
|
-
id:
|
|
6346
|
+
id: T(),
|
|
6347
6347
|
src: e.src,
|
|
6348
|
-
type:
|
|
6348
|
+
type: D.Image,
|
|
6349
6349
|
y: a.top,
|
|
6350
6350
|
x: a.left,
|
|
6351
6351
|
rotation: a.rotation,
|
|
@@ -6364,13 +6364,13 @@ class Ed {
|
|
|
6364
6364
|
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = ke(c, {
|
|
6365
6365
|
vertical: a.vertical,
|
|
6366
6366
|
uppercase: a.uppercase
|
|
6367
|
-
}), A = e.region || await Vt(t,
|
|
6367
|
+
}), A = e.region || await Vt(t, D.Textbox, i, {
|
|
6368
6368
|
text: d,
|
|
6369
6369
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
|
6370
6370
|
}), u = se(
|
|
6371
6371
|
{
|
|
6372
|
-
id:
|
|
6373
|
-
type:
|
|
6372
|
+
id: T(),
|
|
6373
|
+
type: D.Textbox,
|
|
6374
6374
|
x: A.left,
|
|
6375
6375
|
y: A.top,
|
|
6376
6376
|
width: A.width,
|
|
@@ -6430,13 +6430,14 @@ class Ed {
|
|
|
6430
6430
|
</svg>
|
|
6431
6431
|
`, i = {};
|
|
6432
6432
|
i["spiff-fill-shape"] = { browserValue: e.color };
|
|
6433
|
-
const r = e.region || await Vt(t,
|
|
6433
|
+
const r = e.region?.item || await Vt(t, D.Illustration), o = T();
|
|
6434
6434
|
return {
|
|
6435
|
-
stepRegion: e.region,
|
|
6435
|
+
stepRegion: e.region?.item,
|
|
6436
|
+
stepRegionIndex: e.region?.index,
|
|
6436
6437
|
colors: i,
|
|
6437
6438
|
id: o,
|
|
6438
6439
|
svg: a,
|
|
6439
|
-
type:
|
|
6440
|
+
type: D.Illustration,
|
|
6440
6441
|
y: r.top,
|
|
6441
6442
|
x: r.left,
|
|
6442
6443
|
rotation: r.rotation,
|
|
@@ -6448,15 +6449,16 @@ class Ed {
|
|
|
6448
6449
|
};
|
|
6449
6450
|
}
|
|
6450
6451
|
static async getIllustration(t, e) {
|
|
6451
|
-
const a = e.region || await Vt(t,
|
|
6452
|
+
const a = e.region?.item || await Vt(t, D.Illustration, e.src), i = await lt(await ai(e.src)), r = await te(i.svg), o = T();
|
|
6452
6453
|
return {
|
|
6453
6454
|
cachedObjectURL: r,
|
|
6454
|
-
stepRegion: e.region,
|
|
6455
|
+
stepRegion: e.region?.item,
|
|
6456
|
+
stepRegionIndex: e.region?.index,
|
|
6455
6457
|
colors: i.colors,
|
|
6456
6458
|
id: o,
|
|
6457
6459
|
src: e.src,
|
|
6458
6460
|
svg: i.svg,
|
|
6459
|
-
type:
|
|
6461
|
+
type: D.Illustration,
|
|
6460
6462
|
y: a.top,
|
|
6461
6463
|
x: a.left,
|
|
6462
6464
|
rotation: a.rotation,
|
|
@@ -6483,7 +6485,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6483
6485
|
return {
|
|
6484
6486
|
layout: t.layout,
|
|
6485
6487
|
elements: a,
|
|
6486
|
-
modificationID:
|
|
6488
|
+
modificationID: T()
|
|
6487
6489
|
};
|
|
6488
6490
|
}, Za = async (n) => {
|
|
6489
6491
|
const t = [...Object.keys(n.layouts)], e = [...new Set(t)];
|
|
@@ -6495,7 +6497,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6495
6497
|
const s = o;
|
|
6496
6498
|
if (s.src && !s.svg) {
|
|
6497
6499
|
const l = await nt(s.src), c = await lt(l);
|
|
6498
|
-
s.svg =
|
|
6500
|
+
s.svg = xa(
|
|
6499
6501
|
c.svg,
|
|
6500
6502
|
s.width,
|
|
6501
6503
|
s.height,
|
|
@@ -6515,7 +6517,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6515
6517
|
}
|
|
6516
6518
|
for (const a in n.layouts) {
|
|
6517
6519
|
const i = n.layouts[a].elements.filter(
|
|
6518
|
-
(o) => o.type ===
|
|
6520
|
+
(o) => o.type === D.Illustration
|
|
6519
6521
|
);
|
|
6520
6522
|
for (let o = 0; o < i.length; ++o) {
|
|
6521
6523
|
const s = i[o];
|
|
@@ -6527,7 +6529,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6527
6529
|
}
|
|
6528
6530
|
}
|
|
6529
6531
|
const r = n.layouts[a].elements.filter(
|
|
6530
|
-
(o) => o.type ===
|
|
6532
|
+
(o) => o.type === D.Textbox
|
|
6531
6533
|
);
|
|
6532
6534
|
for (let o = 0; o < r.length; ++o) {
|
|
6533
6535
|
const s = r[o];
|
|
@@ -6535,7 +6537,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6535
6537
|
}
|
|
6536
6538
|
}
|
|
6537
6539
|
};
|
|
6538
|
-
class
|
|
6540
|
+
class $ {
|
|
6539
6541
|
undo() {
|
|
6540
6542
|
if (!this.oldState)
|
|
6541
6543
|
throw new Error("Cannot undo.");
|
|
@@ -6545,7 +6547,7 @@ class O {
|
|
|
6545
6547
|
this.oldState = t;
|
|
6546
6548
|
}
|
|
6547
6549
|
}
|
|
6548
|
-
class tn extends
|
|
6550
|
+
class tn extends $ {
|
|
6549
6551
|
constructor(t) {
|
|
6550
6552
|
super(), this.serializableWorkflow = t;
|
|
6551
6553
|
}
|
|
@@ -6556,7 +6558,7 @@ class tn extends O {
|
|
|
6556
6558
|
};
|
|
6557
6559
|
}
|
|
6558
6560
|
}
|
|
6559
|
-
class bd extends
|
|
6561
|
+
class bd extends $ {
|
|
6560
6562
|
constructor(t, e, a) {
|
|
6561
6563
|
super(), this.id = t, this.x = e, this.y = a;
|
|
6562
6564
|
}
|
|
@@ -6579,7 +6581,7 @@ class bd extends O {
|
|
|
6579
6581
|
};
|
|
6580
6582
|
}
|
|
6581
6583
|
}
|
|
6582
|
-
class Id extends
|
|
6584
|
+
class Id extends $ {
|
|
6583
6585
|
constructor(t, e) {
|
|
6584
6586
|
super(), this.id = t, this.angle = e;
|
|
6585
6587
|
}
|
|
@@ -6601,7 +6603,7 @@ class Id extends O {
|
|
|
6601
6603
|
};
|
|
6602
6604
|
}
|
|
6603
6605
|
}
|
|
6604
|
-
class Bd extends
|
|
6606
|
+
class Bd extends $ {
|
|
6605
6607
|
constructor(t, e, a) {
|
|
6606
6608
|
super(), this.id = t, this.width = Math.abs(e), this.height = Math.abs(a);
|
|
6607
6609
|
}
|
|
@@ -6632,7 +6634,7 @@ class Bd extends O {
|
|
|
6632
6634
|
};
|
|
6633
6635
|
}
|
|
6634
6636
|
}
|
|
6635
|
-
class L extends
|
|
6637
|
+
class L extends $ {
|
|
6636
6638
|
constructor(t) {
|
|
6637
6639
|
super(), this.commands = t;
|
|
6638
6640
|
}
|
|
@@ -6640,7 +6642,7 @@ class L extends O {
|
|
|
6640
6642
|
return this.oldState = t, this.commands.reduce((e, a) => a.apply(e), t);
|
|
6641
6643
|
}
|
|
6642
6644
|
}
|
|
6643
|
-
class ni extends
|
|
6645
|
+
class ni extends $ {
|
|
6644
6646
|
constructor(t) {
|
|
6645
6647
|
super(), this.layout = t;
|
|
6646
6648
|
}
|
|
@@ -6652,13 +6654,13 @@ class ni extends O {
|
|
|
6652
6654
|
[this.layout.id]: {
|
|
6653
6655
|
elements: [],
|
|
6654
6656
|
layout: { ...this.layout },
|
|
6655
|
-
modificationID:
|
|
6657
|
+
modificationID: T()
|
|
6656
6658
|
}
|
|
6657
6659
|
}
|
|
6658
6660
|
};
|
|
6659
6661
|
}
|
|
6660
6662
|
}
|
|
6661
|
-
class H extends
|
|
6663
|
+
class H extends $ {
|
|
6662
6664
|
/**
|
|
6663
6665
|
* @param initialParams The initial parameters to be set on this new object
|
|
6664
6666
|
* @param callback An optional callback function to be notified when the object has been instantiated
|
|
@@ -6683,7 +6685,7 @@ class H extends O {
|
|
|
6683
6685
|
[this.layout.id]: {
|
|
6684
6686
|
...t.layouts[this.layout.id],
|
|
6685
6687
|
elements: s,
|
|
6686
|
-
modificationID:
|
|
6688
|
+
modificationID: T()
|
|
6687
6689
|
}
|
|
6688
6690
|
}
|
|
6689
6691
|
};
|
|
@@ -6704,7 +6706,7 @@ class H extends O {
|
|
|
6704
6706
|
[this.layout.id]: {
|
|
6705
6707
|
...t.layouts[this.layout.id],
|
|
6706
6708
|
elements: o,
|
|
6707
|
-
modificationID:
|
|
6709
|
+
modificationID: T()
|
|
6708
6710
|
}
|
|
6709
6711
|
}
|
|
6710
6712
|
};
|
|
@@ -6717,7 +6719,7 @@ class H extends O {
|
|
|
6717
6719
|
return a !== void 0 ? a + 1 : 0;
|
|
6718
6720
|
}
|
|
6719
6721
|
}
|
|
6720
|
-
class Rt extends
|
|
6722
|
+
class Rt extends $ {
|
|
6721
6723
|
constructor(t) {
|
|
6722
6724
|
super(), this.id = t;
|
|
6723
6725
|
}
|
|
@@ -6727,7 +6729,7 @@ class Rt extends O {
|
|
|
6727
6729
|
const a = Object.values(t.layouts).map((r) => (r.elements.filter((s) => s.id !== this.id).length !== r.elements.length && (e = !0), {
|
|
6728
6730
|
...r,
|
|
6729
6731
|
elements: r.elements.filter((s) => s.id !== this.id),
|
|
6730
|
-
modificationID:
|
|
6732
|
+
modificationID: T()
|
|
6731
6733
|
}));
|
|
6732
6734
|
e || console.log(`Failed to delete element ${this.id}`);
|
|
6733
6735
|
const i = {};
|
|
@@ -6739,7 +6741,7 @@ class Rt extends O {
|
|
|
6739
6741
|
};
|
|
6740
6742
|
}
|
|
6741
6743
|
}
|
|
6742
|
-
class To extends
|
|
6744
|
+
class To extends $ {
|
|
6743
6745
|
constructor(t, e, a) {
|
|
6744
6746
|
super(), this.id = t, this.color = e, this.textFillSpotColor = a;
|
|
6745
6747
|
}
|
|
@@ -6763,7 +6765,7 @@ class To extends O {
|
|
|
6763
6765
|
};
|
|
6764
6766
|
}
|
|
6765
6767
|
}
|
|
6766
|
-
class ta extends
|
|
6768
|
+
class ta extends $ {
|
|
6767
6769
|
constructor(t, e) {
|
|
6768
6770
|
super(), this.id = t, this.imageFill = e;
|
|
6769
6771
|
}
|
|
@@ -6785,7 +6787,7 @@ class ta extends O {
|
|
|
6785
6787
|
};
|
|
6786
6788
|
}
|
|
6787
6789
|
}
|
|
6788
|
-
class No extends
|
|
6790
|
+
class No extends $ {
|
|
6789
6791
|
constructor(t, e) {
|
|
6790
6792
|
super(), this.id = t, this.size = e;
|
|
6791
6793
|
}
|
|
@@ -6807,7 +6809,7 @@ class No extends O {
|
|
|
6807
6809
|
};
|
|
6808
6810
|
}
|
|
6809
6811
|
}
|
|
6810
|
-
class en extends
|
|
6812
|
+
class en extends $ {
|
|
6811
6813
|
constructor(t, e) {
|
|
6812
6814
|
super(), this.id = t, this.fontData = e;
|
|
6813
6815
|
}
|
|
@@ -6829,7 +6831,7 @@ class en extends O {
|
|
|
6829
6831
|
};
|
|
6830
6832
|
}
|
|
6831
6833
|
}
|
|
6832
|
-
class Qo extends
|
|
6834
|
+
class Qo extends $ {
|
|
6833
6835
|
constructor(t, e) {
|
|
6834
6836
|
super(), this.id = t, this.align = e;
|
|
6835
6837
|
}
|
|
@@ -6851,7 +6853,7 @@ class Qo extends O {
|
|
|
6851
6853
|
};
|
|
6852
6854
|
}
|
|
6853
6855
|
}
|
|
6854
|
-
class Ro extends
|
|
6856
|
+
class Ro extends $ {
|
|
6855
6857
|
constructor(t, e, a) {
|
|
6856
6858
|
super(), this.id = t, this.imageData = e, this.offsets = a;
|
|
6857
6859
|
}
|
|
@@ -6876,7 +6878,7 @@ class Ro extends O {
|
|
|
6876
6878
|
const o = {
|
|
6877
6879
|
...e,
|
|
6878
6880
|
elements: r,
|
|
6879
|
-
modificationID:
|
|
6881
|
+
modificationID: T()
|
|
6880
6882
|
};
|
|
6881
6883
|
return {
|
|
6882
6884
|
...t,
|
|
@@ -6887,7 +6889,7 @@ class Ro extends O {
|
|
|
6887
6889
|
};
|
|
6888
6890
|
}
|
|
6889
6891
|
}
|
|
6890
|
-
class Oo extends
|
|
6892
|
+
class Oo extends $ {
|
|
6891
6893
|
constructor(t, e, a, i, r) {
|
|
6892
6894
|
super(), this.id = t, this.useThreshold = e, this.invertThreshold = a, this.threshold = i, this.thresholdSaturation = r;
|
|
6893
6895
|
}
|
|
@@ -6912,7 +6914,7 @@ class Oo extends O {
|
|
|
6912
6914
|
};
|
|
6913
6915
|
}
|
|
6914
6916
|
}
|
|
6915
|
-
class Pd extends
|
|
6917
|
+
class Pd extends $ {
|
|
6916
6918
|
constructor(t, e) {
|
|
6917
6919
|
super(), this.id = t, this.src = e;
|
|
6918
6920
|
}
|
|
@@ -6934,7 +6936,7 @@ class Pd extends O {
|
|
|
6934
6936
|
};
|
|
6935
6937
|
}
|
|
6936
6938
|
}
|
|
6937
|
-
class $o extends
|
|
6939
|
+
class $o extends $ {
|
|
6938
6940
|
constructor(t, e) {
|
|
6939
6941
|
super(), this.id = t, this.text = e;
|
|
6940
6942
|
}
|
|
@@ -6953,7 +6955,7 @@ class $o extends O {
|
|
|
6953
6955
|
};
|
|
6954
6956
|
}
|
|
6955
6957
|
}
|
|
6956
|
-
class ea extends
|
|
6958
|
+
class ea extends $ {
|
|
6957
6959
|
constructor(t, e, a) {
|
|
6958
6960
|
super(), this.id = t, this.strokeColor = e, this.strokeThickness = a;
|
|
6959
6961
|
}
|
|
@@ -6976,7 +6978,7 @@ class ea extends O {
|
|
|
6976
6978
|
};
|
|
6977
6979
|
}
|
|
6978
6980
|
}
|
|
6979
|
-
class fa extends
|
|
6981
|
+
class fa extends $ {
|
|
6980
6982
|
constructor(t, e, a) {
|
|
6981
6983
|
super(), this.id = t, this.className = e, this.fill = a;
|
|
6982
6984
|
}
|
|
@@ -7008,7 +7010,7 @@ class fa extends O {
|
|
|
7008
7010
|
};
|
|
7009
7011
|
}
|
|
7010
7012
|
}
|
|
7011
|
-
class Uo extends
|
|
7013
|
+
class Uo extends $ {
|
|
7012
7014
|
constructor(t, e, a) {
|
|
7013
7015
|
super(), this.id = t, this.svgBody = e, this.objectURL = a;
|
|
7014
7016
|
}
|
|
@@ -7031,7 +7033,7 @@ class Uo extends O {
|
|
|
7031
7033
|
};
|
|
7032
7034
|
}
|
|
7033
7035
|
}
|
|
7034
|
-
class
|
|
7036
|
+
class xd extends $ {
|
|
7035
7037
|
/**
|
|
7036
7038
|
* @param id The targeted element to bring to the front.
|
|
7037
7039
|
*/
|
|
@@ -7054,13 +7056,13 @@ class Dd extends O {
|
|
|
7054
7056
|
[a.layout.id]: {
|
|
7055
7057
|
...t.layouts[a.layout.id],
|
|
7056
7058
|
elements: r,
|
|
7057
|
-
modificationID:
|
|
7059
|
+
modificationID: T()
|
|
7058
7060
|
}
|
|
7059
7061
|
}
|
|
7060
7062
|
};
|
|
7061
7063
|
}
|
|
7062
7064
|
}
|
|
7063
|
-
class
|
|
7065
|
+
class Dd extends $ {
|
|
7064
7066
|
/**
|
|
7065
7067
|
* @param id The targeted element to bring to the back.
|
|
7066
7068
|
*/
|
|
@@ -7085,13 +7087,13 @@ class Fd extends O {
|
|
|
7085
7087
|
[a.layout.id]: {
|
|
7086
7088
|
...t.layouts[a.layout.id],
|
|
7087
7089
|
elements: r,
|
|
7088
|
-
modificationID:
|
|
7090
|
+
modificationID: T()
|
|
7089
7091
|
}
|
|
7090
7092
|
}
|
|
7091
7093
|
};
|
|
7092
7094
|
}
|
|
7093
7095
|
}
|
|
7094
|
-
class
|
|
7096
|
+
class Fd extends $ {
|
|
7095
7097
|
/**
|
|
7096
7098
|
* @param id The targeted element to bring to the front.
|
|
7097
7099
|
*/
|
|
@@ -7112,13 +7114,13 @@ class xd extends O {
|
|
|
7112
7114
|
[a.layout.id]: {
|
|
7113
7115
|
...t.layouts[a.layout.id],
|
|
7114
7116
|
elements: o,
|
|
7115
|
-
modificationID:
|
|
7117
|
+
modificationID: T()
|
|
7116
7118
|
}
|
|
7117
7119
|
}
|
|
7118
7120
|
};
|
|
7119
7121
|
}
|
|
7120
7122
|
}
|
|
7121
|
-
class kd extends
|
|
7123
|
+
class kd extends $ {
|
|
7122
7124
|
/**
|
|
7123
7125
|
* @param id The targeted element to bring to the front.
|
|
7124
7126
|
*/
|
|
@@ -7139,7 +7141,7 @@ class kd extends O {
|
|
|
7139
7141
|
[a.layout.id]: {
|
|
7140
7142
|
...t.layouts[a.layout.id],
|
|
7141
7143
|
elements: o,
|
|
7142
|
-
modificationID:
|
|
7144
|
+
modificationID: T()
|
|
7143
7145
|
}
|
|
7144
7146
|
}
|
|
7145
7147
|
};
|
|
@@ -7152,19 +7154,19 @@ class an {
|
|
|
7152
7154
|
if (!r)
|
|
7153
7155
|
throw new K(i);
|
|
7154
7156
|
let o = "";
|
|
7155
|
-
if (this.configuration.type ===
|
|
7157
|
+
if (this.configuration.type === E.ProductOverlay) {
|
|
7156
7158
|
let l = "";
|
|
7157
7159
|
if (this.product?.overlayImageUrl && (l = this.product.overlayImageUrl), o = l, !l)
|
|
7158
|
-
throw new
|
|
7160
|
+
throw new xe(this.configuration, "Couldn't find an asset for product overlay step");
|
|
7159
7161
|
}
|
|
7160
7162
|
const s = this.evaluateAssetType();
|
|
7161
|
-
if (s ===
|
|
7162
|
-
const l = this.configuration.type ===
|
|
7163
|
+
if (s === D.Image) {
|
|
7164
|
+
const l = this.configuration.type === E.SilentIllustration ? this.configuration.data.asset?.fileLink : this.product?.overlayImageUrl;
|
|
7163
7165
|
if (!l)
|
|
7164
7166
|
throw new Error("Undefined raster silent step source");
|
|
7165
7167
|
const c = {
|
|
7166
7168
|
stepName: this.configuration.stepName,
|
|
7167
|
-
id:
|
|
7169
|
+
id: T(),
|
|
7168
7170
|
src: l,
|
|
7169
7171
|
type: s,
|
|
7170
7172
|
y: i.top,
|
|
@@ -7174,7 +7176,7 @@ class an {
|
|
|
7174
7176
|
layer: i.layer,
|
|
7175
7177
|
layerIndex: i.layerIndex,
|
|
7176
7178
|
immutable: i.immutable,
|
|
7177
|
-
productOverlay: this.configuration.type ===
|
|
7179
|
+
productOverlay: this.configuration.type === E.ProductOverlay ? !0 : void 0,
|
|
7178
7180
|
rotation: i.rotation,
|
|
7179
7181
|
excludeFromExport: this.configuration.data.excludeFromPrint,
|
|
7180
7182
|
preserveAspectRatio: "none"
|
|
@@ -7187,17 +7189,17 @@ class an {
|
|
|
7187
7189
|
command: new H(c, r)
|
|
7188
7190
|
};
|
|
7189
7191
|
} else {
|
|
7190
|
-
const l = this.configuration.type ===
|
|
7192
|
+
const l = this.configuration.type === E.SilentIllustration ? this.configuration.data.asset?.fileLink : o, d = await lt(await (async () => new Promise((u, h) => {
|
|
7191
7193
|
if (!l) {
|
|
7192
7194
|
h("Undefined vector silent step source");
|
|
7193
7195
|
return;
|
|
7194
7196
|
}
|
|
7195
|
-
nt(l, !0).then((
|
|
7196
|
-
u(
|
|
7197
|
-
}).catch((
|
|
7197
|
+
nt(l, !0).then((g) => {
|
|
7198
|
+
u(g);
|
|
7199
|
+
}).catch((g) => console.error(g));
|
|
7198
7200
|
}))()), A = {
|
|
7199
7201
|
stepName: this.configuration.stepName,
|
|
7200
|
-
id:
|
|
7202
|
+
id: T(),
|
|
7201
7203
|
cachedObjectURL: await te(d.svg),
|
|
7202
7204
|
src: l,
|
|
7203
7205
|
svg: d.svg,
|
|
@@ -7211,7 +7213,7 @@ class an {
|
|
|
7211
7213
|
layerIndex: i.layerIndex,
|
|
7212
7214
|
rotation: i.rotation,
|
|
7213
7215
|
immutable: i.immutable,
|
|
7214
|
-
productOverlay: this.configuration.type ===
|
|
7216
|
+
productOverlay: this.configuration.type === E.ProductOverlay ? !0 : void 0,
|
|
7215
7217
|
excludeFromExport: this.configuration.data.excludeFromPrint
|
|
7216
7218
|
};
|
|
7217
7219
|
return {
|
|
@@ -7226,11 +7228,11 @@ class an {
|
|
|
7226
7228
|
}
|
|
7227
7229
|
async trigger() {
|
|
7228
7230
|
if (!this.configuration.data.regions)
|
|
7229
|
-
throw new
|
|
7230
|
-
if (this.configuration.type ===
|
|
7231
|
+
throw new xe(this.configuration, "Missing regions.");
|
|
7232
|
+
if (this.configuration.type === E.SilentIllustration) {
|
|
7231
7233
|
const t = this.configuration.data.regions.map(this.processRegion);
|
|
7232
7234
|
return Promise.all(t);
|
|
7233
|
-
} else return this.configuration.type ===
|
|
7235
|
+
} else return this.configuration.type === E.ProductOverlay ? Promise.all(
|
|
7234
7236
|
this.configuration.data.regions.map((t) => {
|
|
7235
7237
|
if (!this.layouts.find((a) => t.panelId === a.panelId))
|
|
7236
7238
|
throw new K(t);
|
|
@@ -7239,8 +7241,8 @@ class an {
|
|
|
7239
7241
|
) : Promise.reject("Unknown silent step. This is a bug");
|
|
7240
7242
|
}
|
|
7241
7243
|
evaluateAssetType() {
|
|
7242
|
-
const t = this.configuration.type ===
|
|
7243
|
-
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ?
|
|
7244
|
+
const t = this.configuration.type === E.ProductOverlay && this.product?.overlayImageUrl ? this.product.overlayImageUrl.toLowerCase() : this.configuration.data.asset?.fileLink?.toLowerCase().split("?")[0];
|
|
7245
|
+
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? D.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), D.Illustration);
|
|
7244
7246
|
}
|
|
7245
7247
|
}
|
|
7246
7248
|
const Lo = async (n) => {
|
|
@@ -7288,7 +7290,11 @@ class Vo {
|
|
|
7288
7290
|
const i = e.getSerializedStep(
|
|
7289
7291
|
t.stepName,
|
|
7290
7292
|
a.serializableWorkflow.steps
|
|
7291
|
-
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({
|
|
7293
|
+
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({
|
|
7294
|
+
id: c.id,
|
|
7295
|
+
region: c.stepRegion,
|
|
7296
|
+
regionIndex: c.stepRegionIndex
|
|
7297
|
+
}));
|
|
7292
7298
|
await e.setSelectionsAndElements(t.stepName, [], l, async () => {
|
|
7293
7299
|
const c = i?.storage?.videoShortUrl, d = i?.storage?.videoUrl;
|
|
7294
7300
|
e.updateStorage(t.stepName, {
|
|
@@ -7299,22 +7305,22 @@ class Vo {
|
|
|
7299
7305
|
}
|
|
7300
7306
|
async regenerateQRCode(t, e, a, i) {
|
|
7301
7307
|
const r = async () => {
|
|
7302
|
-
const h = (await
|
|
7303
|
-
return { asset: h, link:
|
|
7304
|
-
}, o = await new Promise((h,
|
|
7308
|
+
const h = (await De([e]))[0], g = h?.versions?.find((m) => m.name === "mpeg4")?.link;
|
|
7309
|
+
return { asset: h, link: g };
|
|
7310
|
+
}, o = await new Promise((h, g) => {
|
|
7305
7311
|
new ii(
|
|
7306
7312
|
async () => !!(await r()).link,
|
|
7307
7313
|
async () => {
|
|
7308
|
-
const
|
|
7309
|
-
if (!
|
|
7310
|
-
throw new _t(
|
|
7314
|
+
const m = await r();
|
|
7315
|
+
if (!m.link || !m.link)
|
|
7316
|
+
throw new _t(m.asset);
|
|
7311
7317
|
h({
|
|
7312
7318
|
rel: "mpeg4",
|
|
7313
|
-
href:
|
|
7319
|
+
href: m.link
|
|
7314
7320
|
});
|
|
7315
7321
|
},
|
|
7316
7322
|
() => {
|
|
7317
|
-
|
|
7323
|
+
g("Poller timed out with 40 attempts @ 3 second interval");
|
|
7318
7324
|
},
|
|
7319
7325
|
3e3,
|
|
7320
7326
|
40
|
|
@@ -7328,7 +7334,7 @@ class Vo {
|
|
|
7328
7334
|
throw new Re("Cannot create QR code, URL too long.");
|
|
7329
7335
|
const d = await Lo(c);
|
|
7330
7336
|
if (!i.data || !i.data.regions)
|
|
7331
|
-
throw new
|
|
7337
|
+
throw new xe(i, "Missing regions.");
|
|
7332
7338
|
const A = await this.regionElements(i), u = await this.command(d, A, a, i.stepName);
|
|
7333
7339
|
return u && (u.command && a.getCommandDispatcher()(u.command), u.followup && await u.followup()), await a.setSelectionsAndElements(i.stepName, [], A, async () => {
|
|
7334
7340
|
a.updateStorage(i.stepName, {
|
|
@@ -7338,7 +7344,7 @@ class Vo {
|
|
|
7338
7344
|
}), d;
|
|
7339
7345
|
}
|
|
7340
7346
|
async regionElements(t) {
|
|
7341
|
-
const e = (a) => ({ id:
|
|
7347
|
+
const e = (a, i) => ({ id: T(), region: a, regionIndex: i });
|
|
7342
7348
|
return t.data.regions.map(e);
|
|
7343
7349
|
}
|
|
7344
7350
|
async command(t, e, a, i) {
|
|
@@ -7353,10 +7359,11 @@ class Vo {
|
|
|
7353
7359
|
return new H(
|
|
7354
7360
|
{
|
|
7355
7361
|
stepRegion: d,
|
|
7362
|
+
stepRegionIndex: c.regionIndex,
|
|
7356
7363
|
stepName: i,
|
|
7357
7364
|
id: c.id,
|
|
7358
7365
|
src: s,
|
|
7359
|
-
type:
|
|
7366
|
+
type: D.Image,
|
|
7360
7367
|
y: d.top,
|
|
7361
7368
|
x: d.left,
|
|
7362
7369
|
width: d.width,
|
|
@@ -7375,7 +7382,7 @@ class Me {
|
|
|
7375
7382
|
constructor() {
|
|
7376
7383
|
this.frameSourceSvg = async (t, e) => {
|
|
7377
7384
|
if (!t)
|
|
7378
|
-
return
|
|
7385
|
+
return ma(e);
|
|
7379
7386
|
const a = t.asset;
|
|
7380
7387
|
if (!a)
|
|
7381
7388
|
throw new Bt(t);
|
|
@@ -7422,9 +7429,13 @@ class Me {
|
|
|
7422
7429
|
const i = e.getSerializedStep(
|
|
7423
7430
|
t.stepName,
|
|
7424
7431
|
a.serializableWorkflow.steps
|
|
7425
|
-
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({
|
|
7432
|
+
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({
|
|
7433
|
+
id: c.id,
|
|
7434
|
+
region: c.stepRegion,
|
|
7435
|
+
regionIndex: c.stepRegionIndex
|
|
7436
|
+
}));
|
|
7426
7437
|
if (!t.option || (t.option.variants || []).length === 0) {
|
|
7427
|
-
const c = t.data.regions.map((d) =>
|
|
7438
|
+
const c = t.data.regions.map((d) => ma(d));
|
|
7428
7439
|
e.updateStorage(t.stepName, {
|
|
7429
7440
|
currentFrameSources: c
|
|
7430
7441
|
});
|
|
@@ -7514,11 +7525,11 @@ class Me {
|
|
|
7514
7525
|
);
|
|
7515
7526
|
o && (o.command && i.getCommandDispatcher()(o.command), o.followup && await o.followup());
|
|
7516
7527
|
}
|
|
7517
|
-
getCreateElementCommand(t, e, a, i) {
|
|
7528
|
+
getCreateElementCommand(t, e, a, i, r) {
|
|
7518
7529
|
return new H(
|
|
7519
7530
|
{
|
|
7520
7531
|
id: t,
|
|
7521
|
-
type:
|
|
7532
|
+
type: D.Frame,
|
|
7522
7533
|
x: e.left,
|
|
7523
7534
|
y: e.top,
|
|
7524
7535
|
width: e.width,
|
|
@@ -7526,18 +7537,19 @@ class Me {
|
|
|
7526
7537
|
layer: e.layer,
|
|
7527
7538
|
layerIndex: e.layerIndex,
|
|
7528
7539
|
rotation: e.rotation,
|
|
7529
|
-
scaleX: e.width /
|
|
7530
|
-
scaleY: e.height /
|
|
7531
|
-
path:
|
|
7532
|
-
dataWidth:
|
|
7533
|
-
dataHeight:
|
|
7540
|
+
scaleX: e.width / r.frameData.width,
|
|
7541
|
+
scaleY: e.height / r.frameData.height,
|
|
7542
|
+
path: r.frameData.path,
|
|
7543
|
+
dataWidth: r.frameData.width,
|
|
7544
|
+
dataHeight: r.frameData.height,
|
|
7534
7545
|
stepRegion: e,
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7546
|
+
stepRegionIndex: a,
|
|
7547
|
+
stepName: r.stepName,
|
|
7548
|
+
disablePlaceholder: r.disablePlaceholder,
|
|
7549
|
+
pattern: r.pattern,
|
|
7538
7550
|
immutable: e.immutable
|
|
7539
7551
|
},
|
|
7540
|
-
|
|
7552
|
+
i
|
|
7541
7553
|
);
|
|
7542
7554
|
}
|
|
7543
7555
|
async loadPatternFromString(t, e, a = !0, i = void 0, r) {
|
|
@@ -7558,7 +7570,7 @@ class Me {
|
|
|
7558
7570
|
svg: d.svg,
|
|
7559
7571
|
colors: i ?? d.colors
|
|
7560
7572
|
};
|
|
7561
|
-
|
|
7573
|
+
gt.set(t, A), e.setPatternData(A, a);
|
|
7562
7574
|
} else {
|
|
7563
7575
|
const o = await Oe(t, !0), s = await Ue(o), l = {
|
|
7564
7576
|
src: t,
|
|
@@ -7568,7 +7580,7 @@ class Me {
|
|
|
7568
7580
|
svg: void 0,
|
|
7569
7581
|
colors: void 0
|
|
7570
7582
|
};
|
|
7571
|
-
|
|
7583
|
+
gt.set(t, l), e.setPatternData(l, a);
|
|
7572
7584
|
}
|
|
7573
7585
|
}
|
|
7574
7586
|
changeColors(t, e, a) {
|
|
@@ -7644,35 +7656,36 @@ class Me {
|
|
|
7644
7656
|
);
|
|
7645
7657
|
r && r(!0);
|
|
7646
7658
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
|
7647
|
-
t.data.regions.map(async (h,
|
|
7648
|
-
const
|
|
7649
|
-
g,
|
|
7659
|
+
t.data.regions.map(async (h, g) => {
|
|
7660
|
+
const m = await ze(l[g]), p = s.getImageData(), f = a.map((P) => new Rt(P.id)), S = p ? Ta(
|
|
7650
7661
|
p,
|
|
7662
|
+
m,
|
|
7651
7663
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
|
7652
7664
|
t.data.forceImageCover
|
|
7653
|
-
) : void 0, w =
|
|
7654
|
-
id:
|
|
7655
|
-
src:
|
|
7665
|
+
) : void 0, w = p ? {
|
|
7666
|
+
id: T(),
|
|
7667
|
+
src: p.src,
|
|
7656
7668
|
x: S?.x || 0,
|
|
7657
7669
|
y: S?.y || 0,
|
|
7658
|
-
width:
|
|
7659
|
-
height:
|
|
7670
|
+
width: p.width,
|
|
7671
|
+
height: p.height,
|
|
7660
7672
|
scaleX: S?.zoom || 1,
|
|
7661
7673
|
scaleY: S?.zoom || 1,
|
|
7662
7674
|
rotation: 0
|
|
7663
|
-
} : void 0,
|
|
7664
|
-
if (!
|
|
7675
|
+
} : void 0, x = T(), b = i.getLayouts().find((P) => P.panelId === h.panelId);
|
|
7676
|
+
if (!b)
|
|
7665
7677
|
throw new K(h);
|
|
7666
7678
|
return {
|
|
7667
|
-
command: this.getCreateElementCommand(
|
|
7668
|
-
frameData:
|
|
7679
|
+
command: this.getCreateElementCommand(x, h, g, b, {
|
|
7680
|
+
frameData: m,
|
|
7669
7681
|
pattern: w,
|
|
7670
7682
|
disablePlaceholder: t.data.disablePlaceholder,
|
|
7671
7683
|
stepName: t.stepName
|
|
7672
7684
|
}),
|
|
7673
7685
|
regionEl: {
|
|
7674
|
-
id:
|
|
7675
|
-
region: h
|
|
7686
|
+
id: x,
|
|
7687
|
+
region: h,
|
|
7688
|
+
regionIndex: g
|
|
7676
7689
|
},
|
|
7677
7690
|
removeExistingCommands: f
|
|
7678
7691
|
};
|
|
@@ -7745,17 +7758,18 @@ class zo {
|
|
|
7745
7758
|
}).catch((a) => console.error(a));
|
|
7746
7759
|
});
|
|
7747
7760
|
}
|
|
7748
|
-
getCreateElementCommand(t, e, a, i) {
|
|
7761
|
+
getCreateElementCommand(t, e, a, i, r) {
|
|
7749
7762
|
return new H(
|
|
7750
7763
|
{
|
|
7751
7764
|
stepRegion: e,
|
|
7752
|
-
|
|
7753
|
-
|
|
7765
|
+
stepRegionIndex: a,
|
|
7766
|
+
stepName: r.stepName,
|
|
7767
|
+
colors: r.svg.colors,
|
|
7754
7768
|
id: t,
|
|
7755
|
-
src:
|
|
7756
|
-
svg:
|
|
7757
|
-
cachedObjectURL:
|
|
7758
|
-
type:
|
|
7769
|
+
src: r.src,
|
|
7770
|
+
svg: r.svg.svg,
|
|
7771
|
+
cachedObjectURL: r.objectURL,
|
|
7772
|
+
type: D.Illustration,
|
|
7759
7773
|
y: e.top,
|
|
7760
7774
|
x: e.left,
|
|
7761
7775
|
rotation: e.rotation,
|
|
@@ -7765,7 +7779,7 @@ class zo {
|
|
|
7765
7779
|
layerIndex: e.layerIndex,
|
|
7766
7780
|
immutable: e.immutable
|
|
7767
7781
|
},
|
|
7768
|
-
|
|
7782
|
+
i
|
|
7769
7783
|
);
|
|
7770
7784
|
}
|
|
7771
7785
|
getColors(t, e) {
|
|
@@ -7804,7 +7818,11 @@ class zo {
|
|
|
7804
7818
|
if (l && c) {
|
|
7805
7819
|
const d = l.variants?.find((A) => A.id === c);
|
|
7806
7820
|
if (d) {
|
|
7807
|
-
const A = s.map((u) => ({
|
|
7821
|
+
const A = s.map((u) => ({
|
|
7822
|
+
id: u.id,
|
|
7823
|
+
region: u.stepRegion,
|
|
7824
|
+
regionIndex: u.stepRegionIndex
|
|
7825
|
+
}));
|
|
7808
7826
|
await e.setSelectionsAndElements(
|
|
7809
7827
|
t.stepName,
|
|
7810
7828
|
[d],
|
|
@@ -7841,7 +7859,7 @@ class zo {
|
|
|
7841
7859
|
spotColor: A.spotColor,
|
|
7842
7860
|
pmsValue: A.pmsValue
|
|
7843
7861
|
};
|
|
7844
|
-
const s =
|
|
7862
|
+
const s = xa(t, e, a, o), l = await te(s), c = [];
|
|
7845
7863
|
for (const d of i) {
|
|
7846
7864
|
for (const [A, u] of r.entries())
|
|
7847
7865
|
c.push(new fa(d, A, u));
|
|
@@ -7856,22 +7874,22 @@ class zo {
|
|
|
7856
7874
|
e[0].id,
|
|
7857
7875
|
i().map((h) => h.layoutState)
|
|
7858
7876
|
), s = { ...o.colors }, l = {};
|
|
7859
|
-
Object.entries(s).forEach(([h,
|
|
7860
|
-
const
|
|
7861
|
-
|
|
7877
|
+
Object.entries(s).forEach(([h, g]) => {
|
|
7878
|
+
const m = { browserValue: g.browserValue, pmsValue: g.pmsValue }, p = g.spotColor;
|
|
7879
|
+
p && (m.spotColor = { profileName: p.profileName, namedColor: p.namedColor }), l[h] = m;
|
|
7862
7880
|
});
|
|
7863
|
-
for (const [h,
|
|
7864
|
-
const
|
|
7865
|
-
s[h] = { browserValue:
|
|
7881
|
+
for (const [h, g] of r.entries()) {
|
|
7882
|
+
const m = typeof g == "string" ? g : g.browserValue, p = typeof g == "string" ? void 0 : g.pmsValue;
|
|
7883
|
+
s[h] = { browserValue: m, spotColor: s[h]?.spotColor, pmsValue: p }, l[h] = { browserValue: m };
|
|
7866
7884
|
}
|
|
7867
7885
|
let c = Array.from(Object.values(s)).map((h) => h.browserValue);
|
|
7868
7886
|
const d = t.data.colorOption;
|
|
7869
7887
|
d && d.variants?.forEach((h) => {
|
|
7870
|
-
c = c.map((
|
|
7888
|
+
c = c.map((g) => g.toLowerCase() === h.color?.toLowerCase() ? h.name : g);
|
|
7871
7889
|
}), a.updateMetadata(t.stepName, { colors: c });
|
|
7872
7890
|
const A = /* @__PURE__ */ new Map();
|
|
7873
|
-
if (Object.entries(s).forEach(([h,
|
|
7874
|
-
A.set(h,
|
|
7891
|
+
if (Object.entries(s).forEach(([h, g]) => {
|
|
7892
|
+
A.set(h, g);
|
|
7875
7893
|
}), !o.svg)
|
|
7876
7894
|
throw new Error("Colors changed before SVG loaded. This should never happen!");
|
|
7877
7895
|
const u = await this.changeColorsCommand(
|
|
@@ -7891,7 +7909,7 @@ class zo {
|
|
|
7891
7909
|
}
|
|
7892
7910
|
async selectVariantCommand(t, e, a, i, r) {
|
|
7893
7911
|
if (!t.data || !t.data.regions)
|
|
7894
|
-
throw new
|
|
7912
|
+
throw new xe(t, "Missing regions.");
|
|
7895
7913
|
i(!0);
|
|
7896
7914
|
const o = a.map((f) => new Rt(f.id));
|
|
7897
7915
|
t.mandatory && r.setMandatoryFulfilled(t.stepName, !1);
|
|
@@ -7901,27 +7919,27 @@ class zo {
|
|
|
7901
7919
|
const l = s.fileLink;
|
|
7902
7920
|
if (!l)
|
|
7903
7921
|
throw new _t(s);
|
|
7904
|
-
const c = await lt(await this.getIllustrationBody(l)), d = await te(c.svg), A = (f) => {
|
|
7905
|
-
const
|
|
7906
|
-
if (!
|
|
7922
|
+
const c = await lt(await this.getIllustrationBody(l)), d = await te(c.svg), A = (f, S) => {
|
|
7923
|
+
const w = r.getLayouts().find((v) => v.panelId === f.panelId);
|
|
7924
|
+
if (!w)
|
|
7907
7925
|
throw new K(f);
|
|
7908
|
-
const
|
|
7926
|
+
const x = T();
|
|
7909
7927
|
return {
|
|
7910
|
-
regionElement: { id:
|
|
7911
|
-
command: this.getCreateElementCommand(
|
|
7928
|
+
regionElement: { id: x, region: f, regionIndex: S },
|
|
7929
|
+
command: this.getCreateElementCommand(x, f, S, w, {
|
|
7912
7930
|
stepName: t.stepName,
|
|
7913
7931
|
src: l,
|
|
7914
7932
|
objectURL: d,
|
|
7915
7933
|
svg: c
|
|
7916
7934
|
})
|
|
7917
7935
|
};
|
|
7918
|
-
}, u = t.data.regions.map(A),
|
|
7919
|
-
let
|
|
7920
|
-
const
|
|
7921
|
-
return
|
|
7922
|
-
|
|
7923
|
-
}), r.updateMetadata(t.stepName, { colors:
|
|
7924
|
-
command: new L(
|
|
7936
|
+
}, u = t.data.regions.map(A), g = [...u.map((f) => f.command), ...o];
|
|
7937
|
+
let m = Array.from(Object.values(c.colors)).map((f) => f.browserValue);
|
|
7938
|
+
const p = t.data.colorOption;
|
|
7939
|
+
return p && p.variants?.forEach((f) => {
|
|
7940
|
+
m = m.map((S) => S.toLowerCase() === f.color?.toLowerCase() ? f.name : S);
|
|
7941
|
+
}), r.updateMetadata(t.stepName, { colors: m }), {
|
|
7942
|
+
command: new L(g),
|
|
7925
7943
|
followup: async () => {
|
|
7926
7944
|
await r.setSelectionsAndElements(
|
|
7927
7945
|
t.stepName,
|
|
@@ -7934,32 +7952,32 @@ class zo {
|
|
|
7934
7952
|
const f = s.assetConfiguration?.defaultColorVariants || [];
|
|
7935
7953
|
if (f.length !== 0) {
|
|
7936
7954
|
const S = {};
|
|
7937
|
-
(s.assetConfiguration?.channelNumbers || []).forEach((
|
|
7938
|
-
const
|
|
7939
|
-
|
|
7955
|
+
(s.assetConfiguration?.channelNumbers || []).forEach((x) => {
|
|
7956
|
+
const v = f.find((b) => b.channelNumber === x.number);
|
|
7957
|
+
v && (S[`${x.id.replace(/\W/g, "")}`] = { browserValue: v?.variant?.color || "" });
|
|
7940
7958
|
}), await this.changeColors(
|
|
7941
7959
|
t,
|
|
7942
|
-
u.map((
|
|
7960
|
+
u.map((x) => x.regionElement),
|
|
7943
7961
|
r,
|
|
7944
7962
|
() => r.getCommandContext().getAllLayouts(),
|
|
7945
7963
|
new Map(Object.entries(S))
|
|
7946
7964
|
);
|
|
7947
7965
|
}
|
|
7948
7966
|
if (t.data.colorPickerEnabled) {
|
|
7949
|
-
const S = await this.availableColors(t, r) || [], w = Object.keys(c.colors),
|
|
7950
|
-
if (
|
|
7951
|
-
const
|
|
7967
|
+
const S = await this.availableColors(t, r) || [], w = Object.keys(c.colors), x = S.length === 1 && w.length === 1;
|
|
7968
|
+
if (x) {
|
|
7969
|
+
const v = S[0], b = w[0];
|
|
7952
7970
|
await this.changeColors(
|
|
7953
7971
|
t,
|
|
7954
|
-
u.map((
|
|
7972
|
+
u.map((P) => P.regionElement),
|
|
7955
7973
|
r,
|
|
7956
7974
|
() => r.getCommandContext().getAllLayouts(),
|
|
7957
|
-
/* @__PURE__ */ new Map([[
|
|
7975
|
+
/* @__PURE__ */ new Map([[b, v.variant.color]])
|
|
7958
7976
|
);
|
|
7959
7977
|
}
|
|
7960
|
-
!
|
|
7978
|
+
!x && f.length === 0 && await this.changeColors(
|
|
7961
7979
|
t,
|
|
7962
|
-
u.map((
|
|
7980
|
+
u.map((v) => v.regionElement),
|
|
7963
7981
|
r,
|
|
7964
7982
|
() => r.getCommandContext().getAllLayouts(),
|
|
7965
7983
|
/* @__PURE__ */ new Map()
|
|
@@ -7996,7 +8014,11 @@ class Go {
|
|
|
7996
8014
|
if (c) {
|
|
7997
8015
|
const d = l.variants?.find((A) => A.id === c);
|
|
7998
8016
|
if (d) {
|
|
7999
|
-
const A = d.material, u = s.map((h) => ({
|
|
8017
|
+
const A = d.material, u = s.map((h) => ({
|
|
8018
|
+
id: h.id,
|
|
8019
|
+
region: h.stepRegion,
|
|
8020
|
+
regionIndex: h.stepRegionIndex
|
|
8021
|
+
}));
|
|
8000
8022
|
await e.setSelectionsAndElements(
|
|
8001
8023
|
t.stepName,
|
|
8002
8024
|
[d],
|
|
@@ -8004,12 +8026,12 @@ class Go {
|
|
|
8004
8026
|
async () => {
|
|
8005
8027
|
const h = e.getModelContainer();
|
|
8006
8028
|
if (h) {
|
|
8007
|
-
const
|
|
8008
|
-
|
|
8029
|
+
const g = t.data.targetMaterials.map((m) => h.applyMaterialVariant(
|
|
8030
|
+
m,
|
|
8009
8031
|
l.id || "",
|
|
8010
8032
|
A || {}
|
|
8011
8033
|
));
|
|
8012
|
-
Promise.all(
|
|
8034
|
+
Promise.all(g).then(
|
|
8013
8035
|
() => e.setMandatoryFulfilled(t.stepName, !0)
|
|
8014
8036
|
);
|
|
8015
8037
|
}
|
|
@@ -8070,7 +8092,11 @@ class Wo {
|
|
|
8070
8092
|
if (l && c) {
|
|
8071
8093
|
const d = l.variants?.find((A) => A.id === c);
|
|
8072
8094
|
if (d) {
|
|
8073
|
-
const A = s.map((u) => ({
|
|
8095
|
+
const A = s.map((u) => ({
|
|
8096
|
+
id: u.id,
|
|
8097
|
+
region: u.stepRegion,
|
|
8098
|
+
regionIndex: u.stepRegionIndex
|
|
8099
|
+
}));
|
|
8074
8100
|
await e.setSelectionsAndElements(
|
|
8075
8101
|
t.stepName,
|
|
8076
8102
|
[d],
|
|
@@ -8140,7 +8166,11 @@ class qo {
|
|
|
8140
8166
|
const i = e.getSerializedStep(
|
|
8141
8167
|
t.stepName,
|
|
8142
8168
|
a.serializableWorkflow.steps
|
|
8143
|
-
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({
|
|
8169
|
+
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({
|
|
8170
|
+
id: c.id,
|
|
8171
|
+
region: c.stepRegion,
|
|
8172
|
+
regionIndex: c.stepRegionIndex
|
|
8173
|
+
}));
|
|
8144
8174
|
await e.setSelectionsAndElements(t.stepName, [], l, async () => {
|
|
8145
8175
|
e.updateStorage(t.stepName, { text: i?.storage?.text }), e.setMandatoryFulfilled(t.stepName, i?.storage?.text !== "");
|
|
8146
8176
|
});
|
|
@@ -8159,20 +8189,21 @@ class qo {
|
|
|
8159
8189
|
if (a.setMandatoryFulfilled(t.stepName, e !== ""), !t.data || !t.data.regions || t.data.regions.length <= 0)
|
|
8160
8190
|
return console.error("Missing configuration."), null;
|
|
8161
8191
|
a.updateStorage(t.stepName, { text: e }), a.updateMetadata(t.stepName, { text: e });
|
|
8162
|
-
const c = (d, A, u) => {
|
|
8163
|
-
const
|
|
8192
|
+
const c = (d, A, u, h) => {
|
|
8193
|
+
const g = h || T(), p = a.getLayouts().find((S) => S.panelId === A.panelId);
|
|
8164
8194
|
if (!p)
|
|
8165
8195
|
return console.error(`Can not find layout for region: ${A.panelId}`), null;
|
|
8166
|
-
const
|
|
8167
|
-
return
|
|
8196
|
+
const f = [];
|
|
8197
|
+
return h && f.push(new Rt(g)), f.push(
|
|
8168
8198
|
new H(
|
|
8169
8199
|
{
|
|
8170
8200
|
stepRegion: A,
|
|
8201
|
+
stepRegionIndex: u,
|
|
8171
8202
|
stepName: t.stepName,
|
|
8172
8203
|
colors: {},
|
|
8173
|
-
id:
|
|
8204
|
+
id: g,
|
|
8174
8205
|
svg: d,
|
|
8175
|
-
type:
|
|
8206
|
+
type: D.Illustration,
|
|
8176
8207
|
y: A.top,
|
|
8177
8208
|
x: A.left,
|
|
8178
8209
|
rotation: A.rotation,
|
|
@@ -8185,9 +8216,9 @@ class qo {
|
|
|
8185
8216
|
p
|
|
8186
8217
|
)
|
|
8187
8218
|
), {
|
|
8188
|
-
id:
|
|
8219
|
+
id: g,
|
|
8189
8220
|
region: A,
|
|
8190
|
-
command: new L(
|
|
8221
|
+
command: new L(f)
|
|
8191
8222
|
};
|
|
8192
8223
|
};
|
|
8193
8224
|
if (r.length > 0) {
|
|
@@ -8195,7 +8226,12 @@ class qo {
|
|
|
8195
8226
|
if (!u.region)
|
|
8196
8227
|
return null;
|
|
8197
8228
|
const h = o.svgPrint(e, u.region);
|
|
8198
|
-
return c(
|
|
8229
|
+
return c(
|
|
8230
|
+
h,
|
|
8231
|
+
u.region,
|
|
8232
|
+
u.regionIndex,
|
|
8233
|
+
u.id
|
|
8234
|
+
);
|
|
8199
8235
|
}).filter((u) => !!u).filter((u) => !!u).map((u) => u && u.command);
|
|
8200
8236
|
return {
|
|
8201
8237
|
command: new L(A),
|
|
@@ -8204,7 +8240,7 @@ class qo {
|
|
|
8204
8240
|
};
|
|
8205
8241
|
} else {
|
|
8206
8242
|
const d = t.data.regions.map(
|
|
8207
|
-
(u) => c(o.svgPrint(e, u), u)
|
|
8243
|
+
(u, h) => c(o.svgPrint(e, u), u, h)
|
|
8208
8244
|
), A = d.filter((u) => !!u).map((u) => u && u.command);
|
|
8209
8245
|
return {
|
|
8210
8246
|
command: new L(A),
|
|
@@ -8260,7 +8296,11 @@ class Ho {
|
|
|
8260
8296
|
if (l && c) {
|
|
8261
8297
|
const d = l.variants?.find((A) => A.id === c);
|
|
8262
8298
|
if (d) {
|
|
8263
|
-
const A = s.map((u) => ({
|
|
8299
|
+
const A = s.map((u) => ({
|
|
8300
|
+
id: u.id,
|
|
8301
|
+
region: u.stepRegion,
|
|
8302
|
+
regionIndex: u.stepRegionIndex
|
|
8303
|
+
}));
|
|
8264
8304
|
await e.setSelectionsAndElements(
|
|
8265
8305
|
t.stepName,
|
|
8266
8306
|
[d],
|
|
@@ -8285,20 +8325,21 @@ class Ho {
|
|
|
8285
8325
|
if (!o)
|
|
8286
8326
|
return console.error("No URL for picture!"), null;
|
|
8287
8327
|
i(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
|
|
8288
|
-
const l = a.getRegionElements(t.stepName).map((A) => new Rt(A.id)), c = (A) => {
|
|
8289
|
-
const
|
|
8290
|
-
if (!
|
|
8328
|
+
const l = a.getRegionElements(t.stepName).map((A) => new Rt(A.id)), c = (A, u) => {
|
|
8329
|
+
const g = a.getLayouts().find((p) => p.panelId === A.panelId);
|
|
8330
|
+
if (!g)
|
|
8291
8331
|
throw new K(A);
|
|
8292
|
-
const m =
|
|
8332
|
+
const m = T();
|
|
8293
8333
|
return {
|
|
8294
|
-
regionElement: { id: m, region: A },
|
|
8334
|
+
regionElement: { id: m, region: A, regionIndex: u },
|
|
8295
8335
|
command: new H(
|
|
8296
8336
|
{
|
|
8297
8337
|
stepName: t.stepName,
|
|
8298
8338
|
stepRegion: A,
|
|
8339
|
+
stepRegionIndex: u,
|
|
8299
8340
|
id: m,
|
|
8300
8341
|
src: o,
|
|
8301
|
-
type:
|
|
8342
|
+
type: D.Image,
|
|
8302
8343
|
y: A.top,
|
|
8303
8344
|
x: A.left,
|
|
8304
8345
|
rotation: A.rotation,
|
|
@@ -8309,7 +8350,7 @@ class Ho {
|
|
|
8309
8350
|
immutable: A.immutable,
|
|
8310
8351
|
preserveAspectRatio: "none"
|
|
8311
8352
|
},
|
|
8312
|
-
|
|
8353
|
+
g
|
|
8313
8354
|
)
|
|
8314
8355
|
};
|
|
8315
8356
|
}, d = t.data.regions.map(c);
|
|
@@ -8440,7 +8481,11 @@ class Yo {
|
|
|
8440
8481
|
if (l && c) {
|
|
8441
8482
|
const d = l.variants?.find((A) => A.id === c);
|
|
8442
8483
|
if (d) {
|
|
8443
|
-
const A = s.map((u) => ({
|
|
8484
|
+
const A = s.map((u) => ({
|
|
8485
|
+
id: u.id,
|
|
8486
|
+
region: u.stepRegion,
|
|
8487
|
+
regionIndex: u.stepRegionIndex
|
|
8488
|
+
}));
|
|
8444
8489
|
await e.setSelectionsAndElements(
|
|
8445
8490
|
t.stepName,
|
|
8446
8491
|
[d],
|
|
@@ -8464,7 +8509,7 @@ class Yo {
|
|
|
8464
8509
|
if (a.length > 0) {
|
|
8465
8510
|
const l = (d) => {
|
|
8466
8511
|
const A = d.region;
|
|
8467
|
-
if (!r.find((
|
|
8512
|
+
if (!r.find((g) => g.panelId === A?.panelId))
|
|
8468
8513
|
throw new K(A);
|
|
8469
8514
|
const h = s();
|
|
8470
8515
|
return new fa(d.id, this.shapeFillId, h);
|
|
@@ -8480,9 +8525,9 @@ class Yo {
|
|
|
8480
8525
|
}
|
|
8481
8526
|
};
|
|
8482
8527
|
} else {
|
|
8483
|
-
const l = (u) => {
|
|
8484
|
-
const
|
|
8485
|
-
if (!
|
|
8528
|
+
const l = (u, h) => {
|
|
8529
|
+
const g = r.find((w) => w.panelId === u.panelId);
|
|
8530
|
+
if (!g)
|
|
8486
8531
|
throw new K(u);
|
|
8487
8532
|
const m = s(), p = `
|
|
8488
8533
|
<svg
|
|
@@ -8504,20 +8549,21 @@ class Yo {
|
|
|
8504
8549
|
fill="${m}"
|
|
8505
8550
|
/>
|
|
8506
8551
|
</svg>
|
|
8507
|
-
`,
|
|
8508
|
-
|
|
8509
|
-
const
|
|
8552
|
+
`, f = {};
|
|
8553
|
+
f[this.shapeFillId] = { browserValue: m };
|
|
8554
|
+
const S = T();
|
|
8510
8555
|
return {
|
|
8511
|
-
id:
|
|
8556
|
+
id: S,
|
|
8512
8557
|
region: u,
|
|
8513
8558
|
command: new H(
|
|
8514
8559
|
{
|
|
8515
8560
|
stepRegion: u,
|
|
8561
|
+
stepRegionIndex: h,
|
|
8516
8562
|
stepName: t.stepName,
|
|
8517
|
-
colors:
|
|
8518
|
-
id:
|
|
8563
|
+
colors: f,
|
|
8564
|
+
id: S,
|
|
8519
8565
|
svg: p,
|
|
8520
|
-
type:
|
|
8566
|
+
type: D.Illustration,
|
|
8521
8567
|
y: u.top,
|
|
8522
8568
|
x: u.left,
|
|
8523
8569
|
rotation: u.rotation,
|
|
@@ -8528,10 +8574,10 @@ class Yo {
|
|
|
8528
8574
|
immutable: u.immutable,
|
|
8529
8575
|
excludeFromExport: t.data.excludeFromPrint
|
|
8530
8576
|
},
|
|
8531
|
-
|
|
8577
|
+
g
|
|
8532
8578
|
)
|
|
8533
8579
|
};
|
|
8534
|
-
}, c = t.data.regions.map(l), d = c.filter((u) => !!u).map((u) => u?.command), A = c.filter((u) => !!u).map((u) => ({ id: u.id, region: u.region }));
|
|
8580
|
+
}, c = t.data.regions.map(l), d = c.filter((u) => !!u).map((u) => u?.command), A = c.filter((u) => !!u).map((u, h) => ({ id: u.id, region: u.region, regionIndex: h }));
|
|
8535
8581
|
return {
|
|
8536
8582
|
command: new L(d),
|
|
8537
8583
|
followup: async () => {
|
|
@@ -8587,18 +8633,18 @@ const Ko = new Jo(), aa = (n, t, e, a, i) => {
|
|
|
8587
8633
|
const A = Math.max(...s);
|
|
8588
8634
|
if (A <= n.width)
|
|
8589
8635
|
return [r, A];
|
|
8590
|
-
const u = s.reduce((
|
|
8591
|
-
let
|
|
8592
|
-
for (; !
|
|
8593
|
-
|
|
8594
|
-
const
|
|
8595
|
-
f[0] <= n.width && (r = [...r.slice(0, u), ...
|
|
8636
|
+
const u = s.reduce((p, f, S, w) => f > w[p] ? S : p, 0), h = r[u];
|
|
8637
|
+
let g = !1, m = h.length;
|
|
8638
|
+
for (; !g && m > -1; ) {
|
|
8639
|
+
m = h.lastIndexOf(" ", m - 1);
|
|
8640
|
+
const p = [h.slice(0, m), h.slice(m + 1)], f = p.map((w) => pt(w, a, i));
|
|
8641
|
+
f[0] <= n.width && (r = [...r.slice(0, u), ...p, ...r.slice(u + 1)], s = [
|
|
8596
8642
|
...s.slice(0, u),
|
|
8597
8643
|
...f,
|
|
8598
8644
|
...s.slice(u + 1)
|
|
8599
|
-
], o += 1,
|
|
8645
|
+
], o += 1, g = !0);
|
|
8600
8646
|
}
|
|
8601
|
-
|
|
8647
|
+
g || (c = !1);
|
|
8602
8648
|
}
|
|
8603
8649
|
return [null, null];
|
|
8604
8650
|
}, ve = (n, t, e, a, i) => {
|
|
@@ -8682,11 +8728,11 @@ class Xo {
|
|
|
8682
8728
|
let A = t.data.defaultText || "";
|
|
8683
8729
|
const u = e.getWorkflowExperience().getBundle();
|
|
8684
8730
|
if (u && t.globalPropertyAspectConfigurations) {
|
|
8685
|
-
const
|
|
8686
|
-
(
|
|
8731
|
+
const m = u.getGlobalPropertyConfiguration()?.aspects?.find(
|
|
8732
|
+
(p) => p.type === G.Text && t.globalPropertyAspectConfigurations?.map((f) => f.aspectName).includes(p.name)
|
|
8687
8733
|
);
|
|
8688
|
-
if (
|
|
8689
|
-
const f = u.getGlobalPropertyStateManager().getAspect(
|
|
8734
|
+
if (m) {
|
|
8735
|
+
const f = u.getGlobalPropertyStateManager().getAspect(m.name);
|
|
8690
8736
|
f && (A = f);
|
|
8691
8737
|
}
|
|
8692
8738
|
}
|
|
@@ -8846,7 +8892,7 @@ class Xo {
|
|
|
8846
8892
|
});
|
|
8847
8893
|
}
|
|
8848
8894
|
updateInputText(t, e, a, i) {
|
|
8849
|
-
const r = i.getStepStorage(a.stepName), o =
|
|
8895
|
+
const r = i.getStepStorage(a.stepName), o = Ft(t, i), s = this.getProcessedInput(o, a.data, r?.customiseAllText ?? !1), l = {
|
|
8850
8896
|
command: void 0,
|
|
8851
8897
|
helperData: {},
|
|
8852
8898
|
errorData: this.getErrorsForText(t, s, a, i)
|
|
@@ -8857,17 +8903,17 @@ class Xo {
|
|
|
8857
8903
|
const c = [], d = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
|
|
8858
8904
|
for (const u of e) {
|
|
8859
8905
|
if (!u.fontData) throw new R("Failed to resolve font data for text.");
|
|
8860
|
-
const [h,
|
|
8906
|
+
const [h, g] = ve(
|
|
8861
8907
|
u.fontSize,
|
|
8862
8908
|
u.fontData,
|
|
8863
8909
|
{ left: u.x, top: u.y, width: u.width, height: u.height, rotation: u.rotation },
|
|
8864
8910
|
[s],
|
|
8865
8911
|
{ size: a.data.size, minSize: a.data.minSize, maxSize: a.data.maxSize }
|
|
8866
8912
|
);
|
|
8867
|
-
d.set(u.id, h), A.set(u.id,
|
|
8868
|
-
const
|
|
8913
|
+
d.set(u.id, h), A.set(u.id, g);
|
|
8914
|
+
const m = a.data.curved ? s : (g || []).join(`
|
|
8869
8915
|
`);
|
|
8870
|
-
c.push(this.generateTextChangeCommandsForRegion(h, a.data, u.id,
|
|
8916
|
+
c.push(this.generateTextChangeCommandsForRegion(h, a.data, u.id, m));
|
|
8871
8917
|
}
|
|
8872
8918
|
return !a.data.curved && e.length > 0 && !Array.from(A.values()).every((h) => h) ? (l.errorData || (l.errorData = {}), l.errorData.doesNotFit = !0, l) : (i.updateStorage(a.stepName, { text: t }), i.updateMetadata(a.stepName, {
|
|
8873
8919
|
text: s
|
|
@@ -8906,16 +8952,20 @@ class Xo {
|
|
|
8906
8952
|
if (l && c) {
|
|
8907
8953
|
const d = l.variants?.find((A) => A.id === c);
|
|
8908
8954
|
if (d) {
|
|
8909
|
-
const A = await this.fontDataFromVariant(d), u = s.map((
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8955
|
+
const A = await this.fontDataFromVariant(d), u = s.map((p) => ({
|
|
8956
|
+
id: p.id,
|
|
8957
|
+
region: p.stepRegion,
|
|
8958
|
+
regionIndex: p.stepRegionIndex
|
|
8959
|
+
})), h = i.storage?.color;
|
|
8960
|
+
let g = i.storage?.text;
|
|
8961
|
+
const m = e.getWorkflowExperience().getBundle();
|
|
8962
|
+
if (m && t.globalPropertyAspectConfigurations) {
|
|
8963
|
+
const f = m.getGlobalPropertyConfiguration()?.aspects?.find(
|
|
8914
8964
|
(S) => S.type === G.Text && t.globalPropertyAspectConfigurations?.map((w) => w.aspectName).includes(S.name)
|
|
8915
8965
|
);
|
|
8916
8966
|
if (f) {
|
|
8917
|
-
const w =
|
|
8918
|
-
w && (
|
|
8967
|
+
const w = m.getGlobalPropertyStateManager().getAspect(f.name);
|
|
8968
|
+
w && (g = w);
|
|
8919
8969
|
}
|
|
8920
8970
|
}
|
|
8921
8971
|
if (await e.setSelectionsAndElements(
|
|
@@ -8923,17 +8973,17 @@ class Xo {
|
|
|
8923
8973
|
[d],
|
|
8924
8974
|
u,
|
|
8925
8975
|
async () => {
|
|
8926
|
-
e.updateMetadata(t.stepName, { color: h, text:
|
|
8927
|
-
const
|
|
8976
|
+
e.updateMetadata(t.stepName, { color: h, text: g }), e.updateStorage(t.stepName, { text: g, inputText: g });
|
|
8977
|
+
const p = s.map((S) => new en(S.id, A)), f = new L(p);
|
|
8928
8978
|
e.getCommandDispatcher()(f);
|
|
8929
8979
|
}
|
|
8930
8980
|
), s.length === 0 && l) {
|
|
8931
|
-
const
|
|
8932
|
-
if (
|
|
8981
|
+
const p = J.getDefaultVariant(l);
|
|
8982
|
+
if (p) {
|
|
8933
8983
|
const f = await this.selectVariantCommand(
|
|
8934
8984
|
t,
|
|
8935
|
-
|
|
8936
|
-
{ text:
|
|
8985
|
+
p,
|
|
8986
|
+
{ text: g },
|
|
8937
8987
|
[],
|
|
8938
8988
|
e,
|
|
8939
8989
|
() => {
|
|
@@ -8944,13 +8994,13 @@ class Xo {
|
|
|
8944
8994
|
e.getCommandDispatcher()(f.command);
|
|
8945
8995
|
}
|
|
8946
8996
|
} else {
|
|
8947
|
-
const { command:
|
|
8948
|
-
|
|
8997
|
+
const { command: p } = j.updateInputText(
|
|
8998
|
+
g || "",
|
|
8949
8999
|
s,
|
|
8950
9000
|
t,
|
|
8951
9001
|
e
|
|
8952
9002
|
);
|
|
8953
|
-
|
|
9003
|
+
p && e.getCommandDispatcher()(p);
|
|
8954
9004
|
}
|
|
8955
9005
|
}
|
|
8956
9006
|
}
|
|
@@ -8964,11 +9014,11 @@ class Xo {
|
|
|
8964
9014
|
const h = c.getGlobalPropertyStateManager().getAspect(A.name);
|
|
8965
9015
|
if (h)
|
|
8966
9016
|
if (s.length === 0 && l) {
|
|
8967
|
-
const
|
|
8968
|
-
if (
|
|
8969
|
-
const
|
|
9017
|
+
const g = J.getDefaultVariant(l);
|
|
9018
|
+
if (g) {
|
|
9019
|
+
const m = await this.selectVariantCommand(
|
|
8970
9020
|
t,
|
|
8971
|
-
|
|
9021
|
+
g,
|
|
8972
9022
|
{ text: h },
|
|
8973
9023
|
[],
|
|
8974
9024
|
e,
|
|
@@ -8977,16 +9027,16 @@ class Xo {
|
|
|
8977
9027
|
() => {
|
|
8978
9028
|
}
|
|
8979
9029
|
);
|
|
8980
|
-
e.getCommandDispatcher()(
|
|
9030
|
+
e.getCommandDispatcher()(m.command);
|
|
8981
9031
|
}
|
|
8982
9032
|
} else {
|
|
8983
|
-
const { command:
|
|
9033
|
+
const { command: g } = j.updateInputText(
|
|
8984
9034
|
h,
|
|
8985
9035
|
s,
|
|
8986
9036
|
t,
|
|
8987
9037
|
e
|
|
8988
9038
|
);
|
|
8989
|
-
|
|
9039
|
+
g && e.getCommandDispatcher()(g);
|
|
8990
9040
|
}
|
|
8991
9041
|
}
|
|
8992
9042
|
}
|
|
@@ -9027,16 +9077,16 @@ class Xo {
|
|
|
9027
9077
|
async selectVariantCommand(t, e, a, i, r, o, s, l, c) {
|
|
9028
9078
|
const d = r.markUpdatePending(), A = await this.fontDataFromVariant(e);
|
|
9029
9079
|
if (i.length > 0) {
|
|
9030
|
-
const u = i.map((
|
|
9080
|
+
const u = i.map((m) => new en(m.id, A));
|
|
9031
9081
|
if (l) {
|
|
9032
|
-
const
|
|
9033
|
-
u.push(...
|
|
9082
|
+
const m = i.map((p) => new ta(p.id, l));
|
|
9083
|
+
u.push(...m);
|
|
9034
9084
|
}
|
|
9035
9085
|
if (c) {
|
|
9036
|
-
const
|
|
9037
|
-
(
|
|
9086
|
+
const m = i.map(
|
|
9087
|
+
(p) => new ea(p.id, c, t.data.strokeThickness)
|
|
9038
9088
|
);
|
|
9039
|
-
u.push(...
|
|
9089
|
+
u.push(...m);
|
|
9040
9090
|
}
|
|
9041
9091
|
const h = await this.changeInputTextWithRegion(
|
|
9042
9092
|
t,
|
|
@@ -9073,21 +9123,21 @@ class Xo {
|
|
|
9073
9123
|
a?.customiseAllText ?? !1,
|
|
9074
9124
|
o,
|
|
9075
9125
|
s
|
|
9076
|
-
),
|
|
9126
|
+
), g = u.flatMap((p) => p.commands);
|
|
9077
9127
|
if (l) {
|
|
9078
|
-
const
|
|
9128
|
+
const p = u.map(
|
|
9079
9129
|
(f) => new ta(f.regionElement.id, l)
|
|
9080
9130
|
);
|
|
9081
|
-
|
|
9131
|
+
g.push(...p);
|
|
9082
9132
|
}
|
|
9083
9133
|
if (c) {
|
|
9084
|
-
const
|
|
9134
|
+
const p = i.map(
|
|
9085
9135
|
(f) => new ea(f.id, c, t.data.strokeThickness)
|
|
9086
9136
|
);
|
|
9087
|
-
|
|
9137
|
+
g.push(...p);
|
|
9088
9138
|
}
|
|
9089
|
-
return h &&
|
|
9090
|
-
command: new L(
|
|
9139
|
+
return h && g.push(h), {
|
|
9140
|
+
command: new L(g),
|
|
9091
9141
|
followup: async () => {
|
|
9092
9142
|
r.markUpdateCompleted(d);
|
|
9093
9143
|
}
|
|
@@ -9105,24 +9155,25 @@ class Xo {
|
|
|
9105
9155
|
async createTextboxRegions(t, e, a, i, r, o) {
|
|
9106
9156
|
if (!a || !a.regions)
|
|
9107
9157
|
throw new Error("Step data not supplied");
|
|
9108
|
-
const s = r.text || a.defaultText || "", l =
|
|
9109
|
-
const m = o.getLayouts().find((
|
|
9158
|
+
const s = r.text || a.defaultText || "", l = Ft(s, o), c = this.getProcessedInput(l, a, !1), d = async (u, h) => {
|
|
9159
|
+
const m = o.getLayouts().find((f) => f.panelId === u.panelId), p = T();
|
|
9110
9160
|
try {
|
|
9111
9161
|
if (!m)
|
|
9112
9162
|
throw new Ne("Failed to find layout for region: " + u.panelId);
|
|
9113
|
-
const
|
|
9114
|
-
let
|
|
9115
|
-
if (
|
|
9116
|
-
const
|
|
9117
|
-
|
|
9118
|
-
colorProfileAssetKey:
|
|
9163
|
+
const f = a.colorOption;
|
|
9164
|
+
let S;
|
|
9165
|
+
if (f && f.variants) {
|
|
9166
|
+
const U = f.variants.find((M) => M.id === f.defaultVariant?.id) || f.variants[0];
|
|
9167
|
+
S = this.createTextFillSpotColor(f, U), o.updateStorage(t, {
|
|
9168
|
+
colorProfileAssetKey: f.colorProfile?.key
|
|
9119
9169
|
});
|
|
9120
9170
|
}
|
|
9121
|
-
const
|
|
9171
|
+
const w = await this.getDefaultColor(a), x = w || "#000000", v = {
|
|
9122
9172
|
stepRegion: u,
|
|
9173
|
+
stepRegionIndex: h,
|
|
9123
9174
|
stepName: t,
|
|
9124
9175
|
align: this.textAlign(a),
|
|
9125
|
-
fill: r.color ? r.color :
|
|
9176
|
+
fill: r.color ? r.color : x,
|
|
9126
9177
|
fontSize: a.size || na,
|
|
9127
9178
|
fontData: i,
|
|
9128
9179
|
id: p,
|
|
@@ -9131,7 +9182,7 @@ class Xo {
|
|
|
9131
9182
|
rotation: u.rotation,
|
|
9132
9183
|
text: c,
|
|
9133
9184
|
input: s,
|
|
9134
|
-
type:
|
|
9185
|
+
type: D.Textbox,
|
|
9135
9186
|
vertical: a.vertical,
|
|
9136
9187
|
x: u.left,
|
|
9137
9188
|
y: u.top,
|
|
@@ -9141,38 +9192,38 @@ class Xo {
|
|
|
9141
9192
|
verticalAlign: a.verticalAlign || "middle",
|
|
9142
9193
|
curved: a.curved,
|
|
9143
9194
|
paths: a.paths,
|
|
9144
|
-
fillSpotColorDefinition:
|
|
9145
|
-
}, b = [],
|
|
9146
|
-
if (!
|
|
9147
|
-
const [
|
|
9148
|
-
|
|
9149
|
-
|
|
9195
|
+
fillSpotColorDefinition: S
|
|
9196
|
+
}, b = [], P = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
|
|
9197
|
+
if (!v.fontData) throw new R("Failed to resolve font data for text.");
|
|
9198
|
+
const [N, O] = ve(
|
|
9199
|
+
v.fontSize,
|
|
9200
|
+
v.fontData,
|
|
9150
9201
|
{
|
|
9151
|
-
left:
|
|
9152
|
-
top:
|
|
9153
|
-
width:
|
|
9154
|
-
height:
|
|
9155
|
-
rotation:
|
|
9202
|
+
left: v.x,
|
|
9203
|
+
top: v.y,
|
|
9204
|
+
width: v.width,
|
|
9205
|
+
height: v.height,
|
|
9206
|
+
rotation: v.rotation,
|
|
9156
9207
|
panelId: ""
|
|
9157
9208
|
},
|
|
9158
9209
|
[c],
|
|
9159
9210
|
{ size: a.size, minSize: a.minSize, maxSize: a.maxSize }
|
|
9160
9211
|
);
|
|
9161
|
-
|
|
9162
|
-
const
|
|
9212
|
+
P.set(v.id, N), F.set(v.id, O);
|
|
9213
|
+
const I = a.curved || a.vertical ? c : (O || []).join(`
|
|
9163
9214
|
`);
|
|
9164
9215
|
b.push(
|
|
9165
|
-
this.generateTextChangeCommandsForRegion(
|
|
9216
|
+
this.generateTextChangeCommandsForRegion(N, a, v.id, I)
|
|
9166
9217
|
);
|
|
9167
|
-
const
|
|
9218
|
+
const Q = new H(v, m);
|
|
9168
9219
|
return {
|
|
9169
|
-
regionElement: { id: p, region: u },
|
|
9170
|
-
commands: [
|
|
9171
|
-
newElement:
|
|
9220
|
+
regionElement: { id: p, region: u, regionIndex: h },
|
|
9221
|
+
commands: [Q, ...b],
|
|
9222
|
+
newElement: v,
|
|
9172
9223
|
fontData: i
|
|
9173
9224
|
};
|
|
9174
|
-
} catch (
|
|
9175
|
-
throw console.log(
|
|
9225
|
+
} catch (f) {
|
|
9226
|
+
throw console.log(f), new Te("Error adding font to region");
|
|
9176
9227
|
}
|
|
9177
9228
|
}, A = await Promise.all(a.regions.map(d)).catch((u) => {
|
|
9178
9229
|
throw u instanceof Te ? (Ko.setLatestToast("Failed to load font.", qe.Error), u) : u instanceof Ne ? u : new Error(u);
|
|
@@ -9202,30 +9253,30 @@ class Xo {
|
|
|
9202
9253
|
* @deprecated
|
|
9203
9254
|
*/
|
|
9204
9255
|
async changeInputTextWithRegion(t, e, a, i, r, o, s, l, c, d) {
|
|
9205
|
-
const A = (i || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u =
|
|
9206
|
-
for (const
|
|
9207
|
-
if (
|
|
9208
|
-
const [
|
|
9256
|
+
const A = (i || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = Ft(A, o), h = this.getProcessedInput(u, t.data, s), g = o.getRegionElements(t.stepName), m = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
9257
|
+
for (const v of g)
|
|
9258
|
+
if (v.region) {
|
|
9259
|
+
const [b, P] = ve(
|
|
9209
9260
|
e,
|
|
9210
9261
|
a,
|
|
9211
|
-
|
|
9262
|
+
v.region,
|
|
9212
9263
|
[h],
|
|
9213
9264
|
{ size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
|
|
9214
9265
|
);
|
|
9215
|
-
|
|
9266
|
+
m.set(v.id, b), p.set(v.id, P);
|
|
9216
9267
|
}
|
|
9217
9268
|
const S = (() => {
|
|
9218
9269
|
if (t.data && t.data.maxLength && h.length > t.data.maxLength)
|
|
9219
9270
|
return d && d(!0), { info: "0" };
|
|
9220
|
-
const
|
|
9221
|
-
for (const
|
|
9222
|
-
for (const
|
|
9223
|
-
const
|
|
9224
|
-
if (
|
|
9271
|
+
const v = o.getWorkflowExperience().getProfanityList(), b = ca(h.toLowerCase());
|
|
9272
|
+
for (const P of b)
|
|
9273
|
+
for (const F in v) {
|
|
9274
|
+
const N = v[F].toLowerCase().replace(/\s/g, "");
|
|
9275
|
+
if (P === N)
|
|
9225
9276
|
return l(!0), { error: "Blocked profanity." };
|
|
9226
9277
|
}
|
|
9227
9278
|
return !t.data.vertical && !t.data.allowNewlines && (h.includes(`
|
|
9228
|
-
`) || h.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(
|
|
9279
|
+
`) || h.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(p.values()).every((F) => F) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - h.length).toString() });
|
|
9229
9280
|
})();
|
|
9230
9281
|
if (S.error) {
|
|
9231
9282
|
c(S.error);
|
|
@@ -9237,15 +9288,15 @@ class Xo {
|
|
|
9237
9288
|
text: this.injectReplaceableText(A, t.data)
|
|
9238
9289
|
}), (r.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && o.setMandatoryFulfilled(t.stepName, !0);
|
|
9239
9290
|
const w = [];
|
|
9240
|
-
for (const
|
|
9241
|
-
const
|
|
9291
|
+
for (const v of g) {
|
|
9292
|
+
const b = t.data.curved ? h : (p.get(v.id) || []).join(`
|
|
9242
9293
|
`);
|
|
9243
9294
|
w.push(
|
|
9244
9295
|
this.generateTextChangeCommandsForRegion(
|
|
9245
|
-
|
|
9296
|
+
m.get(v.id) || 1,
|
|
9246
9297
|
t.data,
|
|
9247
|
-
|
|
9248
|
-
|
|
9298
|
+
v.id,
|
|
9299
|
+
b
|
|
9249
9300
|
)
|
|
9250
9301
|
);
|
|
9251
9302
|
}
|
|
@@ -9330,7 +9381,7 @@ class os {
|
|
|
9330
9381
|
u = (A * 100 | 0) / 100;
|
|
9331
9382
|
break;
|
|
9332
9383
|
default:
|
|
9333
|
-
throw new
|
|
9384
|
+
throw new Dt("Failed to encode path.");
|
|
9334
9385
|
}
|
|
9335
9386
|
l || o.push(" "), o.push(u), l = !1;
|
|
9336
9387
|
}
|
|
@@ -9344,12 +9395,12 @@ class os {
|
|
|
9344
9395
|
for (e.lastIndex = 0; r = e.exec(t); ) {
|
|
9345
9396
|
const o = r[1].toLowerCase(), s = (r[2].match(a) || []).map(parseFloat), l = o === r[1], c = nn[o];
|
|
9346
9397
|
if (s.length < c.length)
|
|
9347
|
-
throw new
|
|
9398
|
+
throw new Dt(
|
|
9348
9399
|
`Path type "${o}" given ${s.length} arguments, expected ${c.length}.`
|
|
9349
9400
|
);
|
|
9350
9401
|
if (c.length > 0) {
|
|
9351
9402
|
if (s.length % c.length !== 0)
|
|
9352
|
-
throw new
|
|
9403
|
+
throw new Dt(
|
|
9353
9404
|
`Path type "${o}" given ${s.length} arguments, not divisible by ${c.length}`
|
|
9354
9405
|
);
|
|
9355
9406
|
for (let d = 0; d < s.length / c.length; d++) {
|
|
@@ -9374,7 +9425,7 @@ class os {
|
|
|
9374
9425
|
if (s in r && l in r) {
|
|
9375
9426
|
const c = [r[s], r[l]], d = e(c);
|
|
9376
9427
|
if (d.length < 2)
|
|
9377
|
-
throw new
|
|
9428
|
+
throw new Dt("Transformer must return at least 2 points.");
|
|
9378
9429
|
r[s] = d[0], r[l] = d[1];
|
|
9379
9430
|
}
|
|
9380
9431
|
}
|
|
@@ -9411,32 +9462,32 @@ class ss extends Zo {
|
|
|
9411
9462
|
const a = yo(ts), r = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", o = a.getPath(r, 0, 72, 72), s = o.toSVG(2), l = o.getBoundingBox(), c = l.x2 - l.x1, d = o.toPathData(3), A = () => {
|
|
9412
9463
|
const w = at("g");
|
|
9413
9464
|
w.classList.add("module-text-group");
|
|
9414
|
-
const
|
|
9415
|
-
w.appendChild(
|
|
9416
|
-
const
|
|
9417
|
-
|
|
9418
|
-
const
|
|
9419
|
-
|
|
9420
|
-
const
|
|
9421
|
-
|
|
9422
|
-
const
|
|
9423
|
-
|
|
9424
|
-
const
|
|
9425
|
-
return
|
|
9465
|
+
const x = at("defs");
|
|
9466
|
+
w.appendChild(x), x.appendChild(as(0, 2, 2, "shadow"));
|
|
9467
|
+
const v = at("path");
|
|
9468
|
+
v.setAttribute("d", d), v.setAttribute("stroke", "black"), v.setAttribute("stroke-width", "3"), x.appendChild(v);
|
|
9469
|
+
const b = at("g");
|
|
9470
|
+
b.classList.add("module-layer0"), w.appendChild(b), b.setAttribute("filter", "url(#shadow)"), b.innerHTML = v.outerHTML;
|
|
9471
|
+
const P = at("g");
|
|
9472
|
+
P.classList.add("module-layer1"), w.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;
|
|
9473
|
+
const F = at("g");
|
|
9474
|
+
F.classList.add("module-layer2"), w.appendChild(F), F.setAttribute("fill", "rgb(255,209,0)"), F.setAttribute("transform", "translate(1,-0.1)"), F.innerHTML = s;
|
|
9475
|
+
const N = at("g");
|
|
9476
|
+
return N.classList.add("module-layer3"), w.appendChild(N), N.setAttribute("fill", "white"), N.innerHTML = s, new os(w).transform(([I, Q]) => [I, Q + (c / 2 - I) ** 2 / (c * 6)]), w;
|
|
9426
9477
|
}, u = at("g");
|
|
9427
9478
|
u.classList.add("module-root");
|
|
9428
9479
|
const h = at("defs");
|
|
9429
9480
|
u.appendChild(h);
|
|
9430
|
-
const m = at("g");
|
|
9431
|
-
m.classList.add("module-bounds"), u.appendChild(m);
|
|
9432
|
-
const p = es(e.height, e.width);
|
|
9433
|
-
p.setAttribute("opacity", "0"), m.appendChild(p);
|
|
9434
9481
|
const g = at("g");
|
|
9435
|
-
g.classList.add("module-
|
|
9482
|
+
g.classList.add("module-bounds"), u.appendChild(g);
|
|
9483
|
+
const m = es(e.height, e.width);
|
|
9484
|
+
m.setAttribute("opacity", "0"), g.appendChild(m);
|
|
9485
|
+
const p = at("g");
|
|
9486
|
+
p.classList.add("module-text-enclosure"), u.appendChild(p);
|
|
9436
9487
|
const f = A();
|
|
9437
|
-
|
|
9488
|
+
p.appendChild(f);
|
|
9438
9489
|
const S = Oi(d);
|
|
9439
|
-
return is(
|
|
9490
|
+
return is(p, S, e.height, e.width, 0.35, 0.65), ns(u.outerHTML);
|
|
9440
9491
|
}
|
|
9441
9492
|
}
|
|
9442
9493
|
async function Ai(n) {
|
|
@@ -9460,22 +9511,22 @@ const ls = [
|
|
|
9460
9511
|
const a = t.data, i = e.data.baseUrl, r = a.assetUrl.replace("localhost", "localstack"), o = i.slice(0, 4) === "http" ? "" : "https://", s = new URL(o + i);
|
|
9461
9512
|
s.searchParams.append("video", Ha(JSON.stringify([{ href: r }]))), s.pathname = s.pathname + (s.pathname.slice(-1) === "/" ? "" : "/");
|
|
9462
9513
|
const l = s.toString(), d = `data:image/svg+xml;base64,${Ha(await Sn(l, { type: "svg" }))}`, A = (h) => {
|
|
9463
|
-
const
|
|
9464
|
-
if (!
|
|
9514
|
+
const g = n.find((p) => p.panelId === h.panelId);
|
|
9515
|
+
if (!g)
|
|
9465
9516
|
throw new K(h);
|
|
9466
|
-
const
|
|
9517
|
+
const m = T();
|
|
9467
9518
|
return new H(
|
|
9468
9519
|
{
|
|
9469
|
-
id:
|
|
9520
|
+
id: m,
|
|
9470
9521
|
src: d,
|
|
9471
|
-
type:
|
|
9522
|
+
type: D.Image,
|
|
9472
9523
|
y: h.top,
|
|
9473
9524
|
x: h.left,
|
|
9474
9525
|
width: h.width,
|
|
9475
9526
|
height: h.height,
|
|
9476
9527
|
rotation: 0
|
|
9477
9528
|
},
|
|
9478
|
-
|
|
9529
|
+
g
|
|
9479
9530
|
);
|
|
9480
9531
|
}, u = e.data.regions;
|
|
9481
9532
|
try {
|
|
@@ -9489,10 +9540,10 @@ const ls = [
|
|
|
9489
9540
|
const s = Mo(i, a.option);
|
|
9490
9541
|
s && (t[a.stepName] = { selectedVariants: [s] });
|
|
9491
9542
|
const l = async (c) => {
|
|
9492
|
-
const d = await ti(c, s?.asset?.fileLink), A = await ze(d), u =
|
|
9543
|
+
const d = await ti(c, s?.asset?.fileLink), A = await ze(d), u = T(), h = n.find((m) => m.panelId === c.panelId);
|
|
9493
9544
|
if (!h)
|
|
9494
9545
|
throw new K(c);
|
|
9495
|
-
const
|
|
9546
|
+
const g = Ta(
|
|
9496
9547
|
o,
|
|
9497
9548
|
A,
|
|
9498
9549
|
{
|
|
@@ -9507,7 +9558,7 @@ const ls = [
|
|
|
9507
9558
|
{
|
|
9508
9559
|
id: u,
|
|
9509
9560
|
path: A.path,
|
|
9510
|
-
type:
|
|
9561
|
+
type: D.Frame,
|
|
9511
9562
|
forceImageCover: a.data.forceImageCover,
|
|
9512
9563
|
x: c.left,
|
|
9513
9564
|
y: c.top,
|
|
@@ -9521,13 +9572,13 @@ const ls = [
|
|
|
9521
9572
|
pattern: {
|
|
9522
9573
|
id: `${u}-pattern`,
|
|
9523
9574
|
src: o.src,
|
|
9524
|
-
x:
|
|
9525
|
-
y:
|
|
9575
|
+
x: g.x,
|
|
9576
|
+
y: g.y,
|
|
9526
9577
|
width: o.width,
|
|
9527
9578
|
height: o.height,
|
|
9528
9579
|
rotation: 0,
|
|
9529
|
-
scaleX:
|
|
9530
|
-
scaleY:
|
|
9580
|
+
scaleX: g.zoom,
|
|
9581
|
+
scaleY: g.zoom,
|
|
9531
9582
|
svg: o.svg,
|
|
9532
9583
|
colors: o.colors
|
|
9533
9584
|
}
|
|
@@ -9544,7 +9595,7 @@ const ls = [
|
|
|
9544
9595
|
const i = e.data, r = a.option;
|
|
9545
9596
|
if (!r)
|
|
9546
9597
|
return console.error(`No option for step ${a.stepName}.`), [];
|
|
9547
|
-
const o = r.variants?.find((
|
|
9598
|
+
const o = r.variants?.find((v) => v.id === i.illustrationVariantId) || le(r);
|
|
9548
9599
|
if (!o)
|
|
9549
9600
|
return console.error(`No variant with ID: ${i.illustrationVariantId}`), [];
|
|
9550
9601
|
if (!o.asset)
|
|
@@ -9553,73 +9604,73 @@ const ls = [
|
|
|
9553
9604
|
const s = o.asset?.fileLink;
|
|
9554
9605
|
if (!s)
|
|
9555
9606
|
return console.error(`No asset link for variant with ID: ${i.illustrationVariantId}`), [];
|
|
9556
|
-
const l = await nt(s, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = d?.length > 0 ? d[0] : "",
|
|
9557
|
-
if (!
|
|
9607
|
+
const l = await nt(s, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = d?.length > 0 ? d[0] : "", g = At().parseFromString(A, "image/svg+xml").firstElementChild;
|
|
9608
|
+
if (!g)
|
|
9558
9609
|
return console.error("Failed to read SVG."), [];
|
|
9559
|
-
Pa(
|
|
9560
|
-
const
|
|
9561
|
-
Mt(
|
|
9562
|
-
ls.includes(
|
|
9563
|
-
const
|
|
9564
|
-
if (
|
|
9565
|
-
const
|
|
9566
|
-
|
|
9567
|
-
}
|
|
9568
|
-
const
|
|
9569
|
-
if (
|
|
9570
|
-
const
|
|
9571
|
-
|
|
9610
|
+
Pa(g);
|
|
9611
|
+
const m = {};
|
|
9612
|
+
Mt(g, (v) => {
|
|
9613
|
+
ls.includes(v.tagName) && !v.attributes.getNamedItem("fill") && v.setAttribute("fill", "#000000");
|
|
9614
|
+
const b = v.attributes.getNamedItem("fill");
|
|
9615
|
+
if (b && b.value !== "none") {
|
|
9616
|
+
const F = b.value, O = `spiff-fill-${F.replace(/\W/g, "")}`;
|
|
9617
|
+
v.classList.add(O), m[O] = { browserValue: F };
|
|
9618
|
+
}
|
|
9619
|
+
const P = v.attributes.getNamedItem("stroke");
|
|
9620
|
+
if (P && P.value !== "none") {
|
|
9621
|
+
const F = P.value, O = `spiff-stroke-${F.replace(/\W/g, "")}`;
|
|
9622
|
+
v.classList.add(O), m[O] = { browserValue: F };
|
|
9572
9623
|
}
|
|
9573
9624
|
});
|
|
9574
|
-
const f = Pt().serializeToString(
|
|
9625
|
+
const f = Pt().serializeToString(g), S = i.colors;
|
|
9575
9626
|
if (S) {
|
|
9576
|
-
for (const [
|
|
9577
|
-
for (const
|
|
9578
|
-
if (
|
|
9579
|
-
|
|
9627
|
+
for (const [v, b] of Object.entries(m))
|
|
9628
|
+
for (const P of Object.keys(S))
|
|
9629
|
+
if (b.browserValue === P) {
|
|
9630
|
+
m[v] = { browserValue: S[P] };
|
|
9580
9631
|
break;
|
|
9581
9632
|
}
|
|
9582
9633
|
}
|
|
9583
|
-
const w = (
|
|
9584
|
-
const
|
|
9585
|
-
if (!
|
|
9586
|
-
throw new K(
|
|
9587
|
-
const
|
|
9634
|
+
const w = (v) => {
|
|
9635
|
+
const b = n.find((F) => F.panelId === v.panelId);
|
|
9636
|
+
if (!b)
|
|
9637
|
+
throw new K(v);
|
|
9638
|
+
const P = T();
|
|
9588
9639
|
return new H(
|
|
9589
9640
|
{
|
|
9590
|
-
colors:
|
|
9591
|
-
id:
|
|
9641
|
+
colors: m,
|
|
9642
|
+
id: P,
|
|
9592
9643
|
svg: f,
|
|
9593
|
-
type:
|
|
9594
|
-
y:
|
|
9595
|
-
x:
|
|
9596
|
-
rotation:
|
|
9597
|
-
width:
|
|
9598
|
-
height:
|
|
9599
|
-
layer:
|
|
9600
|
-
layerIndex:
|
|
9601
|
-
immutable:
|
|
9644
|
+
type: D.Illustration,
|
|
9645
|
+
y: v.top,
|
|
9646
|
+
x: v.left,
|
|
9647
|
+
rotation: v.rotation,
|
|
9648
|
+
width: v.width,
|
|
9649
|
+
height: v.height,
|
|
9650
|
+
layer: v.layer,
|
|
9651
|
+
layerIndex: v.layerIndex,
|
|
9652
|
+
immutable: v.immutable
|
|
9602
9653
|
},
|
|
9603
|
-
|
|
9654
|
+
b
|
|
9604
9655
|
);
|
|
9605
|
-
},
|
|
9656
|
+
}, x = a.data.regions;
|
|
9606
9657
|
try {
|
|
9607
|
-
return
|
|
9608
|
-
} catch (
|
|
9609
|
-
return console.error(
|
|
9658
|
+
return x.map(w);
|
|
9659
|
+
} catch (v) {
|
|
9660
|
+
return console.error(v), [];
|
|
9610
9661
|
}
|
|
9611
9662
|
}, us = async (n, t, e) => {
|
|
9612
9663
|
const a = await Ai(e.data.module), i = t.data, r = (s, l) => {
|
|
9613
9664
|
const c = n.find((A) => A.panelId === l.panelId);
|
|
9614
9665
|
if (!c)
|
|
9615
9666
|
throw new K(l);
|
|
9616
|
-
const d =
|
|
9667
|
+
const d = T();
|
|
9617
9668
|
return new H(
|
|
9618
9669
|
{
|
|
9619
9670
|
colors: {},
|
|
9620
9671
|
id: d,
|
|
9621
9672
|
svg: s,
|
|
9622
|
-
type:
|
|
9673
|
+
type: D.Illustration,
|
|
9623
9674
|
y: l.top,
|
|
9624
9675
|
x: l.left,
|
|
9625
9676
|
rotation: l.rotation,
|
|
@@ -9655,12 +9706,12 @@ const ls = [
|
|
|
9655
9706
|
const A = n.find((h) => h.panelId === d.panelId);
|
|
9656
9707
|
if (!A)
|
|
9657
9708
|
throw new K(d);
|
|
9658
|
-
const u =
|
|
9709
|
+
const u = T();
|
|
9659
9710
|
return new H(
|
|
9660
9711
|
{
|
|
9661
9712
|
id: u,
|
|
9662
9713
|
src: s,
|
|
9663
|
-
type:
|
|
9714
|
+
type: D.Image,
|
|
9664
9715
|
y: d.top,
|
|
9665
9716
|
x: d.left,
|
|
9666
9717
|
rotation: d.rotation,
|
|
@@ -9679,7 +9730,7 @@ const ls = [
|
|
|
9679
9730
|
} catch (d) {
|
|
9680
9731
|
return console.error(d), [];
|
|
9681
9732
|
}
|
|
9682
|
-
},
|
|
9733
|
+
}, gs = async (n, t, e, a) => {
|
|
9683
9734
|
const i = e.data, r = a.option;
|
|
9684
9735
|
if (!r)
|
|
9685
9736
|
return console.error(`No option for step ${a.stepName}.`), [];
|
|
@@ -9688,7 +9739,7 @@ const ls = [
|
|
|
9688
9739
|
return console.error(`No variant with ID: ${i.colorVariantId}`), [];
|
|
9689
9740
|
t[a.stepName] = { selectedVariants: [o] };
|
|
9690
9741
|
const s = (c) => {
|
|
9691
|
-
const d = n.find((
|
|
9742
|
+
const d = n.find((m) => m.panelId === c.panelId);
|
|
9692
9743
|
if (!d)
|
|
9693
9744
|
throw new K(c);
|
|
9694
9745
|
const A = `
|
|
@@ -9711,13 +9762,13 @@ const ls = [
|
|
|
9711
9762
|
fill="${o?.color}"
|
|
9712
9763
|
/>
|
|
9713
9764
|
</svg>
|
|
9714
|
-
`, h = { "spiff-fill-shape": { browserValue: o.color || "#000000" } },
|
|
9765
|
+
`, h = { "spiff-fill-shape": { browserValue: o.color || "#000000" } }, g = T();
|
|
9715
9766
|
return new H(
|
|
9716
9767
|
{
|
|
9717
9768
|
colors: h,
|
|
9718
|
-
id:
|
|
9769
|
+
id: g,
|
|
9719
9770
|
svg: A,
|
|
9720
|
-
type:
|
|
9771
|
+
type: D.Illustration,
|
|
9721
9772
|
y: c.top,
|
|
9722
9773
|
x: c.left,
|
|
9723
9774
|
rotation: c.rotation,
|
|
@@ -9735,8 +9786,8 @@ const ls = [
|
|
|
9735
9786
|
} catch (c) {
|
|
9736
9787
|
return console.error(c), [];
|
|
9737
9788
|
}
|
|
9738
|
-
},
|
|
9739
|
-
const a = [], r = t.type ===
|
|
9789
|
+
}, ms = async (n, t, e) => {
|
|
9790
|
+
const a = [], r = t.type === E.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ? D.Image : (r.endsWith(".svg"), D.Illustration), l = t.data.regions;
|
|
9740
9791
|
if (s === "image")
|
|
9741
9792
|
try {
|
|
9742
9793
|
l.forEach((c) => {
|
|
@@ -9744,7 +9795,7 @@ const ls = [
|
|
|
9744
9795
|
if (!d)
|
|
9745
9796
|
throw new K(c);
|
|
9746
9797
|
const A = {
|
|
9747
|
-
id:
|
|
9798
|
+
id: T(),
|
|
9748
9799
|
src: r,
|
|
9749
9800
|
type: s,
|
|
9750
9801
|
y: c.top,
|
|
@@ -9753,7 +9804,7 @@ const ls = [
|
|
|
9753
9804
|
height: c.height,
|
|
9754
9805
|
layer: c.layer,
|
|
9755
9806
|
layerIndex: c.layerIndex,
|
|
9756
|
-
productOverlay: t.type ===
|
|
9807
|
+
productOverlay: t.type === E.ProductOverlay ? !0 : void 0,
|
|
9757
9808
|
scaleX: 1,
|
|
9758
9809
|
scaleY: 1,
|
|
9759
9810
|
rotation: c.rotation,
|
|
@@ -9767,17 +9818,17 @@ const ls = [
|
|
|
9767
9818
|
}
|
|
9768
9819
|
else {
|
|
9769
9820
|
const c = await nt(r, !0), d = (A) => {
|
|
9770
|
-
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [],
|
|
9821
|
+
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], g = h?.length > 0 ? h[0] : "", f = At().parseFromString(g, "image/svg+xml").firstElementChild;
|
|
9771
9822
|
if (!f)
|
|
9772
|
-
throw new
|
|
9823
|
+
throw new Dt("Failed to read SVG.");
|
|
9773
9824
|
return Pa(f), Pt().serializeToString(f);
|
|
9774
9825
|
};
|
|
9775
9826
|
l.forEach((A) => {
|
|
9776
|
-
const u = n.find((
|
|
9827
|
+
const u = n.find((g) => g.panelId === A.panelId);
|
|
9777
9828
|
if (!u)
|
|
9778
9829
|
throw new K(A);
|
|
9779
9830
|
const h = {
|
|
9780
|
-
id:
|
|
9831
|
+
id: T(),
|
|
9781
9832
|
src: r,
|
|
9782
9833
|
asset_key: r,
|
|
9783
9834
|
svg: d(c),
|
|
@@ -9792,7 +9843,7 @@ const ls = [
|
|
|
9792
9843
|
scaleX: 1,
|
|
9793
9844
|
scaleY: 1,
|
|
9794
9845
|
rotation: A.rotation,
|
|
9795
|
-
productOverlay: t.type ===
|
|
9846
|
+
productOverlay: t.type === E.ProductOverlay ? !0 : void 0,
|
|
9796
9847
|
excludeFromExport: t.data.excludeFromPrint
|
|
9797
9848
|
};
|
|
9798
9849
|
a.push(new H(h, u));
|
|
@@ -9800,11 +9851,11 @@ const ls = [
|
|
|
9800
9851
|
}
|
|
9801
9852
|
return a;
|
|
9802
9853
|
}, ps = async (n, t, e, a) => {
|
|
9803
|
-
const i = [], r = e.data, o = 30, s = (
|
|
9804
|
-
const
|
|
9805
|
-
if (!
|
|
9854
|
+
const i = [], r = e.data, o = 30, s = (p) => p.vertical ? "center" : p.textAlign || "center", l = () => {
|
|
9855
|
+
const p = a.option;
|
|
9856
|
+
if (!p)
|
|
9806
9857
|
return;
|
|
9807
|
-
const f =
|
|
9858
|
+
const f = p.variants?.find((w) => w.id === r.fontVariantId) || le(p);
|
|
9808
9859
|
if (!f || !f.asset)
|
|
9809
9860
|
return;
|
|
9810
9861
|
t[a.stepName] = { selectedVariants: [f] };
|
|
@@ -9812,51 +9863,51 @@ const ls = [
|
|
|
9812
9863
|
if (S)
|
|
9813
9864
|
return S;
|
|
9814
9865
|
}, d = await (async () => {
|
|
9815
|
-
const
|
|
9816
|
-
if (!
|
|
9866
|
+
const p = l();
|
|
9867
|
+
if (!p)
|
|
9817
9868
|
return;
|
|
9818
|
-
const f = await Qt(
|
|
9869
|
+
const f = await Qt(p);
|
|
9819
9870
|
return {
|
|
9820
|
-
assetUrl:
|
|
9871
|
+
assetUrl: p,
|
|
9821
9872
|
name: f.names.fullName.en
|
|
9822
9873
|
};
|
|
9823
9874
|
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u = ke(A, {
|
|
9824
9875
|
vertical: a.data.vertical,
|
|
9825
9876
|
uppercase: a.data.uppercase
|
|
9826
|
-
}), h = async (
|
|
9827
|
-
const f =
|
|
9877
|
+
}), h = async (p) => {
|
|
9878
|
+
const f = p.colorOption;
|
|
9828
9879
|
return f ? J.getDefaultVariant(f)?.color : void 0;
|
|
9829
|
-
},
|
|
9830
|
-
for (const
|
|
9831
|
-
const f = n.find((w) => w.panelId ===
|
|
9880
|
+
}, g = r.color || await h(a.data), m = a.data.regions;
|
|
9881
|
+
for (const p of m) {
|
|
9882
|
+
const f = n.find((w) => w.panelId === p.panelId);
|
|
9832
9883
|
if (!f)
|
|
9833
9884
|
continue;
|
|
9834
9885
|
const S = {
|
|
9835
9886
|
stepName: e.name,
|
|
9836
|
-
id:
|
|
9887
|
+
id: T(),
|
|
9837
9888
|
align: s(a.data),
|
|
9838
9889
|
curved: a.data.curved,
|
|
9839
|
-
fill: r.color ||
|
|
9890
|
+
fill: r.color || g || "#000000",
|
|
9840
9891
|
fontData: d,
|
|
9841
9892
|
fontSize: a.data.size || o,
|
|
9842
|
-
height:
|
|
9843
|
-
layer:
|
|
9844
|
-
layerIndex:
|
|
9893
|
+
height: p.height,
|
|
9894
|
+
layer: p.layer,
|
|
9895
|
+
layerIndex: p.layerIndex,
|
|
9845
9896
|
paths: a.data.paths,
|
|
9846
|
-
rotation:
|
|
9897
|
+
rotation: p.rotation,
|
|
9847
9898
|
text: u,
|
|
9848
|
-
type:
|
|
9899
|
+
type: D.Textbox,
|
|
9849
9900
|
vertical: a.data.vertical,
|
|
9850
9901
|
verticalAlign: a.data.verticalAlign || "middle",
|
|
9851
|
-
width:
|
|
9852
|
-
x:
|
|
9853
|
-
y:
|
|
9902
|
+
width: p.width,
|
|
9903
|
+
x: p.left,
|
|
9904
|
+
y: p.top
|
|
9854
9905
|
};
|
|
9855
9906
|
if (d) {
|
|
9856
|
-
const [w,
|
|
9907
|
+
const [w, x] = ve(
|
|
9857
9908
|
a.data.size || o,
|
|
9858
9909
|
d,
|
|
9859
|
-
|
|
9910
|
+
p,
|
|
9860
9911
|
[
|
|
9861
9912
|
ke(u, {
|
|
9862
9913
|
vertical: a.data.vertical,
|
|
@@ -9874,7 +9925,7 @@ const ls = [
|
|
|
9874
9925
|
{
|
|
9875
9926
|
...S,
|
|
9876
9927
|
fontSize: w,
|
|
9877
|
-
text: S.curved ? S.text : (
|
|
9928
|
+
text: S.curved ? S.text : (x || []).join(`
|
|
9878
9929
|
`)
|
|
9879
9930
|
},
|
|
9880
9931
|
f
|
|
@@ -9899,18 +9950,18 @@ const ls = [
|
|
|
9899
9950
|
const s = t.steps.find((l) => l.stepName === o.name);
|
|
9900
9951
|
if (s)
|
|
9901
9952
|
switch (s.type) {
|
|
9902
|
-
case
|
|
9953
|
+
case E.DigitalContent:
|
|
9903
9954
|
i.push(
|
|
9904
9955
|
...await cs(e, o, s)
|
|
9905
9956
|
);
|
|
9906
9957
|
break;
|
|
9907
|
-
case
|
|
9908
|
-
case
|
|
9958
|
+
case E.Frame:
|
|
9959
|
+
case E.Photo:
|
|
9909
9960
|
i.push(
|
|
9910
9961
|
...await ds(e, r, o, s)
|
|
9911
9962
|
);
|
|
9912
9963
|
break;
|
|
9913
|
-
case
|
|
9964
|
+
case E.Illustration:
|
|
9914
9965
|
i.push(
|
|
9915
9966
|
...await As(
|
|
9916
9967
|
e,
|
|
@@ -9920,20 +9971,20 @@ const ls = [
|
|
|
9920
9971
|
)
|
|
9921
9972
|
);
|
|
9922
9973
|
break;
|
|
9923
|
-
case
|
|
9974
|
+
case E.Module:
|
|
9924
9975
|
i.push(...await us(e, o, s));
|
|
9925
9976
|
break;
|
|
9926
|
-
case
|
|
9977
|
+
case E.Picture:
|
|
9927
9978
|
i.push(
|
|
9928
9979
|
...await hs(e, r, o, s)
|
|
9929
9980
|
);
|
|
9930
9981
|
break;
|
|
9931
|
-
case
|
|
9982
|
+
case E.Shape:
|
|
9932
9983
|
i.push(
|
|
9933
|
-
...await
|
|
9984
|
+
...await gs(e, r, o, s)
|
|
9934
9985
|
);
|
|
9935
9986
|
break;
|
|
9936
|
-
case
|
|
9987
|
+
case E.Text:
|
|
9937
9988
|
i.push(
|
|
9938
9989
|
...await ps(e, r, o, s)
|
|
9939
9990
|
);
|
|
@@ -9941,8 +9992,8 @@ const ls = [
|
|
|
9941
9992
|
}
|
|
9942
9993
|
}
|
|
9943
9994
|
for (const o of t.steps)
|
|
9944
|
-
o.type !==
|
|
9945
|
-
...await
|
|
9995
|
+
o.type !== E.SilentIllustration && o.type !== E.ProductOverlay || fs(o, r) && i.push(
|
|
9996
|
+
...await ms(e, o, a)
|
|
9946
9997
|
);
|
|
9947
9998
|
return i;
|
|
9948
9999
|
};
|
|
@@ -10094,16 +10145,16 @@ class Es extends Wn {
|
|
|
10094
10145
|
* a loose target but should be kept in mind when making changes.
|
|
10095
10146
|
*/
|
|
10096
10147
|
async execute() {
|
|
10097
|
-
const t = this.layouts.find((
|
|
10148
|
+
const t = this.layouts.find((g) => g.layoutState.layout.id === this.layoutId);
|
|
10098
10149
|
if (!t)
|
|
10099
10150
|
return;
|
|
10100
10151
|
const e = t.layoutState.elements || [], a = t.layoutState.layout.width, i = t.layoutState.layout.height, r = a === 1 || i === 1 ? { width: 1, height: 1 } : this.getDynamicTextureResolution(), o = r.width, s = r.height;
|
|
10101
10152
|
let l, c;
|
|
10102
10153
|
if (this.nonPOTSupport) {
|
|
10103
|
-
const
|
|
10104
|
-
a / i <
|
|
10105
|
-
const
|
|
10106
|
-
l =
|
|
10154
|
+
const g = o / s;
|
|
10155
|
+
a / i < g ? (l = o, c = i * (o / a)) : (l = a * (s / i), c = s);
|
|
10156
|
+
const p = this.resizeFit({ width: l, height: c });
|
|
10157
|
+
l = p.width, c = p.height;
|
|
10107
10158
|
} else
|
|
10108
10159
|
l = r.width, c = r.height;
|
|
10109
10160
|
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = ka(t.layoutState.layout, e, {
|
|
@@ -10111,7 +10162,7 @@ class Es extends Wn {
|
|
|
10111
10162
|
purpose: Kt.ThreeD,
|
|
10112
10163
|
templatingContext: d
|
|
10113
10164
|
}
|
|
10114
|
-
}), u =
|
|
10165
|
+
}), u = xn(A), h = await va.from(this.ctx, u, {
|
|
10115
10166
|
anonymousCrossOrigin: !0,
|
|
10116
10167
|
ignoreDimensions: !this.nonPOTSupport,
|
|
10117
10168
|
ignoreAnimation: !0,
|
|
@@ -10130,7 +10181,7 @@ const Md = (n, t) => {
|
|
|
10130
10181
|
const e = [];
|
|
10131
10182
|
return n.forEach((a) => {
|
|
10132
10183
|
const i = t.steps.find((r) => r.stepName === a.stepName);
|
|
10133
|
-
i?.type ===
|
|
10184
|
+
i?.type === E.Text && a.stepAspectType === "Text" && e.push({
|
|
10134
10185
|
name: i.stepName,
|
|
10135
10186
|
data: {
|
|
10136
10187
|
text: a.value
|
|
@@ -10351,7 +10402,7 @@ const Md = (n, t) => {
|
|
|
10351
10402
|
workflowViewerLink
|
|
10352
10403
|
workflowViewerAmendLink
|
|
10353
10404
|
}
|
|
10354
|
-
`,
|
|
10405
|
+
`, xs = (n) => C`
|
|
10355
10406
|
${Ge}
|
|
10356
10407
|
${We(n)}
|
|
10357
10408
|
${ui}
|
|
@@ -10431,7 +10482,7 @@ const Md = (n, t) => {
|
|
|
10431
10482
|
}
|
|
10432
10483
|
}
|
|
10433
10484
|
}
|
|
10434
|
-
`,
|
|
10485
|
+
`, Ds = C`
|
|
10435
10486
|
query GetBundlesForCustomer($id: String!) {
|
|
10436
10487
|
customers(ids: [$id]) {
|
|
10437
10488
|
bundleStakeholders {
|
|
@@ -10460,7 +10511,7 @@ const Md = (n, t) => {
|
|
|
10460
10511
|
}
|
|
10461
10512
|
}
|
|
10462
10513
|
}
|
|
10463
|
-
`,
|
|
10514
|
+
`, Fs = C`
|
|
10464
10515
|
${Qa(!1)}
|
|
10465
10516
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
|
10466
10517
|
productCollections(ids: [$id], productIds: $productIds) {
|
|
@@ -10866,7 +10917,7 @@ class on extends Wn {
|
|
|
10866
10917
|
}
|
|
10867
10918
|
}
|
|
10868
10919
|
const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
10869
|
-
id:
|
|
10920
|
+
id: T(),
|
|
10870
10921
|
panelId: t.name,
|
|
10871
10922
|
name: t.name,
|
|
10872
10923
|
title: t.title,
|
|
@@ -10885,14 +10936,14 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10885
10936
|
}, jt = class jt {
|
|
10886
10937
|
constructor(t, e, a, i, r, o = !1, s, l = !1, c = !1, d = !1) {
|
|
10887
10938
|
this.workflowStatePromiseQueue = new qn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.setWorkflow = async (u) => {
|
|
10888
|
-
this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.stepSpecificServices = {}, this.pollers = [], this.allScenes = [], this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.currentAdjustingStepId = "", this.reloadedState ? this.layouts = Object.values(this.reloadedState.layouts || {}).map((
|
|
10889
|
-
this.stepTags[
|
|
10939
|
+
this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.stepSpecificServices = {}, this.pollers = [], this.allScenes = [], this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.currentAdjustingStepId = "", this.reloadedState ? this.layouts = Object.values(this.reloadedState.layouts || {}).map((g) => g.layout) : u ? this.layouts = nl(this.experience.getTransaction(), u) : this.layouts = [], this.commandContext.initialize(this.layouts, this.reloadedState), this.renderableContextService = new ws(this.layouts), this.renderableContextService.setWorkflowManager(this), u.steps.forEach((g) => {
|
|
10940
|
+
this.stepTags[g.stepName] = g.tags ?? [];
|
|
10890
10941
|
});
|
|
10891
10942
|
const h = this.previewService;
|
|
10892
10943
|
this.ejectFromPreviewService(), this.initializationPromise = this.initializeDefaultWorkflowState(u), this.initializationPromise.then(() => {
|
|
10893
10944
|
this.initialized = !0;
|
|
10894
|
-
}), this.initializationPromise.catch((
|
|
10895
|
-
throw console.error(
|
|
10945
|
+
}), this.initializationPromise.catch((g) => {
|
|
10946
|
+
throw console.error(g), this.initialized = !1, new Error("Workflow initialization failed due to an error. See console.");
|
|
10896
10947
|
}), this.initializationPromise.finally(
|
|
10897
10948
|
() => this.commandContext.registerStateCallback(() => {
|
|
10898
10949
|
this.updateStateWithServer(), this.renderLayouts();
|
|
@@ -10902,8 +10953,8 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10902
10953
|
if (!this.previewService) return;
|
|
10903
10954
|
const u = this.getCommandContext().getAllLayouts(), h = this.getLayoutPreviewService()?.getAll();
|
|
10904
10955
|
if (h)
|
|
10905
|
-
for (const [,
|
|
10906
|
-
|
|
10956
|
+
for (const [, g] of h)
|
|
10957
|
+
g.render(u);
|
|
10907
10958
|
}, this.experience = t, this.client = e, this.updateTransaction = a, this.graphQlClient = i, this.reloadedState = r, this.readOnly = o, this.singleVariantsRenderable = c, this.commandContext = new ko(), this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.modelContainer = s, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.stepSpecificServices = {}, this.pollers = [], this.allScenes = [], this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.currentAdjustingStepId = "", this.isReloadedTransaction = l, d && (this.workflowStatePromiseQueue.enabled = !1);
|
|
10908
10959
|
const A = this.experience.getWorkflow();
|
|
10909
10960
|
A && this.setWorkflow(A);
|
|
@@ -10915,7 +10966,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10915
10966
|
a.type === Ee.FirstName ? e[i] = t?.firstName : a.type === Ee.LastName ? e[i] = t?.lastName : a.type === Ee.Custom && (a.customFieldIndex === 1 ? e[i] = t?.customField1 : a.customFieldIndex === 2 ? e[i] = t?.customField2 : a.customFieldIndex === 3 ? e[i] = t?.customField3 : a.customFieldIndex === 4 ? e[i] = t?.customField4 : a.customFieldIndex === 5 && (e[i] = t?.customField5), a.option && (e[i] = a.option.variants?.find((r) => r.id === e[i])?.name));
|
|
10916
10967
|
}), e;
|
|
10917
10968
|
}
|
|
10918
|
-
async updateRecipient(t, e, a, i, r, o, s, l, c, d, A, u, h, m, p,
|
|
10969
|
+
async updateRecipient(t, e, a, i, r, o, s, l, c, d, A, u, h, g, m, p, f, S) {
|
|
10919
10970
|
const w = this.experience.getTransaction();
|
|
10920
10971
|
if (w.recipient?.id)
|
|
10921
10972
|
this.experience.getTransaction().recipient = {
|
|
@@ -10933,9 +10984,9 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10933
10984
|
apartment: A ?? w.recipient.apartment,
|
|
10934
10985
|
customField1: u ?? w.recipient.customField1,
|
|
10935
10986
|
customField2: h ?? w.recipient.customField2,
|
|
10936
|
-
customField3:
|
|
10937
|
-
customField4:
|
|
10938
|
-
customField5:
|
|
10987
|
+
customField3: g ?? w.recipient.customField3,
|
|
10988
|
+
customField4: m ?? w.recipient.customField4,
|
|
10989
|
+
customField5: p ?? w.recipient.customField5,
|
|
10939
10990
|
conversionConfigurationId: f || w.recipient.conversionConfigurationId
|
|
10940
10991
|
}, this.experience.callEvent(wa.RecipientChanged), await this.graphQlClient().mutate({
|
|
10941
10992
|
mutation: Xs,
|
|
@@ -10956,15 +11007,15 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10956
11007
|
apartment: A || w.recipient.apartment,
|
|
10957
11008
|
customField1: u || w.recipient.customField1,
|
|
10958
11009
|
customField2: h || w.recipient.customField2,
|
|
10959
|
-
customField3:
|
|
10960
|
-
customField4:
|
|
10961
|
-
customField5:
|
|
11010
|
+
customField3: g || w.recipient.customField3,
|
|
11011
|
+
customField4: m || w.recipient.customField4,
|
|
11012
|
+
customField5: p || w.recipient.customField5,
|
|
10962
11013
|
conversionConfigurationId: f || w.recipient.conversionConfigurationId,
|
|
10963
11014
|
prevalidated: S
|
|
10964
11015
|
}
|
|
10965
11016
|
});
|
|
10966
11017
|
else {
|
|
10967
|
-
const
|
|
11018
|
+
const x = await this.graphQlClient().mutate({
|
|
10968
11019
|
mutation: _s,
|
|
10969
11020
|
errorPolicy: "all",
|
|
10970
11021
|
fetchPolicy: "no-cache",
|
|
@@ -10982,14 +11033,14 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10982
11033
|
apartment: A,
|
|
10983
11034
|
customField1: u,
|
|
10984
11035
|
customField2: h,
|
|
10985
|
-
customField3:
|
|
10986
|
-
customField4:
|
|
10987
|
-
customField5:
|
|
11036
|
+
customField3: g,
|
|
11037
|
+
customField4: m,
|
|
11038
|
+
customField5: p,
|
|
10988
11039
|
conversionConfigurationId: f
|
|
10989
11040
|
}
|
|
10990
11041
|
});
|
|
10991
11042
|
w.recipient = {
|
|
10992
|
-
id:
|
|
11043
|
+
id: x?.data?.recipientCreate?.id,
|
|
10993
11044
|
firstName: t,
|
|
10994
11045
|
lastName: e,
|
|
10995
11046
|
address: a,
|
|
@@ -11003,9 +11054,9 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11003
11054
|
apartment: A,
|
|
11004
11055
|
customField1: u,
|
|
11005
11056
|
customField2: h,
|
|
11006
|
-
customField3:
|
|
11007
|
-
customField4:
|
|
11008
|
-
customField5:
|
|
11057
|
+
customField3: g,
|
|
11058
|
+
customField4: m,
|
|
11059
|
+
customField5: p,
|
|
11009
11060
|
conversionConfigurationId: f
|
|
11010
11061
|
}, this.experience.callEvent(wa.RecipientChanged), await this.graphQlClient().mutate({
|
|
11011
11062
|
mutation: Zs,
|
|
@@ -11013,14 +11064,14 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11013
11064
|
fetchPolicy: "no-cache",
|
|
11014
11065
|
variables: {
|
|
11015
11066
|
id: this.experience.getTransaction().id,
|
|
11016
|
-
recipientId:
|
|
11067
|
+
recipientId: x.data?.recipientCreate?.id
|
|
11017
11068
|
},
|
|
11018
11069
|
context: {
|
|
11019
11070
|
transactionOwnerId: this.experience.getTransaction().transactionOwnerId
|
|
11020
11071
|
}
|
|
11021
11072
|
});
|
|
11022
11073
|
}
|
|
11023
|
-
await this.fetchConversionConfiguration(), this.recipientCallbacks.forEach((
|
|
11074
|
+
await this.fetchConversionConfiguration(), this.recipientCallbacks.forEach((x) => x(this.experience.getTransaction().recipient));
|
|
11024
11075
|
}
|
|
11025
11076
|
async fetchConversionConfiguration() {
|
|
11026
11077
|
const t = this.experience.getTransaction().recipient;
|
|
@@ -11190,7 +11241,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11190
11241
|
this.pendingUpdates = this.pendingUpdates.filter((e) => e !== t);
|
|
11191
11242
|
}
|
|
11192
11243
|
markUpdatePending() {
|
|
11193
|
-
const t =
|
|
11244
|
+
const t = T();
|
|
11194
11245
|
return this.pendingUpdates = [...this.pendingUpdates, t], t;
|
|
11195
11246
|
}
|
|
11196
11247
|
setEditedStatus(t, e) {
|
|
@@ -11243,7 +11294,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11243
11294
|
},
|
|
11244
11295
|
{ refocusCamera: e }
|
|
11245
11296
|
);
|
|
11246
|
-
this.setModelContainer(i), vt(this.allScenes, this.stepSelections).filter((s) => s).map((s) => s.renderableSteps).flat().filter((s) => s.type ===
|
|
11297
|
+
this.setModelContainer(i), vt(this.allScenes, this.stepSelections).filter((s) => s).map((s) => s.renderableSteps).flat().filter((s) => s.type === E.Model || s.type === E.Material).forEach((s) => {
|
|
11247
11298
|
if (!s.option?.id) {
|
|
11248
11299
|
console.error(`Failed to read option id from step: ${s.stepName}`);
|
|
11249
11300
|
return;
|
|
@@ -11251,7 +11302,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11251
11302
|
const l = this.stepSelections[s.stepName]?.selectedVariants || [];
|
|
11252
11303
|
if (l.length === 0) return;
|
|
11253
11304
|
const c = l[0];
|
|
11254
|
-
if (s.type ===
|
|
11305
|
+
if (s.type === E.Model) {
|
|
11255
11306
|
if (!this.modelContainer)
|
|
11256
11307
|
throw new R(
|
|
11257
11308
|
"We should always have a model container when injecting a preview!"
|
|
@@ -11391,17 +11442,17 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11391
11442
|
), t), []) || [];
|
|
11392
11443
|
}
|
|
11393
11444
|
getInvalidModelVariants() {
|
|
11394
|
-
return this.experience.getWorkflow()?.steps.reduce((t, e) => (e.type ===
|
|
11445
|
+
return this.experience.getWorkflow()?.steps.reduce((t, e) => (e.type === E.Model && !bt(e, this.stepSelections) && t.push(e.stepName), t), []) || [];
|
|
11395
11446
|
}
|
|
11396
11447
|
async stepElementsForIntroducedSilentSteps(t, e) {
|
|
11397
11448
|
const a = this.experience.getProduct();
|
|
11398
11449
|
if (!a)
|
|
11399
11450
|
return Promise.resolve({ stepElements: {}, commands: [] });
|
|
11400
11451
|
const i = async (c, d, A) => {
|
|
11401
|
-
if (c.type ===
|
|
11452
|
+
if (c.type === E.SilentIllustration) {
|
|
11402
11453
|
const u = await new an(c, d).trigger();
|
|
11403
11454
|
return { step: c, results: u };
|
|
11404
|
-
} else if (c.type ===
|
|
11455
|
+
} else if (c.type === E.ProductOverlay) {
|
|
11405
11456
|
const u = await new an(
|
|
11406
11457
|
c,
|
|
11407
11458
|
d,
|
|
@@ -11488,37 +11539,37 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11488
11539
|
this.stepSelections = {
|
|
11489
11540
|
...this.stepSelections,
|
|
11490
11541
|
[t]: { selectedVariants: e }
|
|
11491
|
-
}, this.selectionCost = Object.values(this.stepSelections).reduce((
|
|
11492
|
-
bt(
|
|
11542
|
+
}, this.selectionCost = Object.values(this.stepSelections).reduce((b, P) => b + P.selectedVariants.map((F) => F.priceModifier || 0).reduce((F, N) => F + N, 0), 0), r.steps.forEach((b) => {
|
|
11543
|
+
bt(b, this.stepSelections) || (this.stepInitialised[b.stepName] = !1, delete this.stepMetadata[b.stepName], delete this.stepSelections[b.stepName], delete this.storage[b.stepName]);
|
|
11493
11544
|
});
|
|
11494
|
-
const s = this.allScenes, l = vt(s, o), c = vt(s, this.stepSelections), d = l.map((
|
|
11495
|
-
(
|
|
11545
|
+
const s = this.allScenes, l = vt(s, o), c = vt(s, this.stepSelections), d = l.map((b) => b.silentSteps).flat(), u = c.map((b) => b.silentSteps).flat().filter(
|
|
11546
|
+
(b) => !d.some((P) => P.stepName === b.stepName)
|
|
11496
11547
|
);
|
|
11497
|
-
d.forEach((
|
|
11498
|
-
bt(
|
|
11548
|
+
d.forEach((b) => {
|
|
11549
|
+
bt(b, this.stepSelections) || (this.stepInitialised[b.stepName] = !1);
|
|
11499
11550
|
});
|
|
11500
|
-
const h = this.getInvalidCanvasRegions(), { stepElements:
|
|
11551
|
+
const h = this.getInvalidCanvasRegions(), { stepElements: g, commands: m } = await this.stepElementsForIntroducedSilentSteps(u, !1);
|
|
11501
11552
|
this.stepElements = {
|
|
11502
11553
|
...this.stepElements,
|
|
11503
|
-
...
|
|
11554
|
+
...g,
|
|
11504
11555
|
[t]: a
|
|
11505
11556
|
}, this.removeElements(h);
|
|
11506
|
-
const
|
|
11507
|
-
|
|
11508
|
-
const f = h.map((
|
|
11557
|
+
const p = r.steps.find((b) => b.stepName === t);
|
|
11558
|
+
p?.type === E.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((P) => P.id));
|
|
11559
|
+
const f = h.map((b) => new Rt(b.id)), S = new tn(this.constructSerializableWorkflow()), w = [...m, ...f, S];
|
|
11509
11560
|
w.length > 0 && this.commandContext.apply(new L(w), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
11510
|
-
const
|
|
11511
|
-
if (
|
|
11512
|
-
const
|
|
11513
|
-
(
|
|
11514
|
-
|
|
11561
|
+
const x = this.getInvalidModelVariants(), v = this.modelContainer;
|
|
11562
|
+
if (v) {
|
|
11563
|
+
const b = x.map(
|
|
11564
|
+
(P) => v.applyModelVariant(
|
|
11565
|
+
P,
|
|
11515
11566
|
{
|
|
11516
11567
|
contextService: this.getLayoutPreviewService()
|
|
11517
11568
|
},
|
|
11518
11569
|
!1
|
|
11519
11570
|
)
|
|
11520
11571
|
);
|
|
11521
|
-
await Promise.all(
|
|
11572
|
+
await Promise.all(b);
|
|
11522
11573
|
}
|
|
11523
11574
|
await this.onSelectionChange(), i && await i();
|
|
11524
11575
|
}
|
|
@@ -11527,7 +11578,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11527
11578
|
for (const l of i)
|
|
11528
11579
|
if (!this.stepInitialised[l.stepName])
|
|
11529
11580
|
switch (this.stepInitialised[l.stepName] = !0, l.type) {
|
|
11530
|
-
case
|
|
11581
|
+
case E.DigitalContent:
|
|
11531
11582
|
a.push(
|
|
11532
11583
|
ri.init(
|
|
11533
11584
|
l,
|
|
@@ -11536,43 +11587,43 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11536
11587
|
)
|
|
11537
11588
|
);
|
|
11538
11589
|
break;
|
|
11539
|
-
case
|
|
11590
|
+
case E.Frame:
|
|
11540
11591
|
a.push(Et.init(l, this, this.reloadedState));
|
|
11541
11592
|
break;
|
|
11542
|
-
case
|
|
11593
|
+
case E.Illustration:
|
|
11543
11594
|
a.push(
|
|
11544
11595
|
Se.init(l, this, this.reloadedState)
|
|
11545
11596
|
);
|
|
11546
11597
|
break;
|
|
11547
|
-
case
|
|
11598
|
+
case E.Material:
|
|
11548
11599
|
a.push(
|
|
11549
11600
|
oi.init(l, this, this.reloadedState)
|
|
11550
11601
|
);
|
|
11551
11602
|
break;
|
|
11552
|
-
case
|
|
11603
|
+
case E.Model:
|
|
11553
11604
|
a.push(si.init(l, this, this.reloadedState));
|
|
11554
11605
|
break;
|
|
11555
|
-
case
|
|
11606
|
+
case E.Module:
|
|
11556
11607
|
this.stepSpecificServices[l.stepName] = {
|
|
11557
11608
|
module: await Ai(l.data.module)
|
|
11558
11609
|
}, a.push(
|
|
11559
11610
|
li.init(l, this, this.reloadedState)
|
|
11560
11611
|
);
|
|
11561
11612
|
break;
|
|
11562
|
-
case
|
|
11613
|
+
case E.Picture:
|
|
11563
11614
|
a.push(
|
|
11564
11615
|
ci.init(l, this, this.reloadedState)
|
|
11565
11616
|
);
|
|
11566
11617
|
break;
|
|
11567
|
-
case
|
|
11618
|
+
case E.Question:
|
|
11568
11619
|
a.push(
|
|
11569
11620
|
di.init(l, this, this.reloadedState)
|
|
11570
11621
|
);
|
|
11571
11622
|
break;
|
|
11572
|
-
case
|
|
11623
|
+
case E.Shape:
|
|
11573
11624
|
a.push(Wt.init(l, this, this.reloadedState));
|
|
11574
11625
|
break;
|
|
11575
|
-
case
|
|
11626
|
+
case E.Text:
|
|
11576
11627
|
a.push(j.init(l, this, this.reloadedState));
|
|
11577
11628
|
break;
|
|
11578
11629
|
}
|
|
@@ -11632,7 +11683,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11632
11683
|
this.validationCallbacks.forEach((t) => t(this.validationErrors));
|
|
11633
11684
|
}
|
|
11634
11685
|
traversableScenes() {
|
|
11635
|
-
return
|
|
11686
|
+
return mo(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
|
|
11636
11687
|
}
|
|
11637
11688
|
};
|
|
11638
11689
|
jt.configurationPromiseMap = /* @__PURE__ */ new Map();
|
|
@@ -12133,7 +12184,7 @@ class dl extends et {
|
|
|
12133
12184
|
const e = {
|
|
12134
12185
|
input: t,
|
|
12135
12186
|
helperData: {}
|
|
12136
|
-
}, a = j.findLayoutElements(this.manager, this.step), i = j.filterUnsupportedCharacters(t, a[0]?.fontData), r =
|
|
12187
|
+
}, a = j.findLayoutElements(this.manager, this.step), i = j.filterUnsupportedCharacters(t, a[0]?.fontData), r = Ft(i, this.manager).length, o = !!this.step.data && !!this.step.data.maxLength && r > this.step.data.maxLength;
|
|
12137
12188
|
o || (e.input = i);
|
|
12138
12189
|
const s = a.length <= 0, l = s ? { inputText: i, text: i } : { inputText: i };
|
|
12139
12190
|
this.manager.updateStorage(this.step.stepName, l);
|
|
@@ -12209,7 +12260,7 @@ class dl extends et {
|
|
|
12209
12260
|
const t = this.step.data.maxLength;
|
|
12210
12261
|
if (t === void 0)
|
|
12211
12262
|
return;
|
|
12212
|
-
const e =
|
|
12263
|
+
const e = Ft(this.getText(), this.manager);
|
|
12213
12264
|
return t - e.length;
|
|
12214
12265
|
}
|
|
12215
12266
|
setCustomColor(t) {
|
|
@@ -12290,7 +12341,7 @@ class hl extends et {
|
|
|
12290
12341
|
const t = this.step.data.maxLength;
|
|
12291
12342
|
if (t === void 0)
|
|
12292
12343
|
return;
|
|
12293
|
-
const e =
|
|
12344
|
+
const e = Ft(this.getText(), this.manager);
|
|
12294
12345
|
return t - e.length;
|
|
12295
12346
|
}
|
|
12296
12347
|
/**
|
|
@@ -12322,30 +12373,30 @@ class hl extends et {
|
|
|
12322
12373
|
});
|
|
12323
12374
|
}
|
|
12324
12375
|
}
|
|
12325
|
-
class
|
|
12376
|
+
class ge {
|
|
12326
12377
|
static get(t, e) {
|
|
12327
12378
|
switch (e.type) {
|
|
12328
|
-
case
|
|
12379
|
+
case E.DigitalContent:
|
|
12329
12380
|
return new ul(t, e, t.getStepTags(e.stepName));
|
|
12330
|
-
case
|
|
12381
|
+
case E.Information:
|
|
12331
12382
|
return new Al(t, e, t.getStepTags(e.stepName));
|
|
12332
|
-
case
|
|
12383
|
+
case E.Question:
|
|
12333
12384
|
return new ll(t, e, t.getStepTags(e.stepName));
|
|
12334
|
-
case
|
|
12385
|
+
case E.Text:
|
|
12335
12386
|
return new dl(t, e, t.getStepTags(e.stepName));
|
|
12336
|
-
case
|
|
12387
|
+
case E.Illustration:
|
|
12337
12388
|
return new il(t, e, t.getStepTags(e.stepName));
|
|
12338
|
-
case
|
|
12389
|
+
case E.Picture:
|
|
12339
12390
|
return new sl(t, e, t.getStepTags(e.stepName));
|
|
12340
|
-
case
|
|
12391
|
+
case E.Shape:
|
|
12341
12392
|
return new cl(t, e, t.getStepTags(e.stepName));
|
|
12342
|
-
case
|
|
12393
|
+
case E.Material:
|
|
12343
12394
|
return new rl(t, e, t.getStepTags(e.stepName));
|
|
12344
|
-
case
|
|
12395
|
+
case E.Model:
|
|
12345
12396
|
return new ol(t, e, t.getStepTags(e.stepName));
|
|
12346
|
-
case
|
|
12397
|
+
case E.Frame:
|
|
12347
12398
|
return new hc(t, e, t.getStepTags(e.stepName));
|
|
12348
|
-
case
|
|
12399
|
+
case E.Module:
|
|
12349
12400
|
return new hl(t, e, t.getStepTags(e.stepName));
|
|
12350
12401
|
default:
|
|
12351
12402
|
throw new R(`Step type ${e.type} not yet supported in Core SDK`);
|
|
@@ -12377,7 +12428,7 @@ const hi = C`
|
|
|
12377
12428
|
externalProductVariantId
|
|
12378
12429
|
}
|
|
12379
12430
|
}
|
|
12380
|
-
`,
|
|
12431
|
+
`, gl = C`
|
|
12381
12432
|
${hi}
|
|
12382
12433
|
mutation CreateDesign(
|
|
12383
12434
|
$name: String!
|
|
@@ -12409,7 +12460,7 @@ const hi = C`
|
|
|
12409
12460
|
}
|
|
12410
12461
|
}
|
|
12411
12462
|
}
|
|
12412
|
-
`,
|
|
12463
|
+
`, ml = C`
|
|
12413
12464
|
${hi}
|
|
12414
12465
|
mutation CreateDesigns($inputs: [DesignCreateInput]!) {
|
|
12415
12466
|
designCreateMany(inputs: $inputs) {
|
|
@@ -12437,7 +12488,7 @@ const pl = async (n, t) => {
|
|
|
12437
12488
|
s && !ee(s) && (e.Authorization = `Bearer ${s}`);
|
|
12438
12489
|
}
|
|
12439
12490
|
return (await y.getShadowGraphqlClient().mutate({
|
|
12440
|
-
mutation:
|
|
12491
|
+
mutation: gl,
|
|
12441
12492
|
errorPolicy: "all",
|
|
12442
12493
|
fetchPolicy: "no-cache",
|
|
12443
12494
|
variables: {
|
|
@@ -12463,7 +12514,7 @@ const pl = async (n, t) => {
|
|
|
12463
12514
|
s && !ee(s) && (e.Authorization = `Bearer ${s}`);
|
|
12464
12515
|
}
|
|
12465
12516
|
return (await y.getShadowGraphqlClient().mutate({
|
|
12466
|
-
mutation:
|
|
12517
|
+
mutation: ml,
|
|
12467
12518
|
errorPolicy: "all",
|
|
12468
12519
|
fetchPolicy: "no-cache",
|
|
12469
12520
|
variables: {
|
|
@@ -12538,7 +12589,7 @@ const pl = async (n, t) => {
|
|
|
12538
12589
|
});
|
|
12539
12590
|
}
|
|
12540
12591
|
return i;
|
|
12541
|
-
},
|
|
12592
|
+
}, gi = (n, t, e, a, i, r, o, s) => {
|
|
12542
12593
|
const l = t.basePrice || 0, c = n.priceModifierTotal || 0, d = Cl(a, e, void 0, r), u = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), h = {
|
|
12543
12594
|
additionalExternalProductId: n.integrationProduct?.additionalExternalProductId,
|
|
12544
12595
|
additionalExternalVariantId: n.integrationProduct?.additionalExternalVariantId,
|
|
@@ -12561,38 +12612,38 @@ const pl = async (n, t) => {
|
|
|
12561
12612
|
workflowViewerReadOnlyLink: n.workflowViewerReadOnlyLink || ""
|
|
12562
12613
|
};
|
|
12563
12614
|
return r && (h.metadata = r), a && (h.selectedVariants = a), i && (h.sku = i), h;
|
|
12564
|
-
},
|
|
12615
|
+
}, mi = async (n, t, e, a, i, r, o, s, l, c) => {
|
|
12565
12616
|
await (async () => {
|
|
12566
12617
|
if (c !== void 0) return c;
|
|
12567
12618
|
await n.outstandingRequestsPromise();
|
|
12568
|
-
const
|
|
12619
|
+
const N = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(i.id), I = await y.getShadowGraphqlClient().query({
|
|
12569
12620
|
query: zn,
|
|
12570
12621
|
variables: { ids: [i.id] },
|
|
12571
12622
|
fetchPolicy: "no-cache",
|
|
12572
12623
|
errorPolicy: "all",
|
|
12573
12624
|
context: {
|
|
12574
|
-
transactionOwnerId:
|
|
12625
|
+
transactionOwnerId: N
|
|
12575
12626
|
}
|
|
12576
|
-
}), Q =
|
|
12577
|
-
return
|
|
12578
|
-
|
|
12627
|
+
}), Q = I.data?.transactions[0].workflowState;
|
|
12628
|
+
return I.errors ? (I.errors.forEach((U) => {
|
|
12629
|
+
I.errors && console.log("Server Error:", U.message);
|
|
12579
12630
|
}), null) : Q ?? null;
|
|
12580
12631
|
})() || (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"));
|
|
12581
|
-
const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation,
|
|
12582
|
-
const
|
|
12583
|
-
let
|
|
12632
|
+
const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, g = u && t.showModelOnFinishStep && !!h, m = l && sn(l, t, !0), p = l && sn(l, t, !1), f = async (F) => {
|
|
12633
|
+
const N = {};
|
|
12634
|
+
let O = 0;
|
|
12584
12635
|
if (Object.keys(r).length > 0)
|
|
12585
|
-
for (const
|
|
12586
|
-
const Q = r[
|
|
12587
|
-
for (let
|
|
12588
|
-
const q = Q.selections[
|
|
12589
|
-
if (U && (!
|
|
12636
|
+
for (const I of Object.keys(r)) {
|
|
12637
|
+
const Q = r[I], U = t.steps.find((M) => M.stepName === I);
|
|
12638
|
+
for (let M = 0; M < Q.selections.length; ++M) {
|
|
12639
|
+
const q = Q.selections[M];
|
|
12640
|
+
if (U && (!F || U.option && (U.option.variants || []).length > 1 && !U.data.hideSelectionInCart && !U.data.hideSelectionsInCart)) {
|
|
12590
12641
|
const St = U.stepTitle;
|
|
12591
|
-
|
|
12642
|
+
N[St] ? N[St].push({
|
|
12592
12643
|
id: q.id || "",
|
|
12593
12644
|
name: q.name,
|
|
12594
12645
|
priceModifier: q.priceModifier
|
|
12595
|
-
}) :
|
|
12646
|
+
}) : N[St] = [
|
|
12596
12647
|
{
|
|
12597
12648
|
id: q.id || "",
|
|
12598
12649
|
name: q.name,
|
|
@@ -12600,23 +12651,23 @@ const pl = async (n, t) => {
|
|
|
12600
12651
|
}
|
|
12601
12652
|
];
|
|
12602
12653
|
}
|
|
12603
|
-
|
|
12654
|
+
O += q.priceModifier;
|
|
12604
12655
|
}
|
|
12605
12656
|
}
|
|
12606
|
-
return [
|
|
12657
|
+
return [N, O];
|
|
12607
12658
|
}, [S] = await f(!0), w = Object.fromEntries(
|
|
12608
|
-
Object.keys(S).map((
|
|
12609
|
-
), [
|
|
12610
|
-
Object.keys(
|
|
12611
|
-
|
|
12612
|
-
|
|
12659
|
+
Object.keys(S).map((F) => [F, S[F].map((N) => N.id)])
|
|
12660
|
+
), [x] = await f(!1), v = Object.fromEntries(
|
|
12661
|
+
Object.keys(x).map((F) => [
|
|
12662
|
+
F,
|
|
12663
|
+
x[F].map((N) => N.id)
|
|
12613
12664
|
])
|
|
12614
12665
|
);
|
|
12615
|
-
let
|
|
12616
|
-
if (
|
|
12617
|
-
const
|
|
12618
|
-
|
|
12619
|
-
{ name: `${i.id}-preview-image.png`, blob:
|
|
12666
|
+
let b = await s(g, i.id);
|
|
12667
|
+
if (b) {
|
|
12668
|
+
const F = await (await it(b)).blob();
|
|
12669
|
+
b = (await V.uploadAsset(
|
|
12670
|
+
{ name: `${i.id}-preview-image.png`, blob: F },
|
|
12620
12671
|
Ie.Image,
|
|
12621
12672
|
!0,
|
|
12622
12673
|
!1
|
|
@@ -12624,37 +12675,37 @@ const pl = async (n, t) => {
|
|
|
12624
12675
|
}
|
|
12625
12676
|
return {
|
|
12626
12677
|
designDetails: (() => {
|
|
12627
|
-
const
|
|
12678
|
+
const F = {
|
|
12628
12679
|
name: o,
|
|
12629
|
-
layouts: e.map((
|
|
12630
|
-
index:
|
|
12631
|
-
panelId:
|
|
12680
|
+
layouts: e.map((N) => ({
|
|
12681
|
+
index: N.index,
|
|
12682
|
+
panelId: N.panelId
|
|
12632
12683
|
})),
|
|
12633
12684
|
workflowId: t.id,
|
|
12634
12685
|
transactionId: i.id,
|
|
12635
|
-
useThreeDimPreview: !!
|
|
12636
|
-
previewImage:
|
|
12686
|
+
useThreeDimPreview: !!g,
|
|
12687
|
+
previewImage: b
|
|
12637
12688
|
};
|
|
12638
|
-
if (
|
|
12639
|
-
const
|
|
12640
|
-
for (const [
|
|
12641
|
-
|
|
12642
|
-
|
|
12689
|
+
if (p) {
|
|
12690
|
+
const N = [];
|
|
12691
|
+
for (const [O, I] of Object.entries(p))
|
|
12692
|
+
N.push({ key: O, value: I });
|
|
12693
|
+
F.metadata = N;
|
|
12643
12694
|
}
|
|
12644
12695
|
if (w) {
|
|
12645
|
-
const
|
|
12646
|
-
for (const [
|
|
12647
|
-
|
|
12648
|
-
|
|
12696
|
+
const N = [];
|
|
12697
|
+
for (const [O, I] of Object.entries(v))
|
|
12698
|
+
N.push({ key: O, ids: I });
|
|
12699
|
+
F.selectedVariants = N;
|
|
12649
12700
|
}
|
|
12650
|
-
return
|
|
12701
|
+
return F;
|
|
12651
12702
|
})(),
|
|
12652
12703
|
cartSelectionsWithPrices: S,
|
|
12653
|
-
cartMetadata:
|
|
12704
|
+
cartMetadata: m
|
|
12654
12705
|
};
|
|
12655
12706
|
}, wl = async (n, t, e, a, i, r, o, s, l, c, d) => {
|
|
12656
12707
|
l("workflow.steps.finish.finalize.buildingLayouts");
|
|
12657
|
-
const { designDetails: A, cartSelectionsWithPrices: u, cartMetadata: h } = await
|
|
12708
|
+
const { designDetails: A, cartSelectionsWithPrices: u, cartMetadata: h } = await mi(
|
|
12658
12709
|
n,
|
|
12659
12710
|
t,
|
|
12660
12711
|
e,
|
|
@@ -12666,20 +12717,20 @@ const pl = async (n, t) => {
|
|
|
12666
12717
|
d
|
|
12667
12718
|
);
|
|
12668
12719
|
l("workflow.steps.finish.finalize.creatingDesign");
|
|
12669
|
-
const
|
|
12670
|
-
if (!
|
|
12720
|
+
const g = await pl(A), m = g?.transaction?.previewImageLink;
|
|
12721
|
+
if (!g?.transaction)
|
|
12671
12722
|
throw new Error("Failed to create design");
|
|
12672
12723
|
l("workflow.steps.finish.finalize.updatingTransaction");
|
|
12673
|
-
const
|
|
12674
|
-
return
|
|
12675
|
-
|
|
12724
|
+
const p = g.transaction;
|
|
12725
|
+
return gi(
|
|
12726
|
+
p,
|
|
12676
12727
|
i,
|
|
12677
12728
|
t,
|
|
12678
12729
|
u,
|
|
12679
|
-
|
|
12730
|
+
g?.sku,
|
|
12680
12731
|
h,
|
|
12681
|
-
|
|
12682
|
-
|
|
12732
|
+
m,
|
|
12733
|
+
g?.processExecution?.id
|
|
12683
12734
|
);
|
|
12684
12735
|
}, yl = async (n, t, e) => {
|
|
12685
12736
|
t("workflow.steps.finish.finalize.buildingLayouts"), await Promise.all(
|
|
@@ -12698,7 +12749,7 @@ const pl = async (n, t) => {
|
|
|
12698
12749
|
l.errors && console.log("Server Error:", c.message);
|
|
12699
12750
|
}), null) : l.data?.transactions ? l.data.transactions.map((c) => c.workflowState ?? null) : null;
|
|
12700
12751
|
})(), r = await Promise.all(
|
|
12701
|
-
n.map(async (s, l) => await
|
|
12752
|
+
n.map(async (s, l) => await mi(
|
|
12702
12753
|
s.workflowManager,
|
|
12703
12754
|
s.workflow,
|
|
12704
12755
|
s.layouts,
|
|
@@ -12717,7 +12768,7 @@ const pl = async (n, t) => {
|
|
|
12717
12768
|
throw new Error("Failed to create designs");
|
|
12718
12769
|
return t("workflow.steps.finish.finalize.updatingTransaction"), o.map((s, l) => {
|
|
12719
12770
|
const c = n[l], d = r[l], A = s.transaction;
|
|
12720
|
-
return
|
|
12771
|
+
return gi(
|
|
12721
12772
|
A,
|
|
12722
12773
|
c.product,
|
|
12723
12774
|
c.workflow,
|
|
@@ -13112,14 +13163,14 @@ class Il {
|
|
|
13112
13163
|
}, u = this.workflowManager.getCommandContext().getLayoutById(d.layoutState.layout.id), h = o.getContext("2d");
|
|
13113
13164
|
if (!h)
|
|
13114
13165
|
throw new Re("Failed to obtain 2D context for preview image creation");
|
|
13115
|
-
const
|
|
13166
|
+
const g = this.workflowManager.getTemplatingContext(), m = ka(u.layoutState.layout, u.layoutState.elements, {
|
|
13116
13167
|
renderingConfiguration: {
|
|
13117
13168
|
purpose: Kt.Print,
|
|
13118
13169
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
|
13119
|
-
templatingContext:
|
|
13170
|
+
templatingContext: g
|
|
13120
13171
|
}
|
|
13121
|
-
}),
|
|
13122
|
-
await (await va.from(h,
|
|
13172
|
+
}), p = xn(m);
|
|
13173
|
+
await (await va.from(h, p, {
|
|
13123
13174
|
anonymousCrossOrigin: !0,
|
|
13124
13175
|
ignoreDimensions: !1,
|
|
13125
13176
|
createCanvas: Ct,
|
|
@@ -13136,7 +13187,7 @@ class Il {
|
|
|
13136
13187
|
const a = this.cachedStepHandles.get(e.stepName);
|
|
13137
13188
|
if (a)
|
|
13138
13189
|
return a;
|
|
13139
|
-
const i =
|
|
13190
|
+
const i = ge.get(this.getWorkflowManager(), e);
|
|
13140
13191
|
return this.cachedStepHandles.set(e.stepName, i), i;
|
|
13141
13192
|
}
|
|
13142
13193
|
getSteps() {
|
|
@@ -13216,15 +13267,15 @@ class Il {
|
|
|
13216
13267
|
const d = /* @__PURE__ */ new Set(), A = c.getRaw().globalPropertyAspectConfigurations;
|
|
13217
13268
|
A !== void 0 && (A.forEach((u) => d.add(JSON.stringify(u))), s.forEach((u) => {
|
|
13218
13269
|
const h = u.getRaw().globalPropertyAspectConfigurations;
|
|
13219
|
-
h !== void 0 && h.forEach((
|
|
13220
|
-
const
|
|
13221
|
-
if (
|
|
13270
|
+
h !== void 0 && h.forEach((g) => {
|
|
13271
|
+
const m = l(g), p = d.has(JSON.stringify(g));
|
|
13272
|
+
if (p && m?.getType() === "Option") {
|
|
13222
13273
|
const f = u.getCurrentVariant();
|
|
13223
13274
|
if (!f) return;
|
|
13224
|
-
c.selectVariant(f), d.delete(JSON.stringify(
|
|
13225
|
-
} else if (
|
|
13275
|
+
c.selectVariant(f), d.delete(JSON.stringify(g));
|
|
13276
|
+
} else if (p && m?.getType() === "Text") {
|
|
13226
13277
|
const f = u.getText();
|
|
13227
|
-
c.setText(f), d.delete(JSON.stringify(
|
|
13278
|
+
c.setText(f), d.delete(JSON.stringify(g));
|
|
13228
13279
|
}
|
|
13229
13280
|
});
|
|
13230
13281
|
}));
|
|
@@ -13233,17 +13284,17 @@ class Il {
|
|
|
13233
13284
|
getStepByName(t) {
|
|
13234
13285
|
const e = this.getWorkflow()?.steps.find((a) => a.stepTitle === t);
|
|
13235
13286
|
if (!(!e || !this.stepHasHandle(e)))
|
|
13236
|
-
return
|
|
13287
|
+
return ge.get(this.getWorkflowManager(), e);
|
|
13237
13288
|
}
|
|
13238
13289
|
getStepsByType(t) {
|
|
13239
|
-
return this.getWorkflow()?.steps.filter((e) => e.type === t).map((e) =>
|
|
13290
|
+
return this.getWorkflow()?.steps.filter((e) => e.type === t).map((e) => ge.get(this.getWorkflowManager(), e)) || [];
|
|
13240
13291
|
}
|
|
13241
13292
|
getStepsByScene(t) {
|
|
13242
13293
|
if (!this.getWorkflow()?.stepGroups.find((a) => a.name === t.name))
|
|
13243
13294
|
throw new Error(
|
|
13244
13295
|
"Given scene is not present on workflow! Be careful when persisting scenes that you only use them with the relevant workflow."
|
|
13245
13296
|
);
|
|
13246
|
-
return t.stepIds.map((a) => this.getWorkflow()?.steps.find((i) => i.stepName === a)).filter((a) => this.stepHasHandle(a)).map((a) =>
|
|
13297
|
+
return t.stepIds.map((a) => this.getWorkflow()?.steps.find((i) => i.stepName === a)).filter((a) => this.stepHasHandle(a)).map((a) => ge.get(this.getWorkflowManager(), a));
|
|
13247
13298
|
}
|
|
13248
13299
|
async attachCustomerDetails(t) {
|
|
13249
13300
|
return this.assignCustomerDetails({ emailAddress: t.email });
|
|
@@ -13346,7 +13397,7 @@ class Il {
|
|
|
13346
13397
|
* @returns Returns true when a valid handle is implemented for a given step type. Certain steps don't support handles, such as silent illustrations.
|
|
13347
13398
|
*/
|
|
13348
13399
|
stepHasHandle(t) {
|
|
13349
|
-
return t.type !==
|
|
13400
|
+
return t.type !== E.SilentIllustration && t.type !== E.ProductOverlay;
|
|
13350
13401
|
}
|
|
13351
13402
|
getExportedStepData() {
|
|
13352
13403
|
const t = this.getWorkflow(), e = this.getWorkflowManager().getWorkflowMetadata(), a = this.getWorkflowManager().getWorkflowSelections(), i = [];
|
|
@@ -13365,7 +13416,7 @@ class Il {
|
|
|
13365
13416
|
return;
|
|
13366
13417
|
}
|
|
13367
13418
|
switch (r.type) {
|
|
13368
|
-
case
|
|
13419
|
+
case E.Frame:
|
|
13369
13420
|
{
|
|
13370
13421
|
const d = r.data, A = s;
|
|
13371
13422
|
A.image && d.displayImageOnFinishStep && c.properties.push({
|
|
@@ -13375,7 +13426,7 @@ class Il {
|
|
|
13375
13426
|
});
|
|
13376
13427
|
}
|
|
13377
13428
|
break;
|
|
13378
|
-
case
|
|
13429
|
+
case E.Illustration:
|
|
13379
13430
|
{
|
|
13380
13431
|
const d = r.data, A = s;
|
|
13381
13432
|
if (A && A.colors && A.colors.length > 0 && d.displayColorsOnFinishStep) {
|
|
@@ -13388,7 +13439,7 @@ class Il {
|
|
|
13388
13439
|
}
|
|
13389
13440
|
}
|
|
13390
13441
|
break;
|
|
13391
|
-
case
|
|
13442
|
+
case E.Module:
|
|
13392
13443
|
{
|
|
13393
13444
|
const d = r.data, A = s;
|
|
13394
13445
|
A && A.text && d.displayTextOnFinishStep && c.properties.push({
|
|
@@ -13398,7 +13449,7 @@ class Il {
|
|
|
13398
13449
|
});
|
|
13399
13450
|
}
|
|
13400
13451
|
break;
|
|
13401
|
-
case
|
|
13452
|
+
case E.Text: {
|
|
13402
13453
|
const d = r.data, A = s;
|
|
13403
13454
|
A && A.text && d.displayTextOnFinishStep && c.properties.push({
|
|
13404
13455
|
type: "text",
|
|
@@ -13452,14 +13503,14 @@ class Il {
|
|
|
13452
13503
|
}
|
|
13453
13504
|
const Bl = (n) => {
|
|
13454
13505
|
if ([
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13460
|
-
|
|
13461
|
-
|
|
13462
|
-
|
|
13506
|
+
E.Question,
|
|
13507
|
+
E.Frame,
|
|
13508
|
+
E.Illustration,
|
|
13509
|
+
E.Material,
|
|
13510
|
+
E.Model,
|
|
13511
|
+
E.Picture,
|
|
13512
|
+
E.Shape,
|
|
13513
|
+
E.Text
|
|
13463
13514
|
].includes(n.type)) {
|
|
13464
13515
|
const e = n.data;
|
|
13465
13516
|
return !!e.displaySelectionOnFinishStep || !!e.displaySelectionsOnFinishStep;
|
|
@@ -13473,7 +13524,7 @@ const Bl = (n) => {
|
|
|
13473
13524
|
}
|
|
13474
13525
|
return !1;
|
|
13475
13526
|
};
|
|
13476
|
-
class
|
|
13527
|
+
class xl {
|
|
13477
13528
|
constructor(t) {
|
|
13478
13529
|
this.handleCache = {}, this.bundle = t;
|
|
13479
13530
|
}
|
|
@@ -13515,7 +13566,7 @@ class Dl {
|
|
|
13515
13566
|
async createHandle(t) {
|
|
13516
13567
|
switch (t.type) {
|
|
13517
13568
|
case G.FileUpload:
|
|
13518
|
-
return new
|
|
13569
|
+
return new Dl(this.bundle, t).initialize();
|
|
13519
13570
|
case G.ColorOption:
|
|
13520
13571
|
return new cn(
|
|
13521
13572
|
this.bundle,
|
|
@@ -13527,7 +13578,7 @@ class Dl {
|
|
|
13527
13578
|
return e?.type === "Color" ? new cn(this.bundle, t, e) : new pi(this.bundle, t, e);
|
|
13528
13579
|
}
|
|
13529
13580
|
case G.Text:
|
|
13530
|
-
return new
|
|
13581
|
+
return new Fl(this.bundle, t);
|
|
13531
13582
|
default:
|
|
13532
13583
|
throw new Error("Unhandled Global Property Aspect Type");
|
|
13533
13584
|
}
|
|
@@ -13594,7 +13645,7 @@ class Ra {
|
|
|
13594
13645
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
|
13595
13646
|
}
|
|
13596
13647
|
}
|
|
13597
|
-
class
|
|
13648
|
+
class Dl extends Ra {
|
|
13598
13649
|
constructor(t, e) {
|
|
13599
13650
|
super(t, e);
|
|
13600
13651
|
}
|
|
@@ -13620,7 +13671,7 @@ class Fl extends Ra {
|
|
|
13620
13671
|
svg: o.svg,
|
|
13621
13672
|
colors: o.colors
|
|
13622
13673
|
};
|
|
13623
|
-
|
|
13674
|
+
gt.set(t?.fileLink, l), this.imageData = l;
|
|
13624
13675
|
} else
|
|
13625
13676
|
this.imageData = void 0;
|
|
13626
13677
|
}
|
|
@@ -13686,7 +13737,7 @@ class Fl extends Ra {
|
|
|
13686
13737
|
return V.getLocalOrFromServer(t);
|
|
13687
13738
|
}
|
|
13688
13739
|
async getImageWithColors() {
|
|
13689
|
-
return await this.loadImageData(), this.imageData?.svg ? ba(
|
|
13740
|
+
return await this.loadImageData(), this.imageData?.svg ? ba(Da(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
|
13690
13741
|
}
|
|
13691
13742
|
/**
|
|
13692
13743
|
* Retrieves the original, unmodified image selection, if one exists.
|
|
@@ -13820,7 +13871,7 @@ class Fl extends Ra {
|
|
|
13820
13871
|
);
|
|
13821
13872
|
}
|
|
13822
13873
|
}
|
|
13823
|
-
class
|
|
13874
|
+
class Fl extends Ra {
|
|
13824
13875
|
constructor(t, e) {
|
|
13825
13876
|
super(t, e);
|
|
13826
13877
|
}
|
|
@@ -13944,15 +13995,15 @@ class cn extends pi {
|
|
|
13944
13995
|
async applyColorVariant(t, e, a) {
|
|
13945
13996
|
const r = this.getSharedSteps(e).map((o) => {
|
|
13946
13997
|
switch (o.getType()) {
|
|
13947
|
-
case
|
|
13998
|
+
case E.Shape:
|
|
13948
13999
|
return o.selectVariant(t);
|
|
13949
|
-
case
|
|
14000
|
+
case E.Text:
|
|
13950
14001
|
return o.setFillColor({
|
|
13951
14002
|
fill: t.getColor(),
|
|
13952
14003
|
stroke: t.getColor(),
|
|
13953
14004
|
variant: t.getResource()
|
|
13954
14005
|
});
|
|
13955
|
-
case
|
|
14006
|
+
case E.Illustration:
|
|
13956
14007
|
return o.setColor(a?.toString() || "", t.getColor() || "");
|
|
13957
14008
|
}
|
|
13958
14009
|
});
|
|
@@ -13976,7 +14027,7 @@ const kl = (n, t, e, a) => n.flatMap((i) => i.getSteps()).filter((i) => i.getGlo
|
|
|
13976
14027
|
n,
|
|
13977
14028
|
t,
|
|
13978
14029
|
e,
|
|
13979
|
-
|
|
14030
|
+
E.Illustration
|
|
13980
14031
|
).map((r) => {
|
|
13981
14032
|
const o = r.getCurrentVariant()?.getAssetResource(), s = r.getColors();
|
|
13982
14033
|
return !o?.assetConfiguration || !s ? 0 : Object.getOwnPropertyNames(s).length;
|
|
@@ -14008,7 +14059,7 @@ function fi(n) {
|
|
|
14008
14059
|
e.value !== "" && t.set(e.name, !0);
|
|
14009
14060
|
}), t;
|
|
14010
14061
|
}
|
|
14011
|
-
function
|
|
14062
|
+
function me(n) {
|
|
14012
14063
|
return ya(n, ["__typename"]);
|
|
14013
14064
|
}
|
|
14014
14065
|
class Ql {
|
|
@@ -14016,9 +14067,9 @@ class Ql {
|
|
|
14016
14067
|
this.mandatoryFulfilledAspects = /* @__PURE__ */ new Map(), this.bundleId = t, this.bundleOwnerId = e, this.configuration = a, this.bundleOptions = r;
|
|
14017
14068
|
const o = r?.existingGlobalPropertyState;
|
|
14018
14069
|
this.initPromise = o ? Promise.resolve(o).then(() => {
|
|
14019
|
-
console.log("Setting global property state to existing state."), this.globalPropertyState =
|
|
14070
|
+
console.log("Setting global property state to existing state."), this.globalPropertyState = me(o), this.recalculateMandatoryStates();
|
|
14020
14071
|
}) : this.createGlobalPropertyState().then((s) => {
|
|
14021
|
-
console.log("Setting global property state to new state."), this.globalPropertyState =
|
|
14072
|
+
console.log("Setting global property state to new state."), this.globalPropertyState = me(s), this.recalculateMandatoryStates();
|
|
14022
14073
|
}), this.onGlobalPropertyStateChange = i;
|
|
14023
14074
|
}
|
|
14024
14075
|
async clearAspects(t) {
|
|
@@ -14048,7 +14099,7 @@ class Ql {
|
|
|
14048
14099
|
async setGlobalPropertyState(t) {
|
|
14049
14100
|
this.globalPropertyState || await this.initPromise;
|
|
14050
14101
|
const e = It(this.globalPropertyState);
|
|
14051
|
-
this.globalPropertyState = { ...
|
|
14102
|
+
this.globalPropertyState = { ...me(t), id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
|
|
14052
14103
|
}
|
|
14053
14104
|
getAspectMandatoryFulfilled(t) {
|
|
14054
14105
|
return this.mandatoryFulfilledAspects.get(t);
|
|
@@ -14177,7 +14228,7 @@ class Ql {
|
|
|
14177
14228
|
}
|
|
14178
14229
|
});
|
|
14179
14230
|
if (t.data?.globalPropertyStateUpdate)
|
|
14180
|
-
this.globalPropertyState =
|
|
14231
|
+
this.globalPropertyState = me(t.data.globalPropertyStateUpdate);
|
|
14181
14232
|
else
|
|
14182
14233
|
throw new Error("Unable to update global property state");
|
|
14183
14234
|
}
|
|
@@ -14425,7 +14476,7 @@ class Ci {
|
|
|
14425
14476
|
if (this.fullFetched)
|
|
14426
14477
|
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new pe(a));
|
|
14427
14478
|
const e = await y.getShadowGraphqlClient().query({
|
|
14428
|
-
query:
|
|
14479
|
+
query: Fs,
|
|
14429
14480
|
variables: {
|
|
14430
14481
|
id: this.getId(),
|
|
14431
14482
|
productIds: t
|
|
@@ -14517,20 +14568,20 @@ class Ci {
|
|
|
14517
14568
|
});
|
|
14518
14569
|
return new Promise((u) => {
|
|
14519
14570
|
let h = !1;
|
|
14520
|
-
const
|
|
14521
|
-
next(
|
|
14522
|
-
if (h ||
|
|
14571
|
+
const g = A.subscribe({
|
|
14572
|
+
next(m) {
|
|
14573
|
+
if (h || m.partial && (!m.data.productCollections || m.data.productCollections.length === 0 || !m.data.productCollections[0].productCollectionProductsFeed?.items || m.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
|
|
14523
14574
|
return;
|
|
14524
|
-
c.abort(), h = !0,
|
|
14525
|
-
const
|
|
14575
|
+
c.abort(), h = !0, g.unsubscribe();
|
|
14576
|
+
const p = m.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new pe(It(f))) || [];
|
|
14526
14577
|
u({
|
|
14527
|
-
items:
|
|
14578
|
+
items: p,
|
|
14528
14579
|
// Clone items because it could be cached data (immutable)
|
|
14529
|
-
total:
|
|
14580
|
+
total: m.data.productCollections?.[0].productCollectionProductsFeed?.total ?? 0
|
|
14530
14581
|
});
|
|
14531
14582
|
},
|
|
14532
14583
|
error() {
|
|
14533
|
-
h || (h = !0,
|
|
14584
|
+
h || (h = !0, g.unsubscribe(), u({ items: [], total: 0 }));
|
|
14534
14585
|
}
|
|
14535
14586
|
});
|
|
14536
14587
|
});
|
|
@@ -14594,11 +14645,11 @@ class pe {
|
|
|
14594
14645
|
getDefaultWorkflow() {
|
|
14595
14646
|
const t = this.product.workflows;
|
|
14596
14647
|
if (t === void 0)
|
|
14597
|
-
throw new
|
|
14648
|
+
throw new mt(
|
|
14598
14649
|
"Called getDefaultWorkflow() before fetching collection products. Use collection.fetchProducts() first to ensure the data is available."
|
|
14599
14650
|
);
|
|
14600
14651
|
if (t.length === 0)
|
|
14601
|
-
throw new
|
|
14652
|
+
throw new mt(
|
|
14602
14653
|
"Called getDefaultWorkflow() but no workflows on requested product. Ensure at least 1 workflow is assigned to this product."
|
|
14603
14654
|
);
|
|
14604
14655
|
const e = this.productResource.workflowId;
|
|
@@ -14608,7 +14659,7 @@ class pe {
|
|
|
14608
14659
|
}
|
|
14609
14660
|
if (t.length === 1)
|
|
14610
14661
|
return new Ht(t[0]);
|
|
14611
|
-
throw new
|
|
14662
|
+
throw new mt(
|
|
14612
14663
|
"Called getDefaultWorkflow() but no default workflow is configured for the requested product. Multiple workflows exist so we can't assume!"
|
|
14613
14664
|
);
|
|
14614
14665
|
}
|
|
@@ -14617,7 +14668,7 @@ class pe {
|
|
|
14617
14668
|
*/
|
|
14618
14669
|
getAllWorkflows() {
|
|
14619
14670
|
if ((this.product.workflows || []).length === 0)
|
|
14620
|
-
throw new
|
|
14671
|
+
throw new mt(
|
|
14621
14672
|
"No workflows on configured product. Ensure at least 1 workflow is assigned to this product."
|
|
14622
14673
|
);
|
|
14623
14674
|
return this.product.workflows.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new Ht(e));
|
|
@@ -14825,7 +14876,7 @@ class dn {
|
|
|
14825
14876
|
l,
|
|
14826
14877
|
this.onGlobalPropertiesChanged.bind(this),
|
|
14827
14878
|
o
|
|
14828
|
-
), this.globalPropertyHandleService = new
|
|
14879
|
+
), this.globalPropertyHandleService = new xl(this), this.setPreviewService(a);
|
|
14829
14880
|
const c = new Promise((d, A) => {
|
|
14830
14881
|
if (o?.readonly) {
|
|
14831
14882
|
d([]);
|
|
@@ -14834,14 +14885,14 @@ class dn {
|
|
|
14834
14885
|
console.log("Setting default global variants.");
|
|
14835
14886
|
const u = this.globalPropertyStateManager.getGlobalPropertyState();
|
|
14836
14887
|
u ? this.globalPropertyHandleService.getHandles().then((h) => {
|
|
14837
|
-
const
|
|
14838
|
-
if (
|
|
14839
|
-
const
|
|
14840
|
-
if (!u.aspects.find((S) => S.name ===
|
|
14841
|
-
return
|
|
14888
|
+
const g = h.map((m) => {
|
|
14889
|
+
if (m.getType() === G.ColorOption || m.getType() === G.Option) {
|
|
14890
|
+
const p = m;
|
|
14891
|
+
if (!u.aspects.find((S) => S.name === p.getName()))
|
|
14892
|
+
return p.initDefaultVariant();
|
|
14842
14893
|
}
|
|
14843
14894
|
});
|
|
14844
|
-
Promise.all(
|
|
14895
|
+
Promise.all(g).then(d).catch(A);
|
|
14845
14896
|
}) : (console.log("Attempted to set global default variant before state was initialized."), d([]));
|
|
14846
14897
|
});
|
|
14847
14898
|
this.initializationPromise = Promise.all([
|
|
@@ -15029,7 +15080,7 @@ class dn {
|
|
|
15029
15080
|
if (r)
|
|
15030
15081
|
switch (a.type) {
|
|
15031
15082
|
case G.FileUpload: {
|
|
15032
|
-
const o = r, s = await
|
|
15083
|
+
const o = r, s = await De([a.value]);
|
|
15033
15084
|
s.length > 0 && await o.selectImage(s[0]);
|
|
15034
15085
|
const l = a.storage?.colors;
|
|
15035
15086
|
if (l) {
|
|
@@ -15076,7 +15127,7 @@ class dn {
|
|
|
15076
15127
|
return this.productCollection ? new Ci(this.productCollection) : void 0;
|
|
15077
15128
|
}
|
|
15078
15129
|
async initializeAdditionalRequiredColorChannels(t) {
|
|
15079
|
-
for (const e of t.getStepsByType(
|
|
15130
|
+
for (const e of t.getStepsByType(E.Illustration)) {
|
|
15080
15131
|
const a = e.getGlobalPropertyAspects(this.globalConfigurationPropertyId || "");
|
|
15081
15132
|
for (const i of a) {
|
|
15082
15133
|
const r = this.getGlobalPropertyConfiguration()?.aspects.find(
|
|
@@ -15090,8 +15141,8 @@ class dn {
|
|
|
15090
15141
|
), d = [...new Set(s.map((u) => u.number))];
|
|
15091
15142
|
if (d.length > c)
|
|
15092
15143
|
for (const u of d) {
|
|
15093
|
-
const h = this.getGlobalPropertyStateManager(),
|
|
15094
|
-
|
|
15144
|
+
const h = this.getGlobalPropertyStateManager(), g = l.find((m) => m.channelNumber === u);
|
|
15145
|
+
g && await h.setAspect(i, g.variant.id || "", void 0, g.channelNumber);
|
|
15095
15146
|
}
|
|
15096
15147
|
}
|
|
15097
15148
|
}
|
|
@@ -15531,7 +15582,7 @@ class dn {
|
|
|
15531
15582
|
const l = r.map((A) => {
|
|
15532
15583
|
if (A.getType() === G.ColorOption || A.getType() === G.Option) {
|
|
15533
15584
|
const u = A;
|
|
15534
|
-
if (!e.aspects.find((
|
|
15585
|
+
if (!e.aspects.find((g) => g.name === u.getName()))
|
|
15535
15586
|
return u.initDefaultVariant();
|
|
15536
15587
|
}
|
|
15537
15588
|
});
|
|
@@ -16146,9 +16197,9 @@ class $d {
|
|
|
16146
16197
|
mutation: zr
|
|
16147
16198
|
});
|
|
16148
16199
|
} catch (a) {
|
|
16149
|
-
throw console.error(a), new
|
|
16200
|
+
throw console.error(a), new mt("Critical - Unable to synchronize workflow state with server.");
|
|
16150
16201
|
}
|
|
16151
|
-
}, this.options = t, this.options.applicationKey && rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.13.
|
|
16202
|
+
}, this.options = t, this.options.applicationKey && rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.13.3"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16152
16203
|
}
|
|
16153
16204
|
configure(t) {
|
|
16154
16205
|
ft.setHubUrl(t.hubUrl), ft.setServerUrl(t.serverUrl), ft.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 && sr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && zt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16246,7 +16297,7 @@ class $d {
|
|
|
16246
16297
|
const s = k.getMap("transactionCustomerIds");
|
|
16247
16298
|
if (s?.has(t) && s.get(t) && await this.reloadLoggedInCustomer()) {
|
|
16248
16299
|
const u = this.customer?.bundleStakeholders?.find(
|
|
16249
|
-
(h) => h.bundle?.transactions?.some((
|
|
16300
|
+
(h) => h.bundle?.transactions?.some((g) => g.id === t)
|
|
16250
16301
|
) || this.customer?.stakeholders?.find(
|
|
16251
16302
|
(h) => h.transaction?.id === t
|
|
16252
16303
|
);
|
|
@@ -16464,10 +16515,10 @@ class $d {
|
|
|
16464
16515
|
async getExistingBundle(t, e, a, i, r) {
|
|
16465
16516
|
const s = k.getMap("bundleOwnerIds")?.get(t), l = {};
|
|
16466
16517
|
try {
|
|
16467
|
-
const
|
|
16468
|
-
l.Authorization = `Bearer ${
|
|
16518
|
+
const g = await this.loggedInBearerToken();
|
|
16519
|
+
l.Authorization = `Bearer ${g}`;
|
|
16469
16520
|
} catch {
|
|
16470
|
-
const
|
|
16521
|
+
const p = Object.entries(localStorage).find(([S, w]) => S.startsWith("CognitoIdentityServiceProvider") && S.endsWith("idToken"))?.[0] || "", f = localStorage.getItem(p);
|
|
16471
16522
|
f && !ee(f) && (l.Authorization = `Bearer ${f}`);
|
|
16472
16523
|
}
|
|
16473
16524
|
const c = {
|
|
@@ -16475,7 +16526,7 @@ class $d {
|
|
|
16475
16526
|
...l,
|
|
16476
16527
|
...i?.graphql?.additionalHeaders
|
|
16477
16528
|
}, d = await y.getShadowGraphqlClient().query({
|
|
16478
|
-
query:
|
|
16529
|
+
query: xs(i?.graphql?.productCollection?.eagerFetchProducts || !1),
|
|
16479
16530
|
variables: {
|
|
16480
16531
|
id: t
|
|
16481
16532
|
},
|
|
@@ -16571,7 +16622,7 @@ class $d {
|
|
|
16571
16622
|
if (!this.customer)
|
|
16572
16623
|
throw new Error("Customer not authenticated.");
|
|
16573
16624
|
const t = await y.getShadowGraphqlClient().query({
|
|
16574
|
-
query:
|
|
16625
|
+
query: Ds,
|
|
16575
16626
|
variables: {
|
|
16576
16627
|
id: this.customer.id
|
|
16577
16628
|
},
|
|
@@ -16605,47 +16656,47 @@ class $d {
|
|
|
16605
16656
|
*/
|
|
16606
16657
|
async getWorkflowExperiences(t, e, a, i) {
|
|
16607
16658
|
if (t.length === 0)
|
|
16608
|
-
throw new
|
|
16609
|
-
const r = t.map((
|
|
16610
|
-
(
|
|
16659
|
+
throw new mt("No options provided!");
|
|
16660
|
+
const r = t.map((I, Q) => ({ option: I, index: Q })), o = r.filter((I) => I.option.type === "transaction"), s = r.filter(
|
|
16661
|
+
(I) => I.option.type === "integration" || I.option.type === "external" || I.option.type === "blank"
|
|
16611
16662
|
), l = 50, c = La(o, l), d = La(s, l);
|
|
16612
16663
|
let A = 0;
|
|
16613
|
-
const u = y.getShadowGraphqlClient(), h = async (
|
|
16614
|
-
if (
|
|
16664
|
+
const u = y.getShadowGraphqlClient(), h = async (I) => {
|
|
16665
|
+
if (I.length === 0)
|
|
16615
16666
|
return [];
|
|
16616
|
-
const Q =
|
|
16667
|
+
const Q = I.map((q) => q.option.transactionId), U = await u.query({
|
|
16617
16668
|
query: Vr,
|
|
16618
16669
|
variables: {
|
|
16619
16670
|
ids: Q
|
|
16620
16671
|
},
|
|
16621
16672
|
errorPolicy: "all",
|
|
16622
16673
|
fetchPolicy: "no-cache"
|
|
16623
|
-
}),
|
|
16624
|
-
if (A = A +
|
|
16674
|
+
}), M = U.data.transactions;
|
|
16675
|
+
if (A = A + M.length, i && i(A, o.length), M.length !== I.length) {
|
|
16625
16676
|
const q = U.errors?.[0]?.message || "Unknown error";
|
|
16626
|
-
throw new
|
|
16677
|
+
throw new mt(`Not all transactions were found: ${q}`);
|
|
16627
16678
|
}
|
|
16628
|
-
return !this.activeIntegration &&
|
|
16679
|
+
return !this.activeIntegration && M[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(M[0].integrationProduct.integration)), M.map((q, St) => ({
|
|
16629
16680
|
transaction: q,
|
|
16630
16681
|
workflowId: q.workflowId,
|
|
16631
|
-
readOnly:
|
|
16632
|
-
index:
|
|
16682
|
+
readOnly: I.find((ut) => ut.option.transactionId === q.id)?.option.readOnly ?? !1,
|
|
16683
|
+
index: I[St].index
|
|
16633
16684
|
}));
|
|
16634
|
-
},
|
|
16635
|
-
if (
|
|
16685
|
+
}, g = async (I) => {
|
|
16686
|
+
if (I.length === 0)
|
|
16636
16687
|
return [];
|
|
16637
16688
|
const Q = await u.mutate({
|
|
16638
16689
|
mutation: Ur,
|
|
16639
16690
|
variables: {
|
|
16640
|
-
inputs:
|
|
16641
|
-
integrationProductId:
|
|
16642
|
-
externalIntegrationId:
|
|
16643
|
-
externalProductId:
|
|
16644
|
-
workflowId:
|
|
16645
|
-
designName:
|
|
16691
|
+
inputs: I.map((M) => ({
|
|
16692
|
+
integrationProductId: M.option.type === "integration" ? M.option.integrationProductId : void 0,
|
|
16693
|
+
externalIntegrationId: M.option.type === "external" ? M.option.externalIntegrationId : void 0,
|
|
16694
|
+
externalProductId: M.option.type === "external" ? M.option.externalProductId : void 0,
|
|
16695
|
+
workflowId: M.option.workflowId,
|
|
16696
|
+
designName: M.option.designName,
|
|
16646
16697
|
claim: !0,
|
|
16647
|
-
quantity:
|
|
16648
|
-
recipient:
|
|
16698
|
+
quantity: M.option.quantity,
|
|
16699
|
+
recipient: M.option.recipient
|
|
16649
16700
|
})),
|
|
16650
16701
|
marketplaceThemeInstallId: this.marketplaceThemeInstallId,
|
|
16651
16702
|
marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
|
|
@@ -16654,66 +16705,66 @@ class $d {
|
|
|
16654
16705
|
fetchPolicy: "no-cache"
|
|
16655
16706
|
}), U = Q.data?.transactionCreateMany;
|
|
16656
16707
|
if (!U || U.length === 0) {
|
|
16657
|
-
const
|
|
16658
|
-
throw new
|
|
16708
|
+
const M = Q.errors?.[0]?.message || "Unknown error";
|
|
16709
|
+
throw new mt(`Failed to create transactions: ${M}`);
|
|
16659
16710
|
}
|
|
16660
|
-
return A = A + U.length, i && i(A, o.length), U.map((
|
|
16661
|
-
transaction:
|
|
16662
|
-
workflowId:
|
|
16711
|
+
return A = A + U.length, i && i(A, o.length), U.map((M, q) => ({
|
|
16712
|
+
transaction: M,
|
|
16713
|
+
workflowId: M.workflowId,
|
|
16663
16714
|
readOnly: !1,
|
|
16664
|
-
index:
|
|
16715
|
+
index: I[q].index
|
|
16665
16716
|
}));
|
|
16666
|
-
},
|
|
16717
|
+
}, m = (await Promise.all([
|
|
16667
16718
|
...c.map(h),
|
|
16668
|
-
...d.map(
|
|
16669
|
-
])).flat(),
|
|
16670
|
-
...new Set(
|
|
16671
|
-
].filter((
|
|
16672
|
-
(
|
|
16719
|
+
...d.map(g)
|
|
16720
|
+
])).flat(), p = [
|
|
16721
|
+
...new Set(m.map((I) => I.transaction.integrationProductId))
|
|
16722
|
+
].filter((I) => I !== void 0), f = [...new Set(m.map((I) => I.workflowId))].filter(
|
|
16723
|
+
(I) => I !== void 0
|
|
16673
16724
|
), [S, w] = await Promise.all([
|
|
16674
|
-
(async () =>
|
|
16725
|
+
(async () => p.length > 0 ? await lc(p) : [])(),
|
|
16675
16726
|
(async () => f.length > 0 ? await yi(f, e) : [])()
|
|
16676
|
-
]),
|
|
16677
|
-
const { transaction: Q, workflowId: U, readOnly:
|
|
16727
|
+
]), x = new Map(S.map((I) => [I.id, I])), v = new Map(w.map((I) => [I.id, I])), b = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), P = m.map(async (I) => {
|
|
16728
|
+
const { transaction: Q, workflowId: U, readOnly: M, index: q } = I, St = U ? v.get(U) : void 0, ut = t[q];
|
|
16678
16729
|
if (Q.integrationProductId) {
|
|
16679
|
-
const rt =
|
|
16730
|
+
const rt = x.get(Q.integrationProductId);
|
|
16680
16731
|
Q.integrationProduct = rt, Q.product = rt?.product, Q.integrationProduct || console.error("failed to find transaction's product");
|
|
16681
16732
|
}
|
|
16682
|
-
!
|
|
16683
|
-
const He =
|
|
16733
|
+
!b.get(Q.id) && Q.transactionOwnerId && b.set(Q.id, Q.transactionOwnerId);
|
|
16734
|
+
const He = b.get(Q.id) || void 0, bi = new ec({
|
|
16684
16735
|
onMutate: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } }),
|
|
16685
16736
|
onQuery: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } })
|
|
16686
16737
|
}), ce = {
|
|
16687
16738
|
workflow: St,
|
|
16688
16739
|
transaction: Q,
|
|
16689
16740
|
singleVariantsRenderable: ut?.workflowConfiguration?.singleVariantsRenderable,
|
|
16690
|
-
stateMutationFunc:
|
|
16741
|
+
stateMutationFunc: M ? async () => {
|
|
16691
16742
|
throw new R("State mutation is forbidden in read only mode!");
|
|
16692
16743
|
} : async (rt) => this.updateTransactionState({
|
|
16693
16744
|
...rt,
|
|
16694
16745
|
context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId }
|
|
16695
16746
|
}),
|
|
16696
16747
|
graphQlClient: () => bi,
|
|
16697
|
-
readOnly:
|
|
16748
|
+
readOnly: M,
|
|
16698
16749
|
isReloadedTransaction: ut.type === "transaction"
|
|
16699
16750
|
};
|
|
16700
16751
|
if (ut.type === "transaction" && Q.workflowState) {
|
|
16701
16752
|
const rt = JSON.parse(Q.workflowState);
|
|
16702
16753
|
await Za(rt), ce.reloadedState = rt;
|
|
16703
|
-
} else if (!
|
|
16754
|
+
} else if (!M && ut.workflowState) {
|
|
16704
16755
|
const rt = JSON.parse(ut.workflowState);
|
|
16705
16756
|
await Za(rt), ce.reloadedState = rt;
|
|
16706
16757
|
}
|
|
16707
16758
|
return ce.delayWorkflowStateSync = !0, { experienceOptions: ce, index: q, options: ut };
|
|
16708
|
-
}),
|
|
16709
|
-
k.setMap("transactionOwnerIds",
|
|
16710
|
-
const
|
|
16711
|
-
let
|
|
16712
|
-
for (const
|
|
16713
|
-
const { experienceOptions: Q, options: U } =
|
|
16714
|
-
await
|
|
16759
|
+
}), F = await Promise.all(P);
|
|
16760
|
+
k.setMap("transactionOwnerIds", b);
|
|
16761
|
+
const N = F.sort((I, Q) => I.index - Q.index);
|
|
16762
|
+
let O = [];
|
|
16763
|
+
for (const I of N) {
|
|
16764
|
+
const { experienceOptions: Q, options: U } = I, M = new Il(this, Q);
|
|
16765
|
+
await M.getWorkflowManager().getInitializationPromise(), a && a(), U.type !== "transaction" && this.customer && await M.attachCustomerDetails({ email: this.customer.emailAddress }), O = [...O, M], M.getWorkflowManager().setWorkflowStateSyncEnabled(!0);
|
|
16715
16766
|
}
|
|
16716
|
-
return
|
|
16767
|
+
return O;
|
|
16717
16768
|
}
|
|
16718
16769
|
storeCustomer(t) {
|
|
16719
16770
|
const e = k.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map();
|
|
@@ -16943,7 +16994,7 @@ class Ac {
|
|
|
16943
16994
|
getImageSrc() {
|
|
16944
16995
|
if (this.imageData) {
|
|
16945
16996
|
if (this.imageData.svg) {
|
|
16946
|
-
const t =
|
|
16997
|
+
const t = Da(this.imageData.svg, this.imageData.colors || {}, !1);
|
|
16947
16998
|
return ba(t);
|
|
16948
16999
|
}
|
|
16949
17000
|
return this.imageData.src;
|
|
@@ -17046,16 +17097,17 @@ class Ac {
|
|
|
17046
17097
|
* @param onComplete A callback when the operation is completed.
|
|
17047
17098
|
*/
|
|
17048
17099
|
updateFrameOffsets(t, e, a, i, r) {
|
|
17049
|
-
if (!a || a.length === 0 || a.some((
|
|
17100
|
+
if (!a || a.length === 0 || a.some((l) => !l))
|
|
17050
17101
|
throw new R("Frame data not set. This is a bug");
|
|
17051
17102
|
if (!this.workflowManager) throw new R("No workflow manager set, cannot update offsets.");
|
|
17052
|
-
const o = this.workflowManager.getCommandDispatcher();
|
|
17053
|
-
this.targetElements.forEach((
|
|
17054
|
-
o(
|
|
17103
|
+
const o = this.workflowManager.getRegionElements(this.stepName || ""), s = this.workflowManager.getCommandDispatcher();
|
|
17104
|
+
this.targetElements.forEach((l, c) => {
|
|
17105
|
+
let d = o.find((A) => A.id === l)?.regionIndex ?? c;
|
|
17106
|
+
d >= t.length && (d = c), s(
|
|
17055
17107
|
new L([
|
|
17056
|
-
new Ro(
|
|
17108
|
+
new Ro(l, e, t[d]),
|
|
17057
17109
|
new Oo(
|
|
17058
|
-
|
|
17110
|
+
l,
|
|
17059
17111
|
i.useThreshold,
|
|
17060
17112
|
i.invertThreshold,
|
|
17061
17113
|
i.threshold,
|
|
@@ -17093,7 +17145,7 @@ class Wd {
|
|
|
17093
17145
|
traversableScenes() {
|
|
17094
17146
|
throw new Error("Method not implemented.");
|
|
17095
17147
|
}
|
|
17096
|
-
updateRecipient(t, e, a, i, r, o, s, l, c, d, A, u, h, m, p,
|
|
17148
|
+
updateRecipient(t, e, a, i, r, o, s, l, c, d, A, u, h, g, m, p, f) {
|
|
17097
17149
|
throw new Error("Method not implemented.");
|
|
17098
17150
|
}
|
|
17099
17151
|
approveTransaction(t) {
|
|
@@ -17416,7 +17468,7 @@ class hc extends et {
|
|
|
17416
17468
|
return this.manager.getStepStorage(this.step.stepName);
|
|
17417
17469
|
}
|
|
17418
17470
|
}
|
|
17419
|
-
const
|
|
17471
|
+
const gc = C`
|
|
17420
17472
|
query GetLoggedInCustomer($email: String!) {
|
|
17421
17473
|
customer(emailAddress: $email) {
|
|
17422
17474
|
id
|
|
@@ -17459,7 +17511,7 @@ const mc = C`
|
|
|
17459
17511
|
total
|
|
17460
17512
|
}
|
|
17461
17513
|
}
|
|
17462
|
-
`,
|
|
17514
|
+
`, mc = C`
|
|
17463
17515
|
mutation SetTransactionDesignName($id: String!, $name: String!) {
|
|
17464
17516
|
transactionUpdate(id: $id, designName: $name) {
|
|
17465
17517
|
id
|
|
@@ -17545,7 +17597,7 @@ const mc = C`
|
|
|
17545
17597
|
},
|
|
17546
17598
|
context: e
|
|
17547
17599
|
}), Hd = async (n, t) => await y.getShadowGraphqlClient().mutate({
|
|
17548
|
-
mutation:
|
|
17600
|
+
mutation: mc,
|
|
17549
17601
|
errorPolicy: "all",
|
|
17550
17602
|
variables: {
|
|
17551
17603
|
id: n,
|
|
@@ -17566,7 +17618,7 @@ const mc = C`
|
|
|
17566
17618
|
template: t
|
|
17567
17619
|
}
|
|
17568
17620
|
}), Jd = async (n) => (await y.getShadowGraphqlClient().query({
|
|
17569
|
-
query:
|
|
17621
|
+
query: gc,
|
|
17570
17622
|
errorPolicy: "all",
|
|
17571
17623
|
variables: {
|
|
17572
17624
|
email: n
|
|
@@ -17676,7 +17728,7 @@ X = { __e: function(n, t, e, a) {
|
|
|
17676
17728
|
}
|
|
17677
17729
|
throw n;
|
|
17678
17730
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
|
17679
|
-
var st, oa, hn, vi = [], sa = [],
|
|
17731
|
+
var st, oa, hn, vi = [], sa = [], gn = X.__b, mn = X.__r, pn = X.diffed, fn = X.__c, Cn = X.unmount;
|
|
17680
17732
|
function Ec() {
|
|
17681
17733
|
for (var n; n = vi.shift(); )
|
|
17682
17734
|
if (n.__P && n.__H)
|
|
@@ -17687,9 +17739,9 @@ function Ec() {
|
|
|
17687
17739
|
}
|
|
17688
17740
|
}
|
|
17689
17741
|
X.__b = function(n) {
|
|
17690
|
-
st = null,
|
|
17742
|
+
st = null, gn && gn(n);
|
|
17691
17743
|
}, X.__r = function(n) {
|
|
17692
|
-
|
|
17744
|
+
mn && mn(n);
|
|
17693
17745
|
var t = (st = n.__c).__H;
|
|
17694
17746
|
t && (oa === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
|
|
17695
17747
|
e.__N && (e.__ = e.__N), e.__V = sa, e.__N = e.i = void 0;
|
|
@@ -17796,21 +17848,21 @@ const Ei = C`
|
|
|
17796
17848
|
...AddressValidationResultFields
|
|
17797
17849
|
}
|
|
17798
17850
|
}
|
|
17799
|
-
`,
|
|
17851
|
+
`, xc = C`
|
|
17800
17852
|
${Ua}
|
|
17801
17853
|
mutation BatchValidateRecipientAddress($ids: [String!]!) {
|
|
17802
17854
|
recipientValidateBatch(ids: $ids) {
|
|
17803
17855
|
...AddressValidationJobFields
|
|
17804
17856
|
}
|
|
17805
17857
|
}
|
|
17806
|
-
`,
|
|
17858
|
+
`, Dc = C`
|
|
17807
17859
|
mutation OverrideRecipientAddress($id: String!) {
|
|
17808
17860
|
recipientOverrideAddress(id: $id) {
|
|
17809
17861
|
id
|
|
17810
17862
|
}
|
|
17811
17863
|
}
|
|
17812
17864
|
`;
|
|
17813
|
-
var
|
|
17865
|
+
var Fc = /* @__PURE__ */ ((n) => (n.Confirmed = "Confirmed", n.Plausible = "Plausible", n.Unlikely = "Unlikely", n))(Fc || {}), kc = /* @__PURE__ */ ((n) => (n.Created = "Created", n.Processing = "Processing", n.Completed = "Completed", n.Failed = "Failed", n.Cancelled = "Cancelled", n))(kc || {});
|
|
17814
17866
|
const aA = async (n) => {
|
|
17815
17867
|
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().query({
|
|
17816
17868
|
query: Bc,
|
|
@@ -17841,7 +17893,7 @@ const aA = async (n) => {
|
|
|
17841
17893
|
}
|
|
17842
17894
|
})).data?.recipientValidate : void 0, rA = async (n) => {
|
|
17843
17895
|
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().mutate({
|
|
17844
|
-
mutation:
|
|
17896
|
+
mutation: xc,
|
|
17845
17897
|
errorPolicy: "all",
|
|
17846
17898
|
fetchPolicy: "network-only",
|
|
17847
17899
|
variables: {
|
|
@@ -17858,7 +17910,7 @@ const aA = async (n) => {
|
|
|
17858
17910
|
if (!t)
|
|
17859
17911
|
return;
|
|
17860
17912
|
(await y.getShadowGraphqlClient().mutate({
|
|
17861
|
-
mutation:
|
|
17913
|
+
mutation: Dc,
|
|
17862
17914
|
errorPolicy: "all",
|
|
17863
17915
|
fetchPolicy: "network-only",
|
|
17864
17916
|
variables: {
|
|
@@ -17884,17 +17936,17 @@ const aA = async (n) => {
|
|
|
17884
17936
|
export {
|
|
17885
17937
|
Ea as AddonHandle,
|
|
17886
17938
|
kc as AddressValidationJobStatus,
|
|
17887
|
-
|
|
17939
|
+
Fc as AddressValidationResultConfirmationLevel,
|
|
17888
17940
|
bn as AddressValidationStatus,
|
|
17889
17941
|
Od as ArrayInput,
|
|
17890
17942
|
G as AspectType,
|
|
17891
17943
|
Bt as AssetNotFoundError,
|
|
17892
17944
|
Ie as AssetType,
|
|
17893
|
-
|
|
17894
|
-
|
|
17895
|
-
|
|
17945
|
+
Fd as BringForwardCommand,
|
|
17946
|
+
Dd as BringToBackCommand,
|
|
17947
|
+
xd as BringToFrontCommand,
|
|
17896
17948
|
Gi as BundleDesignCreationCartAddMode,
|
|
17897
|
-
|
|
17949
|
+
$ as CanvasCommand,
|
|
17898
17950
|
pe as CollectionProduct,
|
|
17899
17951
|
cn as ColorOptionGlobalPropertyHandle,
|
|
17900
17952
|
ko as CommandContext,
|
|
@@ -17906,7 +17958,7 @@ export {
|
|
|
17906
17958
|
nc as CurrencyService,
|
|
17907
17959
|
Rt as DeleteElementCommand,
|
|
17908
17960
|
ul as DigitalContentStepHandle,
|
|
17909
|
-
|
|
17961
|
+
Dl as FileUploadGlobalPropertyHandle,
|
|
17910
17962
|
fe as FlowExecutionNodeResult,
|
|
17911
17963
|
Kl as FlowExecutionResult,
|
|
17912
17964
|
Jl as FlowService,
|
|
@@ -17925,11 +17977,11 @@ export {
|
|
|
17925
17977
|
An as IntegrationProduct,
|
|
17926
17978
|
qi as IntegrationType,
|
|
17927
17979
|
Ed as LayoutElementFactory,
|
|
17928
|
-
|
|
17980
|
+
D as LayoutElementType,
|
|
17929
17981
|
K as LayoutNotFoundError,
|
|
17930
17982
|
Kt as LayoutRenderingPurpose,
|
|
17931
17983
|
rl as MaterialStepHandle,
|
|
17932
|
-
|
|
17984
|
+
xe as MisconfigurationError,
|
|
17933
17985
|
Wd as MockWorkflowManager,
|
|
17934
17986
|
ol as ModelStepHandle,
|
|
17935
17987
|
hl as ModuleStepHandle,
|
|
@@ -17938,7 +17990,7 @@ export {
|
|
|
17938
17990
|
_l as ObjectInputType,
|
|
17939
17991
|
pi as OptionGlobalPropertyHandle,
|
|
17940
17992
|
Pe as OptionNotFoundError,
|
|
17941
|
-
|
|
17993
|
+
Dt as ParseError,
|
|
17942
17994
|
sl as PictureStepHandle,
|
|
17943
17995
|
Hi as ProductCameraRig,
|
|
17944
17996
|
Ci as ProductCollection,
|
|
@@ -17959,10 +18011,10 @@ export {
|
|
|
17959
18011
|
Be as StakeholderType,
|
|
17960
18012
|
zi as StepAspectType,
|
|
17961
18013
|
et as StepHandle,
|
|
17962
|
-
|
|
18014
|
+
E as StepType,
|
|
17963
18015
|
Tt as TextAlgorithm,
|
|
17964
18016
|
$o as TextChangeCommand,
|
|
17965
|
-
|
|
18017
|
+
Fl as TextGlobalPropertyHandle,
|
|
17966
18018
|
Rd as TextInput,
|
|
17967
18019
|
dl as TextStepHandle,
|
|
17968
18020
|
zl as Transform,
|
|
@@ -17992,7 +18044,7 @@ export {
|
|
|
17992
18044
|
cd as findPmsColors,
|
|
17993
18045
|
Gt as frameDataCache,
|
|
17994
18046
|
Et as frameStepService,
|
|
17995
|
-
|
|
18047
|
+
T as generate,
|
|
17996
18048
|
Cs as generateCommands,
|
|
17997
18049
|
lt as generateSVGWithUnknownColors,
|
|
17998
18050
|
Td as generateStateFromDesignInputSteps,
|
|
@@ -18009,10 +18061,10 @@ export {
|
|
|
18009
18061
|
cc as getIntegration,
|
|
18010
18062
|
sA as getIntegrationProducts,
|
|
18011
18063
|
pd as getNEPoint,
|
|
18012
|
-
|
|
18064
|
+
md as getNWPoint,
|
|
18013
18065
|
Zd as getOrderedTransactions,
|
|
18014
18066
|
Ld as getOverrideThemeConfiguration,
|
|
18015
|
-
|
|
18067
|
+
gd as getPointOfRotation,
|
|
18016
18068
|
Qd as getProductCollections,
|
|
18017
18069
|
fd as getSEPoint,
|
|
18018
18070
|
ka as getSvgElement,
|
|
@@ -18035,14 +18087,14 @@ export {
|
|
|
18035
18087
|
Ul as metafieldManager,
|
|
18036
18088
|
yd as mmPerPixel,
|
|
18037
18089
|
si as modelStepService,
|
|
18038
|
-
|
|
18090
|
+
Da as modifySVGColors,
|
|
18039
18091
|
li as moduleStepService,
|
|
18040
18092
|
qd as nameBundle,
|
|
18041
18093
|
Hd as nameTransaction,
|
|
18042
18094
|
J as optionService,
|
|
18043
18095
|
vd as outlineFontsInSvg,
|
|
18044
18096
|
oA as overrideWorkflowExperienceRecipientAddress,
|
|
18045
|
-
|
|
18097
|
+
gt as patternImageDataCache,
|
|
18046
18098
|
k as persistenceService,
|
|
18047
18099
|
ci as pictureStepService,
|
|
18048
18100
|
sd as pmsToRgb,
|