@spiffcommerce/core 31.2.3 → 31.2.4
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 +6 -0
- package/dist/index.js +54 -54
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +257 -251
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -4,32 +4,32 @@ import { onError as ur } from "@apollo/client/link/error";
|
|
4
4
|
import { renderToStaticMarkup as hr } from "preact-render-to-string";
|
5
5
|
import { removeTypenameFromVariables as mr } from "@apollo/client/link/remove-typename";
|
6
6
|
import { orientation as gr } from "exifr/dist/mini.umd.cjs";
|
7
|
-
import { parse as
|
7
|
+
import { parse as on } from "css";
|
8
8
|
import pr from "fuse.js";
|
9
9
|
import { Pith as Aa } from "pith";
|
10
|
-
import
|
11
|
-
import { toString as
|
10
|
+
import vt from "lodash.clonedeep";
|
11
|
+
import { toString as ln } from "qrcode";
|
12
12
|
import fr from "svg-path-bbox";
|
13
13
|
import { parse as ta } from "opentype.js";
|
14
14
|
import { jsx as D, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
|
15
15
|
import Cr from "handlebars";
|
16
16
|
import { dataUriToBuffer as wr } from "data-uri-to-buffer";
|
17
|
-
import
|
18
|
-
import { CognitoIdentityProviderClient as yr, InitiateAuthCommand as
|
17
|
+
import Fa from "lodash.chunk";
|
18
|
+
import { CognitoIdentityProviderClient as yr, InitiateAuthCommand as xa, RespondToAuthChallengeCommand as Sr } from "@aws-sdk/client-cognito-identity-provider";
|
19
19
|
import vr from "dinero.js";
|
20
|
-
import * as
|
21
|
-
import
|
20
|
+
import * as ka from "currency-codes";
|
21
|
+
import cn from "lodash.isequal";
|
22
22
|
import { split as ea } from "unicode-default-word-boundary";
|
23
|
-
import
|
23
|
+
import dn from "lodash.debounce";
|
24
24
|
import "fs";
|
25
25
|
import "path";
|
26
26
|
var ye = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(ye || {}), L = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(L || {}), v = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(v || {}), Er = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Er || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), x = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(x || {}), br = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(br || {}), Br = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Br || {}), Ir = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Ir || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Pr = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Pr || {}), Se = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(Se || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), j = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(j || {}), Dr = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Dr || {});
|
27
|
-
class
|
27
|
+
class An extends Error {
|
28
28
|
constructor(t) {
|
29
29
|
super(t), this.name = this.constructor.name;
|
30
30
|
}
|
31
31
|
}
|
32
|
-
class Xt extends
|
32
|
+
class Xt extends An {
|
33
33
|
constructor(t) {
|
34
34
|
super(`ConfigurationError - ${t}`);
|
35
35
|
}
|
@@ -44,7 +44,7 @@ class Y extends Xt {
|
|
44
44
|
super(`Panel not Found: ${t.panelId}`), this.panelId = t?.panelId || "N/A";
|
45
45
|
}
|
46
46
|
}
|
47
|
-
class
|
47
|
+
class Et extends Xt {
|
48
48
|
constructor(t) {
|
49
49
|
super(`Asset not found for variant: ${t.name}`), this.variant = t;
|
50
50
|
}
|
@@ -59,7 +59,7 @@ class Ee extends Xt {
|
|
59
59
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
60
60
|
}
|
61
61
|
}
|
62
|
-
class xe extends
|
62
|
+
class xe extends An {
|
63
63
|
constructor(t) {
|
64
64
|
super(`ImplementationError - ${t}`);
|
65
65
|
}
|
@@ -104,7 +104,7 @@ class Fr {
|
|
104
104
|
this.set(t, a);
|
105
105
|
}
|
106
106
|
}
|
107
|
-
class
|
107
|
+
class Ma {
|
108
108
|
constructor() {
|
109
109
|
this.storage = /* @__PURE__ */ new Map();
|
110
110
|
}
|
@@ -129,9 +129,9 @@ class Ta {
|
|
129
129
|
}
|
130
130
|
const xr = () => {
|
131
131
|
try {
|
132
|
-
return localStorage ? new Fr() : new
|
132
|
+
return localStorage ? new Fr() : new Ma();
|
133
133
|
} catch {
|
134
|
-
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new
|
134
|
+
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Ma();
|
135
135
|
}
|
136
136
|
}, k = xr();
|
137
137
|
class kr {
|
@@ -183,19 +183,19 @@ function rt(r, t) {
|
|
183
183
|
}
|
184
184
|
return na(r, t);
|
185
185
|
}
|
186
|
-
const
|
187
|
-
const t =
|
186
|
+
const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), hn = async (r) => {
|
187
|
+
const t = Ta.get(r);
|
188
188
|
if (t) return t;
|
189
189
|
const a = (async () => {
|
190
190
|
const n = await rt(r);
|
191
|
-
return
|
191
|
+
return un.set(r, n.headers?.get("content-type") || ""), await n.arrayBuffer();
|
192
192
|
})();
|
193
|
-
return
|
193
|
+
return Ta.set(r, a), a;
|
194
194
|
}, Mr = async (r) => {
|
195
|
-
const t =
|
195
|
+
const t = Na.get(r);
|
196
196
|
if (t) return t;
|
197
197
|
const a = (async () => await (await rt(r)).text())();
|
198
|
-
return
|
198
|
+
return Na.set(r, a), a;
|
199
199
|
}, Tt = (r) => r.every((t) => t !== "undefined"), se = (r) => Tt([typeof document]) ? document.createElement(r) : Zt().document.createElement(r), Tr = (r, t) => {
|
200
200
|
if (Tt([typeof document]))
|
201
201
|
return document.createElementNS(r, t);
|
@@ -207,7 +207,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
|
|
207
207
|
const r = Zt();
|
208
208
|
return new r.DOMParser();
|
209
209
|
}, Nr = () => Tt([typeof DOMParser]) ? DOMParser : Zt().DOMParser, Me = (r, t) => new Promise((e, a) => {
|
210
|
-
t ?
|
210
|
+
t ? hn(r).then(e).catch(a) : rt(r).then((n) => {
|
211
211
|
n.arrayBuffer().then(e).catch(a);
|
212
212
|
}).catch((n) => {
|
213
213
|
a(n);
|
@@ -216,7 +216,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
|
|
216
216
|
t ? Mr(r).then(e).catch(a) : rt(r).then((n) => {
|
217
217
|
n.text().then(e).catch(a);
|
218
218
|
}).catch(a);
|
219
|
-
}),
|
219
|
+
}), mn = (r) => hr(r), Ue = /* @__PURE__ */ new Map(), Qr = async (r, t) => {
|
220
220
|
if (Tt([typeof FontFace])) {
|
221
221
|
if (Ue.has(t))
|
222
222
|
return Ue.get(t);
|
@@ -230,7 +230,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
|
|
230
230
|
return new XMLSerializer();
|
231
231
|
const r = Zt();
|
232
232
|
return new r.XMLSerializer();
|
233
|
-
},
|
233
|
+
}, Qa = (r) => btoa(r), Te = (r) => {
|
234
234
|
function t() {
|
235
235
|
const a = new Uint8Array(r), n = 4;
|
236
236
|
if (a.length >= n) {
|
@@ -257,7 +257,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
|
|
257
257
|
const e = t();
|
258
258
|
return e || "image/svg+xml";
|
259
259
|
}, Qc = async (r) => {
|
260
|
-
const t = await
|
260
|
+
const t = await hn(r), e = un.get(r) || Te(t);
|
261
261
|
return await $r(new Blob([t], { type: e }));
|
262
262
|
}, Rr = (r) => {
|
263
263
|
let t = "";
|
@@ -268,7 +268,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
|
|
268
268
|
}, Or = async (r) => {
|
269
269
|
const t = Te(r), e = new Uint8Array(r), a = Rr(e), n = btoa(a);
|
270
270
|
return `data:${t};base64,${n}`;
|
271
|
-
}, ha = (r) => `data:image/svg+xml;base64,${btoa(r)}`,
|
271
|
+
}, ha = (r) => `data:image/svg+xml;base64,${btoa(r)}`, gn = (r) => {
|
272
272
|
const t = r.replace(/\r?\n/g, ""), e = t.indexOf(",");
|
273
273
|
if (e === -1 || e <= 4)
|
274
274
|
throw new TypeError("malformed data: URI");
|
@@ -291,9 +291,9 @@ let Ur, ma;
|
|
291
291
|
const Lr = (r) => {
|
292
292
|
ma = r;
|
293
293
|
}, Vr = () => ma;
|
294
|
-
let
|
294
|
+
let pn;
|
295
295
|
const zr = (r) => {
|
296
|
-
|
296
|
+
pn = r;
|
297
297
|
}, Gr = () => new Promise((r) => {
|
298
298
|
const t = gt.getHubUrl(), e = (a) => {
|
299
299
|
a.origin === t && (window.removeEventListener("message", e), r(a.data));
|
@@ -303,7 +303,7 @@ const zr = (r) => {
|
|
303
303
|
const r = {
|
304
304
|
applicationKey: ma,
|
305
305
|
customerToken: Ur,
|
306
|
-
bearer:
|
306
|
+
bearer: pn
|
307
307
|
};
|
308
308
|
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Gr(), ...r } : r;
|
309
309
|
};
|
@@ -369,8 +369,8 @@ const pt = (r, t, e) => {
|
|
369
369
|
if (ra !== void 0)
|
370
370
|
return ra(r, t, e);
|
371
371
|
try {
|
372
|
-
const a =
|
373
|
-
return
|
372
|
+
const a = Cn(!0);
|
373
|
+
return fn(a), a.createCanvas(r, t, e);
|
374
374
|
} catch {
|
375
375
|
throw new Error("Canvas module not set");
|
376
376
|
}
|
@@ -378,16 +378,16 @@ const pt = (r, t, e) => {
|
|
378
378
|
if (ia !== void 0)
|
379
379
|
return ia(r, t);
|
380
380
|
try {
|
381
|
-
const e =
|
382
|
-
return
|
381
|
+
const e = Cn(!0);
|
382
|
+
return fn(e), e.loadImage(r, t);
|
383
383
|
} catch {
|
384
384
|
throw new Error("Canvas module not set");
|
385
385
|
}
|
386
386
|
};
|
387
|
-
function
|
387
|
+
function fn(r) {
|
388
388
|
ra = r?.createCanvas, ia = r?.loadImage;
|
389
389
|
}
|
390
|
-
function
|
390
|
+
function Cn(r) {
|
391
391
|
try {
|
392
392
|
if (document.createElement("canvas").getContext("2d"))
|
393
393
|
return {
|
@@ -3187,23 +3187,23 @@ function $c(r, t) {
|
|
3187
3187
|
let Qt = null;
|
3188
3188
|
function ti(r) {
|
3189
3189
|
if (r.startsWith("#"))
|
3190
|
-
return
|
3190
|
+
return Ra(r);
|
3191
3191
|
if (!document)
|
3192
3192
|
throw new Error("browserColorToHex is only supported on browsers");
|
3193
3193
|
if (Qt || (Qt = document.createElement("canvas").getContext("2d")), !Qt)
|
3194
3194
|
throw new Error("Failed to create canvas context required to convert colors");
|
3195
3195
|
Qt.fillStyle = r;
|
3196
|
-
const t =
|
3196
|
+
const t = Ra(Qt.fillStyle);
|
3197
3197
|
return t || console.error(`Unknown browser color ${r}`), t;
|
3198
3198
|
}
|
3199
|
-
function
|
3199
|
+
function Ra(r) {
|
3200
3200
|
const t = r.substring(1).toUpperCase();
|
3201
3201
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
3202
3202
|
}
|
3203
3203
|
const le = (r) => {
|
3204
|
-
const t =
|
3204
|
+
const t = wn(r.spotColor);
|
3205
3205
|
return t ? `${r.browserValue} ${t}` : r.browserValue;
|
3206
|
-
},
|
3206
|
+
}, wn = (r) => {
|
3207
3207
|
if (!r)
|
3208
3208
|
return "";
|
3209
3209
|
if (r.profileName.includes("/") && r.profileName.includes(".icc")) {
|
@@ -3211,7 +3211,7 @@ const le = (r) => {
|
|
3211
3211
|
return `icc-named-color(${t.slice(e + 1).slice(0, -4)}, ${r.namedColor})`;
|
3212
3212
|
}
|
3213
3213
|
return `icc-named-color(${r.profileName}, ${r.namedColor})`;
|
3214
|
-
},
|
3214
|
+
}, Oa = (r) => {
|
3215
3215
|
const t = r.split(/[ ](?=[^)]*?(?:\(|$))/);
|
3216
3216
|
if (t.length === 0)
|
3217
3217
|
return { browserValue: "#000000" };
|
@@ -3255,7 +3255,7 @@ const le = (r) => {
|
|
3255
3255
|
}
|
3256
3256
|
if (a.tagName === "style") {
|
3257
3257
|
try {
|
3258
|
-
|
3258
|
+
on(a.innerHTML).stylesheet?.rules.forEach((s) => {
|
3259
3259
|
e.push(s);
|
3260
3260
|
}), a.remove();
|
3261
3261
|
} catch (i) {
|
@@ -3287,9 +3287,9 @@ const le = (r) => {
|
|
3287
3287
|
const t = /pt|pc|mm|cm|in/gm, e = r.getAttribute("viewBox"), a = r.getAttribute("width"), n = r.getAttribute("height");
|
3288
3288
|
if (!e) throw new Error("viewBox not specified on SVG!");
|
3289
3289
|
a && r.setAttribute("width", a.replace(t, "")), n && r.setAttribute("height", n.replace(t, ""));
|
3290
|
-
},
|
3290
|
+
}, yn = (r) => dt().parseFromString(r, "image/svg+xml").firstElementChild, ii = (r, t, e) => {
|
3291
3291
|
r.setAttribute("height", `${e}px`), r.setAttribute("width", `${t}px`);
|
3292
|
-
},
|
3292
|
+
}, Sn = (r, t, e) => {
|
3293
3293
|
kt(r, (a) => {
|
3294
3294
|
const n = a.attributes.getNamedItem("fill");
|
3295
3295
|
n && n.value !== "none" && a.classList.forEach((s) => {
|
@@ -3328,16 +3328,16 @@ const le = (r) => {
|
|
3328
3328
|
}
|
3329
3329
|
});
|
3330
3330
|
});
|
3331
|
-
},
|
3332
|
-
const i =
|
3331
|
+
}, vn = (r) => Bt().serializeToString(r), fa = (r, t, e, a, n) => {
|
3332
|
+
const i = yn(r);
|
3333
3333
|
if (!i)
|
3334
3334
|
throw new Error("Failed to read SVG.");
|
3335
|
-
return ii(i, t, e),
|
3335
|
+
return ii(i, t, e), Sn(i, a, n), vn(i);
|
3336
3336
|
}, Ca = (r, t, e) => {
|
3337
|
-
const a =
|
3337
|
+
const a = yn(r);
|
3338
3338
|
if (!a)
|
3339
3339
|
throw new Error("Failed to read SVG.");
|
3340
|
-
return
|
3340
|
+
return Sn(a, t, e), vn(a);
|
3341
3341
|
}, si = (r) => {
|
3342
3342
|
const t = /<svg.*<\/svg>/s, e = r.match(t) || [], a = e?.length > 0 ? e[0] : "";
|
3343
3343
|
return dt().parseFromString(a, "image/svg+xml");
|
@@ -3351,12 +3351,12 @@ const le = (r) => {
|
|
3351
3351
|
ei.includes(s.tagName) && !s.attributes.getNamedItem("fill") && s.setAttribute("fill", "black");
|
3352
3352
|
const o = s.attributes.getNamedItem("fill");
|
3353
3353
|
if (o && o.value !== "none" && !o.value.startsWith("url(")) {
|
3354
|
-
const c =
|
3354
|
+
const c = Oa(o.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
|
3355
3355
|
s.setAttribute("fill", c.browserValue), s.classList.add(A), a[d] = c;
|
3356
3356
|
}
|
3357
3357
|
const l = s.attributes.getNamedItem("stroke");
|
3358
3358
|
if (l && l.value !== "none" && !l.value.startsWith("url(")) {
|
3359
|
-
const c =
|
3359
|
+
const c = Oa(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
|
3360
3360
|
s.classList.add(A), s.setAttribute("stroke", c.browserValue), a[d] = c;
|
3361
3361
|
}
|
3362
3362
|
});
|
@@ -3748,7 +3748,7 @@ const Rt = "persistentAssets", lt = class lt {
|
|
3748
3748
|
};
|
3749
3749
|
lt.callbacks = [];
|
3750
3750
|
let At = lt;
|
3751
|
-
const
|
3751
|
+
const $a = "bgrmPersistentAssets";
|
3752
3752
|
class J {
|
3753
3753
|
static has(t) {
|
3754
3754
|
return J.getMap().has(t);
|
@@ -3775,10 +3775,10 @@ class J {
|
|
3775
3775
|
a && (e.delete(a), J.setMap(e));
|
3776
3776
|
}
|
3777
3777
|
static getMap() {
|
3778
|
-
return k.getMap(
|
3778
|
+
return k.getMap($a) || /* @__PURE__ */ new Map();
|
3779
3779
|
}
|
3780
3780
|
static setMap(t) {
|
3781
|
-
k.setMap(
|
3781
|
+
k.setMap($a, t);
|
3782
3782
|
}
|
3783
3783
|
}
|
3784
3784
|
const O = new mi();
|
@@ -3811,7 +3811,7 @@ class gi {
|
|
3811
3811
|
this.disabled = t;
|
3812
3812
|
}
|
3813
3813
|
}
|
3814
|
-
const Kt = new gi(),
|
3814
|
+
const Kt = new gi(), En = w`
|
3815
3815
|
fragment OptionFields on Option {
|
3816
3816
|
id
|
3817
3817
|
name
|
@@ -3851,7 +3851,7 @@ const Kt = new gi(), bn = w`
|
|
3851
3851
|
`, pi = w`
|
3852
3852
|
${ee(!1)}
|
3853
3853
|
${wa}
|
3854
|
-
${
|
3854
|
+
${En}
|
3855
3855
|
query GetOptions($ids: [String]!) {
|
3856
3856
|
options(ids: $ids) {
|
3857
3857
|
...OptionFields
|
@@ -3920,7 +3920,7 @@ class yi {
|
|
3920
3920
|
}
|
3921
3921
|
}
|
3922
3922
|
}
|
3923
|
-
const H = new yi(),
|
3923
|
+
const H = new yi(), bn = w`
|
3924
3924
|
fragment ActiveIntegrationFields on Integration {
|
3925
3925
|
id
|
3926
3926
|
logo
|
@@ -4048,7 +4048,7 @@ const H = new yi(), Bn = w`
|
|
4048
4048
|
}
|
4049
4049
|
}
|
4050
4050
|
}
|
4051
|
-
`,
|
4051
|
+
`, Bn = w`
|
4052
4052
|
fragment StakeholderFields on Stakeholder {
|
4053
4053
|
id
|
4054
4054
|
type
|
@@ -4056,7 +4056,7 @@ const H = new yi(), Bn = w`
|
|
4056
4056
|
authorizationNote
|
4057
4057
|
authorizationStatus
|
4058
4058
|
}
|
4059
|
-
`,
|
4059
|
+
`, In = w`
|
4060
4060
|
fragment TransactionShareActionFields on TransactionShareAction {
|
4061
4061
|
id
|
4062
4062
|
title
|
@@ -4067,9 +4067,9 @@ const H = new yi(), Bn = w`
|
|
4067
4067
|
}
|
4068
4068
|
`, vi = w`
|
4069
4069
|
${Qe}
|
4070
|
-
${In}
|
4071
|
-
${Pn}
|
4072
4070
|
${Bn}
|
4071
|
+
${In}
|
4072
|
+
${bn}
|
4073
4073
|
query ReadTransactions($ids: [String]!) {
|
4074
4074
|
transactions(ids: $ids) {
|
4075
4075
|
customLogoLink
|
@@ -4332,7 +4332,7 @@ const H = new yi(), Bn = w`
|
|
4332
4332
|
}
|
4333
4333
|
}
|
4334
4334
|
`, Pi = w`
|
4335
|
-
${
|
4335
|
+
${In}
|
4336
4336
|
query ReadTransactionForShareActions($id: String!) {
|
4337
4337
|
transactions(ids: [$id]) {
|
4338
4338
|
id
|
@@ -4342,14 +4342,14 @@ const H = new yi(), Bn = w`
|
|
4342
4342
|
}
|
4343
4343
|
}
|
4344
4344
|
}
|
4345
|
-
`,
|
4345
|
+
`, Pn = w`
|
4346
4346
|
query ReadWorkflowStates($ids: [String]!) {
|
4347
4347
|
transactions(ids: $ids) {
|
4348
4348
|
id
|
4349
4349
|
workflowState
|
4350
4350
|
}
|
4351
4351
|
}
|
4352
|
-
`,
|
4352
|
+
`, Dn = (r) => w`
|
4353
4353
|
${Qe}
|
4354
4354
|
fragment IntegrationProductFields on IntegrationProduct {
|
4355
4355
|
id
|
@@ -4433,14 +4433,14 @@ const H = new yi(), Bn = w`
|
|
4433
4433
|
}
|
4434
4434
|
}
|
4435
4435
|
`, Di = (r) => w`
|
4436
|
-
${
|
4436
|
+
${Dn(r)}
|
4437
4437
|
query GetIntegrationProducts($ids: [String!]!) {
|
4438
4438
|
integrationProducts(ids: $ids) {
|
4439
4439
|
...IntegrationProductFields
|
4440
4440
|
}
|
4441
4441
|
}
|
4442
4442
|
`, Fi = (r) => w`
|
4443
|
-
${
|
4443
|
+
${Dn(r)}
|
4444
4444
|
query GetIntegrationProductFromExternalIds($externalIntegrationId: String!, $externalProductId: String!) {
|
4445
4445
|
integrationProductFromExternalIds(
|
4446
4446
|
externalIntegrationId: $externalIntegrationId
|
@@ -4450,7 +4450,7 @@ const H = new yi(), Bn = w`
|
|
4450
4450
|
}
|
4451
4451
|
}
|
4452
4452
|
`, xi = w`
|
4453
|
-
${
|
4453
|
+
${Bn}
|
4454
4454
|
query ReadTransactionForStakeholders($id: String!) {
|
4455
4455
|
transactions(ids: [$id]) {
|
4456
4456
|
stakeholders {
|
@@ -4588,7 +4588,7 @@ const H = new yi(), Bn = w`
|
|
4588
4588
|
`, Ri = (r) => w`
|
4589
4589
|
${ee(r)}
|
4590
4590
|
${wa}
|
4591
|
-
${
|
4591
|
+
${En}
|
4592
4592
|
${Mi}
|
4593
4593
|
${Ti}
|
4594
4594
|
${Ni}
|
@@ -5113,7 +5113,7 @@ const H = new yi(), Bn = w`
|
|
5113
5113
|
}
|
5114
5114
|
}
|
5115
5115
|
`, Li = w`
|
5116
|
-
${
|
5116
|
+
${bn}
|
5117
5117
|
${Re}
|
5118
5118
|
query GetCurrentIntegration($themeConfigurationId: String) {
|
5119
5119
|
currentIntegration {
|
@@ -5213,7 +5213,7 @@ const H = new yi(), Bn = w`
|
|
5213
5213
|
],
|
5214
5214
|
silentSteps: []
|
5215
5215
|
}), t;
|
5216
|
-
}, ji = (r, t) => t.find((e) => e.stepNames.includes(r)),
|
5216
|
+
}, ji = (r, t) => t.find((e) => e.stepNames.includes(r)), St = (r, t) => (r.conditions || []).every((e) => {
|
5217
5217
|
const a = t[e.targetStepName];
|
5218
5218
|
if (a && a.selectedVariants) {
|
5219
5219
|
const n = a.selectedVariants;
|
@@ -5226,8 +5226,8 @@ const H = new yi(), Bn = w`
|
|
5226
5226
|
const e = {
|
5227
5227
|
name: r.name,
|
5228
5228
|
title: r.title,
|
5229
|
-
renderableSteps: r.renderableSteps.filter((a) =>
|
5230
|
-
silentSteps: r.silentSteps.filter((a) =>
|
5229
|
+
renderableSteps: r.renderableSteps.filter((a) => St(a, t)),
|
5230
|
+
silentSteps: r.silentSteps.filter((a) => St(a, t))
|
5231
5231
|
};
|
5232
5232
|
return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
|
5233
5233
|
}, Pt = (r, t) => r.map((e) => Hi(e, t)).filter((e) => e !== null), Yi = async (r, t, e = !1) => {
|
@@ -5246,12 +5246,12 @@ const H = new yi(), Bn = w`
|
|
5246
5246
|
);
|
5247
5247
|
return i;
|
5248
5248
|
};
|
5249
|
-
class
|
5249
|
+
class Fn {
|
5250
5250
|
constructor() {
|
5251
5251
|
this.timestamp = Date.now();
|
5252
5252
|
}
|
5253
5253
|
}
|
5254
|
-
class
|
5254
|
+
class xn {
|
5255
5255
|
/**
|
5256
5256
|
* Constructs a new promise queue.
|
5257
5257
|
* @param queueMaxSize An optional maximum size, when the max size is hit.
|
@@ -5346,7 +5346,7 @@ const M = () => {
|
|
5346
5346
|
...E,
|
5347
5347
|
_renderingConfiguration: a,
|
5348
5348
|
mask: l ? `url(#viewmask-${C})` : void 0
|
5349
|
-
})), f =
|
5349
|
+
})), f = Sa(I);
|
5350
5350
|
return /* @__PURE__ */ ct(
|
5351
5351
|
"svg",
|
5352
5352
|
{
|
@@ -5502,7 +5502,7 @@ const M = () => {
|
|
5502
5502
|
x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
|
5503
5503
|
y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
|
5504
5504
|
};
|
5505
|
-
}, Jc = 0.352778, Kc = 0.035277,
|
5505
|
+
}, Jc = 0.352778, Kc = 0.035277, kn = (r) => {
|
5506
5506
|
const t = r.rotation || 0, e = ft(t), a = Math.cos(e), n = -Math.sin(e);
|
5507
5507
|
return /* @__PURE__ */ D("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ D(
|
5508
5508
|
"g",
|
@@ -5524,8 +5524,8 @@ const M = () => {
|
|
5524
5524
|
)
|
5525
5525
|
}
|
5526
5526
|
) });
|
5527
|
-
},
|
5528
|
-
const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s =
|
5527
|
+
}, Mn = (r) => {
|
5528
|
+
const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s = Sa(r.children);
|
5529
5529
|
return /* @__PURE__ */ ct(Gt, { children: [
|
5530
5530
|
/* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ D("path", { d: r.clipPath }) : /* @__PURE__ */ D("rect", { x: 0, y: 0, width: r.width, height: r.height }) }) }),
|
5531
5531
|
/* @__PURE__ */ ct(
|
@@ -5629,7 +5629,7 @@ const M = () => {
|
|
5629
5629
|
matrix(${r.scaleX}, 0, 0, ${r.scaleY}, 0, 0)
|
5630
5630
|
`,
|
5631
5631
|
children: /* @__PURE__ */ D(
|
5632
|
-
|
5632
|
+
Mn,
|
5633
5633
|
{
|
5634
5634
|
id: t,
|
5635
5635
|
x: 0,
|
@@ -5646,7 +5646,7 @@ const M = () => {
|
|
5646
5646
|
}
|
5647
5647
|
)
|
5648
5648
|
] });
|
5649
|
-
},
|
5649
|
+
}, Tn = /* @__PURE__ */ new Map();
|
5650
5650
|
class _i {
|
5651
5651
|
constructor(t) {
|
5652
5652
|
this.font = t, this.glyphsFromText = /* @__PURE__ */ new Map(), this.kerningValues = /* @__PURE__ */ new Map(), this.height = this.calculateApproximateHeight();
|
@@ -5701,10 +5701,10 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5701
5701
|
return ze.get(r);
|
5702
5702
|
const e = (async () => {
|
5703
5703
|
try {
|
5704
|
-
return
|
5704
|
+
return Ct(r).getFont();
|
5705
5705
|
} catch {
|
5706
5706
|
if (Xi(r)) {
|
5707
|
-
const a =
|
5707
|
+
const a = gn(r), n = ta(a);
|
5708
5708
|
return sa(r, n), n;
|
5709
5709
|
} else {
|
5710
5710
|
const a = await Me(r, !0), n = ta(a);
|
@@ -5714,20 +5714,20 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5714
5714
|
})();
|
5715
5715
|
return ze.set(r, e), e;
|
5716
5716
|
}, Zi = (r) => {
|
5717
|
-
const t =
|
5717
|
+
const t = gn(r), e = ta(t);
|
5718
5718
|
return sa(r, e), e;
|
5719
|
-
},
|
5720
|
-
const t =
|
5719
|
+
}, Ct = (r) => {
|
5720
|
+
const t = Tn.get(r);
|
5721
5721
|
if (t)
|
5722
5722
|
return t;
|
5723
5723
|
throw new Error("Font metrics unavailable for font");
|
5724
5724
|
}, sa = (r, t) => {
|
5725
5725
|
const e = new _i(t);
|
5726
|
-
return
|
5726
|
+
return Tn.set(r, e), e;
|
5727
5727
|
}, _c = async (r) => {
|
5728
5728
|
const t = dt(), e = t.parseFromString(r, "image/svg+xml"), a = e.firstElementChild, n = /* @__PURE__ */ new Map();
|
5729
5729
|
a.querySelectorAll("style").forEach((d) => {
|
5730
|
-
|
5730
|
+
on(d.innerHTML).stylesheet?.rules.forEach((u) => {
|
5731
5731
|
if (u.type === "font-face" && u.declarations) {
|
5732
5732
|
const h = u.declarations.find(
|
5733
5733
|
(g) => g.property === "font-family"
|
@@ -5759,8 +5759,8 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5759
5759
|
}
|
5760
5760
|
return e.querySelectorAll("text").forEach((d) => d.remove()), Bt().serializeToString(a);
|
5761
5761
|
}, Be = (r, t, e, a) => Math.max(ns(r.join(`
|
5762
|
-
`), e, a), t),
|
5763
|
-
const s = (i ||
|
5762
|
+
`), e, a), t), Ua = (r, t, e, a, n, i) => {
|
5763
|
+
const s = (i || Rn) * n.getApproximateHeight(), o = t.split(`
|
5764
5764
|
`);
|
5765
5765
|
try {
|
5766
5766
|
const l = o.flatMap((d) => ge(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
|
@@ -5811,12 +5811,12 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5811
5811
|
throw new Error(`No max width calculated for text: ${o}.`);
|
5812
5812
|
return { lines: o, width: l };
|
5813
5813
|
}, ts = (r, t, e, a, n, i) => {
|
5814
|
-
const s = (i ??
|
5814
|
+
const s = (i ?? Rn) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Nn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
|
5815
5815
|
return Math.min(A, d);
|
5816
5816
|
}, es = (r, t, e, a) => {
|
5817
|
-
const n =
|
5817
|
+
const n = Ct(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
|
5818
5818
|
if (!e)
|
5819
|
-
return
|
5819
|
+
return Ua(t, r, t.fontSize, s, n, a);
|
5820
5820
|
let o;
|
5821
5821
|
if (t.text ? o = t.text.split(`
|
5822
5822
|
`) : o = t.input?.split(`
|
@@ -5833,11 +5833,11 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5833
5833
|
requiredHeight: t.height,
|
5834
5834
|
requiredWidth: Be(o, t.width, s, n),
|
5835
5835
|
fontSize: ts(o, n, i, t.width, t.height, a)
|
5836
|
-
} :
|
5836
|
+
} : Ua(t, r, t.fontSize, s, n, a);
|
5837
5837
|
}, as = (r, t, e, a, n) => {
|
5838
|
-
const s =
|
5838
|
+
const s = Ct(t.assetUrl).getFont();
|
5839
5839
|
let o = { ...r };
|
5840
|
-
const l = { ...r }, c =
|
5840
|
+
const l = { ...r }, c = Nn(a, e / s.unitsPerEm, Ct(t.assetUrl));
|
5841
5841
|
return c && c < o.width && (l.width = c, n === "left" ? (l.left += Math.sin(o.rotation * Math.PI / 360) * (o.width - c), l.top += Math.sin(o.rotation * Math.PI / 180) * (c - o.width) / 2) : n === "right" ? l.left += o.width - c : l.left += (o.width - c) / 2, a && rs(a, a).every(([d, A]) => d === A) && (o = l)), o;
|
5842
5842
|
}, Ge = 1, mt = (r, t, e) => {
|
5843
5843
|
let a = 0;
|
@@ -5857,21 +5857,21 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5857
5857
|
a = Math.max(a, o || 0);
|
5858
5858
|
}
|
5859
5859
|
}), a *= t, a;
|
5860
|
-
},
|
5860
|
+
}, Nn = (r, t, e) => {
|
5861
5861
|
let a = 0;
|
5862
5862
|
return r.forEach((n) => {
|
5863
5863
|
a = Math.max(a, mt(n, t, e));
|
5864
5864
|
}), a;
|
5865
|
-
},
|
5865
|
+
}, La = {
|
5866
5866
|
stripControlCharacters: !0,
|
5867
5867
|
vertical: !1,
|
5868
5868
|
uppercase: !1
|
5869
|
-
}, Ie = (r, t =
|
5870
|
-
const e = { ...
|
5869
|
+
}, Ie = (r, t = La) => {
|
5870
|
+
const e = { ...La, ...t };
|
5871
5871
|
let a = r || "";
|
5872
5872
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
5873
5873
|
`)), a;
|
5874
|
-
}, rs = (r, t) => r.map((e, a) => [e, t[a]]), is = (r = "center", t = !1) => t ? "center" : r,
|
5874
|
+
}, rs = (r, t) => r.map((e, a) => [e, t[a]]), is = (r = "center", t = !1) => t ? "center" : r, Qn = (r) => r === "left" ? "start" : r === "right" ? "end" : "middle", ae = (r, t, e) => r.fontData ? {
|
5875
5875
|
...r,
|
5876
5876
|
...(() => {
|
5877
5877
|
if (r.algorithm === Mt.Traditional) {
|
@@ -5889,7 +5889,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5889
5889
|
text: t
|
5890
5890
|
};
|
5891
5891
|
})()
|
5892
|
-
} : r,
|
5892
|
+
} : r, Rn = 1.1;
|
5893
5893
|
function Ft(r, t) {
|
5894
5894
|
return On(r, t.getTemplatingContext());
|
5895
5895
|
}
|
@@ -5906,7 +5906,7 @@ const ss = (r) => {
|
|
5906
5906
|
`), A = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeColor?.browserValue : void 0, u = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
|
5907
5907
|
if (r.curved && !r.paths || !r.fontData)
|
5908
5908
|
return null;
|
5909
|
-
const h = () => r.textFillImage ? `url("#${s}")` : r._renderingConfiguration?.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${
|
5909
|
+
const h = () => r.textFillImage ? `url("#${s}")` : r._renderingConfiguration?.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${wn(r.fillSpotColorDefinition)}` : r.fill;
|
5910
5910
|
return /* @__PURE__ */ ct(Gt, { children: [
|
5911
5911
|
/* @__PURE__ */ ct("defs", { children: [
|
5912
5912
|
r.textFillImage && /* @__PURE__ */ D(
|
@@ -5973,7 +5973,8 @@ const ss = (r) => {
|
|
5973
5973
|
textboxWidth: r.width,
|
5974
5974
|
lineHeight: r.lineHeight,
|
5975
5975
|
vertical: r.vertical,
|
5976
|
-
verticalAlign: r.verticalAlign
|
5976
|
+
verticalAlign: r.verticalAlign,
|
5977
|
+
fontData: r.fontData
|
5977
5978
|
},
|
5978
5979
|
p
|
5979
5980
|
))
|
@@ -5981,8 +5982,13 @@ const ss = (r) => {
|
|
5981
5982
|
) }) })
|
5982
5983
|
] });
|
5983
5984
|
}, os = (r) => {
|
5984
|
-
const t = () =>
|
5985
|
-
|
5985
|
+
const t = () => {
|
5986
|
+
if (r.lineHeight !== void 0)
|
5987
|
+
return r.lineHeight * r.fontSize;
|
5988
|
+
const n = Ct(r.fontData.assetUrl), i = n.getFont(), s = r.fontSize / i.unitsPerEm;
|
5989
|
+
return n.getApproximateHeight() * s;
|
5990
|
+
}, e = () => r.align === "left" ? -r.textboxWidth / 2 : r.align === "right" ? r.textboxWidth / 2 : 0, a = () => {
|
5991
|
+
const n = t(), i = r.textboxHeight / 2;
|
5986
5992
|
if (r.verticalAlign === "top")
|
5987
5993
|
return -i + r.fontSize * 3 / 4 + r.thisLineIdx * n;
|
5988
5994
|
if (r.verticalAlign === "bottom") {
|
@@ -5992,14 +5998,14 @@ const ss = (r) => {
|
|
5992
5998
|
const s = (r.amountLines - 1) / 2;
|
5993
5999
|
return (r.thisLineIdx - s) * n + r.fontSize / 4;
|
5994
6000
|
};
|
5995
|
-
return /* @__PURE__ */ D("tspan", { textAnchor:
|
6001
|
+
return /* @__PURE__ */ D("tspan", { textAnchor: Qn(r.align), x: e(), y: `${a()}px`, children: r.text });
|
5996
6002
|
}, ls = (r) => {
|
5997
6003
|
const t = `#${r.curvedPathId}`;
|
5998
6004
|
return /* @__PURE__ */ D(
|
5999
6005
|
"textPath",
|
6000
6006
|
{
|
6001
6007
|
startOffset: r.align === "left" ? "0%" : r.align === "right" ? "100%" : "50%",
|
6002
|
-
textAnchor:
|
6008
|
+
textAnchor: Qn(r.align),
|
6003
6009
|
href: t,
|
6004
6010
|
xlinkHref: t,
|
6005
6011
|
children: r.text
|
@@ -6008,7 +6014,7 @@ const ss = (r) => {
|
|
6008
6014
|
}, cs = (r) => {
|
6009
6015
|
if (r.cachedObjectURL && !r._renderingConfiguration?.omitCachedFields)
|
6010
6016
|
return /* @__PURE__ */ D(
|
6011
|
-
|
6017
|
+
kn,
|
6012
6018
|
{
|
6013
6019
|
id: r.id,
|
6014
6020
|
src: r.cachedObjectURL,
|
@@ -6113,7 +6119,7 @@ class ds {
|
|
6113
6119
|
layout: t,
|
6114
6120
|
elements: e
|
6115
6121
|
},
|
6116
|
-
getComponentWithProps: (a) =>
|
6122
|
+
getComponentWithProps: (a) => ya(t, e, a)
|
6117
6123
|
};
|
6118
6124
|
}
|
6119
6125
|
initialize(t, e) {
|
@@ -6138,7 +6144,7 @@ class ds {
|
|
6138
6144
|
return { ...t, transaction: e.apply(a) };
|
6139
6145
|
}
|
6140
6146
|
}
|
6141
|
-
const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(
|
6147
|
+
const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(kn, { ...r }, r.id) : r.type === x.Frame ? /* @__PURE__ */ D(Ki, { ...r }, r.id) : r.type === x.Illustration ? /* @__PURE__ */ D(cs, { ...r }, r.id) : r.type === x.Textbox ? /* @__PURE__ */ D(ss, { ...r }, r.id) : r.type === x.Group ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : null, ya = (r, t, e) => {
|
6142
6148
|
const a = e.renderingConfiguration, n = a?.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
|
6143
6149
|
return /* @__PURE__ */ D(
|
6144
6150
|
Ji,
|
@@ -6169,7 +6175,7 @@ const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : r
|
|
6169
6175
|
}
|
6170
6176
|
);
|
6171
6177
|
};
|
6172
|
-
function
|
6178
|
+
function Sa(r) {
|
6173
6179
|
return r.sort((t, e) => {
|
6174
6180
|
const a = t.layer || 0, n = e.layer || 0;
|
6175
6181
|
if (a < n) return -1;
|
@@ -6246,7 +6252,7 @@ const ne = (r) => {
|
|
6246
6252
|
throw new Error("Malformed frame SVG");
|
6247
6253
|
})();
|
6248
6254
|
return We.set(r, e), e;
|
6249
|
-
},
|
6255
|
+
}, va = (r, t, e, a) => {
|
6250
6256
|
const n = t.width / t.height, i = r.width / r.height;
|
6251
6257
|
let s;
|
6252
6258
|
a ? i > n ? s = t.height / r.height : s = t.width / r.width : i > n ? s = t.width / r.width : s = t.height / r.height, e?.scale !== void 0 && (s *= e?.scale);
|
@@ -6269,7 +6275,7 @@ const ne = (r) => {
|
|
6269
6275
|
return ut.set(r, i), i;
|
6270
6276
|
}
|
6271
6277
|
if ((r.split(".").pop()?.toLowerCase() ?? "") === "svg") {
|
6272
|
-
const e = await
|
6278
|
+
const e = await Ea(r), a = e.width, n = e.height, i = {
|
6273
6279
|
src: r,
|
6274
6280
|
width: a,
|
6275
6281
|
height: n,
|
@@ -6285,14 +6291,14 @@ const ne = (r) => {
|
|
6285
6291
|
};
|
6286
6292
|
return ut.set(r, n), n;
|
6287
6293
|
}
|
6288
|
-
},
|
6294
|
+
}, Ea = async (r) => {
|
6289
6295
|
const t = await nt(r);
|
6290
6296
|
return Ln(t);
|
6291
|
-
},
|
6297
|
+
}, Va = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), Ln = (r) => {
|
6292
6298
|
const a = dt().parseFromString(r, "image/svg+xml").querySelector("svg");
|
6293
6299
|
if (!a)
|
6294
6300
|
throw new Error("No svg tag found, this svg must be malformed!");
|
6295
|
-
const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0,
|
6301
|
+
const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, Va(i), Va(s)] : n?.split(" ").map((l) => Number(l));
|
6296
6302
|
if (!o)
|
6297
6303
|
throw new Error("No viewbox or width/height values detected on SVG file!");
|
6298
6304
|
return {
|
@@ -6366,7 +6372,7 @@ const ne = (r) => {
|
|
6366
6372
|
}
|
6367
6373
|
if (e && t === x.Textbox && a?.text && a?.fontScale) {
|
6368
6374
|
await Nt(e);
|
6369
|
-
const l =
|
6375
|
+
const l = Ct(e), c = mt(a.text, a?.fontScale, l);
|
6370
6376
|
o.width = Math.min(c, n.width * 0.85), o.left = n.x + n.width / 2 - o.width / 2;
|
6371
6377
|
}
|
6372
6378
|
return o;
|
@@ -6537,13 +6543,13 @@ const $ = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
|
6537
6543
|
throw new U();
|
6538
6544
|
return e;
|
6539
6545
|
}, X = (r, t) => {
|
6540
|
-
const e = [...t.elements.filter((n) => n.id !== r.id), r], a =
|
6546
|
+
const e = [...t.elements.filter((n) => n.id !== r.id), r], a = Sa(e);
|
6541
6547
|
return {
|
6542
6548
|
layout: t.layout,
|
6543
6549
|
elements: a,
|
6544
6550
|
modificationID: M()
|
6545
6551
|
};
|
6546
|
-
},
|
6552
|
+
}, za = async (r) => {
|
6547
6553
|
const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
|
6548
6554
|
for (let a = 0; a < e.length; a++) {
|
6549
6555
|
const n = e[a], i = r.layouts[n];
|
@@ -6603,7 +6609,7 @@ class N {
|
|
6603
6609
|
this.oldState = t;
|
6604
6610
|
}
|
6605
6611
|
}
|
6606
|
-
class
|
6612
|
+
class Ga extends N {
|
6607
6613
|
constructor(t) {
|
6608
6614
|
super(), this.serializableWorkflow = t;
|
6609
6615
|
}
|
@@ -6865,7 +6871,7 @@ class hs extends N {
|
|
6865
6871
|
};
|
6866
6872
|
}
|
6867
6873
|
}
|
6868
|
-
class
|
6874
|
+
class Wa extends N {
|
6869
6875
|
constructor(t, e) {
|
6870
6876
|
super(), this.id = t, this.fontData = e;
|
6871
6877
|
}
|
@@ -7203,7 +7209,7 @@ class sd extends N {
|
|
7203
7209
|
};
|
7204
7210
|
}
|
7205
7211
|
}
|
7206
|
-
class
|
7212
|
+
class qa {
|
7207
7213
|
constructor(t, e, a) {
|
7208
7214
|
this.processRegion = async (n) => {
|
7209
7215
|
const i = this.layouts.find((l) => l.panelId === n.panelId);
|
@@ -7400,7 +7406,7 @@ class ys {
|
|
7400
7406
|
return t.data.regions.map(e);
|
7401
7407
|
}
|
7402
7408
|
async command(t, e, a, n) {
|
7403
|
-
const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await
|
7409
|
+
const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await ln(t, { type: "svg" }))}`, l = e.map((c) => {
|
7404
7410
|
const d = c.region, A = i.find((u) => u.panelId === d?.panelId);
|
7405
7411
|
if (!A && d)
|
7406
7412
|
throw new Y(d);
|
@@ -7436,7 +7442,7 @@ class Pe {
|
|
7436
7442
|
return oa(e);
|
7437
7443
|
const a = t.asset;
|
7438
7444
|
if (!a)
|
7439
|
-
throw new
|
7445
|
+
throw new Et(t);
|
7440
7446
|
const n = a.fileLink;
|
7441
7447
|
if (n)
|
7442
7448
|
return nt(n, !0);
|
@@ -7600,7 +7606,7 @@ class Pe {
|
|
7600
7606
|
}
|
7601
7607
|
async loadPatternFromString(t, e, a = !0, n = void 0, i) {
|
7602
7608
|
if (t.endsWith("svg")) {
|
7603
|
-
const s = await
|
7609
|
+
const s = await Ea(t), o = s.width, l = s.height, c = await nt(t);
|
7604
7610
|
if (i) {
|
7605
7611
|
const u = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
|
7606
7612
|
if (u && u.length > 0)
|
@@ -7703,7 +7709,7 @@ class Pe {
|
|
7703
7709
|
i && i(!0);
|
7704
7710
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
7705
7711
|
t.data.regions.map(async (h, m) => {
|
7706
|
-
const p = await Oe(l[m]), g = o.getImageData(), C = a.map((P) => new bt(P.id)), S = g ?
|
7712
|
+
const p = await Oe(l[m]), g = o.getImageData(), C = a.map((P) => new bt(P.id)), S = g ? va(
|
7707
7713
|
g,
|
7708
7714
|
p,
|
7709
7715
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
@@ -7794,7 +7800,7 @@ class Pe {
|
|
7794
7800
|
), this.validateColorCount(e, a);
|
7795
7801
|
}
|
7796
7802
|
}
|
7797
|
-
const
|
7803
|
+
const yt = new Pe();
|
7798
7804
|
class Ss {
|
7799
7805
|
async getIllustrationBody(t) {
|
7800
7806
|
return new Promise((e) => {
|
@@ -7955,7 +7961,7 @@ class Ss {
|
|
7955
7961
|
t.mandatory && i.setMandatoryFulfilled(t.stepName, !1);
|
7956
7962
|
const o = e.asset;
|
7957
7963
|
if (!o)
|
7958
|
-
throw new
|
7964
|
+
throw new Et(e);
|
7959
7965
|
const l = o.fileLink;
|
7960
7966
|
if (!l)
|
7961
7967
|
throw new Yt(o);
|
@@ -8086,7 +8092,7 @@ class vs {
|
|
8086
8092
|
n(!0);
|
8087
8093
|
const s = e.material;
|
8088
8094
|
if (!s)
|
8089
|
-
throw n(!1), new
|
8095
|
+
throw n(!1), new Et(e);
|
8090
8096
|
return {
|
8091
8097
|
command: void 0,
|
8092
8098
|
followup: async () => {
|
@@ -8137,7 +8143,7 @@ class Es {
|
|
8137
8143
|
const u = e.getModelContainer();
|
8138
8144
|
if (u && t.option) {
|
8139
8145
|
const h = d.asset?.fileLink;
|
8140
|
-
if (!h) throw new
|
8146
|
+
if (!h) throw new Et(d);
|
8141
8147
|
await u.applyModelVariant(
|
8142
8148
|
t.stepName || "",
|
8143
8149
|
{
|
@@ -8161,7 +8167,7 @@ class Es {
|
|
8161
8167
|
n(!0);
|
8162
8168
|
const i = e.asset?.fileLink;
|
8163
8169
|
if (!i)
|
8164
|
-
throw new
|
8170
|
+
throw new Et(e);
|
8165
8171
|
return {
|
8166
8172
|
command: void 0,
|
8167
8173
|
followup: async () => {
|
@@ -8338,7 +8344,7 @@ class Bs {
|
|
8338
8344
|
async selectVariantCommand(t, e, a, n) {
|
8339
8345
|
const i = e.asset;
|
8340
8346
|
if (!i)
|
8341
|
-
throw new
|
8347
|
+
throw new Et(e);
|
8342
8348
|
const s = i?.fileLink;
|
8343
8349
|
if (!s)
|
8344
8350
|
return console.error("No URL for picture!"), null;
|
@@ -8661,7 +8667,7 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
|
|
8661
8667
|
return [null, null];
|
8662
8668
|
}, fe = (r, t, e, a, n) => {
|
8663
8669
|
let i, s;
|
8664
|
-
const o =
|
8670
|
+
const o = Ct(t.assetUrl), l = o.getFont();
|
8665
8671
|
if (n.size) {
|
8666
8672
|
const u = r / l.unitsPerEm;
|
8667
8673
|
return [i, s] = Ye(e, a, r, u, o), [n.size, i, s];
|
@@ -8696,7 +8702,7 @@ class ks {
|
|
8696
8702
|
/(\r\n|\r|(\u2665|\u00a9|\u00ae|[\u2000-\u2017]|[\u201E-\u3300]]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]))/gm,
|
8697
8703
|
""
|
8698
8704
|
);
|
8699
|
-
const n = [], i = e ?
|
8705
|
+
const n = [], i = e ? Ct(e.assetUrl) : void 0;
|
8700
8706
|
if (i) {
|
8701
8707
|
const s = a.split("").filter((l) => !xs.includes(l)).join(""), o = s.split("").map((l) => i.getFont().charToGlyph(l));
|
8702
8708
|
for (let l = 0; l < o.length; l++)
|
@@ -8982,7 +8988,7 @@ class ks {
|
|
8982
8988
|
u,
|
8983
8989
|
async () => {
|
8984
8990
|
e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
|
8985
|
-
const g = o.map((S) => new
|
8991
|
+
const g = o.map((S) => new Wa(S.id, A)), C = new R(g);
|
8986
8992
|
e.getCommandDispatcher()(C);
|
8987
8993
|
}
|
8988
8994
|
), o.length === 0 && l) {
|
@@ -9072,7 +9078,7 @@ class ks {
|
|
9072
9078
|
async fontDataFromVariant(t) {
|
9073
9079
|
const e = t.asset;
|
9074
9080
|
if (!e)
|
9075
|
-
throw new
|
9081
|
+
throw new Et(t);
|
9076
9082
|
const a = e.fileLink;
|
9077
9083
|
if (!a)
|
9078
9084
|
throw new Yt(e);
|
@@ -9085,7 +9091,7 @@ class ks {
|
|
9085
9091
|
async selectVariantCommand(t, e, a, n, i, s, o, l, c) {
|
9086
9092
|
const d = i.markUpdatePending(), A = await this.fontDataFromVariant(e);
|
9087
9093
|
if (n.length > 0) {
|
9088
|
-
const u = n.map((p) => new
|
9094
|
+
const u = n.map((p) => new Wa(p.id, A));
|
9089
9095
|
if (l) {
|
9090
9096
|
const p = n.map((g) => new je(g.id, l));
|
9091
9097
|
u.push(...p);
|
@@ -9345,7 +9351,7 @@ function $s(r, t, e, a) {
|
|
9345
9351
|
const n = e / r, i = a / t;
|
9346
9352
|
return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
|
9347
9353
|
}
|
9348
|
-
const
|
9354
|
+
const ja = {
|
9349
9355
|
m: ["x", "y"],
|
9350
9356
|
z: [],
|
9351
9357
|
l: ["x", "y"],
|
@@ -9375,7 +9381,7 @@ class Us {
|
|
9375
9381
|
const n = (i) => {
|
9376
9382
|
const s = [], o = i.relative ? i.type : i.type.toUpperCase();
|
9377
9383
|
let l = e !== o;
|
9378
|
-
const c =
|
9384
|
+
const c = ja[i.type];
|
9379
9385
|
l && (s.push(o), e = o);
|
9380
9386
|
for (const d of c) {
|
9381
9387
|
const A = i[d];
|
@@ -9400,7 +9406,7 @@ class Us {
|
|
9400
9406
|
const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
|
9401
9407
|
let i;
|
9402
9408
|
for (e.lastIndex = 0; i = e.exec(t); ) {
|
9403
|
-
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c =
|
9409
|
+
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = ja[s];
|
9404
9410
|
if (o.length < c.length)
|
9405
9411
|
throw new Dt(
|
9406
9412
|
`Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
|
@@ -9606,7 +9612,7 @@ const re = w`
|
|
9606
9612
|
name
|
9607
9613
|
}
|
9608
9614
|
}
|
9609
|
-
`,
|
9615
|
+
`, ba = w`
|
9610
9616
|
${Ws}
|
9611
9617
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
9612
9618
|
id
|
@@ -9617,7 +9623,7 @@ const re = w`
|
|
9617
9623
|
}
|
9618
9624
|
}
|
9619
9625
|
`, ie = (r) => w`
|
9620
|
-
${r ?
|
9626
|
+
${r ? ba : ""}
|
9621
9627
|
fragment ProductCollectionFields on ProductCollection {
|
9622
9628
|
id
|
9623
9629
|
name
|
@@ -9730,7 +9736,7 @@ const re = w`
|
|
9730
9736
|
quoteId
|
9731
9737
|
}
|
9732
9738
|
}
|
9733
|
-
`,
|
9739
|
+
`, Ha = w`
|
9734
9740
|
query GetBundleStakeholders($id: String!) {
|
9735
9741
|
bundles(ids: [$id]) {
|
9736
9742
|
id
|
@@ -9805,7 +9811,7 @@ const re = w`
|
|
9805
9811
|
}
|
9806
9812
|
}
|
9807
9813
|
`, Hs = w`
|
9808
|
-
${
|
9814
|
+
${ba}
|
9809
9815
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
9810
9816
|
productCollections(ids: [$id], productIds: $productIds) {
|
9811
9817
|
id
|
@@ -9838,7 +9844,7 @@ const re = w`
|
|
9838
9844
|
}
|
9839
9845
|
}
|
9840
9846
|
`, Js = w`
|
9841
|
-
${
|
9847
|
+
${ba}
|
9842
9848
|
query GetProductCollectionForProductsFeed(
|
9843
9849
|
$id: String!
|
9844
9850
|
$limit: Int
|
@@ -10219,7 +10225,7 @@ const re = w`
|
|
10219
10225
|
`;
|
10220
10226
|
var $e = /* @__PURE__ */ ((r) => (r.Error = "Error", r.Warning = "Warning", r.Info = "Info", r))($e || {});
|
10221
10227
|
const wo = 1e3;
|
10222
|
-
class
|
10228
|
+
class Ya extends Fn {
|
10223
10229
|
constructor(t) {
|
10224
10230
|
super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
|
10225
10231
|
}
|
@@ -10233,7 +10239,7 @@ class Ja extends xn {
|
|
10233
10239
|
}
|
10234
10240
|
class yo {
|
10235
10241
|
constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, p, g = !1, C = !1, S = !1) {
|
10236
|
-
this.workflowStatePromiseQueue = new
|
10242
|
+
this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
|
10237
10243
|
if (!this.previewService) return;
|
10238
10244
|
const b = this.getCommandContext().getAllLayouts(), I = this.getLayoutPreviewService()?.getAll();
|
10239
10245
|
if (I)
|
@@ -10648,9 +10654,9 @@ class yo {
|
|
10648
10654
|
...this.storage,
|
10649
10655
|
[t]: { ...this.storage[t], ...e }
|
10650
10656
|
};
|
10651
|
-
if (!
|
10657
|
+
if (!cn(a, this.storage)) {
|
10652
10658
|
this.storage = a;
|
10653
|
-
const n = new
|
10659
|
+
const n = new Ga(this.constructSerializableWorkflow());
|
10654
10660
|
this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
10655
10661
|
}
|
10656
10662
|
}
|
@@ -10669,7 +10675,7 @@ class yo {
|
|
10669
10675
|
if (this.readOnly) return;
|
10670
10676
|
const t = this.serialize();
|
10671
10677
|
this.workflowStatePromiseQueue.enqueue(
|
10672
|
-
new
|
10678
|
+
new Ya(async () => {
|
10673
10679
|
await new Promise((e) => {
|
10674
10680
|
setTimeout(() => {
|
10675
10681
|
e();
|
@@ -10686,7 +10692,7 @@ class yo {
|
|
10686
10692
|
async updateStateWithServerImmediate() {
|
10687
10693
|
if (this.readOnly) return;
|
10688
10694
|
const t = this.serialize();
|
10689
|
-
return new
|
10695
|
+
return new Ya(async () => {
|
10690
10696
|
await this.updateTransaction({
|
10691
10697
|
variables: {
|
10692
10698
|
id: this.transaction.id,
|
@@ -10699,7 +10705,7 @@ class yo {
|
|
10699
10705
|
const t = this.getCommandContext().getState();
|
10700
10706
|
if (!t)
|
10701
10707
|
throw new V("Attempted to serialize state before it was initialized.");
|
10702
|
-
const e =
|
10708
|
+
const e = vt(t.transaction), a = this.dehydrateState(e);
|
10703
10709
|
return JSON.stringify(a);
|
10704
10710
|
}
|
10705
10711
|
/**
|
@@ -10735,12 +10741,12 @@ class yo {
|
|
10735
10741
|
this.stepElements = e(this.stepElements, t);
|
10736
10742
|
}
|
10737
10743
|
getInvalidCanvasRegions() {
|
10738
|
-
return this.workflow.steps.reduce((t, e) => (
|
10744
|
+
return this.workflow.steps.reduce((t, e) => (St(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
|
10739
10745
|
(a) => t.push(a)
|
10740
10746
|
), t), []);
|
10741
10747
|
}
|
10742
10748
|
getInvalidModelVariants() {
|
10743
|
-
return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !
|
10749
|
+
return this.workflow.steps.reduce((t, e) => (e.type === v.Model && !St(e, this.stepSelections) && t.push(e.stepName), t), []);
|
10744
10750
|
}
|
10745
10751
|
async stepElementsForIntroducedSilentSteps(t, e) {
|
10746
10752
|
const a = this.product;
|
@@ -10748,10 +10754,10 @@ class yo {
|
|
10748
10754
|
return Promise.resolve({ stepElements: {}, commands: [] });
|
10749
10755
|
const n = async (c, d, A) => {
|
10750
10756
|
if (c.type === v.SilentIllustration) {
|
10751
|
-
const u = await new
|
10757
|
+
const u = await new qa(c, d).trigger();
|
10752
10758
|
return { step: c, results: u };
|
10753
10759
|
} else if (c.type === v.ProductOverlay) {
|
10754
|
-
const u = await new
|
10760
|
+
const u = await new qa(
|
10755
10761
|
c,
|
10756
10762
|
d,
|
10757
10763
|
A
|
@@ -10840,13 +10846,13 @@ class yo {
|
|
10840
10846
|
...this.stepSelections,
|
10841
10847
|
[t]: { selectedVariants: e }
|
10842
10848
|
}, this.selectionCost = Object.values(this.stepSelections).reduce((f, E) => f + E.selectedVariants.map((P) => P.priceModifier || 0).reduce((P, B) => P + B, 0), 0), this.workflow.steps.forEach((f) => {
|
10843
|
-
|
10849
|
+
St(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1, delete this.stepMetadata[f.stepName], delete this.stepSelections[f.stepName], delete this.storage[f.stepName]);
|
10844
10850
|
});
|
10845
10851
|
const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((f) => f.silentSteps).flat(), A = l.map((f) => f.silentSteps).flat().filter(
|
10846
10852
|
(f) => !c.some((E) => E.stepName === f.stepName)
|
10847
10853
|
);
|
10848
10854
|
c.forEach((f) => {
|
10849
|
-
|
10855
|
+
St(f, this.stepSelections) || (this.stepInitialised[f.stepName] = !1);
|
10850
10856
|
});
|
10851
10857
|
const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
|
10852
10858
|
this.stepElements = {
|
@@ -10856,7 +10862,7 @@ class yo {
|
|
10856
10862
|
}, this.removeElements(u);
|
10857
10863
|
const p = this.workflow.steps.find((f) => f.stepName === t);
|
10858
10864
|
p?.type === v.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((E) => E.id));
|
10859
|
-
const g = u.map((f) => new bt(f.id)), C = new
|
10865
|
+
const g = u.map((f) => new bt(f.id)), C = new Ga(this.constructSerializableWorkflow()), S = [...m, ...g, C];
|
10860
10866
|
S.length > 0 && this.commandContext.apply(new R(S), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
10861
10867
|
const b = this.getInvalidModelVariants(), I = this.modelContainer;
|
10862
10868
|
if (I) {
|
@@ -10888,7 +10894,7 @@ class yo {
|
|
10888
10894
|
);
|
10889
10895
|
break;
|
10890
10896
|
case v.Frame:
|
10891
|
-
a.push(
|
10897
|
+
a.push(yt.init(l, this, this.reloadedState));
|
10892
10898
|
break;
|
10893
10899
|
case v.Illustration:
|
10894
10900
|
a.push(
|
@@ -11819,7 +11825,7 @@ const To = async (r, t) => {
|
|
11819
11825
|
headers: e
|
11820
11826
|
}
|
11821
11827
|
})).data?.designCreateMany;
|
11822
|
-
},
|
11828
|
+
}, Ja = (r, t, e) => {
|
11823
11829
|
const a = (i) => {
|
11824
11830
|
const s = {};
|
11825
11831
|
if (i.type === "Frame") {
|
@@ -11903,7 +11909,7 @@ const To = async (r, t) => {
|
|
11903
11909
|
if (c !== void 0) return c;
|
11904
11910
|
await r.outstandingRequestsPromise();
|
11905
11911
|
const F = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), T = await y.getShadowGraphqlClient().query({
|
11906
|
-
query:
|
11912
|
+
query: Pn,
|
11907
11913
|
variables: { ids: [n.id] },
|
11908
11914
|
fetchPolicy: "no-cache",
|
11909
11915
|
errorPolicy: "all",
|
@@ -11915,7 +11921,7 @@ const To = async (r, t) => {
|
|
11915
11921
|
T.errors && console.log("Server Error:", et.message);
|
11916
11922
|
}), null) : tt ?? null;
|
11917
11923
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
|
11918
|
-
const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l &&
|
11924
|
+
const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && Ja(l, t, !0), g = l && Ja(l, t, !1), C = async (B) => {
|
11919
11925
|
const F = {};
|
11920
11926
|
let Q = 0;
|
11921
11927
|
if (Object.keys(i).length > 0)
|
@@ -11924,12 +11930,12 @@ const To = async (r, t) => {
|
|
11924
11930
|
for (let W = 0; W < tt.selections.length; ++W) {
|
11925
11931
|
const q = tt.selections[W];
|
11926
11932
|
if (et && (!B || et.option && (et.option.variants || []).length > 1 && !et.data.hideSelectionInCart && !et.data.hideSelectionsInCart)) {
|
11927
|
-
const
|
11928
|
-
F[
|
11933
|
+
const wt = et.stepTitle;
|
11934
|
+
F[wt] ? F[wt].push({
|
11929
11935
|
id: q.id || "",
|
11930
11936
|
name: q.name,
|
11931
11937
|
priceModifier: q.priceModifier
|
11932
|
-
}) : F[
|
11938
|
+
}) : F[wt] = [
|
11933
11939
|
{
|
11934
11940
|
id: q.id || "",
|
11935
11941
|
name: q.name,
|
@@ -12026,7 +12032,7 @@ const To = async (r, t) => {
|
|
12026
12032
|
);
|
12027
12033
|
const n = await (async () => {
|
12028
12034
|
const l = await y.getShadowGraphqlClient().query({
|
12029
|
-
query:
|
12035
|
+
query: Pn,
|
12030
12036
|
variables: { ids: r.map((c) => c.transaction.id) },
|
12031
12037
|
fetchPolicy: "no-cache",
|
12032
12038
|
errorPolicy: "all"
|
@@ -12179,7 +12185,7 @@ const Ke = new $o(), Uo = w`
|
|
12179
12185
|
var zo = /* @__PURE__ */ ((r) => (r.QuantityChanged = "QuantityChanged", r.PriceBreakChanged = "PriceBreakChanged", r))(zo || {});
|
12180
12186
|
class Go {
|
12181
12187
|
constructor(t, e) {
|
12182
|
-
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate =
|
12188
|
+
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = dn(async () => {
|
12183
12189
|
await Ke.getSavedDesignByTransaction(
|
12184
12190
|
this.getWorkflowManager().getTransaction().id
|
12185
12191
|
) && this.save();
|
@@ -12300,13 +12306,13 @@ class Go {
|
|
12300
12306
|
}, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
|
12301
12307
|
if (!h)
|
12302
12308
|
throw new ke("Failed to obtain 2D context for preview image creation");
|
12303
|
-
const m = this.workflowManager.getTemplatingContext(), p =
|
12309
|
+
const m = this.workflowManager.getTemplatingContext(), p = ya(u.layoutState.layout, u.layoutState.elements, {
|
12304
12310
|
renderingConfiguration: {
|
12305
12311
|
purpose: Ht.Print,
|
12306
12312
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
12307
12313
|
templatingContext: m
|
12308
12314
|
}
|
12309
|
-
}), g =
|
12315
|
+
}), g = mn(p);
|
12310
12316
|
await (await Aa.from(h, g, {
|
12311
12317
|
anonymousCrossOrigin: !0,
|
12312
12318
|
ignoreDimensions: !1,
|
@@ -12333,7 +12339,7 @@ class Go {
|
|
12333
12339
|
getStepsConditionallyActive() {
|
12334
12340
|
return this.getScenes().flatMap(
|
12335
12341
|
(t) => this.getStepsByScene(t).filter(
|
12336
|
-
(e) =>
|
12342
|
+
(e) => St(e.getRaw(), this.getWorkflowManager().getStepSelections())
|
12337
12343
|
)
|
12338
12344
|
);
|
12339
12345
|
}
|
@@ -12484,7 +12490,7 @@ class Go {
|
|
12484
12490
|
return await Ke.addDesign(n), n;
|
12485
12491
|
}
|
12486
12492
|
async copy() {
|
12487
|
-
const t =
|
12493
|
+
const t = vt(this.getCommandContext().getState());
|
12488
12494
|
if (!t) throw new V("Internal state is undefined! Cannot copy experience!");
|
12489
12495
|
const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = this.getWorkflowManager().getTransaction().integrationProduct?.id;
|
12490
12496
|
if (!n) throw new V("Integration product id is undefined!");
|
@@ -12671,8 +12677,8 @@ const Wo = (r) => {
|
|
12671
12677
|
"tspan"
|
12672
12678
|
], Ho = async (r, t, e) => {
|
12673
12679
|
const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
|
12674
|
-
o.searchParams.append("video",
|
12675
|
-
const l = o.toString(), d = `data:image/svg+xml;base64,${
|
12680
|
+
o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
|
12681
|
+
const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await ln(l, { type: "svg" }))}`, A = (h) => {
|
12676
12682
|
const m = r.find((g) => g.panelId === h.panelId);
|
12677
12683
|
if (!m)
|
12678
12684
|
throw new Y(h);
|
@@ -12705,7 +12711,7 @@ const Wo = (r) => {
|
|
12705
12711
|
const d = await Un(c, o?.asset?.fileLink), A = await Oe(d), u = M(), h = r.find((p) => p.panelId === c.panelId);
|
12706
12712
|
if (!h)
|
12707
12713
|
throw new Y(c);
|
12708
|
-
const m =
|
12714
|
+
const m = va(
|
12709
12715
|
s,
|
12710
12716
|
A,
|
12711
12717
|
{
|
@@ -13202,7 +13208,7 @@ const rl = () => new Promise((r, t) => {
|
|
13202
13208
|
}), il = rl();
|
13203
13209
|
class sl {
|
13204
13210
|
constructor(t, e, a, n, i) {
|
13205
|
-
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.renderQueue = new
|
13211
|
+
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.renderQueue = new xn(2), this.id = t, this.name = e, this.service = a, this.panelSize = n, this.getWorkflowManager = i;
|
13206
13212
|
}
|
13207
13213
|
getID() {
|
13208
13214
|
return this.id;
|
@@ -13248,7 +13254,7 @@ class sl {
|
|
13248
13254
|
* Actions to perform when a static render event is fired for this canvas.
|
13249
13255
|
*/
|
13250
13256
|
async render(t) {
|
13251
|
-
const e =
|
13257
|
+
const e = vt(t);
|
13252
13258
|
this.lastRequestedRenderArguments = e;
|
13253
13259
|
const a = this.getStaticContext();
|
13254
13260
|
if (!a) {
|
@@ -13269,7 +13275,7 @@ class sl {
|
|
13269
13275
|
);
|
13270
13276
|
}
|
13271
13277
|
}
|
13272
|
-
class ol extends
|
13278
|
+
class ol extends Fn {
|
13273
13279
|
constructor(t, e, a, n, i, s) {
|
13274
13280
|
super(), this.layoutId = t, this.ctx = e, this.nonPOTSupport = a, this.onRender = n, this.layouts = i, this.getWorkflowManager = s;
|
13275
13281
|
}
|
@@ -13319,12 +13325,12 @@ class ol extends xn {
|
|
13319
13325
|
l = g.width, c = g.height;
|
13320
13326
|
} else
|
13321
13327
|
l = i.width, c = i.height;
|
13322
|
-
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A =
|
13328
|
+
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = ya(t.layoutState.layout, e, {
|
13323
13329
|
renderingConfiguration: {
|
13324
13330
|
purpose: Ht.ThreeD,
|
13325
13331
|
templatingContext: d
|
13326
13332
|
}
|
13327
|
-
}), u =
|
13333
|
+
}), u = mn(A), h = await Aa.from(this.ctx, u, {
|
13328
13334
|
anonymousCrossOrigin: !0,
|
13329
13335
|
ignoreDimensions: !this.nonPOTSupport,
|
13330
13336
|
ignoreAnimation: !0,
|
@@ -13403,14 +13409,14 @@ class ll {
|
|
13403
13409
|
case L.FileUpload:
|
13404
13410
|
return new cl(this.bundle, t).initialize();
|
13405
13411
|
case L.ColorOption:
|
13406
|
-
return new
|
13412
|
+
return new Ka(
|
13407
13413
|
this.bundle,
|
13408
13414
|
t,
|
13409
13415
|
t.entityId ? await H.getOption(t.entityId) : void 0
|
13410
13416
|
);
|
13411
13417
|
case L.Option: {
|
13412
13418
|
const e = t.entityId ? await H.getOption(t.entityId) : void 0;
|
13413
|
-
return e?.type === "Color" ? new
|
13419
|
+
return e?.type === "Color" ? new Ka(this.bundle, t, e) : new tr(this.bundle, t, e);
|
13414
13420
|
}
|
13415
13421
|
case L.Text:
|
13416
13422
|
return new dl(this.bundle, t);
|
@@ -13419,7 +13425,7 @@ class ll {
|
|
13419
13425
|
}
|
13420
13426
|
}
|
13421
13427
|
}
|
13422
|
-
class
|
13428
|
+
class Ba {
|
13423
13429
|
constructor(t, e) {
|
13424
13430
|
this.bundle = t, this.property = e;
|
13425
13431
|
}
|
@@ -13480,7 +13486,7 @@ class Ia {
|
|
13480
13486
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
13481
13487
|
}
|
13482
13488
|
}
|
13483
|
-
class cl extends
|
13489
|
+
class cl extends Ba {
|
13484
13490
|
constructor(t, e) {
|
13485
13491
|
super(t, e);
|
13486
13492
|
}
|
@@ -13491,7 +13497,7 @@ class cl extends Ia {
|
|
13491
13497
|
const t = await this.getImage();
|
13492
13498
|
if (t?.fileLink)
|
13493
13499
|
if (t?.fileLink.endsWith(".svg")) {
|
13494
|
-
const e = await nt(t?.fileLink), a = await
|
13500
|
+
const e = await nt(t?.fileLink), a = await Ea(t?.fileLink), n = a.width, i = a.height, s = await ot(e);
|
13495
13501
|
this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach((c) => {
|
13496
13502
|
s.colors[c.key] = {
|
13497
13503
|
browserValue: c.browserValue,
|
@@ -13706,7 +13712,7 @@ class cl extends Ia {
|
|
13706
13712
|
);
|
13707
13713
|
}
|
13708
13714
|
}
|
13709
|
-
class dl extends
|
13715
|
+
class dl extends Ba {
|
13710
13716
|
constructor(t, e) {
|
13711
13717
|
super(t, e);
|
13712
13718
|
}
|
@@ -13745,7 +13751,7 @@ class dl extends Ia {
|
|
13745
13751
|
await Promise.all(n);
|
13746
13752
|
}
|
13747
13753
|
}
|
13748
|
-
class tr extends
|
13754
|
+
class tr extends Ba {
|
13749
13755
|
constructor(t, e, a) {
|
13750
13756
|
super(t, e), this.optionResource = a;
|
13751
13757
|
}
|
@@ -13807,7 +13813,7 @@ class tr extends Ia {
|
|
13807
13813
|
await Promise.all(n);
|
13808
13814
|
}
|
13809
13815
|
}
|
13810
|
-
class
|
13816
|
+
class Ka extends tr {
|
13811
13817
|
constructor(t, e, a) {
|
13812
13818
|
super(t, e, a);
|
13813
13819
|
}
|
@@ -13908,7 +13914,7 @@ class hl {
|
|
13908
13914
|
}
|
13909
13915
|
async setGlobalPropertyState(t) {
|
13910
13916
|
this.globalPropertyState || await this.initPromise;
|
13911
|
-
const e =
|
13917
|
+
const e = vt(this.globalPropertyState);
|
13912
13918
|
this.globalPropertyState = { ...t, id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
|
13913
13919
|
}
|
13914
13920
|
getAspectMandatoryFulfilled(t) {
|
@@ -13935,7 +13941,7 @@ class hl {
|
|
13935
13941
|
if (!i)
|
13936
13942
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
13937
13943
|
this.mandatoryFulfilledAspects.set(t, e !== "");
|
13938
|
-
const s =
|
13944
|
+
const s = vt(this.globalPropertyState), o = this.globalPropertyState.aspects.filter((l) => l.name === t);
|
13939
13945
|
if (o.length > 0)
|
13940
13946
|
if (n) {
|
13941
13947
|
const l = o.find((c) => c.channel === n);
|
@@ -13978,7 +13984,7 @@ class hl {
|
|
13978
13984
|
const n = this.configuration.aspects.find((o) => o.name === t);
|
13979
13985
|
if (!n)
|
13980
13986
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
13981
|
-
const i =
|
13987
|
+
const i = vt(this.globalPropertyState), s = this.globalPropertyState.aspects.filter((o) => o.name === t);
|
13982
13988
|
if (s.length > 0)
|
13983
13989
|
if (a) {
|
13984
13990
|
const o = s.find((l) => l.channel === a);
|
@@ -14375,7 +14381,7 @@ class ar {
|
|
14375
14381
|
if (u || m.partial && (!m.data.productCollections || m.data.productCollections.length === 0 || !m.data.productCollections[0].productCollectionProductsFeed?.items || m.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
|
14376
14382
|
return;
|
14377
14383
|
l.abort(), u = !0, h.unsubscribe();
|
14378
|
-
const p = m.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((g) => !!g.product).map((g) => new Ae(
|
14384
|
+
const p = m.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((g) => !!g.product).map((g) => new Ae(vt(g))) || [];
|
14379
14385
|
A({
|
14380
14386
|
items: p,
|
14381
14387
|
// Clone items because it could be cached data (immutable)
|
@@ -15124,7 +15130,7 @@ class _e {
|
|
15124
15130
|
}
|
15125
15131
|
async getAllStakeholders() {
|
15126
15132
|
const t = await y.getShadowGraphqlClient().query({
|
15127
|
-
query:
|
15133
|
+
query: Ha,
|
15128
15134
|
errorPolicy: "all",
|
15129
15135
|
fetchPolicy: "no-cache",
|
15130
15136
|
variables: {
|
@@ -15140,7 +15146,7 @@ class _e {
|
|
15140
15146
|
}
|
15141
15147
|
async getCurrentStakeholder() {
|
15142
15148
|
const t = await y.getShadowGraphqlClient().query({
|
15143
|
-
query:
|
15149
|
+
query: Ha,
|
15144
15150
|
errorPolicy: "all",
|
15145
15151
|
fetchPolicy: "no-cache",
|
15146
15152
|
variables: {
|
@@ -15544,7 +15550,7 @@ class ue {
|
|
15544
15550
|
return this.getArtifacts().get(t);
|
15545
15551
|
}
|
15546
15552
|
}
|
15547
|
-
class
|
15553
|
+
class Ia {
|
15548
15554
|
constructor(t) {
|
15549
15555
|
this.value = t;
|
15550
15556
|
}
|
@@ -15557,12 +15563,12 @@ class Pa {
|
|
15557
15563
|
}
|
15558
15564
|
}
|
15559
15565
|
var Fl = /* @__PURE__ */ ((r) => (r.Transaction = "Transaction", r.Bundle = "Bundle", r.Product = "Product", r.Variant = "Variant", r.Option = "Option", r.LineItem = "LineItem", r.Asset = "Asset", r))(Fl || {});
|
15560
|
-
class Ad extends
|
15566
|
+
class Ad extends Ia {
|
15561
15567
|
constructor(t) {
|
15562
15568
|
super(`"${t}"`);
|
15563
15569
|
}
|
15564
15570
|
}
|
15565
|
-
class nr extends
|
15571
|
+
class nr extends Ia {
|
15566
15572
|
constructor(t, e) {
|
15567
15573
|
if (e !== "Asset" && !nr.validUUID(t))
|
15568
15574
|
throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");
|
@@ -15572,12 +15578,12 @@ class nr extends Pa {
|
|
15572
15578
|
return t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
|
15573
15579
|
}
|
15574
15580
|
}
|
15575
|
-
class ud extends
|
15581
|
+
class ud extends Ia {
|
15576
15582
|
constructor(t) {
|
15577
15583
|
super(`[${t.map((e) => e.getRaw()).join(",")}]`);
|
15578
15584
|
}
|
15579
15585
|
}
|
15580
|
-
class
|
15586
|
+
class _a {
|
15581
15587
|
constructor(t) {
|
15582
15588
|
this.integrationProduct = t;
|
15583
15589
|
}
|
@@ -15765,7 +15771,7 @@ class Nl {
|
|
15765
15771
|
}
|
15766
15772
|
async generateCode(t) {
|
15767
15773
|
const e = await this.cognitoClient?.send(
|
15768
|
-
new
|
15774
|
+
new xa({
|
15769
15775
|
AuthFlow: "CUSTOM_AUTH",
|
15770
15776
|
ClientId: this.userPoolClientId,
|
15771
15777
|
AuthParameters: {
|
@@ -15799,7 +15805,7 @@ class Nl {
|
|
15799
15805
|
throw new Error("Failed to find existing tokens.");
|
15800
15806
|
const e = JSON.parse(t);
|
15801
15807
|
return await this.cognitoClient?.send(
|
15802
|
-
new
|
15808
|
+
new xa({
|
15803
15809
|
AuthFlow: "REFRESH_TOKEN_AUTH",
|
15804
15810
|
ClientId: this.userPoolClientId,
|
15805
15811
|
AuthParameters: {
|
@@ -15829,7 +15835,7 @@ class Ql {
|
|
15829
15835
|
* @param currency The currency to determine precision for.
|
15830
15836
|
*/
|
15831
15837
|
getPrecisionForCurrency(t) {
|
15832
|
-
const e = t, a =
|
15838
|
+
const e = t, a = ka.code(e);
|
15833
15839
|
return a ? a.digits : 2;
|
15834
15840
|
}
|
15835
15841
|
/**
|
@@ -15840,11 +15846,11 @@ class Ql {
|
|
15840
15846
|
*/
|
15841
15847
|
getSpecialFormat(t) {
|
15842
15848
|
const e = t;
|
15843
|
-
if (
|
15849
|
+
if (ka.code(e)?.code === "CLP")
|
15844
15850
|
return "USD0,0";
|
15845
15851
|
}
|
15846
15852
|
}
|
15847
|
-
const
|
15853
|
+
const Xa = new Ql();
|
15848
15854
|
class Rl {
|
15849
15855
|
constructor(t, e, a, n) {
|
15850
15856
|
this.presentmentCurrency = void 0, this.presentmentCurrency = n, this.partnerCurrency = a, this.rateFrom = t, this.rateTo = e;
|
@@ -15876,13 +15882,13 @@ class Rl {
|
|
15876
15882
|
* Converts a monetary value from the database to the units of its currency.
|
15877
15883
|
*/
|
15878
15884
|
units(t, e) {
|
15879
|
-
return t / Math.pow(10,
|
15885
|
+
return t / Math.pow(10, Xa.getPrecisionForCurrency(e));
|
15880
15886
|
}
|
15881
15887
|
/**
|
15882
15888
|
* Converts a monetary value in units to the subunits of its currency.
|
15883
15889
|
*/
|
15884
15890
|
subunits(t, e) {
|
15885
|
-
return t * Math.pow(10,
|
15891
|
+
return t * Math.pow(10, Xa.getPrecisionForCurrency(e));
|
15886
15892
|
}
|
15887
15893
|
}
|
15888
15894
|
const Ol = async (r, t) => {
|
@@ -15949,7 +15955,7 @@ class md {
|
|
15949
15955
|
} catch (a) {
|
15950
15956
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15951
15957
|
}
|
15952
|
-
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.
|
15958
|
+
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15953
15959
|
}
|
15954
15960
|
configure(t) {
|
15955
15961
|
gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && zr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
@@ -16461,7 +16467,7 @@ class md {
|
|
16461
16467
|
}));
|
16462
16468
|
}, s = t.map((f, E) => ({ option: f, index: E })), o = s.filter((f) => f.option.type === "transaction"), l = s.filter(
|
16463
16469
|
(f) => f.option.type === "integration" || f.option.type === "external"
|
16464
|
-
), c =
|
16470
|
+
), c = Fa(o, 10), d = Fa(l, 10), A = (await Promise.all([
|
16465
16471
|
...c.map(n),
|
16466
16472
|
...d.map(i)
|
16467
16473
|
])).flat(), u = [...new Set(A.map((f) => f.workflowId))], h = await rr(u, e), m = new Map(h.map((f) => [f.id, f])), p = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), g = A.map(async (f) => {
|
@@ -16488,10 +16494,10 @@ class md {
|
|
16488
16494
|
};
|
16489
16495
|
if (T.type === "transaction" && E.workflowState) {
|
16490
16496
|
const q = JSON.parse(E.workflowState);
|
16491
|
-
W.layouts = Object.values(q.layouts || {}).map((
|
16497
|
+
W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await za(q), W.reloadedState = q;
|
16492
16498
|
} else if (!B && T.workflowState) {
|
16493
16499
|
const q = JSON.parse(T.workflowState);
|
16494
|
-
W.layouts = Object.values(q.layouts || {}).map((
|
16500
|
+
W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await za(q), W.reloadedState = q;
|
16495
16501
|
} else
|
16496
16502
|
W.layouts = Ll(
|
16497
16503
|
W.transaction,
|
@@ -16523,7 +16529,7 @@ class md {
|
|
16523
16529
|
})).data?.integrationProducts;
|
16524
16530
|
if (!i || i.length === 0 || !i[0]?.id)
|
16525
16531
|
throw new Error("Integration product not found.");
|
16526
|
-
return new
|
16532
|
+
return new _a(i[0]);
|
16527
16533
|
}
|
16528
16534
|
async getIntegrationProductFromExternalIds(t, e, a) {
|
16529
16535
|
const s = (await y.getShadowGraphqlClient().query({
|
@@ -16537,7 +16543,7 @@ class md {
|
|
16537
16543
|
})).data?.integrationProductFromExternalIds;
|
16538
16544
|
if (!s?.id)
|
16539
16545
|
throw new Error("Integration product not found.");
|
16540
|
-
return new
|
16546
|
+
return new _a(s);
|
16541
16547
|
}
|
16542
16548
|
async getIntegrationProduct(t) {
|
16543
16549
|
return t.type === "integration" ? this.getIntegrationProductById(t.integrationProductId) : this.getIntegrationProductFromExternalIds(t.externalIntegrationId, t.externalProductId);
|
@@ -16634,7 +16640,7 @@ function me(r, t, e) {
|
|
16634
16640
|
}
|
16635
16641
|
class Gl {
|
16636
16642
|
constructor(t, e) {
|
16637
|
-
this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets =
|
16643
|
+
this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets = dn(this.updateFrameOffsets, 200), this.targetElements = [], this.onFrameDataChangeListeners = [], this.onZoomChangeListeners = [], this.forceImageCover = t, this.initialZoom = e, this.thresholdSettings = {
|
16638
16644
|
useThreshold: !1,
|
16639
16645
|
invertThreshold: !1,
|
16640
16646
|
threshold: 128,
|
@@ -16655,7 +16661,7 @@ class Gl {
|
|
16655
16661
|
let i = !1;
|
16656
16662
|
for (let s = 0; s < n.currentFrameSources.length; s++) {
|
16657
16663
|
const o = n.currentFrameSources[s], l = await Oe(o), c = this.frameData ? this.frameData[s] : void 0;
|
16658
|
-
|
16664
|
+
cn(l, c) || (this.frameData || (this.frameData = new Array(n.currentFrameSources.length)), this.frameData[s] = l, i = !0);
|
16659
16665
|
}
|
16660
16666
|
i && (this.onFrameDataChangeListeners.forEach(
|
16661
16667
|
(s) => s(this.frameData)
|
@@ -16844,7 +16850,7 @@ class Gl {
|
|
16844
16850
|
}
|
16845
16851
|
recalculateOffsets(t) {
|
16846
16852
|
this.frameData && ((!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length)), this.frameData.forEach((e, a) => {
|
16847
|
-
this.offsets[a] =
|
16853
|
+
this.offsets[a] = va(
|
16848
16854
|
t,
|
16849
16855
|
e,
|
16850
16856
|
this.initialZoom && !this.forceImageCover ? { scale: this.initialZoom } : void 0,
|
@@ -17024,7 +17030,7 @@ class ql extends Z {
|
|
17024
17030
|
}
|
17025
17031
|
selectVariant(t) {
|
17026
17032
|
const e = this.manager.getRegionElements(this.step.stepName);
|
17027
|
-
return
|
17033
|
+
return yt.selectVariant(
|
17028
17034
|
this.step,
|
17029
17035
|
t.getResource(),
|
17030
17036
|
e,
|
@@ -17044,7 +17050,7 @@ class ql extends Z {
|
|
17044
17050
|
* @param [recalculateOffsets=true] Optional: Recalculates the offsets of the image inside the frame. Default: `true`.
|
17045
17051
|
*/
|
17046
17052
|
async selectImage(t, e = !0, a = !0) {
|
17047
|
-
if (await
|
17053
|
+
if (await yt.selectImage(this.step, t, this.manager, a), e) {
|
17048
17054
|
const n = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
17049
17055
|
this.manager.updateStorage(this.step.stepName, {
|
17050
17056
|
framePatternData: {
|
@@ -17082,7 +17088,7 @@ class ql extends Z {
|
|
17082
17088
|
if (!e)
|
17083
17089
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
17084
17090
|
const a = await O.removeBackgroundFromAsset(e);
|
17085
|
-
t && await
|
17091
|
+
t && await yt.selectImage(this.step, a, this.manager, !1);
|
17086
17092
|
const n = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
17087
17093
|
return this.manager.updateStorage(this.step.stepName, {
|
17088
17094
|
framePatternData: {
|
@@ -17093,7 +17099,7 @@ class ql extends Z {
|
|
17093
17099
|
}), a;
|
17094
17100
|
}
|
17095
17101
|
changeColors(t) {
|
17096
|
-
|
17102
|
+
yt.changeColors(this.step, this.manager, t);
|
17097
17103
|
}
|
17098
17104
|
getImageData() {
|
17099
17105
|
if (this.frameService)
|
@@ -17103,7 +17109,7 @@ class ql extends Z {
|
|
17103
17109
|
return this.step.data.colorOption;
|
17104
17110
|
}
|
17105
17111
|
getAvailableColors() {
|
17106
|
-
return this.step.data.colorPickerEnabled ?
|
17112
|
+
return this.step.data.colorPickerEnabled ? yt.availableColors(this.step, this.manager) : Promise.resolve([]);
|
17107
17113
|
}
|
17108
17114
|
isColorPickerEnabled() {
|
17109
17115
|
return this.step.data.colorPickerEnabled ?? !1;
|
@@ -17116,7 +17122,7 @@ class ql extends Z {
|
|
17116
17122
|
return this.step.data.maxColors;
|
17117
17123
|
}
|
17118
17124
|
getUniqueColorCount() {
|
17119
|
-
return
|
17125
|
+
return yt.getUniqueColorCount(this.step, this.manager);
|
17120
17126
|
}
|
17121
17127
|
getCurrentFrameStep(t, e, a, n) {
|
17122
17128
|
return n && n.length > 1 && t === void 0 ? "SelectFrame" : e || a || this.getImageData() ? "Position" : "SelectImage";
|
@@ -17186,7 +17192,7 @@ const jl = w`
|
|
17186
17192
|
id
|
17187
17193
|
}
|
17188
17194
|
}
|
17189
|
-
`,
|
17195
|
+
`, Pa = w`
|
17190
17196
|
query GetCustomerTransactions(
|
17191
17197
|
$id: String!
|
17192
17198
|
$limit: Int!
|
@@ -17353,7 +17359,7 @@ const jl = w`
|
|
17353
17359
|
},
|
17354
17360
|
context: t
|
17355
17361
|
}), Pd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17356
|
-
query:
|
17362
|
+
query: Pa,
|
17357
17363
|
errorPolicy: "all",
|
17358
17364
|
fetchPolicy: "no-cache",
|
17359
17365
|
variables: {
|
@@ -17373,7 +17379,7 @@ const jl = w`
|
|
17373
17379
|
limit: t
|
17374
17380
|
}
|
17375
17381
|
}))?.data.customerTransactionsFeed?.items || [], Dd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17376
|
-
query:
|
17382
|
+
query: Pa,
|
17377
17383
|
errorPolicy: "all",
|
17378
17384
|
fetchPolicy: "no-cache",
|
17379
17385
|
variables: {
|
@@ -17393,7 +17399,7 @@ const jl = w`
|
|
17393
17399
|
limit: t
|
17394
17400
|
}
|
17395
17401
|
}))?.data.customerTransactionsFeed?.items || [], Fd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17396
|
-
query:
|
17402
|
+
query: Pa,
|
17397
17403
|
errorPolicy: "all",
|
17398
17404
|
fetchPolicy: "no-cache",
|
17399
17405
|
variables: {
|
@@ -17440,7 +17446,7 @@ K = { __e: function(r, t, e, a) {
|
|
17440
17446
|
}
|
17441
17447
|
throw r;
|
17442
17448
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
17443
|
-
var st, Xe,
|
17449
|
+
var st, Xe, Za, ir = [], Ze = [], tn = K.__b, en = K.__r, an = K.diffed, nn = K.__c, rn = K.unmount;
|
17444
17450
|
function ec() {
|
17445
17451
|
for (var r; r = ir.shift(); )
|
17446
17452
|
if (r.__P && r.__H)
|
@@ -17451,17 +17457,17 @@ function ec() {
|
|
17451
17457
|
}
|
17452
17458
|
}
|
17453
17459
|
K.__b = function(r) {
|
17454
|
-
st = null,
|
17460
|
+
st = null, tn && tn(r);
|
17455
17461
|
}, K.__r = function(r) {
|
17456
|
-
|
17462
|
+
en && en(r);
|
17457
17463
|
var t = (st = r.__c).__H;
|
17458
17464
|
t && (Xe === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
|
17459
17465
|
e.__N && (e.__ = e.__N), e.__V = Ze, e.__N = e.i = void 0;
|
17460
17466
|
})) : (t.__h.forEach(we), t.__h.forEach(da), t.__h = [])), Xe = st;
|
17461
17467
|
}, K.diffed = function(r) {
|
17462
|
-
|
17468
|
+
an && an(r);
|
17463
17469
|
var t = r.__c;
|
17464
|
-
t && t.__H && (t.__H.__h.length && (ir.push(t) !== 1 &&
|
17470
|
+
t && t.__H && (t.__H.__h.length && (ir.push(t) !== 1 && Za === K.requestAnimationFrame || ((Za = K.requestAnimationFrame) || ac)(ec)), t.__H.__.forEach(function(e) {
|
17465
17471
|
e.i && (e.__H = e.i), e.__V !== Ze && (e.__ = e.__V), e.i = void 0, e.__V = Ze;
|
17466
17472
|
})), Xe = st = null;
|
17467
17473
|
}, K.__c = function(r, t) {
|
@@ -17475,9 +17481,9 @@ K.__b = function(r) {
|
|
17475
17481
|
n.__h && (n.__h = []);
|
17476
17482
|
}), t = [], K.__e(a, e.__v);
|
17477
17483
|
}
|
17478
|
-
}),
|
17484
|
+
}), nn && nn(r, t);
|
17479
17485
|
}, K.unmount = function(r) {
|
17480
|
-
|
17486
|
+
rn && rn(r);
|
17481
17487
|
var t, e = r.__c;
|
17482
17488
|
e && e.__H && (e.__H.__.forEach(function(a) {
|
17483
17489
|
try {
|
@@ -17487,12 +17493,12 @@ K.__b = function(r) {
|
|
17487
17493
|
}
|
17488
17494
|
}), e.__H = void 0, t && K.__e(t, e.__v));
|
17489
17495
|
};
|
17490
|
-
var
|
17496
|
+
var sn = typeof requestAnimationFrame == "function";
|
17491
17497
|
function ac(r) {
|
17492
17498
|
var t, e = function() {
|
17493
|
-
clearTimeout(a),
|
17499
|
+
clearTimeout(a), sn && cancelAnimationFrame(t), setTimeout(r);
|
17494
17500
|
}, a = setTimeout(e, 100);
|
17495
|
-
|
17501
|
+
sn && (t = requestAnimationFrame(e));
|
17496
17502
|
}
|
17497
17503
|
function we(r) {
|
17498
17504
|
var t = st, e = r.__c;
|
@@ -17524,7 +17530,7 @@ const sr = w`
|
|
17524
17530
|
}
|
17525
17531
|
missingComponentTypes
|
17526
17532
|
}
|
17527
|
-
`,
|
17533
|
+
`, Da = w`
|
17528
17534
|
${sr}
|
17529
17535
|
fragment AddressValidationJobFields on AddressValidationJob {
|
17530
17536
|
id
|
@@ -17537,14 +17543,14 @@ const sr = w`
|
|
17537
17543
|
}
|
17538
17544
|
}
|
17539
17545
|
`, nc = w`
|
17540
|
-
${
|
17546
|
+
${Da}
|
17541
17547
|
query GetAddressValidationJobs($ids: [String!]!) {
|
17542
17548
|
addressValidationJobs(ids: $ids) {
|
17543
17549
|
...AddressValidationJobFields
|
17544
17550
|
}
|
17545
17551
|
}
|
17546
17552
|
`, rc = w`
|
17547
|
-
${
|
17553
|
+
${Da}
|
17548
17554
|
query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
|
17549
17555
|
recipients(ids: $ids) {
|
17550
17556
|
id
|
@@ -17561,7 +17567,7 @@ const sr = w`
|
|
17561
17567
|
}
|
17562
17568
|
}
|
17563
17569
|
`, sc = w`
|
17564
|
-
${
|
17570
|
+
${Da}
|
17565
17571
|
mutation BatchValidateRecipientAddress($ids: [String!]!) {
|
17566
17572
|
recipientValidateBatch(ids: $ids) {
|
17567
17573
|
...AddressValidationJobFields
|
@@ -17618,7 +17624,7 @@ export {
|
|
17618
17624
|
oc as AddressValidationResultConfirmationLevel,
|
17619
17625
|
ud as ArrayInput,
|
17620
17626
|
L as AspectType,
|
17621
|
-
|
17627
|
+
Et as AssetNotFoundError,
|
17622
17628
|
ye as AssetType,
|
17623
17629
|
id as BringForwardCommand,
|
17624
17630
|
rd as BringToBackCommand,
|
@@ -17626,7 +17632,7 @@ export {
|
|
17626
17632
|
br as BundleDesignCreationCartAddMode,
|
17627
17633
|
N as CanvasCommand,
|
17628
17634
|
Ae as CollectionProduct,
|
17629
|
-
|
17635
|
+
Ka as ColorOptionGlobalPropertyHandle,
|
17630
17636
|
ds as CommandContext,
|
17631
17637
|
Ce as ConversionDataType,
|
17632
17638
|
tc as ConversionLocation,
|
@@ -17643,16 +17649,16 @@ export {
|
|
17643
17649
|
ms as FontAlignmentCommand,
|
17644
17650
|
us as FontColorCommand,
|
17645
17651
|
hs as FontSizeCommand,
|
17646
|
-
|
17652
|
+
Wa as FontSourceCommand,
|
17647
17653
|
Gl as FrameService,
|
17648
17654
|
Wl as FrameStep,
|
17649
17655
|
ql as FrameStepHandle,
|
17650
|
-
|
17656
|
+
Ba as GlobalPropertyHandle,
|
17651
17657
|
R as GroupCommand,
|
17652
17658
|
So as IllustrationStepHandle,
|
17653
17659
|
$e as InformationMessageType,
|
17654
17660
|
Do as InformationStepHandle,
|
17655
|
-
|
17661
|
+
_a as IntegrationProduct,
|
17656
17662
|
Ir as IntegrationType,
|
17657
17663
|
Xc as LayoutElementFactory,
|
17658
17664
|
x as LayoutElementType,
|
@@ -17675,9 +17681,9 @@ export {
|
|
17675
17681
|
Cl as ProductCollectionProductSortKey,
|
17676
17682
|
qt as ProductWorkflow,
|
17677
17683
|
Kt as PromiseCache,
|
17678
|
-
|
17684
|
+
xn as PromiseQueue,
|
17679
17685
|
Bo as QuestionStepHandle,
|
17680
|
-
|
17686
|
+
Fn as QueueablePromise,
|
17681
17687
|
ed as ResizeCommand,
|
17682
17688
|
Yt as ResourceNotFoundError,
|
17683
17689
|
td as RotateCommand,
|
@@ -17720,7 +17726,7 @@ export {
|
|
17720
17726
|
$ as findElement,
|
17721
17727
|
$c as findPmsColors,
|
17722
17728
|
Vt as frameDataCache,
|
17723
|
-
|
17729
|
+
yt as frameStepService,
|
17724
17730
|
M as generate,
|
17725
17731
|
al as generateCommands,
|
17726
17732
|
ot as generateSVGWithUnknownColors,
|
@@ -17743,7 +17749,7 @@ export {
|
|
17743
17749
|
Gc as getPointOfRotation,
|
17744
17750
|
dd as getProductCollections,
|
17745
17751
|
jc as getSEPoint,
|
17746
|
-
|
17752
|
+
ya as getSvgElement,
|
17747
17753
|
xd as getTemplateBundles,
|
17748
17754
|
Fd as getTemplateTransactions,
|
17749
17755
|
gd as getTransaction,
|
@@ -17776,17 +17782,17 @@ export {
|
|
17776
17782
|
Jn as questionStepService,
|
17777
17783
|
Nc as registerFetchImplementation,
|
17778
17784
|
Tc as registerWindowImplementation,
|
17779
|
-
|
17785
|
+
za as rehydrateSerializedLayout,
|
17780
17786
|
_r as rgbToPms,
|
17781
17787
|
ce as rotateAroundPoint,
|
17782
17788
|
pa as sanitizeSvgTree,
|
17783
17789
|
zr as setBearerAuthenticationToken,
|
17784
|
-
|
17790
|
+
fn as setCanvasModule,
|
17785
17791
|
zt as shapeStepService,
|
17786
17792
|
ws as shortenUrl,
|
17787
17793
|
gt as spiffCoreConfiguration,
|
17788
17794
|
ld as stepAspectValuesToDesignInputSteps,
|
17789
|
-
|
17795
|
+
Oa as svgColorValueToDefinition,
|
17790
17796
|
Ln as svgStringDimensions,
|
17791
17797
|
ha as svgToDataUrl,
|
17792
17798
|
G as textStepService,
|