@spiffcommerce/core 31.2.0-beta.db42d4ce-e654-556c-beb7-6a0b4defc362 → 31.2.0-beta.dd65281e-c94f-5366-965e-8ae4343ab58b
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 +2 -2
- package/dist/index.js +70 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +503 -503
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -4,37 +4,37 @@ import { onError as ur } from "@apollo/client/link/error";
|
|
4
4
|
import { renderToStaticMarkup as hr } from "preact-render-to-string";
|
5
5
|
import { removeTypenameFromVariables as mr } from "@apollo/client/link/remove-typename";
|
6
6
|
import { orientation as gr } from "exifr/dist/mini.umd.cjs";
|
7
|
-
import { parse as
|
7
|
+
import { parse as ln } from "css";
|
8
8
|
import pr from "fuse.js";
|
9
|
-
import { Pith as
|
9
|
+
import { Pith as Aa } from "pith";
|
10
10
|
import St from "lodash.clonedeep";
|
11
|
-
import { toString as
|
11
|
+
import { toString as cn } from "qrcode";
|
12
12
|
import fr from "svg-path-bbox";
|
13
|
-
import { parse as
|
13
|
+
import { parse as ta } from "opentype.js";
|
14
14
|
import { jsx as D, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
|
15
15
|
import Cr from "handlebars";
|
16
16
|
import { dataUriToBuffer as wr } from "data-uri-to-buffer";
|
17
|
-
import
|
18
|
-
import { CognitoIdentityProviderClient as yr, InitiateAuthCommand as
|
17
|
+
import xa from "lodash.chunk";
|
18
|
+
import { CognitoIdentityProviderClient as yr, InitiateAuthCommand as ka, RespondToAuthChallengeCommand as Sr } from "@aws-sdk/client-cognito-identity-provider";
|
19
19
|
import vr from "dinero.js";
|
20
|
-
import * as
|
21
|
-
import
|
22
|
-
import { split as
|
23
|
-
import
|
20
|
+
import * as Ma from "currency-codes";
|
21
|
+
import dn from "lodash.isequal";
|
22
|
+
import { split as ea } from "unicode-default-word-boundary";
|
23
|
+
import An from "lodash.debounce";
|
24
24
|
import "fs";
|
25
25
|
import "path";
|
26
|
-
var
|
27
|
-
class
|
26
|
+
var ye = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(ye || {}), L = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(L || {}), v = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(v || {}), Er = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Er || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), x = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(x || {}), br = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(br || {}), Br = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Br || {}), Ir = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Ir || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Pr = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Pr || {}), Se = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(Se || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), j = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(j || {}), Dr = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Dr || {});
|
27
|
+
class un extends Error {
|
28
28
|
constructor(t) {
|
29
29
|
super(t), this.name = this.constructor.name;
|
30
30
|
}
|
31
31
|
}
|
32
|
-
class Xt extends
|
32
|
+
class Xt extends un {
|
33
33
|
constructor(t) {
|
34
34
|
super(`ConfigurationError - ${t}`);
|
35
35
|
}
|
36
36
|
}
|
37
|
-
class
|
37
|
+
class ve extends Xt {
|
38
38
|
constructor(t) {
|
39
39
|
super(`Option not Configured: ${t.stepTitle}`), this.optionId = t?.optionId || "N/A";
|
40
40
|
}
|
@@ -54,32 +54,32 @@ class Yt extends Xt {
|
|
54
54
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
55
55
|
}
|
56
56
|
}
|
57
|
-
class
|
57
|
+
class Ee extends Xt {
|
58
58
|
constructor(t, e) {
|
59
59
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
60
60
|
}
|
61
61
|
}
|
62
|
-
class
|
62
|
+
class xe extends un {
|
63
63
|
constructor(t) {
|
64
64
|
super(`ImplementationError - ${t}`);
|
65
65
|
}
|
66
66
|
}
|
67
|
-
class V extends
|
67
|
+
class V extends xe {
|
68
68
|
constructor(t) {
|
69
69
|
super(`Unhandled Behavior Encountered: ${t}`);
|
70
70
|
}
|
71
71
|
}
|
72
|
-
class Dt extends
|
72
|
+
class Dt extends xe {
|
73
73
|
constructor(t) {
|
74
74
|
super(`Parsing Error: ${t}`);
|
75
75
|
}
|
76
76
|
}
|
77
|
-
class ht extends
|
77
|
+
class ht extends xe {
|
78
78
|
constructor(t) {
|
79
79
|
super(`Client Error: ${t}`);
|
80
80
|
}
|
81
81
|
}
|
82
|
-
class
|
82
|
+
class ke extends xe {
|
83
83
|
constructor(t) {
|
84
84
|
super(`Resource Generation Failed: ${t}`);
|
85
85
|
}
|
@@ -104,7 +104,7 @@ class Fr {
|
|
104
104
|
this.set(t, a);
|
105
105
|
}
|
106
106
|
}
|
107
|
-
class
|
107
|
+
class Ta {
|
108
108
|
constructor() {
|
109
109
|
this.storage = /* @__PURE__ */ new Map();
|
110
110
|
}
|
@@ -129,9 +129,9 @@ class Ma {
|
|
129
129
|
}
|
130
130
|
const xr = () => {
|
131
131
|
try {
|
132
|
-
return localStorage ? new Fr() : new
|
132
|
+
return localStorage ? new Fr() : new Ta();
|
133
133
|
} catch {
|
134
|
-
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new
|
134
|
+
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Ta();
|
135
135
|
}
|
136
136
|
}, k = xr();
|
137
137
|
class kr {
|
@@ -161,41 +161,41 @@ class kr {
|
|
161
161
|
}
|
162
162
|
}
|
163
163
|
const gt = new kr();
|
164
|
-
let
|
164
|
+
let aa, na;
|
165
165
|
function Tc(r) {
|
166
|
-
|
166
|
+
aa = r;
|
167
167
|
}
|
168
168
|
function Nc(r) {
|
169
|
-
|
169
|
+
na = r;
|
170
170
|
}
|
171
171
|
function Zt() {
|
172
|
-
return
|
172
|
+
return aa ? new aa().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 (!na) {
|
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 na(r, t);
|
185
185
|
}
|
186
|
-
const
|
187
|
-
const t =
|
186
|
+
const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @__PURE__ */ new Map(), mn = async (r) => {
|
187
|
+
const t = Na.get(r);
|
188
188
|
if (t) return t;
|
189
189
|
const a = (async () => {
|
190
190
|
const n = await rt(r);
|
191
|
-
return
|
191
|
+
return hn.set(r, n.headers?.get("content-type") || ""), await n.arrayBuffer();
|
192
192
|
})();
|
193
|
-
return
|
193
|
+
return Na.set(r, a), a;
|
194
194
|
}, Mr = async (r) => {
|
195
|
-
const t =
|
195
|
+
const t = Qa.get(r);
|
196
196
|
if (t) return t;
|
197
197
|
const a = (async () => await (await rt(r)).text())();
|
198
|
-
return
|
198
|
+
return Qa.set(r, a), a;
|
199
199
|
}, Tt = (r) => r.every((t) => t !== "undefined"), se = (r) => Tt([typeof document]) ? document.createElement(r) : Zt().document.createElement(r), Tr = (r, t) => {
|
200
200
|
if (Tt([typeof document]))
|
201
201
|
return document.createElementNS(r, t);
|
@@ -206,8 +206,8 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
206
206
|
return new DOMParser();
|
207
207
|
const r = Zt();
|
208
208
|
return new r.DOMParser();
|
209
|
-
}, Nr = () => Tt([typeof DOMParser]) ? DOMParser : Zt().DOMParser,
|
210
|
-
t ?
|
209
|
+
}, Nr = () => Tt([typeof DOMParser]) ? DOMParser : Zt().DOMParser, Me = (r, t) => new Promise((e, a) => {
|
210
|
+
t ? mn(r).then(e).catch(a) : rt(r).then((n) => {
|
211
211
|
n.arrayBuffer().then(e).catch(a);
|
212
212
|
}).catch((n) => {
|
213
213
|
a(n);
|
@@ -216,21 +216,21 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
216
216
|
t ? Mr(r).then(e).catch(a) : rt(r).then((n) => {
|
217
217
|
n.text().then(e).catch(a);
|
218
218
|
}).catch(a);
|
219
|
-
}),
|
219
|
+
}), gn = (r) => hr(r), Ue = /* @__PURE__ */ new Map(), Qr = async (r, t) => {
|
220
220
|
if (Tt([typeof FontFace])) {
|
221
|
-
if (
|
222
|
-
return
|
221
|
+
if (Ue.has(t))
|
222
|
+
return Ue.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 Ue.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
|
-
},
|
233
|
+
}, Ra = (r) => btoa(r), Te = (r) => {
|
234
234
|
function t() {
|
235
235
|
const a = new Uint8Array(r), n = 4;
|
236
236
|
if (a.length >= n) {
|
@@ -257,7 +257,7 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
257
257
|
const e = t();
|
258
258
|
return e || "image/svg+xml";
|
259
259
|
}, Qc = async (r) => {
|
260
|
-
const t = await
|
260
|
+
const t = await mn(r), e = hn.get(r) || Te(t);
|
261
261
|
return await $r(new Blob([t], { type: e }));
|
262
262
|
}, Rr = (r) => {
|
263
263
|
let t = "";
|
@@ -266,9 +266,9 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
266
266
|
t += String.fromCharCode(r[a]);
|
267
267
|
return t;
|
268
268
|
}, Or = async (r) => {
|
269
|
-
const t =
|
269
|
+
const t = Te(r), e = new Uint8Array(r), a = Rr(e), n = btoa(a);
|
270
270
|
return `data:${t};base64,${n}`;
|
271
|
-
},
|
271
|
+
}, ha = (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,13 +287,13 @@ const un = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
287
287
|
!i || !i.result ? e() : t(i.result.toString());
|
288
288
|
}, a.readAsDataURL(r);
|
289
289
|
});
|
290
|
-
let Ur,
|
290
|
+
let Ur, ma;
|
291
291
|
const Lr = (r) => {
|
292
|
-
|
293
|
-
}, Vr = () =>
|
294
|
-
let
|
292
|
+
ma = r;
|
293
|
+
}, Vr = () => ma;
|
294
|
+
let fn;
|
295
295
|
const zr = (r) => {
|
296
|
-
|
296
|
+
fn = r;
|
297
297
|
}, Gr = () => new Promise((r) => {
|
298
298
|
const t = gt.getHubUrl(), e = (a) => {
|
299
299
|
a.origin === t && (window.removeEventListener("message", e), r(a.data));
|
@@ -301,9 +301,9 @@ 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: ma,
|
305
305
|
customerToken: Ur,
|
306
|
-
bearer:
|
306
|
+
bearer: fn
|
307
307
|
};
|
308
308
|
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Gr(), ...r } : r;
|
309
309
|
};
|
@@ -364,30 +364,30 @@ class jr {
|
|
364
364
|
}
|
365
365
|
}
|
366
366
|
const y = new jr();
|
367
|
-
let
|
367
|
+
let ra, ia;
|
368
368
|
const pt = (r, t, e) => {
|
369
|
-
if (
|
370
|
-
return
|
369
|
+
if (ra !== void 0)
|
370
|
+
return ra(r, t, e);
|
371
371
|
try {
|
372
|
-
const a =
|
373
|
-
return
|
372
|
+
const a = wn(!0);
|
373
|
+
return Cn(a), a.createCanvas(r, t, e);
|
374
374
|
} catch {
|
375
375
|
throw new Error("Canvas module not set");
|
376
376
|
}
|
377
377
|
}, te = (r, t) => {
|
378
|
-
if (
|
379
|
-
return
|
378
|
+
if (ia !== void 0)
|
379
|
+
return ia(r, t);
|
380
380
|
try {
|
381
|
-
const e =
|
382
|
-
return
|
381
|
+
const e = wn(!0);
|
382
|
+
return Cn(e), e.loadImage(r, t);
|
383
383
|
} catch {
|
384
384
|
throw new Error("Canvas module not set");
|
385
385
|
}
|
386
386
|
};
|
387
|
-
function fn(r) {
|
388
|
-
na = r?.createCanvas, ra = r?.loadImage;
|
389
|
-
}
|
390
387
|
function Cn(r) {
|
388
|
+
ra = r?.createCanvas, ia = r?.loadImage;
|
389
|
+
}
|
390
|
+
function wn(r) {
|
391
391
|
try {
|
392
392
|
if (document.createElement("canvas").getContext("2d"))
|
393
393
|
return {
|
@@ -406,13 +406,13 @@ function Cn(r) {
|
|
406
406
|
throw t;
|
407
407
|
}
|
408
408
|
}
|
409
|
-
let
|
410
|
-
function
|
411
|
-
return
|
409
|
+
let Le;
|
410
|
+
function ga() {
|
411
|
+
return Le === void 0 && (Le = Nr()), Le;
|
412
412
|
}
|
413
413
|
let oe = null;
|
414
414
|
const Hr = (r) => new Promise((t) => {
|
415
|
-
if (
|
415
|
+
if (Te(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
|
+
}, Ne = async (r) => {
|
458
458
|
const t = await Kr(r);
|
459
|
-
return
|
459
|
+
return Te(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
|
+
], Ve = 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 = Ve[A][0], c = Ve[A][1], d = Ve[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
|
}
|
@@ -3187,23 +3187,23 @@ function $c(r, t) {
|
|
3187
3187
|
let Qt = null;
|
3188
3188
|
function ti(r) {
|
3189
3189
|
if (r.startsWith("#"))
|
3190
|
-
return
|
3190
|
+
return Oa(r);
|
3191
3191
|
if (!document)
|
3192
3192
|
throw new Error("browserColorToHex is only supported on browsers");
|
3193
3193
|
if (Qt || (Qt = document.createElement("canvas").getContext("2d")), !Qt)
|
3194
3194
|
throw new Error("Failed to create canvas context required to convert colors");
|
3195
3195
|
Qt.fillStyle = r;
|
3196
|
-
const t =
|
3196
|
+
const t = Oa(Qt.fillStyle);
|
3197
3197
|
return t || console.error(`Unknown browser color ${r}`), t;
|
3198
3198
|
}
|
3199
|
-
function
|
3199
|
+
function Oa(r) {
|
3200
3200
|
const t = r.substring(1).toUpperCase();
|
3201
3201
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
3202
3202
|
}
|
3203
3203
|
const le = (r) => {
|
3204
|
-
const t =
|
3204
|
+
const t = yn(r.spotColor);
|
3205
3205
|
return t ? `${r.browserValue} ${t}` : r.browserValue;
|
3206
|
-
},
|
3206
|
+
}, yn = (r) => {
|
3207
3207
|
if (!r)
|
3208
3208
|
return "";
|
3209
3209
|
if (r.profileName.includes("/") && r.profileName.includes(".icc")) {
|
@@ -3211,7 +3211,7 @@ const le = (r) => {
|
|
3211
3211
|
return `icc-named-color(${t.slice(e + 1).slice(0, -4)}, ${r.namedColor})`;
|
3212
3212
|
}
|
3213
3213
|
return `icc-named-color(${r.profileName}, ${r.namedColor})`;
|
3214
|
-
},
|
3214
|
+
}, $a = (r) => {
|
3215
3215
|
const t = r.split(/[ ](?=[^)]*?(?:\(|$))/);
|
3216
3216
|
if (t.length === 0)
|
3217
3217
|
return { browserValue: "#000000" };
|
@@ -3245,7 +3245,7 @@ const le = (r) => {
|
|
3245
3245
|
} catch {
|
3246
3246
|
return r.classList.contains(t.substring(1));
|
3247
3247
|
}
|
3248
|
-
},
|
3248
|
+
}, pa = (r, t = !1) => {
|
3249
3249
|
!t && r.setAttribute("preserveAspectRatio", "none");
|
3250
3250
|
const e = [];
|
3251
3251
|
kt(r, (a) => {
|
@@ -3255,7 +3255,7 @@ const le = (r) => {
|
|
3255
3255
|
}
|
3256
3256
|
if (a.tagName === "style") {
|
3257
3257
|
try {
|
3258
|
-
|
3258
|
+
ln(a.innerHTML).stylesheet?.rules.forEach((s) => {
|
3259
3259
|
e.push(s);
|
3260
3260
|
}), a.remove();
|
3261
3261
|
} catch (i) {
|
@@ -3287,9 +3287,9 @@ const le = (r) => {
|
|
3287
3287
|
const t = /pt|pc|mm|cm|in/gm, e = r.getAttribute("viewBox"), a = r.getAttribute("width"), n = r.getAttribute("height");
|
3288
3288
|
if (!e) throw new Error("viewBox not specified on SVG!");
|
3289
3289
|
a && r.setAttribute("width", a.replace(t, "")), n && r.setAttribute("height", n.replace(t, ""));
|
3290
|
-
},
|
3290
|
+
}, Sn = (r) => dt().parseFromString(r, "image/svg+xml").firstElementChild, ii = (r, t, e) => {
|
3291
3291
|
r.setAttribute("height", `${e}px`), r.setAttribute("width", `${t}px`);
|
3292
|
-
},
|
3292
|
+
}, vn = (r, t, e) => {
|
3293
3293
|
kt(r, (a) => {
|
3294
3294
|
const n = a.attributes.getNamedItem("fill");
|
3295
3295
|
n && n.value !== "none" && a.classList.forEach((s) => {
|
@@ -3328,16 +3328,16 @@ const le = (r) => {
|
|
3328
3328
|
}
|
3329
3329
|
});
|
3330
3330
|
});
|
3331
|
-
},
|
3332
|
-
const i =
|
3331
|
+
}, En = (r) => Bt().serializeToString(r), fa = (r, t, e, a, n) => {
|
3332
|
+
const i = Sn(r);
|
3333
3333
|
if (!i)
|
3334
3334
|
throw new Error("Failed to read SVG.");
|
3335
|
-
return ii(i, t, e),
|
3336
|
-
},
|
3337
|
-
const a =
|
3335
|
+
return ii(i, t, e), vn(i, a, n), En(i);
|
3336
|
+
}, Ca = (r, t, e) => {
|
3337
|
+
const a = Sn(r);
|
3338
3338
|
if (!a)
|
3339
3339
|
throw new Error("Failed to read SVG.");
|
3340
|
-
return
|
3340
|
+
return vn(a, t, e), En(a);
|
3341
3341
|
}, si = (r) => {
|
3342
3342
|
const t = /<svg.*<\/svg>/s, e = r.match(t) || [], a = e?.length > 0 ? e[0] : "";
|
3343
3343
|
return dt().parseFromString(a, "image/svg+xml");
|
@@ -3345,18 +3345,18 @@ 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
|
+
pa(e);
|
3349
3349
|
const a = {};
|
3350
3350
|
kt(e, (s) => {
|
3351
3351
|
ei.includes(s.tagName) && !s.attributes.getNamedItem("fill") && s.setAttribute("fill", "black");
|
3352
3352
|
const o = s.attributes.getNamedItem("fill");
|
3353
3353
|
if (o && o.value !== "none" && !o.value.startsWith("url(")) {
|
3354
|
-
const c =
|
3354
|
+
const c = $a(o.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
|
3355
3355
|
s.setAttribute("fill", c.browserValue), s.classList.add(A), a[d] = c;
|
3356
3356
|
}
|
3357
3357
|
const l = s.attributes.getNamedItem("stroke");
|
3358
3358
|
if (l && l.value !== "none" && !l.value.startsWith("url(")) {
|
3359
|
-
const c =
|
3359
|
+
const c = $a(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
|
3360
3360
|
s.classList.add(A), s.setAttribute("stroke", c.browserValue), a[d] = c;
|
3361
3361
|
}
|
3362
3362
|
});
|
@@ -3422,7 +3422,7 @@ const le = (r) => {
|
|
3422
3422
|
...AssetFields
|
3423
3423
|
}
|
3424
3424
|
}
|
3425
|
-
`,
|
3425
|
+
`, wa = 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
|
+
${wa}
|
3474
3474
|
query GetMaterials($ids: [String]) {
|
3475
3475
|
materials(id: $ids) {
|
3476
3476
|
...MaterialFields
|
@@ -3497,7 +3497,7 @@ const le = (r) => {
|
|
3497
3497
|
...AssetFields
|
3498
3498
|
}
|
3499
3499
|
}
|
3500
|
-
`,
|
3500
|
+
`, be = async (r) => (await y.getShadowGraphqlClient().query({
|
3501
3501
|
query: li,
|
3502
3502
|
errorPolicy: "all",
|
3503
3503
|
fetchPolicy: "no-cache",
|
@@ -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 Ne(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));
|
@@ -3546,14 +3546,14 @@ class mi {
|
|
3546
3546
|
if (!n) throw new V("Failed to get asset from cache!");
|
3547
3547
|
return n;
|
3548
3548
|
}
|
3549
|
-
const a = (async () => (await
|
3549
|
+
const a = (async () => (await be([t]))[0])();
|
3550
3550
|
return this.cache.set(t, a), a;
|
3551
3551
|
}
|
3552
3552
|
/**
|
3553
3553
|
* Retrieves the asset from the server, bypassing cache (but still writing the result to cache)
|
3554
3554
|
*/
|
3555
3555
|
async getFromServer(t) {
|
3556
|
-
const a = (async () => (await
|
3556
|
+
const a = (async () => (await be([t]))[0])();
|
3557
3557
|
return this.cache.set(t, a), a;
|
3558
3558
|
}
|
3559
3559
|
keyFromURL(t) {
|
@@ -3612,7 +3612,7 @@ class mi {
|
|
3612
3612
|
}, a, n);
|
3613
3613
|
}
|
3614
3614
|
async uploadFile(t, e) {
|
3615
|
-
const n = this.isRaster(t) ?
|
3615
|
+
const n = this.isRaster(t) ? ye.Image : ye.Illustration, i = await this.loadImageAsFileInfo(t);
|
3616
3616
|
return await this.uploadAssetWithProgress(i, n, e, !0);
|
3617
3617
|
}
|
3618
3618
|
async removeBackgroundFromAsset(t) {
|
@@ -3748,7 +3748,7 @@ const Rt = "persistentAssets", lt = class lt {
|
|
3748
3748
|
};
|
3749
3749
|
lt.callbacks = [];
|
3750
3750
|
let At = lt;
|
3751
|
-
const
|
3751
|
+
const Ua = "bgrmPersistentAssets";
|
3752
3752
|
class J {
|
3753
3753
|
static has(t) {
|
3754
3754
|
return J.getMap().has(t);
|
@@ -3775,10 +3775,10 @@ class J {
|
|
3775
3775
|
a && (e.delete(a), J.setMap(e));
|
3776
3776
|
}
|
3777
3777
|
static getMap() {
|
3778
|
-
return k.getMap(
|
3778
|
+
return k.getMap(Ua) || /* @__PURE__ */ new Map();
|
3779
3779
|
}
|
3780
3780
|
static setMap(t) {
|
3781
|
-
k.setMap(
|
3781
|
+
k.setMap(Ua, t);
|
3782
3782
|
}
|
3783
3783
|
}
|
3784
3784
|
const O = new mi();
|
@@ -3811,7 +3811,7 @@ class gi {
|
|
3811
3811
|
this.disabled = t;
|
3812
3812
|
}
|
3813
3813
|
}
|
3814
|
-
const Kt = new gi(),
|
3814
|
+
const Kt = new gi(), bn = w`
|
3815
3815
|
fragment OptionFields on Option {
|
3816
3816
|
id
|
3817
3817
|
name
|
@@ -3850,8 +3850,8 @@ const Kt = new gi(), En = w`
|
|
3850
3850
|
}
|
3851
3851
|
`, pi = w`
|
3852
3852
|
${ee(!1)}
|
3853
|
-
${
|
3854
|
-
${
|
3853
|
+
${wa}
|
3854
|
+
${bn}
|
3855
3855
|
query GetOptions($ids: [String]!) {
|
3856
3856
|
options(ids: $ids) {
|
3857
3857
|
...OptionFields
|
@@ -3920,7 +3920,7 @@ class yi {
|
|
3920
3920
|
}
|
3921
3921
|
}
|
3922
3922
|
}
|
3923
|
-
const H = new yi(),
|
3923
|
+
const H = new yi(), Bn = w`
|
3924
3924
|
fragment ActiveIntegrationFields on Integration {
|
3925
3925
|
id
|
3926
3926
|
logo
|
@@ -3939,7 +3939,7 @@ const H = new yi(), bn = w`
|
|
3939
3939
|
currencyCode
|
3940
3940
|
}
|
3941
3941
|
}
|
3942
|
-
`,
|
3942
|
+
`, Qe = 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
|
+
${Qe}
|
3962
3962
|
mutation CreateTransactions(
|
3963
3963
|
$inputs: [TransactionCreateInput]!
|
3964
3964
|
$marketplaceThemeInstallId: String
|
@@ -4048,7 +4048,7 @@ const H = new yi(), bn = w`
|
|
4048
4048
|
}
|
4049
4049
|
}
|
4050
4050
|
}
|
4051
|
-
`,
|
4051
|
+
`, In = w`
|
4052
4052
|
fragment StakeholderFields on Stakeholder {
|
4053
4053
|
id
|
4054
4054
|
type
|
@@ -4056,7 +4056,7 @@ const H = new yi(), bn = w`
|
|
4056
4056
|
authorizationNote
|
4057
4057
|
authorizationStatus
|
4058
4058
|
}
|
4059
|
-
`,
|
4059
|
+
`, Pn = w`
|
4060
4060
|
fragment TransactionShareActionFields on TransactionShareAction {
|
4061
4061
|
id
|
4062
4062
|
title
|
@@ -4066,10 +4066,10 @@ const H = new yi(), bn = w`
|
|
4066
4066
|
url
|
4067
4067
|
}
|
4068
4068
|
`, vi = w`
|
4069
|
-
${
|
4070
|
-
${Bn}
|
4069
|
+
${Qe}
|
4071
4070
|
${In}
|
4072
|
-
${
|
4071
|
+
${Pn}
|
4072
|
+
${Bn}
|
4073
4073
|
query ReadTransactions($ids: [String]!) {
|
4074
4074
|
transactions(ids: $ids) {
|
4075
4075
|
customLogoLink
|
@@ -4332,7 +4332,7 @@ const H = new yi(), bn = w`
|
|
4332
4332
|
}
|
4333
4333
|
}
|
4334
4334
|
`, Pi = w`
|
4335
|
-
${
|
4335
|
+
${Pn}
|
4336
4336
|
query ReadTransactionForShareActions($id: String!) {
|
4337
4337
|
transactions(ids: [$id]) {
|
4338
4338
|
id
|
@@ -4342,15 +4342,15 @@ const H = new yi(), bn = w`
|
|
4342
4342
|
}
|
4343
4343
|
}
|
4344
4344
|
}
|
4345
|
-
`,
|
4345
|
+
`, Dn = w`
|
4346
4346
|
query ReadWorkflowStates($ids: [String]!) {
|
4347
4347
|
transactions(ids: $ids) {
|
4348
4348
|
id
|
4349
4349
|
workflowState
|
4350
4350
|
}
|
4351
4351
|
}
|
4352
|
-
`,
|
4353
|
-
${
|
4352
|
+
`, Fn = (r) => w`
|
4353
|
+
${Qe}
|
4354
4354
|
fragment IntegrationProductFields on IntegrationProduct {
|
4355
4355
|
id
|
4356
4356
|
externalProductId
|
@@ -4433,14 +4433,14 @@ const H = new yi(), bn = w`
|
|
4433
4433
|
}
|
4434
4434
|
}
|
4435
4435
|
`, Di = (r) => w`
|
4436
|
-
${
|
4436
|
+
${Fn(r)}
|
4437
4437
|
query GetIntegrationProducts($ids: [String!]!) {
|
4438
4438
|
integrationProducts(ids: $ids) {
|
4439
4439
|
...IntegrationProductFields
|
4440
4440
|
}
|
4441
4441
|
}
|
4442
4442
|
`, Fi = (r) => w`
|
4443
|
-
${
|
4443
|
+
${Fn(r)}
|
4444
4444
|
query GetIntegrationProductFromExternalIds($externalIntegrationId: String!, $externalProductId: String!) {
|
4445
4445
|
integrationProductFromExternalIds(
|
4446
4446
|
externalIntegrationId: $externalIntegrationId
|
@@ -4450,7 +4450,7 @@ const H = new yi(), bn = w`
|
|
4450
4450
|
}
|
4451
4451
|
}
|
4452
4452
|
`, xi = w`
|
4453
|
-
${
|
4453
|
+
${In}
|
4454
4454
|
query ReadTransactionForStakeholders($id: String!) {
|
4455
4455
|
transactions(ids: [$id]) {
|
4456
4456
|
stakeholders {
|
@@ -4587,8 +4587,8 @@ const H = new yi(), bn = w`
|
|
4587
4587
|
}
|
4588
4588
|
`, Ri = (r) => w`
|
4589
4589
|
${ee(r)}
|
4590
|
-
${
|
4591
|
-
${
|
4590
|
+
${wa}
|
4591
|
+
${bn}
|
4592
4592
|
${Mi}
|
4593
4593
|
${Ti}
|
4594
4594
|
${Ni}
|
@@ -5027,7 +5027,7 @@ const H = new yi(), bn = w`
|
|
5027
5027
|
}
|
5028
5028
|
}
|
5029
5029
|
}
|
5030
|
-
`,
|
5030
|
+
`, Re = w`
|
5031
5031
|
fragment MarketplaceThemeInstallConfigurationFields on MarketplaceThemeInstallConfiguration {
|
5032
5032
|
id
|
5033
5033
|
themeInstallId
|
@@ -5106,15 +5106,15 @@ const H = new yi(), bn = w`
|
|
5106
5106
|
}
|
5107
5107
|
}
|
5108
5108
|
`, Ui = w`
|
5109
|
-
${
|
5109
|
+
${Re}
|
5110
5110
|
query GetMarketplaceThemeInstallConfiguration($themeConfigurationId: String!, $themeInstallId: String!) {
|
5111
5111
|
marketplaceThemeInstallConfiguration(id: $themeConfigurationId, themeInstallId: $themeInstallId, raw: false) {
|
5112
5112
|
...MarketplaceThemeInstallConfigurationFields
|
5113
5113
|
}
|
5114
5114
|
}
|
5115
5115
|
`, Li = w`
|
5116
|
-
${
|
5117
|
-
${
|
5116
|
+
${Bn}
|
5117
|
+
${Re}
|
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
|
+
${Re}
|
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
|
+
${Re}
|
5139
5139
|
query ReadBundleForMarketplaceTheme($id: String!) {
|
5140
5140
|
bundles(ids: [$id]) {
|
5141
5141
|
marketplaceThemeInstallConfiguration(raw: false) {
|
@@ -5246,12 +5246,12 @@ const H = new yi(), bn = w`
|
|
5246
5246
|
);
|
5247
5247
|
return i;
|
5248
5248
|
};
|
5249
|
-
class
|
5249
|
+
class xn {
|
5250
5250
|
constructor() {
|
5251
5251
|
this.timestamp = Date.now();
|
5252
5252
|
}
|
5253
5253
|
}
|
5254
|
-
class
|
5254
|
+
class kn {
|
5255
5255
|
/**
|
5256
5256
|
* Constructs a new promise queue.
|
5257
5257
|
* @param queueMaxSize An optional maximum size, when the max size is hit.
|
@@ -5346,7 +5346,7 @@ const M = () => {
|
|
5346
5346
|
...E,
|
5347
5347
|
_renderingConfiguration: a,
|
5348
5348
|
mask: l ? `url(#viewmask-${C})` : void 0
|
5349
|
-
})), f =
|
5349
|
+
})), f = va(I);
|
5350
5350
|
return /* @__PURE__ */ ct(
|
5351
5351
|
"svg",
|
5352
5352
|
{
|
@@ -5383,7 +5383,7 @@ const M = () => {
|
|
5383
5383
|
{
|
5384
5384
|
id: "element-group",
|
5385
5385
|
clipPath: a.purpose === Ht.FreeDesign ? "url(#viewboxClip)" : void 0,
|
5386
|
-
children: f.map((E) =>
|
5386
|
+
children: f.map((E) => $n(E)).filter((E) => !!E)
|
5387
5387
|
}
|
5388
5388
|
),
|
5389
5389
|
l && /* @__PURE__ */ D(
|
@@ -5502,7 +5502,7 @@ const M = () => {
|
|
5502
5502
|
x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
|
5503
5503
|
y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
|
5504
5504
|
};
|
5505
|
-
}, Jc = 0.352778, Kc = 0.035277,
|
5505
|
+
}, Jc = 0.352778, Kc = 0.035277, Mn = (r) => {
|
5506
5506
|
const t = r.rotation || 0, e = ft(t), a = Math.cos(e), n = -Math.sin(e);
|
5507
5507
|
return /* @__PURE__ */ D("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ D(
|
5508
5508
|
"g",
|
@@ -5524,8 +5524,8 @@ const M = () => {
|
|
5524
5524
|
)
|
5525
5525
|
}
|
5526
5526
|
) });
|
5527
|
-
},
|
5528
|
-
const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s =
|
5527
|
+
}, Tn = (r) => {
|
5528
|
+
const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s = va(r.children);
|
5529
5529
|
return /* @__PURE__ */ ct(Gt, { children: [
|
5530
5530
|
/* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ D("path", { d: r.clipPath }) : /* @__PURE__ */ D("rect", { x: 0, y: 0, width: r.width, height: r.height }) }) }),
|
5531
5531
|
/* @__PURE__ */ ct(
|
@@ -5550,7 +5550,7 @@ const M = () => {
|
|
5550
5550
|
height: r.height
|
5551
5551
|
}
|
5552
5552
|
) : void 0,
|
5553
|
-
s.map((l) =>
|
5553
|
+
s.map((l) => $n(l)).filter((l) => !!l).map((l) => /* @__PURE__ */ D("g", { clipPath: `url(#${t})`, children: l }))
|
5554
5554
|
]
|
5555
5555
|
}
|
5556
5556
|
)
|
@@ -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 = Ca(r.pattern.svg, r.pattern.colors || {}, !1);
|
5564
|
+
return ha(A);
|
5565
5565
|
}
|
5566
5566
|
return r.pattern.src;
|
5567
5567
|
};
|
@@ -5629,7 +5629,7 @@ const M = () => {
|
|
5629
5629
|
matrix(${r.scaleX}, 0, 0, ${r.scaleY}, 0, 0)
|
5630
5630
|
`,
|
5631
5631
|
children: /* @__PURE__ */ D(
|
5632
|
-
|
5632
|
+
Tn,
|
5633
5633
|
{
|
5634
5634
|
id: t,
|
5635
5635
|
x: 0,
|
@@ -5646,7 +5646,7 @@ const M = () => {
|
|
5646
5646
|
}
|
5647
5647
|
)
|
5648
5648
|
] });
|
5649
|
-
},
|
5649
|
+
}, Nn = /* @__PURE__ */ new Map();
|
5650
5650
|
class _i {
|
5651
5651
|
constructor(t) {
|
5652
5652
|
this.font = t, this.glyphsFromText = /* @__PURE__ */ new Map(), this.kerningValues = /* @__PURE__ */ new Map(), this.height = this.calculateApproximateHeight();
|
@@ -5696,38 +5696,38 @@ 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:", ze = /* @__PURE__ */ new Map(), Nt = async (r) => {
|
5700
|
+
if (ze.has(r))
|
5701
|
+
return ze.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 =
|
5708
|
-
return
|
5707
|
+
const a = pn(r), n = ta(a);
|
5708
|
+
return sa(r, n), n;
|
5709
5709
|
} else {
|
5710
|
-
const a = await
|
5711
|
-
return
|
5710
|
+
const a = await Me(r, !0), n = ta(a);
|
5711
|
+
return sa(r, n), await Qr(n, r), n;
|
5712
5712
|
}
|
5713
5713
|
}
|
5714
5714
|
})();
|
5715
|
-
return
|
5715
|
+
return ze.set(r, e), e;
|
5716
5716
|
}, Zi = (r) => {
|
5717
|
-
const t =
|
5718
|
-
return
|
5717
|
+
const t = pn(r), e = ta(t);
|
5718
|
+
return sa(r, e), e;
|
5719
5719
|
}, Et = (r) => {
|
5720
|
-
const t =
|
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
|
+
}, sa = (r, t) => {
|
5725
5725
|
const e = new _i(t);
|
5726
|
-
return
|
5726
|
+
return Nn.set(r, e), e;
|
5727
5727
|
}, _c = async (r) => {
|
5728
5728
|
const t = dt(), e = t.parseFromString(r, "image/svg+xml"), a = e.firstElementChild, n = /* @__PURE__ */ new Map();
|
5729
5729
|
a.querySelectorAll("style").forEach((d) => {
|
5730
|
-
|
5730
|
+
ln(d.innerHTML).stylesheet?.rules.forEach((u) => {
|
5731
5731
|
if (u.type === "font-face" && u.declarations) {
|
5732
5732
|
const h = u.declarations.find(
|
5733
5733
|
(g) => g.property === "font-family"
|
@@ -5758,9 +5758,9 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
|
|
5758
5758
|
h.appendChild(Q);
|
5759
5759
|
}
|
5760
5760
|
return e.querySelectorAll("text").forEach((d) => d.remove()), Bt().serializeToString(a);
|
5761
|
-
},
|
5762
|
-
`), e, a), t),
|
5763
|
-
const s = (i ||
|
5761
|
+
}, Be = (r, t, e, a) => Math.max(ns(r.join(`
|
5762
|
+
`), e, a), t), La = (r, t, e, a, n, i) => {
|
5763
|
+
const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
|
5764
5764
|
`);
|
5765
5765
|
try {
|
5766
5766
|
const l = o.flatMap((d) => ge(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
|
@@ -5768,7 +5768,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
|
|
5768
5768
|
lines: c,
|
5769
5769
|
requiredHeight: l.flatMap((d) => d.lines).length * (a * s),
|
5770
5770
|
fontSize: e,
|
5771
|
-
requiredWidth:
|
5771
|
+
requiredWidth: Be(c, r.width, a, n)
|
5772
5772
|
};
|
5773
5773
|
} catch {
|
5774
5774
|
const c = t.split("");
|
@@ -5776,7 +5776,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
|
|
5776
5776
|
lines: c,
|
5777
5777
|
requiredHeight: c.length * (a * s),
|
5778
5778
|
fontSize: e,
|
5779
|
-
requiredWidth:
|
5779
|
+
requiredWidth: Be(c, r.width, a, n)
|
5780
5780
|
};
|
5781
5781
|
}
|
5782
5782
|
}, ge = (r, t, e, a) => {
|
@@ -5811,12 +5811,12 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
|
|
5811
5811
|
throw new Error(`No max width calculated for text: ${o}.`);
|
5812
5812
|
return { lines: o, width: l };
|
5813
5813
|
}, ts = (r, t, e, a, n, i) => {
|
5814
|
-
const s = (i ??
|
5814
|
+
const s = (i ?? ya) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Qn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
|
5815
5815
|
return Math.min(A, d);
|
5816
5816
|
}, es = (r, t, e, a) => {
|
5817
5817
|
const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
|
5818
5818
|
if (!e)
|
5819
|
-
return
|
5819
|
+
return La(t, r, t.fontSize, s, n, a);
|
5820
5820
|
let o;
|
5821
5821
|
if (t.text ? o = t.text.split(`
|
5822
5822
|
`) : o = t.input?.split(`
|
@@ -5824,22 +5824,22 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
|
|
5824
5824
|
return {
|
5825
5825
|
lines: o,
|
5826
5826
|
requiredHeight: t.height,
|
5827
|
-
requiredWidth:
|
5827
|
+
requiredWidth: Be(o, t.width, s, n),
|
5828
5828
|
fontSize: t.fontSize
|
5829
5829
|
};
|
5830
5830
|
const l = t.width !== e.width != (t.height !== e.height);
|
5831
5831
|
return t.lineHeight === e.lineHeight && !l && e.input === r ? {
|
5832
5832
|
lines: o,
|
5833
5833
|
requiredHeight: t.height,
|
5834
|
-
requiredWidth:
|
5834
|
+
requiredWidth: Be(o, t.width, s, n),
|
5835
5835
|
fontSize: ts(o, n, i, t.width, t.height, a)
|
5836
|
-
} :
|
5836
|
+
} : La(t, r, t.fontSize, s, n, a);
|
5837
5837
|
}, as = (r, t, e, a, n) => {
|
5838
5838
|
const s = Et(t.assetUrl).getFont();
|
5839
5839
|
let o = { ...r };
|
5840
|
-
const l = { ...r }, c =
|
5840
|
+
const l = { ...r }, c = Qn(a, e / s.unitsPerEm, Et(t.assetUrl));
|
5841
5841
|
return c && c < o.width && (l.width = c, n === "left" ? (l.left += Math.sin(o.rotation * Math.PI / 360) * (o.width - c), l.top += Math.sin(o.rotation * Math.PI / 180) * (c - o.width) / 2) : n === "right" ? l.left += o.width - c : l.left += (o.width - c) / 2, a && rs(a, a).every(([d, A]) => d === A) && (o = l)), o;
|
5842
|
-
},
|
5842
|
+
}, Ge = 1, mt = (r, t, e) => {
|
5843
5843
|
let a = 0;
|
5844
5844
|
const n = e.getGlyphs(r);
|
5845
5845
|
return n.forEach((i, s) => {
|
@@ -5857,21 +5857,21 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
|
|
5857
5857
|
a = Math.max(a, o || 0);
|
5858
5858
|
}
|
5859
5859
|
}), a *= t, a;
|
5860
|
-
},
|
5860
|
+
}, Qn = (r, t, e) => {
|
5861
5861
|
let a = 0;
|
5862
5862
|
return r.forEach((n) => {
|
5863
5863
|
a = Math.max(a, mt(n, t, e));
|
5864
5864
|
}), a;
|
5865
|
-
},
|
5865
|
+
}, Va = {
|
5866
5866
|
stripControlCharacters: !0,
|
5867
5867
|
vertical: !1,
|
5868
5868
|
uppercase: !1
|
5869
|
-
},
|
5870
|
-
const e = { ...
|
5869
|
+
}, Ie = (r, t = Va) => {
|
5870
|
+
const e = { ...Va, ...t };
|
5871
5871
|
let a = r || "";
|
5872
5872
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
5873
5873
|
`)), a;
|
5874
|
-
}, rs = (r, t) => r.map((e, a) => [e, t[a]]), is = (r = "center", t = !1) => t ? "center" : r,
|
5874
|
+
}, rs = (r, t) => r.map((e, a) => [e, t[a]]), is = (r = "center", t = !1) => t ? "center" : r, Rn = (r) => r === "left" ? "start" : r === "right" ? "end" : "middle", ae = (r, t, e) => r.fontData ? {
|
5875
5875
|
...r,
|
5876
5876
|
...(() => {
|
5877
5877
|
if (r.algorithm === Mt.Traditional) {
|
@@ -5889,11 +5889,11 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
|
|
5889
5889
|
text: t
|
5890
5890
|
};
|
5891
5891
|
})()
|
5892
|
-
} : r,
|
5892
|
+
} : r, ya = 1.1;
|
5893
5893
|
function Ft(r, t) {
|
5894
|
-
return
|
5894
|
+
return On(r, t.getTemplatingContext());
|
5895
5895
|
}
|
5896
|
-
function
|
5896
|
+
function On(r, t) {
|
5897
5897
|
try {
|
5898
5898
|
r = Cr.compile(r)(t);
|
5899
5899
|
} catch (e) {
|
@@ -5902,11 +5902,11 @@ function Rn(r, t) {
|
|
5902
5902
|
return r;
|
5903
5903
|
}
|
5904
5904
|
const ss = (r) => {
|
5905
|
-
const e = (r.rotation || 0) * Math.PI / 180, a = Math.cos(e), n = -Math.sin(e), i = `text-path-${r.id}`, s = `text-fill-${r.id}`, o = r.x + (r.curved ? 0 : r.width / 2), l = r.y + (r.curved ? 0 : r.height / 2), c =
|
5905
|
+
const e = (r.rotation || 0) * Math.PI / 180, a = Math.cos(e), n = -Math.sin(e), i = `text-path-${r.id}`, s = `text-fill-${r.id}`, o = r.x + (r.curved ? 0 : r.width / 2), l = r.y + (r.curved ? 0 : r.height / 2), c = On(r.text || "", r._renderingConfiguration?.templatingContext), d = c.split(`
|
5906
5906
|
`), A = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeColor?.browserValue : void 0, u = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
|
5907
5907
|
if (r.curved && !r.paths || !r.fontData)
|
5908
5908
|
return null;
|
5909
|
-
const h = () => r.textFillImage ? `url("#${s}")` : r._renderingConfiguration?.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${
|
5909
|
+
const h = () => r.textFillImage ? `url("#${s}")` : r._renderingConfiguration?.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${yn(r.fillSpotColorDefinition)}` : r.fill;
|
5910
5910
|
return /* @__PURE__ */ ct(Gt, { children: [
|
5911
5911
|
/* @__PURE__ */ ct("defs", { children: [
|
5912
5912
|
r.textFillImage && /* @__PURE__ */ D(
|
@@ -5981,7 +5981,7 @@ const ss = (r) => {
|
|
5981
5981
|
) }) })
|
5982
5982
|
] });
|
5983
5983
|
}, os = (r) => {
|
5984
|
-
const t = () => r.lineHeight !== void 0 ? r.lineHeight :
|
5984
|
+
const t = () => r.lineHeight !== void 0 ? r.lineHeight : ya, e = () => r.align === "left" ? -r.textboxWidth / 2 : r.align === "right" ? r.textboxWidth / 2 : 0, a = () => {
|
5985
5985
|
const n = r.fontSize * t(), i = r.textboxHeight / 2;
|
5986
5986
|
if (r.verticalAlign === "top")
|
5987
5987
|
return -i + r.fontSize * 3 / 4 + r.thisLineIdx * n;
|
@@ -5992,14 +5992,14 @@ const ss = (r) => {
|
|
5992
5992
|
const s = (r.amountLines - 1) / 2;
|
5993
5993
|
return (r.thisLineIdx - s) * n + r.fontSize / 4;
|
5994
5994
|
};
|
5995
|
-
return /* @__PURE__ */ D("tspan", { textAnchor:
|
5995
|
+
return /* @__PURE__ */ D("tspan", { textAnchor: Rn(r.align), x: e(), y: `${a()}px`, children: r.text });
|
5996
5996
|
}, ls = (r) => {
|
5997
5997
|
const t = `#${r.curvedPathId}`;
|
5998
5998
|
return /* @__PURE__ */ D(
|
5999
5999
|
"textPath",
|
6000
6000
|
{
|
6001
6001
|
startOffset: r.align === "left" ? "0%" : r.align === "right" ? "100%" : "50%",
|
6002
|
-
textAnchor:
|
6002
|
+
textAnchor: Rn(r.align),
|
6003
6003
|
href: t,
|
6004
6004
|
xlinkHref: t,
|
6005
6005
|
children: r.text
|
@@ -6008,7 +6008,7 @@ const ss = (r) => {
|
|
6008
6008
|
}, cs = (r) => {
|
6009
6009
|
if (r.cachedObjectURL && !r._renderingConfiguration?.omitCachedFields)
|
6010
6010
|
return /* @__PURE__ */ D(
|
6011
|
-
|
6011
|
+
Mn,
|
6012
6012
|
{
|
6013
6013
|
id: r.id,
|
6014
6014
|
src: r.cachedObjectURL,
|
@@ -6037,7 +6037,7 @@ const ss = (r) => {
|
|
6037
6037
|
{
|
6038
6038
|
transform: i,
|
6039
6039
|
dangerouslySetInnerHTML: {
|
6040
|
-
__html:
|
6040
|
+
__html: fa(
|
6041
6041
|
r.svg,
|
6042
6042
|
r.width,
|
6043
6043
|
r.height,
|
@@ -6113,7 +6113,7 @@ class ds {
|
|
6113
6113
|
layout: t,
|
6114
6114
|
elements: e
|
6115
6115
|
},
|
6116
|
-
getComponentWithProps: (a) =>
|
6116
|
+
getComponentWithProps: (a) => Sa(t, e, a)
|
6117
6117
|
};
|
6118
6118
|
}
|
6119
6119
|
initialize(t, e) {
|
@@ -6128,7 +6128,7 @@ class ds {
|
|
6128
6128
|
layouts: {}
|
6129
6129
|
};
|
6130
6130
|
t.forEach((n) => {
|
6131
|
-
a = new
|
6131
|
+
a = new zn(n).apply(a);
|
6132
6132
|
}), this.runStateCallbacks(), this.state = {
|
6133
6133
|
transaction: a
|
6134
6134
|
};
|
@@ -6138,7 +6138,7 @@ class ds {
|
|
6138
6138
|
return { ...t, transaction: e.apply(a) };
|
6139
6139
|
}
|
6140
6140
|
}
|
6141
|
-
const
|
6141
|
+
const $n = (r) => r.type === x.Image ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : r.type === x.Frame ? /* @__PURE__ */ D(Ki, { ...r }, r.id) : r.type === x.Illustration ? /* @__PURE__ */ D(cs, { ...r }, r.id) : r.type === x.Textbox ? /* @__PURE__ */ D(ss, { ...r }, r.id) : r.type === x.Group ? /* @__PURE__ */ D(Tn, { ...r }, r.id) : null, Sa = (r, t, e) => {
|
6142
6142
|
const a = e.renderingConfiguration, n = a?.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
|
6143
6143
|
return /* @__PURE__ */ D(
|
6144
6144
|
Ji,
|
@@ -6169,7 +6169,7 @@ const On = (r) => r.type === x.Image ? /* @__PURE__ */ D(kn, { ...r }, r.id) : r
|
|
6169
6169
|
}
|
6170
6170
|
);
|
6171
6171
|
};
|
6172
|
-
function
|
6172
|
+
function va(r) {
|
6173
6173
|
return r.sort((t, e) => {
|
6174
6174
|
const a = t.layer || 0, n = e.layer || 0;
|
6175
6175
|
if (a < n) return -1;
|
@@ -6186,13 +6186,13 @@ const ne = (r) => {
|
|
6186
6186
|
if (r.defaultVariant !== void 0)
|
6187
6187
|
return t.find((e) => e.id === r.defaultVariant);
|
6188
6188
|
}
|
6189
|
-
}, ut = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(),
|
6189
|
+
}, ut = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Map(), Un = async (r, t) => {
|
6190
6190
|
if (!t) {
|
6191
6191
|
if (!r) throw new Error("No region or src supplied. Cannot construct frame!");
|
6192
|
-
return
|
6192
|
+
return oa(r);
|
6193
6193
|
}
|
6194
6194
|
return nt(t);
|
6195
|
-
},
|
6195
|
+
}, oa = (r) => {
|
6196
6196
|
const t = r.width, e = r.height;
|
6197
6197
|
return `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${t} ${e}'>
|
6198
6198
|
<path id="target-path" d='M0 0 h ${t} v ${e} h ${-t} Z' />
|
@@ -6207,9 +6207,9 @@ const ne = (r) => {
|
|
6207
6207
|
if (!e.asset)
|
6208
6208
|
throw new Error(`No asset for variant with ID: ${r.frameVariantId}`);
|
6209
6209
|
return e;
|
6210
|
-
},
|
6211
|
-
if (
|
6212
|
-
return
|
6210
|
+
}, Oe = async (r) => {
|
6211
|
+
if (We.has(r))
|
6212
|
+
return We.get(r);
|
6213
6213
|
const e = (async () => {
|
6214
6214
|
if (Vt.has(r))
|
6215
6215
|
return Vt.get(r);
|
@@ -6245,8 +6245,8 @@ const ne = (r) => {
|
|
6245
6245
|
}
|
6246
6246
|
throw new Error("Malformed frame SVG");
|
6247
6247
|
})();
|
6248
|
-
return
|
6249
|
-
},
|
6248
|
+
return We.set(r, e), e;
|
6249
|
+
}, Ea = (r, t, e, a) => {
|
6250
6250
|
const n = t.width / t.height, i = r.width / r.height;
|
6251
6251
|
let s;
|
6252
6252
|
a ? i > n ? s = t.height / r.height : s = t.width / r.width : i > n ? s = t.width / r.width : s = t.height / r.height, e?.scale !== void 0 && (s *= e?.scale);
|
@@ -6256,11 +6256,11 @@ const ne = (r) => {
|
|
6256
6256
|
y: u,
|
6257
6257
|
zoom: s
|
6258
6258
|
};
|
6259
|
-
},
|
6259
|
+
}, la = async (r) => {
|
6260
6260
|
if (ut.has(r))
|
6261
6261
|
return ut.get(r);
|
6262
6262
|
if (r.startsWith("data:image/svg+xml")) {
|
6263
|
-
const e = wr(r), a = new TextDecoder().decode(e.buffer), n =
|
6263
|
+
const e = wr(r), a = new TextDecoder().decode(e.buffer), n = Ln(a), i = {
|
6264
6264
|
src: r,
|
6265
6265
|
width: n.width,
|
6266
6266
|
height: n.height,
|
@@ -6269,7 +6269,7 @@ const ne = (r) => {
|
|
6269
6269
|
return ut.set(r, i), i;
|
6270
6270
|
}
|
6271
6271
|
if ((r.split(".").pop()?.toLowerCase() ?? "") === "svg") {
|
6272
|
-
const e = await
|
6272
|
+
const e = await ba(r), a = e.width, n = e.height, i = {
|
6273
6273
|
src: r,
|
6274
6274
|
width: a,
|
6275
6275
|
height: n,
|
@@ -6277,7 +6277,7 @@ const ne = (r) => {
|
|
6277
6277
|
};
|
6278
6278
|
return ut.set(r, i), i;
|
6279
6279
|
} else {
|
6280
|
-
const e = await
|
6280
|
+
const e = await Me(r, !0), a = await Ne(e), n = {
|
6281
6281
|
src: r,
|
6282
6282
|
width: a.width,
|
6283
6283
|
height: a.height,
|
@@ -6285,14 +6285,14 @@ const ne = (r) => {
|
|
6285
6285
|
};
|
6286
6286
|
return ut.set(r, n), n;
|
6287
6287
|
}
|
6288
|
-
},
|
6288
|
+
}, ba = async (r) => {
|
6289
6289
|
const t = await nt(r);
|
6290
|
-
return
|
6291
|
-
},
|
6290
|
+
return Ln(t);
|
6291
|
+
}, za = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), Ln = (r) => {
|
6292
6292
|
const a = dt().parseFromString(r, "image/svg+xml").querySelector("svg");
|
6293
6293
|
if (!a)
|
6294
6294
|
throw new Error("No svg tag found, this svg must be malformed!");
|
6295
|
-
const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0,
|
6295
|
+
const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, za(i), za(s)] : n?.split(" ").map((l) => Number(l));
|
6296
6296
|
if (!o)
|
6297
6297
|
throw new Error("No viewbox or width/height values detected on SVG file!");
|
6298
6298
|
return {
|
@@ -6302,13 +6302,13 @@ const ne = (r) => {
|
|
6302
6302
|
}, $t = (r, t) => {
|
6303
6303
|
const e = r.layoutState.elements.filter((n) => n.layer === t), a = Math.max(...e.map((n) => n.layerIndex).filter((n) => n !== void 0));
|
6304
6304
|
return Math.max(a, 0) + 1;
|
6305
|
-
},
|
6305
|
+
}, Vn = async (r) => new Promise((t) => {
|
6306
6306
|
nt(r).then((e) => {
|
6307
6307
|
t(e);
|
6308
6308
|
}).catch((e) => console.error(e));
|
6309
|
-
}),
|
6310
|
-
if (
|
6311
|
-
return
|
6309
|
+
}), qe = /* @__PURE__ */ new Map(), _t = async (r) => {
|
6310
|
+
if (qe.has(r))
|
6311
|
+
return qe.get(r);
|
6312
6312
|
const t = async (n) => new Promise((i, s) => {
|
6313
6313
|
try {
|
6314
6314
|
if (!(!!URL && !!URL.createObjectURL)) throw new Error("Environment incapable of generating ObjectURL");
|
@@ -6324,12 +6324,12 @@ const ne = (r) => {
|
|
6324
6324
|
const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
|
6325
6325
|
if (!s)
|
6326
6326
|
throw new Error("Failed to read SVG");
|
6327
|
-
const l = Bt().serializeToString(s), c = pt(), d = c.getContext("2d"), A = await
|
6327
|
+
const l = Bt().serializeToString(s), c = pt(), d = c.getContext("2d"), A = await Aa.from(d, l, {
|
6328
6328
|
anonymousCrossOrigin: !0,
|
6329
6329
|
ignoreDimensions: !1,
|
6330
6330
|
createCanvas: pt,
|
6331
6331
|
createImage: te,
|
6332
|
-
DOMParser:
|
6332
|
+
DOMParser: ga(),
|
6333
6333
|
fetch: rt
|
6334
6334
|
}), u = s.getAttribute("width"), h = s.getAttribute("height"), m = 2048;
|
6335
6335
|
if (h && u) {
|
@@ -6339,7 +6339,7 @@ const ne = (r) => {
|
|
6339
6339
|
A.resize(m, m);
|
6340
6340
|
return await A.render(), await t(c);
|
6341
6341
|
})();
|
6342
|
-
return
|
6342
|
+
return qe.set(r, a), a;
|
6343
6343
|
}, Ut = async (r, t, e, a) => {
|
6344
6344
|
const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
|
6345
6345
|
width: r.layoutState.layout.width,
|
@@ -6355,13 +6355,13 @@ const ne = (r) => {
|
|
6355
6355
|
panelId: r.layoutState.layout.panelId
|
6356
6356
|
};
|
6357
6357
|
if (e && t === x.Illustration) {
|
6358
|
-
const l = await ot(await
|
6358
|
+
const l = await ot(await Vn(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
|
6359
6359
|
if (!u) throw new Error("SVG missing viewBox.");
|
6360
6360
|
const h = o.height, m = u.split(" "), p = parseFloat(m[2]) || 1, g = parseFloat(m[3]) || 1, C = p / g;
|
6361
6361
|
o.height = o.width / C, o.top += (h - o.height) / 2;
|
6362
6362
|
}
|
6363
6363
|
if (e && t === x.Image) {
|
6364
|
-
const l = o.height, c = await
|
6364
|
+
const l = o.height, c = await Me(e), d = await Ne(c), A = d.width / d.height;
|
6365
6365
|
o.height = o.width / A, o.top += (l - o.height) / 2;
|
6366
6366
|
}
|
6367
6367
|
if (e && t === x.Textbox && a?.text && a?.fontScale) {
|
@@ -6373,7 +6373,7 @@ const ne = (r) => {
|
|
6373
6373
|
};
|
6374
6374
|
class Xc {
|
6375
6375
|
static async getFrame(t, e) {
|
6376
|
-
const a = await
|
6376
|
+
const a = await Un(e.region, e.src), n = await Oe(a), i = e.region || await Ut(t, x.Frame);
|
6377
6377
|
return {
|
6378
6378
|
id: M(),
|
6379
6379
|
x: i.left,
|
@@ -6419,7 +6419,7 @@ class Xc {
|
|
6419
6419
|
const { configuration: a, fontSrc: n, designInputStep: i } = e, s = await Nt(n), o = {
|
6420
6420
|
assetUrl: n,
|
6421
6421
|
name: s.names.fullName.en
|
6422
|
-
}, l = i?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d =
|
6422
|
+
}, l = i?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Ie(c, {
|
6423
6423
|
vertical: a.vertical,
|
6424
6424
|
uppercase: a.uppercase
|
6425
6425
|
}), A = e.region || await Ut(t, x.Textbox, n, {
|
@@ -6506,7 +6506,7 @@ class Xc {
|
|
6506
6506
|
};
|
6507
6507
|
}
|
6508
6508
|
static async getIllustration(t, e) {
|
6509
|
-
const a = e.region || await Ut(t, x.Illustration, e.src), n = await ot(await
|
6509
|
+
const a = e.region || await Ut(t, x.Illustration, e.src), n = await ot(await Vn(e.src)), i = await _t(n.svg), s = M();
|
6510
6510
|
return {
|
6511
6511
|
cachedObjectURL: i,
|
6512
6512
|
stepRegion: e.region,
|
@@ -6537,13 +6537,13 @@ const $ = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
|
6537
6537
|
throw new U();
|
6538
6538
|
return e;
|
6539
6539
|
}, X = (r, t) => {
|
6540
|
-
const e = [...t.elements.filter((n) => n.id !== r.id), r], a =
|
6540
|
+
const e = [...t.elements.filter((n) => n.id !== r.id), r], a = va(e);
|
6541
6541
|
return {
|
6542
6542
|
layout: t.layout,
|
6543
6543
|
elements: a,
|
6544
6544
|
modificationID: M()
|
6545
6545
|
};
|
6546
|
-
},
|
6546
|
+
}, Ga = async (r) => {
|
6547
6547
|
const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
|
6548
6548
|
for (let a = 0; a < e.length; a++) {
|
6549
6549
|
const n = e[a], i = r.layouts[n];
|
@@ -6553,7 +6553,7 @@ const $ = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
|
6553
6553
|
const o = s;
|
6554
6554
|
if (o.src && !o.svg) {
|
6555
6555
|
const l = await nt(o.src), c = await ot(l);
|
6556
|
-
o.svg =
|
6556
|
+
o.svg = fa(
|
6557
6557
|
c.svg,
|
6558
6558
|
o.width,
|
6559
6559
|
o.height,
|
@@ -6603,7 +6603,7 @@ class N {
|
|
6603
6603
|
this.oldState = t;
|
6604
6604
|
}
|
6605
6605
|
}
|
6606
|
-
class
|
6606
|
+
class Wa extends N {
|
6607
6607
|
constructor(t) {
|
6608
6608
|
super(), this.serializableWorkflow = t;
|
6609
6609
|
}
|
@@ -6698,7 +6698,7 @@ class R extends N {
|
|
6698
6698
|
return this.oldState = t, this.commands.reduce((e, a) => a.apply(e), t);
|
6699
6699
|
}
|
6700
6700
|
}
|
6701
|
-
class
|
6701
|
+
class zn extends N {
|
6702
6702
|
constructor(t) {
|
6703
6703
|
super(), this.layout = t;
|
6704
6704
|
}
|
@@ -6821,7 +6821,7 @@ class us extends N {
|
|
6821
6821
|
};
|
6822
6822
|
}
|
6823
6823
|
}
|
6824
|
-
class
|
6824
|
+
class je extends N {
|
6825
6825
|
constructor(t, e) {
|
6826
6826
|
super(), this.id = t, this.imageFill = e;
|
6827
6827
|
}
|
@@ -6865,7 +6865,7 @@ class hs extends N {
|
|
6865
6865
|
};
|
6866
6866
|
}
|
6867
6867
|
}
|
6868
|
-
class
|
6868
|
+
class qa extends N {
|
6869
6869
|
constructor(t, e) {
|
6870
6870
|
super(), this.id = t, this.fontData = e;
|
6871
6871
|
}
|
@@ -7011,7 +7011,7 @@ class fs extends N {
|
|
7011
7011
|
};
|
7012
7012
|
}
|
7013
7013
|
}
|
7014
|
-
class
|
7014
|
+
class He extends N {
|
7015
7015
|
constructor(t, e, a) {
|
7016
7016
|
super(), this.id = t, this.strokeColor = e, this.strokeThickness = a;
|
7017
7017
|
}
|
@@ -7034,7 +7034,7 @@ class je extends N {
|
|
7034
7034
|
};
|
7035
7035
|
}
|
7036
7036
|
}
|
7037
|
-
class
|
7037
|
+
class ca extends N {
|
7038
7038
|
constructor(t, e, a) {
|
7039
7039
|
super(), this.id = t, this.className = e, this.fill = a;
|
7040
7040
|
}
|
@@ -7203,7 +7203,7 @@ class sd extends N {
|
|
7203
7203
|
};
|
7204
7204
|
}
|
7205
7205
|
}
|
7206
|
-
class
|
7206
|
+
class ja {
|
7207
7207
|
constructor(t, e, a) {
|
7208
7208
|
this.processRegion = async (n) => {
|
7209
7209
|
const i = this.layouts.find((l) => l.panelId === n.panelId);
|
@@ -7213,7 +7213,7 @@ class qa {
|
|
7213
7213
|
if (this.configuration.type === v.ProductOverlay) {
|
7214
7214
|
let l = "";
|
7215
7215
|
if (this.product?.overlayImageUrl && (l = this.product.overlayImageUrl), s = l, !l)
|
7216
|
-
throw new
|
7216
|
+
throw new Ee(this.configuration, "Couldn't find an asset for product overlay step");
|
7217
7217
|
}
|
7218
7218
|
const o = this.evaluateAssetType();
|
7219
7219
|
if (o === x.Image) {
|
@@ -7284,7 +7284,7 @@ class qa {
|
|
7284
7284
|
}
|
7285
7285
|
async trigger() {
|
7286
7286
|
if (!this.configuration.data.regions)
|
7287
|
-
throw new
|
7287
|
+
throw new Ee(this.configuration, "Missing regions.");
|
7288
7288
|
if (this.configuration.type === v.SilentIllustration) {
|
7289
7289
|
const t = this.configuration.data.regions.map(this.processRegion);
|
7290
7290
|
return Promise.all(t);
|
@@ -7312,10 +7312,10 @@ const ws = async (r) => {
|
|
7312
7312
|
}
|
7313
7313
|
})).json()).shortUrl;
|
7314
7314
|
} catch (e) {
|
7315
|
-
throw console.error(e), new
|
7315
|
+
throw console.error(e), new ke("Failed to shorten URL, see console.");
|
7316
7316
|
}
|
7317
7317
|
};
|
7318
|
-
class
|
7318
|
+
class Gn {
|
7319
7319
|
async poll() {
|
7320
7320
|
try {
|
7321
7321
|
if (await this.predicate()) {
|
@@ -7357,10 +7357,10 @@ class ys {
|
|
7357
7357
|
}
|
7358
7358
|
async regenerateQRCode(t, e, a, n) {
|
7359
7359
|
const i = async () => {
|
7360
|
-
const h = (await
|
7360
|
+
const h = (await be([e]))[0], m = h?.versions?.find((p) => p.name === "mpeg4")?.link;
|
7361
7361
|
return { asset: h, link: m };
|
7362
7362
|
}, s = await new Promise((h, m) => {
|
7363
|
-
new
|
7363
|
+
new Gn(
|
7364
7364
|
async () => !!(await i()).link,
|
7365
7365
|
async () => {
|
7366
7366
|
const p = await i();
|
@@ -7383,10 +7383,10 @@ class ys {
|
|
7383
7383
|
l.searchParams.append("video", btoa(JSON.stringify([s]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
|
7384
7384
|
const c = l.toString();
|
7385
7385
|
if (c.length >= 2e3)
|
7386
|
-
throw new
|
7386
|
+
throw new ke("Cannot create QR code, URL too long.");
|
7387
7387
|
const d = await ws(c);
|
7388
7388
|
if (!n.data || !n.data.regions)
|
7389
|
-
throw new
|
7389
|
+
throw new Ee(n, "Missing regions.");
|
7390
7390
|
const A = await this.regionElements(n), u = await this.command(d, A, a, n.stepName);
|
7391
7391
|
return u && (u.command && a.getCommandDispatcher()(u.command), u.followup && await u.followup()), await a.setSelectionsAndElements(n.stepName, [], A, async () => {
|
7392
7392
|
a.updateStorage(n.stepName, {
|
@@ -7400,7 +7400,7 @@ class ys {
|
|
7400
7400
|
return t.data.regions.map(e);
|
7401
7401
|
}
|
7402
7402
|
async command(t, e, a, n) {
|
7403
|
-
const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await
|
7403
|
+
const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await cn(t, { type: "svg" }))}`, l = e.map((c) => {
|
7404
7404
|
const d = c.region, A = i.find((u) => u.panelId === d?.panelId);
|
7405
7405
|
if (!A && d)
|
7406
7406
|
throw new Y(d);
|
@@ -7428,12 +7428,12 @@ class ys {
|
|
7428
7428
|
} };
|
7429
7429
|
}
|
7430
7430
|
}
|
7431
|
-
const
|
7432
|
-
class
|
7431
|
+
const Wn = new ys();
|
7432
|
+
class Pe {
|
7433
7433
|
constructor() {
|
7434
7434
|
this.frameSourceSvg = async (t, e) => {
|
7435
7435
|
if (!t)
|
7436
|
-
return
|
7436
|
+
return oa(e);
|
7437
7437
|
const a = t.asset;
|
7438
7438
|
if (!a)
|
7439
7439
|
throw new vt(t);
|
@@ -7482,7 +7482,7 @@ class Ie {
|
|
7482
7482
|
a.serializableWorkflow.steps
|
7483
7483
|
), 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
7484
|
if (!t.option || (t.option.variants || []).length === 0) {
|
7485
|
-
const c = t.data.regions.map((d) =>
|
7485
|
+
const c = t.data.regions.map((d) => oa(d));
|
7486
7486
|
e.updateStorage(t.stepName, {
|
7487
7487
|
currentFrameSources: c
|
7488
7488
|
});
|
@@ -7536,14 +7536,14 @@ class Ie {
|
|
7536
7536
|
})) ?? [];
|
7537
7537
|
}
|
7538
7538
|
selectImage(t, e, a, n = !0) {
|
7539
|
-
const i =
|
7539
|
+
const i = Pe.patternSource(e), s = a.getStepStorage(t.stepName)?.framePatternSrc;
|
7540
7540
|
if (s && s === i)
|
7541
7541
|
return Promise.resolve();
|
7542
7542
|
a.setEditedStatus(t.stepName, !0);
|
7543
7543
|
const o = e.fileLink || "";
|
7544
7544
|
return o.endsWith(".pdf") || o.endsWith(".eps") || o.endsWith(".ai") ? new Promise((l) => {
|
7545
7545
|
a.addPoller(
|
7546
|
-
new
|
7546
|
+
new Gn(
|
7547
7547
|
async () => {
|
7548
7548
|
const d = (await O.getFromServer(e.key || "")).versions?.find((u) => u.name === "svg");
|
7549
7549
|
return d ? (await rt(d.link)).status === 200 : !1;
|
@@ -7556,7 +7556,7 @@ class Ie {
|
|
7556
7556
|
});
|
7557
7557
|
},
|
7558
7558
|
() => {
|
7559
|
-
throw new
|
7559
|
+
throw new ke("Failed to resolve transcoded PDF");
|
7560
7560
|
}
|
7561
7561
|
)
|
7562
7562
|
);
|
@@ -7600,7 +7600,7 @@ class Ie {
|
|
7600
7600
|
}
|
7601
7601
|
async loadPatternFromString(t, e, a = !0, n = void 0, i) {
|
7602
7602
|
if (t.endsWith("svg")) {
|
7603
|
-
const s = await
|
7603
|
+
const s = await ba(t), o = s.width, l = s.height, c = await nt(t);
|
7604
7604
|
if (i) {
|
7605
7605
|
const u = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
|
7606
7606
|
if (u && u.length > 0)
|
@@ -7618,7 +7618,7 @@ class Ie {
|
|
7618
7618
|
};
|
7619
7619
|
ut.set(t, A), e.setPatternData(A, a);
|
7620
7620
|
} else {
|
7621
|
-
const s = await
|
7621
|
+
const s = await Me(t, !0), o = await Ne(s), l = {
|
7622
7622
|
src: t,
|
7623
7623
|
width: o.width,
|
7624
7624
|
height: o.height,
|
@@ -7703,7 +7703,7 @@ class Ie {
|
|
7703
7703
|
i && i(!0);
|
7704
7704
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
7705
7705
|
t.data.regions.map(async (h, m) => {
|
7706
|
-
const p = await
|
7706
|
+
const p = await Oe(l[m]), g = o.getImageData(), C = a.map((P) => new bt(P.id)), S = g ? Ea(
|
7707
7707
|
g,
|
7708
7708
|
p,
|
7709
7709
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
@@ -7767,7 +7767,7 @@ class Ie {
|
|
7767
7767
|
throw new Yt(t);
|
7768
7768
|
}
|
7769
7769
|
async loadPatternFromAsset(t, e, a, n) {
|
7770
|
-
const i =
|
7770
|
+
const i = Pe.patternSource(t), s = a.markUpdatePending(), o = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
7771
7771
|
if (!o)
|
7772
7772
|
throw a.markUpdateCompleted(s), new Error("Frame service unavailable, cannot load pattern!");
|
7773
7773
|
try {
|
@@ -7794,7 +7794,7 @@ class Ie {
|
|
7794
7794
|
), this.validateColorCount(e, a);
|
7795
7795
|
}
|
7796
7796
|
}
|
7797
|
-
const wt = new
|
7797
|
+
const wt = new Pe();
|
7798
7798
|
class Ss {
|
7799
7799
|
async getIllustrationBody(t) {
|
7800
7800
|
return new Promise((e) => {
|
@@ -7899,10 +7899,10 @@ class Ss {
|
|
7899
7899
|
spotColor: A.spotColor,
|
7900
7900
|
pmsValue: A.pmsValue
|
7901
7901
|
};
|
7902
|
-
const o =
|
7902
|
+
const o = fa(t, e, a, s), l = await _t(o), c = [];
|
7903
7903
|
for (const d of n) {
|
7904
7904
|
for (const [A, u] of i.entries())
|
7905
|
-
c.push(new
|
7905
|
+
c.push(new ca(d, A, u));
|
7906
7906
|
c.push(new Cs(d, o, l));
|
7907
7907
|
}
|
7908
7908
|
return new R(c);
|
@@ -7949,7 +7949,7 @@ class Ss {
|
|
7949
7949
|
}
|
7950
7950
|
async selectVariantCommand(t, e, a, n, i) {
|
7951
7951
|
if (!t.data || !t.data.regions)
|
7952
|
-
throw new
|
7952
|
+
throw new Ee(t, "Missing regions.");
|
7953
7953
|
n(!0);
|
7954
7954
|
const s = a.map((C) => new bt(C.id));
|
7955
7955
|
t.mandatory && i.setMandatoryFulfilled(t.stepName, !1);
|
@@ -8032,7 +8032,7 @@ class vs {
|
|
8032
8032
|
async init(t, e, a) {
|
8033
8033
|
const n = t.option;
|
8034
8034
|
if (!n)
|
8035
|
-
throw new
|
8035
|
+
throw new ve(t);
|
8036
8036
|
if (a)
|
8037
8037
|
await this.reload(t, e, a);
|
8038
8038
|
else {
|
@@ -8048,7 +8048,7 @@ class vs {
|
|
8048
8048
|
t.stepName,
|
8049
8049
|
a.serializableWorkflow.steps
|
8050
8050
|
), o = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName), l = t.option;
|
8051
|
-
if (!l) throw new
|
8051
|
+
if (!l) throw new ve(t);
|
8052
8052
|
if (n?.selectedVariants) {
|
8053
8053
|
const c = n.selectedVariants[0].id;
|
8054
8054
|
if (c) {
|
@@ -8103,11 +8103,11 @@ class vs {
|
|
8103
8103
|
};
|
8104
8104
|
}
|
8105
8105
|
}
|
8106
|
-
const
|
8106
|
+
const qn = new vs();
|
8107
8107
|
class Es {
|
8108
8108
|
async init(t, e, a) {
|
8109
8109
|
const n = t.option;
|
8110
|
-
if (!n) throw new
|
8110
|
+
if (!n) throw new ve(t);
|
8111
8111
|
if (a)
|
8112
8112
|
await this.reload(t, e, a);
|
8113
8113
|
else {
|
@@ -8184,7 +8184,7 @@ class Es {
|
|
8184
8184
|
};
|
8185
8185
|
}
|
8186
8186
|
}
|
8187
|
-
const
|
8187
|
+
const jn = new Es();
|
8188
8188
|
class bs {
|
8189
8189
|
async init(t, e, a) {
|
8190
8190
|
if (a)
|
@@ -8285,7 +8285,7 @@ class bs {
|
|
8285
8285
|
}
|
8286
8286
|
if (!/^$|^[a-zA-Z0-9 ]+$/.test(e))
|
8287
8287
|
return n("Unsupported characters."), { input: e, helperData: {}, errorData: { unsupportedCharacters: !0 } };
|
8288
|
-
const i =
|
8288
|
+
const i = ea(e.toLowerCase());
|
8289
8289
|
for (const s of i)
|
8290
8290
|
for (const o in a) {
|
8291
8291
|
const l = a[o].toLowerCase().replace(/\s/g, "");
|
@@ -8295,7 +8295,7 @@ class bs {
|
|
8295
8295
|
return n(""), { input: e, helperData: {} };
|
8296
8296
|
}
|
8297
8297
|
}
|
8298
|
-
const
|
8298
|
+
const Hn = new bs();
|
8299
8299
|
class Bs {
|
8300
8300
|
async init(t, e, a) {
|
8301
8301
|
const n = t.option;
|
@@ -8386,7 +8386,7 @@ class Bs {
|
|
8386
8386
|
};
|
8387
8387
|
}
|
8388
8388
|
}
|
8389
|
-
const
|
8389
|
+
const Yn = new Bs();
|
8390
8390
|
class Is {
|
8391
8391
|
async init(t, e, a) {
|
8392
8392
|
const n = t.option;
|
@@ -8441,7 +8441,7 @@ class Is {
|
|
8441
8441
|
};
|
8442
8442
|
}
|
8443
8443
|
}
|
8444
|
-
const
|
8444
|
+
const Jn = new Is();
|
8445
8445
|
class Ps {
|
8446
8446
|
constructor() {
|
8447
8447
|
this.shapeFillId = "spiff-fill-shape";
|
@@ -8459,14 +8459,14 @@ class Ps {
|
|
8459
8459
|
const n = a.getLayouts(), s = (a.getRegionElements(e.stepName) || []).map((o) => {
|
8460
8460
|
const l = o.region;
|
8461
8461
|
if (!n.find((d) => d.panelId === l?.panelId)) throw new Y(l);
|
8462
|
-
return new
|
8462
|
+
return new ca(o.id, this.shapeFillId, t);
|
8463
8463
|
}).filter((o) => !!o);
|
8464
8464
|
a.getCommandDispatcher()(new R(s)), a.updateStorage(e.stepName, { colour: t });
|
8465
8465
|
}
|
8466
8466
|
async init(t, e, a) {
|
8467
8467
|
const n = t.option;
|
8468
8468
|
if (!n)
|
8469
|
-
throw new
|
8469
|
+
throw new ve(t);
|
8470
8470
|
if (a)
|
8471
8471
|
await this.reload(t, e, a);
|
8472
8472
|
else {
|
@@ -8525,7 +8525,7 @@ class Ps {
|
|
8525
8525
|
if (!i.find((m) => m.panelId === A?.panelId))
|
8526
8526
|
throw new Y(A);
|
8527
8527
|
const h = o();
|
8528
|
-
return new
|
8528
|
+
return new ca(d.id, this.shapeFillId, h);
|
8529
8529
|
}, c = a.map(l).filter((d) => !!d);
|
8530
8530
|
return {
|
8531
8531
|
command: new R(c),
|
@@ -8632,7 +8632,7 @@ class Ds {
|
|
8632
8632
|
);
|
8633
8633
|
}
|
8634
8634
|
}
|
8635
|
-
const Fs = new Ds(),
|
8635
|
+
const Fs = new Ds(), Ye = (r, t, e, a, n) => {
|
8636
8636
|
if (t.some((d) => d == null))
|
8637
8637
|
throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
|
8638
8638
|
let i = t.map((d) => d.split(`
|
@@ -8664,29 +8664,29 @@ const Fs = new Ds(), He = (r, t, e, a, n) => {
|
|
8664
8664
|
const o = Et(t.assetUrl), l = o.getFont();
|
8665
8665
|
if (n.size) {
|
8666
8666
|
const u = r / l.unitsPerEm;
|
8667
|
-
return [i, s] =
|
8667
|
+
return [i, s] = Ye(e, a, r, u, o), [n.size, i, s];
|
8668
8668
|
}
|
8669
8669
|
const c = 6;
|
8670
|
-
let d = c -
|
8670
|
+
let d = c - Ge;
|
8671
8671
|
if (a.length > 0) {
|
8672
8672
|
let u = a, h = 0;
|
8673
8673
|
for (; (!n.maxSize || d <= n.maxSize) && u; )
|
8674
|
-
d +=
|
8674
|
+
d += Ge, h = d / l.unitsPerEm, [u, s] = Ye(e, a, d, h, o);
|
8675
8675
|
}
|
8676
|
-
d > c && (d -=
|
8676
|
+
d > c && (d -= Ge), n.minSize && d < n.minSize && (d = n.minSize);
|
8677
8677
|
const A = d / l.unitsPerEm;
|
8678
|
-
return [i, s] =
|
8679
|
-
},
|
8680
|
-
class
|
8678
|
+
return [i, s] = Ye(e, a, d, A, o), [d, i, s];
|
8679
|
+
}, Je = 30;
|
8680
|
+
class De extends Error {
|
8681
8681
|
constructor(t) {
|
8682
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
8682
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = De.name;
|
8683
8683
|
}
|
8684
8684
|
}
|
8685
8685
|
const xs = ["‘", "’", "“", "”", `
|
8686
8686
|
`];
|
8687
|
-
class
|
8687
|
+
class Fe extends Error {
|
8688
8688
|
constructor(t) {
|
8689
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
8689
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Fe.name;
|
8690
8690
|
}
|
8691
8691
|
}
|
8692
8692
|
class ks {
|
@@ -8708,7 +8708,7 @@ class ks {
|
|
8708
8708
|
}, this.textAlign = (t) => t.vertical ? "center" : t.textAlign || "center", this.getErrorsForText = (t, e, a, n) => {
|
8709
8709
|
let i;
|
8710
8710
|
a.data && a.data.maxLength && e.length > a.data.maxLength && (i || (i = {}), i.hitCharacterLimit = !0);
|
8711
|
-
const s = n.getProfanities(), o =
|
8711
|
+
const s = n.getProfanities(), o = ea(t.toLowerCase());
|
8712
8712
|
for (const c of o)
|
8713
8713
|
for (const d in s) {
|
8714
8714
|
const A = s[d].toLowerCase().replace(/\s/g, "");
|
@@ -8728,7 +8728,7 @@ class ks {
|
|
8728
8728
|
if (a)
|
8729
8729
|
await this.reload(t, e, a);
|
8730
8730
|
else {
|
8731
|
-
const i = this.getDefaultImageFillVariant(t.data), s = i?.asset?.fileLink, o = s ? await
|
8731
|
+
const i = this.getDefaultImageFillVariant(t.data), s = i?.asset?.fileLink, o = s ? await la(s) : void 0, l = o ? {
|
8732
8732
|
src: o.src,
|
8733
8733
|
height: o.height,
|
8734
8734
|
width: o.width,
|
@@ -8835,7 +8835,7 @@ class ks {
|
|
8835
8835
|
const a = e.variants?.map((n) => n.asset?.fileLink)?.filter((n) => !!n) || [];
|
8836
8836
|
return Promise.all(
|
8837
8837
|
a.map(async (n) => {
|
8838
|
-
const i = await
|
8838
|
+
const i = await la(n);
|
8839
8839
|
return {
|
8840
8840
|
src: n,
|
8841
8841
|
width: i.width,
|
@@ -8855,7 +8855,7 @@ class ks {
|
|
8855
8855
|
fillImage: e
|
8856
8856
|
});
|
8857
8857
|
for (const o of a) {
|
8858
|
-
const l = new
|
8858
|
+
const l = new je(o.id, e);
|
8859
8859
|
i(l);
|
8860
8860
|
}
|
8861
8861
|
}
|
@@ -8892,13 +8892,13 @@ class ks {
|
|
8892
8892
|
strokeColor: s
|
8893
8893
|
});
|
8894
8894
|
for (const o of a) {
|
8895
|
-
const l = new
|
8895
|
+
const l = new He(o.id, s, t.data?.strokeThickness);
|
8896
8896
|
i(l);
|
8897
8897
|
}
|
8898
8898
|
}
|
8899
8899
|
getProcessedInput(t, e, a) {
|
8900
8900
|
const n = a ? t : this.injectReplaceableText(t, e);
|
8901
|
-
return
|
8901
|
+
return Ie(n, {
|
8902
8902
|
vertical: e.vertical,
|
8903
8903
|
uppercase: e.uppercase
|
8904
8904
|
});
|
@@ -8982,7 +8982,7 @@ class ks {
|
|
8982
8982
|
u,
|
8983
8983
|
async () => {
|
8984
8984
|
e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
|
8985
|
-
const g = o.map((S) => new
|
8985
|
+
const g = o.map((S) => new qa(S.id, A)), C = new R(g);
|
8986
8986
|
e.getCommandDispatcher()(C);
|
8987
8987
|
}
|
8988
8988
|
), o.length === 0 && l) {
|
@@ -9085,20 +9085,20 @@ class ks {
|
|
9085
9085
|
async selectVariantCommand(t, e, a, n, i, s, o, l, c) {
|
9086
9086
|
const d = i.markUpdatePending(), A = await this.fontDataFromVariant(e);
|
9087
9087
|
if (n.length > 0) {
|
9088
|
-
const u = n.map((p) => new
|
9088
|
+
const u = n.map((p) => new qa(p.id, A));
|
9089
9089
|
if (l) {
|
9090
|
-
const p = n.map((g) => new
|
9090
|
+
const p = n.map((g) => new je(g.id, l));
|
9091
9091
|
u.push(...p);
|
9092
9092
|
}
|
9093
9093
|
if (c) {
|
9094
9094
|
const p = n.map(
|
9095
|
-
(g) => new
|
9095
|
+
(g) => new He(g.id, c, t.data.strokeThickness)
|
9096
9096
|
);
|
9097
9097
|
u.push(...p);
|
9098
9098
|
}
|
9099
9099
|
const h = await this.changeInputTextWithRegion(
|
9100
9100
|
t,
|
9101
|
-
t.data.size ||
|
9101
|
+
t.data.size || Je,
|
9102
9102
|
A,
|
9103
9103
|
a.text || "",
|
9104
9104
|
a,
|
@@ -9123,7 +9123,7 @@ class ks {
|
|
9123
9123
|
i
|
9124
9124
|
), h = await this.changeInputTextWithRegion(
|
9125
9125
|
t,
|
9126
|
-
t.data.size ||
|
9126
|
+
t.data.size || Je,
|
9127
9127
|
A,
|
9128
9128
|
u[0]?.newElement.input || a.text || t.data.defaultText || "",
|
9129
9129
|
a,
|
@@ -9134,13 +9134,13 @@ class ks {
|
|
9134
9134
|
), m = u.flatMap((g) => g.commands);
|
9135
9135
|
if (l) {
|
9136
9136
|
const g = u.map(
|
9137
|
-
(C) => new
|
9137
|
+
(C) => new je(C.regionElement.id, l)
|
9138
9138
|
);
|
9139
9139
|
m.push(...g);
|
9140
9140
|
}
|
9141
9141
|
if (c) {
|
9142
9142
|
const g = n.map(
|
9143
|
-
(C) => new
|
9143
|
+
(C) => new He(C.id, c, t.data.strokeThickness)
|
9144
9144
|
);
|
9145
9145
|
m.push(...g);
|
9146
9146
|
}
|
@@ -9167,7 +9167,7 @@ class ks {
|
|
9167
9167
|
const m = s.getLayouts().find((g) => g.panelId === u.panelId), p = M();
|
9168
9168
|
try {
|
9169
9169
|
if (!m)
|
9170
|
-
throw new
|
9170
|
+
throw new Fe("Failed to find layout for region: " + u.panelId);
|
9171
9171
|
const g = a.colorOption;
|
9172
9172
|
let C;
|
9173
9173
|
if (g && g.variants) {
|
@@ -9181,7 +9181,7 @@ class ks {
|
|
9181
9181
|
stepName: t,
|
9182
9182
|
align: this.textAlign(a),
|
9183
9183
|
fill: i.color ? i.color : b,
|
9184
|
-
fontSize: a.size ||
|
9184
|
+
fontSize: a.size || Je,
|
9185
9185
|
fontData: n,
|
9186
9186
|
id: p,
|
9187
9187
|
layer: u.layer,
|
@@ -9230,10 +9230,10 @@ class ks {
|
|
9230
9230
|
fontData: n
|
9231
9231
|
};
|
9232
9232
|
} catch (g) {
|
9233
|
-
throw console.log(g), new
|
9233
|
+
throw console.log(g), new De("Error adding font to region");
|
9234
9234
|
}
|
9235
9235
|
}, A = await Promise.all(a.regions.map(d)).catch((u) => {
|
9236
|
-
throw u instanceof
|
9236
|
+
throw u instanceof De ? (Fs.setLatestToast("Failed to load font.", $e.Error), u) : u instanceof Fe ? u : new Error(u);
|
9237
9237
|
});
|
9238
9238
|
return await s.setSelectionsAndElements(
|
9239
9239
|
t,
|
@@ -9275,7 +9275,7 @@ class ks {
|
|
9275
9275
|
const S = (() => {
|
9276
9276
|
if (t.data && t.data.maxLength && h.length > t.data.maxLength)
|
9277
9277
|
return d && d(!0), { info: "0" };
|
9278
|
-
const f = s.getProfanities(), E =
|
9278
|
+
const f = s.getProfanities(), E = ea(u.toLowerCase());
|
9279
9279
|
for (const P of E)
|
9280
9280
|
for (const B in f) {
|
9281
9281
|
const F = f[B].toLowerCase().replace(/\s/g, "");
|
@@ -9345,7 +9345,7 @@ function $s(r, t, e, a) {
|
|
9345
9345
|
const n = e / r, i = a / t;
|
9346
9346
|
return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
|
9347
9347
|
}
|
9348
|
-
const
|
9348
|
+
const Ha = {
|
9349
9349
|
m: ["x", "y"],
|
9350
9350
|
z: [],
|
9351
9351
|
l: ["x", "y"],
|
@@ -9375,7 +9375,7 @@ class Us {
|
|
9375
9375
|
const n = (i) => {
|
9376
9376
|
const s = [], o = i.relative ? i.type : i.type.toUpperCase();
|
9377
9377
|
let l = e !== o;
|
9378
|
-
const c =
|
9378
|
+
const c = Ha[i.type];
|
9379
9379
|
l && (s.push(o), e = o);
|
9380
9380
|
for (const d of c) {
|
9381
9381
|
const A = i[d];
|
@@ -9400,7 +9400,7 @@ class Us {
|
|
9400
9400
|
const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
|
9401
9401
|
let i;
|
9402
9402
|
for (e.lastIndex = 0; i = e.exec(t); ) {
|
9403
|
-
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c =
|
9403
|
+
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = Ha[s];
|
9404
9404
|
if (o.length < c.length)
|
9405
9405
|
throw new Dt(
|
9406
9406
|
`Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
|
@@ -9497,7 +9497,7 @@ class Ls extends Ms {
|
|
9497
9497
|
return Os(g, S, e.height, e.width, 0.35, 0.65), Rs(u.outerHTML);
|
9498
9498
|
}
|
9499
9499
|
}
|
9500
|
-
async function
|
9500
|
+
async function Kn(r) {
|
9501
9501
|
if (r === "Vegemite")
|
9502
9502
|
return new Ls();
|
9503
9503
|
throw new V(`Failed to resolve Module, Module ${r} not found`);
|
@@ -9562,7 +9562,7 @@ const re = w`
|
|
9562
9562
|
bundleId: r
|
9563
9563
|
}
|
9564
9564
|
})).data.globalPropertyState, Ws = w`
|
9565
|
-
${
|
9565
|
+
${Qe}
|
9566
9566
|
fragment ProductFields on Product {
|
9567
9567
|
id
|
9568
9568
|
basePrice
|
@@ -9606,7 +9606,7 @@ const re = w`
|
|
9606
9606
|
name
|
9607
9607
|
}
|
9608
9608
|
}
|
9609
|
-
`,
|
9609
|
+
`, Ba = w`
|
9610
9610
|
${Ws}
|
9611
9611
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
9612
9612
|
id
|
@@ -9617,7 +9617,7 @@ const re = w`
|
|
9617
9617
|
}
|
9618
9618
|
}
|
9619
9619
|
`, ie = (r) => w`
|
9620
|
-
${r ?
|
9620
|
+
${r ? Ba : ""}
|
9621
9621
|
fragment ProductCollectionFields on ProductCollection {
|
9622
9622
|
id
|
9623
9623
|
name
|
@@ -9730,7 +9730,7 @@ const re = w`
|
|
9730
9730
|
quoteId
|
9731
9731
|
}
|
9732
9732
|
}
|
9733
|
-
`,
|
9733
|
+
`, Ya = w`
|
9734
9734
|
query GetBundleStakeholders($id: String!) {
|
9735
9735
|
bundles(ids: [$id]) {
|
9736
9736
|
id
|
@@ -9805,7 +9805,7 @@ const re = w`
|
|
9805
9805
|
}
|
9806
9806
|
}
|
9807
9807
|
`, Hs = w`
|
9808
|
-
${
|
9808
|
+
${Ba}
|
9809
9809
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
9810
9810
|
productCollections(ids: [$id], productIds: $productIds) {
|
9811
9811
|
id
|
@@ -9838,7 +9838,7 @@ const re = w`
|
|
9838
9838
|
}
|
9839
9839
|
}
|
9840
9840
|
`, Js = w`
|
9841
|
-
${
|
9841
|
+
${Ba}
|
9842
9842
|
query GetProductCollectionForProductsFeed(
|
9843
9843
|
$id: String!
|
9844
9844
|
$limit: Int
|
@@ -10217,9 +10217,9 @@ const re = w`
|
|
10217
10217
|
}
|
10218
10218
|
}
|
10219
10219
|
`;
|
10220
|
-
var
|
10220
|
+
var $e = /* @__PURE__ */ ((r) => (r.Error = "Error", r.Warning = "Warning", r.Info = "Info", r))($e || {});
|
10221
10221
|
const wo = 1e3;
|
10222
|
-
class
|
10222
|
+
class Ja extends xn {
|
10223
10223
|
constructor(t) {
|
10224
10224
|
super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
|
10225
10225
|
}
|
@@ -10233,7 +10233,7 @@ class Ya extends Fn {
|
|
10233
10233
|
}
|
10234
10234
|
class yo {
|
10235
10235
|
constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, p, g = !1, C = !1, S = !1) {
|
10236
|
-
this.workflowStatePromiseQueue = new
|
10236
|
+
this.workflowStatePromiseQueue = new kn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
|
10237
10237
|
if (!this.previewService) return;
|
10238
10238
|
const b = this.getCommandContext().getAllLayouts(), I = this.getLayoutPreviewService()?.getAll();
|
10239
10239
|
if (I)
|
@@ -10251,25 +10251,11 @@ class yo {
|
|
10251
10251
|
})
|
10252
10252
|
);
|
10253
10253
|
}
|
10254
|
-
|
10255
|
-
const t = this.transaction.recipient;
|
10256
|
-
if (t?.conversionConfigurationId && !this.recipientConversionConfiguration) {
|
10257
|
-
const a = await this.graphQlClient().query({
|
10258
|
-
query: Bi,
|
10259
|
-
errorPolicy: "all",
|
10260
|
-
fetchPolicy: "no-cache",
|
10261
|
-
variables: {
|
10262
|
-
id: t.conversionConfigurationId
|
10263
|
-
}
|
10264
|
-
});
|
10265
|
-
a.data.conversionConfiguration && (this.recipientConversionConfiguration = a.data.conversionConfiguration);
|
10266
|
-
}
|
10267
|
-
const e = { recipient: t };
|
10254
|
+
getTemplatingContext() {
|
10255
|
+
const t = this.transaction.recipient, e = { recipient: t };
|
10268
10256
|
return this.recipientConversionConfiguration?.requestedDataItems?.forEach((a) => {
|
10269
|
-
|
10270
|
-
|
10271
|
-
a.customFieldIndex === 1 ? e[n] = t?.customField1 : a.customFieldIndex === 2 ? e[n] = t?.customField2 : a.customFieldIndex === 3 ? e[n] = t?.customField3 : a.customFieldIndex === 4 ? e[n] = t?.customField4 : a.customFieldIndex === 5 && (e[n] = t?.customField5);
|
10272
|
-
}
|
10257
|
+
const n = a.uniqueIdentifier ?? a.title ?? "";
|
10258
|
+
a.type === Ce.FirstName ? e[n] = t?.firstName : a.type === Ce.LastName ? e[n] = t?.lastName : a.type === Ce.Custom && (a.customFieldIndex === 1 ? e[n] = t?.customField1 : a.customFieldIndex === 2 ? e[n] = t?.customField2 : a.customFieldIndex === 3 ? e[n] = t?.customField3 : a.customFieldIndex === 4 ? e[n] = t?.customField4 : a.customFieldIndex === 5 && (e[n] = t?.customField5));
|
10273
10259
|
}), e;
|
10274
10260
|
}
|
10275
10261
|
async updateRecipient(t, e, a, n, i, s, o, l, c, d, A, u, h, m, p, g, C) {
|
@@ -10375,7 +10361,21 @@ class yo {
|
|
10375
10361
|
}
|
10376
10362
|
});
|
10377
10363
|
}
|
10378
|
-
this.recipientCallbacks.forEach((S) => S(this.transaction.recipient));
|
10364
|
+
await this.fetchConversionConfiguration(), this.recipientCallbacks.forEach((S) => S(this.transaction.recipient));
|
10365
|
+
}
|
10366
|
+
async fetchConversionConfiguration() {
|
10367
|
+
const t = this.transaction.recipient;
|
10368
|
+
if (t?.conversionConfigurationId && !this.recipientConversionConfiguration) {
|
10369
|
+
const e = await this.graphQlClient().query({
|
10370
|
+
query: Bi,
|
10371
|
+
errorPolicy: "all",
|
10372
|
+
fetchPolicy: "no-cache",
|
10373
|
+
variables: {
|
10374
|
+
id: t.conversionConfigurationId
|
10375
|
+
}
|
10376
|
+
});
|
10377
|
+
e.data.conversionConfiguration && (this.recipientConversionConfiguration = e.data.conversionConfiguration);
|
10378
|
+
}
|
10379
10379
|
}
|
10380
10380
|
async initializeDefaultWorkflowState(t) {
|
10381
10381
|
const e = () => {
|
@@ -10386,7 +10386,7 @@ class yo {
|
|
10386
10386
|
};
|
10387
10387
|
this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
|
10388
10388
|
this.storage[o.stepName] = o.storage || {};
|
10389
|
-
}), this.allScenes = await qi(t);
|
10389
|
+
}), await this.fetchConversionConfiguration(), this.allScenes = await qi(t);
|
10390
10390
|
const n = Pt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
|
10391
10391
|
this.commandContext.apply(new R(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
|
10392
10392
|
}
|
@@ -10648,9 +10648,9 @@ class yo {
|
|
10648
10648
|
...this.storage,
|
10649
10649
|
[t]: { ...this.storage[t], ...e }
|
10650
10650
|
};
|
10651
|
-
if (!
|
10651
|
+
if (!dn(a, this.storage)) {
|
10652
10652
|
this.storage = a;
|
10653
|
-
const n = new
|
10653
|
+
const n = new Wa(this.constructSerializableWorkflow());
|
10654
10654
|
this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
10655
10655
|
}
|
10656
10656
|
}
|
@@ -10669,7 +10669,7 @@ class yo {
|
|
10669
10669
|
if (this.readOnly) return;
|
10670
10670
|
const t = this.serialize();
|
10671
10671
|
this.workflowStatePromiseQueue.enqueue(
|
10672
|
-
new
|
10672
|
+
new Ja(async () => {
|
10673
10673
|
await new Promise((e) => {
|
10674
10674
|
setTimeout(() => {
|
10675
10675
|
e();
|
@@ -10686,7 +10686,7 @@ class yo {
|
|
10686
10686
|
async updateStateWithServerImmediate() {
|
10687
10687
|
if (this.readOnly) return;
|
10688
10688
|
const t = this.serialize();
|
10689
|
-
return new
|
10689
|
+
return new Ja(async () => {
|
10690
10690
|
await this.updateTransaction({
|
10691
10691
|
variables: {
|
10692
10692
|
id: this.transaction.id,
|
@@ -10748,10 +10748,10 @@ class yo {
|
|
10748
10748
|
return Promise.resolve({ stepElements: {}, commands: [] });
|
10749
10749
|
const n = async (c, d, A) => {
|
10750
10750
|
if (c.type === v.SilentIllustration) {
|
10751
|
-
const u = await new
|
10751
|
+
const u = await new ja(c, d).trigger();
|
10752
10752
|
return { step: c, results: u };
|
10753
10753
|
} else if (c.type === v.ProductOverlay) {
|
10754
|
-
const u = await new
|
10754
|
+
const u = await new ja(
|
10755
10755
|
c,
|
10756
10756
|
d,
|
10757
10757
|
A
|
@@ -10856,7 +10856,7 @@ class yo {
|
|
10856
10856
|
}, this.removeElements(u);
|
10857
10857
|
const p = this.workflow.steps.find((f) => f.stepName === t);
|
10858
10858
|
p?.type === v.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((E) => E.id));
|
10859
|
-
const g = u.map((f) => new bt(f.id)), C = new
|
10859
|
+
const g = u.map((f) => new bt(f.id)), C = new Wa(this.constructSerializableWorkflow()), S = [...m, ...g, C];
|
10860
10860
|
S.length > 0 && this.commandContext.apply(new R(S), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
10861
10861
|
const b = this.getInvalidModelVariants(), I = this.modelContainer;
|
10862
10862
|
if (I) {
|
@@ -10880,7 +10880,7 @@ class yo {
|
|
10880
10880
|
switch (this.stepInitialised[l.stepName] = !0, l.type) {
|
10881
10881
|
case v.DigitalContent:
|
10882
10882
|
a.push(
|
10883
|
-
|
10883
|
+
Wn.init(
|
10884
10884
|
l,
|
10885
10885
|
this,
|
10886
10886
|
this.reloadedState
|
@@ -10897,27 +10897,27 @@ class yo {
|
|
10897
10897
|
break;
|
10898
10898
|
case v.Material:
|
10899
10899
|
a.push(
|
10900
|
-
|
10900
|
+
qn.init(l, this, this.reloadedState)
|
10901
10901
|
);
|
10902
10902
|
break;
|
10903
10903
|
case v.Model:
|
10904
|
-
a.push(
|
10904
|
+
a.push(jn.init(l, this, this.reloadedState));
|
10905
10905
|
break;
|
10906
10906
|
case v.Module:
|
10907
10907
|
this.stepSpecificServices[l.stepName] = {
|
10908
|
-
module: await
|
10908
|
+
module: await Kn(l.data.module)
|
10909
10909
|
}, a.push(
|
10910
|
-
|
10910
|
+
Hn.init(l, this, this.reloadedState)
|
10911
10911
|
);
|
10912
10912
|
break;
|
10913
10913
|
case v.Picture:
|
10914
10914
|
a.push(
|
10915
|
-
|
10915
|
+
Yn.init(l, this, this.reloadedState)
|
10916
10916
|
);
|
10917
10917
|
break;
|
10918
10918
|
case v.Question:
|
10919
10919
|
a.push(
|
10920
|
-
|
10920
|
+
Jn.init(l, this, this.reloadedState)
|
10921
10921
|
);
|
10922
10922
|
break;
|
10923
10923
|
case v.Shape:
|
@@ -11273,7 +11273,7 @@ class vo extends Z {
|
|
11273
11273
|
super(t, e, a);
|
11274
11274
|
}
|
11275
11275
|
selectVariant(t) {
|
11276
|
-
return
|
11276
|
+
return qn.selectVariant(
|
11277
11277
|
this.step,
|
11278
11278
|
t.getResource(),
|
11279
11279
|
this.manager,
|
@@ -11286,7 +11286,7 @@ class Eo extends Z {
|
|
11286
11286
|
super(t, e, a);
|
11287
11287
|
}
|
11288
11288
|
selectVariant(t) {
|
11289
|
-
return
|
11289
|
+
return jn.selectVariant(
|
11290
11290
|
this.step,
|
11291
11291
|
t.getResource(),
|
11292
11292
|
this.manager,
|
@@ -11304,7 +11304,7 @@ class bo extends Z {
|
|
11304
11304
|
* @returns A promise that can be awaited to ensure the new image asset has been updated on the design.
|
11305
11305
|
*/
|
11306
11306
|
selectVariant(t) {
|
11307
|
-
return
|
11307
|
+
return Yn.selectVariant(
|
11308
11308
|
this.step,
|
11309
11309
|
t.getResource(),
|
11310
11310
|
this.manager,
|
@@ -11319,7 +11319,7 @@ class Bo extends Z {
|
|
11319
11319
|
async selectVariant(t) {
|
11320
11320
|
if (!t.getId())
|
11321
11321
|
throw new Error("Unable to select variant with a null ID");
|
11322
|
-
await
|
11322
|
+
await Jn.selectVariant(this.step, t.getId(), this.manager);
|
11323
11323
|
}
|
11324
11324
|
/**
|
11325
11325
|
* The way that this step expects to be rendered.
|
@@ -11399,7 +11399,7 @@ class Po extends Z {
|
|
11399
11399
|
...this.manager.getInformationResults(),
|
11400
11400
|
{
|
11401
11401
|
message: "An issue has occurred with text",
|
11402
|
-
messageType:
|
11402
|
+
messageType: $e.Error,
|
11403
11403
|
stepID: this.step.stepName
|
11404
11404
|
}
|
11405
11405
|
]);
|
@@ -11604,7 +11604,7 @@ class Fo extends Z {
|
|
11604
11604
|
* @returns The final URL string for the QR code.
|
11605
11605
|
*/
|
11606
11606
|
async selectVideo(t) {
|
11607
|
-
return
|
11607
|
+
return Wn.regenerateQRCode(
|
11608
11608
|
this.manager.getRegionElements(this.step.stepName),
|
11609
11609
|
t.key,
|
11610
11610
|
this.manager,
|
@@ -11641,13 +11641,13 @@ class xo extends Z {
|
|
11641
11641
|
return this.manager.getStepStorage(this.step.stepName)?.text || "";
|
11642
11642
|
}
|
11643
11643
|
setText(t) {
|
11644
|
-
|
11644
|
+
Hn.changeText(this.step, t, this.manager, (e) => {
|
11645
11645
|
if (e) {
|
11646
11646
|
const a = [
|
11647
11647
|
...this.manager.getInformationResults(),
|
11648
11648
|
{
|
11649
11649
|
message: e,
|
11650
|
-
messageType:
|
11650
|
+
messageType: $e.Error,
|
11651
11651
|
stepID: this.step.stepName
|
11652
11652
|
}
|
11653
11653
|
];
|
@@ -11689,7 +11689,7 @@ class de {
|
|
11689
11689
|
}
|
11690
11690
|
}
|
11691
11691
|
}
|
11692
|
-
const
|
11692
|
+
const _n = w`
|
11693
11693
|
fragment CreateDesignTransaction on Transaction {
|
11694
11694
|
id
|
11695
11695
|
designName
|
@@ -11715,7 +11715,7 @@ const Kn = w`
|
|
11715
11715
|
}
|
11716
11716
|
}
|
11717
11717
|
`, ko = w`
|
11718
|
-
${
|
11718
|
+
${_n}
|
11719
11719
|
mutation CreateDesign(
|
11720
11720
|
$name: String!
|
11721
11721
|
$layouts: [LayoutInput]!
|
@@ -11747,7 +11747,7 @@ const Kn = w`
|
|
11747
11747
|
}
|
11748
11748
|
}
|
11749
11749
|
`, Mo = w`
|
11750
|
-
${
|
11750
|
+
${_n}
|
11751
11751
|
mutation CreateDesigns($inputs: [DesignCreateInput]!) {
|
11752
11752
|
designCreateMany(inputs: $inputs) {
|
11753
11753
|
id
|
@@ -11819,7 +11819,7 @@ const To = async (r, t) => {
|
|
11819
11819
|
headers: e
|
11820
11820
|
}
|
11821
11821
|
})).data?.designCreateMany;
|
11822
|
-
},
|
11822
|
+
}, Ka = (r, t, e) => {
|
11823
11823
|
const a = (i) => {
|
11824
11824
|
const s = {};
|
11825
11825
|
if (i.type === "Frame") {
|
@@ -11875,7 +11875,7 @@ const To = async (r, t) => {
|
|
11875
11875
|
});
|
11876
11876
|
}
|
11877
11877
|
return n;
|
11878
|
-
},
|
11878
|
+
}, Xn = (r, t, e, a, n, i, s, o) => {
|
11879
11879
|
const l = t.basePrice || 0, c = r.priceModifierTotal || 0, d = Qo(a, e, void 0, i), u = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(r.id), h = {
|
11880
11880
|
additionalExternalProductId: r.integrationProduct?.additionalExternalProductId,
|
11881
11881
|
additionalExternalVariantId: r.integrationProduct?.additionalExternalVariantId,
|
@@ -11898,12 +11898,12 @@ const To = async (r, t) => {
|
|
11898
11898
|
workflowViewerReadOnlyLink: r.workflowViewerReadOnlyLink || ""
|
11899
11899
|
};
|
11900
11900
|
return i && (h.metadata = i), a && (h.selectedVariants = a), n && (h.sku = n), h;
|
11901
|
-
},
|
11901
|
+
}, Zn = async (r, t, e, a, n, i, s, o, l, c) => {
|
11902
11902
|
await (async () => {
|
11903
11903
|
if (c !== void 0) return c;
|
11904
11904
|
await r.outstandingRequestsPromise();
|
11905
11905
|
const F = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), T = await y.getShadowGraphqlClient().query({
|
11906
|
-
query:
|
11906
|
+
query: Dn,
|
11907
11907
|
variables: { ids: [n.id] },
|
11908
11908
|
fetchPolicy: "no-cache",
|
11909
11909
|
errorPolicy: "all",
|
@@ -11915,7 +11915,7 @@ const To = async (r, t) => {
|
|
11915
11915
|
T.errors && console.log("Server Error:", et.message);
|
11916
11916
|
}), null) : tt ?? null;
|
11917
11917
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
|
11918
|
-
const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l &&
|
11918
|
+
const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && Ka(l, t, !0), g = l && Ka(l, t, !1), C = async (B) => {
|
11919
11919
|
const F = {};
|
11920
11920
|
let Q = 0;
|
11921
11921
|
if (Object.keys(i).length > 0)
|
@@ -11954,7 +11954,7 @@ const To = async (r, t) => {
|
|
11954
11954
|
const B = await (await rt(E)).blob();
|
11955
11955
|
E = (await O.uploadAsset(
|
11956
11956
|
{ name: `${n.id}-preview-image.png`, blob: B },
|
11957
|
-
|
11957
|
+
ye.Image,
|
11958
11958
|
!0,
|
11959
11959
|
!1
|
11960
11960
|
)).fileLink;
|
@@ -11991,7 +11991,7 @@ const To = async (r, t) => {
|
|
11991
11991
|
};
|
11992
11992
|
}, Ro = async (r, t, e, a, n, i, s, o, l, c, d) => {
|
11993
11993
|
l("workflow.steps.finish.finalize.buildingLayouts");
|
11994
|
-
const { designDetails: A, cartSelectionsWithPrices: u, cartMetadata: h } = await
|
11994
|
+
const { designDetails: A, cartSelectionsWithPrices: u, cartMetadata: h } = await Zn(
|
11995
11995
|
r,
|
11996
11996
|
t,
|
11997
11997
|
e,
|
@@ -12008,7 +12008,7 @@ const To = async (r, t) => {
|
|
12008
12008
|
throw new Error("Failed to create design");
|
12009
12009
|
l("workflow.steps.finish.finalize.updatingTransaction");
|
12010
12010
|
const g = m.transaction;
|
12011
|
-
return
|
12011
|
+
return Xn(
|
12012
12012
|
g,
|
12013
12013
|
n,
|
12014
12014
|
t,
|
@@ -12026,7 +12026,7 @@ const To = async (r, t) => {
|
|
12026
12026
|
);
|
12027
12027
|
const n = await (async () => {
|
12028
12028
|
const l = await y.getShadowGraphqlClient().query({
|
12029
|
-
query:
|
12029
|
+
query: Dn,
|
12030
12030
|
variables: { ids: r.map((c) => c.transaction.id) },
|
12031
12031
|
fetchPolicy: "no-cache",
|
12032
12032
|
errorPolicy: "all"
|
@@ -12035,7 +12035,7 @@ const To = async (r, t) => {
|
|
12035
12035
|
l.errors && console.log("Server Error:", c.message);
|
12036
12036
|
}), null) : l.data?.transactions ? l.data.transactions.map((c) => c.workflowState ?? null) : null;
|
12037
12037
|
})(), i = await Promise.all(
|
12038
|
-
r.map(async (o, l) => await
|
12038
|
+
r.map(async (o, l) => await Zn(
|
12039
12039
|
o.workflowManager,
|
12040
12040
|
o.workflow,
|
12041
12041
|
o.layouts,
|
@@ -12054,7 +12054,7 @@ const To = async (r, t) => {
|
|
12054
12054
|
throw new Error("Failed to create designs");
|
12055
12055
|
return t("workflow.steps.finish.finalize.updatingTransaction"), s.map((o, l) => {
|
12056
12056
|
const c = r[l], d = i[l], A = o.transaction;
|
12057
|
-
return
|
12057
|
+
return Xn(
|
12058
12058
|
A,
|
12059
12059
|
c.product,
|
12060
12060
|
c.workflow,
|
@@ -12133,7 +12133,7 @@ class $o {
|
|
12133
12133
|
throw new V("Unexpected storage method requested");
|
12134
12134
|
}
|
12135
12135
|
}
|
12136
|
-
const
|
12136
|
+
const Ke = new $o(), Uo = w`
|
12137
12137
|
mutation AddTransactionStakeholder($id: String!, $type: String!, $details: CustomerDetailsInput!) {
|
12138
12138
|
transactionAddStakeholder(id: $id, details: $details, type: $type) {
|
12139
12139
|
id
|
@@ -12179,8 +12179,8 @@ const Je = new $o(), Uo = w`
|
|
12179
12179
|
var zo = /* @__PURE__ */ ((r) => (r.QuantityChanged = "QuantityChanged", r.PriceBreakChanged = "PriceBreakChanged", r))(zo || {});
|
12180
12180
|
class Go {
|
12181
12181
|
constructor(t, e) {
|
12182
|
-
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate =
|
12183
|
-
await
|
12182
|
+
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = An(async () => {
|
12183
|
+
await Ke.getSavedDesignByTransaction(
|
12184
12184
|
this.getWorkflowManager().getTransaction().id
|
12185
12185
|
) && this.save();
|
12186
12186
|
}, 2500), this.getCanvasObjectURLAsync = async (n) => new Promise((i, s) => {
|
@@ -12299,20 +12299,20 @@ class Go {
|
|
12299
12299
|
height: d.layoutState.layout.height
|
12300
12300
|
}, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
|
12301
12301
|
if (!h)
|
12302
|
-
throw new
|
12303
|
-
const m =
|
12302
|
+
throw new ke("Failed to obtain 2D context for preview image creation");
|
12303
|
+
const m = this.workflowManager.getTemplatingContext(), p = Sa(u.layoutState.layout, u.layoutState.elements, {
|
12304
12304
|
renderingConfiguration: {
|
12305
12305
|
purpose: Ht.Print,
|
12306
12306
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
12307
12307
|
templatingContext: m
|
12308
12308
|
}
|
12309
|
-
}), g =
|
12310
|
-
await (await
|
12309
|
+
}), g = gn(p);
|
12310
|
+
await (await Aa.from(h, g, {
|
12311
12311
|
anonymousCrossOrigin: !0,
|
12312
12312
|
ignoreDimensions: !1,
|
12313
12313
|
createCanvas: pt,
|
12314
12314
|
createImage: te,
|
12315
|
-
DOMParser:
|
12315
|
+
DOMParser: ga(),
|
12316
12316
|
fetch
|
12317
12317
|
})).render();
|
12318
12318
|
const S = await this.getCanvasObjectURLAsync(s);
|
@@ -12470,7 +12470,7 @@ class Go {
|
|
12470
12470
|
const n = {
|
12471
12471
|
title: await (async () => {
|
12472
12472
|
if (t) return t;
|
12473
|
-
const i = this.getWorkflowManager().getTransaction().id, o = (await
|
12473
|
+
const i = this.getWorkflowManager().getTransaction().id, o = (await Ke.getSavedDesigns()).find((l) => l.transactionId === i)?.title;
|
12474
12474
|
return o || "My design";
|
12475
12475
|
})(),
|
12476
12476
|
thumbnail: await this.createPreviewImage(!1, 256),
|
@@ -12481,7 +12481,7 @@ class Go {
|
|
12481
12481
|
workflowId: this.getWorkflowManager().getWorkflow().id,
|
12482
12482
|
lastEdited: /* @__PURE__ */ new Date()
|
12483
12483
|
};
|
12484
|
-
return await
|
12484
|
+
return await Ke.addDesign(n), n;
|
12485
12485
|
}
|
12486
12486
|
async copy() {
|
12487
12487
|
const t = St(this.getCommandContext().getState());
|
@@ -12671,8 +12671,8 @@ const Wo = (r) => {
|
|
12671
12671
|
"tspan"
|
12672
12672
|
], Ho = async (r, t, e) => {
|
12673
12673
|
const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
|
12674
|
-
o.searchParams.append("video",
|
12675
|
-
const l = o.toString(), d = `data:image/svg+xml;base64,${
|
12674
|
+
o.searchParams.append("video", Ra(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
|
12675
|
+
const l = o.toString(), d = `data:image/svg+xml;base64,${Ra(await cn(l, { type: "svg" }))}`, A = (h) => {
|
12676
12676
|
const m = r.find((g) => g.panelId === h.panelId);
|
12677
12677
|
if (!m)
|
12678
12678
|
throw new Y(h);
|
@@ -12697,15 +12697,15 @@ const Wo = (r) => {
|
|
12697
12697
|
return console.error(h), [];
|
12698
12698
|
}
|
12699
12699
|
}, Yo = async (r, t, e, a) => {
|
12700
|
-
const n = e.data, i = n.assetUrl, s = await
|
12700
|
+
const n = e.data, i = n.assetUrl, s = await la(i);
|
12701
12701
|
try {
|
12702
12702
|
const o = As(n, a.option);
|
12703
12703
|
o && (t[a.stepName] = { selectedVariants: [o] });
|
12704
12704
|
const l = async (c) => {
|
12705
|
-
const d = await
|
12705
|
+
const d = await Un(c, o?.asset?.fileLink), A = await Oe(d), u = M(), h = r.find((p) => p.panelId === c.panelId);
|
12706
12706
|
if (!h)
|
12707
12707
|
throw new Y(c);
|
12708
|
-
const m =
|
12708
|
+
const m = Ea(
|
12709
12709
|
s,
|
12710
12710
|
A,
|
12711
12711
|
{
|
@@ -12769,7 +12769,7 @@ const Wo = (r) => {
|
|
12769
12769
|
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
12770
|
if (!m)
|
12771
12771
|
return console.error("Failed to read SVG."), [];
|
12772
|
-
|
12772
|
+
pa(m);
|
12773
12773
|
const p = {};
|
12774
12774
|
kt(m, (f) => {
|
12775
12775
|
jo.includes(f.tagName) && !f.attributes.getNamedItem("fill") && f.setAttribute("fill", "#000000");
|
@@ -12822,7 +12822,7 @@ const Wo = (r) => {
|
|
12822
12822
|
return console.error(f), [];
|
12823
12823
|
}
|
12824
12824
|
}, Ko = async (r, t, e) => {
|
12825
|
-
const a = await
|
12825
|
+
const a = await Kn(e.data.module), n = t.data, i = (o, l) => {
|
12826
12826
|
const c = r.find((A) => A.panelId === l.panelId);
|
12827
12827
|
if (!c)
|
12828
12828
|
throw new Y(l);
|
@@ -12983,7 +12983,7 @@ const Wo = (r) => {
|
|
12983
12983
|
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", C = dt().parseFromString(m, "image/svg+xml").firstElementChild;
|
12984
12984
|
if (!C)
|
12985
12985
|
throw new Dt("Failed to read SVG.");
|
12986
|
-
return
|
12986
|
+
return pa(C), Bt().serializeToString(C);
|
12987
12987
|
};
|
12988
12988
|
l.forEach((A) => {
|
12989
12989
|
const u = r.find((m) => m.panelId === A.panelId);
|
@@ -13033,7 +13033,7 @@ const Wo = (r) => {
|
|
13033
13033
|
assetUrl: g,
|
13034
13034
|
name: C.names.fullName.en
|
13035
13035
|
};
|
13036
|
-
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", i.text) : i.text) || "", u =
|
13036
|
+
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", i.text) : i.text) || "", u = Ie(A, {
|
13037
13037
|
vertical: a.data.vertical,
|
13038
13038
|
uppercase: a.data.uppercase
|
13039
13039
|
}), h = async (g) => {
|
@@ -13071,7 +13071,7 @@ const Wo = (r) => {
|
|
13071
13071
|
d,
|
13072
13072
|
g,
|
13073
13073
|
[
|
13074
|
-
|
13074
|
+
Ie(u, {
|
13075
13075
|
vertical: a.data.vertical,
|
13076
13076
|
uppercase: a.data.uppercase
|
13077
13077
|
})
|
@@ -13202,7 +13202,7 @@ const rl = () => new Promise((r, t) => {
|
|
13202
13202
|
}), il = rl();
|
13203
13203
|
class sl {
|
13204
13204
|
constructor(t, e, a, n, i) {
|
13205
|
-
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.renderQueue = new
|
13205
|
+
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.renderQueue = new kn(2), this.id = t, this.name = e, this.service = a, this.panelSize = n, this.getWorkflowManager = i;
|
13206
13206
|
}
|
13207
13207
|
getID() {
|
13208
13208
|
return this.id;
|
@@ -13269,7 +13269,7 @@ class sl {
|
|
13269
13269
|
);
|
13270
13270
|
}
|
13271
13271
|
}
|
13272
|
-
class ol extends
|
13272
|
+
class ol extends xn {
|
13273
13273
|
constructor(t, e, a, n, i, s) {
|
13274
13274
|
super(), this.layoutId = t, this.ctx = e, this.nonPOTSupport = a, this.onRender = n, this.layouts = i, this.getWorkflowManager = s;
|
13275
13275
|
}
|
@@ -13319,12 +13319,12 @@ class ol extends Fn {
|
|
13319
13319
|
l = g.width, c = g.height;
|
13320
13320
|
} else
|
13321
13321
|
l = i.width, c = i.height;
|
13322
|
-
const d =
|
13322
|
+
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = Sa(t.layoutState.layout, e, {
|
13323
13323
|
renderingConfiguration: {
|
13324
13324
|
purpose: Ht.ThreeD,
|
13325
13325
|
templatingContext: d
|
13326
13326
|
}
|
13327
|
-
}), u =
|
13327
|
+
}), u = gn(A), h = await Aa.from(this.ctx, u, {
|
13328
13328
|
anonymousCrossOrigin: !0,
|
13329
13329
|
ignoreDimensions: !this.nonPOTSupport,
|
13330
13330
|
ignoreAnimation: !0,
|
@@ -13333,7 +13333,7 @@ class ol extends Fn {
|
|
13333
13333
|
enableRedraw: !1,
|
13334
13334
|
createCanvas: pt,
|
13335
13335
|
createImage: te,
|
13336
|
-
DOMParser:
|
13336
|
+
DOMParser: ga(),
|
13337
13337
|
fetch
|
13338
13338
|
});
|
13339
13339
|
h.resize(l, c), await h.render(), this.onRender();
|
@@ -13355,7 +13355,7 @@ const ld = (r, t) => {
|
|
13355
13355
|
serializableWorkflow: { steps: [] },
|
13356
13356
|
layouts: {}
|
13357
13357
|
};
|
13358
|
-
n = new R(e.map((l) => new
|
13358
|
+
n = new R(e.map((l) => new zn(l))).apply(n);
|
13359
13359
|
const s = await al(r, t, e, a);
|
13360
13360
|
return new R(s).apply(n);
|
13361
13361
|
};
|
@@ -13403,14 +13403,14 @@ class ll {
|
|
13403
13403
|
case L.FileUpload:
|
13404
13404
|
return new cl(this.bundle, t).initialize();
|
13405
13405
|
case L.ColorOption:
|
13406
|
-
return new
|
13406
|
+
return new _a(
|
13407
13407
|
this.bundle,
|
13408
13408
|
t,
|
13409
13409
|
t.entityId ? await H.getOption(t.entityId) : void 0
|
13410
13410
|
);
|
13411
13411
|
case L.Option: {
|
13412
13412
|
const e = t.entityId ? await H.getOption(t.entityId) : void 0;
|
13413
|
-
return e?.type === "Color" ? new
|
13413
|
+
return e?.type === "Color" ? new _a(this.bundle, t, e) : new tr(this.bundle, t, e);
|
13414
13414
|
}
|
13415
13415
|
case L.Text:
|
13416
13416
|
return new dl(this.bundle, t);
|
@@ -13419,7 +13419,7 @@ class ll {
|
|
13419
13419
|
}
|
13420
13420
|
}
|
13421
13421
|
}
|
13422
|
-
class
|
13422
|
+
class Ia {
|
13423
13423
|
constructor(t, e) {
|
13424
13424
|
this.bundle = t, this.property = e;
|
13425
13425
|
}
|
@@ -13480,7 +13480,7 @@ class Ba {
|
|
13480
13480
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
13481
13481
|
}
|
13482
13482
|
}
|
13483
|
-
class cl extends
|
13483
|
+
class cl extends Ia {
|
13484
13484
|
constructor(t, e) {
|
13485
13485
|
super(t, e);
|
13486
13486
|
}
|
@@ -13491,7 +13491,7 @@ class cl extends Ba {
|
|
13491
13491
|
const t = await this.getImage();
|
13492
13492
|
if (t?.fileLink)
|
13493
13493
|
if (t?.fileLink.endsWith(".svg")) {
|
13494
|
-
const e = await nt(t?.fileLink), a = await
|
13494
|
+
const e = await nt(t?.fileLink), a = await ba(t?.fileLink), n = a.width, i = a.height, s = await ot(e);
|
13495
13495
|
this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach((c) => {
|
13496
13496
|
s.colors[c.key] = {
|
13497
13497
|
browserValue: c.browserValue,
|
@@ -13534,7 +13534,7 @@ class cl extends Ba {
|
|
13534
13534
|
]);
|
13535
13535
|
}
|
13536
13536
|
async canUseBackgroundRemover() {
|
13537
|
-
return this.bundle.getClient().canUseAddon(
|
13537
|
+
return this.bundle.getClient().canUseAddon(ua.BackgroundRemover);
|
13538
13538
|
}
|
13539
13539
|
/**
|
13540
13540
|
* Removes the background from an image, stores it in the state, and returns the new asset.
|
@@ -13572,7 +13572,7 @@ class cl extends Ba {
|
|
13572
13572
|
return O.getLocalOrFromServer(t);
|
13573
13573
|
}
|
13574
13574
|
async getImageWithColors() {
|
13575
|
-
return await this.loadImageData(), this.imageData?.svg ?
|
13575
|
+
return await this.loadImageData(), this.imageData?.svg ? ha(Ca(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
13576
13576
|
}
|
13577
13577
|
/**
|
13578
13578
|
* Retrieves the original, unmodified image selection, if one exists.
|
@@ -13706,7 +13706,7 @@ class cl extends Ba {
|
|
13706
13706
|
);
|
13707
13707
|
}
|
13708
13708
|
}
|
13709
|
-
class dl extends
|
13709
|
+
class dl extends Ia {
|
13710
13710
|
constructor(t, e) {
|
13711
13711
|
super(t, e);
|
13712
13712
|
}
|
@@ -13745,7 +13745,7 @@ class dl extends Ba {
|
|
13745
13745
|
await Promise.all(n);
|
13746
13746
|
}
|
13747
13747
|
}
|
13748
|
-
class
|
13748
|
+
class tr extends Ia {
|
13749
13749
|
constructor(t, e, a) {
|
13750
13750
|
super(t, e), this.optionResource = a;
|
13751
13751
|
}
|
@@ -13807,7 +13807,7 @@ class Zn extends Ba {
|
|
13807
13807
|
await Promise.all(n);
|
13808
13808
|
}
|
13809
13809
|
}
|
13810
|
-
class
|
13810
|
+
class _a extends tr {
|
13811
13811
|
constructor(t, e, a) {
|
13812
13812
|
super(t, e, a);
|
13813
13813
|
}
|
@@ -13872,7 +13872,7 @@ const Al = (r, t, e, a) => r.flatMap((n) => n.getSteps()).filter((n) => n.getGlo
|
|
13872
13872
|
});
|
13873
13873
|
return Math.max(...n);
|
13874
13874
|
};
|
13875
|
-
function
|
13875
|
+
function er(r) {
|
13876
13876
|
const t = /* @__PURE__ */ new Map();
|
13877
13877
|
return r?.aspects?.forEach((e) => {
|
13878
13878
|
e.value !== "" && t.set(e.name, !0);
|
@@ -13889,7 +13889,7 @@ class hl {
|
|
13889
13889
|
}), this.onGlobalPropertyStateChange = n;
|
13890
13890
|
}
|
13891
13891
|
recalculateMandatoryStates() {
|
13892
|
-
this.mandatoryFulfilledAspects =
|
13892
|
+
this.mandatoryFulfilledAspects = er(this.globalPropertyState);
|
13893
13893
|
}
|
13894
13894
|
setBundleOptions(t) {
|
13895
13895
|
this.bundleOptions = t;
|
@@ -14222,7 +14222,7 @@ class pl {
|
|
14222
14222
|
}
|
14223
14223
|
const fl = new pl();
|
14224
14224
|
var Cl = /* @__PURE__ */ ((r) => (r.Default = "Default", r.Name = "Name", r.Price = "Price", r))(Cl || {});
|
14225
|
-
class
|
14225
|
+
class ar {
|
14226
14226
|
constructor(t) {
|
14227
14227
|
this.fullFetched = !1, this.collection = t;
|
14228
14228
|
const e = this.collection.productCollectionProducts;
|
@@ -14606,7 +14606,7 @@ const Sl = w`
|
|
14606
14606
|
variables: {
|
14607
14607
|
ids: r
|
14608
14608
|
}
|
14609
|
-
})).data?.productCollections?.map((e) => new
|
14609
|
+
})).data?.productCollections?.map((e) => new ar(e));
|
14610
14610
|
class vl {
|
14611
14611
|
constructor() {
|
14612
14612
|
this.listeners = {};
|
@@ -14670,7 +14670,7 @@ const El = w`
|
|
14670
14670
|
}
|
14671
14671
|
}
|
14672
14672
|
`;
|
14673
|
-
class
|
14673
|
+
class _e {
|
14674
14674
|
constructor(t, e, a, n, i, s) {
|
14675
14675
|
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
14676
|
const o = this.productCollection?.globalPropertyConfiguration;
|
@@ -14826,7 +14826,7 @@ class Ke {
|
|
14826
14826
|
if (i)
|
14827
14827
|
switch (a.type) {
|
14828
14828
|
case L.FileUpload: {
|
14829
|
-
const s = i, o = await
|
14829
|
+
const s = i, o = await be([a.value]);
|
14830
14830
|
o.length > 0 && await s.selectImage(o[0]);
|
14831
14831
|
const l = a.storage?.colors;
|
14832
14832
|
if (l) {
|
@@ -14872,7 +14872,7 @@ class Ke {
|
|
14872
14872
|
return this.workflowExperiences.map((t) => t.getTotalPriceSubunits()).reduce((t, e) => t + e, 0);
|
14873
14873
|
}
|
14874
14874
|
getProductCollection() {
|
14875
|
-
return this.productCollection ? new
|
14875
|
+
return this.productCollection ? new ar(this.productCollection) : void 0;
|
14876
14876
|
}
|
14877
14877
|
async initializeAdditionalRequiredColorChannels(t) {
|
14878
14878
|
for (const e of t.getStepsByType(v.Illustration)) {
|
@@ -15085,7 +15085,7 @@ class Ke {
|
|
15085
15085
|
variables: {
|
15086
15086
|
id: this.id,
|
15087
15087
|
details: t,
|
15088
|
-
type: e ||
|
15088
|
+
type: e || Se.Owner
|
15089
15089
|
},
|
15090
15090
|
context: {
|
15091
15091
|
bundleOwnerId: this.ownerId
|
@@ -15124,7 +15124,7 @@ class Ke {
|
|
15124
15124
|
}
|
15125
15125
|
async getAllStakeholders() {
|
15126
15126
|
const t = await y.getShadowGraphqlClient().query({
|
15127
|
-
query:
|
15127
|
+
query: Ya,
|
15128
15128
|
errorPolicy: "all",
|
15129
15129
|
fetchPolicy: "no-cache",
|
15130
15130
|
variables: {
|
@@ -15140,7 +15140,7 @@ class Ke {
|
|
15140
15140
|
}
|
15141
15141
|
async getCurrentStakeholder() {
|
15142
15142
|
const t = await y.getShadowGraphqlClient().query({
|
15143
|
-
query:
|
15143
|
+
query: Ya,
|
15144
15144
|
errorPolicy: "all",
|
15145
15145
|
fetchPolicy: "no-cache",
|
15146
15146
|
variables: {
|
@@ -15334,7 +15334,7 @@ class Ke {
|
|
15334
15334
|
});
|
15335
15335
|
}
|
15336
15336
|
checkMandatoryHandlesChanged(t, e) {
|
15337
|
-
const a = [], n = [], i = [], s =
|
15337
|
+
const a = [], n = [], i = [], s = er(t);
|
15338
15338
|
e.forEach((o) => {
|
15339
15339
|
if (o.isMandatory()) {
|
15340
15340
|
const l = o.isMandatoryFulfilled();
|
@@ -15534,7 +15534,7 @@ class ue {
|
|
15534
15534
|
return this.getArtifacts().get(t);
|
15535
15535
|
}
|
15536
15536
|
}
|
15537
|
-
class
|
15537
|
+
class Pa {
|
15538
15538
|
constructor(t) {
|
15539
15539
|
this.value = t;
|
15540
15540
|
}
|
@@ -15547,14 +15547,14 @@ class Ia {
|
|
15547
15547
|
}
|
15548
15548
|
}
|
15549
15549
|
var Fl = /* @__PURE__ */ ((r) => (r.Transaction = "Transaction", r.Bundle = "Bundle", r.Product = "Product", r.Variant = "Variant", r.Option = "Option", r.LineItem = "LineItem", r.Asset = "Asset", r))(Fl || {});
|
15550
|
-
class Ad extends
|
15550
|
+
class Ad extends Pa {
|
15551
15551
|
constructor(t) {
|
15552
15552
|
super(`"${t}"`);
|
15553
15553
|
}
|
15554
15554
|
}
|
15555
|
-
class
|
15555
|
+
class nr extends Pa {
|
15556
15556
|
constructor(t, e) {
|
15557
|
-
if (e !== "Asset" && !
|
15557
|
+
if (e !== "Asset" && !nr.validUUID(t))
|
15558
15558
|
throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");
|
15559
15559
|
super(`{"isSpiffObject": true, "id": "${t}", "type": "${e}"}`);
|
15560
15560
|
}
|
@@ -15562,12 +15562,12 @@ class ar extends Ia {
|
|
15562
15562
|
return t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
|
15563
15563
|
}
|
15564
15564
|
}
|
15565
|
-
class ud extends
|
15565
|
+
class ud extends Pa {
|
15566
15566
|
constructor(t) {
|
15567
15567
|
super(`[${t.map((e) => e.getRaw()).join(",")}]`);
|
15568
15568
|
}
|
15569
15569
|
}
|
15570
|
-
class
|
15570
|
+
class Xa {
|
15571
15571
|
constructor(t) {
|
15572
15572
|
this.integrationProduct = t;
|
15573
15573
|
}
|
@@ -15755,7 +15755,7 @@ class Nl {
|
|
15755
15755
|
}
|
15756
15756
|
async generateCode(t) {
|
15757
15757
|
const e = await this.cognitoClient?.send(
|
15758
|
-
new
|
15758
|
+
new ka({
|
15759
15759
|
AuthFlow: "CUSTOM_AUTH",
|
15760
15760
|
ClientId: this.userPoolClientId,
|
15761
15761
|
AuthParameters: {
|
@@ -15789,7 +15789,7 @@ class Nl {
|
|
15789
15789
|
throw new Error("Failed to find existing tokens.");
|
15790
15790
|
const e = JSON.parse(t);
|
15791
15791
|
return await this.cognitoClient?.send(
|
15792
|
-
new
|
15792
|
+
new ka({
|
15793
15793
|
AuthFlow: "REFRESH_TOKEN_AUTH",
|
15794
15794
|
ClientId: this.userPoolClientId,
|
15795
15795
|
AuthParameters: {
|
@@ -15819,7 +15819,7 @@ class Ql {
|
|
15819
15819
|
* @param currency The currency to determine precision for.
|
15820
15820
|
*/
|
15821
15821
|
getPrecisionForCurrency(t) {
|
15822
|
-
const e = t, a =
|
15822
|
+
const e = t, a = Ma.code(e);
|
15823
15823
|
return a ? a.digits : 2;
|
15824
15824
|
}
|
15825
15825
|
/**
|
@@ -15830,11 +15830,11 @@ class Ql {
|
|
15830
15830
|
*/
|
15831
15831
|
getSpecialFormat(t) {
|
15832
15832
|
const e = t;
|
15833
|
-
if (
|
15833
|
+
if (Ma.code(e)?.code === "CLP")
|
15834
15834
|
return "USD0,0";
|
15835
15835
|
}
|
15836
15836
|
}
|
15837
|
-
const
|
15837
|
+
const Za = new Ql();
|
15838
15838
|
class Rl {
|
15839
15839
|
constructor(t, e, a, n) {
|
15840
15840
|
this.presentmentCurrency = void 0, this.presentmentCurrency = n, this.partnerCurrency = a, this.rateFrom = t, this.rateTo = e;
|
@@ -15866,13 +15866,13 @@ class Rl {
|
|
15866
15866
|
* Converts a monetary value from the database to the units of its currency.
|
15867
15867
|
*/
|
15868
15868
|
units(t, e) {
|
15869
|
-
return t / Math.pow(10,
|
15869
|
+
return t / Math.pow(10, Za.getPrecisionForCurrency(e));
|
15870
15870
|
}
|
15871
15871
|
/**
|
15872
15872
|
* Converts a monetary value in units to the subunits of its currency.
|
15873
15873
|
*/
|
15874
15874
|
subunits(t, e) {
|
15875
|
-
return t * Math.pow(10,
|
15875
|
+
return t * Math.pow(10, Za.getPrecisionForCurrency(e));
|
15876
15876
|
}
|
15877
15877
|
}
|
15878
15878
|
const Ol = async (r, t) => {
|
@@ -15902,7 +15902,7 @@ const Ol = async (r, t) => {
|
|
15902
15902
|
if (!a)
|
15903
15903
|
throw new Error(`Workflow not found: ${r}`);
|
15904
15904
|
return a;
|
15905
|
-
},
|
15905
|
+
}, rr = async (r, t) => {
|
15906
15906
|
const e = r.map((o) => Kt.get({ id: o, options: t })), a = r.filter((o, l) => e[l] === void 0);
|
15907
15907
|
if (a.length === 0)
|
15908
15908
|
return Promise.all(e);
|
@@ -15910,7 +15910,7 @@ const Ol = async (r, t) => {
|
|
15910
15910
|
(o) => Kt.set({ id: o, options: t }, $l(o, n))
|
15911
15911
|
), s = e.filter((o) => o !== void 0);
|
15912
15912
|
return await Promise.all(s.concat(i));
|
15913
|
-
}, hd = async (r, t) => (await
|
15913
|
+
}, hd = async (r, t) => (await rr([r], t))[0], Ul = (r) => r.sort((t, e) => t.index - e.index).map((t) => ({
|
15914
15914
|
id: M(),
|
15915
15915
|
panelId: t.name,
|
15916
15916
|
name: t.name,
|
@@ -15939,7 +15939,7 @@ class md {
|
|
15939
15939
|
} catch (a) {
|
15940
15940
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15941
15941
|
}
|
15942
|
-
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15942
|
+
}, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.2.0-beta.a27ad618-ade0-577a-a396-e9182c5d191a"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15943
15943
|
}
|
15944
15944
|
configure(t) {
|
15945
15945
|
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);
|
@@ -15989,7 +15989,7 @@ class md {
|
|
15989
15989
|
*/
|
15990
15990
|
async authenticateBundleFromLocalStorage(t) {
|
15991
15991
|
if (k.getMap("bundleOwnerIds")?.has(t))
|
15992
|
-
return Promise.resolve({ success: !0, stakeholderType:
|
15992
|
+
return Promise.resolve({ success: !0, stakeholderType: Se.Owner });
|
15993
15993
|
const a = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
15994
15994
|
if (a.has(t)) {
|
15995
15995
|
const n = a.get(t);
|
@@ -16033,7 +16033,7 @@ class md {
|
|
16033
16033
|
if (n.isOrdered)
|
16034
16034
|
return Promise.resolve({ success: !1, transactionReadOnly: !0 });
|
16035
16035
|
if (k.getMap("transactionOwnerIds")?.has(t))
|
16036
|
-
return Promise.resolve({ success: !0, stakeholderType:
|
16036
|
+
return Promise.resolve({ success: !0, stakeholderType: Se.Owner });
|
16037
16037
|
const o = k.getMap("transactionCustomerIds");
|
16038
16038
|
if (o?.has(t) && o.get(t) && await this.reloadLoggedInCustomer()) {
|
16039
16039
|
const u = this.customer?.bundleStakeholders?.find(
|
@@ -16239,7 +16239,7 @@ class md {
|
|
16239
16239
|
s.set(i.id, i.partner.id), k.setMap("bundlePartnerIds", s);
|
16240
16240
|
const o = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
16241
16241
|
o.set(i.id, i.bundleOwnerId), k.setMap("bundleOwnerIds", o);
|
16242
|
-
const l = new
|
16242
|
+
const l = new _e(this, i, void 0, void 0, i.bundleOwnerId, {
|
16243
16243
|
eagerFetchProducts: a?.graphql?.productCollection?.eagerFetchProducts
|
16244
16244
|
});
|
16245
16245
|
return await l.getInitializationPromise(), l;
|
@@ -16279,7 +16279,7 @@ class md {
|
|
16279
16279
|
throw new Error(`Unable to find bundle: ${t}`);
|
16280
16280
|
const d = c.data?.bundles[0], A = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
16281
16281
|
A.set(d.id, d.partner.id), k.setMap("bundlePartnerIds", A);
|
16282
|
-
const u = new
|
16282
|
+
const u = new _e(this, d, e, a, s, {
|
16283
16283
|
additionalHeaders: n?.graphql?.additionalHeaders,
|
16284
16284
|
eagerFetchProducts: n?.graphql?.productCollection?.eagerFetchProducts,
|
16285
16285
|
existingGlobalPropertyState: c.data.globalPropertyState,
|
@@ -16326,7 +16326,7 @@ class md {
|
|
16326
16326
|
d.set(c.id, c.partner.id), k.setMap("bundlePartnerIds", d);
|
16327
16327
|
const A = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
16328
16328
|
return A.set(c.id, c.bundleOwnerId), k.setMap("bundleOwnerIds", A), async () => {
|
16329
|
-
const u = new
|
16329
|
+
const u = new _e(this, c, void 0, void 0, c.bundleOwnerId, {
|
16330
16330
|
eagerFetchProducts: n?.graphql?.productCollection?.eagerFetchProducts,
|
16331
16331
|
existingGlobalPropertyState: c.globalPropertyState
|
16332
16332
|
});
|
@@ -16451,10 +16451,10 @@ class md {
|
|
16451
16451
|
}));
|
16452
16452
|
}, s = t.map((f, E) => ({ option: f, index: E })), o = s.filter((f) => f.option.type === "transaction"), l = s.filter(
|
16453
16453
|
(f) => f.option.type === "integration" || f.option.type === "external"
|
16454
|
-
), c =
|
16454
|
+
), c = xa(o, 10), d = xa(l, 10), A = (await Promise.all([
|
16455
16455
|
...c.map(n),
|
16456
16456
|
...d.map(i)
|
16457
|
-
])).flat(), u = [...new Set(A.map((f) => f.workflowId))], h = await
|
16457
|
+
])).flat(), u = [...new Set(A.map((f) => f.workflowId))], h = await rr(u, e), m = new Map(h.map((f) => [f.id, f])), p = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), g = A.map(async (f) => {
|
16458
16458
|
const { transaction: E, workflowId: P, readOnly: B, index: F } = f, Q = m.get(P), T = t[F];
|
16459
16459
|
!p.get(E.id) && E.transactionOwnerId && p.set(E.id, E.transactionOwnerId);
|
16460
16460
|
const tt = p.get(E.id) || void 0, et = new Tl({
|
@@ -16478,10 +16478,10 @@ class md {
|
|
16478
16478
|
};
|
16479
16479
|
if (T.type === "transaction" && E.workflowState) {
|
16480
16480
|
const q = JSON.parse(E.workflowState);
|
16481
|
-
W.layouts = Object.values(q.layouts || {}).map((Ct) => Ct.layout), await
|
16481
|
+
W.layouts = Object.values(q.layouts || {}).map((Ct) => Ct.layout), await Ga(q), W.reloadedState = q;
|
16482
16482
|
} else if (!B && T.workflowState) {
|
16483
16483
|
const q = JSON.parse(T.workflowState);
|
16484
|
-
W.layouts = Object.values(q.layouts || {}).map((Ct) => Ct.layout), await
|
16484
|
+
W.layouts = Object.values(q.layouts || {}).map((Ct) => Ct.layout), await Ga(q), W.reloadedState = q;
|
16485
16485
|
} else
|
16486
16486
|
W.layouts = Ll(
|
16487
16487
|
W.transaction,
|
@@ -16513,7 +16513,7 @@ class md {
|
|
16513
16513
|
})).data?.integrationProducts;
|
16514
16514
|
if (!i || i.length === 0 || !i[0]?.id)
|
16515
16515
|
throw new Error("Integration product not found.");
|
16516
|
-
return new
|
16516
|
+
return new Xa(i[0]);
|
16517
16517
|
}
|
16518
16518
|
async getIntegrationProductFromExternalIds(t, e, a) {
|
16519
16519
|
const s = (await y.getShadowGraphqlClient().query({
|
@@ -16527,7 +16527,7 @@ class md {
|
|
16527
16527
|
})).data?.integrationProductFromExternalIds;
|
16528
16528
|
if (!s?.id)
|
16529
16529
|
throw new Error("Integration product not found.");
|
16530
|
-
return new
|
16530
|
+
return new Xa(s);
|
16531
16531
|
}
|
16532
16532
|
async getIntegrationProduct(t) {
|
16533
16533
|
return t.type === "integration" ? this.getIntegrationProductById(t.integrationProductId) : this.getIntegrationProductFromExternalIds(t.externalIntegrationId, t.externalProductId);
|
@@ -16624,7 +16624,7 @@ function me(r, t, e) {
|
|
16624
16624
|
}
|
16625
16625
|
class Gl {
|
16626
16626
|
constructor(t, e) {
|
16627
|
-
this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets =
|
16627
|
+
this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets = An(this.updateFrameOffsets, 200), this.targetElements = [], this.onFrameDataChangeListeners = [], this.onZoomChangeListeners = [], this.forceImageCover = t, this.initialZoom = e, this.thresholdSettings = {
|
16628
16628
|
useThreshold: !1,
|
16629
16629
|
invertThreshold: !1,
|
16630
16630
|
threshold: 128,
|
@@ -16644,8 +16644,8 @@ class Gl {
|
|
16644
16644
|
if (n.currentFrameSources) {
|
16645
16645
|
let i = !1;
|
16646
16646
|
for (let s = 0; s < n.currentFrameSources.length; s++) {
|
16647
|
-
const o = n.currentFrameSources[s], l = await
|
16648
|
-
|
16647
|
+
const o = n.currentFrameSources[s], l = await Oe(o), c = this.frameData ? this.frameData[s] : void 0;
|
16648
|
+
dn(l, c) || (this.frameData || (this.frameData = new Array(n.currentFrameSources.length)), this.frameData[s] = l, i = !0);
|
16649
16649
|
}
|
16650
16650
|
i && (this.onFrameDataChangeListeners.forEach(
|
16651
16651
|
(s) => s(this.frameData)
|
@@ -16697,8 +16697,8 @@ class Gl {
|
|
16697
16697
|
getImageSrc() {
|
16698
16698
|
if (this.imageData) {
|
16699
16699
|
if (this.imageData.svg) {
|
16700
|
-
const t =
|
16701
|
-
return
|
16700
|
+
const t = Ca(this.imageData.svg, this.imageData.colors || {}, !1);
|
16701
|
+
return ha(t);
|
16702
16702
|
}
|
16703
16703
|
return this.imageData.src;
|
16704
16704
|
}
|
@@ -16834,7 +16834,7 @@ class Gl {
|
|
16834
16834
|
}
|
16835
16835
|
recalculateOffsets(t) {
|
16836
16836
|
this.frameData && ((!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length)), this.frameData.forEach((e, a) => {
|
16837
|
-
this.offsets[a] =
|
16837
|
+
this.offsets[a] = Ea(
|
16838
16838
|
t,
|
16839
16839
|
e,
|
16840
16840
|
this.initialZoom && !this.forceImageCover ? { scale: this.initialZoom } : void 0,
|
@@ -17050,7 +17050,7 @@ class ql extends Z {
|
|
17050
17050
|
* Returns `true` if the Background Remover is available for the current session.
|
17051
17051
|
*/
|
17052
17052
|
async canUseBackgroundRemover() {
|
17053
|
-
return this.manager.getClient().canUseAddon(
|
17053
|
+
return this.manager.getClient().canUseAddon(ua.BackgroundRemover);
|
17054
17054
|
}
|
17055
17055
|
/**
|
17056
17056
|
* Returns `true` if the Background Remover is available for the current session and if the associated frame has a user-supplied raster image.
|
@@ -17176,7 +17176,7 @@ const jl = w`
|
|
17176
17176
|
id
|
17177
17177
|
}
|
17178
17178
|
}
|
17179
|
-
`,
|
17179
|
+
`, Da = w`
|
17180
17180
|
query GetCustomerTransactions(
|
17181
17181
|
$id: String!
|
17182
17182
|
$limit: Int!
|
@@ -17343,7 +17343,7 @@ const jl = w`
|
|
17343
17343
|
},
|
17344
17344
|
context: t
|
17345
17345
|
}), Pd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17346
|
-
query:
|
17346
|
+
query: Da,
|
17347
17347
|
errorPolicy: "all",
|
17348
17348
|
fetchPolicy: "no-cache",
|
17349
17349
|
variables: {
|
@@ -17363,7 +17363,7 @@ const jl = w`
|
|
17363
17363
|
limit: t
|
17364
17364
|
}
|
17365
17365
|
}))?.data.customerTransactionsFeed?.items || [], Dd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17366
|
-
query:
|
17366
|
+
query: Da,
|
17367
17367
|
errorPolicy: "all",
|
17368
17368
|
fetchPolicy: "no-cache",
|
17369
17369
|
variables: {
|
@@ -17383,7 +17383,7 @@ const jl = w`
|
|
17383
17383
|
limit: t
|
17384
17384
|
}
|
17385
17385
|
}))?.data.customerTransactionsFeed?.items || [], Fd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17386
|
-
query:
|
17386
|
+
query: Da,
|
17387
17387
|
errorPolicy: "all",
|
17388
17388
|
fetchPolicy: "no-cache",
|
17389
17389
|
variables: {
|
@@ -17418,7 +17418,7 @@ const jl = w`
|
|
17418
17418
|
console.error("vite-plugin-css-injected-by-js", t);
|
17419
17419
|
}
|
17420
17420
|
})();
|
17421
|
-
var tc = /* @__PURE__ */ ((r) => (r.Manual = "Manual", r.OnStart = "OnStart", r.OnQuit = "OnQuit", r.OnEnd = "OnEnd", r))(tc || {}),
|
17421
|
+
var tc = /* @__PURE__ */ ((r) => (r.Manual = "Manual", r.OnStart = "OnStart", r.OnQuit = "OnQuit", r.OnEnd = "OnEnd", r))(tc || {}), Ce = /* @__PURE__ */ ((r) => (r.Email = "Email", r.FirstName = "FirstName", r.LastName = "LastName", r.Phone = "Phone", r.Apartment = "Apartment", r.City = "City", r.Country = "Country", r.OrganizationName = "OrganizationName", r.PostCode = "PostCode", r.State = "State", r.StreetAddress = "StreetAddress", r.Custom = "Custom", r))(Ce || {}), K;
|
17422
17422
|
K = { __e: function(r, t, e, a) {
|
17423
17423
|
for (var n, i, s; t = t.__; )
|
17424
17424
|
if ((n = t.__c) && !n.__)
|
@@ -17430,65 +17430,65 @@ K = { __e: function(r, t, e, a) {
|
|
17430
17430
|
}
|
17431
17431
|
throw r;
|
17432
17432
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
17433
|
-
var st,
|
17433
|
+
var st, Xe, tn, ir = [], Ze = [], en = K.__b, an = K.__r, nn = K.diffed, rn = K.__c, sn = K.unmount;
|
17434
17434
|
function ec() {
|
17435
17435
|
for (var r; r = ir.shift(); )
|
17436
17436
|
if (r.__P && r.__H)
|
17437
17437
|
try {
|
17438
|
-
r.__H.__h.forEach(
|
17438
|
+
r.__H.__h.forEach(we), r.__H.__h.forEach(da), r.__H.__h = [];
|
17439
17439
|
} catch (t) {
|
17440
17440
|
r.__H.__h = [], K.__e(t, r.__v);
|
17441
17441
|
}
|
17442
17442
|
}
|
17443
17443
|
K.__b = function(r) {
|
17444
|
-
st = null,
|
17444
|
+
st = null, en && en(r);
|
17445
17445
|
}, K.__r = function(r) {
|
17446
|
-
|
17446
|
+
an && an(r);
|
17447
17447
|
var t = (st = r.__c).__H;
|
17448
|
-
t && (
|
17449
|
-
e.__N && (e.__ = e.__N), e.__V =
|
17450
|
-
})) : (t.__h.forEach(
|
17448
|
+
t && (Xe === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
|
17449
|
+
e.__N && (e.__ = e.__N), e.__V = Ze, e.__N = e.i = void 0;
|
17450
|
+
})) : (t.__h.forEach(we), t.__h.forEach(da), t.__h = [])), Xe = st;
|
17451
17451
|
}, K.diffed = function(r) {
|
17452
|
-
|
17452
|
+
nn && nn(r);
|
17453
17453
|
var t = r.__c;
|
17454
|
-
t && t.__H && (t.__H.__h.length && (ir.push(t) !== 1 &&
|
17455
|
-
e.i && (e.__H = e.i), e.__V !==
|
17456
|
-
})),
|
17454
|
+
t && t.__H && (t.__H.__h.length && (ir.push(t) !== 1 && tn === K.requestAnimationFrame || ((tn = K.requestAnimationFrame) || ac)(ec)), t.__H.__.forEach(function(e) {
|
17455
|
+
e.i && (e.__H = e.i), e.__V !== Ze && (e.__ = e.__V), e.i = void 0, e.__V = Ze;
|
17456
|
+
})), Xe = st = null;
|
17457
17457
|
}, K.__c = function(r, t) {
|
17458
17458
|
t.some(function(e) {
|
17459
17459
|
try {
|
17460
|
-
e.__h.forEach(
|
17461
|
-
return !a.__ ||
|
17460
|
+
e.__h.forEach(we), e.__h = e.__h.filter(function(a) {
|
17461
|
+
return !a.__ || da(a);
|
17462
17462
|
});
|
17463
17463
|
} catch (a) {
|
17464
17464
|
t.some(function(n) {
|
17465
17465
|
n.__h && (n.__h = []);
|
17466
17466
|
}), t = [], K.__e(a, e.__v);
|
17467
17467
|
}
|
17468
|
-
}),
|
17468
|
+
}), rn && rn(r, t);
|
17469
17469
|
}, K.unmount = function(r) {
|
17470
|
-
|
17470
|
+
sn && sn(r);
|
17471
17471
|
var t, e = r.__c;
|
17472
17472
|
e && e.__H && (e.__H.__.forEach(function(a) {
|
17473
17473
|
try {
|
17474
|
-
|
17474
|
+
we(a);
|
17475
17475
|
} catch (n) {
|
17476
17476
|
t = n;
|
17477
17477
|
}
|
17478
17478
|
}), e.__H = void 0, t && K.__e(t, e.__v));
|
17479
17479
|
};
|
17480
|
-
var
|
17480
|
+
var on = typeof requestAnimationFrame == "function";
|
17481
17481
|
function ac(r) {
|
17482
17482
|
var t, e = function() {
|
17483
|
-
clearTimeout(a),
|
17483
|
+
clearTimeout(a), on && cancelAnimationFrame(t), setTimeout(r);
|
17484
17484
|
}, a = setTimeout(e, 100);
|
17485
|
-
|
17485
|
+
on && (t = requestAnimationFrame(e));
|
17486
17486
|
}
|
17487
|
-
function
|
17487
|
+
function we(r) {
|
17488
17488
|
var t = st, e = r.__c;
|
17489
17489
|
typeof e == "function" && (r.__c = void 0, e()), st = t;
|
17490
17490
|
}
|
17491
|
-
function
|
17491
|
+
function da(r) {
|
17492
17492
|
var t = st;
|
17493
17493
|
r.__c = r.__(), st = t;
|
17494
17494
|
}
|
@@ -17514,7 +17514,7 @@ const sr = w`
|
|
17514
17514
|
}
|
17515
17515
|
missingComponentTypes
|
17516
17516
|
}
|
17517
|
-
`,
|
17517
|
+
`, Fa = w`
|
17518
17518
|
${sr}
|
17519
17519
|
fragment AddressValidationJobFields on AddressValidationJob {
|
17520
17520
|
id
|
@@ -17527,14 +17527,14 @@ const sr = w`
|
|
17527
17527
|
}
|
17528
17528
|
}
|
17529
17529
|
`, nc = w`
|
17530
|
-
${
|
17530
|
+
${Fa}
|
17531
17531
|
query GetAddressValidationJobs($ids: [String!]!) {
|
17532
17532
|
addressValidationJobs(ids: $ids) {
|
17533
17533
|
...AddressValidationJobFields
|
17534
17534
|
}
|
17535
17535
|
}
|
17536
17536
|
`, rc = w`
|
17537
|
-
${
|
17537
|
+
${Fa}
|
17538
17538
|
query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
|
17539
17539
|
recipients(ids: $ids) {
|
17540
17540
|
id
|
@@ -17551,7 +17551,7 @@ const sr = w`
|
|
17551
17551
|
}
|
17552
17552
|
}
|
17553
17553
|
`, sc = w`
|
17554
|
-
${
|
17554
|
+
${Fa}
|
17555
17555
|
mutation BatchValidateRecipientAddress($ids: [String!]!) {
|
17556
17556
|
recipientValidateBatch(ids: $ids) {
|
17557
17557
|
...AddressValidationJobFields
|
@@ -17603,25 +17603,25 @@ const kd = async (r) => {
|
|
17603
17603
|
});
|
17604
17604
|
};
|
17605
17605
|
export {
|
17606
|
-
|
17606
|
+
ua as AddonHandle,
|
17607
17607
|
lc as AddressValidationJobStatus,
|
17608
17608
|
oc as AddressValidationResultConfirmationLevel,
|
17609
17609
|
ud as ArrayInput,
|
17610
17610
|
L as AspectType,
|
17611
17611
|
vt as AssetNotFoundError,
|
17612
|
-
|
17612
|
+
ye as AssetType,
|
17613
17613
|
id as BringForwardCommand,
|
17614
17614
|
rd as BringToBackCommand,
|
17615
17615
|
nd as BringToFrontCommand,
|
17616
17616
|
br as BundleDesignCreationCartAddMode,
|
17617
17617
|
N as CanvasCommand,
|
17618
17618
|
Ae as CollectionProduct,
|
17619
|
-
|
17619
|
+
_a as ColorOptionGlobalPropertyHandle,
|
17620
17620
|
ds as CommandContext,
|
17621
|
-
|
17621
|
+
Ce as ConversionDataType,
|
17622
17622
|
tc as ConversionLocation,
|
17623
17623
|
z as CreateElementCommand,
|
17624
|
-
|
17624
|
+
zn as CreateLayoutCommand,
|
17625
17625
|
Rl as CurrencyContext,
|
17626
17626
|
Ql as CurrencyService,
|
17627
17627
|
bt as DeleteElementCommand,
|
@@ -17633,41 +17633,41 @@ export {
|
|
17633
17633
|
ms as FontAlignmentCommand,
|
17634
17634
|
us as FontColorCommand,
|
17635
17635
|
hs as FontSizeCommand,
|
17636
|
-
|
17636
|
+
qa as FontSourceCommand,
|
17637
17637
|
Gl as FrameService,
|
17638
17638
|
Wl as FrameStep,
|
17639
17639
|
ql as FrameStepHandle,
|
17640
|
-
|
17640
|
+
Ia as GlobalPropertyHandle,
|
17641
17641
|
R as GroupCommand,
|
17642
17642
|
So as IllustrationStepHandle,
|
17643
|
-
|
17643
|
+
$e as InformationMessageType,
|
17644
17644
|
Do as InformationStepHandle,
|
17645
|
-
|
17645
|
+
Xa as IntegrationProduct,
|
17646
17646
|
Ir as IntegrationType,
|
17647
17647
|
Xc as LayoutElementFactory,
|
17648
17648
|
x as LayoutElementType,
|
17649
17649
|
Y as LayoutNotFoundError,
|
17650
17650
|
Ht as LayoutRenderingPurpose,
|
17651
17651
|
vo as MaterialStepHandle,
|
17652
|
-
|
17652
|
+
Ee as MisconfigurationError,
|
17653
17653
|
wd as MockWorkflowManager,
|
17654
17654
|
Eo as ModelStepHandle,
|
17655
17655
|
xo as ModuleStepHandle,
|
17656
17656
|
Zc as MoveCommand,
|
17657
|
-
|
17657
|
+
nr as ObjectInput,
|
17658
17658
|
Fl as ObjectInputType,
|
17659
|
-
|
17660
|
-
|
17659
|
+
tr as OptionGlobalPropertyHandle,
|
17660
|
+
ve as OptionNotFoundError,
|
17661
17661
|
Dt as ParseError,
|
17662
17662
|
bo as PictureStepHandle,
|
17663
17663
|
Pr as ProductCameraRig,
|
17664
|
-
|
17664
|
+
ar as ProductCollection,
|
17665
17665
|
Cl as ProductCollectionProductSortKey,
|
17666
17666
|
qt as ProductWorkflow,
|
17667
17667
|
Kt as PromiseCache,
|
17668
|
-
|
17668
|
+
kn as PromiseQueue,
|
17669
17669
|
Bo as QuestionStepHandle,
|
17670
|
-
|
17670
|
+
xn as QueueablePromise,
|
17671
17671
|
ed as ResizeCommand,
|
17672
17672
|
Yt as ResourceNotFoundError,
|
17673
17673
|
td as RotateCommand,
|
@@ -17676,7 +17676,7 @@ export {
|
|
17676
17676
|
Io as ShapeStepHandle,
|
17677
17677
|
Br as ShareActionType,
|
17678
17678
|
md as SpiffCommerceClient,
|
17679
|
-
|
17679
|
+
Se as StakeholderType,
|
17680
17680
|
Er as StepAspectType,
|
17681
17681
|
Z as StepHandle,
|
17682
17682
|
v as StepType,
|
@@ -17699,9 +17699,9 @@ export {
|
|
17699
17699
|
Ro as createDesign,
|
17700
17700
|
Hc as currentDirection,
|
17701
17701
|
Qc as dataUrlFromExternalUrl,
|
17702
|
-
|
17702
|
+
Ke as designService,
|
17703
17703
|
fe as determineCorrectFontSizeAndLines,
|
17704
|
-
|
17704
|
+
Wn as digitalContentStepService,
|
17705
17705
|
dt as domParser,
|
17706
17706
|
vd as duplicateBundle,
|
17707
17707
|
Ed as duplicateTransaction,
|
@@ -17716,14 +17716,14 @@ export {
|
|
17716
17716
|
ot as generateSVGWithUnknownColors,
|
17717
17717
|
cd as generateStateFromDesignInputSteps,
|
17718
17718
|
Md as getAddressValidationJobs,
|
17719
|
-
|
17719
|
+
Ne as getAttributesFromArrayBuffer,
|
17720
17720
|
Uc as getAxisAlignedBoundingBox,
|
17721
17721
|
zl as getBoundedOffsets,
|
17722
17722
|
fd as getBundleThemeConfiguration,
|
17723
17723
|
bd as getCustomer,
|
17724
17724
|
Bd as getCustomerBundles,
|
17725
17725
|
Yc as getElementVertices,
|
17726
|
-
|
17726
|
+
Oe as getFrameData,
|
17727
17727
|
od as getGlobalPropertyStateForBundle,
|
17728
17728
|
Vl as getIntegration,
|
17729
17729
|
qc as getNEPoint,
|
@@ -17733,7 +17733,7 @@ export {
|
|
17733
17733
|
Gc as getPointOfRotation,
|
17734
17734
|
dd as getProductCollections,
|
17735
17735
|
jc as getSEPoint,
|
17736
|
-
|
17736
|
+
Sa as getSvgElement,
|
17737
17737
|
xd as getTemplateBundles,
|
17738
17738
|
Fd as getTemplateTransactions,
|
17739
17739
|
gd as getTransaction,
|
@@ -17743,42 +17743,42 @@ export {
|
|
17743
17743
|
Pd as getUnorderedTransactions,
|
17744
17744
|
kd as getValidationJobsForWorkflowExperiences,
|
17745
17745
|
hd as getWorkflow,
|
17746
|
-
|
17746
|
+
rr as getWorkflows,
|
17747
17747
|
y as graphQlManager,
|
17748
17748
|
pe as illustrationStepService,
|
17749
17749
|
Vc as isCloseToValue,
|
17750
17750
|
Nt as loadFont,
|
17751
17751
|
Oc as matchHexToPms,
|
17752
|
-
|
17752
|
+
qn as materialStepService,
|
17753
17753
|
fl as metafieldManager,
|
17754
17754
|
Jc as mmPerPixel,
|
17755
|
-
|
17756
|
-
|
17757
|
-
|
17755
|
+
jn as modelStepService,
|
17756
|
+
Ca as modifySVGColors,
|
17757
|
+
Hn as moduleStepService,
|
17758
17758
|
yd as nameBundle,
|
17759
17759
|
Sd as nameTransaction,
|
17760
17760
|
H as optionService,
|
17761
17761
|
_c as outlineFontsInSvg,
|
17762
17762
|
ut as patternImageDataCache,
|
17763
17763
|
k as persistenceService,
|
17764
|
-
|
17764
|
+
Yn as pictureStepService,
|
17765
17765
|
Rc as pmsToRgb,
|
17766
|
-
|
17766
|
+
Jn as questionStepService,
|
17767
17767
|
Nc as registerFetchImplementation,
|
17768
17768
|
Tc as registerWindowImplementation,
|
17769
|
-
|
17769
|
+
Ga as rehydrateSerializedLayout,
|
17770
17770
|
_r as rgbToPms,
|
17771
17771
|
ce as rotateAroundPoint,
|
17772
|
-
|
17772
|
+
pa as sanitizeSvgTree,
|
17773
17773
|
zr as setBearerAuthenticationToken,
|
17774
|
-
|
17774
|
+
Cn as setCanvasModule,
|
17775
17775
|
zt as shapeStepService,
|
17776
17776
|
ws as shortenUrl,
|
17777
17777
|
gt as spiffCoreConfiguration,
|
17778
17778
|
ld as stepAspectValuesToDesignInputSteps,
|
17779
|
-
|
17780
|
-
|
17781
|
-
|
17779
|
+
$a as svgColorValueToDefinition,
|
17780
|
+
Ln as svgStringDimensions,
|
17781
|
+
ha as svgToDataUrl,
|
17782
17782
|
G as textStepService,
|
17783
17783
|
Fs as toast,
|
17784
17784
|
Td as validateWorkflowExperienceRecipient,
|