@spiffcommerce/core 34.1.0-beta.7a56a636-d7cf-54ee-8dfc-5407b655bd46 → 34.1.0-beta.af48b4bc-f77e-5542-857a-72db59fb2fc9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -9
- package/dist/index.js +104 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +147 -147
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHttpLink as Ei, ApolloClient as bi, InMemoryCache as Ii, from as Bi, gql as C } from "@apollo/client/core";
|
|
2
2
|
import { setContext as Pi } from "@apollo/client/link/context";
|
|
3
3
|
import { onError as xi } from "@apollo/client/link/error";
|
|
4
|
-
import { renderToStaticMarkup as
|
|
5
|
-
import { removeTypenameFromVariables as
|
|
4
|
+
import { renderToStaticMarkup as Di } from "preact-render-to-string";
|
|
5
|
+
import { removeTypenameFromVariables as Fi } from "@apollo/client/link/remove-typename";
|
|
6
6
|
import { orientation as ki } from "exifr/dist/mini.umd.cjs";
|
|
7
7
|
import { parse as yn } from "css";
|
|
8
8
|
import Mi from "fuse.js";
|
|
@@ -24,7 +24,7 @@ import vn from "lodash.debounce";
|
|
|
24
24
|
import "fs";
|
|
25
25
|
import "path";
|
|
26
26
|
import Ui from "lodash.omit";
|
|
27
|
-
var Ee = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Ee || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), z = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(z || {}), b = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(b || {}), Li = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Li || {}), Yt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Yt || {}),
|
|
27
|
+
var Ee = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Ee || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), z = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(z || {}), b = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(b || {}), Li = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Li || {}), Yt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Yt || {}), D = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(D || {}), Vi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Vi || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), zi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(zi || {}), Gi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(Gi || {}), ba = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(ba || {}), Wi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Wi || {}), be = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(be || {}), kt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(kt || {}), j = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(j || {}), qi = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(qi || {});
|
|
28
28
|
class In extends Error {
|
|
29
29
|
constructor(t) {
|
|
30
30
|
super(t), this.name = this.constructor.name;
|
|
@@ -217,7 +217,7 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
|
|
|
217
217
|
t ? Ji(n).then(e).catch(a) : nt(n).then((i) => {
|
|
218
218
|
i.text().then(e).catch(a);
|
|
219
219
|
}).catch(a);
|
|
220
|
-
}), xn = (n) =>
|
|
220
|
+
}), xn = (n) => Di(n), je = /* @__PURE__ */ new Map(), Xi = async (n, t) => {
|
|
221
221
|
if (Mt([typeof FontFace])) {
|
|
222
222
|
if (je.has(t))
|
|
223
223
|
return je.get(t);
|
|
@@ -269,7 +269,7 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
|
|
|
269
269
|
}, tr = async (n) => {
|
|
270
270
|
const t = Oe(n), e = new Uint8Array(n), a = Zi(e), i = btoa(a);
|
|
271
271
|
return `data:${t};base64,${i}`;
|
|
272
|
-
}, Ia = (n) => `data:image/svg+xml;base64,${btoa(n)}`,
|
|
272
|
+
}, Ia = (n) => `data:image/svg+xml;base64,${btoa(n)}`, Dn = (n) => {
|
|
273
273
|
const t = n.replace(/\r?\n/g, ""), e = t.indexOf(",");
|
|
274
274
|
if (e === -1 || e <= 4)
|
|
275
275
|
throw new TypeError("malformed data: URI");
|
|
@@ -292,9 +292,9 @@ let ar, Ba;
|
|
|
292
292
|
const nr = (n) => {
|
|
293
293
|
Ba = n;
|
|
294
294
|
}, ir = () => Ba;
|
|
295
|
-
let
|
|
295
|
+
let Fn;
|
|
296
296
|
const rr = (n) => {
|
|
297
|
-
|
|
297
|
+
Fn = n;
|
|
298
298
|
}, or = () => new Promise((n) => {
|
|
299
299
|
const t = pt.getHubUrl(), e = (a) => {
|
|
300
300
|
a.origin === t && (window.removeEventListener("message", e), n(a.data));
|
|
@@ -304,7 +304,7 @@ const rr = (n) => {
|
|
|
304
304
|
const n = {
|
|
305
305
|
applicationKey: Ba,
|
|
306
306
|
customerToken: ar,
|
|
307
|
-
bearer:
|
|
307
|
+
bearer: Fn
|
|
308
308
|
};
|
|
309
309
|
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await or(), ...n } : n;
|
|
310
310
|
};
|
|
@@ -356,7 +356,7 @@ class cr {
|
|
|
356
356
|
}), a = xi(({ operation: r, graphQLErrors: o, networkError: s }) => {
|
|
357
357
|
const l = o || [], c = r.getContext();
|
|
358
358
|
s && !c?.fetchOptions?.signal?.aborted && console.log("GraphQL Network error"), l.forEach(() => console.log("GraphQL Error: " + r.operationName));
|
|
359
|
-
}), i =
|
|
359
|
+
}), i = Fi();
|
|
360
360
|
return new bi({
|
|
361
361
|
link: Bi([i, a, e, t]),
|
|
362
362
|
cache: new Ii(),
|
|
@@ -1808,7 +1808,7 @@ const dr = (n) => new Promise((t) => {
|
|
|
1808
1808
|
"Black 5 C",
|
|
1809
1809
|
"Black 6 C",
|
|
1810
1810
|
"Black 7 C"
|
|
1811
|
-
],
|
|
1811
|
+
], Dt = [
|
|
1812
1812
|
"FEDD00",
|
|
1813
1813
|
"FFD700",
|
|
1814
1814
|
"FE5000",
|
|
@@ -3150,17 +3150,17 @@ const dr = (n) => new Promise((t) => {
|
|
|
3150
3150
|
"3E2B2E",
|
|
3151
3151
|
"101820",
|
|
3152
3152
|
"3D3935"
|
|
3153
|
-
], Je =
|
|
3153
|
+
], Je = Dt.map((n) => [
|
|
3154
3154
|
parseInt(n.substring(0, 2), 16),
|
|
3155
3155
|
parseInt(n.substring(2, 4), 16),
|
|
3156
3156
|
parseInt(n.substring(4, 6), 16)
|
|
3157
3157
|
]);
|
|
3158
3158
|
function od(n) {
|
|
3159
3159
|
const t = Kt.indexOf(n);
|
|
3160
|
-
return t >= 0 ?
|
|
3160
|
+
return t >= 0 ? Dt[t] : "";
|
|
3161
3161
|
}
|
|
3162
3162
|
function gr(n) {
|
|
3163
|
-
const t =
|
|
3163
|
+
const t = Dt.indexOf(n);
|
|
3164
3164
|
return t >= 0 ? Kt[t] : "";
|
|
3165
3165
|
}
|
|
3166
3166
|
function sd(n, t = 64) {
|
|
@@ -3172,16 +3172,16 @@ function sd(n, t = 64) {
|
|
|
3172
3172
|
});
|
|
3173
3173
|
const r = parseInt(n.substring(0, 2), 16), o = parseInt(n.substring(2, 4), 16), s = parseInt(n.substring(4, 6), 16);
|
|
3174
3174
|
let l, c, d;
|
|
3175
|
-
for (let A = 0; A <
|
|
3175
|
+
for (let A = 0; A < Dt.length; A++) {
|
|
3176
3176
|
l = Je[A][0], c = Je[A][1], d = Je[A][2];
|
|
3177
3177
|
const u = Math.sqrt(Math.pow(r - l, 2) + Math.pow(o - c, 2) + Math.pow(s - d, 2));
|
|
3178
3178
|
a.push(u);
|
|
3179
3179
|
}
|
|
3180
3180
|
for (let A = 0; A < a.length; A++)
|
|
3181
|
-
a[A] <= t && !e.some((u) => u.pms === Kt[A]) && e.push({ pms: Kt[A], hex:
|
|
3181
|
+
a[A] <= t && !e.some((u) => u.pms === Kt[A]) && e.push({ pms: Kt[A], hex: Dt[A], distance: a[A] });
|
|
3182
3182
|
return e.sort((A, u) => A.distance - u.distance);
|
|
3183
3183
|
}
|
|
3184
|
-
const mr = Kt.map((n, t) => ({ pms: n, hex:
|
|
3184
|
+
const mr = Kt.map((n, t) => ({ pms: n, hex: Dt[t] })), pr = new Mi(mr, { keys: ["pms"] });
|
|
3185
3185
|
function ld(n, t) {
|
|
3186
3186
|
return pr.search(n, t ? { limit: t } : void 0);
|
|
3187
3187
|
}
|
|
@@ -3238,8 +3238,8 @@ const de = (n) => {
|
|
|
3238
3238
|
"textPath",
|
|
3239
3239
|
"tref",
|
|
3240
3240
|
"tspan"
|
|
3241
|
-
], wr = ["fill", "stroke"],
|
|
3242
|
-
t(n), n.children.length > 0 && Array.from(n.children).forEach((e) =>
|
|
3241
|
+
], wr = ["fill", "stroke"], Ft = (n, t) => {
|
|
3242
|
+
t(n), n.children.length > 0 && Array.from(n.children).forEach((e) => Ft(e, t));
|
|
3243
3243
|
}, Nn = (n, t) => {
|
|
3244
3244
|
const e = t(n);
|
|
3245
3245
|
if (e)
|
|
@@ -3256,7 +3256,7 @@ const de = (n) => {
|
|
|
3256
3256
|
}, xa = (n, t = !1) => {
|
|
3257
3257
|
!t && n.setAttribute("preserveAspectRatio", "none");
|
|
3258
3258
|
const e = [];
|
|
3259
|
-
|
|
3259
|
+
Ft(n, (a) => {
|
|
3260
3260
|
if (a.tagName === "script") {
|
|
3261
3261
|
a.remove();
|
|
3262
3262
|
return;
|
|
@@ -3282,7 +3282,7 @@ const de = (n) => {
|
|
|
3282
3282
|
}
|
|
3283
3283
|
}), r.length > 0 ? a.setAttribute("style", r.join(";")) : a.removeAttribute("style");
|
|
3284
3284
|
}
|
|
3285
|
-
}),
|
|
3285
|
+
}), Ft(n, (a) => {
|
|
3286
3286
|
e.forEach((i) => {
|
|
3287
3287
|
i.selectors?.forEach((r) => {
|
|
3288
3288
|
yr(a, r) && i.declarations?.forEach((o) => {
|
|
@@ -3298,7 +3298,7 @@ const de = (n) => {
|
|
|
3298
3298
|
}, Qn = (n) => dt().parseFromString(n, "image/svg+xml").firstElementChild, vr = (n, t, e) => {
|
|
3299
3299
|
n.setAttribute("height", `${e}px`), n.setAttribute("width", `${t}px`);
|
|
3300
3300
|
}, Rn = (n, t, e) => {
|
|
3301
|
-
|
|
3301
|
+
Ft(n, (a) => {
|
|
3302
3302
|
const i = a.attributes.getNamedItem("fill");
|
|
3303
3303
|
i && i.value !== "none" && a.classList.forEach((o) => {
|
|
3304
3304
|
if (o.startsWith("spiff-fill")) {
|
|
@@ -3336,12 +3336,12 @@ const de = (n) => {
|
|
|
3336
3336
|
}
|
|
3337
3337
|
});
|
|
3338
3338
|
});
|
|
3339
|
-
}, On = (n) => It().serializeToString(n),
|
|
3339
|
+
}, On = (n) => It().serializeToString(n), Da = (n, t, e, a, i) => {
|
|
3340
3340
|
const r = Qn(n);
|
|
3341
3341
|
if (!r)
|
|
3342
3342
|
throw new Error("Failed to read SVG.");
|
|
3343
3343
|
return vr(r, t, e), Rn(r, a, i), On(r);
|
|
3344
|
-
},
|
|
3344
|
+
}, Fa = (n, t, e) => {
|
|
3345
3345
|
const a = Qn(n);
|
|
3346
3346
|
if (!a)
|
|
3347
3347
|
throw new Error("Failed to read SVG.");
|
|
@@ -3355,7 +3355,7 @@ const de = (n) => {
|
|
|
3355
3355
|
throw new Error("Failed to read SVG.");
|
|
3356
3356
|
xa(e);
|
|
3357
3357
|
const a = {};
|
|
3358
|
-
|
|
3358
|
+
Ft(e, (o) => {
|
|
3359
3359
|
if (Cr.includes(o.tagName) && !o.attributes.getNamedItem("fill")) {
|
|
3360
3360
|
let c = "black";
|
|
3361
3361
|
const d = o.parentElement;
|
|
@@ -3527,13 +3527,13 @@ const de = (n) => {
|
|
|
3527
3527
|
variables: {
|
|
3528
3528
|
keys: n
|
|
3529
3529
|
}
|
|
3530
|
-
})).data.assets,
|
|
3530
|
+
})).data.assets, Dr = async (n) => (await y.getShadowGraphqlClient().query({
|
|
3531
3531
|
query: Br,
|
|
3532
3532
|
errorPolicy: "all",
|
|
3533
3533
|
variables: {
|
|
3534
3534
|
ids: n
|
|
3535
3535
|
}
|
|
3536
|
-
})).data.materials,
|
|
3536
|
+
})).data.materials, Fr = async (n, t, e, a, i) => (await y.getShadowGraphqlClient().mutate({
|
|
3537
3537
|
mutation: Pr,
|
|
3538
3538
|
errorPolicy: "all",
|
|
3539
3539
|
fetchPolicy: "no-cache",
|
|
@@ -3609,7 +3609,7 @@ class kr {
|
|
|
3609
3609
|
async getMaterialLocalOrFromServer(t) {
|
|
3610
3610
|
if (this.materialCache.has(t))
|
|
3611
3611
|
return this.materialCache.get(t);
|
|
3612
|
-
const a = (async () => (await
|
|
3612
|
+
const a = (async () => (await Dr([t]))[0])();
|
|
3613
3613
|
return this.materialCache.set(t, a), a;
|
|
3614
3614
|
}
|
|
3615
3615
|
/**
|
|
@@ -3698,7 +3698,7 @@ class kr {
|
|
|
3698
3698
|
* @param assetType The type of asset we're expecting to upload
|
|
3699
3699
|
*/
|
|
3700
3700
|
async dispatchCreateAssetRequest(t, e, a, i) {
|
|
3701
|
-
const r = t.blob.type ? t.blob.type : this.guessMIME(t.name), o = await
|
|
3701
|
+
const r = t.blob.type ? t.blob.type : this.guessMIME(t.name), o = await Fr(t.name, e, r, a, i);
|
|
3702
3702
|
if (o)
|
|
3703
3703
|
return {
|
|
3704
3704
|
assetResponse: o,
|
|
@@ -4186,7 +4186,6 @@ const Y = new Or(), Un = C`
|
|
|
4186
4186
|
externalCartProductId
|
|
4187
4187
|
externalCartProductVariantId
|
|
4188
4188
|
id
|
|
4189
|
-
bundleIndex
|
|
4190
4189
|
completed
|
|
4191
4190
|
lastSyncedAt
|
|
4192
4191
|
priceModifierTotal
|
|
@@ -5530,7 +5529,7 @@ const M = () => {
|
|
|
5530
5529
|
if (!n.pattern)
|
|
5531
5530
|
return "";
|
|
5532
5531
|
if (n.pattern.svg) {
|
|
5533
|
-
const A =
|
|
5532
|
+
const A = Fa(n.pattern.svg, n.pattern.colors || {}, !1);
|
|
5534
5533
|
return Ia(A);
|
|
5535
5534
|
}
|
|
5536
5535
|
return n.pattern.src;
|
|
@@ -5560,7 +5559,7 @@ const M = () => {
|
|
|
5560
5559
|
const A = n.pattern?.x || 0, u = n.pattern?.y || 0, h = n.pattern?.width || 0, g = n.pattern?.height || 0, m = n.pattern?.scaleX || 1, p = n.pattern?.scaleY || 1, f = n.pattern?.rotation || 0;
|
|
5561
5560
|
return [n.pattern?.svg ? {
|
|
5562
5561
|
id: `${t}-contents`,
|
|
5563
|
-
type:
|
|
5562
|
+
type: D.Illustration,
|
|
5564
5563
|
x: A,
|
|
5565
5564
|
y: u,
|
|
5566
5565
|
rotation: f,
|
|
@@ -5571,7 +5570,7 @@ const M = () => {
|
|
|
5571
5570
|
colors: n.pattern?.colors
|
|
5572
5571
|
} : {
|
|
5573
5572
|
id: `${t}-contents`,
|
|
5574
|
-
type:
|
|
5573
|
+
type: D.Image,
|
|
5575
5574
|
x: A,
|
|
5576
5575
|
y: u,
|
|
5577
5576
|
rotation: f,
|
|
@@ -5674,7 +5673,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5674
5673
|
return wt(n).getFont();
|
|
5675
5674
|
} catch {
|
|
5676
5675
|
if (wo(n)) {
|
|
5677
|
-
const a =
|
|
5676
|
+
const a = Dn(n), i = la(a);
|
|
5678
5677
|
return ma(n, i), i;
|
|
5679
5678
|
} else {
|
|
5680
5679
|
const a = await Re(n, !0), i = la(a);
|
|
@@ -5684,7 +5683,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5684
5683
|
})();
|
|
5685
5684
|
return Ke.set(n, e), e;
|
|
5686
5685
|
}, yo = (n) => {
|
|
5687
|
-
const t =
|
|
5686
|
+
const t = Dn(n), e = la(t);
|
|
5688
5687
|
return ma(n, e), e;
|
|
5689
5688
|
}, wt = (n) => {
|
|
5690
5689
|
const t = Yn.get(n);
|
|
@@ -5836,7 +5835,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5836
5835
|
stripControlCharacters: !0,
|
|
5837
5836
|
vertical: !1,
|
|
5838
5837
|
uppercase: !1
|
|
5839
|
-
},
|
|
5838
|
+
}, De = (n, t = _a) => {
|
|
5840
5839
|
const e = { ..._a, ...t };
|
|
5841
5840
|
let a = n || "";
|
|
5842
5841
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
|
@@ -5931,7 +5930,7 @@ const Po = (n) => {
|
|
|
5931
5930
|
},
|
|
5932
5931
|
stroke: A,
|
|
5933
5932
|
strokeWidth: u,
|
|
5934
|
-
children: n.curved ? /* @__PURE__ */ P(
|
|
5933
|
+
children: n.curved ? /* @__PURE__ */ P(Do, { text: c, curvedPathId: r, align: n.align }) : d.map((g, m) => /* @__PURE__ */ P(
|
|
5935
5934
|
xo,
|
|
5936
5935
|
{
|
|
5937
5936
|
align: n.vertical ? "center" : n.align,
|
|
@@ -5969,7 +5968,7 @@ const Po = (n) => {
|
|
|
5969
5968
|
return (n.thisLineIdx - o) * i + n.fontSize / 4;
|
|
5970
5969
|
};
|
|
5971
5970
|
return /* @__PURE__ */ P("tspan", { textAnchor: Kn(n.align), x: e(), y: `${a()}px`, children: n.text });
|
|
5972
|
-
},
|
|
5971
|
+
}, Do = (n) => {
|
|
5973
5972
|
const t = `#${n.curvedPathId}`;
|
|
5974
5973
|
return /* @__PURE__ */ P(
|
|
5975
5974
|
"textPath",
|
|
@@ -5981,7 +5980,7 @@ const Po = (n) => {
|
|
|
5981
5980
|
children: n.text
|
|
5982
5981
|
}
|
|
5983
5982
|
);
|
|
5984
|
-
},
|
|
5983
|
+
}, Fo = (n) => {
|
|
5985
5984
|
if (n.cachedObjectURL && !n._renderingConfiguration?.omitCachedFields)
|
|
5986
5985
|
return /* @__PURE__ */ P(
|
|
5987
5986
|
Hn,
|
|
@@ -6013,7 +6012,7 @@ const Po = (n) => {
|
|
|
6013
6012
|
{
|
|
6014
6013
|
transform: r,
|
|
6015
6014
|
dangerouslySetInnerHTML: {
|
|
6016
|
-
__html:
|
|
6015
|
+
__html: Da(
|
|
6017
6016
|
n.svg,
|
|
6018
6017
|
n.width,
|
|
6019
6018
|
n.height,
|
|
@@ -6114,7 +6113,7 @@ class ko {
|
|
|
6114
6113
|
return { ...t, transaction: e.apply(a) };
|
|
6115
6114
|
}
|
|
6116
6115
|
}
|
|
6117
|
-
const Zn = (n) => n.type ===
|
|
6116
|
+
const Zn = (n) => n.type === D.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n.type === D.Frame ? /* @__PURE__ */ P(fo, { ...n }, n.id) : n.type === D.Illustration ? /* @__PURE__ */ P(Fo, { ...n }, n.id) : n.type === D.Textbox ? /* @__PURE__ */ P(Po, { ...n }, n.id) : n.type === D.Group ? /* @__PURE__ */ P(jn, { ...n }, n.id) : null, Ma = (n, t, e) => {
|
|
6118
6117
|
const a = e.renderingConfiguration, i = a?.removeExcludedElements ? t.filter((r) => !r.excludeFromExport) : t;
|
|
6119
6118
|
return /* @__PURE__ */ P(
|
|
6120
6119
|
po,
|
|
@@ -6330,17 +6329,17 @@ const re = (n) => {
|
|
|
6330
6329
|
rotation: 0,
|
|
6331
6330
|
panelId: n.layoutState.layout.panelId
|
|
6332
6331
|
};
|
|
6333
|
-
if (e && t ===
|
|
6332
|
+
if (e && t === D.Illustration) {
|
|
6334
6333
|
const l = await st(await ai(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
|
|
6335
6334
|
if (!u) throw new Error("SVG missing viewBox.");
|
|
6336
6335
|
const h = s.height, g = u.split(" "), m = parseFloat(g[2]) || 1, p = parseFloat(g[3]) || 1, f = m / p;
|
|
6337
6336
|
s.height = s.width / f, s.top += (h - s.height) / 2;
|
|
6338
6337
|
}
|
|
6339
|
-
if (e && t ===
|
|
6338
|
+
if (e && t === D.Image) {
|
|
6340
6339
|
const l = s.height, c = await Re(e), d = await $e(c), A = d.width / d.height;
|
|
6341
6340
|
s.height = s.width / A, s.top += (l - s.height) / 2;
|
|
6342
6341
|
}
|
|
6343
|
-
if (e && t ===
|
|
6342
|
+
if (e && t === D.Textbox && a?.text && a?.fontScale) {
|
|
6344
6343
|
await Tt(e);
|
|
6345
6344
|
const l = wt(e), c = mt(a.text, a?.fontScale, l);
|
|
6346
6345
|
s.width = Math.min(c, i.width * 0.85), s.left = i.x + i.width / 2 - s.width / 2;
|
|
@@ -6349,7 +6348,7 @@ const re = (n) => {
|
|
|
6349
6348
|
};
|
|
6350
6349
|
class vd {
|
|
6351
6350
|
static async getFrame(t, e) {
|
|
6352
|
-
const a = await ti(e.region, e.src), i = await Ve(a), r = e.region || await Ut(t,
|
|
6351
|
+
const a = await ti(e.region, e.src), i = await Ve(a), r = e.region || await Ut(t, D.Frame);
|
|
6353
6352
|
return {
|
|
6354
6353
|
id: M(),
|
|
6355
6354
|
x: r.left,
|
|
@@ -6364,7 +6363,7 @@ class vd {
|
|
|
6364
6363
|
path: i.path,
|
|
6365
6364
|
dataWidth: i.width,
|
|
6366
6365
|
dataHeight: i.height,
|
|
6367
|
-
type:
|
|
6366
|
+
type: D.Frame,
|
|
6368
6367
|
disablePlaceholder: e.configuration.disablePlaceholder,
|
|
6369
6368
|
focalBlur: e.configuration.focalBlur,
|
|
6370
6369
|
focalBlurStrength: e.configuration.focalBlurStrength,
|
|
@@ -6375,11 +6374,11 @@ class vd {
|
|
|
6375
6374
|
};
|
|
6376
6375
|
}
|
|
6377
6376
|
static async getImage(t, e) {
|
|
6378
|
-
const a = e.region || await Ut(t,
|
|
6377
|
+
const a = e.region || await Ut(t, D.Image, e.src);
|
|
6379
6378
|
return {
|
|
6380
6379
|
id: M(),
|
|
6381
6380
|
src: e.src,
|
|
6382
|
-
type:
|
|
6381
|
+
type: D.Image,
|
|
6383
6382
|
y: a.top,
|
|
6384
6383
|
x: a.left,
|
|
6385
6384
|
rotation: a.rotation,
|
|
@@ -6395,16 +6394,16 @@ class vd {
|
|
|
6395
6394
|
const { configuration: a, fontSrc: i, designInputStep: r } = e, o = await Tt(i), s = {
|
|
6396
6395
|
assetUrl: i,
|
|
6397
6396
|
name: o.names.fullName.en
|
|
6398
|
-
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d =
|
|
6397
|
+
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = De(c, {
|
|
6399
6398
|
vertical: a.vertical,
|
|
6400
6399
|
uppercase: a.uppercase
|
|
6401
|
-
}), A = e.region || await Ut(t,
|
|
6400
|
+
}), A = e.region || await Ut(t, D.Textbox, i, {
|
|
6402
6401
|
text: d,
|
|
6403
6402
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
|
6404
6403
|
}), u = ie(
|
|
6405
6404
|
{
|
|
6406
6405
|
id: M(),
|
|
6407
|
-
type:
|
|
6406
|
+
type: D.Textbox,
|
|
6408
6407
|
x: A.left,
|
|
6409
6408
|
y: A.top,
|
|
6410
6409
|
width: A.width,
|
|
@@ -6464,14 +6463,14 @@ class vd {
|
|
|
6464
6463
|
</svg>
|
|
6465
6464
|
`, i = {};
|
|
6466
6465
|
i["spiff-fill-shape"] = { browserValue: e.color };
|
|
6467
|
-
const r = e.region?.item || await Ut(t,
|
|
6466
|
+
const r = e.region?.item || await Ut(t, D.Illustration), o = M();
|
|
6468
6467
|
return {
|
|
6469
6468
|
stepRegion: e.region?.item,
|
|
6470
6469
|
stepRegionIndex: e.region?.index,
|
|
6471
6470
|
colors: i,
|
|
6472
6471
|
id: o,
|
|
6473
6472
|
svg: a,
|
|
6474
|
-
type:
|
|
6473
|
+
type: D.Illustration,
|
|
6475
6474
|
y: r.top,
|
|
6476
6475
|
x: r.left,
|
|
6477
6476
|
rotation: r.rotation,
|
|
@@ -6483,7 +6482,7 @@ class vd {
|
|
|
6483
6482
|
};
|
|
6484
6483
|
}
|
|
6485
6484
|
static async getIllustration(t, e) {
|
|
6486
|
-
const a = e.region?.item || await Ut(t,
|
|
6485
|
+
const a = e.region?.item || await Ut(t, D.Illustration, e.src), i = await st(await ai(e.src)), r = await Xt(i.svg), o = M();
|
|
6487
6486
|
return {
|
|
6488
6487
|
cachedObjectURL: r,
|
|
6489
6488
|
stepRegion: e.region?.item,
|
|
@@ -6492,7 +6491,7 @@ class vd {
|
|
|
6492
6491
|
id: o,
|
|
6493
6492
|
src: e.src,
|
|
6494
6493
|
svg: i.svg,
|
|
6495
|
-
type:
|
|
6494
|
+
type: D.Illustration,
|
|
6496
6495
|
y: a.top,
|
|
6497
6496
|
x: a.left,
|
|
6498
6497
|
rotation: a.rotation,
|
|
@@ -6531,7 +6530,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6531
6530
|
const s = o;
|
|
6532
6531
|
if (s.src && !s.svg) {
|
|
6533
6532
|
const l = await at(s.src), c = await st(l);
|
|
6534
|
-
s.svg =
|
|
6533
|
+
s.svg = Da(
|
|
6535
6534
|
c.svg,
|
|
6536
6535
|
s.width,
|
|
6537
6536
|
s.height,
|
|
@@ -6551,7 +6550,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6551
6550
|
}
|
|
6552
6551
|
for (const a in n.layouts) {
|
|
6553
6552
|
const i = n.layouts[a].elements.filter(
|
|
6554
|
-
(o) => o.type ===
|
|
6553
|
+
(o) => o.type === D.Illustration
|
|
6555
6554
|
);
|
|
6556
6555
|
for (let o = 0; o < i.length; ++o) {
|
|
6557
6556
|
const s = i[o];
|
|
@@ -6563,7 +6562,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6563
6562
|
}
|
|
6564
6563
|
}
|
|
6565
6564
|
const r = n.layouts[a].elements.filter(
|
|
6566
|
-
(o) => o.type ===
|
|
6565
|
+
(o) => o.type === D.Textbox
|
|
6567
6566
|
);
|
|
6568
6567
|
for (let o = 0; o < r.length; ++o) {
|
|
6569
6568
|
const s = r[o];
|
|
@@ -7127,7 +7126,7 @@ class xd extends O {
|
|
|
7127
7126
|
};
|
|
7128
7127
|
}
|
|
7129
7128
|
}
|
|
7130
|
-
class
|
|
7129
|
+
class Dd extends O {
|
|
7131
7130
|
/**
|
|
7132
7131
|
* @param id The targeted element to bring to the front.
|
|
7133
7132
|
*/
|
|
@@ -7154,7 +7153,7 @@ class Fd extends O {
|
|
|
7154
7153
|
};
|
|
7155
7154
|
}
|
|
7156
7155
|
}
|
|
7157
|
-
class
|
|
7156
|
+
class Fd extends O {
|
|
7158
7157
|
/**
|
|
7159
7158
|
* @param id The targeted element to bring to the front.
|
|
7160
7159
|
*/
|
|
@@ -7194,7 +7193,7 @@ class an {
|
|
|
7194
7193
|
throw new Be(this.configuration, "Couldn't find an asset for product overlay step");
|
|
7195
7194
|
}
|
|
7196
7195
|
const s = this.evaluateAssetType();
|
|
7197
|
-
if (s ===
|
|
7196
|
+
if (s === D.Image) {
|
|
7198
7197
|
const l = this.configuration.type === b.SilentIllustration ? this.configuration.data.asset?.fileLink : this.product?.overlayImageUrl;
|
|
7199
7198
|
if (!l)
|
|
7200
7199
|
throw new Error("Undefined raster silent step source");
|
|
@@ -7276,7 +7275,7 @@ class an {
|
|
|
7276
7275
|
}
|
|
7277
7276
|
evaluateAssetType() {
|
|
7278
7277
|
const t = this.configuration.type === b.ProductOverlay && this.product?.overlayImageUrl ? this.product.overlayImageUrl.toLowerCase() : this.configuration.data.asset?.fileLink?.toLowerCase().split("?")[0];
|
|
7279
|
-
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ?
|
|
7278
|
+
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? D.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), D.Illustration);
|
|
7280
7279
|
}
|
|
7281
7280
|
}
|
|
7282
7281
|
const Lo = async (n) => {
|
|
@@ -7397,7 +7396,7 @@ class Vo {
|
|
|
7397
7396
|
stepName: i,
|
|
7398
7397
|
id: c.id,
|
|
7399
7398
|
src: s,
|
|
7400
|
-
type:
|
|
7399
|
+
type: D.Image,
|
|
7401
7400
|
y: d.top,
|
|
7402
7401
|
x: d.left,
|
|
7403
7402
|
width: d.width,
|
|
@@ -7412,7 +7411,7 @@ class Vo {
|
|
|
7412
7411
|
}
|
|
7413
7412
|
}
|
|
7414
7413
|
const ri = new Vo();
|
|
7415
|
-
class
|
|
7414
|
+
class Fe {
|
|
7416
7415
|
constructor() {
|
|
7417
7416
|
this.frameSourceSvg = async (t, e) => {
|
|
7418
7417
|
if (!t)
|
|
@@ -7523,7 +7522,7 @@ class De {
|
|
|
7523
7522
|
})) ?? [];
|
|
7524
7523
|
}
|
|
7525
7524
|
selectImage(t, e, a, i = !0) {
|
|
7526
|
-
const r =
|
|
7525
|
+
const r = Fe.patternSource(e), o = a.getStepStorage(t.stepName)?.framePatternSrc;
|
|
7527
7526
|
if (o && o === r)
|
|
7528
7527
|
return Promise.resolve();
|
|
7529
7528
|
a.setEditedStatus(t.stepName, !0);
|
|
@@ -7563,7 +7562,7 @@ class De {
|
|
|
7563
7562
|
return new W(
|
|
7564
7563
|
{
|
|
7565
7564
|
id: t,
|
|
7566
|
-
type:
|
|
7565
|
+
type: D.Frame,
|
|
7567
7566
|
x: e.left,
|
|
7568
7567
|
y: e.top,
|
|
7569
7568
|
width: e.width,
|
|
@@ -7756,7 +7755,7 @@ class De {
|
|
|
7756
7755
|
throw new Jt(t);
|
|
7757
7756
|
}
|
|
7758
7757
|
async loadPatternFromAsset(t, e, a, i) {
|
|
7759
|
-
const r =
|
|
7758
|
+
const r = Fe.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
|
7760
7759
|
if (!s)
|
|
7761
7760
|
throw a.markUpdateCompleted(o), new Error("Frame service unavailable, cannot load pattern!");
|
|
7762
7761
|
try {
|
|
@@ -7783,7 +7782,7 @@ class De {
|
|
|
7783
7782
|
), this.validateColorCount(e, a);
|
|
7784
7783
|
}
|
|
7785
7784
|
}
|
|
7786
|
-
const St = new
|
|
7785
|
+
const St = new Fe();
|
|
7787
7786
|
class zo {
|
|
7788
7787
|
async getIllustrationBody(t) {
|
|
7789
7788
|
return new Promise((e) => {
|
|
@@ -7803,7 +7802,7 @@ class zo {
|
|
|
7803
7802
|
src: r.src,
|
|
7804
7803
|
svg: r.svg.svg,
|
|
7805
7804
|
cachedObjectURL: r.objectURL,
|
|
7806
|
-
type:
|
|
7805
|
+
type: D.Illustration,
|
|
7807
7806
|
y: e.top,
|
|
7808
7807
|
x: e.left,
|
|
7809
7808
|
rotation: e.rotation,
|
|
@@ -7893,7 +7892,7 @@ class zo {
|
|
|
7893
7892
|
spotColor: A.spotColor,
|
|
7894
7893
|
pmsValue: A.pmsValue
|
|
7895
7894
|
};
|
|
7896
|
-
const s =
|
|
7895
|
+
const s = Da(t, e, a, o), l = await Xt(s), c = [];
|
|
7897
7896
|
for (const d of i) {
|
|
7898
7897
|
for (const [A, u] of r.entries())
|
|
7899
7898
|
c.push(new Ca(d, A, u));
|
|
@@ -8237,7 +8236,7 @@ class qo {
|
|
|
8237
8236
|
colors: {},
|
|
8238
8237
|
id: g,
|
|
8239
8238
|
svg: d,
|
|
8240
|
-
type:
|
|
8239
|
+
type: D.Illustration,
|
|
8241
8240
|
y: A.top,
|
|
8242
8241
|
x: A.left,
|
|
8243
8242
|
rotation: A.rotation,
|
|
@@ -8373,7 +8372,7 @@ class Ho {
|
|
|
8373
8372
|
stepRegionIndex: u,
|
|
8374
8373
|
id: m,
|
|
8375
8374
|
src: o,
|
|
8376
|
-
type:
|
|
8375
|
+
type: D.Image,
|
|
8377
8376
|
y: A.top,
|
|
8378
8377
|
x: A.left,
|
|
8379
8378
|
rotation: A.rotation,
|
|
@@ -8597,7 +8596,7 @@ class Yo {
|
|
|
8597
8596
|
colors: f,
|
|
8598
8597
|
id: S,
|
|
8599
8598
|
svg: p,
|
|
8600
|
-
type:
|
|
8599
|
+
type: D.Illustration,
|
|
8601
8600
|
y: u.top,
|
|
8602
8601
|
x: u.left,
|
|
8603
8602
|
rotation: u.rotation,
|
|
@@ -8920,7 +8919,7 @@ class Xo {
|
|
|
8920
8919
|
}
|
|
8921
8920
|
getProcessedInput(t, e, a) {
|
|
8922
8921
|
const i = a ? t : this.injectReplaceableText(t, e);
|
|
8923
|
-
return
|
|
8922
|
+
return De(i, {
|
|
8924
8923
|
vertical: e.vertical,
|
|
8925
8924
|
uppercase: e.uppercase
|
|
8926
8925
|
});
|
|
@@ -9197,8 +9196,8 @@ class Xo {
|
|
|
9197
9196
|
const f = a.colorOption;
|
|
9198
9197
|
let S;
|
|
9199
9198
|
if (f && f.variants) {
|
|
9200
|
-
const
|
|
9201
|
-
S = this.createTextFillSpotColor(f,
|
|
9199
|
+
const F = f.variants.find((q) => q.id === f.defaultVariant?.id) || f.variants[0];
|
|
9200
|
+
S = this.createTextFillSpotColor(f, F), o.updateStorage(t, {
|
|
9202
9201
|
colorProfileAssetKey: f.colorProfile?.key
|
|
9203
9202
|
});
|
|
9204
9203
|
}
|
|
@@ -9216,7 +9215,7 @@ class Xo {
|
|
|
9216
9215
|
rotation: u.rotation,
|
|
9217
9216
|
text: c,
|
|
9218
9217
|
input: s,
|
|
9219
|
-
type:
|
|
9218
|
+
type: D.Textbox,
|
|
9220
9219
|
vertical: a.vertical,
|
|
9221
9220
|
x: u.left,
|
|
9222
9221
|
y: u.top,
|
|
@@ -9553,7 +9552,7 @@ const ls = [
|
|
|
9553
9552
|
{
|
|
9554
9553
|
id: m,
|
|
9555
9554
|
src: d,
|
|
9556
|
-
type:
|
|
9555
|
+
type: D.Image,
|
|
9557
9556
|
y: h.top,
|
|
9558
9557
|
x: h.left,
|
|
9559
9558
|
width: h.width,
|
|
@@ -9592,7 +9591,7 @@ const ls = [
|
|
|
9592
9591
|
{
|
|
9593
9592
|
id: u,
|
|
9594
9593
|
path: A.path,
|
|
9595
|
-
type:
|
|
9594
|
+
type: D.Frame,
|
|
9596
9595
|
forceImageCover: a.data.forceImageCover,
|
|
9597
9596
|
x: c.left,
|
|
9598
9597
|
y: c.top,
|
|
@@ -9643,7 +9642,7 @@ const ls = [
|
|
|
9643
9642
|
return console.error("Failed to read SVG."), [];
|
|
9644
9643
|
xa(g);
|
|
9645
9644
|
const m = {};
|
|
9646
|
-
|
|
9645
|
+
Ft(g, (v) => {
|
|
9647
9646
|
ls.includes(v.tagName) && !v.attributes.getNamedItem("fill") && v.setAttribute("fill", "#000000");
|
|
9648
9647
|
const E = v.attributes.getNamedItem("fill");
|
|
9649
9648
|
if (E && E.value !== "none") {
|
|
@@ -9675,7 +9674,7 @@ const ls = [
|
|
|
9675
9674
|
colors: m,
|
|
9676
9675
|
id: I,
|
|
9677
9676
|
svg: f,
|
|
9678
|
-
type:
|
|
9677
|
+
type: D.Illustration,
|
|
9679
9678
|
y: v.top,
|
|
9680
9679
|
x: v.left,
|
|
9681
9680
|
rotation: v.rotation,
|
|
@@ -9704,7 +9703,7 @@ const ls = [
|
|
|
9704
9703
|
colors: {},
|
|
9705
9704
|
id: d,
|
|
9706
9705
|
svg: s,
|
|
9707
|
-
type:
|
|
9706
|
+
type: D.Illustration,
|
|
9708
9707
|
y: l.top,
|
|
9709
9708
|
x: l.left,
|
|
9710
9709
|
rotation: l.rotation,
|
|
@@ -9745,7 +9744,7 @@ const ls = [
|
|
|
9745
9744
|
{
|
|
9746
9745
|
id: u,
|
|
9747
9746
|
src: s,
|
|
9748
|
-
type:
|
|
9747
|
+
type: D.Image,
|
|
9749
9748
|
y: d.top,
|
|
9750
9749
|
x: d.left,
|
|
9751
9750
|
rotation: d.rotation,
|
|
@@ -9802,7 +9801,7 @@ const ls = [
|
|
|
9802
9801
|
colors: h,
|
|
9803
9802
|
id: g,
|
|
9804
9803
|
svg: A,
|
|
9805
|
-
type:
|
|
9804
|
+
type: D.Illustration,
|
|
9806
9805
|
y: c.top,
|
|
9807
9806
|
x: c.left,
|
|
9808
9807
|
rotation: c.rotation,
|
|
@@ -9821,7 +9820,7 @@ const ls = [
|
|
|
9821
9820
|
return console.error(c), [];
|
|
9822
9821
|
}
|
|
9823
9822
|
}, ms = async (n, t, e) => {
|
|
9824
|
-
const a = [], r = t.type === b.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ?
|
|
9823
|
+
const a = [], r = t.type === b.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ? D.Image : (r.endsWith(".svg"), D.Illustration), l = t.data.regions;
|
|
9825
9824
|
if (s === "image")
|
|
9826
9825
|
try {
|
|
9827
9826
|
l.forEach((c) => {
|
|
@@ -9905,7 +9904,7 @@ const ls = [
|
|
|
9905
9904
|
assetUrl: p,
|
|
9906
9905
|
name: f.names.fullName.en
|
|
9907
9906
|
};
|
|
9908
|
-
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u =
|
|
9907
|
+
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u = De(A, {
|
|
9909
9908
|
vertical: a.data.vertical,
|
|
9910
9909
|
uppercase: a.data.uppercase
|
|
9911
9910
|
}), h = async (p) => {
|
|
@@ -9930,7 +9929,7 @@ const ls = [
|
|
|
9930
9929
|
paths: a.data.paths,
|
|
9931
9930
|
rotation: p.rotation,
|
|
9932
9931
|
text: u,
|
|
9933
|
-
type:
|
|
9932
|
+
type: D.Textbox,
|
|
9934
9933
|
vertical: a.data.vertical,
|
|
9935
9934
|
verticalAlign: a.data.verticalAlign || "middle",
|
|
9936
9935
|
width: p.width,
|
|
@@ -9943,7 +9942,7 @@ const ls = [
|
|
|
9943
9942
|
d,
|
|
9944
9943
|
p,
|
|
9945
9944
|
[
|
|
9946
|
-
|
|
9945
|
+
De(u, {
|
|
9947
9946
|
vertical: a.data.vertical,
|
|
9948
9947
|
uppercase: a.data.uppercase
|
|
9949
9948
|
})
|
|
@@ -10516,7 +10515,7 @@ const kd = (n, t) => {
|
|
|
10516
10515
|
}
|
|
10517
10516
|
}
|
|
10518
10517
|
}
|
|
10519
|
-
`,
|
|
10518
|
+
`, Ds = C`
|
|
10520
10519
|
query GetBundlesForCustomer($id: String!) {
|
|
10521
10520
|
customers(ids: [$id]) {
|
|
10522
10521
|
bundleStakeholders {
|
|
@@ -10545,7 +10544,7 @@ const kd = (n, t) => {
|
|
|
10545
10544
|
}
|
|
10546
10545
|
}
|
|
10547
10546
|
}
|
|
10548
|
-
`,
|
|
10547
|
+
`, Fs = C`
|
|
10549
10548
|
${Ra(!1)}
|
|
10550
10549
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
|
10551
10550
|
productCollections(ids: [$id], productIds: $productIds) {
|
|
@@ -12613,22 +12612,22 @@ const pl = async (n, t) => {
|
|
|
12613
12612
|
for (const R of Object.keys(r)) {
|
|
12614
12613
|
const B = r[R], T = t.steps.find((L) => L.stepName === R);
|
|
12615
12614
|
for (let L = 0; L < B.selections.length; ++L) {
|
|
12616
|
-
const
|
|
12615
|
+
const F = B.selections[L];
|
|
12617
12616
|
if (T && (!E || T.option && (T.option.variants || []).length > 1 && !T.data.hideSelectionInCart && !T.data.hideSelectionsInCart)) {
|
|
12618
12617
|
const q = T.stepTitle;
|
|
12619
12618
|
I[q] ? I[q].push({
|
|
12620
|
-
id:
|
|
12621
|
-
name:
|
|
12622
|
-
priceModifier:
|
|
12619
|
+
id: F.id || "",
|
|
12620
|
+
name: F.name,
|
|
12621
|
+
priceModifier: F.priceModifier
|
|
12623
12622
|
}) : I[q] = [
|
|
12624
12623
|
{
|
|
12625
|
-
id:
|
|
12626
|
-
name:
|
|
12627
|
-
priceModifier:
|
|
12624
|
+
id: F.id || "",
|
|
12625
|
+
name: F.name,
|
|
12626
|
+
priceModifier: F.priceModifier
|
|
12628
12627
|
}
|
|
12629
12628
|
];
|
|
12630
12629
|
}
|
|
12631
|
-
N +=
|
|
12630
|
+
N += F.priceModifier;
|
|
12632
12631
|
}
|
|
12633
12632
|
}
|
|
12634
12633
|
return [I, N];
|
|
@@ -13084,9 +13083,6 @@ class bl {
|
|
|
13084
13083
|
getBundle() {
|
|
13085
13084
|
return this.bundle;
|
|
13086
13085
|
}
|
|
13087
|
-
getBundleIndex() {
|
|
13088
|
-
return this.transaction.bundleIndex;
|
|
13089
|
-
}
|
|
13090
13086
|
setBundle(t) {
|
|
13091
13087
|
this.bundle = t;
|
|
13092
13088
|
}
|
|
@@ -13543,7 +13539,7 @@ class Pl {
|
|
|
13543
13539
|
return e?.type === "Color" ? new cn(this.bundle, t, e) : new gi(this.bundle, t, e);
|
|
13544
13540
|
}
|
|
13545
13541
|
case z.Text:
|
|
13546
|
-
return new
|
|
13542
|
+
return new Dl(this.bundle, t);
|
|
13547
13543
|
default:
|
|
13548
13544
|
throw new Error("Unhandled Global Property Aspect Type");
|
|
13549
13545
|
}
|
|
@@ -13702,7 +13698,7 @@ class xl extends Oa {
|
|
|
13702
13698
|
return U.getLocalOrFromServer(t);
|
|
13703
13699
|
}
|
|
13704
13700
|
async getImageWithColors() {
|
|
13705
|
-
return await this.loadImageData(), this.imageData?.svg ? Ia(
|
|
13701
|
+
return await this.loadImageData(), this.imageData?.svg ? Ia(Fa(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
|
13706
13702
|
}
|
|
13707
13703
|
/**
|
|
13708
13704
|
* Retrieves the original, unmodified image selection, if one exists.
|
|
@@ -13836,7 +13832,7 @@ class xl extends Oa {
|
|
|
13836
13832
|
);
|
|
13837
13833
|
}
|
|
13838
13834
|
}
|
|
13839
|
-
class
|
|
13835
|
+
class Dl extends Oa {
|
|
13840
13836
|
constructor(t, e) {
|
|
13841
13837
|
super(t, e);
|
|
13842
13838
|
}
|
|
@@ -13987,8 +13983,8 @@ class cn extends gi {
|
|
|
13987
13983
|
return this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.customColor || this.getCurrentVariant()?.getColor() || "#ffffff";
|
|
13988
13984
|
}
|
|
13989
13985
|
}
|
|
13990
|
-
const
|
|
13991
|
-
const i =
|
|
13986
|
+
const Fl = (n, t, e, a) => n.flatMap((i) => i.getSteps()).filter((i) => i.getGlobalPropertyAspects(t).includes(e) && i.getType() === a), kl = (n, t, e) => {
|
|
13987
|
+
const i = Fl(
|
|
13992
13988
|
n,
|
|
13993
13989
|
t,
|
|
13994
13990
|
e,
|
|
@@ -14441,7 +14437,7 @@ class pi {
|
|
|
14441
14437
|
if (this.fullFetched)
|
|
14442
14438
|
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new ge(a));
|
|
14443
14439
|
const e = await y.getShadowGraphqlClient().query({
|
|
14444
|
-
query:
|
|
14440
|
+
query: Fs,
|
|
14445
14441
|
variables: {
|
|
14446
14442
|
id: this.getId(),
|
|
14447
14443
|
productIds: t
|
|
@@ -15114,13 +15110,21 @@ class dn {
|
|
|
15114
15110
|
}
|
|
15115
15111
|
}
|
|
15116
15112
|
async addWorkflowExperience(t) {
|
|
15117
|
-
await this.initializeAdditionalRequiredColorChannels(t), t.setBundle(this), await this.appendWorkflowExperience(t), await this.injectExperienceIntoPreviewService(t), await t.getWorkflowManager().getInitializationPromise();
|
|
15113
|
+
console.log(`log: awe 1 ${Date.now()}`), await this.initializeAdditionalRequiredColorChannels(t), console.log(`log: awe 2 ${Date.now()}`), t.setBundle(this), console.log(`log: awe 3 ${Date.now()}`), await this.appendWorkflowExperience(t), console.log(`log: awe 4 ${Date.now()}`), await this.injectExperienceIntoPreviewService(t), console.log(`log: awe 5 ${Date.now()}`), await t.getWorkflowManager().getInitializationPromise(), console.log(`log: awe 6 ${Date.now()}`);
|
|
15118
15114
|
const e = await this.getGlobalProperties();
|
|
15115
|
+
console.log(`log: awe 7 ${Date.now()}`);
|
|
15119
15116
|
for (const a of e)
|
|
15120
|
-
await a.applyGlobalState([t]);
|
|
15117
|
+
await a.applyGlobalState([t]), console.log(`log: awe global ${Date.now()}`);
|
|
15121
15118
|
this.fireEvent("workflow-experience-added", {
|
|
15122
15119
|
workflowExperiences: [t]
|
|
15123
|
-
})
|
|
15120
|
+
}), console.log(`log: awe 8 ${Date.now()}`), Promise.resolve().then(
|
|
15121
|
+
() => console.log("f microtask:", Date.now())
|
|
15122
|
+
), setTimeout(
|
|
15123
|
+
() => console.log("f timeout:", Date.now()),
|
|
15124
|
+
0
|
|
15125
|
+
), requestAnimationFrame(
|
|
15126
|
+
() => console.log("f raf:", Date.now())
|
|
15127
|
+
);
|
|
15124
15128
|
}
|
|
15125
15129
|
async addWorkflowExperiences(t) {
|
|
15126
15130
|
for (const s of t)
|
|
@@ -15282,11 +15286,7 @@ class dn {
|
|
|
15282
15286
|
this.workflowExperiences[t] = this.workflowExperiences[e], this.workflowExperiences[e] = a, await this.updateTransactionOrder();
|
|
15283
15287
|
}
|
|
15284
15288
|
getWorkflowExperiences() {
|
|
15285
|
-
|
|
15286
|
-
const r = a.getBundleIndex(), o = i.getBundleIndex();
|
|
15287
|
-
return r === void 0 || o === void 0 ? 0 : r < o ? -1 : 1;
|
|
15288
|
-
};
|
|
15289
|
-
return t.sort(e), t;
|
|
15289
|
+
return [...this.workflowExperiences];
|
|
15290
15290
|
}
|
|
15291
15291
|
async sortWorkflowExperiences(t) {
|
|
15292
15292
|
this.workflowExperiences = this.workflowExperiences.sort(t), await this.updateTransactionOrder();
|
|
@@ -16166,7 +16166,7 @@ class Od {
|
|
|
16166
16166
|
} catch (a) {
|
|
16167
16167
|
throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
|
|
16168
16168
|
}
|
|
16169
|
-
}, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.1.0-beta.
|
|
16169
|
+
}, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.1.0-beta.e726c178-ca4d-5f86-9fa4-962d8fc2d6fc"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16170
16170
|
}
|
|
16171
16171
|
configure(t) {
|
|
16172
16172
|
pt.setHubUrl(t.hubUrl), pt.setServerUrl(t.serverUrl), pt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && rr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16589,7 +16589,7 @@ class Od {
|
|
|
16589
16589
|
if (!this.customer)
|
|
16590
16590
|
throw new Error("Customer not authenticated.");
|
|
16591
16591
|
const t = await y.getShadowGraphqlClient().query({
|
|
16592
|
-
query:
|
|
16592
|
+
query: Ds,
|
|
16593
16593
|
variables: {
|
|
16594
16594
|
id: this.customer.id
|
|
16595
16595
|
},
|
|
@@ -16638,12 +16638,12 @@ class Od {
|
|
|
16638
16638
|
},
|
|
16639
16639
|
errorPolicy: "all",
|
|
16640
16640
|
fetchPolicy: "no-cache"
|
|
16641
|
-
}),
|
|
16642
|
-
if (A = A +
|
|
16641
|
+
}), F = L.data.transactions;
|
|
16642
|
+
if (A = A + F.length, i && i(A, o.length), F.length !== B.length) {
|
|
16643
16643
|
const q = L.errors?.[0]?.message || "Unknown error";
|
|
16644
16644
|
throw new gt(`Not all transactions were found: ${q}`);
|
|
16645
16645
|
}
|
|
16646
|
-
return !this.activeIntegration &&
|
|
16646
|
+
return !this.activeIntegration && F[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(F[0].integrationProduct.integration)), F.map((q, qe) => ({
|
|
16647
16647
|
transaction: q,
|
|
16648
16648
|
workflowId: q.workflowId,
|
|
16649
16649
|
readOnly: B.find((At) => At.option.transactionId === q.id)?.option.readOnly ?? !1,
|
|
@@ -16655,15 +16655,15 @@ class Od {
|
|
|
16655
16655
|
const T = await u.mutate({
|
|
16656
16656
|
mutation: $r,
|
|
16657
16657
|
variables: {
|
|
16658
|
-
inputs: B.map((
|
|
16659
|
-
integrationProductId:
|
|
16660
|
-
externalIntegrationId:
|
|
16661
|
-
externalProductId:
|
|
16662
|
-
workflowId:
|
|
16663
|
-
designName:
|
|
16658
|
+
inputs: B.map((F) => ({
|
|
16659
|
+
integrationProductId: F.option.type === "integration" ? F.option.integrationProductId : void 0,
|
|
16660
|
+
externalIntegrationId: F.option.type === "external" ? F.option.externalIntegrationId : void 0,
|
|
16661
|
+
externalProductId: F.option.type === "external" ? F.option.externalProductId : void 0,
|
|
16662
|
+
workflowId: F.option.workflowId,
|
|
16663
|
+
designName: F.option.designName,
|
|
16664
16664
|
claim: !0,
|
|
16665
|
-
quantity:
|
|
16666
|
-
recipient:
|
|
16665
|
+
quantity: F.option.quantity,
|
|
16666
|
+
recipient: F.option.recipient
|
|
16667
16667
|
})),
|
|
16668
16668
|
marketplaceThemeInstallId: this.marketplaceThemeInstallId,
|
|
16669
16669
|
marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
|
|
@@ -16672,12 +16672,12 @@ class Od {
|
|
|
16672
16672
|
fetchPolicy: "no-cache"
|
|
16673
16673
|
}), L = T.data?.transactionCreateMany;
|
|
16674
16674
|
if (!L || L.length === 0) {
|
|
16675
|
-
const
|
|
16676
|
-
throw new gt(`Failed to create transactions: ${
|
|
16675
|
+
const F = T.errors?.[0]?.message || "Unknown error";
|
|
16676
|
+
throw new gt(`Failed to create transactions: ${F}`);
|
|
16677
16677
|
}
|
|
16678
|
-
return A = A + L.length, i && i(A, o.length), L.map((
|
|
16679
|
-
transaction:
|
|
16680
|
-
workflowId:
|
|
16678
|
+
return A = A + L.length, i && i(A, o.length), L.map((F, q) => ({
|
|
16679
|
+
transaction: F,
|
|
16680
|
+
workflowId: F.workflowId,
|
|
16681
16681
|
readOnly: !1,
|
|
16682
16682
|
index: B[q].index
|
|
16683
16683
|
}));
|
|
@@ -16692,7 +16692,7 @@ class Od {
|
|
|
16692
16692
|
(async () => p.length > 0 ? await sc(p) : [])(),
|
|
16693
16693
|
(async () => f.length > 0 ? await Ci(f, e) : [])()
|
|
16694
16694
|
]), x = new Map(S.map((B) => [B.id, B])), v = new Map(w.map((B) => [B.id, B])), E = m.map(async (B) => {
|
|
16695
|
-
const { transaction: T, workflowId: L, readOnly:
|
|
16695
|
+
const { transaction: T, workflowId: L, readOnly: F, index: q } = B, qe = L ? v.get(L) : void 0, At = t[q];
|
|
16696
16696
|
if (T.integrationProductId) {
|
|
16697
16697
|
const it = x.get(T.integrationProductId);
|
|
16698
16698
|
T.integrationProduct = it, T.product = it?.product, T.integrationProduct || console.error("failed to find transaction's product");
|
|
@@ -16706,20 +16706,20 @@ class Od {
|
|
|
16706
16706
|
workflow: qe,
|
|
16707
16707
|
transaction: T,
|
|
16708
16708
|
singleVariantsRenderable: At?.workflowConfiguration?.singleVariantsRenderable,
|
|
16709
|
-
stateMutationFunc:
|
|
16709
|
+
stateMutationFunc: F ? async () => {
|
|
16710
16710
|
throw new Q("State mutation is forbidden in read only mode!");
|
|
16711
16711
|
} : async (it) => this.updateTransactionState({
|
|
16712
16712
|
...it,
|
|
16713
16713
|
context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId }
|
|
16714
16714
|
}),
|
|
16715
16715
|
graphQlClient: () => vi,
|
|
16716
|
-
readOnly:
|
|
16716
|
+
readOnly: F,
|
|
16717
16717
|
isReloadedTransaction: At.type === "transaction"
|
|
16718
16718
|
};
|
|
16719
16719
|
if (At.type === "transaction" && T.workflowState) {
|
|
16720
16720
|
const it = JSON.parse(T.workflowState);
|
|
16721
16721
|
await Za(it), se.reloadedState = it;
|
|
16722
|
-
} else if (!
|
|
16722
|
+
} else if (!F && At.workflowState) {
|
|
16723
16723
|
const it = JSON.parse(At.workflowState);
|
|
16724
16724
|
await Za(it), se.reloadedState = it;
|
|
16725
16725
|
}
|
|
@@ -16727,8 +16727,8 @@ class Od {
|
|
|
16727
16727
|
}), N = (await Promise.all(E)).sort((B, T) => B.index - T.index);
|
|
16728
16728
|
let R = [];
|
|
16729
16729
|
for (const B of N) {
|
|
16730
|
-
const { experienceOptions: T, options: L } = B,
|
|
16731
|
-
await
|
|
16730
|
+
const { experienceOptions: T, options: L } = B, F = new bl(this, T);
|
|
16731
|
+
await F.getWorkflowManager().getInitializationPromise(), a && a(), L.type !== "transaction" && this.customer && await F.attachCustomerDetails({ email: this.customer.emailAddress }), R = [...R, F], F.getWorkflowManager().setWorkflowStateSyncEnabled(!0);
|
|
16732
16732
|
}
|
|
16733
16733
|
return R;
|
|
16734
16734
|
}
|
|
@@ -16960,7 +16960,7 @@ class dc {
|
|
|
16960
16960
|
getImageSrc() {
|
|
16961
16961
|
if (this.imageData) {
|
|
16962
16962
|
if (this.imageData.svg) {
|
|
16963
|
-
const t =
|
|
16963
|
+
const t = Fa(this.imageData.svg, this.imageData.colors || {}, !1);
|
|
16964
16964
|
return Ia(t);
|
|
16965
16965
|
}
|
|
16966
16966
|
return this.imageData.src;
|
|
@@ -17828,7 +17828,7 @@ const Si = C`
|
|
|
17828
17828
|
}
|
|
17829
17829
|
}
|
|
17830
17830
|
`;
|
|
17831
|
-
var
|
|
17831
|
+
var Dc = /* @__PURE__ */ ((n) => (n.Confirmed = "Confirmed", n.Plausible = "Plausible", n.Unlikely = "Unlikely", n))(Dc || {}), Fc = /* @__PURE__ */ ((n) => (n.Created = "Created", n.Processing = "Processing", n.Completed = "Completed", n.Failed = "Failed", n.Cancelled = "Cancelled", n))(Fc || {});
|
|
17832
17832
|
const eA = async (n) => {
|
|
17833
17833
|
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().query({
|
|
17834
17834
|
query: Ic,
|
|
@@ -17901,14 +17901,14 @@ const eA = async (n) => {
|
|
|
17901
17901
|
})).data.integrationProducts;
|
|
17902
17902
|
export {
|
|
17903
17903
|
ba as AddonHandle,
|
|
17904
|
-
|
|
17905
|
-
|
|
17904
|
+
Fc as AddressValidationJobStatus,
|
|
17905
|
+
Dc as AddressValidationResultConfirmationLevel,
|
|
17906
17906
|
bn as AddressValidationStatus,
|
|
17907
17907
|
Rd as ArrayInput,
|
|
17908
17908
|
z as AspectType,
|
|
17909
17909
|
bt as AssetNotFoundError,
|
|
17910
17910
|
Ee as AssetType,
|
|
17911
|
-
|
|
17911
|
+
Dd as BringForwardCommand,
|
|
17912
17912
|
xd as BringToBackCommand,
|
|
17913
17913
|
Pd as BringToFrontCommand,
|
|
17914
17914
|
Vi as BundleDesignCreationCartAddMode,
|
|
@@ -17943,7 +17943,7 @@ export {
|
|
|
17943
17943
|
An as IntegrationProduct,
|
|
17944
17944
|
Gi as IntegrationType,
|
|
17945
17945
|
vd as LayoutElementFactory,
|
|
17946
|
-
|
|
17946
|
+
D as LayoutElementType,
|
|
17947
17947
|
J as LayoutNotFoundError,
|
|
17948
17948
|
Yt as LayoutRenderingPurpose,
|
|
17949
17949
|
rl as MaterialStepHandle,
|
|
@@ -17970,7 +17970,7 @@ export {
|
|
|
17970
17970
|
Jt as ResourceNotFoundError,
|
|
17971
17971
|
bd as RotateCommand,
|
|
17972
17972
|
j as ScaleAxis,
|
|
17973
|
-
|
|
17973
|
+
Fd as SendBackwardsCommand,
|
|
17974
17974
|
cl as ShapeStepHandle,
|
|
17975
17975
|
zi as ShareActionType,
|
|
17976
17976
|
Od as SpiffCommerceClient,
|
|
@@ -17980,7 +17980,7 @@ export {
|
|
|
17980
17980
|
b as StepType,
|
|
17981
17981
|
kt as TextAlgorithm,
|
|
17982
17982
|
$o as TextChangeCommand,
|
|
17983
|
-
|
|
17983
|
+
Dl as TextGlobalPropertyHandle,
|
|
17984
17984
|
Qd as TextInput,
|
|
17985
17985
|
dl as TextStepHandle,
|
|
17986
17986
|
Vl as Transform,
|
|
@@ -18052,7 +18052,7 @@ export {
|
|
|
18052
18052
|
$l as metafieldManager,
|
|
18053
18053
|
wd as mmPerPixel,
|
|
18054
18054
|
si as modelStepService,
|
|
18055
|
-
|
|
18055
|
+
Fa as modifySVGColors,
|
|
18056
18056
|
li as moduleStepService,
|
|
18057
18057
|
Wd as nameBundle,
|
|
18058
18058
|
qd as nameTransaction,
|