@spiffcommerce/core 30.0.0-beta.98669a48-b3f6-5dd5-9ae9-1eb262832b66 → 30.0.0-beta.c50ef448-756b-5f0a-bbae-9e768d08ebf4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -97
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import { split as ta } from "unicode-default-word-boundary";
|
|
|
23
23
|
import An from "lodash.debounce";
|
|
24
24
|
import "fs";
|
|
25
25
|
import "path";
|
|
26
|
-
var we = /* @__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))(we || {}), z = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(z || {}), I = /* @__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))(I || {}), Ir = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Ir || {}),
|
|
26
|
+
var we = /* @__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))(we || {}), z = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(z || {}), I = /* @__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))(I || {}), Ir = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Ir || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), Pr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(Pr || {}), Dr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Dr || {}), Fr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Fr || {}), ha = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ha || {}), xr = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(xr || {}), ye = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(ye || {}), 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 || {}), kr = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(kr || {});
|
|
27
27
|
class un extends Error {
|
|
28
28
|
constructor(t) {
|
|
29
29
|
super(t), this.name = this.constructor.name;
|
|
@@ -49,7 +49,7 @@ class vt extends Xt {
|
|
|
49
49
|
super(`Asset not found for variant: ${t.name}`), this.variant = t;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
class
|
|
52
|
+
class jt extends Xt {
|
|
53
53
|
constructor(t) {
|
|
54
54
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
|
55
55
|
}
|
|
@@ -298,18 +298,18 @@ const Gr = (r) => {
|
|
|
298
298
|
let fn;
|
|
299
299
|
const qr = (r) => {
|
|
300
300
|
fn = r;
|
|
301
|
-
},
|
|
301
|
+
}, Hr = () => new Promise((r) => {
|
|
302
302
|
const t = mt.getHubUrl(), e = (a) => {
|
|
303
303
|
a.origin === t && (window.removeEventListener("message", e), r(a.data));
|
|
304
304
|
};
|
|
305
305
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
|
|
306
|
-
}),
|
|
306
|
+
}), jr = async () => {
|
|
307
307
|
const r = {
|
|
308
308
|
applicationKey: ga,
|
|
309
309
|
customerToken: zr,
|
|
310
310
|
bearer: fn
|
|
311
311
|
};
|
|
312
|
-
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await
|
|
312
|
+
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Hr(), ...r } : r;
|
|
313
313
|
};
|
|
314
314
|
async function Yr(r, t) {
|
|
315
315
|
const e = mt.getServerUrl(), a = e.includes(".aumelbdev.spiffcommerce.com") ? "https://moonlight.aumelbdev.spiffcommerce.com" : e.includes(".us.spiffcommerce.com") ? "https://moonlight.us.spiffcommerce.com" : "https://moonlight.au.spiffcommerce.com";
|
|
@@ -333,7 +333,7 @@ class Jr {
|
|
|
333
333
|
uri: `${mt.getServerUrl()}/graphql`,
|
|
334
334
|
fetch: Yr
|
|
335
335
|
}), e = mr(async (i, s) => {
|
|
336
|
-
const { headers: o } = s, l = o || {}, c = await
|
|
336
|
+
const { headers: o } = s, l = o || {}, c = await jr();
|
|
337
337
|
let d = s.bearer ?? c.bearer;
|
|
338
338
|
if (this.spiffClient)
|
|
339
339
|
try {
|
|
@@ -4050,6 +4050,7 @@ const Y = new Ei(), In = v`
|
|
|
4050
4050
|
mandatory
|
|
4051
4051
|
title
|
|
4052
4052
|
uniqueIdentifier
|
|
4053
|
+
customFieldIndex
|
|
4053
4054
|
}
|
|
4054
4055
|
mandatory
|
|
4055
4056
|
}
|
|
@@ -4156,6 +4157,7 @@ const Y = new Ei(), In = v`
|
|
|
4156
4157
|
customField3
|
|
4157
4158
|
customField4
|
|
4158
4159
|
customField5
|
|
4160
|
+
conversionConfigurationId
|
|
4159
4161
|
}
|
|
4160
4162
|
product {
|
|
4161
4163
|
id
|
|
@@ -4228,6 +4230,7 @@ const Y = new Ei(), In = v`
|
|
|
4228
4230
|
mandatory
|
|
4229
4231
|
title
|
|
4230
4232
|
uniqueIdentifier
|
|
4233
|
+
customFieldIndex
|
|
4231
4234
|
}
|
|
4232
4235
|
mandatory
|
|
4233
4236
|
}
|
|
@@ -4281,6 +4284,7 @@ const Y = new Ei(), In = v`
|
|
|
4281
4284
|
mandatory
|
|
4282
4285
|
title
|
|
4283
4286
|
uniqueIdentifier
|
|
4287
|
+
customFieldIndex
|
|
4284
4288
|
}
|
|
4285
4289
|
mandatory
|
|
4286
4290
|
}
|
|
@@ -4314,6 +4318,7 @@ const Y = new Ei(), In = v`
|
|
|
4314
4318
|
mandatory
|
|
4315
4319
|
title
|
|
4316
4320
|
uniqueIdentifier
|
|
4321
|
+
customFieldIndex
|
|
4317
4322
|
}
|
|
4318
4323
|
mandatory
|
|
4319
4324
|
}
|
|
@@ -5075,6 +5080,7 @@ const Y = new Ei(), In = v`
|
|
|
5075
5080
|
mandatory
|
|
5076
5081
|
title
|
|
5077
5082
|
uniqueIdentifier
|
|
5083
|
+
customFieldIndex
|
|
5078
5084
|
}
|
|
5079
5085
|
mandatory
|
|
5080
5086
|
}
|
|
@@ -5165,14 +5171,14 @@ const Y = new Ei(), In = v`
|
|
|
5165
5171
|
}
|
|
5166
5172
|
}
|
|
5167
5173
|
}
|
|
5168
|
-
`,
|
|
5174
|
+
`, Hi = v`
|
|
5169
5175
|
mutation CreateOrder($orderItems: [OrderItemInput]!) {
|
|
5170
5176
|
orderCreate(orderItems: $orderItems, paid: false, generateInternalId: true) {
|
|
5171
5177
|
id
|
|
5172
5178
|
internalId
|
|
5173
5179
|
}
|
|
5174
5180
|
}
|
|
5175
|
-
`,
|
|
5181
|
+
`, ji = v`
|
|
5176
5182
|
query CurrencyConversion($from: String!, $to: String!) {
|
|
5177
5183
|
currencyConversion(from: $from, to: $to) {
|
|
5178
5184
|
rateFrom
|
|
@@ -5363,7 +5369,7 @@ const Q = () => {
|
|
|
5363
5369
|
width: u
|
|
5364
5370
|
}) => {
|
|
5365
5371
|
var E;
|
|
5366
|
-
const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose ===
|
|
5372
|
+
const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === Ht.FreeDesign && /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ x("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ x("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((b, P) => (
|
|
5367
5373
|
/* @ts-ignore */
|
|
5368
5374
|
/* @__PURE__ */ x("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, P)
|
|
5369
5375
|
)), S = n.map((b) => ({
|
|
@@ -5406,7 +5412,7 @@ const Q = () => {
|
|
|
5406
5412
|
"g",
|
|
5407
5413
|
{
|
|
5408
5414
|
id: "element-group",
|
|
5409
|
-
clipPath: a.purpose ===
|
|
5415
|
+
clipPath: a.purpose === Ht.FreeDesign ? "url(#viewboxClip)" : void 0,
|
|
5410
5416
|
children: y.map((b) => Un(b)).filter((b) => !!b)
|
|
5411
5417
|
}
|
|
5412
5418
|
),
|
|
@@ -5465,10 +5471,10 @@ const Q = () => {
|
|
|
5465
5471
|
x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
|
|
5466
5472
|
y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
|
|
5467
5473
|
};
|
|
5468
|
-
},
|
|
5474
|
+
}, Hc = (r, t) => ({
|
|
5469
5475
|
x: (r.x + t.x) / 2,
|
|
5470
5476
|
y: (r.y + t.y) / 2
|
|
5471
|
-
}),
|
|
5477
|
+
}), jc = (r, t, e, a) => ({
|
|
5472
5478
|
x: r.x + (t == null ? void 0 : t.x) * e,
|
|
5473
5479
|
y: r.y + (t == null ? void 0 : t.y) * a
|
|
5474
5480
|
}), Yc = (r, t, e, a) => ({
|
|
@@ -5479,22 +5485,22 @@ const Q = () => {
|
|
|
5479
5485
|
y: r.y + ((t == null ? void 0 : t.y) + (t == null ? void 0 : t.height)) * a
|
|
5480
5486
|
}), Pt = (r) => {
|
|
5481
5487
|
switch (r) {
|
|
5482
|
-
case
|
|
5483
|
-
return
|
|
5484
|
-
case
|
|
5485
|
-
return
|
|
5486
|
-
case
|
|
5487
|
-
return
|
|
5488
|
-
case
|
|
5489
|
-
return
|
|
5490
|
-
case
|
|
5491
|
-
return
|
|
5492
|
-
case
|
|
5493
|
-
return
|
|
5494
|
-
case
|
|
5495
|
-
return
|
|
5496
|
-
case
|
|
5497
|
-
return
|
|
5488
|
+
case j.North:
|
|
5489
|
+
return j.East;
|
|
5490
|
+
case j.East:
|
|
5491
|
+
return j.South;
|
|
5492
|
+
case j.South:
|
|
5493
|
+
return j.West;
|
|
5494
|
+
case j.West:
|
|
5495
|
+
return j.North;
|
|
5496
|
+
case j.Northwest:
|
|
5497
|
+
return j.Northeast;
|
|
5498
|
+
case j.Northeast:
|
|
5499
|
+
return j.Southeast;
|
|
5500
|
+
case j.Southeast:
|
|
5501
|
+
return j.Southwest;
|
|
5502
|
+
case j.Southwest:
|
|
5503
|
+
return j.Northwest;
|
|
5498
5504
|
}
|
|
5499
5505
|
}, Kc = (r, t) => t > 45 && t <= 135 ? Pt(r) : t > 135 && t <= 225 ? Pt(Pt(r)) : t > 225 && t <= 315 ? Pt(Pt(Pt(r))) : r, _c = (r, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
|
5500
5506
|
const a = pt(r.rotation), n = {
|
|
@@ -6913,7 +6919,7 @@ class ps extends $ {
|
|
|
6913
6919
|
};
|
|
6914
6920
|
}
|
|
6915
6921
|
}
|
|
6916
|
-
class
|
|
6922
|
+
class Ha extends $ {
|
|
6917
6923
|
constructor(t, e) {
|
|
6918
6924
|
super(), this.id = t, this.fontData = e;
|
|
6919
6925
|
}
|
|
@@ -7059,7 +7065,7 @@ class ys extends $ {
|
|
|
7059
7065
|
};
|
|
7060
7066
|
}
|
|
7061
7067
|
}
|
|
7062
|
-
class
|
|
7068
|
+
class He extends $ {
|
|
7063
7069
|
constructor(t, e, a) {
|
|
7064
7070
|
super(), this.id = t, this.strokeColor = e, this.strokeThickness = a;
|
|
7065
7071
|
}
|
|
@@ -7251,7 +7257,7 @@ class cd extends $ {
|
|
|
7251
7257
|
};
|
|
7252
7258
|
}
|
|
7253
7259
|
}
|
|
7254
|
-
class
|
|
7260
|
+
class ja {
|
|
7255
7261
|
constructor(t, e, a) {
|
|
7256
7262
|
this.processRegion = async (n) => {
|
|
7257
7263
|
var l, c, d, A;
|
|
@@ -7418,7 +7424,7 @@ class Es {
|
|
|
7418
7424
|
async () => {
|
|
7419
7425
|
const g = await i();
|
|
7420
7426
|
if (!g.link || !g.link)
|
|
7421
|
-
throw new
|
|
7427
|
+
throw new jt(g.asset);
|
|
7422
7428
|
h({
|
|
7423
7429
|
rel: "mpeg4",
|
|
7424
7430
|
href: g.link
|
|
@@ -7493,7 +7499,7 @@ class Ie {
|
|
|
7493
7499
|
const n = a.fileLink;
|
|
7494
7500
|
if (n)
|
|
7495
7501
|
return at(n, !0);
|
|
7496
|
-
throw new
|
|
7502
|
+
throw new jt(a);
|
|
7497
7503
|
};
|
|
7498
7504
|
}
|
|
7499
7505
|
async init(t, e, a) {
|
|
@@ -7837,7 +7843,7 @@ class Ie {
|
|
|
7837
7843
|
const a = t.fileLink;
|
|
7838
7844
|
if (a)
|
|
7839
7845
|
return a;
|
|
7840
|
-
throw new
|
|
7846
|
+
throw new jt(t);
|
|
7841
7847
|
}
|
|
7842
7848
|
async loadPatternFromAsset(t, e, a, n) {
|
|
7843
7849
|
var c, d;
|
|
@@ -8042,7 +8048,7 @@ class bs {
|
|
|
8042
8048
|
throw new vt(e);
|
|
8043
8049
|
const l = o.fileLink;
|
|
8044
8050
|
if (!l)
|
|
8045
|
-
throw new
|
|
8051
|
+
throw new jt(o);
|
|
8046
8052
|
const c = await lt(await this.getIllustrationBody(l)), d = await _t(c.svg), A = (C) => {
|
|
8047
8053
|
const w = i.getLayouts().find((y) => y.panelId === C.panelId);
|
|
8048
8054
|
if (!w)
|
|
@@ -8194,7 +8200,7 @@ class Bs {
|
|
|
8194
8200
|
};
|
|
8195
8201
|
}
|
|
8196
8202
|
}
|
|
8197
|
-
const
|
|
8203
|
+
const Hn = new Bs();
|
|
8198
8204
|
class Is {
|
|
8199
8205
|
async init(t, e, a) {
|
|
8200
8206
|
const n = t.option;
|
|
@@ -8280,7 +8286,7 @@ class Is {
|
|
|
8280
8286
|
};
|
|
8281
8287
|
}
|
|
8282
8288
|
}
|
|
8283
|
-
const
|
|
8289
|
+
const jn = new Is();
|
|
8284
8290
|
class Ps {
|
|
8285
8291
|
async init(t, e, a) {
|
|
8286
8292
|
if (a)
|
|
@@ -8743,7 +8749,7 @@ class ks {
|
|
|
8743
8749
|
);
|
|
8744
8750
|
}
|
|
8745
8751
|
}
|
|
8746
|
-
const Ms = new ks(),
|
|
8752
|
+
const Ms = new ks(), je = (r, t, e, a, n) => {
|
|
8747
8753
|
if (t.some((d) => d == null))
|
|
8748
8754
|
throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
|
|
8749
8755
|
let i = t.map((d) => d.split(`
|
|
@@ -8775,18 +8781,18 @@ const Ms = new ks(), He = (r, t, e, a, n) => {
|
|
|
8775
8781
|
const o = Et(t.assetUrl), l = o.getFont();
|
|
8776
8782
|
if (n.size) {
|
|
8777
8783
|
const u = r / l.unitsPerEm;
|
|
8778
|
-
return [i, s] =
|
|
8784
|
+
return [i, s] = je(e, a, r, u, o), [n.size, i, s];
|
|
8779
8785
|
}
|
|
8780
8786
|
const c = 6;
|
|
8781
8787
|
let d = c - ze;
|
|
8782
8788
|
if (a.length > 0) {
|
|
8783
8789
|
let u = a, h = 0;
|
|
8784
8790
|
for (; (!n.maxSize || d <= n.maxSize) && u; )
|
|
8785
|
-
d += ze, h = d / l.unitsPerEm, [u, s] =
|
|
8791
|
+
d += ze, h = d / l.unitsPerEm, [u, s] = je(e, a, d, h, o);
|
|
8786
8792
|
}
|
|
8787
8793
|
d > c && (d -= ze), n.minSize && d < n.minSize && (d = n.minSize);
|
|
8788
8794
|
const A = d / l.unitsPerEm;
|
|
8789
|
-
return [i, s] =
|
|
8795
|
+
return [i, s] = je(e, a, d, A, o), [d, i, s];
|
|
8790
8796
|
}, Ye = 30;
|
|
8791
8797
|
class Pe extends Error {
|
|
8792
8798
|
constructor(t) {
|
|
@@ -9019,7 +9025,7 @@ class Ns {
|
|
|
9019
9025
|
strokeColor: s
|
|
9020
9026
|
});
|
|
9021
9027
|
for (const l of a) {
|
|
9022
|
-
const c = new
|
|
9028
|
+
const c = new He(l.id, s, (o = t.data) == null ? void 0 : o.strokeThickness);
|
|
9023
9029
|
i(c);
|
|
9024
9030
|
}
|
|
9025
9031
|
}
|
|
@@ -9115,7 +9121,7 @@ class Ns {
|
|
|
9115
9121
|
f,
|
|
9116
9122
|
async () => {
|
|
9117
9123
|
e.updateMetadata(t.stepName, { color: C, text: w }), e.updateStorage(t.stepName, { text: w, inputText: w });
|
|
9118
|
-
const y = o.map((b) => new
|
|
9124
|
+
const y = o.map((b) => new Ha(b.id, p)), E = new O(y);
|
|
9119
9125
|
e.getCommandDispatcher()(E);
|
|
9120
9126
|
}
|
|
9121
9127
|
), o.length === 0 && l) {
|
|
@@ -9214,7 +9220,7 @@ class Ns {
|
|
|
9214
9220
|
throw new vt(t);
|
|
9215
9221
|
const a = e.fileLink;
|
|
9216
9222
|
if (!a)
|
|
9217
|
-
throw new
|
|
9223
|
+
throw new jt(e);
|
|
9218
9224
|
const n = await Nt(a);
|
|
9219
9225
|
return {
|
|
9220
9226
|
assetUrl: a,
|
|
@@ -9225,14 +9231,14 @@ class Ns {
|
|
|
9225
9231
|
var u;
|
|
9226
9232
|
const d = i.markUpdatePending(), A = await this.fontDataFromVariant(e);
|
|
9227
9233
|
if (n.length > 0) {
|
|
9228
|
-
const h = n.map((p) => new
|
|
9234
|
+
const h = n.map((p) => new Ha(p.id, A));
|
|
9229
9235
|
if (l) {
|
|
9230
9236
|
const p = n.map((f) => new qe(f.id, l));
|
|
9231
9237
|
h.push(...p);
|
|
9232
9238
|
}
|
|
9233
9239
|
if (c) {
|
|
9234
9240
|
const p = n.map(
|
|
9235
|
-
(f) => new
|
|
9241
|
+
(f) => new He(f.id, c, t.data.strokeThickness)
|
|
9236
9242
|
);
|
|
9237
9243
|
h.push(...p);
|
|
9238
9244
|
}
|
|
@@ -9280,7 +9286,7 @@ class Ns {
|
|
|
9280
9286
|
}
|
|
9281
9287
|
if (c) {
|
|
9282
9288
|
const f = n.map(
|
|
9283
|
-
(C) => new
|
|
9289
|
+
(C) => new He(C.id, c, t.data.strokeThickness)
|
|
9284
9290
|
);
|
|
9285
9291
|
g.push(...f);
|
|
9286
9292
|
}
|
|
@@ -9690,7 +9696,7 @@ const re = v`
|
|
|
9690
9696
|
}
|
|
9691
9697
|
}
|
|
9692
9698
|
}
|
|
9693
|
-
`,
|
|
9699
|
+
`, Hs = v`
|
|
9694
9700
|
${re}
|
|
9695
9701
|
query GetGlobalPropertyState($bundleId: String!) {
|
|
9696
9702
|
globalPropertyState(bundleId: $bundleId) {
|
|
@@ -9701,13 +9707,13 @@ const re = v`
|
|
|
9701
9707
|
}
|
|
9702
9708
|
}
|
|
9703
9709
|
`, dd = async (r) => (await B.getShadowGraphqlClient().query({
|
|
9704
|
-
query:
|
|
9710
|
+
query: Hs,
|
|
9705
9711
|
fetchPolicy: "cache-first",
|
|
9706
9712
|
errorPolicy: "all",
|
|
9707
9713
|
variables: {
|
|
9708
9714
|
bundleId: r
|
|
9709
9715
|
}
|
|
9710
|
-
})).data.globalPropertyState,
|
|
9716
|
+
})).data.globalPropertyState, js = v`
|
|
9711
9717
|
${Ne}
|
|
9712
9718
|
fragment ProductFields on Product {
|
|
9713
9719
|
id
|
|
@@ -9753,7 +9759,7 @@ const re = v`
|
|
|
9753
9759
|
}
|
|
9754
9760
|
}
|
|
9755
9761
|
`, Ia = v`
|
|
9756
|
-
${
|
|
9762
|
+
${js}
|
|
9757
9763
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
|
9758
9764
|
id
|
|
9759
9765
|
productId
|
|
@@ -10482,7 +10488,8 @@ class Eo {
|
|
|
10482
10488
|
customField2: h,
|
|
10483
10489
|
customField3: m,
|
|
10484
10490
|
customField4: g,
|
|
10485
|
-
customField5: p
|
|
10491
|
+
customField5: p,
|
|
10492
|
+
conversionConfigurationId: f
|
|
10486
10493
|
}
|
|
10487
10494
|
});
|
|
10488
10495
|
this.transaction.recipient = {
|
|
@@ -10502,7 +10509,8 @@ class Eo {
|
|
|
10502
10509
|
customField2: h,
|
|
10503
10510
|
customField3: m,
|
|
10504
10511
|
customField4: g,
|
|
10505
|
-
customField5: p
|
|
10512
|
+
customField5: p,
|
|
10513
|
+
conversionConfigurationId: f
|
|
10506
10514
|
}, await this.graphQlClient().mutate({
|
|
10507
10515
|
mutation: So,
|
|
10508
10516
|
errorPolicy: "all",
|
|
@@ -10898,10 +10906,10 @@ class Eo {
|
|
|
10898
10906
|
return Promise.resolve({ stepElements: {}, commands: [] });
|
|
10899
10907
|
const n = async (c, d, A) => {
|
|
10900
10908
|
if (c.type === I.SilentIllustration) {
|
|
10901
|
-
const u = await new
|
|
10909
|
+
const u = await new ja(c, d).trigger();
|
|
10902
10910
|
return { step: c, results: u };
|
|
10903
10911
|
} else if (c.type === I.ProductOverlay) {
|
|
10904
|
-
const u = await new
|
|
10912
|
+
const u = await new ja(
|
|
10905
10913
|
c,
|
|
10906
10914
|
d,
|
|
10907
10915
|
A
|
|
@@ -11052,11 +11060,11 @@ class Eo {
|
|
|
11052
11060
|
break;
|
|
11053
11061
|
case I.Material:
|
|
11054
11062
|
a.push(
|
|
11055
|
-
|
|
11063
|
+
Hn.init(l, this, this.reloadedState)
|
|
11056
11064
|
);
|
|
11057
11065
|
break;
|
|
11058
11066
|
case I.Model:
|
|
11059
|
-
a.push(
|
|
11067
|
+
a.push(jn.init(l, this, this.reloadedState));
|
|
11060
11068
|
break;
|
|
11061
11069
|
case I.Module:
|
|
11062
11070
|
this.stepSpecificServices[l.stepName] = {
|
|
@@ -11441,7 +11449,7 @@ class Bo extends it {
|
|
|
11441
11449
|
super(t, e, a);
|
|
11442
11450
|
}
|
|
11443
11451
|
selectVariant(t) {
|
|
11444
|
-
return
|
|
11452
|
+
return Hn.selectVariant(
|
|
11445
11453
|
this.step,
|
|
11446
11454
|
t.getResource(),
|
|
11447
11455
|
this.manager,
|
|
@@ -11454,7 +11462,7 @@ class Io extends it {
|
|
|
11454
11462
|
super(t, e, a);
|
|
11455
11463
|
}
|
|
11456
11464
|
selectVariant(t) {
|
|
11457
|
-
return
|
|
11465
|
+
return jn.selectVariant(
|
|
11458
11466
|
this.step,
|
|
11459
11467
|
t.getResource(),
|
|
11460
11468
|
this.manager,
|
|
@@ -12118,22 +12126,22 @@ const Ro = async (r, t) => {
|
|
|
12118
12126
|
for (const T of Object.keys(i)) {
|
|
12119
12127
|
const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
|
|
12120
12128
|
for (let tt = 0; tt < nt.selections.length; ++tt) {
|
|
12121
|
-
const
|
|
12129
|
+
const H = nt.selections[tt];
|
|
12122
12130
|
if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
|
|
12123
12131
|
const ft = R.stepTitle;
|
|
12124
12132
|
F[ft] ? F[ft].push({
|
|
12125
|
-
id:
|
|
12126
|
-
name:
|
|
12127
|
-
priceModifier:
|
|
12133
|
+
id: H.id || "",
|
|
12134
|
+
name: H.name,
|
|
12135
|
+
priceModifier: H.priceModifier
|
|
12128
12136
|
}) : F[ft] = [
|
|
12129
12137
|
{
|
|
12130
|
-
id:
|
|
12131
|
-
name:
|
|
12132
|
-
priceModifier:
|
|
12138
|
+
id: H.id || "",
|
|
12139
|
+
name: H.name,
|
|
12140
|
+
priceModifier: H.priceModifier
|
|
12133
12141
|
}
|
|
12134
12142
|
];
|
|
12135
12143
|
}
|
|
12136
|
-
k +=
|
|
12144
|
+
k += H.priceModifier;
|
|
12137
12145
|
}
|
|
12138
12146
|
}
|
|
12139
12147
|
return [F, k];
|
|
@@ -12376,7 +12384,7 @@ const Je = new Vo(), zo = v`
|
|
|
12376
12384
|
}
|
|
12377
12385
|
`;
|
|
12378
12386
|
var qo = /* @__PURE__ */ ((r) => (r.QuantityChanged = "QuantityChanged", r.PriceBreakChanged = "PriceBreakChanged", r))(qo || {});
|
|
12379
|
-
class
|
|
12387
|
+
class Ho {
|
|
12380
12388
|
constructor(t, e) {
|
|
12381
12389
|
var n;
|
|
12382
12390
|
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = An(async () => {
|
|
@@ -12506,7 +12514,7 @@ class jo {
|
|
|
12506
12514
|
throw new xe("Failed to obtain 2D context for preview image creation");
|
|
12507
12515
|
const m = await this.workflowManager.getTemplatingContext(), g = va(u.layoutState.layout, u.layoutState.elements, {
|
|
12508
12516
|
renderingConfiguration: {
|
|
12509
|
-
purpose:
|
|
12517
|
+
purpose: Ht.Print,
|
|
12510
12518
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
|
12511
12519
|
templatingContext: m
|
|
12512
12520
|
}
|
|
@@ -12854,7 +12862,7 @@ class jo {
|
|
|
12854
12862
|
(this.eventCallbacks.get(t) || []).forEach((e) => e(this));
|
|
12855
12863
|
}
|
|
12856
12864
|
}
|
|
12857
|
-
const
|
|
12865
|
+
const jo = (r) => {
|
|
12858
12866
|
if ([
|
|
12859
12867
|
I.Question,
|
|
12860
12868
|
I.Frame,
|
|
@@ -12870,7 +12878,7 @@ const Ho = (r) => {
|
|
|
12870
12878
|
}
|
|
12871
12879
|
return !1;
|
|
12872
12880
|
}, Yo = (r, t) => {
|
|
12873
|
-
if (!
|
|
12881
|
+
if (!jo(r))
|
|
12874
12882
|
return !1;
|
|
12875
12883
|
if (r.option && (r.option.variants || []).length > 1) {
|
|
12876
12884
|
const e = t[r.stepName];
|
|
@@ -13553,7 +13561,7 @@ class dl extends kn {
|
|
|
13553
13561
|
l = i.width, c = i.height;
|
|
13554
13562
|
const d = await ((g = (m = this.getWorkflowManager) == null ? void 0 : m.call(this)) == null ? void 0 : g.getTemplatingContext()), A = va(t.layoutState.layout, e, {
|
|
13555
13563
|
renderingConfiguration: {
|
|
13556
|
-
purpose:
|
|
13564
|
+
purpose: Ht.ThreeD,
|
|
13557
13565
|
templatingContext: d
|
|
13558
13566
|
}
|
|
13559
13567
|
}), u = gn(A), h = await ua.from(this.ctx, u, {
|
|
@@ -15123,7 +15131,6 @@ class Ke {
|
|
|
15123
15131
|
async applyGlobalPropertyState(t) {
|
|
15124
15132
|
var a;
|
|
15125
15133
|
const e = await this.globalPropertyHandleService.getHandles();
|
|
15126
|
-
console.error("applyGlobalPropertyState called");
|
|
15127
15134
|
for (const n of t.aspects) {
|
|
15128
15135
|
const i = n == null ? void 0 : n.name;
|
|
15129
15136
|
this.getGlobalPropertyStateManager().setAspect(i, n.value);
|
|
@@ -15167,6 +15174,7 @@ class Ke {
|
|
|
15167
15174
|
}
|
|
15168
15175
|
}
|
|
15169
15176
|
}
|
|
15177
|
+
this.checkMandatoryHandlesChanged(void 0, e);
|
|
15170
15178
|
}
|
|
15171
15179
|
getGlobalPropertyStateManager() {
|
|
15172
15180
|
return this.globalPropertyStateManager;
|
|
@@ -16273,7 +16281,7 @@ class fd {
|
|
|
16273
16281
|
} catch (a) {
|
|
16274
16282
|
throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
|
|
16275
16283
|
}
|
|
16276
|
-
}, this.options = t, this.options.applicationKey && Gr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 30.0.0-beta.
|
|
16284
|
+
}, this.options = t, this.options.applicationKey && Gr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 30.0.0-beta.98669a48-b3f6-5dd5-9ae9-1eb262832b66"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16277
16285
|
}
|
|
16278
16286
|
configure(t) {
|
|
16279
16287
|
mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.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 && qr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16292,7 +16300,7 @@ class fd {
|
|
|
16292
16300
|
}
|
|
16293
16301
|
async getCurrencyContext(t) {
|
|
16294
16302
|
const a = (await this.getIntegration()).partner.currencyCode, i = await B.getShadowGraphqlClient().query({
|
|
16295
|
-
query:
|
|
16303
|
+
query: ji,
|
|
16296
16304
|
errorPolicy: "all",
|
|
16297
16305
|
fetchPolicy: "cache-first",
|
|
16298
16306
|
variables: {
|
|
@@ -16835,8 +16843,8 @@ class fd {
|
|
|
16835
16843
|
singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
|
|
16836
16844
|
stateMutationFunc: P ? async () => {
|
|
16837
16845
|
throw new G("State mutation is forbidden in read only mode!");
|
|
16838
|
-
} : async (
|
|
16839
|
-
...
|
|
16846
|
+
} : async (H) => this.updateTransactionState({
|
|
16847
|
+
...H,
|
|
16840
16848
|
context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
|
|
16841
16849
|
}),
|
|
16842
16850
|
graphQlClient: () => nt,
|
|
@@ -16845,11 +16853,11 @@ class fd {
|
|
|
16845
16853
|
isReloadedTransaction: k.type === "transaction"
|
|
16846
16854
|
};
|
|
16847
16855
|
if (k.type === "transaction" && E.workflowState) {
|
|
16848
|
-
const
|
|
16849
|
-
R.layouts = Object.values(
|
|
16856
|
+
const H = JSON.parse(E.workflowState);
|
|
16857
|
+
R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await Wa(H), R.reloadedState = H;
|
|
16850
16858
|
} else if (!P && k.workflowState) {
|
|
16851
|
-
const
|
|
16852
|
-
R.layouts = Object.values(
|
|
16859
|
+
const H = JSON.parse(k.workflowState);
|
|
16860
|
+
R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await Wa(H), R.reloadedState = H;
|
|
16853
16861
|
} else
|
|
16854
16862
|
R.layouts = Gl(
|
|
16855
16863
|
R.transaction,
|
|
@@ -16861,7 +16869,7 @@ class fd {
|
|
|
16861
16869
|
}), f = await Promise.all(p);
|
|
16862
16870
|
N.setMap("transactionOwnerIds", g);
|
|
16863
16871
|
const w = f.sort((y, E) => y.index - E.index).map(async (y) => {
|
|
16864
|
-
const { experienceOptions: E, options: b } = y, P = new
|
|
16872
|
+
const { experienceOptions: E, options: b } = y, P = new Ho(this, E);
|
|
16865
16873
|
return await P.getWorkflowManager().getInitializationPromise(), b.type !== "transaction" && this.customer && await P.attachCustomerDetails({ email: this.customer.emailAddress }), P;
|
|
16866
16874
|
}), S = await Promise.all(w);
|
|
16867
16875
|
return S.forEach((y) => y.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), S;
|
|
@@ -16920,7 +16928,7 @@ class fd {
|
|
|
16920
16928
|
}
|
|
16921
16929
|
async placeOrder(t) {
|
|
16922
16930
|
const e = await B.getShadowGraphqlClient().mutate({
|
|
16923
|
-
mutation:
|
|
16931
|
+
mutation: Hi,
|
|
16924
16932
|
variables: {
|
|
16925
16933
|
orderItems: t
|
|
16926
16934
|
}
|
|
@@ -17001,7 +17009,7 @@ function ql(r, t, e, a) {
|
|
|
17001
17009
|
function me(r, t, e) {
|
|
17002
17010
|
return Math.min(Math.max(r, t), e);
|
|
17003
17011
|
}
|
|
17004
|
-
class
|
|
17012
|
+
class Hl {
|
|
17005
17013
|
constructor(t, e) {
|
|
17006
17014
|
this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets = An(this.updateFrameOffsets, 200), this.targetElements = [], this.onFrameDataChangeListeners = [], this.onZoomChangeListeners = [], this.forceImageCover = t, this.initialZoom = e, this.thresholdSettings = {
|
|
17007
17015
|
useThreshold: !1,
|
|
@@ -17385,12 +17393,12 @@ class vd {
|
|
|
17385
17393
|
return [];
|
|
17386
17394
|
}
|
|
17387
17395
|
}
|
|
17388
|
-
var
|
|
17396
|
+
var jl = /* @__PURE__ */ ((r) => (r.SelectFrame = "SelectFrame", r.SelectImage = "SelectImage", r.Position = "Position", r))(jl || {});
|
|
17389
17397
|
class Yl extends it {
|
|
17390
17398
|
constructor(t, e, a) {
|
|
17391
17399
|
super(t, e, a);
|
|
17392
17400
|
const n = e.data;
|
|
17393
|
-
this.frameService = new
|
|
17401
|
+
this.frameService = new Hl(n.forceImageCover, n.initialZoomLevel), this.frameService.connectWorkflowManager(t, e.stepName);
|
|
17394
17402
|
}
|
|
17395
17403
|
selectVariant(t) {
|
|
17396
17404
|
const e = this.manager.getRegionElements(this.step.stepName);
|
|
@@ -18052,9 +18060,9 @@ export {
|
|
|
18052
18060
|
fs as FontAlignmentCommand,
|
|
18053
18061
|
gs as FontColorCommand,
|
|
18054
18062
|
ps as FontSizeCommand,
|
|
18055
|
-
|
|
18056
|
-
|
|
18057
|
-
|
|
18063
|
+
Ha as FontSourceCommand,
|
|
18064
|
+
Hl as FrameService,
|
|
18065
|
+
jl as FrameStep,
|
|
18058
18066
|
Yl as FrameStepHandle,
|
|
18059
18067
|
Pa as GlobalPropertyHandle,
|
|
18060
18068
|
O as GroupCommand,
|
|
@@ -18066,7 +18074,7 @@ export {
|
|
|
18066
18074
|
ed as LayoutElementFactory,
|
|
18067
18075
|
M as LayoutElementType,
|
|
18068
18076
|
J as LayoutNotFoundError,
|
|
18069
|
-
|
|
18077
|
+
Ht as LayoutRenderingPurpose,
|
|
18070
18078
|
Bo as MaterialStepHandle,
|
|
18071
18079
|
ve as MisconfigurationError,
|
|
18072
18080
|
vd as MockWorkflowManager,
|
|
@@ -18088,9 +18096,9 @@ export {
|
|
|
18088
18096
|
Do as QuestionStepHandle,
|
|
18089
18097
|
kn as QueueablePromise,
|
|
18090
18098
|
rd as ResizeCommand,
|
|
18091
|
-
|
|
18099
|
+
jt as ResourceNotFoundError,
|
|
18092
18100
|
nd as RotateCommand,
|
|
18093
|
-
|
|
18101
|
+
j as ScaleAxis,
|
|
18094
18102
|
cd as SendBackwardsCommand,
|
|
18095
18103
|
Fo as ShapeStepHandle,
|
|
18096
18104
|
Dr as ShareActionType,
|
|
@@ -18111,7 +18119,7 @@ export {
|
|
|
18111
18119
|
id as UpdateImageSourceCommand,
|
|
18112
18120
|
st as Variant,
|
|
18113
18121
|
qo as WorkflowExperienceEventType,
|
|
18114
|
-
|
|
18122
|
+
Ho as WorkflowExperienceImpl,
|
|
18115
18123
|
U as assetService,
|
|
18116
18124
|
ni as browserColorToHex,
|
|
18117
18125
|
Zc as cmPerPixel,
|
|
@@ -18146,10 +18154,10 @@ export {
|
|
|
18146
18154
|
dd as getGlobalPropertyStateForBundle,
|
|
18147
18155
|
Wl as getIntegration,
|
|
18148
18156
|
Yc as getNEPoint,
|
|
18149
|
-
|
|
18157
|
+
jc as getNWPoint,
|
|
18150
18158
|
kd as getOrderedTransactions,
|
|
18151
18159
|
wd as getOverrideThemeConfiguration,
|
|
18152
|
-
|
|
18160
|
+
Hc as getPointOfRotation,
|
|
18153
18161
|
hd as getProductCollections,
|
|
18154
18162
|
Jc as getSEPoint,
|
|
18155
18163
|
va as getSvgElement,
|
|
@@ -18168,10 +18176,10 @@ export {
|
|
|
18168
18176
|
Wc as isCloseToValue,
|
|
18169
18177
|
Nt as loadFont,
|
|
18170
18178
|
Lc as matchHexToPms,
|
|
18171
|
-
|
|
18179
|
+
Hn as materialStepService,
|
|
18172
18180
|
yl as metafieldManager,
|
|
18173
18181
|
Xc as mmPerPixel,
|
|
18174
|
-
|
|
18182
|
+
jn as modelStepService,
|
|
18175
18183
|
wa as modifySVGColors,
|
|
18176
18184
|
Yn as moduleStepService,
|
|
18177
18185
|
Ed as nameBundle,
|