@spiffcommerce/core 31.2.2 → 31.2.3-beta.31c9ba15-a663-564f-ae8f-4ab38e25e1d4
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.d.ts +4 -0
- package/dist/index.js +41 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +200 -189
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -6,11 +6,11 @@ import { removeTypenameFromVariables as mr } from "@apollo/client/link/remove-ty
|
|
6
6
|
import { orientation as gr } from "exifr/dist/mini.umd.cjs";
|
7
7
|
import { parse as ln } from "css";
|
8
8
|
import pr from "fuse.js";
|
9
|
-
import { Pith as
|
9
|
+
import { Pith as ua } from "pith";
|
10
10
|
import St from "lodash.clonedeep";
|
11
11
|
import { toString as cn } from "qrcode";
|
12
12
|
import fr from "svg-path-bbox";
|
13
|
-
import { parse as
|
13
|
+
import { parse as ea } 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";
|
@@ -19,11 +19,11 @@ import { CognitoIdentityProviderClient as yr, InitiateAuthCommand as ka, Respond
|
|
19
19
|
import vr from "dinero.js";
|
20
20
|
import * as Ma from "currency-codes";
|
21
21
|
import dn from "lodash.isequal";
|
22
|
-
import { split as
|
22
|
+
import { split as aa } from "unicode-default-word-boundary";
|
23
23
|
import An from "lodash.debounce";
|
24
24
|
import "fs";
|
25
25
|
import "path";
|
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 || {}),
|
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 || {}), ha = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ha || {}), 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
27
|
class un extends Error {
|
28
28
|
constructor(t) {
|
29
29
|
super(t), this.name = this.constructor.name;
|
@@ -59,27 +59,27 @@ class Ee extends Xt {
|
|
59
59
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
60
60
|
}
|
61
61
|
}
|
62
|
-
class
|
62
|
+
class ke extends un {
|
63
63
|
constructor(t) {
|
64
64
|
super(`ImplementationError - ${t}`);
|
65
65
|
}
|
66
66
|
}
|
67
|
-
class V extends
|
67
|
+
class V extends ke {
|
68
68
|
constructor(t) {
|
69
69
|
super(`Unhandled Behavior Encountered: ${t}`);
|
70
70
|
}
|
71
71
|
}
|
72
|
-
class Dt extends
|
72
|
+
class Dt extends ke {
|
73
73
|
constructor(t) {
|
74
74
|
super(`Parsing Error: ${t}`);
|
75
75
|
}
|
76
76
|
}
|
77
|
-
class ht extends
|
77
|
+
class ht extends ke {
|
78
78
|
constructor(t) {
|
79
79
|
super(`Client Error: ${t}`);
|
80
80
|
}
|
81
81
|
}
|
82
|
-
class
|
82
|
+
class Me extends ke {
|
83
83
|
constructor(t) {
|
84
84
|
super(`Resource Generation Failed: ${t}`);
|
85
85
|
}
|
@@ -161,27 +161,27 @@ class kr {
|
|
161
161
|
}
|
162
162
|
}
|
163
163
|
const gt = new kr();
|
164
|
-
let
|
164
|
+
let na, ra;
|
165
165
|
function Tc(r) {
|
166
|
-
|
166
|
+
na = r;
|
167
167
|
}
|
168
168
|
function Nc(r) {
|
169
|
-
|
169
|
+
ra = r;
|
170
170
|
}
|
171
171
|
function Zt() {
|
172
|
-
return
|
172
|
+
return na ? new na().window : (console.log(
|
173
173
|
"DOM constructor is not registered. Assuming browser environment. If not, please register DOM constructor before calling this function."
|
174
174
|
), window);
|
175
175
|
}
|
176
176
|
function rt(r, t) {
|
177
|
-
if (!
|
177
|
+
if (!ra) {
|
178
178
|
if (typeof window < "u" && window.fetch)
|
179
179
|
return window.fetch(r, t);
|
180
180
|
if (typeof global < "u" && global.fetch)
|
181
181
|
return global.fetch(r, t);
|
182
182
|
throw new Error("Fetch implementation is not registered. Please register it before calling this function.");
|
183
183
|
}
|
184
|
-
return
|
184
|
+
return ra(r, t);
|
185
185
|
}
|
186
186
|
const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @__PURE__ */ new Map(), mn = async (r) => {
|
187
187
|
const t = Na.get(r);
|
@@ -206,7 +206,7 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
|
|
206
206
|
return new DOMParser();
|
207
207
|
const r = Zt();
|
208
208
|
return new r.DOMParser();
|
209
|
-
}, Nr = () => Tt([typeof DOMParser]) ? DOMParser : Zt().DOMParser,
|
209
|
+
}, Nr = () => Tt([typeof DOMParser]) ? DOMParser : Zt().DOMParser, Te = (r, t) => new Promise((e, a) => {
|
210
210
|
t ? mn(r).then(e).catch(a) : rt(r).then((n) => {
|
211
211
|
n.arrayBuffer().then(e).catch(a);
|
212
212
|
}).catch((n) => {
|
@@ -216,21 +216,21 @@ 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
|
-
}), gn = (r) => hr(r),
|
219
|
+
}), gn = (r) => hr(r), Le = /* @__PURE__ */ new Map(), Qr = async (r, t) => {
|
220
220
|
if (Tt([typeof FontFace])) {
|
221
|
-
if (
|
222
|
-
return
|
221
|
+
if (Le.has(t))
|
222
|
+
return Le.get(t);
|
223
223
|
const e = r.names.fullName.en, a = new FontFace(e, `url(${t})`);
|
224
224
|
document.fonts.add(a);
|
225
225
|
const n = a.load();
|
226
|
-
return
|
226
|
+
return Le.set(t, n), n;
|
227
227
|
}
|
228
228
|
}, Bt = () => {
|
229
229
|
if (Tt([typeof XMLSerializer]))
|
230
230
|
return new XMLSerializer();
|
231
231
|
const r = Zt();
|
232
232
|
return new r.XMLSerializer();
|
233
|
-
}, Ra = (r) => btoa(r),
|
233
|
+
}, Ra = (r) => btoa(r), Ne = (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 mn(r), e = hn.get(r) ||
|
260
|
+
const t = await mn(r), e = hn.get(r) || Ne(t);
|
261
261
|
return await $r(new Blob([t], { type: e }));
|
262
262
|
}, Rr = (r) => {
|
263
263
|
let t = "";
|
@@ -266,9 +266,9 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
|
|
266
266
|
t += String.fromCharCode(r[a]);
|
267
267
|
return t;
|
268
268
|
}, Or = async (r) => {
|
269
|
-
const t =
|
269
|
+
const t = Ne(r), e = new Uint8Array(r), a = Rr(e), n = btoa(a);
|
270
270
|
return `data:${t};base64,${n}`;
|
271
|
-
},
|
271
|
+
}, ma = (r) => `data:image/svg+xml;base64,${btoa(r)}`, pn = (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");
|
@@ -287,10 +287,10 @@ const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
|
|
287
287
|
!i || !i.result ? e() : t(i.result.toString());
|
288
288
|
}, a.readAsDataURL(r);
|
289
289
|
});
|
290
|
-
let Ur,
|
290
|
+
let Ur, ga;
|
291
291
|
const Lr = (r) => {
|
292
|
-
|
293
|
-
}, Vr = () =>
|
292
|
+
ga = r;
|
293
|
+
}, Vr = () => ga;
|
294
294
|
let fn;
|
295
295
|
const zr = (r) => {
|
296
296
|
fn = r;
|
@@ -301,7 +301,7 @@ const zr = (r) => {
|
|
301
301
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
|
302
302
|
}), Wr = async () => {
|
303
303
|
const r = {
|
304
|
-
applicationKey:
|
304
|
+
applicationKey: ga,
|
305
305
|
customerToken: Ur,
|
306
306
|
bearer: fn
|
307
307
|
};
|
@@ -364,10 +364,10 @@ class jr {
|
|
364
364
|
}
|
365
365
|
}
|
366
366
|
const y = new jr();
|
367
|
-
let
|
367
|
+
let ia, sa;
|
368
368
|
const pt = (r, t, e) => {
|
369
|
-
if (
|
370
|
-
return
|
369
|
+
if (ia !== void 0)
|
370
|
+
return ia(r, t, e);
|
371
371
|
try {
|
372
372
|
const a = wn(!0);
|
373
373
|
return Cn(a), a.createCanvas(r, t, e);
|
@@ -375,8 +375,8 @@ const pt = (r, t, e) => {
|
|
375
375
|
throw new Error("Canvas module not set");
|
376
376
|
}
|
377
377
|
}, te = (r, t) => {
|
378
|
-
if (
|
379
|
-
return
|
378
|
+
if (sa !== void 0)
|
379
|
+
return sa(r, t);
|
380
380
|
try {
|
381
381
|
const e = wn(!0);
|
382
382
|
return Cn(e), e.loadImage(r, t);
|
@@ -385,7 +385,7 @@ const pt = (r, t, e) => {
|
|
385
385
|
}
|
386
386
|
};
|
387
387
|
function Cn(r) {
|
388
|
-
|
388
|
+
ia = r?.createCanvas, sa = r?.loadImage;
|
389
389
|
}
|
390
390
|
function wn(r) {
|
391
391
|
try {
|
@@ -406,13 +406,13 @@ function wn(r) {
|
|
406
406
|
throw t;
|
407
407
|
}
|
408
408
|
}
|
409
|
-
let
|
410
|
-
function
|
411
|
-
return
|
409
|
+
let Ve;
|
410
|
+
function pa() {
|
411
|
+
return Ve === void 0 && (Ve = Nr()), Ve;
|
412
412
|
}
|
413
413
|
let oe = null;
|
414
414
|
const Hr = (r) => new Promise((t) => {
|
415
|
-
if (
|
415
|
+
if (Ne(r) !== "image/jpeg")
|
416
416
|
return t(1);
|
417
417
|
gr(r).then((a) => t(a || 1)).catch(() => t(1));
|
418
418
|
}), Yr = async () => {
|
@@ -454,9 +454,9 @@ const Hr = (r) => new Promise((t) => {
|
|
454
454
|
break;
|
455
455
|
}
|
456
456
|
return d.drawImage(e, 0, 0, o, l), c;
|
457
|
-
},
|
457
|
+
}, Qe = async (r) => {
|
458
458
|
const t = await Kr(r);
|
459
|
-
return
|
459
|
+
return Ne(r) === "image/jpeg" ? {
|
460
460
|
dataUrl: t.toDataURL("image/jpeg", 1),
|
461
461
|
height: t.height,
|
462
462
|
width: t.width
|
@@ -3149,7 +3149,7 @@ const Hr = (r) => new Promise((t) => {
|
|
3149
3149
|
"3E2B2E",
|
3150
3150
|
"101820",
|
3151
3151
|
"3D3935"
|
3152
|
-
],
|
3152
|
+
], ze = xt.map((r) => [
|
3153
3153
|
parseInt(r.substring(0, 2), 16),
|
3154
3154
|
parseInt(r.substring(2, 4), 16),
|
3155
3155
|
parseInt(r.substring(4, 6), 16)
|
@@ -3172,7 +3172,7 @@ function Oc(r, t = 64) {
|
|
3172
3172
|
const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
|
3173
3173
|
let l, c, d;
|
3174
3174
|
for (let A = 0; A < xt.length; A++) {
|
3175
|
-
l =
|
3175
|
+
l = ze[A][0], c = ze[A][1], d = ze[A][2];
|
3176
3176
|
const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
|
3177
3177
|
a.push(u);
|
3178
3178
|
}
|
@@ -3245,7 +3245,7 @@ const le = (r) => {
|
|
3245
3245
|
} catch {
|
3246
3246
|
return r.classList.contains(t.substring(1));
|
3247
3247
|
}
|
3248
|
-
},
|
3248
|
+
}, fa = (r, t = !1) => {
|
3249
3249
|
!t && r.setAttribute("preserveAspectRatio", "none");
|
3250
3250
|
const e = [];
|
3251
3251
|
kt(r, (a) => {
|
@@ -3328,12 +3328,12 @@ const le = (r) => {
|
|
3328
3328
|
}
|
3329
3329
|
});
|
3330
3330
|
});
|
3331
|
-
}, En = (r) => Bt().serializeToString(r),
|
3331
|
+
}, En = (r) => Bt().serializeToString(r), Ca = (r, t, e, a, n) => {
|
3332
3332
|
const i = Sn(r);
|
3333
3333
|
if (!i)
|
3334
3334
|
throw new Error("Failed to read SVG.");
|
3335
3335
|
return ii(i, t, e), vn(i, a, n), En(i);
|
3336
|
-
},
|
3336
|
+
}, wa = (r, t, e) => {
|
3337
3337
|
const a = Sn(r);
|
3338
3338
|
if (!a)
|
3339
3339
|
throw new Error("Failed to read SVG.");
|
@@ -3345,7 +3345,7 @@ const le = (r) => {
|
|
3345
3345
|
const e = si(r).firstElementChild;
|
3346
3346
|
if (!e)
|
3347
3347
|
throw new Error("Failed to read SVG.");
|
3348
|
-
|
3348
|
+
fa(e);
|
3349
3349
|
const a = {};
|
3350
3350
|
kt(e, (s) => {
|
3351
3351
|
ei.includes(s.tagName) && !s.attributes.getNamedItem("fill") && s.setAttribute("fill", "black");
|
@@ -3422,7 +3422,7 @@ const le = (r) => {
|
|
3422
3422
|
...AssetFields
|
3423
3423
|
}
|
3424
3424
|
}
|
3425
|
-
`,
|
3425
|
+
`, ya = w`
|
3426
3426
|
fragment MaterialFields on Material {
|
3427
3427
|
id
|
3428
3428
|
name
|
@@ -3470,7 +3470,7 @@ const le = (r) => {
|
|
3470
3470
|
}
|
3471
3471
|
}
|
3472
3472
|
`, ci = w`
|
3473
|
-
${
|
3473
|
+
${ya}
|
3474
3474
|
query GetMaterials($ids: [String]) {
|
3475
3475
|
materials(id: $ids) {
|
3476
3476
|
...MaterialFields
|
@@ -3525,7 +3525,7 @@ const le = (r) => {
|
|
3525
3525
|
class mi {
|
3526
3526
|
constructor() {
|
3527
3527
|
this.cache = /* @__PURE__ */ new Map(), this.bgrmProcessCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map(), this.loadImageAsFileInfo = async (t) => {
|
3528
|
-
const e = await t.arrayBuffer(), a = await
|
3528
|
+
const e = await t.arrayBuffer(), a = await Qe(e), n = (i, s) => {
|
3529
3529
|
const o = atob(i.split(",")[1]), l = [];
|
3530
3530
|
for (let c = 0; c < o.length; c++)
|
3531
3531
|
l.push(o.charCodeAt(c));
|
@@ -3850,7 +3850,7 @@ const Kt = new gi(), bn = w`
|
|
3850
3850
|
}
|
3851
3851
|
`, pi = w`
|
3852
3852
|
${ee(!1)}
|
3853
|
-
${
|
3853
|
+
${ya}
|
3854
3854
|
${bn}
|
3855
3855
|
query GetOptions($ids: [String]!) {
|
3856
3856
|
options(ids: $ids) {
|
@@ -3939,7 +3939,7 @@ const H = new yi(), Bn = w`
|
|
3939
3939
|
currencyCode
|
3940
3940
|
}
|
3941
3941
|
}
|
3942
|
-
`,
|
3942
|
+
`, Re = w`
|
3943
3943
|
fragment AdditionalIntegrationProductFields on IntegrationProduct {
|
3944
3944
|
id
|
3945
3945
|
product {
|
@@ -3958,7 +3958,7 @@ const H = new yi(), Bn = w`
|
|
3958
3958
|
}
|
3959
3959
|
}
|
3960
3960
|
`, Si = w`
|
3961
|
-
${
|
3961
|
+
${Re}
|
3962
3962
|
mutation CreateTransactions(
|
3963
3963
|
$inputs: [TransactionCreateInput]!
|
3964
3964
|
$marketplaceThemeInstallId: String
|
@@ -4066,7 +4066,7 @@ const H = new yi(), Bn = w`
|
|
4066
4066
|
url
|
4067
4067
|
}
|
4068
4068
|
`, vi = w`
|
4069
|
-
${
|
4069
|
+
${Re}
|
4070
4070
|
${In}
|
4071
4071
|
${Pn}
|
4072
4072
|
${Bn}
|
@@ -4350,7 +4350,7 @@ const H = new yi(), Bn = w`
|
|
4350
4350
|
}
|
4351
4351
|
}
|
4352
4352
|
`, Fn = (r) => w`
|
4353
|
-
${
|
4353
|
+
${Re}
|
4354
4354
|
fragment IntegrationProductFields on IntegrationProduct {
|
4355
4355
|
id
|
4356
4356
|
externalProductId
|
@@ -4587,7 +4587,7 @@ const H = new yi(), Bn = w`
|
|
4587
4587
|
}
|
4588
4588
|
`, Ri = (r) => w`
|
4589
4589
|
${ee(r)}
|
4590
|
-
${
|
4590
|
+
${ya}
|
4591
4591
|
${bn}
|
4592
4592
|
${Mi}
|
4593
4593
|
${Ti}
|
@@ -5027,7 +5027,7 @@ const H = new yi(), Bn = w`
|
|
5027
5027
|
}
|
5028
5028
|
}
|
5029
5029
|
}
|
5030
|
-
`,
|
5030
|
+
`, Oe = w`
|
5031
5031
|
fragment MarketplaceThemeInstallConfigurationFields on MarketplaceThemeInstallConfiguration {
|
5032
5032
|
id
|
5033
5033
|
themeInstallId
|
@@ -5106,7 +5106,7 @@ const H = new yi(), Bn = w`
|
|
5106
5106
|
}
|
5107
5107
|
}
|
5108
5108
|
`, Ui = w`
|
5109
|
-
${
|
5109
|
+
${Oe}
|
5110
5110
|
query GetMarketplaceThemeInstallConfiguration($themeConfigurationId: String!, $themeInstallId: String!) {
|
5111
5111
|
marketplaceThemeInstallConfiguration(id: $themeConfigurationId, themeInstallId: $themeInstallId, raw: false) {
|
5112
5112
|
...MarketplaceThemeInstallConfigurationFields
|
@@ -5114,7 +5114,7 @@ const H = new yi(), Bn = w`
|
|
5114
5114
|
}
|
5115
5115
|
`, Li = w`
|
5116
5116
|
${Bn}
|
5117
|
-
${
|
5117
|
+
${Oe}
|
5118
5118
|
query GetCurrentIntegration($themeConfigurationId: String) {
|
5119
5119
|
currentIntegration {
|
5120
5120
|
id
|
@@ -5126,7 +5126,7 @@ const H = new yi(), Bn = w`
|
|
5126
5126
|
}
|
5127
5127
|
}
|
5128
5128
|
`, Vi = w`
|
5129
|
-
${
|
5129
|
+
${Oe}
|
5130
5130
|
query ReadTransactionForMarketplaceTheme($id: String!) {
|
5131
5131
|
transactions(ids: [$id]) {
|
5132
5132
|
marketplaceThemeInstallConfiguration(raw: false) {
|
@@ -5135,7 +5135,7 @@ const H = new yi(), Bn = w`
|
|
5135
5135
|
}
|
5136
5136
|
}
|
5137
5137
|
`, zi = w`
|
5138
|
-
${
|
5138
|
+
${Oe}
|
5139
5139
|
query ReadBundleForMarketplaceTheme($id: String!) {
|
5140
5140
|
bundles(ids: [$id]) {
|
5141
5141
|
marketplaceThemeInstallConfiguration(raw: false) {
|
@@ -5560,8 +5560,8 @@ const M = () => {
|
|
5560
5560
|
if (!r.pattern)
|
5561
5561
|
return "";
|
5562
5562
|
if (r.pattern.svg) {
|
5563
|
-
const A =
|
5564
|
-
return
|
5563
|
+
const A = wa(r.pattern.svg, r.pattern.colors || {}, !1);
|
5564
|
+
return ma(A);
|
5565
5565
|
}
|
5566
5566
|
return r.pattern.src;
|
5567
5567
|
};
|
@@ -5696,32 +5696,32 @@ class _i {
|
|
5696
5696
|
}), a - n;
|
5697
5697
|
}
|
5698
5698
|
}
|
5699
|
-
const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:",
|
5700
|
-
if (
|
5701
|
-
return
|
5699
|
+
const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ge = /* @__PURE__ */ new Map(), Nt = async (r) => {
|
5700
|
+
if (Ge.has(r))
|
5701
|
+
return Ge.get(r);
|
5702
5702
|
const e = (async () => {
|
5703
5703
|
try {
|
5704
5704
|
return Et(r).getFont();
|
5705
5705
|
} catch {
|
5706
5706
|
if (Xi(r)) {
|
5707
|
-
const a = pn(r), n =
|
5708
|
-
return
|
5707
|
+
const a = pn(r), n = ea(a);
|
5708
|
+
return oa(r, n), n;
|
5709
5709
|
} else {
|
5710
|
-
const a = await
|
5711
|
-
return
|
5710
|
+
const a = await Te(r, !0), n = ea(a);
|
5711
|
+
return oa(r, n), await Qr(n, r), n;
|
5712
5712
|
}
|
5713
5713
|
}
|
5714
5714
|
})();
|
5715
|
-
return
|
5715
|
+
return Ge.set(r, e), e;
|
5716
5716
|
}, Zi = (r) => {
|
5717
|
-
const t = pn(r), e =
|
5718
|
-
return
|
5717
|
+
const t = pn(r), e = ea(t);
|
5718
|
+
return oa(r, e), e;
|
5719
5719
|
}, Et = (r) => {
|
5720
5720
|
const t = Nn.get(r);
|
5721
5721
|
if (t)
|
5722
5722
|
return t;
|
5723
5723
|
throw new Error("Font metrics unavailable for font");
|
5724
|
-
},
|
5724
|
+
}, oa = (r, t) => {
|
5725
5725
|
const e = new _i(t);
|
5726
5726
|
return Nn.set(r, e), e;
|
5727
5727
|
}, _c = async (r) => {
|
@@ -5760,7 +5760,8 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
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
5762
|
`), e, a), t), La = (r, t, e, a, n, i) => {
|
5763
|
-
|
5763
|
+
console.log("LOG: getLines");
|
5764
|
+
const s = (i || Pe) * n.getApproximateHeight(), o = t.split(`
|
5764
5765
|
`);
|
5765
5766
|
try {
|
5766
5767
|
const l = o.flatMap((d) => ge(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
|
@@ -5780,6 +5781,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5780
5781
|
};
|
5781
5782
|
}
|
5782
5783
|
}, ge = (r, t, e, a) => {
|
5784
|
+
console.log("LOG: splitLineUntilFit");
|
5783
5785
|
const n = mt(r, e, a);
|
5784
5786
|
if (n <= t)
|
5785
5787
|
return { lines: [r], width: n };
|
@@ -5811,9 +5813,11 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5811
5813
|
throw new Error(`No max width calculated for text: ${o}.`);
|
5812
5814
|
return { lines: o, width: l };
|
5813
5815
|
}, ts = (r, t, e, a, n, i) => {
|
5814
|
-
|
5816
|
+
console.log("LOG: calcFontSize");
|
5817
|
+
const s = (i ?? Pe) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Qn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
|
5815
5818
|
return Math.min(A, d);
|
5816
5819
|
}, es = (r, t, e, a) => {
|
5820
|
+
console.log("LOG: refit");
|
5817
5821
|
const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
|
5818
5822
|
if (!e)
|
5819
5823
|
return La(t, r, t.fontSize, s, n, a);
|
@@ -5835,11 +5839,12 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5835
5839
|
fontSize: ts(o, n, i, t.width, t.height, a)
|
5836
5840
|
} : La(t, r, t.fontSize, s, n, a);
|
5837
5841
|
}, as = (r, t, e, a, n) => {
|
5842
|
+
console.log("LOG: recalc");
|
5838
5843
|
const s = Et(t.assetUrl).getFont();
|
5839
5844
|
let o = { ...r };
|
5840
5845
|
const l = { ...r }, c = Qn(a, e / s.unitsPerEm, Et(t.assetUrl));
|
5841
5846
|
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
|
-
},
|
5847
|
+
}, We = 1, mt = (r, t, e) => {
|
5843
5848
|
let a = 0;
|
5844
5849
|
const n = e.getGlyphs(r);
|
5845
5850
|
return n.forEach((i, s) => {
|
@@ -5889,7 +5894,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5889
5894
|
text: t
|
5890
5895
|
};
|
5891
5896
|
})()
|
5892
|
-
} : r,
|
5897
|
+
} : r, Pe = 1.1;
|
5893
5898
|
function Ft(r, t) {
|
5894
5899
|
return On(r, t.getTemplatingContext());
|
5895
5900
|
}
|
@@ -5981,7 +5986,8 @@ const ss = (r) => {
|
|
5981
5986
|
) }) })
|
5982
5987
|
] });
|
5983
5988
|
}, os = (r) => {
|
5984
|
-
|
5989
|
+
console.log(`LOG: text span. prop height: ${r.lineHeight}, fallback: ${Pe}`);
|
5990
|
+
const t = () => r.lineHeight !== void 0 ? r.lineHeight : Pe, e = () => r.align === "left" ? -r.textboxWidth / 2 : r.align === "right" ? r.textboxWidth / 2 : 0, a = () => {
|
5985
5991
|
const n = r.fontSize * t(), i = r.textboxHeight / 2;
|
5986
5992
|
if (r.verticalAlign === "top")
|
5987
5993
|
return -i + r.fontSize * 3 / 4 + r.thisLineIdx * n;
|
@@ -6037,7 +6043,7 @@ const ss = (r) => {
|
|
6037
6043
|
{
|
6038
6044
|
transform: i,
|
6039
6045
|
dangerouslySetInnerHTML: {
|
6040
|
-
__html:
|
6046
|
+
__html: Ca(
|
6041
6047
|
r.svg,
|
6042
6048
|
r.width,
|
6043
6049
|
r.height,
|
@@ -6186,13 +6192,13 @@ const ne = (r) => {
|
|
6186
6192
|
if (r.defaultVariant !== void 0)
|
6187
6193
|
return t.find((e) => e.id === r.defaultVariant);
|
6188
6194
|
}
|
6189
|
-
}, ut = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(),
|
6195
|
+
}, ut = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), qe = /* @__PURE__ */ new Map(), Un = async (r, t) => {
|
6190
6196
|
if (!t) {
|
6191
6197
|
if (!r) throw new Error("No region or src supplied. Cannot construct frame!");
|
6192
|
-
return
|
6198
|
+
return la(r);
|
6193
6199
|
}
|
6194
6200
|
return nt(t);
|
6195
|
-
},
|
6201
|
+
}, la = (r) => {
|
6196
6202
|
const t = r.width, e = r.height;
|
6197
6203
|
return `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${t} ${e}'>
|
6198
6204
|
<path id="target-path" d='M0 0 h ${t} v ${e} h ${-t} Z' />
|
@@ -6207,9 +6213,9 @@ const ne = (r) => {
|
|
6207
6213
|
if (!e.asset)
|
6208
6214
|
throw new Error(`No asset for variant with ID: ${r.frameVariantId}`);
|
6209
6215
|
return e;
|
6210
|
-
},
|
6211
|
-
if (
|
6212
|
-
return
|
6216
|
+
}, $e = async (r) => {
|
6217
|
+
if (qe.has(r))
|
6218
|
+
return qe.get(r);
|
6213
6219
|
const e = (async () => {
|
6214
6220
|
if (Vt.has(r))
|
6215
6221
|
return Vt.get(r);
|
@@ -6245,7 +6251,7 @@ const ne = (r) => {
|
|
6245
6251
|
}
|
6246
6252
|
throw new Error("Malformed frame SVG");
|
6247
6253
|
})();
|
6248
|
-
return
|
6254
|
+
return qe.set(r, e), e;
|
6249
6255
|
}, Ea = (r, t, e, a) => {
|
6250
6256
|
const n = t.width / t.height, i = r.width / r.height;
|
6251
6257
|
let s;
|
@@ -6256,7 +6262,7 @@ const ne = (r) => {
|
|
6256
6262
|
y: u,
|
6257
6263
|
zoom: s
|
6258
6264
|
};
|
6259
|
-
},
|
6265
|
+
}, ca = async (r) => {
|
6260
6266
|
if (ut.has(r))
|
6261
6267
|
return ut.get(r);
|
6262
6268
|
if (r.startsWith("data:image/svg+xml")) {
|
@@ -6277,7 +6283,7 @@ const ne = (r) => {
|
|
6277
6283
|
};
|
6278
6284
|
return ut.set(r, i), i;
|
6279
6285
|
} else {
|
6280
|
-
const e = await
|
6286
|
+
const e = await Te(r, !0), a = await Qe(e), n = {
|
6281
6287
|
src: r,
|
6282
6288
|
width: a.width,
|
6283
6289
|
height: a.height,
|
@@ -6306,9 +6312,9 @@ const ne = (r) => {
|
|
6306
6312
|
nt(r).then((e) => {
|
6307
6313
|
t(e);
|
6308
6314
|
}).catch((e) => console.error(e));
|
6309
|
-
}),
|
6310
|
-
if (
|
6311
|
-
return
|
6315
|
+
}), je = /* @__PURE__ */ new Map(), _t = async (r) => {
|
6316
|
+
if (je.has(r))
|
6317
|
+
return je.get(r);
|
6312
6318
|
const t = async (n) => new Promise((i, s) => {
|
6313
6319
|
try {
|
6314
6320
|
if (!(!!URL && !!URL.createObjectURL)) throw new Error("Environment incapable of generating ObjectURL");
|
@@ -6324,12 +6330,12 @@ const ne = (r) => {
|
|
6324
6330
|
const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
|
6325
6331
|
if (!s)
|
6326
6332
|
throw new Error("Failed to read SVG");
|
6327
|
-
const l = Bt().serializeToString(s), c = pt(), d = c.getContext("2d"), A = await
|
6333
|
+
const l = Bt().serializeToString(s), c = pt(), d = c.getContext("2d"), A = await ua.from(d, l, {
|
6328
6334
|
anonymousCrossOrigin: !0,
|
6329
6335
|
ignoreDimensions: !1,
|
6330
6336
|
createCanvas: pt,
|
6331
6337
|
createImage: te,
|
6332
|
-
DOMParser:
|
6338
|
+
DOMParser: pa(),
|
6333
6339
|
fetch: rt
|
6334
6340
|
}), u = s.getAttribute("width"), h = s.getAttribute("height"), m = 2048;
|
6335
6341
|
if (h && u) {
|
@@ -6339,7 +6345,7 @@ const ne = (r) => {
|
|
6339
6345
|
A.resize(m, m);
|
6340
6346
|
return await A.render(), await t(c);
|
6341
6347
|
})();
|
6342
|
-
return
|
6348
|
+
return je.set(r, a), a;
|
6343
6349
|
}, Ut = async (r, t, e, a) => {
|
6344
6350
|
const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
|
6345
6351
|
width: r.layoutState.layout.width,
|
@@ -6361,7 +6367,7 @@ const ne = (r) => {
|
|
6361
6367
|
o.height = o.width / C, o.top += (h - o.height) / 2;
|
6362
6368
|
}
|
6363
6369
|
if (e && t === x.Image) {
|
6364
|
-
const l = o.height, c = await
|
6370
|
+
const l = o.height, c = await Te(e), d = await Qe(c), A = d.width / d.height;
|
6365
6371
|
o.height = o.width / A, o.top += (l - o.height) / 2;
|
6366
6372
|
}
|
6367
6373
|
if (e && t === x.Textbox && a?.text && a?.fontScale) {
|
@@ -6373,7 +6379,7 @@ const ne = (r) => {
|
|
6373
6379
|
};
|
6374
6380
|
class Xc {
|
6375
6381
|
static async getFrame(t, e) {
|
6376
|
-
const a = await Un(e.region, e.src), n = await
|
6382
|
+
const a = await Un(e.region, e.src), n = await $e(a), i = e.region || await Ut(t, x.Frame);
|
6377
6383
|
return {
|
6378
6384
|
id: M(),
|
6379
6385
|
x: i.left,
|
@@ -6553,7 +6559,7 @@ const $ = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
|
6553
6559
|
const o = s;
|
6554
6560
|
if (o.src && !o.svg) {
|
6555
6561
|
const l = await nt(o.src), c = await ot(l);
|
6556
|
-
o.svg =
|
6562
|
+
o.svg = Ca(
|
6557
6563
|
c.svg,
|
6558
6564
|
o.width,
|
6559
6565
|
o.height,
|
@@ -6821,7 +6827,7 @@ class us extends N {
|
|
6821
6827
|
};
|
6822
6828
|
}
|
6823
6829
|
}
|
6824
|
-
class
|
6830
|
+
class He extends N {
|
6825
6831
|
constructor(t, e) {
|
6826
6832
|
super(), this.id = t, this.imageFill = e;
|
6827
6833
|
}
|
@@ -7011,7 +7017,7 @@ class fs extends N {
|
|
7011
7017
|
};
|
7012
7018
|
}
|
7013
7019
|
}
|
7014
|
-
class
|
7020
|
+
class Ye extends N {
|
7015
7021
|
constructor(t, e, a) {
|
7016
7022
|
super(), this.id = t, this.strokeColor = e, this.strokeThickness = a;
|
7017
7023
|
}
|
@@ -7034,7 +7040,7 @@ class He extends N {
|
|
7034
7040
|
};
|
7035
7041
|
}
|
7036
7042
|
}
|
7037
|
-
class
|
7043
|
+
class da extends N {
|
7038
7044
|
constructor(t, e, a) {
|
7039
7045
|
super(), this.id = t, this.className = e, this.fill = a;
|
7040
7046
|
}
|
@@ -7312,7 +7318,7 @@ const ws = async (r) => {
|
|
7312
7318
|
}
|
7313
7319
|
})).json()).shortUrl;
|
7314
7320
|
} catch (e) {
|
7315
|
-
throw console.error(e), new
|
7321
|
+
throw console.error(e), new Me("Failed to shorten URL, see console.");
|
7316
7322
|
}
|
7317
7323
|
};
|
7318
7324
|
class Gn {
|
@@ -7383,7 +7389,7 @@ class ys {
|
|
7383
7389
|
l.searchParams.append("video", btoa(JSON.stringify([s]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
|
7384
7390
|
const c = l.toString();
|
7385
7391
|
if (c.length >= 2e3)
|
7386
|
-
throw new
|
7392
|
+
throw new Me("Cannot create QR code, URL too long.");
|
7387
7393
|
const d = await ws(c);
|
7388
7394
|
if (!n.data || !n.data.regions)
|
7389
7395
|
throw new Ee(n, "Missing regions.");
|
@@ -7429,11 +7435,11 @@ class ys {
|
|
7429
7435
|
}
|
7430
7436
|
}
|
7431
7437
|
const Wn = new ys();
|
7432
|
-
class
|
7438
|
+
class De {
|
7433
7439
|
constructor() {
|
7434
7440
|
this.frameSourceSvg = async (t, e) => {
|
7435
7441
|
if (!t)
|
7436
|
-
return
|
7442
|
+
return la(e);
|
7437
7443
|
const a = t.asset;
|
7438
7444
|
if (!a)
|
7439
7445
|
throw new vt(t);
|
@@ -7482,7 +7488,7 @@ class Pe {
|
|
7482
7488
|
a.serializableWorkflow.steps
|
7483
7489
|
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({ id: c.id, region: c.stepRegion }));
|
7484
7490
|
if (!t.option || (t.option.variants || []).length === 0) {
|
7485
|
-
const c = t.data.regions.map((d) =>
|
7491
|
+
const c = t.data.regions.map((d) => la(d));
|
7486
7492
|
e.updateStorage(t.stepName, {
|
7487
7493
|
currentFrameSources: c
|
7488
7494
|
});
|
@@ -7536,7 +7542,7 @@ class Pe {
|
|
7536
7542
|
})) ?? [];
|
7537
7543
|
}
|
7538
7544
|
selectImage(t, e, a, n = !0) {
|
7539
|
-
const i =
|
7545
|
+
const i = De.patternSource(e), s = a.getStepStorage(t.stepName)?.framePatternSrc;
|
7540
7546
|
if (s && s === i)
|
7541
7547
|
return Promise.resolve();
|
7542
7548
|
a.setEditedStatus(t.stepName, !0);
|
@@ -7556,7 +7562,7 @@ class Pe {
|
|
7556
7562
|
});
|
7557
7563
|
},
|
7558
7564
|
() => {
|
7559
|
-
throw new
|
7565
|
+
throw new Me("Failed to resolve transcoded PDF");
|
7560
7566
|
}
|
7561
7567
|
)
|
7562
7568
|
);
|
@@ -7618,7 +7624,7 @@ class Pe {
|
|
7618
7624
|
};
|
7619
7625
|
ut.set(t, A), e.setPatternData(A, a);
|
7620
7626
|
} else {
|
7621
|
-
const s = await
|
7627
|
+
const s = await Te(t, !0), o = await Qe(s), l = {
|
7622
7628
|
src: t,
|
7623
7629
|
width: o.width,
|
7624
7630
|
height: o.height,
|
@@ -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
|
7712
|
+
const p = await $e(l[m]), g = o.getImageData(), C = a.map((P) => new bt(P.id)), S = g ? Ea(
|
7707
7713
|
g,
|
7708
7714
|
p,
|
7709
7715
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
@@ -7767,7 +7773,7 @@ class Pe {
|
|
7767
7773
|
throw new Yt(t);
|
7768
7774
|
}
|
7769
7775
|
async loadPatternFromAsset(t, e, a, n) {
|
7770
|
-
const i =
|
7776
|
+
const i = De.patternSource(t), s = a.markUpdatePending(), o = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
7771
7777
|
if (!o)
|
7772
7778
|
throw a.markUpdateCompleted(s), new Error("Frame service unavailable, cannot load pattern!");
|
7773
7779
|
try {
|
@@ -7794,7 +7800,7 @@ class Pe {
|
|
7794
7800
|
), this.validateColorCount(e, a);
|
7795
7801
|
}
|
7796
7802
|
}
|
7797
|
-
const wt = new
|
7803
|
+
const wt = new De();
|
7798
7804
|
class Ss {
|
7799
7805
|
async getIllustrationBody(t) {
|
7800
7806
|
return new Promise((e) => {
|
@@ -7899,10 +7905,10 @@ class Ss {
|
|
7899
7905
|
spotColor: A.spotColor,
|
7900
7906
|
pmsValue: A.pmsValue
|
7901
7907
|
};
|
7902
|
-
const o =
|
7908
|
+
const o = Ca(t, e, a, s), l = await _t(o), c = [];
|
7903
7909
|
for (const d of n) {
|
7904
7910
|
for (const [A, u] of i.entries())
|
7905
|
-
c.push(new
|
7911
|
+
c.push(new da(d, A, u));
|
7906
7912
|
c.push(new Cs(d, o, l));
|
7907
7913
|
}
|
7908
7914
|
return new R(c);
|
@@ -8285,7 +8291,7 @@ class bs {
|
|
8285
8291
|
}
|
8286
8292
|
if (!/^$|^[a-zA-Z0-9 ]+$/.test(e))
|
8287
8293
|
return n("Unsupported characters."), { input: e, helperData: {}, errorData: { unsupportedCharacters: !0 } };
|
8288
|
-
const i =
|
8294
|
+
const i = aa(e.toLowerCase());
|
8289
8295
|
for (const s of i)
|
8290
8296
|
for (const o in a) {
|
8291
8297
|
const l = a[o].toLowerCase().replace(/\s/g, "");
|
@@ -8459,7 +8465,7 @@ class Ps {
|
|
8459
8465
|
const n = a.getLayouts(), s = (a.getRegionElements(e.stepName) || []).map((o) => {
|
8460
8466
|
const l = o.region;
|
8461
8467
|
if (!n.find((d) => d.panelId === l?.panelId)) throw new Y(l);
|
8462
|
-
return new
|
8468
|
+
return new da(o.id, this.shapeFillId, t);
|
8463
8469
|
}).filter((o) => !!o);
|
8464
8470
|
a.getCommandDispatcher()(new R(s)), a.updateStorage(e.stepName, { colour: t });
|
8465
8471
|
}
|
@@ -8525,7 +8531,7 @@ class Ps {
|
|
8525
8531
|
if (!i.find((m) => m.panelId === A?.panelId))
|
8526
8532
|
throw new Y(A);
|
8527
8533
|
const h = o();
|
8528
|
-
return new
|
8534
|
+
return new da(d.id, this.shapeFillId, h);
|
8529
8535
|
}, c = a.map(l).filter((d) => !!d);
|
8530
8536
|
return {
|
8531
8537
|
command: new R(c),
|
@@ -8632,15 +8638,17 @@ class Ds {
|
|
8632
8638
|
);
|
8633
8639
|
}
|
8634
8640
|
}
|
8635
|
-
const Fs = new Ds(),
|
8641
|
+
const Fs = new Ds(), Je = (r, t, e, a, n) => {
|
8636
8642
|
if (t.some((d) => d == null))
|
8637
8643
|
throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
|
8638
8644
|
let i = t.map((d) => d.split(`
|
8639
8645
|
`)).flat(), s = i.length, o = i.map((d) => mt(d, a, n));
|
8640
8646
|
const l = n.getApproximateHeight() * a;
|
8647
|
+
console.log(`LOG: lines that fit. calced line height: ${l}`);
|
8641
8648
|
let c = !0;
|
8642
8649
|
for (; c; ) {
|
8643
|
-
|
8650
|
+
const d = l + (s - 1) * e;
|
8651
|
+
if (console.log(`LOG: textbox height for size ${e}: ${d}`), d > r.height)
|
8644
8652
|
return [null, null];
|
8645
8653
|
const A = Math.max(...o);
|
8646
8654
|
if (A <= r.width)
|
@@ -8660,33 +8668,34 @@ const Fs = new Ds(), Ye = (r, t, e, a, n) => {
|
|
8660
8668
|
}
|
8661
8669
|
return [null, null];
|
8662
8670
|
}, fe = (r, t, e, a, n) => {
|
8671
|
+
console.log(`LOG: determineCorrectFontSize, region height ${e.height}`);
|
8663
8672
|
let i, s;
|
8664
8673
|
const o = Et(t.assetUrl), l = o.getFont();
|
8665
8674
|
if (n.size) {
|
8666
8675
|
const u = r / l.unitsPerEm;
|
8667
|
-
return [i, s] =
|
8676
|
+
return [i, s] = Je(e, a, r, u, o), console.log(`LOG: fixed mode returning ${n.size, s}`), [n.size, i, s];
|
8668
8677
|
}
|
8669
8678
|
const c = 6;
|
8670
|
-
let d = c -
|
8679
|
+
let d = c - We;
|
8671
8680
|
if (a.length > 0) {
|
8672
8681
|
let u = a, h = 0;
|
8673
8682
|
for (; (!n.maxSize || d <= n.maxSize) && u; )
|
8674
|
-
d +=
|
8683
|
+
d += We, h = d / l.unitsPerEm, [u, s] = Je(e, a, d, h, o), console.log(`LOG: intermediate result ${[u, s]}`);
|
8675
8684
|
}
|
8676
|
-
d > c && (d -=
|
8685
|
+
d > c && (d -= We), n.minSize && d < n.minSize && (d = n.minSize);
|
8677
8686
|
const A = d / l.unitsPerEm;
|
8678
|
-
return [i, s] =
|
8679
|
-
},
|
8680
|
-
class
|
8687
|
+
return [i, s] = Je(e, a, d, A, o), console.log(`LOG: var mode returning ${[d, i, s]}`), [d, i, s];
|
8688
|
+
}, Ke = 30;
|
8689
|
+
class Fe extends Error {
|
8681
8690
|
constructor(t) {
|
8682
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
8691
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Fe.name;
|
8683
8692
|
}
|
8684
8693
|
}
|
8685
8694
|
const xs = ["‘", "’", "“", "”", `
|
8686
8695
|
`];
|
8687
|
-
class
|
8696
|
+
class xe extends Error {
|
8688
8697
|
constructor(t) {
|
8689
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
8698
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = xe.name;
|
8690
8699
|
}
|
8691
8700
|
}
|
8692
8701
|
class ks {
|
@@ -8708,7 +8717,7 @@ class ks {
|
|
8708
8717
|
}, this.textAlign = (t) => t.vertical ? "center" : t.textAlign || "center", this.getErrorsForText = (t, e, a, n) => {
|
8709
8718
|
let i;
|
8710
8719
|
a.data && a.data.maxLength && e.length > a.data.maxLength && (i || (i = {}), i.hitCharacterLimit = !0);
|
8711
|
-
const s = n.getProfanities(), o =
|
8720
|
+
const s = n.getProfanities(), o = aa(t.toLowerCase());
|
8712
8721
|
for (const c of o)
|
8713
8722
|
for (const d in s) {
|
8714
8723
|
const A = s[d].toLowerCase().replace(/\s/g, "");
|
@@ -8728,7 +8737,7 @@ class ks {
|
|
8728
8737
|
if (a)
|
8729
8738
|
await this.reload(t, e, a);
|
8730
8739
|
else {
|
8731
|
-
const i = this.getDefaultImageFillVariant(t.data), s = i?.asset?.fileLink, o = s ? await
|
8740
|
+
const i = this.getDefaultImageFillVariant(t.data), s = i?.asset?.fileLink, o = s ? await ca(s) : void 0, l = o ? {
|
8732
8741
|
src: o.src,
|
8733
8742
|
height: o.height,
|
8734
8743
|
width: o.width,
|
@@ -8835,7 +8844,7 @@ class ks {
|
|
8835
8844
|
const a = e.variants?.map((n) => n.asset?.fileLink)?.filter((n) => !!n) || [];
|
8836
8845
|
return Promise.all(
|
8837
8846
|
a.map(async (n) => {
|
8838
|
-
const i = await
|
8847
|
+
const i = await ca(n);
|
8839
8848
|
return {
|
8840
8849
|
src: n,
|
8841
8850
|
width: i.width,
|
@@ -8855,7 +8864,7 @@ class ks {
|
|
8855
8864
|
fillImage: e
|
8856
8865
|
});
|
8857
8866
|
for (const o of a) {
|
8858
|
-
const l = new
|
8867
|
+
const l = new He(o.id, e);
|
8859
8868
|
i(l);
|
8860
8869
|
}
|
8861
8870
|
}
|
@@ -8892,7 +8901,7 @@ class ks {
|
|
8892
8901
|
strokeColor: s
|
8893
8902
|
});
|
8894
8903
|
for (const o of a) {
|
8895
|
-
const l = new
|
8904
|
+
const l = new Ye(o.id, s, t.data?.strokeThickness);
|
8896
8905
|
i(l);
|
8897
8906
|
}
|
8898
8907
|
}
|
@@ -9087,18 +9096,18 @@ class ks {
|
|
9087
9096
|
if (n.length > 0) {
|
9088
9097
|
const u = n.map((p) => new qa(p.id, A));
|
9089
9098
|
if (l) {
|
9090
|
-
const p = n.map((g) => new
|
9099
|
+
const p = n.map((g) => new He(g.id, l));
|
9091
9100
|
u.push(...p);
|
9092
9101
|
}
|
9093
9102
|
if (c) {
|
9094
9103
|
const p = n.map(
|
9095
|
-
(g) => new
|
9104
|
+
(g) => new Ye(g.id, c, t.data.strokeThickness)
|
9096
9105
|
);
|
9097
9106
|
u.push(...p);
|
9098
9107
|
}
|
9099
9108
|
const h = await this.changeInputTextWithRegion(
|
9100
9109
|
t,
|
9101
|
-
t.data.size ||
|
9110
|
+
t.data.size || Ke,
|
9102
9111
|
A,
|
9103
9112
|
a.text || "",
|
9104
9113
|
a,
|
@@ -9123,7 +9132,7 @@ class ks {
|
|
9123
9132
|
i
|
9124
9133
|
), h = await this.changeInputTextWithRegion(
|
9125
9134
|
t,
|
9126
|
-
t.data.size ||
|
9135
|
+
t.data.size || Ke,
|
9127
9136
|
A,
|
9128
9137
|
u[0]?.newElement.input || a.text || t.data.defaultText || "",
|
9129
9138
|
a,
|
@@ -9134,13 +9143,13 @@ class ks {
|
|
9134
9143
|
), m = u.flatMap((g) => g.commands);
|
9135
9144
|
if (l) {
|
9136
9145
|
const g = u.map(
|
9137
|
-
(C) => new
|
9146
|
+
(C) => new He(C.regionElement.id, l)
|
9138
9147
|
);
|
9139
9148
|
m.push(...g);
|
9140
9149
|
}
|
9141
9150
|
if (c) {
|
9142
9151
|
const g = n.map(
|
9143
|
-
(C) => new
|
9152
|
+
(C) => new Ye(C.id, c, t.data.strokeThickness)
|
9144
9153
|
);
|
9145
9154
|
m.push(...g);
|
9146
9155
|
}
|
@@ -9167,7 +9176,7 @@ class ks {
|
|
9167
9176
|
const m = s.getLayouts().find((g) => g.panelId === u.panelId), p = M();
|
9168
9177
|
try {
|
9169
9178
|
if (!m)
|
9170
|
-
throw new
|
9179
|
+
throw new xe("Failed to find layout for region: " + u.panelId);
|
9171
9180
|
const g = a.colorOption;
|
9172
9181
|
let C;
|
9173
9182
|
if (g && g.variants) {
|
@@ -9181,7 +9190,7 @@ class ks {
|
|
9181
9190
|
stepName: t,
|
9182
9191
|
align: this.textAlign(a),
|
9183
9192
|
fill: i.color ? i.color : b,
|
9184
|
-
fontSize: a.size ||
|
9193
|
+
fontSize: a.size || Ke,
|
9185
9194
|
fontData: n,
|
9186
9195
|
id: p,
|
9187
9196
|
layer: u.layer,
|
@@ -9230,10 +9239,10 @@ class ks {
|
|
9230
9239
|
fontData: n
|
9231
9240
|
};
|
9232
9241
|
} catch (g) {
|
9233
|
-
throw console.log(g), new
|
9242
|
+
throw console.log(g), new Fe("Error adding font to region");
|
9234
9243
|
}
|
9235
9244
|
}, A = await Promise.all(a.regions.map(d)).catch((u) => {
|
9236
|
-
throw u instanceof
|
9245
|
+
throw u instanceof Fe ? (Fs.setLatestToast("Failed to load font.", Ue.Error), u) : u instanceof xe ? u : new Error(u);
|
9237
9246
|
});
|
9238
9247
|
return await s.setSelectionsAndElements(
|
9239
9248
|
t,
|
@@ -9275,7 +9284,7 @@ class ks {
|
|
9275
9284
|
const S = (() => {
|
9276
9285
|
if (t.data && t.data.maxLength && h.length > t.data.maxLength)
|
9277
9286
|
return d && d(!0), { info: "0" };
|
9278
|
-
const f = s.getProfanities(), E =
|
9287
|
+
const f = s.getProfanities(), E = aa(u.toLowerCase());
|
9279
9288
|
for (const P of E)
|
9280
9289
|
for (const B in f) {
|
9281
9290
|
const F = f[B].toLowerCase().replace(/\s/g, "");
|
@@ -9562,7 +9571,7 @@ const re = w`
|
|
9562
9571
|
bundleId: r
|
9563
9572
|
}
|
9564
9573
|
})).data.globalPropertyState, Ws = w`
|
9565
|
-
${
|
9574
|
+
${Re}
|
9566
9575
|
fragment ProductFields on Product {
|
9567
9576
|
id
|
9568
9577
|
basePrice
|
@@ -10217,7 +10226,7 @@ const re = w`
|
|
10217
10226
|
}
|
10218
10227
|
}
|
10219
10228
|
`;
|
10220
|
-
var
|
10229
|
+
var Ue = /* @__PURE__ */ ((r) => (r.Error = "Error", r.Warning = "Warning", r.Info = "Info", r))(Ue || {});
|
10221
10230
|
const wo = 1e3;
|
10222
10231
|
class Ja extends xn {
|
10223
10232
|
constructor(t) {
|
@@ -11399,7 +11408,7 @@ class Po extends Z {
|
|
11399
11408
|
...this.manager.getInformationResults(),
|
11400
11409
|
{
|
11401
11410
|
message: "An issue has occurred with text",
|
11402
|
-
messageType:
|
11411
|
+
messageType: Ue.Error,
|
11403
11412
|
stepID: this.step.stepName
|
11404
11413
|
}
|
11405
11414
|
]);
|
@@ -11647,7 +11656,7 @@ class xo extends Z {
|
|
11647
11656
|
...this.manager.getInformationResults(),
|
11648
11657
|
{
|
11649
11658
|
message: e,
|
11650
|
-
messageType:
|
11659
|
+
messageType: Ue.Error,
|
11651
11660
|
stepID: this.step.stepName
|
11652
11661
|
}
|
11653
11662
|
];
|
@@ -12133,7 +12142,7 @@ class $o {
|
|
12133
12142
|
throw new V("Unexpected storage method requested");
|
12134
12143
|
}
|
12135
12144
|
}
|
12136
|
-
const
|
12145
|
+
const _e = new $o(), Uo = w`
|
12137
12146
|
mutation AddTransactionStakeholder($id: String!, $type: String!, $details: CustomerDetailsInput!) {
|
12138
12147
|
transactionAddStakeholder(id: $id, details: $details, type: $type) {
|
12139
12148
|
id
|
@@ -12180,7 +12189,7 @@ var zo = /* @__PURE__ */ ((r) => (r.QuantityChanged = "QuantityChanged", r.Price
|
|
12180
12189
|
class Go {
|
12181
12190
|
constructor(t, e) {
|
12182
12191
|
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = An(async () => {
|
12183
|
-
await
|
12192
|
+
await _e.getSavedDesignByTransaction(
|
12184
12193
|
this.getWorkflowManager().getTransaction().id
|
12185
12194
|
) && this.save();
|
12186
12195
|
}, 2500), this.getCanvasObjectURLAsync = async (n) => new Promise((i, s) => {
|
@@ -12299,7 +12308,7 @@ class Go {
|
|
12299
12308
|
height: d.layoutState.layout.height
|
12300
12309
|
}, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
|
12301
12310
|
if (!h)
|
12302
|
-
throw new
|
12311
|
+
throw new Me("Failed to obtain 2D context for preview image creation");
|
12303
12312
|
const m = this.workflowManager.getTemplatingContext(), p = Sa(u.layoutState.layout, u.layoutState.elements, {
|
12304
12313
|
renderingConfiguration: {
|
12305
12314
|
purpose: Ht.Print,
|
@@ -12307,12 +12316,12 @@ class Go {
|
|
12307
12316
|
templatingContext: m
|
12308
12317
|
}
|
12309
12318
|
}), g = gn(p);
|
12310
|
-
await (await
|
12319
|
+
await (await ua.from(h, g, {
|
12311
12320
|
anonymousCrossOrigin: !0,
|
12312
12321
|
ignoreDimensions: !1,
|
12313
12322
|
createCanvas: pt,
|
12314
12323
|
createImage: te,
|
12315
|
-
DOMParser:
|
12324
|
+
DOMParser: pa(),
|
12316
12325
|
fetch
|
12317
12326
|
})).render();
|
12318
12327
|
const S = await this.getCanvasObjectURLAsync(s);
|
@@ -12470,7 +12479,7 @@ class Go {
|
|
12470
12479
|
const n = {
|
12471
12480
|
title: await (async () => {
|
12472
12481
|
if (t) return t;
|
12473
|
-
const i = this.getWorkflowManager().getTransaction().id, o = (await
|
12482
|
+
const i = this.getWorkflowManager().getTransaction().id, o = (await _e.getSavedDesigns()).find((l) => l.transactionId === i)?.title;
|
12474
12483
|
return o || "My design";
|
12475
12484
|
})(),
|
12476
12485
|
thumbnail: await this.createPreviewImage(!1, 256),
|
@@ -12481,7 +12490,7 @@ class Go {
|
|
12481
12490
|
workflowId: this.getWorkflowManager().getWorkflow().id,
|
12482
12491
|
lastEdited: /* @__PURE__ */ new Date()
|
12483
12492
|
};
|
12484
|
-
return await
|
12493
|
+
return await _e.addDesign(n), n;
|
12485
12494
|
}
|
12486
12495
|
async copy() {
|
12487
12496
|
const t = St(this.getCommandContext().getState());
|
@@ -12697,12 +12706,12 @@ const Wo = (r) => {
|
|
12697
12706
|
return console.error(h), [];
|
12698
12707
|
}
|
12699
12708
|
}, Yo = async (r, t, e, a) => {
|
12700
|
-
const n = e.data, i = n.assetUrl, s = await
|
12709
|
+
const n = e.data, i = n.assetUrl, s = await ca(i);
|
12701
12710
|
try {
|
12702
12711
|
const o = As(n, a.option);
|
12703
12712
|
o && (t[a.stepName] = { selectedVariants: [o] });
|
12704
12713
|
const l = async (c) => {
|
12705
|
-
const d = await Un(c, o?.asset?.fileLink), A = await
|
12714
|
+
const d = await Un(c, o?.asset?.fileLink), A = await $e(d), u = M(), h = r.find((p) => p.panelId === c.panelId);
|
12706
12715
|
if (!h)
|
12707
12716
|
throw new Y(c);
|
12708
12717
|
const m = Ea(
|
@@ -12769,7 +12778,7 @@ const Wo = (r) => {
|
|
12769
12778
|
const l = await nt(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = d?.length > 0 ? d[0] : "", m = dt().parseFromString(A, "image/svg+xml").firstElementChild;
|
12770
12779
|
if (!m)
|
12771
12780
|
return console.error("Failed to read SVG."), [];
|
12772
|
-
|
12781
|
+
fa(m);
|
12773
12782
|
const p = {};
|
12774
12783
|
kt(m, (f) => {
|
12775
12784
|
jo.includes(f.tagName) && !f.attributes.getNamedItem("fill") && f.setAttribute("fill", "#000000");
|
@@ -12983,7 +12992,7 @@ const Wo = (r) => {
|
|
12983
12992
|
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", C = dt().parseFromString(m, "image/svg+xml").firstElementChild;
|
12984
12993
|
if (!C)
|
12985
12994
|
throw new Dt("Failed to read SVG.");
|
12986
|
-
return
|
12995
|
+
return fa(C), Bt().serializeToString(C);
|
12987
12996
|
};
|
12988
12997
|
l.forEach((A) => {
|
12989
12998
|
const u = r.find((m) => m.panelId === A.panelId);
|
@@ -13324,7 +13333,7 @@ class ol extends xn {
|
|
13324
13333
|
purpose: Ht.ThreeD,
|
13325
13334
|
templatingContext: d
|
13326
13335
|
}
|
13327
|
-
}), u = gn(A), h = await
|
13336
|
+
}), u = gn(A), h = await ua.from(this.ctx, u, {
|
13328
13337
|
anonymousCrossOrigin: !0,
|
13329
13338
|
ignoreDimensions: !this.nonPOTSupport,
|
13330
13339
|
ignoreAnimation: !0,
|
@@ -13333,7 +13342,7 @@ class ol extends xn {
|
|
13333
13342
|
enableRedraw: !1,
|
13334
13343
|
createCanvas: pt,
|
13335
13344
|
createImage: te,
|
13336
|
-
DOMParser:
|
13345
|
+
DOMParser: pa(),
|
13337
13346
|
fetch
|
13338
13347
|
});
|
13339
13348
|
h.resize(l, c), await h.render(), this.onRender();
|
@@ -13534,7 +13543,7 @@ class cl extends Ia {
|
|
13534
13543
|
]);
|
13535
13544
|
}
|
13536
13545
|
async canUseBackgroundRemover() {
|
13537
|
-
return this.bundle.getClient().canUseAddon(
|
13546
|
+
return this.bundle.getClient().canUseAddon(ha.BackgroundRemover);
|
13538
13547
|
}
|
13539
13548
|
/**
|
13540
13549
|
* Removes the background from an image, stores it in the state, and returns the new asset.
|
@@ -13572,7 +13581,7 @@ class cl extends Ia {
|
|
13572
13581
|
return O.getLocalOrFromServer(t);
|
13573
13582
|
}
|
13574
13583
|
async getImageWithColors() {
|
13575
|
-
return await this.loadImageData(), this.imageData?.svg ?
|
13584
|
+
return await this.loadImageData(), this.imageData?.svg ? ma(wa(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
13576
13585
|
}
|
13577
13586
|
/**
|
13578
13587
|
* Retrieves the original, unmodified image selection, if one exists.
|
@@ -14670,7 +14679,7 @@ const El = w`
|
|
14670
14679
|
}
|
14671
14680
|
}
|
14672
14681
|
`;
|
14673
|
-
class
|
14682
|
+
class Xe {
|
14674
14683
|
constructor(t, e, a, n, i, s) {
|
14675
14684
|
this.workflowExperiences = [], this.eventEmitter = new vl(), this.client = t, this.id = e.id, this.name = e.name || "", this.dispatchDate = e.dispatchDate, this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(e.metadata?.map((c) => [c.key, c.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new ml(e.bundleStateData);
|
14676
14685
|
const o = this.productCollection?.globalPropertyConfiguration;
|
@@ -15170,6 +15179,7 @@ class _e {
|
|
15170
15179
|
name: this.getName(),
|
15171
15180
|
dispatchDate: this.getDispatchDate() || "",
|
15172
15181
|
purchaseOrder: this.getPurchaseOrder() || "",
|
15182
|
+
collectionId: this.getProductCollection()?.getId() || "",
|
15173
15183
|
collectionName: this.getProductCollection()?.getName() || "",
|
15174
15184
|
items: [],
|
15175
15185
|
bundleOwnerId: this.ownerId
|
@@ -15202,6 +15212,7 @@ class _e {
|
|
15202
15212
|
name: this.getName(),
|
15203
15213
|
dispatchDate: this.getDispatchDate() || "",
|
15204
15214
|
purchaseOrder: this.getPurchaseOrder() || "",
|
15215
|
+
collectionId: this.getProductCollection()?.getId() || "",
|
15205
15216
|
collectionName: this.getProductCollection()?.getName() || "",
|
15206
15217
|
items: a,
|
15207
15218
|
bundleOwnerId: this.ownerId
|
@@ -15947,7 +15958,7 @@ class md {
|
|
15947
15958
|
} catch (a) {
|
15948
15959
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15949
15960
|
}
|
15950
|
-
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.
|
15961
|
+
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.3-beta.6656bf1f-f28c-546b-a655-f036c595b6cc"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15951
15962
|
}
|
15952
15963
|
configure(t) {
|
15953
15964
|
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);
|
@@ -16247,7 +16258,7 @@ class md {
|
|
16247
16258
|
s.set(i.id, i.partner.id), k.setMap("bundlePartnerIds", s);
|
16248
16259
|
const o = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
16249
16260
|
o.set(i.id, i.bundleOwnerId), k.setMap("bundleOwnerIds", o);
|
16250
|
-
const l = new
|
16261
|
+
const l = new Xe(this, i, void 0, void 0, i.bundleOwnerId, {
|
16251
16262
|
eagerFetchProducts: a?.graphql?.productCollection?.eagerFetchProducts
|
16252
16263
|
});
|
16253
16264
|
return await l.getInitializationPromise(), l;
|
@@ -16287,7 +16298,7 @@ class md {
|
|
16287
16298
|
throw new Error(`Unable to find bundle: ${t}`);
|
16288
16299
|
const d = c.data?.bundles[0], A = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
16289
16300
|
A.set(d.id, d.partner.id), k.setMap("bundlePartnerIds", A);
|
16290
|
-
const u = new
|
16301
|
+
const u = new Xe(this, d, e, a, s, {
|
16291
16302
|
additionalHeaders: n?.graphql?.additionalHeaders,
|
16292
16303
|
eagerFetchProducts: n?.graphql?.productCollection?.eagerFetchProducts,
|
16293
16304
|
existingGlobalPropertyState: c.data.globalPropertyState,
|
@@ -16334,7 +16345,7 @@ class md {
|
|
16334
16345
|
d.set(c.id, c.partner.id), k.setMap("bundlePartnerIds", d);
|
16335
16346
|
const A = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
16336
16347
|
return A.set(c.id, c.bundleOwnerId), k.setMap("bundleOwnerIds", A), async () => {
|
16337
|
-
const u = new
|
16348
|
+
const u = new Xe(this, c, void 0, void 0, c.bundleOwnerId, {
|
16338
16349
|
eagerFetchProducts: n?.graphql?.productCollection?.eagerFetchProducts,
|
16339
16350
|
existingGlobalPropertyState: c.globalPropertyState
|
16340
16351
|
});
|
@@ -16652,7 +16663,7 @@ class Gl {
|
|
16652
16663
|
if (n.currentFrameSources) {
|
16653
16664
|
let i = !1;
|
16654
16665
|
for (let s = 0; s < n.currentFrameSources.length; s++) {
|
16655
|
-
const o = n.currentFrameSources[s], l = await
|
16666
|
+
const o = n.currentFrameSources[s], l = await $e(o), c = this.frameData ? this.frameData[s] : void 0;
|
16656
16667
|
dn(l, c) || (this.frameData || (this.frameData = new Array(n.currentFrameSources.length)), this.frameData[s] = l, i = !0);
|
16657
16668
|
}
|
16658
16669
|
i && (this.onFrameDataChangeListeners.forEach(
|
@@ -16705,8 +16716,8 @@ class Gl {
|
|
16705
16716
|
getImageSrc() {
|
16706
16717
|
if (this.imageData) {
|
16707
16718
|
if (this.imageData.svg) {
|
16708
|
-
const t =
|
16709
|
-
return
|
16719
|
+
const t = wa(this.imageData.svg, this.imageData.colors || {}, !1);
|
16720
|
+
return ma(t);
|
16710
16721
|
}
|
16711
16722
|
return this.imageData.src;
|
16712
16723
|
}
|
@@ -17058,7 +17069,7 @@ class ql extends Z {
|
|
17058
17069
|
* Returns `true` if the Background Remover is available for the current session.
|
17059
17070
|
*/
|
17060
17071
|
async canUseBackgroundRemover() {
|
17061
|
-
return this.manager.getClient().canUseAddon(
|
17072
|
+
return this.manager.getClient().canUseAddon(ha.BackgroundRemover);
|
17062
17073
|
}
|
17063
17074
|
/**
|
17064
17075
|
* Returns `true` if the Background Remover is available for the current session and if the associated frame has a user-supplied raster image.
|
@@ -17438,12 +17449,12 @@ K = { __e: function(r, t, e, a) {
|
|
17438
17449
|
}
|
17439
17450
|
throw r;
|
17440
17451
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
17441
|
-
var st,
|
17452
|
+
var st, Ze, tn, ir = [], ta = [], en = K.__b, an = K.__r, nn = K.diffed, rn = K.__c, sn = K.unmount;
|
17442
17453
|
function ec() {
|
17443
17454
|
for (var r; r = ir.shift(); )
|
17444
17455
|
if (r.__P && r.__H)
|
17445
17456
|
try {
|
17446
|
-
r.__H.__h.forEach(we), r.__H.__h.forEach(
|
17457
|
+
r.__H.__h.forEach(we), r.__H.__h.forEach(Aa), r.__H.__h = [];
|
17447
17458
|
} catch (t) {
|
17448
17459
|
r.__H.__h = [], K.__e(t, r.__v);
|
17449
17460
|
}
|
@@ -17453,20 +17464,20 @@ K.__b = function(r) {
|
|
17453
17464
|
}, K.__r = function(r) {
|
17454
17465
|
an && an(r);
|
17455
17466
|
var t = (st = r.__c).__H;
|
17456
|
-
t && (
|
17457
|
-
e.__N && (e.__ = e.__N), e.__V =
|
17458
|
-
})) : (t.__h.forEach(we), t.__h.forEach(
|
17467
|
+
t && (Ze === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
|
17468
|
+
e.__N && (e.__ = e.__N), e.__V = ta, e.__N = e.i = void 0;
|
17469
|
+
})) : (t.__h.forEach(we), t.__h.forEach(Aa), t.__h = [])), Ze = st;
|
17459
17470
|
}, K.diffed = function(r) {
|
17460
17471
|
nn && nn(r);
|
17461
17472
|
var t = r.__c;
|
17462
17473
|
t && t.__H && (t.__H.__h.length && (ir.push(t) !== 1 && tn === K.requestAnimationFrame || ((tn = K.requestAnimationFrame) || ac)(ec)), t.__H.__.forEach(function(e) {
|
17463
|
-
e.i && (e.__H = e.i), e.__V !==
|
17464
|
-
})),
|
17474
|
+
e.i && (e.__H = e.i), e.__V !== ta && (e.__ = e.__V), e.i = void 0, e.__V = ta;
|
17475
|
+
})), Ze = st = null;
|
17465
17476
|
}, K.__c = function(r, t) {
|
17466
17477
|
t.some(function(e) {
|
17467
17478
|
try {
|
17468
17479
|
e.__h.forEach(we), e.__h = e.__h.filter(function(a) {
|
17469
|
-
return !a.__ ||
|
17480
|
+
return !a.__ || Aa(a);
|
17470
17481
|
});
|
17471
17482
|
} catch (a) {
|
17472
17483
|
t.some(function(n) {
|
@@ -17496,7 +17507,7 @@ function we(r) {
|
|
17496
17507
|
var t = st, e = r.__c;
|
17497
17508
|
typeof e == "function" && (r.__c = void 0, e()), st = t;
|
17498
17509
|
}
|
17499
|
-
function
|
17510
|
+
function Aa(r) {
|
17500
17511
|
var t = st;
|
17501
17512
|
r.__c = r.__(), st = t;
|
17502
17513
|
}
|
@@ -17611,7 +17622,7 @@ const kd = async (r) => {
|
|
17611
17622
|
});
|
17612
17623
|
};
|
17613
17624
|
export {
|
17614
|
-
|
17625
|
+
ha as AddonHandle,
|
17615
17626
|
lc as AddressValidationJobStatus,
|
17616
17627
|
oc as AddressValidationResultConfirmationLevel,
|
17617
17628
|
ud as ArrayInput,
|
@@ -17648,7 +17659,7 @@ export {
|
|
17648
17659
|
Ia as GlobalPropertyHandle,
|
17649
17660
|
R as GroupCommand,
|
17650
17661
|
So as IllustrationStepHandle,
|
17651
|
-
|
17662
|
+
Ue as InformationMessageType,
|
17652
17663
|
Do as InformationStepHandle,
|
17653
17664
|
Xa as IntegrationProduct,
|
17654
17665
|
Ir as IntegrationType,
|
@@ -17707,7 +17718,7 @@ export {
|
|
17707
17718
|
Ro as createDesign,
|
17708
17719
|
Hc as currentDirection,
|
17709
17720
|
Qc as dataUrlFromExternalUrl,
|
17710
|
-
|
17721
|
+
_e as designService,
|
17711
17722
|
fe as determineCorrectFontSizeAndLines,
|
17712
17723
|
Wn as digitalContentStepService,
|
17713
17724
|
dt as domParser,
|
@@ -17724,14 +17735,14 @@ export {
|
|
17724
17735
|
ot as generateSVGWithUnknownColors,
|
17725
17736
|
cd as generateStateFromDesignInputSteps,
|
17726
17737
|
Md as getAddressValidationJobs,
|
17727
|
-
|
17738
|
+
Qe as getAttributesFromArrayBuffer,
|
17728
17739
|
Uc as getAxisAlignedBoundingBox,
|
17729
17740
|
zl as getBoundedOffsets,
|
17730
17741
|
fd as getBundleThemeConfiguration,
|
17731
17742
|
bd as getCustomer,
|
17732
17743
|
Bd as getCustomerBundles,
|
17733
17744
|
Yc as getElementVertices,
|
17734
|
-
|
17745
|
+
$e as getFrameData,
|
17735
17746
|
od as getGlobalPropertyStateForBundle,
|
17736
17747
|
Vl as getIntegration,
|
17737
17748
|
qc as getNEPoint,
|
@@ -17761,7 +17772,7 @@ export {
|
|
17761
17772
|
fl as metafieldManager,
|
17762
17773
|
Jc as mmPerPixel,
|
17763
17774
|
jn as modelStepService,
|
17764
|
-
|
17775
|
+
wa as modifySVGColors,
|
17765
17776
|
Hn as moduleStepService,
|
17766
17777
|
yd as nameBundle,
|
17767
17778
|
Sd as nameTransaction,
|
@@ -17777,7 +17788,7 @@ export {
|
|
17777
17788
|
Ga as rehydrateSerializedLayout,
|
17778
17789
|
_r as rgbToPms,
|
17779
17790
|
ce as rotateAroundPoint,
|
17780
|
-
|
17791
|
+
fa as sanitizeSvgTree,
|
17781
17792
|
zr as setBearerAuthenticationToken,
|
17782
17793
|
Cn as setCanvasModule,
|
17783
17794
|
zt as shapeStepService,
|
@@ -17786,7 +17797,7 @@ export {
|
|
17786
17797
|
ld as stepAspectValuesToDesignInputSteps,
|
17787
17798
|
$a as svgColorValueToDefinition,
|
17788
17799
|
Ln as svgStringDimensions,
|
17789
|
-
|
17800
|
+
ma as svgToDataUrl,
|
17790
17801
|
G as textStepService,
|
17791
17802
|
Fs as toast,
|
17792
17803
|
Td as validateWorkflowExperienceRecipient,
|